diff --git a/LeanPool.lean b/LeanPool.lean index 56cb3c4950..01aa8023e5 100644 --- a/LeanPool.lean +++ b/LeanPool.lean @@ -7543,6 +7543,7 @@ public import LeanPool.RootSystem.An public import LeanPool.RootSystem.BCn public import LeanPool.RungeKuttaOrderConditions public import LeanPool.RungeKuttaOrderConditions.ButcherOrder +public import LeanPool.RungeKuttaOrderConditions.CheckerExamples public import LeanPool.Rupert public import LeanPool.Rupert.Affine public import LeanPool.Rupert.Attr diff --git a/LeanPool/ABCExceptions.lean b/LeanPool/ABCExceptions.lean index 689e57d60b..738f03b780 100644 --- a/LeanPool/ABCExceptions.lean +++ b/LeanPool/ABCExceptions.lean @@ -23,7 +23,7 @@ Tags: number-theory, analytic-number-theory, abc-conjecture MSC: 11D75, 11N37 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/ABCExceptions/ForMathlib.lean b/LeanPool/ABCExceptions/ForMathlib.lean index a93a2a009f..1004b468cd 100644 --- a/LeanPool/ABCExceptions/ForMathlib.lean +++ b/LeanPool/ABCExceptions/ForMathlib.lean @@ -16,4 +16,4 @@ Import-only index for Mathlib-adjacent support files used by the ABC exceptions development. -/ -@[expose] public section +public section diff --git a/LeanPool/ABCExceptions/ForMathlib/Misc.lean b/LeanPool/ABCExceptions/ForMathlib/Misc.lean index e1c00ca19f..3610dfb53e 100644 --- a/LeanPool/ABCExceptions/ForMathlib/Misc.lean +++ b/LeanPool/ABCExceptions/ForMathlib/Misc.lean @@ -18,7 +18,7 @@ import Mathlib.Data.Nat.SuccPred # LeanPool.ABCExceptions.ForMathlib.Misc -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/ABCExceptions/ForMathlib/RingTheory.lean b/LeanPool/ABCExceptions/ForMathlib/RingTheory.lean index e0c63b379c..5468387390 100644 --- a/LeanPool/ABCExceptions/ForMathlib/RingTheory.lean +++ b/LeanPool/ABCExceptions/ForMathlib/RingTheory.lean @@ -15,4 +15,4 @@ Import-only index for ring-theoretic support files used by the ABC exceptions development. -/ -@[expose] public section +public section diff --git a/LeanPool/ABCExceptions/ForMathlib/RingTheory/Radical.lean b/LeanPool/ABCExceptions/ForMathlib/RingTheory/Radical.lean index cc7f32ed77..797721fe8a 100644 --- a/LeanPool/ABCExceptions/ForMathlib/RingTheory/Radical.lean +++ b/LeanPool/ABCExceptions/ForMathlib/RingTheory/Radical.lean @@ -15,7 +15,7 @@ import Mathlib.RingTheory.Radical.NatInt # LeanPool.ABCExceptions.ForMathlib.RingTheory.Radical -/ -@[expose] public section +public section namespace UniqueFactorizationMonoid diff --git a/LeanPool/ABCExceptions/Section2.lean b/LeanPool/ABCExceptions/Section2.lean index 356dfd301b..767e6a1188 100644 --- a/LeanPool/ABCExceptions/Section2.lean +++ b/LeanPool/ABCExceptions/Section2.lean @@ -21,7 +21,7 @@ import Mathlib.RingTheory.Radical.NatInt # LeanPool.ABCExceptions.Section2 -/ -@[expose] public section +public section open Finset UniqueFactorizationMonoid diff --git a/LeanPool/ABCExceptions/Section4.lean b/LeanPool/ABCExceptions/Section4.lean index be6fc50cf8..714cfec6f2 100644 --- a/LeanPool/ABCExceptions/Section4.lean +++ b/LeanPool/ABCExceptions/Section4.lean @@ -27,7 +27,7 @@ parts of the paper. -/ -@[expose] public section +public section noncomputable section @@ -257,6 +257,7 @@ lemma ThueBound.special_two (hd : 4 ≤ d) : end /-- We define `section4Sum i` to be `a i + b i + c i`. -/ +@[expose] def section4Sum (a b c : ℕ → ℝ) (i : ℕ) := a i + b i + c i local notation "s" => section4Sum a b c @@ -394,6 +395,7 @@ lemma bound_4_point_9_upper (hε : 0 < ε) (f : ℕ → ℝ) (h45 : Bound4Point5 linear_combination h45.lower + hε /-- Define `δₛ` to be the sum of the `δ_` values for `a, b, c`. -/ +@[expose] def deltaS (d : ℕ) (a b c : ℕ → ℝ) := δ_ d a + δ_ d b + δ_ d c local notation "δₛ" => deltaS d a b c diff --git a/LeanPool/ACMax.lean b/LeanPool/ACMax.lean index 6b89d10e10..765200de29 100644 --- a/LeanPool/ACMax.lean +++ b/LeanPool/ACMax.lean @@ -31,7 +31,7 @@ The statement decomposes into the equality clause (`algConn_completeBipartite_tw and the universal upper-bound clause (`algConn_le_two_of_card`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/AHL/AHLAmGm.lean b/LeanPool/ACMax/AHL/AHLAmGm.lean index 1fc5a30825..ca487409b5 100644 --- a/LeanPool/ACMax/AHL/AHLAmGm.lean +++ b/LeanPool/ACMax/AHL/AHLAmGm.lean @@ -37,7 +37,7 @@ average-degree walk-count lower bound. i.e. `Λ ≥ (D − n)/n = d_avg − 1`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/AHL/AHLMarginals.lean b/LeanPool/ACMax/AHL/AHLMarginals.lean index 8fcd012c9e..76545388ec 100644 --- a/LeanPool/ACMax/AHL/AHLMarginals.lean +++ b/LeanPool/ACMax/AHL/AHLMarginals.lean @@ -35,7 +35,7 @@ Throughout `hδ2 : ∀ v, 2 ≤ G.degree v`. A directed edge is the `(penultima walks is exactly `D = ∑ v, deg v` — the normalization the weighted AM–GM (W7) consumes. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/AHL/AHLStationary.lean b/LeanPool/ACMax/AHL/AHLStationary.lean index 7944a13112..f4e6c6159c 100644 --- a/LeanPool/ACMax/AHL/AHLStationary.lean +++ b/LeanPool/ACMax/AHL/AHLStationary.lean @@ -51,7 +51,7 @@ finsets with **no** `Dart`-to-walk bridge. (`Walk.penultimate_concat` is alread "penultimate of an extension" fiber fact needs no fresh lemma.) -/ -@[expose] public section +public section namespace ACMax @@ -168,7 +168,7 @@ omit [DecidableEq V] in /-- Unfolding of `nbWeight` on an explicit sigma constructor. -/ theorem nbWeight_mk {x v : V} (p : G.Walk x v) : nbWeight (⟨v, p⟩ : Σ w : V, G.Walk x w) = - ∏ j ∈ Finset.Ico 1 p.length, ((G.degree (p.getVert j) : ℝ) - 1)⁻¹ := rfl + ∏ j ∈ Finset.Ico 1 p.length, ((G.degree (p.getVert j) : ℝ) - 1)⁻¹ := by rfl omit [DecidableEq V] in /-- **The weight is `1` on short walks.** For a walk of length `≤ 1` the intermediate range @@ -216,7 +216,7 @@ theorem nbWeight_concat {x v t : V} (p : G.Walk x v) (hp : ¬ p.Nil) (h : G.Adj /-- The global sigma finset of all length-`k` non-backtracking walks, tagged by their start: an element `⟨x, ⟨v, p⟩⟩` is a length-`k` non-backtracking walk `p : G.Walk x v`. -/ -def nbAll (k : ℕ) : Finset (Σ x : V, Σ v : V, G.Walk x v) := +@[expose] def nbAll (k : ℕ) : Finset (Σ x : V, Σ v : V, G.Walk x v) := Finset.univ.sigma fun x => nbWalksFrom G x k /-- Membership in `nbAll`: `⟨x, ⟨v, p⟩⟩` lies in `nbAll k` iff `p` has length `k` and is @@ -230,18 +230,18 @@ theorem mem_nbAll {k : ℕ} {t : Σ x : V, Σ v : V, G.Walk x v} : /-- **The last-edge marginal** (AHL's `xP = x`, def only). The total weight of the length-`k` non-backtracking walks whose last directed edge is `(u, v)` — i.e. ending at `v` with penultimate `u`. Its value `1` (for `k ≥ 1`, `G.Adj u v`) is the stationarity identity proved in node W3. -/ -noncomputable def nbLastWeight (k : ℕ) (u v : V) : ℝ := +@[expose] noncomputable def nbLastWeight (k : ℕ) (u v : V) : ℝ := ∑ t ∈ (nbAll (G := G) k).filter (fun t => t.2.1 = v ∧ t.2.2.penultimate = u), nbWeight t.2 /-- **The end marginal** (def only). The total weight of the length-`k` non-backtracking walks ending at `v`; its value `deg v` (node W4) is the marginal of `nbLastWeight` over the neighbours of `v`. -/ -noncomputable def nbEndWeight (k : ℕ) (v : V) : ℝ := +@[expose] noncomputable def nbEndWeight (k : ℕ) (v : V) : ℝ := ∑ t ∈ (nbAll (G := G) k).filter (fun t => t.2.1 = v), nbWeight t.2 /-- **The total weight** (def only). The total weight of all length-`k` non-backtracking walks; its value `D = ∑ v, deg v` (node W5) is the normalization `∑_v nbEndWeight k v`. -/ -noncomputable def nbWeightTotal (k : ℕ) : ℝ := +@[expose] noncomputable def nbWeightTotal (k : ℕ) : ℝ := ∑ t ∈ nbAll (G := G) k, nbWeight t.2 end ACMax diff --git a/LeanPool/ACMax/AHL/NBWalk.lean b/LeanPool/ACMax/AHL/NBWalk.lean index 33ec2e7b6a..f05f46ff5f 100644 --- a/LeanPool/ACMax/AHL/NBWalk.lean +++ b/LeanPool/ACMax/AHL/NBWalk.lean @@ -42,7 +42,7 @@ The degree-weighted lower bound on the *number* of non-backtracking walks and th assembly into the Moore bound are the follow-up counting node; this file lands the foundation only. -/ -@[expose] public section +public section namespace ACMax @@ -51,7 +51,7 @@ open SimpleGraph /-- A walk is **non-backtracking** when it never immediately reverses a step: for every position `i` with `i + 2 ≤ w.length`, the vertex two steps ahead differs from the current one. (For `nil` and single-edge walks the condition is vacuous.) -/ -def IsNonBacktracking {V : Type*} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) : Prop := +@[expose] def IsNonBacktracking {V : Type*} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) : Prop := ∀ i : ℕ, i + 2 ≤ w.length → w.getVert (i + 2) ≠ w.getVert i /-- Any walk of length at most `1` (in particular `nil` and a single edge) is non-backtracking: diff --git a/LeanPool/ACMax/AHL/NBWalkCount.lean b/LeanPool/ACMax/AHL/NBWalkCount.lean index 286ea72bc2..ae5817f136 100644 --- a/LeanPool/ACMax/AHL/NBWalkCount.lean +++ b/LeanPool/ACMax/AHL/NBWalkCount.lean @@ -34,7 +34,7 @@ over `fun v => Finset (G.Walk x v)` is not type-correct — the fibers must be t endpoint first, which is exactly what `nbWalksFrom` does). -/ -@[expose] public section +public section namespace ACMax @@ -126,7 +126,7 @@ theorem card_nbWalksFrom [Fintype V] [DecidableEq V] [DecidableRel G.Adj] (x : V /-- The one-edge non-backtracking extensions of a bundled walk `s = ⟨u, p⟩`: for each neighbour `t` of `u` other than the penultimate vertex of `p`, the walk `p.concat _`. -/ -def nbExtend (G : SimpleGraph V) [Fintype V] [DecidableEq V] [DecidableRel G.Adj] (x : V) +@[expose] def nbExtend (G : SimpleGraph V) [Fintype V] [DecidableEq V] [DecidableRel G.Adj] (x : V) (s : Σ v : V, G.Walk x v) : Finset (Σ v : V, G.Walk x v) := (G.neighborFinset s.1 \ {s.2.penultimate}).image fun t => if h : G.Adj s.1 t then ⟨t, s.2.concat h⟩ else ⟨x, Walk.nil⟩ diff --git a/LeanPool/ACMax/AHL/NBWeighted.lean b/LeanPool/ACMax/AHL/NBWeighted.lean index 0780c763e1..cafa148bcc 100644 --- a/LeanPool/ACMax/AHL/NBWeighted.lean +++ b/LeanPool/ACMax/AHL/NBWeighted.lean @@ -18,7 +18,7 @@ Alon–Hoory–Linial irregular Moore bound chain; the walk-count and average-de it live downstream (`AHL.AHLAmGm`, `Band.Sum`). -/ -@[expose] public section +public section namespace ACMax @@ -28,7 +28,7 @@ variable {V : Type*} [Fintype V] {G : SimpleGraph V} [DecidableEq V] [DecidableR /-- `mₖ`: the total number of length-`k` non-backtracking walks, summed over all ordered start/end pairs. By definition this is `∑ x, ∑ v, ((G.finsetWalkLength k x v).filter …).card`. -/ -def nbTotalWalks (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ) : ℕ := +@[expose] def nbTotalWalks (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ) : ℕ := ∑ x : V, ∑ v : V, ((G.finsetWalkLength k x v).filter IsNonBacktracking).card end ACMax diff --git a/LeanPool/ACMax/Band/AssemblyAllRange.lean b/LeanPool/ACMax/Band/AssemblyAllRange.lean index 444e28782b..f2748d5765 100644 --- a/LeanPool/ACMax/Band/AssemblyAllRange.lean +++ b/LeanPool/ACMax/Band/AssemblyAllRange.lean @@ -19,7 +19,7 @@ This assembly replaces the split between the finite exact-Moore range and the polynomial large-order range by one exact non-backtracking certificate. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/CertAllRange.lean b/LeanPool/ACMax/Band/CertAllRange.lean index ded371c9ee..05d70f8a01 100644 --- a/LeanPool/ACMax/Band/CertAllRange.lean +++ b/LeanPool/ACMax/Band/CertAllRange.lean @@ -15,7 +15,7 @@ exponent at least eight, the fourth nonconstant term of the binomial expansion gives a uniform certificate with no upper bound on the order. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/CertUniform.lean b/LeanPool/ACMax/Band/CertUniform.lean index 65a3f709bd..21eaa613b9 100644 --- a/LeanPool/ACMax/Band/CertUniform.lean +++ b/LeanPool/ACMax/Band/CertUniform.lean @@ -27,7 +27,7 @@ terms and an exact chord identity for a cubic polynomial. This replaces the fiv ratio certificates formerly used by `Band.Assembly`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/Final.lean b/LeanPool/ACMax/Band/Final.lean index 65d987a13d..00679b2047 100644 --- a/LeanPool/ACMax/Band/Final.lean +++ b/LeanPool/ACMax/Band/Final.lean @@ -22,7 +22,7 @@ The second range combines the direct incidence-capacity proof on orders `48` and `49` is harmless. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/KillSharp.lean b/LeanPool/ACMax/Band/KillSharp.lean index 4a26792329..335bd1f644 100644 --- a/LeanPool/ACMax/Band/KillSharp.lean +++ b/LeanPool/ACMax/Band/KillSharp.lean @@ -25,7 +25,7 @@ longer needed: at the longer target the SUM disjunct alone covers every cell of `55 ≤ n ≤ 122` (the EDGE disjunct was load-bearing exactly on `77 ≤ n ≤ 81` at the old target). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/Rows.lean b/LeanPool/ACMax/Band/Rows.lean index 0c32b021fe..b698680da7 100644 --- a/LeanPool/ACMax/Band/Rows.lean +++ b/LeanPool/ACMax/Band/Rows.lean @@ -26,7 +26,7 @@ a degree-`3`-separated obstruction at `n ≥ 48`. Notation: Everything is `sorry`-free and axiom-clean (`[propext, Classical.choice, Quot.sound]`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/Subset.lean b/LeanPool/ACMax/Band/Subset.lean index 92828ad493..9fba5f4e73 100644 --- a/LeanPool/ACMax/Band/Subset.lean +++ b/LeanPool/ACMax/Band/Subset.lean @@ -42,7 +42,7 @@ verification. `3 ≤ k ≤ L` inside `S`, in the `ZMod k` cyclic-map form. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Band/Sum.lean b/LeanPool/ACMax/Band/Sum.lean index 7920318cab..870914c818 100644 --- a/LeanPool/ACMax/Band/Sum.lean +++ b/LeanPool/ACMax/Band/Sum.lean @@ -33,7 +33,7 @@ buying the extra half-level over the pair form `ahl_irregular_moore`. arithmetic instantiates at the extremal `V₉/2`-core. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/Cherry.lean b/LeanPool/ACMax/Counting/Cherry.lean index 4b0c486acc..cfd24a8954 100644 --- a/LeanPool/ACMax/Counting/Cherry.lean +++ b/LeanPool/ACMax/Counting/Cherry.lean @@ -46,7 +46,7 @@ cut, so any disjoint `3`-block `P` with `2·e(P,N) + leak(P) ≤ 7` closes. `Δ ≤ 4`, `e(M) = 2` regime for every `n ≥ 18`. -/ -@[expose] public section +public section namespace ACMax @@ -494,7 +494,7 @@ theorem residualCore_cherry (n : ℕ) (G : SimpleGraph (Fin n)) (h : ResidualCor open Classical in /-- The **cherry-touching hubs**: hubs adjacent to a cherry vertex. -/ -noncomputable def cherryHubs (G : SimpleGraph V) (x z y : V) : Finset V := +@[expose] noncomputable def cherryHubs (G : SimpleGraph V) (x z y : V) : Finset V := (hubSet G).filter (fun w => G.Adj w z ∨ G.Adj w x ∨ G.Adj w y) open Classical in @@ -610,7 +610,7 @@ theorem mem_richLowHubs {G : SimpleGraph V} {w : V} : open Classical in /-- The **bad neighbours** of an apex `t` against a cherry: neighbours of degree `≥ 5` or touching the cherry — the vertices that block the SingleVertex pair selection. -/ -noncomputable def badApexNbrs (G : SimpleGraph V) (x z y t : V) : Finset V := +@[expose] noncomputable def badApexNbrs (G : SimpleGraph V) (x z y t : V) : Finset V := (G.neighborFinset t).filter (fun w => 5 ≤ G.degree w ∨ w ∈ cherryHubs G x z y) open Classical in @@ -753,7 +753,7 @@ private theorem mem_hubTwins {G : SimpleGraph V} {g t : V} : open Classical in /-- The **iso-twin neighbours** of a hub, as a pinned `def` so that its instances stay stable across the `Fin n` / generic-`V` boundary. -/ -noncomputable def isoNbrs (G : SimpleGraph V) (g : V) : Finset V := +@[expose] noncomputable def isoNbrs (G : SimpleGraph V) (g : V) : Finset V := G.neighborFinset g ∩ isoTwins G open Classical in diff --git a/LeanPool/ACMax/Counting/CherryMShape.lean b/LeanPool/ACMax/Counting/CherryMShape.lean index e6fef0fdeb..df139f8a0a 100644 --- a/LeanPool/ACMax/Counting/CherryMShape.lean +++ b/LeanPool/ACMax/Counting/CherryMShape.lean @@ -44,7 +44,7 @@ with every other degree-3 vertex an iso twin. `Δ ≥ 5` ("fat") side of `ResidualCore` remains open. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/CompactCell.lean b/LeanPool/ACMax/Counting/CompactCell.lean index 731703a8fe..5c098fd1e6 100644 --- a/LeanPool/ACMax/Counting/CompactCell.lean +++ b/LeanPool/ACMax/Counting/CompactCell.lean @@ -37,7 +37,7 @@ degree excess. the large-order reduction. The full theorem is assembled in `Band.Final`. -/ -@[expose] public section +public section namespace ACMax @@ -51,7 +51,7 @@ open Classical in /-- The **slot value function** `σ(d) = (d−3)/(d−2)`: the per-slot worst-case surplus of a degree-`d` neighbour used as a leak carrier. `σ(3) = 0`, `σ(4) = 1/2`, `σ(5) = 2/3`, `σ(6) = 3/4`, `σ → 1`. -/ -noncomputable def sigma (d : ℕ) : ℝ := ((d : ℝ) - 3) / ((d : ℝ) - 2) +@[expose] noncomputable def sigma (d : ℕ) : ℝ := ((d : ℝ) - 3) / ((d : ℝ) - 2) open Classical in /-- The **mass factor** `c_u = 1 + Σ_{w∈N(u)} 1/(deg w − 2)`. -/ @@ -60,7 +60,7 @@ noncomputable def cW (G : SimpleGraph V) (u : V) : ℝ := open Classical in /-- The **`σ`-sum** `Σσ_u = Σ_{w∈N(u)} σ(deg w)`. -/ -noncomputable def sigS (G : SimpleGraph V) (u : V) : ℝ := +@[expose] noncomputable def sigS (G : SimpleGraph V) (u : V) : ℝ := ∑ w ∈ G.neighborFinset u, sigma (G.degree w) /-! ### `σ` arithmetic (`L-FB-2` real-valued facts) -/ @@ -398,7 +398,7 @@ open Classical in each of which is `σ`-usable. This is the exact *spread* witness: present on every diameter-`≥ 4` "buried" world and absent on every diameter-`3` compact cell inhabitant. -/ -def HasUsableFarPair (G : SimpleGraph V) : Prop := +@[expose] def HasUsableFarPair (G : SimpleGraph V) : Prop := ∃ u v : V, u ≠ v ∧ ¬G.Adj u v ∧ (∀ w : V, ¬(G.Adj u w ∧ G.Adj v w)) ∧ (∀ w w' : V, G.Adj u w → G.Adj v w' → ¬G.Adj w w') ∧ sigS G u ≤ 2 ∧ sigS G v ≤ 2 @@ -542,13 +542,13 @@ variable {n : ℕ} open Classical in /-- The **total degree excess** `X = ∑_{deg v ≥ 5} (deg v − 4)` (ℕ-valued; the truncated subtraction is exact since every summand has degree ≥ 5). -/ -noncomputable def excessX (n : ℕ) (G : SimpleGraph (Fin n)) : ℕ := +@[expose] noncomputable def excessX (n : ℕ) (G : SimpleGraph (Fin n)) : ℕ := ∑ v ∈ Finset.univ.filter (fun v => 5 ≤ G.degree v), (G.degree v - 4) open Classical in /-- The **radius-3 combinatorial ball** around `u₀`: `u₀` together with its neighbours, second neighbours, and third neighbours. -/ -noncomputable def closeSet (G : SimpleGraph (Fin n)) (u₀ : Fin n) : Finset (Fin n) := +@[expose] noncomputable def closeSet (G : SimpleGraph (Fin n)) (u₀ : Fin n) : Finset (Fin n) := insert u₀ (G.neighborFinset u₀ ∪ (G.neighborFinset u₀).biUnion (fun w => G.neighborFinset w) ∪ ((G.neighborFinset u₀).biUnion (fun w => G.neighborFinset w)).biUnion @@ -875,6 +875,6 @@ cover `53 + 6·C₀` (the disjoint-slot 6X covering: heavy counts are dominated by their own excess pools) when a light usable vertex exists; the second arm `199990` dominates both the all-usable-heavy case (`n + 8 ≤ 5·29877`) and the hoarding wall (`199985 = 6·33322 + 53`). -/ -def boundLin (C₀ : ℕ) : ℕ := max ((151 + 11 * C₀) / 2) 520 +@[expose] def boundLin (C₀ : ℕ) : ℕ := max ((151 + 11 * C₀) / 2) 520 end ACMax diff --git a/LeanPool/ACMax/Counting/CompactLedgers.lean b/LeanPool/ACMax/Counting/CompactLedgers.lean index 8079dfb0ce..f469daf351 100644 --- a/LeanPool/ACMax/Counting/CompactLedgers.lean +++ b/LeanPool/ACMax/Counting/CompactLedgers.lean @@ -51,7 +51,7 @@ same-count hubs with zero internal degree, zero `mCross` and no adjacency shares shared twins would assemble a good `K_{2,3}` (`Σ₅deg = 21`), contradicting `no_good_K23` (`no_two_saturated_deg6`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/DecoratedC4.lean b/LeanPool/ACMax/Counting/DecoratedC4.lean index a88f682298..82b99dc99b 100644 --- a/LeanPool/ACMax/Counting/DecoratedC4.lean +++ b/LeanPool/ACMax/Counting/DecoratedC4.lean @@ -16,7 +16,7 @@ The four-cycle itself misses the order-15 cut inequality by one edge; adjoining one parent, or two adjacent parents, supplies exactly the missing slack. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/DoubleStar.lean b/LeanPool/ACMax/Counting/DoubleStar.lean index 0ace5c8087..702f316e37 100644 --- a/LeanPool/ACMax/Counting/DoubleStar.lean +++ b/LeanPool/ACMax/Counting/DoubleStar.lean @@ -45,7 +45,7 @@ private to it / shared with `h`), `intDeg g` (non-degree-3 neighbours of `g`), master arithmetic, used in the rich-sea regime. -/ -@[expose] public section +public section namespace ACMax @@ -55,7 +55,7 @@ variable {V : Type*} [Fintype V] open Classical in /-- The degree-3 set `D`. -/ -noncomputable def deg3Set (G : SimpleGraph V) : Finset V := +@[expose] noncomputable def deg3Set (G : SimpleGraph V) : Finset V := Finset.univ.filter (fun v => G.degree v = 3) open Classical in @@ -65,41 +65,41 @@ theorem mem_deg3Set {G : SimpleGraph V} {v : V} : v ∈ deg3Set G ↔ G.degree v open Classical in /-- The degree-3 twins of a hub: `D3(g) = N(g) ∩ D`. -/ -noncomputable def hubTwins (G : SimpleGraph V) (g : V) : Finset V := +@[expose] noncomputable def hubTwins (G : SimpleGraph V) (g : V) : Finset V := G.neighborFinset g ∩ deg3Set G open Classical in /-- The **private** twins of `g` against `h`: `D3(g) \ D3(h)` — the `P`-side block body of the double open star. -/ -noncomputable def privTwins (G : SimpleGraph V) (g h : V) : Finset V := +@[expose] noncomputable def privTwins (G : SimpleGraph V) (g h : V) : Finset V := hubTwins G g \ hubTwins G h open Classical in /-- The **shared** twins `s(g,h) = D3(g) ∩ D3(h)`. -/ -noncomputable def sharedTwins (G : SimpleGraph V) (g h : V) : Finset V := +@[expose] noncomputable def sharedTwins (G : SimpleGraph V) (g h : V) : Finset V := hubTwins G g ∩ hubTwins G h open Classical in /-- The **internal degree** `i(g) = deg g − |D3(g)|` — the number of non-degree-3 neighbours (the design's `intdeg`). -/ -noncomputable def intDeg (G : SimpleGraph V) (g : V) : ℕ := +@[expose] noncomputable def intDeg (G : SimpleGraph V) (g : V) : ℕ := (G.neighborFinset g \ deg3Set G).card open Classical in /-- The **`M`-cross count**: the number of edges between the two private sides (each such edge is a `D`–`D` edge, i.e. an `M`-edge; in the residual world `e(M) ≤ 1` forces `mCross ≤ 1`, so this count coincides with the design's `[M-cross]` indicator). -/ -noncomputable def mCross (G : SimpleGraph V) (g h : V) : ℕ := +@[expose] noncomputable def mCross (G : SimpleGraph V) (g h : V) : ℕ := ∑ t ∈ privTwins G g h, (G.neighborFinset t ∩ privTwins G h g).card open Classical in /-- The adjacency indicator `[g ~ h]`. -/ -noncomputable def adjInd (G : SimpleGraph V) (g h : V) : ℕ := +@[expose] noncomputable def adjInd (G : SimpleGraph V) (g h : V) : ℕ := if G.Adj g h then 1 else 0 open Classical in /-- The `D`–`D` incidence sum `∑_{v∈D} |N(v) ∩ D| = 2·e(M)`. -/ -noncomputable def mIncidence (G : SimpleGraph V) : ℕ := +@[expose] noncomputable def mIncidence (G : SimpleGraph V) : ℕ := ∑ v ∈ deg3Set G, (G.neighborFinset v ∩ deg3Set G).card /-! ### Vocabulary lemmas -/ @@ -417,12 +417,12 @@ no-`M`-edge worlds, and the `SeaFatBoundary` resource gate. -/ open Classical in /-- **C0 — the cherry world**: `e(M) ≥ 2` (incidence form). Routed to the per-`n` cherry constructions (SingleVertex / TwoTwin / HubTriangle). -/ -def CaseCherry (G : SimpleGraph V) : Prop := 4 ≤ mIncidence G +@[expose] def CaseCherry (G : SimpleGraph V) : Prop := 4 ≤ mIncidence G open Classical in /-- **C5 — the `e(M) = 0` world.** Closing counting: NEEDS-NEW-COUNTING (L5.7; the MaxHub-style extremal counting survives only `n ≤ 20`). -/ -def CaseMZero (G : SimpleGraph V) : Prop := mIncidence G = 0 +@[expose] def CaseMZero (G : SimpleGraph V) : Prop := mIncidence G = 0 open Classical in /-- The `e(M)` **dispatch gate**: the `D`–`D` incidence sum is even (each `M`-edge is @@ -438,7 +438,7 @@ theorem eM_trichotomy (G : SimpleGraph V) : open Classical in /-- **The DS value of a hub pair** — the design's master-arithmetic left-hand side, with the gap in `ℕ`-symmetric form `(p_g − p_h) + (p_h − p_g) = |p_g − p_h|`. -/ -noncomputable def dsValue (G : SimpleGraph V) (g h : V) : ℕ := +@[expose] noncomputable def dsValue (G : SimpleGraph V) (g h : V) : ℕ := ((privTwins G g h).card - (privTwins G h g).card) + ((privTwins G h g).card - (privTwins G g h).card) + intDeg G g + intDeg G h + 2 * (sharedTwins G g h).card @@ -448,7 +448,7 @@ open Classical in /-- **C2 — the ¬W1-resource boundary predicate** (design §2a): every hub pair is DS-blocked (`value ≥ 5`). The output of the (open) C2 resource LP: `≤ 1` clean deg-4 hub, `O(√n)` unburied hubs, `e_H ≥ (3/2)(|Hub| − O(√n))` — NEEDS-C2-COUNTING. -/ -def SeaFatBoundary (G : SimpleGraph V) : Prop := +@[expose] def SeaFatBoundary (G : SimpleGraph V) : Prop := ∀ g h : V, 4 ≤ G.degree g → 4 ≤ G.degree h → g ≠ h → 5 ≤ dsValue G g h open Classical in @@ -514,7 +514,7 @@ theorem classical_sdiff_eq {α : Type*} [inst : DecidableEq α] (s t : Finset α open Classical in /-- The hub set: vertices of degree `≥ 4`. -/ -noncomputable def hubSet (G : SimpleGraph V) : Finset V := +@[expose] noncomputable def hubSet (G : SimpleGraph V) : Finset V := Finset.univ.filter (fun v => 4 ≤ G.degree v) open Classical in diff --git a/LeanPool/ACMax/Counting/FarPair.lean b/LeanPool/ACMax/Counting/FarPair.lean index 6498f2d209..90b3a4f77e 100644 --- a/LeanPool/ACMax/Counting/FarPair.lean +++ b/LeanPool/ACMax/Counting/FarPair.lean @@ -45,7 +45,7 @@ All three are direct instances of `algConn_le_two_of_testvector`; no new spectra machinery is introduced. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/HeavyClass.lean b/LeanPool/ACMax/Counting/HeavyClass.lean index 95fcbb7875..560c318ef2 100644 --- a/LeanPool/ACMax/Counting/HeavyClass.lean +++ b/LeanPool/ACMax/Counting/HeavyClass.lean @@ -16,7 +16,7 @@ development; this neutral module keeps the active proof independent of that historical assembly. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/HubCross.lean b/LeanPool/ACMax/Counting/HubCross.lean index 4012557cf0..4189c3920c 100644 --- a/LeanPool/ACMax/Counting/HubCross.lean +++ b/LeanPool/ACMax/Counting/HubCross.lean @@ -42,7 +42,7 @@ with the rigidity of the twin population it controls. bipartite incidence counts feeding the hub-cross coverage argument. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/Incidence.lean b/LeanPool/ACMax/Counting/Incidence.lean index b5fba7e604..016823a166 100644 --- a/LeanPool/ACMax/Counting/Incidence.lean +++ b/LeanPool/ACMax/Counting/Incidence.lean @@ -10,7 +10,7 @@ public import Mathlib.Algebra.Order.BigOperators.Group.Finset /-! # Incidence counts in finite simple graphs -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/LargeN.lean b/LeanPool/ACMax/Counting/LargeN.lean index 5c75c59a9f..3aac2691f2 100644 --- a/LeanPool/ACMax/Counting/LargeN.lean +++ b/LeanPool/ACMax/Counting/LargeN.lean @@ -50,7 +50,7 @@ the hub-cross law, bound the cloud by the apex-tie law, and sharpen the constant hubs with a positive private-twin gap is non-adjacent (adjacency already costs `1 + 1 + 1 + 2 = 5 > 4`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/MEdgeSparse.lean b/LeanPool/ACMax/Counting/MEdgeSparse.lean index 5b2c0afc93..a3d80cee37 100644 --- a/LeanPool/ACMax/Counting/MEdgeSparse.lean +++ b/LeanPool/ACMax/Counting/MEdgeSparse.lean @@ -19,7 +19,7 @@ and bulk incidence ledgers would then force `2 * n + 2 ≤ 5 * |F|`, which is impossible from order ten onward. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/MoatSharp.lean b/LeanPool/ACMax/Counting/MoatSharp.lean index d9e072a66d..b95dd792c8 100644 --- a/LeanPool/ACMax/Counting/MoatSharp.lean +++ b/LeanPool/ACMax/Counting/MoatSharp.lean @@ -33,7 +33,7 @@ Everything else — the slice bound, the moat cap `|F| ≤ Σ_{S₁}(deg − 2)` verbatim `master_cycle_fires`; only the ledger and the threshold change. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/Moats.lean b/LeanPool/ACMax/Counting/Moats.lean index 5e16f6178e..08ef10eff0 100644 --- a/LeanPool/ACMax/Counting/Moats.lean +++ b/LeanPool/ACMax/Counting/Moats.lean @@ -47,7 +47,7 @@ any root set `T`; combined with `total_excess_eq` and a multiplicity cap multiplicity is unbounded); the clean instances are `thin_twin_exists_deg5` (`K = 5` when `Δ ≤ 5`) and `thin_twin_exists_iso_of_multcap` (on `isoTwins G`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/PoorCorner.lean b/LeanPool/ACMax/Counting/PoorCorner.lean index f9475fe31d..a17b1903b0 100644 --- a/LeanPool/ACMax/Counting/PoorCorner.lean +++ b/LeanPool/ACMax/Counting/PoorCorner.lean @@ -46,7 +46,7 @@ bounds algebraic connectivity by `2`. assembled from the three results above. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/Quotient.lean b/LeanPool/ACMax/Counting/Quotient.lean index 7de5b8a397..befb6828c9 100644 --- a/LeanPool/ACMax/Counting/Quotient.lean +++ b/LeanPool/ACMax/Counting/Quotient.lean @@ -37,7 +37,7 @@ edge counts, exactly what the campaign's counting machinery produces. quotient data of the degree partition `{3}/{4}/{≥5}` in ledger terms. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/ResidualInterface.lean b/LeanPool/ACMax/Counting/ResidualInterface.lean index 7049a5e448..4157acaf3d 100644 --- a/LeanPool/ACMax/Counting/ResidualInterface.lean +++ b/LeanPool/ACMax/Counting/ResidualInterface.lean @@ -37,7 +37,7 @@ vertices. set and the twin incidence total is `3·|Iso|`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/SigmaCloud.lean b/LeanPool/ACMax/Counting/SigmaCloud.lean index 7363b42fe5..f9bb6af615 100644 --- a/LeanPool/ACMax/Counting/SigmaCloud.lean +++ b/LeanPool/ACMax/Counting/SigmaCloud.lean @@ -39,7 +39,7 @@ on the one cloud class (`W₅ᵇ`) that obstructs it. All certificates use the `n ≥ 512`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/SmallDegreeThreeCore.lean b/LeanPool/ACMax/Counting/SmallDegreeThreeCore.lean index a56a2cd402..c453ded5bb 100644 --- a/LeanPool/ACMax/Counting/SmallDegreeThreeCore.lean +++ b/LeanPool/ACMax/Counting/SmallDegreeThreeCore.lean @@ -18,7 +18,7 @@ good-triangle certificate; if the core is triangle-free, the standard small-degree lemma supplies an induced `2K₂`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/SparseCore.lean b/LeanPool/ACMax/Counting/SparseCore.lean index ec24cfd175..30963d2bc0 100644 --- a/LeanPool/ACMax/Counting/SparseCore.lean +++ b/LeanPool/ACMax/Counting/SparseCore.lean @@ -19,7 +19,7 @@ always deleting a vertex with at least three external neighbors. The surviving set has external degree at most two at every vertex. -/ -@[expose] public section +public section namespace ACMax @@ -45,7 +45,7 @@ theorem neighbor_sdiff_card_add_le_degree {n : ℕ} (G : SimpleGraph (Fin n)) open Classical in /-- The number of ordered adjacent pairs contained in `S`. -/ -def internalPairCount {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : ℕ := +@[expose] def internalPairCount {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : ℕ := ((S ×ˢ S).filter (fun p => G.Adj p.1 p.2)).card open Classical in diff --git a/LeanPool/ACMax/Counting/SqrtGirth.lean b/LeanPool/ACMax/Counting/SqrtGirth.lean index bf5bddab3c..5918676330 100644 --- a/LeanPool/ACMax/Counting/SqrtGirth.lean +++ b/LeanPool/ACMax/Counting/SqrtGirth.lean @@ -40,7 +40,7 @@ engine is a BFS ball-excess count in a graph with no cycle of length `≤ 2r + 1 `two_core_of_excess` (`degWithin`, `edgeSumWithin`). -/ -@[expose] public section +public section namespace ACMax @@ -710,7 +710,7 @@ variable {V : Type*} /-- The number of neighbours of `v` lying inside the finite set `S` — the degree of `v` in the induced subgraph `G.induce ↑S`. -/ -def degWithin (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) (v : V) : ℕ := +@[expose] def degWithin (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) (v : V) : ℕ := (S.filter (fun w => G.Adj v w)).card /-- Twice the number of edges of `G` with both endpoints in `S`, written as the within-`S` diff --git a/LeanPool/ACMax/Counting/StarForcing.lean b/LeanPool/ACMax/Counting/StarForcing.lean index ecb00673b9..2773f66c65 100644 --- a/LeanPool/ACMax/Counting/StarForcing.lean +++ b/LeanPool/ACMax/Counting/StarForcing.lean @@ -18,7 +18,7 @@ forces a degree-four vertex with at least two degree-three neighbors whenever th is at most `31`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/StarMoatSharp.lean b/LeanPool/ACMax/Counting/StarMoatSharp.lean index e1184bfc8e..1779523c14 100644 --- a/LeanPool/ACMax/Counting/StarMoatSharp.lean +++ b/LeanPool/ACMax/Counting/StarMoatSharp.lean @@ -40,7 +40,7 @@ remaining orders `10 ≤ n ≤ 15` have rigid excess profiles; the same ledgers, triangle and decorated-`C₄` certificates at the tight corners, close them directly. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/StarNeighbors.lean b/LeanPool/ACMax/Counting/StarNeighbors.lean index 36258baa77..c7bbd8d221 100644 --- a/LeanPool/ACMax/Counting/StarNeighbors.lean +++ b/LeanPool/ACMax/Counting/StarNeighbors.lean @@ -10,7 +10,7 @@ public import Mathlib.Algebra.Order.BigOperators.Group.Finset /-! # External degrees in three-vertex stars -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/StarvedCensus.lean b/LeanPool/ACMax/Counting/StarvedCensus.lean index 952e92ea48..9f9aba2b1c 100644 --- a/LeanPool/ACMax/Counting/StarvedCensus.lean +++ b/LeanPool/ACMax/Counting/StarvedCensus.lean @@ -41,7 +41,7 @@ feeding the caps into the twin-incidence total against the degree-excess ledger `9·(deg u + deg v) ≤ n + 56`) discharging the last moat-provenance hypothesis. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/TripleCensus.lean b/LeanPool/ACMax/Counting/TripleCensus.lean index 23fcec8cdf..89a79fb520 100644 --- a/LeanPool/ACMax/Counting/TripleCensus.lean +++ b/LeanPool/ACMax/Counting/TripleCensus.lean @@ -20,7 +20,7 @@ incidences land in three two-vertex groups. If too few pairs are repeated inside the groups and across the first group, the six columns cannot exist. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/V9Discharge.lean b/LeanPool/ACMax/Counting/V9Discharge.lean index 0078fc3cde..048625388a 100644 --- a/LeanPool/ACMax/Counting/V9Discharge.lean +++ b/LeanPool/ACMax/Counting/V9Discharge.lean @@ -45,7 +45,7 @@ twins turns the honest excess into `t₉ = n − 4 − X − 3h = Θ(n)` (`X = e `GirthExcessBound`) and a `119`-fold giant credit in `heavy_full_budget`. -/ -@[expose] public section +public section namespace ACMax @@ -67,7 +67,7 @@ theorem mem_v9Set {n : ℕ} {G : SimpleGraph (Fin n)} {v : Fin n} : open Classical in /-- **Ordered adjacent pairs within `V₉`** (twice the number of internal tier-9 edges); `2·|V₉| < v9Pairs G` is the density row "average tier-9 degree `> 2`". -/ -noncomputable def v9Pairs {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := +@[expose] noncomputable def v9Pairs {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := ((v9Set G ×ˢ v9Set G).filter (fun q => G.Adj q.1 q.2)).card open Classical in @@ -172,7 +172,7 @@ inequality after discarding the `|S|(2r+1)` ball term, weakening the level floor import-free floor from `n ≥ 1071` to `n ≥ 379`. Threaded through intermediate bounds and discharged by `girth_excess_bound_holds` below. The separate AHL strength reaches further down the band. -/ -def GirthExcessBound (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := +@[expose] def GirthExcessBound (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := ∀ (S : Finset (Fin n)) (t r : ℕ), S.Nonempty → 1 ≤ t → 1 ≤ r → 2 * S.card + 2 * t ≤ ((S ×ˢ S).filter (fun q => G.Adj q.1 q.2)).card → S.card ^ 2 < S.card * (2 * r + 1) + t * (3 * r ^ 2 - r) → diff --git a/LeanPool/ACMax/Counting/V9DischargeSharp.lean b/LeanPool/ACMax/Counting/V9DischargeSharp.lean index 0710d58b13..19654df410 100644 --- a/LeanPool/ACMax/Counting/V9DischargeSharp.lean +++ b/LeanPool/ACMax/Counting/V9DischargeSharp.lean @@ -35,7 +35,7 @@ so its minimum sits at `17H = 4N − 200`; there `4913·gap − cubic` splits *e three manifestly non-negative products, and `strip_cubic_sharp` closes. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/Windows.lean b/LeanPool/ACMax/Counting/Windows.lean index 1bf38b134c..a144b21d0a 100644 --- a/LeanPool/ACMax/Counting/Windows.lean +++ b/LeanPool/ACMax/Counting/Windows.lean @@ -39,7 +39,7 @@ present ⟹ the sparse-core moat fires; absent ⟹ the shared-hub stars are forc hypothesis (negating `Z1` starves the degree-4 hubs and the incidence total forces `n ≥ 32`). The same star moat fires throughout this range by `z1_fires_sharp`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Counting/XBoundAssembly.lean b/LeanPool/ACMax/Counting/XBoundAssembly.lean index e7f2d48caa..27bef7368a 100644 --- a/LeanPool/ACMax/Counting/XBoundAssembly.lean +++ b/LeanPool/ACMax/Counting/XBoundAssembly.lean @@ -24,7 +24,7 @@ linearly in the number of *usable* (unsuppressed, `sigS ≤ 2`) degree-3 vertice (`compact_covering_eleven_halves`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/Disconnected.lean b/LeanPool/ACMax/Cuts/Disconnected.lean index 4ed5dbcbe9..7b02e68ace 100644 --- a/LeanPool/ACMax/Cuts/Disconnected.lean +++ b/LeanPool/ACMax/Cuts/Disconnected.lean @@ -16,7 +16,7 @@ then the cut is empty, so the weighted-cut certificate gives `algConn G ≤ 2` ( `algConn G = 0`). This handles disconnected graphs uniformly for every `n`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/GoodC4.lean b/LeanPool/ACMax/Cuts/GoodC4.lean index 8adb1064ff..19546ec854 100644 --- a/LeanPool/ACMax/Cuts/GoodC4.lean +++ b/LeanPool/ACMax/Cuts/GoodC4.lean @@ -19,7 +19,7 @@ cut value is `∑ deg − 8`, and the weighted-cut inequality `n · (∑deg − applies in the no-`2K₂` regime where the induced-`2K₂` method fails. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/GoodK23.lean b/LeanPool/ACMax/Cuts/GoodK23.lean index 287c22124f..897f318e1d 100644 --- a/LeanPool/ACMax/Cuts/GoodK23.lean +++ b/LeanPool/ACMax/Cuts/GoodK23.lean @@ -22,7 +22,7 @@ with two degree-4 vertices on the small side has `C₄`s of degree-sum `14 > 13` yet the denser 5-vertex set still yields `cut = 5`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/GoodTriangle.lean b/LeanPool/ACMax/Cuts/GoodTriangle.lean index 5babddce54..e1dea7b944 100644 --- a/LeanPool/ACMax/Cuts/GoodTriangle.lean +++ b/LeanPool/ACMax/Cuts/GoodTriangle.lean @@ -15,7 +15,7 @@ usual weighted cut vector therefore certifies algebraic connectivity at most two whenever that boundary satisfies the corresponding cut inequality. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/Ind2K2.lean b/LeanPool/ACMax/Cuts/Ind2K2.lean index 6c7641025c..e0a1bbc196 100644 --- a/LeanPool/ACMax/Cuts/Ind2K2.lean +++ b/LeanPool/ACMax/Cuts/Ind2K2.lean @@ -28,7 +28,7 @@ tight (`degsum = 12`), which is exactly what certifies the `n = 9` Fiedler-eigen graphs that no `±1` cut can. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/LowDegreeVertex.lean b/LeanPool/ACMax/Cuts/LowDegreeVertex.lean index 7ff5cfd29e..d576bb4844 100644 --- a/LeanPool/ACMax/Cuts/LowDegreeVertex.lean +++ b/LeanPool/ACMax/Cuts/LowDegreeVertex.lean @@ -30,7 +30,7 @@ forces a vertex of degree `≤ 2`. The open core is exactly the graphs with min degree `≥ 3` (possible only for `n ≥ 8`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/SignedCut.lean b/LeanPool/ACMax/Cuts/SignedCut.lean index 13e1e873dc..f8e5eb390c 100644 --- a/LeanPool/ACMax/Cuts/SignedCut.lean +++ b/LeanPool/ACMax/Cuts/SignedCut.lean @@ -32,7 +32,7 @@ and, unlike any bipartition cut, it certifies the `λ₂ = 2` Fiedler-eigenvecto `n = 9` (the eigenvectors are `{-1,0,1}`-valued, with the high-degree vertices in `Z`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/TriangleFree2K2.lean b/LeanPool/ACMax/Cuts/TriangleFree2K2.lean index d9b99922b6..c21bbfcc71 100644 --- a/LeanPool/ACMax/Cuts/TriangleFree2K2.lean +++ b/LeanPool/ACMax/Cuts/TriangleFree2K2.lean @@ -29,7 +29,7 @@ NOTE: the threshold is `8`, not `7` — there is an explicit triangle-free, max- `2K₂`-free graph on `7` vertices (containing an induced `C₅`). -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/TwoCut.lean b/LeanPool/ACMax/Cuts/TwoCut.lean index 541bf6e3bc..65da4b538c 100644 --- a/LeanPool/ACMax/Cuts/TwoCut.lean +++ b/LeanPool/ACMax/Cuts/TwoCut.lean @@ -29,7 +29,7 @@ quadratic form is at most `2 · (∑ c) · (∑ x²) = 4 ∑ x²`, hence `xᵀ L x ≤ 2 ∑ x²` and the universal test-vector certificate applies. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Cuts/WeightedCut.lean b/LeanPool/ACMax/Cuts/WeightedCut.lean index a62cba42b7..e0c1042a75 100644 --- a/LeanPool/ACMax/Cuts/WeightedCut.lean +++ b/LeanPool/ACMax/Cuts/WeightedCut.lean @@ -23,7 +23,7 @@ has squared norm `p·q·n`, and Laplacian quadratic form `n²·cut`, so and unbalanced near-regular graphs where a balanced cut is unavailable. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/InternalEdgesEven.lean b/LeanPool/ACMax/InternalEdgesEven.lean index f96bd23f30..faeb32c802 100644 --- a/LeanPool/ACMax/InternalEdgesEven.lean +++ b/LeanPool/ACMax/InternalEdgesEven.lean @@ -15,7 +15,7 @@ For any finite simple graph `G` and vertex set `s`, the sum over `v ∈ s` of th neighbours of `v` lying in `s` equals twice the number of edges internal to `s`, hence is even. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Reduction/GapReduction.lean b/LeanPool/ACMax/Reduction/GapReduction.lean index 475113cb87..59ffe830f5 100644 --- a/LeanPool/ACMax/Reduction/GapReduction.lean +++ b/LeanPool/ACMax/Reduction/GapReduction.lean @@ -17,7 +17,7 @@ public import LeanPool.ACMax.Spectral.AlgConnK2 The complete all-order theorem is assembled separately in `Band.Final`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Reduction/Reduction.lean b/LeanPool/ACMax/Reduction/Reduction.lean index f999a85a33..238fcbdf50 100644 --- a/LeanPool/ACMax/Reduction/Reduction.lean +++ b/LeanPool/ACMax/Reduction/Reduction.lean @@ -60,7 +60,7 @@ residual case as an explicit hypothesis. `residual_algConn_le_two` in conjecture. The numeric examples below check the cut thresholds at order 19. -/ -@[expose] public section +public section namespace ACMax @@ -74,7 +74,7 @@ open Classical in `n`-uniform weighted-cut inequality `n·(∑deg − 6) ≤ 2·(3·(n−3))`. (The triangle `A = {x,y,z}` sends exactly `∑deg − 6` edges to `Aᶜ`, so this is precisely the hypothesis of `algConn_le_two_of_weighted_cut`.) At `n = 19` this is `∑deg ≤ 11`. -/ -def HasGoodTriangle (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := +@[expose] def HasGoodTriangle (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := ∃ x y z : Fin n, x ≠ y ∧ y ≠ z ∧ x ≠ z ∧ G.Adj x y ∧ G.Adj y z ∧ G.Adj x z ∧ n * (G.degree x + G.degree y + G.degree z - 6) ≤ 2 * (3 * (n - 3)) @@ -83,7 +83,7 @@ open Classical in /-- An **induced `2K₂` on degree-`3` vertices**: four distinct vertices of degree `3` spanning exactly the two edges `ab`, `cd`. Its degree sum is `12`, so `algConn_le_two_of_ind_2K2` applies (for every `n`). -/ -def HasDeg3Ind2K2 (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := +@[expose] def HasDeg3Ind2K2 (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := ∃ a b c d : Fin n, ({a, b, c, d} : Finset (Fin n)).card = 4 ∧ G.degree a = 3 ∧ G.degree b = 3 ∧ G.degree c = 3 ∧ G.degree d = 3 ∧ G.Adj a b ∧ G.Adj c d ∧ ¬G.Adj a c ∧ ¬G.Adj a d ∧ ¬G.Adj b c ∧ ¬G.Adj b d @@ -92,7 +92,7 @@ open Classical in /-- A **good `C₄`**: an induced `4`-cycle `a-b-c-d-a` with the `n`-uniform threshold `n·(∑deg − 8) ≤ 2·(4·(n−4))` — exactly the hypothesis of `algConn_le_two_of_good_C4`. At `n = 19` this is `∑deg ≤ 14`. -/ -def HasGoodC4 (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := +@[expose] def HasGoodC4 (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := ∃ a b c d : Fin n, ({a, b, c, d} : Finset (Fin n)).card = 4 ∧ G.Adj a b ∧ G.Adj b c ∧ G.Adj c d ∧ G.Adj d a ∧ ¬G.Adj a c ∧ ¬G.Adj b d ∧ n * (G.degree a + G.degree b + G.degree c + G.degree d - 8) ≤ 2 * (4 * (n - 4)) diff --git a/LeanPool/ACMax/Reduction/Residual.lean b/LeanPool/ACMax/Reduction/Residual.lean index 1cde1dde0b..a9a1d3d4dc 100644 --- a/LeanPool/ACMax/Reduction/Residual.lean +++ b/LeanPool/ACMax/Reduction/Residual.lean @@ -58,7 +58,7 @@ program identified by the investigation of the per-`n` architecture (`n = 12..19 Everything here is sorry-free and axiom-clean. -/ -@[expose] public section +public section namespace ACMax @@ -238,7 +238,7 @@ cycle vs any sparse block) kill every verified `n ≥ 23` escaper of the 5-const Stated for an arbitrary finite vertex type (like the whole spectral base layer), so that its instances match `algConn_le_two_of_signed` exactly; at `Fin n` this is the `TwoBlockConfig n G` of the residual program. -/ -def TwoBlockConfig {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop := +@[expose] def TwoBlockConfig {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop := ∃ P N : Finset V, Disjoint P N ∧ P.card = N.card ∧ 0 < P.card ∧ 2 * (∑ p ∈ P, (G.neighborFinset p ∩ N).card) + (∑ p ∈ P, (G.neighborFinset p \ P).card) diff --git a/LeanPool/ACMax/Spectral/AlgConn.lean b/LeanPool/ACMax/Spectral/AlgConn.lean index ab42ce2b20..4ed3ffd0e8 100644 --- a/LeanPool/ACMax/Spectral/AlgConn.lean +++ b/LeanPool/ACMax/Spectral/AlgConn.lean @@ -21,14 +21,14 @@ Laplacian) sits at index `card V - 1`, and the second-smallest — the algebraic connectivity `λ₂` — at index `card V - 2`. -/ -@[expose] public section +public section namespace ACMax open Classical in /-- Algebraic connectivity of a finite simple graph: the second-smallest eigenvalue of the graph Laplacian `L(G) = D(G) - A(G)`. -/ -noncomputable def algConn {V : Type*} [Fintype V] [Nonempty V] +@[expose] noncomputable def algConn {V : Type*} [Fintype V] [Nonempty V] (G : SimpleGraph V) : ℝ := (SimpleGraph.posSemidef_lapMatrix ℝ G).isHermitian.eigenvalues₀ ⟨Fintype.card V - 2, Nat.sub_lt Fintype.card_pos (by norm_num)⟩ diff --git a/LeanPool/ACMax/Spectral/AlgConnK2.lean b/LeanPool/ACMax/Spectral/AlgConnK2.lean index 0805a90c4c..2c35e31328 100644 --- a/LeanPool/ACMax/Spectral/AlgConnK2.lean +++ b/LeanPool/ACMax/Spectral/AlgConnK2.lean @@ -20,7 +20,7 @@ The Laplacian spectrum of `K_{2,n-2}` is `0, 2^(n-3), (n-2), n`, so its second-smallest eigenvalue is `2`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Spectral/RayleighLower.lean b/LeanPool/ACMax/Spectral/RayleighLower.lean index 34de383fe9..c223c703a6 100644 --- a/LeanPool/ACMax/Spectral/RayleighLower.lean +++ b/LeanPool/ACMax/Spectral/RayleighLower.lean @@ -18,7 +18,7 @@ every `x` orthogonal to the all-ones vector (`∑ i, x i = 0`), then `c ≤ algC This is the reverse direction used to certify the *lower* bound `algConn ≥ 2`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Spectral/RayleighUpper.lean b/LeanPool/ACMax/Spectral/RayleighUpper.lean index c4e8f35728..bcf649c4eb 100644 --- a/LeanPool/ACMax/Spectral/RayleighUpper.lean +++ b/LeanPool/ACMax/Spectral/RayleighUpper.lean @@ -23,7 +23,7 @@ Rayleigh quotient of `x`, in division-free form This is the reusable bridge both clauses of the ACMAX conjecture rely on. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/Spectral/TestVector.lean b/LeanPool/ACMax/Spectral/TestVector.lean index 601dd3159f..fda88f2a86 100644 --- a/LeanPool/ACMax/Spectral/TestVector.lean +++ b/LeanPool/ACMax/Spectral/TestVector.lean @@ -21,7 +21,7 @@ balanced, weighted and signed cuts, the induced-`2K₂` bound and the good-`C₄ certificates all build an explicit `x ⊥ 𝟙` and discharge the Rayleigh inequality here. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/ACMax/UpperBound.lean b/LeanPool/ACMax/UpperBound.lean index 49d4dc28b8..40c48b89e3 100644 --- a/LeanPool/ACMax/UpperBound.lean +++ b/LeanPool/ACMax/UpperBound.lean @@ -23,7 +23,7 @@ two-range assembly in `Band.Final`: the low-order proof handles `4 ≤ n ≤ 31` and the incidence-capacity and exact Moore arguments jointly handle `n ≥ 32`. -/ -@[expose] public section +public section namespace ACMax diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean.lean index a4a08bafc8..7a0975511b 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean.lean @@ -22,7 +22,7 @@ Tags: descriptive-set-theory, game-theory, determinacy MSC: 03E15, 54H05, 91A44 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications.lean index 09d199305f..8ea996272f 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications.lean @@ -18,4 +18,4 @@ Import-only index for the application modules in the Borel determinacy formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Choquet.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Choquet.lean index 1ecdb49c65..2d09c6259d 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Choquet.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Choquet.lean @@ -20,7 +20,7 @@ import Mathlib.Topology.MetricSpace.Bounded Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section open GaleStewartGame @@ -52,11 +52,11 @@ variable {W : Set (Set X)} (hWV : W ⊆ V) (hW : ∀ A ∈ V, ∃ B ∈ W, B ⊆ lemma extend_mem_iff (x : List W) : x.map (Set.inclusion hWV) ∈ chainTree V ↔ x ∈ chainTree W := by simp [chainTree, List.isChain_map] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extend (x : chainTree W) : chainTree V where +@[expose, simps] def extend (x : chainTree W) : chainTree V where val := x.1.map (Set.inclusion hWV) property := by simpa only [extend_mem_iff] using x.2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extend' {x : chainTree W} (a : Tree.ExtensionsAt x) : +@[expose, simps] def extend' {x : chainTree W} (a : Tree.ExtensionsAt x) : Tree.ExtensionsAt (extend hWV x) where val := Set.inclusion hWV a.val property := by diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean index 8a41364dea..5fd16a5a90 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.TautoSet Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section lemma diff_subset_union {I} {A B C : Set I} : A \ C ⊆ (A \ B) ∪ (B \ C) := by tauto_set diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean index d091bc08a8..f3829b060b 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean @@ -17,7 +17,7 @@ import LeanPool.AFormalizationOfBorelDeterminacyInLean.Applications.RegularOpen Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section variable {X Y : Type*} [tX : TopologicalSpace X] [tY : TopologicalSpace Y] diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/RegularOpen.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/RegularOpen.lean index 4ba4aa64b0..dd4b61112e 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/RegularOpen.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/RegularOpen.lean @@ -14,7 +14,7 @@ public import Mathlib.Topology.Sets.Opens Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section variable {X : Type*} [tX : TopologicalSpace X] {A B : Set X} {U V : tX.Opens} diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic.lean index 020ba7051b..a2040e2a83 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic.lean @@ -24,4 +24,4 @@ Import-only index for the basic list, stream, category, and tactic support modules in the Borel determinacy formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/FinLists.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/FinLists.lean index 9aac96b785..e3b4ce805c 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/FinLists.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/FinLists.lean @@ -26,7 +26,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section variable {α β γ : Type*} {a : α} {m n : ℕ} @@ -112,7 +112,7 @@ variable (x y : List α) (a : α) (f : α → List α → β) /-- Auxiliary declaration for the Borel determinacy formalization. -/ def zipInitsMap := x.zipWith f x.inits.tail @[simp] lemma zipInitsMap_nil : [].zipInitsMap f = [] := by simp [zipInitsMap] -@[simp] lemma zipInitsMap_singleton : [a].zipInitsMap f = [f a [a]] := rfl +@[simp] lemma zipInitsMap_singleton : [a].zipInitsMap f = [f a [a]] := by rfl lemma zipInitsMap_append : (x ++ y).zipInitsMap f = x.zipInitsMap f ++ y.zipInitsMap (fun a z ↦ f a (x ++ z)) := by have h : ¬ x.inits.isEmpty := by rw [List.isEmpty_iff_length_eq_zero]; simp diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean index 30667f5a23..2d06c27e50 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Ring.RingNF Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section attribute [simp_lengths] diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InfLists.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InfLists.lean index d07697d835..5e0c455d03 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InfLists.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InfLists.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Stream' @@ -37,7 +37,7 @@ namespace Discrete (y ++ₛ ·)⁻¹' ((x ++ₛ ·)⁻¹' T) = ((x ++ y) ++ₛ ·)⁻¹' T := by simp [← Set.preimage_comp] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def principalOpen : Set (Stream' A) := Set.range (x ++ₛ ·) +@[expose] def principalOpen : Set (Stream' A) := Set.range (x ++ₛ ·) @[simp] lemma principalOpen_nil : @principalOpen A [] = Set.univ := by simp [principalOpen] @[simp] lemma principalOpen_append : x ++ₛ a ∈ principalOpen (x ++ y) ↔ a ∈ principalOpen y := by simp [principalOpen] diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InvLimitNat.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InvLimitNat.lean index f230b6ddc4..06ab05959d 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InvLimitNat.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/InvLimitNat.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section open CategoryTheory @@ -111,7 +111,7 @@ def recCompOfLE {m n} (h : m ≤ n) {F : ℕ → C} (f : ∀ n, F (n + 1) ⟶ F rw [ih, ← F.map_comp] congr 1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -noncomputable def natFreeCat : (ℕᵒᵖ ⥤ C) ≃ ((O : ℕ → C) × (∀ n, O (n + 1) ⟶ O n)) where +@[expose] noncomputable def natFreeCat : (ℕᵒᵖ ⥤ C) ≃ ((O : ℕ → C) × (∀ n, O (n + 1) ⟶ O n)) where toFun F := ⟨F.obj ∘ Opposite.op, fun n ↦ F.map (homOfLE (Nat.le_succ n)).op⟩ invFun := fun ⟨O, F⟩ ↦ { obj := O ∘ Opposite.unop diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/MiscCat.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/MiscCat.lean index 459e73e010..1f0f498853 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/MiscCat.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/MiscCat.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section open CategoryTheory diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game.lean index 54da6099e3..df6b527b6c 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game.lean @@ -23,4 +23,4 @@ import Mathlib.Tactic.NormNum.Pow Import-only index for Gale-Stewart game definitions, strategies, and examples. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/BuildStrategies.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/BuildStrategies.lean index 97d78c6383..eca8e0660b 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/BuildStrategies.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/BuildStrategies.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame @@ -33,7 +33,7 @@ namespace PreStrategy section «tryAndElse» variable {p : Player} /-- try following PreStrategy `planA` if possible, else follow `planB` -/ -noncomputable def tryAndElse (planA planB : PreStrategy T p) : +@[expose] noncomputable def tryAndElse (planA planB : PreStrategy T p) : PreStrategy T p := by classical exact fun x hp ↦ @@ -98,7 +98,7 @@ lemma _root_.GaleStewartGame.Game.AllWinning.existsWinning subset_trans (by simp) (Set.image_mono h.superset)⟩ /-- Extend a pre-strategy to a quasi-strategy. The definition boundary keeps API-level simp lemmas stated through `extQuasi` instead of exposing the `tryAndElse` implementation. -/ -def extQuasi (S : PreStrategy T p) (h : IsPruned T) : QuasiStrategy T p := +@[expose] def extQuasi (S : PreStrategy T p) (h : IsPruned T) : QuasiStrategy T p := ⟨tryAndElse S ⊤, quasi_of_planB <| top_isQuasi h⟩ lemma eq_extQuasi (S : PreStrategy T p) (hT : IsPruned T) (h : ∀ (x : S.subtree) (hp : IsPosition x.val p), ∃ a, a ∈ S (S.subtreeIncl x) hp) : @@ -241,7 +241,7 @@ section «PreserveProp» variable {p : Player} variable (P : ∀ x : T, IsPosition x.val p.swap → Prop) /-- play such that the proposition `P x` holds in every position `x` resulting from your move -/ -def preserveProp : PreStrategy T p := fun x hp ↦ {a | P a.valT' (by synthIsPosition)} +@[expose] def preserveProp : PreStrategy T p := fun x hp ↦ {a | P a.valT' (by synthIsPosition)} lemma preserveProp_eq_extQuasi (h : ∀ x hp, P x hp → ∀ a : ExtensionsAt x, (preserveProp P a.valT' (by as_aux_lemma => synthIsPosition)).Nonempty) (hT : IsPruned T) (hst0 : (hp : p = Player.zero) → ∃ a ha, P ⟨[a], ha⟩ (by as_aux_lemma => synthIsPosition)) @@ -262,13 +262,13 @@ end PreStrategy variable {G G' : Game A} {p p' : Player} namespace Game /-- a position is winning if there is a winning strategy in the residual game -/ -def WinningPosition (G : Game A) (x : List A) (p : Player := Player.zero) := +@[expose] def WinningPosition (G : Game A) (x : List A) (p : Player := Player.zero) := (G.residual x).ExistsWinning p @[simp] lemma winningPosition_residual x y : (G.residual x).WinningPosition y p ↔ G.WinningPosition (x ++ y) p := by simp [WinningPosition] /-- a position is won if it cannot be lost by playing however -/ -def WonPosition (G : Game A) (x : List A) (p : Player := Player.zero) := +@[expose] def WonPosition (G : Game A) (x : List A) (p : Player := Player.zero) := (G.residual x).AllWinning p @[simp] lemma wonPosition_residual x y : (G.residual x).WonPosition y p ↔ G.WonPosition (x ++ y) p := by @@ -302,7 +302,7 @@ lemma wonPosition_iff_disjoint {x} : wonPosition_iff_disjoint' /-- the defensive PreStrategy never moves into a winning position of the opponent -/ -def defensivePre (G : Game A) (p : Player) : PreStrategy G.tree p := +@[expose] def defensivePre (G : Game A) (p : Player) : PreStrategy G.tree p := preserveProp (fun x _ ↦ ¬ WinningPosition G x.val) @[simp] lemma defensivePre_residual {x} : (defensivePre G p).residual x = defensivePre (G.residual x) (p.residual x) := by @@ -313,7 +313,7 @@ def defensivePre (G : Game A) (p : Player) : PreStrategy G.tree p := @[congr] lemma defensivePre_subtree {hG : G = G'} {hp : p = p'} : (defensivePre G p).subtree = (defensivePre G' p').subtree := by congr! /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def defensiveQuasi (G : Game A) (p : Player) := (defensivePre G p).extQuasi +@[expose] def defensiveQuasi (G : Game A) (p : Player) := (defensivePre G p).extQuasi @[congr] lemma defensiveQuasi_subtree {hG : G = G'} {hp : p = p'} h : (defensiveQuasi G p h).1.subtree = (defensiveQuasi G' p' (hG ▸ h)).1.subtree := by subst hG hp; rfl @@ -353,7 +353,7 @@ lemma followUntilWon_body : body S.followUntilWon.subtree ≤ body S.subtree ∪ · right; have hx' := body_mono S.followUntilWon.subtree_sub hx; conv => simp [hx'] let ⟨n, h'⟩ := h' conv at h' => simp [WonPosition, AllWinning] - have hmem := Set.eq_univ_iff_forall.mp h' (body.drop n ⟨x, hx'⟩) + have hmem := h' (Set.mem_range_self (body.drop n ⟨x, hx'⟩)) simpa [body.append] using hmem · left; apply subtree_induction_body hx intro n _ _ hmem diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/GaleStewart.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/GaleStewart.lean index a88df5825c..79d83d388a 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/GaleStewart.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/GaleStewart.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Games.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Games.lean index 51910fa2b0..713d26df75 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Games.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Games.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame @@ -47,14 +47,16 @@ namespace Game · apply Set.hEq_of_image_eq _ hp rw [ht] /-- The residual game starting in position x -/ -@[simps tree] def residual (G : Game A) (x : List A) : Game A where +@[expose] def residual (G : Game A) (x : List A) : Game A where tree := subAt G.tree x payoff := (body.append x)⁻¹' if x.length % 2 = 0 then G.payoff else G.payoffᶜ +@[simp] theorem residual_tree (G : Game A) (x : List A) : + (G.residual x).tree = subAt G.tree x := rfl @[simp] lemma residual_payoff_even (G : Game A) (x : List A) (h : x.length % 2 = 0) : (G.residual x).payoff = (body.append x)⁻¹' G.payoff := by simp [residual, h] @[simp] lemma residual_payoff_odd (G : Game A) (x : List A) (h : x.length % 2 = 1) : (G.residual x).payoff = ((body.append x)⁻¹' G.payoff)ᶜ := by simp [residual, h] -@[simp] lemma residual_nil (G : Game A) : G.residual [] = G := rfl +@[simp] lemma residual_nil (G : Game A) : G.residual [] = G := by rfl @[simp] lemma residual_append (G : Game A) (x y : List A) : (G.residual x).residual y = G.residual (x ++ y) := by ext1 @@ -95,7 +97,7 @@ abbrev PreStrategy.subgame (S : PreStrategy G.tree p) : Game A where namespace Player /-- player p wins if and only if the resulting play lies in `p.payoff G` -/ -def payoff (p : Player) (G : Game A) : Set (body G.tree) := match p with +@[expose] def payoff (p : Player) (G : Game A) : Set (body G.tree) := match p with | zero => G.payoff | one => G.payoffᶜ @[simp] lemma payoff_zero : zero.payoff G = G.payoff := rfl @@ -109,7 +111,6 @@ def payoff (p : Player) (G : Game A) : Set (body G.tree) := match p with by_cases h : x.length % 2 = 0 · cases p · simp_all - rfl · unfold Player.payoff Player.residual rw [ite_eq_left h, Game.residual_payoff_even G x h] ext y @@ -117,24 +118,24 @@ def payoff (p : Player) (G : Game A) : Set (body G.tree) := match p with · have hodd : x.length % 2 = 1 := Nat.mod_two_ne_zero.mp h cases p · simp_all - rfl · unfold Player.payoff Player.residual rw [ite_eq_right h, Game.residual_payoff_odd G x hodd] - exact compl_compl (body.append x ⁻¹' G.payoff) + simp only [Game.residual_tree, Player.swap_one] + ext y + exact not_not end Player @[congr] lemma subtype_val_player_payoff {G' p'} (h : G = G') (hp : p = p') : Subtype.val '' (p.payoff G) = Subtype.val '' (p'.payoff G') := by congr! /-- A pre-strategy is winning if all compatible plays are won. Keeping this as a definition lets API-level simp lemmas remain stated in terms of winning strategies. -/ -def PreStrategy.IsWinning (s : PreStrategy G.tree p) := body s.subtree ⊆ p.payoff G +@[expose] def PreStrategy.IsWinning (s : PreStrategy G.tree p) := body s.subtree ⊆ p.payoff G lemma PreStrategy.sub_winning {s t : PreStrategy G.tree p} (h : s ≤ t) (h' : t.IsWinning) : s.IsWinning := subset_trans (by gcongr) h' lemma PreStrategy.IsWinning.residual {s : PreStrategy G.tree p} (h : s.IsWinning) (x : s.subtree) : (s.residual x).IsWinning (G := G.residual x) := by have hpay : (p.residual x.val).payoff (G.residual x.val) = (body.append x.val)⁻¹' p.payoff G := by simp_all - rfl change body _ ⊆ _ rw [hpay] simpa [PreStrategy.residual, Game.residual, subAt_body, subAt_body_image] using @@ -148,7 +149,7 @@ namespace Game (∃ s : Strategy S.tree p, s.pre.IsWinning) ↔ ∃ s : Strategy T.tree q, s.pre.IsWinning := by subst hS hp; rfl /-- whether a winning strategy exists for player p -/ -def ExistsWinning (G : Game A) p := ∃ S : Strategy G.tree p, S.pre.IsWinning +@[expose] def ExistsWinning (G : Game A) p := ∃ S : Strategy G.tree p, S.pre.IsWinning lemma existsWinning_iff_quasi : G.ExistsWinning p ↔ ∃ S : QuasiStrategy G.tree p, S.1.IsWinning := ⟨fun ⟨S, h'⟩ ↦ ⟨S.quasi, h'⟩, fun ⟨_, h'⟩ ↦ ⟨_, h'.choose⟩⟩ @@ -168,7 +169,7 @@ include hW in lemma not_both_winning (hNe : [] ∈ G.tree) : ¬ G.ExistsWinning exact h.subset (by simpa using ha) end ExistsWinning /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def AllWinning (G : Game A) (p : Player) := p.payoff G = Set.univ +@[expose] def AllWinning (G : Game A) (p : Player) := p.payoff G = Set.univ lemma AllWinning.residual (hW : G.AllWinning p) x : (G.residual x).AllWinning (p.residual x) := by cases p @@ -187,7 +188,8 @@ lemma AllWinning.residual (hW : G.AllWinning p) x : Game.residual_payoff_even G x hx] ext a constructor - · simp_all + · intro _ + trivial · intro _ hmem have hcompl : body.append x a ∈ G.payoffᶜ := by simp_all @@ -201,7 +203,7 @@ lemma AllWinning.residual (hW : G.AllWinning p) x : exact Set.mem_univ a · simp_all /-- a game is determined if some player has a winning strategy -/ -def IsDetermined (G : Game A) := ∃ p, G.ExistsWinning p +@[expose] def IsDetermined (G : Game A) := ∃ p, G.ExistsWinning p end Game end GaleStewartGame diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Player.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Player.lean index 3df5553012..f0a38464f4 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Player.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Player.lean @@ -32,7 +32,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame @@ -79,7 +79,7 @@ end «Section1» variable {A : Type*} (x : List A) (p q : Player) namespace Player /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def toNat : Player → ℕ +@[expose] def toNat : Player → ℕ | zero => 0 | one => 1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ @@ -91,22 +91,23 @@ def toNat : Player → ℕ @[ext] lemma ext (h : p.toNat = q.toNat) : p = q := by synthIsPosition /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def swap : Player → Player +@[expose] def swap : Player → Player | zero => one | one => zero /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simp_isPosition] lemma apply_ite_swap (P : Prop) [Decidable P] (a b : Player) : swap (if P then a else b) = if P then swap a else swap b := by simpa using (apply_ite swap P a b) -@[simp, simp_isPosition] lemma swap_zero : zero.swap = one := rfl -@[simp, simp_isPosition] lemma swap_one : one.swap = zero := rfl +@[simp, simp_isPosition] lemma swap_zero : zero.swap = one := by rfl +@[simp, simp_isPosition] lemma swap_one : one.swap = zero := by rfl /-- if `p` moves in position `[]`, then `p.residual x` moves in position `x` -/ -@[simp_isPosition] def residual := if x.length % 2 = 0 then p else p.swap +@[expose, simp_isPosition] def residual := if x.length % 2 = 0 then p else p.swap end Player /-- is player `p` to move in position `x`? -/ -@[simp_isPosition] def IsPosition (x : List A) (p : Player) : Prop := x.length % 2 = p.toNat +@[expose, simp_isPosition] def IsPosition (x : List A) (p : Player) : Prop := + x.length % 2 = p.toNat diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Strategies.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Strategies.lean index c14c502532..dc81e3039f 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Strategies.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Strategies.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame @@ -32,7 +32,7 @@ variable {A : Type*} (T : tree A) (p : Player) /-- a `PreStrategy` is a weak form of a strategy given by specifying not a single move, but a possibly empty set of valid moves in all positions. This can be defined for arbitrary trees and not just games as the payoff set is irrelevant -/ -def PreStrategy := ∀ x : T, IsPosition x.val p → Set (ExtensionsAt x) --TODO synth arg? +@[expose] def PreStrategy := ∀ x : T, IsPosition x.val p → Set (ExtensionsAt x) --TODO synth arg? variable {T p} namespace PreStrategy @[ext] lemma ext {f g : PreStrategy T p} (h : ∀ x hp, f x hp = g x hp) : f = g := @@ -45,7 +45,7 @@ instance : PartialOrder (PreStrategy T p) where variable (S : PreStrategy T p) /-- the tree of plays valid with a `PreStrategy` -/ -def subtree : tree A where +@[expose] def subtree : tree A where val := { x | ∃ (hx : x ∈ T), ∀ {y} {a}, (hpr : y ++ [a] <+: x) → (hpo : IsPosition y p) → ⟨a, mem_of_prefix hpr hx⟩ ∈ S ⟨y, mem_of_append (mem_of_prefix hpr hx)⟩ hpo } property := fun _ _ ⟨hx, h⟩ ↦ @@ -54,7 +54,8 @@ def subtree : tree A where @[simp] lemma subtree_ne : [] ∈ S.subtree ↔ [] ∈ T := by simp [subtree] @[simp] lemma subtree_sub : S.subtree ≤ T := fun _ ⟨h, _⟩ ↦ h /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def subtreeIncl (x : S.subtree) : T := ⟨x.val, S.subtree_sub x.prop⟩ +@[expose] def subtreeIncl (x : S.subtree) : T := ⟨x.val, S.subtree_sub x.prop⟩ +@[simp] lemma subtreeIncl_coe (x : S.subtree) : (S.subtreeIncl x : List A) = x.val := by rfl attribute [simp_lengths] subtreeIncl_coe @[gcongr] lemma subtree_mono {f g : PreStrategy T p} (h : f ≤ g) : f.subtree ≤ g.subtree := @@ -113,7 +114,7 @@ lemma restrict_valid (rto : tree A) (hr : rto ≤ T) : (fun _ h ↦ ⟨h.2, h.1.2⟩) /-- the residual strategy for the game starting in position x -/ -def residual (x : List A) : PreStrategy (subAt T x) (p.residual x) := +@[expose] def residual (x : List A) : PreStrategy (subAt T x) (p.residual x) := fun y hy ↦ {a | ⟨a.val, by simpa [List.append_assoc] using a.prop⟩ ∈ S ⟨x ++ y.val, y.prop⟩ (by synthIsPosition)} lemma sub_residual_subtree (x : List A) : @@ -138,11 +139,11 @@ lemma sub_residual_subtree (x : List A) : · apply sub_residual_subtree /-- A quasistrategy is a `PreStrategy` that allows at least one move in every position -/ -def IsQuasi (S : PreStrategy T p) := ∀ x hx, (S x hx).Nonempty +@[expose] def IsQuasi (S : PreStrategy T p) := ∀ x hx, (S x hx).Nonempty end PreStrategy variable (T p) in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def QuasiStrategy := PSigma (@PreStrategy.IsQuasi A T p) +@[expose] def QuasiStrategy := PSigma (@PreStrategy.IsQuasi A T p) @[ext] lemma QuasiStrategy.ext {f g : QuasiStrategy T p} (h : f.1 = g.1) : f = g := by obtain ⟨f, hf⟩ := f; obtain ⟨g, hg⟩ := g have h' : f = g := h @@ -150,7 +151,7 @@ def QuasiStrategy := PSigma (@PreStrategy.IsQuasi A T p) rfl variable (T p) in /-- A quasistrategy is a `PreStrategy` that allows exactly one move in every position -/ -def Strategy := ∀ x : T, IsPosition x.val p → ExtensionsAt x +@[expose] def Strategy := ∀ x : T, IsPosition x.val p → ExtensionsAt x @[ext] lemma Strategy.ext {f g : Strategy T p} (h : ∀ x hp, f x hp = g x hp) : f = g := funext fun x ↦ funext (h x) @@ -206,9 +207,12 @@ lemma PreStrategy.IsQuasi.restrict_isQuasi {S : PreStrategy T p} (rto : PreStrat abbrev QuasiStrategy.restrict (S : QuasiStrategy T p) (rto : PreStrategy T p.swap) : QuasiStrategy rto.subtree p := ⟨_, S.2.restrict_isQuasi rto⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def QuasiStrategy.residual (S : QuasiStrategy T p) (x : List A) : +@[expose] def QuasiStrategy.residual (S : QuasiStrategy T p) (x : List A) : QuasiStrategy (subAt T x) (p.residual x) := ⟨S.1.residual x, by intro y hy; have ne := S.2 ⟨x ++ y.val, y.prop⟩ (by synthIsPosition) use ⟨ne.choose.val, by simpa using ne.choose.prop⟩, ne.choose_spec⟩ +@[simp] theorem QuasiStrategy.residual_fst (S : QuasiStrategy T p) (x : List A) : + (S.residual x).fst = S.fst.residual x := by rfl + end GaleStewartGame diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Undetermined.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Undetermined.lean index d7e82a5789..a65f17d618 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Undetermined.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Game/Undetermined.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof.lean index 8997a3fed3..57ad254f07 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof.lean @@ -20,4 +20,4 @@ public import LeanPool.AFormalizationOfBorelDeterminacyInLean.Proof.WinAsap Import-only index for the covering and unravelling proof of Borel determinacy. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BorelDeterminacy.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BorelDeterminacy.lean index c949739556..478d1401a3 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BorelDeterminacy.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BorelDeterminacy.lean @@ -18,7 +18,7 @@ import LeanPool.AFormalizationOfBorelDeterminacyInLean.Proof.Zero.Strat Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BuildLevelwise.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BuildLevelwise.lean index 7a247495f0..7401f8dd74 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BuildLevelwise.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/BuildLevelwise.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame @@ -60,7 +60,7 @@ lemma bodySystem_take' (x : BodySystemObj T) (h : m ≤ k) : rw [bodySystem_take_val] exact congrArg (fun j ↦ (x.res j).val) (inf_of_le_right h) /-- an isomorph of `bodyFunctor` that is more convenient to build levelwise -/ -@[simps obj] def bodySystem : Trees ⥤ Type* where +@[expose, simps obj] def bodySystem : Trees ⥤ Type* where obj T := BodySystemObj T map {S T} f := TypeCat.ofHom fun x : BodySystemObj S ↦ ({ res := fun k ↦ (resEq k).map f (x.res k) @@ -80,7 +80,7 @@ abbrev ofObj (x : bodySystem.obj T) : BodySystemObj T := (Equiv.cast (by dsimp [bodySystem] : bodySystem.obj T = BodySystemObj T)).injective h end BodySystemObj /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def bodyEquivSystemApp (T : Trees) : body T.2 ≃ BodySystemObj T where +@[expose, simps] def bodyEquivSystemApp (T : Trees) : body T.2 ≃ BodySystemObj T where toFun x := { res := fun k ↦ ⟨x.val.take k, by simp⟩ con := by simp @@ -102,7 +102,7 @@ end BodySystemObj · exact List.IsPrefix.getElem (xs := (x.res (m + 1)).val) (ys := (x.res n).val) ((bodySystem_con' x).mpr (by omega)) (by rw [resEq_len]; omega) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps! -isSimp] def bodyEquivSystem : bodyFunctor ≅ bodySystem := NatIso.ofComponents +@[expose, simps! -isSimp] def bodyEquivSystem : bodyFunctor ≅ bodySystem := NatIso.ofComponents (fun T ↦ eqToIso (by rfl : bodyFunctor.obj T = body T.2) ≪≫ (bodyEquivSystemApp T).toIso ≪≫ eqToIso (by dsimp [bodySystem] : BodySystemObj T = bodySystem.obj T)) (by @@ -159,7 +159,7 @@ end BodySystemObj IsPosition (A := no_index _) (Tree.pInv f x h).val p ↔ IsPosition x.val p := by synthIsPosition /-- a strategy defined only on positions up to length k -/ -def ResStrategy (T : Trees) (p : Player) (k : ℕ) := +@[expose] def ResStrategy (T : Trees) (p : Player) (k : ℕ) := ∀ x : T, IsPosition x.val p → x.val.length ≤ k → ExtensionsAt x namespace ResStrategy @[ext] lemma ext {S S' : ResStrategy T p k} (h : ∀ x hp hl, S x hp hl = S' x hp hl) : S = S' := @@ -181,14 +181,14 @@ lemma eval_val_congr' (S S' : ResStrategy T p k) (h : S = S') subst h h' rfl /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def res (h : m ≤ k) (S : ResStrategy T p k) : ResStrategy T p m := +@[expose] def res (h : m ≤ k) (S : ResStrategy T p k) : ResStrategy T p m := fun x hp hl ↦ S x hp (by omega) @[simp] lemma res_refl (S : ResStrategy T p k) : S.res le_rfl = S := rfl @[simp] lemma res_trans (m n k) (S : ResStrategy T p k) (mn : m ≤ n) (nk : n ≤ k) : (S.res nk).res mn = S.res (mn.trans nk) := rfl /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def fromMap (f : S ⟶ T) (h : Tree.Fixing k f := by as_aux_lemma => synthFixing) +@[expose] def fromMap (f : S ⟶ T) (h : Tree.Fixing k f := by as_aux_lemma => synthFixing) (S' : ResStrategy S p k) : ResStrategy T p k := fun x hx hl ↦ ExtensionsAt.map f (x := pInv f x) (y := x) (by simp_rw [cancel_pInv_right]) (S' _ (by simpa only [iff_pInv_lenHom]) (by simpa only [h_length_pInv])) @@ -253,7 +253,7 @@ end ResStrategy simp_rw [← ih (by simp), Nat.add_succ, ← (S.str (k + n + 1)).res_trans k (k + n) (k + n + 1) (by omega) (by omega), S.con] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def strategyEquivSystem : Strategy T.2 p ≃ StrategySystem T p where +@[expose, simps] def strategyEquivSystem : Strategy T.2 p ≃ StrategySystem T p where toFun S := { str := fun _ x h _ ↦ S x h con := fun _ ↦ rfl diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Covering.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Covering.lean index 8f2b227581..b06c92b29c 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Covering.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Covering.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame @@ -32,7 +32,7 @@ noncomputable section «Section1» variable {k m n : ℕ} {p : Player} namespace Covering /-- a tree that is pruned and nonempty as required for determinacy -/ -def PTrees := Σ' (T : Trees), IsPruned T.2 ∧ [] ∈ T.2 +@[expose] def PTrees := Σ' (T : Trees), IsPruned T.2 ∧ [] ∈ T.2 @[simp] lemma pTrees_isPruned (T : PTrees) : IsPruned T.1.2 := T.2.1 @[simp] lemma pTrees_ne (T : PTrees) : [] ∈ T.1.2 := T.2.2 end Covering @@ -46,7 +46,7 @@ def chooseSucc : ResStrategy T.1 p m := lemma res_surjective (h : m ≤ k) : (res h (T := T.1) (p := p)).Surjective := fun S ↦ ⟨_, S.res_chooseSucc h⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def chooseSystem : StrategySystem T.1 p where +@[expose, simps] def chooseSystem : StrategySystem T.1 p where str k := S.chooseSucc con k := by ext x; simp [chooseSucc, res] lemma chooseSystem_self : S.chooseSystem.str k = S := by ext _ _ hl; simp [chooseSucc, hl] @@ -65,11 +65,11 @@ structure PTreesS where toFun : ∀ p k, ResStrategy T.tree.1 p k → ResStrategy U.tree.1 p k con : ∀ p {k m} (h : m ≤ k) S, (toFun p k S).res h = toFun p m (S.res h) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def LvlStratHom.id (T : PTreesS) : LvlStratHom T T where +@[expose] def LvlStratHom.id (T : PTreesS) : LvlStratHom T T where toFun p k := _root_.id con := by simp /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def LvlStratHom.comp {T U V : PTreesS} (g : LvlStratHom U V) (f : LvlStratHom T U) : +@[expose] def LvlStratHom.comp {T U V : PTreesS} (g : LvlStratHom U V) (f : LvlStratHom T U) : LvlStratHom T V where toFun p k := g.toFun p k ∘ f.toFun p k con := by simp [g.con, f.con] @@ -103,7 +103,7 @@ abbrev LvlStratHom.systemOfObj {T : PTreesS} (S : (LvlStratHom.system p).obj T) cast (by dsimp [LvlStratHom.system] : (LvlStratHom.system p).obj T = StrategySystem T.tree.1 p) S /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def LvlStratHom.global (p : Player) : PTreesS ⥤ Type where +@[expose] def LvlStratHom.global (p : Player) : PTreesS ⥤ Type where obj T := Strategy T.tree.1.2 p map {T U} f := TypeCat.ofHom fun S : Strategy T.tree.1.2 p ↦ strategyEquivSystem.symm @@ -129,6 +129,7 @@ abbrev LvlStratHom.globalOfObj {T : PTreesS} (S : (LvlStratHom.global p).obj T) (LvlStratHom.global p).obj T = Strategy T.tree.1.2 p) S /-- Auxiliary declaration for the Borel determinacy formalization. -/ +@[expose] def bodyLiftExists {T U : PTrees} (toHom : T.1 ⟶ U.1) (str : PTreesS.mk T ⟶ PTreesS.mk U) := ∀ {p : Player} {S : Strategy T.1.2 p} (y : body (LvlStratHom.globalOfObj @@ -249,7 +250,7 @@ lemma fixing_mon {S T} (f : S ⟶ T) (h : Fixing k f) (hn : n ≤ k) : Fixing n f := ⟨h.1.mon hn, fun _ ↦ fixing_snd_mon hn _ h _⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Games := Σ' (A : Type*) (G : Game A), IsPruned G.tree ∧ [] ∈ G.tree +@[expose] def Games := Σ' (A : Type*) (G : Game A), IsPruned G.tree ∧ [] ∈ G.tree @[simp] lemma games_isPruned (G : Games) : IsPruned G.2.1.tree := G.2.2.1 @[simp] lemma games_ne (G : Games) : [] ∈ G.2.1.tree := G.2.2.2 instance (G : Games) : TopologicalSpace G.1 := ⊥ diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringClosedGame.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringClosedGame.lean index 456c549dcd..36d1f5da43 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringClosedGame.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringClosedGame.lean @@ -27,7 +27,7 @@ import Mathlib.Topology.Bases Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet @@ -44,13 +44,13 @@ structure Hyp (G : Game A) (k : ℕ) where variable {G : Game A} {k : ℕ} (hyp : Hyp G k) --the second component is the residual tree of valid extensions /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def upA (hyp : Hyp G k) := +@[expose] def upA (hyp : Hyp G k) := let _ : IsClosed G.payoff := hyp.closed A × tree A /-- Auxiliary declaration for the Borel determinacy formalization. -/ abbrev A' {A : Type*} {G : Game A} {k : ℕ} {hyp : Hyp G k} := upA hyp /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def getTree' (hyp : Hyp G k) (x : List (upA hyp)) := match x.getLast? with +@[expose] def getTree' (hyp : Hyp G k) (x : List (upA hyp)) := match x.getLast? with | none => G.tree | some a => a.2 /-- Auxiliary declaration for the Borel determinacy formalization. -/ @@ -62,7 +62,7 @@ variable {hyp} simp [getTree'] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def LosingCondition (x : List (upA hyp)) (h : x.length = 2 * k + 2) := +@[expose] def LosingCondition (x : List (upA hyp)) (h : x.length = 2 * k + 2) := body (pullSub (getTree' hyp x) (x.map Prod.fst)) ∩ G.payoff = ∅ ∧ ∃ y : subAt (getTree' hyp (x.take (2 * k + 1))) [x[2 * k + 1].1], getTree' hyp x = pullSub (subAt G.tree (x.map Prod.fst ++ y)) y @@ -126,15 +126,15 @@ def ValidExt (x : List (upA hyp)) (a : upA hyp) := [a.1] ∈ getTree' hyp x ∧ variable (hyp) /-- the tree of the unraveled game of a closed game -/ -def gameTree : tree (upA hyp) where +@[expose] def gameTree : tree (upA hyp) where val := {x | List.reverseRecOn x True (fun x a hx ↦ hx ∧ ValidExt x a)} property _ := by simp; tauto /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def oldAsTrees (hyp : Hyp G k) : Trees := +@[expose, simps] def oldAsTrees (hyp : Hyp G k) : Trees := let _ : IsClosed G.payoff := hyp.closed ⟨A, G.tree⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def gameAsTrees (hyp : Hyp G k) : Trees := ⟨upA hyp, gameTree hyp⟩ +@[expose, simps] def gameAsTrees (hyp : Hyp G k) : Trees := ⟨upA hyp, gameTree hyp⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ abbrev T {A : Type*} {G : Game A} : tree A := G.tree @@ -247,7 +247,7 @@ abbrev π {A : Type*} {G : Game A} {k : ℕ} {hyp : Hyp G k} : gameAsTrees hyp ⟶ oldAsTrees hyp := treeHom hyp /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def pInvTreeHomMap (hyp : Hyp G k) (x : List A) : List (upA hyp) := +@[expose] def pInvTreeHomMap (hyp : Hyp G k) (x : List A) : List (upA hyp) := x.zipInitsMap (fun a y ↦ (a, (G.residual y).tree)) variable {hyp} lemma treeHom_val x : (treeHom hyp x).val = x.val.map Prod.fst := by @@ -313,7 +313,7 @@ lemma pInvTreeHomMap_mem : ∀ {x : List A}, x ∈ G.tree → x.length ≤ 2 * k ⟨ih (mem_of_append hmem) hxlt.le, hvalid⟩ variable (hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def pInvTreeHom : (Tree.res (2 * k)).obj ⟨_, G.tree⟩ ⟶ +@[expose] def pInvTreeHom : (Tree.res (2 * k)).obj ⟨_, G.tree⟩ ⟶ (Tree.res (2 * k)).obj ⟨_, gameTree hyp⟩ where toFun x := ⟨pInvTreeHomMap hyp x.val, pInvTreeHomMap_mem x.prop.1 x.prop.2, @@ -334,7 +334,7 @@ def treeHomRes : (Tree.res (2 * k)).obj ⟨_, gameTree hyp⟩ ≅ rcases x with ⟨x, h⟩ change pInvTreeHomMap hyp (List.map Prod.fst x) = x induction x using List.reverseRecOn with - | nil => rfl + | nil => simpa only [List.map_nil] using (pInvTreeHomMap_nil (hyp := hyp)) | append_singleton x a ih => have hx : x ++ [a] ∈ gameTree hyp := h.1 have hxprev : x ∈ gameTree hyp := mem_of_append hx @@ -372,7 +372,7 @@ instance treeHom_fixing : Tree.Fixing (2 * k) (treeHom hyp) := ⟨Iso.isIso_hom xs = List.map Prod.fst (xs.zipInitsMap fun a y => (a, (G.residual y).tree)) := by intro xs induction xs using List.reverseRecOn with - | nil => rfl + | nil => simp | append_singleton xs a ih => rw [List.zipInitsMap_concat, List.map_append, ← ih] rfl @@ -440,7 +440,7 @@ lemma gameTree_isPruned : IsPruned <| gameTree hyp := by variable (hyp) in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def game : Game (upA hyp) where +@[expose, simps] def game : Game (upA hyp) where tree := gameTree hyp payoff := (bodyFunctor.map (treeHom hyp))⁻¹' G.payoff /-- Auxiliary declaration for the Borel determinacy formalization. -/ diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringLim.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringLim.lean index 163f92e811..916e9d900b 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringLim.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/CoveringLim.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One.lean index 961f087021..393c944a78 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One.lean @@ -20,4 +20,4 @@ import Mathlib.Tactic.NormNum.Pow Import-only index for the player-one lift and strategy construction modules. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Lift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Lift.lean index 0a5752b73b..efb01b0808 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Lift.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Lift.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.One @@ -37,7 +37,7 @@ noncomputable section «Section1» namespace Lift' variable (H : Lift' hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extension (hp : IsPosition H.x.val Player.one) +@[expose] def extension (hp : IsPosition H.x.val Player.one) (R : ResStrategy (gameAsTrees hyp) Player.one H.x.val.length) := R H.lift (by change H.liftVal.length % 2 = Player.one.toNat @@ -46,7 +46,7 @@ def extension (hp : IsPosition H.x.val Player.one) change H.liftVal.length ≤ H.x.val.length rw [H.liftVal_length]) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extensionMap (hp : IsPosition H.x.val Player.one) +@[expose] def extensionMap (hp : IsPosition H.x.val Player.one) (R : ResStrategy (gameAsTrees hyp) Player.one H.x.val.length) := ExtensionsAt.map (treeHom hyp) H.lift_lift (H.extension hp R) variable (hp : IsPosition H.x.val Player.one) @@ -193,7 +193,7 @@ structure LLift extends PreLift hyp where namespace LLift variable (H : LLift hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def S := defensiveQuasi H.game Player.one (hyp.pruned.sub _) +@[expose] def S := defensiveQuasi H.game Player.one (hyp.pruned.sub _) lemma S_winning : H.S.1.IsWinning := H.game.gale_stewart_precise' H.game_open (hyp.pruned.sub _) (by intro h; apply H.los; use 0; simpa) @@ -313,7 +313,7 @@ lemma Losable.losable_of_le {H H' : PreLift hyp} (hL : H'.Losable) (h : H ≤ H' exact Game.defensiveQuasi_subtree (hG := hG) (hp := rfl) _ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toLift] def Losable.lift' {H : PreLift hyp} (h : H.Losable) := Lift'.mk _ h.2 +@[expose, simps toLift] def Losable.lift' {H : PreLift hyp} (h : H.Losable) := Lift'.mk _ h.2 attribute [simp_lengths] Losable.lift'_toLift lemma Won.won_of_le {H H' : PreLift hyp} (hW : H.Won) (h : H ≤ H') : H'.Won := by @@ -480,16 +480,16 @@ lemma winnable_of_le {H H' : PreLift hyp} (hW : H.Winnable) (h : H ≤ H') : H'. rw [← h] at hW; simp [Winnable, List.drop_take] at hW; exact hW.of_take variable {H : PreLift hyp} (h : H.Winnable) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def takeMin := H.take (2 * k + 1 + h.num) (by omega) +@[expose, simps!] def takeMin := H.take (2 * k + 1 + h.num) (by omega) lemma takeMin_winnable : h.takeMin.Winnable := by simpa [Winnable, takeMin, List.drop_take] using h.shrink /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def x' : (H.game.residual ((H.x.val.drop (2 * k + 1)).take h.num)).tree := +@[expose, simps] def x' : (H.game.residual ((H.x.val.drop (2 * k + 1)).take h.num)).tree := ⟨H.x.val.drop (2 * k + 1 + h.num), by simp [game]⟩ attribute [simp_lengths] x'_coe variable (hp : IsPosition H.x.val Player.one) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def a : ExtensionsAt h.x' := h.strat h.x' (by have := H.hlvl; synthIsPosition) +@[expose] def a : ExtensionsAt h.x' := h.strat h.x' (by have := H.hlvl; synthIsPosition) /-- Auxiliary declaration for the Borel determinacy formalization. -/ def extension : ExtensionsAt H.x where val := (h.a hp).val diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/PreLift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/PreLift.lean index 8b07bcf8bb..fbf06f8a76 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/PreLift.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/PreLift.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.NormNum.OfScientific Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.One @@ -118,7 +118,7 @@ namespace Lift variable (H : Lift hyp) attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftVeryShort : gameTree hyp where +@[expose] def liftVeryShort : gameTree hyp where val := (pInv (treeHom hyp) (Tree.take (2 * k) H.x)).val ++ [⟨H.x.val[2 * k]'H.hlvl, H.liftTree⟩] property := by @@ -164,7 +164,7 @@ attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in _ = H.x.val.take (2 * k + 1) := by simp_all /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftShort : gameTree hyp := (H.R H.liftVeryShort +@[expose] def liftShort : gameTree hyp := (H.R H.liftVeryShort (by change H.liftVeryShort.val.length % 2 = Player.one.toNat simp_all) @@ -192,7 +192,7 @@ def liftShort : gameTree hyp := (H.R H.liftVeryShort H.liftShort.val.take (α := no_index _) (2 * k + 1) = H.liftVeryShort := ExtensionsAt.val'_take_of_eq _ H.liftVeryShort_length.symm /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftVal := if H.x.val.length = 2 * k + 1 then H.liftVeryShort.val +@[expose] def liftVal := if H.x.val.length = 2 * k + 1 then H.liftVeryShort.val else H.liftShort.val ++ (H.x.val.drop (2 * k + 2)).zipInitsMap (fun a y ↦ ⟨a, subAt (getTree' hyp H.liftShort.val) y⟩) @@ -241,7 +241,7 @@ attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in · simp -- for u drop (2 * k + 1) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def PreWonPos (u : List A) := LosingCondition H.liftShort.val (by simp) ∧ +@[expose] def PreWonPos (u : List A) := LosingCondition H.liftShort.val (by simp) ∧ (∃ (h : u ≠ []), u[0]'(by simpa [List.length_pos_iff]) = H.liftShort.val[2 * k + 1].1) ∧ getTree' hyp H.liftShort.val = pullSub (subAt G.tree (H.x.val.take (2 * k + 1) ++ u)) u.tail @@ -305,7 +305,7 @@ lemma liftVal_mono {H H' : Lift hyp} (h : H ≤ H') (ht : H.liftTree = H'.liftTr H.liftVal <+: H'.liftVal := by rw [eq_take h ht]; simpa using List.take_prefix _ _ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Con := H.x.val.drop (2 * k + 1) ∈ +@[expose] def Con := H.x.val.drop (2 * k + 1) ∈ pullSub (getTree' hyp H.liftShort.val) [H.liftShort.val[2 * k + 1].1] lemma Con.take h (h' : H.Con) : (H.take n h).Con := by simpa [Lift.Con, List.drop_take] using take_mem ⟨_, h'⟩ @@ -458,7 +458,7 @@ variable (H : PreLift hyp) htree := ⟨S, rfl⟩ attribute [simp_lengths] extend_toPreLift /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def WonPos := {u | ∃ S, (H.extend S).PreWonPos u} +@[expose] def WonPos := {u | ∃ S, (H.extend S).PreWonPos u} /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simps -isSimp] def game : Game A where tree := subAt G.tree (H.x.val.take (2 * k + 1)) @@ -478,9 +478,9 @@ lemma extend_take h S : (H.take n h).extend S = @[simp] lemma game_take h : (H.take n h).game = H.game := by ext1 <;> simp [game, List.take_take, h] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Won := ∃ u ∈ H.WonPos, u <+: H.x.val.drop (2 * k + 1) +@[expose] def Won := ∃ u ∈ H.WonPos, u <+: H.x.val.drop (2 * k + 1) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Winnable := WinningPrefix H.game Player.zero (H.x.val.drop (2 * k + 1)) +@[expose] def Winnable := WinningPrefix H.game Player.zero (H.x.val.drop (2 * k + 1)) /-- Auxiliary declaration for the Borel determinacy formalization. -/ def Losable' := ¬ WinningPrefix H.game Player.zero (H.x.val.drop (2 * k + 1)) end PreLift diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Strat.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Strat.lean index eee1dbf127..65f93d3023 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Strat.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/One/Strat.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Linarith.Frontend Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.One @@ -29,7 +29,7 @@ variable {A : Type*} {G : Game A} {k m n : ℕ} {hyp : Hyp G k} noncomputable section «Section1» /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def stratMap (lvl : ℕ) (R : ResStrategy (gameAsTrees hyp) Player.one lvl) : +@[expose] def stratMap (lvl : ℕ) (R : ResStrategy (gameAsTrees hyp) Player.one lvl) : ResStrategy (oldAsTrees hyp) Player.one lvl := fun x hp hlen ↦ if hxlen : x.val.length ≤ 2 * k then (ResStrategy.fromMap (treeHom hyp)) (R.res hlen) x hp le_rfl else diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/WinAsap.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/WinAsap.lean index a8c71a4883..43c1115553 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/WinAsap.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/WinAsap.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section lemma choose_eq {α : Type*} {p q : α → Prop} (hpq : ∀ a, p a ↔ q a) (h : ∃ a, p a) : @@ -39,7 +39,7 @@ open Stream'.Discrete Tree Game noncomputable section «Section1» variable {A : Type*} (G : Game A) (p : Player) /-- whether there exists a prefix of `x` that is a winning position for `p` -/ -def WinningPrefix (x : List A) := ∃ (n : ℕ), +@[expose] def WinningPrefix (x : List A) := ∃ (n : ℕ), (G.residual (x.take n)).ExistsWinning (p.residual (x.take n)) lemma winningPrefix_of_notMem {x} (h : x ∉ G.tree) : WinningPrefix G p x := by use x.length; simpa [residual_notMem G x h] using existsWinning_empty @@ -72,7 +72,7 @@ section «Section2» variable {x : List A} (h : WinningPrefix G p x) /-- the length of the shortest prefix of `x` that is winning for `p` -/ -noncomputable def num : ℕ := by +@[expose] noncomputable def num : ℕ := by classical exact Nat.find h lemma num_spec : (G.residual (x.take h.num)).ExistsWinning (p.residual (x.take h.num)) := by @@ -318,11 +318,7 @@ lemma winAsap_body (x : body (winAsap G p).subtree) suffices x.val.drop h.num ∈ body h.strat.pre.subtree by have hW := h.strat_winning this conv at hW => simp [hN] - obtain ⟨w, hpay, hw⟩ := hW - refine Set.mem_of_eq_of_mem (y := body.append (Stream'.take h.num x.val) w) ?_ hpay - apply Subtype.ext - change x.val = Stream'.take h.num x.val ++ₛ w.val - rw [hw, Stream'.append_take_drop] + simpa only [Player.payoff] using hW apply mem_body_of_take 0; intro n _ rw [← winAsap_subtree]; simp [hN] lemma winAsap_body' (x : body (winAsap G p).followUntilWon.subtree) diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero.lean index c023680d47..9b62ba2e47 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero.lean @@ -21,4 +21,4 @@ import Mathlib.Tactic.NormNum.Pow Import-only index for the player-zero lift and strategy construction modules. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Lift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Lift.lean index 1408fe0ca3..e6298f9fcc 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Lift.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Lift.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.Zero @@ -264,7 +264,7 @@ noncomputable def minLength : ℕ := by /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simp] lemma lt_minLength : 2 * k + 1 < H.minLength := by have := H.le_minLength; omega /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps!] def takeMin := H.take H.minLength H.le_minLength +@[expose, simps!] def takeMin := H.take H.minLength H.le_minLength @[simp] lemma takeMin_liftShort : H.takeMin.liftShort = H.liftShort := by simp [takeMin] @[simp] lemma takeMin_game : H.takeMin.game = H.game := by simp [takeMin] @@ -277,12 +277,12 @@ lemma le_of_take {n : ℕ} {h : 2 * k + 2 ≤ n} (hL : (H.take n h).Lost') : change Nat.find H.exists_prefix ≤ n exact Nat.find_le ⟨h, hL⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toLift] def toWLLift : WLLift hyp where +@[expose, simps toLift] def toWLLift : WLLift hyp where toLift := H.toLift liftTree := pullSub (subAt G.tree H.takeMin.x.val) (H.takeMin.x.val.drop (2 * k + 2)) end LLift /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps toLift] def Lost'.mk {H : Lift hyp} (h : Lost' H) : LLift hyp := LLift.mk _ h +@[expose, simps toLift] def Lost'.mk {H : Lift hyp} (h : Lost' H) : LLift hyp := LLift.mk _ h attribute [simp_lengths] LLift.toWLLift_toLift Lost'.mk_toLift section «extend'» @@ -467,14 +467,14 @@ lemma take (hn : 1 ≤ h.2.num + n) : apply WinningPrefix.of_take (n := h.num) simpa (disch := omega) [List.take_take] using h.shrink /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def x' : (H.game.residual ((H.x.val.drop (2 * k + 1)).take h.2.num)).tree where +@[expose, simps] def x' : (H.game.residual ((H.x.val.drop (2 * k + 1)).take h.2.num)).tree where val := H.x.val.drop (2 * k + 1 + h.2.num) property := by simpa [PreLift.ConLong] using h.1 attribute [simp_lengths] x'_coe section «Section3» variable (hp : IsPosition H.x.val Player.zero) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def a : ExtensionsAt h.x' := h.2.strat h.x' (by have := H.hlvl; synthIsPosition) +@[expose] def a : ExtensionsAt h.x' := h.2.strat h.x' (by have := H.hlvl; synthIsPosition) /-- Auxiliary declaration for the Borel determinacy formalization. -/ def extension : ExtensionsAt H.x where val := (h.a hp).val @@ -515,7 +515,7 @@ end Losable variable (H : Lift hyp) (hp : IsPosition H.x.val Player.zero) (R : ResStrategy ⟨_, T'⟩ Player.zero H.x.val.length) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -noncomputable def extension : ExtensionsAt H.x := by +@[expose] noncomputable def extension : ExtensionsAt H.x := by classical exact if h : H.Lost then h.toLLift'.extensionMap hp R diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/PreLift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/PreLift.lean index 5549996633..f529671c79 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/PreLift.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/PreLift.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.OfScientific Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.Zero @@ -68,7 +68,7 @@ lemma pInv_take_length_le : rw [H.pInv_take_length] attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftShort : gameTree hyp := (H.R (pInv (treeHom hyp) (Tree.take (2 * k) H.x)) +@[expose] def liftShort : gameTree hyp := (H.R (pInv (treeHom hyp) (Tree.take (2 * k) H.x)) H.pInv_take_position H.pInv_take_length_le).valT' attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in @[simp, simp_lengths] lemma liftShort_length : @@ -170,11 +170,11 @@ lemma take_le_take hm hn : H.take m hm ≤ H.take n hn ↔ m ≤ n ∨ H.x.val.l (conv => lhs; dsimp [LE.le]); simp [PreLift.ext_iff] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def ConShort := H.x.val[2 * k]'H.hlvl = H.liftShort.val[2 * k].1 +@[expose] def ConShort := H.x.val[2 * k]'H.hlvl = H.liftShort.val[2 * k].1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simp] lemma conShort_iff_take h : (H.take n h).ConShort ↔ H.ConShort := by simp [ConShort] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def ConLong := H.x.val.drop (2 * k + 1) ∈ H.game.tree +@[expose] def ConLong := H.x.val.drop (2 * k + 1) ∈ H.game.tree lemma conLong_take {h} (h' : H.ConLong) : (H.take n h).ConLong := by simpa [PreLift.ConLong, List.drop_take] using take_mem ⟨_, h'⟩ end PreLift @@ -191,9 +191,9 @@ instance : PartialOrder (Lift hyp) where namespace Lift variable (H : Lift hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Lost' := G.WonPosition H.x.val (Player.one.residual H.x.val) +@[expose] def Lost' := G.WonPosition H.x.val (Player.one.residual H.x.val) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def Losable := H.ConLong ∧ WinningPrefix H.game Player.one (H.x.val.drop (2 * k + 1)) +@[expose] def Losable := H.ConLong ∧ WinningPrefix H.game Player.one (H.x.val.drop (2 * k + 1)) /-- Auxiliary declaration for the Borel determinacy formalization. -/ def Winnable := ¬ WinningPrefix H.game Player.one (H.x.val.drop (2 * k + 1)) lemma Winnable.conLong (h : H.Winnable) : H.ConLong := Classical.byContradiction fun h' ↦ @@ -219,7 +219,7 @@ attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in lemma liftShort_lift : treeHom hyp H.liftShort = Tree.take (2 * k + 1) H.x := tree_ext H.liftShort_val_map /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftNode : A := H.x.val[2 * k + 1] +@[expose] def liftNode : A := H.x.val[2 * k + 1] /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simps toPreLift] def take (n : ℕ) (h : 2 * k + 2 ≤ n) : Lift hyp where @@ -253,7 +253,7 @@ namespace WLLift variable (H : WLLift hyp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftMediumVal : List (upA hyp) := H.liftShort.val ++ [⟨H.liftNode, H.liftTree⟩] +@[expose] def liftMediumVal : List (upA hyp) := H.liftShort.val ++ [⟨H.liftNode, H.liftTree⟩] attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in @[simp, simp_lengths] lemma liftMediumVal_length : H.liftMediumVal.length (α := no_index _) = 2 * k + 2 := by simp [liftMediumVal] @@ -272,7 +272,7 @@ attribute [local implicit_reducible] upA oldAsTrees gameAsTrees in simp_all /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def liftVal := H.liftMediumVal ++ +@[expose] def liftVal := H.liftMediumVal ++ (H.x.val.drop (2 * k + 2)).zipInitsMap (fun a y ↦ ⟨a, subAt H.liftTree y⟩) @[simp] lemma liftVal_take_medium : H.liftVal.take (2 * k + 2) = H.liftMediumVal := by simp [liftVal] @@ -333,7 +333,7 @@ lemma lift_lift : treeHom hyp H.lift = H.x := tree_ext H.liftVal_lift section «Section2» /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extension (hp : IsPosition H.x.val Player.zero) +@[expose] def extension (hp : IsPosition H.x.val Player.zero) (R : ResStrategy (gameAsTrees hyp) Player.zero H.x.val.length) := R H.lift (by change H.liftVal.length % 2 = Player.zero.toNat @@ -342,7 +342,7 @@ def extension (hp : IsPosition H.x.val Player.zero) change H.liftVal.length ≤ H.x.val.length rw [H.liftVal_length]) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extensionMap (hp : IsPosition H.x.val Player.zero) +@[expose] def extensionMap (hp : IsPosition H.x.val Player.zero) (R : ResStrategy (gameAsTrees hyp) Player.zero H.x.val.length) := ExtensionsAt.map (treeHom hyp) H.lift_lift (H.extension hp R) variable (hp : IsPosition H.x.val Player.zero) diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Strat.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Strat.lean index fb02c03468..e8fb0c0d71 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Strat.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/Strat.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.Zero diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/TreeLift.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/TreeLift.lean index 41a5e86918..e28ec8c3b7 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/TreeLift.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Proof/Zero/TreeLift.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.OfScientific Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace GaleStewartGame.BorelDet.Zero @@ -33,7 +33,7 @@ variable {A : Type*} {G : Game A} {k : ℕ} {hyp : Hyp G k} {m n : ℕ} noncomputable section «Section1» /-- Auxiliary declaration for the Borel determinacy formalization. -/ -noncomputable def stratMap (lvl : ℕ) (R : ResStrategy (gameAsTrees hyp) Player.zero lvl) : +@[expose] noncomputable def stratMap (lvl : ℕ) (R : ResStrategy (gameAsTrees hyp) Player.zero lvl) : ResStrategy (oldAsTrees hyp) Player.zero lvl := by classical exact fun x hp hlen ↦ diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/QualityAliases.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/QualityAliases.lean index 82aafb1792..e43b486487 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/QualityAliases.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/QualityAliases.lean @@ -17,7 +17,7 @@ These aliases preserve names that Lean Pool's deterministic quality audit derive from dotted declarations inside namespaces. -/ -@[expose] public section +public section namespace AllWinning alias residual := GaleStewartGame.Game.AllWinning.residual diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree.lean index f8905e8725..3726125ec2 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree.lean @@ -25,4 +25,4 @@ import Mathlib.Tactic.NormNum.Pow Import-only index for tree, body, restriction, limit, and functoriality modules. -/ -@[expose] public section +public section diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/BodyFunctor.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/BodyFunctor.lean index 1945e94a8c..d9965473b2 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/BodyFunctor.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/BodyFunctor.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -34,7 +34,7 @@ variable {A A' : Type*} {n : ℕ} noncomputable section «Section1» variable {S : tree A} {T : tree A'} /-- The set of points in `body S` where the body map of f is defined -/ -def bodyDom (f : OrderHom S T) : Set (Stream' A) := { a | a ∈ body S ∧ +@[expose] def bodyDom (f : OrderHom S T) : Set (Stream' A) := { a | a ∈ body S ∧ Set.Unbounded Nat.le ((fun (x : S) ↦ (f x).val.length) '' { x | a ∈ principalOpen x }) } lemma bodyMap_uniq (f : OrderHom S T) {a : Stream' A} {x y : List A} {ha : a ∈ body S} (hx : a ∈ principalOpen x) (hy : a ∈ principalOpen y) @@ -65,7 +65,7 @@ lemma bodyMap_pspec (f : OrderHom S T) (a : bodyDom f) {x} rfl /-- The induced map on branches -/ -def bodyMap (f : OrderHom S T) (a : bodyDom f) : body T := +@[expose] def bodyMap (f : OrderHom S T) (a : bodyDom f) : body T := ⟨bodyMapVal f a, by intro y hy; apply mem_of_prefix (y := bodyMapChooseSpec f a y.length) _ (SetLike.coe_mem _) rw [principalOpen_iff_restrict] at hy; nth_rw 1 [hy]; apply List.prefix_iff_eq_take.mpr @@ -106,9 +106,11 @@ variable {S T : Trees} refine ⟨⟨x.take (n + 1), hx _ (extend_sub _ _)⟩, extend_sub _ _, ?_⟩ simp /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps obj] def bodyPre : Prefunctor Trees (Type*) where +@[expose] def bodyPre : Prefunctor Trees (Type*) where obj S := body S.2 map f := TypeCat.ofHom fun a ↦ bodyMap f.toOrderHom ⟨a, by simp⟩ + +@[simp] theorem bodyPre_obj (S : Trees) : bodyPre.obj S = body S.2 := by rfl @[ext] lemma bodyPre_obj_ext {x y : bodyPre.obj S} (h : x.val = y.val) : x = y := Subtype.ext h lemma LenHom.bodyMap_spec (f : S ⟶ T) (a : body S.2) @@ -128,7 +130,7 @@ lemma LenHom.bodyPre_map_restrict (f : S ⟶ T) (a : body S.2) n : · intro m hm _ simpa [bodyPre] using LenHom.bodyMap_spec_res_lt f a hm /-- the body of a tree is functorial -/ -@[simps! obj] def bodyFunctor : Trees ⥤ Type* where +@[expose] def bodyFunctor : Trees ⥤ Type* where obj S := body S.2 map f := bodyPre.map f map_id _ := by @@ -146,6 +148,9 @@ lemma LenHom.bodyPre_map_restrict (f : S ⟶ T) (a : body S.2) n : apply tree_ext exact LenHom.bodyPre_map_restrict f x (n + 1) simp_all + +@[simp] theorem bodyFunctor_obj (S : Trees) : bodyFunctor.obj S = body S.2 := by rfl + instance bodySpace : TopologicalSpace (Tree.bodyFunctor.obj S) := inferInstanceAs (TopologicalSpace (body S.2)) lemma bodyMap_spec' (f : S ⟶ T) (a : body S.2) diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/LenTreeHom.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/LenTreeHom.lean index 155e6afdcc..4cb709ea69 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/LenTreeHom.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/LenTreeHom.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section open CategoryTheory @@ -34,7 +34,7 @@ namespace Descriptive.Tree noncomputable section «Section1» /-- The objects of the category of trees -/ -def Trees := Σ A, tree A +@[expose] def Trees := Σ A, tree A instance : CoeSort Trees (Type _) where coe S := S.2 variable {S T U : Trees} diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/PointedTrees.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/PointedTrees.lean index 498edcf6e0..f07b888118 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/PointedTrees.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/PointedTrees.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -28,7 +28,7 @@ open CategoryTheory Descriptive noncomputable section «Section1» /-- A tree with a chosen base node -/ -def PointedTrees := Σ (T : Trees), T +@[expose] def PointedTrees := Σ (T : Trees), T /-- a base node preserving morphism of trees -/ @[ext (flat := false)] structure PointedLenHom (S T : PointedTrees) @@ -37,7 +37,7 @@ def PointedTrees := Σ (T : Trees), T variable {S T : PointedTrees} {n : ℕ} namespace PointedLenHom /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def toHom (f : PointedLenHom S T) : S.1 ⟶ T.1 := f.toLenHom +@[expose] def toHom (f : PointedLenHom S T) : S.1 ⟶ T.1 := f.toLenHom instance : FunLike (PointedLenHom S T) S.1 T.1 where coe f := f.toHom coe_injective _ _ h := PointedLenHom.ext <| LenHom.ext h @@ -109,7 +109,7 @@ lemma concat_uniq b (hb : (f ⟨x, mem_of_append hx⟩).val ++ [b] = (f ⟨_, hx end «Section2» /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extensions : PointedTrees ⥤ Type* where +@[expose] def extensions : PointedTrees ⥤ Type* where obj T := { a : T.1.1 | T.2.val ++ [a] ∈ T.1.2 } map f := TypeCat.ofHom fun a ↦ ⟨concat (forgetPoint.map f) a.prop, by dsimp only [Set.mem_ofPred_eq]; erw [← f.hp, ← concat_spec]; apply SetLike.coe_mem⟩ @@ -126,11 +126,13 @@ def extensions : PointedTrees ⥤ Type* where simp_all /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extensions.val' {T : PointedTrees} (a : extensions.obj T) : List T.1.1 := +@[expose] def extensions.val' {T : PointedTrees} (a : extensions.obj T) : List T.1.1 := T.2.val ++ [a.val] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def extensions.valT' {T : PointedTrees} (a : extensions.obj T) : T.1 := +@[expose] def extensions.valT' {T : PointedTrees} (a : extensions.obj T) : T.1 := ⟨extensions.val' a, a.prop⟩ +@[simp] lemma extensions.valT'_coe {T : PointedTrees} (a : extensions.obj T) : + (extensions.valT' a).val = extensions.val' a := by rfl @[simp] lemma extensions_map_val' {S T : PointedTrees} (f : S ⟶ T) (a : extensions.obj S) : extensions.val' (extensions.map f a) = (f.toHom ⟨extensions.val' a, a.prop⟩).val := by @@ -144,7 +146,7 @@ def extensions.val' {T : PointedTrees} (a : extensions.obj T) : List T.1.1 := /-- Auxiliary declaration for the Borel determinacy formalization. -/ abbrev mkPointed {T : Trees} (x : T) : PointedTrees := ⟨T, x⟩ /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def mkPointedMor {S T : Trees} (f : S ⟶ T) (x : S) : +@[expose] def mkPointedMor {S T : Trees} (f : S ⟶ T) (x : S) : mkPointed x ⟶ mkPointed (f x) := ⟨f, rfl⟩ namespace ExtensionsAt diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/RestrictTree.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/RestrictTree.lean index bfbeb46fd4..a4c1db542a 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/RestrictTree.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/RestrictTree.lean @@ -26,7 +26,7 @@ import Mathlib.Tactic.NormNum.OfScientific Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -36,7 +36,7 @@ noncomputable section «Section1» variable {S T U : Trees} {k m n : ℕ} /-- Remove all nodes of a tree beyond level k -/ -@[simps! obj_fst] def res (k : ℕ) : Trees ⥤ Trees where +@[expose] def res (k : ℕ) : Trees ⥤ Trees where obj S := @id Trees ⟨S.1, { val := {x | x ∈ S.2 ∧ x.length ≤ k} property := by as_aux_lemma => @@ -51,16 +51,25 @@ variable {S T U : Trees} {k m n : ℕ} map_id _ := rfl map_comp _ _ := rfl +@[simp] theorem res_obj_fst (S : Trees) : ((res k).obj S).fst = S.fst := by rfl + @[ext] lemma res_ext (x y : (res k).obj S) (h : x.val = y.val) : x = y := Subtype.ext h @[simp] lemma mem_res_obj (x : List T.1) : Membership.mem (γ := tree T.1) ((Tree.res k).obj T).2 x ↔ x ∈ T.2 ∧ x.length ≤ k := Iff.rfl /-- Remove all nodes of a tree not on level exactly k -/ -@[simps map] def resEq (k : ℕ) : Trees ⥤ Type* where +@[expose] def resEq (k : ℕ) : Trees ⥤ Type* where obj := fun S ↦ {x | x ∈ S.2 ∧ x.length = k} map := fun f ↦ TypeCat.ofHom fun x ↦ ⟨(f ⟨x.val, x.prop.1⟩).val, by simp [x.prop.2]⟩ map_id _ := rfl map_comp _ _ := rfl + +@[simp] theorem resEq_map (f : S ⟶ T) : + (resEq k).map f = TypeCat.ofHom (fun x : (resEq k).obj S ↦ + ⟨(f ⟨x.val, x.prop.1⟩).val, by simp [x.prop.2]⟩) := by rfl + +@[simp] theorem resEq_map_val (f : S ⟶ T) (x : (resEq k).obj S) : + ((resEq k).map f x).val = (f ⟨x.val, x.prop.1⟩).val := by rfl @[ext] lemma resEq_ext (x y : (resEq k).obj S) (h : x.val = y.val) : x = y := Subtype.ext h lemma resEq_ext_hEq (x : (resEq k).obj T) (y : (resEq m).obj T) (h' : x.val = y.val) : HEq x y := by @@ -71,7 +80,8 @@ lemma resEq_ext_hEq (x : (resEq k).obj T) (y : (resEq m).obj T) (h' : x.val = y. /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simp] lemma res_mem (x : (res k).obj S) : x.val ∈ S.2 := x.prop.1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def res.val' (x : (res k).obj S) : S := ⟨_, res_mem x⟩ +@[expose] def res.val' (x : (res k).obj S) : S := ⟨_, res_mem x⟩ +@[simp] theorem res.val'_coe (x : (res k).obj S) : (res.val' x).val = x.val := by rfl lemma res.ext_val' {x y : (res k).obj S} (h : res.val' x = res.val' y) : x = y := by apply_fun Subtype.val at h; ext1; exact h @[simp] lemma res_val (f : S ⟶ T) (k : ℕ) x : @@ -83,7 +93,8 @@ lemma res.ext_val' {x y : (res k).obj S} (h : res.val' x = res.val' y) : x = y : /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simp] lemma resEq_mem (x : (resEq k).obj S) : x.val ∈ S.2 := x.prop.1 /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def resEq.val' (x : (resEq k).obj S) : S := ⟨_, resEq_mem x⟩ +@[expose] def resEq.val' (x : (resEq k).obj S) : S := ⟨_, resEq_mem x⟩ +@[simp] theorem resEq.val'_coe (x : (resEq k).obj S) : (resEq.val' x).val = x.val := by rfl lemma resEq.ext_val' {x y : (resEq k).obj S} (h : resEq.val' x = resEq.val' y) : x = y := by apply_fun Subtype.val at h; ext1; exact h lemma resEq_val (f : S ⟶ T) (k : ℕ) x : diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeBody.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeBody.lean index 2b9e4b1669..40879eee92 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeBody.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeBody.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -32,13 +32,16 @@ variable {A : Type*} (S T : tree A) /-- The body of a tree T, also written [T] in the literature, is the set of infinite branches, implemented as `Stream` -/ -def body : Set (Stream' A) := { y | ∀ x, y ∈ principalOpen x → x ∈ T } +@[expose] def body : Set (Stream' A) := { y | ∀ x, y ∈ principalOpen x → x ∈ T } @[gcongr] lemma body_mono {S T : tree A} (h : S ≤ T) : body S ⊆ body T := fun _ h' x y ↦ h (h' x y) /-- Auxiliary declaration for the Borel determinacy formalization. -/ @[simp] lemma take_mem_body {T : tree A} {x} (h : x ∈ body T) n : x.take n ∈ T := h _ (by simp) /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps coe] def body.take {T : tree A} (n : ℕ) (x : body T) : T := ⟨_, take_mem_body x.2 n⟩ +@[expose] def body.take {T : tree A} (n : ℕ) (x : body T) : T := + ⟨_, take_mem_body x.2 n⟩ +@[simp] lemma body.take_coe {T : tree A} (n : ℕ) (x : body T) : + (body.take n x : List A) = Stream'.take n x := by rfl attribute [simp_lengths] body.take_coe lemma mem_body_of_take m (T : tree A) (x : Stream' A) (h : ∀ n ≥ m, x.take n ∈ T) : x ∈ body T := by @@ -78,7 +81,7 @@ def bodyInfHom : sInfHom (tree A) (Set (Stream' A)) where · intro h _ _; apply h; simpa /-- Appending lists to the front of a branch lifts as an operation on bodies -/ -@[simps -fullyApplied coe] +@[expose, simps -fullyApplied coe] def body.append {T : tree A} (x : List A) (y : body (subAt T x)) : body T := ⟨x ++ₛ y.val, by simpa using y.prop⟩ @[simp] lemma body_append_nil (y : body T) : body.append (T := no_index _) [] y = y := rfl @@ -94,9 +97,10 @@ lemma body.append_con {T : tree A} (x : List A) : Continuous (@body.append A T x exact ⟨by simp, by simpa [subAt_body] using a.prop⟩ · rintro ⟨⟨b, rfl⟩, ha⟩; use ⟨x ++ₛ b, ha⟩, ⟨⟨b, by simpa⟩, rfl⟩ /-- Dropping the first elements of a branch lifts as an operation on bodies -/ -@[simps -fullyApplied coe] def body.drop {T : tree A} (n : ℕ) (x : body T) : body (subAt T (x.val.take n)) := ⟨x.1.drop n, by simp⟩ +@[simp] lemma body.drop_coe {T : tree A} (n : ℕ) (x : body T) : + (body.drop n x : Stream' A) = Stream'.drop n x := by rfl section «Section1» variable {T : tree A} (X : Set (body T)) (x : List A) diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeExtensions.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeExtensions.lean index d9e5c6ec01..39a95861ba 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeExtensions.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeExtensions.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -42,7 +42,7 @@ abbrev pointedResObj (k : ℕ) (T : PointedTrees) : PointedTrees where snd := ⟨T.2.val.take k, Tree.take_mem T.2, List.length_take_le k T.2.val⟩ /-- restriction of a pointed tree, obtained by replacing the base node by an ancestor if necessary -/ -def pointedRes (k : ℕ) : PointedTrees ⥤ PointedTrees where +@[expose] def pointedRes (k : ℕ) : PointedTrees ⥤ PointedTrees where obj := pointedResObj k map {S T} f := ⟨(forgetPoint ⋙ res k).map f, by ext1; change (f.toHom (Tree.take k S.2)).val = _ @@ -55,7 +55,7 @@ lemma pointedRes_isIso_iff_fixing k {S T : PointedTrees} (f : S ⟶ T) : IsIso ((pointedRes k).map f) ↔ Fixing k f.toHom := by simp only [pointed_isIso_iff]; use Fixing.mk, fun h ↦ h.prop /-- Auxiliary declaration for the Borel determinacy formalization. -/ -def extensionsRes T : +@[expose] def extensionsRes T : extensions.obj T ≃ extensions.obj ((pointedRes (T.2.val.length + 1)).obj T) where toFun a := ⟨a.val, by constructor diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeLim.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeLim.lean index 6d31349b2b..21e014799e 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeLim.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/TreeLim.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.NormNum.OfScientific Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -57,7 +57,7 @@ lemma headD_nonempty (x : constTreeObj k A) (h : x.val ≠ []) : headD x = x.val @[simp] lemma constTree_zero (x : constTreeObj 0 A) : x.val = [] := by apply List.eq_nil_of_length_eq_zero; linarith [constTree_length x] /-- Adjoint of `res k` -/ -def constTree (k : ℕ) : Type* ⥤ Trees where +@[expose] def constTree (k : ℕ) : Type* ⥤ Trees where obj A := ⟨A, constTreeObj k A⟩ map f := { toFun := fun ⟨x, h⟩ ↦ ⟨List.map (ConcreteCategory.hom f) x, by diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/Trees.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/Trees.lean index 1be69b3c8b..39f8b4624b 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/Trees.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Tree/Trees.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Auxiliary declarations for the Borel determinacy formalization. -/ -@[expose] public section +public section namespace Descriptive.Tree @@ -30,26 +30,32 @@ namespace Descriptive.Tree variable {A A' : Type*} (S T : tree A) (x y : List A) /-- Set of children of node x as elements of T -/ -def ExtensionsAt {T : tree A} (x : T) := { a : A // x.val ++ [a] ∈ T } +@[expose] def ExtensionsAt {T : tree A} (x : T) := { a : A // x.val ++ [a] ∈ T } namespace ExtensionsAt variable {S T} variable {n : ℕ} {x : T} (a : ExtensionsAt x) /-- The underlying list of a child -/ -def val' := x.val ++ [a.val] +@[expose] def val' := x.val ++ [a.val] /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps coe] def valT' : T := ⟨a.val', a.prop⟩ +@[expose] def valT' : T := ⟨a.val', a.prop⟩ +@[simp] lemma valT'_coe : (a.valT' : List A) = a.val' := by rfl @[ext] lemma ext {a b : ExtensionsAt x} (h : a.val = b.val) : a = b := Subtype.ext h lemma ext_val' {a b : ExtensionsAt x} (h : a.val' = b.val') : a = b := by ext; simpa [val'] using h lemma ext_valT' {a b : ExtensionsAt x} (h : a.valT' = b.valT') : a = b := ext_val' <| congr_arg Subtype.val h /-- Auxiliary declaration for the Borel determinacy formalization. -/ -@[simps] def drop {T : tree A} {n : ℕ} {x : T} : +@[expose] def drop {T : tree A} {n : ℕ} {x : T} : ExtensionsAt x ≃ ExtensionsAt (Tree.drop T n x) where --TODO fix T explicit toFun a := ⟨a.val, by simpa [← List.append_assoc] using a.prop⟩ invFun a := ⟨a.val, by simpa [← List.append_assoc] using a.prop⟩ left_inv _ := rfl right_inv _ := rfl +@[simp] lemma drop_apply_coe {T : tree A} {n : ℕ} {x : T} (a : ExtensionsAt x) : + (drop (n := n) a).val = a.val := by rfl +@[simp] lemma drop_symm_apply_coe {T : tree A} {n : ℕ} + {x : T} (a : ExtensionsAt (Tree.drop T n x)) : + ((drop (n := n) (x := x)).symm a).val = a.val := by rfl @[simp] lemma val'_length : a.val' (A := no_index _).length (α := no_index _) = x.val.length (α := no_index _) + 1 := by simp [ExtensionsAt.val'] @@ -72,7 +78,7 @@ lemma valT'_take_of_eq (a : ExtensionsAt x) (h : n = x.val.length) : end ExtensionsAt /-- A tree is pruned if it has no leaves -/ -def IsPruned : Prop := ∀ x : T, Nonempty (ExtensionsAt x) +@[expose] def IsPruned : Prop := ∀ x : T, Nonempty (ExtensionsAt x) lemma IsPruned.sub {T : tree A} (h : IsPruned T) (x : List A) : IsPruned (subAt T x) := by intro ⟨y, h'⟩ simpa only [ExtensionsAt, nonempty_subtype, List.append_assoc, mem_subAt] using h ⟨_, h'⟩ diff --git a/LeanPool/AgreeToDisagree.lean b/LeanPool/AgreeToDisagree.lean index c62a7f54a8..fd3aa0507b 100644 --- a/LeanPool/AgreeToDisagree.lean +++ b/LeanPool/AgreeToDisagree.lean @@ -20,7 +20,7 @@ Tags: probability, game-theory, epistemic-logic MSC: 60A10, 91A40 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/AgreeToDisagree/AgreeToDisagree.lean b/LeanPool/AgreeToDisagree/AgreeToDisagree.lean index 1f8f192400..1de050eb5a 100644 --- a/LeanPool/AgreeToDisagree/AgreeToDisagree.lean +++ b/LeanPool/AgreeToDisagree/AgreeToDisagree.lean @@ -16,7 +16,7 @@ This file develops information partitions and conditional probabilities needed for Aumann's agreement theorem. -/ -@[expose] public section +public section namespace AgreeToDisagree @@ -57,7 +57,7 @@ lemma Partition.le_iff {P Q : Partition α} : P ≤ Q ↔ ∀ s ∈ P, ∃ t ∈ exact hs'.2 <| hab t ht hat /-- We call a partition of a measurable space measurable if it consists of measurable sets. -/ -protected def Partition.Measurable [MeasurableSpace Ω] (P : Partition Ω) := +@[expose] protected def Partition.Measurable [MeasurableSpace Ω] (P : Partition Ω) := ∀ s ∈ P, MeasurableSet s /-- If a countable partition is measurable, every partition it refines is measurable too. diff --git a/LeanPool/AgreeToDisagree/AgreeToDisagreeBeliefs.lean b/LeanPool/AgreeToDisagree/AgreeToDisagreeBeliefs.lean index 5eb7ac59cf..9fd33256ab 100644 --- a/LeanPool/AgreeToDisagree/AgreeToDisagreeBeliefs.lean +++ b/LeanPool/AgreeToDisagree/AgreeToDisagreeBeliefs.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Normed.Group.InfiniteSum This file proves the `p`-belief version of Aumann's agreement theorem. -/ -@[expose] public section +public section namespace AgreeToDisagree diff --git a/LeanPool/AharoniKorman.lean b/LeanPool/AharoniKorman.lean index 8c16ff9476..22a59ca3ed 100644 --- a/LeanPool/AharoniKorman.lean +++ b/LeanPool/AharoniKorman.lean @@ -20,7 +20,7 @@ Tags: order-theory, combinatorics, partial-orders MSC: 06A06, 06A07 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/AharoniKorman/Counterexample.lean b/LeanPool/AharoniKorman/Counterexample.lean index 2734933414..ed90591fce 100644 --- a/LeanPool/AharoniKorman/Counterexample.lean +++ b/LeanPool/AharoniKorman/Counterexample.lean @@ -77,14 +77,14 @@ aim of reaching a contradiction (as then, no such partition can exist). We may f we have a contradiction (`no_spinalMap`), and therefore show that no spinal map exists. -/ -@[expose] public section +public section attribute [aesop 2 simp] Set.subset_def Finset.subset_iff namespace LeanPool.AharoniKorman /-- A type synonym on ℕ³ on which we will construct Hollom's partial order P_5. -/ -def Hollom : Type := ℕ × ℕ × ℕ +@[expose] def Hollom : Type := ℕ × ℕ × ℕ deriving DecidableEq /-- @@ -92,13 +92,13 @@ The backward equivalence between ℕ³ and the underlying set in Hollom's partia Note that this equivalence does not respect the partial order relation, and therefore should be used explicitly to transfer between the two types, despite their being equal. -/ -def ofHollom : Hollom ≃ ℕ × ℕ × ℕ := Equiv.refl _ +@[expose] def ofHollom : Hollom ≃ ℕ × ℕ × ℕ := Equiv.refl _ /-- The forward equivalence between ℕ³ and the underlying set in Hollom's partial order. Note that this equivalence does not respect the partial order relation, and therefore should be used explicitly to transfer between the two types, despite their being equal. -/ -def toHollom : ℕ × ℕ × ℕ ≃ Hollom := Equiv.refl _ +@[expose] def toHollom : ℕ × ℕ × ℕ ≃ Hollom := Equiv.refl _ @[simp] lemma ofHollom_symm_eq : ofHollom.symm = toHollom := rfl @[simp] lemma toHollom_symm_eq : toHollom.symm = ofHollom := rfl @@ -211,7 +211,7 @@ private lemma embed_injective (n : ℕ) : Function.Injective fun x : ℕ × ℕ For each `n`, there is an order embedding from ℕ × ℕ (which has the product order) to the Hollom partial order. -/ -def embed (n : ℕ) : ℕ × ℕ ↪o Hollom where +@[expose] def embed (n : ℕ) : ℕ × ℕ ↪o Hollom where toFun x := h(x.1, x.2, n) inj' := private embed_injective n map_rel_iff' := by simp @@ -250,7 +250,7 @@ lemma ordConnected_level {n : ℕ} : (level n).OrdConnected := by exact le_antisymm (le_of_toHollom_le_toHollom h1) (le_of_toHollom_le_toHollom h2) /-- The map from `(x, y, n)` to `x + y`. -/ -@[pp_nodot] def line (x : Hollom) : ℕ := (ofHollom x).1 + (ofHollom x).2.1 +@[pp_nodot, expose] def line (x : Hollom) : ℕ := (ofHollom x).1 + (ofHollom x).2.1 @[simp] lemma line_toHollom (x : ℕ × ℕ × ℕ) : line (toHollom x) = x.1 + x.2.1 := rfl diff --git a/LeanPool/AharoniKorman/ForMathlib.lean b/LeanPool/AharoniKorman/ForMathlib.lean index 8b7fb35b2e..e1a2136bf0 100644 --- a/LeanPool/AharoniKorman/ForMathlib.lean +++ b/LeanPool/AharoniKorman/ForMathlib.lean @@ -14,4 +14,4 @@ import Mathlib.Data.Finset.Attr This module collects helper lemmas used by the Aharoni-Korman counterexample. -/ -@[expose] public section +public section diff --git a/LeanPool/AharoniKorman/ForMathlib/Misc.lean b/LeanPool/AharoniKorman/ForMathlib/Misc.lean index d66f58a520..74a2c0f21b 100644 --- a/LeanPool/AharoniKorman/ForMathlib/Misc.lean +++ b/LeanPool/AharoniKorman/ForMathlib/Misc.lean @@ -16,7 +16,7 @@ A collection of results for the disproof of the Aharoni–Korman conjecture whic mathlib. -/ -@[expose] public section +public section namespace LeanPool.AharoniKorman diff --git a/LeanPool/AndersonConjecture.lean b/LeanPool/AndersonConjecture.lean index 6582888000..9b9be161b3 100644 --- a/LeanPool/AndersonConjecture.lean +++ b/LeanPool/AndersonConjecture.lean @@ -29,7 +29,7 @@ Tags: commutative-algebra, ring-theory MSC: 13B35, 13H10 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/AndersonConjecture/AdicKerEval.lean b/LeanPool/AndersonConjecture/AdicKerEval.lean index c04c5af0b8..f13aefeed0 100644 --- a/LeanPool/AndersonConjecture/AdicKerEval.lean +++ b/LeanPool/AndersonConjecture/AdicKerEval.lean @@ -21,7 +21,7 @@ This follows from the kernel description for evaluation on a finitely generated adic completion. -/ -@[expose] public section +public section open scoped Pointwise open AdicCompletion diff --git a/LeanPool/AndersonConjecture/AdicLocal.lean b/LeanPool/AndersonConjecture/AdicLocal.lean index 9878047ff5..bcc3dee657 100644 --- a/LeanPool/AndersonConjecture/AdicLocal.lean +++ b/LeanPool/AndersonConjecture/AdicLocal.lean @@ -18,7 +18,7 @@ a local ring. The maximal ideal of the completion is the kernel of the natural surjection onto the residue field R/M. -/ -@[expose] public section +public section open scoped Pointwise open AdicCompletion Ideal Finset diff --git a/LeanPool/AndersonConjecture/AdicNoetherian.lean b/LeanPool/AndersonConjecture/AdicNoetherian.lean index 748b34e852..310ae53d37 100644 --- a/LeanPool/AndersonConjecture/AdicNoetherian.lean +++ b/LeanPool/AndersonConjecture/AdicNoetherian.lean @@ -23,7 +23,7 @@ M-adically complete, so the Noetherian property lifts by successive approximation (Atiyah--Macdonald, Prop. 10.11). -/ -@[expose] public section +public section open AdicCompletion diff --git a/LeanPool/AndersonConjecture/Basic.lean b/LeanPool/AndersonConjecture/Basic.lean index 0d13bdcd6d..8e2d5ddc0b 100644 --- a/LeanPool/AndersonConjecture/Basic.lean +++ b/LeanPool/AndersonConjecture/Basic.lean @@ -21,7 +21,7 @@ chains with zero intersection. We also define analytical irreducibility (the M-adic completion is a domain). -/ -@[expose] public section +public section open scoped Pointwise @@ -32,7 +32,7 @@ ideals `A : ℕ → Ideal R` and each `k : ℕ`, there exists `s` such that `A s ≤ (⨅ n, A n) ⊔ (IsLocalRing.maximalIdeal R) ^ k`. This is Definition 1.1 of Anderson (2014). -/ -def IsQuasiComplete : Prop := +@[expose] def IsQuasiComplete : Prop := ∀ (A : ℕ → Ideal R), Antitone A → ∀ (k : ℕ), ∃ s, A s ≤ (⨅ n, A n) ⊔ (IsLocalRing.maximalIdeal R) ^ k @@ -43,14 +43,14 @@ there exists `s` such that `A s ≤ (IsLocalRing.maximalIdeal R) ^ k`. Equivalently, this is `IsQuasiComplete` restricted to sequences whose intersection is `⊥`. -/ -def IsWeaklyQuasiComplete : Prop := +@[expose] def IsWeaklyQuasiComplete : Prop := ∀ (A : ℕ → Ideal R), Antitone A → (⨅ n, A n) = ⊥ → ∀ (k : ℕ), ∃ s, A s ≤ (IsLocalRing.maximalIdeal R) ^ k /-- A local ring `R` is **analytically irreducible** if its maximal-ideal-adic completion is a domain. (This notion is primarily of interest for Noetherian local rings.) -/ -def IsAnalyticallyIrreducible : Prop := +@[expose] def IsAnalyticallyIrreducible : Prop := IsDomain (AdicCompletion (IsLocalRing.maximalIdeal R) R) /-- Quasi-completeness implies weak quasi-completeness. -/ diff --git a/LeanPool/AndersonConjecture/CompleteDomain.lean b/LeanPool/AndersonConjecture/CompleteDomain.lean index a935a6b23e..ca72df39cc 100644 --- a/LeanPool/AndersonConjecture/CompleteDomain.lean +++ b/LeanPool/AndersonConjecture/CompleteDomain.lean @@ -22,4 +22,4 @@ ring `T = ℂ[[x,y,z]]/(x²-yz)` is a complete two-dimensional Cohen–Macaulay local domain with a non-principal height-one prime. -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/CompleteDomain/CompleteDomain.lean b/LeanPool/AndersonConjecture/CompleteDomain/CompleteDomain.lean index 7434b4e5a7..5d2c7c080b 100644 --- a/LeanPool/AndersonConjecture/CompleteDomain/CompleteDomain.lean +++ b/LeanPool/AndersonConjecture/CompleteDomain/CompleteDomain.lean @@ -22,14 +22,14 @@ ideal (x^2-yz). It is a two-dimensional Noetherian complete local domain with a height-one prime Q = (x,y) that is not principal. -/ -@[expose] public section +public section noncomputable section open MvPowerSeries in /-- Q = (x, y)T, the height-1 prime that is not principal. Here x = image of X 0, y = image of X 1 in T. -/ -def Q : Ideal T := +@[expose] def Q : Ideal T := Ideal.span {Ideal.Quotient.mk conjI (X 0), Ideal.Quotient.mk conjI (X 1)} /-- Ring hom from MvPowerSeries (Fin 3) ℂ to PowerSeries ℂ that "projects onto X₂": diff --git a/LeanPool/AndersonConjecture/CompleteDomain/Domain.lean b/LeanPool/AndersonConjecture/CompleteDomain/Domain.lean index cd7e4d1cab..47ef33acf4 100644 --- a/LeanPool/AndersonConjecture/CompleteDomain/Domain.lean +++ b/LeanPool/AndersonConjecture/CompleteDomain/Domain.lean @@ -19,13 +19,13 @@ Construction of T = C[[x,y,z]]/(x^2 - yz) and the proof that T is an integral domain. -/ -@[expose] public section +public section noncomputable section open MvPowerSeries in /-- The ideal (x² - yz) in ℂ[[x,y,z]] where x = X 0, y = X 1, z = X 2. -/ -def conjI : Ideal (MvPowerSeries (Fin 3) ℂ) := +@[expose] def conjI : Ideal (MvPowerSeries (Fin 3) ℂ) := Ideal.span {(X 0) ^ 2 - (X 1) * (X 2)} /-- T = ℂ[[x,y,z]]/(x²-yz), the main complete local domain. -/ @@ -43,7 +43,7 @@ open MvPowerSeries /-- The substitution map ψ : ℂ[[x,y,z]] → ℂ[[u,v]] defined by x ↦ u·v, y ↦ u², z ↦ v². -/ -noncomputable def ψMap : Fin 3 → MvPowerSeries (Fin 2) ℂ := +@[expose] noncomputable def ψMap : Fin 3 → MvPowerSeries (Fin 2) ℂ := fun i => match i with | 0 => X 0 * X 1 | 1 => (X 0) ^ 2 @@ -56,7 +56,7 @@ lemma ψ_hasSubst : HasSubst (a := ψMap) := by /-- The algebra hom `ℂ[[x,y,z]] → ℂ[[u,v]]` induced by the substitution `ψMap` (`x ↦ uv`, `y ↦ u²`, `z ↦ v²`). -/ -noncomputable def ψHom : +@[expose] noncomputable def ψHom : MvPowerSeries (Fin 3) ℂ →ₐ[ℂ] MvPowerSeries (Fin 2) ℂ := MvPowerSeries.substAlgHom ψ_hasSubst @@ -91,7 +91,7 @@ lemma anderson_gen_ne_zero : (X (0 : Fin 3) : MvPowerSeries (Fin 3) ℂ) ^ 2 - sub_zero, one_ne_zero] at hcoeff /-- The factored map ψbar : T → ℂ[[u,v]]. -/ -noncomputable def ψBar : T →+* MvPowerSeries (Fin 2) ℂ := +@[expose] noncomputable def ψBar : T →+* MvPowerSeries (Fin 2) ℂ := Ideal.Quotient.lift conjI ψHom.toRingHom (fun x hx => (conjI_le_ker_ψ hx : x ∈ RingHom.ker ψHom.toRingHom)) diff --git a/LeanPool/AndersonConjecture/CompleteDomain/LocalRing.lean b/LeanPool/AndersonConjecture/CompleteDomain/LocalRing.lean index b43ac58f75..135626e6a1 100644 --- a/LeanPool/AndersonConjecture/CompleteDomain/LocalRing.lean +++ b/LeanPool/AndersonConjecture/CompleteDomain/LocalRing.lean @@ -26,7 +26,7 @@ T = C[[x,y,z]]/(x^2 - yz) is a Noetherian complete local domain whose residue field has the cardinality of C. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen.lean b/LeanPool/AndersonConjecture/Jensen.lean index ba2377b376..c020f9929a 100644 --- a/LeanPool/AndersonConjecture/Jensen.lean +++ b/LeanPool/AndersonConjecture/Jensen.lean @@ -29,4 +29,4 @@ a UFD with a prescribed completion (Jensen 2006, building on Loepp 1997 and Heitmann 1993). -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin.lean index f18723fe22..ddb52cde53 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin.lean @@ -22,4 +22,4 @@ Index file for the `LeanPool.AndersonConjecture.Jensen.Adjoin` directory: adjoining elements to N-subrings (Loepp, Jensen, Heitmann). -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean index 6c3687550c..93c38da325 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean @@ -28,7 +28,7 @@ adjunction from a prime ideal (Jensen), and the surjectivity step ensuring R → T/M² stays surjective (Heitmann Lemma 5). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean index 41612a8eaa..f068997619 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean @@ -30,7 +30,7 @@ Jensen, "Completions of UFDs with semi-local formal fibers", 2006, Lemma 2.1 (case P = (0)). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean index eb0141c5e9..37f75b9f72 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean @@ -27,7 +27,7 @@ ideal yields a new N-subring. Loepp, "Constructing local generic formal fibers", 1997, Lemma 11. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/Application.lean b/LeanPool/AndersonConjecture/Jensen/Application.lean index f13c8f26de..9321e6b1c8 100644 --- a/LeanPool/AndersonConjecture/Jensen/Application.lean +++ b/LeanPool/AndersonConjecture/Jensen/Application.lean @@ -26,7 +26,7 @@ hypotheses (Corollary 2.4 with P = (0)) and apply the construction to produce a local UFD whose completion is T. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/Avoidance.lean b/LeanPool/AndersonConjecture/Jensen/Avoidance.lean index 961c84ba62..b3675f91f7 100644 --- a/LeanPool/AndersonConjecture/Jensen/Avoidance.lean +++ b/LeanPool/AndersonConjecture/Jensen/Avoidance.lean @@ -24,7 +24,7 @@ the uncountable case uses a cardinality argument. Heitmann, "Characterization of completions of UFDs", 1993, Lemmas 2--3. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp.lean index 05961f85f2..a4b760368f 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp.lean @@ -30,4 +30,4 @@ Index file for the `LeanPool.AndersonConjecture.Jensen.CloseUp` directory: closing up finitely generated ideals (Heitmann, Lemma 4). -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean index 29956e12c5..06d79644d6 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean @@ -30,7 +30,7 @@ one obtains the required A-extension by applying prime avoidance (Heitmann, Lemma 4). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/Base.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/Base.lean index d116e8917f..2c740bedfe 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/Base.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/Base.lean @@ -23,7 +23,7 @@ a/p for suitable primes p. The divisibility case follows by induction on the UFD factorisation in R. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/CloseUp.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/CloseUp.lean index 7a75d6fa4d..fa41510d5d 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/CloseUp.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/CloseUp.lean @@ -28,7 +28,7 @@ induction on generator count with GCD complexity as a well-founded measure (Heitmann, 1993, Lemma 4). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean index 187c82fdfc..77a9c4c0b8 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/CoprimeSplit.lean @@ -28,7 +28,7 @@ The argument splits on whether the ideal generated by s' is zero or not, and reduces to the factor and intersection cases. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean index c65db1edb6..eb5a5f204d 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/Factor.lean @@ -25,7 +25,7 @@ sub-cases into the main factor theorem for the close-up induction (Heitmann, Lemma 4, case n >= 3). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/FactorDivisibility.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/FactorDivisibility.lean index af17a52974..980666b53f 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/FactorDivisibility.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/FactorDivisibility.lean @@ -23,7 +23,7 @@ s' divides either the distinguished generator a or the witness c. Dividing out p reduces the GCD complexity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/GcdComplexity.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/GcdComplexity.lean index f1285663c6..80628e2b42 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/GcdComplexity.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/GcdComplexity.lean @@ -25,7 +25,7 @@ construction when n >= 3 generators. Dividing all generators by a common prime strictly decreases the complexity. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ variable {T : Type*} [CommRing T] [IsLocalRing T] [IsNoetherianRing T] [IsDomain /-- "GCD complexity" of a finite set `s` in a UFD subring `R`: the sum over `x ∈ s` of the number of (normalized) irreducible factors of `x`. Used as a termination measure in the close-up construction. -/ -noncomputable def gcdComplexity {R : Subring T} +@[expose] noncomputable def gcdComplexity {R : Subring T} [UniqueFactorizationMonoid R] (s : Finset R) : ℕ := @Finset.sum _ _ _ s fun x => @Multiset.card _ diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionHelpers.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionHelpers.lean index 083f69f087..933f9d37c0 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionHelpers.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionHelpers.lean @@ -24,7 +24,7 @@ the strict decrease of GCD complexity after dividing by a common prime factor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionStep.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionStep.lean index 904c0570b1..724fe356d7 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionStep.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/IntersectionStep.lean @@ -30,7 +30,7 @@ is obtained by passing to an A-extension where the intersection has been resolved. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean index 54fbbd7564..2a586fa5e1 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean @@ -30,7 +30,7 @@ any associated prime of height at most one, so the avoidance step applies directly. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/TwoGen.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/TwoGen.lean index bbdcc8d25c..eb78954811 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/TwoGen.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/TwoGen.lean @@ -28,7 +28,7 @@ the general case reduces to it by extracting common factors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean b/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean index 0fde43c393..700edd8abc 100644 --- a/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean +++ b/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean @@ -25,7 +25,7 @@ element of T/M² and meeting a given nonzero prime, while closing all finitely generated ideals (Heitmann, 1993, Lemma 7). -/ -@[expose] public section +public section noncomputable section @@ -75,7 +75,8 @@ include T in theorem build_union_isNSubring ≤ Cardinal.mk ι' * ⨆ α, Cardinal.mk ↑((chain.ring α).carrier : Set T) := h1 _ ≤ κ * κ := mul_le_mul' h_ι_card (ciSup_le fun α => h_card α) _ ≤ κ := (Cardinal.mul_le_max_of_aleph0_le_left (le_max_left ..)).trans_eq (max_self κ) - exact ⟨chain.unionNSubring hU_card, rfl, chain.le_union⟩ + refine ⟨chain.unionNSubring hU_card, chain.unionNSubring_carrier hU_card, ?_⟩ + simpa only [NSubringChain.unionNSubring_carrier] using chain.le_union /- Process one (gens, c) pair: given NSubring Sk with R' ≤ Sk and #Sk < #T, produce an A-extension Sk1 that closes the pair if c ∈ I·T. -/ @@ -468,7 +469,8 @@ include T in theorem build_union_isNSubring_nat ≤ Cardinal.aleph0 * ⨆ n, Cardinal.mk ((chain.ring n).carrier : Set T) := h_lift _ ≤ κ * κ := mul_le_mul' (le_max_left ..) (ciSup_le fun n => h_card n) _ ≤ κ := (Cardinal.mul_le_max_of_aleph0_le_left (le_max_left ..)).trans_eq (max_self κ) - exact ⟨chain.unionNSubring hU_card, rfl, chain.le_union⟩ + refine ⟨chain.unionNSubring hU_card, chain.unionNSubring_carrier hU_card, ?_⟩ + simpa only [NSubringChain.unionNSubring_carrier] using chain.le_union /- ω-iteration: given a one-pass close-up procedure, iterate it to close all f.g. ideals. -/ include T in theorem close_up_all_omega diff --git a/LeanPool/AndersonConjecture/Jensen/Construction.lean b/LeanPool/AndersonConjecture/Jensen/Construction.lean index 7f8954148d..3ef0dee3ad 100644 --- a/LeanPool/AndersonConjecture/Jensen/Construction.lean +++ b/LeanPool/AndersonConjecture/Jensen/Construction.lean @@ -22,4 +22,4 @@ Index file for the `LeanPool.AndersonConjecture.Jensen.Construction` directory: the transfinite construction assembling the final ring. -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/Jensen/Construction/ChainHelpers.lean b/LeanPool/AndersonConjecture/Jensen/Construction/ChainHelpers.lean index ac908b99dd..fcd131e5d0 100644 --- a/LeanPool/AndersonConjecture/Jensen/Construction/ChainHelpers.lean +++ b/LeanPool/AndersonConjecture/Jensen/Construction/ChainHelpers.lean @@ -26,7 +26,7 @@ Jensen, "Completions of UFDs with semi-local formal fibers", 2006, Theorem 2.2. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/AndersonConjecture/Jensen/Construction/Construction.lean b/LeanPool/AndersonConjecture/Jensen/Construction/Construction.lean index 06442d9b7e..8513b5a552 100644 --- a/LeanPool/AndersonConjecture/Jensen/Construction/Construction.lean +++ b/LeanPool/AndersonConjecture/Jensen/Construction/Construction.lean @@ -25,7 +25,7 @@ contraction), yielding a Noetherian local domain with prescribed completion (Jensen, 2006, Corollary 2.4). -/ -@[expose] public section +public section universe u diff --git a/LeanPool/AndersonConjecture/Jensen/Construction/HeitmannProp.lean b/LeanPool/AndersonConjecture/Jensen/Construction/HeitmannProp.lean index bcee52fd3e..f98e7957fc 100644 --- a/LeanPool/AndersonConjecture/Jensen/Construction/HeitmannProp.lean +++ b/LeanPool/AndersonConjecture/Jensen/Construction/HeitmannProp.lean @@ -21,7 +21,7 @@ depth T >= 2, associated primes of T have height at most 1. Heitmann, "Characterization of completions of UFDs", 1993, Prop. 1. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean b/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean index 69ed1c3df0..29a3f01ab9 100644 --- a/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean +++ b/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean @@ -26,7 +26,7 @@ Jensen, "Completions of UFDs with semi-local formal fibers", 2006, Theorem 2.2. -/ -@[expose] public section +public section universe u @@ -94,8 +94,6 @@ private noncomputable def mk_union_nsub_aux hprimes hβ₁ hβ₂ hle r ((hmono hβ₁ hβ₂ hle) r.2) hr } set U := lc.unionSubring with hU_def have hU_le := lc.le_union - have hU_mem : ∀ x : ↥U, ∃ β : {β : ι // β < α}, - (x : T) ∈ (lc.ring β).carrier := fun x => lc.mem_union_iff.mp x.2 have h_tight : Cardinal.mk ↥U ≤ max Cardinal.aleph0 (Cardinal.mk {γ : ι // γ < α}) := by set n := Cardinal.mk {γ : ι // γ < α} @@ -133,9 +131,13 @@ private noncomputable def mk_union_nsub_aux have hU_card : Cardinal.mk ↥U ≤ max Cardinal.aleph0 (Cardinal.mk (IsLocalRing.ResidueField T)) := hU_lt.le.trans (hcard.le.trans (le_max_right ..)) - refine ⟨lc.unionNSubring hU_card, hU_lt, h_tight, fun β hβ => hU_le ⟨β, hβ⟩, ?_⟩ - intro β hβ r hr hmem - exact transfinite_union_primes_preserved lc U hU_le hU_mem ⟨β, hβ⟩ r hr + refine ⟨lc.unionNSubring hU_card, ?_, ?_, ?_, ?_⟩ + · simpa only [NSubringChain.unionNSubring_carrier] using hU_lt + · simpa only [NSubringChain.unionNSubring_carrier] using h_tight + · intro β hβ + simpa only [NSubringChain.unionNSubring_carrier] using hU_le ⟨β, hβ⟩ + · intro β hβ r hr hmem + exact lc.prime_unionNSubring hU_card ⟨β, hβ⟩ r hr hmem /-- The transfinite construction via ordinal recursion: iterate `combined_step` over all (prime, residue) pairs indexed by ordinals, building an N-subring A @@ -553,7 +555,11 @@ private def transfinite_construction_proof _ ≤ max κ' κ' := Cardinal.mul_le_max_of_aleph0_le_left (le_max_left ..) _ = κ' := max_self κ' let A : NSubring T := chain.unionNSubring hU_card_le - refine ⟨chain, A, chain.le_union, fun x => chain.mem_union_iff.mp x.2, ?_, ?_, ?_⟩ + refine ⟨chain, A, ?_, ?_, ?_, ?_, ?_⟩ + · simpa only [A, NSubringChain.unionNSubring_carrier] using chain.le_union + · intro x + apply chain.mem_union_iff.mp + simpa only [A, NSubringChain.unionNSubring_carrier] using x.2 · intro α I hI c hc exact (data α).2.2.2.2.1 I hI c hc · -- Surjectivity: use enum to find α covering each residue class ℓ diff --git a/LeanPool/AndersonConjecture/Jensen/Defs.lean b/LeanPool/AndersonConjecture/Jensen/Defs.lean index c0eaa250e1..9d63dd79fc 100644 --- a/LeanPool/AndersonConjecture/Jensen/Defs.lean +++ b/LeanPool/AndersonConjecture/Jensen/Defs.lean @@ -18,11 +18,12 @@ zero. This is the key condition in Jensen's construction of UFDs with prescribed completions. -/ -@[expose] public section +public section /-- A local ring `R` has **trivial generic formal fiber** if every prime ideal of its `M`-adic completion that contracts to `0` in `R` is itself `0`. (This is the relevant condition for Noetherian local domains.) -/ +@[expose] def HasTrivialGenericFormalFiber (R : Type*) [CommRing R] [IsLocalRing R] : Prop := ∀ (P : Ideal (AdicCompletion (IsLocalRing.maximalIdeal R) R)), diff --git a/LeanPool/AndersonConjecture/Jensen/Jensen.lean b/LeanPool/AndersonConjecture/Jensen/Jensen.lean index ba4082c97d..c2627f972e 100644 --- a/LeanPool/AndersonConjecture/Jensen/Jensen.lean +++ b/LeanPool/AndersonConjecture/Jensen/Jensen.lean @@ -26,7 +26,7 @@ constructs a local UFD A whose adic completion is T and whose generic formal fiber is trivial (Jensen, 2006, Corollary 2.4). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain.lean index b01414e457..3a14f9160e 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain.lean @@ -26,4 +26,4 @@ Index file for the `LeanPool.AndersonConjecture.Jensen.KrullDomain` directory: Krull domain intersection for the two-generator coprime case. -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/AdjoinLocSet.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/AdjoinLocSet.lean index 0b959bc030..63cf3845dd 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/AdjoinLocSet.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/AdjoinLocSet.lean @@ -21,7 +21,7 @@ local domain T and their intersection, used in the Krull domain construction of Anderson--Jensen. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ section IntersectionDefs /-- The set A = R[x, y⁻¹] inside T: elements t such that t·yⁿ = f(x) for some f ∈ R[X] and n ∈ ℕ. This is the image of the localization of R[x] at the powers of y, embedded in T via evaluation. -/ -def adjoinLocSetY (R : NSubring T) (x : T) (y : R.carrier) : Set T := +@[expose] def adjoinLocSetY (R : NSubring T) (x : T) (y : R.carrier) : Set T := {t : T | ∃ (f : Polynomial R.carrier) (n : ℕ), t * (↑y : T) ^ n = aeval x f} /-- R ⊆ R[x, y⁻¹]. -/ @@ -48,7 +48,7 @@ theorem x_mem_adjoinLocSetY (R : NSubring T) (x : T) (y : R.carrier) : ⟨X, 0, by simp⟩ /-- The intersection Rbar = A₁ ∩ A₂ as a set in T. -/ -def intersectionSet (R : NSubring T) (x₁ x₂ : T) (y₁ y₂ : R.carrier) : Set T := +@[expose] def intersectionSet (R : NSubring T) (x₁ x₂ : T) (y₁ y₂ : R.carrier) : Set T := adjoinLocSetY R x₁ y₂ ∩ adjoinLocSetY R x₂ y₁ /-- R ⊆ Rbar. -/ diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean index 2f92aa192d..c4e07b6c9f 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean @@ -30,7 +30,7 @@ at most one in T, using well-founded descent on heights and the mod-principal transcendence argument. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/KrullDomain.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/KrullDomain.lean index bb9f076793..7060047df4 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/KrullDomain.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/KrullDomain.lean @@ -26,7 +26,7 @@ construct an A-extension S with c ∈ (y₁,y₂)S via the intersection Rbar = R[x₁, y₂⁻¹] ∩ R[x₂, y₁⁻¹] where c = x₁y₁ + x₂y₂. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/LocUFD.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/LocUFD.lean index 30566547a3..cfdf58dae5 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/LocUFD.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/LocUFD.lean @@ -21,7 +21,7 @@ the remaining irreducibles stay prime. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/Nagata.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/Nagata.lean index 02732dfb01..aaed633fa1 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/Nagata.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/Nagata.lean @@ -23,7 +23,7 @@ prime ideal of R contains a prime element, obtained by lifting a prime from the localisation and cancelling powers of p. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/Prime.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/Prime.lean index bd894a0fd4..f6e682139c 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/Prime.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/Prime.lean @@ -23,7 +23,7 @@ prime of T contracting to a nonzero ideal of R can contain both y_1 and y_2. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean index 38643cc882..b2644cab6f 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/UFDConstruction.lean @@ -30,7 +30,7 @@ Nagata's criterion then gives that S itself is a UFD. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/NSubring.lean b/LeanPool/AndersonConjecture/Jensen/NSubring.lean index 37277dcbb4..a3668f76cb 100644 --- a/LeanPool/AndersonConjecture/Jensen/NSubring.lean +++ b/LeanPool/AndersonConjecture/Jensen/NSubring.lean @@ -23,7 +23,7 @@ An A-extension preserves primality and cardinality bounds. * Jensen, "Completions of UFDs with semi-local formal fibers", 2006. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/Jensen/TransfiniteUnion.lean b/LeanPool/AndersonConjecture/Jensen/TransfiniteUnion.lean index fb67c0e7cb..a0bcd2ff24 100644 --- a/LeanPool/AndersonConjecture/Jensen/TransfiniteUnion.lean +++ b/LeanPool/AndersonConjecture/Jensen/TransfiniteUnion.lean @@ -26,7 +26,7 @@ Heitmann, "Characterization of completions of UFDs", 1993, Lemma 6 Loepp, "Constructing local generic formal fibers", 1997, Lemmas 14--15. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ lemma directed_carriers (chain : NSubringChain T ι) : fun α β => ⟨max α β, chain.mono (le_max_left α β), chain.mono (le_max_right α β)⟩ /-- The union of all subrings in the chain. -/ -def unionSubring (chain : NSubringChain T ι) : Subring T := +@[expose] def unionSubring (chain : NSubringChain T ι) : Subring T := ⨆ (α : ι), (chain.ring α).carrier /-- Every chain member is contained in the union. -/ @@ -272,6 +272,22 @@ def NSubringChain.unionNSubring [Nonempty ι] (chain : NSubringChain T ι) maximal_ideal_eq := hU_maximal height_bound := hU_height } +/-- The union construction preserves the underlying union subring. -/ +lemma NSubringChain.unionNSubring_carrier [Nonempty ι] (chain : NSubringChain T ι) + (h_card : Cardinal.mk ↥chain.unionSubring ≤ + max Cardinal.aleph0 (Cardinal.mk (IsLocalRing.ResidueField T))) : + (chain.unionNSubring h_card).carrier = chain.unionSubring := by + rfl + +theorem NSubringChain.prime_unionNSubring [Nonempty ι] (chain : NSubringChain T ι) + (h_card : Cardinal.mk ↥chain.unionSubring ≤ + max Cardinal.aleph0 (Cardinal.mk (IsLocalRing.ResidueField T))) + (α : ι) (r : (chain.ring α).carrier) (hr : Prime r) + (hmem : (r : T) ∈ (chain.unionNSubring h_card).carrier) : + Prime (⟨(r : T), hmem⟩ : (chain.unionNSubring h_card).carrier) := by + exact transfinite_union_primes_preserved chain chain.unionSubring chain.le_union + (fun x => chain.mem_union_iff.mp x.2) α r hr + /-- Heitmann Lemma 6: The union of a well-ordered ascending chain of A-extensions is an N-subring (modulo cardinality bound). diff --git a/LeanPool/AndersonConjecture/Main.lean b/LeanPool/AndersonConjecture/Main.lean index 32418711dc..c94173b5d1 100644 --- a/LeanPool/AndersonConjecture/Main.lean +++ b/LeanPool/AndersonConjecture/Main.lean @@ -32,7 +32,7 @@ Anderson's theorems reduce the problem to a quotient that fails weak quasi-completeness. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/AndersonConjecture/QuasiCompleteRing.lean b/LeanPool/AndersonConjecture/QuasiCompleteRing.lean index 850483a960..34f287e17d 100644 --- a/LeanPool/AndersonConjecture/QuasiCompleteRing.lean +++ b/LeanPool/AndersonConjecture/QuasiCompleteRing.lean @@ -18,4 +18,4 @@ Index file for the `LeanPool.AndersonConjecture.QuasiCompleteRing` directory: Anderson's Theorems 3–5 characterising (weak) quasi-completeness. -/ -@[expose] public section +public section diff --git a/LeanPool/AndersonConjecture/QuasiCompleteRing/Complete.lean b/LeanPool/AndersonConjecture/QuasiCompleteRing/Complete.lean index 2546b28fef..d899d0840d 100644 --- a/LeanPool/AndersonConjecture/QuasiCompleteRing/Complete.lean +++ b/LeanPool/AndersonConjecture/QuasiCompleteRing/Complete.lean @@ -17,7 +17,7 @@ A complete Noetherian local ring is quasi-complete (Anderson, 2014, Theorem 3). -/ -@[expose] public section +public section open scoped Pointwise diff --git a/LeanPool/AndersonConjecture/QuasiCompleteRing/QuasiCompleteRing.lean b/LeanPool/AndersonConjecture/QuasiCompleteRing/QuasiCompleteRing.lean index b09dd39854..ebdd54e73e 100644 --- a/LeanPool/AndersonConjecture/QuasiCompleteRing/QuasiCompleteRing.lean +++ b/LeanPool/AndersonConjecture/QuasiCompleteRing/QuasiCompleteRing.lean @@ -26,7 +26,7 @@ import Mathlib.RingTheory.PicardGroup Imported Lean Pool material for `LeanPool.AndersonConjecture.QuasiCompleteRing.QuasiCompleteRing`. -/ -@[expose] public section +public section open scoped Pointwise diff --git a/LeanPool/Apportionment.lean b/LeanPool/Apportionment.lean index 84e2910c4e..1bb9088f2b 100644 --- a/LeanPool/Apportionment.lean +++ b/LeanPool/Apportionment.lean @@ -20,7 +20,7 @@ Tags: social-choice-theory, combinatorics MSC: 91B12, 91B14 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Apportionment/Basic.lean b/LeanPool/Apportionment/Basic.lean index 65beada8e1..5249629cd5 100644 --- a/LeanPool/Apportionment/Basic.lean +++ b/LeanPool/Apportionment/Basic.lean @@ -51,7 +51,7 @@ between weak and strong exactness is added, following [PalomaresPukelsheimRamire -/ -@[expose] public section +public section /-- An apportionment is a vector of natural numbers representing the number of seats allocated to each party (at the corresponding index). -/ diff --git a/LeanPool/Apportionment/PlausibleInstances.lean b/LeanPool/Apportionment/PlausibleInstances.lean index 95f5e9018e..df25bd9445 100644 --- a/LeanPool/Apportionment/PlausibleInstances.lean +++ b/LeanPool/Apportionment/PlausibleInstances.lean @@ -35,7 +35,7 @@ example (e : Election 4) : e.votes[0] ≤ 15 + e.votes[1] := by ``` -/ -@[expose] public section +public section open Plausible diff --git a/LeanPool/Apportionment/Utils.lean b/LeanPool/Apportionment/Utils.lean index eaa9872f17..fa3e0fbab9 100644 --- a/LeanPool/Apportionment/Utils.lean +++ b/LeanPool/Apportionment/Utils.lean @@ -25,7 +25,7 @@ Utility lemmas for the Apportionment library: a positivity criterion for the sum vector of natural numbers, and a closed form for the sum of a length-four vector. -/ -@[expose] public section +public section /-- A vector of natural numbers has positive sum iff at least one component is positive. -/ lemma sum_pos_iff_exists_pos {n : ℕ} {v : Vector ℕ n} : diff --git a/LeanPool/ArchonFirstProofResults.lean b/LeanPool/ArchonFirstProofResults.lean index dac64cc7d0..8f8cf3a585 100644 --- a/LeanPool/ArchonFirstProofResults.lean +++ b/LeanPool/ArchonFirstProofResults.lean @@ -21,7 +21,7 @@ Tags: polynomials, analysis, combinatorics, linear-algebra, graph-theory MSC: 26D15, 05C50, 15A42 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4.lean b/LeanPool/ArchonFirstProofResults/FirstProof4.lean index 9f4dac0a98..4bdda6a731 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4.lean @@ -25,4 +25,4 @@ not squarefree). The proof lives in `Problem4`; supporting infrastructure is in the `Auxiliary` sub-modules. -/ -@[expose] public section +public section diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary.lean index 9c9e0584f6..04aeefd7ad 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary.lean @@ -47,4 +47,4 @@ Re-exports all auxiliary sub-modules used by `Problem4`: - `BoxPlusRealRoots`: real-rootedness preservation, `PhiN` residue bound -/ -@[expose] public section +public section diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/BoxPlusRealRoots.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/BoxPlusRealRoots.lean index 4be30c407b..61c6484364 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/BoxPlusRealRoots.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/BoxPlusRealRoots.lean @@ -37,7 +37,7 @@ and establishes the core PhiN residue bound via the transport decomposition. - Marcus, Spielman, Srivastava, *Interlacing families II* -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Continuity.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Continuity.lean index 552d3dca70..28cf4ca768 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Continuity.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Continuity.lean @@ -32,7 +32,7 @@ with respect to coefficient perturbation. The argument proceeds in three steps: -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Defs.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Defs.lean index a13a2be3b9..0f8911db56 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Defs.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Defs.lean @@ -45,7 +45,7 @@ This file defines the core algebraic objects for the finite additive convolution - `p ⊞[n] q` is used for `polyBoxPlus n p q` -/ -@[expose] public section +public section open Polynomial BigOperators Nat @@ -60,7 +60,7 @@ variable (n : ℕ) (hn : 2 ≤ n) /-- The coefficient formula for box-plus convolution: c_k = ∑_{i+j=k} [(n-i)!(n-j)! / (n!(n-k)!)] · aᵢ · bⱼ We work with real coefficients throughout. -/ -def boxPlusCoeff (n : ℕ) (a b : ℕ → ℝ) (k : ℕ) : ℝ := +@[expose] def boxPlusCoeff (n : ℕ) (a b : ℕ → ℝ) (k : ℕ) : ℝ := (Finset.range (k + 1)).sum fun i ↦ ((n - i).factorial * (n - (k - i)).factorial : ℝ) / ((n.factorial * (n - k).factorial : ℝ)) * a i * b (k - i) @@ -68,20 +68,20 @@ def boxPlusCoeff (n : ℕ) (a b : ℕ → ℝ) (k : ℕ) : ℝ := /-- The box-plus convolution of two coefficient sequences of degree ≤ n. Given a = (a₀, a₁, ..., aₙ) and b = (b₀, b₁, ..., bₙ), returns the coefficient sequence c = (c₀, c₁, ..., cₙ). -/ -def boxPlusConv (n : ℕ) (a b : ℕ → ℝ) : ℕ → ℝ := +@[expose] def boxPlusConv (n : ℕ) (a b : ℕ → ℝ) : ℕ → ℝ := fun k ↦ if k ≤ n then boxPlusCoeff n a b k else 0 /-- Convert a polynomial to its coefficient sequence in the basis x^{n-k}: p(x) = ∑_k a_k x^{n-k}, so a_k is the coefficient of x^{n-k} in p. -/ -def polyToCoeffs (p : ℝ[X]) (n : ℕ) : ℕ → ℝ := +@[expose] def polyToCoeffs (p : ℝ[X]) (n : ℕ) : ℕ → ℝ := fun k ↦ p.coeff (n - k) /-- Convert a coefficient sequence back to a polynomial. -/ -def coeffsToPoly (a : ℕ → ℝ) (n : ℕ) : ℝ[X] := +@[expose] def coeffsToPoly (a : ℕ → ℝ) (n : ℕ) : ℝ[X] := (Finset.range (n + 1)).sum fun k ↦ Polynomial.C (a k) * Polynomial.X ^ (n - k) /-- The box-plus convolution of two polynomials of degree ≤ n. -/ -def polyBoxPlus (n : ℕ) (p q : ℝ[X]) : ℝ[X] := +@[expose] def polyBoxPlus (n : ℕ) (p q : ℝ[X]) : ℝ[X] := coeffsToPoly (boxPlusConv n (polyToCoeffs p n) (polyToCoeffs q n)) n /-- Notation `p ⊞[n] q` for `polyBoxPlus n p q`, the degree-`n` box-plus convolution. -/ diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean index 9f40c6c159..0d575c30fa 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean @@ -22,7 +22,7 @@ Monic real-rooted polynomials can be approximated by squarefree ones. also all-real-rooted, with coefficients within ε. -/ -@[expose] public section +public section open Polynomial BigOperators Nat Finset diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/HarmonicBound.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/HarmonicBound.lean index 382f6231bb..3ff014d596 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/HarmonicBound.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/HarmonicBound.lean @@ -28,7 +28,7 @@ reciprocals and the Cauchy-Schwarz inequality for finite sums. - `harmonic_sum_bound`: ∑ 1/wConv ≤ Ap·Aq/(Ap+Aq) -/ -@[expose] public section +public section open BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/InvPhiN.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/InvPhiN.lean index 3ea867557a..786804d882 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/InvPhiN.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/InvPhiN.lean @@ -36,7 +36,7 @@ connection lemma showing it equals `1/PhiN` for any choice of root vector. - `invPhiN_poly_eq_inv_PhiN`: `invPhiNPoly n p = 1 / PhiN n roots` for any root vector -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Obreschkoff.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Obreschkoff.lean index bfd4f0e586..5effdcd237 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Obreschkoff.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Obreschkoff.lean @@ -30,7 +30,7 @@ and the backward Hermite-Kakeya theorem. - `eval_div_deriv_pos_of_pencil_real`: Positivity via pencil and GCD factoring -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/ObreschkoffTransport.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/ObreschkoffTransport.lean index fd77d1eae9..6cd22fef9b 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/ObreschkoffTransport.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/ObreschkoffTransport.lean @@ -30,7 +30,7 @@ real-rootedness of box-plus convolution. via pencil real-rootedness -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/PhiN.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/PhiN.lean index 58f7e5fa69..013dc01662 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/PhiN.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/PhiN.lean @@ -34,7 +34,7 @@ and cross-term vanishing. - `cross_term_vanishing`: Cross terms vanish in the PhiN expansion -/ -@[expose] public section +public section open Polynomial BigOperators Nat @@ -48,21 +48,21 @@ variable (n : ℕ) (hn : 2 ≤ n) /-- Φₙ(p) for a polynomial with distinct real roots λ₁,...,λₙ: Φₙ(p) = ∑ᵢ (∑_{j≠i} 1/(λᵢ - λⱼ))² -/ -def PhiN (roots : Fin n → ℝ) : ℝ := +@[expose] def PhiN (roots : Fin n → ℝ) : ℝ := ∑ i, ((Finset.univ.filter (· ≠ i)).sum fun j ↦ 1 / (roots i - roots j)) ^ 2 /-- The derivative-related quantity `r_p = p' / n`. -/ -def rPoly (n : ℕ) (p : ℝ[X]) : ℝ[X] := (1 / (n : ℝ)) • p.derivative +@[expose] def rPoly (n : ℕ) (p : ℝ[X]) : ℝ[X] := (1 / (n : ℝ)) • p.derivative /-- The derivative-related quantity `R_p = p - X · r_p`. -/ -def RPoly (n : ℕ) (p : ℝ[X]) : ℝ[X] := p - Polynomial.X * rPoly n p +@[expose] def RPoly (n : ℕ) (p : ℝ[X]) : ℝ[X] := p - Polynomial.X * rPoly n p /-! ### The critical values w_i(p) -/ /-- w_i(p) = -R_p(νᵢ)/r_p'(νᵢ) where νᵢ are zeros of r_p. These are positive when p has simple real zeros and is centered. -/ -def criticalValue (p : ℝ[X]) (n : ℕ) (ν : ℝ) : ℝ := +@[expose] def criticalValue (p : ℝ[X]) (n : ℕ) (ν : ℝ) : ℝ := -(RPoly n p).eval ν / (rPoly n p).derivative.eval ν /-! ### The derivative convolution identity -/ @@ -151,11 +151,11 @@ lemma derivative_boxPlus (n : ℕ) (p q : ℝ[X]) : /-! ### The transport matrix K -/ /-- The Lagrange basis polynomial ℓⱼ(x) = r_p(x)/(x - νⱼ). -/ -def lagrangeBasis (rp : ℝ[X]) (ν : ℝ) : ℝ[X] := +@[expose] def lagrangeBasis (rp : ℝ[X]) (ν : ℝ) : ℝ[X] := rp /ₘ (Polynomial.X - Polynomial.C ν) /-- The transport matrix K_{ij} = (ℓⱼ ⊞_m r_q)(μᵢ) / r'(μᵢ). -/ -def transportMatrix (m : ℕ) (rp rq : ℝ[X]) (r : ℝ[X]) +@[expose] def transportMatrix (m : ℕ) (rp rq : ℝ[X]) (r : ℝ[X]) (critPtsP critPtsConv : Fin m → ℝ) : Fin m → Fin m → ℝ := fun i j ↦ let lj := lagrangeBasis rp (critPtsP j) diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RPoly.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RPoly.lean index 5706fbeec7..9ca6698a47 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RPoly.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RPoly.lean @@ -28,7 +28,7 @@ and the polar decomposition for box-plus convolution. - `polyBoxPlus_add_left`: Additivity of polyBoxPlus in first argument -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RealRoots.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RealRoots.lean index df2051fc92..566675ad46 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RealRoots.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RealRoots.lean @@ -31,7 +31,7 @@ sign conditions. - `monic_alternating_has_real_roots`: Alternating signs imply n real roots -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Residue.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Residue.lean index 3b6f2c296a..6542f812d0 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Residue.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Residue.lean @@ -28,7 +28,7 @@ linearity of polyBoxPlus in its first argument. - `sum_lagrangeBasis_boxPlus_eq_deriv`: ∑ⱼ (ℓⱼ ⊞ rq) = r' (equation 2.18) -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RootContinuity.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RootContinuity.lean index 6cb68fc2c0..998edfd4f4 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RootContinuity.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/RootContinuity.lean @@ -23,7 +23,7 @@ the coefficients: if `f(a) = 0`, then for any `ε > 0`, there exists - `polynomial_root_perturbation_real`: Root perturbation theorem (real version) -/ -@[expose] public section +public section namespace Problem4 diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/SignSquarefree.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/SignSquarefree.lean index 5f24d0efad..e744180673 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/SignSquarefree.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/SignSquarefree.lean @@ -34,7 +34,7 @@ for polynomials with distinct real roots. - `squarefree_comp_X_sub_C`: Squarefree is preserved under translation -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Transport.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Transport.lean index 9b4ca97cee..25da710c28 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Transport.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Transport.lean @@ -26,7 +26,7 @@ interlacing, and establishes the critical value decomposition identity. via transport matrices -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/TransportDecomp.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/TransportDecomp.lean index cd8e67c762..311c8fca8d 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/TransportDecomp.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/TransportDecomp.lean @@ -36,7 +36,7 @@ and the resulting critical value positivity theorems. - Marcus, Spielman, Srivastava, *Interlacing families II* -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean index 497677b2b0..c35c3b0c0f 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean @@ -39,7 +39,7 @@ the harmonic mean inequality for Φₙ under box-plus convolution. - Marcus, Spielman, Srivastava, *Interlacing families II* -/ -@[expose] public section +public section open Polynomial BigOperators Nat diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6.lean b/LeanPool/ArchonFirstProofResults/FirstProof6.lean index ffaee939ae..94b1c882d6 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6.lean @@ -21,4 +21,4 @@ The proof lives in `Problem6`; supporting infrastructure is in the `Auxiliary` sub-modules. -/ -@[expose] public section +public section diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary.lean index 143ebc1f15..15094e96cb 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary.lean @@ -27,4 +27,4 @@ Re-exports all auxiliary sub-modules used by `Problem6`: - `LoewnerPullback`: Loewner pullback to `ε`-lightness -/ -@[expose] public section +public section diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/BarrierPotential.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/BarrierPotential.lean index f943b70a27..ec355afea3 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/BarrierPotential.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/BarrierPotential.lean @@ -31,7 +31,7 @@ unitary conjugation, and the Neumann-Loewner trace bound. - `Problem6.eigenvalue_le_trace_of_posSemidef`: eigenvalue-trace bound -/ -@[expose] public section +public section open Finset Matrix BigOperators @@ -43,7 +43,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] /-- The upper barrier potential Φ_u(M) = tr((uI - M)⁻¹), defined for symmetric M with eigenvalues < u. -/ -def barrierPotential (u : ℝ) (M : Matrix V V ℝ) : ℝ := +@[expose] def barrierPotential (u : ℝ) (M : Matrix V V ℝ) : ℝ := (u • (1 : Matrix V V ℝ) - M)⁻¹.trace /-- Real form of the spectral theorem: a real Hermitian matrix equals diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ColoringFramework.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ColoringFramework.lean index 71e1481bd5..fc09bbda56 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ColoringFramework.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ColoringFramework.lean @@ -32,7 +32,7 @@ and `barrier_parameter_bound`. - `Problem6.barrier_parameter_bound`: final parameter bound -/ -@[expose] public section +public section open Finset Matrix BigOperators diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean index 0d0f08175c..1afb243e68 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean @@ -15,7 +15,7 @@ Key infrastructure for the dynamic BSS coloring: pseudo-inverse pullback, projection identity, normalized monochromatic PSD. -/ -@[expose] public section +public section open Finset Matrix BigOperators diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LaplacianBasics.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LaplacianBasics.lean index 93a03728ba..0fd0ad1c06 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LaplacianBasics.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LaplacianBasics.lean @@ -30,7 +30,7 @@ with mathlib's `lapMatrix`. - `Problem6.lapMatrix_loewner_mono`: Loewner monotonicity for lapMatrix -/ -@[expose] public section +public section open Finset Matrix BigOperators @@ -43,14 +43,14 @@ variable {V : Type*} [Fintype V] [DecidableEq V] /-- The Laplacian matrix of a simple graph, defined as ∑_{e ∈ E} L_e where each L_e is the edge Laplacian. We use the standard definition L_{ij} = deg(i) if i=j, -1 if i~j, 0 otherwise. -/ -def graphLaplacian (G : SimpleGraph V) [DecidableRel G.Adj] : Matrix V V ℝ := +@[expose] def graphLaplacian (G : SimpleGraph V) [DecidableRel G.Adj] : Matrix V V ℝ := Matrix.of fun i j => if i = j then ((Finset.univ.filter (G.Adj i)).card : ℝ) else if G.Adj i j then -1 else 0 /-- The Laplacian of the induced subgraph on S: restricting to edges within S. -/ -def inducedLaplacian (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) : +@[expose] def inducedLaplacian (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) : Matrix V V ℝ := Matrix.of fun i j => if i = j then ((Finset.univ.filter (fun k => i ∈ S ∧ k ∈ S ∧ G.Adj i k)).card : ℝ) @@ -58,7 +58,7 @@ def inducedLaplacian (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) : else 0 /-- A set S is ε-light if εL - L_S is positive semidefinite. -/ -def IsEpsLight (G : SimpleGraph V) [DecidableRel G.Adj] (ε : ℝ) (S : Finset V) : Prop := +@[expose] def IsEpsLight (G : SimpleGraph V) [DecidableRel G.Adj] (ε : ℝ) (S : Finset V) : Prop := (ε • graphLaplacian G - inducedLaplacian G S).PosSemidef /-! ### The induced subgraph as a SimpleGraph V diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LoewnerPullback.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LoewnerPullback.lean index 38c4affdda..0537c1215d 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LoewnerPullback.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/LoewnerPullback.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real Congruence pullbacks for Loewner order and epsilon-lightness from Loewner bound. -/ -@[expose] public section +public section open Finset Matrix BigOperators diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/OneSidedBarrier.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/OneSidedBarrier.lean index 94a168ffbb..0eb987e9fb 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/OneSidedBarrier.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/OneSidedBarrier.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Matrix.PosDef One-sided barrier machinery for the BSS coloring argument. -/ -@[expose] public section +public section open Finset Matrix BigOperators diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ResolventBound.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ResolventBound.lean index c4ded53303..a5f335af1a 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ResolventBound.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/ResolventBound.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Matrix.PosDef `psd_resolvent_trace_bound`: `tr((U⁻¹ - B)⁻¹) ≤ tr(U) + tr(B·U²) / (1 - tr(B·U))`. -/ -@[expose] public section +public section open Finset Matrix BigOperators diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean index 86011b2947..e20a6de8b6 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean @@ -27,7 +27,7 @@ All auxiliary infrastructure is in `Problem6Aux.lean`. with `|S| >= epsilon/256 * |V|` -/ -@[expose] public section +public section open Finset Matrix BigOperators diff --git a/LeanPool/ArtinWedderburn.lean b/LeanPool/ArtinWedderburn.lean index 483faf7233..7f2ecfe91c 100644 --- a/LeanPool/ArtinWedderburn.lean +++ b/LeanPool/ArtinWedderburn.lean @@ -34,7 +34,7 @@ Tags: ring-theory, noncommutative-algebra, artinian-rings MSC: 16K20, 16P20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean b/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean index 0f27a96222..facc7daa25 100644 --- a/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean +++ b/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean @@ -25,7 +25,7 @@ ring-isomorphic to a matrix ring over a division ring. Specialised to a simple ring it yields the same conclusion. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn diff --git a/LeanPool/ArtinWedderburn/Auxiliary.lean b/LeanPool/ArtinWedderburn/Auxiliary.lean index 166c44a2df..1fe5ed05f1 100644 --- a/LeanPool/ArtinWedderburn/Auxiliary.lean +++ b/LeanPool/ArtinWedderburn/Auxiliary.lean @@ -25,7 +25,7 @@ Mathlib's `DivisionRing`, and shows that an isomorphism of rings transports the division-ring property. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -33,13 +33,13 @@ variable {R : Type*} [Ring R] /-- `S` is a division subring with identity `e` when it contains a nonzero element and every nonzero member has a left inverse inside `S` equal to `e`. -/ -def IsDivisionSubring (S : NonUnitalSubring R) (e : R) : Prop := +@[expose] def IsDivisionSubring (S : NonUnitalSubring R) (e : R) : Prop := (∃ x : R, x ∈ S ∧ x ≠ 0) ∧ (∀ x : R, x ∈ S → x ≠ 0 → ∃ y : R, y ∈ S ∧ y * x = e) /-- A ring `R` is a division ring when it is nontrivial and every nonzero element has a two-sided multiplicative inverse. -/ -def IsDivisionRing (R : Type*) [Ring R] : Prop := +@[expose] def IsDivisionRing (R : Type*) [Ring R] : Prop := (∃ x : R, x ≠ 0) ∧ (∀ x : R, x ≠ 0 → ∃ y : R, y * x = 1 ∧ x * y = 1) -- if every nonzero element has a left inverse then the ring is a division ring @@ -56,7 +56,7 @@ theorem left_inv_implies_divring [Nontrivial R] exact ⟨y, hy, x_eq_z ▸ hz⟩ /-- Promote a proof of `IsDivisionRing R` to a Mathlib `DivisionRing R` instance. -/ -@[reducible] +@[expose, reducible] noncomputable def IsDivisionRingToDivisionRing (div : IsDivisionRing R) : DivisionRing R := by unfold IsDivisionRing at div diff --git a/LeanPool/ArtinWedderburn/CornerCornerLemma.lean b/LeanPool/ArtinWedderburn/CornerCornerLemma.lean index 4dea178a71..1c2508051f 100644 --- a/LeanPool/ArtinWedderburn/CornerCornerLemma.lean +++ b/LeanPool/ArtinWedderburn/CornerCornerLemma.lean @@ -20,7 +20,7 @@ corner subring of `f` inside `eRe` agrees (as a ring) with the corner subring of `f` viewed in `R`. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn diff --git a/LeanPool/ArtinWedderburn/CornerRing.lean b/LeanPool/ArtinWedderburn/CornerRing.lean index a9317a2e80..7e61060ca2 100644 --- a/LeanPool/ArtinWedderburn/CornerRing.lean +++ b/LeanPool/ArtinWedderburn/CornerRing.lean @@ -27,7 +27,7 @@ artinianness, primality, lifts and pushes of ideals, and isomorphisms between corner subrings of equal idempotents. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -35,7 +35,7 @@ variable {R : Type*} [Ring R] variable {e : R} /-- The carrier set of the corner ring `eRe`, defined as `{e * x * e | x : R}`. -/ -def CornerRingSet (e : R) : Set R := bothMul e e +@[expose] def CornerRingSet (e : R) : Set R := bothMul e e -- an element x of R is in the corner ring if and only if x = e * x * e theorem corner_ring_set_mem {x : R} (idem_e : IsIdempotentElem e) : @@ -52,7 +52,7 @@ theorem x_in_corner_x_eq_e_y_e {x : R} (h : x ∈ CornerRingSet e) : ∃ (y : R), x = e * y * e := h /-- The nonunital corner subring `eRe` as a `NonUnitalSubring`. -/ -@[reducible] +@[reducible, expose] def CornerSubringNonUnital (e : R) : NonUnitalSubring R where carrier := bothMul e e zero_mem' := ⟨0, by simp⟩ @@ -72,7 +72,7 @@ def CornerSubringNonUnital (e : R) : NonUnitalSubring R where noncomm_ring -- definition unfolding theorems -theorem corner_ring_carrier : (CornerSubringNonUnital e).carrier = bothMul e e := rfl +theorem corner_ring_carrier : (CornerSubringNonUnital e).carrier = bothMul e e := by rfl theorem el_in_corner_ring (x : R) : x ∈ bothMul e e ↔ x ∈ CornerSubringNonUnital e := Iff.rfl @@ -84,7 +84,7 @@ theorem eq_carrier_eq_corner (x y : R) (h : bothMul x x = bothMul y y) : /-- The corner subring `eRe` packaged as a `NonUnitalSubring`, tagged with the proof that `e` is idempotent. The proof argument lets later constructions attach the unital ring structure on `eRe`. -/ -@[reducible] +@[expose, reducible] def CornerSubring (idem_e : IsIdempotentElem e) : NonUnitalSubring R := have : IsIdempotentElem e := idem_e CornerSubringNonUnital e @@ -263,6 +263,8 @@ def equalElIsoMatrixRings' (e f : R) (idem_e : IsIdempotentElem e) (idem_f : IsI (e_eq_f : e = f) (n : ℕ) : Matrix (Fin n) (Fin n) (CornerSubring idem_e) ≃+* Matrix (Fin n) (Fin n) (CornerSubring idem_f) := + letI : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e + letI : Ring (CornerSubring idem_f) := CornerRingIsRing idem_f RingEquiv.mapMatrix (eqElIsoCorner e f idem_e idem_f e_eq_f) -- same element produce same Matrix rings over corner subrings @@ -285,7 +287,9 @@ instance : CoeOut (Set (CornerSubring idem_e)) (Set R) := -- I left ideal in eRe -> RI is a left ideal in R /-- Lift a (left) ideal of the corner subring `eRe` to a (left) ideal of `R` by taking the `R`-span of its carrier. -/ -def idealLift (I : Ideal (CornerSubring idem_e)) : Ideal R := Ideal.span (I.carrier) +def idealLift (I : Ideal (CornerSubring idem_e)) : Ideal R := by + letI : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e + exact Ideal.span (Set.image (fun x : CornerSubring idem_e => (x : R)) I.carrier) -- coercion from Ideals of CornerSubrings to Ideals of R instance : CoeOut (Ideal (CornerSubring idem_e)) (Ideal R) := { coe := idealLift idem_e } @@ -304,23 +308,25 @@ def elPush (x : R) : CornerSubring idem_e := ⟨e * x * e, e_x_e_in_corner idem_ -- A left ideal I can be pushed down to eRe by eIe /-- Push a (left) ideal of `R` down to a (left) ideal of `eRe` by taking the elementwise image under `elPush`. -/ -def idealPush (idem_e : IsIdempotentElem e) (J : Ideal R) : Ideal (CornerSubring idem_e) where - carrier := {elPush idem_e x | x ∈ J} - zero_mem' := by - refine ⟨0, Submodule.zero_mem J, ?_⟩ - apply Subtype.ext - change e * 0 * e = (0 : R) - noncomm_ring - add_mem' := by - rintro x y ⟨r, ⟨hr_mem, hr⟩⟩ ⟨s, ⟨hs_mem, hs⟩⟩ +def idealPush (idem_e : IsIdempotentElem e) (J : Ideal R) : Ideal (CornerSubring idem_e) := by + letI : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e + refine { + carrier := {elPush idem_e x | x ∈ J}, + zero_mem' := ?_, + add_mem' := ?_, + smul_mem' := ?_ } + · rintro x y ⟨r, ⟨hr_mem, hr⟩⟩ ⟨s, ⟨hs_mem, hs⟩⟩ refine ⟨r + s, (Submodule.add_mem_iff_right J hr_mem).mpr hs_mem, ?_⟩ apply Subtype.ext change e * (r + s) * e = (x + y : CornerSubring idem_e).val rw [← hr, ← hs] change e * (r + s) * e = e * r * e + e * s * e noncomm_ring - smul_mem' := by - rintro ⟨c, ⟨a, hc⟩⟩ x ⟨r, ⟨hr_mem, hr⟩⟩ + · refine ⟨0, Submodule.zero_mem J, ?_⟩ + apply Subtype.ext + change e * 0 * e = (0 : R) + noncomm_ring + · rintro ⟨c, ⟨a, hc⟩⟩ x ⟨r, ⟨hr_mem, hr⟩⟩ refine ⟨a * e * e * r, Ideal.mul_mem_left J (a * e * e) hr_mem, ?_⟩ apply Subtype.ext rw [← hr] @@ -337,6 +343,7 @@ theorem add_el_push_eq_add (x y : R) : -- multiplication by scalar keeps pushed element in ideal lemma el_push_smul_in_I (a y : R) (I : Ideal (CornerSubring idem_e)) : y ∈ (I.carrier : Set R) → elPush idem_e (a • y) ∈ I := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e intro hy obtain ⟨r, ⟨hr1, hr2⟩⟩ := hy obtain ⟨s, hs⟩ := r.2 @@ -364,6 +371,7 @@ lemma el_push_smul_in_I (a y : R) (I : Ideal (CornerSubring idem_e)) : -- if x in the lift of I then its push is in I theorem ideal_push_pull_inclusion (I : Ideal (CornerSubring idem_e)) (x : R) : (x ∈ idealLift idem_e I) → (elPush idem_e x) ∈ I := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e intro hx induction hx using Submodule.closure_induction with | zero => @@ -380,6 +388,7 @@ theorem ideal_push_pull_inclusion (I : Ideal (CornerSubring idem_e)) (x : R) : -- pushing and pulling an ideal brings us back to the same ideal theorem push_pull (idem_e : IsIdempotentElem e) (I : Ideal (CornerSubring idem_e)) : idealPush idem_e (idealLift idem_e I) = I := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e ext x constructor · rintro ⟨y, ⟨hy_mem, hy⟩⟩ @@ -402,6 +411,7 @@ theorem push_pull (idem_e : IsIdempotentElem e) (I : Ideal (CornerSubring idem_e theorem lift_strict_monotonicity (I J : Ideal (CornerSubring idem_e)) : I < J → (idealLift idem_e I) < (idealLift idem_e J) := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e intro I_leq_J have I_neq_J : I ≠ J := ne_of_lt I_leq_J have lift_leq : (idealLift idem_e I) ≤ (idealLift idem_e J) := @@ -419,6 +429,7 @@ theorem lift_acc_then_ideal_acc (idem_e : IsIdempotentElem e) (J : Ideal R) (h_J_is_lift : ∃ I3 : Ideal (CornerSubring idem_e), J = idealLift idem_e I3) (h_acc_J : Acc (fun x y => x < y) J) : Acc (fun x y => x < y) (idealPush idem_e J) := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e induction h_acc_J with | intro J2 _ hi => obtain ⟨I, hI⟩ := h_J_is_lift @@ -435,11 +446,13 @@ theorem lift_acc_then_ideal_acc (idem_e : IsIdempotentElem e) (J : Ideal R) -- a) If R is artinian, then the corner ring is artinian theorem corner_ring_artinian [h_ar : IsArtinian R R] : IsArtinian (CornerSubring idem_e) (CornerSubring idem_e) := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e have Iacc : ∀ I : Ideal R, Acc (fun x y => x < y) I := fun I ↦ WellFounded.apply h_ar I have allacc : ∀ I : Ideal (CornerSubring idem_e), Acc (fun x y => x < y) I := by intro I have h : Acc (fun x y => x < y) (idealPush idem_e (idealLift idem_e I)) := - lift_acc_then_ideal_acc idem_e I ⟨I, rfl⟩ (Iacc (idealLift idem_e I)) + lift_acc_then_ideal_acc idem_e (idealLift idem_e I) ⟨I, rfl⟩ + (Iacc (idealLift idem_e I)) rw [push_pull idem_e I] at h exact h exact WellFounded.intro allacc @@ -455,6 +468,7 @@ theorem corner_ring_both_mul_mem' (x y : CornerSubring idem_e) (w : R) : -- if a and b in eRe, then a (e R e) b = a R b as sets theorem both_mul_lift (x y : CornerSubring idem_e) : (bothMul (x : CornerSubring idem_e) y) = bothMul (x : R) (y : R) := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e ext a constructor · rintro ⟨r, ⟨s, hs⟩, rfl⟩ @@ -478,6 +492,7 @@ theorem both_mul_lift (x y : CornerSubring idem_e) : -- b) If R is a prime ring, then the corner ring is prime theorem corner_ring_prime (hRP : IsPrimeRing R) : IsPrimeRing (CornerSubring idem_e) := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e rw [prime_ring_equiv] intro a b h have h_lift : ((bothMul a b) : Set R) = {0} := by @@ -490,6 +505,7 @@ theorem corner_ring_prime (hRP : IsPrimeRing R) : IsPrimeRing (CornerSubring ide theorem div_subring_to_div_ring (e : R) (idem_e : IsIdempotentElem e) (h : IsDivisionSubring (CornerSubringNonUnital e) e) : IsDivisionRing (CornerSubring idem_e) := by + let : Ring (CornerSubring idem_e) := CornerRingIsRing idem_e obtain ⟨⟨a, ⟨a_mem, a_nz⟩⟩, h_inv⟩ := h have corner_nontrivial : Nontrivial (CornerSubring idem_e) := by refine ⟨⟨(⟨a, a_mem⟩ : CornerSubring idem_e), diff --git a/LeanPool/ArtinWedderburn/IdealProd.lean b/LeanPool/ArtinWedderburn/IdealProd.lean index 6ff55a84e0..37766f9908 100644 --- a/LeanPool/ArtinWedderburn/IdealProd.lean +++ b/LeanPool/ArtinWedderburn/IdealProd.lean @@ -21,13 +21,13 @@ the monoid structure on `TwoSidedIdeal R` used throughout the Artin–Wedderburn development. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn -- bothMul a b is the set aRb /-- The set `aRb = {a * r * b | r : R}` of two-sided products through `R`. -/ -def bothMul {R : Type*} [Ring R] (a b : R) : Set R := {x | ∃ r : R, x = a * r * b} +@[expose] def bothMul {R : Type*} [Ring R] (a b : R) : Set R := {x | ∃ r : R, x = a * r * b} /-- Notation `(a ⬝ R ⬝ b)` for `bothMul R a b`. -/ notation:55 "(" a:55 "⬝" R:55 "⬝" b:55 ")" => bothMul R a b @@ -240,7 +240,7 @@ def twoSidedIdealToSubgroup (I : TwoSidedIdeal R) : AddSubgroup R := neg_mem' := I.neg_mem } theorem subgroup_of_ideal_carrier_eq_carrier (I : TwoSidedIdeal R) : - ((twoSidedIdealToSubgroup I) : Set R) = I := rfl + ((twoSidedIdealToSubgroup I) : Set R) = I := by rfl -- cl(cl(A*B)*C) = cl(A*B*C) theorem ideal_product_subgroup_eq (A B C : TwoSidedIdeal R) : diff --git a/LeanPool/ArtinWedderburn/Idempotents.lean b/LeanPool/ArtinWedderburn/Idempotents.lean index 1a76c77a97..0f6a8304a1 100644 --- a/LeanPool/ArtinWedderburn/Idempotents.lean +++ b/LeanPool/ArtinWedderburn/Idempotents.lean @@ -22,7 +22,7 @@ orthogonal idempotents whose corner rings are division rings, and packages the data as `OrtIdem` / `OrtIdemDiv` structures. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -31,10 +31,10 @@ variable (I J : Ideal R) variable {e f : R} /-- Two elements are orthogonal when their products in both orders vanish. -/ -def IsOrthogonal (e f : R) : Prop := e * f = 0 ∧ f * e = 0 +@[expose] def IsOrthogonal (e f : R) : Prop := e * f = 0 ∧ f * e = 0 /-- `e` and `f` are orthogonal idempotents when each is idempotent and they are orthogonal. -/ -def AreOrthogonalIdempotents (e f : R) : Prop := +@[expose] def AreOrthogonalIdempotents (e f : R) : Prop := IsIdempotentElem e ∧ IsIdempotentElem f ∧ IsOrthogonal e f theorem leq_neq_lt (I J : Ideal R) : I ≤ J → I ≠ J → I < J := by @@ -92,7 +92,7 @@ theorem e_span_larger_e_sub_f (e f : R) (h : AreOrthogonalIdempotents (1 - e) f) /-- `R` has a system of `n × n` matrix units when there exist `n^2` elements `es i j` summing to `1` on the diagonal and multiplying like matrix units. -/ -def HasMatrixUnits (R : Type*) [Ring R] (n : ℕ) : Prop := +@[expose] def HasMatrixUnits (R : Type*) [Ring R] (n : ℕ) : Prop := ∃ (es : Fin n → Fin n → R), (∑ i, es i i = 1) ∧ (∀ i j k l, es i j * es k l = (if j = k then es i l else 0)) @@ -100,7 +100,7 @@ def HasMatrixUnits (R : Type*) [Ring R] (n : ℕ) : Prop := def kroneckerDelta (n : ℕ) (i j : Fin n) : R := if i = j then 1 else 0 /-- Two elements are pairwise orthogonal when both of their products vanish. -/ -def PairwiseOrthogonal (a b : R) : Prop := a * b = 0 ∧ b * a = 0 +@[expose] def PairwiseOrthogonal (a b : R) : Prop := a * b = 0 ∧ b * a = 0 -- Lemma 2.18 theorem OrtIdem_imply_MatUnits {n : ℕ} (hn : 0 < n) diff --git a/LeanPool/ArtinWedderburn/MatrixUnits.lean b/LeanPool/ArtinWedderburn/MatrixUnits.lean index e9a405f742..b85c1dc375 100644 --- a/LeanPool/ArtinWedderburn/MatrixUnits.lean +++ b/LeanPool/ArtinWedderburn/MatrixUnits.lean @@ -21,7 +21,7 @@ construction of matrix units from `OrtIdemDiv`, and the explicit ring isomorphism `R ≃+* Matrix (Fin n) (Fin n) (e₀₀ R e₀₀)`. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn diff --git a/LeanPool/ArtinWedderburn/MinIdeals.lean b/LeanPool/ArtinWedderburn/MinIdeals.lean index 31a572b447..b9f2c1ed52 100644 --- a/LeanPool/ArtinWedderburn/MinIdeals.lean +++ b/LeanPool/ArtinWedderburn/MinIdeals.lean @@ -21,7 +21,7 @@ idempotent generator `e` of `I` and shows that the corner subring `eRe` is a division subring. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn diff --git a/LeanPool/ArtinWedderburn/NiceIdeals.lean b/LeanPool/ArtinWedderburn/NiceIdeals.lean index 7881334daa..29b476e12f 100644 --- a/LeanPool/ArtinWedderburn/NiceIdeals.lean +++ b/LeanPool/ArtinWedderburn/NiceIdeals.lean @@ -20,7 +20,7 @@ A *nice ideal* is an idempotent ideal whose corner ring is `OrtIdemDiv`. We prove that in a prime artinian ring, every ideal is nice. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -28,12 +28,12 @@ variable {R : Type*} [Ring R] universe u /-- An ideal is *idempotent-generated* when it is the (left) span of a single idempotent. -/ -def IdemIdeal (I : Ideal R) : Prop := +@[expose] def IdemIdeal (I : Ideal R) : Prop := ∃ (e : R), IsIdempotentElem e ∧ I = Ideal.span {e} /-- An ideal is *nice* when, whenever it is generated by an idempotent `e`, the corner ring `eRe` admits an `OrtIdemDiv` decomposition. -/ -def NiceIdeal (I : Ideal R) := +@[expose] def NiceIdeal (I : Ideal R) := IdemIdeal I → ∀ (e : R) (idem : IsIdempotentElem e), I = Ideal.span {e} → OrtIdemDiv (CornerSubring idem) @@ -64,7 +64,7 @@ def zeroIdealNice : NiceIdeal (⊥ : Ideal R) := by /-- Extend a list of `n` elements with an extra entry `x` in front, yielding `n + 1` elements. -/ -def idempotents {α : Type*} {n : ℕ} (x : α) (h : Fin n → α) : Fin (n + 1) → α := +@[expose] def idempotents {α : Type*} {n : ℕ} (x : α) (h : Fin n → α) : Fin (n + 1) → α := Fin.cases x h lemma idempotents_first {α : Type*} {n : ℕ} (x : α) (h : Fin n → α) : diff --git a/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean b/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean index 43495ecb45..e684712c6c 100644 --- a/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean +++ b/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean @@ -14,7 +14,7 @@ If a non-unital ring `R` has an element `e` that is both a left and a right identity, then `R` admits a (unital) ring structure with `1 = e`. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -22,8 +22,7 @@ variable {R : Type*} [NonUnitalRing R] variable (e : R) /-- Designate `e` as the `1` element when building a unital `Ring` structure on `R`. -/ -@[reducible] -def eOne : One R := ⟨e⟩ +@[reducible, expose] def eOne : One R := ⟨e⟩ variable (is_left_unit : ∀ x : R, e * x = x) variable (is_right_unit : ∀ x : R, x * e = x) @@ -36,8 +35,7 @@ The additive structure is inherited verbatim from the `NonUnitalRing R` instance `AddCommMonoid R` carried by the result is the one already in scope; rebuilding it (as `Ring.ofMinimalAxioms` would) yields `nsmulRec`/`zsmulRec` instead and makes the two incomparable during instance synthesis. -/ -@[reducible] -def nonUnitalWEIsRing : Ring R where +@[reducible, expose] def nonUnitalWEIsRing : Ring R where __ := (inferInstance : NonUnitalRing R) __ := eOne e one_mul := is_left_unit diff --git a/LeanPool/ArtinWedderburn/PrimeRing.lean b/LeanPool/ArtinWedderburn/PrimeRing.lean index 1eebe1d5f3..21ad200ebf 100644 --- a/LeanPool/ArtinWedderburn/PrimeRing.lean +++ b/LeanPool/ArtinWedderburn/PrimeRing.lean @@ -24,7 +24,7 @@ elementwise version `aRb = 0 → a = 0 ∨ b = 0` and to the two-sided ideal ver Concludes that simple rings are prime. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -33,7 +33,7 @@ variable {R : Type*} [Ring R] -- A ring is prime if from I * J = 0 it follows that I = 0 or J = 0 for any ideals I, J /-- A ring is *prime* when the product of two left ideals can be zero only if at least one of the factors is zero. -/ -def IsPrimeRing (R : Type*) [Ring R] : Prop := +@[expose] def IsPrimeRing (R : Type*) [Ring R] : Prop := ∀ (I J : Ideal R), (I * J) = ⊥ → I = ⊥ ∨ J = ⊥ -- A ring is prime if any of the following equivalent statements hold diff --git a/LeanPool/ArtinWedderburn/SetProd.lean b/LeanPool/ArtinWedderburn/SetProd.lean index fa4777bc73..34661f7980 100644 --- a/LeanPool/ArtinWedderburn/SetProd.lean +++ b/LeanPool/ArtinWedderburn/SetProd.lean @@ -21,7 +21,7 @@ the consequence that `aRb = 0` collapses these auxiliary sets to zero. Used by t characterisation. -/ -@[expose] public section +public section namespace LeanPool.ArtinWedderburn @@ -29,7 +29,7 @@ variable {R : Type*} [Ring R] (a b : R) -- leftMul a is the set Ra /-- The set `Ra = {r * a | r : R}` of left multiples of `a`. -/ -def leftMul (a : R) : Set R := {x | ∃ r : R, x = r * a} +@[expose] def leftMul (a : R) : Set R := {x | ∃ r : R, x = r * a} -- rightMul a is the set aR /-- The set `aR = {a * r | r : R}` of right multiples of `a`. -/ @@ -68,7 +68,7 @@ theorem both_mul_zero_one_left_zero : simp_all /-- The principal left ideal `Ra` generated by `a`, packaged as an `Ideal R`. -/ -def leftIdealOfElement (a : R) : Ideal R := +@[expose] def leftIdealOfElement (a : R) : Ideal R := { carrier := leftMul a, zero_mem' := by use 0; noncomm_ring, add_mem' := by @@ -83,6 +83,6 @@ def leftIdealOfElement (a : R) : Ideal R := noncomm_ring } theorem carrier_of_left_ideal_of_element (a : R) : - (leftIdealOfElement a).carrier = leftMul a := rfl + (leftIdealOfElement a).carrier = leftMul a := by rfl end LeanPool.ArtinWedderburn diff --git a/LeanPool/AsymptoticTrianglePacking/Basic.lean b/LeanPool/AsymptoticTrianglePacking/Basic.lean index a29cff5ba6..3be2cd7478 100644 --- a/LeanPool/AsymptoticTrianglePacking/Basic.lean +++ b/LeanPool/AsymptoticTrianglePacking/Basic.lean @@ -15,7 +15,7 @@ The public statement records the finite near-regular hypergraph rounding interfa the nibble method. The underlying finite definitions are kept in the internal library. -/ -@[expose] public section +public section namespace LeanPool.AsymptoticTrianglePacking diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/AdaptiveRounds.lean b/LeanPool/AsymptoticTrianglePacking/Internal/AdaptiveRounds.lean index 11dc07b684..6783f03c5e 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/AdaptiveRounds.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/AdaptiveRounds.lean @@ -47,7 +47,7 @@ matching. Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph @@ -271,7 +271,7 @@ currently covered set) which still-uncovered vertices and re-establishes the invariant. This is the per-round (non-iterated) content of the nibble outer loop. -/ -def HasRoundOracle (H : Finset (Finset V)) (c β : ℝ) : Prop := +@[expose] def HasRoundOracle (H : Finset (Finset V)) (c β : ℝ) : Prop := ∃ Inv : Finset (Finset V) → Finset V → Prop, Inv H ∅ ∧ ∀ (H' : Finset (Finset V)) (S : Finset V), Inv H' S → diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean index 7f6297de81..b0535ee65a 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Assemble.lean @@ -28,7 +28,7 @@ Definitions from `LeanPool.AsymptoticTrianglePacking.Internal.Basic` / Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Assembly.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Assembly.lean index 548f55be99..ba034184d5 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Assembly.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Assembly.lean @@ -28,7 +28,7 @@ Definitions (`IsMatching`, `support`) come from `LeanPool.AsymptoticTrianglePack Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Basic.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Basic.lean index 717220b283..f77346e54f 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Basic.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Basic.lean @@ -22,7 +22,7 @@ Goals of this module: Everything here must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -31,14 +31,15 @@ namespace Hypergraph variable {V : Type*} [DecidableEq V] [Fintype V] /-- The degree of a vertex `v` in a hypergraph `H`: the number of edges containing `v`. -/ -def degree (H : Finset (Finset V)) (v : V) : ℕ := (H.filter (fun e => v ∈ e)).card +@[expose] def degree (H : Finset (Finset V)) (v : V) : ℕ := (H.filter (fun e => v ∈ e)).card /-- The codegree of a pair `x y`: the number of edges containing both. -/ +@[expose] def codegree (H : Finset (Finset V)) (x y : V) : ℕ := (H.filter (fun e => x ∈ e ∧ y ∈ e)).card /-- `H` is `r`-uniform: every edge has exactly `r` vertices. -/ -def IsUniform (H : Finset (Finset V)) (r : ℕ) : Prop := ∀ e ∈ H, e.card = r +@[expose] def IsUniform (H : Finset (Finset V)) (r : ℕ) : Prop := ∀ e ∈ H, e.card = r /-- A matching `M` in `H`: a subfamily of pairwise-disjoint edges. -/ structure IsMatching (H M : Finset (Finset V)) : Prop where diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/BernoulliSpace.lean b/LeanPool/AsymptoticTrianglePacking/Internal/BernoulliSpace.lean index 383242a338..13dd25900c 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/BernoulliSpace.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/BernoulliSpace.lean @@ -25,7 +25,7 @@ coordinate events are independent (product measure) and each has probability `p` Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/CeilingOracle.lean b/LeanPool/AsymptoticTrianglePacking/Internal/CeilingOracle.lean index 96e01d2382..48775668ad 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/CeilingOracle.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/CeilingOracle.lean @@ -16,7 +16,7 @@ tight-band nibble proof. It deliberately contains no historical majority-only or round-oracle development: the global degree ceiling is part of every input. -/ -@[expose] public section +public section open Finset Hypergraph @@ -54,7 +54,7 @@ theorem nibbleTheoremMostCeil_of_adaptiveOracleCeil (h : AdaptiveOracleExistsCei exact exists_matching_of_oracle_seq_lt hSubset hUniform hrOne hNonnegative T hProduct hRound /-- A one-round ceiling oracle which can be iterated into the adaptive oracle. -/ -def RoundOracleExistsCeil : Prop := +@[expose] def RoundOracleExistsCeil : Prop := ∀ (r : ℕ), 2 ≤ r → ∀ (β : ℝ), 0 < β → ∃ μ : ℝ, 0 < μ ∧ ∃ η : ℝ, 0 < η ∧ ∃ d₀ : ℝ, 0 < d₀ ∧ ∃ c : ℝ, 0 < c ∧ c ≤ 1 ∧ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Conflict.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Conflict.lean index 9ecd5427d4..f6865a69f1 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Conflict.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Conflict.lean @@ -30,7 +30,7 @@ Definitions (`degree`, `IsUniform`) come from `LeanPool.AsymptoticTrianglePackin Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -39,6 +39,7 @@ namespace Hypergraph variable {V : Type*} [DecidableEq V] /-- The conflict set of an edge `e`: the other edges of `H` that meet `e`. -/ +@[expose] def conflicts (H : Finset (Finset V)) (e : Finset V) : Finset (Finset V) := H.filter (fun f => f ≠ e ∧ (e ∩ f).Nonempty) diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Convergence.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Convergence.lean index 3efa40de86..578ba853d2 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Convergence.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Convergence.lean @@ -28,7 +28,7 @@ This is the deterministic convergence mechanism into which the per-round coverin Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section namespace LeanPool.AsymptoticTrianglePacking.Internal diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Covered.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Covered.lean index a600f75755..0d6d9c5deb 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Covered.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Covered.lean @@ -31,7 +31,7 @@ This union-bound estimate deliberately sidesteps the delicate correlation struct Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph @@ -40,6 +40,7 @@ namespace LeanPool.AsymptoticTrianglePacking.Internal variable {V : Type*} [DecidableEq V] {Ω : Type*} [MeasureSpace Ω] /-- The set of retained edges at outcome `ω` (classically decidable membership in the events). -/ +@[expose] noncomputable def retainedSet (H : Finset (Finset V)) {p : ℝ} (ρ : BernoulliRetention (Ω := Ω) H p) (ω : Ω) : Finset (Finset V) := by classical diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/CoveredExpectation.lean b/LeanPool/AsymptoticTrianglePacking/Internal/CoveredExpectation.lean index dd476ec350..bdbd29f0b6 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/CoveredExpectation.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/CoveredExpectation.lean @@ -32,7 +32,7 @@ hypergraph). Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/DischargeSeq.lean b/LeanPool/AsymptoticTrianglePacking/Internal/DischargeSeq.lean index 563f0ad43a..173191ee82 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/DischargeSeq.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/DischargeSeq.lean @@ -31,7 +31,7 @@ uncovered vertices, and the uncovered count after `T` rounds is controlled by th Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Greedy.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Greedy.lean index 423218b662..996d3e603d 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Greedy.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Greedy.lean @@ -29,7 +29,7 @@ Definitions (`degree`, `IsUniform`, `IsMatching`) come from Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -38,6 +38,7 @@ namespace Hypergraph variable {V : Type*} [DecidableEq V] /-- The support (vertex set) of a family of edges. -/ +@[expose] def support (M : Finset (Finset V)) : Finset V := M.biUnion id /-- **A3a — support cardinality.** A matching of an `r`-uniform hypergraph covers exactly diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Interface.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Interface.lean index 9820994e47..1c2d36acee 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Interface.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Interface.lean @@ -20,7 +20,7 @@ Definitions come from `LeanPool.AsymptoticTrianglePacking.Internal.Basic` (`IsUn (`NearlyRegular`, `CodegreeBounded`). -/ -@[expose] public section +public section open Hypergraph @@ -30,7 +30,7 @@ namespace LeanPool.AsymptoticTrianglePacking.Internal near-regularity/codegree tolerance `μ > 0` such that every `r`-uniform hypergraph on a finite vertex set that is `(1±μ)`-nearly `d`-regular with codegree `≤ μd` has a matching covering at least a `(1-β)` fraction of the maximum possible (`|V|/r`). -/ -def NibbleTheorem : Prop := +@[expose] def NibbleTheorem : Prop := ∀ (r : ℕ), 2 ≤ r → ∀ (β : ℝ), 0 < β → ∃ μ : ℝ, 0 < μ ∧ ∃ d₀ : ℝ, 0 < d₀ ∧ ∀ {V : Type} [Fintype V] [DecidableEq V] (H : Finset (Finset V)) (d : ℝ), 0 < d → d₀ ≤ d → IsUniform H r → NearlyRegular H d μ → CodegreeBounded H (μ * d) → diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Iteration.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Iteration.lean index 75e743c5c6..e5d321156c 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Iteration.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Iteration.lean @@ -31,7 +31,7 @@ Definitions come from `LeanPool.AsymptoticTrianglePacking.Internal.Basic` / `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -41,7 +41,7 @@ variable {V : Type*} [DecidableEq V] /-- Run `k` nibble rounds from `H` under retention strategy `R`, returning `(accumulated matching, current residual)`. -/ -def nibbleIter (R : Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) : +@[expose] def nibbleIter (R : Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) : ℕ → Finset (Finset V) × Finset (Finset V) := nibbleIterSeq (fun _ => R) H @@ -52,10 +52,12 @@ theorem nibbleIterSeq_const (R : Finset (Finset V) → Finset (Finset V)) (H : F rfl /-- The residual hypergraph after `k` rounds. -/ +@[expose] def nibbleResidual (R : Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) (k : ℕ) : Finset (Finset V) := (nibbleIter R H k).2 /-- The matching accumulated over `k` rounds. -/ +@[expose] def nibbleMatching (R : Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) (k : ℕ) : Finset (Finset V) := (nibbleIter R H k).1 diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/IterationSeq.lean b/LeanPool/AsymptoticTrianglePacking/Internal/IterationSeq.lean index f9296572e8..a0e7944058 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/IterationSeq.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/IterationSeq.lean @@ -38,7 +38,7 @@ The fixed-strategy iteration is recovered by specializing this sequence in Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -48,6 +48,7 @@ variable {V : Type*} [DecidableEq V] /-- Run `k` nibble rounds from `H`, using the strategy `R i` in round `i`; returns `(accumulated matching, current residual)`. -/ +@[expose] def nibbleIterSeq (R : ℕ → Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) : ℕ → Finset (Finset V) × Finset (Finset V) | 0 => (∅, H) @@ -56,10 +57,12 @@ def nibbleIterSeq (R : ℕ → Finset (Finset V) → Finset (Finset V)) (H : Fin residual (nibbleIterSeq R H k).2 (R k (nibbleIterSeq R H k).2)) /-- The residual hypergraph after `k` rounds of a strategy sequence. -/ +@[expose] def nibbleResidualSeq (R : ℕ → Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) (k : ℕ) : Finset (Finset V) := (nibbleIterSeq R H k).2 /-- The matching accumulated over `k` rounds of a strategy sequence. -/ +@[expose] def nibbleMatchingSeq (R : ℕ → Finset (Finset V) → Finset (Finset V)) (H : Finset (Finset V)) (k : ℕ) : Finset (Finset V) := (nibbleIterSeq R H k).1 diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Measurable.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Measurable.lean index 72d6ff0993..cc9794e33e 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Measurable.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Measurable.lean @@ -26,7 +26,7 @@ and the round's matching / covered set are finite Boolean combinations of the re Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/NearRegularNibble.lean b/LeanPool/AsymptoticTrianglePacking/Internal/NearRegularNibble.lean index 3c4a93a1e9..0761981c2e 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/NearRegularNibble.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/NearRegularNibble.lean @@ -16,7 +16,7 @@ A finite, ceiling-carrying nibble theorem for near-regular uniform hypergraphs. The module deliberately stops before application-specific graph-transfer assemblies. -/ -@[expose] public section +public section open Finset Hypergraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Regular.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Regular.lean index a6c0e42d7b..b68617a782 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Regular.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Regular.lean @@ -26,7 +26,7 @@ Definitions (`degree`, `codegree`) come from `LeanPool.AsymptoticTrianglePacking Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -35,11 +35,11 @@ namespace Hypergraph variable {V : Type*} [DecidableEq V] /-- `H` is `(1 ± μ)`-nearly `d`-regular: every degree lies in `[(1-μ)d, (1+μ)d]`. -/ -def NearlyRegular (H : Finset (Finset V)) (d μ : ℝ) : Prop := +@[expose] def NearlyRegular (H : Finset (Finset V)) (d μ : ℝ) : Prop := ∀ v : V, (1 - μ) * d ≤ (degree H v : ℝ) ∧ (degree H v : ℝ) ≤ (1 + μ) * d /-- `H` has codegree bounded by `C`: every distinct pair lies in at most `C` edges. -/ -def CodegreeBounded (H : Finset (Finset V)) (C : ℝ) : Prop := +@[expose] def CodegreeBounded (H : Finset (Finset V)) (C : ℝ) : Prop := ∀ x y : V, x ≠ y → (codegree H x y : ℝ) ≤ C /-- **A4 — degree-sum squeeze.** If `H` is `(1±μ)`-nearly `d`-regular on a finite vertex type, diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean b/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean index 57a0fa5d3d..a6258a6ca5 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/RegularMost.lean @@ -27,7 +27,7 @@ that consume this hypothesis. Must be placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -37,7 +37,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] /-- **Majority near-regularity.** `H` is `(1±μ)`-nearly `d`-regular outside an exceptional set of vertices of size at most `η·|V|`. Recovers `NearlyRegular` when the exceptional set is empty. -/ -def NearlyRegularMost (H : Finset (Finset V)) (d μ η : ℝ) : Prop := +@[expose] def NearlyRegularMost (H : Finset (Finset V)) (d μ η : ℝ) : Prop := ∃ Exc : Finset V, (Exc.card : ℝ) ≤ η * (Fintype.card V : ℝ) ∧ ∀ v ∉ Exc, (1 - μ) * d ≤ (degree H v : ℝ) ∧ (degree H v : ℝ) ≤ (1 + μ) * d @@ -70,6 +70,7 @@ def NibbleTheoremMost : Prop := Freedman assembly: in addition to majority near-regularity and codegree boundedness, every vertex has degree at most `(1+μ)d`. -/ +@[expose] def NibbleTheoremMostCeil : Prop := ∀ (r : ℕ), 2 ≤ r → ∀ (β : ℝ), 0 < β → ∃ μ : ℝ, 0 < μ ∧ ∃ η : ℝ, 0 < η ∧ ∃ d₀ : ℝ, 0 < d₀ ∧ ∀ {V : Type} [Fintype V] [DecidableEq V] (H : Finset (Finset V)) (d : ℝ), 0 < d → d₀ ≤ d → @@ -82,7 +83,7 @@ def NibbleTheoremMostCeil : Prop := selection needs a uniform way to make the all-vertices bad-event probability small. The abstract hypergraph hypotheses do not bound `|V|` in terms of the regular degree scale `d`; the triangle hypergraph application does. This interface records that missing input explicitly. -/ -def NibbleTheoremMostCeilSized : Prop := +@[expose] def NibbleTheoremMostCeilSized : Prop := ∀ (r : ℕ), 2 ≤ r → ∀ (β : ℝ), 0 < β → ∃ μ : ℝ, 0 < μ ∧ ∃ η : ℝ, 0 < η ∧ ∃ d₀ : ℝ, 0 < d₀ ∧ ∃ K : ℝ, 0 < K ∧ ∀ {V : Type} [Fintype V] [DecidableEq V] (H : Finset (Finset V)) (d : ℝ), 0 < d → d₀ ≤ d → diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Round.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Round.lean index d6b1a6c161..32b6d2a3a8 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Round.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Round.lean @@ -38,7 +38,7 @@ Definitions (`degree`, `IsUniform`, `IsMatching`, `support`) come from `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset @@ -48,13 +48,16 @@ variable {V : Type*} [DecidableEq V] /-- The matching induced by a retained set `R`: the retained edges that are disjoint from every other retained edge. -/ +@[expose] def roundMatching (R : Finset (Finset V)) : Finset (Finset V) := R.filter (fun e => ∀ f ∈ R, f ≠ e → Disjoint e f) /-- The vertices covered by the round's matching. -/ +@[expose] def covered (R : Finset (Finset V)) : Finset V := support (roundMatching R) /-- The residual hypergraph: edges of `H` that avoid the covered vertices. -/ +@[expose] def residual (H R : Finset (Finset V)) : Finset (Finset V) := H.filter (fun e => Disjoint e (covered R)) diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/RoundConflict.lean b/LeanPool/AsymptoticTrianglePacking/Internal/RoundConflict.lean index fd1123dda6..6bd6b3440f 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/RoundConflict.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/RoundConflict.lean @@ -27,7 +27,7 @@ Definitions come from `LeanPool.AsymptoticTrianglePacking.Internal.Basic`, axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Survival.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Survival.lean index b457a95ae4..657793aab8 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Survival.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Survival.lean @@ -27,7 +27,7 @@ placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ConflictCount.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ConflictCount.lean index 8738d826d9..eaf0bcd27b 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ConflictCount.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ConflictCount.lean @@ -36,7 +36,7 @@ Proof. Writing `S = ∑_{h ∈ H} a(h)·b(h)` with `a(h) = #{f ∋ u : h ∈ co placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverProb.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverProb.lean index 3df63d4b0c..fdc3424fc1 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverProb.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverProb.lean @@ -37,7 +37,7 @@ expressions that agree to second order. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable @@ -52,7 +52,7 @@ variable {V : Type*} [DecidableEq V] {Ω : Type*} [MeasureSpace Ω] /-- **The exact one-round covering rate of a vertex.** `∑_{f ∋ x} p·(1−p)^{c(f)}`, where `c(f)` is the number of edges conflicting with `f`. By `prob_vertex_covered_eq` this is *exactly* the probability that `x` is covered by the round matching. -/ -noncomputable def coverRate (H : Finset (Finset V)) (p : ℝ) (x : V) : ℝ := +@[expose] noncomputable def coverRate (H : Finset (Finset V)) (p : ℝ) (x : V) : ℝ := ∑ f ∈ H.filter (fun f => x ∈ f), p * (1 - p) ^ (conflicts H f).card omit [IsProbabilityMeasure (ℙ : Measure Ω)] in diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverVariance.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverVariance.lean index 0cd6cfff03..bc52b8523f 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverVariance.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverVariance.lean @@ -40,7 +40,7 @@ i.e. `≤ 1/2` as soon as `N ≥ 16/γ` and `μ ≤ γ/16` — INDEPENDENTLY of placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeight.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeight.lean index 534b47a63b..a4f29ee076 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeight.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeight.lean @@ -38,7 +38,7 @@ what makes the SAFE degree concentrate where the residual degree cannot. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph @@ -47,11 +47,11 @@ namespace LeanPool.AsymptoticTrianglePacking.Internal variable {V : Type*} [DecidableEq V] /-- The loss weight of `v` against a covered set `C`: `∑_{u ∈ C, u ≠ v} codeg(v,u)`. -/ -def coverWeight (H : Finset (Finset V)) (v : V) (C : Finset V) : ℕ := +@[expose] def coverWeight (H : Finset (Finset V)) (v : V) (C : Finset V) : ℕ := ∑ u ∈ C.erase v, codegree H v u /-- The Bonferroni correction: `∑_{e ∋ v} C(|(e∖v) ∩ C|, 2)`. -/ -def pairWeight (H : Finset (Finset V)) (v : V) (C : Finset V) : ℕ := +@[expose] def pairWeight (H : Finset (Finset V)) (v : V) (C : Finset V) : ℕ := ∑ e ∈ H.filter (fun e => v ∈ e), Nat.choose ((e.erase v ∩ C).card) 2 /-- `coverWeight` counted edge-by-edge: `∑_{e ∋ v} |(e∖v) ∩ C|`. -/ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeightMoments.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeightMoments.lean index a9344990f4..e7bcf9f3af 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeightMoments.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CoverWeightMoments.lean @@ -37,7 +37,7 @@ regime, which is precisely the concentration the residual degree cannot have. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable @@ -50,7 +50,7 @@ variable {V : Type*} [DecidableEq V] [Fintype V] {Ω : Type*} [MeasureSpace Ω] /-! ## The covering indicator -/ /-- The indicator that `u` is covered by the round matching. -/ -noncomputable def coverInd {H : Finset (Finset V)} {p : ℝ} +@[expose] noncomputable def coverInd {H : Finset (Finset V)} {p : ℝ} (ρ : BernoulliRetention (Ω := Ω) H p) (u : V) (ω : Ω) : ℝ := if u ∈ covered (retainedSet H ρ ω) then 1 else 0 @@ -114,7 +114,7 @@ theorem integrable_coverInd_mul {H : Finset (Finset V)} {p : ℝ} /-! ## The centred covering indicator -/ /-- The centred covering indicator `1[u covered] − q_u`. -/ -noncomputable def coverIndC {H : Finset (Finset V)} {p : ℝ} +@[expose] noncomputable def coverIndC {H : Finset (Finset V)} {p : ℝ} (ρ : BernoulliRetention (Ω := Ω) H p) (u : V) (ω : Ω) : ℝ := coverInd ρ u ω - coverRate H p u @@ -189,7 +189,7 @@ noncomputable def lossWeight {H : Finset (Finset V)} {p : ℝ} ∑ u ∈ (Finset.univ : Finset V).erase v, (codegree H v u : ℝ) * coverInd ρ u ω /-- Its deterministic mean. -/ -noncomputable def lossWeightMean (H : Finset (Finset V)) (p : ℝ) (v : V) : ℝ := +@[expose] noncomputable def lossWeightMean (H : Finset (Finset V)) (p : ℝ) (v : V) : ℝ := ∑ u ∈ (Finset.univ : Finset V).erase v, (codegree H v u : ℝ) * coverRate H p u omit [IsProbabilityMeasure (ℙ : Measure Ω)] in diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeRetention.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeRetention.lean index acd0796ee3..ff9c11720a 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeRetention.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeRetention.lean @@ -36,7 +36,7 @@ for which (`LeanPool.AsymptoticTrianglePacking.Internal.cube_centred_sq_le`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset @@ -51,7 +51,7 @@ noncomputable def cubeMeasure (p : ℝ) : Measure (ι → Bool) := ∑ ω : ι → Bool, ENNReal.ofReal (wt p ω) • Measure.dirac ω /-- The finite cube as a measure space. -/ -@[instance_reducible] +@[instance_reducible, expose] noncomputable def cubeSpace (p : ℝ) : MeasureSpace (ι → Bool) := ⟨cubeMeasure p⟩ theorem cubeMeasure_apply {p : ℝ} (hp0 : 0 ≤ p) (hp1 : p ≤ 1) (A : Set (ι → Bool)) : diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeVariance.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeVariance.lean index ce8cf7507a..0b334cab5d 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeVariance.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/CubeVariance.lean @@ -38,7 +38,7 @@ Averaging over a duplicate-free list exhausting `ι` turns `f` into the constant telescoping sum of the second bullet is exactly the statement. -/ -@[expose] public section +public section open Finset @@ -56,6 +56,7 @@ def wtc (i : ι) (p : ℝ) (ω : ι → Bool) : ℝ := ∏ j ∈ Finset.univ.erase i, (if ω j then p else 1 - p) /-- The expectation of `f` on the Bernoulli(`p`) cube. -/ +@[expose] def Exp (p : ℝ) (f : (ι → Bool) → ℝ) : ℝ := ∑ ω, wt p ω * f ω omit [DecidableEq ι] in @@ -82,6 +83,7 @@ theorem wtc_update (i : ι) (p : ℝ) (ω : ι → Bool) (b : Bool) : /-! ## The one-coordinate averaging operator -/ /-- The discrete derivative of `f` in coordinate `i`. -/ +@[expose] def D (i : ι) (f : (ι → Bool) → ℝ) (ω : ι → Bool) : ℝ := f (Function.update ω i true) - f (Function.update ω i false) diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/FlipStability.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/FlipStability.lean index 364e042ef9..20e0a71624 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/FlipStability.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/FlipStability.lean @@ -52,7 +52,7 @@ gives exactly `O_r(γΔ(1 + κ))`, the sharp bound — the arithmetic is recorde placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph @@ -64,7 +64,7 @@ variable {V : Type*} [DecidableEq V] /-- The edges whose membership in the round matching can be affected by flipping the retention status of `e`: the edge `e` itself, and the retained edges meeting `e`. -/ -def flipInfluence (R : Finset (Finset V)) (e : Finset V) : Finset (Finset V) := +@[expose] def flipInfluence (R : Finset (Finset V)) (e : Finset V) : Finset (Finset V) := insert e (R.filter (fun f => ¬ Disjoint f e)) theorem notMem_flipInfluence_ne {R : Finset (Finset V)} {e f : Finset V} diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/LossVariance.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/LossVariance.lean index 04f4ad7634..c12c5f7656 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/LossVariance.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/LossVariance.lean @@ -34,7 +34,7 @@ the concentration that the residual degree does not have. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairExcessCodegree.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairExcessCodegree.lean index 2124582fd7..ca446363d3 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairExcessCodegree.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairExcessCodegree.lean @@ -53,7 +53,7 @@ codegree, which the nibble hypothesis lets us choose as small as we like) below placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairWeightMean.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairWeightMean.lean index d75da1471f..87341b1899 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairWeightMean.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/PairWeightMean.lean @@ -31,7 +31,7 @@ of the vertices. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable @@ -80,7 +80,7 @@ theorem choose_two_le_sum_pair_ind (D C : Finset V) : /-! ## The pair count as a random variable -/ /-- The ordered-pair count of covering indicators at `v`. -/ -noncomputable def pairCount {H : Finset (Finset V)} {p : ℝ} +@[expose] noncomputable def pairCount {H : Finset (Finset V)} {p : ℝ} (ρ : BernoulliRetention (Ω := Ω) H p) (v : V) (ω : Ω) : ℝ := ∑ e ∈ H.filter (fun e => v ∈ e), ∑ u ∈ e.erase v, ∑ u' ∈ (e.erase v).erase u, coverInd ρ u ω * coverInd ρ u' ω diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Pruning.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Pruning.lean index aa515f2cfb..bfd7b2250d 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Pruning.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Pruning.lean @@ -27,7 +27,7 @@ Pure `Finset` combinatorics, no probability. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph @@ -36,11 +36,11 @@ namespace LeanPool.AsymptoticTrianglePacking.Internal variable {V : Type*} [DecidableEq V] [Fintype V] /-- The edges lost at `v` when the vertex set `B` is deleted. -/ -def lostDegree (H : Finset (Finset V)) (B : Finset V) (v : V) : ℕ := +@[expose] def lostDegree (H : Finset (Finset V)) (B : Finset V) (v : V) : ℕ := (H.filter (fun e => v ∈ e ∧ ¬ Disjoint e B)).card /-- The hypergraph with all edges meeting `B` removed. -/ -def prune (H : Finset (Finset V)) (B : Finset V) : Finset (Finset V) := +@[expose] def prune (H : Finset (Finset V)) (B : Finset V) : Finset (Finset V) := H.filter (fun e => Disjoint e B) omit [Fintype V] in diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBand.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBand.lean index 4478deb1a2..24bbfaa575 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBand.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBand.lean @@ -38,7 +38,7 @@ cannot do. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBandCheb.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBandCheb.lean index 682123b1c8..b0b34de63c 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBandCheb.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/ResidualBandCheb.lean @@ -48,7 +48,7 @@ provide (there `s ≳ γd/θ`, first order in `γ`). placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/RoundExplicit.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/RoundExplicit.lean index 2317c717e2..2a07c26f78 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/RoundExplicit.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/RoundExplicit.lean @@ -41,7 +41,7 @@ first order in `γ` and the accumulation does not vanish. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegree.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegree.lean index 9fa7a33bc0..fb2ebf6d3c 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegree.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegree.lean @@ -38,7 +38,7 @@ agree to second order, which is exactly what the loose brackets placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable @@ -51,6 +51,7 @@ variable {V : Type*} [DecidableEq V] {Ω : Type*} [MeasureSpace Ω] /-! ## The safe degree -/ /-- **The safe degree.** The number of edges at `v` whose vertices OTHER than `v` all avoid `C`. -/ +@[expose] def safeDegree (H : Finset (Finset V)) (C : Finset V) (v : V) : ℕ := (H.filter (fun e => v ∈ e ∧ Disjoint (e.erase v) C)).card @@ -85,7 +86,7 @@ theorem residual_degree_le_safeDegree {H R : Finset (Finset V)} (v : V) : /-! ## The safe-degree indicator and its expectation -/ /-- The indicator that all vertices of `e` other than `v` survive the round. -/ -noncomputable def safeIndicator {H : Finset (Finset V)} {p : ℝ} +@[expose] noncomputable def safeIndicator {H : Finset (Finset V)} {p : ℝ} (ρ : BernoulliRetention (Ω := Ω) H p) (v : V) (e : Finset V) (ω : Ω) : ℝ := if Disjoint (e.erase v) (covered (retainedSet H ρ ω)) then 1 else 0 diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegreeVariance.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegreeVariance.lean index 9587a794dc..cc284941f7 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegreeVariance.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeDegreeVariance.lean @@ -51,7 +51,7 @@ for the round to be iterated, and removing it requires a third-order Bonferroni placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeRoundCheb.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeRoundCheb.lean index a23018fd8a..35efaf45bc 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeRoundCheb.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SafeRoundCheb.lean @@ -50,7 +50,7 @@ which would turn `Vs ≈ 2γ³Δ²` into `Vs = O(γ⁴Δ²)`. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Selection.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Selection.lean index 22756b14ab..13bd1d2254 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Selection.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/Selection.lean @@ -23,7 +23,7 @@ Two elementary tools used to extract a single good outcome of a nibble round. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory Finset open scoped ProbabilityTheory diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRound.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRound.lean index c71273c2f3..df840bd3f2 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRound.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRound.lean @@ -17,7 +17,7 @@ It packages retention, concentration, degree-band, codegree, and cover-rate boun can be iterated by the schedule. -/ -@[expose] public section +public section open Finset Hypergraph @@ -47,7 +47,7 @@ admits a retained set `R' ⊆ K` and an exceptional set `B`, `|B| ≤ θ|V|`, su `Δ − ((r−1)/r)·γ·(δ − lost(v))·δ·(1−γ)/Δ + εγΔ`, where `lost(v) = lostDegree K Aᶜ v` counts the edges at `v` leaving `A`, and * the round covers at least a `γ/(8r)` fraction of `A`. -/ -def SharpRoundFor (r : ℕ) (γ ε θ α D₀ c₀ : ℝ) : Prop := +@[expose] def SharpRoundFor (r : ℕ) (γ ε θ α D₀ c₀ : ℝ) : Prop := ∀ {V : Type} [Fintype V] [DecidableEq V] (K : Finset (Finset V)) (A : Finset V) (δ Δ κ : ℝ), IsUniform K r → diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundAssembly.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundAssembly.lean index c45ed57769..dd357becd5 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundAssembly.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundAssembly.lean @@ -47,7 +47,7 @@ the sharp upper bound `(1−p)^{rΔ} ≤ 1 − γ + γ²/2` the `(1−γ)` factor carried by the ceiling drop that `SharpRoundFor` requests. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundProof.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundProof.lean index bf4b17298d..194bd1f1da 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundProof.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpRoundProof.lean @@ -24,7 +24,7 @@ safe-degree variance bound on the elementary Bernoulli cube. Here it is transpo Chebyshev round `LeanPool.AsymptoticTrianglePacking.Internal.exists_safe_round_cheb` consumes. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpVariance.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpVariance.lean index 1224972ab3..f408d81004 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpVariance.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/SharpVariance.lean @@ -37,7 +37,7 @@ inside `k ∪ ⋃ {f ∈ R : f meets k}`, so the safe degree at `v` moves by at Squaring, taking expectations and summing over `k` produces exactly the three terms above. -/ -@[expose] public section +public section open Finset Hypergraph LeanPool.AsymptoticTrianglePacking.Internal.Cube @@ -48,11 +48,11 @@ variable {V : Type*} [Fintype V] [DecidableEq V] /-! ## The cube picture of a round -/ /-- The retained set at a configuration of the cube. -/ -def retSet (H : Finset (Finset V)) (ω : Finset V → Bool) : Finset (Finset V) := +@[expose] def retSet (H : Finset (Finset V)) (ω : Finset V → Bool) : Finset (Finset V) := H.filter (fun e => ω e = true) /-- The safe degree at `v` as a function on the cube. -/ -def safeDegCube (H : Finset (Finset V)) (v : V) (ω : Finset V → Bool) : ℝ := +@[expose] def safeDegCube (H : Finset (Finset V)) (v : V) (ω : Finset V → Bool) : ℝ := (safeDegree H (covered (retSet H ω)) v : ℝ) /-- The codegree weight of an edge as seen from `v`: `∑_{u ∈ f∖v} codeg(v,u)`. -/ diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean index 1b49e06165..9e9e2a6787 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRound.lean @@ -35,7 +35,7 @@ coverage). The two failure probabilities add up to `< 1`, so a good outcome exi placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundCheb.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundCheb.lean index a3a9c8dc75..5d1f9a46d8 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundCheb.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundCheb.lean @@ -39,7 +39,7 @@ i.e. deviations of relative size `γ²`, whose accumulation over `γ^{-1}log(1/ placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundConcrete.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundConcrete.lean index f14d173ca8..22d98375bf 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundConcrete.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TightRoundConcrete.lean @@ -33,7 +33,7 @@ for all but `a` vertices, and a guaranteed coverage fraction. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TwoEdgeMatch.lean b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TwoEdgeMatch.lean index f75e0e61dd..670746a32e 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TwoEdgeMatch.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/Tight/TwoEdgeMatch.lean @@ -39,7 +39,7 @@ the nibble's residual degrees concentrate. placeholder-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset Hypergraph attribute [local instance] Classical.propDecidable diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/TightAssembly.lean b/LeanPool/AsymptoticTrianglePacking/Internal/TightAssembly.lean index 13e873fb4f..ba24f165de 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/TightAssembly.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/TightAssembly.lean @@ -55,7 +55,7 @@ The three mechanisms of the assembly are: Must be sorry-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset Hypergraph diff --git a/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean b/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean index 9a756caaf5..21bd0db18f 100644 --- a/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean +++ b/LeanPool/AsymptoticTrianglePacking/Internal/TightSchedule.lean @@ -39,7 +39,7 @@ The two per-round band inequalities reduce to the polynomial cores Must be sorry-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/AsymptoticTrianglePacking/NibbleRounding.lean b/LeanPool/AsymptoticTrianglePacking/NibbleRounding.lean index f0d03f7ffc..ead572f1d1 100644 --- a/LeanPool/AsymptoticTrianglePacking/NibbleRounding.lean +++ b/LeanPool/AsymptoticTrianglePacking/NibbleRounding.lean @@ -17,7 +17,7 @@ The full development remains internal so that the public API is limited to stabl statements. -/ -@[expose] public section +public section namespace LeanPool.AsymptoticTrianglePacking diff --git a/LeanPool/BannaiBannaiStanton.lean b/LeanPool/BannaiBannaiStanton.lean index c6dbbd4135..be21342a93 100644 --- a/LeanPool/BannaiBannaiStanton.lean +++ b/LeanPool/BannaiBannaiStanton.lean @@ -18,4 +18,4 @@ Tags: combinatorics, distance-sets, polynomial-method MSC: 52C10, 05B30 -/ -@[expose] public section +public section diff --git a/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean b/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean index 1556f8265f..12830264d8 100644 --- a/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean +++ b/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean @@ -20,7 +20,7 @@ set `S` in `ℝ^d` with `s` distinct distances by `Nat.choose (d + s) s`, follow the short proof of Petrov and Pohoata via the Croot-Lev-Pach lemma. -/ -@[expose] public section +public section open MvPolynomial diff --git a/LeanPool/Basic.lean b/LeanPool/Basic.lean index d8bb822417..b14154dda4 100644 --- a/LeanPool/Basic.lean +++ b/LeanPool/Basic.lean @@ -5,7 +5,7 @@ Authors: Vasily Ilin, Justin Asher -/ module -@[expose] public section +public section /-- Placeholder greeting string. -/ def hello := "world" diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/Basic.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/Basic.lean index a1fc11bf92..31d195ccba 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/Basic.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/Basic.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.BesicovitchPairCondition.Definitions This file develops the elementary set-distance API needed by the six-point transfer. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/Definitions.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/Definitions.lean index 84627f8a64..b2c26c2ad1 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/Definitions.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/Definitions.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.Statement This file defines straight measures and the pair condition in the Euclidean plane. -/ -@[expose] public section +public section noncomputable section @@ -23,14 +23,17 @@ open scoped ENNReal namespace LeanPool.Besicovitch /-- The extended distance between two sets; it is infinite when either set is empty. -/ +@[expose] def setEDist {X : Type*} [PseudoEMetricSpace X] (s t : Set X) : ℝ≥0∞ := ⨅ x ∈ s, ⨅ y ∈ t, edist x y /-- A measure is straight if every measurable set has mass at most its extended diameter. -/ +@[expose] def IsStraightMeasure (μ : Measure (EuclideanSpace ℝ (Fin 2))) : Prop := ∀ s, MeasurableSet s → μ s ≤ Metric.ediam s /-- The Besicovitch pair condition at density parameter `β`. -/ +@[expose] def BesicovitchPairCondition (β : ℝ) : Prop := ∀ μ : Measure (EuclideanSpace ℝ (Fin 2)), IsStraightMeasure μ → ∃ τ : ℝ, 0 < τ ∧ ∀ scale : ℝ, 0 < scale → diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/Extraction.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/Extraction.lean index 360b97be12..53bbc40c39 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/Extraction.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/Extraction.lean @@ -14,7 +14,7 @@ This file isolates the measure estimate that turns a dense root ball into two we points of the same set. The missing mass is charged to one common leakage set. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/PackingMeasure.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/PackingMeasure.lean index 27b1f28a01..07def34b0e 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/PackingMeasure.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/PackingMeasure.lean @@ -15,7 +15,7 @@ public import LeanPool.Besicovitch.SixPoint.Configuration This file bounds the mass of a finite two-color ball packing by its union and leakage. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/Parameters.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/Parameters.lean index 945321f661..c108632a87 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/Parameters.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/Parameters.lean @@ -14,7 +14,7 @@ The approximate-root ratio and the sibling-density parameter are chosen strictly finite endpoint and the target density. -/ -@[expose] public section +public section namespace LeanPool.Besicovitch diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/Rectifiability.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/Rectifiability.lean index 0883da1ab7..3cab9441eb 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/Rectifiability.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/Rectifiability.lean @@ -19,7 +19,7 @@ The Besicovitch pair condition rules out a positive straight purely unrectifiabl density is strictly above the pair-condition parameter. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/RootBalls.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/RootBalls.lean index 77c3240a39..678fcba795 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/RootBalls.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/RootBalls.lean @@ -13,12 +13,12 @@ public import LeanPool.Besicovitch.Statement The direct pair-condition transfer charges both child extractions to one union of root balls. -/ -@[expose] public section +public section namespace LeanPool.Besicovitch /-- The common open neighborhood formed by two balls of the same radius. -/ -def rootBallUnion (x y : (EuclideanSpace ℝ (Fin 2))) (r : ℝ) : +@[expose] def rootBallUnion (x y : (EuclideanSpace ℝ (Fin 2))) (r : ℝ) : Set (EuclideanSpace ℝ (Fin 2)) := Metric.ball x r ∪ Metric.ball y r diff --git a/LeanPool/Besicovitch/BesicovitchPairCondition/SixPointTransfer.lean b/LeanPool/Besicovitch/BesicovitchPairCondition/SixPointTransfer.lean index c10b5886e6..b453b0cfdb 100644 --- a/LeanPool/Besicovitch/BesicovitchPairCondition/SixPointTransfer.lean +++ b/LeanPool/Besicovitch/BesicovitchPairCondition/SixPointTransfer.lean @@ -20,7 +20,7 @@ public import LeanPool.Besicovitch.SixPoint.Scaling This file turns a finite two-color packing theorem into the Besicovitch pair condition. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Certificates/DensePolynomial.lean b/LeanPool/Besicovitch/Certificates/DensePolynomial.lean index 36887587cf..b9d45cc5d5 100644 --- a/LeanPool/Besicovitch/Certificates/DensePolynomial.lean +++ b/LeanPool/Besicovitch/Certificates/DensePolynomial.lean @@ -15,7 +15,7 @@ The outer list records increasing powers of `x`; each inner list records increas `y`. Transparent list arithmetic lets the kernel normalize small polynomial certificates. -/ -@[expose] public section +public section namespace LeanPool.Besicovitch @@ -25,21 +25,21 @@ abbrev DenseUnivariate := List ℚ namespace DenseUnivariate /-- Add coefficient lists, padding the shorter list by zeros. -/ -def add : DenseUnivariate → DenseUnivariate → DenseUnivariate +@[expose] def add : DenseUnivariate → DenseUnivariate → DenseUnivariate | [], q => q | p, [] => p | a :: p, b :: q => (a + b) :: add p q /-- Multiply every coefficient by a rational scalar. -/ -def scale (a : ℚ) (p : DenseUnivariate) : DenseUnivariate := +@[expose] def scale (a : ℚ) (p : DenseUnivariate) : DenseUnivariate := p.map (a * ·) /-- Negate every coefficient. -/ -def neg (p : DenseUnivariate) : DenseUnivariate := +@[expose] def neg (p : DenseUnivariate) : DenseUnivariate := p.map (-·) /-- Exact polynomial multiplication by coefficient convolution. -/ -def mul : DenseUnivariate → DenseUnivariate → DenseUnivariate +@[expose] def mul : DenseUnivariate → DenseUnivariate → DenseUnivariate | [], _ => [] | a :: p, q => add (scale a q) (0 :: mul p q) @@ -49,11 +49,11 @@ noncomputable def eval : DenseUnivariate → ℝ → ℝ | a :: p, x => a + x * eval p x /-- The sum of the absolute values of the coefficients. -/ -def coefficientL1Norm (p : DenseUnivariate) : ℚ := +@[expose] def coefficientL1Norm (p : DenseUnivariate) : ℚ := (p.map abs).sum /-- Formal differentiation, using `P = a + x Q` and `P' = Q + x Q'`. -/ -def deriv : DenseUnivariate → DenseUnivariate +@[expose] def deriv : DenseUnivariate → DenseUnivariate | [] => [] | _ :: p => add p (0 :: deriv p) @@ -138,39 +138,40 @@ abbrev DenseBivariatePolynomial := List DenseUnivariate namespace DenseBivariatePolynomial /-- Add two dense bivariate polynomials. -/ -def add : DenseBivariatePolynomial → DenseBivariatePolynomial → DenseBivariatePolynomial +@[expose] def add : DenseBivariatePolynomial → DenseBivariatePolynomial → DenseBivariatePolynomial | [], q => q | p, [] => p | a :: p, b :: q => DenseUnivariate.add a b :: add p q /-- Multiply by a rational scalar. -/ -def scale (a : ℚ) (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := +@[expose] def scale (a : ℚ) (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := p.map (DenseUnivariate.scale a) /-- Negate a dense bivariate polynomial. -/ -def neg (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := +@[expose] def neg (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := p.map DenseUnivariate.neg /-- Multiply each outer coefficient by a univariate polynomial. -/ +@[expose] def scaleRow (a : DenseUnivariate) (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := p.map (DenseUnivariate.mul a) /-- Exact bivariate polynomial multiplication. -/ -def mul : DenseBivariatePolynomial → DenseBivariatePolynomial → DenseBivariatePolynomial +@[expose] def mul : DenseBivariatePolynomial → DenseBivariatePolynomial → DenseBivariatePolynomial | [], _ => [] | a :: p, q => add (scaleRow a q) ([] :: mul p q) /-- A constant bivariate polynomial. -/ -def literal (a : ℚ) : DenseBivariatePolynomial := [[a]] +@[expose] def literal (a : ℚ) : DenseBivariatePolynomial := [[a]] /-- The first variable. -/ -def first : DenseBivariatePolynomial := [[0], [1]] +@[expose] def first : DenseBivariatePolynomial := [[0], [1]] /-- The second variable. -/ -def second : DenseBivariatePolynomial := [[0, 1]] +@[expose] def second : DenseBivariatePolynomial := [[0, 1]] /-- Natural powers of a dense bivariate polynomial. -/ -def pow (p : DenseBivariatePolynomial) : ℕ → DenseBivariatePolynomial +@[expose] def pow (p : DenseBivariatePolynomial) : ℕ → DenseBivariatePolynomial | 0 => literal 1 | n + 1 => mul (pow p n) p @@ -180,16 +181,16 @@ noncomputable def eval : DenseBivariatePolynomial → ℝ → ℝ → ℝ | a :: p, x, y => DenseUnivariate.eval a y + x * eval p x y /-- The sum of the absolute values of all coefficients. -/ -def coefficientL1Norm (p : DenseBivariatePolynomial) : ℚ := +@[expose] def coefficientL1Norm (p : DenseBivariatePolynomial) : ℚ := (p.map DenseUnivariate.coefficientL1Norm).sum /-- Formal differentiation with respect to the first variable. -/ -def derivFirst : DenseBivariatePolynomial → DenseBivariatePolynomial +@[expose] def derivFirst : DenseBivariatePolynomial → DenseBivariatePolynomial | [] => [] | _ :: p => add p ([] :: derivFirst p) /-- Formal differentiation with respect to the second variable. -/ -def derivSecond (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := +@[expose] def derivSecond (p : DenseBivariatePolynomial) : DenseBivariatePolynomial := p.map DenseUnivariate.deriv theorem coefficientL1Norm_nonneg (p : DenseBivariatePolynomial) : 0 ≤ coefficientL1Norm p := by diff --git a/LeanPool/Besicovitch/Certificates/EndpointBridge.lean b/LeanPool/Besicovitch/Certificates/EndpointBridge.lean index cec6dc30e7..d7b514784b 100644 --- a/LeanPool/Besicovitch/Certificates/EndpointBridge.lean +++ b/LeanPool/Besicovitch/Certificates/EndpointBridge.lean @@ -14,7 +14,7 @@ This file transfers the exact polynomial certificate to the natural radical endp identifies the constants defined from that endpoint. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Certificates/EndpointIsolation.lean b/LeanPool/Besicovitch/Certificates/EndpointIsolation.lean index e84820b86e..510b73cab2 100644 --- a/LeanPool/Besicovitch/Certificates/EndpointIsolation.lean +++ b/LeanPool/Besicovitch/Certificates/EndpointIsolation.lean @@ -16,7 +16,7 @@ This file encodes the two polynomial equations in centered coordinates. All numb preconditioner are rational, and the coefficient-norm estimates are checked by the kernel. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Certificates/Krawczyk.lean b/LeanPool/Besicovitch/Certificates/Krawczyk.lean index 9730002783..b9abe42504 100644 --- a/LeanPool/Besicovitch/Certificates/Krawczyk.lean +++ b/LeanPool/Besicovitch/Certificates/Krawczyk.lean @@ -16,7 +16,7 @@ which preserves a complete nonempty set has a unique fixed point there. If the c preconditioned Newton map, that fixed point is the unique zero in the set. -/ -@[expose] public section +public section open Function NNReal Set diff --git a/LeanPool/Besicovitch/Certificates/RadicalInterval.lean b/LeanPool/Besicovitch/Certificates/RadicalInterval.lean index f9214dd7c0..f7538f99dd 100644 --- a/LeanPool/Besicovitch/Certificates/RadicalInterval.lean +++ b/LeanPool/Besicovitch/Certificates/RadicalInterval.lean @@ -15,7 +15,7 @@ A square-root node carries rational lower and upper witnesses. The evaluator che squares exactly, so every successful enclosure has a kernel-checked real-number semantics. -/ -@[expose] public section +public section open Set @@ -34,7 +34,7 @@ inductive RadicalExpression (n : ℕ) where namespace RadicalExpression /-- Evaluate a radical expression in a real environment. -/ -noncomputable def eval {n : ℕ} : RadicalExpression n → (Fin n → ℝ) → ℝ +@[expose] noncomputable def eval {n : ℕ} : RadicalExpression n → (Fin n → ℝ) → ℝ | .var i, x => x i | .literal q, _ => q | .add f g, x => f.eval x + g.eval x @@ -44,7 +44,7 @@ noncomputable def eval {n : ℕ} : RadicalExpression n → (Fin n → ℝ) → | .sqrt f _ _, x => Real.sqrt (f.eval x) /-- Evaluate by exact rational intervals, rejecting unsafe inverses or square-root witnesses. -/ -def enclosure {n : ℕ} : RadicalExpression n → (Fin n → RationalInterval) → +@[expose] def enclosure {n : ℕ} : RadicalExpression n → (Fin n → RationalInterval) → Option RationalInterval | .var i, X => some (X i) | .literal q, _ => some (.singleton q) @@ -76,7 +76,7 @@ def enclosureWithin {n : ℕ} (f : RadicalExpression n) (X : Fin n → RationalI if target.lower ≤ I.lower ∧ I.upper ≤ target.upper then some target else none /-- Decide whether the computed enclosure lies in a given rational target interval. -/ -def certifiesWithin {n : ℕ} (f : RadicalExpression n) (X : Fin n → RationalInterval) +@[expose] def certifiesWithin {n : ℕ} (f : RadicalExpression n) (X : Fin n → RationalInterval) (target : RationalInterval) : Bool := match f.enclosure X with | none => false diff --git a/LeanPool/Besicovitch/Certificates/RationalInterval.lean b/LeanPool/Besicovitch/Certificates/RationalInterval.lean index 3ed6303357..565e3ea247 100644 --- a/LeanPool/Besicovitch/Certificates/RationalInterval.lean +++ b/LeanPool/Besicovitch/Certificates/RationalInterval.lean @@ -17,7 +17,7 @@ numbers. The operations provide the enclosure primitives used by the radical-exp with soundness checked by the kernel. -/ -@[expose] public section +public section open Set @@ -34,23 +34,24 @@ structure RationalInterval where namespace RationalInterval /-- A real number belongs to a rational interval. -/ +@[expose] def Contains (I : RationalInterval) (x : ℝ) : Prop := (I.lower : ℝ) ≤ x ∧ x ≤ (I.upper : ℝ) /-- The degenerate interval containing one rational number. -/ -def singleton (q : ℚ) : RationalInterval := +@[expose] def singleton (q : ℚ) : RationalInterval := ⟨q, q, le_rfl⟩ /-- The interval sum. -/ -def add (I J : RationalInterval) : RationalInterval := +@[expose] def add (I J : RationalInterval) : RationalInterval := ⟨I.lower + J.lower, I.upper + J.upper, add_le_add I.lower_le_upper J.lower_le_upper⟩ /-- The additive inverse of an interval. -/ -def neg (I : RationalInterval) : RationalInterval := +@[expose] def neg (I : RationalInterval) : RationalInterval := ⟨-I.upper, -I.lower, neg_le_neg I.lower_le_upper⟩ /-- The smallest interval whose endpoints include all four endpoint products. -/ -def mul (I J : RationalInterval) : RationalInterval where +@[expose] def mul (I J : RationalInterval) : RationalInterval where lower := min (min (I.lower * J.lower) (I.lower * J.upper)) (min (I.upper * J.lower) (I.upper * J.upper)) upper := max (max (I.lower * J.lower) (I.lower * J.upper)) @@ -65,7 +66,7 @@ def pow (I : RationalInterval) : ℕ → RationalInterval | n + 1 => (pow I n).mul I /-- An interval which avoids zero has a well-defined reciprocal interval. -/ -def inv (I : RationalInterval) (h : 0 < I.lower ∨ I.upper < 0) : RationalInterval where +@[expose] def inv (I : RationalInterval) (h : 0 < I.lower ∨ I.upper < 0) : RationalInterval where lower := 1 / I.upper upper := 1 / I.lower lower_le_upper := by diff --git a/LeanPool/Besicovitch/Example/Avoid.lean b/LeanPool/Besicovitch/Example/Avoid.lean index fa7215fbc6..40104db8b5 100644 --- a/LeanPool/Besicovitch/Example/Avoid.lean +++ b/LeanPool/Besicovitch/Example/Avoid.lean @@ -20,7 +20,7 @@ point. Its intersection with any cell of level `m ≥ n` is order-connected, be level-`n` grid point is a level-`m` grid point and hence lies outside the interior of that cell. -/ -@[expose] public section +public section noncomputable section @@ -30,13 +30,13 @@ open scoped NNReal namespace LeanPool.Besicovitch.Example /-- Half the width of the strip around a level-`n` grid point that `A` cannot straddle. -/ -def margin (L : ℝ) (n : ℕ) : ℝ := cellLength n / (2 * n * (L + 1)) +@[expose] def margin (L : ℝ) (n : ℕ) : ℝ := cellLength n / (2 * n * (L + 1)) /-- The level-`n` grid point with index `i`. -/ -def gridPoint (n : ℕ) (i : ℤ) : ℝ := i * cellLength n +@[expose] def gridPoint (n : ℕ) (i : ℤ) : ℝ := i * cellLength n /-- Points at distance at least `margin L n` from every level-`n` grid point. -/ -def avoid (L : ℝ) (n : ℕ) : Set ℝ := {x | ∀ i : ℤ, margin L n ≤ |x - gridPoint n i|} +@[expose] def avoid (L : ℝ) (n : ℕ) : Set ℝ := {x | ∀ i : ℤ, margin L n ≤ |x - gridPoint n i|} theorem margin_pos {L : ℝ} (hL : 0 ≤ L) {n : ℕ} (hn : 1 ≤ n) : 0 < margin L n := by unfold margin diff --git a/LeanPool/Besicovitch/Example/Cover.lean b/LeanPool/Besicovitch/Example/Cover.lean index e0cc5b37c2..99fb085a2c 100644 --- a/LeanPool/Besicovitch/Example/Cover.lean +++ b/LeanPool/Besicovitch/Example/Cover.lean @@ -16,7 +16,7 @@ The graph over `[a, b)` is covered, at level `n`, by the graphs over the level-` The constant `2` is crude but is all that is needed: the sharp value `1` is never used. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/Density.lean b/LeanPool/Besicovitch/Example/Density.lean index ab62788ae0..e07e5c02e4 100644 --- a/LeanPool/Besicovitch/Example/Density.lean +++ b/LeanPool/Besicovitch/Example/Density.lean @@ -24,7 +24,7 @@ Hence almost every point of `A` eventually avoids the grid on *both* sides, and recursion of `LeanPool.Besicovitch.Example.Zero` applies to the resulting sets. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/Graph.lean b/LeanPool/Besicovitch/Example/Graph.lean index ba747d9364..b9837e4953 100644 --- a/LeanPool/Besicovitch/Example/Graph.lean +++ b/LeanPool/Besicovitch/Example/Graph.lean @@ -22,7 +22,7 @@ The construction follows Capdevila, *Besicovitch's example in higher dimensions* arXiv:2607.05206, §2, which in turn follows Besicovitch (1938) and Dickinson (1939). -/ -@[expose] public section +public section noncomputable section @@ -31,19 +31,22 @@ open Finset namespace LeanPool.Besicovitch.Example /-- The length `2^(-n²)` of a level-`n` cell. -/ -def cellLength (n : ℕ) : ℝ := (1 / 2) ^ (n ^ 2) +@[expose] def cellLength (n : ℕ) : ℝ := (1 / 2) ^ (n ^ 2) /-- The amplitude `2^(-n²) / n` of the level-`n` square wave. -/ def jumpHeight (n : ℕ) : ℝ := cellLength n / n /-- The index of the level-`n` cell `[i * cellLength n, (i + 1) * cellLength n)` containing `x`. -/ +@[expose] def cellIndex (n : ℕ) (x : ℝ) : ℤ := ⌊x / cellLength n⌋ /-- The level-`n` square wave: `-jumpHeight n` on even cells, `+jumpHeight n` on odd cells. -/ +@[expose] def squareWave (n : ℕ) (x : ℝ) : ℝ := if Even (cellIndex n x) then -jumpHeight n else jumpHeight n /-- Besicovitch's function, the sum of the square waves of every level `n ≥ 1`. -/ +@[expose] def besicovitchFun (x : ℝ) : ℝ := ∑' n : ℕ, squareWave (n + 1) x /-! ### The cell lengths -/ diff --git a/LeanPool/Besicovitch/Example/Hull.lean b/LeanPool/Besicovitch/Example/Hull.lean index 091814a3c1..dd8e567464 100644 --- a/LeanPool/Besicovitch/Example/Hull.lean +++ b/LeanPool/Besicovitch/Example/Hull.lean @@ -18,7 +18,7 @@ then gives `μH[1] (graphMap '' A) ≤ 2 * volume A` for every `A ⊆ ℝ`; in p graph over a Lebesgue-null set is `μH[1]`-null. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/LowerBound.lean b/LeanPool/Besicovitch/Example/LowerBound.lean index 2503d74a06..8a99b65d31 100644 --- a/LeanPool/Besicovitch/Example/LowerBound.lean +++ b/LeanPool/Besicovitch/Example/LowerBound.lean @@ -25,7 +25,7 @@ impossible (`LeanPool.Besicovitch.Example.Zero`). On the other hand its lower o So no threshold below `1/2` forces one-rectifiability in the plane, and `sigmaOne ℝ² ≥ 1/2`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/LowerDensity.lean b/LeanPool/Besicovitch/Example/LowerDensity.lean index b5c98ddc3a..4b75ae81ba 100644 --- a/LeanPool/Besicovitch/Example/LowerDensity.lean +++ b/LeanPool/Besicovitch/Example/LowerDensity.lean @@ -20,7 +20,7 @@ graph over that interval is at least `θ * r`, so the lower density (normalised `2 * r` of the ball) is at least `θ / 2`. Letting `θ → 1` gives `1/2`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/Measurable.lean b/LeanPool/Besicovitch/Example/Measurable.lean index f22ed6abc0..fadcb40a15 100644 --- a/LeanPool/Besicovitch/Example/Measurable.lean +++ b/LeanPool/Besicovitch/Example/Measurable.lean @@ -17,7 +17,7 @@ Each square wave is a step function, hence measurable, and `g` is a pointwise li sums of them. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/Plane.lean b/LeanPool/Besicovitch/Example/Plane.lean index 714c409527..f817e06223 100644 --- a/LeanPool/Besicovitch/Example/Plane.lean +++ b/LeanPool/Besicovitch/Example/Plane.lean @@ -21,7 +21,7 @@ of a piece of the graph is at least the Lebesgue measure of its base), and the g level-`n` cell has diameter at most twice the cell length. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ abbrev Plane := EuclideanSpace ℝ (Fin 2) def graphMap (x : ℝ) : Plane := !₂[x, besicovitchFun x] /-- Besicovitch's set: the graph of `g` over `[0, 1]`. -/ -def besicovitchSet : Set Plane := graphMap '' Icc 0 1 +@[expose] def besicovitchSet : Set Plane := graphMap '' Icc 0 1 @[simp] theorem graphMap_apply_zero (x : ℝ) : graphMap x 0 = x := by simp [graphMap] @@ -79,7 +79,7 @@ theorem volume_le_hausdorffMeasure_graphMap_image (A : Set ℝ) : /-! ### Cells -/ /-- The level-`n` cell with index `i`. -/ -def cell (n : ℕ) (i : ℤ) : Set ℝ := Ico (i * cellLength n) ((i + 1) * cellLength n) +@[expose] def cell (n : ℕ) (i : ℤ) : Set ℝ := Ico (i * cellLength n) ((i + 1) * cellLength n) theorem mem_cell_iff {n : ℕ} {i : ℤ} {x : ℝ} : x ∈ cell n i ↔ cellIndex n x = i := by have hpos := cellLength_pos n diff --git a/LeanPool/Besicovitch/Example/Recursion.lean b/LeanPool/Besicovitch/Example/Recursion.lean index d140ff2ca3..0be6c076e3 100644 --- a/LeanPool/Besicovitch/Example/Recursion.lean +++ b/LeanPool/Besicovitch/Example/Recursion.lean @@ -18,7 +18,7 @@ survives the level-`n` holes contracts by a factor `1 - c/n` at each level, up t error, and `∑ 1/n = ∞`. -/ -@[expose] public section +public section open Filter Finset Topology diff --git a/LeanPool/Besicovitch/Example/Reduction.lean b/LeanPool/Besicovitch/Example/Reduction.lean index 7cfad91cac..ecea1fe237 100644 --- a/LeanPool/Besicovitch/Example/Reduction.lean +++ b/LeanPool/Besicovitch/Example/Reduction.lean @@ -29,7 +29,7 @@ is Lipschitz in `t` and `t` is Lipschitz in `f₁ t`; and `A` has positive Lebes the graph over `A` contains `f '' P`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Example/Zero.lean b/LeanPool/Besicovitch/Example/Zero.lean index d6d43fe761..b76d1d1840 100644 --- a/LeanPool/Besicovitch/Example/Zero.lean +++ b/LeanPool/Besicovitch/Example/Zero.lean @@ -24,7 +24,7 @@ Combined with `ae_eventually_mem_avoid`, every subset of `[0, 1]` on which `g` i Lebesgue-null. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Geometry/BallUnion.lean b/LeanPool/Besicovitch/Geometry/BallUnion.lean index cd72fee389..407217b0d2 100644 --- a/LeanPool/Besicovitch/Geometry/BallUnion.lean +++ b/LeanPool/Besicovitch/Geometry/BallUnion.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric This file collects the finite-ball estimates used in the packing-to-measure transfer. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ namespace LeanPool.Besicovitch variable {X ι : Type*} [PseudoMetricSpace X] /-- The union of open balls indexed by a finite support. -/ -def finiteBallUnion (support : Finset ι) (center : support → X) (radius : support → ℝ) : +@[expose] def finiteBallUnion (support : Finset ι) (center : support → X) (radius : support → ℝ) : Set X := ⋃ i : support, Metric.ball (center i) (radius i) diff --git a/LeanPool/Besicovitch/Geometry/ConvexEnlargement.lean b/LeanPool/Besicovitch/Geometry/ConvexEnlargement.lean index 3dd156cf46..72bd6329e1 100644 --- a/LeanPool/Besicovitch/Geometry/ConvexEnlargement.lean +++ b/LeanPool/Besicovitch/Geometry/ConvexEnlargement.lean @@ -16,7 +16,7 @@ This file records the two elementary enlargements used in the continuum argument set by a multiple of its diameter, and replacing an open set by its open convex hull. -/ -@[expose] public section +public section noncomputable section @@ -25,6 +25,7 @@ open Bornology Set namespace LeanPool.Besicovitch /-- The `p`-diameter thickening of a set. -/ +@[expose] def diameterThickening (p : ℝ) (s : Set (EuclideanSpace ℝ (Fin 2))) : Set (EuclideanSpace ℝ (Fin 2)) := Metric.thickening (p * Metric.diam s) s @@ -72,6 +73,7 @@ theorem subset_diameterThickening_of_inter_nonempty exact ⟨y, hys, (Metric.dist_le_diam_of_mem hu hxu hyu).trans_lt hdiam⟩ /-- The interior of the convex hull of a set. -/ +@[expose] def openConvexHull (s : Set (EuclideanSpace ℝ (Fin 2))) : Set (EuclideanSpace ℝ (Fin 2)) := interior (convexHull ℝ s) diff --git a/LeanPool/Besicovitch/Main/Bound.lean b/LeanPool/Besicovitch/Main/Bound.lean index 9166abae99..5404c368d2 100644 --- a/LeanPool/Besicovitch/Main/Bound.lean +++ b/LeanPool/Besicovitch/Main/Bound.lean @@ -17,7 +17,7 @@ This file contains the analytic bridge from the finite six-point property to the the planar rectifiability threshold. The finite property itself remains the sole geometric input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Main/RationalBound.lean b/LeanPool/Besicovitch/Main/RationalBound.lean index 48ba4635f8..c625ff8deb 100644 --- a/LeanPool/Besicovitch/Main/RationalBound.lean +++ b/LeanPool/Besicovitch/Main/RationalBound.lean @@ -16,7 +16,7 @@ failure tree turns that into the six-point finite property at `barS = 6934/10000 six-point transfer turns that into the planar rectifiability bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Measure/CompactExhaustion.lean b/LeanPool/Besicovitch/Measure/CompactExhaustion.lean index 6147c9dfae..95138242e1 100644 --- a/LeanPool/Besicovitch/Measure/CompactExhaustion.lean +++ b/LeanPool/Besicovitch/Measure/CompactExhaustion.lean @@ -14,7 +14,7 @@ An increasing measurable exhaustion which covers a finite-measure set almost eve a compact core with arbitrarily small discarded mass. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Measure/DensityBasic.lean b/LeanPool/Besicovitch/Measure/DensityBasic.lean index 6a81fcda8a..2f380d8c29 100644 --- a/LeanPool/Besicovitch/Measure/DensityBasic.lean +++ b/LeanPool/Besicovitch/Measure/DensityBasic.lean @@ -15,7 +15,7 @@ Strictly exceeding a lower-density level gives the corresponding ball-mass estim sufficiently small positive radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Measure/DensityLocalization.lean b/LeanPool/Besicovitch/Measure/DensityLocalization.lean index e546879853..9da9919278 100644 --- a/LeanPool/Besicovitch/Measure/DensityLocalization.lean +++ b/LeanPool/Besicovitch/Measure/DensityLocalization.lean @@ -17,7 +17,7 @@ relative to the restricted measure. Straightness turns this relative differenti into preservation of every strictly smaller lower-density bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Measure/UniformDensity.lean b/LeanPool/Besicovitch/Measure/UniformDensity.lean index b9a923a71a..32a9af80c8 100644 --- a/LeanPool/Besicovitch/Measure/UniformDensity.lean +++ b/LeanPool/Besicovitch/Measure/UniformDensity.lean @@ -15,7 +15,7 @@ The set `uniformDensitySet μ A γ m` consists of the points of `A` where the lo bound at level `γ` holds at every positive rational radius below `1 / (m + 1)`. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ theorem measurable_measure_ball (mu : Measure (EuclideanSpace ℝ (Fin 2))) [SFi rw [dist_comm] /-- Points with a uniform rational-radius lower mass bound. -/ -def uniformDensitySet (mu : Measure (EuclideanSpace ℝ (Fin 2))) +@[expose] def uniformDensitySet (mu : Measure (EuclideanSpace ℝ (Fin 2))) (A : Set (EuclideanSpace ℝ (Fin 2))) (γ : ℝ) (m : ℕ) : Set (EuclideanSpace ℝ (Fin 2)) := {x ∈ A | ∀ q : ℚ, 0 < (q : ℝ) → (q : ℝ) < 1 / (m + 1 : ℝ) → diff --git a/LeanPool/Besicovitch/Measure/UniformDensityCompact.lean b/LeanPool/Besicovitch/Measure/UniformDensityCompact.lean index 041361ad5f..9755d3e9ca 100644 --- a/LeanPool/Besicovitch/Measure/UniformDensityCompact.lean +++ b/LeanPool/Besicovitch/Measure/UniformDensityCompact.lean @@ -15,7 +15,7 @@ An almost-everywhere strict lower-density bound can be made uniform on a compact while losing arbitrarily little Hausdorff measure. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/AttachmentLocalization.lean b/LeanPool/Besicovitch/Rectifiability/AttachmentLocalization.lean index d8fd929cc8..28133f2f79 100644 --- a/LeanPool/Besicovitch/Rectifiability/AttachmentLocalization.lean +++ b/LeanPool/Besicovitch/Rectifiability/AttachmentLocalization.lean @@ -16,7 +16,7 @@ point also lies in a local set `C`, the attachment's three-diameter enlargement holes recorded as touching `C`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/BadConvexLocalization.lean b/LeanPool/Besicovitch/Rectifiability/BadConvexLocalization.lean index 99fcc4ee1f..90539bff5e 100644 --- a/LeanPool/Besicovitch/Rectifiability/BadConvexLocalization.lean +++ b/LeanPool/Besicovitch/Rectifiability/BadConvexLocalization.lean @@ -14,7 +14,7 @@ A selected bad set whose three-diameter enlargement meets a small continuum must the doubled ball, provided the centre was chosen outside its seven-diameter enlargement. -/ -@[expose] public section +public section noncomputable section @@ -23,7 +23,7 @@ open Bornology Set namespace LeanPool.Besicovitch /-- Selected holes whose `p`-diameter enlargements meet a set. -/ -def touchingBadConvexSets (p : ℝ) +@[expose] def touchingBadConvexSets (p : ℝ) (chosen : Set (Set (EuclideanSpace ℝ (Fin 2)))) (C : Set (EuclideanSpace ℝ (Fin 2))) : Set (Set (EuclideanSpace ℝ (Fin 2))) := diff --git a/LeanPool/Besicovitch/Rectifiability/BadConvexPacking.lean b/LeanPool/Besicovitch/Rectifiability/BadConvexPacking.lean index a4a7d92724..c6d987cc6c 100644 --- a/LeanPool/Besicovitch/Rectifiability/BadConvexPacking.lean +++ b/LeanPool/Besicovitch/Rectifiability/BadConvexPacking.lean @@ -14,7 +14,7 @@ For a disjoint countable family of bad convex sets, the sum of their diameters i the mass outside the compact core. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/BadConvexSets.lean b/LeanPool/Besicovitch/Rectifiability/BadConvexSets.lean index 0197268048..a2b26189f7 100644 --- a/LeanPool/Besicovitch/Rectifiability/BadConvexSets.lean +++ b/LeanPool/Besicovitch/Rectifiability/BadConvexSets.lean @@ -16,7 +16,7 @@ A bad convex set meets the compact density core but contains disproportionately outside it. These are the holes used in the continuum construction. -/ -@[expose] public section +public section noncomputable section @@ -26,6 +26,7 @@ open scoped ENNReal MeasureTheory namespace LeanPool.Besicovitch /-- Open convex sets meeting `F` whose mass outside `F` exceeds `alpha` times their diameter. -/ +@[expose] def badConvexSets (mu : Measure (EuclideanSpace ℝ (Fin 2))) (F : Set (EuclideanSpace ℝ (Fin 2))) (alpha : ℝ) : Set (Set (EuclideanSpace ℝ (Fin 2))) := diff --git a/LeanPool/Besicovitch/Rectifiability/BadConvexThickening.lean b/LeanPool/Besicovitch/Rectifiability/BadConvexThickening.lean index 04b7a6172a..0cb1979cba 100644 --- a/LeanPool/Besicovitch/Rectifiability/BadConvexThickening.lean +++ b/LeanPool/Besicovitch/Rectifiability/BadConvexThickening.lean @@ -15,7 +15,7 @@ the compact core uncovered. The number `15 = 2 * 7 + 1` is exactly the diameter factor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/Basic.lean b/LeanPool/Besicovitch/Rectifiability/Basic.lean index 137710e980..d372e8edd6 100644 --- a/LeanPool/Besicovitch/Rectifiability/Basic.lean +++ b/LeanPool/Besicovitch/Rectifiability/Basic.lean @@ -14,7 +14,7 @@ public import Mathlib.Data.Nat.Pairing Countable one-rectifiability is inherited by subsets and countable unions. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ namespace LeanPool.Besicovitch variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] /-- A set is purely one-unrectifiable if it meets every rectifiable set in a null set. -/ -def IsPurelyOneUnrectifiable (s : Set X) : Prop := +@[expose] def IsPurelyOneUnrectifiable (s : Set X) : Prop := ∀ t, IsCountablyOneRectifiable t → μH[1] (s ∩ t) = 0 /-- A subset of a countably one-rectifiable set is countably one-rectifiable. -/ diff --git a/LeanPool/Besicovitch/Rectifiability/CompactAttachmentUnion.lean b/LeanPool/Besicovitch/Rectifiability/CompactAttachmentUnion.lean index a3dcd13718..d6d6f23d1d 100644 --- a/LeanPool/Besicovitch/Rectifiability/CompactAttachmentUnion.lean +++ b/LeanPool/Besicovitch/Rectifiability/CompactAttachmentUnion.lean @@ -15,7 +15,7 @@ If the selected holes have finite total diameter, their compact attachments accu the compact core. Consequently the core together with all attachments is compact. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ open scoped ENNReal Topology namespace LeanPool.Besicovitch /-- The compact core together with all convex pieces attached along selected holes. -/ -def compactAttachmentUnion (F : Set (EuclideanSpace ℝ (Fin 2))) +@[expose] def compactAttachmentUnion (F : Set (EuclideanSpace ℝ (Fin 2))) (chosen : Set (Set (EuclideanSpace ℝ (Fin 2)))) : Set (EuclideanSpace ℝ (Fin 2)) := F ∪ ⋃ V : chosen, convexAttachment F (V : Set (EuclideanSpace ℝ (Fin 2))) diff --git a/LeanPool/Besicovitch/Rectifiability/ComponentDiameter.lean b/LeanPool/Besicovitch/Rectifiability/ComponentDiameter.lean index 3df06d7f2b..50f1af9e83 100644 --- a/LeanPool/Besicovitch/Rectifiability/ComponentDiameter.lean +++ b/LeanPool/Besicovitch/Rectifiability/ComponentDiameter.lean @@ -19,7 +19,7 @@ the small inner ball. Any hypothetical clopen separation would be crossed by on attachment. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open scoped ENNReal MeasureTheory Topology namespace LeanPool.Besicovitch /-- The connected component through `z` in the attachment union localized to a closed ball. -/ -def localAttachmentComponent (F : Set (EuclideanSpace ℝ (Fin 2))) +@[expose] def localAttachmentComponent (F : Set (EuclideanSpace ℝ (Fin 2))) (chosen : Set (Set (EuclideanSpace ℝ (Fin 2)))) (z : (EuclideanSpace ℝ (Fin 2))) (rho : ℝ) : Set (EuclideanSpace ℝ (Fin 2)) := connectedComponentIn diff --git a/LeanPool/Besicovitch/Rectifiability/Continuum.lean b/LeanPool/Besicovitch/Rectifiability/Continuum.lean index e1fc82bad7..b99ba2581a 100644 --- a/LeanPool/Besicovitch/Rectifiability/Continuum.lean +++ b/LeanPool/Besicovitch/Rectifiability/Continuum.lean @@ -14,7 +14,7 @@ public import Mathlib.Topology.Order.IntermediateValue A preconnected set has one-dimensional Hausdorff measure at least its extended diameter. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/ContinuumSurgery.lean b/LeanPool/Besicovitch/Rectifiability/ContinuumSurgery.lean index 4ba0251e24..b1cc624279 100644 --- a/LeanPool/Besicovitch/Rectifiability/ContinuumSurgery.lean +++ b/LeanPool/Besicovitch/Rectifiability/ContinuumSurgery.lean @@ -19,7 +19,7 @@ import Mathlib.Analysis.Convex.Caratheodory This file develops the continuum-surgery argument for countably many open convex holes. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/ConvexAttachment.lean b/LeanPool/Besicovitch/Rectifiability/ConvexAttachment.lean index 17dcd475f4..6e13e2d277 100644 --- a/LeanPool/Besicovitch/Rectifiability/ConvexAttachment.lean +++ b/LeanPool/Besicovitch/Rectifiability/ConvexAttachment.lean @@ -15,7 +15,7 @@ For each selected hole, the continuum construction attaches the closed convex hu points in its two-diameter enlargement. -/ -@[expose] public section +public section noncomputable section @@ -24,6 +24,7 @@ open Bornology Set namespace LeanPool.Besicovitch /-- The compact convex piece attached to the core near a selected hole. -/ +@[expose] def convexAttachment (F V : Set (EuclideanSpace ℝ (Fin 2))) : Set (EuclideanSpace ℝ (Fin 2)) := closure (convexHull ℝ (F ∩ diameterThickening 2 V)) diff --git a/LeanPool/Besicovitch/Rectifiability/Decomposition.lean b/LeanPool/Besicovitch/Rectifiability/Decomposition.lean index eca3cf2a88..4f22976a8c 100644 --- a/LeanPool/Besicovitch/Rectifiability/Decomposition.lean +++ b/LeanPool/Besicovitch/Rectifiability/Decomposition.lean @@ -17,7 +17,7 @@ one-unrectifiable remainder. The proof maximizes the measure captured by counta Lipschitz curves; it does not assume a decomposition theorem from outside Mathlib. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/DensityPoint.lean b/LeanPool/Besicovitch/Rectifiability/DensityPoint.lean index 48fedabf58..2c562797a7 100644 --- a/LeanPool/Besicovitch/Rectifiability/DensityPoint.lean +++ b/LeanPool/Besicovitch/Rectifiability/DensityPoint.lean @@ -15,7 +15,7 @@ Lebesgue differentiation lets us choose the point outside the seven-diameter enl the mass missing from the compact core is linearly small in every sufficiently small ball. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/FiniteContinuum.lean b/LeanPool/Besicovitch/Rectifiability/FiniteContinuum.lean index 88ad7282c7..ba7315a2a5 100644 --- a/LeanPool/Besicovitch/Rectifiability/FiniteContinuum.lean +++ b/LeanPool/Besicovitch/Rectifiability/FiniteContinuum.lean @@ -20,7 +20,7 @@ Compact connected subsets of the Euclidean plane with finite Hausdorff one-measu Lipschitz parametrization. This is the Eilenberg--Harrold finite-length continuum theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/HoleMerging.lean b/LeanPool/Besicovitch/Rectifiability/HoleMerging.lean index 0c8b86b437..cda0a90a43 100644 --- a/LeanPool/Besicovitch/Rectifiability/HoleMerging.lean +++ b/LeanPool/Besicovitch/Rectifiability/HoleMerging.lean @@ -21,7 +21,7 @@ hulls can acquire new intersections. We instead repeatedly merge intersecting c each finite stage and then take the increasing union of every eventual cluster. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/Selection.lean b/LeanPool/Besicovitch/Rectifiability/Selection.lean index 0acee21dc7..0bcd5fe667 100644 --- a/LeanPool/Besicovitch/Rectifiability/Selection.lean +++ b/LeanPool/Besicovitch/Rectifiability/Selection.lean @@ -16,7 +16,7 @@ This file extracts a countable disjoint subfamily of uniformly bounded open sets set meets a selected set whose diameter is more than half as large. -/ -@[expose] public section +public section open Bornology Set diff --git a/LeanPool/Besicovitch/Rectifiability/Straight.lean b/LeanPool/Besicovitch/Rectifiability/Straight.lean index b2e1075287..dd94e4442b 100644 --- a/LeanPool/Besicovitch/Rectifiability/Straight.lean +++ b/LeanPool/Besicovitch/Rectifiability/Straight.lean @@ -19,7 +19,7 @@ This file proves the positive-piece form of Delaware's straight-set theorem for one-measure in the Euclidean plane. It also records the elementary restriction API used later. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Rectifiability/StraightReduction.lean b/LeanPool/Besicovitch/Rectifiability/StraightReduction.lean index 53ba039803..e840fae937 100644 --- a/LeanPool/Besicovitch/Rectifiability/StraightReduction.lean +++ b/LeanPool/Besicovitch/Rectifiability/StraightReduction.lean @@ -15,7 +15,7 @@ A hypothetical nonrectifiable finite set has a positive purely unrectifiable par piece of that part retains every strictly smaller lower-density threshold almost everywhere. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/Sigma/Basic.lean b/LeanPool/Besicovitch/Sigma/Basic.lean index a20bb954da..36ebe9d898 100644 --- a/LeanPool/Besicovitch/Sigma/Basic.lean +++ b/LeanPool/Besicovitch/Sigma/Basic.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.Statement The forcing property is monotone in its density threshold. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/AlgebraicBasic.lean b/LeanPool/Besicovitch/SixPoint/AlgebraicBasic.lean index f2ea221291..56196e2752 100644 --- a/LeanPool/Besicovitch/SixPoint/AlgebraicBasic.lean +++ b/LeanPool/Besicovitch/SixPoint/AlgebraicBasic.lean @@ -15,14 +15,14 @@ order-theoretic consequences of defining `cStar` as an infimum. The strict lower bound for `sStar` requires uniqueness of the isolated first coordinate. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- The polynomial residual obtained by squaring the endpoint balance equation. -/ -def endpointBalanceResidual (c B : ℝ) : ℝ := +@[expose] def endpointBalanceResidual (c B : ℝ) : ℝ := let D := 4 * c ^ 2 - 2 * c - B let b := (2 * B - 3 * c ^ 2 + 2 * c - 1) / (c + 1) let A2 := (B ^ 2 - 1) / 2 @@ -31,7 +31,7 @@ def endpointBalanceResidual (c B : ℝ) : ℝ := (R ^ 2 - A2 - C2) ^ 2 - 4 * A2 * C2 /-- The residual of the endpoint Gram equation. -/ -def endpointGramResidual (c B : ℝ) : ℝ := +@[expose] def endpointGramResidual (c B : ℝ) : ℝ := let D := 4 * c ^ 2 - 2 * c - B let b := (2 * B - 3 * c ^ 2 + 2 * c - 1) / (c + 1) let x := (5 - B ^ 2) / 4 @@ -40,7 +40,7 @@ def endpointGramResidual (c B : ℝ) : ℝ := (k - x * z) ^ 2 - (1 - x ^ 2) * (b ^ 2 - z ^ 2) /-- The signed polynomial system used to isolate the exact endpoint pair. -/ -def IsEndpointPolynomialPair (c B : ℝ) : Prop := +@[expose] def IsEndpointPolynomialPair (c B : ℝ) : Prop := let D := 4 * c ^ 2 - 2 * c - B let b := (2 * B - 3 * c ^ 2 + 2 * c - 1) / (c + 1) let A2 := (B ^ 2 - 1) / 2 diff --git a/LeanPool/Besicovitch/SixPoint/BlueChildSwap.lean b/LeanPool/Besicovitch/SixPoint/BlueChildSwap.lean index 6875f41d3c..baf52a9df1 100644 --- a/LeanPool/Besicovitch/SixPoint/BlueChildSwap.lean +++ b/LeanPool/Besicovitch/SixPoint/BlueChildSwap.lean @@ -17,7 +17,7 @@ The four-child minimax has two matching branches. Swapping only the blue childre anti-diagonal branch with the diagonal one and preserves admissibility and every packing score. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/CanonicalTriangle.lean b/LeanPool/Besicovitch/SixPoint/CanonicalTriangle.lean index 79986d0838..aecc0c24a2 100644 --- a/LeanPool/Besicovitch/SixPoint/CanonicalTriangle.lean +++ b/LeanPool/Besicovitch/SixPoint/CanonicalTriangle.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.SixPoint.Configuration The three radii are the half-perimeter differences, indexed by the six-point labels. -/ -@[expose] public section +public section noncomputable section @@ -22,6 +22,7 @@ namespace LeanPool.Besicovitch variable {X : Type*} [PseudoMetricSpace X] /-- The canonical mutually tangent radii attached to a labelled triangle. -/ +@[expose] def canonicalTriangleRadius (root left right : X) : SixPointLabel → ℝ | .root => (dist root left + dist root right - dist left right) / 2 | .left => (dist root left + dist left right - dist root right) / 2 diff --git a/LeanPool/Besicovitch/SixPoint/ChildSwapPacking.lean b/LeanPool/Besicovitch/SixPoint/ChildSwapPacking.lean index 2eb307a248..49f5b56188 100644 --- a/LeanPool/Besicovitch/SixPoint/ChildSwapPacking.lean +++ b/LeanPool/Besicovitch/SixPoint/ChildSwapPacking.lean @@ -17,7 +17,7 @@ across the simultaneous swap of both colors, preserving its total radius, virtua score. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ def swapChildrenIndexEquiv : SixPointIndex ≃ SixPointIndex where /-- Child relabelling preserves the color of each index. -/ @[simp] theorem swapChildrenIndexEquiv_color (index : SixPointIndex) : - (swapChildrenIndexEquiv index).1 = index.1 := rfl + (swapChildrenIndexEquiv index).1 = index.1 := by rfl @[simp] private theorem swapChildrenIndexEquiv_involution (index : SixPointIndex) : swapChildrenIndexEquiv (swapChildrenIndexEquiv index) = index := by diff --git a/LeanPool/Besicovitch/SixPoint/Configuration.lean b/LeanPool/Besicovitch/SixPoint/Configuration.lean index ceba9e640f..0d5157f75b 100644 --- a/LeanPool/Besicovitch/SixPoint/Configuration.lean +++ b/LeanPool/Besicovitch/SixPoint/Configuration.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.Statement This file records exactly the metric assumptions in the finite six-point problem. -/ -@[expose] public section +public section namespace LeanPool.Besicovitch @@ -47,6 +47,7 @@ abbrev SixPointConfiguration := SixPointColor → SixPointLabel → (EuclideanSp namespace SixPointConfiguration /-- The labelled configuration determined by two roots and two children of each color. -/ +@[expose] def ofPoints (redRoot redLeft redRight blueRoot blueLeft blueRight : (EuclideanSpace ℝ (Fin 2))) : SixPointConfiguration | .red, .root => redRoot diff --git a/LeanPool/Besicovitch/SixPoint/EndpointFailureClosed.lean b/LeanPool/Besicovitch/SixPoint/EndpointFailureClosed.lean index c40d30b935..8a17622015 100644 --- a/LeanPool/Besicovitch/SixPoint/EndpointFailureClosed.lean +++ b/LeanPool/Besicovitch/SixPoint/EndpointFailureClosed.lean @@ -18,7 +18,7 @@ strictly incompatible with the weighted geometric bound. The other matched endp simultaneously swapping both pairs of children. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/EndpointGeometry.lean b/LeanPool/Besicovitch/SixPoint/EndpointGeometry.lean index 639edd45b8..cb2b9eece2 100644 --- a/LeanPool/Besicovitch/SixPoint/EndpointGeometry.lean +++ b/LeanPool/Besicovitch/SixPoint/EndpointGeometry.lean @@ -14,7 +14,7 @@ After translating the red root to the origin, the blue children are pulled back root. The resulting vectors are the `e`, `p`, and `w` variables in the nine-packing proof. -/ -@[expose] public section +public section noncomputable section @@ -23,16 +23,17 @@ namespace LeanPool.Besicovitch namespace SixPointConfiguration /-- The displacement from the red root to the blue root. -/ +@[expose] def rootDisplacement (configuration : SixPointConfiguration) : (EuclideanSpace ℝ (Fin 2)) := configuration .blue .root - configuration .red .root /-- A red point, translated relative to the red root. -/ -def redDisplacement (configuration : SixPointConfiguration) (label : SixPointLabel) : +@[expose] def redDisplacement (configuration : SixPointConfiguration) (label : SixPointLabel) : (EuclideanSpace ℝ (Fin 2)) := configuration .red label - configuration .red .root /-- A blue point pulled back from the blue root into the red child disk. -/ -def bluePullback (configuration : SixPointConfiguration) (label : SixPointLabel) : +@[expose] def bluePullback (configuration : SixPointConfiguration) (label : SixPointLabel) : (EuclideanSpace ℝ (Fin 2)) := configuration .blue .root - configuration .blue label diff --git a/LeanPool/Besicovitch/SixPoint/EndpointPacking.lean b/LeanPool/Besicovitch/SixPoint/EndpointPacking.lean index 384250bffc..f8959f4c93 100644 --- a/LeanPool/Besicovitch/SixPoint/EndpointPacking.lean +++ b/LeanPool/Besicovitch/SixPoint/EndpointPacking.lean @@ -18,7 +18,7 @@ This file assembles the finite failure tree. Its sole analytic input is the wei bound for two ordered chords in the unit disk. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/EndpointWeights.lean b/LeanPool/Besicovitch/SixPoint/EndpointWeights.lean index 04d1e19503..08235a818d 100644 --- a/LeanPool/Besicovitch/SixPoint/EndpointWeights.lean +++ b/LeanPool/Besicovitch/SixPoint/EndpointWeights.lean @@ -17,7 +17,7 @@ Small exact radical certificates prove the numerical inequalities; the stationar proved symbolically from Cramer's rule. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/FailureTree.lean b/LeanPool/Besicovitch/SixPoint/FailureTree.lean index dc10637c34..23878b1cb9 100644 --- a/LeanPool/Besicovitch/SixPoint/FailureTree.lean +++ b/LeanPool/Besicovitch/SixPoint/FailureTree.lean @@ -16,7 +16,7 @@ For an admissible endpoint configuration, either a packing already has nonnegati of the two perfect matchings of the four children satisfies the exact matching obstruction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/FiniteProperty.lean b/LeanPool/Besicovitch/SixPoint/FiniteProperty.lean index 5742459fe9..b6ee57af2d 100644 --- a/LeanPool/Besicovitch/SixPoint/FiniteProperty.lean +++ b/LeanPool/Besicovitch/SixPoint/FiniteProperty.lean @@ -14,14 +14,14 @@ This file states the compactified finite property and removes zero-radius labels witnesses. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- Every admissible configuration at `s` has a compactified packing of nonnegative score. -/ -def SixPointFiniteProperty (s : ℝ) : Prop := +@[expose] def SixPointFiniteProperty (s : ℝ) : Prop := ∀ configuration : SixPointConfiguration, configuration.IsAdmissibleAt s → ∃ packing : SixPointPacking configuration, 0 ≤ packing.score s @@ -30,7 +30,7 @@ namespace SixPointPacking variable {configuration : SixPointConfiguration} (packing : SixPointPacking configuration) /-- A packing is genuine when every radius on its support is positive. -/ -def HasPositiveRadii : Prop := +@[expose] def HasPositiveRadii : Prop := ∀ i : packing.support, 0 < (packing.radius i : ℝ) /-- The labels carrying positive radius in a compactified packing. -/ diff --git a/LeanPool/Besicovitch/SixPoint/FourChildren.lean b/LeanPool/Besicovitch/SixPoint/FourChildren.lean index 3a2a5a59a6..a18912c978 100644 --- a/LeanPool/Besicovitch/SixPoint/FourChildren.lean +++ b/LeanPool/Besicovitch/SixPoint/FourChildren.lean @@ -14,7 +14,7 @@ This file constructs the split-radius packing on the four child labels and recor routing algebra. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/GramCertificateCore.lean b/LeanPool/Besicovitch/SixPoint/GramCertificateCore.lean index 318f33ae29..87cd61b2f2 100644 --- a/LeanPool/Besicovitch/SixPoint/GramCertificateCore.lean +++ b/LeanPool/Besicovitch/SixPoint/GramCertificateCore.lean @@ -22,7 +22,7 @@ completed by elementary two-vector squares, dominates that form, so the score is explicit rational number depending only on the certificate. -/ -@[expose] public section +public section noncomputable section @@ -37,20 +37,20 @@ abbrev Five := Fin 5 abbrev Three := Fin 3 /-- The small rational weight on the coincident-endpoint slack. -/ -def gramLambda : ℝ := 1 / 12 +@[expose] def gramLambda : ℝ := 1 / 12 /-- The small rational weight on the balanced root--edge slack. -/ -def gramMu : ℝ := 13 / 14 +@[expose] def gramMu : ℝ := 13 / 14 theorem gramLambda_pos : 0 < gramLambda := by norm_num [gramLambda] theorem gramMu_pos : 0 < gramMu := by norm_num [gramMu] /-- Half the first-child radial penalty at the small rational weights. -/ -def gramFirstPenalty : ℝ := weightedFirstPenalty barC gramLambda gramMu / 2 +@[expose] def gramFirstPenalty : ℝ := weightedFirstPenalty barC gramLambda gramMu / 2 /-- Half the second-child radial penalty at the small rational weights. -/ -def gramSecondPenalty : ℝ := weightedSecondPenalty barC gramLambda gramMu / 2 +@[expose] def gramSecondPenalty : ℝ := weightedSecondPenalty barC gramLambda gramMu / 2 theorem gramFirstPenalty_pos : 0 < gramFirstPenalty := by norm_num [gramFirstPenalty, weightedFirstPenalty, gramLambda, gramMu, barC] @@ -88,19 +88,19 @@ structure GramCertificate where factor : Fin 3 → Fin 5 → ℚ /-- Scale a table of integers by `10⁻⁴`. -/ -def tenThousandthFactor (entries : Fin 3 → Fin 5 → ℤ) : Fin 3 → Fin 5 → ℚ := +@[expose] def tenThousandthFactor (entries : Fin 3 → Fin 5 → ℤ) : Fin 3 → Fin 5 → ℚ := fun i j ↦ entries i j / 10000 /-- One rational Gram-factor row, cast to real coordinates. -/ -def factorRow (certificate : GramCertificate) (k : Three) : Five → ℝ := +@[expose] def factorRow (certificate : GramCertificate) (k : Three) : Five → ℝ := fun i ↦ certificate.factor k i /-- The positive semidefinite Gram matrix represented by the three factor rows. -/ -def factorGram (certificate : GramCertificate) : Matrix Five Five ℝ := +@[expose] def factorGram (certificate : GramCertificate) : Matrix Five Five ℝ := ∑ k, Matrix.vecMulVec (factorRow certificate k) (factorRow certificate k) /-- The negated off-diagonal coefficients of the quadratic form. -/ -def targetOffDiagonal (certificate : GramCertificate) : Matrix Five Five ℝ := +@[expose] def targetOffDiagonal (certificate : GramCertificate) : Matrix Five Five ℝ := !![0, certificate.alpha₀ + certificate.alpha₂ + certificate.alpha₄, certificate.alpha₁ + certificate.alpha₅, certificate.alpha₀ + certificate.alpha₃ + certificate.alpha₅, @@ -115,7 +115,7 @@ def targetOffDiagonal (certificate : GramCertificate) : Matrix Five Five ℝ := certificate.etaW, 0] /-- The discrepancy between the target quadratic form and its rational Gram factor. -/ -def residual (certificate : GramCertificate) (i j : Five) : ℝ := +@[expose] def residual (certificate : GramCertificate) (i j : Five) : ℝ := targetOffDiagonal certificate i j - factorGram certificate i j private def certificateMatrix (certificate : GramCertificate) : Matrix Five Five ℝ := @@ -181,27 +181,27 @@ private theorem certificateMatrix_offDiagonal (certificate : GramCertificate) {i simp_all [certificateMatrix, fivePairCompletion, residual, targetOffDiagonal] /-- Diagonal entry 0 after adding the rank-one residual corrections. -/ -def diagonal₀ (certificate : GramCertificate) : ℝ := +@[expose] def diagonal₀ (certificate : GramCertificate) : ℝ := factorGram certificate 0 0 + |residual certificate 0 1| + |residual certificate 0 2| + |residual certificate 0 3| + |residual certificate 0 4| /-- Diagonal entry 1 after adding the rank-one residual corrections. -/ -def diagonal₁ (certificate : GramCertificate) : ℝ := +@[expose] def diagonal₁ (certificate : GramCertificate) : ℝ := factorGram certificate 1 1 + |residual certificate 0 1| + |residual certificate 1 2| + |residual certificate 1 3| + |residual certificate 1 4| /-- Diagonal entry 2 after adding the rank-one residual corrections. -/ -def diagonal₂ (certificate : GramCertificate) : ℝ := +@[expose] def diagonal₂ (certificate : GramCertificate) : ℝ := factorGram certificate 2 2 + |residual certificate 0 2| + |residual certificate 1 2| + |residual certificate 2 3| + |residual certificate 2 4| /-- Diagonal entry 3 after adding the rank-one residual corrections. -/ -def diagonal₃ (certificate : GramCertificate) : ℝ := +@[expose] def diagonal₃ (certificate : GramCertificate) : ℝ := factorGram certificate 3 3 + |residual certificate 0 3| + |residual certificate 1 3| + |residual certificate 2 3| + |residual certificate 3 4| /-- Diagonal entry 4 after adding the rank-one residual corrections. -/ -def diagonal₄ (certificate : GramCertificate) : ℝ := +@[expose] def diagonal₄ (certificate : GramCertificate) : ℝ := factorGram certificate 4 4 + |residual certificate 0 4| + |residual certificate 1 4| + |residual certificate 2 4| + |residual certificate 3 4| @@ -231,10 +231,10 @@ private theorem gram_sum_nonneg {E : Type*} [NormedAddCommGroup E] exact matrix_inner_sum_nonneg (certificateMatrix_posSemidef certificate) v /-- The lower bound the separation forces on the first red radius. -/ -def redFirstLower (certificate : GramCertificate) : ℝ := barC - certificate.pUpper +@[expose] def redFirstLower (certificate : GramCertificate) : ℝ := barC - certificate.pUpper /-- The lower bound the separation forces on the first blue radius. -/ -def blueFirstLower (certificate : GramCertificate) : ℝ := barC - certificate.wUpper +@[expose] def blueFirstLower (certificate : GramCertificate) : ℝ := barC - certificate.wUpper private theorem certificate_gram_nonneg {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (certificate : GramCertificate) (e p₁ p₂ w₁ w₂ : E) : @@ -284,32 +284,32 @@ private theorem certificate_gram_nonneg {E : Type*} [NormedAddCommGroup E] nlinarith /-- The balance of the root vector. -/ -def balance₀ (certificate : GramCertificate) : ℝ := +@[expose] def balance₀ (certificate : GramCertificate) : ℝ := diagonal₀ certificate + certificate.alpha₀ + certificate.alpha₁ + certificate.alpha₂ + certificate.alpha₃ + certificate.alpha₄ + certificate.alpha₅ /-- The balance of the first red vector. -/ -def balance₁ (certificate : GramCertificate) : ℝ := +@[expose] def balance₁ (certificate : GramCertificate) : ℝ := diagonal₁ certificate + certificate.alpha₀ + certificate.alpha₂ + certificate.alpha₄ - gramFirstPenalty / (redFirstLower certificate + 1) + certificate.etaP /-- The balance of the second red vector. -/ -def balance₂ (certificate : GramCertificate) : ℝ := +@[expose] def balance₂ (certificate : GramCertificate) : ℝ := diagonal₂ certificate + certificate.alpha₁ + certificate.alpha₅ - gramSecondPenalty / (certificate.pLower + certificate.pUpper) + certificate.etaP /-- The balance of the first blue vector. -/ -def balance₃ (certificate : GramCertificate) : ℝ := +@[expose] def balance₃ (certificate : GramCertificate) : ℝ := diagonal₃ certificate + certificate.alpha₀ + certificate.alpha₃ + certificate.alpha₅ - gramFirstPenalty / (blueFirstLower certificate + 1) + certificate.etaW /-- The balance of the second blue vector. -/ -def balance₄ (certificate : GramCertificate) : ℝ := +@[expose] def balance₄ (certificate : GramCertificate) : ℝ := diagonal₄ certificate + certificate.alpha₁ + certificate.alpha₄ - gramSecondPenalty / (certificate.wLower + certificate.wUpper) + certificate.etaW /-- The radius-box maximum of the diagonal form after the Gram corrections. -/ -def dualRadialBound (certificate : GramCertificate) : ℝ := +@[expose] def dualRadialBound (certificate : GramCertificate) : ℝ := balance₀ certificate + positivePart (balance₁ certificate) - negativePart (balance₁ certificate) * redFirstLower certificate ^ 2 + @@ -322,7 +322,7 @@ def dualRadialBound (certificate : GramCertificate) : ℝ := (certificate.etaP + certificate.etaW) * barC ^ 2 /-- The exact rational upper bound the certificate proves for the weighted score. -/ -def GramCertificate.upperBound (certificate : GramCertificate) : ℝ := +@[expose] def GramCertificate.upperBound (certificate : GramCertificate) : ℝ := -weightedConstantTerm barC gramLambda gramMu + (1 + gramLambda) ^ 2 / (4 * certificate.alpha₀) + 1 / (4 * certificate.alpha₁) + @@ -339,7 +339,7 @@ def GramCertificate.upperBound (certificate : GramCertificate) : ℝ := dualRadialBound certificate /-- The arithmetic conditions making a certificate usable. -/ -def GramCertificate.Valid (certificate : GramCertificate) : Prop := +@[expose] def GramCertificate.Valid (certificate : GramCertificate) : Prop := barC - 1 ≤ (certificate.pLower : ℝ) ∧ (certificate.pLower : ℝ) ≤ certificate.pUpper ∧ (certificate.pUpper : ℝ) ≤ 1 ∧ barC - 1 ≤ (certificate.wLower : ℝ) ∧ diff --git a/LeanPool/Besicovitch/SixPoint/GramCertificateCover.lean b/LeanPool/Besicovitch/SixPoint/GramCertificateCover.lean index c1b8fd1784..04472d1295 100644 --- a/LeanPool/Besicovitch/SixPoint/GramCertificateCover.lean +++ b/LeanPool/Besicovitch/SixPoint/GramCertificateCover.lean @@ -15,7 +15,7 @@ ordered pair of bands is contained in the radius rectangle of one stored certifi swapping the two sibling pairs when the blue band precedes the red one. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/GramCertificateData.lean b/LeanPool/Besicovitch/SixPoint/GramCertificateData.lean index 37c7b5953a..cc868cea04 100644 --- a/LeanPool/Besicovitch/SixPoint/GramCertificateData.lean +++ b/LeanPool/Besicovitch/SixPoint/GramCertificateData.lean @@ -18,14 +18,14 @@ The tangent parameters, separation multipliers and factor entries were found num stored as exact rationals with denominator `10000`; every inequality below is recomputed here. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- One local Gram certificate for each of the thirty radius rectangles. -/ -def gramCertificates : Fin 30 → GramCertificate := ![ +@[expose] def gramCertificates : Fin 30 → GramCertificate := ![ -- `I0xI0` { pLower := 967/2500, pUpper := 1/2, wLower := 967/2500, wUpper := 1/2, alpha₀ := 1880 / 10000, alpha₁ := 3752 / 10000, alpha₂ := 1215 / 10000, diff --git a/LeanPool/Besicovitch/SixPoint/GramWeightedBound.lean b/LeanPool/Besicovitch/SixPoint/GramWeightedBound.lean index 8e0fad7cae..e3c053acdb 100644 --- a/LeanPool/Besicovitch/SixPoint/GramWeightedBound.lean +++ b/LeanPool/Besicovitch/SixPoint/GramWeightedBound.lean @@ -15,7 +15,7 @@ Combining the local Gram certificates with the finite cover of second-child radi weighted geometric bound for every pair of separated sibling pairs in the unit ball. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/LensEndpointBalancedE0S0.lean b/LeanPool/Besicovitch/SixPoint/LensEndpointBalancedE0S0.lean index e4893f7d06..b73d6f926f 100644 --- a/LeanPool/Besicovitch/SixPoint/LensEndpointBalancedE0S0.lean +++ b/LeanPool/Besicovitch/SixPoint/LensEndpointBalancedE0S0.lean @@ -19,7 +19,7 @@ radii are then divided into a small rational cover. On every rectangle, an expl Gram majorant, corrected by elementary two-vector squares, proves the required strict bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/MatrixCorrections.lean b/LeanPool/Besicovitch/SixPoint/MatrixCorrections.lean index e35e6ba5ff..52d0889fcf 100644 --- a/LeanPool/Besicovitch/SixPoint/MatrixCorrections.lean +++ b/LeanPool/Besicovitch/SixPoint/MatrixCorrections.lean @@ -15,7 +15,7 @@ public import LeanPool.Besicovitch.SixPoint.NormEstimates Certificate families use these signed corrections to dominate their off-diagonal residuals. -/ -@[expose] public section +public section noncomputable section @@ -42,6 +42,7 @@ theorem pairCorrection_posSemidef [Finite ι] (r : ℝ) (i j : ι) : (Matrix.posSemidef_vecMulVec_self_star (pairVector r i j)).smul (abs_nonneg r) /-- Complete a five-vector certificate with positive two-coordinate corrections. -/ +@[expose] def fivePairCompletion (base : Matrix (Fin 5) (Fin 5) ℝ) (residual : Fin 5 → Fin 5 → ℝ) : Matrix (Fin 5) (Fin 5) ℝ := base + diff --git a/LeanPool/Besicovitch/SixPoint/NormEstimates.lean b/LeanPool/Besicovitch/SixPoint/NormEstimates.lean index 10f7dda814..102cdf76d9 100644 --- a/LeanPool/Besicovitch/SixPoint/NormEstimates.lean +++ b/LeanPool/Besicovitch/SixPoint/NormEstimates.lean @@ -17,7 +17,7 @@ public import Mathlib.Tactic.Ring The sibling and row-column certificates use the same norm expansions and tangent bounds. -/ -@[expose] public section +public section noncomputable section @@ -90,10 +90,10 @@ theorem norm_sub_sub_sq {E : Type*} [NormedAddCommGroup E] ring /-- The nonnegative part of a real coefficient. -/ -def positivePart (x : ℝ) : ℝ := max x 0 +@[expose] def positivePart (x : ℝ) : ℝ := max x 0 /-- The magnitude of the negative part of a real coefficient. -/ -def negativePart (x : ℝ) : ℝ := max (-x) 0 +@[expose] def negativePart (x : ℝ) : ℝ := max (-x) 0 /-- Positive and negative parts recover the coefficient. -/ theorem positivePart_sub_negativePart (x : ℝ) : diff --git a/LeanPool/Besicovitch/SixPoint/Normalization.lean b/LeanPool/Besicovitch/SixPoint/Normalization.lean index b1f650c776..380d885907 100644 --- a/LeanPool/Besicovitch/SixPoint/Normalization.lean +++ b/LeanPool/Besicovitch/SixPoint/Normalization.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.SixPoint.Configuration This file translates and rescales a configuration for the finite six-point problem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/Packing.lean b/LeanPool/Besicovitch/SixPoint/Packing.lean index d7b2c7c3c2..7b17b77750 100644 --- a/LeanPool/Besicovitch/SixPoint/Packing.lean +++ b/LeanPool/Besicovitch/SixPoint/Packing.lean @@ -14,7 +14,7 @@ public import Mathlib.Data.Finset.Lattice.Fold A support remembers selected zero-radius labels, so its virtual diameter has no degenerate cases. -/ -@[expose] public section +public section noncomputable section @@ -42,10 +42,12 @@ theorem support_nonempty : packing.support.Nonempty := by exact ⟨(.red, label), hlabel⟩ /-- The sum of all supported radii. -/ +@[expose] def totalRadius : ℝ := packing.support.attach.sum fun i ↦ (packing.radius i : ℝ) /-- The maximum pairwise center distance plus the two radii on the explicit support. -/ +@[expose] def virtualDiameter : ℝ := packing.support.attach.sup' packing.support_nonempty.attach fun i ↦ packing.support.attach.sup' packing.support_nonempty.attach fun j ↦ @@ -53,6 +55,7 @@ def virtualDiameter : ℝ := packing.radius i + packing.radius j /-- The packing score at parameter `s`. -/ +@[expose] def score (s : ℝ) : ℝ := packing.totalRadius - packing.virtualDiameter / (2 * s) diff --git a/LeanPool/Besicovitch/SixPoint/PackingRelabel.lean b/LeanPool/Besicovitch/SixPoint/PackingRelabel.lean index 037619809d..5fb1d2ac61 100644 --- a/LeanPool/Besicovitch/SixPoint/PackingRelabel.lean +++ b/LeanPool/Besicovitch/SixPoint/PackingRelabel.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.SixPoint.Packing A color-preserving permutation transports a packing and preserves its radius sum and score. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/RationalChord.lean b/LeanPool/Besicovitch/SixPoint/RationalChord.lean index c628cced79..be09015a3f 100644 --- a/LeanPool/Besicovitch/SixPoint/RationalChord.lean +++ b/LeanPool/Besicovitch/SixPoint/RationalChord.lean @@ -21,17 +21,18 @@ The routing and exclusion modules use a chord only through the two facts below: between one and two, and that it lies in an explicit rational box. Both are immediate here. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- Twice the rational threshold: the chord length of the retargeted argument. -/ +@[expose] def barC : ℝ := 3467 / 2500 /-- The rational density threshold certified by the retargeted argument. -/ -def barS : ℝ := barC / 2 +@[expose] def barS : ℝ := barC / 2 /-- The rational threshold is `0.6934`. -/ theorem barS_eq : barS = 6934 / 10000 := by diff --git a/LeanPool/Besicovitch/SixPoint/Realization.lean b/LeanPool/Besicovitch/SixPoint/Realization.lean index 67d5c10490..1a2e2d247a 100644 --- a/LeanPool/Besicovitch/SixPoint/Realization.lean +++ b/LeanPool/Besicovitch/SixPoint/Realization.lean @@ -15,7 +15,7 @@ A normalized packing is realized by multiplying its radii by the physical length relates its virtual diameter and disjointness constraints to the resulting union of open balls. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ namespace SixPointPacking variable {normalized physical : SixPointConfiguration} /-- The physical union of balls obtained from a normalized packing at a given scale. -/ -def ballUnionAt (packing : SixPointPacking normalized) (physical : SixPointConfiguration) +@[expose] def ballUnionAt (packing : SixPointPacking normalized) (physical : SixPointConfiguration) (scale : ℝ) : Set (EuclideanSpace ℝ (Fin 2)) := finiteBallUnion packing.support (fun i ↦ physical i.1.1 i.1.2) (fun i ↦ scale * packing.radius i) diff --git a/LeanPool/Besicovitch/SixPoint/RootEdge.lean b/LeanPool/Besicovitch/SixPoint/RootEdge.lean index 438f66adcc..a3cafc4b2e 100644 --- a/LeanPool/Besicovitch/SixPoint/RootEdge.lean +++ b/LeanPool/Besicovitch/SixPoint/RootEdge.lean @@ -20,7 +20,7 @@ triangle. It also proves the exact rational separator that excludes an internal primitive on the matching branch of the endpoint failure tree. -/ -@[expose] public section +public section noncomputable section @@ -282,14 +282,14 @@ theorem redRootEdgeBlueTrianglePacking_totalRadius ring /-- Cross reach from the red root to a labelled blue triangle ball. -/ -def redRootBlueTriangleReach (configuration : SixPointConfiguration) +@[expose] def redRootBlueTriangleReach (configuration : SixPointConfiguration) (label : SixPointLabel) : ℝ := dist (configuration .red .root) (configuration .blue label) + canonicalTriangleRadius (configuration .blue .root) (configuration .blue .left) (configuration .blue .right) label /-- Cross reach from a red child to a labelled blue triangle ball. -/ -def redChildBlueTriangleReach (configuration : SixPointConfiguration) +@[expose] def redChildBlueTriangleReach (configuration : SixPointConfiguration) (redLabel blueLabel : SixPointLabel) : ℝ := dist (configuration .red redLabel) (configuration .blue blueLabel) + canonicalTriangleRadius (configuration .blue .root) (configuration .blue .left) @@ -562,14 +562,14 @@ theorem blueRootEdgeRedTrianglePacking_totalRadius ring /-- Cross reach from the blue root to a labelled red triangle ball. -/ -def blueRootRedTriangleReach (configuration : SixPointConfiguration) +@[expose] def blueRootRedTriangleReach (configuration : SixPointConfiguration) (label : SixPointLabel) : ℝ := dist (configuration .blue .root) (configuration .red label) + canonicalTriangleRadius (configuration .red .root) (configuration .red .left) (configuration .red .right) label /-- Cross reach from a blue child to a labelled red triangle ball. -/ -def blueChildRedTriangleReach (configuration : SixPointConfiguration) +@[expose] def blueChildRedTriangleReach (configuration : SixPointConfiguration) (blueLabel redLabel : SixPointLabel) : ℝ := dist (configuration .blue blueLabel) (configuration .red redLabel) + canonicalTriangleRadius (configuration .red .root) (configuration .red .left) @@ -1060,23 +1060,23 @@ theorem rootEdge_internal_expanded_lt {E : Type*} [NormedAddCommGroup E] nlinarith [rootEdge_internal_polynomial_lt] /-- Failure slack for the diagonal four-child matching. -/ -def matchingFailureSlack (c L M B₁₁ B₂₂ : ℝ) : ℝ := +@[expose] def matchingFailureSlack (c L M B₁₁ B₂₂ : ℝ) : ℝ := B₁₁ + B₂₂ - (2 * c - 1) * (L + M) /-- Failure slack for the red coincident endpoint on the first matching edge. -/ -def redEndpointFailureSlack (c L M b₁ b₂ B₁₁ : ℝ) : ℝ := +@[expose] def redEndpointFailureSlack (c L M b₁ b₂ B₁₁ : ℝ) : ℝ := L - 1 + B₁₁ + (b₁ + M - b₂) / 2 - c * (L + (b₁ + b₂ + M) / 2) /-- Internal failure slack for the red root--second-child edge. -/ -def redRootEdgeInternalSlack (c M r₂ b₁ b₂ : ℝ) : ℝ := +@[expose] def redRootEdgeInternalSlack (c M r₂ b₁ b₂ : ℝ) : ℝ := 2 * M - c * (r₂ + (b₁ + b₂ + M) / 2) /-- Failure slack for the blue coincident endpoint on the first matching edge. -/ -def blueEndpointFailureSlack (c L M r₁ r₂ B₁₁ : ℝ) : ℝ := +@[expose] def blueEndpointFailureSlack (c L M r₁ r₂ B₁₁ : ℝ) : ℝ := M - 1 + B₁₁ + (r₁ + L - r₂) / 2 - c * (M + (r₁ + r₂ + L) / 2) /-- Internal failure slack for the blue root--second-child edge. -/ -def blueRootEdgeInternalSlack (c L b₂ r₁ r₂ : ℝ) : ℝ := +@[expose] def blueRootEdgeInternalSlack (c L b₂ r₁ r₂ : ℝ) : ℝ := 2 * L - c * (b₂ + (r₁ + r₂ + L) / 2) /-- The internal root-edge slack has a strictly negative positive separator. -/ diff --git a/LeanPool/Besicovitch/SixPoint/RootEdgeClosed.lean b/LeanPool/Besicovitch/SixPoint/RootEdgeClosed.lean index af6d4c9a72..505c05a47d 100644 --- a/LeanPool/Besicovitch/SixPoint/RootEdgeClosed.lean +++ b/LeanPool/Besicovitch/SixPoint/RootEdgeClosed.lean @@ -16,7 +16,7 @@ The crossed `(1,2)` separator removes the second branch of each root--edge minim root--edge supports either provide a nonnegative packing or both select their `(1,1)` terms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/RootEdgeFailureTree.lean b/LeanPool/Besicovitch/SixPoint/RootEdgeFailureTree.lean index e12245973a..dbf59fc3b1 100644 --- a/LeanPool/Besicovitch/SixPoint/RootEdgeFailureTree.lean +++ b/LeanPool/Besicovitch/SixPoint/RootEdgeFailureTree.lean @@ -17,19 +17,19 @@ the opposite children. This file connects their geometric packings to the root-- records the elementary reductions shared by the two color directions. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- The endpoint diameter target for the red root--second-child support. -/ -def redRootEdgeTarget (configuration : SixPointConfiguration) : ℝ := +@[expose] def redRootEdgeTarget (configuration : SixPointConfiguration) : ℝ := barC * (dist (configuration .red .root) (configuration .red .right) + rootedTriangleTotalRadius configuration .blue) /-- The endpoint diameter target for the blue root--second-child support. -/ -def blueRootEdgeTarget (configuration : SixPointConfiguration) : ℝ := +@[expose] def blueRootEdgeTarget (configuration : SixPointConfiguration) : ℝ := barC * (dist (configuration .blue .root) (configuration .blue .right) + rootedTriangleTotalRadius configuration .red) @@ -98,14 +98,14 @@ theorem blueRootEdgePackingAtEndpoint_score_nonnegative simpa [blueRootEdgeTarget, rootedTriangleTotalRadius, mul_comm] using hdiameter /-- Every feasible split of support `57` has negative score. -/ -def RedRootEdgeFails (configuration : SixPointConfiguration) +@[expose] def RedRootEdgeFails (configuration : SixPointConfiguration) (h : configuration.IsAdmissibleAt barS) : Prop := ∀ (x : ℝ) (hxZero : 0 ≤ x) (hxEdge : x ≤ dist (configuration .red .root) (configuration .red .right)), (redRootEdgePackingAtEndpoint configuration h x hxZero hxEdge).score barS < 0 /-- Every feasible split of support `75` has negative score. -/ -def BlueRootEdgeFails (configuration : SixPointConfiguration) +@[expose] def BlueRootEdgeFails (configuration : SixPointConfiguration) (h : configuration.IsAdmissibleAt barS) : Prop := ∀ (x : ℝ) (hxZero : 0 ≤ x) (hxEdge : x ≤ dist (configuration .blue .root) (configuration .blue .right)), diff --git a/LeanPool/Besicovitch/SixPoint/RootEdgeType12.lean b/LeanPool/Besicovitch/SixPoint/RootEdgeType12.lean index cca8ba05b4..4eae915d19 100644 --- a/LeanPool/Besicovitch/SixPoint/RootEdgeType12.lean +++ b/LeanPool/Besicovitch/SixPoint/RootEdgeType12.lean @@ -20,7 +20,7 @@ separator with weights `1, 1, 2`. Three scalar norm tangents reduce it to one f Gram certificate; radial secants use only the sibling separation and the unit-ball bounds. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open scoped InnerProductSpace namespace LeanPool.Besicovitch /-- Failure slack of the crossed `(1,2)` term for a red root--second-child edge. -/ -def redRootEdgeType12Slack +@[expose] def redRootEdgeType12Slack (c M r₂ b₁ b₂ rootToBlueFirst secondCross : ℝ) : ℝ := r₂ + rootToBlueFirst + secondCross + M - 2 * c * (r₂ + (b₁ + b₂ + M) / 2) diff --git a/LeanPool/Besicovitch/SixPoint/RowColumnRescue.lean b/LeanPool/Besicovitch/SixPoint/RowColumnRescue.lean index a4f56ff3a3..5741624692 100644 --- a/LeanPool/Besicovitch/SixPoint/RowColumnRescue.lean +++ b/LeanPool/Besicovitch/SixPoint/RowColumnRescue.lean @@ -19,7 +19,7 @@ for the four-child packing forces the corresponding root against the full opposi have nonnegative score. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/Scaling.lean b/LeanPool/Besicovitch/SixPoint/Scaling.lean index 2765624e6e..40f2d0924b 100644 --- a/LeanPool/Besicovitch/SixPoint/Scaling.lean +++ b/LeanPool/Besicovitch/SixPoint/Scaling.lean @@ -14,7 +14,7 @@ This file shrinks every radius while retaining the same centers and support. Shr strict score gain used when the density parameter is larger than the finite endpoint. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ namespace SixPointPacking variable {configuration : SixPointConfiguration} /-- Shrink every packing radius by a factor in `[0, 1]`. -/ -def scaleRadii (packing : SixPointPacking configuration) (q : ℝ) (hq0 : 0 ≤ q) +@[expose] def scaleRadii (packing : SixPointPacking configuration) (q : ℝ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : SixPointPacking configuration where support := packing.support meets_color := packing.meets_color diff --git a/LeanPool/Besicovitch/SixPoint/Score.lean b/LeanPool/Besicovitch/SixPoint/Score.lean index be9607c2ed..0dc6859c59 100644 --- a/LeanPool/Besicovitch/SixPoint/Score.lean +++ b/LeanPool/Besicovitch/SixPoint/Score.lean @@ -13,7 +13,7 @@ public import LeanPool.Besicovitch.SixPoint.Packing This file controls the score when its parameter or the underlying center distances change. -/ -@[expose] public section +public section noncomputable section @@ -58,7 +58,7 @@ theorem transport_totalRadius (packing : SixPointPacking configuration) (hdistance : ∀ i j : packing.support, i ≠ j → i.1.1 = j.1.1 → dist (configuration i.1.1 i.1.2) (configuration j.1.1 j.1.2) ≤ dist (configuration' i.1.1 i.1.2) (configuration' j.1.1 j.1.2)) : - (packing.transport hdistance).totalRadius = packing.totalRadius := rfl + (packing.transport hdistance).totalRadius = packing.totalRadius := by rfl /-- An upper perturbation of all supported distances bounds the transported virtual diameter. -/ theorem transport_virtualDiameter_le_add (packing : SixPointPacking configuration) diff --git a/LeanPool/Besicovitch/SixPoint/SiblingFailureTree.lean b/LeanPool/Besicovitch/SixPoint/SiblingFailureTree.lean index 955251e737..6c016fe53c 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingFailureTree.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingFailureTree.lean @@ -16,7 +16,7 @@ Once the diagonal matching obstruction is selected, supports `67` and `76` eithe nonnegative-score packing or route their simultaneous failures into the finite incidence ledger. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/SiblingIncidence.lean b/LeanPool/Besicovitch/SixPoint/SiblingIncidence.lean index ea761df8d4..766f7cf79f 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingIncidence.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingIncidence.lean @@ -17,31 +17,31 @@ This file encodes the finite incidence ledger for simultaneous failures of suppo are exactly the six, eight, and seven cases left by the fixed diagonal matching. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- The child at one coordinate of an incidence code. -/ -def incidenceChild : Fin 2 → SixPointLabel +@[expose] def incidenceChild : Fin 2 → SixPointLabel | 0 => .left | 1 => .right /-- The other child index. -/ -def otherChild : Fin 2 → Fin 2 +@[expose] def otherChild : Fin 2 → Fin 2 | 0 => 1 | 1 => 0 /-- The first child coordinate in the code `2 i + j`. -/ -def incidenceFirst : Fin 4 → Fin 2 +@[expose] def incidenceFirst : Fin 4 → Fin 2 | 0 => 0 | 1 => 0 | 2 => 1 | 3 => 1 /-- The second child coordinate in the code `2 i + j`. -/ -def incidenceSecond : Fin 4 → Fin 2 +@[expose] def incidenceSecond : Fin 4 → Fin 2 | 0 => 0 | 1 => 1 | 2 => 0 @@ -54,26 +54,26 @@ inductive SiblingTriangleWitness deriving DecidableEq /-- Simultaneously swapping the two children sends an endpoint code `a` to `3 - a`. -/ -def swapEndpointCode : Fin 4 → Fin 4 +@[expose] def swapEndpointCode : Fin 4 → Fin 4 | 0 => 3 | 1 => 2 | 2 => 1 | 3 => 0 /-- Transposing the two colors transposes an endpoint's two coordinates. -/ -def transposeEndpointCode : Fin 4 → Fin 4 +@[expose] def transposeEndpointCode : Fin 4 → Fin 4 | 0 => 0 | 1 => 2 | 2 => 1 | 3 => 3 /-- Put a blue endpoint witness into the common `(red child, blue child)` code convention. -/ -def transposeBlueEndpointWitness : SiblingTriangleWitness → SiblingTriangleWitness +@[expose] def transposeBlueEndpointWitness : SiblingTriangleWitness → SiblingTriangleWitness | .endpoint code => .endpoint (transposeEndpointCode code) | .balanced code => .balanced code /-- Simultaneously swapping the children exchanges balanced codes `0` and `3`. -/ -def swapBalancedCode : Fin 4 → Fin 4 +@[expose] def swapBalancedCode : Fin 4 → Fin 4 | 0 => 3 | 1 => 1 | 2 => 2 @@ -113,7 +113,7 @@ inductive BalancedBalancedOrbit deriving DecidableEq /-- Classify an ordered pair of endpoint codes under child swap and color transposition. -/ -def endpointEndpointOrbit : Fin 4 → Fin 4 → EndpointEndpointOrbit +@[expose] def endpointEndpointOrbit : Fin 4 → Fin 4 → EndpointEndpointOrbit | 0, 0 | 3, 3 => .matchedCoincident | 1, 1 | 2, 2 => .offMatchingCoincident | 0, 1 | 3, 2 | 2, 0 | 1, 3 => .adjacentFirst @@ -122,7 +122,7 @@ def endpointEndpointOrbit : Fin 4 → Fin 4 → EndpointEndpointOrbit | 1, 2 | 2, 1 => .offMatchingDisjoint /-- Classify an endpoint code and a balanced code under simultaneous child swap. -/ -def endpointBalancedOrbit : Fin 4 → Fin 4 → EndpointBalancedOrbit +@[expose] def endpointBalancedOrbit : Fin 4 → Fin 4 → EndpointBalancedOrbit | 0, 0 | 3, 3 => .e0s0 | 0, 1 | 3, 1 => .e0s1 | 0, 2 | 3, 2 => .e0s2 @@ -133,7 +133,7 @@ def endpointBalancedOrbit : Fin 4 → Fin 4 → EndpointBalancedOrbit | 1, 3 | 2, 0 => .e1s3 /-- Classify an ordered pair of balanced codes under child swap and color transposition. -/ -def balancedBalancedOrbit : Fin 4 → Fin 4 → BalancedBalancedOrbit +@[expose] def balancedBalancedOrbit : Fin 4 → Fin 4 → BalancedBalancedOrbit | 0, 0 | 3, 3 => .s0s0 | 0, 3 | 3, 0 => .s0s3 | 0, 1 | 3, 1 | 1, 0 | 1, 3 => .s0s1 @@ -183,7 +183,7 @@ theorem balancedBalancedOrbit_transpose (redCode blueCode : Fin 4) : rfl /-- The threshold inequality selected by an endpoint or balanced sibling witness. -/ -def siblingTriangleWitnessExceeds (L T : ℝ) (leftReach rightReach : SixPointLabel → ℝ) : +@[expose] def siblingTriangleWitnessExceeds (L T : ℝ) (leftReach rightReach : SixPointLabel → ℝ) : SiblingTriangleWitness → Prop | .endpoint code => let reach := if incidenceFirst code = 0 then leftReach else rightReach @@ -226,24 +226,24 @@ theorem exists_siblingTriangleWitnessExceeds_of_failure · exact ⟨.balanced 3, hlabels⟩ /-- The total canonical radius of one color's rooted triangle. -/ -def rootedTriangleTotalRadius (configuration : SixPointConfiguration) +@[expose] def rootedTriangleTotalRadius (configuration : SixPointConfiguration) (color : SixPointColor) : ℝ := (dist (configuration color .root) (configuration color .left) + dist (configuration color .root) (configuration color .right) + dist (configuration color .left) (configuration color .right)) / 2 /-- The diameter threshold for support `67` at the exact endpoint. -/ -def redSiblingTriangleTarget (configuration : SixPointConfiguration) : ℝ := +@[expose] def redSiblingTriangleTarget (configuration : SixPointConfiguration) : ℝ := barC * (dist (configuration .red .left) (configuration .red .right) + rootedTriangleTotalRadius configuration .blue) /-- The diameter threshold for support `76` at the exact endpoint. -/ -def blueSiblingTriangleTarget (configuration : SixPointConfiguration) : ℝ := +@[expose] def blueSiblingTriangleTarget (configuration : SixPointConfiguration) : ℝ := barC * (dist (configuration .blue .left) (configuration .blue .right) + rootedTriangleTotalRadius configuration .red) /-- The exact endpoint or balanced failure inequality for support `67`. -/ -def redSiblingTriangleFailure (configuration : SixPointConfiguration) : +@[expose] def redSiblingTriangleFailure (configuration : SixPointConfiguration) : SiblingTriangleWitness → Prop := siblingTriangleWitnessExceeds (dist (configuration .red .left) (configuration .red .right)) @@ -252,7 +252,7 @@ def redSiblingTriangleFailure (configuration : SixPointConfiguration) : (redSiblingBlueTriangleReach configuration .right) /-- The exact endpoint or balanced failure inequality for support `76`. -/ -def blueSiblingTriangleFailure (configuration : SixPointConfiguration) : +@[expose] def blueSiblingTriangleFailure (configuration : SixPointConfiguration) : SiblingTriangleWitness → Prop := fun witness ↦ siblingTriangleWitnessExceeds (dist (configuration .blue .left) (configuration .blue .right)) @@ -262,7 +262,7 @@ def blueSiblingTriangleFailure (configuration : SixPointConfiguration) : (transposeBlueEndpointWitness witness) /-- The average of the two root-to-child distances at a matched child index. -/ -def matchedChildAverage (configuration : SixPointConfiguration) (child : Fin 2) : ℝ := +@[expose] def matchedChildAverage (configuration : SixPointConfiguration) (child : Fin 2) : ℝ := (dist (configuration .red .root) (configuration .red (incidenceChild child)) + dist (configuration .blue .root) (configuration .blue (incidenceChild child))) / 2 @@ -640,7 +640,7 @@ def blueSiblingTrianglePackingAtEndpoint (configuration : SixPointConfiguration) (h.child_distance .red .right (by simp)) /-- Every feasible support `67` radius split has negative endpoint score. -/ -def RedSiblingTriangleFails (configuration : SixPointConfiguration) +@[expose] def RedSiblingTriangleFails (configuration : SixPointConfiguration) (h : configuration.IsAdmissibleAt barS) : Prop := ∀ (x : ℝ) (hxLower : dist (configuration .red .left) (configuration .red .right) - 1 ≤ x) @@ -648,7 +648,7 @@ def RedSiblingTriangleFails (configuration : SixPointConfiguration) (redSiblingTrianglePackingAtEndpoint configuration h x hxLower hxUpper).score barS < 0 /-- Every feasible support `76` radius split has negative endpoint score. -/ -def BlueSiblingTriangleFails (configuration : SixPointConfiguration) +@[expose] def BlueSiblingTriangleFails (configuration : SixPointConfiguration) (h : configuration.IsAdmissibleAt barS) : Prop := ∀ (y : ℝ) (hyLower : dist (configuration .blue .left) (configuration .blue .right) - 1 ≤ y) diff --git a/LeanPool/Besicovitch/SixPoint/SiblingIncidenceClosed.lean b/LeanPool/Besicovitch/SixPoint/SiblingIncidenceClosed.lean index 99c55dc9dd..fb5f144472 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingIncidenceClosed.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingIncidenceClosed.lean @@ -19,7 +19,7 @@ The five lens separators, together with the direct outside-orbit exclusions, rul simultaneous sibling failure except the two matched endpoint coincidences. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/SiblingIncidenceLedger.lean b/LeanPool/Besicovitch/SixPoint/SiblingIncidenceLedger.lean index fdbd625bef..93daa3e8f6 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingIncidenceLedger.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingIncidenceLedger.lean @@ -15,23 +15,25 @@ This file connects the exact rational tangent certificates to the endpoint and b failure witnesses. The only remaining analytic inputs are the five named lens inequalities. -/ -@[expose] public section +public section noncomputable section namespace LeanPool.Besicovitch /-- Swap the two child labels while fixing the root. -/ -def swapChildLabel : SixPointLabel → SixPointLabel +@[expose] def swapChildLabel : SixPointLabel → SixPointLabel | .root => .root | .left => .right | .right => .left /-- Simultaneously swap the two children of both colors. -/ +@[expose] def swapConfigurationChildren (configuration : SixPointConfiguration) : SixPointConfiguration := fun color label ↦ configuration color (swapChildLabel label) /-- Interchange the red and blue colors. -/ +@[expose] def transposeConfigurationColors (configuration : SixPointConfiguration) : SixPointConfiguration | .red => configuration .blue | .blue => configuration .red @@ -63,6 +65,7 @@ theorem IsAdmissibleAt.transposeColors {configuration : SixPointConfiguration} { simpa [transposeConfigurationColors] using h.sibling_distance _ /-- The distance between a chosen red child and a chosen blue child. -/ +@[expose] def incidenceCrossDistance (configuration : SixPointConfiguration) (redChild blueChild : Fin 2) : ℝ := dist (configuration .red (incidenceChild redChild)) @@ -95,19 +98,19 @@ theorem incidenceCrossDistance_eq_norm (configuration : SixPointConfiguration) exact configuration.dist_red_blue_eq_norm _ _ /-- The radial penalty in a reduced balanced incidence slack. -/ -def balancedIncidencePenalty (code : Fin 4) (firstRadius secondRadius : ℝ) : ℝ := +@[expose] def balancedIncidencePenalty (code : Fin 4) (firstRadius secondRadius : ℝ) : ℝ := match code with | 0 => ((barC - 1) * firstRadius + (barC + 1) * secondRadius) / 2 | 1 | 2 => barC * (firstRadius + secondRadius) / 2 | 3 => ((barC + 1) * firstRadius + (barC - 1) * secondRadius) / 2 /-- The reduced matching slack retained from the four-child branch. -/ -def diagonalMatchingReducedSlack (configuration : SixPointConfiguration) : ℝ := +@[expose] def diagonalMatchingReducedSlack (configuration : SixPointConfiguration) : ℝ := incidenceCrossDistance configuration 0 0 + incidenceCrossDistance configuration 1 1 - 2 * barC * (2 * barC - 1) /-- The selected diagonal matching alternative from the four-child minimax. -/ -def SelectedDiagonalMatchingFails (configuration : SixPointConfiguration) : Prop := +@[expose] def SelectedDiagonalMatchingFails (configuration : SixPointConfiguration) : Prop := (2 * barC - 1) * (dist (configuration .red .left) (configuration .red .right) + dist (configuration .blue .left) (configuration .blue .right)) ≤ @@ -230,7 +233,7 @@ theorem blueBalancedFailure_transposeColors (configuration : SixPointConfigurati dist_comm, add_comm] /-- The reduced upper slack for a red endpoint incidence. -/ -def redEndpointReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := +@[expose] def redEndpointReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := let blueChild := incidenceSecond code incidenceCrossDistance configuration (incidenceFirst code) blueChild - (1 + 3 * barC * (barC - 1) / 2) - @@ -238,7 +241,7 @@ def redEndpointReducedSlack (configuration : SixPointConfiguration) (code : Fin (barC + 1) * incidenceChildRadius configuration .blue (otherChild blueChild)) / 2 /-- The reduced upper slack for a blue endpoint incidence. -/ -def blueEndpointReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := +@[expose] def blueEndpointReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := let redChild := incidenceFirst code incidenceCrossDistance configuration redChild (incidenceSecond code) - (1 + 3 * barC * (barC - 1) / 2) - @@ -246,7 +249,7 @@ def blueEndpointReducedSlack (configuration : SixPointConfiguration) (code : Fin (barC + 1) * incidenceChildRadius configuration .red (otherChild redChild)) / 2 /-- The reduced upper slack for a red balanced incidence. -/ -def redBalancedReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := +@[expose] def redBalancedReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := (incidenceCrossDistance configuration 0 (incidenceFirst code) + incidenceCrossDistance configuration 1 (incidenceSecond code)) / 2 + barC - 3 * barC ^ 2 / 2 - @@ -254,7 +257,7 @@ def redBalancedReducedSlack (configuration : SixPointConfiguration) (code : Fin (incidenceChildRadius configuration .blue 1) /-- The reduced upper slack for a blue balanced incidence. -/ -def blueBalancedReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := +@[expose] def blueBalancedReducedSlack (configuration : SixPointConfiguration) (code : Fin 4) : ℝ := (incidenceCrossDistance configuration (incidenceFirst code) 0 + incidenceCrossDistance configuration (incidenceSecond code) 1) / 2 + barC - 3 * barC ^ 2 / 2 - @@ -753,13 +756,13 @@ theorem not_redEndpoint_zero_and_blueEndpoint_two nlinarith /-- The exact scalar lens bound for the off-matching coincident endpoint cell. -/ -def OffMatchingCoincidentLensBound (configuration : SixPointConfiguration) : Prop := +@[expose] def OffMatchingCoincidentLensBound (configuration : SixPointConfiguration) : Prop := 6 * diagonalMatchingReducedSlack configuration + 7 * redEndpointReducedSlack configuration 1 + 7 * blueEndpointReducedSlack configuration 1 < 0 /-- The exact scalar lens bound for the `E0/S0` endpoint/balanced cell. -/ -def EndpointBalancedE0S0LensBound (configuration : SixPointConfiguration) : Prop := +@[expose] def EndpointBalancedE0S0LensBound (configuration : SixPointConfiguration) : Prop := 5 * diagonalMatchingReducedSlack configuration + 9 * redEndpointReducedSlack configuration 0 + 6 * blueBalancedReducedSlack configuration 0 < 0 @@ -1048,7 +1051,7 @@ theorem balancedBalanced_excluded_outside_lenses · exact (hnotS0S0 rfl).elim /-- The five possible outcomes after all tangent and direct incidence exclusions. -/ -def SiblingIncidenceOutcome (configuration : SixPointConfiguration) : Prop := +@[expose] def SiblingIncidenceOutcome (configuration : SixPointConfiguration) : Prop := (∃ code : Fin 4, (code = 0 ∨ code = 3) ∧ redSiblingTriangleFailure configuration (.endpoint code) ∧ blueSiblingTriangleFailure configuration (.endpoint code)) ∨ diff --git a/LeanPool/Besicovitch/SixPoint/SiblingLens.lean b/LeanPool/Besicovitch/SixPoint/SiblingLens.lean index fa04ba0911..a3cf8d9a1e 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingLens.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingLens.lean @@ -17,7 +17,7 @@ preserve the correlation between its cross distances. A rational two-by-two Gram separates the two colors, leaving a convex quadratic on the three radial vertices. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/SiblingLensE1S0.lean b/LeanPool/Besicovitch/SixPoint/SiblingLensE1S0.lean index acf9b18a86..eaabd6a8df 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingLensE1S0.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingLensE1S0.lean @@ -17,7 +17,7 @@ matrix preserves the correlation between the three positive distances. The resul colorwise quadratics are bounded on the three radial vertices. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/SiblingLensS0S0.lean b/LeanPool/Besicovitch/SixPoint/SiblingLensS0S0.lean index 974af921f5..21c29b7517 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingLensS0S0.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingLensS0S0.lean @@ -17,7 +17,7 @@ two-by-two incidence matrix. A rational positive-semidefinite factorization then two colors, leaving two copies of the three-vertex radial estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/SiblingLensS0S3.lean b/LeanPool/Besicovitch/SixPoint/SiblingLensS0S3.lean index 6a6bdc0ea4..ccfa7049dc 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingLensS0S3.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingLensS0S3.lean @@ -16,7 +16,7 @@ three positive cross distances. Two secants of the square root retain enough of radial penalties, and three exact rational Gram factorizations cover the resulting radial ranges. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/SiblingTangent.lean b/LeanPool/Besicovitch/SixPoint/SiblingTangent.lean index 54fb10f3fd..b2c9bb2560 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingTangent.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingTangent.lean @@ -18,7 +18,7 @@ sibling-incidence ledger. Its endpoint checks use only rational arithmetic and t isolation interval for `barC`. -/ -@[expose] public section +public section noncomputable section @@ -63,13 +63,13 @@ theorem separableQuadratic_le_radial_vertices {a₁ a₂ b₁ b₂ d c t₁ t₂ simpa [value, v11, v1c, vc1] using hfinal /-- The scalar upper function for a two-point Gram estimate. -/ -def gramPairValue (c u₁ u₂ g₁ g₂ d₁ d₂ off sigma t₁ t₂ : ℝ) : ℝ := +@[expose] def gramPairValue (c u₁ u₂ g₁ g₂ d₁ d₂ off sigma t₁ t₂ : ℝ) : ℝ := (u₁ + (g₁ + g₂) * g₁ / sigma) * t₁ ^ 2 - d₁ * t₁ + (u₂ + (g₁ + g₂) * g₂ / sigma) * t₂ ^ 2 - d₂ * t₂ + sigma - (off + g₁ * g₂ / sigma) * c ^ 2 /-- The largest radial-vertex value in a two-point Gram estimate. -/ -def gramPairMaximum (c u₁ u₂ g₁ g₂ d₁ d₂ off sigma : ℝ) : ℝ := +@[expose] def gramPairMaximum (c u₁ u₂ g₁ g₂ d₁ d₂ off sigma : ℝ) : ℝ := max (gramPairValue c u₁ u₂ g₁ g₂ d₁ d₂ off sigma 1 1) (max (gramPairValue c u₁ u₂ g₁ g₂ d₁ d₂ off sigma 1 (c - 1)) (gramPairValue c u₁ u₂ g₁ g₂ d₁ d₂ off sigma (c - 1) 1)) diff --git a/LeanPool/Besicovitch/SixPoint/SiblingTriangle.lean b/LeanPool/Besicovitch/SixPoint/SiblingTriangle.lean index 71b63b863f..269efb6eb4 100644 --- a/LeanPool/Besicovitch/SixPoint/SiblingTriangle.lean +++ b/LeanPool/Besicovitch/SixPoint/SiblingTriangle.lean @@ -14,7 +14,7 @@ public import LeanPool.Besicovitch.SixPoint.Packing This file constructs supports `67` and `76` and proves their one-dimensional routing algebra. -/ -@[expose] public section +public section noncomputable section @@ -253,21 +253,21 @@ theorem blueSiblingRedTrianglePacking_totalRadius ring /-- Cross reach from a red point to a blue point carrying its canonical radius. -/ -def redSiblingBlueTriangleReach (configuration : SixPointConfiguration) +@[expose] def redSiblingBlueTriangleReach (configuration : SixPointConfiguration) (redLabel blueLabel : SixPointLabel) : ℝ := dist (configuration .red redLabel) (configuration .blue blueLabel) + canonicalTriangleRadius (configuration .blue .root) (configuration .blue .left) (configuration .blue .right) blueLabel /-- Cross reach from a blue point to a red point carrying its canonical radius. -/ -def blueSiblingRedTriangleReach (configuration : SixPointConfiguration) +@[expose] def blueSiblingRedTriangleReach (configuration : SixPointConfiguration) (blueLabel redLabel : SixPointLabel) : ℝ := dist (configuration .blue blueLabel) (configuration .red redLabel) + canonicalTriangleRadius (configuration .red .root) (configuration .red .left) (configuration .red .right) redLabel /-- The largest of three labelled real values. -/ -def triangleMaximum (value : SixPointLabel → ℝ) : ℝ := +@[expose] def triangleMaximum (value : SixPointLabel → ℝ) : ℝ := max (value .root) (max (value .left) (value .right)) /-- Every labelled value is bounded by its triangle maximum. -/ diff --git a/LeanPool/Besicovitch/SixPoint/WeightedFailure.lean b/LeanPool/Besicovitch/SixPoint/WeightedFailure.lean index a591d57e1d..19b5a5a4db 100644 --- a/LeanPool/Besicovitch/SixPoint/WeightedFailure.lean +++ b/LeanPool/Besicovitch/SixPoint/WeightedFailure.lean @@ -17,7 +17,7 @@ names those natural slacks and identifies their positive weighted sum with the c weighted pair score. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Besicovitch/SixPoint/WeightedReduction.lean b/LeanPool/Besicovitch/SixPoint/WeightedReduction.lean index 4e40100f7f..b6043b2468 100644 --- a/LeanPool/Besicovitch/SixPoint/WeightedReduction.lean +++ b/LeanPool/Besicovitch/SixPoint/WeightedReduction.lean @@ -15,7 +15,7 @@ This file records the exact weighted score and proves that its two second childr moved inward until both sibling distances equal the endpoint chord length. -/ -@[expose] public section +public section noncomputable section @@ -24,19 +24,22 @@ open Set namespace LeanPool.Besicovitch /-- The coefficient penalizing the first child radii in the weighted score. -/ +@[expose] def weightedFirstPenalty (c lambda mu : ℝ) : ℝ := (c - 1) * (lambda / 2 + mu) /-- The coefficient penalizing the second child radii in the weighted score. -/ +@[expose] def weightedSecondPenalty (c lambda mu : ℝ) : ℝ := (c + 1) * lambda / 2 + 3 * c * mu /-- The constant term in the weighted combination of the three failure slacks. -/ -def weightedConstantTerm (c lambda mu : ℝ) : ℝ := +@[expose] def weightedConstantTerm (c lambda mu : ℝ) : ℝ := 2 * c * (2 * c - 1) + lambda * (3 * c ^ 2 - 3 * c + 2) / 2 + mu * (c ^ 2 - c) /-- The weighted failure score for two ordered sibling pairs relative to a unit root vector. -/ +@[expose] def weightedPairScore {E : Type*} [NormedAddCommGroup E] (e : E) (c lambda mu : ℝ) (p₁ p₂ w₁ w₂ : E) : ℝ := (1 + lambda) * ‖e - p₁ - w₁‖ + ‖e - p₂ - w₂‖ + diff --git a/LeanPool/Besicovitch/Statement.lean b/LeanPool/Besicovitch/Statement.lean index 64a2d630f1..21e654a0d2 100644 --- a/LeanPool/Besicovitch/Statement.lean +++ b/LeanPool/Besicovitch/Statement.lean @@ -18,7 +18,7 @@ This module contains the transparent definitions used by the solution. They are `Challenge.lean`, whose statement is checked independently by the comparator. -/ -@[expose] public section +public section noncomputable section @@ -30,16 +30,19 @@ namespace LeanPool.Besicovitch variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] /-- The lower one-density of `s` at `x`, normalized by the diameter `2 * r` of a ball. -/ +@[expose] def lowerOneDensity (s : Set X) (x : X) : ℝ≥0∞ := liminf (fun r : ℝ ↦ μH[1] (s ∩ Metric.ball x r) / ENNReal.ofReal (2 * r)) (nhdsWithin 0 (Ioi 0)) /-- A set is countably one-rectifiable if Lipschitz curves cover it up to Hausdorff null measure. -/ +@[expose] def IsCountablyOneRectifiable (s : Set X) : Prop := ∃ f : ℕ → ℝ → X, (∀ i, ∃ K : ℝ≥0, LipschitzWith K (f i)) ∧ μH[1] (s \ ⋃ i, range (f i)) = 0 /-- Every finite-measure set with lower density at least `β` is one-rectifiable. -/ +@[expose] def ForcesOneRectifiability (X : Type*) [MetricSpace X] [MeasurableSpace X] [BorelSpace X] (β : ℝ≥0∞) : Prop := ∀ s : Set X, MeasurableSet s → μH[1] s < ∞ → @@ -47,10 +50,12 @@ def ForcesOneRectifiability (X : Type*) [MetricSpace X] [MeasurableSpace X] [Bor IsCountablyOneRectifiable s /-- The infimum of the nonnegative thresholds forcing one-rectifiability in `X`. -/ +@[expose] def sigmaOne (X : Type*) [MetricSpace X] [MeasurableSpace X] [BorelSpace X] : ℝ := sInf {β : ℝ | 0 ≤ β ∧ ForcesOneRectifiability X (ENNReal.ofReal β)} /-- The isolated radical system whose first coordinate is twice the six-point endpoint. -/ +@[expose] def IsEndpointPair (c B : ℝ) : Prop := let D := 4 * c ^ 2 - 2 * c - B let b := (2 * B - 3 * c ^ 2 + 2 * c - 1) / (c + 1) @@ -66,10 +71,12 @@ def IsEndpointPair (c B : ℝ) : Prop := x < 0 ∧ z < 0 ∧ k - x * z < 0 /-- Twice the optimal six-point constant, defined by its isolated exact system. -/ +@[expose] def cStar : ℝ := sInf {c : ℝ | ∃ B : ℝ, IsEndpointPair c B} /-- The optimal two-colour six-point constant. -/ +@[expose] def sStar : ℝ := cStar / 2 diff --git a/LeanPool/Besicovitch/Topology/ConnectedComponent.lean b/LeanPool/Besicovitch/Topology/ConnectedComponent.lean index 626cac7110..bcefae20cd 100644 --- a/LeanPool/Besicovitch/Topology/ConnectedComponent.lean +++ b/LeanPool/Besicovitch/Topology/ConnectedComponent.lean @@ -15,7 +15,7 @@ A connected component in a compact Hausdorff space has arbitrarily small clopen neighborhoods. This is the compact-space separation fact used in the BPC argument. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Biswal.lean b/LeanPool/Biswal.lean index 087b0b8518..2937886c5b 100644 --- a/LeanPool/Biswal.lean +++ b/LeanPool/Biswal.lean @@ -22,4 +22,4 @@ Tags: algebraic-combinatorics, chebyshev, demazure MSC: 05E10 -/ -@[expose] public section +public section diff --git a/LeanPool/Biswal/Theorem1.lean b/LeanPool/Biswal/Theorem1.lean index feb807449f..7b69c980c6 100644 --- a/LeanPool/Biswal/Theorem1.lean +++ b/LeanPool/Biswal/Theorem1.lean @@ -33,7 +33,7 @@ eventually positive, built from a Chebyshev-type polynomial recurrence and a Dyck-path model. -/ -@[expose] public section +public section namespace Biswal.Theorem1 @@ -41,7 +41,7 @@ namespace Biswal.Theorem1 /-- The Chebyshev-type polynomial sequence `P n` over a commutative ring, defined by `P 0 = P 1 = 1` and `P (n + 2) = P (n + 1) - X * P n`. -/ -noncomputable def polyP (R : Type*) [CommRing R] : ℕ → Polynomial R +@[expose] noncomputable def polyP (R : Type*) [CommRing R] : ℕ → Polynomial R | 0 => 1 | 1 => 1 | (n + 2) => polyP R (n + 1) - Polynomial.X * polyP R n diff --git a/LeanPool/Biswal/Theorem23.lean b/LeanPool/Biswal/Theorem23.lean index 7b5b06e9e7..06e6917c54 100644 --- a/LeanPool/Biswal/Theorem23.lean +++ b/LeanPool/Biswal/Theorem23.lean @@ -27,7 +27,7 @@ for the generating-function coefficients and their nonnegativity via a Dyck-path counting model. -/ -@[expose] public section +public section namespace Biswal.Theorem23 @@ -35,7 +35,7 @@ namespace Biswal.Theorem23 /-- The Chebyshev-type polynomial sequence `P n` over a commutative ring, defined by `P 0 = P 1 = 1` and `P (n + 2) = P (n + 1) - X * P n`. -/ -noncomputable def polyP (R : Type*) [CommRing R] : ℕ → Polynomial R +@[expose] noncomputable def polyP (R : Type*) [CommRing R] : ℕ → Polynomial R | 0 => 1 | 1 => 1 | (n + 2) => polyP R (n + 1) - Polynomial.X * polyP R n diff --git a/LeanPool/BlockSpectralSensitivity/Composition.lean b/LeanPool/BlockSpectralSensitivity/Composition.lean index ba0adda25d..dda17a2ef6 100644 --- a/LeanPool/BlockSpectralSensitivity/Composition.lean +++ b/LeanPool/BlockSpectralSensitivity/Composition.lean @@ -29,7 +29,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -39,7 +39,7 @@ universe u /-- Block composition `f ∘ g`: `N` disjoint `M`-bit inputs, `g` applied to each, the `N` resulting bits fed to `f` (Section 14 of `bs_lambda.txt`). -/ -def comp {W V : Type*} (f : Input W → Bool) (g : Input V → Bool) : +@[expose] def comp {W V : Type*} (f : Input W → Bool) (g : Input V → Bool) : Input (W × V) → Bool := fun x => f fun w => g fun v => x (w, v) /-- The defining equation of `comp`. -/ @@ -50,7 +50,7 @@ theorem comp_apply {W V : Type*} (f : Input W → Bool) (g : Input V → Bool) `IterCoord V (m + 1) = V × IterCoord V m` holds definitionally (Section 14). It is used both as the coordinate set of `iterFun f m` and, at `V := ι`, as the index set of the product blocks `iterBlock blk m`. -/ -def IterCoord (V : Type u) : ℕ → Type u +@[expose] def IterCoord (V : Type u) : ℕ → Type u | 0 => PUnit | m + 1 => V × IterCoord V m @@ -77,6 +77,7 @@ theorem card_iterCoord (V : Type*) [Fintype V] : rw [Fintype.card_prod, card_iterCoord V m, pow_succ'] /-- The Cartesian-product block `B_{i_1} × ⋯ × B_{i_m}` (Section 14). -/ +@[expose] def iterBlock {V ι : Type*} [DecidableEq V] (blk : ι → Finset V) : (m : ℕ) → IterCoord ι m → Finset (IterCoord V m) | 0 => fun _ => (Finset.univ : Finset PUnit) @@ -92,6 +93,7 @@ theorem iterBlock_succ {V ι : Type*} [DecidableEq V] (blk : ι → Finset V) (m /-- `F_m = f^{∘ m}`, the `m`-fold self-composition (Section 14). `F_0` is the one-bit identity function. -/ +@[expose] def iterFun {V : Type*} (f : Input V → Bool) : (m : ℕ) → Input (IterCoord V m) → Bool | 0 => fun x => x PUnit.unit | m + 1 => comp f (iterFun f m) diff --git a/LeanPool/BlockSpectralSensitivity/Construction/Basic.lean b/LeanPool/BlockSpectralSensitivity/Construction/Basic.lean index 516671a1e9..462d80931c 100644 --- a/LeanPool/BlockSpectralSensitivity/Construction/Basic.lean +++ b/LeanPool/BlockSpectralSensitivity/Construction/Basic.lean @@ -34,7 +34,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -67,6 +67,7 @@ lemma block_disjoint {i j : ι} (h : i ≠ j) : /-! ### Gate coordinates -/ /-- The gate coordinate `(j, γ(i,j))` selected by the arc `i → j` (Section 3.1). -/ +@[expose] def gateCoord (γ : ι → ι → Fin r) (i j : ι) : Coord ι r := (j, γ i j) @[simp] lemma gateCoord_fst (γ : ι → ι → Fin r) (i j : ι) : (gateCoord γ i j).1 = j := rfl @@ -87,6 +88,7 @@ variable [DecidableEq ι] /-- The partial assignment `P_i` cutting out the certificate `C_i` (Section 3.2): the owner block `B_i` is fixed to `true`, and every outgoing gate coordinate is fixed to `false`. -/ +@[expose] def cert (Arc : ι → ι → Bool) (γ : ι → ι → Fin r) (i : ι) : PartialAssign (Coord ι r) := fun v ↦ if v.1 = i then some true else if Arc i v.1 ∧ v.2 = γ i v.1 then some false else none @@ -200,6 +202,7 @@ latter do not fire on it; the three lemmas below restate them for `ind`. /-- The Boolean function `f`: the indicator of the union of the certificate subcubes `C_i` (Section 3.3). -/ +@[expose] def ind (Arc : ι → ι → Bool) (γ : ι → ι → Fin r) : Input (Coord ι r) → Bool := PartialAssign.indUnion (cert Arc γ) diff --git a/LeanPool/BlockSpectralSensitivity/Construction/BlockSens.lean b/LeanPool/BlockSpectralSensitivity/Construction/BlockSens.lean index 416fc24877..abdd6f2c16 100644 --- a/LeanPool/BlockSpectralSensitivity/Construction/BlockSens.lean +++ b/LeanPool/BlockSpectralSensitivity/Construction/BlockSens.lean @@ -24,7 +24,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda diff --git a/LeanPool/BlockSpectralSensitivity/Construction/Conflict.lean b/LeanPool/BlockSpectralSensitivity/Construction/Conflict.lean index 93f017a7e2..231eaabd17 100644 --- a/LeanPool/BlockSpectralSensitivity/Construction/Conflict.lean +++ b/LeanPool/BlockSpectralSensitivity/Construction/Conflict.lean @@ -35,7 +35,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda diff --git a/LeanPool/BlockSpectralSensitivity/Defs/Cube.lean b/LeanPool/BlockSpectralSensitivity/Defs/Cube.lean index c33b47cf15..beac282507 100644 --- a/LeanPool/BlockSpectralSensitivity/Defs/Cube.lean +++ b/LeanPool/BlockSpectralSensitivity/Defs/Cube.lean @@ -20,7 +20,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section /-- The symmetric difference of two distinct singletons is the corresponding pair. This is a general `Finset` fact, stated here because Mathlib does not have it. -/ @@ -35,7 +35,7 @@ namespace BSLambda abbrev Input (V : Type*) : Type _ := V → Bool /-- The all-zero input, written `0^V` in `bs_lambda.txt`. -/ -def zeroInput (V : Type*) : Input V := fun _ ↦ false +@[expose] def zeroInput (V : Type*) : Input V := fun _ ↦ false @[simp] lemma zeroInput_apply {V : Type*} (v : V) : zeroInput V v = false := rfl @@ -46,6 +46,7 @@ variable [DecidableEq V] /-- `flipSet x A` is the input written `x^A` in the source document: it flips every coordinate lying in `A` and leaves all other coordinates unchanged. -/ +@[expose] def flipSet (x : Input V) (A : Finset V) : Input V := fun v ↦ if v ∈ A then !x v else x v @[simp] lemma flipSet_apply_of_mem {x : Input V} {A : Finset V} {v : V} (hv : v ∈ A) : diff --git a/LeanPool/BlockSpectralSensitivity/Defs/Sensitivity.lean b/LeanPool/BlockSpectralSensitivity/Defs/Sensitivity.lean index 13ddf7c256..d50f88edd3 100644 --- a/LeanPool/BlockSpectralSensitivity/Defs/Sensitivity.lean +++ b/LeanPool/BlockSpectralSensitivity/Defs/Sensitivity.lean @@ -27,7 +27,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section /-! ## A missing `Set` lemma @@ -48,7 +48,7 @@ namespace BSLambda variable {V : Type*} [Fintype V] [DecidableEq V] /-- A coordinate `v` is sensitive for `f` at `x` when flipping it changes the value. -/ -def SensitiveCoord (f : Input V → Bool) (x : Input V) (v : V) : Prop := +@[expose] def SensitiveCoord (f : Input V → Bool) (x : Input V) (v : V) : Prop := f (flipSet x {v}) ≠ f x instance (f : Input V → Bool) (x : Input V) (v : V) : Decidable (SensitiveCoord f x v) := @@ -62,7 +62,7 @@ lemma mem_sensCoords {f : Input V → Bool} {x : Input V} {v : V} : v ∈ sensCoords f x ↔ SensitiveCoord f x v := Finset.mem_filter_univ v /-- `s(f,x)`: the number of sensitive coordinates at `x`. -/ -def sensAt (f : Input V → Bool) (x : Input V) : ℕ := (sensCoords f x).card +@[expose] def sensAt (f : Input V → Bool) (x : Input V) : ℕ := (sensCoords f x).card /-- Any `Finset` containing every sensitive coordinate at `x` bounds `s(f,x)`. -/ lemma sensAt_le_card {f : Input V → Bool} {x : Input V} {s : Finset V} diff --git a/LeanPool/BlockSpectralSensitivity/Defs/Spectral.lean b/LeanPool/BlockSpectralSensitivity/Defs/Spectral.lean index cbd6b06e13..5c6477d357 100644 --- a/LeanPool/BlockSpectralSensitivity/Defs/Spectral.lean +++ b/LeanPool/BlockSpectralSensitivity/Defs/Spectral.lean @@ -24,7 +24,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -33,7 +33,7 @@ open scoped Matrix Matrix.Norms.L2Operator variable {V : Type*} [Fintype V] /-- The adjacency matrix `A_f` of the sensitivity graph `G_f`. -/ -noncomputable def adj (f : Input V → Bool) : Matrix (Input V) (Input V) ℝ := +@[expose] noncomputable def adj (f : Input V → Bool) : Matrix (Input V) (Input V) ℝ := Matrix.of fun x y => if hammingDist x y = 1 ∧ f x ≠ f y then (1 : ℝ) else 0 lemma adj_apply (f : Input V → Bool) (x y : Input V) : @@ -117,6 +117,7 @@ lemma trace_adj (f : Input V → Bool) : (adj f).trace = 0 := by simp [Matrix.diag_apply, adj_apply] /-- `lambda(f)`: the largest eigenvalue of the sensitivity-graph adjacency matrix. -/ +@[expose] noncomputable def lam (f : Input V → Bool) : ℝ := ⨆ i, (isHermitian_adj f).eigenvalues i /-- `lambda(f) ≥ 0`: the eigenvalues of `adj f` sum to `trace (adj f) = 0`, so at least one of diff --git a/LeanPool/BlockSpectralSensitivity/Defs/Subcube.lean b/LeanPool/BlockSpectralSensitivity/Defs/Subcube.lean index fc8f201fd4..c3d6d5e78e 100644 --- a/LeanPool/BlockSpectralSensitivity/Defs/Subcube.lean +++ b/LeanPool/BlockSpectralSensitivity/Defs/Subcube.lean @@ -33,7 +33,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -48,6 +48,7 @@ variable {V : Type*} /-! ### Satisfaction, projection and conflicts -/ /-- `x` satisfies every literal of `P`. -/ +@[expose] def Sat (P : PartialAssign V) (x : Input V) : Prop := ∀ v b, P v = some b → x v = b lemma Sat.eq_of_fixed {P : PartialAssign V} {x : Input V} (hx : P.Sat x) {v : V} {b : Bool} @@ -55,7 +56,7 @@ lemma Sat.eq_of_fixed {P : PartialAssign V} {x : Input V} (hx : P.Sat x) {v : V} /-- The nearest-point projection of `x` onto `C(P)`: reset every violated fixed coordinate, leave the free coordinates alone. -/ -def proj (P : PartialAssign V) (x : Input V) : Input V := fun v => (P v).getD (x v) +@[expose] def proj (P : PartialAssign V) (x : Input V) : Input V := fun v => (P v).getD (x v) /-- The projection keeps the value `P` fixes, falling back on the value of `x`. -/ @[simp] lemma proj_apply (P : PartialAssign V) (x : Input V) (v : V) : @@ -72,6 +73,7 @@ lemma proj_eq_self_of_sat {P : PartialAssign V} {x : Input V} (hx : P.Sat x) : P | some b => simp [hv, hx.eq_of_fixed hv] /-- Two partial assignments *conflict* at `v` if they fix `v` to opposite values. -/ +@[expose] def Conflict (P Q : PartialAssign V) (v : V) : Prop := ∃ b, P v = some b ∧ Q v = some (!b) /-- `Conflict` is an existential over `Bool`, hence decidable; providing the instance @@ -144,7 +146,7 @@ lemma mem_fixedSet_iff_exists {P : PartialAssign V} {v : V} : rw [mem_fixedSet_iff_ne_none, Option.ne_none_iff_exists'] /-- The codimension of the subcube `C(P)`: the number of coordinates that `P` fixes. -/ -def codim (P : PartialAssign V) : ℕ := P.fixedSet.card +@[expose] def codim (P : PartialAssign V) : ℕ := P.fixedSet.card /-- The defining equation for `codim`, so that call sites need not unfold the `def`. -/ lemma codim_eq_card_fixedSet (P : PartialAssign V) : P.codim = P.fixedSet.card := rfl @@ -191,7 +193,7 @@ lemma violSet_subset_of_sat_of_eq_off {P : PartialAssign V} {x y : Input V} {A : exact hne ((h v hvA).trans (hx.eq_of_fixed hb)) /-- `dist(x, C(P))`: the number of fixed literals of `P` violated by `x`. -/ -def dist (P : PartialAssign V) (x : Input V) : ℕ := (P.violSet x).card +@[expose] def dist (P : PartialAssign V) (x : Input V) : ℕ := (P.violSet x).card /-- The defining equation for `dist`, so that call sites need not unfold the `def`. -/ lemma dist_eq_card_violSet (P : PartialAssign V) (x : Input V) : diff --git a/LeanPool/BlockSpectralSensitivity/Defs/Tournament.lean b/LeanPool/BlockSpectralSensitivity/Defs/Tournament.lean index 54aff178da..0868e59d6e 100644 --- a/LeanPool/BlockSpectralSensitivity/Defs/Tournament.lean +++ b/LeanPool/BlockSpectralSensitivity/Defs/Tournament.lean @@ -40,7 +40,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda diff --git a/LeanPool/BlockSpectralSensitivity/LLL/Asymmetric.lean b/LeanPool/BlockSpectralSensitivity/LLL/Asymmetric.lean index c9b170c1c7..80eaa2b8f8 100644 --- a/LeanPool/BlockSpectralSensitivity/LLL/Asymmetric.lean +++ b/LeanPool/BlockSpectralSensitivity/LLL/Asymmetric.lean @@ -30,7 +30,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda.LLL diff --git a/LeanPool/BlockSpectralSensitivity/LLL/GateExists.lean b/LeanPool/BlockSpectralSensitivity/LLL/GateExists.lean index 7d4c75835f..13c28643c1 100644 --- a/LeanPool/BlockSpectralSensitivity/LLL/GateExists.lean +++ b/LeanPool/BlockSpectralSensitivity/LLL/GateExists.lean @@ -35,7 +35,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -52,6 +52,7 @@ variable {r : ℕ} {Arc : ι → ι → Bool} support carrying the consolidated radius-two obstruction. Inactive flags and supports of the wrong size are excluded, because the dependency counts of Section 10.1 count only the active patterns. -/ +@[expose] def BadIdx (Arc : ι → ι → Bool) : Type _ := {F : Flag1 ι // F.Active Arc} ⊕ {S : Finset ι // S.card = 9} @@ -323,6 +324,7 @@ theorem card_nbr_type_one_le (i : BadIdx Arc) : the owner `q.1` and, when it is present, by the top vertex `q.2`. The bottom set of an active flag is a subset of this (`Flag1.Active.bot_subset_headOut`), and its size is `d = 7005` for a Type-A head and `t = 3502` for a Type-B head. -/ +@[expose] def headOut (Arc : ι → ι → Bool) (q : ι × Option ι) : Finset ι := q.2.elim (outNbrs Arc q.1) (commonOut Arc q.1) diff --git a/LeanPool/BlockSpectralSensitivity/LLL/Obstruction.lean b/LeanPool/BlockSpectralSensitivity/LLL/Obstruction.lean index bfaa4323a8..0cf07db18a 100644 --- a/LeanPool/BlockSpectralSensitivity/LLL/Obstruction.lean +++ b/LeanPool/BlockSpectralSensitivity/LLL/Obstruction.lean @@ -42,7 +42,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -805,6 +805,7 @@ def radiusTwoOwnerConst : ℕ := 2 ^ 20 * ∑ l ∈ Finset.range 9, Nat.choose 8 l * Nat.choose 28 (8 - l) * 2 ^ l /-- The constant `radiusTwoConst = 9 · 2 ^ 20 · ∑_{l=0}^{8} C(8,l) C(28,8-l) 2 ^ l` of Section 9. -/ +@[expose] def radiusTwoConst : ℕ := 1300311466573824 /-- `radiusTwoConst` has one `radiusTwoOwnerConst` for each of the nine possible owners. -/ diff --git a/LeanPool/BlockSpectralSensitivity/LLL/Prob.lean b/LeanPool/BlockSpectralSensitivity/LLL/Prob.lean index f02a6a7362..b5dac8c590 100644 --- a/LeanPool/BlockSpectralSensitivity/LLL/Prob.lean +++ b/LeanPool/BlockSpectralSensitivity/LLL/Prob.lean @@ -35,7 +35,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda.LLL @@ -122,7 +122,7 @@ theorem pr_le_of_subset_biUnion {κ : Type*} {E : Finset (Cfg β)} end Additivity /-- `E` depends only on the coordinates in `S`. -/ -def Determined (S : Finset A) (E : Finset (Cfg β)) : Prop := +@[expose] def Determined (S : Finset A) (E : Finset (Cfg β)) : Prop := ∀ ω ω' : Cfg β, (∀ a ∈ S, ω a = ω' a) → (ω ∈ E ↔ ω' ∈ E) section Determined diff --git a/LeanPool/BlockSpectralSensitivity/Main.lean b/LeanPool/BlockSpectralSensitivity/Main.lean index 01ead7606a..d05e57cd36 100644 --- a/LeanPool/BlockSpectralSensitivity/Main.lean +++ b/LeanPool/BlockSpectralSensitivity/Main.lean @@ -45,7 +45,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -99,19 +99,19 @@ theorem uniqueConflict_cert (γ : Idx → Idx → Fin r) (i j : Idx) (hij : i /-- Property (L1) of Section 6: every positive point has at most three other certificates at distance one. -/ -def ListOne (γ : Idx → Idx → Fin r) : Prop := +@[expose] def ListOne (γ : Idx → Idx → Fin r) : Prop := ∀ i x, (cert Arc γ i).Sat x → (Finset.univ.filter fun j => j ≠ i ∧ (cert Arc γ j).dist x = 1).card ≤ 3 /-- Property (L2) of Section 6: every positive point has at most seven other certificates at distance at most two. -/ -def ListTwo (γ : Idx → Idx → Fin r) : Prop := +@[expose] def ListTwo (γ : Idx → Idx → Fin r) : Prop := ∀ i x, (cert Arc γ i).Sat x → (Finset.univ.filter fun j => j ≠ i ∧ (cert Arc γ j).dist x ≤ 2).card ≤ 7 /-- The certificate family attached to a gate labelling satisfying (L1) and (L2) (Sections 3, 4 and 6). -/ -@[simps] +@[expose, simps] def family (γ : Idx → Idx → Fin r) (h₁ : ListOne γ) (h₂ : ListTwo γ) : CertFamily (Coord Idx r) Idx where P := cert Arc γ diff --git a/LeanPool/BlockSpectralSensitivity/Numerics/Binomial.lean b/LeanPool/BlockSpectralSensitivity/Numerics/Binomial.lean index 7db2e35434..3638a3e015 100644 --- a/LeanPool/BlockSpectralSensitivity/Numerics/Binomial.lean +++ b/LeanPool/BlockSpectralSensitivity/Numerics/Binomial.lean @@ -34,7 +34,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda.Numerics diff --git a/LeanPool/BlockSpectralSensitivity/Numerics/LLLBounds.lean b/LeanPool/BlockSpectralSensitivity/Numerics/LLLBounds.lean index da9ee9f389..c4b26284bb 100644 --- a/LeanPool/BlockSpectralSensitivity/Numerics/LLLBounds.lean +++ b/LeanPool/BlockSpectralSensitivity/Numerics/LLLBounds.lean @@ -37,7 +37,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda.Numerics @@ -45,6 +45,7 @@ namespace BSLambda.Numerics /-- The number of type-1 dependency neighbours of a type-1 event, `D₁₁ = 10 N₁` (Section 10.1 of `bs_lambda.txt`). -/ +@[expose] def D11 : ℕ := 2146200875100 /-- The number of type-2 dependency neighbours of a type-1 event, @@ -61,11 +62,13 @@ def D21 : ℕ := 7726323150360 def D22 : ℕ := 753455972623601870517771054 /-- The type-1 event probability `p₁ = r⁻⁶` at `r = 144` (Section 10 of `bs_lambda.txt`). -/ +@[expose] noncomputable def p1 : ℝ := 1 / 144 ^ 6 /-- The type-2 event probability bound `p₂ = K / r²⁰` at `r = 144` and `K = 1300311466573824` (`BSLambda.LLL.radiusTwoConst`; Sections 9 and 10 of `bs_lambda.txt`). -/ +@[expose] noncomputable def p2 : ℝ := 1300311466573824 / 144 ^ 20 /-- The local-lemma parameter `x₁ = (29/16) p₁` (Section 10.2 of `bs_lambda.txt`). -/ diff --git a/LeanPool/BlockSpectralSensitivity/Numerics/Logs.lean b/LeanPool/BlockSpectralSensitivity/Numerics/Logs.lean index 959a4a50e9..6d63fc288c 100644 --- a/LeanPool/BlockSpectralSensitivity/Numerics/Logs.lean +++ b/LeanPool/BlockSpectralSensitivity/Numerics/Logs.lean @@ -37,7 +37,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda.Numerics diff --git a/LeanPool/BlockSpectralSensitivity/Paley/Tournament.lean b/LeanPool/BlockSpectralSensitivity/Paley/Tournament.lean index d2ae3053c2..1796dd00c2 100644 --- a/LeanPool/BlockSpectralSensitivity/Paley/Tournament.lean +++ b/LeanPool/BlockSpectralSensitivity/Paley/Tournament.lean @@ -33,7 +33,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/Bipartite.lean b/LeanPool/BlockSpectralSensitivity/Spectral/Bipartite.lean index ab1ea549ca..4016ce0e01 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/Bipartite.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/Bipartite.lean @@ -31,7 +31,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -51,6 +51,7 @@ abbrev Zeros (f : Input V → Bool) : Type _ := {x : Input V // f x = false} /-- The biadjacency matrix `M` of the sensitivity graph, rows indexed by `S`, columns by `T` (Section 11.1). -/ +@[expose] noncomputable def biadj (f : Input V → Bool) : Matrix (Ones f) (Zeros f) ℝ := Matrix.of fun x z => if hammingDist x.1 z.1 = 1 then (1 : ℝ) else 0 diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/CertFamily.lean b/LeanPool/BlockSpectralSensitivity/Spectral/CertFamily.lean index 19136d94a0..71fe7f0ce1 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/CertFamily.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/CertFamily.lean @@ -29,7 +29,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda @@ -82,6 +82,7 @@ latter do not fire on it; the first three lemmas below restate them for `ind`. -/ /-- The indicator `f` of the union of the certificate subcubes (Section 3.3). -/ +@[expose] def ind : Input V → Bool := PartialAssign.indUnion F.P /-- A point is positive exactly when some certificate subcube contains it. -/ diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/CertUnion.lean b/LeanPool/BlockSpectralSensitivity/Spectral/CertUnion.lean index f27466d2c8..189bd34857 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/CertUnion.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/CertUnion.lean @@ -35,7 +35,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section /-- A finite sum of reals that are each at most one is at most the number of nonzero terms. This is a general `Finset` fact, stated here because Mathlib does not have it. -/ @@ -61,10 +61,12 @@ noncomputable def diagMat : Matrix (Ones F.ind) (Ones F.ind) ℝ := /-- The oriented off-diagonal part `R` of the Gram matrix: the entry `G x y` is kept only when `x` lies at distance one from `y`'s certificate (Section 11.3). -/ +@[expose] noncomputable def offMat : Matrix (Ones F.ind) (Ones F.ind) ℝ := Matrix.of fun x y => if F.owner x ≠ F.owner y ∧ (F.P (F.owner y)).dist x.1 = 1 then gram F.ind x y else 0 /-- The Schur-test bound `√(A (c-1) B)` on the oriented part (Section 11.3). -/ +@[expose] noncomputable def offBound : ℝ := Real.sqrt (((F.A * (F.c - 1) : ℕ) : ℝ) * (F.B : ℝ)) diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/GramClass.lean b/LeanPool/BlockSpectralSensitivity/Spectral/GramClass.lean index 454f277d3f..125212f980 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/GramClass.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/GramClass.lean @@ -42,7 +42,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/Hermitian.lean b/LeanPool/BlockSpectralSensitivity/Spectral/Hermitian.lean index 6c36843905..f37ce38b06 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/Hermitian.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/Hermitian.lean @@ -31,7 +31,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace Matrix.IsHermitian diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/Multiplicative.lean b/LeanPool/BlockSpectralSensitivity/Spectral/Multiplicative.lean index 0aecf54b46..52dfb785bd 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/Multiplicative.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/Multiplicative.lean @@ -43,7 +43,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section /-! ### Minkowski's inequality @@ -87,9 +87,11 @@ section Blocks variable {W V : Type*} /-- The `w`-th block of an input of `comp f g`, i.e. `x` viewed as a `W`-indexed family. -/ +@[expose] def blk (x : Input (W × V)) : W → Input V := Function.curry x /-- The string of block values `w ↦ g (blk x w)`, which `comp f g` feeds into `f`. -/ +@[expose] def topBits (g : Input V → Bool) (x : Input (W × V)) : Input W := fun w ↦ g (blk x w) /-- `comp f g` is `f` applied to the top bits. -/ @@ -103,6 +105,7 @@ theorem blk_injective : Function.Injective (blk : Input (W × V) → W → Input variable [DecidableEq W] /-- `setBlk x w z` replaces the `w`-th block of `x` by `z`. -/ +@[expose] def setBlk (x : Input (W × V)) (w : W) (z : Input V) : Input (W × V) := Function.uncurry (Function.update (blk x) w z) diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/OpNorm.lean b/LeanPool/BlockSpectralSensitivity/Spectral/OpNorm.lean index 9b5d215e5d..2c759da130 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/OpNorm.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/OpNorm.lean @@ -26,7 +26,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section namespace BSLambda diff --git a/LeanPool/BlockSpectralSensitivity/Spectral/SchurTest.lean b/LeanPool/BlockSpectralSensitivity/Spectral/SchurTest.lean index 53c61113ca..48762793c7 100644 --- a/LeanPool/BlockSpectralSensitivity/Spectral/SchurTest.lean +++ b/LeanPool/BlockSpectralSensitivity/Spectral/SchurTest.lean @@ -23,7 +23,7 @@ Adapted for Lean Pool from `Timeroot/BS_Lam` at commit `7bd39a8d41ee7910d3296d0477ad18f8fff9d870`; ported to Lean Pool with proof and dependency cleanup. -/ -@[expose] public section +public section open scoped Matrix Matrix.Norms.L2Operator diff --git a/LeanPool/BollobasNikiforov/Basic/Graph.lean b/LeanPool/BollobasNikiforov/Basic/Graph.lean index 0a2686c523..e9b3d0c97a 100644 --- a/LeanPool/BollobasNikiforov/Basic/Graph.lean +++ b/LeanPool/BollobasNikiforov/Basic/Graph.lean @@ -19,14 +19,14 @@ This module is copied, up to the namespace, from `SqOmega/Graph.lean` in (Liu, Tang, Zhang). -/ -@[expose] public section +public section namespace BollobasNikiforov variable {V : Type*} /-- The coefficient `1 - 1 / ω(G)` appearing in Turán-type bounds. -/ -noncomputable def turanFactor (G : SimpleGraph V) : ℝ := +@[expose] noncomputable def turanFactor (G : SimpleGraph V) : ℝ := 1 - 1 / (G.cliqueNum : ℝ) namespace SimpleGraph diff --git a/LeanPool/BollobasNikiforov/Basic/Inner.lean b/LeanPool/BollobasNikiforov/Basic/Inner.lean index 9987229763..4b3e462919 100644 --- a/LeanPool/BollobasNikiforov/Basic/Inner.lean +++ b/LeanPool/BollobasNikiforov/Basic/Inner.lean @@ -19,7 +19,7 @@ entrywise positive part of a matrix, the rank-one Laplacian positive semidefinite matrices. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -31,7 +31,7 @@ variable {m n : Type*} /-! ### N06 — Frobenius pairing -/ /-- The real Frobenius pairing `⟨B, C⟩ = tr(Bᵀ C)`. -/ -def inner [Fintype n] (B C : Matrix n n ℝ) : ℝ := +@[expose] def inner [Fintype n] (B C : Matrix n n ℝ) : ℝ := (Bᵀ * C).trace section Inner @@ -86,7 +86,7 @@ def posPart (X : Matrix m n ℝ) : Matrix m n ℝ := @[simp] lemma posPart_apply (X : Matrix m n ℝ) (i : m) (j : n) : posPart X i j = max (X i j) 0 := - rfl + by rfl lemma posPart_nonneg (X : Matrix m n ℝ) (i : m) (j : n) : 0 ≤ posPart X i j := @@ -99,7 +99,7 @@ lemma posPart_eq_of_nonneg (X : Matrix m n ℝ) {i : m} {j : n} /-! ### N09 — Rank-one Laplacian entries -/ /-- The standard basis vector `e k` in `n → ℝ`. -/ -def e [DecidableEq n] (k : n) : n → ℝ := +@[expose] def e [DecidableEq n] (k : n) : n → ℝ := Pi.single k 1 /-- The vector `e i - e j` in coordinates. -/ diff --git a/LeanPool/BollobasNikiforov/Basic/Spectrum.lean b/LeanPool/BollobasNikiforov/Basic/Spectrum.lean index a8f4195166..c3e11e93aa 100644 --- a/LeanPool/BollobasNikiforov/Basic/Spectrum.lean +++ b/LeanPool/BollobasNikiforov/Basic/Spectrum.lean @@ -19,7 +19,7 @@ conventions in `docs/sol.tex`. The ordered family is Mathlib's antitone terms replaced by zero. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -30,23 +30,23 @@ variable {A : Matrix n n ℝ} /-- The eigenvalues of a Hermitian matrix in nonincreasing order. The value at `i` is the paper's `λ_{i+1}`. -/ -noncomputable def eigs₀ (hA : A.IsHermitian) : Fin (Fintype.card n) → ℝ := +@[expose] noncomputable def eigs₀ (hA : A.IsHermitian) : Fin (Fintype.card n) → ℝ := hA.eigenvalues₀ lemma eigs₀_antitone (hA : A.IsHermitian) : Antitone (eigs₀ hA) := hA.eigenvalues₀_antitone /-- The largest eigenvalue `λ₁(A)`. -/ -noncomputable def lambdaMax (hA : A.IsHermitian) [Nonempty n] : ℝ := +@[expose] noncomputable def lambdaMax (hA : A.IsHermitian) [Nonempty n] : ℝ := eigs₀ hA ⟨0, Fintype.card_pos⟩ /-- The second-largest eigenvalue `λ₂(A)`. -/ -noncomputable def lambdaSecond (hA : A.IsHermitian) [Nontrivial n] : ℝ := +@[expose] noncomputable def lambdaSecond (hA : A.IsHermitian) [Nontrivial n] : ℝ := eigs₀ hA ⟨1, Fintype.one_lt_card⟩ /-- The sum of squares of the two largest positive eigenvalues of a Hermitian matrix, with missing terms replaced by zero. -/ -noncomputable def F (hA : A.IsHermitian) : ℝ := +@[expose] noncomputable def F (hA : A.IsHermitian) : ℝ := if h0 : 0 < Fintype.card n then let t0 := (max (hA.eigenvalues₀ ⟨0, h0⟩) 0) ^ 2 if h1 : 1 < Fintype.card n then diff --git a/LeanPool/BollobasNikiforov/CP/Basic.lean b/LeanPool/BollobasNikiforov/CP/Basic.lean index 39693b31e6..0f33287841 100644 --- a/LeanPool/BollobasNikiforov/CP/Basic.lean +++ b/LeanPool/BollobasNikiforov/CP/Basic.lean @@ -15,7 +15,7 @@ A real matrix is completely positive if it is a finite sum of rank-one matrices `vecMulVec p p` with entrywise nonnegative `p`. -/ -@[expose] public section +public section open Matrix @@ -25,7 +25,7 @@ variable {n : Type*} [Fintype n] [DecidableEq n] /-- A real matrix is completely positive if it is a sum of outer products of entrywise nonnegative vectors. -/ -def IsCompletelyPositive (C : Matrix n n ℝ) : Prop := +@[expose] def IsCompletelyPositive (C : Matrix n n ℝ) : Prop := ∃ (q : ℕ) (p : Fin q → n → ℝ), (∀ a i, 0 ≤ p a i) ∧ C = ∑ a, vecMulVec (p a) (p a) diff --git a/LeanPool/BollobasNikiforov/CP/Closed.lean b/LeanPool/BollobasNikiforov/CP/Closed.lean index 228b8f8387..95aea7ae42 100644 --- a/LeanPool/BollobasNikiforov/CP/Closed.lean +++ b/LeanPool/BollobasNikiforov/CP/Closed.lean @@ -20,7 +20,7 @@ The rank-one generators of unit mass form a compact set `S` not containing `0`. The completely positive cone is the cone generated by `S`, and is closed. -/ -@[expose] public section +public section open Matrix Set Filter open scoped Topology diff --git a/LeanPool/BollobasNikiforov/Definition.lean b/LeanPool/BollobasNikiforov/Definition.lean index 9ba1487260..f77a9c3a45 100644 --- a/LeanPool/BollobasNikiforov/Definition.lean +++ b/LeanPool/BollobasNikiforov/Definition.lean @@ -18,7 +18,7 @@ counted automatically. The ordered family is Mathlib's antitone `eigenvalues₀`, which is the paper's `λ₁ ≥ ⋯ ≥ λₙ` with `λ₁` at index `0`. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -32,7 +32,7 @@ noncomputable def adjacencyEigenvalues /-- The adjacency eigenvalues in nonincreasing order. The value at `i` is the paper's `λ_{i+1}(G)`. -/ -noncomputable def adjacencyEigenvalues₀ +@[expose] noncomputable def adjacencyEigenvalues₀ (G : SimpleGraph V) [DecidableRel G.Adj] : Fin (Fintype.card V) → ℝ := (G.isHermitian_adjMatrix ℝ).eigenvalues₀ @@ -42,12 +42,12 @@ lemma adjacencyEigenvalues₀_antitone (G.isHermitian_adjMatrix ℝ).eigenvalues₀_antitone /-- The largest adjacency eigenvalue `λ₁(G)`. -/ -noncomputable def lambda1 +@[expose] noncomputable def lambda1 (G : SimpleGraph V) [DecidableRel G.Adj] [Nonempty V] : ℝ := adjacencyEigenvalues₀ G ⟨0, Fintype.card_pos⟩ /-- The second-largest adjacency eigenvalue `λ₂(G)`. -/ -noncomputable def lambda2 +@[expose] noncomputable def lambda2 (G : SimpleGraph V) [DecidableRel G.Adj] [Nontrivial V] : ℝ := adjacencyEigenvalues₀ G ⟨1, Fintype.one_lt_card⟩ diff --git a/LeanPool/BollobasNikiforov/Kernel/Bilinear.lean b/LeanPool/BollobasNikiforov/Kernel/Bilinear.lean index 7c306262c1..329b4d4e89 100644 --- a/LeanPool/BollobasNikiforov/Kernel/Bilinear.lean +++ b/LeanPool/BollobasNikiforov/Kernel/Bilinear.lean @@ -18,7 +18,7 @@ Completing squares in coordinates `2,1,0` yields `eq:bilinear`, and substituting `U` yields the factorization `eq:factor` of `docs/sol.tex` §3. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Kernel/Data.lean b/LeanPool/BollobasNikiforov/Kernel/Data.lean index 2acb839589..c70174ade9 100644 --- a/LeanPool/BollobasNikiforov/Kernel/Data.lean +++ b/LeanPool/BollobasNikiforov/Kernel/Data.lean @@ -18,7 +18,7 @@ functions of `docs/sol.tex` §3 (`sec:kernel`, `eq:functions`). Coordinates of `ℝ³` are numbered `0,1,2`. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -28,15 +28,15 @@ open scoped Matrix noncomputable section /-- Feature vector `v(t) = (1, -√2 t, t²)ᵀ`. -/ -def v (t : ℝ) : Fin 3 → ℝ := +@[expose] def v (t : ℝ) : Fin 3 → ℝ := ![1, -Real.sqrt 2 * t, t ^ 2] /-- Feature vector `b(x) = (x², √2 x, 1)ᵀ`. -/ -def b (x : ℝ) : Fin 3 → ℝ := +@[expose] def b (x : ℝ) : Fin 3 → ℝ := ![x ^ 2, Real.sqrt 2 * x, 1] /-- Truncated square `aᵢ(x) = (x - tᵢ)₊²`. -/ -def truncSq (ti x : ℝ) : ℝ := +@[expose] def truncSq (ti x : ℝ) : ℝ := (max (x - ti) 0) ^ 2 /-- The outer product `v vᵀ` is Hermitian. -/ @@ -69,7 +69,7 @@ lemma posSemidef_vecMulVec_self_fin3 (w : Fin 3 → ℝ) : variable {k : ℕ} (t : Fin k → ℝ) (q : Fin k → ℝ) /-- Gram matrix `𝒜 = I₃ + ∑ᵢ qᵢ v(tᵢ) v(tᵢ)ᵀ`. -/ -def 𝒜 : Matrix (Fin 3) (Fin 3) ℝ := +@[expose] def 𝒜 : Matrix (Fin 3) (Fin 3) ℝ := 1 + ∑ i, q i • vecMulVec (v (t i)) (v (t i)) /-- `𝒜` is positive definite: the identity is PD and each summand is PSD. -/ @@ -84,26 +84,26 @@ lemma 𝒜_isUnit (hq : ∀ i, 0 < q i) : IsUnit (𝒜 t q) := (𝒜_posDef t q hq).isUnit /-- Moments `mⱼ = ∑ᵢ qᵢ tᵢʲ`. -/ -def m (j : ℕ) : ℝ := +@[expose] def m (j : ℕ) : ℝ := ∑ i, q i * t i ^ j lemma m_zero : m t q 0 = ∑ i, q i := by simp [m] /-- Scalar `a₀ = 1 + m₀`. -/ -def a0 : ℝ := +@[expose] def a0 : ℝ := 1 + m t q 0 /-- Scalar `D₂ = a₀(1 + 2 m₂) - 2 m₁²`. -/ -def D2 : ℝ := +@[expose] def D2 : ℝ := a0 t q * (1 + 2 * m t q 2) - 2 * m t q 1 ^ 2 /-- Scalar `Δ = det 𝒜`. -/ -def Δ : ℝ := +@[expose] def Δ : ℝ := (𝒜 t q).det /-- Vector `V = 𝒜 e₀`. -/ -def Vvec : Fin 3 → ℝ := +@[expose] def Vvec : Fin 3 → ℝ := 𝒜 t q *ᵥ Pi.single 0 1 /-! ### KR04: principal minors of `𝒜` -/ @@ -182,23 +182,23 @@ lemma D2_pos (hq : ∀ i, 0 < q i) : 0 < D2 t q := by /-! ### KR05: auxiliary functions -/ /-- `h(x) = ∑ᵢ qᵢ aᵢ(x)`. -/ -def h (x : ℝ) : ℝ := +@[expose] def h (x : ℝ) : ℝ := ∑ i, q i * truncSq (t i) x /-- `h₁(x) = ∑ᵢ qᵢ tᵢ aᵢ(x)`. -/ -def h1 (x : ℝ) : ℝ := +@[expose] def h1 (x : ℝ) : ℝ := ∑ i, q i * t i * truncSq (t i) x /-- `b̂(x) = b(x) + ∑ᵢ qᵢ aᵢ(x) v(tᵢ)`. -/ -def bhat (x : ℝ) : Fin 3 → ℝ := +@[expose] def bhat (x : ℝ) : Fin 3 → ℝ := b x + ∑ i, (q i * truncSq (t i) x) • v (t i) /-- `U(x) = b̂(x) + (h(x)/γ) V`. -/ -def U (γ x : ℝ) : Fin 3 → ℝ := +@[expose] def U (γ x : ℝ) : Fin 3 → ℝ := bhat t q x + (h t q x / γ) • Vvec t q /-- The Gram update `𝒜 + VVᵀ/γ` before inversion. -/ -def 𝒦Mat (γ : ℝ) : Matrix (Fin 3) (Fin 3) ℝ := +@[expose] def 𝒦Mat (γ : ℝ) : Matrix (Fin 3) (Fin 3) ℝ := 𝒜 t q + (1 / γ) • vecMulVec (Vvec t q) (Vvec t q) lemma 𝒦Mat_posDef (γ : ℝ) (hq : ∀ i, 0 < q i) (hγ : 0 < γ) : @@ -212,19 +212,19 @@ lemma 𝒦Mat_isUnit (γ : ℝ) (hq : ∀ i, 0 < q i) (hγ : 0 < γ) : (𝒦Mat_posDef t q γ hq hγ).isUnit /-- `𝒦 = (𝒜 + VVᵀ/γ)⁻¹`. -/ -def 𝒦 (γ : ℝ) : Matrix (Fin 3) (Fin 3) ℝ := +@[expose] def 𝒦 (γ : ℝ) : Matrix (Fin 3) (Fin 3) ℝ := (𝒦Mat t q γ)⁻¹ /-- `N(x) = Δ e₂ᵀ 𝒜⁻¹ b̂(x)`. -/ -def N (x : ℝ) : ℝ := +@[expose] def N (x : ℝ) : ℝ := Δ t q * ((𝒜 t q)⁻¹ *ᵥ bhat t q x) 2 /-- `P(x) = a₀ x + m₁ x² + m₁ h(x) − a₀ h₁(x)`. -/ -def P (x : ℝ) : ℝ := +@[expose] def P (x : ℝ) : ℝ := a0 t q * x + m t q 1 * x ^ 2 + m t q 1 * h t q x - a0 t q * h1 t q x /-- `Z(x) = γ x² + (γ + a₀) h(x)`. -/ -def Z (γ x : ℝ) : ℝ := +@[expose] def Z (γ x : ℝ) : ℝ := γ * x ^ 2 + (γ + a0 t q) * h t q x /-! ### KR06: `𝒜⁻¹ V = e₀` -/ diff --git a/LeanPool/BollobasNikiforov/Kernel/Main.lean b/LeanPool/BollobasNikiforov/Kernel/Main.lean index c724cfcbdb..733093e446 100644 --- a/LeanPool/BollobasNikiforov/Kernel/Main.lean +++ b/LeanPool/BollobasNikiforov/Kernel/Main.lean @@ -22,7 +22,7 @@ factorization of `docs/sol.tex` §3 (`lem:kernel`, `eq:factor`), and the resulting three-column completely positive Gram of `U`. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Kernel/N.lean b/LeanPool/BollobasNikiforov/Kernel/N.lean index ce725efdc9..59c9681e8b 100644 --- a/LeanPool/BollobasNikiforov/Kernel/N.lean +++ b/LeanPool/BollobasNikiforov/Kernel/N.lean @@ -22,7 +22,7 @@ The identity `N = det(I + Q W)` of `docs/sol.tex` §3, the factorization of for `x ≥ 0`. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -38,13 +38,13 @@ def fromThreeCols (c0 c1 c2 : Fin 3 → ℝ) : Matrix (Fin 3) (Fin 3) ℝ := fun i j => if j = 0 then c0 i else if j = 1 then c1 i else c2 i lemma fromThreeCols_apply_zero (c0 c1 c2 : Fin 3 → ℝ) (i : Fin 3) : - fromThreeCols c0 c1 c2 i 0 = c0 i := rfl + fromThreeCols c0 c1 c2 i 0 = c0 i := by rfl lemma fromThreeCols_apply_one (c0 c1 c2 : Fin 3 → ℝ) (i : Fin 3) : - fromThreeCols c0 c1 c2 i 1 = c1 i := rfl + fromThreeCols c0 c1 c2 i 1 = c1 i := by rfl lemma fromThreeCols_apply_two (c0 c1 c2 : Fin 3 → ℝ) (i : Fin 3) : - fromThreeCols c0 c1 c2 i 2 = c2 i := rfl + fromThreeCols c0 c1 c2 i 2 = c2 i := by rfl lemma fromThreeCols_add (u0 u1 u2 v0 v1 v2 : Fin 3 → ℝ) : fromThreeCols (u0 + v0) (u1 + v1) (u2 + v2) = diff --git a/LeanPool/BollobasNikiforov/Kernel/SM.lean b/LeanPool/BollobasNikiforov/Kernel/SM.lean index 416c6754dc..5f6be24a4d 100644 --- a/LeanPool/BollobasNikiforov/Kernel/SM.lean +++ b/LeanPool/BollobasNikiforov/Kernel/SM.lean @@ -17,7 +17,7 @@ The rank-one update `𝒦 = (𝒜 + VVᵀ/γ)⁻¹` expands as `𝒜⁻¹ - e₀ e₀ᵀ / (γ + a₀)`, using `𝒜⁻¹ V = e₀` and `V 0 = a₀`. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Kernel/Signs.lean b/LeanPool/BollobasNikiforov/Kernel/Signs.lean index f8d1557b03..0ca0158376 100644 --- a/LeanPool/BollobasNikiforov/Kernel/Signs.lean +++ b/LeanPool/BollobasNikiforov/Kernel/Signs.lean @@ -19,7 +19,7 @@ The expansions and nonnegativity statements for `P` and `Z` in `docs/sol.tex` § (`eq:functions`, after `eq:factor`). -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/M/Basic.lean b/LeanPool/BollobasNikiforov/M/Basic.lean index bdbedda03a..2714a3f66c 100644 --- a/LeanPool/BollobasNikiforov/M/Basic.lean +++ b/LeanPool/BollobasNikiforov/M/Basic.lean @@ -17,7 +17,7 @@ For a real matrix `X`, When `X` is positive semidefinite this is PSD and entrywise nonnegative. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -32,15 +32,15 @@ noncomputable section /-- The correction weight on the pair `{i,j}`: `(X i j)²` when `i < j` and the entry is negative, and `0` otherwise. -/ -def laplacianCoeff (X : Matrix n n ℝ) (i j : n) : ℝ := +@[expose] def laplacianCoeff (X : Matrix n n ℝ) (i j : n) : ℝ := if i < j ∧ X i j < 0 then (X i j) ^ 2 else 0 /-- The map of `docs/sol.tex` (eq:matrix). -/ -def M (X : Matrix n n ℝ) : Matrix n n ℝ := +@[expose] def M (X : Matrix n n ℝ) : Matrix n n ℝ := X ⊙ X + ∑ i, ∑ j, laplacianCoeff X i j • vecMulVec (e i - e j) (e i - e j) /-- The all-ones matrix, used as the Frobenius partner of `M`. -/ -def ones : Matrix n n ℝ := +@[expose] def ones : Matrix n n ℝ := of fun _ _ => 1 omit [Fintype n] [DecidableEq n] in diff --git a/LeanPool/BollobasNikiforov/M/Config.lean b/LeanPool/BollobasNikiforov/M/Config.lean index 8b37a878cd..384245bc6f 100644 --- a/LeanPool/BollobasNikiforov/M/Config.lean +++ b/LeanPool/BollobasNikiforov/M/Config.lean @@ -19,7 +19,7 @@ Indices are identified with `Option (Fin k) ⊕ Fin p` via `configIdxEquiv`: `Fin (k + 1 + p)`, which supplies `LinearOrder` for `M`. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -40,13 +40,13 @@ def configIdxEquiv (k p : ℕ) : ConfigIdx k p ≃ Option (Fin k) ⊕ Fin p := (Equiv.sumCongr (finSuccEquiv k) (Equiv.refl _)) /-- The `z₀` index (`none`). -/ -def idxZ0 : ConfigIdx k p := (configIdxEquiv k p).symm (Sum.inl none) +@[expose] def idxZ0 : ConfigIdx k p := (configIdxEquiv k p).symm (Sum.inl none) /-- The `zᵢ` index (`some i`). -/ -def idxZ (i : Fin k) : ConfigIdx k p := (configIdxEquiv k p).symm (Sum.inl (some i)) +@[expose] def idxZ (i : Fin k) : ConfigIdx k p := (configIdxEquiv k p).symm (Sum.inl (some i)) /-- The `yⱼ` index. -/ -def idxY (j : Fin p) : ConfigIdx k p := (configIdxEquiv k p).symm (Sum.inr j) +@[expose] def idxY (j : Fin p) : ConfigIdx k p := (configIdxEquiv k p).symm (Sum.inr j) lemma idxZ0_eq : (idxZ0 : ConfigIdx k p) = 0 := by simp only [idxZ0, configIdxEquiv, Equiv.symm_trans, Equiv.sumCongr_symm, Equiv.refl_symm, @@ -104,14 +104,14 @@ lemma sum_configIdx (f : ConfigIdx k p → ℝ) : /-! ### MX06 — configuration vectors and Gram matrix -/ /-- Feature vector `z₀ = (1, 0)`. -/ -def z0 : Fin 2 → ℝ := ![1, 0] +@[expose] def z0 : Fin 2 → ℝ := ![1, 0] /-- Feature vector `zᵢ = √sᵢ (-1, tᵢ)`. -/ -def zVec (s t : Fin k → ℝ) (i : Fin k) : Fin 2 → ℝ := +@[expose] def zVec (s t : Fin k → ℝ) (i : Fin k) : Fin 2 → ℝ := ![ -Real.sqrt (s i), Real.sqrt (s i) * t i ] /-- Feature vector `yⱼ = √ρⱼ (xⱼ, 1)`. -/ -def yVec (ρ x : Fin p → ℝ) (j : Fin p) : Fin 2 → ℝ := +@[expose] def yVec (ρ x : Fin p → ℝ) (j : Fin p) : Fin 2 → ℝ := ![ Real.sqrt (ρ j) * x j, Real.sqrt (ρ j) ] @[simp] lemma z0_zero : z0 0 = 1 := rfl @@ -126,7 +126,7 @@ def yVec (ρ x : Fin p → ℝ) (j : Fin p) : Fin 2 → ℝ := yVec ρ x j 1 = Real.sqrt (ρ j) := by simp [yVec] /-- The assembled configuration on `ConfigIdx`. -/ -def configVec (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def configVec (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : ConfigIdx k p → Fin 2 → ℝ := fun α => match configIdxEquiv k p α with @@ -152,7 +152,7 @@ def configMat (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : fun α c => configVec s t ρ x α c /-- Gram matrix of the configuration. -/ -def Xconfig (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def Xconfig (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : Matrix (ConfigIdx k p) (ConfigIdx k p) ℝ := fun a b => configVec s t ρ x a ⬝ᵥ configVec s t ρ x b @@ -229,15 +229,15 @@ lemma Xconfig_z_y (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) (j : /-! ### MX07 — auxiliary scalars -/ /-- `Hᵢ = ∑ⱼ ρⱼ (xⱼ - tᵢ)₊²`. -/ -def configH (t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) : ℝ := +@[expose] def configH (t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) : ℝ := ∑ j, ρ j * (max (x j - t i) 0) ^ 2 /-- `dᵢ = 1 + Hᵢ`. -/ -def configD (t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) : ℝ := +@[expose] def configD (t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) : ℝ := 1 + configH t ρ x i /-- `σ = ∑ᵢ sᵢ`. -/ -def configσ (s : Fin k → ℝ) : ℝ := +@[expose] def configσ (s : Fin k → ℝ) : ℝ := ∑ i, s i lemma configH_nonneg (t : Fin k → ℝ) {ρ : Fin p → ℝ} (hρ : ∀ j, 0 < ρ j) diff --git a/LeanPool/BollobasNikiforov/M/Elim.lean b/LeanPool/BollobasNikiforov/M/Elim.lean index 5167ee884e..b3077b7a38 100644 --- a/LeanPool/BollobasNikiforov/M/Elim.lean +++ b/LeanPool/BollobasNikiforov/M/Elim.lean @@ -29,7 +29,7 @@ products of those columns yield a completely positive `C₀` (EL12). The remainder is the `T`-Schur complement of `E` and is PSD (EL13–EL14). -/ -@[expose] public section +public section open Matrix Function @@ -1222,12 +1222,12 @@ lemma MX_isSymm (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : isHermitian_iff_isSymm.mp (MX_isHermitian s t ρ x) /-- `E`-embedding: `none` is `z₀`, `some i` is `zᵢ`. -/ -def elimEEmbed : Option (Fin k) → ConfigIdx k p +@[expose] def elimEEmbed : Option (Fin k) → ConfigIdx k p | none => idxZ0 | some i => idxZ i /-- `T`-embedding: the `y`-indices. -/ -def elimT : Fin p → ConfigIdx k p := idxY +@[expose] def elimT : Fin p → ConfigIdx k p := idxY lemma elimEEmbed_none : elimEEmbed (p := p) (none : Option (Fin k)) = idxZ0 := rfl lemma elimEEmbed_some (i : Fin k) : elimEEmbed (p := p) (some i) = idxZ i := rfl @@ -1252,29 +1252,29 @@ lemma elimEEmbed_ne_elimT (a : Option (Fin k)) (j : Fin p) : /-- The `E`-block of `M (Xconfig s t ρ x)`: rows and columns indexed by the axis vector and the left vectors through `elimEEmbed`. -/ -def elimEE (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def elimEE (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : Matrix (Option (Fin k)) (Option (Fin k)) ℝ := (M (Xconfig s t ρ x)).submatrix elimEEmbed elimEEmbed /-- The block of `M (Xconfig s t ρ x)` with `E`-rows (via `elimEEmbed`) and right-vector columns (via `elimT`). -/ -def elimET (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def elimET (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : Matrix (Option (Fin k)) (Fin p) ℝ := (M (Xconfig s t ρ x)).submatrix elimEEmbed elimT /-- The block of `M (Xconfig s t ρ x)` with right-vector rows (via `elimT`) and `E`-columns (via `elimEEmbed`). -/ -def elimTE (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def elimTE (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : Matrix (Fin p) (Option (Fin k)) ℝ := (M (Xconfig s t ρ x)).submatrix elimT elimEEmbed /-- The right-vector block of `M (Xconfig s t ρ x)`: rows and columns indexed through `elimT`. -/ -def elimTT (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def elimTT (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : Matrix (Fin p) (Fin p) ℝ := (M (Xconfig s t ρ x)).submatrix elimT elimT lemma elimEE_none_none (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : - elimEE s t ρ x none none = M (Xconfig s t ρ x) idxZ0 idxZ0 := rfl + elimEE s t ρ x none none = M (Xconfig s t ρ x) idxZ0 idxZ0 := by rfl lemma elimEE_none_some (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) : elimEE s t ρ x none (some i) = 0 := @@ -1286,7 +1286,7 @@ lemma elimEE_some_none (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i : Fin k) lemma elimEE_some_some (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) (i h : Fin k) : elimEE s t ρ x (some i) (some h) = - M (Xconfig s t ρ x) (idxZ i) (idxZ h) := rfl + M (Xconfig s t ρ x) (idxZ i) (idxZ h) := by rfl lemma elimEE_isHermitian (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : (elimEE s t ρ x).IsHermitian := @@ -1363,7 +1363,7 @@ lemma M_submatrix_sumElim (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : cases i <;> cases j <;> rfl /-- Schur complement of the `E`-block in the `T`-block. -/ -def elimSchurR (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : +@[expose] def elimSchurR (s t : Fin k → ℝ) (ρ x : Fin p → ℝ) : Matrix (Fin p) (Fin p) ℝ := elimTT s t ρ x - elimTE s t ρ x * (elimEE s t ρ x)⁻¹ * elimET s t ρ x diff --git a/LeanPool/BollobasNikiforov/M/GammaZero.lean b/LeanPool/BollobasNikiforov/M/GammaZero.lean index 2cc12b46ea..073aa5eb0b 100644 --- a/LeanPool/BollobasNikiforov/M/GammaZero.lean +++ b/LeanPool/BollobasNikiforov/M/GammaZero.lean @@ -22,7 +22,7 @@ Closedness of the CP cone upgrades SC18 on the enlargements to CP of the original `M`, including the case `p = 0` (SC21). -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -60,10 +60,10 @@ noncomputable def configXstar (t : Fin k → ℝ) : ℝ := | 0, _ => 0 | _ + 1, t => univ.sup' univ_nonempty t + 1 -lemma configXstar_zero (t : Fin 0 → ℝ) : configXstar t = 0 := rfl +lemma configXstar_zero (t : Fin 0 → ℝ) : configXstar t = 0 := by rfl lemma configXstar_succ {n : ℕ} (t : Fin (n + 1) → ℝ) : - configXstar t = univ.sup' univ_nonempty t + 1 := rfl + configXstar t = univ.sup' univ_nonempty t + 1 := by rfl lemma configXstar_nonneg {t : Fin k → ℝ} (ht : ∀ i, 0 < t i) : 0 ≤ configXstar t := by diff --git a/LeanPool/BollobasNikiforov/M/HalfPlane.lean b/LeanPool/BollobasNikiforov/M/HalfPlane.lean index 2f5203300c..7e3b5a0593 100644 --- a/LeanPool/BollobasNikiforov/M/HalfPlane.lean +++ b/LeanPool/BollobasNikiforov/M/HalfPlane.lean @@ -25,7 +25,7 @@ MX06 configuration (`k ≥ 1`). Unique and tied open-half-plane configurations are completely positive (HP04–HP05), as is the closed half-plane (HP06). -/ -@[expose] public section +public section open Matrix Filter open scoped Matrix Topology @@ -38,7 +38,7 @@ variable {n : Type*} [Fintype n] [DecidableEq n] [LinearOrder n] noncomputable section /-- The Gram matrix of a family of planar vectors. -/ -def gram (z : n → Fin 2 → ℝ) : Matrix n n ℝ := +@[expose] def gram (z : n → Fin 2 → ℝ) : Matrix n n ℝ := of fun i j => z i ⬝ᵥ z j omit [Fintype n] [DecidableEq n] [LinearOrder n] in diff --git a/LeanPool/BollobasNikiforov/M/Main.lean b/LeanPool/BollobasNikiforov/M/Main.lean index 9effb71582..4ebdb7e3c0 100644 --- a/LeanPool/BollobasNikiforov/M/Main.lean +++ b/LeanPool/BollobasNikiforov/M/Main.lean @@ -14,7 +14,7 @@ If planar vectors lie in a closed half-plane, `M` of their Gram matrix is completely positive (`thm:matrix`). -/ -@[expose] public section +public section open Matrix diff --git a/LeanPool/BollobasNikiforov/M/Schur.lean b/LeanPool/BollobasNikiforov/M/Schur.lean index 8ccd97c72d..7dc681d7b0 100644 --- a/LeanPool/BollobasNikiforov/M/Schur.lean +++ b/LeanPool/BollobasNikiforov/M/Schur.lean @@ -25,7 +25,7 @@ rows by `(F_E, 𝒰)`, the Schur complement of the first block is (paper (eq:Schur)). -/ -@[expose] public section +public section open Matrix open scoped Matrix @@ -1708,7 +1708,7 @@ lemma configLred_eq_weightedLaplacian (hs : ∀ i, 0 < s i) (hρ : ∀ j, 0 < ρ lemma configEEmbed_eq_elimEEmbed : (configEEmbed : Option (Fin k) → ConfigIdx k p) = elimEEmbed := - rfl + by rfl lemma configLEE_isSymm : (configLEE s t ρ x).IsSymm := by ext a b diff --git a/LeanPool/BollobasNikiforov/MS/Basic.lean b/LeanPool/BollobasNikiforov/MS/Basic.lean index a33db5b79e..3daa6a1959 100644 --- a/LeanPool/BollobasNikiforov/MS/Basic.lean +++ b/LeanPool/BollobasNikiforov/MS/Basic.lean @@ -19,7 +19,7 @@ nonnegative orthant by the Turán factor `1 - 1/ω(G)`, and the same bound passes to the Frobenius pairing against a completely positive matrix. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Main.lean b/LeanPool/BollobasNikiforov/Main.lean index a98a37af9f..f0f9a1bb10 100644 --- a/LeanPool/BollobasNikiforov/Main.lean +++ b/LeanPool/BollobasNikiforov/Main.lean @@ -19,7 +19,7 @@ multiplicity. Completeness is `G = ⊤`; the hypothesis `G ≠ ⊤` is the paper noncomplete assumption. `[Nontrivial V]` is the paper's `n ≥ 2`. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Spectral/Conic.lean b/LeanPool/BollobasNikiforov/Spectral/Conic.lean index 42f29f3ed2..fc7f692b5e 100644 --- a/LeanPool/BollobasNikiforov/Spectral/Conic.lean +++ b/LeanPool/BollobasNikiforov/Spectral/Conic.lean @@ -21,7 +21,7 @@ the mass of `X ⊙ X` off those edges equals `1`. The feasible set is nonempty and compact, so the supremum is attained. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -43,7 +43,7 @@ def offEdgeMatrix (G : SimpleGraph V) [DecidableRel G.Adj] : Matrix V V ℝ := omit [Fintype V] [DecidableEq V] in lemma onesMatrix_apply (i j : V) : onesMatrix i j = 1 := - rfl + by rfl omit [Fintype V] in lemma offEdgeMatrix_apply (i j : V) : @@ -388,7 +388,7 @@ noncomputable def cliqueGram (s : Finset V) : Matrix V V ℝ := omit [Fintype V] in lemma cliqueIndicator_apply (s : Finset V) (i : V) : cliqueIndicator s i = if i ∈ s then (1 : ℝ) else 0 := - rfl + by rfl omit [Fintype V] in lemma cliqueGram_apply (s : Finset V) (i j : V) : diff --git a/LeanPool/BollobasNikiforov/Spectral/Gram.lean b/LeanPool/BollobasNikiforov/Spectral/Gram.lean index fc8164b111..7ebcc7c362 100644 --- a/LeanPool/BollobasNikiforov/Spectral/Gram.lean +++ b/LeanPool/BollobasNikiforov/Spectral/Gram.lean @@ -26,7 +26,7 @@ with `BollobasNikiforov.MS.Basic` (pulled in by `Weighted`), and also overlaps W `GramAux`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/BollobasNikiforov/Spectral/Interlace.lean b/LeanPool/BollobasNikiforov/Spectral/Interlace.lean index 8bbcde6944..e17c9cf442 100644 --- a/LeanPool/BollobasNikiforov/Spectral/Interlace.lean +++ b/LeanPool/BollobasNikiforov/Spectral/Interlace.lean @@ -18,7 +18,7 @@ is not complete, and therefore `F(A_G) = lambda1 G ^ 2 + lambda2 G ^ 2`. The largest eigenvalue is nonnegative for every finite graph, complete or not. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Spectral/Perron.lean b/LeanPool/BollobasNikiforov/Spectral/Perron.lean index 3d0b8b1eab..03d1c55c71 100644 --- a/LeanPool/BollobasNikiforov/Spectral/Perron.lean +++ b/LeanPool/BollobasNikiforov/Spectral/Perron.lean @@ -14,7 +14,7 @@ A real symmetric entrywise-nonnegative matrix has a nonnegative unit maximizer o Rayleigh quotient, and that maximizer is an eigenvector for `lambdaMax`. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/Spectral/Weighted.lean b/LeanPool/BollobasNikiforov/Spectral/Weighted.lean index 3f7e355f61..9d0fe447e9 100644 --- a/LeanPool/BollobasNikiforov/Spectral/Weighted.lean +++ b/LeanPool/BollobasNikiforov/Spectral/Weighted.lean @@ -24,7 +24,7 @@ the closed right half-plane. If `B` is zero-diagonal and supported on `E(G)`, the Motzkin–Straus bound on `M X` yields `F B ≤ turanFactor G * ⟨B, B⟩`. -/ -@[expose] public section +public section namespace BollobasNikiforov diff --git a/LeanPool/BollobasNikiforov/TN/Basic.lean b/LeanPool/BollobasNikiforov/TN/Basic.lean index 951d6d6232..47f038b9ea 100644 --- a/LeanPool/BollobasNikiforov/TN/Basic.lean +++ b/LeanPool/BollobasNikiforov/TN/Basic.lean @@ -20,7 +20,7 @@ enumerating the `C(3, r)` strictly increasing maps `Fin r → Fin 3` (`r = 0,1,2,3`) and using rank for `r > 3`. -/ -@[expose] public section +public section open Function Matrix @@ -34,7 +34,7 @@ variable {m n : Type*} [LinearOrder m] [LinearOrder n] increasing row and column index maps has nonnegative determinant. The `k = 0` case is included: `Matrix.det_fin_zero` says the empty minor equals `1`. -/ -def IsTotallyNonneg (A : Matrix m n ℝ) : Prop := +@[expose] def IsTotallyNonneg (A : Matrix m n ℝ) : Prop := ∀ k : ℕ, ∀ I : Fin k → m, ∀ J : Fin k → n, StrictMono I → StrictMono J → 0 ≤ (A.submatrix I J).det diff --git a/LeanPool/BollobasNikiforov/TN/Convex.lean b/LeanPool/BollobasNikiforov/TN/Convex.lean index eb20594a6e..b7bab91180 100644 --- a/LeanPool/BollobasNikiforov/TN/Convex.lean +++ b/LeanPool/BollobasNikiforov/TN/Convex.lean @@ -18,7 +18,7 @@ Lemma `lem:convex` of `docs/sol.tex`: if `f : [0, ∞) → [0, ∞)` is convex a totally nonnegative. -/ -@[expose] public section +public section open Function Matrix Set @@ -66,7 +66,7 @@ lemma convexOn_Ici_zero_monotoneOn /-! ### TN15: size-one and size-two minors of rows `(1, t, f t)` -/ /-- The feature row `(1, t, f t)`. -/ -def row3 (f : ℝ → ℝ) (t : ℝ) : Fin 3 → ℝ := ![1, t, f t] +@[expose] def row3 (f : ℝ → ℝ) (t : ℝ) : Fin 3 → ℝ := ![1, t, f t] @[simp] lemma row3_zero (f : ℝ → ℝ) (t : ℝ) : row3 f t 0 = 1 := rfl @[simp] lemma row3_one (f : ℝ → ℝ) (t : ℝ) : row3 f t 1 = t := rfl @@ -74,7 +74,7 @@ def row3 (f : ℝ → ℝ) (t : ℝ) : Fin 3 → ℝ := ![1, t, f t] simp [row3, cons_val_two, vecHead, vecTail] /-- The `ι × 3` matrix whose `i`th row is `(1, t i, f (t i))`. -/ -def convexRowMatrix {ι : Type*} (f : ℝ → ℝ) (t : ι → ℝ) : Matrix ι (Fin 3) ℝ := +@[expose] def convexRowMatrix {ι : Type*} (f : ℝ → ℝ) (t : ι → ℝ) : Matrix ι (Fin 3) ℝ := fun i j ↦ row3 f (t i) j lemma row3_nonneg (hfnn : ∀ x, 0 ≤ x → 0 ≤ f x) {t : ℝ} (ht : 0 < t) (j : Fin 3) : diff --git a/LeanPool/BollobasNikiforov/TN/Truncated.lean b/LeanPool/BollobasNikiforov/TN/Truncated.lean index 83474c67f6..a5ae2c03ee 100644 --- a/LeanPool/BollobasNikiforov/TN/Truncated.lean +++ b/LeanPool/BollobasNikiforov/TN/Truncated.lean @@ -20,7 +20,7 @@ This file records the elementary algebraic facts about the kernels part is `max · 0`. -/ -@[expose] public section +public section namespace BollobasNikiforov @@ -33,12 +33,12 @@ def unrestrictedSquare (a : ι → ℝ) (t : κ → ℝ) : Matrix ι κ ℝ := fun i j => (t j - a i) ^ 2 /-- The truncated square kernel `(i, j) ↦ (t j - a i)₊²`. -/ -def truncatedSquare (a : ι → ℝ) (t : κ → ℝ) : Matrix ι κ ℝ := +@[expose] def truncatedSquare (a : ι → ℝ) (t : κ → ℝ) : Matrix ι κ ℝ := fun i j => (max (t j - a i) 0) ^ 2 @[simp] lemma unrestrictedSquare_apply (a : ι → ℝ) (t : κ → ℝ) (i : ι) (j : κ) : unrestrictedSquare a t i j = (t j - a i) ^ 2 := - rfl + by rfl @[simp] lemma truncatedSquare_apply (a : ι → ℝ) (t : κ → ℝ) (i : ι) (j : κ) : truncatedSquare a t i j = (max (t j - a i) 0) ^ 2 := @@ -234,7 +234,7 @@ lemma truncatedSquare_submatrix_eq {r c n m : ℕ} lemma unrestrictedSquare_submatrix_eq {r c n m : ℕ} (a : Fin r → ℝ) (t : Fin c → ℝ) (I : Fin n → Fin r) (J : Fin m → Fin c) : (unrestrictedSquare a t).submatrix I J = unrestrictedSquare (a ∘ I) (t ∘ J) := - rfl + by rfl lemma monotone_comp_of_monotone {α β γ : Type*} [Preorder α] [Preorder β] [Preorder γ] {f : β → γ} {g : α → β} (hf : Monotone f) (hg : Monotone g) : @@ -520,12 +520,12 @@ def stepKernel (a : ι → ℝ) (t : κ → ℝ) : Matrix ι κ ℝ := lemma stepKernel_apply (a : ι → ℝ) (t : κ → ℝ) (i : ι) (j : κ) : stepKernel a t i j = if a i ≤ t j then (1 : ℝ) else 0 := - rfl + by rfl lemma stepKernel_submatrix_eq {r c n m : ℕ} (a : Fin r → ℝ) (t : Fin c → ℝ) (I : Fin n → Fin r) (J : Fin m → Fin c) : (stepKernel a t).submatrix I J = stepKernel (a ∘ I) (t ∘ J) := - rfl + by rfl /-- Columns where the `i`-th step-row is one. -/ def stepSupport {n : ℕ} (a t : Fin n → ℝ) (i : Fin n) : Finset (Fin n) := diff --git a/LeanPool/BooleanIsoperimetry.lean b/LeanPool/BooleanIsoperimetry.lean index ac58e4c53c..1a08a66aa9 100644 --- a/LeanPool/BooleanIsoperimetry.lean +++ b/LeanPool/BooleanIsoperimetry.lean @@ -27,7 +27,7 @@ Tags: additive-combinatorics, isoperimetry, boolean-cube, subset-sums, coherent- MSC: 05D05, 05C35 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/BooleanIsoperimetry/Cascade.lean b/LeanPool/BooleanIsoperimetry/Cascade.lean index d2c750627a..c584a2d058 100644 --- a/LeanPool/BooleanIsoperimetry/Cascade.lean +++ b/LeanPool/BooleanIsoperimetry/Cascade.lean @@ -17,7 +17,7 @@ simplicial initial segments in the Boolean cube, including the slice recurrence for the Harper boundary function `H`. -/ -@[expose] public section +public section open scoped BigOperators @@ -31,25 +31,25 @@ taken from layer `r`. The final disjunct makes the decomposition canonical at layer boundaries: when a layer is completely full, we move to the next layer with residual `0`. -/ -def IsBinomialCascade (n k r t : ℕ) : Prop := +@[expose] def IsBinomialCascade (n k r t : ℕ) : Prop := r ≤ n + 1 ∧ t ≤ Nat.choose n r ∧ k = binomPrefix n r + t ∧ (t < Nat.choose n r ∨ r = n + 1) /-- The lower-slice size determined by cascade parameters `n`, `r`, and `t`. -/ -def cascadeSlice0Value (n r t : ℕ) : ℕ := +@[expose] def cascadeSlice0Value (n r t : ℕ) : ℕ := binomPrefix n r + (t - choosePred n r) /-- The upper-slice size determined by cascade parameters `n`, `r`, and `t`. -/ -def cascadeSlice1Value (n r t : ℕ) : ℕ := +@[expose] def cascadeSlice1Value (n r t : ℕ) : ℕ := binomPrefix n (r - 1) + min t (choosePred n r) /-- The algebraic lower/upper split for the canonical cascade of `k` in dimension `n + 1`. It is independent of `slice0`, `slice1`, `rank`, and neighborhoods. -/ -def CascadeSplit (n k p q : ℕ) : Prop := +@[expose] def CascadeSplit (n k p q : ℕ) : Prop := ∃ r t, IsBinomialCascade (n + 1) k r t ∧ p = cascadeSlice0Value n r t ∧ q = cascadeSlice1Value n r t diff --git a/LeanPool/BooleanIsoperimetry/CoherentGap.lean b/LeanPool/BooleanIsoperimetry/CoherentGap.lean index f8b808526e..b98c3bb839 100644 --- a/LeanPool/BooleanIsoperimetry/CoherentGap.lean +++ b/LeanPool/BooleanIsoperimetry/CoherentGap.lean @@ -28,7 +28,7 @@ The open-problem context and the exact boundary of this formalization are recorded separately in the Construct research notes. -/ -@[expose] public section +public section open scoped BigOperators @@ -38,20 +38,20 @@ namespace BooleanIsoperimetry.CoherentGap abbrev Relation (n : ℕ) := Fin n → ℤ /-- The coordinate sum of an integer relation. -/ -def coordinateSum {n : ℕ} (relation : Relation n) : ℤ := +@[expose] def coordinateSum {n : ℕ} (relation : Relation n) : ℤ := ∑ i, relation i /-- The scalar product of an integer relation with an integer weight row. -/ -def dot {n : ℕ} (relation weights : Relation n) : ℤ := +@[expose] def dot {n : ℕ} (relation weights : Relation n) : ℤ := ∑ i, relation i * weights i /-- The standard coordinate vector. -/ -def basis {n : ℕ} (coordinate : Fin n) : Relation n := +@[expose] def basis {n : ℕ} (coordinate : Fin n) : Relation n := fun i => if i = coordinate then 1 else 0 /-- A relation whose entries and coordinate sum lie in `{-1, 0, 1}` and whose value on the weight row is one. -/ -def IsLiftableUnit {n : ℕ} (weights relation : Relation n) : Prop := +@[expose] def IsLiftableUnit {n : ℕ} (weights relation : Relation n) : Prop := (∀ i, relation i = -1 ∨ relation i = 0 ∨ relation i = 1) ∧ dot relation weights = 1 ∧ (coordinateSum relation = -1 ∨ @@ -178,11 +178,11 @@ def Certificate.sum {n : ℕ} {weights : Relation n} : simpa using certificate.add (Certificate.sum certificates) /-- Add one coordinate at the front of a weight row. -/ -def extendWeights {n : ℕ} (head : ℤ) (weights : Relation n) : Relation (n + 1) := +@[expose] def extendWeights {n : ℕ} (head : ℤ) (weights : Relation n) : Relation (n + 1) := Fin.cases head fun i => head + weights i /-- Lift a relation by adding the negative coordinate sum at the front. -/ -def lift {n : ℕ} (relation : Relation n) : Relation (n + 1) := +@[expose] def lift {n : ℕ} (relation : Relation n) : Relation (n + 1) := Fin.cases (-coordinateSum relation) relation @[simp] @@ -210,13 +210,13 @@ lemma lift_aggregate {n : ℕ} (relations : List (Relation n)) : rw [inductionHypothesis, lift_add] /-- Iterate the dimension lift. -/ -def iteratedLift {n : ℕ} (relation : Relation n) : +@[expose] def iteratedLift {n : ℕ} (relation : Relation n) : (steps : ℕ) → Relation (n + steps) | 0 => relation | steps + 1 => lift (iteratedLift relation steps) /-- Transport a relation through an equality of dimensions. -/ -def castRelation {firstDimension secondDimension : ℕ} +@[expose] def castRelation {firstDimension secondDimension : ℕ} (hdimension : firstDimension = secondDimension) (relation : Relation firstDimension) : Relation secondDimension := by subst secondDimension @@ -346,7 +346,7 @@ lemma Correction.sourceOffset_lt {offset : ℕ} omega /-- The target contributed by a lifted smaller-dimensional basis certificate. -/ -def Correction.target {dimension : ℕ} +@[expose] def Correction.target {dimension : ℕ} (correction : Correction dimension) : Relation dimension := castRelation correction.dimension_eq (iteratedLift (basis correction.sourceCoordinate) correction.steps) @@ -453,7 +453,7 @@ noncomputable def recurrenceCertificates (tower : WeightTower) Classical.choice (recurrenceCertificate_exists tower recurrence n coordinate) /-- Pair an integer relation with a real candidate row. -/ -def realDot {n : ℕ} (relation : Relation n) (candidate : Fin n → ℝ) : ℝ := +@[expose] def realDot {n : ℕ} (relation : Relation n) (candidate : Fin n → ℝ) : ℝ := ∑ i, (relation i : ℝ) * candidate i lemma realDot_add {n : ℕ} (first second : Relation n) diff --git a/LeanPool/BooleanIsoperimetry/Compression.lean b/LeanPool/BooleanIsoperimetry/Compression.lean index 27f291dc84..6ca4ed0076 100644 --- a/LeanPool/BooleanIsoperimetry/Compression.lean +++ b/LeanPool/BooleanIsoperimetry/Compression.lean @@ -24,7 +24,7 @@ families in the Boolean cube, connecting compressed families to canonical simplicial initial segments. -/ -@[expose] public section +public section open scoped BigOperators open scoped FinsetFamily diff --git a/LeanPool/BooleanIsoperimetry/ConwayGuyCoherentGap.lean b/LeanPool/BooleanIsoperimetry/ConwayGuyCoherentGap.lean index e1d916fcf3..73bdb6d6a2 100644 --- a/LeanPool/BooleanIsoperimetry/ConwayGuyCoherentGap.lean +++ b/LeanPool/BooleanIsoperimetry/ConwayGuyCoherentGap.lean @@ -18,14 +18,14 @@ Conway--Guy distinct-subset-sum sequence. The recurrence and notation follow Section 2 of Tom Bohman's 1996 paper on the Conway--Guy sequence. -/ -@[expose] public section +public section open scoped BigOperators namespace BooleanIsoperimetry.CoherentGap /-- The triangular numbers, indexed from zero. -/ -def triangular : ℕ → ℕ +@[expose] def triangular : ℕ → ℕ | 0 => 0 | index + 1 => triangular index + index + 1 @@ -60,7 +60,7 @@ theorem guideWitness (dimension : ℕ) : ⟨dimension, (Nat.sub_le dimension 1).trans (self_le_triangular dimension)⟩ /-- The least triangular block containing `dimension - 1`. -/ -noncomputable def guide (dimension : ℕ) : ℕ := +@[expose] noncomputable def guide (dimension : ℕ) : ℕ := Nat.find (guideWitness dimension) lemma guide_upper (dimension : ℕ) : @@ -409,7 +409,7 @@ lemma principal_corrections_decomposition (offset : ℕ) : abel /-- The one-indexed Conway--Guy recurrence, stored with zero-based indices. -/ -def difference (blockGuide : ℕ → ℕ) : ℕ → ℕ +@[expose] def difference (blockGuide : ℕ → ℕ) : ℕ → ℕ | 0 => 1 | index + 1 => ∑ offset ∈ Finset.range (blockGuide (index + 2)), @@ -418,11 +418,11 @@ termination_by index => index decreasing_by omega /-- The Conway--Guy difference sequence using the triangular block guide. -/ -noncomputable def conwayGuyDifference (index : ℕ) : ℕ := +@[expose] noncomputable def conwayGuyDifference (index : ℕ) : ℕ := difference guide index /-- The cumulative Conway--Guy heights. -/ -noncomputable def conwayGuyHeight (dimension : ℕ) : ℤ := +@[expose] noncomputable def conwayGuyHeight (dimension : ℕ) : ℤ := ∑ index ∈ Finset.range dimension, (conwayGuyDifference index : ℤ) @[simp] @@ -448,13 +448,13 @@ structure ConwayGuyArithmetic where height_zero : height 0 = 0 /-- The arithmetic data of the actual Conway--Guy sequence. -/ -noncomputable def conwayGuyArithmetic : ConwayGuyArithmetic where +@[expose] noncomputable def conwayGuyArithmetic : ConwayGuyArithmetic where guide := guide height := conwayGuyHeight height_zero := conwayGuyHeight_zero /-- The increasing Conway--Guy-style row obtained from cumulative heights. -/ -def ConwayGuyArithmetic.weights (data : ConwayGuyArithmetic) +@[expose] def ConwayGuyArithmetic.weights (data : ConwayGuyArithmetic) (dimension : ℕ) : Relation dimension := fun coordinate => data.height dimension - @@ -484,7 +484,7 @@ lemma ConwayGuyArithmetic.weights_step (data : ConwayGuyArithmetic) ring /-- The exact Conway--Guy-style dimension-lift tower. -/ -def ConwayGuyArithmetic.tower (data : ConwayGuyArithmetic) : WeightTower where +@[expose] def ConwayGuyArithmetic.tower (data : ConwayGuyArithmetic) : WeightTower where weights := data.weights head := data.head step := data.weights_step diff --git a/LeanPool/BooleanIsoperimetry/ConwayGuyHeight.lean b/LeanPool/BooleanIsoperimetry/ConwayGuyHeight.lean index df33fb5cdf..0dbb2f5158 100644 --- a/LeanPool/BooleanIsoperimetry/ConwayGuyHeight.lean +++ b/LeanPool/BooleanIsoperimetry/ConwayGuyHeight.lean @@ -21,7 +21,7 @@ This file derives the height identity used by every Conway--Guy principal relation directly from the published difference recurrence. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/BooleanIsoperimetry/ConwayGuyOrderBridge.lean b/LeanPool/BooleanIsoperimetry/ConwayGuyOrderBridge.lean index c1f96482b9..ea1de6c3b4 100644 --- a/LeanPool/BooleanIsoperimetry/ConwayGuyOrderBridge.lean +++ b/LeanPool/BooleanIsoperimetry/ConwayGuyOrderBridge.lean @@ -28,7 +28,7 @@ order. The bridge itself only uses integrality: two subset sums differing by one have no integer subset sum strictly between them. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/BooleanIsoperimetry/ConwayGuyRigidity.lean b/LeanPool/BooleanIsoperimetry/ConwayGuyRigidity.lean index 64ef6f74cb..49f6a600c7 100644 --- a/LeanPool/BooleanIsoperimetry/ConwayGuyRigidity.lean +++ b/LeanPool/BooleanIsoperimetry/ConwayGuyRigidity.lean @@ -21,7 +21,7 @@ corrections as a `FirstCoordinateRecurrence`. The separate height identity supplies the one remaining arithmetic input. -/ -@[expose] public section +public section namespace BooleanIsoperimetry.CoherentGap diff --git a/LeanPool/BooleanIsoperimetry/Cube.lean b/LeanPool/BooleanIsoperimetry/Cube.lean index e65f1e9f22..a1ac8caf6e 100644 --- a/LeanPool/BooleanIsoperimetry/Cube.lean +++ b/LeanPool/BooleanIsoperimetry/Cube.lean @@ -20,7 +20,7 @@ simplicial order, initial segments, slicing maps, and the Harper boundary function `H`. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,7 +30,7 @@ namespace BooleanIsoperimetry abbrev Cube (n : ℕ) := Finset (Fin n) /-- The Hamming distance between two Boolean-cube vertices. -/ -noncomputable def hDist {n : ℕ} (x y : Cube n) : ℕ := +@[expose] noncomputable def hDist {n : ℕ} (x y : Cube n) : ℕ := (symmDiff x y).card /-- The closed Hamming `r`-neighborhood of a family of cube vertices. -/ @@ -47,15 +47,15 @@ noncomputable def hammingBall {n : ℕ} (r : ℕ) : Finset (Cube n) := Finset.univ.filter (fun v => v.card ≤ r) /-- The binary encoding used to break ties in the simplicial order. -/ -noncomputable def cubeToNat {n : ℕ} (x : Cube n) : ℕ := +@[expose] noncomputable def cubeToNat {n : ℕ} (x : Cube n) : ℕ := ∑ i ∈ x, 2 ^ (i : ℕ) /-- The non-strict simplicial order: first by weight, then by reverse binary order. -/ -def simplicialLe {n : ℕ} (x y : Cube n) : Prop := +@[expose] def simplicialLe {n : ℕ} (x y : Cube n) : Prop := x.card < y.card ∨ (x.card = y.card ∧ cubeToNat y ≤ cubeToNat x) /-- The strict simplicial order on Boolean-cube vertices. -/ -def simplicialLt {n : ℕ} (x y : Cube n) : Prop := +@[expose] def simplicialLt {n : ℕ} (x y : Cube n) : Prop := simplicialLe x y ∧ ¬simplicialLe y x -- ========================================== @@ -202,12 +202,12 @@ lemma simplicialLe_total {n : ℕ} (a b : Cube n) : simplicialLe a b ∨ simplic open Classical in /-- The zero-based position of a vertex in the simplicial order. -/ -noncomputable def rank {n : ℕ} (x : Cube n) : ℕ := +@[expose] noncomputable def rank {n : ℕ} (x : Cube n) : ℕ := (Finset.univ.filter (fun y => simplicialLt y x)).card open Classical in /-- The first `k` vertices of the `n`-cube in simplicial order. -/ -noncomputable def simplicialInitSeg (n : ℕ) (k : ℕ) : Finset (Cube n) := +@[expose] noncomputable def simplicialInitSeg (n : ℕ) (k : ℕ) : Finset (Cube n) := Finset.univ.filter (fun x => rank x < k) /- @@ -291,19 +291,19 @@ lemma card_simplicialInitSeg {n k : ℕ} : -- ========================================== /-- Embed an `n`-cube vertex in dimension `n + 1` with last coordinate zero. -/ -noncomputable def embed0 {n : ℕ} (x : Cube n) : Cube (n + 1) := +@[expose] noncomputable def embed0 {n : ℕ} (x : Cube n) : Cube (n + 1) := x.image Fin.castSucc /-- Embed an `n`-cube vertex in dimension `n + 1` with last coordinate one. -/ -noncomputable def embed1 {n : ℕ} (x : Cube n) : Cube (n + 1) := +@[expose] noncomputable def embed1 {n : ℕ} (x : Cube n) : Cube (n + 1) := insert (Fin.last n) (x.image Fin.castSucc) /-- The lower slice of a family in dimension `n + 1`. -/ -noncomputable def slice0 {n : ℕ} (A : Finset (Cube (n + 1))) : Finset (Cube n) := +@[expose] noncomputable def slice0 {n : ℕ} (A : Finset (Cube (n + 1))) : Finset (Cube n) := Finset.univ.filter (fun x => embed0 x ∈ A) /-- The upper slice of a family in dimension `n + 1`. -/ -noncomputable def slice1 {n : ℕ} (A : Finset (Cube (n + 1))) : Finset (Cube n) := +@[expose] noncomputable def slice1 {n : ℕ} (A : Finset (Cube (n + 1))) : Finset (Cube n) := Finset.univ.filter (fun x => embed1 x ∈ A) /- @@ -487,7 +487,7 @@ lemma neighborhood_succ {n : ℕ} (A : Finset (Cube (n + 1))) : -- ========================================== /-- The size of the radius-one neighborhood of the simplicial initial segment of size `k`. -/ -noncomputable def H (n k : ℕ) : ℕ := +@[expose] noncomputable def H (n k : ℕ) : ℕ := (neighborhood 1 (simplicialInitSeg n k)).card -- Basic algebraic properties of H @@ -550,7 +550,7 @@ lemma rank_mono {n : ℕ} {a b : Cube n} (h : simplicialLe a b) : rank a ≤ ran exact le_of_lt (rank_strictMono h_lt) /-- Remove the least active coordinate, giving the lowest-rank vertex in the closed unit ball. -/ -noncomputable def gShift {n : ℕ} (v : Cube n) : Cube n := +@[expose] noncomputable def gShift {n : ℕ} (v : Cube n) : Cube n := if h : v.Nonempty then v.erase (v.min' h) else v /- @@ -951,11 +951,11 @@ lemma H_succ_slice {n k : ℕ} : -- ========================================== /-- The sum of the first `r` binomial coefficients in row `n`. -/ -def binomPrefix (n r : ℕ) : ℕ := +@[expose] def binomPrefix (n r : ℕ) : ℕ := (Finset.range r).sum (fun i => Nat.choose n i) /-- The binomial coefficient immediately preceding layer `r`, with value zero at `r = 0`. -/ -def choosePred (n r : ℕ) : ℕ := +@[expose] def choosePred (n r : ℕ) : ℕ := if r = 0 then 0 else Nat.choose n (r - 1) end BooleanIsoperimetry diff --git a/LeanPool/BooleanIsoperimetry/Harper.lean b/LeanPool/BooleanIsoperimetry/Harper.lean index 749c7812c2..62438d9696 100644 --- a/LeanPool/BooleanIsoperimetry/Harper.lean +++ b/LeanPool/BooleanIsoperimetry/Harper.lean @@ -22,7 +22,7 @@ This file assembles the compression, Macaulay, Kruskal-Katona, and scalar recurrence layers into the final sorry-free proof of Harper's theorem. -/ -@[expose] public section +public section open scoped BigOperators @@ -2159,8 +2159,17 @@ Base case of Harper's theorem (dimension 0). lemma harper_base (A : Finset (Cube 0)) (k : ℕ) (hk : A.card = k) : (neighborhood 1 (simplicialInitSeg 0 k)).card ≤ (neighborhood 1 A).card := by subst hk - fin_cases A <;> - simp +decide [simplicialInitSeg, Finset.filter_singleton, rank, simplicialLt, simplicialLe] + have hdefault : (default : Cube 0) = ∅ := by + ext i + exact i.elim0 + fin_cases A + · simp +decide [hdefault, simplicialInitSeg, Finset.filter_singleton, rank, + simplicialLt, simplicialLe] + · apply le_of_eq + congr 1 + simp +decide [hdefault, simplicialInitSeg, Finset.filter_singleton, rank, + simplicialLt, simplicialLe] + rfl theorem harper_theorem (n : ℕ) (A : Finset (Cube n)) (k : ℕ) (hk : A.card = k) : (neighborhood 1 (simplicialInitSeg n k)).card ≤ (neighborhood 1 A).card := by diff --git a/LeanPool/BooleanIsoperimetry/KruskalKatona.lean b/LeanPool/BooleanIsoperimetry/KruskalKatona.lean index a7b215243b..09342760b2 100644 --- a/LeanPool/BooleanIsoperimetry/KruskalKatona.lean +++ b/LeanPool/BooleanIsoperimetry/KruskalKatona.lean @@ -23,7 +23,7 @@ This file proves the set-family upper-shadow minimization theorem used by the Boolean-isoperimetry argument. -/ -@[expose] public section +public section open scoped BigOperators open scoped FinsetFamily @@ -50,7 +50,7 @@ def layer (N r : ℕ) : Finset (Cube N) := /-- Local numeric upper-shadow value (identical to `Shadow.upperShadow` but defined here so the Kruskal–Katona core is strictly upstream of `Shadow.lean`): `upperShadowVal N r t = H N (binomPrefix N r + t) - binomPrefix N (r+1)`. -/ -noncomputable def upperShadowVal (N r t : ℕ) : ℕ := +@[expose] noncomputable def upperShadowVal (N r t : ℕ) : ℕ := H N (binomPrefix N r + t) - binomPrefix N (r + 1) /-- The layer-`r` part of the simplicial initial segment with local size `t`. -/ @@ -58,7 +58,7 @@ noncomputable def layerInitSeg (N r t : ℕ) : Finset (Cube N) := (simplicialInitSeg N (binomPrefix N r + t)).filter (fun x => x.card = r) /-- The layer-`r + 1` upper shadow of a uniform family in layer `r`. -/ -noncomputable def upperLayerShadow (N r : ℕ) (A : Finset (Cube N)) : Finset (Cube N) := +@[expose] noncomputable def upperLayerShadow (N r : ℕ) (A : Finset (Cube N)) : Finset (Cube N) := (Finset.upShadow A).filter (fun x => x.card = r + 1) lemma binomPrefix_eq_card_lt (N r : ℕ) : diff --git a/LeanPool/BooleanIsoperimetry/LayerWindows.lean b/LeanPool/BooleanIsoperimetry/LayerWindows.lean index 57c7cb292f..657fa1a118 100644 --- a/LeanPool/BooleanIsoperimetry/LayerWindows.lean +++ b/LeanPool/BooleanIsoperimetry/LayerWindows.lean @@ -31,7 +31,7 @@ Kruskal–Katona core operates on — not an opaque scalar. The pair functional `initSegPairLayerWindowCost` then assembles the two slice costs exactly the way `PairShadowCost` does on simplicial initial segments. -/ -@[expose] public section +public section namespace BooleanIsoperimetry @@ -107,11 +107,11 @@ each slice's boundary is the layer-window neighborhood cost `max (H N a) b + max (H N b) a` on initial segments, but it is *defined* through the explicit per-layer windows so the cross-slice Kruskal–Katona minimization can be carried out layer by layer. -/ -noncomputable def initSegPairLayerWindowCost (N a b : ℕ) : ℕ := +@[expose] noncomputable def initSegPairLayerWindowCost (N a b : ℕ) : ℕ := max (neighborhoodLayerCost N a) b + max (neighborhoodLayerCost N b) a /-- The number of layer-`r` sets in the initial segment of size `a`. -/ -noncomputable def layerWindowRemainder (N r a : ℕ) : ℕ := +@[expose] noncomputable def layerWindowRemainder (N r a : ℕ) : ℕ := layerCount N r (simplicialInitSeg N a) /-- The number of layer-`r` sets in the neighborhood of the initial segment of size `a`. @@ -120,7 +120,7 @@ noncomputable def layerWindowShadowCost (N r a : ℕ) : ℕ := layerCount N r (neighborhood 1 (simplicialInitSeg N a)) /-- The cross-slice layer window cost for a single Hamming layer `r`. -/ -noncomputable def PairLayerWindowCost (N r a b : ℕ) : ℕ := +@[expose] noncomputable def PairLayerWindowCost (N r a b : ℕ) : ℕ := max (layerWindowShadowCost N r a) (layerWindowRemainder N r b) + max (layerWindowShadowCost N r b) (layerWindowRemainder N r a) diff --git a/LeanPool/BooleanIsoperimetry/Macaulay.lean b/LeanPool/BooleanIsoperimetry/Macaulay.lean index cd354b4098..f4ad4a48e4 100644 --- a/LeanPool/BooleanIsoperimetry/Macaulay.lean +++ b/LeanPool/BooleanIsoperimetry/Macaulay.lean @@ -23,7 +23,7 @@ This file develops the increment profile of the Harper boundary function and the nested-cascade inequalities used by the final minimization argument. -/ -@[expose] public section +public section open scoped BigOperators @@ -965,7 +965,7 @@ inequality (two different splits can have identical prefix masses but distinct boundary costs), which is why the cascade profile of `(p, q)` is recorded as well. -/ -def CascadeInterleaves (n p q a b : ℕ) : Prop := +@[expose] def CascadeInterleaves (n p q a b : ℕ) : Prop := CascadeSplit n (a + b) p q ∧ ∀ l, splitPrefixMass n a b l ≤ splitPrefixMass n p q l diff --git a/LeanPool/BooleanIsoperimetry/MacaulayMin.lean b/LeanPool/BooleanIsoperimetry/MacaulayMin.lean index d7350b76c0..b077504535 100644 --- a/LeanPool/BooleanIsoperimetry/MacaulayMin.lean +++ b/LeanPool/BooleanIsoperimetry/MacaulayMin.lean @@ -22,7 +22,7 @@ This file packages the set-family compression and shadow estimates into scalar Macaulay minimization lemmas consumed by the final Harper theorem. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/BooleanIsoperimetry/SetFamilyShadow.lean b/LeanPool/BooleanIsoperimetry/SetFamilyShadow.lean index 0b6cb1dc68..0a903ca6f8 100644 --- a/LeanPool/BooleanIsoperimetry/SetFamilyShadow.lean +++ b/LeanPool/BooleanIsoperimetry/SetFamilyShadow.lean @@ -20,7 +20,7 @@ This file exposes thin numeric corollaries of the upstream Kruskal-Katona upper-shadow theorem in the notation used by the Harper proof. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/BooleanIsoperimetry/Shadow.lean b/LeanPool/BooleanIsoperimetry/Shadow.lean index 99f1c9f8be..fa4262e219 100644 --- a/LeanPool/BooleanIsoperimetry/Shadow.lean +++ b/LeanPool/BooleanIsoperimetry/Shadow.lean @@ -21,7 +21,7 @@ This file connects Kruskal-Katona upper-shadow estimates to the Macaulay exchange inequalities used in Harper's theorem. -/ -@[expose] public section +public section open scoped BigOperators @@ -64,7 +64,7 @@ namespace BooleanIsoperimetry (a full Hamming ball of radius `r-1` plus `t` vertices of layer `r`), this is the number of vertices the closed neighbourhood adds beyond the full ball of radius `r`, i.e. the size of the upper shadow of the first `t` vertices of layer `r`. -/ -noncomputable def upperShadow (N r t : ℕ) : ℕ := +@[expose] noncomputable def upperShadow (N r t : ℕ) : ℕ := H N (binomPrefix N r + t) - binomPrefix N (r + 1) /-- **Macaulay closed form for `H` on a partial layer.** For `1 ≤ r`, the diff --git a/LeanPool/BooleanIsoperimetry/SimplicialCompression.lean b/LeanPool/BooleanIsoperimetry/SimplicialCompression.lean index 42dd937d81..868e11f32e 100644 --- a/LeanPool/BooleanIsoperimetry/SimplicialCompression.lean +++ b/LeanPool/BooleanIsoperimetry/SimplicialCompression.lean @@ -20,7 +20,7 @@ This file defines coordinate up/down compression operations on Boolean-cube families and proves basic neighborhood monotonicity and slice-pair facts. -/ -@[expose] public section +public section open scoped BigOperators open Finset @@ -29,13 +29,13 @@ namespace BooleanIsoperimetry /-- A faithful relation for the Up compression of a family along a coordinate `i`. It pushes elements missing `i` to have `i`, provided the target is not already present. -/ -def IsCoordinateUp {N : ℕ} (i : Fin N) (A A' : Finset (Cube N)) : Prop := +@[expose] def IsCoordinateUp {N : ℕ} (i : Fin N) (A A' : Finset (Cube N)) : Prop := A'.card = A.card ∧ ∀ x, x ∈ A' ↔ (x ∈ A ∧ (i ∈ x ∨ insert i x ∈ A)) ∨ (i ∈ x ∧ x ∉ A ∧ x.erase i ∈ A) /-- A faithful relation for the Down compression of a family along a coordinate `i`. It pushes elements containing `i` to miss `i`, provided the target is not already present. -/ -def IsCoordinateDown {N : ℕ} (i : Fin N) (B B' : Finset (Cube N)) : Prop := +@[expose] def IsCoordinateDown {N : ℕ} (i : Fin N) (B B' : Finset (Cube N)) : Prop := B'.card = B.card ∧ ∀ x, x ∈ B' ↔ (x ∈ B ∧ (i ∉ x ∨ x.erase i ∈ B)) ∨ (i ∉ x ∧ x ∉ B ∧ insert i x ∈ B) @@ -391,7 +391,7 @@ lemma neighborhood_coordinateDown_subset {N : ℕ} {i : Fin N} {A : Finset (Cube the sum of simplicial ranks of all vertices in the family. Coordinate and within-layer shifts are expected to strictly reduce this potential unless they are already fixed points. -/ -noncomputable def compressionPotential {N : ℕ} (A : Finset (Cube N)) : ℕ := +@[expose] noncomputable def compressionPotential {N : ℕ} (A : Finset (Cube N)) : ℕ := ∑ x ∈ A, rank x /-- The paired version of `compressionPotential`, matching the two-slice @@ -407,7 +407,7 @@ def IsCoordinateUpFixed {N : ℕ} (A : Finset (Cube N)) : Prop := ∀ i : Fin N, IsCoordinateUp i A A /-- A family is fixed by all currently formalized Down-compressions. -/ -def IsCoordinateDownFixed {N : ℕ} (A : Finset (Cube N)) : Prop := +@[expose] def IsCoordinateDownFixed {N : ℕ} (A : Finset (Cube N)) : Prop := ∀ i : Fin N, IsCoordinateDown i A A lemma coordinateUp_card_eq {N : ℕ} {i : Fin N} {A A' : Finset (Cube N)} @@ -566,13 +566,13 @@ lemma coordinateDown_potential_lt_of_ne {N : ℕ} (i : Fin N) (A : Finset (Cube /-- Within-layer colexicographic shift. It moves an element to a strictly earlier element in the same layer (same cardinality), provided the target is not already in the family. -/ -def IsColexShift {N : ℕ} (A A' : Finset (Cube N)) : Prop := +@[expose] def IsColexShift {N : ℕ} (A A' : Finset (Cube N)) : Prop := A'.card = A.card ∧ ∃ (x y : Cube N), x ∈ A ∧ y ∉ A ∧ x.card = y.card ∧ simplicialLt y x ∧ A' = insert y (A.erase x) /-- A family is stable under all within-layer colex shifts. -/ -def IsColexShiftFixed {N : ℕ} (A : Finset (Cube N)) : Prop := +@[expose] def IsColexShiftFixed {N : ℕ} (A : Finset (Cube N)) : Prop := ∀ A', ¬IsColexShift A A' /-- The missing level-saturation condition in the PDF compression route: once @@ -580,7 +580,7 @@ the compression process keeps a vertex of a given Hamming level, every lower Hamming level is already completely filled. Coordinate Down-compressions alone only fill coordinate subfaces of a present vertex; they do not imply this global saturation across a whole level. -/ -def IsLowerLevelSaturated {N : ℕ} (A : Finset (Cube N)) : Prop := +@[expose] def IsLowerLevelSaturated {N : ℕ} (A : Finset (Cube N)) : Prop := ∀ ⦃x y : Cube N⦄, x.card < y.card → y ∈ A → x ∈ A lemma lowerLevelSaturated_colexFixed_is_downClosed {N : ℕ} (A : Finset (Cube N)) diff --git a/LeanPool/BooleanMultiplication.lean b/LeanPool/BooleanMultiplication.lean index d6698a04fc..60d6d86bdf 100644 --- a/LeanPool/BooleanMultiplication.lean +++ b/LeanPool/BooleanMultiplication.lean @@ -31,7 +31,7 @@ and review. The project card records AI provenance and the source details. The u notice is retained below. -/ -@[expose] public section +public section /- MIT License diff --git a/LeanPool/BooleanMultiplication/ANF.lean b/LeanPool/BooleanMultiplication/ANF.lean index 7c8137542a..8c4acf5984 100644 --- a/LeanPool/BooleanMultiplication/ANF.lean +++ b/LeanPool/BooleanMultiplication/ANF.lean @@ -16,7 +16,7 @@ set union, so the resulting monoid algebra over `ZMod 2` is exactly the Boolean ANF quotient in canonical normal form. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul @@ -30,7 +30,7 @@ abbrev F₂ := ZMod 2 structure Monomial (m : Nat) where /-- Variables occurring in this squarefree monomial. -/ vars : Finset (Fin m) -deriving DecidableEq +deriving @[expose] DecidableEq namespace Monomial @@ -70,7 +70,7 @@ theorem Monomial.singleton_mul_singleton {m : Nat} (i j : Fin m) : abbrev ANF (m : Nat) := MonoidAlgebra F₂ (Monomial m) /-- The ANF consisting of one squarefree monomial. -/ -def monomial {m : Nat} (s : Finset (Fin m)) : ANF m := +@[expose] def monomial {m : Nat} (s : Finset (Fin m)) : ANF m := MonoidAlgebra.single ⟨s⟩ 1 @[simp] @@ -93,7 +93,7 @@ theorem coeff_sum_smul_mul_sum_smul {m : Nat} {ι κ : Type*} rw [Finset.sum_comm] /-- The `i`th input variable. -/ -def X {m : Nat} (i : Fin m) : ANF m := monomial {i} +@[expose] def X {m : Nat} (i : Fin m) : ANF m := monomial {i} @[simp] theorem monomial_mul {m : Nat} (s t : Finset (Fin m)) : @@ -186,6 +186,7 @@ noncomputable def evalHom {m : Nat} (x : Fin m → F₂) : ANF m →ₐ[F₂] F theorem eval_eq_evalHom {m : Nat} (p : ANF m) (x : Fin m → F₂) : eval p x = evalHom x p := by simp [eval, evalHom, monomialEval, MonoidAlgebra.lift_apply] + rfl @[simp] theorem eval_zero' {m : Nat} (x : Fin m → F₂) : eval 0 x = 0 := by rw [eval_eq_evalHom] @@ -274,7 +275,7 @@ noncomputable def evalLinearEquiv (m : Nat) : ANF m ≃ₗ[F₂] ((Fin m → F LinearEquiv.ofBijective (evalLinearMap m) ⟨eval_injective m, evalLinearMap_surjective m⟩ /-- The subspace of constants and input-linear functions. -/ -noncomputable def affine (m : Nat) : Submodule F₂ (ANF m) := +@[expose] noncomputable def affine (m : Nat) : Submodule F₂ (ANF m) := Submodule.span F₂ ({1} ∪ Set.range X) theorem one_mem_affine (m : Nat) : (1 : ANF m) ∈ affine m := by diff --git a/LeanPool/BooleanMultiplication/Circuit.lean b/LeanPool/BooleanMultiplication/Circuit.lean index 136c008e89..d1c6592676 100644 --- a/LeanPool/BooleanMultiplication/Circuit.lean +++ b/LeanPool/BooleanMultiplication/Circuit.lean @@ -16,18 +16,18 @@ belong to the affine span enlarged by the outputs of gates with index below but makes the unrestricted nature of nonlinear feedback explicit. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul noncomputable section /-- Outputs of gates whose index is strictly before `j`. -/ -def prefixGates {m r : Nat} (g : Fin r → ANF m) (j : Nat) : Set (ANF m) := +@[expose] def prefixGates {m r : Nat} (g : Fin r → ANF m) (j : Nat) : Set (ANF m) := {p | ∃ i : Fin r, i.val < j ∧ g i = p} /-- The functions available for free immediately before gate `j`. -/ -def wireSpace {m r : Nat} (g : Fin r → ANF m) (j : Nat) : Submodule F₂ (ANF m) := +@[expose] def wireSpace {m r : Nat} (g : Fin r → ANF m) (j : Nat) : Submodule F₂ (ANF m) := affine m ⊔ Submodule.span F₂ (prefixGates g j) theorem affine_le_wireSpace {m r j : Nat} (g : Fin r → ANF m) : @@ -46,7 +46,7 @@ structure Circuit (m r : Nat) where gate_eq : ∀ j, gate j = left j * right j /-- A circuit all of whose AND inputs are affine in the original inputs. -/ -def Circuit.ofAffineProducts {m r : Nat} (left right : Fin r → ANF m) +@[expose] def Circuit.ofAffineProducts {m r : Nat} (left right : Fin r → ANF m) (left_affine : ∀ i, left i ∈ affine m) (right_affine : ∀ i, right i ∈ affine m) : Circuit m r where gate i := left i * right i @@ -60,7 +60,8 @@ def Circuit.ofAffineProducts {m r : Nat} (left right : Fin r → ANF m) theorem Circuit.ofAffineProducts_gate {m r : Nat} (left right : Fin r → ANF m) (left_affine : ∀ i, left i ∈ affine m) (right_affine : ∀ i, right i ∈ affine m) (i : Fin r) : - (Circuit.ofAffineProducts left right left_affine right_affine).gate i = left i * right i := rfl + (Circuit.ofAffineProducts left right left_affine right_affine).gate i = left i * right i := by + rfl /-- The circuit with no AND gates. -/ def Circuit.empty (m : Nat) : Circuit m 0 := @@ -68,15 +69,15 @@ def Circuit.empty (m : Nat) : Circuit m 0 := (fun i => Fin.elim0 i) (fun i => Fin.elim0 i) /-- The final free-XOR wire space of a circuit. -/ -def Circuit.finalWire {m r : Nat} (C : Circuit m r) : Submodule F₂ (ANF m) := +@[expose] def Circuit.finalWire {m r : Nat} (C : Circuit m r) : Submodule F₂ (ANF m) := wireSpace C.gate r /-- A circuit computes a vector-valued target when every coordinate is in its final span. -/ -def Circuit.Computes {m r o : Nat} (C : Circuit m r) (target : Fin o → ANF m) : Prop := +@[expose] def Circuit.Computes {m r o : Nat} (C : Circuit m r) (target : Fin o → ANF m) : Prop := ∀ i, target i ∈ C.finalWire /-- There is an unrestricted circuit with `r` AND gates computing `target`. -/ -def HasCircuit {m o : Nat} (target : Fin o → ANF m) (r : Nat) : Prop := +@[expose] def HasCircuit {m o : Nat} (target : Fin o → ANF m) (r : Nat) : Prop := Nonempty {C : Circuit m r // C.Computes target} /-- Unrestricted Boolean multiplicative complexity (zero for an uncomputable target). -/ diff --git a/LeanPool/BooleanMultiplication/Mul.lean b/LeanPool/BooleanMultiplication/Mul.lean index 60a55234cf..698296be47 100644 --- a/LeanPool/BooleanMultiplication/Mul.lean +++ b/LeanPool/BooleanMultiplication/Mul.lean @@ -12,18 +12,18 @@ public import Lean.Elab.Tactic.Omega # Binary polynomial multiplication targets -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul noncomputable section /-- The variable `a_i` among the `2n` multiplication inputs. -/ -def aVar (n : Nat) (i : Fin n) : ANF (2 * n) := +@[expose] def aVar (n : Nat) (i : Fin n) : ANF (2 * n) := X ⟨i.val, by omega⟩ /-- The variable `b_j` among the `2n` multiplication inputs. -/ -def bVar (n : Nat) (j : Fin n) : ANF (2 * n) := +@[expose] def bVar (n : Nat) (j : Fin n) : ANF (2 * n) := X ⟨n + j.val, by omega⟩ @[simp] @@ -35,16 +35,16 @@ theorem bVar_mem_affine (n : Nat) (j : Fin n) : bVar n j ∈ affine (2 * n) := X_mem_affine _ /-- Coefficient `s` of the product of two `n`-term binary polynomials. -/ -def mulCoefficient (n : Nat) (s : Nat) : ANF (2 * n) := +@[expose] def mulCoefficient (n : Nat) (s : Nat) : ANF (2 * n) := ∑ i : Fin n, ∑ j : Fin n, if i.val + j.val = s then aVar n i * bVar n j else 0 /-- Binary `n`-term polynomial multiplication in Boolean ANF. -/ -def Mul (n : Nat) : Fin (2 * n - 1) → ANF (2 * n) := +@[expose] def Mul (n : Nat) : Fin (2 * n - 1) → ANF (2 * n) := fun s => mulCoefficient n s.val /-- The linear target space spanned by all multiplication coordinates. -/ -def mulTarget (n : Nat) : Submodule F₂ (ANF (2 * n)) := +@[expose] def mulTarget (n : Nat) : Submodule F₂ (ANF (2 * n)) := Submodule.span F₂ (Set.range (Mul n)) /-- Affine functions plus the multiplication target. -/ @@ -56,7 +56,7 @@ theorem Mul_mem_target (n : Nat) (s : Fin (2 * n - 1)) : Mul n s ∈ mulTarget n exact ⟨s, rfl⟩ /-- Coefficient projection onto a chosen finite family of squarefree monomials. -/ -def coefficientProjection {m d : Nat} (anchor : Fin d → Monomial m) : +@[expose] def coefficientProjection {m d : Nat} (anchor : Fin d → Monomial m) : ANF m →ₗ[F₂] (Fin d → F₂) where toFun p i := p.coeff (anchor i) map_add' p q := by ext i; simp @@ -64,7 +64,7 @@ def coefficientProjection {m d : Nat} (anchor : Fin d → Monomial m) : theorem coefficient_eq_zero_of_mem_affine {m : Nat} {p : ANF m} (hp : p ∈ affine m) (s : Monomial m) (hs : s.vars.card = 2) : p.coeff s = 0 := by - refine Submodule.span_induction (p := fun p _ => p.coeff s = 0) ?_ ?_ ?_ ?_ hp + refine Submodule.span_induction (p := fun (p : ANF m) _ => p.coeff s = 0) ?_ ?_ ?_ ?_ hp · intro q hq rcases hq with hq | hq · have hqone : q = 1 := by simpa only [Set.mem_singleton_iff] using hq diff --git a/LeanPool/BooleanMultiplication/N3.lean b/LeanPool/BooleanMultiplication/N3.lean index cec854aca0..596f976f86 100644 --- a/LeanPool/BooleanMultiplication/N3.lean +++ b/LeanPool/BooleanMultiplication/N3.lean @@ -11,7 +11,7 @@ public import LeanPool.BooleanMultiplication.N3Certificate # N3 for unrestricted Boolean polynomial multiplication -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul @@ -20,24 +20,24 @@ open N3Certificate noncomputable section /-- Sum of the five output coefficients for three-term multiplication. -/ -def targetSum : ANF 6 := ∑ i : Fin 5, UnrestrictedBooleanMul.Mul 3 i +@[expose] def targetSum : ANF 6 := ∑ i : Fin 5, UnrestrictedBooleanMul.Mul 3 i /-- Affine inputs followed by the three rational-place evaluations for three-term products. -/ -def rationalBasis : Fin 10 → ANF 6 := +@[expose] def rationalBasis : Fin 10 → ANF 6 := ![1, X 0, X 1, X 2, X 3, X 4, X 5, UnrestrictedBooleanMul.Mul 3 0, UnrestrictedBooleanMul.Mul 3 4, targetSum] /-- Affine inputs followed by the five output coefficients for three-term products. -/ -def ambientBasis : Fin 12 → ANF 6 := +@[expose] def ambientBasis : Fin 12 → ANF 6 := ![1, X 0, X 1, X 2, X 3, X 4, X 5, UnrestrictedBooleanMul.Mul 3 0, UnrestrictedBooleanMul.Mul 3 1, UnrestrictedBooleanMul.Mul 3 2, UnrestrictedBooleanMul.Mul 3 3, UnrestrictedBooleanMul.Mul 3 4] /-- The ANF represented by a coefficient vector in the rational-place basis. -/ -def rationalRep (c : Fin 10 → F₂) : ANF 6 := ∑ i, c i • rationalBasis i +@[expose] def rationalRep (c : Fin 10 → F₂) : ANF 6 := ∑ i, c i • rationalBasis i /-- The ANF represented by a coefficient vector in the affine-plus-target basis. -/ -def ambientRep (c : Fin 12 → F₂) : ANF 6 := ∑ i, c i • ambientBasis i +@[expose] def ambientRep (c : Fin 12 → F₂) : ANF 6 := ∑ i, c i • ambientBasis i /-- Extract coefficients bilinearly, then normalize the resulting scalar polynomial. -/ macro (name := solveProductCoeff) "solve_product_coeff" : tactic => diff --git a/LeanPool/BooleanMultiplication/N3Certificate.lean b/LeanPool/BooleanMultiplication/N3Certificate.lean index 1cb1067712..4280b8196a 100644 --- a/LeanPool/BooleanMultiplication/N3Certificate.lean +++ b/LeanPool/BooleanMultiplication/N3Certificate.lean @@ -11,7 +11,7 @@ public import LeanPool.BooleanMultiplication.SmallCases # N3Certificate for unrestricted Boolean polynomial multiplication -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul.N3Certificate @@ -31,46 +31,46 @@ theorem six_eq_zero_f2 : (6 : F2) = 0 := by decide theorem eight_eq_zero_f2 : (8 : F2) = 0 := by decide /-- A bilinear coordinate product from two rational-basis coefficient vectors. -/ -def ab (a b : Fin 10 -> F2) (i j : Fin 10) : F2 := a i * b j +@[expose] def ab (a b : Fin 10 -> F2) (i j : Fin 10) : F2 := a i * b j /-- The product coefficient at the squarefree monomial `{0, 1, 4}`. -/ -def c3 (a b : Fin 10 -> F2) : F2 := +@[expose] def c3 (a b : Fin 10 -> F2) : F2 := ab a b 1 9 + ab a b 2 9 + ab a b 9 1 + ab a b 9 2 /-- The product coefficient at the squarefree monomial `{0, 4, 5}`. -/ -def c20 (a b : Fin 10 -> F2) : F2 := +@[expose] def c20 (a b : Fin 10 -> F2) : F2 := ab a b 5 9 + ab a b 6 9 + ab a b 9 5 + ab a b 9 6 /-- The product coefficient at the squarefree monomial `{0, 1}`. -/ -def c25 (a b : Fin 10 -> F2) : F2 := ab a b 1 2 + ab a b 2 1 +@[expose] def c25 (a b : Fin 10 -> F2) : F2 := ab a b 1 2 + ab a b 2 1 /-- The product coefficient at the squarefree monomial `{4, 5}`. -/ -def c30 (a b : Fin 10 -> F2) : F2 := ab a b 5 6 + ab a b 6 5 +@[expose] def c30 (a b : Fin 10 -> F2) : F2 := ab a b 5 6 + ab a b 6 5 /-- Sum of product coefficients at `{0, 4}` and `{1, 3}`. -/ -def c31 (a b : Fin 10 -> F2) : F2 := +@[expose] def c31 (a b : Fin 10 -> F2) : F2 := ab a b 1 5 + ab a b 1 9 + ab a b 2 4 + ab a b 2 9 + ab a b 4 2 + ab a b 4 9 + ab a b 5 1 + ab a b 5 9 + ab a b 9 1 + ab a b 9 2 + ab a b 9 4 + ab a b 9 5 /-- Sum of product coefficients at `{0, 5}` and `{1, 4}`. -/ -def c32 (a b : Fin 10 -> F2) : F2 := +@[expose] def c32 (a b : Fin 10 -> F2) : F2 := ab a b 1 6 + ab a b 1 9 + ab a b 2 5 + ab a b 2 9 + ab a b 5 2 + ab a b 5 9 + ab a b 6 1 + ab a b 6 9 + ab a b 9 1 + ab a b 9 2 + ab a b 9 5 + ab a b 9 6 /-- Sum of product coefficients at `{1, 5}` and `{2, 4}`. -/ -def c34 (a b : Fin 10 -> F2) : F2 := +@[expose] def c34 (a b : Fin 10 -> F2) : F2 := ab a b 2 6 + ab a b 2 9 + ab a b 3 5 + ab a b 3 9 + ab a b 5 3 + ab a b 5 9 + ab a b 6 2 + ab a b 6 9 + ab a b 9 2 + ab a b 9 3 + ab a b 9 5 + ab a b 9 6 /-- The first target-coordinate obstruction, detected at `{0, 4}` and `{0, 5}`. -/ -def g0 (a b : Fin 10 -> F2) : F2 := +@[expose] def g0 (a b : Fin 10 -> F2) : F2 := ab a b 1 5 + ab a b 1 6 + ab a b 5 1 + ab a b 5 9 + ab a b 6 1 + ab a b 6 9 + ab a b 9 5 + ab a b 9 6 /-- The second target-coordinate obstruction, detected at `{0, 5}` and `{1, 5}`. -/ -def g1 (a b : Fin 10 -> F2) : F2 := +@[expose] def g1 (a b : Fin 10 -> F2) : F2 := ab a b 1 6 + ab a b 1 9 + ab a b 2 6 + ab a b 2 9 + ab a b 6 1 + ab a b 6 2 + ab a b 9 1 + ab a b 9 2 diff --git a/LeanPool/BooleanMultiplication/N3TruthTable.lean b/LeanPool/BooleanMultiplication/N3TruthTable.lean index 2fd3e07768..5040bbe63d 100644 --- a/LeanPool/BooleanMultiplication/N3TruthTable.lean +++ b/LeanPool/BooleanMultiplication/N3TruthTable.lean @@ -15,7 +15,7 @@ This module validates the concrete 64-bit encodings used while developing the algebraic proof. Nothing in `N3.lean` or the final theorem depends on it. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul diff --git a/LeanPool/BooleanMultiplication/N4/BooleanIdentities.lean b/LeanPool/BooleanMultiplication/N4/BooleanIdentities.lean index 5d46b38c01..06417f27aa 100644 --- a/LeanPool/BooleanMultiplication/N4/BooleanIdentities.lean +++ b/LeanPool/BooleanMultiplication/N4/BooleanIdentities.lean @@ -17,7 +17,7 @@ prevents those arguments from silently treating Boolean multiplication as ordinary polynomial multiplication. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/Cubic.lean b/LeanPool/BooleanMultiplication/N4/Cubic.lean index 992a17b718..017b23ed53 100644 --- a/LeanPool/BooleanMultiplication/N4/Cubic.lean +++ b/LeanPool/BooleanMultiplication/N4/Cubic.lean @@ -17,7 +17,7 @@ quadratic direction, and the remaining cubic is a single vector wedged with that direction. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -64,16 +64,16 @@ theorem vectorWedge_add_right (x y z : LinearForm) : /-- Cubic high part of a product whose linear factors are `ell,m` and whose quadratic factors have rational-place coefficient words `α,β`. -/ -def rationalProductCubic (ell m : LinearForm) (α β : Fin 3 → F₂) : ThreeForm := +@[expose] def rationalProductCubic (ell m : LinearForm) (α β : Fin 3 → F₂) : ThreeForm := vectorWedgeTwo ell (rationalTwo β) + vectorWedgeTwo m (rationalTwo α) /-- Boolean degree-lowering contraction: the quadratic part created when a linear form multiplies a quadratic form and repeats one of its variables. -/ -def booleanContraction (ell : LinearForm) (q : TwoForm) : TwoForm := +@[expose] def booleanContraction (ell : LinearForm) (q : TwoForm) : TwoForm := fun i j => (ell i + ell j) * q i j /-- Quadratic terms created by multiplying identical quadratic monomials. -/ -def twoHadamard (q c : TwoForm) : TwoForm := fun i j => q i j * c i j +@[expose] def twoHadamard (q c : TwoForm) : TwoForm := fun i j => q i j * c i j /-- Boolean contraction along a rational-place support only rescales that place. The two support vectors use disjoint `A` and `B` coordinates. -/ @@ -87,7 +87,7 @@ theorem booleanContraction_rationalPlace (a b : F₂) (θ : Fin 3) : /-- Complete quadratic shadow of a product `(a + ell + Q) * (b + m + C)`. -/ -def rationalProductQuadratic (a b : F₂) (ell m : LinearForm) +@[expose] def rationalProductQuadratic (a b : F₂) (ell m : LinearForm) (α β : Fin 3 → F₂) : TwoForm := a • rationalTwo β + b • rationalTwo α + vectorWedge ell m + booleanContraction ell (rationalTwo β) + diff --git a/LeanPool/BooleanMultiplication/N4/CubicDirect.lean b/LeanPool/BooleanMultiplication/N4/CubicDirect.lean index 6e0c64ec83..709146aacd 100644 --- a/LeanPool/BooleanMultiplication/N4/CubicDirect.lean +++ b/LeanPool/BooleanMultiplication/N4/CubicDirect.lean @@ -21,7 +21,7 @@ linearity. This compact certificate replaces repeated coordinate chases in the quartic and annihilator arguments. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -65,13 +65,13 @@ def cubicDirectRecover (r : Fin 18) : ThreeForm →ₗ[F₂] F₂ := (upperTriple k).2.2 /-- Wedge a linear form with the two-form of one rational place. -/ -def cubicPlaceLinear (theta : Fin 3) : LinearForm →ₗ[F₂] ThreeForm where +@[expose] def cubicPlaceLinear (theta : Fin 3) : LinearForm →ₗ[F₂] ThreeForm where toFun := fun u => vectorWedgeTwo u (rationalPlaceTwo theta) map_add' u v := vectorWedgeTwo_add_left u v _ map_smul' a u := vectorWedgeTwo_smul_left a u _ /-- Sum of the cubic contributions at the three rational places. -/ -def rationalCubicDirectSum (M : Fin 3 → LinearForm) : ThreeForm := +@[expose] def rationalCubicDirectSum (M : Fin 3 → LinearForm) : ThreeForm := ∑ theta : Fin 3, cubicPlaceLinear theta (M theta) /-- Six quotient coordinates for each of `P₀`, `P₁`, and `P∞`. -/ diff --git a/LeanPool/BooleanMultiplication/N4/CubicFeedback.lean b/LeanPool/BooleanMultiplication/N4/CubicFeedback.lean index 7abb667db8..7a416082f4 100644 --- a/LeanPool/BooleanMultiplication/N4/CubicFeedback.lean +++ b/LeanPool/BooleanMultiplication/N4/CubicFeedback.lean @@ -20,7 +20,7 @@ No circuit configurations are enumerated here; the proof is obtained from the three algebraic dependency cases in `low_product_quadratic_normal_form`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/CubicSeed.lean b/LeanPool/BooleanMultiplication/N4/CubicSeed.lean index 5552e38937..f106ab7529 100644 --- a/LeanPool/BooleanMultiplication/N4/CubicSeed.lean +++ b/LeanPool/BooleanMultiplication/N4/CubicSeed.lean @@ -16,7 +16,7 @@ Boolean ANF algebra bounds the product by degree three. The independent high-part argument then makes its cubic projection nonzero. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/CubicSemantic.lean b/LeanPool/BooleanMultiplication/N4/CubicSemantic.lean index 031d5a0e60..0c2410a4e1 100644 --- a/LeanPool/BooleanMultiplication/N4/CubicSemantic.lean +++ b/LeanPool/BooleanMultiplication/N4/CubicSemantic.lean @@ -16,7 +16,7 @@ The only finite certificate here is the fixed subset identity on three indices; it contains no circuit data. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/CubicSlice.lean b/LeanPool/BooleanMultiplication/N4/CubicSlice.lean index 250148b6d6..1f6e794cf4 100644 --- a/LeanPool/BooleanMultiplication/N4/CubicSlice.lean +++ b/LeanPool/BooleanMultiplication/N4/CubicSlice.lean @@ -22,7 +22,7 @@ The proof is exterior-linear and does not enumerate circuits or Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/CubicTarget.lean b/LeanPool/BooleanMultiplication/N4/CubicTarget.lean index 374d58446c..248726a37b 100644 --- a/LeanPool/BooleanMultiplication/N4/CubicTarget.lean +++ b/LeanPool/BooleanMultiplication/N4/CubicTarget.lean @@ -15,7 +15,7 @@ seven-dimensional Hankel target. It is used only for the `D = 0` branch of quartic exclusion. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/Degree.lean b/LeanPool/BooleanMultiplication/N4/Degree.lean index fbd27e7c19..456f9b3f13 100644 --- a/LeanPool/BooleanMultiplication/N4/Degree.lean +++ b/LeanPool/BooleanMultiplication/N4/Degree.lean @@ -16,7 +16,7 @@ quotient API. This file supplies the high-part predicates used by the seed and defect arguments. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/Exterior.lean b/LeanPool/BooleanMultiplication/N4/Exterior.lean index b3e1ea5222..0bcb01d0c8 100644 --- a/LeanPool/BooleanMultiplication/N4/Exterior.lean +++ b/LeanPool/BooleanMultiplication/N4/Exterior.lean @@ -18,7 +18,7 @@ explicit bilinear maps avoid constructing or deciding equality in a large general-purpose exterior algebra. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -37,11 +37,11 @@ abbrev FourForm := Fin 8 → Fin 8 → Fin 8 → Fin 8 → F₂ abbrev FiveForm := Fin 8 → Fin 8 → Fin 8 → Fin 8 → Fin 8 → F₂ /-- Dimension-polymorphic versions used for quotient and tail arguments. -/ -def vectorWedgeN {n : Nat} (u v : Fin n → F₂) : Fin n → Fin n → F₂ := +@[expose] def vectorWedgeN {n : Nat} (u v : Fin n → F₂) : Fin n → Fin n → F₂ := fun i j => u i * v j + u j * v i /-- Coordinates of a vector wedged with a two-form, in arbitrary finite dimension. -/ -def vectorWedgeTwoN {n : Nat} (u : Fin n → F₂) +@[expose] def vectorWedgeTwoN {n : Nat} (u : Fin n → F₂) (q : Fin n → Fin n → F₂) : Fin n → Fin n → Fin n → F₂ := fun i j k => u i * q j k + u j * q i k + u k * q i j @@ -69,11 +69,11 @@ theorem decomposable_of_vectorWedgeTwoN_zero {n : Nat} simpa [add_assoc] using hij /-- Exterior product of two vectors. -/ -def vectorWedge (u v : LinearForm) : TwoForm := +@[expose] def vectorWedge (u v : LinearForm) : TwoForm := fun i j => u i * v j + u j * v i /-- Exterior product of a vector and a two-form. -/ -def vectorWedgeTwo (u : LinearForm) (q : TwoForm) : ThreeForm := +@[expose] def vectorWedgeTwo (u : LinearForm) (q : TwoForm) : ThreeForm := fun i j k => u i * q j k + u j * q i k + u k * q i j theorem vectorWedgeTwo_repeated_left (x y : LinearForm) : @@ -131,13 +131,13 @@ theorem mem_support_of_vectorWedgeTwo_zero /-- Exterior product of two two-forms. The six terms remember which of the two input forms receives each pair. -/ -def wedgeTwo (q c : TwoForm) : FourForm := +@[expose] def wedgeTwo (q c : TwoForm) : FourForm := fun i j k l => q i j * c k l + q i k * c j l + q i l * c j k + c i j * q k l + c i k * q j l + c i l * q j k /-- Exterior product of a cubic and a two-form. -/ -def wedgeThreeTwo (h : ThreeForm) (q : TwoForm) : FiveForm := +@[expose] def wedgeThreeTwo (h : ThreeForm) (q : TwoForm) : FiveForm := fun i j k l m => h i j k * q l m + h i j l * q k m + h i j m * q k l + h i k l * q j m + h i k m * q j l + h i l m * q j k + @@ -145,7 +145,7 @@ def wedgeThreeTwo (h : ThreeForm) (q : TwoForm) : FiveForm := h k l m * q i j /-- Exterior product of a vector and a four-form. -/ -def vectorWedgeFour (u : LinearForm) (w : FourForm) : FiveForm := +@[expose] def vectorWedgeFour (u : LinearForm) (w : FourForm) : FiveForm := fun i j k l m => u i * w j k l m + u j * w i k l m + u k * w i j l m + u l * w i j k m + u m * w i j k l @@ -208,23 +208,23 @@ theorem wedge_place_firstJet_zero (x u y v : LinearForm) : simp [N3Certificate.two_eq_zero_f2] /-- The three rational `A`-side place vectors: zero, one, infinity. -/ -def placeA : Fin 3 → LinearForm := +@[expose] def placeA : Fin 3 → LinearForm := ![![1, 0, 0, 0, 0, 0, 0, 0], ![1, 1, 1, 1, 0, 0, 0, 0], ![0, 0, 0, 1, 0, 0, 0, 0]] /-- The three rational `B`-side place vectors: zero, one, infinity. -/ -def placeB : Fin 3 → LinearForm := +@[expose] def placeB : Fin 3 → LinearForm := ![![0, 0, 0, 0, 1, 0, 0, 0], ![0, 0, 0, 0, 1, 1, 1, 1], ![0, 0, 0, 0, 0, 0, 0, 1]] /-- Exterior product of the two input evaluations at a rational place. -/ -def rationalPlaceTwo (θ : Fin 3) : TwoForm := +@[expose] def rationalPlaceTwo (θ : Fin 3) : TwoForm := vectorWedge (placeA θ) (placeB θ) /-- Linear combination of the two-forms of the three rational places. -/ -def rationalTwo (α : Fin 3 → F₂) : TwoForm := +@[expose] def rationalTwo (α : Fin 3 → F₂) : TwoForm := ∑ θ : Fin 3, α θ • rationalPlaceTwo θ /-- Ordinary vector dependence over `F₂`, derived algebraically from the diff --git a/LeanPool/BooleanMultiplication/N4/Feedback.lean b/LeanPool/BooleanMultiplication/N4/Feedback.lean index 4298a1d257..089e9e9960 100644 --- a/LeanPool/BooleanMultiplication/N4/Feedback.lean +++ b/LeanPool/BooleanMultiplication/N4/Feedback.lean @@ -18,7 +18,7 @@ the manuscript and derive the zero-wedge structure needed by the low--low second-feedback exclusion. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -30,7 +30,7 @@ targets. -/ abbrev FeedbackCoord := Fin 4 → F₂ /-- Represent feedback coordinates in the target coefficient space. -/ -def feedbackCoeffRep (q : FeedbackCoord) : TargetCoeff := +@[expose] def feedbackCoeffRep (q : FeedbackCoord) : TargetCoeff := q 0 • targetBasis 0 + q 1 • targetBasis 1 + q 2 • targetBasis 6 + q 3 • rOneCoeff diff --git a/LeanPool/BooleanMultiplication/N4/FeedbackHomogeneous.lean b/LeanPool/BooleanMultiplication/N4/FeedbackHomogeneous.lean index 98a39c67ba..11e0eee646 100644 --- a/LeanPool/BooleanMultiplication/N4/FeedbackHomogeneous.lean +++ b/LeanPool/BooleanMultiplication/N4/FeedbackHomogeneous.lean @@ -16,7 +16,7 @@ bilinear and checks the fixed `7 × 7 × 6` basis matrix; it never enumerates circuits or Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/FeedbackSaturation.lean b/LeanPool/BooleanMultiplication/N4/FeedbackSaturation.lean index 4581dd5e29..9bc15e5848 100644 --- a/LeanPool/BooleanMultiplication/N4/FeedbackSaturation.lean +++ b/LeanPool/BooleanMultiplication/N4/FeedbackSaturation.lean @@ -17,7 +17,7 @@ state, to exactly the two algebraic types excluded in `SecondFeedbackUsing` and `SecondFeedbackHigh`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/FeedbackSlice.lean b/LeanPool/BooleanMultiplication/N4/FeedbackSlice.lean index 1167164bdd..eb037faaf3 100644 --- a/LeanPool/BooleanMultiplication/N4/FeedbackSlice.lean +++ b/LeanPool/BooleanMultiplication/N4/FeedbackSlice.lean @@ -17,7 +17,7 @@ variables. Thus the factor has the manuscript form projection and six explicit exterior coordinates. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/FirstJet.lean b/LeanPool/BooleanMultiplication/N4/FirstJet.lean index b2f1c331f9..e8aa14656b 100644 --- a/LeanPool/BooleanMultiplication/N4/FirstJet.lean +++ b/LeanPool/BooleanMultiplication/N4/FirstJet.lean @@ -18,7 +18,7 @@ and the new low--low product have a genuinely non-rational quadratic collision in `Aff + T`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/FirstJetState.lean b/LeanPool/BooleanMultiplication/N4/FirstJetState.lean index 38bfab1c6e..e51172adb4 100644 --- a/LeanPool/BooleanMultiplication/N4/FirstJetState.lean +++ b/LeanPool/BooleanMultiplication/N4/FirstJetState.lean @@ -16,7 +16,7 @@ state, by its rational tangent. Thus later gates see the old seed state plus one explicit first-Hasse-jet direction. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/FirstJetSupport.lean b/LeanPool/BooleanMultiplication/N4/FirstJetSupport.lean index 172309048e..b0ec70b697 100644 --- a/LeanPool/BooleanMultiplication/N4/FirstJetSupport.lean +++ b/LeanPool/BooleanMultiplication/N4/FirstJetSupport.lean @@ -20,7 +20,7 @@ The only finite certificates below concern the nine fixed Hankel words and their eight columns. They do not enumerate circuits or Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -170,7 +170,7 @@ theorem nonzero_place_vector_classifies_outside_support : /-- A vector supported on the first two coefficients of each input polynomial. -/ -def normalizedFirstJetVector (pa pb ja jb : F₂) : LinearForm := +@[expose] def normalizedFirstJetVector (pa pb ja jb : F₂) : LinearForm := ![pa, ja, 0, 0, pb, jb, 0, 0] theorem normalizedFirstJetVector_eq (pa pb ja jb : F₂) : diff --git a/LeanPool/BooleanMultiplication/N4/Flag.lean b/LeanPool/BooleanMultiplication/N4/Flag.lean index d18f25c664..be85115f08 100644 --- a/LeanPool/BooleanMultiplication/N4/Flag.lean +++ b/LeanPool/BooleanMultiplication/N4/Flag.lean @@ -17,7 +17,7 @@ identity is the reusable form of the manuscript's ledger `number of nonredundant gates = target rank + defect rank`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -25,19 +25,19 @@ namespace N4 noncomputable section /-- The target ambient space `Aff + T`. -/ -def targetAmbient (m : Nat) (T : Submodule F₂ (ANF m)) : Submodule F₂ (ANF m) := +@[expose] def targetAmbient (m : Nat) (T : Submodule F₂ (ANF m)) : Submodule F₂ (ANF m) := affine m ⊔ T /-- Target dimension of a wire space, measured modulo affine functions. -/ -def flagTargetRank {m : Nat} (V T : Submodule F₂ (ANF m)) : Nat := +@[expose] def flagTargetRank {m : Nat} (V T : Submodule F₂ (ANF m)) : Nat := Module.finrank F₂ ↥(V ⊓ targetAmbient m T) - Module.finrank F₂ ↥(affine m) /-- Defect dimension: directions in the wire space outside `Aff + T`. -/ -def flagDefectRank {m : Nat} (V T : Submodule F₂ (ANF m)) : Nat := +@[expose] def flagDefectRank {m : Nat} (V T : Submodule F₂ (ANF m)) : Nat := Module.finrank F₂ ↥V - Module.finrank F₂ ↥(V ⊓ targetAmbient m T) /-- The wire-space flag associated with a semantic circuit. -/ -def circuitFlag {m r : Nat} (C : Circuit m r) (j : Nat) : Submodule F₂ (ANF m) := +@[expose] def circuitFlag {m r : Nat} (C : Circuit m r) (j : Nat) : Submodule F₂ (ANF m) := wireSpace C.gate j /-- A gate is nonredundant when its output is not already in the preceding @@ -46,7 +46,7 @@ def NonredundantAt {m r : Nat} (C : Circuit m r) (j : Fin r) : Prop := C.gate j ∉ circuitFlag C j.val /-- A gate is useful when adjoining it raises the target rank. -/ -def UsefulAt {m r : Nat} (C : Circuit m r) (T : Submodule F₂ (ANF m)) +@[expose] def UsefulAt {m r : Nat} (C : Circuit m r) (T : Submodule F₂ (ANF m)) (j : Fin r) : Prop := flagTargetRank (circuitFlag C (j.val + 1)) T = flagTargetRank (circuitFlag C j.val) T + 1 diff --git a/LeanPool/BooleanMultiplication/N4/Geometry.lean b/LeanPool/BooleanMultiplication/N4/Geometry.lean index 20a2fca520..147dd50aeb 100644 --- a/LeanPool/BooleanMultiplication/N4/Geometry.lean +++ b/LeanPool/BooleanMultiplication/N4/Geometry.lean @@ -16,7 +16,7 @@ vectors dependent, so the cross block is an outer product and every Hankel minor vanishes. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -24,17 +24,17 @@ namespace N4 noncomputable section /-- Coordinate of an input coefficient in the first polynomial. -/ -def aCoord (i : Fin 4) : Fin 8 := ⟨i.val, by omega⟩ +@[expose] def aCoord (i : Fin 4) : Fin 8 := ⟨i.val, by omega⟩ /-- Coordinate of an input coefficient in the second polynomial. -/ -def bCoord (j : Fin 4) : Fin 8 := ⟨4 + j.val, by omega⟩ +@[expose] def bCoord (j : Fin 4) : Fin 8 := ⟨4 + j.val, by omega⟩ /-- Restrict a linear form to the first polynomial input. -/ -def aPart (u : LinearForm) : Fin 4 → F₂ := fun i => u (aCoord i) +@[expose] def aPart (u : LinearForm) : Fin 4 → F₂ := fun i => u (aCoord i) /-- Restrict a linear form to the second polynomial input. -/ -def bPart (u : LinearForm) : Fin 4 → F₂ := fun j => u (bCoord j) +@[expose] def bPart (u : LinearForm) : Fin 4 → F₂ := fun j => u (bCoord j) /-- The mixed input coordinates of the exterior product of two linear forms. -/ -def crossPart (u v : LinearForm) (i j : Fin 4) : F₂ := +@[expose] def crossPart (u v : LinearForm) (i j : Fin 4) : F₂ := vectorWedge u v (aCoord i) (bCoord j) /-- A target coefficient word is decomposable when it is the quadratic cross @@ -83,7 +83,7 @@ theorem decomposableTarget_classification {c : TargetCoeff} rankOne_target_classification (decomposableTarget_rankOne hdec) hc /-- Represent a linear combination of evaluations at zero, one, and infinity. -/ -def rationalCoeffRep (α : Fin 3 → F₂) : TargetCoeff := +@[expose] def rationalCoeffRep (α : Fin 3 → F₂) : TargetCoeff := α 0 • rZeroCoeff + α 1 • rOneCoeff + α 2 • rInfinityCoeff theorem rationalCoeffRep_mem (α : Fin 3 → F₂) : diff --git a/LeanPool/BooleanMultiplication/N4/Hankel.lean b/LeanPool/BooleanMultiplication/N4/Hankel.lean index 25dde6c42e..79db8ff632 100644 --- a/LeanPool/BooleanMultiplication/N4/Hankel.lean +++ b/LeanPool/BooleanMultiplication/N4/Hankel.lean @@ -15,7 +15,7 @@ target of four-term multiplication. All classifications are expressed as polynomial identities over `F₂`; no circuit or truth-table enumeration is used. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -26,28 +26,28 @@ noncomputable section abbrev TargetCoeff := Fin 7 → F₂ /-- The coefficient vector supported at one target coordinate. -/ -def targetBasis (s : Fin 7) : TargetCoeff := +@[expose] def targetBasis (s : Fin 7) : TargetCoeff := (Pi.basisFun F₂ (Fin 7)) s /-- The rational place at zero. -/ -def rZeroCoeff : TargetCoeff := ![1, 0, 0, 0, 0, 0, 0] +@[expose] def rZeroCoeff : TargetCoeff := ![1, 0, 0, 0, 0, 0, 0] /-- The rational place at one. -/ -def rOneCoeff : TargetCoeff := ![1, 1, 1, 1, 1, 1, 1] +@[expose] def rOneCoeff : TargetCoeff := ![1, 1, 1, 1, 1, 1, 1] /-- The rational place at infinity. -/ -def rInfinityCoeff : TargetCoeff := ![0, 0, 0, 0, 0, 0, 1] +@[expose] def rInfinityCoeff : TargetCoeff := ![0, 0, 0, 0, 0, 0, 1] /-- The three-dimensional space spanned by the rational places. -/ def rationalCoeffSpace : Submodule F₂ TargetCoeff := Submodule.span F₂ {rZeroCoeff, rOneCoeff, rInfinityCoeff} /-- Interpret a target coefficient vector as an ANF in the `Mul 4` target. -/ -def targetANF (c : TargetCoeff) : ANF 8 := +@[expose] def targetANF (c : TargetCoeff) : ANF 8 := ∑ s : Fin 7, c s • Mul 4 s /-- The `4 × 4` Hankel matrix attached to a target coefficient vector. -/ -def hankelMatrix (c : TargetCoeff) : Matrix (Fin 4) (Fin 4) F₂ := +@[expose] def hankelMatrix (c : TargetCoeff) : Matrix (Fin 4) (Fin 4) F₂ := fun i j => c ⟨i.val + j.val, by omega⟩ /-- Algebraic rank-at-most-one condition: every `2 × 2` minor vanishes. -/ diff --git a/LeanPool/BooleanMultiplication/N4/Homogeneous.lean b/LeanPool/BooleanMultiplication/N4/Homogeneous.lean index 9f757299b2..8c128a6f26 100644 --- a/LeanPool/BooleanMultiplication/N4/Homogeneous.lean +++ b/LeanPool/BooleanMultiplication/N4/Homogeneous.lean @@ -17,7 +17,7 @@ an input variable with one of the three rational places (and pairs of those places) require coordinate normalization. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -25,7 +25,7 @@ namespace N4 noncomputable section /-- Cubic coefficients as a three-form array, with repeated-index coordinates zero. -/ -def anfThreeProjection : ANF 8 →ₗ[F₂] ThreeForm where +@[expose] def anfThreeProjection : ANF 8 →ₗ[F₂] ThreeForm where toFun p i j k := if ({i, j, k} : Finset (Fin 8)).card = 3 then p.coeff ⟨{i, j, k}⟩ else 0 @@ -37,7 +37,7 @@ def anfThreeProjection : ANF 8 →ₗ[F₂] ThreeForm where by_cases h : ({i, j, k} : Finset (Fin 8)).card = 3 <;> simp [h] /-- Quartic coefficients as a four-form array, with repeated-index coordinates zero. -/ -def anfFourProjection : ANF 8 →ₗ[F₂] FourForm where +@[expose] def anfFourProjection : ANF 8 →ₗ[F₂] FourForm where toFun p i j k l := if ({i, j, k, l} : Finset (Fin 8)).card = 4 then p.coeff ⟨{i, j, k, l}⟩ else 0 @@ -49,11 +49,11 @@ def anfFourProjection : ANF 8 →ₗ[F₂] FourForm where by_cases h : ({i, j, k, l} : Finset (Fin 8)).card = 4 <;> simp [h] /-- The Boolean ANF of the given linear form. -/ -def linearANF (ell : LinearForm) : ANF 8 := +@[expose] def linearANF (ell : LinearForm) : ANF 8 := ∑ i : Fin 8, ell i • X i /-- The Boolean ANF with the given constant and linear parts. -/ -def affineANF (a : F₂) (ell : LinearForm) : ANF 8 := +@[expose] def affineANF (a : F₂) (ell : LinearForm) : ANF 8 := a • (1 : ANF 8) + linearANF ell /-- The target ANF of a linear combination of rational-place evaluations. -/ @@ -69,10 +69,10 @@ theorem rationalANF_eq_sum (α : Fin 3 → F₂) : add_assoc] /-- The product coefficient index corresponding to two input coefficient indices. -/ -def hankelIndex (i j : Fin 4) : Fin 7 := ⟨i.val + j.val, by omega⟩ +@[expose] def hankelIndex (i j : Fin 4) : Fin 7 := ⟨i.val + j.val, by omega⟩ /-- The squarefree mixed monomial for one coefficient from each input polynomial. -/ -def targetPair (i j : Fin 4) : Finset (Fin 8) := {aCoord i, bCoord j} +@[expose] def targetPair (i j : Fin 4) : Finset (Fin 8) := {aCoord i, bCoord j} /-- The target Hankel form as its sixteen cross monomials. -/ theorem targetANF_eq_double_sum (c : TargetCoeff) : @@ -95,7 +95,7 @@ theorem coeff_targetANF_mul_targetANF (c d : TargetCoeff) (s : Finset (Fin 8)) : monomial_mul, coeff_monomial] /-- The cubic coordinate array of a squarefree monomial. -/ -def monomialThree (s : Finset (Fin 8)) : ThreeForm := fun i j k => +@[expose] def monomialThree (s : Finset (Fin 8)) : ThreeForm := fun i j k => if ({i, j, k} : Finset (Fin 8)).card = 3 then if s = {i, j, k} then 1 else 0 else 0 @@ -113,7 +113,7 @@ def cubicPlaceModel (r : Fin 8) (θ : Fin 3) : ThreeForm := monomialThree ({r} ∪ targetPair i j) /-- The linear form selecting one input coordinate. -/ -def coordinateLinear (r : Fin 8) : LinearForm := fun i => +@[expose] def coordinateLinear (r : Fin 8) : LinearForm := fun i => if i = r then 1 else 0 private theorem anfThreeProjection_three_X (r a b : Fin 8) : @@ -391,7 +391,7 @@ def quarticProbeANF : ANF 8 →ₗ[F₂] (Fin 3 → F₂) where simp [quarticProbeANF, coeff_monomial] /-- The three designated coordinates of a wedge of two two-forms. -/ -def quarticWedgeProbe (q r : TwoForm) : Fin 3 → F₂ := +@[expose] def quarticWedgeProbe (q r : TwoForm) : Fin 3 → F₂ := ![wedgeTwo q r 0 1 4 6, wedgeTwo q r 1 3 5 7, wedgeTwo q r 0 3 4 7] diff --git a/LeanPool/BooleanMultiplication/N4/JetSeparation.lean b/LeanPool/BooleanMultiplication/N4/JetSeparation.lean index 6a9ffe0529..545fcbfa0f 100644 --- a/LeanPool/BooleanMultiplication/N4/JetSeparation.lean +++ b/LeanPool/BooleanMultiplication/N4/JetSeparation.lean @@ -17,7 +17,7 @@ kills `C`; the four remaining outside slices force `A = B = 0` unless the auxiliary two-plane is exactly the anchor plane. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -35,11 +35,11 @@ def feedbackCoeffSpace : Submodule F₂ TargetCoeff := targetBasis 6, rOneCoeff]) /-- The second coefficient relative to the evaluation-at-one component. -/ -def jetA (c : TargetCoeff) : F₂ := c 2 + c 5 +@[expose] def jetA (c : TargetCoeff) : F₂ := c 2 + c 5 /-- The third coefficient relative to the evaluation-at-one component. -/ -def jetB (c : TargetCoeff) : F₂ := c 3 + c 5 +@[expose] def jetB (c : TargetCoeff) : F₂ := c 3 + c 5 /-- The fourth coefficient relative to the evaluation-at-one component. -/ -def jetC (c : TargetCoeff) : F₂ := c 4 + c 5 +@[expose] def jetC (c : TargetCoeff) : F₂ := c 4 + c 5 /-- The feedback-subspace component in the chosen target decomposition. -/ def feedbackBasePart (c : TargetCoeff) : TargetCoeff := @@ -110,19 +110,19 @@ theorem submodule_eq_anchorPlane_of_generators_mem exact (Submodule.eq_of_le_of_finrank_le hle hdim).symm /-- The second first-input slice of the residual jet coefficients. -/ -def jetSliceA2 (c : TargetCoeff) : LinearForm := +@[expose] def jetSliceA2 (c : TargetCoeff) : LinearForm := jetA c • bLinear 0 + jetB c • bLinear 1 /-- The third first-input slice of the residual jet coefficients. -/ -def jetSliceA3 (c : TargetCoeff) : LinearForm := +@[expose] def jetSliceA3 (c : TargetCoeff) : LinearForm := jetB c • bLinear 0 /-- The second second-input slice of the residual jet coefficients. -/ -def jetSliceB2 (c : TargetCoeff) : LinearForm := +@[expose] def jetSliceB2 (c : TargetCoeff) : LinearForm := jetA c • aLinear 0 + jetB c • aLinear 1 /-- The third second-input slice of the residual jet coefficients. -/ -def jetSliceB3 (c : TargetCoeff) : LinearForm := +@[expose] def jetSliceB3 (c : TargetCoeff) : LinearForm := jetB c • aLinear 0 /-- Jet separation in the exact algebraic interface used later: the diff --git a/LeanPool/BooleanMultiplication/N4/JetShadow.lean b/LeanPool/BooleanMultiplication/N4/JetShadow.lean index 774e2943a3..c4bf072fbd 100644 --- a/LeanPool/BooleanMultiplication/N4/JetShadow.lean +++ b/LeanPool/BooleanMultiplication/N4/JetShadow.lean @@ -16,7 +16,7 @@ supported in `K₀` disappear on the four outside slices; the two remaining wedge directions give a subspace of rank at most two. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/LowProductBridge.lean b/LeanPool/BooleanMultiplication/N4/LowProductBridge.lean index 92c58c4e48..dbc249b4a5 100644 --- a/LeanPool/BooleanMultiplication/N4/LowProductBridge.lean +++ b/LeanPool/BooleanMultiplication/N4/LowProductBridge.lean @@ -17,7 +17,7 @@ input coordinate and one of the three rational places; no circuit states are enumerated. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -378,7 +378,7 @@ theorem anfTwoProjection_affine_mul_affine anfTwoProjection_linear_mul_linear, smul_zero, zero_add, add_zero] /-- The quadratic coordinate array of a squarefree monomial. -/ -def monomialTwo (s : Finset (Fin 8)) : TwoForm := fun i j => +@[expose] def monomialTwo (s : Finset (Fin 8)) : TwoForm := fun i j => if i = j then 0 else if s = {i, j} then 1 else 0 theorem anfTwoProjection_monomial (s : Finset (Fin 8)) : diff --git a/LeanPool/BooleanMultiplication/N4/Main.lean b/LeanPool/BooleanMultiplication/N4/Main.lean index 68fcfd2d86..a1e21a2b9b 100644 --- a/LeanPool/BooleanMultiplication/N4/Main.lean +++ b/LeanPool/BooleanMultiplication/N4/Main.lean @@ -15,7 +15,7 @@ algebraic seven-gate obstruction and the explicit nine-gate construction, this closes the `n = 4` theorem. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/Normalization.lean b/LeanPool/BooleanMultiplication/N4/Normalization.lean index 142f608c2d..62203a5cdd 100644 --- a/LeanPool/BooleanMultiplication/N4/Normalization.lean +++ b/LeanPool/BooleanMultiplication/N4/Normalization.lean @@ -16,7 +16,7 @@ vector without changing the state. This is exactly what later gates see in the semantic circuit model. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -75,7 +75,7 @@ def rOneANF : ANF 8 := targetANF rOneCoeff def rInfinityANF : ANF 8 := targetANF rInfinityCoeff /-- The span of the product evaluations at zero, one, and infinity. -/ -def rationalTargetSpace : Submodule F₂ (ANF 8) := +@[expose] def rationalTargetSpace : Submodule F₂ (ANF 8) := Submodule.span F₂ {rZeroANF, rOneANF, rInfinityANF} /-- Affine functions together with the rational-place product targets. -/ diff --git a/LeanPool/BooleanMultiplication/N4/NormalizedConstruction.lean b/LeanPool/BooleanMultiplication/N4/NormalizedConstruction.lean index 62605c2a45..e17e78ab67 100644 --- a/LeanPool/BooleanMultiplication/N4/NormalizedConstruction.lean +++ b/LeanPool/BooleanMultiplication/N4/NormalizedConstruction.lean @@ -15,7 +15,7 @@ commutation. No circuits are enumerated. The only finite calculation below is the three-coordinate proof that the rational place words are independent. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/PlaceState.lean b/LeanPool/BooleanMultiplication/N4/PlaceState.lean index 0e6566f692..f31522df40 100644 --- a/LeanPool/BooleanMultiplication/N4/PlaceState.lean +++ b/LeanPool/BooleanMultiplication/N4/PlaceState.lean @@ -19,7 +19,7 @@ in both directions. The only coordinate certificate is the displayed `7 × 7` change of Hankel coefficients. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/PlaceSymmetry.lean b/LeanPool/BooleanMultiplication/N4/PlaceSymmetry.lean index a069f6003d..018948c354 100644 --- a/LeanPool/BooleanMultiplication/N4/PlaceSymmetry.lean +++ b/LeanPool/BooleanMultiplication/N4/PlaceSymmetry.lean @@ -17,7 +17,7 @@ rational place and its first tangent to the zero place. No circuit states or Boolean functions are enumerated. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -26,7 +26,7 @@ noncomputable section /-- Images of the eight coordinate linear forms under the identity, translation, and reversal substitutions. -/ -def inputPlaceChange : Fin 3 → Fin 8 → LinearForm := +@[expose] def inputPlaceChange : Fin 3 → Fin 8 → LinearForm := ![ ![![1,0,0,0,0,0,0,0], ![0,1,0,0,0,0,0,0], ![0,0,1,0,0,0,0,0], ![0,0,0,1,0,0,0,0], @@ -42,7 +42,7 @@ def inputPlaceChange : Fin 3 → Fin 8 → LinearForm := ![0,0,0,0,0,1,0,0], ![0,0,0,0,1,0,0,0]]] /-- Apply the input coordinate change moving the chosen rational place to zero. -/ -def normalizePlaceLinear (theta : Fin 3) (ell : LinearForm) : LinearForm := +@[expose] def normalizePlaceLinear (theta : Fin 3) (ell : LinearForm) : LinearForm := ∑ i : Fin 8, ell i • inputPlaceChange theta i /-- Permute rational-place coefficients under the chosen place normalization. -/ diff --git a/LeanPool/BooleanMultiplication/N4/Places.lean b/LeanPool/BooleanMultiplication/N4/Places.lean index ac2ec7bbd1..f52e3e4507 100644 --- a/LeanPool/BooleanMultiplication/N4/Places.lean +++ b/LeanPool/BooleanMultiplication/N4/Places.lean @@ -16,7 +16,7 @@ search over circuits. Subsequent proofs consume the named rational, tangent, and degree-two-place families rather than raw bit patterns. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -24,13 +24,13 @@ namespace N4 noncomputable section /-- Determinant of a `3 × 3` matrix in characteristic two. -/ -def detThree (M : Matrix (Fin 3) (Fin 3) F₂) : F₂ := +@[expose] def detThree (M : Matrix (Fin 3) (Fin 3) F₂) : F₂ := M 0 0 * M 1 1 * M 2 2 + M 0 0 * M 1 2 * M 2 1 + M 0 1 * M 1 0 * M 2 2 + M 0 1 * M 1 2 * M 2 0 + M 0 2 * M 1 0 * M 2 1 + M 0 2 * M 1 1 * M 2 0 /-- A cubic minor obtained by deleting one row and one column. -/ -def hankelMinorThree (c : TargetCoeff) (dropRow dropCol : Fin 4) : F₂ := +@[expose] def hankelMinorThree (c : TargetCoeff) (dropRow dropCol : Fin 4) : F₂ := detThree fun i j => hankelMatrix c (dropRow.succAbove i) (dropCol.succAbove j) @@ -44,7 +44,7 @@ instance (c : TargetCoeff) : Decidable (HankelRankLETwo c) := by /-- The sixteen coefficient words in the manuscript's rank-at-most-two table, including zero. -/ -def rankTwoWord : Fin 16 → TargetCoeff := +@[expose] def rankTwoWord : Fin 16 → TargetCoeff := ![![0, 0, 0, 0, 0, 0, 0], ![0, 0, 0, 0, 0, 1, 0], ![0, 0, 0, 0, 0, 0, 1], diff --git a/LeanPool/BooleanMultiplication/N4/Prefix.lean b/LeanPool/BooleanMultiplication/N4/Prefix.lean index 8ff2e0a14e..9658eb7f4f 100644 --- a/LeanPool/BooleanMultiplication/N4/Prefix.lean +++ b/LeanPool/BooleanMultiplication/N4/Prefix.lean @@ -17,7 +17,7 @@ product has no cubic or quartic part, then any target quadratic shadow of that product is again in the rational-place space. No circuit enumeration is used. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuadraticCircuit.lean b/LeanPool/BooleanMultiplication/N4/QuadraticCircuit.lean index c4e59a9dce..f087b69cbd 100644 --- a/LeanPool/BooleanMultiplication/N4/QuadraticCircuit.lean +++ b/LeanPool/BooleanMultiplication/N4/QuadraticCircuit.lean @@ -17,7 +17,7 @@ quadratic coefficient projection, and the eight-form Hankel obstruction then rules out a flattening with eight products. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuadraticLower.lean b/LeanPool/BooleanMultiplication/N4/QuadraticLower.lean index 252df3a8eb..14d1541113 100644 --- a/LeanPool/BooleanMultiplication/N4/QuadraticLower.lean +++ b/LeanPool/BooleanMultiplication/N4/QuadraticLower.lean @@ -20,7 +20,7 @@ most four members. This replaces a search over quadratic circuits by a small linear-algebra certificate. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -309,7 +309,7 @@ theorem target_sum_two_decomposable_rankTwo {c : TargetCoeff} /-! ## Eight decomposable forms cannot cover the target space -/ /-- The coefficient vectors for evaluations at zero, one, and infinity. -/ -def rationalPlaceCoeff : Fin 3 → TargetCoeff := +@[expose] def rationalPlaceCoeff : Fin 3 → TargetCoeff := ![rZeroCoeff, rOneCoeff, rInfinityCoeff] theorem rationalPlaceCoeff_injective : Function.Injective rationalPlaceCoeff := by @@ -402,7 +402,7 @@ theorem add_mem_of_codim_one {V : Type*} [AddCommGroup V] [Module F₂ V] exact hm /-- The span of the three rational-place target two-forms. -/ -def rationalPlaceTwoSpace : Submodule F₂ TwoForm := +@[expose] def rationalPlaceTwoSpace : Submodule F₂ TwoForm := Submodule.span F₂ (Set.range (fun θ : Fin 3 => targetTwo (rationalPlaceCoeff θ))) theorem rationalPlaceTwoSpace_finrank_le_three : diff --git a/LeanPool/BooleanMultiplication/N4/QuadraticProjection.lean b/LeanPool/BooleanMultiplication/N4/QuadraticProjection.lean index f308eacf1e..ef446ae2c2 100644 --- a/LeanPool/BooleanMultiplication/N4/QuadraticProjection.lean +++ b/LeanPool/BooleanMultiplication/N4/QuadraticProjection.lean @@ -16,7 +16,7 @@ squarefree quadratic coefficients. Products of affine ANFs therefore become decomposable alternating forms. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -30,7 +30,7 @@ def anfLinearProjection : ANF 8 →ₗ[F₂] LinearForm where map_smul' a p := by ext i; simp /-- Extract quadratic coefficients, with repeated-index coordinates zero. -/ -def anfTwoProjection : ANF 8 →ₗ[F₂] TwoForm where +@[expose] def anfTwoProjection : ANF 8 →ₗ[F₂] TwoForm where toFun p i j := if i = j then 0 else p.coeff ⟨{i, j}⟩ map_add' p q := by funext i j diff --git a/LeanPool/BooleanMultiplication/N4/QuarticANF.lean b/LeanPool/BooleanMultiplication/N4/QuarticANF.lean index 615bdbe428..461fafb940 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticANF.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticANF.lean @@ -16,7 +16,7 @@ term, so it cancels before the cubic and quadratic projections are evaluated. This is the circuit-facing version of the exterior theorem. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -24,7 +24,7 @@ namespace N4 noncomputable section /-- An affine factor together with a linear combination of rational-place targets. -/ -def representedLowFactor (a : F₂) (ell : LinearForm) +@[expose] def representedLowFactor (a : F₂) (ell : LinearForm) (α : Fin 3 → F₂) : ANF 8 := affineANF a ell + rationalANF α diff --git a/LeanPool/BooleanMultiplication/N4/QuarticAllPairs.lean b/LeanPool/BooleanMultiplication/N4/QuarticAllPairs.lean index e01be8c968..20c7064fc9 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticAllPairs.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticAllPairs.lean @@ -16,7 +16,7 @@ two. This lets the low--low proof select a nonzero `2 × 2` coefficient minor directly, without formalizing a separate `PGL₂(F₂)` action. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -74,7 +74,7 @@ def quarticSupportPair : Fin 3 → Fin 3 × Fin 3 := ![(1, 0), (0, 2), (1, 2)] /-- A vector in the two-input support of a chosen rational place. -/ -def quarticSupportVector (theta : Fin 3) (a b : F₂) : LinearForm := +@[expose] def quarticSupportVector (theta : Fin 3) (a b : F₂) : LinearForm := a • placeA theta + b • placeB theta /-- Select a packed separating covector for one of the three rational-place pairs. -/ diff --git a/LeanPool/BooleanMultiplication/N4/QuarticAnnihilator.lean b/LeanPool/BooleanMultiplication/N4/QuarticAnnihilator.lean index 950d0be83d..83dd0ac124 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticAnnihilator.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticAnnihilator.lean @@ -16,7 +16,7 @@ nonzero rational coefficient vectors and 128 Hankel words. It is an algebraic coordinate check, not a circuit or truth-table enumeration. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -24,11 +24,11 @@ namespace N4 noncomputable section /-- The unit coefficient vector for one rational place. -/ -def rationalSingleton (theta : Fin 3) : Fin 3 → F₂ := +@[expose] def rationalSingleton (theta : Fin 3) : Fin 3 → F₂ := ![![1, 0, 0], ![0, 1, 0], ![0, 0, 1]] theta /-- A first-jet target at a rational place, optionally translated by the place itself. -/ -def rationalTangentAt (theta : Fin 3) (eps : F₂) : TargetCoeff := +@[expose] def rationalTangentAt (theta : Fin 3) (eps : F₂) : TargetCoeff := match theta with | ⟨0, _⟩ => ![eps, 1, 0, 0, 0, 0, 0] | ⟨1, _⟩ => @@ -55,7 +55,7 @@ def quarticAnnihilatorTable : Fin 9 → Nat := 0x092c00, 0x018482, 0x086000] /-- The scalar bilinear formula for a quartic-annihilator probe on target coordinates. -/ -def quarticAnnihilatorCoeffProbe +@[expose] def quarticAnnihilatorCoeffProbe (c : TargetCoeff) (delta : Fin 3 → F₂) (k : Fin 9) : F₂ := match k with | ⟨0, _⟩ => c 0 * delta 1 + c 2 * delta 0 + c 2 * delta 1 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticBasisChange.lean b/LeanPool/BooleanMultiplication/N4/QuarticBasisChange.lean index 9c05a7fbff..bb6551bf17 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticBasisChange.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticBasisChange.lean @@ -17,7 +17,7 @@ the affine and linear parts preserves the cubic projection; its quadratic projection changes only by an explicitly rational form. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -33,7 +33,7 @@ def basisChangeQ (α γ : Fin 3 → F₂) (i j : Fin 3) : F₂ := α i * γ j + α j * γ i /-- A two-term linear combination of rational-place coefficient vectors. -/ -def coeffCombination (p q : F₂) (α β : Fin 3 → F₂) : Fin 3 → F₂ := +@[expose] def coeffCombination (p q : F₂) (α β : Fin 3 → F₂) : Fin 3 → F₂ := p • α + q • β /-- The two pairs of rational coefficient vectors have the same three exterior minors. -/ diff --git a/LeanPool/BooleanMultiplication/N4/QuarticCircuit.lean b/LeanPool/BooleanMultiplication/N4/QuarticCircuit.lean index a246709122..3bec1e18c7 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticCircuit.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticCircuit.lean @@ -16,7 +16,7 @@ from its interface and applies the result to the first useful child of the normalized seed. No circuit enumeration is involved. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticCoordinates.lean b/LeanPool/BooleanMultiplication/N4/QuarticCoordinates.lean index 8da4457439..f0af80f9d3 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticCoordinates.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticCoordinates.lean @@ -21,7 +21,7 @@ Thus the certificate is a small algebraic matrix check, not an enumeration of circuits or Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -105,11 +105,11 @@ def quarticSeparatorEval (a b c d : F₂) (i : Fin 9) (q : TwoForm) : F₂ := quarticSeparatorLinear a b c d i q /-- A vector in the two-dimensional input support at the place one. -/ -def quarticPoneVector (a b : F₂) : LinearForm := +@[expose] def quarticPoneVector (a b : F₂) : LinearForm := a • placeA 1 + b • placeB 1 /-- A vector in the two-dimensional input support at the place zero. -/ -def quarticPzeroVector (c d : F₂) : LinearForm := +@[expose] def quarticPzeroVector (c d : F₂) : LinearForm := c • placeA 0 + d • placeB 0 theorem quarticSeparator_target_check : @@ -333,9 +333,9 @@ theorem quartic_cubic_kernel_zero_one (x y : LinearForm) exact ⟨a, b, c, d, hx, by simpa [quarticPzeroVector] using hy⟩ /-- Select evaluation at zero among the three rational-place coordinates. -/ -def zeroPlaceCoeff3 : Fin 3 → F₂ := ![1, 0, 0] +@[expose] def zeroPlaceCoeff3 : Fin 3 → F₂ := ![1, 0, 0] /-- Select evaluation at one among the three rational-place coordinates. -/ -def onePlaceCoeff3 : Fin 3 → F₂ := ![0, 1, 0] +@[expose] def onePlaceCoeff3 : Fin 3 → F₂ := ![0, 1, 0] @[simp] theorem rationalTwo_zeroPlaceCoeff3 : rationalTwo zeroPlaceCoeff3 = rationalPlaceTwo 0 := by diff --git a/LeanPool/BooleanMultiplication/N4/QuarticExclusion.lean b/LeanPool/BooleanMultiplication/N4/QuarticExclusion.lean index edb56e6e92..942b92f114 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticExclusion.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticExclusion.lean @@ -15,7 +15,7 @@ place. The complete zero-place slice theorem then excludes every possible second direction in the normalized seed plane. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticIdempotence.lean b/LeanPool/BooleanMultiplication/N4/QuarticIdempotence.lean index e96efd8466..81915b7d17 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticIdempotence.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticIdempotence.lean @@ -16,7 +16,7 @@ certificate are projected. Their product formula is proved on the representation of all 210 coordinates of `Λ⁴(F₂⁸)`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticIdempotenceConsequences.lean b/LeanPool/BooleanMultiplication/N4/QuarticIdempotenceConsequences.lean index 2e7902439d..defbdd11a4 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticIdempotenceConsequences.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticIdempotenceConsequences.lean @@ -16,7 +16,7 @@ Every summand except target times rational has degree at most three, so the quartic equation is exactly the rational-annihilator probe. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticLowLow.lean b/LeanPool/BooleanMultiplication/N4/QuarticLowLow.lean index 84f9727781..cde3ae253d 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticLowLow.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticLowLow.lean @@ -16,7 +16,7 @@ the two linear differences. Their quadratic wedge shadow therefore lies in one of the three support-pair spaces certified in `QuarticAllPairs`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -24,7 +24,7 @@ namespace N4 noncomputable section /-- A two-by-two minor of two rational coefficient vectors. -/ -def rationalCoeffMinor (α β : Fin 3 → F₂) (i j : Fin 3) : F₂ := +@[expose] def rationalCoeffMinor (α β : Fin 3 → F₂) (i j : Fin 3) : F₂ := α i * β j + α j * β i @[simp] theorem f2_mul_self_quartic (u : F₂) : u * u = u := by diff --git a/LeanPool/BooleanMultiplication/N4/QuarticOrbits.lean b/LeanPool/BooleanMultiplication/N4/QuarticOrbits.lean index 43586364b5..bdb0216ddf 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticOrbits.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticOrbits.lean @@ -15,7 +15,7 @@ The only finite certificate is the left inverse in `CubicDirect`; the orbit arguments below are ordinary exterior algebra and coordinate extensionality. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticPlaneNormalization.lean b/LeanPool/BooleanMultiplication/N4/QuarticPlaneNormalization.lean index 38781c5d03..bfe0d90e2b 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticPlaneNormalization.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticPlaneNormalization.lean @@ -17,7 +17,7 @@ Changing factor basis modifies the seed product only by rational-low wires, which are absorbed into the existing correction. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticSeedClassified.lean b/LeanPool/BooleanMultiplication/N4/QuarticSeedClassified.lean index 17bd8f73ed..df7b9149b3 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticSeedClassified.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticSeedClassified.lean @@ -16,7 +16,7 @@ in their plane, excludes the zero feedback, and applies the rational annihilator classification. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticSeedNormalForm.lean b/LeanPool/BooleanMultiplication/N4/QuarticSeedNormalForm.lean index 8bcdfcebc6..140ad7c0e1 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticSeedNormalForm.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticSeedNormalForm.lean @@ -16,7 +16,7 @@ remaining seed-using type is recorded together with its two Boolean idempotence equations and the rational-annihilator certificate. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuarticSeedUsing.lean b/LeanPool/BooleanMultiplication/N4/QuarticSeedUsing.lean index 5f2aded757..4ce73ae58a 100644 --- a/LeanPool/BooleanMultiplication/N4/QuarticSeedUsing.lean +++ b/LeanPool/BooleanMultiplication/N4/QuarticSeedUsing.lean @@ -18,7 +18,7 @@ actual target-ambient product `F = (g + a) * c` outside the rational-low state. This is the precise input to the quartic idempotence argument. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/QuinticBridge.lean b/LeanPool/BooleanMultiplication/N4/QuinticBridge.lean index e374cf84fe..b76dce6f55 100644 --- a/LeanPool/BooleanMultiplication/N4/QuinticBridge.lean +++ b/LeanPool/BooleanMultiplication/N4/QuinticBridge.lean @@ -17,7 +17,7 @@ on the `8 * 3 * 2` input/place/tangent basis rows and extended by linearity. This is a fixed algebraic matrix certificate, not circuit enumeration. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/ReedMuller.lean b/LeanPool/BooleanMultiplication/N4/ReedMuller.lean index f3ba0858e6..6be409b51f 100644 --- a/LeanPool/BooleanMultiplication/N4/ReedMuller.lean +++ b/LeanPool/BooleanMultiplication/N4/ReedMuller.lean @@ -19,7 +19,7 @@ where `a` is affine. The minimum-weight proof is therefore an induction on variables, not an enumeration of eight-variable truth tables. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -105,10 +105,10 @@ def QuadraticCode.eval : {n : Nat} → QuadraticCode n → (Fin n → F₂) → rfl /-- The natural-number indicator of a nonzero field element. -/ -def truthBit (a : F₂) : Nat := if a = 0 then 0 else 1 +@[expose] def truthBit (a : F₂) : Nat := if a = 0 then 0 else 1 /-- The number of inputs on which a field-valued function is nonzero. -/ -def truthWeight {X : Type*} [Fintype X] (f : X → F₂) : Nat := +@[expose] def truthWeight {X : Type*} [Fintype X] (f : X → F₂) : Nat := ∑ x, truthBit (f x) theorem truthBit_zero : truthBit (0 : F₂) = 0 := by simp [truthBit] diff --git a/LeanPool/BooleanMultiplication/N4/Rewiring.lean b/LeanPool/BooleanMultiplication/N4/Rewiring.lean index 8a7028d09a..1396654547 100644 --- a/LeanPool/BooleanMultiplication/N4/Rewiring.lean +++ b/LeanPool/BooleanMultiplication/N4/Rewiring.lean @@ -17,7 +17,7 @@ transported across the equality of wire spaces. This file implements that transport as an actual `Circuit`, rather than only as a flag-level statement. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SecondFeedbackHigh.lean b/LeanPool/BooleanMultiplication/N4/SecondFeedbackHigh.lean index 268bf33c88..ecca417a97 100644 --- a/LeanPool/BooleanMultiplication/N4/SecondFeedbackHigh.lean +++ b/LeanPool/BooleanMultiplication/N4/SecondFeedbackHigh.lean @@ -16,7 +16,7 @@ supported on `K₀` and at most two exterior directions. Jet separation sends the resulting target back to the feedback state. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SecondFeedbackLow.lean b/LeanPool/BooleanMultiplication/N4/SecondFeedbackLow.lean index 3c51fc7203..93f633d8a8 100644 --- a/LeanPool/BooleanMultiplication/N4/SecondFeedbackLow.lean +++ b/LeanPool/BooleanMultiplication/N4/SecondFeedbackLow.lean @@ -15,7 +15,7 @@ feedback coefficient space. The independent alternative is confined to the four-dimensional first-jet support `K₀` by cubic rows. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -23,7 +23,7 @@ namespace N4 noncomputable section /-- A linear form is supported on the first two coefficients of each input polynomial. -/ -def InK0Linear (ell : LinearForm) : Prop := +@[expose] def InK0Linear (ell : LinearForm) : Prop := ell 2 = 0 ∧ ell 3 = 0 ∧ ell 6 = 0 ∧ ell 7 = 0 theorem normalizedFirstJetVector_inK0 (pa pb ja jb : F₂) : diff --git a/LeanPool/BooleanMultiplication/N4/SecondFeedbackUsing.lean b/LeanPool/BooleanMultiplication/N4/SecondFeedbackUsing.lean index f2451ef511..4cfa217891 100644 --- a/LeanPool/BooleanMultiplication/N4/SecondFeedbackUsing.lean +++ b/LeanPool/BooleanMultiplication/N4/SecondFeedbackUsing.lean @@ -17,7 +17,7 @@ linear parts of the other factor. The remaining constant would put the nonzero seed cubic in the quadratic target ambient. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SecondJet.lean b/LeanPool/BooleanMultiplication/N4/SecondJet.lean index 30726d75fa..a9edd0dec0 100644 --- a/LeanPool/BooleanMultiplication/N4/SecondJet.lean +++ b/LeanPool/BooleanMultiplication/N4/SecondJet.lean @@ -17,7 +17,7 @@ matrix on coordinate vectors and target basis elements; no truth table or circuit state is enumerated. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SeedChild.lean b/LeanPool/BooleanMultiplication/N4/SeedChild.lean index 8f4a231278..b20b9b1302 100644 --- a/LeanPool/BooleanMultiplication/N4/SeedChild.lean +++ b/LeanPool/BooleanMultiplication/N4/SeedChild.lean @@ -17,7 +17,7 @@ to one of two forms: a low--low product, or a product with exactly one both the quartic and cubic feedback arguments. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SemanticQuadratic.lean b/LeanPool/BooleanMultiplication/N4/SemanticQuadratic.lean index 0cedfc0b1a..433b7f05c9 100644 --- a/LeanPool/BooleanMultiplication/N4/SemanticQuadratic.lean +++ b/LeanPool/BooleanMultiplication/N4/SemanticQuadratic.lean @@ -15,7 +15,7 @@ connects that code to canonical Boolean ANFs without enumerating functions. Only sparse evaluations and finite sums of monomials are used. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -188,7 +188,7 @@ theorem quadratic_semantic_of_degreeLE {p : ANF 8} (hp : DegreeLE 2 p) : · exact Submodule.zero_mem _ /-- The Boolean assignment whose nonzero coordinates form the given finite set. -/ -def supportAssignment (t : Finset (Fin 8)) : Fin 8 → F₂ := +@[expose] def supportAssignment (t : Finset (Fin 8)) : Fin 8 → F₂ := fun i => if i ∈ t then 1 else 0 theorem prod_supportAssignment (s t : Finset (Fin 8)) : diff --git a/LeanPool/BooleanMultiplication/N4/SevenGate.lean b/LeanPool/BooleanMultiplication/N4/SevenGate.lean index 3e2fdd11d2..4814fc14ae 100644 --- a/LeanPool/BooleanMultiplication/N4/SevenGate.lean +++ b/LeanPool/BooleanMultiplication/N4/SevenGate.lean @@ -19,7 +19,7 @@ in `Aff + R`, contradicting the presence of a non-rational target direction. This argument uses neither circuit enumeration nor a truth-table search. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SexticPlane.lean b/LeanPool/BooleanMultiplication/N4/SexticPlane.lean index fb2fdcf4f0..9835ace24f 100644 --- a/LeanPool/BooleanMultiplication/N4/SexticPlane.lean +++ b/LeanPool/BooleanMultiplication/N4/SexticPlane.lean @@ -17,7 +17,7 @@ every term containing an affine factor, so no large exterior-power coordinate space or circuit enumeration is needed. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SliceBridge.lean b/LeanPool/BooleanMultiplication/N4/SliceBridge.lean index 29f89cea2e..e9cef18e73 100644 --- a/LeanPool/BooleanMultiplication/N4/SliceBridge.lean +++ b/LeanPool/BooleanMultiplication/N4/SliceBridge.lean @@ -16,7 +16,7 @@ Those three coefficient equations are exactly the inputs consumed by `no_typeA_active_slice_pair` and `no_typeB_active_slice_pair`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/SliceExclusion.lean b/LeanPool/BooleanMultiplication/N4/SliceExclusion.lean index fbd25f3f1d..77dbd5d7e1 100644 --- a/LeanPool/BooleanMultiplication/N4/SliceExclusion.lean +++ b/LeanPool/BooleanMultiplication/N4/SliceExclusion.lean @@ -17,7 +17,7 @@ only exterior products and the two support planes established in `SliceGeometry`; it does not enumerate circuits or Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -25,27 +25,27 @@ namespace N4 noncomputable section /-- The linear slice variation induced by the two anchor values. -/ -def sliceVaryingLinear (x y : F₂) : LinearForm := +@[expose] def sliceVaryingLinear (x y : F₂) : LinearForm := x • sliceBBar + y • sliceABar /-- Coordinatewise product of two linear coefficient vectors. -/ -def pointwiseLinearProduct (ell m : LinearForm) : LinearForm := +@[expose] def pointwiseLinearProduct (ell m : LinearForm) : LinearForm := fun i => ell i * m i /-- Linear part of `(mu + ell) * (nu + n + Q)`, followed by the fixed correction and the `r₁` slice variation. -/ -def sliceProductLinear +@[expose] def sliceProductLinear (mu nu : F₂) (ell n base : LinearForm) (lambdaOne x y : F₂) : LinearForm := mu • n + nu • ell + pointwiseLinearProduct ell n + base + lambdaOne • sliceVaryingLinear x y /-- The difference in the target linear parts at two anchor assignments. -/ -def sliceTargetDifference (x y x' y' : F₂) : LinearForm := +@[expose] def sliceTargetDifference (x y x' y' : F₂) : LinearForm := (y + y') • sliceU + (x + x') • sliceV /-- Vanishing of the type-A slice quadratic after its rational correction. -/ -def SliceQuadraticEquationA +@[expose] def SliceQuadraticEquationA (mu : F₂) (ell n : LinearForm) (lambdaOne lambdaInfinity : F₂) : Prop := mu • sliceQuadraticA + vectorWedge ell n + @@ -53,7 +53,7 @@ def SliceQuadraticEquationA lambdaInfinity • sliceInfinityQuadratic = 0 /-- Vanishing of the type-B slice quadratic after its rational correction. -/ -def SliceQuadraticEquationB +@[expose] def SliceQuadraticEquationB (mu : F₂) (ell n : LinearForm) (lambdaOne lambdaInfinity : F₂) : Prop := mu • sliceQuadraticB + vectorWedge ell n + @@ -421,7 +421,7 @@ theorem no_typeA_active_slice_pair exact distinct_corner_target_difference_not_in_plane hdistinct hsumPlane /-- Vanishing of the infinity-type slice quadratic after its rational correction. -/ -def SliceQuadraticEquationInfinity +@[expose] def SliceQuadraticEquationInfinity (mu : F₂) (ell n : LinearForm) (lambdaOne lambdaInfinity : F₂) : Prop := mu • sliceInfinityQuadratic + vectorWedge ell n + diff --git a/LeanPool/BooleanMultiplication/N4/SliceGeometry.lean b/LeanPool/BooleanMultiplication/N4/SliceGeometry.lean index 65d1f57b48..7c97604556 100644 --- a/LeanPool/BooleanMultiplication/N4/SliceGeometry.lean +++ b/LeanPool/BooleanMultiplication/N4/SliceGeometry.lean @@ -18,7 +18,7 @@ proved from fixed exterior coordinates; no circuits or truth tables are enumerated. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -26,29 +26,29 @@ namespace N4 noncomputable section /-- The two anchor variables used to slice the Boolean identities. -/ -def sliceX : LinearForm := aLinear 0 +@[expose] def sliceX : LinearForm := aLinear 0 /-- The second polynomial constant coefficient, used as a slice anchor. -/ -def sliceY : LinearForm := bLinear 0 +@[expose] def sliceY : LinearForm := bLinear 0 /-- The first complementary target directions. -/ -def sliceU : LinearForm := aLinear 1 +@[expose] def sliceU : LinearForm := aLinear 1 /-- The second polynomial linear coefficient, complementary to its slice anchor. -/ -def sliceV : LinearForm := bLinear 1 +@[expose] def sliceV : LinearForm := bLinear 1 /-- Sums of the three variables complementary to the zero place. -/ -def sliceABar : LinearForm := placeA 1 + placeA 0 +@[expose] def sliceABar : LinearForm := placeA 1 + placeA 0 /-- The sum of the three second-polynomial input variables away from the zero-place anchor. -/ -def sliceBBar : LinearForm := placeB 1 + placeB 0 +@[expose] def sliceBBar : LinearForm := placeB 1 + placeB 0 /-- Type A complementary quadratic part. -/ -def sliceQuadraticA : TwoForm := vectorWedge sliceABar sliceBBar +@[expose] def sliceQuadraticA : TwoForm := vectorWedge sliceABar sliceBBar /-- The extra infinity-place term producing type B. -/ -def sliceInfinityQuadratic : TwoForm := +@[expose] def sliceInfinityQuadratic : TwoForm := vectorWedge (placeA 2) (placeB 2) /-- Type B complementary quadratic part. -/ -def sliceQuadraticB : TwoForm := +@[expose] def sliceQuadraticB : TwoForm := sliceQuadraticA + sliceInfinityQuadratic /-- The plane spanned by the complementary evaluation-at-one input directions. -/ diff --git a/LeanPool/BooleanMultiplication/N4/SliceModels.lean b/LeanPool/BooleanMultiplication/N4/SliceModels.lean index c5c6c5c7b9..1649ada3a5 100644 --- a/LeanPool/BooleanMultiplication/N4/SliceModels.lean +++ b/LeanPool/BooleanMultiplication/N4/SliceModels.lean @@ -17,7 +17,7 @@ lets the homogeneous projections already used by the exterior argument apply without introducing a second ANF type or enumerating Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -33,46 +33,46 @@ def sliceAnchorValue (ell : LinearForm) (x y : F₂) : F₂ := ell 0 * x + ell 4 * y /-- The ANF product of the two complementary evaluation-at-one directions. -/ -def sliceQuadraticAANF : ANF 8 := +@[expose] def sliceQuadraticAANF : ANF 8 := linearANF sliceABar * linearANF sliceBBar /-- The product of the two leading input coefficients. -/ -def sliceInfinityQuadraticANF : ANF 8 := +@[expose] def sliceInfinityQuadraticANF : ANF 8 := linearANF (placeA 2) * linearANF (placeB 2) /-- The sum of the complementary evaluation-at-one and infinity products. -/ -def sliceQuadraticBANF : ANF 8 := +@[expose] def sliceQuadraticBANF : ANF 8 := sliceQuadraticAANF + sliceInfinityQuadraticANF /-- Restrict an affine factor plus the zero-place product to an anchor slice. -/ -def sliceZeroFactorModel +@[expose] def sliceZeroFactorModel (a : F₂) (ell : LinearForm) (x y : F₂) : ANF 8 := affineANF (a + sliceAnchorValue ell x y + x * y) (sliceComplementLinear ell) /-- Restrict an affine factor plus the evaluation-at-one product to an anchor slice. -/ -def sliceOneFactorModel +@[expose] def sliceOneFactorModel (a : F₂) (ell : LinearForm) (x y : F₂) : ANF 8 := affineANF (a + sliceAnchorValue ell x y + x * y) (sliceComplementLinear ell + sliceVaryingLinear x y) + sliceQuadraticAANF /-- Restrict an affine factor plus the infinity-place product to an anchor slice. -/ -def sliceInfinityFactorModel +@[expose] def sliceInfinityFactorModel (a : F₂) (ell : LinearForm) (x y : F₂) : ANF 8 := affineANF (a + sliceAnchorValue ell x y) (sliceComplementLinear ell) + sliceInfinityQuadraticANF /-- Restrict an affine factor with type-B quadratic part to an anchor slice. -/ -def sliceTypeBFactorModel +@[expose] def sliceTypeBFactorModel (a : F₂) (ell : LinearForm) (x y : F₂) : ANF 8 := affineANF (a + sliceAnchorValue ell x y + x * y) (sliceComplementLinear ell + sliceVaryingLinear x y) + sliceQuadraticBANF /-- Restrict an affine-plus-rational-target correction to an anchor slice. -/ -def sliceCorrectionModel +@[expose] def sliceCorrectionModel (a : F₂) (ell : LinearForm) (alpha : Fin 3 → F₂) (x y : F₂) : ANF 8 := affineANF @@ -82,7 +82,7 @@ def sliceCorrectionModel alpha 2 • sliceInfinityQuadraticANF /-- Restrict an affine perturbation of a first-jet tangent target to an anchor slice. -/ -def sliceTangentModel +@[expose] def sliceTangentModel (a : F₂) (ell : LinearForm) (eps x y : F₂) : ANF 8 := affineANF (a + sliceAnchorValue ell x y + eps * x * y) (sliceComplementLinear ell + y • sliceU + x • sliceV) diff --git a/LeanPool/BooleanMultiplication/N4/SliceProjection.lean b/LeanPool/BooleanMultiplication/N4/SliceProjection.lean index 711b25af74..3667fdcbc6 100644 --- a/LeanPool/BooleanMultiplication/N4/SliceProjection.lean +++ b/LeanPool/BooleanMultiplication/N4/SliceProjection.lean @@ -16,7 +16,7 @@ explicit complementary quadratics; there is no search over circuits or Boolean functions. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -528,7 +528,7 @@ theorem booleanContraction_zero (q : TwoForm) : simp [booleanContraction] /-- The full sliced type-A product, including its affine and rational-target correction. -/ -def sliceTypeAFullModel +@[expose] def sliceTypeAFullModel (leftConst : F₂) (leftLinear : LinearForm) (rightConst : F₂) (rightLinear : LinearForm) (correctionConst : F₂) (correctionLinear : LinearForm) @@ -539,7 +539,7 @@ def sliceTypeAFullModel correctionCoeff x y /-- The full sliced type-B product, including its affine and rational-target correction. -/ -def sliceTypeBFullModel +@[expose] def sliceTypeBFullModel (leftConst : F₂) (leftLinear : LinearForm) (rightConst : F₂) (rightLinear : LinearForm) (correctionConst : F₂) (correctionLinear : LinearForm) @@ -550,7 +550,7 @@ def sliceTypeBFullModel correctionCoeff x y /-- The full sliced infinity-type product, including its affine and rational-target correction. -/ -def sliceTypeInfinityFullModel +@[expose] def sliceTypeInfinityFullModel (leftConst : F₂) (leftLinear : LinearForm) (rightConst : F₂) (rightLinear : LinearForm) (correctionConst : F₂) (correctionLinear : LinearForm) diff --git a/LeanPool/BooleanMultiplication/N4/SliceVanishing.lean b/LeanPool/BooleanMultiplication/N4/SliceVanishing.lean index a4ad4f434e..2e28e0f54d 100644 --- a/LeanPool/BooleanMultiplication/N4/SliceVanishing.lean +++ b/LeanPool/BooleanMultiplication/N4/SliceVanishing.lean @@ -18,7 +18,7 @@ equal. Hence there is exactly one zero corner and exactly three active slices. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -26,7 +26,7 @@ namespace N4 noncomputable section /-- Embed six complementary values between the two anchor variables. -/ -def sliceAssignment (x y : F₂) (z : Fin 6 → F₂) : Fin 8 → F₂ := +@[expose] def sliceAssignment (x y : F₂) (z : Fin 6 → F₂) : Fin 8 → F₂ := ![x, z 0, z 1, z 2, y, z 3, z 4, z 5] /-- The zero assignment on the six complementary slice inputs. -/ diff --git a/LeanPool/BooleanMultiplication/N4/Tail.lean b/LeanPool/BooleanMultiplication/N4/Tail.lean index 6ec29cc1dd..bc883b222d 100644 --- a/LeanPool/BooleanMultiplication/N4/Tail.lean +++ b/LeanPool/BooleanMultiplication/N4/Tail.lean @@ -16,7 +16,7 @@ rank-one classification is proved from minors, so the annihilator argument does not enumerate the 128 target words or build a large exterior basis. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/N4/Target.lean b/LeanPool/BooleanMultiplication/N4/Target.lean index 256c6043d0..7cc971e9a8 100644 --- a/LeanPool/BooleanMultiplication/N4/Target.lean +++ b/LeanPool/BooleanMultiplication/N4/Target.lean @@ -15,7 +15,7 @@ seven target directions. They make the flag ledger numerically usable while keeping all proofs in ordinary linear algebra over `F₂`. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -32,7 +32,7 @@ def targetANFLinear : TargetCoeff →ₗ[F₂] ANF 8 where smul_eq_mul] @[simp] theorem targetANFLinear_apply (c : TargetCoeff) : - targetANFLinear c = targetANF c := rfl + targetANFLinear c = targetANF c := by rfl /-- Seven quadratic monomials, one private to each coordinate of `Mul 4`. -/ def fourTargetAnchor : Fin 7 → Monomial 8 := diff --git a/LeanPool/BooleanMultiplication/N4/TwoForm.lean b/LeanPool/BooleanMultiplication/N4/TwoForm.lean index 14259479e5..cbd46bba66 100644 --- a/LeanPool/BooleanMultiplication/N4/TwoForm.lean +++ b/LeanPool/BooleanMultiplication/N4/TwoForm.lean @@ -15,7 +15,7 @@ the `4 × 4` Hankel matrix in its two cross blocks. This small coordinate layer is shared by the quadratic lower bound and the cubic annihilator. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 @@ -23,18 +23,18 @@ namespace N4 noncomputable section /-- Coordinate linear forms on the two four-dimensional input blocks. -/ -def aLinear (i : Fin 4) : LinearForm := +@[expose] def aLinear (i : Fin 4) : LinearForm := (Pi.basisFun F₂ (Fin 8)) (aCoord i) /-- The linear form selecting one coefficient of the second input polynomial. -/ -def bLinear (i : Fin 4) : LinearForm := +@[expose] def bLinear (i : Fin 4) : LinearForm := (Pi.basisFun F₂ (Fin 8)) (bCoord i) /-- The first three Hasse coefficients at the rational place zero. -/ -def zeroPlaceTwo : TwoForm := vectorWedge (aLinear 0) (bLinear 0) +@[expose] def zeroPlaceTwo : TwoForm := vectorWedge (aLinear 0) (bLinear 0) /-- The two-form of the first Hasse coefficient at zero. -/ -def zeroFirstJetTwo : TwoForm := +@[expose] def zeroFirstJetTwo : TwoForm := vectorWedge (aLinear 0) (bLinear 1) + vectorWedge (aLinear 1) (bLinear 0) @@ -45,7 +45,7 @@ def zeroSecondJetTwo : TwoForm := vectorWedge (aLinear 2) (bLinear 0) /-- The alternating two-form whose mixed block is the target Hankel matrix. -/ -def targetTwo (c : TargetCoeff) : TwoForm := fun i j => +@[expose] def targetTwo (c : TargetCoeff) : TwoForm := fun i j => if hi : i.val < 4 then if hj : 4 ≤ j.val then c ⟨i.val + (j.val - 4), by omega⟩ diff --git a/LeanPool/BooleanMultiplication/N4/UsefulWitness.lean b/LeanPool/BooleanMultiplication/N4/UsefulWitness.lean index 014393f030..0f67468d31 100644 --- a/LeanPool/BooleanMultiplication/N4/UsefulWitness.lean +++ b/LeanPool/BooleanMultiplication/N4/UsefulWitness.lean @@ -16,7 +16,7 @@ extension. This file packages that linear-algebra step once. It is entirely independent of the later homogeneous-coordinate calculations. -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul namespace N4 diff --git a/LeanPool/BooleanMultiplication/SmallCases.lean b/LeanPool/BooleanMultiplication/SmallCases.lean index 4c39e578ad..f95495a043 100644 --- a/LeanPool/BooleanMultiplication/SmallCases.lean +++ b/LeanPool/BooleanMultiplication/SmallCases.lean @@ -11,7 +11,7 @@ public import LeanPool.BooleanMultiplication.Mul # Exact small cases and explicit upper-bound circuits -/ -@[expose] public section +public section namespace UnrestrictedBooleanMul diff --git a/LeanPool/BrauerGroupNew.lean b/LeanPool/BrauerGroupNew.lean index f27e652cc4..3be2153d9a 100644 --- a/LeanPool/BrauerGroupNew.lean +++ b/LeanPool/BrauerGroupNew.lean @@ -50,4 +50,4 @@ Tags: algebra, ring-theory, central-simple-algebras, brauer-groups MSC: 16K20, 16K50, 16S35 -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/AbsoluteIsoH2.lean b/LeanPool/BrauerGroupNew/AbsoluteIsoH2.lean index a2bd009e87..ee5db68824 100644 --- a/LeanPool/BrauerGroupNew/AbsoluteIsoH2.lean +++ b/LeanPool/BrauerGroupNew/AbsoluteIsoH2.lean @@ -19,6 +19,6 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.BrauerGroupNew.AbsoluteIsoH2`. -/ -@[expose] public section +public section variable (F F_star : Type) [Field F] [Field F_star] [Algebra F F_star] [IsSepClosure F F_star] diff --git a/LeanPool/BrauerGroupNew/AlgClosedUnion.lean b/LeanPool/BrauerGroupNew/AlgClosedUnion.lean index 701ead0438..5dcf2877ae 100644 --- a/LeanPool/BrauerGroupNew/AlgClosedUnion.lean +++ b/LeanPool/BrauerGroupNew/AlgClosedUnion.lean @@ -16,7 +16,7 @@ This file ports auxiliary results about finite intermediate fields inside an alg closure and tensor products over their directed union. -/ -@[expose] public section +public section suppress_compilation diff --git a/LeanPool/BrauerGroupNew/Azumaya/Basic.lean b/LeanPool/BrauerGroupNew/Azumaya/Basic.lean index b62aaa9ae4..2802ac033a 100644 --- a/LeanPool/BrauerGroupNew/Azumaya/Basic.lean +++ b/LeanPool/BrauerGroupNew/Azumaya/Basic.lean @@ -29,7 +29,7 @@ import Mathlib.RingTheory.SimpleRing.Matrix Imported Lean Pool material for `LeanPool.BrauerGroupNew.Azumaya.Basic`. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/BrauerGroupNew/Azumaya/Mul.lean b/LeanPool/BrauerGroupNew/Azumaya/Mul.lean index 348fcfbe63..34e751092a 100644 --- a/LeanPool/BrauerGroupNew/Azumaya/Mul.lean +++ b/LeanPool/BrauerGroupNew/Azumaya/Mul.lean @@ -19,7 +19,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic Imported Lean Pool material for `LeanPool.BrauerGroupNew.Azumaya.Mul`. -/ -@[expose] public section +public section suppress_compilation diff --git a/LeanPool/BrauerGroupNew/BrauerGroup.lean b/LeanPool/BrauerGroupNew/BrauerGroup.lean index da803cd8bc..7f85f4b7a8 100644 --- a/LeanPool/BrauerGroupNew/BrauerGroup.lean +++ b/LeanPool/BrauerGroupNew/BrauerGroup.lean @@ -28,7 +28,7 @@ public import Mathlib.RingTheory.SimpleRing.Matrix Imported Lean Pool material for `LeanPool.BrauerGroupNew.BrauerGroup`. -/ -@[expose] public section +public section suppress_compilation universe u v v₁ v₂ w @@ -72,7 +72,7 @@ instance st : IsScalarTower K K (Module.End K A) where change (k₁ * k₂) • f a = k₁ • (k₂ • f a) rw [mul_smul] /-- The action map from `A ⊗ Aᵐᵒᵖ` to endomorphisms of `A`. -/ -def toEnd : A ⊗[K] Aᵐᵒᵖ →ₐ[K] Module.End K A := +@[expose] def toEnd : A ⊗[K] Aᵐᵒᵖ →ₐ[K] Module.End K A := Algebra.TensorProduct.lift { toFun a := { toFun x := a * x @@ -118,7 +118,7 @@ lemma dim_eq : simp only [Module.finrank_self, mul_one] /-- The central simple algebra isomorphism `A ⊗ Aᵐᵒᵖ ≃ End_K(A)`. -/ -def equivEnd : A ⊗[K] Aᵐᵒᵖ ≃ₐ[K] Module.End K A := +@[expose] def equivEnd : A ⊗[K] Aᵐᵒᵖ ≃ₐ[K] Module.End K A := AlgEquiv.ofBijective (toEnd K A) <| bijective_of_dim_eq_of_isCentralSimple _ _ _ _ <| dim_eq K A @@ -154,6 +154,7 @@ variable {K : Type u} [Field K] namespace IsBrauerEquivalent /-- Reindexes matrices over `Fin n × Fin m` as matrices over `Fin (n * m)`. -/ +@[expose] def matrixEqv' (n m : ℕ) (A : Type*) [Ring A] [Algebra K A] : (Matrix (Fin n × Fin m) (Fin n × Fin m) A) ≃ₐ[K] Matrix (Fin (n * m)) (Fin (n * m)) A := { Matrix.reindexLinearEquiv K A finProdFinEquiv finProdFinEquiv with @@ -175,13 +176,13 @@ end IsBrauerEquivalent namespace BrauerGroup /-- The setoid on central simple algebras generated by Brauer equivalence. -/ -@[implicit_reducible] +@[implicit_reducible, expose] def CSASetoid : Setoid (CSA K) where r := IsBrauerEquivalent iseqv := IsBrauerEquivalent.Braur_is_eqv /-- Tensor-product multiplication on representatives of the Brauer group. -/ -def mul (A B : CSA K) : CSA K where +@[expose] def mul (A B : CSA K) : CSA K where toAlgCat := .of K (A ⊗[K] B) fin_dim := Module.Finite.tensorProduct K A B @@ -192,7 +193,7 @@ theorem isFinDimOfMop (A : Type*) [Ring A] [Algebra K A] [FiniteDimensional K A] exact Module.Finite.equiv f /-- The opposite algebra representative used for inversion in the Brauer group. -/ -def inv (A : CSA K) : CSA K := { +@[expose] def inv (A : CSA K) : CSA K := { __ := AlgCat.of K Aᵐᵒᵖ fin_dim := isFinDimOfMop A } @@ -200,7 +201,7 @@ def inv (A : CSA K) : CSA K := { def oneIn (n : ℕ) [hn : NeZero n] : CSA K := ⟨.of K (Matrix (Fin n) (Fin n) K)⟩ /-- The base field representative of the identity Brauer class. -/ -def oneIn' : CSA K := ⟨.of K K⟩ +@[expose] def oneIn' : CSA K := ⟨.of K K⟩ /-- Right tensoring by an identity matrix algebra representative. -/ def oneMulIn (n : ℕ) [hn : NeZero n] (A : CSA K) : CSA K := @@ -269,7 +270,7 @@ def matrixEquivForward (m n : Type*) [Fintype m] [Fintype n] [DecidableEq m] [De open scoped Kronecker in lemma matrixEquivForward_tmul (m n : Type*) [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (M : Matrix m m K) (N : Matrix n n K) : - matrixEquivForward (K := K) m n (M ⊗ₜ N) = M ⊗ₖ N := rfl + matrixEquivForward (K := K) m n (M ⊗ₜ N) = M ⊗ₖ N := by rfl lemma matrixEquivForward_surjective (n m : Type*) [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] : @@ -637,7 +638,7 @@ open CategoryTheory namespace baseChangeIdem /-- The linear equivalence comparing two-step and one-step scalar extension. -/ -@[simps!] +@[simps!, expose] def Aux (F K E : Type u) [Field F] [Field K] [Field E] [Algebra F K] [Algebra F E] [Algebra K E] [IsScalarTower F K E] (A : CSA F) : E ⊗[K] (K ⊗[F] A) ≃ₗ[E] (E ⊗[F] A.carrier) := diff --git a/LeanPool/BrauerGroupNew/BrauerOverR.lean b/LeanPool/BrauerGroupNew/BrauerOverR.lean index d795ef631c..94dfed6af8 100644 --- a/LeanPool/BrauerGroupNew/BrauerOverR.lean +++ b/LeanPool/BrauerGroupNew/BrauerOverR.lean @@ -25,7 +25,7 @@ import Mathlib.RingTheory.SimpleRing.Matrix Imported Lean Pool material for `LeanPool.BrauerGroupNew.BrauerOverR`. -/ -@[expose] public section +public section suppress_compilation diff --git a/LeanPool/BrauerGroupNew/CentralSimple.lean b/LeanPool/BrauerGroupNew/CentralSimple.lean index db01caefaf..83b58bde84 100644 --- a/LeanPool/BrauerGroupNew/CentralSimple.lean +++ b/LeanPool/BrauerGroupNew/CentralSimple.lean @@ -33,7 +33,7 @@ immediately give rise to nontrivial quotients of `D` so there are no central sim algebras in this case according to our definition. -/ -@[expose] public section +public section universe u v w open Module variable (K : Type u) [Field K] diff --git a/LeanPool/BrauerGroupNew/Centralizer.lean b/LeanPool/BrauerGroupNew/Centralizer.lean index b6043761e7..2dcbdbbd57 100644 --- a/LeanPool/BrauerGroupNew/Centralizer.lean +++ b/LeanPool/BrauerGroupNew/Centralizer.lean @@ -31,7 +31,7 @@ Let `R` be a commutative ring and `A` and `B` two `R`-algebras. then the centralizer of `B` in `A ⊗ B` is `A ⊗ C(B)` where `C(B)` is the center of `B`. -/ -@[expose] public section +public section namespace Subalgebra diff --git a/LeanPool/BrauerGroupNew/CrossProductAlgebra.lean b/LeanPool/BrauerGroupNew/CrossProductAlgebra.lean index f9af49dbbb..7b50448618 100644 --- a/LeanPool/BrauerGroupNew/CrossProductAlgebra.lean +++ b/LeanPool/BrauerGroupNew/CrossProductAlgebra.lean @@ -30,7 +30,7 @@ This file constructs the cross product algebra associated to a 2-cocycle of a fi * [*Advanced Algebra*] -/ -@[expose] public section +public section open groupCohomology Function Module @@ -104,7 +104,7 @@ instance addCommGroup : AddCommGroup (CrossProductAlgebra f) := val_injective.addCommGroup val val_zero val_add val_neg val_sub (fun _ _ ↦ rfl) (fun _ _ ↦ rfl) /-- The additive equivalence with finitely supported functions on the Galois group. -/ -@[simps] +@[expose, simps] def valAddEquiv : CrossProductAlgebra f ≃+ (Gal(K, F) →₀ K) where toFun := val invFun := mk @@ -126,20 +126,20 @@ instance [Semiring R] [Semiring S] [Module R K] [Module S K] [Module R S] [IsSca smul_assoc r s x := by ext; simp [smul_assoc] /-- The linear equivalence with finitely supported functions on the Galois group. -/ -@[simps] +@[expose, simps] def valLinearEquiv [Semiring R] [Module R K] : CrossProductAlgebra f ≃ₗ[R] (Gal(K, F) →₀ K) where __ := valAddEquiv map_smul' := val_smul /-- The standard basis of the cross product algebra over `K`. -/ -@[simps] +@[expose, simps] def basis : Basis Gal(K, F) K (CrossProductAlgebra f) where repr := valLinearEquiv -lemma basis_val (σ : Gal(K, F)) : (basis (f := f) σ).val = .single σ 1 := rfl +lemma basis_val (σ : Gal(K, F)) : (basis (f := f) σ).val = .single σ 1 := by rfl -lemma mk_single_one (σ : Gal(K, F)) : mk (.single σ 1) = basis (f := f) σ := rfl +lemma mk_single_one (σ : Gal(K, F)) : mk (.single σ 1) = basis (f := f) σ := by rfl variable (f) in /-- The bilinear multiplication map on the underlying finitely supported functions. -/ @@ -263,7 +263,7 @@ variable (f) in Note that this does *not* make `CrossProductAlgebra f` into a `K`-algebra, because that would require `incl k * x = x * incl k`. -/ -@[simps -isSimp] +@[expose, simps -isSimp] def incl : K →ₐ[F] CrossProductAlgebra f where toFun k := k • 1 map_zero' := by ext; simp @@ -287,7 +287,7 @@ instance [CommSemiring R] [Algebra R K] : variable (f) in /-- The canonical unit associated to an element of the Galois group. -/ -@[simps] +@[expose, simps] def of (σ : Gal(K, F)) : (CrossProductAlgebra f)ˣ where val.val := .single σ 1 inv.val := .single σ⁻¹ <| (f (σ⁻¹, σ))⁻¹ * (f (1, 1))⁻¹ @@ -307,7 +307,7 @@ def of (σ : Gal(K, F)) : (CrossProductAlgebra f)ˣ where map_one, mul_right_comm _ (f _ : K)⁻¹, mul_one, ne_eq, Units.ne_zero, not_false_eq_true, inv_mul_cancel₀, one_mul, val_one] -lemma basis_eq_of (σ : Gal(K, F)) : basis σ = (of f σ).val := rfl +lemma basis_eq_of (σ : Gal(K, F)) : basis σ = (of f σ).val := by rfl variable (f) in @[simp] lemma of_one : of f 1 = incl f (f (1, 1)) := by ext; simp [incl_apply] @@ -479,6 +479,6 @@ instance : IsSimpleRing (CrossProductAlgebra f) := by variable (f) in /-- The cross product algebra as a central simple algebra. -/ -def asCSA : CSA F := ⟨.of F (CrossProductAlgebra f)⟩ +@[expose] def asCSA : CSA F := ⟨.of F (CrossProductAlgebra f)⟩ end CrossProductAlgebra diff --git a/LeanPool/BrauerGroupNew/DoubleCentralizer.lean b/LeanPool/BrauerGroupNew/DoubleCentralizer.lean index e638ec519b..20f2f06e2a 100644 --- a/LeanPool/BrauerGroupNew/DoubleCentralizer.lean +++ b/LeanPool/BrauerGroupNew/DoubleCentralizer.lean @@ -32,7 +32,7 @@ import Mathlib.RingTheory.SimpleRing.Matrix Imported Lean Pool material for `LeanPool.BrauerGroupNew.DoubleCentralizer`. -/ -@[expose] public section +public section universe u v @@ -303,7 +303,7 @@ instance : FiniteDimensional (Subalgebra.center F B) B := variable (F B) in /-- The subalgebra of endomorphisms given by left multiplication. -/ -@[simps] +@[simps, expose] def Module.End.leftMul : Subalgebra F (Module.End F B) where carrier := Set.range <| LinearMap.mulLeft F mul_mem' := by @@ -415,7 +415,7 @@ lemma centralizer_mulLeft : end lemma2 /-- The conjugate of a subalgebra by a unit. -/ -@[simps] +@[simps, expose] def Subalgebra.conj (B : Subalgebra F A) (x : Aˣ) : Subalgebra F A where carrier := {y | ∃ b ∈ B, y = x * b * x⁻¹} mul_mem' := by @@ -439,7 +439,7 @@ lemma Subalgebra.mem_conj {B : Subalgebra F A} {x : Aˣ} {y : A} : rfl /-- The algebra homomorphism from a subalgebra to its conjugate. -/ -@[simps] +@[simps, expose] def Subalgebra.toConj (B : Subalgebra F A) (x : Aˣ) : B →ₐ[F] B.conj x where toFun b := ⟨x * b * x⁻¹, by simp [Subalgebra.mem_conj]⟩ map_one' := by @@ -463,7 +463,7 @@ def Subalgebra.toConj (B : Subalgebra F A) (x : Aˣ) : B →ₐ[F] B.conj x wher simp only [Units.mul_inv, mul_one] /-- The algebra homomorphism from a conjugate subalgebra back to the original subalgebra. -/ -@[simps] +@[simps, expose] def Subalgebra.fromConj (B : Subalgebra F A) (x : Aˣ) : B.conj x →ₐ[F] B where toFun b := ⟨x⁻¹ * b * x, by rcases b with ⟨_, ⟨b, hb, rfl⟩⟩ diff --git a/LeanPool/BrauerGroupNew/Examples/ShortComplex/LeftHomologyMapData.lean b/LeanPool/BrauerGroupNew/Examples/ShortComplex/LeftHomologyMapData.lean index d5a37d7197..7b472d1acc 100644 --- a/LeanPool/BrauerGroupNew/Examples/ShortComplex/LeftHomologyMapData.lean +++ b/LeanPool/BrauerGroupNew/Examples/ShortComplex/LeftHomologyMapData.lean @@ -13,7 +13,7 @@ public import Mathlib.Algebra.Homology.ShortComplex.ModuleCat Imported Lean Pool material for `LeanPool.BrauerGroupNew.Examples.ShortComplex.LeftHomologyMapData`. -/ -@[expose] public section +public section universe v u @@ -60,7 +60,7 @@ abbrev φH : φK_maps_moduleCatToCycles_range R S₁ S₂ f /-- The explicit left homology map data for a morphism of short complexes of modules. -/ -@[simps] +@[expose, simps] def LeftHomologyMapData.ofModuleCat : ShortComplex.LeftHomologyMapData f (ShortComplex.moduleCatLeftHomologyData S₁) diff --git a/LeanPool/BrauerGroupNew/ExtendScalar.lean b/LeanPool/BrauerGroupNew/ExtendScalar.lean index 1978502275..ecf13d525a 100644 --- a/LeanPool/BrauerGroupNew/ExtendScalar.lean +++ b/LeanPool/BrauerGroupNew/ExtendScalar.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.TensorProduct.Basic Imported Lean Pool material for `LeanPool.BrauerGroupNew.ExtendScalar`. -/ -@[expose] public section +public section open scoped TensorProduct @@ -22,7 +22,7 @@ variable (k K L A : Type u) [Field k] [Field K] [Field L] [Algebra k K] [Algebra [Algebra k L] [Ring A] [Algebra k A] [IsScalarTower k K L] /-- Additive map sending `l ⊗ a` to `l ⊗ (1 ⊗ a)` after releasing scalars through `K`. -/ -def releaseAddHom : L ⊗[k] A →+ L ⊗[K] (K ⊗[k] A) := +@[expose] def releaseAddHom : L ⊗[k] A →+ L ⊗[K] (K ⊗[k] A) := TensorProduct.liftAddHom { toFun l := { @@ -37,7 +37,7 @@ def releaseAddHom : L ⊗[k] A →+ L ⊗[K] (K ⊗[k] A) := repeat rw [TensorProduct.add_tmul] } fun r l a ↦ by simp only [AddMonoidHom.coe_mk, ZeroHom.coe_mk, TensorProduct.tmul_smul]; rfl /-- Algebra homomorphism releasing an `L ⊗[k] A` tensor through `K`. -/ -def release : L ⊗[k] A →ₐ[L] L ⊗[K] (K ⊗[k] A) where +@[expose] def release : L ⊗[k] A →ₐ[L] L ⊗[K] (K ⊗[k] A) where __ := releaseAddHom k K L A map_one' := by simp only [releaseAddHom, Algebra.TensorProduct.one_def, ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe, TensorProduct.liftAddHom_tmul, AddMonoidHom.coe_mk, @@ -141,6 +141,7 @@ def absorb : L ⊗[K] (K ⊗[k] A) →ₐ[L] L ⊗[k] A where /-- Algebra equivalence between direct scalar extension and extension through the intermediate field. -/ +@[expose] def absorbEqv : L ⊗[k] A ≃ₐ[L] L ⊗[K] (K ⊗[k] A) where toFun := release k K L A invFun := absorb k K L A @@ -169,4 +170,4 @@ def absorbEqv : L ⊗[k] A ≃ₐ[L] L ⊗[K] (K ⊗[k] A) where commutes' := release k K L A|>.commutes theorem absorbEqv_apply (l : L) (a : A) : absorbEqv k K L A (l ⊗ₜ a) = l ⊗ₜ[K] (1 ⊗ₜ a) := - rfl + by rfl diff --git a/LeanPool/BrauerGroupNew/FieldCat.lean b/LeanPool/BrauerGroupNew/FieldCat.lean index a5f9d27e4d..24c0f3f910 100644 --- a/LeanPool/BrauerGroupNew/FieldCat.lean +++ b/LeanPool/BrauerGroupNew/FieldCat.lean @@ -19,7 +19,7 @@ public import Mathlib.Algebra.Field.Defs # Category instances for `Field`. -/ -@[expose] public section +public section universe u v @@ -151,12 +151,17 @@ instance hasForgetToAddCommGrp : HasForget₂ FieldCat RingCat where map := fun f ↦ RingCat.ofHom f.hom } /-- Field equivalence are isomorphisms in category of semirings -/ -@[simps] def RingEquiv.toRingCatIso {R S : Type u} [Field R] [Field S] (e : R ≃+* S) : of R ≅ of S where hom := ⟨e⟩ inv := ⟨e.symm⟩ +@[simp] lemma RingEquiv.toRingCatIso_hom_hom {R S : Type u} [Field R] [Field S] + (e : R ≃+* S) : (RingEquiv.toRingCatIso e).hom.hom = e.toRingHom := by rfl + +@[simp] lemma RingEquiv.toRingCatIso_inv_hom {R S : Type u} [Field R] [Field S] + (e : R ≃+* S) : (RingEquiv.toRingCatIso e).inv.hom = e.symm.toRingHom := by rfl + instance forgetReflectIsos : (forget FieldCat).ReflectsIsomorphisms where reflects {X Y} f _ := by let i := asIso ((forget FieldCat).map f) diff --git a/LeanPool/BrauerGroupNew/FiniteField.lean b/LeanPool/BrauerGroupNew/FiniteField.lean index 6ee7a44568..9e26a433c5 100644 --- a/LeanPool/BrauerGroupNew/FiniteField.lean +++ b/LeanPool/BrauerGroupNew/FiniteField.lean @@ -17,7 +17,7 @@ import Mathlib.RingTheory.LittleWedderburn This file proves that the Brauer group of a finite field is trivial. -/ -@[expose] public section +public section variable (K : Type*) [Field K] [Finite K] diff --git a/LeanPool/BrauerGroupNew/FrobeniusTheorem.lean b/LeanPool/BrauerGroupNew/FrobeniusTheorem.lean index 002c374f95..c2672444ee 100644 --- a/LeanPool/BrauerGroupNew/FrobeniusTheorem.lean +++ b/LeanPool/BrauerGroupNew/FrobeniusTheorem.lean @@ -25,7 +25,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Imported Lean Pool material for `LeanPool.BrauerGroupNew.FrobeniusTheorem`. -/ -@[expose] public section +public section suppress_compilation diff --git a/LeanPool/BrauerGroupNew/IsoSecond.lean b/LeanPool/BrauerGroupNew/IsoSecond.lean index 204dee05b9..bb0ab40198 100644 --- a/LeanPool/BrauerGroupNew/IsoSecond.lean +++ b/LeanPool/BrauerGroupNew/IsoSecond.lean @@ -22,7 +22,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Imported Lean Pool material for `LeanPool.BrauerGroupNew.IsoSecond`. -/ -@[expose] public section +public section suppress_compilation @@ -56,7 +56,7 @@ lemma mem_S (x : A ⊗[F] B) : variable (α β) in /-- The balanced tensor-product module used in the multiplicativity proof. -/ -@[reducible] def M := (A ⊗[F] B) ⧸ Submodule.span F (S α β) +@[expose, reducible] def M := (A ⊗[F] B) ⧸ Submodule.span F (S α β) /-- Right multiplication by fixed tensor factors descends to the balanced quotient. -/ def AoxFBSmulMAux (a' : A) (b' : B) : M α β →ₗ[F] M α β := @@ -118,7 +118,7 @@ def AoxFBSmulM : A ⊗[F] B →ₗ[F] M α β →ₗ[F] M α β := @[simp] lemma AoxFBSmulM_op_tmul_smul_mk_tmul (a' a : A) (b' b : B) : AoxFBSmulM (a' ⊗ₜ[F] b') (Submodule.Quotient.mk (a ⊗ₜ[F] b) : M α β) = - (Submodule.Quotient.mk ((a * a') ⊗ₜ[F] (b * b')) : M α β) := rfl + (Submodule.Quotient.mk ((a * a') ⊗ₜ[F] (b * b')) : M α β) := by rfl instance : SMul (A ⊗[F] B)ᵐᵒᵖ (M α β) where smul x y := AoxFBSmulM x.unop y @@ -127,7 +127,7 @@ open MulOpposite in @[simp] lemma Aox_FB_op_tmul_smul_mk_tmul (a' a : A) (b' b : B) : op (a' ⊗ₜ[F] b') • (Submodule.Quotient.mk (a ⊗ₜ[F] b) : M α β) = - Submodule.Quotient.mk ((a * a') ⊗ₜ[F] (b * b')) := rfl + Submodule.Quotient.mk ((a * a') ⊗ₜ[F] (b * b')) := by rfl open MulOpposite in instance : MulAction (A ⊗[F] B)ᵐᵒᵖ (M α β) where @@ -597,7 +597,7 @@ variable [IsGalois F K] variable (α β) in /-- A chosen simple module appearing in the Wedderburn decomposition of `C`. -/ -def SimpleMod : Type := exists_simple_module_directSum α β |>.choose +@[expose] def SimpleMod : Type := exists_simple_module_directSum α β |>.choose local notation "SM" => SimpleMod α β @@ -612,7 +612,7 @@ instance : IsSimpleModule C SM := exists_simple_module_directSum _ _ variable (α β) in /-- The finite index set for the simple-module decomposition of `C`. -/ -def IndexingSet : Type := exists_simple_module_directSum α β +@[expose] def IndexingSet : Type := exists_simple_module_directSum α β |>.choose_spec.choose_spec.choose_spec.choose_spec.choose local notation "ι" => IndexingSet α β @@ -718,7 +718,7 @@ lemma M_directSum : ∃ (ιM : Type) (_ : Fintype ιM), Nonempty (M α β ≃ₗ variable (α β) in /-- The finite index set for the simple-module decomposition of `M`. -/ -def IndexingSetM : Type := (M_directSum α β).choose +@[expose] def IndexingSetM : Type := (M_directSum α β).choose local notation "ιM" => IndexingSetM α β diff --git a/LeanPool/BrauerGroupNew/LemmasAboutSimpleRing.lean b/LeanPool/BrauerGroupNew/LemmasAboutSimpleRing.lean index 6f3d7c38ea..076dd71cd6 100644 --- a/LeanPool/BrauerGroupNew/LemmasAboutSimpleRing.lean +++ b/LeanPool/BrauerGroupNew/LemmasAboutSimpleRing.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.BrauerGroupNew.LemmasAboutSimpleRing`. -/ -@[expose] public section +public section universe u variable (K : Type u) [Field K] open TensorProduct in diff --git a/LeanPool/BrauerGroupNew/Mathlib.lean b/LeanPool/BrauerGroupNew/Mathlib.lean index f74093f5fd..4323b22609 100644 --- a/LeanPool/BrauerGroupNew/Mathlib.lean +++ b/LeanPool/BrauerGroupNew/Mathlib.lean @@ -17,4 +17,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RingTheory Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra.lean index 220c3f1cc1..813f67bacf 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra.lean index 5b3e4916e4..3be2c0ecc1 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra.lean @@ -14,4 +14,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Subalgebra Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Equiv.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Equiv.lean index 3debe1b249..7df969835b 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Equiv.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Equiv.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Algebra.Equiv Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Equiv`. -/ -@[expose] public section +public section /-- Galois-group notation as algebra equivalences. -/ notation "Gal("K ", "F")" => K ≃ₐ[F] K diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra.lean index 2311971b23..1c3c6235c5 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra.lean @@ -15,4 +15,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Subalgebra.Lattice Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean index 108b4289b1..5160a673fa 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean @@ -13,7 +13,7 @@ public import Mathlib.Algebra.Algebra.Subalgebra.Basic Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Subalgebra.Basic`. -/ -@[expose] public section +public section namespace Subalgebra variable {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] {L S T U : Subalgebra R A} diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean index ccf5ad8321..21d9d4a068 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean @@ -15,7 +15,7 @@ Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Subalgebra.Directed`. -/ -@[expose] public section +public section namespace Subalgebra variable {R A ι : Type*} [CommSemiring R] [Semiring A] [Algebra R A] {K : ι → Subalgebra R A} diff --git a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean index 55d6f30af5..3a01cee098 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean @@ -15,7 +15,7 @@ Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Subalgebra.Lattice`. -/ -@[expose] public section +public section variable {R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B] diff --git a/LeanPool/BrauerGroupNew/Mathlib/Data.lean b/LeanPool/BrauerGroupNew/Mathlib/Data.lean index 2ed1b5ea11..d51481a189 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Data.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Data.lean @@ -14,4 +14,4 @@ import Mathlib.Tactic.Bound.Init Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp.lean b/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp.lean index cfd92958e0..7eb337f43e 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp.lean @@ -14,4 +14,4 @@ import Mathlib.Tactic.Bound.Init Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp/Submonoid.lean b/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp/Submonoid.lean index b400c57e71..b1461edf80 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp/Submonoid.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/Data/DFinsupp/Submonoid.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Bound.Init Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.Data.DFinsupp.Submonoid`. -/ -@[expose] public section +public section variable {ι γ β : Type*} diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra.lean index ec84e7b46d..ff9c8ca08e 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra.lean @@ -16,4 +16,4 @@ import Mathlib.Data.Nat.Totient Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent.lean index 4a739ad06a..0eb04fc668 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.LinearAlgebra.LinearIndependent.De Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean index 9515bf591c..2eb86d50ad 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean @@ -14,7 +14,7 @@ Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.LinearAlgebra.LinearIndependent.Defs`. -/ -@[expose] public section +public section variable {ι R M : Type*} {v : ι → M} [Semiring R] [AddCommMonoid M] [Module R M] diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix.lean index 814509d927..961a71c2ee 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix.lean @@ -15,4 +15,4 @@ import Mathlib.Data.Nat.Totient Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly.lean index c892a20a7f..7e2e015ad4 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.LinearAlgebra.Matrix.Charpoly.Basi Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean index 9a8af8b4ef..bc691b5c86 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean @@ -13,12 +13,12 @@ public import Mathlib.LinearAlgebra.Matrix.Charpoly.Basic This file restores upstream helper lemmas for block diagonal characteristic polynomials. -/ -@[expose] public section +public section variable {F : Type*} [Field F] /-- A subtype of a product that depends only on the second component. -/ -@[simps] +@[expose, simps] def Equiv.prodSubtypeSndEquivProdSubtype {α β} {p : β → Prop} : {s : α × β // p s.2} ≃ α × {b // p b} where toFun x := ⟨x.1.1, x.1.2, x.2⟩ @@ -27,7 +27,7 @@ def Equiv.prodSubtypeSndEquivProdSubtype {α β} {p : β → Prop} : right_inv _ := rfl /-- The fiber of a product projection over a fixed second coordinate. -/ -@[simps!] +@[expose, simps!] def thing' {α β : Type*} (b : β) : {i : α × β // i.2 = b} ≃ α := Equiv.prodSubtypeSndEquivProdSubtype.trans (Equiv.prodUnique α {i : β // i = b}) diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup.lean index b199d3240a..86687b9a32 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup.lean @@ -14,4 +14,4 @@ import Mathlib.Data.Nat.Totient Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean index 8356d7e63f..fb86607e3f 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Basic.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.Totient This file restores a similarity invariance lemma for matrix characteristic polynomials. -/ -@[expose] public section +public section variable {F : Type*} [Field F] diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span.lean index 89b95d2f99..fc9da6e773 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span.lean @@ -17,4 +17,4 @@ import Mathlib.Tactic.SetLike Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span/Basic.lean index 02f9b087aa..c54ebe7315 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/LinearAlgebra/Span/Basic.lean @@ -24,4 +24,4 @@ that declaration is available in current Mathlib from import-compatible shim. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory.lean b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory.lean index 7868aef9ca..55ff7278ba 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RepresentationTheory.Homological Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological.lean b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological.lean index b9a98c21a2..73b768d3fd 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RepresentationTheory.Homological.G Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology.lean b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology.lean index 79248ee967..f5eef90173 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RepresentationTheory.Homological.G Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean index d9d1a26c34..2dd1201081 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean @@ -13,7 +13,7 @@ public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree This file restores upstream aliases and multiplicative cocycle closure lemmas. -/ -@[expose] public section +public section variable {G M : Type*} [Group G] [CommGroup M] [MulDistribMulAction G M] {f g : G × G → M} diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory.lean index ec27da86c3..0d104ea3e8 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory.lean @@ -18,4 +18,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RingTheory.TwoSidedIdeal Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence.lean index dbbaeac7a1..71e5be785c 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence.lean @@ -16,4 +16,4 @@ import Mathlib.Tactic.NormNum.Pow Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Basic.lean index 77ca25ea69..f2cace578f 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Basic.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.Congruence.Basic`. -/ -@[expose] public section +public section open Function @@ -43,6 +43,7 @@ instance instModuleQuotientOfIsScalarTowerLeanPool [Semiring α] [NonAssocSemiri variable (α) in /-- The quotient map as a linear map. -/ +@[expose] def mkL [Semiring α] [NonAssocSemiring R] [Module α R] [IsScalarTower α R R] (c : RingCon R) : R →ₗ[α] c.Quotient where __ := c.mk' diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Defs.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Defs.lean index 1a620af303..66c912fd4b 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Defs.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/Congruence/Defs.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.Congruence.Defs This file restores the upstream eliminator name used by the Brauer group port. -/ -@[expose] public section +public section namespace RingCon diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/MatrixAlgebra.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/MatrixAlgebra.lean index dbfb8bca73..5e60551511 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/MatrixAlgebra.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/MatrixAlgebra.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.MatrixAlgebra This file restores an upstream matrix/tensor equivalence in the opposite direction. -/ -@[expose] public section +public section open scoped TensorProduct @@ -27,4 +27,4 @@ def matrixEquivTensor' (n R A : Type*) [CommSemiring R] [CommSemiring A] @[simp] lemma matrixEquivTensor'_symm_apply (n R A : Type*) [CommSemiring R] [CommSemiring A] [Algebra R A] [Fintype n] [DecidableEq n] (a : A) (m : Matrix n n R) : - (matrixEquivTensor' n R A).symm (a ⊗ₜ m) = a • (m.map (algebraMap R A)) := rfl + (matrixEquivTensor' n R A).symm (a ⊗ₜ m) = a • (m.map (algebraMap R A)) := by rfl diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring.lean index e3951c71e9..1669afe9e0 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RingTheory.NonUnitalSubring.Defs Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring/Defs.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring/Defs.lean index 585596f03c..2b4c1212d7 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring/Defs.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubring/Defs.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.NonUnitalSubring.Defs Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.NonUnitalSubring.Defs`. -/ -@[expose] public section +public section variable {R : Type*} [NonUnitalRing R] diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring.lean index efb7cdc2e7..8034c60563 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring.lean @@ -14,4 +14,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RingTheory.NonUnitalSubsemiring.De Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean index 0b61cbd751..fc07e31aa4 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean @@ -14,6 +14,6 @@ Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.NonUnitalSubsemiring.Basic`. -/ -@[expose] public section +public section attribute [simp, norm_cast] NonUnitalSubsemiring.coe_center diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean index ab4dd2730e..e8c1be651e 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/NonUnitalSubsemiring/Defs.lean @@ -14,7 +14,7 @@ Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.NonUnitalSubsemiring.Defs`. -/ -@[expose] public section +public section variable {R : Type*} [NonUnitalSemiring R] diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct.lean index e0b4c8e061..170ab6da80 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct.lean @@ -13,4 +13,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RingTheory.TensorProduct.Basic Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct/Basic.lean index 3aefb6fab1..2cbabcbf6c 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TensorProduct/Basic.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.TensorProduct.Basic This file restores an upstream tensor-product associator over mixed scalar towers. -/ -@[expose] public section +public section open scoped TensorProduct @@ -33,4 +33,4 @@ lemma Algebra.TensorProduct.assoc'_apply (R S R' A B C : Type*) [CommSemiring R] [Algebra R' A] [Algebra R B] [Algebra R' B] [Algebra R C] [IsScalarTower R R' A] [IsScalarTower R R' B] [Algebra S A] [Algebra R S] [Algebra R' S] [IsScalarTower R' S A] [IsScalarTower R S A] (a : A) (b : B) (c : C) : - (Algebra.TensorProduct.assoc' R S R' A B C) ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c) := rfl + (Algebra.TensorProduct.assoc' R S R' A B C) ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c) := by rfl diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal.lean index 114913965f..b264b0b588 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal.lean @@ -16,4 +16,4 @@ public import LeanPool.BrauerGroupNew.Mathlib.RingTheory.TwoSidedIdeal.Operation Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean index 5b55dc5422..f34fe6b84a 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Basic.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.TwoSidedIdeal.Basic This file restores upstream scalar-action helpers for two-sided ideals. -/ -@[expose] public section +public section namespace TwoSidedIdeal diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean index 2d7e1fb8ba..359756e8f6 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Kernel.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.TwoSidedIdeal.Kernel Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.TwoSidedIdeal.Kernel`. -/ -@[expose] public section +public section variable {R S : Type*} [Ring R] [Ring S] diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean index f003374cd1..bd885e6af6 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean @@ -13,7 +13,7 @@ public import Mathlib.RingTheory.TwoSidedIdeal.Lattice Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.TwoSidedIdeal.Lattice`. -/ -@[expose] public section +public section namespace TwoSidedIdeal variable {R : Type*} [NonUnitalNonAssocRing R] {I J : TwoSidedIdeal R} {x : R} diff --git a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean index ad7de9934f..6649d7eae1 100644 --- a/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean +++ b/LeanPool/BrauerGroupNew/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean @@ -14,7 +14,7 @@ Imported Lean Pool material for `LeanPool.BrauerGroupNew.Mathlib.RingTheory.TwoSidedIdeal.Operations`. -/ -@[expose] public section +public section open Function diff --git a/LeanPool/BrauerGroupNew/MatrixCenterEquiv.lean b/LeanPool/BrauerGroupNew/MatrixCenterEquiv.lean index 02501e0ddb..68e772d8da 100644 --- a/LeanPool/BrauerGroupNew/MatrixCenterEquiv.lean +++ b/LeanPool/BrauerGroupNew/MatrixCenterEquiv.lean @@ -15,7 +15,7 @@ import Mathlib.LinearAlgebra.Matrix.IsDiag Imported Lean Pool material for `LeanPool.BrauerGroupNew.MatrixCenterEquiv`. -/ -@[expose] public section +public section local notation "M[" ι "," R "]" => Matrix ι ι R diff --git a/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean b/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean index aacd0e8d85..5bc6442ece 100644 --- a/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean +++ b/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean @@ -14,7 +14,7 @@ public import Mathlib.RingTheory.TensorProduct.Basic Imported Lean Pool material for `LeanPool.BrauerGroupNew.MatrixEquivTensor`. -/ -@[expose] public section +public section open scoped TensorProduct @@ -36,7 +36,7 @@ def toTensorMartrixToFunBilinear : K →ₗ[F] Matrix n n A →ₗ[F] Matrix n n @[simp] lemma toTensorMartrixToFunBilinear_apply (k : K) (M : Matrix n n A) : toTensorMartrixToFunBilinear K F A n k M = - k • Algebra.TensorProduct.includeRight.mapMatrix M := rfl + k • Algebra.TensorProduct.includeRight.mapMatrix M := by rfl /-- The `F`-linear map induced from `toTensorMartrixToFunBilinear`. -/ abbrev toTensorMatrixToFunFlinear : K ⊗[F] Matrix n n A →ₗ[F] Matrix n n (K ⊗[F] A) := @@ -82,7 +82,7 @@ def invFunToFunBilinear (i j : n) : K →ₗ[F] A →ₗ[F] K ⊗[F] Matrix n n omit [Fintype n] in @[simp] lemma invFunToFunBilinear_apply (i j : n) (k : K) (a : A) : - invFunToFunBilinear K F A n i j k a = k ⊗ₜ single i j a := rfl + invFunToFunBilinear K F A n i j k a = k ⊗ₜ single i j a := by rfl /-- The `F`-linear map induced by `invFunToFunBilinear`. -/ abbrev invFunToFun (i j : n) : K ⊗[F] A →ₗ[F] K ⊗[F] Matrix n n A := @@ -132,8 +132,8 @@ def matrixTensorEquivTensor : K ⊗[F] Matrix n n A ≃ₐ[K] Matrix n n (K ⊗[ @[simp] lemma matrixTensorEquivTensor_apply (M : K ⊗[F] Matrix n n A) : - matrixTensorEquivTensor K F A n M = toTensorMatrix K F A n M := rfl + matrixTensorEquivTensor K F A n M = toTensorMatrix K F A n M := by rfl @[simp] lemma matrixTensorEquivTensor_symm_apply (M : Matrix n n (K ⊗[F] A)) : - (matrixTensorEquivTensor K F A n).symm M = invFunLinearMap K F A n M := rfl + (matrixTensorEquivTensor K F A n).symm M = invFunLinearMap K F A n M := by rfl diff --git a/LeanPool/BrauerGroupNew/Morita/ChangeOfRings.lean b/LeanPool/BrauerGroupNew/Morita/ChangeOfRings.lean index 4386b7d498..e4bbe739ad 100644 --- a/LeanPool/BrauerGroupNew/Morita/ChangeOfRings.lean +++ b/LeanPool/BrauerGroupNew/Morita/ChangeOfRings.lean @@ -18,7 +18,7 @@ import Mathlib.RingTheory.SimpleModule.Rank Imported Lean Pool material for `LeanPool.BrauerGroupNew.Morita.ChangeOfRings`. -/ -@[expose] public section +public section open CategoryTheory Limits @@ -74,7 +74,7 @@ instance instAlgebraEndOfLeanPool : Algebra R (End (ModuleCat.of A A)) := inferI /-- Right multiplication identifies the opposite division ring with endomorphisms of its regular module. -/ -@[simps] +@[simps, expose] def mopToEnd : Aᵐᵒᵖ →ₐ[R] End (ModuleCat.of A A) where toFun a := ModuleCat.ofHom <| { toFun := fun (x : A) ↦ x * a.unop diff --git a/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean b/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean index 5758d004da..24d582e2bb 100644 --- a/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean +++ b/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.BrauerGroupNew.Morita.TensorProduct`. -/ -@[expose] public section +public section universe u v w @@ -187,7 +187,7 @@ lemma TensorModule.hom_ext {M N : TensorModule R A C} (f g : M ⟶ N) (h : f.hom simp_all /-- Build an isomorphism of tensor modules from an isomorphism of the underlying modules. -/ -@[simps] +@[simps, expose] def TensorModule.IsoMk {M N : TensorModule R A C} (f : M.carrier ≅ N.carrier) (h : ∀ c, f.hom ≫ ModuleCat.ofHom (N.morphism c) = ModuleCat.ofHom (M.morphism c) ≫ f.hom) : diff --git a/LeanPool/BrauerGroupNew/MoritaEquivalence.lean b/LeanPool/BrauerGroupNew/MoritaEquivalence.lean index 8a0732240d..cdb024bb62 100644 --- a/LeanPool/BrauerGroupNew/MoritaEquivalence.lean +++ b/LeanPool/BrauerGroupNew/MoritaEquivalence.lean @@ -23,7 +23,7 @@ This file ports the upstream BrauerGroup development proving the Morita equivalence between modules over a ring and over a matrix ring. -/ -@[expose] public section +public section open CategoryTheory Matrix Module @@ -50,7 +50,7 @@ instance instModuleMatrixForallLeanPool (M : Type*) [AddCommGroup M] [Module R M zero_smul v := funext fun i ↦ show ∑ _, _ = _ by simp /-- The functor sending an `R`-module to the coordinatewise module over `ι × ι` matrices. -/ -@[simps] +@[expose, simps] def toModuleCatOverMatrix : ModuleCat R ⥤ ModuleCat M[ι, R] where obj M := ModuleCat.of M[ι, R] (ι → M) map f := ModuleCat.ofHom { @@ -63,7 +63,7 @@ def toModuleCatOverMatrix : ModuleCat R ⥤ ModuleCat M[ι, R] where map_comp _ _ := rfl /-- The additive subgroup cut out by the default diagonal idempotent. -/ -@[simps] +@[expose, simps] def fromModuleCatOverMatrix.α (M : Type*) [AddCommGroup M] [Module M[ι, R] M] : AddSubgroup M where carrier := Set.range ((single (default : ι) (default : ι) (1 : R) : M[ι, R]) • ·) @@ -124,7 +124,7 @@ instance fromModuleCatOverMatrix.moduleΑ (M : Type*) [AddCommGroup M] [Module M open fromModuleCatOverMatrix /-- The functor sending a matrix-module to the default diagonal idempotent summand. -/ -@[simps] +@[expose, simps] def fromModuleCatOverMatrix : ModuleCat M[ι, R] ⥤ ModuleCat R where obj M := .of _ <| α R ι M map f := ModuleCat.ofHom { @@ -145,7 +145,7 @@ def fromModuleCatOverMatrix : ModuleCat M[ι, R] ⥤ ModuleCat R where map_comp _ _ := by ext; rfl /-- The counit of `toModuleCatOverMatrix ⋙ fromModuleCatOverMatrix`. -/ -@[simps] +@[expose, simps] def matrix.unitIsoHom : toModuleCatOverMatrix R ι ⋙ fromModuleCatOverMatrix R ι ⟶ 𝟭 (ModuleCat R) where app X := ModuleCat.ofHom @@ -193,7 +193,7 @@ def matrix.unitIsoHom : simp_all /-- The inverse unit map for `toModuleCatOverMatrix ⋙ fromModuleCatOverMatrix`. -/ -@[simps] +@[expose, simps] def matrix.unitIsoInv : 𝟭 (ModuleCat R) ⟶ toModuleCatOverMatrix R ι ⋙ fromModuleCatOverMatrix R ι where app X := ModuleCat.ofHom @@ -242,7 +242,7 @@ def matrix.unitIsoInv : /-- The natural isomorphism from `toModuleCatOverMatrix ⋙ fromModuleCatOverMatrix` to the identity. -/ -@[simps] +@[expose, simps] def matrix.unitIso : toModuleCatOverMatrix R ι ⋙ fromModuleCatOverMatrix R ι ≅ 𝟭 (ModuleCat R) where @@ -359,7 +359,7 @@ noncomputable def matrix.counitIsoHomMap (M : ModuleCat M[ι, R]) : simp_all⟩ /-- The counit map from the reconstructed matrix-module to the original matrix-module. -/ -@[simps] +@[expose, simps] noncomputable def matrix.counitIsoHom : fromModuleCatOverMatrix R ι ⋙ toModuleCatOverMatrix R ι ⟶ 𝟭 (ModuleCat M[ι, R]) where app M := (matrix.counitIsoHomMap R ι M).inv @@ -373,7 +373,7 @@ noncomputable def matrix.counitIsoHom : rw [map_smul] /-- The inverse of the matrix-module counit map. -/ -@[simps] +@[expose, simps] noncomputable def matrix.counitIsoInv : 𝟭 (ModuleCat M[ι, R]) ⟶ fromModuleCatOverMatrix R ι ⋙ toModuleCatOverMatrix R ι where @@ -388,7 +388,7 @@ noncomputable def matrix.counitIsoInv : /-- The natural isomorphism from `fromModuleCatOverMatrix ⋙ toModuleCatOverMatrix` to the identity. -/ -@[simps] +@[expose, simps] noncomputable def matrix.counitIso : fromModuleCatOverMatrix R ι ⋙ toModuleCatOverMatrix R ι ≅ 𝟭 (ModuleCat M[ι, R]) where hom := matrix.counitIsoHom R ι @@ -397,7 +397,7 @@ noncomputable def matrix.counitIso : inv_hom_id := by ext; simp /-- The Morita equivalence between modules over `R` and modules over `Matrix ι ι R`. -/ -@[simps] +@[expose, simps] noncomputable def moritaEquivalentToMatrix : ModuleCat R ≌ ModuleCat M[ι, R] where functor := toModuleCatOverMatrix R ι inverse := fromModuleCatOverMatrix R ι diff --git a/LeanPool/BrauerGroupNew/RelativeBrauer.lean b/LeanPool/BrauerGroupNew/RelativeBrauer.lean index 10a0728178..c0a373acff 100644 --- a/LeanPool/BrauerGroupNew/RelativeBrauer.lean +++ b/LeanPool/BrauerGroupNew/RelativeBrauer.lean @@ -29,7 +29,7 @@ import Mathlib.RingTheory.SimpleRing.Matrix `dim_F B = (dim_F K)^2`. -/ -@[expose] public section +public section suppress_compilation diff --git a/LeanPool/BrauerGroupNew/SkolemNoether.lean b/LeanPool/BrauerGroupNew/SkolemNoether.lean index bf300888a2..82488fba30 100644 --- a/LeanPool/BrauerGroupNew/SkolemNoether.lean +++ b/LeanPool/BrauerGroupNew/SkolemNoether.lean @@ -21,7 +21,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Imported Lean Pool material for `LeanPool.BrauerGroupNew.SkolemNoether`. -/ -@[expose] public section +public section suppress_compilation @@ -33,7 +33,7 @@ open scoped TensorProduct variable (K : Type u) [Field K] /-- Type synonym for viewing an `A`-module through an embedding of `B` into `A`. -/ -def moduleInst (K A B M : Type u) +@[expose] def moduleInst (K A B M : Type u) [Field K] [Ring A] [Algebra K A] [Ring B] [Algebra K B] (f : B →ₐ[K] A) := (fun _ : B →ₐ[K] A => M) f @@ -61,7 +61,7 @@ instance (K A B M : Type u) IsScalarTower.of_algebraMap_smul fun _ ↦ congrFun rfl /-- The additive action map before tensor-product descent. -/ -def smul1AddHom' (K A B M : Type u) +@[expose] def smul1AddHom' (K A B M : Type u) [Field K] [Ring A] [Algebra K A] [Ring B] [Algebra K B] [AddCommGroup M] [Module A M] (f : B →ₐ[K] A) (m : M) : B →+ (Module.End A M) →+ M where @@ -80,7 +80,7 @@ def smul1AddHom' (K A B M : Type u) exact Module.add_smul (f b1) (f b2) (l m) /-- The tensor-product additive action on the transported module. -/ -def smul1AddHom (K A B M : Type u) +@[expose] def smul1AddHom (K A B M : Type u) [Field K] [Ring A] [Algebra K A] [Ring B] [Algebra K B] [AddCommGroup M] [Module K M] [Module A M] [IsScalarTower K A M] (f : B →ₐ[K] A) : M → (B ⊗[K] (Module.End A M)) →+ M := fun m ↦ @@ -89,7 +89,7 @@ def smul1AddHom (K A B M : Type u) rw [map_smul, LinearMap.smul_apply, smul_assoc, smul_comm] /-- The tensor-product linear action on the transported module. -/ -def smul1 (K A B M : Type u) +@[expose] def smul1 (K A B M : Type u) [Field K] [Ring A] [Algebra K A] [Ring B] [Algebra K B] [AddCommGroup M] [Module K M] [Module A M] [IsScalarTower K A M] (f : B →ₐ[K] A) : M → (B ⊗[K] (Module.End A M)) →ₗ[K] (moduleInst K A B M f) := diff --git a/LeanPool/BrauerGroupNew/SplittingOfCSA.lean b/LeanPool/BrauerGroupNew/SplittingOfCSA.lean index 38bd704dd7..754fc1aee4 100644 --- a/LeanPool/BrauerGroupNew/SplittingOfCSA.lean +++ b/LeanPool/BrauerGroupNew/SplittingOfCSA.lean @@ -32,7 +32,7 @@ import Mathlib.Topology.MetricSpace.Bounded This file ports the upstream splitting-field infrastructure for central simple algebras. -/ -@[expose] public section +public section suppress_compilation @@ -225,7 +225,7 @@ structure split (A : CSA k) (K : Type*) [Field K] [Algebra k K] where (iso : K ⊗[k] A ≃ₐ[K] Matrix (Fin n) (Fin n) K) /-- A field extension splits an algebra if the scalar extension is a matrix algebra. -/ -def isSplit (L : Type u) [Field L] [Algebra k L] : Prop := +@[expose] def isSplit (L : Type u) [Field L] [Algebra k L] : Prop := ∃ (n : ℕ) (_ : NeZero n), Nonempty (L ⊗[k] A ≃ₐ[L] Matrix (Fin n) (Fin n) L) diff --git a/LeanPool/BrauerGroupNew/Subfield.lean b/LeanPool/BrauerGroupNew/Subfield.lean index 5af48c687f..ded9d55024 100644 --- a/LeanPool/BrauerGroupNew/Subfield.lean +++ b/LeanPool/BrauerGroupNew/Subfield.lean @@ -19,4 +19,4 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Import index for the Brauer group formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/BrauerGroupNew/Subfield/Defs.lean b/LeanPool/BrauerGroupNew/Subfield/Defs.lean index 082db8715d..d99eafdf9a 100644 --- a/LeanPool/BrauerGroupNew/Subfield/Defs.lean +++ b/LeanPool/BrauerGroupNew/Subfield/Defs.lean @@ -14,7 +14,7 @@ import LeanPool.BrauerGroupNew.Mathlib.Algebra.Algebra.Subalgebra.Directed Imported Lean Pool material for `LeanPool.BrauerGroupNew.Subfield.Defs`. -/ -@[expose] public section +public section open Function TensorProduct MulOpposite @@ -76,7 +76,7 @@ noncomputable instance _root_.SubField.carrier.instSemifield [Nontrivial A] : Se nnqsmul := _ /-- The directed supremum of a set of subfields. -/ -@[simps toSubalgebra] +@[expose, simps toSubalgebra] def dSup (s : Set (SubField R A)) (hs : s.Nonempty) (hsdir : DirectedOn (· ≤ ·) s) : SubField R A where toSubalgebra := ⨆ L ∈ s, L.1 diff --git a/LeanPool/BrauerGroupNew/Subfield/FiniteDimensional.lean b/LeanPool/BrauerGroupNew/Subfield/FiniteDimensional.lean index c4098bbd65..b4236e7d06 100644 --- a/LeanPool/BrauerGroupNew/Subfield/FiniteDimensional.lean +++ b/LeanPool/BrauerGroupNew/Subfield/FiniteDimensional.lean @@ -15,7 +15,7 @@ import Mathlib.LinearAlgebra.FiniteDimensional.Basic Imported Lean Pool material for `LeanPool.BrauerGroupNew.Subfield.FiniteDimensional`. -/ -@[expose] public section +public section namespace SubField variable {K A : Type*} [Field K] [Ring A] [Algebra K A] {L : SubField K A} diff --git a/LeanPool/BrauerGroupNew/Subfield/Separable.lean b/LeanPool/BrauerGroupNew/Subfield/Separable.lean index 2a36f3d1de..48a305cb1a 100644 --- a/LeanPool/BrauerGroupNew/Subfield/Separable.lean +++ b/LeanPool/BrauerGroupNew/Subfield/Separable.lean @@ -23,7 +23,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Imported Lean Pool material for `LeanPool.BrauerGroupNew.Subfield.Separable`. -/ -@[expose] public section +public section universe u @@ -64,7 +64,7 @@ instance SubField.adjoin_isDomain (L : SubField K D) (a : D) : simp_all /-- The subfield generated by a subfield and an element centralizing that subfield. -/ -def SubField.adjoin (L : SubField K D) (a : D) (ha : a ∈ Subalgebra.centralizer K L) : +@[expose] def SubField.adjoin (L : SubField K D) (a : D) (ha : a ∈ Subalgebra.centralizer K L) : SubField K D where __ := Algebra.adjoin K (L ∪ {a}) algebraMap_mem' k := by diff --git a/LeanPool/BrauerGroupNew/Subfield/Splitting.lean b/LeanPool/BrauerGroupNew/Subfield/Splitting.lean index 89aeba43c6..e6de553f79 100644 --- a/LeanPool/BrauerGroupNew/Subfield/Splitting.lean +++ b/LeanPool/BrauerGroupNew/Subfield/Splitting.lean @@ -31,7 +31,7 @@ import Mathlib.RingTheory.SimpleRing.Matrix Imported Lean Pool material for `LeanPool.BrauerGroupNew.Subfield.Splitting`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/BrauerGroupNew/Subfield/Subfield.lean b/LeanPool/BrauerGroupNew/Subfield/Subfield.lean index 4ff96dd7ab..b2ea5ddb77 100644 --- a/LeanPool/BrauerGroupNew/Subfield/Subfield.lean +++ b/LeanPool/BrauerGroupNew/Subfield/Subfield.lean @@ -20,7 +20,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Imported Lean Pool material for `LeanPool.BrauerGroupNew.Subfield.Subfield`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/BrauerGroupNew/ToSecond.lean b/LeanPool/BrauerGroupNew/ToSecond.lean index 5a378816ac..0fbe04e30c 100644 --- a/LeanPool/BrauerGroupNew/ToSecond.lean +++ b/LeanPool/BrauerGroupNew/ToSecond.lean @@ -23,7 +23,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Imported Lean Pool material for `LeanPool.BrauerGroupNew.ToSecond`. -/ -@[expose] public section +public section suppress_compilation @@ -98,7 +98,7 @@ lemma dim_eq' [FiniteDimensional F K] : Module.finrank K A = Module.finrank F K variable (ρ σ τ : Gal(K, F)) /-- A unit implementing the Galois action by conjugation on the embedded splitting field. -/ -def conjFactor (σ : Gal(K, F)) : Type := {a : Aˣ // ∀ x : K, A.ι (σ x) = a * A.ι x * a⁻¹} +@[expose] def conjFactor (σ : Gal(K, F)) : Type := {a : Aˣ // ∀ x : K, A.ι (σ x) = a * A.ι x * a⁻¹} /-- A chosen conjugating unit for each Galois automorphism, supplied by Skolem-Noether. -/ def arbitraryConjFactor : A.conjFactor σ where @@ -118,7 +118,7 @@ def mul' (x : A.conjFactor σ) (y : A.conjFactor τ) : A.conjFactor (σ * τ) := conjFactor_prop, ← _root_.mul_assoc, conjFactor_prop]⟩ @[simp] -lemma mul'_coe (x : A.conjFactor σ) (y : A.conjFactor τ) : (mul' x y).1.1 = x.1 * y.1 := rfl +lemma mul'_coe (x : A.conjFactor σ) (y : A.conjFactor τ) : (mul' x y).1.1 = x.1 * y.1 := by rfl lemma conjFactor_rel_aux (x y : A.conjFactor σ) : ∃ (c : K), x.1 = y.1 * A.ι c := by @@ -161,7 +161,7 @@ lemma conjFactorTwistCoeff_self (x : A.conjFactor σ) : conjFactorTwistCoeff x x Eq.symm <| conjFactorTwistCoeff_unique _ _ _ <| by simp /-- The twist coefficient packaged as a unit. -/ -@[simps -isSimp] +@[simps -isSimp, expose] def conjFactorTwistCoeffAsUnit (x y : A.conjFactor σ) : Kˣ where val := conjFactorTwistCoeff x y inv := conjFactorTwistCoeff y x @@ -213,7 +213,7 @@ def conjFactorCompCoeff (x : A.conjFactor σ) (y : A.conjFactor τ) (z : A.conjF σ <| τ <| conjFactorTwistCoeff (mul' x y) z /-- The composition coefficient packaged as a unit. -/ -@[simps -isSimp] +@[simps -isSimp, expose] def conjFactorCompCoeffAsUnit (x : A.conjFactor σ) (y : A.conjFactor τ) (z : A.conjFactor (σ * τ)) : Kˣ where val := conjFactorCompCoeff x y z @@ -423,7 +423,7 @@ def pushConjFactor (x : A.conjFactor σ) : B.conjFactor σ where @[simp] lemma pushConjFactor_coe (x : A.conjFactor σ) : (A.pushConjFactor B x).1.1 = A.isoConjCoeff B * (A.iso B <| x.1) * (A.isoConjCoeff B)⁻¹ := - rfl + by rfl /-- The scalar comparing a transported conjugating unit with a chosen target unit. -/ def pushConjFactorCoeff (x : A.conjFactor σ) (y : B.conjFactor σ) : K := @@ -546,13 +546,13 @@ lemma compare_toCocycles₂' (x_ : Π σ, A.conjFactor σ) (y_ : Π σ, B.conjFa end GoodRep /-- The additive form of a multiplicative-distribution representation. -/ -@[simps!] +@[simps!, expose] def _root_.Amelia.toAdditive (M G : Type 0) [Monoid M] [CommGroup G] [MulDistribMulAction M G] : Rep.ofMulDistribMulAction M G ≃+ Additive G := AddEquiv.refl _ variable (F K) in /-- The Galois action of `Gal(K/F)` on `Kˣ` as a representation. -/ -noncomputable def galAct : Rep ℤ Gal(K, F) := .ofMulDistribMulAction Gal(K, F) Kˣ +@[expose] noncomputable def galAct : Rep ℤ Gal(K, F) := .ofMulDistribMulAction Gal(K, F) Kˣ @[simp] lemma galAct_ρ_apply (σ : Gal(K, F)) (x : Kˣ) : (galAct F K).ρ σ (.ofMul x) = .ofMul (x.map σ) := rfl @@ -871,7 +871,7 @@ lemma fromSnd_wd (a : cocycles₂ (galAct F K)) : (fromSnd F K <| Quotient.mk'' a) = ⟨Quotient.mk'' (CrossProductAlgebra.asCSA (Additive.toMul ∘ a)), mem_relativeBrGroup_iff_nonempty_goodRep.2 - ⟨_, rfl, CrossProductAlgebra.incl _, CrossProductAlgebra.dim_eq_sq⟩⟩ := rfl + ⟨_, rfl, CrossProductAlgebra.incl _, CrossProductAlgebra.dim_eq_sq⟩⟩ := by rfl /-- Convert a multiplicative two-coboundary witness into an additive cohomology coboundary. -/ def _root_.Amfix.coboundariesOfIsMulCoboundary₂ {G M : Type} [Group G] [CommGroup M] @@ -1048,7 +1048,7 @@ lemma fromSnd_toSnd : (fromSnd F K ∘ (H2Iso (galAct F K)).hom) ∘ toSnd = id simp [-GoodRep.conjFactor_prop] /-- The equivalence between the relative Brauer group and second Galois cohomology. -/ -@[simp] +@[expose, simp] def equivSnd : RelativeBrGroup K F ≃ H2 (galAct F K) where toFun := toSnd invFun := (fromSnd F K ∘ (H2Iso (galAct F K)).hom) diff --git a/LeanPool/BrauerGroupNew/TwoSidedIdeal.lean b/LeanPool/BrauerGroupNew/TwoSidedIdeal.lean index 3a452ca2ea..f8006e3501 100644 --- a/LeanPool/BrauerGroupNew/TwoSidedIdeal.lean +++ b/LeanPool/BrauerGroupNew/TwoSidedIdeal.lean @@ -18,7 +18,7 @@ import Mathlib.RingTheory.TwoSidedIdeal.BigOperators Imported Lean Pool material for `LeanPool.BrauerGroupNew.TwoSidedIdeal`. -/ -@[expose] public section +public section variable {M : Type*} [AddCommMonoid M] (r : AddCon M) {ι : Type*} (s : Finset ι) variable {R : Type*} [Ring R] (t : TwoSidedIdeal R) diff --git a/LeanPool/BrauerGroupNew/Wedderburn.lean b/LeanPool/BrauerGroupNew/Wedderburn.lean index cd591988d5..b561ee00c4 100644 --- a/LeanPool/BrauerGroupNew/Wedderburn.lean +++ b/LeanPool/BrauerGroupNew/Wedderburn.lean @@ -22,7 +22,7 @@ import Mathlib.RingTheory.TwoSidedIdeal.BigOperators Imported Lean Pool material for `LeanPool.BrauerGroupNew.Wedderburn`. -/ -@[expose] public section +public section variable (A : Type*) [Ring A] @@ -66,7 +66,7 @@ The two-sided-ideals of `A` corresponds bijectively to that of `Mₙ(A)`. Given an ideal `I ≤ A`, we send it to `Mₙ(I)`. Given an ideal `J ≤ Mₙ(A)`, we send it to `{x₀₀ | x ∈ J}`. -/ -@[simps] +@[expose, simps] def TwoSidedIdeal.equivRingConMatrix (oo : ι) : TwoSidedIdeal A ≃ TwoSidedIdeal M[ι, A] where toFun I := I.mapMatrix A ι invFun J := TwoSidedIdeal.mk' @@ -117,7 +117,7 @@ The two-sided-ideals of `A` corresponds bijectively to that of `Mₙ(A)`. Given an ideal `I ≤ A`, we send it to `Mₙ(I)`. Given an ideal `J ≤ Mₙ(A)`, we send it to `{x₀₀ | x ∈ J}`. -/ -@[simps!] +@[expose, simps!] def TwoSidedIdeal.equivRingConMatrix' (oo : ι) : TwoSidedIdeal A ≃o TwoSidedIdeal M[ι, A] where __ := TwoSidedIdeal.equivRingConMatrix A _ oo map_rel_iff' {I J} := by @@ -145,7 +145,7 @@ instance op_simple : IsSimpleRing Aᵐᵒᵖ := /-- The canonical map from `Aᵒᵖ` to `Hom(A, A)` -/ -@[simps] +@[expose, simps] def mopToEnd : Aᵐᵒᵖ →+* Module.End A A where toFun a := { toFun := fun x ↦ x * a.unop @@ -159,7 +159,7 @@ def mopToEnd : Aᵐᵒᵖ →+* Module.End A A where /-- The canonical map from `A` to `Hom(A, A)ᵒᵖ` -/ -@[simps] +@[expose, simps] def toEndMop : A →+* (Module.End A A)ᵐᵒᵖ where toFun a := op { toFun := fun x ↦ x * a @@ -173,7 +173,7 @@ def toEndMop : A →+* (Module.End A A)ᵐᵒᵖ where /-- the map `Aᵒᵖ → Hom(A, A)` is bijective -/ -noncomputable def mopEquivEnd : Aᵐᵒᵖ ≃+* Module.End A A := +@[expose] noncomputable def mopEquivEnd : Aᵐᵒᵖ ≃+* Module.End A A := .ofBijective (mopToEnd A) ⟨RingHom.injective_iff_ker_eq_bot _ |>.mpr <| SetLike.ext fun α => ⟨by rintro (ha : mopToEnd A α = 0); simpa using (DFunLike.ext_iff.mp ha) 1, by rintro rfl; ext; simp⟩, fun φ => ⟨op (φ 1), by ext; simp⟩⟩ @@ -181,7 +181,7 @@ noncomputable def mopEquivEnd : Aᵐᵒᵖ ≃+* Module.End A A := /-- the map `Aᵒᵖ → Hom(A, A)` is bijective -/ -@[simps!] +@[expose, simps!] noncomputable def equivEndMop : A ≃+* (Module.End A A)ᵐᵒᵖ := .ofBijective (toEndMop A) ⟨RingHom.injective_iff_ker_eq_bot _ |>.mpr <| SetLike.ext fun α => ⟨fun ha => by @@ -193,7 +193,7 @@ noncomputable def equivEndMop : A ≃+* (Module.End A A)ᵐᵒᵖ := /-- For any ring `D`, `Mₙ(D) ≅ Mₙ(D)ᵒᵖ`. -/ -@[simps] +@[expose, simps] def matrixEquivMatrixMop (n : ℕ) (D : Type*) [Ring D] : Matrix (Fin n) (Fin n) Dᵐᵒᵖ ≃+* (Matrix (Fin n) (Fin n) D)ᵐᵒᵖ where toFun M := MulOpposite.op (M.transpose.map (fun d => MulOpposite.unop d)) @@ -446,7 +446,7 @@ variable {B} in /-- For a `K`-algebra B, there is a map from `I : Ideal B` to `End(I)ᵒᵖ` defined by `k ↦ x ↦ k • x`. -/ -@[simps] +@[expose, simps] def algebraMapEndIdealMop (I : Ideal B) : K →+* (Module.End B I)ᵐᵒᵖ where toFun k := .op { toFun x := k • x diff --git a/LeanPool/BrauerGroupNew/ZeroSevenFourE.lean b/LeanPool/BrauerGroupNew/ZeroSevenFourE.lean index 9af9296dc2..cbee0ac9ae 100644 --- a/LeanPool/BrauerGroupNew/ZeroSevenFourE.lean +++ b/LeanPool/BrauerGroupNew/ZeroSevenFourE.lean @@ -20,7 +20,7 @@ This file ports the upstream Wedderburn-Artin uniqueness arguments used by the B development. -/ -@[expose] public section +public section open CategoryTheory DirectSum @@ -559,7 +559,7 @@ lemma gen_spec (M : Type v) [AddCommGroup M] ∃ a : A, m' = a • gen A M := (exists_gen A M).choose_spec.2 m' /-- The left action map into the double centralizer endomorphism algebra. -/ -@[simps] +@[simps, expose] def toEndEnd (M : Type v) [AddCommGroup M] [Module A M] : A →ₗ[A] Module.End (Module.End A M) M where toFun a := @@ -575,6 +575,7 @@ lemma toEndEnd_apply (M : Type v) [AddCommGroup M] [Module A M] (a : A) (m : M) toEndEnd A M a m = a • m := rfl /-- The algebra homomorphism induced by the double centralizer action map. -/ +@[expose] def toEndEndAlgHom (M : Type v) [AddCommGroup M] [Module A M] [Module k M] [IsScalarTower k A M] : A →ₐ[k] Module.End (Module.End A M) M where __ := toEndEnd A M @@ -700,7 +701,7 @@ lemma isBalanced_of_simpleMod (k : Type u) (A : Type v) [Field k] [Ring A] [Alge exact this /-- The double centralizer algebra equivalence for a simple module. -/ -noncomputable def endEndIso +@[expose] noncomputable def endEndIso (M : Type v) [AddCommGroup M] [Module A M] [IsSimpleModule A M] [Module k M] [IsScalarTower k A M] : A ≃ₐ[k] Module.End (Module.End A M) M := diff --git a/LeanPool/Brouwer.lean b/LeanPool/Brouwer.lean index 22619c0b92..8f69e404ea 100644 --- a/LeanPool/Brouwer.lean +++ b/LeanPool/Brouwer.lean @@ -21,4 +21,4 @@ Tags: game-theory, nash-equilibrium, brouwer-fixed-point, scarf-lemma, simplex MSC: 91A06, 91A10, 47H10 -/ -@[expose] public section +public section diff --git a/LeanPool/Brouwer/Brouwer.lean b/LeanPool/Brouwer/Brouwer.lean index 69a01b4864..fdb139112c 100644 --- a/LeanPool/Brouwer/Brouwer.lean +++ b/LeanPool/Brouwer/Brouwer.lean @@ -24,7 +24,7 @@ finer and finer subdivisions and passing to a convergent subsequence of the resulting colorful points produces a fixed point. -/ -@[expose] public section +public section open Brouwer (standardSimplex) diff --git a/LeanPool/Brouwer/BrouwerProduct.lean b/LeanPool/Brouwer/BrouwerProduct.lean index dca6addc5f..c82b200e6b 100644 --- a/LeanPool/Brouwer/BrouwerProduct.lean +++ b/LeanPool/Brouwer/BrouwerProduct.lean @@ -22,7 +22,7 @@ simplex onto the product, so a fixed point of a continuous self-map of the produ is obtained from the single-simplex theorem. -/ -@[expose] public section +public section open Brouwer (standardSimplex) diff --git a/LeanPool/Brouwer/Nash.lean b/LeanPool/Brouwer/Nash.lean index a9085fda00..80ec972fd3 100644 --- a/LeanPool/Brouwer/Nash.lean +++ b/LeanPool/Brouwer/Nash.lean @@ -23,7 +23,7 @@ simplices, and `ExistsNashEq` derives the existence of a mixed Nash equilibrium every finite game from Brouwer's fixed-point theorem on a product of simplices. -/ -@[expose] public section +public section open Brouwer (standardSimplex) @@ -237,7 +237,7 @@ def mapSimplex {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) : @[simp] lemma map_simplex_apply {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) (x : standardSimplex ℝ n) (i : m) : - (mapSimplex e x).1 i = x.1 (e.symm i) := rfl + (mapSimplex e x).1 i = x.1 (e.symm i) := by rfl /-- The simplex map induced by an equivalence is itself an equivalence. -/ def mapSimplexEquiv {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) : diff --git a/LeanPool/Brouwer/Primitive.lean b/LeanPool/Brouwer/Primitive.lean index ee89ce50f1..5cdfbc19a5 100644 --- a/LeanPool/Brouwer/Primitive.lean +++ b/LeanPool/Brouwer/Primitive.lean @@ -22,7 +22,7 @@ algorithm. It relates the room/door combinatorics developed in `Scarf` to this primitive-set picture used by the path-following termination argument. -/ -@[expose] public section +public section attribute [local instance] Classical.propDecidable open Finset @@ -55,6 +55,7 @@ def fromMissing (X : Finset (ExtendedGoods T I)) : Finset I := Finset.univ.filter (fun i : I => Sum.inr i ∉ X) /-- The room/door cell associated to a subset of `T ∪ I`. -/ +@[expose] def associatedCell (X : Finset (ExtendedGoods T I)) : GiCell T I := (fromGoods (T := T) (I := I) X, fromMissing (T := T) (I := I) X) @@ -923,6 +924,7 @@ theorem internal_almostPrimitive_replacementStep {Y : Finset (ExtendedGoods T I) exact ⟨X₁, X₂, ⟨hPrim₁, hPrim₂, hNe, Y, hY, hSub₁, hSub₂⟩, hSub₁, hSub₂⟩ /-- Extend a coloring of goods by coloring each slack vector by its own index. -/ +@[expose] def extendedColoring (c : T → I) : ExtendedGoods T I → I | Sum.inl t => c t | Sum.inr i => i @@ -1660,6 +1662,7 @@ def slackVector (M : I → ℝ) (i : I) : I → ℝ := fun j => if j = i then 0 else M i /-- Interpret the enlarged set `T ∪ I` as points in `ℝ^I`. -/ +@[expose] def extendedCoordinatePoint (u : I → T → ℝ) (M : I → ℝ) : ExtendedGoods T I → I → ℝ | Sum.inl x => utilityVector (I := I) u x diff --git a/LeanPool/Brouwer/Scarf.lean b/LeanPool/Brouwer/Scarf.lean index 714d7f16f0..06a746875f 100644 --- a/LeanPool/Brouwer/Scarf.lean +++ b/LeanPool/Brouwer/Scarf.lean @@ -29,7 +29,7 @@ machinery used in the parity (door-counting) argument that culminates in colorful room. -/ -@[expose] public section +public section section fiberlemma @@ -102,7 +102,7 @@ variable (σ : Finset T) (C : Finset I) /- Definition of Dominant -/ /-- `σ` is dominant for `C`: every point is dominated at some index of `C`. -/ -def isDominant := +@[expose] def isDominant := ∀ y, ∃ i ∈ C, ∀ x ∈ σ, y ≤[i] x variable {σ C} in @@ -1095,12 +1095,13 @@ attribute [local instance] Classical.propDecidable variable (c : T → I) (σ : Finset T) (C : Finset I) /-- A colorful cell: the image of the coloring on `σ` equals `C`. -/ -def isColorful : Prop := IST.isCell σ C ∧ σ.image c = C +@[expose] def isColorful : Prop := IST.isCell σ C ∧ σ.image c = C /-- A nearly colorful cell: exactly one color of `C` is missing. -/ def isNearlyColorful : Prop := IST.isCell σ C ∧ (C \ σ.image c).card = 1 /-- A nearly colorful cell whose missing color is exactly `i`. -/ +@[expose] def isTypedNC (i : I) (σ : Finset T) (C : Finset I) : Prop := IST.isCell σ C ∧ (C \ (σ.image c)) = {i} diff --git a/LeanPool/Brouwer/ScarfPath.lean b/LeanPool/Brouwer/ScarfPath.lean index ddf80300ac..4e5ffaf259 100644 --- a/LeanPool/Brouwer/ScarfPath.lean +++ b/LeanPool/Brouwer/ScarfPath.lean @@ -24,7 +24,7 @@ room-door incidences. Following a path in this graph between odd-degree vertices is the combinatorial heart of the path-following proof of Scarf's lemma. -/ -@[expose] public section +public section attribute [local instance] Classical.propDecidable open Finset @@ -40,11 +40,13 @@ variable [DecidableEq T] [DecidableEq I] [IST : IndexedLOrder I T] abbrev GiCell (T I : Type*) := Finset T × Finset I /-- The room-type vertices of the graph `G_i`: colorful rooms and typed nearly-colorful rooms. -/ +@[expose] def GiRoomVertex (c : T → I) (i : I) (v : GiCell T I) : Prop := IST.isColorful c v.1 v.2 ∨ (IST.isRoom v.1 v.2 ∧ IST.isTypedNC c i v.1 v.2) /-- The door-type vertices of the graph `G_i`: typed nearly-colorful doors. -/ +@[expose] def GiDoorVertex (c : T → I) (i : I) (v : GiCell T I) : Prop := IST.isDoor v.1 v.2 ∧ IST.isTypedNC c i v.1 v.2 @@ -53,6 +55,7 @@ def GiVertex (c : T → I) (i : I) (v : GiCell T I) : Prop := GiRoomVertex (IST := IST) c i v ∨ GiDoorVertex (IST := IST) c i v /-- Edges of `G_i`: room-door incidence, made symmetric. -/ +@[expose] def GiEdge (c : T → I) (i : I) (v w : GiCell T I) : Prop := (GiRoomVertex (IST := IST) c i v ∧ GiDoorVertex (IST := IST) c i w ∧ @@ -98,12 +101,14 @@ lemma GiEdge.irrefl {c : T → I} {i : I} (v : GiCell T I) : exact absurd h.2.1.door.2 (by have := h.1.room.2; omega) /-- The Mathlib `SimpleGraph` whose vertices and edges are the graph `G_i`. -/ +@[expose] def GiGraph (c : T → I) (i : I) : SimpleGraph (GiCell T I) where Adj := GiEdge (IST := IST) c i symm := ⟨fun _ _ h => GiEdge.symm h⟩ loopless := ⟨fun v => GiEdge.irrefl (IST := IST) (c := c) (i := i) v⟩ /-- The finite neighbor set of a vertex in `G_i`. -/ +@[expose] def GiNeighbors (c : T → I) (i : I) (v : GiCell T I) : Finset (GiCell T I) := (GiGraph (IST := IST) c i).neighborFinset v @@ -113,10 +118,12 @@ lemma mem_GiNeighbors {c : T → I} {i : I} {v w : GiCell T I} : exact SimpleGraph.mem_neighborFinset (GiGraph (IST := IST) c i) v w /-- Degree in `G_i`. -/ +@[expose] def GiDegree (c : T → I) (i : I) (v : GiCell T I) : Nat := (GiNeighbors (IST := IST) c i v).card /-- Endpoint vertices of `G_i`. -/ +@[expose] def GiEndpoint (c : T → I) (i : I) (v : GiCell T I) : Prop := GiVertex (IST := IST) c i v ∧ GiDegree (IST := IST) c i v = 1 @@ -445,6 +452,7 @@ theorem GiDegree_colorfulRoom {c : T → I} {i : I} {σ : Finset T} {C : Finset simp /-- A graph has degree at most two at each vertex. -/ +@[expose] def simpleGraphDegreeAtMostTwo {α : Type*} [Fintype α] (G : SimpleGraph α) : Prop := ∀ v, G.degree v ≤ 2 @@ -471,6 +479,7 @@ The degree characterization of `G_i`: every vertex has degree one or two, and the degree-one vertices are exactly the unique outside door of type `i` and the colorful rooms. -/ +@[expose] def GiDegreeCharacterization (c : T → I) (i : I) : Prop := (∀ v, GiVertex (IST := IST) c i v → GiDegree (IST := IST) c i v = 1 ∨ GiDegree (IST := IST) c i v = 2) ∧ @@ -518,6 +527,7 @@ theorem GiDegreeCharacterization_holds (c : T → I) (i : I) : The path-structure target for `G_i`: degree characterization plus the local degree-at-most-two property used by path-following. -/ +@[expose] def GiPathStructure (c : T → I) (i : I) : Prop := GiDegreeCharacterization (IST := IST) c i ∧ simpleGraphDegreeAtMostTwo (GiGraph (IST := IST) c i) diff --git a/LeanPool/Brouwer/Simplex.lean b/LeanPool/Brouwer/Simplex.lean index a7b714b930..018a1a40d5 100644 --- a/LeanPool/Brouwer/Simplex.lean +++ b/LeanPool/Brouwer/Simplex.lean @@ -16,12 +16,13 @@ when reasoning about mixed strategies, including the key inequality `wsum_magic_ineq` relating a weighted sum to a uniform bound. -/ -@[expose] public section +public section namespace Brouwer /-- The standard simplex as a set of coordinate functions. Keeping this representation gives its points the subspace topology of the finite product used in the fixed-point proof. -/ +@[expose] def standardSimplex (k α : Type*) [Semiring k] [PartialOrder k] [Fintype α] : Set (α → k) := {f | (∀ i, 0 ≤ f i) ∧ ∑ i, f i = 1} diff --git a/LeanPool/BruhatTits.lean b/LeanPool/BruhatTits.lean index a106d4910c..3a06269a12 100644 --- a/LeanPool/BruhatTits.lean +++ b/LeanPool/BruhatTits.lean @@ -22,7 +22,7 @@ Tags: algebraic-geometry, graph-theory, discrete-valuation-rings MSC: 20E42, 05C25, 13H05 -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Cartan.lean b/LeanPool/BruhatTits/Cartan.lean index eb0cfc23aa..c64f4e7b1d 100644 --- a/LeanPool/BruhatTits/Cartan.lean +++ b/LeanPool/BruhatTits/Cartan.lean @@ -12,6 +12,6 @@ public import LeanPool.BruhatTits.Cartan.Uniqueness # Cartan decomposition -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Cartan/Existence.lean b/LeanPool/BruhatTits/Cartan/Existence.lean index 1885b4e07f..38101ef9b5 100644 --- a/LeanPool/BruhatTits/Cartan/Existence.lean +++ b/LeanPool/BruhatTits/Cartan/Existence.lean @@ -34,7 +34,7 @@ This is inspired by the file https://leanprover-community.github.io/mathlib4_doc -/ -@[expose] public section +public section open Module @@ -626,7 +626,7 @@ lemma exists_normalization_of_isMonotoneDiag [IsDiscreteValuationRing R] (g : GL /-- The cartan diagonal for a tuple of integers `f` is the diagonal matrix where the diagonal entries are given by `ϖ ^ f i`. -/ -@[simps! -isSimp] +@[expose, simps! -isSimp] def cartanDiag {k : ℕ} (f : Fin k → ℤ) : GL (Fin k) K := let d (j : Fin k) : Kˣ := { val := ϖ ^ f j diff --git a/LeanPool/BruhatTits/Cartan/Uniqueness.lean b/LeanPool/BruhatTits/Cartan/Uniqueness.lean index 76739296ec..a236e3be89 100644 --- a/LeanPool/BruhatTits/Cartan/Uniqueness.lean +++ b/LeanPool/BruhatTits/Cartan/Uniqueness.lean @@ -28,7 +28,7 @@ completeness, this is stated as `iUnion₂_doset_cartanDiag_eq_univ` and `disjoint_doset_cartanDiag_of_ne` below. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Graph.lean b/LeanPool/BruhatTits/Graph.lean index 0692c67656..098dfd1d7b 100644 --- a/LeanPool/BruhatTits/Graph.lean +++ b/LeanPool/BruhatTits/Graph.lean @@ -17,6 +17,6 @@ public import LeanPool.BruhatTits.Graph.Vertices # Bruhat-Tits graph -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Graph/Edges.lean b/LeanPool/BruhatTits/Graph/Edges.lean index c47a70e578..7ff3f4de7f 100644 --- a/LeanPool/BruhatTits/Graph/Edges.lean +++ b/LeanPool/BruhatTits/Graph/Edges.lean @@ -43,7 +43,7 @@ sense of `inv`, is one. -/ -@[expose] public section +public section open Module @@ -62,6 +62,7 @@ variable [IsDiscreteValuationRing R] [IsFractionRing R K] /-- Two vertices `x` and `y` in the Bruhat-Tits tree are neighbours if `inv L M = 1`. For a common alternative definition see `BruhatTits.isNeighbour_iff`. -/ +@[expose] def IsNeighbour (x y : Vertices R) : Prop := inv x y = 1 lemma isNeighbour_def (x y : Vertices R) : @@ -153,8 +154,8 @@ lemma isNeighbour_of_isStandardNeighbour {M L : Lattice R} (h : IsStandardNeighb have : f 1 = 0 ∧ f 0 = 1 := by omega rw [this.left, this.right] at hdiff simp at hdiff - change dist _ _ = 1 - rw [dist_symm] + apply (isNeighbour_def (Vertices.mk _) (Vertices.mk _)).mpr + rw [inv_mk, dist_symm] omega lemma exists_basis_eq_ntwist_of_isNeighbour (M : Lattice R) (L : Vertices R) diff --git a/LeanPool/BruhatTits/Graph/Graph.lean b/LeanPool/BruhatTits/Graph/Graph.lean index a6f3723e62..cfedc02932 100644 --- a/LeanPool/BruhatTits/Graph/Graph.lean +++ b/LeanPool/BruhatTits/Graph/Graph.lean @@ -15,7 +15,7 @@ In this file we define the Bruhat-Tits graph as a simple graph and show it is co -/ -@[expose] public section +public section open Module @@ -35,7 +35,6 @@ The Bruhat-Tits graph defined as a simple graph. The vertices are given by the h classes of lattices. Two vertices are connected by an edge if they are neighbours, i.e. if their distance is equal to `1`. -/ -@[simps -isSimp] def BTgraph : SimpleGraph (Vertices R) where Adj L M := BruhatTits.IsNeighbour L M symm := ⟨fun L M => (isNeighbour_symm L M).mp⟩ @@ -44,6 +43,9 @@ def BTgraph : SimpleGraph (Vertices R) where rw [inv_self] at h simp at h⟩ +lemma BTgraph_adj (L M : Vertices R) : + (BTgraph (R := R)).Adj L M = IsNeighbour L M := by rfl + /-- There is a path between any two vertices. -/ lemma reachable (M L : Vertices R) {n : ℕ} : (h : inv M L = n) → BTgraph.Reachable M L := by revert M L diff --git a/LeanPool/BruhatTits/Graph/GroupAction.lean b/LeanPool/BruhatTits/Graph/GroupAction.lean index d7273b5061..3e15768706 100644 --- a/LeanPool/BruhatTits/Graph/GroupAction.lean +++ b/LeanPool/BruhatTits/Graph/GroupAction.lean @@ -28,7 +28,7 @@ In this file we equip the Bruhat-Tits graph with group actions of `GL₂(K)` and -/ -@[expose] public section +public section open Module @@ -77,8 +77,7 @@ def smulGL (g : GL (Fin 2) K) : Vertices R → Vertices R := exact isSimilar_smul_of_isSimilar g L M h lemma smulGL_mk (g : GL (Fin 2) K) (L : Lattice R) : - smulGL g ⟦L⟧ = ⟦g • L⟧ := - rfl + smulGL g ⟦L⟧ = ⟦g • L⟧ := by rfl instance : SMul (GL (Fin 2) K) (Vertices R) where smul := smulGL @@ -118,11 +117,11 @@ lemma inv_smul_smul_eq_inv (g : GL (Fin 2) K) (x y : Vertices R) : lemma adj_smul_smul_iff_adj (g : GL (Fin 2) K) (x y : Vertices R) : BTgraph.Adj (g • x) (g • y) ↔ BTgraph.Adj x y := by - change inv (g • x) (g • y) = 1 ↔ inv x y = 1 + simp only [BTgraph_adj, IsNeighbour] simp /-- `GL₂(K)` acts by graph isomorphisms on the Bruhat-Tits tree. -/ -def _root_.Matrix.GeneralLinearGroup.toGraphIso (g : GL (Fin 2) K) : +@[expose] def _root_.Matrix.GeneralLinearGroup.toGraphIso (g : GL (Fin 2) K) : BTgraph (R := R) ≃g BTgraph (R := R) where toEquiv := MulAction.toPerm g map_rel_iff' {x y} := adj_smul_smul_iff_adj g x y diff --git a/LeanPool/BruhatTits/Graph/Orientation.lean b/LeanPool/BruhatTits/Graph/Orientation.lean index b1f6571b88..eabc600574 100644 --- a/LeanPool/BruhatTits/Graph/Orientation.lean +++ b/LeanPool/BruhatTits/Graph/Orientation.lean @@ -31,7 +31,7 @@ evenness of vertices (see `BruhatTits.isEven_specialLinearGroup_smul_iff`). -/ -@[expose] public section +public section open Module @@ -85,7 +85,12 @@ lemma isEven_iff' (L : Lattice R) : L.IsEven ↔ ∃ (b : Basis (Fin 2) K (Fin 2 → K)), b.toLattice = L ∧ Even (zaddVal (R := R) b.toGeneralLinearGroup.det) := by rw [isEven_iff] - refine ⟨fun ⟨b, hb⟩ ↦ ⟨b.fromLattice, by simp, hb⟩, ?_⟩ + refine ⟨?_, ?_⟩ + · rintro ⟨b, hb⟩ + have hGL : b.fromLattice.toGeneralLinearGroup = b.toGL := by + ext i j + simp only [Basis.toGeneralLinearGroup_apply, Basis.fromLattice_apply, Basis.toGL_apply] + exact ⟨b.fromLattice, by simp, by simpa only [hGL] using hb⟩ rintro ⟨b, rfl, hb⟩ use b.restrictToLattice have : (b.restrictToLattice (R := R)).toGL = b.toGeneralLinearGroup := by @@ -183,7 +188,8 @@ lemma isEven_specialLinearGroup_smul {x : Vertices R} (h : IsEven x) (g : Matrix.SpecialLinearGroup (Fin 2) K) : IsEven (g • x) := by revert h refine Quotient.inductionOn x fun x h ↦ ?_ - change IsEven ⟦g • x⟧ + change IsEven (smulGL g.toGL (⟦x⟧ : Vertices R)) + rw [smulGL_mk] simpa @[simp] diff --git a/LeanPool/BruhatTits/Graph/Regular.lean b/LeanPool/BruhatTits/Graph/Regular.lean index 18af940e49..cd4a78cbe5 100644 --- a/LeanPool/BruhatTits/Graph/Regular.lean +++ b/LeanPool/BruhatTits/Graph/Regular.lean @@ -27,7 +27,7 @@ vertex has the same finite number of neighbours. Furthermore we show that this n cardinality of `R ⧸ 𝓂 R`. -/ -@[expose] public section +public section open Module @@ -70,8 +70,7 @@ def standardNeighbour {L : Lattice R} {y : Vertices R} (h : IsNeighbour y ⟦L @[simp] lemma standardNeighbourBasis_ntwist_eq {L : Lattice R} {y : Vertices R} (h : IsNeighbour y ⟦L⟧) : ((standardNeighbourBasis h).ntwist₂ (standardNeighbourϖ_irreducible h) 1 0).toLattice = - standardNeighbour h := - rfl + standardNeighbour h := by rfl lemma standardNeighbour_isStandardNeighbour {L : Lattice R} {y : Vertices R} (h : IsNeighbour y ⟦L⟧) : @@ -287,7 +286,6 @@ variable [Finite (ResidueField R)] /-- If the residue field of `R` is finite, every vertex has finitely many neighbors. -/ instance (x : Vertices R) : Finite ((BTgraph (R := R)).neighborSet x) := by refine Quotient.inductionOn x (fun L ↦ ?_) - change Finite {y : Vertices R // IsNeighbour ⟦L⟧ y} have : Finite L.quotient := Module.finite_of_finite (ResidueField R) apply Finite.of_equiv _ (neighborSetEquivProjectivization L).symm diff --git a/LeanPool/BruhatTits/Graph/Tree.lean b/LeanPool/BruhatTits/Graph/Tree.lean index bc8e54cba8..20183c6be4 100644 --- a/LeanPool/BruhatTits/Graph/Tree.lean +++ b/LeanPool/BruhatTits/Graph/Tree.lean @@ -29,7 +29,7 @@ The strategy for proving acyclicity is as follows: -/ -@[expose] public section +public section open Module @@ -61,7 +61,8 @@ lemma _root_.SimpleGraph.Walk.exists_repr_isChain {x y : Vertices R} (p : BTgrap rw [← p.cons_tail_support] at hl exact (List.cons.inj hl).1 subst hLv - obtain ⟨M, rfl, hstd⟩ := exists_repr_isStandardNeighbour_of_isNeighbour L u hadj.symm + obtain ⟨M, rfl, hstd⟩ := exists_repr_isStandardNeighbour_of_isNeighbour L u + (by simpa only [BTgraph_adj] using hadj.symm) refine ⟨M :: L :: l, ?_, ?_⟩ · exact cons_isChain_of hchain hstd · rw [SimpleGraph.Walk.support_cons, ← hl] @@ -73,6 +74,7 @@ noncomputable def chainToWalk (l : List (Lattice R)) (hl : l ≠ []) (hc : l.IsB | [L] => SimpleGraph.Walk.nil' ⟦L⟧ | L₁ :: L₂ :: l => have p : BTgraph.Adj ⟦L₁⟧ ⟦L₂⟧ := by + rw [BTgraph_adj] apply isNeighbour_of_isStandardNeighbour have := hc.isStandardNeighbour simp_all diff --git a/LeanPool/BruhatTits/Graph/Vertices.lean b/LeanPool/BruhatTits/Graph/Vertices.lean index b96df9b33f..63ca072100 100644 --- a/LeanPool/BruhatTits/Graph/Vertices.lean +++ b/LeanPool/BruhatTits/Graph/Vertices.lean @@ -30,7 +30,7 @@ is later used to define the edge relations on the Bruhat-Tits graph (see `Bruhat -/ -@[expose] public section +public section open Module @@ -41,7 +41,7 @@ variable {K : Type*} [Field K] (R : Subring K) [IsDiscreteValuationRing R] /-- The vertices of the Bruhat-Tits tree are `R`-lattices modulo the equivalence relation `IsSimilar`. -/ -def Vertices : Type _ := +@[expose] def Vertices : Type _ := Quotient (Lattice.IsSimilar.setoid R) variable {R} @@ -57,7 +57,7 @@ noncomputable def inv (L M : Vertices R) : ℕ := @[simp] lemma inv_mk (L M : BruhatTits.Lattice R) : - inv (Quotient.mk'' L) (Quotient.mk'' M) = dist L M := + inv (Quotient.mk'' L) (Quotient.mk'' M) = dist L M := by rfl lemma inv_symm (L M : Vertices R) : inv L M = inv M L := by @@ -195,7 +195,8 @@ lemma dist_twist₂ (b : Basis (Fin 2) K (Fin 2 → K)) {ϖ : R} (hϖ : Irreduci lemma dist_ntwist₂ (b : Basis (Fin 2) K (Fin 2 → K)) {ϖ : R} (hϖ : Irreducible ϖ) (n : ℕ) : dist (b.toLattice (R := R)) (b.ntwist₂ hϖ n 0).toLattice = n := by - simp [Basis.ntwist₂, ← Nat.cast_inj (R := ℤ), dist_twist₂] + rw [← Nat.cast_inj (R := ℤ)] + simp [Basis.ntwist₂, dist_twist₂] /-- If vertices `x` and `y` have distance `n + 1`, there exists a vertex `o` with `inv o x = 1` and `inv y o = n`. diff --git a/LeanPool/BruhatTits/Harmonic.lean b/LeanPool/BruhatTits/Harmonic.lean index 8ba7630055..c82d3ecc57 100644 --- a/LeanPool/BruhatTits/Harmonic.lean +++ b/LeanPool/BruhatTits/Harmonic.lean @@ -12,6 +12,6 @@ public import LeanPool.BruhatTits.Harmonic.Basic # Harmonic cochains -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Harmonic/Application.lean b/LeanPool/BruhatTits/Harmonic/Application.lean index 062ea04f29..f4e31a0a77 100644 --- a/LeanPool/BruhatTits/Harmonic/Application.lean +++ b/LeanPool/BruhatTits/Harmonic/Application.lean @@ -17,7 +17,7 @@ In this file we show that the Laplacian of the Bruhat-Tits tree is surjective. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Harmonic/Basic.lean b/LeanPool/BruhatTits/Harmonic/Basic.lean index 616da87db6..ca6f3ecf14 100644 --- a/LeanPool/BruhatTits/Harmonic/Basic.lean +++ b/LeanPool/BruhatTits/Harmonic/Basic.lean @@ -24,7 +24,7 @@ finitely many neighbours, then the Laplacian is surjective. -/ -@[expose] public section +public section open Module @@ -63,6 +63,7 @@ lemma mem_incidenceFinset' (v : V) [Fintype (X.neighborSet v)] (e : X.edgeSet) : /-- The Laplacian of an `M`-valued function on the set of edges of `X` as an `M`-valued function on the vertices of `X`. -/ +@[expose] def laplace [∀ v, Fintype (X.neighborSet v)] (w : V → Aˣ) (f : X.edgeSet → M) (v : V) : M := w v • ∑ e ∈ X.incidenceFinset' v, f e @@ -763,8 +764,7 @@ lemma laplace_add (f g : X.edgeSet → M) : X.laplace w (f + g) = X.laplace w f simp [laplace_apply, Finset.sum_add_distrib] /-- The Laplacian of `X` as a group homomorphism. -/ -@[simps] -def laplaceHom : (X.edgeSet → M) →+ (V → M) where +@[expose, simps] def laplaceHom : (X.edgeSet → M) →+ (V → M) where toFun := X.laplace w map_zero' := laplace_zero w map_add' := laplace_add w @@ -786,7 +786,7 @@ lemma isLinearMap_laplace : IsLinearMap A (X.laplace (M := M) w) where map_smul := laplace_ASmul w /-- The Laplacian of `X` as an `A`-linear map. -/ -def laplaceLinearMap : (X.edgeSet → M) →ₗ[A] (V → M) := (isLinearMap_laplace w).mk' +@[expose] def laplaceLinearMap : (X.edgeSet → M) →ₗ[A] (V → M) := (isLinearMap_laplace w).mk' omit [DecidableEq V] in @[simp] diff --git a/LeanPool/BruhatTits/Lattice.lean b/LeanPool/BruhatTits/Lattice.lean index 84ee98ec35..85262b2524 100644 --- a/LeanPool/BruhatTits/Lattice.lean +++ b/LeanPool/BruhatTits/Lattice.lean @@ -15,6 +15,6 @@ public import LeanPool.BruhatTits.Lattice.Transvect # Lattices -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Lattice/Basic.lean b/LeanPool/BruhatTits/Lattice/Basic.lean index 170d1eb1c0..a830743ed4 100644 --- a/LeanPool/BruhatTits/Lattice/Basic.lean +++ b/LeanPool/BruhatTits/Lattice/Basic.lean @@ -22,7 +22,7 @@ If `R` is a principal ideal domain, any lattice is a free `R`-module of rank car -/ -@[expose] public section +public section open Module @@ -400,6 +400,7 @@ noncomputable def basis (L : BruhatTits.Lattice R) : variable (R) /-- Two `R`-lattices `L` and `N` are similar, if `N` is a `Kˣ`-multiple of `L`. -/ +@[expose] def IsSimilar (L N : Lattice R) : Prop := ∃ (a : Kˣ), a • L = N omit [IsFractionRing R K] [IsPrincipalIdealRing R] diff --git a/LeanPool/BruhatTits/Lattice/Construction.lean b/LeanPool/BruhatTits/Lattice/Construction.lean index eadc5f899a..c043778999 100644 --- a/LeanPool/BruhatTits/Lattice/Construction.lean +++ b/LeanPool/BruhatTits/Lattice/Construction.lean @@ -38,7 +38,7 @@ Most constructions work for an arbitrary subring `R` of a field `K`. of `b.twist hϖ f` for fixed `b` and varying `f`, in order to simplify calculations. -/ -@[expose] public section +public section open Module @@ -56,7 +56,7 @@ variable {ι : Type*} /-- From a `ι`-indexed basis `b` of `ι → K`, we obtain an `R` submodule of `ι → K` generated by the entries of `b`. -/ -def toSubmodule (b : Basis ι K (ι → K)) : Submodule R (ι → K) := +@[expose] def toSubmodule (b : Basis ι K (ι → K)) : Submodule R (ι → K) := Submodule.span R (Set.range b) lemma self_mem_toSubmodule (b : Basis ι K (ι → K)) (i : ι) : b i ∈ b.toSubmodule (R := R) := by @@ -87,6 +87,7 @@ suitable `simp` lemmas should be provided for lattices given by `Basis.toLattice If possible, in proofs use the induction principle of equality (i.e. the `subst` tactic) to replace all occurring lattices by invocations of `Basis.toLattice`. -/ +@[expose] def toLattice (b : Basis (Fin 2) K (Fin 2 → K)) : BruhatTits.Lattice R where M := b.toSubmodule isLattice := b.toSubmodule_isLattice @@ -144,6 +145,7 @@ lemma ntwist_apply [Fintype ι] (b : Basis ι K (ι → K)) {ϖ : R} simp [ntwist, Subring.smul_def] /-- `twist` specialized to dimension two. -/ +@[expose] def twist₂ (b : Basis (Fin 2) K (Fin 2 → K)) {ϖ : R} (hϖ : Irreducible ϖ) (n m : ℤ) : Basis (Fin 2) K (Fin 2 → K) := b.twist hϖ (fun i ↦ match i with @@ -163,6 +165,7 @@ lemma twist₂_apply₁ (b : Basis (Fin 2) K ((Fin 2) → K)) {ϖ : R} simp [twist₂] /-- `twist₂` for natural exponents. -/ +@[expose] def ntwist₂ (b : Basis (Fin 2) K (Fin 2 → K)) {ϖ : R} (hϖ : Irreducible ϖ) (n m : ℕ) : Basis (Fin 2) K (Fin 2 → K) := b.twist₂ hϖ n m @@ -381,7 +384,7 @@ lemma restrict_apply (b : Basis ι K (ι → K)) (i : ι) : /-- If `b` is a `K`-basis of `Fin 2 → K`, it is naturally an `R`-basis of the `R`-lattice generated by the entries of `b`. -/ -def restrictToLattice (b : Basis (Fin 2) K (Fin 2 → K)) : +@[expose] def restrictToLattice (b : Basis (Fin 2) K (Fin 2 → K)) : Basis (Fin 2) R (b.toLattice (R := R)).M := b.restrict (R := R) @@ -398,6 +401,7 @@ section «GLSMul» variable [DecidableEq ι] [Fintype ι] /-- Scalar multiplication by `GL ι K` on `ι`-indexed bases of `ι → K`. -/ +@[expose] def smulGL (g : GL ι K) (b : Basis ι K (ι → K)) : Basis ι K (ι → K) := b.map (g.toLin.toLinearEquiv) @@ -464,6 +468,7 @@ section «SMul» variable [Fintype ι] /-- Scalar multiplication of units of `K` on bases of `ι → K` by twisting. -/ +@[expose] def smul' (a : Kˣ) (b : Basis ι K (ι → K)) : Basis ι K (ι → K) := b.twist' (fun _ ↦ a) instance instSMulUnitsForallLeanPool : SMul Kˣ (Basis ι K (ι → K)) where @@ -607,6 +612,7 @@ lemma permMatrix_smul_toSubmodule (b : Basis ι K (ι → K)) (e : ι ≃ ι) : simp [permMatrix, toLinear_symm_ofLinearEquiv_mulVec] /-- The permutation exchanging the two indices of a rank-two basis. -/ +@[expose] def swap₂ : Fin 2 ≃ Fin 2 where toFun | 0 => 1 @@ -695,7 +701,7 @@ end Module.Basis variable (R) in /-- The standard `R`-lattice `R ⊕ R`. -/ -def Lattice.standard : BruhatTits.Lattice R := +@[expose] def Lattice.standard : BruhatTits.Lattice R := (Pi.basisFun K (Fin 2)).toLattice lemma Lattice.standard_M : diff --git a/LeanPool/BruhatTits/Lattice/Distance.lean b/LeanPool/BruhatTits/Lattice/Distance.lean index 37dcb539f0..20325a9524 100644 --- a/LeanPool/BruhatTits/Lattice/Distance.lean +++ b/LeanPool/BruhatTits/Lattice/Distance.lean @@ -41,7 +41,7 @@ graph. - `BruhatTits.dist_inv_isSimilar`: The distance function is invariant under homothety. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Lattice/Quotient.lean b/LeanPool/BruhatTits/Lattice/Quotient.lean index f77fabf112..15f2a749a7 100644 --- a/LeanPool/BruhatTits/Lattice/Quotient.lean +++ b/LeanPool/BruhatTits/Lattice/Quotient.lean @@ -33,7 +33,7 @@ the two-dimensional `R ⧸ ϖ R`-vector space `L ⧸ ϖ L`. -/ -@[expose] public section +public section open Module @@ -47,6 +47,7 @@ namespace BruhatTits /-- The `R ⧸ ϖ R`-module `L ⧸ ϖ L`. We define this in terms of the maximal ideal of `R`. -/ +@[expose] def _root_.BruhatTits.Lattice.quotient (L : Lattice R) : Type _ := L.M ⧸ (IsLocalRing.maximalIdeal R • ⊤ : Submodule R L.M) @@ -182,7 +183,8 @@ lemma _root_.Module.Basis.unipotentResidue_mk [IsFractionRing R K] (b : Basis (Fin 2) K (Fin 2 → K)) (x : R) (y : b.toSubmodule (R := R)) : (b.unipotentResidue x) (Submodule.Quotient.mk y) = - Submodule.Quotient.mk (⟨b.transvectEquiv x y, b.transvectEquiv_apply_mem x y⟩) := by + Submodule.Quotient.mk + (⟨b.transvectEquiv x y, b.transvectEquiv_apply_mem x y⟩ : (b.toLattice (R := R)).M) := by let b' : Basis (Fin 2) R (b.toSubmodule (R := R)) := b.restrict have : y ∈ Submodule.span R (Set.range b') := by simp_all @@ -266,6 +268,7 @@ def _root_.BruhatTits.Lattice.mapIntermediateSubmodule /-- Variant of `Lattice.mapIntermediateSubmodule` where `M` is a second lattice. This is the most frequent use case. -/ +@[expose] def _root_.BruhatTits.Lattice.mapIntermediate (L M : Lattice R) : Submodule (ResidueField R) L.quotient := L.mapIntermediateSubmodule M.M @@ -320,6 +323,7 @@ lemma _root_.BruhatTits.Lattice.mapIntermediate_inj_of (L M₁ M₂ : Lattice R) /-- The image of the lattice spanned by `(ϖ • b₀, b₁)` in `L ⧸ ϖ L` where `L` is spanned by `(b₀, b₁)`. -/ +@[expose] def _root_.Module.Basis.quotientStdLine₀ (b : Basis (Fin 2) K (Fin 2 → K)) {ϖ : R} (hϖ : Irreducible ϖ) : Submodule (ResidueField R) (b.toLattice (R := R)).quotient := diff --git a/LeanPool/BruhatTits/Lattice/Transvect.lean b/LeanPool/BruhatTits/Lattice/Transvect.lean index b02212b178..54a9b13db6 100644 --- a/LeanPool/BruhatTits/Lattice/Transvect.lean +++ b/LeanPool/BruhatTits/Lattice/Transvect.lean @@ -33,7 +33,7 @@ We call the basis representing this automorphism the unipotent matrix associated `n ≥ k`. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Utils.lean b/LeanPool/BruhatTits/Utils.lean index a349aad088..c168b9c910 100644 --- a/LeanPool/BruhatTits/Utils.lean +++ b/LeanPool/BruhatTits/Utils.lean @@ -20,6 +20,6 @@ public import LeanPool.BruhatTits.Utils.ValuationRings # Auxiliary lemmas -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Utils/GLSubmoduleAction.lean b/LeanPool/BruhatTits/Utils/GLSubmoduleAction.lean index cc53720a21..16c70eb2d7 100644 --- a/LeanPool/BruhatTits/Utils/GLSubmoduleAction.lean +++ b/LeanPool/BruhatTits/Utils/GLSubmoduleAction.lean @@ -11,7 +11,7 @@ public import LeanPool.BruhatTits.Utils.Matrix # LeanPool.BruhatTits.Utils.GLSubmoduleAction -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Utils/GraphAction.lean b/LeanPool/BruhatTits/Utils/GraphAction.lean index 73d4b374a5..75757dfe78 100644 --- a/LeanPool/BruhatTits/Utils/GraphAction.lean +++ b/LeanPool/BruhatTits/Utils/GraphAction.lean @@ -22,7 +22,7 @@ We show that a graph action induces an action on the edges. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Utils/LinearAlgebra.lean b/LeanPool/BruhatTits/Utils/LinearAlgebra.lean index 0ac8dfeabb..f6fb14e77c 100644 --- a/LeanPool/BruhatTits/Utils/LinearAlgebra.lean +++ b/LeanPool/BruhatTits/Utils/LinearAlgebra.lean @@ -15,7 +15,7 @@ import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas # LeanPool.BruhatTits.Utils.LinearAlgebra -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Utils/List.lean b/LeanPool/BruhatTits/Utils/List.lean index 26e69682a6..6505669fb4 100644 --- a/LeanPool/BruhatTits/Utils/List.lean +++ b/LeanPool/BruhatTits/Utils/List.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.TypeStar # LeanPool.BruhatTits.Utils.List -/ -@[expose] public section +public section theorem List.zipWith₃_map {α α' β β' γ γ' δ : Type*} (f : α' → β' → γ' → δ) (fa : α → α') (fb : β → β') (fc : γ → γ') diff --git a/LeanPool/BruhatTits/Utils/Matrix.lean b/LeanPool/BruhatTits/Utils/Matrix.lean index e146ca30b7..f12b173098 100644 --- a/LeanPool/BruhatTits/Utils/Matrix.lean +++ b/LeanPool/BruhatTits/Utils/Matrix.lean @@ -14,7 +14,7 @@ import LeanPool.BruhatTits.Utils.Subring # LeanPool.BruhatTits.Utils.Matrix -/ -@[expose] public section +public section open Module @@ -318,6 +318,7 @@ section «GeneralLinearGroup» variable [DecidableEq n] [Fintype n] /-- `GL` version of `toMatrix`. -/ +@[expose] def _root_.Matrix.TransvectionStruct.toGL (t : TransvectionStruct n R) : GL n R where val := t.toMatrix inv := t.inv.toMatrix @@ -325,7 +326,7 @@ def _root_.Matrix.TransvectionStruct.toGL (t : TransvectionStruct n R) : GL n R inv_val := t.inv_mul /-- The transpose of an invertible matrix as an element of `GL`. -/ -@[simps val] +@[expose, simps val] def _root_.Matrix.GL.transpose (g : GL n R) : GL n R where val := g.val.transpose inv := g.inv.transpose @@ -341,7 +342,7 @@ lemma _root_.Matrix.GL.val_inv_transpose (g : GL n R) : rfl /-- A diagonal matrix with unit diagonal entries as an element of `GL`. -/ -@[simps val] +@[expose, simps val] def _root_.Matrix.GL.diagonal (g : n → Rˣ) : GL n R where val := Matrix.diagonal (fun j ↦ g j) inv := Matrix.diagonal (fun j ↦ (g j).inv) @@ -360,7 +361,7 @@ lemma _root_.Matrix.GL.diagonal_det (g : n → Rˣ) : variable [DecidableEq m] [Fintype m] /-- The block diagonal sum of two general linear matrices. -/ -@[simps val] +@[expose, simps val] def _root_.Matrix.GL.diagonalBlocks (g : GL n R) (h : GL m R) : GL (n ⊕ m) R where val := Matrix.fromBlocks g 0 0 h inv := Matrix.fromBlocks g.inv 0 0 h.inv @@ -376,7 +377,7 @@ lemma _root_.Matrix.GL.val_inv_diagonalBlocks (g : GL n R) (h : GL m R) : rfl /-- Reindex the rows and columns of an element of `GL` along an equivalence. -/ -@[simps val] +@[expose, simps val] def _root_.Matrix.GL.reindex (e : n ≃ m) (g : GL n R) : GL m R where val := Matrix.reindex e e g inv := Matrix.reindex e e g.inv @@ -453,6 +454,7 @@ lemma toBasis_coe_apply (g : GL ι K) (i : ι) : g.toBasis i = (fun j ↦ g j i) /-- From an invertible matrix over `K`, we obtain an `R` submodule by taking the span of the columns. -/ +@[expose] def toSubmodule (g : GL ι K) : Submodule R (ι → K) := Submodule.span R (Set.range (fun col row ↦ g.val row col)) @@ -539,7 +541,7 @@ instance instMulActionSubmoduleSubtypeMemSubringForallLeanPool : simp /-- The canonical `R`-linear isomorphism from `M` to `g • M` induced by `g`. -/ -def equivSMulGL (g : GL ι K) (M : Submodule R (ι → K)) : +@[expose] def equivSMulGL (g : GL ι K) (M : Submodule R (ι → K)) : M ≃ₗ[R] (g • M : Submodule R (ι → K)) := ((toLin g).toLinearEquiv.restrictScalars R).submoduleMap M @@ -549,12 +551,14 @@ lemma smul_toSubmodule (g h : GL ι K) : simp [mem_smul, mem_toSubmodule] /-- The linear equivalence induced by a matrix in the coordinates of a basis. -/ +@[expose] noncomputable def toLinearEquivOfBasis {R M : Type*} [CommRing R] [AddCommMonoid M] [Module R M] (b : Basis ι R M) (g : GL ι R) : M ≃ₗ[R] M := let f : (ι → R) ≃ₗ[R] ι → R := (toLin g).toLinearEquiv b.equivFun ≪≫ₗ f ≪≫ₗ b.equivFun.symm /-- The basis obtained by acting on coordinates by a matrix in `GL`. -/ +@[expose] noncomputable def smulBasis {R M : Type*} [CommRing R] [AddCommMonoid M] [Module R M] (g : GL ι R) (b : Basis ι R M) : Basis ι R M := b.map (toLinearEquivOfBasis b g) @@ -590,7 +594,7 @@ instance (M : Submodule R (ι → K)) : simp /-- The diagonal embedding from the units of `R` to the general linear group. -/ -@[simps] +@[expose, simps] def embDiagonal (R ι : Type*) [CommRing R] [Fintype ι] [DecidableEq ι] : Rˣ →* GL ι R where toFun x := Matrix.GL.diagonal (fun _ ↦ x) diff --git a/LeanPool/BruhatTits/Utils/Misc.lean b/LeanPool/BruhatTits/Utils/Misc.lean index 456839756c..6940d24e3c 100644 --- a/LeanPool/BruhatTits/Utils/Misc.lean +++ b/LeanPool/BruhatTits/Utils/Misc.lean @@ -12,7 +12,7 @@ import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic # LeanPool.BruhatTits.Utils.Misc -/ -@[expose] public section +public section open Module @@ -90,8 +90,7 @@ theorem IsLocalRing.exists_isUnit_of_isUnit_sum {ι R : Type*} [CommRing R] [IsL exact (maximalIdeal R).sum_mem h /-- `Fin (n + 1)` is equivalent to `Fin n ⊕ Unit`. -/ -@[simps] -def Fin.succEquivUnit (n : ℕ) : Fin (n + 1) ≃ Fin n ⊕ Unit where +@[expose, simps] def Fin.succEquivUnit (n : ℕ) : Fin (n + 1) ≃ Fin n ⊕ Unit where toFun j := if h : (j : ℕ) < n then Sum.inl ⟨j, h⟩ else Sum.inr () invFun := Sum.elim (fun j ↦ j.castSucc) (fun _ ↦ Fin.last n) left_inv j := by diff --git a/LeanPool/BruhatTits/Utils/Order.lean b/LeanPool/BruhatTits/Utils/Order.lean index d44c1a6f15..02a39b3ae8 100644 --- a/LeanPool/BruhatTits/Utils/Order.lean +++ b/LeanPool/BruhatTits/Utils/Order.lean @@ -11,7 +11,7 @@ public import Mathlib.Order.Hom.Basic # LeanPool.BruhatTits.Utils.Order -/ -@[expose] public section +public section variable {α β : Type*} [PartialOrder α] [PartialOrder β] (f : α ≃o β) diff --git a/LeanPool/BruhatTits/Utils/RingHom.lean b/LeanPool/BruhatTits/Utils/RingHom.lean index cb9738fb95..17cbd73e34 100644 --- a/LeanPool/BruhatTits/Utils/RingHom.lean +++ b/LeanPool/BruhatTits/Utils/RingHom.lean @@ -11,7 +11,7 @@ public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs # LeanPool.BruhatTits.Utils.RingHom -/ -@[expose] public section +public section open Module @@ -21,7 +21,7 @@ variable {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) -- all in Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs.lean -- for some reason `Units.map f.mapMatrix` does not work. /-- Map an element of `GL` along a ring homomorphism. -/ -def GL.map {α : Type*} [DecidableEq α] [Fintype α] (g : GL α R) : GL α S where +@[expose] def GL.map {α : Type*} [DecidableEq α] [Fintype α] (g : GL α R) : GL α S where val := f.mapMatrix g inv := f.mapMatrix g.inv val_inv := by rw [← map_mul]; simp diff --git a/LeanPool/BruhatTits/Utils/Subring.lean b/LeanPool/BruhatTits/Utils/Subring.lean index 6d7f8256d3..f51fb9986d 100644 --- a/LeanPool/BruhatTits/Utils/Subring.lean +++ b/LeanPool/BruhatTits/Utils/Subring.lean @@ -13,7 +13,7 @@ import Mathlib.RingTheory.Localization.Module # LeanPool.BruhatTits.Utils.Subring -/ -@[expose] public section +public section open Module diff --git a/LeanPool/BruhatTits/Utils/ValuationRings.lean b/LeanPool/BruhatTits/Utils/ValuationRings.lean index 5f35c88354..00fd4f69ff 100644 --- a/LeanPool/BruhatTits/Utils/ValuationRings.lean +++ b/LeanPool/BruhatTits/Utils/ValuationRings.lean @@ -12,7 +12,7 @@ import LeanPool.BruhatTits.Utils.Misc # LeanPool.BruhatTits.Utils.ValuationRings -/ -@[expose] public section +public section open Module diff --git a/LeanPool/Burkholder.lean b/LeanPool/Burkholder.lean index 0f9692dc6d..2634771c6d 100644 --- a/LeanPool/Burkholder.lean +++ b/LeanPool/Burkholder.lean @@ -25,4 +25,4 @@ Tags: probability, martingales, burkholder-inequality MSC: 60G42 -/ -@[expose] public section +public section diff --git a/LeanPool/Burkholder/Majorants.lean b/LeanPool/Burkholder/Majorants.lean index 545e6fd7a9..ac8221fa90 100644 --- a/LeanPool/Burkholder/Majorants.lean +++ b/LeanPool/Burkholder/Majorants.lean @@ -22,7 +22,7 @@ Assembles the regime-by-regime constructions into the existence of a Burkholder majorant for every exponent `p > 1`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Burkholder/Majorants/Definitions.lean b/LeanPool/Burkholder/Majorants/Definitions.lean index 9379761abd..a66ce1dea5 100644 --- a/LeanPool/Burkholder/Majorants/Definitions.lean +++ b/LeanPool/Burkholder/Majorants/Definitions.lean @@ -20,28 +20,29 @@ Defines the conjugate exponent `q`, `pStar`, the Burkholder expression `v`, and the sector parameters used to build the majorant. -/ -@[expose] public section +public section noncomputable section namespace Majorants /-- The conjugate exponent, with a harmless value at `p = 1`. -/ -def q (p : ℝ) : ℝ := if p = 1 then 0 else p / (p - 1) +@[expose] def q (p : ℝ) : ℝ := if p = 1 then 0 else p / (p - 1) /-- `pStar = max p q`; in the main `p ≥ 2` regime this is just `p`. -/ -def pStar (p : ℝ) : ℝ := max p (q p) +@[expose] def pStar (p : ℝ) : ℝ := max p (q p) /-- The original Burkholder-type expression, written with `pStar`. -/ -def v (p x y : ℝ) : ℝ := +@[expose] def v (p x y : ℝ) : ℝ := Real.rpow (|((x + y) / 2)|) p - Real.rpow (|pStar p - 1|) p * Real.rpow (|((x - y) / 2)|) p /-- The slope parameter separating the two smooth sectors in the first quadrant. -/ + @[expose] def a (p : ℝ) : ℝ := 1 - 2 / (pStar p) /-- Normalization constant for the affine-in-`y` sector formula. -/ - def alpha (p : ℝ) : ℝ := p* Real.rpow (pStar p/(pStar p - 1)) (1-p) + @[expose] def alpha (p : ℝ) : ℝ := p* Real.rpow (pStar p/(pStar p - 1)) (1-p) end Majorants diff --git a/LeanPool/Burkholder/Majorants/MajorantPEq2.lean b/LeanPool/Burkholder/Majorants/MajorantPEq2.lean index 08aa6db0b1..d9f77065a2 100644 --- a/LeanPool/Burkholder/Majorants/MajorantPEq2.lean +++ b/LeanPool/Burkholder/Majorants/MajorantPEq2.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset Constructs the Burkholder majorant in the special case `p = 2`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Burkholder/Majorants/MajorantPG2.lean b/LeanPool/Burkholder/Majorants/MajorantPG2.lean index 128688ead3..648752fd17 100644 --- a/LeanPool/Burkholder/Majorants/MajorantPG2.lean +++ b/LeanPool/Burkholder/Majorants/MajorantPG2.lean @@ -17,7 +17,7 @@ Constructs and verifies the Burkholder majorant in the regime `p > 2`, including the explicit derivatives, concavity, and tangent estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Burkholder/Majorants/MajorantPL2.lean b/LeanPool/Burkholder/Majorants/MajorantPL2.lean index d635c08e93..0e5fac30f5 100644 --- a/LeanPool/Burkholder/Majorants/MajorantPL2.lean +++ b/LeanPool/Burkholder/Majorants/MajorantPL2.lean @@ -17,7 +17,7 @@ Constructs and verifies the Burkholder majorant in the regime `1 < p < 2`, including the explicit derivatives, concavity, and tangent estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Burkholder/MartingaleTransforms.lean b/LeanPool/Burkholder/MartingaleTransforms.lean index 4ccaeede65..4d0a4307c1 100644 --- a/LeanPool/Burkholder/MartingaleTransforms.lean +++ b/LeanPool/Burkholder/MartingaleTransforms.lean @@ -18,7 +18,7 @@ Defines the discrete martingale transform and proves the sharp `Lp` Burkholder inequality for martingale transforms by a predictable multiplier bounded by `1`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/BallCover.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/BallCover.lean index 1127017b6a..4c1657b73d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/BallCover.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/BallCover.lean @@ -24,7 +24,7 @@ arbitrary order-connected time interval; so the cover is indexed by one finite family and a finite union of integrability statements closes it. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/CompactLp.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/CompactLp.lean index 8c3eb8db31..1f86402a5a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/CompactLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/CompactLp.lean @@ -27,7 +27,7 @@ clauses, since it would assume what is being proved. The proofs below use nothing beyond the data clauses. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Constructor.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Constructor.lean index 804a49d92c..fb685fa5ab 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Constructor.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Constructor.lean @@ -44,7 +44,7 @@ space-time, has to transport it, and that transport is legal only once the integrability is in hand - which is exactly what these lemmas supply. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Data.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Data.lean index eb821cdc8f..8d1d5ec290 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Data.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/Data.lean @@ -29,7 +29,7 @@ stated that way can be used while the identity clauses of the class are still being established, which a lemma stated with the full class cannot. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -42,7 +42,7 @@ namespace CKN /-- The measurability and local-integrability clauses of `def:sws`: the first six conjuncts of `CKN.IsSuitableWeakSolutionIntegrable`, copied verbatim. -/ -def IsSuitableWeakSolutionData (Ω : Set Vec3) (I : Set ℝ) (q : ℝ) +@[expose] def IsSuitableWeakSolutionData (Ω : Set Vec3) (I : Set ℝ) (q : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) : Prop := IsOpen Ω ∧ IsOpen I ∧ OrdConnected I ∧ 5 / 2 < q ∧ diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DissipationIntegrand.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DissipationIntegrand.lean index 6295ae9e89..95a6f87aa0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DissipationIntegrand.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DissipationIntegrand.lean @@ -22,7 +22,7 @@ is a bounded factor. Nothing about the identities of `def:sws` is used, so the conclusion is available while those identities are still being established. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DivergenceFreeIntegrand.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DivergenceFreeIntegrand.lean index 1e57ee6646..3b4123bb02 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DivergenceFreeIntegrand.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/DivergenceFreeIntegrand.lean @@ -24,7 +24,7 @@ Nothing about the identities of `def:sws` is used, so the conclusion is available while those identities are still being established. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/EnergyIntegrand.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/EnergyIntegrand.lean index 129e55f7bf..31dea06144 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/EnergyIntegrand.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/EnergyIntegrand.lean @@ -43,7 +43,7 @@ nonnegativity of the test function that the clause also assumes is not needed for integrability and is omitted here. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MainTheorems.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MainTheorems.lean index 90dea1be56..2f8c94d0bc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MainTheorems.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MainTheorems.lean @@ -54,7 +54,7 @@ statements assume `CKN.IsSuitableWeakSolution`: exactly what `def:sws` assumes, and nothing more. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MomentumIntegrand.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MomentumIntegrand.lean index e3dd5102ca..cc9ea6c2ee 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MomentumIntegrand.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/MomentumIntegrand.lean @@ -28,7 +28,7 @@ Nothing about the identities of `def:sws` is used, so the conclusion is available while those identities are still being established. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/TestSupport.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/TestSupport.lean index 92bc2f0437..48ce7cbdde 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/TestSupport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/TestSupport.lean @@ -32,7 +32,7 @@ Boundedness is the form in which the test function enters: an integrand of function. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/VelocityTenThirds.lean b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/VelocityTenThirds.lean index 79f1fce91b..4fc1351b4b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/VelocityTenThirds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/ClassEquivalence/VelocityTenThirds.lean @@ -49,7 +49,7 @@ norms: a component is bounded by the sup norm on the way into the interpolation, and the Euclidean norm is bounded by `√3` times the sup norm on the way out. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Admissibility.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Admissibility.lean index e0f3fc2eb5..a6a3c4da62 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Admissibility.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Admissibility.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.Operations Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set Filter open scoped ENNReal NNReal Topology @@ -28,6 +28,7 @@ noncomputable section namespace CKN /-- The globally defined product used for the backward heat test. -/ +@[expose] def backwardHeatCutoff (η : Vec3 × ℝ → ℝ) (x₀ : Vec3) (t₀ r : ℝ) (z : Vec3 × ℝ) : ℝ := η z * if z.2 - t₀ < r ^ 2 then diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Caccioppoli.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Caccioppoli.lean index fd40c5f0e5..505b950ec7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Caccioppoli.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Caccioppoli.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.InteriorEstim Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology @@ -30,7 +30,7 @@ namespace CKN /-- Squared common coefficient collecting the velocity and pressure terms in the Caccioppoli estimate. -/ -def caccioppoliC₂₅BaseSquared : ℝ := +@[expose] def caccioppoliC₂₅BaseSquared : ℝ := max ((32 + 3 * cutoffSecondDerivativeConstant) * 8000000 + 6 * cutoffGradientConstant * 5000000) (max (poincareSobolevL1VectorConstant * @@ -42,10 +42,10 @@ def caccioppoliC₂₅BaseSquared : ℝ := def caccioppoliC₂₅Base : ℝ := Real.sqrt caccioppoliC₂₅BaseSquared /-- Velocity and pressure coefficient after normalizing the Caccioppoli energy bound. -/ -def caccioppoliC₂₅ : ℝ := Real.sqrt (6000 * caccioppoliC₂₅BaseSquared) +@[expose] def caccioppoliC₂₅ : ℝ := Real.sqrt (6000 * caccioppoliC₂₅BaseSquared) /-- Force coefficient in the Caccioppoli estimate for local integrability exponent `q`. -/ -def caccioppoliC₂₆ (q : ℝ) : ℝ := +@[expose] def caccioppoliC₂₆ (q : ℝ) : ℝ := Real.sqrt (6000 * (2000 * (4 * Real.pi / 3) ^ (1 / (q / (q - 1)) - 1 / 3 : ℝ))) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliAssembly.lean index ba339aba4e..bdfd6d698c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliAssembly.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CaccioppoliMeanS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCentered.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCentered.lean index dfbd941221..514f4f426a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCentered.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCentered.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CaccioppoliCente Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCenteredRhs.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCenteredRhs.lean index ce3344a55d..b6f171387f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCenteredRhs.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliCenteredRhs.lean @@ -9,7 +9,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CaccioppoliAssem /-! The scalar normalization used by the centered Caccioppoli estimate. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergy.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergy.lean index 0f846013b2..493147837c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergy.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergy.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CaccioppoliAssem Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLower.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLower.lean index 22aa5a8681..96d65caa30 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLower.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLower.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CaccioppoliEnerg Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLowerIntegrability.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLowerIntegrability.lean index 039a4dc724..33e0878013 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLowerIntegrability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyLowerIntegrability.lean @@ -10,7 +10,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CaccioppoliEnerg /-! Integrability estimates used by the local energy lower bound. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTerms.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTerms.lean index a2015dc402..68a593d124 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTerms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTerms.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.IntegralEqImproper Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTools.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTools.lean index 6b0e34b310..05fe3d551a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTools.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliEnergyTools.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.IntegralEqImproper Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliMeanSubtraction.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliMeanSubtraction.lean index bc378eaeee..9722bea573 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliMeanSubtraction.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliMeanSubtraction.lean @@ -30,7 +30,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.VectorInequalities Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliRHS.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliRHS.lean index 382d9e8c3a..ae33da3045 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliRHS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CaccioppoliRHS.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ScalingInvarianceTests Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Consumers.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Consumers.lean index 1ba8512e7d..752e24e902 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Consumers.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Consumers.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Iteration.Arithmetic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Conversions.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Conversions.lean index 124155a2c8..58f55b6468 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Conversions.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Conversions.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Finiteness Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Cutoff.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Cutoff.lean index 6a7bb3c064..3db21195e4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Cutoff.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Cutoff.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.CutoffBase Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -404,6 +404,7 @@ theorem caccioppoli_asymmetricTimeCutoff_abs_deriv_le_on_left /-- Product cutoff used to test the local energy inequality with a regularized backward heat kernel. -/ +@[expose] def caccioppoliHeatCutoff (x₀ : Vec3) (t₀ ρ ε : ℝ) (hρ : 0 < ρ) (_hε : 0 < ε) (z : Vec3 × ℝ) : ℝ := mollifiedBallCutoff x₀ hρ z.1 * diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CutoffBase.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CutoffBase.lean index 73ce8206f8..e661a51ecd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CutoffBase.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/CutoffBase.lean @@ -12,7 +12,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Energy.Calculus /-! The spatial-temporal cutoff and its support estimates. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -37,6 +37,7 @@ given a separate outer radius so that its support can be placed inside the open time interval. -/ /-- Spatial and temporal cutoff for the centered Caccioppoli estimate. -/ +@[expose] def caccioppoliCutoff (x₀ : Vec3) (t₀ ρ R : ℝ) (hρ : 0 < ρ) (_hR : ρ / 2 < R) (z : Vec3 × ℝ) : ℝ := mollifiedBallCutoff x₀ hρ z.1 * timeCutoff t₀ (ρ / 2) R z.2 diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Derivatives.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Derivatives.lean index 98ce7b6c55..5c5665e282 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Derivatives.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Derivatives.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.Calculus.FDeriv.Pi Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Finiteness.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Finiteness.lean index f769f843b6..93a9069281 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Finiteness.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Finiteness.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.FinitenessCompon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter CKN.Foundation.Parabolic CKN.Foundation.Parabolic.Integration open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/FinitenessComponentBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/FinitenessComponentBounds.lean index dbb1703ad8..b02c1e7801 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/FinitenessComponentBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/FinitenessComponentBounds.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.SliceIntegrability /-! Componentwise norm estimates used by Caccioppoli finiteness arguments. -/ -@[expose] public section +public section open MeasureTheory Set Filter CKN.Foundation.Parabolic CKN.Foundation.Parabolic.Integration open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaAssembly.lean index 84b22964ee..bfd41e2fd1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaAssembly.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.RawI4 Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaTerms.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaTerms.lean index 6482c77795..2811b63692 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaTerms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/GammaTerms.lean @@ -34,7 +34,7 @@ The remaining two terms `I₃`, `I₄` keep their proved bounds, so the conclusi of `eq:caccioppoli-gamma` follows by the normalisation lemmas recorded here. -/ -@[expose] public section +public section open MeasureTheory Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1.lean index 643c459dbf..b7922630e8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.I1ProductRules Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1ProductRules.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1ProductRules.lean index da32f8d01a..7e1033beb4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1ProductRules.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I1ProductRules.lean @@ -12,7 +12,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. /-! Product rules for the spatial part of the first Caccioppoli term. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I2.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I2.lean index db9d348f83..a12d65035b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I2.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I2.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Slices Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I3.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I3.lean index 538e8d997b..37ef686ca7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I3.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I3.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SliceNormBounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I4.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I4.lean index 489b330778..e27a517e54 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I4.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/I4.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/LocalBox.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/LocalBox.lean index 88f9098ced..6566bf2489 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/LocalBox.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/LocalBox.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Energy.Integrability Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI1.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI1.lean index ccc91612d6..bde527e671 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI1.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SliceNormBounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter Metric open scoped ENNReal NNReal Topology @@ -46,6 +46,7 @@ theorem caccioppoli_timePartial_contDiff simpa only [F, timePartial, Function.uncurry] using hderiv /-- Raw energy contribution from the time derivative and Laplacian of the heat cutoff. -/ +@[expose] def caccioppoliI1HeatCutoffRaw {u : ParabolicPoint → Vec3} {x₀ : Vec3} {t₀ ρ ε r : ℝ} (hρ : 0 < ρ) (hε : 0 < ε) : diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI2Bound.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI2Bound.lean index 0cd8235bb7..294bf70227 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI2Bound.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI2Bound.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SliceNormBounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology @@ -27,6 +27,7 @@ noncomputable section namespace CKN /-- Raw transport contribution after subtracting the chosen scalar energy center. -/ +@[expose] def caccioppoliI2HeatCutoffRaw {u : ParabolicPoint → Vec3} {c : ParabolicPoint → ℝ} {x₀ : Vec3} {t₀ ρ ε r : ℝ} (hρ : 0 < ρ) (hε : 0 < ε) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3.lean index 61bff9c7b2..4ec5e73cdf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Covering Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3Bound.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3Bound.lean index 7837ad746f..f95160f3ae 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3Bound.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI3Bound.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SliceNormBounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology @@ -28,6 +28,7 @@ noncomputable section namespace CKN /-- Raw pressure contribution paired with velocity and the spatial gradient of the heat cutoff. -/ +@[expose] def caccioppoliI3HeatCutoffRaw {p : ParabolicPoint → ℝ} {v : ParabolicPoint → Vec3} {x₀ : Vec3} {t₀ ρ ε r : ℝ} (hρ : 0 < ρ) (hε : 0 < ε) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI4.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI4.lean index c7bc01a8d0..1bdb71d835 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI4.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/RawI4.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.CylinderCentered Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology @@ -28,6 +28,7 @@ noncomputable section namespace CKN /-- Raw forcing contribution to the local energy estimate. -/ +@[expose] def caccioppoliI4HeatCutoffRaw {u f : ParabolicPoint → Vec3} {x₀ : Vec3} {t₀ ρ ε r : ℝ} (hρ : 0 < ρ) (hε : 0 < ε) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Terms.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Terms.lean index 9b845a6ee6..6dcede8285 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Terms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Caccioppoli/Terms.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Caccioppoli.Derivatives Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsAEMeasurable.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsAEMeasurable.lean index 31532aa054..a197f16eb9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsAEMeasurable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsAEMeasurable.lean @@ -15,7 +15,7 @@ potential at every evaluation point. Thus the scalar Adams estimate does not require pointwise measurability of the original source. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsConstants.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsConstants.lean index 81b1abed8d..e5b11ab2d3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsConstants.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/AdamsConstants.lean @@ -13,7 +13,7 @@ The geometric series and maximal-function constants are finite under the same strict exponent conditions as the potential estimate. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BallBootstrap.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BallBootstrap.lean index 136b82901f..510f940521 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BallBootstrap.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BallBootstrap.lean @@ -15,7 +15,7 @@ shifted forward. The quantitative potential estimate is independent of this enlargement, so its numerical coefficient is unchanged. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Bootstrap.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Bootstrap.lean index 8ec4e79ddb..9400fcb60e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Bootstrap.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Bootstrap.lean @@ -17,7 +17,7 @@ of the potential and finiteness of the explicit Adams constants are derived, rather than supplied as extra inputs. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapBounds.lean index 47101ed6f2..f7909f1651 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapBounds.lean @@ -16,7 +16,7 @@ are retained. This gives a bound determined by the source bounds, not by a new existential constant chosen after the solution. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapDerivativeSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapDerivativeSource.lean index 44b0df93f9..80e5e27e68 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapDerivativeSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapDerivativeSource.lean @@ -15,7 +15,7 @@ without lowering integrability. Unit-cylinder support then lowers only the outer Morrey exponent, with numerical factor one. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapLinearSources.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapLinearSources.lean index 757a1d9d95..0319c78846 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapLinearSources.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapLinearSources.lean @@ -17,7 +17,7 @@ The initial velocity exponent supplies the linear velocity terms, while a cutoff of absolute value at most one preserves pressure-gradient bounds. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPotential.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPotential.lean index 0824a78b88..9877090e98 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPotential.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPotential.lean @@ -16,7 +16,7 @@ every evaluation point. All conversions to real numbers are made only after this finiteness has been established. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPressureConsumer.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPressureConsumer.lean index 6db09340a8..4a1b685fd5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPressureConsumer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapPressureConsumer.lean @@ -27,7 +27,7 @@ bound at times after `0` is used; the pressure values there enter only the local representation of the localized velocity. -/ -@[expose] public section +public section open Set MeasureTheory Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapSourceBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapSourceBounds.lean index 3388f94dff..b1fd98bdf5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapSourceBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/BootstrapSourceBounds.lean @@ -21,7 +21,7 @@ norm, and the original force smallness. The formula includes the pressure gradient in the order-two slot. No potential or Hölder estimate is assumed. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CZConsumption.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CZConsumption.lean index ff5bba1413..50e38dfca1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CZConsumption.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CZConsumption.lean @@ -17,7 +17,7 @@ supplies the separate distributional pairing and does not identify a rough classical representative. -/ -@[expose] public section +public section open MeasureTheory Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierLocalAE.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierLocalAE.lean index 2c600966fd..df1a403405 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierLocalAE.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierLocalAE.lean @@ -14,7 +14,7 @@ of a representative to the indicated original function. The representative need not vanish outside the carrier. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierRestriction.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierRestriction.lean index 850ea784c2..741435e4f6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierRestriction.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CarrierRestriction.lean @@ -15,7 +15,7 @@ Smaller carriers retain the same numerical Morrey bound. Joint measurability on a spatial-time strip gives globally measurable past-cylinder indications. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalBootstrap.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalBootstrap.lean index 66d9b3195a..95cead1cbb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalBootstrap.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalBootstrap.lean @@ -16,7 +16,7 @@ agreement with velocity is needed only on the target cylinder. Consequently no bound or representation for the truncated velocity at future times is used. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalDerivativeSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalDerivativeSource.lean index 36b478f178..f4e8871c48 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalDerivativeSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalDerivativeSource.lean @@ -18,7 +18,7 @@ only local suitable-solution data. Its support and Morrey bound follow from the cutoff support, its derivative bound, and initial velocity norms. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -31,6 +31,7 @@ noncomputable section namespace CKN.Core.Endgame /-- A scalar component of the differentiated cutoff source in the past. -/ +@[expose] def causalDerivativeComponent (φ : Vec3 × ℝ → ℝ) (u : ParabolicPoint → Vec3) (j i : Fin 3) : ParabolicPoint → ℝ := {z : ParabolicPoint | z.2 ≤ 0}.indicator diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalForceSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalForceSource.lean index 95d7401b54..6fb439fd5c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalForceSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalForceSource.lean @@ -17,7 +17,7 @@ extended source, because the cutoff vanishes outside that cylinder in the past. Its numerical Morrey bound follows from the original small-data sum. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -29,6 +29,7 @@ noncomputable section namespace CKN.Core.Endgame /-- A scalar component of the cutoff force, extended by zero to future times. -/ +@[expose] def causalForceComponent (φ : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) (i : Fin 3) : ParabolicPoint → ℝ := {z : ParabolicPoint | z.2 ≤ 0}.indicator (fun z => φ z * f z i) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalGradientMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalGradientMorrey.lean index d3658a96ce..08c9f9a1c8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalGradientMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalGradientMorrey.lean @@ -20,7 +20,7 @@ norm, and the original force smallness. The formula includes the pressure gradient in the order-two slot. No potential or Hölder estimate is assumed. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalHalfCylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalHalfCylinder.lean index 9428970a76..e780e6f797 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalHalfCylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalHalfCylinder.lean @@ -15,7 +15,7 @@ Only its sources at times at most zero contribute on the target cylinder. Consequently the numerical bounds below concern the truncated sources only. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalLinearSources.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalLinearSources.lean index a9910dd1f3..80f9639c84 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalLinearSources.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalLinearSources.lean @@ -17,7 +17,7 @@ The improved velocity exponent supplies the linear velocity terms, while a cutoff of absolute value at most one preserves pressure-gradient bounds. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -29,6 +29,7 @@ noncomputable section namespace CKN.Core.Endgame /-- A scalar product restricted to nonpositive times. -/ +@[expose] def pastMultiplierSource (a f : ParabolicPoint → ℝ) : ParabolicPoint → ℝ := {z : ParabolicPoint | z.2 ≤ 0}.indicator (fun z => a z * f z) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalPressureExtension.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalPressureExtension.lean index b5020ea6d2..afcdc29967 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalPressureExtension.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalPressureExtension.lean @@ -15,7 +15,7 @@ when its cutoff is supported in the smaller cylinder. No global weak-gradient characterization is asserted for the extended field. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalSources.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalSources.lean index 63d7559792..dbbbf930c3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalSources.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CausalSources.lean @@ -16,7 +16,7 @@ the pressure gradient in the order-two slot. This is an identity of formulas; it does not assert the still-needed localized representation theorem. -/ -@[expose] public section +public section open Set Filter open scoped Topology @@ -27,6 +27,7 @@ noncomputable section namespace CKN.Core.Endgame /-- The actual past-time order-two source with the pressure gradient. -/ +@[expose] def causalGradientSourceComponent (φ : ParabolicPoint → ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (f Dp : ParabolicPoint → Vec3) (i : Fin 3) : ParabolicPoint → ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Causality.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Causality.lean index d4dc372f41..9ea4c673e6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Causality.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Causality.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Topology Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic CKN.Foundation.Heat CKN.Core.HeatPotential diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CompactBall.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CompactBall.lean index 1ecdc0fa1d..05dc24c614 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CompactBall.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CompactBall.lean @@ -15,7 +15,7 @@ inclusion uses the triangle inequality and applies without any positivity assumption on its radii. -/ -@[expose] public section +public section open Set Metric open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ConcreteRieszConsumption.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ConcreteRieszConsumption.lean index 4af0b1a6c0..f0812e956c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ConcreteRieszConsumption.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ConcreteRieszConsumption.lean @@ -17,7 +17,7 @@ the concrete restricted weak endpoint is instantiated. The first-potential pairing supplies the weak-gradient identity without an analytic input. -/ -@[expose] public section +public section open MeasureTheory Filter open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffDerivatives.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffDerivatives.lean index 8e675f9fa1..3310e8f5ba 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffDerivatives.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffDerivatives.lean @@ -20,7 +20,7 @@ support assumptions on the second function. In particular the negative-time bounds of a domain-adapted cutoff retain the fixed function's constants. -/ -@[expose] public section +public section open Set Filter open scoped Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffMorrey.lean index bc732c4e3b..754df04baf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/CutoffMorrey.lean @@ -17,7 +17,7 @@ then supplies the differentiated heat-source norm, including after truncation to nonpositive times. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionNormTransport.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionNormTransport.lean index d9b8993e72..416c3060e3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionNormTransport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionNormTransport.lean @@ -14,7 +14,7 @@ Consequently a real norm estimate between the representatives gives the same numerical estimate on the original functions, for any exponent. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionPairing.lean index 11b5362515..ba8ea052e0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ExtensionPairing.lean @@ -16,7 +16,7 @@ to every L^(3/2) input. Compact support is required only of the test function, not of a chosen representative of an Lp class. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalCutoffConsumer.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalCutoffConsumer.lean index c34587fbd1..e09cae450f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalCutoffConsumer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalCutoffConsumer.lean @@ -19,7 +19,7 @@ literal localized source unchanged. The remaining input is exactly the global heat representation of the localized velocity. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalPressureConsumer.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalPressureConsumer.lean index c0d14f25e1..c44dfa1528 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalPressureConsumer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/FinalPressureConsumer.lean @@ -22,7 +22,7 @@ the pressure gradient, not a uniform bound at later times, is used to justify that representation. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ForceSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ForceSource.lean index 3300b8c7f3..545c4766e5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ForceSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ForceSource.lean @@ -16,7 +16,7 @@ estimate and unit-support exponent reduction preserve a fully numerical bound, with no conversion of infinite integrals to real numbers. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -28,6 +28,7 @@ noncomputable section namespace CKN.Core.Endgame /-- The force-source bound determined by the unit-cylinder data size. -/ +@[expose] def forceSourceMorreyBound (q ε₀ : ℝ) : ℝ≥0∞ := volume (parabolicCylinder (0 : Vec3) 0 1) ^ (5 / 6 - 1 / q : ℝ) * ENNReal.ofReal ε₀ ^ (1 / q : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdapters.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdapters.lean index cac9d49042..49584482d8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdapters.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdapters.lean @@ -36,7 +36,7 @@ against origin carrier, and the two orders in which the solution hypotheses are presented. No estimate is strengthened or weakened here. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdaptersCell.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdaptersCell.lean index 26bddc0db3..c089aac5e1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdaptersCell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/GAAdaptersCell.lean @@ -33,7 +33,7 @@ is itself a space-time product set, the domain hypothesis of `thm:A` does not imply the corresponding inclusion for any symmetric ball about the origin. -/ -@[expose] public section +public section open MeasureTheory Set Metric open scoped ENNReal Topology @@ -209,10 +209,13 @@ theorem exists_spaceTimeSet_without_symmetric_ball {ρ : ℝ} (hρ : 0 < ρ) : ∃ (Ω : Set Vec3) (I : Set ℝ), closure (parabolicCylinder (0 : Vec3) 0 1) ⊆ spaceTimeSet Ω I ∧ ¬ Metric.ball oneSidedPressureGradientOrigin ρ ⊆ spaceTimeSet Ω I := by - refine ⟨_, _, - (closure_parabolicCylinder_eq_spaceTimeSet (0 : Vec3) 0 (r := 1) one_pos).subset, ?_⟩ - rw [← closure_parabolicCylinder_eq_spaceTimeSet (0 : Vec3) 0 (r := 1) one_pos] + let Ω : Set Vec3 := {y | vec3EuclideanNorm (y - 0) ≤ 1} + let I : Set ℝ := Icc (0 - (1 : ℝ) ^ 2) 0 + have hEq : closure (parabolicCylinder (0 : Vec3) 0 1) = spaceTimeSet Ω I := + closure_parabolicCylinder_eq_spaceTimeSet (0 : Vec3) 0 (r := 1) one_pos + refine ⟨Ω, I, hEq.subset, ?_⟩ + intro hsub exact metricBall_not_subset_closure_parabolicCylinder - oneSidedPressureGradientOrigin hρ one_pos + oneSidedPressureGradientOrigin hρ one_pos (hEq.symm ▸ hsub) end CKN.Core.Endgame diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HeatRepresentative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HeatRepresentative.lean index 96de4c7474..96c74d5d05 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HeatRepresentative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HeatRepresentative.lean @@ -15,7 +15,7 @@ bound and the global Hölder constant remain explicit functions of the source norms and the local averages of the potential. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory Set @@ -26,6 +26,7 @@ noncomputable section namespace CKN.Core.Endgame /-- The explicit scalar Hölder coefficient in the heat-potential estimate. -/ +@[expose] def heatHolderCoefficient (F : ParabolicPoint → ℝ) (G : Fin 3 → ParabolicPoint → ℝ) (γ θ₀ θ₁ P : ℝ) : ℝ := let V : ℝ := (volume (parabolicCylinder 0 0 1)).toReal @@ -46,6 +47,7 @@ def heatHolderCoefficient (F : ParabolicPoint → ℝ) (Cnear + C * (1 - (2 : ℝ) ^ (γ - 1))⁻¹) /-- The sum of the absolute scalar Hölder coefficients. -/ +@[expose] def vectorHeatHolderCoefficient (F : ParabolicPoint → Vec3) (G : Fin 3 → ParabolicPoint → Vec3) (γ θ₀ θ₁ P : ℝ) : ℝ := ∑ i, |heatHolderCoefficient (fun x => F x i) (fun j x => G j x i) γ θ₀ θ₁ P| diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HolderGluing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HolderGluing.lean index 9f0358eec8..d96588764c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HolderGluing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/HolderGluing.lean @@ -19,7 +19,7 @@ pointwise. A common local Hölder bound then gives a quantitative bound on a region whenever sufficiently close pairs lie in a common member of the cover. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/InitialUniform.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/InitialUniform.lean index 62f8a099d7..5393d1b577 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/InitialUniform.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/InitialUniform.lean @@ -14,7 +14,7 @@ domain and the solution. The proof consumes the actual start and iteration route on the wider cylinder needed for the first localization. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/LocalBoxRestriction.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/LocalBoxRestriction.lean index 1ce5edb227..5b8d2e34b5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/LocalBoxRestriction.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/LocalBoxRestriction.lean @@ -14,7 +14,7 @@ on which a pressure gradient is characterized, without changing its time interval or losing compact containment in the original domain. -/ -@[expose] public section +public section open Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Localization.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Localization.lean index af3cab0acf..3e1c797313 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Localization.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Localization.lean @@ -19,7 +19,7 @@ A ball compactly inside the space-time domain admits a smooth cutoff and a compactly interior product box containing its support. -/ -@[expose] public section +public section open Set Metric open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/MorreyScaling.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/MorreyScaling.lean index ecb8bf7013..ca939dbe99 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/MorreyScaling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/MorreyScaling.lean @@ -14,7 +14,7 @@ The absolute scalar factor is retained in the bound, including when the scalar vanishes or the unscaled seminorm is infinite. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Neighborhood.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Neighborhood.lean index 9dbf2dfa7c..0eec51898a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Neighborhood.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/Neighborhood.lean @@ -14,7 +14,7 @@ The smallness premise stays in the extended nonnegative reals. The only additional estimate is the pair of one-step inequalities in `lem:theta-decay`. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/NestedCutoffs.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/NestedCutoffs.lean index fbd0e4488a..5eea7cc446 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/NestedCutoffs.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/NestedCutoffs.lean @@ -15,7 +15,7 @@ as a germ at every nonpositive time, so all past derivative bounds remain independent of the domain and of its future-time collar. -/ -@[expose] public section +public section open Set Metric Filter open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCover.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCover.lean index b114026811..399ebce047 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCover.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCover.lean @@ -16,7 +16,7 @@ finite backward-cylinder cover after truncating the forward time shifts. All centers and the number of cylinders are chosen before the integrand. -/ -@[expose] public section +public section open Set Metric MeasureTheory open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCutoff.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCutoff.lean index f339979692..79726c24fc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCutoff.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedCutoff.lean @@ -20,7 +20,7 @@ zero, the resulting function agrees locally with the fixed cutoff. Thus its negative-time derivatives do not acquire domain-dependent constants. -/ -@[expose] public section +public section open Set Metric Filter open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedEnergy.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedEnergy.lean index 0447dc6f09..6c1e489cd5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedEnergy.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedEnergy.lean @@ -16,7 +16,7 @@ top time. Their constants depend only on the given decay constant. They are the scalar integral inputs for extension by zero across the top time face. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGeometry.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGeometry.lean index 147adbe211..2a9c9785af 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGeometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGeometry.lean @@ -21,7 +21,7 @@ centres, and `𝒞_ϱ(w) ∩ {t ≤ 0} ⊆ 𝒞_{2ϱ}(w'')`. The covering itself upper bound on the radius. -/ -@[expose] public section +public section open Set open CKN.Foundation.Parabolic @@ -33,6 +33,7 @@ namespace CKN.Core.Endgame /-- Shift the time coordinate forward by the squared radius, stopping at the prescribed upper time, and use the selected point as spatial center. -/ +@[expose] def truncatedCylinderCenter (w w' : ParabolicPoint) (ρ T : ℝ) : ParabolicPoint := (w'.1, min (w.2 + ρ ^ 2) T) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGradient.lean index eb66f6e90f..1af9267cc7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedGradient.lean @@ -16,7 +16,7 @@ the small-cylinder decay constant. The cover is selected before the solution, so no solution-dependent large-scale integral enters the bound. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -28,7 +28,7 @@ noncomputable section namespace CKN.Core.Endgame /-- Gradient Morrey constant associated with a finite geometric cover. -/ -def oneSidedGradientMorreyBound (M r₀ : ℝ) (N : ℕ) : ℝ≥0∞ := +@[expose] def oneSidedGradientMorreyBound (M r₀ : ℝ) (N : ℕ) : ℝ≥0∞ := oneSidedMorreyBound 2 (25 / 8) r₀ (ENNReal.ofReal (M ^ 2)) ((N : ℝ≥0∞) * (ENNReal.ofReal (M ^ 2) * ENNReal.ofReal ((r₀ / 2) ^ (9 / 5 : ℝ)))) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMeasurability.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMeasurability.lean index f205c66fc3..d1fe6fe62c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMeasurability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMeasurability.lean @@ -17,7 +17,7 @@ coefficient supported on a measurable set likewise localizes an a.e. measurable scalar field without requiring a global representative. -/ -@[expose] public section +public section open Set MeasureTheory open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMorrey.lean index 3da924345b..c1b068f1af 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedMorrey.lean @@ -26,7 +26,7 @@ small-cell growth coefficient and `B` the total integral; the two enter through the two regimes just described. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal @@ -82,6 +82,7 @@ theorem cylinder_morrey_cell_le /-- The explicit small-scale plus large-scale constant for the one-sided Morrey transfer. -/ +@[expose] def oneSidedMorreyBound (P τ ρ₀ : ℝ) (A B : ℝ≥0∞) : ℝ≥0∞ := (A * ENNReal.ofReal ((2 : ℝ) ^ (5 * (1 - P / τ)))) ^ (1 / P : ℝ) + ENNReal.ofReal ((ρ₀ / 2) ^ (-(5 * (1 - P / τ) / P))) * B ^ (1 / P : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedSources.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedSources.lean index 6e61f82228..67b28d77a2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedSources.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/OneSidedSources.lean @@ -17,7 +17,7 @@ independent of the solution. Both estimates concern extension by zero from the intermediate backward cylinder of radius `5/8`. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -59,12 +59,12 @@ theorem closure_small_cylinder_subset_unit linarith only [ht, hzlow] /-- The explicit uniform velocity Morrey constant. -/ -def oneSidedVelocityMorreyBound (M r₀ ε₀ : ℝ) : ℝ≥0∞ := +@[expose] def oneSidedVelocityMorreyBound (M r₀ ε₀ : ℝ) : ℝ≥0∞ := oneSidedMorreyBound 3 (25 / 3) r₀ (ENNReal.ofReal ((2 * gagliardoConstant * M) ^ 3)) (ENNReal.ofReal ε₀) /-- The explicit uniform pressure Morrey constant. -/ -def oneSidedPressureMorreyBound (M r₀ ε₀ : ℝ) : ℝ≥0∞ := +@[expose] def oneSidedPressureMorreyBound (M r₀ ε₀ : ℝ) : ℝ≥0∞ := oneSidedMorreyBound (3 / 2) (25 / 8) r₀ (ENNReal.ofReal (M ^ (3 / 2 : ℝ))) (ENNReal.ofReal ε₀) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialFiniteness.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialFiniteness.lean index fb25cb67ee..bbc16e955f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialFiniteness.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialFiniteness.lean @@ -15,7 +15,7 @@ give finiteness of the extended-real potential almost everywhere, before any use of its real-valued conversion. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialMeasurability.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialMeasurability.lean index 681c82de22..c3e426ac0f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialMeasurability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PotentialMeasurability.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.PotentialFiniteness Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open CKN.Foundation.Parabolic CKN.Foundation.Parabolic.Morrey diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PowerNormTransport.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PowerNormTransport.lean index 4805efec04..e7b3589bf8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PowerNormTransport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PowerNormTransport.lean @@ -13,7 +13,7 @@ The scalar conversion requires measurability of only the two actual functions. A finite input seminorm then gives a finite output seminorm. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PressureCZConsumption.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PressureCZConsumption.lean index 6f5d888cb6..eba63ecbf1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PressureCZConsumption.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/PressureCZConsumption.lean @@ -17,7 +17,7 @@ real pressure norm bound. Compact support is not needed for this consumption step once the component estimates are supplied. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ProducerRegularity.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ProducerRegularity.lean index d29ae681e4..42062650c6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ProducerRegularity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/ProducerRegularity.lean @@ -22,7 +22,7 @@ The velocity improvement and pressure-gradient construction are used on nested balls before localizing the equation and applying the heat estimate. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RawCZBridge.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RawCZBridge.lean index 109f6af7cd..3db43e2f7b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RawCZBridge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RawCZBridge.lean @@ -14,7 +14,7 @@ carrier. Additivity and sublinearity are asserted only almost everywhere; no algebraic property of the definition outside L² is used. -/ -@[expose] public section +public section open MeasureTheory Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RepresentativeBound.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RepresentativeBound.lean index 8c9e1f23ef..173d79b4a3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RepresentativeBound.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RepresentativeBound.lean @@ -16,7 +16,7 @@ oscillation against the original velocity. No average of the heat potential outside the region of almost-everywhere agreement is required. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory Set diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedCZInterpolation.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedCZInterpolation.lean index b4654ddbdd..e1af9d31ad 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedCZInterpolation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedCZInterpolation.lean @@ -17,7 +17,7 @@ the strong endpoint. Only its restricted weak estimate remains an analytic input to the intermediate-exponent estimate. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedInterpolationAE.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedInterpolationAE.lean index c5999abba5..f891f91d06 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedInterpolationAE.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RestrictedInterpolationAE.lean @@ -16,7 +16,7 @@ the truncations, layer-cake argument, and numerical constant are unchanged from `Foundation.Euclidean.InterpolationRestricted`. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RieszWeakGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RieszWeakGradient.lean index 8964b1fc0e..51fc3a717d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RieszWeakGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/RieszWeakGradient.lean @@ -18,7 +18,7 @@ bound. Its positive pairing with the first potential selects the negatively signed weak gradient, without any classical representative identification. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceComponents.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceComponents.lean index 0f14414f83..85b0237f8f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceComponents.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceComponents.lean @@ -14,7 +14,7 @@ values. The scalar triangle inequality transfers this comparison to the Morrey norm without changing either exponent. -/ -@[expose] public section +public section open MeasureTheory Set open scoped BigOperators ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceExponents.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceExponents.lean index 4cc6b754f7..69cebb62b5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceExponents.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/SourceExponents.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallDisplays Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartCaccioppoli.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartCaccioppoli.lean index 65265f73d8..e30945fd11 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartCaccioppoli.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartCaccioppoli.lean @@ -14,7 +14,7 @@ constant is the same explicit q-dependent constant as in Caccioppoli. Neither constant depends on the domain or the solution. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic @@ -23,7 +23,7 @@ noncomputable section namespace CKN.Core.Endgame /-- A common constant for the three velocity/pressure terms of the gamma estimate. -/ -def startGammaConstant : ℝ := +@[expose] def startGammaConstant : ℝ := Real.sqrt (max (6000 * ((Real.pi * 4 / 3) ^ (1 / 3 : ℝ) * ((32 + 3 * cutoffSecondDerivativeConstant) * 8000000 + diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartSmallness.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartSmallness.lean index 803b0d24d9..b52ea20205 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartSmallness.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/StartSmallness.lean @@ -15,7 +15,7 @@ size. Its admissible threshold depends only on the numerical constants, before any solution or domain is chosen. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -27,6 +27,7 @@ namespace CKN /-- The numerical upper bound for the initial theta quantity in `lem:thmA-start`. -/ +@[expose] def theoremAStartBound (q κ C₂₅ C₂₆ C₃₂ ε₀ : ℝ) : ℝ := C₂₅ * (κ * (16 * ε₀) ^ (1 / 3 : ℝ) + κ ^ (-1 : ℝ) * (16 * ε₀) ^ (1 / 2 : ℝ) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TensorExtensionPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TensorExtensionPairing.lean index 9cef95a031..afe337800c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TensorExtensionPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TensorExtensionPairing.lean @@ -14,7 +14,7 @@ integrability justifies the finite-sum interchanges without compact support of the tensor inputs or any condition on chosen Lp representatives. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersCZ.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersCZ.lean index 3ef4cb7775..bb067dc4f6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersCZ.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersCZ.lean @@ -23,7 +23,7 @@ certificate available for every suitable weak solution, it produces the solution-uniform `ext:CZ` estimate with the exact binder consumed downstream. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersLin34.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersLin34.lean index 0243e5e8e4..814bbb76a5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersLin34.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAAdaptersLin34.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34CentredResidual Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremABudgetBridge.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremABudgetBridge.lean index 81438f7e4b..2d58743bba 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremABudgetBridge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremABudgetBridge.lean @@ -28,7 +28,7 @@ A uniform bound on the covering sums is a genuine quantitative input; finiteness of the local growth coefficients alone does not supply it. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped BigOperators ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACarrierTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACarrierTime.lean index cfa5e35bae..06f7d8b04b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACarrierTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACarrierTime.lean @@ -16,7 +16,7 @@ obligations on compactly interior source balls. A finite spatial estimate then transfers them to the entire carrier in `prop:bootstrap`. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators @@ -27,7 +27,7 @@ noncomputable section namespace CKN.Core.Endgame /-- The explicit slice majorant in coordinates translated to a source centre. -/ -def theoremATranslatedSliceMajorant +@[expose] def theoremATranslatedSliceMajorant (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) (x : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) : ℝ≥0∞ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACloser.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACloser.lean index f859813f07..87261995a8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACloser.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremACloser.lean @@ -71,7 +71,7 @@ The numerical majorant is `oneSidedPressureGradientKPAffine`, and all numerical constants are fixed before the solution fields. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstances.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstances.lean index 6a74c44c43..d33c781e52 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstances.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstances.lean @@ -15,7 +15,7 @@ Morrey exponent and radii. The actual-integral slots are required only at those triples, above one absolute Calderón–Zygmund threshold. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstancesQ.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstancesQ.lean index dcee91d823..765a14e287 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstancesQ.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersInstancesQ.lean @@ -29,7 +29,7 @@ written, with an unrestricted pressure-gradient hypothesis, in `CKN.Core.Endgame.epsilonRegularityL3_closer_of_pending_inputs`. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersThreshold.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersThreshold.lean index 0129e142a0..47a44edd79 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersThreshold.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAClosersThreshold.lean @@ -14,7 +14,7 @@ The two actual-integral estimates are used above one fixed absolute Calderón–Zygmund threshold. Their spatial and temporal clipping is preserved. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAFullSumAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAFullSumAssembly.lean index e2bc768c80..1b4799907f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAFullSumAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAFullSumAssembly.lean @@ -19,7 +19,7 @@ the `6/5` power and its radius-weighted multiple. They are distinct from bounds on individual clipped cell integrals or the actual total time mass. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAUnconditional.lean index 79380c898b..ec2a543a37 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremAUnconditional.lean @@ -11,7 +11,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientOrigin /-! # The cubic regularity criterion for suitable weak solutions -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZ.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZ.lean index 8785d24ba1..4847894c2d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZ.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZ.lean @@ -23,7 +23,7 @@ exact pressure binder consumed by the gradient criterion of `thm:B`. The constant relation is the one exposed by the transfer: the cylinder constant `C₁₂_p1` dominates `C_CZ * (9 * sobolevPoincareL6Constant)`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZSource.lean index 54b94a6254..0daf7b6818 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersCZSource.lean @@ -16,7 +16,7 @@ of nine to the pressure constant. The suitable-solution slice and residual estimates supply every analytic input of the scalar extension estimate. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersVelocitySlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersVelocitySlice.lean index 836d37166e..f5cdfa8910 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersVelocitySlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBAdaptersVelocitySlice.lean @@ -14,7 +14,7 @@ The slice Sobolev estimate and the nine-component tensor estimate supply the estimates proved in `CKN.Pressure.SliceVelocityCube`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBCloser.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBCloser.lean index 4cfa3194d5..3bfa3c94b5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBCloser.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBCloser.lean @@ -35,7 +35,7 @@ field by uniqueness. Finite covering supplies its whole-carrier integral, and the two cell regimes give the pressure-gradient input of the criterion. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBUnconditional.lean index afe1672a53..adfce52d11 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/TheoremBUnconditional.lean @@ -11,7 +11,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.WeakGradientGluingTRem /-! # The gradient regularity criterion for suitable weak solutions -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/UniformHalfCylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/UniformHalfCylinder.lean index 22a3953789..a2e981f3fa 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/UniformHalfCylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/UniformHalfCylinder.lean @@ -19,7 +19,7 @@ Together they give a quantitative representative with constants chosen before the solution. Construction of the heat sources is a separate step. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/VelocityAverage.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/VelocityAverage.lean index 34227edc9a..067a6488c8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/VelocityAverage.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/VelocityAverage.lean @@ -17,7 +17,7 @@ part of the reanchored heat representative without any additional assumption on that average. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory Set diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WeakPressureSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WeakPressureSlice.lean index 313978921b..c86a43f8d0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WeakPressureSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WeakPressureSlice.lean @@ -14,7 +14,7 @@ The particular gradient is supplied as a measurable field with its weak identity. Only the test functions are differentiated classically. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WideInitialMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WideInitialMorrey.lean index 5e7e3fb12d..dacebc9f10 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WideInitialMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Endgame/WideInitialMorrey.lean @@ -16,7 +16,7 @@ the smaller-cylinder estimates; the gradient covering number is selected before the domain and solution. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Campanato.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Campanato.lean index 6c343ce24b..a3c1e2f0c9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Campanato.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Campanato.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Normed.Group.InfiniteSum Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -32,6 +32,7 @@ open CKN.Foundation.Heat CKN.Foundation.Parabolic /-- Contribution of scalar and divergence sources restricted to one integration shell. -/ +@[expose] def heatPotentialShellValue (F : ParabolicPoint → ℝ) (G : Fin 3 → ParabolicPoint → ℝ) (S : Set ParabolicPoint) (w : ParabolicPoint) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Exponents.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Exponents.lean index a60f225904..dd49ec1321 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Exponents.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Exponents.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Real Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Far.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Far.lean index 1f4dfcde7e..4e35df245d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Far.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Far.lean @@ -17,7 +17,7 @@ public import Mathlib.Analysis.Calculus.MeanValue Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarOscillation.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarOscillation.lean index 92a5af0761..8848047a3f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarOscillation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarOscillation.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.FarShell Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarShell.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarShell.lean index 4e4bcb3abb..a600ca4def 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarShell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/FarShell.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.Far Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -48,7 +48,7 @@ theorem measurable_heatPotentialSpatialKernel_translate (i : Fin 3) (w : Parabol · exact measurable_const /-- Far parabolic shell with the six-scale separation used in heat-kernel difference estimates. -/ -def heatPotentialFarShellSet (z : ParabolicPoint) (r : ℝ) (j : ℕ) : +@[expose] def heatPotentialFarShellSet (z : ParabolicPoint) (r : ℝ) (j : ℕ) : Set ParabolicPoint := parabolicRieszShell r (j + 6 : ℤ) z theorem measurableSet_heatPotentialFarShellSet (z : ParabolicPoint) (r : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Kernel.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Kernel.lean index 97fe804cd5..df98e275f0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Kernel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Kernel.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.Bounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -30,18 +30,22 @@ open CKN.Foundation.Heat CKN.Foundation.Parabolic kernel and its spatial derivatives have one common interface. -/ /-- Space-time displacement used as the argument of the translation-invariant heat kernel. -/ +@[expose] def pointSub (w v : ParabolicPoint) : ParabolicPoint := (w.1 - v.1, w.2 - v.2) /-- Causal heat kernel evaluated at the space-time displacement of two points. -/ +@[expose] def heatPotentialKernel (w v : ParabolicPoint) : ℝ := heatKernelPlus (pointSub w v) /-- Spatial derivative of the causal heat kernel at a space-time displacement. -/ +@[expose] def heatPotentialSpatialKernel (i : Fin 3) (w v : ParabolicPoint) : ℝ := heatKernelSpaceDerivative (w.1 - v.1) (w.2 - v.2) i /-- Heat potential of a scalar source and spatial divergence sources. -/ +@[expose] def heatPotential (F : ParabolicPoint → ℝ) (G : Fin 3 → ParabolicPoint → ℝ) (w : ParabolicPoint) : ℝ := (∫ v, heatPotentialKernel w v * F v) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/MorreySources.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/MorreySources.lean index 7dc2cc584c..81018686eb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/MorreySources.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/MorreySources.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Kerne Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Near.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Near.lean index a9f76a5950..09ae7a5e54 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Near.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/Near.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Adams Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section @@ -94,7 +94,7 @@ written with the gauge `parabolicRho₂`, whose time component is symmetric; this is the geometry needed for a genuine parabolic metric ball. -/ /-- Near region separated from the far shells at parabolic distance `64 * r`. -/ -def heatPotentialNearSet (z : ParabolicPoint) (r : ℝ) : Set ParabolicPoint := +@[expose] def heatPotentialNearSet (z : ParabolicPoint) (r : ℝ) : Set ParabolicPoint := {v | parabolicRho₂ z v < (64 : ℝ) * r} diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedAssembly.lean index e4b299f75b..880962b4bd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedAssembly.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.SubordinatedFa Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedBase.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedBase.lean index bfb63c55a1..eb4f03ea31 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedBase.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedBase.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.Subordination Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedCampanato.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedCampanato.lean index 75c1690c94..9cf98b0781 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedCampanato.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedCampanato.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.SubordinatedEn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedEnd.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedEnd.lean index 328d4f32c1..6e081d003f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedEnd.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedEnd.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.SubordinatedAs Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedFar.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedFar.lean index 55f635098b..b016193e11 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedFar.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedFar.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.SubordinatedNe Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedNear.lean b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedNear.lean index 85fde204b0..9405958646 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedNear.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/HeatPotential/SubordinatedNear.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.HeatPotential.SubordinatedBa Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/Arithmetic.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/Arithmetic.lean index 3199f42e06..2bb7b00e99 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/Arithmetic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/Arithmetic.lean @@ -24,7 +24,7 @@ The radius interpolation theorem likewise takes the finiteness hypotheses required by the radius monotonicity API. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology @@ -39,6 +39,7 @@ namespace CKN /-! ### The numerical convention -/ /-- The fixed exponent `ε = 2/5` in `conv:kappa`. -/ +@[expose] def iterationEpsilon : ℝ := 2 / 5 /-- The fixed contraction factor in `conv:kappa`. -/ @@ -54,7 +55,7 @@ def iterationEpsilonStar (C₂₇ : ℝ) : ℝ := min 1 ((iterationKappa C₂₇ ^ (5 + iterationEpsilon) / (32 * C₂₇)) ^ 2) /-- The force coefficient `C₂₉` in `eq:C29`. -/ -def iterationC₂₉ (C₂₇ C₂₈ : ℝ) : ℝ := +@[expose] def iterationC₂₉ (C₂₇ C₂₈ : ℝ) : ℝ := 2 * C₂₈ ^ 2 * iterationKappa C₂₇ ^ (-1 - 2 * iterationEpsilon) + C₂₈ * iterationKappa C₂₇ ^ (-3 - iterationEpsilon) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaDecayAlgebra.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaDecayAlgebra.lean index f886c297b6..148c6f6656 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaDecayAlgebra.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaDecayAlgebra.lean @@ -47,7 +47,7 @@ square-root bounds for `√γ`, and the power comparisons `κ ≤ κ^{2/3}` and `κ⁻¹ ≤ κ^{-5}` valid for `0 < κ ≤ 1/2`. -/ -@[expose] public section +public section noncomputable section @@ -60,17 +60,18 @@ namespace CKN The fourth power of the scale ratio enters as `κ ^ (-4 : ℝ)` so that the statement is uniform with the remaining real powers of `κ` in the decay estimates; for `κ > 0` this is the paper's `κ⁻⁴`. -/ +@[expose] def thetaValue (κ α β δ : ℝ) : ℝ := α + β + κ ^ (-4 : ℝ) * δ ^ 2 /-- The absolute constant `C₂₇` of `eq:theta-decay-1`, in terms of the input constants `C₉` (Gagliardo–Nirenberg), `C₁₄` (pressure) and `C₂₅` (Caccioppoli): the paper's `3C₁₄² + C₂₅(1 + 2C₉^{1/2}) + 2C₂₅C₉^{1/2}`. -/ -def thetaDecayC₂₇ (C₉ C₁₄ C₂₅ : ℝ) : ℝ := +@[expose] def thetaDecayC₂₇ (C₉ C₁₄ C₂₅ : ℝ) : ℝ := 3 * C₁₄ ^ 2 + C₂₅ * (1 + 2 * Real.sqrt C₉) + 2 * C₂₅ * Real.sqrt C₉ /-- The constant `C₂₈ = C₂₈(q)` of `eq:theta-decay-1`, in terms of `C₉`, `C₁₅` (pressure) and `C₂₆` (Caccioppoli): the paper's `3C₁₅² + 2C₂₆C₉^{1/2}`. -/ -def thetaDecayC₂₈ (C₉ C₁₅ C₂₆ : ℝ) : ℝ := +@[expose] def thetaDecayC₂₈ (C₉ C₁₅ C₂₆ : ℝ) : ℝ := 3 * C₁₅ ^ 2 + 2 * C₂₆ * Real.sqrt C₉ /-! ### Elementary real inequalities -/ diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuity.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuity.lean index 9d4370cef4..7491e30e5e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuity.lean @@ -20,7 +20,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Iteration.ThetaUpperSemicont Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityAlpha.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityAlpha.lean index 1fe2a9c1d6..9ef57559ca 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityAlpha.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityAlpha.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Iteration.ThetaUpperSemicont Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityBasic.lean index e4b85d5176..aa517f3b99 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/ThetaUpperSemicontinuityBasic.lean @@ -18,7 +18,7 @@ public import Mathlib.MeasureTheory.Group.Prod Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuity.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuity.lean index 1b4555d482..859229de46 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuity.lean @@ -22,7 +22,7 @@ The product-cutoff argument below uses the almost-every-time local energy inequality and the compactly supported smooth cutoffs from the setting layer. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuityBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuityBasic.lean index 1baf954904..0ae389d34e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuityBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Iteration/UpperSemicontinuityBasic.lean @@ -21,7 +21,7 @@ The product-cutoff argument below uses the almost-every-time local energy inequality and the compactly supported smooth cutoffs from the setting layer. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Parameters.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Parameters.lean index 29ec38839a..5fb7960826 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Parameters.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Parameters.lean @@ -35,7 +35,7 @@ used in Corollary `cor:one-round`, the positivity and upper bound the exponent identities `2 - 5/θ₀ = 1 - 5/θ₁ = γ` of `eq:q0q1`. -/ -@[expose] public section +public section noncomputable section @@ -85,7 +85,7 @@ theorem bootstrap_gain_at_tau₂ : 1 / stepTau₂ - stepVarpi = 1 / 25 := by /-- The integrability parameter `σ = 3 - 5/q` of `eq:standing`, a function of the force exponent `q`. -/ -def stepSigma (q : ℝ) : ℝ := 3 - 5 / q +@[expose] def stepSigma (q : ℝ) : ℝ := 3 - 5 / q /-- `eq:standing` records `σ = 3 - 5/q > 1` under `q > 5/2`. -/ theorem one_lt_stepSigma {q : ℝ} (hq : (5 : ℝ) / 2 < q) : 1 < stepSigma q := by @@ -112,7 +112,7 @@ theorem iterationEpsilon_lt_stepSigma {q : ℝ} (hq : (5 : ℝ) / 2 < q) : /-- The Hölder exponent `γ₀(q) = min {2 - 5/q, 1/5}` of `eq:gamma-value` in Theorem `thm:endgame`. -/ -def stepGamma₀ (q : ℝ) : ℝ := min (2 - 5 / q) (1 / 5) +@[expose] def stepGamma₀ (q : ℝ) : ℝ := min (2 - 5 / q) (1 / 5) /-- `eq:gamma-value` records `γ₀ > 0` because `q > 5/2`. -/ theorem stepGamma₀_pos {q : ℝ} (hq : (5 : ℝ) / 2 < q) : 0 < stepGamma₀ q := by @@ -142,11 +142,11 @@ theorem stepGamma₀_lt_one (q : ℝ) : stepGamma₀ q < 1 := by /-- The Morrey exponent `θ₀ = 5/(2 - γ)` of `eq:q0q1`, as a function of the Hölder exponent `γ`. -/ -def stepTheta₀ (γ : ℝ) : ℝ := 5 / (2 - γ) +@[expose] def stepTheta₀ (γ : ℝ) : ℝ := 5 / (2 - γ) /-- The Morrey exponent `θ₁ = 5/(1 - γ)` of `eq:q0q1`, as a function of the Hölder exponent `γ`. -/ -def stepTheta₁ (γ : ℝ) : ℝ := 5 / (1 - γ) +@[expose] def stepTheta₁ (γ : ℝ) : ℝ := 5 / (1 - γ) /-- The first identity of `eq:q0q1`: `1/θ₀ = (2 - γ)/5`. -/ theorem stepTheta₀_inv (γ : ℝ) : 1 / stepTheta₀ γ = (2 - γ) / 5 := by diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Interpolation.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Interpolation.lean index 01020bd81f..ea72d46524 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Interpolation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Interpolation.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -28,6 +28,7 @@ open CKN.Foundation.Parabolic.Integration noncomputable section namespace CKN /-- Positive coefficient for the scale-normalized velocity interpolation estimate. -/ +@[expose] noncomputable def gagliardoConstant : ℝ := 1 + (81 * ENNReal.ofReal (Real.sqrt 3) * (Classical.choose interpolationBall_three_finite)).toReal private theorem gamma_le_of_same_ball_interpolation diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Iteration.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Iteration.lean index ed9488b347..8b374b8528 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Iteration.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/Iteration.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.Theta Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyBalls.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyBalls.lean index 2fc666d1d6..537e88442f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyBalls.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyBalls.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.MorreyVecMem Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecay.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecay.lean index cffcdb399e..d8bf047ee1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecay.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecay.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Energy.PointwiseEnergy Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecayAux.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecayAux.lean index 9f44d68aca..9400a6ee9b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecayAux.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyDecayAux.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Energy.PointwiseEnergy Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyForm.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyForm.lean index 4c3e9857fe..cea4ecdd8e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyForm.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyForm.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step2.MorreyBalls Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormFixedScale.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormFixedScale.lean index 8bd3b34a75..d88fa1f864 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormFixedScale.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormFixedScale.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Cylin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormUniform.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormUniform.lean index da326d19f3..965eeef471 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormUniform.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step2/MorreyFormUniform.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step2.MorreyFormFixedScale Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/DuhamelAdjoint.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/DuhamelAdjoint.lean index 608e724e27..1ffb815eab 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/DuhamelAdjoint.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/DuhamelAdjoint.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Cutoff.SpaceTi Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -150,6 +150,7 @@ private lemma canonical_cutoff_potential_agreement /-! The causal heat potential with a divergence-form source. -/ /-- Vector Duhamel potential with the sign convention for the localized divergence equation. -/ +@[expose] def duhamelPotential (g : ParabolicPoint → Vec3) (h : Fin 3 → ParabolicPoint → Vec3) (z : ParabolicPoint) : Vec3 := fun i => diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamel.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamel.lean index b41d957370..536f9b809e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamel.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationDuham Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelAtoms.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelAtoms.lean index 27e7634250..3d3a2f6913 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelAtoms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelAtoms.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.LocalizedEquationGradi Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelTested.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelTested.lean index a03f6c506f..d58906d398 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelTested.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/GradientSlotDuhamelTested.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationConve Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalEquationRepresentation.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalEquationRepresentation.lean index fc495bfd20..8716e5ab9c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalEquationRepresentation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalEquationRepresentation.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.LeibnizLaplacian Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -40,17 +40,20 @@ the pointwise estimate is proved directly from the explicit heat kernels. -/ /-- Velocity multiplied by the localization cutoff. -/ +@[expose] def localizedVelocity (φ : ParabolicPoint → ℝ) (u : ParabolicPoint → Vec3) : ParabolicPoint → Vec3 := fun z => φ z • u z /-- Convective derivative of velocity, expressed through its selected weak gradient. -/ +@[expose] def localizedConvection (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) : ParabolicPoint → Vec3 := fun z i => ∑ j, u z j * Du z i j /-- Scalar-source part of the localized heat equation before putting convection in divergence form. -/ +@[expose] def localizedEquationG (φ : ParabolicPoint → ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (f : ParabolicPoint → Vec3) : ParabolicPoint → Vec3 := @@ -60,6 +63,7 @@ def localizedEquationG (φ : ParabolicPoint → ℝ) φ z * localizedConvection u Du z i + φ z * f z i /-- Divergence-source contribution from differentiating the localization cutoff. -/ +@[expose] def localizedEquationH (φ : ParabolicPoint → ℝ) (u : ParabolicPoint → Vec3) : Fin 3 → ParabolicPoint → Vec3 := fun i z => (-2 * spatialPartial φ i z) • u z diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationBasics.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationBasics.lean index 4745b7f346..f3a1e132a2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationBasics.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationBasics.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Function.L2Space Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter @@ -27,6 +27,7 @@ open CKN.Foundation.Heat CKN.Foundation.Parabolic open CKN.Core.HeatPotential /-! These are the divergence-form sources obtained directly from the tested equation. -/ /-- Non-divergence source in the localized momentum equation, including pressure and forcing. -/ +@[expose] def localizedDivergenceG (φ : Vec3 × ℝ → ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) : ParabolicPoint → Vec3 := @@ -35,6 +36,7 @@ def localizedDivergenceG (φ : Vec3 × ℝ → ℝ) (u : ParabolicPoint → Vec3 - ∑ j, Du z i j * spatialPartial (show ParabolicPoint → ℝ from φ) j z + p z * spatialPartial (show ParabolicPoint → ℝ from φ) i z + f z i * φ z /-- Tensor divergence source in the localized momentum equation. -/ +@[expose] def localizedDivergenceH (φ : Vec3 × ℝ → ℝ) (u : ParabolicPoint → Vec3) (p : ParabolicPoint → ℝ) : Fin 3 → ParabolicPoint → Vec3 := fun j z i => φ z * u z i * u z j + u z i * spatialPartial φ j z diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationConvectionTransfer.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationConvectionTransfer.lean index 8f7d489150..4e667ca7e6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationConvectionTransfer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationConvectionTransfer.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationGradi Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamel.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamel.lean index a77ee0859e..ac27831205 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamel.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationDuham Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelFinish.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelFinish.lean index 898a173eba..9f4684a5d7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelFinish.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelFinish.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationDuham Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelKernels.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelKernels.lean index 06cd17d410..e4b3681f6a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelKernels.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationDuhamelKernels.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Topology Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationGradientTransfers.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationGradientTransfers.lean index 0b6e7c11ba..1489f06eb7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationGradientTransfers.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationGradientTransfers.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Measure.SliceGradientS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationLaplacian.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationLaplacian.lean index cbc7e3dd94..cafbb689bb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationLaplacian.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationLaplacian.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationTested.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationTested.lean index 9086db2583..d176f5d110 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationTested.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/LocalizedEquationTested.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationLapla Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecay.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecay.lean index cac23538f9..be11c2dbd5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecay.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecay.lean @@ -22,7 +22,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.RpowSquares Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology open MeasureTheory Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayMeasurability.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayMeasurability.lean index 5fa6725aed..6b84dd4432 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayMeasurability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayMeasurability.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCor Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayTShape.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayTShape.lean index 6e3b0bd2ec..c8c20fa79b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayTShape.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/PressureDecayTShape.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsP7SolutionBound Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecay.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecay.lean index 3810774be1..f046d39877 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecay.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecay.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.Theta Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecayTShape.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecayTShape.lean index 85f08884fc..04b020ca4e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecayTShape.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step3/ThetaDecayTShape.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.ThetaDecay Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/Decay.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/Decay.lean index 0de1dc8abd..18f14e79dc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/Decay.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/Decay.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Cylin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/KappaCapArithmetic.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/KappaCapArithmetic.lean index b226203f0e..47eb956e26 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/KappaCapArithmetic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/KappaCapArithmetic.lean @@ -16,7 +16,7 @@ public import Mathlib.Tactic.NormNum Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientData.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientData.lean index 96f8908e3b..4e6a15584d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientData.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientData.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.LocalizedEquationBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientMeasurability.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientMeasurability.lean index 3d9e7ffd6f..dc45fbf27e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientMeasurability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/LocalizedEquationGradientMeasurability.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.OneSidedMeasurabilit Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/OneSidedMorreyMonotone.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/OneSidedMorreyMonotone.lean index 3bf4a3285f..c900534b6c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/OneSidedMorreyMonotone.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/OneSidedMorreyMonotone.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.OneSidedMorrey Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PointwisePotential.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PointwisePotential.lean index d60b821d9c..4973db8e8b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PointwisePotential.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PointwisePotential.lean @@ -20,7 +20,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -48,6 +48,7 @@ lemma heatPotentialSpatialKernel_abs_le_riesz₁ (i : Fin 3) exact _root_.CKN.Core.HeatPotential.heatPotentialSpatialKernel_abs_le_riesz₁ i z w /-- Riesz-potential majorant for the localized scalar and divergence heat sources. -/ +@[expose] def pointwisePotentialMajorant (g : ParabolicPoint → Vec3) (h : Fin 3 → ParabolicPoint → Vec3) : ParabolicPoint → ℝ := fun z => diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradient.lean index 956ad9ec7d..0a0e9ce082 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradient.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Measure.SliceGradientS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientBase.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientBase.lean index 429298a51f..5c137eea71 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientBase.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientBase.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Potentials Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantExponents.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantExponents.lean index 1fb270750e..391d0d0ed0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantExponents.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantExponents.lean @@ -36,7 +36,7 @@ This file records the two exponent balances involved, in the normalisation dominates the requirement for every admissible `κ` with room to spare. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantHolder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantHolder.lean index e77cc9bef9..d8f042b0a3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantHolder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantHolder.lean @@ -15,7 +15,7 @@ the backward window of a parabolic cell: a power-mean bound that trades a sub-unit power for the total mass. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantShift.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantShift.lean index 791f51aec7..7561ae0e0c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantShift.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGaugeMajorantShift.lean @@ -16,7 +16,7 @@ the pressure slice unchanged, so a slice estimate proved for the shifted pressure is an estimate for the original pressure gradient. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedCell.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedCell.lean index 277d924b99..92c8447de9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedCell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedCell.lean @@ -25,7 +25,7 @@ bound to the one field. Its conclusion is exactly the slice hypothesis of the time integration that turns slice bounds into the cell power integral. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedLocality.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedLocality.lean index aeb9969368..057998a3b6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedLocality.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedLocality.lean @@ -23,7 +23,7 @@ available anywhere: the previously existing interface for weak derivatives consisted only of restriction, transport and almost-everywhere uniqueness. -/ -@[expose] public section +public section open MeasureTheory Set noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginCost.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginCost.lean index 87e343683e..a8681ef5e7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginCost.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginCost.lean @@ -20,7 +20,7 @@ statement is the form in which a comparison against an explicit majorant stated at the carrier radius is transported down to the margin scale. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginGeometry.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginGeometry.lean index 550d5de1b2..a8ab1179d4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginGeometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedMarginGeometry.lean @@ -26,7 +26,7 @@ based at the origin of the unit parabolic cylinder, and a parabolic metric ball about an arbitrary centre. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginClause.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginClause.lean index 99a1d17539..7a44103998 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginClause.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginClause.lean @@ -54,7 +54,7 @@ Nothing else in the estimate changes: the transfer, the carrier, the field and the conclusion are the established ones. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginTransfer.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginTransfer.lean index e2ea114f4f..d8caafb626 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginTransfer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedOriginTransfer.lean @@ -19,7 +19,7 @@ centre is not met by the carrier contribute nothing, and cells at or above the fixed scale are handled by the total integral on the carrier. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedPartition.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedPartition.lean index 1da39e800d..0e9c9445a6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedPartition.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedPartition.lean @@ -17,7 +17,7 @@ sum equals `1` on that compact set. The construction multiplies bump functions telescopically, so no manifold partition-of-unity machinery is needed. -/ -@[expose] public section +public section open Metric Set noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedRemainderBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedRemainderBounds.lean index 9fb5256991..5392223fc8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedRemainderBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedRemainderBounds.lean @@ -17,7 +17,7 @@ Morrey control. Intersecting the time window and spatial ball with carriers preserves the estimate, with the explicit radius power `5 * (1 - (6/5)/κ)`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSelectionCore.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSelectionCore.lean index 6d15f4ceb9..dfe7cf6a3c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSelectionCore.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSelectionCore.lean @@ -15,7 +15,7 @@ overlaps is represented by a single function, and that representative inherits local integrability on the union of the pieces. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSlice.lean index ba26ec7386..d7057353f8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSlice.lean @@ -34,7 +34,7 @@ sub-ball is inherited by the glued field there. That is the mechanism that makes a bound available at *every* cell scale rather than at one scale only. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSmallCell.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSmallCell.lean index 534cb4102a..f778a39eed 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSmallCell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSmallCell.lean @@ -33,7 +33,7 @@ Cells above the margin scale are **not** reached by this argument; they belong t the other regime and are bounded by the whole-carrier integral. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSupport.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSupport.lean index ca7a326fa9..072d569e77 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSupport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedSupport.lean @@ -18,7 +18,7 @@ integrable on the domain; and a set integral of a function supported in a common subset does not see the ambient set. -/ -@[expose] public section +public section open MeasureTheory Set noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTimeBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTimeBounds.lean index 0a48a021e7..e1f7cd9f61 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTimeBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTimeBounds.lean @@ -18,7 +18,7 @@ and under extending the time window by zero. The coefficients below are fixed before the time integral; no shrinking-cell growth is asserted. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTransferClause.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTransferClause.lean index 91173878ab..2bc5f86178 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTransferClause.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTransferClause.lean @@ -33,7 +33,7 @@ cylinder inside `Metric.ball z₀ (2 * R)`, which is the region the hypotheses control. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTwoRegimeMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTwoRegimeMorrey.lean index ece0b5a42c..e23211cf01 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTwoRegimeMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientGluedTwoRegimeMorrey.lean @@ -24,7 +24,7 @@ available only while the cell is small relative to its distance to the carrier boundary, so the two regimes must be kept separate and then glued. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsFiniteAnnuli.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsFiniteAnnuli.lean index 11731178bd..61bb6b8426 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsFiniteAnnuli.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsFiniteAnnuli.lean @@ -16,7 +16,7 @@ many dyadic annuli. The near part uses the global Calderón–Zygmund bound; each annulus uses the exterior inverse-cube estimate. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsMeanMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsMeanMorrey.lean index 3d5b462c1c..f4be2474fe 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsMeanMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsMeanMorrey.lean @@ -15,7 +15,7 @@ space-time carrier. It therefore belongs to every finite integrability class needed here. Subtracting it preserves the velocity Morrey class. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsNormalization.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsNormalization.lean index eed5d90b33..1202e264d1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsNormalization.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsNormalization.lean @@ -15,7 +15,7 @@ near-source term and the annular tail. The resulting bound is independent of the centre, radius, and number of source annuli. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainder.lean index 45652caa63..bcb6a9db8b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainder.lean @@ -16,7 +16,7 @@ power needed for the harmonic part of the pressure gradient. The temporal Hölder factor is retained explicitly before the Morrey normalization. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainderGlobal.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainderGlobal.lean index 2f38845a15..656583b564 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainderGlobal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRemainderGlobal.lean @@ -14,7 +14,7 @@ cell controls small cells. Together these estimates give a finite Morrey seminorm from an `L^{3/2}` temporal bound on the spatial supremum. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRiesz.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRiesz.lean index 41368c5bd4..e5d1dcf8f0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRiesz.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRiesz.lean @@ -15,7 +15,7 @@ near/far decomposition. Away from the support its exterior formula gives a pointwise bound by the source's spatial `L^1` norm. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRieszMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRieszMorrey.lean index 353140cfec..95ad2bf2a8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRieszMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsRieszMorrey.lean @@ -14,7 +14,7 @@ cell. The normalized bound is uniform in their number. It therefore bounds the Morrey seminorm of any measurable representative of the slice operator. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators @@ -25,6 +25,7 @@ namespace CKN.Core.Step4 /-- The explicit constant in the parabolic Morrey bound for one spatial Riesz component. -/ +@[expose] def pressureRieszMorreyConstant (κ : ℝ) : ℝ≥0∞ := ENNReal.ofReal (czGradientComponentConstant rieszSecondWeakTypeConstant 1) * (2 : ℝ≥0∞) ^ (25 / 6 - 5 / κ) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsShellTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsShellTime.lean index 2daf44f8ba..d41b56c176 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsShellTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsShellTime.lean @@ -15,7 +15,7 @@ exponent is uniform. It makes the exterior source scales summable after their spatial masses have been integrated in time. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceMorrey.lean index 071a36b269..e14c80e667 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceMorrey.lean @@ -19,7 +19,7 @@ term uses two velocity factors. Bounded cutoff coefficients and the bounded source carrier preserve finiteness at the target exponent. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceTime.lean index afc765ecce..c6e1f31a3f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserCellsSourceTime.lean @@ -14,7 +14,7 @@ Spatial Hölder converts the `L^1` mass of a source on a ball into its then makes the source's Morrey bound available for exterior kernel terms. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserTimeBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserTimeBounds.lean index eae052dbae..11ae614128 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserTimeBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientHGCloserTimeBounds.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.SliceSelectedGradientS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientLargeCells.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientLargeCells.lean index e68613d00e..c3062ebb39 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientLargeCells.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientLargeCells.lean @@ -20,7 +20,7 @@ the carrier boundary. Both the origin past cylinder and the symmetric parabolic metric ball are treated without any small-cell estimate. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientMorrey.lean index 9659a19ce3..1d5dd1c210 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientMorrey.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step2.MorreyForm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSided.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSided.lean index b6574b7f3e..2b63e2313a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSided.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSided.lean @@ -20,7 +20,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallBasics Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -173,6 +173,7 @@ representations on arbitrary sub-boxes. -/ /-- Quantitative Morrey bound assembled from velocity, gradient, forcing and harmonic remainders. -/ +@[expose] def oneSidedPressureGradientKP (q τ C_CZ R₀ R₁ ε : ℝ) (KU KD : ℝ≥0∞) : ℝ≥0∞ := let κ := min ((1 / τ + 8 / 25)⁻¹) q @@ -211,7 +212,7 @@ theorem oneSidedPressureGradientKP_lt_top /-- Uniform quantitative pressure-gradient conclusion on the prescribed range of Morrey exponents. -/ -def oneSidedPressureGradientQuantitative : Prop := +@[expose] def oneSidedPressureGradientQuantitative : Prop := ∀ q τ C_CZ R₀ R₁ ε : ℝ, ∀ KU KD : ℝ≥0∞, 5 / 2 < q → 25 / 3 ≤ τ → τ ≤ 25 → 0 ≤ C_CZ → diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedCell.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedCell.lean index 4ecb8f468e..00acab9a1f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedCell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedCell.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallDisplays Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -26,7 +26,7 @@ noncomputable section namespace CKN.Core.Step4 /-- Origin used for the normalized pressure-gradient estimate. -/ -def oneSidedPressureGradientOrigin : ParabolicPoint := ((0 : Vec3), 0) +@[expose] def oneSidedPressureGradientOrigin : ParabolicPoint := ((0 : Vec3), 0) /-! The cell is carried by the inner half of a symmetric parabolic ball. -/ @@ -51,7 +51,7 @@ cylinder; the Morrey seminorm is recovered as the supremum of the cells. -/ /-- Componentwise Morrey-cell bound for the gradient restricted to the normalized cylinder. -/ -def oneSidedPressureGradientOriginCellOutput +@[expose] def oneSidedPressureGradientOriginCellOutput (R₁ κ : ℝ) (KP : ℝ≥0∞) (Dp : ParabolicPoint → Vec3) : Prop := ∀ i : Fin 3, ∀ z : ParabolicPoint, ∀ r : {r : ℝ // 0 < r}, morreyCell (6 / 5 : ℝ) κ diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedKP.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedKP.lean index e8c916030f..bc11c16d36 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedKP.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedKP.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.OneSidedMorreyMonotone Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal @@ -48,6 +48,7 @@ The adapter direction is from the AE producer stated with `KP` to the larger /-- The enlarged pressure-gradient majorant. Its A budget adds the raised `6/5` power to the old A budget, and its B budget absorbs the clipped-scale inflation, floored at one. -/ +@[expose] def oneSidedPressureGradientKP' (q τ C_CZ R₀ R₁ ε : ℝ) (KU KD : ℝ≥0∞) : ℝ≥0∞ := let κ := min ((1 / τ + 8 / 25)⁻¹) q diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedOrigin.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedOrigin.lean index 010d2b3ccd..f10c30315f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedOrigin.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOneSidedOrigin.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.SliceSelectedGradient Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -34,7 +34,7 @@ there is no symmetric time window in this interface. -/ /-- Existence interface for a measurable weak pressure gradient with normalized-cylinder cell bounds. -/ -def oneSidedPressureGradientOriginCellProducer : Prop := +@[expose] def oneSidedPressureGradientOriginCellProducer : Prop := ∀ q τ C_CZ R₀ R₁ ε : ℝ, ∀ KU KD : ℝ≥0∞, 5 / 2 < q → 25 / 3 ≤ τ → τ ≤ 25 → 0 ≤ C_CZ → diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotCorrectionAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotCorrectionAssembly.lean index 79e9ece213..ea48e1945e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotCorrectionAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotCorrectionAssembly.lean @@ -16,7 +16,7 @@ transfer are supplied internally. Only the displayed correction estimate remains as the analytic input of this reduction. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotFinal.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotFinal.lean index 9fd048e1b9..e174557fa4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotFinal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotFinal.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotHarmonic.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotHarmonic.lean index f95443eea5..8b32844dd1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotHarmonic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotHarmonic.lean @@ -40,7 +40,7 @@ absolute constant survives, so the estimate is compatible with a vanishing slot at vanishing data. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCells.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCells.lean index 636a9272d2..c9701d9c90 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCells.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCells.lean @@ -35,7 +35,7 @@ superhomogeneous in `|C_CZ| + 1`, so both are absorbed by requiring centre of the given cell is arbitrary and its radius is arbitrary. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCellsGeometry.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCellsGeometry.lean index d0ba0e4734..8a445b1aea 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCellsGeometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotLargeCellsGeometry.lean @@ -31,7 +31,7 @@ Together they reduce every clipped cell to margin cells centred in the carrier, at the cost of one absolute multiplicative constant. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Data.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Data.lean index 1873d72348..7a7611c5ed 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Data.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Data.lean @@ -22,7 +22,7 @@ slice mean; the divergence source's Morrey budget on any carrier inside the outer cylinder; and the gradient-shaped budget for the mean-free velocity. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2EnergyMean.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2EnergyMean.lean index 74273b4755..8c6e2e0c0a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2EnergyMean.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2EnergyMean.lean @@ -20,7 +20,7 @@ the ratio of the two ball volumes as the only coefficient. No covering of the averaging ball by cells of the running radius is needed. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2InstancesCorrection.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2InstancesCorrection.lean index 96a405776b..14ed11a273 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2InstancesCorrection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2InstancesCorrection.lean @@ -26,7 +26,7 @@ slice mean. The actual Riesz fields of the three sources then satisfy the clipped-cell estimate above an explicit threshold depending on nothing. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2MeanFree.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2MeanFree.lean index 9a9d5d657c..173ecac4d2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2MeanFree.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2MeanFree.lean @@ -24,7 +24,7 @@ volume gain on a cell of radius `r` beats the Morrey normalisation by `r^{1/10}`, uniformly over all cells and both large and small radii. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Riesz.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Riesz.lean index 0a097f5c1f..0795b90872 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Riesz.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Riesz.lean @@ -20,7 +20,7 @@ carrier restriction is invisible on the collar time window because the correction vanishes off the source ball. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Split.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Split.lean index e75b0be876..0c3461f6e6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Split.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotM2Split.lean @@ -23,7 +23,7 @@ endpoint is transferred to the exponent-dependent one for free on a carrier of radius at most one. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotSourceCorrectionSupport.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotSourceCorrectionSupport.lean index 690de30783..f91fb0eb3e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotSourceCorrectionSupport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotSourceCorrectionSupport.lean @@ -30,7 +30,7 @@ centring term explicit, so they can be consumed by the source estimates. derivative of that cutoff vanishes there under the same condition. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotThinCells.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotThinCells.lean index ab3e491a49..2b8f8db5aa 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotThinCells.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginASlotThinCells.lean @@ -15,7 +15,7 @@ unrestricted clipped-cell bound. The explicit cover count is absorbed once into the affine pressure coefficient. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyMajorant.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyMajorant.lean index c95fd9b32a..88bf653121 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyMajorant.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyMajorant.lean @@ -16,7 +16,7 @@ slice `L³` norm, and splits the centred source majorant of velocity term, and a localized force term, with explicit numerical constants. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergySlices.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergySlices.lean index 16cdc7f7eb..ec092ad518 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergySlices.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergySlices.lean @@ -21,7 +21,7 @@ or by the collar Dirichlet integral. No estimate here uses velocity or gradient Morrey data. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyTime.lean index 5384314600..188e292703 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotEnergyTime.lean @@ -23,7 +23,7 @@ shape `c₁ * (a * d) + c₂ * a ^ 2 + c₃ * F`. Every constant here is explicit, and no estimate below depends on the solution. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstances.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstances.lean index c17c72b513..106c67b2d8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstances.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstances.lean @@ -24,7 +24,7 @@ gradient of `eq:pressure-gradient-morrey`, cover the carrier by the fixed finite lattice of collars of radius `1/8`, and add the collar estimates. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstancesCollar.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstancesCollar.lean index 0048a144e9..f258996028 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstancesCollar.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotInstancesCollar.lean @@ -27,7 +27,7 @@ on the component index. No velocity or gradient Morrey datum enters any estimate in this file. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology BigOperators @@ -306,6 +306,7 @@ theorem time_mass_of_three_slice_bounds of the harmonic remainder constant; none depends on the force exponent, on the Morrey exponent, on the radii of the carrier, on the data size, or on the solution. -/ +@[expose] def bslotCollarConstant (C ρ : ℝ) : ℝ≥0∞ := 4 * ((3 * ENNReal.ofReal (czGradientComponentConstant rieszSecondWeakTypeConstant 1)) ^ (6 / 5 : ℝ) * diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotThreshold.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotThreshold.lean index 9ef17522c1..d3592f379a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotThreshold.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBSlotThreshold.lean @@ -24,7 +24,7 @@ the radius-`1/8` ball, are the geometric inputs of the whole-carrier pressure mass. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic CKN.Foundation.Parabolic.Integration diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudget.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudget.lean index 3ed716d0d7..a203fae817 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudget.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudget.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudgetSufficient.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudgetSufficient.lean index 0d31dd20a8..3b5b349dcf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudgetSufficient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginBudgetSufficient.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceAssembly.lean index 93d671522e..984e303133 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceAssembly.lean @@ -28,7 +28,7 @@ nor the slice bounds. The output also records the identification of the field with every slice weak gradient, which is what pins it almost everywhere. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceCenteredSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceCenteredSource.lean index 99c3d7e1b0..a6aeffe4e3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceCenteredSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceCenteredSource.lean @@ -17,7 +17,7 @@ cost needed for the time estimate of `eq:pressure-gradient-morrey`. The scalar Hölder proofs follow `PressureGradientSourceBounds`. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceExhaustion.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceExhaustion.lean index 4dfd228527..4afb9babc8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceExhaustion.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceExhaustion.lean @@ -16,7 +16,7 @@ public import Mathlib.Topology.Order.IntermediateValue Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set Metric diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceForceEnvelope.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceForceEnvelope.lean index 12d5d6a6ca..b27c67178a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceForceEnvelope.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceForceEnvelope.lean @@ -17,7 +17,7 @@ Fixed-radius Young and far-field bounds control the force contribution of `eq:pressure-gradient-morrey` by spatial source norms on its cutoff ball. -/ -@[expose] public section +public section section @@ -160,19 +160,20 @@ noncomputable section namespace CKN.Core.Step4 /-- Fixed-radius coefficient for the Newtonian potential. -/ -def originNewtonianCoefficient (R : ℝ) : ℝ≥0∞ := +@[expose] def originNewtonianCoefficient (R : ℝ) : ℝ≥0∞ := eLpNorm (truncatedNewtonianPotentialKernel (R + 2 * R)) (ENNReal.ofReal (6 / 5 : ℝ)) volume + ENNReal.ofReal (2 * (4 * Real.pi)⁻¹ * invNormBallConstant ^ (2 / 3 : ℝ)) * volume (closedBall (0 : Vec3) R) ^ (1 / 6 : ℝ) /-- Fixed-radius coefficient for the derivative Newtonian potential. -/ -def originNewtonianDerivativeCoefficient (R : ℝ) (i : Fin 3) : ℝ≥0∞ := +@[expose] def originNewtonianDerivativeCoefficient (R : ℝ) (i : Fin 3) : ℝ≥0∞ := eLpNorm (truncatedNewtonianDerivative (R + 2 * R) i) (ENNReal.ofReal (6 / 5 : ℝ)) volume + ENNReal.ofReal (4 * (4 * Real.pi)⁻¹ / (2 * R) * invNormBallConstant ^ (2 / 3 : ℝ)) * volume (closedBall (0 : Vec3) R) ^ (1 / 6 : ℝ) /-- The force-growth envelope uses only spatial norms on the origin ball. -/ -def originForceGrowthEnvelope (R : ℝ) (f : ParabolicPoint → Vec3) (s : ℝ) : ℝ≥0∞ := +@[expose] def originForceGrowthEnvelope + (R : ℝ) (f : ParabolicPoint → Vec3) (s : ℝ) : ℝ≥0∞ := ENNReal.ofReal (1 + R) * ∑ j : Fin 3, (originNewtonianDerivativeCoefficient R j + ENNReal.ofReal (cutoffGradientConstant / R) * originNewtonianCoefficient R) * diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceGlue.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceGlue.lean index 784d652d9a..6fb1da45f7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceGlue.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceGlue.lean @@ -24,7 +24,7 @@ This module records the gluing construction and the geometric facts about the unit domain hypothesis of the one-sided pressure estimate. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceHarmonicForceTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceHarmonicForceTime.lean index 7404e1075a..c410526c1f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceHarmonicForceTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceHarmonicForceTime.lean @@ -14,7 +14,7 @@ The harmonic force term in `eq:pressure-gradient-morrey`, including both potential-growth constants, is measurable and integrable on interior time boxes. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMargin.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMargin.lean index 63ccd02748..602ff38715 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMargin.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMargin.lean @@ -19,7 +19,7 @@ slice estimate in `eq:pressure-gradient-morrey` bounds the power integral of one fixed measurable gradient, as used in `prop:bootstrap`. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeanNorm.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeanNorm.lean index 0c69c55218..99845d0295 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeanNorm.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeanNorm.lean @@ -15,7 +15,7 @@ The mean oscillation estimate behind `eq:Chat` gives a uniform component `L³` bound for the centered factor of `eq:Uij`. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeasurable.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeasurable.lean index b98f118fa2..a00c7e6b9c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeasurable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceMeasurable.lean @@ -20,7 +20,7 @@ representative on the whole time interval. Its derivatives on all open subdomains share one exceptional set of times, as needed in `prop:bootstrap`. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePairing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePairing.lean index cb37b033af..ef8cbd0c79 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePairing.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ScalingInvarianceTests Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePotentialTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePotentialTime.lean index 71864cbd45..448f9c4fab 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePotentialTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePotentialTime.lean @@ -16,7 +16,7 @@ of the potential norm in time. This applies to the force-growth constants in `eq:pressure-gradient-morrey` without assuming temporal regularity. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePressure.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePressure.lean index ce6b33e923..c454da8ae4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePressure.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstancePressure.lean @@ -17,7 +17,7 @@ A compact exhaustion of the time interval makes the exceptional set uniform on the entire interval. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceQuantitative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceQuantitative.lean index 27a9445f38..26f7fe5885 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceQuantitative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceQuantitative.lean @@ -19,7 +19,7 @@ The complete majorant in `eq:pressure-gradient-morrey` is retained when constructing the local pressure gradient on one interior cylinder. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -30,6 +30,7 @@ namespace CKN.Core.Step4 /-- The explicit source, harmonic, and force majorant of `eq:pressure-gradient-morrey` on one interior cylinder. -/ +@[expose] def originSliceGradientMajorant (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSource.lean index 6d141aafbf..09d8f33332 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSource.lean @@ -18,7 +18,7 @@ The source and its tested pairing in `eq:pressure-gradient-morrey` follow from the velocity's spatial weak gradient and divergence constraint. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSourceObligations.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSourceObligations.lean index 5e987e7ce3..afe78f6f0f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSourceObligations.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceSourceObligations.lean @@ -17,7 +17,7 @@ contribution to the time obligations in `prop:bootstrap`; the pressure and force-potential contributions are separate. -/ -@[expose] public section +public section section @@ -111,6 +111,7 @@ noncomputable section namespace CKN.Core.Step4 /-- The two-term bound for the sum of the centered tensor-source norms. -/ +@[expose] def originCenteredSourceMajorant (x : Vec3) (ρ : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (s : ℝ) : ℝ≥0∞ := let U := eLpNorm (fun y => vec3EuclideanNorm (u (y, s))) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTensorTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTensorTime.lean index 83015f8355..d04e02d314 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTensorTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTensorTime.lean @@ -16,7 +16,7 @@ in `eq:pressure-gradient-morrey` by the velocity cube. The mean oscillation argument follows the local estimate in `CKN.Pressure.Lin34SliceMeanFree`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTermTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTermTime.lean index 319041b223..1f14c4adcd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTermTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTermTime.lean @@ -18,7 +18,7 @@ The sum of source norms and the real tensor energy in `eq:pressure-gradient-morrey` are integrable on arbitrary interior time boxes. -/ -@[expose] public section +public section section @@ -235,6 +235,7 @@ noncomputable section namespace CKN.Core.Step4 /-- The sum of the three actual global centered-source norms. -/ +@[expose] def originCenteredSourceNorm (x : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (s : ℝ) : ℝ≥0∞ := ∑ i : Fin 3, eLpNorm (fun y => pressureDivergenceCutoffSourceCentredTensor diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeHolder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeHolder.lean index 5d2f535b48..751e1196d5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeHolder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeHolder.lean @@ -16,7 +16,7 @@ at exponent `6/5`. Velocity cubes and gradient squares enter with powers `1/5` power of the time-window measure. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeIntegrals.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeIntegrals.lean index 775c90d45b..d2c6ee36c9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeIntegrals.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTimeIntegrals.lean @@ -19,7 +19,7 @@ windows. Tonelli identifies these integrals with the carrier-restricted space-time mass without extending any data outside the carrier. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTranslatedSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTranslatedSlice.lean index c50efc648f..148fc3a412 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTranslatedSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceTranslatedSlice.lean @@ -21,7 +21,7 @@ The slice bound of `eq:pressure-gradient-morrey` therefore holds almost everywhere on the full interval, with its source radius unchanged. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeFinite.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeFinite.lean index 2637642c1d..66b04286ca 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeFinite.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeFinite.lean @@ -16,7 +16,7 @@ any local box from the spatial Sobolev data of `def:sws`, at almost every time of that box. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeTime.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeTime.lean index 750cdd933d..62c39736d4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellInstanceWholeTime.lean @@ -16,7 +16,7 @@ integrable in time at a fixed interior origin radius, on every local box of the solution interval. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellProducerSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellProducerSlice.lean index d1381ef084..d998886084 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellProducerSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginCellProducerSlice.lean @@ -16,7 +16,7 @@ the power integrals of its spatial slices. Consequently a bound on the `L^P` norm of almost every spatial slice controls the full cylinder power integral. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseBudget.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseBudget.lean index cabad6660e..db12eb30ac 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseBudget.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseBudget.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.OneSidedMorreyMonotone Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivative.lean index 986ea05f72..4f5ea92599 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivative.lean @@ -19,7 +19,7 @@ The finite-cover argument uses the same-repository collar assembly pattern; its backward patches include the final time without requiring future Morrey data. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeLocal.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeLocal.lean index 8fb6e08a14..464d313102 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeLocal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeLocal.lean @@ -17,7 +17,7 @@ specializes the same-repository fixed-source Morrey estimates to this geometry. The selected derivative is retained in the signed Riesz and remainder identity. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeShared.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeShared.lean index 6c9130f61c..6f37c483e0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeShared.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDerivativeShared.lean @@ -15,7 +15,7 @@ ball and the same cylinder scale. No symmetric enlargement of the time window or additional pressure estimate is needed. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDoubling.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDoubling.lean index fa8da5dadc..0e79dba3b3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDoubling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseDoubling.lean @@ -22,7 +22,7 @@ For centres in the closed origin cylinder, this construction is admissible through radius `(1 - R₁) / 2`, twice the origin margin scale. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseExhaustion.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseExhaustion.lean index 9f32674cc8..80f41c1c8b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseExhaustion.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseExhaustion.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set Metric diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseField.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseField.lean index 54ba2e5490..a2d451080b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseField.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseField.lean @@ -28,7 +28,7 @@ nor the slice bounds. The output also records the identification of the field with every slice weak gradient, which is what pins it almost everywhere. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGauge.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGauge.lean index 1be08c6599..e46a4b383f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGauge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGauge.lean @@ -17,7 +17,7 @@ cells use one pressure normalization in the clipped carrier integral. The argument is slicewise and requires no temporal integrability of the gauge. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped BigOperators ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGeometry.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGeometry.lean index f6e9c399a4..6f01b3e4e8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGeometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGeometry.lean @@ -28,7 +28,7 @@ transfer: cell bounds for the gradient *restricted to the backward carrier* give the Morrey cell output the estimate consumes. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGlue.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGlue.lean index d48b1f3d45..00735809a4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGlue.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGlue.lean @@ -24,7 +24,7 @@ This module records the gluing construction and the geometric facts about the unit domain hypothesis of the one-sided pressure estimate. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGrowth.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGrowth.lean index d1c91ae240..c008fc2374 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGrowth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseGrowth.lean @@ -21,7 +21,7 @@ The separate large-radius estimate is supplied by No estimate for the complete slice majorant is asserted here. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClausePairing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClausePairing.lean index d6d9975ecf..b8714f1954 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClausePairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClausePairing.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ScalingInvarianceTests Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseProduct.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseProduct.lean index 54429cfb24..96e96e9a56 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseProduct.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginClauseProduct.lean @@ -23,7 +23,7 @@ stated for an arbitrary spatial set and an arbitrary time set; no geometry of a ball or a backward time window is used. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPAffineSlot.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPAffineSlot.lean index 587d63e5e9..3b1614ff38 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPAffineSlot.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPAffineSlot.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientOneSid Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal @@ -79,6 +79,7 @@ velocity-gradient source. /-- The enlarged small-cell budget for the origin pressure-gradient estimate. With `c = |C_CZ| + 1` and `X = 3·KU·KD + forceSourceMorreyBound q ε` it is `c·3X + (c·3X)^{6/5} + c·128·ε^{4/5}`. -/ +@[expose] def originKPAffineASlot (q C_CZ ε : ℝ) (KU KD : ℝ≥0∞) : ℝ≥0∞ := ENNReal.ofReal (|C_CZ| + 1) * (3 * (3 * KU * KD + forceSourceMorreyBound q ε)) + (ENNReal.ofReal (|C_CZ| + 1) * @@ -88,7 +89,7 @@ def originKPAffineASlot (q C_CZ ε : ℝ) (KU KD : ℝ≥0∞) : ℝ≥0∞ := /-- The enlarged origin pressure-gradient majorant: the small-cell budget `originKPAffineASlot` together with the whole-carrier budget of `oneSidedPressureGradientKP'`, which carries the clipped-scale inflation. -/ -def oneSidedPressureGradientKPAffine +@[expose] def oneSidedPressureGradientKPAffine (q τ C_CZ R₀ R₁ ε : ℝ) (KU KD : ℝ≥0∞) : ℝ≥0∞ := oneSidedMorreyBound (6 / 5) (min ((1 / τ + 8 / 25)⁻¹) q) R₁ (originKPAffineASlot q C_CZ ε KU KD) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPComparison.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPComparison.lean index 760c38df1d..814d99e50a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPComparison.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPComparison.lean @@ -24,7 +24,7 @@ the velocity budgets. These are the numerical bounds a selected field is compared against. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicCells.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicCells.lean index 54ef894e61..10749cdd04 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicCells.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicCells.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SobolevPoincareRescale Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicMoment.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicMoment.lean index 8d08138185..6c77d43de1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicMoment.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginKPHarmonicMoment.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientHGClos Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal @@ -30,6 +30,7 @@ def originHarmonicSliceMajorant (C ρ : ℝ) (x : Vec3) (∫⁻ y in vec3Ball x ρ, ENNReal.ofReal |p (y,s)|) /-- The explicit coefficient of the harmonic majorant's time moment. -/ +@[expose] def originHarmonicMomentConstant (C ρ : ℝ) (x : Vec3) : ℝ≥0∞ := 16 * volume (vec3Ball x ρ) ^ (1/2 : ℝ) * (fixedRemainderCoefficients C ρ 0 ^ (3/2 : ℝ) + @@ -203,6 +204,7 @@ theorem origin_harmonic_majorant_clipped_time_of_sws /-- A collar-independent moment coefficient for source radii between `1/8` and `1`. It is an explicit function of the absolute harmonic coefficient. -/ +@[expose] def originHarmonicAbsoluteMomentConstant (C : ℝ) : ℝ≥0∞ := 16 * ENNReal.ofReal (Real.pi*4/3)^(1/2 : ℝ) * ((ENNReal.ofReal (4096*C))^(3/2 : ℝ) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginLatticeCover.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginLatticeCover.lean index d5afb30273..883ed0c9da 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginLatticeCover.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientOriginLatticeCover.lean @@ -17,7 +17,7 @@ Spatial mesh `r/2` and temporal mesh `r²/2` give a countable family of backward parabolic cells of radius `r` that covers the whole space-time. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal BigOperators @@ -27,6 +27,7 @@ namespace CKN.Core.Step4 attribute [local instance] Classical.propDecidable /-- The lattice with spatial mesh `r/2` and temporal mesh `r²/2`. -/ +@[expose] def originLatticeCentre (r : ℝ) (k : (Fin 3 → ℤ) × ℤ) : ParabolicPoint := (fun i => (r / 2) * (k.1 i : ℝ), (r ^ 2 / 2) * (k.2 : ℝ)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientProduct.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientProduct.lean index ba0cd2893b..3212d52ca9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientProduct.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientProduct.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientBase Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSWS.lean index 7c5b45d116..4a174aa552 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSWS.lean @@ -26,7 +26,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.SliceSelectedGradientS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSlice.lean index 46160db8ca..227309f46f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSlice.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.WeakDerivative Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSliceCZ.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSliceCZ.lean index 920f59f1b6..5c49d5079f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSliceCZ.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSliceCZ.lean @@ -21,7 +21,7 @@ family at that constant and the resulting slice bound, so the pressure gradient on a slice is controlled with no Calderón--Zygmund premise. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceBounds.lean index 0f5c85c6e4..ab7b490a38 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceBounds.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Measure.HolderTriplePr Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -31,6 +31,7 @@ namespace CKN.Core.Step4 /-- The product-rule source obtained after inserting a spatial cutoff into the quadratic tensor. The field `dη j` is the j-th spatial derivative of the cutoff; its analytic derivative estimate is passed at the use site. -/ +@[expose] def pressureDivergenceCutoffSource (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) (f : Vec3 → Vec3) : Vec3 → Vec3 := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceMorrey.lean index 47de8335b1..9da7d7043a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSourceMorrey.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientSource Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSymmetricCell.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSymmetricCell.lean index cf2dc944c6..d9bc6fc271 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSymmetricCell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/PressureGradientSymmetricCell.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallDisplays Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section @@ -74,7 +74,7 @@ the exact inner-ball interface consumed by `exists_spacetime_weak_gradient_of_sl This is the space-time form of the paper's display (3.5). -/ /-- Existence interface for pressure-gradient slices on symmetric interior parabolic balls. -/ -def symmetricPressureGradientSliceProducer : Prop := +@[expose] def symmetricPressureGradientSliceProducer : Prop := ∀ q : ℝ, 5 / 2 < q → ∀ {Ω : Set Vec3} {I : Set ℝ} {u : ParabolicPoint → Vec3} diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAAssembly.lean index 588fd3588a..406d9b78d7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAAssembly.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Minko Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -70,7 +70,7 @@ Morrey membership, so it carries no Calderón--Zygmund constant: the construction that discharges this interface, not to its statement. -/ /-- Pressure-gradient construction interface used in the Morrey bootstrap route. -/ -def routeAGradientProducer : Prop := +@[expose] def routeAGradientProducer : Prop := ∀ q : ℝ, 5 / 2 < q → ∀ {Ω : Set Vec3} {I : Set ℝ} {u : ParabolicPoint → Vec3} diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAFirstRoundConsumer.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAFirstRoundConsumer.lean index 3a445b6e95..7d7fc3678c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAFirstRoundConsumer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAFirstRoundConsumer.lean @@ -19,7 +19,7 @@ first-round exponents `(6/5, 25/11)` and `(3, 25/6)`. The last of these is remaining inputs. -/ -@[expose] public section +public section open MeasureTheory Set Metric open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniform.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniform.lean index c64b559467..da35e211e0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniform.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniform.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallBasics Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -41,7 +41,7 @@ as the base point of that family. /-- The slicewise `L^{6/5}` pressure-gradient production on the symmetric ball, with the incoming velocity Morrey exponent `τ` free. The conclusion does not mention `τ`: only the hypothesis on `u` does. -/ -def symmetricPressureGradientSliceProducerUniform : Prop := +@[expose] def symmetricPressureGradientSliceProducerUniform : Prop := ∀ q τ : ℝ, 5 / 2 < q → 25 / 3 ≤ τ → τ ≤ 25 → ∀ {Ω : Set Vec3} {I : Set ℝ} {u : ParabolicPoint → Vec3} @@ -65,7 +65,7 @@ def symmetricPressureGradientSliceProducerUniform : Prop := /-- The Route A pressure-gradient producer at a free velocity exponent. This is the statement consumed by the regularity provider for every `τ` that the bootstrap of `prop:bootstrap` visits. -/ -def routeAGradientProducerUniform : Prop := +@[expose] def routeAGradientProducerUniform : Prop := ∀ q τ : ℝ, 5 / 2 < q → 25 / 3 ≤ τ → τ ≤ 25 → ∀ {Ω : Set Vec3} {I : Set ℝ} {u : ParabolicPoint → Vec3} {Du : ParabolicPoint → Fin 3 → Vec3} diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformExponents.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformExponents.lean index 56b69472c1..978b3c33df 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformExponents.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformExponents.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Real Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformMorrey.lean index def01e3215..a17925929d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAGradientProducerUniformMorrey.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Inclu Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAOneRoundFinal.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAOneRoundFinal.lean index de272b5f8c..2ed37a23b8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAOneRoundFinal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/RouteAOneRoundFinal.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.CarrierLocalAE Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section @@ -43,7 +43,7 @@ namespace CKN.Core.Step4 theorem. Its test functions are supported in the same local product box as the cutoff. -/ /-- Heat-potential representation interface with an explicitly selected weak pressure gradient. -/ -def routeAGradientSlotRepresentation : Prop := +@[expose] def routeAGradientSlotRepresentation : Prop := ∀ {Ω : Set Vec3} {I : Set ℝ} {q : ℝ} {u : ParabolicPoint → Vec3} {Du : ParabolicPoint → Fin 3 → Vec3} {p : ParabolicPoint → ℝ} {f : ParabolicPoint → Vec3}, @@ -85,7 +85,7 @@ namespace CKN.Core.Step4 boundary until its general construction lands. Its two support fields are deliberately symmetric-ball fields, matching BallBootstrap. -/ /-- Final localized-source integrability and Morrey estimates required by the bootstrap route. -/ -def routeAFinalSourcePackage : Prop := +@[expose] def routeAFinalSourcePackage : Prop := ∀ {Ω : Set Vec3} {I : Set ℝ} {q : ℝ} {u : ParabolicPoint → Vec3} {Du : ParabolicPoint → Fin 3 → Vec3} {p : ParabolicPoint → ℝ} {f : ParabolicPoint → Vec3}, diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradient.lean index 54fd17fc4f..2aabebf2a4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradient.lean @@ -25,7 +25,7 @@ The harmonic term is taken from the interior gradient display, whose integrated over the half ball. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientAssembly.lean index b1c2573fe3..d5154334e4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientAssembly.lean @@ -25,7 +25,7 @@ set, which is the coordinate weak gradient of the pressure slice there, and whose coordinate norms obey the three-term bound of display (3.5). -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSBounds.lean index 97fa8435d0..07215eef07 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSBounds.lean @@ -16,7 +16,7 @@ mean-component bounds, and the localized force estimate used in All coefficients are explicit and independent of the solution. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -28,7 +28,7 @@ namespace CKN.Core.Step4 /-- The uncentred source majorant in `eq:pressure-gradient-decomposition`, using the native vector norms of the velocity, gradient, and force slices. -/ -def centredSWSUncentredMajorant (x : Vec3) (ρ q : ℝ) +@[expose] def centredSWSUncentredMajorant (x : Vec3) (ρ q : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (f : ParabolicPoint → Vec3) (s : ℝ) : ℝ≥0∞ := let μ := volume.restrict (vec3Ball x ρ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSData.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSData.lean index 2ffc7fc815..f63c2f6aea 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSData.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSData.lean @@ -22,7 +22,7 @@ norms, weak gradients, and zero trace used in `eq:pressure-gradient-decompositio The exceptional set is chosen before quantifying over spatial test functions. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSFinal.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSFinal.lean index ab8853d433..c8c7203076 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSFinal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSFinal.lean @@ -17,7 +17,7 @@ All slice inputs to the unconditional gradient selector are supplied by solution, and the source is the force-free centred tensor source. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSSource.lean index c438f29640..600e967c65 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSWSSource.lean @@ -14,7 +14,7 @@ The local norm data of `def:sws` give compactly supported `L^{6/5}` sources and the explicit centred majorant used in `eq:pressure-gradient-decomposition`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -26,7 +26,7 @@ namespace CKN.Core.Step4 /-- The global componentwise source majorant in `eq:pressure-gradient-decomposition`, including the constant-mean correction and the localized force norm. -/ -def centredSWSCentredMajorant (x : Vec3) (ρ q : ℝ) +@[expose] def centredSWSCentredMajorant (x : Vec3) (ρ q : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (f : ParabolicPoint → Vec3) (s : ℝ) : ℝ≥0∞ := let μ := volume.restrict (vec3Ball x ρ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSource.lean index 2f5830cd34..81d11ee37b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSource.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.SourceMorreySlice Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -39,6 +39,7 @@ uncentred source is zero while the centred tensor has a nonzero `(0,0)` entry. -/ /-- The centred divergence-form source paired with `pressureUTensor u c`. -/ +@[expose] def pressureDivergenceCutoffSourceCentred (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) (f : Vec3 → Vec3) @@ -47,6 +48,7 @@ def pressureDivergenceCutoffSourceCentred dη j x * u x i * (u x j - c j)) - η x * f x i /-- Alias used by the source-Morrey and slice-selection interfaces. -/ +@[expose] def sourceMorreyCutoffVCentred (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) (f : Vec3 → Vec3) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensor.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensor.lean index a2e4f95e14..e1146b7314 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensor.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensor.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34CentredCorrection Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensorDef.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensorDef.lean index 5150d4bff6..29c5a17cf0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensorDef.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCentredSourceTensorDef.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.SliceSelectedGradientC Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -33,6 +33,7 @@ pressure contribution. -/ /-- Force-free centred divergence-form source paired with `η · pressureUTensor`. -/ +@[expose] def pressureDivergenceCutoffSourceCentredTensor (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) @@ -41,6 +42,7 @@ def pressureDivergenceCutoffSourceCentredTensor dη j x * u x i * (u x j - c j)) /-- Source-Morrey alias for `pressureDivergenceCutoffSourceCentredTensor`. -/ +@[expose] def sourceMorreyCutoffVCentredTensor (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) @@ -48,6 +50,7 @@ def sourceMorreyCutoffVCentredTensor pressureDivergenceCutoffSourceCentredTensor η dη u Du c /-- Spacetime force-free source with a time-dependent spatial mean. -/ +@[expose] def sourceMorreyCutoffVCentredTensorSpacetime (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCorrectedSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCorrectedSWS.lean index 3447414613..fa5d0dba39 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCorrectedSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientCorrectedSWS.lean @@ -17,7 +17,7 @@ suitable-solution data. The resulting quantitative slice estimate is in the form used to transfer a doubled-scale bound to cell data. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForce.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForce.lean index 26da4181b3..ba5c79a995 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForce.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForce.lean @@ -21,7 +21,7 @@ the force section; this file only converts it into the weak-gradient shape that display (3.5) consumes. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceHolder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceHolder.lean index 77d6b9dafc..c1bcc193d6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceHolder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceHolder.lean @@ -17,7 +17,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceP8.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceP8.lean index c059c924fa..96cb1d36a8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceP8.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceP8.lean @@ -28,7 +28,7 @@ measured in the Euclidean norm, is controlled by the `L¹` size of the annular density with a constant that is uniform in the ball and its centre. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceSlices.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceSlices.lean index 54d7ae7c4b..df3b4b56c9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceSlices.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceSlices.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Measure.SupportRestric Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceUnconditional.lean index 859df0fb3c..057b12186e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientForceUnconditional.lean @@ -28,7 +28,7 @@ there is its weak gradient. Adding the two produces one slice field, in `L^{6/5}` of the inner ball with the `ρ^{-1/2}` weight of display (3.5). -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -217,7 +217,7 @@ theorem sliceForceGradientConstant_nonneg : 0 ≤ sliceForceGradientConstant := /-- The `L^{6/5}` size of the force slot of display (3.5) on one time slice: the Calderón–Zygmund norm of the cut-off force together with the `ρ^{-1/2}`-weighted `L¹` norm of the force on the ball. -/ -noncomputable def sliceForceGradientBound (C_CZ C₈ : ℝ) (x₀ : Vec3) {ρ : ℝ} +@[expose] noncomputable def sliceForceGradientBound (C_CZ C₈ : ℝ) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (f : ParabolicPoint → Vec3) (s : ℝ) : ℝ := C_CZ * (∑ j : Fin 3, lpNorm (fun y : Vec3 => mollifiedBallCutoff x₀ hρ y * f (y, s) j) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientIdentification.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientIdentification.lean index 422708f686..1c2d4acfc9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientIdentification.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientIdentification.lean @@ -32,7 +32,7 @@ harmonic on `ℝ³`, and the whole-space Liouville theorem with local `L^{3/2}` linear growth identifies them almost everywhere. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputs.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputs.lean index b6e468851b..9cf964bad6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputs.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputs.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.HarmonicRemainderSliceSW Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputsCentred.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputsCentred.lean index 44553958b4..569e846700 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputsCentred.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientInputsCentred.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -30,6 +30,7 @@ noncomputable section namespace CKN.Core.Step4 /-- The spatial velocity mean used in the centred source at each time. -/ +@[expose] def sourceSliceCentredMean (x : Vec3) (ρ : ℝ) (u : ParabolicPoint → Vec3) : ℝ → Vec3 := fun s j => average (volume.restrict (vec3Ball x ρ)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientPotential.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientPotential.lean index a78f5ac4fe..493549651d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientPotential.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientPotential.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.LeibnizLaplacian Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRegularity.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRegularity.lean index 6249e65c48..4886c47745 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRegularity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRegularity.lean @@ -22,7 +22,7 @@ pressure part is `C¹` on `B_{ρ/2}(x₀)`, so its weak gradient there is its classical gradient. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRemainder.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRemainder.lean index 25290071fa..09f7f64dcb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRemainder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientRemainder.lean @@ -20,7 +20,7 @@ weak partial derivatives add along an a.e. decomposition of the carrier, and a coordinate field obeying a pointwise gradient display is controlled in `L^(6/5)` on the half ball. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWS.lean index c2c098437b..f3cd3014df 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWS.lean @@ -26,7 +26,7 @@ divergence-form characterization of the slice source `V` and the distributional divergence-freedom of the force in space-time. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSFinal.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSFinal.lean index 6ff7b9f8e2..38f90428b2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSFinal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSFinal.lean @@ -17,7 +17,7 @@ The preceding slice theorem takes the weak-gradient construction as an explicit solution-level statement without an analytic Calderón–Zygmund premise. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSUnconditional.lean index 90d6386dbe..91bf4dc182 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSWSUnconditional.lean @@ -28,7 +28,7 @@ discharges the third from the force data of the solution alone: the bound gains the `ρ^{-1/2}`-weighted force term `sliceForceGradientBound`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientScaling.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientScaling.lean index 2b32b5ba5f..9e75c161c5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientScaling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientScaling.lean @@ -23,7 +23,7 @@ The only input is the closed formula for the volume of a Euclidean ball in three dimensions, `volume_vec3Ball_eq`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSymmetricGeometry.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSymmetricGeometry.lean index 4e5e4f6e40..aa4a2fed1e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSymmetricGeometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientSymmetricGeometry.lean @@ -25,7 +25,7 @@ The module contains no analytic content: it is pure parabolic geometry, and its statements are used only to rewrite membership between the one-sided and symmetric carriers. -/ -@[expose] public section +public section open MeasureTheory Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSource.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSource.lean index 9b0f18ca92..21f25aa690 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSource.lean @@ -15,7 +15,7 @@ negative divergence of the cutoff tensor. The force belongs to the seventh and eighth potentials. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSourcePairing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSourcePairing.lean index e33612f37a..6722605eaf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSourcePairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SliceSelectedGradientTensorSourcePairing.lean @@ -17,7 +17,7 @@ quadratic product, subtracting its constant-vector correction, and using the vanishing trace of the weak velocity gradient. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyData.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyData.lean index 9c61ca3f8e..567b187a4e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyData.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyData.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Minko Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRound.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRound.lean index c55514f51d..aa15d462e7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRound.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRound.lean @@ -25,7 +25,7 @@ of both sources outside the half ball. The centre and radius are arbitrary and the carrier is the symmetric parabolic ball, not a one-sided cylinder. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundCutoff.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundCutoff.lean index f40dae1e9d..64dafb1459 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundCutoff.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundCutoff.lean @@ -22,7 +22,7 @@ admits a smooth cutoff equal to one on the inner quarter-ball, supported inside the three-eighths-ball, and contained in the product box of half radius. -/ -@[expose] public section +public section open Set Metric open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundNorms.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundNorms.lean index 8f3e875128..59ccd07d7f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundNorms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundNorms.lean @@ -23,7 +23,7 @@ velocity itself, so its integrability exponent stays at `3`: it is estimated in `M^{3,25/6}` directly, by lowering only the Morrey exponent from `25/3`. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundSupport.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundSupport.lean index c3f30bd731..2c7b0f9cd2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundSupport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyFirstRoundSupport.lean @@ -22,7 +22,7 @@ exponents: a lowering step for the pair of exponents, and the local integrability that a finite Morrey norm supplies. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradient.lean index e1c1229810..f7105e9ddf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradient.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step3.DuhamelAdjoint Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -35,6 +35,7 @@ place `p * φ` in the spatial derivative slot and therefore have a different Morrey order. -/ /-- Localized scalar heat source after subtracting the cutoff times the weak pressure gradient. -/ +@[expose] def localizedGradientSourceG (φ : ParabolicPoint → ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (f : ParabolicPoint → Vec3) (Dp : ParabolicPoint → Vec3) : @@ -42,12 +43,13 @@ def localizedGradientSourceG (φ : ParabolicPoint → ℝ) fun z i => localizedEquationG φ u Du f z i - φ z * Dp z i /-- Localized divergence source in the pressure-gradient formulation of the heat equation. -/ +@[expose] def localizedGradientSourceH (φ : ParabolicPoint → ℝ) (u : ParabolicPoint → Vec3) : Fin 3 → ParabolicPoint → Vec3 := localizedEquationH φ u /-- Componentwise vector heat potential of scalar and divergence sources. -/ -def vectorHeatPotential (F : ParabolicPoint → Vec3) +@[expose] def vectorHeatPotential (F : ParabolicPoint → Vec3) (G : Fin 3 → ParabolicPoint → Vec3) : ParabolicPoint → Vec3 := fun z i => heatPotential (fun w => F w i) (fun j w => G j w i) z diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientInstances.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientInstances.lean index a342e23055..aac4a77bc8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientInstances.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientInstances.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.SourceComponents Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Metric open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientPackage.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientPackage.lean index 2c7c98aa98..ea7d5d7c5b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientPackage.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreyGradientPackage.lean @@ -21,7 +21,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallDisplays Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreySlice.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreySlice.lean index 15b7915bea..454a4079c1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreySlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/SourceMorreySlice.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.PressureGradientSource Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -29,6 +29,7 @@ spatial cutoff. These bounds are source estimates only; they do not select a weak pressure gradient or prove its spacetime pairing. -/ /-- Cutoff pressure-Poisson source used to estimate the selected gradient in Morrey spaces. -/ +@[expose] def sourceMorreyCutoffV (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) (f : Vec3 → Vec3) : Vec3 → Vec3 := diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTActualPressureIdentification.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTActualPressureIdentification.lean index 4efad6d961..d2db467f8d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTActualPressureIdentification.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTActualPressureIdentification.lean @@ -16,7 +16,7 @@ locally integrable weak derivatives identifies it on the intersection of the consumer carrier and the local pressure ball, on one common time set. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators @@ -105,6 +105,7 @@ theorem raw_divergence_source_memLp_ae_of_sws /-- The explicit complementary gradient after replacing the centred source by the raw source on the outer origin ball. -/ +@[expose] def rawCorrectedPressureRemainder (R₀ : ℝ) (z : ParabolicPoint) {ρ : ℝ} (hρ : 0 < ρ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTBoundedRepresentative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTBoundedRepresentative.lean index 657a1fbf9f..7022b63be8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTBoundedRepresentative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTBoundedRepresentative.lean @@ -14,7 +14,7 @@ changed on a null set to obey that bound at every spatial point on almost every time slice. This preserves its value on the prescribed carrier. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCaccioppoliQuantitative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCaccioppoliQuantitative.lean index 85c416ef0a..1966c8ce98 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCaccioppoliQuantitative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCaccioppoliQuantitative.lean @@ -17,7 +17,7 @@ upper bound. Applying the display on a doubled interior cylinder produces an explicit energy coefficient before any solution is chosen. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCentredSourceCorrection.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCentredSourceCorrection.lean index d3889b9eee..e5d06e3961 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCentredSourceCorrection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCentredSourceCorrection.lean @@ -16,7 +16,7 @@ and spatial-mean terms. Linearity transports this explicit correction to the completed spatial Riesz operators. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology BigOperators @@ -25,6 +25,7 @@ noncomputable section namespace CKN.Core.Step4 /-- The cutoff and mean correction relative to a raw source on `B`. -/ +@[expose] def centredRawSourceCorrection (B : Set Vec3) (η : Vec3 → ℝ) (dη : Fin 3 → Vec3 → ℝ) (u f : Vec3 → Vec3) (Du : Vec3 → Fin 3 → Vec3) (c : Vec3) diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCollarAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCollarAssembly.lean index ea8f0b04f4..9392925cfb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCollarAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTCollarAssembly.lean @@ -21,7 +21,7 @@ bounds to one measurable field. The only external analytic input is the fixed harmonic and far-force remainder's temporal majorant. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTDecompositionMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTDecompositionMorrey.lean index 34cf92c2cb..5b4ea17ba0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTDecompositionMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTDecompositionMorrey.lean @@ -18,7 +18,7 @@ Finite sums of the completed source fields and the measurable remainder control the same identified pressure field on its target carrier. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedForceMorrey.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedForceMorrey.lean index 96674a3714..8c7c31c955 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedForceMorrey.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedForceMorrey.lean @@ -17,7 +17,7 @@ Morrey class. The cutoff is bounded by one, and no spatial supremum bound on the force is used. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedPairing.lean index 27c433a56f..c9af511517 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedPairing.lean @@ -13,7 +13,7 @@ Integrability of the same selected field on the inner carrier upgrades its slice weak derivative identity to the full-space test-function pairing. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedSelection.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedSelection.lean index 9ca4954a76..62eee5fb5a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedSelection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFixedSelection.lean @@ -16,7 +16,7 @@ chosen from suitability. Their measurable remainder represents the classical harmonic and far-force gradient on almost every slice of the target carrier. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTForceMassEnvelope.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTForceMassEnvelope.lean index 24b188a7ee..bbec34567a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTForceMassEnvelope.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTForceMassEnvelope.lean @@ -14,7 +14,7 @@ Spatial boundedness on the half-collar and Holder's inequality in space and time retain the force data power without an additive constant. -/ -@[expose] public section +public section section @@ -66,6 +66,7 @@ theorem four_term_slice_mass_le {μ : Measure Vec3} {D A B C E : Vec3 → ℝ} exact (ENNReal.rpow_le_rpow hh (by norm_num)).trans (four_term_six_fifths _ _ _ _) /-- The absolute enlargement pays the triangle cost and all four component budgets. -/ +@[expose] def fourTermAffineThreshold (Cbase : ℝ) : ℝ := 64*(|Cbase|+1) /-- Four component bounds at the base constant fit the enlarged affine slot. -/ @@ -133,7 +134,7 @@ noncomputable section namespace CKN.Core.Step4 /-- An explicit absolute threshold for the force-potential increment. -/ -def gapForceIncrementThreshold : ℝ := 5 * gapForceIncrementCoefficient +@[expose] def gapForceIncrementThreshold : ℝ := 5 * gapForceIncrementCoefficient end CKN.Core.Step4 end diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFourTermIdentification.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFourTermIdentification.lean index 6371408ab0..4e66434ef7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFourTermIdentification.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTFourTermIdentification.lean @@ -9,7 +9,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Step4.WeakGradientGluingTGap /-! # Four-term identification on interior collars -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTGapForceIncrement.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTGapForceIncrement.lean index 26de8d3939..4ef6ec74b8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTGapForceIncrement.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTGapForceIncrement.lean @@ -15,7 +15,7 @@ annular force potential. Its coefficient is uniform for collars of radius at least one over 128, without an additive data-independent remainder. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology BigOperators @@ -24,6 +24,7 @@ noncomputable section namespace CKN.Core.Step4 /-- The force-potential increment in the actual pressure decomposition. -/ +@[expose] def gapForceIncrement (z : ParabolicPoint) {ρ : ℝ} (hρ : 0 < ρ) (u : ParabolicPoint → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) (i : Fin 3) (w : ParabolicPoint) : ℝ := @@ -33,7 +34,7 @@ def gapForceIncrement (z : ParabolicPoint) {ρ : ℝ} (hρ : 0 < ρ) classicalGradient (harmonicPressurePart η u c p w.2) w.1 i /-- An absolute coefficient for the force increment on either half-gap collar. -/ -def gapForceIncrementCoefficient : ℝ := +@[expose] def gapForceIncrementCoefficient : ℝ := 400 * sliceForcePotentialConstant * cutoffGradientConstant * (128 : ℝ)^3 /-- The absolute force-increment coefficient is nonnegative. -/ diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTHarmonicMassEnvelope.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTHarmonicMassEnvelope.lean index 7a13d9601f..4758e129e3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTHarmonicMassEnvelope.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTHarmonicMassEnvelope.lean @@ -14,7 +14,7 @@ The collar floor is `1/128`. The larger absolute moment coefficient is chosen before the numerical data and the suitable solution. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTInstanceInteriorCollar.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTInstanceInteriorCollar.lean index 03e5c8007b..e8eed2bf51 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTInstanceInteriorCollar.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTInstanceInteriorCollar.lean @@ -14,7 +14,7 @@ in the closed inner carrier, so the actual pressure gradient admits the raw-source decomposition on that collar. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTMeasurableFourTermAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTMeasurableFourTermAssembly.lean index 4905541660..9069fc9843 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTMeasurableFourTermAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTMeasurableFourTermAssembly.lean @@ -21,7 +21,7 @@ Only the final centred-source correction needs a mass bound without any joint measurability assumption. -/ -@[expose] public section +public section section @@ -58,18 +58,18 @@ namespace CKN.Core.Step4 /-- The scale-free part of the far-force gradient coefficient of display (3.5): the numeral `400 = (3/20)⁻²` of the separation of `lem:cutoff`, the order-one constant of `eq:har-Ck`, and the cutoff gradient constant. -/ -def originASlotForceIncrementConstant : ℝ := +@[expose] def originASlotForceIncrementConstant : ℝ := 400 * sliceForcePotentialConstant * cutoffGradientConstant /-- The far-force gradient coefficient at collar radii at least `1/128`, where the scale factor `ρ⁻³` of display (3.5) is at most `128³`. -/ -def originASlotForceIncrementCoefficient : ℝ := +@[expose] def originASlotForceIncrementCoefficient : ℝ := originASlotForceIncrementConstant * (128 : ℝ) ^ 3 /-- The absolute Calderón–Zygmund threshold at which the affine slot pays for the far-force increment: the coefficient of display (3.5) times the cell-volume factor `4π/3 ≤ 5`. -/ -def originASlotForceIncrementThreshold : ℝ := +@[expose] def originASlotForceIncrementThreshold : ℝ := 5 * originASlotForceIncrementCoefficient end CKN.Core.Step4 diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorant.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorant.lean index 7183cc5439..ad242047d5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorant.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorant.lean @@ -19,7 +19,7 @@ force integral. Their finite time moments follow from local suitability on one fixed cylinder, without a pressure oscillation estimate on smaller cells. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorantQuantitative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorantQuantitative.lean index 53c4b84eff..71e01163ef 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorantQuantitative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRemainderMajorantQuantitative.lean @@ -15,7 +15,7 @@ replacing it by its essential supremum in time. The calculus and integral estimates are adapted from `CKN.Pressure.HarmonicPartBoundsAE`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -447,7 +447,7 @@ theorem three_terms_power_bound (a b c : ℝ≥0∞) : _ = _ := by ring /-- The three coefficients of the slice-energy, pressure, and force integrals. -/ -def fixedRemainderCoefficients (C ρ : ℝ) : Fin 3 → ℝ≥0∞ := ![ +@[expose] def fixedRemainderCoefficients (C ρ : ℝ) : Fin 3 → ℝ≥0∞ := ![ ENNReal.ofReal (C * ρ ^ (-3 : ℝ) / ρ), ENNReal.ofReal (C * ρ ^ (-3 : ℝ) / ((Real.pi * 4 / 3) ^ (1/3 : ℝ) * ρ)), ENNReal.ofReal |400 * sliceForcePotentialConstant * (cutoffGradientConstant / ρ) * (ρ ^ 2)⁻¹|] @@ -463,6 +463,7 @@ def fixedRemainderSliceMajorant (C ρ : ℝ) (x : Vec3) (∫⁻ y in vec3Ball x ρ, ENNReal.ofReal (vec3EuclideanNorm (f (y,s)))) /-- An explicit coefficient for the `3/2` time moment on a fixed collar. -/ +@[expose] def fixedRemainderMomentConstant (C ρ : ℝ) (x : Vec3) : ℝ≥0∞ := 16 * volume (vec3Ball x ρ) ^ (1/2 : ℝ) * (fixedRemainderCoefficients C ρ 0 ^ (3/2 : ℝ) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszIdentification.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszIdentification.lean index 8b475d903d..19a767cff1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszIdentification.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszIdentification.lean @@ -16,7 +16,7 @@ force has the opposite sign. Uniqueness identifies these terms with an already chosen weak pressure derivative. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal BigOperators Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSelection.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSelection.lean index 14292c74d5..f762218908 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSelection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSelection.lean @@ -17,7 +17,7 @@ the negatives of the completed Riesz operator, so measurable derivative selection gives representatives of that operator with the correct sign. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSourceQuantitative.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSourceQuantitative.lean index 7f94cd272d..b819366785 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSourceQuantitative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTRieszSourceQuantitative.lean @@ -19,7 +19,7 @@ A uniform endpoint coefficient puts the localized divergence source into the affine cell budget; the source contains both convection and force. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSourceMeasurable.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSourceMeasurable.lean index f57fd97303..b1c8a72b86 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSourceMeasurable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSourceMeasurable.lean @@ -15,7 +15,7 @@ restricted to the fixed time window and spatial ball before the completed operators are selected. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal BigOperators Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableIdentification.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableIdentification.lean index 4cc1f19dd5..149f68acd8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableIdentification.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableIdentification.lean @@ -17,7 +17,7 @@ Every locally integrable weak pressure derivative agrees with their signed completed-operator decomposition on almost every slice. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal BigOperators Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableRiesz.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableRiesz.lean index 76b41bebb6..18f08fbb5e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableRiesz.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableRiesz.lean @@ -15,7 +15,7 @@ window. The selected operator fields satisfy the completed-operator identity on the full spatial space at almost every time, including the zero extension. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableSelection.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableSelection.lean index 7ca448952f..3323e7abc2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableSelection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTSuitableSelection.lean @@ -18,7 +18,7 @@ on a larger ball. Measurable selection fixes one field on the inner ball before any smaller cells or quantitative estimates are considered. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTWindowSelection.lean b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTWindowSelection.lean index a9e8d0bfb7..526932bbc5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTWindowSelection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/Step4/WeakGradientGluingTWindowSelection.lean @@ -16,7 +16,7 @@ integrable slices almost everywhere when the original slices are integrable on that window. Its completed Riesz representative is selected on all times. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Route.lean b/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Route.lean index 8a2b9be9cc..d3cb219c60 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Route.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Route.lean @@ -36,7 +36,7 @@ here: it additionally requires the causal localization and source estimates of Step 3, through the top time face. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Start.lean b/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Start.lean index db9474b533..2362f6e03b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Start.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Core/TheoremA/Start.lean @@ -20,7 +20,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.Theta Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Covering/TheoremCReductionClosed.lean b/LeanPool/CaffarelliKohnNirenberg/Covering/TheoremCReductionClosed.lean index b77a314182..4cc2cb4a99 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Covering/TheoremCReductionClosed.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Covering/TheoremCReductionClosed.lean @@ -19,7 +19,7 @@ parabolic one dimensional Hausdorff measure. The criterion is supplied as a hypothesis so that a later regularity theorem can instantiate it directly. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Ambient/Euclidean.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Ambient/Euclidean.lean index 4510b054cd..3b0e123a3c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Ambient/Euclidean.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Ambient/Euclidean.lean @@ -20,7 +20,7 @@ body of `spaceEuclideanNorm` is kept definitionally identical to the finite-sum expression used by the parabolic spatial norm. -/ -@[expose] public section +public section namespace CKN @@ -28,6 +28,7 @@ namespace CKN abbrev Space := Vec 3 /-- The Euclidean length given by the finite sum of coordinate squares. -/ +@[expose] noncomputable def spaceEuclideanNorm (x : Space) : ℝ := Real.sqrt (∑ k, x k ^ 2) theorem space_norm_le_euclideanNorm (x : Space) : diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZCylinderBridge.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZCylinderBridge.lean index af505378c1..37d0c39462 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZCylinderBridge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZCylinderBridge.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.TimeHolder Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecomposition.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecomposition.lean index 439c1edfb8..823c3e12e4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecomposition.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecomposition.lean @@ -20,7 +20,7 @@ the good/bad part argument. Its geometry is native to `Vec3`; no alternate Euclidean carrier is introduced. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology @@ -127,6 +127,7 @@ private theorem dyadicAncestor_eq_of_intersect_of_scale_le exact ⟨x, hsubset hxR, hxQ⟩ /-- Half-open geometric cube represented by a dyadic index. -/ +@[expose] def dyadicCubeSet (Q : DyadicIndex) : Set Vec3 := dyadicCube Q.scale Q.corner @@ -135,29 +136,34 @@ def dyadicParentSet (Q : DyadicIndex) : Set Vec3 := dyadicCubeSet (dyadicParent Q) /-- Signed average of a scalar function on a dyadic cube. -/ +@[expose] def dyadicAverage (F : Vec3 → ℝ) (Q : DyadicIndex) : ℝ := ⨍ x in dyadicCubeSet Q, F x /-- Average absolute value on a dyadic cube, used in the stopping criterion. -/ +@[expose] def dyadicAbsAverage (F : Vec3 → ℝ) (Q : DyadicIndex) : ℝ := ⨍ x in dyadicCubeSet Q, |F x| /-- Extended nonnegative integral of the absolute value for the dyadic decomposition. -/ +@[expose] def dyadicL1Norm (F : Vec3 → ℝ) : ℝ≥0∞ := ∫⁻ x, ENNReal.ofReal |F x| /-- Membership in the union of a chosen family of dyadic cubes. -/ +@[expose] def dyadicCubeMember (D : Set DyadicIndex) (x : Vec3) : Prop := ∃ Q, Q ∈ D ∧ x ∈ dyadicCubeSet Q /-- Good part obtained by replacing the function by its average on each selected cube. -/ -noncomputable def dyadicGoodPart (F : Vec3 → ℝ) (D : Set DyadicIndex) : Vec3 → ℝ := by +@[expose] noncomputable def dyadicGoodPart (F : Vec3 → ℝ) (D : Set DyadicIndex) : Vec3 → ℝ := by classical exact fun x => if hx : dyadicCubeMember D x then dyadicAverage F (Classical.choose hx) else F x /-- Mean-zero bad part supported on one selected dyadic cube. -/ +@[expose] def dyadicBadPart (F : Vec3 → ℝ) (Q : DyadicIndex) : Vec3 → ℝ := (dyadicCubeSet Q).indicator (fun x => F x - dyadicAverage F Q) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecompositionExistence.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecompositionExistence.lean index baa26e28f1..d9e99e75ea 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecompositionExistence.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZDecompositionExistence.lean @@ -15,7 +15,7 @@ decomposition structure. The good and bad parts are integrated directly over the disjoint cube family. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZInputs.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZInputs.lean index ade6065603..3c74636248 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZInputs.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZInputs.lean @@ -26,7 +26,7 @@ kept as an explicit a.e. input until the distributional identification and the endpoint estimates are available together. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -41,11 +41,13 @@ open CKN open CKN.Foundation.Parabolic /-- The real-valued operator constant at exponent `3 / 2`. -/ +@[expose] def czP1Constant (A₁ A₂ : ℝ) : ℝ := (ENNReal.ofReal (rieszSecondInterpolationConstant A₁ A₂ ((3 : ℝ) / 2))) ^ (2 / 3 : ℝ) |>.toReal /-- The real-valued component constant at exponent `6 / 5`. -/ +@[expose] def czGradientComponentConstant (A₁ A₂ : ℝ) : ℝ := (ENNReal.ofReal (rieszSecondInterpolationConstant A₁ A₂ ((6 : ℝ) / 5))) ^ (5 / 6 : ℝ) |>.toReal @@ -120,7 +122,7 @@ theorem eLpNorm_bound_of_l2_interpolation simpa only [ENNReal.toReal_ofReal hp0.le] using hres /-- Build extension data from subadditivity, weak-(1,1), measurability and an L² bound. -/ -def l2ExtensionInput +@[expose] def l2ExtensionInput {T : (Vec3 → ℝ) → Vec3 → ℝ} {A₁ A₂ p : ℝ} (hTsub : ∀ f g, Measurable f → Integrable f volume → MemLp f 2 volume → Measurable g → MemLp g 2 volume → ∀ᵐ x ∂volume, |T (f + g) x| ≤ @@ -202,7 +204,7 @@ def l2ExtensionInput eLpNorm_congr_ae hf.coeFn_toLp, K, lpNorm] using hlp /-- Extension data for a second Riesz transform obtained by interpolation below exponent two. -/ -def rieszSecondExtensionInput +@[expose] def rieszSecondExtensionInput {i j : Fin 3} {p A₁ : ℝ} (hL2 : RieszSecondL2Input i j) (hWeak11 : ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → @@ -234,7 +236,7 @@ def rieszSecondExtensionInput hK /-- The extension input for the scalar pressure operator at exponent 3 / 2. -/ -def rieszSecondP1ExtensionInput {i j : Fin 3} +@[expose] def rieszSecondP1ExtensionInput {i j : Fin 3} (hL2 : RieszSecondL2Input i j) (hWeak11 : ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → ∀ l : ℝ, 0 < l → @@ -255,7 +257,7 @@ def rieszSecondP1ExtensionInput {i j : Fin 3} positivity) (by norm_num) (by norm_num) hK) /-- The extension input for one scalar gradient component at exponent 6 / 5. -/ -def rieszSecondGradientExtensionInput {i j : Fin 3} +@[expose] def rieszSecondGradientExtensionInput {i j : Fin 3} (hL2 : RieszSecondL2Input i j) (hWeak11 : ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → ∀ l : ℝ, 0 < l → @@ -277,7 +279,7 @@ def rieszSecondGradientExtensionInput {i j : Fin 3} positivity) (by norm_num) (by norm_num) hK) /-- The scalar pressure operator after completion from the L2 carrier. -/ -def rieszSecondP1ExtensionOperator {i j : Fin 3} +@[expose] def rieszSecondP1ExtensionOperator {i j : Fin 3} (hL2 : RieszSecondL2Input i j) (hWeak11 : ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → ∀ l : ℝ, 0 < l → @@ -323,7 +325,7 @@ theorem rieszSecondP1Extension_toLp_bound {i j : Fin 3} (rieszSecondP1ExtensionInput hL2 hWeak11) hf /-- The indexed completed operator at exponent 6 / 5. -/ -def rieszSecondGradientExtensionOperator {i j : Fin 3} +@[expose] def rieszSecondGradientExtensionOperator {i j : Fin 3} (hL2 : RieszSecondL2Input i j) (hWeak11 : ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → ∀ l : ℝ, 0 < l → diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZUnconditional.lean index 8368c3a6ce..a7bf959f9e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/CZUnconditional.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.IdentificationExtension Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -35,10 +35,12 @@ the endpoint estimate. -/ /-- The explicit constant for the selected vector-valued gradient operator. -/ +@[expose] def czGradientOperatorConstant : ℝ := 3 * czGradientComponentConstant rieszSecondWeakTypeConstant 1 /-- The explicit component constant at exponent `3 / 2`. -/ +@[expose] def czP1OperatorConstant : ℝ := czP1Constant rieszSecondWeakTypeConstant 1 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Dyadic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Dyadic.lean index b446561e2f..e54b8bc56b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Dyadic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Dyadic.lean @@ -17,7 +17,7 @@ The cubes use the half-open product grid on `Vec3 = Fin 3 → ℝ`. The scale index is integral so that parent and child cubes are represented uniformly. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -39,14 +39,17 @@ structure DyadicIndex where corner : DyadicCorner /-- Side length of the dyadic grid at integer scale `k`. -/ +@[expose] def dyadicScale (k : ℤ) : ℝ := (2 : ℝ) ^ (-k : ℤ) /-- Half-open dyadic cube with scale index `k` and lattice corner `a`. -/ +@[expose] def dyadicCube (k : ℤ) (a : DyadicCorner) : Set Vec3 := Set.univ.pi (fun i => Ico ((a i : ℝ) * dyadicScale k) (((a i : ℝ) + 1) * dyadicScale k)) /-- Center of a dyadic cube in native Euclidean coordinates. -/ +@[expose] def dyadicCubeCenter (k : ℤ) (a : DyadicCorner) : Vec3 := fun i => ((a i : ℝ) + 1 / 2) * dyadicScale k @@ -55,6 +58,7 @@ def dyadicCorner (k : ℤ) (x : Vec3) : DyadicCorner := fun i => ⌊x i / dyadicScale k⌋ /-- Immediate containing dyadic cube at the next coarser scale. -/ +@[expose] def dyadicParent (Q : DyadicIndex) : DyadicIndex := { scale := Q.scale - 1 corner := fun i => Q.corner i / 2 } diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HLS.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HLS.lean index f8582d53a6..dd2cd9a438 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HLS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HLS.lean @@ -16,7 +16,7 @@ estimate. The a.e. maximal-data hypothesis is exposed so that zero data and finite truncations can be handled by the consuming pressure lemma. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -30,6 +30,7 @@ namespace CKN.Foundation.Euclidean open CKN.Foundation.Parabolic /-- The constant in the three-dimensional order-one HLS estimate. -/ +@[expose] def hlsRieszConstant : ℝ≥0∞ := (hedbergNearConstant + hedbergFarConstant) * (maximalStrongConstant (5 / 2 : ℝ)) ^ (1 / 15 : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hedberg.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hedberg.lean index dc896d67ea..10a368c704 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hedberg.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hedberg.lean @@ -15,7 +15,7 @@ three-dimensional model `Vec3`. The maximal majorant is the uncentred maximal function from `Maximal.HardyLittlewood`. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter @@ -23,12 +23,14 @@ noncomputable section namespace CKN.Foundation.Euclidean open CKN.Foundation.Parabolic /-- A maximal majorant for the absolute value of a real function. -/ +@[expose] def IsMaximalMajorant (f : Vec3 → ℝ) (M : Vec3 → ℝ≥0∞) : Prop := ∀ z : Vec3, ∀ R : ℝ, 0 < R → (∫⁻ w in Metric.ball z R, ENNReal.ofReal |f w|) ≤ M z * volume (Metric.ball z R) /-- The maximal majorant associated with the Euclidean maximal function. -/ +@[expose] def maximalMajorant (f : Vec3 → ℝ) : Vec3 → ℝ≥0∞ := maximalFunction (fun z ↦ ENNReal.ofReal |f z|) theorem isMaximalMajorant_maximalMajorant (f : Vec3 → ℝ) : @@ -47,9 +49,10 @@ theorem isMaximalMajorant_maximalMajorant (f : Vec3 → ℝ) : exact (ENNReal.div_le_iff hvol0 hvoltop).mp haverage /-- The order-one Riesz kernel and its nonnegative potential. -/ -def rieszKernelOne (z w : Vec3) : ℝ≥0∞ := +@[expose] def rieszKernelOne (z w : Vec3) : ℝ≥0∞ := (ENNReal.ofReal (dist z w)) ^ (-2 : ℝ) /-- Order-one Riesz potential of the absolute value of a scalar source. -/ +@[expose] def rieszPotentialOne (f : Vec3 → ℝ) (z : Vec3) : ℝ≥0∞ := ∫⁻ w, rieszKernelOne z w * ENNReal.ofReal |f w| /-- Dyadic shell inside the reference radius for the near-field potential estimate. -/ @@ -260,10 +263,11 @@ private lemma ennreal_mul_rpow_of_ne_zero_of_ne_top exact ENNReal.mul_inv (Or.inl hxr0) (Or.inl hxrtop) _ = x ^ e * y ^ e := by rw [hxpow, hypow] /-- Geometric-series term controlling the near-field order-one potential. -/ -def nearTerm (n : ℕ) : ℝ≥0∞ := +@[expose] def nearTerm (n : ℕ) : ℝ≥0∞ := (ENNReal.ofReal ((2 : ℝ) ^ (Int.negSucc n : ℝ))) ^ (-2 : ℝ) * ENNReal.ofReal ((4 * ((2 : ℝ) ^ (Int.negSucc n : ℝ))) ^ 3) /-- The geometric constant in the near-field estimate. -/ +@[expose] def hedbergNearConstant : ℝ≥0∞ := ∑' n : ℕ, nearTerm n private lemma near_shell_integral_le @@ -543,7 +547,7 @@ private lemma far_shell_integral_le gcongr /-- Geometric-series term controlling the far-field order-one potential. -/ -def farTerm (n : ℕ) : ℝ≥0∞ := +@[expose] def farTerm (n : ℕ) : ℝ≥0∞ := ((ENNReal.ofReal ((2 : ℝ) ^ (n : ℝ))) ^ (-(10 / 3 : ℝ)) * ENNReal.ofReal ((4 * ((2 : ℝ) ^ (n : ℝ))) ^ 3)) ^ (3 / 5 : ℝ) @@ -599,6 +603,7 @@ private lemma far_shell_scale_identity {R : ℝ} (hR : 0 < R) (n : ℕ) : ring_nf /-- Summed coefficient in the far-field Hedberg estimate. -/ +@[expose] def hedbergFarConstant : ℝ≥0∞ := ∑' n : ℕ, farTerm n private lemma far_integral_le_shell_sum {R : ℝ} (hR : 0 < R) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HessianL2.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HessianL2.lean index 3055590f93..6d8c8904e6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HessianL2.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/HessianL2.lean @@ -19,7 +19,7 @@ public import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hormander.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hormander.lean index bda4378ce6..e40e4ea71b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hormander.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Hormander.lean @@ -45,7 +45,7 @@ shells are Euclidean (`vec3Ball`), and the volume normalization `volume_vec3Ball_eq` is the one of the paper. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology open Filter MeasureTheory MeasureTheory.Measure Set Metric diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Interpolation.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Interpolation.lean index 0ae8b0f85a..617ae9053c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Interpolation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Interpolation.lean @@ -21,7 +21,7 @@ truncating at level `t/2`, and its layer-cake integral against the weight `p t^{p-1}` — are in `InterpolationBasic.lean`. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationBasic.lean index 1e6d05d808..3e66abb6eb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationBasic.lean @@ -30,7 +30,7 @@ The proof works throughout with Lebesgue integrals in `ℝ≥0∞`; measurabilit the input function and of its image under `T` are explicit hypotheses. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -425,6 +425,7 @@ private lemma weighted_low_integral {N : Vec3 → ℝ≥0∞} (hN : Measurable N /-- The `ℝ≥0∞`-valued modulus of a real function; it converts the real-valued weak- and strong-type hypotheses into inequalities between Lebesgue integrals. -/ +@[expose] def absE (f : Vec3 → ℝ) : Vec3 → ℝ≥0∞ := fun x ↦ ENNReal.ofReal |f x| private lemma absE_apply (f : Vec3 → ℝ) (x : Vec3) : absE f x = ENNReal.ofReal |f x| := @@ -714,11 +715,13 @@ lemma interp_integrand {A₁ A₂ p t : ℝ} (hA₁ : 0 ≤ A₁) (hp1 : 1 < p) /-- The high-frequency tail integral `∫_{N > t/2} N`, viewed as a function of the level `t`. -/ +@[expose] def highTail (N : Vec3 → ℝ≥0∞) (t : ℝ) : ℝ≥0∞ := ∫⁻ x in N ⁻¹' Ioi (ENNReal.ofReal (t / 2)), N x /-- The low-frequency tail integral `∫_{N ≤ t/2} N ^ 2`, viewed as a function of the level `t`. -/ +@[expose] def lowTail (N : Vec3 → ℝ≥0∞) (t : ℝ) : ℝ≥0∞ := ∫⁻ x in N ⁻¹' Iic (ENNReal.ofReal (t / 2)), N x ^ 2 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationIndicator.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationIndicator.lean index 85ec7fbd7f..202d3bc8e8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationIndicator.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationIndicator.lean @@ -27,7 +27,7 @@ stated for an arbitrary measurable set `s` and an arbitrary function measure to `s`. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationLpChar.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationLpChar.lean index 93251802f6..c46960a83c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationLpChar.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationLpChar.lean @@ -31,7 +31,7 @@ agree pointwise with `‖f ·‖ₑ`. The results are: (`integrable_of_lintegral_absE_lt_top`). -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationRestricted.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationRestricted.lean index 7ea2574d33..fdd19e5e19 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationRestricted.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationRestricted.lean @@ -41,7 +41,7 @@ of `InterpolationTruncBounds.lean`, are what lets the restricted hypotheses be applied. Everything else is the argument of `Interpolation.lean`. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationTruncBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationTruncBounds.lean index 723d616104..7ae4261b8c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationTruncBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/InterpolationTruncBounds.lean @@ -23,7 +23,7 @@ scalar comparison of `|f x|` with `l`; the exponents `l ^ (1 - p)` and `l ^ (2 - p)` are real powers. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpDensity.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpDensity.lean index 795458c7f8..e4992d8fa7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpDensity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpDensity.lean @@ -22,7 +22,7 @@ integral form supplied by Hölder's inequality, which is convenient when passing a distributional identity to the limit. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtension.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtension.lean index e7d47fdadf..2f2ee9f3c1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtension.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtension.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.ExtensionNormTranspo Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -230,7 +230,7 @@ theorem lpExtensionCore_norm_le {p : ℝ≥0∞} [Fact (1 ≤ p)] C (lpInterL2Map_bound_subtype h) u) /-- Measurable representative of the extended operator, defined as zero outside its Lᵖ domain. -/ -def lpExtensionRepresentative {p : ℝ≥0∞} [Fact (1 ≤ p)] {C : ℝ} +@[expose] def lpExtensionRepresentative {p : ℝ≥0∞} [Fact (1 ≤ p)] {C : ℝ} (hp : p ≠ ∞) (h : LpExtensionInput p C) (f : Vec3 → ℝ) : Vec3 → ℝ := by classical exact if hf : MemLp f p volume then @@ -280,6 +280,7 @@ theorem lpExtensionRepresentative_norm_le {p : ℝ≥0∞} [Fact (1 ≤ p)] exact lpExtensionCore_norm_le hp h _ /-- Pointwise presentation of the continuous Lᵖ extension. -/ +@[expose] def lpExtensionOperator {p : ℝ≥0∞} [Fact (1 ≤ p)] {C : ℝ} (hp : p ≠ ∞) (h : LpExtensionInput p C) (f : Vec3 → ℝ) : Vec3 → ℝ := lpExtensionRepresentative hp h f @@ -298,6 +299,7 @@ theorem lpExtensionOperator_toLp_bound {p : ℝ≥0∞} [Fact (1 ≤ p)] lpExtensionRepresentative_norm_le hp h hf /-- Sum of the componentwise extended operators acting on a tensor source. -/ +@[expose] def lpExtensionTensorOperator {p : ℝ≥0∞} [Fact (1 ≤ p)] {C : Fin 3 → Fin 3 → ℝ} (hp : p ≠ ∞) (h : ∀ i j, LpExtensionInput p (C i j)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionCZ.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionCZ.lean index 7a96ee3f7c..767dba6ebc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionCZ.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionCZ.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.RieszWeakGradient Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -148,7 +148,7 @@ theorem exists_weak_pressure_gradient_of_rieszSecond_l2_extension_unconditional (fun i j => rieszSecondL2_weak_type i j)) /-- Tensor second-Riesz operator at exponent three-halves, built from L² and weak-(1,1) data. -/ -def rieszSecondP1ExtensionTensorOperator +@[expose] def rieszSecondP1ExtensionTensorOperator (hL2 : ∀ i j : Fin 3, RieszSecondL2Input i j) (hWeak11 : ∀ i j : Fin 3, ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → ∀ l : ℝ, 0 < l → diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionExterior.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionExterior.lean index 75c1060a0a..7d4a8f89f0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionExterior.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionExterior.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.IdentificationExtension Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionInputCast.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionInputCast.lean index be8add2d20..ed6296da29 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionInputCast.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionInputCast.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.LpExtension Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairing.lean index 0dd61a47c1..feb3ec216f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairing.lean @@ -30,7 +30,7 @@ which is the smooth case of the distributional adjointness used for the `L^(6/5)` Calderón--Zygmund endpoint. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingDensity.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingDensity.lean index 7e21401c22..4539ba663f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingDensity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingDensity.lean @@ -20,7 +20,7 @@ against a fixed dual class and are the device used to pass the identity from the dense set to every `Lᵖ` input. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingHeat.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingHeat.lean index 8551a1c32d..4839fba0ec 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingHeat.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingHeat.lean @@ -17,7 +17,7 @@ lemmas here supply the product integrability on `(0, ∞) × ℝ³` that license Fubini exchange, for data that is smooth with compact support. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingKernel.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingKernel.lean index ed7ffc25d0..e2bf21effb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingKernel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingKernel.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.LpExtensionP Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingMain.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingMain.lean index 0a59e2b8eb..2f818cd977 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingMain.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingMain.lean @@ -33,7 +33,7 @@ the Newtonian potential `N * ∂ᵢ∂ⱼψ ∈ L⁶`. Density of smooth compac supported classes in `L^(6/5)` closes the argument. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingPotential.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingPotential.lean index 4f5c4039fd..9c6150376e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingPotential.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingPotential.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.JapaneseBracket Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingSmooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingSmooth.lean index e3cc2b0240..94106788b0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingSmooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/LpExtensionPairingSmooth.lean @@ -19,7 +19,7 @@ only place where a classical representative of the completed operator is identified, and it is used exactly on the dense class of test data. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/HardyLittlewood.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/HardyLittlewood.lean index 26cd22ed7f..7bc3cb712a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/HardyLittlewood.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/HardyLittlewood.lean @@ -17,7 +17,7 @@ This module defines the uncentred maximal function on `Vec3` and proves its weak `(1,1)` estimate by the metric Vitali covering theorem. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -34,6 +34,7 @@ open CKN.Foundation.Parabolic abbrev hardyLittlewoodMetricBall (c : Vec3) (r : ℝ) : Set Vec3 := Metric.ball c r /-- The uncentred Hardy--Littlewood maximal function on `Vec3`. -/ +@[expose] def maximalFunction (f : Vec3 → ℝ≥0∞) (z : Vec3) : ℝ≥0∞ := ⨆ c : Vec3, ⨆ r : ℝ, (hardyLittlewoodMetricBall c r).indicator diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/StrongType.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/StrongType.lean index d2b6018c0f..d41a4e4426 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/StrongType.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/Maximal/StrongType.lean @@ -23,7 +23,7 @@ half the level and Tonelli's theorem, so it does not depend on an abstract interpolation package. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -37,6 +37,7 @@ namespace CKN.Foundation.Euclidean open CKN.Foundation.Parabolic /-- Explicit strong-type coefficient for the Euclidean maximal operator. -/ +@[expose] def maximalStrongConstant (p : ℝ) : ℝ≥0∞ := (2 : ℝ≥0∞) ^ p * ENNReal.ofReal (5 ^ 3) * ENNReal.ofReal p / ENNReal.ofReal (p - 1) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/NewtonianDerivativeLocalLp.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/NewtonianDerivativeLocalLp.lean index b97ac1d431..32b40bc700 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/NewtonianDerivativeLocalLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/NewtonianDerivativeLocalLp.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Integral.MeanInequalities Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -30,7 +30,7 @@ namespace CKN.Foundation.Euclidean open CKN /-- The scalar convolution convention used for the Newtonian derivative. -/ -def scalarConvolution (f g : Vec3 → ℝ) (x : Vec3) : ℝ := +@[expose] def scalarConvolution (f g : Vec3 → ℝ) (x : Vec3) : ℝ := ∫ y : Vec3, f y * g (x - y) /-- Extended nonnegative convolution used to majorize ordinary convolution integrals. -/ @@ -297,6 +297,7 @@ private theorem ae_integrable_scalarConvolution_six_fifths_three_halves three-dimensional Newtonian derivative. -/ /-- The Newtonian derivative kernel truncated to a ball about the origin. -/ +@[expose] def truncatedNewtonianDerivative (R : ℝ) (i : Fin 3) : Vec3 → ℝ := fun z => if ‖z‖ < R then spatialDeriv newtonianKernel i z else 0 @@ -376,7 +377,7 @@ theorem truncatedNewtonianDerivative_memLp norm_num [kp] /-- The first Newtonian derivative potential, with the derivative in the kernel slot. -/ -def newtonianDerivativePotential (i : Fin 3) (G : Vec3 → ℝ) (x : Vec3) : ℝ := +@[expose] def newtonianDerivativePotential (i : Fin 3) (G : Vec3 → ℝ) (x : Vec3) : ℝ := ∫ y, spatialDeriv newtonianKernel i (x - y) * G y /-- The derivative kernel has the expected inverse-square bound away from the origin. -/ diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/OperatorConstantNonneg.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/OperatorConstantNonneg.lean index 0b64ca69d6..b25c546dda 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/OperatorConstantNonneg.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/OperatorConstantNonneg.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.OscillationLin34 Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Real diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLp.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLp.lean index 7450766302..85f3df1fa8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLp.lean @@ -34,7 +34,7 @@ and therefore cover every exponent `q ≥ 6/5`; in particular `q = 3/2` and the `q > 5/2` of `def:sws`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpExponents.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpExponents.lean index 8d964aad2b..0c5a4115f3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpExponents.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpExponents.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.NewtonianDer Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpGrowth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpGrowth.lean index 6b56af1863..b00eb036a6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpGrowth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpGrowth.lean @@ -29,7 +29,7 @@ All the estimates are stated for exponents `q ≥ 6/5`, which covers the exponen pressure and the exponents `q > 5/2` of the force datum of `def:sws`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -46,22 +46,26 @@ open CKN /-- The far-field decay constant of the Newtonian potential of `G`: the potential is bounded by this constant times `‖x‖⁻¹` outside the support ball. -/ +@[expose] def newtonianPotentialDecayConstant (G : Vec3 → ℝ) : ℝ := 2 * (4 * Real.pi)⁻¹ * ∫ y, |G y| /-- The far-field decay constant of the first-derivative Newtonian potential of `G` on the region `2 * R ≤ ‖x‖`, measured against `‖x‖⁻¹`. -/ +@[expose] def newtonianDerivativePotentialDecayConstant (G : Vec3 → ℝ) (R : ℝ) : ℝ := 4 * (4 * Real.pi)⁻¹ * (∫ y, |G y|) / (2 * R) /-- The linear-growth constant of the Newtonian potential of data supported in the closed ball of radius `R`: the local `L^{3/2}` norm near the origin plus the far-field decay constant times the universal ball constant. -/ +@[expose] def newtonianPotentialGrowthConstant (G : Vec3 → ℝ) (R : ℝ) : ℝ := invNormGrowthConstant (pressureNewtonianPotential G) (newtonianPotentialDecayConstant G) R /-- The linear-growth constant of the first-derivative Newtonian potential of data supported in the closed ball of radius `R`. -/ +@[expose] def newtonianDerivativePotentialGrowthConstant (i : Fin 3) (G : Vec3 → ℝ) (R : ℝ) : ℝ := invNormGrowthConstant (pressureNewtonianDerivativePotential i G) (newtonianDerivativePotentialDecayConstant G R) R diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpKernel.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpKernel.lean index 83998eafb3..21505a2626 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpKernel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpKernel.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.NewtonianDer Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -27,6 +27,7 @@ namespace CKN.Foundation.Euclidean open CKN /-- The Newtonian kernel truncated to the ball of radius `R` about the origin. -/ +@[expose] def truncatedNewtonianPotentialKernel (R : ℝ) : Vec3 → ℝ := fun z => if ‖z‖ < R then newtonianKernel z else 0 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpMeasure.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpMeasure.lean index 43884f9be3..ea8ff9bf86 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpMeasure.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpMeasure.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Potentials Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpP8.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpP8.lean index bde0fb76dc..8e31eaeda0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpP8.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/PotentialLocalLpP8.lean @@ -32,7 +32,7 @@ vanishes off a closed ball. The exponent range `6/5 ≤ q` contains the pressur and the force exponents `q > 5/2` of `def:sws`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -74,12 +74,14 @@ theorem neg_sum_memLp_and_lpNorm_growth {F : Fin 3 → Vec3 → ℝ} {C : Fin 3 /-- The linear-growth constant of `p₈` at time `s`, for data supported in the closed ball of radius `R`: the sum over the three components of the Newtonian-potential constants. -/ +@[expose] def pressureP8GrowthConstant (η : Vec3 → ℝ) (f : ParabolicPoint → Vec3) (s R : ℝ) : ℝ := ∑ j : Fin 3, newtonianPotentialGrowthConstant (fun y => spatialDeriv η j y * f (y, s) j) R /-- The linear-growth constant of `p₇` at time `s`, for data supported in the closed ball of radius `R`: the sum over the three components of the derivative-potential constants. -/ +@[expose] def pressureP7GrowthConstant (η : Vec3 → ℝ) (f : ParabolicPoint → Vec3) (s R : ℝ) : ℝ := ∑ j : Fin 3, newtonianDerivativePotentialGrowthConstant j (fun y => η y * f (y, s) j) R diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecond.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecond.lean index 87edcf8b2e..e666c7ce7c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecond.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecond.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Integral.Lebesgue.Markov Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -126,6 +126,7 @@ private lemma vec3EuclideanNorm_le_sqrt_three_mul_norm (v : Vec3) : abs_of_nonneg (mul_nonneg (Real.sqrt_nonneg 3) (norm_nonneg v))] at h2 /-- The Euclidean `2√3` enlargement of a dyadic cube, with the cube's sup-radius `dyadicScale Q.scale / 2`. -/ +@[expose] def rieszSecondCubeStar (Q : DyadicIndex) : Set Vec3 := {x | vec3EuclideanNorm (x - dyadicCubeCenter Q.scale Q.corner) ≤ 2 * Real.sqrt 3 * (dyadicScale Q.scale / 2)} diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondBadPart.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondBadPart.lean index e4a64d8e01..7adc82970a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondBadPart.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondBadPart.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.KernelAllOrde Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -29,9 +29,10 @@ namespace CKN.Foundation.Euclidean open CKN /-- Explicit coefficient controlling the second Riesz kernel's size estimates. -/ -def rieszSecondKernelC₂ : ℝ := 72 / (4 * Real.pi) +@[expose] def rieszSecondKernelC₂ : ℝ := 72 / (4 * Real.pi) /-- Second spatial derivative of the Newtonian kernel in the chosen coordinates. -/ +@[expose] def rieszSecondKernel (i j : Fin 3) (z : Vec3) : ℝ := CKN.spatialDeriv (CKN.spatialDeriv CKN.Foundation.Heat.newtonianKernel i) j z diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondExterior.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondExterior.lean index 61ae238975..c8f5a22a8e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondExterior.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondExterior.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Mollify.Suppor Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Global.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Global.lean index 419f2ef3ac..8215e0dcb0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Global.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Global.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.RieszSecondL Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2GlobalBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2GlobalBounds.lean index 9c84b1ec2f..64758a047b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2GlobalBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2GlobalBounds.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Integral.IntegralEqImproper Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -139,6 +139,7 @@ lemma pressure_potential_deriv_tail_bound hR ((tsupport_fderiv_apply_subset ℝ (basisVec i)).trans hSupp) hx) /-- Error produced by applying the Laplacian to a cutoff Newtonian potential. -/ +@[expose] def cutoffError (F : Vec3 → ℝ) {ρ : ℝ} (hρ : 0 < ρ) (x : Vec3) : ℝ := 2 * spatialGradDot (mollifiedBallCutoff 0 hρ) (pressureNewtonianPotential F) x + pressureNewtonianPotential F x * @@ -191,11 +192,13 @@ lemma cutoffError_hasCompactSupport {F : Vec3 → ℝ} simp [cutoffError, hgrad', hlap] /-- Source and first-derivative mass controlling the tail of the Newtonian potential. -/ +@[expose] def potentialTailSize (F : Vec3 → ℝ) : ℝ := 2 * (4 * Real.pi)⁻¹ * ((∫ y, |F y|) + ∑ i : Fin 3, ∫ y, |spatialDeriv F i y|) /-- Coefficient bounding the cutoff error in terms of source tail size. -/ +@[expose] def cutoffErrorConstant (F : Vec3 → ℝ) : ℝ := (60 / 13) * potentialTailSize F * (6 * cutoffGradientConstant + 3 * cutoffSecondDerivativeConstant) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Input.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Input.lean index 6565946d9c..c395aad217 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Input.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondL2Input.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Convolution Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology Distributions Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondOperator.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondOperator.lean index 628b385228..25b8e8f2e5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondOperator.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondOperator.lean @@ -20,7 +20,7 @@ public import Mathlib.MeasureTheory.Function.LpSpace.Complete Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -36,7 +36,7 @@ open CKN abbrev rieszSecondL2 := Lp ℝ 2 (volume : Measure Vec3) /-- Continuous inclusion of Schwartz functions into the L² source space. -/ -def rieszSecondSchwartzEmbedding : +@[expose] def rieszSecondSchwartzEmbedding : SchwartzMap Vec3 ℝ →L[ℝ] rieszSecondL2 := SchwartzMap.toLpCLM ℝ ℝ 2 volume @@ -375,6 +375,7 @@ structure RieszSecondL2CZCertificate {i j : Fin 3} ENNReal.ofReal |dyadicBadPart F Q.1 x|) /-- Explicit weak-(1,1) coefficient assembled from the decomposition and kernel bounds. -/ +@[expose] def rieszSecondWeakTypeConstant : ℝ := 32 + 32 * Real.pi * Real.sqrt 3 + 256 * Real.pi * rieszSecondKernelC₂ @@ -388,7 +389,7 @@ theorem rieszSecondKernelC_H : ring /-- Measurable second-Riesz operator on L² inputs, extended by zero outside L². -/ -def rieszSecondL2RawOperator {i j : Fin 3} +@[expose] def rieszSecondL2RawOperator {i j : Fin 3} (hL2 : RieszSecondL2Input i j) (f : Vec3 → ℝ) : Vec3 → ℝ := by classical exact if hf : MemLp f (2 : ℝ≥0∞) volume then diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondStrong.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondStrong.lean index b4d965decd..05e4d917f7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondStrong.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondStrong.lean @@ -17,7 +17,7 @@ only inputs here are its sublinearity, measurability, weak `(1,1)` estimate, and global `(2,2)` estimate. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology Convolution @@ -31,6 +31,7 @@ namespace CKN.Foundation.Euclidean open CKN.Foundation.Parabolic /-- The explicit integral constant furnished by weak-to-strong interpolation. -/ +@[expose] def rieszSecondInterpolationConstant (A₁ A₂ p : ℝ) : ℝ := p * (2 ^ p * (A₁ / (p - 1) + A₂ ^ 2 / (2 - p))) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakAssembly.lean index c3dd5b7d79..2b75711c82 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakAssembly.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.Interpolatio Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -365,6 +365,7 @@ theorem rieszSecond_good_output_l2 simpa only [g, u] using And.intro hmem_op hreal /-- Second-Riesz kernel with the sign convention for pressure reconstruction. -/ +@[expose] def rieszSecondPressureKernel (i j : Fin 3) : Vec3 → ℝ := fun z => -rieszSecondKernel i j z diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCertificate.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCertificate.lean index 394064e6b1..0f1ff058e3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCertificate.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCertificate.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Core.Endgame.RestrictedCZInterpol Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakConcrete.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakConcrete.lean index f2d2c63910..c647233c1e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakConcrete.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakConcrete.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.Interior Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCountable.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCountable.lean index 916df2482c..21d4ff8e57 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCountable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakCountable.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.LpDensity Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakExterior.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakExterior.lean index a12dd6aa43..c2cb64bcad 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakExterior.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RieszSecondWeakExterior.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Euclidean.RieszSecondW Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RpowSquares.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RpowSquares.lean index 92bd0561fa..98f553236e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RpowSquares.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Euclidean/RpowSquares.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.Sqrt Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/Kernels.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/Kernels.lean index 930b7bf822..5f746ecad9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/Kernels.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/Kernels.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Integral.Bochner.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open Filter MeasureTheory diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/KernelsBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/KernelsBasic.lean index f9db4b24d1..fcccce05df 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/KernelsBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Commutator/KernelsBasic.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Integral.Bochner.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open Filter MeasureTheory @@ -94,6 +94,7 @@ theorem spatialDeriv_radialInverse {x : CKN.Vec 3} (hx : x ≠ 0) ring_nf /-- First derivative formula for the inverse Euclidean radius. -/ +@[expose] def firstFormula (i : Fin 3) (x : CKN.Vec 3) : ℝ := -x i * q x ^ (-(3 : ℝ) / 2) @@ -167,6 +168,7 @@ private theorem spatialDeriv_second_radialInverse {x : CKN.Vec 3} (hx : x ≠ 0) · simp [h'] /-- Second derivative formula for the inverse Euclidean radius. -/ +@[expose] def secondFormula (i j : Fin 3) (x : CKN.Vec 3) : ℝ := 3 * x i * x j * q x ^ (-(5 : ℝ) / 2) - (if i = j then 1 else 0) * q x ^ (-(3 : ℝ) / 2) @@ -322,6 +324,7 @@ private theorem q_rpow_neg_nine {x : CKN.Vec 3} (hx : x ≠ 0) : /-- The third derivative of the inverse Euclidean radius, in the convention used by the Newtonian kernel. -/ +@[expose] def inverseThirdFormula (m j l : Fin 3) (x : CKN.Vec 3) : ℝ := -15 * x m * x j * x l * (CKN.vecEuclideanNorm x ^ 7)⁻¹ + 3 * ((if m = l then 1 else 0) * x j + @@ -401,10 +404,12 @@ private theorem hasFDerivAt_inverseThirdFormulaQ {x : CKN.Vec 3} (hx : x ≠ 0) ring /-- The Newtonian potential and its third-derivative kernel. -/ +@[expose] def newtonianPotential (x : CKN.Vec 3) : ℝ := -(4 * Real.pi)⁻¹ * radialInverse x /-- Normalized third Newtonian derivative kernel used in the commutator estimates. -/ +@[expose] def newtonianKernel (m j l : Fin 3) (x : CKN.Vec 3) : ℝ := -(4 * Real.pi)⁻¹ * inverseThirdFormula m j l x diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Interior.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Interior.lean index 630011483a..2ac165f10d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Interior.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Interior.lean @@ -18,7 +18,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorBasic.lean index 7fdf426a8c..0cd8f64f29 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorBasic.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.NewtonianKern Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter @@ -35,6 +35,7 @@ noncomputable section namespace CKN.Foundation.Heat /-- Squared Euclidean radius in native three-dimensional coordinates. -/ +@[expose] def q (z : Vec3) : ℝ := ∑ i : Fin 3, z i ^ 2 lemma q_pos {z : Vec3} (hz : z ≠ 0) : 0 < q z := by @@ -297,10 +298,12 @@ private lemma spatialDeriv_kernel_eq_kernelDerivative {x y : Vec3} (hxy : x - y exact spatialDeriv_newtonianKernel_shift hxy i /-- The smooth cutoff used in the annular harmonic representation. -/ +@[expose] def eta (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) : Vec3 → ℝ := mollifiedBallCutoff x₀ hρ /-- The Newtonian kernel times one cutoff derivative. -/ +@[expose] def kernelCutoffDerivative (x x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (i : Fin 3) (y : Vec3) : ℝ := newtonianKernel (x - y) * spatialDeriv (eta x₀ hρ) i y diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplayBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplayBounds.lean index 901e6367c1..16aa85c5c3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplayBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplayBounds.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Poincare.LpCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter @@ -27,6 +27,7 @@ namespace CKN.Foundation.Heat /-- Common coefficient for the displayed harmonic value, gradient and integral estimates. -/ +@[expose] noncomputable def harmonicInteriorDisplayConstant : ℝ := max (max weakHarmonicInteriorSupConstant (576 * weakHarmonicInteriorSupConstant)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplays.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplays.lean index 273204e727..5fdc67e921 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplays.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorDisplays.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Poincare.LpCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimates.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimates.lean index 50a50ed66b..65b41c8a71 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimates.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimates.lean @@ -19,7 +19,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimatesBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimatesBasic.lean index da4e09ea72..1813e8c253 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimatesBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorEstimatesBasic.lean @@ -18,7 +18,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter @@ -121,7 +121,7 @@ lemma eta_spatialSecond_bound_global (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) eta_second_derivative_bound x₀ hρ y i j /-- Annulus containing the derivatives of the interior harmonic cutoff. -/ -def cutoffAnnulus (x₀ : Vec3) (ρ : ℝ) : Set Vec3 := +@[expose] def cutoffAnnulus (x₀ : Vec3) (ρ : ℝ) : Set Vec3 := euclideanBall x₀ (3 * ρ / 4) \ euclideanClosedBall x₀ (13 * ρ / 20) private lemma cutoff_annulus_distance_for_inner_half diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorGradient.lean index 89988eec18..4dba6b2c85 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorGradient.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.InteriorEstim Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRegularity.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRegularity.lean index 6232bc65ce..095ccd165f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRegularity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRegularity.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Function.ConvergenceInMeasure Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRepresentative.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRepresentative.lean index 33ac98058c..2a4ac7778f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRepresentative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorRepresentative.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.Calculus.UniformLimitsDeriv Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution open MeasureTheory MeasureTheory.Measure Set Filter @@ -28,6 +28,7 @@ namespace CKN.Foundation.Heat /-- Interior representative constructed from a weakly harmonic function by Newtonian integration. -/ +@[expose] noncomputable def weakHarmonicInteriorRepresentative (h : Vec3 → ℝ) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (x : Vec3) : ℝ := (-∫ y : Vec3, newtonianKernel (x - y) * @@ -54,6 +55,7 @@ noncomputable def weakHarmonicInteriorSourceXGradientConstant : ℝ := (4 * Real.pi)⁻¹ * (1200 * cutoffSecondDerivativeConstant) /-- Supremum coefficient for the weakly harmonic interior representative. -/ +@[expose] noncomputable def weakHarmonicInteriorSupConstant : ℝ := (Real.pi * 4 / 3) ^ (1 / (3 : ℝ)) * (weakHarmonicInteriorSourceConstant + diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorSmooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorSmooth.lean index 24864cc927..0a565448dc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorSmooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorSmooth.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution open MeasureTheory MeasureTheory.Measure Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorWeak.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorWeak.lean index 01e2f84698..5bb0601c56 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorWeak.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/InteriorWeak.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Calculus.ParametricIntegral Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution open MeasureTheory MeasureTheory.Measure Set Filter @@ -30,7 +30,7 @@ namespace CKN.Foundation.Heat /-- A locally integrable function is weakly harmonic when its Laplacian pairing with every compactly supported smooth test function vanishes. -/ -def WeaklyHarmonicOn (U : Set Vec3) (h : Vec3 → ℝ) : Prop := +@[expose] def WeaklyHarmonicOn (U : Set Vec3) (h : Vec3 → ℝ) : Prop := ∀ ψ : Vec3 → ℝ, ContDiff ℝ (⊤ : ℕ∞) ψ → HasCompactSupport ψ → diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrders.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrders.lean index 3abffef0ec..200526fd41 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrders.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrders.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open MeasureTheory diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersBounds.lean index 375a0c239c..662d562baa 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersBounds.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.Bounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersOpen.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersOpen.lean index d0bda7dff5..0cafeb05b1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersOpen.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersOpen.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped Topology open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersPotential.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersPotential.lean index 528b9dabef..bbed18659a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersPotential.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersPotential.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.Bounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section universe u @@ -49,7 +49,7 @@ noncomputable section namespace CKN.Foundation.Heat /-- The potential of a kernel `K` against a density `g`. -/ -def kernelPotential {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] +@[expose] def kernelPotential {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] (K : Vec3 → F) (g : Vec3 → ℝ) (x : Vec3) : F := ∫ y : Vec3, g y • K (x - y) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersShift.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersShift.lean index 9dd5de37bf..d1e542cea3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersShift.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersShift.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.OfBasis Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open MeasureTheory diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSmooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSmooth.lean index 89e10745a0..45b09c858a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSmooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSmooth.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Deriv Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSphere.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSphere.lean index d9406475ef..560a9b383d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSphere.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/KernelAllOrdersSphere.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Ambient.Euclidean Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Liouville.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Liouville.lean index 968ae26d84..2115d0fdce 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Liouville.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Liouville.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.InteriorDispl Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Newtonian.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Newtonian.lean index 195320731a..dcae2ca4f7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Newtonian.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/Newtonian.lean @@ -21,7 +21,7 @@ kernel away from its singularity. This identity is the scalar analytic input for the heat-kernel route to the pressure decomposition. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianKernelIntegrability.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianKernelIntegrability.lean index 4aa2227afb..67e5ca6643 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianKernelIntegrability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianKernelIntegrability.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.NewtonianRepr Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianRepresentation.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianRepresentation.lean index 302d012f26..180b560831 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianRepresentation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Harmonic/NewtonianRepresentation.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Integral Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Interval open MeasureTheory MeasureTheory.Measure Set Filter @@ -29,6 +29,7 @@ open CKN.Foundation.Parabolic /-! The Newtonian kernel representation obtained from the heat semigroup. -/ /-- The positive three-dimensional Newtonian kernel. -/ +@[expose] def newtonianKernel (z : Vec3) : ℝ := 1 / (4 * Real.pi * vec3EuclideanNorm z) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotential.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotential.lean index 1eebad231c..ee4ec0519a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotential.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotential.lean @@ -20,7 +20,7 @@ public import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution @@ -36,14 +36,17 @@ open CKN.Foundation.Parabolic /-! The backward heat potential used to test a causal weak equation. -/ /-- Product of spatial volume and time volume for backward heat integration. -/ +@[expose] def backwardProductVolume : Measure (Vec3 × ℝ) := (volume : Measure Vec3).prod (volume : Measure ℝ) /-- Reflected causal heat kernel used in the backward test-function convolution. -/ +@[expose] def backwardTestKernel (p : Vec3 × ℝ) : ℝ := heatKernelPlus (show ParabolicPoint from -p) /-- Backward heat potential of a test function, written as a product-space convolution. -/ +@[expose] def backwardTestPotential (ζ : Vec3 × ℝ → ℝ) (v : Vec3 × ℝ) : ℝ := MeasureTheory.convolution backwardTestKernel ζ (ContinuousLinearMap.lsmul ℝ ℝ) backwardProductVolume v @@ -654,18 +657,22 @@ lemma shifted_time_green (integral_Ioi_deriv_mul_eq_sub hu hv hprod hzero hzeroTop) /-- Causal heat kernel pairing a later test point with an earlier source point. -/ +@[expose] def backwardHeatKernel (z v : ParabolicPoint) : ℝ := heatKernelPlus (z.1 - v.1, z.2 - v.2) /-- Spatial derivative kernel in the backward heat-potential pairing. -/ +@[expose] def backwardHeatSpatialKernel (i : Fin 3) (z v : ParabolicPoint) : ℝ := heatKernelSpaceDerivative (z.1 - v.1) (z.2 - v.2) i /-- Backward heat potential obtained by integrating against the test variable. -/ +@[expose] def backwardHeatPotential (ζ : ParabolicPoint → ℝ) (v : ParabolicPoint) : ℝ := ∫ z, backwardHeatKernel z v * ζ z /-- Spatial derivative of the backward heat potential, including the differentiation sign. -/ +@[expose] def backwardHeatPotentialSpatial (i : Fin 3) (ζ : ParabolicPoint → ℝ) (v : ParabolicPoint) : ℝ := -(∫ z, backwardHeatSpatialKernel i z v * ζ z) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialIdentity.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialIdentity.lean index f0dbd5d4c4..6315167e12 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialIdentity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialIdentity.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.BackwardPotential Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialKernelBridge.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialKernelBridge.lean index 5797deb558..99a3df1677 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialKernelBridge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialKernelBridge.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialPairing.lean index 2407853632..ea2e723fb2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialPairing.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.BackwardPotential Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialSmooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialSmooth.lean index 357bd7e088..42e4fc3b72 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialSmooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/BackwardPotentialSmooth.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.BackwardPotential Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Basic.lean index 37c36f6138..6940045653 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Basic.lean @@ -19,7 +19,7 @@ quadratic form is written as a finite sum so that it is independent of the ambient sup norm on the function space. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -35,6 +35,7 @@ open CKN.Foundation.Parabolic /-! ### Definitions and elementary identities -/ /-- Three-dimensional Gaussian heat kernel, extended by zero to nonpositive time. -/ +@[expose] def heatKernel (x : Vec3) (t : ℝ) : ℝ := if 0 < t then (4 * Real.pi * t) ^ (-(3 : ℝ) / 2) * @@ -42,10 +43,12 @@ def heatKernel (x : Vec3) (t : ℝ) : ℝ := else 0 /-- Causal heat kernel on parabolic points. -/ +@[expose] def heatKernelPlus (p : ParabolicPoint) : ℝ := if 0 < p.2 then heatKernel p.1 p.2 else 0 /-- Sum of spatial Euclidean length and the square root of time used in kernel estimates. -/ +@[expose] def rhoTwo (x : Vec3) (t : ℝ) : ℝ := vec3EuclideanNorm x + Real.sqrt t diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Bounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Bounds.lean index 860b5a9e49..676fb6f87c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Bounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Bounds.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Kerne Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -38,10 +38,12 @@ lemma abs_vec3_component_le_norm (x : Vec3) (i : Fin 3) : exact hi /-- Sum of absolute spatial derivatives of the heat kernel. -/ +@[expose] def heatKernelGradientNorm (x : Vec3) (t : ℝ) : ℝ := ∑ i, |heatKernelSpaceDerivative x t i| /-- Time derivative of a spatial heat-kernel derivative, extended by zero to nonpositive time. -/ +@[expose] def heatKernelTimeGradientDerivative (x : Vec3) (t : ℝ) (i : Fin 3) : ℝ := if 0 < t then (x i) / (2 * t ^ 2) * heatKernel x t + @@ -50,6 +52,7 @@ def heatKernelTimeGradientDerivative (x : Vec3) (t : ℝ) (i : Fin 3) : ℝ := else 0 /-- Sum of absolute time derivatives of the spatial heat-kernel gradient. -/ +@[expose] def heatKernelTimeGradientNorm (x : Vec3) (t : ℝ) : ℝ := ∑ i, |heatKernelTimeGradientDerivative x t i| diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Convolution.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Convolution.lean index db24cf3b5c..f56ee08dec 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Convolution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Convolution.lean @@ -23,7 +23,7 @@ compactly supported function is the right factor, so Mathlib's right-factor regularity and derivative-transport theorems apply directly. -/ -@[expose] public section +public section open scoped Convolution open scoped BigOperators @@ -40,7 +40,7 @@ namespace CKN.Foundation.Heat open CKN.Foundation.Parabolic /-- Spatial convolution of the heat kernel with a scalar function. -/ -noncomputable def heatConv (t : ℝ) (u : Vec3 → ℝ) : Vec3 → ℝ := +@[expose] noncomputable def heatConv (t : ℝ) (u : Vec3 → ℝ) : Vec3 → ℝ := MeasureTheory.convolution (fun y : Vec3 => heatKernel y t) u (ContinuousLinearMap.lsmul ℝ ℝ) volume diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Cylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Cylinder.lean index dc5ec45da5..094eb87826 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Cylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Cylinder.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.TestFunction Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -28,7 +28,7 @@ namespace CKN.Foundation.Heat open CKN.Foundation.Parabolic /-- Spatial-gradient bound for the rescaled backward heat test function. -/ -def backwardHeatTestGradientNorm (r : ℝ) (x : Vec3) (t : ℝ) : ℝ := +@[expose] def backwardHeatTestGradientNorm (r : ℝ) (x : Vec3) (t : ℝ) : ℝ := r ^ 2 * heatKernelGradientNorm x (r ^ 2 - t) private lemma rpow_three_halves_eq_sqrt_cube {y : ℝ} (hy : 0 ≤ y) : diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/CylinderCentered.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/CylinderCentered.lean index 8b9fc00148..065ff263f9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/CylinderCentered.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/CylinderCentered.lean @@ -22,7 +22,7 @@ translated test function and proves the statements of `eq:psi-backward`, canonical-center statements exactly. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology @@ -38,6 +38,7 @@ open CKN.Foundation.Parabolic /-- The backward Gaussian test function `ψ_r` of `eq:psi-r` based at `z₀ = (x₀, t₀)`, namely `x ↦ r² G(x - x₀, r² - (t - t₀))` on a parabolic point `z = (x, t)`. -/ +@[expose] def centeredBackwardHeatTest (x₀ : Vec3) (t₀ r : ℝ) (z : ParabolicPoint) : ℝ := backwardHeatTestFunction r (z.1 - x₀) (z.2 - t₀) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/HigherBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/HigherBounds.lean index 350e61043c..33bfc427be 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/HigherBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/HigherBounds.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Heat.Bounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Integrability.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Integrability.lean index f1a99f8751..499335b719 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Integrability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Integrability.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/IntegralBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/IntegralBounds.lean index c44f7e1695..95d932c6af 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/IntegralBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/IntegralBounds.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/PolyExpBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/PolyExpBounds.lean index f589eef060..070b7d6e71 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/PolyExpBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/PolyExpBounds.lean @@ -19,7 +19,7 @@ public import Mathlib.Tactic.Positivity Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Smooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Smooth.lean index 5667d5871d..3ef4e09cd8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Smooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Smooth.lean @@ -19,7 +19,7 @@ The coordinate formulas below use the standard coordinate directions of quadratic expressions are finite sums. -/ -@[expose] public section +public section open scoped BigOperators ENNReal Topology @@ -33,6 +33,7 @@ namespace CKN.Foundation.Heat open CKN.Foundation.Parabolic /-- Time derivative formula for the causal heat kernel. -/ +@[expose] def heatKernelTimeDerivative (x : Vec3) (t : ℝ) : ℝ := if 0 < t then heatKernel x t * @@ -40,17 +41,19 @@ def heatKernelTimeDerivative (x : Vec3) (t : ℝ) : ℝ := else 0 /-- First spatial derivative formula for the causal heat kernel. -/ +@[expose] def heatKernelSpaceDerivative (x : Vec3) (t : ℝ) (i : Fin 3) : ℝ := if 0 < t then -(x i) / (2 * t) * heatKernel x t else 0 /-- Pure second spatial derivative formula for the causal heat kernel. -/ +@[expose] def heatKernelSpaceSecondDerivative (x : Vec3) (t : ℝ) (i : Fin 3) : ℝ := if 0 < t then ((x i) ^ 2 / (4 * t ^ 2) - 1 / (2 * t)) * heatKernel x t else 0 /-- Mixed second spatial derivative formula for the causal heat kernel. -/ -def heatKernelSpaceMixedSecondDerivative (x : Vec3) (t : ℝ) +@[expose] def heatKernelSpaceMixedSecondDerivative (x : Vec3) (t : ℝ) (i j : Fin 3) : ℝ := if 0 < t then ((x i) * (x j) / (4 * t ^ 2) - @@ -58,6 +61,7 @@ def heatKernelSpaceMixedSecondDerivative (x : Vec3) (t : ℝ) else 0 /-- Third spatial derivative formula for the causal heat kernel. -/ +@[expose] def heatKernelSpaceThirdDerivative (x : Vec3) (t : ℝ) (i j k : Fin 3) : ℝ := if 0 < t then @@ -68,6 +72,7 @@ def heatKernelSpaceThirdDerivative (x : Vec3) (t : ℝ) else 0 /-- Fourth spatial derivative formula for the causal heat kernel. -/ +@[expose] def heatKernelSpaceFourthDerivative (x : Vec3) (t : ℝ) (i j k l : Fin 3) : ℝ := if 0 < t then @@ -85,6 +90,7 @@ def heatKernelSpaceFourthDerivative (x : Vec3) (t : ℝ) else 0 /-- Spatial Laplacian of the heat kernel, summed over coordinate directions. -/ +@[expose] def heatKernelLaplacian (x : Vec3) (t : ℝ) : ℝ := ∑ i, heatKernelSpaceSecondDerivative x t i diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/SpaceSecondDeriv.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/SpaceSecondDeriv.lean index 0999245f13..fb4ae65e36 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/SpaceSecondDeriv.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/SpaceSecondDeriv.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Ambient.CoordD Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Subordination.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Subordination.lean index 325960d772..226bed1236 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Subordination.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/Subordination.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Integral.IntegralEqImproper Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/TestFunction.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/TestFunction.lean index 3af002e7a3..d3d8c8a608 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/TestFunction.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Heat/TestFunction.lean @@ -14,7 +14,7 @@ The backward test function used in the local energy calculation is recorded together with its nonnegativity. -/ -@[expose] public section +public section open scoped Topology @@ -26,6 +26,7 @@ namespace CKN.Foundation.Heat open CKN.Foundation.Parabolic /-- Rescaled backward heat test function centered at time `r ^ 2`. -/ +@[expose] def backwardHeatTestFunction (r : ℝ) (x : Vec3) (t : ℝ) : ℝ := r ^ 2 * heatKernel x (r ^ 2 - t) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/ENNRealHalfScale.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/ENNRealHalfScale.lean index 95b8c2f733..9f99b6602d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/ENNRealHalfScale.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/ENNRealHalfScale.lean @@ -15,7 +15,7 @@ public import Mathlib.Tactic.Linarith Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/Fatou.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/Fatou.lean index a34da6df66..e6fd4c8162 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/Fatou.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/Fatou.lean @@ -11,7 +11,7 @@ public import Mathlib.MeasureTheory.Integral.Bochner.Basic # Passing nonnegative integral bounds to an almost-everywhere limit -/ -@[expose] public section +public section open MeasureTheory Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/HolderTripleProducts.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/HolderTripleProducts.lean index 677b3ca333..5aeb880869 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/HolderTripleProducts.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/HolderTripleProducts.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.SMul Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/LayerCake.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/LayerCake.lean index 6adc945d80..3e9124814f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/LayerCake.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/LayerCake.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Integral Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistribution.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistribution.lean index fb9e8a3a78..a07aaefc88 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistribution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistribution.lean @@ -29,7 +29,7 @@ full-space form is exactly the slice hypothesis consumed by the pressure module's force-cancellation results. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionCore.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionCore.lean index ccbbb8a603..fad0162aa8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionCore.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionCore.lean @@ -38,7 +38,7 @@ testing one test function at a time is replaced by a single null set valid for every test function. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology Set diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionKernel.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionKernel.lean index 0a8101cfdf..b0f514f5b0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionKernel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionKernel.lean @@ -20,7 +20,7 @@ and its coordinate derivative is the translate of the coordinate derivative of the kernel. -/ -@[expose] public section +public section open MeasureTheory Metric diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionLocal.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionLocal.lean index a731de5b37..3441c71ba0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionLocal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionLocal.lean @@ -26,7 +26,7 @@ in the Caffarelli–Kohn–Nirenberg paper (CKN) when a spatially localised kern is slid against a locally integrable density. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionMollifyBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionMollifyBounds.lean index 6918f7be76..89d85ee6f2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionMollifyBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionMollifyBounds.lean @@ -19,7 +19,7 @@ throughout the Caffarelli–Kohn–Nirenberg argument. beyond the closed `ε`-neighbourhood of its topological support. -/ -@[expose] public section +public section open MeasureTheory Metric diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionSwap.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionSwap.lean index 998e4f7a06..cd8fd87c8b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionSwap.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionSwap.lean @@ -21,7 +21,7 @@ uses two ingredients that are independent of the differential operator at hand. function against a compactly supported continuous kernel. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionTransport.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionTransport.lean index 3295df72b4..6fe0ef9e9a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionTransport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceDistributionTransport.lean @@ -25,7 +25,7 @@ form of the weak partial derivative, so that a smooth `ψ` may be differentiated inside the pairing. -/ -@[expose] public section +public section open MeasureTheory Metric open scoped Convolution Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientBumps.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientBumps.lean index 3ebfdba029..2caeab5164 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientBumps.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientBumps.lean @@ -20,7 +20,7 @@ integrable function therefore applies: for any `g`, the functions `mollify g (sliceRadius n) _` converge to `g` almost everywhere. -/ -@[expose] public section +public section open MeasureTheory Filter Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientSelection.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientSelection.lean index e90923af3c..60b88cf081 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientSelection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceGradientSelection.lean @@ -54,7 +54,7 @@ Space-time points use the ordinary product space `Vec3 × ℝ` of docs/DESIGN_NO carrier on which `spatialPartial` and `spaceTimeTestFunction` are stated. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped Topology ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceMollifierIdentity.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceMollifierIdentity.lean index 85632ed4a7..b7424241fb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceMollifierIdentity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceMollifierIdentity.lean @@ -18,7 +18,7 @@ result is the integral form of the transport identity, stated on its own so that it can be used without unfolding the convolution derivative. -/ -@[expose] public section +public section open scoped Convolution Topology open MeasureTheory diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceProductMeasurability.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceProductMeasurability.lean index 39a78bf85a..4421b19364 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceProductMeasurability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SliceProductMeasurability.lean @@ -26,7 +26,7 @@ into a single space-time statement. obtained by transporting along the measure-preserving coordinate swap. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SupportRestrict.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SupportRestrict.lean index b14aa6795c..d5e21eee2c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SupportRestrict.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/SupportRestrict.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Integral.IntegrableOn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/WeightedKernelIdentity.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/WeightedKernelIdentity.lean index a827951dc6..aa68ade4ab 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/WeightedKernelIdentity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Measure/WeightedKernelIdentity.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallBasics.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallBasics.lean index 7d6875feb9..699e8f1302 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallBasics.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallBasics.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Cutoff.Ball Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallDisplays.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallDisplays.lean index 266210c57e..1a5dacf8b0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallDisplays.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallDisplays.lean @@ -27,7 +27,7 @@ volume of the Euclidean ball in `EuclideanSpace ℝ (Fin 3)` along the measure-preserving equivalence `WithLp.toLp 2`. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallOrigin.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallOrigin.lean index 1d550960d2..ddaf2adfd7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallOrigin.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/BallOrigin.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Vec3Norm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Basic.lean index 2140e5980e..c3aa4810fb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Basic.lean @@ -20,7 +20,7 @@ finite sum of squares. This is deliberate: the ambient function space's default norm can be the sup norm, whereas the cylinders here are Euclidean. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -38,6 +38,7 @@ abbrev Vec3 := Fin 3 → ℝ abbrev L2Vec3 := PiLp 2 (fun _ : Fin 3 => ℝ) /-- Space-time points, given the parabolic metric below rather than the product metric. -/ +@[expose] def ParabolicPoint := Vec3 × ℝ theorem half_pos : 0 < (1 / 2 : ℝ) := by norm_num @@ -48,6 +49,7 @@ theorem half_le_one : (1 / 2 : ℝ) ≤ 1 := by norm_num abbrev SnowTime := Metric.Snowflaking ℝ (1 / 2 : ℝ) half_pos half_le_one /-- Euclidean length of a native three-dimensional coordinate vector. -/ +@[expose] def vec3EuclideanNorm (v : Vec3) : ℝ := Real.sqrt (∑ i, v i ^ 2) instance : MeasurableSpace ParabolicPoint := inferInstanceAs (MeasurableSpace (Vec3 × ℝ)) @@ -57,6 +59,7 @@ instance : MeasurableSpace SnowTime := borel SnowTime instance : BorelSpace SnowTime := ⟨rfl⟩ /-- Measurable equivalence to Euclidean space times snowflaked time. -/ +@[expose] def parabolicMeasurableEquiv : ParabolicPoint ≃ᵐ L2Vec3 × SnowTime := MeasurableEquiv.prodCongr (MeasurableEquiv.toLp 2 Vec3) { toEquiv := Metric.Snowflaking.toSnowflaking @@ -64,6 +67,7 @@ def parabolicMeasurableEquiv : ParabolicPoint ≃ᵐ L2Vec3 × SnowTime := measurable_invFun := Metric.Snowflaking.homeomorph.continuous.measurable } /-- Coordinate map into the product carrying the parabolic metric. -/ +@[expose] def parabolicMap (p : ParabolicPoint) : L2Vec3 × SnowTime := parabolicMeasurableEquiv p @@ -106,6 +110,7 @@ lemma vec3EuclideanNorm_smul (a : ℝ) (v : Vec3) : ← vec3EuclideanNorm_eq_l2] /-- Maximum of spatial Euclidean distance and square-root time separation. -/ +@[expose] def parabolicDist (p q : ParabolicPoint) : ℝ := max (vec3EuclideanNorm (p.1 - q.1)) (Real.sqrt |p.2 - q.2|) @@ -115,10 +120,12 @@ lemma dist_eq_parabolicDist (p q : ParabolicPoint) : rfl /-- Open Euclidean ball in native spatial coordinates. -/ +@[expose] def vec3Ball (x : Vec3) (r : ℝ) : Set Vec3 := {y | vec3EuclideanNorm (y - x) < r} /-- Backward parabolic cylinder with spatial radius `r` and time depth `r ^ 2`. -/ +@[expose] def parabolicCylinder (x : Vec3) (t r : ℝ) : Set ParabolicPoint := vec3Ball x r ×ˢ Ioc (t - r ^ 2) t @@ -145,10 +152,12 @@ lemma parabolicCylinder_mono {x : Vec3} {t r₁ r₂ : ℝ} (hr₁ : 0 ≤ r₁) exact (sub_le_sub_left hrsq t).trans_lt hp₂ /-- Space-time translation by a spatial vector and time offset. -/ +@[expose] def parabolicTranslate (a : Vec3) (τ : ℝ) (p : ParabolicPoint) : ParabolicPoint := (a + p.1, τ + p.2) /-- Parabolic scaling, linear in space and quadratic in time. -/ +@[expose] def parabolicScale (a : ℝ) (p : ParabolicPoint) : ParabolicPoint := (a • p.1, a ^ 2 * p.2) @@ -265,6 +274,7 @@ lemma volume_parabolicCylinder_zero (x : Vec3) (t r : ℝ) : rw [volume_parabolicCylinder, volume_vec3Ball] /-- Hausdorff measure computed using the parabolic metric and the real value of the exponent. -/ +@[expose] def parabolicHausdorffMeasure (d : ℝ≥0∞) : Measure ParabolicPoint := MeasureTheory.Measure.hausdorffMeasure d.toReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Campanato.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Campanato.lean index ad166251db..d0e8d2cc5c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Campanato.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Campanato.lean @@ -21,7 +21,7 @@ series, and the comparison of the average of `|f|` on a subset with the average on the ambient set. The oscillations use genuine space-time averages. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -53,6 +53,7 @@ def ParabolicCylinderCampanatoBoundOn ParabolicCylinderLpOscillation f z.1 z.2 r p ≤ K * r ^ α /-- Geometric-series coefficient for summing dyadic Campanato oscillations. -/ +@[expose] def parabolicCampanatoTailConstant (α : ℝ) : ℝ := 1 / (1 - (2 : ℝ) ^ (-α)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolder.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolder.lean index 82a9c4f113..34d252e4c4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolder.lean @@ -14,28 +14,32 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.ParabolicHolderVecOn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set Metric Filter noncomputable section namespace CKN.Foundation.Parabolic /-- Normalized Lᵖ oscillation about the mean on a closed parabolic ball. -/ +@[expose] def ParabolicBallLpOscillation (f : ParabolicPoint → ℝ) (z : ParabolicPoint) (r p : ℝ) : ℝ := (⨍ y in @Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z r, |f y - ⨍ x in @Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z r, f x| ^ p) ^ (1 / p) /-- Uniform Campanato oscillation bound for balls centered in a given set. -/ +@[expose] def ParabolicBallCampanatoBoundOn (f : ParabolicPoint → ℝ) (U : Set ParabolicPoint) (R α K p : ℝ) : Prop := ∀ z ∈ U, ∀ {r : ℝ}, 0 < r → r ≤ R → ParabolicBallLpOscillation f z r p ≤ K * r ^ α /-- Campanato oscillation bound at every point and positive radius. -/ +@[expose] def GlobalParabolicBallCampanatoBound (f : ParabolicPoint → ℝ) (α K p : ℝ) : Prop := ∀ z : ParabolicPoint, ∀ {r : ℝ}, 0 < r → ParabolicBallLpOscillation f z r p ≤ K * r ^ α /-- Local integrability data needed to use ball averages and Lᵖ oscillations. -/ +@[expose] def ParabolicBallLpDataOn (f : ParabolicPoint → ℝ) (U : Set ParabolicPoint) (R p : ℝ) : Prop := ∀ z ∈ U, ∀ {r : ℝ}, 0 < r → r ≤ R → @@ -44,6 +48,7 @@ def ParabolicBallLpDataOn (f : ParabolicPoint → ℝ) (U : Set ParabolicPoint) @Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z r, f x| ^ p) (@Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z r) volume /-- Averages over a dyadically shrinking sequence of closed parabolic balls. -/ +@[expose] def ParabolicBallMeanSeq (f : ParabolicPoint → ℝ) (R : ℝ) (z : ParabolicPoint) (n : ℕ) : ℝ := ⨍ y in @Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z (R / (2 : ℝ) ^ n), f y @@ -452,6 +457,7 @@ theorem abs_parabolicBallRepresentative_sub_meanSeq_le unfold parabolicCampanatoTailConstant field_simp /-- Integrability data for ball averages and oscillations at all points and radii. -/ +@[expose] def GlobalParabolicBallLpData (f : ParabolicPoint → ℝ) (p : ℝ) : Prop := ∀ z : ParabolicPoint, ∀ {r : ℝ}, 0 < r → @@ -462,6 +468,7 @@ def GlobalParabolicBallLpData @Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z r, f x| ^ p) (@Metric.closedBall ParabolicPoint parabolicPseudoMetricSpace z r) volume /-- Explicit coefficient converting a Campanato bound to a Hölder bound. -/ +@[expose] def parabolicCampanatoHolderConstant (α p : ℝ) : ℝ := (2 * parabolicCampanatoTailConstant α + 1) * (2 : ℝ) ^ (5 / p) * (8 : ℝ) ^ α diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderCorollaries.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderCorollaries.lean index b373af59eb..a245a3aed3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderCorollaries.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderCorollaries.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.ParabolicHolderVecOn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderFinal.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderFinal.lean index 5e0d022ce6..c363976dfe 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderFinal.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/CampanatoHolderFinal.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.CampanatoHol Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Covering.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Covering.lean index 3ebdaebfc8..b274b50fae 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Covering.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Covering.lean @@ -16,7 +16,7 @@ This file records the measure estimate obtained by applying the Vitali covering theorem to the metric balls associated with the parabolic cylinders. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Doubling.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Doubling.lean index 0da694a3a1..52cd5b970c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Doubling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Doubling.lean @@ -19,7 +19,7 @@ use the cylinder/metric-ball comparison from `Basic` to provide the doubling instance required by metric covering arguments. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Holder.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Holder.lean index d28649da59..09ab7369a3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Holder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Holder.lean @@ -14,7 +14,7 @@ This module names the seminorm used by the space-time regularity statements. The measure-theoretic representative predicate records agreement on a set. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -26,6 +26,7 @@ noncomputable section namespace CKN.Foundation.Parabolic /-- Pointwise Hölder seminorm bound with respect to parabolic distance. -/ +@[expose] def ParabolicHolderSeminormLE (U : Set ParabolicPoint) (g : ParabolicPoint → ℝ) (α K : ℝ) : Prop := diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Average.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Average.lean index 5e09f173ab..85f8f2d2fc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Average.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Average.lean @@ -24,7 +24,7 @@ The source-facing scale-invariant quantities are intentionally not defined here. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/ProdSwap.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/ProdSwap.lean index 16d2f49a6e..6322f1ada4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/ProdSwap.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/ProdSwap.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.Lebesgue.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Scaling.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Scaling.lean index 3e3e9983ac..38362d038a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Scaling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Scaling.lean @@ -18,7 +18,7 @@ change-of-variables statements needed for scale-invariant quantities. In particular, no source-facing quantity is introduced in this module. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open scoped ENNReal Pointwise @@ -554,10 +554,12 @@ theorem volume_parabolicCylinder_translate (a x : Vec3) (τ t r : ℝ) : simp_rw [volume_vec3Ball] /-- The nonnegative energy of a spatial time slice. -/ +@[expose] def timeSliceBallEnergy (x : Vec3) (r s : ℝ) (g : ParabolicPoint → ℝ) : ℝ≥0∞ := ∫⁻ y in vec3Ball x r, ‖g (y, s)‖ₑ ^ (2 : ℝ) /-- Essential supremum of a time-slice energy over the cylinder time interval. -/ +@[expose] def timeSliceEnergyEssSup (x : Vec3) (t r : ℝ) (g : ParabolicPoint → ℝ) : ℝ≥0∞ := essSup (timeSliceBallEnergy x r · g) (volume.restrict (Ioc (t - r ^ 2) t)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/SingletonNull.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/SingletonNull.lean index 269a3dfb8e..469ed13198 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/SingletonNull.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/SingletonNull.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Slice.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Slice.lean index 8a14f0fdb3..8c40ff845b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Slice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Integration/Slice.lean @@ -20,7 +20,7 @@ The definitions remain the ordinary Mathlib set averages, so existing `average`, `eLpNorm`, and restriction lemmas apply without a second normalization convention. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open scoped ENNReal @@ -30,6 +30,7 @@ noncomputable section namespace CKN.Foundation.Parabolic.Integration /-- The spatial average of a scalar function at a fixed time. -/ +@[expose] def spatialAverage (x : Vec3) (r s : ℝ) (g : ParabolicPoint → ℝ) : ℝ := ⨍ y in vec3Ball x r, g (y, s) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/HardyLittlewood.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/HardyLittlewood.lean index e2cba6795d..47d387b85b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/HardyLittlewood.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/HardyLittlewood.lean @@ -19,7 +19,7 @@ theorem. The covering argument follows the general metric-measure argument in under Apache 2.0. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -35,6 +35,7 @@ abbrev hardyLittlewoodParabolicMetricBall (z : ParabolicPoint) (r : ℝ) : Set P @Metric.ball ParabolicPoint parabolicPseudoMetricSpace z r /-- Uncentered Hardy–Littlewood maximal function over parabolic balls. -/ +@[expose] def parabolicMaximalFunction (f : ParabolicPoint → ℝ≥0∞) (z : ParabolicPoint) : ℝ≥0∞ := ⨆ c : ParabolicPoint, ⨆ r : ℝ, (hardyLittlewoodParabolicMetricBall c r).indicator diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/StrongType.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/StrongType.lean index f4a3523cc2..6d57be372c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/StrongType.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Maximal/StrongType.lean @@ -23,7 +23,7 @@ half the level and Tonelli's theorem, so it does not depend on an abstract interpolation package. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology @@ -35,6 +35,7 @@ noncomputable section namespace CKN.Foundation.Parabolic /-- Explicit strong-type coefficient for the parabolic maximal operator. -/ +@[expose] def parabolicMaximalStrongConstant (p : ℝ) : ℝ≥0∞ := (2 : ℝ≥0∞) ^ p * ENNReal.ofReal (10 ^ 5) * ENNReal.ofReal p / ENNReal.ofReal (p - 1) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Adams.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Adams.lean index 1ac4843308..5a6ca8aa3d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Adams.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Adams.lean @@ -17,7 +17,7 @@ This module connects the parabolic Riesz potential with the exported maximal function estimates and the cylinder Morrey seminorm. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -28,6 +28,7 @@ noncomputable section namespace CKN.Foundation.Parabolic.Morrey /-- The maximal function applied to the absolute value of a real function. -/ +@[expose] def parabolicMaximalMajorant (f : ParabolicPoint → ℝ) : ParabolicPoint → ℝ≥0∞ := parabolicMaximalFunction (fun w ↦ ENNReal.ofReal |f w|) @@ -251,6 +252,7 @@ private lemma near_shell_integral_le ac_rfl /-- The geometric constant in the local Hedberg estimate. -/ +@[expose] def parabolicHedbergNearConstant (β : ℝ) : ℝ≥0∞ := (ENNReal.ofReal (2 ^ 5) * (ENNReal.ofReal (2 ^ 5) * volume (parabolicCylinder 0 0 1))) * diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsBridge.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsBridge.lean index 2a8df775df..82d017b1b6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsBridge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsBridge.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Adams Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsEndpoints.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsEndpoints.lean index cb92943863..a3910e3cc0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsEndpoints.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsEndpoints.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Adams Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsM4.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsM4.lean index e296b229f9..ea849f65d9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsM4.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/AdamsM4.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Adams Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -24,6 +24,7 @@ noncomputable section namespace CKN.Foundation.Parabolic.Morrey /-- A concrete constant for the localized maximal-function estimate. -/ +@[expose] def parabolicAdamsMaximalConstant (P τ : ℝ) : ℝ≥0∞ := (2 : ℝ≥0∞) ^ (P - 1) * (parabolicMaximalStrongConstant P * @@ -34,6 +35,7 @@ def parabolicAdamsMaximalConstant (P τ : ℝ) : ℝ≥0∞ := (volume (parabolicCylinder 0 0 1)) ^ (1 - 1 / P)) ^ P) /-- A concrete constant in the parabolic Adams inequality. -/ +@[expose] def parabolicAdamsPotentialConstant (β P τ : ℝ) : ℝ≥0∞ := let lam : ℝ := 1 - β * τ / 5 let theta : ℝ := β * τ / 5 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Basic.lean index ab9ade95c5..7098665886 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Basic.lean @@ -20,7 +20,7 @@ metric-ball version is kept alongside it; the two versions are compared by the inclusions between cylinders and metric balls. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -34,16 +34,19 @@ namespace CKN.Foundation.Parabolic.Morrey abbrev Q := (5 : ℝ) /-- The integral part of a Morrey cell on a parabolic cylinder. -/ +@[expose] def cylinderPowerIntegral (p : ℝ) (f : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ≥0∞ := ∫⁻ w in parabolicCylinder z.1 z.2 r, ENNReal.ofReal |f w| ^ p /-- The integral part of a Morrey cell on a metric ball. -/ +@[expose] def ballPowerIntegral (p : ℝ) (f : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ≥0∞ := ∫⁻ w in Metric.ball z r, ENNReal.ofReal |f w| ^ p /-- The Morrey cell attached to a positive-radius cylinder. -/ +@[expose] def morreyCell (p q : ℝ) (f : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ≥0∞ := (ENNReal.ofReal r) ^ (-(Q * (1 - p / q) / p)) * @@ -58,16 +61,19 @@ theorem morreyCell_eq (p q : ℝ) (f : ParabolicPoint → ℝ) rfl /-- The Morrey cell attached to a positive-radius metric ball. -/ +@[expose] def morreyBallCell (p q : ℝ) (f : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ≥0∞ := (ENNReal.ofReal r) ^ (-(Q * (1 - p / q) / p)) * (ballPowerIntegral p f z r) ^ (1 / p) /-- The parabolic Morrey seminorm, with homogeneous dimension `Q = 5`. -/ +@[expose] def morreyNorm (p q : ℝ) (f : ParabolicPoint → ℝ) : ℝ≥0∞ := ⨆ z : ParabolicPoint, ⨆ r : {r : ℝ // 0 < r}, morreyCell p q f z r.1 /-- The metric-ball version of the parabolic Morrey seminorm. -/ +@[expose] def morreyBallNorm (p q : ℝ) (f : ParabolicPoint → ℝ) : ℝ≥0∞ := ⨆ z : ParabolicPoint, ⨆ r : {r : ℝ // 0 < r}, morreyBallCell p q f z r.1 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Cylinders.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Cylinders.lean index 0634733589..234e771d3a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Cylinders.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Cylinders.lean @@ -22,7 +22,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Hedberg.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Hedberg.lean index 1bb8b11aef..5d63fd2bc6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Hedberg.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Hedberg.lean @@ -15,7 +15,7 @@ the parameter property used by the pointwise potential argument and records the exponent identities needed by its eventual proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -26,7 +26,7 @@ noncomputable section namespace CKN.Foundation.Parabolic.Morrey /-- A function is a parabolic uncentred maximal majorant for `f`. -/ -def IsParabolicMaximalMajorant (f : ParabolicPoint → ℝ) +@[expose] def IsParabolicMaximalMajorant (f : ParabolicPoint → ℝ) (M : ParabolicPoint → ℝ≥0∞) : Prop := ∀ z : ParabolicPoint, ∀ R : ℝ, 0 < R → (∫⁻ w in Metric.ball z R, ENNReal.ofReal |f w|) ≤ diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Inclusions.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Inclusions.lean index a48c32b73c..02c6ca6f57 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Inclusions.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Inclusions.lean @@ -14,7 +14,7 @@ This module records the change of Morrey exponent available for functions supported in one parabolic cylinder. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Indicator.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Indicator.lean index 0182164dc0..1507f7157c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Indicator.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Indicator.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Kernel.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Kernel.lean index fd06665e3d..c1b03434c1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Kernel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Kernel.lean @@ -16,7 +16,7 @@ potential estimates and expose the dyadic shell geometry used by later integral estimates. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -27,20 +27,22 @@ noncomputable section namespace CKN.Foundation.Parabolic.Morrey /-- The parabolic gauge used by the order-`β` Riesz kernel. -/ -def parabolicRho₂ (z w : ParabolicPoint) : ℝ := +@[expose] def parabolicRho₂ (z w : ParabolicPoint) : ℝ := Real.sqrt |z.2 - w.2| + vec3EuclideanNorm (z.1 - w.1) /-- The order-`β` parabolic Riesz kernel as an extended nonnegative function. -/ +@[expose] def parabolicRieszKernel (β : ℝ) (z w : ParabolicPoint) : ℝ≥0∞ := (ENNReal.ofReal (parabolicRho₂ z w)) ^ (-(5 - β)) /-- The nonnegative parabolic Riesz potential. -/ +@[expose] def parabolicRieszPotential (β : ℝ) (f : ParabolicPoint → ℝ) (z : ParabolicPoint) : ℝ≥0∞ := ∫⁻ w, parabolicRieszKernel β z w * ENNReal.ofReal |f w| /-- The shell with inner radius `2^k R` and outer radius `2^(k+1) R`. -/ -def parabolicRieszShell (R : ℝ) (k : ℤ) (z : ParabolicPoint) : Set ParabolicPoint := +@[expose] def parabolicRieszShell (R : ℝ) (k : ℤ) (z : ParabolicPoint) : Set ParabolicPoint := {w | (2 : ℝ) ^ (k : ℝ) * R ≤ parabolicRho₂ z w ∧ parabolicRho₂ z w < (2 : ℝ) ^ ((k : ℝ) + 1) * R} diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Minkowski.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Minkowski.lean index 09b8228060..12454bd1d2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Minkowski.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Minkowski.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Integral.MeanInequalities Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -27,12 +27,14 @@ noncomputable section namespace CKN.Foundation.Parabolic.Morrey /-- The Morrey cell for an extended nonnegative-valued function. -/ +@[expose] def morreyENormCell (p q : ℝ) (f : ParabolicPoint → ℝ≥0∞) (z : ParabolicPoint) (r : ℝ) : ℝ≥0∞ := (ENNReal.ofReal r) ^ (-(5 * (1 - p / q) / p)) * (∫⁻ w in parabolicCylinder z.1 z.2 r, f w ^ p) ^ (1 / p) /-- The extended nonnegative-valued Morrey seminorm. -/ +@[expose] def morreyENorm (p q : ℝ) (f : ParabolicPoint → ℝ≥0∞) : ℝ≥0∞ := ⨆ z : ParabolicPoint, ⨆ r : {r : ℝ // 0 < r}, morreyENormCell p q f z r.1 @@ -457,7 +459,7 @@ theorem morreyENorm_parabolicConvolution_le exact lintegral_mul_const' _ _ hfinit /-- Spatial convolution of a parabolic source at each fixed time. -/ -def spatialConvolution (K : Vec3 → ℝ≥0∞) (f : ParabolicPoint → ℝ≥0∞) +@[expose] def spatialConvolution (K : Vec3 → ℝ≥0∞) (f : ParabolicPoint → ℝ≥0∞) (z : ParabolicPoint) : ℝ≥0∞ := ∫⁻ y, K y * f (parabolicTranslate (-y) 0 z) ∂volume diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Neg.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Neg.lean index 0d90a9bbf7..9922e70f60 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Neg.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Neg.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Tail.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Tail.lean index c3ef492d0b..d12771f64d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Tail.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Tail.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Kerne Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology @@ -380,6 +380,7 @@ private lemma tail_integral_le_shell_sum {β : ℝ} {R : ℝ} (hR : 0 < R) rfl /-- The dyadic constant used by the Morrey tail estimate. -/ +@[expose] def parabolicTailKernelConstant (β q : ℝ) : ℝ≥0∞ := ∑' n : ℕ, (ENNReal.ofReal (2 : ℝ)) ^ ((n : ℝ) * (β - 5 / q) + 2 * (5 * (1 - 1 / q))) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/VecMem.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/VecMem.lean index 709d3ea5d5..d679c7d6fb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/VecMem.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/VecMem.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Neg Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Zero.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Zero.lean index 9bb12b269a..37b9d70d1f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Zero.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Morrey/Zero.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.MorreyVecMem Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/OffCentreInclusion.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/OffCentreInclusion.lean index 81dc619a4e..392c483cb9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/OffCentreInclusion.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/OffCentreInclusion.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Vec3Norm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Topology.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Topology.lean index d6cc2250e3..a4a3a704b6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Topology.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Topology.lean @@ -23,7 +23,7 @@ and `I`, and the interior and closure of a parabolic cylinder are computed from Euclidean ball and the intervals `Ioo` and `Icc`. -/ -@[expose] public section +public section open scoped Topology open Set Metric @@ -91,6 +91,7 @@ theorem continuous_prod_to_parabolicPoint : /-- The identity, viewed as a homeomorphism from the parabolic space-time to `Vec3 × ℝ` with the product topology. This is the topology bridge: set-theoretic operations on space-time sets may be performed on the product instead. -/ +@[expose] def parabolicHomeomorph : ParabolicPoint ≃ₜ Vec3 × ℝ where toFun := fun p => (p.1, p.2) invFun := fun q => ((q.1, q.2) : ParabolicPoint) @@ -124,6 +125,7 @@ theorem topologicalSpace_eq_induced_prod : /-- The identification of `Vec3` (with its product-of-coordinates topology) with `L²(ℝ³)`, under which `vec3EuclideanNorm` is the `L²` norm. -/ +@[expose] def vec3Homeomorph : Vec3 ≃ₜ L2Vec3 := (PiLp.homeomorph 2 (fun _ : Fin 3 => ℝ)).symm diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportProduct.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportProduct.lean index 83602db93d..714c0f8b6e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportProduct.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportProduct.lean @@ -14,7 +14,7 @@ public import Mathlib.Topology.Constructions.SumProd Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportSpatialBox.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportSpatialBox.lean index af476a3231..7fc48ea3be 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportSpatialBox.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/TsupportSpatialBox.lean @@ -15,7 +15,7 @@ public import Mathlib.Topology.Separation.Regular Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Vec3Norm.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Vec3Norm.lean index db9d22a866..1163ba078f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Vec3Norm.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Parabolic/Vec3Norm.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basic.lean index 640d2c694c..9f360b2de9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basic.lean @@ -15,7 +15,7 @@ permission. This port keeps only the coordinate carrier needed by the weak-derivative API and uses the `CKN` namespace. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basis.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basis.lean index eb98a46778..e714e1fb23 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basis.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/Basis.lean @@ -16,11 +16,12 @@ permission. This port retains the coordinate basis and reconstruction facts needed to state coordinate weak derivatives, under the `CKN` namespace. -/ -@[expose] public section +public section namespace CKN /-- The `i`th coordinate basis vector in the native ambient space. -/ +@[expose] def basisVec {d : ℕ} (i : Fin d) : Vec d := Pi.single i (1 : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/CoordDeriv.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/CoordDeriv.lean index 73a0a8299d..466475477f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/CoordDeriv.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Ambient/CoordDeriv.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Calculus.FDeriv.Comp Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Ball.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Ball.lean index d04c29c37e..8f004c8402 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Ball.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Ball.lean @@ -41,7 +41,7 @@ explicit Euclidean squared distance. `32 / (R - r)`. -/ -@[expose] public section +public section open Set @@ -54,11 +54,12 @@ def euclideanSqDist {d : ℕ} (x y : Vec d) : ℝ := vecNormSq (x - y) /-- The explicit round Euclidean open ball. -/ +@[expose] def euclideanBall {d : ℕ} (x₀ : Vec d) (R : ℝ) : Set (Vec d) := {x | euclideanSqDist x x₀ < R ^ 2} /-- The explicit round Euclidean closed ball. -/ -def euclideanClosedBall {d : ℕ} (x₀ : Vec d) (R : ℝ) : Set (Vec d) := +@[expose] def euclideanClosedBall {d : ℕ} (x₀ : Vec d) (R : ℝ) : Set (Vec d) := {x | euclideanSqDist x x₀ ≤ R ^ 2} @[simp] diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallMemLp.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallMemLp.lean index bc03583ddc..696eae92ab 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallMemLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallMemLp.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallTopology.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallTopology.lean index d6ded186c7..2bd61ffabb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallTopology.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/BallTopology.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Basic.lean index 19cad2da1e..30a5f1e0f2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Basic.lean @@ -26,21 +26,24 @@ The main definitions are `CKN.vecEuclideanNorm` and `CKN.classicalGradient`. The norm lemmas give positivity, scalar multiplication and component bounds. -/ -@[expose] public section +public section open scoped BigOperators namespace CKN /-- The Euclidean dot product on native coordinate vectors. -/ +@[expose] def vecDot {d : ℕ} (x y : Vec d) : ℝ := ∑ i, x i * y i /-- The square of the Euclidean norm on native coordinate vectors. -/ +@[expose] def vecNormSq {d : ℕ} (x : Vec d) : ℝ := vecDot x x /-- The Euclidean norm on native coordinate vectors. -/ +@[expose] noncomputable def vecEuclideanNorm {d : ℕ} (x : Vec d) : ℝ := Real.sqrt (vecNormSq x) @@ -113,6 +116,7 @@ theorem abs_apply_le_vecEuclideanNorm {d : ℕ} exact Real.abs_le_sqrt (sq_apply_le_vecNormSq x i) /-- The coordinate gradient of a scalar function in the native vector carrier. -/ +@[expose] noncomputable def classicalGradient {d : ℕ} (f : Vec d → ℝ) (x : Vec d) : Vec d := fun i => (fderiv ℝ f x) (basisVec i) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormLeVecEuclidean.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormLeVecEuclidean.lean index 7bd46f5540..a02ebef3cc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormLeVecEuclidean.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormLeVecEuclidean.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Cutoff.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormTriangle.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormTriangle.lean index 45cea45fde..b3b647707a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormTriangle.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/NormTriangle.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.Normed.Lp.PiLp Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Profile.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Profile.lean index 551412ad5d..aaa19fae91 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Profile.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/Profile.lean @@ -32,7 +32,7 @@ permission. The namespace and imports are independent. bounded by `8`. -/ -@[expose] public section +public section noncomputable section @@ -41,6 +41,7 @@ open Polynomial namespace CKN /-- The canonical smooth transition from `0` to `1`. -/ +@[expose] def smoothTransitionProfile : ℝ → ℝ := Real.smoothTransition @@ -71,6 +72,7 @@ theorem le_one (t : ℝ) : Real.smoothTransition.le_one t /-- The explicit first-derivative constant for the canonical transition. -/ +@[expose] def derivBound : ℝ := 8 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/SpaceTime.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/SpaceTime.lean index 3ed97e0d91..38e17eebfe 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/SpaceTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Cutoff/SpaceTime.lean @@ -37,7 +37,7 @@ one-dimensional time cutoff in the `CKN` namespace. `spaceTimeCutoff_support_subset` give the product cutoff properties. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/H1/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/H1/Basic.lean index 05d63b5206..ec62785dbd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/H1/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/H1/Basic.lean @@ -25,7 +25,7 @@ representative-level `W1pFunction` API. * The conversion lemmas preserve values and gradients definitionally. -/ -@[expose] public section +public section open scoped ENNReal @@ -89,6 +89,7 @@ theorem memH1 {d : ℕ} {U : Set (Vec d)} (u : H1Function U) : ⟨u, rfl⟩ /-- Regard an `H1Function` as the corresponding `W1pFunction` at `p = 2`. -/ +@[expose] def toW1pFunction {d : ℕ} {U : Set (Vec d)} (u : H1Function U) : W1pFunction U (2 : ℝ≥0∞) where toFun := u.toFun @@ -120,6 +121,7 @@ end H1Function namespace W1pFunction /-- Regard a `W1pFunction` at `p = 2` as the corresponding `H1Function`. -/ +@[expose] def toH1Function {d : ℕ} {U : Set (Vec d)} (u : W1pFunction U (2 : ℝ≥0∞)) : H1Function U where toFun := u.toFun @@ -157,6 +159,7 @@ theorem toH1Function_toW1pFunction {d : ℕ} {U : Set (Vec d)} apply H1Function.ext <;> rfl /-- Restrict an `H1Function` to an open subset. -/ +@[expose] def restrict {d : ℕ} {U V : Set (Vec d)} (u : H1Function U) (hVOpen : IsOpen V) (hVU : V ⊆ U) : H1Function V := diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/H1.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/H1.lean index 9c11b24d07..180789a40a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/H1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/H1.lean @@ -24,13 +24,14 @@ global mollification then supplies smooth functions, and Fatou's lemma passes th representative. This preserves the absolute constant from the smooth estimate. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Convolution namespace CKN noncomputable section /-- The extended `Lᵖ` seminorm of a chosen weak gradient on a set. -/ +@[expose] def weakGradientLpNormOn (p : ℝ≥0∞) (s : Set (Vec 3)) (Du : Vec 3 → Vec 3) : ℝ≥0∞ := eLpNorm Du p (volume.restrict s) private theorem fderiv_norm_le_three_classicalGradient_h1 diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Seeley.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Seeley.lean index 55c22d33d1..585c697e60 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Seeley.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Seeley.lean @@ -23,7 +23,7 @@ function across the unit sphere. The geometric estimates are recorded on the closed annulus and the gluing interface is kept independent of the radial maps. -/ -@[expose] public section +public section open Set MeasureTheory open scoped BigOperators @@ -36,22 +36,27 @@ noncomputable section attribute [local instance] Classical.propDecidable /-- The open annulus on which both radial reflections are smooth. -/ +@[expose] def seeleyAnnulus : Set (Vec 3) := {x | (1 / 2 : ℝ) < vecEuclideanNorm x ∧ vecEuclideanNorm x < 3} /-- The closed annulus used for the extension estimates. -/ +@[expose] def seeleyClosedAnnulus : Set (Vec 3) := {x | 1 ≤ vecEuclideanNorm x ∧ vecEuclideanNorm x ≤ 2} /-- The first radial reflection, `x ↦ x / |x|²`. -/ +@[expose] def seeleyReflectionOne (x : Vec 3) : Vec 3 := (vecNormSq x)⁻¹ • x /-- The second radial reflection, `x ↦ x / ((2|x| - 1)|x|)`. -/ +@[expose] def seeleyReflectionTwo (x : Vec 3) : Vec 3 := ((2 * vecEuclideanNorm x - 1) * vecEuclideanNorm x)⁻¹ • x /-- The exterior formula in the two-reflection extension. -/ +@[expose] def seeleyExterior (v : Vec 3 → ℝ) (x : Vec 3) : ℝ := 3 * v (seeleyReflectionOne x) - 2 * v (seeleyReflectionTwo x) @@ -377,6 +382,7 @@ theorem seeley_glue_hasFDerivAt_of_not_mem simp only [hyC, ite_false] /-- The piecewise two-reflection extension, before a cutoff is applied. -/ +@[expose] def seeleyExtension (v : Vec 3 → ℝ) (x : Vec 3) : ℝ := if x ∈ euclideanClosedBall (0 : Vec 3) 1 then v x else seeleyExterior v x diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyBounds.lean index 9820703905..e8cf26f519 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyBounds.lean @@ -18,7 +18,7 @@ The constants are deliberately coarse absolute constants; their role is to make the change-of-variables estimates explicit. -/ -@[expose] public section +public section open Set MeasureTheory open scoped BigOperators ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyC1.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyC1.lean index cd4dec8b76..efc21dc37c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyC1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyC1.lean @@ -15,7 +15,7 @@ two-reflection extension. The derivative is glued across the unit sphere using matching identities from `Seeley`. -/ -@[expose] public section +public section open Set open scoped Topology @@ -399,7 +399,7 @@ theorem seeleyExtension_fderiv_eq_reflection_combo_of_mem_annulus exact hext.fderiv /-- Seeley extension multiplied by a compactly supported spatial cutoff. -/ -def seeleyCutoffExtension (v : Vec 3 → ℝ) : Vec 3 → ℝ := +@[expose] def seeleyCutoffExtension (v : Vec 3 → ℝ) : Vec 3 → ℝ := canonicalBallCutoff (0 : Vec 3) 1 2 * seeleyExtension v end diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyEnergy.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyEnergy.lean index 750ad316e9..a98b9e4f0a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyEnergy.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyEnergy.lean @@ -17,7 +17,7 @@ nonnegative extended-valued integrands, so no auxiliary measurability assumptions are needed at this stage. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal @@ -29,7 +29,7 @@ noncomputable section attribute [local instance] Classical.propDecidable /-- The part of the closed annulus lying in the outer unit-ball shell. -/ -def seeleyOuterAnnulus : Set (Vec 3) := +@[expose] def seeleyOuterAnnulus : Set (Vec 3) := {x | 1 < vecEuclideanNorm x ∧ vecEuclideanNorm x < 2} theorem seeleyOuterAnnulus_subset_closedAnnulus : diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyGradient.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyGradient.lean index 7224255fc9..b487daff59 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyGradient.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyGradient.lean @@ -18,7 +18,7 @@ The chain rule and the operator-norm estimates from `SeeleyBounds` are combined with the pullback estimates from `SeeleyEnergy`. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyL1.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyL1.lean index fe7841b2f6..22c8f5406e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyL1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyL1.lean @@ -16,7 +16,7 @@ energy bounds. They are used to control the value and derivative terms after the compactly supported cutoff is applied to a mean-subtracted function. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyPoincare.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyPoincare.lean index ec188a6e6e..d641fdcaa5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyPoincare.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyPoincare.lean @@ -18,7 +18,7 @@ public import Mathlib.Analysis.Convex.Measure Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal @@ -171,6 +171,7 @@ theorem euclideanClosedBall_one_ae_eq_euclideanBall : exact measure_mono_null hsub measure_empty /-- Explicit L² Poincare coefficient on the unit Euclidean ball. -/ +@[expose] noncomputable def euclideanBallPoincareConstant : ℝ≥0∞ := let A : ℝ := (MeasureTheory.volume seeleyUnitEuclideanBall).toReal⁻¹ * diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyScaling.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyScaling.lean index 0709964c20..014ad4225a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyScaling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleyScaling.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Inequalities.S Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal Pointwise @@ -23,7 +23,7 @@ namespace CKN noncomputable section /-- Affine map transporting the unit ball to a ball centered at `x₀` with scale `r`. -/ -def seeleyAffineMap (x₀ : Vec 3) (r : ℝ) (x : Vec 3) : Vec 3 := +@[expose] def seeleyAffineMap (x₀ : Vec 3) (r : ℝ) (x : Vec 3) : Vec 3 := x₀ + r • x private theorem seeleyAffineMap_preimage (x₀ : Vec 3) {r : ℝ} (hr : 0 < r) : diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleySplit.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleySplit.lean index b232f58b3a..704453a77c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleySplit.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/SeeleySplit.lean @@ -15,7 +15,7 @@ densities. The resulting theorem is applied only after the density has been made opaque at the use site. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Smooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Smooth.lean index c8a282f0f3..7e762df3d8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Smooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Inequalities/Smooth.lean @@ -25,7 +25,7 @@ for a smooth cutoff. Interpolation yields the `L³` and `L^(10/3)` estimates; for `Q_r = (t-r²,t) × B_r`, the `L³` cylinder factor is `r^(1/2)`. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal @@ -35,10 +35,12 @@ namespace CKN noncomputable section /-- The extended `Lᵖ` seminorm of a function on a measurable set. -/ +@[expose] def lpNormOn (p : ℝ≥0∞) (s : Set (Vec 3)) (u : Vec 3 → ℝ) : ℝ≥0∞ := eLpNorm u p (volume.restrict s) /-- The extended `Lᵖ` seminorm of the native classical gradient. -/ +@[expose] def gradientLpNormOn (p : ℝ≥0∞) (s : Set (Vec 3)) (u : Vec 3 → ℝ) : ℝ≥0∞ := eLpNorm (classicalGradient u) p (volume.restrict s) @@ -108,6 +110,7 @@ private theorem canonicalBallCutoff_gradient_norm_bound /- The fixed factor is absolute because the ambient dimension is three. -/ /-- Euclidean Sobolev coefficient inherited from Mathlib's compact-support inequality. -/ +@[expose] noncomputable def localSobolevConstant : ℝ≥0∞ := ((3 : NNReal) : ℝ≥0∞) * (SNormLESNormFDerivOfEqConst (E := Vec 3) ℝ (volume : Measure (Vec 3)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/CompactMultiplier.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/CompactMultiplier.lean index 23de484343..87d8fae1bf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/CompactMultiplier.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/CompactMultiplier.lean @@ -16,7 +16,7 @@ public import Mathlib.Topology.Algebra.Support Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/RestrictedVolume.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/RestrictedVolume.lean index c679f5ea4f..b28c15ea17 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/RestrictedVolume.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Measure/RestrictedVolume.lean @@ -17,7 +17,7 @@ permission. This port keeps the common restricted-volume abbreviations and drops domain regularity predicates that are not needed by weak derivatives. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Basic.lean index 767cbe3b43..21467cc8af 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Basic.lean @@ -20,13 +20,14 @@ regularity, and approximate-identity convergence. This direct port keeps the kernel and convolution API independent of the sibling geometry layer. -/ -@[expose] public section +public section open scoped Convolution Topology namespace CKN /-- A smooth bump centered at zero with outer radius `ε`. -/ +@[expose] noncomputable def standardMollifier {d : ℕ} (ε : ℝ) (hε : 0 < ε) : ContDiffBump (0 : Vec d) := { rIn := ε / 2 @@ -35,6 +36,7 @@ noncomputable def standardMollifier {d : ℕ} (ε : ℝ) (hε : 0 < ε) : rIn_lt_rOut := half_lt_self hε } /-- The normalized scalar kernel associated with `standardMollifier`. -/ +@[expose] noncomputable def mollifier {d : ℕ} (ε : ℝ) (hε : 0 < ε) : Vec d → ℝ := (standardMollifier ε hε).normed MeasureTheory.volume @@ -60,6 +62,7 @@ theorem mollifier_locallyIntegrable {d : ℕ} {ε : ℝ} (hε : 0 < ε) : exact (mollifier_contDiff (d := d) hε (n := 0)).continuous.locallyIntegrable /-- Convolution of `u` with the normalized radius-`ε` kernel. -/ +@[expose] noncomputable def mollify {d : ℕ} (u : Vec d → ℝ) (ε : ℝ) (hε : 0 < ε) : Vec d → ℝ := MeasureTheory.convolution (mollifier (d := d) ε hε) u diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpApproximation.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpApproximation.lean index 1be518d0a3..20301bac52 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpApproximation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpApproximation.lean @@ -17,7 +17,7 @@ The three results below separate translation continuity, the normalized-kernel estimate, and the compact-localization step used for interior convergence. -/ -@[expose] public section +public section open Function Set Filter MeasureTheory Topology open scoped ENNReal Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpConvolution.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpConvolution.lean index 3ea05cdb89..8f2f1828cb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpConvolution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/LpConvolution.lean @@ -21,7 +21,7 @@ result is the contraction estimate needed in the density argument for mollification. -/ -@[expose] public section +public section open Function Set Filter MeasureTheory Topology open scoped ENNReal Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/SupportThickening.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/SupportThickening.lean index 8d7ef47a64..a25fa2eb1d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/SupportThickening.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/SupportThickening.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.KernelAllOrde Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Transport.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Transport.lean index 82108aa3d6..dca740ed5c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Transport.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Mollify/Transport.lean @@ -21,7 +21,7 @@ not asserted here because the available Mathlib API does not provide the needed local convolution bound and translation-continuity package. -/ -@[expose] public section +public section open scoped Convolution Topology open MeasureTheory diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Geometry.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Geometry.lean index dc4afdfb63..a5a606e601 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Geometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Geometry.lean @@ -27,13 +27,14 @@ permission. This file keeps the bounded convex-domain and affine-segment interfaces needed by the ball estimate while using the established CKN carriers. -/ -@[expose] public section +public section namespace CKN open MeasureTheory /-- A coordinatewise bounded domain in the native finite-dimensional carrier. -/ +@[expose] def IsBoundedDomain {d : ℕ} (U : Set (Vec d)) : Prop := ∃ R : ℝ, 0 < R ∧ ∀ x ∈ U, ∀ i, |x i| ≤ R @@ -57,6 +58,7 @@ theorem IsBoundedDomain.isFiniteMeasure_restrict_volume infer_instance /-- The average of a scalar function over a restricted volume measure. -/ +@[expose] noncomputable def integralAverage {d : ℕ} (U : Set (Vec d)) (u : Vec d → ℝ) : ℝ := MeasureTheory.average (MeasureTheory.volume.restrict U) u @@ -86,7 +88,7 @@ theorem isFiniteMeasure_restrict_volume {d : ℕ} {U : Set (Vec d)} end IsSobolevRegularDomain /-- An open bounded convex domain in the native carrier. -/ -def IsOpenBoundedConvexDomain {d : ℕ} (U : Set (Vec d)) : Prop := +@[expose] def IsOpenBoundedConvexDomain {d : ℕ} (U : Set (Vec d)) : Prop := IsOpen U ∧ IsBoundedDomain U ∧ Convex ℝ U namespace IsOpenBoundedConvexDomain @@ -139,6 +141,7 @@ theorem IsBoundedDomain.norm_sub_le_two_mul_choose {d : ℕ} {U : Set (Vec d)} _ = 2 * Classical.choose hU := by ring /-- Translate a set by a vector in the native finite-dimensional carrier. -/ +@[expose] def translateSet {d : ℕ} (z : Vec d) (U : Set (Vec d)) : Set (Vec d) := {x | ∃ y ∈ U, x = y + z} @@ -232,10 +235,12 @@ theorem isOpenBoundedConvexDomain_ball {d : ℕ} (x₀ : Vec d) {r : ℝ} (hr : linarith only [hxi, hx', hnorm] /-- The affine map which sends the unit ball to the ball of radius `r`. -/ +@[expose] def ballAffineMap {d : ℕ} (x₀ : Vec d) (r : ℝ) (x : Vec d) : Vec d := x₀ + r • x /-- The point on the segment from `y` to `x` with parameter `t`. -/ +@[expose] noncomputable def segmentBlend {d : ℕ} (x : Vec d) (t : ℝ) (y : Vec d) : Vec d := AffineMap.lineMap y x t diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/GradientNorm.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/GradientNorm.lean index 298083abf6..0fe5b87d46 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/GradientNorm.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/GradientNorm.lean @@ -19,7 +19,7 @@ The proof uses interior mollification on compactly contained balls and then exhausts the original ball. -/ -@[expose] public section +public section open Function Set Filter MeasureTheory Topology open scoped ENNReal Convolution Pointwise @@ -110,6 +110,7 @@ lemma opNorm_eq_sum_abs_basis (L : Vec 3 →L[ℝ] ℝ) : exact le_antisymm hupper hlower /-- The native coordinate-gradient norm used by the scalar `W^{1,p}` result. -/ +@[expose] def w1pGradientNorm {U : Set (Vec 3)} {p : ℝ≥0∞} (u : W1pFunction U p) : Vec 3 → ℝ := fun x => ∑ i : Fin 3, |u.grad x i| diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelBasic.lean index 3ed2b81306..9bb89c653c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelBasic.lean @@ -19,7 +19,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.NormedSpace Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN @@ -35,6 +35,7 @@ domain `L¹` size is controlled by the radius of `IsBoundedDomain`. -/ /-- The order-`1` Riesz kernel in dimension `d`. -/ +@[expose] noncomputable def rieszKernel {d : ℕ} (x y : Vec d) : ℝ := ‖x - y‖ ^ (1 - (d : ℝ)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelPower.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelPower.lean index f7c5a47b7d..61e2db9d81 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelPower.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelPower.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Poincare.Kerne Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelSegment.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelSegment.lean index 6d8af684d4..713455cb4b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelSegment.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelSegment.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.Prod Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelTime.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelTime.lean index 2bdff941ad..419b98d5ba 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/KernelTime.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Measure.WithDensity Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Lp.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Lp.lean index 5f1bf1823f..f1dd56cab5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Lp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Lp.lean @@ -20,7 +20,7 @@ public import Mathlib.MeasureTheory.Integral.DominatedConvergence Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpConvergence.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpConvergence.lean index bdfa1ab194..23f2959905 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpConvergence.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpConvergence.lean @@ -19,7 +19,7 @@ The proof uses interior mollification on compactly contained balls and then exhausts the original ball. -/ -@[expose] public section +public section open Function Set Filter MeasureTheory Topology open scoped ENNReal Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpOne.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpOne.lean index 62d5393afd..80e5d7be0c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpOne.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/LpOne.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.DominatedConvergence Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Mean.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Mean.lean index 0f56979b7c..bf7b528743 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Mean.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Mean.lean @@ -16,7 +16,7 @@ permission. These identities separate the average bookkeeping from the analytic segment estimate. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Scaling.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Scaling.lean index 00d75cd603..e7bc12a5fc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Scaling.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Scaling.lean @@ -19,12 +19,12 @@ proved for the smooth pullback; a density theorem for the full representative level is still a separate input. -/ -@[expose] public section +public section namespace CKN /-- Pull back a scalar function by the affine map from the unit ball. -/ -def ballPullback {d : ℕ} (x₀ : Vec d) (r : ℝ) (u : Vec d → ℝ) : Vec d → ℝ := +@[expose] def ballPullback {d : ℕ} (x₀ : Vec d) (r : ℝ) (u : Vec d → ℝ) : Vec d → ℝ := fun x => u (ballAffineMap x₀ r x) theorem ballPullback_contDiff {d : ℕ} (x₀ : Vec d) (r : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Smooth.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Smooth.lean index 5203932432..c2a7d51802 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Smooth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/Poincare/Smooth.lean @@ -20,7 +20,7 @@ permission. These are the smooth one-dimensional estimates used by the unit-ball Poincare proof. -/ -@[expose] public section +public section namespace CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/TestFunction.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/TestFunction.lean index 7ebbfee6a1..ab800399e8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/TestFunction.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/TestFunction.lean @@ -17,7 +17,7 @@ permission. This port separates the bundled test-function facade from the weak-derivative predicates and uses the `CKN` namespace. -/ -@[expose] public section +public section namespace CKN @@ -34,6 +34,7 @@ instance {d : ℕ} {U : Set (Vec d)} : coe φ := φ.toFun /-- The classical `i`th derivative of a bundled test function. -/ +@[expose] noncomputable def WeakTestFunction.partialDeriv {d : ℕ} {U : Set (Vec d)} (φ : WeakTestFunction U) (i : Fin d) (x : Vec d) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/W1p/Basic.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/W1p/Basic.lean index a271e5fa4c..e70a399f89 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/W1p/Basic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/W1p/Basic.lean @@ -26,7 +26,7 @@ representatives and uses the `CKN` weak-gradient API. * `W1pFunction.restrict`: restriction to an open subset. -/ -@[expose] public section +public section open scoped ENNReal @@ -38,6 +38,7 @@ abbrev MemLpOn {d : ℕ} MeasureTheory.MemLp u p (volumeOn U) /-- Coordinatewise gradient `L^p` membership on a restricted domain. -/ +@[expose] def GradMemLpOn {d : ℕ} (U : Set (Vec d)) (p : ℝ≥0∞) (Du : Vec d → Vec d) : Prop := ∀ i : Fin d, MemLpOn U p (fun x => Du x i) @@ -111,6 +112,7 @@ theorem memW1p {d : ℕ} ⟨u, rfl⟩ /-- Restrict a representative-level Sobolev function to an open subset. -/ +@[expose] def restrict {d : ℕ} {U V : Set (Vec d)} {p : ℝ≥0∞} (u : W1pFunction U p) (hVOpen : IsOpen V) (hVU : V ⊆ U) : W1pFunction V p where diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative.lean index b3742a1ea5..718aa83384 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative.lean @@ -23,11 +23,12 @@ a.e. uniqueness, restriction, and smooth-function constructors, while using the `CKN` namespace and the reduced weak-derivative dependency surface. -/ -@[expose] public section +public section namespace CKN /-- `gi` is the `i`th weak derivative of `u` on `U`. -/ +@[expose] def HasWeakPartialDerivOn {d : ℕ} (U : Set (Vec d)) (i : Fin d) (u gi : Vec d → ℝ) : Prop := ∀ φ : Vec d → ℝ, @@ -38,6 +39,7 @@ def HasWeakPartialDerivOn {d : ℕ} (U : Set (Vec d)) (i : Fin d) -∫ x in U, gi x * φ x ∂MeasureTheory.volume /-- `Du` is a coordinate weak gradient of `u` on `U`. -/ +@[expose] def HasWeakGradientOn {d : ℕ} (U : Set (Vec d)) (u : Vec d → ℝ) (Du : Vec d → Vec d) : Prop := ∀ i : Fin d, HasWeakPartialDerivOn U i u (fun x => Du x i) diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/Product.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/Product.lean index 02d6626d70..85f65ac999 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/Product.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/Product.lean @@ -19,7 +19,7 @@ predicate. Compact support keeps every test-function product inside the open se the resulting derivative is a global weak derivative of the zero extension. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/ProductH1.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/ProductH1.lean index de106a1889..eb30834055 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/ProductH1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakDerivative/ProductH1.lean @@ -17,7 +17,7 @@ public import Mathlib.Topology.MetricSpace.Thickening Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluing.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluing.lean index 0e1c7049ed..198151a119 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluing.lean @@ -15,7 +15,7 @@ Locally integrable weak partial derivatives of the same function on an open set agree almost everywhere. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTBounds.lean index 2b66b17217..9a91ea77a6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTBounds.lean @@ -19,7 +19,7 @@ Spatial a.e. uniqueness preserves the complete quantitative majorant. Time windows are restricted only along an explicit subset inclusion. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTGlobalSelection.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTGlobalSelection.lean index 35207bccfd..c51a53a121 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTGlobalSelection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTGlobalSelection.lean @@ -14,7 +14,7 @@ and local integrability of almost every slice. No time-integrability bound on the derivative is needed for this selection. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTMeasurable.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTMeasurable.lean index 5eb4e5d535..8e0a2baf4f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTMeasurable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTMeasurable.lean @@ -19,7 +19,7 @@ every spatial slice, so uniqueness identifies it with every derivative on an open subdomain of the carrier. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTPressureMean.lean b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTPressureMean.lean index 269034b642..a06500f369 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTPressureMean.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Foundation/Sobolev/WeakGradientGluingTPressureMean.lean @@ -16,7 +16,7 @@ its weak gradient or its distributional harmonicity. In particular these identities apply to the spatial mean at each fixed time. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremA.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremA.lean index 629030e2db..8e08872e55 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremA.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremA.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Main.TheoremAProvider Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAPaper.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAPaper.lean index 5a5536d7b9..603b2f298c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAPaper.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAPaper.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.ClassEquivalence.MainTheorems Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAProvider.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAProvider.lean index 030828fdda..f4e807b39b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAProvider.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremAProvider.lean @@ -21,7 +21,7 @@ and the final closed-cylinder estimate. Every remaining analytic input is displayed explicitly; no regularity conclusion is assumed. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremB.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremB.lean index fcf8adabc9..2a53629b4b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremB.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremB.lean @@ -25,7 +25,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SuitableWeakSolutionIn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremBPaper.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremBPaper.lean index e432560246..e20e17f523 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremBPaper.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremBPaper.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.ClassEquivalence.MainTheorems Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremC.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremC.lean index d78d612f0e..61016951e9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremC.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremC.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Main.TheoremB Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section section diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCOfB.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCOfB.lean index cfd951d53c..bb464f5544 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCOfB.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCOfB.lean @@ -28,7 +28,7 @@ suitable-solution class; the class-equivalence bridge supplies this version when assembling Theorem C. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCPaper.lean b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCPaper.lean index e80746bd31..4a4632a43b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCPaper.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Main/TheoremCPaper.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.ClassEquivalence.MainTheorems Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZHarmonicCorollaryForceSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZHarmonicCorollaryForceSlice.lean index 481fe759fa..284cd9b816 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZHarmonicCorollaryForceSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZHarmonicCorollaryForceSlice.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34Slices Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1Closer.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1Closer.lean index 83541288e0..bcd151d462 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1Closer.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1Closer.lean @@ -19,7 +19,7 @@ adapter supplies the pressure input shared by the two regularity criteria. No pressure estimate or source certificate is assumed here. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1UnconditionalAssembly.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1UnconditionalAssembly.lean index aba7878879..c19044fbb7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1UnconditionalAssembly.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZP1UnconditionalAssembly.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.SliceVelocityCube Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZStartBridgeSource.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZStartBridgeSource.lean index a24f7b9f42..b0f759aa5c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/CZStartBridgeSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/CZStartBridgeSource.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.OscillationLin34 Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Cutoff.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Cutoff.lean index cdf7bad735..397b83cdd4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Cutoff.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Cutoff.lean @@ -23,7 +23,7 @@ its Euclidean support has a strict collar in the native carrier. This keeps the stated Euclidean radii literal while avoiding an implicit change of norm. -/ -@[expose] public section +public section open Set MeasureTheory Metric open scoped Convolution diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Decomposition.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Decomposition.lean index 698f1fc934..7a6c0b9fa0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Decomposition.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Decomposition.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.NewtonianRepr Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology @@ -25,6 +25,7 @@ open CKN.Foundation.Parabolic noncomputable section namespace CKN /-- Partially centered velocity tensor with the sign convention for the pressure decomposition. -/ +@[expose] def pressureUTensor (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (z : ParabolicPoint) (i j : Fin 3) : ℝ := -u z i * (u z j - c z.2 j) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionIdentity.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionIdentity.lean index 46e2f30171..790ffd58d0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionIdentity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionIdentity.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionPotentials Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionPotentials.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionPotentials.lean index 3238512d64..a70eb10bf6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionPotentials.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionPotentials.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DerivativeAdjoint Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -28,43 +28,51 @@ namespace CKN /-! The eight explicit potentials in the local pressure decomposition. -/ /-- Newtonian potential of the tensor paired with the second derivatives of the cutoff. -/ +@[expose] def pressureP2 (η : Vec3 → ℝ) (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (s : ℝ) : Vec3 → ℝ := fun x => ∑ i, ∑ j, pressureNewtonianPotential (fun y => mixedSecond η i j y * pressureUTensor u c (y, s) i j) x /-- First Newtonian derivative potential for the first tensor-cutoff cross term. -/ +@[expose] def pressureP3 (η : Vec3 → ℝ) (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (s : ℝ) : Vec3 → ℝ := fun x => ∑ i, ∑ j, pressureNewtonianDerivativePotential j (fun y => pressureUTensor u c (y, s) i j * spatialDeriv η i y) x /-- First Newtonian derivative potential for the second tensor-cutoff cross term. -/ +@[expose] def pressureP4 (η : Vec3 → ℝ) (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (s : ℝ) : Vec3 → ℝ := fun x => ∑ i, ∑ j, pressureNewtonianDerivativePotential i (fun y => pressureUTensor u c (y, s) i j * spatialDeriv η j y) x /-- Pressure correction involving the Laplacian of the cutoff. -/ +@[expose] def pressureP5 (η : Vec3 → ℝ) (p : ParabolicPoint → ℝ) (s : ℝ) : Vec3 → ℝ := fun x => -pressureNewtonianPotential (fun y => p (y, s) * spatialLaplacian η y) x /-- Pressure correction involving the gradient of the cutoff. -/ +@[expose] def pressureP6 (η : Vec3 → ℝ) (p : ParabolicPoint → ℝ) (s : ℝ) : Vec3 → ℝ := fun x => -2 * ∑ j, pressureNewtonianDerivativePotential j (fun y => spatialDeriv η j y * p (y, s)) x /-- First Newtonian derivative potential of the cutoff force. -/ +@[expose] def pressureP7 (η : Vec3 → ℝ) (f : ParabolicPoint → Vec3) (s : ℝ) : Vec3 → ℝ := fun x => -∑ j, pressureNewtonianDerivativePotential j (fun y => η y * f (y, s) j) x /-- Newtonian potential of the force paired with the cutoff gradient. -/ +@[expose] def pressureP8 (η : Vec3 → ℝ) (f : ParabolicPoint → Vec3) (s : ℝ) : Vec3 → ℝ := fun x => -∑ j, pressureNewtonianPotential (fun y => spatialDeriv η j y * f (y, s) j) x /-- Localized pressure after subtracting the seven explicit cutoff and forcing corrections. -/ +@[expose] def pressureP1 (η : Vec3 → ℝ) (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) (s : ℝ) : Vec3 → ℝ := fun x => η x * p (x, s) - (pressureP2 η u c s x + pressureP3 η u c s x + diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWS.lean index b07c367170..085ff6afb8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWS.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionSWSBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWSBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWSBasic.lean index 5c7a6ce399..6f8523e676 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWSBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/DecompositionSWSBasic.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionIdentity Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/DeltaPCentred.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/DeltaPCentred.lean index 57a9a39c14..bcbdc75cc1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/DeltaPCentred.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/DeltaPCentred.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionSWS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/DerivativeAdjoint.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/DerivativeAdjoint.lean index c489ba45cf..c5af56faa7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/DerivativeAdjoint.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/DerivativeAdjoint.lean @@ -17,7 +17,7 @@ public import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Equation.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Equation.lean index 22a0d1061d..a1872033d4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Equation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Equation.lean @@ -18,7 +18,7 @@ public import Mathlib.MeasureTheory.Function.L2Space Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology @@ -30,15 +30,15 @@ noncomputable section namespace CKN /-- Space-time vector test built from a spatial gradient and a temporal scalar test. -/ -def pressureTest (ψ : Vec3 → ℝ) (θ : ℝ → ℝ) : Vec3 × ℝ → Vec3 := +@[expose] def pressureTest (ψ : Vec3 → ℝ) (θ : ℝ → ℝ) : Vec3 × ℝ → Vec3 := fun z i => θ z.2 * spatialDeriv ψ i z.1 /-- The product test field on the ordinary product carrier. -/ -def pressureTestProduct (ψ : Vec3 → ℝ) (θ : ℝ → ℝ) : Vec3 × ℝ → Vec3 := +@[expose] def pressureTestProduct (ψ : Vec3 → ℝ) (θ : ℝ → ℝ) : Vec3 × ℝ → Vec3 := pressureTest ψ θ /-- The product test field viewed on the parabolic-point carrier. -/ -def pressureTestParabolic (ψ : Vec3 → ℝ) (θ : ℝ → ℝ) : +@[expose] def pressureTestParabolic (ψ : Vec3 → ℝ) (θ : ℝ → ℝ) : ParabolicPoint → Vec3 := fun z => pressureTest ψ θ (z.1, z.2) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellation.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellation.lean index f4ae9586d5..d01f16675c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellation.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.Liouville Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -27,11 +27,11 @@ noncomputable section namespace CKN /-- The test functions used for a distributional spatial divergence. -/ -def SmoothCompactTest (ψ : Vec3 → ℝ) : Prop := +@[expose] def SmoothCompactTest (ψ : Vec3 → ℝ) : Prop := (∀ n : ℕ, ContDiff ℝ (n : ℕ∞) ψ) ∧ HasCompactSupport ψ /-- Distributional divergence-free data, with the spatial test class explicit. -/ -def DistributionalDivergenceFree (F : Vec3 → Vec3) : Prop := +@[expose] def DistributionalDivergenceFree (F : Vec3 → Vec3) : Prop := ∀ ψ : Vec3 → ℝ, SmoothCompactTest ψ → ∫ x, ∑ i : Fin 3, F x i * spatialDeriv ψ i x = 0 diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellationUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellationUnconditional.lean index e6ba4dd0a1..02aef7b598 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellationUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/ForceCancellationUnconditional.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.HarmonicRemainderForceTe Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBounds.lean index a26e90332f..1103de05fc 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBounds.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.HarmonicPartBoundsTerms Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsAE.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsAE.lean index b46256559d..a529792e87 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsAE.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsAE.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsHelpers.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsHelpers.lean index b9d5f94184..6f61ed396b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsHelpers.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsHelpers.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SliceNormBounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsTerms.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsTerms.lean index 7427eede73..32d7333cfb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsTerms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartBoundsTerms.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.HarmonicPartBoundsHelper Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartDerivatives.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartDerivatives.lean index 4049d2d38f..e41084e2b5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartDerivatives.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicPartDerivatives.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.OscillationHarmonic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -25,6 +25,7 @@ noncomputable section namespace CKN /-- The harmonic pressure part appearing in the local decomposition. -/ +@[expose] def harmonicPressurePart (η : Vec3 → ℝ) (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (p : ParabolicPoint → ℝ) (s : ℝ) : Vec3 → ℝ := pressureP2 η u c s + pressureP3 η u c s + pressureP4 η u c s + diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderForceTerms.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderForceTerms.lean index d44d4e2e71..db98882196 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderForceTerms.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderForceTerms.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSlice.lean index aee52f17c9..a24e479266 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSlice.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.OscillationLin34Solution Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSliceSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSliceSWS.lean index 9cab1bb74c..a45502ddb5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSliceSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HarmonicRemainderSliceSWS.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.HarmonicRemainderForceTe Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -33,6 +33,7 @@ private theorem harmonic_remainder_vec3_norm_add_le (v w : Vec3) : exact norm_add_le _ _ /-- Nonnegative growth coefficient for the forcing part of the harmonic pressure remainder. -/ +@[expose] def harmonicRemainderForceBound (z : ParabolicPoint) {ρ : ℝ} (hρ : 0 < ρ) (f : ParabolicPoint → Vec3) (s : ℝ) : ℝ := max diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/HeatKernelIntegrable.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/HeatKernelIntegrable.lean index 85f932a83e..4251265b7e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/HeatKernelIntegrable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/HeatKernelIntegrable.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.Real.Pi.Bounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Identification.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Identification.lean index e708d7b4aa..61684c6f35 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Identification.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Identification.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionSWS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -29,6 +29,7 @@ namespace CKN /- The tensor pairing is kept explicit so that the distributional pressure identity and the eventual singular-integral identity have the same target. -/ /-- Pairing of a tensor source with the Hessian of a scalar test function. -/ +@[expose] def pressureSecondPairing (G : Fin 3 → Fin 3 → Vec3 → ℝ) (ψ : Vec3 → ℝ) : ℝ := ∫ x, ∑ i, ∑ j, G i j x * mixedSecond ψ i j x diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationCZP1Unconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationCZP1Unconditional.lean index 5a05db5243..47b7112f47 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationCZP1Unconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationCZP1Unconditional.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.IdentificationExtensionU Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtension.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtension.lean index 4c62d8d518..e3ae82f8e5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtension.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtension.lean @@ -18,7 +18,7 @@ The ordinary Newtonian kernel expression is an exterior tail object and is not used by the global identification. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -31,7 +31,7 @@ namespace CKN open CKN.Foundation.Euclidean /-- Pressure reconstruction operator from the continuous second-Riesz tensor extension. -/ -def pressureSecondExtensionOperator +@[expose] def pressureSecondExtensionOperator (hL2 : ∀ i j : Fin 3, RieszSecondL2Input i j) (hWeak11 : ∀ i j : Fin 3, ∀ f, Measurable f → Integrable f volume → MemLp f 2 volume → ∀ l : ℝ, 0 < l → diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowth.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowth.lean index befee52580..034facd58c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowth.lean @@ -20,7 +20,7 @@ indexed extension. The last two declarations expose the pressure-decomposition shape consumed by the CZ identification argument. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowthSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowthSWS.lean index 7c8ea436bf..b0ebd462d8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowthSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionGrowthSWS.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.UTensor Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairing.lean index 04950afa8d..2393e8db55 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairing.lean @@ -23,7 +23,7 @@ dependence, and the two facts below hold, for almost every time, simultaneously for every test function. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingCylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingCylinder.lean index c2ebb673b8..1a929583fb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingCylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingCylinder.lean @@ -20,7 +20,7 @@ constant. The conclusion is stated on the cylinder's time interval, which is the form the slice pressure estimates consume. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingExterior.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingExterior.lean index 7c29974873..336a6ccaeb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingExterior.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingExterior.lean @@ -19,7 +19,7 @@ identity for `p₁`; the interior half is the localized identity of the pressure decomposition. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingKernel.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingKernel.lean index 27e9d0f1de..517751a68a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingKernel.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingKernel.lean @@ -27,7 +27,7 @@ derivative of `ψ`. The translation identities `spatialDeriv_sub_const` and derivative, and the kernel vanishes outside its support ball. -/ -@[expose] public section +public section open MeasureTheory Metric open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSlice.lean index 070fbd14cd..9462c978ba 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSlice.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionSWS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSource.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSource.lean index 27d5c68a4f..e95b0f31cd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSource.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionPotentials Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSwap.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSwap.lean index 8ccaa52369..5136728a98 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSwap.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingSwap.lean @@ -22,7 +22,7 @@ the divergence-form and multiplication-form upgrades used for the slice identities. -/ -@[expose] public section +public section open MeasureTheory Metric Filter Topology Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingWholeSpace.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingWholeSpace.lean index cfc52c7064..72110fbb51 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingWholeSpace.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionPairingWholeSpace.lean @@ -22,7 +22,7 @@ The result is the identity tested against every compactly supported smooth `ψ`, which is the form the Liouville identification consumes. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionUnconditional.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionUnconditional.lean index ba9c825d14..5d262da13b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionUnconditional.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationExtensionUnconditional.lean @@ -21,7 +21,7 @@ public import Mathlib.Geometry.Manifold.PartitionOfUnity Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationL2.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationL2.lean index 81d0ffd12e..6a32ba0459 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationL2.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationL2.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Function.L2Space Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationWholeSpace.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationWholeSpace.lean index c0a913923e..f9c6c333ec 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationWholeSpace.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/IdentificationWholeSpace.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Identification Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Identity.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Identity.lean index d93951f525..44560bdb69 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Identity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Identity.lean @@ -19,7 +19,7 @@ public import Mathlib.MeasureTheory.Function.LocallyIntegrable Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology @@ -31,6 +31,7 @@ noncomputable section namespace CKN /-- The spatial pressure residual at a fixed time for a compactly supported test. -/ +@[expose] def pressureSliceResidual {Ω : Set Vec3} {u : ParabolicPoint → Vec3} {p : ParabolicPoint → ℝ} {f : ParabolicPoint → Vec3} (ψ : Vec3 → ℝ) (s : ℝ) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/LeibnizLaplacian.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/LeibnizLaplacian.lean index 5c4b47959c..332d025d5a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/LeibnizLaplacian.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/LeibnizLaplacian.lean @@ -30,7 +30,7 @@ Fréchet derivative applied to a coordinate basis vector, matching the convention of `CKN.spatialPartial`. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic @@ -43,18 +43,22 @@ noncomputable section /-- The `i`th spatial partial derivative `∂_i f`, as the Fréchet derivative applied to the `i`th coordinate basis vector. -/ +@[expose] def spatialDeriv (f : Vec3 → ℝ) (i : Fin 3) : Vec3 → ℝ := fun x => (fderiv ℝ f x) (basisVec i) /-- The spatial Laplacian `Δ f = ∑_i ∂_i ∂_i f`. -/ +@[expose] def spatialLaplacian (f : Vec3 → ℝ) : Vec3 → ℝ := fun x => ∑ i : Fin 3, spatialDeriv (spatialDeriv f i) i x /-- The Euclidean gradient pairing `∇f · ∇g = ∑_i ∂_i f ∂_i g`. -/ +@[expose] def spatialGradDot (f g : Vec3 → ℝ) : Vec3 → ℝ := fun x => ∑ i : Fin 3, spatialDeriv f i x * spatialDeriv g i x /-- The mixed second derivative `∂_i ∂_j f`. -/ +@[expose] def mixedSecond (f : Vec3 → ℝ) (i j : Fin 3) : Vec3 → ℝ := fun x => spatialDeriv (spatialDeriv f j) i x diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZ.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZ.lean index cb1c2945e9..b3da0af5b3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZ.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZ.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34SliceIntegrated Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZResidual.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZResidual.lean index 8147860a76..00effab65c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZResidual.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCZResidual.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34CentredPairingSWS Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCorrection.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCorrection.lean index 677bb9f08b..7370912f97 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCorrection.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredCorrection.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.DivergenceFreeSlice Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairing.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairing.lean index ce564083a2..7f7020fd5c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairing.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairing.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34CentredSource Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -43,7 +43,7 @@ the Calderón--Zygmund estimate for the centred potential. /-- The spatial average `⨍_{B_ρ(x₀)} u(·, s)` of `eq:Chat`, seen as a time-dependent constant vector. -/ -def lin34MeanVelocity (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) : +@[expose] def lin34MeanVelocity (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) : ℝ → Vec3 := fun s j => MeasureTheory.average (volume.restrict (vec3Ball x₀ ρ)) (fun z => u (z, s) j) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairingSWS.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairingSWS.lean index 5c8cb67f7e..8ab2d2722a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairingSWS.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPairingSWS.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCor Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialGrowth.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialGrowth.lean index 04bcf87b36..99ccc322c0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialGrowth.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialGrowth.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsCylinder Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialSource.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialSource.lean index 2313f537c9..5e2967dcce 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredPotentialSource.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology @@ -296,34 +296,34 @@ private lemma lin34_product_aestronglyMeasurable_of_zero_off /-- The source `g₂` of the centred potential `p₂`: the entry `i j` of the centred tensor `eq:Uhat` multiplied by the mixed second derivative `∂_i ∂_j η` of the cut-off. -/ -def lin34CentredTensorHessian (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} +@[expose] def lin34CentredTensorHessian (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) (i j : Fin 3) : Vec3 → ℝ := fun y => mixedSecond (mollifiedBallCutoff x₀ hρ) i j y * pressureUTensor (lin34CentredVelocity u x₀ ρ) 0 ((y, s) : ParabolicPoint) i j /-- The source of the centred potential `p₃`: the entry `i j` of the centred tensor `eq:Uhat` multiplied by the first derivative `∂_i η` of the cut-off. -/ -def lin34CentredTensorGradientI (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} +@[expose] def lin34CentredTensorGradientI (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) (i j : Fin 3) : Vec3 → ℝ := fun y => pressureUTensor (lin34CentredVelocity u x₀ ρ) 0 ((y, s) : ParabolicPoint) i j * spatialDeriv (mollifiedBallCutoff x₀ hρ) i y /-- The source of the centred potential `p₄`: the entry `i j` of the centred tensor `eq:Uhat` multiplied by the first derivative `∂_j η` of the cut-off. -/ -def lin34CentredTensorGradientJ (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} +@[expose] def lin34CentredTensorGradientJ (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) (i j : Fin 3) : Vec3 → ℝ := fun y => pressureUTensor (lin34CentredVelocity u x₀ ρ) 0 ((y, s) : ParabolicPoint) i j * spatialDeriv (mollifiedBallCutoff x₀ hρ) j y /-- The source of the centred potential `p₅`: the pressure slice multiplied by the spatial Laplacian `Δη` of the cut-off. -/ -def lin34CentredPressureLaplacian (p : ParabolicPoint → ℝ) (x₀ : Vec3) {ρ : ℝ} +@[expose] def lin34CentredPressureLaplacian (p : ParabolicPoint → ℝ) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) : Vec3 → ℝ := fun y => p (y, s) * spatialLaplacian (mollifiedBallCutoff x₀ hρ) y /-- The source of the centred potential `p₆`: the first derivative `∂_j η` of the cut-off multiplied by the pressure slice. -/ -def lin34CentredPressureGradient (p : ParabolicPoint → ℝ) (x₀ : Vec3) {ρ : ℝ} +@[expose] def lin34CentredPressureGradient (p : ParabolicPoint → ℝ) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) (j : Fin 3) : Vec3 → ℝ := fun y => spatialDeriv (mollifiedBallCutoff x₀ hρ) j y * p (y, s) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredResidual.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredResidual.lean index a6b23d9c4f..76774d0077 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredResidual.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredResidual.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34SliceIntegrated Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredSource.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredSource.lean index 3b686dedbf..fe20486d33 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredSource.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34CentredSource.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.CZStartBridgeSource Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -30,7 +30,7 @@ mollified cut-off of `B_ρ` and `Û` the centred tensor `eq:Uhat`, at the time `s` and in the entries `i, j` it is the function `x ↦ η(x) · Û_{ij}(x, s)`. -/ -def lin34CentredSource (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) +@[expose] def lin34CentredSource (u : ParabolicPoint → Vec3) (x₀ : Vec3) {ρ : ℝ} (hρ : 0 < ρ) (s : ℝ) (i j : Fin 3) : Vec3 → ℝ := fun x => mollifiedBallCutoff x₀ hρ x * pressureUTensor (lin34CentredVelocity u x₀ ρ) 0 ((x, s) : ParabolicPoint) i j diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceCore.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceCore.lean index c5c680d113..ad5cbe47f9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceCore.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceCore.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.InteriorEstim Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -38,7 +38,7 @@ field `u - ⨍_{B_ρ} u` of `eq:Chat`. /-- The mean-free velocity field `w = u - ⨍_{B_ρ} u` of `eq:Uhat` in `paper/ckn.tex`, seen as a field on space-time. -/ -def lin34CentredVelocity (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) : +@[expose] def lin34CentredVelocity (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) : ParabolicPoint → Vec3 := fun w => meanFreeVec u x₀ ρ w.2 w.1 /-- The centred tensor `Û_{ij} = -(u_i - ⨍u_i)(u_j - ⨍u_j)` of `eq:Uhat` is the @@ -516,13 +516,14 @@ theorem lin34_centred_remainder_integral_bound /-- The Calderón--Zygmund part `p₁` of `prop:pressure-decomposition`, run with the centred tensor `eq:Uhat`. This is the object the external input `ext:CZ` bounds in the proof of `prop:lin34`. -/ +@[expose] def lin34CentredP1 (u : ParabolicPoint → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) (hρ : 0 < ρ) (s : ℝ) : Vec3 → ℝ := pressureP1 (mollifiedBallCutoff x₀ hρ) (lin34CentredVelocity u x₀ ρ) 0 p f s /-- The force group `p₇ + p₈` of `prop:pressure-decomposition`. -/ -def lin34ForcePart (f : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) +@[expose] def lin34ForcePart (f : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) (hρ : 0 < ρ) (s : ℝ) : Vec3 → ℝ := pressureP7 (mollifiedBallCutoff x₀ hρ) f s + pressureP8 (mollifiedBallCutoff x₀ hρ) f s diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceCylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceCylinder.lean index 4fb6ef8832..f00114182c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceCylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceCylinder.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalP8 Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceLp.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceLp.lean index a71df5c0ae..52e2eb1ae8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceForceLp.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.BallOrigin Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceFubini.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceFubini.lean index 2ede939a86..b592f77c7c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceFubini.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceFubini.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceHolder.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceHolder.lean index 53934c4501..8bd2ccafcf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceHolder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceHolder.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceIntegrated.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceIntegrated.lean index 47a4c76787..c34ec689b0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceIntegrated.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceIntegrated.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34SliceQuantities Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -273,6 +273,7 @@ theorem pressure_lin34_force_of_sws /-- The constant `C₃₂(q)` of `eq:lin35-force` in `paper/ckn.tex`, expressed through the exponent that `lin34ForceConstant` consumes. -/ +@[expose] def lin34SolutionForceExponent (C₁₁ q : ℝ) : ℝ := (lin34ForceConstant (lin34ForceExponent C₁₁) * (1 + lin34ForceCylinderConstant q ^ (3 / 2 : ℝ))) ^ (2 / 3 : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceMeanFree.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceMeanFree.lean index 77e8b25d78..78059b171d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceMeanFree.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceMeanFree.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ExcessComparisonCore Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SlicePointwise.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SlicePointwise.lean index 68d75aae8b..7c02cedfac 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SlicePointwise.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SlicePointwise.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34SliceCore Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceQuantities.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceQuantities.lean index 298730b9aa..d4119bf4fa 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceQuantities.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34SliceQuantities.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.Lin34SlicePointwise Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -39,38 +39,38 @@ quantities `D(z₀, r)` and `D(z₀, ρ)` of `eq:ABCDE`, and `C_hat(z₀, ρ)` o /-- The spatial `L³` mass of the mean-free velocity on `B_ρ` at time `s`, the slice integrand of `C_hat(z₀,ρ)` in `eq:Chat`. -/ -def lin34VelocitySlice (u : ParabolicPoint → Vec3) (z : ParabolicPoint) +@[expose] def lin34VelocitySlice (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (ρ s : ℝ) : ℝ := ∫ y in vec3Ball z.1 ρ, vec3EuclideanNorm (meanFreeVec u z.1 ρ s y) ^ (3 : ℕ) /-- The spatial `L^{3/2}` mass of the pressure on `B_ρ` at time `s`, the slice integrand of `D(z₀,ρ)`. -/ -def lin34PressureSlice (p : ParabolicPoint → ℝ) (z : ParabolicPoint) +@[expose] def lin34PressureSlice (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (ρ s : ℝ) : ℝ := ∫ y in vec3Ball z.1 ρ, |p (y, s)| ^ (3 / 2 : ℝ) /-- The spatial `L^{3/2}` mass of the force group `p₇ + p₈` on `B_r` at time `s`. -/ -def lin34ForceSliceIntegral (f : ParabolicPoint → Vec3) (z : ParabolicPoint) +@[expose] def lin34ForceSliceIntegral (f : ParabolicPoint → Vec3) (z : ParabolicPoint) (ρ r : ℝ) (hρ : 0 < ρ) (s : ℝ) : ℝ := ∫ x in vec3Ball z.1 r, |lin34ForcePart f z.1 ρ hρ s x| ^ (3 / 2 : ℝ) /-- The left-hand side of `eq:lin34-pointwise`, extended by zero outside `J_r = (t₀ - r², t₀)`. -/ -def lin34F (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ → ℝ := +@[expose] def lin34F (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ → ℝ := Set.indicator (Ioc (z.2 - r ^ 2) z.2) (fun s => r⁻¹ ^ 2 * lin34PressureSlice p z r s) /-- The velocity term of `eq:lin34-pointwise`. -/ -def lin34G (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (ρ : ℝ) : ℝ → ℝ := +@[expose] def lin34G (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (ρ : ℝ) : ℝ → ℝ := fun s => ρ⁻¹ ^ 2 * lin34VelocitySlice u z ρ s /-- The pressure term of `eq:lin34-pointwise`. -/ -def lin34H (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (ρ : ℝ) : ℝ → ℝ := +@[expose] def lin34H (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (ρ : ℝ) : ℝ → ℝ := fun s => ρ⁻¹ ^ 2 * lin34PressureSlice p z ρ s /-- The force term of `eq:lin34-pointwise`, extended by zero outside `J_r`. -/ -def lin34J (f : ParabolicPoint → Vec3) (z : ParabolicPoint) (ρ r : ℝ) +@[expose] def lin34J (f : ParabolicPoint → Vec3) (z : ParabolicPoint) (ρ r : ℝ) (hρ : 0 < ρ) : ℝ → ℝ := Set.indicator (Ioc (z.2 - r ^ 2) z.2) (fun s => r⁻¹ ^ 2 * lin34ForceSliceIntegral f z ρ r hρ s) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34Slices.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34Slices.lean index 3e4dbbb52e..237a22f9ba 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34Slices.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Lin34Slices.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.OscillationHarmonic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/MemLpThreeHalvesLift.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/MemLpThreeHalvesLift.lean index 5a2aedbf48..a09da8ef76 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/MemLpThreeHalvesLift.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/MemLpThreeHalvesLift.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Measure.SupportRestric Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationHarmonic.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationHarmonic.lean index ef7518e73b..cdd769d84c 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationHarmonic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationHarmonic.lean @@ -20,7 +20,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.DecompositionSWSBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34.lean index 9f4702231e..a064ad28db 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -28,11 +28,13 @@ noncomputable section namespace CKN /-- The velocity oscillation in `eq:Chat`, with the spatial mean taken at each time. -/ +@[expose] def pressureChat (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := r⁻¹ ^ 2 * ∫ w in parabolicCylinder z.1 z.2 r, vec3EuclideanNorm (meanFreeVec u z.1 r w.2 w.1) ^ (3 : ℕ) /-- The unrooted pressure quantity `D` used in the integrated Lin estimate. -/ +@[expose] def pressureD (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ := r⁻¹ ^ 2 * ∫ w in parabolicCylinder z.1 z.2 r, |p w| ^ (3 / 2 : ℝ) @@ -198,6 +200,7 @@ theorem pressureD_integrated_from_slices rw [hChat, hDρ] /-- Coefficient for the forcing term in the localized pressure estimate. -/ +@[expose] noncomputable def lin34ForceConstant (C₁₃ : ℝ) : ℝ := Real.sqrt 2 * (1 + C₁₃ ^ (3 / 2 : ℝ)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34Solution.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34Solution.lean index 59642b4c5f..2fc7b1e24a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34Solution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/OscillationLin34Solution.lean @@ -20,7 +20,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/ParamExtension.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/ParamExtension.lean index 1c59737598..c8dd8cb7a4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/ParamExtension.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/ParamExtension.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.Bochner.Set Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -27,6 +27,7 @@ namespace CKN /-- The scalar pairing of a parameterized test family with zeroth, first, and second order slice data on a fixed compact set. -/ +@[expose] def parametricPairing {X : Type} (Ψ : X → Vec3 → ℝ) (g₀ : Vec3 → ℝ) (g₁ : Vec3 → Vec3) (g₂ : Vec3 → Fin 3 → Fin 3 → ℝ) (x : X) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsBasic.lean index d35a40232c..01864ff2cd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsBasic.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.Real.Pi.Bounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -30,7 +30,7 @@ namespace CKN /-! Common annular and time-integration facts for the pressure terms. -/ /-- Spatial annulus supporting derivatives of the pressure cutoff. -/ -def pressureAnnulus (x₀ : Vec3) (ρ : ℝ) : Set Vec3 := +@[expose] def pressureAnnulus (x₀ : Vec3) (ρ : ℝ) : Set Vec3 := vec3Ball x₀ (3 * ρ / 4) \ vec3Ball x₀ (13 * ρ / 20) theorem pressure_annulus_subset_ball {x₀ : Vec3} {ρ : ℝ} {y : Vec3} @@ -211,6 +211,7 @@ theorem pressure_cylinder_eLpNorm_le {P : Vec3 × ℝ → ℝ} {G : ℝ → ℝ} simp [μx, μt] /-- Euclidean tensor norm of the partially centered pressure source. -/ +@[expose] def pressureUTensorNorm (u : ParabolicPoint → Vec3) (c : ℝ → Vec3) (s : ℝ) (y : Vec3) : ℝ := Real.sqrt (∑ i : Fin 3, ∑ j : Fin 3, diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsCylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsCylinder.lean index c62d9fbcf4..1be3dd2aeb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsCylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsCylinder.lean @@ -22,7 +22,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SliceNormBounds Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP234.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP234.lean index 12fb2da47f..2ebe060a1f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP234.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP234.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP56.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP56.lean index 4858d24df4..41d4c57eb8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP56.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP56.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7.lean index 81729631c6..109c85840d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7Solution.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7Solution.lean index 395de459f2..6a02b4ebca 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7Solution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7Solution.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.TimeHolder Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionBound.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionBound.lean index 9786c2457f..0d8d83b105 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionBound.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionBound.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionMeas.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionMeas.lean index 27a046338d..04f1a7497d 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionMeas.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP7SolutionMeas.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCor Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP8.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP8.lean index e06ccac25a..6b1c509aae 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP8.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsP8.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalConstants.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalConstants.lean index d69aa2f501..347645b958 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalConstants.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalConstants.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalSca Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology @@ -28,6 +28,7 @@ namespace CKN /-! Explicit constants used by the three unconditional pressure estimates. -/ /-- Combined coefficient for the three velocity-tensor pressure corrections. -/ +@[expose] noncomputable def pressureP234Constant : ℝ := 3 * (9 * sobolevPoincareL6Constant.toReal * @@ -36,6 +37,7 @@ noncomputable def pressureP234Constant : ℝ := (4 * Real.pi / 3) ^ (2 / 3 : ℝ) /-- Combined coefficient for the two pressure-cutoff corrections. -/ +@[expose] noncomputable def pressureP56Constant : ℝ := 2 * ((Real.pi * 4 / 3) ^ (1 / 3 : ℝ) * @@ -43,10 +45,11 @@ noncomputable def pressureP56Constant : ℝ := (4 * Real.pi / 3) ^ (2 / 3 : ℝ) /-- Common coefficient dominating the velocity and pressure cutoff contributions. -/ -noncomputable def pressureP12Constant : ℝ := +@[expose] noncomputable def pressureP12Constant : ℝ := max pressureP234Constant pressureP56Constant /-- Exponent-dependent coefficient for the force-cutoff contribution. -/ +@[expose] noncomputable def pressureP13Constant (q : ℝ) : ℝ := 6 * cutoffGradientConstant * (4 * Real.pi / 3) ^ (1 - 1 / q) * diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalCore.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalCore.lean index eaf62b7d7e..c2eb6945c0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalCore.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalCore.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalSca Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP234.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP234.lean index e0633ba70c..c2d2a61cec 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP234.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP234.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP56.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP56.lean index b65ae178c7..7fb8269505 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP56.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP56.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP8.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP8.lean index 898f282c57..409a7f5559 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP8.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalP8.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsUnconditionalCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalScale.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalScale.lean index ad35f1d18e..0781270221 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalScale.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PkBoundsUnconditionalScale.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsCylinder Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecay.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecay.lean index ac9c6e2f76..804441c1be 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecay.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecay.lean @@ -25,7 +25,7 @@ theorem to a harmonic function that tends to zero in the `L^{3/2}` average sense at infinity. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology @@ -199,6 +199,7 @@ theorem eLpNorm_euclideanBall_le_of_inv_norm_decay /-- The explicit growth constant attached to an inverse-distance decay estimate: the local norm near the origin plus the decay constant times the universal ball constant. -/ +@[expose] def invNormGrowthConstant (h : Vec3 → ℝ) (M R : ℝ) : ℝ := lpNorm h (ENNReal.ofReal (3 / 2 : ℝ)) (volume.restrict (Metric.ball (0 : Vec3) (2 * R))) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayFarField.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayFarField.lean index 1d474272d3..5e2834ff80 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayFarField.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayFarField.lean @@ -22,7 +22,7 @@ Newtonian representation `ext:newtonian` of the paper, where the difference of t representations is harmonic on all of space and tends to zero in the `L^{3/2}` average sense. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGeometry.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGeometry.lean index 3260313da7..d632063f66 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGeometry.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGeometry.lean @@ -15,7 +15,7 @@ Newtonian potentials of compactly supported data. Nothing measure-theoretic is involved: each statement is a triangle-inequality estimate on `Vec3`. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic noncomputable section diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGrowthSum.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGrowthSum.lean index 6844518be0..2752090cb1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGrowthSum.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayGrowthSum.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.Liouville Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayPotentials.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayPotentials.lean index 36f2462fbe..20ba75ba7a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayPotentials.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayPotentials.lean @@ -25,7 +25,7 @@ zeroth-order potential it follows from local integrability of the kernel, and fo the derivative potentials it is the Calderón–Zygmund bound. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayShell.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayShell.lean index 026856f540..376feb9ec6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayShell.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayShell.lean @@ -18,7 +18,7 @@ bound by the supremum of the weight times the volume of the ball would only give sum by a single change of variables. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayUnitBall.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayUnitBall.lean index 2c6d1180bb..6505ae23d7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayUnitBall.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/PotentialDecayUnitBall.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Harmonic.Liouville Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Potentials.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Potentials.lean index c82a145f0e..9d79fbfd71 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Potentials.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Potentials.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.Calculus.FDeriv.Measurable Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology @@ -329,10 +329,12 @@ private lemma pressure_potential_pairing_of_compact ring /-- The Newtonian potential with the paper's sign convention `N = -newtonianKernel`. -/ +@[expose] def pressureNewtonianPotential (g : Vec3 → ℝ) (x : Vec3) : ℝ := ∫ y, (-newtonianKernel (x-y)) * g y /-- The first derivative potential, written as `-∂ⱼN * g = ∂ⱼ(newtonianKernel) * g`. -/ +@[expose] def pressureNewtonianDerivativePotential (i : Fin 3) (g : Vec3 → ℝ) (x : Vec3) : ℝ := ∫ y, CKN.spatialDeriv newtonianKernel i (x-y) * g y diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIdentity.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIdentity.lean index de54b88aeb..9b9654abb9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIdentity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIdentity.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Integral.Prod Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIntegrability.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIntegrability.lean index 191f080166..718c3e9647 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIntegrability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceIntegrability.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Integral.Prod Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceVelocityCube.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceVelocityCube.lean index 8c0136fac1..59834365b9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceVelocityCube.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/SliceVelocityCube.lean @@ -22,7 +22,7 @@ unconditional Calderón--Zygmund estimate. The nine-entry source bound retains its dimension factor by packaging it into the source energy. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/Slices.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/Slices.lean index 76be4e245f..6ec5442e70 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/Slices.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/Slices.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Measure.Restrict Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Pressure/UTensorNormFactor.lean b/LeanPool/CaffarelliKohnNirenberg/Pressure/UTensorNormFactor.lean index 4c255e25f1..5e336ebd38 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Pressure/UTensorNormFactor.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Pressure/UTensorNormFactor.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Pressure.PkBoundsBasic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Cutoff.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Cutoff.lean index 108db169bb..6be2c5f978 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Cutoff.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Cutoff.lean @@ -23,7 +23,7 @@ public import Mathlib.Tactic.Ring Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set Filter open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/DivergenceFreeSlice.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/DivergenceFreeSlice.lean index b6ffa361a5..47bbc0bebf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/DivergenceFreeSlice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/DivergenceFreeSlice.lean @@ -29,7 +29,7 @@ null set requires a countable `C¹`-dense family of test functions and is not fo here. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/AELocalEnergy.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/AELocalEnergy.lean index 350cb21721..168e94a9f6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/AELocalEnergy.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/AELocalEnergy.lean @@ -21,7 +21,7 @@ public import Mathlib.MeasureTheory.Measure.Real Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Calculus.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Calculus.lean index 833ba09bca..264ddf3880 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Calculus.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Calculus.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Energy.PointwiseEnergy Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Integrability.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Integrability.lean index 1a38911431..1aaa22fe80 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Integrability.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/Integrability.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Cutoff.Ball Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/PointwiseEnergy.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/PointwiseEnergy.lean index dadd7e0da2..17f764d991 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/PointwiseEnergy.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/PointwiseEnergy.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SuitableWeakSolutionIn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -25,19 +25,23 @@ noncomputable section namespace CKN /-- The time derivative on the explicit space-time product carrier. -/ +@[expose] def timePartialProd (g : Vec3 × ℝ → ℝ) (z : Vec3 × ℝ) : ℝ := timePartial (show ParabolicPoint → ℝ from g) z /-- The spatial derivative on the explicit space-time product carrier. -/ +@[expose] def spatialPartialProd (g : Vec3 × ℝ → ℝ) (i : Fin 3) (z : Vec3 × ℝ) : ℝ := spatialPartial (show ParabolicPoint → ℝ from g) i z /-- The iterated spatial derivative on the explicit product carrier. -/ +@[expose] def spatialSecondPartialProd (g : Vec3 × ℝ → ℝ) (i j : Fin 3) (z : Vec3 × ℝ) : ℝ := spatialSecondPartial (show ParabolicPoint → ℝ from g) i j z /-- The right-hand energy density in the local energy inequality. -/ +@[expose] def localEnergyRhs (u : Vec3 × ℝ → Vec3) (p : Vec3 × ℝ → ℝ) (f : Vec3 × ℝ → Vec3) (ψ : Vec3 × ℝ → ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/TimeCutoff.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/TimeCutoff.lean index 329aae4922..a39a8159f3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/TimeCutoff.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Energy/TimeCutoff.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlow.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlow.lean index 73bb191882..77f717ab86 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlow.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlow.lean @@ -16,7 +16,7 @@ The velocity has one component, depending only on the transverse coordinate and time. Its spatial gradient has only the entry in row zero, column one. -/ -@[expose] public section +public section open Set MeasureTheory open CKN.Foundation.Parabolic @@ -25,18 +25,22 @@ open CKN.Foundation.Parabolic namespace CKN /-- A decaying sinusoidal shear velocity. -/ +@[expose] noncomputable def shearFlow (z : ParabolicPoint) : Vec3 := fun i => if i = 0 then Real.exp (-z.2) * Real.sin (z.1 1) else 0 /-- The explicit spatial gradient of the shear velocity. -/ +@[expose] noncomputable def shearFlowGrad (z : ParabolicPoint) : Fin 3 → Vec3 := fun i j => if i = 0 ∧ j = 1 then Real.exp (-z.2) * Real.cos (z.1 1) else 0 /-- The scalar amplitude of the velocity. -/ +@[expose] noncomputable def shearAmplitude (z : Vec3 × ℝ) : ℝ := Real.exp (-z.2) * Real.sin (z.1 1) /-- The transverse derivative of the amplitude. -/ +@[expose] noncomputable def shearSlope (z : Vec3 × ℝ) : ℝ := Real.exp (-z.2) * Real.cos (z.1 1) diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergy.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergy.lean index 57923373f1..12542af593 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergy.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergy.lean @@ -14,7 +14,7 @@ Two spatial integrations by parts and one time integration by parts give the energy identity, hence the local energy inequality for nonnegative tests. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic CKN.ShearCalculus diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergyDensity.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergyDensity.lean index 0fdda06c75..27e034e2b3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergyDensity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowEnergyDensity.lean @@ -9,7 +9,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Examples.ShearFlow /-! # Pointwise energy calculus for the viscous shear -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic @@ -19,9 +19,11 @@ open CKN.ShearCalculus namespace CKN /-- The kinetic-energy density of the shear. -/ +@[expose] noncomputable def shearEnergy (z : Vec3 × ℝ) : ℝ := shearAmplitude z * shearAmplitude z /-- The cubic scalar transport factor. -/ +@[expose] noncomputable def shearTransport (z : Vec3 × ℝ) : ℝ := shearEnergy z * shearAmplitude z /-- Smoothness of the energy density. -/ diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowIBP.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowIBP.lean index fc174b94de..168d754742 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowIBP.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowIBP.lean @@ -16,7 +16,7 @@ Directional integration by parts for a smooth field and a compactly supported test on the raw product of space and time, expressed using factor derivatives. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowLocalData.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowLocalData.lean index aaf153eaaf..dc4415b888 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowLocalData.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowLocalData.lean @@ -14,7 +14,7 @@ The velocity and its gradient are bounded by one on the positive time interval. Compact local boxes therefore have finite energy and slice bounds. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowSuitable.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowSuitable.lean index 3ceaf243af..ea6b345bac 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowSuitable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowSuitable.lean @@ -15,7 +15,7 @@ The smooth decaying shear satisfies every clause of the suitable weak-solution definition on all space and the time interval (0,1), with zero pressure and force. -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowWeakForm.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowWeakForm.lean index f6acf84977..1c2e314611 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowWeakForm.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Examples/ShearFlowWeakForm.lean @@ -9,7 +9,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.Examples.ShearFlowEnergyD /-! # Divergence and momentum identities for the viscous shear -/ -@[expose] public section +public section open MeasureTheory Set open CKN.Foundation.Parabolic CKN.ShearCalculus diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonCore.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonCore.lean index 6bcd52fe87..2d97dad3d4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonCore.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonCore.lean @@ -21,7 +21,7 @@ the convexity estimate, so it is the Euclidean norm used by the scale quantities. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology BigOperators @@ -34,6 +34,7 @@ noncomputable section namespace CKN /-- Tsai's velocity excess `C_tilde` on the one-sided parabolic cylinder. -/ +@[expose] noncomputable def tsaiVelocityExcess (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := r⁻¹ ^ (2 : ℕ) * @@ -42,6 +43,7 @@ noncomputable def tsaiVelocityExcess (u : ParabolicPoint → Vec3) (u w - ⨍ y in parabolicCylinder z.1 z.2 r, u y) ^ (3 : ℕ)) /-- Tsai's pressure excess `D_tilde` on the one-sided parabolic cylinder. -/ +@[expose] noncomputable def tsaiPressureExcess (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ := r⁻¹ ^ (2 : ℕ) * @@ -49,13 +51,14 @@ noncomputable def tsaiPressureExcess (p : ParabolicPoint → ℝ) |p w - spatialAverage z.1 r w.2 p| ^ (3 / 2 : ℝ)) /-- Tsai's combined excess `φ`. -/ +@[expose] noncomputable def tsaiPhi (u : ParabolicPoint → Vec3) (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ := tsaiVelocityExcess u z r ^ (1 / 3 : ℝ) + tsaiPressureExcess p z r ^ (2 / 3 : ℝ) /-- Tsai's drift functional `Ψ`. -/ -noncomputable def tsaiPsi (u : ParabolicPoint → Vec3) +@[expose] noncomputable def tsaiPsi (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := r * vec3EuclideanNorm (⨍ w in parabolicCylinder z.1 z.2 r, u w) diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonPressure.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonPressure.lean index 2a6194d970..7592d925d0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonPressure.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ExcessComparisonPressure.lean @@ -9,7 +9,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ExcessComparisonCore /-! Pressure-side comparisons for the Tsai excess quantities. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallSupported.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallSupported.lean index 86af0e88d4..20c97c9759 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallSupported.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallSupported.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallTime.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallTime.lean index cd0b7d5773..e252828211 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallTime.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ExtSobolevBallTime.lean @@ -23,7 +23,7 @@ formalizes that time estimate on Euclidean balls. Clauses (i)--(iii) of the external input are independent and are not changed here. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Finiteness.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Finiteness.lean index 753ee763e1..6734581df5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Finiteness.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Finiteness.lean @@ -17,7 +17,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationBall.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationBall.lean index ca573a42c2..5e688f5887 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationBall.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationBall.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology @@ -31,7 +31,7 @@ def interpolationTheta (q : ℝ) : ℝ := 3 * (q - 2) / (2 * q) /-- Exponent of the gradient contribution in the velocity interpolation estimate. -/ -def interpolationExponent (q : ℝ) : ℝ := +@[expose] def interpolationExponent (q : ℝ) : ℝ := 3 * (q - 2) / 4 private theorem interpolationTheta_bounds {q : ℝ} (hq2 : 2 < q) (hq6 : q < 6) : diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationCylinder.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationCylinder.lean index a5be914680..90d3d3def8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationCylinder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/InterpolationCylinder.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/Monotonicity.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/Monotonicity.lean index 5dc7a88871..d7c251c902 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/Monotonicity.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/Monotonicity.lean @@ -38,7 +38,7 @@ require the relevant quantity at the larger radius to be finite: this is the in `paper/ckn.tex`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1.lean index d921dd89e4..7c5785f5b5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1.lean @@ -30,7 +30,7 @@ Gagliardo--Nirenberg inequality at `p = 1`. The affine bookkeeping is kept explicit so that the final constant is independent of the ball. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal Pointwise @@ -597,7 +597,7 @@ private theorem cutoff_gradient_lintegral_le (g : Vec 3 → ℝ) (hg : ContDiff _ = _ := by ring /-- The absolute unit-ball constant in the smooth `W^{1,1}` endpoint estimate. -/ -noncomputable def poincareSobolevL1Constant : ℝ≥0∞ := +@[expose] noncomputable def poincareSobolevL1Constant : ℝ≥0∞ := (SNormLESNormFDerivOfEqConst ℝ (volume : Measure (Vec 3)) (1 : ℝ) : ℝ≥0∞) * ((1 + 3 * 25 * 64 + 2 * 169 * 648 : ℝ≥0∞) + 96 * (3 * 64 + 2 * 648 : ℝ≥0∞) * ENNReal.ofReal unitL1PoincareConstant) diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Ball.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Ball.lean index c536d502a1..07ad92337a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Ball.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Ball.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.PoincareSobolevL1 Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Slice.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Slice.lean index df3f03b9fe..e363371abb 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Slice.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Slice.lean @@ -21,7 +21,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Poincare.LpCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory Filter Topology open scoped BigOperators ENNReal Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1SliceBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1SliceBasic.lean index 2a6e10f967..84a2599ed2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1SliceBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1SliceBasic.lean @@ -18,7 +18,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Poincare.LpCon Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory Filter Topology open scoped BigOperators ENNReal Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Vec.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Vec.lean index eee9734d7c..fcaf7c18fd 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Vec.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/PoincareSobolevL1Vec.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Poincare.Gradi Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory open scoped BigOperators ENNReal @@ -33,6 +33,7 @@ private theorem vec3Ball_eq_euclideanBall {x₀ : Vec3} {r : ℝ} (hr : 0 < r) : using (mem_euclideanBall_iff_vecEuclideanNorm_lt (d := 3) hr).symm /-- Explicit constant for the vector-valued ball inequality. -/ +@[expose] noncomputable def poincareSobolevL1VectorConstant : ℝ := 2 * Real.sqrt 3 * poincareSobolevL1Constant.toReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/PressureGaugeSlices.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/PressureGaugeSlices.lean index c68e6f73d1..b3605f1158 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/PressureGaugeSlices.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/PressureGaugeSlices.lean @@ -35,7 +35,7 @@ supremum of the slice energies in `def:sws` together with `x ≤ 1 + x²`; no Gagliardo-Nirenberg input is needed. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter Metric open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvariance.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvariance.lean index 0ac67a9460..7832b30b67 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvariance.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvariance.lean @@ -17,7 +17,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceBasic.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceBasic.lean index ddd77b5521..ef35c991b5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceBasic.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceBasic.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.NormedSpace Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology Pointwise @@ -28,23 +28,28 @@ noncomputable section namespace CKN /-- Spatial part of the parabolic change of variables. -/ +@[expose] def scalingSpace (μ : ℝ) (x₀ : Vec3) : Vec3 → Vec3 := fun y => x₀ + μ • y /-- Temporal part of the parabolic change of variables. -/ +@[expose] def scalingTime (μ : ℝ) (t₀ : ℝ) : ℝ → ℝ := fun s => t₀ + μ ^ 2 * s /-- Parabolic dilation followed by space-time translation. -/ +@[expose] def scalingParabolic (μ : ℝ) (z₀ : ParabolicPoint) : ParabolicPoint → ParabolicPoint := fun z => parabolicTranslate z₀.1 z₀.2 (parabolicScale μ z) /-- Spatial domain pulled back under the parabolic change of variables. -/ +@[expose] def rescaledSpace (μ : ℝ) (x₀ : Vec3) (Ω : Set Vec3) : Set Vec3 := scalingSpace μ x₀ ⁻¹' Ω /-- Time domain pulled back under the parabolic change of variables. -/ +@[expose] def rescaledTime (μ : ℝ) (t₀ : ℝ) (I : Set ℝ) : Set ℝ := scalingTime μ t₀ ⁻¹' I diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS2.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS2.lean index 91a2548e0c..a6b7ffeac9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS2.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS2.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ScalingInvarianceTests Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS3S4.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS3S4.lean index 80eb619330..a05e2e8b55 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS3S4.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceS3S4.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.ScalingInvarianceTests Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceTests.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceTests.lean index d25c5f77be..21af52b294 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceTests.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceTests.lean @@ -16,7 +16,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceWeak.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceWeak.lean index d4f9957691..b55c615088 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceWeak.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingInvarianceWeak.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.WeakDerivative Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantities.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantities.lean index cc8c6bdc3a..e36be37200 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantities.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantities.lean @@ -24,7 +24,7 @@ the boundedness assumption that makes the transform of an essential supremum legitimate; every other quantity is unconditional. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set open scoped ENNReal Pointwise @@ -39,24 +39,28 @@ namespace CKN /-- The velocity component of the parabolically rescaled solution of Definition `def:rescaling`: `u^{μ,z₀}(y,s) = μ u(x₀ + μ y, t₀ + μ² s)`. -/ +@[expose] noncomputable def rescaleVelocity (μ : ℝ) (z₀ : ParabolicPoint) (u : ParabolicPoint → Vec3) : ParabolicPoint → Vec3 := fun w => μ • u (parabolicTranslate z₀.1 z₀.2 (parabolicScale μ w)) /-- The pressure component of the parabolically rescaled solution of Definition `def:rescaling`: `p^{μ,z₀}(y,s) = μ² p(x₀ + μ y, t₀ + μ² s)`. -/ +@[expose] noncomputable def rescalePressure (μ : ℝ) (z₀ : ParabolicPoint) (p : ParabolicPoint → ℝ) : ParabolicPoint → ℝ := fun w => μ ^ 2 * p (parabolicTranslate z₀.1 z₀.2 (parabolicScale μ w)) /-- The force component of the parabolically rescaled solution of Definition `def:rescaling`: `f^{μ,z₀}(y,s) = μ³ f(x₀ + μ y, t₀ + μ² s)`. -/ +@[expose] noncomputable def rescaleForce (μ : ℝ) (z₀ : ParabolicPoint) (f : ParabolicPoint → Vec3) : ParabolicPoint → Vec3 := fun w => μ ^ 3 • f (parabolicTranslate z₀.1 z₀.2 (parabolicScale μ w)) /-- The rescaled spatial gradient datum matching `rescaleVelocity`: the chain rule gives `∇(u^{μ,z₀}) = μ² (∇u) ∘ T` for `T(y,s) = (x₀ + μ y, t₀ + μ² s)`. -/ +@[expose] noncomputable def rescaleGradient (μ : ℝ) (z₀ : ParabolicPoint) (Du : ParabolicPoint → Fin 3 → Vec3) : ParabolicPoint → Fin 3 → Vec3 := fun w i => μ ^ 2 • Du (parabolicTranslate z₀.1 z₀.2 (parabolicScale μ w)) i diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantityNonneg.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantityNonneg.lean index 56f00551fe..8444c26d76 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantityNonneg.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/ScalingQuantityNonneg.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.Lambda Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SingularSetClosed.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SingularSetClosed.lean index 2e10a7529a..c58be17838 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SingularSetClosed.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SingularSetClosed.lean @@ -19,7 +19,7 @@ point of that same neighbourhood; the singular set is then the trace on `𝒪` of the complement, a closed set. -/ -@[expose] public section +public section open Set Filter diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SliceNormBounds.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SliceNormBounds.lean index af38e0d623..e10f3f4427 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SliceNormBounds.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SliceNormBounds.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Function.L1Space.Integrable Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBall.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBall.lean index e24a2319a5..572b7f705f 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBall.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBall.lean @@ -20,7 +20,7 @@ same-ball estimate. This module records the localization step explicitly; the remaining reduction of its outer-ball terms to the original ball is kept separate. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal @@ -478,6 +478,7 @@ theorem seeleyLocalizedSobolevBound (v : Vec 3 → ℝ) (c : ℝ) all_goals norm_num /-- Finite coefficient in the L⁶ Poincare–Sobolev estimate on a Euclidean ball. -/ +@[expose] noncomputable def sobolevPoincareL6Constant : ℝ≥0∞ := let Cg : ℝ≥0∞ := 2 * (1 + 2 * 675 ^ 2 * 64 + 2 * 3042 ^ 2 * 648) + diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithful.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithful.lean index 4b59c937ed..47fdad3f6e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithful.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithful.lean @@ -34,7 +34,7 @@ This file records the three clauses of the ball lemma together with one constant chosen independently of the ball and the functions. -/ -@[expose] public section +public section open MeasureTheory Filter Topology open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1.lean index dde137a34d..df7ada6aec 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1.lean @@ -33,7 +33,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.SobolevPoincareBallFaithf These lemmas transfer smooth Euclidean-ball Poincaré estimates to W¹,¹ data. -/ -@[expose] public section +public section open MeasureTheory Filter Topology open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1Local.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1Local.lean index d2d22890ce..06e64fc771 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1Local.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallFaithfulL1Local.lean @@ -32,7 +32,7 @@ public import Mathlib.Tactic.Finiteness These lemmas transfer smooth Euclidean-ball Poincaré estimates to W¹,¹ data. -/ -@[expose] public section +public section open MeasureTheory Filter Topology open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallWeak.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallWeak.lean index f47b5a0a58..e86e02eb79 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallWeak.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBallWeak.lean @@ -22,7 +22,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set MeasureTheory Filter Topology open scoped ENNReal Convolution Pointwise diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBridge.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBridge.lean index f8c8f7cf77..ac8328452b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBridge.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareBridge.lean @@ -18,7 +18,7 @@ public import Mathlib.MeasureTheory.SpecificCodomains.Pi Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal Topology @@ -30,6 +30,7 @@ noncomputable section namespace CKN /-- Volume-normalization coefficient for the full ball Sobolev estimate. -/ +@[expose] noncomputable def sobolevPoincareBallFullConstant : ℝ≥0∞ := ENNReal.ofReal (Real.pi * 4 / 3) ^ (-(1 / 3 : ℝ)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantFinite.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantFinite.lean index 633d277061..9020e0d34b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantFinite.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantFinite.lean @@ -14,7 +14,7 @@ public import Mathlib.Tactic.Finiteness Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantPos.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantPos.lean index 966d784071..122007f0e0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantPos.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareConstantPos.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareRescale.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareRescale.lean index 202f99b516..01039b02d5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareRescale.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/SobolevPoincareRescale.lean @@ -23,7 +23,7 @@ norm of the gradient. These steps contribute respectively `(4π/3)^(1/3) r` and `√3` to the constant. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal NNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/TimeHolder.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/TimeHolder.lean index 1fd28cef96..0dc448bb82 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/TimeHolder.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/TimeHolder.lean @@ -17,7 +17,7 @@ which agrees with the usual `L^p` norm when the latter is finite and keeps the statements valid without an extra integrability hypothesis. -/ -@[expose] public section +public section open Set MeasureTheory open scoped ENNReal diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/UTensor.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/UTensor.lean index 1e821e1595..08f36e4dc5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/UTensor.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/UTensor.lean @@ -43,7 +43,7 @@ field; everything else is the pointwise rank-one identity `|U| = |u| |v|`, Hölder's inequality, and the volume of `B_ρ`. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -57,6 +57,7 @@ noncomputable section /-- The `j`-th component of `u(·,t)` with its spatial average over `B_ρ = vec3Ball x₀ ρ` subtracted, the mean-free component appearing in equation `eq:Uij` of `paper/ckn.tex`. -/ +@[expose] def meanFreeComponent (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) (t : ℝ) (j : Fin 3) (y : Vec3) : ℝ := u (y, t) j - MeasureTheory.average @@ -64,18 +65,20 @@ def meanFreeComponent (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) (t /-- The mean-free velocity `v = u(·,t) - ⨍_{B_ρ} u(·,t)` of equation `eq:Uij` in `paper/ckn.tex`. -/ -def meanFreeVec (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) (t : ℝ) +@[expose] def meanFreeVec (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ : ℝ) (t : ℝ) (y : Vec3) : Vec3 := fun j => meanFreeComponent u x₀ ρ t j y /-- The rank-one tensor `U_ij = -u_i (u_j - ⨍_{B_ρ} u_j)` of equation `eq:Uij` in `paper/ckn.tex`. -/ +@[expose] def utensor (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ t : ℝ) (i j : Fin 3) (y : Vec3) : ℝ := - u (y, t) i * meanFreeComponent u x₀ ρ t j y /-- The pointwise norm `|U| = (∑_{i,j} U_ij²)^{1/2}` of the tensor of equation `eq:Uij` in `paper/ckn.tex`. -/ +@[expose] def utensorNorm (u : ParabolicPoint → Vec3) (x₀ : Vec3) (ρ t : ℝ) (y : Vec3) : ℝ := Real.sqrt (∑ i : Fin 3, ∑ j : Fin 3, (utensor u x₀ ρ t i j y) ^ (2 : ℕ)) diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/VectorInequalities.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/VectorInequalities.lean index ab0de0c0d3..a08a45a880 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/VectorInequalities.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/VectorInequalities.lean @@ -21,7 +21,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SuitableWeakSolutionIn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Setting/VectorNormAggregation.lean b/LeanPool/CaffarelliKohnNirenberg/Setting/VectorNormAggregation.lean index fa6019699e..d4a5dc9970 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Setting/VectorNormAggregation.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Setting/VectorNormAggregation.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Setting.VectorInequalities Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Metric Filter open scoped ENNReal NNReal Topology BigOperators diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/Alpha.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/Alpha.lean index ff5ebe21bf..3d5df4e6f0 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/Alpha.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/Alpha.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Integration. Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology @@ -26,6 +26,7 @@ noncomputable section namespace CKN /-- The velocity energy quantity α from the manuscript, `eq:alpha-beta`. -/ +@[expose] noncomputable def alpha (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := (r⁻¹ * (timeSliceEnergyEssSup z.1 z.2 r (fun w => vec3EuclideanNorm (u w))).toReal) ^ (1 / 2 : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/Beta.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/Beta.lean index 3c7f83a629..9367cb95d6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/Beta.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/Beta.lean @@ -14,7 +14,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology @@ -27,6 +27,7 @@ namespace CKN /-- The gradient quantity β from the manuscript, `eq:alpha-beta`; `Du` is the explicit gradient datum. -/ +@[expose] noncomputable def beta (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := (r⁻¹ * (∫⁻ w in parabolicCylinder z.1 z.2 r, diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/Delta.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/Delta.lean index 254e90e1fa..80075d55c1 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/Delta.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/Delta.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology @@ -25,6 +25,7 @@ noncomputable section namespace CKN /-- The pressure quantity δ from the manuscript, `eq:alpha-beta`. -/ +@[expose] noncomputable def delta (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ := (r ^ (-2 : ℝ) * (∫⁻ w in parabolicCylinder z.1 z.2 r, ENNReal.ofReal |p w| ^ (3 / 2 : ℝ)).toReal) ^ (1 / 3 : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/Gamma.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/Gamma.lean index e459422717..9e1a4187ad 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/Gamma.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/Gamma.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology @@ -25,6 +25,7 @@ noncomputable section namespace CKN /-- The velocity cubic quantity γ from the manuscript, `eq:alpha-beta`. -/ +@[expose] noncomputable def gamma (u : ParabolicPoint → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := (r ^ (-2 : ℝ) * (∫⁻ w in parabolicCylinder z.1 z.2 r, ENNReal.ofReal (vec3EuclideanNorm (u w)) ^ (3 : ℝ)).toReal) ^ (1 / 3 : ℝ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/Lambda.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/Lambda.lean index c5d292d74c..28f95ea7f6 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/Lambda.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/Lambda.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal NNReal Topology @@ -25,6 +25,7 @@ noncomputable section namespace CKN /-- The force quantity λ from the manuscript, `eq:lambda`. -/ +@[expose] noncomputable def lambda (q : ℝ) (f : ParabolicPoint → Vec3) (z : ParabolicPoint) (r : ℝ) : ℝ := r ^ (3 - 5 / q) * diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/LocalBox.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/LocalBox.lean index 712aa5b1b9..20f47185e8 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/LocalBox.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/LocalBox.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set open CKN.Foundation.Parabolic @@ -22,6 +22,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- Compactly interior spatial and time subdomains used by paper label `def:sws`. -/ +@[expose] def localBox (Ω : Set Vec3) (I : Set ℝ) (Ω' : Set Vec3) (J : Set ℝ) : Prop := IsOpen Ω' ∧ IsCompact (closure Ω') ∧ closure Ω' ⊆ Ω ∧ OrdConnected J ∧ IsCompact (closure J) ∧ closure J ⊆ I diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/LocalLp.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/LocalLp.lean index 5ea2af2469..da68612f97 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/LocalLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/LocalLp.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal @@ -24,6 +24,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- Local scalar `Lp` membership used by paper label `def:sws`. -/ +@[expose] def localLp (E : Set ParabolicPoint) (p : ℝ) (g : ParabolicPoint → ℝ) : Prop := MeasureTheory.MemLp g (ENNReal.ofReal p) (volume.restrict E) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/LocalVecLp.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/LocalVecLp.lean index 4c4ea6048c..628803fc16 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/LocalVecLp.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/LocalVecLp.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.LocalLp Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -21,6 +21,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- Componentwise local vector `Lp` membership used by paper label `def:sws`. -/ +@[expose] def localVecLp (E : Set ParabolicPoint) (p : ℝ) (g : ParabolicPoint → Vec3) : Prop := ∀ i : Fin 3, localLp E p (fun z => g z i) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/MorreyVecMem.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/MorreyVecMem.lean index ec642fe2c0..5c5b964a79 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/MorreyVecMem.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/MorreyVecMem.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Morrey.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set open scoped ENNReal @@ -24,7 +24,7 @@ open CKN.Foundation.Parabolic.Morrey namespace CKN /-- Componentwise parabolic Morrey membership used by paper label `def:parabolic-morrey`. -/ -def morreyVecMem (P τ : ℝ) (S : Set ParabolicPoint) +@[expose] def morreyVecMem (P τ : ℝ) (S : Set ParabolicPoint) (u : ParabolicPoint → Vec3) : Prop := ∀ i : Fin 3, morreyBallNorm P τ (S.indicator (fun z => u z i)) < ∞ diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecNormLE.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecNormLE.lean index 3c41e2acfc..5702d94d33 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecNormLE.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecNormLE.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -21,6 +21,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- A bounded vector-valued parabolic Hölder norm built from paper label `def:holder`. -/ +@[expose] def ParabolicHolderVecNormLE (U : Set ParabolicPoint) (g : ParabolicPoint → Vec3) (γ C : ℝ) : Prop := ∃ B K : ℝ, 0 ≤ B ∧ 0 ≤ K ∧ B + K ≤ C ∧ diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecOn.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecOn.lean index 6a74c4141a..9a482b69b2 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecOn.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/ParabolicHolderVecOn.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -21,6 +21,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- Vector-valued parabolic Hölder control from paper label `def:holder`. -/ +@[expose] def ParabolicHolderVecOn (U : Set ParabolicPoint) (g : ParabolicPoint → Vec3) (γ : ℝ) : Prop := ∃ B K : ℝ, 0 ≤ B ∧ 0 ≤ K ∧ diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/RegularPoint.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/RegularPoint.lean index 3b7e003cbd..2bc70f8413 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/RegularPoint.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/RegularPoint.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open CKN.Foundation.Parabolic @@ -27,6 +27,7 @@ namespace CKN /-- The regular-point predicate from paper label `def:regular`, with the Hölder representative convention of docs/DESIGN_NOTES.md. -/ +@[expose] def IsRegularPoint (Ω : Set Vec3) (I : Set ℝ) (u : ParabolicPoint → Vec3) (z₀ : ParabolicPoint) : Prop := z₀ ∈ spaceTimeSet Ω I ∧ diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SingularSet.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SingularSet.lean index a3edc75657..59cf6721ca 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SingularSet.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SingularSet.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.RegularPoint Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set @@ -23,6 +23,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- The singular set from paper label `def:regular`. -/ +@[expose] def SingularSet (Ω : Set Vec3) (I : Set ℝ) (u : ParabolicPoint → Vec3) : Set ParabolicPoint := {z | z ∈ spaceTimeSet Ω I ∧ ¬ IsRegularPoint Ω I u z} diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeSet.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeSet.lean index ca648c0e88..b42b1903da 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeSet.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeSet.lean @@ -13,13 +13,14 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic namespace CKN /-- The open space-time carrier `Ω × I` from paper label `def:sws`. -/ +@[expose] def spaceTimeSet (Ω : Set Vec3) (I : Set ℝ) : Set ParabolicPoint := Ω ×ˢ I end CKN diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeTestFunction.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeTestFunction.lean index 79c58e8f0a..11c3cadbee 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeTestFunction.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SpaceTimeTestFunction.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.Calculus.ContDiff.Operations Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set open CKN.Foundation.Parabolic @@ -26,6 +26,7 @@ namespace CKN /-- The smooth compactly supported test-function class on `Ω × I` from paper label `def:sws`; its ordinary product space follows the test-function convention of docs/DESIGN_NOTES.md. -/ +@[expose] def spaceTimeTestFunction {V : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] (Ω : Set Vec3) (I : Set ℝ) : Set (Vec3 × ℝ → V) := {φ | ContDiff ℝ (⊤ : ℕ∞) φ ∧ HasCompactSupport φ ∧ diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialGradientSq.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialGradientSq.lean index 906dbe55d8..58d12033d3 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialGradientSq.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialGradientSq.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Parabolic.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -21,6 +21,7 @@ open CKN.Foundation.Parabolic namespace CKN /-- The squared spatial-gradient density used by paper label `def:sws`. -/ +@[expose] def spatialGradientSq (_u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (z : ParabolicPoint) : ℝ := ∑ i, ∑ j, (Du z i j) ^ (2 : ℕ) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialPartial.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialPartial.lean index e3000978f4..b41d3261a9 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialPartial.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialPartial.lean @@ -15,7 +15,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Foundation.Sobolev.Ambient.Basis Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -26,6 +26,7 @@ namespace CKN /-- Factor-wise spatial derivative on the ordinary product space described in docs/DESIGN_NOTES.md. -/ +@[expose] def spatialPartial (g : ParabolicPoint → ℝ) (i : Fin 3) (z : ParabolicPoint) : ℝ := (fderiv ℝ (fun x : Vec3 => g (x, z.2)) z.1) (basisVec i) diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialSecondPartial.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialSecondPartial.lean index 0a9ccbb529..b943fedddf 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialSecondPartial.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SpatialSecondPartial.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SpatialPartial Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -23,6 +23,7 @@ noncomputable section namespace CKN /-- The iterated spatial derivative used in the local energy inequality. -/ +@[expose] def spatialSecondPartial (g : ParabolicPoint → ℝ) (i j : Fin 3) (z : ParabolicPoint) : ℝ := spatialPartial (fun w => spatialPartial g i w) j z diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolution.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolution.lean index ce09ec0a83..92d425395e 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolution.lean @@ -24,7 +24,7 @@ public import Mathlib.MeasureTheory.Integral.Bochner.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -45,7 +45,7 @@ integrand it tests. The a.e. uniqueness of the weak gradient is four integrability conjuncts to the identity clauses. Those follow from the regularity clauses above, so the two classes have the same inhabitants; the proof is `CKN.isSuitableWeakSolution_iff_integrable`. -/ -def IsSuitableWeakSolution (Ω : Set Vec3) (I : Set ℝ) (q : ℝ) +@[expose] def IsSuitableWeakSolution (Ω : Set Vec3) (I : Set ℝ) (q : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) : Prop := IsOpen Ω ∧ IsOpen I ∧ OrdConnected I ∧ 5 / 2 < q ∧ diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolutionIntegrable.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolutionIntegrable.lean index e3776c5697..1436b5df0a 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolutionIntegrable.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/SuitableWeakSolutionIntegrable.lean @@ -24,7 +24,7 @@ public import Mathlib.MeasureTheory.Integral.Bochner.Basic Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Set Filter open scoped ENNReal NNReal Topology @@ -37,6 +37,7 @@ namespace CKN finite energies, support integrability, and interval time domains. The a.e. uniqueness of the weak gradient is `CKN.HasWeakPartialDerivOn.ae_eq` from `CKN/Foundation/Sobolev/WeakDerivative.lean`. -/ +@[expose] def IsSuitableWeakSolutionIntegrable (Ω : Set Vec3) (I : Set ℝ) (q : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (f : ParabolicPoint → Vec3) : Prop := diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremA.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremA.lean index c46661d96f..2b79ad1fb7 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremA.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremA.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.ParabolicHolderVecNorm Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremB.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremB.lean index 1dec3b305b..38b48ae637 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremB.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremB.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SpatialGradientSq Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremC.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremC.lean index fc9cbdcea7..137615db40 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremC.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/TheoremC.lean @@ -19,7 +19,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SingularSet Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/Theta.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/Theta.lean index d9ffc65ed4..ac2e634ca4 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/Theta.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/Theta.lean @@ -15,13 +15,14 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.Delta Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic namespace CKN /-- The iteration quantity θ from the manuscript, `eq:theta`. -/ +@[expose] noncomputable def theta (κ : ℝ) (u : ParabolicPoint → Vec3) (Du : ParabolicPoint → Fin 3 → Vec3) (p : ParabolicPoint → ℝ) (z : ParabolicPoint) (r : ℝ) : ℝ := diff --git a/LeanPool/CaffarelliKohnNirenberg/Statements/TimePartial.lean b/LeanPool/CaffarelliKohnNirenberg/Statements/TimePartial.lean index 6e900df923..f457c0f96b 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Statements/TimePartial.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Statements/TimePartial.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.Calculus.FDeriv.Add Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open CKN.Foundation.Parabolic @@ -24,6 +24,7 @@ noncomputable section namespace CKN /-- Factor-wise time derivative on the ordinary product space described in docs/DESIGN_NOTES.md. -/ +@[expose] def timePartial (g : ParabolicPoint → ℝ) (z : ParabolicPoint) : ℝ := (fderiv ℝ (fun s : ℝ => g (z.1, s)) z.2) 1 diff --git a/LeanPool/CaffarelliKohnNirenberg/Witnesses/TrivialSolution.lean b/LeanPool/CaffarelliKohnNirenberg/Witnesses/TrivialSolution.lean index 2091819408..55835b9dc5 100644 --- a/LeanPool/CaffarelliKohnNirenberg/Witnesses/TrivialSolution.lean +++ b/LeanPool/CaffarelliKohnNirenberg/Witnesses/TrivialSolution.lean @@ -13,7 +13,7 @@ public import LeanPool.CaffarelliKohnNirenberg.Statements.SuitableWeakSolutionIn Part of the Caffarelli–Kohn–Nirenberg partial regularity proof. -/ -@[expose] public section +public section open Set open MeasureTheory diff --git a/LeanPool/CencovPetz.lean b/LeanPool/CencovPetz.lean index f7e209351d..904020ceba 100644 --- a/LeanPool/CencovPetz.lean +++ b/LeanPool/CencovPetz.lean @@ -46,7 +46,7 @@ Tags: information-geometry, fisher-information, markov-morphisms, finite-simplex MSC: 62B10, 53C21 -/ -@[expose] public section +public section /-! This project formalizes the finite/discrete Čencov-Petz uniqueness theorem: diff --git a/LeanPool/CencovPetz/Basic.lean b/LeanPool/CencovPetz/Basic.lean index 56016d7f24..7302e67eef 100644 --- a/LeanPool/CencovPetz/Basic.lean +++ b/LeanPool/CencovPetz/Basic.lean @@ -9,7 +9,7 @@ module # CencovPetz.Basic Root namespace and shared foundation for the Čencov–Petz uniqueness theorem package. --/@[expose] public section +-/public section namespace LeanPool.CencovPetz diff --git a/LeanPool/CencovPetz/CencovFinite.lean b/LeanPool/CencovPetz/CencovFinite.lean index 4edb1a464d..6ac190d728 100644 --- a/LeanPool/CencovPetz/CencovFinite.lean +++ b/LeanPool/CencovPetz/CencovFinite.lean @@ -36,7 +36,7 @@ multiple of Fisher. - `CencovPetz.MonotoneMetricFamily.eq_smul_fisher_of_continuous` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/CencovSplitPoint.lean b/LeanPool/CencovPetz/CencovSplitPoint.lean index 2127418d6d..f94a360cd1 100644 --- a/LeanPool/CencovPetz/CencovSplitPoint.lean +++ b/LeanPool/CencovPetz/CencovSplitPoint.lean @@ -32,7 +32,7 @@ scalar multiple of Fisher. - `CencovPetz.MonotoneMetricFamily.eq_smul_fisher_of_isSplitRepresentable` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/ContinuousExtension.lean b/LeanPool/CencovPetz/ContinuousExtension.lean index a5840a7368..ce73619f9d 100644 --- a/LeanPool/CencovPetz/ContinuousExtension.lean +++ b/LeanPool/CencovPetz/ContinuousExtension.lean @@ -27,7 +27,7 @@ identity to all simplex points. - `CencovPetz.eq_of_eqOn_dense₂` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/FisherContinuity.lean b/LeanPool/CencovPetz/FisherContinuity.lean index 0d4ca360b5..63258614b2 100644 --- a/LeanPool/CencovPetz/FisherContinuity.lean +++ b/LeanPool/CencovPetz/FisherContinuity.lean @@ -26,7 +26,7 @@ family. - `CencovPetz.Simplex.continuous_fisherBilin_apply` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/LeftInverseIsometry.lean b/LeanPool/CencovPetz/LeftInverseIsometry.lean index 465acabcd5..1b04db054c 100644 --- a/LeanPool/CencovPetz/LeftInverseIsometry.lean +++ b/LeanPool/CencovPetz/LeftInverseIsometry.lean @@ -26,7 +26,7 @@ is an isometry for the metric family. This is the abstract lemma behind permutation invariance and replication invariance. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/MarkovMorphism.lean b/LeanPool/CencovPetz/MarkovMorphism.lean index 26383db1c5..5b2a92a83b 100644 --- a/LeanPool/CencovPetz/MarkovMorphism.lean +++ b/LeanPool/CencovPetz/MarkovMorphism.lean @@ -35,7 +35,7 @@ needed for the Čencov/Chentsov uniqueness story. Markov morphism. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -81,7 +81,7 @@ noncomputable def deterministic (g : α → β) (hg : Function.Surjective g) : M simp /-- Pushforward of a distribution `p` along a Markov morphism `κ`. -/ -noncomputable def pushforward (p : Simplex α) : Simplex β := by +@[expose] noncomputable def pushforward (p : Simplex α) : Simplex β := by classical refine { p := fun b => ∑ a, p.p a * κ.K a b @@ -114,7 +114,8 @@ noncomputable def pushforward (p : Simplex α) : Simplex β := by _ = 1 := p.sum_eq_one /-- Pushforward of a tangent vector along a Markov morphism. -/ -noncomputable def tangentPushforward (u : tangentSpace (α := α)) : tangentSpace (α := β) := by +@[expose] noncomputable def tangentPushforward (u : tangentSpace (α := α)) : + tangentSpace (α := β) := by classical refine ⟨fun b => ∑ a : α, ((u : α → ℝ) a) * κ.K a b, ?_⟩ -- Prove the pushed-forward vector has total sum `0`. @@ -145,7 +146,8 @@ noncomputable def tangentPushforward (u : tangentSpace (α := α)) : tangentSpac rfl /-- `tangentPushforward` packaged as a linear map. -/ -noncomputable def tangentPushforwardLinear : tangentSpace (α := α) →ₗ[ℝ] tangentSpace (α := β) := by +@[expose] noncomputable def tangentPushforwardLinear : + tangentSpace (α := α) →ₗ[ℝ] tangentSpace (α := β) := by classical refine { toFun := κ.tangentPushforward diff --git a/LeanPool/CencovPetz/MonotoneMetric.lean b/LeanPool/CencovPetz/MonotoneMetric.lean index 2f88ed65b7..819eb59b21 100644 --- a/LeanPool/CencovPetz/MonotoneMetric.lean +++ b/LeanPool/CencovPetz/MonotoneMetric.lean @@ -35,7 +35,7 @@ needed for that proof. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -66,7 +66,7 @@ structure MonotoneMetricFamily : Type _ where g (α := α) p u u /-- The Fisher metric family is a monotone metric family. -/ -noncomputable def fisherMetricFamily : MonotoneMetricFamily where +@[expose] noncomputable def fisherMetricFamily : MonotoneMetricFamily where g := fun {α} _ => fisherBilin symm := by intro α _ p u v diff --git a/LeanPool/CencovPetz/PermutationInvariance.lean b/LeanPool/CencovPetz/PermutationInvariance.lean index 03e7120a95..6720c62f8c 100644 --- a/LeanPool/CencovPetz/PermutationInvariance.lean +++ b/LeanPool/CencovPetz/PermutationInvariance.lean @@ -31,7 +31,7 @@ permutation/equivalence invariance consequences for monotone metric families in any monotone metric family is invariant under equivalences (permutations) of finite types. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/PermutationInvariantBilinForm.lean b/LeanPool/CencovPetz/PermutationInvariantBilinForm.lean index d247f802b2..abc7a7b112 100644 --- a/LeanPool/CencovPetz/PermutationInvariantBilinForm.lean +++ b/LeanPool/CencovPetz/PermutationInvariantBilinForm.lean @@ -23,7 +23,7 @@ permutations (equivalences) of the underlying finite type. This is a technical step towards the finite Čencov uniqueness theorem. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -40,7 +40,7 @@ abbrev V (n : ℕ) : Type := tangentSpace (α := Fin n) namespace Basis /-- The coordinate basis vector on `Fin n`. -/ -noncomputable def e (i : Fin n) : Fin n → ℝ := Pi.single i (1 : ℝ) +@[expose] noncomputable def e (i : Fin n) : Fin n → ℝ := Pi.single i (1 : ℝ) lemma sum_e (i : Fin n) : (∑ k : Fin n, e (n := n) i k) = 1 := by classical @@ -51,7 +51,7 @@ lemma sum_sub_e (i j : Fin n) : (∑ k : Fin n, (e (n := n) i k - e (n := n) j k simp [e] /-- The tangent vector `e_i - e_j` (sum-zero). -/ -noncomputable def dij (i j : Fin n) : V n := +@[expose] noncomputable def dij (i j : Fin n) : V n := ⟨fun k => e (n := n) i k - e (n := n) j k, by -- Membership in `tangentSpace` is `∑ = 0`. exact (tangentSpace.mem_iff (α := Fin n) diff --git a/LeanPool/CencovPetz/RationalDensity.lean b/LeanPool/CencovPetz/RationalDensity.lean index 1b0e7ab749..5b5422fa76 100644 --- a/LeanPool/CencovPetz/RationalDensity.lean +++ b/LeanPool/CencovPetz/RationalDensity.lean @@ -28,7 +28,7 @@ simplex points. - `CencovPetz.Simplex.dense_setOf_isRational` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/RationalPoint.lean b/LeanPool/CencovPetz/RationalPoint.lean index 8981dd643b..ffc833ce87 100644 --- a/LeanPool/CencovPetz/RationalPoint.lean +++ b/LeanPool/CencovPetz/RationalPoint.lean @@ -34,7 +34,7 @@ This file packages the notion of a common-denominator point and relates it to - `CencovPetz.Simplex.IsRational.isSplitRepresentable` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -58,7 +58,7 @@ variable {α : Type u} [Fintype α] /-- A simplex point whose coordinates have a finite common-denominator representation `p(a) = m(a) / (∑ m)` for some strictly positive `m : α → ℕ`. -/ -def IsRational (p : Simplex α) : Prop := +@[expose] def IsRational (p : Simplex α) : Prop := ∃ m : α → ℕ, (∀ a, 0 < m a) ∧ ∀ a, p.p a = (m a : ℝ) / ((∑ a : α, m a : ℕ) : ℝ) diff --git a/LeanPool/CencovPetz/Replication.lean b/LeanPool/CencovPetz/Replication.lean index 516186e1fa..dd604249f9 100644 --- a/LeanPool/CencovPetz/Replication.lean +++ b/LeanPool/CencovPetz/Replication.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.ContinuousFunctionalCalculus Replication Markov morphisms `α → α × Fin m` that split each outcome into `m` copies uniformly. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/ReplicationInvariance.lean b/LeanPool/CencovPetz/ReplicationInvariance.lean index 650fe6f796..1410ab0c3d 100644 --- a/LeanPool/CencovPetz/ReplicationInvariance.lean +++ b/LeanPool/CencovPetz/ReplicationInvariance.lean @@ -22,7 +22,7 @@ For a monotone metric family (Čencov setting), replication maps `α → α × F they have a deterministic left inverse (coarsening), so monotonicity holds in both directions. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/Simplex.lean b/LeanPool/CencovPetz/Simplex.lean index bb336a2227..66b475078f 100644 --- a/LeanPool/CencovPetz/Simplex.lean +++ b/LeanPool/CencovPetz/Simplex.lean @@ -34,7 +34,7 @@ This is groundwork for the finite/discrete Čencov (Chentsov) uniqueness story. - `CencovPetz.fisherBilin_pos`: positive-definiteness on nonzero tangent vectors. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -95,7 +95,8 @@ end tangentSpace /-- The Fisher bilinear form on the simplex tangent space: `⟪u,v⟫_p = ∑ a, u a * v a / p a`. -/ -noncomputable def fisherBilin (p : Simplex α) : LinearMap.BilinForm ℝ (tangentSpace (α := α)) := by +@[expose] noncomputable def fisherBilin (p : Simplex α) : + LinearMap.BilinForm ℝ (tangentSpace (α := α)) := by classical refine LinearMap.mk₂ ℝ (fun u v => ∑ a, ((u : α → ℝ) a) * ((v : α → ℝ) a) / p.p a) ?_ ?_ ?_ ?_ diff --git a/LeanPool/CencovPetz/SimplexTopology.lean b/LeanPool/CencovPetz/SimplexTopology.lean index a8de49637f..3ea8f4aa00 100644 --- a/LeanPool/CencovPetz/SimplexTopology.lean +++ b/LeanPool/CencovPetz/SimplexTopology.lean @@ -26,7 +26,7 @@ proof fields of `Simplex` are propositions, this agrees with the usual subspace - `CencovPetz.Simplex.continuous_eval` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/Splitting.lean b/LeanPool/CencovPetz/Splitting.lean index dbe9ed6c1b..b781b5c5f4 100644 --- a/LeanPool/CencovPetz/Splitting.lean +++ b/LeanPool/CencovPetz/Splitting.lean @@ -28,7 +28,7 @@ These are left inverses on simplex points and tangent vectors, and are standard Čencov/Chentsov uniqueness proofs. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/SplittingInvariance.lean b/LeanPool/CencovPetz/SplittingInvariance.lean index 4ebd7b1217..986ea5897f 100644 --- a/LeanPool/CencovPetz/SplittingInvariance.lean +++ b/LeanPool/CencovPetz/SplittingInvariance.lean @@ -23,7 +23,7 @@ isometries: they have a deterministic left inverse (merge), so monotonicity hold directions. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/SplittingUniform.lean b/LeanPool/CencovPetz/SplittingUniform.lean index cf0f9f7651..8a082aa0b6 100644 --- a/LeanPool/CencovPetz/SplittingUniform.lean +++ b/LeanPool/CencovPetz/SplittingUniform.lean @@ -27,7 +27,7 @@ This is one of the standard reduction steps in finite Čencov/Chentsov uniquenes - `CencovPetz.MarkovMorphism.split_pushforward_eq_uniform_of_apply_eq_div_card` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -44,7 +44,7 @@ Such points become uniform after applying the fiberwise splitting Markov morphis `α → Σ a, Fin (m a)`. This is the standard “rational-point” reduction step in finite Čencov/Chentsov arguments. -/ -def IsSplitRepresentable (p : Simplex α) : Prop := +@[expose] def IsSplitRepresentable (p : Simplex α) : Prop := ∃ m : α → ℕ, (∀ a, 0 < m a) ∧ ∀ a, diff --git a/LeanPool/CencovPetz/SufficientStatistic.lean b/LeanPool/CencovPetz/SufficientStatistic.lean index 49dbd09aca..719a542143 100644 --- a/LeanPool/CencovPetz/SufficientStatistic.lean +++ b/LeanPool/CencovPetz/SufficientStatistic.lean @@ -40,7 +40,7 @@ reduces to Titu's lemma / Engel form of Cauchy–Schwarz on each fiber. surjective map (finite sufficient statistic). -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -51,7 +51,7 @@ namespace Simplex /-- Pushforward of a strictly positive distribution along a surjective map, by summing over fibers. -/ -noncomputable def pushforward (g : α → β) (hg : Function.Surjective g) (p : Simplex α) : +@[expose] noncomputable def pushforward (g : α → β) (hg : Function.Surjective g) (p : Simplex α) : Simplex β := by classical refine @@ -80,7 +80,7 @@ noncomputable def pushforward (g : α → β) (hg : Function.Surjective g) (p : end Simplex /-- Pushforward of a tangent vector along a map, by summing over fibers. -/ -noncomputable def tangentPushforward (g : α → β) (u : tangentSpace (α := α)) : +@[expose] noncomputable def tangentPushforward (g : α → β) (u : tangentSpace (α := α)) : tangentSpace (α := β) := by classical refine ⟨fun b => ∑ a with g a = b, ((u : α → ℝ) a), ?_⟩ diff --git a/LeanPool/CencovPetz/Uniform.lean b/LeanPool/CencovPetz/Uniform.lean index 6fd3248113..765880ba81 100644 --- a/LeanPool/CencovPetz/Uniform.lean +++ b/LeanPool/CencovPetz/Uniform.lean @@ -26,7 +26,7 @@ calculations. - `IsUniform`: predicate asserting a function is uniform. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz diff --git a/LeanPool/CencovPetz/UniformScalarConstant.lean b/LeanPool/CencovPetz/UniformScalarConstant.lean index 9b88e698de..3312524753 100644 --- a/LeanPool/CencovPetz/UniformScalarConstant.lean +++ b/LeanPool/CencovPetz/UniformScalarConstant.lean @@ -33,7 +33,7 @@ pointwise scalar multiple with a scalar depending on the point. - `CencovPetz.MonotoneMetricFamily.uniformScalar_eq_uniformScalar_two` -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -44,7 +44,7 @@ open MarkovMorphism TangentFin /-- The scalar relating a monotone metric family to Fisher at the uniform simplex of dimension `n`. -/ -noncomputable def uniformScalar (G : MonotoneMetricFamily) (n : ℕ) (hn : 2 ≤ n) : ℝ := by +@[expose] noncomputable def uniformScalar (G : MonotoneMetricFamily) (n : ℕ) (hn : 2 ≤ n) : ℝ := by classical let i0 : Fin n := ⟨0, lt_of_lt_of_le Nat.zero_lt_two hn⟩ let i1 : Fin n := ⟨1, lt_of_lt_of_le Nat.one_lt_two hn⟩ diff --git a/LeanPool/CencovPetz/UniformScalarMultiple.lean b/LeanPool/CencovPetz/UniformScalarMultiple.lean index 5832f4e309..0329b6446b 100644 --- a/LeanPool/CencovPetz/UniformScalarMultiple.lean +++ b/LeanPool/CencovPetz/UniformScalarMultiple.lean @@ -24,7 +24,7 @@ plus the `dij` relations imply that (at the uniform point) the metric is determi scalar. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators diff --git a/LeanPool/CencovPetz/UniformSimplex.lean b/LeanPool/CencovPetz/UniformSimplex.lean index af6f1f6b26..5b90ed7df2 100644 --- a/LeanPool/CencovPetz/UniformSimplex.lean +++ b/LeanPool/CencovPetz/UniformSimplex.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.ContinuousFunctionalCalculus Package the uniform distribution on a finite type as a point of the open simplex. -/ -@[expose] public section +public section namespace LeanPool.CencovPetz open scoped BigOperators @@ -29,7 +29,7 @@ variable {α : Type*} [Fintype α] [Nonempty α] namespace Simplex /-- The uniform point of the open simplex. -/ -noncomputable def uniform : Simplex α where +@[expose] noncomputable def uniform : Simplex α where p := uniformDistribution (α := α) pos := by intro a diff --git a/LeanPool/CenteredMaximal.lean b/LeanPool/CenteredMaximal.lean index ec18748a67..403f9dc9ed 100644 --- a/LeanPool/CenteredMaximal.lean +++ b/LeanPool/CenteredMaximal.lean @@ -39,7 +39,7 @@ The exact minimal-polynomial degree, optimality, and an exact level-set area are of the formal results. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/CenteredMaximal/Basic.lean b/LeanPool/CenteredMaximal/Basic.lean index 6b38f1bf90..73faed1c6e 100644 --- a/LeanPool/CenteredMaximal/Basic.lean +++ b/LeanPool/CenteredMaximal/Basic.lean @@ -17,7 +17,7 @@ public import LeanPool.CenteredMaximal.Statement * `weakTypeConstant_le`, `le_weakTypeConstant`: the constant is the least weak type bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CenteredMaximal/Lattice/Constants.lean b/LeanPool/CenteredMaximal/Lattice/Constants.lean index 69ec459b93..bf763775e9 100644 --- a/LeanPool/CenteredMaximal/Lattice/Constants.lean +++ b/LeanPool/CenteredMaximal/Lattice/Constants.lean @@ -26,7 +26,7 @@ four open slots, each of width `slotW` and height `slotH`, and All numerical facts are proved from rational enclosures of `√2` and `√22`. -/ -@[expose] public section +public section noncomputable section @@ -54,10 +54,10 @@ def sideLH2 : ℝ := √2 * root def sideLHL2 : ℝ := √(2 * (2 + heavy)) /-- Width of a slot excluded from the witnessed region: `2h - √(2(2 + w))/2 - u/2`. -/ -def slotW : ℝ := 2 * hgap - sideLHL2 / 2 - root / 2 +@[expose] def slotW : ℝ := 2 * hgap - sideLHL2 / 2 - root / 2 /-- Height of a slot excluded from the witnessed region: `V - √(2(1 + w))/2 - √w/2`. -/ -def slotH : ℝ := vgap - sideLH2 / 2 - sideH1 / 2 +@[expose] def slotH : ℝ := vgap - sideLH2 / 2 - sideH1 / 2 /-! ### Square roots -/ @@ -93,7 +93,7 @@ theorem one_add_heavy : 1 + heavy = root ^ 2 := by ring /-- `V = h + 1`. -/ -theorem vgap_eq : vgap = hgap + 1 := rfl +theorem vgap_eq : vgap = hgap + 1 := by rfl /-- `w = (17 + 4√22)/9`. -/ theorem heavy_eq : heavy = (17 + 4 * √22) / 9 := by diff --git a/LeanPool/CenteredMaximal/Lattice/LowerBound.lean b/LeanPool/CenteredMaximal/Lattice/LowerBound.lean index c079d6573f..b2451d8c90 100644 --- a/LeanPool/CenteredMaximal/Lattice/LowerBound.lean +++ b/LeanPool/CenteredMaximal/Lattice/LowerBound.lean @@ -18,7 +18,7 @@ using atoms of the neighbouring cells (`exists_isWitness_of_abs`). The `(2N + 1) `C` therefore satisfies `C ≥ ((2N + 1)/(2N + 3))³ Φ`, and `N → ∞` gives `C ≥ Φ`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CenteredMaximal/Lattice/Smear.lean b/LeanPool/CenteredMaximal/Lattice/Smear.lean index e25d91444b..9b0d4b6d68 100644 --- a/LeanPool/CenteredMaximal/Lattice/Smear.lean +++ b/LeanPool/CenteredMaximal/Lattice/Smear.lean @@ -23,7 +23,7 @@ least `L² / (L + ε)² ≥ (1 + ε)⁻² > 1 - 2ε` (`lt_maximalFunction_smeare Aldaz (2000, Lemma 1.1), adapted to weighted atoms. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ namespace LeanPool.CenteredMaximal.Lattice def atom (p : ℤ × ℤ) : Fin 2 → ℝ := ![p.1 * hgap, p.2 * vgap] /-- The atoms kept at scale `N`: columns `-2N-2, …, 2N+2` and rows `-N-1, …, N+1`. -/ -def atomBox (N : ℕ) : Finset (ℤ × ℤ) := +@[expose] def atomBox (N : ℕ) : Finset (ℤ × ℤ) := Icc (-2 * (N : ℤ) - 2) (2 * N + 2) ×ˢ Icc (-(N : ℤ) - 1) (N + 1) /-- The truncated lattice with each atom smeared over the closed square of side `ε`. -/ diff --git a/LeanPool/CenteredMaximal/Lattice/Witness.lean b/LeanPool/CenteredMaximal/Lattice/Witness.lean index 331295d887..2a636198d2 100644 --- a/LeanPool/CenteredMaximal/Lattice/Witness.lean +++ b/LeanPool/CenteredMaximal/Lattice/Witness.lean @@ -23,7 +23,7 @@ Six explicit witnesses cover the quarter cell `[0, hgap] × [0, vgap/2]` except `(2 hgap, vgap)` preserve the atom masses, so they transport witnesses to the whole plane. -/ -@[expose] public section +public section noncomputable section @@ -32,23 +32,23 @@ open Finset namespace LeanPool.CenteredMaximal.Lattice /-- The mass of an atom in column `c`: `1` if `c` is even, `heavy` if `c` is odd. -/ -def colWeight (c : ℤ) : ℝ := if Even c then 1 else heavy +@[expose] def colWeight (c : ℤ) : ℝ := if Even c then 1 else heavy /-- `(L, A)` witnesses level one at `(x, y)`: `L ≥ 1`, the atoms of `A` have total mass at least `L²`, and every atom of `A` lies in the closed square of side `L` centred at `(x, y)`. -/ -def IsWitness (x y L : ℝ) (A : Finset (ℤ × ℤ)) : Prop := +@[expose] def IsWitness (x y L : ℝ) (A : Finset (ℤ × ℤ)) : Prop := 1 ≤ L ∧ L ^ 2 ≤ ∑ p ∈ A, colWeight p.1 ∧ ∀ p ∈ A, |p.1 * hgap - x| ≤ L / 2 ∧ |p.2 * vgap - y| ≤ L / 2 /-- The atoms that a witness for a point of the period cell with index `(k, l)` may use. -/ -def nearBox (k l : ℤ) : Finset (ℤ × ℤ) := +@[expose] def nearBox (k l : ℤ) : Finset (ℤ × ℤ) := Icc (2 * k - 2) (2 * k + 2) ×ˢ Icc (l - 1) (l + 1) /-- Reflection of atom indices in the vertical axis. -/ -def negFst : ℤ × ℤ ≃ ℤ × ℤ := (Equiv.neg ℤ).prodCongr (Equiv.refl ℤ) +@[expose] def negFst : ℤ × ℤ ≃ ℤ × ℤ := (Equiv.neg ℤ).prodCongr (Equiv.refl ℤ) /-- Reflection of atom indices in the horizontal axis. -/ -def negSnd : ℤ × ℤ ≃ ℤ × ℤ := (Equiv.refl ℤ).prodCongr (Equiv.neg ℤ) +@[expose] def negSnd : ℤ × ℤ ≃ ℤ × ℤ := (Equiv.refl ℤ).prodCongr (Equiv.neg ℤ) /-- `negFst` negates the first coordinate. -/ @[simp] theorem coe_negFst : ⇑negFst = fun p ↦ (-p.1, p.2) := rfl diff --git a/LeanPool/CenteredMaximal/Numerics.lean b/LeanPool/CenteredMaximal/Numerics.lean index f560292ce2..b0876c18e8 100644 --- a/LeanPool/CenteredMaximal/Numerics.lean +++ b/LeanPool/CenteredMaximal/Numerics.lean @@ -14,7 +14,7 @@ public import LeanPool.CenteredMaximal.Statement `√(17 + 4√22)`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CenteredMaximal/Statement.lean b/LeanPool/CenteredMaximal/Statement.lean index 149a5a9063..dda535276e 100644 --- a/LeanPool/CenteredMaximal/Statement.lean +++ b/LeanPool/CenteredMaximal/Statement.lean @@ -16,7 +16,7 @@ The maximal operator is defined on real-valued integrable functions using Lebesg These definitions agree with the independently stated upstream comparator challenge. -/ -@[expose] public section +public section noncomputable section @@ -30,18 +30,18 @@ namespace LeanPool.CenteredMaximal Since `Fin d → ℝ` carries the sup norm, `closedBall x r` is the closed cube `∏ᵢ [xᵢ - r, xᵢ + r]` of side length `2r` centred at `x`; `volume` is Lebesgue measure. -/ -def maximalFunction {d : ℕ} (f : (Fin d → ℝ) → ℝ) (x : Fin d → ℝ) : ℝ≥0∞ := +@[expose] def maximalFunction {d : ℕ} (f : (Fin d → ℝ) → ℝ) (x : Fin d → ℝ) : ℝ≥0∞ := ⨆ (r : ℝ) (_ : 0 < r), (volume (closedBall x r))⁻¹ * ∫⁻ y in closedBall x r, ‖f y‖ₑ /-- `C` is a weak type `(1, 1)` bound for the centred maximal operator in dimension `d`: for every integrable `f : ℝᵈ → ℝ` and every level `α ∈ [0, ∞]`, `α · |{x : M f (x) > α}| ≤ C · ‖f‖₁`. -/ -def IsWeakTypeBound (d : ℕ) (C : ℝ≥0∞) : Prop := +@[expose] def IsWeakTypeBound (d : ℕ) (C : ℝ≥0∞) : Prop := ∀ f : (Fin d → ℝ) → ℝ, Integrable f → ∀ α : ℝ≥0∞, α * volume {x | α < maximalFunction f x} ≤ C * ∫⁻ x, ‖f x‖ₑ /-- The weak type `(1, 1)` constant `c_d` of the centred Hardy–Littlewood maximal operator over axis-parallel cubes in `ℝᵈ`: the least weak type bound. -/ -def weakTypeConstant (d : ℕ) : ℝ≥0∞ := +@[expose] def weakTypeConstant (d : ℕ) : ℝ≥0∞ := sInf {C | IsWeakTypeBound d C} /-- The constant `Φ = 1.68550999335552518…`, an explicit radical expression: @@ -51,7 +51,7 @@ def weakTypeConstant (d : ℕ) : ℝ≥0∞ := It bounds the covered area per unit mass of a periodic measure from below: unit masses and masses `w = (17 + 4√22)/9` alternate along the columns `x = i h`, `h = (5 + √22)/6`, and the rows are `y = j V`, `V = (11 + √22)/6`. -/ -def phi : ℝ := +@[expose] def phi : ℝ := ((77 + 16 * √22) / 2 - (8 + √22 - √(70 + 8 * √22)) * (11 + √22 - 2 * √2 - 2 * √11 - √(17 + 4 * √22))) / (26 + 4 * √22) diff --git a/LeanPool/CenteredMaximal/UpperBound.lean b/LeanPool/CenteredMaximal/UpperBound.lean index 037f91b8d1..dcc3959a78 100644 --- a/LeanPool/CenteredMaximal/UpperBound.lean +++ b/LeanPool/CenteredMaximal/UpperBound.lean @@ -20,7 +20,7 @@ the factor `3ᵈ` of the uncentred argument. Summing over the disjoint selected hint notes that one needs an epsilon of room). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Champernowne/Asymptotics.lean b/LeanPool/Champernowne/Asymptotics.lean index 47988a1111..1ab9c1bc05 100644 --- a/LeanPool/Champernowne/Asymptotics.lean +++ b/LeanPool/Champernowne/Asymptotics.lean @@ -17,7 +17,7 @@ The natural-number prefix bounds give an error that is little-o of `n`, and therefore the frequency of each nonempty length-`k` word tends to `b⁻ᵏ`. -/ -@[expose] public section +public section namespace Champernowne diff --git a/LeanPool/Champernowne/Count.lean b/LeanPool/Champernowne/Count.lean index 35c1c770be..4615a9bd8a 100644 --- a/LeanPool/Champernowne/Count.lean +++ b/LeanPool/Champernowne/Count.lean @@ -22,7 +22,7 @@ The window convention is documented at `countOccurrences`. Statements assume and exact digit-counting results are in `LeanPool.Champernowne.CountExtras`. -/ -@[expose] public section +public section namespace Champernowne diff --git a/LeanPool/Champernowne/CountExtras.lean b/LeanPool/Champernowne/CountExtras.lean index 2b745beb75..8ddae8fe28 100644 --- a/LeanPool/Champernowne/CountExtras.lean +++ b/LeanPool/Champernowne/CountExtras.lean @@ -21,7 +21,7 @@ These results are exported by the project entry module as reusable infrastructur The normality proof itself needs only the lower bounds in `DigitCount`. -/ -@[expose] public section +public section namespace Champernowne diff --git a/LeanPool/Champernowne/Defs.lean b/LeanPool/Champernowne/Defs.lean index a1487606e6..cf05eafece 100644 --- a/LeanPool/Champernowne/Defs.lean +++ b/LeanPool/Champernowne/Defs.lean @@ -21,15 +21,15 @@ Definitions allow every base; hypotheses `1 < b` appear on the results that need them. The prefix-coherence API is in `LeanPool.Champernowne.Prefix`. -/ -@[expose] public section +public section namespace Champernowne /-- Big-endian digits of `n` in base `b`. -/ -def bigDigits (b n : ℕ) : List ℕ := (Nat.digits b n).reverse +@[expose] def bigDigits (b n : ℕ) : List ℕ := (Nat.digits b n).reverse /-- First `N` blocks of the base-`b` Champernowne sequence: digits of 1..N. -/ -def champBlocks (b N : ℕ) : List ℕ := +@[expose] def champBlocks (b N : ℕ) : List ℕ := ((List.range N).map fun n => bigDigits b (n + 1)).flatten theorem champBlocks_succ (b N : ℕ) : @@ -48,7 +48,7 @@ theorem le_length_champBlocks (b N : ℕ) : N ≤ (champBlocks b N).length := by omega /-- The `i`-th digit (0-indexed) of the base-`b` Champernowne sequence. -/ -def champDigit (b i : ℕ) : ℕ := +@[expose] def champDigit (b i : ℕ) : ℕ := (champBlocks b (i + 1))[i]'(lt_of_lt_of_le (Nat.lt_succ_self i) (le_length_champBlocks b (i + 1))) @@ -61,12 +61,12 @@ positions `0 … l.length - w.length`; there are no partial windows at the end of the list. In particular `countOccurrences w l = 0` whenever `w.length > l.length`, and `countOccurrences [] l = l.length + 1` (the empty word is a prefix of every tail) — callers always pass `w ≠ []`. -/ -def countOccurrences (w l : List ℕ) : ℕ := +@[expose] def countOccurrences (w l : List ℕ) : ℕ := l.tails.countP (w.isPrefixOf ·) /-- Normality of a digit sequence in base `b`: every block of length `k` (entries `< b`, leading zeros allowed) has asymptotic frequency `b⁻ᵏ`. -/ -def IsNormalSequence (b : ℕ) (s : ℕ → ℕ) : Prop := +@[expose] def IsNormalSequence (b : ℕ) (s : ℕ → ℕ) : Prop := ∀ w : List ℕ, w ≠ [] → (∀ d ∈ w, d < b) → Filter.Tendsto (fun n => (countOccurrences w ((List.range n).map s) : ℝ) / n) diff --git a/LeanPool/Champernowne/DigitCount.lean b/LeanPool/Champernowne/DigitCount.lean index 85d9eaf189..d0b4c133c7 100644 --- a/LeanPool/Champernowne/DigitCount.lean +++ b/LeanPool/Champernowne/DigitCount.lean @@ -29,7 +29,7 @@ cohort sums, `digitEquiv` and its round-trips) live in `CountExtras.lean`. -/ -@[expose] public section +public section namespace Champernowne diff --git a/LeanPool/Champernowne/Main.lean b/LeanPool/Champernowne/Main.lean index 90737bd0d0..9f630a64c0 100644 --- a/LeanPool/Champernowne/Main.lean +++ b/LeanPool/Champernowne/Main.lean @@ -13,7 +13,7 @@ public import LeanPool.Champernowne.Asymptotics The base-`b` Champernowne sequence is normal in base `b`. -/ -@[expose] public section +public section namespace Champernowne diff --git a/LeanPool/Champernowne/Positions.lean b/LeanPool/Champernowne/Positions.lean index fc305876ea..6718f9b25c 100644 --- a/LeanPool/Champernowne/Positions.lean +++ b/LeanPool/Champernowne/Positions.lean @@ -21,12 +21,12 @@ two-sided comparison between `b^k · countOccurrences w (champPrefix b n)` and `n` with error `O(k)·b^(2k)·b^M`. -/ -@[expose] public section +public section namespace Champernowne /-- Greatest `N` with `(champBlocks b N).length ≤ n`. -/ -def champIndex (b n : ℕ) : ℕ := +@[expose] def champIndex (b n : ℕ) : ℕ := Nat.findGreatest (fun N => (champBlocks b N).length ≤ n) n theorem length_champBlocks_champIndex_le (b n : ℕ) : diff --git a/LeanPool/Champernowne/Prefix.lean b/LeanPool/Champernowne/Prefix.lean index b5f9f49acc..b0e58cc68a 100644 --- a/LeanPool/Champernowne/Prefix.lean +++ b/LeanPool/Champernowne/Prefix.lean @@ -20,7 +20,7 @@ long block computes the same digit as `champDigit`, and `champPrefix` (see `Defs.lean`). -/ -@[expose] public section +public section namespace Champernowne @@ -40,7 +40,7 @@ theorem champBlocks_getElem (b N i : ℕ) (h : i < (champBlocks b N).length) : (le_length_champBlocks b (i + 1)))).symm /-- The first `n` digits of the base-`b` Champernowne sequence. -/ -def champPrefix (b n : ℕ) : List ℕ := (champBlocks b n).take n +@[expose] def champPrefix (b n : ℕ) : List ℕ := (champBlocks b n).take n theorem length_champPrefix (b n : ℕ) : (champPrefix b n).length = n := by rw [champPrefix, List.length_take] diff --git a/LeanPool/ChannelCapacity.lean b/LeanPool/ChannelCapacity.lean index 934ab1a01d..18dd3e9f2c 100644 --- a/LeanPool/ChannelCapacity.lean +++ b/LeanPool/ChannelCapacity.lean @@ -27,4 +27,4 @@ Tags: information-theory, channel-capacity, mutual-information, kullback-leibler MSC: 94A17, 94A15, 60A10 -/ -@[expose] public section +public section diff --git a/LeanPool/ChannelCapacity/Basic.lean b/LeanPool/ChannelCapacity/Basic.lean index ba61f9fb15..990d5d7e6c 100644 --- a/LeanPool/ChannelCapacity/Basic.lean +++ b/LeanPool/ChannelCapacity/Basic.lean @@ -31,7 +31,7 @@ measures, so this file provides the subtype-level wrapper needed by the strict-c uniqueness arguments. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -45,7 +45,7 @@ variable {Ω : Type*} [MeasurableSpace Ω] This is a subtype-level wrapper around convex combinations of measures. It exists because Mathlib does not currently provide an affine-space structure on `ProbabilityMeasure Ω`. -/ -noncomputable def convexCombination (μ ν : ProbabilityMeasure Ω) (t : NNReal) +@[expose] noncomputable def convexCombination (μ ν : ProbabilityMeasure Ω) (t : NNReal) (ht : t ≤ (1 : NNReal)) : ProbabilityMeasure Ω := ⟨t • μ.toMeasure + ((1 : NNReal) - t) • ν.toMeasure, by @@ -84,6 +84,7 @@ namespace ChannelCapacity variable {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] /-- The output prior induced by pushing a prior through a Markov kernel. -/ +@[expose] noncomputable def outputPrior (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityMeasure α) : ProbabilityMeasure β := ⟨k ∘ₘ p.toMeasure, by infer_instance⟩ @@ -94,7 +95,8 @@ lemma outputPrior_toMeasure (k : Kernel α β) [IsMarkovKernel k] (p : Probabili rfl /-- The joint law `p ⊗ k` on `α × β`. -/ -noncomputable def jointLaw (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityMeasure α) : +@[expose] noncomputable def jointLaw + (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityMeasure α) : ProbabilityMeasure (α × β) := ⟨p.toMeasure ⊗ₘ k, by infer_instance⟩ @@ -104,7 +106,7 @@ lemma jointLaw_toMeasure (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityM rfl /-- The independent coupling with the same input prior and induced output prior. -/ -noncomputable def independentJointLaw (k : Kernel α β) [IsMarkovKernel k] +@[expose] noncomputable def independentJointLaw (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityMeasure α) : ProbabilityMeasure (α × β) := let q := outputPrior k p ⟨p.toMeasure ⊗ₘ Kernel.const α q.toMeasure, by infer_instance⟩ @@ -117,7 +119,7 @@ lemma independentJointLaw_toMeasure (k : Kernel α β) [IsMarkovKernel k] rfl /-- Shannon mutual information between an input prior and a Markov kernel. -/ -noncomputable def mutualInformation (p : ProbabilityMeasure α) (k : Kernel α β) +@[expose] noncomputable def mutualInformation (p : ProbabilityMeasure α) (k : Kernel α β) [IsMarkovKernel k] : ℝ := (InformationTheory.klDiv (jointLaw k p).toMeasure (independentJointLaw k p).toMeasure).toReal diff --git a/LeanPool/ChannelCapacity/Capacity.lean b/LeanPool/ChannelCapacity/Capacity.lean index 671db6a4f8..30e205b6fe 100644 --- a/LeanPool/ChannelCapacity/Capacity.lean +++ b/LeanPool/ChannelCapacity/Capacity.lean @@ -14,7 +14,7 @@ import LeanPool.ChannelCapacity.StrictConcavity Capacity and generic existence/uniqueness packaging for maximizing mutual information. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/ChannelCapacity/ChainRule.lean b/LeanPool/ChannelCapacity/ChainRule.lean index fed44823c1..564aa36f57 100644 --- a/LeanPool/ChannelCapacity/ChainRule.lean +++ b/LeanPool/ChannelCapacity/ChainRule.lean @@ -21,7 +21,7 @@ The main theorem rewrites the KL divergence from the joint law `p ⊗ k` to the against `ν`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal diff --git a/LeanPool/ChannelCapacity/Counterexample.lean b/LeanPool/ChannelCapacity/Counterexample.lean index f4cf9bd937..3716fa9e6a 100644 --- a/LeanPool/ChannelCapacity/Counterexample.lean +++ b/LeanPool/ChannelCapacity/Counterexample.lean @@ -14,7 +14,7 @@ public import LeanPool.ChannelCapacity.NonDegeneracy A finite counterexample showing that row separation does not imply injective prior pushforward. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/ChannelCapacity/Discharged.lean b/LeanPool/ChannelCapacity/Discharged.lean index d8ddd49ffb..994b16c1b4 100644 --- a/LeanPool/ChannelCapacity/Discharged.lean +++ b/LeanPool/ChannelCapacity/Discharged.lean @@ -34,7 +34,7 @@ channel with counting-measure reference, an explicit `ContinuousPositiveDensity` concrete application of `exists_unique_capacity_achieving_prior_discharged`. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/ChannelCapacity/DischargedExample.lean b/LeanPool/ChannelCapacity/DischargedExample.lean index 331816971f..a1d1e9f088 100644 --- a/LeanPool/ChannelCapacity/DischargedExample.lean +++ b/LeanPool/ChannelCapacity/DischargedExample.lean @@ -20,7 +20,7 @@ reference, instantiates `Kernel.ContinuousPositiveDensity`, and applies `exists_unique_capacity_achieving_prior_discharged`. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/ChannelCapacity/Finite.lean b/LeanPool/ChannelCapacity/Finite.lean index 1750418974..23d99fc16f 100644 --- a/LeanPool/ChannelCapacity/Finite.lean +++ b/LeanPool/ChannelCapacity/Finite.lean @@ -23,7 +23,7 @@ concavity can be proved internally without passing abstract topology or semicont through the public theorem statement. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -45,7 +45,7 @@ end ProbabilityMeasure namespace Kernel /-- A concrete finite non-degeneracy condition: the row matrix has trivial kernel over `ℝ`. -/ -def RowMatrixFullRank (k : Kernel α β) : Prop := +@[expose] def RowMatrixFullRank (k : Kernel α β) : Prop := Function.Injective fun w : α → ℝ => fun b => ∑ a, w a * (k a {b}).toReal diff --git a/LeanPool/ChannelCapacity/KernelCompositionKullbackLeibler.lean b/LeanPool/ChannelCapacity/KernelCompositionKullbackLeibler.lean index b793696093..5a8e965276 100644 --- a/LeanPool/ChannelCapacity/KernelCompositionKullbackLeibler.lean +++ b/LeanPool/ChannelCapacity/KernelCompositionKullbackLeibler.lean @@ -38,7 +38,7 @@ infrastructure in Mathlib, where the mixed-left-measure and additive chain-rule already available. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ENNReal diff --git a/LeanPool/ChannelCapacity/NonDegeneracy.lean b/LeanPool/ChannelCapacity/NonDegeneracy.lean index 53cfcc9f5e..002b97a5cc 100644 --- a/LeanPool/ChannelCapacity/NonDegeneracy.lean +++ b/LeanPool/ChannelCapacity/NonDegeneracy.lean @@ -19,7 +19,7 @@ Correct non-degeneracy conditions for uniqueness in the prior variable. - `Kernel.RowSeparating` -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory @@ -32,21 +32,21 @@ variable {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] namespace Kernel /-- The output prior map `p ↦ Σ_x p(x) k(x, ·)`. -/ -noncomputable def priorPushforward (k : Kernel α β) [IsMarkovKernel k] +@[expose] noncomputable def priorPushforward (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityMeasure α) : ProbabilityMeasure β := outputPrior k p /-- Pairwise-distinct rows of a kernel. This is weaker than injective prior pushforward. -/ -def RowSeparating (k : Kernel α β) : Prop := +@[expose] def RowSeparating (k : Kernel α β) : Prop := ∀ ⦃a a' : α⦄, a ≠ a' → k a ≠ k a' /-- The correct non-degeneracy hypothesis for uniqueness in the prior variable. -/ -def InjectivePriorPushforward (k : Kernel α β) [IsMarkovKernel k] : Prop := +@[expose] def InjectivePriorPushforward (k : Kernel α β) [IsMarkovKernel k] : Prop := Function.Injective (priorPushforward k) /-- Reference measures needed by the strict-concavity proof: output marginals of priors that dominate the given prior. -/ -def OutputMarginalReference (k : Kernel α β) [IsMarkovKernel k] +@[expose] def OutputMarginalReference (k : Kernel α β) [IsMarkovKernel k] (p : ProbabilityMeasure α) (ν : Measure β) : Prop := ∃ q : ProbabilityMeasure α, p.toMeasure ≪ q.toMeasure ∧ ν = (outputPrior k q).toMeasure diff --git a/LeanPool/ChannelCapacity/StrictConcavity.lean b/LeanPool/ChannelCapacity/StrictConcavity.lean index 8bdb0b9ea5..4ba0c80fb0 100644 --- a/LeanPool/ChannelCapacity/StrictConcavity.lean +++ b/LeanPool/ChannelCapacity/StrictConcavity.lean @@ -19,7 +19,7 @@ strict concavity is phrased directly in terms of the explicit operation `ProbabilityMeasure.convexCombination`. -/ -@[expose] public section +public section open MeasureTheory open ProbabilityTheory diff --git a/LeanPool/ChipFiring.lean b/LeanPool/ChipFiring.lean index 3d53d9fde7..0fd445dcaf 100644 --- a/LeanPool/ChipFiring.lean +++ b/LeanPool/ChipFiring.lean @@ -29,4 +29,4 @@ Tags: combinatorics MSC: 05C57, 14T20 -/ -@[expose] public section +public section diff --git a/LeanPool/ChipFiring/ChipFiringWithLean.lean b/LeanPool/ChipFiring/ChipFiringWithLean.lean index 92be5d9004..291901aac8 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean.lean @@ -23,4 +23,4 @@ public import LeanPool.ChipFiring.ChipFiringWithLean.RiemannRoch Chip firing, graph divisors, and their combinatorial properties. -/ -@[expose] public section +public section diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/Algorithms.lean b/LeanPool/ChipFiring/ChipFiringWithLean/Algorithms.lean index e6f0b7b125..f64e5c323f 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/Algorithms.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/Algorithms.lean @@ -21,7 +21,7 @@ In particular, the core mathematical statements about $q$-reduced divisors, supe and Dhar's algorithm are proved elsewhere in the library. -/ -@[expose] public section +public section namespace ChipFiring diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/Basic.lean b/LeanPool/ChipFiring/ChipFiringWithLean/Basic.lean index bfde63b6f9..31844adbce 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/Basic.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/Basic.lean @@ -27,7 +27,7 @@ Many main theorems in this library require connectivity; see `graphConnected`. I proof of connectivity must be provided as an additional argument. -/ -@[expose] public section +public section namespace ChipFiring @@ -58,7 +58,7 @@ attribute [instance] CFGraph.instDecidableEq CFGraph.instFintype CFGraph.instNon When working with chip-firing graphs in this repository, prefer this function to the underlying multiset of edges. -/ -def numEdges (G : CFGraph) (v w : G.V) : ℕ := +@[expose] def numEdges (G : CFGraph) (v w : G.V) : ℕ := Multiset.card (G.edges.filter (fun e => e = (v, w) ∨ e = (w, v))) /-- A graph is *connected* if its vertices cannot be partitioned into two nonempty sets @@ -71,7 +71,7 @@ def graphConnected (G : CFGraph) : Prop := (∃ v ∈ S, ∃ w ∉ S, numEdges G v w > 0) /-- The genus of a graph is its cyclomatic number, $|E| - |V| + 1$. -/ -def genus (G : CFGraph) : ℤ := +@[expose] def genus (G : CFGraph) : ℤ := Multiset.card G.edges - Fintype.card G.V + 1 /-- The number of edges between two vertices is symmetric (the graph is undirected). -/ @@ -91,7 +91,7 @@ lemma num_edges_symmetric (G : CFGraph) (v w : G.V) : exact G.loopless v h_inE /-- The degree, or valence, of a vertex as an integer. -/ -def vertexDegree (G : CFGraph) (v : G.V) : ℤ := +@[expose] def vertexDegree (G : CFGraph) (v : G.V) : ℤ := ∑ u : G.V, (numEdges G v u : ℤ) /-! @@ -118,7 +118,7 @@ See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.3. -/ abbrev CFDiv (G : CFGraph) := G.V → ℤ /-- The divisor with one chip at a specified vertex $v_{\mathrm{chip}}$ and zero chips elsewhere. -/ -def oneChip {G : CFGraph} (v_chip : G.V) : CFDiv G := +@[expose] def oneChip {G : CFGraph} (v_chip : G.V) : CFDiv G := fun v => if v = v_chip then 1 else 0 -- Canonical simplifications for evaluations of oneChip. @@ -139,17 +139,17 @@ def oneChip {G : CFGraph} (v_chip : G.V) : CFDiv G := /-- The result of firing a vertex $v$, starting from the divisor $D$. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.5. -/ -def firingMove (G : CFGraph) (D : CFDiv G) (v : G.V) : CFDiv G := +@[expose] def firingMove (G : CFGraph) (D : CFDiv G) (v : G.V) : CFDiv G := fun w => if w = v then D v - vertexDegree G v else D w + numEdges G v w /-- The result of borrowing at a vertex $v$, starting from a divisor $D$. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.5. -/ -def borrowingMove (G : CFGraph) (D : CFDiv G) (v : G.V) : CFDiv G := +@[expose] def borrowingMove (G : CFGraph) (D : CFDiv G) (v : G.V) : CFDiv G := fun w => if w = v then D v + vertexDegree G v else D w - numEdges G v w /-- The out-degree of `v` relative to `S`, counted with edge multiplicity. -/ -def outdegS (G : CFGraph) (S : Finset G.V) (v : G.V) : ℤ := +@[expose] def outdegS (G : CFGraph) (S : Finset G.V) (v : G.V) : ℤ := ∑ w ∈ (univ \ S), (numEdges G v w : ℤ) @[simp] theorem outdeg_S_eq_sum_filter (G : CFGraph) (S : Finset G.V) (v : G.V) : @@ -173,7 +173,7 @@ theorem outdeg_S_antitone (G : CFGraph) {S T : Finset G.V} (h : S ⊆ T) (v : G. /-- The result of firing a set $S$ of vertices, starting from a divisor $D$. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.6. -/ -def setFiring (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : CFDiv G := +@[expose] def setFiring (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : CFDiv G := fun w => if w ∈ S then D w - outdegS G S w else D w + outdegS G Sᶜ w theorem set_firing_apply_of_mem (G : CFGraph) (D : CFDiv G) {S : Finset G.V} @@ -221,7 +221,7 @@ def principalDivisors (G : CFGraph) : AddSubgroup (CFDiv G) := /-- Two divisors are *linearly equivalent* if their difference is a principal divisor. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.8. -/ -def linearEquiv (G : CFGraph) (D D' : CFDiv G) : Prop := +@[expose] def linearEquiv (G : CFGraph) (D D' : CFDiv G) : Prop := D' - D ∈ principalDivisors G /-- Principal divisors contain the firing vector at a vertex. -/ @@ -289,7 +289,7 @@ def prin (G : CFGraph) : firingScript G →+ CFDiv G := } @[simp] theorem prin_apply (G : CFGraph) (σ : firingScript G) (v : G.V) : - prin G σ v = ∑ u : G.V, (σ u - σ v) * (numEdges G v u : ℤ) := rfl + prin G σ v = ∑ u : G.V, (σ u - σ v) * (numEdges G v u : ℤ) := by rfl /-- Constant firing scripts have zero principal divisor. -/ @[simp] theorem prin_const (G : CFGraph) (c : ℤ) : @@ -424,12 +424,12 @@ Equivalently, the players can collectively win the dollar game starting from pos Equivalently, it is at least $0$. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.13. -/ -def effective {G : CFGraph} (D : CFDiv G) : Prop := +@[expose] def effective {G : CFGraph} (D : CFDiv G) : Prop := ∀ v : G.V, D v ≥ 0 /-- The submonoid of effective divisors is denoted `Eff G`. -/ -def Eff (G : CFGraph) : AddSubmonoid (CFDiv G) := +@[expose] def Eff (G : CFGraph) : AddSubmonoid (CFDiv G) := { carrier := {D : CFDiv G | effective D}, zero_mem' := by simp only [effective, ge_iff_le, Set.mem_ofPred_eq, Pi.zero_apply, Std.le_refl, implies_true] @@ -452,7 +452,7 @@ lemma sub_eff_iff_geq {G : CFGraph} (D₁ D₂ : CFDiv G) : effective (D₁ - D /-- A divisor is winnable if it is linearly equivalent to an effective divisor. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.14. -/ -def winnable (G : CFGraph) (D : CFDiv G) : Prop := +@[expose] def winnable (G : CFGraph) (D : CFDiv G) : Prop := ∃ D' ∈ Eff G, linearEquiv G D D' @@ -471,7 +471,7 @@ Applying the Laplacian to a firing script produces the corresponding principal d /-- The degree of a divisor is the sum of its values over all vertices. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 1.4. -/ -def deg {G : CFGraph} : CFDiv G →+ ℤ := { +@[expose] def deg {G : CFGraph} : CFDiv G →+ ℤ := { toFun := fun D => ∑ v, D v, map_zero' := by simp only [Pi.zero_apply, sum_const_zero], @@ -643,7 +643,7 @@ open Matrix /-- The Laplacian matrix of a CFGraph. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 2.6. -/ -def laplacianMatrix (G : CFGraph) : Matrix G.V G.V ℤ := +@[expose] def laplacianMatrix (G : CFGraph) : Matrix G.V G.V ℤ := fun i j => if i = j then vertexDegree G i else - (numEdges G i j) -- Note: The Laplacian matrix L is given by Deg(G) - A, where Deg(G) is the diagonal @@ -652,7 +652,7 @@ def laplacianMatrix (G : CFGraph) : Matrix G.V G.V ℤ := /-- Applies the Laplacian matrix to a firing script and a current divisor to obtain a new divisor. -/ -def applyLaplacian (G : CFGraph) (σ : firingScript G) (D : CFDiv G) : CFDiv G := +@[expose] def applyLaplacian (G : CFGraph) (σ : firingScript G) (D : CFDiv G) : CFDiv G := fun v => (D v) - (laplacianMatrix G).mulVec σ v /-! @@ -670,7 +670,7 @@ debt concentrated on $S$ via firing moves. /-- A divisor is *$q$-effective* if it has a nonnegative number of chips at every vertex except possibly $q$. -/ -def qEffective {G : CFGraph} (q : G.V) (D : CFDiv G) : Prop := +@[expose] def qEffective {G : CFGraph} (q : G.V) (D : CFDiv G) : Prop := ∀ v : G.V, v ≠ q → D v ≥ 0 /-- A divisor bundled with a proof that it is $q$-effective. -/ @@ -1025,7 +1025,7 @@ at active vertices — strictly decreases at each reduction step. /-- A set of vertices is legal for `D` if firing it leaves every vertex in the set nonnegative. -/ -def legalSet (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : Prop := +@[expose] def legalSet (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : Prop := ∀ v ∈ S, outdegS G S v ≤ D v instance (G : CFGraph) (D : CFDiv G) (S : Finset G.V) : @@ -1070,7 +1070,7 @@ theorem legal_set_union (G : CFGraph) {D : CFDiv G} {S T : Finset G.V} set of vertices disjoint from $q$ puts some vertex of that set into debt. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 3.4. -/ -def qReduced (G : CFGraph) (q : G.V) (D : CFDiv G) : Prop := +@[expose] def qReduced (G : CFGraph) (q : G.V) (D : CFDiv G) : Prop := qEffective q D ∧ ∀ S : Finset G.V, q ∉ S → S.Nonempty → ¬ legalSet G D S diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/CFGraphExample.lean b/LeanPool/ChipFiring/ChipFiringWithLean/CFGraphExample.lean index 5199b9e58c..367ff52112 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/CFGraphExample.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/CFGraphExample.lean @@ -15,7 +15,7 @@ public import Mathlib.LinearAlgebra.Matrix.Symmetric Chip firing, graph divisors, and their combinatorial properties. -/ -@[expose] public section +public section namespace ChipFiring @@ -57,7 +57,7 @@ def edgesWithLoop : Multiset (Person × Person) := private theorem loopless_test_edges_with_loop : ¬ (∀ v, (v, v) ∉ edgesWithLoop) := by decide /-- Four-vertex loopless multigraph used to test firing and borrowing operations. -/ -def exampleGraph : CFGraph := { +@[expose] def exampleGraph : CFGraph := { V := Person, edges := Multiset.ofList [ (Person.A, Person.B), (Person.B, Person.C), diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/Config.lean b/LeanPool/ChipFiring/ChipFiringWithLean/Config.lean index ea42e1259d..75c714310f 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/Config.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/Config.lean @@ -26,7 +26,7 @@ The quantity `outdegS G S v` counts edges from $v$ to vertices outside $S$, and relevant threshold for the superstability condition. -/ -@[expose] public section +public section namespace ChipFiring @@ -57,7 +57,7 @@ $$ \deg(c) = \sum_{v \in V(G)\setminus\{q\}} c(v). $$ Since $c(q)=0$, this is implemented as the degree of the underlying divisor. -/ -def configDegree {G : CFGraph} {q : G.V} (c : Config G q) : ℤ := +@[expose] def configDegree {G : CFGraph} {q : G.V} (c : Config G q) : ℤ := deg (c.chips) /-- Converts a configuration $c$ to a divisor of prescribed degree $d$ by placing @@ -112,7 +112,7 @@ def toQed {q : G.V} (d : ℤ) (c : Config G q) : qEffDiv G q := exact c.non_negative v } /-- Converts a $q$-effective divisor to a configuration by zeroing out the chip count at $q$. -/ -def toConfig {q : G.V} (D : qEffDiv G q) : Config G q := { +@[expose] def toConfig {q : G.V} (D : qEffDiv G q) : Config G q := { chips := D.D - (D.D q) • (oneChip q) q_zero := by rw [Pi.sub_apply, Pi.smul_apply, smul_eq_mul] @@ -388,7 +388,7 @@ lemma q_reduced_superstable_correspondence (G : CFGraph) (q : G.V) (D : CFDiv G) /-- A maximal superstable configuration is not strictly dominated by any other superstable configuration. -/ -def maximalSuperstable (G : CFGraph) {q : G.V} (c : Config G q) : Prop := +@[expose] def maximalSuperstable (G : CFGraph) {q : G.V} (c : Config G q) : Prop := superstable G q c ∧ ∀ c' : Config G q, superstable G q c' → c ≤ c' → c' = c @@ -615,6 +615,7 @@ lemma superstable_burn_list (G : CFGraph) {q : G.V} (c : Config G q) (h_ss : sup (i.e. assign nonzero flow) if $u$ appears in the list and $v$ appears before $u$. In other words, the orientation indicates the direction of the spreading fire in Dhar's burning algorithm. -/ +@[expose] def burnFlow {G : CFGraph} {q : G.V} {c : Config G q} (L : burnList G c) : (G.V × G.V) → ℕ := fun e => if (e.1 ∈ L.list) ∧ (L.list.idxOf e.2 < L.list.idxOf e.1) then numEdges G e.1 e.2 else 0 diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/Orientation.lean b/LeanPool/ChipFiring/ChipFiringWithLean/Orientation.lean index 01ffc2d0a0..051d98f594 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/Orientation.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/Orientation.lean @@ -34,7 +34,7 @@ The main results are: See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Theorem 4.8. -/ -@[expose] public section +public section namespace ChipFiring @@ -203,7 +203,7 @@ def outdeg (G : CFGraph) (O : CFOrientation G) (v : G.V) : ℕ := Multiset.card (O.directedEdges.filter (fun e => e.fst = v)) /-- A vertex is a source if it has no incoming edges. -/ -def isSource (G : CFGraph) (O : CFOrientation G) (v : G.V) : Prop := +@[expose] def isSource (G : CFGraph) (O : CFOrientation G) (v : G.V) : Prop := indeg G O v = 0 /-- The proposition `directedEdge G O u v` holds when there is a directed edge from $u$ @@ -367,7 +367,7 @@ private lemma is_source_of_unique_source {G : CFGraph} (O : CFOrientation G) {q /-- The proposition `acyclicWithUniqueSource G O q` means that $\mathcal{O}$ is acyclic and every source of $\mathcal{O}$ is equal to $q$. -/ -def acyclicWithUniqueSource (G : CFGraph) (O : CFOrientation G) (q : G.V) : Prop := +@[expose] def acyclicWithUniqueSource (G : CFGraph) (O : CFOrientation G) (q : G.V) : Prop := isAcyclic G O ∧ ∀ w, isSource G O w → w = q /-- In an acyclic orientation with unique source $q$, the vertex $q$ is a source. -/ @@ -412,12 +412,12 @@ See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 4.7. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Definition 4.7, part 1; written $D(\mathcal{O})$ there. -/ -def ordiv (G : CFGraph) (O : CFOrientation G) : CFDiv G := +@[expose] def ordiv (G : CFGraph) (O : CFOrientation G) : CFDiv G := fun v => indeg G O v - 1 /-- The orientation divisor `ordiv G O` bundled as a $q$-effective divisor, using acyclicity to prove $q$-effectivity. -/ -def orqed {G : CFGraph} (O : CFOrientation G) {q : G.V} +@[expose] def orqed {G : CFGraph} (O : CFOrientation G) {q : G.V} (hO : acyclicWithUniqueSource G O q) : qEffDiv G q := { D := ordiv G O, h_eff := by diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/PalomarSolution.lean b/LeanPool/ChipFiring/ChipFiringWithLean/PalomarSolution.lean index 700bed2695..8f217f8dd5 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/PalomarSolution.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/PalomarSolution.lean @@ -14,7 +14,7 @@ public import LeanPool.ChipFiring.ChipFiringWithLean.RiemannRoch Chip firing, graph divisors, and their combinatorial properties. -/ -@[expose] public section +public section namespace ChipFiring diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/RRGHelpers.lean b/LeanPool/ChipFiring/ChipFiringWithLean/RRGHelpers.lean index 33a4732347..af107d52c2 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/RRGHelpers.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/RRGHelpers.lean @@ -23,7 +23,7 @@ maximal unwinnable divisors: - Every maximal unwinnable divisor has degree $g - 1$ (`maximal_unwinnable_deg`). -/ -@[expose] public section +public section namespace ChipFiring diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/Rank.lean b/LeanPool/ChipFiring/ChipFiringWithLean/Rank.lean index e0c5be7c81..586bfefe68 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/Rank.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/Rank.lean @@ -29,7 +29,7 @@ A divisor $D$ is *maximal unwinnable* if it is unwinnable but $D + \delta_v$ is for every vertex $v$. Such divisors arise in the proof of the Riemann-Roch theorem. -/ -@[expose] public section +public section namespace ChipFiring @@ -47,7 +47,7 @@ lemma winnable_equiv_winnable (G : CFGraph) (D1 D2 : CFDiv G) : /-- A divisor is maximal unwinnable if it is unwinnable but adding a chip to any vertex makes it winnable. -/ -def maximalUnwinnable (G : CFGraph) (D : CFDiv G) : Prop := +@[expose] def maximalUnwinnable (G : CFGraph) (D : CFDiv G) : Prop := ¬winnable G D ∧ ∀ v : G.V, winnable G (D + oneChip v) /-- Being maximal unwinnable is preserved under linear equivalence. -/ @@ -80,7 +80,7 @@ private lemma eff_of_degree_nonempty (G : CFGraph) {k : ℤ} (h_nonneg : 0 ≤ k /-- The relation $r(D) \ge k$: the game remains winnable after removing any effective divisor of degree $k$. -/ -def rankGeq (G : CFGraph) (D : CFDiv G) (k : ℤ) : Prop := +@[expose] def rankGeq (G : CFGraph) (D : CFDiv G) (k : ℤ) : Prop := ∀ E ∈ effOfDegree G k, winnable G (D-E) /-- The relation $r(D)=r$: `rankGeq G D r` holds, but `rankGeq G D (r+1)` does not. -/ diff --git a/LeanPool/ChipFiring/ChipFiringWithLean/RiemannRoch.lean b/LeanPool/ChipFiring/ChipFiringWithLean/RiemannRoch.lean index 4c36981376..5d0c7ac446 100644 --- a/LeanPool/ChipFiring/ChipFiringWithLean/RiemannRoch.lean +++ b/LeanPool/ChipFiring/ChipFiringWithLean/RiemannRoch.lean @@ -16,7 +16,7 @@ The Riemann-Roch theorem for graphs and its main corollaries. See: [Corry-Perkinson](https://pubs.ams.org/ebooks/mbk/114), Chapter 5. -/ -@[expose] public section +public section namespace ChipFiring diff --git a/LeanPool/Chudnovsky.lean b/LeanPool/Chudnovsky.lean index fac10fcf58..922f5c3a9b 100644 --- a/LeanPool/Chudnovsky.lean +++ b/LeanPool/Chudnovsky.lean @@ -37,4 +37,4 @@ Tags: number-theory, pi, chudnovsky, modular-forms, complex-multiplication MSC: 11Y60, 11F03, 33C05 -/ -@[expose] public section +public section diff --git a/LeanPool/Chudnovsky/Basic.lean b/LeanPool/Chudnovsky/Basic.lean index d2cdcfe305..36dcaf428e 100644 --- a/LeanPool/Chudnovsky/Basic.lean +++ b/LeanPool/Chudnovsky/Basic.lean @@ -28,7 +28,7 @@ Following the plan in `PLAN.md`, `J` is defined directly in terms of Eisenstein lattice-theoretic description `g₂³/Δ` becomes a lemma (proved in `Fourier.lean`). -/ -@[expose] public section +public section noncomputable section @@ -48,12 +48,12 @@ def Lτ (τ : ℍ) : PeriodPair where simp only [Complex.smul_im, Complex.one_im, smul_zero, coe_im] at h exact τ.im_pos.ne' h.symm -@[simp] lemma Lτ_ω₁ (τ : ℍ) : (Lτ τ).ω₁ = 1 := rfl +@[simp] lemma Lτ_ω₁ (τ : ℍ) : (Lτ τ).ω₁ = 1 := by rfl -@[simp] lemma Lτ_ω₂ (τ : ℍ) : (Lτ τ).ω₂ = τ := rfl +@[simp] lemma Lτ_ω₂ (τ : ℍ) : (Lτ τ).ω₂ = τ := by rfl /-- The nome `q = exp (2πiτ)`, as Mathlib's `Periodic.qParam` with period `1`. -/ -def q (τ : ℍ) : ℂ := Function.Periodic.qParam 1 τ +@[expose] def q (τ : ℍ) : ℂ := Function.Periodic.qParam 1 τ lemma q_eq (τ : ℍ) : q τ = Complex.exp (2 * π * Complex.I * τ) := by simp [q, Function.Periodic.qParam] @@ -68,6 +68,7 @@ lemma norm_q_lt_one (τ : ℍ) : ‖q τ‖ < 1 := by /-- Klein's `J`-invariant, defined via Eisenstein series: `J = E₄³ / (E₄³ - E₆²)`. The classical lattice description `J = g₂³ / Δ` is proved in `Fourier.lean`. -/ +@[expose] def J (τ : ℍ) : ℂ := E₄ τ ^ 3 / (E₄ τ ^ 3 - E₆ τ ^ 2) /-- The denominator of `J` never vanishes: `E₄³ - E₆² = 1728·Δ` and `Δ ≠ 0`. -/ @@ -92,29 +93,29 @@ lemma mul_J_eq (τ : ℍ) : 1728 * J τ = E₄ τ ^ 3 / discriminant τ := by /-- The non-holomorphic (quasi-modular) Eisenstein series `E₂*(τ) = E₂(τ) - 3 / (π · Im τ)`. -/ -def E₂star (τ : ℍ) : ℂ := E2 τ - 3 / (π * τ.im) +@[expose] def E₂star (τ : ℍ) : ℂ := E2 τ - 3 / (π * τ.im) /-- Ramanujan's function `s₂(τ) = (E₄(τ)/E₆(τ)) · E₂*(τ)`. -/ -def s₂ (τ : ℍ) : ℂ := E₄ τ / E₆ τ * E₂star τ +@[expose] def s₂ (τ : ℍ) : ℂ := E₄ τ / E₆ τ * E₂star τ /-- The CM point `τ₁₆₃ = (1 + i√163)/2` of discriminant `-163`. -/ def τ₁₆₃ : ℍ := ⟨⟨1 / 2, Real.sqrt 163 / 2⟩, div_pos (Real.sqrt_pos.mpr (by norm_num)) two_pos⟩ -lemma τ₁₆₃_re : (τ₁₆₃ : ℂ).re = 1 / 2 := rfl +lemma τ₁₆₃_re : (τ₁₆₃ : ℂ).re = 1 / 2 := by rfl -@[simp] lemma τ₁₆₃_im : τ₁₆₃.im = Real.sqrt 163 / 2 := rfl +@[simp] lemma τ₁₆₃_im : τ₁₆₃.im = Real.sqrt 163 / 2 := by rfl /-- The CM point `τ₈ = i√2` of discriminant `-8`, used for the branch-of-square-root argument in the Main Theorem. -/ def τ₈ : ℍ := ⟨⟨0, Real.sqrt 2⟩, Real.sqrt_pos.mpr (by norm_num)⟩ -lemma τ₈_re : (τ₈ : ℂ).re = 0 := rfl +lemma τ₈_re : (τ₈ : ℂ).re = 0 := by rfl -@[simp] lemma τ₈_im : τ₈.im = Real.sqrt 2 := rfl +@[simp] lemma τ₈_im : τ₈.im = Real.sqrt 2 := by rfl /-- All estimates in the paper hold on the region `Im τ > 1.25`. -/ -def Region : Set ℍ := {τ : ℍ | 5 / 4 < τ.im} +@[expose] def Region : Set ℍ := {τ : ℍ | 5 / 4 < τ.im} lemma τ₁₆₃_mem_Region : τ₁₆₃ ∈ Region := by simp only [Region, Set.mem_ofPred_eq, τ₁₆₃_im] diff --git a/LeanPool/Chudnovsky/Chudnovsky.lean b/LeanPool/Chudnovsky/Chudnovsky.lean index b95b28ccb4..e9f74c50ad 100644 --- a/LeanPool/Chudnovsky/Chudnovsky.lean +++ b/LeanPool/Chudnovsky/Chudnovsky.lean @@ -26,7 +26,7 @@ the Phase C inputs (`SingularModuli.lean`) as explicit hypotheses: the paper's p minus the literature citations (Silverman II.6.1, II.4.3(b), Buell, Masser Thm. A1). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/Clausen.lean b/LeanPool/Chudnovsky/Clausen.lean index 6e00c842ae..4e26d0fd7d 100644 --- a/LeanPool/Chudnovsky/Clausen.lean +++ b/LeanPool/Chudnovsky/Clausen.lean @@ -49,7 +49,7 @@ This file covers chapter 6 of Milla's proof of the Chudnovsky formula (arXiv:180 `(₂F₁(1/12, 5/12; 1; z))² = ∑ (6n)!/((3n)!(n!)³) · zⁿ/12^(3n)` (paper Thm. `darst`). -/ -@[expose] public section +public section noncomputable section @@ -937,6 +937,7 @@ namespace Chudnovsky /-! ## The specific instances used in the paper -/ /-- The hypergeometric function `₂F₁(1/12, 5/12; 1; z)` (paper Thms. `darst`, `omegastrich`). -/ +@[expose] def hyp2F1 (z : ℂ) : ℂ := ₂F₁ (1 / 12 : ℂ) (5 / 12) 1 z /-- The generalized hypergeometric function `₃F₂(1/6, 5/6, 1/2; 1, 1; z)`, the right-hand side diff --git a/LeanPool/Chudnovsky/Coefficients.lean b/LeanPool/Chudnovsky/Coefficients.lean index 1ee0329cd4..e54f6892ea 100644 --- a/LeanPool/Chudnovsky/Coefficients.lean +++ b/LeanPool/Chudnovsky/Coefficients.lean @@ -33,7 +33,7 @@ rational is an integer, and an integer within distance `< 1/2` of a certified nu approximation is determined exactly. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/ComplexMult.lean b/LeanPool/Chudnovsky/ComplexMult.lean index 1872df590f..57b826757f 100644 --- a/LeanPool/Chudnovsky/ComplexMult.lean +++ b/LeanPool/Chudnovsky/ComplexMult.lean @@ -31,7 +31,7 @@ At `τ₁₆₃` : `41 − τ + τ² = 0`, i.e. `A = 41, B = −1, C = 1`, `D = `√D = 2τ − 1 = i√163`, `AC = 41` — the specialization used in `Coefficients.lean`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/DivisionValues.lean b/LeanPool/Chudnovsky/DivisionValues.lean index 69302f7362..1cf8156dc3 100644 --- a/LeanPool/Chudnovsky/DivisionValues.lean +++ b/LeanPool/Chudnovsky/DivisionValues.lean @@ -31,7 +31,7 @@ recursion, Baker's factorization `thmbaker` structure lemmas `propindu`, from which the two theorems below follow. -/ -@[expose] public section +public section open scoped Topology @@ -43,7 +43,7 @@ variable (L : PeriodPair) /-- The `m`-division point `(k/m)·ω₁ + (l/m)·ω₂` indexed by `v = (k, l) : Fin m × Fin m`. For `v ≠ 0` these are exactly the points of the paper's `DIV(m)` (Def. `defidivi`). -/ -def divPt (m : ℕ) (v : Fin m × Fin m) : ℂ := +@[expose] def divPt (m : ℕ) (v : Fin m × Fin m) : ℂ := ((v.1 : ℕ) : ℂ) / m * L.ω₁ + ((v.2 : ℕ) : ℂ) / m * L.ω₂ /-- A nonnegative rational `k/m` with `k < m` and integral denominator must be `0`. -/ diff --git a/LeanPool/Chudnovsky/Estimates.lean b/LeanPool/Chudnovsky/Estimates.lean index 1bd3df6e09..9585110f0d 100644 --- a/LeanPool/Chudnovsky/Estimates.lean +++ b/LeanPool/Chudnovsky/Estimates.lean @@ -38,7 +38,7 @@ This file states the explicit estimates and `q`-series approximations of Chapter All estimates hold on `Chudnovsky.Region = {τ | Im τ > 5/4}`. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ them directly. -/ def E₄trunc (τ : ℍ) : ℂ := 1 + 240 * (q τ + 9 * q τ ^ 2) /-- The quadratic truncation `Y := E₆⁽²⁾ = 1 - 504(q + 33q²)` of `E₆` (paper Lemma `lemxy`). -/ -def E₆trunc (τ : ℍ) : ℂ := 1 - 504 * (q τ + 33 * q τ ^ 2) +@[expose] def E₆trunc (τ : ℍ) : ℂ := 1 - 504 * (q τ + 33 * q τ ^ 2) /-- The quadratic truncation `Z := E₂⁽²⁾ - 3/(π·Im τ) = 1 - 24(q + 3q²) - 3/(π·Im τ)` of `E₂*` (paper Lemma `lemxy`). -/ @@ -75,7 +75,7 @@ def Jtilde (τ : ℍ) : ℂ := (1 + 240 * (q τ + 9 * q τ ^ 2)) ^ 3 / (1728 * q τ * (1 - q τ - q τ ^ 2) ^ 24) lemma Jtilde_eq (τ : ℍ) : - Jtilde τ = E₄trunc τ ^ 3 / (1728 * q τ * (1 - q τ - q τ ^ 2) ^ 24) := rfl + Jtilde τ = E₄trunc τ ^ 3 / (1728 * q τ * (1 - q τ - q τ ^ 2) ^ 24) := by rfl /-- `1728·Jtilde` in the normalized form used in the paper and in the numerical phase. -/ lemma mul_Jtilde_eq (τ : ℍ) : @@ -89,11 +89,11 @@ lemma mul_Jtilde_eq (τ : ℍ) : /-- The approximation `stilde₂` of Ramanujan's `s₂` from Theorem `theonaehers2` of the paper: `stilde₂(τ) = (1 + 240(q + 9q²))/(1 - 504(q + 33q²)) · (1 - 24(q + 3q²) - 3/(π·Im τ))`. -/ -def s₂tilde (τ : ℍ) : ℂ := +@[expose] def s₂tilde (τ : ℍ) : ℂ := (1 + 240 * (q τ + 9 * q τ ^ 2)) / (1 - 504 * (q τ + 33 * q τ ^ 2)) * (1 - 24 * (q τ + 3 * q τ ^ 2) - 3 / (π * τ.im)) -lemma s₂tilde_eq (τ : ℍ) : s₂tilde τ = E₄trunc τ / E₆trunc τ * E₂starTrunc τ := rfl +lemma s₂tilde_eq (τ : ℍ) : s₂tilde τ = E₄trunc τ / E₆trunc τ * E₂starTrunc τ := by rfl /-! ### The σₖ bound (paper Lemma `sigmaschaetz`) -/ @@ -527,9 +527,11 @@ lemma norm_sub_E₂starTrunc_le {τ : ℍ} (hτ : τ ∈ Region) : /-! ### Klein's `k` and its truncation `ktilde` (paper Lemma `lemk`) -/ /-- The analytic function `k(τ) = (E₄³ - E₆²)/(1728·q) = Δ/q` (paper Lemma `lemk`). -/ +@[expose] def kfun (τ : ℍ) : ℂ := (E₄ τ ^ 3 - E₆ τ ^ 2) / (1728 * q τ) /-- The truncation `ktilde(τ) = (1 - q - q²)²⁴` (paper Lemma `lemk`). -/ +@[expose] def ktilde (τ : ℍ) : ℂ := (1 - q τ - q τ ^ 2) ^ 24 lemma q_ne_zero (τ : ℍ) : q τ ≠ 0 := norm_pos_iff.mp (norm_q_pos τ) diff --git a/LeanPool/Chudnovsky/Fourier.lean b/LeanPool/Chudnovsky/Fourier.lean index 27a1ac1adb..37ed524d20 100644 --- a/LeanPool/Chudnovsky/Fourier.lean +++ b/LeanPool/Chudnovsky/Fourier.lean @@ -27,7 +27,7 @@ final product formula `fouriersigma` stated here is unaffected. All statements in this file are fully proved. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/Kummer.lean b/LeanPool/Chudnovsky/Kummer.lean index 7330a5b174..5b351db73b 100644 --- a/LeanPool/Chudnovsky/Kummer.lean +++ b/LeanPool/Chudnovsky/Kummer.lean @@ -54,7 +54,7 @@ what chapter 9 consumes after the PLAN A7 reformulation. TODO: if the final asse only through `F` and `dF/dJ`), add it here with an explicit principal-branch bookkeeping. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/Lattices.lean b/LeanPool/Chudnovsky/Lattices.lean index 5187501a76..9e07c88d84 100644 --- a/LeanPool/Chudnovsky/Lattices.lean +++ b/LeanPool/Chudnovsky/Lattices.lean @@ -24,7 +24,7 @@ Statements from chapter 3 of Milla (arXiv:1809.00533v6, file `080_Lattices.tex`) All nontrivial proofs are `sorry`-ed for now; this file pins the statements. -/ -@[expose] public section +public section noncomputable section @@ -47,9 +47,9 @@ instance instSMulUnitsPeriodPair : SMul ℂˣ PeriodPair := ⟨smul⟩ variable (a : ℂˣ) (L : PeriodPair) -@[simp] lemma smul_ω₁ : (a • L).ω₁ = a * L.ω₁ := rfl +@[simp] lemma smul_ω₁ : (a • L).ω₁ = a * L.ω₁ := by rfl -@[simp] lemma smul_ω₂ : (a • L).ω₂ = a * L.ω₂ := rfl +@[simp] lemma smul_ω₂ : (a • L).ω₂ = a * L.ω₂ := by rfl /-- The lattice of `a•L` is the scaled lattice `a·L` (paper ch. 3). -/ theorem mem_smul_lattice_iff (z : ℂ) : @@ -75,7 +75,7 @@ def smulLatticeEquiv : L.lattice ≃ (a • L).lattice where apply Subtype.ext; simp only; rw [← mul_assoc, mul_inv_cancel₀ a.ne_zero, one_mul] @[simp] lemma smulLatticeEquiv_coe (l : L.lattice) : - ((smulLatticeEquiv a L l : (a • L).lattice) : ℂ) = (a : ℂ) * (l : ℂ) := rfl + ((smulLatticeEquiv a L l : (a • L).lattice) : ℂ) = (a : ℂ) * (l : ℂ) := by rfl /-- Multiplication by `a` as an equivalence between the nonzero lattice points of `L` and those of `a•L`. -/ @@ -87,7 +87,7 @@ def smulLatticeEquiv' : @[simp] lemma smulLatticeEquiv'_coe (l : {l : L.lattice // l ≠ 0}) : (((smulLatticeEquiv' a L l).1 : (a • L).lattice) : ℂ) = (a : ℂ) * ((l : L.lattice) : ℂ) := - rfl + by rfl /-! ### Termwise scaling identities (helpers) -/ @@ -124,11 +124,11 @@ private lemma sigmaTerm_aux {c : ℂ} (hc : c ≠ 0) (z w : ℂ) : /-! ## The discriminant and Klein's absolute invariant (paper Def. `defijdelta`) -/ /-- The discriminant of a lattice, `Δ(L) = g₂(L)³ - 27·g₃(L)²` (paper Def. `defijdelta`). -/ -def discr : ℂ := L.g₂ ^ 3 - 27 * L.g₃ ^ 2 +@[expose] def discr : ℂ := L.g₂ ^ 3 - 27 * L.g₃ ^ 2 /-- Klein's absolute invariant of a lattice, `J(L) = g₂(L)³ / (g₂(L)³ - 27·g₃(L)²)` (paper Def. `defijdelta`). -/ -def J : ℂ := L.g₂ ^ 3 / L.discr +@[expose] def J : ℂ := L.g₂ ^ 3 / L.discr /-! ## Scaling laws (paper `trafog23`, `etatransf`) -/ diff --git a/LeanPool/Chudnovsky/Liouville.lean b/LeanPool/Chudnovsky/Liouville.lean index ff877306f8..02a86a9fe0 100644 --- a/LeanPool/Chudnovsky/Liouville.lean +++ b/LeanPool/Chudnovsky/Liouville.lean @@ -35,7 +35,7 @@ proved via a self-contained parallelogram residue theorem built from Mathlib's r Cauchy--Goursat primitives. -/ -@[expose] public section +public section noncomputable section @@ -231,11 +231,13 @@ variable (L : PeriodPair) /-- An elliptic function for the lattice of the period pair `L`: a meromorphic function `ℂ → ℂ` which is periodic with respect to every lattice point (paper Def. of "elliptic function", ch. 1). -/ +@[expose] def IsEllipticWith (f : ℂ → ℂ) : Prop := Meromorphic f ∧ ∀ (z : ℂ) (l : L.lattice), f (z + l) = f z /-- The fundamental parallelogram `𝒫 = {s·ω₁ + t·ω₂ | 0 ≤ s, t < 1}` (paper Def. `fund`). Every `z : ℂ` is equivalent modulo `L.lattice` to exactly one point of `𝒫`. -/ +@[expose] def fundamentalParallelogram : Set ℂ := {z : ℂ | ∃ s ∈ Set.Ico (0 : ℝ) 1, ∃ t ∈ Set.Ico (0 : ℝ) 1, z = s • L.ω₁ + t • L.ω₂} diff --git a/LeanPool/Chudnovsky/MainTheorem.lean b/LeanPool/Chudnovsky/MainTheorem.lean index daaa2a57ef..bb07217587 100644 --- a/LeanPool/Chudnovsky/MainTheorem.lean +++ b/LeanPool/Chudnovsky/MainTheorem.lean @@ -35,7 +35,7 @@ estimates), and the principal square root of `w²` is `w` on the right half-plan originally planned for this step (PLAN A8) is kept for reference/reuse. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ def Gsq (z : ℂ) : ℂ := (₂F₁ (1 / 12 : ℂ) (5 / 12) 1 z) ^ 2 /-- The summand of the Main Theorem's series: `((1−s₂(τ))/6 + n) · (6n)!/((3n)!(n!)³) · (1728·J(τ))⁻ⁿ`. -/ -def mainSummand (τ : ℍ) (n : ℕ) : ℂ := +@[expose] def mainSummand (τ : ℍ) (n : ℕ) : ℂ := ((1 - s₂ τ) / 6 + n) * (((6 * n)! : ℂ) / (((3 * n)! : ℂ) * ((n ! : ℕ) : ℂ) ^ 3)) / (1728 * J τ) ^ n diff --git a/LeanPool/Chudnovsky/Numerics.lean b/LeanPool/Chudnovsky/Numerics.lean index 3a585ea5b9..f37eb0ddb4 100644 --- a/LeanPool/Chudnovsky/Numerics.lean +++ b/LeanPool/Chudnovsky/Numerics.lean @@ -32,7 +32,7 @@ Every digit string below has been verified by exact rational arithmetic * `e^{-π√163} = 3.80898093700765233822623151647 80054376196293193806…e-18` -/ -@[expose] public section +public section noncomputable section @@ -331,7 +331,7 @@ theorem norm_q_τ₁₆₃ : ‖q τ₁₆₃‖ = Real.exp (-(π * Real.sqrt 16 `q τ₁₆₃ = e^{2πi(1/2 + i√163/2)} = e^{πi}·e^{-π√163} = -e^{-π√163}`. -/ theorem q_τ₁₆₃_eq : q τ₁₆₃ = -Complex.exp (-(π * Real.sqrt 163) : ℝ) := by rw [q_eq] - have hre : τ₁₆₃.re = 1 / 2 := rfl + have hre : τ₁₆₃.re = 1 / 2 := τ₁₆₃_re have hτ : (τ₁₆₃ : ℂ) = ((1 / 2 : ℝ) : ℂ) + ((Real.sqrt 163 / 2 : ℝ) : ℂ) * Complex.I := by apply Complex.ext <;> simp [hre] have harg : 2 * (π : ℂ) * Complex.I * (τ₁₆₃ : ℂ) diff --git a/LeanPool/Chudnovsky/PicardFuchs.lean b/LeanPool/Chudnovsky/PicardFuchs.lean index e64a73e59e..68fd31144a 100644 --- a/LeanPool/Chudnovsky/PicardFuchs.lean +++ b/LeanPool/Chudnovsky/PicardFuchs.lean @@ -37,7 +37,7 @@ which bypasses the Picard–Fuchs equation entirely and proves the chapter-8 out theorem for the periods is not needed on the main chain and is omitted here. -/ -@[expose] public section +public section noncomputable section @@ -47,6 +47,7 @@ open UpperHalfPlane Complex /-- The **Picard–Fuchs differential equation** (paper Thm. `picardfuchs`): `Ω` satisfies `d²Ω/dJ² + (1/J)·dΩ/dJ + (31J - 4)/(144·J²·(J-1)²)·Ω = 0` at every point of `S`. -/ +@[expose] def SatisfiesPicardFuchs (Ω : ℂ → ℂ) (S : Set ℂ) : Prop := ∀ z ∈ S, deriv (deriv Ω) z + 1 / z * deriv Ω z diff --git a/LeanPool/Chudnovsky/Quasiperiods.lean b/LeanPool/Chudnovsky/Quasiperiods.lean index 9dbe09783e..711101b68b 100644 --- a/LeanPool/Chudnovsky/Quasiperiods.lean +++ b/LeanPool/Chudnovsky/Quasiperiods.lean @@ -27,7 +27,7 @@ Statements from chapter 2 of Milla (arXiv:1809.00533v6, file `070_Quasiperiods.t All statements in this file are fully proved. -/ -@[expose] public section +public section noncomputable section @@ -39,10 +39,12 @@ variable (L : PeriodPair) /-- The first basic quasiperiod `η₁(L) = 2ζ(ω₁/2)` (paper Def. `defetak`; this equals `ζ(z+ω₁) - ζ(z)` for every `z ∉ L`, see `weierstrassZeta_add_ω₁`). -/ +@[expose] def eta₁ : ℂ := 2 * L.weierstrassZeta (L.ω₁ / 2) /-- The second basic quasiperiod `η₂(L) = 2ζ(ω₂/2)` (paper Def. `defetak`; this equals `ζ(z+ω₂) - ζ(z)` for every `z ∉ L`, see `weierstrassZeta_add_ω₂`). -/ +@[expose] def eta₂ : ℂ := 2 * L.weierstrassZeta (L.ω₂ / 2) /-- The lattice is a countable subset of `ℂ`. -/ diff --git a/LeanPool/Chudnovsky/Ramanujan.lean b/LeanPool/Chudnovsky/Ramanujan.lean index 3811caaf4e..9ba2f4306a 100644 --- a/LeanPool/Chudnovsky/Ramanujan.lean +++ b/LeanPool/Chudnovsky/Ramanujan.lean @@ -45,7 +45,7 @@ Byproducts stated for downstream use (Kummer/PicardFuchs and MainTheorem): * pointwise raw-derivative forms `deriv_comp_ofComplex_E2`/`_E₄`/`_E₆`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/SigmaZeta.lean b/LeanPool/Chudnovsky/SigmaZeta.lean index b8a8726cb5..a6a5df7ed6 100644 --- a/LeanPool/Chudnovsky/SigmaZeta.lean +++ b/LeanPool/Chudnovsky/SigmaZeta.lean @@ -32,7 +32,7 @@ of a basic first year approach* (arXiv:1809.00533v6, file `060_ElliptFunct.tex`) `ζ = σ'/σ` (paper Def. `defizeta`) and `ζ' = -℘` (paper Def. `defiwp`). -/ -@[expose] public section +public section noncomputable section @@ -42,23 +42,24 @@ open Complex Filter Topology Module /-- The factor of the Weierstrass σ-product associated to a nonzero lattice point `w`: `(1 - z/w)·exp(z/w + z²/(2w²))`. -/ -def weierstrassSigmaTerm (z w : ℂ) : ℂ := +@[expose] def weierstrassSigmaTerm (z w : ℂ) : ℂ := (1 - z / w) * Complex.exp (z / w + z ^ 2 / (2 * w ^ 2)) /-- The summand of the Weierstrass ζ-series associated to a nonzero lattice point `w`: `1/(z-w) + 1/w + z/w²`. -/ -def weierstrassZetaTerm (z w : ℂ) : ℂ := +@[expose] def weierstrassZetaTerm (z w : ℂ) : ℂ := 1 / (z - w) + 1 / w + z / w ^ 2 variable (L : PeriodPair) /-- The Weierstrass σ-function of the lattice `L` (paper Def. `defisigma`): `σ(z; L) = z·∏_{ω ∈ L, ω ≠ 0} (1 - z/ω)·exp(z/ω + z²/(2ω²))`. -/ -def weierstrassSigma (z : ℂ) : ℂ := +@[expose] def weierstrassSigma (z : ℂ) : ℂ := z * ∏' l : {l : L.lattice // l ≠ 0}, weierstrassSigmaTerm z (l.1 : ℂ) /-- The Weierstrass ζ-function of the lattice `L` (paper Def. `defizeta`): `ζ(z; L) = 1/z + ∑_{ω ∈ L, ω ≠ 0} (1/(z-ω) + 1/ω + z/ω²)`. -/ +@[expose] def weierstrassZeta (z : ℂ) : ℂ := 1 / z + ∑' l : {l : L.lattice // l ≠ 0}, weierstrassZetaTerm z (l.1 : ℂ) diff --git a/LeanPool/Chudnovsky/SingularModuli.lean b/LeanPool/Chudnovsky/SingularModuli.lean index e9e0edf939..a777fb279d 100644 --- a/LeanPool/Chudnovsky/SingularModuli.lean +++ b/LeanPool/Chudnovsky/SingularModuli.lean @@ -35,7 +35,7 @@ explicit hypotheses, giving the intermediate milestone `chudnovsky_of_singular_m (PLAN Phase C). -/ -@[expose] public section +public section /- Candidate proof routes, summarized from PLAN.md (Phase C): diff --git a/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean b/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean index 705a7f4d57..675dea9620 100644 --- a/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean +++ b/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean @@ -30,7 +30,7 @@ Only elementary Möbius algebra is used; nothing here touches the modular polyno itself (that is `ModularPolynomialQ`, another track). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean b/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean index 32c324c0fc..82408c0cd4 100644 --- a/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean +++ b/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean @@ -53,7 +53,7 @@ with `c n = jqInt.coeff n ∈ ℤ` the integer `j`-coefficients. The `b`-depende `(B3)`. -/ -@[expose] public section +public section noncomputable section @@ -78,9 +78,9 @@ def Acol (m : ℕ) [NeZero m] (b : ℤ) : GL (Fin 2) ℝ := .mkOfDetNeZero !![1, (b : ℝ); 0, (m : ℝ)] (by simp [Matrix.det_fin_two_of, Nat.cast_ne_zero.mpr (NeZero.ne m)]) -@[simp] lemma val_AInf [NeZero m] : (AInf m).val = !![(m : ℝ), 0; 0, 1] := rfl +@[simp] lemma val_AInf [NeZero m] : (AInf m).val = !![(m : ℝ), 0; 0, 1] := by rfl -@[simp] lemma val_Acol [NeZero m] (b : ℤ) : (Acol m b).val = !![1, (b : ℝ); 0, (m : ℝ)] := rfl +@[simp] lemma val_Acol [NeZero m] (b : ℤ) : (Acol m b).val = !![1, (b : ℝ); 0, (m : ℝ)] := by rfl lemma det_AInf_pos [NeZero m] : 0 < (AInf m).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_AInf, Matrix.det_fin_two_of] @@ -109,10 +109,10 @@ def f (m : ℕ) [NeZero m] : Option (ZMod m) → ℍ → ℂ | none, τ => j (AInf m • τ) | some b, τ => j (Acol m b.val • τ) -@[simp] lemma f_none [NeZero m] (τ : ℍ) : f m none τ = j (AInf m • τ) := rfl +@[simp] lemma f_none [NeZero m] (τ : ℍ) : f m none τ = j (AInf m • τ) := by rfl @[simp] lemma f_some [NeZero m] (b : ZMod m) (τ : ℍ) : - f m (some b) τ = j (Acol m b.val • τ) := rfl + f m (some b) τ = j (Acol m b.val • τ) := by rfl /-- Each orbit function is holomorphic on `ℍ`. -/ lemma mdifferentiable_f [NeZero m] (i : Option (ZMod m)) : MDiff (f m i) := by @@ -157,8 +157,8 @@ private lemma dvd_val_add [NeZero m] (b : ZMod m) (c : ℤ) : /-- The permutation of the orbit induced by `T`: rotation `some b ↦ some (b+1)`, `none` fixed. -/ def σT (m : ℕ) : Equiv.Perm (Option (ZMod m)) := Equiv.optionCongr (Equiv.addRight (1 : ZMod m)) -@[simp] lemma σT_none : σT m none = none := rfl -@[simp] lemma σT_some (b : ZMod m) : σT m (some b) = some (b + 1) := rfl +@[simp] lemma σT_none : σT m none = none := by rfl +@[simp] lemma σT_some (b : ZMod m) : σT m (some b) = some (b + 1) := by rfl /-- **`T`-permutation**: `f i (T • τ) = f (σT i) τ`, i.e. `f i (τ + 1) = f (σT i) τ`. -/ lemma f_T_smul [NeZero m] (i : Option (ZMod m)) (τ : ℍ) : @@ -220,7 +220,7 @@ lemma sSfun_involutive [Fact m.Prime] : Function.Involutive (sSfun m) := by /-- The `S`-permutation as an `Equiv.Perm`. -/ def σS (m : ℕ) [Fact m.Prime] : Equiv.Perm (Option (ZMod m)) := sSfun_involutive.toPerm -@[simp] lemma σS_apply [Fact m.Prime] (i : Option (ZMod m)) : σS m i = sSfun m i := rfl +@[simp] lemma σS_apply [Fact m.Prime] (i : Option (ZMod m)) : σS m i = sSfun m i := by rfl /-- **`S`-permutation**: `f i (S • τ) = f (σS i) τ`, i.e. `f i (-1/τ) = f (σS i) τ`. This is what makes the elementary symmetric functions of the orbit `SL(2,ℤ)`-invariant. -/ @@ -280,10 +280,10 @@ and composing `JFunction`'s integer expansion `hasSum_j_mul_q` yields the coeffi /-- The base variable `w = exp(2πiτ/m)`: an honest holomorphic function of `τ` (no `q^{1/m}`), with `w^m = q τ`. -/ -def wParam (m : ℕ) (τ : ℍ) : ℂ := Complex.exp (2 * π * Complex.I * (τ : ℂ) / m) +@[expose] def wParam (m : ℕ) (τ : ℍ) : ℂ := Complex.exp (2 * π * Complex.I * (τ : ℂ) / m) /-- The `m`-th root of unity `ζ = exp(2πi/m)`. -/ -def zetaM (m : ℕ) : ℂ := Complex.exp (2 * π * Complex.I / m) +@[expose] def zetaM (m : ℕ) : ℂ := Complex.exp (2 * π * Complex.I / m) lemma wParam_ne_zero (τ : ℍ) : wParam m τ ≠ 0 := Complex.exp_ne_zero _ diff --git a/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean b/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean index 46d996acde..3b869b1b8f 100644 --- a/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean +++ b/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean @@ -30,7 +30,7 @@ The bridge from these form-level facts to the statement *"every CM point of disc with `BQF.act`; that analytic bookkeeping is deferred (see the closing `TODO`). -/ -@[expose] public section +public section noncomputable section @@ -310,8 +310,8 @@ theorem isRoot_smul {f g : BQF} {p q r s : ℤ} (hdet : p * s - q * r = 1) /-- `τ₁₆₃` is the root of the reduced form `(1, −1, 41)` (`41 − τ + τ² = 0`). -/ theorem isRoot_τ₁₆₃ : IsRoot ⟨1, -1, 41⟩ Chudnovsky.τ₁₆₃ := by simp only [IsRoot] - have hre : Chudnovsky.τ₁₆₃.re = 1 / 2 := rfl - have him : Chudnovsky.τ₁₆₃.im = Real.sqrt 163 / 2 := rfl + have hre : Chudnovsky.τ₁₆₃.re = 1 / 2 := Chudnovsky.τ₁₆₃_re + have him : Chudnovsky.τ₁₆₃.im = Real.sqrt 163 / 2 := Chudnovsky.τ₁₆₃_im have hτ : (Chudnovsky.τ₁₆₃ : ℂ) = ((1 / 2 : ℝ) : ℂ) + ((Real.sqrt 163 / 2 : ℝ) : ℂ) * Complex.I := by apply Complex.ext <;> simp [hre, him] @@ -331,7 +331,8 @@ theorem cm_disc_neg163_smul_eq_τ₁₆₃ {f : BQF} (hpd : IsPosDef f) (hdisc : · obtain ⟨N, hN⟩ := isRoot_smul hdet hact hroot exact ⟨N, root_unique posdef_1m141 hN isRoot_τ₁₆₃⟩ · obtain ⟨N, hN⟩ := isRoot_smul hdet hact hroot - have hTact : act (⟨1, 1, 41⟩ : BQF) 1 (-1) 0 1 = ⟨1, -1, 41⟩ := by decide + have hTact : act (⟨1, 1, 41⟩ : BQF) 1 (-1) 0 1 = ⟨1, -1, 41⟩ := by + ext <;> norm_num obtain ⟨N', hN'⟩ := isRoot_smul (by ring : (1 : ℤ) * 1 - (-1) * 0 = 1) hTact hN refine ⟨N' * N, ?_⟩ rw [mul_smul] diff --git a/LeanPool/Chudnovsky/SingularModuli/JFunction.lean b/LeanPool/Chudnovsky/SingularModuli/JFunction.lean index 17f083616d..937eea7c29 100644 --- a/LeanPool/Chudnovsky/SingularModuli/JFunction.lean +++ b/LeanPool/Chudnovsky/SingularModuli/JFunction.lean @@ -49,7 +49,7 @@ harmlessly, in the *boundedness* of `j·q` at the cusp, via `tendsto_atImInfty_tprod_one_sub_eta_q_pow`.) -/ -@[expose] public section +public section noncomputable section @@ -63,9 +63,9 @@ open scoped Real ComplexOrder Manifold MatrixGroups /-- The modular `j`-invariant in this project's normalization, `j = 1728·J = E₄³/Δ`. Kept definitionally equal to the `1728 * J τ` appearing in `SingularModuli.lean`'s pinned statements. -/ -def j (τ : ℍ) : ℂ := 1728 * J τ +@[expose] def j (τ : ℍ) : ℂ := 1728 * J τ -@[simp] lemma j_def (τ : ℍ) : j τ = 1728 * J τ := rfl +@[simp] lemma j_def (τ : ℍ) : j τ = 1728 * J τ := by rfl /-- `j = E₄³/Δ`. -/ lemma j_eq (τ : ℍ) : j τ = E₄ τ ^ 3 / discriminant τ := by diff --git a/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean b/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean index 548b17a931..2ed0102be1 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean @@ -43,7 +43,7 @@ Everything downstream of `±1` is `isIntegral_of_kronecker`; `isIntegral_j_of_cm so that only the CM relation `j τ = f m i τ` and the defining identity `hPhi` are needed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean b/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean index 48032a59d7..0b590b9f5a 100644 --- a/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean +++ b/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean @@ -61,7 +61,7 @@ Everything, unconditionally: The top-level deliverable is `masser_s₂_rational : ∃ r : ℚ, s₂ τ₁₆₃ = r`. -/ -@[expose] public section +public section noncomputable section @@ -94,7 +94,7 @@ lemma two_tau_sub_one_ne_zero : 2 * (τ₁₆₃ : ℂ) - 1 ≠ 0 := by def LamGL : GL (Fin 2) ℝ := .mkOfDetNeZero !![1, -82; 2, -1] (by rw [Matrix.det_fin_two_of]; norm_num) -@[simp] lemma val_LamGL : (LamGL).val = !![1, -82; 2, -1] := rfl +@[simp] lemma val_LamGL : (LamGL).val = !![1, -82; 2, -1] := by rfl lemma LamGL_det_pos : 0 < (LamGL).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_LamGL, Matrix.det_fin_two_of] @@ -844,7 +844,7 @@ private lemma mβ10_ne_zero : mβ10 ≠ 0 := by private lemma two_tau_eq : 2 * (τ₁₆₃ : ℂ) - 1 = 2 * Complex.I * ((τ₁₆₃.im : ℝ) : ℂ) := by apply Complex.ext - · simp [Complex.mul_re, show τ₁₆₃.re = 1 / 2 from rfl] + · simp [Complex.mul_re, show τ₁₆₃.re = 1 / 2 from τ₁₆₃_re] · simp [Complex.mul_im, UpperHalfPlane.coe_im] /-- **The analytic gate of `masser_s₂_rational_of`, discharged**: Masser's identity (106) diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean index 1ed5bc48ad..ac0bb04af5 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean @@ -62,7 +62,7 @@ The whole file is **sorry-free**. The gated pieces, with routes, are documented documented at `PhiQ`. -/ -@[expose] public section +public section noncomputable section @@ -199,6 +199,7 @@ The generating polynomial of the orbit; its coefficients are (up to sign) the el symmetric functions of `{f_i τ}`, which are `SL(2,ℤ)`-invariant and holomorphic. -/ /-- The orbit polynomial `∏_i (X − f_i τ) ∈ ℂ[X]`. -/ +@[expose] def orbitPoly (m : ℕ) [NeZero m] (τ : ℍ) : Polynomial ℂ := ∏ i : Option (ZMod m), (X - C (f m i τ)) @@ -514,6 +515,7 @@ identity. -/ /-- Specialization of a `ℚ[Y][X]`-polynomial at `Y = Y₀ ∈ ℂ`: map each `ℚ[Y]`-coefficient to its value at `Y₀`, landing in `ℂ[X]`. Applied at `Y₀ = j τ` this is `Φ_m(X, j τ)`. -/ +@[expose] def specializeY (Y₀ : ℂ) : Polynomial (Polynomial ℚ) →+* Polynomial ℂ := Polynomial.mapRingHom (Polynomial.aeval Y₀).toRingHom @@ -841,6 +843,7 @@ series. -/ variable {m : ℕ} /-- The subring `ℚ ⊆ ℂ` (image of the rational cast). -/ +@[expose] def RQ : Subring ℂ := (Rat.castHom ℂ).range lemma intCast_mem_RQ (n : ℤ) : (n : ℂ) ∈ RQ := intCast_mem RQ n diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean index 4130a59f26..f552bf0509 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean @@ -85,7 +85,7 @@ lives in `CMRelations.lean` (a two-line Möbius computation), consumed via `diag / `PhiQ_eval_j_root`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean b/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean index 0217c0375e..ac646e4433 100644 --- a/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean +++ b/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean @@ -33,7 +33,7 @@ The `GL₂` action is the classical *right* action on forms, `BQF.act f p q r s` taking the four entries directly (avoiding matrix-coercion churn). -/ -@[expose] public section +public section noncomputable section @@ -53,16 +53,19 @@ triple `(a, b, c)`. -/ deriving DecidableEq /-- The discriminant `b² − 4ac`. -/ -def disc (f : BQF) : ℤ := f.b ^ 2 - 4 * f.a * f.c +@[expose] def disc (f : BQF) : ℤ := f.b ^ 2 - 4 * f.a * f.c /-- A form is positive definite when `a > 0` and `disc < 0` (then `c > 0` too). -/ +@[expose] def IsPosDef (f : BQF) : Prop := 0 < f.a ∧ disc f < 0 /-- A form is primitive when its coefficients have no common non-unit divisor. -/ +@[expose] def IsPrimitive (f : BQF) : Prop := ∀ d : ℤ, d ∣ f.a → d ∣ f.b → d ∣ f.c → IsUnit d /-- The right `GL₂`-action on forms: `(f · ![![p,q],![r,s]])`. -/ +@[expose] def act (f : BQF) (p q r s : ℤ) : BQF where a := f.a * p ^ 2 + f.b * p * r + f.c * r ^ 2 b := 2 * f.a * p * q + f.b * (p * s + q * r) + 2 * f.c * r * s @@ -122,7 +125,7 @@ theorem IsPrimitive.act {f : BQF} (hf : IsPrimitive f) {p q r s : ℤ} /-! ## CM points: roots of a form in the upper half-plane -/ /-- `τ ∈ ℍ` is a *root* of the form `f` when `a τ² + b τ + c = 0`. -/ -def IsRoot (f : BQF) (τ : ℍ) : Prop := +@[expose] def IsRoot (f : BQF) (τ : ℍ) : Prop := (f.a : ℂ) * (τ : ℂ) ^ 2 + (f.b : ℂ) * (τ : ℂ) + (f.c : ℂ) = 0 /-- A real linear relation `α·τ + β = 0` at a point of `ℍ` forces `α = 0` (and then @@ -193,7 +196,7 @@ positive-definite form `f = (a,b,c)`, the fixing matrices are exactly `p·I + k §4.2 (C5) and §5.1 step 4. -/ /-- The fixing relation `p τ + q = τ (r τ + s)`, division-free. -/ -def Fixes (p q r s : ℤ) (τ : ℍ) : Prop := +@[expose] def Fixes (p q r s : ℤ) (τ : ℍ) : Prop := (p : ℂ) * (τ : ℂ) + (q : ℂ) = (τ : ℂ) * ((r : ℂ) * (τ : ℂ) + (s : ℂ)) /-- A primitive form admits a Bézout relation among its coefficients. -/ diff --git a/LeanPool/Chudnovsky/SingularModuli/Rationality.lean b/LeanPool/Chudnovsky/SingularModuli/Rationality.lean index 2532c520a1..93c74c5830 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Rationality.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Rationality.lean @@ -51,7 +51,7 @@ Let `j₀ := j τ₁₆₃` and `x` an arbitrary complex root of `minpoly ℚ j Vieta relation on the subleading coefficient (a rational) forces `j₀ ∈ ℚ`. -/ -@[expose] public section +public section noncomputable section @@ -108,7 +108,7 @@ def cmGL (n : ℤ) : GL (Fin 2) ℝ := nlinarith [sq_nonneg (2 * (n : ℝ) + 1)]) @[simp] lemma val_cmGL (n : ℤ) : - (cmGL n).val = !![(n : ℝ) + 1, -41; 1, (n : ℝ)] := rfl + (cmGL n).val = !![(n : ℝ) + 1, -41; 1, (n : ℝ)] := by rfl lemma cmGL_det_pos (n : ℤ) : 0 < (cmGL n).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_cmGL, Matrix.det_fin_two_of] diff --git a/LeanPool/Chudnovsky/SingularModuli/Valence.lean b/LeanPool/Chudnovsky/SingularModuli/Valence.lean index 24372d442d..efc5e28f9a 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Valence.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Valence.lean @@ -59,7 +59,7 @@ Both halves of the §4.3 valence theory (`j_injective_mod_Γ` and `j_surjective` `sorry`-free. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chudnovsky/WeierstrassMore.lean b/LeanPool/Chudnovsky/WeierstrassMore.lean index 7017b10afc..31d6ae480a 100644 --- a/LeanPool/Chudnovsky/WeierstrassMore.lean +++ b/LeanPool/Chudnovsky/WeierstrassMore.lean @@ -29,7 +29,7 @@ characterisation of the zeros of `℘'` use the third Liouville theorem (from `LeanPool.Chudnovsky.Liouville`) as a pinned interface. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Chvatal.lean b/LeanPool/Chvatal.lean index d9c77378b2..8adb7337fc 100644 --- a/LeanPool/Chvatal.lean +++ b/LeanPool/Chvatal.lean @@ -21,7 +21,7 @@ Tags: extremal-combinatorics, intersecting-families, Fourier-analysis MSC: 05D05, 60E15 -/ -@[expose] public section +public section /- Upstream: https://github.com/boonsuan/chvatal diff --git a/LeanPool/Chvatal/Auxiliary.lean b/LeanPool/Chvatal/Auxiliary.lean index 97611390f6..382a59f3fb 100644 --- a/LeanPool/Chvatal/Auxiliary.lean +++ b/LeanPool/Chvatal/Auxiliary.lean @@ -50,7 +50,7 @@ Corollary 3.2. The independence proof uses subset induction and needs no arbitrary ordering of the monomials. -/ -@[expose] public section +public section namespace Chvatal @@ -151,7 +151,7 @@ noncomputable def twistedMonomial (S : Finset ι) : Finset ι → ℝ := /-- Coordinate description of the twisted monomials of Lemma 3.1. -/ @[simp] theorem twistedMonomial_apply (S x : Finset ι) : - twistedMonomial S x = monomial S x * walsh Finset.univ x := rfl + twistedMonomial S x = monomial S x * walsh Finset.univ x := by rfl /-- Lemma 3.1(iii) for the second family: the full character is an invertible multiplier, so independence of the monomials is preserved. -/ @@ -251,7 +251,7 @@ theorem fourier_smul_function (c : ℝ) (f : Finset ι → ℝ) (S : Finset ι) /-- The functions satisfying both support restrictions of Corollary 3.2 form a linear subspace: physical support lies in `F`, and Fourier support lies in `K`. -/ -def supportSubspace (F K : Family ι) : Submodule ℝ (Finset ι → ℝ) where +@[expose] def supportSubspace (F K : Family ι) : Submodule ℝ (Finset ι → ℝ) where carrier := {f | (∀ x, x ∉ F → f x = 0) ∧ (∀ S, S ∉ K → fourier f S = 0)} zero_mem' := by constructor diff --git a/LeanPool/Chvatal/Bessel.lean b/LeanPool/Chvatal/Bessel.lean index ac042e2099..2f412ff104 100644 --- a/LeanPool/Chvatal/Bessel.lean +++ b/LeanPool/Chvatal/Bessel.lean @@ -48,7 +48,7 @@ inner product on Euclidean space. This file transfers mathlib's Bessel inequalit and Gram–Schmidt theorem through the explicit normalization by `√|Ω|`. -/ -@[expose] public section +public section namespace Chvatal @@ -60,7 +60,7 @@ variable {Ω : Type*} [Fintype Ω] [Nonempty Ω] /-- The uniform probability inner product in Section 2, generalized to any nonempty finite sample space. -/ -def uniformInner (f g : Ω → ℝ) : ℝ := (∑ x, f x * g x) / Fintype.card Ω +@[expose] def uniformInner (f g : Ω → ℝ) : ℝ := (∑ x, f x * g x) / Fintype.card Ω /-- The normalization which identifies the paper's probability inner product with mathlib's Euclidean inner product. -/ @@ -71,7 +71,7 @@ noncomputable def uniformEuclidean : (Ω → ℝ) ≃ₗ[ℝ] EuclideanSpace ℝ /-- Coordinate formula for the normalization used in Theorem 2.1. -/ @[simp] theorem uniformEuclidean_apply (f : Ω → ℝ) (x : Ω) : - uniformEuclidean f x = (Real.sqrt (Fintype.card Ω))⁻¹ * f x := rfl + uniformEuclidean f x = (Real.sqrt (Fintype.card Ω))⁻¹ * f x := by rfl /-- The normalization preserves exactly the probability inner product of Section 2. -/ theorem inner_uniformEuclidean (f g : Ω → ℝ) : @@ -89,7 +89,7 @@ theorem inner_uniformEuclidean (f g : Ω → ℝ) : /-- Orthonormality with respect to uniform probability, as in Theorem 2.1 and Corollary 3.2. The index type may be empty. -/ -def UniformOrthonormal {κ : Type*} (u : κ → Ω → ℝ) : Prop := by +@[expose] def UniformOrthonormal {κ : Type*} (u : κ → Ω → ℝ) : Prop := by classical exact ∀ i j, uniformInner (u i) (u j) = if i = j then 1 else 0 diff --git a/LeanPool/Chvatal/Boolean.lean b/LeanPool/Chvatal/Boolean.lean index 8074043afd..6f5974ba69 100644 --- a/LeanPool/Chvatal/Boolean.lean +++ b/LeanPool/Chvatal/Boolean.lean @@ -49,7 +49,7 @@ this makes their Fourier transforms ordinary real-valued transforms. Increasing functions use mathlib's `Monotone` predicate on finite subsets ordered by inclusion. -/ -@[expose] public section +public section open scoped BigOperators symmDiff @@ -60,15 +60,15 @@ namespace Chvatal variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- Section 2: a real-valued cube function is Boolean when every value is zero or one. -/ -def IsBoolean (f : Finset ι → ℝ) : Prop := ∀ x, f x = 0 ∨ f x = 1 +@[expose] def IsBoolean (f : Finset ι → ℝ) : Prop := ∀ x, f x = 0 ∨ f x = 1 /-- The sign `2xᵢ - 1` used in the influence identity (6). -/ -def coordinateSign (i : ι) (x : Finset ι) : ℝ := if i ∈ x then 1 else -1 +@[expose] def coordinateSign (i : ι) (x : Finset ι) : ℝ := if i ∈ x then 1 else -1 /-- Section 2: influence, written as mean squared change under a single-coordinate flip. For Boolean functions this is the probability that the value changes; see `influence_eq_mean_indicator`. -/ -def influence (f : Finset ι → ℝ) (i : ι) : ℝ := +@[expose] def influence (f : Finset ι → ℝ) (i : ι) : ℝ := cubeMean (fun x => (f x - f (x ∆ {i})) ^ 2) /-- The Boolean duality operation of Section 2 preserves Boolean values. -/ diff --git a/LeanPool/Chvatal/Correlation.lean b/LeanPool/Chvatal/Correlation.lean index 1cb0dda813..7b4eb36f68 100644 --- a/LeanPool/Chvatal/Correlation.lean +++ b/LeanPool/Chvatal/Correlation.lean @@ -48,7 +48,7 @@ as a boundary sum, a constant is subtracted from the second function, and the auxiliary orthonormal system bounds the resulting interior sum. -/ -@[expose] public section +public section open scoped BigOperators symmDiff diff --git a/LeanPool/Chvatal/Counting.lean b/LeanPool/Chvatal/Counting.lean index 3d82ef2579..526625f420 100644 --- a/LeanPool/Chvatal/Counting.lean +++ b/LeanPool/Chvatal/Counting.lean @@ -48,7 +48,7 @@ and the cube's uniform probability measure. They are the elementary counting steps in Section 4 of arXiv:2609.19123. -/ -@[expose] public section +public section open scoped BigOperators @@ -60,7 +60,7 @@ namespace Family variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- The real-valued indicator `𝟙_B` of a family, used in Section 4. -/ -def indicator (B : Family ι) (x : Finset ι) : ℝ := if x ∈ B then 1 else 0 +@[expose] def indicator (B : Family ι) (x : Finset ι) : ℝ := if x ∈ B then 1 else 0 omit [Fintype ι] in /-- Evaluating the Section 4 indicator at a member of its family. -/ @@ -310,7 +310,7 @@ theorem influence_le_four_covariance_iff {D B : Family ι} omit [Fintype ι] in /-- The star property asserted for each hereditary family in Theorem 1.1: every intersecting subfamily is no larger than some star. -/ -def HasStarProperty (D : Family ι) : Prop := +@[expose] def HasStarProperty (D : Family ι) : Prop := ∀ A : Family ι, A ⊆ D → A.IsIntersecting → ∃ i : ι, A.card ≤ (D.star i).card end Family @@ -321,7 +321,7 @@ variable {ι : Type*} [Fintype ι] [DecidableEq ι] coordinate attaining a bound instead of a finite minimum. On a nonempty ground type this is exactly `Cov(f,g) ≥ (1/4) min_i Inf_i[f]`. This is a proposition, not an assumption introduced into the logical environment. -/ -def AntipodalCorrelationBound (ι : Type*) [Fintype ι] [DecidableEq ι] : Prop := +@[expose] def AntipodalCorrelationBound (ι : Type*) [Fintype ι] [DecidableEq ι] : Prop := ∀ f g : Finset ι → ℝ, IsBoolean f → Monotone f → IsBoolean g → Monotone g → dual g = g → ∃ i : ι, influence f i ≤ 4 * covariance f g diff --git a/LeanPool/Chvatal/Family.lean b/LeanPool/Chvatal/Family.lean index c7b4f2cbf0..cfc2f7362d 100644 --- a/LeanPool/Chvatal/Family.lean +++ b/LeanPool/Chvatal/Family.lean @@ -52,7 +52,7 @@ intersecting on an empty ground type, but is not antipodal. Accordingly, Proposition 4.1 is stated for a nonempty ground type. -/ -@[expose] public section +public section namespace Chvatal @@ -83,7 +83,7 @@ def IsMaximalIntersecting (B : Family ι) : Prop := /-- The star `D_i = {S ∈ D : i ∈ S}` appearing in Chvátal's conjecture (Theorem 1.1 and Section 4). -/ -def star (D : Family ι) (i : ι) : Family ι := D.filter (i ∈ ·) +@[expose] def star (D : Family ι) (i : ι) : Family ι := D.filter (i ∈ ·) /-- Membership in the star from Theorem 1.1. -/ @[simp] theorem mem_star {D : Family ι} {i : ι} {S : Finset ι} : @@ -148,7 +148,7 @@ Sections 1–3. -/ /-- A family is antipodal when exactly one of each complementary pair belongs to it, as defined immediately before Proposition 4.1. -/ -def IsAntipodal (B : Family ι) : Prop := ∀ S : Finset ι, S ∈ B ↔ Sᶜ ∉ B +@[expose] def IsAntipodal (B : Family ι) : Prop := ∀ S : Finset ι, S ∈ B ↔ Sᶜ ∉ B /-- Antipodality is the self-duality condition used in Section 4. -/ theorem isAntipodal_iff_dual_eq (B : Family ι) : B.IsAntipodal ↔ B.dual = B := by diff --git a/LeanPool/Chvatal/Fourier.lean b/LeanPool/Chvatal/Fourier.lean index 93cde37077..a35d4931cd 100644 --- a/LeanPool/Chvatal/Fourier.lean +++ b/LeanPool/Chvatal/Fourier.lean @@ -52,7 +52,7 @@ This file develops the normalized Fourier–Walsh conventions used in Section 2 arXiv:2609.19123. A point of the cube is its set of coordinates equal to one. -/ -@[expose] public section +public section open scoped BigOperators symmDiff @@ -63,22 +63,22 @@ namespace Chvatal variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- Uniform expectation on the Boolean cube, as in the preliminaries of the paper. -/ -def cubeMean (f : Finset ι → ℝ) : ℝ := +@[expose] def cubeMean (f : Finset ι → ℝ) : ℝ := (∑ x, f x) / Fintype.card (Finset ι) /-- The Walsh character indexed by `S`, denoted `χ_S` in the paper. -/ def walsh (S x : Finset ι) : ℝ := (-1 : ℝ) ^ (S ∩ x).card /-- The normalized Fourier coefficient `f̂(S)` of Section 2. -/ -def fourier (f : Finset ι → ℝ) (S : Finset ι) : ℝ := +@[expose] def fourier (f : Finset ι → ℝ) (S : Finset ι) : ℝ := cubeMean (fun x => f x * walsh S x) /-- Covariance with respect to uniform measure, as used in the main theorem. -/ -def covariance (f g : Finset ι → ℝ) : ℝ := +@[expose] def covariance (f g : Finset ι → ℝ) : ℝ := cubeMean (fun x => f x * g x) - cubeMean f * cubeMean g /-- The dual Boolean function `f*(x) = 1 - f(1-x)` in the paper. -/ -def dual (f : Finset ι → ℝ) (x : Finset ι) : ℝ := 1 - f xᶜ +@[expose] def dual (f : Finset ι → ℝ) (x : Finset ι) : ℝ := 1 - f xᶜ omit [DecidableEq ι] in /-- The cube has positive cardinality, including when its coordinate set is empty. -/ diff --git a/LeanPool/Chvatal/Kernel.lean b/LeanPool/Chvatal/Kernel.lean index 14f835a640..a911682a49 100644 --- a/LeanPool/Chvatal/Kernel.lean +++ b/LeanPool/Chvatal/Kernel.lean @@ -46,7 +46,7 @@ This file proves the kernel calculation (8) and the lower bound (14) in the proo of Theorem 1.4. All sums are finite and the normalization is made explicit. -/ -@[expose] public section +public section open scoped BigOperators symmDiff diff --git a/LeanPool/Chvatal/LayerCake.lean b/LeanPool/Chvatal/LayerCake.lean index 7daec7517b..f9a9fd2b71 100644 --- a/LeanPool/Chvatal/LayerCake.lean +++ b/LeanPool/Chvatal/LayerCake.lean @@ -51,7 +51,7 @@ be replaced by repeatedly subtracting the smallest positive weight from its support. The support is a lower set, and each step strictly shrinks it. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Chvatal/Main.lean b/LeanPool/Chvatal/Main.lean index 7b25b27a55..ef804de7d4 100644 --- a/LeanPool/Chvatal/Main.lean +++ b/LeanPool/Chvatal/Main.lean @@ -53,7 +53,7 @@ The analytic statements allow an empty coordinate type. Statements involving a minimum coordinate or a star center explicitly require a nonempty coordinate type. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Chvatal/Optimization.lean b/LeanPool/Chvatal/Optimization.lean index 4aa5d46e71..ac65cb333a 100644 --- a/LeanPool/Chvatal/Optimization.lean +++ b/LeanPool/Chvatal/Optimization.lean @@ -48,7 +48,7 @@ from Theorem 1.4 of Chang–Liu–Liu, arXiv:2609.19123v1. Real division in Lean `0 / 0 = 0`, agreeing with the convention in the footnote to Theorem 1.2. -/ -@[expose] public section +public section namespace Chvatal diff --git a/LeanPool/Chvatal/Sharpness.lean b/LeanPool/Chvatal/Sharpness.lean index ebeac0a57f..2173c48c55 100644 --- a/LeanPool/Chvatal/Sharpness.lean +++ b/LeanPool/Chvatal/Sharpness.lean @@ -47,7 +47,7 @@ This file formalizes Proposition 5.1 and Remark 5.2 of arXiv:2609.19123. The AND function is the indicator of the top cube point; OR is its dual. -/ -@[expose] public section +public section open scoped BigOperators symmDiff diff --git a/LeanPool/Chvatal/Signed.lean b/LeanPool/Chvatal/Signed.lean index 9e433f0eef..4aa45148c6 100644 --- a/LeanPool/Chvatal/Signed.lean +++ b/LeanPool/Chvatal/Signed.lean @@ -49,7 +49,7 @@ This file verifies that conversion, the positive-part and Fourier identities, and the resulting signed version of the weighted star inequality. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Chvatal/Spectral.lean b/LeanPool/Chvatal/Spectral.lean index 3c9594836e..66c8586191 100644 --- a/LeanPool/Chvatal/Spectral.lean +++ b/LeanPool/Chvatal/Spectral.lean @@ -47,7 +47,7 @@ comparison (16) from Lemma 3.3. It also records the variance argument in Corollary 1.3. The parameter optimization is in `Chvatal.Optimization`. -/ -@[expose] public section +public section open scoped BigOperators symmDiff diff --git a/LeanPool/Chvatal/Weighted.lean b/LeanPool/Chvatal/Weighted.lean index c0468def9b..4a34946f5a 100644 --- a/LeanPool/Chvatal/Weighted.lean +++ b/LeanPool/Chvatal/Weighted.lean @@ -51,7 +51,7 @@ arguments below allow any fixed selector belonging to that set, a slightly stronger formulation which includes the paper's choice. -/ -@[expose] public section +public section open scoped BigOperators @@ -64,7 +64,7 @@ variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- Proposition 5.3's coefficients `λ_i`: four times the nonconstant Fourier mass assigned to coordinate `i`. The selector is fixed independently of the weight or hereditary family under consideration. -/ -def spectralWeights (g : Finset ι → ℝ) (select : Finset ι → ι) (i : ι) : ℝ := +@[expose] def spectralWeights (g : Finset ι → ℝ) (select : Finset ι → ι) (i : ι) : ℝ := 4 * ∑ S ∈ Finset.univ.erase ∅, if select S = i then fourier g S ^ 2 else 0 /-- Nonnegativity of every coefficient in Proposition 5.3. -/ diff --git a/LeanPool/CircuitComplexity.lean b/LeanPool/CircuitComplexity.lean index 1bbc6130fc..eb548f2213 100644 --- a/LeanPool/CircuitComplexity.lean +++ b/LeanPool/CircuitComplexity.lean @@ -35,7 +35,7 @@ Tags: circuit-complexity, boolean-functions, lower-bounds, shannon-bound, parity MSC: 68Q06, 94C11 -/ -@[expose] public section +public section /-! # Circuit Complexity diff --git a/LeanPool/CircuitComplexity/AC0.lean b/LeanPool/CircuitComplexity/AC0.lean index 47d6c2d79a..8c97b15ea0 100644 --- a/LeanPool/CircuitComplexity/AC0.lean +++ b/LeanPool/CircuitComplexity/AC0.lean @@ -18,7 +18,7 @@ This module re-exports the AC0 definitions and main results. unbounded fan-in AND/OR) -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/AC0/Defs.lean b/LeanPool/CircuitComplexity/AC0/Defs.lean index a2bdfb2826..c77236ed89 100644 --- a/LeanPool/CircuitComplexity/AC0/Defs.lean +++ b/LeanPool/CircuitComplexity/AC0/Defs.lean @@ -17,7 +17,7 @@ This module defines the AC0 circuit complexity class. unbounded fan-in AND/OR) -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/AON.lean b/LeanPool/CircuitComplexity/AON.lean index 546ba486a1..47ab9c30c9 100644 --- a/LeanPool/CircuitComplexity/AON.lean +++ b/LeanPool/CircuitComplexity/AON.lean @@ -28,7 +28,7 @@ This module provides the AND/OR basis definitions and completeness results. from `unboundedAON`, using `CompleteBasis.of_simulation` -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/AON/Defs.lean b/LeanPool/CircuitComplexity/AON/Defs.lean index 7c211f16c5..d2c39757c4 100644 --- a/LeanPool/CircuitComplexity/AON/Defs.lean +++ b/LeanPool/CircuitComplexity/AON/Defs.lean @@ -21,7 +21,7 @@ used throughout the circuit complexity library. * `Basis.andOr2` — fan-in exactly 2 AND/OR basis (used in Shannon/Schnorr bounds) -/ -@[expose] public section +public section namespace CircuitComplexity @@ -35,12 +35,12 @@ inductive AONOp where /-- Evaluate an AND or OR operation on `n` input bits by folding. AND folds with `&&` starting from `true`; OR folds with `||` from `false`. -/ -def AONOp.eval : (op : AONOp) → (n : Nat) → BitString n → Bool +@[expose] def AONOp.eval : (op : AONOp) → (n : Nat) → BitString n → Bool | .and, n, inputs => Fin.foldl n (fun acc i => acc && inputs i) true | .or, n, inputs => Fin.foldl n (fun acc i => acc || inputs i) false /-- AND/OR basis with unbounded fan-in. Negation is free (per-input flags on gates). -/ -def Basis.unboundedAON : Basis where +@[expose] def Basis.unboundedAON : Basis where Op := AONOp arity | .and => .unbounded @@ -48,7 +48,7 @@ def Basis.unboundedAON : Basis where eval op n _ inputs := op.eval n inputs /-- AND/OR basis with fan-in bounded by `k`. Negation is free (per-input flags on gates). -/ -def Basis.boundedAON (k : Nat) : Basis where +@[expose] def Basis.boundedAON (k : Nat) : Basis where Op := AONOp arity | .and => .upto k @@ -58,7 +58,7 @@ def Basis.boundedAON (k : Nat) : Basis where /-- Fan-in-2 AND/OR basis. Every gate has exactly 2 inputs. Negation is free (per-input flags on gates). This is the basis used in the Shannon and Schnorr lower bound theorems. -/ -def Basis.andOr2 : Basis where +@[expose] def Basis.andOr2 : Basis where Op := AONOp arity _ := .exactly 2 eval op n _ inputs := op.eval n inputs diff --git a/LeanPool/CircuitComplexity/Basic.lean b/LeanPool/CircuitComplexity/Basic.lean index 0d2d11dbb2..928b0f36fe 100644 --- a/LeanPool/CircuitComplexity/Basic.lean +++ b/LeanPool/CircuitComplexity/Basic.lean @@ -29,7 +29,7 @@ establishes the circuit size complexity measure for Boolean functions. * `Circuit.size_complexity_pos` — for complete bases, size complexity is positive -/ -@[expose] public section +public section namespace CircuitComplexity @@ -50,7 +50,7 @@ inductive Arity where deriving Repr, DecidableEq /-- Whether `n` satisfies an arity constraint. -/ -def Arity.satisfiedBy : Arity → Nat → Prop +@[expose] def Arity.satisfiedBy : Arity → Nat → Prop | .unbounded, _ => True | .exactly k, n => n = k | .upto k, n => n ≤ k @@ -90,7 +90,7 @@ structure Gate (B : Basis) (W : Nat) where negated : Fin fanIn → Bool /-- Evaluate a gate given a wire-value assignment. -/ -def Gate.eval (g : Gate B W) (wireVal : BitString W) : Bool := +@[expose] def Gate.eval (g : Gate B W) (wireVal : BitString W) : Bool := B.eval g.op g.fanIn g.arityOk (fun i => (g.negated i).xor (wireVal (g.inputs i))) /-- @@ -186,11 +186,11 @@ def depth (c : Circuit B N M G) : Nat := Fin.foldl M (fun acc j => max acc (c.outputDepth j)) 0 /-- Evaluate a circuit: map an `N`-bit input to an `M`-bit output. -/ -def eval (c : Circuit B N M G) (input : BitString N) : BitString M := +@[expose] def eval (c : Circuit B N M G) (input : BitString N) : BitString M := fun j => (c.outputs j).eval (c.wireValue input) /-- The size of a circuit is its total number of gates (internal + output). -/ -def size (c : Circuit B N M G) : Nat := +@[expose] def size (c : Circuit B N M G) : Nat := G + M + (c.outputs 0).fanIn * 0 end Circuit diff --git a/LeanPool/CircuitComplexity/Digraph/Defs.lean b/LeanPool/CircuitComplexity/Digraph/Defs.lean index 18fe6b6de6..8e8e204b47 100644 --- a/LeanPool/CircuitComplexity/Digraph/Defs.lean +++ b/LeanPool/CircuitComplexity/Digraph/Defs.lean @@ -21,7 +21,7 @@ arguments, edge partitions by first-differing bit, etc.) lives in `Circ.Internal.Valiant`. -/ -@[expose] public section +public section namespace Digraph @@ -29,11 +29,13 @@ variable {V : Type*} /-- `G.IsDirectedPath p` says that `p : Fin m → V` is a directed walk in the digraph `G`: consecutive vertices are joined by an edge. -/ +@[expose] def IsDirectedPath (G : Digraph V) {m : Nat} (p : Fin m → V) : Prop := ∀ i : Fin m, ∀ h : i.val + 1 < m, G.Adj (p i) (p ⟨i.val + 1, h⟩) /-- `G.IsSimplePath p` says that `p : Fin m → V` is a *simple* directed path: an injective directed walk. -/ +@[expose] def IsSimplePath (G : Digraph V) {m : Nat} (p : Fin m → V) : Prop := G.IsDirectedPath p ∧ Function.Injective p @@ -41,7 +43,7 @@ def IsSimplePath (G : Digraph V) {m : Nat} (p : Fin m → V) : Prop := longest directed walk in it. Walks are not required to be injective, so cyclic graphs have `depth = 0` by the `Nat.sSup` convention on unbounded sets. -/ -noncomputable def depth (G : Digraph V) : Nat := +@[expose] noncomputable def depth (G : Digraph V) : Nat := sSup { m | ∃ p : Fin m → V, G.IsDirectedPath p } /-- The directed edge set of a digraph with decidable adjacency on a @@ -57,7 +59,7 @@ lemma mem_edgeFinset [Fintype V] [DecidableEq V] {G : Digraph V} /-- The digraph obtained from `G` by deleting a finite set of directed edges `F`. -/ -def deleteEdges (G : Digraph V) (F : Finset (V × V)) : Digraph V where +@[expose] def deleteEdges (G : Digraph V) (F : Finset (V × V)) : Digraph V where Adj u v := G.Adj u v ∧ (u, v) ∉ F instance [DecidableEq V] (G : Digraph V) [DecidableRel G.Adj] @@ -67,6 +69,7 @@ instance [DecidableEq V] (G : Digraph V) [DecidableRel G.Adj] /-- A digraph is **acyclic** when its set of directed-walk lengths is bounded. For finite vertex types this is equivalent to having no directed cycles. -/ +@[expose] def IsAcyclic (G : Digraph V) : Prop := BddAbove { m | ∃ p : Fin m → V, G.IsDirectedPath p } diff --git a/LeanPool/CircuitComplexity/EssentialInput.lean b/LeanPool/CircuitComplexity/EssentialInput.lean index cfa78f5583..dd0b77ce9c 100644 --- a/LeanPool/CircuitComplexity/EssentialInput.lean +++ b/LeanPool/CircuitComplexity/EssentialInput.lean @@ -19,14 +19,14 @@ for a Boolean function. * `EssentialInputs` — the set of essential input variables -/ -@[expose] public section +public section namespace CircuitComplexity /-- A function `f` depends on input variable `i` if flipping that bit can change some output. -/ -def IsEssentialInput {N M : Nat} (f : BitString N → BitString M) (i : Fin N) : Prop := +@[expose] def IsEssentialInput {N M : Nat} (f : BitString N → BitString M) (i : Fin N) : Prop := ∃ x : BitString N, f x ≠ f (Function.update x i (!x i)) instance {N M : Nat} {f : BitString N → BitString M} {i : Fin N} : @@ -34,7 +34,7 @@ instance {N M : Nat} {f : BitString N → BitString M} {i : Fin N} : inferInstanceAs (Decidable (∃ x, f x ≠ f (Function.update x i (!x i)))) /-- The set of input variables that `f` depends on. -/ -def EssentialInputs {N M : Nat} (f : BitString N → BitString M) : Finset (Fin N) := +@[expose] def EssentialInputs {N M : Nat} (f : BitString N → BitString M) : Finset (Fin N) := Finset.univ.filter (IsEssentialInput f) end CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/AON.lean b/LeanPool/CircuitComplexity/Internal/AON.lean index 4282e1717f..07053a895c 100644 --- a/LeanPool/CircuitComplexity/Internal/AON.lean +++ b/LeanPool/CircuitComplexity/Internal/AON.lean @@ -14,7 +14,7 @@ via DNF (disjunctive normal form) construction. The basis definitions are in `Circ.AON.Defs`; this module is re-exported through `Circ.AON`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/Bridge.lean b/LeanPool/CircuitComplexity/Internal/Bridge.lean index 9b37a09179..81bd6531fc 100644 --- a/LeanPool/CircuitComplexity/Internal/Bridge.lean +++ b/LeanPool/CircuitComplexity/Internal/Bridge.lean @@ -27,7 +27,7 @@ The public theorems `shannon_lower_bound_circuit` and `Circ.Schnorr` respectively. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/CircDesc.lean b/LeanPool/CircuitComplexity/Internal/CircDesc.lean index 31142c9864..ee737f51f5 100644 --- a/LeanPool/CircuitComplexity/Internal/CircDesc.lean +++ b/LeanPool/CircuitComplexity/Internal/CircDesc.lean @@ -21,7 +21,7 @@ theorem `shannon_lower_bound_circuit` (which speaks in terms of `Circuit`) is in `Circ.Internal.Bridge`. -/ -@[expose] public section +public section namespace CircuitComplexity @@ -43,7 +43,7 @@ abbrev CircDesc (N s : Nat) := Fin s → GateSlot (N + s) /-- Evaluate wire `w` in a circuit descriptor. Primary input wires return the corresponding input bit. Gate wires evaluate their gate, with forward references defaulting to `false`. -/ -def wireValD {N s : Nat} (d : CircDesc N s) (input : BitString N) +@[expose] def wireValD {N s : Nat} (d : CircDesc N s) (input : BitString N) (w : Fin (N + s)) : Bool := if h : w.val < N then input ⟨w.val, h⟩ @@ -56,7 +56,7 @@ def wireValD {N s : Nat} (d : CircDesc N s) (input : BitString N) termination_by w.val /-- Evaluate a circuit descriptor: the output is the value of the last gate. -/ -def evalD {N s : Nat} (hs : 0 < s) (d : CircDesc N s) : BitString N → Bool := +@[expose] def evalD {N s : Nat} (hs : 0 < s) (d : CircDesc N s) : BitString N → Bool := fun input => wireValD d input ⟨N + s - 1, by omega⟩ /-! ## Cardinality Lemmas -/ diff --git a/LeanPool/CircuitComplexity/Internal/LowerBound.lean b/LeanPool/CircuitComplexity/Internal/LowerBound.lean index 36e4a0efe1..9e244e7c4b 100644 --- a/LeanPool/CircuitComplexity/Internal/LowerBound.lean +++ b/LeanPool/CircuitComplexity/Internal/LowerBound.lean @@ -21,7 +21,7 @@ The public definitions (`IsEssentialInput`, `EssentialInputs`) are in `lower_bound_all_inputs`) are accessible through `Circ.LowerBound`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/NF.lean b/LeanPool/CircuitComplexity/Internal/NF.lean index 19ba20acc4..9423f03c38 100644 --- a/LeanPool/CircuitComplexity/Internal/NF.lean +++ b/LeanPool/CircuitComplexity/Internal/NF.lean @@ -26,7 +26,7 @@ This internal module contains the proof infrastructure for CNF/DNF: The public interface re-exports the main theorems from `Circ.NF`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/Nondeterminism.lean b/LeanPool/CircuitComplexity/Internal/Nondeterminism.lean index d8605488ff..40f9d6e4f5 100644 --- a/LeanPool/CircuitComplexity/Internal/Nondeterminism.lean +++ b/LeanPool/CircuitComplexity/Internal/Nondeterminism.lean @@ -45,7 +45,7 @@ The OR of two Boolean functions has circuit complexity bounded by the sum of their complexities plus one, using `ShannonUpper.binopCircuit`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/Schnorr.lean b/LeanPool/CircuitComplexity/Internal/Schnorr.lean index 6f69b77869..b51a9c239d 100644 --- a/LeanPool/CircuitComplexity/Internal/Schnorr.lean +++ b/LeanPool/CircuitComplexity/Internal/Schnorr.lean @@ -19,7 +19,7 @@ The public definitions (`Schnorr.xorBool`, `Schnorr.xorBool_flip`, `schnorr_lower_bound_circuit` is accessible through `Circ.Schnorr`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/ShannonUpper.lean b/LeanPool/CircuitComplexity/Internal/ShannonUpper.lean index 7d73f588ff..dfba54698f 100644 --- a/LeanPool/CircuitComplexity/Internal/ShannonUpper.lean +++ b/LeanPool/CircuitComplexity/Internal/ShannonUpper.lean @@ -37,7 +37,7 @@ for column functions, AND/OR combining layers. Total ≤ `18 · 2^N / N` gates for `N ≥ 16`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Internal/Simulation.lean b/LeanPool/CircuitComplexity/Internal/Simulation.lean index 4ba30b599d..90cc17dba3 100644 --- a/LeanPool/CircuitComplexity/Internal/Simulation.lean +++ b/LeanPool/CircuitComplexity/Internal/Simulation.lean @@ -31,7 +31,7 @@ gates followed by chains for all original output gates. The new output gates are trivial passthroughs reading the last wire of each output chain. -/ -@[expose] public section +public section namespace CircuitComplexity @@ -94,7 +94,7 @@ namespace CompileAON /-! ## Chain length and prefix sums -/ /-- Number of fan-in-2 gates needed to simulate one gate with `k` inputs. -/ -def chainLen (k : Nat) : Nat := if k ≤ 1 then 1 else k - 1 +@[expose] def chainLen (k : Nat) : Nat := if k ≤ 1 then 1 else k - 1 @[simp] lemma chainLen_zero : chainLen 0 = 1 := rfl @[simp] lemma chainLen_one : chainLen 1 = 1 := rfl @@ -106,7 +106,7 @@ lemma chainLen_of_ge_two {k : Nat} (hk : 2 ≤ k) : chainLen k = k - 1 := by rw [chainLen, ite_eq_right (by omega)] /-- Prefix sum: `prefixSum f n = f 0 + f 1 + ⋯ + f (n-1)`. -/ -def prefixSum (f : Nat → Nat) : Nat → Nat +@[expose] def prefixSum (f : Nat → Nat) : Nat → Nat | 0 => 0 | n + 1 => prefixSum f n + f n @@ -268,7 +268,7 @@ lemma remapWire_lt_oOffset (c : Circuit Basis.unboundedAON N M G) (w : Fin (N + /-! ## Chain gate construction -/ /-- Helper: construct a function `Fin 2 → α` from two values. -/ -def fin2 (a b : α) : Fin 2 → α := fun i => if i.val = 0 then a else b +@[expose] def fin2 (a b : α) : Fin 2 → α := fun i => if i.val = 0 then a else b @[simp] lemma fin2_zero (a b : α) : fin2 a b 0 = a := rfl @[simp] lemma fin2_one (a b : α) : fin2 a b 1 = b := rfl diff --git a/LeanPool/CircuitComplexity/Internal/Valiant.lean b/LeanPool/CircuitComplexity/Internal/Valiant.lean index 5f680a3d01..e4b032fa51 100644 --- a/LeanPool/CircuitComplexity/Internal/Valiant.lean +++ b/LeanPool/CircuitComplexity/Internal/Valiant.lean @@ -25,7 +25,7 @@ labeling argument, the edge partition by first-differing bit, the averaging step, and the relabeling-after-removal bound. -/ -@[expose] public section +public section namespace Digraph @@ -349,6 +349,7 @@ variable [DecidableEq V] /-- Edges whose canonical-label endpoints' `k`-bit binary representations first disagree at MSB position `i`. -/ +@[expose] noncomputable def levelEdges (G : Digraph V) [DecidableRel G.Adj] (k i : ℕ) : Finset (V × V) := G.edgeFinset.filter (fun e => diff --git a/LeanPool/CircuitComplexity/LowerBound.lean b/LeanPool/CircuitComplexity/LowerBound.lean index df4de71eee..499da70a1e 100644 --- a/LeanPool/CircuitComplexity/LowerBound.lean +++ b/LeanPool/CircuitComplexity/LowerBound.lean @@ -49,7 +49,7 @@ And its corollary for functions that depend on all inputs: N ≤ k * c.size -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/NF.lean b/LeanPool/CircuitComplexity/NF.lean index 3e0b25439b..b45506d2cf 100644 --- a/LeanPool/CircuitComplexity/NF.lean +++ b/LeanPool/CircuitComplexity/NF.lean @@ -33,7 +33,7 @@ De Morgan duality (`CNF.neg`). * `CNF.xorBool_complexity_lb` — any CNF computing XOR has `≥ 2^{N-1}` clauses -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/NF/Defs.lean b/LeanPool/CircuitComplexity/NF/Defs.lean index 53ace4e507..cdf4915353 100644 --- a/LeanPool/CircuitComplexity/NF/Defs.lean +++ b/LeanPool/CircuitComplexity/NF/Defs.lean @@ -23,7 +23,7 @@ complexity measures, and De Morgan negation duality. * `CNF.neg` / `DNF.neg` — De Morgan negation (CNF ↔ DNF) -/ -@[expose] public section +public section namespace CircuitComplexity @@ -40,7 +40,7 @@ structure Literal (N : Nat) where deriving DecidableEq /-- Evaluate a literal on a bit assignment. -/ -def Literal.eval (l : Literal N) (x : BitString N) : Bool := +@[expose] def Literal.eval (l : Literal N) (x : BitString N) : Bool := if l.polarity then x l.var else !x l.var /-- Negate a literal by flipping its polarity. -/ @@ -69,11 +69,12 @@ namespace CNF /-- A CNF formula evaluates to `true` iff every clause contains at least one satisfied literal. -/ +@[expose] def eval (φ : CNF N) (x : BitString N) : Bool := φ.clauses.all fun clause => clause.any fun l => l.eval x /-- The complexity of a CNF formula is its number of clauses. -/ -def complexity (φ : CNF N) : Nat := φ.clauses.length +@[expose] def complexity (φ : CNF N) : Nat := φ.clauses.length end CNF @@ -92,11 +93,11 @@ namespace DNF /-- A DNF formula evaluates to `true` iff at least one term has all its literals satisfied. -/ -def eval (φ : DNF N) (x : BitString N) : Bool := +@[expose] def eval (φ : DNF N) (x : BitString N) : Bool := φ.terms.any fun term => term.all fun l => l.eval x /-- The complexity of a DNF formula is its number of terms. -/ -def complexity (φ : DNF N) : Nat := φ.terms.length +@[expose] def complexity (φ : DNF N) : Nat := φ.terms.length end DNF diff --git a/LeanPool/CircuitComplexity/Nondeterminism.lean b/LeanPool/CircuitComplexity/Nondeterminism.lean index a2e764a5d8..2cd06ea657 100644 --- a/LeanPool/CircuitComplexity/Nondeterminism.lean +++ b/LeanPool/CircuitComplexity/Nondeterminism.lean @@ -58,7 +58,7 @@ The naive bound is tighter when `k` is small and `f` has low complexity; the Shannon bound wins when `k` is large, regardless of `f`'s complexity. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Nondeterminism/Defs.lean b/LeanPool/CircuitComplexity/Nondeterminism/Defs.lean index c8c2128896..769283704c 100644 --- a/LeanPool/CircuitComplexity/Nondeterminism/Defs.lean +++ b/LeanPool/CircuitComplexity/Nondeterminism/Defs.lean @@ -33,7 +33,7 @@ guesses the first `k` input bits. * `existQuantify_mono` — monotonicity under pointwise implication -/ -@[expose] public section +public section namespace CircuitComplexity @@ -45,7 +45,7 @@ variable {k m : Nat} `g(y) = true` iff `∃ x : BitString k, f(x ++ y) = true`. This models a nondeterministic circuit that guesses the first `k` inputs. -/ -def existQuantify (f : BitString (k + m) → Bool) : BitString m → Bool := +@[expose] def existQuantify (f : BitString (k + m) → Bool) : BitString m → Bool := fun y => decide (∃ x : BitString k, f (Fin.append x y) = true) /-- Universal quantification over the first `k` inputs of a Boolean function. -/ @@ -121,7 +121,7 @@ theorem forallQuantify_const_false : /-- Restrict a Boolean function by fixing its first input to a constant. Reduces the input size from `(k + 1) + m` to `k + m`. -/ -def restrictFirst (f : BitString ((k + 1) + m) → Bool) (b : Bool) : +@[expose] def restrictFirst (f : BitString ((k + 1) + m) → Bool) (b : Bool) : BitString (k + m) → Bool := fun z => f (fun i => if h : i.val = 0 then b else z ⟨i.val - 1, by omega⟩) diff --git a/LeanPool/CircuitComplexity/Schnorr.lean b/LeanPool/CircuitComplexity/Schnorr.lean index 04fe681373..30801a619b 100644 --- a/LeanPool/CircuitComplexity/Schnorr.lean +++ b/LeanPool/CircuitComplexity/Schnorr.lean @@ -48,7 +48,7 @@ When `Basis.andOr2` is known to be complete, this yields a `sizeComplexity` bound via `schnorr_size_complexity`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Shannon.lean b/LeanPool/CircuitComplexity/Shannon.lean index 7577e0f7ed..7fbe7db635 100644 --- a/LeanPool/CircuitComplexity/Shannon.lean +++ b/LeanPool/CircuitComplexity/Shannon.lean @@ -48,7 +48,7 @@ When `Basis.andOr2` is known to be complete, this yields a Together these establish that worst-case circuit complexity is `Θ(2^N / N)`. -/ -@[expose] public section +public section namespace CircuitComplexity diff --git a/LeanPool/CircuitComplexity/Valiant.lean b/LeanPool/CircuitComplexity/Valiant.lean index 45caf539be..ac480d5b74 100644 --- a/LeanPool/CircuitComplexity/Valiant.lean +++ b/LeanPool/CircuitComplexity/Valiant.lean @@ -40,7 +40,7 @@ first-differing bit, averaging, and the relabeling-after-removal bound — lives in `Circ.Internal.Valiant`. -/ -@[expose] public section +public section namespace CircuitComplexity.Valiant diff --git a/LeanPool/CircuitComplexity/XOR.lean b/LeanPool/CircuitComplexity/XOR.lean index 9df6ffda8b..bd45b656b6 100644 --- a/LeanPool/CircuitComplexity/XOR.lean +++ b/LeanPool/CircuitComplexity/XOR.lean @@ -21,7 +21,7 @@ This module defines the N-input XOR function and its key properties. * `Schnorr.xorBool_essential` — XOR depends on all inputs -/ -@[expose] public section +public section namespace CircuitComplexity @@ -29,7 +29,7 @@ namespace CircuitComplexity namespace Schnorr /-- The N-input XOR (parity) function. -/ -def xorBool : (N : Nat) → BitString N → Bool +@[expose] def xorBool : (N : Nat) → BitString N → Bool | 0, _ => false | _ + 1, x => (x 0).xor (xorBool _ (x ∘ Fin.succ)) diff --git a/LeanPool/Circuitlib.lean b/LeanPool/Circuitlib.lean index 91bf29a855..93e9e4395c 100644 --- a/LeanPool/Circuitlib.lean +++ b/LeanPool/Circuitlib.lean @@ -19,4 +19,4 @@ Tags: circuits, hardware, category-theory, combinational, sequential MSC: 18M05, 68Q60, 94C11 -/ -@[expose] public section +public section diff --git a/LeanPool/Circuitlib/Circuit/Basic.lean b/LeanPool/Circuitlib/Circuit/Basic.lean index 0c252bef40..cf34106b78 100644 --- a/LeanPool/Circuitlib/Circuit/Basic.lean +++ b/LeanPool/Circuitlib/Circuit/Basic.lean @@ -19,7 +19,7 @@ public import LeanPool.Circuitlib.Circuit.Belnap.Gate -/ -@[expose] public section +public section namespace Circuit diff --git a/LeanPool/Circuitlib/Circuit/Belnap/Basic.lean b/LeanPool/Circuitlib/Circuit/Belnap/Basic.lean index 0e4207c71a..ca81a5813c 100644 --- a/LeanPool/Circuitlib/Circuit/Belnap/Basic.lean +++ b/LeanPool/Circuitlib/Circuit/Belnap/Basic.lean @@ -17,14 +17,14 @@ public import LeanPool.Circuitlib.Circuit.Wires -/ -@[expose] public section +public section namespace Circuit namespace Belnap /-- The AND wire-function on a pair of Belnap-valued wires. -/ -@[inline] +@[expose, inline] def and (w : Wires BelnapLevel 2) : Wires BelnapLevel 1 := #v[(w.get 0).and (w.get 1)] @[simp] @@ -44,7 +44,7 @@ lemma and_monotonic : Monotone and := by exact and_leq (hab 0) (hab 1) /-- The OR wire-function on a pair of Belnap-valued wires. -/ -@[inline] +@[expose, inline] def or (w : Wires BelnapLevel 2) : Wires BelnapLevel 1 := #v[(w.get 0).or (w.get 1)] @[simp] @@ -64,7 +64,7 @@ lemma or_monotonic : Monotone or := by exact or_leq (hab 0) (hab 1) /-- The NOT wire-function on a single Belnap-valued wire. -/ -@[inline] +@[expose, inline] def not (w : Wires BelnapLevel 1) : Wires BelnapLevel 1 := #v[ (w.get 0).not ] @[simp] diff --git a/LeanPool/Circuitlib/Circuit/Belnap/Gate.lean b/LeanPool/Circuitlib/Circuit/Belnap/Gate.lean index bfc5fe9f6a..74236918d1 100644 --- a/LeanPool/Circuitlib/Circuit/Belnap/Gate.lean +++ b/LeanPool/Circuitlib/Circuit/Belnap/Gate.lean @@ -17,7 +17,7 @@ public import LeanPool.Circuitlib.Circuit.Gate -/ -@[expose] public section +public section namespace Circuit diff --git a/LeanPool/Circuitlib/Circuit/Belnap/Level.lean b/LeanPool/Circuitlib/Circuit/Belnap/Level.lean index 9abaaae169..16f8d09e0e 100644 --- a/LeanPool/Circuitlib/Circuit/Belnap/Level.lean +++ b/LeanPool/Circuitlib/Circuit/Belnap/Level.lean @@ -16,13 +16,13 @@ public import Mathlib.Order.WithBotTop -/ -@[expose] public section +public section namespace Circuit /-- The Belnap four-valued logic lattice on `Bool`, with a bottom (no information) and a top (conflicting information) adjoined. -/ -def BelnapLevel := WithBotTop Bool +@[expose] def BelnapLevel := WithBotTop Bool namespace BelnapLevel @@ -37,7 +37,7 @@ instance : Top BelnapLevel where /-- The information ordering on Belnap levels: `⊥` is below everything, everything is below `⊤`, and the two classical values are only related to themselves. -/ -@[inline] +@[expose, inline] def le : BelnapLevel → BelnapLevel → Prop | ⊥, _ => true | _, ⊤ => true @@ -83,7 +83,7 @@ instance : SemilatticeSup BelnapLevel where sup_le /-- Logical AND. -/ -@[inline] +@[expose, inline] def and (a b : BelnapLevel) : BelnapLevel := match a, b with | .some (.some false), _ => false | _, .some (.some false) => false @@ -94,7 +94,7 @@ def and (a b : BelnapLevel) : BelnapLevel := match a, b with | _, _ => false /-- Logical OR. -/ -@[inline] +@[expose, inline] def or (a b : BelnapLevel) : BelnapLevel := match a, b with | .some (.some true), _ => true | _, .some (.some true) => true @@ -105,7 +105,7 @@ def or (a b : BelnapLevel) : BelnapLevel := match a, b with | _, _ => true /-- Logical NOT. -/ -@[inline] +@[expose, inline] def not : BelnapLevel → BelnapLevel | .some (.some b) => !b | x => x diff --git a/LeanPool/Circuitlib/Circuit/Category/Basic.lean b/LeanPool/Circuitlib/Circuit/Category/Basic.lean index d27db8f7fc..217303138e 100644 --- a/LeanPool/Circuitlib/Circuit/Category/Basic.lean +++ b/LeanPool/Circuitlib/Circuit/Category/Basic.lean @@ -16,7 +16,7 @@ public import Mathlib.CategoryTheory.Category.Basic -/ -@[expose] public section +public section namespace Circuit diff --git a/LeanPool/Circuitlib/Circuit/Category/Combinational.lean b/LeanPool/Circuitlib/Circuit/Category/Combinational.lean index bb7366cf07..0c20b14ecb 100644 --- a/LeanPool/Circuitlib/Circuit/Category/Combinational.lean +++ b/LeanPool/Circuitlib/Circuit/Category/Combinational.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Attr.Core -/ -@[expose] public section +public section namespace Circuit @@ -39,18 +39,18 @@ universe u v variable {V : Type v} {G : Type u} /-- Homomorphism. -/ -def Hom (V : Type v) [Preorder V] (I O : CombinationalCircuitCategory V G) := +@[expose] def Hom (V : Type v) [Preorder V] (I O : CombinationalCircuitCategory V G) := { f : Wires V I.obj → Wires V O.obj // Monotone f } /-- The underlying identity wire-function. -/ -@[inline, simp] +@[expose, inline, simp] def idVal : Wires V n → Wires V n := fun x => x @[simp] lemma id_monotone [Preorder V] : Monotone (idVal (V:=V) (n:=n)) := monotone_id /-- The identity morphism. -/ -@[inline, simp] +@[expose, inline, simp] def id [Preorder V] : CombinationalCircuitCategory.Hom V X X := ⟨idVal, id_monotone⟩ open CategoryTheory @@ -71,7 +71,7 @@ lemma id_coe_apply (𝟙 X : Hom V X X).val v = v := rfl /-- The wire-function that duplicates its single input wire. -/ -@[inline, simp] +@[expose, inline, simp] def fork (w : Wires V 1) : Wires V 2 := #v[w.get 0, w.get 0] @[simp] @@ -261,7 +261,7 @@ lemma iso_inv_hom_id apply Subtype.ext; funext v; rfl /-- The isomorphism between objects with equal wire counts. -/ -@[inline, simp] +@[expose, inline, simp] def iso (h : n = m) : CombinationalCircuitCategory.of V G n ≅ CombinationalCircuitCategory.of V G m := @@ -359,7 +359,7 @@ lemma tensorHom_comp_tensorHom exact tensorHom_eq_right v k f₁ f₂)) /-- The monoidal unit, the object with no wires. -/ -@[inline, simp] +@[expose, inline, simp] def tensorUnit : CombinationalCircuitCategory V G := .of V G 0 omit [SemilatticeSup V] in @@ -370,7 +370,7 @@ lemma associator_eq Nat.add_assoc X.obj Y.obj Z.obj /-- The associator isomorphism of the monoidal structure. -/ -@[inline, simp] +@[expose, inline, simp] def associator (X Y Z : CombinationalCircuitCategory V G) : (X.tensorObj Y).tensorObj Z ≅ X.tensorObj (Y.tensorObj Z) := @@ -551,7 +551,7 @@ lemma braiding_hom_monotone split_ifs <;> exact hab _ /-- The braiding morphism, swapping two blocks of wires. -/ -@[inline, simp] +@[expose, inline, simp] def braidingHom (X Y : CombinationalCircuitCategory V G) : X ⊗ Y ⟶ Y ⊗ X := ⟨braidingHomVal X Y, braiding_hom_monotone⟩ @@ -568,7 +568,7 @@ lemma braiding_hom_inv_id split_ifs <;> exact congrArg v.get (Fin.ext (by simp <;> omega)) /-- The braiding isomorphism of the symmetric monoidal structure. -/ -@[inline, simp] +@[expose, inline, simp] def braiding (X Y : CombinationalCircuitCategory V G) : X ⊗ Y ≅ Y ⊗ X := { hom := braidingHom X Y inv := braidingHom Y X diff --git a/LeanPool/Circuitlib/Circuit/Category/Sequential.lean b/LeanPool/Circuitlib/Circuit/Category/Sequential.lean index b853b5e6a4..28835e70e3 100644 --- a/LeanPool/Circuitlib/Circuit/Category/Sequential.lean +++ b/LeanPool/Circuitlib/Circuit/Category/Sequential.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Attr.Core -/ -@[expose] public section +public section namespace Circuit @@ -36,7 +36,7 @@ instance : OfNat (SequentialCircuitCategory V G) n where namespace SequentialCircuitCategory /-- A stream of values, i.e. an infinite sequence indexed by time. -/ -@[inline] +@[expose, inline] def Stream := Stream' instance [Preorder α] : Preorder (Stream α) where @@ -56,15 +56,16 @@ universe u v variable {V : Type v} {G : Type u} /-- A stream function is causal if the output at time `t` depends only on inputs up to time `t`. -/ +@[expose] def Causal (f : Stream α → Stream β) : Prop := ∀ (x y : Stream α) (t : ℕ), (∀ s, s ≤ t → x s = y s) → f x t = f y t /-- Homomorphism. -/ -def Hom (V : Type v) [Preorder V] (I O : SequentialCircuitCategory V G) := +@[expose] def Hom (V : Type v) [Preorder V] (I O : SequentialCircuitCategory V G) := { f : Stream (Wires V I.obj) → Stream (Wires V O.obj) // Monotone f ∧ Causal f } /-- The underlying identity wire-function. -/ -@[inline, simp] +@[expose, inline, simp] def idVal : Stream (Wires V n) → Stream (Wires V n) := fun x => x variable [Preorder V] @@ -77,7 +78,7 @@ omit [Preorder V] in lemma id_causal : Causal (idVal (V:=V) (n:=n)) := fun _ _ t h => h t le_rfl /-- The identity morphism. -/ -@[inline, simp] +@[expose, inline, simp] def id : SequentialCircuitCategory.Hom V X X := ⟨idVal, ⟨id_monotone, id_causal⟩⟩ open CategoryTheory diff --git a/LeanPool/Circuitlib/Circuit/Combinational.lean b/LeanPool/Circuitlib/Circuit/Combinational.lean index e9eb084400..4b1fe6425f 100644 --- a/LeanPool/Circuitlib/Circuit/Combinational.lean +++ b/LeanPool/Circuitlib/Circuit/Combinational.lean @@ -17,7 +17,7 @@ public import LeanPool.Circuitlib.Circuit.Basic -/ -@[expose] public section +public section namespace Circuit diff --git a/LeanPool/Circuitlib/Circuit/Gate.lean b/LeanPool/Circuitlib/Circuit/Gate.lean index ac80530d7c..3ed7a0e274 100644 --- a/LeanPool/Circuitlib/Circuit/Gate.lean +++ b/LeanPool/Circuitlib/Circuit/Gate.lean @@ -16,7 +16,7 @@ public import Mathlib.Order.Monotone.Defs -/ -@[expose] public section +public section namespace Circuit diff --git a/LeanPool/Circuitlib/Circuit/Wires.lean b/LeanPool/Circuitlib/Circuit/Wires.lean index 6cff166016..1544469a30 100644 --- a/LeanPool/Circuitlib/Circuit/Wires.lean +++ b/LeanPool/Circuitlib/Circuit/Wires.lean @@ -16,12 +16,12 @@ public import Mathlib.Order.Defs.PartialOrder -/ -@[expose] public section +public section namespace Circuit /-- A bundle of `I` wires, each carrying a value of type `V`. -/ -def Wires (V : Type u) (I : ℕ) := Vector V I +@[expose] def Wires (V : Type u) (I : ℕ) := Vector V I instance [Preorder V] : Preorder (Wires V I) where le a b := ∀ i : Fin I, a.get i ≤ b.get i diff --git a/LeanPool/ClassificationOfSurfaces.lean b/LeanPool/ClassificationOfSurfaces.lean index 1fba4961b6..04a1ab4f02 100644 --- a/LeanPool/ClassificationOfSurfaces.lean +++ b/LeanPool/ClassificationOfSurfaces.lean @@ -150,4 +150,4 @@ Tags: geometric-topology, low-dimensional-topology, surfaces, manifolds, triangu MSC: 57K20, 57N05 -/ -@[expose] public section +public section diff --git a/LeanPool/ClassificationOfSurfaces/API.lean b/LeanPool/ClassificationOfSurfaces/API.lean index 11b79a6cf4..8d88a32397 100644 --- a/LeanPool/ClassificationOfSurfaces/API.lean +++ b/LeanPool/ClassificationOfSurfaces/API.lean @@ -520,7 +520,7 @@ invariance of domain. `LeanEval/SpecAudit.lean` checks that the current public t is the exact published Lean-Eval type over the vendored disc relations. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Basic.lean b/LeanPool/ClassificationOfSurfaces/Basic.lean index 4ff847aa00..5962b36385 100644 --- a/LeanPool/ClassificationOfSurfaces/Basic.lean +++ b/LeanPool/ClassificationOfSurfaces/Basic.lean @@ -20,4 +20,4 @@ This module re-exports the current project skeleton for the Lean Eval challenge `topological_classification_of_surfaces`. -/ -@[expose] public section +public section diff --git a/LeanPool/ClassificationOfSurfaces/CanonicalCoordinates.lean b/LeanPool/ClassificationOfSurfaces/CanonicalCoordinates.lean index ff2543f53c..bedbad08df 100644 --- a/LeanPool/ClassificationOfSurfaces/CanonicalCoordinates.lean +++ b/LeanPool/ClassificationOfSurfaces/CanonicalCoordinates.lean @@ -21,7 +21,7 @@ negative angles using `Fin.rev` and integral periodicity. The resulting theorems five canonical pairing families into the corresponding trusted equivalence closure. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces.NormalForm diff --git a/LeanPool/ClassificationOfSurfaces/CanonicalGeneratorMaps.lean b/LeanPool/ClassificationOfSurfaces/CanonicalGeneratorMaps.lean index a3492c8e8f..8e81c0753e 100644 --- a/LeanPool/ClassificationOfSurfaces/CanonicalGeneratorMaps.lean +++ b/LeanPool/ClassificationOfSurfaces/CanonicalGeneratorMaps.lean @@ -23,7 +23,7 @@ maps identify the generated equivalence relations and descend the one-face carri to the canonical quotient spaces. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces.NormalForm diff --git a/LeanPool/ClassificationOfSurfaces/CanonicalPairings.lean b/LeanPool/ClassificationOfSurfaces/CanonicalPairings.lean index 4f54f3d9d9..e5c4b1f09c 100644 --- a/LeanPool/ClassificationOfSurfaces/CanonicalPairings.lean +++ b/LeanPool/ClassificationOfSurfaces/CanonicalPairings.lean @@ -21,7 +21,7 @@ opposite-parameter boundary-seam pairings. The orientable generators are opposit orders. The free `h` dart in each boundary block occurs only once and contributes no gluing. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/CanonicalWords.lean b/LeanPool/ClassificationOfSurfaces/CanonicalWords.lean index b1ecbedc56..4f9c7ef18b 100644 --- a/LeanPool/ClassificationOfSurfaces/CanonicalWords.lean +++ b/LeanPool/ClassificationOfSurfaces/CanonicalWords.lean @@ -26,7 +26,7 @@ certificates. Their faithful polygonal realizations are compared with the closed defined in `LeanEval/ChallengeDeps.lean` by the canonical realization layer. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -67,32 +67,32 @@ inductive NonOrientableEdge (p n : ℕ) deriving DecidableEq, Repr, Fintype /-- The commutator block `aᵢ bᵢ aᵢ⁻¹ bᵢ⁻¹`. -/ -def orientableHandleBlock {p n : ℕ} (i : Fin p) : +@[expose] def orientableHandleBlock {p n : ℕ} (i : Fin p) : List (SignedDart (OrientableEdge p n)) := [.pos (.a i), .pos (.b i), .neg (.a i), .neg (.b i)] /-- The boundary block `cᵢ hᵢ cᵢ⁻¹` in the orientable word. -/ -def orientableBoundaryBlock {p n : ℕ} (i : Fin n) : +@[expose] def orientableBoundaryBlock {p n : ℕ} (i : Fin n) : List (SignedDart (OrientableEdge p n)) := [.pos (.c i), .pos (.h i), .neg (.c i)] /-- The square block `aᵢ aᵢ` in the nonorientable word. -/ -def nonOrientableCrosscapBlock {p n : ℕ} (i : Fin p) : +@[expose] def nonOrientableCrosscapBlock {p n : ℕ} (i : Fin p) : List (SignedDart (NonOrientableEdge p n)) := [.pos (.a i), .pos (.a i)] /-- The boundary block `cᵢ hᵢ cᵢ⁻¹` in the nonorientable word. -/ -def nonOrientableBoundaryBlock {p n : ℕ} (i : Fin n) : +@[expose] def nonOrientableBoundaryBlock {p n : ℕ} (i : Fin n) : List (SignedDart (NonOrientableEdge p n)) := [.pos (.c i), .pos (.h i), .neg (.c i)] /-- The canonical orientable signed boundary word. -/ -def orientableBoundaryWord (p n : ℕ) : List (SignedDart (OrientableEdge p n)) := +@[expose] def orientableBoundaryWord (p n : ℕ) : List (SignedDart (OrientableEdge p n)) := (List.ofFn (fun i : Fin p ↦ orientableHandleBlock (n := n) i)).flatten ++ (List.ofFn (fun i : Fin n ↦ orientableBoundaryBlock (p := p) i)).flatten /-- The canonical nonorientable signed boundary word. -/ -def nonOrientableBoundaryWord (p n : ℕ) : +@[expose] def nonOrientableBoundaryWord (p n : ℕ) : List (SignedDart (NonOrientableEdge p n)) := (List.ofFn (fun i : Fin p ↦ nonOrientableCrosscapBlock (n := n) i)).flatten ++ (List.ofFn (fun i : Fin n ↦ nonOrientableBoundaryBlock (p := p) i)).flatten diff --git a/LeanPool/ClassificationOfSurfaces/CellComplex.lean b/LeanPool/ClassificationOfSurfaces/CellComplex.lean index 6d771403e8..3b1d309e1b 100644 --- a/LeanPool/ClassificationOfSurfaces/CellComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/CellComplex.lean @@ -19,7 +19,7 @@ Gallier-Xu normal-form route. The definitions are still intentionally light, but and theorem boundaries match the Moise/PL blueprint. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -82,15 +82,16 @@ instance boundaryOccurrenceFintype (K : SurfaceCellComplex) : Fintype K.Boundary inferInstance /-- The dart stored at a boundary occurrence. -/ +@[expose] def BoundaryOccurrence.dart {K : SurfaceCellComplex} (o : K.BoundaryOccurrence) : K.Dart := (K.boundary o.1).get o.2 /-- Two darts name the same unoriented edge. -/ -def SameEdge (K : SurfaceCellComplex) (d e : K.Dart) : Prop := +@[expose] def SameEdge (K : SurfaceCellComplex) (d e : K.Dart) : Prop := e = d ∨ e = K.inv d /-- A boundary position belongs to the unoriented edge named by `d`. -/ -def Occurs (K : SurfaceCellComplex) (d : K.Dart) (o : K.BoundaryOccurrence) : Prop := +@[expose] def Occurs (K : SurfaceCellComplex) (d : K.Dart) (o : K.BoundaryOccurrence) : Prop := K.SameEdge d o.dart /-- The unoriented edge named by `d` occurs at exactly one boundary position. -/ @@ -174,7 +175,7 @@ def edge {α : Type*} : SignedDart α → α | neg a => a /-- Reverse the orientation of a signed dart. -/ -def flip {α : Type*} : SignedDart α → SignedDart α +@[expose] def flip {α : Type*} : SignedDart α → SignedDart α | pos a => neg a | neg a => pos a @@ -253,7 +254,7 @@ theorem signedDartOfOrientedEdge_edge {Edge : Type*} (d : OrientedEdge Edge) : The nonempty boundary presentation is equivalent to Gallier--Xu's empty-word sphere and is directly compatible with the polygonal occurrence adapter. -/ -def sphere : SurfaceCellComplex where +@[expose] def sphere : SurfaceCellComplex where Face := Bool Dart := SignedDart PUnit Vertex := PUnit diff --git a/LeanPool/ClassificationOfSurfaces/CellComplexQuotient.lean b/LeanPool/ClassificationOfSurfaces/CellComplexQuotient.lean index eea331b711..5de9b43899 100644 --- a/LeanPool/ClassificationOfSurfaces/CellComplexQuotient.lean +++ b/LeanPool/ClassificationOfSurfaces/CellComplexQuotient.lean @@ -29,7 +29,7 @@ realization, and the standard one-face examples have occurrence-validity witness derives its orbit conditions from `IsSurfaceValid`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -41,7 +41,7 @@ abbrev occurrenceDart (K : SurfaceCellComplex) (o : K.BoundaryOccurrence) : K.Da o.dart /-- The polygon side indexed by a boundary occurrence. -/ -def occurrenceSide (K : SurfaceCellComplex) (o : K.BoundaryOccurrence) : +@[expose] def occurrenceSide (K : SurfaceCellComplex) (o : K.BoundaryOccurrence) : PolygonGluing.Side K.Face K.faceBoundaryLength := ⟨o.1, o.2⟩ @@ -132,7 +132,7 @@ end OccurrencePairingValid namespace SignedDart /-- The unoriented edge name carried by a signed dart. -/ -def edgeName {Edge : Type} : SignedDart Edge → Edge +@[expose] def edgeName {Edge : Type} : SignedDart Edge → Edge | pos e => e | neg e => e @@ -148,7 +148,7 @@ theorem eq_or_eq_flip_iff_edgeName_eq {Edge : Type} (x d : SignedDart Edge) : end SignedDart /-- Positions in a boundary word carrying either orientation of `e`. -/ -def wordEdgeOccurrences {Edge : Type} [DecidableEq Edge] +@[expose] def wordEdgeOccurrences {Edge : Type} [DecidableEq Edge] (word : List (SignedDart Edge)) (e : Edge) : Finset (Fin word.length) := Finset.univ.filter fun i ↦ SignedDart.edgeName (word.get i) = e @@ -390,7 +390,7 @@ theorem not_isBoundaryDart_of_occurs_at_ne exact (hunique source hsource).trans (hunique target htarget).symm /-- Reverse the directed presentation of a side identification. -/ -def swapIdentification {K : SurfaceCellComplex} +@[expose] def swapIdentification {K : SurfaceCellComplex} (identification : PolygonGluing.Identification K.Face K.faceBoundaryLength) : PolygonGluing.Identification K.Face K.faceBoundaryLength where source := identification.target @@ -535,11 +535,11 @@ theorem polygonalMk_pairing_eq {K : SurfaceCellComplex} (valid : K.OccurrencePai /-! ## The two-monogon sphere presentation -/ /-- The positively oriented side in the two-monogon sphere presentation. -/ -def spherePositiveOccurrence : sphere.BoundaryOccurrence := +@[expose] def spherePositiveOccurrence : sphere.BoundaryOccurrence := ⟨false, ⟨0, by simp [sphere]⟩⟩ /-- The negatively oriented side in the two-monogon sphere presentation. -/ -def sphereNegativeOccurrence : sphere.BoundaryOccurrence := +@[expose] def sphereNegativeOccurrence : sphere.BoundaryOccurrence := ⟨true, ⟨0, by simp [sphere]⟩⟩ @[simp] @@ -588,7 +588,7 @@ theorem sphere_not_isBoundaryDart (d : sphere.Dart) : ¬sphere.IsBoundaryDart d exact hne heq /-- The gluing from the positive monogon to the negative monogon. -/ -def sphereBoundaryPairing : sphere.BoundaryPairing where +@[expose] def sphereBoundaryPairing : sphere.BoundaryPairing where source := spherePositiveOccurrence target := sphereNegativeOccurrence source_ne_target := by diff --git a/LeanPool/ClassificationOfSurfaces/DiskSquare.lean b/LeanPool/ClassificationOfSurfaces/DiskSquare.lean index 5a961b3f7f..e36f0190bc 100644 --- a/LeanPool/ClassificationOfSurfaces/DiskSquare.lean +++ b/LeanPool/ClassificationOfSurfaces/DiskSquare.lean @@ -23,7 +23,7 @@ projection of the Euclidean circle, and an arbitrary homeomorphism from the circ frontier of a bounded convex disk is extended across `PolygonCell`. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -306,7 +306,7 @@ noncomputable def circleBoundaryHomeomorph : Circle ≃ₜ boundary where theorem circleBoundaryHomeomorph_val (z : Circle) : (circleBoundaryHomeomorph z).1 = radialToBoundary z z.coe_ne_zero := - rfl + by rfl /-! ## Extending a chosen square-boundary parameterization -/ @@ -956,22 +956,22 @@ noncomputable def rightPlacement : C(square, square) where @[simp] theorem leftPlacement_re (z : square) : (leftPlacement z).1.re = (z.1.re - 1) / 2 := - rfl + by rfl @[simp] theorem leftPlacement_im (z : square) : (leftPlacement z).1.im = z.1.im := - rfl + by rfl @[simp] theorem rightPlacement_re (z : square) : (rightPlacement z).1.re = (1 - z.1.re) / 2 := - rfl + by rfl @[simp] theorem rightPlacement_im (z : square) : (rightPlacement z).1.im = z.1.im := - rfl + by rfl theorem leftPlacement_injective : Function.Injective leftPlacement := by intro z w h @@ -1165,7 +1165,7 @@ noncomputable def squareGluingMap : C(SquareGluing, square) where theorem squareGluingMap_mk (x : SquarePair) : squareGluingMap (@Quotient.mk'' SquarePair seamSetoid x) = squarePairMerge x := - rfl + by rfl theorem squareGluingMap_injective : Function.Injective squareGluingMap := by @@ -1205,7 +1205,7 @@ noncomputable def squareGluingHomeomorph : SquareGluing ≃ₜ square := by @[simp] theorem squareGluingHomeomorph_apply (q : SquareGluing) : squareGluingHomeomorph q = squareGluingMap q := - rfl + by rfl /-! ## Transporting the seam model to two nondegenerate polygon cells -/ @@ -1251,7 +1251,7 @@ theorem childPairSquarePairHomeomorph_inl (z : PolygonCell (l + 1)) : childPairSquarePairHomeomorph l r hl hr (.inl z) = .inl (finalSideCellHomeomorph l hl z) := - rfl + by rfl @[simp] theorem childPairSquarePairHomeomorph_inr @@ -1259,7 +1259,7 @@ theorem childPairSquarePairHomeomorph_inr (z : PolygonCell (r + 1)) : childPairSquarePairHomeomorph l r hl hr (.inr z) = .inr (firstSideCellHomeomorph r hr z) := - rfl + by rfl theorem childSeamGenerator_map (l r : ℕ) (hl : 0 < l) (hr : 0 < r) @@ -1542,7 +1542,7 @@ theorem finalOldArcLocal_apply finalSideCellHomeomorph l hl (PolygonCell.ofCircle (l + 1) (Circle.exp (2 * Real.pi * s.1 / (l + 1)))) := - rfl + by rfl @[simp] theorem firstOldArcLocal_apply @@ -1552,7 +1552,7 @@ theorem firstOldArcLocal_apply (PolygonCell.ofCircle (r + 1) (Circle.exp (2 * Real.pi * (1 + s.1) / (r + 1)))) := - rfl + by rfl theorem finalOldArcLocal_re_eq_one_iff_endpoint (l : ℕ) (hl : 0 < l) (s : Set.Icc (0 : ℝ) l) : @@ -2019,13 +2019,13 @@ theorem finalOldArc_val (l : ℕ) (hl : 0 < l) (s : Set.Icc (0 : ℝ) l) : (finalOldArc l hl s).1 = (leftPlacement (finalOldArcLocal l hl s)).1 := - rfl + by rfl theorem firstOldArc_val (r : ℕ) (hr : 0 < r) (s : Set.Icc (0 : ℝ) r) : (firstOldArc r hr s).1 = (rightPlacement (firstOldArcLocal r hr s)).1 := - rfl + by rfl theorem finalOldArc_zero_re (l : ℕ) (hl : 0 < l) : (finalOldArc l hl ⟨0, by constructor <;> positivity⟩).1.re = 0 := by @@ -2801,7 +2801,7 @@ theorem outerEndpointArc_apply outerEndpointArc l r hl hr x = outerArc l r hl hr ⟨x.1, by simpa only [zero_add] using x.2⟩ := - rfl + by rfl theorem outerArc_endpointIdent (x y : Set.Icc (0 : ℝ) (0 + (l + r))) @@ -2825,7 +2825,7 @@ theorem outerBoundaryQuotMap_mk (x : Set.Icc (0 : ℝ) (0 + (l + r))) : outerBoundaryQuotMap l r hl hr (Quot.mk _ x) = outerEndpointArc l r hl hr x := - rfl + by rfl theorem outerBoundaryQuotMap_surjective : Function.Surjective (outerBoundaryQuotMap l r hl hr) := by @@ -2917,7 +2917,7 @@ theorem outerBoundaryQuotHomeomorph_mk (x : Set.Icc (0 : ℝ) (0 + (l + r))) : outerBoundaryQuotHomeomorph l r hl hr (Quot.mk _ x) = outerEndpointArc l r hl hr x := - rfl + by rfl /-- The additive circle parameterized by the old sides is the outer square boundary. -/ noncomputable def outerAddCircleHomeomorph : @@ -3208,7 +3208,7 @@ theorem paramChildGluingHomeomorph_mk_inl (@Quotient.mk'' (ChildPair l r) (paramChildSeamSetoid l r) (.inl z)) = leftPlacement (finalSideCellHomeomorph l hl z) := - rfl + by rfl @[simp] theorem paramChildGluingHomeomorph_mk_inr @@ -3218,7 +3218,7 @@ theorem paramChildGluingHomeomorph_mk_inr (@Quotient.mk'' (ChildPair l r) (paramChildSeamSetoid l r) (.inr z)) = rightPlacement (firstSideCellHomeomorph r hr z) := - rfl + by rfl /-- The complete local P2 equivalence: one unsplit polygon is homeomorphic to the quotient of the two child polygons by their reversed fresh-side identification. -/ diff --git a/LeanPool/ClassificationOfSurfaces/EvalStatement.lean b/LeanPool/ClassificationOfSurfaces/EvalStatement.lean index 03ad200e77..43467e9517 100644 --- a/LeanPool/ClassificationOfSurfaces/EvalStatement.lean +++ b/LeanPool/ClassificationOfSurfaces/EvalStatement.lean @@ -20,7 +20,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch This file contains the public theorem matching the Lean Eval problem statement. -/ -@[expose] public section +public section open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Examples.lean b/LeanPool/ClassificationOfSurfaces/Examples.lean index def0e8e799..c42538beaa 100644 --- a/LeanPool/ClassificationOfSurfaces/Examples.lean +++ b/LeanPool/ClassificationOfSurfaces/Examples.lean @@ -20,7 +20,7 @@ The examples are concrete one-face boundary-word presentations in the shared `Su API. Their topology is supplied by the faithful polygonal quotient layer. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCancellation.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCancellation.lean index d15253a57c..59fde36c23 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCancellation.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCancellation.lean @@ -20,7 +20,7 @@ the P1 expansion of the one-sided split of the word with the pair removed. Thus one P1 contraction, and one one-sided P2 merge cancel the pair. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -97,18 +97,18 @@ theorem retainWord_contractWord_of_fresh_not_mem {n : ℕ} P1.castSuccDart_neg, ih'] /-- Move a chosen edge name to the fresh-last position. -/ -def moveToLast {n : ℕ} (a : Fin (n + 1)) : +@[expose] def moveToLast {n : ℕ} (a : Fin (n + 1)) : Fin (n + 1) ≃ Fin (n + 1) := Equiv.swap a (Fin.last n) /-- Rename a tail so that the displayed cancellable edge becomes last. -/ -def renamedTail {n : ℕ} (a : Fin (n + 1)) +@[expose] def renamedTail {n : ℕ} (a : Fin (n + 1)) (X : List (SignedDart (Fin (n + 1)))) : List (SignedDart (Fin (n + 1))) := X.map (SignedDart.mapEquiv (moveToLast a)) /-- Delete the now-unused last edge name from a renamed tail. -/ -def lowerTail {n : ℕ} (a : Fin (n + 1)) +@[expose] def lowerTail {n : ℕ} (a : Fin (n + 1)) (X : List (SignedDart (Fin (n + 1)))) : List (SignedDart (Fin n)) := P1.contractWord (renamedTail a X) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonical.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonical.lean index d79f298ee3..83a56a1119 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonical.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonical.lean @@ -25,7 +25,7 @@ and `NormalForm.nonOrientableBoundaryWord`; this file does not introduce another the Lean-Eval representatives. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonicalRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonicalRealization.lean index b8c12996b5..84553844d4 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonicalRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCanonicalRealization.lean @@ -23,7 +23,7 @@ already-certified canonical polygonal quotients; in particular, it does not rest Lean-Eval relation. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCrosscap.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCrosscap.lean index 3073df1372..e2ac08a112 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicCrosscap.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicCrosscap.lean @@ -26,7 +26,7 @@ backwards, exactly as in Gallier--Xu's derivation. The broader ordinary signed edge relabeling. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -37,14 +37,14 @@ open SurfaceCellComplex namespace Crosscap /-- The source spelling with two equally oriented occurrences of `a`. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace (([.pos a] ++ X) ++ ([.pos a] ++ Y)) /-- A cyclic spelling of the target cross-cap word `a a Y⁻¹ X`. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicDerivedRewrites.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicDerivedRewrites.lean index 61c0ff15f7..3292261554 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicDerivedRewrites.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicDerivedRewrites.lean @@ -24,7 +24,7 @@ normalization proof. It starts with proof-producing infrastructure for one-face These lemmas keep intermediate validity witnesses out of the public derived-chain APIs. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -128,7 +128,7 @@ theorem target_isSurfaceValid {n : ℕ} (a : Fin n) omega /-- Reverse exactly one named edge orientation. -/ -def reverseEdgeRelabeling {n : ℕ} (a : Fin n) : +@[expose] def reverseEdgeRelabeling {n : ℕ} (a : Fin n) : EdgeRelabeling (Fin n) (Fin n) where edgeEquiv := Equiv.refl _ reverse := fun e ↦ decide (e = a) @@ -175,14 +175,14 @@ theorem reverseEdgeRelabeling_word {n : ℕ} (a : Fin n) exact reverseEdgeRelabeling_of_ne a e hda true /-- The negatively oriented spelling of the Dyck source. -/ -@[reducible] +@[expose, reducible] def negativeSource {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : FiniteCyclicPresentation := oneFace (([.neg a] ++ U) ++ (V ++ [.pos a] ++ X)) /-- The corresponding negatively oriented target spelling. -/ -@[reducible] +@[expose, reducible] def negativeTarget {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -279,14 +279,14 @@ theorem target_isSurfaceValid {n : ℕ} (a : Fin n) omega /-- The cross-cap source with the distinguished edge displayed negative. -/ -@[reducible] +@[expose, reducible] def negativeSource {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace (([.neg a] ++ X) ++ ([.neg a] ++ Y)) /-- The corresponding negatively oriented target. -/ -@[reducible] +@[expose, reducible] def negativeTarget {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -363,14 +363,14 @@ theorem negativeNormalizationEquivalent {n : ℕ} (a : Fin n) (NormalizationEquivalent.ofSignedIso targetIso).symm) /-- The adjacent-crosscap source `a a X Y`. -/ -@[reducible] +@[expose, reducible] def adjacentSource {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := Dyck.oneFace ([.pos a, .pos a] ++ X ++ Y) /-- The alternate cross-cap target `a Y a X⁻¹`. -/ -@[reducible] +@[expose, reducible] def adjacentTarget {n : ℕ} (a : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -440,7 +440,7 @@ end Crosscap namespace Handle /-- The source spelling for Gallier--Xu handle extraction. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (a b : Fin n) (U V X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -668,7 +668,7 @@ private theorem crosscap_rewriteCertificate {n : ℕ} (a : Fin n) · exact Crosscap.normalizationEquivalent a X Y haX haY /-- A crosscap followed by a handle, with arbitrary intervening words `X` and `Y`. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (a b c : Fin n) (X Y : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -903,7 +903,7 @@ namespace LoopGrouping /-- A cyclic word with the loop block `a H a⁻¹`, a separating word `X`, and a block `V` to move next to the loop. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (a : Fin n) (H X V : List (SignedDart (Fin n))) : FiniteCyclicPresentation := diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicDyck.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicDyck.lean index 2857d6d925..88a8634635 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicDyck.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicDyck.lean @@ -26,7 +26,7 @@ reverses the former. The side words `U`, `V`, and `X` must not use `a`; this is side-condition available when the displayed two darts are the two occurrences of an inner edge. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -37,7 +37,7 @@ open SurfaceCellComplex namespace Dyck /-- A finite-cyclic presentation with one explicitly indexed face. -/ -@[reducible] +@[expose, reducible] def oneFace {n : ℕ} (word : List (SignedDart (Fin n))) : FiniteCyclicPresentation where edgeCount := n @@ -48,7 +48,7 @@ theorem oneFace_boundary_zero {n : ℕ} (word : List (SignedDart (Fin n))) : rfl /-- The source spelling of the Dyck rewrite. -/ -@[reducible] +@[expose, reducible] def source {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : FiniteCyclicPresentation := @@ -56,7 +56,7 @@ def source {n : ℕ} (a : Fin n) /-- A cyclic spelling of the target word `a V U a⁻¹ X`, chosen so its common P2 subdivision is definitionally transparent. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (a : Fin n) (U V X : List (SignedDart (Fin n))) : FiniteCyclicPresentation := diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicFaceMerge.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicFaceMerge.lean index 1a83cfe869..8f366f9dda 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicFaceMerge.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicFaceMerge.lean @@ -20,7 +20,7 @@ local merge used to reduce a connected presentation to one face. It covers both nondegenerate cuts and the one-sided monogon case. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -264,7 +264,7 @@ theorem polygonallyEquivalentOfSignedIso namespace ContextMerge /-- Merge `U` and `V` into the first face while retaining the remaining face words `W`. -/ -@[reducible] +@[expose, reducible] def target {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -283,7 +283,7 @@ has finished. /-- Merge the first and last displayed children while retaining their separator as an adjacent inverse pair in the merged face. -/ -@[reducible] +@[expose, reducible] def markedTarget {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : @@ -412,7 +412,7 @@ theorem markedMiddleFaceEquiv_rightFace {n : ℕ} simp [target, markedTarget] /-- The child occupying the selected old-face position. -/ -def selectedFace {n : ℕ} +@[expose] def selectedFace {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) : (source U V W).Face := @@ -427,7 +427,7 @@ def rightFace {n : ℕ} P2.rightFace (target U V W) (targetCut U V W) /-- The target face occupied by the `i`th untouched word. -/ -def untouchedTargetFace {n : ℕ} +@[expose] def untouchedTargetFace {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) (i : Fin W.length) : @@ -438,7 +438,7 @@ def untouchedTargetFace {n : ℕ} omega⟩ /-- The source face occupied by the `i`th untouched word. -/ -def untouchedSourceFace {n : ℕ} +@[expose] def untouchedSourceFace {n : ℕ} (U V : List (SignedDart (Fin n))) (W : List (List (SignedDart (Fin n)))) (i : Fin W.length) : diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoveRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoveRealization.lean index 2e1e04208b..13a8f919a1 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoveRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoveRealization.lean @@ -22,7 +22,7 @@ faithful polygonal quotient. Consequently, clients of directed chains and common certificates do not need to pass the primitive invariance proofs explicitly. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoves.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoves.lean index 83d3a6f081..f1923b026d 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoves.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicMoves.lean @@ -30,7 +30,7 @@ move chain, which may pass through the exceptional empty-word sphere where subdivision implies move equivalence, but no converse or confluence theorem is asserted here. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalization.lean index cd93b8c734..d648046c9d 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalization.lean @@ -31,7 +31,7 @@ intermediate validity arguments. This is the stable target for the remaining der normalization chains. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalizationResult.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalizationResult.lean index 1404606ea6..ff2c7e8457 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalizationResult.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicNormalizationResult.lean @@ -20,7 +20,7 @@ A result lands only at the existing `NormalForm.canonicalPresentation`; it canno second project-owned spelling of the Eval representatives. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1.lean index b2d85bf4e5..e13b72adc8 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1.lean @@ -34,7 +34,7 @@ both subdivided edges, and preserves ordinary validity, face-incidence connectiv isomorphism. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -46,7 +46,7 @@ open SurfaceCellComplex namespace P1 /-- Retain an old signed edge in the enlarged edge type. -/ -def castSuccDart {n : ℕ} : SignedDart (Fin n) → SignedDart (Fin (n + 1)) +@[expose] def castSuccDart {n : ℕ} : SignedDart (Fin n) → SignedDart (Fin (n + 1)) | .pos e => .pos e.castSucc | .neg e => .neg e.castSucc @@ -66,11 +66,11 @@ theorem edgeOfDart_castSuccDart {n : ℕ} (d : SignedDart (Fin n)) : cases d <;> rfl /-- The fresh second subedge in the canonical P1 expansion. -/ -def freshEdge (n : ℕ) : Fin (n + 1) := +@[expose] def freshEdge (n : ℕ) : Fin (n + 1) := Fin.last n /-- The retained first subedge in the canonical P1 expansion. -/ -def firstSubedge {n : ℕ} (a : Fin n) : Fin (n + 1) := +@[expose] def firstSubedge {n : ℕ} (a : Fin n) : Fin (n + 1) := a.castSucc theorem firstSubedge_ne_freshEdge {n : ℕ} (a : Fin n) : @@ -78,7 +78,7 @@ theorem firstSubedge_ne_freshEdge {n : ℕ} (a : Fin n) : Fin.castSucc_ne_last a /-- Substitute one signed occurrence according to Gallier--Xu P1. -/ -def expandDart {n : ℕ} (a : Fin n) : +@[expose] def expandDart {n : ℕ} (a : Fin n) : SignedDart (Fin n) → List (SignedDart (Fin (n + 1))) | .pos e => if e = a then @@ -141,7 +141,7 @@ theorem castSuccDart_mem_expandDart {n : ℕ} (a : Fin n) · simp [expandDart, h] /-- Contract one target dart: discard the fresh edge and retain every old edge. -/ -def contractDart {n : ℕ} : +@[expose] def contractDart {n : ℕ} : SignedDart (Fin (n + 1)) → Option (SignedDart (Fin n)) | .pos e => Fin.lastCases none (fun b ↦ some (.pos b)) e | .neg e => Fin.lastCases none (fun b ↦ some (.neg b)) e @@ -167,12 +167,12 @@ theorem contractDart_neg_freshEdge (n : ℕ) : simp [contractDart, freshEdge] /-- Apply P1 simultaneously to every occurrence in a linear representative of a cyclic word. -/ -def expandWord {n : ℕ} (a : Fin n) (word : List (SignedDart (Fin n))) : +@[expose] def expandWord {n : ℕ} (a : Fin n) (word : List (SignedDart (Fin n))) : List (SignedDart (Fin (n + 1))) := word.flatMap (expandDart a) /-- Contract a P1 word by deleting the fresh subedge. -/ -def contractWord {n : ℕ} (word : List (SignedDart (Fin (n + 1)))) : +@[expose] def contractWord {n : ℕ} (word : List (SignedDart (Fin (n + 1)))) : List (SignedDart (Fin n)) := word.filterMap contractDart @@ -392,7 +392,7 @@ theorem expand_faces_length (P : FiniteCyclicPresentation) (a : P.Edge) : simp [expand] /-- P1 preserves face positions. -/ -def faceEquiv (P : FiniteCyclicPresentation) (a : P.Edge) : +@[expose] def faceEquiv (P : FiniteCyclicPresentation) (a : P.Edge) : P.Face ≃ (expand P a).Face := finCongr (expand_faces_length P a).symm diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1Realization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1Realization.lean index 01d96297d7..bf6dc370c0 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1Realization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP1Realization.lean @@ -22,7 +22,7 @@ and weight one everywhere else. `WeightedCircle` turns those weights into the e homeomorphism required by P1, and radial extension gives the corresponding disk homeomorphism. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2.lean index a167655149..4e113bcea0 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2.lean @@ -33,7 +33,7 @@ it does not claim to preserve the old positive stored orientation. This conventi reversing a cut exchange the two children exactly. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -70,7 +70,7 @@ theorem isNondegenerate_iff_lengths_pos {P : FiniteCyclicPresentation} simp only [IsNondegenerate, List.length_pos_iff_ne_nil] /-- Cut a chosen oriented representative at a linear position. -/ -def canonical {P : FiniteCyclicPresentation} (face : P.OrientedFace) +@[expose] def canonical {P : FiniteCyclicPresentation} (face : P.OrientedFace) (position : Fin ((P.orientedBoundary face).length + 1)) : P2Cut P where face := face left := (P.orientedBoundary face).take position @@ -107,7 +107,7 @@ theorem canonical_last_right {P : FiniteCyclicPresentation} (face : P.OrientedFa simp [canonical] /-- Move the cyclic cut point to the other end of the two pieces. -/ -def swap {P : FiniteCyclicPresentation} (cut : P2Cut P) : P2Cut P where +@[expose] def swap {P : FiniteCyclicPresentation} (cut : P2Cut P) : P2Cut P where face := cut.face left := cut.right right := cut.left @@ -115,7 +115,7 @@ def swap {P : FiniteCyclicPresentation} (cut : P2Cut P) : P2Cut P where cut.boundary_rotated.trans List.isRotated_append /-- Reverse the traversal orientation of a cut. -/ -def flip {P : FiniteCyclicPresentation} (cut : P2Cut P) : P2Cut P where +@[expose] def flip {P : FiniteCyclicPresentation} (cut : P2Cut P) : P2Cut P where face := cut.face.flip left := inverseWord cut.right right := inverseWord cut.left @@ -176,16 +176,16 @@ end P2Cut namespace P2 /-- The fresh cutting edge. -/ -def freshEdge (P : FiniteCyclicPresentation) : Fin (P.edgeCount + 1) := +@[expose] def freshEdge (P : FiniteCyclicPresentation) : Fin (P.edgeCount + 1) := P1.freshEdge P.edgeCount /-- Retain an old boundary word in the enlarged edge type. -/ -def retainWord {n : ℕ} (word : List (SignedDart (Fin n))) : +@[expose] def retainWord {n : ℕ} (word : List (SignedDart (Fin n))) : List (SignedDart (Fin (n + 1))) := word.map P1.castSuccDart /-- Store a displayed oriented boundary in the presentation's positive orientation. -/ -def storedWord {α : Type*} (orientation : Bool) +@[expose] def storedWord {α : Type*} (orientation : Bool) (word : List (SignedDart α)) : List (SignedDart α) := if orientation then inverseWord word else word @@ -247,27 +247,27 @@ theorem contractWord_retainWord {n : ℕ} exact congrArg (List.cons d) ih /-- The first displayed child boundary. -/ -def selectedOrientedBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def selectedOrientedBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : List (SignedDart (Fin (P.edgeCount + 1))) := retainWord cut.left ++ [.pos (freshEdge P)] /-- The second displayed child boundary. -/ -def rightOrientedBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def rightOrientedBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : List (SignedDart (Fin (P.edgeCount + 1))) := .neg (freshEdge P) :: retainWord cut.right /-- The first child boundary in its stored orientation. -/ -def selectedBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def selectedBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : List (SignedDart (Fin (P.edgeCount + 1))) := storedWord cut.face.orientation (selectedOrientedBoundary P cut) /-- The second child boundary in its stored orientation. -/ -def rightBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def rightBoundary (P : FiniteCyclicPresentation) (cut : P2Cut P) : List (SignedDart (Fin (P.edgeCount + 1))) := storedWord cut.face.orientation (rightOrientedBoundary P cut) /-- The word stored at a target face index. -/ -def faceWord (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def faceWord (P : FiniteCyclicPresentation) (cut : P2Cut P) : Fin (P.faces.length + 1) → List (SignedDart (Fin (P.edgeCount + 1))) := Fin.lastCases (rightBoundary P cut) fun f ↦ if f = cut.face.face then @@ -291,17 +291,17 @@ theorem split_faces_length (P : FiniteCyclicPresentation) (cut : P2Cut P) : simp [split] /-- Identify the explicit target indexing type with the presentation's face type. -/ -def faceEquiv (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def faceEquiv (P : FiniteCyclicPresentation) (cut : P2Cut P) : Fin (P.faces.length + 1) ≃ (split P cut).Face := finCongr (split_faces_length P cut).symm /-- The target face occupying an old source-face position. -/ -def oldFace (P : FiniteCyclicPresentation) (cut : P2Cut P) (f : P.Face) : +@[expose] def oldFace (P : FiniteCyclicPresentation) (cut : P2Cut P) (f : P.Face) : (split P cut).Face := faceEquiv P cut f.castSucc /-- The fresh second child face. -/ -def rightFace (P : FiniteCyclicPresentation) (cut : P2Cut P) : +@[expose] def rightFace (P : FiniteCyclicPresentation) (cut : P2Cut P) : (split P cut).Face := faceEquiv P cut (Fin.last P.faces.length) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean index 26d4725a44..d3dd951925 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean @@ -20,7 +20,7 @@ positive base case has an empty left cut word and a nonempty right cut word. Re swap transport that case to every ordinary-valid one-sided-degenerate cut. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean index 5d25b54bb3..7511285591 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean @@ -23,7 +23,7 @@ terms of the existing `P2Cut` data, so the presentation-level quotient compariso same side indices and no second formulation of P2 is introduced. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -597,7 +597,7 @@ def positiveSelectedChildSideIndex exact i.isLt⟩ /-- The target right-child index corresponding to a local child side. -/ -def positiveRightChildSideIndex +@[expose] def positiveRightChildSideIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) (i : Fin (cut.right.length + 1)) : @@ -712,7 +712,7 @@ theorem positiveChildPairPreMap_inr rfl /-- Send a local child point to its class in the complete split realization. -/ -noncomputable def positiveChildPairMap +@[expose] noncomputable def positiveChildPairMap (P : FiniteCyclicPresentation) (cut : P2Cut P) (horientation : cut.face.orientation = false) (validP : P.IsSurfaceValid) : @@ -950,7 +950,7 @@ noncomputable def retainedCellHomeomorph (split_boundary_old_length_of_ne P cut hface).symm 0 /-- Target index corresponding to a side of a retained source face. -/ -def retainedSideIndex +@[expose] def retainedSideIndex (P : FiniteCyclicPresentation) (cut : P2Cut P) {f : P.Face} (hface : f ≠ cut.face.face) (i : Fin (P.boundary f).length) : @@ -982,7 +982,7 @@ theorem retainedCellHomeomorph_side exact i.isLt /-- A retained face maps directly to its unchanged target face class. -/ -noncomputable def retainedFaceMap +@[expose] noncomputable def retainedFaceMap (P : FiniteCyclicPresentation) (cut : P2Cut P) {f : P.Face} (hface : f ≠ cut.face.face) (validP : P.IsSurfaceValid) : diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicPresentation.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicPresentation.lean index 6bef5d6c54..9684edf6b8 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicPresentation.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicPresentation.lean @@ -38,7 +38,7 @@ isomorphism class and `IsGallierValid` adds it as an explicit disjunct. The pres `twoMonogonSphere` is the nonexceptional two-face model obtained by the book's P2 refinement. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -70,11 +70,11 @@ abbrev Face (P : FiniteCyclicPresentation) := Fin P.faces.length /-- The stored cyclic boundary word of a face. -/ -def boundary (P : FiniteCyclicPresentation) (f : P.Face) : List P.Dart := +@[expose] def boundary (P : FiniteCyclicPresentation) (f : P.Face) : List P.Dart := P.faces.get f /-- Forget the orientation of a signed edge occurrence. -/ -def edgeOfDart {α : Type*} : SignedDart α → α +@[expose] def edgeOfDart {α : Type*} : SignedDart α → α | .pos e => e | .neg e => e @@ -84,7 +84,7 @@ theorem edgeOfDart_flip {α : Type*} (d : SignedDart α) : cases d <;> rfl /-- Reverse the traversal direction of a signed boundary word. -/ -def inverseWord {α : Type*} (word : List (SignedDart α)) : +@[expose] def inverseWord {α : Type*} (word : List (SignedDart α)) : List (SignedDart α) := word.reverse.map SignedDart.flip @@ -146,7 +146,7 @@ structure EdgeRelabeling (α β : Type*) where namespace EdgeRelabeling /-- Apply an edge relabeling to a signed dart. -/ -def mapDart {α β : Type*} (e : EdgeRelabeling α β) : SignedDart α → SignedDart β +@[expose] def mapDart {α β : Type*} (e : EdgeRelabeling α β) : SignedDart α → SignedDart β | .pos a => if e.reverse a then .neg (e.edgeEquiv a) @@ -380,7 +380,7 @@ deriving DecidableEq, Fintype namespace OrientedFace /-- A face with its stored traversal orientation. -/ -def pos {P : FiniteCyclicPresentation} (f : P.Face) : P.OrientedFace := +@[expose] def pos {P : FiniteCyclicPresentation} (f : P.Face) : P.OrientedFace := ⟨f, false⟩ /-- A face with the traversal orientation opposite to the stored one. -/ @@ -388,7 +388,7 @@ def neg {P : FiniteCyclicPresentation} (f : P.Face) : P.OrientedFace := ⟨f, true⟩ /-- Reverse the traversal orientation of a face. -/ -def flip {P : FiniteCyclicPresentation} (f : P.OrientedFace) : +@[expose] def flip {P : FiniteCyclicPresentation} (f : P.OrientedFace) : P.OrientedFace := ⟨f.face, !f.orientation⟩ @@ -458,7 +458,7 @@ theorem orientedBoundary_length (P : FiniteCyclicPresentation) cases orientation <;> simp [orientedBoundary] /-- Multiplicity of an edge in one face boundary. -/ -def faceEdgeMultiplicity (P : FiniteCyclicPresentation) (f : P.Face) (e : P.Edge) : ℕ := +@[expose] def faceEdgeMultiplicity (P : FiniteCyclicPresentation) (f : P.Face) (e : P.Edge) : ℕ := ((P.boundary f).map edgeOfDart).count e /-- Reading a face boundary in the opposite direction does not change edge multiplicities. -/ @@ -475,7 +475,7 @@ theorem orientedBoundary_edgeMultiplicity (P : FiniteCyclicPresentation) exact (List.reverse_perm _).count_eq e /-- Total number of boundary occurrences of an unoriented edge. -/ -def edgeMultiplicity (P : FiniteCyclicPresentation) (e : P.Edge) : ℕ := +@[expose] def edgeMultiplicity (P : FiniteCyclicPresentation) (e : P.Edge) : ℕ := ∑ f : P.Face, P.faceEdgeMultiplicity f e /-- An edge is a boundary edge when it occurs in exactly one face boundary position. -/ @@ -514,7 +514,7 @@ def emptyWordSphere : FiniteCyclicPresentation where Gallier--Xu page 86 obtains this presentation from `emptyWordSphere` by the P2 face split. Unlike the exceptional presentation, it satisfies the ordinary nonempty-boundary validity predicate. -/ -@[reducible] +@[expose, reducible] def twoMonogonSphere : FiniteCyclicPresentation where edgeCount := 1 faces := [[.pos 0], [.neg 0]] diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicRealization.lean index 97fc8eace9..cff0dc1e53 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicRealization.lean @@ -29,7 +29,7 @@ legacy cell-complex predicate. It therefore supplies the complete occurrence-pai needed by this construction. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -54,7 +54,7 @@ def dart {P : FiniteCyclicPresentation} (o : P.BoundaryOccurrence) : P.Dart := (P.boundary o.1).get o.2 /-- The unoriented edge stored at a boundary occurrence. -/ -def edge {P : FiniteCyclicPresentation} (o : P.BoundaryOccurrence) : P.Edge := +@[expose] def edge {P : FiniteCyclicPresentation} (o : P.BoundaryOccurrence) : P.Edge := edgeOfDart o.dart @[simp] @@ -73,7 +73,7 @@ theorem edge_mk (P : FiniteCyclicPresentation) (f : P.Face) end BoundaryOccurrence /-- The polygon side indexed by a boundary occurrence. -/ -def occurrenceSide (P : FiniteCyclicPresentation) (o : P.BoundaryOccurrence) : +@[expose] def occurrenceSide (P : FiniteCyclicPresentation) (o : P.BoundaryOccurrence) : PolygonGluing.Side P.Face fun f => (P.boundary f).length := ⟨o.1, o.2⟩ @@ -260,7 +260,7 @@ end IsSurfaceValid namespace BoundaryPairing /-- The polygon-side identification associated to a compatible occurrence pairing. -/ -def identification {P : FiniteCyclicPresentation} (pairing : P.BoundaryPairing) : +@[expose] def identification {P : FiniteCyclicPresentation} (pairing : P.BoundaryPairing) : PolygonGluing.Identification P.Face fun f => (P.boundary f).length where source := P.occurrenceSide pairing.source target := P.occurrenceSide pairing.target diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicReduction.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicReduction.lean index ea5e2976b7..1c241166ff 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicReduction.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicReduction.lean @@ -20,7 +20,7 @@ a genuinely adjacent pair, and either occurrence of their common edge can be pla of a suitably oriented cyclic boundary. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicSignedRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicSignedRealization.lean index 7af4f98ef5..e5236c9ad2 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicSignedRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicSignedRealization.lean @@ -25,7 +25,7 @@ generators and their equivalence closures. It therefore descends to a homeomorph polygonal quotients. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -137,7 +137,7 @@ theorem rotate_target_boundary (e : SignedPresentationIso P Q) (f : P.Face) : Classical.choose_spec (e.boundary_rotated f).symm /-- The target side occupied by a source side after the selected face rotation. -/ -noncomputable def sideIndex (e : SignedPresentationIso P Q) +@[expose] noncomputable def sideIndex (e : SignedPresentationIso P Q) (validQ : Q.IsSurfaceValid) (f : P.Face) (i : Fin (P.boundary f).length) : Fin (Q.boundary (e.faceEquiv f)).length := by diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicSphereRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicSphereRealization.lean index 2536470197..c0e11cc24e 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicSphereRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicSphereRealization.lean @@ -21,7 +21,7 @@ two-monogon presentation and transports the already established sphere homeomorp comparison. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicTerminalNormalization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicTerminalNormalization.lean index e68dfb6dd3..5000579692 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicTerminalNormalization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicTerminalNormalization.lean @@ -20,7 +20,7 @@ when a crosscap is present, and the resulting ordered word is signed-relabelled project-owned `NormalForm.canonicalPresentation`. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicTriangulation.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicTriangulation.lean index cba2e70568..d26290bdf6 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicTriangulation.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicTriangulation.lean @@ -20,7 +20,7 @@ Incidence validity and dual connectivity then pass to the resulting `FiniteCyclicPresentation`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -167,7 +167,7 @@ theorem toFiniteCyclicPresentation_boundary_faceEquiv_get /-- Original triangle-boundary positions are canonically the boundary occurrences of the enumerated cyclic presentation. -/ -noncomputable def finiteCyclicOccurrenceEquiv (T : FiniteSurfaceTriangulation S) : +@[expose] noncomputable def finiteCyclicOccurrenceEquiv (T : FiniteSurfaceTriangulation S) : T.BoundaryPosition ≃ (Σ f : T.toFiniteCyclicPresentation.Face, Fin (T.toFiniteCyclicPresentation.boundary f).length) := diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicUnorientedRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicUnorientedRealization.lean index aea7d058b9..ee73ec984e 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicUnorientedRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicUnorientedRealization.lean @@ -26,7 +26,7 @@ does preserve their faithful polygonal realizations. This is the exact extra com the cross-cap pseudo-rewrite, whose common P2 refinement reads one of its two faces backwards. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReduction.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReduction.lean index dacd8000ac..17d206a055 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReduction.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReduction.lean @@ -19,7 +19,7 @@ This file completes the recursive reduction developed in normalization and the connected-presentation result. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -7526,14 +7526,14 @@ structure TerminalCompletedWord where namespace TerminalCompletedWord /-- Validity-bundled finite-cyclic presentation displayed by a terminal completed-block word. -/ -def validPresentation (terminal : TerminalCompletedWord) : +@[expose] def validPresentation (terminal : TerminalCompletedWord) : ValidPresentation := ⟨Dyck.oneFace (CompletedBlock.sequenceWord terminal.blocks), terminal.valid⟩ /-- Exact canonical normal form selected by the completed block counts. -/ -def normalForm (terminal : TerminalCompletedWord) : +@[expose] def normalForm (terminal : TerminalCompletedWord) : NormalForm := CompletedBlock.normalForm terminal.blocks diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReductionCore.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReductionCore.lean index 1ff5c8c62e..0b336d590a 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReductionCore.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicWordReductionCore.lean @@ -21,7 +21,7 @@ while preserving a validity-bundled normalization chain. If the final pair is t the result is the agreed ordinary-valid two-monogon sphere presentation. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -194,7 +194,7 @@ noncomputable def nonOrientableNormalizationResultOfSignedRotated edgeRelabeling rotated) /-- The two possible signed spellings of an adjacent inverse pair. -/ -def inversePair {Edge : Type} (a : Edge) : Bool → List (SignedDart Edge) +@[expose] def inversePair {Edge : Type} (a : Edge) : Bool → List (SignedDart Edge) | false => [.pos a, .neg a] | true => [.neg a, .pos a] @@ -629,7 +629,7 @@ def dartNegative {α : Type*} : SignedDart α → Bool | .neg _ => true /-- An edge equivalence equipped with an explicit source-orientation normalization function. -/ -def signedRelabeling {α β : Type*} +@[expose] def signedRelabeling {α β : Type*} (edgeEquiv : α ≃ β) (reverse : α → Bool) : EdgeRelabeling α β where edgeEquiv := edgeEquiv @@ -695,7 +695,7 @@ theorem signedRelabeling_mapDart_dart_not_self {α β : Type*} dart, hnegative] /-- Exact signed spelling of one boundary loop before final edge-name and sign normalization. -/ -def boundaryLoopWord {α : Type*} +@[expose] def boundaryLoopWord {α : Type*} (carrier hole : α) (carrierNegative holeNegative : Bool) : List (SignedDart α) := @@ -1452,7 +1452,7 @@ namespace ActionablePairReductionFeature /-- Delete the darts of the extracted block, retaining the exact residual order produced by the proof-generating rewrite endpoint. -/ -def residualWord {n : ℕ} {word : List (SignedDart (Fin n))} : +@[expose] def residualWord {n : ℕ} {word : List (SignedDart (Fin n))} : ActionablePairReductionFeature word → List (SignedDart (Fin n)) | .boundary _ form => @@ -1784,13 +1784,13 @@ inductive ExtractedBlock (n : ℕ) namespace ExtractedBlock /-- Ambient edge names consumed by an extracted block. -/ -def edges {n : ℕ} : ExtractedBlock n → List (Fin n) +@[expose] def edges {n : ℕ} : ExtractedBlock n → List (Fin n) | .boundary a _ => [a] | .crosscap a _ => [a] | .handle a b => [a, b] /-- Exact signed word contributed by an extracted block. -/ -def word {n : ℕ} : ExtractedBlock n → +@[expose] def word {n : ℕ} : ExtractedBlock n → List (SignedDart (Fin n)) | .boundary a negative => [dart a negative] | .crosscap a negative => @@ -2040,7 +2040,7 @@ inductive CompletedBlock (n : ℕ) namespace CompletedBlock /-- Exact signed word represented by a completed block. -/ -def word {n : ℕ} : CompletedBlock n → +@[expose] def word {n : ℕ} : CompletedBlock n → List (SignedDart (Fin n)) | .crosscap a negative => [dart a negative, dart a negative] @@ -2051,14 +2051,14 @@ def word {n : ℕ} : CompletedBlock n → carrierNegative holeNegative /-- Ambient edge names used by a completed block. -/ -def edges {n : ℕ} : CompletedBlock n → List (Fin n) +@[expose] def edges {n : ℕ} : CompletedBlock n → List (Fin n) | .crosscap a _ => [a] | .handle a b => [a, b] | .boundary carrier hole _ _ => [carrier, hole, carrier] /-- Distinct-name spine of a completed block. Unlike `edges`, this records a boundary carrier once rather than once per dart occurrence. -/ -def names {n : ℕ} : CompletedBlock n → List (Fin n) +@[expose] def names {n : ℕ} : CompletedBlock n → List (Fin n) | .crosscap a _ => [a] | .handle a b => [a, b] | .boundary carrier hole _ _ => [carrier, hole] @@ -2275,7 +2275,7 @@ theorem sequenceWord_append {n : ℕ} simp [sequenceWord] /-- Concatenate the distinct-name spines owned by a completed block sequence. -/ -def sequenceNames {n : ℕ} +@[expose] def sequenceNames {n : ℕ} (blocks : List (CompletedBlock n)) : List (Fin n) := (blocks.map names).flatten @@ -2294,21 +2294,21 @@ theorem sequenceNames_cons {n : ℕ} simp [sequenceNames] /-- Number of completed crosscap blocks. -/ -def crosscapCount {n : ℕ} : +@[expose] def crosscapCount {n : ℕ} : List (CompletedBlock n) → ℕ | [] => 0 | .crosscap _ _ :: blocks => 1 + crosscapCount blocks | _ :: blocks => crosscapCount blocks /-- Number of completed handle blocks. -/ -def handleCount {n : ℕ} : +@[expose] def handleCount {n : ℕ} : List (CompletedBlock n) → ℕ | [] => 0 | .handle _ _ :: blocks => 1 + handleCount blocks | _ :: blocks => handleCount blocks /-- Number of completed boundary-loop blocks. -/ -def boundaryCount {n : ℕ} : +@[expose] def boundaryCount {n : ℕ} : List (CompletedBlock n) → ℕ | [] => 0 | .boundary _ _ _ _ :: blocks => @@ -2316,7 +2316,7 @@ def boundaryCount {n : ℕ} : | _ :: blocks => boundaryCount blocks /-- Normal-form parameters selected by a completed block sequence. -/ -def normalForm {n : ℕ} +@[expose] def normalForm {n : ℕ} (blocks : List (CompletedBlock n)) : NormalForm := if crosscapCount blocks = 0 then .orientable (handleCount blocks) (boundaryCount blocks) @@ -2364,7 +2364,7 @@ end CompletedBlock namespace BoundaryBlockCommute /-- A completed positive-carrier boundary loop lying inside an opposite residual pair. -/ -def sourceWord {n : ℕ} +@[expose] def sourceWord {n : ℕ} (outer carrier hole : Fin n) (outerNegative holeNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -2378,7 +2378,7 @@ def sourceWord {n : ℕ} /-- Move the completed loop outside the residual pair, leaving the residual pair around the strictly shorter protected interval. -/ -def targetWord {n : ℕ} +@[expose] def targetWord {n : ℕ} (outer carrier hole : Fin n) (outerNegative holeNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -2391,7 +2391,7 @@ def targetWord {n : ℕ} outsideTail /-- The same contextual loop with its carrier displayed negative first. -/ -def negativeSourceWord {n : ℕ} +@[expose] def negativeSourceWord {n : ℕ} (outer carrier hole : Fin n) (outerNegative holeNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -2404,7 +2404,7 @@ def negativeSourceWord {n : ℕ} outsideTail /-- Negative-carrier target spelling. -/ -def negativeTargetWord {n : ℕ} +@[expose] def negativeTargetWord {n : ℕ} (outer carrier hole : Fin n) (outerNegative holeNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -2983,7 +2983,7 @@ end BoundarySingletonClosure namespace BoundaryAtomRotate /-- A raw boundary atom followed by a nonempty protected interval inside an opposite pair. -/ -def sourceWord {n : ℕ} +@[expose] def sourceWord {n : ℕ} (carrier hole : Fin n) (carrierNegative holeNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -2995,7 +2995,7 @@ def sourceWord {n : ℕ} outsideTail /-- Move the raw boundary atom to the end of the protected interval, exposing its next atom. -/ -def targetWord {n : ℕ} +@[expose] def targetWord {n : ℕ} (carrier hole : Fin n) (carrierNegative holeNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -3184,7 +3184,7 @@ def positiveTargetWord {n : ℕ} insideTail ++ .pos carrier :: inverseWord outsideTail /-- Contextual crosscap source with arbitrary orientations on both distinguished edges. -/ -def sourceWord {n : ℕ} +@[expose] def sourceWord {n : ℕ} (outer carrier : Fin n) (outerNegative carrierNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -3196,7 +3196,7 @@ def sourceWord {n : ℕ} outsideTail /-- Arbitrarily oriented contextual crosscap target. -/ -def targetWord {n : ℕ} +@[expose] def targetWord {n : ℕ} (outer carrier : Fin n) (outerNegative carrierNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -3667,7 +3667,7 @@ end CrosscapBlockCommute namespace HandleBlockCommute /-- A completed handle at the head of a positive/negative residual pair. -/ -def positiveSourceWord {n : ℕ} +@[expose] def positiveSourceWord {n : ℕ} (outer first second : Fin n) (insideTail outsideTail : List (SignedDart (Fin n))) : List (SignedDart (Fin n)) := @@ -3675,7 +3675,7 @@ def positiveSourceWord {n : ℕ} insideTail ++ .neg outer :: outsideTail /-- The same completed handle commuted outside the residual pair. -/ -def positiveTargetWord {n : ℕ} +@[expose] def positiveTargetWord {n : ℕ} (outer first second : Fin n) (insideTail outsideTail : List (SignedDart (Fin n))) : List (SignedDart (Fin n)) := @@ -3683,7 +3683,7 @@ def positiveTargetWord {n : ℕ} insideTail ++ .neg outer :: outsideTail /-- The contextual handle source with its residual carrier displayed negative first. -/ -def negativeSourceWord {n : ℕ} +@[expose] def negativeSourceWord {n : ℕ} (outer first second : Fin n) (insideTail outsideTail : List (SignedDart (Fin n))) : List (SignedDart (Fin n)) := @@ -3691,7 +3691,7 @@ def negativeSourceWord {n : ℕ} insideTail ++ .pos outer :: outsideTail /-- Negative-residual-carrier target spelling. -/ -def negativeTargetWord {n : ℕ} +@[expose] def negativeTargetWord {n : ℕ} (outer first second : Fin n) (insideTail outsideTail : List (SignedDart (Fin n))) : List (SignedDart (Fin n)) := @@ -3699,7 +3699,7 @@ def negativeTargetWord {n : ℕ} insideTail ++ .pos outer :: outsideTail /-- Contextual handle source with arbitrary residual-carrier orientation. -/ -def sourceWord {n : ℕ} +@[expose] def sourceWord {n : ℕ} (outer first second : Fin n) (outerNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -3719,7 +3719,7 @@ private theorem sourceWord_false {n : ℕ} (outer first second : Fin n) simp [sourceWord] /-- Contextual handle target with arbitrary residual-carrier orientation. -/ -def targetWord {n : ℕ} +@[expose] def targetWord {n : ℕ} (outer first second : Fin n) (outerNegative : Bool) (insideTail outsideTail : List (SignedDart (Fin n))) : @@ -4225,7 +4225,7 @@ end HandleBlockCommute namespace BoundaryPairContraction /-- Two consecutive extracted boundary darts with arbitrary independent orientations. -/ -def sourceWord {n : ℕ} +@[expose] def sourceWord {n : ℕ} (first second : Fin (n + 1)) (firstNegative secondNegative : Bool) (tail : List (SignedDart (Fin (n + 1)))) : @@ -4234,7 +4234,7 @@ def sourceWord {n : ℕ} dart second secondNegative] ++ tail /-- Contract the second boundary edge and retain one positively normalized boundary dart. -/ -def targetWord {n : ℕ} +@[expose] def targetWord {n : ℕ} (first second : Fin (n + 1)) (hfirstSecond : first ≠ second) (tail : List (SignedDart (Fin (n + 1)))) : @@ -4512,7 +4512,7 @@ def carrier (n : ℕ) : Fin (n + 1) := P1.freshEdge n /-- Enclose a retained word in a fresh positively oriented carrier pair. -/ -def targetWord {n : ℕ} (word : List (SignedDart (Fin n))) : +@[expose] def targetWord {n : ℕ} (word : List (SignedDart (Fin n))) : List (SignedDart (Fin (n + 1))) := [.pos (carrier n)] ++ P2.retainWord word ++ [.neg (carrier n)] @@ -4836,7 +4836,7 @@ inductive ProtectedAtom (n : ℕ) namespace ProtectedAtom /-- Exact signed word represented by one classified protected atom. -/ -def word {n : ℕ} : ProtectedAtom n → +@[expose] def word {n : ℕ} : ProtectedAtom n → List (SignedDart (Fin n)) | .boundary hole negative => [dart hole negative] @@ -4849,7 +4849,7 @@ def edges {n : ℕ} : ProtectedAtom n → List (Fin n) | .completed block => block.edges /-- Distinct protected names owned by one classified atom. -/ -def names {n : ℕ} : ProtectedAtom n → List (Fin n) +@[expose] def names {n : ℕ} : ProtectedAtom n → List (Fin n) | .boundary hole _ => [hole] | .completed block => block.names @@ -5175,7 +5175,7 @@ inductive ReductionToken (n : ℕ) namespace ReductionToken /-- Embed a classified protected atom as one marked token. -/ -def ofProtectedAtom {n : ℕ} : +@[expose] def ofProtectedAtom {n : ℕ} : ProtectedAtom n → ReductionToken n | .boundary hole negative => .extracted (.boundary hole negative) @@ -5183,7 +5183,7 @@ def ofProtectedAtom {n : ℕ} : .completed block /-- Number of still-raw boundary singleton tokens in a marked word. -/ -def rawBoundaryCount {n : ℕ} : +@[expose] def rawBoundaryCount {n : ℕ} : List (ReductionToken n) → ℕ | [] => 0 | .extracted (.boundary _ _) :: tokens => @@ -5766,7 +5766,7 @@ def protectedNames {n : ℕ} (tokens : List (ReductionToken n)) : (tokens.map extractedNames).flatten /-- Residual darts and already-extracted blocks use disjoint ambient edge names. -/ -def IsSeparated {n : ℕ} (tokens : List (ReductionToken n)) : Prop := +@[expose] def IsSeparated {n : ℕ} (tokens : List (ReductionToken n)) : Prop := ((residualDarts tokens).map edgeOfDart).Disjoint (protectedEdges tokens) @@ -6052,7 +6052,7 @@ theorem Cancellation.lowerTail_append {n : ℕ} simp [Cancellation.lowerTail, Cancellation.renamedTail] /-- Lower every token in a marked word which avoids the removed edge. -/ -def lowerTokensAvoiding {n : ℕ} (a : Fin (n + 1)) : +@[expose] def lowerTokensAvoiding {n : ℕ} (a : Fin (n + 1)) : (tokens : List (ReductionToken (n + 1))) → a ∉ (expand tokens).map edgeOfDart → List (ReductionToken n) diff --git a/LeanPool/ClassificationOfSurfaces/GeometricTriangulationRealization.lean b/LeanPool/ClassificationOfSurfaces/GeometricTriangulationRealization.lean index 0422c0f5f6..87e3085e56 100644 --- a/LeanPool/ClassificationOfSurfaces/GeometricTriangulationRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/GeometricTriangulationRealization.lean @@ -23,7 +23,7 @@ barycentric face. Its side formula uses the cyclic face order exactly, so adjac agree under the signed occurrence pairing. -/ -@[expose] public section +public section open Set Topology diff --git a/LeanPool/ClassificationOfSurfaces/LeanEval/ChallengeDeps.lean b/LeanPool/ClassificationOfSurfaces/LeanEval/ChallengeDeps.lean index 5aad94a37f..deab14aa55 100644 --- a/LeanPool/ClassificationOfSurfaces/LeanEval/ChallengeDeps.lean +++ b/LeanPool/ClassificationOfSurfaces/LeanEval/ChallengeDeps.lean @@ -23,7 +23,7 @@ leanprover/lean-eval/generated/topological_classification_of_surfaces -/ -@[expose] public section +public section /-! Benchmark statements for topological classification of compact connected surfaces with boundary. @@ -42,7 +42,7 @@ namespace Complex abbrev ClosedUnitDisc : Type := Metric.closedBall (0 : ℂ) 1 /-- The boundary point exp(2πir) on the boundary of the closed unit disc in the complex plane. -/ -noncomputable def ClosedUnitDisc.bdyPtOfReal (r : ℝ) : ClosedUnitDisc := +@[expose] noncomputable def ClosedUnitDisc.bdyPtOfReal (r : ℝ) : ClosedUnitDisc := ⟨r.fourierChar, r.fourierChar.2.le⟩ end Complex diff --git a/LeanPool/ClassificationOfSurfaces/LeanEval/RepresentativeSanity.lean b/LeanPool/ClassificationOfSurfaces/LeanEval/RepresentativeSanity.lean index 830275e013..d71201d959 100644 --- a/LeanPool/ClassificationOfSurfaces/LeanEval/RepresentativeSanity.lean +++ b/LeanPool/ClassificationOfSurfaces/LeanEval/RepresentativeSanity.lean @@ -16,7 +16,7 @@ radius is constant across every generating identification, so it descends to bot families and distinguishes the disk center from its boundary. -/ -@[expose] public section +public section namespace Complex diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveControlledApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveControlledApproximation.lean index 36ce98f7fd..c7a1e04bff 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveControlledApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveControlledApproximation.lean @@ -24,7 +24,7 @@ diameter. Subordination to the resulting open cover converts the existing setwi graph replacement into a pointwise controlled approximation. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanAffine.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanAffine.lean index e153742f7f..1c48b5cb86 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanAffine.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanAffine.lean @@ -18,7 +18,7 @@ relative Radó weld uses this formula after composing with the inverse-affine pi polygonal filling certificates. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanComplex.lean index 5a5164a696..8c8386a4ef 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveFanComplex.lean @@ -16,7 +16,7 @@ of parametrized triangles in the open subpolyhedron. This file constructs those proving the global face-to-face intersection theorem. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenComplex.lean index f3e40234ac..d7b4884d6a 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenComplex.lean @@ -17,7 +17,7 @@ Their edges need not yet form a conforming simplicial complex: a coarse edge may edges of finer adjacent tiles. The next layer resolves precisely those hanging vertices. -/ -@[expose] public section +public section open scoped BigOperators @@ -378,11 +378,11 @@ noncomputable def levelAncestor (n : ℕ) : | k + 1, t => levelAncestor n k (K.levelParentFace (n + k) t) @[simp] theorem levelAncestor_zero (n : ℕ) (t : K.LevelFace n) : - K.levelAncestor n 0 t = t := rfl + K.levelAncestor n 0 t = t := by rfl @[simp] theorem levelAncestor_succ (n k : ℕ) (t : K.LevelFace (n + (k + 1))) : K.levelAncestor n (k + 1) t = - K.levelAncestor n k (K.levelParentFace (n + k) t) := rfl + K.levelAncestor n k (K.levelParentFace (n + k) t) := by rfl theorem levelFaceCarrier_subset_ancestor (n k : ℕ) (t : K.LevelFace (n + k)) : @@ -735,7 +735,7 @@ theorem isCompact_adaptiveFaceCarrierInOpen (t : K.AdaptiveFace U) : exact isCompact_range he /-- Adaptive tiles touching a fixed tile. -/ -def TouchingFace (t : K.AdaptiveFace U) := +@[expose] def TouchingFace (t : K.AdaptiveFace U) := {u : K.AdaptiveFace U // (K.adaptiveFaceCarrierInOpen U u ∩ K.adaptiveFaceCarrierInOpen U t).Nonempty} @@ -957,7 +957,7 @@ theorem mem_boundaryEdgeVertices_iff (hU : IsOpen U) (t : K.AdaptiveFace U) exact Finset.mem_filter /-- Barycentric parameter along a cyclic level-face edge, from vertex `i` to vertex `i+1`. -/ -noncomputable def levelFaceEdgeParameter {n : ℕ} (t : K.LevelFace n) +@[expose] noncomputable def levelFaceEdgeParameter {n : ℕ} (t : K.LevelFace n) (i : ZMod 3) (p : K.realization) : ℝ := ((K.safeSubdivision n).homeo.symm p).1 ((K.safeSubdivision n).refined.faceVertex t (i + 1)) @@ -1361,7 +1361,7 @@ noncomputable def faceCenterSimplex (t : K.Face) : norm_num @[simp] theorem faceCenterSimplex_apply (t : K.Face) (v : {v // v ∈ t.1}) : - K.faceCenterSimplex t v = 1 / 3 := rfl + K.faceCenterSimplex t v = 1 / 3 := by rfl /-- The barycentric center of an arbitrary level face, transported to the original realization. -/ @@ -1489,7 +1489,7 @@ theorem adaptiveFace_edgeCarrier_subset_of_level_le_of_common_not_boundaryVertex exact K.adaptiveVertexPoint_mem_boundaryVertices U hU ⟨n + k, t⟩ v /-- The barycentric center of one adaptive tile, transported to the original realization. -/ -noncomputable def adaptiveFaceCenter (t : K.AdaptiveFace U) : K.realization := +@[expose] noncomputable def adaptiveFaceCenter (t : K.AdaptiveFace U) : K.realization := (K.safeSubdivision t.1).homeo ((K.safeSubdivision t.1).refined.faceStandardMap t.2.1 ((K.safeSubdivision t.1).refined.faceCenterSimplex t.2.1)) @@ -1527,7 +1527,7 @@ abbrev AdaptiveEdgeInterval (hU : IsOpen U) (t : K.AdaptiveFace U) (i : ZMod 3) Fin ((K.boundaryEdgeVertexList U hU t i).length - 1) /-- First endpoint of a resolved adaptive-edge interval. -/ -noncomputable def adaptiveEdgeIntervalFirst (hU : IsOpen U) +@[expose] noncomputable def adaptiveEdgeIntervalFirst (hU : IsOpen U) (t : K.AdaptiveFace U) (i : ZMod 3) (j : K.AdaptiveEdgeInterval U hU t i) : K.realization := (K.boundaryEdgeVertexList U hU t i).get @@ -1536,7 +1536,7 @@ noncomputable def adaptiveEdgeIntervalFirst (hU : IsOpen U) omega⟩ /-- Second endpoint of a resolved adaptive-edge interval. -/ -noncomputable def adaptiveEdgeIntervalSecond (hU : IsOpen U) +@[expose] noncomputable def adaptiveEdgeIntervalSecond (hU : IsOpen U) (t : K.AdaptiveFace U) (i : ZMod 3) (j : K.AdaptiveEdgeInterval U hU t i) : K.realization := (K.boundaryEdgeVertexList U hU t i).get @@ -1733,7 +1733,7 @@ theorem mem_adaptiveFanFacesOver_iff (hU : IsOpen U) exact ⟨f.2, by simp, rfl⟩ /-- The `adaptiveFanFaceVertices` declaration. -/ -noncomputable def adaptiveFanFaceVertices (hU : IsOpen U) +@[expose] noncomputable def adaptiveFanFaceVertices (hU : IsOpen U) (f : K.AdaptiveFanFace U hU) : Finset K.realization := {K.adaptiveFaceCenter U f.1, K.adaptiveEdgeIntervalFirst U hU f.1 f.2.1 f.2.2, diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenCover.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenCover.lean index d78e3a8815..c6060c6e53 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenCover.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveOpenCover.lean @@ -17,7 +17,7 @@ one prescribed control neighborhood. Quantitative chart approximation can there the neighborhoods first and reuse the conforming triangulation unchanged. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTileComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTileComplex.lean index 5cfef46c86..3e39b7e114 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTileComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTileComplex.lean @@ -22,7 +22,7 @@ plane complex for one tile. The next layer proves that the transported tile com overlaps and takes their locally finite union. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -67,7 +67,7 @@ noncomputable def adaptiveFaceSourceHomeomorph (t : K.AdaptiveFace U) : exact (K.safeSubdivision t.1).homeo.continuous.comp continuous_subtype_val /-- The canonical standard-plane chart of an adaptive tile. -/ -noncomputable def adaptiveFacePlaneHomeomorph (t : K.AdaptiveFace U) : +@[expose] noncomputable def adaptiveFacePlaneHomeomorph (t : K.AdaptiveFace U) : K.AdaptiveClosedFace U t ≃ₜ standardTrianglePlaneComplex.support := (K.adaptiveFaceSourceHomeomorph U t).trans ((K.safeSubdivision t.1).refined.facePlaneHomeomorph t.2.1) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTriangulation.lean b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTriangulation.lean index efb0cc0693..2e8de146ec 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTriangulation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AdaptiveTriangulation.lean @@ -16,7 +16,7 @@ in a fan face. This no-junk representation is what lets compactness turn local finite intrinsic triangulation. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/AmbientHomeomorph.lean b/LeanPool/ClassificationOfSurfaces/Moise/AmbientHomeomorph.lean index 81288de203..68025c8bc0 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/AmbientHomeomorph.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/AmbientHomeomorph.lean @@ -15,7 +15,7 @@ the move fixes the patch frontier, it extends to an ambient homeomorphism by the file proves that pasting step independently of the particular triangulated patch. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -80,8 +80,11 @@ theorem coe_repositionHomeomorph_apply_realization (position' : M.Vertex → Pla (M.toPlaneComplex.realizationHomeomorph M.toPlaneComplex_isPure2 x) : Plane) = (M.reposition position' hposition_injective haffineIndependent htriangle_inter).toPlaneComplex.baryEval x.1 := by - exact congrArg Subtype.val (M.repositionHomeomorph_apply_realization position' + have h := congrArg Subtype.val (M.repositionHomeomorph_apply_realization position' hposition_injective haffineIndependent htriangle_inter x) + exact h.trans (PlaneComplex.realizationHomeomorph_apply + (M.reposition position' hposition_injective haffineIndependent htriangle_inter).toPlaneComplex + _ x) theorem coe_repositionHomeomorph_apply (position' : M.Vertex → Plane) (hposition_injective : Function.Injective position') @@ -105,7 +108,7 @@ theorem coe_repositionHomeomorph_apply (position' : M.Vertex → Plane) (M.reposition position' hposition_injective haffineIndependent htriangle_inter).toPlaneComplex.baryEval x.1 rw [hz, repositionHomeomorph_apply_realization] - rfl + exact PlaneComplex.realizationHomeomorph_apply _ _ _ theorem coe_repositionHomeomorph_trans_setCongr_apply (position' : M.Vertex → Plane) @@ -218,7 +221,7 @@ variable (M : TriangleMesh) /-- A repositioning with unchanged support and fixed support frontier extends to an ambient plane homeomorphism. -/ -noncomputable def ambientRepositionHomeomorph (position' : M.Vertex → Plane) +@[expose] noncomputable def ambientRepositionHomeomorph (position' : M.Vertex → Plane) (hposition_injective : Function.Injective position') (haffineIndependent : ∀ t ∈ M.triangles, AffineIndependent ℝ fun v : t => position' v) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean b/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean index b091b9fa40..1e580c61e7 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean @@ -28,7 +28,7 @@ affine independence of the three vertices, proved from non-collinearity by coord computation. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -36,7 +36,7 @@ namespace ClassificationOfSurfaces namespace Moise /-- The vertices of the standard triangle: `(0,0)`, `(1,0)`, `(0,1)`. -/ -def standardTriangleVertex : Fin 3 → Plane := +@[expose] def standardTriangleVertex : Fin 3 → Plane := ![!₂[(0 : ℝ), 0], !₂[(1 : ℝ), 0], !₂[(0 : ℝ), 1]] /-- The vertices of the standard triangle are not collinear. -/ @@ -81,7 +81,7 @@ theorem standardTriangleVertex_triple_affineIndependent (a b c : Fin 3) /-- **Positive anchor** for `PolygonalCircle`: the boundary of the standard triangle with vertices `(0,0)`, `(1,0)`, `(0,1)` is a polygonal simple closed curve. -/ -def standardTriangleCircle : PolygonalCircle where +@[expose] def standardTriangleCircle : PolygonalCircle where n := 3 three_le := le_rfl vertex := standardTriangleVertex diff --git a/LeanPool/ClassificationOfSurfaces/Moise/BoundaryInvariant.lean b/LeanPool/ClassificationOfSurfaces/Moise/BoundaryInvariant.lean index f755a58919..35be67c064 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/BoundaryInvariant.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/BoundaryInvariant.lean @@ -23,7 +23,7 @@ The frontier of the chart's extended target follows because its interior is cont interior of the model range. -/ -@[expose] public section +public section open scoped Manifold @@ -55,12 +55,12 @@ instance chartBoundaryInvariant_of_invarianceOfDomain exact hyNotInteriorRange (f.interior_extend_target_subset_interior_range hyInterior) /-- Reflection in the boundary line of the Euclidean half-plane. -/ -def reflectAcrossHalfPlaneBoundary (p : Moise.Plane) : Moise.Plane := +@[expose] def reflectAcrossHalfPlaneBoundary (p : Moise.Plane) : Moise.Plane := WithLp.toLp 2 (fun i => if i = 0 then -p i else p i) /-- Fold the plane onto the Euclidean half-plane by taking the absolute value of its normal coordinate. -/ -def foldPlaneToHalfSpace (p : Moise.Plane) : EuclideanHalfSpace 2 := +@[expose] def foldPlaneToHalfSpace (p : Moise.Plane) : EuclideanHalfSpace 2 := ⟨WithLp.toLp 2 (fun i => if i = 0 then |p i| else p i), by simp⟩ /-- Reflection across the boundary line is continuous. -/ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/BrokenLine.lean b/LeanPool/ClassificationOfSurfaces/Moise/BrokenLine.lean index a86628545e..b7854b1991 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/BrokenLine.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/BrokenLine.lean @@ -26,7 +26,7 @@ points extends or truncates a broken line by one segment. Preconnectedness of ` the complement to be empty. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -35,7 +35,7 @@ namespace Moise /-- `a` and `b` are joined by a broken line inside `U`: there is a finite chain of vertices starting at `a` and ending at `b` such that every consecutive closed segment lies in `U`. -/ -def JoinedByBrokenLine (U : Set Plane) (a b : Plane) : Prop := +@[expose] def JoinedByBrokenLine (U : Set Plane) (a b : Plane) : Prop := ∃ (n : ℕ) (v : Fin (n + 1) → Plane), v 0 = a ∧ v (Fin.last n) = b ∧ ∀ i : Fin n, segment ℝ (v i.castSucc) (v i.succ) ⊆ U diff --git a/LeanPool/ClassificationOfSurfaces/Moise/Brouwer.lean b/LeanPool/ClassificationOfSurfaces/Moise/Brouwer.lean index 793be143b9..6b52765b36 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/Brouwer.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/Brouwer.lean @@ -26,7 +26,7 @@ sphere that root is `1`, so the construction would be a retraction of the disk o contradicting `no_retraction_planeClosedUnitBall`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartExtraction.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartExtraction.lean index 72cb5c358e..574dd1fc5d 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ChartExtraction.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ChartExtraction.lean @@ -31,7 +31,7 @@ boundary-faithfulness: manifold-boundary points in the chart land on the frontie target, hence on the model edge line. -/ -@[expose] public section +public section open scoped Manifold open Topology @@ -44,7 +44,7 @@ namespace Moise open InvarianceOfDomain /-- The closed right half-plane, the ambient model for `EuclideanHalfSpace 2`. -/ -def HalfPlaneSet : Set Plane := +@[expose] def HalfPlaneSet : Set Plane := {v : Plane | 0 ≤ v 0} theorem continuous_coordZero : Continuous fun v : Plane => v 0 := @@ -63,7 +63,7 @@ noncomputable def recenter (p : Plane) (ε : ℝ) (hε : ε ≠ 0) : Plane ≃ variable {p : Plane} {ε : ℝ} theorem recenter_apply (hε : ε ≠ 0) (v : Plane) : - recenter p ε hε v = ε⁻¹ • (v + -p) := rfl + recenter p ε hε v = ε⁻¹ • (v + -p) := by rfl theorem recenter_symm_apply (hε : ε ≠ 0) (w : Plane) : (recenter p ε hε).symm w = ε • w + p := by @@ -136,13 +136,13 @@ inductive ChartKind where deriving DecidableEq, Repr /-- The model region of a chart kind: the open unit disk, or its closed-right half. -/ -def ChartKind.modelRegion : ChartKind → Set Plane +@[expose] def ChartKind.modelRegion : ChartKind → Set Plane | .disk => Metric.ball 0 1 | .halfDisk => {x ∈ Metric.ball 0 1 | 0 ≤ x 0} /-- The model core of a chart kind: the closed disk of radius one half, or its right half. Cores are compact and their union over a chart cover is what the Radó induction absorbs. -/ -def ChartKind.modelCore : ChartKind → Set Plane +@[expose] def ChartKind.modelCore : ChartKind → Set Plane | .disk => Metric.closedBall 0 (1 / 2) | .halfDisk => {x ∈ Metric.closedBall 0 (1 / 2) | 0 ≤ x 0} @@ -170,7 +170,7 @@ def halfDiskModelToHalfSpace : @[simp] theorem halfDiskModelToHalfSpace_val (p : ChartKind.halfDisk.modelRegion) : - (halfDiskModelToHalfSpace p).1 = p.1 := + (halfDiskModelToHalfSpace p).1 = p.1 := by rfl /-- The half-disk model is an open subset of the Euclidean half-space. -/ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean index 5b80fe71a7..dc094bdc30 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean @@ -19,7 +19,7 @@ This file completes the chart-induction framework developed in `ChartInductionCo the crossing weld, packages the one-chart induction step, and assembles the final triangulation. -/ -@[expose] public section +public section open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartInductionCore.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartInductionCore.lean index 255dd7aeb7..7b2419d525 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ChartInductionCore.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ChartInductionCore.lean @@ -40,7 +40,7 @@ This file provides the honest objects for that induction: * `moise_triangulation_of_boundaries` — the finite induction and final geometric realization. -/ -@[expose] public section +public section open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartPatch.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartPatch.lean index d04c220fac..5231612b09 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ChartPatch.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ChartPatch.lean @@ -20,7 +20,7 @@ corresponding half-disk patch. These strict margins are the concrete base geome Rado induction. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -50,16 +50,16 @@ noncomputable def chartDiamondAffineEquiv : Plane ≃ᵃ[ℝ] Plane := chartDiamondLinearEquiv.toAffineEquiv @[simp] theorem chartDiamondAffineEquiv_apply_zero (p : Plane) : - chartDiamondAffineEquiv p 0 = (3 / 4 : ℝ) * p 0 := rfl + chartDiamondAffineEquiv p 0 = (3 / 4 : ℝ) * p 0 := by rfl @[simp] theorem chartDiamondAffineEquiv_apply_one (p : Plane) : - chartDiamondAffineEquiv p 1 = (3 / 8 : ℝ) * p 1 := rfl + chartDiamondAffineEquiv p 1 = (3 / 8 : ℝ) * p 1 := by rfl @[simp] theorem chartDiamondAffineEquiv_symm_apply_zero (p : Plane) : - chartDiamondAffineEquiv.symm p 0 = (4 / 3 : ℝ) * p 0 := rfl + chartDiamondAffineEquiv.symm p 0 = (4 / 3 : ℝ) * p 0 := by rfl @[simp] theorem chartDiamondAffineEquiv_symm_apply_one (p : Plane) : - chartDiamondAffineEquiv.symm p 1 = (8 / 3 : ℝ) * p 1 := rfl + chartDiamondAffineEquiv.symm p 1 = (8 / 3 : ℝ) * p 1 := by rfl /-- The fixed four-triangle chart patch. -/ noncomputable def chartDiamondMesh : TriangleMesh := diff --git a/LeanPool/ClassificationOfSurfaces/Moise/CommonSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/CommonSubdivision.lean index a6c482986a..7773a0c6be 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/CommonSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/CommonSubdivision.lean @@ -16,7 +16,7 @@ subordinate to a target mesh with the same support, cut it by every barycentric- hyperplane of every target triangle. The resulting chambers lie in target triangles. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -277,7 +277,7 @@ theorem oppositeCoord_mem_coordinateLines (t : M.Triangle) (k : Fin 3) : simp [coordinateLines] /-- Cut `M` by every coordinate hyperplane of `N`. -/ -noncomputable def refineTo (M N : TriangleMesh) : TriangleMesh := +@[expose] noncomputable def refineTo (M N : TriangleMesh) : TriangleMesh := M.refineByLines N.coordinateLines theorem refineTo_support (N : TriangleMesh) : @@ -478,7 +478,7 @@ theorem exists_target_triangle_of_refineTo_of_interior_inter_support /-- Cut `M` by every face line of `N`, then retain exactly the chambers whose interiors meet the support of `N`. This is the unequal-support version of common refinement used in the local Radó weld. -/ -noncomputable def refineToSupport (N : TriangleMesh) : TriangleMesh := +@[expose] noncomputable def refineToSupport (N : TriangleMesh) : TriangleMesh := by classical exact (M.refineTo N).restrictTriangles fun t ↦ @@ -601,7 +601,7 @@ namespace PlaneComplex variable (K : PlaneComplex) /-- Regard the two-dimensional faces of a plane complex as the maximal triangles of a mesh. -/ -noncomputable def toTriangleMesh : TriangleMesh where +@[expose] noncomputable def toTriangleMesh : TriangleMesh where Vertex := K.Vertex position := K.position position_injective := K.position_injective @@ -712,7 +712,7 @@ variable (K : PlaneComplex) Unlike `mapComplex`, this construction does not require an irrelevant global injectivity hypothesis. The additional vertex hypothesis excludes unused vertices, whose images would not be controlled by injectivity on the support. -/ -noncomputable def mapComplexOn (f : Plane → Plane) +@[expose] noncomputable def mapComplexOn (f : Plane → Plane) (hvertex : ∀ v : K.Vertex, K.position v ∈ K.support) (hinj : Set.InjOn f K.support) (haffine : ∀ s ∈ K.simplexes, IsAffineOn f (K.cellCarrier s)) : PlaneComplex where @@ -822,7 +822,7 @@ theorem IsPure2.mapComplexOn (hpure : K.IsPure2) (f : Plane → Plane) exact hpure s hs /-- Map every face of a finite plane complex through a facewise-affine embedding. -/ -noncomputable def mapComplex (f : Plane → Plane) +@[expose] noncomputable def mapComplex (f : Plane → Plane) (hinj : Function.Injective f) (haffine : ∀ s ∈ K.simplexes, IsAffineOn f (K.cellCarrier s)) : PlaneComplex where Vertex := K.Vertex diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ConeExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/ConeExtension.lean index a586f227ea..7beaa2499b 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ConeExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ConeExtension.lean @@ -23,7 +23,7 @@ endpoints on the frontier. It is the face-to-face lemma behind the cone extensi on a triangle boundary. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -391,7 +391,7 @@ abbrev ActiveVertex := {v : K.Vertex // K.position v ∈ K.support} noncomputable instance activeVertexFintype : Fintype K.ActiveVertex := Fintype.ofFinite _ /-- The `activeEmbedding` declaration. -/ -def activeEmbedding : K.ActiveVertex ↪ K.Vertex := Function.Embedding.subtype _ +@[expose] def activeEmbedding : K.ActiveVertex ↪ K.Vertex := Function.Embedding.subtype _ /-- The `activeSimplexes` declaration. -/ noncomputable def activeSimplexes : Finset (Finset K.ActiveVertex) := @@ -408,7 +408,7 @@ theorem active_position_image (s : Finset K.ActiveVertex) : simp [activeEmbedding] /-- Delete all unused vertices without changing the support or any face geometry. -/ -noncomputable def active : PlaneComplex where +@[expose] noncomputable def active : PlaneComplex where Vertex := K.ActiveVertex position := fun v => K.position v.1 position_injective := fun v w h => Subtype.ext (K.position_injective h) @@ -560,7 +560,7 @@ theorem used_position_image (s : Finset K.UsedVertex) : simp [usedEmbedding] /-- Delete vertices unused by every face, without changing the represented complex. -/ -noncomputable def used : PlaneComplex where +@[expose] noncomputable def used : PlaneComplex where Vertex := K.UsedVertex position := fun v => K.position v.1 position_injective := fun v w h => Subtype.ext (K.position_injective h) @@ -745,7 +745,7 @@ theorem exists_affineMap_eqOn_affineIndependent {ι : Type*} [Nonempty ι] /-- Map a one-dimensional complex by a function affine on every face and injective on its support. -/ -noncomputable def mapGraph (f : Plane → Plane) +@[expose] noncomputable def mapGraph (f : Plane → Plane) (hvertex : ∀ v, K.position v ∈ K.support) (hinj : Set.InjOn f K.support) (hgraph : ∀ s ∈ K.simplexes, s.card ≤ 2) @@ -904,10 +904,10 @@ noncomputable def realizationHomeomorphAll : @[simp] theorem realizationHomeomorphAll_apply (x : GeometricRealization K.Vertex K.simplexes) : - (K.realizationHomeomorphAll x).1 = K.baryEval x.1 := rfl + (K.realizationHomeomorphAll x).1 = K.baryEval x.1 := by rfl /-- Reposition a plane complex while retaining its abstract simplexes. -/ -noncomputable def reposition (position' : K.Vertex → Plane) +@[expose] noncomputable def reposition (position' : K.Vertex → Plane) (hinj : Function.Injective position') (haff : ∀ s ∈ K.simplexes, AffineIndependent ℝ fun v : s => position' v) (hface : ∀ s ∈ K.simplexes, ∀ t ∈ K.simplexes, @@ -939,7 +939,7 @@ noncomputable def repositionHomeomorphAll (position' : K.Vertex → Plane) /-- The ambient function underlying barycentric repositioning, set to zero off the source support. -/ -noncomputable def repositionMap (position' : K.Vertex → Plane) +@[expose] noncomputable def repositionMap (position' : K.Vertex → Plane) (hinj : Function.Injective position') (haff : ∀ s ∈ K.simplexes, AffineIndependent ℝ fun v : s => position' v) (hface : ∀ s ∈ K.simplexes, ∀ t ∈ K.simplexes, @@ -1075,17 +1075,17 @@ def coneWeights (z : K.Vertex → ℝ) : Option K.Vertex → ℝ | none => 0 | some v => z v -@[simp] theorem coneWeights_none (z : K.Vertex → ℝ) : K.coneWeights z none = 0 := rfl +@[simp] theorem coneWeights_none (z : K.Vertex → ℝ) : K.coneWeights z none = 0 := by rfl @[simp] theorem coneWeights_some (z : K.Vertex → ℝ) (v : K.Vertex) : - K.coneWeights z (some v) = z v := rfl + K.coneWeights z (some v) = z v := by rfl theorem sum_coneWeights (z : K.Vertex → ℝ) : ∑ v, K.coneWeights z v = ∑ v, z v := by simp /-- Lift a base face to the non-cone vertices. -/ -def liftFace (s : Finset K.Vertex) : Finset (Option K.Vertex) := +@[expose] def liftFace (s : Finset K.Vertex) : Finset (Option K.Vertex) := s.map Function.Embedding.some /-- Remove the cone vertex from a cone face. -/ @@ -1207,7 +1207,7 @@ theorem baseCarrier_inter {t u : Finset (Option K.Vertex)} (K.baseFace_mem_of_nonempty hu hune) /-- Cone a finite one-dimensional complex supported on the frontier of a convex set. -/ -noncomputable def cone (S : Set Plane) (hS : Convex ℝ S) (c : Plane) +@[expose] noncomputable def cone (S : Set Plane) (hS : Convex ℝ S) (c : Plane) (hc : c ∈ interior S) (havoid : c ∉ Set.range K.position) (hgraph : ∀ s ∈ K.simplexes, s.card ≤ 2) (hsupport : K.support = frontier S) : PlaneComplex where diff --git a/LeanPool/ClassificationOfSurfaces/Moise/Countermodels.lean b/LeanPool/ClassificationOfSurfaces/Moise/Countermodels.lean index cdb1ce98cc..9831d4f6c9 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/Countermodels.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/Countermodels.lean @@ -36,7 +36,7 @@ Contents: documentation of why `GeometricTriangulation` replaces it. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/DualConnectivity.lean b/LeanPool/ClassificationOfSurfaces/Moise/DualConnectivity.lean index b05ade0df4..a204cb4f66 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/DualConnectivity.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/DualConnectivity.lean @@ -22,7 +22,7 @@ their closed carriers can meet only at triangulation vertices. Deleting that fi locus would therefore disconnect the surface, contradicting finite-puncture connectivity. -/ -@[expose] public section +public section open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ElementaryMove.lean b/LeanPool/ClassificationOfSurfaces/Moise/ElementaryMove.lean index a4157e7ce8..4976de9906 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ElementaryMove.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ElementaryMove.lean @@ -16,7 +16,7 @@ inside a fixed diamond. Repositioning the fan point while fixing the four diamo a PL homeomorphism of the diamond, and hence an ambient homeomorphism by identity extension. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -24,11 +24,11 @@ namespace ClassificationOfSurfaces namespace Moise /-- Vertices `0,1,2,3` are left, right, top, bottom; vertex `4` is the fan point. -/ -def diamondFanPosition (a : ℝ) : Fin 5 → Plane := +@[expose] def diamondFanPosition (a : ℝ) : Fin 5 → Plane := ![planePoint (-1) 0, planePoint 1 0, planePoint 0 2, planePoint 0 (-2), planePoint 0 a] /-- The four maximal triangles in the fan of the diamond. -/ -def diamondFanTriangles : Finset (Finset (Fin 5)) := +@[expose] def diamondFanTriangles : Finset (Finset (Fin 5)) := {{0, 4, 2}, {1, 2, 4}, {0, 3, 4}, {1, 4, 3}} @[simp] theorem diamondFanPosition_apply_zero (a : ℝ) : @@ -146,19 +146,19 @@ noncomputable def diamondUpDiagonalAffine (a : ℝ) : Plane →ᵃ[ℝ] ℝ := cartesianX + cartesianY - AffineMap.const ℝ Plane a @[simp] theorem diamondVerticalAffine_apply (x y : ℝ) : - diamondVerticalAffine (planePoint x y) = x := rfl + diamondVerticalAffine (planePoint x y) = x := by rfl @[simp] theorem diamondLeftAffine_apply (a x y : ℝ) : - diamondLeftAffine a (planePoint x y) = a * x - y + a := rfl + diamondLeftAffine a (planePoint x y) = a * x - y + a := by rfl @[simp] theorem diamondRightAffine_apply (a x y : ℝ) : - diamondRightAffine a (planePoint x y) = a * x + y - a := rfl + diamondRightAffine a (planePoint x y) = a * x + y - a := by rfl @[simp] theorem diamondDownDiagonalAffine_apply (a x y : ℝ) : - diamondDownDiagonalAffine a (planePoint x y) = x - y + a := rfl + diamondDownDiagonalAffine a (planePoint x y) = x - y + a := by rfl @[simp] theorem diamondUpDiagonalAffine_apply (a x y : ℝ) : - diamondUpDiagonalAffine a (planePoint x y) = x + y - a := rfl + diamondUpDiagonalAffine a (planePoint x y) = x + y - a := by rfl /-- Splitting one edge of a nondegenerate triangle at an interior parameter covers the original triangle by the two resulting triangles. -/ @@ -258,15 +258,15 @@ theorem triangle_edge_split_union (p : Fin 3 → Plane) (hp : AffineIndependent exact himage /-- The left triangular half of the fixed diamond. -/ -def diamondLeftRegion : Set Plane := +@[expose] def diamondLeftRegion : Set Plane := convexHull ℝ (Set.range ![planePoint 0 2, planePoint 0 (-2), planePoint (-1) 0]) /-- The right triangular half of the fixed diamond. -/ -def diamondRightRegion : Set Plane := +@[expose] def diamondRightRegion : Set Plane := convexHull ℝ (Set.range ![planePoint 0 2, planePoint 0 (-2), planePoint 1 0]) /-- The fixed closed patch supporting the elementary move. -/ -def diamondPatch : Set Plane := diamondLeftRegion ∪ diamondRightRegion +@[expose] def diamondPatch : Set Plane := diamondLeftRegion ∪ diamondRightRegion theorem isClosed_diamondPatch : IsClosed diamondPatch := by apply IsClosed.union @@ -554,7 +554,7 @@ theorem diamondSlackLL_baryEval (a : ℝ) (ha0 : -2 < a) (ha1 : a < 2) linarith /-- Closed four-halfspace description of the diamond. -/ -def InDiamond (p : Plane) : Prop := +@[expose] def InDiamond (p : Plane) : Prop := 0 ≤ diamondSlackUR p ∧ 0 ≤ diamondSlackUL p ∧ 0 ≤ diamondSlackLR p ∧ 0 ≤ diamondSlackLL p @@ -603,7 +603,7 @@ theorem diamondPatch_eq_inDiamond : diamondPatch = {p | InDiamond p} := by all_goals ring /-- Points satisfying all four diamond inequalities strictly form an open subset of the patch. -/ -def StrictlyInDiamond : Set Plane := +@[expose] def StrictlyInDiamond : Set Plane := {p | 0 < diamondSlackUR p ∧ 0 < diamondSlackUL p ∧ 0 < diamondSlackLR p ∧ 0 < diamondSlackLL p} @@ -638,7 +638,7 @@ theorem strictlyInDiamond_subset_interior : StrictlyInDiamond ⊆ interior diamo interior_maximal strictlyInDiamond_subset_patch isOpen_strictlyInDiamond /-- The fixed abstract diamond fan with its center repositioned from height `a` to height `b`. -/ -noncomputable def diamondFanReposition (a b : ℝ) +@[expose] noncomputable def diamondFanReposition (a b : ℝ) (ha0 : -2 < a) (ha1 : a < 2) (hb0 : -2 < b) (hb1 : b < 2) : TriangleMesh := (diamondFanMesh a ha0 ha1).reposition (diamondFanPosition b) (diamondFanPosition_injective hb0 hb1) @@ -671,7 +671,7 @@ theorem diamondFanReposition_baryEval_eq_of_center_zero (a b : ℝ) simp [diamondFanPosition, Fin.sum_univ_succ, h4] /-- Preserve barycentric coordinates while moving the fan point from `(0,a)` to `(0,b)`. -/ -noncomputable def diamondFanSupportHomeomorph (a b : ℝ) +@[expose] noncomputable def diamondFanSupportHomeomorph (a b : ℝ) (ha0 : -2 < a) (ha1 : a < 2) (hb0 : -2 < b) (hb1 : b < 2) : (diamondFanMesh a ha0 ha1).toPlaneComplex.support ≃ₜ (diamondFanReposition a b ha0 ha1 hb0 hb1).toPlaneComplex.support := @@ -722,6 +722,7 @@ theorem diamondFanSupportHomeomorph_center (a b : ℝ) simp [InDiamond] constructor <;> linarith⟩ := by apply Subtype.ext + rw [PlaneComplex.realizationHomeomorph_apply] exact diamondFanCenterRealization_baryEval a ha0 ha1 change ((diamondFanMesh a ha0 ha1).repositionHomeomorph (diamondFanPosition b) (diamondFanPosition_injective hb0 hb1) @@ -765,7 +766,7 @@ theorem diamondFanSupportHomeomorph_center (a b : ℝ) simp [Pi.single_apply] /-- The barycentric fan move, viewed as a self-homeomorphism of the original diamond support. -/ -noncomputable def diamondFanPatchHomeomorph (a b : ℝ) +@[expose] noncomputable def diamondFanPatchHomeomorph (a b : ℝ) (ha0 : -2 < a) (ha1 : a < 2) (hb0 : -2 < b) (hb1 : b < 2) : (diamondFanMesh a ha0 ha1).toPlaneComplex.support ≃ₜ (diamondFanMesh a ha0 ha1).toPlaneComplex.support := @@ -837,7 +838,7 @@ theorem diamondFanPatchHomeomorph_fixed_frontier (a b : ℝ) _ = p := by simpa only [weights, x, e] using hbary /-- The elementary fan move extended by the identity to the whole plane. -/ -noncomputable def diamondFanAmbientHomeomorph (a b : ℝ) +@[expose] noncomputable def diamondFanAmbientHomeomorph (a b : ℝ) (ha0 : -2 < a) (ha1 : a < 2) (hb0 : -2 < b) (hb1 : b < 2) : Plane ≃ₜ Plane := (diamondFanMesh a ha0 ha1).ambientRepositionHomeomorph (diamondFanPosition b) (diamondFanPosition_injective hb0 hb1) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/EmbeddedComplexValence.lean b/LeanPool/ClassificationOfSurfaces/Moise/EmbeddedComplexValence.lean index 53f9b47452..25260eee45 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/EmbeddedComplexValence.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/EmbeddedComplexValence.lean @@ -21,7 +21,7 @@ used implicitly in Moise's gluing theorem: two pages around an edge already form neighborhood, so a third page approaching the same edge would have to enter their open image. -/ -@[expose] public section +public section open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FacewiseComparison.lean b/LeanPool/ClassificationOfSurfaces/Moise/FacewiseComparison.lean index 98132c7045..709ffa74e8 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FacewiseComparison.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FacewiseComparison.lean @@ -42,7 +42,7 @@ Everything is arranged for a realization with shrunken approximation controls radii; the resulting entry point is `exists_controlled_polygonalReplacement_of_comparison`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FineSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/FineSubdivision.lean index 4094cd1f2e..2f46f1b1c2 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FineSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FineSubdivision.lean @@ -17,7 +17,7 @@ support by small balls and, around every center, cut by two vertical and two hor Every chamber meeting the corresponding smaller ball is trapped in the resulting rectangle. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FinitePLHomeomorph.lean b/LeanPool/ClassificationOfSurfaces/Moise/FinitePLHomeomorph.lean index 8c7fdac518..c297270d23 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FinitePLHomeomorph.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FinitePLHomeomorph.lean @@ -17,7 +17,7 @@ finite source complex on which an ambient homeomorphism is affine facewise. Com and pullback make these witnesses closed under symmetry and composition. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -249,7 +249,7 @@ theorem inverseOn_injOn_target : Set.InjOn F.inverseOn P.target.support := by /-- The actual source complex obtained by mapping the common target refinement through the certified inverse. It has the same vertex and simplex labels as the target refinement. -/ -noncomputable def source : PlaneComplex := +@[expose] noncomputable def source : PlaneComplex := P.target.mapComplexOn F.inverseOn P.target_vertex_mem_support P.inverseOn_injOn_target P.inverseAffine diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangle.lean b/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangle.lean index f8512c5d47..6c815c6610 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangle.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangle.lean @@ -17,7 +17,7 @@ Schoenflies induction. A finite planar triangle mesh with infinite frontier has to exactly one triangle, hence a free triangle that can be removed by a supported ambient move. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -29,19 +29,20 @@ namespace TriangleMesh variable (M : TriangleMesh) /-- The geometric carrier of a maximal triangle. -/ -def triangleCarrier (t : Finset M.Vertex) : Set Plane := +@[expose] def triangleCarrier (t : Finset M.Vertex) : Set Plane := convexHull ℝ (M.position '' (t : Set M.Vertex)) /-- The two-element faces occurring in maximal triangles. -/ -def edges : Finset (Finset M.Vertex) := +@[expose] def edges : Finset (Finset M.Vertex) := M.triangles.biUnion fun t => t.powersetCard 2 /-- Maximal triangles incident to an edge. -/ +@[expose] def incidentTriangles (e : Finset M.Vertex) : Finset (Finset M.Vertex) := M.triangles.filter fun t => e ⊆ t /-- A boundary edge is incident to exactly one maximal triangle. -/ -def IsBoundaryEdge (e : Finset M.Vertex) : Prop := +@[expose] def IsBoundaryEdge (e : Finset M.Vertex) : Prop := e ∈ M.edges ∧ (M.incidentTriangles e).card = 1 /-- A weakly free triangle contains an incidence-one edge. This is the boundary-edge precursor @@ -51,7 +52,7 @@ def IsFreeTriangle (t : Finset M.Vertex) : Prop := t ∈ M.triangles ∧ ∃ e, M.IsBoundaryEdge e ∧ e ⊆ t /-- The three abstract edges of a maximal triangle. -/ -def triangleEdges (t : Finset M.Vertex) : Finset (Finset M.Vertex) := +@[expose] def triangleEdges (t : Finset M.Vertex) : Finset (Finset M.Vertex) := t.powersetCard 2 /-- The boundary edges belonging to a maximal triangle. -/ @@ -71,7 +72,7 @@ theorem mem_allBoundaryEdges_iff {e : Finset M.Vertex} : simp [allBoundaryEdges, IsBoundaryEdge] /-- The finite union of the geometric carriers of all incidence-one mesh edges. -/ -noncomputable def boundaryCarrier : Set Plane := +@[expose] noncomputable def boundaryCarrier : Set Plane := ⋃ e ∈ M.allBoundaryEdges, convexHull ℝ (M.position '' (e : Set M.Vertex)) theorem isCompact_boundaryCarrier : IsCompact M.boundaryCarrier := by @@ -1531,7 +1532,7 @@ theorem frontier_inter_triangleCarrier_diff_vertices {t : Finset M.Vertex} exact convexHull_mono (Set.image_mono heData.1) hpEdge /-- No mesh vertex contributes an isolated point to this triangle's frontier trace. -/ -def HasNoIsolatedFrontierVertex (t : Finset M.Vertex) : Prop := +@[expose] def HasNoIsolatedFrontierVertex (t : Finset M.Vertex) : Prop := ∀ v : M.Vertex, M.position v ∈ frontier M.toPlaneComplex.support → M.position v ∈ M.triangleCarrier t → ∃ e ∈ M.boundaryEdges t, diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean b/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean index 0ad4cdee9d..eaa8cbf401 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean @@ -15,7 +15,7 @@ This file transports the normalized thin-kite move to an arbitrary plane triangl supplies the small positive thickness required by the relative polygonal Schoenflies theorem. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -23,29 +23,29 @@ namespace ClassificationOfSurfaces namespace Moise /-- An affine equivalence of the plane, regarded as a homeomorphism. -/ -noncomputable def affineEquivHomeomorph (e : Plane ≃ᵃ[ℝ] Plane) : Plane ≃ₜ Plane where +@[expose] noncomputable def affineEquivHomeomorph (e : Plane ≃ᵃ[ℝ] Plane) : Plane ≃ₜ Plane where toEquiv := e.toEquiv continuous_toFun := e.toAffineMap.continuous_of_finiteDimensional continuous_invFun := e.symm.toAffineMap.continuous_of_finiteDimensional @[simp] theorem affineEquivHomeomorph_apply (e : Plane ≃ᵃ[ℝ] Plane) (p : Plane) : - affineEquivHomeomorph e p = e p := rfl + affineEquivHomeomorph e p = e p := by rfl @[simp] theorem affineEquivHomeomorph_symm_apply (e : Plane ≃ᵃ[ℝ] Plane) (p : Plane) : - (affineEquivHomeomorph e).symm p = e.symm p := rfl + (affineEquivHomeomorph e).symm p = e.symm p := by rfl theorem affineEquivHomeomorph_image_segment (e : Plane ≃ᵃ[ℝ] Plane) (a b : Plane) : affineEquivHomeomorph e '' segment ℝ a b = segment ℝ (e a) (e b) := by exact image_segment ℝ e.toAffineMap a b /-- Conjugate the normalized kite move by an affine coordinate system. -/ -noncomputable def transportedThinKiteHomeomorph (e : Plane ≃ᵃ[ℝ] Plane) +@[expose] noncomputable def transportedThinKiteHomeomorph (e : Plane ≃ᵃ[ℝ] Plane) (δ : ℝ) (hδ : 0 < δ) : Plane ≃ₜ Plane := (affineEquivHomeomorph e).symm.trans ((thinKiteAmbientHomeomorph δ hδ).trans (affineEquivHomeomorph e)) /-- The `transportedThinKitePatch` declaration. -/ -def transportedThinKitePatch (e : Plane ≃ᵃ[ℝ] Plane) (δ : ℝ) : Set Plane := +@[expose] def transportedThinKitePatch (e : Plane ≃ᵃ[ℝ] Plane) (δ : ℝ) : Set Plane := e '' thinKitePatch δ theorem transportedThinKiteHomeomorph_eqOn_compl (e : Plane ≃ᵃ[ℝ] Plane) @@ -193,13 +193,13 @@ theorem triangleEdges_eq_orderedEdges (T : M.Triangle) : · simp_all /-- Moise's first free-triangle case: the frontier meets the triangle in exactly its base edge. -/ -def IsOneEdgeFreeTriangle (T : M.Triangle) (k : Fin 3) : Prop := +@[expose] def IsOneEdgeFreeTriangle (T : M.Triangle) (k : Fin 3) : Prop := frontier M.toPlaneComplex.support ∩ M.triangleCarrier T.1 = segment ℝ (M.freeTriangleOrder T k 0) (M.freeTriangleOrder T k 1) /-- Moise's second free-triangle case: the frontier meets the triangle in exactly the two edges through the apex. -/ -def IsTwoEdgeFreeTriangle (T : M.Triangle) (k : Fin 3) : Prop := +@[expose] def IsTwoEdgeFreeTriangle (T : M.Triangle) (k : Fin 3) : Prop := frontier M.toPlaneComplex.support ∩ M.triangleCarrier T.1 = segment ℝ (M.freeTriangleOrder T k 0) (M.freeTriangleOrder T k 2) ∪ segment ℝ (M.freeTriangleOrder T k 1) (M.freeTriangleOrder T k 2) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FrontierGlue.lean b/LeanPool/ClassificationOfSurfaces/Moise/FrontierGlue.lean index a842673786..5f78d97738 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FrontierGlue.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FrontierGlue.lean @@ -16,7 +16,7 @@ continuously with the unchanged map outside the open set. This file isolates th argument from the later complex bookkeeping. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean b/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean index bd7c3c17f1..9cf0bfce45 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean @@ -29,7 +29,7 @@ Semantic anchors (see `Moise/Countermodels.lean` and the Definition Faithfulness * non-example: `ℝ` and `ℚ` admit no geometric triangulation (they are not compact). -/ -@[expose] public section +public section /-- A finite closed cover of a preconnected set has a connected intersection graph. @@ -102,7 +102,7 @@ variable (𝕜 : Type*) (ι : Type*) [Semiring 𝕜] [PartialOrder 𝕜] [Fintyp /-- The standard simplex in the space of functions `ι → 𝕜` is the set of vectors with non-negative coordinates with total sum `1`. -/ -def stdSimplex : Set (ι → 𝕜) := +@[expose] def stdSimplex : Set (ι → 𝕜) := {f | (∀ x, 0 ≤ f x) ∧ ∑ x, f x = 1} theorem stdSimplex_eq_inter : @@ -206,7 +206,7 @@ noncomputable def map (f : X → Y) (s : stdSimplex S X) : stdSimplex S Y := ⟨FunOnFinite.linearMap S S f s, image_linearMap f (by aesop)⟩ @[simp] lemma map_coe (f : X → Y) (s : stdSimplex S X) : - ⇑(map f s) = FunOnFinite.linearMap S S f s := rfl + ⇑(map f s) = FunOnFinite.linearMap S S f s := by rfl @[simp] lemma map_id_apply (x : stdSimplex S X) : map id x = x := by aesop @@ -265,7 +265,7 @@ end stdSimplex points of the standard simplex on `V` whose support lies inside some face of `F`. For a face `t` this carves out the geometric simplex spanned by `t`, so the realization is the finite union of the geometric simplexes of `F`, glued along shared barycentric-coordinate faces. -/ -def GeometricRealization (V : Type*) [Fintype V] (F : Finset (Finset V)) : Set (V → ℝ) := +@[expose] def GeometricRealization (V : Type*) [Fintype V] (F : Finset (Finset V)) : Set (V → ℝ) := {x | x ∈ stdSimplex ℝ V ∧ ∃ t ∈ F, ∀ v ∉ t, x v = 0} /-- The geometric simplex carried by one finite set of vertices. -/ @@ -390,7 +390,7 @@ def edges (faces : Finset (Finset Vertex)) : Finset (Finset Vertex) := faces.biUnion fun t => t.powersetCard 2 /-- Two listed triangles are dual-adjacent when they share a two-vertex face. -/ -def FaceAdjacent (faces : Finset (Finset Vertex)) (f g : Face faces) : Prop := +@[expose] def FaceAdjacent (faces : Finset (Finset Vertex)) (f g : Face faces) : Prop := ∃ e : Finset Vertex, e.card = 2 ∧ e ⊆ f.1 ∧ e ⊆ g.1 /-- Two listed triangles are adjacent at `v` when they share a two-vertex face containing `v`. @@ -497,7 +497,7 @@ theorem mem_of_reflTransGen_faceAdjacentAtVertex | tail _h hstep _ih => exact mem_right_of_faceAdjacentAtVertex hstep /-- Every two listed triangles are connected by a finite chain of shared edges. -/ -def IsDualConnected (faces : Finset (Finset Vertex)) : Prop := +@[expose] def IsDualConnected (faces : Finset (Finset Vertex)) : Prop := ∀ f g : Face faces, Relation.ReflTransGen (FaceAdjacent faces) f g /-- Every pair of triangles incident to one vertex can be joined through shared edges. @@ -584,7 +584,7 @@ theorem IsVertexStarConnected.isDualConnected exact hstar v a b (Finset.mem_inter.mp hv).1 (Finset.mem_inter.mp hv).2)) f g (hinter f g) /-- Regard a face of a subfamily as a face of a larger family. -/ -def faceOfSubset {faces faces' : Finset (Finset Vertex)} (h : faces ⊆ faces') : +@[expose] def faceOfSubset {faces faces' : Finset (Finset Vertex)} (h : faces ⊆ faces') : Face faces → Face faces' := fun f => ⟨f.1, h f.2⟩ @@ -592,7 +592,7 @@ omit [DecidableEq Vertex] in @[simp] theorem faceOfSubset_val {faces faces' : Finset (Finset Vertex)} (h : faces ⊆ faces') (f : Face faces) : (faceOfSubset h f).1 = f.1 := - rfl + by rfl omit [DecidableEq Vertex] in theorem faceAdjacent_faceOfSubset {faces faces' : Finset (Finset Vertex)} @@ -650,7 +650,7 @@ theorem isDualConnected_union {left right : Finset (Finset Vertex)} simpa [f', g', faceOfSubset] using hpath /-- A face from each family shares a genuine two-vertex edge in the union family. -/ -def HasCrossEdge (left right : Finset (Finset Vertex)) : Prop := +@[expose] def HasCrossEdge (left right : Finset (Finset Vertex)) : Prop := ∃ (fleft : Face left) (fright : Face right), FaceAdjacent (left ∪ right) (faceOfSubset Finset.subset_union_left fleft) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean index d912978192..c3d97b1239 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean @@ -18,7 +18,7 @@ constructions trim each embedded edge at the last exits from those regions and p remaining pairwise-disjoint compact arcs. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -1929,7 +1929,7 @@ theorem completeCarrier_avoids_nonincident end CentralPolygonalArc /-- The selected replacement arc for an enumerated edge. -/ -noncomputable def replacementArc {h : Plane → Plane} (hcont : ContinuousOn h K.support) +@[expose] noncomputable def replacementArc {h : Plane → Plane} (hcont : ContinuousOn h K.support) (D : K.VertexDiskControl h) (C : K.CentralTubeControl hcont D) (i : Fin (Fintype.card K.EdgeFace)) : K.CentralPolygonalArc hcont D C i := K.centralPolygonalArc hcont D C i @@ -1945,7 +1945,7 @@ noncomputable def rawMiddleBreakpoint (A.exitData.right - A.exitData.left) + 2) / 4 /-- The `middleSourceScalarMap` declaration. -/ -noncomputable def middleSourceScalarMap +@[expose] noncomputable def middleSourceScalarMap {h : Plane → Plane} {hcont : ContinuousOn h K.support} {D : K.VertexDiskControl h} {C : K.CentralTubeControl hcont D} {i : Fin (Fintype.card K.EdgeFace)} @@ -1956,7 +1956,7 @@ noncomputable def middleSourceScalarMap ((4 : ℝ) • K.edgeParameter i - AffineMap.const ℝ Plane 2)) /-- The `middleSourceMap` declaration. -/ -noncomputable def middleSourceMap +@[expose] noncomputable def middleSourceMap {h : Plane → Plane} {hcont : ContinuousOn h K.support} {D : K.VertexDiskControl h} {C : K.CentralTubeControl hcont D} {i : Fin (Fintype.card K.EdgeFace)} @@ -2668,7 +2668,7 @@ theorem graphReplacementMap_affineOn_middle {h : Plane → Plane} exact ⟨x, hx, rfl⟩ rw [K.graphReplacementMap_eq_edge_on_cellCarrier hcont D C i (hui hx), K.edgeReplacementMap_eq_middle hcont D C i (hui hx) (hmid0 x hx) (hmid1 x hx)] - exact hg hxSource + simpa only [middleSourceMap_apply, Function.comp_apply] using hg hxSource /-- The simultaneous edge replacement is affine on every face of its named common source subdivision. -/ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean index 26b2181dd5..50403b05ee 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean @@ -16,7 +16,7 @@ points. When the marks lie in the graph support, the subordinate arrangement is of the graph and every mark is a vertex of that subdivision. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -149,11 +149,11 @@ theorem markedEdgeChain_segment (point : P → Plane) rw [himage, convexHull_pair] /-- The `markedEdgeArrangement` declaration. -/ -noncomputable def markedEdgeArrangement (point : P → Plane) : PlaneComplex := +@[expose] noncomputable def markedEdgeArrangement (point : P → Plane) : PlaneComplex := (K.markedEdgeChain point).arrangementMesh.toPlaneComplex /-- The `markedEdgeSubdivision` declaration. -/ -noncomputable def markedEdgeSubdivision (point : P → Plane) : PlaneComplex := +@[expose] noncomputable def markedEdgeSubdivision (point : P → Plane) : PlaneComplex := (K.markedEdgeArrangement point).subordinateTo K theorem markedEdgeSubdivision_support_eq (point : P → Plane) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean index 5728846421..45ce132fb8 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean @@ -18,7 +18,7 @@ source edge. Keeping only arrangement faces subordinate to an original face pro subdivision of the graph. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -121,11 +121,11 @@ variable (K : PlaneComplex) abbrev EdgeFace := {e : Finset K.Vertex // e ∈ K.edges} /-- The `edgeEquiv` declaration. -/ -noncomputable def edgeEquiv : K.EdgeFace ≃ Fin (Fintype.card K.EdgeFace) := +@[expose] noncomputable def edgeEquiv : K.EdgeFace ≃ Fin (Fintype.card K.EdgeFace) := Fintype.equivFin K.EdgeFace /-- The `edgeAt` declaration. -/ -noncomputable def edgeAt (i : Fin (Fintype.card K.EdgeFace)) : K.EdgeFace := +@[expose] noncomputable def edgeAt (i : Fin (Fintype.card K.EdgeFace)) : K.EdgeFace := K.edgeEquiv.symm i /-- The `vertexEquiv` declaration. -/ @@ -160,7 +160,7 @@ theorem edgeAt_mem_simplexes (i : Fin (Fintype.card K.EdgeFace)) : (Finset.mem_filter.mp (K.edgeAt i).2).1 /-- Affine coordinate from `0` to `1` on an enumerated source edge. -/ -noncomputable def edgeParameter (i : Fin (Fintype.card K.EdgeFace)) : +@[expose] noncomputable def edgeParameter (i : Fin (Fintype.card K.EdgeFace)) : Plane →ᵃ[ℝ] ℝ := if _ : K.position (K.edgeFirst i) 0 ≠ K.position (K.edgeSecond i) 0 then (K.position (K.edgeSecond i) 0 - K.position (K.edgeFirst i) 0)⁻¹ • @@ -233,7 +233,7 @@ theorem exists_vertexAt (v : K.Vertex) : ∃ i, K.vertexAt i = v := by /-- The auxiliary chain has one genuine edge segment at every even index; odd segments merely connect one enumerated edge to the next and are discarded by `subordinateTo`. -/ -noncomputable def edgeChain : BrokenLineData (Set.univ : Set Plane) := by +@[expose] noncomputable def edgeChain : BrokenLineData (Set.univ : Set Plane) := by classical let m := Fintype.card K.EdgeFace let q := Fintype.card K.Vertex diff --git a/LeanPool/ClassificationOfSurfaces/Moise/HalfPlanePolygon.lean b/LeanPool/ClassificationOfSurfaces/Moise/HalfPlanePolygon.lean index a75ad59439..ceb7dbd430 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/HalfPlanePolygon.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/HalfPlanePolygon.lean @@ -22,7 +22,7 @@ file records the elementary but important consequence: once the replacement poly that half-plane, its bounded Schoenflies filling stays there as well. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCellwiseExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCellwiseExtension.lean index d1483fc4c0..3ac7417d16 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCellwiseExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCellwiseExtension.lean @@ -20,7 +20,7 @@ glues the finite family. Coherence is proved from the common global one-skeleto it is not stored as an extra compatibility assumption. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseCellwiseExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseCellwiseExtension.lean index f914336568..614c3ddebd 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseCellwiseExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseCellwiseExtension.lean @@ -20,7 +20,7 @@ from `IntrinsicCloseGraphApproximation`. The proofs parallel the first intrinsi construction, but the boundary map is now the second, metrically controlled graph replacement. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseGraphApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseGraphApproximation.lean index 9fd995e12d..bd4b58ea0c 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseGraphApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicCloseGraphApproximation.lean @@ -18,7 +18,7 @@ embedding to this model and applying the plane graph approximation theorem gives arbitrarily close second replacement. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicComplex.lean index 010cad2412..508cb076ea 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicComplex.lean @@ -20,7 +20,7 @@ facewise affine formulas and subordination to old faces. Thus an arbitrary home be installed as a subdivision by bookkeeping alone. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -54,7 +54,7 @@ def ambientFaceCarrier (t : Finset K.Vertex) : Set (K.Vertex → ℝ) := {x | x ∈ stdSimplex ℝ K.Vertex ∧ ∀ v ∉ t, x v = 0} /-- The carrier of a listed triangle as a subset of the realization. -/ -def faceCarrier (t : Finset K.Vertex) : Set K.realization := +@[expose] def faceCarrier (t : Finset K.Vertex) : Set K.realization := {x | ∀ v ∉ t, x.1 v = 0} theorem mem_realization_iff (x : K.Vertex → ℝ) : @@ -97,6 +97,7 @@ theorem realization_eq_iUnion_faceCarrier : · exact Set.subset_univ _ /-- The intrinsic subcomplex obtained by retaining a selected family of maximal faces. -/ +@[expose] def restrictFaces (p : Finset K.Vertex → Prop) [DecidablePred p] : IntrinsicTwoComplex where Vertex := K.Vertex faces := K.faces.filter p @@ -108,7 +109,7 @@ def restrictFaces (p : Finset K.Vertex → Prop) [DecidablePred p] : IntrinsicTw (K.restrictFaces p).faces = K.faces.filter p := rfl /-- The canonical inclusion of a face restriction into the old realization. -/ -def restrictFacesInclusion (p : Finset K.Vertex → Prop) +@[expose] def restrictFacesInclusion (p : Finset K.Vertex → Prop) [decidablePred : DecidablePred p] : (K.restrictFaces p).realization → K.realization := fun x => ⟨x.1, x.2.1, by @@ -117,7 +118,7 @@ def restrictFacesInclusion (p : Finset K.Vertex → Prop) @[simp] theorem restrictFacesInclusion_val (p : Finset K.Vertex → Prop) [DecidablePred p] (x : (K.restrictFaces p).realization) : - (K.restrictFacesInclusion p x).1 = x.1 := rfl + (K.restrictFacesInclusion p x).1 = x.1 := by rfl theorem isEmbedding_restrictFacesInclusion (p : Finset K.Vertex → Prop) [decidablePred : DecidablePred p] : @@ -155,12 +156,12 @@ theorem restrictFacesInclusion_range (p : Finset K.Vertex → Prop) /-! ## Intrinsic vertices and edges -/ /-- The edges of an intrinsic two-complex. -/ -def edges : Finset (Finset K.Vertex) := +@[expose] def edges : Finset (Finset K.Vertex) := K.faces.biUnion fun t => t.powersetCard 2 /-- The abstract two-complex has surface edge valence when every edge is contained in at most two maximal triangles. -/ -def HasSurfaceEdgeValence : Prop := +@[expose] def HasSurfaceEdgeValence : Prop := ∀ e ∈ K.edges, (K.faces.filter fun t => e ⊆ t).card ≤ 2 theorem card_of_mem_edges {e : Finset K.Vertex} (he : e ∈ K.edges) : e.card = 2 := by @@ -207,7 +208,7 @@ noncomputable def faceVertexEquiv (t : K.Face) : Fin 3 ≃ t.1 := rw [Fintype.card_fin, Fintype.card_coe, K.faces_card t.1 t.2]) /-- Cyclically indexed vertices of a maximal face. -/ -noncomputable def faceVertex (t : K.Face) (i : ZMod 3) : K.Vertex := +@[expose] noncomputable def faceVertex (t : K.Face) (i : ZMod 3) : K.Vertex := (K.faceVertexEquiv t ((ZMod.finEquiv 3).symm i)).1 theorem faceVertex_mem (t : K.Face) (i : ZMod 3) : K.faceVertex t i ∈ t.1 := @@ -255,7 +256,7 @@ noncomputable def faceEdge (t : K.Face) (i : ZMod 3) : K.Edge := by · simp [K.faceVertex_ne_next t i] @[simp] theorem faceEdge_val (t : K.Face) (i : ZMod 3) : - (K.faceEdge t i).1 = {K.faceVertex t i, K.faceVertex t (i + 1)} := rfl + (K.faceEdge t i).1 = {K.faceVertex t i, K.faceVertex t (i + 1)} := by rfl /-- The consecutive face edges share exactly their common cyclic vertex. -/ theorem faceEdge_inter_next (t : K.Face) (i : ZMod 3) : @@ -296,7 +297,7 @@ theorem faceEdge_ne_next (t : K.Face) (i : ZMod 3) : abbrev UsedVertex : Type := {v : K.Vertex // ∃ t ∈ K.faces, v ∈ t} /-- A cyclic face vertex with explicit evidence that it occurs in the complex. -/ -noncomputable def faceUsedVertex (t : K.Face) (i : ZMod 3) : K.UsedVertex := +@[expose] noncomputable def faceUsedVertex (t : K.Face) (i : ZMod 3) : K.UsedVertex := ⟨K.faceVertex t i, t.1, t.2, K.faceVertex_mem t i⟩ /-- A chosen maximal face containing a used vertex. -/ @@ -310,7 +311,7 @@ theorem usedVertex_mem_parent (v : K.UsedVertex) : v.1 ∈ K.usedVertexParent v (Classical.choose_spec v.2).2 /-- The canonical barycentric point of a used vertex. -/ -noncomputable def vertexPoint (v : K.UsedVertex) : K.realization := +@[expose] noncomputable def vertexPoint (v : K.UsedVertex) : K.realization := ⟨Pi.single v.1 1, single_mem_stdSimplex ℝ v.1, by refine ⟨K.usedVertexParent v, K.usedVertexParent_mem v, ?_⟩ intro w hw @@ -374,7 +375,7 @@ theorem edgeSecond_mem (e : K.Edge) : K.edgeSecond e ∈ e.1 := by simp /-- The canonical barycentric realization point associated to a vertex of an edge. -/ -noncomputable def edgeVertexPoint (e : K.Edge) (v : K.Vertex) (hv : v ∈ e.1) : +@[expose] noncomputable def edgeVertexPoint (e : K.Edge) (v : K.Vertex) (hv : v ∈ e.1) : K.realization := ⟨Pi.single v 1, single_mem_stdSimplex ℝ v, by refine ⟨K.edgeParent e, K.edgeParent_mem e, ?_⟩ @@ -392,11 +393,11 @@ theorem edgeVertexPoint_eq_vertexPoint (e : K.Edge) (v : K.Vertex) (hv : v ∈ e rfl /-- Canonical first endpoint in the barycentric realization. -/ -noncomputable def edgeFirstPoint (e : K.Edge) : K.realization := +@[expose] noncomputable def edgeFirstPoint (e : K.Edge) : K.realization := K.edgeVertexPoint e (K.edgeFirst e) (K.edgeFirst_mem e) /-- Canonical second endpoint in the barycentric realization. -/ -noncomputable def edgeSecondPoint (e : K.Edge) : K.realization := +@[expose] noncomputable def edgeSecondPoint (e : K.Edge) : K.realization := K.edgeVertexPoint e (K.edgeSecond e) (K.edgeSecond_mem e) /-- The first endpoint as a used vertex. -/ @@ -762,7 +763,7 @@ structure Subdivision where namespace Subdivision /-- Every intrinsic complex is a subdivision of itself. -/ -noncomputable def refl : K.Subdivision where +@[expose] noncomputable def refl : K.Subdivision where refined := K homeo := Homeomorph.refl K.realization affineOnFace := by @@ -774,11 +775,11 @@ noncomputable def refl : K.Subdivision where intro t ht exact ⟨t, ht, fun x hx => hx⟩ -@[simp] theorem refl_refined : (refl K).refined = K := rfl +@[simp] theorem refl_refined : (refl K).refined = K := by rfl /-- Faithful intrinsic subdivisions compose. -/ -noncomputable def trans {K : IntrinsicTwoComplex} +@[expose] noncomputable def trans {K : IntrinsicTwoComplex} (R : K.Subdivision) (Q : R.refined.Subdivision) : K.Subdivision where refined := Q.refined homeo := Q.homeo.trans R.homeo @@ -799,11 +800,11 @@ noncomputable def trans {K : IntrinsicTwoComplex} exact ⟨s, hs, fun x hx => hus (Q.homeo x) (htu x hx)⟩ @[simp] theorem trans_refined (R : K.Subdivision) (Q : R.refined.Subdivision) : - (R.trans Q).refined = Q.refined := rfl + (R.trans Q).refined = Q.refined := by rfl theorem trans_homeo_apply (R : K.Subdivision) (Q : R.refined.Subdivision) (x : Q.refined.realization) : - (R.trans Q).homeo x = R.homeo (Q.homeo x) := rfl + (R.trans Q).homeo x = R.homeo (Q.homeo x) := by rfl end Subdivision @@ -890,7 +891,7 @@ noncomputable def refl : K.PLHomeomorph K where intro x hx rfl -@[simp] theorem refl_apply (x : K.realization) : (refl K).toHomeomorph x = x := rfl +@[simp] theorem refl_apply (x : K.realization) : (refl K).toHomeomorph x = x := by rfl end PLHomeomorph diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceBoundary.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceBoundary.lean index 9162493e71..d4d5303679 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceBoundary.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceBoundary.lean @@ -18,7 +18,7 @@ actually carry those three edges, resolves all their segments simultaneously, an resulting simple polygonal cycle. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean index c84e1f08a9..439dfab530 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean @@ -18,7 +18,7 @@ edge. The construction below is topological; the finite conforming subdivision that it is PL is kept as a separate obligation. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceFilling.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceFilling.lean index e079f53d19..6ab6aa0a3d 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceFilling.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceFilling.lean @@ -19,7 +19,7 @@ that this map is genuinely PL on one named finite subdivision. Polygonal Schoen it by a finite PL homeomorphism, without changing any shared-edge boundary values. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean index f63339d4a5..4339b4e09b 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean @@ -16,7 +16,7 @@ the explicit coordinate reindexing homeomorphism to the standard plane triangle. source-side bridge used to apply the already proved polygonal Schoenflies extension cellwise. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -87,12 +87,12 @@ variable (K : IntrinsicTwoComplex) (ZMod.finEquiv 3).symm i = i := rfl /-- The chosen ordering of one intrinsic face, viewed as an embedding into all vertices. -/ -noncomputable def faceVertexEmbedding (t : K.Face) : Fin 3 ↪ K.Vertex where +@[expose] noncomputable def faceVertexEmbedding (t : K.Face) : Fin 3 ↪ K.Vertex where toFun i := (K.faceVertexEquiv t i).1 inj' := fun _ _ hij => (K.faceVertexEquiv t).injective (Subtype.ext hij) /-- The two standard indices belonging to cyclic side `i`. -/ -noncomputable def faceStandardEdge (i : ZMod 3) : Finset (Fin 3) := +@[expose] noncomputable def faceStandardEdge (i : ZMod 3) : Finset (Fin 3) := {(ZMod.finEquiv 3).symm i, (ZMod.finEquiv 3).symm (i + 1)} theorem faceVertexEmbedding_cyclic (t : K.Face) (i : ZMod 3) : @@ -204,7 +204,7 @@ theorem standardTriangle_oneSkeleton_support : abbrev ClosedFace (t : K.Face) := {x : K.realization // x ∈ K.faceCarrier t.1} /-- Reindex the barycentric coordinates of an intrinsic face by its chosen `Fin 3` ordering. -/ -noncomputable def faceReindexToStandard (t : K.Face) (x : K.ClosedFace t) : +@[expose] noncomputable def faceReindexToStandard (t : K.Face) (x : K.ClosedFace t) : standardTrianglePlaneComplex.toIntrinsic.realization := by let z : Fin 3 → ℝ := fun i => x.1.1 (K.faceVertexEquiv t i).1 refine ⟨z, ⟨?_, ?_⟩, ⟨Finset.univ, standardTriangle_univ_mem_cells, ?_⟩⟩ @@ -274,7 +274,7 @@ theorem continuous_faceReindexToStandard (t : K.Face) : /-- The canonical barycentric homeomorphism from one intrinsic face to the standard intrinsic triangle. -/ -noncomputable def faceReindexHomeomorph (t : K.Face) : +@[expose] noncomputable def faceReindexHomeomorph (t : K.Face) : K.ClosedFace t ≃ₜ standardTrianglePlaneComplex.toIntrinsic.realization := by let e : K.ClosedFace t ≃ standardTrianglePlaneComplex.toIntrinsic.realization := { toFun := K.faceReindexToStandard t @@ -317,14 +317,14 @@ theorem faceReindexToStandard_mem_faceCarrier (t : K.Face) (s : Finset (Fin 3)) exact hj (hkj' ▸ hks) /-- The standard plane realization of one intrinsic closed face. -/ -noncomputable def facePlaneHomeomorph (t : K.Face) : +@[expose] noncomputable def facePlaneHomeomorph (t : K.Face) : K.ClosedFace t ≃ₜ standardTrianglePlaneComplex.support := (K.faceReindexHomeomorph t).trans (standardTrianglePlaneComplex.realizationHomeomorph standardTrianglePlaneComplex_pure) /-- Restrict ambient intrinsic barycentric coordinates to the ordered vertices of one face. -/ -noncomputable def faceCoordRestrictionAffine (t : K.Face) : +@[expose] noncomputable def faceCoordRestrictionAffine (t : K.Face) : (K.Vertex → ℝ) →ᵃ[ℝ] (Fin 3 → ℝ) := AffineMap.pi fun j => (LinearMap.proj (K.faceVertexEmbedding t j)).toAffineMap @@ -337,7 +337,7 @@ noncomputable def faceCoordRestrictionAffine (t : K.Face) : /-- The forward standard-plane chart is affine in the ambient intrinsic barycentric coordinates. -/ -noncomputable def facePlaneForwardAffine (t : K.Face) : +@[expose] noncomputable def facePlaneForwardAffine (t : K.Face) : (K.Vertex → ℝ) →ᵃ[ℝ] Plane := standardTrianglePlaneComplex.baryEvalAffine.comp (K.faceCoordRestrictionAffine t) @@ -376,7 +376,7 @@ noncomputable def faceCoordExtensionAffine (t : K.Face) : /-- The barycentric-coordinate formula for the inverse standard plane chart of one intrinsic face. -/ -noncomputable def facePlaneInverseAffine (t : K.Face) : +@[expose] noncomputable def facePlaneInverseAffine (t : K.Face) : Plane →ᵃ[ℝ] (K.Vertex → ℝ) := (K.faceCoordExtensionAffine t).comp (standardTrianglePlaneComplex.faceCoords standardTriangleMeshFace) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFineSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFineSubdivision.lean index c343597a3a..4647091949 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFineSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFineSubdivision.lean @@ -17,7 +17,7 @@ each new face is at most half that of its parent. This supplies the finite fine open-subcomplex extraction used in the compact form of Moise Chapter 8, Theorem 2. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -29,11 +29,11 @@ namespace IntrinsicTwoComplex variable (K : IntrinsicTwoComplex) /-- The barycentric realization point at a specified vertex of a specified maximal face. -/ -noncomputable def facePoint (t : K.Face) (v : t.1) : K.realization := +@[expose] noncomputable def facePoint (t : K.Face) (v : t.1) : K.realization := K.vertexPoint ⟨v.1, t.1, t.2, v.2⟩ @[simp] theorem facePoint_val (t : K.Face) (v : t.1) : - (K.facePoint t v).1 = Pi.single v.1 1 := rfl + (K.facePoint t v).1 = Pi.single v.1 1 := by rfl theorem facePoint_mem_faceCarrier (t : K.Face) (v : t.1) : K.facePoint t v ∈ K.faceCarrier t.1 := @@ -180,7 +180,7 @@ theorem midpointEvalAffine_facePoint simpa only [← K.midpointEval_val] using K.midpointEval_facePoint s w /-- A mesh bound measured after transporting each refined face into the original realization. -/ -def Subdivision.MeshLE {K : IntrinsicTwoComplex} (R : K.Subdivision) (d : ℝ) : Prop := +@[expose] def Subdivision.MeshLE {K : IntrinsicTwoComplex} (R : K.Subdivision) (d : ℝ) : Prop := ∀ t ∈ R.refined.faces, ∀ x ∈ R.refined.faceCarrier t, ∀ y ∈ R.refined.faceCarrier t, dist (R.homeo x) (R.homeo y) ≤ d @@ -356,7 +356,8 @@ theorem Subdivision.meshLE_trans_midpoint change dist ((R.homeo (R.refined.midpointEval x)).1) ((R.homeo (R.refined.midpointEval y)).1) = _ rw [ha _ hxParent, ha _ hyParent] - rfl + exact congrArg₂ (fun u v => dist (a u) (a v)) + (R.refined.midpointEval_val x) (R.refined.midpointEval_val y) rw [hxy] refine hvw.trans ?_ have hbv : b (R.refined.midpointComplex.facePoint S v).1 = @@ -397,7 +398,7 @@ theorem Subdivision.refl_meshLE (K : IntrinsicTwoComplex) : constructor <;> linarith /-- The `n`-fold intrinsic midpoint subdivision. -/ -noncomputable def iteratedMidpointSubdivision (K : IntrinsicTwoComplex) : +@[expose] noncomputable def iteratedMidpointSubdivision (K : IntrinsicTwoComplex) : (n : ℕ) → K.Subdivision | 0 => Subdivision.refl K | n + 1 => @@ -405,12 +406,12 @@ noncomputable def iteratedMidpointSubdivision (K : IntrinsicTwoComplex) : R.trans R.refined.midpointSubdivision @[simp] theorem iteratedMidpointSubdivision_zero (K : IntrinsicTwoComplex) : - K.iteratedMidpointSubdivision 0 = Subdivision.refl K := rfl + K.iteratedMidpointSubdivision 0 = Subdivision.refl K := by rfl theorem iteratedMidpointSubdivision_succ (K : IntrinsicTwoComplex) (n : ℕ) : K.iteratedMidpointSubdivision (n + 1) = (K.iteratedMidpointSubdivision n).trans - (K.iteratedMidpointSubdivision n).refined.midpointSubdivision := rfl + (K.iteratedMidpointSubdivision n).refined.midpointSubdivision := by rfl /-- Every iterated midpoint refinement preserves the surface edge-valence bound. -/ theorem hasSurfaceEdgeValence_iteratedMidpointSubdivision diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphApproximation.lean index 11061e49e4..bd34a87272 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphApproximation.lean @@ -17,7 +17,7 @@ to canonical barycentric realizations. The target geometry is unchanged: finite embedded arcs admit uniform disjoint vertex disks and nonincident edge tubes. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -1388,7 +1388,7 @@ theorem edgeAt_spec (x : K.realization) (hx : x ∈ K.oneSkeleton) : Classical.choose_spec hx /-- The edgewise replacement map, expressed on the intrinsic edge carrier. -/ -noncomputable def edgeReplacementMap {h : K.realization → Plane} +@[expose] noncomputable def edgeReplacementMap {h : K.realization → Plane} (hcont : Continuous h) (hinj : Function.Injective h) (D : K.VertexDiskControl h) (C : K.CentralTubeControl hcont hinj D) (e : K.Edge) (x : K.realization) : Plane := diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean index 284a69e8bc..1a1931a500 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean @@ -18,7 +18,7 @@ transferred to that plane complex and the ordinary plane one-skeleton approximat be applied at an arbitrary tolerance. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphPL.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphPL.lean index e0b6a89aa2..c7b969e52b 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphPL.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphPL.lean @@ -17,7 +17,7 @@ of the middle PL segment model between its two last-exit parameters. Marking th in the source arrangement makes the closed subsegment an exact finite subcomplex. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -242,7 +242,7 @@ abbrev EdgeBreakpoint (A : K.CentralPolygonalArc hcont hinj D C e) := Option (Option A.parameterization.source.Vertex) /-- The `edgeBreakpointParameter` declaration. -/ -noncomputable def edgeBreakpointParameter +@[expose] noncomputable def edgeBreakpointParameter (A : K.CentralPolygonalArc hcont hinj D C e) (b : EdgeBreakpoint A) : ℝ := match b with | none => 1 / 2 diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMarkedFan.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMarkedFan.lean index 571b287696..38b304db2d 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMarkedFan.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMarkedFan.lean @@ -19,7 +19,7 @@ the two incident face charts can introduce incompatible auxiliary points. This that global finite edge order and its consecutive intervals. -/ -@[expose] public section +public section open scoped BigOperators @@ -2689,7 +2689,7 @@ noncomputable def fanVertexEmbedding (f : M.FanFace) : exact congrArg (fun z : M.FanVertex ↦ z.1) hpq /-- The three vertices of a marked fan face, regarded as global used vertices. -/ -noncomputable def globalFanFaceVertices (f : M.FanFace) : +@[expose] noncomputable def globalFanFaceVertices (f : M.FanFace) : Finset M.FanVertex := (M.fanFaceVertices f).attach.map (M.fanVertexEmbedding f) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMidpointSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMidpointSubdivision.lean index f2fba8d74f..0e8f625362 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMidpointSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicMidpointSubdivision.lean @@ -17,7 +17,7 @@ indexed by the old edge itself, the construction is automatically coherent acros faces. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -53,21 +53,21 @@ variable (K : IntrinsicTwoComplex) abbrev MidpointVertex := K.Vertex ⊕ K.Edge /-- The corner triangle at the `i`-th vertex of an old face. -/ -noncomputable def midpointCornerFace (t : K.Face) (i : ZMod 3) : +@[expose] noncomputable def midpointCornerFace (t : K.Face) (i : ZMod 3) : Finset K.MidpointVertex := {Sum.inl (K.faceVertex t i), Sum.inr (K.faceEdge t i), Sum.inr (K.faceEdge t (i + 2))} /-- The central triangle of the midpoint subdivision of an old face. -/ -noncomputable def midpointCentralFace (t : K.Face) : Finset K.MidpointVertex := +@[expose] noncomputable def midpointCentralFace (t : K.Face) : Finset K.MidpointVertex := Finset.univ.image (fun i : ZMod 3 => Sum.inr (K.faceEdge t i)) /-- The four midpoint triangles belonging to one old face. -/ -noncomputable def midpointFacesOver (t : K.Face) : Finset (Finset K.MidpointVertex) := +@[expose] noncomputable def midpointFacesOver (t : K.Face) : Finset (Finset K.MidpointVertex) := (Finset.univ.image (K.midpointCornerFace t)) ∪ {K.midpointCentralFace t} /-- All maximal faces in the midpoint subdivision. -/ -noncomputable def midpointFaces : Finset (Finset K.MidpointVertex) := +@[expose] noncomputable def midpointFaces : Finset (Finset K.MidpointVertex) := K.faces.attach.biUnion K.midpointFacesOver theorem faceEdge_ne_add_two (t : K.Face) (i : ZMod 3) : @@ -113,7 +113,7 @@ theorem midpointFacesOver_card (t : K.Face) {s : Finset K.MidpointVertex} exact K.midpointCentralFace_card t /-- The finite abstract complex underlying midpoint subdivision. -/ -noncomputable def midpointComplex : IntrinsicTwoComplex where +@[expose] noncomputable def midpointComplex : IntrinsicTwoComplex where Vertex := K.MidpointVertex faces := K.midpointFaces faces_card := by @@ -133,7 +133,7 @@ theorem exists_parentFace_of_mem_midpointFaces /-- A chosen parent of a midpoint-subdivision face. Geometric arguments use only `midpointFace_mem_parent`; uniqueness is not needed for the adaptive open-complex construction. -/ -noncomputable def midpointParentFace (s : K.midpointComplex.Face) : K.Face := +@[expose] noncomputable def midpointParentFace (s : K.midpointComplex.Face) : K.Face := Classical.choose (K.exists_parentFace_of_mem_midpointFaces s.2) theorem midpointFace_mem_parent (s : K.midpointComplex.Face) : @@ -141,7 +141,7 @@ theorem midpointFace_mem_parent (s : K.midpointComplex.Face) : Classical.choose_spec (K.exists_parentFace_of_mem_midpointFaces s.2) /-- Canonical old barycentric position of a midpoint-subdivision vertex. -/ -noncomputable def midpointPosition : K.MidpointVertex → (K.Vertex → ℝ) +@[expose] noncomputable def midpointPosition : K.MidpointVertex → (K.Vertex → ℝ) | Sum.inl v => Pi.single v 1 | Sum.inr e => fun v => if v ∈ e.1 then (2 : ℝ)⁻¹ else 0 @@ -168,7 +168,7 @@ theorem sum_midpointPosition (w : K.MidpointVertex) : · simp [midpointPosition, K.card_of_mem_edges e.2] /-- Affine barycentric evaluation from midpoint coordinates to old coordinates. -/ -noncomputable def midpointEvalAffine : +@[expose] noncomputable def midpointEvalAffine : (K.MidpointVertex → ℝ) →ᵃ[ℝ] (K.Vertex → ℝ) := (∑ w, (LinearMap.proj w).smulRight (K.midpointPosition w)).toAffineMap @@ -1332,7 +1332,7 @@ theorem sum_midpointEvalAffine (x : K.midpointComplex.realization) : _ = 1 := x.2.1.2 /-- Canonical affine map from the midpoint realization into the old realization. -/ -noncomputable def midpointEval (x : K.midpointComplex.realization) : K.realization := by +@[expose] noncomputable def midpointEval (x : K.midpointComplex.realization) : K.realization := by refine ⟨K.midpointEvalAffine x.1, ⟨K.midpointEvalAffine_nonneg x, K.sum_midpointEvalAffine x⟩, ?_⟩ obtain ⟨s, hs, hxs⟩ := x.2.2 @@ -1340,7 +1340,7 @@ noncomputable def midpointEval (x : K.midpointComplex.realization) : K.realizati exact ⟨t.1, t.2, fun v hv => K.midpointEvalAffine_support t hst hxs hv⟩ @[simp] theorem midpointEval_val (x : K.midpointComplex.realization) : - (K.midpointEval x).1 = K.midpointEvalAffine x.1 := rfl + (K.midpointEval x).1 = K.midpointEvalAffine x.1 := by rfl theorem continuous_midpointEval : Continuous K.midpointEval := by apply Continuous.subtype_mk @@ -1371,7 +1371,7 @@ theorem surjective_midpointEval : Function.Surjective K.midpointEval := by exact ⟨x, Subtype.ext hx⟩ /-- The canonical midpoint realization map is a homeomorphism. -/ -noncomputable def midpointHomeomorph : +@[expose] noncomputable def midpointHomeomorph : K.midpointComplex.realization ≃ₜ K.realization := Continuous.homeoOfEquivCompactToT2 (f := Equiv.ofBijective K.midpointEval @@ -1379,10 +1379,10 @@ noncomputable def midpointHomeomorph : K.continuous_midpointEval @[simp] theorem midpointHomeomorph_apply (x : K.midpointComplex.realization) : - K.midpointHomeomorph x = K.midpointEval x := rfl + K.midpointHomeomorph x = K.midpointEval x := by rfl /-- The intrinsic 1-to-4 midpoint subdivision, with its canonical faithful realization map. -/ -noncomputable def midpointSubdivision : K.Subdivision where +@[expose] noncomputable def midpointSubdivision : K.Subdivision where refined := K.midpointComplex homeo := K.midpointHomeomorph affineOnFace := by @@ -1397,7 +1397,7 @@ noncomputable def midpointSubdivision : K.Subdivision where K.midpointSubdivision.refined = K.midpointComplex := rfl theorem midpointSubdivision_homeo_apply (x : K.midpointComplex.realization) : - K.midpointSubdivision.homeo x = K.midpointEval x := rfl + K.midpointSubdivision.homeo x = K.midpointEval x := by rfl end IntrinsicTwoComplex diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicSubdivision.lean index ea865a1760..fc482e5d72 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicSubdivision.lean @@ -18,7 +18,7 @@ subdivision induces a faithful intrinsic subdivision through the barycentric rea homeomorphisms. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -31,7 +31,7 @@ variable (K : PlaneComplex) /-- Forget the planar placement of a complex, retaining its maximal triangles as an intrinsic two-complex. -/ -@[reducible] def toIntrinsic : IntrinsicTwoComplex where +@[expose, reducible] def toIntrinsic : IntrinsicTwoComplex where Vertex := K.Vertex faces := K.cells faces_card := fun _ ht => K.card_of_mem_cells ht @@ -39,7 +39,7 @@ two-complex. -/ @[simp] theorem toIntrinsic_faces : K.toIntrinsic.faces = K.cells := rfl /-- Barycentric evaluation is an affine map on the ambient coordinate space. -/ -noncomputable def baryEvalAffine : (K.Vertex → ℝ) →ᵃ[ℝ] Plane := +@[expose] noncomputable def baryEvalAffine : (K.Vertex → ℝ) →ᵃ[ℝ] Plane := (∑ v, (LinearMap.proj v).smulRight (K.position v)).toAffineMap @[simp] theorem baryEvalAffine_apply (x : K.Vertex → ℝ) : diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LineSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/LineSubdivision.lean index ca9309822b..239534e11f 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LineSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LineSubdivision.lean @@ -18,7 +18,7 @@ file develops that construction from its local primitive: when an affine functio signs at the endpoints of an edge, its zero gives the new subdivision vertex on that edge. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -26,7 +26,7 @@ namespace ClassificationOfSurfaces namespace Moise /-- Three affinely independent points form an affine basis of the plane. -/ -noncomputable def affineBasisOfTriangle (p : Fin 3 → Plane) (hp : AffineIndependent ℝ p) : +@[expose] noncomputable def affineBasisOfTriangle (p : Fin 3 → Plane) (hp : AffineIndependent ℝ p) : AffineBasis (Fin 3) ℝ Plane where toFun := p ind' := hp @@ -312,7 +312,7 @@ theorem convexHull_image_inter_of_affine_separation {V : Type*} [DecidableEq V] /-! ## The reference split of a triangle -/ /-- A point of the Euclidean plane with the displayed Cartesian coordinates. -/ -def planePoint (x y : ℝ) : Plane := +@[expose] def planePoint (x y : ℝ) : Plane := WithLp.toLp 2 ![x, y] @[simp] theorem planePoint_apply_zero (x y : ℝ) : planePoint x y 0 = x := rfl @@ -362,17 +362,17 @@ theorem referenceSplit_triangle2_affineIndependent {a b : ℝ} (ha0 : 0 < a) nlinarith /-- The first Cartesian coordinate, regarded as an affine functional. -/ -noncomputable def cartesianX : Plane →ᵃ[ℝ] ℝ := +@[expose] noncomputable def cartesianX : Plane →ᵃ[ℝ] ℝ := ((LinearMap.proj (R := ℝ) (φ := fun _ : Fin 2 => ℝ) 0).comp (WithLp.linearEquiv 2 ℝ (Fin 2 → ℝ)).toLinearMap).toAffineMap /-- The second Cartesian coordinate, regarded as an affine functional. -/ -noncomputable def cartesianY : Plane →ᵃ[ℝ] ℝ := +@[expose] noncomputable def cartesianY : Plane →ᵃ[ℝ] ℝ := ((LinearMap.proj (R := ℝ) (φ := fun _ : Fin 2 => ℝ) 1).comp (WithLp.linearEquiv 2 ℝ (Fin 2 → ℝ)).toLinearMap).toAffineMap -@[simp] theorem cartesianX_apply (p : Plane) : cartesianX p = p 0 := rfl -@[simp] theorem cartesianY_apply (p : Plane) : cartesianY p = p 1 := rfl +@[simp] theorem cartesianX_apply (p : Plane) : cartesianX p = p 0 := by rfl +@[simp] theorem cartesianY_apply (p : Plane) : cartesianY p = p 1 := by rfl /-- The affine line through the two new edge points in the reference split. -/ noncomputable def referenceOuterAffine (a b : ℝ) : Plane →ᵃ[ℝ] ℝ := @@ -388,14 +388,14 @@ noncomputable def referenceVertexAffine (a b : ℝ) : Plane →ᵃ[ℝ] ℝ := cartesianX + (a * (1 + b) / (2 * b)) • cartesianY - AffineMap.const ℝ Plane a @[simp] theorem referenceOuterAffine_planePoint (a b x y : ℝ) : - referenceOuterAffine a b (planePoint x y) = a⁻¹ * x + b⁻¹ * y - 1 := rfl + referenceOuterAffine a b (planePoint x y) = a⁻¹ * x + b⁻¹ * y - 1 := by rfl @[simp] theorem referenceDiagonalAffine_planePoint (a x y : ℝ) : - referenceDiagonalAffine a (planePoint x y) = x + a * y - a := rfl + referenceDiagonalAffine a (planePoint x y) = x + a * y - a := by rfl @[simp] theorem referenceVertexAffine_planePoint (a b x y : ℝ) : referenceVertexAffine a b (planePoint x y) = - x + (a * (1 + b) / (2 * b)) * y - a := rfl + x + (a * (1 + b) / (2 * b)) * y - a := by rfl private theorem affineIndependent_referenceTriangle0 {a b : ℝ} (ha0 : 0 < a) (hb0 : 0 < b) : @@ -448,7 +448,7 @@ private theorem affineIndependent_referenceTriangle2 {a b : ℝ} (ha0 : 0 < a) /-- The three triangles produced when a line meets the two edges issuing from the origin of the standard triangle. -/ -noncomputable def referenceSplitMesh (a b : ℝ) (ha0 : 0 < a) (ha1 : a < 1) +@[expose] noncomputable def referenceSplitMesh (a b : ℝ) (ha0 : 0 < a) (ha1 : a < 1) (hb0 : 0 < b) (hb1 : b < 1) : TriangleMesh where Vertex := Fin 5 position := referenceSplitPosition a b @@ -793,11 +793,11 @@ theorem referenceSplitMesh_support (a b : ℝ) (ha0 : 0 < a) (ha1 : a < 1) /-! ## The reference split through one vertex -/ /-- The `referenceEdgeSplitPosition` declaration. -/ -def referenceEdgeSplitPosition (c : ℝ) : Fin 4 → Plane := +@[expose] def referenceEdgeSplitPosition (c : ℝ) : Fin 4 → Plane := ![planePoint 0 0, planePoint 1 0, planePoint 0 1, planePoint c 0] /-- The `referenceEdgeSplitTriangles` declaration. -/ -def referenceEdgeSplitTriangles : Finset (Finset (Fin 4)) := +@[expose] def referenceEdgeSplitTriangles : Finset (Finset (Fin 4)) := {{0, 2, 3}, {1, 2, 3}} theorem referenceEdgeSplitPosition_injective {c : ℝ} (hc0 : 0 < c) (hc1 : c < 1) : @@ -849,7 +849,7 @@ private theorem affineIndependent_referenceEdgeTriangle1 {c : ℝ} (hc1 : c < 1) exact h /-- The two-triangle reference mesh used when the cutting line passes through vertex `2`. -/ -noncomputable def referenceEdgeSplitMesh (c : ℝ) (hc0 : 0 < c) (hc1 : c < 1) : +@[expose] noncomputable def referenceEdgeSplitMesh (c : ℝ) (hc0 : 0 < c) (hc1 : c < 1) : TriangleMesh where Vertex := Fin 4 position := referenceEdgeSplitPosition c @@ -1084,7 +1084,7 @@ end affineCutPoint /-! ## The transported split of an arbitrary triangle -/ /-- The ordered vertices of the standard triangle. -/ -def standardTrianglePosition : Fin 3 → Plane := +@[expose] def standardTrianglePosition : Fin 3 → Plane := ![planePoint 0 0, planePoint 1 0, planePoint 0 1] theorem standardTrianglePosition_affineIndependent : @@ -1093,7 +1093,7 @@ theorem standardTrianglePosition_affineIndependent : norm_num [standardTrianglePosition, planePoint_apply_zero, planePoint_apply_one, PiLp.sub_apply] /-- The parameter at which a line cuts the edge from the positive vertex to a negative vertex. -/ -noncomputable def triangleCutParameter (f : Plane →ᵃ[ℝ] ℝ) (p q : Plane) : ℝ := +@[expose] noncomputable def triangleCutParameter (f : Plane →ᵃ[ℝ] ℝ) (p q : Plane) : ℝ := f p / (f p - f q) /-- The reference split transported to an arbitrary ordered triangle. The first vertex is on @@ -1147,7 +1147,7 @@ noncomputable def triangleEquiv (t : M.Triangle) : t.1 ≃ Fin 3 := rw [Fintype.card_coe, M.card_triangle t.1 t.2]) /-- A proof-independent ordering of the three vertices of a maximal triangle. -/ -noncomputable def orderedVertex (t : M.Triangle) : Fin 3 → M.Vertex := +@[expose] noncomputable def orderedVertex (t : M.Triangle) : Fin 3 → M.Vertex := fun i => ((M.triangleEquiv t).symm i).1 theorem orderedVertex_injective (t : M.Triangle) : @@ -1219,11 +1219,11 @@ noncomputable def cutRefinedVertex (u v : M.Vertex) ⟨Finset.mem_product.mpr ⟨Finset.mem_univ _, Finset.mem_univ _⟩, huv⟩, rfl⟩⟩ @[simp] theorem oldRefinedVertex_val (v : M.Vertex) : - (M.oldRefinedVertex f v : Plane) = M.position v := rfl + (M.oldRefinedVertex f v : Plane) = M.position v := by rfl @[simp] theorem cutRefinedVertex_val (u v : M.Vertex) (huv : f (M.position u) * f (M.position v) < 0) : - (M.cutRefinedVertex f u v huv : Plane) = M.pairCutPosition f u v := rfl + (M.cutRefinedVertex f u v huv : Plane) = M.pairCutPosition f u v := by rfl theorem pairCutPosition_eq_reverse (u v : M.Vertex) (huv : f (M.position u) * f (M.position v) < 0) : @@ -1258,14 +1258,14 @@ theorem refinementPoints_neg : M.refinementPoints (-f) = M.refinementPoints f := exact affineCutPoint.neg f (M.position uv.1) (M.position uv.2) /-- Identifying the coherent vertex pools for `f` and `-f`; geometrically this is the identity. -/ -noncomputable def refinedVertexNegEquiv : M.RefinedVertex (-f) ≃ M.RefinedVertex f where +@[expose] noncomputable def refinedVertexNegEquiv : M.RefinedVertex (-f) ≃ M.RefinedVertex f where toFun v := ⟨v.1, by rw [← M.refinementPoints_neg f]; exact v.2⟩ invFun v := ⟨v.1, by rw [M.refinementPoints_neg f]; exact v.2⟩ left_inv v := Subtype.ext rfl right_inv v := Subtype.ext rfl @[simp] theorem refinedVertexNegEquiv_val (v : M.RefinedVertex (-f)) : - (M.refinedVertexNegEquiv f v : Plane) = v := rfl + (M.refinedVertexNegEquiv f v : Plane) = v := by rfl /-- The five vertices of the strict `+--` model in the coherent global vertex pool. -/ noncomputable def strictModelVertex (t : M.Triangle) @@ -1495,7 +1495,7 @@ noncomputable def strictVerticesEmbedding (v : Fin 3 → M.Vertex) standardTrianglePosition_affineIndependent hv).injective hpos /-- The `strictMeshFor` declaration. -/ -noncomputable def strictMeshFor (v : Fin 3 → M.Vertex) +@[expose] noncomputable def strictMeshFor (v : Fin 3 → M.Vertex) (hv : AffineIndependent ℝ (M.position ∘ v)) (h0 : 0 < f (M.position (v 0))) (h1 : f (M.position (v 1)) < 0) (h2 : f (M.position (v 2)) < 0) : TriangleMesh := @@ -1556,7 +1556,7 @@ theorem strictMeshFor_support (v : Fin 3 → M.Vertex) standardTrianglePosition_affineIndependent hv /-- The `strictNegativeMeshFor` declaration. -/ -noncomputable def strictNegativeMeshFor (v : Fin 3 → M.Vertex) +@[expose] noncomputable def strictNegativeMeshFor (v : Fin 3 → M.Vertex) (hv : AffineIndependent ℝ (M.position ∘ v)) (h0 : f (M.position (v 0)) < 0) (h1 : 0 < f (M.position (v 1))) (h2 : 0 < f (M.position (v 2))) : TriangleMesh := @@ -1647,7 +1647,7 @@ noncomputable def edgeVerticesEmbedding (v : Fin 3 → M.Vertex) standardTrianglePosition_affineIndependent hv).injective hpos /-- The `edgeMeshFor` declaration. -/ -noncomputable def edgeMeshFor (v : Fin 3 → M.Vertex) +@[expose] noncomputable def edgeMeshFor (v : Fin 3 → M.Vertex) (hv : AffineIndependent ℝ (M.position ∘ v)) (h0 : 0 < f (M.position (v 0))) (h1 : f (M.position (v 1)) < 0) : TriangleMesh := let c := triangleCutParameter f (M.position (v 0)) (M.position (v 1)) @@ -1699,7 +1699,7 @@ theorem edgeMeshFor_support (v : Fin 3 → M.Vertex) standardTrianglePosition_affineIndependent hv /-- The `edgeNegativeMeshFor` declaration. -/ -noncomputable def edgeNegativeMeshFor (v : Fin 3 → M.Vertex) +@[expose] noncomputable def edgeNegativeMeshFor (v : Fin 3 → M.Vertex) (hv : AffineIndependent ℝ (M.position ∘ v)) (h0 : f (M.position (v 0)) < 0) (h1 : 0 < f (M.position (v 1))) : TriangleMesh := let N := M.edgeMeshFor (-f) v hv (by simpa) (by simpa) @@ -1853,7 +1853,7 @@ theorem localRefinementMesh_support (t : M.Triangle) : rw [Set.range_comp, M.range_orderedVertex t] /-- Every maximal triangle lies wholly on one closed side of the cutting line. -/ -def IsMonochromatic (N : TriangleMesh) (f : Plane →ᵃ[ℝ] ℝ) : Prop := +@[expose] def IsMonochromatic (N : TriangleMesh) (f : Plane →ᵃ[ℝ] ℝ) : Prop := ∀ s ∈ N.triangles, (∀ v ∈ s, 0 ≤ f (N.position v)) ∨ (∀ v ∈ s, f (N.position v) ≤ 0) @@ -2067,6 +2067,7 @@ theorem strictMeshFor_triangles (v : Fin 3 → M.Vertex) simp [strictMeshFor, strictPatternTriangles, referenceSplitMesh, referenceSplitTriangles, TriangleMesh.reindex, TriangleMesh.mapAffineEquiv, strictVerticesEmbedding] + rfl theorem edgeMeshFor_triangles (v : Fin 3 → M.Vertex) (hv : AffineIndependent ℝ (M.position ∘ v)) @@ -2076,6 +2077,7 @@ theorem edgeMeshFor_triangles (v : Fin 3 → M.Vertex) simp [edgeMeshFor, edgePatternTriangles, referenceEdgeSplitMesh, referenceEdgeSplitTriangles, TriangleMesh.reindex, TriangleMesh.mapAffineEquiv, edgeVerticesEmbedding] + rfl theorem strictNegativeMeshFor_monochromatic (v : Fin 3 → M.Vertex) (hv : AffineIndependent ℝ (M.position ∘ v)) @@ -2266,7 +2268,7 @@ noncomputable def localCutVertex (t : M.Triangle) (i j : Fin 3) M.cutRefinedVertex f (M.orderedVertex t i) (M.orderedVertex t j) hij @[simp] theorem localOldVertex_val (t : M.Triangle) (i : Fin 3) : - (M.localOldVertex f t i : Plane) = M.position (M.orderedVertex t i) := rfl + (M.localOldVertex f t i : Plane) = M.position (M.orderedVertex t i) := by rfl theorem localCutVertex_apply_eq_zero (t : M.Triangle) (i j : Fin 3) (hij : f (M.position (M.orderedVertex t i)) * @@ -2838,7 +2840,7 @@ theorem child_vertex_mem_parent (t : M.Triangle) /-! ## Barycentric traces on old parent edges -/ /-- The barycentric coordinate opposite the `k`-th edge of an old triangle. -/ -noncomputable def oppositeCoord (t : M.Triangle) (k : Fin 3) : Plane →ᵃ[ℝ] ℝ := +@[expose] noncomputable def oppositeCoord (t : M.Triangle) (k : Fin 3) : Plane →ᵃ[ℝ] ℝ := (affineBasisOfTriangle (M.position ∘ M.orderedVertex t) (M.orderedVertex_affineIndependent t)).coord k @@ -2847,7 +2849,7 @@ noncomputable def oppositeCoord (t : M.Triangle) (k : Fin 3) : Plane →ᵃ[ℝ] exact AffineBasis.coord_apply _ _ _ /-- The two old geometric vertices of the edge opposite `k`. -/ -noncomputable def oppositeEdgePoints (t : M.Triangle) (k : Fin 3) : Finset Plane := +@[expose] noncomputable def oppositeEdgePoints (t : M.Triangle) (k : Fin 3) : Finset Plane := (Finset.univ.erase k).image (M.position ∘ M.orderedVertex t) theorem oppositeEdgePoints_subset_parentPoints (t : M.Triangle) (k : Fin 3) : @@ -4009,7 +4011,7 @@ theorem lineRefinementMesh_preserves_monochromatic (g : Plane →ᵃ[ℝ] ℝ) exact ht w hw /-- Successively subdivide a mesh by a finite list of affine lines. -/ -noncomputable def refineByLines : TriangleMesh → List (Plane →ᵃ[ℝ] ℝ) → TriangleMesh +@[expose] noncomputable def refineByLines : TriangleMesh → List (Plane →ᵃ[ℝ] ℝ) → TriangleMesh | M, [] => M | M, g :: gs => refineByLines (M.lineRefinementMesh g) gs diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteCellwiseExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteCellwiseExtension.lean index 84ed5723b8..c46afec947 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteCellwiseExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteCellwiseExtension.lean @@ -18,7 +18,7 @@ the family of filled closed regions is locally finite. Under these conditions t maps form a genuine locally finite triangle complex in the plane. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteControlledApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteControlledApproximation.lean index 8929c8abf1..9323945aa1 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteControlledApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteControlledApproximation.lean @@ -21,7 +21,7 @@ construction supplies quantitative face control and separation. Polygonal Schoe fills every face, and local finiteness glues the fillings into a homeomorphism of supports. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceBoundary.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceBoundary.lean index 427b8f6271..87220e3b88 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceBoundary.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceBoundary.lean @@ -17,7 +17,7 @@ line arrangement and extracts the resulting simple polygonal cycle. Shared abstr literally the same replacement arc, so adjacent face fillings will have identical boundaries. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean index 31b1d0b994..1be055b9cc 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean @@ -19,7 +19,7 @@ resulting boundary maps agree literally on overlaps. This is the compatibility applying polygonal Schoenflies face by face. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceFilling.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceFilling.lean index 709ffc0f07..7cbaa47cfa 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceFilling.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceFilling.lean @@ -18,7 +18,7 @@ triangular frontier onto a simple polygonal circle. Polygonal Schoenflies fills finite PL homeomorphism without changing its shared-edge boundary values. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean index e0c53fac43..1139056e92 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean @@ -18,7 +18,7 @@ chosen cyclic `Fin 3` ordering and identifies the result with the standard close triangle. The cyclic sides are carried exactly to the corresponding standard polygon sides. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -102,7 +102,7 @@ noncomputable def standardSimplexToRealization (z : stdSimplex ℝ (Fin 3)) : ⟨z.1, z.2, ⟨Finset.univ, standardTriangle_univ_mem_cells, by simp⟩⟩ /-- Forget the vacuous one-face support witness in the standard intrinsic realization. -/ -noncomputable def standardRealizationToSimplex +@[expose] noncomputable def standardRealizationToSimplex (z : standardTrianglePlaneComplex.toIntrinsic.realization) : stdSimplex ℝ (Fin 3) := ⟨z.1, z.2.1⟩ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphApproximation.lean index 7feb3010a5..fd3d4d6de9 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphApproximation.lean @@ -21,7 +21,7 @@ nonincident edges and all other vertices. Local finiteness makes the two obstac closed, which is the only compactness input needed for this pointwise construction. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -444,11 +444,11 @@ theorem vertexImage_not_mem_nonincidentEdgeImage (v : K.Vertex) : ⟨K.vertexPoint v, K.vertexPoint_mem_support v⟩) /-- Singleton chart images of the global vertices. -/ -def vertexImageCarrier (v : K.Vertex) : Set Plane := +@[expose] def vertexImageCarrier (v : K.Vertex) : Set Plane := {G.vertexImage v} /-- A singleton vertex image in the open chart range. -/ -def vertexImageCarrierInRange (v : K.Vertex) : Set G.region := +@[expose] def vertexImageCarrierInRange (v : K.Vertex) : Set G.region := {q | q.1 ∈ G.vertexImageCarrier v} /-- Local finiteness of vertex images transported to the chart plane. It follows from edge @@ -2770,7 +2770,7 @@ noncomputable def edgePathInSupportHomeomorph (e : K.Edge) : edgePathInSupport (K := K) e r := rfl /-- The polygonal replacement map on one closed source edge. -/ -noncomputable def replacementEdgeMap (e : K.Edge) : +@[expose] noncomputable def replacementEdgeMap (e : K.Edge) : edgeInSupport (K := K) e → Plane := fun p ↦ (G.replacementArc e).completePath ((G.edgePathInSupportHomeomorph e).symm p) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphPL.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphPL.lean index e2094d38f7..b1899e66dc 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphPL.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteGraphPL.lean @@ -19,7 +19,7 @@ replacement edge as support. It is the edge-level input for assembling polygonal boundaries in a common arrangement. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFinitePLApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFinitePLApproximation.lean index 956b4f5ae1..dca50b3bf7 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFinitePLApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFinitePLApproximation.lean @@ -17,7 +17,7 @@ deliberately pointwise: on a noncompact open complex no uniform positive toleran strongly positive tolerance has a positive lower bound on every compact face. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteSidePreservation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteSidePreservation.lean index 9ef6a6ca95..6d2368e7e3 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteSidePreservation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteSidePreservation.lean @@ -18,7 +18,7 @@ argument is the same connected-side argument used in Moise Chapter 6: an edge ca polygonal boundary only where the corresponding abstract edge meets the face. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteTriangulation.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteTriangulation.lean index 9177b0a8ca..00eafb62f5 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteTriangulation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteTriangulation.lean @@ -27,7 +27,7 @@ makes the vertex type finite, and finite closed pasting produces the required ho the canonical barycentric realization. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -35,7 +35,7 @@ namespace ClassificationOfSurfaces namespace Moise /-- Extend barycentric coordinates on a finite face by zero to the global vertex type. -/ -def extendFaceCoordinates {V : Type*} [DecidableEq V] (t : Finset V) +@[expose] def extendFaceCoordinates {V : Type*} [DecidableEq V] (t : Finset V) (x : stdSimplex ℝ {v // v ∈ t}) : V → ℝ := fun v ↦ if hv : v ∈ t then x ⟨v, hv⟩ else 0 @@ -147,7 +147,7 @@ noncomputable def finsetMapSubtypeEquiv @[simp] theorem finsetMapSubtypeEquiv_apply_val {A B : Type*} (e : A ↪ B) (t : Finset A) (a : {a // a ∈ t}) : - (finsetMapSubtypeEquiv e t a).1 = e a.1 := rfl + (finsetMapSubtypeEquiv e t a).1 = e a.1 := by rfl /-- Pull simplex coordinates on a relabeled face back to the original face. -/ noncomputable def relabelFaceSimplex @@ -409,7 +409,7 @@ theorem stdSimplex_map_embedding_apply_of_notMem_range simp /-- Relabel a finite face family along an embedding of its vertex type. -/ -def relabelFaceFamily +@[expose] def relabelFaceFamily {A B : Type*} [DecidableEq B] (e : A ↪ B) (F : Finset (Finset A)) : Finset (Finset B) := by exact F.image fun t ↦ t.map e @@ -428,8 +428,7 @@ def faceOfRelabel (e : A ↪ B) {faces : Finset (Finset A)} : omit [DecidableEq A] in theorem faceOfRelabel_val (e : A ↪ B) {faces : Finset (Finset A)} - (f : Face faces) : (faceOfRelabel e f).1 = f.1.map e := - rfl + (f : Face faces) : (faceOfRelabel e f).1 = f.1.map e := by rfl omit [DecidableEq A] in /-- Injective vertex relabeling preserves dual adjacency of listed faces. -/ @@ -588,7 +587,7 @@ noncomputable def pullGeometricRealization (e : A ↪ B) (F : Finset (Finset A)) (x : GeometricRealization A F) : (pushGeometricRealization e F x).1 = - stdSimplex.map e ⟨x.1, x.2.1⟩ := rfl + stdSimplex.map e ⟨x.1, x.2.1⟩ := by rfl @[simp] theorem pushGeometricRealization_apply_embedding {A B : Type*} [Fintype A] [Fintype B] @@ -829,11 +828,11 @@ namespace LocallyFiniteTriangleComplex variable {S : Type*} [TopologicalSpace S] (K : LocallyFiniteTriangleComplex S) /-- The ambient carrier of one maximal face. -/ -def faceCarrier (f : K.Face) : Set S := +@[expose] def faceCarrier (f : K.Face) : Set S := Set.range (K.faceMap f) /-- The ambient support of the locally finite complex. -/ -def support : Set S := +@[expose] def support : Set S := ⋃ f, K.faceCarrier f theorem faceCarrier_nonempty (f : K.Face) : (K.faceCarrier f).Nonempty := by @@ -1029,7 +1028,7 @@ noncomputable def faceEdge (f : K.Face) (i : ZMod 3) : K.Edge := by · exact K.faceVertex_mem f (i + 1) @[simp] theorem faceEdge_val (f : K.Face) (i : ZMod 3) : - (K.faceEdge f i).1 = {K.faceVertex f i, K.faceVertex f (i + 1)} := rfl + (K.faceEdge f i).1 = {K.faceVertex f i, K.faceVertex f (i + 1)} := by rfl /-- Consecutive face edges share exactly their common cyclic vertex. -/ theorem faceEdge_inter_next (f : K.Face) (i : ZMod 3) : @@ -1542,7 +1541,7 @@ noncomputable def edgePathHomeomorph [T2Space S] (e : K.Edge) : @[simp] theorem edgePathHomeomorph_apply [T2Space S] (e : K.Edge) (r : Set.Icc (0 : ℝ) 1) : - (K.edgePathHomeomorph e r).1 = K.edgePath e r := rfl + (K.edgePathHomeomorph e r).1 = K.edgePath e r := by rfl theorem edgePathHomeomorph_symm_val [T2Space S] (e : K.Edge) (p : K.edgeCarrier e) : @@ -1591,7 +1590,7 @@ noncomputable local instance compactVertexFintype [CompactSpace S] : Fintype K.V K.vertexFintype /-- The finite intrinsic complex obtained from a compact locally finite triangle complex. -/ -noncomputable def compactIntrinsic [CompactSpace S] : IntrinsicTwoComplex := by +@[expose] noncomputable def compactIntrinsic [CompactSpace S] : IntrinsicTwoComplex := by letI : Fintype K.Face := K.faceFintype letI : Fintype K.Vertex := K.vertexFintype exact @@ -1793,22 +1792,20 @@ noncomputable def toGeometricTriangulation [CompactSpace S] [T2Space S] support. This is the finite gluing bridge used in the Rado induction: once a compatible finite family of old and new triangles has been assembled, no separate ambient coverage proof is needed. -/ -noncomputable def onSupport [Finite K.Face] : +@[expose] noncomputable def onSupport [Finite K.Face] : LocallyFiniteTriangleComplex K.support where Vertex := K.Vertex + vertexDecidableEq := K.vertexDecidableEq Face := K.Face + faceDecidableEq := K.faceDecidableEq faceVertices := K.faceVertices faceVertices_card := K.faceVertices_card vertex_used := K.vertex_used faceMap := fun f x => ⟨K.faceMap f x, Set.mem_iUnion.mpr ⟨f, Set.mem_range_self x⟩⟩ - faceMap_continuous := fun f => by - apply Continuous.subtype_mk - exact K.faceMap_continuous f - faceMap_eq_iff := by - intro f g x y - rw [Subtype.ext_iff] - exact K.faceMap_eq_iff + faceMap_continuous := fun f => (K.faceMap_continuous f).subtype_mk _ + faceMap_eq_iff := fun {f g} {x y} => + Subtype.ext_iff.trans (K.faceMap_eq_iff (f := f) (g := g) (x := x) (y := y)) locallyFinite := locallyFinite_of_finite _ @[simp] theorem onSupport_faceVertices [Finite K.Face] (f : K.Face) : diff --git a/LeanPool/ClassificationOfSurfaces/Moise/NoRetraction.lean b/LeanPool/ClassificationOfSurfaces/Moise/NoRetraction.lean index 708ed62ebb..4e6914e571 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/NoRetraction.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/NoRetraction.lean @@ -21,7 +21,7 @@ lifts to `ℝ`, whereas its restriction to the boundary cannot be the identity b standard boundary loop has lifts whose endpoints differ by `2π`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -41,8 +41,7 @@ def circleToClosedUnitDisk (z : Circle) : ClosedUnitDisk := rw [Circle.norm_coe]⟩ @[simp] theorem circleToClosedUnitDisk_coe (z : Circle) : - (circleToClosedUnitDisk z : ℂ) = z := - rfl + (circleToClosedUnitDisk z : ℂ) = z := by rfl theorem continuous_circleToClosedUnitDisk : Continuous circleToClosedUnitDisk := by apply Continuous.subtype_mk diff --git a/LeanPool/ClassificationOfSurfaces/Moise/OpenMidpointComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/OpenMidpointComplex.lean index 036a461796..bde7bf1002 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/OpenMidpointComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/OpenMidpointComplex.lean @@ -16,7 +16,7 @@ triangle whose whole carrier is contained in `U`. These finite stages are neste subdivisions are reconciled by coning. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -32,7 +32,7 @@ noncomputable abbrev safeSubdivision (n : ℕ) : K.Subdivision := K.iteratedMidpointSubdivision n /-- Refined triangles whose complete transported carriers lie in the prescribed open set. -/ -noncomputable def safeFaces (n : ℕ) : +@[expose] noncomputable def safeFaces (n : ℕ) : Finset (Finset (K.safeSubdivision n).refined.Vertex) := by classical exact (K.safeSubdivision n).refined.faces.filter fun t ↦ @@ -49,7 +49,7 @@ noncomputable abbrev safeStage (n : ℕ) : IntrinsicTwoComplex := (fun t ↦ t ∈ K.safeFaces U n) /-- Include a safe stage into the original finite realization. -/ -noncomputable def safeStageInclusion (n : ℕ) : +@[expose] noncomputable def safeStageInclusion (n : ℕ) : (K.safeStage U n).realization → K.realization := (K.safeSubdivision n).homeo ∘ (K.safeSubdivision n).refined.restrictFacesInclusion @@ -62,7 +62,7 @@ theorem isEmbedding_safeStageInclusion (n : ℕ) : (fun t ↦ t ∈ K.safeFaces U n)) /-- Carrier of one finite safe stage in the original realization. -/ -noncomputable def safeStageSupport (n : ℕ) : Set K.realization := +@[expose] noncomputable def safeStageSupport (n : ℕ) : Set K.realization := Set.range (K.safeStageInclusion U n) theorem isCompact_safeStageSupport (n : ℕ) : @@ -105,7 +105,8 @@ theorem safeStageSupport_mono (n : ℕ) : R.homeo (R.refined.midpointHomeomorph w) ∈ U := by intro w hw apply htSafe - exact R.refined.midpointEval_mem_parentFace T hsOver w hw + simpa only [R.refined.midpointHomeomorph_apply] using + R.refined.midpointEval_mem_parentFace T hsOver w hw have hsMem : s ∈ K.safeFaces U (n + 1) := by change s ∈ R.refined.midpointComplex.faces.filter fun t ↦ ∀ x ∈ R.refined.midpointComplex.faceCarrier t, @@ -248,11 +249,11 @@ noncomputable def safeExhaustionIndex : ℕ → ℕ | 0 => 0 | n + 1 => K.nextSafeStage U hU (safeExhaustionIndex n) -@[simp] theorem safeExhaustionIndex_zero : K.safeExhaustionIndex U hU 0 = 0 := rfl +@[simp] theorem safeExhaustionIndex_zero : K.safeExhaustionIndex U hU 0 = 0 := by rfl @[simp] theorem safeExhaustionIndex_succ (n : ℕ) : K.safeExhaustionIndex U hU (n + 1) = - K.nextSafeStage U hU (K.safeExhaustionIndex U hU n) := rfl + K.nextSafeStage U hU (K.safeExhaustionIndex U hU n) := by rfl theorem safeExhaustionIndex_lt_succ (n : ℕ) : K.safeExhaustionIndex U hU n < K.safeExhaustionIndex U hU (n + 1) := by diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean index 2271de60d6..4fa2f34eab 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean @@ -38,7 +38,7 @@ broken-line connectivity (Ch. 1), and Thm. 6.3 needs the polygonal theorems of C the combinatorial Schoenflies theorem. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PLMoves.lean b/LeanPool/ClassificationOfSurfaces/Moise/PLMoves.lean index 1300f58d4d..4cd7cbb945 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PLMoves.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PLMoves.lean @@ -15,7 +15,7 @@ The topological homeomorphisms used by the Chapter 3 ear shelling were construct barycentric repositioning. This file records the missing PL certificates used in Chapter 5. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -64,7 +64,7 @@ theorem mem_boundaryFaces_iff {s : Finset M.Vertex} : simp [boundaryFaces, and_assoc, and_comm] /-- The incidence-one edges and their faces form a finite one-dimensional plane complex. -/ -noncomputable def boundaryComplex : PlaneComplex where +@[expose] noncomputable def boundaryComplex : PlaneComplex where Vertex := M.Vertex position := M.position position_injective := M.position_injective diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PlaneComplex.lean b/LeanPool/ClassificationOfSurfaces/Moise/PlaneComplex.lean index ad13e238d9..dd9279343b 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PlaneComplex.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PlaneComplex.lean @@ -28,7 +28,7 @@ it is affine on every face of some subdivision. A generic continuous map is *no complex with a 2-face, in contrast to the vacuous `IsPLOnSimplexes` this replaces. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -44,7 +44,7 @@ abbrev Plane : Type := EuclideanSpace ℝ (Fin 2) /-- A closed triangle in the plane: the convex hull of three affinely independent points. -/ -def IsTriangle (C : Set Plane) : Prop := +@[expose] def IsTriangle (C : Set Plane) : Prop := ∃ p : Fin 3 → Plane, AffineIndependent ℝ p ∧ C = convexHull ℝ (Set.range p) /-- Two plane points with equal coordinates are equal. -/ @@ -362,6 +362,7 @@ namespace TriangleMesh variable (M : TriangleMesh) /-- The mesh consisting of one geometric triangle. -/ +@[expose] noncomputable def single (p : Fin 3 → Plane) (hp : AffineIndependent ℝ p) : TriangleMesh where Vertex := Fin 3 position := p @@ -404,7 +405,7 @@ noncomputable abbrev mapAffineEquiv (e : Plane ≃ᵃ[ℝ] Plane) : TriangleMesh /-- Reposition the vertices of a triangle mesh while retaining its abstract triangles. The caller supplies the geometric nondegeneracy and face-to-face proofs for the new positions. -/ -noncomputable def reposition (position' : M.Vertex → Plane) +@[expose] noncomputable def reposition (position' : M.Vertex → Plane) (hposition_injective : Function.Injective position') (haffineIndependent : ∀ t ∈ M.triangles, AffineIndependent ℝ fun v : t => position' v) @@ -432,7 +433,7 @@ noncomputable def reposition (position' : M.Vertex → Plane) /-- Delete one maximal triangle from a mesh. Vertices no longer used by any triangle are retained; this keeps the vertex type and geometric positions definitionally unchanged. -/ -noncomputable def eraseTriangle (t : Finset M.Vertex) : TriangleMesh where +@[expose] noncomputable def eraseTriangle (t : Finset M.Vertex) : TriangleMesh where Vertex := M.Vertex position := M.position position_injective := M.position_injective @@ -459,7 +460,7 @@ theorem card_eraseTriangle_triangles {t : Finset M.Vertex} (ht : t ∈ M.triangl /-- Reindex a triangle mesh inside a larger finite vertex type without changing any geometric positions. Extra vertices of the target type may be unused. -/ -noncomputable def reindex {V' : Type} [Fintype V'] [DecidableEq V'] +@[expose] noncomputable def reindex {V' : Type} [Fintype V'] [DecidableEq V'] (position' : V' → Plane) (hposition_injective : Function.Injective position') (e : M.Vertex ↪ V') (hposition : ∀ v, position' (e v) = M.position v) : TriangleMesh where @@ -527,7 +528,7 @@ theorem mapAffineEquiv_triangles (e : Plane ≃ᵃ[ℝ] Plane) : (M.mapAffineEquiv e).triangles = M.triangles := rfl /-- The nonempty subfaces of all maximal triangles in a triangle mesh. -/ -def faces : Finset (Finset M.Vertex) := +@[expose] def faces : Finset (Finset M.Vertex) := M.triangles.biUnion fun t => t.powerset.filter (·.Nonempty) theorem mem_faces_iff {s : Finset M.Vertex} : @@ -623,11 +624,11 @@ namespace PlaneComplex variable (K : PlaneComplex) /-- The carrier of a face: the convex hull of its vertex positions. -/ -def cellCarrier (s : Finset K.Vertex) : Set Plane := +@[expose] def cellCarrier (s : Finset K.Vertex) : Set Plane := convexHull ℝ (K.position '' s) /-- The support of the complex: the union of its face carriers. -/ -def support : Set Plane := +@[expose] def support : Set Plane := ⋃ s ∈ K.simplexes, K.cellCarrier s theorem cellCarrier_subset_support {s : Finset K.Vertex} (hs : s ∈ K.simplexes) : @@ -642,7 +643,7 @@ theorem isCompact_support : IsCompact K.support := K.simplexes.finite_toSet.isCompact_biUnion fun s _ => K.isCompact_cellCarrier s /-- Transport a finite plane complex through an affine equivalence. -/ -noncomputable def mapAffineEquiv (e : Plane ≃ᵃ[ℝ] Plane) : PlaneComplex where +@[expose] noncomputable def mapAffineEquiv (e : Plane ≃ᵃ[ℝ] Plane) : PlaneComplex where Vertex := K.Vertex position := e ∘ K.position position_injective := e.injective.comp K.position_injective @@ -705,11 +706,11 @@ theorem mapAffineEquiv_support (e : Plane ≃ᵃ[ℝ] Plane) : exact ⟨_, hy, rfl⟩ /-- The two-dimensional faces. -/ -def cells : Finset (Finset K.Vertex) := +@[expose] def cells : Finset (Finset K.Vertex) := K.simplexes.filter fun s => s.card = 3 /-- The edges (one-dimensional faces). -/ -def edges : Finset (Finset K.Vertex) := +@[expose] def edges : Finset (Finset K.Vertex) := K.simplexes.filter fun s => s.card = 2 /-- The subcomplex consisting of the vertices and edges of `K`. -/ @@ -770,7 +771,7 @@ theorem oneSkeleton_isGraph : /-- Keep the faces of `L` which lie in a face of `K`. This is the standard way to turn an ambient line arrangement into a subdivision subordinate to a pre-existing complex. -/ -noncomputable def subordinateTo (L K : PlaneComplex) : PlaneComplex := by +@[expose] noncomputable def subordinateTo (L K : PlaneComplex) : PlaneComplex := by classical exact { Vertex := L.Vertex @@ -819,7 +820,7 @@ theorem subordinateTo_support_subset (L K : PlaneComplex) : exact ⟨t, ht, hst hxs⟩ /-- Keep precisely the faces whose carriers lie in a prescribed geometric set. -/ -noncomputable def restrictToSet (K : PlaneComplex) (A : Set Plane) : PlaneComplex := by +@[expose] noncomputable def restrictToSet (K : PlaneComplex) (A : Set Plane) : PlaneComplex := by classical exact { Vertex := K.Vertex @@ -857,7 +858,7 @@ theorem restrictToSet_support_subset (K : PlaneComplex) (A : Set Plane) : exact (K.mem_restrictToSet_simplexes_iff A).mp hs |>.2 hxs /-- A complex is purely two-dimensional when every face lies in a two-dimensional one. -/ -def IsPure2 : Prop := +@[expose] def IsPure2 : Prop := ∀ s ∈ K.simplexes, ∃ t ∈ K.simplexes, s ⊆ t ∧ t.card = 3 end PlaneComplex @@ -1022,7 +1023,7 @@ variable (K : PlaneComplex) /-- `K'` subdivides `K`: same support, and every face carrier of `K'` lies inside some face carrier of `K`. -/ -def Subdivides (K' K : PlaneComplex) : Prop := +@[expose] def Subdivides (K' K : PlaneComplex) : Prop := K'.support = K.support ∧ ∀ s' ∈ K'.simplexes, ∃ s ∈ K.simplexes, K'.cellCarrier s' ⊆ K.cellCarrier s @@ -1065,7 +1066,7 @@ theorem subordinateTo_subdivides (L K : PlaneComplex) end PlaneComplex /-- `f` agrees with an affine map on `A`. -/ -def IsAffineOn (f : Plane → Plane) (A : Set Plane) : Prop := +@[expose] def IsAffineOn (f : Plane → Plane) (A : Set Plane) : Prop := ∃ g : Plane →ᵃ[ℝ] Plane, Set.EqOn f g A /-- `f` is piecewise linear on the complex `K`: affine on every face of some subdivision. @@ -1073,17 +1074,17 @@ def IsAffineOn (f : Plane → Plane) (A : Set Plane) : Prop := This is the honest PL predicate: a map that is not affine on any neighborhood of a point interior to a 2-cell of `K` cannot satisfy it, in contrast to the vacuous `IsPLOnSimplexes` of the retiring `PL.lean` layer. -/ -def IsPLOn (K : PlaneComplex) (f : Plane → Plane) : Prop := +@[expose] def IsPLOn (K : PlaneComplex) (f : Plane → Plane) : Prop := ∃ K' : PlaneComplex, K'.Subdivides K ∧ ∀ s' ∈ K'.simplexes, IsAffineOn f (K'.cellCarrier s') /-- `f` is a PL embedding of the support of `K`: piecewise linear and injective on the support. -/ -def IsPLEmbeddingOn (K : PlaneComplex) (f : Plane → Plane) : Prop := +@[expose] def IsPLEmbeddingOn (K : PlaneComplex) (f : Plane → Plane) : Prop := IsPLOn K f ∧ Set.InjOn f K.support /-- A function is PL on a geometric set when the set is the support of a finite plane complex on which the function is PL. -/ -def IsPLOnSet (A : Set Plane) (f : Plane → Plane) : Prop := +@[expose] def IsPLOnSet (A : Set Plane) (f : Plane → Plane) : Prop := ∃ K : PlaneComplex, K.support = A ∧ IsPLOn K f namespace IsAffineOn @@ -1200,7 +1201,7 @@ theorem card_of_mem_cells {t : Finset K.Vertex} (ht : t ∈ K.cells) : t.card = (Finset.mem_filter.mp ht).2 /-- Barycentric evaluation: the point of the plane with the given barycentric weights. -/ -noncomputable def baryEval (x : K.Vertex → ℝ) : Plane := +@[expose] noncomputable def baryEval (x : K.Vertex → ℝ) : Plane := ∑ v, x v • K.position v theorem continuous_baryEval : @@ -1296,6 +1297,7 @@ end PlaneComplex /-- The canonical barycentric homeomorphism from the abstract realization of a pure plane complex to its geometric support. -/ +@[expose] noncomputable def PlaneComplex.realizationHomeomorph (K : PlaneComplex) (hpure : K.IsPure2) : GeometricRealization K.Vertex K.cells ≃ₜ K.support := by classical @@ -1346,7 +1348,7 @@ noncomputable def PlaneComplex.realizationHomeomorph (K : PlaneComplex) (hpure : @[simp] theorem PlaneComplex.realizationHomeomorph_apply (K : PlaneComplex) (hpure : K.IsPure2) (x : GeometricRealization K.Vertex K.cells) : - ((K.realizationHomeomorph hpure) x).1 = K.baryEval x.1 := rfl + ((K.realizationHomeomorph hpure) x).1 = K.baryEval x.1 := by rfl /-- **Realization bridge** (elementary): a purely two-dimensional plane complex induces a geometric triangulation of its support, by barycentric coordinates in the face containing each diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean b/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean index b3730f0525..c598bd293f 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean @@ -15,7 +15,7 @@ polygonal circle. The exact segment-intersection axioms follow from the complex law and the fact that a simple cycle has no repeated cyclic vertex. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -47,13 +47,13 @@ noncomputable def walkGeometricPath {u w : K.Vertex} @[simp] theorem walkGeometricPath_nil (u : K.Vertex) : K.walkGeometricPath (SimpleGraph.Walk.nil : K.vertexGraph.Walk u u) = - Path.refl (K.position u) := rfl + Path.refl (K.position u) := by rfl @[simp] theorem walkGeometricPath_cons {u w z : K.Vertex} (h : K.vertexGraph.Adj u w) (p : K.vertexGraph.Walk w z) : K.walkGeometricPath (SimpleGraph.Walk.cons h p) = (Path.segment (K.position u) (K.position w)).trans - (K.walkGeometricPath p) := rfl + (K.walkGeometricPath p) := by rfl /-- The geometric path of a walk stays in the support of the complex, provided its final vertex is an actual zero-face. -/ @@ -202,11 +202,11 @@ def Path.copy {X : Type*} [TopologicalSpace X] {a b a' b' : X} @[simp] theorem Path.copy_apply {X : Type*} [TopologicalSpace X] {a b a' b' : X} (p : Path a b) (ha : a = a') (hb : b = b') (t : unitInterval) : - Path.copy p ha hb t = p t := rfl + Path.copy p ha hb t = p t := by rfl @[simp] theorem Path.copy_range {X : Type*} [TopologicalSpace X] {a b a' b' : X} (p : Path a b) (ha : a = a') (hb : b = b') : - Set.range (Path.copy p ha hb) = Set.range p := rfl + Set.range (Path.copy p ha hb) = Set.range p := by rfl /-- A path contained in an embedded arc and joining the same endpoints covers that entire arc. This is the order-convexity of connected subsets of the unit interval, transported through the diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean index 4950395476..f2a77996ec 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean @@ -20,7 +20,7 @@ chain vertex, turns all crossings and all chain vertices into vertices of one fi mesh. A simple graph path in the resulting one-skeleton is then a loop-free polygonal arc. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -41,10 +41,10 @@ namespace BrokenLineData variable {U : Set Plane} (B : BrokenLineData U) /-- The `start` declaration. -/ -def start : Plane := B.vertex 0 +@[expose] def start : Plane := B.vertex 0 /-- The `finish` declaration. -/ -def finish : Plane := B.vertex (Fin.last B.n) +@[expose] def finish : Plane := B.vertex (Fin.last B.n) /-- An auxiliary broken line listing an arbitrary finite family of segments. The prescribed segments occur at the even indices; the odd indices are disposable connectors. This is the @@ -112,14 +112,14 @@ theorem segmentFamilyChain_vertex_odd {I : Type*} [Fintype I] (segmentFamilyIndex left right i).castSucc = ⟨2 * (Fintype.equivFin I i).val, by change 2 * (Fintype.equivFin I i).val < 2 * Fintype.card I + 1 - omega⟩ := rfl + omega⟩ := by rfl @[simp] theorem segmentFamilyIndex_succ {I : Type*} [Fintype I] (left right : I → Plane) (i : I) : (segmentFamilyIndex left right i).succ = ⟨2 * (Fintype.equivFin I i).val + 1, by change 2 * (Fintype.equivFin I i).val + 1 < 2 * Fintype.card I + 1 - omega⟩ := rfl + omega⟩ := by rfl /-- The segment at the distinguished even index is exactly the requested family member. -/ theorem segmentFamilyChain_segment {I : Type*} [Fintype I] @@ -226,11 +226,11 @@ theorem mem_segment_of_segmentLine_eq_zero {a b x : Plane} (hab : a ≠ b) ring /-- The `verticalLine` declaration. -/ -noncomputable def verticalLine (p : Plane) : Plane →ᵃ[ℝ] ℝ := +@[expose] noncomputable def verticalLine (p : Plane) : Plane →ᵃ[ℝ] ℝ := cartesianX - AffineMap.const ℝ Plane (p 0) /-- The `horizontalLine` declaration. -/ -noncomputable def horizontalLine (p : Plane) : Plane →ᵃ[ℝ] ℝ := +@[expose] noncomputable def horizontalLine (p : Plane) : Plane →ᵃ[ℝ] ℝ := cartesianY - AffineMap.const ℝ Plane (p 1) @[simp] theorem verticalLine_apply_self (p : Plane) : verticalLine p p = 0 := by @@ -283,7 +283,7 @@ noncomputable def enclosingMesh : TriangleMesh := (PolygonalCircle.enclosingTriangleVertices_affineIndependent B.enclosingRadius_pos) /-- The finite line arrangement resolving every segment crossing and chain vertex. -/ -noncomputable def arrangementMesh : TriangleMesh := +@[expose] noncomputable def arrangementMesh : TriangleMesh := B.enclosingMesh.refineByLines B.arrangementLines theorem arrangementMesh_support : @@ -544,7 +544,7 @@ theorem exists_vertex_pair_segment_of_mem_cellCarrier {s : Finset K.Vertex} rwa [himage, convexHull_pair] at hx /-- The graph formed by the one-dimensional faces of a plane complex. -/ -def vertexGraph : SimpleGraph K.Vertex where +@[expose] def vertexGraph : SimpleGraph K.Vertex where Adj v w := v ≠ w ∧ ({v, w} : Finset K.Vertex) ∈ K.simplexes symm := ⟨by rintro v w ⟨hvw, hedge⟩ @@ -581,7 +581,7 @@ theorem position_mem_support_of_mem_walk {u v w : K.Vertex} /-- The induced subcomplex on the vertices satisfying `p`. Vertices outside `p` remain in the ambient finite type but occur in no face; `PlaneComplex.active` can remove them when desired. -/ -noncomputable def inducedBy (p : K.Vertex → Prop) : PlaneComplex := by +@[expose] noncomputable def inducedBy (p : K.Vertex → Prop) : PlaneComplex := by classical exact { Vertex := K.Vertex @@ -1103,7 +1103,7 @@ theorem segmentFamily_arrangementVertex_position_right {I : Type*} [Fintype I] exact segmentFamilyChain_vertex_odd left right i /-- The part of the arrangement mesh lying wholly on one original chain segment. -/ -noncomputable def segmentComplex (i : Fin B.n) : PlaneComplex := +@[expose] noncomputable def segmentComplex (i : Fin B.n) : PlaneComplex := B.arrangementMesh.toPlaneComplex.restrictedTo (segment ℝ (B.vertex i.castSucc) (B.vertex i.succ)) @@ -1244,7 +1244,7 @@ noncomputable def resolvedWalk : B.inSetGraph.Walk B.resolvedPath /-- Ordered geometric vertices of the resolved polygonal arc. -/ -noncomputable def resolvedVertex +@[expose] noncomputable def resolvedVertex (i : Fin (B.resolvedWalk.length + 1)) : Plane := B.arrangementMesh.toPlaneComplex.position (B.resolvedWalk.getVert i) @@ -1354,7 +1354,7 @@ def IsResolvedFace (s : Finset B.arrangementMesh.toPlaneComplex.Vertex) : Prop : s ⊆ {B.resolvedWalk.getVert i.val, B.resolvedWalk.getVert (i.val + 1)}) /-- The parent-arrangement subcomplex consisting of the chosen path edges and their vertices. -/ -noncomputable def resolvedComplex : PlaneComplex := by +@[expose] noncomputable def resolvedComplex : PlaneComplex := by classical let K := B.arrangementMesh.toPlaneComplex exact { @@ -1925,18 +1925,18 @@ theorem resolvedGlobalParameter_finish : exact_mod_cast Nat.sub_add_cancel hpos /-- Affine inclusion of the real axis into the plane. -/ -def realAxisLinear : ℝ →ₗ[ℝ] Plane where +@[expose] def realAxisLinear : ℝ →ₗ[ℝ] Plane where toFun t := planePoint t 0 map_add' := by intro x y; ext i ; fin_cases i <;> simp [planePoint] map_smul' := by intro c x; ext i ; fin_cases i <;> simp [planePoint] /-- The `realAxisAffine` declaration. -/ -def realAxisAffine : ℝ →ᵃ[ℝ] Plane := realAxisLinear.toAffineMap +@[expose] def realAxisAffine : ℝ →ᵃ[ℝ] Plane := realAxisLinear.toAffineMap -@[simp] theorem realAxisAffine_apply (t : ℝ) : realAxisAffine t = planePoint t 0 := rfl +@[simp] theorem realAxisAffine_apply (t : ℝ) : realAxisAffine t = planePoint t 0 := by rfl /-- Piecewise-affine straightening of the selected polygonal arc onto the real axis. -/ -noncomputable def resolvedStraighten (x : Plane) : Plane := +@[expose] noncomputable def resolvedStraighten (x : Plane) : Plane := realAxisAffine (B.resolvedGlobalParameter x) theorem resolvedStraighten_start : diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArcModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArcModel.lean index 31ced94180..3bc4aa8a76 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArcModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArcModel.lean @@ -10,7 +10,7 @@ public import LeanPool.ClassificationOfSurfaces.Moise.PolygonalArc /-! # PL segment models for polygonal arcs -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalCrosscut.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalCrosscut.lean index 44c0ae148c..1599bea64f 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalCrosscut.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalCrosscut.lean @@ -18,7 +18,7 @@ polygons containing the chord lie inside the first polygon. This is the cutting the free-triangle induction of Chapter 3. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -659,7 +659,7 @@ def insertZero (J : PolygonalCircle) (p : Plane) (hp : p ∈ J.edgeSegment 0) @[simp] theorem insertZero_n (J : PolygonalCircle) (p : Plane) (hp : p ∈ J.edgeSegment 0) (hp0 : p ≠ J.vertex 0) (hp1 : p ≠ J.vertex 1) : - (J.insertZero p hp hp0 hp1).n = J.n + 1 := rfl + (J.insertZero p hp hp0 hp1).n = J.n + 1 := by rfl @[simp] theorem insertZero_vertex_zero (J : PolygonalCircle) (p : Plane) (hp : p ∈ J.edgeSegment 0) (hp0 : p ≠ J.vertex 0) (hp1 : p ≠ J.vertex 1) : @@ -721,7 +721,7 @@ theorem insertZero_carrier (J : PolygonalCircle) (p : Plane) (hp : p ∈ J.edgeS rwa [ZMod.natCast_zmod_val i] /-- Cyclically reindex a polygon so that the old index `a` becomes the new index zero. -/ -def rotate (J : PolygonalCircle) (a : ZMod J.n) : PolygonalCircle where +@[expose] def rotate (J : PolygonalCircle) (a : ZMod J.n) : PolygonalCircle where n := J.n three_le := J.three_le vertex i := J.vertex (i + a) @@ -1497,7 +1497,7 @@ theorem forwardCut_nonadjacent_disjoint {k : ℕ} (hk2 : 2 ≤ k) (hk : k + 1 < rw [hv, Nat.cast_add, Nat.cast_one] /-- Close the forward boundary arc from vertex `0` to vertex `k` by a proper chord. -/ -def forwardCutCircle {k : ℕ} (hk2 : 2 ≤ k) (hk : k + 1 < J.n) +@[expose] def forwardCutCircle {k : ℕ} (hk2 : 2 ≤ k) (hk : k + 1 < J.n) (hP : J.vertex 0 = C.P) (hQ : J.vertex (k : ZMod J.n) = C.Q) : PolygonalCircle where n := k + 1 @@ -2623,20 +2623,20 @@ theorem triangle_interior_side (C : G.MeshCrosscut M) (T : M.Triangle) : G.disjoint_interior13_interior23 hsplit ⟨p, hp, hp23⟩ /-- Select the maximal triangles lying on the `J13` side of the crosscut. -/ -noncomputable def side13Mesh (_ : G.MeshCrosscut M) : TriangleMesh := by +@[expose] noncomputable def side13Mesh (_ : G.MeshCrosscut M) : TriangleMesh := by classical exact M.restrictTriangles fun t => (interior (M.triangleCarrier t) ∩ G.J13.interiorRegion).Nonempty /-- Select the maximal triangles lying on the `J23` side of the crosscut. -/ -noncomputable def side23Mesh (_ : G.MeshCrosscut M) : TriangleMesh := by +@[expose] noncomputable def side23Mesh (_ : G.MeshCrosscut M) : TriangleMesh := by classical exact M.restrictTriangles fun t => (interior (M.triangleCarrier t) ∩ G.J23.interiorRegion).Nonempty -@[simp] theorem swap12_side13Mesh : C.swap12.side13Mesh = C.side23Mesh := rfl +@[simp] theorem swap12_side13Mesh : C.swap12.side13Mesh = C.side23Mesh := by rfl -@[simp] theorem swap12_side23Mesh : C.swap12.side23Mesh = C.side13Mesh := rfl +@[simp] theorem swap12_side23Mesh : C.swap12.side23Mesh = C.side13Mesh := by rfl private theorem triangleCarrier_subset_side13 {t : Finset M.Vertex} (ht : t ∈ C.side13Mesh.triangles) : diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalFamilyPolyhedron.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalFamilyPolyhedron.lean index 8aa4df6ff5..b5f1ee66c9 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalFamilyPolyhedron.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalFamilyPolyhedron.lean @@ -19,7 +19,7 @@ the family and retains precisely the chambers lying inside at least one polygon. single triangle mesh has support equal to the union. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -90,7 +90,7 @@ namespace PolygonalFamily variable {ι : Type*} [Fintype ι] (J : ι → PolygonalCircle) /-- The union of the finitely many closed polygonal disks. -/ -def closedRegion : Set Plane := +@[expose] def closedRegion : Set Plane := ⋃ i, (J i).closedRegion omit [Fintype ι] in @@ -113,7 +113,7 @@ theorem closedRegion_subset_enclosingBall : exact Metric.closedBall_subset_closedBall (le_max_left _ _) h /-- The common enclosing triangle. -/ -noncomputable def enclosingMesh : TriangleMesh := +@[expose] noncomputable def enclosingMesh : TriangleMesh := TriangleMesh.single (PolygonalCircle.enclosingTriangleVertices (enclosingRadius J)) (PolygonalCircle.enclosingTriangleVertices_affineIndependent (enclosingRadius_pos J)) @@ -133,7 +133,7 @@ theorem edgeLine_mem_edgeLines (i : ι) (k : ZMod (J i).n) : exact ⟨i, by simp, (J i).edgeLine_mem_edgeLines k⟩ /-- The common supporting-line arrangement. -/ -noncomputable def arrangementMesh : TriangleMesh := +@[expose] noncomputable def arrangementMesh : TriangleMesh := (enclosingMesh J).refineByLines (edgeLines J) theorem arrangementMesh_support : @@ -257,7 +257,7 @@ def IsInteriorArrangementTriangle ∃ i, interior (arrangementTriangleCarrier J t) ⊆ (J i).interiorRegion /-- The common finite mesh of the union of all closed regions. -/ -noncomputable def closedRegionMesh : TriangleMesh := by +@[expose] noncomputable def closedRegionMesh : TriangleMesh := by classical exact (arrangementMesh J).restrictTriangles (IsInteriorArrangementTriangle J) @@ -331,7 +331,7 @@ theorem closedRegionMesh_support : /-! ## Synchronized submeshes of one family arrangement -/ /-- The union of a selected subfamily of polygonal closed disks. -/ -def selectedClosedRegion (p : ι → Prop) : Set Plane := +@[expose] def selectedClosedRegion (p : ι → Prop) : Set Plane := ⋃ i, ⋃ (_ : p i), (J i).closedRegion /-- An arrangement chamber belongs to the selected submesh when its interior lies on the @@ -343,7 +343,7 @@ def IsSelectedInteriorArrangementTriangle (p : ι → Prop) /-- Restrict the common arrangement to the chambers belonging to a selected subfamily. Different predicates therefore produce meshes with definitionally the same ambient vertex type and position map. -/ -noncomputable def selectedClosedRegionMesh (p : ι → Prop) : TriangleMesh := by +@[expose] noncomputable def selectedClosedRegionMesh (p : ι → Prop) : TriangleMesh := by classical exact (arrangementMesh J).restrictTriangles (IsSelectedInteriorArrangementTriangle J p) @@ -473,7 +473,7 @@ theorem selectedClosedRegionMeshes_joint_edge_valence (p q : ι → Prop) /-! ## Synchronization with an independent finite patch mesh -/ /-- Cut the polygon-family arrangement by all barycentric face lines of a second mesh. -/ -noncomputable def synchronizedArrangement (N : TriangleMesh) : TriangleMesh := +@[expose] noncomputable def synchronizedArrangement (N : TriangleMesh) : TriangleMesh := (arrangementMesh J).refineTo N /-- A chamber of the synchronized arrangement lies in the selected polygonal region. -/ @@ -484,7 +484,7 @@ def IsSelectedSynchronizedTriangle (N : TriangleMesh) (p : ι → Prop) (J i).interiorRegion /-- The polygonal side of the common old/patch arrangement. -/ -noncomputable def selectedSynchronizedMesh (N : TriangleMesh) +@[expose] noncomputable def selectedSynchronizedMesh (N : TriangleMesh) (p : ι → Prop) : TriangleMesh := by classical exact (synchronizedArrangement J N).restrictTriangles @@ -497,7 +497,7 @@ def IsTargetSynchronizedTriangle (N : TriangleMesh) N.toPlaneComplex.support).Nonempty /-- The target-mesh side of the common old/patch arrangement. -/ -noncomputable def targetSynchronizedMesh (N : TriangleMesh) : TriangleMesh := by +@[expose] noncomputable def targetSynchronizedMesh (N : TriangleMesh) : TriangleMesh := by classical exact (synchronizedArrangement J N).restrictTriangles (IsTargetSynchronizedTriangle J N) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalJordan.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalJordan.lean index aad9e3114e..f79d69dedc 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalJordan.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalJordan.lean @@ -25,7 +25,7 @@ with adjacent segments meeting exactly at their shared vertex and non-adjacent s A junk witness cannot satisfy these fields: they force the carrier to be a topological circle. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -60,7 +60,7 @@ instance : NeZero J.n := ⟨by have := J.three_le; omega⟩ /-- The edge from vertex `i` to vertex `i + 1`. -/ -def edgeSegment (i : ZMod J.n) : Set Plane := +@[expose] def edgeSegment (i : ZMod J.n) : Set Plane := segment ℝ (J.vertex i) (J.vertex (i + 1)) /-- Two edge indices are nonadjacent when the corresponding edges share no endpoint. -/ @@ -68,7 +68,7 @@ def NonAdjacentEdges (i j : ZMod J.n) : Prop := i ≠ j ∧ i ≠ j + 1 ∧ j ≠ i + 1 /-- The carrier of the polygon: the union of its edges. -/ -def carrier : Set Plane := +@[expose] def carrier : Set Plane := ⋃ i, J.edgeSegment i theorem vertex_mem_carrier (i : ZMod J.n) : J.vertex i ∈ J.carrier := @@ -93,7 +93,7 @@ theorem isClosed_edgeSegment (i : ZMod J.n) : IsClosed (J.edgeSegment i) := /-- Transport a polygon through a function which is injective on its carrier and straight on each edge. No extension to an ambient homeomorphism is needed. -/ -noncomputable def mapEmbedding (f : Plane → Plane) +@[expose] noncomputable def mapEmbedding (f : Plane → Plane) (hinj : Set.InjOn f J.carrier) (hedge : ∀ i : ZMod J.n, f '' J.edgeSegment i = segment ℝ (f (J.vertex i)) (f (J.vertex (i + 1)))) : @@ -160,7 +160,7 @@ theorem mapEmbedding_carrier (f : Plane → Plane) (hinj : Set.InjOn f J.carrier exact ⟨q, hqi, rfl⟩⟩ /-- Transport a polygon through a homeomorphism which is straight on each polygon edge. -/ -noncomputable def mapHomeomorph (h : Plane ≃ₜ Plane) +@[expose] noncomputable def mapHomeomorph (h : Plane ≃ₜ Plane) (hedge : ∀ i : ZMod J.n, h '' J.edgeSegment i = segment ℝ (h (J.vertex i)) (h (J.vertex (i + 1)))) : PolygonalCircle where @@ -541,7 +541,7 @@ noncomputable def complexDirection (z : ℂ) (hz : z ≠ 0) : Circle := abs_of_pos (norm_pos_iff.mpr hz), div_self (norm_ne_zero_iff.mpr hz)]⟩ @[simp] theorem coe_complexDirection (z : ℂ) (hz : z ≠ 0) : - (complexDirection z hz : ℂ) = z / ‖z‖ := rfl + (complexDirection z hz : ℂ) = z / ‖z‖ := by rfl /-- Polar reconstruction from norm and unit direction. -/ theorem norm_mul_complexDirection (z : ℂ) (hz : z ≠ 0) : @@ -2447,12 +2447,12 @@ Horizontal edges are never crossed. -/ /-- The x-coordinate at height `y` of the line through `v` and `w` (meaningful when the heights of `v` and `w` differ, which the crossing condition guarantees at use sites). -/ -noncomputable def crossingX (v w : Plane) (y : ℝ) : ℝ := +@[expose] noncomputable def crossingX (v w : Plane) (y : ℝ) : ℝ := v 0 + (y - v 1) / (w 1 - v 1) * (w 0 - v 0) /-- The leftward horizontal ray from `P` crosses edge `i`, with the half-open height convention. -/ -def EdgeCrossed (i : ZMod J.n) (P : Plane) : Prop := +@[expose] def EdgeCrossed (i : ZMod J.n) (P : Plane) : Prop := ((J.vertex i) 1 ≤ P 1 ∧ P 1 < (J.vertex (i + 1)) 1 ∨ (J.vertex (i + 1)) 1 ≤ P 1 ∧ P 1 < (J.vertex i) 1) ∧ crossingX (J.vertex i) (J.vertex (i + 1)) (P 1) < P 0 @@ -2460,7 +2460,7 @@ def EdgeCrossed (i : ZMod J.n) (P : Plane) : Prop := open scoped Classical in /-- The Moise index of a point: the parity of the number of edges crossed by its leftward horizontal ray. -/ -noncomputable def index (P : Plane) : ℕ := +@[expose] noncomputable def index (P : Plane) : ℕ := (Finset.univ.filter fun i : ZMod J.n => J.EdgeCrossed i P).card % 2 theorem index_lt_two (P : Plane) : J.index P < 2 := @@ -3446,7 +3446,7 @@ theorem exists_index_eq_one : ∃ P : Plane, P ∉ J.carrier ∧ J.index P = 1 : /-- The part of the polygon complement having crossing index `k`. Only `k = 0, 1` are nonempty. -/ -def indexRegion (k : ℕ) : Set Plane := +@[expose] def indexRegion (k : ℕ) : Set Plane := {P | P ∉ J.carrier ∧ J.index P = k} /-- Every index region is open, since the carrier is closed and the index is locally constant on @@ -4099,7 +4099,7 @@ theorem interiorRegion_eq_indexRegion_one : J.interiorRegion = J.indexRegion 1 : exact (Set.disjoint_left.mp J.disjoint_indexRegion_zero_one hxExterior hx).elim /-- The closed region bounded by a polygon: the closure of its interior region. -/ -noncomputable def closedRegion : Set Plane := +@[expose] noncomputable def closedRegion : Set Plane := closure J.interiorRegion theorem closedRegion_eq_union : J.closedRegion = J.interiorRegion ∪ J.carrier := by diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalPolyhedron.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalPolyhedron.lean index b4a0abd79c..93af5c476b 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalPolyhedron.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalPolyhedron.lean @@ -17,7 +17,7 @@ edges of a polygon cut an enclosing triangle into a finite triangle mesh. The t bounded side of polygonal Jordan form the required finite complex. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -186,7 +186,7 @@ theorem closedRegion_subset_enclosingMesh_support : (closedBall_subset_enclosingTriangle J.enclosingRadius_pos) /-- The finite mesh obtained by cutting the enclosing triangle along every polygon edge line. -/ -noncomputable def arrangementMesh : TriangleMesh := +@[expose] noncomputable def arrangementMesh : TriangleMesh := J.enclosingMesh.refineByLines J.edgeLines theorem arrangementMesh_support : @@ -299,7 +299,7 @@ def IsInteriorArrangementTriangle (t : Finset J.arrangementMesh.Vertex) : Prop : interior (J.arrangementTriangleCarrier t) ⊆ J.interiorRegion /-- The finite mesh formed by all bounded-side arrangement chambers. -/ -noncomputable def closedRegionMesh : TriangleMesh := +@[expose] noncomputable def closedRegionMesh : TriangleMesh := by classical exact J.arrangementMesh.restrictTriangles J.IsInteriorArrangementTriangle diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean index 460a0d4c7b..7646f01bcf 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean @@ -28,7 +28,7 @@ Only the polygonal case is stated. The full Schoenflies theorem (Moise Ch. 9) c triangulation theorem in Moise and is not on this route's critical path. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PuncturedSurface.lean b/LeanPool/ClassificationOfSurfaces/Moise/PuncturedSurface.lean index 57b1fde891..2923c1c482 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PuncturedSurface.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PuncturedSurface.lean @@ -26,7 +26,7 @@ deleting a finite set. That theorem, in turn, rules out multiple dual component surface triangulation. -/ -@[expose] public section +public section open Set Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/RelativeSynchronizedArrangement.lean b/LeanPool/ClassificationOfSurfaces/Moise/RelativeSynchronizedArrangement.lean index 1837a39761..917f5da6a9 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/RelativeSynchronizedArrangement.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/RelativeSynchronizedArrangement.lean @@ -16,7 +16,7 @@ submeshes of one ambient triangle mesh. This file records that harmless extra-l generalization of `PolygonalFamily.synchronizedArrangement`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ThinKiteMove.lean b/LeanPool/ClassificationOfSurfaces/Moise/ThinKiteMove.lean index 7096cf0efb..e29be59211 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ThinKiteMove.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ThinKiteMove.lean @@ -16,7 +16,7 @@ upper margins are an arbitrary positive `δ`. The two halves of the outer kite two-triangle mesh, so the transport is supplied by the canonical realization homeomorphism. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -24,7 +24,7 @@ namespace ClassificationOfSurfaces namespace Moise /-- Left, right, top, and bottom vertices of an axis-aligned kite. -/ -def axisKitePosition (lo hi : ℝ) : Fin 4 → Plane := +@[expose] def axisKitePosition (lo hi : ℝ) : Fin 4 → Plane := ![planePoint (-1) 0, planePoint 1 0, planePoint 0 hi, planePoint 0 lo] @[simp] theorem axisKitePosition_zero (lo hi : ℝ) : @@ -40,7 +40,7 @@ def axisKitePosition (lo hi : ℝ) : Fin 4 → Plane := axisKitePosition lo hi 3 = planePoint 0 lo := rfl /-- The `axisKiteTriangles` declaration. -/ -def axisKiteTriangles : Finset (Finset (Fin 4)) := +@[expose] def axisKiteTriangles : Finset (Finset (Fin 4)) := {{0, 2, 3}, {1, 2, 3}} /-- The `axisKitePatch` declaration. -/ @@ -116,6 +116,7 @@ theorem axisKite_inter {lo hi : ℝ} (hlo : lo < 0) (hhi : 0 < hi) : fin_cases v <;> simp [axisKitePosition] at hv ⊢ /-- The `axisKiteMesh` declaration. -/ +@[expose] noncomputable def axisKiteMesh (lo hi : ℝ) (hlo : lo < 0) (hhi : 0 < hi) : TriangleMesh where Vertex := Fin 4 position := axisKitePosition lo hi @@ -150,11 +151,11 @@ theorem axisKitePatch_negTwo_two : axisKitePatch (-2) 2 = diamondPatch := by simp [axisKitePosition] <;> tauto /-- Vertical scale used to compress the fixed diamond to a kite with margins `δ`. -/ -noncomputable def thinKiteScale (δ : ℝ) : ℝ := (1 + 2 * δ) / 4 +@[expose] noncomputable def thinKiteScale (δ : ℝ) : ℝ := (1 + 2 * δ) / 4 /-- The global piecewise-affine transport. Writing the two affine pieces with `|x|` makes continuity across the vertical diagonal immediate. -/ -noncomputable def thinKiteMap (δ : ℝ) (p : Plane) : Plane := +@[expose] noncomputable def thinKiteMap (δ : ℝ) (p : Plane) : Plane := planePoint (p 0) (thinKiteScale δ * p 1 + (1 - |p 0|) / 2) /-- The `thinKiteInv` declaration. -/ @@ -166,7 +167,7 @@ theorem thinKiteScale_pos {δ : ℝ} (hδ : 0 < δ) : 0 < thinKiteScale δ := by positivity /-- The `thinKiteGlobalHomeomorph` declaration. -/ -noncomputable def thinKiteGlobalHomeomorph (δ : ℝ) (hδ : 0 < δ) : Plane ≃ₜ Plane := by +@[expose] noncomputable def thinKiteGlobalHomeomorph (δ : ℝ) (hδ : 0 < δ) : Plane ≃ₜ Plane := by have hs : thinKiteScale δ ≠ 0 := (thinKiteScale_pos hδ).ne' have hleft : Function.LeftInverse (thinKiteInv δ) (thinKiteMap δ) := by intro p @@ -193,7 +194,7 @@ noncomputable def thinKiteGlobalHomeomorph (δ : ℝ) (hδ : 0 < δ) : Plane ≃ fun_prop } /-- The thin kite is the image of the fixed diamond under the explicit transport. -/ -noncomputable def thinKitePatch (δ : ℝ) : Set Plane := thinKiteMap δ '' diamondPatch +@[expose] noncomputable def thinKitePatch (δ : ℝ) : Set Plane := thinKiteMap δ '' diamondPatch /-- Every point of the thin kite lies in the tangent cone at its left base vertex. -/ theorem thinKitePatch_subset_leftCone {δ : ℝ} (hδ : 0 ≤ δ) {p : Plane} @@ -262,7 +263,7 @@ theorem thinKitePatch_subset_rightCone {δ : ℝ} (hδ : 0 ≤ δ) {p : Plane} nlinarith /-- The triangle onto which the thin kite collapses when `δ = 0`. -/ -def kiteTrianglePosition : Fin 3 → Plane := +@[expose] def kiteTrianglePosition : Fin 3 → Plane := ![planePoint (-1) 0, planePoint 1 0, planePoint 0 1] theorem kiteTrianglePosition_affineIndependent : @@ -1008,7 +1009,7 @@ theorem isClosed_thinKitePatch (δ : ℝ) : IsClosed (thinKitePatch δ) := by fun_prop)).isClosed /-- The `thinKiteAmbientHomeomorph` declaration. -/ -noncomputable def thinKiteAmbientHomeomorph (δ : ℝ) (hδ : 0 < δ) : Plane ≃ₜ Plane := +@[expose] noncomputable def thinKiteAmbientHomeomorph (δ : ℝ) (hδ : 0 < δ) : Plane ≃ₜ Plane := (thinKiteGlobalHomeomorph δ hδ).symm.trans ((diamondFanAmbientHomeomorph (thinKiteSource δ) (thinKiteTarget δ) (thinKiteSource_lower hδ) (thinKiteSource_upper hδ) diff --git a/LeanPool/ClassificationOfSurfaces/NormalForm.lean b/LeanPool/ClassificationOfSurfaces/NormalForm.lean index c08123993a..d71c0cd6a3 100644 --- a/LeanPool/ClassificationOfSurfaces/NormalForm.lean +++ b/LeanPool/ClassificationOfSurfaces/NormalForm.lean @@ -24,7 +24,7 @@ with the exact realization homeomorphisms for the three canonical endpoints. Ev chain is a faithful polygonal quotient. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/P2DegenerateDisk.lean b/LeanPool/ClassificationOfSurfaces/P2DegenerateDisk.lean index 213d93c879..42998e856f 100644 --- a/LeanPool/ClassificationOfSurfaces/P2DegenerateDisk.lean +++ b/LeanPool/ClassificationOfSurfaces/P2DegenerateDisk.lean @@ -29,7 +29,7 @@ scaled copy receives the monogon, while the other child fills the collar between the full teardrop. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces diff --git a/LeanPool/ClassificationOfSurfaces/PolygonCellRadial.lean b/LeanPool/ClassificationOfSurfaces/PolygonCellRadial.lean index fb79863a96..92e2072dc9 100644 --- a/LeanPool/ClassificationOfSurfaces/PolygonCellRadial.lean +++ b/LeanPool/ClassificationOfSurfaces/PolygonCellRadial.lean @@ -23,7 +23,7 @@ later boundary reparameterization only needs to construct a circle homeomorphism action on marked arcs; `PolygonCell.radialHomeomorph` then supplies the disk homeomorphism. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -41,7 +41,7 @@ noncomputable def direction (z : ℂ) (hz : z ≠ 0) : Circle := @[simp] theorem coe_direction (z : ℂ) (hz : z ≠ 0) : (direction z hz : ℂ) = z / ‖z‖ := - rfl + by rfl theorem continuous_direction : Continuous (fun w : {w : ℂ // w ≠ 0} => @@ -192,7 +192,7 @@ theorem radialHomeomorph_apply_val {n m : ℕ} (h : Circle ≃ₜ Circle) (z : PolygonCell n) : (radialHomeomorph (n := n) (m := m) h z).val = Circle.radialMap h z.val := - rfl + by rfl /-- The radial cell homeomorphism restricts to the selected circle homeomorphism. -/ @[simp] diff --git a/LeanPool/ClassificationOfSurfaces/PolygonalQuotient.lean b/LeanPool/ClassificationOfSurfaces/PolygonalQuotient.lean index 61929b878d..cd60ce5193 100644 --- a/LeanPool/ClassificationOfSurfaces/PolygonalQuotient.lean +++ b/LeanPool/ClassificationOfSurfaces/PolygonalQuotient.lean @@ -30,7 +30,7 @@ oriented monogons instead of using `PolygonCell 0`. Keeping that choice out of t prevents a side-free disk from silently acquiring the wrong topology. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -72,14 +72,14 @@ theorem castHomeomorph_val {m n : ℕ} (h : m = n) (x : PolygonCell m) : rfl /-- The unit circle included in a polygonal cell. -/ -def ofCircle (n : ℕ) : C(Circle, PolygonCell n) where +@[expose] def ofCircle (n : ℕ) : C(Circle, PolygonCell n) where toFun z := ⟨z, by rw [Metric.mem_closedBall] exact z.property.le⟩ continuous_toFun := continuous_induced_rng.2 continuous_subtype_val /-- The angle swept out by side `i` at parameter `t`. -/ -noncomputable def sideAngle {n : ℕ} (i : Fin n) (t : unitInterval) : ℝ := +@[expose] noncomputable def sideAngle {n : ℕ} (i : Fin n) (t : unitInterval) : ℝ := 2 * Real.pi * ((i.val : ℝ) + t) / n theorem continuous_sideAngle {n : ℕ} (i : Fin n) : Continuous (sideAngle i) := by @@ -87,7 +87,7 @@ theorem continuous_sideAngle {n : ℕ} (i : Fin n) : Continuous (sideAngle i) := fun_prop /-- Side `i` of an `n`-sided cell, parameterized in boundary order. -/ -noncomputable def side {n : ℕ} (i : Fin n) : C(unitInterval, PolygonCell n) where +@[expose] noncomputable def side {n : ℕ} (i : Fin n) : C(unitInterval, PolygonCell n) where toFun t := ofCircle n (Circle.exp (sideAngle i t)) continuous_toFun := (ofCircle n).continuous.comp (Circle.exp.continuous.comp (continuous_sideAngle i)) @@ -99,7 +99,7 @@ noncomputable def reversedSide {n : ℕ} (i : Fin n) : C(unitInterval, PolygonCe theorem reversedSide_apply {n : ℕ} (i : Fin n) (t : unitInterval) : reversedSide i t = side i (unitInterval.symm t) := - rfl + by rfl theorem castHomeomorph_side {m n : ℕ} (h : m = n) (i : Fin m) (t : unitInterval) : @@ -220,7 +220,7 @@ structure Side (Face : Type u) (sideCount : Face → ℕ) where namespace Side /-- A point on a labelled side, included in the disjoint union. -/ -noncomputable def point {Face : Type u} {sideCount : Face → ℕ} +@[expose] noncomputable def point {Face : Type u} {sideCount : Face → ℕ} (s : Side Face sideCount) (t : unitInterval) : PreRealization Face sideCount := ⟨s.face, PolygonCell.side s.index t⟩ @@ -240,18 +240,18 @@ def homeomorph : ParameterDirection → (unitInterval ≃ₜ unitInterval) | opposite => unitInterval.symmHomeomorph theorem homeomorph_same : homeomorph same = Homeomorph.refl unitInterval := - rfl + by rfl theorem homeomorph_opposite : homeomorph opposite = unitInterval.symmHomeomorph := - rfl + by rfl @[simp] theorem homeomorph_same_apply (t : unitInterval) : homeomorph same t = t := - rfl + by rfl theorem homeomorph_opposite_apply (t : unitInterval) : homeomorph opposite t = unitInterval.symm t := - rfl + by rfl end ParameterDirection @@ -267,19 +267,19 @@ structure Identification (Face : Type u) (sideCount : Face → ℕ) where namespace Identification /-- The affine parameter homeomorphism of a side identification. -/ -def parameter {Face : Type u} {sideCount : Face → ℕ} +@[expose] def parameter {Face : Type u} {sideCount : Face → ℕ} (identification : Identification Face sideCount) : unitInterval ≃ₜ unitInterval := identification.direction.homeomorph /-- Identify two sides with the same parameter direction. -/ -def sameDirection {Face : Type u} {sideCount : Face → ℕ} +@[expose] def sameDirection {Face : Type u} {sideCount : Face → ℕ} (source target : Side Face sideCount) : Identification Face sideCount where source := source target := target direction := .same /-- Identify two sides with the parameter direction reversed. -/ -def oppositeDirection {Face : Type u} {sideCount : Face → ℕ} +@[expose] def oppositeDirection {Face : Type u} {sideCount : Face → ℕ} (source target : Side Face sideCount) : Identification Face sideCount where source := source target := target @@ -289,13 +289,13 @@ def oppositeDirection {Face : Type u} {sideCount : Face → ℕ} theorem parameter_sameDirection {Face : Type u} {sideCount : Face → ℕ} (source target : Side Face sideCount) : (sameDirection source target).parameter = Homeomorph.refl unitInterval := - rfl + by rfl @[simp] theorem parameter_oppositeDirection {Face : Type u} {sideCount : Face → ℕ} (source target : Side Face sideCount) : (oppositeDirection source target).parameter = unitInterval.symmHomeomorph := - rfl + by rfl end Identification diff --git a/LeanPool/ClassificationOfSurfaces/RepresentativeCarrier.lean b/LeanPool/ClassificationOfSurfaces/RepresentativeCarrier.lean index 3b4cdad4bf..3b6d2e354e 100644 --- a/LeanPool/ClassificationOfSurfaces/RepresentativeCarrier.lean +++ b/LeanPool/ClassificationOfSurfaces/RepresentativeCarrier.lean @@ -31,7 +31,7 @@ canonical polygonal generators transports to the equivalence closure of `Orienta `NonOrientableRel`. -/ -@[expose] public section +public section namespace Complex diff --git a/LeanPool/ClassificationOfSurfaces/Representatives.lean b/LeanPool/ClassificationOfSurfaces/Representatives.lean index 916b7f1dec..933539b875 100644 --- a/LeanPool/ClassificationOfSurfaces/Representatives.lean +++ b/LeanPool/ClassificationOfSurfaces/Representatives.lean @@ -16,7 +16,7 @@ The Lean-Eval challenge owns `Complex.ClosedUnitDisc`, `OrientableRel`, and only the project-owned sphere abbreviation and the index type used by the normal-form reduction. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/SignedPresentation.lean b/LeanPool/ClassificationOfSurfaces/SignedPresentation.lean index 7a89a7dfcb..63a7f74aa2 100644 --- a/LeanPool/ClassificationOfSurfaces/SignedPresentation.lean +++ b/LeanPool/ClassificationOfSurfaces/SignedPresentation.lean @@ -24,7 +24,7 @@ does not trust the stored vertex endpoints. This is the combinatorial input need boundary-word moves can be stated independently of a presentation's original edge names. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -34,7 +34,7 @@ namespace SurfaceCellComplex namespace SignedDart /-- Relabel signed darts along an equivalence of edge names. -/ -def mapEquiv {α β : Type*} (e : α ≃ β) : SignedDart α ≃ SignedDart β where +@[expose] def mapEquiv {α β : Type*} (e : α ≃ β) : SignedDart α ≃ SignedDart β where toFun | .pos a => .pos (e a) | .neg a => .neg (e a) diff --git a/LeanPool/ClassificationOfSurfaces/SphereCarrierGeometry.lean b/LeanPool/ClassificationOfSurfaces/SphereCarrierGeometry.lean index 32dc87d3b8..638d4e456d 100644 --- a/LeanPool/ClassificationOfSurfaces/SphereCarrierGeometry.lean +++ b/LeanPool/ClassificationOfSurfaces/SphereCarrierGeometry.lean @@ -25,7 +25,7 @@ The indexed cells are also compact. The instance is transported through the exis homeomorphism with the closed unit disk, keeping this fact tied to the actual polygon carrier. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/SphereHemisphere.lean b/LeanPool/ClassificationOfSurfaces/SphereHemisphere.lean index 72c3f952e4..f47956f324 100644 --- a/LeanPool/ClassificationOfSurfaces/SphereHemisphere.lean +++ b/LeanPool/ClassificationOfSurfaces/SphereHemisphere.lean @@ -25,7 +25,7 @@ continuous facewise map on the polygonal pre-realization respects every raw glui `SphereQuotientHomeomorph` descends this map and proves that it is a homeomorphism. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -42,7 +42,7 @@ theorem normSq_le_one {n : ℕ} (z : PolygonCell n) : Complex.normSq z.val ≤ 1 simpa only [Metric.mem_closedBall, Complex.dist_eq, sub_zero] using z.property /-- The nonnegative height above the equatorial plane associated to a disk point. -/ -noncomputable def hemisphereHeight {n : ℕ} (z : PolygonCell n) : ℝ := +@[expose] noncomputable def hemisphereHeight {n : ℕ} (z : PolygonCell n) : ℝ := Real.sqrt (1 - Complex.normSq z.val) theorem hemisphereHeight_nonneg {n : ℕ} (z : PolygonCell n) : @@ -62,12 +62,12 @@ theorem continuous_hemisphereHeight {n : ℕ} : (continuous_const.sub (Complex.continuous_normSq.comp PolygonCell.continuous_val)) /-- A disk point placed on the upper unit hemisphere. -/ -noncomputable def upperHemisphereVector (z : PolygonCell 1) : +@[expose] noncomputable def upperHemisphereVector (z : PolygonCell 1) : EuclideanSpace ℝ (Fin 3) := !₂[z.val.re, z.val.im, hemisphereHeight z] /-- A conjugated disk point placed on the lower unit hemisphere. -/ -noncomputable def lowerHemisphereVector (z : PolygonCell 1) : +@[expose] noncomputable def lowerHemisphereVector (z : PolygonCell 1) : EuclideanSpace ℝ (Fin 3) := !₂[(conj z.val).re, (conj z.val).im, -hemisphereHeight z] @@ -98,7 +98,7 @@ theorem continuous_lowerHemisphereVector : Continuous lowerHemisphereVector := b fun_prop /-- The continuous map from a monogon disk to the upper unit hemisphere. -/ -noncomputable def upperHemisphere : C(PolygonCell 1, SphereRepresentative) where +@[expose] noncomputable def upperHemisphere : C(PolygonCell 1, SphereRepresentative) where toFun z := ⟨upperHemisphereVector z, by rw [Metric.mem_sphere] simpa only [dist_eq_norm, sub_zero] using upperHemisphereVector_norm z⟩ @@ -107,7 +107,7 @@ noncomputable def upperHemisphere : C(PolygonCell 1, SphereRepresentative) where simpa only [dist_eq_norm, sub_zero] using upperHemisphereVector_norm z /-- The continuous map from a monogon disk to the lower unit hemisphere. -/ -noncomputable def lowerHemisphere : C(PolygonCell 1, SphereRepresentative) where +@[expose] noncomputable def lowerHemisphere : C(PolygonCell 1, SphereRepresentative) where toFun z := ⟨lowerHemisphereVector z, by rw [Metric.mem_sphere] simpa only [dist_eq_norm, sub_zero] using lowerHemisphereVector_norm z⟩ diff --git a/LeanPool/ClassificationOfSurfaces/SphereQuotientHomeomorph.lean b/LeanPool/ClassificationOfSurfaces/SphereQuotientHomeomorph.lean index 7411504d74..5b6d0a65f7 100644 --- a/LeanPool/ClassificationOfSurfaces/SphereQuotientHomeomorph.lean +++ b/LeanPool/ClassificationOfSurfaces/SphereQuotientHomeomorph.lean @@ -21,7 +21,7 @@ the descended map is bijective and hence, by compactness of the source and the H of the target, a homeomorphism with `SphereRepresentative`. -/ -@[expose] public section +public section namespace LeanEval namespace Topology diff --git a/LeanPool/ClassificationOfSurfaces/StrongVertexStar.lean b/LeanPool/ClassificationOfSurfaces/StrongVertexStar.lean index b027598933..42ac63d1ec 100644 --- a/LeanPool/ClassificationOfSurfaces/StrongVertexStar.lean +++ b/LeanPool/ClassificationOfSurfaces/StrongVertexStar.lean @@ -23,7 +23,7 @@ had two adjacency components, their finite closed face unions would separate tha chart. -/ -@[expose] public section +public section open Set Topology open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Surface.lean b/LeanPool/ClassificationOfSurfaces/Surface.lean index 71cfe939ee..4032b828cc 100644 --- a/LeanPool/ClassificationOfSurfaces/Surface.lean +++ b/LeanPool/ClassificationOfSurfaces/Surface.lean @@ -13,7 +13,7 @@ public import Mathlib.Geometry.Manifold.Instances.Real This file records the manifold assumptions used by the Lean Eval target. -/ -@[expose] public section +public section open scoped Manifold diff --git a/LeanPool/ClassificationOfSurfaces/Topology/InvarianceOfDomain.lean b/LeanPool/ClassificationOfSurfaces/Topology/InvarianceOfDomain.lean index 1788f219ac..7c59f9f1e3 100644 --- a/LeanPool/ClassificationOfSurfaces/Topology/InvarianceOfDomain.lean +++ b/LeanPool/ClassificationOfSurfaces/Topology/InvarianceOfDomain.lean @@ -46,7 +46,7 @@ Stone-Weierstrass approximation, and a measure-theoretic perturbation argument. problem", 2011. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces.InvarianceOfDomain diff --git a/LeanPool/ClassificationOfSurfaces/TriangleCell.lean b/LeanPool/ClassificationOfSurfaces/TriangleCell.lean index b85d914118..3c54968a18 100644 --- a/LeanPool/ClassificationOfSurfaces/TriangleCell.lean +++ b/LeanPool/ClassificationOfSurfaces/TriangleCell.lean @@ -19,7 +19,7 @@ boundary calibration is exact: circular side `i` at parameter `t` is sent to the parameter `t` on standard triangle edge `i`. -/ -@[expose] public section +public section open Set Topology diff --git a/LeanPool/ClassificationOfSurfaces/Triangulation.lean b/LeanPool/ClassificationOfSurfaces/Triangulation.lean index 9ac47574d2..b1b88ba74e 100644 --- a/LeanPool/ClassificationOfSurfaces/Triangulation.lean +++ b/LeanPool/ClassificationOfSurfaces/Triangulation.lean @@ -26,7 +26,7 @@ its stored realization. The classification proof therefore starts from `Geometri and uses the incidence certificate constructed by its bridge. -/ -@[expose] public section +public section namespace LeanEval namespace Topology @@ -41,7 +41,7 @@ deriving DecidableEq, Repr, Fintype namespace OrientedEdge /-- The underlying unoriented edge. -/ -def edge {α : Type*} : OrientedEdge α → α +@[expose] def edge {α : Type*} : OrientedEdge α → α | pos e => e | neg e => e @@ -159,7 +159,7 @@ def orientedEdge {S : Type*} [TopologicalSpace S] {T : FiniteSurfaceTriangulatio (T.triangleBoundary o.1).get o.2 /-- The unoriented edge stored at a triangle-boundary position. -/ -def edge {S : Type*} [TopologicalSpace S] {T : FiniteSurfaceTriangulation S} +@[expose] def edge {S : Type*} [TopologicalSpace S] {T : FiniteSurfaceTriangulation S} (o : T.BoundaryPosition) : T.Edge := o.orientedEdge.edge @@ -361,7 +361,7 @@ theorem triangleBoundary_nodup (t : T.Triangle) : (T.triangleBoundary t).Nodup : This is the compatibility bridge: downstream consumers (the cell-complex conversion and the Gallier--Xu route) keep their interface, while the triangulation content now lives in the faithful geometric object. -/ -noncomputable def toFiniteSurfaceTriangulation : FiniteSurfaceTriangulation S where +@[expose] noncomputable def toFiniteSurfaceTriangulation : FiniteSurfaceTriangulation S where Vertex := T.Vertex Edge := T.Edge Triangle := T.Triangle diff --git a/LeanPool/ClassificationOfSurfaces/WeightedCircle.lean b/LeanPool/ClassificationOfSurfaces/WeightedCircle.lean index b898243d3d..56ba76be2e 100644 --- a/LeanPool/ClassificationOfSurfaces/WeightedCircle.lean +++ b/LeanPool/ClassificationOfSurfaces/WeightedCircle.lean @@ -16,7 +16,7 @@ packages that map as a homeomorphism of intervals and, after identifying endpoin homeomorphism of circles. It is the geometric core of Gallier--Xu P1 edge subdivision. -/ -@[expose] public section +public section namespace LeanEval.Topology.ClassificationOfSurfaces @@ -35,7 +35,7 @@ noncomputable def unstretch : List ℕ → ℝ → ℝ if y ≤ w then y / w else 1 + unstretch weights (y - w) /-- Every weight is strictly positive. -/ -def Positive (weights : List ℕ) : Prop := +@[expose] def Positive (weights : List ℕ) : Prop := ∀ w ∈ weights, 0 < w theorem Positive.head {w : ℕ} {weights : List ℕ} @@ -61,11 +61,11 @@ theorem sum_take_lt_sum {weights : List ℕ} (h : Positive weights) @[simp] theorem stretch_nil (x : ℝ) : stretch [] x = 0 := - rfl + by rfl @[simp] theorem unstretch_nil (y : ℝ) : unstretch [] y = 0 := - rfl + by rfl @[simp] theorem stretch_zero (weights : List ℕ) : stretch weights 0 = 0 := by @@ -397,7 +397,7 @@ noncomputable def intervalHomeomorph (weights : List ℕ) (h : Positive weights) theorem intervalHomeomorph_apply_val (weights : List ℕ) (h : Positive weights) (x : Set.Icc (0 : ℝ) (0 + weights.length)) : (intervalHomeomorph weights h x).val = stretch weights x := - rfl + by rfl @[simp] theorem intervalHomeomorph_zero (weights : List ℕ) (h : Positive weights) : diff --git a/LeanPool/Clawristotle.lean b/LeanPool/Clawristotle.lean index 9de9bdfdb6..f12a9fca51 100644 --- a/LeanPool/Clawristotle.lean +++ b/LeanPool/Clawristotle.lean @@ -22,7 +22,7 @@ Tags: pde, kinetic-theory, mathematical-physics MSC: 35Q83, 82C40, 35Q61 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Clawristotle/CoulombConcreteTheorem42.lean b/LeanPool/Clawristotle/CoulombConcreteTheorem42.lean index 8b9a4f3b27..d56abfc8a6 100644 --- a/LeanPool/Clawristotle/CoulombConcreteTheorem42.lean +++ b/LeanPool/Clawristotle/CoulombConcreteTheorem42.lean @@ -30,7 +30,7 @@ steady state of the VML system with Coulomb collisions is a global Maxwellian with E = 0 and B = const. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombFlux.lean b/LeanPool/Clawristotle/CoulombFlux.lean index eca9d816cd..6308a4e8b5 100644 --- a/LeanPool/Clawristotle/CoulombFlux.lean +++ b/LeanPool/Clawristotle/CoulombFlux.lean @@ -19,7 +19,7 @@ Proves integrability of the Landau collision flux, Schwartz partial decay, and AEStronglyMeasurability of flux components for the Coulomb kernel. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombFluxBound.lean b/LeanPool/Clawristotle/CoulombFluxBound.lean index 2af634484d..f4703d6797 100644 --- a/LeanPool/Clawristotle/CoulombFluxBound.lean +++ b/LeanPool/Clawristotle/CoulombFluxBound.lean @@ -22,7 +22,7 @@ Proves: - `coulomb_flux_component_bound`: Pointwise |flux_i(v)| ≤ Cf * g(v) * (1+‖v‖)^Kg. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombFluxConv.lean b/LeanPool/Clawristotle/CoulombFluxConv.lean index b894411edb..fb73e3e4c9 100644 --- a/LeanPool/Clawristotle/CoulombFluxConv.lean +++ b/LeanPool/Clawristotle/CoulombFluxConv.lean @@ -23,7 +23,7 @@ Coulomb kernel entry convolutions are differentiable with uniform derivative bou and the full Coulomb flux component is differentiable with a decomposition formula. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombFluxDiff.lean b/LeanPool/Clawristotle/CoulombFluxDiff.lean index 0c683639ba..23d32b722f 100644 --- a/LeanPool/Clawristotle/CoulombFluxDiff.lean +++ b/LeanPool/Clawristotle/CoulombFluxDiff.lean @@ -19,7 +19,7 @@ decomposition) and the IBP integrability condition for the flux derivative times Depends on differentiability and decomposition results from CoulombFluxConv. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombForceTransport.lean b/LeanPool/Clawristotle/CoulombForceTransport.lean index 79505d0607..414d295809 100644 --- a/LeanPool/Clawristotle/CoulombForceTransport.lean +++ b/LeanPool/Clawristotle/CoulombForceTransport.lean @@ -21,7 +21,7 @@ term ((E + v × B) · ∇ᵥf · log f), and force IBP terms for the Coulomb ker Uses Schwartz decay, log growth bounds, and the Lorentz force component bound. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombKernel.lean b/LeanPool/Clawristotle/CoulombKernel.lean index 82fce760a7..477d5a8030 100644 --- a/LeanPool/Clawristotle/CoulombKernel.lean +++ b/LeanPool/Clawristotle/CoulombKernel.lean @@ -16,7 +16,7 @@ Defines `coulombKernel` (Psi(r) = r^{-3} for r > 0) and proves basic properties: strict positivity, Schwartz uniform bounds, and `inv_norm_schwartz_integrable`. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real @@ -27,7 +27,7 @@ namespace VML The value at r ≤ 0 is irrelevant since landauMatrix Ψ 0 = 0 always (the projection |z|²I - zz^T vanishes at z = 0). Setting it to 1 ensures ∀ r, 0 < Ψ r, which the abstract theorem requires. -/ -def coulombKernel (r : ℝ) : ℝ := +@[expose] def coulombKernel (r : ℝ) : ℝ := if r ≤ 0 then 1 else r ^ (-3 : ℝ) lemma coulombKernel_pos : ∀ r, 0 < coulombKernel r := by diff --git a/LeanPool/Clawristotle/CoulombNonvacuous.lean b/LeanPool/Clawristotle/CoulombNonvacuous.lean index 7d27c46cba..de07052b3a 100644 --- a/LeanPool/Clawristotle/CoulombNonvacuous.lean +++ b/LeanPool/Clawristotle/CoulombNonvacuous.lean @@ -26,7 +26,7 @@ Also provides helper lemmas about the equilibrium Maxwellian: - `equilibriumMaxwellian_log_bound`: polynomial log growth -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombPSD.lean b/LeanPool/Clawristotle/CoulombPSD.lean index f745a82e51..6491448161 100644 --- a/LeanPool/Clawristotle/CoulombPSD.lean +++ b/LeanPool/Clawristotle/CoulombPSD.lean @@ -22,7 +22,7 @@ symmetrization needed for the H-theorem entropy dissipation identity. Depends on continuity and pointwise bounds from CoulombPSDHelpers. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombPSDHelpers.lean b/LeanPool/Clawristotle/CoulombPSDHelpers.lean index ad985fa80e..25f54be26b 100644 --- a/LeanPool/Clawristotle/CoulombPSDHelpers.lean +++ b/LeanPool/Clawristotle/CoulombPSDHelpers.lean @@ -19,7 +19,7 @@ Proves the Landau quadratic form bound, continuity of the PSD integrand These are building blocks for the integrability and Fubini results in CoulombPSD. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/CoulombSpatialTransport.lean b/LeanPool/Clawristotle/CoulombSpatialTransport.lean index 94fe2f3949..05504b18a2 100644 --- a/LeanPool/Clawristotle/CoulombSpatialTransport.lean +++ b/LeanPool/Clawristotle/CoulombSpatialTransport.lean @@ -17,7 +17,7 @@ import Mathlib.Data.Nat.Choose.Multinomial # LeanPool.Clawristotle.CoulombSpatialTransport -/ -@[expose] public section +public section /-\! # Spatial Transport: Measurability, Joint Integrability, and Continuity diff --git a/LeanPool/Clawristotle/Defs.lean b/LeanPool/Clawristotle/Defs.lean index 3b8a01625b..7831dd83f2 100644 --- a/LeanPool/Clawristotle/Defs.lean +++ b/LeanPool/Clawristotle/Defs.lean @@ -20,7 +20,7 @@ small auxiliary lemmas about the definitions. Derived FlatTorus3 lemmas are in `FlatTorus3Lemmas.lean`. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory @@ -33,7 +33,7 @@ namespace VML -- ============================================================================ /-- Squared Euclidean norm: ‖z‖² = z · z = ∑ᵢ zᵢ² -/ -def normSq (z : Fin 3 → ℝ) : ℝ := dotProduct z z +@[expose] def normSq (z : Fin 3 → ℝ) : ℝ := dotProduct z z @[simp] lemma normSq_zero : normSq (0 : Fin 3 → ℝ) = 0 := by @@ -58,7 +58,7 @@ lemma normSq_neg (z : Fin 3 → ℝ) : normSq (-z) = normSq z := by simp [normSq, dotProduct, Pi.neg_apply] /-- Euclidean norm: |z| = √(z · z) -/ -def eucNorm (z : Fin 3 → ℝ) : ℝ := Real.sqrt (normSq z) +@[expose] def eucNorm (z : Fin 3 → ℝ) : ℝ := Real.sqrt (normSq z) lemma eucNorm_nonneg (z : Fin 3 → ℝ) : 0 ≤ eucNorm z := Real.sqrt_nonneg _ @@ -74,12 +74,12 @@ lemma eucNorm_sq (z : Fin 3 → ℝ) : eucNorm z ^ 2 = normSq z := by /-- The inner part of the Landau matrix: B(z) = |z|² I₃ - z zᵀ. This is the matrix that appears inside the scalar factor Ψ(|z|). -/ -def innerLandauMatrix (z : Fin 3 → ℝ) : Matrix (Fin 3) (Fin 3) ℝ := +@[expose] def innerLandauMatrix (z : Fin 3 → ℝ) : Matrix (Fin 3) (Fin 3) ℝ := normSq z • (1 : Matrix (Fin 3) (Fin 3) ℝ) - vecMulVec z z /-- The Landau collision matrix: A(z) = Ψ(|z|) · (|z|² I₃ - z zᵀ). Reference: Definition 2 (def:landau_matrix) -/ -def landauMatrix (Ψ : ℝ → ℝ) (z : Fin 3 → ℝ) : Matrix (Fin 3) (Fin 3) ℝ := +@[expose] def landauMatrix (Ψ : ℝ → ℝ) (z : Fin 3 → ℝ) : Matrix (Fin 3) (Fin 3) ℝ := Ψ (eucNorm z) • innerLandauMatrix z lemma innerLandauMatrix_apply (z : Fin 3 → ℝ) (i j : Fin 3) : @@ -93,7 +93,7 @@ lemma innerLandauMatrix_apply (z : Fin 3 → ℝ) (i j : Fin 3) : /-- A Maxwellian distribution: log-quadratic with c₀ < 0 (ensuring integrability). Specifically: ∃ a₀ b c₀, c₀ < 0 ∧ f(v) = exp(a₀ + b · v + c₀ |v|²) -/ -def IsMaxwellian (f : (Fin 3 → ℝ) → ℝ) : Prop := +@[expose] def IsMaxwellian (f : (Fin 3 → ℝ) → ℝ) : Prop := ∃ (a₀ : ℝ) (b : Fin 3 → ℝ) (c₀ : ℝ), c₀ < 0 ∧ ∀ v, f v = Real.exp (a₀ + dotProduct b v + c₀ * normSq v) @@ -140,7 +140,7 @@ lemma _root_.VML.IsMaxwellian.contDiff (hM : IsMaxwellian f) : ContDiff ℝ ⊤ /-- The equilibrium Maxwellian (zero drift, density = ρIon): f∞(v) = ρIon/(2πT∞)^(3/2) · exp(-|v|²/(2T∞)) -/ -def equilibriumMaxwellian (ρIon T : ℝ) (v : Fin 3 → ℝ) : ℝ := +@[expose] def equilibriumMaxwellian (ρIon T : ℝ) (v : Fin 3 → ℝ) : ℝ := ρIon / (2 * π * T) ^ ((3 : ℝ) / 2) * Real.exp (-(normSq v) / (2 * T)) @@ -191,15 +191,15 @@ lemma equilibriumMaxwellian_pos (ρ T : ℝ) (hρ : 0 < ρ) (hT : 0 < T) (v : Fi /-- Velocity gradient: ∇ᵥf(v), the vector of partial derivatives of f at v. Uses Fréchet derivative from Mathlib. -/ -def vGrad (f : (Fin 3 → ℝ) → ℝ) (v : Fin 3 → ℝ) : Fin 3 → ℝ := +@[expose] def vGrad (f : (Fin 3 → ℝ) → ℝ) (v : Fin 3 → ℝ) : Fin 3 → ℝ := fun i => fderiv ℝ f v (Pi.single i 1) /-- Velocity divergence: ∇ᵥ · F(v) = ∑ᵢ ∂Fᵢ/∂vᵢ -/ -def vDiv (F : (Fin 3 → ℝ) → (Fin 3 → ℝ)) (v : Fin 3 → ℝ) : ℝ := +@[expose] def vDiv (F : (Fin 3 → ℝ) → (Fin 3 → ℝ)) (v : Fin 3 → ℝ) : ℝ := ∑ i : Fin 3, fderiv ℝ (fun w => F w i) v (Pi.single i 1) /-- Cross product in ℝ³: a × b -/ -def cross (a b : Fin 3 → ℝ) : Fin 3 → ℝ := +@[expose] def cross (a b : Fin 3 → ℝ) : Fin 3 → ℝ := ![a 1 * b 2 - a 2 * b 1, a 2 * b 0 - a 0 * b 2, a 0 * b 1 - a 1 * b 0] /-- Velocity-space integration by parts on ℝ³. @@ -247,14 +247,14 @@ lemma velocity_ibp Reference: Definition 3 (def:landau_operator) Q(f,f)(v) = ∇ᵥ · ∫_{ℝ³} A(v-w) [f(w)∇ᵥf(v) - f(v)∇_wf(w)] dw -/ -def LandauOperator (Ψ : ℝ → ℝ) (f : (Fin 3 → ℝ) → ℝ) (v : Fin 3 → ℝ) : ℝ := +@[expose] def LandauOperator (Ψ : ℝ → ℝ) (f : (Fin 3 → ℝ) → ℝ) (v : Fin 3 → ℝ) : ℝ := vDiv (fun v' => ∫ w, mulVec (landauMatrix Ψ (v' - w)) (f w • vGrad f v' - f v' • vGrad f w)) v /-- The entropy dissipation functional: D(f) = ∫ Q(f,f)(v) log f(v) dv. Reference: Definition in Lemma 5 (lem:entropy_dissipation) -/ -def entropyDissipation (Ψ : ℝ → ℝ) (f : (Fin 3 → ℝ) → ℝ) : ℝ := +@[expose] def entropyDissipation (Ψ : ℝ → ℝ) (f : (Fin 3 → ℝ) → ℝ) : ℝ := ∫ v, LandauOperator Ψ f v * Real.log (f v) /-- IBP for the Landau collision operator: ∫ Q(g,g)(v) · log g(v) dv equals @@ -323,7 +323,7 @@ lemma landau_ibp (Ψ : ℝ → ℝ) (g : (Fin 3 → ℝ) → ℝ) /-- The PSD integrand: g(v,w) = f(v)·f(w)·⟨Δ(v,w), A(v-w) Δ(v,w)⟩ where Δ(v,w) = ∇log f(v) - ∇log f(w). This appears in the entropy dissipation formula (Lemma 5). -/ -def PSDIntegrand (Ψ : ℝ → ℝ) (f : (Fin 3 → ℝ) → ℝ) (v w : Fin 3 → ℝ) : ℝ := +@[expose] def PSDIntegrand (Ψ : ℝ → ℝ) (f : (Fin 3 → ℝ) → ℝ) (v w : Fin 3 → ℝ) : ℝ := f v * f w * dotProduct (vGrad (Real.log ∘ f) v - vGrad (Real.log ∘ f) w) (mulVec (landauMatrix Ψ (v - w)) diff --git a/LeanPool/Clawristotle/FlatTorus3Lemmas.lean b/LeanPool/Clawristotle/FlatTorus3Lemmas.lean index ede8600e71..b84a21142b 100644 --- a/LeanPool/Clawristotle/FlatTorus3Lemmas.lean +++ b/LeanPool/Clawristotle/FlatTorus3Lemmas.lean @@ -16,7 +16,7 @@ chain rules for log, integration by parts consequences, Laplacian sign at extrem and Maxwellian parameter regularity. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/Clawristotle/GaussianHelpers.lean b/LeanPool/Clawristotle/GaussianHelpers.lean index 836a29454c..f4e8bc1aa8 100644 --- a/LeanPool/Clawristotle/GaussianHelpers.lean +++ b/LeanPool/Clawristotle/GaussianHelpers.lean @@ -18,7 +18,7 @@ Gaussian normalization, gradient of exponential-quadratic functions, integrability, and related analysis lemmas used in Section 3. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/Clawristotle/IteratedDerivHelpers.lean b/LeanPool/Clawristotle/IteratedDerivHelpers.lean index 1110096538..132c4e096b 100644 --- a/LeanPool/Clawristotle/IteratedDerivHelpers.lean +++ b/LeanPool/Clawristotle/IteratedDerivHelpers.lean @@ -17,7 +17,7 @@ Bounds on iterated derivatives of continuous linear maps and quadratic forms, used in the Schwartz decay proof for the equilibrium Maxwellian. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/Clawristotle/LogBoundHelpers.lean b/LeanPool/Clawristotle/LogBoundHelpers.lean index e0d1324d1a..1ee5513915 100644 --- a/LeanPool/Clawristotle/LogBoundHelpers.lean +++ b/LeanPool/Clawristotle/LogBoundHelpers.lean @@ -15,7 +15,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # LeanPool.Clawristotle.LogBoundHelpers -/ -@[expose] public section +public section open ContinuousLinearMap Real Set VML diff --git a/LeanPool/Clawristotle/NewtonianPotential.lean b/LeanPool/Clawristotle/NewtonianPotential.lean index bfb5d2b3fa..36fb76809b 100644 --- a/LeanPool/Clawristotle/NewtonianPotential.lean +++ b/LeanPool/Clawristotle/NewtonianPotential.lean @@ -19,7 +19,7 @@ integrability of ||z||^{-1} against Schwartz functions, the key estimates for handling the Coulomb singularity in collision integrals. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/SchwartzDecayDefs.lean b/LeanPool/Clawristotle/SchwartzDecayDefs.lean index 4f602adb99..76986b9734 100644 --- a/LeanPool/Clawristotle/SchwartzDecayDefs.lean +++ b/LeanPool/Clawristotle/SchwartzDecayDefs.lean @@ -20,7 +20,7 @@ and proves basic integrability lemmas. This is the standard regularity assumptio for kinetic theory used throughout the Coulomb concrete theorem files. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/Section2.lean b/LeanPool/Clawristotle/Section2.lean index 90c07a119b..14077a1e96 100644 --- a/LeanPool/Clawristotle/Section2.lean +++ b/LeanPool/Clawristotle/Section2.lean @@ -16,7 +16,7 @@ Properties of the Landau collision matrix: evenness, positive semidefiniteness, the symmetrized weak form, and the entropy dissipation identity D(f) as a double integral. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/Section3.lean b/LeanPool/Clawristotle/Section3.lean index bbe68b51fd..40aba35bd0 100644 --- a/LeanPool/Clawristotle/Section3.lean +++ b/LeanPool/Clawristotle/Section3.lean @@ -20,7 +20,7 @@ as f being a Maxwellian, and Corollary 1: if entropy dissipation vanishes then f is a local Maxwellian at each spatial point. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/Clawristotle/Section3Helpers.lean b/LeanPool/Clawristotle/Section3Helpers.lean index 3c41fd5cac..c94b3d736b 100644 --- a/LeanPool/Clawristotle/Section3Helpers.lean +++ b/LeanPool/Clawristotle/Section3Helpers.lean @@ -20,7 +20,7 @@ characterization, and derivative bounds used in the nullspace analysis of the Landau operator. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/Clawristotle/Section3Helpers2.lean b/LeanPool/Clawristotle/Section3Helpers2.lean index 921ccc6574..1c6d04e897 100644 --- a/LeanPool/Clawristotle/Section3Helpers2.lean +++ b/LeanPool/Clawristotle/Section3Helpers2.lean @@ -16,7 +16,7 @@ import Mathlib.Data.Nat.Choose.Multinomial # LeanPool.Clawristotle.Section3Helpers2 -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real diff --git a/LeanPool/Clawristotle/Section4.lean b/LeanPool/Clawristotle/Section4.lean index 1fc1df4dd9..c77ca4c0e8 100644 --- a/LeanPool/Clawristotle/Section4.lean +++ b/LeanPool/Clawristotle/Section4.lean @@ -19,7 +19,7 @@ and D(f) = 0 at each spatial point, applies Corollary 1 to conclude f(x, .) is Maxwellian for each x. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/Section5.lean b/LeanPool/Clawristotle/Section5.lean index 3ae3bda094..becbe17357 100644 --- a/LeanPool/Clawristotle/Section5.lean +++ b/LeanPool/Clawristotle/Section5.lean @@ -19,7 +19,7 @@ identity matching that constrains the Maxwellian parameters (a, b, c) from the Vlasov transport equation. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/Section6.lean b/LeanPool/Clawristotle/Section6.lean index 0b9df62d84..985741d50a 100644 --- a/LeanPool/Clawristotle/Section6.lean +++ b/LeanPool/Clawristotle/Section6.lean @@ -16,7 +16,7 @@ Proves that the drift velocity u_inf = 0 using Ampere's law, Stokes' theorem on the torus, and positivity of the charge density. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/Section7.lean b/LeanPool/Clawristotle/Section7.lean index 3d05e81465..da3abe7520 100644 --- a/LeanPool/Clawristotle/Section7.lean +++ b/LeanPool/Clawristotle/Section7.lean @@ -23,7 +23,7 @@ then proves the electric field vanishes (E = 0) and the magnetic field is spatially constant using harmonic function theory on the torus. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/Section8.lean b/LeanPool/Clawristotle/Section8.lean index e7b55a6eb0..c177df6cab 100644 --- a/LeanPool/Clawristotle/Section8.lean +++ b/LeanPool/Clawristotle/Section8.lean @@ -18,7 +18,7 @@ derives E = 0 from the Poisson-Boltzmann equation, and assembles the abstract `ConcreteTheorem42` combining all sections. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/Theorem42.lean b/LeanPool/Clawristotle/Theorem42.lean index 8a891677db..b15c7dcc98 100644 --- a/LeanPool/Clawristotle/Theorem42.lean +++ b/LeanPool/Clawristotle/Theorem42.lean @@ -30,7 +30,7 @@ velocities $v \in \mathbb{R}^3$ are unbounded. This admits superluminal particle but is the standard mathematical setting for the classical Landau equation. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/TorusDefs.lean b/LeanPool/Clawristotle/TorusDefs.lean index 87c8f0ecbe..e68612bcab 100644 --- a/LeanPool/Clawristotle/TorusDefs.lean +++ b/LeanPool/Clawristotle/TorusDefs.lean @@ -20,7 +20,7 @@ and differential operators (`torusGradX`, `torusDivX`, `torusCurlX`) via the periodic lift. The `FlatTorus3` instance is assembled in `TorusInstance.lean`. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real Filter @@ -47,7 +47,7 @@ instance : SigmaFinite (volume : Measure Torus3) := inferInstance -- ============================================================================ /-- The quotient map ℝ³ → T³, sending each coordinate to its equivalence class. -/ -def torusMk (x : Fin 3 → ℝ) : Torus3 := fun i => QuotientAddGroup.mk (x i) +@[expose] def torusMk (x : Fin 3 → ℝ) : Torus3 := fun i => QuotientAddGroup.mk (x i) -- torusMk is surjective (every point in T³ has a preimage) lemma torusMk_surjective : Function.Surjective torusMk := by @@ -61,7 +61,7 @@ lemma torusMk_surjective : Function.Surjective torusMk := by -- ============================================================================ /-- The periodic lift of a function on the torus to ℝ³. -/ -def periodicLift (f : Torus3 → ℝ) : (Fin 3 → ℝ) → ℝ := f ∘ torusMk +@[expose] def periodicLift (f : Torus3 → ℝ) : (Fin 3 → ℝ) → ℝ := f ∘ torusMk -- The lift IS periodic (by construction): lemma periodicLift_periodic (f : Torus3 → ℝ) (x : Fin 3 → ℝ) (i : Fin 3) : @@ -115,18 +115,18 @@ lemma periodicLift_fderiv_eq (f : Torus3 → ℝ) (x y : Fin 3 → ℝ) /-- Spatial gradient on T³. For f : T³ → ℝ, we lift to ℝ³, compute fderiv, and read off components. This is well-defined by periodicLift_fderiv_eq. -/ -def torusGradX (f : Torus3 → ℝ) (x : Torus3) : Fin 3 → ℝ := +@[expose] def torusGradX (f : Torus3 → ℝ) (x : Torus3) : Fin 3 → ℝ := -- Choose any preimage of x let x₀ := (torusMk_surjective x).choose fun i => fderiv ℝ (periodicLift f) x₀ (Pi.single i 1) /-- Spatial divergence on T³. -/ -def torusDivX (F : Torus3 → (Fin 3 → ℝ)) (x : Torus3) : ℝ := +@[expose] def torusDivX (F : Torus3 → (Fin 3 → ℝ)) (x : Torus3) : ℝ := let x₀ := (torusMk_surjective x).choose ∑ i : Fin 3, fderiv ℝ (fun y => periodicLift (fun z => F z i) y) x₀ (Pi.single i 1) /-- Spatial curl on T³. -/ -def torusCurlX (F : Torus3 → (Fin 3 → ℝ)) (x : Torus3) : Fin 3 → ℝ := +@[expose] def torusCurlX (F : Torus3 → (Fin 3 → ℝ)) (x : Torus3) : Fin 3 → ℝ := let x₀ := (torusMk_surjective x).choose let d := fun i j => fderiv ℝ (fun y => periodicLift (fun z => F z j) y) x₀ (Pi.single i 1) ![d 1 2 - d 2 1, d 2 0 - d 0 2, d 0 1 - d 1 0] diff --git a/LeanPool/Clawristotle/TorusInstance.lean b/LeanPool/Clawristotle/TorusInstance.lean index bde79c127d..490f308e20 100644 --- a/LeanPool/Clawristotle/TorusInstance.lean +++ b/LeanPool/Clawristotle/TorusInstance.lean @@ -21,7 +21,7 @@ implies harmonic, curl-div implies harmonic) and assembles the full `FlatTorus3` instance on `Fin 3 -> AddCircle 1`. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real Filter diff --git a/LeanPool/Clawristotle/TorusIntegration.lean b/LeanPool/Clawristotle/TorusIntegration.lean index d0ce7872a1..084a5238f5 100644 --- a/LeanPool/Clawristotle/TorusIntegration.lean +++ b/LeanPool/Clawristotle/TorusIntegration.lean @@ -20,7 +20,7 @@ Box integral machinery, integration by parts on T³, curl integral vanishing, and the energy method proof that harmonic functions on T³ are constant. -/ -@[expose] public section +public section open MeasureTheory Matrix Finset BigOperators Real Filter diff --git a/LeanPool/Clawristotle/VMLInputDerive.lean b/LeanPool/Clawristotle/VMLInputDerive.lean index 0ea0c9cef5..d3ec0ac3e9 100644 --- a/LeanPool/Clawristotle/VMLInputDerive.lean +++ b/LeanPool/Clawristotle/VMLInputDerive.lean @@ -25,7 +25,7 @@ then applies the abstract proof chain (Sections 2-8) to derive the main theorem `ConcreteTheorem42` with minimal physical hypotheses. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory noncomputable section diff --git a/LeanPool/Clawristotle/VMLStructures.lean b/LeanPool/Clawristotle/VMLStructures.lean index 393d6525bc..25d1965544 100644 --- a/LeanPool/Clawristotle/VMLStructures.lean +++ b/LeanPool/Clawristotle/VMLStructures.lean @@ -17,7 +17,7 @@ Defines the core data structures for the VML steady state problem: - `VMLInput`: minimal physical input for the steady state problem -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/Clawristotle/VelocityDecayInstance.lean b/LeanPool/Clawristotle/VelocityDecayInstance.lean index adb7f0b42b..3c8b2a74ba 100644 --- a/LeanPool/Clawristotle/VelocityDecayInstance.lean +++ b/LeanPool/Clawristotle/VelocityDecayInstance.lean @@ -17,7 +17,7 @@ is bounded by C * (1 + ||v||). Used by `CoulombSpatialTransport` for bounding spatial transport integrands. -/ -@[expose] public section +public section open Matrix Finset BigOperators Real MeasureTheory diff --git a/LeanPool/CommonNeighbourConjecture.lean b/LeanPool/CommonNeighbourConjecture.lean index 5f0337a203..ab5085a3ba 100644 --- a/LeanPool/CommonNeighbourConjecture.lean +++ b/LeanPool/CommonNeighbourConjecture.lean @@ -24,4 +24,4 @@ Tags: permutation-groups, group-actions, algebraic-graph-theory, saxl-graphs, co MSC: 20B15, 05C25 -/ -@[expose] public section +public section diff --git a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/AbstractSeed.lean b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/AbstractSeed.lean index e628ab3985..26aa5618ed 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/AbstractSeed.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/AbstractSeed.lean @@ -23,7 +23,7 @@ Faithfulness and irreducibility are intentionally absent from needed for the obstruction. -/ -@[expose] public section +public section namespace SaxlCounterexamples.EveryBase @@ -563,7 +563,7 @@ noncomputable def regularTupleCode (S : EveryBaseSeed) (n : Nat) : hits := regularTupleColour_hits S n /-- The canonical, genuinely inhabited positive regular-colour tower. -/ -noncomputable def quotientRegularTupleColourTower (S : EveryBaseSeed) : +@[expose] noncomputable def quotientRegularTupleColourTower (S : EveryBaseSeed) : RegularTupleColourTower S where C n := RegularTupleColour S n fintypeC n := regularTupleColourFintype S n @@ -631,7 +631,7 @@ theorem firstVectorOrbitColour_regularTupleColour exact Quotient.lift_mk _ _ _ /-- Canonical finite tuple/vector orbit colours used by the profile argument. -/ -noncomputable def quotientBaseArrayColours (S : EveryBaseSeed) (tail : Nat) : +@[expose] noncomputable def quotientBaseArrayColours (S : EveryBaseSeed) (tail : Nat) : BaseArrayColours S tail where C := RegularTupleColour S tail D := VectorOrbitColour S @@ -648,7 +648,7 @@ noncomputable def quotientBaseArrayColours (S : EveryBaseSeed) (tail : Nat) : /-- A technically convenient strengthening of `Saxl.ExactBaseSize`: smaller ordered tuples are excluded even before imposing injectivity. -/ -def ExactTupleBaseSize +@[expose] def ExactTupleBaseSize (G X : Type*) [Group G] [MulAction G X] (n : Nat) : Prop := (∃ x : Fin n → X, Saxl.IsBaseTuple G X x) ∧ ∀ m < n, ¬ ∃ x : Fin m → X, Saxl.IsBaseTuple G X x diff --git a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/DeletedModule.lean b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/DeletedModule.lean index f8d059b5b4..b4414fb78c 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/DeletedModule.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/DeletedModule.lean @@ -17,7 +17,7 @@ irreducibility proof: every endomorphism of the deleted module extends to the full permutation module, while the all-ones operator restricts to zero. -/ -@[expose] public section +public section noncomputable section @@ -50,7 +50,7 @@ instance permModSMulCommClass : SMulCommClass H F2 (PermMod Ω) where smul_comm _ _ _ := by funext x; rfl /-- Sum all coordinates of a vector in the permutation module. -/ -def coordSum : PermMod Ω →ₗ[F2] F2 where +@[expose] def coordSum : PermMod Ω →ₗ[F2] F2 where toFun f := ∑ x, f x map_add' f g := by simp only [Pi.add_apply, Finset.sum_add_distrib] map_smul' a f := by @@ -62,7 +62,7 @@ theorem coordSum_smul (g : H) (f : PermMod Ω) : exact (MulAction.toPerm g).symm.sum_comp f /-- The deleted binary permutation module, i.e. the coordinate-sum kernel. -/ -def DeletedModule (Ω : Type*) [Fintype Ω] := +@[expose] def DeletedModule (Ω : Type*) [Fintype Ω] := LinearMap.ker (coordSum (Ω := Ω)) instance deletedModuleDistribMulAction : @@ -87,7 +87,7 @@ instance deletedModuleSMulCommClass : smul_comm _ _ _ := by apply Subtype.ext; rfl /-- The inclusion of the deleted module into the full permutation module. -/ -def deletedIncl : DeletedModule Ω →ₗ[F2] PermMod Ω := +@[expose] def deletedIncl : DeletedModule Ω →ₗ[F2] PermMod Ω := (DeletedModule Ω).subtype theorem coordSum_one (hΩodd : Odd (Fintype.card Ω)) : @@ -202,11 +202,11 @@ theorem vq_card (d : Nat) (hd : Odd d) : norm_num /-- The natural representation of `Hq d` on its deleted module. -/ -def hqRepresentation (d : Nat) : Representation F2 (Hq d) (Vq d) := +@[expose] def hqRepresentation (d : Nat) : Representation F2 (Hq d) (Vq d) := Representation.ofDistribMulAction F2 (Hq d) (Vq d) /-- The characteristic vector of `{0,1}`, written as a deleted vector. -/ -noncomputable def pairVector (d : Nat) : Vq d := +@[expose] noncomputable def pairVector (d : Nat) : Vq d := ⟨Pi.basisFun F2 (Fq d) 0 + Pi.basisFun F2 (Fq d) 1, by change coordSum (Pi.basisFun F2 (Fq d) 0 + Pi.basisFun F2 (Fq d) 1) = 0 @@ -265,7 +265,7 @@ theorem hq_faithful (d : Nat) (hd : Odd d) : FaithfulSMul (Hq d) (Vq d) := by exact pairVector_isRegular d hd g (hfix (pairVector d)) /-- The complement-of-zero vector used in the displayed obstruction. -/ -noncomputable def hqBadSeedVector (d : Nat) (hd : Odd d) : Vq d := +@[expose] noncomputable def hqBadSeedVector (d : Nat) (hd : Odd d) : Vq d := ⟨(1 : PermMod (Fq d)) + Pi.basisFun F2 (Fq d) 0, by change coordSum ((1 : PermMod (Fq d)) + Pi.basisFun F2 (Fq d) 0) = 0 @@ -327,7 +327,7 @@ theorem hqBadSeedVector_not_regular exact hzero /-- The coordinate map from the deleted module to binary-valued functions. -/ -def deletedCoord (d : Nat) : Vq d →+ (Fq d → F2) := +@[expose] def deletedCoord (d : Nat) : Vq d →+ (Fq d → F2) := (Vq d).subtype.toAddHom end SaxlCounterexamples.EveryBase diff --git a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/FrobeniusGroup.lean b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/FrobeniusGroup.lean index c396e2a67c..de911ca2fb 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/FrobeniusGroup.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/FrobeniusGroup.lean @@ -25,7 +25,7 @@ the later files of the construction. Here we prove the elementary finite-field facts and the two-point support calculation needed there. -/ -@[expose] public section +public section namespace SaxlCounterexamples.EveryBase diff --git a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/GeneralConstruction.lean b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/GeneralConstruction.lean index a5ed09bc1e..be47692bb2 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/GeneralConstruction.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/GeneralConstruction.lean @@ -16,7 +16,7 @@ sumset obstruction, and the abstract exact-base-size counterexample theorem. All seed and finite-colour hypotheses are exposed by the imported structures. -/ -@[expose] public section +public section namespace SaxlCounterexamples.EveryBase diff --git a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Irreducible.lean b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Irreducible.lean index 50b811ea7a..2965522eba 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Irreducible.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Irreducible.lean @@ -20,7 +20,7 @@ adjacency operator. A two-point vector proves that neither `A` nor `I + A` is idempotent. Maschke's theorem then proves irreducibility. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Main.lean b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Main.lean index 10fa797463..b64c341f7c 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Main.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/EveryBase/Main.lean @@ -18,7 +18,7 @@ This module instantiates the abstract obstruction construction with the affine Frobenius groups and their deleted binary permutation modules. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ namespace SaxlCounterexamples.EveryBase open scoped Pointwise /-- The concrete binary seed attached to `GF(3^d)`. -/ -noncomputable def hqSeed (d : Nat) (hd : Odd d) (hd3 : 3 ≤ d) : +@[expose] noncomputable def hqSeed (d : Nat) (hd : Odd d) (hd3 : 3 ≤ d) : EveryBaseSeed where Ω := Fq d H := Hq d @@ -83,7 +83,7 @@ abbrev GBd (HqProductModule d hd hd3 tail) /-- The explicit vector outside the doubled generalized neighborhood. -/ -noncomputable def hqBadVector +@[expose] noncomputable def hqBadVector (d : Nat) (hd : Odd d) (hd3 : 3 ≤ d) (tail : Nat) : HqProductModule d hd hd3 tail := badVector (hqSeed d hd hd3) (hqColours d hd hd3 tail) diff --git a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems.lean b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems.lean index a973258910..beecacfe0b 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems.lean @@ -18,7 +18,7 @@ The complete reader-facing interface: the four non-Mathlib definitions needed to read the result, followed by one theorem. -/ -@[expose] public section +public section namespace SaxlCounterexamples.MainTheorems diff --git a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Definitions.lean b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Definitions.lean index 469df4e18f..9dbb615e76 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Definitions.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Definitions.lean @@ -14,7 +14,7 @@ public import Mathlib.Order.Lattice.Nat The complete non-Mathlib vocabulary used in the public statement. -/ -@[expose] public section +public section noncomputable section @@ -40,12 +40,12 @@ attribute [instance] FinitePermutationGroup.group namespace FinitePermutationGroup /-- A set of points is a base if only the identity fixes every point in it. -/ -def IsBase (P : FinitePermutationGroup) (B : Set P.Point) : Prop := +@[expose] def IsBase (P : FinitePermutationGroup) (B : Set P.Point) : Prop := ∀ g : P.G, (∀ x ∈ B, g • x = x) → g = 1 /-- The least size of a base. An injective map from `Fin n` represents an `n`-element base; existential quantification makes its enumeration irrelevant. -/ -noncomputable def baseSize (P : FinitePermutationGroup) : Nat := +@[expose] noncomputable def baseSize (P : FinitePermutationGroup) : Nat := sInf {n : Nat | ∃ b : Fin n → P.Point, Function.Injective b ∧ P.IsBase (Set.range b)} @@ -53,7 +53,7 @@ noncomputable def baseSize (P : FinitePermutationGroup) : Nat := adjacent exactly when they lie together in a base of minimum size. Thus this is the ordinary Saxl graph at base size two and the generalized Saxl graph at larger base sizes. -/ -noncomputable def saxlGraph (P : FinitePermutationGroup) : +@[expose] noncomputable def saxlGraph (P : FinitePermutationGroup) : SimpleGraph P.Point where Adj x y := x ≠ y ∧ ∃ b : Fin P.baseSize → P.Point, diff --git a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Internal.lean b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Internal.lean index 179a434af4..d8e16afd4c 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Internal.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/Internal.lean @@ -19,7 +19,7 @@ Construction parameters, bridge lemmas, and proof machinery used by the minimal public module `Examples.MainTheorems`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/ProofAliases.lean b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/ProofAliases.lean index fd5b2b9f63..fafcebaf90 100644 --- a/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/ProofAliases.lean +++ b/LeanPool/CommonNeighbourConjecture/Examples/MainTheorems/ProofAliases.lean @@ -23,4 +23,4 @@ The definitions and internal proof now share one API. This module remains as a compatibility import for downstream users of the original file layout. -/ -@[expose] public section +public section diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/Affine.lean b/LeanPool/CommonNeighbourConjecture/Saxl/Affine.lean index 0b082c994c..b21fcee36a 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/Affine.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/Affine.lean @@ -20,7 +20,7 @@ semidirect product of the additive translation group by a distributive action. It proves the part of paper Lemma 3.1 used by every affine construction. -/ -@[expose] public section +public section namespace Saxl @@ -29,7 +29,7 @@ open scoped Pointwise variable (H V : Type*) [Group H] [AddCommGroup V] [DistribMulAction H V] /-- A vector whose stabilizer in the linear group is trivial. -/ -def IsRegularVector (v : V) : Prop := +@[expose] def IsRegularVector (v : V) : Prop := ∀ h : H, h • v = v → h = 1 /-- The set of regular vectors for the linear action. -/ @@ -66,7 +66,7 @@ theorem threefold_add_eq_univ_of_card_compl_twofold_lt simp /-- The action of `H` on the multiplicative wrapper of the additive group `V`. -/ -def affineLinearAut : H →* MulAut (Multiplicative V) := +@[expose] def affineLinearAut : H →* MulAut (Multiplicative V) := (MulAutMultiplicative V).symm.toMonoidHom.comp (DistribMulAction.toAddAut H V) @@ -148,7 +148,7 @@ theorem affine_isBaseTuple_cons_iff {n : Nat} (x : V) (w : Fin n → V) : An element belongs when it can be completed by `tail` further vectors so that the resulting linear tuple has trivial kernel, while adjoining zero keeps the full affine tuple set-like. -/ -def generalizedAffineKernelSet (tail : Nat) : Set V := +@[expose] def generalizedAffineKernelSet (tail : Nat) : Set V := {v | ∃ z : Fin tail → V, Function.Injective (Fin.cons 0 (Fin.cons v z)) ∧ IsBaseTuple H V (Fin.cons v z)} diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/Basic.lean b/LeanPool/CommonNeighbourConjecture/Saxl/Basic.lean index 5d9e099b1c..520309cceb 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/Basic.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/Basic.lean @@ -18,35 +18,35 @@ Foundational definitions for ordered tuple bases, ordinary and generalized Saxl adjacency, exact base size, and common neighbours. -/ -@[expose] public section +public section namespace Saxl variable (G Ω : Type*) [Group G] [MulAction G Ω] /-- An ordered tuple whose pointwise stabilizer in `G` is trivial. -/ -def IsBaseTuple {n : Nat} (x : Fin n → Ω) : Prop := +@[expose] def IsBaseTuple {n : Nat} (x : Fin n → Ω) : Prop := ∀ g : G, (∀ i, g • x i = x i) → g = 1 /-- An injective ordered tuple corresponding literally to a base as a set. -/ -def IsSetBaseTuple {n : Nat} (x : Fin n → Ω) : Prop := +@[expose] def IsSetBaseTuple {n : Nat} (x : Fin n → Ω) : Prop := Function.Injective x ∧ IsBaseTuple G Ω x /-- Base-two adjacency: the displayed ordered pair has trivial stabilizer. -/ -def Adjacent (x y : Ω) : Prop := +@[expose] def Adjacent (x y : Ω) : Prop := IsBaseTuple G Ω (Fin.cons x (Fin.cons y Fin.elim0)) /-- Two vertices extend to an injective base of size `tail + 2`. -/ -def GeneralizedAdjacent (tail : Nat) (x y : Ω) : Prop := +@[expose] def GeneralizedAdjacent (tail : Nat) (x y : Ω) : Prop := ∃ z : Fin tail → Ω, IsSetBaseTuple G Ω (Fin.cons x (Fin.cons y z)) /-- Two vertices have a common neighbour for a relation `R`. -/ -def HasCommonNeighbour (R : Ω → Ω → Prop) (x y : Ω) : Prop := +@[expose] def HasCommonNeighbour (R : Ω → Ω → Prop) (x y : Ω) : Prop := ∃ z, R x z ∧ R z y /-- Exact base size `n`, stated without a global minimum operator. -/ -def ExactBaseSize (n : Nat) : Prop := +@[expose] def ExactBaseSize (n : Nat) : Prop := (∃ x : Fin n → Ω, IsSetBaseTuple G Ω x) ∧ ∀ m < n, ¬ ∃ x : Fin m → Ω, IsSetBaseTuple G Ω x diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/Generalized.lean b/LeanPool/CommonNeighbourConjecture/Saxl/Generalized.lean index f9c0521dc9..e0920988f4 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/Generalized.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/Generalized.lean @@ -19,7 +19,7 @@ irrelevant: generalized adjacency is exactly membership of two distinct vertices in a common set-like base of the required size. -/ -@[expose] public section +public section namespace Saxl diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Action.lean b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Action.lean index 0e99928d8b..9afcf2d11b 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Action.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Action.lean @@ -15,7 +15,7 @@ For `g = (f, q)` the action on `ι → Δ` is `(g • x) i = f i • x (q⁻¹ • i)`. -/ -@[expose] public section +public section namespace Saxl diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Defs.lean b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Defs.lean index 9045664421..c282ce9b5d 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Defs.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Defs.lean @@ -19,7 +19,7 @@ reindexing, so that Unlike `RegularWreathProduct`, the action of `Q` on `ι` need not be regular. -/ -@[expose] public section +public section namespace Saxl @@ -27,7 +27,7 @@ variable (X Q ι : Type*) [Group X] [Group Q] [MulAction Q ι] /-- The action of `Q` on the base group `ι → X` by contravariant reindexing. -/ -def reindexAut : Q →* MulAut (ι → X) where +@[expose] def reindexAut : Q →* MulAut (ι → X) where toFun q := MulEquiv.arrowCongr (MulAction.toPerm q) (MulEquiv.refl X) map_one' := by ext f i @@ -38,7 +38,7 @@ def reindexAut : Q →* MulAut (ι → X) where @[simp] theorem reindexAut_apply (q : Q) (f : ι → X) (i : ι) : - reindexAut X Q ι q f i = f (q⁻¹ • i) := rfl + reindexAut X Q ι q f i = f (q⁻¹ • i) := by rfl /-- The permutation wreath product `X wr_ι Q`, with base group `ι → X` and the specified action of `Q` on `ι`. -/ @@ -57,16 +57,16 @@ def top : Q →* PermWreath X Q ι := SemidirectProduct.inr @[simp] -theorem base_left (f : ι → X) : (base X Q ι f).left = f := rfl +theorem base_left (f : ι → X) : (base X Q ι f).left = f := by rfl @[simp] -theorem base_right (f : ι → X) : (base X Q ι f).right = 1 := rfl +theorem base_right (f : ι → X) : (base X Q ι f).right = 1 := by rfl @[simp] -theorem top_left (q : Q) : (top X Q ι q).left = 1 := rfl +theorem top_left (q : Q) : (top X Q ι q).left = 1 := by rfl @[simp] -theorem top_right (q : Q) : (top X Q ι q).right = q := rfl +theorem top_right (q : Q) : (top X Q ι q).right = q := by rfl /-- Extensionality in the base and top coordinates. -/ theorem ext {g h : PermWreath X Q ι} (hbase : g.left = h.left) diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Irreducible.lean b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Irreducible.lean index e97e2fd423..fe355522e2 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Irreducible.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Irreducible.lean @@ -28,7 +28,7 @@ to every coordinate, and the finite sum of coordinate vectors fills the whole product module. -/ -@[expose] public section +public section namespace Saxl diff --git a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Symmetric.lean b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Symmetric.lean index c944ff05d3..6992156903 100644 --- a/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Symmetric.lean +++ b/LeanPool/CommonNeighbourConjecture/Saxl/PermWreath/Symmetric.lean @@ -16,12 +16,12 @@ Only the distinguishing-word facts used by the every-base construction are included here. -/ -@[expose] public section +public section namespace Saxl /-- A colour word has trivial stabilizer under contravariant reindexing. -/ -def WordDistinguishing (Q : Type*) {ι C : Type*} [Group Q] [MulAction Q ι] +@[expose] def WordDistinguishing (Q : Type*) {ι C : Type*} [Group Q] [MulAction Q ι] (word : ι → C) : Prop := ∀ q : Q, (∀ i, word (q⁻¹ • i) = word i) → q = 1 diff --git a/LeanPool/CompactSpectral.lean b/LeanPool/CompactSpectral.lean index cba36e8ea1..706cf75b09 100644 --- a/LeanPool/CompactSpectral.lean +++ b/LeanPool/CompactSpectral.lean @@ -26,7 +26,7 @@ Tags: spectral-theory, functional-analysis, compact-operators MSC: 47A75, 47B07 -/ -@[expose] public section +public section /-! # Compact self-adjoint spectral theory diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactOperatorOrthonormal.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactOperatorOrthonormal.lean index 10e7bc8525..3749a2c558 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactOperatorOrthonormal.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactOperatorOrthonormal.lean @@ -27,7 +27,7 @@ operators such as Laplace–Beltrami). - `CompactSpectral.tendsto_norm_apply_of_isCompactOperator_of_orthonormal` -/ -@[expose] public section +public section namespace CompactSpectral diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint.lean index 6697d2a8e3..5231602991 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint.lean @@ -19,4 +19,4 @@ import Mathlib.Tactic.Positivity.Finset This module bundles the spectral theory of compact self-adjoint operators. -/ -@[expose] public section +public section diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Approximation.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Approximation.lean index b8c374f479..382cf69e24 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Approximation.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Approximation.lean @@ -21,7 +21,7 @@ For a compact self-adjoint operator `T` and `ε > 0`, the “large-eigenvalue” * `‖T - T ∘ largeEigenspaceProjector T ε‖ ≤ ε`. -/ -@[expose] public section +public section namespace CompactSelfAdjoint diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Basic.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Basic.lean index d0b58d2f86..040423e442 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Basic.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/Basic.lean @@ -32,7 +32,7 @@ agrees with the naive restriction and eigenvectors lift back to eigenvectors of - `CompactSelfAdjoint.invariant_orthogonalComplement_eigenspace_of_isSelfAdjoint` -/ -@[expose] public section +public section namespace CompactSelfAdjoint diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/CutoffProjector.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/CutoffProjector.lean index 277cf5a2e9..28bd5d4d85 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/CutoffProjector.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/CutoffProjector.lean @@ -33,7 +33,7 @@ enable spectral iteration by compressing to invariant orthogonal complements. - `CompactSelfAdjoint.largeEigenspaceProjector_comp` -/ -@[expose] public section +public section namespace CompactSelfAdjoint @@ -46,7 +46,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [Complete /-! ### Large-eigenspace cutoff subspace and projector -/ /-- The spectral cutoff subspace spanned by all eigenspaces with `‖μ‖ ≥ ε`. -/ -noncomputable def largeEigenspace (T : E →L[𝕜] E) (ε : ℝ) : Submodule 𝕜 E := +@[expose] noncomputable def largeEigenspace (T : E →L[𝕜] E) (ε : ℝ) : Submodule 𝕜 E := let t : Module.End 𝕜 E := (T : E →ₗ[𝕜] E) (⨆ i : {μ : 𝕜 // ε ≤ ‖μ‖ ∧ t.HasEigenvalue μ}, t.eigenspace i.1) @@ -60,6 +60,7 @@ lemma finiteDimensional_largeEigenspace_of_isCompactOperator_of_isSelfAdjoint -- Reuse `finiteDimensional_iSup_eigenspace_norm_ge`. exact finiteDimensional_iSup_eigenspace_norm_ge (𝕜 := 𝕜) (E := E) T hT hTc hε /-- The orthogonal projector onto the `largeEigenspace` cutoff subspace. -/ +@[expose] noncomputable def largeEigenspaceProjector (T : E →L[𝕜] E) (hT : IsSelfAdjoint T) (hTc : IsCompactOperator (T : E → E)) {ε : ℝ} (hε : 0 < ε) : E →L[𝕜] E := by diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/OpNormEigenvalue.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/OpNormEigenvalue.lean index 165b11cf28..0c0d2f37fc 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/OpNormEigenvalue.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/OpNormEigenvalue.lean @@ -22,7 +22,7 @@ This file provides two Hilbert-space facts about compact operators: These are used downstream to turn “no eigenvalues above `ε`” into an operator-norm estimate. -/ -@[expose] public section +public section namespace CompactSelfAdjoint diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralFiniteness.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralFiniteness.lean index b8d5822935..13b8538fb5 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralFiniteness.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralFiniteness.lean @@ -32,7 +32,7 @@ These are standard ingredients for spectral-iteration proofs and compact-resolve - `CompactSelfAdjoint.tendsto_norm_of_injective_hasEigenvalue_of_isCompactOperator_of_isSelfAdjoint` -/ -@[expose] public section +public section namespace CompactSelfAdjoint diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralTheorem.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralTheorem.lean index 3e1ad88ea1..4abe6fe182 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralTheorem.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/CompactSelfAdjoint/SpectralTheorem.lean @@ -26,7 +26,7 @@ Hilbert space. a compact self-adjoint operator admits a `HilbertBasis` consisting of eigenvectors. -/ -@[expose] public section +public section namespace CompactSelfAdjoint diff --git a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/RayleighCompact.lean b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/RayleighCompact.lean index 07f56f370f..f304ae665c 100644 --- a/LeanPool/CompactSpectral/Analysis/InnerProductSpace/RayleighCompact.lean +++ b/LeanPool/CompactSpectral/Analysis/InnerProductSpace/RayleighCompact.lean @@ -31,7 +31,7 @@ compact operator the quadratic form is continuous on that weakly compact set. - `CompactSelfAdjoint.exists_hasEigenvector_iSup_or_iInf_of_isCompactOperator` -/ -@[expose] public section +public section namespace CompactSelfAdjoint open CompactSpectral diff --git a/LeanPool/CompactSpectral/Topology/WeakHilbertCompact.lean b/LeanPool/CompactSpectral/Topology/WeakHilbertCompact.lean index a4b46425ae..0eb983c0be 100644 --- a/LeanPool/CompactSpectral/Topology/WeakHilbertCompact.lean +++ b/LeanPool/CompactSpectral/Topology/WeakHilbertCompact.lean @@ -24,7 +24,7 @@ This lemma is a key building block for developing compact/self-adjoint spectral Hilbert setting while keeping `packages/mathlib_extensions/` mathlib-only. -/ -@[expose] public section +public section namespace CompactSpectral @@ -42,7 +42,7 @@ noncomputable scoped instance instNormWeakSpace : /-- The Riesz map `E → E*` viewed as a function from the weak topology on `E` (`WeakSpace 𝕜 E`) to the weak-star topology on the dual (`WeakDual 𝕜 E`). -/ -noncomputable def weakToWeakDual : WeakSpace 𝕜 E → WeakDual 𝕜 E := +@[expose] noncomputable def weakToWeakDual : WeakSpace 𝕜 E → WeakDual 𝕜 E := fun x => StrongDual.toWeakDual ((InnerProductSpace.toDual 𝕜 E) (x : E)) /-- The inverse Riesz map `E* → E` viewed as a function from the weak-star dual (`WeakDual 𝕜 E`) @@ -139,7 +139,7 @@ lemma continuous_weakDualToWeak : Continuous (weakDualToWeak (𝕜 := 𝕜) (E : /-! ### Closed balls -/ /-- The norm-closed ball, viewed as a subset of `WeakSpace 𝕜 E`. -/ -noncomputable def weakClosedBall (r : ℝ) : Set (WeakSpace 𝕜 E) := +@[expose] noncomputable def weakClosedBall (r : ℝ) : Set (WeakSpace 𝕜 E) := Metric.closedBall (α := E) (0 : E) r /-- The (weak-*) closed ball in the dual, as a subset of `WeakDual 𝕜 E`. -/ diff --git a/LeanPool/CompactnessAndDegeneracy.lean b/LeanPool/CompactnessAndDegeneracy.lean index 7d6504370d..bc79e1642c 100644 --- a/LeanPool/CompactnessAndDegeneracy.lean +++ b/LeanPool/CompactnessAndDegeneracy.lean @@ -19,7 +19,7 @@ Tags: extremal-combinatorics, extremal-graph-theory, degenerate-graphs, countere MSC: 05C35, 05C75 -/ -@[expose] public section +public section /-! # Counterexamples in extremal graph theory diff --git a/LeanPool/CompositionAlgebras.lean b/LeanPool/CompositionAlgebras.lean index d9d4a47887..13eda43605 100644 --- a/LeanPool/CompositionAlgebras.lean +++ b/LeanPool/CompositionAlgebras.lean @@ -34,7 +34,7 @@ Tags: nonassociative-algebra, composition-algebras, octonions, hurwitz-theorem, MSC: 17A75, 17A35, 11E88 -/ -@[expose] public section +public section /-! # Euclidean composition algebras over `ℝ` diff --git a/LeanPool/CompositionAlgebras/Composition/CayleyDickson.lean b/LeanPool/CompositionAlgebras/Composition/CayleyDickson.lean index 8832729728..46a646a03e 100644 --- a/LeanPool/CompositionAlgebras/Composition/CayleyDickson.lean +++ b/LeanPool/CompositionAlgebras/Composition/CayleyDickson.lean @@ -64,7 +64,7 @@ Substrate for the classification. The headline declaration is the instance `Composition/Classification.lean`. -/ -@[expose] public section +public section namespace CompositionAlgebra @@ -75,7 +75,7 @@ universe u Kept as a type synonym rather than a structure so that the additive and `ℝ`-module structure transfer from `Prod` verbatim; the product and the unit are the only new data. -/ -def CD (D : Type u) : Type u := D × D +@[expose] def CD (D : Type u) : Type u := D × D namespace CD @@ -86,75 +86,75 @@ instance instAddCommGroup : AddCommGroup (CD D) := inferInstanceAs (AddCommGroup instance instModule : Module ℝ (CD D) := inferInstanceAs (Module ℝ (D × D)) /-- Assemble an element of the double from its two components. -/ -def mk (a b : D) : CD D := (a, b) +@[expose] def mk (a b : D) : CD D := (a, b) /-- The first component of an element of the double. -/ -def fst (x : CD D) : D := Prod.fst (α := D) (β := D) x +@[expose] def fst (x : CD D) : D := Prod.fst (α := D) (β := D) x /-- The second component of an element of the double. -/ -def snd (x : CD D) : D := Prod.snd (α := D) (β := D) x +@[expose] def snd (x : CD D) : D := Prod.snd (α := D) (β := D) x omit [NonAssocRing D] [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem fst_mk (a b : D) : (mk a b).fst = a := rfl +@[simp] theorem fst_mk (a b : D) : (mk a b).fst = a := by rfl omit [NonAssocRing D] [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem snd_mk (a b : D) : (mk a b).snd = b := rfl +@[simp] theorem snd_mk (a b : D) : (mk a b).snd = b := by rfl omit [NonAssocRing D] [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in @[ext] theorem ext {x y : CD D} (h1 : x.fst = y.fst) (h2 : x.snd = y.snd) : x = y := Prod.ext (α := D) (β := D) h1 h2 omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem fst_zero : (0 : CD D).fst = 0 := rfl +@[simp] theorem fst_zero : (0 : CD D).fst = 0 := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem snd_zero : (0 : CD D).snd = 0 := rfl +@[simp] theorem snd_zero : (0 : CD D).snd = 0 := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem fst_add (x y : CD D) : (x + y).fst = x.fst + y.fst := rfl +@[simp] theorem fst_add (x y : CD D) : (x + y).fst = x.fst + y.fst := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem snd_add (x y : CD D) : (x + y).snd = x.snd + y.snd := rfl +@[simp] theorem snd_add (x y : CD D) : (x + y).snd = x.snd + y.snd := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem fst_neg (x : CD D) : (-x).fst = -x.fst := rfl +@[simp] theorem fst_neg (x : CD D) : (-x).fst = -x.fst := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem snd_neg (x : CD D) : (-x).snd = -x.snd := rfl +@[simp] theorem snd_neg (x : CD D) : (-x).snd = -x.snd := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem fst_sub (x y : CD D) : (x - y).fst = x.fst - y.fst := rfl +@[simp] theorem fst_sub (x y : CD D) : (x - y).fst = x.fst - y.fst := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem snd_sub (x y : CD D) : (x - y).snd = x.snd - y.snd := rfl +@[simp] theorem snd_sub (x y : CD D) : (x - y).snd = x.snd - y.snd := by rfl omit [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem fst_smul (r : ℝ) (x : CD D) : (r • x).fst = r • x.fst := rfl +@[simp] theorem fst_smul (r : ℝ) (x : CD D) : (r • x).fst = r • x.fst := by rfl omit [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] in -@[simp] theorem snd_smul (r : ℝ) (x : CD D) : (r • x).snd = r • x.snd := rfl +@[simp] theorem snd_smul (r : ℝ) (x : CD D) : (r • x).snd = r • x.snd := by rfl variable [CompositionAlgebra D] instance instOne : One (CD D) := ⟨mk 1 0⟩ omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] [CompositionAlgebra D] in -@[simp] theorem fst_one : (1 : CD D).fst = 1 := rfl +@[simp] theorem fst_one : (1 : CD D).fst = 1 := by rfl omit [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommClass ℝ D D] [CompositionAlgebra D] in -@[simp] theorem snd_one : (1 : CD D).snd = 0 := rfl +@[simp] theorem snd_one : (1 : CD D).snd = 0 := by rfl instance instMul : Mul (CD D) := ⟨fun x y => mk (x.fst * y.fst - cstar y.snd * x.snd) (y.snd * x.fst + x.snd * cstar y.fst)⟩ @[simp] theorem fst_mul (x y : CD D) : - (x * y).fst = x.fst * y.fst - cstar y.snd * x.snd := rfl + (x * y).fst = x.fst * y.fst - cstar y.snd * x.snd := by rfl @[simp] theorem snd_mul (x y : CD D) : - (x * y).snd = y.snd * x.fst + x.snd * cstar y.fst := rfl + (x * y).snd = y.snd * x.fst + x.snd * cstar y.fst := by rfl theorem mul_def (a b c d : D) : - mk a b * mk c d = mk (a * c - cstar d * b) (d * a + b * cstar c) := rfl + mk a b * mk c d = mk (a * c - cstar d * b) (d * a + b * cstar c) := by rfl /-! ### The ring structure -/ @@ -197,7 +197,7 @@ def bilin : CD D →ₗ[ℝ] CD D →ₗ[ℝ] ℝ := (by intro c x y; simp; ring) @[simp] theorem bilin_apply (x y : CD D) : - bilin x y = ip x.fst y.fst + ip x.snd y.snd := rfl + bilin x y = ip x.fst y.fst + ip x.snd y.snd := by rfl /-! ### The composition law @@ -247,9 +247,9 @@ variable {D : Type u} [Ring D] [Module ℝ D] [IsScalarTower ℝ D D] [SMulCommC instance CD.instCompositionAlgebra : CompositionAlgebra (CD D) := CD.compositionAlgebraOfAssoc (fun p q r => mul_assoc p q r) -@[simp] theorem CD.nf_eq (x : CD D) : nf x = nf x.fst + nf x.snd := rfl +@[simp] theorem CD.nf_eq (x : CD D) : nf x = nf x.fst + nf x.snd := by rfl -@[simp] theorem CD.ip_eq (x y : CD D) : ip x y = ip x.fst y.fst + ip x.snd y.snd := rfl +@[simp] theorem CD.ip_eq (x y : CD D) : ip x y = ip x.fst y.fst + ip x.snd y.snd := by rfl /-- The conjugation of the double negates the second component. -/ theorem CD.cstar_eq (x : CD D) : cstar x = CD.mk (cstar x.fst) (-x.snd) := by diff --git a/LeanPool/CompositionAlgebras/Composition/Classification.lean b/LeanPool/CompositionAlgebras/Composition/Classification.lean index f1d2614a49..6e8da7303c 100644 --- a/LeanPool/CompositionAlgebras/Composition/Classification.lean +++ b/LeanPool/CompositionAlgebras/Composition/Classification.lean @@ -58,7 +58,7 @@ proof is what makes that true, and it is not repeated. This file carries `hurwitz_classification`, the headline theorem of the development. -/ -@[expose] public section +public section open scoped Quaternion @@ -158,7 +158,7 @@ def congr (e : E ≃ₗ[ℝ] D) (he : IsCompIso e) (f : CompEmb D C) : CompEmb E omit [Nontrivial C] in @[simp] theorem congr_apply (e : E ≃ₗ[ℝ] D) (he : IsCompIso e) (f : CompEmb D C) (x : E) : - (f.congr e he).toLinearMap x = f.toLinearMap (e x) := rfl + (f.congr e he).toLinearMap x = f.toLinearMap (e x) := by rfl omit [Nontrivial C] in /-- Renaming the source does not move the range. -/ @@ -180,7 +180,7 @@ noncomputable def toEquiv (f : CompEmb D C) (h : LinearMap.range f.toLinearMap = omit [Nontrivial C] in @[simp] theorem toEquiv_apply (f : CompEmb D C) (h : LinearMap.range f.toLinearMap = ⊤) (x : D) : - f.toEquiv h x = f.toLinearMap x := rfl + f.toEquiv h x = f.toLinearMap x := by rfl omit [Nontrivial C] in theorem toEquiv_isCompIso (f : CompEmb D C) (h : LinearMap.range f.toLinearMap = ⊤) : @@ -253,7 +253,7 @@ def doubleMap : CD D →ₗ[ℝ] C where omit [Nontrivial C] in @[simp] theorem doubleMap_apply (x : CD D) : - f.doubleMap (u := u) x = f.toLinearMap x.fst + (f.toLinearMap x.snd) * u := rfl + f.doubleMap (u := u) x = f.toLinearMap x.fst + (f.toLinearMap x.snd) * u := by rfl include hu hnu @@ -281,7 +281,7 @@ def double : CompEmb (CD D) C where rw [hA.nf_add_mul_unit hu hnu ⟨x.fst, rfl⟩ ⟨x.snd, rfl⟩, f.map_nf, f.map_nf, CD.nf_eq] @[simp] theorem double_apply (x : CD D) : - (f.double hu hnu).toLinearMap x = f.toLinearMap x.fst + (f.toLinearMap x.snd) * u := rfl + (f.double hu hnu).toLinearMap x = f.toLinearMap x.fst + (f.toLinearMap x.snd) * u := by rfl /-- The transported embedding lands exactly on the internal double of the range. -/ theorem range_double : @@ -315,7 +315,7 @@ def realCompEmb : CompEmb ℝ C where ring @[simp] theorem realCompEmb_apply (x : ℝ) : - (realCompEmb (C := C)).toLinearMap x = x • (1 : C) := rfl + (realCompEmb (C := C)).toLinearMap x = x • (1 : C) := by rfl /-- The range of the base embedding is the line through the unit, the `A₀` of the dimension proof. -/ diff --git a/LeanPool/CompositionAlgebras/Composition/Defs.lean b/LeanPool/CompositionAlgebras/Composition/Defs.lean index 59a21274f4..51bd8ee58d 100644 --- a/LeanPool/CompositionAlgebras/Composition/Defs.lean +++ b/LeanPool/CompositionAlgebras/Composition/Defs.lean @@ -64,7 +64,7 @@ Everything below is derived from the four class fields alone. Substrate for the two Hurwitz theorems. It states neither of them. -/ -@[expose] public section +public section universe u @@ -88,12 +88,12 @@ variable {C : Type u} [NonAssocRing C] [Module ℝ C] [IsScalarTower ℝ C C] [SMulCommClass ℝ C C] [CompositionAlgebra C] /-- The inner product `⟪x, y⟫` of a composition algebra. -/ -def ip (x y : C) : ℝ := B x y +@[expose] def ip (x y : C) : ℝ := B x y /-- The norm form `N x = ⟪x, x⟫`. Positive definite, and multiplicative by `comp`. -/ -def nf (x : C) : ℝ := B x x +@[expose] def nf (x : C) : ℝ := B x x -theorem nf_eq_ip (x : C) : nf x = ip x x := rfl +theorem nf_eq_ip (x : C) : nf x = ip x x := by rfl theorem ip_symm (x y : C) : ip x y = ip y x := B_symm x y @@ -182,7 +182,7 @@ theorem ip_exchange (x y w z : C) : /-- The conjugation `x* = 2⟪x, 1⟫ • 1 - x`, i.e. reflection in the line `ℝ ∙ 1`. -/ def cstar (x : C) : C := (2 * ip x 1) • (1 : C) - x -theorem cstar_apply (x : C) : cstar x = (2 * ip x 1) • (1 : C) - x := rfl +theorem cstar_apply (x : C) : cstar x = (2 * ip x 1) • (1 : C) - x := by rfl theorem cstar_add (x y : C) : cstar (x + y) = cstar x + cstar y := by simp only [cstar_apply, ip_add_left] @@ -337,7 +337,7 @@ theorem right_alternative (x y : C) : (y * x) * x = y * (x * x) := by /-! ### Imaginary elements -/ /-- `x` is **imaginary** (pure) when it is orthogonal to the unit. -/ -def IsPure (x : C) : Prop := ip x 1 = 0 +@[expose] def IsPure (x : C) : Prop := ip x 1 = 0 theorem cstar_of_pure {x : C} (hx : IsPure x) : cstar x = -x := by simp only [cstar_apply, IsPure] at * diff --git a/LeanPool/CompositionAlgebras/Composition/Doubling.lean b/LeanPool/CompositionAlgebras/Composition/Doubling.lean index 2a2576a018..62d9d847d7 100644 --- a/LeanPool/CompositionAlgebras/Composition/Doubling.lean +++ b/LeanPool/CompositionAlgebras/Composition/Doubling.lean @@ -62,7 +62,7 @@ The named results are the four listed above plus their inputs: `cstar_mul_mul` Substrate for the two Hurwitz theorems. It states neither of them. -/ -@[expose] public section +public section namespace CompositionAlgebra diff --git a/LeanPool/CompositionAlgebras/Composition/Hurwitz.lean b/LeanPool/CompositionAlgebras/Composition/Hurwitz.lean index 528912d606..fc9df0f414 100644 --- a/LeanPool/CompositionAlgebras/Composition/Hurwitz.lean +++ b/LeanPool/CompositionAlgebras/Composition/Hurwitz.lean @@ -76,7 +76,7 @@ This file carries `finrank_eq_one_or_two_or_four_or_eight`, Hurwitz's theorem in dimension form. -/ -@[expose] public section +public section namespace CompositionAlgebra @@ -95,7 +95,7 @@ def mulRightL (u : C) : C →ₗ[ℝ] C where map_smul' r x := smul_mul_assoc r x u omit [SMulCommClass ℝ C C] [CompositionAlgebra C] [Nontrivial C] in -@[simp] theorem mulRightL_apply (u x : C) : mulRightL u x = x * u := rfl +@[simp] theorem mulRightL_apply (u x : C) : mulRightL u x = x * u := by rfl omit [Nontrivial C] in /-- Right multiplication by a unit vector is injective: it is a linear isometry of the norm diff --git a/LeanPool/CompositionAlgebras/Composition/Instances.lean b/LeanPool/CompositionAlgebras/Composition/Instances.lean index 3f28550b26..487fd549a2 100644 --- a/LeanPool/CompositionAlgebras/Composition/Instances.lean +++ b/LeanPool/CompositionAlgebras/Composition/Instances.lean @@ -57,7 +57,7 @@ They are assembled here from the distributivity and unit lemmas already proved t Substrate, and the non-vacuity witness for `Composition/Defs.lean`'s class. -/ -@[expose] public section +public section noncomputable section @@ -73,7 +73,7 @@ instance Real.instCompositionAlgebra : CompositionAlgebra ℝ where B_pos x hx := by simp only [LinearMap.mul_apply']; exact mul_self_pos.mpr hx B_comp x y := by simp only [LinearMap.mul_apply']; ring -theorem Real.nf_eq (x : ℝ) : nf x = x * x := rfl +theorem Real.nf_eq (x : ℝ) : nf x = x * x := by rfl /-! ## `ℂ` -/ @@ -88,7 +88,7 @@ def Complex.ipBilin : ℂ →ₗ[ℝ] ℂ →ₗ[ℝ] ℝ := Complex.ofReal_re, Complex.ofReal_im, smul_eq_mul]; ring) @[simp] theorem Complex.ipBilin_apply (x y : ℂ) : - Complex.ipBilin x y = x.re * y.re + x.im * y.im := rfl + Complex.ipBilin x y = x.re * y.re + x.im * y.im := by rfl /-- `ℂ` is a Euclidean composition algebra with `N z = |z|²`. The composition law is the two-square identity. -/ @@ -101,7 +101,7 @@ instance Complex.instCompositionAlgebra : CompositionAlgebra ℂ where B_comp x y := by simp only [Complex.ipBilin_apply, Complex.mul_re, Complex.mul_im]; ring -theorem Complex.nf_eq (z : ℂ) : nf z = z.re * z.re + z.im * z.im := rfl +theorem Complex.nf_eq (z : ℂ) : nf z = z.re * z.re + z.im * z.im := by rfl /-! ## `ℍ` -/ @@ -137,7 +137,7 @@ def Quaternion.ipBilin : ℍ[ℝ] →ₗ[ℝ] ℍ[ℝ] →ₗ[ℝ] ℝ := Quaternion.imK_smul, smul_eq_mul]; ring) @[simp] theorem Quaternion.ipBilin_apply (x y : ℍ[ℝ]) : - Quaternion.ipBilin x y = x.re * y.re + x.imI * y.imI + x.imJ * y.imJ + x.imK * y.imK := rfl + Quaternion.ipBilin x y = x.re * y.re + x.imI * y.imI + x.imJ * y.imJ + x.imK * y.imK := by rfl theorem Quaternion.ipBilin_self (x : ℍ[ℝ]) : Quaternion.ipBilin x x = Quaternion.normSq x := by rw [Quaternion.normSq_def'] @@ -195,7 +195,7 @@ def ipBilin : Octonion →ₗ[ℝ] Octonion →ₗ[ℝ] ℝ := (by intro x y z; exact Octonion.octIp_add_right x y z) (by intro c x y; simp [Octonion.octIp_smul_right]) -@[simp] theorem ipBilin_apply (x y : Octonion) : ipBilin x y = Octonion.octIp x y := rfl +@[simp] theorem ipBilin_apply (x y : Octonion) : ipBilin x y = Octonion.octIp x y := by rfl theorem octIp_self_eq_norm_sq (x : Octonion) : Octonion.octIp x x = Octonion.normSq x := by simp only [Octonion.octIp, Octonion.normSq, sq] @@ -206,7 +206,7 @@ with no reference to composition algebras — after `octIp_self_eq_norm_sq` matc form against `normSq`. -/ instance instCompositionAlgebra : CompositionAlgebra Octonion where B := ipBilin - B_symm x y := Octonion.octIp_comm x y + B_symm x y := by simpa only [ipBilin_apply] using Octonion.octIp_comm x y B_pos x hx := by simp only [ipBilin_apply] refine lt_of_le_of_ne (Octonion.octIp_self_nonneg x) (fun h => hx ?_) diff --git a/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean b/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean index 492e473817..a8d6495968 100644 --- a/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean +++ b/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean @@ -69,7 +69,7 @@ Substrate for the classification: it supplies the three base identifications the doubling chain is renamed along. -/ -@[expose] public section +public section open CompositionAlgebra open scoped Quaternion @@ -107,7 +107,10 @@ end CompositionAlgebra rw [cstar_apply, h]; simp; ring @[simp] theorem Complex.cstar_eq (z : ℂ) : cstar z = ⟨z.re, -z.im⟩ := by - have h : ip z (1 : ℂ) = z.re := by change z.re * 1 + z.im * 0 = z.re; ring + have h : ip z (1 : ℂ) = z.re := by + change Complex.ipBilin z 1 = z.re + simp only [Complex.ipBilin_apply, Complex.one_re, Complex.one_im, mul_one, mul_zero, + add_zero] rw [cstar_apply, h] apply Complex.ext <;> simp ring @@ -115,8 +118,9 @@ end CompositionAlgebra theorem Quaternion.cstar_eq (q : ℍ[ℝ]) : cstar q = ⟨q.re, -q.imI, -q.imJ, -q.imK⟩ := by have h : ip q (1 : ℍ[ℝ]) = q.re := by - change q.re * 1 + q.imI * 0 + q.imJ * 0 + q.imK * 0 = q.re - ring + change Quaternion.ipBilin q 1 = q.re + simp only [Quaternion.ipBilin_apply, Quaternion.re_one, Quaternion.imI_one, + Quaternion.imJ_one, Quaternion.imK_one, mul_one, mul_zero, add_zero] rw [cstar_apply, h] ext <;> simp ring @@ -158,13 +162,16 @@ coordinates. -/ missing companions. -/ theorem Quaternion.nf_eq (q : ℍ[ℝ]) : - nf q = q.re * q.re + q.imI * q.imI + q.imJ * q.imJ + q.imK * q.imK := rfl + nf q = q.re * q.re + q.imI * q.imI + q.imJ * q.imJ + q.imK * q.imK := by + change Quaternion.ipBilin q q = _ + exact Quaternion.ipBilin_apply q q theorem Octonion.nf_eq (o : Octonion) : nf o = o.coords 0 * o.coords 0 + o.coords 1 * o.coords 1 + o.coords 2 * o.coords 2 + o.coords 3 * o.coords 3 + o.coords 4 * o.coords 4 + o.coords 5 * o.coords 5 + o.coords 6 * o.coords 6 + o.coords 7 * o.coords 7 := by - change Octonion.octIp o o = _ + change Octonion.ipBilin o o = _ + rw [Octonion.ipBilin_apply] simp [Octonion.octIp, Fin.sum_univ_eight] namespace CompositionAlgebra @@ -180,14 +187,16 @@ def cdRealEquiv : CD ℝ ≃ₗ[ℝ] ℂ where left_inv x := by apply CD.ext <;> rfl right_inv z := by apply Complex.ext <;> rfl -@[simp] theorem cdRealEquiv_re (x : CD ℝ) : (cdRealEquiv x).re = x.fst := rfl -@[simp] theorem cdRealEquiv_im (x : CD ℝ) : (cdRealEquiv x).im = x.snd := rfl +@[simp] theorem cdRealEquiv_re (x : CD ℝ) : (cdRealEquiv x).re = x.fst := by rfl +@[simp] theorem cdRealEquiv_im (x : CD ℝ) : (cdRealEquiv x).im = x.snd := by rfl theorem cdRealEquiv_isCompIso : IsCompIso cdRealEquiv where map_one := by apply Complex.ext <;> simp map_mul x y := by apply Complex.ext <;> simp [Complex.mul_re, Complex.mul_im] <;> ring - map_nf x := rfl + map_nf x := by + rw [Complex.nf_eq, CD.nf_eq, Real.nf_eq, Real.nf_eq, + cdRealEquiv_re, cdRealEquiv_im] /-! ### `CD ℂ ≃ ℍ` -/ @@ -206,10 +215,10 @@ def cdComplexEquiv : CD ℂ ≃ₗ[ℝ] ℍ[ℝ] where left_inv x := by apply CD.ext <;> apply Complex.ext <;> rfl right_inv q := by ext <;> rfl -@[simp] theorem cdComplexEquiv_re (x : CD ℂ) : (cdComplexEquiv x).re = x.fst.re := rfl -@[simp] theorem cdComplexEquiv_imI (x : CD ℂ) : (cdComplexEquiv x).imI = x.fst.im := rfl -@[simp] theorem cdComplexEquiv_imJ (x : CD ℂ) : (cdComplexEquiv x).imJ = x.snd.re := rfl -@[simp] theorem cdComplexEquiv_imK (x : CD ℂ) : (cdComplexEquiv x).imK = x.snd.im := rfl +@[simp] theorem cdComplexEquiv_re (x : CD ℂ) : (cdComplexEquiv x).re = x.fst.re := by rfl +@[simp] theorem cdComplexEquiv_imI (x : CD ℂ) : (cdComplexEquiv x).imI = x.fst.im := by rfl +@[simp] theorem cdComplexEquiv_imJ (x : CD ℂ) : (cdComplexEquiv x).imJ = x.snd.re := by rfl +@[simp] theorem cdComplexEquiv_imK (x : CD ℂ) : (cdComplexEquiv x).imK = x.snd.im := by rfl theorem cdComplexEquiv_isCompIso : IsCompIso cdComplexEquiv where map_one := by ext <;> simp @@ -241,7 +250,7 @@ def cdQuaternionEquiv : CD ℍ[ℝ] ≃ₗ[ℝ] Octonion where @[simp] theorem cdQuaternionEquiv_coords (x : CD ℍ[ℝ]) : (cdQuaternionEquiv x).coords = ![x.fst.re, x.fst.imI, x.fst.imJ, x.snd.re, - x.fst.imK, x.snd.imJ, -x.snd.imK, x.snd.imI] := rfl + x.fst.imK, x.snd.imJ, -x.snd.imK, x.snd.imI] := by rfl theorem cdQuaternionEquiv_isCompIso : IsCompIso cdQuaternionEquiv where map_one := by ext i; fin_cases i <;> simp [Octonion.one_def, Octonion.one] diff --git a/LeanPool/CompositionAlgebras/OctonionModule.lean b/LeanPool/CompositionAlgebras/OctonionModule.lean index 2dec769133..cc5a3c61d9 100644 --- a/LeanPool/CompositionAlgebras/OctonionModule.lean +++ b/LeanPool/CompositionAlgebras/OctonionModule.lean @@ -39,7 +39,7 @@ is no `Module ℝ Octonion` for `CompositionAlgebra Octonion` to be stated over. * `Octonion.finrank_eq_eight` -- `finrank ℝ 𝕆 = 8` -/ -@[expose] public section +public section noncomputable section @@ -92,7 +92,7 @@ with the trace form `re (x * conj y)` of `OctonionTrace.lean`, which is how the there reach the trace form on hermitian octonionic matrices. -/ /-- The Euclidean inner product on the octonions. -/ -def octIp (x y : Octonion) : ℝ := ∑ i, x.coords i * y.coords i +@[expose] def octIp (x y : Octonion) : ℝ := ∑ i, x.coords i * y.coords i theorem octIp_comm (x y : Octonion) : octIp x y = octIp y x := by simp only [octIp]; exact Finset.sum_congr rfl fun i _ => mul_comm _ _ diff --git a/LeanPool/CompositionAlgebras/OctonionNucleus.lean b/LeanPool/CompositionAlgebras/OctonionNucleus.lean index f456c21b26..78171063a3 100644 --- a/LeanPool/CompositionAlgebras/OctonionNucleus.lean +++ b/LeanPool/CompositionAlgebras/OctonionNucleus.lean @@ -36,7 +36,7 @@ relation `c.coords m = -c.coords m`. Three triples cover all seven imaginary ind discharged by kernel-external evaluation, so nothing below rests on the compiler. -/ -@[expose] public section +public section namespace Octonion theorem coord_eq {a b : Octonion} (hab : a = b) (k : Fin 8) : a.coords k = b.coords k := by diff --git a/LeanPool/CompositionAlgebras/OctonionTrace.lean b/LeanPool/CompositionAlgebras/OctonionTrace.lean index 996bd631f8..abed3795e0 100644 --- a/LeanPool/CompositionAlgebras/OctonionTrace.lean +++ b/LeanPool/CompositionAlgebras/OctonionTrace.lean @@ -55,7 +55,7 @@ maxHeartbeats` is needed anywhere in this file. octonionic matrices is built over. -/ -@[expose] public section +public section namespace Octonion diff --git a/LeanPool/CompositionAlgebras/Octonions.lean b/LeanPool/CompositionAlgebras/Octonions.lean index e5ee6efa99..96c99e8956 100644 --- a/LeanPool/CompositionAlgebras/Octonions.lean +++ b/LeanPool/CompositionAlgebras/Octonions.lean @@ -64,7 +64,7 @@ dropped axiom. The other two remain unstated. * Hurwitz, "Uber die Composition der quadratischen Formen von beliebig vielen Variablen," 1898 -/ -@[expose] public section +public section noncomputable section @@ -94,10 +94,10 @@ theorem ext {a b : Octonion} (h : ∀ i, a.coords i = b.coords i) : a = b := by @[simp] lemma neg_coords (a : Octonion) (i : Fin 8) : (-a).coords i = -(a.coords i) := rfl /-- The real unit octonion e_0 = (1, 0, 0, 0, 0, 0, 0, 0). -/ -def one : Octonion := ⟨fun i => if i = 0 then 1 else 0⟩ +@[expose] def one : Octonion := ⟨fun i => if i = 0 then 1 else 0⟩ /-- The i-th basis octonion e_i. -/ -def basisVec (i : Fin 8) : Octonion := ⟨fun j => if j = i then 1 else 0⟩ +@[expose] def basisVec (i : Fin 8) : Octonion := ⟨fun j => if j = i then 1 else 0⟩ /-- Octonionic multiplication. Non-associative, non-commutative. Defined via the Fano plane multiplication table (Baez convention). @@ -105,7 +105,7 @@ def basisVec (i : Fin 8) : Octonion := ⟨fun j => if j = i then 1 else 0⟩ For each triple (i,j,k): e_i * e_j = e_k (cyclic positive), e_j * e_i = -e_k. e_0 is the two-sided identity; e_i^2 = -e_0 for i > 0. Extended bilinearly: (sum a_i e_i) * (sum b_j e_j) = sum a_i b_j (e_i * e_j). -/ -def mul (a b : Octonion) : Octonion where +@[expose] def mul (a b : Octonion) : Octonion where coords k := if k.val = 0 then a.coords 0 * b.coords 0 - a.coords 1 * b.coords 1 - a.coords 2 * b.coords 2 - @@ -144,14 +144,14 @@ instance : Mul Octonion where mul := mul /-- Octonionic conjugation: a* = 2 Re(a) - a. Equivalently: conjugate flips the sign of all imaginary components. -/ -def conj (a : Octonion) : Octonion := +@[expose] def conj (a : Octonion) : Octonion := ⟨fun i => if i = 0 then a.coords 0 else -(a.coords i)⟩ /-- The real part of an octonion. -/ -def re (a : Octonion) : ℝ := a.coords 0 +@[expose] def re (a : Octonion) : ℝ := a.coords 0 /-- The norm-squared: N(a) = a * a* = sum of squares of components. -/ -def normSq (a : Octonion) : ℝ := Finset.univ.sum fun i => (a.coords i) ^ 2 +@[expose] def normSq (a : Octonion) : ℝ := Finset.univ.sum fun i => (a.coords i) ^ 2 /-- The 7 imaginary unit octonions e_1, ..., e_7. -/ def imagUnit (i : Fin 7) : Octonion := basisVec ⟨i.val + 1, by omega⟩ diff --git a/LeanPool/Computability.lean b/LeanPool/Computability.lean index 02c80ffd85..f9de7b4927 100644 --- a/LeanPool/Computability.lean +++ b/LeanPool/Computability.lean @@ -28,7 +28,7 @@ Tags: computability, oracle-computability, turing-degrees, recursion-theory, ari MSC: 03D30, 03D28 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Computability/ArithHierarchy.lean b/LeanPool/Computability/ArithHierarchy.lean index f09b8dc1f7..81d2a4f298 100644 --- a/LeanPool/Computability/ArithHierarchy.lean +++ b/LeanPool/Computability/ArithHierarchy.lean @@ -19,7 +19,7 @@ This file develops the iterated jump operator, the sets `∅⁽ⁿ⁾`, and the `Δ⁰ₙ` of the arithmetical hierarchy relative to oracle computability. -/ -@[expose] public section +public section namespace Computability diff --git a/LeanPool/Computability/AutGrp.lean b/LeanPool/Computability/AutGrp.lean index 3bcdf88560..50681fc432 100644 --- a/LeanPool/Computability/AutGrp.lean +++ b/LeanPool/Computability/AutGrp.lean @@ -19,7 +19,7 @@ This file sets up the automorphism group of the Turing degrees as the group of o isomorphisms of `TuringDegree`. -/ -@[expose] public section +public section namespace Computability @@ -39,7 +39,7 @@ instance OrderAutGroup (α : Type) [LE α] : Group (OrderAut α) where namespace TuringDegree /-- The automorphism group of the Turing degrees. -/ -def automorphismGroup : Type := OrderAut TuringDegree +@[expose] def automorphismGroup : Type := OrderAut TuringDegree instance automorphismGroup.isGroup : Group automorphismGroup := OrderAutGroup TuringDegree diff --git a/LeanPool/Computability/Encoding.lean b/LeanPool/Computability/Encoding.lean index b2eafbb740..1951394468 100644 --- a/LeanPool/Computability/Encoding.lean +++ b/LeanPool/Computability/Encoding.lean @@ -20,7 +20,7 @@ This file provides an encoding for oracle partial recursive functions and a defi universal partial recursive function relative to an oracle, along with a proof that it is universal. -/ -@[expose] public section +public section open Denumerable Encodable @@ -175,7 +175,7 @@ inductive codeo : Type | rfind' : codeo → codeo /-- Semantics of `codeo`, relative to an indexed oracle family. -/ -def evalo {α : Type} [Primcodable α] (f : α → ℕ →. ℕ) : codeo → ℕ →. ℕ +@[expose] def evalo {α : Type} [Primcodable α] (f : α → ℕ →. ℕ) : codeo → ℕ →. ℕ | codeo.zero => pure 0 | codeo.succ => fun n => some (n + 1) | codeo.left => fun n => some (Nat.unpair n).1 @@ -313,7 +313,7 @@ theorem decodeCodeo_encodeCodeo (c : codeo) : decodeCodeo (encodeCodeo c) = c := exact h_inj _ _ (encodeCodeo_decodeCodeo' (encodeCodeo c)) /-- Returns a code for the constant function outputting a particular natural. -/ -def const : ℕ → codeo +@[expose] def const : ℕ → codeo | 0 => codeo.zero | n + 1 => codeo.comp codeo.succ (const n) @@ -367,7 +367,7 @@ theorem encode_const_step_primrec : Nat.Primrec encodeConstStepFun := by omega theorem encode_const_succ (n : ℕ) : - encodeConst (n + 1) = 4 + (5 * Nat.pair 1 (encodeConst n) + 2) := rfl + encodeConst (n + 1) = 4 + (5 * Nat.pair 1 (encodeConst n) + 2) := by rfl theorem encode_const_primrec : Nat.Primrec encodeConst := by have ih_step : Nat.Primrec (Nat.unpaired fun a n => Nat.rec (encodeCodeo codeo.zero) (fun y IH => @@ -386,7 +386,7 @@ theorem encode_const_primrec : Nat.Primrec encodeConst := by def sInner (n : ℕ) : ℕ := encodeCodeo (codeo.pair (const n) idCode) @[simp] lemma s_inner_eq (n : ℕ) : - sInner n = 4 + (5 * Nat.pair (encodeConst n) (encodeCodeo idCode) + 1) := rfl + sInner n = 4 + (5 * Nat.pair (encodeConst n) (encodeCodeo idCode) + 1) := by rfl theorem s_inner_primrec : Nat.Primrec sInner := by have h_pair : Nat.Primrec (fun n => Nat.pair (encodeCodeo (const n)) (encodeCodeo idCode)) := @@ -396,9 +396,9 @@ theorem s_inner_primrec : Nat.Primrec sInner := by omega /-- The encoding of the code applying oracle `0` to the constant `n` (an `s`-`m`-`n` index). -/ -def s (n : ℕ) : ℕ := encodeCodeo (codeo.comp (codeo.oracle 0) (const n)) +@[expose] def s (n : ℕ) : ℕ := encodeCodeo (codeo.comp (codeo.oracle 0) (const n)) -theorem s_eq (n : ℕ) : s n = 4 + (5 * Nat.pair 4 (encodeConst n) + 2) := rfl +theorem s_eq (n : ℕ) : s n = 4 + (5 * Nat.pair 4 (encodeConst n) + 2) := by rfl theorem s_primrec : Nat.Primrec s := by have h_pair : Nat.Primrec (fun n => Nat.pair (encodeCodeo (codeo.oracle 0)) (encodeConst n)) := diff --git a/LeanPool/Computability/Jump.lean b/LeanPool/Computability/Jump.lean index beed6478e4..83b0535127 100644 --- a/LeanPool/Computability/Jump.lean +++ b/LeanPool/Computability/Jump.lean @@ -26,7 +26,7 @@ if `f : ℕ →. ℕ`, then `dom f : Set ℕ` is `{n | n ∈ f.Dom}`. These are theorems are stated. -/ -@[expose] public section +public section open scoped Computability diff --git a/LeanPool/Computability/Oracle.lean b/LeanPool/Computability/Oracle.lean index 4b1cdbcf40..dab100e048 100644 --- a/LeanPool/Computability/Oracle.lean +++ b/LeanPool/Computability/Oracle.lean @@ -38,7 +38,7 @@ the inductive structure of `Nat.Partrec`. Computability, Oracle, Recursion, Primitive Recursion -/ -@[expose] public section +public section open Primrec Nat.Partrec Part Encodable diff --git a/LeanPool/Computability/TuringDegree.lean b/LeanPool/Computability/TuringDegree.lean index e9605431da..dba0d3d2bd 100644 --- a/LeanPool/Computability/TuringDegree.lean +++ b/LeanPool/Computability/TuringDegree.lean @@ -48,7 +48,7 @@ Turing reducibility. This gives a concrete representation of degrees as equivale Computability, Turing Degrees, Reducibility, Equivalence Relation -/ -@[expose] public section +public section namespace Computability @@ -133,7 +133,7 @@ abbrev TuringDegree := Antisymmetrization _ TuringReducible /-- The preorder on partial functions induced by Turing reducibility. -/ -@[instance_reducible] def turingPreorder : Preorder (ℕ →. ℕ) where +@[expose, instance_reducible] def turingPreorder : Preorder (ℕ →. ℕ) where le := TuringReducible le_refl := .refl le_trans _ _ _ := TuringReducible.trans @@ -475,7 +475,7 @@ theorem join_congr {f f' g g' : ℕ →. ℕ} (hf : f ≡ᵀ f') (hg : g ≡ᵀ ⟨join_mono hf.1 hg.1, join_mono hf.2 hg.2⟩ /-- The supremum operation on Turing degrees, induced by the Turing join. -/ -def sup : TuringDegree → TuringDegree → TuringDegree := +@[expose] def sup : TuringDegree → TuringDegree → TuringDegree := Quotient.lift₂ (fun f g => toAntisymmetrization TuringReducible (f ⊕ g)) (fun _ _ _ _ hf hg => Quotient.sound (join_congr hf hg)) @@ -483,16 +483,18 @@ def sup : TuringDegree → TuringDegree → TuringDegree := theorem sup_mk (f g : ℕ →. ℕ) : TuringDegree.sup (toAntisymmetrization TuringReducible f) (toAntisymmetrization TuringReducible g) = - toAntisymmetrization TuringReducible (f ⊕ g) := rfl + toAntisymmetrization TuringReducible (f ⊕ g) := by rfl theorem le_sup_left (a b : TuringDegree) : a ≤ TuringDegree.sup a b := by induction a using Quotient.inductionOn' induction b using Quotient.inductionOn' + change _ ≤ᵀ (_ ⊕ _) exact left_le_join _ _ theorem le_sup_right (a b : TuringDegree) : b ≤ TuringDegree.sup a b := by induction a using Quotient.inductionOn' induction b using Quotient.inductionOn' + change _ ≤ᵀ (_ ⊕ _) exact right_le_join _ _ theorem sup_le {a b c : TuringDegree} (ha : a ≤ c) (hb : b ≤ c) : @@ -500,6 +502,8 @@ theorem sup_le {a b c : TuringDegree} (ha : a ≤ c) (hb : b ≤ c) : induction a using Quotient.inductionOn' induction b using Quotient.inductionOn' induction c using Quotient.inductionOn' + change _ ≤ᵀ _ at ha hb + change (_ ⊕ _) ≤ᵀ _ exact join_le _ _ _ ha hb instance instSemilatticeSup : SemilatticeSup TuringDegree where @@ -512,7 +516,7 @@ instance instSemilatticeSup : SemilatticeSup TuringDegree where @[simp] lemma sup_def (f g : ℕ →. ℕ) : (toAntisymmetrization TuringReducible f) ⊔ (toAntisymmetrization TuringReducible g) = - toAntisymmetrization TuringReducible (f ⊕ g) := rfl + toAntisymmetrization TuringReducible (f ⊕ g) := by rfl end TuringDegree diff --git a/LeanPool/ComputableReal.lean b/LeanPool/ComputableReal.lean index e3bc4559cc..903c1b010c 100644 --- a/LeanPool/ComputableReal.lean +++ b/LeanPool/ComputableReal.lean @@ -24,7 +24,7 @@ Tags: interval-arithmetic, real-numbers, cauchy-sequences, special-functions MSC: 65G40, 68V20 -/ -@[expose] public section +public section /-! A framework for verified interval-Cauchy real arithmetic, after Russell O'Connor, diff --git a/LeanPool/ComputableReal/AuxLemmas.lean b/LeanPool/ComputableReal/AuxLemmas.lean index 79aedc41fa..0b34dfa471 100644 --- a/LeanPool/ComputableReal/AuxLemmas.lean +++ b/LeanPool/ComputableReal/AuxLemmas.lean @@ -15,7 +15,7 @@ Small helper lemmas about `CauSeq` suprema/infima and about Cauchy sequences converging to a real number, used in the construction of computable reals. -/ -@[expose] public section +public section theorem abs_ite_le [AddCommGroup α] [LinearOrder α] [IsOrderedAddMonoid α] (x : α) : abs x = if 0 ≤ x then x else -x := by @@ -59,7 +59,7 @@ theorem inf_equiv_of_equivs (ha : a ≈ c) (hb : b ≈ c) : a ⊓ b ≈ c := by all_goals linarith /-- Dropping the first n terms of a Cauchy sequence to get a new sequence. -/ -def drop (a : CauSeq α abs) (n : ℕ) : CauSeq α abs := +@[expose] def drop (a : CauSeq α abs) (n : ℕ) : CauSeq α abs := ⟨fun k ↦ a.val (n+k), fun _ hq ↦ Exists.casesOn (cauchy₂ a hq) fun i hi ↦ ⟨i, fun _ hj ↦ hi _ (le_add_of_le_right hj) _ (Nat.le_add_left i n)⟩⟩ diff --git a/LeanPool/ComputableReal/ComputableRSeq.lean b/LeanPool/ComputableReal/ComputableRSeq.lean index 636d183526..98ce289dd8 100644 --- a/LeanPool/ComputableReal/ComputableRSeq.lean +++ b/LeanPool/ComputableReal/ComputableRSeq.lean @@ -35,7 +35,7 @@ sense. Addition, negation, and multiplication are executable interval arithmetic classically and is `noncomputable`. -/ -@[expose] public section +public section namespace QInterval @@ -145,9 +145,9 @@ namespace ComputableℝSeq open scoped QInterval /-- The lower-bound Cauchy sequence of a `ComputableℝSeq`. -/ -def lb (x : ComputableℝSeq) : CauSeq ℚ abs := ⟨fun n ↦ (x.lub n).fst, x.hcl⟩ +@[expose] def lb (x : ComputableℝSeq) : CauSeq ℚ abs := ⟨fun n ↦ (x.lub n).fst, x.hcl⟩ /-- The upper-bound Cauchy sequence of a `ComputableℝSeq`. -/ -def ub (x : ComputableℝSeq) : CauSeq ℚ abs := ⟨fun n ↦ (x.lub n).snd, x.hcu⟩ +@[expose] def ub (x : ComputableℝSeq) : CauSeq ℚ abs := ⟨fun n ↦ (x.lub n).snd, x.hcu⟩ /-- Get the real value determined by the sequence. (Irreducibly) given here as the limit of the lower bound sequence. -/ @@ -195,7 +195,7 @@ theorem val_uniq {x : ℝ} {s : ComputableℝSeq} (hlb : ∀ n, s.lb n ≤ x) (h s.val_def ▸ val_uniq' hlb hub s.heq /-- Make a computable sequence for x from a separate lower and upper bound CauSeq. -/ -def mk (x : ℝ) (lub : ℕ → ℚInterval) +@[expose] def mk (x : ℝ) (lub : ℕ → ℚInterval) (hcl : IsCauSeq abs (fun n ↦ (lub n).fst)) (hcu : IsCauSeq abs (fun n ↦ (lub n).snd)) (hlb : ∀ n, (lub n).fst ≤ x) @@ -223,7 +223,7 @@ theorem ext {x y : ComputableℝSeq} (h₁ : ∀ n, x.lb n = y.lb n) (h₂ : ∀ mk'.injEq _ _ _ _ _ _ _ _ _ _ ▸ (funext fun n ↦ NonemptyInterval.ext (Prod.ext (h₁ n) (h₂ n))) /-- All rational numbers `q` have a computable sequence: the constant sequence `q`. -/ -def ofRat (q : ℚ) : ComputableℝSeq := +@[expose] def ofRat (q : ℚ) : ComputableℝSeq := mk q (fun _ ↦ NonemptyInterval.pure q) (IsCauSeq.const q) (IsCauSeq.const q) @@ -236,7 +236,7 @@ instance intCast : IntCast ComputableℝSeq where intCast z := ofRat z instance ratCast : RatCast ComputableℝSeq where ratCast q := ofRat q /-- Addition of computable real sequences. -/ -def add (x : ComputableℝSeq) (y : ComputableℝSeq) : ComputableℝSeq := +@[expose] def add (x : ComputableℝSeq) (y : ComputableℝSeq) : ComputableℝSeq := mk (x.val + y.val) (fun n ↦ x.lub n + y.lub n) (IsCauSeq.add x.hcl y.hcl) @@ -253,7 +253,7 @@ def add (x : ComputableℝSeq) (y : ComputableℝSeq) : ComputableℝSeq := exact add_le_add (x.hub n) (y.hub n)) (have := CauSeq.add_equiv_add x.heq y.heq; this) --TODO why does 'inlining' the have not work /-- Negation of a computable real sequence. -/ -def neg (x : ComputableℝSeq) : ComputableℝSeq := +@[expose] def neg (x : ComputableℝSeq) : ComputableℝSeq := mk (-x.val) (fun n ↦ -x.lub n) (IsCauSeq.neg x.hcu) @@ -262,7 +262,7 @@ def neg (x : ComputableℝSeq) : ComputableℝSeq := (fun n ↦ by simpa [lb] using x.hlb n) (have := CauSeq.neg_equiv_neg (Setoid.symm x.heq); this) /-- Subtraction of computable real sequences. -/ -def sub (x : ComputableℝSeq) (y : ComputableℝSeq) : ComputableℝSeq := +@[expose] def sub (x : ComputableℝSeq) (y : ComputableℝSeq) : ComputableℝSeq := add x (neg y) /-- "Bundled" multiplication to give lower and upper bounds. This bundling avoids the need to @@ -493,7 +493,7 @@ private noncomputable instance sign_aux_sound (x : ℝ) : sign witness terminates exactly when `x ≠ 0` or some interval is the point `0`, so a fuel-free executable version cannot be total.) This ends up providing the `DecidableEq` and `DecidableLT` instances on `Computableℝ`, which are likewise classical. -/ -noncomputable def sign (x : ComputableℝSeq) : SignType := +@[expose] noncomputable def sign (x : ComputableℝSeq) : SignType := SignType.sign x.val theorem sign_sound (x : ComputableℝSeq) : x.sign = SignType.sign x.val := @@ -534,26 +534,27 @@ theorem signWitnessTerm_prop (x : ComputableℝSeq) (n : ℕ) (hnz : x.val ≠ 0 all_goals rify at *; linarith (config := {splitNe := true}) +/-- Find a sign witness by searching from index `k`. -/ +def signWitnessFrom (x : ComputableℝSeq) (hnz : x.val ≠ 0) (k : ℕ) : + { n // (0 < x.val ∧ 0 < x.lb n) ∨ (x.val < 0 ∧ x.ub n < 0)} := + if hub : x.ub k < 0 then + ⟨k, Or.inr ⟨by rify at hub; linarith [x.hub k], hub⟩⟩ + else if hlb : x.lb k > 0 then + ⟨k, Or.inl ⟨by rify at hlb; linarith [x.hlb k], hlb⟩⟩ + else + signWitnessFrom x hnz (k + 1) +termination_by (x.signWitnessTerm hnz).val.fst - k +decreasing_by + decreasing_with + apply Nat.sub_add_lt_sub _ Nat.le.refl + exact x.signWitnessTerm_prop k hnz hub hlb + /-- With the proof that x≠0, we can also eventually get a sign witness: a number n such that either 0 < x and 0 < lb n; or that x < 0 and ub n < 0. Marking it as irreducible because in theory all of the info needed is in the return Subtype. -/ irreducible_def signWitness (x : ComputableℝSeq) (hnz : x.val ≠ 0) : { n // (0 < x.val ∧ 0 < x.lb n) ∨ (x.val < 0 ∧ x.ub n < 0)} := - signWitness_aux 0 hnz where - signWitness_aux (k : ℕ) (hnz : x.val ≠ 0) : { n // (0 < x.val ∧ 0 < x.lb n) ∨ (x.val < 0 ∧ x.ub - n < 0)}:= - if hub : x.ub k < 0 then - ⟨k, Or.inr ⟨by rify at hub; linarith [x.hub k], hub⟩⟩ - else if hlb : x.lb k > 0 then - ⟨k, Or.inl ⟨by rify at hlb; linarith [x.hlb k], hlb⟩⟩ - else - signWitness_aux (k+1) hnz - termination_by - (x.signWitnessTerm hnz).val.fst - k - decreasing_by - · decreasing_with - apply Nat.sub_add_lt_sub _ Nat.le.refl - exact x.signWitnessTerm_prop k hnz hub hlb + signWitnessFrom x hnz 0 /-- With the proof that x≠0, we get a total comparison function. -/ def isPos {x : ComputableℝSeq} (hnz : x.val ≠ 0) : Bool := @@ -839,7 +840,7 @@ theorem val_safeInv_ne_zero {x : ComputableℝSeq} (hnz : x.val ≠ 0) : (x.safe rwa [val_safeInv, ne_eq, inv_eq_zero] /-- Subtype of sequences with nonzero values. These admit a (terminating) inverse function. -/ -def nzSeq := {x : ComputableℝSeq // x.val ≠ 0} +@[expose] def nzSeq := {x : ComputableℝSeq // x.val ≠ 0} /-- The inverse on the subtype of sequences with nonzero value. -/ noncomputable def invNz : nzSeq → nzSeq := fun x ↦ ⟨x.val.safeInv x.prop, val_safeInv_ne_zero _⟩ diff --git a/LeanPool/ComputableReal/ComputableReal.lean b/LeanPool/ComputableReal/ComputableReal.lean index 29c37b01c6..0d8d5a077f 100644 --- a/LeanPool/ComputableReal/ComputableReal.lean +++ b/LeanPool/ComputableReal/ComputableReal.lean @@ -18,13 +18,13 @@ arithmetic; inversion and the comparison `Decidable` instances go through the classical `ComputableℝSeq.sign` and are `noncomputable`. -/ -@[expose] public section +public section /-- Computable reals, defined as the quotient of ComputableℝSeq sequences -- sequences with Cauchy sequences of lower and upper bounds that converge to the same value -- by the equivalence relation of having the same converged value. This is similar to how reals are quotients of Cauchy sequence (without any guarantees on lower/upper bounds). -/ -def Computableℝ := +@[expose] def Computableℝ := @Quotient ComputableℝSeq ComputableℝSeq.equiv attribute [local implicit_reducible] Computableℝ ComputableℝSeq.nzSeq @@ -32,11 +32,11 @@ attribute [local implicit_reducible] Computableℝ ComputableℝSeq.nzSeq namespace Computableℝ /-- Definition of `mk`. -/ -def mk : ComputableℝSeq → Computableℝ := +@[expose] def mk : ComputableℝSeq → Computableℝ := Quotient.mk ComputableℝSeq.equiv /-- Definition of `val`. -/ -def val : Computableℝ → ℝ := Quotient.lift ComputableℝSeq.val (fun _ _ h ↦ h) +@[expose] def val : Computableℝ → ℝ := Quotient.lift ComputableℝSeq.val (fun _ _ h ↦ h) @[simp] theorem val_mk_eq_val : (mk x).val = x.val := @@ -61,12 +61,14 @@ theorem eq_iff_eq_val (x y : Computableℝ) : x.val = y.val ↔ x = y := /-- Alternate version of mapℝ that doesn't directly refer to f₂, so it stays computable even if f₂ isn't. -/ -def mapℝ' (f : ComputableℝSeq → ComputableℝSeq) (h : ∃ f₂ : ℝ → ℝ, ∀ x, (f x).val = f₂ x.val) : +@[expose] def mapℝ' (f : ComputableℝSeq → ComputableℝSeq) + (h : ∃ f₂ : ℝ → ℝ, ∀ x, (f x).val = f₂ x.val) : Computableℝ → Computableℝ := Quotient.map f (fun a b h₂ ↦ h.elim fun _ h ↦ (h₂ ▸ h a).trans (h b).symm) /-- Given a unary function on sequences that clearly matches function on reals, lift it. -/ -def mapℝ (f : ComputableℝSeq → ComputableℝSeq) {f₂ : ℝ → ℝ} (h : ∀ x, (f x).val = f₂ x.val) : +@[expose] def mapℝ (f : ComputableℝSeq → ComputableℝSeq) {f₂ : ℝ → ℝ} + (h : ∀ x, (f x).val = f₂ x.val) : Computableℝ → Computableℝ := mapℝ' f ⟨f₂, h⟩ @@ -75,12 +77,13 @@ theorem mapℝ'_eq_mapℝ : mapℝ' f h = mapℝ f h₂ := by /-- Alternate version of map₂ℝ that doesn't directly refer to f₂, so it stays computable even if f₂ isn't. -/ -def map₂ℝ' (f : ComputableℝSeq → ComputableℝSeq → ComputableℝSeq) (h : ∃ f₂ : ℝ → ℝ → ℝ, ∀ x y, +@[expose] def map₂ℝ' (f : ComputableℝSeq → ComputableℝSeq → ComputableℝSeq) + (h : ∃ f₂ : ℝ → ℝ → ℝ, ∀ x y, (f x y).val = f₂ x.val y.val) : Computableℝ → Computableℝ → Computableℝ := Quotient.map₂ f (fun a b h₂ y z h₃ ↦ h.elim fun _ h ↦ (h₂ ▸ h₃ ▸ h a y).trans (h b z).symm) /-- Given a binary function that clearly mimics a standard real function, lift that. -/ -def map₂ℝ (f : ComputableℝSeq → ComputableℝSeq → ComputableℝSeq) {f₂ : ℝ → ℝ → ℝ} +@[expose] def map₂ℝ (f : ComputableℝSeq → ComputableℝSeq → ComputableℝSeq) {f₂ : ℝ → ℝ → ℝ} (h : ∀ x y, (f x y).val = f₂ x.val y.val) : Computableℝ → Computableℝ → Computableℝ := map₂ℝ' f ⟨f₂, h⟩ @@ -164,6 +167,14 @@ theorem neg_mk (x : ComputableℝSeq) : -mk x = mk (-x) := instance instCommRing : CommRing Computableℝ := by refine { natCast := fun n => mk n intCast := fun z => mk z + intCast_negSucc := by + intro n + rw [← eq_iff_eq_val] + simp only [val_mk_eq_val, val_neg, ComputableℝSeq.val_intCast, + Int.cast_negSucc] + change -(↑(n + 1) : ℝ) = + -((mk ((n + 1 : ℕ) : ComputableℝSeq)).val) + simp only [val_mk_eq_val, ComputableℝSeq.val_natCast] zero := 0 one := 1 mul := (· * ·) @@ -287,7 +298,7 @@ instance instLT : LT Computableℝ := ⟨lt⟩ /-- Definition of `le`. -/ -def le : Prop := by +@[expose] def le : Prop := by apply Quotient.lift (fun z ↦ SignType.zero ≤ z.sign) ?_ (y - x) intro a b h dsimp diff --git a/LeanPool/ComputableReal/IsComputable.lean b/LeanPool/ComputableReal/IsComputable.lean index 5351689826..7dd2ca8ab5 100644 --- a/LeanPool/ComputableReal/IsComputable.lean +++ b/LeanPool/ComputableReal/IsComputable.lean @@ -29,7 +29,7 @@ rather than recursive data, this is not computability in the computable-analysis comparison instances below are classical (`noncomputable`, via sign information on the limit). -/ -@[expose] public section +public section /-- Type class stating that `x : ℝ` carries a `ComputableℝSeq`: an explicit sequence of rational interval approximations converging to `x`. Like `Decidable`, it carries data with it, and @@ -50,13 +50,14 @@ analogous to `decidable_of_iff`, as a way to avoid `Eq.rec` on data-carrying ins fun ⟨sx, hsx⟩ ↦ ⟨sx, h ▸ hsx⟩ /-- Definition of `lift`. -/ -@[reducible] def lift (fr : ℝ → ℝ) (fs : ComputableℝSeq → ComputableℝSeq) +@[expose, reducible] def lift (fr : ℝ → ℝ) (fs : ComputableℝSeq → ComputableℝSeq) (h : ∀ a, (fs a).val = fr a.val) : IsComputable x → IsComputable (fr x) := fun ⟨sx, hsx⟩ ↦ ⟨fs sx, hsx ▸ h sx⟩ /-- Definition of `lift₂`. -/ -@[reducible] def lift₂ (fr : ℝ → ℝ → ℝ) (fs : ComputableℝSeq → ComputableℝSeq → ComputableℝSeq) +@[expose, reducible] +def lift₂ (fr : ℝ → ℝ → ℝ) (fs : ComputableℝSeq → ComputableℝSeq → ComputableℝSeq) (h : ∀ a b, (fs a b).val = fr a.val b.val) : IsComputable x → IsComputable y → IsComputable (fr x y) := fun ⟨sx, hsx⟩ ⟨sy, hsy⟩ ↦ ⟨fs sx sy, hsx ▸ hsy ▸ h sx sy⟩ @@ -180,7 +181,7 @@ end IsComputable but that only uses neighborhoods within the rationals, which is a strictly weaker condition. This uses neighborhoods in the ambient space, the reals. -/ -def TendstoLocallyUniformlyWithout (F : ℕ → ℚ → ℚ) (f : ℝ → ℝ) : Prop := +@[expose] def TendstoLocallyUniformlyWithout (F : ℕ → ℚ → ℚ) (f : ℝ → ℝ) : Prop := ∀ (ε : ℝ), 0 < ε → ∀ (x : ℝ), ∃ t ∈ nhds x, ∃ a, ∀ (b : ℕ), a ≤ b → ∀ (y : ℚ), ↑y ∈ t → |f y - ↑(F b y)| < ε @@ -228,7 +229,7 @@ open scoped QInterval namespace ComputableℝSeq /-- Definition of `ofTendstoLocallyUniformlyContinuous`. -/ -def ofTendstoLocallyUniformlyContinuous +@[expose] def ofTendstoLocallyUniformlyContinuous {f : ℝ → ℝ} (hf : Continuous f) (fImpl : ℕ → ℚInterval → ℚInterval) (fImpl_l : ℕ → ℚ → ℚ) diff --git a/LeanPool/ComputableReal/IsComputableC.lean b/LeanPool/ComputableReal/IsComputableC.lean index 54d026229b..9ed5f17913 100644 --- a/LeanPool/ComputableReal/IsComputableC.lean +++ b/LeanPool/ComputableReal/IsComputableC.lean @@ -19,7 +19,7 @@ instances; like their real counterparts, these comparison instances are classica `noncomputable`. -/ -@[expose] public section +public section /-- Type class stating that `x : ℂ` has a `ComputableℝSeq` for its real and imaginary parts. Note that we can't define this as `IsComputable x.re` + `IsComputable x.im`, because then diff --git a/LeanPool/ComputableReal/SpecialFunctions/Basic.lean b/LeanPool/ComputableReal/SpecialFunctions/Basic.lean index db3ea945ca..b78149f189 100644 --- a/LeanPool/ComputableReal/SpecialFunctions/Basic.lean +++ b/LeanPool/ComputableReal/SpecialFunctions/Basic.lean @@ -22,7 +22,7 @@ under the basic operations on real numbers. The instances that branch on a compa (`Real.sign`, `max`, `min`, `abs`) inherit its classical sign test and are `noncomputable`. -/ -@[expose] public section +public section namespace IsComputable diff --git a/LeanPool/ComputableReal/SpecialFunctions/Exp.lean b/LeanPool/ComputableReal/SpecialFunctions/Exp.lean index 3d1d323d4e..2688f89b4c 100644 --- a/LeanPool/ComputableReal/SpecialFunctions/Exp.lean +++ b/LeanPool/ComputableReal/SpecialFunctions/Exp.lean @@ -19,7 +19,7 @@ functions are executable; the packaged sequence mentions `Real.exp` itself as it value, so `exp` and the instances are `noncomputable` Lean terms. -/ -@[expose] public section +public section namespace ComputableℝSeq namespace Exp diff --git a/LeanPool/ComputableReal/SpecialFunctions/Pi.lean b/LeanPool/ComputableReal/SpecialFunctions/Pi.lean index 93266adb21..27a3e76e03 100644 --- a/LeanPool/ComputableReal/SpecialFunctions/Pi.lean +++ b/LeanPool/ComputableReal/SpecialFunctions/Pi.lean @@ -21,7 +21,7 @@ go through the `noncomputable` square-root sequences, so `Pi` and the derived bounds `piLb`/`piUb` are `noncomputable` Lean terms. -/ -@[expose] public section +public section open scoped QInterval @@ -38,7 +38,7 @@ noncomputable instance instComputableSqrtTwoAddSeries (x : ℝ) [hx : IsComputab n.rec hx (fun _ _ ↦ IsComputable.instComputableSqrt _) /-- Definition of `sqrtTwoAddSeriesN`. -/ -noncomputable def sqrtTwoAddSeriesN : ℕ → ComputableℝSeq := +@[expose] noncomputable def sqrtTwoAddSeriesN : ℕ → ComputableℝSeq := fun n ↦ (instComputableSqrtTwoAddSeries 0 n).seq theorem sqrtTwoAddSeriesN_lb_le (n k : ℕ) : (sqrtTwoAddSeriesN n).lb k ≤ Real.sqrtTwoAddSeries 0 @@ -163,7 +163,7 @@ theorem sqrtTwoAddSeriesN_bounds (n k : ℕ) (hk : 3 ≤ k) : linarith /-- Definition of `sqrtTwoSubSqrtTwoAddSeriesN`. -/ -noncomputable def sqrtTwoSubSqrtTwoAddSeriesN : ℕ → ComputableℝSeq := +@[expose] noncomputable def sqrtTwoSubSqrtTwoAddSeriesN : ℕ → ComputableℝSeq := fun n ↦ (inferInstance : IsComputable (Real.sqrt (2 - Real.sqrtTwoAddSeries 0 n))).seq theorem sqrtTwoSubSqrtTwoAddSeries_eq (n k : ℕ) : @@ -414,7 +414,7 @@ theorem piUb_causeq : ∃ (h' : IsCauSeq abs piUb), Real.mk ⟨piUb, h'⟩ = Rea · linarith /-- Definition of `Pi`. -/ -noncomputable def Pi : ComputableℝSeq := +@[expose] noncomputable def Pi : ComputableℝSeq := mk Real.pi (lub := fun n ↦ ⟨⟨piLb n, piUb n⟩, Rat.cast_le.mp <| (piLb_le_pi n).trans (piUb_ge_pi n)⟩) @@ -437,5 +437,6 @@ namespace IsComputable noncomputable instance instComputablePi : IsComputable (Real.pi) where seq := ComputableℝSeq.Pi prop := ComputableℝSeq.mk_val_eq_val + (h₃ := ComputableℝSeq.piLb_le_pi) (h₄ := ComputableℝSeq.piUb_ge_pi) end IsComputable diff --git a/LeanPool/ComputableReal/SpecialFunctions/Sqrt.lean b/LeanPool/ComputableReal/SpecialFunctions/Sqrt.lean index 3b0ac057cc..25c97bfc03 100644 --- a/LeanPool/ComputableReal/SpecialFunctions/Sqrt.lean +++ b/LeanPool/ComputableReal/SpecialFunctions/Sqrt.lean @@ -22,7 +22,7 @@ functions are executable; the packaged sequence mentions `Real.sqrt` itself as i value, so `sqrt` and the instances are `noncomputable` Lean terms. -/ -@[expose] public section +public section namespace ComputableℝSeq @@ -133,7 +133,7 @@ def boundedSqrt (x : ℚInterval) (n : ℕ) (b : ℕ) (hb : 0 < b) : ℚInterval ⟩ /-- Definition of `sqrtq`. -/ -def sqrtq (x : ℚInterval) (n : ℕ) : ℚInterval := +@[expose] def sqrtq (x : ℚInterval) (n : ℕ) : ℚInterval := --shortcut with an if to slightly speed things up if x.snd ≤ 0 then 0 else boundedSqrt x n 4 (by norm_num) @@ -638,7 +638,7 @@ theorem TLUW_upper : TendstoLocallyUniformlyWithout linarith /-- Definition of `sqrt`. -/ -noncomputable def sqrt : ComputableℝSeq → ComputableℝSeq := +@[expose] noncomputable def sqrt : ComputableℝSeq → ComputableℝSeq := ofTendstoLocallyUniformlyContinuous (f := Real.sqrt) (hf := Real.continuous_sqrt) diff --git a/LeanPool/ConcentrationInequalities/BennettBernstein.lean b/LeanPool/ConcentrationInequalities/BennettBernstein.lean index 99b3d9c58e..f5b877b68e 100644 --- a/LeanPool/ConcentrationInequalities/BennettBernstein.lean +++ b/LeanPool/ConcentrationInequalities/BennettBernstein.lean @@ -43,7 +43,7 @@ This file develops that from scratch, Mathlib-only: Sorry-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real @@ -55,7 +55,7 @@ variable {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} `mgf X μ t ≤ exp(V t²/(2(1−ct)))` for `0 ≤ t` and `ct < 1`. This is the variance-based (Bernstein) analogue of `HasSubgaussianMGF`; when `c = 0`, every nonnegative parameter is in the effective domain. It is the martingale-summable object underlying Freedman's inequality. -/ -def HasSubgammaMGF (X : Ω → ℝ) (V c : ℝ) (μ : Measure Ω) : Prop := +@[expose] def HasSubgammaMGF (X : Ω → ℝ) (V c : ℝ) (μ : Measure Ω) : Prop := ∀ t : ℝ, 0 ≤ t → c * t < 1 → mgf X μ t ≤ Real.exp (V * t ^ 2 / (2 * (1 - c * t))) /-- **Bernstein tail from the sub-gamma MGF.** If `X` has a sub-gamma MGF with `V > 0`, diff --git a/LeanPool/ConcentrationInequalities/ConditionalHoeffding.lean b/LeanPool/ConcentrationInequalities/ConditionalHoeffding.lean index b4beeabee3..a5083753e9 100644 --- a/LeanPool/ConcentrationInequalities/ConditionalHoeffding.lean +++ b/LeanPool/ConcentrationInequalities/ConditionalHoeffding.lean @@ -28,7 +28,7 @@ The proof lifts the unconditional Hoeffding bound through the conditional-expect Sorry-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean b/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean index ec96743d2c..e322e7fd34 100644 --- a/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean +++ b/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean @@ -26,7 +26,7 @@ of `Contrib.BennettBernstein`, with kernel-level tower additivity of the varianc Sorry-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real Contrib.Bennett open scoped ENNReal NNReal Topology diff --git a/LeanPool/ConcentrationInequalities/HoeffdingUpper.lean b/LeanPool/ConcentrationInequalities/HoeffdingUpper.lean index 9e376064de..a960575ac4 100644 --- a/LeanPool/ConcentrationInequalities/HoeffdingUpper.lean +++ b/LeanPool/ConcentrationInequalities/HoeffdingUpper.lean @@ -30,7 +30,7 @@ the optimized Chernoff bound. Sorry-free and axiom-clean `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Finset diff --git a/LeanPool/ConnesKreimer.lean b/LeanPool/ConnesKreimer.lean index 516d2ab695..ef755fb0f4 100644 --- a/LeanPool/ConnesKreimer.lean +++ b/LeanPool/ConnesKreimer.lean @@ -20,7 +20,7 @@ Tags: hopf-algebras, rooted-trees, renormalization, combinatorics MSC: 16T05, 05C05, 81T15 -/ -@[expose] public section +public section /-! Top-level import for the Connes-Kreimer / Foissy Hopf algebra development. diff --git a/LeanPool/ConnesKreimer/Coassoc.lean b/LeanPool/ConnesKreimer/Coassoc.lean index 302e140dad..68303f80e0 100644 --- a/LeanPool/ConnesKreimer/Coassoc.lean +++ b/LeanPool/ConnesKreimer/Coassoc.lean @@ -11,7 +11,7 @@ Authors: Carles Marín not literal list equality. WIP, LOCAL only. -/ module -@[expose] public section +public section namespace CK.Coassoc @@ -32,10 +32,10 @@ def tmul (x y : Tens) : Tens := mutual /-- The Connes-Kreimer coproduct on one rooted tree, as a formal list of tensor terms. -/ - def coprodTree : RTree → Tens + @[expose] def coprodTree : RTree → Tens | .node F => ([RTree.node F], []) :: (coprodForest F).map (fun (p, r) => (p, [RTree.node r])) /-- The multiplicative extension of the coproduct from trees to forests. -/ - def coprodForest : Forest → Tens + @[expose] def coprodForest : Forest → Tens | [] => [([], [])] | t :: ts => tmul (coprodTree t) (coprodForest ts) end diff --git a/LeanPool/ConnesKreimer/Core.lean b/LeanPool/ConnesKreimer/Core.lean index a4babcd3b0..5561af3a62 100644 --- a/LeanPool/ConnesKreimer/Core.lean +++ b/LeanPool/ConnesKreimer/Core.lean @@ -15,7 +15,7 @@ import Mathlib.RingTheory.HopfAlgebra.Convolution Combinatorial core (List.Perm) proven below verbatim from `Coassoc.lean`; the Mathlib bridge lifts it to equality of linear maps. LOCAL — not part of the published godsil tree. -/ -@[expose] public section +public section open scoped TensorProduct @@ -38,10 +38,10 @@ def tmul (x y : Tens) : Tens := mutual /-- The Connes-Kreimer coproduct on one rooted tree, as a formal list of tensor terms. -/ - def coprodTree : RTree → Tens + @[expose] def coprodTree : RTree → Tens | .node F => ([RTree.node F], []) :: (coprodForest F).map (fun (p, r) => (p, [RTree.node r])) /-- The multiplicative extension of the coproduct from trees to forests. -/ - def coprodForest : Forest → Tens + @[expose] def coprodForest : Forest → Tens | [] => [([], [])] | t :: ts => tmul (coprodTree t) (coprodForest ts) end @@ -357,7 +357,7 @@ theorem _root_.CK.coassoc_map : /-! ### Counit. -/ /-- Counit monoid hom: every generator ↦ 0, so a word ↦ `0 ^ len` = indicator of empty. -/ -def _root_.CK.εmon : FreeMonoid RTree →* k := FreeMonoid.lift (fun _ => (0 : k)) +@[expose] def _root_.CK.εmon : FreeMonoid RTree →* k := FreeMonoid.lift (fun _ => (0 : k)) @[simp] theorem _root_.CK.εmon_nil : εmon k ([] : Forest) = 1 := map_one _ @@ -373,11 +373,11 @@ theorem _root_.CK.εmon_append (p p' : Forest) : εmon k (p ++ p') = εmon k p * | cons a as ih => simp /-- Counit as an algebra hom, then linear. -/ -noncomputable def _root_.CK.εalg : H k →ₐ[k] k := +@[expose] noncomputable def _root_.CK.εalg : H k →ₐ[k] k := MonoidAlgebra.lift k k (FreeMonoid RTree) (εmon k) /-- The Connes-Kreimer counit as a linear map. -/ -noncomputable def _root_.CK.ε : H k →ₗ[k] k := (εalg k).toLinearMap +@[expose] noncomputable def _root_.CK.ε : H k →ₗ[k] k := (εalg k).toLinearMap theorem _root_.CK.ε_single (f : Forest) (b : k) : ε k (MonoidAlgebra.single f b) = b * εmon k f := by @@ -1054,7 +1054,7 @@ noncomputable def _root_.CK.adamsUnit : (WithConv (H k →ₗ[k] H k))ˣ where inv_val := antipode_convMul_id k /-- `Ψ₋₁ = S`: the inverse of the Adams unit `Ψ₁` is the antipode. -/ -theorem _root_.CK.adamsUnit_inv_val : (adamsUnit k)⁻¹.val = WithConv.toConv (antipode k) := rfl +theorem _root_.CK.adamsUnit_inv_val : (adamsUnit k)⁻¹.val = WithConv.toConv (antipode k) := by rfl /-! ### Part 2 — local nilpotency of `J = id − u∘ε` (the connected-graded engine for `log_⋆`). diff --git a/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean b/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean index 858a70b119..ef64a2f9fd 100644 --- a/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean +++ b/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean @@ -14,7 +14,7 @@ This module proves the power-series logarithm additivity and coefficient identit transport the Connes-Kreimer Eulerian idempotent calculation to convolution algebras. -/ -@[expose] public section +public section namespace PowerSeries diff --git a/LeanPool/ConnesRigidity.lean b/LeanPool/ConnesRigidity.lean index bbb832ad31..d2c7adc1af 100644 --- a/LeanPool/ConnesRigidity.lean +++ b/LeanPool/ConnesRigidity.lean @@ -21,4 +21,4 @@ Tags: operator-algebras, von-neumann-algebras, property-t, group-theory, connes- MSC: 46L10, 20F65, 22D10 -/ -@[expose] public section +public section diff --git a/LeanPool/ConnesRigidity/Construction.lean b/LeanPool/ConnesRigidity/Construction.lean index 2930a3e3af..aad6a76d67 100644 --- a/LeanPool/ConnesRigidity/Construction.lean +++ b/LeanPool/ConnesRigidity/Construction.lean @@ -20,7 +20,7 @@ This file contains no declaration block recorded as a code transfer; its public code dependencies are attributed in their defining modules. -/ -@[expose] public section +public section namespace Connes namespace Construction @@ -60,10 +60,11 @@ noncomputable instance tensorAACountable : Countable TensorAA := by infer_instance /-- Flip on the tensor square. Paper: §2. -/ +@[expose] def flip : TensorAA ≃ₗ[k] TensorAA := TensorProduct.comm k A A /-- Flip-fixed symmetric tensor module. Paper: §2. -/ -def C : Submodule k TensorAA where +@[expose] def C : Submodule k TensorAA where carrier := {x | flip x = x} zero_mem' := by simp [flip] add_mem' := by @@ -76,7 +77,7 @@ def C : Submodule k TensorAA where rw [map_smul, hx] /-- Diagonal element of the paper's symmetric tensor module. Paper: §2. -/ -def diagonal (a : A) : C := +@[expose] def diagonal (a : A) : C := ⟨a ⊗ₜ[k] a, by simp [flip, C]⟩ /-- Matrix-indexed finite symplectic module. Paper: §2. -/ @@ -173,7 +174,7 @@ def coordHadamardLinear : A →ₗ[k] A →ₗ[k] A where def deltaTensor : TensorAA →ₗ[k] A := TensorProduct.lift coordHadamardLinear /-- Equivariant-retraction candidate on the flip-fixed tensor module. Paper: §2. -/ -def delta : C →ₗ[k] A := deltaTensor.domRestrict C +@[expose] def delta : C →ₗ[k] A := deltaTensor.domRestrict C /-- The retraction returns the original vector on diagonal tensors. Paper: §2. -/ theorem delta_diagonal (a : A) : delta (diagonal a) = a := by diff --git a/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean b/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean index 9ab05182e7..b64f49db6e 100644 --- a/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean +++ b/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean @@ -17,7 +17,7 @@ import Mathlib.Algebra.Algebra.ZMod The paper action instances component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace Construction @@ -47,7 +47,7 @@ lemma transvection_action_apply_of_ne_target {i j r : Fin 3} (hij : i ≠ j) simp [hri] /-- The linear action on the first summand of the paper kernel. Paper: §2. -/ -def avStarAction (l : SpecialLinear.SL3) (q : Q) : AVStar ≃ₗ[k] AVStar := +@[expose] def avStarAction (l : SpecialLinear.SL3) (q : Q) : AVStar ≃ₗ[k] AVStar := TensorProduct.congr (sl3AAction l) (qVStarActionHom q) /-- The first-summand action is a homomorphism. Paper: §2. -/ @@ -174,7 +174,7 @@ def sl3CActionHom : SpecialLinear.SL3 →* (C ≃ₗ[k] C) where simpa using h /-- The first Zhou action as a linear equivalence of the kernel. Paper: §2. -/ -def paperThetaOneLinear (h : H) : D ≃ₗ[k] D := +@[expose] def paperThetaOneLinear (h : H) : D ≃ₗ[k] D := (avStarAction h.1 h.2).prodCongr (sl3CActionEquiv h.1) /-- Pointwise form of the first Zhou action on the kernel splitting. -/ @@ -260,7 +260,7 @@ theorem quadraticDefectLinear_cocycle (p q : Q) : abel /-- The correction term in the second Zhou action. Paper: §2. -/ -def thetaTwoTermMap (h : H) : C →ₗ[k] AVStar where +@[expose] def thetaTwoTermMap (h : H) : C →ₗ[k] AVStar where toFun c := delta (sl3CAction h.1 c) ⊗ₜ[k] quadraticDefectLinear h.2 map_add' c d := by simp only [map_add] @@ -275,7 +275,7 @@ def thetaTwoTermMap (h : H) : C →ₗ[k] AVStar where rfl /-- The second Zhou action as a linear map. Paper: §2. -/ -def thetaTwoLinearMap (h : H) : D →ₗ[k] D where +@[expose] def thetaTwoLinearMap (h : H) : D →ₗ[k] D where toFun d := (avStarAction h.1 h.2 d.1 + thetaTwoTermMap h d.2, sl3CAction h.1 d.2) map_add' d e := by @@ -470,7 +470,7 @@ def contractStar (ψ : VStar →ₗ[k] k) : AVStar →ₗ[k] A := rfl /-- The constant-one polynomial used in the §4 detector and §§5–6 witnesses. -/ -def a0 : A := fun _ => 1 +@[expose] def a0 : A := fun _ => 1 theorem a0_ne_zero : a0 ≠ 0 := by intro h diff --git a/LeanPool/ConnesRigidity/Construction/PaperActions.lean b/LeanPool/ConnesRigidity/Construction/PaperActions.lean index 9cde66b1b2..95199f2546 100644 --- a/LeanPool/ConnesRigidity/Construction/PaperActions.lean +++ b/LeanPool/ConnesRigidity/Construction/PaperActions.lean @@ -17,7 +17,7 @@ public import LeanPool.ConnesRigidity.Foundation.LinearAlgebra.QuadraticCocycle The paper actions component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace Construction @@ -35,7 +35,7 @@ The `SymplecticIndex` construction used in the Connes rigidity formalization. abbrev SymplecticIndex := OpenAIPort.SymplecticIndex /-- The SL₃ action on the polynomial module. Paper: §2. -/ -def sl3AAction : SpecialLinear.SL3 →* (A ≃ₗ[k] A) where +@[expose] def sl3AAction : SpecialLinear.SL3 →* (A ≃ₗ[k] A) where toFun l := (Matrix.SpecialLinearGroup.toLin' l).restrictScalars k map_one' := by ext a @@ -45,11 +45,12 @@ def sl3AAction : SpecialLinear.SL3 →* (A ≃ₗ[k] A) where simp /-- The diagonal SL₃ action on the tensor square. Paper: §2. -/ -def sl3TensorAction (l : SpecialLinear.SL3) : +@[expose] def sl3TensorAction (l : SpecialLinear.SL3) : TensorAA →ₗ[k] TensorAA := TensorProduct.map (sl3AAction l).toLinearMap (sl3AAction l).toLinearMap /-- The diagonal SL₃ action restricted to the fixed tensor module. Paper: §2. -/ +@[expose] def sl3CAction (l : SpecialLinear.SL3) : C →ₗ[k] C where toFun c := ⟨sl3TensorAction l c, by @@ -75,7 +76,7 @@ def sl3CAction (l : SpecialLinear.SL3) : C →ₗ[k] C where simp only [map_smul] /-- The natural linear action of Q on the finite module. Paper: §2. -/ -def qVAction (q : Q) : PaperV ≃ₗ[k] PaperV := +@[expose] def qVAction (q : Q) : PaperV ≃ₗ[k] PaperV := { toFun := fun v => q • v invFun := fun v => q⁻¹ • v left_inv := by intro v; simp [smul_smul] @@ -101,7 +102,7 @@ def qVActionHom : Q →* (PaperV ≃ₗ[k] PaperV) where rw [mul_smul] /-- The contragredient Q action on the finite dual. Paper: §2. -/ -def qVStarActionHom : Q →* (VStar ≃ₗ[k] VStar) where +@[expose] def qVStarActionHom : Q →* (VStar ≃ₗ[k] VStar) where toFun q := LinearEquiv.dualMap (qVActionHom q⁻¹) map_one' := by ext f v @@ -118,7 +119,7 @@ def qVStarActionHom : Q →* (VStar ≃ₗ[k] VStar) where rfl /-- Span of square tensors in the tensor square. Paper: §2. -/ -def squareSpan : Submodule k TensorAA := +@[expose] def squareSpan : Submodule k TensorAA := Submodule.span k (Set.range fun a : A => a ⊗ₜ[k] a) /-- The paper's missing spanning statement for the fixed tensor module. Paper: §2. -/ diff --git a/LeanPool/ConnesRigidity/Construction/SquareSpan.lean b/LeanPool/ConnesRigidity/Construction/SquareSpan.lean index 6e76b41dac..27f1b02934 100644 --- a/LeanPool/ConnesRigidity/Construction/SquareSpan.lean +++ b/LeanPool/ConnesRigidity/Construction/SquareSpan.lean @@ -17,7 +17,7 @@ import Mathlib.Algebra.Algebra.ZMod The square span component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace Construction @@ -32,7 +32,7 @@ abbrev OrderedBasisIndex := Lex (Fin 3 × Nat) abbrev OrderedTensorIndex := Lex (OrderedBasisIndex × OrderedBasisIndex) /-- The ordered monomial basis of the polynomial module. Paper: §2. -/ -noncomputable def orderedBasis : Module.Basis OrderedBasisIndex k A := +@[expose] noncomputable def orderedBasis : Module.Basis OrderedBasisIndex k A := (Pi.basis (fun _ => Polynomial.basisMonomials k)).reindex ((Equiv.sigmaEquivProd (Fin 3) Nat).trans toLex) diff --git a/LeanPool/ConnesRigidity/Core.lean b/LeanPool/ConnesRigidity/Core.lean index bfe6d61d95..b2d559f98f 100644 --- a/LeanPool/ConnesRigidity/Core.lean +++ b/LeanPool/ConnesRigidity/Core.lean @@ -23,7 +23,7 @@ public import Mathlib.Analysis.VonNeumannAlgebra.Basic The core component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes @@ -49,7 +49,7 @@ attribute [instance] group countable end CountableDiscreteGroup /-- ICC predicate boundary. Paper: §5. -/ -def IsICC (G : CountableDiscreteGroup) : Prop := +@[expose] def IsICC (G : CountableDiscreteGroup) : Prop := Infinite G ∧ ∀ g : G, g ≠ 1 → Set.Infinite (conjugatesOf g) /-- Unitary-representation carrier. Paper: §4. -/ @@ -64,11 +64,11 @@ variable {G : Type u} {H : Type v} [Group G] [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] /-- Invariant-vector predicate. Paper: §4. -/ -def IsInvariant (π : UnitaryRepresentation G H) (ξ : H) : Prop := +@[expose] def IsInvariant (π : UnitaryRepresentation G H) (ξ : H) : Prop := ∀ g : G, (π g : H →L[ℂ] H) ξ = ξ /-- Almost-invariant-vector predicate. Paper: §4. -/ -def HasAlmostInvariantUnitVectors (π : UnitaryRepresentation G H) : Prop := +@[expose] def HasAlmostInvariantUnitVectors (π : UnitaryRepresentation G H) : Prop := ∀ (K : Finset G) (ε : ℝ), 0 < ε → ∃ ξ : H, ‖ξ‖ = 1 ∧ ∀ g ∈ K, ‖(π g : H →L[ℂ] H) ξ - ξ‖ < ε @@ -76,7 +76,7 @@ end UnitaryRepresentation /-- Property-(T), universe-polymorphic in the representation carrier so concrete `Type 0` groups are not restricted to `Type 0` Hilbert spaces. Paper: §4. -/ -def HasKazhdanPropertyT (G : CountableDiscreteGroup.{u}) : Prop := +@[expose] def HasKazhdanPropertyT (G : CountableDiscreteGroup.{u}) : Prop := ∀ (H : Type v) (_ : NormedAddCommGroup H) (_ : InnerProductSpace ℂ H) @@ -87,7 +87,7 @@ def HasKazhdanPropertyT (G : CountableDiscreteGroup.{u}) : Prop := /-- Relative property-(T), universe-polymorphic in the representation carrier so concrete `Type 0` groups are not restricted to `Type 0` Hilbert spaces. Paper: §4. -/ -def HasRelativePropertyT +@[expose] def HasRelativePropertyT (G : CountableDiscreteGroup.{u}) (N : Subgroup G) : Prop := ∀ (H : Type v) (_ : NormedAddCommGroup H) @@ -113,7 +113,7 @@ theorem memℓp_reindex {α : Type u} {β : Type v} {E : Type w} exact (e.symm.summable_iff).2 ((lp.memℓp f).summable hp) /-- Reindexing equivalence for group-indexed Hilbert spaces. Paper: §3. -/ -def l2Reindex {α : Type u} {β : Type v} (e : α ≃ β) : +@[expose] def l2Reindex {α : Type u} {β : Type v} (e : α ≃ β) : GroupL2 α ≃ₗᵢ[ℂ] GroupL2 β where toLinearEquiv := { toFun := fun f ↦ ⟨(fun j : β ↦ f (e.symm j)), memℓp_reindex e (by norm_num) f⟩ @@ -130,7 +130,7 @@ def l2Reindex {α : Type u} {β : Type v} (e : α ≃ β) : exact e.symm.tsum_eq (fun i ↦ ‖f i‖ ^ (2 : ℝ≥0∞).toReal) /-- Left-regular unitary boundary. Paper: §3. -/ -def leftRegularUnitary {G : Type u} [Group G] (g : G) : +@[expose] def leftRegularUnitary {G : Type u} [Group G] (g : G) : unitary (GroupL2 G →L[ℂ] GroupL2 G) := Unitary.linearIsometryEquiv.symm (l2Reindex (Equiv.mulLeft g)) @@ -182,7 +182,7 @@ theorem mem_vonNeumannClosure rfl /-- Group von Neumann algebra boundary. Paper: §3. -/ -def groupVonNeumannAlgebra (G : CountableDiscreteGroup.{u}) : +@[expose] def groupVonNeumannAlgebra (G : CountableDiscreteGroup.{u}) : VonNeumannAlgebra (GroupL2 G) := vonNeumannClosure (Set.range fun g : G ↦ (leftRegularRepresentation G g : GroupL2 G →L[ℂ] GroupL2 G)) @@ -198,7 +198,7 @@ def delta (G : CountableDiscreteGroup.{u}) (g : G) : GroupL2 G := exact lp.single 2 g 1 /-- Canonical trace boundary. Paper: §3. -/ -def canonicalTrace (G : CountableDiscreteGroup.{u}) : +@[expose] def canonicalTrace (G : CountableDiscreteGroup.{u}) : GroupVonNeumannAlgebra G → ℂ := fun x ↦ inner ℂ (delta G 1) ((x : GroupL2 G →L[ℂ] GroupL2 G) (delta G 1)) @@ -349,7 +349,7 @@ structure TracialGroupFactorEquiv ∀ x, canonicalTrace H (toStarAlgEquiv x) = canonicalTrace G x /-- Trace-preserving factor-isomorphism predicate. Paper: §3. -/ -def TracialGroupFactorsIsomorphic +@[expose] def TracialGroupFactorsIsomorphic (G : CountableDiscreteGroup.{u}) (H : CountableDiscreteGroup.{v}) : Prop := Nonempty (TracialGroupFactorEquiv G H) diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4Basic.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4Basic.lean index 5ed423a43a..f733fbc6a3 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4Basic.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4Basic.lean @@ -23,7 +23,7 @@ transitively on nonzero vectors. It realizes the action with symplectic transvections and keeps the exhaustive normal-subgroup certificate separate. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificate.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificate.lean index a86a5f49a0..d83f0fa640 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificate.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificate.lean @@ -30,7 +30,7 @@ The 65,536 Boolean matrices are checked in independent shards so Lake can compile the certificate in parallel. The public theorem is unchanged. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard0.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard0.lean index 70b7c70ae3..a4113d7ec2 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard0.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard0.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 1 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard1.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard1.lean index 807d5e3435..3a8730b59a 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard1.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard1.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 2 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard2.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard2.lean index e7cd5c408e..cf855d25e9 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard2.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard2.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 3 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard3.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard3.lean index c654d24925..83b4ef9f4b 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard3.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard3.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 4 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard4.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard4.lean index 2826c6c864..1f3932dbb1 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard4.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard4.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 5 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard5.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard5.lean index d7a75d6929..804a6eee41 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard5.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard5.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 6 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard6.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard6.lean index a9d0afe174..b40138bbeb 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard6.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard6.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 7 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard7.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard7.lean index d9410ebadd..b907d6d51f 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard7.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelCertificateShard7.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Kernel-checked shard 8 of 8 for the exhaustive Sp₄(𝔽₂) detector. -/ -@[expose] public section +public section namespace Connes namespace Sp4 diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelDetector.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelDetector.lean index 71809f64d6..75ebb3b654 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelDetector.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/Sp4KernelDetector.lean @@ -24,7 +24,7 @@ search is split into kernel-checked chunks and decoded back to Mathlib's symplectic-matrix carrier for the public theorem used in Zhou §6. -/ -@[expose] public section +public section namespace Connes namespace Sp4 @@ -35,18 +35,18 @@ abbrev BVMatrix := BitVec 16 abbrev BMatrix := Fin 4 → Fin 4 → Bool /-- Decode a packed matrix in row-major order. -/ -def bvEntry (x : BVMatrix) : BMatrix := fun i j => +@[expose] def bvEntry (x : BVMatrix) : BMatrix := fun i j => x.getLsbD (4 * i.val + j.val) /-- The row-column dot product over the field with two elements. -/ -def boolDot (a b : BMatrix) (i j : Fin 4) : Bool := +@[expose] def boolDot (a b : BMatrix) (i j : Fin 4) : Bool := (a i 0 && b 0 j) ^^ (a i 1 && b 1 j) ^^ (a i 2 && b 2 j) ^^ (a i 3 && b 3 j) /-- Multiply Boolean matrices over the field with two elements. -/ -def boolMul (a b : BMatrix) : BMatrix := boolDot a b +@[expose] def boolMul (a b : BMatrix) : BMatrix := boolDot a b /-- Transpose a Boolean matrix. -/ -def boolTranspose (a : BMatrix) : BMatrix := fun i j => a j i +@[expose] def boolTranspose (a : BMatrix) : BMatrix := fun i j => a j i private def boolMatrixEq (a b : BMatrix) : Prop := a 0 0 = b 0 0 ∧ a 0 1 = b 0 1 ∧ a 0 2 = b 0 2 ∧ a 0 3 = b 0 3 ∧ @@ -55,7 +55,7 @@ private def boolMatrixEq (a b : BMatrix) : Prop := a 3 0 = b 3 0 ∧ a 3 1 = b 3 1 ∧ a 3 2 = b 3 2 ∧ a 3 3 = b 3 3 /-- Decide entrywise equality of Boolean matrices. -/ -def boolMatrixEqB (a b : BMatrix) : Bool := +@[expose] def boolMatrixEqB (a b : BMatrix) : Bool := (a 0 0 == b 0 0) && (a 0 1 == b 0 1) && (a 0 2 == b 0 2) && (a 0 3 == b 0 3) && (a 1 0 == b 1 0) && (a 1 1 == b 1 1) && @@ -71,32 +71,32 @@ private theorem boolMatrixEqB_eq_true_iff (a b : BMatrix) : tauto /-- The identity matrix in the Boolean representation. -/ -def boolOne : BMatrix := bvEntry (BitVec.ofNat 16 0x8421) +@[expose] def boolOne : BMatrix := bvEntry (BitVec.ofNat 16 0x8421) /-- The standard symplectic form in the Boolean representation. -/ -def boolJ : BMatrix := bvEntry (BitVec.ofNat 16 0x2184) +@[expose] def boolJ : BMatrix := bvEntry (BitVec.ofNat 16 0x2184) /-- The first chosen symplectic generator in the Boolean representation. -/ -def boolG1 : BMatrix := bvEntry (BitVec.ofNat 16 0x13DB) +@[expose] def boolG1 : BMatrix := bvEntry (BitVec.ofNat 16 0x13DB) /-- The inverse of the first chosen symplectic generator. -/ -def boolG1Inv : BMatrix := bvEntry (BitVec.ofNat 16 0x5FC8) +@[expose] def boolG1Inv : BMatrix := bvEntry (BitVec.ofNat 16 0x5FC8) /-- The second chosen symplectic generator in the Boolean representation. -/ -def boolG2 : BMatrix := bvEntry (BitVec.ofNat 16 0x21B7) +@[expose] def boolG2 : BMatrix := bvEntry (BitVec.ofNat 16 0x21B7) /-- The inverse of the second chosen symplectic generator. -/ -def boolG2Inv : BMatrix := bvEntry (BitVec.ofNat 16 0xED84) +@[expose] def boolG2Inv : BMatrix := bvEntry (BitVec.ofNat 16 0xED84) private def boolSymplectic (x : BMatrix) : Prop := boolMatrixEq (boolMul (boolMul x boolJ) (boolTranspose x)) boolJ /-- Conjugate a Boolean matrix using a supplied matrix and its inverse. -/ -def boolConj (g gi x : BMatrix) : BMatrix := boolMul (boolMul g x) gi +@[expose] def boolConj (g gi x : BMatrix) : BMatrix := boolMul (boolMul g x) gi private def boolCommutes (a b : BMatrix) : Prop := boolMatrixEq (boolMul a b) (boolMul b a) /-- Decide whether two Boolean matrices commute. -/ -def boolCommutesB (a b : BMatrix) : Bool := +@[expose] def boolCommutesB (a b : BMatrix) : Bool := boolMatrixEqB (boolMul a b) (boolMul b a) /-- The standard alternating pairing of Boolean four-vectors. -/ -def boolPairing (a b : Fin 4 → Bool) : Bool := +@[expose] def boolPairing (a b : Fin 4 → Bool) : Bool := (a 2 && b 0) ^^ (a 3 && b 1) ^^ (a 0 && b 2) ^^ (a 1 && b 3) private theorem boolPairing_comm (a b : Fin 4 → Bool) : boolPairing a b = boolPairing b a := by @@ -110,7 +110,7 @@ private theorem boolMul_symplectic_apply (x : BMatrix) (i j : Fin 4) : simp [boolMul, boolDot, boolTranspose, boolJ, bvEntry, boolPairing] /-- Check preservation of the symplectic form using its six independent row pairings. -/ -def boolSymplecticB (x : BMatrix) : Bool := +@[expose] def boolSymplecticB (x : BMatrix) : Bool := -- The unit pairings reject zero rows before checking orthogonality. boolPairing (x 0) (x 2) && boolPairing (x 1) (x 3) && !(boolPairing (x 0) (x 1)) && !(boolPairing (x 0) (x 3)) && @@ -124,7 +124,7 @@ theorem boolSymplecticB_eq (x : BMatrix) : Bool.and_left_comm, Bool.and_comm] /-- Boolean certificate predicate used by the kernel-checked finite search. -/ -def kernelDetectorCheck (x : BitVec 16) : Bool := +@[expose] def kernelDetectorCheck (x : BitVec 16) : Bool := !(boolSymplecticB (bvEntry x)) || boolMatrixEqB (bvEntry x) boolOne || !(boolCommutesB (boolConj boolG1 boolG1Inv (bvEntry x)) (bvEntry x)) || diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/Basic.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/Basic.lean index d0c08e862c..3ac9229d27 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/Basic.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/Basic.lean @@ -15,7 +15,7 @@ import Mathlib.Data.Finsupp.Encodable # The special-linear carrier in Zhou's construction -/ -@[expose] public section +public section namespace Connes namespace SpecialLinear @@ -43,6 +43,7 @@ noncomputable instance : Countable SL3 := by infer_instance /-- Countable discrete acting-group carrier. Paper: §§4, 5. -/ +@[expose] noncomputable def sl3Group : CountableDiscreteGroup where Carrier := SL3 group := inferInstance diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ElementaryGeneration.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ElementaryGeneration.lean index 3563cfde65..9a18b63048 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ElementaryGeneration.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ElementaryGeneration.lean @@ -19,7 +19,7 @@ import Mathlib.FieldTheory.Finite.Basic # Elementary generation for Zhou §4 -/ -@[expose] public section +public section namespace Connes namespace SpecialLinear diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ICC.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ICC.lean index c74fa3280c..f6a62c0907 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ICC.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SpecialLinear/ICC.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Foundation.GroupTheory.SpecialLinear.Basic # Special-linear conjugacy and ICC for Zhou §5 -/ -@[expose] public section +public section namespace Connes namespace SpecialLinear diff --git a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SplitAbelianExtension.lean b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SplitAbelianExtension.lean index 1e46a55b4a..3c8271c6d4 100644 --- a/LeanPool/ConnesRigidity/Foundation/GroupTheory/SplitAbelianExtension.lean +++ b/LeanPool/ConnesRigidity/Foundation/GroupTheory/SplitAbelianExtension.lean @@ -19,7 +19,7 @@ public import LeanPool.ConnesRigidity.Core The split abelian extension component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/ArithmeticSymplectic.lean b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/ArithmeticSymplectic.lean index e487aad486..1e813b4a51 100644 --- a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/ArithmeticSymplectic.lean +++ b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/ArithmeticSymplectic.lean @@ -19,7 +19,7 @@ public import Mathlib.LinearAlgebra.SymplecticGroup The arithmetic symplectic component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace OpenAIPort @@ -68,7 +68,7 @@ instance : DistribMulAction IntegralSymplecticGroup IntegralLattice := /-- The `reducedMatrixHom` construction used in the Connes rigidity formalization. -/ -def reducedMatrixHom : +@[expose] def reducedMatrixHom : IntegralSymplecticGroup →* Matrix SymplecticIndex SymplecticIndex (ZMod 2) where toFun g := (g.1 : Matrix SymplecticIndex SymplecticIndex ℤ).map (Int.castRingHom (ZMod 2)) @@ -94,7 +94,7 @@ def reduceVector : IntegralLattice →+ ModTwoSpace where /-- Evaluation of coordinatewise reduction. Paper: §2. -/ @[simp] theorem reduceVector_apply (v : IntegralLattice) (i : SymplecticIndex) : - reduceVector v i = (v i : ZMod 2) := rfl + reduceVector v i = (v i : ZMod 2) := by rfl /- A canonical integral lift. Paper: §2. -/ @@ -155,13 +155,13 @@ theorem two_nsmul_integralLattice_injective : /-- The `modTwoSymplecticForm` construction used in the Connes rigidity formalization. -/ -def modTwoSymplecticForm (x y : ModTwoSpace) : ZMod 2 := +@[expose] def modTwoSymplecticForm (x y : ModTwoSpace) : ZMod 2 := ∑ i : Fin 2, (x (Sum.inl i) * y (Sum.inr i) + x (Sum.inr i) * y (Sum.inl i)) /-- The standard quadratic refinement. Paper: §2. -/ -def standardQuadraticForm (x : ModTwoSpace) : ZMod 2 := +@[expose] def standardQuadraticForm (x : ModTwoSpace) : ZMod 2 := ∑ i : Fin 2, x (Sum.inl i) * x (Sum.inr i) /- Polarization of the standard quadratic refinement. Paper: §2. -/ diff --git a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean index e551592cde..6f4332412f 100644 --- a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean +++ b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean @@ -20,7 +20,7 @@ local Boolean-polynomial namespace. The remaining finite-coordinate support and weight development is local. See the upstream PORT_MAP.md. -/ -@[expose] public section +public section namespace Connes namespace BooleanPolynomial @@ -39,12 +39,14 @@ theorem eq_one_of_ne_zero (a : F) (ha : a ≠ 0) : a = 1 := by abbrev PolynomialOn (ι : Type*) := (ι → F) → F /-- Support of a Boolean function on arbitrary finite coordinates. Paper: §4. -/ +@[expose] noncomputable def supportOn {ι : Type*} [Fintype ι] (P : PolynomialOn ι) : Finset (ι → F) := by classical exact Finset.univ.filter (fun x => P x ≠ 0) /-- Support weight on arbitrary finite coordinates. Paper: §4. -/ +@[expose] noncomputable def weightOn {ι : Type*} [Fintype ι] (P : PolynomialOn ι) : ℕ := (supportOn P).card @@ -64,13 +66,14 @@ structure QuadraticData (ι : Type*) [Fintype ι] where quadratic : ι → ι → F /-- Evaluation of degree-two coefficient data. Paper: §4. -/ -def QuadraticData.eval {ι : Type*} [Fintype ι] +@[expose] def QuadraticData.eval {ι : Type*} [Fintype ι] (q : QuadraticData ι) (x : ι → F) : F := q.constantTerm + ∑ i, q.linear i * x i + ∑ i, ∑ j, q.quadratic i j * x i * x j /-- Degree restriction on arbitrary finite Boolean coordinates. Paper: §4. -/ +@[expose] def IsQuadratic {ι : Type*} [Fintype ι] (P : PolynomialOn ι) : Prop := ∃ q : QuadraticData ι, ∀ x, q.eval x = P x diff --git a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/QuadraticCocycle.lean b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/QuadraticCocycle.lean index 2b76f7f7e3..8ec768f3b6 100644 --- a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/QuadraticCocycle.lean +++ b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/QuadraticCocycle.lean @@ -20,7 +20,7 @@ public import Mathlib.RepresentationTheory.Homological.GroupCohomology.LowDegree The quadratic cocycle component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace OpenAIPort @@ -49,7 +49,7 @@ instance : Fintype ModTwoSymplecticGroup := /-- The `reducedSymplecticHom` construction used in the Connes rigidity formalization. -/ -def reducedSymplecticHom : +@[expose] def reducedSymplecticHom : IntegralSymplecticGroup →* ModTwoSymplecticGroup where toFun g := ⟨(g.1 : Matrix SymplecticIndex SymplecticIndex ℤ).map @@ -66,7 +66,7 @@ def reducedSymplecticHom : /-- Evaluation of matrix reduction. Paper: §2. -/ @[simp] theorem reducedSymplecticHom_coe (g : IntegralSymplecticGroup) : (reducedSymplecticHom g : Matrix SymplecticIndex SymplecticIndex (ZMod 2)) = - reducedMatrixHom g := rfl + reducedMatrixHom g := by rfl instance : DistribMulAction ModTwoSymplecticGroup ModTwoSpace := DistribMulAction.compHom ModTwoSpace @@ -77,7 +77,7 @@ instance : DistribMulAction ModTwoSymplecticGroup ModTwoSpace := /-- The `modTwoBasis` construction used in the Connes rigidity formalization. -/ -def modTwoBasis (i : SymplecticIndex) : ModTwoSpace := +@[expose] def modTwoBasis (i : SymplecticIndex) : ModTwoSpace := Pi.single i 1 /-- The source-shaped quadratic cocycle. Paper: §2. @@ -122,6 +122,7 @@ theorem modTwoSymplecticForm_add_right (x y z : ModTwoSpace) : /-- The `quadraticDefectLinear` construction used in the Connes rigidity formalization. -/ +@[expose] def quadraticDefectLinear (g : ModTwoSymplecticGroup) : ModTwoSpace →ₗ[ZMod 2] ZMod 2 where toFun w := standardQuadraticForm (g⁻¹ • w) + standardQuadraticForm w @@ -164,6 +165,7 @@ def quadraticDefectLinear (g : ModTwoSymplecticGroup) : /-- The pairing functional associated to a finite vector. Paper: §2. -/ +@[expose] def symplecticFunctional (d : ModTwoSpace) : ModTwoSpace →ₗ[ZMod 2] ZMod 2 where toFun w := modTwoSymplecticForm d w @@ -254,7 +256,7 @@ def integralQuadraticCocycle (g : IntegralSymplecticGroup) : ModTwoSpace := /- Reduction and integral actions agree on the finite carrier. Paper: §2. -/ theorem reducedSymplecticHom_smul (g : IntegralSymplecticGroup) (w : ModTwoSpace) : - reducedSymplecticHom g • w = g • w := rfl + reducedSymplecticHom g • w = g • w := by rfl /- The integral cocycle has the quadratic defining identity. Paper: §2. -/ theorem integralQuadraticCocycle_defining_identity diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/BinaryPontryaginDual.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/BinaryPontryaginDual.lean index 847aa647a7..18907f66b5 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/BinaryPontryaginDual.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/BinaryPontryaginDual.lean @@ -21,7 +21,7 @@ import Mathlib.Algebra.Module.StablyFree.Basic The binary pontryagin dual component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace BinaryPontryaginDual @@ -58,11 +58,11 @@ def binaryRootsEquiv : Multiplicative F ≃* rootsOfUnity 2 Circle := @[simp] theorem binaryRootsEquiv_apply (a : F) : binaryRootsEquiv (Multiplicative.ofAdd a) = - ZMod.rootsOfUnityAddChar 2 a := rfl + ZMod.rootsOfUnityAddChar 2 a := by rfl @[simp] theorem binaryRootsEquiv_val (a : Multiplicative F) : ((binaryRootsEquiv a).val : Circle) = - ZMod.toCircle (Multiplicative.toAdd a) := rfl + ZMod.toCircle (Multiplicative.toAdd a) := by rfl /-- Binary characters have order dividing two. Paper: §3. -/ theorem character_sq (M : Type*) [AddCommGroup M] [Module F M] @@ -122,6 +122,7 @@ def characterAdd {M : Type*} [AddCommGroup M] [Module F M] /-- The linear form underlying a Pontryagin character. Paper: §3. -/ +@[expose] def characterLinear {M : Type*} [AddCommGroup M] [Module F M] [TopologicalSpace M] (χ : PontryaginDual (Multiplicative M)) : M →ₗ[F] F := @@ -263,7 +264,7 @@ def continuousBinaryBidualEvaluation (M : Type*) [AddCommGroup M] [Module F M] : (M : Type*) [AddCommGroup M] [Module F M] (m : M) (ℓ : M →ₗ[F] F) : (continuousBinaryBidualEvaluation M m : - (M →ₗ[F] F) →ₗ[F] F) ℓ = ℓ m := rfl + (M →ₗ[F] F) →ₗ[F] F) ℓ = ℓ m := by rfl /-- The binary Pontryagin dual of a linear dual is its evaluation module. Paper: §3. -/ @@ -286,7 +287,7 @@ def pointwiseEvaluationCharacter (M : Type*) [AddCommGroup M] [Module F M] (m : M) (ℓ : M →ₗ[F] F) : pointwiseEvaluationCharacter M m (Multiplicative.ofAdd ℓ) = - ZMod.toCircle (ℓ m) := rfl + ZMod.toCircle (ℓ m) := by rfl /-- The `pointwiseEvaluationHom` construction used in the Connes rigidity formalization. @@ -347,7 +348,7 @@ def pointwisePontryaginDualEquiv @[simp] theorem pointwisePontryaginDualEquiv_symm_apply (M : Type*) [AddCommGroup M] [Module F M] (m : M) : - (pointwisePontryaginDualEquiv M).symm m = pointwiseEvaluationHom M m := rfl + (pointwisePontryaginDualEquiv M).symm m = pointwiseEvaluationHom M m := by rfl @[simp] theorem pointwisePontryaginDualEquiv_apply_character (M : Type*) [AddCommGroup M] [Module F M] diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProduct.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProduct.lean index e62fdb79ef..3631e8d4cd 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProduct.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProduct.lean @@ -21,7 +21,7 @@ public import LeanPool.ConnesRigidity.Core The crossed product component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace CrossedProduct @@ -94,7 +94,7 @@ def refl (X : HaarProbabilityAction K Ω) : EquivariantHaarEquiv X X where /-- Equivariant Haar equivalences are closed under inverse. Paper: §3. -/ -def symm +@[expose] def symm {X : HaarProbabilityAction K Ω} {Y : HaarProbabilityAction K Ξ} (e : EquivariantHaarEquiv X Y) : @@ -219,7 +219,7 @@ def crossedFiberwiseOperator {K : Type u} {H : Type v} [NormedAddCommGroup H] [NormedSpace ℂ H] (T : H →L[ℂ] H) (ξ : lp (fun _ : K ↦ H) 2) (k : K) : - crossedFiberwiseOperator T ξ k = T (ξ k) := rfl + crossedFiberwiseOperator T ξ k = T (ξ k) := by rfl /-- Base multipliers are lifted fiberwise to the crossed Hilbert space. Paper: §3. @@ -237,12 +237,12 @@ def crossedMultiplier [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) (f : crossedCoefficient X) (ξ : crossedHilbert X) (k : K) : - crossedMultiplier X f ξ k = crossedBaseMultiplier X f (ξ k) := rfl + crossedMultiplier X f ξ k = crossedBaseMultiplier X f (ξ k) := by rfl /-- A fiberwise linear isometry is lifted to the crossed Hilbert space. Paper: §3. -/ -def crossedFiberwiseEquiv +@[expose] def crossedFiberwiseEquiv {K : Type u} {H : Type v} {J : Type w} [NormedAddCommGroup H] [NormedSpace ℂ H] [NormedAddCommGroup J] [NormedSpace ℂ J] @@ -293,7 +293,7 @@ def crossedFiberwiseEquiv [NormedAddCommGroup H] [NormedSpace ℂ H] [NormedAddCommGroup J] [NormedSpace ℂ J] (e : H ≃ₗᵢ[ℂ] J) (ξ : lp (fun _ : K ↦ H) 2) (k : K) : - crossedFiberwiseEquiv e ξ k = e (ξ k) := rfl + crossedFiberwiseEquiv e ξ k = e (ξ k) := by rfl /-- The crossed Hilbert space reindexes under a group equivalence. Paper: §3. -/ @@ -334,12 +334,12 @@ def crossedIndexEquiv {K : Type u} {H : Type v} [NormedAddCommGroup H] [NormedSpace ℂ H] (e : K ≃ K) (ξ : lp (fun _ : K ↦ H) 2) (k : K) : - crossedIndexEquiv e ξ k = ξ (e.symm k) := rfl + crossedIndexEquiv e ξ k = ξ (e.symm k) := by rfl /-- The base Haar equivalence acts fiberwise on the crossed Hilbert space. Paper: §3. -/ -def crossedBaseHaarEquiv +@[expose] def crossedBaseHaarEquiv {K : Type u} {Ω : Type v} {Ξ : Type w} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] [AddCommGroup Ξ] [TopologicalSpace Ξ] [MeasurableSpace Ξ] @@ -390,12 +390,12 @@ def crossedBaseHaarEquiv (e : EquivariantHaarEquiv X Y) (f : crossedBaseHilbert X) : crossedBaseHaarEquiv e f = Lp.compMeasurePreserving e.toMeasurableEquiv.symm - (EquivariantHaarEquiv.symm e).measure_preserving f := rfl + (EquivariantHaarEquiv.symm e).measure_preserving f := by rfl /-- The crossed-product group unitary implements the action on the base. Paper: §3. -/ -def crossedActionL2Equiv +@[expose] def crossedActionL2Equiv {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) (k : K) : @@ -441,12 +441,12 @@ def crossedActionL2Equiv (f : crossedBaseHilbert X) : crossedActionL2Equiv X k f = Lp.compMeasurePreserving (X.action k⁻¹) - (X.action_preserves_measure k⁻¹) f := rfl + (X.action_preserves_measure k⁻¹) f := by rfl /-- The crossed-product group unitary on the indexed Hilbert space. Paper: §3. -/ -def crossedGroupUnitary +@[expose] def crossedGroupUnitary {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) (k : K) : @@ -460,7 +460,7 @@ def crossedGroupUnitary (X : HaarProbabilityAction K Ω) (k : K) (ξ : crossedHilbert X) (h : K) : crossedGroupUnitary X k ξ h = - crossedActionL2Equiv X k (ξ (k⁻¹ * h)) := rfl + crossedActionL2Equiv X k (ξ (k⁻¹ * h)) := by rfl /-- The standard two-family crossed-product generator set. Paper: §3. @@ -477,7 +477,7 @@ def crossedGeneratorSet /-- The crossed-product vacuum is the constant base vector at the identity. Paper: §3. -/ -def crossedVacuum +@[expose] def crossedVacuum {K : Type u} {Ω : Type v} [Group K] [AddCommGroup Ω] [TopologicalSpace Ω] [MeasurableSpace Ω] (X : HaarProbabilityAction K Ω) : crossedHilbert X := by diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductFactorTransport.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductFactorTransport.lean index be2a01656e..19deb168ef 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductFactorTransport.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductFactorTransport.lean @@ -27,7 +27,7 @@ measure-preserving homeomorphism transports that closure. The homeomorphism is not required to preserve the addition on either compact group. -/ -@[expose] public section +public section namespace Connes namespace CrossedProduct diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductTransport.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductTransport.lean index ebaa6be6d1..57408bbe10 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductTransport.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/CrossedProductTransport.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Foundation.OperatorAlgebra.CrossedProduct The crossed product transport component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace CrossedProduct @@ -39,6 +39,7 @@ variable {Ξ : Type w} [AddCommGroup Ξ] [TopologicalSpace Ξ] [MeasurableSpace /-- The `crossedHaarHilbertEquiv` construction used in the Connes rigidity formalization. -/ +@[expose] def crossedHaarHilbertEquiv {X : HaarProbabilityAction K Ω} {Y : HaarProbabilityAction K Ξ} @@ -51,7 +52,7 @@ def crossedHaarHilbertEquiv {Y : HaarProbabilityAction K Ξ} (e : EquivariantHaarEquiv X Y) (ξ : crossedHilbert X) (k : K) : - crossedHaarHilbertEquiv e ξ k = crossedBaseHaarEquiv e (ξ k) := rfl + crossedHaarHilbertEquiv e ξ k = crossedBaseHaarEquiv e (ξ k) := by rfl /- Constant one is preserved by measure-preserving base transport. Paper: §3. -/ diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FactorWitness.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FactorWitness.lean index a83ef1df2b..435649c803 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FactorWitness.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FactorWitness.lean @@ -20,7 +20,7 @@ public import LeanPool.ConnesRigidity.Core The factor witness component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace FactorWitness diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FiniteIndex.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FiniteIndex.lean index 24d218519f..a6070c790b 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FiniteIndex.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FiniteIndex.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Core The finite index component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace OpenAIPort @@ -28,6 +28,7 @@ universe u v open scoped ENNReal /-- Countable discrete subgroup wrapper. Paper: §4. -/ +@[expose] def CountableDiscreteGroup.subgroup (G : CountableDiscreteGroup.{u}) (S : Subgroup G) : CountableDiscreteGroup.{u} where @@ -59,7 +60,7 @@ noncomputable def correction (g : G) (q : G ⧸ S) : S := @[simp] theorem correction_coe (g : G) (q : G ⧸ S) : (correction S g q : G) = (Quotient.out (g • q))⁻¹ * g * Quotient.out q := - rfl + by rfl /-- Multiplicativity of the correction cocycle. Paper: §4. -/ theorem correction_mul (g h : G) (q : G ⧸ S) : @@ -170,7 +171,7 @@ noncomputable def inducedRepresentation InducedSpace (H := H) S →L[ℂ] InducedSpace (H := H) S) ξ q = (π (correction S g (g⁻¹ • q)) : H →L[ℂ] H) (ξ (g⁻¹ • q)) := - rfl + by rfl omit [InnerProductSpace ℂ H] [CompleteSpace H] in /-- Sum-of-coordinate norm bound for the induced space. Paper: §4. -/ diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FinitePropertyT.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FinitePropertyT.lean index a8f09aaaf7..b8fcdf9a04 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FinitePropertyT.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/FinitePropertyT.lean @@ -18,7 +18,7 @@ public import Mathlib.RepresentationTheory.Invariants The finite property t component of the Connes rigidity formalization. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalFixed.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalFixed.lean index da438e8874..df21d6837d 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalFixed.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalFixed.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Core The normal fixed component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes @@ -30,6 +30,7 @@ variable {G : Type u} [Group G] {K : Type v} [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] /-- Vectors fixed by a subgroup under a unitary representation. Paper: §4. -/ +@[expose] def normalFixedSubmodule (N : Subgroup G) (π : UnitaryRepresentation G K) : Submodule ℂ K where carrier := {x : K | ∀ n : N, (π (n : G) : K →L[ℂ] K) x = x} @@ -170,7 +171,7 @@ def normalFixedRepresentation : (g : G) (x : normalFixedSubmodule N π) : ((normalFixedRepresentation N π g : normalFixedSubmodule N π →L[ℂ] normalFixedSubmodule N π) x : K) = - (π g : K →L[ℂ] K) (x : K) := rfl + (π g : K →L[ℂ] K) (x : K) := by rfl theorem normalFixedRepresentation_apply_eq_one (n : G) (hn : n ∈ N) : normalFixedRepresentation N π n = 1 := by @@ -191,12 +192,13 @@ theorem normalFixedQuotientRepresentation_apply_mk (g : G) (x : normalFixedSubmodule N π) : ((normalFixedQuotientRepresentation N π (QuotientGroup.mk' N g) : normalFixedSubmodule N π →L[ℂ] normalFixedSubmodule N π) x : K) = - (π g : K →L[ℂ] K) (x : K) := rfl + (π g : K →L[ℂ] K) (x : K) := by rfl /-- The `normalFixedOrthogonalLinearIsometryEquiv` construction used in the Connes rigidity formalization. -/ +@[expose] def normalFixedOrthogonalLinearIsometryEquiv (g : G) : (normalFixedSubmodule N π)ᗮ ≃ₗᵢ[ℂ] (normalFixedSubmodule N π)ᗮ where @@ -223,6 +225,7 @@ def normalFixedOrthogonalLinearIsometryEquiv (g : G) : norm_map' x := Unitary.norm_map (π g) (x : K) /-- The restricted representation on the orthogonal complement. Paper: §4. -/ +@[expose] def normalFixedOrthogonalRepresentation : UnitaryRepresentation G ((normalFixedSubmodule N π)ᗮ) where toFun g := Unitary.linearIsometryEquiv.symm @@ -249,7 +252,7 @@ def normalFixedOrthogonalRepresentation : ((normalFixedOrthogonalRepresentation N π g : (normalFixedSubmodule N π)ᗮ →L[ℂ] (normalFixedSubmodule N π)ᗮ) x : K) = - (π g : K →L[ℂ] K) (x : K) := rfl + (π g : K →L[ℂ] K) (x : K) := by rfl theorem normalFixedOrthogonalRepresentation_no_fixed (x : (normalFixedSubmodule N π)ᗮ) diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean index fd62676776..2457d5c709 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean @@ -19,7 +19,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.Basic The normalized haar component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace NormalizedHaar @@ -111,7 +111,7 @@ theorem skew_add_translation_measurePreserving abel /-- Product probability Haar measure for two compact additive groups. Paper: §3. -/ -def productHaar +@[expose] def productHaar (P : Type u) (Q : Type v) [AddGroup P] [AddGroup Q] [TopologicalSpace P] [TopologicalSpace Q] diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean index aadf06da5c..68f1b5dbfe 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean @@ -36,7 +36,7 @@ import Mathlib.Topology.Order.Hom.Esakia The positive spectral measure component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/Supremum.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/Supremum.lean index 4505ce3ff2..c40f7ecd28 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/Supremum.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/Supremum.lean @@ -27,7 +27,7 @@ star-algebra equivalences. It supplies the normality witness consumed by the spatial factor equivalence in Zhou §3. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean index 13ee069271..4ca7e8aeff 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean @@ -20,7 +20,7 @@ public import LeanPool.ConnesRigidity.Foundation.OperatorAlgebra.NormalFixed The valued spectral measure component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean index e48d94b78e..bfa6d53005 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean @@ -20,7 +20,7 @@ import LeanPool.ConnesRigidity.Porting.CoreTransfer The property t transfer component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectClosure.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectClosure.lean index d87c2b349f..e75065af41 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectClosure.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectClosure.lean @@ -19,7 +19,7 @@ public import LeanPool.ConnesRigidity.Core The semidirect closure component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectFubini.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectFubini.lean index 8a9f76c747..f34457d9a0 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectFubini.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectFubini.lean @@ -21,7 +21,7 @@ import Mathlib.Topology.Separation.CompletelyRegular The semidirect fubini component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace SemidirectFubini @@ -123,11 +123,11 @@ def l2Curry (ι : Type u) (κ : Type v) : @[simp] theorem l2Curry_apply {ι : Type u} {κ : Type v} (ξ : GroupL2 (ι × κ)) (i : ι) (k : κ) : - l2Curry ι κ ξ i k = ξ (i, k) := rfl + l2Curry ι κ ξ i k = ξ (i, k) := by rfl @[simp] theorem l2Curry_symm_apply {ι : Type u} {κ : Type v} (ξ : lp (fun _ : ι => GroupL2 κ) 2) (i : ι) (k : κ) : - (l2Curry ι κ).symm ξ (i, k) = ξ i k := rfl + (l2Curry ι κ).symm ξ (i, k) = ξ i k := by rfl variable {A : Type u} {K : Type v} [Group A] [Group K] @@ -140,7 +140,7 @@ def semidirectFubiniCoordinates (φ : K →* MulAut A) : @[simp] theorem semidirectFubiniCoordinates_apply (φ : K →* MulAut A) (g : SemidirectProduct A K φ) : - semidirectFubiniCoordinates φ g = (g.right, g.left) := rfl + semidirectFubiniCoordinates φ g = (g.right, g.left) := by rfl /-- The semidirect-product ℓ² carrier in fibre coordinates. Ported from the public OpenAI construction, then kept local to Zhou's §3 model. @@ -154,14 +154,14 @@ def semidirectFubini (φ : K →* MulAut A) : (φ : K →* MulAut A) (ξ : GroupL2 (SemidirectProduct A K φ)) (k : K) (a : A) : semidirectFubini φ ξ k a = - ξ (⟨a, k⟩ : SemidirectProduct A K φ) := rfl + ξ (⟨a, k⟩ : SemidirectProduct A K φ) := by rfl @[simp] theorem semidirectFubini_symm_apply (φ : K →* MulAut A) (ξ : lp (fun _ : K => GroupL2 A) 2) (a : A) (k : K) : (semidirectFubini φ).symm ξ (⟨a, k⟩ : SemidirectProduct A K φ) = - ξ k a := rfl + ξ k a := by rfl /- Regular translation in fibre coordinates. This is the key carrier bridge for the inl and inr generator calculations. Paper: §3. -/ diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectGeneratorTransport.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectGeneratorTransport.lean index e0d33e39f0..ffa98116ff 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectGeneratorTransport.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SemidirectGeneratorTransport.lean @@ -20,7 +20,7 @@ import LeanPool.ConnesRigidity.Foundation.OperatorAlgebra.SemidirectClosure The semidirect generator transport component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace SemidirectGeneratorTransport diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralCriterion.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralCriterion.lean index 825cdef388..75a2690808 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralCriterion.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralCriterion.lean @@ -23,7 +23,7 @@ public import LeanPool.ConnesRigidity.Foundation.GroupTheory.SplitAbelianExtensi The spectral criterion component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes @@ -95,7 +95,7 @@ theorem measurable_dualCharacterAction /-- Invariant probability measure for the dual action, whose measurability is recorded by `measurable_dualCharacterAction`. Paper: §4. -/ -def IsInvariantSpectralMeasure +@[expose] def IsInvariantSpectralMeasure (action : H →* Multiplicative (AddAut A)) (μ : ProbabilityMeasure (DiscreteCharacterSpace A)) : Prop := ∀ h : H, @@ -103,7 +103,7 @@ def IsInvariantSpectralMeasure (dualCharacterAction action h) = μ /-- Mass of the trivial character. Paper: §4. -/ -def spectralTrivialAtom +@[expose] def spectralTrivialAtom (μ : ProbabilityMeasure (DiscreteCharacterSpace A)) : ℝ := (μ : Measure (DiscreteCharacterSpace A)).real {1} @@ -134,7 +134,7 @@ omit [MeasurableSpace (DiscreteCharacterSpace A)] @[simp] theorem spectralEnergyTest_apply (a : A) (χ : DiscreteCharacterSpace A) : spectralEnergyTest a χ = - ‖((χ (Multiplicative.ofAdd a) : Circle) : ℂ) - 1‖ ^ 2 := rfl + ‖((χ (Multiplicative.ofAdd a) : Circle) : ℂ) - 1‖ ^ 2 := by rfl omit [DiscreteTopology A] in /-- The spectral displacement integrand is integrable against every probability measure. -/ @@ -157,7 +157,7 @@ theorem integrable_spectralEnergyTest /-- Spectral displacement energy of a kernel element. Its integrand is integrable by `integrable_spectralEnergyTest`. Paper: §4. -/ -def spectralDetectionEnergy +@[expose] def spectralDetectionEnergy (μ : ProbabilityMeasure (DiscreteCharacterSpace A)) (a : A) : ℝ := ∫ χ : DiscreteCharacterSpace A, ‖((χ (Multiplicative.ofAdd a) : Circle) : ℂ) - 1‖ ^ 2 diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralDetection.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralDetection.lean index 5ea859d08e..ac724e672f 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralDetection.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/SpectralDetection.lean @@ -20,7 +20,7 @@ import Mathlib.Algebra.Order.Ring.Star The spectral detection component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Main.lean b/LeanPool/ConnesRigidity/Main.lean index a185bb0aa9..00ddb8765b 100644 --- a/LeanPool/ConnesRigidity/Main.lean +++ b/LeanPool/ConnesRigidity/Main.lean @@ -17,7 +17,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc Completion boundary for Zhou's Theorem A. -/ -@[expose] public section +public section namespace Connes diff --git a/LeanPool/ConnesRigidity/Paper/Section3.lean b/LeanPool/ConnesRigidity/Paper/Section3.lean index 76cbf2cc3b..c2aaa0427f 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3.lean @@ -16,4 +16,4 @@ The section endpoint constructs the compact-dual shear, its crossed-product implementation, and the resulting trace-preserving factor equivalence. -/ -@[expose] public section +public section diff --git a/LeanPool/ConnesRigidity/Paper/Section3/CrossedAction.lean b/LeanPool/ConnesRigidity/Paper/Section3/CrossedAction.lean index 7aad1c599d..f93f6331a4 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/CrossedAction.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/CrossedAction.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Paper.Section3.DualActions The crossed action component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperCrossedAction diff --git a/LeanPool/ConnesRigidity/Paper/Section3/CrossedHaar.lean b/LeanPool/ConnesRigidity/Paper/Section3/CrossedHaar.lean index f51020004d..49f97da185 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/CrossedHaar.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/CrossedHaar.lean @@ -20,7 +20,7 @@ import LeanPool.ConnesRigidity.Paper.Section3.DualActionConjugacy The crossed haar component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperCrossedHaar @@ -161,7 +161,7 @@ def paperHaarHomeomorph : /-- Zhou's fiber shear is an equivariant Haar equivalence between the two crossed-product bases. Paper: §3. -/ -def paperHaarEquiv : +@[expose] def paperHaarEquiv : EquivariantHaarEquiv paperHaarActionOne paperHaarActionTwo := paperHaarHomeomorph.toEquivariantHaarEquiv diff --git a/LeanPool/ConnesRigidity/Paper/Section3/CrossedKernel.lean b/LeanPool/ConnesRigidity/Paper/Section3/CrossedKernel.lean index 7fb0dd4e94..4960b1e4d0 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/CrossedKernel.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/CrossedKernel.lean @@ -17,7 +17,7 @@ public import LeanPool.ConnesRigidity.Paper.Section3.CrossedHaar The crossed kernel component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperCrossedKernel @@ -83,7 +83,7 @@ local instance paperMultiplicativeDDecidableEq : /-- The `coordinateComplexCharacter` construction used in the Connes rigidity formalization. -/ -def coordinateComplexCharacter (d : D) : C(Coordinates, ℂ) where +@[expose] def coordinateComplexCharacter (d : D) : C(Coordinates, ℂ) where toFun p := complexCharacter d (characterCoordinatesHomeomorph.symm p) continuous_toFun := (complexCharacter d).continuous.comp characterCoordinatesHomeomorph.symm.continuous diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacy.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacy.lean index e22844e021..2ef2759420 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacy.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacy.lean @@ -22,7 +22,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc The dual action conjugacy component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualActionConjugacy diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyAlgebra.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyAlgebra.lean index 181a3f1a05..71ae1f50f4 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyAlgebra.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyAlgebra.lean @@ -21,7 +21,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc The dual action conjugacy algebra component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualActionConjugacyAlgebra diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyCoordinates.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyCoordinates.lean index 726fa8fe85..ceb2beefa0 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyCoordinates.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyCoordinates.lean @@ -21,7 +21,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc The dual action conjugacy coordinates component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualActionConjugacyCoordinates diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyFirst.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyFirst.lean index bcac5679b2..f6426552e6 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyFirst.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyFirst.lean @@ -20,7 +20,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc The dual action conjugacy first component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualActionConjugacyFirst diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyQuadratic.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyQuadratic.lean index 253d070d8a..95c142b59e 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyQuadratic.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualActionConjugacyQuadratic.lean @@ -19,7 +19,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc The dual action conjugacy quadratic component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualActionConjugacyQuadratic diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualActions.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualActions.lean index fc560d01a0..b87fa446b4 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualActions.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualActions.lean @@ -22,7 +22,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc The dual actions component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualActions @@ -56,7 +56,7 @@ abbrev Coordinates := PaperFactorIsomorphism.DualCoordinates /-- Precomposition by the inverse is the contragredient of a kernel automorphism. Paper: §3. -/ -def dualPrecomp (e : D ≃ₗ[k] D) : Dual ≃ₗ[k] Dual where +@[expose] def dualPrecomp (e : D ≃ₗ[k] D) : Dual ≃ₗ[k] Dual where toFun ℓ := ℓ.comp (e⁻¹).toLinearMap invFun ℓ := ℓ.comp e.toLinearMap left_inv ℓ := by @@ -81,7 +81,7 @@ def dualPrecomp (e : D ≃ₗ[k] D) : Dual ≃ₗ[k] Dual where /-- Contragredient action associated to a homomorphism of kernel actions. Paper: §§3--4. -/ -def dualPrecompHom (theta : H →* (D ≃ₗ[k] D)) : +@[expose] def dualPrecompHom (theta : H →* (D ≃ₗ[k] D)) : H →* (Dual ≃ₗ[k] Dual) where toFun h := dualPrecomp (theta h) map_one' := by @@ -102,16 +102,16 @@ def dualPrecompHom (theta : H →* (D ≃ₗ[k] D)) : dualPrecompHom theta h ℓ d = ℓ ((theta h)⁻¹ d) := rfl /-- The first actual Zhou contragredient action on the full dual. Paper: §3. -/ -def paperDualActionOne : H →* (Dual ≃ₗ[k] Dual) := +@[expose] def paperDualActionOne : H →* (Dual ≃ₗ[k] Dual) := dualPrecompHom PaperKernel.paperThetaOneLinearHom /-- The second actual Zhou contragredient action on the full dual. Paper: §3. -/ -def paperDualActionTwo : H →* (Dual ≃ₗ[k] Dual) := +@[expose] def paperDualActionTwo : H →* (Dual ≃ₗ[k] Dual) := dualPrecompHom PaperKernel.paperThetaTwoLinearHom /-- Transport a full-dual additive equivalence to Zhou's raw coordinates. Paper: §3. -/ -def coordinateAction (dualAction : H →* (Dual ≃ₗ[k] Dual)) (h : H) : +@[expose] def coordinateAction (dualAction : H →* (Dual ≃ₗ[k] Dual)) (h : H) : Coordinates ≃+ Coordinates := PaperDualCoordinates.dualEquiv.toAddEquiv.symm.trans ((dualAction h).toAddEquiv.trans diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualAutomorphism.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualAutomorphism.lean index 54313a0ec3..673f398045 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualAutomorphism.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualAutomorphism.lean @@ -17,7 +17,7 @@ and proves continuity and Haar preservation. It is the common §3 input for the crossed-action conjugacy and the §4 spectral detector. -/ -@[expose] public section +public section namespace Connes namespace PaperDualAutomorphism @@ -42,7 +42,7 @@ abbrev CharacterSpace := PaperDualTopology.CharacterSpace /-- The `continuousMulAut` construction used in the Connes rigidity formalization. -/ -def continuousMulAut (e : AddAut D) : +@[expose] def continuousMulAut (e : AddAut D) : Multiplicative D →ₜ* Multiplicative D where toFun x := Multiplicative.ofAdd (e x.toAdd) map_one' := by simp diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean index e7bafa2c03..25b3e641d9 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Algebra.ZMod The dual coordinates component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualCoordinates @@ -68,6 +68,7 @@ noncomputable def vStarDualEquiv : Module.Dual k VStar ≃ₗ[k] V := /-- The `transposeToDual` construction used in the Connes rigidity formalization. -/ +@[expose] def transposeToDual : (A →ₗ[k] V) →ₗ[k] (VStar →ₗ[k] Module.Dual k A) where toFun f := @@ -83,7 +84,7 @@ def transposeToDual : (A →ₗ[k] V) →ₗ[k] /-- The `transposeFromDual` construction used in the Connes rigidity formalization. -/ -def transposeFromDual : (VStar →ₗ[k] Module.Dual k A) →ₗ[k] +@[expose] def transposeFromDual : (VStar →ₗ[k] Module.Dual k A) →ₗ[k] (A →ₗ[k] V) where toFun g := { toFun := fun a => @@ -136,6 +137,7 @@ theorem transposeFromDual_right_inverse /-- The `transposeEquiv` construction used in the Connes rigidity formalization. -/ +@[expose] noncomputable def transposeEquiv : (A →ₗ[k] V) ≃ₗ[k] (VStar →ₗ[k] Module.Dual k A) := LinearEquiv.ofLinearMap transposeToDual transposeFromDual @@ -145,6 +147,7 @@ noncomputable def transposeEquiv : (A →ₗ[k] V) ≃ₗ[k] /-- The `dualTensorToPartial` construction used in the Connes rigidity formalization. -/ +@[expose] def dualTensorToPartial : Module.Dual k AVStar →ₗ[k] (VStar →ₗ[k] Module.Dual k A) where toFun f := @@ -211,6 +214,7 @@ theorem partialToDual_right_inverse /-- The `dualTensorPartialEquiv` construction used in the Connes rigidity formalization. -/ +@[expose] noncomputable def dualTensorPartialEquiv : Module.Dual k AVStar ≃ₗ[k] (VStar →ₗ[k] Module.Dual k A) := LinearEquiv.ofLinearMap dualTensorToPartial partialToDual @@ -220,6 +224,7 @@ noncomputable def dualTensorPartialEquiv : Module.Dual k AVStar ≃ₗ[k] /-- The `avDualEquiv` construction used in the Connes rigidity formalization. -/ +@[expose] noncomputable def avDualEquiv : Module.Dual k AVStar ≃ₗ[k] A →ₗ[k] V := dualTensorPartialEquiv.trans transposeEquiv.symm @@ -228,7 +233,7 @@ noncomputable def avDualEquiv : Module.Dual k AVStar ≃ₗ[k] A →ₗ[k] V := /-- The `dualEquiv` construction used in the Connes rigidity formalization. -/ -noncomputable def dualEquiv : Module.Dual k D ≃ₗ[k] DualCoordinates := +@[expose] noncomputable def dualEquiv : Module.Dual k D ≃ₗ[k] DualCoordinates := (Module.dualProdDualEquivDual k AVStar C).symm.trans (avDualEquiv.prodCongr (LinearEquiv.refl k (C →ₗ[k] k))) diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualHaar.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualHaar.lean index 07e869024a..01ae1b3c9d 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualHaar.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualHaar.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Paper.Section3.DualCoordinates The dual haar component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualHaar @@ -59,7 +59,7 @@ noncomputable instance paperCharacterMeasurableSpace : instance paperCharacterBorelSpace : BorelSpace PaperCharacterSpace := ⟨rfl⟩ /-- The normalized Haar probability on the actual character space. Paper: §3. -/ -noncomputable def paperCharacterHaar : Measure PaperCharacterSpace := +@[expose] noncomputable def paperCharacterHaar : Measure PaperCharacterSpace := NormalizedHaar.normalizedAddHaar PaperCharacterSpace /-- The normalized dual Haar measure is a probability measure. Paper: §3. -/ @@ -75,6 +75,7 @@ instance paperCharacterHaar_isAddHaar : infer_instance /-- A binary linear form gives its continuous circle character. Paper: §3. -/ +@[expose] def linearCharacter (ℓ : PaperKernel.D →ₗ[ZMod 2] ZMod 2) : PontryaginDual (Multiplicative PaperKernel.D) := { toMonoidHom := @@ -85,7 +86,7 @@ def linearCharacter (ℓ : PaperKernel.D →ₗ[ZMod 2] ZMod 2) : @[simp] theorem linearCharacter_apply (ℓ : PaperKernel.D →ₗ[ZMod 2] ZMod 2) (x : PaperKernel.D) : - linearCharacter ℓ (Multiplicative.ofAdd x) = ZMod.toCircle (ℓ x) := rfl + linearCharacter ℓ (Multiplicative.ofAdd x) = ZMod.toCircle (ℓ x) := by rfl /-- Character extraction recovers every binary linear form. Paper: §3. -/ theorem characterLinear_linearCharacter @@ -113,6 +114,7 @@ theorem linearCharacter_characterLinear (Multiplicative.toAdd x)) using 1; rfl /-- Character extraction is additive in the binary character group. Paper: §3. -/ +@[expose] def characterToLinear : PaperCharacterSpace →+ Module.Dual (ZMod 2) PaperKernel.D where toFun χ := BinaryPontryaginDual.characterLinear @@ -165,6 +167,7 @@ def linearToCharacter : rw [AddChar.map_add_eq_mul] /-- The actual compact dual is algebraically the full binary linear dual. Paper: §3. -/ +@[expose] def characterLinearEquiv : PaperCharacterSpace ≃+ Module.Dual (ZMod 2) PaperKernel.D := AddEquiv.ofBijective characterToLinear ⟨by @@ -196,7 +199,7 @@ def characterLinearEquiv : exact congrArg (fun f => f x) (characterLinear_linearCharacter ℓ)⟩ /-- The actual Zhou dual coordinates. Paper: §3. -/ -def characterCoordinatesEquiv : +@[expose] def characterCoordinatesEquiv : PaperCharacterSpace ≃+ PaperFactorIsomorphism.DualCoordinates := characterLinearEquiv.trans PaperDualCoordinates.dualEquiv.toAddEquiv diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean index 0a6d04697b..18b02e89ce 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Paper.Section3.DualTopology The dual shear measure component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualShearMeasure @@ -463,14 +463,14 @@ abbrev Coordinates := PaperFactorIsomorphism.DualCoordinates /-- The `coordinateProductEquiv` construction used in the Connes rigidity formalization. -/ -def coordinateProductEquiv : Coordinates ≃+ +@[expose] def coordinateProductEquiv : Coordinates ≃+ (Additive PChar × Additive QChar) := PaperDualHaar.characterCoordinatesEquiv.symm.trans characterProductEquiv /-- The `coordinateProductHomeomorph` construction used in the Connes rigidity formalization. -/ -def coordinateProductHomeomorph : Coordinates ≃ₜ +@[expose] def coordinateProductHomeomorph : Coordinates ≃ₜ (Additive PChar × Additive QChar) := PaperDualTopology.characterCoordinatesHomeomorph.symm.trans characterProductHomeomorph diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean index c44bd46fa9..7573653d68 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Paper.Section3.DualHaar The dual topology component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperDualTopology @@ -245,6 +245,7 @@ Paper: §3. /-- The `characterFiberShearMul` construction used in the Connes rigidity formalization. -/ +@[expose] def characterFiberShearMul (χ : CharacterSpace) : PontryaginDual (Multiplicative D) := PaperDualHaar.linearCharacter (shearedLinear χ) @@ -273,6 +274,7 @@ theorem continuous_characterFiberShearMul : /-- The `characterFiberShear` construction used in the Connes rigidity formalization. -/ +@[expose] def characterFiberShear (χ : CharacterSpace) : CharacterSpace := Additive.ofMul (characterFiberShearMul χ) @@ -406,7 +408,7 @@ theorem measurable_fiberShear : continuous_fiberShear.measurable /-- The normalized Haar probability in raw Zhou coordinates. Paper: §3. -/ -noncomputable def coordinatesHaar : Measure Coordinates := +@[expose] noncomputable def coordinatesHaar : Measure Coordinates := NormalizedHaar.normalizedAddHaar Coordinates instance coordinatesHaar_isProbability : IsProbabilityMeasure coordinatesHaar := by diff --git a/LeanPool/ConnesRigidity/Paper/Section3/FactorClosure.lean b/LeanPool/ConnesRigidity/Paper/Section3/FactorClosure.lean index b6796449f8..ce9dd73af0 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/FactorClosure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/FactorClosure.lean @@ -24,7 +24,7 @@ import Mathlib.Topology.ContinuousMap.StoneWeierstrass The factor closure component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperFactorClosure diff --git a/LeanPool/ConnesRigidity/Paper/Section3/FactorIsomorphism.lean b/LeanPool/ConnesRigidity/Paper/Section3/FactorIsomorphism.lean index 83c25a7bea..9c3d860506 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/FactorIsomorphism.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/FactorIsomorphism.lean @@ -14,7 +14,7 @@ Algebraic part of Zhou §3 for the concrete tensor kernel, including the quadratic fiber shear and its characteristic-two involutivity. -/ -@[expose] public section +public section namespace Connes namespace PaperFactorIsomorphism @@ -55,12 +55,14 @@ abbrev DualCoordinates := (A →ₗ[k] PaperV) × (C →ₗ[k] k) /-- One finite coordinate of a map `A → V`. Paper: §3. -/ +@[expose] def coordinate (z : A →ₗ[k] PaperV) (i : SymplecticIndex) : A →ₗ[k] k where toFun a := z a i map_add' a b := by simp map_smul' r a := by simp /-- Bilinear evaluation on a pure tensor. Paper: §3. -/ +@[expose] def tensorFunctional (f g : A →ₗ[k] k) : TensorAA →ₗ[k] k := TensorProduct.lift { toFun := fun a => @@ -84,7 +86,7 @@ def tensorFunctional (f g : A →ₗ[k] k) : TensorAA →ₗ[k] k := simp [smul_eq_mul, mul_assoc] } /-- Restriction of tensor evaluation to the flip-fixed carrier. Paper: §3. -/ -def tensorFunctionalOnC (f g : A →ₗ[k] k) : C →ₗ[k] k := +@[expose] def tensorFunctionalOnC (f g : A →ₗ[k] k) : C →ₗ[k] k := (tensorFunctional f g).domRestrict C @[simp] theorem tensorFunctionalOnC_diagonal @@ -95,7 +97,7 @@ def tensorFunctionalOnC (f g : A →ₗ[k] k) : C →ₗ[k] k := Construction.PaperKernel.diagonal] /-- Zhou's quadratic functional on the symmetric tensor dual. Paper: §3. -/ -def quadraticMap (z : A →ₗ[k] PaperV) : C →ₗ[k] k := +@[expose] def quadraticMap (z : A →ₗ[k] PaperV) : C →ₗ[k] k := tensorFunctionalOnC (coordinate z (Sum.inl 0)) (coordinate z (Sum.inr 0)) + tensorFunctionalOnC (coordinate z (Sum.inl 1)) (coordinate z (Sum.inr 1)) @@ -105,7 +107,7 @@ def quadraticMap (z : A →ₗ[k] PaperV) : C →ₗ[k] k := simp [quadraticMap, coordinate, OpenAIPort.standardQuadraticForm] /-- The nontrivial fiber shear from Zhou Proposition 3.2. Paper: §3. -/ -def fiberShear : DualCoordinates → DualCoordinates := fun p => +@[expose] def fiberShear : DualCoordinates → DualCoordinates := fun p => (p.1, p.2 + quadraticMap p.1) /-- The characteristic-two cancellation behind the fiber shear. Paper: §3. -/ diff --git a/LeanPool/ConnesRigidity/Paper/Section3/Fourier.lean b/LeanPool/ConnesRigidity/Paper/Section3/Fourier.lean index ddbaa2acc8..1b716dcb3a 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/Fourier.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/Fourier.lean @@ -25,7 +25,7 @@ import Mathlib.Topology.Metrizable.Urysohn The fourier component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperFourier @@ -56,6 +56,7 @@ abbrev CharacterSpace := PaperDualHaar.PaperCharacterSpace /-- The `complexCharacter` construction used in the Connes rigidity formalization. -/ +@[expose] def complexCharacter (d : D) : C(CharacterSpace, ℂ) where toFun χ := (Additive.toMul χ (Multiplicative.ofAdd d) : ℂ) continuous_toFun := by @@ -93,6 +94,7 @@ theorem complexCharacter_separates /-- The `evaluationCharacter` construction used in the Connes rigidity formalization. -/ +@[expose] def evaluationCharacter (d : D) : PontryaginDual (Multiplicative CharacterSpace) where toMonoidHom := @@ -181,7 +183,7 @@ theorem integral_character_eq_zero /-- The `characterL2` construction used in the Connes rigidity formalization. -/ -def characterL2 (d : D) : Lp ℂ 2 paperCharacterHaar := +@[expose] def characterL2 (d : D) : Lp ℂ 2 paperCharacterHaar := ContinuousMap.toLp 2 paperCharacterHaar ℂ (complexCharacter d) /- The compact-dual characters form an orthonormal family. Paper: §3. -/ @@ -312,7 +314,7 @@ def FourierBasis : HilbertBasis D ℂ (Lp ℂ 2 paperCharacterHaar) := /-- The `FourierTransform` construction used in the Connes rigidity formalization. -/ -def FourierTransform : +@[expose] def FourierTransform : lp (fun _ : D => ℂ) 2 ≃ₗᵢ[ℂ] Lp ℂ 2 paperCharacterHaar := FourierBasis.repr.symm diff --git a/LeanPool/ConnesRigidity/Paper/Section3/FourierAction.lean b/LeanPool/ConnesRigidity/Paper/Section3/FourierAction.lean index 3aa762a0ad..272f830a1c 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/FourierAction.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/FourierAction.lean @@ -20,7 +20,7 @@ import LeanPool.ConnesRigidity.Porting.CoreTransfer The fourier action component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperFourierAction diff --git a/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean b/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean index 84e9a098fe..c255493210 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean @@ -18,7 +18,7 @@ import LeanPool.ConnesRigidity.Paper.Section3.DualShearMeasure The fourier coordinates component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperFourierCoordinates diff --git a/LeanPool/ConnesRigidity/Paper/Section3/GroupFactor.lean b/LeanPool/ConnesRigidity/Paper/Section3/GroupFactor.lean index 3c283afb02..bf5a25b529 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/GroupFactor.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/GroupFactor.lean @@ -17,7 +17,7 @@ public import LeanPool.ConnesRigidity.Paper.Section3.CrossedKernel The group factor component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperGroupFactor diff --git a/LeanPool/ConnesRigidity/Paper/Section3/GroupQuotient.lean b/LeanPool/ConnesRigidity/Paper/Section3/GroupQuotient.lean index 45961424a2..94867ad80c 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/GroupQuotient.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/GroupQuotient.lean @@ -18,7 +18,7 @@ import LeanPool.ConnesRigidity.Porting.CoreTransfer The group quotient component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperGroupQuotient diff --git a/LeanPool/ConnesRigidity/Paper/Section3/GroupVacuum.lean b/LeanPool/ConnesRigidity/Paper/Section3/GroupVacuum.lean index 080045789e..99fb6668fe 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/GroupVacuum.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/GroupVacuum.lean @@ -18,7 +18,7 @@ import LeanPool.ConnesRigidity.Paper.Section3.QuotientAction The group vacuum component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperGroupVacuum diff --git a/LeanPool/ConnesRigidity/Paper/Section3/QuotientAction.lean b/LeanPool/ConnesRigidity/Paper/Section3/QuotientAction.lean index a247543749..61735c57f7 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/QuotientAction.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/QuotientAction.lean @@ -19,7 +19,7 @@ import LeanPool.ConnesRigidity.Porting.CoreTransfer The quotient action component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperQuotientAction diff --git a/LeanPool/ConnesRigidity/Paper/Section4.lean b/LeanPool/ConnesRigidity/Paper/Section4.lean index e0c9bf0090..0297291526 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4.lean @@ -17,4 +17,4 @@ The section endpoint combines the `EL₃ = SL₃` bridge, finite extensions, spectral measures, and the concrete finite detector certificates. -/ -@[expose] public section +public section diff --git a/LeanPool/ConnesRigidity/Paper/Section4/AChartDetectorMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section4/AChartDetectorMeasure.lean index 9bf2e96371..9d9986ec3e 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/AChartDetectorMeasure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/AChartDetectorMeasure.lean @@ -15,7 +15,7 @@ Concrete §4 A-coordinate detector transport and invariant-measure bound for Zhou's dual kernel. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperAChartDetectorMeasure @@ -71,7 +71,7 @@ def aCoordinateEmbedding (v : OpenAIPort.SymplecticIndex) : /-- The character's A-coordinate linear functional at one finite dual index. Paper: §4. -/ -def aChartLinear (χ : CharacterSpace) +@[expose] def aChartLinear (χ : CharacterSpace) (v : OpenAIPort.SymplecticIndex) : A →ₗ[k] k := (BinaryPontryaginDual.characterLinear (M := D) (Additive.toMul χ)).comp (aCoordinateEmbedding v) @@ -188,7 +188,7 @@ theorem aChart_support_card_bound (χ : CharacterSpace) /-- The `aDetector` construction used in the Connes rigidity formalization. -/ -def aDetector (v : OpenAIPort.SymplecticIndex) (a : A) : +@[expose] def aDetector (v : OpenAIPort.SymplecticIndex) (a : A) : Set CharacterSpace := linearDetector (aCoordinateEmbedding v a) diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartDetector.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartDetector.lean index 3361f89c9d..a76785a574 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/ChartDetector.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/ChartDetector.lean @@ -14,7 +14,7 @@ import Mathlib.FieldTheory.Finite.Basic Algebraic finite-chart detector spine for Zhou's §4. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperChartDetector @@ -49,7 +49,7 @@ noncomputable instance coeffIndexLinearOrder (N : ℕ) : (finSumFinEquiv : PaperFiniteCharts.CoeffIndex N ≃ Fin (N + N)).injective /-- The symmetric cross term of two vectors. Paper: §4. -/ -def cross (a b : A) : C := +@[expose] def cross (a b : A) : C := ⟨a ⊗ₜ[k] b + b ⊗ₜ[k] a, by change TensorProduct.comm k A A (a ⊗ₜ[k] b + b ⊗ₜ[k] a) = a ⊗ₜ[k] b + b ⊗ₜ[k] a @@ -221,7 +221,7 @@ theorem chartPoint_ofCoefficients_eq_sum (N : ℕ) (s : Fin 3) /-- The `chartEvaluation` construction used in the Connes rigidity formalization. -/ -def chartEvaluation (χ : C →ₗ[k] k) (N : ℕ) (s : Fin 3) +@[expose] def chartEvaluation (χ : C →ₗ[k] k) (N : ℕ) (s : Fin 3) (x : PaperFiniteCharts.CoeffIndex N → F) : F := χ (PaperKernel.diagonal (PaperFiniteCharts.chartPoint N (chartIndexOfCoefficients N s x))) @@ -372,7 +372,7 @@ abbrev ChartEvalIndex (N : ℕ) := /-- The `chartEvalValue` construction used in the Connes rigidity formalization. -/ -def chartEvalValue (χ : C →ₗ[k] k) (N : ℕ) (i : ChartEvalIndex N) : F := +@[expose] def chartEvalValue (χ : C →ₗ[k] k) (N : ℕ) (i : ChartEvalIndex N) : F := chartEvaluation χ N i.1 i.2 /-- diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartDetectorMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartDetectorMeasure.lean index 4c90630ce5..79da51fa5b 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/ChartDetectorMeasure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/ChartDetectorMeasure.lean @@ -17,7 +17,7 @@ Concrete §4 chart detector transport and the invariant-measure bound for Zhou's dual kernel. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperChartDetectorMeasure @@ -131,7 +131,7 @@ def chartLinear (χ : CharacterSpace) : C →ₗ[k] k := /-- The detector set associated with one C-coordinate. Paper: §4. -/ -def chartDetector (c : C) : Set CharacterSpace := +@[expose] def chartDetector (c : C) : Set CharacterSpace := linearDetector (0, c) /-- The C-coordinate agrees with direct character evaluation. Paper: §4. -/ diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartMeasure.lean index afd70a16ad..c61efe5ea5 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/ChartMeasure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/ChartMeasure.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure Invariant dual-measure transport for Zhou's finite chart detector. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperChartMeasure @@ -42,7 +42,7 @@ abbrev CharacterSpace := PaperDualTopology.CharacterSpace /-- The `dualCharacterEquivOfAction` construction used in the Connes rigidity formalization. -/ -def dualCharacterEquivOfAction {H : CountableDiscreteGroup} +@[expose] def dualCharacterEquivOfAction {H : CountableDiscreteGroup} (action : H →* Multiplicative (AddAut D)) (h : H) : CharacterSpace ≃+ CharacterSpace := PaperDualAutomorphism.dualCharacterEquiv @@ -56,7 +56,7 @@ definitionally equal. Paper: §4. /-- The `paperDualCharacterAction` construction used in the Connes rigidity formalization. -/ -def paperDualCharacterAction {H : CountableDiscreteGroup} +@[expose] def paperDualCharacterAction {H : CountableDiscreteGroup} (action : H →* Multiplicative (AddAut D)) (h : H) : CharacterSpace → CharacterSpace := dualCharacterEquivOfAction action h diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartOrbits.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartOrbits.lean index 2c8cd05136..99406586e9 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/ChartOrbits.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/ChartOrbits.lean @@ -17,7 +17,7 @@ import LeanPool.ConnesRigidity.Construction.PaperActionInstances The chart orbits component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperChartOrbits diff --git a/LeanPool/ConnesRigidity/Paper/Section4/ChartSpan.lean b/LeanPool/ConnesRigidity/Paper/Section4/ChartSpan.lean index c40bb5f975..ea3627f986 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/ChartSpan.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/ChartSpan.lean @@ -13,7 +13,7 @@ import LeanPool.ConnesRigidity.Construction.SquareSpan Finite chart span and exhaustion for Zhou's §4 detector. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperChartSpan diff --git a/LeanPool/ConnesRigidity/Paper/Section4/FiniteCharts.lean b/LeanPool/ConnesRigidity/Paper/Section4/FiniteCharts.lean index bbf28dd564..8fb6dd984b 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/FiniteCharts.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/FiniteCharts.lean @@ -17,7 +17,7 @@ import Mathlib.Algebra.Algebra.ZMod The finite charts component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperFiniteCharts @@ -99,13 +99,13 @@ theorem polynomialChart_mono {N M : ℕ} (hNM : N ≤ M) : /-- The cyclic coordinate order used for the three paper charts. Paper: Lemma 4.2. -/ -def next (s : Fin 3) : Fin 3 := +@[expose] def next (s : Fin 3) : Fin 3 := ⟨(s.val + 1) % 3, Nat.mod_lt _ (by decide)⟩ /-- The `nextNext` construction used in the Connes rigidity formalization. -/ -def nextNext (s : Fin 3) : Fin 3 := next (next s) +@[expose] def nextNext (s : Fin 3) : Fin 3 := next (next s) theorem next_ne (s : Fin 3) : next s ≠ s := by fin_cases s <;> decide @@ -118,11 +118,11 @@ theorem next_nextNext_ne (s : Fin 3) : next s ≠ nextNext s := by /-- The standard basis vector in A. Paper: Lemma 4.2. -/ -def basisVector (s : Fin 3) : A := Pi.single s 1 +@[expose] def basisVector (s : Fin 3) : A := Pi.single s 1 /-- A point in one of the three finite charts. Paper: Lemma 4.2. -/ -def chartVector (s : Fin 3) (f h : R) : A := +@[expose] def chartVector (s : Fin 3) (f h : R) : A := basisVector s + f • basisVector (next s) + h • basisVector (nextNext s) /-- @@ -133,13 +133,13 @@ abbrev ChartIndex (N : ℕ) := Fin 3 × (Fin N → F) × (Fin N → F) /-- The `chartPoint` construction used in the Connes rigidity formalization. -/ -def chartPoint (N : ℕ) (i : ChartIndex N) : A := +@[expose] def chartPoint (N : ℕ) (i : ChartIndex N) : A := chartVector i.1 (Polynomial.ofFn N i.2.1) (Polynomial.ofFn N i.2.2) /-- The `chartSquare` construction used in the Connes rigidity formalization. -/ -def chartSquare (N : ℕ) (i : ChartIndex N) : C := +@[expose] def chartSquare (N : ℕ) (i : ChartIndex N) : C := PaperKernel.diagonal (chartPoint N i) /-- The chart span C_N. Paper: Lemma 4.2. @@ -169,7 +169,7 @@ abbrev CoeffIndex (N : ℕ) := Fin N ⊕ Fin N /-- The `coefficientVector` construction used in the Connes rigidity formalization. -/ -def coefficientVector (N : ℕ) (s : Fin 3) : CoeffIndex N → A +@[expose] def coefficientVector (N : ℕ) (s : Fin 3) : CoeffIndex N → A | Sum.inl i => polynomialBasis N i • basisVector (next s) | Sum.inr i => polynomialBasis N i • basisVector (nextNext s) diff --git a/LeanPool/ConnesRigidity/Paper/Section4/FiniteExtensions.lean b/LeanPool/ConnesRigidity/Paper/Section4/FiniteExtensions.lean index 092d03a741..3c7908c0c3 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/FiniteExtensions.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/FiniteExtensions.lean @@ -17,7 +17,7 @@ public import LeanPool.ConnesRigidity.Paper.Section4.PropertyT The finite extensions component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperFiniteExtensions diff --git a/LeanPool/ConnesRigidity/Paper/Section4/FullDetectorMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section4/FullDetectorMeasure.lean index 6d35842bbf..969dfb7208 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/FullDetectorMeasure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/FullDetectorMeasure.lean @@ -11,7 +11,7 @@ public import LeanPool.ConnesRigidity.Paper.Section4.AChartDetectorMeasure Full §4 detector union for Zhou's compact dual. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperFullDetectorMeasure diff --git a/LeanPool/ConnesRigidity/Paper/Section4/PropertyT.lean b/LeanPool/ConnesRigidity/Paper/Section4/PropertyT.lean index cc90185dd5..8aa7d46f4f 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/PropertyT.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/PropertyT.lean @@ -16,7 +16,7 @@ import LeanPool.ConnesRigidity.Porting.CoreTransfer Property-(T) transfer for Zhou §4 on the concrete tensor-kernel groups. -/ -@[expose] public section +public section namespace Connes namespace PaperPropertyT diff --git a/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetector.lean b/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetector.lean index 21de71d8d9..527dd2d5a4 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetector.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetector.lean @@ -12,7 +12,7 @@ The paper-facing spectral-energy form of Zhou's five-detector estimate. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperSpectralDetector @@ -47,20 +47,20 @@ abbrev CharacterSpace := PaperDualHaar.PaperCharacterSpace /-- The `detectorValue` construction used in the Connes rigidity formalization. -/ -def detectorValue (χ : CharacterSpace) (d : D) : k := +@[expose] def detectorValue (χ : CharacterSpace) (d : D) : k := BinaryPontryaginDual.characterLinear (M := D) (Additive.toMul χ) d /-- The squared displacement of a character at one kernel element. Its exact detector-mass value is proved immediately below. Paper: §4. -/ -def spectralEnergy (μ : ProbabilityMeasure CharacterSpace) (d : D) : ℝ := +@[expose] def spectralEnergy (μ : ProbabilityMeasure CharacterSpace) (d : D) : ℝ := ∫ χ : CharacterSpace, ‖((ZMod.toCircle (detectorValue χ d) : Circle) : ℂ) - 1‖ ^ 2 ∂(μ : Measure CharacterSpace) /-- The mass of the trivial character in the additive dual model. Paper: §4. -/ -def trivialAtom (μ : ProbabilityMeasure CharacterSpace) : ℝ := +@[expose] def trivialAtom (μ : ProbabilityMeasure CharacterSpace) : ℝ := (μ : Measure CharacterSpace).real ({0} : Set CharacterSpace) /- Every binary detector value is one of the two field elements. Paper: §4. -/ diff --git a/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean b/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean index 366b0539b0..9c3eab5c6a 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean @@ -13,7 +13,7 @@ Transport of Zhou's compact-dual detector estimate to the raw Pontryagin-dual carrier used by the generic split-extension criterion. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperSpectralDetectorBridge diff --git a/LeanPool/ConnesRigidity/Paper/Section4/SpectralFiniteDetection.lean b/LeanPool/ConnesRigidity/Paper/Section4/SpectralFiniteDetection.lean index 4d805423e5..264af86450 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/SpectralFiniteDetection.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/SpectralFiniteDetection.lean @@ -13,7 +13,7 @@ import LeanPool.ConnesRigidity.Paper.Section4.SpectralDetectorBridge Finite detector sets for the raw Zhou split extensions. Paper: §4. -/ -@[expose] public section +public section namespace Connes namespace PaperSpectralFiniteDetection diff --git a/LeanPool/ConnesRigidity/Paper/Section4/SpectralPropertyT.lean b/LeanPool/ConnesRigidity/Paper/Section4/SpectralPropertyT.lean index 0e838c46cd..5e36929c2c 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/SpectralPropertyT.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/SpectralPropertyT.lean @@ -21,7 +21,7 @@ import LeanPool.ConnesRigidity.Paper.Section4.FiniteExtensions The spectral property t component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperSpectralPropertyT diff --git a/LeanPool/ConnesRigidity/Paper/Section4/SplitExtensions.lean b/LeanPool/ConnesRigidity/Paper/Section4/SplitExtensions.lean index 8952d00141..6831f64edd 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/SplitExtensions.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/SplitExtensions.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Foundation.GroupTheory.SplitAbelianExtensi The split extensions component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperSplitExtensions diff --git a/LeanPool/ConnesRigidity/Paper/Section5.lean b/LeanPool/ConnesRigidity/Paper/Section5.lean index 0204841ad8..28ddc84ee3 100644 --- a/LeanPool/ConnesRigidity/Paper/Section5.lean +++ b/LeanPool/ConnesRigidity/Paper/Section5.lean @@ -16,4 +16,4 @@ The section endpoint supplies the concrete orbit and displacement certificates for the two semidirect products. -/ -@[expose] public section +public section diff --git a/LeanPool/ConnesRigidity/Paper/Section5/ICC.lean b/LeanPool/ConnesRigidity/Paper/Section5/ICC.lean index ef49f28384..08cedc3e82 100644 --- a/LeanPool/ConnesRigidity/Paper/Section5/ICC.lean +++ b/LeanPool/ConnesRigidity/Paper/Section5/ICC.lean @@ -16,7 +16,7 @@ ICC transfer for Zhou §5. Since the acting group is concrete product quotient. -/ -@[expose] public section +public section namespace Connes namespace PaperICC diff --git a/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean b/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean index ffc465e384..4369e6b9bf 100644 --- a/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean +++ b/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean @@ -15,7 +15,7 @@ finite quotient detector is checked by kernel computation over the public finite carrier. Paper: §5. -/ -@[expose] public section +public section namespace Connes namespace PaperICC diff --git a/LeanPool/ConnesRigidity/Paper/Section6.lean b/LeanPool/ConnesRigidity/Paper/Section6.lean index 68e415fa93..605e56df6a 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6.lean @@ -16,4 +16,4 @@ The section endpoint combines characteristic-kernel transport with the concrete nonsplit module obstruction. -/ -@[expose] public section +public section diff --git a/LeanPool/ConnesRigidity/Paper/Section6/Characteristic.lean b/LeanPool/ConnesRigidity/Paper/Section6/Characteristic.lean index 791414db91..607aa2782d 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/Characteristic.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/Characteristic.lean @@ -18,7 +18,7 @@ import Mathlib.CategoryTheory.Category.Init The characteristic component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperCharacteristic diff --git a/LeanPool/ConnesRigidity/Paper/Section6/CharacteristicTransport.lean b/LeanPool/ConnesRigidity/Paper/Section6/CharacteristicTransport.lean index ef2dd0f2a2..9ab6eda812 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/CharacteristicTransport.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/CharacteristicTransport.lean @@ -15,7 +15,7 @@ Zhou-shaped nonisomorphism argument. It is independently written from the cited public mathematical source. -/ -@[expose] public section +public section namespace Connes namespace PaperCharacteristicTransport @@ -47,6 +47,7 @@ abbrev H := S × Q /-- The `kernelSubgroup` construction used in the Connes rigidity formalization. -/ +@[expose] def kernelSubgroup (action : H →* MulAut N) : Subgroup (PaperKernel.paperGammaCarrier action) := (SemidirectProduct.inl (N := N) (G := H) (φ := action)).range diff --git a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean index d39b5975ea..2233625557 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean @@ -20,7 +20,7 @@ import Mathlib.RingTheory.PicardGroup The module semisimple component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperModuleSemisimple diff --git a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimpleTransport.lean b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimpleTransport.lean index ad3aedf3ba..464302f0ea 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimpleTransport.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimpleTransport.lean @@ -13,7 +13,7 @@ Transport the concrete first-module semisimplicity proof into the paper-facing predicate and expose the resulting Section 6 nonisomorphism theorem. -/ -@[expose] public section +public section namespace Connes namespace PaperModuleSemisimpleTransport diff --git a/LeanPool/ConnesRigidity/Paper/Section6/Nonisomorphism.lean b/LeanPool/ConnesRigidity/Paper/Section6/Nonisomorphism.lean index 991d2d5dfe..379e691a8b 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/Nonisomorphism.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/Nonisomorphism.lean @@ -15,7 +15,7 @@ semisimplicity predicates are the concrete `k[Sp₄(F₂)]` modules attached to the two actions from §2. -/ -@[expose] public section +public section namespace Connes namespace PaperNonisomorphism diff --git a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismEmbedding.lean b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismEmbedding.lean index ce5bb67dd5..d7c5bb97c5 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismEmbedding.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismEmbedding.lean @@ -18,7 +18,7 @@ import Mathlib.Algebra.Algebra.ZMod The nonisomorphism embedding component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperNonisomorphism diff --git a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismProofs.lean b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismProofs.lean index 3f9a71e548..95921c6b3e 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismProofs.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismProofs.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Paper.Section6.Nonisomorphism The nonisomorphism proofs component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace PaperNonisomorphism @@ -98,7 +98,7 @@ def paperEllVStarRepresentation : Representation k PaperKernel.Q PaperKernel.VSt /-- The `paperEllScalarRepresentation` construction used in the Connes rigidity formalization. -/ -def paperEllScalarRepresentation : Representation k PaperKernel.Q k := +@[expose] def paperEllScalarRepresentation : Representation k PaperKernel.Q k := Representation.trivial k PaperKernel.Q k /-- diff --git a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismTransport.lean b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismTransport.lean index 7a82a3f72e..ba1b74ce61 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismTransport.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/NonisomorphismTransport.lean @@ -15,7 +15,7 @@ the actual Zhou carriers. The proof uses the public characteristic-kernel and quotient transport files in this project. -/ -@[expose] public section +public section namespace Connes namespace PaperNonisomorphism diff --git a/LeanPool/ConnesRigidity/Paper/Section6/QuotientModuleTransport.lean b/LeanPool/ConnesRigidity/Paper/Section6/QuotientModuleTransport.lean index ef276797ae..933213339b 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/QuotientModuleTransport.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/QuotientModuleTransport.lean @@ -14,7 +14,7 @@ This file proves the concrete quotient and module transport in Zhou's Section 6 argument. It uses public project statements only. -/ -@[expose] public section +public section namespace Connes namespace PaperCharacteristicTransport diff --git a/LeanPool/ConnesRigidity/Paper/Section7.lean b/LeanPool/ConnesRigidity/Paper/Section7.lean index 65ec1c81eb..cdf29a0dbf 100644 --- a/LeanPool/ConnesRigidity/Paper/Section7.lean +++ b/LeanPool/ConnesRigidity/Paper/Section7.lean @@ -19,4 +19,4 @@ This facade exposes the assembled paper endpoint relative to the cited EJZK property-(T) input. -/ -@[expose] public section +public section diff --git a/LeanPool/ConnesRigidity/Paper/Section7/TheoremACompletion.lean b/LeanPool/ConnesRigidity/Paper/Section7/TheoremACompletion.lean index c6e1a21eff..5abee418f4 100644 --- a/LeanPool/ConnesRigidity/Paper/Section7/TheoremACompletion.lean +++ b/LeanPool/ConnesRigidity/Paper/Section7/TheoremACompletion.lean @@ -17,7 +17,7 @@ import LeanPool.ConnesRigidity.Paper.Section6.ModuleSemisimpleTransport Concrete completion boundary for Zhou's Theorem A. Paper: §§3--7. -/ -@[expose] public section +public section namespace Connes namespace PaperTheoremACompletion diff --git a/LeanPool/ConnesRigidity/Porting/CoreTransfer.lean b/LeanPool/ConnesRigidity/Porting/CoreTransfer.lean index 63bdaeb18d..c28d8a8951 100644 --- a/LeanPool/ConnesRigidity/Porting/CoreTransfer.lean +++ b/LeanPool/ConnesRigidity/Porting/CoreTransfer.lean @@ -18,7 +18,7 @@ public import LeanPool.ConnesRigidity.Core The core transfer component of the Connes rigidity formalization. -/ -@[expose] public section +public section namespace Connes namespace OpenAIPort diff --git a/LeanPool/CramerWold.lean b/LeanPool/CramerWold.lean index 7fbe8234f9..63549dca39 100644 --- a/LeanPool/CramerWold.lean +++ b/LeanPool/CramerWold.lean @@ -20,7 +20,7 @@ Tags: probability, measure-theory, characteristic-functions, cramer-wold MSC: 60B11, 60E10, 28A33 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/CriticalPortraits.lean b/LeanPool/CriticalPortraits.lean index ac9b9d7017..e85dcc931c 100644 --- a/LeanPool/CriticalPortraits.lean +++ b/LeanPool/CriticalPortraits.lean @@ -32,7 +32,7 @@ Tags: combinatorics, cycle-lemma, critical-portraits, enumeration MSC: 05A15, 37F20 -/ -@[expose] public section +public section /-! # Full all-`d` proof of `census = C(N,d−1)/d` (Mathlib) diff --git a/LeanPool/CriticalPortraits/Census.lean b/LeanPool/CriticalPortraits/Census.lean index 055248f840..ce8180f768 100644 --- a/LeanPool/CriticalPortraits/Census.lean +++ b/LeanPool/CriticalPortraits/Census.lean @@ -29,7 +29,7 @@ With positions in `ZMod N` (`N = d*m`) and the delete-min map `T`: agree; composing with the **denominator** count `card_levelCanonical_mul` yields the result. -/ -@[expose] public section +public section namespace CriticalPortraits open Finset diff --git a/LeanPool/CriticalPortraits/Core.lean b/LeanPool/CriticalPortraits/Core.lean index 73417ae90c..fcaa12672e 100644 --- a/LeanPool/CriticalPortraits/Core.lean +++ b/LeanPool/CriticalPortraits/Core.lean @@ -24,7 +24,7 @@ Proved here (sorry-free): the count **numerator** `#{(d−1)-subsets of Z_N} = C Mathlib's `Fintype.card_finset_len` + `ZMod.card`. -/ -@[expose] public section +public section namespace CriticalPortraits @@ -42,7 +42,7 @@ def level {N : ℕ} (m : ℕ) (i : ZMod N) : ℕ := i.val / m def fiber {N : ℕ} (m : ℕ) (i : ZMod N) : ℕ := i.val % m /-- `S ⊆ Z_{d*m}` is **level-canonical** iff `#{i ∈ S : level i ≤ j} ≤ j` for every `j < d`. -/ -def LevelCanonical (d m : ℕ) (S : Finset (ZMod (d * m))) : Prop := +@[expose] def LevelCanonical (d m : ℕ) (S : Finset (ZMod (d * m))) : Prop := ∀ j < d, (S.filter (fun i => i.val / m ≤ j)).card ≤ j instance (d m : ℕ) (S : Finset (ZMod (d * m))) : Decidable (LevelCanonical d m S) := by diff --git a/LeanPool/CriticalPortraits/CycleLemma.lean b/LeanPool/CriticalPortraits/CycleLemma.lean index 83ca814fb2..cdbed379f7 100644 --- a/LeanPool/CriticalPortraits/CycleLemma.lean +++ b/LeanPool/CriticalPortraits/CycleLemma.lean @@ -27,14 +27,14 @@ partial sums `Q k = ∑_{j a ≤ fam.lo e ∧ fam.hi e ≤ b) /-- The count `N(a,b)`. -/ -def N (a b : ℕ) : ℕ := (contained fam a b).card +@[expose] def N (a b : ℕ) : ℕ := (contained fam a b).card lemma mem_contained {a b : ℕ} {e : ι} : e ∈ contained fam a b ↔ e ∈ fam.E ∧ a ≤ fam.lo e ∧ fam.hi e ≤ b := by @@ -111,6 +111,7 @@ lemma overlap_imp_nested {e f : ι} (he : e ∈ fam.E) (hf : f ∈ fam.E) omega /-- "strict": interval not exactly the window. -/ +@[expose] def IsStrict (a b : ℕ) (e : ι) : Prop := fam.lo e ≠ a ∨ fam.hi e ≠ b instance (a b : ℕ) (e : ι) : Decidable (IsStrict fam a b e) := by unfold IsStrict; infer_instance @@ -291,7 +292,7 @@ lemma Sstrict_card_eq_sum : rfl /-- Edges with interval exactly the window. -/ -def topEdges (a b : ℕ) : Finset ι := +@[expose] def topEdges (a b : ℕ) : Finset ι := (contained fam a b).filter (fun e => fam.lo e = a ∧ fam.hi e = b) /-- At most one top edge (intervals identify edges). -/ @@ -596,11 +597,11 @@ lemma cross_false [NeZero (d * m)] {P : Finset (Finset (ZMod (d * m)))} (hP : Po /-! ## Phase 2: total edge data `(loV, hiV, colV)`. -/ /-- The level index `x.val / m` of a position `x`. -/ -def hiV (x : ZMod (d * m)) : ℕ := x.val / m +@[expose] def hiV (x : ZMod (d * m)) : ℕ := x.val / m /-- The fiber index `x.val % m` of a position `x`. -/ -def colV (x : ZMod (d * m)) : ℕ := x.val % m +@[expose] def colV (x : ZMod (d * m)) : ℕ := x.val % m /-- The low interval-endpoint value of `x` within its host critical set. -/ -noncomputable def loV [NeZero (d * m)] (P : Finset (Finset (ZMod (d * m)))) +@[expose] noncomputable def loV [NeZero (d * m)] (P : Finset (Finset (ZMod (d * m)))) (x : ZMod (d * m)) : ℕ := if hx : x ∈ T P then (predIn P x hx).val / m else 0 @@ -834,7 +835,7 @@ lemma edge_inj [NeZero (d * m)] (hd : 0 < d) (hm : 0 < m) /-! ## Phase 5: the `Family` instance and the forward bound. -/ /-- The laminar interval family of a portrait's survivors (edges = survivors). -/ -noncomputable def survivorFamily [NeZero (d * m)] (hd : 0 < d) (hm : 0 < m) +@[expose] noncomputable def survivorFamily [NeZero (d * m)] (hd : 0 < d) (hm : 0 < m) {P : Finset (Finset (ZMod (d * m)))} (hP : Portrait d m P) : AbstractLaminar.Family (ZMod (d*m)) where E := T P diff --git a/LeanPool/CriticalPortraits/Injectivity.lean b/LeanPool/CriticalPortraits/Injectivity.lean index 9e16a56227..242f394816 100644 --- a/LeanPool/CriticalPortraits/Injectivity.lean +++ b/LeanPool/CriticalPortraits/Injectivity.lean @@ -46,7 +46,7 @@ separation (`column_sep_with_gap` / `column_sep_geom_dir`). Everything is axiom • The assembly `T_inj` / `T_injOn`. -/ -@[expose] public section +public section open Finset open scoped BigOperators diff --git a/LeanPool/CriticalPortraits/Portraits.lean b/LeanPool/CriticalPortraits/Portraits.lean index 394882ef62..687bf7fd05 100644 --- a/LeanPool/CriticalPortraits/Portraits.lean +++ b/LeanPool/CriticalPortraits/Portraits.lean @@ -40,7 +40,7 @@ Positions/level/fiber/`LevelCanonical` are reused from `CriticalPortraits.Core`. `LevelCanonical (T P)` is a LATER brick (3b) and is deliberately NOT stated here. -/ -@[expose] public section +public section namespace CriticalPortraits @@ -51,6 +51,7 @@ open scoped BigOperators /-- `S ⊆ Z_{d*m}` is a **critical set**: it lies in one `σ_d`-fiber (all points share a column `r < m`) and has at least `2` points. Its **weight** is `S.card - 1`. -/ +@[expose] def IsCriticalSet (d m : ℕ) (S : Finset (ZMod (d * m))) : Prop := (∃ r, r < m ∧ ∀ x ∈ S, x.val % m = r) ∧ 2 ≤ S.card @@ -66,6 +67,7 @@ crossing patterns (up to relabelling) are `a1 < b1 < a2 < b2` and `b1 < a1 < b2 `a, b, a, b`", which is exactly the negation of "`A` is a single cyclic run" — i.e. the bare-Lean `hullsUnlinked` test `cyclicRuns ≤ 1`. `Unlinked A B := ¬ Linked A B`. -/ /-- Two cyclic subsets `A` and `B` are linked when they interleave. -/ +@[expose] def Linked {N : ℕ} (A B : Finset (ZMod N)) : Prop := ∃ a1 ∈ A, ∃ a2 ∈ A, ∃ b1 ∈ B, ∃ b2 ∈ B, (a1.val < b1.val ∧ b1.val < a2.val ∧ a2.val < b2.val) ∨ @@ -75,6 +77,7 @@ instance {N : ℕ} (A B : Finset (ZMod N)) : Decidable (Linked A B) := by unfold Linked; infer_instance /-- `A` and `B` have unlinked convex hulls (no crossing chords). -/ +@[expose] def Unlinked {N : ℕ} (A B : Finset (ZMod N)) : Prop := ¬ Linked A B instance {N : ℕ} (A B : Finset (ZMod N)) : Decidable (Unlinked A B) := by @@ -101,6 +104,7 @@ theorem not_unlinked_of_alternating {N : ℕ} {A B : Finset (ZMod N)} /-- A **critical portrait**: a family of critical sets that is pairwise vertex-disjoint, pairwise unlinked, of total weight `∑ (|S| - 1) = d - 1`. -/ +@[expose] def Portrait (d m : ℕ) (P : Finset (Finset (ZMod (d * m)))) : Prop := (∀ S ∈ P, IsCriticalSet d m S) ∧ (∀ A ∈ P, ∀ B ∈ P, A ≠ B → Disjoint A B) ∧ @@ -193,7 +197,7 @@ lemma mem_eraseMin {N : ℕ} (S : Finset (ZMod N)) (h : S.Nonempty) (x : ZMod N) tauto /-- `T(P)`: delete the lowest-level point of every set, then take the union. -/ -noncomputable def T {N : ℕ} (P : Finset (Finset (ZMod N))) : Finset (ZMod N) := +@[expose] noncomputable def T {N : ℕ} (P : Finset (Finset (ZMod N))) : Finset (ZMod N) := P.sup eraseMin /-- The erased sets remain pairwise disjoint (erase only shrinks). -/ diff --git a/LeanPool/CriticalPortraits/Surjectivity.lean b/LeanPool/CriticalPortraits/Surjectivity.lean index d501f455ab..25acaaded9 100644 --- a/LeanPool/CriticalPortraits/Surjectivity.lean +++ b/LeanPool/CriticalPortraits/Surjectivity.lean @@ -51,7 +51,7 @@ NOW FULLY PROVED (no remaining `sorry`): Axioms: `{propext, Classical.choice, Quot.sound}` (no `sorryAx`, no `native_decide`). -/ -@[expose] public section +public section namespace CriticalPortraits diff --git a/LeanPool/CutAndProject.lean b/LeanPool/CutAndProject.lean index 7dc14f85be..be2dabec67 100644 --- a/LeanPool/CutAndProject.lean +++ b/LeanPool/CutAndProject.lean @@ -21,4 +21,4 @@ Tags: number-theory, aperiodic-order, cut-and-project, quasicrystals MSC: 52C23, 11K06 -/ -@[expose] public section +public section diff --git a/LeanPool/CutAndProject/Basic.lean b/LeanPool/CutAndProject/Basic.lean index 0a6baa7913..8dc351426e 100644 --- a/LeanPool/CutAndProject/Basic.lean +++ b/LeanPool/CutAndProject/Basic.lean @@ -33,7 +33,7 @@ projections is not formalised here. The irrational-slope case (`LeanPool.CutAndProject.Irrational`) is built from the lattice directly. -/ -@[expose] public section +public section open Nat diff --git a/LeanPool/CutAndProject/Irrational.lean b/LeanPool/CutAndProject/Irrational.lean index 43b9cde05a..c31540a451 100644 --- a/LeanPool/CutAndProject/Irrational.lean +++ b/LeanPool/CutAndProject/Irrational.lean @@ -27,7 +27,7 @@ The proof has three steps: this out, forcing `v = 0` and contradicting Step 2. -/ -@[expose] public section +public section open Set Function @@ -39,10 +39,10 @@ variable (a ω : ℝ) /-- Physical (signed-position) projection used in the irrational case: `tildeP(x,y) = x + a*y`. -/ -def tildeP : ℤ × ℤ → ℝ := fun z => (z.1 : ℝ) + a * (z.2 : ℝ) +@[expose] def tildeP : ℤ × ℤ → ℝ := fun z => (z.1 : ℝ) + a * (z.2 : ℝ) /-- Internal coordinate: `s(x,y) = y - a*x`. -/ -def sInternal : ℤ × ℤ → ℝ := fun z => (z.2 : ℝ) - a * (z.1 : ℝ) +@[expose] def sInternal : ℤ × ℤ → ℝ := fun z => (z.2 : ℝ) - a * (z.1 : ℝ) /-- Internal window `W = [-a*ω, ω]`. -/ def W : Set ℝ := Set.Icc (-(a * ω)) ω diff --git a/LeanPool/DeadEnds.lean b/LeanPool/DeadEnds.lean index 2f5cdccd73..b7583eafcc 100644 --- a/LeanPool/DeadEnds.lean +++ b/LeanPool/DeadEnds.lean @@ -23,7 +23,7 @@ Tags: number-theory, combinatorics MSC: 11N25 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/DeadEnds/Basic.lean b/LeanPool/DeadEnds/Basic.lean index 785e930235..ce3b767fd8 100644 --- a/LeanPool/DeadEnds/Basic.lean +++ b/LeanPool/DeadEnds/Basic.lean @@ -16,7 +16,7 @@ import Mathlib.NumberTheory.SumPrimeReciprocals /-! ## Counting functions for joint conditions -/ -@[expose] public section +public section namespace LeanPool.DeadEnds @@ -34,7 +34,7 @@ MATHLIB COVERAGE: /-- A positive integer `N` is a *base-`b` dead end*: `N` is square-free, yet `b * N + d` fails to be square-free for every digit `d ∈ {0, …, b - 1}`. -/ -def IsBaseBDeadEnd (b : ℕ) (N : ℕ) : Prop := +@[expose] def IsBaseBDeadEnd (b : ℕ) (N : ℕ) : Prop := 0 < N ∧ Squarefree N ∧ ∀ d ∈ Finset.range b, ¬Squarefree (b * N + d) instance (b N : ℕ) : Decidable (IsBaseBDeadEnd b N) := by @@ -42,18 +42,18 @@ instance (b N : ℕ) : Decidable (IsBaseBDeadEnd b N) := by infer_instance /-- The number of base-`b` dead ends in `[1, X]`. -/ -def countBaseBDeadEnds (b : ℕ) (X : ℕ) : ℕ := +@[expose] def countBaseBDeadEnds (b : ℕ) (X : ℕ) : ℕ := (Finset.filter (fun N => IsBaseBDeadEnd b N) (Finset.Icc 1 X)).card /-- The asymptotic density of base-`b` dead ends equals `D`, i.e. `countBaseBDeadEnds b X / X → D` as `X → ∞`. -/ -def HasAsymptoticDensity (b : ℕ) (D : ℝ) : Prop := +@[expose] def HasAsymptoticDensity (b : ℕ) (D : ℝ) : Prop := Filter.Tendsto (fun X : ℕ => (countBaseBDeadEnds b X : ℝ) / (X : ℝ)) Filter.atTop (nhds D) /-- The local density factor `μ_p(b, T)`: the fraction of residues `r ∈ [0, p²)` with `p² ∤ r` and `p² ∤ b * r + d` for every `d ∈ T`. -/ -noncomputable def localDensityFactor (p : ℕ) (b : ℕ) (T : Finset ℕ) : ℝ := +@[expose] noncomputable def localDensityFactor (p : ℕ) (b : ℕ) (T : Finset ℕ) : ℝ := let pSq := p ^ 2 let validResidues := (Finset.range pSq).filter fun r => ¬(pSq ∣ r) ∧ ∀ d ∈ T, ¬(pSq ∣ (b * r + d)) @@ -61,17 +61,17 @@ noncomputable def localDensityFactor (p : ℕ) (b : ℕ) (T : Finset ℕ) : ℝ /-- The joint square-free density `α(b, T) = ∏_p μ_p(b, T)`, the infinite product over all primes. -/ -noncomputable def jointSquarefreeDensity (b : ℕ) (T : Finset ℕ) : ℝ := +@[expose] noncomputable def jointSquarefreeDensity (b : ℕ) (T : Finset ℕ) : ℝ := ∏' p : Nat.Primes, localDensityFactor (p : ℕ) b T /-- The explicit inclusion-exclusion formula `∑_{T ⊆ {0,…,b-1}} (-1)^{|T|} α(b, T)` for `D_b`. -/ -noncomputable def explicitDensityFormula (b : ℕ) : ℝ := +@[expose] noncomputable def explicitDensityFormula (b : ℕ) : ℝ := ∑ T ∈ (Finset.range b).powerset, ((-1 : ℝ) ^ T.card) * jointSquarefreeDensity b T /-- Count N in [1,X] such that N is squarefree and bN+d is squarefree for all d in T -/ -def countJointSquarefree (b : ℕ) (T : Finset ℕ) (X : ℕ) : ℕ := +@[expose] def countJointSquarefree (b : ℕ) (T : Finset ℕ) (X : ℕ) : ℕ := (Finset.Icc 1 X).filter (fun N => Squarefree N ∧ ∀ d ∈ T, Squarefree (b * N + d)) |>.card diff --git a/LeanPool/DeadEnds/CRT.lean b/LeanPool/DeadEnds/CRT.lean index 1b5819c949..41005ea1d8 100644 --- a/LeanPool/DeadEnds/CRT.lean +++ b/LeanPool/DeadEnds/CRT.lean @@ -15,20 +15,22 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.DeadEnds.CRT -/ -@[expose] public section +public section namespace LeanPool.DeadEnds /-- The modulus M = ∏_{p ∈ S} p² -/ -noncomputable def primeSquareProduct (S : Finset Nat.Primes) : ℕ := +@[expose] noncomputable def primeSquareProduct (S : Finset Nat.Primes) : ℕ := ∏ p ∈ S, (p : ℕ) ^ 2 /-- Valid residues mod M: residues r such that for all p ∈ S, r mod p² is valid -/ -noncomputable def validResiduesMod (b : ℕ) (T : Finset ℕ) (S : Finset Nat.Primes) : Finset ℕ := +@[expose] noncomputable def validResiduesMod (b : ℕ) (T : Finset ℕ) + (S : Finset Nat.Primes) : Finset ℕ := (Finset.range (primeSquareProduct S)).filter fun r => ∀ p ∈ S, ¬((p : ℕ) ^ 2 ∣ r) ∧ ∀ d ∈ T, ¬((p : ℕ) ^ 2 ∣ (b * r + d)) /-- The product of local density factors L = ∏_{p ∈ S} localDensityFactor p b T -/ +@[expose] noncomputable def localDensityProduct (b : ℕ) (T : Finset ℕ) (S : Finset Nat.Primes) : ℝ := ∏ p ∈ S, localDensityFactor (p : ℕ) b T diff --git a/LeanPool/DeadEnds/Counting.lean b/LeanPool/DeadEnds/Counting.lean index 7601140b61..f3b7d80cc7 100644 --- a/LeanPool/DeadEnds/Counting.lean +++ b/LeanPool/DeadEnds/Counting.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset Finite-prime counting bounds and comparison with the Euler product density. -/ -@[expose] public section +public section namespace LeanPool.DeadEnds diff --git a/LeanPool/DeadEnds/CountingBlocks.lean b/LeanPool/DeadEnds/CountingBlocks.lean index 25beb10cab..44b141d412 100644 --- a/LeanPool/DeadEnds/CountingBlocks.lean +++ b/LeanPool/DeadEnds/CountingBlocks.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset Complete and partial residue blocks used to count finite prime-square conditions. -/ -@[expose] public section +public section namespace LeanPool.DeadEnds diff --git a/LeanPool/DeadEnds/InclusionExclusion.lean b/LeanPool/DeadEnds/InclusionExclusion.lean index dd53356dcd..d35cc3d141 100644 --- a/LeanPool/DeadEnds/InclusionExclusion.lean +++ b/LeanPool/DeadEnds/InclusionExclusion.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset /-! ## Helper lemmas for inclusion-exclusion -/ -@[expose] public section +public section namespace LeanPool.DeadEnds diff --git a/LeanPool/DeadEnds/PrimeTail.lean b/LeanPool/DeadEnds/PrimeTail.lean index 78973187dd..11abfb5b41 100644 --- a/LeanPool/DeadEnds/PrimeTail.lean +++ b/LeanPool/DeadEnds/PrimeTail.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset Prime-tail and single-prime divisibility estimates. -/ -@[expose] public section +public section namespace LeanPool.DeadEnds diff --git a/LeanPool/DeadEnds/RelevantPrimes.lean b/LeanPool/DeadEnds/RelevantPrimes.lean index ea0b6892e9..c2bd029a6b 100644 --- a/LeanPool/DeadEnds/RelevantPrimes.lean +++ b/LeanPool/DeadEnds/RelevantPrimes.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Positivity.Finset Bounding the finite set of primes relevant to square-divisibility violations. -/ -@[expose] public section +public section namespace LeanPool.DeadEnds diff --git a/LeanPool/DeadEnds/Solution.lean b/LeanPool/DeadEnds/Solution.lean index 17f24de504..b60d813ed6 100644 --- a/LeanPool/DeadEnds/Solution.lean +++ b/LeanPool/DeadEnds/Solution.lean @@ -24,4 +24,4 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.DeadEnds.Solution`. -/ -@[expose] public section +public section diff --git a/LeanPool/DeadEnds/TailEstimates.lean b/LeanPool/DeadEnds/TailEstimates.lean index 9638772e7f..60562b6b0e 100644 --- a/LeanPool/DeadEnds/TailEstimates.lean +++ b/LeanPool/DeadEnds/TailEstimates.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset Asymptotic tail estimates that turn finite-prime counts into density bounds. -/ -@[expose] public section +public section namespace LeanPool.DeadEnds diff --git a/LeanPool/DemazureOperatorsLean.lean b/LeanPool/DemazureOperatorsLean.lean index 2eee1dbb65..aa3093db07 100644 --- a/LeanPool/DemazureOperatorsLean.lean +++ b/LeanPool/DemazureOperatorsLean.lean @@ -26,7 +26,7 @@ Tags: algebraic-combinatorics, demazure-operators, polynomials, representation-t MSC: 05E05, 13P10, 20F55 -/ -@[expose] public section +public section /-! The Demazure-operator declarations are sourced to the BGG Schubert-cells paper diff --git a/LeanPool/DemazureOperatorsLean/Demazure.lean b/LeanPool/DemazureOperatorsLean/Demazure.lean index 86c4284b29..0e6cdba014 100644 --- a/LeanPool/DemazureOperatorsLean/Demazure.lean +++ b/LeanPool/DemazureOperatorsLean/Demazure.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.DemazureOperatorsLean.Demazure -/ -@[expose] public section +public section noncomputable section open MvPolynomial @@ -37,6 +37,7 @@ variable {n : ℕ} (n_pos : n > 0) (n_gt_1 : n > 1) /- Prerequisites -/ /-- The polynomial obtained by swapping the variables indexed by `i` and `j`. -/ +@[expose] def SwapVariablesFun (i j : Fin n) (p : MvPolynomial (Fin n) ℂ) : (MvPolynomial (Fin n) ℂ) := (renameEquiv ℂ (Equiv.swap i j)) p @@ -101,7 +102,7 @@ lemma swap_variables_order_two {i j : Fin n} {p : MvPolynomial (Fin n) ℂ} : simp /-- The algebra equivalence swapping the variables indexed by `i` and `j`. -/ -def SwapVariables (i : Fin n) (j : Fin n) : +@[expose] def SwapVariables (i : Fin n) (j : Fin n) : AlgEquiv ℂ (MvPolynomial (Fin n) ℂ) (MvPolynomial (Fin n) ℂ) := renameEquiv ℂ (Equiv.swap i j) @@ -182,6 +183,7 @@ lemma demazure_denominator_not_null (i : Fin n) : to perform division by (x_i - x_(i+1)) later (only univariable division is supported) -/ /-- The numerator used to define the Demazure operator in one distinguished variable. -/ +@[expose] def DemazureNumerator (i : Fin n) (p : MvPolynomial (Fin (n + 1)) ℂ) : Polynomial (MvPolynomial (Fin n) ℂ) := let i' : Fin (n + 1) := Fin.castSucc i @@ -207,7 +209,7 @@ lemma demazure_numerator_C_mul (i : Fin n) : ∀ (p : MvPolynomial (Fin (n + 1)) -- Now we also define the denominator taking the variable x_i as the variable to divide by /-- The monic denominator `X - X_i` used in the Demazure division step. -/ -def DemazureDenominator (i : Fin n) : Polynomial (MvPolynomial (Fin n) ℂ) := +@[expose] def DemazureDenominator (i : Fin n) : Polynomial (MvPolynomial (Fin n) ℂ) := let X_i : MvPolynomial (Fin n) ℂ := MvPolynomial.X i let denominator_X : Polynomial (MvPolynomial (Fin n) ℂ) := (Polynomial.X - Polynomial.C X_i) denominator_X @@ -246,6 +248,7 @@ lemma demazure_division_exact : ∀(i : Fin n), ∀(p : MvPolynomial (Fin (n + 1 /-- The Demazure operator as a function on multivariate polynomials. -/ +@[expose] def DemazureFun (i : Fin n) (p : MvPolynomial (Fin (n + 1)) ℂ) : MvPolynomial (Fin (n + 1)) ℂ := let numerator := DemazureNumerator i p let denominator := DemazureDenominator i @@ -334,7 +337,7 @@ lemma demazure_map_smul (i : Fin n) : ∀ (r : ℂ) (p : MvPolynomial (Fin (n + exact demazure_numerator_C_mul i p r /-- The Demazure operator as a complex-linear map. -/ -def DemazureLinear (i : Fin n) : +@[expose] def DemazureLinear (i : Fin n) : LinearMap (RingHom.id ℂ) (MvPolynomial (Fin (n + 1)) ℂ) (MvPolynomial (Fin (n + 1)) ℂ) where toFun := DemazureFun i diff --git a/LeanPool/DemazureOperatorsLean/DemazureAux.lean b/LeanPool/DemazureOperatorsLean/DemazureAux.lean index 4f8f663abb..91e900fea5 100644 --- a/LeanPool/DemazureOperatorsLean/DemazureAux.lean +++ b/LeanPool/DemazureOperatorsLean/DemazureAux.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.DemazureOperatorsLean.DemazureAux -/ -@[expose] public section +public section noncomputable section open MvPolynomial @@ -44,10 +44,10 @@ structure PolyFraction' (n : ℕ) where example : PolyFraction' 2 := ⟨X 0 + X 1, 1, one_ne_zero⟩ /-- View a polynomial as a fraction with denominator one. -/ -def toFrac (p : MvPolynomial (Fin (n + 1)) ℂ) : PolyFraction' n := ⟨p, 1, one_ne_zero⟩ +@[expose] def toFrac (p : MvPolynomial (Fin (n + 1)) ℂ) : PolyFraction' n := ⟨p, 1, one_ne_zero⟩ /-- The proportionality relation on polynomial fractions. -/ -def r (n : ℕ) : PolyFraction' n → PolyFraction' n → Prop := +@[expose] def r (n : ℕ) : PolyFraction' n → PolyFraction' n → Prop := fun p q => p.numerator * q.denominator = q.numerator * p.denominator lemma r_equiv : Equivalence (r n) := by @@ -86,13 +86,15 @@ lemma equiv_r {a b : PolyFraction' n} : (r n) a b ↔ a ≈ b := by /-- The quotient type of polynomial fractions modulo proportionality. -/ +@[expose] def PolyFraction (n : ℕ) := (Quotient (s n)) /-- The quotient map from fraction representatives. -/ +@[expose] def mk (p : PolyFraction' n) : PolyFraction n := Quotient.mk (s n) p /-- The quotient map from polynomials, viewed as fractions with denominator one. -/ -def mk' (p : MvPolynomial (Fin (n + 1)) ℂ) : PolyFraction n := mk ⟨p, 1, one_ne_zero⟩ +@[expose] def mk' (p : MvPolynomial (Fin (n + 1)) ℂ) : PolyFraction n := mk ⟨p, 1, one_ne_zero⟩ /- This lemmas enables us to compute the result of a lift of a function applied at a @@ -129,12 +131,12 @@ lemma get_polyfraction_rep (p : PolyFraction n) : ∃p' : PolyFraction' n, mk p' exact Quotient.exists_rep p /-- Addition of polynomial-fraction representatives. -/ -def add' {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction' n := +@[expose] def add' {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction' n := fun p q => ⟨p.numerator * q.denominator + q.numerator * p.denominator, p.denominator * q.denominator, mul_ne_zero p.denominator_ne_zero q.denominator_ne_zero⟩ /-- Addition of representatives followed by the quotient map. -/ -def addMk {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction n := +@[expose] def addMk {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction n := fun p q => mk (add' p q) lemma add'_s {n : ℕ} : ∀ a₁ b₁ a₂ b₂ : PolyFraction' n, a₁ ≈ a₂ → b₁ ≈ b₂ → @@ -158,6 +160,7 @@ lemma add'_s {n : ℕ} : ∀ a₁ b₁ a₂ b₂ : PolyFraction' n, a₁ ≈ a ring_nf /-- Addition on quotient polynomial fractions. -/ +@[expose] def add : PolyFraction n → PolyFraction n → PolyFraction n := fun p q ↦ Quotient.lift₂ (addMk) (add'_s) p q @@ -195,12 +198,12 @@ def sub : PolyFraction n → PolyFraction n → PolyFraction n := fun p q ↦ Quotient.lift₂ (sub') (sub'_s) p q /-- Multiplication of polynomial-fraction representatives. -/ -def mul' {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction' n := +@[expose] def mul' {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction' n := fun p q => ⟨p.numerator * q.numerator, p.denominator * q.denominator, mul_ne_zero p.denominator_ne_zero q.denominator_ne_zero⟩ /-- Multiplication of representatives followed by the quotient map. -/ -def mulMk {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction n := +@[expose] def mulMk {n : ℕ} : PolyFraction' n → PolyFraction' n → PolyFraction n := fun p q => mk (mul' p q) lemma mul'_s {n : ℕ} : ∀ a₁ b₁ a₂ b₂ : PolyFraction' n, a₁ ≈ a₂ → b₁ ≈ b₂ → @@ -221,7 +224,7 @@ lemma mul'_s {n : ℕ} : ∀ a₁ b₁ a₂ b₂ : PolyFraction' n, a₁ ≈ a ring_nf /-- Multiplication on quotient polynomial fractions. -/ -def mul : PolyFraction n → PolyFraction n → PolyFraction n := +@[expose] def mul : PolyFraction n → PolyFraction n → PolyFraction n := fun p q ↦ Quotient.lift₂ (mulMk) (mul'_s) p q -- Enable use of * notation @@ -239,13 +242,14 @@ def one' : PolyFraction' n where def one : PolyFraction n := mk one' /-- The additive identity as a fraction representative. -/ -@[simp] +@[expose, simp] def zero' : PolyFraction' n where numerator := 0 denominator := 1 denominator_ne_zero := one_ne_zero /-- The additive identity as a quotient fraction. -/ +@[expose] def zero : PolyFraction n := mk zero' /-- Negation of polynomial-fraction representatives. -/ @@ -302,7 +306,7 @@ lemma add_assoc (p q r : PolyFraction n) : add (add p q) r = add p (add q r) := /- We directly define the Demazure operator on fractions (even though we proved that the result is a polynomial, for the proofs it's better to keep the result as a fraction)-/ /-- The auxiliary Demazure operator on fraction representatives. -/ -def DemAux' (i : Fin n) : PolyFraction' n → PolyFraction' n := fun p => +@[expose] def DemAux' (i : Fin n) : PolyFraction' n → PolyFraction' n := fun p => ⟨ p.numerator * (SwapVariables (Fin.castSucc i) (Fin.succ i) p.denominator) - (SwapVariables (Fin.castSucc i) (Fin.succ i) p.numerator) * p.denominator, @@ -338,7 +342,7 @@ lemma DemAux_well_defined (i : Fin n) : ∀ (p q : PolyFraction' n), ring_nf /-- The auxiliary Demazure operator on quotient polynomial fractions. -/ -def DemAux (i : Fin n) (p : PolyFraction n) : PolyFraction n := +@[expose] def DemAux (i : Fin n) (p : PolyFraction n) : PolyFraction n := Quotient.lift (mk ∘ (DemAux' i)) (DemAux_well_defined i) p /- This definition is equivalent to the direct one on the polynomial ring-/ diff --git a/LeanPool/DemazureOperatorsLean/DemazureAuxRelations.lean b/LeanPool/DemazureOperatorsLean/DemazureAuxRelations.lean index eed1497fa2..94df628c90 100644 --- a/LeanPool/DemazureOperatorsLean/DemazureAuxRelations.lean +++ b/LeanPool/DemazureOperatorsLean/DemazureAuxRelations.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.DemazureOperatorsLean.DemazureAuxRelations -/ -@[expose] public section +public section noncomputable section namespace Demazure @@ -141,7 +141,7 @@ lemma symm_invariant_swap_variables {i j : Fin n} {g : MvPolynomial (Fin n) ℂ} /- Now we prove that symmetric polynomials act as scalars -/ /-- A quotient fraction represented by symmetric numerator and denominator polynomials. -/ -def IsSymmetric (p : PolyFraction n) : Prop := ∃p' : PolyFraction' n, +@[expose] def IsSymmetric (p : PolyFraction n) : Prop := ∃p' : PolyFraction' n, mk p' = p ∧ MvPolynomial.IsSymmetric p'.numerator ∧ MvPolynomial.IsSymmetric p'.denominator lemma demaux_mul_symm (i : Fin n) (g f : PolyFraction n) (h : IsSymmetric g) : diff --git a/LeanPool/DemazureOperatorsLean/DemazureRelations.lean b/LeanPool/DemazureOperatorsLean/DemazureRelations.lean index 454bdfce23..7a63b875a3 100644 --- a/LeanPool/DemazureOperatorsLean/DemazureRelations.lean +++ b/LeanPool/DemazureOperatorsLean/DemazureRelations.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.DemazureOperatorsLean.DemazureRelations -/ -@[expose] public section +public section noncomputable section open MvPolynomial diff --git a/LeanPool/DemazureOperatorsLean/Matsumoto.lean b/LeanPool/DemazureOperatorsLean/Matsumoto.lean index bcf9b7ce46..efeb680406 100644 --- a/LeanPool/DemazureOperatorsLean/Matsumoto.lean +++ b/LeanPool/DemazureOperatorsLean/Matsumoto.lean @@ -12,7 +12,7 @@ import LeanPool.DemazureOperatorsLean.StrongExchange # LeanPool.DemazureOperatorsLean.Matsumoto -/ -@[expose] public section +public section namespace CoxeterSystem noncomputable section diff --git a/LeanPool/DemazureOperatorsLean/StrongExchange.lean b/LeanPool/DemazureOperatorsLean/StrongExchange.lean index f4de4aa36b..02d671bbb4 100644 --- a/LeanPool/DemazureOperatorsLean/StrongExchange.lean +++ b/LeanPool/DemazureOperatorsLean/StrongExchange.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Group.NatPowAssoc # LeanPool.DemazureOperatorsLean.StrongExchange -/ -@[expose] public section +public section namespace CoxeterSystem noncomputable section diff --git a/LeanPool/DemazureProduct.lean b/LeanPool/DemazureProduct.lean index 43014fc251..e3d1890e0f 100644 --- a/LeanPool/DemazureProduct.lean +++ b/LeanPool/DemazureProduct.lean @@ -33,7 +33,7 @@ Tags: algebraic-combinatorics, demazure-product, bruhat-order, permutations MSC: 05E05, 20F55 -/ -@[expose] public section +public section /-! This project formalizes the extended Demazure product on almost-sign-preserving diff --git a/LeanPool/DemazureProduct/AspPerm.lean b/LeanPool/DemazureProduct/AspPerm.lean index e3f9657792..4ee41969ac 100644 --- a/LeanPool/DemazureProduct/AspPerm.lean +++ b/LeanPool/DemazureProduct/AspPerm.lean @@ -29,7 +29,7 @@ bounded-difference material from Section 7, of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -38,14 +38,14 @@ namespace LeanPool.DemazureProduct \tau(u) > \tau(v)\}$. *Definition 2.5 (`defn:Inv`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ -def invSet (τ : ℤ → ℤ) : Set (ℤ × ℤ) := +@[expose] def invSet (τ : ℤ → ℤ) : Set (ℤ × ℤ) := {(i,j) : ℤ × ℤ | i < j ∧ τ j < τ i} /-- The southeast quadrant below value `m` and weakly to the right of index `n`. -/ -def southeastSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | n ≤ k ∧ τ k < m } +@[expose] def southeastSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | n ≤ k ∧ τ k < m } /-- The northwest quadrant above value `m` and strictly to the left of index `n`. -/ -def northwestSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | k < n ∧ m ≤ τ k } +@[expose] def northwestSet (τ : ℤ → ℤ) (m n : ℤ) : Set ℤ := { k : ℤ | k < n ∧ m ≤ τ k } /-- Reflect an integer function by the order-reversing involution `n ↦ -1 - n`. -/ abbrev flipFunc (f : ℤ → ℤ) : ℤ → ℤ := fun k => -1 - f (-1 - k) @@ -118,6 +118,7 @@ private lemma nw_finite_of_finite {τ : ℤ → ℤ} (h_inj : Function.Injective $\{ n \in \mathbb{Z} : n \tau(n) < 0 \}$ is finite. Equivalently, only finitely many integers change sign under `τ`. -/ +@[expose] def isAsp (τ : ℤ → ℤ) : Prop := { n : ℤ | n * (τ n) < 0 }.Finite @@ -274,6 +275,7 @@ noncomputable def inv (τ : AspPerm) : AspPerm where simp only [Set.preimage_ofPred_eq, Set.mem_ofPred_eq, this, mul_comm] /-- The identity ASP permutation. -/ +@[expose] def id : AspPerm where func := _root_.id bijective := ⟨Function.injective_id, Function.surjective_id⟩ @@ -298,7 +300,10 @@ noncomputable instance : Group AspPerm where exact Function.leftInverse_invFun τ.injective n /-- Ordinary multiplication of ASP permutations is function composition. -/ -@[simp] lemma mul_apply (σ τ : AspPerm) (n : ℤ) : (σ * τ) n = σ (τ n) := rfl +@[simp] lemma mul_apply (σ τ : AspPerm) (n : ℤ) : (σ * τ) n = σ (τ n) := by rfl + +/-- The inverse ASP permutation evaluates using the inverse underlying function. -/ +lemma inv_func (τ : AspPerm) (n : ℤ) : (τ⁻¹).func n = Function.invFun τ.func n := by rfl @[simp] lemma inv_mul_cancel_eval (n : ℤ) : τ⁻¹ (τ n) = n := by change Function.invFun τ.func (τ.func n) = n @@ -315,14 +320,14 @@ lemma nw_finite (a b : ℤ) : (northwestSet τ a b).Finite := nw_finite_of_asp τ.injective a b τ.asp /-- The finite southeast quadrant for an ASP permutation. -/ -noncomputable def seFinset (a b : ℤ) : Finset ℤ := (τ.se_finite a b).toFinset +@[expose] noncomputable def seFinset (a b : ℤ) : Finset ℤ := (τ.se_finite a b).toFinset @[simp] lemma mem_se (a b n : ℤ) : n ∈ (τ.seFinset a b) ↔ n ≥ b ∧ τ n < a := by unfold seFinset simp [southeastSet] /-- The finite northwest quadrant for an ASP permutation. -/ -noncomputable def nwFinset (a b : ℤ) : Finset ℤ := (τ.nw_finite a b).toFinset +@[expose] noncomputable def nwFinset (a b : ℤ) : Finset ℤ := (τ.nw_finite a b).toFinset @[simp] lemma mem_nw (a b n : ℤ) : n ∈ (τ.nwFinset a b) ↔ n < b ∧ τ n ≥ a := by unfold nwFinset @@ -341,7 +346,7 @@ lemma inv_set_inverse (u v : ℤ) : exact ⟨u_lt_v, τv_lt_τu⟩ /-- Reverse an inversion box through an ASP permutation. -/ -def revMap : ℤ × ℤ → ℤ × ℤ := fun ⟨i, j⟩ => ⟨τ j, τ i⟩ +@[expose] def revMap : ℤ × ℤ → ℤ × ℤ := fun ⟨i, j⟩ => ⟨τ j, τ i⟩ /-- The slipface associated to an ASP permutation is defined by $s_\tau(a,b) = \#\{n \geq b : \tau(n) < a\}$, in the notation of @@ -1048,6 +1053,7 @@ lemma a_step_eq_iff' (u b : ℤ) : τ.s (τ u + 1) b = τ.s (τ u) b ↔ u < b : simpa [τ.mul_inv_cancel_eval] using this /-- The set of inversion sources ending at `v`. -/ +@[expose] def inset (v : ℤ) : Set ℤ := {u | ⟨u, v⟩ ∈ invSet τ} lemma inset_eq_nw (v : ℤ) : τ.inset v = northwestSet τ (τ v) v := by @@ -1073,6 +1079,7 @@ lemma inset_finite (v : ℤ) : (τ.inset v).Finite := by apply τ.nw_finite /-- The set of inversion targets starting at `u`. -/ +@[expose] def outset (u : ℤ) : Set ℤ := {v | ⟨u, v⟩ ∈ invSet τ} lemma outset_eq_se (u : ℤ) : τ.outset u = southeastSet τ (τ u) u := by @@ -1154,7 +1161,7 @@ lemma inv_set_id : invSet AspPerm.id = ∅ := by intro u_lt_v exact le_of_lt u_lt_v -@[simp] lemma s_chi_eq : τ.s.χ = τ.χ := rfl +@[simp] lemma s_chi_eq : τ.s.χ = τ.χ := by rfl lemma s_dual : τ.s.dual = (τ⁻¹).s := by apply (SF_ext τ.s.dual τ⁻¹.s).mpr @@ -1550,12 +1557,13 @@ $\operatorname{Inv}(\alpha) \cap \operatorname{Inv}(\beta^{-1})$ is empty. *Definition 2.7 (`defn:reducedProduct`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ -def ReducedProduct (α β : AspPerm) : Prop := +@[expose] def ReducedProduct (α β : AspPerm) : Prop := Disjoint (invSet α) (invSet (β⁻¹).func) /-- The left weak order: `σ ≤L τ` if and only if $\operatorname{Inv} \sigma \subseteq \operatorname{Inv} \tau$. *Definition 2.6 (`defn:weakOrders`), part 1/2, of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] def leWeakL (σ τ : AspPerm) : Prop := invSet σ ⊆ invSet τ /-- Infix notation for the left weak order on ASP permutations. -/ infix:50 " ≤L " => leWeakL @@ -1564,6 +1572,7 @@ infix:50 " ≤L " => leWeakL $\operatorname{Inv}(\sigma^{-1}) \subseteq \operatorname{Inv}(\tau^{-1})$. *Definition 2.6 (`defn:weakOrders`), part 2/2, of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] def leWeakR (σ τ : AspPerm) : Prop := invSet (σ⁻¹).func ⊆ invSet (τ⁻¹).func /-- Infix notation for the right weak order on ASP permutations. -/ infix:50 " ≤R " => leWeakR @@ -1687,22 +1696,24 @@ lemma sr_subset (τ α : AspPerm) (h_R : α ≤R τ) : (τ.sr α) '' invSet α exact ⟨u_lt_v, τu_gt_τv⟩ /-- The min-plus Demazure-product value is at least `n` at `(a, b)`. -/ -def dprodValGe (α β : AspPerm) (a b n : ℤ) : Prop := +@[expose] def dprodValGe (α β : AspPerm) (a b n : ℤ) : Prop := ∀ l : ℤ, α.s a l + β.s l b ≥ n /-- Pointwise lower-bound predicate for a candidate Demazure product. -/ +@[expose] def leDprod (τ α β : AspPerm) : Prop := ∀ a b : ℤ, dprodValGe α β a b (τ.s a b) /-- The min-plus Demazure-product value is at most `n` at `(a, b)`. -/ -def dprodValLe (α β : AspPerm) (a b n : ℤ) : Prop := +@[expose] def dprodValLe (α β : AspPerm) (a b n : ℤ) : Prop := ∃ l : ℤ, α.s a l + β.s l b ≤ n /-- Pointwise upper-bound predicate for a candidate Demazure product. -/ -def geDprod (τ α β : AspPerm) : Prop := +@[expose] def geDprod (τ α β : AspPerm) : Prop := ∀ a b : ℤ, dprodValLe α β a b (τ.s a b) /-- Pointwise equality predicate for a candidate Demazure product. -/ +@[expose] def eqDprod (τ α β : AspPerm) : Prop := τ.leDprod α β ∧ τ.geDprod α β diff --git a/LeanPool/DemazureProduct/Avoiding321.lean b/LeanPool/DemazureProduct/Avoiding321.lean index 739fb4aafb..d6fe80ed0c 100644 --- a/LeanPool/DemazureProduct/Avoiding321.lean +++ b/LeanPool/DemazureProduct/Avoiding321.lean @@ -24,13 +24,14 @@ permutations (not necessarily of finite length), which are all automatically in This material is not present in [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct /-- The 321-avoidance condition used in this file: every triple `i < j < k` has either `τ i < τ j` or `τ j < τ k`. -/ +@[expose] def is321a (τ : ℤ → ℤ) : Prop := ∀ (i j k : ℤ), i < j → j < k → τ i < τ j ∨ τ j < τ k @@ -150,6 +151,7 @@ theorem is_321a_iff_set_321a_prop (τ : ℤ → ℤ) (hperm : Function.Bijective exact ⟨ ⟨i_lt_j, h1⟩, ⟨j_lt_k, h2⟩ ⟩ /-- The triangle-free abstract ASP set associated to a 321-avoiding ASP permutation. -/ +@[expose] def tfasOfPerm {τ : AspPerm} (h_321a : is321a τ) : tfas := ⟨AspSet.ofAspPerm τ, by constructor · exact AspSet.AspSet_InvSet_of_AspPerm τ @@ -694,6 +696,7 @@ lemma between_inv_lel · simp_all /-- The interval-subordination relation on inversion boxes. -/ +@[expose] def intervalSub (i₁ i₂ : (ℤ × ℤ)) : Prop := i₂.1 ≤ i₁.1 ∧ i₁.2 ≤ i₂.2 /-- Infix notation for interval-subordination of inversion boxes. -/ @@ -1361,6 +1364,7 @@ theorem dprod_ge_iff_union : /-- A set of boxes is isolated if it contains no two distinct comparable elements. -/ +@[expose] def isolated (S : Set (ℤ × ℤ)) : Prop := ∀ I ∈ S, ∀ J ∈ S, I ≼ J → I = J /-- In the 321-avoiding setting, the inequality `α ⋆ β ≤ τ` is equivalent to diff --git a/LeanPool/DemazureProduct/InvSet.lean b/LeanPool/DemazureProduct/InvSet.lean index e60d519f49..987558c944 100644 --- a/LeanPool/DemazureProduct/InvSet.lean +++ b/LeanPool/DemazureProduct/InvSet.lean @@ -24,7 +24,7 @@ It corresponds to Theorem 2.13 of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -190,6 +190,7 @@ lemma AspSet_InvSet_of_AspPerm (τ : AspPerm) : AspSet_prop (invSet τ) := by · exact τ.inset_finite /-- The abstract inversion set associated to an ASP permutation. -/ +@[expose] def ofAspPerm (τ : AspPerm) : AspSet := ⟨invSet τ, AspSet_InvSet_of_AspPerm τ⟩ @@ -658,6 +659,7 @@ theorem func_asp : isAsp (asps.recon χ) := by /-- Package the function reconstructed from an ASP set and a shift as an `AspPerm`. -/ +@[expose] noncomputable def toAspPerm : AspPerm := ⟨asps.recon χ, (by exact func_bijective asps χ), (by exact func_asp asps χ)⟩ @@ -724,10 +726,10 @@ noncomputable def aspPermEquivAspSet : · simpa using chi_of_toAspPerm asps χ @[simp] lemma AspPerm_equiv_AspSet_toFun_fst (τ : AspPerm) : - ((aspPermEquivAspSet τ).1 : Set (ℤ × ℤ)) = invSet τ := rfl + ((aspPermEquivAspSet τ).1 : Set (ℤ × ℤ)) = invSet τ := by rfl @[simp] lemma AspPerm_equiv_AspSet_toFun_snd (τ : AspPerm) : - (aspPermEquivAspSet τ).2 = τ.χ := rfl + (aspPermEquivAspSet τ).2 = τ.χ := by rfl @[simp] lemma inv_set_AspPerm_equiv_AspSet_invFun (asps : AspSet) (χ : ℤ) : invSet (aspPermEquivAspSet.symm (asps, χ)) = asps := diff --git a/LeanPool/DemazureProduct/ReducedProducts.lean b/LeanPool/DemazureProduct/ReducedProducts.lean index 3c5688f7e4..9c562c54f2 100644 --- a/LeanPool/DemazureProduct/ReducedProducts.lean +++ b/LeanPool/DemazureProduct/ReducedProducts.lean @@ -20,7 +20,7 @@ permutations. It corresponds roughly to Section 5 of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct diff --git a/LeanPool/DemazureProduct/Reduction.lean b/LeanPool/DemazureProduct/Reduction.lean index 17c4b2ae86..da22bea0f7 100644 --- a/LeanPool/DemazureProduct/Reduction.lean +++ b/LeanPool/DemazureProduct/Reduction.lean @@ -22,7 +22,7 @@ This file formalizes the main theorems from the introduction of (`thm:reduce`) reduces inequalities `α ⋆ β ≥ γ` to equalities of reduced products. It corresponds roughly to Section 6 of the paper. -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct diff --git a/LeanPool/DemazureProduct/SlipFace.lean b/LeanPool/DemazureProduct/SlipFace.lean index 26221372c0..d5803446e9 100644 --- a/LeanPool/DemazureProduct/SlipFace.lean +++ b/LeanPool/DemazureProduct/SlipFace.lean @@ -26,7 +26,7 @@ Section 3, with some essential-set material from Section 7.1, of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -353,6 +353,9 @@ noncomputable def SlipValley (s t : SlipFace) (a b : ℤ) : Valley where · linarith [t.nonneg n b, s.ge_diff a n] · linarith [s.nonneg a n, t.ge_diff n b] +lemma SlipValley_f (s t : SlipFace) (a b : ℤ) : + (SlipValley s t a b).f = fun l => s a l + t l b := by rfl + /-- The min-plus product formula $$ (s \star t)(a,b) = \min_{\ell \in \mathbb{Z}} [s(a,\ell) + t(\ell,b)]. @@ -362,7 +365,7 @@ In Lean, `starFunc s t a b` is this integer value, while `s ⋆ t` is the result `SlipFace`. See *Definition 3.7 (`defn:sfAlgebra`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ -noncomputable def starFunc (s t : SlipFace) : ℤ → ℤ → ℤ := +@[expose] noncomputable def starFunc (s t : SlipFace) : ℤ → ℤ → ℤ := fun a b => (SlipValley s t a b).min lemma star_dual_ineq (s t : SlipFace) (a b : ℤ) : @@ -624,6 +627,7 @@ lemma star_assoc (r s t : SlipFace) : r ⋆ s ⋆ t = r ⋆ (s ⋆ t) := by omega /-- The identity slipface, given by the positive part of `a - b`. -/ +@[expose] def id : SlipFace := { func := fun a b => max (a - b) 0, χ := 0, @@ -775,6 +779,7 @@ $$ $$ See *Definition 3.7* (`defn:sfAlgebra`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ +@[expose] noncomputable def lresFunc (s t : SlipFace) : ℤ → ℤ → ℤ := fun a b => s a (lresWit s t a b) - t.dual b (lresWit s t a b) @@ -1264,7 +1269,7 @@ left/right duality to dual slipfaces. /-- A small set on which witnesses to the value $s \star t (a,b)$ always occur. *Lemma 3.13 (`lem:setL`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227), part 1/5.* -/ -def bendSet (t : SlipFace) (b : ℤ) : Set ℤ := +@[expose] def bendSet (t : SlipFace) (b : ℤ) : Set ℤ := {l : ℤ | t (l-1) b = t l b ∧ t l b ≠ t (l+1) b} /-- *Lemma 3.13 (`lem:setL`) of @@ -1684,6 +1689,7 @@ $$ $$ In Lean this is written `sf.Δ a b`. -/ +@[expose] def Δ (a b : ℤ) : ℤ := sf (a+1) b - sf a b - sf (a+1) (b+1) + sf a (b+1) @@ -1782,11 +1788,13 @@ lemma sum_ab {a₁ a₂ b₁ b₂ : ℤ} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b /-- A slipface is submodular if $\Delta s(a,b) \ge 0$ for all `a, b`. *Definition 4.2 (`defn:submodular`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] def submodular : Prop := ∀ a b : ℤ, sf.Δ a b ≥ 0 /-- The set of boxes where the mixed difference `Δ` is equal to `1`, as defined in the proof of *Proposition 4.3* (`prop:imageASP`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] def Γ : Set (ℤ × ℤ) := {(a, b) | sf.Δ a b = 1} lemma Γ_dual : ∀ (a b : ℤ), (a, b) ∈ sf.Γ ↔ (b, a) ∈ sf.dual.Γ := by @@ -1804,7 +1812,7 @@ slipface. $\operatorname{Ess}(s) = \{ (a,b) \in \mathbb{Z}^2: s(a-1,b) < s(a,b) = s(a+1,b) \mbox{ and } s(a,b+1) < s(a,b) = s(a,b-1) \}.$ -/ -def ess : Set (ℤ × ℤ) := {(a, b) | sf (a-1) b < sf a b ∧ sf a b = sf (a+1) b +@[expose] def ess : Set (ℤ × ℤ) := {(a, b) | sf (a-1) b < sf a b ∧ sf a b = sf (a+1) b ∧ sf a (b+1) < sf a b ∧ sf a b = sf a (b-1)} /-- Lemma 7.2 (`lem:essSetMoves`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227). @@ -1897,6 +1905,7 @@ private lemma ess_seeker (s t : SlipFace) (nle : ¬ s ≤ t) (M : ℕ) : /-- *Definition 7.3 (`defn:cliffordSF`) of [An extended Demazure product](https://arxiv.org/abs/2206.14227).* -/ +@[expose] def isClifford : Prop := ∃ (M : ℕ), ∀ a b : ℤ, sf a b + sf.dual b a ≥ M → sf a b = 0 ∨ sf.dual b a = 0 diff --git a/LeanPool/DemazureProduct/Submodular.lean b/LeanPool/DemazureProduct/Submodular.lean index 9720003ca1..8b3a74e133 100644 --- a/LeanPool/DemazureProduct/Submodular.lean +++ b/LeanPool/DemazureProduct/Submodular.lean @@ -22,7 +22,7 @@ It corresponds roughly to Section 4 of [An extended Demazure product](https://arxiv.org/abs/2206.14227). -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -406,7 +406,8 @@ private lemma AspSlipValley (α β : AspPerm) (a b : ℤ) : suffices (AspValley α β a b).f = (SlipFace.SlipValley α.s β.s a b).f by rwa [Valley.mk.injEq] ext l - dsimp [AspValley, SlipFace.SlipValley, AspPerm.s] + rw [SlipFace.SlipValley_f] + rfl /-- If `τ = α ⋆ β` in the Demazure sense, then the minimum of `AspValley α β a b` is `τ.s a b`. -/ @@ -557,7 +558,7 @@ lemma AspValley_step_b (α β : AspPerm) (a b : ℤ) : intro n subst v w; simp only [AspValley] rw [β.b_step n b] - unfold Valley.shiftDown + rw [Valley.shiftDown_f] by_cases h : n ≤ β b · simp only [h, ↓reduceIte, sub_add_cancel, add_right_inj, sub_eq_self, ite_eq_right_iff, one_ne_zero, imp_false, not_lt] @@ -1306,6 +1307,7 @@ instance : PartialOrder AspPerm where /-- The relation $\alpha \leq_\chi \beta$ from [An extended Demazure product](https://arxiv.org/abs/2206.14227): Bruhat order together with equality of shifts. In Lean this is the infix `≤χ`. -/ +@[expose] def leChi (σ τ : AspPerm) : Prop := σ ≤ τ ∧ σ.χ = τ.χ /-- Infix notation for Bruhat order plus equality of shifts. -/ infix:50 " ≤χ " => leChi diff --git a/LeanPool/DemazureProduct/Tableaux.lean b/LeanPool/DemazureProduct/Tableaux.lean index 5674db4876..fa4cafa89f 100644 --- a/LeanPool/DemazureProduct/Tableaux.lean +++ b/LeanPool/DemazureProduct/Tableaux.lean @@ -26,7 +26,7 @@ it gives an additional formal correspondence between fixed-shift set-valued tabl Hecke factorizations for the 321-avoiding case. -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -471,6 +471,7 @@ open AspPerm /-- A Hecke factorization of `τ`, represented as a list of ASP permutations whose Demazure product is `τ`. -/ +@[expose] def HeckeFactorization (τ : AspPerm) : Type := {P : List AspPerm // DProd P = τ} @@ -494,6 +495,7 @@ def isChain : List (Set (ℤ × ℤ) × ℤ) → Prop /-- A chain of box sets with shifts whose union is `invSet τ`, whose total shift is `τ.χ`, and whose pieces are linked in order. -/ +@[expose] def PChain (τ : AspPerm) : Type := {C : List (Set (ℤ × ℤ) × ℤ) // isChain C ∧ boxUnion C = invSet τ ∧ chiSum C = τ.χ} @@ -794,6 +796,7 @@ structure SetValuedTableau_prop {τ : AspPerm} {n : ℕ} i ∈ T p → j ∈ T q → p.val ≼ q.val → p ≠ q → j ≤ i /-- A set-valued tableau on `invSet τ` with symbols `1, ..., n`. -/ +@[expose] def SetValuedTableau (τ : AspPerm) (n : ℕ) : Type := {T : ↥(invSet τ) → Finset (Fin n) // SetValuedTableau_prop (τ := τ) T} @@ -807,6 +810,7 @@ structure LabelChain_prop {τ : AspPerm} {n : ℕ} /-- A fixed-length chain of subsets of `invSet τ`, indexed by the symbols `1, ..., n`. -/ +@[expose] def LabelChain (τ : AspPerm) (n : ℕ) : Type := {C : Fin n → Set (ℤ × ℤ) // LabelChain_prop (τ := τ) C} diff --git a/LeanPool/DemazureProduct/Transpositions.lean b/LeanPool/DemazureProduct/Transpositions.lean index 7606582818..bd5809336f 100644 --- a/LeanPool/DemazureProduct/Transpositions.lean +++ b/LeanPool/DemazureProduct/Transpositions.lean @@ -25,7 +25,7 @@ Theorem A and the theorem labeled `thm:resL`, which describe the special case of $S = \{n\}$ a singleton. -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -142,7 +142,7 @@ private lemma sigma_involutive {S : Set ℤ} (hS : NoConsecutive S) : -- Proof written by GPT 5.5. apply AspPerm.ext.mpr funext n - change Function.invFun (sigma S hS).func n = sigma S hS n + rw [AspPerm.inv_func] apply (sigma S hS).injective rw [Function.rightInverse_invFun (sigma S hS).surjective n] exact Eq.symm <| sigma_involutive hS n diff --git a/LeanPool/DemazureProduct/Utils.lean b/LeanPool/DemazureProduct/Utils.lean index 26202cb09f..2136b603c9 100644 --- a/LeanPool/DemazureProduct/Utils.lean +++ b/LeanPool/DemazureProduct/Utils.lean @@ -21,7 +21,7 @@ This file contains small helper lemmas. These are all generic -- they are not sp repository's main objects, so they are collected separately here. -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct diff --git a/LeanPool/DemazureProduct/Valley.lean b/LeanPool/DemazureProduct/Valley.lean index e525629134..f917960a13 100644 --- a/LeanPool/DemazureProduct/Valley.lean +++ b/LeanPool/DemazureProduct/Valley.lean @@ -24,7 +24,7 @@ to keep track of the set where the minimum value is achieved, and some facts abo changes when the valley is modified in simple ways. -/ -@[expose] public section +public section namespace LeanPool.DemazureProduct @@ -116,6 +116,8 @@ def shiftDown (k : ℤ) : Valley where rw [this] apply v.rises +lemma shiftDown_f (k : ℤ) : (v.shiftDown k).f = fun n => v.f n - k := by rfl + /-- Shifting a valley downward does not change its rightmost minimizer. -/ lemma shift_down_M (k : ℤ) : (v.shiftDown k).M = v.M := by let v' := v.shiftDown k diff --git a/LeanPool/DensityHalesJewett.lean b/LeanPool/DensityHalesJewett.lean index 99960bb41b..f0c4041518 100644 --- a/LeanPool/DensityHalesJewett.lean +++ b/LeanPool/DensityHalesJewett.lean @@ -35,4 +35,4 @@ Tags: combinatorics MSC: 05D10, 05A05, 11B75, 68R15 -/ -@[expose] public section +public section diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Canonization.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Canonization.lean index ac90832154..50326e869d 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Canonization.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Canonization.lean @@ -24,7 +24,7 @@ application of the ordinary Hales--Jewett theorem per variable, each of them app profile of colours obtained by letting the remaining positions vary. -/ -@[expose] public section +public section open Finset open Combinatorics @@ -32,7 +32,7 @@ open Combinatorics namespace DensityHalesJewett /-- Two words over `Option α` have the same support when their variable positions agree. -/ -def SameSupport {α ι : Type*} (x y : ι → Option α) : Prop := ∀ i, x i = none ↔ y i = none +@[expose] def SameSupport {α ι : Type*} (x y : ι → Option α) : Prop := ∀ i, x i = none ↔ y i = none namespace Line @@ -57,7 +57,7 @@ variable {α η θ ι : Type*} /-- Substitute a word over `Option α` into a combinatorial subspace, marking variable positions of the parameter word by `none`. -/ -def wordMap (V : Combinatorics.Subspace η α ι) (x : η → Option α) : ι → Option α := +@[expose] def wordMap (V : Combinatorics.Subspace η α ι) (x : η → Option α) : ι → Option α := fun i ↦ Sum.elim some x (V.idxFun i) lemma wordMap_compose (V : Combinatorics.Subspace η α ι) (W : Combinatorics.Subspace θ α η) diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement.lean index e92c8e3e13..4564e31788 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement.lean @@ -17,7 +17,7 @@ Tiling a structured insensitive intersection by subspaces and averaging over the structured correlation into a genuine density increment on a subspace. -/ -@[expose] public section +public section open Finset open Combinatorics diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/CorrelatedFibers.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/CorrelatedFibers.lean index 72a20aac06..61a94853e5 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/CorrelatedFibers.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/CorrelatedFibers.lean @@ -17,7 +17,7 @@ common fibers; averaging over fixed suffixes then yields either an immediate den suffix carrying many complete restricted-alphabet lines. -/ -@[expose] public section +public section open Finset open Combinatorics @@ -26,11 +26,11 @@ open scoped BigOperators namespace DensityHalesJewett /-- A finite word family contains no complete combinatorial line. -/ -def IsLineFree {α ι : Type*} (A : Finset (ι → α)) : Prop := +@[expose] def IsLineFree {α ι : Type*} (A : Finset (ι → α)) : Prop := ∀ l : Combinatorics.Line α ι, ∃ a, l a ∉ A /-- Pull a word family back to the parameter cube of a subspace. -/ -noncomputable def pullback {η α ι : Type*} [Fintype (η → α)] +@[expose] noncomputable def pullback {η α ι : Type*} [Fintype (η → α)] (V : Combinatorics.Subspace η α ι) (A : Finset (ι → α)) : Finset (η → α) := parameterPreimage V A diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/Parameters.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/Parameters.lean index 95381329d3..44502b1b0f 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/Parameters.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/Parameters.lean @@ -15,7 +15,7 @@ The thresholds `θ`, `η`, and `γ` attached to an alphabet size and a density, monotonicity and positivity properties. -/ -@[expose] public section +public section open Finset open Combinatorics @@ -26,7 +26,7 @@ namespace DensityHalesJewett namespace Parameters /-- A positive dimension selected from the density Hales--Jewett assertion when available. -/ -noncomputable def m₀ (k : ℕ) (δ : ℝ) : ℕ := by +@[expose] noncomputable def m₀ (k : ℕ) (δ : ℝ) : ℕ := by classical exact if h : 0 < δ ∧ HasDensityHJ k then Nat.succ <| Nat.find <| h.2 (δ / 4) (by linarith) @@ -77,7 +77,7 @@ lemma θ_denominator_pos {k : ℕ} (hk : 2 ≤ k) (δ : ℝ) : · exact Nat.ne_of_gt <| m₀_pos k δ /-- The correlated-fibers threshold attached to an alphabet size and density. -/ -noncomputable def θ (k : ℕ) (δ : ℝ) : ℝ := +@[expose] noncomputable def θ (k : ℕ) (δ : ℝ) : ℝ := (δ / 4) / (((k + 1 : ℕ) : ℝ) ^ m₀ k δ - (k : ℝ) ^ m₀ k δ) @@ -131,7 +131,7 @@ lemma η_pos {k : ℕ} (hk : 2 ≤ k) {δ : ℝ} (hδ : 0 < δ) : 0 < η k δ := · positivity /-- The density increment attached to an alphabet size and density. -/ -noncomputable def γ (k : ℕ) (δ : ℝ) : ℝ := +@[expose] noncomputable def γ (k : ℕ) (δ : ℝ) : ℝ := min (δ * η k δ ^ 2 / k) (min (η k δ ^ 2 / 2) (3 * η k δ)) /-- The increment is monotone in the density parameter. -/ diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/StructuredCorrelation.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/StructuredCorrelation.lean index 62da56ecf9..0d57a8b3cd 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/StructuredCorrelation.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/DensityIncrement/StructuredCorrelation.lean @@ -18,7 +18,7 @@ insensitive families, and the first-failure partition upgrades that intersection correlated with the ambient word family. -/ -@[expose] public section +public section open Finset open Combinatorics diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/FiniteUnions.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/FiniteUnions.lean index e9921e2cc4..86f0ade923 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/FiniteUnions.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/FiniteUnions.lean @@ -20,7 +20,7 @@ canonizes the colour of a union in terms of its least block, and the pigeonhole extracts a monochromatic family. -/ -@[expose] public section +public section open Finset open Combinatorics diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/GrahamRothschild.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/GrahamRothschild.lean index 45e45ef255..afc4407944 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/GrahamRothschild.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/GrahamRothschild.lean @@ -32,7 +32,7 @@ write-up, and with it the finite Ramsey theorem used to arrange the blocks in in is not needed here: pairwise disjoint blocks already describe a subspace. -/ -@[expose] public section +public section open Finset open Combinatorics diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Insensitive.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Insensitive.lean index 81ab82410c..c284c0fb71 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Insensitive.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Insensitive.lean @@ -19,7 +19,7 @@ Boolean closure of insensitive families and the subspace-tiling results used in increment argument. -/ -@[expose] public section +public section open Finset open Combinatorics @@ -32,7 +32,7 @@ def InsensitiveEquiv {α ι : Type*} (i j : α) (x y : ι → α) : Prop := ∀ a, a ≠ i → a ≠ j → ∀ c, (x c = a ↔ y c = a) /-- Membership in an `(i,j)`-insensitive family is constant on insensitive-equivalence classes. -/ -def IsInsensitive {α ι : Type*} (i j : α) (D : Finset (ι → α)) : Prop := +@[expose] def IsInsensitive {α ι : Type*} (i j : α) (D : Finset (ι → α)) : Prop := ∀ ⦃x y⦄, InsensitiveEquiv i j x y → (x ∈ D ↔ y ∈ D) /-- Transport a word family along an equivalence of coordinate types. -/ @@ -84,7 +84,7 @@ lemma compl {α ι : Type*} [Fintype (ι → α)] [DecidableEq (ι → α)] simp only [mem_compl, hD hxy] /-- The part of `D` left uncovered by a set of subspaces. -/ -noncomputable def uncovered {η α ι : Type*} [Fintype (η → α)] +@[expose] noncomputable def uncovered {η α ι : Type*} [Fintype (η → α)] [DecidableEq (ι → α)] (D : Finset (ι → α)) (𝒱 : Set (Combinatorics.Subspace η α ι)) : Finset (ι → α) := by classical diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Main.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Main.lean index 41b46ddd6c..6e9191c38a 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Main.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Main.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.LinearCombination The binary base case and induction on the alphabet size. -/ -@[expose] public section +public section open Finset open Combinatorics diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Subspace.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Subspace.lean index ac3f714f17..48d199f377 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Subspace.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Subspace.lean @@ -15,7 +15,7 @@ Ranges, containment, relative density, alphabet restriction, and lines inside ma `Combinatorics.Subspace`. -/ -@[expose] public section +public section open Finset Function open Combinatorics @@ -34,7 +34,7 @@ lemma injective (V : Combinatorics.Subspace η α ι) : simpa only [V.apply_inr hi] using congrFun hxy i /-- The finite range of a combinatorial subspace. -/ -def range [Fintype (η → α)] [DecidableEq (ι → α)] +@[expose] def range [Fintype (η → α)] [DecidableEq (ι → α)] (V : Combinatorics.Subspace η α ι) : Finset (ι → α) := Finset.univ.image V @@ -45,11 +45,11 @@ lemma mem_range [Fintype (η → α)] [DecidableEq (ι → α)] simp [range] /-- A subspace is contained in a finite word family when all its evaluations belong to it. -/ -def IsContained (V : Combinatorics.Subspace η α ι) (A : Finset (ι → α)) : Prop := +@[expose] def IsContained (V : Combinatorics.Subspace η α ι) (A : Finset (ι → α)) : Prop := ∀ x, V x ∈ A /-- Compose a parameter subspace with an ambient subspace. -/ -def compose (V : Combinatorics.Subspace η α ι) (W : Combinatorics.Subspace θ α η) : +@[expose] def compose (V : Combinatorics.Subspace η α ι) (W : Combinatorics.Subspace θ α η) : Combinatorics.Subspace θ α ι where idxFun i := (V.idxFun i).elim Sum.inl W.idxFun proper e := by @@ -119,17 +119,17 @@ lemma lineToSubspaceFinOne_apply (l : Combinatorics.Line α ι) (x : Fin 1 → simp [lineToSubspaceFinOne, Fin.eq_zero] /-- Relative density on a subspace, defined on its parameter cube. -/ -def relativeDensity [Fintype (η → α)] [DecidableEq (ι → α)] +@[expose] def relativeDensity [Fintype (η → α)] [DecidableEq (ι → α)] (V : Combinatorics.Subspace η α ι) (A : Finset (ι → α)) : ℚ≥0 := (Finset.univ.filter fun x ↦ V x ∈ A).dens /-- Ambient line structures whose evaluations are contained in a subspace. -/ -def Lines [Fintype (η → α)] [DecidableEq (ι → α)] +@[expose] def Lines [Fintype (η → α)] [DecidableEq (ι → α)] (V : Combinatorics.Subspace η α ι) := {l : Combinatorics.Line α ι // ∀ a, l a ∈ range V} /-- Compose a parameter-cube line with a combinatorial subspace. -/ -def composeLine (V : Combinatorics.Subspace η α ι) (l : Combinatorics.Line α η) : +@[expose] def composeLine (V : Combinatorics.Subspace η α ι) (l : Combinatorics.Line α η) : Combinatorics.Line α ι where idxFun i := (V.idxFun i).elim some l.idxFun proper := by @@ -229,7 +229,7 @@ def mapLine (V : Combinatorics.Subspace η α ι) (l : Combinatorics.Line α η) composeLine V l lemma mapLine_eq_composeLine (V : Combinatorics.Subspace η α ι) (l : Combinatorics.Line α η) : - mapLine V l = composeLine V l := + mapLine V l = composeLine V l := by rfl @[simp] @@ -238,7 +238,7 @@ lemma mapLine_apply (V : Combinatorics.Subspace η α ι) (l : Combinatorics.Lin composeLine_apply V l a /-- Restrict the variable letters of a subspace along an alphabet embedding. -/ -def restrictAlphabet {β : Type*} [Fintype (η → β)] [DecidableEq (ι → α)] +@[expose] def restrictAlphabet {β : Type*} [Fintype (η → β)] [DecidableEq (ι → α)] (V : Combinatorics.Subspace η α ι) (e : β ↪ α) : Finset (ι → α) := Finset.univ.image fun x ↦ V (e ∘ x) @@ -261,7 +261,7 @@ lemma transportSubspace_apply {α η ι ω ν : Type*} (e : ι ≃ ω ⊕ ν) (z cases e c <;> simp only [Sum.elim_inl, Sum.elim_inr, id_eq, Combinatorics.Subspace.coe_apply] /-- The preimage of a word family in a subspace parameter cube. -/ -noncomputable def parameterPreimage {η α ι : Type*} [Fintype (η → α)] +@[expose] noncomputable def parameterPreimage {η α ι : Type*} [Fintype (η → α)] (V : Combinatorics.Subspace η α ι) (D : Finset (ι → α)) : Finset (η → α) := by classical apply Finset.univ.filter diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Szemeredi.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Szemeredi.lean index e0ecae227f..59c0de1b81 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Szemeredi.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Szemeredi.lean @@ -17,7 +17,7 @@ The digital transfer from density Hales--Jewett to Szemeredi's theorem on finite mathlib's fixed-length base encoding `finFunctionFinEquiv`. -/ -@[expose] public section +public section open Finset open Combinatorics @@ -36,7 +36,7 @@ structure ArithmeticProgression (α : Type*) [AddMonoid α] (k : ℕ) where namespace ArithmeticProgression /-- The term of `P` indexed by `i`. -/ -def term {α : Type*} [AddMonoid α] {k : ℕ} (P : ArithmeticProgression α k) +@[expose] def term {α : Type*} [AddMonoid α] {k : ℕ} (P : ArithmeticProgression α k) (i : Fin k) : α := P.start + (i : ℕ) • P.diff diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/UniformFibers.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/UniformFibers.lean index 02f0c1c5d0..f85da9f10f 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/UniformFibers.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/UniformFibers.lean @@ -17,7 +17,7 @@ Multidimensional density Hales--Jewett, uniform fibers, and the restricted-alpha lemma. All subspaces below are mathlib's `Combinatorics.Subspace`. -/ -@[expose] public section +public section open Finset open Combinatorics @@ -26,14 +26,14 @@ open scoped BigOperators namespace DensityHalesJewett /-- The density Hales--Jewett assertion for the alphabet `Fin k`. -/ -def HasDensityHJ (k : ℕ) : Prop := +@[expose] def HasDensityHJ (k : ℕ) : Prop := ∀ δ : ℝ, 0 < δ → ∃ N, ∀ n, N ≤ n → ∀ A : Finset (Fin n → Fin k), δ * (k : ℝ) ^ n ≤ #A → ∃ l : Combinatorics.Line (Fin k) (Fin n), ∀ a, l a ∈ A namespace Subspace /-- A one-dimensional density Hales--Jewett threshold selected from `HasDensityHJ`. -/ -noncomputable def densityOneBound (k : ℕ) (δ : ℝ) : ℕ := by +@[expose] noncomputable def densityOneBound (k : ℕ) (δ : ℝ) : ℕ := by classical exact if h : 0 < δ ∧ HasDensityHJ k then Nat.find (h.2 δ h.1) diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Varnavides.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Varnavides.lean index b22dc815ae..911efd7980 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Varnavides.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Varnavides.lean @@ -14,7 +14,7 @@ Varnavides' averaging argument upgrades Szemerédi's theorem from the existence progression in a dense set to a quadratic lower bound on the number of such progressions. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/DensityHalesJewett/DensityHalesJewett/Word.lean b/LeanPool/DensityHalesJewett/DensityHalesJewett/Word.lean index e207f218b6..48921b1870 100644 --- a/LeanPool/DensityHalesJewett/DensityHalesJewett/Word.lean +++ b/LeanPool/DensityHalesJewett/DensityHalesJewett/Word.lean @@ -22,7 +22,7 @@ coordinate types, and `Equiv.sumArrowEquivProdArrow` for the underlying decompos a sum of coordinate types. -/ -@[expose] public section +public section open Finset open scoped BigOperators @@ -31,7 +31,7 @@ namespace DensityHalesJewett /-- The fiber of a word family above a fixed prefix. Words on a sum of coordinate types are concatenations `Sum.elim x y` of their two parts. -/ -def fiber {α ι κ : Type*} [Fintype (κ → α)] [DecidableEq (ι ⊕ κ → α)] +@[expose] def fiber {α ι κ : Type*} [Fintype (κ → α)] [DecidableEq (ι ⊕ κ → α)] (A : Finset (ι ⊕ κ → α)) (x : ι → α) : Finset (κ → α) := Finset.univ.filter fun y ↦ Sum.elim x y ∈ A diff --git a/LeanPool/DensityHalesJewett/Solution.lean b/LeanPool/DensityHalesJewett/Solution.lean index 663dd60f40..e21c047381 100644 --- a/LeanPool/DensityHalesJewett/Solution.lean +++ b/LeanPool/DensityHalesJewett/Solution.lean @@ -21,7 +21,7 @@ letters give distinct words. This is Mathlib's `Combinatorics.Line α (Fin n)`, of the line indexed by the letter `x`. -/ -@[expose] public section +public section open Filter Finset open Combinatorics diff --git a/LeanPool/Desargues.lean b/LeanPool/Desargues.lean index edc573bd32..eb8c0766fc 100644 --- a/LeanPool/Desargues.lean +++ b/LeanPool/Desargues.lean @@ -21,7 +21,7 @@ Tags: projective-geometry, incidence-geometry, geometry MSC: 51A05, 51A30 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Desargues/Basic.lean b/LeanPool/Desargues/Basic.lean index e3d42e7398..f17ea6e465 100644 --- a/LeanPool/Desargues/Basic.lean +++ b/LeanPool/Desargues/Basic.lean @@ -24,7 +24,7 @@ Defines the projective-geometry axioms, the line operator, and central projection between lines in an axiomatic projective geometry. -/ -@[expose] public section +public section open Set @@ -152,7 +152,7 @@ variable [DecidableEq G] /-- The line operator `⋆`: `star ell a b` is the line through `a` and `b`, defined as `{c | ell a b c}` when `a ≠ b` and as `{a}` when `a = b`. -/ -@[simp] +@[expose, simp] def star (ell : G → G → G → Prop) (a b : G) : diff --git a/LeanPool/Desargues/Morphism.lean b/LeanPool/Desargues/Morphism.lean index 34e98c6233..1595727b20 100644 --- a/LeanPool/Desargues/Morphism.lean +++ b/LeanPool/Desargues/Morphism.lean @@ -17,7 +17,7 @@ Defines isomorphisms of projective geometries as bijections preserving the collinearity relation. -/ -@[expose] public section +public section open Basic diff --git a/LeanPool/Desargues/PV.lean b/LeanPool/Desargues/PV.lean index 72822c535d..09e32dfc4a 100644 --- a/LeanPool/Desargues/PV.lean +++ b/LeanPool/Desargues/PV.lean @@ -17,7 +17,7 @@ Proves that Mathlib projectivizations satisfy the projective-geometry axioms for the dependence-based collinearity relation. -/ -@[expose] public section +public section open Finset Set Submodule FiniteDimensional Projectivization open scoped LinearAlgebra.Projectivization diff --git a/LeanPool/Desargues/Structure.lean b/LeanPool/Desargues/Structure.lean index 5d3e35d327..fc3a151c39 100644 --- a/LeanPool/Desargues/Structure.lean +++ b/LeanPool/Desargues/Structure.lean @@ -21,7 +21,7 @@ Defines subspaces of an axiomatic projective geometry and the induced projective subgeometry structure on a closed subset. -/ -@[expose] public section +public section open Set open Basic diff --git a/LeanPool/Dilatations/Basic.lean b/LeanPool/Dilatations/Basic.lean index 69ff4bc1c0..a6b1c88808 100644 --- a/LeanPool/Dilatations/Basic.lean +++ b/LeanPool/Dilatations/Basic.lean @@ -16,7 +16,7 @@ https://arxiv.org/abs/2608.09305, and `rndmx/DilCat` at commit `604559654c948566675da3f7709b8ad3126bd487` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -53,10 +53,12 @@ variable {C : Type u} [Category.{v} C] variable (Z : Center C) /-- Whether a dependent morphism is one of the chosen denominators. -/ +@[expose] def IsCenterMor (f : Σ X Y : C, X ⟶ Y) : Prop := ∃ i : Z.I, f = ⟨Z.dom i, Z.cod i, Z.mor i⟩ /-- The MorphismProperty corresponding to IsCenterMor. -/ +@[expose] def CenterMorphismProperty : MorphismProperty C := fun X Y f => IsCenterMor Z ⟨X, Y, f⟩ /-- The localized category obtained by formally inverting the morphisms in @@ -64,17 +66,18 @@ def CenterMorphismProperty : MorphismProperty C := fun X Y f => IsCenterMor Z def CenterLocalization : Type u := (CenterMorphismProperty Z).Localization /-- The canonical functor from C to the localization. -/ -def LocalizationFunctor : C ⥤ (CenterMorphismProperty Z).Localization := +@[expose] def LocalizationFunctor : C ⥤ (CenterMorphismProperty Z).Localization := (CenterMorphismProperty Z).Q /-- A chosen denominator together with a permitted numerator. -/ -def CenterSievePair : Type (max u v) := +@[expose] def CenterSievePair : Type (max u v) := Σ i : Z.I, Σ X : C, { f : X ⟶ Z.cod i // Z.N i f } /-- The quiver obtained by adjoining formal inverses of the chosen denominators. -/ def localizationQuiver := LocQuiver (CenterMorphismProperty Z) /-- The formal inverse of the denominator attached to a numerator. -/ +@[expose] def inverseInPath (p : CenterSievePair Z) : ιPaths (CenterMorphismProperty Z) (Z.cod p.1) ⟶ ιPaths (CenterMorphismProperty Z) (Z.dom p.1) := @@ -82,6 +85,7 @@ def inverseInPath (p : CenterSievePair Z) : (Z.mor p.1) ⟨p.1, rfl⟩ /-- The path consisting of a numerator followed by its formal denominator inverse. -/ +@[expose] def fractionInPath (p : CenterSievePair Z) : ιPaths (CenterMorphismProperty Z) (p.2.1) ⟶ ιPaths (CenterMorphismProperty Z) (Z.dom p.1) := @@ -89,6 +93,7 @@ def fractionInPath (p : CenterSievePair Z) : inverseInPath Z p /-- A permitted fraction evaluated in the ambient localization. -/ +@[expose] def fractionInLocalization (p : CenterSievePair Z) : objEquiv (CenterMorphismProperty Z) (p.2.1) ⟶ objEquiv (CenterMorphismProperty Z) (Z.dom p.1) := @@ -156,32 +161,33 @@ inductive GeneratorMorphismData GeneratorMorphismData Z f /-- The quiver of witnessed original and fraction morphisms. -/ -@[instance_reducible] +@[expose, instance_reducible] def GeneratorQuiver : Quiver (CenterMorphismProperty Z).Localization where Hom X Y := Σ f : X ⟶ Y, GeneratorMorphismData Z f /-- Objects of the ambient localization, used to build the generator category. -/ -def GeneratorObjects := +@[expose] def GeneratorObjects := (CenterMorphismProperty Z).Localization instance : Quiver (GeneratorObjects Z) := GeneratorQuiver Z /-- The free category on the original and fraction generators. -/ -def GeneratedCategory := +@[expose] def GeneratedCategory := CategoryTheory.Paths (GeneratorObjects Z) instance : Category (GeneratedCategory Z) := Paths.categoryPaths _ /-- Forget the witness distinguishing original and fraction generators. -/ +@[expose] def forgetGenerator : GeneratorObjects Z ⥤q (CenterMorphismProperty Z).Localization := { obj := id, map := fun {_ _} f => f.1 } /-- Evaluate a path of generators by composition in the localization. -/ -def GeneratedToLocalization : +@[expose] def GeneratedToLocalization : GeneratedCategory Z ⥤ (CenterMorphismProperty Z).Localization := CategoryTheory.Paths.lift (forgetGenerator Z) @@ -195,6 +201,7 @@ def originalFactor h.g /-- Two paths are identified exactly when they evaluate equally in the localization. -/ +@[expose] def DilaRel : HomRel (GeneratedCategory Z) := fun {_ _} f g => @@ -204,13 +211,14 @@ def DilaRel : /-- **Definition 2.13 / Fact 2.11.** The dilatation `C[{(dᵢ)⁻¹∘Nᵢ}ᵢ∈I]`: objects are `C`'s objects, morphisms are `{[Nᵢ,dᵢ]}`-fractions, composed via `Quotient` (Fact 2.11's associativity of fraction composition is `Quotient.category`'s own well-definedness). -/ -def Dila := +@[expose] def Dila := CategoryTheory.Quotient (DilaRel Z) instance : Category (Dila Z) := CategoryTheory.Quotient.category _ /-- The canonical faithful functor from the dilatation to the ambient localization. -/ +@[expose] def DilaToLoc : Dila Z ⥤ (CenterMorphismProperty Z).Localization := CategoryTheory.Quotient.lift @@ -268,6 +276,7 @@ lemma DilaToLoc_faithful : h) /-- The quotient functor from generator paths to the dilatation. -/ +@[expose] def GeneratedToDila : GeneratedCategory Z ⥤ Dila Z := CategoryTheory.Quotient.functor (DilaRel Z) @@ -278,6 +287,7 @@ instance GeneratedToDila_full : infer_instance /-- The base-category prefunctor sending morphisms to original generators. -/ +@[expose] def CToGeneratorQuiver : C ⥤q GeneratorObjects Z where obj X := objEquiv (CenterMorphismProperty Z) X @@ -290,6 +300,7 @@ def CToGeneratorQuiver : }⟩ /-- **Proposition 3.1 (1).** The canonical functor `Θ : C ⥤ C'`. -/ +@[expose] def CatToDila : C ⥤ Dila Z where obj X := @@ -341,6 +352,7 @@ theorem Prop_3_3 (i : Z.I) : exact Fact_3_2 (DilaToLoc Z) ((CatToDila Z).map (Z.mor i)) /-- Push a sieve forward along the canonical dilatation functor. -/ +@[expose] def CatToDilaSieve {X : C} (N : Sieve (C := C) X) : Sieve (C := Dila Z) ((CatToDila Z).obj X) := @@ -366,6 +378,7 @@ lemma fraction_comp_mor (i : Z.I) (X : C) HomRel.CompClosure.intro _ _ (ψ₁ (CenterMorphismProperty Z) m) _ _ (𝟙 _)) /-- The generator corresponding to a single permitted fraction. -/ +@[expose] def fractionGenerator (p : CenterSievePair Z) : (CToGeneratorQuiver Z).obj p.2.1 ⟶ (CToGeneratorQuiver Z).obj (Z.dom p.1) := @@ -376,6 +389,7 @@ def fractionGenerator (p : CenterSievePair Z) : /-- **Proposition 3.1 (2), existence.** The fraction `b = dᵢ\n = [n∘l_{dᵢ}]` witnessing the unique factorization `[n] = Θ(dᵢ) ∘ b`. -/ +@[expose] def fractionInDilatation (p : CenterSievePair Z) : (CatToDila Z).obj p.2.1 ⟶ (CatToDila Z).obj (Z.dom p.1) := @@ -473,6 +487,7 @@ variable {D : Type u} [Category.{v'} D] variable (F : C ⥤ D) /-- Morphisms in D obtained as images of the chosen central morphisms of C. -/ +@[expose] def IsImageCenterMor (F : C ⥤ D) (f : Σ X Y : D, X ⟶ Y) : Prop := @@ -483,6 +498,7 @@ def IsImageCenterMor F.map (Z.mor i)⟩ /-- The morphism property consisting of the images of the chosen denominators. -/ +@[expose] def ImageCenterMorphismProperty : MorphismProperty D := fun X Y f => @@ -490,6 +506,7 @@ def ImageCenterMorphismProperty : /-- The localization of D obtained by formally inverting the images of the central morphisms. -/ +@[expose] def ImageCenterLocalization : Type u := (ImageCenterMorphismProperty Z F).Localization @@ -499,6 +516,7 @@ instance instCategoryImageCenterLocalization : infer_instance /-- The canonical functor from D to the localization. -/ +@[expose] def ImageCenterLocalizationFunctor : D ⥤ ImageCenterLocalization Z F := (ImageCenterMorphismProperty Z F).Q @@ -644,6 +662,7 @@ theorem localizationMap_comp_Q : apply Localization.Construction.fac /-- The prefunctor interpreting dilatation generators in the target category. -/ +@[expose] def generatorImage (hfaith : (ImageCenterLocalizationFunctor Z F).Faithful) @@ -662,7 +681,7 @@ def generatorImage } /-- Extend the generator interpretation to paths by the free-category universal property. -/ -def H +@[expose] def H (hfaith : (ImageCenterLocalizationFunctor Z F).Faithful) (hsieve : @@ -1301,7 +1320,7 @@ theorem Dila_universal_property /-- **Definition 3.6.** `F : C ⥤ D` is `Σ`-regular (`F ∈ Cat ^ Σ-reg_C`) if `D → D[F(Σ)⁻¹]` is faithful. -/ -def IsSigmaRegular : Prop := +@[expose] def IsSigmaRegular : Prop := Functor.Faithful (ImageCenterMorphismProperty Z F).Q /-- If `p ⋙ e` is faithful, then `p` is faithful. This is the elementary categorical fact behind diff --git a/LeanPool/Dilatations/CategoryCounterexample.lean b/LeanPool/Dilatations/CategoryCounterexample.lean index fe9b429a1a..5f37158485 100644 --- a/LeanPool/Dilatations/CategoryCounterexample.lean +++ b/LeanPool/Dilatations/CategoryCounterexample.lean @@ -16,7 +16,7 @@ https://arxiv.org/abs/2608.09305, and `rndmx/DilCat` at commit `604559654c948566675da3f7709b8ad3126bd487` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ def FSep : Obj ⥤ D0 where /-- `Γ = {b}` as a `MorphismProperty Obj`. -/ def Gamma : MorphismProperty Obj := fun P Q f => (⟨P, Q, f⟩ : Σ P Q : Obj, CHom P Q) = ⟨.X, .Y, .b⟩ -lemma Gamma_b : Gamma (CHom.b) := rfl +lemma Gamma_b : Gamma (CHom.b) := by rfl /-- `F` inverts `Γ`, trivially — `D0` is a groupoid, so *every* morphism is invertible. -/ lemma FSep_inverts_Gamma : Gamma.IsInvertedBy FSep := by diff --git a/LeanPool/Dilatations/Centers.lean b/LeanPool/Dilatations/Centers.lean index 507d24771c..2412ca3edd 100644 --- a/LeanPool/Dilatations/Centers.lean +++ b/LeanPool/Dilatations/Centers.lean @@ -15,7 +15,7 @@ https://arxiv.org/abs/2608.09305, and `rndmx/DilCat` at commit `604559654c948566675da3f7709b8ad3126bd487` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -32,6 +32,7 @@ variable {D : Type u} [Category.{v'} D] variable (F : C ⥤ D) /-- **Proposition 3.14, setup.** The restriction of `Z` to a subcollection `K ⊂ Z.I`. -/ +@[expose] def Center.restrict (Z : Center C) (K : Set Z.I) (hK : K.Nonempty) : Center C where I := K nonempty := ⟨⟨hK.choose, hK.choose_spec⟩⟩ @@ -48,6 +49,7 @@ lemma CenterMorphismProperty_restrict_le exact ⟨k.1, hk⟩ /-- The localization functor induced by inclusion of a restricted set of denominators. -/ +@[expose] def baseRestrictFunctor (Z : Center C) (K : Set Z.I) (hK : K.Nonempty) : (CenterMorphismProperty (Z.restrict K hK)).Localization ⥤ (CenterMorphismProperty Z).Localization := @@ -238,10 +240,7 @@ lemma PhiPreimage_id (Z : Center C) (K : Set Z.I) (hK : K.Nonempty) (X' : Genera refine ⟨𝟙 _, ?_⟩ rw [Functor.map_id] erw [Functor.map_id] - -- `restrictPhi` is now a structural `DilaLift`, so both `eqToHom`s flanking the identity - -- are definitionally `𝟙`; strip the two compositions and close by `rfl`. - erw [Category.id_comp] - erw [Category.id_comp] + erw [Category.id_comp, eqToHom_trans] rfl /-- Inductive step : `Φ`-preimages compose. -/ @@ -319,8 +318,8 @@ lemma restrictPhi_map_fraction (Z : Center C) (K : Set Z.I) (hK : K.Nonempty) apply (DilaToLoc Z).map_injective have hcomp := Functor.congr_hom (restrictPhi_comp_DilaToLoc Z K hK) (fractionInDilatation (Z.restrict K hK) ⟨⟨i, hiK⟩, ⟨X0, ⟨n, hn⟩⟩⟩) - erw [Functor.comp_map, Functor.comp_map, DilaToLoc_map_fraction, - baseRestrictFunctor_map_fraction] at hcomp + simp only [Functor.comp_map] at hcomp + erw [DilaToLoc_map_fraction, baseRestrictFunctor_map_fraction] at hcomp erw [hcomp, Functor.map_comp, Functor.map_comp] erw [eqToHom_map, eqToHom_map, DilaToLoc_map_fraction] rfl @@ -354,7 +353,8 @@ lemma PhiPreimage_fraction_mem (Z : Center C) (K : Set Z.I) (hK : K.Nonempty) (objEquiv (CenterMorphismProperty Z) (Z.dom i))).symm rw [Functor.map_comp, Functor.map_comp, restrictPhi_map_fraction Z K hK i hiK X0 n hn] - simp only [eqToHom_map] + simp only [eqToHom_map, fractionInDilatation, fractionGenerator] + erw [Category.assoc, eqToHom_trans_assoc, Category.assoc, eqToHom_trans] rfl /-- Generator case, original morphisms : always has a `Φ`-preimage. -/ @@ -493,6 +493,7 @@ def Center.pushforward (W : Center C) (F : C ⥤ D) : Center D where /-- Combining two centers `Z` and `W` on the same category `C` into one center indexed by `Z.I ⊕ W.I`. -/ +@[expose] def Center.sum (Z W : Center C) : Center C where I := Z.I ⊕ W.I nonempty := ⟨Sum.inl Z.nonempty.some⟩ @@ -876,11 +877,13 @@ For a fixed center `{[Nᵢ,dᵢ]}_{i∈I}` on `C` and an alternative choice of s sieves `Nᵢ ∪ N'ᵢ`. -/ /-- Same generators `{dᵢ}` as `Z`, with an alternative choice of sieves `N'`. Represents `{[N'ᵢ,dᵢ]}_{i∈I}`. -/ +@[expose] def Center.altSieve (Z : Center C) (N' : ∀ i : Z.I, Sieve (C := C) (Z.cod i)) : Center C := { Z with N := N' } /-- Same generators as `Z`, with sieves `Nᵢ ∪ N'ᵢ`. Represents `{[N''ᵢ,dᵢ]}_{i∈I}` from Proposition 3.18. -/ +@[expose] def Center.sieveUnion (Z : Center C) (N' : ∀ i : Z.I, Sieve (C := C) (Z.cod i)) : Center C := { Z with N := fun i => Z.N i ⊔ N' i } diff --git a/LeanPool/Dilatations/Duality.lean b/LeanPool/Dilatations/Duality.lean index bf1d549eff..b8128a830c 100644 --- a/LeanPool/Dilatations/Duality.lean +++ b/LeanPool/Dilatations/Duality.lean @@ -15,7 +15,7 @@ https://arxiv.org/abs/2608.09305, and `rndmx/DilCat` at commit `604559654c948566675da3f7709b8ad3126bd487` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -107,7 +107,7 @@ structure Cocenter (C : Type u) [Category.{v} C] where /-- The center on `Cᵒᵖ` obtained by regarding `{[Vᵢ,dᵢ]}_{i∈I}` as `{[Vᵢ,(dᵢ)ᵒᵖ]}_{i∈I}` (Fact 4.2). -/ -def Cocenter.toCenterOp (co : Cocenter C) : Center Cᵒᵖ where +@[expose] def Cocenter.toCenterOp (co : Cocenter C) : Center Cᵒᵖ where I := co.I nonempty := co.nonempty dom := fun i => Opposite.op (co.cod i) @@ -128,7 +128,7 @@ def Cocenter.toCenter (co : Cocenter C) : Center C where /-- **Definition 4.3.** The codilatation of `C` with cocenter `{[Vᵢ,dᵢ]}_{i∈I}`: `C[{Vᵢ∘(dᵢ)⁻¹}_{i∈I}] := (Cᵒᵖ[{(dᵢ)⁻¹∘Vᵢ}_{i∈I}])ᵒᵖ`. -/ -def Codila (co : Cocenter C) : Type u := (Dila (co.toCenterOp))ᵒᵖ +@[expose] def Codila (co : Cocenter C) : Type u := (Dila (co.toCenterOp))ᵒᵖ instance instCategoryCodila (co : Cocenter C) : Category (Codila co) := by unfold Codila; infer_instance @@ -212,7 +212,7 @@ theorem Cocenter.Upsilon_isSigmaRegular (co : Cocenter C) : `Θ` post-composed with `G.rightOp`. This is the key bridge letting factorizations through `Codila co` be transported to (and from) factorizations through `Dila (co.toCenterOp)`. -/ lemma Cocenter.comp_Upsilon_op (co : Cocenter C) (G : Codila co ⥤ D) : - (co.Upsilon ⋙ G).op = CatToDila (co.toCenterOp) ⋙ G.rightOp := rfl + (co.Upsilon ⋙ G).op = CatToDila (co.toCenterOp) ⋙ G.rightOp := by rfl /-- `ImageCenterMorphismProperty` for `(co.toCenterOp, F.op)` is exactly the `.op` of `ImageCenterMorphismProperty` for `(co.toCenter, F)`. -/ diff --git a/LeanPool/Dilatations/IteratedRings.lean b/LeanPool/Dilatations/IteratedRings.lean index 7b45c2e589..9716515555 100644 --- a/LeanPool/Dilatations/IteratedRings.lean +++ b/LeanPool/Dilatations/IteratedRings.lean @@ -18,7 +18,7 @@ The ring construction includes work by Arnaud Mayeux and Jujian Zhang from `ProjConstruction/Proj` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -44,6 +44,7 @@ variable {A' : Type*} [CommRing A'] (M : Multicenter A') (K : Set M.index) /-- **Restriction of a multicenter to a subset `K ⊆ I` of the index set**, matching the notation `{[Mᵢ,aᵢ]}_{i∈K}` of §2.2 of the printed paper. -/ +@[expose] def restrict : Multicenter A' where index := K ideal := fun i => M.ideal i.1 @@ -57,6 +58,7 @@ def restrict : Multicenter A' where /-- **The second-stage multicenter of Proposition 2.24.** Over `B := A'[M.restrict K]`, the complementary indices `j ∈ I ∖ K` carry the ideal `B·(Mⱼ)` (the image of `M.ideal j`) and the element `aⱼ/1` (the image of `M.elem j`). -/ +@[expose] def complement : Multicenter (A'[M.restrict K]) where index := (Kᶜ : Set M.index) ideal := fun j => Ideal.map (algebraMap A' A'[M.restrict K]) (M.ideal j.1) diff --git a/LeanPool/Dilatations/NaiveCenterCounterexample.lean b/LeanPool/Dilatations/NaiveCenterCounterexample.lean index e78e62e0d7..e0d62a31ae 100644 --- a/LeanPool/Dilatations/NaiveCenterCounterexample.lean +++ b/LeanPool/Dilatations/NaiveCenterCounterexample.lean @@ -19,7 +19,7 @@ The ring construction includes work by Arnaud Mayeux and Jujian Zhang from `ProjConstruction/Proj` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -151,6 +151,7 @@ lemma psi_frac_eq_zero (m : Polynomial ℤ) (hm : m ∈ Ideal.span ({X} : Set (P /-- The naive `I`-indexed center `{(a_i, M_i)}` (here a single index): index `Unit`, morphism `2`, sieve generated by `(X)` directly (not the large ideal). -/ +@[expose] def centerNaive : Center (CategoryTheory.SingleObj (Polynomial ℤ)) where I := Unit nonempty := ⟨()⟩ diff --git a/LeanPool/Dilatations/RingComparison.lean b/LeanPool/Dilatations/RingComparison.lean index a853b1d0e1..97d61ea1da 100644 --- a/LeanPool/Dilatations/RingComparison.lean +++ b/LeanPool/Dilatations/RingComparison.lean @@ -20,7 +20,7 @@ The ring construction includes work by Arnaud Mayeux and Jujian Zhang from `ProjConstruction/Proj` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -59,6 +59,7 @@ variable {A' : Type u} [CommRing A'] /-- An ideal of `A'`, regarded as a sieve over the unique object of `SingleObj A'`: ideals absorb multiplication by arbitrary ring elements, which is exactly a sieve's stability under precomposition, since composition in `SingleObj A'` *is* ring multiplication. -/ +@[expose] def Sieve.ofIdeal (I : Ideal A') : Sieve (CategoryTheory.SingleObj.star A') where arrows {_} f := (f : A') ∈ I downward_closed {_ _ f} hf g := by @@ -83,7 +84,7 @@ variable (M : Multicenter A') /-- The functor `SingleObj A' ⥤ SingleObj A'[M]` induced by the canonical ring map `A' → A'[M]` (`CategoryTheory.SingleObj.mapHom` turns any monoid hom into a functor between the attached one-object categories). This plays the role of `Θ` on the "attached-to-a-ring" side. -/ -def toDilatationFunctor : CategoryTheory.SingleObj A' ⥤ CategoryTheory.SingleObj A'[M] := +@[expose] def toDilatationFunctor : CategoryTheory.SingleObj A' ⥤ CategoryTheory.SingleObj A'[M] := CategoryTheory.SingleObj.mapHom A' A'[M] (algebraMap A' A'[M]).toMonoidHom /-- **General fact**: in the one-object category `SingleObj R` attached to a monoid `R`, a @@ -544,7 +545,7 @@ noncomputable def Phi51Equiv : lemma Phi51Equiv_apply (x : CategoryTheory.End ((CatToDila (centerOfMulticenter M)).obj (CategoryTheory.SingleObj.star A'))) : - Phi51Equiv M x = (Phi51 M).map x := rfl + Phi51Equiv M x = (Phi51 M).map x := by rfl lemma Phi51Equiv_one : Phi51Equiv M 1 = 1 := by change (Phi51 M).map (1 : CategoryTheory.End _) = (1 : A'[M]) diff --git a/LeanPool/Dilatations/Rings.lean b/LeanPool/Dilatations/Rings.lean index f6bb33e409..92a5dac870 100644 --- a/LeanPool/Dilatations/Rings.lean +++ b/LeanPool/Dilatations/Rings.lean @@ -18,7 +18,7 @@ The ring construction includes work by Arnaud Mayeux and Jujian Zhang from `ProjConstruction/Proj` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -63,11 +63,10 @@ section variable {A' G : Type*} [CommMonoid A'] [Zero G] [Pow A' G] variable {ι : Type*} /-- The finite product of a family raised to finitely supported exponents. -/ -def familyPow (f : ι → A') (v : ι →₀ G) : A' := v.prod fun i k ↦ f i ^ k +@[expose] def familyPow (f : ι → A') (v : ι →₀ G) : A' := v.prod fun i k ↦ f i ^ k /-- Scoped exponent notation for finite products of a family. -/ -@[instance_reducible] -def instFamilyPow : HPow (ι → A') (ι →₀ G) A' where +@[expose, instance_reducible] def instFamilyPow : HPow (ι → A') (ι →₀ G) A' where hPow f v := familyPow f v scoped[CategoryTheory.Dilatations.Family] attribute [instance] @@ -160,7 +159,7 @@ variable {A' : Type*} [CommSemiring A'] (M : Multicenter A') scoped notation : max M"^ℕ" => Multicenter.index M →₀ ℕ /-- Enlarge the numerator ideal by the principal ideal of its denominator. -/ -def LargeIdeal (i : M.index) : Ideal A' := M.ideal i + Ideal.span {M.elem i} +@[expose] def LargeIdeal (i : M.index) : Ideal A' := M.ideal i + Ideal.span {M.elem i} lemma elem_mem_LargeIdeal (i : M.index) : M.elem i ∈ M.LargeIdeal i := by suffices inequality : Ideal.span {M.elem i} ≤ M.LargeIdeal i by @@ -178,7 +177,7 @@ lemma elem_pow_mem_LargeIdealPow (ν : M^ℕ) : M.elem ^ ν ∈ M.LargeIdeal ^ /-- The `ν`-indexed reindexing of `M`: index type `M^ℕ` (exponent profiles), ideal `L ^ ν` at `ν`, element `a ^ ν` at `ν`. Dilating by this center gives back the same ring as dilating by `M` directly (`reindexRingEquiv` below, inside `Dilatation`). -/ -@[reducible] def reindex : Multicenter A' where +@[expose, reducible] def reindex : Multicenter A' where index := M^ℕ ideal := M.prodLargeIdealPower elem := fun ν => M.elem ^ ν @@ -231,6 +230,7 @@ structure PreDil where num_mem : num ∈ M.LargeIdeal ^pow /-- Equality after cross-multiplication and multiplication by another denominator. -/ +@[expose] def r : M.PreDil → M.PreDil → Prop := fun x y => ∃ β : M^ℕ, x.num * M.elem ^ (β + y.pow) = y.num * M.elem ^ (β + x.pow) @@ -256,6 +256,7 @@ lemma r_trans (x y z : M.PreDil) : M.r x y → M.r y z → M.r x z := by abel /-- The equivalence relation on fraction representatives. -/ +@[expose] def setoid : Setoid (M.PreDil) where r := M.r iseqv := @@ -265,14 +266,14 @@ def setoid : Setoid (M.PreDil) where variable (M) in /-- The quotient of permitted fraction representatives by cross-multiplication. -/ -def Dilatation := _root_.Quotient M.setoid +@[expose] def Dilatation := _root_.Quotient M.setoid /-- The dilatation of a commutative semiring at a multicenter. -/ scoped notation : max ring"["multicenter"]" => Dilatation (A' := ring) multicenter namespace Dilatation /-- Map a fraction representative to its class in the dilatation. -/ -def mk (x : M.PreDil) : A'[M] := _root_.Quotient.mk _ x +@[expose] def mk (x : M.PreDil) : A'[M] := _root_.Quotient.mk _ x lemma mk_eq_mk (x y : M.PreDil) : mk x = mk y ↔ M.r x y := by erw [_root_.Quotient.eq] @@ -284,11 +285,12 @@ lemma induction_on {P : A'[M] → Prop} (x : A'[M]) (h : ∀ x : M.PreDil, P (mk exact h a /-- Descend a relation-respecting function on representatives to the quotient. -/ +@[expose] def descFun {B' : Type*} (f : M.PreDil → B') (hf : ∀ x y, M.r x y → f x = f y) : A'[M] → B' := _root_.Quotient.lift f hf /-- Descend a binary function that respects equality of representatives. -/ -def descFun₂ {B' : Type*} (f : M.PreDil → M.PreDil → B') +@[expose] def descFun₂ {B' : Type*} (f : M.PreDil → M.PreDil → B') (hf : ∀ a b x y, M.r a b → M.r x y → f a x = f b y) : A'[M] → A'[M] → B' := _root_.Quotient.lift₂ f <| fun a x b y ↦ hf a b x y @@ -304,8 +306,7 @@ lemma descFun₂_mk_mk {B' : Type*} (f : M.PreDil → M.PreDil → B') descFun₂ f hf (mk x) (mk y) = f x y := rfl /-- Addition of representatives using a common denominator. -/ -@[simps] -def add' (x y : M.PreDil) : M.PreDil where +@[expose, simps] def add' (x y : M.PreDil) : M.PreDil where pow := x.pow + y.pow num := M.elem ^ y.pow * x.num + M.elem ^ x.pow * y.num num_mem := Ideal.add_mem _ @@ -346,8 +347,7 @@ instance : Add A'[M] where lemma mk_add_mk (x y : M.PreDil) : mk x + mk y = mk (add' x y) := rfl /-- Multiplication of representatives by multiplying their numerators. -/ -@[simps] -def mul' (x y : M.PreDil) : M.PreDil where +@[expose, simps] def mul' (x y : M.PreDil) : M.PreDil where pow := x.pow + y.pow num := x.num * y.num num_mem := Ideal.mem_familyPow_add x.num_mem y.num_mem @@ -498,7 +498,7 @@ instance instCommSemiring : CommSemiring A'[M] where variable (M) in /-- The canonical ring homomorphism sending a base element to denominator one. -/ -@[simps] +@[expose, simps] def fromBaseRing : A' →+* A'[M] where toFun x := .mk { pow := 0 @@ -757,8 +757,7 @@ namespace Dilatation variable {A' : Type*} [CommRing A'] {M : Multicenter A'} /-- Negation of a representative by negating its numerator. -/ -@[simps] -def neg' (x : M.PreDil) : M.PreDil where +@[expose, simps] def neg' (x : M.PreDil) : M.PreDil where pow := x.pow num := -x.num num_mem := neg_mem x.num_mem diff --git a/LeanPool/DirectedTopologyLean4.lean b/LeanPool/DirectedTopologyLean4.lean index efbd02d4ed..8fa156dad6 100644 --- a/LeanPool/DirectedTopologyLean4.lean +++ b/LeanPool/DirectedTopologyLean4.lean @@ -44,4 +44,4 @@ Tags: directed-topology, algebraic-topology, category-theory MSC: 55U40, 55Q05, 18A30 -/ -@[expose] public section +public section diff --git a/LeanPool/DirectedTopologyLean4/Constructions.lean b/LeanPool/DirectedTopologyLean4/Constructions.lean index a5e2242845..110e547311 100644 --- a/LeanPool/DirectedTopologyLean4/Constructions.lean +++ b/LeanPool/DirectedTopologyLean4/Constructions.lean @@ -12,7 +12,7 @@ import LeanPool.DirectedTopologyLean4.MonotonePath # LeanPool.DirectedTopologyLean4.Constructions -/ -@[expose] public section +public section /- This file contains constructions of directed spaces such as: @@ -30,7 +30,7 @@ universe u v /-- Any space with a preorder can be equiped with a directedness, by allowing all monotone paths as directed paths -/ -@[reducible] def DirectedSpace.Preorder (α : Type u) [TopologicalSpace α] [Preorder α] : +@[reducible, expose] def DirectedSpace.Preorder (α : Type u) [TopologicalSpace α] [Preorder α] : DirectedSpace α where IsDipath := fun {x y : α} γ => Monotone ↑γ isDipath_constant := fun x _ _ _ => le_refl x @@ -55,7 +55,7 @@ universe u v topological space creates a directed structure on α by pulling back paths. -/ -@[reducible] def DirectedSpace.Induced {α : Type u} {β : Type v} [TopologicalSpace α] +@[expose, reducible] def DirectedSpace.Induced {α : Type u} {β : Type v} [TopologicalSpace α] [hβ : DirectedSpace β] {f : α → β} (hf : Continuous f) : DirectedSpace α where IsDipath := fun {x y : α} γ => IsDipath (γ.map hf) isDipath_constant := fun x => isDipath_constant (f x) @@ -116,12 +116,12 @@ instance DirectedProduct {α : Type u} {β : Type v} [t₁ : DirectedSpace α] [ ⟨isDipath_reparam hφ_mono γ₁_dipath, isDipath_reparam hφ_mono γ₂_dipath⟩ /-- The projection map `α × β → α` -/ -def directedFst {α β : Type*} [DirectedSpace α] [DirectedSpace β] : D(α × β, α) where +@[expose] def directedFst {α β : Type*} [DirectedSpace α] [DirectedSpace β] : D(α × β, α) where toFun := fun x => x.1 directed_toFun := fun _ _ γ ⟨hγ₁, _⟩ => hγ₁ /-- The projection map `α × β → β` -/ -def directedSnd {α β : Type*} [DirectedSpace α] [DirectedSpace β] : D(α × β, β) where +@[expose] def directedSnd {α β : Type*} [DirectedSpace α] [DirectedSpace β] : D(α × β, β) where toFun := fun x => x.2 directed_toFun := fun _ _ γ ⟨_, hγ₂⟩ => hγ₂ @@ -132,7 +132,7 @@ variable {α β γ δ : Type*} [DirectedSpace α] [DirectedSpace β] [DirectedSp /-- Two directed maps `f : α → β` and `g : α → γ` can be turned into a directed map `α → β × γ` by mapping `a : α` to `(f a, g a)`. -/ -protected def DirectedMap.prodMapMk (f : D(α,β)) (g : D(α,γ)) : D(α, β × γ) where +@[expose] protected def DirectedMap.prodMapMk (f : D(α,β)) (g : D(α,γ)) : D(α, β × γ) where toFun := fun x => (f x, g x) directed_toFun := fun x y γ hγ => ⟨f.directed_toFun γ hγ, g.directed_toFun γ hγ⟩ @@ -147,19 +147,19 @@ protected def DirectedMap.prodMapMk' (f : D(α,γ)) (g : D(β,δ)) : D(α × β, /-- For every `t : α`, we can convert a directed map `F : α × β → γ` to a directed map `β → γ` by sending `b` to `F(t, b)` -/ -def DirectedMap.prodConstFst (F : D(α × β,γ)) (a : α) : D(β,γ) := +@[expose] def DirectedMap.prodConstFst (F : D(α × β,γ)) (a : α) : D(β,γ) := F.comp (DirectedMap.prodMapMk (DirectedMap.const β a) (DirectedMap.id β)) @[simp] lemma DirectedMap.prod_const_fst_apply (F : D(α × β,γ)) (a : α) (b : β) : - DirectedMap.prodConstFst F a b = F (a, b) := rfl + DirectedMap.prodConstFst F a b = F (a, b) := by rfl /-- For every `t : β`, we can convert a directed map `F : α × β → γ` to a directed map `α → γ` by sending `a` to `F(a, t)` -/ -def DirectedMap.prodConstSnd (F : D(α × β,γ)) (t : β) : D(α,γ) := +@[expose] def DirectedMap.prodConstSnd (F : D(α × β,γ)) (t : β) : D(α,γ) := F.comp (DirectedMap.prodMapMk (DirectedMap.id α) (DirectedMap.const α t)) @[simp] lemma DirectedMap.prod_const_snd_apply (F : D(α × β,γ)) (b : β) (a : α) : - DirectedMap.prodConstSnd F b a = F (a, b) := rfl + DirectedMap.prodConstSnd F b a = F (a, b) := by rfl end prod diff --git a/LeanPool/DirectedTopologyLean4/CoverLemma.lean b/LeanPool/DirectedTopologyLean4/CoverLemma.lean index 44ab419829..93f04a5a72 100644 --- a/LeanPool/DirectedTopologyLean4/CoverLemma.lean +++ b/LeanPool/DirectedTopologyLean4/CoverLemma.lean @@ -10,7 +10,7 @@ import Mathlib.Topology.MetricSpace.Pseudo.Real /-! ### Auxiliary lemmas -/ -@[expose] public section +public section /- This file contains two applications of the Lebesgue Number Lemma: diff --git a/LeanPool/DirectedTopologyLean4/DTop.lean b/LeanPool/DirectedTopologyLean4/DTop.lean index 8096b18200..343ff034ac 100644 --- a/LeanPool/DirectedTopologyLean4/DTop.lean +++ b/LeanPool/DirectedTopologyLean4/DTop.lean @@ -12,7 +12,7 @@ public import Mathlib.CategoryTheory.ConcreteCategory.Basic # LeanPool.DirectedTopologyLean4.DTop -/ -@[expose] public section +public section /- This file contains the definition of `dTopCat`, the category of directed spaces. @@ -40,10 +40,10 @@ instance : CoeSort dTopCat (Type u) := ⟨dTopCat.carrier⟩ attribute [coe] dTopCat.carrier /-- Construct a bundled `dTopCat` from the underlying type and the typeclass. -/ -def of (X : Type u) [DirectedSpace X] : dTopCat := ⟨X⟩ +@[expose] def of (X : Type u) [DirectedSpace X] : dTopCat := ⟨X⟩ @[simp] -lemma coe_of (X : Type u) [DirectedSpace X] : (of X : Type u) = X := rfl +lemma coe_of (X : Type u) [DirectedSpace X] : (of X : Type u) = X := by rfl /-- The type of morphisms in `dTopCat`. -/ @[ext] @@ -101,12 +101,12 @@ lemma hom_ofHom {X Y : Type u} [DirectedSpace X] [DirectedSpace Y] (f : D(X,Y)) lemma ofHom_hom {X Y : dTopCat} (f : X ⟶ Y) : ofHom (Hom.hom f) = f := rfl @[simp] -lemma ofHom_id {X : Type u} [DirectedSpace X] : ofHom (DirectedMap.id X) = 𝟙 (of X) := rfl +lemma ofHom_id {X : Type u} [DirectedSpace X] : ofHom (DirectedMap.id X) = 𝟙 (of X) := by rfl @[simp] lemma ofHom_comp {X Y Z : Type u} [DirectedSpace X] [DirectedSpace Y] [DirectedSpace Z] (f : D(X,Y)) (g : D(Y,Z)) : - ofHom (g.comp f) = ofHom f ≫ ofHom g := rfl + ofHom (g.comp f) = ofHom f ≫ ofHom g := by rfl instance subspaceCoe {X : dTopCat} : CoeTC (Set X) dTopCat := ⟨fun s => dTopCat.of s⟩ diff --git a/LeanPool/DirectedTopologyLean4/DihomotopyCover.lean b/LeanPool/DirectedTopologyLean4/DihomotopyCover.lean index 813b31d4da..110253d386 100644 --- a/LeanPool/DirectedTopologyLean4/DihomotopyCover.lean +++ b/LeanPool/DirectedTopologyLean4/DihomotopyCover.lean @@ -13,7 +13,7 @@ public import LeanPool.DirectedTopologyLean4.CoverLemma # LeanPool.DirectedTopologyLean4.DihomotopyCover -/ -@[expose] public section +public section /- This file contains the definition of a (n, m)-covered (dipath) dihomotopy, covered by X₁ and X₂: @@ -389,7 +389,7 @@ lemma range_right_subset (F : Dihomotopy γ₁ γ₂) : range γ₂ ⊆ range F /-- A dihomotopy of directed paths is covered if its image lies entirely in X₀ or in X₁. -/ -def covered (hX : X₀ ∪ X₁ = univ) (F : Dihomotopy γ₁ γ₂) : Prop := +@[expose] def covered (hX : X₀ ∪ X₁ = univ) (F : Dihomotopy γ₁ γ₂) : Prop := let _ : X₀ ∪ X₁ = univ := hX range F ⊆ X₀ ∨ range F ⊆ X₁ diff --git a/LeanPool/DirectedTopologyLean4/DihomotopyFlip.lean b/LeanPool/DirectedTopologyLean4/DihomotopyFlip.lean index 34404819c3..090ff89e20 100644 --- a/LeanPool/DirectedTopologyLean4/DihomotopyFlip.lean +++ b/LeanPool/DirectedTopologyLean4/DihomotopyFlip.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.DTop # LeanPool.DirectedTopologyLean4.DihomotopyFlip -/ -@[expose] public section +public section /- If we have a dihomotopy `F` from `f : D(I,X)` to `g : D(I,X)`: @@ -69,7 +69,7 @@ namespace Dihomotopy variable {X : dTopCat} {f g : D(I,X)} /-- Flip a dihomotopy by swapping its two coordinates. -/ -def flip (F : Dihomotopy f g) +@[expose] def flip (F : Dihomotopy f g) : Dihomotopy (F.evalAtRight 0).toDirectedMap (F.evalAtRight 1).toDirectedMap := { toFun := fun t => F (t.2, t.1) diff --git a/LeanPool/DirectedTopologyLean4/DihomotopyToPathDihomotopy.lean b/LeanPool/DirectedTopologyLean4/DihomotopyToPathDihomotopy.lean index 409d9dcd54..3b6fa95819 100644 --- a/LeanPool/DirectedTopologyLean4/DihomotopyToPathDihomotopy.lean +++ b/LeanPool/DirectedTopologyLean4/DihomotopyToPathDihomotopy.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.DirectedPathHomotopy # LeanPool.DirectedTopologyLean4.DihomotopyToPathDihomotopy -/ -@[expose] public section +public section /- This file contains the construction of the following statement: diff --git a/LeanPool/DirectedTopologyLean4/Dipath.lean b/LeanPool/DirectedTopologyLean4/Dipath.lean index 6d46238a1f..c5d702d548 100644 --- a/LeanPool/DirectedTopologyLean4/Dipath.lean +++ b/LeanPool/DirectedTopologyLean4/Dipath.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.Fraction # LeanPool.DirectedTopologyLean4.Dipath -/ -@[expose] public section +public section /- This file contains the definition of a dipath in a directed space: @@ -44,7 +44,7 @@ lemma directed (γ : Dipath x y) : DirectedMap.Directed γ.toContinuousMap := fun _ _ _ φ_dipath => isDipath_reparam φ_dipath γ.dipath_toPath /-- Convert a dipath to its underlying directed map `D(I, X)`. -/ -def toDirectedMap (γ : Dipath x y) : D(I,X) where +@[expose] def toDirectedMap (γ : Dipath x y) : D(I,X) where toFun := γ.toFun continuous_toFun := γ.continuous_toFun directed_toFun := Dipath.directed γ @@ -69,13 +69,14 @@ protected lemma Dipath.ext : ∀ {γ₁ γ₂ : Dipath x y}, (γ₁ : I → X) = namespace Dipath /-- Promote a path with a proof of directedness into a dipath. -/ +@[expose] def ofIsDipath {γ : Path x y} (hγ : IsDipath γ) : Dipath x y := { toPath := γ, dipath_toPath := hγ, } /-- An directed map from I to a directed space can be turned into a dipath -/ -def ofDirectedMap (f : D(I,X)) : Dipath (f 0) (f 1) where +@[expose] def ofDirectedMap (f : D(I,X)) : Dipath (f 0) (f 1) where toFun := f continuous_toFun := f.continuous_toFun source' := rfl @@ -111,7 +112,7 @@ initialize_simps_projections Dipath lemma coe_toContinuousMap : ⇑γ.toContinuousMap = γ := rfl @[simp] -lemma coe_toDirectedMap : ⇑γ.toDirectedMap = γ := rfl +lemma coe_toDirectedMap : ⇑γ.toDirectedMap = γ := by rfl /-- Any function `φ : Π (a : α), Dipath (x a) (y a)` can be seen as a function `α × I → X`. -/ instance hasUncurryDipath {X α : Type*} [DirectedSpace X] {x y : α → X} : @@ -153,17 +154,20 @@ lemma image_extend_eq_image (γ : Dipath x y) (a b : I) : /-! ### Reflexive dipaths -/ /-- The constant dipath from a point to itself -/ -@[refl, simps!] -def refl (x : X) : Dipath x x where +@[expose, refl] def refl (x : X) : Dipath x x where toPath := Path.refl x dipath_toPath := isDipath_constant x +@[simp] theorem refl_toFun (x : X) (t : I) : (refl x).toFun t = x := by rfl + +@[simp] theorem refl_apply (x : X) (t : I) : refl x t = x := by rfl + lemma refl_range {a : X} : range (Dipath.refl a) = {a} := Path.refl_range /-! ### Concatenation of dipaths -/ /-- Directed paths can be concatenated -/ -@[trans] def trans (γ : Dipath x y) (γ' : Dipath y z) : Dipath x z := +@[expose, trans] def trans (γ : Dipath x y) (γ' : Dipath y z) : Dipath x z := { γ.toPath.trans γ'.toPath with dipath_toPath := isDipath_concat γ.dipath_toPath γ'.dipath_toPath @@ -192,6 +196,7 @@ lemma trans_eval_at_half (γ : Dipath x y) (γ' : Dipath y z) : /-! ### Mapping dipaths -/ /-- Image of a dipath from `x` to `y` by a directed map -/ +@[expose] def map (γ : Dipath x y) {Y : Type*} [DirectedSpace Y] (f : D(X,Y)) : Dipath (f x) (f y) := { γ.toPath.map f.continuous_toFun with @@ -218,7 +223,7 @@ by { ext t; rfl } /-! ### Casting dipaths -/ /-- Casting a dipath from `x` to `y` to a dipath from `x'` to `y'` when `x' = x` and `y' = y` -/ -def cast (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) : Dipath x' y' := +@[expose] def cast (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) : Dipath x' y' := { toFun := γ, continuous_toFun := γ.continuous, dipath_toPath := isDipath_cast γ.toPath hx hy γ.dipath_toPath, @@ -227,20 +232,20 @@ def cast (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) : Dipath x' y' := } lemma cast_apply (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) (t : I) : - (γ.cast hx hy) t = γ t := rfl + (γ.cast hx hy) t = γ t := by rfl @[simp] lemma trans_cast {X : Type*} [DirectedSpace X] {a₁ a₂ b₁ b₂ c₁ c₂ : X} (γ : Dipath a₂ b₂) (γ' : Dipath b₂ c₂) (ha : a₁ = a₂) (hb : b₁ = b₂) (hc : c₁ = c₂) : - (γ.cast ha hb).trans (γ'.cast hb hc) = (γ.trans γ').cast ha hc := rfl + (γ.cast ha hb).trans (γ'.cast hb hc) = (γ.trans γ').cast ha hc := by rfl @[simp] lemma cast_coe (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) : - (γ.cast hx hy : I → X) = γ := rfl + (γ.cast hx hy : I → X) = γ := by rfl lemma cast_range (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) : - range (γ.cast hx hy) = range γ := rfl + range (γ.cast hx hy) = range γ := by rfl lemma cast_image (γ : Dipath x y) {x' y'} (hx : x' = x) (hy : y' = y) (a b : ℝ) : - (γ.cast hx hy).extend '' Icc a b = γ.extend '' Icc a b := rfl + (γ.cast hx hy).extend '' Icc a b = γ.extend '' Icc a b := by rfl lemma dipath_of_directed_map_of_to_dimap (γ : Dipath x y) : Dipath.ofDirectedMap (γ.toDirectedMap) = γ.cast γ.source' γ.target' := by {ext t; rfl } @@ -248,7 +253,7 @@ lemma dipath_of_directed_map_of_to_dimap (γ : Dipath x y) : /-! ### Reparametrising a path -/ /-- Reparametrize a dipath by precomposing it with a directed self-map of the unit interval. -/ -def subparam (γ : Dipath x y) (f : D(I,I)) : Dipath (γ (f 0)) (γ (f 1)) := +@[expose] def subparam (γ : Dipath x y) (f : D(I,I)) : Dipath (γ (f 0)) (γ (f 1)) := { toFun := γ ∘ f continuous_toFun := by continuity @@ -271,13 +276,13 @@ lemma subparam_range (γ : Dipath x y) (f : D(I,I)) : /-- Given a dipath `γ` and a dimap `f : I → I` where `f 0 = 0` and `f 1 = 1`, `γ.reparam f` is the dipath defined by `γ ∘ f`. -/ -def reparam (γ : Dipath x y) (f : D(I,I)) (hf₀ : f 0 = 0) (hf₁ : f 1 = 1) : +@[expose] def reparam (γ : Dipath x y) (f : D(I,I)) (hf₀ : f 0 = 0) (hf₁ : f 1 = 1) : Dipath x y := (subparam γ f).cast (hf₀.symm ▸ γ.source.symm) (hf₁.symm ▸ γ.target.symm) @[simp] lemma coe_to_fun (γ : Dipath x y) (f : D(I,I)) (hf₀ : f 0 = 0) (hf₁ : f 1 = 1) : - ⇑(γ.reparam f hf₀ hf₁) = γ ∘ f := rfl + ⇑(γ.reparam f hf₀ hf₁) = γ ∘ f := by rfl @[simp] lemma reparam_id (γ : Dipath x y) : γ.reparam (DirectedMap.id I) rfl rfl = γ := @@ -290,7 +295,7 @@ Path.range_reparam γ.toPath f.continuous_toFun hf₀ hf₁ variable {Y : Type*} [DirectedSpace Y] {x₀ x₁ : X} {y₀ y₁ : Y} /-- Two dipaths together form a dipath in the product space -/ -def dipathProduct (γ₁ : Dipath x₀ x₁) (γ₂ : Dipath y₀ y₁) : Dipath (x₀, y₀) (x₁, y₁) where +@[expose] def dipathProduct (γ₁ : Dipath x₀ x₁) (γ₂ : Dipath y₀ y₁) : Dipath (x₀, y₀) (x₁, y₁) where toFun := fun t => (γ₁ t, γ₂ t) source' := by simp target' := by simp @@ -298,13 +303,13 @@ def dipathProduct (γ₁ : Dipath x₀ x₁) (γ₂ : Dipath y₀ y₁) : Dipath /-- Given a directed path in a product space, we can project it to its first coordinate to obtain a directed path -/ -def ofProductFst (γ : Dipath (x₀, y₀) (x₁, y₁)) : Dipath x₀ x₁ where +@[expose] def ofProductFst (γ : Dipath (x₀, y₀) (x₁, y₁)) : Dipath x₀ x₁ where toPath := γ.toPath.map continuous_fst dipath_toPath := γ.dipath_toPath.1 /-- Given a directed path in a product space, we can project it to its second coordinate to obtain a directed path -/ -def ofProductSnd (γ : Dipath (x₀, y₀) (x₁, y₁)) : Dipath y₀ y₁ where +@[expose] def ofProductSnd (γ : Dipath (x₀, y₀) (x₁, y₁)) : Dipath y₀ y₁ where toPath := γ.toPath.map continuous_snd dipath_toPath := γ.dipath_toPath.2 diff --git a/LeanPool/DirectedTopologyLean4/DipathSubtype.lean b/LeanPool/DirectedTopologyLean4/DipathSubtype.lean index c233148edd..f7396c5bd5 100644 --- a/LeanPool/DirectedTopologyLean4/DipathSubtype.lean +++ b/LeanPool/DirectedTopologyLean4/DipathSubtype.lean @@ -11,7 +11,7 @@ public import LeanPool.DirectedTopologyLean4.FundamentalCategory # LeanPool.DirectedTopologyLean4.DipathSubtype -/ -@[expose] public section +public section /- This file contains properties of dipaths contained in directed subspaces of a directed space. diff --git a/LeanPool/DirectedTopologyLean4/DirectedHomotopy.lean b/LeanPool/DirectedTopologyLean4/DirectedHomotopy.lean index ee0b024a11..bec1cd908f 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedHomotopy.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedHomotopy.lean @@ -14,7 +14,7 @@ import Mathlib.CategoryTheory.Category.Init # LeanPool.DirectedTopologyLean4.DirectedHomotopy -/ -@[expose] public section +public section /- This file contains the definitions of three type of directed homotopies: @@ -92,19 +92,20 @@ initialize_simps_projections Dihomotopy (toDirectedMap_toContinuousMap_toFun → /-- Currying a dihomotopy to a map fron `I` to `D(X,Y)`. -/ -def curry (F : Dihomotopy f₀ f₁) : I → D(X,Y) := fun t => DirectedMap.prodConstFst ↑F t +@[expose] def curry (F : Dihomotopy f₀ f₁) : I → D(X,Y) := fun t => DirectedMap.prodConstFst ↑F t @[simp] lemma curry_apply (F : Dihomotopy f₀ f₁) (t : I) (x : X) : F.curry t x = F (t, x) := rfl /-- Currying a dihomotopy to a map fron `X` to `D(I,Y)`. -/ -def currySnd (F : Dihomotopy f₀ f₁) : X → D(I,Y) := fun x => DirectedMap.prodConstSnd ↑F x +@[expose] def currySnd (F : Dihomotopy f₀ f₁) : X → D(I,Y) := fun x => DirectedMap.prodConstSnd ↑F x @[simp] lemma curry_snd_apply (F : Dihomotopy f₀ f₁) (x : X) (t : I) : F.currySnd x t = F (t, x) := rfl /-- Promote a continuous-map homotopy together with a proof of directedness to a dihomotopy. -/ +@[expose] def homToDihom (F : ContinuousMap.Homotopy (↑f₀ : C(X, Y)) ↑f₁) (HF : Directed (F : C(I × X, Y))) : Dihomotopy f₀ f₁ where @@ -115,7 +116,7 @@ def homToDihom (F : ContinuousMap.Homotopy (↑f₀ : C(X, Y)) ↑f₁) (HF : Di map_one_left := F.map_one_left /-- Forget the directedness of a dihomotopy to obtain the underlying continuous-map homotopy. -/ -def dihomToHom (F : Dihomotopy f₀ f₁) : ContinuousMap.Homotopy (f₀ : C(X, Y)) ↑f₁ where +@[expose] def dihomToHom (F : Dihomotopy f₀ f₁) : ContinuousMap.Homotopy (f₀ : C(X, Y)) ↑f₁ where toFun := F.toFun continuous_toFun := F.continuous_toFun map_zero_left := F.map_zero_left @@ -129,7 +130,8 @@ instance coeDihomToHom : Coe (Dihomotopy f₀ f₁) (ContinuousMap.Homotopy (f /-- Evaluating a dipath homotopy at an intermediate point in the left coordinate, giving us a `dipath`. -/ -def evalAtLeft {f g : D(I,X)} (F : Dihomotopy f g) (t : I) : Dipath (F (t, 0)) (F (t, 1)) where +@[expose] def evalAtLeft {f g : D(I,X)} (F : Dihomotopy f g) (t : I) : + Dipath (F (t, 0)) (F (t, 1)) where toFun := F.curry t source' := by simp target' := by simp @@ -140,7 +142,7 @@ def evalAtLeft {f g : D(I,X)} (F : Dihomotopy f g) (t : I) : Dipath (F (t, 0)) ( /-- Given a dihomotopy H: f ∼ g, get the dipath traced by the point `x` as it moves from `f x` to `g x` -/ -def evalAtRight {X : Type*} {Y : Type*} [DirectedSpace X] [DirectedSpace Y] {f g : D(X,Y)} +@[expose] def evalAtRight {X : Type*} {Y : Type*} [DirectedSpace X] [DirectedSpace Y] {f g : D(X,Y)} (H : DirectedMap.Dihomotopy f g) (x : X) : Dipath (f x) (g x) where toFun := fun t => H (t, x) source' := H.apply_zero x @@ -157,8 +159,7 @@ lemma directed_refl (f : D(X,Y)) (f.directed_toFun (γ.map continuous_snd) (directedSnd.directed_toFun γ γ_dipath)) /-- The trivial reflexive dihomotopy `F (t, x) = f x`. -/ -@[simps! -isSimp] -def refl (f : D(X,Y)) : Dihomotopy f f := homToDihom _ (directed_refl f) +@[expose, simps! -isSimp] def refl (f : D(X,Y)) : Dihomotopy f f := homToDihom _ (directed_refl f) instance : Inhabited (Dihomotopy (DirectedMap.id X) (DirectedMap.id X)) := ⟨Dihomotopy.refl _⟩ @@ -173,20 +174,21 @@ variable {t₀ t₁ : I} (γ : Dipath t₀ t₁) {T : I} variable (hT : γ T = halfI) /-- The first half of a split dipath, stretched to the interval `[2 t₀, 1]`. -/ +@[expose] def FirstPartStretch (ht₀ : (t₀ : ℝ) ≤ 2⁻¹) : Dipath (⟨2 * (t₀.1 : ℝ), double_mem_I ht₀⟩ : I) (1 : I) where toFun := Dipath.stretchUp (FirstPart γ T) (le_of_eq (by rw [hT])) source' := by simp target' := by simp [hT] - dipath_toPath := Dipath.isDipath_stretch_up (_) (le_of_eq (by rw [hT])) + dipath_toPath := Dipath.isDipath_stretch_up (FirstPart γ T) (le_of_eq (by rw [hT])) /-- The second half of a split dipath, stretched to the interval `[0, 2 t₁ - 1]`. -/ -def SecondPartStretch (ht₁ : 2⁻¹ ≤ (t₁ : ℝ)) : Dipath (0 : I) ⟨2 * (t₁.1 : ℝ) +@[expose] def SecondPartStretch (ht₁ : 2⁻¹ ≤ (t₁ : ℝ)) : Dipath (0 : I) ⟨2 * (t₁.1 : ℝ) - 1, double_sub_one_mem_I ht₁⟩ where toFun := Dipath.stretchDown (SecondPart γ T) (le_of_eq (by rw [hT])) source' := by simp [hT] target' := by simp - dipath_toPath := Dipath.isDipath_stretch_down (_) (le_of_eq (by rw [hT])) + dipath_toPath := Dipath.isDipath_stretch_down (SecondPart γ T) (le_of_eq (by rw [hT])) variable {f₂ : D(X,Y)} (F : Dihomotopy f₀ f₁) (G : Dihomotopy f₁ f₂) (t : I) (x : X) @@ -235,10 +237,10 @@ lemma trans_first_case {a₀ a₁ : I × X} {γ : Path a₀ a₁} (γ_dipath : I have : (t₀ : ℝ) ≤ 2⁻¹ := by have h_le : t₀ ≤ t₁ := directed_path_source_le_target γ_dipath.1 exact le_trans (Subtype.coe_le_coe.mpr h_le) ht₁ - have hpath : γ.map Γ.continuous_toFun = p'.cast (h t₀ x₀ this) (h t₁ x₁ ht₁) := by + have hpath : γ.map Γ.continuous_toFun = (p'.cast (h t₀ x₀ this) (h t₁ x₁ ht₁)).toPath := by ext simp only [ContinuousMap.toFun_eq_coe, ContinuousMap.Homotopy.coe_toContinuousMap, Path.map_coe, - Function.comp_apply, DirectedMap.coe_coe] + Function.comp_apply] exact h _ _ (le_trans (directed_path_bounded γ_dipath.1 _).2 ht₁) rw [hpath] exact (p'.cast (h t₀ x₀ this) (h t₁ x₁ ht₁)).dipath_toPath @@ -265,16 +267,17 @@ lemma trans_second_case {a₀ a₁ : I × X} {γ : Path a₀ a₁} (γ_dipath : have : 2⁻¹ ≤ (t₁ : ℝ) := by have h_le : t₀ ≤ t₁ := directed_path_source_le_target γ₁.dipath_toPath exact le_trans ht₀ (Subtype.coe_le_coe.mpr h_le) - have hpath : γ.map Γ.continuous_toFun = p'.cast (h t₀ x₀ ht₀) (h t₁ x₁ this) := by + have hpath : γ.map Γ.continuous_toFun = (p'.cast (h t₀ x₀ ht₀) (h t₁ x₁ this)).toPath := by ext simp only [ContinuousMap.toFun_eq_coe, ContinuousMap.Homotopy.coe_toContinuousMap, Path.map_coe, - Function.comp_apply, DirectedMap.coe_coe] + Function.comp_apply] exact h _ _ (le_trans ht₀ (directed_path_bounded γ_dipath.1 _).1) rw [hpath] exact (p'.cast (h t₀ x₀ ht₀) (h t₁ x₁ this)).dipath_toPath /-- Given `Dihomotopy f₀ f₁` and `Dihomotopy f₁ f₂`, we can define a `Dihomotopy f₀ f₂` by putting the first dihomotopy on `[0, 1/2]` and the second on `[1/2, 1]`. -/ +@[expose] def trans {f₂ : D(X,Y)} (F : Dihomotopy f₀ f₁) (G : Dihomotopy f₁ f₂) : Dihomotopy f₀ f₂ := by set Fₕ := dihomToHom F set Gₕ := dihomToHom G @@ -391,7 +394,7 @@ lemma trans_apply {f₀ f₁ f₂ : D(X,Y)} (F : Dihomotopy f₀ f₁) (G : Diho /-- Casting a `Dihomotopy f₀ f₁` to a `Dihomotopy g₀ g₁` where `f₀ = g₀` and `f₁ = g₁`. -/ -@[simps -isSimp] +@[expose, simps -isSimp] def cast {f₀ f₁ g₀ g₁ : D(X,Y)} (F : Dihomotopy f₀ f₁) (h₀ : f₀ = g₀) (h₁ : f₁ = g₁) : Dihomotopy g₀ g₁ where toFun := F @@ -400,7 +403,7 @@ def cast {f₀ f₁ g₀ g₁ : D(X,Y)} (F : Dihomotopy f₀ f₁) (h₀ : f₀ map_one_left := by simp [←h₁] /-- Horizontal composition for `ContinuousMap.Homotopy`. -/ -def Homotopy.hcomp' {f₀ f₁ : C(X, Y)} {g₀ g₁ : C(Y, Z)} +@[expose] def Homotopy.hcomp' {f₀ f₁ : C(X, Y)} {g₀ g₁ : C(Y, Z)} (F : ContinuousMap.Homotopy f₀ f₁) (G : ContinuousMap.Homotopy g₀ g₁) : ContinuousMap.Homotopy (g₀.comp f₀) (g₁.comp f₁) where toFun := fun p => G (p.1, F p) @@ -412,7 +415,7 @@ def Homotopy.hcomp' {f₀ f₁ : C(X, Y)} {g₀ g₁ : C(Y, Z)} /-- If we have a `Dihomotopy f₀ f₁` and a `Dihomotopy g₀ g₁`, then we can compose them and get a `Dihomotopy (g₀.comp f₀) (g₁.comp f₁)`. -/ -@[simps! -isSimp] +@[expose, simps! -isSimp] def hcomp {f₀ f₁ : D(X,Y)} {g₀ g₁ : D(Y,Z)} (F : Dihomotopy f₀ f₁) (G : Dihomotopy g₀ g₁) : Dihomotopy (g₀.comp f₀) (g₁.comp f₁) := homToDihom (Homotopy.hcomp' (dihomToHom F) (dihomToHom G)) @@ -499,8 +502,7 @@ lemma prop (F : DihomotopyWith f₀ f₁ P) (t : I) : P (F.toDihomotopy.curry t) /-- Given a directed map `f`, and a proof `h : P f`, we can define a `DihomotopyWith f f P` by `F (t, x) = f x` -/ -@[simps! -isSimp] -def refl (f : D(X,Y)) (hf : P f) : DihomotopyWith f f P := { +@[expose, simps! -isSimp] def refl (f : D(X,Y)) (hf : P f) : DihomotopyWith f f P := { Dihomotopy.refl f with prop' := fun t => by convert hf @@ -515,7 +517,7 @@ instance : Inhabited (DihomotopyWith (DirectedMap.id X) (DirectedMap.id X) (fun f₂ P` by putting the first dihomotopy on `[0, 1/2]` and the second on `[1/2, 1]`. -/ -def trans {f₀ f₁ f₂ : D(X,Y)} (F : DihomotopyWith f₀ f₁ P) (G : DihomotopyWith f₁ f₂ P) : +@[expose] def trans {f₀ f₁ f₂ : D(X,Y)} (F : DihomotopyWith f₀ f₁ P) (G : DihomotopyWith f₁ f₂ P) : DihomotopyWith f₀ f₂ P := { F.toDihomotopy.trans G.toDihomotopy with @@ -547,7 +549,7 @@ Dihomotopy.trans_apply _ _ _ /-- Casting a `DihomotopyWith f₀ f₁ P` to a `DihomotopyWith g₀ g₁ P` where `f₀ = g₀` and `f₁ = g₁`. -/ -@[simps! -isSimp] +@[expose, simps! -isSimp] def cast {f₀ f₁ g₀ g₁ : D(X,Y)} (F : DihomotopyWith f₀ f₁ P) (h₀ : f₀ = g₀) (h₁ : f₁ = g₁) : DihomotopyWith g₀ g₁ P := { @@ -591,14 +593,14 @@ lemma fst_eq_snd (F : DihomotopyRel f₀ f₁ S) {x : X} (hx : x ∈ S) : f₀ x `F (t, x) = f x` for all `t`. This is defined using `DihomotopyWith.refl`, but with the proof filled in. -/ -@[simps! -isSimp] -def refl (f : D(X,Y)) (S : Set X) : DihomotopyRel f f S := +@[expose, simps! -isSimp] def refl (f : D(X,Y)) (S : Set X) : DihomotopyRel f f S := DihomotopyWith.refl f (fun _ _ => rfl) /-- Given `DihomotopyRel f₀ f₁ S` and `DihomotopyRel f₁ f₂ S`, we can define a `DihomotopyRel f₀ f₂ S` by putting the first dihomotopy on `[0, 1/2]` and the second on `[1/2, 1]`. -/ +@[expose] def trans (F : DihomotopyRel f₀ f₁ S) (G : DihomotopyRel f₁ f₂ S) : DihomotopyRel f₀ f₂ S := { Dihomotopy.trans F.toDihomotopy G.toDihomotopy with @@ -631,7 +633,7 @@ Dihomotopy.trans_apply _ _ _ /-- Casting a `DihomotopyRel f₀ f₁ S` to a `DihomotopyRel g₀ g₁ S` where `f₀ = g₀` and `f₁ = g₁`. -/ -@[simps! -isSimp] +@[expose, simps! -isSimp] def cast {f₀ f₁ g₀ g₁ : D(X,Y)} (F : DihomotopyRel f₀ f₁ S) (h₀ : f₀ = g₀) (h₁ : f₁ = g₁) : DihomotopyRel g₀ g₁ S := { diff --git a/LeanPool/DirectedTopologyLean4/DirectedMap.lean b/LeanPool/DirectedTopologyLean4/DirectedMap.lean index 8795d6047e..3d591e6aef 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedMap.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedMap.lean @@ -11,7 +11,7 @@ public import LeanPool.DirectedTopologyLean4.DirectedSpace # LeanPool.DirectedTopologyLean4.DirectedMap -/ -@[expose] public section +public section /- # Definition of directed maps @@ -27,7 +27,7 @@ public import LeanPool.DirectedTopologyLean4.DirectedSpace namespace DirectedMap /-- A continuous map between two directed spaces is `Directed` if it maps dipaths to dipaths. -/ -def Directed {α β : Type*} [DirectedSpace α] [DirectedSpace β] (f : C(α, β)) : Prop := +@[expose] def Directed {α β : Type*} [DirectedSpace α] [DirectedSpace β] (f : C(α, β)) : Prop := ∀ ⦃x y : α⦄ (γ : Path x y), IsDipath γ → IsDipath (γ.map f.continuous_toFun) end DirectedMap @@ -57,7 +57,7 @@ section DirectedMapClass variable {F α β : Type*} [DirectedSpace α] [DirectedSpace β] [FunLike F α β] [hF : DirectedMapClass F α β] /-- Coerce a member of a `DirectedMapClass` to the bundled directed map type `D(α, β)`. -/ -@[coe] def toDirectedMap (f : F) : D(α,β) := ⟨f, map_directed f⟩ +@[coe, expose] def toDirectedMap (f : F) : D(α,β) := ⟨f, map_directed f⟩ instance : CoeTC F D(α,β) := ⟨toDirectedMap⟩ end DirectedMapClass @@ -87,41 +87,41 @@ instance : Coe D(α,β) C(α, β) := ⟨fun f => f.toContinuousMap⟩ @[simp] lemma toFun_eq_coe {f : D(α,β)} : f.toFun = (f : α → β) := rfl @[simp] lemma coe_to_continuous_map (f : D(α,β)) : ⇑f.toContinuousMap = f := rfl @[simp] protected lemma coe_coe {F : Type*} [FunLike F α β] [DirectedMapClass F α β] (f : F) - : ⇑(f : D(α,β)) = f := rfl + : ⇑(f : D(α,β)) = f := by rfl @[ext] theorem ext {f g : D(α,β)} (h : ∀ x, f x = g x) : f = g := DFunLike.ext f g h variable (α) /-- The identity map is directed -/ -protected def id : D(α,α) where +@[expose] protected def id : D(α,α) where toFun := id directed_toFun := fun x y γ γ_path => γ_path -@[simp] lemma coe_id : ⇑(DirectedMap.id α) = id := rfl +@[simp] lemma coe_id : ⇑(DirectedMap.id α) = id := by rfl /-- Constant maps are directed -/ -def const (b : β) : D(α,β) where +@[expose] def const (b : β) : D(α,β) where toFun := fun _ : α => b directed_toFun := fun x y γ _ => isDipath_constant b -@[simp] lemma coe_const (b : β) : ⇑(const α b) = Function.const α b := rfl +@[simp] lemma coe_const (b : β) : ⇑(const α b) = Function.const α b := by rfl variable {α} /-- The composition of directed maps is directed -/ -def comp (f : D(β,γ)) (g : D(α,β)) : D(α,γ) where +@[expose] def comp (f : D(β,γ)) (g : D(α,β)) : D(α,γ) where toFun := f ∘ g directed_toFun := fun x y p hp => f.directed_toFun (p.map g.continuous_toFun) (g.directed_toFun p hp) -@[simp] lemma id_apply (a : α) : DirectedMap.id α a = a := rfl -@[simp] lemma const_apply (b : β) (a : α) : const α b a = b := rfl -@[simp] lemma coe_comp (f : D(β,γ)) (g : D(α,β)) : ⇑(f.comp g) = f ∘ g := rfl -@[simp] lemma comp_apply (f : D(β,γ)) (g : D(α,β)) (a : α) : f.comp g a = f (g a) := rfl +@[simp] lemma id_apply (a : α) : DirectedMap.id α a = a := by rfl +@[simp] lemma const_apply (b : β) (a : α) : const α b a = b := by rfl +@[simp] lemma coe_comp (f : D(β,γ)) (g : D(α,β)) : ⇑(f.comp g) = f ∘ g := by rfl +@[simp] lemma comp_apply (f : D(β,γ)) (g : D(α,β)) (a : α) : f.comp g a = f (g a) := by rfl @[simp] lemma comp_assoc (f : D(γ,δ)) (g : D(β,γ)) (h : D(α,β)) : - (f.comp g).comp h = f.comp (g.comp h) := rfl + (f.comp g).comp h = f.comp (g.comp h) := by rfl @[simp] lemma id_comp (f : D(α,β)) : (DirectedMap.id β).comp f = f := ext fun _ => rfl @[simp] lemma comp_id (f : D(α,β)) : f.comp (DirectedMap.id α) = f := ext fun _ => rfl @[simp] lemma const_comp (c : γ) (f : D(α,β)) : (const β c).comp f = const α c diff --git a/LeanPool/DirectedTopologyLean4/DirectedPathHomotopy.lean b/LeanPool/DirectedTopologyLean4/DirectedPathHomotopy.lean index c8a5c1c451..7b698e1727 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedPathHomotopy.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedPathHomotopy.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.TransRefl # LeanPool.DirectedTopologyLean4.DirectedPathHomotopy -/ -@[expose] public section +public section /- This file contains the definition of a directed path homotopy, or `Dipath.Dihomotopy`: @@ -93,7 +93,7 @@ instance coeDihomToHom : Coe (Dihomotopy p₀ p₁) (Path.Homotopy p₀.toPath p /-- Evaluating a dipath homotopy at an intermediate point, giving us a `Dipath`. -/ -def eval (F : Dihomotopy p₀ p₁) (t : I) : Dipath x y where +@[expose] def eval (F : Dihomotopy p₀ p₁) (t : I) : Dipath x y where toFun := F.toDihomotopy.curry t source' := F.source t target' := F.target t @@ -205,7 +205,7 @@ lemma _root_.Dipath.Dihomotopy.hcomp_first_case (F : Dihomotopy p₀ q₀) (G : ext simp only [Path.coe_toContinuousMap, ContinuousMap.toFun_eq_coe, ContinuousMap.Homotopy.coe_toContinuousMap, ContinuousMap.HomotopyWith.coe_toHomotopy, - Path.map_coe, Function.comp_apply, coe_toDirectedMap, + Path.map_coe, Function.comp_apply, DirectedMap.Dihomotopy.coe_to_directed_map, DirectedMap.DihomotopyWith.coe_to_dihomotopy] exact h _ _ (le_trans (directed_path_bounded γ_dipath.2 _).2 ht₁) rw [hpath] @@ -238,7 +238,7 @@ lemma _root_.Dipath.Dihomotopy.hcomp_second_case (F : Dihomotopy p₀ q₀) (G : ext x simp only [Path.coe_toContinuousMap, ContinuousMap.toFun_eq_coe, ContinuousMap.Homotopy.coe_toContinuousMap, ContinuousMap.HomotopyWith.coe_toHomotopy, - Path.map_coe, Function.comp_apply, coe_toDirectedMap, + Path.map_coe, Function.comp_apply, DirectedMap.Dihomotopy.coe_to_directed_map, DirectedMap.DihomotopyWith.coe_to_dihomotopy] exact h (γ x).1 (γ x).2 (le_trans ht₀ (directed_path_bounded γ_dipath.2 _).1) rw [hpath] @@ -520,7 +520,7 @@ def _root_.Dipath.Dihomotopy.reflTransToReparamTransRefl (p : Dipath x y) (f : D /-- Given `F : Dihomotopy p q`, and `f : D(X,Y)`, there is a dihomotopy from `p.map f` to `q.map f` given by `f ∘ F`. -/ -@[simps!] +@[expose, simps!] def _root_.Dipath.Dihomotopy.map {p q : Dipath x y} (F : Dihomotopy p q) (f : D(X,Y)) : Dihomotopy (p.map f) (q.map f) where toFun := f ∘ F @@ -550,7 +550,7 @@ def _root_.Dipath.PreDihomotopic : Prop := Nonempty (Dihomotopy p₀ p₁) /-- `Dipath.Dihomotopic` is the equivalence generated by `Dipath.PreDihomotopic`. -/ -def _root_.Dipath.Dihomotopic : Prop := Relation.EqvGen PreDihomotopic p₀ p₁ +@[expose] def _root_.Dipath.Dihomotopic : Prop := Relation.EqvGen PreDihomotopic p₀ p₁ end @@ -698,12 +698,13 @@ lemma _root_.Dipath.Dihomotopic.reparam (p : Dipath x y) (f : D(I,I)) paths are equivalent if there is a chain of `Dihomotopies` starting in one and ending in the other. -/ -@[reducible] protected def _root_.Dipath.Dihomotopic.setoid (x y : X) : Setoid (Dipath x y) := +@[expose, reducible] +protected def _root_.Dipath.Dihomotopic.setoid (x y : X) : Setoid (Dipath x y) := ⟨Dihomotopic, equivalence⟩ /-- The quotient on `Dipath x y` by the equivalence relation `Dipath.Dihomotopic`. -/ -protected def _root_.Dipath.Dihomotopic.Quotient (x y : X) := +@[expose] protected def _root_.Dipath.Dihomotopic.Quotient (x y : X) := Quotient (Dihomotopic.setoid x y) attribute [local instance] Dihomotopic.setoid @@ -713,6 +714,7 @@ instance : Inhabited (Dihomotopic.Quotient x x) := /-- The composition of dipath dihomotopy classes. This is `Dipath.trans` descended to the quotient. -/ +@[expose] def _root_.Dipath.Dihomotopic.Quotient.comp (P₀ : Dipath.Dihomotopic.Quotient x y) (P₁ : Dipath.Dihomotopic.Quotient y z) : Dipath.Dihomotopic.Quotient x z := Quotient.map₂ Dipath.trans @@ -723,6 +725,7 @@ lemma _root_.Dipath.Dihomotopic.comp_lift (P₀ : Dipath x y) (P₁ : Dipath y z /-- The image of a dipath dihomotopy class `P₀` under a directed map `f`. This is `Dipath.map` descended to the quotient. -/ +@[expose] def _root_.Dipath.Dihomotopic.Quotient.mapFn (P₀ : Dipath.Dihomotopic.Quotient x y) (f : D(X,Y)) : Dipath.Dihomotopic.Quotient (f x) (f y) := Quotient.map (fun (q : Dipath x y) => q.map f) (fun _ _ h => Dipath.Dihomotopic.map h f) P₀ diff --git a/LeanPool/DirectedTopologyLean4/DirectedSpace.lean b/LeanPool/DirectedTopologyLean4/DirectedSpace.lean index 09b3a88b2b..3d6a43eb2e 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedSpace.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedSpace.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.Path # LeanPool.DirectedTopologyLean4.DirectedSpace -/ -@[expose] public section +public section /- # Definition of directed spaces @@ -47,7 +47,7 @@ variable {α : Type u} {x y z : α} [DirectedSpace α] {γ : Path x y} {γ' : Pa {f : Path t₀ t₁} /-- A path in a directed space is a dipath if it satisfies the directed-space predicate. -/ -def IsDipath : (Path x y) → Prop := +@[expose] def IsDipath : (Path x y) → Prop := DirectedSpace.IsDipath /-- The constant path at any point of a directed space is directed. -/ diff --git a/LeanPool/DirectedTopologyLean4/DirectedUnitInterval.lean b/LeanPool/DirectedTopologyLean4/DirectedUnitInterval.lean index a4c47b40b3..688666bbd6 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedUnitInterval.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedUnitInterval.lean @@ -12,7 +12,7 @@ import LeanPool.DirectedTopologyLean4.MonotonePath # LeanPool.DirectedTopologyLean4.DirectedUnitInterval -/ -@[expose] public section +public section /- This file contains the definition of the directed unit interval. @@ -31,7 +31,7 @@ instance : DirectedSpace I := DirectedSpace.Preorder I /-- The identity on I as a path I → I. -/ -def IdentityPath : Path (0 : I) (1 : I) := +@[expose] def IdentityPath : Path (0 : I) (1 : I) := { toFun := fun x => x, continuous_toFun := by continuity, diff --git a/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean b/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean index 827c92d102..3c0b3a0f8e 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean @@ -18,7 +18,7 @@ import LeanPool.DirectedTopologyLean4.SplitPath.SplitProperties # LeanPool.DirectedTopologyLean4.DirectedVanKampen -/ -@[expose] public section +public section /- This file contains the directed version of the Van Kampen Theorem. diff --git a/LeanPool/DirectedTopologyLean4/Fraction.lean b/LeanPool/DirectedTopologyLean4/Fraction.lean index c8840a23e9..305e96d114 100644 --- a/LeanPool/DirectedTopologyLean4/Fraction.lean +++ b/LeanPool/DirectedTopologyLean4/Fraction.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.UnitInterval # LeanPool.DirectedTopologyLean4.Fraction -/ -@[expose] public section +public section open scoped unitInterval noncomputable section @@ -20,8 +20,7 @@ noncomputable section fraction `i/n : ℝ` lives in the unit interval -/ -@[reducible] -def Fraction {i n : ℕ} (hn : 0 < n) (hi : i ≤ n) : I := +@[reducible, expose] def Fraction {i n : ℕ} (hn : 0 < n) (hi : i ≤ n) : I := ⟨(i : ℝ)/(n : ℝ), ⟨div_nonneg (Nat.cast_nonneg i) (Nat.cast_nonneg n), (div_le_one ((Nat.cast_pos (α := ℝ)).mpr hn)).mpr (Nat.cast_le.mpr hi)⟩⟩ @@ -30,11 +29,11 @@ namespace Fraction /-- For any positive number `n : ℕ`, we have the fraction `1/n : ℝ` in the unit interval -/ -@[reducible] +@[reducible, expose] def ofPos {n : ℕ} (hn : 0 < n) : I := Fraction hn (Nat.succ_le_iff.mpr hn) @[simp] -lemma Fraction_coe {i n : ℕ} (hn : 0 < n) (hi : i ≤ n) : (Fraction hn hi : ℝ) = (i/n : ℝ) := rfl +lemma Fraction_coe {i n : ℕ} (hn : 0 < n) (hi : i ≤ n) : (Fraction hn hi : ℝ) = (i/n : ℝ) := by rfl lemma ofPos_coe {n : ℕ} (hn : 0 < n) : ((ofPos hn) : ℝ) = (1/n : ℝ) := by simp /-- For any postive `n : ℕ`, we have that `0/n = n`. diff --git a/LeanPool/DirectedTopologyLean4/FractionEqualities.lean b/LeanPool/DirectedTopologyLean4/FractionEqualities.lean index e7c2394b57..0a36d17006 100644 --- a/LeanPool/DirectedTopologyLean4/FractionEqualities.lean +++ b/LeanPool/DirectedTopologyLean4/FractionEqualities.lean @@ -11,7 +11,7 @@ public import LeanPool.DirectedTopologyLean4.Fraction # LeanPool.DirectedTopologyLean4.FractionEqualities -/ -@[expose] public section +public section namespace FractionEqualities diff --git a/LeanPool/DirectedTopologyLean4/FundamentalCategory.lean b/LeanPool/DirectedTopologyLean4/FundamentalCategory.lean index 2acfe01d4c..f97962fa86 100644 --- a/LeanPool/DirectedTopologyLean4/FundamentalCategory.lean +++ b/LeanPool/DirectedTopologyLean4/FundamentalCategory.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.DTop # LeanPool.DirectedTopologyLean4.FundamentalCategory -/ -@[expose] public section +public section /- This file contains the definition of the fundamental category of a directed space. diff --git a/LeanPool/DirectedTopologyLean4/Interpolate.lean b/LeanPool/DirectedTopologyLean4/Interpolate.lean index 68a18cf246..fbb4ed8667 100644 --- a/LeanPool/DirectedTopologyLean4/Interpolate.lean +++ b/LeanPool/DirectedTopologyLean4/Interpolate.lean @@ -12,7 +12,7 @@ import Mathlib.CategoryTheory.Category.Init # LeanPool.DirectedTopologyLean4.Interpolate -/ -@[expose] public section +public section /- This file contains definitions about interpolating points in the directed unit interval @@ -65,7 +65,7 @@ def directedInterpolateConst {a b : I} (h : a ≤ b) : D(I,I) where variable (f g : C(I, I)) /-- Two-parameter interpolation `(s, t) ↦ (1 - s) * f t + s * g t`. -/ -def interpolate : C(I × I, I) where +@[expose] def interpolate : C(I × I, I) where toFun := fun t => ⟨(σ t.1 : ℝ) * (f t.2) + t.1 * (g t.2), interp_mem_I t.1 (f t.2) (g t.2)⟩ lemma interpolate_left : (interpolate f g).curry 0 = f := by diff --git a/LeanPool/DirectedTopologyLean4/MonotonePath.lean b/LeanPool/DirectedTopologyLean4/MonotonePath.lean index be57c08b2b..53152ff246 100644 --- a/LeanPool/DirectedTopologyLean4/MonotonePath.lean +++ b/LeanPool/DirectedTopologyLean4/MonotonePath.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.Path # LeanPool.DirectedTopologyLean4.MonotonePath -/ -@[expose] public section +public section /- This file contains lemmas about monotone paths in a preordered topological space diff --git a/LeanPool/DirectedTopologyLean4/MorphismAux.lean b/LeanPool/DirectedTopologyLean4/MorphismAux.lean index bdc6f64123..7f147054aa 100644 --- a/LeanPool/DirectedTopologyLean4/MorphismAux.lean +++ b/LeanPool/DirectedTopologyLean4/MorphismAux.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Attr.Core # LeanPool.DirectedTopologyLean4.MorphismAux -/ -@[expose] public section +public section /- This file contains auxiliary equalities of objects morphisms in a category. diff --git a/LeanPool/DirectedTopologyLean4/PathCover.lean b/LeanPool/DirectedTopologyLean4/PathCover.lean index 4dadfc5e95..0c08619d12 100644 --- a/LeanPool/DirectedTopologyLean4/PathCover.lean +++ b/LeanPool/DirectedTopologyLean4/PathCover.lean @@ -15,7 +15,7 @@ import LeanPool.DirectedTopologyLean4.SplitPath.SplitProperties # LeanPool.DirectedTopologyLean4.PathCover -/ -@[expose] public section +public section /- This file contains the definition of a directed path being n-covered by two subspaces X₁ and X₂: diff --git a/LeanPool/DirectedTopologyLean4/PushoutAlternative.lean b/LeanPool/DirectedTopologyLean4/PushoutAlternative.lean index 0794ab7762..aa2c609802 100644 --- a/LeanPool/DirectedTopologyLean4/PushoutAlternative.lean +++ b/LeanPool/DirectedTopologyLean4/PushoutAlternative.lean @@ -11,7 +11,7 @@ public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Defs # LeanPool.DirectedTopologyLean4.PushoutAlternative -/ -@[expose] public section +public section /- This file contains an alternative way for proving a commutative square in a category is a pushout. diff --git a/LeanPool/DirectedTopologyLean4/SplitDihomotopy.lean b/LeanPool/DirectedTopologyLean4/SplitDihomotopy.lean index 80113b5a73..7643fc2a50 100644 --- a/LeanPool/DirectedTopologyLean4/SplitDihomotopy.lean +++ b/LeanPool/DirectedTopologyLean4/SplitDihomotopy.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.DTop # LeanPool.DirectedTopologyLean4.SplitDihomotopy -/ -@[expose] public section +public section /- This file contains the definitions of splitting a (dipath) diff --git a/LeanPool/DirectedTopologyLean4/SplitPath.lean b/LeanPool/DirectedTopologyLean4/SplitPath.lean index 203c78531d..625f9df9df 100644 --- a/LeanPool/DirectedTopologyLean4/SplitPath.lean +++ b/LeanPool/DirectedTopologyLean4/SplitPath.lean @@ -17,4 +17,4 @@ Bundles the directed-path splitting modules used by the Van Kampen theorem development. -/ -@[expose] public section +public section diff --git a/LeanPool/DirectedTopologyLean4/SplitPath/SplitDipath.lean b/LeanPool/DirectedTopologyLean4/SplitPath/SplitDipath.lean index 53f893b7ef..732f412190 100644 --- a/LeanPool/DirectedTopologyLean4/SplitPath/SplitDipath.lean +++ b/LeanPool/DirectedTopologyLean4/SplitPath/SplitDipath.lean @@ -13,7 +13,7 @@ import Mathlib.CategoryTheory.Category.Init # LeanPool.DirectedTopologyLean4.SplitPath.SplitDipath -/ -@[expose] public section +public section /- This file contains definitions for splitting a directed path `γ : Dipath x y` at some point `T : I` yielding two different directed paths: @@ -63,28 +63,28 @@ lemma second_part_is_dipath {γ : Path x₀ x₁} (γ_dipath : IsDipath γ) (T : exact isDipath_reparam φ_mono γ_dipath /-- The first half of a dipath split at parameter `T`, viewed as a dipath from `γ 0` to `γ T`. -/ -def FirstPart (γ : Dipath x₀ x₁) (T : I) : Dipath x₀ (γ T) := { +@[expose] def FirstPart (γ : Dipath x₀ x₁) (T : I) : Dipath x₀ (γ T) := { SplitPath.FirstPart (γ : Path x₀ x₁) T with dipath_toPath := first_part_is_dipath γ.dipath_toPath T } /-- The second half of a dipath split at parameter `T`, viewed as a dipath from `γ T` to `γ 1`. -/ -def SecondPart (γ : Dipath x₀ x₁) (T : I) : Dipath (γ T) x₁ := { +@[expose] def SecondPart (γ : Dipath x₀ x₁) (T : I) : Dipath (γ T) x₁ := { SplitPath.SecondPart (γ : Path x₀ x₁) T with dipath_toPath := second_part_is_dipath γ.dipath_toPath T } @[simp] lemma first_part_apply (γ : Dipath x₀ x₁) (T t : I) : - (FirstPart γ T) t = γ ⟨ T* t, unitInterval.mul_mem T.2 t.2⟩ := rfl + (FirstPart γ T) t = γ ⟨ T* t, unitInterval.mul_mem T.2 t.2⟩ := by rfl @[simp] lemma second_part_apply (γ : Dipath x₀ x₁) (T t : I) : - (SecondPart γ T) t = γ ⟨(σ T : ℝ) * (t : ℝ) + (T : ℝ), interp_left_mem_I T t⟩ := rfl + (SecondPart γ T) t = γ ⟨(σ T : ℝ) * (t : ℝ) + (T : ℝ), interp_left_mem_I T t⟩ := by rfl /-- The reparametrization of `I` used to glue the first and second part of a dipath split at `T` back into the original dipath, packaged as a directed self-map of `I`. -/ -def transReparamMap {T : I} (hT₀ : 0 < T) (hT₁ : T < 1) : D(I,I) where +@[expose] def transReparamMap {T : I} (hT₀ : 0 < T) (hT₁ : T < 1) : D(I,I) where toFun := fun t => ⟨transReparam T t, trans_reparam_mem_I t hT₀ hT₁⟩ continuous_toFun := Continuous.subtype_mk (continuous_trans_reparam hT₀ hT₁) _ directed_toFun := DirectedUnitInterval.directed_of_monotone _ (monotone_trans_reparam hT₀ hT₁) diff --git a/LeanPool/DirectedTopologyLean4/SplitPath/SplitPath.lean b/LeanPool/DirectedTopologyLean4/SplitPath/SplitPath.lean index 05eae30e3f..b1d0e2fc35 100644 --- a/LeanPool/DirectedTopologyLean4/SplitPath/SplitPath.lean +++ b/LeanPool/DirectedTopologyLean4/SplitPath/SplitPath.lean @@ -13,7 +13,7 @@ import Mathlib.CategoryTheory.Category.Init # LeanPool.DirectedTopologyLean4.SplitPath.SplitPath -/ -@[expose] public section +public section /- This file contains definitions for splitting a path `γ : Path x y` at some point `T : I` yielding two different paths: @@ -32,13 +32,13 @@ variable {X : Type u} [DirectedSpace X] {x₀ x₁ : X} namespace SplitPath /-- The part of a path on the interval [0, T] -/ -def FirstPart (γ : Path x₀ x₁) (T : I) : Path x₀ (γ T) where +@[expose] def FirstPart (γ : Path x₀ x₁) (T : I) : Path x₀ (γ T) where toFun := fun t => γ ⟨(T : ℝ) * ↑t, unitInterval.mul_mem T.2 t.2⟩ source' := by simp target' := by simp /-- The part of a path on the interval [T, 1] -/ -def SecondPart (γ : Path x₀ x₁) (T : I) : Path (γ T) x₁ where +@[expose] def SecondPart (γ : Path x₀ x₁) (T : I) : Path (γ T) x₁ where toFun := fun t => γ ⟨(σ T : ℝ) * ↑t + ↑T, interp_left_mem_I T t⟩ source' := by simp target' := by simp diff --git a/LeanPool/DirectedTopologyLean4/SplitPath/SplitProperties.lean b/LeanPool/DirectedTopologyLean4/SplitPath/SplitProperties.lean index 9930e654cd..716890da6c 100644 --- a/LeanPool/DirectedTopologyLean4/SplitPath/SplitProperties.lean +++ b/LeanPool/DirectedTopologyLean4/SplitPath/SplitProperties.lean @@ -12,7 +12,7 @@ import Mathlib.CategoryTheory.Category.Init /-! ### General -/ -@[expose] public section +public section /- This file contains many lemmas about relations that the parts of a split path satisfy. diff --git a/LeanPool/DirectedTopologyLean4/StretchPath.lean b/LeanPool/DirectedTopologyLean4/StretchPath.lean index 256f774b78..cb227264c4 100644 --- a/LeanPool/DirectedTopologyLean4/StretchPath.lean +++ b/LeanPool/DirectedTopologyLean4/StretchPath.lean @@ -14,7 +14,7 @@ import Mathlib.CategoryTheory.Category.Init # LeanPool.DirectedTopologyLean4.StretchPath -/ -@[expose] public section +public section /- This file contains definitions about stretching a (directed) path in `I` in two ways: @@ -37,7 +37,7 @@ lemma double_mem_I_of_bounded {t₀ t₁ : I} (t : I) (γ : Dipath t₀ t₁) (h /-- Stretch a path whose image lies in `[0, 1/2]` to a path on the full unit interval by doubling all parameter values. -/ -def stretchUpPath {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₁ : ↑t₁ ≤ (2⁻¹ : ℝ)) : Path +@[expose] def stretchUpPath {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₁ : ↑t₁ ≤ (2⁻¹ : ℝ)) : Path (⟨2 * ↑t₀, by { rw [←γ.source']; exact double_mem_I_of_bounded 0 γ ht₁ }⟩ : I) ⟨2 * ↑t₁, double_mem_I ht₁⟩ where toFun := fun t => ⟨2 * (γ t), double_mem_I_of_bounded t γ ht₁⟩ @@ -54,7 +54,7 @@ lemma isDipath_stretch_up {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₁ : ↑t /-- The dipath obtained by stretching a dipath whose image lies in `[0, 1/2]` to the full unit interval. -/ -def stretchUp {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₁ : ↑t₁ ≤ (2⁻¹ : ℝ)) : Dipath +@[expose] def stretchUp {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₁ : ↑t₁ ≤ (2⁻¹ : ℝ)) : Dipath (⟨2 * ↑t₀, by { rw [←γ.source']; exact double_mem_I_of_bounded 0 γ ht₁ }⟩ : I) ⟨2 * ↑t₁, double_mem_I ht₁⟩ where toPath := stretchUpPath γ ht₁ @@ -68,7 +68,7 @@ lemma double_sub_one_mem_I_of_bounded {t₀ t₁ : I} (t : I) (γ : Dipath t₀ /-- Stretch a path whose image lies in `[1/2, 1]` to a path on the full unit interval by mapping each parameter `s` to `2s - 1`. -/ -def stretchDownPath {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₀ : (2⁻¹ : ℝ) ≤ ↑t₀) : Path +@[expose] def stretchDownPath {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₀ : (2⁻¹ : ℝ) ≤ ↑t₀) : Path (⟨2 * ↑t₀ - 1, double_sub_one_mem_I ht₀⟩ : I) ⟨2 * ↑t₁ - 1, by { rw [←γ.target']; exact double_sub_one_mem_I_of_bounded 1 γ ht₀ }⟩ where toFun := fun t => ⟨2 * (γ t) - 1, double_sub_one_mem_I_of_bounded t γ ht₀⟩ @@ -85,7 +85,7 @@ lemma isDipath_stretch_down {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₀ : (2 /-- The dipath obtained by stretching a dipath whose image lies in `[1/2, 1]` to the full unit interval. -/ -def stretchDown {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₀ : (2⁻¹ : ℝ) ≤ ↑t₀) : Dipath +@[expose] def stretchDown {t₀ t₁ : I} (γ : Dipath t₀ t₁) (ht₀ : (2⁻¹ : ℝ) ≤ ↑t₀) : Dipath (⟨2 * ↑t₀ - 1, double_sub_one_mem_I ht₀⟩ : I) ⟨2 * ↑t₁ - 1, by { rw [←γ.target']; exact double_sub_one_mem_I_of_bounded 1 γ ht₀ }⟩ where toPath := stretchDownPath γ ht₀ diff --git a/LeanPool/DirectedTopologyLean4/TransRefl.lean b/LeanPool/DirectedTopologyLean4/TransRefl.lean index 92b6a746de..a4532532b9 100644 --- a/LeanPool/DirectedTopologyLean4/TransRefl.lean +++ b/LeanPool/DirectedTopologyLean4/TransRefl.lean @@ -12,7 +12,7 @@ public import LeanPool.DirectedTopologyLean4.Dipath # LeanPool.DirectedTopologyLean4.TransRefl -/ -@[expose] public section +public section /- Auxiliary lemmas for the reflTrans and transRefl definitions in directed_path_homotopy.lean. @@ -56,7 +56,7 @@ lemma directed_transReflReparamAux : DirectedMap.Directed /-- The auxiliary reparametrization map `I → I` used to show that `p.trans (refl _)` is dihomotopic to `p`, packaged as a directed map. -/ -def TransReflReparamAuxMap : D(I,I) where +@[expose] def TransReflReparamAuxMap : D(I,I) where toFun := fun t => ⟨transReflReparamAux t, transReflReparamAux_mem_I t⟩ continuous_toFun := Continuous.subtype_mk continuous_transReflReparamAux _ directed_toFun := directed_transReflReparamAux @@ -70,7 +70,7 @@ lemma trans_refl_reparam_dipath (p : Dipath x₀ x₁) : p.trans (Dipath.refl x rfl /-- Auxilliary function for `ReflTransReparam` -/ -def ReflTransReparamAux (t : I) : ℝ := +@[expose] def ReflTransReparamAux (t : I) : ℝ := if (t : ℝ) ≤ 1/2 then 0 else @@ -111,7 +111,7 @@ lemma directed_ReflTransReparamAux : DirectedMap.Directed /-- The auxiliary reparametrization map `I → I` used to show that `(refl _).trans p` is dihomotopic to `p`, packaged as a directed map. -/ -def ReflTransReparamAuxMap : D(I,I) where +@[expose] def ReflTransReparamAuxMap : D(I,I) where toFun := fun t => ⟨ReflTransReparamAux t, reflTransReparamAux_mem_I t⟩ continuous_toFun := Continuous.subtype_mk continuous_ReflTransReparamAux _ directed_toFun := directed_ReflTransReparamAux diff --git a/LeanPool/DirectedTopologyLean4/UnitIntervalAux.lean b/LeanPool/DirectedTopologyLean4/UnitIntervalAux.lean index f953f54ff6..a8b502b8cc 100644 --- a/LeanPool/DirectedTopologyLean4/UnitIntervalAux.lean +++ b/LeanPool/DirectedTopologyLean4/UnitIntervalAux.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.Path # LeanPool.DirectedTopologyLean4.UnitIntervalAux -/ -@[expose] public section +public section /- This file contains lemmas about diff --git a/LeanPool/DistanceGeometry.lean b/LeanPool/DistanceGeometry.lean index e1482280c8..2a57ea8546 100644 --- a/LeanPool/DistanceGeometry.lean +++ b/LeanPool/DistanceGeometry.lean @@ -23,7 +23,7 @@ Tags: distance-geometry, euclidean-geometry, linear-algebra, cayley-menger MSC: 51K05, 52C99, 15A18 -/ -@[expose] public section +public section /-! This project develops three parts of finite Euclidean distance geometry: both diff --git a/LeanPool/DistanceGeometry/CayleyMengerVolume.lean b/LeanPool/DistanceGeometry/CayleyMengerVolume.lean index a78311847e..f23c03b4f4 100644 --- a/LeanPool/DistanceGeometry/CayleyMengerVolume.lean +++ b/LeanPool/DistanceGeometry/CayleyMengerVolume.lean @@ -53,7 +53,7 @@ identity is proved here. * K. Menger, *Untersuchungen über allgemeine Metrik*, 1928. -/ -@[expose] public section +public section namespace DistanceGeometry @@ -69,7 +69,7 @@ variable {n : ℕ} first row and column, and `D` in the lower-right `(n+1)×(n+1)` block. Built with `Fin.cons`: row `0` is `[0, 1, …, 1]`; row `i+1` is `[1, D i 0, …]`. -/ -def cayleyMenger (D : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ) : +@[expose] def cayleyMenger (D : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ) : Matrix (Fin (n + 2)) (Fin (n + 2)) ℝ := Matrix.of (Fin.cons (Fin.cons 0 (fun _ => 1)) (fun i => Fin.cons 1 (D i))) diff --git a/LeanPool/DistanceGeometry/Defs.lean b/LeanPool/DistanceGeometry/Defs.lean index ba0bc8a867..12b855383d 100644 --- a/LeanPool/DistanceGeometry/Defs.lean +++ b/LeanPool/DistanceGeometry/Defs.lean @@ -45,7 +45,7 @@ only needs `Fintype` and `DecidableEq`. * I. J. Schoenberg, *Remarks to Maurice Fréchet's article ...*, 1935. -/ -@[expose] public section +public section namespace DistanceGeometry @@ -61,11 +61,11 @@ noncomputable def sqDistMatrix (x : Fin n → EuclideanSpace ℝ (Fin k)) : @[simp] theorem sqDistMatrix_apply (x : Fin n → EuclideanSpace ℝ (Fin k)) (i j : Fin n) : - sqDistMatrix x i j = dist (x i) (x j) ^ 2 := rfl + sqDistMatrix x i j = dist (x i) (x j) ^ 2 := by rfl /-- `D` is the squared-distance matrix of the configuration `x` when every entry `D i j` equals the squared Euclidean distance between points `x i` and `x j`. -/ -def IsSqDistMatrix (D : Matrix (Fin n) (Fin n) ℝ) +@[expose] def IsSqDistMatrix (D : Matrix (Fin n) (Fin n) ℝ) (x : Fin n → EuclideanSpace ℝ (Fin k)) : Prop := ∀ i j, D i j = dist (x i) (x j) ^ 2 @@ -88,7 +88,7 @@ theorem IsSqDistMatrix.hollow {D : Matrix (Fin n) (Fin n) ℝ} /-- `D` is embeddable in dimension `k` when it is the squared-distance matrix of some configuration of points in `EuclideanSpace ℝ (Fin k)`. -/ -def EmbedsIn (D : Matrix (Fin n) (Fin n) ℝ) (k : ℕ) : Prop := +@[expose] def EmbedsIn (D : Matrix (Fin n) (Fin n) ℝ) (k : ℕ) : Prop := ∃ x : Fin n → EuclideanSpace ℝ (Fin k), IsSqDistMatrix D x /-- `IsPreDistMatrix` is this project's name for the symmetric-and-hollow structural @@ -123,7 +123,7 @@ noncomputable def centeredGram [NeZero n] (D : Matrix (Fin n) (Fin n) ℝ) : @[simp] theorem centeredGram_apply [NeZero n] (D : Matrix (Fin n) (Fin n) ℝ) (i j : Fin n) : - centeredGram D i j = (D 0 i + D 0 j - D i j) / 2 := rfl + centeredGram D i j = (D 0 i + D 0 j - D i j) / 2 := by rfl /-- The basepoint-centered Gram matrix of a symmetric matrix is symmetric. -/ theorem centeredGram_symm [NeZero n] {D : Matrix (Fin n) (Fin n) ℝ} diff --git a/LeanPool/DistanceGeometry/Schoenberg.lean b/LeanPool/DistanceGeometry/Schoenberg.lean index fc6e317fb3..b753cd27fd 100644 --- a/LeanPool/DistanceGeometry/Schoenberg.lean +++ b/LeanPool/DistanceGeometry/Schoenberg.lean @@ -38,7 +38,7 @@ together with `Matrix.rank_conjTranspose_mul_self` and `Matrix.rank_le_card_heig `DistanceGeometry.schoenberg_easy` : the necessary conditions. -/ -@[expose] public section +public section namespace DistanceGeometry diff --git a/LeanPool/DistanceGeometry/SchoenbergHard.lean b/LeanPool/DistanceGeometry/SchoenbergHard.lean index 8b74ab28c0..6e265888e5 100644 --- a/LeanPool/DistanceGeometry/SchoenbergHard.lean +++ b/LeanPool/DistanceGeometry/SchoenbergHard.lean @@ -38,7 +38,7 @@ configuration, and reverse polarization recovers `D`. * `DistanceGeometry.schoenberg` : the full characterization (an iff). -/ -@[expose] public section +public section open Matrix open scoped RealInnerProductSpace diff --git a/LeanPool/DistanceGeometry/Trilateration.lean b/LeanPool/DistanceGeometry/Trilateration.lean index 21c5f27bb2..9fcb23af73 100644 --- a/LeanPool/DistanceGeometry/Trilateration.lean +++ b/LeanPool/DistanceGeometry/Trilateration.lean @@ -38,7 +38,7 @@ solution to coincide with `p₁` or `p₂`. independent centers in `EuclideanSpace ℝ (Fin 3)`. -/ -@[expose] public section +public section namespace DistanceGeometry diff --git a/LeanPool/DomainTheory.lean b/LeanPool/DomainTheory.lean index f8a4c53fa6..0184d41f3c 100644 --- a/LeanPool/DomainTheory.lean +++ b/LeanPool/DomainTheory.lean @@ -166,4 +166,4 @@ Tags: domain-theory, denotational-semantics, information-systems MSC: 03B70, 06B35, 68Q55 -/ -@[expose] public section +public section diff --git a/LeanPool/DomainTheory/Constructive.lean b/LeanPool/DomainTheory/Constructive.lean index ac11ca036c..0288573742 100644 --- a/LeanPool/DomainTheory/Constructive.lean +++ b/LeanPool/DomainTheory/Constructive.lean @@ -45,7 +45,7 @@ folding `insert`. Every declaration here is audited to depend only on `[propext, Quot.sound]`. -/ -@[expose] public section +public section namespace Domain.Constructive diff --git a/LeanPool/DomainTheory/ContinuousLattice/Constructions.lean b/LeanPool/DomainTheory/ContinuousLattice/Constructions.lean index 9f97451dab..f452e23141 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/Constructions.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/Constructions.lean @@ -28,7 +28,7 @@ the Milner correction and remain open. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice diff --git a/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaceTower.lean b/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaceTower.lean index dc987bd546..cf43c5da9d 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaceTower.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaceTower.lean @@ -23,7 +23,7 @@ its own function space* `[D_∞ → D_∞]`. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -41,12 +41,12 @@ structure CLat : Type (u + 1) where attribute [instance] CLat.str /-- The tower `D₀, [D₀→D₀], [[D₀→D₀]→[D₀→D₀]], …` as bundled complete lattices. -/ -noncomputable def towerCLat (D₀ : CLat.{u}) : ℕ → CLat.{u} +@[expose] noncomputable def towerCLat (D₀ : CLat.{u}) : ℕ → CLat.{u} | 0 => D₀ | (n + 1) => ⟨ScottMap (towerCLat D₀ n).carrier (towerCLat D₀ n).carrier⟩ /-- The carrier `Dₙ` of the function-space tower. -/ -def towerType (D₀ : CLat.{u}) (n : ℕ) : Type u := (towerCLat D₀ n).carrier +@[expose] def towerType (D₀ : CLat.{u}) (n : ℕ) : Type u := (towerCLat D₀ n).carrier noncomputable instance towerCompleteLattice (D₀ : CLat.{u}) (n : ℕ) : CompleteLattice (towerType D₀ n) := (towerCLat D₀ n).str @@ -59,7 +59,7 @@ theorem towerType_succ (D₀ : CLat.{u}) (n : ℕ) : /-- View an element of `D_{n+1}` as the Scott map `[Dₙ → Dₙ]` it definitionally is. -/ -def towerToMap {D₀ : CLat.{u}} {n : ℕ} (f : towerType D₀ (n + 1)) : +@[expose] def towerToMap {D₀ : CLat.{u}} {n : ℕ} (f : towerType D₀ (n + 1)) : ScottMap (towerType D₀ n) (towerType D₀ n) := f /-- Apply an element of `D_{n+1}` as a function `Dₙ → Dₙ` (definitional via @@ -90,6 +90,7 @@ open Set variable {Y Z W : Type u} [CompleteLattice Y] [CompleteLattice Z] [CompleteLattice W] /-- Conjugation `f ↦ post ∘ f ∘ pre` as a bare function `[Y → Y] → [W → Z]`. -/ +@[expose] def conjMapFun (post : ScottMap Y Z) (pre : ScottMap W Y) (f : ScottMap Y Y) : ScottMap W Z := post.comp (f.comp pre) @@ -123,7 +124,7 @@ theorem conjMap_preservesDirectedSup_apply (post : ScottMap Y Z) (pre : ScottMap rfl /-- Conjugation `f ↦ post ∘ f ∘ pre` as a Scott map `[Y → Y] → [W → Z]`. -/ -noncomputable def conjMap (post : ScottMap Y Z) (pre : ScottMap W Y) : +@[expose] noncomputable def conjMap (post : ScottMap Y Z) (pre : ScottMap W Y) : ScottMap (ScottMap Y Y) (ScottMap W Z) := ⟨conjMapFun post pre, continuous_of_preservesDirectedSup (conjMap_preservesDirectedSup post pre)⟩ @@ -138,7 +139,7 @@ end Conj continuous-lattice projection of `D'`, then `[D → D]` is a projection of `[D' → D']` via `i_{[·]}(f) = i ∘ f ∘ j` and `j_{[·]}(g) = j ∘ g ∘ i`. -/ -noncomputable def IsContinuousLatticeProjection.functionSpace +@[expose] noncomputable def IsContinuousLatticeProjection.functionSpace {A B : Type u} [CompleteLattice A] [CompleteLattice B] (P : IsContinuousLatticeProjection A B) : IsContinuousLatticeProjection (ScottMap A A) (ScottMap B B) where @@ -155,7 +156,7 @@ noncomputable def IsContinuousLatticeProjection.functionSpace /-- The projection tower `j_{n+1} = [j_n → j_n]`, anchored at a chosen base projection `j₀ : [D₀ → D₀] → D₀`. -/ -noncomputable def towerProj (D₀ : CLat.{u}) +@[expose] noncomputable def towerProj (D₀ : CLat.{u}) (j₀ : IsContinuousLatticeProjection D₀.carrier (ScottMap D₀.carrier D₀.carrier)) : ∀ n, IsContinuousLatticeProjection (towerType D₀ n) (towerType D₀ (n + 1)) | 0 => j₀ @@ -226,7 +227,7 @@ where `x_{n+1}` is the `(n+1)`-st component of `x ∈ D_∞`. As a map `D_∞ → [D_∞ → D_∞]` it is the composite of the component projection `j_{∞(n+1)}` with conjugation by `(i_{n∞}, j_{∞n})`. -/ -noncomputable def iInfTerm (n : ℕ) : ScottMap (DInf D₀ j₀) (DInfFn D₀ j₀) := +@[expose] noncomputable def iInfTerm (n : ℕ) : ScottMap (DInf D₀ j₀) (DInfFn D₀ j₀) := (conjMap (embInf (towerType D₀) (towerProj D₀ j₀) n) (projInf (towerType D₀) (towerProj D₀ j₀) n)).comp (projInf (towerType D₀) (towerProj D₀ j₀) (n + 1)) @@ -256,7 +257,7 @@ i_{n∞})`. As a map `[D_∞ → D_∞] → D_∞` it is conjugation by `(j_{∞n}, i_{n∞})` (landing in `D_{n+1}`) followed by the embedding `i_{(n+1)∞}`. -/ -noncomputable def jInfTerm (n : ℕ) : ScottMap (DInfFn D₀ j₀) (DInf D₀ j₀) := +@[expose] noncomputable def jInfTerm (n : ℕ) : ScottMap (DInfFn D₀ j₀) (DInf D₀ j₀) := (embInf (towerType D₀) (towerProj D₀ j₀) (n + 1)).comp (conjMap (projInf (towerType D₀) (towerProj D₀ j₀) n) (embInf (towerType D₀) (towerProj D₀ j₀) n)) diff --git a/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaces.lean b/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaces.lean index dc49d2e8a4..427e1ff484 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaces.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/FunctionSpaces.lean @@ -39,7 +39,7 @@ while `⊔S` is the supremum in the subspace `D`; the retraction identity is `j( = ⊔S`. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -117,6 +117,7 @@ abbrev ScottC (D D' : Type*) [CompleteLattice D] [CompleteLattice D'] := @ContinuousMap D D' scottTopologicalSpace scottTopologicalSpace /-- Continuous maps between complete lattices with Scott's induced topologies. -/ +@[expose] def ScottMap (D D' : Type*) [CompleteLattice D] [CompleteLattice D'] : Type _ := { f : D → D' // @Continuous D D' scottTopologicalSpace scottTopologicalSpace f } @@ -158,6 +159,7 @@ theorem preservesDirectedSup_comp {f : D' → D''} {g : D → D'} (hf : Preserve exact (Set.image_comp f g S).symm /-- Composition of Scott-continuous maps. -/ +@[expose] def comp (f : ScottMap D' D'') (g : ScottMap D D') : ScottMap D D'' := ⟨f ∘ g, continuous_of_preservesDirectedSup (preservesDirectedSup_comp ((proposition_2_5 (Subtype.val f)).mp f.property) @@ -194,6 +196,7 @@ noncomputable def bot : ScottMap D D' := const ⊥ /-- The pointwise order on Scott maps. -/ +@[expose] def le (f g : ScottMap D D') : Prop := ∀ x, f x ≤ g x @@ -235,7 +238,7 @@ noncomputable def sSupMaps (F : Set (ScottMap D D')) : ScottMap D D' := theorem sSupMaps_apply (F : Set (ScottMap D D')) (x : D) : (sSupMaps F : D → D') x = sSup (Set.image (fun f : ScottMap D D' => (f : D → D') x) F) := - rfl + by rfl /-! ### The complete lattice `[D → D']` (Theorem 3.3, order content) @@ -260,7 +263,7 @@ noncomputable instance instSupSet : SupSet (ScottMap D D') := ⟨sSupMaps⟩ theorem sSup_apply (F : Set (ScottMap D D')) (x : D) : ((sSup F : ScottMap D D') : D → D') x = sSup (Set.image (fun f : ScottMap D D' => (f : D → D') x) F) := - rfl + by rfl theorem isLUB_sSup (F : Set (ScottMap D D')) : IsLUB F (sSup F) := by constructor @@ -286,10 +289,10 @@ def idMap : ScottMap D D := show sSup S = sSup (Set.image (fun x => x) S) rw [Set.image_id']⟩ -@[simp] theorem idMap_apply (x : D) : (idMap : ScottMap D D) x = x := rfl +@[simp] theorem idMap_apply (x : D) : (idMap : ScottMap D D) x = x := by rfl @[simp] theorem comp_apply (f : ScottMap D' D'') (g : ScottMap D D') (x : D) : - (f.comp g : D → D'') x = f (g x) := rfl + (f.comp g : D → D'') x = f (g x) := by rfl /-- The (completeLatticeOfSup-derived) binary join of Scott maps is computed pointwise. -/ @@ -304,7 +307,7 @@ theorem bot_apply (x : D) : ((⊥ : ScottMap D D') : D → D') x = ⊥ := by have h : (⊥ : ScottMap D D') = sSup (∅ : Set (ScottMap D D')) := rfl rw [h, sSup_apply, Set.image_empty, sSup_empty] -@[simp] theorem const_apply (c : D') (x : D) : (ScottMap.const c : D → D') x = c := rfl +@[simp] theorem const_apply (c : D') (x : D) : (ScottMap.const c : D → D') x = c := by rfl end ScottMap @@ -747,7 +750,7 @@ noncomputable def scottLambda (f : ScottMap (D × D') D'') : ScottMap D (ScottMa @[simp] theorem scottLambda_apply (f : ScottMap (D × D') D'') (x : D) (y : D') : ((scottLambda f x : ScottMap D' D'') : D' → D'') y = (f : (D × D') → D'') (x, y) := - rfl + by rfl /-- `lambda` preserves directed suprema: both sides evaluate, pointwise at `(x, y)`, to @@ -1631,9 +1634,9 @@ noncomputable def min : ScottMap (ScottMap D D) D := = sSup (Set.image (fun f : ScottMap D D => (f : D → D) ⊥) F) rw [ScottMap.sSup_apply])⟩ -@[simp] theorem con_apply (x y : D) : ((con x : ScottMap D D) : D → D) y = x := rfl +@[simp] theorem con_apply (x y : D) : ((con x : ScottMap D D) : D → D) y = x := by rfl -@[simp] theorem min_apply (f : ScottMap D D) : (min f : D) = (f : D → D) ⊥ := rfl +@[simp] theorem min_apply (f : ScottMap D D) : (min f : D) = (f : D → D) ⊥ := by rfl /-- **Scott 1972, Proposition 3.13.** `(con, min)` makes `D` a projection of `[D → D]`: @@ -1731,7 +1734,7 @@ Scott-continuous map. -/ noncomputable def fixMap : ScottMap (ScottMap D D) D := ⟨fix, continuous_of_preservesDirectedSup fix_preservesDirectedSup⟩ -@[simp] theorem fixMap_apply (f : ScottMap D D) : (fixMap f : D) = fix f := rfl +@[simp] theorem fixMap_apply (f : ScottMap D D) : (fixMap f : D) = fix f := by rfl /-- Uniqueness: any value that is a fixed point of `f` and below every pre-fixed point equals diff --git a/LeanPool/DomainTheory/ContinuousLattice/Injective.lean b/LeanPool/DomainTheory/ContinuousLattice/Injective.lean index 9778ac999f..c126e1fa66 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/Injective.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/Injective.lean @@ -25,7 +25,7 @@ theorem) that every `T₀`-space embeds in a power of the Sierpiński space. * `corollary_1_6`, `corollary_1_7` — Scott's Corollaries 1.6 and 1.7. -/ -@[expose] public section +public section /-- Scott's two-point Sierpiński space 𝕆: `Prop` with the Sierpiński topology. -/ abbrev Sierpinski := Prop @@ -39,7 +39,7 @@ for every topological embedding `e : X → Y` and every continuous `f : X → D`, there is a continuous `g : Y → D` extending `f` along `e`. -/ -def IsInjectiveSpace (D : Type v) [TopologicalSpace D] : Prop := +@[expose] def IsInjectiveSpace (D : Type v) [TopologicalSpace D] : Prop := ∀ {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y] (e : X → Y), IsEmbedding e → ∀ f : C(X, D), ∃ g : C(Y, D), ∀ x, g (e x) = f x diff --git a/LeanPool/DomainTheory/ContinuousLattice/InverseLimits.lean b/LeanPool/DomainTheory/ContinuousLattice/InverseLimits.lean index 282e3c05f2..14a31f3c84 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/InverseLimits.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/InverseLimits.lean @@ -44,7 +44,7 @@ via injectivity, obtained here as the adjoint of the inclusion. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -73,7 +73,7 @@ theorem projection_galoisConnection (n : ℕ) : exact le_trans ((P n).incl.monotone h) ((P n).incl_retr_le y) /-- Compatibility of a sequence: `jₙ(x_{n+1}) = xₙ` for all `n`. -/ -def Compatible (x : ∀ n, D n) : Prop := ∀ n, (P n).retr (x (n + 1)) = x n +@[expose] def Compatible (x : ∀ n, D n) : Prop := ∀ n, (P n).retr (x (n + 1)) = x n /-- **Scott 1972, §4.** The inverse limit `D_∞` as the subspace of compatible sequences. -/ @@ -284,7 +284,7 @@ theorem projLE_retr {m : ℕ} : ∀ {n : ℕ} (h : m + 1 ≤ n) (x : D n), /-- Scott's embedding component `i_{n∞}(x)_m`: climb for `m ≥ n`, descend for `m < n`. -/ -def iComp (n : ℕ) (x : D n) (m : ℕ) : D m := +@[expose] def iComp (n : ℕ) (x : D n) (m : ℕ) : D m := if h : n ≤ m then embLE D P h x else projLE D P (le_of_lt (not_le.mp h)) x theorem iComp_of_le {n m : ℕ} (h : n ≤ m) (x : D n) : iComp D P n x m = embLE D P h x := @@ -385,9 +385,10 @@ theorem iComp_monotone (n m : ℕ) : Monotone (fun x : D n => iComp D P n x m) : preservesDirectedSup_monotone (iComp_preservesDirectedSup D P n m) /-- The embedding `i_{n∞} : Dₙ → D_∞` as a bare function into the inverse limit. -/ +@[expose] def embInfFun (n : ℕ) (x : D n) : InverseLimit D P := ⟨iComp D P n x, iComp_compatible D P n x⟩ -@[simp] theorem embInfFun_coe (n : ℕ) (x : D n) : (embInfFun D P n x).1 = iComp D P n x := rfl +@[simp] theorem embInfFun_coe (n : ℕ) (x : D n) : (embInfFun D P n x).1 = iComp D P n x := by rfl theorem embInf_monotone (n : ℕ) : Monotone (embInfFun D P n) := by intro x x' hxx @@ -413,7 +414,7 @@ theorem embInf_preservesDirectedSup (n : ℕ) : PreservesDirectedSup (embInfFun exact iComp_preservesDirectedSup D P n m hS hSdir /-- The projection `j_{∞n} : D_∞ → Dₙ` as a bare function. -/ -def projInfFun (n : ℕ) (y : InverseLimit D P) : D n := y.1 n +@[expose] def projInfFun (n : ℕ) (y : InverseLimit D P) : D n := y.1 n theorem eval_preservesDirectedSup (n : ℕ) : PreservesDirectedSup (projInfFun D P n) := by intro S hS hSdir @@ -424,17 +425,17 @@ theorem eval_preservesDirectedSup (n : ℕ) : PreservesDirectedSup (projInfFun D exact hL /-- The embedding `i_{n∞} : Dₙ → D_∞`, Scott-continuous. -/ -noncomputable def embInf (n : ℕ) : ScottMap (D n) (InverseLimit D P) := +@[expose] noncomputable def embInf (n : ℕ) : ScottMap (D n) (InverseLimit D P) := ⟨embInfFun D P n, continuous_of_preservesDirectedSup (embInf_preservesDirectedSup D P n)⟩ /-- The projection `j_{∞n} : D_∞ → Dₙ`, Scott-continuous. -/ -noncomputable def projInf (n : ℕ) : ScottMap (InverseLimit D P) (D n) := +@[expose] noncomputable def projInf (n : ℕ) : ScottMap (InverseLimit D P) (D n) := ⟨projInfFun D P n, continuous_of_preservesDirectedSup (eval_preservesDirectedSup D P n)⟩ /-- **Scott 1972, Proposition 4.2.** Each `j_{∞n} : D_∞ → Dₙ` is a projection of continuous lattices, with embedding `i_{n∞} = embInf n`. -/ -noncomputable def proposition_4_2 (n : ℕ) : +@[expose] noncomputable def proposition_4_2 (n : ℕ) : IsContinuousLatticeProjection (D n) (InverseLimit D P) where incl := embInf D P n retr := projInf D P n @@ -557,7 +558,7 @@ def coconeInf (f : ∀ n, ScottMap (D n) D') (x : InverseLimit D P) : D' := ⨆ n, f n (x.1 n) theorem coconeInf_apply (f : ∀ n, ScottMap (D n) D') (x : InverseLimit D P) : - coconeInf D P f x = ⨆ n, f n (x.1 n) := rfl + coconeInf D P f x = ⨆ n, f n (x.1 n) := by rfl /-- Climbing then applying `f` is constant: `f_m(i_{m-1}…iₙ x) = fₙ(x)`. -/ theorem coconeInf_climb (f : ∀ n, ScottMap (D n) D') diff --git a/LeanPool/DomainTheory/ContinuousLattice/MilnerCorrection.lean b/LeanPool/DomainTheory/ContinuousLattice/MilnerCorrection.lean index 28b554c390..9a59a042ba 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/MilnerCorrection.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/MilnerCorrection.lean @@ -41,7 +41,7 @@ topology once the Milner hypothesis is in place. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice diff --git a/LeanPool/DomainTheory/ContinuousLattice/ScottMaps.lean b/LeanPool/DomainTheory/ContinuousLattice/ScottMaps.lean index d329142ca7..59e349def4 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/ScottMaps.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/ScottMaps.lean @@ -11,7 +11,7 @@ public import LeanPool.DomainTheory.ContinuousLattice.Specialization # Scott-continuous maps (Scott 1972, §2.5–2.7) -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -20,6 +20,7 @@ open Set Topology variable {D D' D'' : Type*} [CompleteLattice D] [CompleteLattice D'] [CompleteLattice D''] /-- A function preserves suprema of nonempty directed subsets. -/ +@[expose] def PreservesDirectedSup (f : D → D') : Prop := ∀ ⦃S : Set D⦄, S.Nonempty → DirectedOn (· ≤ ·) S → f (sSup S) = sSup (f '' S) diff --git a/LeanPool/DomainTheory/ContinuousLattice/Specialization.lean b/LeanPool/DomainTheory/ContinuousLattice/Specialization.lean index 569c2b42d3..6d8ccdfc87 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/Specialization.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/Specialization.lean @@ -20,7 +20,7 @@ mathematically heavier half and is recorded as `proposition_2_1_of_le`. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -34,6 +34,7 @@ variable {X D : Type*} [TopologicalSpace X] [CompleteLattice D] /-- **Scott 1972, §2.** The *specialization order*: `x ⊑ y` when `x ∈ U` open implies `y ∈ U`. -/ +@[expose] def SpecializationLe (x y : X) : Prop := ∀ U, IsOpen U → x ∈ U → y ∈ U @@ -52,7 +53,7 @@ theorem specializationLe_antisymm [T0Space X] {x y : X} /-- Scott's induced topology on a complete lattice, realized as mathlib's Scott topology. -/ -@[reducible] noncomputable def scottTopologicalSpace : TopologicalSpace D := +@[expose, reducible] noncomputable def scottTopologicalSpace : TopologicalSpace D := Topology.scott D univ theorem ScottOpen_iff_dirSupInacc {U : Set D} : ScottOpen U ↔ IsUpperSet U ∧ DirSupInacc U := by diff --git a/LeanPool/DomainTheory/ContinuousLattice/Theorem212.lean b/LeanPool/DomainTheory/ContinuousLattice/Theorem212.lean index f799bcfa46..5316bc037a 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/Theorem212.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/Theorem212.lean @@ -39,7 +39,7 @@ idempotent on a complete lattice form a complete lattice (`IdemFix.completeLattice`). -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -97,7 +97,7 @@ supremum corrected by `e`; the rest follows from `completeLatticeOfSup`. -/ /-- The ambient supremum corrected by `e` is the supremum in `IdemFix e`. -/ theorem coe_sSup (hidem : ∀ x, e (e x) = e x) (hmono : Monotone e) (S : Set (IdemFix e)) : letI := completeLattice hidem hmono - ((sSup S : IdemFix e) : L) = e (sSup (Subtype.val '' S)) := rfl + ((sSup S : IdemFix e) : L) = e (sSup (Subtype.val '' S)) := by rfl end IdemFix diff --git a/LeanPool/DomainTheory/ContinuousLattice/WayBelow.lean b/LeanPool/DomainTheory/ContinuousLattice/WayBelow.lean index 88dcfe8fec..67f49a1490 100644 --- a/LeanPool/DomainTheory/ContinuousLattice/WayBelow.lean +++ b/LeanPool/DomainTheory/ContinuousLattice/WayBelow.lean @@ -42,7 +42,7 @@ Proposition 2.2 (vi) and (vii) fall straight out of the open-set axioms. This is the classical/topological version of the theory, so we reason classically. -/ -@[expose] public section +public section namespace Domain.ContinuousLattice @@ -53,6 +53,7 @@ upper set and is inaccessible by suprema of non-empty directed sets: if a non-empty directed `S` has its supremum in `U`, then some member of `S` already lies in `U`. -/ +@[expose] def ScottOpen (U : Set D) : Prop := IsUpperSet U ∧ ∀ ⦃S : Set D⦄, S.Nonempty → DirectedOn (· ≤ ·) S → sSup S ∈ U → (S ∩ U).Nonempty @@ -82,6 +83,7 @@ theorem scottOpen_sUnion {C : Set (Set D)} (hC : ∀ U ∈ C, ScottOpen U) : interior of the principal up-set `Set.Ici x` for the induced topology, witnessed by a Scott-open neighbourhood of `y` contained in `Set.Ici x`. -/ +@[expose] def WayBelow (x y : D) : Prop := ∃ U : Set D, ScottOpen U ∧ y ∈ U ∧ U ⊆ Set.Ici x @@ -163,6 +165,7 @@ theorem wayBelow_sSup_iff {x : D} {S : Set D} (hS : S.Nonempty) /-- **Scott 1972, Definition 2.3.** A complete lattice `D` is a *continuous lattice* when every element is the supremum of the elements way below it: `y = ⊔ {x | x ≪ y}`. -/ +@[expose] def IsContinuousLattice (D : Type*) [CompleteLattice D] : Prop := ∀ y : D, IsLUB {x | x ≪ y} y diff --git a/LeanPool/DomainTheory/InfoSys.lean b/LeanPool/DomainTheory/InfoSys.lean index 8265c1b18f..1feadb528f 100644 --- a/LeanPool/DomainTheory/InfoSys.lean +++ b/LeanPool/DomainTheory/InfoSys.lean @@ -43,7 +43,7 @@ This is the **1982** presentation; the development is kept choice-free matching Scott's emphasis on the constructive nature of the definitions. -/ -@[expose] public section +public section /-- A Scott information system on a type of tokens `α`, following Scott's Definition 2.1 diff --git a/LeanPool/DomainTheory/Neighborhood/Approximable.lean b/LeanPool/DomainTheory/Neighborhood/Approximable.lean index 65b034fe48..0cc2cdf5c6 100644 --- a/LeanPool/DomainTheory/Neighborhood/Approximable.lean +++ b/LeanPool/DomainTheory/Neighborhood/Approximable.lean @@ -65,7 +65,7 @@ classical lemma is `ext_of_toElementMap`, which decides neighbourhood membership by `by_cases` (`Classical.em`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -98,6 +98,11 @@ def sSupDirected (V : NeighborhoodSystem α) (S : Set V.Element) (hne : S.Nonemp rintro Z Z' ⟨a, haS, haZ⟩ hZ' hZZ' exact ⟨a, haS, a.up_mem haZ hZ' hZZ'⟩ +/-- Membership in a directed union is membership in one of its elements. -/ +theorem mem_sSupDirected (V : NeighborhoodSystem α) (S : Set V.Element) (hne : S.Nonempty) + (hdir : ∀ a ∈ S, ∀ b ∈ S, ∃ c ∈ S, a ≤ c ∧ b ≤ c) {Z : Set α} : + (V.sSupDirected S hne hdir).mem Z ↔ ∃ s ∈ S, s.mem Z := by rfl + /-- Each member of a directed family approximates the directed union. -/ theorem le_sSupDirected (V : NeighborhoodSystem α) (S : Set V.Element) (hne : S.Nonempty) (hdir : ∀ a ∈ S, ∀ b ∈ S, ∃ c ∈ S, a ≤ c ∧ b ≤ c) {a : V.Element} (ha : a ∈ S) : @@ -161,7 +166,7 @@ approximable mapping: `f(x) = {Y ∈ 𝒟₁ ∣ ∃ X ∈ x, X f Y}`. The four Definition 2.1: `master_mem` uses (i); `inter_mem` uses (ii) together with (iii) (to pull both outputs back along the common input `X ∩ X'`); `up_mem` uses (iii). -/ -def toElementMap (f : ApproximableMap V₀ V₁) (x : V₀.Element) : V₁.Element where +@[expose] def toElementMap (f : ApproximableMap V₀ V₁) (x : V₀.Element) : V₁.Element where mem Y := ∃ X, x.mem X ∧ f.rel X Y sub := fun ⟨_, _, hXY⟩ => f.rel_cod hXY master_mem := ⟨V₀.master, x.master_mem, f.master_rel⟩ @@ -227,6 +232,7 @@ mappings. -/ (confined to `𝒟 × 𝒟`). It is approximable: (i) `Δ ⊆ Δ`; (ii) `X ⊆ Y`, `X ⊆ Y'` give `X ⊆ Y ∩ Y'` with witness `X`; (iii) is transitivity `X' ⊆ X ⊆ Y ⊆ Y'`. -/ +@[expose] def idMap (V : NeighborhoodSystem α) : ApproximableMap V V where rel X Y := V.mem X ∧ V.mem Y ∧ X ⊆ Y rel_dom h := h.1 @@ -251,6 +257,7 @@ witnesses via `g.mono`); (iii) narrow the input with `f.mono` and widen the output with `g.mono`, keeping the same witness. -/ +@[expose] def comp (g : ApproximableMap V₁ V₂) (f : ApproximableMap V₀ V₁) : ApproximableMap V₀ V₂ where rel X Z := ∃ Y, f.rel X Y ∧ g.rel Y Z rel_dom := fun ⟨_, hXY, _⟩ => f.rel_dom hXY @@ -353,6 +360,7 @@ mapping" is the relation `X f Y ↔ Y ∈ e(↑X)`. The conditions of 2.1 hold b sharpening `X' ⊆ X` means `↑X ⊑ ↑X'`, so `e(↑X) ⊑ e(↑X')` and the output transports along, then widens by `up_mem`. -/ +@[expose] def ofIso (e : V₀.Element ≃o V₁.Element) : ApproximableMap V₀ V₁ where rel X Y := ∃ hX : V₀.mem X, (e (V₀.principal hX)).mem Y rel_dom := by rintro X Y ⟨hX, _⟩; exact hX diff --git a/LeanPool/DomainTheory/Neighborhood/ApproximableExercises.lean b/LeanPool/DomainTheory/Neighborhood/ApproximableExercises.lean index d334974dae..3ffa0e0aea 100644 --- a/LeanPool/DomainTheory/Neighborhood/ApproximableExercises.lean +++ b/LeanPool/DomainTheory/Neighborhood/ApproximableExercises.lean @@ -44,7 +44,7 @@ the two classical, exactly like `ext_of_toElementMap`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -67,6 +67,7 @@ def iSupDirected {α : Type*} {V : NeighborhoodSystem α} {I : Type*} [Nonempty theorem mem_iSupDirected {α : Type*} {V : NeighborhoodSystem α} {I : Type*} [Nonempty I] (a : I → V.Element) (hdir : ∀ i j, ∃ k, a i ≤ a k ∧ a j ≤ a k) {Z : Set α} : (iSupDirected a hdir).mem Z ↔ ∃ i, (a i).mem Z := by + rw [iSupDirected, mem_sSupDirected] constructor · rintro ⟨s, ⟨i, rfl⟩, hsZ⟩; exact ⟨i, hsZ⟩ · rintro ⟨i, hi⟩; exact ⟨a i, ⟨i, rfl⟩, hi⟩ @@ -117,6 +118,7 @@ in the sense `X' ⊆ X → m X hX ≤ m X' hX'` (i.e. `↑X ⊑ ↑X' ⟹ m(↑X) ⊑ m(↑X')`). The induced relation is `X f Y ↔ Y ∈ m(↑X)`. -/ +@[expose] def ofMono (m : (X : Set α) → V₀.mem X → V₁.Element) (hmono : ∀ (X X' : Set α) (hX : V₀.mem X) (hX' : V₀.mem X'), X' ⊆ X → m X hX ≤ m X' hX') : ApproximableMap V₀ V₁ where @@ -142,6 +144,7 @@ theorem toElementMap_ofMono_principal (ofMono m hmono).toElementMap (V₀.principal hX) = m X hX := by apply Element.ext intro Y + simp only [mem_toElementMap] constructor · rintro ⟨Z, ⟨hZmem, hXZ⟩, hZ', hmY⟩ have hle : m Z hZ' ≤ m X hX := hmono Z X hZ' hX hXZ @@ -188,6 +191,7 @@ witnesses `X ∈ x` (for `f`) and `X' ∈ x` (for `g`) through `X ∩ X' ∈ x` theorem mem_toElementMap_interMap (f g : ApproximableMap V₀ V₁) (x : V₀.Element) {Z : Set β} : ((interMap f g).toElementMap x).mem Z ↔ (f.toElementMap x).mem Z ∧ (g.toElementMap x).mem Z := by + simp only [mem_toElementMap] constructor · rintro ⟨X, hxX, hf, hg⟩ exact ⟨⟨X, hxX, hf⟩, ⟨X, hxX, hg⟩⟩ @@ -213,6 +217,7 @@ theorem toElementMap_iSupDirected (f : ApproximableMap V₀ V₁) {I : Type*} [N apply Element.ext intro Y rw [mem_toElementMap, NeighborhoodSystem.mem_iSupDirected] + simp only [mem_toElementMap] constructor · rintro ⟨X, hX, hrel⟩ obtain ⟨i, hi⟩ := (NeighborhoodSystem.mem_iSupDirected a hdir).mp hX @@ -228,7 +233,7 @@ approximable maps is approximable. Directedness is stated on the relations: any two `f i, f j` are dominated by some `f k`. The union relation is `X g Z ↔ ∃ i, X (f i) Z`. -/ -def iSupMap {I : Type*} [Nonempty I] (f : I → ApproximableMap V₀ V₁) +@[expose] def iSupMap {I : Type*} [Nonempty I] (f : I → ApproximableMap V₀ V₁) (hdir : ∀ i j, ∃ k, (∀ X Y, (f i).rel X Y → (f k).rel X Y) ∧ (∀ X Y, (f j).rel X Y → (f k).rel X Y)) : ApproximableMap V₀ V₁ where rel X Z := ∃ i, (f i).rel X Z @@ -249,6 +254,7 @@ theorem mem_toElementMap_iSupMap {I : Type*} [Nonempty I] (f : I → Approximabl (hdir : ∀ i j, ∃ k, (∀ X Y, (f i).rel X Y → (f k).rel X Y) ∧ (∀ X Y, (f j).rel X Y → (f k).rel X Y)) (x : V₀.Element) {Y : Set β} : ((iSupMap f hdir).toElementMap x).mem Y ↔ ∃ i, ((f i).toElementMap x).mem Y := by + simp only [mem_toElementMap] constructor · rintro ⟨X, hxX, i, hrel⟩ exact ⟨i, X, hxX, hrel⟩ @@ -293,7 +299,7 @@ Z}`. The filter laws use all three conditions: `inter_mem` pulls both outputs back to `(X ∩ X', Y ∩ Y')` via `mono` then `inter_right`. -/ -def toElementMap₂ (f : ApproximableMap₂ V₀ V₁ V₂) (x : V₀.Element) (y : V₁.Element) : +@[expose] def toElementMap₂ (f : ApproximableMap₂ V₀ V₁ V₂) (x : V₀.Element) (y : V₁.Element) : V₂.Element where mem Z := ∃ X Y, x.mem X ∧ y.mem Y ∧ f.rel X Y Z sub := fun ⟨_, _, _, _, hrel⟩ => f.rel_cod hrel diff --git a/LeanPool/DomainTheory/Neighborhood/Basic.lean b/LeanPool/DomainTheory/Neighborhood/Basic.lean index 41969e8550..4eff9281c8 100644 --- a/LeanPool/DomainTheory/Neighborhood/Basic.lean +++ b/LeanPool/DomainTheory/Neighborhood/Basic.lean @@ -54,7 +54,7 @@ depends only on `propext`/`Quot.sound` (no `Classical.choice`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -97,6 +97,7 @@ family `𝒟` is **nested-or-disjoint** when any two of its members are either nested (one included in the other) or disjoint. -/ +@[expose] def NestedOrDisjoint {α : Type*} (mem : Set α → Prop) : Prop := ∀ ⦃X Y : Set α⦄, mem X → mem Y → X ⊆ Y ∨ Y ⊆ X ∨ X ∩ Y = ∅ @@ -115,6 +116,7 @@ smaller (already in `𝒟`); if they are disjoint then the consistency witness ` forces `Z = ∅`, whence `X ∩ Y = ∅ = Z ∈ 𝒟`. The caller supplies `sub_master` (Scott's `𝒟 ⊆ 𝒫(Δ)`) directly. -/ +@[expose] def NeighborhoodSystem.ofNestedOrDisjoint {α : Type*} (mem : Set α → Prop) (master : Set α) (master_mem : mem master) (hnd : NestedOrDisjoint mem) (sub_master : ∀ {X : Set α}, mem X → X ⊆ master) : NeighborhoodSystem α where @@ -134,6 +136,7 @@ neighbourhood system is *positive* when Scott's (ii) is strengthened to the biconditional **(ii′)**: for `X, Y ∈ 𝒟`, the intersection `X ∩ Y` is a neighbourhood **iff** it is non-empty. -/ +@[expose] def NeighborhoodSystem.IsPositive {α : Type*} (V : NeighborhoodSystem α) : Prop := ∀ ⦃X Y : Set α⦄, V.mem X → V.mem Y → (V.mem (X ∩ Y) ↔ (X ∩ Y).Nonempty) @@ -146,6 +149,7 @@ consistency witness `Z ⊆ X ∩ Y` with `Z ∈ 𝒟` is itself non-empty (apply (ii′) to `Z ∩ Z = Z`), so `X ∩ Y ⊇ Z` is non-empty, whence `X ∩ Y ∈ 𝒟` by (ii′). Choice-free. -/ +@[expose] def NeighborhoodSystem.ofPositive {α : Type*} (mem : Set α → Prop) (master : Set α) (master_mem : mem master) (sub_master : ∀ {X : Set α}, mem X → X ⊆ master) (pos : ∀ ⦃X Y : Set α⦄, mem X → mem Y → (mem (X ∩ Y) ↔ (X ∩ Y).Nonempty)) : @@ -180,6 +184,7 @@ neighbourhoods, defined by Scott's recursive convention (**Factoid 1.1a / 1.1b** (See `interUpTo_zero` and `interUpTo_succ` for the two defining equations as lemmas.) -/ +@[expose] def interUpTo (V : NeighborhoodSystem α) (X : ℕ → Set α) : ℕ → Set α | 0 => V.master | (n + 1) => interUpTo V X n ∩ X n @@ -219,6 +224,7 @@ n} Xᵢ` (equivalently, contained in every `Xⱼ`, `j < n`). This is Scott's notion of consistency, generalized from pairs to finite sequences. -/ +@[expose] def Consistent (X : ℕ → Set α) (n : ℕ) : Prop := ∃ Z, V.mem Z ∧ Z ⊆ V.interUpTo X n @@ -388,6 +394,7 @@ These are Scott's *finite elements* of `|𝒟|`. The four filter conditions: the consistency witness for `V.inter_mem`; * `up_mem` is transitivity of `⊆`. -/ +@[expose] def principal {X : Set α} (hX : V.mem X) : V.Element where mem Y := V.mem Y ∧ X ⊆ Y sub h := h.1 @@ -447,6 +454,7 @@ theorem eq_iUnion_principal (x : V.Element) {Z : Set α} : {Δ}`, "read: *bottom*". It is the principal filter of the master neighbourhood `Δ`: `⊥ = ↑Δ`. -/ +@[expose] def bot : V.Element := V.principal V.master_mem /-- **Definition 1.8 — `⊥ = {Δ}` literally.** Scott's `⊥` is the *singleton* @@ -490,6 +498,7 @@ maximal: any *existence* of total elements above a given `x` (Exercise 1.24) is choice-dependent and out of scope here. -/ +@[expose] def IsTotal (x : V.Element) : Prop := ∀ y, x ≤ y → y ≤ x /-- **Factoid 1.8b (Scott 1981, PRG-19) — "Examples 1.2–1.5 revisited".** "Any @@ -534,6 +543,7 @@ abbrev DomainIso {α β : Type*} (V₀ : NeighborhoodSystem α) (V₁ : Neighbor V₀.Element ≃o V₁.Element /-- Scott's `𝒟₀ ≅ 𝒟₁`: the domains are isomorphic (there *exists* a `DomainIso`). -/ +@[expose] def Isomorphic {α β : Type*} (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : Prop := Nonempty (DomainIso V₀ V₁) diff --git a/LeanPool/DomainTheory/Neighborhood/Definition610.lean b/LeanPool/DomainTheory/Neighborhood/Definition610.lean index eadc8258ee..33f66cf405 100644 --- a/LeanPool/DomainTheory/Neighborhood/Definition610.lean +++ b/LeanPool/DomainTheory/Neighborhood/Definition610.lean @@ -47,7 +47,7 @@ a projection pair `i, j`) build on this relation and are formalized separately. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Definition613.lean b/LeanPool/DomainTheory/Neighborhood/Definition613.lean index 254219dfce..655ee1dcf9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Definition613.lean +++ b/LeanPool/DomainTheory/Neighborhood/Definition613.lean @@ -85,7 +85,7 @@ The identity functor is monotone and continuous on domains (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -128,7 +128,7 @@ is *monotone on domains* iff every subdomain relation `D ◁ E` is carried to a subdomain relation `T(D) ◁ T(E)` whose projection pair is `(T(i), T(j))` — see `MonotoneAt`. -/ -def MonotoneOnDomains (T : Endofunctor DomainObj.{w}) : Prop := +@[expose] def MonotoneOnDomains (T : Endofunctor DomainObj.{w}) : Prop := ∀ {α : Type w} {D E : NeighborhoodSystem α} (h : D ◁ E), MonotoneAt T h /-- The **identity functor is monotone on domains**: it fixes objects and maps, so @@ -145,7 +145,7 @@ theorem monotoneOnDomains_id : MonotoneOnDomains (idEndofunctor DomainObj.{w}) : over `T(E)`'s carrier (using `MonotoneAt.carrier_eq` to transport neighbourhoods of `T(D)` to that carrier). This is the data on which "`λD. T(D)` is approximable" is expressed. -/ -def targetFam (T : Endofunctor DomainObj.{w}) (hmono : MonotoneOnDomains T) +@[expose] def targetFam (T : Endofunctor DomainObj.{w}) (hmono : MonotoneOnDomains T) {α : Type w} {D E : NeighborhoodSystem α} (h : D ◁ E) : Set (Set (T.obj ⟨α, E⟩).carrier) := {Y | (T.obj ⟨α, D⟩).sys.mem ((hmono h).carrier_eq ▸ Y)} @@ -159,7 +159,7 @@ for any non-empty directed family `ℱ` of subsystems of `E` whose union is the subsystem `U` (`hU`), the target-side neighbourhood family of `T(U)` is the union of those of the `T(D)` for `D ∈ ℱ`. -/ -def ContinuousOnDomains (T : Endofunctor DomainObj.{w}) : Prop := +@[expose] def ContinuousOnDomains (T : Endofunctor DomainObj.{w}) : Prop := ∃ hmono : MonotoneOnDomains T, ∀ {α : Type w} {E : NeighborhoodSystem α} (ℱ : Set (NeighborhoodSystem α)) (hℱ : ∀ ⦃D⦄, D ∈ ℱ → D ◁ E) diff --git a/LeanPool/DomainTheory/Neighborhood/Definition63.lean b/LeanPool/DomainTheory/Neighborhood/Definition63.lean index 5801a7f020..0467f146f1 100644 --- a/LeanPool/DomainTheory/Neighborhood/Definition63.lean +++ b/LeanPool/DomainTheory/Neighborhood/Definition63.lean @@ -101,7 +101,7 @@ counterproductive* for this development, and is deliberately not used. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -203,22 +203,22 @@ structure AlgHom (A B : TAlgebra T) where namespace AlgHom /-- The identity is a homomorphism: `I ∘ k = k ∘ T(I)`. -/ -def id (A : TAlgebra T) : AlgHom A A where +@[expose] def id (A : TAlgebra T) : AlgHom A A where hom := Category.id A.carrier comm := by rw [Category.id_comp, T.map_id, Category.comp_id] /-- Composition of `T`-algebra homomorphisms (the `T`-algebras and homomorphisms form a category — the remark after Definition 6.4). -/ -def comp {A B C : TAlgebra T} (β : AlgHom B C) (α : AlgHom A B) : AlgHom A C where +@[expose] def comp {A B C : TAlgebra T} (β : AlgHom B C) (α : AlgHom A B) : AlgHom A C where hom := β.hom ⊚ α.hom comm := by rw [Category.assoc, α.comm, ← Category.assoc, β.comm, Category.assoc, ← T.map_comp] -@[simp] theorem id_hom (A : TAlgebra T) : (AlgHom.id A).hom = Category.id A.carrier := rfl +@[simp] theorem id_hom (A : TAlgebra T) : (AlgHom.id A).hom = Category.id A.carrier := by rfl @[simp] theorem comp_hom {A B C : TAlgebra T} (β : AlgHom B C) (α : AlgHom A B) : - (β.comp α).hom = β.hom ⊚ α.hom := rfl + (β.comp α).hom = β.hom ⊚ α.hom := by rfl end AlgHom diff --git a/LeanPool/DomainTheory/Neighborhood/Definition68.lean b/LeanPool/DomainTheory/Neighborhood/Definition68.lean index cd56dc1f2f..d0e606a19f 100644 --- a/LeanPool/DomainTheory/Neighborhood/Definition68.lean +++ b/LeanPool/DomainTheory/Neighborhood/Definition68.lean @@ -92,7 +92,7 @@ representing `Φ` is the identity on the function space. Everything here is (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -104,6 +104,7 @@ universe u (A convenient witness that `Endofunctor` is inhabited; used to show Definition 6.8 is non-vacuous.) -/ +@[expose] def idEndofunctor (Obj : Type u) [Category Obj] : Endofunctor Obj where obj X := X map f := f @@ -125,7 +126,7 @@ action `λf. T(f)` on the `(D →⊥ E)` to `(T(D) →⊥ T(E))` whose elementwise action (read through the representation `strictFunEquiv`) sends each strict map `f` to `T(f)`. -/ -def ContinuousOnMaps (T : Endofunctor DomainObj) : Prop := +@[expose] def ContinuousOnMaps (T : Endofunctor DomainObj) : Prop := ∀ D E : DomainObj, ∃ Φ : ApproximableMap (strictFun D.sys E.sys) (strictFun (T.obj D).sys (T.obj E).sys), ∀ f : StrictMap D.sys E.sys, diff --git a/LeanPool/DomainTheory/Neighborhood/Definition71.lean b/LeanPool/DomainTheory/Neighborhood/Definition71.lean index cc3d35b871..884b3c8d15 100644 --- a/LeanPool/DomainTheory/Neighborhood/Definition71.lean +++ b/LeanPool/DomainTheory/Neighborhood/Definition71.lean @@ -75,7 +75,7 @@ inhabitant (`unitSys_isEffectivelyGiven`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -175,6 +175,7 @@ end ComputablePresentation /-- **Definition 7.1 (Scott 1981, PRG-19) — effectively given.** A neighbourhood system is *effectively given* when it admits a computable presentation. -/ +@[expose] def NeighborhoodSystem.IsEffectivelyGiven (V : NeighborhoodSystem α) : Prop := Nonempty (ComputablePresentation V) diff --git a/LeanPool/DomainTheory/Neighborhood/Definition72.lean b/LeanPool/DomainTheory/Neighborhood/Definition72.lean index c99e651363..fa11cb2a3a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Definition72.lean +++ b/LeanPool/DomainTheory/Neighborhood/Definition72.lean @@ -70,7 +70,7 @@ the choice-free deciders of Definition 7.1 and the choice-free r.e. layer of `Recursive.lean`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -83,7 +83,7 @@ computable presentations `P` of `V` and `Q` of `W`, an approximable map `f : V → W` is *computable* iff its neighbourhood relation `Xₙ f Yₘ`, transported to the integer indices, is recursively enumerable. -/ -def IsComputableMap {V : NeighborhoodSystem α} {W : NeighborhoodSystem β} +@[expose] def IsComputableMap {V : NeighborhoodSystem α} {W : NeighborhoodSystem β} (P : ComputablePresentation V) (Q : ComputablePresentation W) (f : ApproximableMap V W) : Prop := REPred₂ (fun n m => f.rel (P.X n) (Q.X m)) @@ -93,7 +93,7 @@ def IsComputableMap {V : NeighborhoodSystem α} {W : NeighborhoodSystem β} condition becomes: the index set `{m ∣ Yₘ ∈ y}` of the element `y ∈ |W|` is recursively enumerable. We take this as the definition of a *computable element*. -/ -def IsComputableElement {W : NeighborhoodSystem β} (Q : ComputablePresentation W) +@[expose] def IsComputableElement {W : NeighborhoodSystem β} (Q : ComputablePresentation W) (y : W.Element) : Prop := REPred (fun m => y.mem (Q.X m)) diff --git a/LeanPool/DomainTheory/Neighborhood/Example12.lean b/LeanPool/DomainTheory/Neighborhood/Example12.lean index c856b2bc51..ec4384b4d7 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example12.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example12.lean @@ -23,7 +23,7 @@ one partial element — the bottom filter `{Δ}`. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example12 @@ -31,13 +31,13 @@ namespace Domain.Neighborhood.Example12 abbrev Token := Fin 2 /-- The master neighbourhood `Δ = {0, 1}`. -/ -def master : Set Token := Set.univ +@[expose] def master : Set Token := Set.univ /-- The neighbourhood `{0}`. -/ -def zero : Set Token := {0} +@[expose] def zero : Set Token := {0} /-- The neighbourhood `{1}`. -/ -def one : Set Token := {1} +@[expose] def one : Set Token := {1} /-- The three neighbourhoods of Example 1.2. -/ def memSet : Set (Set Token) := {master, zero, one} @@ -136,6 +136,7 @@ private theorem inter_eq (X Y : Set Token) (h : mem X) (h' : mem Y) : · exact Or.inr (Or.inr (Or.inl (Set.inter_self _))) /-- **Example 1.2.** The neighbourhood system on `Δ = {0, 1}`. -/ +@[expose] def neighborhoodSystem : NeighborhoodSystem Token where mem := mem master := master @@ -154,6 +155,7 @@ namespace neighborhoodSystem open NeighborhoodSystem /-- The bottom element `⊥ = {Δ}`. -/ +@[expose] def bot : neighborhoodSystem.Element where mem X := X = master sub h := by rw [h]; exact mem_master @@ -166,6 +168,7 @@ def bot : neighborhoodSystem.Element where exact eq_of_master_subset hY hXY /-- The total element determined by `{0}`. -/ +@[expose] def elemZero : neighborhoodSystem.Element where mem X := X = master ∨ X = zero sub h := by @@ -190,6 +193,7 @@ def elemZero : neighborhoodSystem.Element where · exact absurd hXY zero_not_subset_one /-- The total element determined by `{1}`. -/ +@[expose] def elemOne : neighborhoodSystem.Element where mem X := X = master ∨ X = one sub h := by diff --git a/LeanPool/DomainTheory/Neighborhood/Example13.lean b/LeanPool/DomainTheory/Neighborhood/Example13.lean index 7dfb1a00a4..27aaa141ea 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example13.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example13.lean @@ -26,7 +26,7 @@ This is a concrete finite computation (`fin_cases`/`simp`); footprint `[propext, Classical.choice, Quot.sound]` — same as Example 1.2. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example13 diff --git a/LeanPool/DomainTheory/Neighborhood/Example14.lean b/LeanPool/DomainTheory/Neighborhood/Example14.lean index c469526d97..166167db51 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example14.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example14.lean @@ -43,7 +43,7 @@ This is a concrete finite computation (`fin_cases`/`simp`); footprint `[propext, Classical.choice, Quot.sound]` — same as Examples 1.2/1.3. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example14 diff --git a/LeanPool/DomainTheory/Neighborhood/Example15.lean b/LeanPool/DomainTheory/Neighborhood/Example15.lean index 83a4d27c9a..e7a0632ca4 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example15.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example15.lean @@ -40,7 +40,7 @@ Unlike Examples 1.2–1.4 this construction needs no `fin_cases`/`decide`: it is bookkeeping, so it audits **constructive** (`[propext, Quot.sound]`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example15 diff --git a/LeanPool/DomainTheory/Neighborhood/Example23.lean b/LeanPool/DomainTheory/Neighborhood/Example23.lean index 6b4c031836..aa64030e53 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example23.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example23.lean @@ -51,7 +51,7 @@ codomain `T` of Example 1.2, whose `simp`/`fin_cases` proofs already do — pre-existing and harmless.) -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example23 @@ -61,12 +61,15 @@ open Domain.Neighborhood NeighborhoodSystem ExampleB abbrev T : NeighborhoodSystem Example12.Token := Example12.neighborhoodSystem /-- Scott's `true`: the total element `{Δ, {0}}` of `T`. -/ +@[expose] def trueElt : T.Element := Example12.neighborhoodSystem.elemZero /-- Scott's `false`: the total element `{Δ, {1}}` of `T`. -/ +@[expose] def falseElt : T.Element := Example12.neighborhoodSystem.elemOne /-- Scott's `⊥`: the unique partial element `{Δ}` of `T`. -/ +@[expose] def botElt : T.Element := Example12.neighborhoodSystem.bot /-- The codomain element selected by a parity reading: `none ↦ ⊥`, `some true ↦ @@ -95,9 +98,9 @@ def scan : Str → Option Bool | true :: _ => some true | false :: t => (scan t).map (!·) -@[simp] theorem scan_nil : scan [] = none := rfl -@[simp] theorem scan_true (t : Str) : scan (true :: t) = some true := rfl -@[simp] theorem scan_false (t : Str) : scan (false :: t) = (scan t).map (!·) := rfl +@[simp] theorem scan_nil : scan [] = none := by rfl +@[simp] theorem scan_true (t : Str) : scan (true :: t) = some true := by rfl +@[simp] theorem scan_false (t : Str) : scan (false :: t) = (scan t).map (!·) := by rfl /-- **Stability of the scan under extension.** Once `scan σ` has committed to a parity `some b`, diff --git a/LeanPool/DomainTheory/Neighborhood/Example24.lean b/LeanPool/DomainTheory/Neighborhood/Example24.lean index 072dd83192..b2128b2102 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example24.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example24.lean @@ -38,7 +38,7 @@ Definition 2.1(iii); (i) and (ii) are the principal-filter facts for the cone `(out σ)Σ*`. Constructive. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example24 @@ -51,9 +51,9 @@ def del : Str → Str | true :: t => del t | false :: t => false :: t -@[simp] theorem del_nil : del [] = [] := rfl -@[simp] theorem del_true (t : Str) : del (true :: t) = del t := rfl -@[simp] theorem del_false (t : Str) : del (false :: t) = false :: t := rfl +@[simp] theorem del_nil : del [] = [] := by rfl +@[simp] theorem del_true (t : Str) : del (true :: t) = del t := by rfl +@[simp] theorem del_false (t : Str) : del (false :: t) = false :: t := by rfl /-- The guaranteed output prefix: copy leading `0`'s; on the first `1`, eliminate the run via `del`. @@ -63,9 +63,9 @@ def out : Str → Str | false :: t => false :: out t | true :: t => del t -@[simp] theorem out_nil : out [] = [] := rfl -@[simp] theorem out_false (t : Str) : out (false :: t) = false :: out t := rfl -@[simp] theorem out_true (t : Str) : out (true :: t) = del t := rfl +@[simp] theorem out_nil : out [] = [] := by rfl +@[simp] theorem out_false (t : Str) : out (false :: t) = false :: out t := by rfl +@[simp] theorem out_true (t : Str) : out (true :: t) = del t := by rfl /-- `del` only grows under extension: `del s <+: del (s ++ t)`. -/ theorem del_append (s t : Str) : del s <+: del (s ++ t) := by diff --git a/LeanPool/DomainTheory/Neighborhood/Example43.lean b/LeanPool/DomainTheory/Neighborhood/Example43.lean index c71d4f8667..37b866cf6f 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example43.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example43.lean @@ -58,7 +58,7 @@ structurally from the truth domain `T` of Example 1.2 exactly as `Example23.parityMap` does. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example43 @@ -69,6 +69,7 @@ open Domain.Neighborhood NeighborhoodSystem ApproximableMap /-- Membership in Scott's natural-number system: a neighbourhood is the whole space `ℕ` or a singleton `{n}`. -/ +@[expose] def memN (X : Set ℕ) : Prop := X = Set.univ ∨ ∃ n, X = {n} theorem memN_univ : memN (Set.univ : Set ℕ) := Or.inl rfl @@ -102,13 +103,14 @@ theorem nestedOrDisjoint : NestedOrDisjoint memN := by /-- **Example 4.3 (Scott 1981, PRG-19).** The natural-number neighbourhood system `N` on `Δ = ℕ`. -/ +@[expose] def N : NeighborhoodSystem ℕ := NeighborhoodSystem.ofNestedOrDisjoint memN Set.univ memN_univ nestedOrDisjoint (fun _ => Set.subset_univ _) @[simp] theorem N_mem {X : Set ℕ} : N.mem X ↔ memN X := Iff.rfl -@[simp] theorem N_master : N.master = (Set.univ : Set ℕ) := rfl +@[simp] theorem N_master : N.master = (Set.univ : Set ℕ) := by rfl /-- `⊥ ∈ N` reads: a neighbourhood lies in `⊥` iff it is the whole space `ℕ`. -/ theorem N_bot_mem {X : Set ℕ} : N.bot.mem X ↔ X = Set.univ := NeighborhoodSystem.mem_bot N @@ -117,6 +119,7 @@ theorem N_bot_mem {X : Set ℕ} : N.bot.mem X ↔ X = Set.univ := NeighborhoodSy /-- Scott's total element `n̂ = ↑{n} = {{n}, ℕ}`, the principal filter of the singleton `{n}`. -/ +@[expose] def natElem (n : ℕ) : N.Element := N.principal (N_mem.mpr (memN_singleton n)) /-- A neighbourhood belongs to `n̂` iff it is `ℕ` (the master) or the singleton @@ -135,6 +138,7 @@ theorem mem_natElem_iff {n : ℕ} {Y : Set ℕ} : · exact ⟨memN_singleton n, subset_rfl⟩ /-- Scott's `0 ∈ |N|`, the distinguished zero of the structured domain. -/ +@[expose] def zeroElt : N.Element := natElem 0 /-! ### The strict lifting combinator `n̂ ↦ val n`, `⊥ ↦ ⊥`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Example44.lean b/LeanPool/DomainTheory/Neighborhood/Example44.lean index 5cd97af96d..dcd6a937c0 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example44.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example44.lean @@ -58,7 +58,7 @@ The data constructions (`C`, `consMap`) are **choice-free** (`#print axioms ⊆ Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Example44 @@ -80,7 +80,7 @@ theorem prepend_mono (σ : Str) {X X' : Set Str} (h : X' ⊆ X) : prepend σ X' /-! ### The neighbourhood system `C`. -/ /-- Membership in `C`: a neighbourhood is a cone `σΣ*` or a singleton `{σ}`. -/ -def memC (X : Set Str) : Prop := (∃ σ, X = cone σ) ∨ (∃ σ, X = {σ}) +@[expose] def memC (X : Set Str) : Prop := (∃ σ, X = cone σ) ∨ (∃ σ, X = {σ}) theorem memC_cone (σ : Str) : memC (cone σ) := Or.inl ⟨σ, rfl⟩ @@ -116,21 +116,21 @@ theorem nestedOrDisjoint : NestedOrDisjoint memC := by /-- **Example 4.4 (Scott 1981, PRG-19).** The neighbourhood system `C` of finite or infinite binary sequences on `Δ = Σ*`. -/ -def C : NeighborhoodSystem Str := +@[expose] def C : NeighborhoodSystem Str := NeighborhoodSystem.ofNestedOrDisjoint memC Set.univ (Or.inl ⟨[], cone_nil.symm⟩) nestedOrDisjoint (fun _ => Set.subset_univ _) @[simp] theorem C_mem {X : Set Str} : C.mem X ↔ memC X := Iff.rfl -@[simp] theorem C_master : C.master = (Set.univ : Set Str) := rfl +@[simp] theorem C_master : C.master = (Set.univ : Set Str) := by rfl /-! ### Elements of `C`: `σ` (total) and `σ⊥` (partial). -/ /-- Scott's partial element `σ⊥ = ↑σΣ*` ("the sequence starts with `σ`"). -/ -def strBot (σ : Str) : C.Element := C.principal (C_mem.mpr (memC_cone σ)) +@[expose] def strBot (σ : Str) : C.Element := C.principal (C_mem.mpr (memC_cone σ)) /-- Scott's total element `σ = ↑{σ}` (the finite sequence `σ`, completed). -/ -def strElem (σ : Str) : C.Element := C.principal (C_mem.mpr (memC_singleton σ)) +@[expose] def strElem (σ : Str) : C.Element := C.principal (C_mem.mpr (memC_singleton σ)) /-! ### The successor maps `x ↦ bx`. -/ @@ -152,7 +152,7 @@ bit `b`: `X (bx) Y ↔ bX ⊆ Y`. Approximable because `bX` is again a neighbourhood (`memC_prepend`) and prepending is monotone. -/ -def consMap (b : Bool) : ApproximableMap C C where +@[expose] def consMap (b : Bool) : ApproximableMap C C where rel X Y := memC X ∧ memC Y ∧ prepend [b] X ⊆ Y rel_dom h := h.1 rel_cod h := h.2.1 diff --git a/LeanPool/DomainTheory/Neighborhood/Example61.lean b/LeanPool/DomainTheory/Neighborhood/Example61.lean index 4a59ade913..3c84bf2f68 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example61.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example61.lean @@ -52,7 +52,7 @@ All *data* is choice-free (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -67,23 +67,28 @@ variable {α : Type*} /-- `0X = {([], a) ∣ a ∈ X}`: the `0`-tagged copy of a `D`-neighbourhood `X` (empty `{1,2}`-path). -/ +@[expose] def embZero (X : Set α) : Set (List Bool × α) := {t | t.1 = [] ∧ t.2 ∈ X} /-- `1P = {(1::p, a) ∣ (p, a) ∈ P}`: the `1`-prefixed copy of a `D^§`-neighbourhood `P`. -/ +@[expose] def embL (P : Set (List Bool × α)) : Set (List Bool × α) := {t | ∃ p', t.1 = true :: p' ∧ (p', t.2) ∈ P} /-- `2Q = {(2::q, a) ∣ (q, a) ∈ Q}`: the `2`-prefixed copy of a `D^§`-neighbourhood `Q`. -/ +@[expose] def embR (Q : Set (List Bool × α)) : Set (List Bool × α) := {t | ∃ q', t.1 = false :: q' ∧ (q', t.2) ∈ Q} /-- `1P ∪ 2Q`: the product-style neighbourhood of `D^§`. -/ +@[expose] def embPair (P Q : Set (List Bool × α)) : Set (List Bool × α) := embL P ∪ embR Q /-- The master neighbourhood `Γ = {1,2}* 0 Δ` of `D^§`: any path, `D`-token in `Δ`. -/ +@[expose] def Gamma (D : NeighborhoodSystem α) : Set (List Bool × α) := {t | t.2 ∈ D.master} @[simp] theorem mem_embZero {X : Set α} {p : List Bool} {a : α} : @@ -283,6 +288,7 @@ theorem memS_inter {D : NeighborhoodSystem α} (hD : ∀ X, D.mem X → X.Nonemp /-- **Example 6.1 (Scott 1981, PRG-19).** The *tree algebra* `D^§`: a neighbourhood system over `Γ = {1,2}* 0 Δ`, under the standing assumption `∅ ∉ 𝒟` (`hD`). -/ +@[expose] def Dsharp (D : NeighborhoodSystem α) (hD : ∀ X, D.mem X → X.Nonempty) : NeighborhoodSystem (List Bool × α) where mem := MemS D @@ -295,7 +301,7 @@ def Dsharp (D : NeighborhoodSystem α) (hD : ∀ X, D.mem X → X.Nonempty) : {W : Set (List Bool × α)} : (Dsharp D hD).mem W ↔ MemS D W := Iff.rfl @[simp] theorem Dsharp_master {D : NeighborhoodSystem α} {hD : ∀ X, D.mem X → X.Nonempty} : - (Dsharp D hD).master = Gamma D := rfl + (Dsharp D hD).master = Gamma D := by rfl /-! ### Inversion lemmas for `D^§`-neighbourhoods. diff --git a/LeanPool/DomainTheory/Neighborhood/Example62.lean b/LeanPool/DomainTheory/Neighborhood/Example62.lean index e1c1f163dd..6b77c4b526 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example62.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example62.lean @@ -49,7 +49,7 @@ filter maps `toBB` (forward) / `fromBB` (inverse), mirroring All *data* is choice-free (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -62,6 +62,7 @@ namespace Example62 /-- `bX = {b :: w' ∣ w' ∈ X}`: the `b`-prefixed copy of a neighbourhood `X` (Scott's `0X` for `b = false` and `1X` for `b = true`). -/ +@[expose] def embBit (b : Bool) (X : Set Str) : Set Str := {w | ∃ w', w = b :: w' ∧ w' ∈ X} @[simp] theorem mem_embBit {b : Bool} {X : Set Str} {w : Str} : diff --git a/LeanPool/DomainTheory/Neighborhood/Example62A.lean b/LeanPool/DomainTheory/Neighborhood/Example62A.lean index 5cfc9390f5..96623a37f9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example62A.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example62A.lean @@ -60,7 +60,7 @@ aside (eventually-periodic trees ↔ regular events) are formalised in All *data* is choice-free (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -319,7 +319,7 @@ def Asys (n : ℕ) (hn : 0 < n) : NeighborhoodSystem Str where @[simp] theorem Asys_mem {hn : 0 < n} {W : Set Str} : (Asys n hn).mem W ↔ MemA n W := Iff.rfl -@[simp] theorem Asys_master {hn : 0 < n} : (Asys n hn).master = Set.univ := rfl +@[simp] theorem Asys_master {hn : 0 < n} : (Asys n hn).master = Set.univ := by rfl /-! ### The domain equation `A ≅ Aⁿ + Aⁿ`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Example62C.lean b/LeanPool/DomainTheory/Neighborhood/Example62C.lean index 97619320e9..9164aec076 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example62C.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example62C.lean @@ -50,7 +50,7 @@ order-isomorphism All *data* is choice-free (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -197,7 +197,7 @@ theorem j2_injective {Z Z' : Set γ} variable (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) /-- The master neighbourhood of the three-way sum: `{Λ} ∪ 0Δ₀ ∪ 1Δ₁ ∪ 2Δ₂`. -/ -def master3 : Set (Option (α ⊕ β ⊕ γ)) := +@[expose] def master3 : Set (Option (α ⊕ β ⊕ γ)) := insert none (j0 V₀.master ∪ j1 V₁.master ∪ j2 V₂.master) variable {V₀ V₁ V₂} @@ -242,6 +242,7 @@ theorem eq_master3_of_subset {W : Set (Option (α ⊕ β ⊕ γ))} /-- **Example 6.2 — the three-way separated sum `D₀ + D₁ + D₂`** over `{Λ} ∪ 0Δ₀ ∪ 1Δ₁ ∪ 2Δ₂`, under the standing assumption that no neighbourhood of any factor is empty. -/ +@[expose] def sum3 (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) (h₀ : ∀ X, V₀.mem X → X.Nonempty) (h₁ : ∀ Y, V₁.mem Y → Y.Nonempty) (h₂ : ∀ Z, V₂.mem Z → Z.Nonempty) : NeighborhoodSystem (Option (α ⊕ β ⊕ γ)) where @@ -405,7 +406,7 @@ theorem sum3_mem_nonempty {W : Set (Option (Unit ⊕ Str ⊕ Str))} (h : CC.mem /-! ### The forward half `toCC : |C| → |𝟙 + C + C|`. -/ /-- **Example 6.2 — forward half of `C ≅ 𝟙 + C + C`.** -/ -def toCC (x : C.Element) : CC.Element where +@[expose] def toCC (x : C.Element) : CC.Element where mem W := W = master3 unitSys C C ∨ (W = j0 (Set.univ : Set Unit) ∧ x.mem ({[]} : Set Str)) ∨ (∃ X, C.mem X ∧ W = j1 X ∧ x.mem (embBit false X)) @@ -520,7 +521,7 @@ theorem toCC_mem_j2 {x : C.Element} {Y : Set Str} (hY : C.mem Y) : /-! ### The inverse half `fromCC : |𝟙 + C + C| → |C|`. -/ /-- **Example 6.2 — inverse half of `C ≅ 𝟙 + C + C`.** -/ -def fromCC (s : CC.Element) : C.Element where +@[expose] def fromCC (s : CC.Element) : C.Element where mem W := W = Set.univ ∨ (W = ({[]} : Set Str) ∧ s.mem (j0 (Set.univ : Set Unit))) ∨ (∃ X, C.mem X ∧ W = embBit false X ∧ s.mem (j1 X)) @@ -670,7 +671,7 @@ theorem toCC_fromCC (s : CC.Element) : toCC (fromCC s) = s := by /-! ### The domain equation `C ≅ 𝟙 + C + C`. -/ /-- **Example 6.2 (Scott 1981, PRG-19) — the isomorphism `|C| ≃o |𝟙 + C + C|`.** -/ -def ccEquiv : C.Element ≃o CC.Element where +@[expose] def ccEquiv : C.Element ≃o CC.Element where toFun := toCC invFun := fromCC left_inv := fromCC_toCC diff --git a/LeanPool/DomainTheory/Neighborhood/Example62Regular.lean b/LeanPool/DomainTheory/Neighborhood/Example62Regular.lean index cc7ad7360e..71009b895c 100644 --- a/LeanPool/DomainTheory/Neighborhood/Example62Regular.lean +++ b/LeanPool/DomainTheory/Neighborhood/Example62Regular.lean @@ -56,7 +56,7 @@ orthogonal to the neighbourhood-system machinery. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -83,6 +83,7 @@ def pos (a : Tree n) : Bool := a [] `σ`. Defined so that `(aσ)τ = a(στ)`; the `pos`-label at node `τ` of `aσ` is the label at node `στ` of `a`. -/ +@[expose] def select (a : Tree n) (σ : List (Fin n)) : Tree n := fun τ => a (σ ++ τ) @[simp] theorem select_apply (a : Tree n) (σ τ : List (Fin n)) : select a σ τ = a (σ ++ τ) := rfl diff --git a/LeanPool/DomainTheory/Neighborhood/ExampleB.lean b/LeanPool/DomainTheory/Neighborhood/ExampleB.lean index 5c358cdc64..abef28e66a 100644 --- a/LeanPool/DomainTheory/Neighborhood/ExampleB.lean +++ b/LeanPool/DomainTheory/Neighborhood/ExampleB.lean @@ -53,7 +53,7 @@ list-prefix is decidable, so the trichotomy is choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood.ExampleB @@ -64,6 +64,7 @@ abbrev Str := List Bool /-- The neighbourhood `σΣ*`: all *extensions* of `σ` (sequences with `σ` as an initial segment). -/ +@[expose] def cone (σ : Str) : Set Str := {w | σ <+: w} @[simp] theorem mem_cone {σ w : Str} : w ∈ cone σ ↔ σ <+: w := Iff.rfl @@ -113,6 +114,7 @@ theorem cone_trichotomy (σ τ : Str) : /-- Membership in Scott's binary neighbourhood system `B`: `X ∈ B` iff `X = σΣ*` for some `σ`. -/ +@[expose] def memB (X : Set Str) : Prop := ∃ σ, X = cone σ /-- **Exercise ("`B` is a neighbourhood system").** The family `B = {σΣ* ∣ σ ∈ @@ -124,13 +126,14 @@ theorem nestedOrDisjoint : NestedOrDisjoint memB := by /-- **Example 1.B (Scott 1981, PRG-19).** The binary neighbourhood system `B` on `Δ = Σ*`. -/ +@[expose] def B : NeighborhoodSystem Str := NeighborhoodSystem.ofNestedOrDisjoint memB Set.univ ⟨[], cone_nil.symm⟩ nestedOrDisjoint (fun _ => Set.subset_univ _) @[simp] theorem B_mem {X : Set Str} : B.mem X ↔ memB X := Iff.rfl -@[simp] theorem B_master : B.master = Set.univ := rfl +@[simp] theorem B_master : B.master = Set.univ := by rfl /-- Every cone is a neighbourhood of `B`. -/ theorem memB_cone (σ : Str) : B.mem (cone σ) := ⟨σ, rfl⟩ @@ -138,6 +141,7 @@ theorem memB_cone (σ : Str) : B.mem (cone σ) := ⟨σ, rfl⟩ /-! ### Prepending a prefix: `σX = {στ ∣ τ ∈ X}`. -/ /-- Scott's `σX = {στ ∣ τ ∈ X}` (prepend the prefix `σ` to every member of `X`). -/ +@[expose] def prepend (σ : Str) (X : Set Str) : Set Str := {w | ∃ τ, τ ∈ X ∧ w = σ ++ τ} @[simp] theorem mem_prepend {σ : Str} {X : Set Str} {w : Str} : @@ -174,6 +178,7 @@ theorem memB_prepend (σ : Str) {X : Set Str} (hX : B.mem X) : B.mem (prepend σ of `σ`; its minimal neighbourhood is `σΔ = σΣ*` (Scott). These are exactly the finite elements of `|B|`. -/ +@[expose] def sigmaBot (σ : Str) : B.Element := B.principal (memB_cone σ) /-- **Factoid (Scott 1981, PRG-19).** "`σ₀⊥ ⊆ σ₁⊥` if and only if `σ₀` is an @@ -197,7 +202,7 @@ The filter laws: `master` uses `X = Δ ∈ x` (`σΔ ⊆ Δ` trivially); `inter` the consistency witness `σ(X₁∩X₂)`, which is a *cone* (hence in `B`, by `memB_prepend`) contained in both `Y₁` and `Y₂`; `up` reuses the same `X`. -/ -def sigmaElt (σ : Str) (x : B.Element) : B.Element where +@[expose] def sigmaElt (σ : Str) (x : B.Element) : B.Element where mem Y := B.mem Y ∧ ∃ X, x.mem X ∧ prepend σ X ⊆ Y sub h := h.1 master_mem := ⟨B.master_mem, B.master, x.master_mem, Set.subset_univ _⟩ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise112.lean b/LeanPool/DomainTheory/Neighborhood/Exercise112.lean index 7c3bdd1ae2..b14c6fcace 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise112.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise112.lean @@ -40,7 +40,7 @@ a finite `fin n` is constructive. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise112 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise113.lean b/LeanPool/DomainTheory/Neighborhood/Exercise113.lean index 2b01062d25..a2998cdd74 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise113.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise113.lean @@ -41,7 +41,7 @@ Constructive except `branch_isTotal`'s use of `B`'s structure (still `[propext, Quot.sound]`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise113 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise114.lean b/LeanPool/DomainTheory/Neighborhood/Exercise114.lean index eafe98b2d0..398d30ab94 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise114.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise114.lean @@ -37,7 +37,7 @@ exactly the principals Constructive (`[propext, Quot.sound]`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise114 @@ -46,6 +46,7 @@ open Domain.Neighborhood NeighborhoodSystem /-- Membership: `X` is a neighbourhood iff `X = ℕ` (the master `Δ`) or `X` is finite and non-empty. -/ +@[expose] def mem (X : Set ℕ) : Prop := X = Set.univ ∨ (X.Finite ∧ X.Nonempty) theorem empty_not_mem : ¬ mem (∅ : Set ℕ) := by @@ -64,6 +65,7 @@ theorem mem_singleton (n : ℕ) : mem {n} := /-- **Exercise 1.14.** The neighbourhood system of finite non-empty subsets of `ℕ` (plus `Δ = ℕ`). -/ +@[expose] def neighborhoodSystem : NeighborhoodSystem ℕ where mem := mem master := Set.univ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise115.lean b/LeanPool/DomainTheory/Neighborhood/Exercise115.lean index 709cbb444f..0398e23a36 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise115.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise115.lean @@ -51,7 +51,7 @@ contains some atom); the constructions and the non-isomorphism argument are otherwise elementary. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise115 @@ -81,7 +81,7 @@ def flat : NeighborhoodSystem ℕ := @[simp] theorem flat_mem {X : Set ℕ} : flat.mem X ↔ X = Set.univ ∨ ∃ n, X = {n} := Iff.rfl -@[simp] theorem flat_master : flat.master = Set.univ := rfl +@[simp] theorem flat_master : flat.master = Set.univ := by rfl theorem flat_empty_not_mem : ¬ flat.mem (∅ : Set ℕ) := by rintro (h | ⟨n, h⟩) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise116.lean b/LeanPool/DomainTheory/Neighborhood/Exercise116.lean index e1fd9f8c09..69721c0d3a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise116.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise116.lean @@ -40,7 +40,7 @@ classification lemmas are not choice-free; the *constructions* (`ofExcluded`, are `[propext, Quot.sound]`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise117.lean b/LeanPool/DomainTheory/Neighborhood/Exercise117.lean index adf78989d8..94c6f7dded 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise117.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise117.lean @@ -38,7 +38,7 @@ The constructions are `[propext, Quot.sound]`; injectivity uses `exists_rat_btwn classical). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise118.lean b/LeanPool/DomainTheory/Neighborhood/Exercise118.lean index 7f590dc439..e38e19ff96 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise118.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise118.lean @@ -37,7 +37,7 @@ Constructive (`[propext, Quot.sound]`) except the counterexample's finite case-analysis. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -105,7 +105,7 @@ theorem interUpTo_appendSeq (X1 : ℕ → Set α) (n1 : ℕ) (X2 : ℕ → Set /-- **Exercise 1.18 — consistent subset.** `C ⊆ 𝒟` is *finitely consistent* iff every finite sequence drawn from `C` is `Consistent` in `𝒟`. -/ -def FinitelyConsistent (C : Set (Set α)) : Prop := +@[expose] def FinitelyConsistent (C : Set (Set α)) : Prop := ∀ (n : ℕ) (X : ℕ → Set α), (∀ i, i < n → X i ∈ C) → V.Consistent X n /-! ### Intersection of a non-empty family of filters (Scott's last claim). -/ @@ -184,7 +184,7 @@ def triSys : NeighborhoodSystem (Fin 3) := NeighborhoodSystem.ofPositive (fun X => X.Nonempty) Set.univ (⟨0, Set.mem_univ 0⟩) (fun {_} _ => Set.subset_univ _) (fun _ _ _ _ => Iff.rfl) -theorem triSys_master : triSys.master = (Set.univ : Set (Fin 3)) := rfl +theorem triSys_master : triSys.master = (Set.univ : Set (Fin 3)) := by rfl namespace triSys diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise119.lean b/LeanPool/DomainTheory/Neighborhood/Exercise119.lean index cdcf9d7968..31927f40a2 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise119.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise119.lean @@ -39,7 +39,7 @@ with Everything is `[propext, Quot.sound]`. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise119 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise120.lean b/LeanPool/DomainTheory/Neighborhood/Exercise120.lean index c7f29b0cce..294447f42c 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise120.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise120.lean @@ -39,7 +39,7 @@ unlike Def 1.7's `principal`. Everything is `[propext, Quot.sound]`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -78,6 +78,7 @@ theorem upSet_injective {X Y : Set α} (hX : V.mem X) (hY : V.mem Y) master is `↑Δ`; the intersection law uses the consistency witness `Z ∈ ↑Z ⊆ ↑X ∩ ↑Y` to get `Z ⊆ X ∩ Y`, hence `X ∩ Y ∈ 𝒟` and `↑X ∩ ↑Y = ↑(X∩Y)`. -/ +@[expose] def powerSystem : NeighborhoodSystem (Set α) where mem S := ∃ X, V.mem X ∧ S = V.upSet X master := V.upSet V.master diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise121.lean b/LeanPool/DomainTheory/Neighborhood/Exercise121.lean index d9ab5fe11d..0a8cc7982d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise121.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise121.lean @@ -35,7 +35,7 @@ proofs of Theorem 1.10 / Theorem 1.1c). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise122.lean b/LeanPool/DomainTheory/Neighborhood/Exercise122.lean index aa8969c404..fd6d3efa30 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise122.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise122.lean @@ -58,7 +58,7 @@ questions of the exercise need Definition 1.7 (`↑X`) and are deferred. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -71,7 +71,7 @@ of the domain `|𝒟|` that contain the neighbourhood `X`. These sets are the basic opens of the topology of Exercise 1.22. -/ -def basicOpen (X : Set α) : Set V.Element := {x | x.mem X} +@[expose] def basicOpen (X : Set α) : Set V.Element := {x | x.mem X} @[simp] theorem mem_basicOpen {X : Set α} {x : V.Element} : x ∈ V.basicOpen X ↔ x.mem X := Iff.rfl @@ -93,6 +93,7 @@ theorem basicOpen_inter_subset_right {X Y : Set α} (hY : V.mem Y) : /-- A set `𝒰 ⊆ |𝒟|` is *open* (Exercise 1.22, condition (ii)) when every point `x ∈ 𝒰` has a basic neighbourhood `[X]` with `X ∈ x` contained in `𝒰`. -/ +@[expose] def IsOpenFilter (U : Set V.Element) : Prop := ∀ x ∈ U, ∃ X, x.mem X ∧ V.basicOpen X ⊆ U diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise123.lean b/LeanPool/DomainTheory/Neighborhood/Exercise123.lean index 58861a5431..824734fdee 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise123.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise123.lean @@ -46,7 +46,7 @@ maximal: any `W` The construction is `[propext, Quot.sound]` given the supplied `DecidablePred`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -99,15 +99,15 @@ prefix `Y₀,…,Yₙ`? An `abbrev` so the `[DecidablePred V.mem]` instance is found through it. -/ abbrev cond (n : ℕ) : Prop := V.mem (acc V enum n ∩ enum (n + 1)) -@[simp] theorem Y_zero : Y V enum 0 = enum 0 := rfl +@[simp] theorem Y_zero : Y V enum 0 = enum 0 := by rfl -@[simp] theorem acc_zero : acc V enum 0 = V.master ∩ enum 0 := rfl +@[simp] theorem acc_zero : acc V enum 0 = V.master ∩ enum 0 := by rfl /-- The defining equation of `state` at a successor, written with the named `cond`/`acc`. -/ theorem state_succ (n : ℕ) : state V enum (n + 1) = - if cond V enum n then (enum (n + 1), acc V enum n ∩ enum (n + 1)) else state V enum n := + if cond V enum n then (enum (n + 1), acc V enum n ∩ enum (n + 1)) else state V enum n := by rfl theorem Y_succ_pos {n : ℕ} (h : cond V enum n) : Y V enum (n + 1) = enum (n + 1) := by diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise124.lean b/LeanPool/DomainTheory/Neighborhood/Exercise124.lean index 69cb7bf98f..56d907e5df 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise124.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise124.lean @@ -42,7 +42,7 @@ legitimately uses *construction* is choice-free (`[propext, Quot.sound]`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -57,6 +57,7 @@ uses chain totality: given `X ∈ x` and `Y ∈ y` with `x, y ∈ C`, one of `x ⊑ y`, `y ⊑ x` holds, and the larger filter contains both `X` and `Y`, hence `X ∩ Y`. -/ +@[expose] def chainUnion (C : Set V.Element) (hne : C.Nonempty) (hchain : IsChain (· ≤ ·) C) : V.Element where mem X := ∃ x ∈ C, x.mem X sub := by rintro X ⟨x, _, hxX⟩; exact x.sub hxX diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise125.lean b/LeanPool/DomainTheory/Neighborhood/Exercise125.lean index 5c2189e00c..26a501cccf 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise125.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise125.lean @@ -50,7 +50,7 @@ The system and `Ici` lemmas are `[propext, Quot.sound]`; the classification's surjectivity uses the well-ordering (`WellFounded.has_min`), so it is classical. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -90,7 +90,7 @@ variable {Δ : Type*} [LinearOrder Δ] [Nonempty Δ] @[simp] theorem mem_def {X : Set Δ} : (finalSegmentSystem Δ).mem X ↔ X.Nonempty ∧ IsUpperSet X := Iff.rfl -@[simp] theorem master_eq : (finalSegmentSystem Δ).master = Set.univ := rfl +@[simp] theorem master_eq : (finalSegmentSystem Δ).master = Set.univ := by rfl /-- Each `Set.Ici a` is a (non-empty, upper) neighbourhood. -/ theorem Ici_mem (a : Δ) : (finalSegmentSystem Δ).mem (Set.Ici a) := diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise126.lean b/LeanPool/DomainTheory/Neighborhood/Exercise126.lean index d2b83d5085..9c5ecff127 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise126.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise126.lean @@ -41,7 +41,7 @@ Constructive (`[propext, Quot.sound]`): the round trips are equational, the only inputs being mathlib's `Ideal.span` API. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise127.lean b/LeanPool/DomainTheory/Neighborhood/Exercise127.lean index 9a66ef36ea..49e4558547 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise127.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise127.lean @@ -48,7 +48,7 @@ this is a *proof*, so the construction stays choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -59,6 +59,7 @@ variable {α : Type*} (V : NeighborhoodSystem α) /-- **Exercise 1.27 — bounded set of elements.** `X ⊆ |𝒟|` is *bounded* iff it has an upper bound `y ∈ |𝒟|`: `x ⊑ y` for all `x ∈ X`. -/ +@[expose] def Bounded (X : Set V.Element) : Prop := ∃ y : V.Element, ∀ x ∈ X, x ≤ y /-- The family of upper bounds of `X`: `{y ∣ x ⊑ y for all x ∈ X}`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise213.lean b/LeanPool/DomainTheory/Neighborhood/Exercise213.lean index 0530bafdc6..61a86fb144 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise213.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise213.lean @@ -53,7 +53,7 @@ Choice-free apart from the `ofMono`/Exercise-2.9 ingredients (whose uniqueness companions are the only classical pieces). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise214.lean b/LeanPool/DomainTheory/Neighborhood/Exercise214.lean index d5fde454b2..ad5ea9c17e 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise214.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise214.lean @@ -48,7 +48,7 @@ X' ∈ 𝒟₀`). order-theoretic proofs of `rel_ofIso_iff`/`phi_inter` are otherwise choice-free (`propext`, `Quot.sound`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise215.lean b/LeanPool/DomainTheory/Neighborhood/Exercise215.lean index cb7a800717..83a5d25ba4 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise215.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise215.lean @@ -61,7 +61,7 @@ Choice-free (`#print axioms ⊆ {propext, Quot.sound}`) apart from the `eq_of_toElementMap_principal` uniqueness step inherited from Exercise 2.8. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise215 @@ -89,7 +89,7 @@ def O : NeighborhoodSystem (Fin 1) := NeighborhoodSystem.ofNestedOrDisjoint memO Set.univ (Or.inl rfl) nestedOrDisjoint_O subMaster_O @[simp] theorem O_mem {X : Set (Fin 1)} : O.mem X ↔ memO X := Iff.rfl -@[simp] theorem O_master : O.master = (Set.univ : Set (Fin 1)) := rfl +@[simp] theorem O_master : O.master = (Set.univ : Set (Fin 1)) := by rfl theorem O_mem_empty : O.mem (∅ : Set (Fin 1)) := Or.inr rfl theorem O_mem_univ : O.mem (Set.univ : Set (Fin 1)) := Or.inl rfl diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise216.lean b/LeanPool/DomainTheory/Neighborhood/Exercise216.lean index f05d9bc7ff..2a66b2b270 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise216.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise216.lean @@ -31,7 +31,7 @@ map satisfying `f(1x)=true`, `f(01x)=false`, `f(00x)=f(x)` — is an equational-uniqueness statement left to a later pass.) Constructive (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise216 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise218.lean b/LeanPool/DomainTheory/Neighborhood/Exercise218.lean index 23dbda4a6f..5a741d75df 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise218.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise218.lean @@ -48,7 +48,7 @@ to `⊥` (the first Choice-free (`#print axioms ⊆ {propext, Quot.sound}`): everything is decidable list surgery. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise218 @@ -62,8 +62,8 @@ def hOut : Str → Str | [] => [] | b :: t => b :: false :: hOut t -@[simp] theorem hOut_nil : hOut [] = [] := rfl -@[simp] theorem hOut_cons (b : Bool) (t : Str) : hOut (b :: t) = b :: false :: hOut t := rfl +@[simp] theorem hOut_nil : hOut [] = [] := by rfl +@[simp] theorem hOut_cons (b : Bool) (t : Str) : hOut (b :: t) = b :: false :: hOut t := by rfl /-- `hOut` grows under extension: `hOut σ <+: hOut (σ ++ t)`. -/ theorem hOut_append (σ t : Str) : hOut σ <+: hOut (σ ++ t) := by @@ -87,9 +87,9 @@ def kOut : Str → Str | [_] => [] | b :: _ :: t => b :: kOut t -@[simp] theorem kOut_nil : kOut [] = [] := rfl -@[simp] theorem kOut_single (b : Bool) : kOut [b] = [] := rfl -@[simp] theorem kOut_cons (b c : Bool) (t : Str) : kOut (b :: c :: t) = b :: kOut t := rfl +@[simp] theorem kOut_nil : kOut [] = [] := by rfl +@[simp] theorem kOut_single (b : Bool) : kOut [b] = [] := by rfl +@[simp] theorem kOut_cons (b c : Bool) (t : Str) : kOut (b :: c :: t) = b :: kOut t := by rfl /-- **`k` inverts `h` on prefixes.** `kOut (hOut σ) = σ`. -/ theorem kOut_hOut (σ : Str) : kOut (hOut σ) = σ := by diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise220.lean b/LeanPool/DomainTheory/Neighborhood/Exercise220.lean index c285c3e8a9..b98ea02f7e 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise220.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise220.lean @@ -53,7 +53,7 @@ Choice-free (`#print axioms ⊆ {propext, Quot.sound}`); the `mem_compl_of_finite` is structural recursion on a finiteness proof, not `Classical.choice`. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise220 @@ -74,7 +74,7 @@ def powerSet : NeighborhoodSystem ℕ where sub_master := fun _ => Set.subset_univ _ @[simp] theorem mem_powerSet {X : Set ℕ} : powerSet.mem X ↔ Xᶜ.Finite := Iff.rfl -@[simp] theorem powerSet_master : powerSet.master = (Set.univ : Set ℕ) := rfl +@[simp] theorem powerSet_master : powerSet.master = (Set.univ : Set ℕ) := by rfl /-- Cofinite sets are closed under intersection (witness-free form). -/ theorem powerSet_inter_mem {A B : Set ℕ} (hA : powerSet.mem A) (hB : powerSet.mem B) : diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise221.lean b/LeanPool/DomainTheory/Neighborhood/Exercise221.lean index f75aa6f6d8..1b0722957a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise221.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise221.lean @@ -59,7 +59,7 @@ after `x` is known to have terminated. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise221 @@ -135,7 +135,7 @@ def C : NeighborhoodSystem Str := @[simp] theorem C_mem {X : Set Str} : C.mem X ↔ memC X := Iff.rfl -@[simp] theorem C_master : C.master = Set.univ := rfl +@[simp] theorem C_master : C.master = Set.univ := by rfl /-- Every cone is a neighbourhood of `𝒞` — this is the inclusion `𝔹 ⊆ 𝒞`. -/ theorem memC_cone (σ : Str) : C.mem (cone σ) := Or.inl ⟨σ, rfl⟩ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise222.lean b/LeanPool/DomainTheory/Neighborhood/Exercise222.lean index f890abbfd2..9be213ac79 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise222.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise222.lean @@ -53,7 +53,7 @@ exercise's framing ("for set theorists"). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise222 @@ -150,7 +150,7 @@ def reprSystem : NeighborhoodSystem (Tok C) where @[simp] theorem mem_reprSystem {N : Set (Tok C)} : (reprSystem C hInter hne).mem N ↔ ∃ F : Tok C, N = nbhd C F.1 := Iff.rfl -@[simp] theorem reprSystem_master : (reprSystem C hInter hne).master = Set.univ := rfl +@[simp] theorem reprSystem_master : (reprSystem C hInter hne).master = Set.univ := by rfl /-! ### From an element to a set of `C`: `x ↦ ⋃ {Fbar ∣ C(F) ∈ x}`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise314.lean b/LeanPool/DomainTheory/Neighborhood/Exercise314.lean index 5013a83081..2b0fa696a4 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise314.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise314.lean @@ -39,7 +39,7 @@ here is the Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise315.lean b/LeanPool/DomainTheory/Neighborhood/Exercise315.lean index b28c2528a2..945f8a718d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise315.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise315.lean @@ -32,7 +32,7 @@ it is a two-sided Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -45,6 +45,7 @@ variable {V₀' : NeighborhoodSystem α'} {V₁' : NeighborhoodSystem β'} /-! ### Order-iso helpers for cartesian products. -/ /-- The product of two order isomorphisms, as an order isomorphism. -/ +@[expose] def prodCongrOrderIso {A B C D : Type*} [Preorder A] [Preorder B] [Preorder C] [Preorder D] (e₀ : A ≃o B) (e₁ : C ≃o D) : A × C ≃o B × D where toFun p := (e₀ p.1, e₁ p.2) @@ -111,6 +112,7 @@ single neighbourhood `Δ = univ`. Its domain `|𝟙|` has exactly one element (`⊥ = {Δ}`), so `𝟙` is the *product of no factors*. -/ +@[expose] def unitSys : NeighborhoodSystem Unit where mem X := X = Set.univ master := Set.univ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise316.lean b/LeanPool/DomainTheory/Neighborhood/Exercise316.lean index d2be68f42c..6a0f9e24cd 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise316.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise316.lean @@ -52,7 +52,7 @@ inherited from the project's `Element.ext`/`prodEquiv` machinery, as elsewhere in §3. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -63,6 +63,7 @@ variable {α : Type*} /-! ### Fibers of a set of `(copy index, token)` pairs. -/ /-- The `i`-th *fiber* of a set `W ⊆ ℕ × α`: the tokens appearing in copy `i`. -/ +@[expose] def fiber (W : Set (ℕ × α)) (i : ℕ) : Set α := {a | (i, a) ∈ W} @[simp] theorem mem_fiber {W : Set (ℕ × α)} {i : ℕ} {a : α} : a ∈ fiber W i ↔ (i, a) ∈ W := Iff.rfl @@ -71,7 +72,7 @@ theorem fiber_mono {W W' : Set (ℕ × α)} (h : W ⊆ W') (i : ℕ) : fiber W i fun _ ha => h ha theorem fiber_inter (W W' : Set (ℕ × α)) (i : ℕ) : - fiber (W ∩ W') i = fiber W i ∩ fiber W' i := rfl + fiber (W ∩ W') i = fiber W i ∩ fiber W' i := by rfl theorem eq_of_fiber_eq {W W' : Set (ℕ × α)} (h : ∀ i, fiber W i = fiber W' i) : W = W' := by ext ⟨i, a⟩ @@ -119,6 +120,7 @@ theorem single_inter {n : ℕ} (X X' : Set α) : ℕ × Δ`: `W ∈ 𝒟^∞` iff every fiber is a neighbourhood of `𝒟` and all but finitely many fibers equal `Δ`. -/ +@[expose] def iterSys (V : NeighborhoodSystem α) : NeighborhoodSystem (ℕ × α) where mem W := (∀ i, V.mem (fiber W i)) ∧ ∃ N, ∀ i, N ≤ i → fiber W i = V.master master := {p | p.2 ∈ V.master} @@ -134,9 +136,9 @@ def iterSys (V : NeighborhoodSystem α) : NeighborhoodSystem (ℕ × α) where rintro W ⟨hWf, _⟩ ⟨i, a⟩ ha exact V.sub_master (hWf i) ha -@[simp] theorem iterSys_master : (iterSys V).master = {p : ℕ × α | p.2 ∈ V.master} := rfl +@[simp] theorem iterSys_master : (iterSys V).master = {p : ℕ × α | p.2 ∈ V.master} := by rfl -theorem fiber_iterSys_master (i : ℕ) : fiber ((iterSys V).master) i = V.master := rfl +theorem fiber_iterSys_master (i : ℕ) : fiber ((iterSys V).master) i = V.master := by rfl @[simp] theorem mem_iterSys {W : Set (ℕ × α)} : (iterSys V).mem W ↔ (∀ i, V.mem (fiber W i)) ∧ ∃ N, ∀ i, N ≤ i → fiber W i = V.master := Iff.rfl @@ -191,7 +193,7 @@ theorem reconstruct_subset {W : Set (ℕ × α)} (_hW : (iterSys V).mem W) {N : /-- The `n`-th component `xₙ ∈ |𝒟|` of a `𝒟^∞`-element `z` (Scott's coordinate at copy `n`). -/ -def component (z : (iterSys V).Element) (n : ℕ) : V.Element where +@[expose] def component (z : (iterSys V).Element) (n : ℕ) : V.Element where mem X := V.mem X ∧ z.mem (single V n X) sub h := h.1 master_mem := ⟨V.master_mem, by rw [single_master]; exact z.master_mem⟩ @@ -211,6 +213,7 @@ def component (z : (iterSys V).Element) (n : ℕ) : V.Element where /-- The `𝒟^∞`-element determined by an infinite sequence `⟨xₙ⟩` of `𝒟`-elements: the neighbourhoods `W` whose every fiber lies in the corresponding `xᵢ`. -/ +@[expose] def ofSeq (seq : ℕ → V.Element) : (iterSys V).Element where mem W := (iterSys V).mem W ∧ ∀ i, (seq i).mem (fiber W i) sub h := h.1 @@ -279,6 +282,7 @@ theorem le_of_component_le {z z' : (iterSys V).Element} one-one, order-preserving correspondence with infinite sequences `⟨xₙ⟩` of elements of `|𝒟|`. -/ +@[expose] def iterSeqEquiv (V : NeighborhoodSystem α) : (iterSys V).Element ≃o (∀ _ : ℕ, V.Element) where toFun z := fun n => component z n invFun seq := ofSeq seq @@ -293,7 +297,7 @@ def iterSeqEquiv (V : NeighborhoodSystem α) : (iterSys V).Element ≃o (∀ _ : exact ⟨hX.1, h (single V n X) hX.2⟩ /-- The shift order-isomorphism `(ℕ → E) ≃o E × (ℕ → E)`, `f ↦ (f 0, f ∘ succ)`. -/ -def natShiftEquiv (E : Type*) [Preorder E] : (ℕ → E) ≃o E × (ℕ → E) where +@[expose] def natShiftEquiv (E : Type*) [Preorder E] : (ℕ → E) ≃o E × (ℕ → E) where toFun f := (f 0, fun n => f (n + 1)) invFun p := fun n => Nat.casesOn n p.1 (fun m => p.2 m) left_inv f := by funext n; cases n <;> rfl @@ -312,6 +316,7 @@ def natShiftEquiv (E : Type*) [Preorder E] : (ℕ → E) ≃o E × (ℕ → E) w /-- **Exercise 3.16 (Scott 1981, PRG-19).** The isomorphism `|𝒟^∞| ≃o |𝒟 × 𝒟^∞|`, obtained from the sequence correspondence and the shift. -/ +@[expose] def iterProdIso (V : NeighborhoodSystem α) : (iterSys V).Element ≃o (prod V (iterSys V)).Element := (iterSeqEquiv V).trans <| diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise317.lean b/LeanPool/DomainTheory/Neighborhood/Exercise317.lean index fb2ba574dd..144d4927bd 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise317.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise317.lean @@ -52,7 +52,7 @@ element can only lose the post-gap information. Hence `f` is one-one (`f_injective`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise317 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise318.lean b/LeanPool/DomainTheory/Neighborhood/Exercise318.lean index de2be68ad4..f24cc62328 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise318.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise318.lean @@ -37,7 +37,7 @@ maps.) Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -129,7 +129,7 @@ theorem inj₁_injective {Y Y' : Set β} (h : (inj₁ Y : Set (Option (α ⊕ β variable (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) /-- The master neighbourhood of the sum: `{Λ} ∪ 0Δ₀ ∪ 1Δ₁`. -/ -def sumMaster : Set (Option (α ⊕ β)) := insert none (inj₀ V₀.master ∪ inj₁ V₁.master) +@[expose] def sumMaster : Set (Option (α ⊕ β)) := insert none (inj₀ V₀.master ∪ inj₁ V₁.master) variable {V₀ V₁} @@ -159,7 +159,7 @@ theorem sumMaster_inter_inj₁ {Y : Set β} (hY : V₁.mem Y) : /-- **Exercise 3.18 (Scott 1981, PRG-19).** The *sum system* `𝒟₀ + 𝒟₁` over `{Λ} ∪ 0Δ₀ ∪ 1Δ₁`, under the standing assumption that no neighbourhood of `𝒟₀` or `𝒟₁` is empty. -/ -def sum (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) +@[expose] def sum (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) (h₀ : ∀ X, V₀.mem X → X.Nonempty) (h₁ : ∀ Y, V₁.mem Y → Y.Nonempty) : NeighborhoodSystem (Option (α ⊕ β)) where mem W := W = sumMaster V₀ V₁ ∨ (∃ X, V₀.mem X ∧ W = inj₀ X) ∨ (∃ Y, V₁.mem Y ∧ W = inj₁ Y) @@ -330,7 +330,7 @@ theorem rightPart_mem {W : Set (Option (α ⊕ β))} (hW : (sum V₀ V₁ h₀ h /-- **Exercise 3.18 (Scott 1981, PRG-19).** The left injection `in₀ : 𝒟₀ → 𝒟₀ + 𝒟₁`, `X (in₀) W ↔ 0X ⊆ W`. -/ -def inMap₀ : ApproximableMap V₀ (sum V₀ V₁ h₀ h₁) where +@[expose] def inMap₀ : ApproximableMap V₀ (sum V₀ V₁ h₀ h₁) where rel X W := V₀.mem X ∧ (sum V₀ V₁ h₀ h₁).mem W ∧ inj₀ X ⊆ W rel_dom h := h.1 rel_cod h := h.2.1 @@ -345,7 +345,7 @@ def inMap₀ : ApproximableMap V₀ (sum V₀ V₁ h₀ h₁) where /-- **Exercise 3.18 (Scott 1981, PRG-19).** The right injection `in₁ : 𝒟₁ → 𝒟₀ + 𝒟₁`. -/ -def inMap₁ : ApproximableMap V₁ (sum V₀ V₁ h₀ h₁) where +@[expose] def inMap₁ : ApproximableMap V₁ (sum V₀ V₁ h₀ h₁) where rel Y W := V₁.mem Y ∧ (sum V₀ V₁ h₀ h₁).mem W ∧ inj₁ Y ⊆ W rel_dom h := h.1 rel_cod h := h.2.1 @@ -362,7 +362,7 @@ def inMap₁ : ApproximableMap V₁ (sum V₀ V₁ h₀ h₁) where 𝒟₀`, `W (out₀) X ↔ leftPart W ⊆ X` (right/basepoint neighbourhoods relate only to `Δ₀`). -/ -def outMap₀ : ApproximableMap (sum V₀ V₁ h₀ h₁) V₀ where +@[expose] def outMap₀ : ApproximableMap (sum V₀ V₁ h₀ h₁) V₀ where rel W X := (sum V₀ V₁ h₀ h₁).mem W ∧ V₀.mem X ∧ leftPart V₀ W ⊆ X rel_dom h := h.1 rel_cod h := h.2.1 @@ -377,7 +377,7 @@ def outMap₀ : ApproximableMap (sum V₀ V₁ h₀ h₁) V₀ where /-- **Exercise 3.18 (Scott 1981, PRG-19).** The right projection `out₁ : 𝒟₀ + 𝒟₁ → 𝒟₁`. -/ -def outMap₁ : ApproximableMap (sum V₀ V₁ h₀ h₁) V₁ where +@[expose] def outMap₁ : ApproximableMap (sum V₀ V₁ h₀ h₁) V₁ where rel W Y := (sum V₀ V₁ h₀ h₁).mem W ∧ V₁.mem Y ∧ rightPart V₁ W ⊆ Y rel_dom h := h.1 rel_cod h := h.2.1 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise319.lean b/LeanPool/DomainTheory/Neighborhood/Exercise319.lean index b721674bbf..323eb8d8a9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise319.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise319.lean @@ -34,7 +34,7 @@ is built. Everything here is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -46,7 +46,7 @@ variable {V₀' : NeighborhoodSystem α'} {V₁' : NeighborhoodSystem β'} /-- **Exercise 3.19(ii) (Scott 1981, PRG-19).** The product mapping `f × g = ⟨f ∘ p₀, g ∘ p₁⟩`. -/ -def prodMap (f : ApproximableMap V₀ V₀') (g : ApproximableMap V₁ V₁') : +@[expose] def prodMap (f : ApproximableMap V₀ V₀') (g : ApproximableMap V₁ V₁') : ApproximableMap (prod V₀ V₁) (prod V₀' V₁') := paired (f.comp (proj₀ V₀ V₁)) (g.comp (proj₁ V₀ V₁)) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise319Sum.lean b/LeanPool/DomainTheory/Neighborhood/Exercise319Sum.lean index fe81562a61..1d4e769422 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise319Sum.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise319Sum.lean @@ -37,7 +37,7 @@ on the basepoint `Λ` (i.e. `(f + g)(⊥)`) is unconstrained; our choice sends ` Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -100,6 +100,7 @@ theorem not_inj₁_subset_inj₀ {X : Set α} {Y : Set β} (hY : Y.Nonempty) relation between sum-neighbourhoods, `W (f+g) W'` holds iff `W'` is the codomain master, or `W = 0X` with `W' = 0Y'` and `X f Y'`, or `W = 1Y` with `W' = 1Y'` and `Y g Y'`. -/ +@[expose] def sumMap (f : ApproximableMap V₀ V₀') (g : ApproximableMap V₁ V₁') : ApproximableMap (sum V₀ V₁ h₀ h₁) (sum V₀' V₁' h₀' h₁') where rel W W' := (sum V₀ V₁ h₀ h₁).mem W ∧ (sum V₀' V₁' h₀' h₁').mem W' ∧ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise321.lean b/LeanPool/DomainTheory/Neighborhood/Exercise321.lean index 3a2ccb4f05..b4da6c8fbc 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise321.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise321.lean @@ -40,7 +40,7 @@ outputs are `Δ₂`, or Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise322.lean b/LeanPool/DomainTheory/Neighborhood/Exercise322.lean index ae9ce768b5..15120eed71 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise322.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise322.lean @@ -35,7 +35,7 @@ Definition 3.3, and then Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise323.lean b/LeanPool/DomainTheory/Neighborhood/Exercise323.lean index 2559389f94..0480736eb4 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise323.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise323.lean @@ -46,7 +46,7 @@ right adjoint to `- × 𝒟₀`. Everything is **choice-free** (`#print axioms {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise324.lean b/LeanPool/DomainTheory/Neighborhood/Exercise324.lean index 2e6ec590d1..b8e3116dc3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise324.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise324.lean @@ -32,7 +32,7 @@ and Proposition 3.2's `prodEquiv` gives the domain isomorphism `funProdIso`. Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise324Distrib.lean b/LeanPool/DomainTheory/Neighborhood/Exercise324Distrib.lean index accfe24cd2..d79d07b2a9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise324Distrib.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise324Distrib.lean @@ -49,7 +49,7 @@ extraction lemmas of Exercise 3.19. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise324Iter.lean b/LeanPool/DomainTheory/Neighborhood/Exercise324Iter.lean index 9835a8f4c9..3bf9952d2d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise324Iter.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise324Iter.lean @@ -41,7 +41,7 @@ from `Element.ext`, §3. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise325.lean b/LeanPool/DomainTheory/Neighborhood/Exercise325.lean index d3c6d04d00..97d99a8f37 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise325.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise325.lean @@ -47,7 +47,7 @@ recovered from its basic neighbourhoods. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise325 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise326.lean b/LeanPool/DomainTheory/Neighborhood/Exercise326.lean index 73dfe78ef6..eab13bd368 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise326.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise326.lean @@ -60,7 +60,7 @@ and from the project's `ext_of_toElementMap`/`Element.ext` machinery, as elsewhe in §3. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise326 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise326Sum.lean b/LeanPool/DomainTheory/Neighborhood/Exercise326Sum.lean index 52f9621627..c837261230 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise326Sum.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise326Sum.lean @@ -42,7 +42,7 @@ component are mutually exclusive because the three forms of a sum-neighbourhood copy, right copy) are mutually exclusive (Exercise 3.18, using non-emptiness). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise326 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise327.lean b/LeanPool/DomainTheory/Neighborhood/Exercise327.lean index fecf233419..3074fb689e 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise327.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise327.lean @@ -54,7 +54,7 @@ Scott's "compare with Exercise 2.22 and from the `graph`-inversion. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise327 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise328.lean b/LeanPool/DomainTheory/Neighborhood/Exercise328.lean index 3a97bb8774..726795b091 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise328.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise328.lean @@ -42,7 +42,7 @@ antisymmetry. Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise407.lean b/LeanPool/DomainTheory/Neighborhood/Exercise407.lean index 2f321cc4db..9ebabadca9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise407.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise407.lean @@ -36,7 +36,7 @@ filters, Exercise 2.11 / All constructions are **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -51,7 +51,7 @@ def iterFrom (f : ApproximableMap V V) (a : V.Element) (n : ℕ) : V.Element := (f.toElementMap)^[n] a @[simp] theorem iterFrom_zero (f : ApproximableMap V V) (a : V.Element) : - f.iterFrom a 0 = a := rfl + f.iterFrom a 0 = a := by rfl theorem iterFrom_succ (f : ApproximableMap V V) (a : V.Element) (n : ℕ) : f.iterFrom a (n + 1) = f.toElementMap (f.iterFrom a n) := by @@ -78,6 +78,7 @@ theorem iterFrom_mono (f : ApproximableMap V V) {a : V.Element} (ha : a ≤ f.to /-- The fixed point of `f` lying above a pre-fixed-point candidate `a` (with `a ⊑ f(a)`), constructed as the directed union `⊔ₙ fⁿ(a)`. -/ +@[expose] def fixAbove (f : ApproximableMap V V) {a : V.Element} (ha : a ≤ f.toElementMap a) : V.Element := NeighborhoodSystem.iSupDirected (f.iterFrom a) (fun i j => ⟨max i j, iterFrom_mono f ha (le_max_left i j), diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise408.lean b/LeanPool/DomainTheory/Neighborhood/Exercise408.lean index 67086a5f21..f5e2214743 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise408.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise408.lean @@ -45,7 +45,7 @@ used to compare the two directed unions. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise409.lean b/LeanPool/DomainTheory/Neighborhood/Exercise409.lean index 1cac0a56fd..0943ed7e7f 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise409.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise409.lean @@ -52,7 +52,7 @@ through the project's permitted `Element.ext` / `ext_of_toElementMap`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise410.lean b/LeanPool/DomainTheory/Neighborhood/Exercise410.lean index 922648774c..90ff291aa5 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise410.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise410.lean @@ -55,7 +55,7 @@ project's permitted `Element.ext`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -70,7 +70,7 @@ namespace ApproximableMap /-- **Exercise 4.10 (Scott 1981, PRG-19).** The relativized neighbourhood system `Dₐ`: same tokens and master, neighbourhoods exactly the members of the filter `a`. -/ -def relSystem (a : V.Element) : NeighborhoodSystem α where +@[expose] def relSystem (a : V.Element) : NeighborhoodSystem α where mem X := a.mem X master := V.master master_mem := a.master_mem @@ -80,10 +80,10 @@ def relSystem (a : V.Element) : NeighborhoodSystem α where @[simp] theorem relSystem_mem (a : V.Element) {X : Set α} : (relSystem a).mem X ↔ a.mem X := Iff.rfl -@[simp] theorem relSystem_master (a : V.Element) : (relSystem a).master = V.master := rfl +@[simp] theorem relSystem_master (a : V.Element) : (relSystem a).master = V.master := by rfl /-- The `𝒟`-element obtained from a `Dₐ`-filter by upward closure in `𝒟`. -/ -def embed (a : V.Element) (g : (relSystem a).Element) : V.Element where +@[expose] def embed (a : V.Element) (g : (relSystem a).Element) : V.Element where mem X := V.mem X ∧ ∃ W, a.mem W ∧ g.mem W ∧ W ⊆ X sub := fun h => h.1 master_mem := ⟨V.master_mem, V.master, a.master_mem, g.master_mem, subset_rfl⟩ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise411.lean b/LeanPool/DomainTheory/Neighborhood/Exercise411.lean index 8fc17ebef4..c1e00382cc 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise411.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise411.lean @@ -52,7 +52,7 @@ the project's permitted `Element.ext`; the inclusion data `inclMap` is **choice-free**. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -104,7 +104,7 @@ theorem fixElement_uniform {β γ : Type*} {W₀ : NeighborhoodSystem β} {W₁ relates to any larger `𝒟`-neighbourhood `Y ⊇ X`. Its elementwise action is `embed a` (`inclMap_toElementMap`). -/ -def inclMap (a : V.Element) : ApproximableMap (relSystem a) V where +@[expose] def inclMap (a : V.Element) : ApproximableMap (relSystem a) V where rel X Y := a.mem X ∧ V.mem Y ∧ X ⊆ Y rel_dom := fun h => h.1 rel_cod := fun h => h.2.1 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise412.lean b/LeanPool/DomainTheory/Neighborhood/Exercise412.lean index 907f114cb7..6b427a1870 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise412.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise412.lean @@ -36,7 +36,7 @@ classification, exactly as that file does. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise412 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise413.lean b/LeanPool/DomainTheory/Neighborhood/Exercise413.lean index 65f70c06b9..f5a9c8d2c2 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise413.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise413.lean @@ -60,7 +60,7 @@ used in 4.1 (`nat_iterate_unique`), closing the loop without circularity. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise414.lean b/LeanPool/DomainTheory/Neighborhood/Exercise414.lean index db9dcfbf21..b9639ac946 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise414.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise414.lean @@ -42,7 +42,7 @@ Both constructions use **only monotonicity** and the complete-lattice structure entirely **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise414 @@ -86,6 +86,7 @@ theorem gfpSet_greatest (f : Set A → Set A) {y : Set A} (hy : f y = y) : monotone `f : P A → P A`, as the intersection of all pre-fixed points `⋂ {x ∣ f(x) ⊆ x}`. -/ +@[expose] def lfpSet (f : Set A → Set A) : Set A := {a | ∀ x : Set A, f x ⊆ x → a ∈ x} /-- `lfpSet f ⊆ x` for every pre-fixed point `f(x) ⊆ x`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise415.lean b/LeanPool/DomainTheory/Neighborhood/Exercise415.lean index 444ffee287..c165a63cb3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise415.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise415.lean @@ -49,7 +49,7 @@ like Exercise 1.24; the `chainUnion` construction itself is choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise416.lean b/LeanPool/DomainTheory/Neighborhood/Exercise416.lean index d3aa4d9a34..d913d95c07 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise416.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise416.lean @@ -43,7 +43,7 @@ the supply of maximal fixed points is classical. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise417.lean b/LeanPool/DomainTheory/Neighborhood/Exercise417.lean index bf124723a4..729ab083f4 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise417.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise417.lean @@ -49,7 +49,7 @@ inheriting `lfpSet` from Exercise 4.14. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise417 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise418.lean b/LeanPool/DomainTheory/Neighborhood/Exercise418.lean index bb83c67506..c074f21aa3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise418.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise418.lean @@ -44,7 +44,7 @@ exactly as Example 4.3's **choice-free**. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise418 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise419.lean b/LeanPool/DomainTheory/Neighborhood/Exercise419.lean index 99553e5bba..09fa12abfa 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise419.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise419.lean @@ -64,7 +64,7 @@ structurally from `T` (Example 1.2), exactly as `Example23.parityMap` and `Example43.zeroMap` do. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise419 @@ -125,7 +125,7 @@ variable {β : Type*} With `z = ⊥` this is the value at the *partial* element `σ⊥`; with `z = vΛ` the value at the *total* element `σ`. -/ -def headValC (V : NeighborhoodSystem β) (z a0 a1 : V.Element) : Str → V.Element +@[expose] def headValC (V : NeighborhoodSystem β) (z a0 a1 : V.Element) : Str → V.Element | [] => z | false :: _ => a0 | true :: _ => a1 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise420.lean b/LeanPool/DomainTheory/Neighborhood/Exercise420.lean index aad40d4895..b8bde0121f 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise420.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise420.lean @@ -36,7 +36,7 @@ whole file is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise421.lean b/LeanPool/DomainTheory/Neighborhood/Exercise421.lean index bcbf08e1a5..b4a4259897 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise421.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise421.lean @@ -57,7 +57,7 @@ All set-level constructions are **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise421 @@ -178,7 +178,7 @@ def addIso (m : ℕ) : ℕ ≃ {k : ℕ // k ∈ upSet m} where simp_all /-- The isomorphism is given by addition: `addIso m n = m + n`. -/ -theorem addIso_apply (m n : ℕ) : (addIso m n : ℕ) = m + n := rfl +theorem addIso_apply (m n : ℕ) : (addIso m n : ℕ) = m + n := by rfl /-- The isomorphism sends `0` to the distinguished element `m` of `[m]`. -/ theorem addIso_zero (m : ℕ) : (addIso m 0 : ℕ) = m := by simp [addIso] diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise422.lean b/LeanPool/DomainTheory/Neighborhood/Exercise422.lean index e667fdb2fa..b6337f1bf3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise422.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise422.lean @@ -51,7 +51,7 @@ existence statement live over `Classical.choice` exactly as Theorem 4.6's bijection does. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise422 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise423.lean b/LeanPool/DomainTheory/Neighborhood/Exercise423.lean index ef121a5b03..977c6d07ad 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise423.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise423.lean @@ -56,7 +56,7 @@ The argument uses only the project's permitted element-extensionality through `Theorem41`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise424.lean b/LeanPool/DomainTheory/Neighborhood/Exercise424.lean index 149c98109d..3878c9e80e 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise424.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise424.lean @@ -48,7 +48,7 @@ inherently classical; the construction of `h` uses `Classical.choice` (the the statement demands. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise424 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise425.lean b/LeanPool/DomainTheory/Neighborhood/Exercise425.lean index 2fdc6f38a4..94ad9364f3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise425.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise425.lean @@ -59,7 +59,7 @@ The data (`C₁`, `consMap`, `relateNToC1`) is **choice-free** (`#print axioms Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise425 @@ -148,7 +148,7 @@ def C1 : NeighborhoodSystem ℕ := @[simp] theorem C1_mem {X : Set ℕ} : C1.mem X ↔ memC1 X := Iff.rfl -@[simp] theorem C1_master : C1.master = (Set.univ : Set ℕ) := rfl +@[simp] theorem C1_master : C1.master = (Set.univ : Set ℕ) := by rfl /-! ### Elements: `1ⁿ` (total) and `1ⁿ⊥` (partial). -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise507.lean b/LeanPool/DomainTheory/Neighborhood/Exercise507.lean index a4ec940d85..52dd33d152 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise507.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise507.lean @@ -57,7 +57,7 @@ No new axioms are introduced beyond the project's `Element.ext` / already used by `curry`/`uncurry`. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise507 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise508.lean b/LeanPool/DomainTheory/Neighborhood/Exercise508.lean index e11ceaa94c..e37046bf14 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise508.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise508.lean @@ -81,7 +81,7 @@ Everything is **data**; the combinators are built from `idMap`, `curry`, `proj`, choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise508 @@ -164,6 +164,7 @@ structure Dom where and its system is the function space `funSpace A.sys B.sys`. -/ +@[expose] def Dom.arrow (A B : Dom) : Dom := ⟨ApproximableMap A.sys B.sys, funSpace A.sys B.sys⟩ attribute [local implicit_reducible] Dom.arrow diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise509.lean b/LeanPool/DomainTheory/Neighborhood/Exercise509.lean index 218c79fa3d..92f7e541f5 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise509.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise509.lean @@ -46,7 +46,7 @@ leastness. All maps and elements are choice-free; the equalities use only the order on `|𝒟|`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise510.lean b/LeanPool/DomainTheory/Neighborhood/Exercise510.lean index 5a892c8579..ab10d547fb 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise510.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise510.lean @@ -76,7 +76,7 @@ enters only the `smashCurryEquiv` *proof*, through the genuinely-classical `X = boundary case analysis. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise510 @@ -164,7 +164,7 @@ def smash (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : Neighb · exact prodNbhd_subset_iff.mpr ⟨V₀.sub_master hX, V₁.sub_master hY⟩ @[simp] theorem smash_master : - (smash V₀ V₁).master = prodNbhd V₀.master V₁.master := rfl + (smash V₀ V₁).master = prodNbhd V₀.master V₁.master := by rfl theorem smash_mem_iff {W : Set (α ⊕ β)} : (smash V₀ V₁).mem W ↔ @@ -323,7 +323,7 @@ Theorem 3.10. -/ input only to the master output. -/ -def IsStrict (f : ApproximableMap V₀ V₁) : Prop := +@[expose] def IsStrict (f : ApproximableMap V₀ V₁) : Prop := ∀ ⦃Y⦄, f.rel V₀.master Y → Y = V₁.master /-- Strictness is exactly `f(⊥) = ⊥`. -/ @@ -364,13 +364,13 @@ abbrev StrictMap (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : {f : ApproximableMap V₀ V₁ // IsStrict f} /-- A step set among strict maps: `[X, Y] = {f strict ∣ X f Y}`. -/ -def sstep (X : Set α) (Y : Set β) : Set (StrictMap V₀ V₁) := {f | f.1.rel X Y} +@[expose] def sstep (X : Set α) (Y : Set β) : Set (StrictMap V₀ V₁) := {f | f.1.rel X Y} @[simp] theorem mem_sstep {X : Set α} {Y : Set β} {f : StrictMap V₀ V₁} : f ∈ sstep X Y ↔ f.1.rel X Y := Iff.rfl /-- A finite intersection of strict step sets. -/ -def sstepFun (L : List (Set α × Set β)) : Set (StrictMap V₀ V₁) := +@[expose] def sstepFun (L : List (Set α × Set β)) : Set (StrictMap V₀ V₁) := {f | ∀ p ∈ L, f.1.rel p.1 p.2} @[simp] theorem mem_sstepFun {L : List (Set α × Set β)} {f : StrictMap V₀ V₁} : @@ -421,7 +421,7 @@ theorem sstep_subset {X X' : Set α} {Y Y' : Set β} (hX' : V₀.mem X') (hY' : /-- **Exercise 5.10 — the strict function space `(𝒟₀ →⊥ 𝒟₁)`.** Tokens are the strict approximable maps; neighbourhoods are non-empty finite intersections of step sets. -/ -def strictFun (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : +@[expose] def strictFun (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : NeighborhoodSystem (StrictMap V₀ V₁) where mem W := (∃ L : List (Set α × Set β), (∀ p ∈ L, V₀.mem p.1 ∧ V₁.mem p.2) ∧ W = sstepFun L) ∧ W.Nonempty @@ -437,7 +437,7 @@ def strictFun (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : · exact hL' p h sub_master := fun _ => Set.subset_univ _ -@[simp] theorem strictFun_master : (strictFun V₀ V₁).master = Set.univ := rfl +@[simp] theorem strictFun_master : (strictFun V₀ V₁).master = Set.univ := by rfl theorem strictFun_mem_iff {W : Set (StrictMap V₀ V₁)} : (strictFun V₀ V₁).mem W ↔ @@ -505,6 +505,7 @@ theorem mem_sstepFun_iff (φ : (strictFun V₀ V₁).Element) {L : List (Set α because the step `[Δ₀, Y]` with `Y ≠ Δ₁` is empty (no strict map relates `Δ₀` to a proper output), hence not a neighbourhood, so it cannot belong to `φ`. -/ +@[expose] def toStrictMap (φ : (strictFun V₀ V₁).Element) : StrictMap V₀ V₁ := ⟨{ rel := fun X Y => φ.mem (sstep X Y) rel_dom := by intro X Y h; obtain ⟨f, hf⟩ := (φ.sub h).2; exact f.1.rel_dom hf @@ -535,7 +536,7 @@ def toStrictMap (φ : (strictFun V₀ V₁).Element) : StrictMap V₀ V₁ := (toStrictMap φ).1.rel X Y ↔ φ.mem (sstep X Y) := Iff.rfl /-- **The filter `f̂ = {F ∣ f ∈ F}` of a strict map.** -/ -def toStrictFilter (f : StrictMap V₀ V₁) : (strictFun V₀ V₁).Element where +@[expose] def toStrictFilter (f : StrictMap V₀ V₁) : (strictFun V₀ V₁).Element where mem W := (strictFun V₀ V₁).mem W ∧ f ∈ W sub h := h.1 master_mem := ⟨(strictFun V₀ V₁).master_mem, Set.mem_univ f⟩ @@ -550,6 +551,7 @@ def toStrictFilter (f : StrictMap V₀ V₁) : (strictFun V₀ V₁).Element whe /-- **Exercise 5.10 — the strict function space is complete.** `|𝒟₀ →⊥ 𝒟₁|` is order-isomorphic to the strict approximable maps `𝒟₀ → 𝒟₁`. -/ +@[expose] def strictFunEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : (strictFun V₀ V₁).Element ≃o StrictMap V₀ V₁ where toFun := toStrictMap diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise511.lean b/LeanPool/DomainTheory/Neighborhood/Exercise511.lean index 6a499e121b..18a9756a27 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise511.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise511.lean @@ -56,7 +56,7 @@ the project's `Element.ext` machinery. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise511 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise512.lean b/LeanPool/DomainTheory/Neighborhood/Exercise512.lean index 05d75cb174..7f71b045b6 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise512.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise512.lean @@ -62,7 +62,7 @@ Everything is choice-free in spirit; the only classical input is inherited from (Example 1.2) and the project's `Element.ext` / `ext_of_toElementMap` machinery. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise512 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise513.lean b/LeanPool/DomainTheory/Neighborhood/Exercise513.lean index 9d353890fa..229e945897 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise513.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise513.lean @@ -76,13 +76,14 @@ Everything (including `numEquiv` and the order-isomorphisms) is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise513 /-! ### Triangular numbers -/ /-- The `k`-th triangular number `T(k) = k(k+1)/2`. -/ +@[expose] def tri (k : ℕ) : ℕ := k * (k + 1) / 2 /-- `k(k+1)` is even (choice-free, by induction). -/ @@ -124,10 +125,10 @@ theorem tri_mono {a b : ℕ} (h : a ≤ b) : tri a ≤ tri b := by /-- The pairing function `num n m = (n+m)(n+m+1)/2 + m` (Cantor's diagonal enumeration). -/ -def num (n m : ℕ) : ℕ := tri (n + m) + m +@[expose] def num (n m : ℕ) : ℕ := tri (n + m) + m /-- Its uncurried form, the actual `N × N → N` of the exercise. -/ -def numP (p : ℕ × ℕ) : ℕ := num p.1 p.2 +@[expose] def numP (p : ℕ × ℕ) : ℕ := num p.1 p.2 theorem num_zero_zero : num 0 0 = 0 := rfl @@ -210,7 +211,7 @@ def numEquiv : ℕ × ℕ ≃ ℕ where left_inv := unnum_numP right_inv := numP_unnum -@[simp] theorem numEquiv_apply (p : ℕ × ℕ) : numEquiv p = num p.1 p.2 := rfl +@[simp] theorem numEquiv_apply (p : ℕ × ℕ) : numEquiv p = num p.1 p.2 := by rfl /-! ### The domain isomorphisms diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise514.lean b/LeanPool/DomainTheory/Neighborhood/Exercise514.lean index 05fcbd151b..c2fd4915a9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise514.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise514.lean @@ -63,7 +63,7 @@ continuous maps. Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise514 @@ -84,6 +84,7 @@ theorem num_succ_left_gt (n b : ℕ) : b < num (n + 1) b := by /-- `tag [n₀, …, n_{k-1}] m = [n₀+1, …, n_{k-1}+1, 0, m]`, built from the pairing function `num`. -/ +@[expose] def tag : List ℕ → ℕ → ℕ | [], m => num 0 m | (n :: ns), m => num (n + 1) (tag ns m) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise515.lean b/LeanPool/DomainTheory/Neighborhood/Exercise515.lean index b7a8d3cbe6..f9b5cb0716 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise515.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise515.lean @@ -52,7 +52,7 @@ recursion (`kpow`) rather than `⋃ₙ zⁿ`, and phrase Arden's lemma without everything **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise515 @@ -97,6 +97,7 @@ theorem smul_union (a b c : Set S) : a * (b ∪ c) = a * b ∪ a * c := by /-! ### The star `z* = ⋃ₙ zⁿ`, by explicit recursion -/ /-- `zⁿ` as an iterated pointwise product (left-recursion `z^{n+1} = z·zⁿ`). -/ +@[expose] def kpow (z : Set S) : ℕ → Set S | 0 => 1 | n + 1 => z * kpow z n diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise516.lean b/LeanPool/DomainTheory/Neighborhood/Exercise516.lean index c5e0b9cb6d..7adb5b2c8d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise516.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise516.lean @@ -65,7 +65,7 @@ overlap-freeness) are real combinatorics-on-words and are left as a separate follow-up. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise516 @@ -89,7 +89,7 @@ theorem flip_flip (σ : Str) : flip (flip σ) = σ := by theorem flip_prefix {σ τ : Str} (h : σ <+: τ) : flip σ <+: flip τ := h.map _ /-- Double every bit of a finite string: `double (b :: σ) = b :: b :: double σ`. -/ -def double : Str → Str +@[expose] def double : Str → Str | [] => [] | b :: σ => b :: b :: double σ @@ -289,7 +289,7 @@ the partial order between them (`SLe`), and the interleaving value function /-- The neighbourhood of the tagged string `(b, σ)`: `{σ}` if total, `cone σ` if partial. -/ -def shape : Bool → Str → Set Str +@[expose] def shape : Bool → Str → Set Str | true, σ => {σ} | false, σ => cone σ @@ -299,7 +299,7 @@ theorem memC_shape : ∀ (b : Bool) (σ : Str), memC (shape b σ) /-- The element of the tagged string `(b, σ)`: total `σ` if `b`, partial `σ⊥` otherwise. -/ -def shapeElem (b : Bool) (σ : Str) : C.Element := C.principal (memC_shape b σ) +@[expose] def shapeElem (b : Bool) (σ : Str) : C.Element := C.principal (memC_shape b σ) @[simp] theorem shapeElem_true (σ : Str) : shapeElem true σ = strElem σ := rfl @[simp] theorem shapeElem_false (σ : Str) : shapeElem false σ = strBot σ := rfl @@ -330,7 +330,7 @@ of the tagged strings `(b₀, σ)` and `(b₁, τ)` as a tagged string. Boundary convention (the only monotone one): `merge(Λ, y) = Λ`, `merge(⊥, y) = ⊥`, and `merge(εx, y) = ε⊥` once `y` runs out. -/ -def mergeVal : Str → Bool → Str → Bool → Str × Bool +@[expose] def mergeVal : Str → Bool → Str → Bool → Str × Bool | [], b₀, _, _ => ([], b₀) | a :: _, _, [], _ => ([a], false) | a :: σ, b₀, b :: τ, b₁ => (a :: b :: (mergeVal σ b₀ τ b₁).1, (mergeVal σ b₀ τ b₁).2) @@ -344,7 +344,7 @@ def mergeVal : Str → Bool → Str → Bool → Str × Bool (a :: b :: (mergeVal σ b₀ τ b₁).1, (mergeVal σ b₀ τ b₁).2) := rfl /-- The element produced by interleaving `(b₀, σ)` and `(b₁, τ)`. -/ -def mergeElem (σ : Str) (b₀ : Bool) (τ : Str) (b₁ : Bool) : C.Element := +@[expose] def mergeElem (σ : Str) (b₀ : Bool) (τ : Str) (b₁ : Bool) : C.Element := shapeElem (mergeVal σ b₀ τ b₁).2 (mergeVal σ b₀ τ b₁).1 /-! #### The monotonicity of `mergeVal` (the crux of approximability). -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise516Overlap.lean b/LeanPool/DomainTheory/Neighborhood/Exercise516Overlap.lean index 2c1c225d95..81e4e0a626 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise516Overlap.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise516Overlap.lean @@ -45,7 +45,7 @@ period `≥ 5` forces a run of three equal symbols. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise516 diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise516ThueMorse.lean b/LeanPool/DomainTheory/Neighborhood/Exercise516ThueMorse.lean index 456dda2429..ee97e70c2a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise516ThueMorse.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise516ThueMorse.lean @@ -64,7 +64,7 @@ word-combinatorics theorem and lives in its own module. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise516 @@ -74,7 +74,7 @@ open Domain.Neighborhood NeighborhoodSystem ApproximableMap ExampleB Example44 E /-- The Thue–Morse substitution applied letterwise: each bit `b` is replaced by `b (¬b)`. -/ -def expand : Str → Str +@[expose] def expand : Str → Str | [] => [] | b :: σ => b :: (!b) :: expand σ @@ -204,7 +204,7 @@ theorem tm_two_mul_add_one (n : ℕ) : tm (2 * n + 1) = !tm n := by simp only [tm, Nat.bit1_bits n, List.foldr_cons, Bool.true_xor] /-- The length-`n` Thue–Morse prefix `[tm 0, tm 1, …, tm (n-1)]`. -/ -def tmList (n : ℕ) : Str := (List.range n).map tm +@[expose] def tmList (n : ℕ) : Str := (List.range n).map tm @[simp] theorem tmList_zero : tmList 0 = [] := rfl diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise617.lean b/LeanPool/DomainTheory/Neighborhood/Exercise617.lean index c7920df486..3ff93c5a8c 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise617.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise617.lean @@ -82,7 +82,7 @@ reuses the project's established machinery. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -145,7 +145,7 @@ genuine three-way separated sum `𝟙 + D + D` (Example 6.2's `sum3`, with `𝟙 = unitSys`), again `∅`-free by `sum3_nonempty`. -/ -def tcObj (D : StrictDomainObj.{w}) : StrictDomainObj.{w} where +@[expose] def tcObj (D : StrictDomainObj.{w}) : StrictDomainObj.{w} where carrier := Option (Unit ⊕ D.carrier ⊕ D.carrier) sys := sum3 unitSys D.sys D.sys Example62C.unitSys_nonempty D.nonempty D.nonempty nonempty := sum3_nonempty @@ -677,7 +677,7 @@ open Example62C in /-- The morphism action of `T`: `T(f) = I_𝟙 + f + f` (identity on the terminator, `f` on each successor copy). Always strict (`isStrict_sumMap3`). -/ -def tcMapHom {D E : StrictDomainObj.{w}} (f : Category.Hom D E) : +@[expose] def tcMapHom {D E : StrictDomainObj.{w}} (f : Category.Hom D E) : Category.Hom (tcObj D) (tcObj E) := ⟨sumMap3 (h₀ := Example62C.unitSys_nonempty) (h₁ := D.nonempty) (h₂ := D.nonempty) (h₀' := Example62C.unitSys_nonempty) (h₁' := E.nonempty) (h₂' := E.nonempty) @@ -689,7 +689,7 @@ domains and strict maps. On objects, `T(D) = 𝟙 + D + D` (Example 6.2's three-way sum); on maps, `T(f) = I_𝟙 + f + f`. -/ -def Tc : Endofunctor StrictDomainObj.{w} where +@[expose] def Tc : Endofunctor StrictDomainObj.{w} where obj := tcObj map := tcMapHom map_id D := Subtype.ext (by @@ -724,7 +724,7 @@ theorem isStrict_ofIso {α β : Type*} {V₀ : NeighborhoodSystem α} {V₁ : Ne open Example44 Example62C ExampleB in /-- `C` (Example 4.4: finite-or-infinite binary sequences) as an object of the `∅`-free category. -/ -def Cobj : StrictDomainObj.{0} := ⟨Str, C, C_nonempty⟩ +@[expose] def Cobj : StrictDomainObj.{0} := ⟨Str, C, C_nonempty⟩ open Example44 Example62C in /-- **The `T`-algebra structure on `C`.** `(tcObj Cobj).sys = 𝟙 + C + C` @@ -735,7 +735,7 @@ domain-equation isomorphism `ccEquiv` (Example 6.2), realised as an approximable map by `ofIso`; it is strict by `isStrict_ofIso`. Concretely `i` sends the terminator to `Λ̂` and each `b`-copy of `x` to `b·x`. -/ -def cStr : Category.Hom (Tc.obj Cobj) Cobj := +@[expose] def cStr : Category.Hom (Tc.obj Cobj) Cobj := ⟨ofIso (by exact ccEquiv.symm), isStrict_ofIso _⟩ open Example44 Example62C in @@ -859,7 +859,7 @@ def descE : B.carrier.sys.Element := /-- The `b`-th successor operation `f_b = k ∘ inj_b`: `f₀` via the `0`-copy (`inj₁`), `f₁` via the `1`-copy (`inj₂`). -/ -def descF (b : Bool) (y : B.carrier.sys.Element) : B.carrier.sys.Element := +@[expose] def descF (b : Bool) (y : B.carrier.sys.Element) : B.carrier.sys.Element := B.str.1.toElementMap (cond b (sinj2 (h₀ := Example62C.unitSys_nonempty) (h₁ := B.carrier.nonempty) ( h₂ := B.carrier.nonempty) y) @@ -868,7 +868,7 @@ def descF (b : Bool) (y : B.carrier.sys.Element) : B.carrier.sys.Element := /-- The recursion `φ(Λ)=z`, `φ(b·σ)=f_b(φ(σ))` on a finite string, with base value `z`. -/ -def descVal (z : B.carrier.sys.Element) : Str → B.carrier.sys.Element +@[expose] def descVal (z : B.carrier.sys.Element) : Str → B.carrier.sys.Element | [] => z | b :: σ => descF B b (descVal z σ) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise617Gen.lean b/LeanPool/DomainTheory/Neighborhood/Exercise617Gen.lean index cda2a834ee..b8d6cffd4d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise617Gen.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise617Gen.lean @@ -43,7 +43,7 @@ and the data (`Cn`, `consMapN`) stays choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Exercise617Gen @@ -90,7 +90,7 @@ theorem coneN_trichotomy (σ τ : Strn A) : · exact hτσ h)) /-- Membership in `Cₐ`: a cone `σA*` or a singleton `{σ}`. -/ -def memCn (X : Set (Strn A)) : Prop := (∃ σ, X = coneN σ) ∨ (∃ σ, X = {σ}) +@[expose] def memCn (X : Set (Strn A)) : Prop := (∃ σ, X = coneN σ) ∨ (∃ σ, X = {σ}) omit [DecidableEq A] in theorem memCn_coneN (σ : Strn A) : memCn (coneN σ) := Or.inl ⟨σ, rfl⟩ @@ -126,7 +126,7 @@ theorem nestedOrDisjointN : NestedOrDisjoint (memCn (A := A)) := by · simp_all /-- **The generic domain `Cₐ`** of finite-or-infinite `A`-sequences. -/ -def Cn (A : Type) : NeighborhoodSystem (Strn A) := +@[expose] def Cn (A : Type) : NeighborhoodSystem (Strn A) := NeighborhoodSystem.ofNestedOrDisjoint memCn Set.univ (Or.inl ⟨[], coneN_nil.symm⟩) nestedOrDisjointN (fun _ => Set.subset_univ _) @@ -361,7 +361,7 @@ theorem jc_eq_jc {a a' : A} {X X' : Set β} (hXne : X.Nonempty) variable (V : NeighborhoodSystem β) /-- The master neighbourhood `{Λ} ∪ {tu} ∪ ⋃_a aΔ`. -/ -def masterSig : Set (SigTok A β) := +@[expose] def masterSig : Set (SigTok A β) := {w | w = none ∨ w = tu ∨ ∃ a t, t ∈ V.master ∧ w = tc a t} variable {V} @@ -400,7 +400,7 @@ under the standing assumption that no neighbourhood of `V` is empty. The alphabet-generic analogue of `sum3 unitSys V V` (Example 6.2). -/ -def sumSig (A : Type) [DecidableEq A] (V : NeighborhoodSystem β) +@[expose] def sumSig (A : Type) [DecidableEq A] (V : NeighborhoodSystem β) (h : ∀ X, V.mem X → X.Nonempty) : NeighborhoodSystem (SigTok A β) where mem W := W = masterSig V ∨ W = jU ∨ ∃ a X, V.mem X ∧ W = jc a X @@ -756,6 +756,7 @@ end SumMapSig /-! ## The endofunctor `Tsig(X) = 𝟙 + Σ_a X` on the `∅`-free category. -/ /-- `Tsig` on objects: `Tsig(D) = 𝟙 + Σ_a D`, again `∅`-free (`sumSig_nonempty`). -/ +@[expose] def tsigObj (A : Type) [DecidableEq A] (D : StrictDomainObj.{0}) : StrictDomainObj.{0} where carrier := SigTok A D.carrier sys := sumSig A D.sys D.nonempty @@ -766,6 +767,7 @@ attribute [local implicit_reducible] tsigObj (tsigObj A D).sys = sumSig A D.sys D.nonempty := rfl /-- `Tsig` on maps: `Tsig(f) = I_𝟙 + Σ_a f`, strict by `isStrict_sumMapSig`. -/ +@[expose] def tsigMapHom (A : Type) [DecidableEq A] {D E : StrictDomainObj.{0}} (f : Category.Hom D E) : Category.Hom (tsigObj A D) (tsigObj A E) := ⟨sumMapSig (A := A) (h₀ := D.nonempty) (h₁ := E.nonempty) f.1, isStrict_sumMapSig _⟩ @@ -777,7 +779,7 @@ def tsigMapHom (A : Type) [DecidableEq A] {D E : StrictDomainObj.{0}} (f : Categ /-- **The functor `Tsig(X) = 𝟙 + Σ_{a:A} X`** on the category of `∅`-free domains and strict maps. -/ -def Tsig (A : Type) [DecidableEq A] : Endofunctor StrictDomainObj.{0} where +@[expose] def Tsig (A : Type) [DecidableEq A] : Endofunctor StrictDomainObj.{0} where obj := tsigObj A map := tsigMapHom A map_id _D := Subtype.ext sumMapSig_id @@ -939,7 +941,7 @@ theorem sumSig_mem_jc_inv {a : A} {X : Set (Strn A)} (h : (CCn A).mem (jc a X)) /-- **Forward half of `Cₐ ≅ 𝟙 + Σ_a Cₐ`.** Records, for each branch, whether `x` finishes at `Λ` (the `𝟙`-summand) or reaches the `a`-copy `aX` (the `a`-th summand). -/ -def toCC (x : (Cn A).Element) : (CCn A).Element where +@[expose] def toCC (x : (Cn A).Element) : (CCn A).Element where mem W := W = masterSig (Cn A) ∨ (W = jU ∧ x.mem ({[]} : Set (Strn A))) ∨ (∃ a X, (Cn A).mem X ∧ W = jc a X ∧ x.mem (embA a X)) @@ -1130,7 +1132,7 @@ theorem toCC_fromCC (s : (CCn A).Element) : toCC (fromCC s) = s := by · exact Or.inr (Or.inr ⟨a, X, hX, rfl, (fromCC_mem_embA hX).mpr hW⟩) /-- **The isomorphism `|Cₐ| ≃o |𝟙 + Σ_a Cₐ|`.** -/ -def ccEquiv : (Cn A).Element ≃o (CCn A).Element where +@[expose] def ccEquiv : (Cn A).Element ≃o (CCn A).Element where toFun := toCC invFun := fromCC left_inv := fromCC_toCC @@ -1225,7 +1227,7 @@ section Algebra variable {A : Type} [DecidableEq A] [Inhabited A] /-- `Cₐ` as an object of the `∅`-free category. -/ -def Cnobj (A : Type) : StrictDomainObj.{0} := ⟨Strn A, Cn A, Cn_nonempty⟩ +@[expose] def Cnobj (A : Type) : StrictDomainObj.{0} := ⟨Strn A, Cn A, Cn_nonempty⟩ @[simp] theorem Cnobj_sys (A : Type) : (Cnobj A).sys = Cn A := rfl diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise618.lean b/LeanPool/DomainTheory/Neighborhood/Exercise618.lean index 196f58284c..085b8d1bd9 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise618.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise618.lean @@ -71,7 +71,7 @@ T(ρₙ) ∘ j`, Everything is choice-free where it is data. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -114,7 +114,7 @@ theorem iterProdIso_apply (z : (iterSys V).Element) : /-- The "cons" of a head `a : |𝒟|` and a tail `b : |𝒟^∞|`, as a sequence `⟨a, b₀, b₁, …⟩`. -/ -def consSeq (a : V.Element) (b : (iterSys V).Element) : ℕ → V.Element := +@[expose] def consSeq (a : V.Element) (b : (iterSys V).Element) : ℕ → V.Element := fun i => Nat.casesOn i a (fun k => component b k) @[simp] theorem consSeq_zero (a : V.Element) (b : (iterSys V).Element) : consSeq a b 0 = a := rfl @@ -527,12 +527,13 @@ theorem isStrict_prodMap {α β α' β' : Type*} {V₀ : NeighborhoodSystem α} exact pair_bot /-- The fixed domain `𝒟` times an object `X`, again an `∅`-free domain. -/ -def prodObj (Dom X : StrictDomainObj.{w}) : StrictDomainObj.{w} where +@[expose] def prodObj (Dom X : StrictDomainObj.{w}) : StrictDomainObj.{w} where carrier := Dom.carrier ⊕ X.carrier sys := prod Dom.sys X.sys nonempty := prod_nonempty Dom.nonempty X.nonempty /-- The morphism action `T(f) = id_𝒟 × f`, strict by `isStrict_prodMap`. -/ +@[expose] def prodMapHom (Dom : StrictDomainObj.{w}) {X Y : StrictDomainObj.{w}} (f : Category.Hom X Y) : Category.Hom (prodObj Dom X) (prodObj Dom Y) := ⟨prodMap (idMap Dom.sys) f.1, isStrict_prodMap isStrict_idMap f.2⟩ @@ -540,7 +541,7 @@ def prodMapHom (Dom : StrictDomainObj.{w}) {X Y : StrictDomainObj.{w}} (f : Cate /-- **The product endofunctor `T(X) = 𝒟 × X`** on `∅`-free domains and strict maps, for a fixed domain `𝒟`. On objects `T(X) = 𝒟 × X`; on maps `T(f) = id_𝒟 × f`. -/ -def prodFunctor (Dom : StrictDomainObj.{w}) : Endofunctor StrictDomainObj.{w} where +@[expose] def prodFunctor (Dom : StrictDomainObj.{w}) : Endofunctor StrictDomainObj.{w} where obj := prodObj Dom map := prodMapHom Dom map_id X := Subtype.ext (by @@ -554,7 +555,7 @@ def prodFunctor (Dom : StrictDomainObj.{w}) : Endofunctor StrictDomainObj.{w} wh exact h) /-- `𝒟^∞` (Exercise 3.16's `iterSys`) as an `∅`-free object. -/ -def iterObj (Dom : StrictDomainObj.{w}) : StrictDomainObj.{w} where +@[expose] def iterObj (Dom : StrictDomainObj.{w}) : StrictDomainObj.{w} where carrier := ℕ × Dom.carrier sys := iterSys Dom.sys nonempty := iterSys_nonempty Dom.nonempty @@ -562,14 +563,14 @@ def iterObj (Dom : StrictDomainObj.{w}) : StrictDomainObj.{w} where /-- **`𝒟^∞` as a `T`-algebra**, `(𝒟^∞, i)` with `i : 𝒟 × 𝒟^∞ → 𝒟^∞` the "cons" iso (`imap`, Exercise 3.16's `iterProdIso⁻¹`), strict by `isStrict_imap`. -/ -def iterAlg (Dom : StrictDomainObj.{w}) : TAlgebra (prodFunctor Dom) where +@[expose] def iterAlg (Dom : StrictDomainObj.{w}) : TAlgebra (prodFunctor Dom) where carrier := iterObj Dom str := ⟨imap Dom.sys, isStrict_imap⟩ /-- **The descent homomorphism `(𝒟^∞, i) → (E, k)`**: the strict map `descMap k` (existence half), with the homomorphism square supplied by `descMap_comm`. -/ -def descAlgHom (Dom : StrictDomainObj.{w}) (B : TAlgebra (prodFunctor Dom)) : +@[expose] def descAlgHom (Dom : StrictDomainObj.{w}) (B : TAlgebra (prodFunctor Dom)) : AlgHom (iterAlg Dom) B where hom := ⟨descMap B.str.1, descMap_strict B.str.1 B.str.2⟩ comm := by diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise619.lean b/LeanPool/DomainTheory/Neighborhood/Exercise619.lean index 1487f7a3c8..751b3efcc3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise619.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise619.lean @@ -55,7 +55,7 @@ continuous on maps, monotone and continuous on domains) is **Part B**, deferred. Everything here is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -72,7 +72,7 @@ variable {D₀ D₁ : NeighborhoodSystem Str} `1Y = embBit true Y`. -/ /-- The master neighbourhood `{Λ} ∪ 0Δ₀ ∪ 1Δ₁` of the concrete sum. -/ -def sumTokMaster (D₀ D₁ : NeighborhoodSystem Str) : Set Str := +@[expose] def sumTokMaster (D₀ D₁ : NeighborhoodSystem Str) : Set Str := insert [] (embBit false D₀.master ∪ embBit true D₁.master) theorem nil_mem_sumTokMaster : ([] : Str) ∈ sumTokMaster D₀ D₁ := Set.mem_insert _ _ @@ -107,6 +107,7 @@ master `{Λ} ∪ 0Δ₀ ∪ 1Δ₁`, a left copy `0X` (`X ∈ 𝒟₀`), or a ri assumption `∅ ∉ 𝒟ᵢ` (`h₀`, `h₁`) makes the two tagged copies disjoint, so the system is closed under consistent intersection. -/ +@[expose] def sumTok (D₀ D₁ : NeighborhoodSystem Str) (h₀ : ∀ X, D₀.mem X → X.Nonempty) (h₁ : ∀ Y, D₁.mem Y → Y.Nonempty) : NeighborhoodSystem Str where @@ -434,6 +435,7 @@ the basepoint, in contrast to the sum (where a proper neighbourhood refines exactly one summand). -/ /-- A product neighbourhood `{Λ} ∪ 0X ∪ 1Y` over `{0,1}*`. -/ +@[expose] def prodTokNbhd (X Y : Set Str) : Set Str := insert [] (embBit false X ∪ embBit true Y) @[simp] theorem mem_prodTokNbhd_nil {X Y : Set Str} : ([] : Str) ∈ prodTokNbhd X Y := @@ -450,7 +452,7 @@ def prodTokNbhd (X Y : Set Str) : Set Str := insert [] (embBit false X ∪ embBi simp_all /-- `prodTokNbhd D₀.master D₁.master` is exactly the sum master `{Λ} ∪ 0Δ₀ ∪ 1Δ₁`. -/ -theorem prodTokNbhd_master_eq : prodTokNbhd D₀.master D₁.master = sumTokMaster D₀ D₁ := rfl +theorem prodTokNbhd_master_eq : prodTokNbhd D₀.master D₁.master = sumTokMaster D₀ D₁ := by rfl /-- Scott's (2) for the product: product neighbourhoods intersect componentwise. -/ theorem prodTokNbhd_inter (X X' Y Y' : Set Str) : @@ -489,6 +491,7 @@ Neighbourhoods are `{Λ} ∪ 0X ∪ 1Y` with `X ∈ 𝒟₀`, `Y ∈ 𝒟₁`. Closed under consistent intersection by Scott's (1)/(2) together with the factors' closure. -/ +@[expose] def prodTok (D₀ D₁ : NeighborhoodSystem Str) : NeighborhoodSystem Str where mem W := ∃ X Y, D₀.mem X ∧ D₁.mem Y ∧ W = prodTokNbhd X Y master := prodTokNbhd D₀.master D₁.master @@ -508,7 +511,7 @@ def prodTok (D₀ D₁ : NeighborhoodSystem Str) : NeighborhoodSystem Str where theorem prodTok_mem_prodTokNbhd {X Y : Set Str} (hX : D₀.mem X) (hY : D₁.mem Y) : (prodTok D₀ D₁).mem (prodTokNbhd X Y) := ⟨X, Y, hX, hY, rfl⟩ -@[simp] theorem prodTok_master : (prodTok D₀ D₁).master = prodTokNbhd D₀.master D₁.master := rfl +@[simp] theorem prodTok_master : (prodTok D₀ D₁).master = prodTokNbhd D₀.master D₁.master := by rfl /-- The concrete product is again `∅`-free (every neighbourhood contains `Λ`). -/ theorem prodTok_nonempty : ∀ W, (prodTok D₀ D₁).mem W → W.Nonempty := by diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise619PartB.lean b/LeanPool/DomainTheory/Neighborhood/Exercise619PartB.lean index 456276b5d3..15202dbe03 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise619PartB.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise619PartB.lean @@ -94,7 +94,7 @@ needs. Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -117,12 +117,12 @@ structure ScottSys where /-- The **sum object** `𝒟₀ + 𝒟₁` of Part A, repackaged as an object of the category. -/ -def ScottSys.sum (A₀ A₁ : ScottSys) : ScottSys := +@[expose] def ScottSys.sum (A₀ A₁ : ScottSys) : ScottSys := ⟨sumTok A₀.sys A₁.sys A₀.ne A₁.ne, sumTok_nonempty⟩ /-- The **product object** `𝒟₀ × 𝒟₁` of Part A, repackaged as an object of the category. -/ -def ScottSys.prod (A₀ A₁ : ScottSys) : ScottSys := +@[expose] def ScottSys.prod (A₀ A₁ : ScottSys) : ScottSys := ⟨prodTok A₀.sys A₁.sys, prodTok_nonempty⟩ variable {A₀ A₁ B₀ B₁ C₀ C₁ : ScottSys} @@ -143,7 +143,7 @@ to the master (so it is strict), a left copy `0X` to `0X'` whenever `X f₀ X'`, and a right copy `1Y` to `1Y'` whenever `Y f₁ Y'`. -/ -def sumMapTok (f₀ : ApproximableMap A₀.sys B₀.sys) (f₁ : ApproximableMap A₁.sys B₁.sys) : +@[expose] def sumMapTok (f₀ : ApproximableMap A₀.sys B₀.sys) (f₁ : ApproximableMap A₁.sys B₁.sys) : ApproximableMap (A₀.sum A₁).sys (B₀.sum B₁).sys where rel W W' := ((sumTok A₀.sys A₁.sys A₀.ne A₁.ne).mem W ∧ W' = sumTokMaster B₀.sys B₁.sys) ∨ @@ -225,7 +225,7 @@ theorem sumMapTok_isStrict (f₀ : ApproximableMap A₀.sys B₀.sys) product neighbourhood `{Λ} ∪ 0X ∪ 1Y` is sent to `{Λ} ∪ 0X' ∪ 1Y'` whenever `X f₀ X'` and `Y f₁ Y'`. -/ -def prodMapTok (f₀ : ApproximableMap A₀.sys B₀.sys) (f₁ : ApproximableMap A₁.sys B₁.sys) : +@[expose] def prodMapTok (f₀ : ApproximableMap A₀.sys B₀.sys) (f₁ : ApproximableMap A₁.sys B₁.sys) : ApproximableMap (A₀.prod A₁).sys (B₀.prod B₁).sys where rel W W' := ∃ X Y X' Y', f₀.rel X X' ∧ f₁.rel Y Y' ∧ W = prodTokNbhd X Y ∧ W' = prodTokNbhd X' Y' @@ -663,7 +663,7 @@ def ScottSys.tok (D : ScottSys) : Set Str := D.sys.master /-- **The one-neighbourhood system `{Γ}`** over `{0,1}*`: its only neighbourhood is `Γ` itself, and its master (token set) is `Γ`. It is `∅`-free precisely because `Γ` is non-empty. -/ -def singletonSys (Γ : Set Str) (h : Γ.Nonempty) : ScottSys where +@[expose] def singletonSys (Γ : Set Str) (h : Γ.Nonempty) : ScottSys where sys := { mem := fun X => X = Γ master := Γ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise621.lean b/LeanPool/DomainTheory/Neighborhood/Exercise621.lean index fbebf27ec7..7eb744b231 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise621.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise621.lean @@ -47,7 +47,7 @@ category. Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -79,7 +79,7 @@ theorem inter_ne_of_ne_right {X X' Δ : Set Str} (hX' : X' ⊆ Δ) (hne : X' ≠ `sumTok`, but the improper copies `0Δ₀`, `1Δ₁` are removed (`X ≠ Δ₀`, `Y ≠ Δ₁`), so the two bottoms are identified. -/ -def oplusTok (D₀ D₁ : NeighborhoodSystem Str) +@[expose] def oplusTok (D₀ D₁ : NeighborhoodSystem Str) (h₀ : ∀ X, D₀.mem X → X.Nonempty) (h₁ : ∀ Y, D₁.mem Y → Y.Nonempty) : NeighborhoodSystem Str where mem W := W = sumTokMaster D₀ D₁ ∨ (∃ X, D₀.mem X ∧ X ≠ D₀.master ∧ W = embBit false X) ∨ @@ -151,7 +151,7 @@ than the full top `M`) are removed. -/ rectangles must avoid both top coordinates (`X ≠ Δ₀`, `Y ≠ Δ₁`); the full top `M = prodTokNbhd Δ₀ Δ₁` is kept as the master. -/ -def otimesTok (D₀ D₁ : NeighborhoodSystem Str) : NeighborhoodSystem Str where +@[expose] def otimesTok (D₀ D₁ : NeighborhoodSystem Str) : NeighborhoodSystem Str where mem W := W = prodTokNbhd D₀.master D₁.master ∨ (∃ X Y, D₀.mem X ∧ D₁.mem Y ∧ X ≠ D₀.master ∧ Y ≠ D₁.master ∧ W = prodTokNbhd X Y) master := prodTokNbhd D₀.master D₁.master @@ -188,11 +188,11 @@ theorem otimesTok_nonempty : ∀ W, (otimesTok D₀ D₁).mem W → W.Nonempty : /-! ## Repackaged as objects of Scott's category -/ /-- The **coalesced sum object** `𝒟₀ ⊕ 𝒟₁`. -/ -def ScottSys.oplus (A₀ A₁ : ScottSys) : ScottSys := +@[expose] def ScottSys.oplus (A₀ A₁ : ScottSys) : ScottSys := ⟨oplusTok A₀.sys A₁.sys A₀.ne A₁.ne, oplusTok_nonempty⟩ /-- The **smash product object** `𝒟₀ ⊗ 𝒟₁`. -/ -def ScottSys.otimes (A₀ A₁ : ScottSys) : ScottSys := +@[expose] def ScottSys.otimes (A₀ A₁ : ScottSys) : ScottSys := ⟨otimesTok A₀.sys A₁.sys, otimesTok_nonempty⟩ /-! ## Membership inversions -/ @@ -306,6 +306,7 @@ the shared bottom). -/ variable {C₀ C₁ : ScottSys} /-- **`f₀ ⊕ f₁`, the action of the coalesced sum on maps.** -/ +@[expose] def oplusMapTok (f₀ : ApproximableMap A₀.sys B₀.sys) (f₁ : ApproximableMap A₁.sys B₁.sys) : ApproximableMap (A₀.oplus A₁).sys (B₀.oplus B₁).sys where rel W W' := @@ -474,6 +475,7 @@ As `prodMapTok`, but proper rectangles require both components proper, and a absorbs a boundary hit `f₀(X) = Δ₀'` (or `f₁(Y) = Δ₁'`) into the top `M`. -/ /-- **`f₀ ⊗ f₁`, the action of the smash product on maps.** -/ +@[expose] def otimesMapTok (f₀ : ApproximableMap A₀.sys B₀.sys) (f₁ : ApproximableMap A₁.sys B₁.sys) : ApproximableMap (A₀.otimes A₁).sys (B₀.otimes B₁).sys where rel W W' := @@ -624,7 +626,7 @@ inductive GExpr where | otimes : GExpr → GExpr → GExpr /-- **The action of `T` on objects.** -/ -def GExpr.obj : GExpr → ScottSys → ScottSys +@[expose] def GExpr.obj : GExpr → ScottSys → ScottSys | .const D, _ => D | .var, X => X | .sum a b, X => (a.obj X).sum (b.obj X) @@ -633,7 +635,7 @@ def GExpr.obj : GExpr → ScottSys → ScottSys | .otimes a b, X => (a.obj X).otimes (b.obj X) /-- **The action of `T` on maps.** -/ -def GExpr.map : (T : GExpr) → {X Y : ScottSys} → ApproximableMap X.sys Y.sys → +@[expose] def GExpr.map : (T : GExpr) → {X Y : ScottSys} → ApproximableMap X.sys Y.sys → ApproximableMap (T.obj X).sys (T.obj Y).sys | .const D, _, _, _ => idMap D.sys | .var, _, _, f => f @@ -849,7 +851,7 @@ generic helpers /-- **The token-level master recursion for `GExpr`.** All four binary operations share the same body (`sumTokMaster = prodTokNbhd` on masters). -/ -def gFun : GExpr → Set Str → Set Str +@[expose] def gFun : GExpr → Set Str → Set Str | .const C, _ => C.sys.master | .var, Γ => Γ | .sum a b, Γ => insert ([] : Str) (embBit false (gFun a Γ) ∪ embBit true (gFun b Γ)) @@ -909,7 +911,7 @@ theorem gFun_continuous (T : GExpr) {ℱ : Set (Set Str)} {U : Set Str} | otimes a b ih₀ ih₁ => intro w; exact insertTag_continuous hne ih₀ ih₁ w /-- **`Λ ∈ tok(C)` for every constant `C` occurring in `T`.** -/ -def GExpr.RootedConst : GExpr → Prop +@[expose] def GExpr.RootedConst : GExpr → Prop | .const C => ([] : Str) ∈ C.sys.master | .var => True | .sum a b => a.RootedConst ∧ b.RootedConst @@ -927,7 +929,7 @@ theorem gFun_nil_mem : ∀ (T : GExpr), T.RootedConst → {Γ : Set Str} → | .otimes _ _, _, _, _ => Set.mem_insert _ _ /-- The **Kleene iteration** `gFunⁿ({Λ})`. -/ -def gIter (T : GExpr) : ℕ → Set Str +@[expose] def gIter (T : GExpr) : ℕ → Set Str | 0 => {([] : Str)} | n + 1 => gFun T (gIter T n) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise622.lean b/LeanPool/DomainTheory/Neighborhood/Exercise622.lean index f68f65f529..7f058f378d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise622.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise622.lean @@ -70,7 +70,7 @@ Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -109,7 +109,7 @@ theorem nil_mem_Cnat : ([] : Str) ∈ Cnat.sys.master := Set.mem_insert_iff.mpr /-- **The one-point domain `{{Λ}} = 𝟙`** (the terminal object of Scott's category). -/ -def Cone : ScottSys := singletonSys ({([] : Str)} : Set Str) ⟨[], rfl⟩ +@[expose] def Cone : ScottSys := singletonSys ({([] : Str)} : Set Str) ⟨[], rfl⟩ /-- `Λ ∈ tok(Cone)`. -/ theorem nil_mem_Cone : ([] : Str) ∈ Cone.sys.master := rfl diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise623.lean b/LeanPool/DomainTheory/Neighborhood/Exercise623.lean index 60843ca728..00a6d59b1a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise623.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise623.lean @@ -87,7 +87,7 @@ union, not an existential witness). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -102,7 +102,7 @@ data) -/ /-- **The fixed-point token set `Γ = tok(T({Γ}))`**, as the explicit Kleene union `⋃ₙ gIter T n` (no `Classical.choice`). -/ -def gFix (T : GExpr) : Set Str := ⋃ n, gIter T n +@[expose] def gFix (T : GExpr) : Set Str := ⋃ n, gIter T n theorem gFix_nil_mem (T : GExpr) : ([] : Str) ∈ gFix T := Set.mem_iUnion.mpr ⟨0, rfl⟩ @@ -116,7 +116,7 @@ theorem gFix_fixed (T : GExpr) (hT : T.RootedConst) : gFun T (gFix T) = gFix T : /-! ## The iterated-functor tower `Tⁿ({Γ})` -/ /-- **The one-point generator `{Γ}`** as an object of the category. -/ -def gGen (T : GExpr) : ScottSys := singletonSys (gFix T) (gFix_nonempty T) +@[expose] def gGen (T : GExpr) : ScottSys := singletonSys (gFix T) (gFix_nonempty T) @[simp] theorem gGen_master (T : GExpr) : (gGen T).sys.master = gFix T := rfl @@ -138,7 +138,7 @@ theorem gBase (T : GExpr) (hT : T.RootedConst) : (gGen T).sys ◁ (T.obj (gGen T /-- **The tower `Tⁿ({Γ})`** of `∅`-free systems over `Str`: `T⁰({Γ}) = {Γ}`, `Tⁿ⁺¹({Γ}) = T(Tⁿ({Γ}))`. -/ -def gTower (T : GExpr) : ℕ → ScottSys +@[expose] def gTower (T : GExpr) : ℕ → ScottSys | 0 => gGen T | n + 1 => T.obj (gTower T n) @@ -174,7 +174,7 @@ set is a neighbourhood exactly when it is a neighbourhood of some level; closure under consistent intersection uses that the tower is a chain (any finite collection sits inside one level). -/ -def gColim (T : GExpr) (hT : T.RootedConst) : ScottSys where +@[expose] def gColim (T : GExpr) (hT : T.RootedConst) : ScottSys where sys := { mem := fun X => ∃ n, (gTower T n).sys.mem X master := gFix T @@ -268,7 +268,7 @@ over the variable domain `N`. The `⊕ N` carries the variables, and the two `(X×X)` summands (combined by `+`) carry the two binary operation symbols. -/ -def Texp (N : ScottSys) : GExpr := +@[expose] def Texp (N : ScottSys) : GExpr := .oplus (.const N) (.sum (.prod .var .var) (.prod .var .var)) /-- `Texp N` is rooted iff the variable domain `N` is (`Λ ∈ tok(N)`, automatic for @@ -280,7 +280,7 @@ theorem Texp_rooted {N : ScottSys} (hN : ([] : Str) ∈ N.sys.master) : (Texp N) /-- **The syntactic domain of expressions** `Exp = ⋃ₙ Texpⁿ({Γ})`, the initial solution of `Exp ≅ N ⊕ ((Exp×Exp)+(Exp×Exp))`. -/ -def Exp (N : ScottSys) (hN : ([] : Str) ∈ N.sys.master) : ScottSys := +@[expose] def Exp (N : ScottSys) (hN : ([] : Str) ∈ N.sys.master) : ScottSys := gColim (Texp N) (Texp_rooted hN) /-- **The domain equation `Exp ≅ N ⊕ ((Exp×Exp)+(Exp×Exp))`**, realised as an @@ -334,7 +334,7 @@ instance : Category ScottSys where `StrictMap`, which is defeq to the category's `Hom`; this avoids the class-projection that blocks the anonymous `.1` on `Category.Hom`.) -/ -def gFunctorMap (T : GExpr) {X Y : ScottSys} (f : StrictMap X.sys Y.sys) : +@[expose] def gFunctorMap (T : GExpr) {X Y : ScottSys} (f : StrictMap X.sys Y.sys) : StrictMap (T.obj X).sys (T.obj Y).sys := ⟨T.map f.1, T.map_isStrict f.1 f.2⟩ @@ -345,7 +345,7 @@ Functoriality is `GExpr.map_id` and `GExpr.map_comp` (the latter needs `g` strict — automatic here, since every morphism of this category is strict). -/ -def gFunctor (T : GExpr) : Endofunctor ScottSys where +@[expose] def gFunctor (T : GExpr) : Endofunctor ScottSys where obj := T.obj map := gFunctorMap T map_id X := Subtype.ext (T.map_id X) @@ -378,7 +378,7 @@ since `T(Exp) = Exp`). This realises Scott's "construe the initial solution as a syntactic domain of expressions": `Exp` is an algebra of `T(X) = N ⊕ ((X×X)+(X×X))`. -/ -@[instance_reducible] +@[expose, instance_reducible] def ExpAlg (N : ScottSys) (hN : ([] : Str) ∈ N.sys.master) : TAlgebra (TexpF N) where carrier := Exp N hN str := (ExpIso N hN).hom @@ -450,7 +450,7 @@ variable {N : ScottSys} (hN : ([] : Str) ∈ N.sys.master) (B : TAlgebra (TexpF /-- **The Kleene iterates `valₙ : Exp → D`** of the operator `λh. k ∘ T(h) ∘ j`. `val₀ = ⊥`, `valₙ₊₁ = k ∘ T(valₙ) ∘ j`. -/ -def descRel : ℕ → ApproximableMap (Exp N hN).sys B.carrier.sys +@[expose] def descRel : ℕ → ApproximableMap (Exp N hN).sys B.carrier.sys | 0 => constMap (Exp N hN).sys B.carrier.sys.bot | n + 1 => (algStr B).comp (((Texp N).map (descRel n)).comp (expInv N hN)) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise624.lean b/LeanPool/DomainTheory/Neighborhood/Exercise624.lean index b23b89dc1e..679252b0fb 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise624.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise624.lean @@ -87,7 +87,7 @@ of the simultaneous Theorem 6.14, which then yields the required isomorphisms Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -102,12 +102,12 @@ namespace Exercise624 ∪ 1q`. It is also the master of the product `{p} × {q}` (sum and product share the master shape over `{0,1}*`). -/ -def gTok (p q : Set Str) : Set Str := insert ([] : Str) (embBit false p ∪ embBit true q) +@[expose] def gTok (p q : Set Str) : Set Str := insert ([] : Str) (embBit false p ∪ embBit true q) /-- `fTok p q = tok((D + (D×E)))` for `D = {p}`, `E = {q}`: `{Λ} ∪ 0p ∪ 1(gTok p q)`, equivalently `gTok p (gTok p q)`. -/ -def fTok (p q : Set Str) : Set Str := gTok p (gTok p q) +@[expose] def fTok (p q : Set Str) : Set Str := gTok p (gTok p q) theorem nil_mem_gTok (p q : Set Str) : ([] : Str) ∈ gTok p q := Set.mem_insert _ _ @@ -232,16 +232,16 @@ theorem exists_double_fixedPoint : /-! ## The two solution systems and the simultaneous subsystem facts -/ /-- The solution system `D = {Γ_D}`. -/ -def Dsol : ScottSys := singletonSys GammaD ⟨[], nil_mem_GammaD⟩ +@[expose] def Dsol : ScottSys := singletonSys GammaD ⟨[], nil_mem_GammaD⟩ /-- The solution system `E = {Γ_E}`. -/ -def Esol : ScottSys := singletonSys GammaE ⟨[], nil_mem_GammaE⟩ +@[expose] def Esol : ScottSys := singletonSys GammaE ⟨[], nil_mem_GammaE⟩ /-- The first right-hand side `D + (D × E)`. -/ -def Fsol (D E : ScottSys) : ScottSys := D.sum (D.prod E) +@[expose] def Fsol (D E : ScottSys) : ScottSys := D.sum (D.prod E) /-- The second right-hand side `D + E`. -/ -def Gsol (D E : ScottSys) : ScottSys := D.sum E +@[expose] def Gsol (D E : ScottSys) : ScottSys := D.sum E /-- The master (token set) of `D + (D×E)` is `fTok Γ_D Γ_E` — definitionally, the sum/product diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise625.lean b/LeanPool/DomainTheory/Neighborhood/Exercise625.lean index 1eba16677d..4931bbb5be 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise625.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise625.lean @@ -69,7 +69,7 @@ Exercises 1.18/1.27 are the only constructions used and are themselves choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise626.lean b/LeanPool/DomainTheory/Neighborhood/Exercise626.lean index c854b87f1f..0c0c958e10 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise626.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise626.lean @@ -59,7 +59,7 @@ to decide whether an element lies above the fresh bottom — unavoidable and cal out there. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -74,6 +74,7 @@ variable {D : NeighborhoodSystem Str} /-! ## The lifted system `𝒟_⊥` over `{0,1}*` -/ /-- The master neighbourhood `{Λ} ∪ 0Δ` of the lift. -/ +@[expose] def liftTokMaster (D : NeighborhoodSystem Str) : Set Str := insert [] (embBit false D.master) theorem nil_mem_liftTokMaster : ([] : Str) ∈ liftTokMaster D := Set.mem_insert _ _ @@ -93,7 +94,7 @@ theorem embF_ne_liftTokMaster {X : Set Str} : embBit false X ≠ liftTokMaster D the master `{Λ} ∪ 0Δ` or a tagged copy `0X` (`X ∈ 𝒟`). `∅`-freeness of `𝒟` (`hD`) keeps it `∅`-free. -/ -def liftTok (D : NeighborhoodSystem Str) : +@[expose] def liftTok (D : NeighborhoodSystem Str) : NeighborhoodSystem Str where mem W := W = liftTokMaster D ∨ ∃ X, D.mem X ∧ W = embBit false X master := liftTokMaster D @@ -122,7 +123,7 @@ theorem liftTok_nonempty (hD : ∀ X, D.mem X → X.Nonempty) : · exact embBit_nonempty (hD X hX) /-- The **lift object** `𝒟_⊥` of Scott's category. -/ -def ScottSys.lift (A : ScottSys) : ScottSys := ⟨liftTok A.sys, liftTok_nonempty A.ne⟩ +@[expose] def ScottSys.lift (A : ScottSys) : ScottSys := ⟨liftTok A.sys, liftTok_nonempty A.ne⟩ theorem liftTok_mem_master : (liftTok D).mem (liftTokMaster D) := Or.inl rfl @@ -443,7 +444,7 @@ def toSumLift (z : (D.lift.oplus E.lift).sys.Element) : (D.sum E).sys.Element wh · intro hz; exact Or.inr (Or.inr ⟨Y, hY, rfl, hz⟩) /-- The inverse half `|𝒟 + ℰ| → |𝒟_⊥ ⊕ ℰ_⊥|`: reinstate the inner `0`. -/ -def fromSumLift (s : (D.sum E).sys.Element) : (D.lift.oplus E.lift).sys.Element where +@[expose] def fromSumLift (s : (D.sum E).sys.Element) : (D.lift.oplus E.lift).sys.Element where mem W := W = sumTokMaster D.lift.sys E.lift.sys ∨ (∃ X, D.sys.mem X ∧ W = embBit false (embBit false X) ∧ s.mem (embBit false X)) ∨ (∃ Y, E.sys.mem Y ∧ W = embBit true (embBit false Y) ∧ s.mem (embBit true Y)) @@ -672,6 +673,7 @@ def toLiftProd (z : (D.lift.otimes E.lift).sys.Element) : (D.prod E).lift.sys.El · intro hz; exact Or.inr ⟨X, Y, hX, hY, rfl, hz⟩ /-- The inverse half `|(𝒟 × ℰ)_⊥| → |𝒟_⊥ ⊗ ℰ_⊥|`. -/ +@[expose] def fromLiftProd (s : (D.prod E).lift.sys.Element) : (D.lift.otimes E.lift).sys.Element where mem W := W = prodTokNbhd (liftTokMaster D.sys) (liftTokMaster E.sys) ∨ (∃ X Y, D.sys.mem X ∧ E.sys.mem Y ∧ W = prodTokNbhd (embBit false X) (embBit false Y) ∧ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise627.lean b/LeanPool/DomainTheory/Neighborhood/Exercise627.lean index eae830046e..35d6dbcb63 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise627.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise627.lean @@ -56,7 +56,7 @@ genuinely-undecidable test `X = Δ₀` over an arbitrary system and so depends on `Classical.choice`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -300,7 +300,7 @@ theorem oplus_mem_leftN {X : Set Str} (hX : D₀.mem X) : · rw [leftN_proper h]; exact oplusTok_mem_embF hX h /-- The injection `i : 𝒟 → 𝒟 ⊕ ℰ`: `X i W ↔ X ∈ 𝒟 ∧ W ∈ 𝒟⊕ℰ ∧ leftN X ⊆ W`. -/ -def inlInj : ApproximableMap D₀ (oplusTok D₀ D₁ h₀ h₁) where +@[expose] def inlInj : ApproximableMap D₀ (oplusTok D₀ D₁ h₀ h₁) where rel X W := D₀.mem X ∧ (oplusTok D₀ D₁ h₀ h₁).mem W ∧ leftN D₀ D₁ X ⊆ W rel_dom h := h.1 rel_cod h := h.2.1 @@ -431,7 +431,7 @@ theorem toStrictFilter_toStrictMap (φ : (strictFun V₀ V₁).Element) : (strictFunEquiv V₀ V₁).symm_apply_apply φ /-- Element-level inclusion `|𝒟 →⊥ ℰ| → |𝒟 → ℰ|`. -/ -def incl (φ : (strictFun V₀ V₁).Element) : (funSpace V₀ V₁).Element := +@[expose] def incl (φ : (strictFun V₀ V₁).Element) : (funSpace V₀ V₁).Element := toFilter (toStrictMap φ).1 /-- Element-level strictification `|𝒟 → ℰ| → |𝒟 →⊥ ℰ|`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise628.lean b/LeanPool/DomainTheory/Neighborhood/Exercise628.lean index 805d23fbbb..ce5e9e3c8e 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise628.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise628.lean @@ -75,7 +75,7 @@ genuinely unavoidable, as it extracts a `Fintype` from `Finite` and a surjection's section. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise629.lean b/LeanPool/DomainTheory/Neighborhood/Exercise629.lean index 6785dcc5eb..0e17976b05 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise629.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise629.lean @@ -76,7 +76,7 @@ argument through Mathlib's classical `Set.Finite`). Both are flagged in their docstrings. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -182,7 +182,7 @@ theorem updTuple_apply_ne {i j : ι} (U : Set (α i)) (h : j ≠ i) : def slice (D : ∀ i, NeighborhoodSystem (α i)) (i : ι) (U : Set (α i)) : Set (Σ i, α i) := iprodNbhd (updTuple D i U) -theorem slice_eq (i : ι) (U : Set (α i)) : slice D i U = iprodNbhd (updTuple D i U) := rfl +theorem slice_eq (i : ι) (U : Set (α i)) : slice D i U = iprodNbhd (updTuple D i U) := by rfl /-- A slice has support `⊆ {i}`, hence is a neighbourhood of the product when `U ∈ 𝒟ᵢ`. -/ diff --git a/LeanPool/DomainTheory/Neighborhood/FunctionSpace.lean b/LeanPool/DomainTheory/Neighborhood/FunctionSpace.lean index cb3f523be6..5b66229575 100644 --- a/LeanPool/DomainTheory/Neighborhood/FunctionSpace.lean +++ b/LeanPool/DomainTheory/Neighborhood/FunctionSpace.lean @@ -60,7 +60,7 @@ neighbourhood, condition `sSupMaps` with `toElementMap_sSupMaps` (iii). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -85,12 +85,14 @@ theorem ApproximableMap.le_iff {f g : ApproximableMap V₀ V₁} : /-! ### Definition 3.8 — step sets and the function space. -/ /-- Scott's step set `[X, Y] = {f ∣ X f Y}`. -/ +@[expose] def step (X : Set α) (Y : Set β) : Set (ApproximableMap V₀ V₁) := {f | f.rel X Y} @[simp] theorem mem_step {X : Set α} {Y : Set β} {f : ApproximableMap V₀ V₁} : f ∈ step X Y ↔ f.rel X Y := Iff.rfl /-- A finite intersection of step sets, indexed by a list of `(X, Y)` pairs. -/ +@[expose] def stepFun (L : List (Set α × Set β)) : Set (ApproximableMap V₀ V₁) := {f | ∀ p ∈ L, f.rel p.1 p.2} @@ -144,6 +146,7 @@ theorem step_subset {X X' : Set α} {Y Y' : Set β} (hX' : V₀.mem X') (hY' : V /-- **Definition 3.8 (Scott 1981, PRG-19).** The *function space* `(𝒟₀ → 𝒟₁)`: tokens are approximable maps, neighbourhoods are non-empty finite intersections of step sets. -/ +@[expose] def funSpace (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : NeighborhoodSystem (ApproximableMap V₀ V₁) where mem W := (∃ L : List (Set α × Set β), (∀ p ∈ L, V₀.mem p.1 ∧ V₁.mem p.2) ∧ W = stepFun L) @@ -159,7 +162,7 @@ def funSpace (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : · exact hL' p h sub_master := fun _ => Set.subset_univ _ -@[simp] theorem funSpace_master : (funSpace V₀ V₁).master = Set.univ := rfl +@[simp] theorem funSpace_master : (funSpace V₀ V₁).master = Set.univ := by rfl theorem funSpace_mem_iff {W : Set (ApproximableMap V₀ V₁)} : (funSpace V₀ V₁).mem W ↔ @@ -210,6 +213,7 @@ theorem mem_stepFun_iff (φ : (funSpace V₀ V₁).Element) {L : List (Set α × filter `φ`. Intersectivity is the payoff of positivity (`[X,Y]∩[X,Y'] = [X,Y∩Y']` is non-empty, so `Y∩Y' ∈ 𝒟₁`). -/ +@[expose] def toApproxMap (φ : (funSpace V₀ V₁).Element) : ApproximableMap V₀ V₁ where rel X Y := φ.mem (step X Y) rel_dom := by intro X Y h; obtain ⟨f, hf⟩ := (φ.sub h).2; exact f.rel_dom hf @@ -234,7 +238,7 @@ def toApproxMap (φ : (funSpace V₀ V₁).Element) : ApproximableMap V₀ V₁ /-- **Theorem 3.10 (Scott 1981, PRG-19).** The filter `f̂ = {F ∣ f ∈ F}` of an approximable map. -/ -def toFilter (f : ApproximableMap V₀ V₁) : (funSpace V₀ V₁).Element where +@[expose] def toFilter (f : ApproximableMap V₀ V₁) : (funSpace V₀ V₁).Element where mem W := (funSpace V₀ V₁).mem W ∧ f ∈ W sub h := h.1 master_mem := ⟨(funSpace V₀ V₁).master_mem, Set.mem_univ f⟩ @@ -256,6 +260,7 @@ def toFilter (f : ApproximableMap V₀ V₁) : (funSpace V₀ V₁).Element wher /-- **Theorem 3.10 (Scott 1981, PRG-19).** The function space is *complete*: every filter is fixed by a unique approximable mapping, inclusion-preservingly. -/ +@[expose] def funSpaceEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : (funSpace V₀ V₁).Element ≃o ApproximableMap V₀ V₁ where toFun := toApproxMap @@ -289,10 +294,10 @@ def funSpaceEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) exact h _ hrel @[simp] theorem funSpaceEquiv_apply (φ : (funSpace V₀ V₁).Element) : - funSpaceEquiv V₀ V₁ φ = toApproxMap φ := rfl + funSpaceEquiv V₀ V₁ φ = toApproxMap φ := by rfl @[simp] theorem funSpaceEquiv_symm_apply (f : ApproximableMap V₀ V₁) : - (funSpaceEquiv V₀ V₁).symm f = toFilter f := rfl + (funSpaceEquiv V₀ V₁).symm f = toFilter f := by rfl /-- Intersection of two function-space neighbourhoods, when non-empty, is again one. -/ @@ -328,14 +333,15 @@ than `X`, taken inside the master neighbourhood `Δ₁` (so the empty intersection is `Δ₁`, per the convention 1.1a). Indexed by the list `L` of `(Xᵢ, Yᵢ)` pairs. -/ +@[expose] def interYs (m : Set β) : List (Set α × Set β) → Set α → Set β | [], _ => m | p :: L, X => {z | X ⊆ p.1 → z ∈ p.2} ∩ interYs m L X -@[simp] theorem interYs_nil (m : Set β) (X : Set α) : interYs m [] X = m := rfl +@[simp] theorem interYs_nil (m : Set β) (X : Set α) : interYs m [] X = m := by rfl theorem interYs_cons (m : Set β) (p : Set α × Set β) (L : List (Set α × Set β)) (X : Set α) : - interYs m (p :: L) X = {z | X ⊆ p.1 → z ∈ p.2} ∩ interYs m L X := rfl + interYs m (p :: L) X = {z | X ⊆ p.1 → z ∈ p.2} ∩ interYs m L X := by rfl /-- Membership in `interYs`: `z ∈ ⋂{Yᵢ ∣ X ⊆ Xᵢ}` iff `z ∈ Δ₁` and `z ∈ Yᵢ` for every `i` with @@ -379,6 +385,7 @@ Scott's condition (i) in the operational form `hcons`: for every neighbourhood `{Yᵢ ∣ X ⊆ Xᵢ}` (consistent in `𝒟₁`, witnessed by `X` being a common lower bound of their inputs) have their intersection again a neighbourhood. -/ +@[expose] def leastMap (L : List (Set α × Set β)) (hcons : ∀ {X}, V₀.mem X → V₁.mem (interYs V₁.master L X)) : ApproximableMap V₀ V₁ where rel X Y := V₀.mem X ∧ V₁.mem Y ∧ interYs V₁.master L X ⊆ Y @@ -478,6 +485,7 @@ def MapsBounded (F : Set (ApproximableMap V₀ V₁)) : Prop := ∃ h, ∀ f ∈ /-- `F` is *pointwise bounded* when `{f(x) ∣ f ∈ F}` is bounded in `|𝒟₁|` for every `x`. -/ +@[expose] def PointwiseBounded (F : Set (ApproximableMap V₀ V₁)) : Prop := ∀ x : V₀.Element, V₁.Bounded (Set.image (fun f => f.toElementMap x) F) @@ -597,7 +605,7 @@ variable {V₂ : NeighborhoodSystem γ} /-- **Theorem 3.11 (Scott 1981, PRG-19).** The two-variable evaluation map `eval : (𝒟₁ → 𝒟₂) × 𝒟₁ → 𝒟₂`, `F, X eval Y ↔ X f Y for all f ∈ F`. -/ -def eval (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) : +@[expose] def eval (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) : ApproximableMap₂ (funSpace V₁ V₂) V₁ V₂ where rel F X Y := (funSpace V₁ V₂).mem F ∧ V₁.mem X ∧ V₂.mem Y ∧ ∀ f ∈ F, f.rel X Y rel_dom₀ h := h.1 @@ -634,7 +642,7 @@ theorem toElementMap₂_eval (φ : (funSpace V₁ V₂).Element) (x : V₁.Eleme /-- **Theorem 3.11 (Scott 1981, PRG-19).** Evaluation as a single approximable map out of the product `(𝒟₁ → 𝒟₂) × 𝒟₁ → 𝒟₂`. -/ -def evalMap (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) : +@[expose] def evalMap (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) : ApproximableMap (prod (funSpace V₁ V₂) V₁) V₂ := ofMap₂ (eval V₁ V₂) /-- **Theorem 3.11(i) (Scott 1981, PRG-19).** `eval(⟨f, x⟩) = f(x)`. -/ @@ -838,7 +846,7 @@ theorem curry_eval_comp (h : ApproximableMap V₀ (funSpace V₁ V₂)) : /-- **Theorem 3.12 (Scott 1981, PRG-19).** `curry` is an order-isomorphism between `|𝒟₀ × 𝒟₁ → 𝒟₂|` and `|𝒟₀ → (𝒟₁ → 𝒟₂)|`. -/ -def curryEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) +@[expose] def curryEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) : ApproximableMap (prod V₀ V₁) V₂ ≃o ApproximableMap V₀ (funSpace V₁ V₂) where toFun := curry diff --git a/LeanPool/DomainTheory/Neighborhood/Lemma615.lean b/LeanPool/DomainTheory/Neighborhood/Lemma615.lean index 286bddaef0..170686b490 100644 --- a/LeanPool/DomainTheory/Neighborhood/Lemma615.lean +++ b/LeanPool/DomainTheory/Neighborhood/Lemma615.lean @@ -75,7 +75,7 @@ development is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -86,6 +86,7 @@ variable {α β : Type*} {D : NeighborhoodSystem α} {E : NeighborhoodSystem β} /-- **Scott's `⊴` (the prose before Lemma 6.15).** `D ⊴ E` means `D ≅ D'` for some subdomain `D' ◁ E`: `D` *embeds as a subdomain* of `E`. -/ +@[expose] def Trianglelefteq (D : NeighborhoodSystem α) (E : NeighborhoodSystem β) : Prop := ∃ D' : NeighborhoodSystem β, D' ◁ E ∧ (D ≅ᴰ D') diff --git a/LeanPool/DomainTheory/Neighborhood/Product.lean b/LeanPool/DomainTheory/Neighborhood/Product.lean index b4454f392f..1f4235ea08 100644 --- a/LeanPool/DomainTheory/Neighborhood/Product.lean +++ b/LeanPool/DomainTheory/Neighborhood/Product.lean @@ -55,7 +55,7 @@ substitution Everything is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -66,6 +66,7 @@ variable {α β γ δ : Type*} /-- The product neighbourhood `X ∪ Y` over the disjoint union `Δ₀ ∪ Δ₁`, modelled on `α ⊕ β` as `Sum.inl '' X ∪ Sum.inr '' Y`. -/ +@[expose] def prodNbhd (X : Set α) (Y : Set β) : Set (α ⊕ β) := Sum.inl '' X ∪ Sum.inr '' Y @[simp] theorem mem_prodNbhd_inl {X : Set α} {Y : Set β} {a : α} : @@ -117,6 +118,7 @@ neighbourhoods are (`prodNbhd_inter`) together with the factors' closure; the consistency witness `Z ⊆ (X∪Y) ∩ (X'∪Y')` splits into witnesses `Z₀ ⊆ X ∩ X'`, `Z₁ ⊆ Y ∩ Y'` by `prodNbhd_subset_iff`. -/ +@[expose] def prod (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : NeighborhoodSystem (α ⊕ β) where mem W := ∃ X Y, V₀.mem X ∧ V₁.mem Y ∧ W = prodNbhd X Y master := prodNbhd V₀.master V₁.master @@ -138,12 +140,13 @@ variable {V₀ : NeighborhoodSystem α} {V₁ : NeighborhoodSystem β} theorem prod_mem_prodNbhd {X : Set α} {Y : Set β} (hX : V₀.mem X) (hY : V₁.mem Y) : (prod V₀ V₁).mem (prodNbhd X Y) := ⟨X, Y, hX, hY, rfl⟩ -@[simp] theorem prod_master : (prod V₀ V₁).master = prodNbhd V₀.master V₁.master := rfl +@[simp] theorem prod_master : (prod V₀ V₁).master = prodNbhd V₀.master V₁.master := by rfl /-! ### Projections of an element (Scott's `z₀`, `z₁`). -/ /-- Scott's `z₀ = {X ∈ 𝒟₀ ∣ X ∪ Δ₁ ∈ z}`: the first component of a product element. -/ +@[expose] def NeighborhoodSystem.Element.fst (z : (prod V₀ V₁).Element) : V₀.Element where mem X := V₀.mem X ∧ z.mem (prodNbhd X V₁.master) sub h := h.1 @@ -162,6 +165,7 @@ def NeighborhoodSystem.Element.fst (z : (prod V₀ V₁).Element) : V₀.Element /-- Scott's `z₁ = {Y ∈ 𝒟₁ ∣ Δ₀ ∪ Y ∈ z}`: the second component of a product element. -/ +@[expose] def NeighborhoodSystem.Element.snd (z : (prod V₀ V₁).Element) : V₁.Element where mem Y := V₁.mem Y ∧ z.mem (prodNbhd V₀.master Y) sub h := h.1 @@ -207,6 +211,7 @@ theorem prod_mem_split {z : (prod V₀ V₁).Element} {X : Set α} {Y : Set β} /-- **Definition 3.1 (Scott 1981, PRG-19).** The element pairing `⟨x, y⟩ = {X ∪ Y ∣ X ∈ x, Y ∈ y}`. -/ +@[expose] def pair (x : V₀.Element) (y : V₁.Element) : (prod V₀ V₁).Element where mem W := ∃ X Y, x.mem X ∧ y.mem Y ∧ W = prodNbhd X Y sub := by rintro W ⟨X, Y, hX, hY, rfl⟩; exact prod_mem_prodNbhd (x.sub hX) (y.sub hY) @@ -280,7 +285,7 @@ theorem pair_fst_snd (z : (prod V₀ V₁).Element) : pair z.fst z.snd = z := by /-- **Proposition 3.2 (Scott 1981, PRG-19).** The order-isomorphism `|𝒟₀ × 𝒟₁| ≃o |𝒟₀| × |𝒟₁|`. -/ -def prodEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : +@[expose] def prodEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : (prod V₀ V₁).Element ≃o V₀.Element × V₁.Element where toFun z := (z.fst, z.snd) invFun p := pair p.1 p.2 @@ -299,10 +304,10 @@ def prodEquiv (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : exact ⟨fun X ⟨hX, hzX⟩ => ⟨hX, h _ hzX⟩, fun Y ⟨hY, hzY⟩ => ⟨hY, h _ hzY⟩⟩ @[simp] theorem prodEquiv_apply (z : (prod V₀ V₁).Element) : - prodEquiv V₀ V₁ z = (z.fst, z.snd) := rfl + prodEquiv V₀ V₁ z = (z.fst, z.snd) := by rfl @[simp] theorem prodEquiv_symm_apply (p : V₀.Element × V₁.Element) : - (prodEquiv V₀ V₁).symm p = pair p.1 p.2 := rfl + (prodEquiv V₀ V₁).symm p = pair p.1 p.2 := by rfl /-! ### Definition 3.3 / Proposition 3.4 — projections and pairing of maps. -/ @@ -360,6 +365,7 @@ def proj₁ (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) : /-- **Definition 3.3 (Scott 1981, PRG-19).** The paired mapping `⟨f, g⟩ : 𝒟₂ → 𝒟₀ × 𝒟₁`, `Z ⟨f, g⟩ (X ∪ Y) ↔ Z f X ∧ Z g Y`. -/ +@[expose] def paired (f : ApproximableMap V₂ V₀) (g : ApproximableMap V₂ V₁) : ApproximableMap V₂ (prod V₀ V₁) where rel Z P := (prod V₀ V₁).mem P ∧ f.rel Z (Sum.inl ⁻¹' P) ∧ g.rel Z (Sum.inr ⁻¹' P) @@ -481,6 +487,7 @@ theorem prod_mem_prodNbhd_iff {X : Set α} {Y : Set β} : /-- **Lemma 3.6 (Scott 1981, PRG-19).** The constant map at `b : |𝒟₁|`: `X b Y ↔ Y ∈ b`. -/ +@[expose] def constMap (V₀ : NeighborhoodSystem α) (b : V₁.Element) : ApproximableMap V₀ V₁ where rel X Y := V₀.mem X ∧ b.mem Y rel_dom h := h.1 @@ -531,7 +538,7 @@ def toMap₂ (f : ApproximableMap (prod V₀ V₁) V₂) : ApproximableMap₂ V /-- **Theorem 3.5 (←) (Scott 1981, PRG-19).** A two-variable mapping induces a joint mapping. -/ -def ofMap₂ (f : ApproximableMap₂ V₀ V₁ V₂) : ApproximableMap (prod V₀ V₁) V₂ where +@[expose] def ofMap₂ (f : ApproximableMap₂ V₀ V₁ V₂) : ApproximableMap (prod V₀ V₁) V₂ where rel W Z := (prod V₀ V₁).mem W ∧ f.rel (Sum.inl ⁻¹' W) (Sum.inr ⁻¹' W) Z rel_dom h := h.1 rel_cod h := f.rel_cod h.2 diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition53.lean b/LeanPool/DomainTheory/Neighborhood/Proposition53.lean index 5b3037f3cf..caafa2a838 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition53.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition53.lean @@ -47,7 +47,7 @@ solution `⟨a, b⟩` one derives `!x.τ(x,b) ⊑ a`, hence `outerOp(b) ⊑ b`, universal properties of `fixElement`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition54.lean b/LeanPool/DomainTheory/Neighborhood/Proposition54.lean index 04046e46fe..6d8c7cbdb5 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition54.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition54.lean @@ -51,7 +51,7 @@ permitted `ext_of_toElementMap`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition611.lean b/LeanPool/DomainTheory/Neighborhood/Proposition611.lean index be82e865a0..825053db3a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition611.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition611.lean @@ -72,7 +72,7 @@ picks witnesses of non-emptiness and uses finite-set induction), exactly as Exercise 3.27 does. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Proposition611 diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition612.lean b/LeanPool/DomainTheory/Neighborhood/Proposition612.lean index 51602eb545..95d7bd0d33 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition612.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition612.lean @@ -60,7 +60,7 @@ The element-wise descriptions Scott records are `Subsystem.toElementMap_inj` and Everything here is **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -77,7 +77,7 @@ relation, `X i Y ↔ X ∈ D ∧ Y ∈ E ∧ X ⊆ Y`. Element-wise (see `toElementMap_inj`) it is Scott's `i(x) = {Y ∈ E ∣ ∃ X ∈ x, X ⊆ Y}`. -/ -def inj (h : D ◁ E) : ApproximableMap D E where +@[expose] def inj (h : D ◁ E) : ApproximableMap D E where rel X Y := D.mem X ∧ E.mem Y ∧ X ⊆ Y rel_dom hr := hr.1 rel_cod hr := hr.2.1 @@ -100,7 +100,7 @@ Scott's `j(y) = y ∩ D`. The `inter_right` law is exactly where Definition 6.10's consistency clause (`inter_closed`) is used. -/ -def proj (h : D ◁ E) : ApproximableMap E D where +@[expose] def proj (h : D ◁ E) : ApproximableMap E D where rel Y X := E.mem Y ∧ D.mem X ∧ Y ⊆ X rel_dom hr := hr.1 rel_cod hr := hr.2.1 diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition66.lean b/LeanPool/DomainTheory/Neighborhood/Proposition66.lean index a8172aa6c2..10258ae9a3 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition66.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition66.lean @@ -28,7 +28,7 @@ realising it is the only one (`iso_hom_unique`). Choice-free (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition67.lean b/LeanPool/DomainTheory/Neighborhood/Proposition67.lean index 4e6c5b546b..0c9919c49c 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition67.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition67.lean @@ -35,7 +35,7 @@ satisfy the domain equation `D ≅ T(D)`". Choice-free (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -46,7 +46,7 @@ variable {Obj : Type u} [Category Obj] {T : Endofunctor Obj} /-- For an algebra `A = (D, i)`, the functor turns the structure map into a new `T`-algebra `(T(D), T(i))`. -/ -@[instance_reducible] +@[expose, instance_reducible] def tStr (A : TAlgebra T) : TAlgebra T where carrier := T.obj A.carrier str := T.map A.str @@ -66,13 +66,13 @@ theorem str_comp_desc (A : TAlgebra T) (hA : IsInitial A) : have h : (strHom A).comp (hA.desc (tStr A)) = AlgHom.id A := by rw [hA.uniq A ((strHom A).comp (hA.desc (tStr A))), hA.uniq A (AlgHom.id A)] have := congrArg AlgHom.hom h - exact this + simpa only [AlgHom.comp_hom, AlgHom.id_hom, strHom] using this /-- **Proposition 6.7 (Lambek's lemma; Scott 1981, PRG-19).** The structure map `i : T(D) → D` of an initial `T`-algebra is an isomorphism `T(D) ≅ D`, with inverse the descent homomorphism `j`. -/ -def lambek (A : TAlgebra T) (hA : IsInitial A) : Iso (T.obj A.carrier) A.carrier where +@[expose] def lambek (A : TAlgebra T) (hA : IsInitial A) : Iso (T.obj A.carrier) A.carrier where hom := A.str inv := (hA.desc (tStr A)).hom inv_hom_id := str_comp_desc A hA diff --git a/LeanPool/DomainTheory/Neighborhood/Proposition77.lean b/LeanPool/DomainTheory/Neighborhood/Proposition77.lean index 2a5b72fec7..cb9b5b8846 100644 --- a/LeanPool/DomainTheory/Neighborhood/Proposition77.lean +++ b/LeanPool/DomainTheory/Neighborhood/Proposition77.lean @@ -43,7 +43,7 @@ This file builds the construction in milestones: `surj` (every `𝒟^§`-neighbourhood is some `V k`), nonemptiness. All choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -386,7 +386,7 @@ def rtbl (step : ℕ → ℕ) : ℕ → ℕ /-- The course-of-values value at `w`: `g w = step (pair w (table of g below w))`. -/ def gOf (step : ℕ → ℕ) (w : ℕ) : ℕ := step (Nat.pair w (rtbl step w)) -theorem gOf_def (step : ℕ → ℕ) (w : ℕ) : gOf step w = step (Nat.pair w (rtbl step w)) := rfl +theorem gOf_def (step : ℕ → ℕ) (w : ℕ) : gOf step w = step (Nat.pair w (rtbl step w)) := by rfl /-- The reverse list of memo values `[g(w-1), …, g 0]`. -/ def gList (step : ℕ → ℕ) : ℕ → List ℕ diff --git a/LeanPool/DomainTheory/Neighborhood/Recursive.lean b/LeanPool/DomainTheory/Neighborhood/Recursive.lean index f3a2c10e48..fe5bb50ec8 100644 --- a/LeanPool/DomainTheory/Neighborhood/Recursive.lean +++ b/LeanPool/DomainTheory/Neighborhood/Recursive.lean @@ -47,7 +47,7 @@ pairing round-trips (`unpair_pair'`, `pair_unpair'`) choice-free here. Everything in this file is `⊆ {propext, Quot.sound}`. -/ -@[expose] public section +public section namespace Domain.Recursive @@ -317,7 +317,7 @@ theorem primrec_sub₂ {f g : ℕ → ℕ} (hf : Nat.Primrec f) (hg : Nat.Primre /-- Choice-free primitive-recursive **selection**: `selectFn c a b = a` if `c = 1`, `= b` if `c = 0` (for a `{0,1}`-valued `c`), via `c * a + (1 - c) * b`. -/ -def selectFn (c a b : ℕ) : ℕ := c * a + (1 - c) * b +@[expose] def selectFn (c a b : ℕ) : ℕ := c * a + (1 - c) * b @[simp] theorem selectFn_one (a b : ℕ) : selectFn 1 a b = a := by simp [selectFn] @@ -351,16 +351,19 @@ let us derive the inclusion- and equality-deciders. All choice-free. -/ /-- A unary predicate `p : ℕ → Prop` is **recursively decidable**. -/ +@[expose] def RecDecidable (p : ℕ → Prop) : Prop := ∃ f : ℕ → ℕ, Nat.Primrec f ∧ ∀ n, p n ↔ f n = 1 /-- A binary relation is recursively decidable when its `Nat.pair`-coding is. -/ +@[expose] def RecDecidable₂ (r : ℕ → ℕ → Prop) : Prop := RecDecidable fun t => r t.unpair.1 t.unpair.2 /-- A ternary relation is recursively decidable when its `Nat.pair`-coding (`pair n (pair m k)`) is. -/ +@[expose] def RecDecidable₃ (r : ℕ → ℕ → ℕ → Prop) : Prop := RecDecidable fun t => r t.unpair.1 t.unpair.2.unpair.1 t.unpair.2.unpair.2 @@ -472,10 +475,12 @@ equivalence (`REPred.of_iff`). All choice-free. -/ /-- A unary predicate `p : ℕ → Prop` is **recursively enumerable**: it is the projection of a recursively decidable relation, `p n ↔ ∃ i, q (Nat.pair i n)`. -/ +@[expose] def REPred (p : ℕ → Prop) : Prop := ∃ q : ℕ → Prop, RecDecidable q ∧ ∀ n, p n ↔ ∃ i, q (Nat.pair i n) /-- A binary relation is recursively enumerable when its `Nat.pair`-coding is. -/ +@[expose] def REPred₂ (r : ℕ → ℕ → Prop) : Prop := REPred fun t => r t.unpair.1 t.unpair.2 @@ -635,6 +640,7 @@ theorem le_pair_right (a b : ℕ) : b ≤ Nat.pair a b := by /-- Encode a list of naturals as a single natural: `[] ↦ 0`, `a :: l ↦ pair a (encodeList l) + 1`. The `+1` keeps the empty list (code `0`) distinguishable from any nonempty list. -/ +@[expose] def encodeList : List ℕ → ℕ | [] => 0 | a :: l => Nat.pair a (encodeList l) + 1 @@ -910,7 +916,7 @@ recursively decidable — choice-free, via an explicit `Nat.rec` fold of the `{0,1}` indicator. -/ /-- Indicator of `v = 1`, as a `{0,1}`-valued primitive-recursive function. -/ -def isOne (v : ℕ) : ℕ := 1 - ((v - 1) + (1 - v)) +@[expose] def isOne (v : ℕ) : ℕ := 1 - ((v - 1) + (1 - v)) theorem isOne_le_one (v : ℕ) : isOne v ≤ 1 := by unfold isOne; omega @@ -925,7 +931,7 @@ theorem primrec_isOne : Nat.Primrec isOne := /-- The `{0,1}`-valued bounded-`∀` indicator: `1` iff `g (pair i n) = 1` for all `i < N`. Folded right-to-left with `selectFn` so the result stays in `{0,1}`. -/ -def bForallFn (g : ℕ → ℕ) (n N : ℕ) : ℕ := +@[expose] def bForallFn (g : ℕ → ℕ) (n N : ℕ) : ℕ := Nat.rec (motive := fun _ => ℕ) 1 (fun i ih => selectFn ih (isOne (g (Nat.pair i n))) 0) N theorem bForallFn_le_one (g : ℕ → ℕ) (n N : ℕ) : bForallFn g n N ≤ 1 := by diff --git a/LeanPool/DomainTheory/Neighborhood/Table55.lean b/LeanPool/DomainTheory/Neighborhood/Table55.lean index 51724cccc9..2d191cef5d 100644 --- a/LeanPool/DomainTheory/Neighborhood/Table55.lean +++ b/LeanPool/DomainTheory/Neighborhood/Table55.lean @@ -61,7 +61,7 @@ established `ofIso`/`fixMap` API. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -161,6 +161,7 @@ theorem constC_eq_constMap (k : V₁.Element) : *function-space domains*, obtained from Theorem 3.10 (`funSpaceEquiv`) and Theorem 3.12 (`curryEquiv`). -/ +@[expose] def curryIso (V₀ : NeighborhoodSystem α) (V₁ : NeighborhoodSystem β) (V₂ : NeighborhoodSystem γ) : (funSpace (prod V₀ V₁) V₂).Element ≃o (funSpace V₀ (funSpace V₁ V₂)).Element := (funSpaceEquiv (prod V₀ V₁) V₂).trans diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem110.lean b/LeanPool/DomainTheory/Neighborhood/Theorem110.lean index 768ea483f5..a3cac23d49 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem110.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem110.lean @@ -42,7 +42,7 @@ Everything is constructive (`[propext, Quot.sound]`): `[X]`-membership is just filter laws mirror the constructive proofs for `principal`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -54,7 +54,7 @@ variable {α : Type*} (V : NeighborhoodSystem α) neighbourhood `X`. (This is the `basicOpen X` of Exercise 1.22, repeated here to avoid the topology dependency.) -/ -def bracket (X : Set α) : Set V.Element := {x | x.mem X} +@[expose] def bracket (X : Set α) : Set V.Element := {x | x.mem X} @[simp] theorem mem_bracket {X : Set α} {x : V.Element} : x ∈ V.bracket X ↔ x.mem X := Iff.rfl @@ -121,7 +121,7 @@ laws reduce to facts about `[·]`: the master `[Δ] = |𝒟|` is the whole space consistency witness `[W]` for `[X] ∩ [Y]` yields `W ⊆ X ∩ Y` (via `↑W`), so `X ∩ Y ∈ 𝒟` and `[X] ∩ [Y] = [X ∩ Y]`. -/ -def tokenSystem : NeighborhoodSystem V.Element where +@[expose] def tokenSystem : NeighborhoodSystem V.Element where mem S := ∃ X, V.mem X ∧ S = V.bracket X master := Set.univ master_mem := ⟨V.master, V.master_mem, V.bracket_master.symm⟩ @@ -138,7 +138,7 @@ def tokenSystem : NeighborhoodSystem V.Element where /-- The element of `|{[X]}|` corresponding to `x ∈ |𝒟|`: the filter `{[X] ∣ X ∈ x}`. -/ -def toToken (x : V.Element) : V.tokenSystem.Element where +@[expose] def toToken (x : V.Element) : V.tokenSystem.Element where mem S := ∃ X, x.mem X ∧ S = V.bracket X sub := by rintro S ⟨X, hX, rfl⟩; exact ⟨X, x.sub hX, rfl⟩ master_mem := ⟨V.master, x.master_mem, V.bracket_master.symm⟩ @@ -152,7 +152,7 @@ def toToken (x : V.Element) : V.tokenSystem.Element where /-- The element of `|𝒟|` corresponding to `y ∈ |{[X]}|`: the filter `{X ∣ [X] ∈ y}`. -/ -def ofToken (y : V.tokenSystem.Element) : V.Element where +@[expose] def ofToken (y : V.tokenSystem.Element) : V.Element where mem X := V.mem X ∧ y.mem (V.bracket X) sub h := h.1 master_mem := ⟨V.master_mem, by rw [V.bracket_master]; exact y.master_mem⟩ @@ -174,7 +174,7 @@ def ofToken (y : V.tokenSystem.Element) : V.Element where /-- **Theorem 1.10 (the isomorphism).** `X ↦ [X]` induces an order-isomorphism `|𝒟| ≃o |{[X]}|`: `toToken` and `ofToken` are mutually inverse and preserve/reflect `⊑`. -/ -def tokenIso : V.Element ≃o V.tokenSystem.Element where +@[expose] def tokenIso : V.Element ≃o V.tokenSystem.Element where toFun := V.toToken invFun := V.ofToken left_inv := by diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem111.lean b/LeanPool/DomainTheory/Neighborhood/Theorem111.lean index 691baaf6ed..2f786839b6 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem111.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem111.lean @@ -34,7 +34,7 @@ filter law (ii) Everything is constructive (`[propext, Quot.sound]`). -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem41.lean b/LeanPool/DomainTheory/Neighborhood/Theorem41.lean index 34e31289e0..42dc1c34b8 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem41.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem41.lean @@ -60,7 +60,7 @@ pulls `Classical.choice` only through the project's `ext_of_toElementMap`, as permitted. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -75,14 +75,14 @@ namespace ApproximableMap /-- **Theorem 4.1 (Scott 1981, PRG-19).** The `n`-fold composition `fⁿ` of an endomap with itself: `f⁰ = I_𝒟` and `f^{n+1} = f ∘ fⁿ`. -/ -def iterMap (f : ApproximableMap V V) : ℕ → ApproximableMap V V +@[expose] def iterMap (f : ApproximableMap V V) : ℕ → ApproximableMap V V | 0 => idMap V | (n + 1) => f.comp (f.iterMap n) -@[simp] theorem iterMap_zero (f : ApproximableMap V V) : f.iterMap 0 = idMap V := rfl +@[simp] theorem iterMap_zero (f : ApproximableMap V V) : f.iterMap 0 = idMap V := by rfl @[simp] theorem iterMap_succ (f : ApproximableMap V V) (n : ℕ) : - f.iterMap (n + 1) = f.comp (f.iterMap n) := rfl + f.iterMap (n + 1) = f.comp (f.iterMap n) := by rfl /-- Composition is monotone in both arguments. -/ theorem comp_mono {f g a b : ApproximableMap V V} (hfg : f ≤ g) (hab : a ≤ b) : @@ -136,7 +136,7 @@ Scott's: `Δ ∈ x` (the (`inter_right`) of the single iterate `f^{max n m}` reached by extending the shorter chain; upward closure is `mono`. -/ -def fixElement (f : ApproximableMap V V) : V.Element where +@[expose] def fixElement (f : ApproximableMap V V) : V.Element where mem X := ∃ n, (f.iterMap n).rel V.master X sub := fun ⟨n, h⟩ => (f.iterMap n).rel_cod h master_mem := ⟨0, show (idMap V).rel V.master V.master from (idMap V).master_rel⟩ @@ -212,7 +212,8 @@ theorem fixElement_mono {f g : ApproximableMap V V} (hfg : f ≤ g) : /-! ### Theorem 4.2(iii) — the iterates `fⁿ(⊥)`. -/ /-- The `n`-th approximant `fⁿ(⊥)` of the least fixed point. -/ -def iterElem (f : ApproximableMap V V) (n : ℕ) : V.Element := (f.iterMap n).toElementMap V.bot +@[expose] def iterElem (f : ApproximableMap V V) (n : ℕ) : V.Element := + (f.iterMap n).toElementMap V.bot /-- `Y ∈ fⁿ(⊥) ↔ Δ fⁿ Y`: the `n`-th approximant is the family of neighbourhoods reachable from diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem46.lean b/LeanPool/DomainTheory/Neighborhood/Theorem46.lean index c1f2833759..10cc3e4bb6 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem46.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem46.lean @@ -60,7 +60,7 @@ Dedekind/recursion theorem must. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem51.lean b/LeanPool/DomainTheory/Neighborhood/Theorem51.lean index ce1471d368..80c9d3d329 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem51.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem51.lean @@ -51,7 +51,7 @@ This module collects the five closure facts as concrete lemmas; everything is **choice-free**. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem52.lean b/LeanPool/DomainTheory/Neighborhood/Theorem52.lean index e81093d9bf..f1015a4119 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem52.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem52.lean @@ -46,7 +46,7 @@ uses the permitted `ext_of_toElementMap`, the *value* equations are choice-free. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem56.lean b/LeanPool/DomainTheory/Neighborhood/Theorem56.lean index 95915c72ec..7d64d09c05 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem56.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem56.lean @@ -67,7 +67,7 @@ domain `T` Theorem 4.1. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Theorem56 diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem56Full.lean b/LeanPool/DomainTheory/Neighborhood/Theorem56Full.lean index 0c1b34ec94..7dfa99c2dc 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem56Full.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem56Full.lean @@ -43,7 +43,7 @@ minimisation compose. The capstone is `partrec_lamDef` and the 1-ary corollary `partrec_one`. -/ -@[expose] public section +public section namespace Domain.Neighborhood.Theorem56Full @@ -200,7 +200,7 @@ theorem strictGuardN_strict (n : ℕ) (φ : ApproximableMap 𝒩 N) (z : 𝒩.El /-- `⟨g₀, …, g_{n-1}⟩ : 𝒩 → 𝒩` placing `gᵢ` at coordinate `i` (`< n`) and `⊥` beyond. -/ -def tupleMap : (n : ℕ) → (Fin n → ApproximableMap 𝒩 N) → ApproximableMap 𝒩 𝒩 +@[expose] def tupleMap : (n : ℕ) → (Fin n → ApproximableMap 𝒩 N) → ApproximableMap 𝒩 𝒩 | 0, _ => constMap 𝒩 𝒩.bot | n + 1, gs => (push N).comp (paired (gs 0) (tupleMap n (fun i => gs i.succ))) diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem614.lean b/LeanPool/DomainTheory/Neighborhood/Theorem614.lean index 182ff720d1..29741bc1db 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem614.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem614.lean @@ -83,7 +83,7 @@ concrete `DomainObj`s g.hom` — the `have` unifies by defeq), then `rw [← e]`. -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -157,7 +157,7 @@ uses *monotone on domains* (`MonotoneAt`) to obtain the next carrier identification and subdomain relation. Choice-free. -/ -def iter (s : Setup.{w}) : (n : ℕ) → +@[expose] def iter (s : Setup.{w}) : (n : ℕ) → Σ' (S : NeighborhoodSystem s.Tok), Σ' (ceq : (s.T.obj ⟨s.Tok, S⟩).carrier = s.Tok), S ◁ (ceq ▸ (s.T.obj ⟨s.Tok, S⟩).sys : NeighborhoodSystem s.Tok) | 0 => ⟨s.Γ, s.ceq, s.hsub⟩ @@ -170,7 +170,7 @@ def iter (s : Setup.{w}) : (n : ℕ) → rwa [rec_trans] at hsub⟩ /-- `Tⁿ({Γ})`, the `n`-th system in the tower (over `Tok`). -/ -def Dsys (s : Setup.{w}) (n : ℕ) : NeighborhoodSystem s.Tok := (iter s n).1 +@[expose] def Dsys (s : Setup.{w}) (n : ℕ) : NeighborhoodSystem s.Tok := (iter s n).1 /-- The carrier identification `(T.obj Tⁿ({Γ})).carrier = Tok`. -/ theorem Dceq (s : Setup.{w}) (n : ℕ) : (s.T.obj ⟨s.Tok, Dsys s n⟩).carrier = s.Tok := @@ -205,7 +205,7 @@ consistent intersection uses that the tower is a chain (`chain_le`): any finite collection of neighbourhoods sits inside one level `Tᴺ({Γ})`, whose own `inter_mem` finishes the job. -/ -def colim (s : Setup.{w}) : NeighborhoodSystem s.Tok where +@[expose] def colim (s : Setup.{w}) : NeighborhoodSystem s.Tok where mem X := ∃ n, (Dsys s n).mem X master := s.Γ.master master_mem := ⟨0, s.Γ.master_mem⟩ @@ -340,7 +340,7 @@ def colimIso (s : Setup.{w}) : Iso (s.T.obj ⟨s.Tok, colim s⟩) (⟨s.Tok, col isoOfEq (colimObj_eq s) /-- The colimit `𝒟` as a `T`-algebra, with structure map the iso `T(𝒟) → 𝒟`. -/ -def colimAlg (s : Setup.{w}) : TAlgebra s.T := +@[expose] def colimAlg (s : Setup.{w}) : TAlgebra s.T := ⟨⟨s.Tok, colim s⟩, (colimIso s).hom⟩ attribute [local implicit_reducible] colimAlg @@ -388,7 +388,7 @@ theorem rho_mono (s : Setup.{w}) {n m : ℕ} (h : n ≤ m) {X Y : Set s.Tok} exact ⟨hcX, hcY, z, (chain_le s h).sub hDz, hXz, hzY⟩ /-- The pointwise union `⋃ₙ ρₙ` (directed, since the chain is increasing). -/ -def iSupRho (s : Setup.{w}) : ApproximableMap (colim s) (colim s) := +@[expose] def iSupRho (s : Setup.{w}) : ApproximableMap (colim s) (colim s) := iSupMap (rho s) (fun i j => ⟨max i j, fun _ _ h => rho_mono s (le_max_left i j) h, fun _ _ h => rho_mono s (le_max_right i j) h⟩) diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem616.lean b/LeanPool/DomainTheory/Neighborhood/Theorem616.lean index 6a770c1dbe..88648f5617 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem616.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem616.lean @@ -60,7 +60,7 @@ approximant chains `H`, `G`, `K` (for `h`, `g`, `k`) and the ladder identity `H point. Lemma 6.15 (`trianglelefteq_of_projectionPair`) then closes `D ⊴ E`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem69.lean b/LeanPool/DomainTheory/Neighborhood/Theorem69.lean index bf31a1fbe7..e3f522fdcf 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem69.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem69.lean @@ -82,7 +82,7 @@ is done by `Exists.elim` while proving a `Prop`, so it stays **choice-free** (`#print axioms ⊆ {propext, Quot.sound}`). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -159,7 +159,7 @@ variable (T : Endofunctor DomainObj) (D E : DomainObj) (hj : IsStrict j) (hk : IsStrict k) /-- The strict composite `g ↦ k ∘ g ∘ j : (T(D) →⊥ T(E)) → (D →⊥ E)`. -/ -def homOpComp (g : StrictMap (T.obj D).sys (T.obj E).sys) : StrictMap D.sys E.sys := +@[expose] def homOpComp (g : StrictMap (T.obj D).sys (T.obj E).sys) : StrictMap D.sys E.sys := ⟨k.comp (g.1.comp j), isStrict_comp hk (isStrict_comp g.2 hj)⟩ theorem homOpComp_mono {g g' : StrictMap (T.obj D).sys (T.obj E).sys} (hgg : g ≤ g') : diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem74.lean b/LeanPool/DomainTheory/Neighborhood/Theorem74.lean index 260bd6487f..e3122dc19a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem74.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem74.lean @@ -53,7 +53,7 @@ development. Everything here is `⊆ {propext, Quot.sound}` (choice-free). -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -71,12 +71,12 @@ theorem prodNbhd_eq_iff {X X' : Set α} {Y Y' : Set β} : variable {V₀ : NeighborhoodSystem α} {V₁ : NeighborhoodSystem β} /-- Scott's `W_k = X⁰_{p(k)} ∪ X¹_{q(k)}` with `p = ·.unpair.1`, `q = ·.unpair.2`. -/ -def prodEnum (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) (t : ℕ) : +@[expose] def prodEnum (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) (t : ℕ) : Set (α ⊕ β) := prodNbhd (P₀.X t.unpair.1) (P₁.X t.unpair.2) @[simp] theorem prodEnum_apply (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) - (t : ℕ) : prodEnum P₀ P₁ t = prodNbhd (P₀.X t.unpair.1) (P₁.X t.unpair.2) := rfl + (t : ℕ) : prodEnum P₀ P₁ t = prodNbhd (P₀.X t.unpair.1) (P₁.X t.unpair.2) := by rfl /-- **Theorem 7.4 (Scott 1981, PRG-19) — `𝒟₀ × 𝒟₁` is effectively given.** The presentation @@ -85,7 +85,7 @@ presentation `prodNbhd_subset_iff`, into the *conjunction* of the two factors' relations on the projected indices — recursively decidable by `RecDecidable.and`/`.comp`/`.of_iff`. -/ -def prodPresentation (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) : +@[expose] def prodPresentation (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) : ComputablePresentation (prod V₀ V₁) where X := prodEnum P₀ P₁ mem_X t := prod_mem_prodNbhd (P₀.mem_X _) (P₁.mem_X _) @@ -153,7 +153,7 @@ def prodPresentation (P₀ : ComputablePresentation V₀) (P₁ : ComputablePres @[simp] theorem prodPresentation_X (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) (t : ℕ) : - (prodPresentation P₀ P₁).X t = prodNbhd (P₀.X t.unpair.1) (P₁.X t.unpair.2) := rfl + (prodPresentation P₀ P₁).X t = prodNbhd (P₀.X t.unpair.1) (P₁.X t.unpair.2) := by rfl /-- **Theorem 7.4 (Scott 1981, PRG-19).** The product of effectively given domains is effectively diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem75.lean b/LeanPool/DomainTheory/Neighborhood/Theorem75.lean index 1ad2b683b2..7d08dccbea 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem75.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem75.lean @@ -56,7 +56,7 @@ it needs with the decider.) -/ -@[expose] public section +public section namespace Domain.Neighborhood @@ -70,7 +70,7 @@ base). -/ /-- The intersection of the sets in `M`, taken inside the base set `base` (so the empty list gives `base`, matching the convention 1.1a where the empty intersection is `Δ`). -/ -def interList (base : Set β) : List (Set β) → Set β +@[expose] def interList (base : Set β) : List (Set β) → Set β | [] => base | Y :: M => Y ∩ interList base M @@ -156,13 +156,13 @@ by the presentation variable (P₀ : ComputablePresentation V₀) (P₁ : ComputablePresentation V₁) /-- The step pair coded by an entry `e`: `(X_{e.unpair.1}, Y_{e.unpair.2})`. -/ -def funPair (e : ℕ) : Set α × Set β := (P₀.X e.unpair.1, P₁.X e.unpair.2) +@[expose] def funPair (e : ℕ) : Set α × Set β := (P₀.X e.unpair.1, P₁.X e.unpair.2) @[simp] theorem funPair_fst (e : ℕ) : (funPair P₀ P₁ e).1 = P₀.X e.unpair.1 := rfl @[simp] theorem funPair_snd (e : ℕ) : (funPair P₀ P₁ e).2 = P₁.X e.unpair.2 := rfl /-- The list of step pairs coded by an entry-list `el`. -/ -def funListOf (el : List ℕ) : List (Set α × Set β) := el.map (funPair P₀ P₁) +@[expose] def funListOf (el : List ℕ) : List (Set α × Set β) := el.map (funPair P₀ P₁) theorem funListOf_valid (el : List ℕ) : ∀ p ∈ funListOf P₀ P₁ el, V₀.mem p.1 ∧ V₁.mem p.2 := by @@ -369,7 +369,7 @@ predicate is recursively decidable (`RecDecidable.bForall`). All choice-free. -/ /-- The sublist of `L` selected by the bitmask `b` (low bit = head). -/ -def bitSelect : List ℕ → ℕ → List ℕ +@[expose] def bitSelect : List ℕ → ℕ → List ℕ | [], _ => [] | e :: L, b => if b % 2 = 1 then e :: bitSelect L (b / 2) else bitSelect L (b / 2) @@ -1298,7 +1298,7 @@ where `gN` is the consistency char) the neighbourhood is `stepFun (funListOf otherwise we send the junk code to the master neighbourhood `univ`. Choice-free as *data* because the branch is a `Nat`-equality `if`. -/ -def Xenum (gN : ℕ → ℕ) (c : ℕ) : Set (ApproximableMap V₀ V₁) := +@[expose] def Xenum (gN : ℕ → ℕ) (c : ℕ) : Set (ApproximableMap V₀ V₁) := if gN c = 1 then stepFun (funListOf P₀ P₁ (decodeList c)) else Set.univ theorem Xenum_pos {gN : ℕ → ℕ} {c : ℕ} (h : gN c = 1) : @@ -1538,7 +1538,7 @@ functions for the component presentations' relations (`gN` = function-space consistency, `incl0`/`incl1` = inclusion, `eq1` = equality), so it is choice-free given those concrete functions. -/ -def funPresentation (gN incl0 incl1 eq1 : ℕ → ℕ) +@[expose] def funPresentation (gN incl0 incl1 eq1 : ℕ → ℕ) (hgN : ∀ c, gN c = 1 ↔ (stepFun (funListOf P₀ P₁ (decodeList c)) : Set (ApproximableMap V₀ V₁)).Nonempty) (hgNp : Nat.Primrec gN) (hincl0 : ∀ s, incl0 s = 1 ↔ P₀.X s.unpair.1 ⊆ P₀.X s.unpair.2) (hincl0p : Nat.Primrec incl0) diff --git a/LeanPool/DomainTheory/Neighborhood/Theorem76.lean b/LeanPool/DomainTheory/Neighborhood/Theorem76.lean index d7a03fa284..b84ed8629a 100644 --- a/LeanPool/DomainTheory/Neighborhood/Theorem76.lean +++ b/LeanPool/DomainTheory/Neighborhood/Theorem76.lean @@ -71,7 +71,7 @@ the flag together with the final inclusion `X_{last} ⊆ X_ℓ`. Everything audi `⊆ {propext, Quot.sound}`. -/ -@[expose] public section +public section namespace Domain.Neighborhood diff --git a/LeanPool/Duality.lean b/LeanPool/Duality.lean index 8c8cd28820..dcb6b5d41e 100644 --- a/LeanPool/Duality.lean +++ b/LeanPool/Duality.lean @@ -30,7 +30,7 @@ Tags: linear-programming, optimization, farkas-lemma MSC: 90C05, 90C46 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Duality/Common.lean b/LeanPool/Duality/Common.lean index 189b21a891..799b09cdb4 100644 --- a/LeanPool/Duality/Common.lean +++ b/LeanPool/Duality/Common.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Group.Defs # LeanPool.Duality.Common -/ -@[expose] public section +public section section finset_sums variable {α β : Type*} diff --git a/LeanPool/Duality/ExtendedFields.lean b/LeanPool/Duality/ExtendedFields.lean index 85880bb701..0cb0e1c835 100644 --- a/LeanPool/Duality/ExtendedFields.lean +++ b/LeanPool/Duality/ExtendedFields.lean @@ -16,11 +16,11 @@ This entire file is inspired by: https://github.com/leanprover-community/mathlib4/blob/333e2d79fdaee86489af73dee919bc4b66957a52/Mathlib/Data/Real/EReal.lean -/ -@[expose] public section +public section /-- `Extend F` is the type of values in `F ∪ {⊥, ⊤}` where, informally speaking, `⊥` (negative infinity) is stronger than `⊤` (positive infinity). -/ -def Extend (F : Type*) := WithBot (WithTop F) +@[expose] def Extend (F : Type*) := WithBot (WithTop F) variable {F : Type*} [Field F] [LinearOrder F] [IsStrictOrderedRing F] @@ -50,7 +50,7 @@ instance : DecidableRel ((· < ·) : Extend F → Extend F → Prop) := WithBot. /-- The canonical inclusion from `F` to `Extend F` is registered as a coercion. -/ -@[coe] def toE : F → Extend F := some ∘ some +@[expose, coe] def toE : F → Extend F := some ∘ some instance : Coe F (Extend F) := ⟨toE⟩ @@ -91,11 +91,11 @@ lemma coe_neq_coe_iff {x y : F} : (x : Extend F) ≠ (y : Extend F) ↔ x ≠ y omit [LinearOrder F] [IsStrictOrderedRing F] in @[simp, norm_cast] -lemma coe_zero : ((0 : F) : Extend F) = 0 := rfl +lemma coe_zero : ((0 : F) : Extend F) = 0 := by rfl omit [LinearOrder F] [IsStrictOrderedRing F] in @[simp, norm_cast] -lemma coe_one : ((1 : F) : Extend F) = 1 := rfl +lemma coe_one : ((1 : F) : Extend F) = 1 := by rfl omit [Field F] [IsStrictOrderedRing F] in @[simp] @@ -159,8 +159,7 @@ lemma top_neq_zero : (⊤ : Extend F) ≠ 0 := omit [LinearOrder F] [IsStrictOrderedRing F] in @[simp, norm_cast] -lemma coe_add (x y : F) : toE (x + y) = toE x + toE y := - rfl +lemma coe_add (x y : F) : toE (x + y) = toE x + toE y := by rfl omit [IsStrictOrderedRing F] in @[simp, norm_cast] @@ -225,17 +224,17 @@ lemma top_add_top : (⊤ : Extend F) + ⊤ = ⊤ := omit [IsStrictOrderedRing F] in @[simp] lemma top_add_coe (x : F) : (⊤ : Extend F) + x = ⊤ := - rfl + by rfl omit [IsStrictOrderedRing F] in @[simp] lemma coe_add_top (x : F) : (x : Extend F) + ⊤ = ⊤ := - rfl + by rfl /-! ### Negation -/ /-- Negation on `Extend F`. -/ -def neg : Extend F → Extend F +@[expose] def neg : Extend F → Extend F | ⊥ => ⊤ | ⊤ => ⊥ | (x : F) => toE (-x) @@ -249,16 +248,16 @@ instance : SubNegZeroMonoid (Extend F) where omit [IsStrictOrderedRing F] in @[simp] lemma neg_top : -(⊤ : Extend F) = ⊥ := - rfl + by rfl omit [IsStrictOrderedRing F] in @[simp] lemma neg_bot : -(⊥ : Extend F) = ⊤ := - rfl + by rfl omit [IsStrictOrderedRing F] in @[simp, norm_cast] -lemma coe_neg (x : F) : toE (-x) = -(toE x) := rfl +lemma coe_neg (x : F) : toE (-x) = -(toE x) := by rfl instance : InvolutiveNeg (Extend F) where neg_neg a := diff --git a/LeanPool/Duality/FarkasBartl.lean b/LeanPool/Duality/FarkasBartl.lean index e2bd5ff9ed..0628c5a393 100644 --- a/LeanPool/Duality/FarkasBartl.lean +++ b/LeanPool/Duality/FarkasBartl.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Abel # LeanPool.Duality.FarkasBartl -/ -@[expose] public section +public section private def withoutLastMap {m : ℕ} {R W : Type*} [Semiring R] [AddCommMonoid W] [Module R W] (A : W →ₗ[R] Fin m.succ → R) : diff --git a/LeanPool/Duality/FarkasBasic.lean b/LeanPool/Duality/FarkasBasic.lean index 54802e1759..e179abb7d7 100644 --- a/LeanPool/Duality/FarkasBasic.lean +++ b/LeanPool/Duality/FarkasBasic.lean @@ -21,7 +21,7 @@ import Mathlib.LinearAlgebra.Matrix.ToLin # LeanPool.Duality.FarkasBasic -/ -@[expose] public section +public section /- Let's move from linear maps to matrices, which give more familiar (albeit less general) formulations of the theorems of alternative. -/ diff --git a/LeanPool/Duality/FarkasSpecial.lean b/LeanPool/Duality/FarkasSpecial.lean index d2a4cb72bb..1bffc4ebdd 100644 --- a/LeanPool/Duality/FarkasSpecial.lean +++ b/LeanPool/Duality/FarkasSpecial.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow # LeanPool.Duality.FarkasSpecial -/ -@[expose] public section +public section section notation_EF @@ -67,7 +67,7 @@ section extras_EF /-- Scalar action of a nonnegative scalar on `F∞`: `c • ⊥ = ⊥`, `c • ⊤ = ⊤` when `c > 0` (and `c • ⊤ = 0` when `c = 0`), and `c • (f : F) = c * f` on finite values. -/ -def EF.smulNN (c : F≥0) : F∞ → F∞ +@[expose] def EF.smulNN (c : F≥0) : F∞ → F∞ | ⊥ => ⊥ | ⊤ => if c = 0 then 0 else ⊤ | (f : F) => toE (c.val * f) @@ -95,7 +95,7 @@ lemma EF.smul_coe_neq_bot (c : F≥0) (f : F) : c • toE f ≠ (⊥ : F∞) := omit [IsStrictOrderedRing F] in lemma EF.smul_bot (c : F≥0) : c • (⊥ : F∞) = ⊥ := - rfl + by rfl lemma EF.smul_nonbot_neq_bot (c : F≥0) {r : F∞} (hr : r ≠ ⊥) : c • r ≠ ⊥ := by match r with @@ -190,7 +190,7 @@ variable {α γ : Type*} [AddCommMonoid α] [SMul γ α] but heterogeneous (mnemonic: "vector times weights"). Note that the order of arguments (also with the infix notation) is opposite than in the `SMul` it builds upon. -/ -def dotWeig (v : I → α) (w : I → γ) : α := ∑ i : I, w i • v i +@[expose] def dotWeig (v : I → α) (w : I → γ) : α := ∑ i : I, w i • v i @[inherit_doc dotWeig] infixl:72 " ᵥ⬝ " => dotWeig @@ -199,7 +199,7 @@ infixl:72 " ᵥ⬝ " => dotWeig `Matrix.mulVec M w` (mnemonic: "matrix times weights"). Note that the order of arguments (also with the infix notation) is opposite than in the `SMul` it builds upon. -/ -def Matrix.mulWeig (M : Matrix I J α) (w : J → γ) (i : I) : α := +@[expose] def Matrix.mulWeig (M : Matrix I J α) (w : J → γ) (i : I) : α := M i ᵥ⬝ w @[inherit_doc Matrix.mulWeig] diff --git a/LeanPool/Duality/LinearProgramming.lean b/LeanPool/Duality/LinearProgramming.lean index fdb455acf9..98a3a1d55d 100644 --- a/LeanPool/Duality/LinearProgramming.lean +++ b/LeanPool/Duality/LinearProgramming.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.OfScientific # LeanPool.Duality.LinearProgramming -/ -@[expose] public section +public section /-- Linear program over `F∞` in the standard form (i.e., a system of linear inequalities with nonnegative variables). @@ -60,31 +60,31 @@ section extended_LP_definitions /-- A nonnegative vector `x` is a solution to a linear program `P` iff its multiplication by matrix `A` from the left yields a vector whose all entries are less or equal to corresponding entries of the vector `b`. -/ -def ExtendedLP.IsSolution [Fintype J] (P : ExtendedLP I J F) (x : J → F≥0) : Prop := +@[expose] def ExtendedLP.IsSolution [Fintype J] (P : ExtendedLP I J F) (x : J → F≥0) : Prop := P.A ₘ* x ≤ P.b /-- Linear program `P` reaches objective value `r` iff there is a solution `x` such that, when its entries are elementwise multiplied by the the coefficients `c` and summed up, the result is the value `r`. -/ -def ExtendedLP.Reaches [Fintype J] (P : ExtendedLP I J F) (r : F∞) : Prop := +@[expose] def ExtendedLP.Reaches [Fintype J] (P : ExtendedLP I J F) (r : F∞) : Prop := ∃ x : J → F≥0, P.IsSolution x ∧ P.c ᵥ⬝ x = r /-- Linear program `P` is feasible iff `P` reaches a value that is not `⊤`. -/ -def ExtendedLP.IsFeasible [Fintype J] (P : ExtendedLP I J F) : Prop := +@[expose] def ExtendedLP.IsFeasible [Fintype J] (P : ExtendedLP I J F) : Prop := ∃ p : F∞, P.Reaches p ∧ p ≠ ⊤ /-- Linear program `P` is bounded by `r` iff every value reached by `P` is greater or equal to `r` (i.e., `P` is bounded by `r` from below). -/ -def ExtendedLP.IsBoundedBy [Fintype J] (P : ExtendedLP I J F) (r : F) : Prop := +@[expose] def ExtendedLP.IsBoundedBy [Fintype J] (P : ExtendedLP I J F) (r : F) : Prop := ∀ p : F∞, P.Reaches p → r ≤ p /-- Linear program `P` is unbounded iff values reached by `P` have no finite lower bound. -/ -def ExtendedLP.IsUnbounded [Fintype J] (P : ExtendedLP I J F) : Prop := +@[expose] def ExtendedLP.IsUnbounded [Fintype J] (P : ExtendedLP I J F) : Prop := ¬∃ r : F, P.IsBoundedBy r open scoped Classical in /-- Extended notion of "optimum" of "minimization LP" (the less the better). -/ -noncomputable def ExtendedLP.optimum [Fintype J] (P : ExtendedLP I J F) : Option F∞ := +@[expose] noncomputable def ExtendedLP.optimum [Fintype J] (P : ExtendedLP I J F) : Option F∞ := if ¬P.IsFeasible then some ⊤ -- infeasible means that the minimum is `⊤` else @@ -110,7 +110,7 @@ abbrev ExtendedLP.dualize (P : ExtendedLP I J F) : ExtendedLP J I F := ⟨-P.Aᵀ, P.c, P.b⟩ /-- Dualize a valid extended linear program. -/ -def ValidELP.dualize (P : ValidELP I J F) : ValidELP J I F where +@[expose] def ValidELP.dualize (P : ValidELP I J F) : ValidELP J I F where toExtendedLP := P.toExtendedLP.dualize hAi := by aeply P.hAj hAj := by aeply P.hAi diff --git a/LeanPool/Duality/LinearProgrammingB.lean b/LeanPool/Duality/LinearProgrammingB.lean index e6e4282bd0..0d4932b7c8 100644 --- a/LeanPool/Duality/LinearProgrammingB.lean +++ b/LeanPool/Duality/LinearProgrammingB.lean @@ -21,7 +21,7 @@ linear programs. The only exception is the weak duality theorem, which is proved to allow weaker assumptions. -/ -@[expose] public section +public section /-- Linear program in the standard form. Variables are of type `J`. Conditions are indexed by diff --git a/LeanPool/EcTateLean.lean b/LeanPool/EcTateLean.lean index 488997ad0d..e139e1f139 100644 --- a/LeanPool/EcTateLean.lean +++ b/LeanPool/EcTateLean.lean @@ -31,7 +31,7 @@ Tags: number-theory, elliptic-curves, algebraic-geometry MSC: 11G05, 11G07, 14H52 -/ -@[expose] public section +public section /-! This is the foundational layer of the `ec-tate-lean` formalization of Tate's diff --git a/LeanPool/EcTateLean/Algebra/CharP/Basic.lean b/LeanPool/EcTateLean/Algebra/CharP/Basic.lean index f6c08be2d3..20ea4c599a 100644 --- a/LeanPool/EcTateLean/Algebra/CharP/Basic.lean +++ b/LeanPool/EcTateLean/Algebra/CharP/Basic.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.CharP.Lemmas Imported Lean Pool material for `LeanPool.EcTateLean.Algebra.CharP.Basic`. -/ -@[expose] public section +public section lemma ringChar_is_zero_or_prime (R : Type _) [NonAssocSemiring R] [NoZeroDivisors R] [Nontrivial R] : ringChar R = 0 ∨ Nat.Prime (ringChar R) := diff --git a/LeanPool/EcTateLean/Algebra/EllipticCurve/AuxRingLemmas.lean b/LeanPool/EcTateLean/Algebra/EllipticCurve/AuxRingLemmas.lean index 0f77bb7adf..acdc4191c9 100644 --- a/LeanPool/EcTateLean/Algebra/EllipticCurve/AuxRingLemmas.lean +++ b/LeanPool/EcTateLean/Algebra/EllipticCurve/AuxRingLemmas.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Ring.RingNF Imported Lean Pool material for `LeanPool.EcTateLean.Algebra.EllipticCurve.AuxRingLemmas`. -/ -@[expose] public section +public section section ring_lemmas diff --git a/LeanPool/EcTateLean/Algebra/EllipticCurve/KodairaTypes.lean b/LeanPool/EcTateLean/Algebra/EllipticCurve/KodairaTypes.lean index 07cd5aaf60..875822e67b 100644 --- a/LeanPool/EcTateLean/Algebra/EllipticCurve/KodairaTypes.lean +++ b/LeanPool/EcTateLean/Algebra/EllipticCurve/KodairaTypes.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Lemma Imported Lean Pool material for `LeanPool.EcTateLean.Algebra.EllipticCurve.KodairaTypes`. -/ -@[expose] public section +public section -- For imperfect residue fields of characteristic 2 or 3 there are new types: -- Z1, Z2, X1, X2, Y1, Y2, Y3, K n (n ≥ 2), K' n (even n ≥ 2), T n (n ≥ 1) diff --git a/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean b/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean index aaeecbf0c1..6f37175fdc 100644 --- a/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean +++ b/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.Push Imported Lean Pool material for `LeanPool.EcTateLean.Algebra.EllipticCurve.Kronecker`. -/ -@[expose] public section +public section open Nat diff --git a/LeanPool/EcTateLean/Algebra/EllipticCurve/Model.lean b/LeanPool/EcTateLean/Algebra/EllipticCurve/Model.lean index 1dc1d81d0a..42ca7beb8a 100644 --- a/LeanPool/EcTateLean/Algebra/EllipticCurve/Model.lean +++ b/LeanPool/EcTateLean/Algebra/EllipticCurve/Model.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.EcTateLean.Algebra.EllipticCurve.Model`. -/ -@[expose] public section +public section -- import Aesop @@ -161,7 +161,7 @@ def rstTransform := {urst : urstTransform R // urst.u = 1} --TODO instance Group /-- The Weierstrass model obtained from `e` by the change of coordinates `(1, r, s, t)`. -/ -def rstIso (r s t : R) (e : Model R) : Model R := +@[expose] def rstIso (r s t : R) (e : Model R) : Model R := { a1 := e.a1 + 2*s a2 := e.a2 - s*e.a1 + 3*r - s*s a3 := e.a3 + r*e.a1 + 2*t @@ -211,7 +211,7 @@ lemma rst_discr (r s t : R) (e : Model R) : (rstIso r s t e).discr = e.discr := variable {S : Type u} [CommRing S] (f : R →+* S) /-- Pushes a Weierstrass model forward along a ring homomorphism `f`. -/ -@[simps] +@[expose, simps] def map : Model R → Model S := fun e => ⟨f e.a1, f e.a2, f e.a3, f e.a4, f e.a6⟩ @[simp] lemma map_b2 : (map f e).b2 = f e.b2 := by simp [Model.b2, map_ofNat] @@ -336,7 +336,7 @@ theorem dweierstrassDy_iso_eq_varChange (e : Model R) (P : R × R) : /-- The change of coordinates `(1, r, s, t)` applied to `e`, with the triple `rst = (r, s, t)` packaged as a single argument. -/ -def rstTriple (e : Model R) (rst : R × R × R) : Model R := +@[expose] def rstTriple (e : Model R) (rst : R × R × R) : Model R := rstIso rst.fst rst.snd.fst rst.snd.snd e lemma rstIso_to_triple (e : Model R) (r s t : R) : rstIso r s t e = rstTriple e (r, s, t) := rfl @@ -354,7 +354,7 @@ variable {R : Type u} [CommRing R] instance [Repr R] : Repr (ValidModel R) := ⟨fun (e : ValidModel R) _ => repr e.toModel⟩ /-- The valid model obtained from `e` by the change of coordinates `(1, r, s, t)`. -/ -@[simps!] +@[expose, simps!] def rstIso (r s t : R) (e : ValidModel R) : ValidModel R := { toModel := Model.rstIso r s t e.toModel, discr_not_zero := by @@ -419,7 +419,7 @@ lemma st_of_b8 (e : ValidModel R) (s t : R) : (rstIso 0 s t e).b8 = e.b8 := by /-- The change of coordinates `(1, r, s, t)` applied to the valid model `e`, with the triple `rst = (r, s, t)` packaged as a single argument. -/ -def rstTriple (e : ValidModel R) (rst : R × R × R) : ValidModel R := +@[expose] def rstTriple (e : ValidModel R) (rst : R × R × R) : ValidModel R := rstIso rst.fst rst.snd.fst rst.snd.snd e lemma rstIso_to_triple (e : ValidModel R) (r s t : R) : rstIso r s t e = rstTriple e (r, s, t) := diff --git a/LeanPool/EcTateLean/Algebra/Ring/Basic.lean b/LeanPool/EcTateLean/Algebra/Ring/Basic.lean index 1e928b9d47..a494891cb2 100644 --- a/LeanPool/EcTateLean/Algebra/Ring/Basic.lean +++ b/LeanPool/EcTateLean/Algebra/Ring/Basic.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.EcTateLean.Algebra.Ring.Basic`. -/ -@[expose] public section +public section diff --git a/LeanPool/EcTateLean/FieldTheory/PerfectClosure.lean b/LeanPool/EcTateLean/FieldTheory/PerfectClosure.lean index 889e1a5fbf..4ce54b4643 100644 --- a/LeanPool/EcTateLean/FieldTheory/PerfectClosure.lean +++ b/LeanPool/EcTateLean/FieldTheory/PerfectClosure.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.EcTateLean.FieldTheory.PerfectClosure`. -/ -@[expose] public section +public section namespace ECTate /-- A perfect ring is one where raising to the power of the ring characteristic is a bijection diff --git a/LeanPool/EcTateLean/Init/Data/Int/Lemmas.lean b/LeanPool/EcTateLean/Init/Data/Int/Lemmas.lean index 365c192f00..69ab75a5be 100644 --- a/LeanPool/EcTateLean/Init/Data/Int/Lemmas.lean +++ b/LeanPool/EcTateLean/Init/Data/Int/Lemmas.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Lemma Imported Lean Pool material for `LeanPool.EcTateLean.Init.Data.Int.Lemmas`. -/ -@[expose] public section +public section lemma mod_neg_right (m k : Int) : m % (-k) = m % k := by simp lemma div_neg_right (m k : Int) : m / (-k) = -(m / k) := by simp diff --git a/LeanPool/Egrs75.lean b/LeanPool/Egrs75.lean index 047712cadb..c99067678c 100644 --- a/LeanPool/Egrs75.lean +++ b/LeanPool/Egrs75.lean @@ -37,4 +37,4 @@ Tags: number-theory, central-binomial-coefficients, digit-representations, erdos MSC: 11A63, 11B65 -/ -@[expose] public section +public section diff --git a/LeanPool/Egrs75/AddBranch.lean b/LeanPool/Egrs75/AddBranch.lean index c456b6f625..da47148ecb 100644 --- a/LeanPool/Egrs75/AddBranch.lean +++ b/LeanPool/Egrs75/AddBranch.lean @@ -57,7 +57,7 @@ not attempted. Recon: ~/Knowledge/Construct/recon/erdos_376.md. Imports only the pre-existing kernel-clean files; modifies none of them. -/ -@[expose] public section +public section namespace Egrs75.ClearingP2 diff --git a/LeanPool/Egrs75/BadPrefixRoute.lean b/LeanPool/Egrs75/BadPrefixRoute.lean index f944608782..f8958037af 100644 --- a/LeanPool/Egrs75/BadPrefixRoute.lean +++ b/LeanPool/Egrs75/BadPrefixRoute.lean @@ -80,7 +80,7 @@ existing clean file. Formalizes the KNOWN theorem EGRS75 (1975); three primes i Erdős #376 (OPEN) — not attempted. -/ -@[expose] public section +public section namespace Egrs75.Finish diff --git a/LeanPool/Egrs75/CentralBinomialDigits.lean b/LeanPool/Egrs75/CentralBinomialDigits.lean index 3f2e333639..c3d2a832df 100644 --- a/LeanPool/Egrs75/CentralBinomialDigits.lean +++ b/LeanPool/Egrs75/CentralBinomialDigits.lean @@ -38,7 +38,7 @@ The carry machinery below is the general-base-`p` analogue of the base-3 doubling transducer already proven in ConcreteMath/CarryTransducerCorrectness.lean. -/ -@[expose] public section +public section namespace Egrs75.Erdos376 @@ -49,7 +49,7 @@ open Nat /-- `LowDoubleDigits p n`: doubling `n` in base `p` produces no carry, i.e. every base-`p` digit `d` of `n` satisfies `2*d < p`. For `p = 3` this is "all digits ≤ 1", for `p = 5` "≤ 2", for `p = 7` "≤ 3". -/ -def LowDoubleDigits (p n : ℕ) : Prop := ∀ d ∈ Nat.digits p n, 2 * d < p +@[expose] def LowDoubleDigits (p n : ℕ) : Prop := ∀ d ∈ Nat.digits p n, 2 * d < p /-! ## General-base doubling carry transducer diff --git a/LeanPool/Egrs75/ClearingHigh.lean b/LeanPool/Egrs75/ClearingHigh.lean index f7b5f5c8e4..343ea175c7 100644 --- a/LeanPool/Egrs75/ClearingHigh.lean +++ b/LeanPool/Egrs75/ClearingHigh.lean @@ -17,7 +17,7 @@ top oversized base-`q` digit), a fresh `LowDigits p` window number drawn from clearing dichotomy; the low case is the μ-measure machine in `MuFinish`. -/ -@[expose] public section +public section namespace Egrs75.Probe diff --git a/LeanPool/Egrs75/ConditionThreeWindow.lean b/LeanPool/Egrs75/ConditionThreeWindow.lean index addbd91aab..75a0098574 100644 --- a/LeanPool/Egrs75/ConditionThreeWindow.lean +++ b/LeanPool/Egrs75/ConditionThreeWindow.lean @@ -54,7 +54,7 @@ Reuses (does not reprove) the imported base-`q` digit machinery. Formalizes the theorem EGRS75 (1975). Three primes is Erdős #376 (OPEN) — not attempted. -/ -@[expose] public section +public section namespace Egrs75.P4 @@ -154,7 +154,7 @@ of range they read `0 < B` for `q ≥ 3`). We expose it via `Nat.find`, supplyi existence proof. -/ /-- The strictly-good base-`q` digit predicate at index `i`: `n / q^i % q < (q-1)/2`. -/ -def StrictGoodAt (q i n : ℕ) : Prop := n / q ^ i % q < (q - 1) / 2 +@[expose] def StrictGoodAt (q i n : ℕ) : Prop := n / q ^ i % q < (q - 1) / 2 instance (q i n : ℕ) : Decidable (StrictGoodAt q i n) := by unfold StrictGoodAt; infer_instance @@ -181,6 +181,12 @@ defined for `q ≥ 3` and a positive bad count. Carries the existence witness. noncomputable def leastGoodAbove {q n : ℕ} (hq : 3 ≤ q) (hbad : 0 < badCountQ q n) : ℕ := Nat.find (exists_strictGood_above hq hbad) +/-- Any strictly good index above the top bad index bounds the least such index. -/ +theorem leastGoodAbove_le {q n k : ℕ} (hq : 3 ≤ q) (hbad : 0 < badCountQ q n) + (h_top : topBadIndex q n < k) (h_good : StrictGoodAt q k n) : + leastGoodAbove hq hbad ≤ k := + Nat.find_min' _ ⟨h_top, h_good⟩ + /-- `leastGoodAbove` lies strictly above the top bad index (KERNEL-CLEAN). -/ theorem topBad_lt_leastGoodAbove {q n : ℕ} (hq : 3 ≤ q) (hbad : 0 < badCountQ q n) : topBadIndex q n < leastGoodAbove hq hbad := diff --git a/LeanPool/Egrs75/Defs.lean b/LeanPool/Egrs75/Defs.lean index 03af7a29a5..1837709e9a 100644 --- a/LeanPool/Egrs75/Defs.lean +++ b/LeanPool/Egrs75/Defs.lean @@ -35,7 +35,7 @@ Recon / context: MATH CONTEXT block in the run prompt; #376 recon at DO NOT reprove Kummer — reuse the imports below. -/ -@[expose] public section +public section namespace Egrs75 @@ -48,7 +48,7 @@ This is the Kummer no-carry condition for doubling `n` in base `p` (`p ∤ C(2n,n)`). For an **odd** prime `p`, `d ≤ (p-1)/2 ↔ 2*d < p`, so it is the same predicate as #376's `LowDoubleDigits p n := ∀ d ∈ digits p n, 2*d < p` (see `lowDigits_iff_lowDoubleDigits` below). -/ -def LowDigits (p n : ℕ) : Prop := ∀ d ∈ Nat.digits p n, d ≤ (p - 1) / 2 +@[expose] def LowDigits (p n : ℕ) : Prop := ∀ d ∈ Nat.digits p n, d ≤ (p - 1) / 2 /-- For an **odd** prime `p`, the per-digit bound `2*d < p` (the #376 form, i.e. "doubling produces no carry") is equivalent to `d ≤ (p-1)/2` (the `LowDigits` diff --git a/LeanPool/Egrs75/DigitAtToolkit.lean b/LeanPool/Egrs75/DigitAtToolkit.lean index 80bf4d6dc9..f761c120ed 100644 --- a/LeanPool/Egrs75/DigitAtToolkit.lean +++ b/LeanPool/Egrs75/DigitAtToolkit.lean @@ -45,7 +45,7 @@ no circularity. This formalizes the KNOWN 1975 theorem; it is not an open proble Imports only kernel-clean material; does NOT modify any existing clean file. -/ -@[expose] public section +public section namespace Egrs75.RepairPaperfaithful @@ -56,7 +56,7 @@ open Egrs75.LeafInduction /-! ## Per-index characterization of `LowDigits` -/ /-- The base-`p` digit of `n` at index `i`. -/ -def digitAt (p i n : ℕ) : ℕ := n / p ^ i % p +@[expose] def digitAt (p i n : ℕ) : ℕ := n / p ^ i % p /-- `LowDigits p n` iff every indexed base-`p` digit is `≤ (p-1)/2`. Out-of-range indices give digit `0 ≤ (p-1)/2`, so the quantifier is over all `i`. -/ @@ -128,7 +128,7 @@ imported clean). A positive count means there is at least one oversized base-`q` digit; we extract the highest such index, which is where the EGRS repair acts. -/ /-- A base-`q` digit of `n` is "bad" if it exceeds `(q-1)/2`. -/ -def BadAt (q i n : ℕ) : Prop := (q - 1) / 2 < digitAt q i n +@[expose] def BadAt (q i n : ℕ) : Prop := (q - 1) / 2 < digitAt q i n /-- If `badCountQ q n > 0` then some base-`q` digit index is bad, and there is a greatest such index. (Bad indices are bounded by the length of the digit list, so diff --git a/LeanPool/Egrs75/DigitVector.lean b/LeanPool/Egrs75/DigitVector.lean index b7cd54a012..8edaa2727f 100644 --- a/LeanPool/Egrs75/DigitVector.lean +++ b/LeanPool/Egrs75/DigitVector.lean @@ -40,7 +40,7 @@ hypothesis. Formalizes the KNOWN theorem EGRS75 (Math. Comp. 29 (1975), the rep Lemma p.84, case `κ₁ = κ₂ = 1/2`). Three primes is Erdős #376 (OPEN); not attempted. -/ -@[expose] public section +public section namespace Egrs75.RepairDV @@ -51,7 +51,7 @@ open Egrs75.LeafInduction /-! ## Local notation and the "oversized digit" predicate -/ /-- The base-`q` "oversized" test: a digit `d` is oversized iff `(q-1)/2 < d`. -/ -@[reducible] def bigQ (q d : ℕ) : Bool := decide ((q - 1) / 2 < d) +@[reducible, expose] def bigQ (q d : ℕ) : Bool := decide ((q - 1) / 2 < d) /-- `badCountQ` unfolded as a filter-length over the base-`q` digit list. -/ theorem badCountQ_eq (q n : ℕ) : @@ -135,7 +135,7 @@ containing the bad digit at `j`; high block = digits `> j`, all good). -/ /-- The (decidable, finite, nonempty) set of oversized base-`q` digit positions of `n`, as indices into the digit list. `i` is oversized iff `(q-1)/2 < n / q^i % q` (= the `i`-th base-`q` digit) and `i < length`. -/ -def badIndexSet (q n : ℕ) : Finset ℕ := +@[expose] def badIndexSet (q n : ℕ) : Finset ℕ := (Finset.range (Nat.digits q n).length).filter (fun i => bigQ q ((Nat.digits q n).getD i 0)) /-- If the bad count is positive, the bad-index set is nonempty. -/ diff --git a/LeanPool/Egrs75/Instances.lean b/LeanPool/Egrs75/Instances.lean index 874a104c2d..6dd20e7cdf 100644 --- a/LeanPool/Egrs75/Instances.lean +++ b/LeanPool/Egrs75/Instances.lean @@ -22,7 +22,7 @@ satisfiable (no hidden vacuity) and that the closure is usable downstream. All three MUST be kernel-clean. -/ -@[expose] public section +public section namespace Egrs75.SmokeProbe diff --git a/LeanPool/Egrs75/KummerValuation.lean b/LeanPool/Egrs75/KummerValuation.lean index c01c795517..4f6eba804c 100644 --- a/LeanPool/Egrs75/KummerValuation.lean +++ b/LeanPool/Egrs75/KummerValuation.lean @@ -21,7 +21,7 @@ Erdos117 squarefree-central-binomial scaffold. Keeping them here makes the ConcreteMath module self-contained around its actual open target. -/ -@[expose] public section +public section namespace Egrs75.ConcreteMath diff --git a/LeanPool/Egrs75/LeafInduction.lean b/LeanPool/Egrs75/LeafInduction.lean index fb4a0fbec3..c7eafdc466 100644 --- a/LeanPool/Egrs75/LeafInduction.lean +++ b/LeanPool/Egrs75/LeafInduction.lean @@ -72,7 +72,7 @@ clean files are NOT modified. This formalizes the KNOWN theorem EGRS75 not attempted here. -/ -@[expose] public section +public section namespace Egrs75.LeafInduction @@ -120,12 +120,12 @@ theorem seed_lt_pow_succ {p : ℕ} (hp : 2 ≤ p) (N : ℕ) : N < p ^ (N + 1) := measure: each repair step strictly decreases it while preserving `LowDigits p`. -/ /-- The oversized base-`q` digits of `n` (those exceeding `(q-1)/2`). -/ -def badDigitsQ (q n : ℕ) : List ℕ := +@[expose] def badDigitsQ (q n : ℕ) : List ℕ := (Nat.digits q n).filter (fun d => decide ((q - 1) / 2 < d)) /-- The number of oversized base-`q` digits of `n`. This is the EGRS termination potential: `0` iff `LowDigits q n`, strictly decreased by each repair step. -/ -def badCountQ (q n : ℕ) : ℕ := (badDigitsQ q n).length +@[expose] def badCountQ (q n : ℕ) : ℕ := (badDigitsQ q n).length /-- **Base case of the induction (KERNEL-CLEAN).** The potential vanishes exactly when every base-`q` digit is `≤ (q-1)/2`, i.e. when `n` is `LowDigits q`. So a diff --git a/LeanPool/Egrs75/LogIrrationality.lean b/LeanPool/Egrs75/LogIrrationality.lean index a0b45be801..22ea3c14cf 100644 --- a/LeanPool/Egrs75/LogIrrationality.lean +++ b/LeanPool/Egrs75/LogIrrationality.lean @@ -58,7 +58,7 @@ DO NOT frame this as solving an open Erdős problem: this formalises EGRS75 (Math. Comp. 1975, Theorem 1/2), a KNOWN theorem. Three primes is Erdős #376 (open). -/ -@[expose] public section +public section namespace Egrs75.MathlibAPI diff --git a/LeanPool/Egrs75/MoveDigits.lean b/LeanPool/Egrs75/MoveDigits.lean index d7ab81215e..88ff96389c 100644 --- a/LeanPool/Egrs75/MoveDigits.lean +++ b/LeanPool/Egrs75/MoveDigits.lean @@ -36,7 +36,7 @@ Formalizes part of the KNOWN theorem EGRS75 (1975); three primes is Erdős #376 (OPEN) — not attempted. Recon: ~/Knowledge/Construct/recon/erdos_376.md. -/ -@[expose] public section +public section namespace Egrs75.MoveDigits diff --git a/LeanPool/Egrs75/MuFinish.lean b/LeanPool/Egrs75/MuFinish.lean index 09480a8872..d3bc206364 100644 --- a/LeanPool/Egrs75/MuFinish.lean +++ b/LeanPool/Egrs75/MuFinish.lean @@ -64,7 +64,7 @@ NOT an open-problem solve: the r ≥ 3 generalization is Erdős #376 (OPEN) and not attempted. Recon: ~/Knowledge/Construct/recon/erdos_376.md. -/ -@[expose] public section +public section namespace Egrs75.MuFinish @@ -228,7 +228,7 @@ theorem egrs_move {p q : ℕ} (hp : p.Prime) (_hq : q.Prime) have hsgk : StrictGoodAt q k (n + U) := by unfold StrictGoodAt rw [hlow k hki]; exact hkstrict - have hi'le : leastGoodAbove hq3 hbad' ≤ k := Nat.find_min' _ ⟨htb', hsgk⟩ + have hi'le : leastGoodAbove hq3 hbad' ≤ k := leastGoodAbove_le hq3 hbad' htb' hsgk exact muVal_lt_of hq3 hbad (Or.inr ⟨hbad', Or.inl (by omega)⟩) · -- ════════════ SUBTRACT branch (S ≤ T; tail strip, block frozen) ════════════ have hppos : 1 ≤ p ^ m := Nat.one_le_pow _ _ (by omega) @@ -261,7 +261,7 @@ theorem egrs_move {p q : ℕ} (hp : p.Prime) (_hq : q.Prime) have hsgi : StrictGoodAt q i (n - S) := by unfold StrictGoodAt rwa [hfrozen i (le_refl i)] - have hi'le : leastGoodAbove hq3 hbad' ≤ i := Nat.find_min' _ ⟨htb', hsgi⟩ + have hi'le : leastGoodAbove hq3 hbad' ≤ i := leastGoodAbove_le hq3 hbad' htb' hsgi rcases Nat.eq_or_lt_of_le hi'le with heq' | hlt' · -- index and digit frozen: μ unchanged, n strictly drops right @@ -420,7 +420,7 @@ theorem align_finish_mu {p q : ℕ} (hp : p.Prime) (hq : q.Prime) unfold StrictGoodAt rw [hdiv2, Nat.mul_mod_left] omega - have hple : leastGoodAbove hq3 hbads ≤ e + 2 := Nat.find_min' _ ⟨htb, hsg⟩ + have hple : leastGoodAbove hq3 hbads ≤ e + 2 := leastGoodAbove_le hq3 hbads htb hsg have hsfl : ∀ (hbad : 0 < badCountQ q (p ^ α)), N < p ^ α / q ^ (leastGoodAbove hq3 hbad) * q ^ (leastGoodAbove hq3 hbad) := by intro hbad diff --git a/LeanPool/Egrs75/Reduction.lean b/LeanPool/Egrs75/Reduction.lean index 09ae12959f..2abd3ad721 100644 --- a/LeanPool/Egrs75/Reduction.lean +++ b/LeanPool/Egrs75/Reduction.lean @@ -68,7 +68,7 @@ Recon / context: MATH CONTEXT block in the run prompt; #376 recon at ~/Knowledge/Construct/recon/erdos_376.md. -/ -@[expose] public section +public section namespace Egrs75 @@ -83,6 +83,7 @@ Everything else in the assembly is verified. -/ `p q`, the set of `n` low-digit in BOTH bases is infinite. This is the genuine number-theoretic core (`θ_p + θ_q > 1`); it is the ONLY unproven input to the target. -/ +@[expose] def EgrsCrux (p q : ℕ) : Prop := {n : ℕ | LowDigits p n ∧ LowDigits q n}.Infinite /-! ## The reduction, SORRY-FREE relative to the crux (KERNEL-CLEAN) -/ diff --git a/LeanPool/Egrs75/RoundUp.lean b/LeanPool/Egrs75/RoundUp.lean index 76455dcdc8..c3fd28cd8b 100644 --- a/LeanPool/Egrs75/RoundUp.lean +++ b/LeanPool/Egrs75/RoundUp.lean @@ -38,7 +38,7 @@ low-digit number in both bases is the EGRS Diophantine "iterative digit repair" step (their eq. (2) + the repair Lemma), which is the genuine remaining gap. -/ -@[expose] public section +public section namespace Egrs75.RoundUp diff --git a/LeanPool/Egrs75/SeedWindow.lean b/LeanPool/Egrs75/SeedWindow.lean index d88bfc6db0..fbc05693dc 100644 --- a/LeanPool/Egrs75/SeedWindow.lean +++ b/LeanPool/Egrs75/SeedWindow.lean @@ -41,7 +41,7 @@ theorem EGRS75 (1975); three primes is Erdős #376 (OPEN) — not attempted. Recon: ~/Knowledge/Construct/recon/erdos_376.md. -/ -@[expose] public section +public section namespace Egrs75.SeedWindow diff --git a/LeanPool/Egrs75/SubtractBranch.lean b/LeanPool/Egrs75/SubtractBranch.lean index 69144ff5db..91735e2d47 100644 --- a/LeanPool/Egrs75/SubtractBranch.lean +++ b/LeanPool/Egrs75/SubtractBranch.lean @@ -70,7 +70,7 @@ and the high/low base-`q` machinery; does NOT modify any existing clean file. F the KNOWN 1975 theorem; three primes is Erdős #376 (OPEN) — not attempted. -/ -@[expose] public section +public section namespace Egrs75.ClearingP3 diff --git a/LeanPool/Erdos1196.lean b/LeanPool/Erdos1196.lean index e8be46e0d5..ad7ea77724 100644 --- a/LeanPool/Erdos1196.lean +++ b/LeanPool/Erdos1196.lean @@ -26,7 +26,7 @@ Tags: number-theory, combinatorics, analysis MSC: 11N25, 05D05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Erdos1196/Basic.lean b/LeanPool/Erdos1196/Basic.lean index 9ae9a3a2ee..9122b8c503 100644 --- a/LeanPool/Erdos1196/Basic.lean +++ b/LeanPool/Erdos1196/Basic.lean @@ -27,52 +27,52 @@ and `μ_x`, and the abstract Markov-layer interface used for the visit-probabili * `MarkovLayer` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators namespace PrimitiveSetsAboveX /-- The primitive-set predicate used throughout the local development. -/ -def PrimitiveSet (A : Set ℕ) : Prop := +@[expose] def PrimitiveSet (A : Set ℕ) : Prop := ∀ ⦃m n : ℕ⦄, m ∈ A → n ∈ A → m ∣ n → m = n /-- Partial sums of `Λ(q) / q`. -/ -noncomputable def mertensPartialSum (t : ℕ) : ℝ := +@[expose] noncomputable def mertensPartialSum (t : ℕ) : ℝ := (Finset.Icc 1 t).sum fun q => Λ q / (q : ℝ) /-- The logarithmic tail sum `T(m, y)` used in the normalization estimates. -/ -noncomputable def tailSum (m y : ℕ) : ℝ := +@[expose] noncomputable def tailSum (m y : ℕ) : ℝ := ∑' q : ℕ, if y ≤ q then Λ q / ((q : ℝ) * (Real.log ((m * q : ℕ) : ℝ)) ^ 2) else 0 /-- The quantity `R_Y(m)` introduced in the proof of the main theorem. -/ -noncomputable def ry (Y m : ℕ) : ℝ := +@[expose] noncomputable def ry (Y m : ℕ) : ℝ := ∑' q : ℕ, if Y ≤ q then (Real.log (m : ℝ) / (Real.log ((m * q : ℕ) : ℝ)) ^ 2) * (Λ q / (q : ℝ)) else 0 /-- The transition weight `p(m, mq)` of the sub-Markov chain. -/ -noncomputable def transitionWeight (Y m q : ℕ) : ℝ := +@[expose] noncomputable def transitionWeight (Y m q : ℕ) : ℝ := if Y ≤ q then (Real.log (m : ℝ) / (Real.log ((m * q : ℕ) : ℝ)) ^ 2) * (Λ q / (q : ℝ)) else 0 /-- The entry weight `b_x(n)` used to define the initial distribution of the chain. -/ -noncomputable def entryWeight (x Y n : ℕ) : ℝ := +@[expose] noncomputable def entryWeight (x Y n : ℕ) : ℝ := 1 / ((n : ℝ) * (Real.log (n : ℝ)) ^ 2) * (((n.divisors.filter (fun q => q < Y)).sum fun q => Λ q) + ((n.divisors.filter (fun q => Y ≤ q ∧ n / q < x)).sum fun q => Λ q)) /-- The normalizing constant `B_x`. -/ -noncomputable def normalizationConstant (x Y : ℕ) : ℝ := +@[expose] noncomputable def normalizationConstant (x Y : ℕ) : ℝ := ∑' n : ℕ, if x ≤ n then entryWeight x Y n else 0 /-- The normalized initial distribution `μ_x(n) = b_x(n) / B_x`. -/ -noncomputable def initialDistribution (x Y n : ℕ) : ℝ := +@[expose] noncomputable def initialDistribution (x Y n : ℕ) : ℝ := entryWeight x Y n / normalizationConstant x Y /-- diff --git a/LeanPool/Erdos1196/FirstEntryRowTerm.lean b/LeanPool/Erdos1196/FirstEntryRowTerm.lean index 0acfac7db1..c2d5747c2f 100644 --- a/LeanPool/Erdos1196/FirstEntryRowTerm.lean +++ b/LeanPool/Erdos1196/FirstEntryRowTerm.lean @@ -24,18 +24,18 @@ the resulting tail sum, and the pairwise weights used later in the fiberwise rei * `firstEntryPairWeight` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators namespace PrimitiveSetsAboveX /-- The least threshold satisfying both `q ≥ Y` and `x ≤ m * q`. -/ -def entryThreshold (x Y m : ℕ) : ℕ := +@[expose] def entryThreshold (x Y m : ℕ) : ℕ := max Y (x ⌈/⌉ m) /-- The first-entry tail sum starting from a parent state `m`. -/ -noncomputable def firstEntryTail (x Y m : ℕ) : ℝ := +@[expose] noncomputable def firstEntryTail (x Y m : ℕ) : ℝ := ∑' q : ℕ, if entryThreshold x Y m ≤ q then Λ q / ((q : ℝ) * (Real.log ((m * q : ℕ) : ℝ)) ^ 2) @@ -43,7 +43,7 @@ noncomputable def firstEntryTail (x Y m : ℕ) : ℝ := /-- The pairwise weight indexed by a parent state `m` and jump factor `q` for the first-entry contribution to `B_x`. -/ -noncomputable def firstEntryPairWeight (x Y : ℕ) (mq : ℕ × ℕ) : ℝ := +@[expose] noncomputable def firstEntryPairWeight (x Y : ℕ) (mq : ℕ × ℕ) : ℝ := if 1 ≤ mq.1 ∧ mq.1 < x ∧ entryThreshold x Y mq.1 ≤ mq.2 then Λ mq.2 / (((mq.1 * mq.2 : ℕ) : ℝ) * (Real.log ((mq.1 * mq.2 : ℕ) : ℝ)) ^ 2) else 0 diff --git a/LeanPool/Erdos1196/FormalConjecturesErdos1196.lean b/LeanPool/Erdos1196/FormalConjecturesErdos1196.lean index e75a02ea2b..1d3a85bfae 100644 --- a/LeanPool/Erdos1196/FormalConjecturesErdos1196.lean +++ b/LeanPool/Erdos1196/FormalConjecturesErdos1196.lean @@ -23,7 +23,7 @@ definition, but omit the repository-specific metadata attribute and `answer(...) * `Erdos1196.erdos_1196` -/ -@[expose] public section +public section open Filter open scoped Asymptotics BigOperators diff --git a/LeanPool/Erdos1196/HitMass.lean b/LeanPool/Erdos1196/HitMass.lean index 44adb56672..3a1ac91bcf 100644 --- a/LeanPool/Erdos1196/HitMass.lean +++ b/LeanPool/Erdos1196/HitMass.lean @@ -41,7 +41,7 @@ paths in the multiplicative chain can meet `A` at most once. * `PrimitiveSet.summable_indicator_visitProbability_and_tsum_le_one_of_visitMass_le_one` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators diff --git a/LeanPool/Erdos1196/Main.lean b/LeanPool/Erdos1196/Main.lean index 3d84412994..025c72ed83 100644 --- a/LeanPool/Erdos1196/Main.lean +++ b/LeanPool/Erdos1196/Main.lean @@ -25,7 +25,7 @@ normalization estimates into the final logarithmic-series bound. * `mainTheorem` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators diff --git a/LeanPool/Erdos1196/Markov.lean b/LeanPool/Erdos1196/Markov.lean index 1eb7fcdbd9..d425f38e28 100644 --- a/LeanPool/Erdos1196/Markov.lean +++ b/LeanPool/Erdos1196/Markov.lean @@ -27,7 +27,7 @@ probabilities. * `visitProbabilityFormula` -/ -@[expose] public section +public section /- ! Markov-chain identities and row-sum bounds used in the proof. -/ open scoped ArithmeticFunction BigOperators diff --git a/LeanPool/Erdos1196/Normalization.lean b/LeanPool/Erdos1196/Normalization.lean index 5c4712fd2a..126b7aa0c2 100644 --- a/LeanPool/Erdos1196/Normalization.lean +++ b/LeanPool/Erdos1196/Normalization.lean @@ -20,7 +20,7 @@ proving the final estimate for the first-entry contribution to `B_x`. * `normalizationFirstEntryPart_estimate` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators Topology diff --git a/LeanPool/Erdos1196/NormalizationCore.lean b/LeanPool/Erdos1196/NormalizationCore.lean index 22747c45c0..1e15b37ed1 100644 --- a/LeanPool/Erdos1196/NormalizationCore.lean +++ b/LeanPool/Erdos1196/NormalizationCore.lean @@ -27,14 +27,14 @@ the two separate estimate files. * `normalizationFirstEntryPart` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators Topology namespace PrimitiveSetsAboveX /-- The common prefactor `1 / (n log^2 n)` in the entry weights. -/ -noncomputable def entryWeightFactor (n : ℕ) : ℝ := +@[expose] noncomputable def entryWeightFactor (n : ℕ) : ℝ := 1 / ((n : ℝ) * (Real.log (n : ℝ)) ^ 2) /-- The small-prime-power divisor sum appearing in `b_x(n)`. -/ @@ -54,7 +54,7 @@ noncomputable def firstEntryEntryWeight (x Y n : ℕ) : ℝ := entryWeightFactor n * firstEntryDivisorSum x Y n /-- The small-prime-power summand in the normalization constant `B_x`. -/ -noncomputable def normalizationSmallPrimePart (x Y n : ℕ) : ℝ := +@[expose] noncomputable def normalizationSmallPrimePart (x Y n : ℕ) : ℝ := if x ≤ n then smallPrimeEntryWeight Y n else 0 /-- The first-entry summand in the normalization constant `B_x`. -/ diff --git a/LeanPool/Erdos1196/NormalizationSmallPrime.lean b/LeanPool/Erdos1196/NormalizationSmallPrime.lean index 21dd2e3545..30f6b9ccac 100644 --- a/LeanPool/Erdos1196/NormalizationSmallPrime.lean +++ b/LeanPool/Erdos1196/NormalizationSmallPrime.lean @@ -24,7 +24,7 @@ Its main theorem shows that this part is summable and contributes only `O(1 / lo * `summable_normalizationSmallPrimePart_and_tsum_le` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators Topology diff --git a/LeanPool/Erdos1196/Preliminaries.lean b/LeanPool/Erdos1196/Preliminaries.lean index 175169b45c..b5033e699a 100644 --- a/LeanPool/Erdos1196/Preliminaries.lean +++ b/LeanPool/Erdos1196/Preliminaries.lean @@ -25,7 +25,7 @@ The arithmetic input for the Mertens partial sums lives in * `tailEstimate` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators Topology open Filter MeasureTheory diff --git a/LeanPool/Erdos1196/PreliminariesMertens.lean b/LeanPool/Erdos1196/PreliminariesMertens.lean index e00d6fc9a7..b9bf4e41f3 100644 --- a/LeanPool/Erdos1196/PreliminariesMertens.lean +++ b/LeanPool/Erdos1196/PreliminariesMertens.lean @@ -21,7 +21,7 @@ Mertens estimate used later in the normalization and tail-sum arguments. * `mertensEstimate` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators diff --git a/LeanPool/Erdos1196/PreliminariesTailAux.lean b/LeanPool/Erdos1196/PreliminariesTailAux.lean index e0f088c5b4..5dfd02d7b0 100644 --- a/LeanPool/Erdos1196/PreliminariesTailAux.lean +++ b/LeanPool/Erdos1196/PreliminariesTailAux.lean @@ -28,7 +28,7 @@ be computed exactly. * `integral_Ioi_two_inv_log_cube` -/ -@[expose] public section +public section open scoped ArithmeticFunction BigOperators Topology open Filter MeasureTheory diff --git a/LeanPool/Erdos1196/PrimitiveWeight.lean b/LeanPool/Erdos1196/PrimitiveWeight.lean index 80364eb647..30613f3fb5 100644 --- a/LeanPool/Erdos1196/PrimitiveWeight.lean +++ b/LeanPool/Erdos1196/PrimitiveWeight.lean @@ -23,7 +23,7 @@ summable hit series to the logarithmic-series bound. * `summable_indicatorLogSeries_and_tsum_le_of_hitMass` -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Erdos132ConvexK3.lean b/LeanPool/Erdos132ConvexK3.lean index 7e2945d41e..08aa86c8d7 100644 --- a/LeanPool/Erdos132ConvexK3.lean +++ b/LeanPool/Erdos132ConvexK3.lean @@ -28,7 +28,7 @@ Tags: discrete-geometry, distance-graphs, erdos-problems, convexity MSC: 52C10, 05C12 -/ -@[expose] public section +public section /-! # Exceptional-Word Closures for the Convex Three-Distance Case of Erdős Problem 132 diff --git a/LeanPool/Erdos132ConvexK3/Assembly.lean b/LeanPool/Erdos132ConvexK3/Assembly.lean index 59c6c9cb0d..c1d80f6c5e 100644 --- a/LeanPool/Erdos132ConvexK3/Assembly.lean +++ b/LeanPool/Erdos132ConvexK3/Assembly.lean @@ -23,7 +23,7 @@ final section separately records the stronger global reduction still needed to obtain the source-facing convex theorem. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -91,7 +91,7 @@ def ExceptionalCoverWord.row : ExceptionalCoverWord → ExceptionalRow | .row5_BB_DD => .row5 /-- Exact destination column of the draft Section 7 table. -/ -def ExceptionalCoverWord.route : ExceptionalCoverWord → WordClosureRoute +@[expose] def ExceptionalCoverWord.route : ExceptionalCoverWord → WordClosureRoute | .row1_B32 | .row4_D32 => .terminalCage | .row1_B31 | .row2_BA | .row4_D31 | .row4_DC => .antiSaturation | .row4_DD => .fourEdgeCage @@ -99,7 +99,7 @@ def ExceptionalCoverWord.route : ExceptionalCoverWord → WordClosureRoute .row5_BB_DD => .fullTwoRung /-- Degree bound supplied by each of the four local closure routes. -/ -def WordClosureRoute.degreeBound : WordClosureRoute → ℕ +@[expose] def WordClosureRoute.degreeBound : WordClosureRoute → ℕ | .antiSaturation => 5 | .fullTwoRung | .terminalCage | .fourEdgeCage => 6 @@ -152,7 +152,7 @@ theorem full_two_rung_shared_tip_degree_le_six · exact (hLow hLow').trans (by omega) /-- The four shared geometric realization predicates, indexed by closure route. -/ -def WordClosureRealization +@[expose] def WordClosureRealization {n : ℕ} (route : WordClosureRoute) (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) : Prop := match route with | .terminalCage => Nonempty (Row1B32WordRealization P d₁ d₂ d₃) @@ -161,7 +161,7 @@ def WordClosureRealization | .fourEdgeCage => Nonempty (Row4DDWordRealization P d₁ d₂ d₃) /-- A word is realized when the geometric predicate selected by its route is inhabited. -/ -def WordRealization +@[expose] def WordRealization {n : ℕ} (word : ExceptionalCoverWord) (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) : Prop := WordClosureRealization word.route P d₁ d₂ d₃ @@ -225,7 +225,7 @@ theorem concrete_word_closures simpa only [hRoute, WordClosureRoute.degreeBound] using close word hRealizes /-- Direct short-arc closure or one of the thirteen exceptional words. -/ -def HasThirteenWordReduction +@[expose] def HasThirteenWordReduction {n : ℕ} (degree : Fin n → ℕ) (Realizes : ExceptionalCoverWord → Prop) : Prop := (∃ v, degree v ≤ 6) ∨ ∃ w, Realizes w @@ -249,7 +249,7 @@ theorem thirteen_word_assembly /-- The proof-producing reduction package still required for an arbitrary convex configuration. -/ -def HasConvexK3DraftReduction +@[expose] def HasConvexK3DraftReduction {n : ℕ} [_nonzero : NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) : Prop := ∃ Realizes : ExceptionalCoverWord → Prop, HasThirteenWordReduction (vertexDegree P d₁ d₂ d₃) Realizes ∧ @@ -273,7 +273,7 @@ def ConvexTopThreeDegreeSixStatement : Prop := /-- Bridge from the two public geometric hypotheses to the complete draft reduction package. -/ -def ConvexTopThreeDraftReductionComplete : Prop := +@[expose] def ConvexTopThreeDraftReductionComplete : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), CyclicStrictConvex P → HasTopThreeDistanceClasses P d₁ d₂ d₃ → HasConvexK3DraftReduction P d₁ d₂ d₃ diff --git a/LeanPool/Erdos132ConvexK3/Basic.lean b/LeanPool/Erdos132ConvexK3/Basic.lean index f2653289cc..64819afbff 100644 --- a/LeanPool/Erdos132ConvexK3/Basic.lean +++ b/LeanPool/Erdos132ConvexK3/Basic.lean @@ -25,7 +25,7 @@ The open Erdős 132 conjecture is not asserted here. Recon: `~/Knowledge/Construct/recon/erdos_132.md`. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -33,20 +33,20 @@ namespace LeanPool.Erdos132ConvexK3 abbrev Point (K : Type*) := K × K /-- Signed two-dimensional cross product. -/ -def cross {K : Type*} [Ring K] (u v : Point K) : K := +@[expose] def cross {K : Type*} [Ring K] (u v : Point K) : K := u.1 * v.2 - u.2 * v.1 /-- Cartesian dot product. Keeping this polynomial form explicit lets the majorant angle argument stay over exact ordered rings. -/ -def dot {K : Type*} [Ring K] (u v : Point K) : K := +@[expose] def dot {K : Type*} [Ring K] (u v : Point K) : K := u.1 * v.1 + u.2 * v.2 /-- Signed turn from the ray `a ⟶ b` to the ray `a ⟶ c`. -/ -def turn {K : Type*} [Ring K] (a b c : Point K) : K := +@[expose] def turn {K : Type*} [Ring K] (a b c : Point K) : K := (b.1 - a.1) * (c.2 - a.2) - (b.2 - a.2) * (c.1 - a.1) /-- Squared Euclidean distance, used to compare distance classes exactly. -/ -def sqDist {K : Type*} [Ring K] (a b : Point K) : K := +@[expose] def sqDist {K : Type*} [Ring K] (a b : Point K) : K := (b.1 - a.1) ^ 2 + (b.2 - a.2) ^ 2 theorem sqDist_comm {K : Type*} [CommRing K] (a b : Point K) : @@ -55,7 +55,7 @@ theorem sqDist_comm {K : Type*} [CommRing K] (a b : Point K) : ring /-- The next index in a cyclic labelling. -/ -def cyclicNext {n : ℕ} [NeZero n] (i : Fin n) : Fin n := i + 1 +@[expose] def cyclicNext {n : ℕ} [NeZero n] (i : Fin n) : Fin n := i + 1 /-- Strict convex position in a specified cyclic order. @@ -63,7 +63,7 @@ Every vertex other than the endpoints of a boundary edge lies strictly in that oriented edge's left open half-plane. This signed-area formulation is stronger and less ambiguous than checking consecutive turns alone. -/ -def CyclicStrictConvex +@[expose] def CyclicStrictConvex {K : Type*} [Ring K] [LinearOrder K] {n : ℕ} [NeZero n] (P : Fin n → Point K) : Prop := @@ -71,19 +71,19 @@ def CyclicStrictConvex /-- Four vertices in positive cyclic order, in the exact form needed for the diagonal-crossing proof. -/ -def StrictConvexQuad +@[expose] def StrictConvexQuad {K : Type*} [Ring K] [LinearOrder K] (a b c d : Point K) : Prop := 0 < turn a b c ∧ 0 < turn a b d ∧ 0 < turn b c d ∧ 0 < turn c d a /-- Membership in the open left half-plane of the oriented line `a ⟶ b`. -/ -def InLeftOpenHalfPlane +@[expose] def InLeftOpenHalfPlane {K : Type*} [Ring K] [LinearOrder K] (a b p : Point K) : Prop := 0 < turn a b p /-- Executable increasing representatives of unordered pairs of labels. -/ -def unorderedPairList (n : ℕ) : List (Fin n × Fin n) := +@[expose] def unorderedPairList (n : ℕ) : List (Fin n × Fin n) := (List.finRange n).flatMap fun i ↦ ((List.finRange n).filter fun j ↦ decide (i < j)).map fun j ↦ (i, j) @@ -97,7 +97,7 @@ def realizedSquaredDistances (unorderedPairs n).image fun e ↦ sqDist (P e.1) (P e.2) /-- `d₁ > d₂ > d₃` are exactly the three largest squared distance classes. -/ -def HasTopThreeDistanceClasses +@[expose] def HasTopThreeDistanceClasses {K : Type*} [Ring K] [LinearOrder K] {n : ℕ} (P : Fin n → Point K) (d₁ d₂ d₃ : K) : Prop := d₃ < d₂ ∧ d₂ < d₁ ∧ @@ -193,7 +193,7 @@ theorem hasTopThreeDistanceClasses_of_check exact hall e he /-- Adjacency in the union of the three named largest distance classes. -/ -def TopThreeAdjacent +@[expose] def TopThreeAdjacent {K : Type*} [Ring K] {n : ℕ} (P : Fin n → Point K) (d₁ d₂ d₃ : K) (i j : Fin n) : Prop := i ≠ j ∧ @@ -201,7 +201,7 @@ def TopThreeAdjacent sqDist (P i) (P j) = d₃) /-- The graph `G(S,3)` for three explicitly identified distance classes. -/ -def topThreeGraph +@[expose] def topThreeGraph {K : Type*} [CommRing K] {n : ℕ} (P : Fin n → Point K) (d₁ d₂ d₃ : K) : SimpleGraph (Fin n) where Adj i j := TopThreeAdjacent P d₁ d₂ d₃ i j @@ -215,7 +215,7 @@ def topThreeGraph exact hii.1 rfl⟩ /-- Vertex degree in `G(S,3)`, executable for exact coordinate fields. -/ -def vertexDegree +@[expose] def vertexDegree {K : Type*} [CommRing K] [DecidableEq K] {n : ℕ} (P : Fin n → Point K) (d₁ d₂ d₃ : K) (i : Fin n) : ℕ := ((Finset.univ.erase i).filter fun j ↦ diff --git a/LeanPool/Erdos132ConvexK3/CoordinatedMajorants.lean b/LeanPool/Erdos132ConvexK3/CoordinatedMajorants.lean index d571927af8..6e4f7065e6 100644 --- a/LeanPool/Erdos132ConvexK3/CoordinatedMajorants.lean +++ b/LeanPool/Erdos132ConvexK3/CoordinatedMajorants.lean @@ -19,7 +19,7 @@ jointly to minimize the moves made by their facing endpoints. The finite minimum exists. The remaining exchange statement is isolated exactly. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -565,7 +565,7 @@ theorem coordinated_exceptional_22_forces_cross_top_three joint minimum admits another actual pair with fewer facing-endpoint moves. Neither ErLV89 p.548 nor the 1986 preprint states a selection rule or proves this replacement. -/ -def ErLVCoordinatedMajorantExchangeComplete : Prop := +@[expose] def ErLVCoordinatedMajorantExchangeComplete : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), CyclicStrictConvex P → HasTopThreeDistanceClasses P d₁ d₂ d₃ → (∀ v, 7 ≤ vertexDegree P d₁ d₂ d₃ v) → diff --git a/LeanPool/Erdos132ConvexK3/Geometry.lean b/LeanPool/Erdos132ConvexK3/Geometry.lean index 29cb292fb0..1ec0511f2c 100644 --- a/LeanPool/Erdos132ConvexK3/Geometry.lean +++ b/LeanPool/Erdos132ConvexK3/Geometry.lean @@ -17,7 +17,7 @@ red--blue consequences, chord half-plane separation, and same-half-plane uniqueness for two-circle intersections. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -25,7 +25,7 @@ namespace LeanPool.Erdos132ConvexK3 def toComplex (p : Point ℝ) : ℂ := ⟨p.1, p.2⟩ /-- Ordinary Euclidean distance between real Cartesian points. -/ -noncomputable def euclideanDist (a b : Point ℝ) : ℝ := +@[expose] noncomputable def euclideanDist (a b : Point ℝ) : ℝ := dist (toComplex a) (toComplex b) /-- The ordinary distance squares to the polynomial Cartesian squared diff --git a/LeanPool/Erdos132ConvexK3/GlobalAssembly.lean b/LeanPool/Erdos132ConvexK3/GlobalAssembly.lean index 0794f5aa4c..b755164656 100644 --- a/LeanPool/Erdos132ConvexK3/GlobalAssembly.lean +++ b/LeanPool/Erdos132ConvexK3/GlobalAssembly.lean @@ -22,7 +22,7 @@ jointly selected majorants and their outer-endpoint localization. The first stage below packages that data and instantiates the five-row enumeration. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -139,7 +139,7 @@ namespace ErLVGlobalFiveRowFrame /-- The global frame contains exactly the data required by the established degree-seven use-site lemmas. -/ -noncomputable def toUseSite +@[expose] noncomputable def toUseSite {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : ErLVAtVertexUseSite P d₁ d₂ d₃ := @@ -155,35 +155,35 @@ noncomputable def setup (F.maximalGap (cyclicAdvance F.x 3)) F.M F.M_le_secondRight /-- First exceptional row of the five-row count table. -/ -def Row1 +@[expose] def Row1 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.pair.first.rightMoves = 0 ∧ F.pair.first.leftMoves = 1 ∧ F.setup.L = 3 ∧ F.M = 2 /-- Second exceptional row of the five-row count table. -/ -def Row2 +@[expose] def Row2 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.pair.first.rightMoves = 1 ∧ F.pair.first.leftMoves = 1 ∧ F.setup.L = 3 ∧ F.M = 2 /-- Third exceptional row of the five-row count table. -/ -def Row3 +@[expose] def Row3 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.pair.first.rightMoves = 0 ∧ F.pair.first.leftMoves = 2 ∧ F.setup.L = 2 ∧ F.M = 2 /-- Fourth exceptional row of the five-row count table. -/ -def Row4 +@[expose] def Row4 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.pair.first.rightMoves = 0 ∧ F.pair.first.leftMoves = 2 ∧ F.setup.L = 3 ∧ F.M = 1 /-- Fifth exceptional row of the five-row count table. -/ -def Row5 +@[expose] def Row5 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.pair.first.rightMoves = 0 ∧ F.pair.first.leftMoves = 2 ∧ @@ -200,13 +200,13 @@ theorem exceptional_row_iff_rows norm_cast /-- Squared distance of the first majorant's starting edge. -/ -noncomputable def firstStartSqDist +@[expose] noncomputable def firstStartSqDist {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : ℝ := sqDist (P (firstClockwiseNeighbor P d₁ d₂ d₃ F.x)) (P F.x) /-- Squared distance of the first majorant's terminal edge. -/ -noncomputable def firstTerminalSqDist +@[expose] noncomputable def firstTerminalSqDist {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : ℝ := sqDist @@ -215,14 +215,14 @@ noncomputable def firstTerminalSqDist (P (cyclicAdvance F.x F.pair.first.rightMoves)) /-- Squared distance of the second majorant's starting edge. -/ -noncomputable def secondStartSqDist +@[expose] noncomputable def secondStartSqDist {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : ℝ := sqDist (P (cyclicAdvance F.x 3)) (P (firstCounterclockwiseNeighbor P d₁ d₂ d₃ (cyclicAdvance F.x 3))) /-- Squared distance of the second majorant's terminal edge. -/ -noncomputable def secondTerminalSqDist +@[expose] noncomputable def secondTerminalSqDist {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : ℝ := sqDist @@ -232,37 +232,37 @@ noncomputable def secondTerminalSqDist F.pair.second.rightMoves)) /-- The first majorant changes rank from `d₃` to `d₂`. -/ -def FirstRank32 +@[expose] def FirstRank32 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.firstStartSqDist = d₃ ∧ F.firstTerminalSqDist = d₂ /-- The first majorant changes rank from `d₃` to `d₁`. -/ -def FirstRank31 +@[expose] def FirstRank31 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.firstStartSqDist = d₃ ∧ F.firstTerminalSqDist = d₁ /-- The first majorant changes rank from `d₂` to `d₁`. -/ -def FirstRank21 +@[expose] def FirstRank21 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.firstStartSqDist = d₂ ∧ F.firstTerminalSqDist = d₁ /-- The second majorant changes rank from `d₃` to `d₂`. -/ -def SecondRank32 +@[expose] def SecondRank32 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.secondStartSqDist = d₃ ∧ F.secondTerminalSqDist = d₂ /-- The second majorant changes rank from `d₃` to `d₁`. -/ -def SecondRank31 +@[expose] def SecondRank31 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.secondStartSqDist = d₃ ∧ F.secondTerminalSqDist = d₁ /-- The second majorant changes rank from `d₂` to `d₁`. -/ -def SecondRank21 +@[expose] def SecondRank21 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : Prop := F.secondStartSqDist = d₂ ∧ F.secondTerminalSqDist = d₁ @@ -306,7 +306,7 @@ theorem second_rank_transition_of_positive maximal-gap frame. The letters record the actual endpoint order (`A/B` for the first path and `C/D` for the second); the one-step words also retain the exact strict rank transition. -/ -def RealizesCoverWord +@[expose] def RealizesCoverWord {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃) : ExceptionalCoverWord → Prop @@ -674,7 +674,7 @@ theorem exists_erlv_global_exceptional_row_of_no_degree_six /-- Canonical raw geometric meaning of a cover word: it is realized by an actual localized maximal-gap frame with the row, endpoint order, and rank data recorded by `RealizesCoverWord`. -/ -def GeometricallyRealizesCoverWord +@[expose] def GeometricallyRealizesCoverWord {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (w : ExceptionalCoverWord) : Prop := ∃ F : ErLVGlobalFiveRowFrame P d₁ d₂ d₃, F.RealizesCoverWord w @@ -699,7 +699,7 @@ theorem has_thirteen_word_reduction_of_convex_top_three /-- Exact remaining global component after the maximal-gap, five-row, and thirteen-word reductions: prove each canonical geometric word closes by its routed local kernel. -/ -def GlobalThirteenWordClosureComplete : Prop := +@[expose] def GlobalThirteenWordClosureComplete : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), Nonempty (DraftWordClosureInterface (vertexDegree P d₁ d₂ d₃) (GeometricallyRealizesCoverWord P d₁ d₂ d₃)) diff --git a/LeanPool/Erdos132ConvexK3/GlobalClosure.lean b/LeanPool/Erdos132ConvexK3/GlobalClosure.lean index d44cfb14aa..ba1440b468 100644 --- a/LeanPool/Erdos132ConvexK3/GlobalClosure.lean +++ b/LeanPool/Erdos132ConvexK3/GlobalClosure.lean @@ -23,7 +23,7 @@ reflected row-4 routes use the orientation-reversing isometry the original labelling. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132ConvexK3/GlobalReduction.lean b/LeanPool/Erdos132ConvexK3/GlobalReduction.lean index 00503cd908..cc125c11cf 100644 --- a/LeanPool/Erdos132ConvexK3/GlobalReduction.lean +++ b/LeanPool/Erdos132ConvexK3/GlobalReduction.lean @@ -30,16 +30,16 @@ The number of such moves is therefore exactly the side-count convention used by `K3Majorant.leftMoves/rightMoves`. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 /-- Advance by `k` polygon sides in the fixed cyclic labelling. -/ -def cyclicAdvance {n : ℕ} [NeZero n] (i : Fin n) (k : ℕ) : Fin n := +@[expose] def cyclicAdvance {n : ℕ} [NeZero n] (i : Fin n) (k : ℕ) : Fin n := i + Fin.ofNat n k /-- Retreat by `k` polygon sides in the fixed cyclic labelling. -/ -def cyclicRetreat {n : ℕ} [NeZero n] (i : Fin n) (k : ℕ) : Fin n := +@[expose] def cyclicRetreat {n : ℕ} [NeZero n] (i : Fin n) (k : ℕ) : Fin n := i - Fin.ofNat n k @[simp] theorem cyclicAdvance_zero {n : ℕ} [NeZero n] (i : Fin n) : @@ -69,7 +69,7 @@ theorem cyclicRetreat_add {n : ℕ} [NeZero n] (i : Fin n) (a b : ℕ) : /-- Nonzero counterclockwise offsets from `v` that lead to a neighbor in `G(S,3)`. The order on `Fin n` is the order of representatives `0,1,...,n-1`, so its minimum is the first counterclockwise neighbor. -/ -noncomputable def ccwNeighborOffsets +@[expose] noncomputable def ccwNeighborOffsets {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : Finset (Fin n) := by classical @@ -77,7 +77,7 @@ noncomputable def ccwNeighborOffsets k ≠ 0 ∧ TopThreeAdjacent P d₁ d₂ d₃ v (cyclicAdvance v k.val) /-- Nonzero clockwise offsets from `v` that lead to a graph neighbor. -/ -noncomputable def cwNeighborOffsets +@[expose] noncomputable def cwNeighborOffsets {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : Finset (Fin n) := by classical @@ -86,33 +86,33 @@ noncomputable def cwNeighborOffsets /-- First counterclockwise neighbor offset; zero is the explicit sentinel when the vertex is isolated. -/ -noncomputable def firstNeighborOffset +@[expose] noncomputable def firstNeighborOffset {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : Fin n := by classical let S := ccwNeighborOffsets P d₁ d₂ d₃ v exact if h : S.Nonempty then S.min' h else 0 /-- First clockwise neighbor offset, with zero as the isolated sentinel. -/ -noncomputable def firstClockwiseNeighborOffset +@[expose] noncomputable def firstClockwiseNeighborOffset {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : Fin n := by classical let S := cwNeighborOffsets P d₁ d₂ d₃ v exact if h : S.Nonempty then S.min' h else 0 /-- The first-neighbor gap `g(v)`, measured in polygon sides. -/ -noncomputable def firstNeighborGap +@[expose] noncomputable def firstNeighborGap {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : ℕ := (firstNeighborOffset P d₁ d₂ d₃ v).val /-- First counterclockwise graph neighbor, with the vertex itself as the isolated-vertex sentinel. -/ -noncomputable def firstCounterclockwiseNeighbor +@[expose] noncomputable def firstCounterclockwiseNeighbor {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : Fin n := cyclicAdvance v (firstNeighborGap P d₁ d₂ d₃ v) /-- First clockwise graph neighbor, with the vertex itself as the isolated-vertex sentinel. -/ -noncomputable def firstClockwiseNeighbor +@[expose] noncomputable def firstClockwiseNeighbor {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ) (v : Fin n) : Fin n := cyclicRetreat v (firstClockwiseNeighborOffset P d₁ d₂ d₃ v).val @@ -269,21 +269,21 @@ theorem exists_maximal_firstNeighborGap /-- A primary-source left cover of the oriented edge `ij`: retreating the left endpoint by one side strictly increases the squared distance. -/ -def IsLeftCover +@[expose] def IsLeftCover {K : Type*} [Ring K] [LT K] {n : ℕ} [NeZero n] (P : Fin n → Point K) (i j : Fin n) : Prop := sqDist (P i) (P j) < sqDist (P (cyclicRetreat i 1)) (P j) /-- A primary-source right cover of the oriented edge `ij`: advancing the right endpoint by one side strictly increases the squared distance. -/ -def IsRightCover +@[expose] def IsRightCover {K : Type*} [Ring K] [LT K] {n : ℕ} [NeZero n] (P : Fin n → Point K) (i j : Fin n) : Prop := sqDist (P i) (P j) < sqDist (P i) (P (cyclicAdvance j 1)) /-- An oriented edge is a majorant when neither legal endpoint cover raises its distance. -/ -def IsMajorant +@[expose] def IsMajorant {K : Type*} [Ring K] [LT K] {n : ℕ} [NeZero n] (P : Fin n → Point K) (i j : Fin n) : Prop := ¬IsLeftCover P i j ∧ ¬IsRightCover P i j @@ -626,7 +626,7 @@ theorem exists_maximal_gap_coordinated_majorants namespace K3MajorantWitness /-- Convert a witness without changing endpoint orientation. -/ -def toK3Majorant +@[expose] def toK3Majorant {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} {i j : Fin n} (W : K3MajorantWitness P d₁ d₂ d₃ i j) : K3Majorant where leftMoves := W.leftMoves @@ -635,7 +635,7 @@ def toK3Majorant /-- Convert the first source majorant `z ⟶ x` to the draft convention: `a` counts moves at `x`, while `b` counts moves at `z`. -/ -def toFirstK3Majorant +@[expose] def toFirstK3Majorant {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} {i j : Fin n} (W : K3MajorantWitness P d₁ d₂ d₃ i j) : K3Majorant where leftMoves := W.rightMoves @@ -646,7 +646,7 @@ end K3MajorantWitness /-- Build the arithmetic record once the source's arc-nesting conclusion `s = u+M`, `M≤β` has been supplied. -/ -noncomputable def erlvK3MaximalGapSetupOfMajorants +@[expose] noncomputable def erlvK3MaximalGapSetupOfMajorants {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} {x z t u : Fin n} (first : K3MajorantWitness P d₁ d₂ d₃ z x) @@ -673,7 +673,7 @@ The acute-angle/nonavoiding-majorants implication is proved in `MajorantArcNesting.lean`. What remains is ErLV's undisplayed strict order of the two inner majorant endpoints: under the draft's side-count convention it is `first.rightMoves + second.leftMoves < 3`. -/ -def ErLVMajorantArcNestingComplete : Prop := +@[expose] def ErLVMajorantArcNestingComplete : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), CyclicStrictConvex P → HasTopThreeDistanceClasses P d₁ d₂ d₃ → (∀ v, 7 ≤ vertexDegree P d₁ d₂ d₃ v) → diff --git a/LeanPool/Erdos132ConvexK3/Lens.lean b/LeanPool/Erdos132ConvexK3/Lens.lean index 630d12b150..70a2839dee 100644 --- a/LeanPool/Erdos132ConvexK3/Lens.lean +++ b/LeanPool/Erdos132ConvexK3/Lens.lean @@ -25,13 +25,13 @@ The P5-1 correction is explicit in the theorem statement: the lower point does not by itself supply `0 < X < 2c`; the diameter bound does. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 /-- The intersection of the two closed radius-`d₁` disks centered at `(0,0)` and `(2c,0)`, where `d₁² = c² + H²`. -/ -def InSharedDiameterLens (c H : ℝ) (v : Point ℝ) : Prop := +@[expose] def InSharedDiameterLens (c H : ℝ) (v : Point ℝ) : Prop := sqDist (0, 0) v ≤ c ^ 2 + H ^ 2 ∧ sqDist (2 * c, 0) v ≤ c ^ 2 + H ^ 2 diff --git a/LeanPool/Erdos132ConvexK3/MajorantArcNesting.lean b/LeanPool/Erdos132ConvexK3/MajorantArcNesting.lean index 65d074cca2..edd27fbd72 100644 --- a/LeanPool/Erdos132ConvexK3/MajorantArcNesting.lean +++ b/LeanPool/Erdos132ConvexK3/MajorantArcNesting.lean @@ -20,7 +20,7 @@ convexity propagates those local inequalities to all four angles of their quadrilateral, contradicting `strict_convex_quad_not_all_acute`. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -856,7 +856,7 @@ theorem k3_inner_endpoint_budget_partition convention. It asks for a jointly minimal pair of actual cover paths whose facing endpoints consume strictly fewer than the three sides between `x` and `t`. -/ -def ErLVInnerEndpointSeparationComplete : Prop := +@[expose] def ErLVInnerEndpointSeparationComplete : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), CyclicStrictConvex P → HasTopThreeDistanceClasses P d₁ d₂ d₃ → (∀ v, 7 ≤ vertexDegree P d₁ d₂ d₃ v) → diff --git a/LeanPool/Erdos132ConvexK3/Majorants.lean b/LeanPool/Erdos132ConvexK3/Majorants.lean index 0480ee4ec4..3791bd1f53 100644 --- a/LeanPool/Erdos132ConvexK3/Majorants.lean +++ b/LeanPool/Erdos132ConvexK3/Majorants.lean @@ -28,7 +28,7 @@ Signed integers are used for arc differences. Thus the case `L < 0`, where `u` precedes `y` in unwrapped order, is represented rather than discarded. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -65,13 +65,13 @@ structure ErLVK3MaximalGapSetup where namespace ErLVK3MaximalGapSetup /-- The maximal-gap slack `δ = gₓ - gₜ`. -/ -def delta (D : ErLVK3MaximalGapSetup) : ℕ := D.gapX - D.gapT +@[expose] def delta (D : ErLVK3MaximalGapSetup) : ℕ := D.gapX - D.gapT /-- The signed side difference `L = |yu|_sides = 3 - δ`. -/ -def L (D : ErLVK3MaximalGapSetup) : ℤ := 3 - (D.delta : ℤ) +@[expose] def L (D : ErLVK3MaximalGapSetup) : ℤ := 3 - (D.delta : ℤ) /-- The signed side difference `|yz| = L + M + b`. -/ -def yzSides (D : ErLVK3MaximalGapSetup) : ℤ := +@[expose] def yzSides (D : ErLVK3MaximalGapSetup) : ℤ := D.L + (D.M : ℤ) + (D.first.rightMoves : ℤ) end ErLVK3MaximalGapSetup @@ -79,7 +79,7 @@ end ErLVK3MaximalGapSetup /-- Maximality gives the exact corrected formula `L = 3 - δ`, not merely ErLV's printed loose upper bound. -/ theorem maximal_gap_L_eq_three_sub_delta (D : ErLVK3MaximalGapSetup) : - D.L = 3 - (D.delta : ℤ) := rfl + D.L = 3 - (D.delta : ℤ) := by rfl /-- The corrected maximal-gap formula implies the sharp signed bound `L ≤ 3`. -/ theorem maximal_gap_L_le_three (D : ErLVK3MaximalGapSetup) : D.L ≤ 3 := by @@ -128,7 +128,7 @@ theorem maximal_gap_signed_yz /-- The five and only five integer rows for which the short-arc inequality `L + M + b ≤ 5` fails under the `k = 3` majorant budgets. -/ -def IsExceptionalMajorantRow (a b L M : ℤ) : Prop := +@[expose] def IsExceptionalMajorantRow (a b L M : ℤ) : Prop := (a = 0 ∧ b = 1 ∧ L = 3 ∧ M = 2) ∨ (a = 1 ∧ b = 1 ∧ L = 3 ∧ M = 2) ∨ (a = 0 ∧ b = 2 ∧ L = 2 ∧ M = 2) ∨ diff --git a/LeanPool/Erdos132ConvexK3/MetricDichotomy.lean b/LeanPool/Erdos132ConvexK3/MetricDichotomy.lean index 954a6925b9..5508fe848b 100644 --- a/LeanPool/Erdos132ConvexK3/MetricDichotomy.lean +++ b/LeanPool/Erdos132ConvexK3/MetricDichotomy.lean @@ -25,7 +25,7 @@ applies uniformly to all four cross-color pairs. The two boundary radicals are retained as exact kernel inequalities. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132ConvexK3/Penultimate.lean b/LeanPool/Erdos132ConvexK3/Penultimate.lean index f0d587773f..081984fda0 100644 --- a/LeanPool/Erdos132ConvexK3/Penultimate.lean +++ b/LeanPool/Erdos132ConvexK3/Penultimate.lean @@ -24,7 +24,7 @@ assumed. The previously implicit P5-4 height constraint is named and used explicitly in every distance-subtraction identity. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean b/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean index 6b7e9a1100..9dda8986df 100644 --- a/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean +++ b/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean @@ -16,14 +16,14 @@ Kernel-reduced checks for the three configurations used during the convex regressions use them without importing the closure stack. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3.Witnesses open LeanPool.Erdos132ConvexK3 /-- Attempt 2's exact integer heptagon, in positive cyclic order. -/ -def heptagon : Fin 7 → Point ℚ := +@[expose] def heptagon : Fin 7 → Point ℚ := ![(0, 0), (72, 0), (45, 68), (40, 75), (36, 77), (32, 75), (27, 68)] theorem heptagon_strict_convex : CyclicStrictConvex heptagon := by @@ -48,7 +48,7 @@ theorem heptagon_x_degree : vertexDegree heptagon 7225 6649 5353 0 = 5 := by decide +kernel /-- Attempt 3's exact nine-point low-altitude insertion witness. -/ -def ninePoint : Fin 9 → Point ℚ := +@[expose] def ninePoint : Fin 9 → Point ℚ := ![(0, 0), (180, -1), (370, -1), (570, 0), (309, 862), (300, 875), (285, 880), (270, 875), (261, 862)] @@ -67,7 +67,7 @@ theorem ninePoint_insertions_isolated : decide +kernel /-- A second exact rational hexagon, in positive cyclic order. -/ -def rationalHexagon : Fin 6 → Point ℚ := +@[expose] def rationalHexagon : Fin 6 → Point ℚ := ![(0, -20), (24171 / 50380, -(12571661 / 629750)), (48331 / 50380, -(12546661 / 629750)), diff --git a/LeanPool/Erdos132ConvexK3/ResidualBounds.lean b/LeanPool/Erdos132ConvexK3/ResidualBounds.lean index 5afe7eeff2..67cc0ba03d 100644 --- a/LeanPool/Erdos132ConvexK3/ResidualBounds.lean +++ b/LeanPool/Erdos132ConvexK3/ResidualBounds.lean @@ -21,7 +21,7 @@ penultimate anti-saturation step, and the two metric regimes of the conditional four-edge cage. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -131,14 +131,14 @@ instance : Fintype CageDistanceBand where cases band <;> simp /-- General row of draft package table (6.5). -/ -def fourEdgeGeneralPackage : CageDistanceBand → ℕ +@[expose] def fourEdgeGeneralPackage : CageDistanceBand → ℕ | .d1 => 4 | .d2 => 3 | .d3 => 1 | .below => 0 /-- Long-metric row of draft package table (6.5). -/ -def fourEdgeLongPackage : CageDistanceBand → ℕ +@[expose] def fourEdgeLongPackage : CageDistanceBand → ℕ | .d1 => 4 | .d2 => 2 | .d3 => 1 diff --git a/LeanPool/Erdos132ConvexK3/TailClosure.lean b/LeanPool/Erdos132ConvexK3/TailClosure.lean index 9fc39a9fd4..1e4ec16a08 100644 --- a/LeanPool/Erdos132ConvexK3/TailClosure.lean +++ b/LeanPool/Erdos132ConvexK3/TailClosure.lean @@ -21,7 +21,7 @@ and same-half-plane two-circle uniqueness leave at most two tail slots (one under the strict anchor). -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132ConvexK3/TerminalCage.lean b/LeanPool/Erdos132ConvexK3/TerminalCage.lean index d87cd7e5ff..10dbb9357a 100644 --- a/LeanPool/Erdos132ConvexK3/TerminalCage.lean +++ b/LeanPool/Erdos132ConvexK3/TerminalCage.lean @@ -25,7 +25,7 @@ The finite branch counts are kept explicit, so the equality and `q=d₃` boundaries cannot disappear inside prose. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132ConvexK3/TerminalColorClosure.lean b/LeanPool/Erdos132ConvexK3/TerminalColorClosure.lean index 8770d63f26..47f85d4188 100644 --- a/LeanPool/Erdos132ConvexK3/TerminalColorClosure.lean +++ b/LeanPool/Erdos132ConvexK3/TerminalColorClosure.lean @@ -19,7 +19,7 @@ It closes the three terminal-color obligations left after `TailClosure.lean`: `(1,2)-d₁`, `(2,1)-d₁`, and `(2,1)-d₂`. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132ConvexK3/UseSite.lean b/LeanPool/Erdos132ConvexK3/UseSite.lean index 86d9756109..1ad1965200 100644 --- a/LeanPool/Erdos132ConvexK3/UseSite.lean +++ b/LeanPool/Erdos132ConvexK3/UseSite.lean @@ -24,7 +24,7 @@ impossible. The use-site package keeps only the data consumed by the branch proofs. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 @@ -48,7 +48,7 @@ structure ErLVAtVertexUseSite (firstCounterclockwiseNeighbor P d₁ d₂ d₃ (cyclicAdvance x 3)) /-- Package an actual contradiction-branch use site. -/ -noncomputable def erlvAtVertexUseSiteOfHighDegree +@[expose] noncomputable def erlvAtVertexUseSiteOfHighDegree {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (hConvex : CyclicStrictConvex P) (hClasses : HasTopThreeDistanceClasses P d₁ d₂ d₃) @@ -72,19 +72,19 @@ noncomputable def erlvAtVertexUseSiteOfHighDegree namespace ErLVAtVertexUseSite /-- The exceptional branch with inner endpoint move counts `(1,2)`. -/ -def Case12 +@[expose] def Case12 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (S : ErLVAtVertexUseSite P d₁ d₂ d₃) : Prop := S.pair.first.rightMoves = 1 ∧ S.pair.second.leftMoves = 2 /-- The exceptional branch with inner endpoint move counts `(2,1)`. -/ -def Case21 +@[expose] def Case21 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (S : ErLVAtVertexUseSite P d₁ d₂ d₃) : Prop := S.pair.first.rightMoves = 2 ∧ S.pair.second.leftMoves = 1 /-- The exceptional branch with inner endpoint move counts `(2,2)`. -/ -def Case22 +@[expose] def Case22 {n : ℕ} [NeZero n] {P : Fin n → Point ℝ} {d₁ d₂ d₃ : ℝ} (S : ErLVAtVertexUseSite P d₁ d₂ d₃) : Prop := S.pair.first.rightMoves = 2 ∧ S.pair.second.leftMoves = 2 @@ -109,7 +109,7 @@ def ErLVAtVertexCase21Impossible : Prop := ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case21 → False /-- The `(2,2)` exceptional branch is impossible at the use site. -/ -def ErLVAtVertexCase22Impossible : Prop := +@[expose] def ErLVAtVertexCase22Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case22 → False @@ -508,7 +508,7 @@ theorem erlv_exceptional_use_site_localization_avoids_five_rows omega /-- The two exact color subcases left at the shared tip in `(1,2)`. -/ -def ErLVAtVertexCase12OtherD1Impossible : Prop := +@[expose] def ErLVAtVertexCase12OtherD1Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case12 → sqDist @@ -517,7 +517,7 @@ def ErLVAtVertexCase12OtherD1Impossible : Prop := (P (cyclicAdvance S.x 1)) = d₁ → False /-- The remaining `d₂` terminal color is impossible in the `(1,2)` branch. -/ -def ErLVAtVertexCase12OtherD2Impossible : Prop := +@[expose] def ErLVAtVertexCase12OtherD2Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case12 → sqDist @@ -537,7 +537,7 @@ theorem erlv_at_vertex_case12_impossible_of_terminal_colors · exact hD2 P d₁ d₂ d₃ S h12 hOtherD2 /-- The mirror terminal-color split left at the shared tip in `(2,1)`. -/ -def ErLVAtVertexCase21OtherD1Impossible : Prop := +@[expose] def ErLVAtVertexCase21OtherD1Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case21 → sqDist (P (cyclicAdvance S.x 2)) @@ -546,7 +546,7 @@ def ErLVAtVertexCase21OtherD1Impossible : Prop := S.pair.second.rightMoves)) = d₁ → False /-- The remaining `d₂` terminal color is impossible in the `(2,1)` branch. -/ -def ErLVAtVertexCase21OtherD2Impossible : Prop := +@[expose] def ErLVAtVertexCase21OtherD2Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case21 → sqDist (P (cyclicAdvance S.x 2)) @@ -568,21 +568,21 @@ theorem erlv_at_vertex_case21_impossible_of_terminal_colors /-- Four exact top-two cross-color subcases left in `(2,2)`. The `d₂` subcases are the only ones even color-compatible with the terminal `d₂` cage; the `d₁` subcases require a different full-two-rung adapter. -/ -def ErLVAtVertexCase22ZTD1Impossible : Prop := +@[expose] def ErLVAtVertexCase22ZTD1Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case22 → sqDist (P (firstClockwiseNeighbor P d₁ d₂ d₃ S.x)) (P (cyclicAdvance S.x 3)) = d₁ → False /-- The `zt = d₂` cross-color subcase is impossible in the `(2,2)` branch. -/ -def ErLVAtVertexCase22ZTD2Impossible : Prop := +@[expose] def ErLVAtVertexCase22ZTD2Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case22 → sqDist (P (firstClockwiseNeighbor P d₁ d₂ d₃ S.x)) (P (cyclicAdvance S.x 3)) = d₂ → False /-- The `xu = d₁` cross-color subcase is impossible in the `(2,2)` branch. -/ -def ErLVAtVertexCase22XUD1Impossible : Prop := +@[expose] def ErLVAtVertexCase22XUD1Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case22 → sqDist (P S.x) @@ -590,7 +590,7 @@ def ErLVAtVertexCase22XUD1Impossible : Prop := (cyclicAdvance S.x 3))) = d₁ → False /-- The `xu = d₂` cross-color subcase is impossible in the `(2,2)` branch. -/ -def ErLVAtVertexCase22XUD2Impossible : Prop := +@[expose] def ErLVAtVertexCase22XUD2Impossible : Prop := ∀ {n : ℕ} [NeZero n] (P : Fin n → Point ℝ) (d₁ d₂ d₃ : ℝ), ∀ S : ErLVAtVertexUseSite P d₁ d₂ d₃, S.Case22 → sqDist (P S.x) diff --git a/LeanPool/Erdos132ConvexK3/Witnesses.lean b/LeanPool/Erdos132ConvexK3/Witnesses.lean index a96cf0251e..b3cc490a33 100644 --- a/LeanPool/Erdos132ConvexK3/Witnesses.lean +++ b/LeanPool/Erdos132ConvexK3/Witnesses.lean @@ -21,7 +21,7 @@ Explicit real configurations inhabit each of the thirteen exceptional-word realization predicates routed through the four shared closure families. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3.Witnesses diff --git a/LeanPool/Erdos132ConvexK3/WordClosures.lean b/LeanPool/Erdos132ConvexK3/WordClosures.lean index 855850cff0..2187d4c04e 100644 --- a/LeanPool/Erdos132ConvexK3/WordClosures.lean +++ b/LeanPool/Erdos132ConvexK3/WordClosures.lean @@ -26,7 +26,7 @@ quadrilateral and half-plane facts, and pointwise arc partitions. All degree and cardinality bounds are conclusions of the theorems below. -/ -@[expose] public section +public section namespace LeanPool.Erdos132ConvexK3 diff --git a/LeanPool/Erdos132N14.lean b/LeanPool/Erdos132N14.lean index 6b94e967b1..d7f87a5081 100644 --- a/LeanPool/Erdos132N14.lean +++ b/LeanPool/Erdos132N14.lean @@ -19,7 +19,7 @@ Tags: discrete-geometry, few-distance-sets, erdos-problems, planar-configuration MSC: 52C10, 05D99 -/ -@[expose] public section +public section /-! # A conditional fourteen-point case of Erdős Problem 132 diff --git a/LeanPool/Erdos132N14/Basic.lean b/LeanPool/Erdos132N14/Basic.lean index 3953e24389..6a60453333 100644 --- a/LeanPool/Erdos132N14/Basic.lean +++ b/LeanPool/Erdos132N14/Basic.lean @@ -16,7 +16,7 @@ The definitions work on a selected finite subset of a labelled configuration, which makes deletion and insertion statements literal finset identities. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 @@ -33,10 +33,11 @@ structure Configuration (ι : Type*) where variable {ι κ : Type*} [LinearOrder ι] /-- The unordered pairs in `S`, represented by their increasing orientation. -/ -def pairs (S : Finset ι) : Finset (ι × ι) := +@[expose] def pairs (S : Finset ι) : Finset (ι × ι) := (S ×ˢ S).filter fun e ↦ e.1 < e.2 /-- The increasing representative of the unordered pair containing `v` and `w`. -/ +@[expose] def pairWith (v w : ι) : ι × ι := if w < v then (w, v) else (v, w) @@ -144,7 +145,7 @@ theorem pairWith_map_injectiveOn_orderedPairs namespace Configuration /-- The Euclidean length belonging to an indexed pair. -/ -def pairDistance (P : Configuration ι) (e : ι × ι) : ℝ := +@[expose] def pairDistance (P : Configuration ι) (e : ι × ι) : ℝ := dist (P.point e.1) (P.point e.2) /-- The positive distances realized inside `S`. -/ @@ -152,11 +153,12 @@ def realizedDistances (P : Configuration ι) (S : Finset ι) : Finset ℝ := (pairs S).image P.pairDistance /-- The number of unordered pairs in `S` at distance `d`. -/ +@[expose] def distanceMultiplicity (P : Configuration ι) (S : Finset ι) (d : ℝ) : ℕ := ((pairs S).filter fun e ↦ P.pairDistance e = d).card /-- Realized distances represented by at most `threshold` unordered pairs. -/ -def lowMultiplicityDistances +@[expose] def lowMultiplicityDistances (P : Configuration ι) (S : Finset ι) (threshold : ℕ) : Finset ℝ := (P.realizedDistances S).filter fun d ↦ P.distanceMultiplicity S d ≤ threshold @@ -247,6 +249,7 @@ theorem sum_distanceMultiplicity (P : Configuration ι) (S : Finset ι) : _ = (pairs S).card := hsubtype /-- Number of new edges of length `d` created by inserting `v` into `S`. -/ +@[expose] def insertionMultiplicity (P : Configuration ι) (v : ι) (S : Finset ι) (d : ℝ) : ℕ := (S.filter fun w ↦ dist (P.point v) (P.point w) = d).card diff --git a/LeanPool/Erdos132N14/DiameterDescent.lean b/LeanPool/Erdos132N14/DiameterDescent.lean index 0f2a2c9780..d0a738ac4d 100644 --- a/LeanPool/Erdos132N14/DiameterDescent.lean +++ b/LeanPool/Erdos132N14/DiameterDescent.lean @@ -18,7 +18,7 @@ It then deletes one endpoint of the unique pair in the first class and proves that the realized-distance set is exactly the old set with that class erased. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 @@ -152,13 +152,13 @@ namespace FourteenFailureExactProfile variable {P : Configuration (Fin 14)} (profile : FourteenFailureExactProfile P) /-- The deleted endpoint of the unique rare pair. -/ -def deletedVertex : Fin 14 := profile.rarePair.1 +@[expose] def deletedVertex : Fin 14 := profile.rarePair.1 /-- The other endpoint of the unique rare pair. -/ -def retainedEndpoint : Fin 14 := profile.rarePair.2 +@[expose] def retainedEndpoint : Fin 14 := profile.rarePair.2 /-- The thirteen labels left after endpoint deletion. -/ -def remaining : Finset (Fin 14) := Finset.univ.erase profile.deletedVertex +@[expose] def remaining : Finset (Fin 14) := Finset.univ.erase profile.deletedVertex theorem rarePair_mem : profile.rarePair ∈ pairs (Finset.univ : Finset (Fin 14)) := by have hmem : profile.rarePair ∈ diff --git a/LeanPool/Erdos132N14/HopfPannwitz.lean b/LeanPool/Erdos132N14/HopfPannwitz.lean index 408efb7a95..7a3a39c57b 100644 --- a/LeanPool/Erdos132N14/HopfPannwitz.lean +++ b/LeanPool/Erdos132N14/HopfPannwitz.lean @@ -17,7 +17,7 @@ is assigned to a clockwise-extreme endpoint, and the signed-area lemmas show that no endpoint can receive two different edges. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 @@ -282,6 +282,7 @@ theorem diameterEdges_card_le /-- Every fourteen-point planar configuration has a realized distance represented by at most fourteen unordered pairs. -/ +@[expose] def HopfPannwitzLowMultiplicityDistance14 : Prop := ∀ P : Configuration (Fin 14), ∃ d ∈ P.realizedDistances Finset.univ, diff --git a/LeanPool/Erdos132N14/HopfPannwitzGeometry.lean b/LeanPool/Erdos132N14/HopfPannwitzGeometry.lean index 8c1eec8559..d970691b39 100644 --- a/LeanPool/Erdos132N14/HopfPannwitzGeometry.lean +++ b/LeanPool/Erdos132N14/HopfPannwitzGeometry.lean @@ -15,7 +15,7 @@ of the planar diameter bound. Working with dot products and signed areas keeps all collinear cases explicit and avoids a general-position assumption. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 @@ -30,7 +30,7 @@ def planeCross (z w : ℂ) : ℝ := z.re * w.im - z.im * w.re /-- The signed turn from the ray `a ⟶ b` to the ray `a ⟶ c`. -/ -def planeTurn (a b c : ℂ) : ℝ := +@[expose] def planeTurn (a b c : ℂ) : ℝ := planeCross (b - a) (c - a) theorem planeDot_self (z : ℂ) : diff --git a/LeanPool/Erdos132N14/Main.lean b/LeanPool/Erdos132N14/Main.lean index 928072fe20..4800ecf635 100644 --- a/LeanPool/Erdos132N14/Main.lean +++ b/LeanPool/Erdos132N14/Main.lean @@ -22,7 +22,7 @@ The planar diameter bound is proved internally. It does not settle Erdős Problem 132 in general. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 diff --git a/LeanPool/Erdos132N14/PublishedInputs.lean b/LeanPool/Erdos132N14/PublishedInputs.lean index e7e6133771..b4c5fee84b 100644 --- a/LeanPool/Erdos132N14/PublishedInputs.lean +++ b/LeanPool/Erdos132N14/PublishedInputs.lean @@ -24,7 +24,7 @@ paper and returns only a genuine Euclidean distance-scaling similarity to one of the three explicit coordinate templates. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 @@ -43,14 +43,14 @@ inductive ThirteenPointSixDistanceClassification /-- Published planar few-distance input: a set determining at most six distances has at most thirteen points. This combines the known maxima through five distances with Wei's exact six-distance theorem `g(6) = 13`. -/ -def PublishedAtMostSixDistanceCardinalityBound : Prop := +@[expose] def PublishedAtMostSixDistanceCardinalityBound : Prop := ∀ {ι : Type} [Fintype ι] [LinearOrder ι] (P : Configuration ι) (S : Finset ι), (P.realizedDistances S).card ≤ 6 → S.card ≤ 13 /-- Published Szöllősi--Östergård input: every thirteen-point planar six-distance set is similar to one of the three explicit templates. -/ -def SzollosiOstergardThirteenPointSixDistanceClassification : Prop := +@[expose] def SzollosiOstergardThirteenPointSixDistanceClassification : Prop := ∀ {ι : Type} [Fintype ι] [LinearOrder ι] (P : Configuration ι) (S : Finset ι), S.card = 13 → (P.realizedDistances S).card = 6 → diff --git a/LeanPool/Erdos132N14/RegularTridecagon.lean b/LeanPool/Erdos132N14/RegularTridecagon.lean index a69c26b915..eea069a36a 100644 --- a/LeanPool/Erdos132N14/RegularTridecagon.lean +++ b/LeanPool/Erdos132N14/RegularTridecagon.lean @@ -20,7 +20,7 @@ and centered regular hexagram are also given by explicit complex coordinates; their high-multiplicity classes are checked inside Lean. -/ -@[expose] public section +public section namespace LeanPool.Erdos132N14 @@ -51,7 +51,7 @@ theorem regularTridecagonPoint_injective : exact regularThirteenRoot_isPrimitive.pow_inj i.isLt j.isLt hij /-- The regular tridecagon as a labelled planar configuration. -/ -def regularTridecagon : Configuration (Fin 13) where +@[expose] def regularTridecagon : Configuration (Fin 13) where point := regularTridecagonPoint injective := regularTridecagonPoint_injective @@ -90,7 +90,7 @@ theorem sum_regularTridecagonPoint_sq : exact hprimitiveSquare.geom_sum_eq_zero (by norm_num) /-- The real Euclidean scalar product on complex coordinates. -/ -def planeDot (x y : ℂ) : ℝ := +@[expose] def planeDot (x y : ℂ) : ℝ := x.re * y.re + x.im * y.im theorem normSq_sub (x y : ℂ) : diff --git a/LeanPool/Erdos132ThreeChain.lean b/LeanPool/Erdos132ThreeChain.lean index cd92473d95..e958934254 100644 --- a/LeanPool/Erdos132ThreeChain.lean +++ b/LeanPool/Erdos132ThreeChain.lean @@ -26,4 +26,4 @@ Tags: discrete-geometry, distance-geometry, erdos-problems MSC: 52C10, 52C35, 05C69 -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos132ThreeChain/Basic.lean b/LeanPool/Erdos132ThreeChain/Basic.lean index b6d2ae7af4..485ebd8481 100644 --- a/LeanPool/Erdos132ThreeChain/Basic.lean +++ b/LeanPool/Erdos132ThreeChain/Basic.lean @@ -31,7 +31,7 @@ Everything is deliberately self-contained and coordinate-based: `Point` is `ℝ (Heron, the anchored Gram determinant) is provable by `ring` from coordinates. -/ -@[expose] public section +public section namespace Erdos132ThreeChain @@ -39,7 +39,7 @@ namespace Erdos132ThreeChain abbrev Point : Type := ℝ × ℝ /-- The squared Euclidean distance between two points of the plane. -/ -def sqDist (p q : Point) : ℝ := (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 +@[expose] def sqDist (p q : Point) : ℝ := (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 @[simp] theorem sqDist_self (p : Point) : sqDist p p = 0 := by simp [sqDist] @@ -68,11 +68,11 @@ theorem sqDist_pos {p q : Point} (h : p ≠ q) : 0 < sqDist p q := /-- `IsSqDiameter X D` says that `D` is the squared diameter of `X`: it is realised by two distinct points of `X`, and it dominates every squared distance inside `X`. -/ -def IsSqDiameter (X : Finset Point) (D : ℝ) : Prop := +@[expose] def IsSqDiameter (X : Finset Point) (D : ℝ) : Prop := (∃ p ∈ X, ∃ q ∈ X, p ≠ q ∧ sqDist p q = D) ∧ ∀ p ∈ X, ∀ q ∈ X, sqDist p q ≤ D /-- The geometric 3-chain of length `h` and base `a`: the set `{a * 3 ^ j | j < h}`. -/ -def chain (a : ℝ) (h : ℕ) : Set ℝ := {x : ℝ | ∃ j < h, x = a * 3 ^ j} +@[expose] def chain (a : ℝ) (h : ℕ) : Set ℝ := {x : ℝ | ∃ j < h, x = a * 3 ^ j} theorem mem_chain_iff {a x : ℝ} {h : ℕ} : x ∈ chain a h ↔ ∃ j < h, x = a * 3 ^ j := Iff.rfl @@ -84,13 +84,13 @@ theorem triple_base_mem_chain {a : ℝ} {h : ℕ} (hh : 2 ≤ h) : a * 3 ∈ cha /-- The set of squared distances realised by distinct points of `X` that are not the squared diameter `D`. -/ -def nonDiameterSqDists (X : Finset Point) (D : ℝ) : Set ℝ := +@[expose] def nonDiameterSqDists (X : Finset Point) (D : ℝ) : Set ℝ := {d : ℝ | ∃ p ∈ X, ∃ q ∈ X, p ≠ q ∧ sqDist p q = d ∧ d ≠ D} /-- `IsChainValue c x` records that `x` is `c` times a nonnegative power of three. It is the scale-free shadow of `chain`: if `c` is the smallest value of a chain that `x` belongs to, then `x = c * 3 ^ j` for some `j : ℕ`. -/ -def IsChainValue (c x : ℝ) : Prop := ∃ j : ℕ, x = c * 3 ^ j +@[expose] def IsChainValue (c x : ℝ) : Prop := ∃ j : ℕ, x = c * 3 ^ j theorem IsChainValue.pos {c x : ℝ} (hc : 0 < c) (h : IsChainValue c x) : 0 < x := by obtain ⟨j, rfl⟩ := h diff --git a/LeanPool/Erdos132ThreeChain/CaroWei.lean b/LeanPool/Erdos132ThreeChain/CaroWei.lean index d7f2a89c69..a8365c19f0 100644 --- a/LeanPool/Erdos132ThreeChain/CaroWei.lean +++ b/LeanPool/Erdos132ThreeChain/CaroWei.lean @@ -31,7 +31,7 @@ bound into a lower bound on the independence number, and integrality upgrades `n independent set of size `5` once `n ≥ 13`. -/ -@[expose] public section +public section namespace Erdos132ThreeChain @@ -40,7 +40,7 @@ open Finset variable {α : Type*} /-- The degree of `v` in the graph that `adj` induces on the vertex set `V`. -/ -def degree (adj : α → α → Prop) [DecidableRel adj] (V : Finset α) (v : α) : ℕ := +@[expose] def degree (adj : α → α → Prop) [DecidableRel adj] (V : Finset α) (v : α) : ℕ := (V.filter (adj v)).card theorem degree_mono {adj : α → α → Prop} [DecidableRel adj] {V W : Finset α} (h : W ⊆ V) diff --git a/LeanPool/Erdos132ThreeChain/FivePoints.lean b/LeanPool/Erdos132ThreeChain/FivePoints.lean index 605512e4d1..9301cb5f96 100644 --- a/LeanPool/Erdos132ThreeChain/FivePoints.lean +++ b/LeanPool/Erdos132ThreeChain/FivePoints.lean @@ -32,7 +32,7 @@ every three-vector Gram matrix in the plane forces each triple product `⟪u i, This is the five-point Gram obstruction in its scale-free form. -/ -@[expose] public section +public section namespace Erdos132ThreeChain diff --git a/LeanPool/Erdos132ThreeChain/FourPoints.lean b/LeanPool/Erdos132ThreeChain/FourPoints.lean index ec8012e6fd..50648df391 100644 --- a/LeanPool/Erdos132ThreeChain/FourPoints.lean +++ b/LeanPool/Erdos132ThreeChain/FourPoints.lean @@ -35,7 +35,7 @@ distances lie in the single adjacent pair `{c, 3 * c}`: no planar chain quadrupl steps of the chain. -/ -@[expose] public section +public section namespace Erdos132ThreeChain diff --git a/LeanPool/Erdos132ThreeChain/HopfPannwitz.lean b/LeanPool/Erdos132ThreeChain/HopfPannwitz.lean index b57be051c9..76df953c12 100644 --- a/LeanPool/Erdos132ThreeChain/HopfPannwitz.lean +++ b/LeanPool/Erdos132ThreeChain/HopfPannwitz.lean @@ -42,14 +42,14 @@ satisfies `⟪B, w - v⟫ = |w - v|² / 2` while `⟪A, w - v⟫` and `⟪C, w - pairing Cramer's identity with `w - v` forces `|w - v|² ≤ 0`, i.e. `w = v`. -/ -@[expose] public section +public section namespace Erdos132ThreeChain open Finset /-- Adjacency in the diameter graph: distinct points at squared distance exactly `D`. -/ -def DiameterAdj (D : ℝ) (p q : Point) : Prop := p ≠ q ∧ sqDist p q = D +@[expose] def DiameterAdj (D : ℝ) (p q : Point) : Prop := p ≠ q ∧ sqDist p q = D noncomputable instance decidableDiameterAdj (D : ℝ) : DecidableRel (DiameterAdj D) := fun _ _ => inferInstanceAs (Decidable (_ ∧ _)) diff --git a/LeanPool/Erdos132ThreeChain/Plane.lean b/LeanPool/Erdos132ThreeChain/Plane.lean index 457bfefbcb..be96267580 100644 --- a/LeanPool/Erdos132ThreeChain/Plane.lean +++ b/LeanPool/Erdos132ThreeChain/Plane.lean @@ -30,13 +30,13 @@ identity in the coordinates of the points involved, so each is proved by `ring`. with `sq_nonneg_combo` it supplies the five-point obstruction. -/ -@[expose] public section +public section namespace Erdos132ThreeChain /-- Twice the signed area of the triangle `p q r`; equivalently the two-dimensional cross product of `q - p` and `r - p`. -/ -def cross (p q r : Point) : ℝ := (q.1 - p.1) * (r.2 - p.2) - (r.1 - p.1) * (q.2 - p.2) +@[expose] def cross (p q r : Point) : ℝ := (q.1 - p.1) * (r.2 - p.2) - (r.1 - p.1) * (q.2 - p.2) /-- Heron's formula in squared-distance form: the Cayley--Menger expression of a triangle is four times the square of its doubled signed area. -/ @@ -52,7 +52,7 @@ theorem sq_le_four_mul (p q r : Point) : nlinarith [sq_nonneg (cross p q r)] /-- The inner product of `p - o` and `q - o`. -/ -def dotp (o p q : Point) : ℝ := (p.1 - o.1) * (q.1 - o.1) + (p.2 - o.2) * (q.2 - o.2) +@[expose] def dotp (o p q : Point) : ℝ := (p.1 - o.1) * (q.1 - o.1) + (p.2 - o.2) * (q.2 - o.2) theorem dotp_self (o p : Point) : dotp o p p = sqDist p o := by simp only [dotp, sqDist]; ring @@ -63,7 +63,7 @@ theorem two_mul_dotp (o p q : Point) : /-- The determinant of the doubled Gram matrix of `b - a`, `c - a`, `d - a`, written in the six squared distances of `a`, `b`, `c`, `d`. -/ -def gramDet (dab dac dad dbc dbd dcd : ℝ) : ℝ := +@[expose] def gramDet (dab dac dad dbc dbd dcd : ℝ) : ℝ := 2 * dab * (2 * dac * (2 * dad) - (dac + dad - dcd) ^ 2) - (dab + dac - dbc) * ((dab + dac - dbc) * (2 * dad) - (dac + dad - dcd) * (dab + dad - dbd)) diff --git a/LeanPool/Erdos132ThreeChain/PowerThree.lean b/LeanPool/Erdos132ThreeChain/PowerThree.lean index d3d5d4def6..a44b11fdb4 100644 --- a/LeanPool/Erdos132ThreeChain/PowerThree.lean +++ b/LeanPool/Erdos132ThreeChain/PowerThree.lean @@ -23,7 +23,7 @@ This file isolates them. Everything is stated over `ℤ`; the geometric files p corresponding real equations and transfer them by `exact_mod_cast`. -/ -@[expose] public section +public section namespace Erdos132ThreeChain diff --git a/LeanPool/Erdos132ThreeChain/Statement.lean b/LeanPool/Erdos132ThreeChain/Statement.lean index 202235d7bc..480aba442b 100644 --- a/LeanPool/Erdos132ThreeChain/Statement.lean +++ b/LeanPool/Erdos132ThreeChain/Statement.lean @@ -43,7 +43,7 @@ numbered result anywhere else. Hopf--Pannwitz (1934) and Caro--Wei are classica but their Lean proofs here are written from scratch. -/ -@[expose] public section +public section namespace Erdos132ThreeChain diff --git a/LeanPool/Erdos132ThreeChain/Support.lean b/LeanPool/Erdos132ThreeChain/Support.lean index 500103c93f..69afeefe46 100644 --- a/LeanPool/Erdos132ThreeChain/Support.lean +++ b/LeanPool/Erdos132ThreeChain/Support.lean @@ -26,7 +26,7 @@ whose pairwise squared distances lie in a geometric 3-chain, selects a shortest and rescales the chain so that the shortest edge has squared length exactly the new base. -/ -@[expose] public section +public section namespace Erdos132ThreeChain diff --git a/LeanPool/Erdos132ThreeChain/Witnesses.lean b/LeanPool/Erdos132ThreeChain/Witnesses.lean index e0452d1a2c..f93a8017be 100644 --- a/LeanPool/Erdos132ThreeChain/Witnesses.lean +++ b/LeanPool/Erdos132ThreeChain/Witnesses.lean @@ -24,7 +24,7 @@ one) and the equilateral triangle together with its centroid (three short edges ones). Both have all six squared distances inside the adjacent pair `{1, 3}`. -/ -@[expose] public section +public section namespace Erdos132ThreeChain diff --git a/LeanPool/Erdos137.lean b/LeanPool/Erdos137.lean index abdb103d1d..4b592ef623 100644 --- a/LeanPool/Erdos137.lean +++ b/LeanPool/Erdos137.lean @@ -34,4 +34,4 @@ Tags: number-theory, powerful-numbers, erdos-problems MSC: 11A51, 11N25 -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos137/AxiomAudit.lean b/LeanPool/Erdos137/AxiomAudit.lean index 85dfe7234f..d93ebdd344 100644 --- a/LeanPool/Erdos137/AxiomAudit.lean +++ b/LeanPool/Erdos137/AxiomAudit.lean @@ -46,4 +46,4 @@ The routes assembled here are: * the term-level rough-part anatomy (`RoughPartStructure`). -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos137/Base.lean b/LeanPool/Erdos137/Base.lean index 810bc53490..45bf5a7dab 100644 --- a/LeanPool/Erdos137/Base.lean +++ b/LeanPool/Erdos137/Base.lean @@ -36,7 +36,7 @@ None of these mentions any block length `g` (or the concrete `B`/`W`/`overlap` o are proved once here and reused verbatim downstream. -/ -@[expose] public section +public section namespace Erdos137 @@ -189,11 +189,11 @@ lemma div_le_factorization_factorial {k p : ℕ} (hp : p.Prime) : /-! ## The primorial-type quantities `P k` and `L k` -/ /-- `P k = ∏_{p ∈ primesBelow k} p` — the product of the primes `< k` (the primorial of `k`). -/ -def P (k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow k, p +@[expose] def P (k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow k, p /-- `L k = ∏_{p ∈ primesBelow k} p ^ (k / p)` — the smooth-part lower bound (`L ∣ k!` by Legendre, `L = (k!)^{1-o(1)}`). -/ -def L (k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow k, p ^ (k / p) +@[expose] def L (k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow k, p ^ (k / p) lemma P_pos (k : ℕ) : 1 ≤ P k := Finset.one_le_prod fun _p hp => (Nat.prime_of_mem_primesBelow hp).one_le diff --git a/LeanPool/Erdos137/BlockFramework.lean b/LeanPool/Erdos137/BlockFramework.lean index c1fbda8d51..b9751e927c 100644 --- a/LeanPool/Erdos137/BlockFramework.lean +++ b/LeanPool/Erdos137/BlockFramework.lean @@ -97,7 +97,7 @@ sharper exponent only via the unformalized Mertens reading. The crude `g = 3` in recorded `not_powerful_of_large` threshold `n > k^6` exactly. -/ -@[expose] public section +public section namespace Erdos137 @@ -114,12 +114,12 @@ def Bg (g k n : ℕ) : ℕ := ∏ j ∈ Finset.range (k / g), F g (n + g * j) /-- `overlapg g p = ∑_j [p ∈ (F g (n+g·j)).primeFactors]` is the number of `g`-blocks `p` divides. Generic form of `overlap`/`overlap5`. -/ -def overlapg (g k n p : ℕ) : ℕ := +@[expose] def overlapg (g k n p : ℕ) : ℕ := ∑ j ∈ Finset.range (k / g), if p ∈ (F g (n + g * j)).primeFactors then 1 else 0 /-- The over-count `Wg g k n := ∏_{p ∈ (Bg g k n).primeFactors} p ^ (overlapg p − 1)`. Generic form of `W`/`W5`. -/ -def Wg (g k n : ℕ) : ℕ := +@[expose] def Wg (g k n : ℕ) : ℕ := ∏ p ∈ (Bg g k n).primeFactors, p ^ (overlapg g k n p - 1) /-- The product over the `⌊k/g⌋` blocks, `∏_{j<⌊k/g⌋} F g (n + g·j)`, equals `F (g · ⌊k/g⌋) n`. @@ -410,7 +410,7 @@ theorem Wg_le_pow (hg : 1 ≤ g) {k n : ℕ} (hn : 1 ≤ n) : Wg g k n ≤ k ^ k abc/Langevin statement): packages the abc constant, epsilon loss, and omitted tail. The guard `g ≤ k` is essential — for `g > k` there are no `g`-blocks (`⌊k/g⌋ = 0`), the RHS is the empty product `1`, and `(F k n)^{(g-1)/g} ≤ 1` would be inconsistent. -/ -def BlockRadLBg (g : ℕ) : Prop := +@[expose] def BlockRadLBg (g : ℕ) : Prop := ∀ k n : ℕ, g ≤ k → 1 ≤ n → (F k n : ℝ) ^ (((g : ℝ) - 1) / (g : ℝ)) ≤ ((∏ j ∈ Finset.range (k / g), rad (F g (n + g * j)) : ℕ) : ℝ) diff --git a/LeanPool/Erdos137/CombinedSplice.lean b/LeanPool/Erdos137/CombinedSplice.lean index 3402d34781..21325358e6 100644 --- a/LeanPool/Erdos137/CombinedSplice.lean +++ b/LeanPool/Erdos137/CombinedSplice.lean @@ -37,7 +37,7 @@ BHP, Pandey, Mertens, or abc. This is the four-range analogue of range and the high range. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/Finiteness.lean b/LeanPool/Erdos137/Finiteness.lean index f0a189072f..928f6e1ca6 100644 --- a/LeanPool/Erdos137/Finiteness.lean +++ b/LeanPool/Erdos137/Finiteness.lean @@ -31,7 +31,7 @@ and Langevin / Granville; this is a formalization of the deduction, not a new re The radical bound `RadLB` is the only nonelementary input and appears as a hypothesis. -/ -@[expose] public section +public section namespace Erdos137 @@ -43,14 +43,14 @@ noncomputable section /-! ### Definitions -/ /-- The radical of `m`: product of its distinct prime factors. rad(0) = rad(1) = 1 by convention. -/ -def rad (m : ℕ) : ℕ := ∏ p ∈ m.factorization.support, p +@[expose] def rad (m : ℕ) : ℕ := ∏ p ∈ m.factorization.support, p /-- The 2-full (powerful) part of `m`: product of p^{a_p} over primes with a_p ≥ 2. -/ def B2 (m : ℕ) : ℕ := ∏ p ∈ m.factorization.support.filter (fun p => 2 ≤ m.factorization p), p ^ m.factorization p /-- Product of k consecutive integers starting at n. -/ -def F (k n : ℕ) : ℕ := ∏ i ∈ Finset.range k, (n + i) +@[expose] def F (k n : ℕ) : ℕ := ∏ i ∈ Finset.range k, (n + i) /-! ### Auxiliary lemmas -/ @@ -147,7 +147,7 @@ def RadLB (k : ℕ) : Prop := /-- `N` is **powerful** if every prime dividing `N` divides it with multiplicity at least two, i.e. `p ∣ N → p ^ 2 ∣ N` for all primes `p`. -/ -def Powerful (N : ℕ) : Prop := ∀ p : ℕ, p.Prime → p ∣ N → p ^ 2 ∣ N +@[expose] def Powerful (N : ℕ) : Prop := ∀ p : ℕ, p.Prime → p ∣ N → p ^ 2 ∣ N /-- For powerful `N`, the 2-full part `B2 N` is all of `N`. -/ theorem powerful_B2_eq {N : ℕ} (hN : N ≠ 0) (hP : Powerful N) : B2 N = N := by diff --git a/LeanPool/Erdos137/JointFiniteness.lean b/LeanPool/Erdos137/JointFiniteness.lean index d30979d666..ee0d5c7565 100644 --- a/LeanPool/Erdos137/JointFiniteness.lean +++ b/LeanPool/Erdos137/JointFiniteness.lean @@ -81,7 +81,7 @@ unconditional squarefree-value count for `n < k^{5+δ}` would give full joint `( That last unconditional input (Pandey) is not formalized here. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/QuarticCrude.lean b/LeanPool/Erdos137/QuarticCrude.lean index 1ad92a3714..533ed3e397 100644 --- a/LeanPool/Erdos137/QuarticCrude.lean +++ b/LeanPool/Erdos137/QuarticCrude.lean @@ -43,7 +43,7 @@ The ONLY hypothesis is `BlockRadLB4` (the `g = 4` instance of `BlockRadLBg`); it an `axiom`, so it does not appear in any axiom footprint. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/RefinedOverlap.lean b/LeanPool/Erdos137/RefinedOverlap.lean index 965e890673..318bf19406 100644 --- a/LeanPool/Erdos137/RefinedOverlap.lean +++ b/LeanPool/Erdos137/RefinedOverlap.lean @@ -74,7 +74,7 @@ logarithm `k log(k/g) + O(k)`. inequalities of `BlockFramework`, restated with `WgRefinedCap g k` in place of `k^k`. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/RoughPartStructure.lean b/LeanPool/Erdos137/RoughPartStructure.lean index 3a6d998d4c..f1876330f4 100644 --- a/LeanPool/Erdos137/RoughPartStructure.lean +++ b/LeanPool/Erdos137/RoughPartStructure.lean @@ -23,7 +23,7 @@ anatomy behind Tao's "very bad interval" language. No abc, no radical lower boun number theory. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/SexticCrude.lean b/LeanPool/Erdos137/SexticCrude.lean index 4cb442400d..3bbcd23cdc 100644 --- a/LeanPool/Erdos137/SexticCrude.lean +++ b/LeanPool/Erdos137/SexticCrude.lean @@ -43,7 +43,7 @@ The ONLY hypothesis is `BlockRadLB6` (the `g = 6` instance of `BlockRadLBg`); it an `axiom`, so it does not appear in any axiom footprint. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/SmoothRefinement.lean b/LeanPool/Erdos137/SmoothRefinement.lean index 14e43940d0..3d5d753dc6 100644 --- a/LeanPool/Erdos137/SmoothRefinement.lean +++ b/LeanPool/Erdos137/SmoothRefinement.lean @@ -36,7 +36,7 @@ The smooth-refined master inequality `master_ineq` is the `g = 3` instance of th (via `blockRadLB_iff`). -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/SpliceFiniteness.lean b/LeanPool/Erdos137/SpliceFiniteness.lean index c01df1c840..100f80a5b2 100644 --- a/LeanPool/Erdos137/SpliceFiniteness.lean +++ b/LeanPool/Erdos137/SpliceFiniteness.lean @@ -66,7 +66,7 @@ faithful instantiation would carry a finite-exception clause. abc remain open. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/SquarefreeCapacity.lean b/LeanPool/Erdos137/SquarefreeCapacity.lean index 55c9d82635..b98c292374 100644 --- a/LeanPool/Erdos137/SquarefreeCapacity.lean +++ b/LeanPool/Erdos137/SquarefreeCapacity.lean @@ -75,7 +75,7 @@ powerful. * `not_powerful_of_sqfree_count_beats_fourk` : explicit count ⟹ non-powerful obstruction. -/ -@[expose] public section +public section namespace Erdos137 diff --git a/LeanPool/Erdos137/TaoPoint.lean b/LeanPool/Erdos137/TaoPoint.lean index 1b5b40805e..b7f62e7a83 100644 --- a/LeanPool/Erdos137/TaoPoint.lean +++ b/LeanPool/Erdos137/TaoPoint.lean @@ -45,7 +45,7 @@ relation extraction that is Tao's next step is likewise not formalized. factor and exceeds the block length prevents powerfulness. -/ -@[expose] public section +public section namespace Erdos137 @@ -58,7 +58,7 @@ noncomputable section `F k n = ∏_{i (1, 0) | j + 1 => let (x, y) := pellXY j; (3 * x + 8 * y, x + 3 * y) /-- X component of Pell solutions for `x² - 8y² = 1`. -/ +@[expose] def pellX (j : ℕ) : ℤ := (pellXY j).1 /-- Y component of Pell solutions for `x² - 8y² = 1`. -/ +@[expose] def pellY (j : ℕ) : ℤ := (pellXY j).2 @[simp] lemma pellX_zero : pellX 0 = 1 := rfl diff --git a/LeanPool/Erdos367/RFullLowerBound.lean b/LeanPool/Erdos367/RFullLowerBound.lean index 08ac9542bf..43ac9e93a9 100644 --- a/LeanPool/Erdos367/RFullLowerBound.lean +++ b/LeanPool/Erdos367/RFullLowerBound.lean @@ -30,7 +30,7 @@ Main theorem: for odd r ≥ 1 and q ≥ 2, with n = (q^r - 1)^r, (iv) (B_r(n) · B_r(n+1))^r > n^{r+1}. -/ -@[expose] public section +public section namespace RFullOdd diff --git a/LeanPool/Erdos403.lean b/LeanPool/Erdos403.lean index ad6597e791..9ff6ca6b17 100644 --- a/LeanPool/Erdos403.lean +++ b/LeanPool/Erdos403.lean @@ -26,4 +26,4 @@ Tags: number-theory, factorials, erdos-problems MSC: 11B83 -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos403/Basic.lean b/LeanPool/Erdos403/Basic.lean index 16ef53b635..e8a594cec8 100644 --- a/LeanPool/Erdos403/Basic.lean +++ b/LeanPool/Erdos403/Basic.lean @@ -37,14 +37,14 @@ A "sum of distinct factorials" is modelled by a `Finset ℕ` of indices (distinc automatic). Note `0! = 1! = 1`, so e.g. `{0,1}` sums to `2`. -/ -@[expose] public section +public section namespace Erdos403 open scoped Nat /-- The sum of distinct factorials indexed by `S`: `∑_{a ∈ S} a!`. -/ -def factSum (S : Finset ℕ) : ℕ := ∑ a ∈ S, a ! +@[expose] def factSum (S : Finset ℕ) : ℕ := ∑ a ∈ S, a ! /-- The extremal witness: `factSum {2, 3, 5} = 2! + 3! + 5! = 2 + 6 + 120 = 128 = 2⁷`. -/ theorem witness : factSum {2, 3, 5} = 2 ^ 7 := by diff --git a/LeanPool/Erdos403/FactBase.lean b/LeanPool/Erdos403/FactBase.lean index c6a8e710c7..a462dd3da7 100644 --- a/LeanPool/Erdos403/FactBase.lean +++ b/LeanPool/Erdos403/FactBase.lean @@ -30,7 +30,7 @@ This file builds the infrastructure the sharp endgame needs: `Erdos403.Superseded`.) -/ -@[expose] public section +public section namespace Erdos403 @@ -38,7 +38,7 @@ open Finset open scoped Nat /-- The `i`-th factorial-base digit of `n`: `dᵢ(n) = ⌊n / i!⌋ mod (i+1)`. -/ -def factDigit (i n : ℕ) : ℕ := (n / i !) % (i + 1) +@[expose] def factDigit (i n : ℕ) : ℕ := (n / i !) % (i + 1) /-- The factorials below `i` (positive indices) sum to less than `i!`. -/ theorem sum_lt_factorial_of_lt (T : Finset ℕ) (hT : ∀ a ∈ T, 1 ≤ a) (i : ℕ) : diff --git a/LeanPool/Erdos403/Sharp.lean b/LeanPool/Erdos403/Sharp.lean index a086ddf22c..987993052f 100644 --- a/LeanPool/Erdos403/Sharp.lean +++ b/LeanPool/Erdos403/Sharp.lean @@ -31,7 +31,7 @@ Using the factorial number system (`FactBase`), `factSum S = 2^m` is impossible small `m`). Both are `sorry`-free and depend only on `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section namespace Erdos403 diff --git a/LeanPool/Erdos548/Main.lean b/LeanPool/Erdos548/Main.lean index e84bafe572..8f64ddf8d1 100644 --- a/LeanPool/Erdos548/Main.lean +++ b/LeanPool/Erdos548/Main.lean @@ -38,7 +38,7 @@ target of order `t ≥ 2`. The marked-state count is exactly `2 * |E(G)| * (n - and exact. -/ -@[expose] public section +public section open SimpleGraph diff --git a/LeanPool/Erdos548/RootedTrees.lean b/LeanPool/Erdos548/RootedTrees.lean index 1b5471d64c..980160dc12 100644 --- a/LeanPool/Erdos548/RootedTrees.lean +++ b/LeanPool/Erdos548/RootedTrees.lean @@ -31,7 +31,7 @@ least two splits a finite tree into two strictly smaller rooted trees meeting on word `l₀` number at most those supporting a rooted copy of the tree plus `(t - 2) · |l₀|!`. -/ -@[expose] public section +public section open SimpleGraph @@ -77,13 +77,13 @@ lemma attach_single_leaf_copy {U V : Type*} (S : SimpleGraph U) (G : SimpleGraph /-! Rooted graph copies in permutation-word prefixes and the leaf-root move. -/ /-- A rooted copy supported on the root image and the displayed outer set. -/ -def RootedWordFamily {U V : Type*} [DecidableEq V] +@[expose] def RootedWordFamily {U V : Type*} [DecidableEq V] (S : SimpleGraph U) (r : U) (G : SimpleGraph V) (b : V) (X : Finset V) : Prop := ∃ f : S.Copy G, f r = b ∧ ∀ x, f x ∈ insert b X /-- The number of cut permutation words of `l₀` supporting a rooted copy of `S` with root at the first letter. -/ -noncomputable def rootedWordCount {U V : Type*} [DecidableEq V] +@[expose] noncomputable def rootedWordCount {U V : Type*} [DecidableEq V] (S : SimpleGraph U) (r : U) (G : SimpleGraph V) (l₀ : List V) : ℕ := fullWordCount l₀ G.Adj (RootedWordFamily S r G) @@ -427,11 +427,11 @@ noncomputable def leafRestoreIso {U : Type} (T : SimpleGraph U) (l p : U) @[simp] lemma leafRestoreIso_inl {U : Type} (T : SimpleGraph U) (l p : U) (hlp : T.Adj l p) (honly : ∀ x, T.Adj l x → x = p) (x : ({l}ᶜ : Set U)) : - leafRestoreIso T l p hlp honly (Sum.inl x) = x.val := rfl + leafRestoreIso T l p hlp honly (Sum.inl x) = x.val := by rfl @[simp] lemma leafRestoreIso_inr {U : Type} (T : SimpleGraph U) (l p : U) (hlp : T.Adj l p) (honly : ∀ x, T.Adj l x → x = p) : - leafRestoreIso T l p hlp honly (Sum.inr 0) = l := rfl + leafRestoreIso T l p hlp honly (Sum.inr 0) = l := by rfl /-! The rooted word-count bound for every finite tree. -/ @@ -476,6 +476,7 @@ lemma rooted_word_count_base {U V : Type*} [Fintype U] [DecidableEq V] (G : SimpleGraph V) (l₀ : List V) : fullWordCount l₀ G.Adj (fun _ _ => True) ≤ rootedWordCount T r G l₀ := by classical + rw [fullWordCount_eq_card, rootedWordCount, fullWordCount_eq_card] apply Finset.card_le_card intro p hp obtain ⟨hl, hk, b, q, he, hm, _⟩ := (mem_fullGoodWordCuts _ _ _ _ _).mp hp diff --git a/LeanPool/Erdos548/Words.lean b/LeanPool/Erdos548/Words.lean index 61f15fd89e..505fbbfdf8 100644 --- a/LeanPool/Erdos548/Words.lean +++ b/LeanPool/Erdos548/Words.lean @@ -39,14 +39,14 @@ the gluing inequality to full words, and `full_word_transfer_count` bounds one f through the cut-reversal involution `reverseCutPair`, losing at most one first cut per word. -/ -@[expose] public section +public section namespace Erdos548 /-! Reversible prefix-block rotation for finite marked-word counting. -/ /-- A nonempty marked last letter. -/ -def MarkedEnd {α : Type*} (N : α → Prop) (l : List α) : Prop := +@[expose] def MarkedEnd {α : Type*} (N : α → Prop) (l : List α) : Prop := ∃ a, l.getLast? = some a ∧ N a lemma markedEnd_not_nil {α : Type*} {N : α → Prop} {l : List α} @@ -393,7 +393,7 @@ attribute [local instance] Classical.propDecidable /-- The first letter is a distinguished root, and a marked cut is taken in the remaining word. The family is allowed to depend on that root. -/ -def FullWordQualifies {α : Type*} [DecidableEq α] +@[expose] def FullWordQualifies {α : Type*} [DecidableEq α] (N : α → α → Prop) (A : α → Finset α → Prop) (l : List α) (k : ℕ) : Prop := ∃ b q, l = b::q ∧ MarkedEnd (N b) (q.take k) ∧ A b (q.take k).toFinset @@ -415,10 +415,14 @@ noncomputable def fullGoodWordCuts {α : Type*} [DecidableEq α] (fun p => FullWordQualifies N A p.1 p.2) /-- The number of qualifying cut permutation words of `l₀`. -/ -noncomputable def fullWordCount {α : Type*} [DecidableEq α] +@[expose] noncomputable def fullWordCount {α : Type*} [DecidableEq α] (l₀ : List α) (N : α → α → Prop) (A : α → Finset α → Prop) : ℕ := (fullGoodWordCuts l₀ N A).card +theorem fullWordCount_eq_card {α : Type*} [DecidableEq α] + (l₀ : List α) (N : α → α → Prop) (A : α → Finset α → Prop) : + fullWordCount l₀ N A = (fullGoodWordCuts l₀ N A).card := by rfl + lemma mem_fullGoodWordCuts {α : Type*} [DecidableEq α] (l₀ : List α) (N : α → α → Prop) (A : α → Finset α → Prop) (l : List α) (k : ℕ) : (l, k) ∈ fullGoodWordCuts l₀ N A ↔ l.Perm l₀ ∧ k < l₀.length ∧ FullWordQualifies N A l k := by diff --git a/LeanPool/Erdos81PaperIContrib.lean b/LeanPool/Erdos81PaperIContrib.lean index 0493196dbc..23cc25623e 100644 --- a/LeanPool/Erdos81PaperIContrib.lean +++ b/LeanPool/Erdos81PaperIContrib.lean @@ -20,7 +20,7 @@ Tags: convex-geometry, linear-programming, duality, farkas-lemma MSC: 52A20, 90C05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Erdos81PaperIContrib/FarkasLP.lean b/LeanPool/Erdos81PaperIContrib/FarkasLP.lean index bfc65e28ae..ea124984a2 100644 --- a/LeanPool/Erdos81PaperIContrib/FarkasLP.lean +++ b/LeanPool/Erdos81PaperIContrib/FarkasLP.lean @@ -31,7 +31,7 @@ specialization built directly from the finitely generated cone closedness theore -/ -@[expose] public section +public section open scoped BigOperators @@ -40,7 +40,7 @@ namespace LeanPool.Erdos81PaperIContrib variable {ι κ : Type*} /-- A real vector viewed in `EuclideanSpace ℝ ι` by its coordinates. -/ -noncomputable def toE (f : ι → ℝ) : EuclideanSpace ℝ ι := +@[expose] noncomputable def toE (f : ι → ℝ) : EuclideanSpace ℝ ι := (WithLp.equiv 2 (ι → ℝ)).symm f @[simp] lemma toE_apply (f : ι → ℝ) (i : ι) : toE f i = f i := rfl diff --git a/LeanPool/Erdos81PaperIContrib/FgConeClosed.lean b/LeanPool/Erdos81PaperIContrib/FgConeClosed.lean index 48085794b1..d17db734f6 100644 --- a/LeanPool/Erdos81PaperIContrib/FgConeClosed.lean +++ b/LeanPool/Erdos81PaperIContrib/FgConeClosed.lean @@ -36,7 +36,7 @@ inner product; they are ported here to an arbitrary real normed space `E` -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Erdos81PaperIIContrib.lean b/LeanPool/Erdos81PaperIIContrib.lean index 3a96c0babb..852513019a 100644 --- a/LeanPool/Erdos81PaperIIContrib.lean +++ b/LeanPool/Erdos81PaperIIContrib.lean @@ -18,7 +18,7 @@ Tags: graph-theory, chordal-graphs, induced-subgraphs, minimal-separators, simpl MSC: 05C75 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Erdos81PaperIIContrib/Chordal.lean b/LeanPool/Erdos81PaperIIContrib/Chordal.lean index 80f6db0f31..ceb04692f0 100644 --- a/LeanPool/Erdos81PaperIIContrib/Chordal.lean +++ b/LeanPool/Erdos81PaperIIContrib/Chordal.lean @@ -34,7 +34,7 @@ self-contained and depends only on Mathlib. graph has two non-adjacent simplicial vertices -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/Erdos81PaperIIIContrib.lean b/LeanPool/Erdos81PaperIIIContrib.lean index 57b69c227c..9e436dc8e8 100644 --- a/LeanPool/Erdos81PaperIIIContrib.lean +++ b/LeanPool/Erdos81PaperIIIContrib.lean @@ -23,7 +23,7 @@ Tags: extremal-combinatorics, triangle-packing, cyclic-groups MSC: 05B07, 05C70 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Erdos81PaperIIIContrib/SimpleGraph.lean b/LeanPool/Erdos81PaperIIIContrib/SimpleGraph.lean index 1aa27fb5fd..26a325d809 100644 --- a/LeanPool/Erdos81PaperIIIContrib/SimpleGraph.lean +++ b/LeanPool/Erdos81PaperIIIContrib/SimpleGraph.lean @@ -22,7 +22,7 @@ providing graph-valued triangles, their union, and a complete-graph corollary st disjointness and degree. -/ -@[expose] public section +public section open Finset @@ -31,11 +31,11 @@ namespace SumZeroTriangles variable {V : Type*} [DecidableEq V] /-- The simple graph consisting of the edges spanned by the vertices in `t`. -/ -def triangleGraph (t : Finset V) : SimpleGraph V := +@[expose] def triangleGraph (t : Finset V) : SimpleGraph V := SimpleGraph.fromEdgeSet t.innerEdges /-- The simple graph consisting of all edges covered by the triples in `P`. -/ -def packingGraph (P : Finset (Finset V)) : SimpleGraph V := +@[expose] def packingGraph (P : Finset (Finset V)) : SimpleGraph V := SimpleGraph.fromEdgeSet (familyEdges P) instance instDecidableAdjTriangleGraph (t : Finset V) : DecidableRel (triangleGraph t).Adj := by diff --git a/LeanPool/Erdos81PaperIIIContrib/SumZeroTriangles.lean b/LeanPool/Erdos81PaperIIIContrib/SumZeroTriangles.lean index 3a1fe16d37..0ba49eb01f 100644 --- a/LeanPool/Erdos81PaperIIIContrib/SumZeroTriangles.lean +++ b/LeanPool/Erdos81PaperIIIContrib/SumZeroTriangles.lean @@ -54,7 +54,7 @@ edge sets. -/ -@[expose] public section +public section open Finset @@ -133,7 +133,7 @@ lemma mem_familyEdges {P : Finset (Finset V)} {e : Sym2 V} : simp [familyEdges] /-- The number of edges of the edge set `E` that are incident to the vertex `v`. -/ -def edgeDegree (E : Finset (Sym2 V)) (v : V) : ℕ := +@[expose] def edgeDegree (E : Finset (Sym2 V)) (v : V) : ℕ := #{e ∈ E | v ∈ e} end Finset diff --git a/LeanPool/Erdos865.lean b/LeanPool/Erdos865.lean index 939204ea32..e1f29800a2 100644 --- a/LeanPool/Erdos865.lean +++ b/LeanPool/Erdos865.lean @@ -29,4 +29,4 @@ Tags: additive-combinatorics, erdos-problems, sum-free-sets, combinatorics MSC: 11B75, 11B13 -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos865/Defs.lean b/LeanPool/Erdos865/Defs.lean index c58b65f460..4eaa34fad3 100644 --- a/LeanPool/Erdos865/Defs.lean +++ b/LeanPool/Erdos865/Defs.lean @@ -15,7 +15,7 @@ Basic objects for the pairwise-sums problem: pairwise-sum triples and triple-fre hypothesis `FoldedOK`, and the folding sets `Xset`/`Yset`/`Bset`/`Eset`. -/ -@[expose] public section +public section open Finset @@ -23,29 +23,31 @@ namespace Erdos865 /-- `A` contains a *pairwise-sum triple*: distinct `a, b, c ∈ A` with `a+b, a+c, b+c ∈ A`. -/ +@[expose] def HasTriple (A : Finset ℕ) : Prop := ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ a + b ∈ A ∧ a + c ∈ A ∧ b + c ∈ A /-- `A` is *triple-free* if it contains no pairwise-sum triple. -/ -def IsTripleFree (A : Finset ℕ) : Prop := ¬ HasTriple A +@[expose] def IsTripleFree (A : Finset ℕ) : Prop := ¬ HasTriple A /-! ### Folded additive lemma definitions -/ /-- Non-wrapped pair sums `x + y` (`x ≠ y`, both in `B`, `x + y < m`). -/ -def lowSums (m : ℕ) (B : Finset ℕ) : Finset ℕ := +@[expose] def lowSums (m : ℕ) (B : Finset ℕ) : Finset ℕ := ((B ×ˢ B).filter (fun p => p.1 ≠ p.2 ∧ p.1 + p.2 < m)).image (fun p => p.1 + p.2) /-- Wrapped pair sums `x + y - m` (`x ≠ y`, both in `B`, `x + y > m`). -/ -def highSums (m : ℕ) (B : Finset ℕ) : Finset ℕ := +@[expose] def highSums (m : ℕ) (B : Finset ℕ) : Finset ℕ := ((B ×ˢ B).filter (fun p => p.1 ≠ p.2 ∧ m < p.1 + p.2)).image (fun p => p.1 + p.2 - m) /-- Residues arising both as a non-wrapped and as a wrapped pair sum. -/ -def collisions (m : ℕ) (B : Finset ℕ) : Finset ℕ := lowSums m B ∩ highSums m B +@[expose] def collisions (m : ℕ) (B : Finset ℕ) : Finset ℕ := lowSums m B ∩ highSums m B /-- The hypothesis `(1.1)` of the folded additive lemma: `B ⊆ {1,…,m-1}` and for all distinct `x, y ∈ B`, `x + y ≠ m` and the residue of `x + y` mod `m` is not in `B`. -/ +@[expose] def FoldedOK (m : ℕ) (B : Finset ℕ) : Prop := (∀ b ∈ B, 1 ≤ b ∧ b < m) ∧ (∀ x ∈ B, ∀ y ∈ B, x ≠ y → x + y ≠ m ∧ (x + y) % m ∉ B) @@ -53,18 +55,18 @@ def FoldedOK (m : ℕ) (B : Finset ℕ) : Prop := /-! ### Folding definitions -/ /-- `X = {r : 1 ≤ r < h, r ∈ A}`. -/ -def Xset (A : Finset ℕ) (h : ℕ) : Finset ℕ := +@[expose] def Xset (A : Finset ℕ) (h : ℕ) : Finset ℕ := (Finset.Ico 1 h).filter (fun r => r ∈ A) /-- `Y = {r : 1 ≤ r < h, h + r ≤ N, h + r ∈ A}`. -/ -def Yset (A : Finset ℕ) (N h : ℕ) : Finset ℕ := +@[expose] def Yset (A : Finset ℕ) (N h : ℕ) : Finset ℕ := (Finset.Ico 1 h).filter (fun r => h + r ≤ N ∧ h + r ∈ A) /-- `B_h = X ∩ Y`. -/ -def Bset (A : Finset ℕ) (N h : ℕ) : Finset ℕ := Xset A h ∩ Yset A N h +@[expose] def Bset (A : Finset ℕ) (N h : ℕ) : Finset ℕ := Xset A h ∩ Yset A N h /-- `E = [1, h-1] \ (X ∪ Y)`. -/ -def Eset (A : Finset ℕ) (N h : ℕ) : Finset ℕ := +@[expose] def Eset (A : Finset ℕ) (N h : ℕ) : Finset ℕ := (Finset.Ico 1 h) \ (Xset A h ∪ Yset A N h) end Erdos865 diff --git a/LeanPool/Erdos865/FoldedAux.lean b/LeanPool/Erdos865/FoldedAux.lean index fac07c8bf9..1418b1964c 100644 --- a/LeanPool/Erdos865/FoldedAux.lean +++ b/LeanPool/Erdos865/FoldedAux.lean @@ -20,7 +20,7 @@ Supporting material for the folded additive lemma: the images `T₁,…,T₄` of four-set union bound `case2_bound`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Erdos865/FoldedMain.lean b/LeanPool/Erdos865/FoldedMain.lean index 6d5302b04e..69c6d1a895 100644 --- a/LeanPool/Erdos865/FoldedMain.lean +++ b/LeanPool/Erdos865/FoldedMain.lean @@ -23,7 +23,7 @@ Monotonicity of the sum sets, the reflection `-B = {m - b}` and its effect on additive lemma `folded_additive`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Erdos865/Folding.lean b/LeanPool/Erdos865/Folding.lean index dccfc76b54..bf9cccdc59 100644 --- a/LeanPool/Erdos865/Folding.lean +++ b/LeanPool/Erdos865/Folding.lean @@ -18,7 +18,7 @@ Folds a triple-free set `A ⊆ [1,N]` onto a `FoldedOK` set `B_h` and controls t collisions via the exceptional set, giving the folding lemma `folding_lemma`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Erdos865/Main.lean b/LeanPool/Erdos865/Main.lean index 44d87cc0da..864748b79b 100644 --- a/LeanPool/Erdos865/Main.lean +++ b/LeanPool/Erdos865/Main.lean @@ -30,7 +30,7 @@ size forcing such a triple. This file assembles the proof that `8|A| = 5N + 16`, so the constant `5/8` is optimal. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Erdos865/Sharpness.lean b/LeanPool/Erdos865/Sharpness.lean index 1b8f01845d..3bb99521f8 100644 --- a/LeanPool/Erdos865/Sharpness.lean +++ b/LeanPool/Erdos865/Sharpness.lean @@ -20,7 +20,7 @@ The construction `A = [M,2M] ∪ [4M,8M]` is triple-free of size `5M + 2`, so fo one has `8·|A| = 5·N + 16`, showing the constant `5/8` is optimal. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Erdos865/UpperBound.lean b/LeanPool/Erdos865/UpperBound.lean index 95d5abd383..5c2ba83b71 100644 --- a/LeanPool/Erdos865/UpperBound.lean +++ b/LeanPool/Erdos865/UpperBound.lean @@ -22,7 +22,7 @@ Strong induction on `N` proving `even_bound`: every triple-free `A ⊆ [1, 2e]` `5/8` counting bound, split into the cases `even_bound_case1` and `even_bound_case2`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Erdos97ConvexOctagon.lean b/LeanPool/Erdos97ConvexOctagon.lean index ae95fac876..46ea3fd805 100644 --- a/LeanPool/Erdos97ConvexOctagon.lean +++ b/LeanPool/Erdos97ConvexOctagon.lean @@ -24,4 +24,4 @@ Tags: discrete-geometry, distance-geometry, erdos-problems, convexity MSC: 51K05, 52A10 -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos97ConvexOctagon/Basic.lean b/LeanPool/Erdos97ConvexOctagon/Basic.lean index 2ef51cee1a..13afabb268 100644 --- a/LeanPool/Erdos97ConvexOctagon/Basic.lean +++ b/LeanPool/Erdos97ConvexOctagon/Basic.lean @@ -9,7 +9,7 @@ public import Mathlib.Analysis.InnerProductSpace.PiL2 /-! # Erdős 97 convex-octagon formalization: Basic -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/CayleyMenger.lean b/LeanPool/Erdos97ConvexOctagon/CayleyMenger.lean index 9b1f5e45c6..7a1dea7fd4 100644 --- a/LeanPool/Erdos97ConvexOctagon/CayleyMenger.lean +++ b/LeanPool/Erdos97ConvexOctagon/CayleyMenger.lean @@ -10,17 +10,17 @@ import LeanPool.Erdos97ConvexOctagon.Gram /-! # Erdős 97 convex-octagon formalization: Cayley Menger -/ -@[expose] public section +public section namespace Erdos97Octagon open scoped InnerProductSpace /-- Squared Euclidean distance. -/ -noncomputable def sqDist (a b : Plane) : ℝ := dist a b ^ 2 +@[expose] noncomputable def sqDist (a b : Plane) : ℝ := dist a b ^ 2 /-- The four-point Cayley--Menger polynomial in its six squared distances. -/ -def cm4 (A B C D E F : ℝ) : ℝ := +@[expose] def cm4 (A B C D E F : ℝ) : ℝ := -2 * A ^ 2 * F - 2 * A * B * D + 2 * A * B * E + 2 * A * B * F + 2 * A * C * D - 2 * A * C * E + 2 * A * C * F + 2 * A * D * F + 2 * A * E * F - 2 * A * F ^ 2 - 2 * B ^ 2 * E + 2 * B * C * D + diff --git a/LeanPool/Erdos97ConvexOctagon/Certificates.lean b/LeanPool/Erdos97ConvexOctagon/Certificates.lean index cbbfd2a03a..08aa9b474c 100644 --- a/LeanPool/Erdos97ConvexOctagon/Certificates.lean +++ b/LeanPool/Erdos97ConvexOctagon/Certificates.lean @@ -14,7 +14,7 @@ import LeanPool.Erdos97ConvexOctagon.ResidualObstructions /-! # Erdős 97 convex-octagon formalization: Certificates -/ -@[expose] public section +public section namespace Erdos97Octagon @@ -36,12 +36,12 @@ inductive PrefixCertificate where deriving DecidableEq /-- Regard a monotone prefix witness as a general obstruction certificate. -/ -def PrefixCertificate.toCertificate : PrefixCertificate → Certificate +@[expose] def PrefixCertificate.toCertificate : PrefixCertificate → Certificate | .k4 root component a b c d => .k4 root component a b c d | .sharedThree a b q1 q2 q3 => .sharedThree a b q1 q2 q3 /-- Validate the tail of an ordered mutual-edge spanning tree. -/ -def extendsTreeB +@[expose] def extendsTreeB (R : RawIncidence) (reached : Finset Vertex) : List Vertex → Bool | [] => true | v :: todo => @@ -50,12 +50,12 @@ def extendsTreeB extendsTreeB R (insert v reached) todo /-- Check that the listed vertices form an ordered mutual-edge spanning tree. -/ -def componentTreeB (R : RawIncidence) (root : Vertex) : List Vertex → Bool +@[expose] def componentTreeB (R : RawIncidence) (root : Vertex) : List Vertex → Bool | [] => false | first :: rest => decide (first = root) && extendsTreeB R {root} rest /-- A selected edge whose selecting endpoint occurs in a validated tree. -/ -def TreeLabelledEdge (R : RawIncidence) (component : List Vertex) (a b : Vertex) : Prop := +@[expose] def TreeLabelledEdge (R : RawIncidence) (component : List Vertex) (a b : Vertex) : Prop := (a ∈ component ∧ b ∈ R a) ∨ (b ∈ component ∧ a ∈ R b) /-- Boolean test for a selected edge incident to the validated tree. -/ @@ -65,19 +65,19 @@ def treeLabelledEdgeB (decide (b ∈ component) && decide (a ∈ R b)) /-- The class number stored in a residual-isomorphism payload. -/ -def payloadClass (payload : UInt64) : ℕ := +@[expose] def payloadClass (payload : UInt64) : ℕ := (payload &&& 15).toNat /-- The forward permutation stored in a residual-isomorphism payload. -/ -def payloadForwardCode (payload : UInt64) : UInt64 := +@[expose] def payloadForwardCode (payload : UInt64) : UInt64 := (payload >>> 4) &&& 0xffffff /-- The inverse permutation stored in a residual-isomorphism payload. -/ -def payloadInverseCode (payload : UInt64) : UInt64 := +@[expose] def payloadInverseCode (payload : UInt64) : UInt64 := (payload >>> 28) &&& 0xffffff /-- The mathematical proposition checked for each emitted finite witness. -/ -def Certificate.Valid (R : RawIncidence) : Certificate → Prop +@[expose] def Certificate.Valid (R : RawIncidence) : Certificate → Prop | .k4 root component a b c d => componentTreeB R root component = true ∧ [a, b, c, d].Nodup ∧ TreeLabelledEdge R component a b ∧ TreeLabelledEdge R component a c ∧ @@ -186,7 +186,7 @@ theorem Certificate.valid_of_validB and_assoc] using hvalid /-- One incidence table extends another when it contains every selected edge. -/ -def Extends (R S : RawIncidence) : Prop := +@[expose] def Extends (R S : RawIncidence) : Prop := ∀ centre target, target ∈ R centre → target ∈ S centre private theorem extendsTreeB_mono {R S : RawIncidence} (hRS : Extends R S) : diff --git a/LeanPool/Erdos97ConvexOctagon/Classification.lean b/LeanPool/Erdos97ConvexOctagon/Classification.lean index bfb75b63e0..bcf88eac7a 100644 --- a/LeanPool/Erdos97ConvexOctagon/Classification.lean +++ b/LeanPool/Erdos97ConvexOctagon/Classification.lean @@ -17,7 +17,7 @@ finite search excludes every completion of those canonical rows using checked geometric obstruction witnesses. -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/CodeStateExactness.lean b/LeanPool/Erdos97ConvexOctagon/CodeStateExactness.lean index edcefc231b..4980359441 100644 --- a/LeanPool/Erdos97ConvexOctagon/CodeStateExactness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CodeStateExactness.lean @@ -10,7 +10,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSearchCore /-! # Exactness of packed incidence-table prefixes -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage @@ -143,7 +143,7 @@ private theorem shiftedRow_bit simp [hequal, hbefore] /-- A packed table code exactly records all selected bits in its assignment list. -/ -def CodeMatches (code : UInt64) (assignments : List RowAssignment) : Prop := +@[expose] def CodeMatches (code : UInt64) (assignments : List RowAssignment) : Prop := ∀ centre target, bitSetB code (varIndex centre target) = selectedByAssignmentsB assignments centre target diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageBranches.lean b/LeanPool/Erdos97ConvexOctagon/CoverageBranches.lean index 3c77af2dbd..f1e6a87e24 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageBranches.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageBranches.lean @@ -17,7 +17,7 @@ The compact kernel-checked coverage certificate excludes all seven canonical first rows. -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificate.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificate.lean index 396f4e6301..a41a6dd6c6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificate.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificate.lean @@ -14,4 +14,4 @@ import Mathlib.Tactic.NormNum.GCD /-! # Audited flat coverage certificates -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateChecker.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateChecker.lean index d5e6da1f52..74e016e256 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateChecker.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateChecker.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Flat local checker for coverage certificates -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage @@ -74,14 +74,17 @@ inductive BranchClaim where | search (claims : BranchClaims) /-- The empty node claim used when a lookup has no matching entry. -/ +@[expose] def defaultNodeClaim : NodeClaim := ⟨0, 0, 0, 0, 0, 0, 0, 0, #[]⟩ /-- An empty word claim retaining the requested word index. -/ +@[expose] def emptyNodeWordClaim (wordIndex : Nat) : NodeWordClaim := ⟨wordIndex, [], [], [], []⟩ /-- Search a bounded suffix of the word-claim array for the requested index. -/ +@[expose] def nodeWordClaimAtAux (wordClaims : Array NodeWordClaim) (wordIndex position : Nat) : Nat → NodeWordClaim @@ -94,24 +97,26 @@ def nodeWordClaimAtAux else nodeWordClaimAtAux wordClaims wordIndex (position + 1) fuel /-- Retrieve one of at most seven sparse word claims, defaulting to empty streams. -/ +@[expose] def NodeClaim.wordAt (claim : NodeClaim) (wordIndex : Nat) : NodeWordClaim := nodeWordClaimAtAux claim.wordClaims wordIndex 0 7 /-- Retrieve one node without unfolding an entire large flat array literal. -/ +@[expose] def BranchClaims.nodeAt (claims : BranchClaims) (identifier : Nat) : NodeClaim := (claims.nodeGroups.getD (identifier / 64) #[]).getD (identifier % 64) defaultNodeClaim /-- Read one row byte from a packed incidence-table code. -/ -def rowFromCode (code : UInt64) (centre : Vertex) : UInt64 := +@[expose] def rowFromCode (code : UInt64) (centre : Vertex) : UInt64 := (code >>> UInt64.ofNat (8 * centre.val)) &&& 255 /-- Assigned centres at one search depth. -/ -def assignedCentres (depth : Nat) : List Vertex := +@[expose] def assignedCentres (depth : Nat) : List Vertex := [0, 1, 2] ++ searchCentres.take depth /-- Reconstruct the semantic assignment prefix from a code and search depth. -/ -def assignmentsFromCode (code : UInt64) (depth : Nat) : List RowAssignment := +@[expose] def assignmentsFromCode (code : UInt64) (depth : Nat) : List RowAssignment := (assignedCentres depth).map fun centre => (centre, rowFromCode code centre) /-- Reconstruct the packed pair state from the semantic assignment prefix. -/ @@ -177,42 +182,43 @@ private theorem foldl_good_of_final · exact induction hfinal htail /-- Constant-depth lookup of one compact pattern-summary identifier. -/ -def densePatternSummaryLookup (identifier : Nat) : Option PatternSummary := +@[expose] def densePatternSummaryLookup (identifier : Nat) : Option PatternSummary := match densePatternSummaryGroups[identifier / 64]? with | none => none | some group => group[identifier % 64]? /-- Constant-depth lookup of one compact exact-summary identifier. -/ -def denseHardSummaryLookup (identifier : Nat) : Option HardSummary := +@[expose] def denseHardSummaryLookup (identifier : Nat) : Option HardSummary := match denseHardSummaryGroups[identifier / 64]? with | none => none | some group => group[identifier % 64]? /-- Packed-only pattern-summary validation for the first computation gate. -/ -def patternIdentifierPackedMatchesB +@[expose] def patternIdentifierPackedMatchesB (identifier : Nat) (code : UInt64) : Bool := match densePatternSummaryLookup identifier with | none => false | some summary => (summary.mask &&& code) == summary.mask /-- Packed-only exact-summary validation for the first computation gate. -/ -def hardIdentifierPackedMatchesB (identifier : Nat) (code : UInt64) : Bool := +@[expose] def hardIdentifierPackedMatchesB (identifier : Nat) (code : UInt64) : Bool := match denseHardSummaryLookup identifier with | none => false | some summary => summary.code == code /-- Selected row indices in one fixed five-index word. -/ -def rowIndexWord (rows : UInt64) (offset : Nat) : List Nat := +@[expose] def rowIndexWord (rows : UInt64) (offset : Nat) : List Nat := let word := ((rows >>> UInt64.ofNat offset) &&& 31).toNat (fiveBitIndices.getD word []).map fun index => offset + index /-- Retrieve one conflict cover without unfolding the full generated table. -/ -def conflictCoverLookup (identifier : Nat) : Option ConflictCover := +@[expose] def conflictCoverLookup (identifier : Nat) : Option ConflictCover := match conflictCoverGroups[identifier / 64]? with | none => none | some group => group[identifier % 64]? /-- Check one certificate row and update its accumulated references. -/ +@[expose] def processRow (claims : BranchClaims) (identifier : Nat) (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (pairState : PairState) @@ -247,6 +253,7 @@ def processRow ⟨childValid, cursor.patternOrigins, childIds, cursor.hardOrigins⟩ /-- Process at most five compatible rows while threading the local witness streams. -/ +@[expose] def processFiveRows (claims : BranchClaims) (identifier : Nat) (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (pairState : PairState) @@ -255,7 +262,7 @@ def processFiveRows (processRow claims identifier claim centre remaining pairState) initial /-- Semantic consequence recorded for one active legal-row index. -/ -def NodeRowValid +@[expose] def NodeRowValid (claims : BranchClaims) (identifier : Nat) (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (pairState : PairState) (index : Nat) : Prop := @@ -315,6 +322,7 @@ private theorem nodeRowValid_of_processRow_ok simp [processRow, hcursorFalse] at hok /-- Validate one of the seven disjoint five-row words of a node claim. -/ +@[expose] def nodeWordValidB (claims : BranchClaims) (identifier : Nat) (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (pairState : PairState) @@ -350,7 +358,7 @@ theorem nodeRowValid_of_word · exact hindex /-- Validate one semantically rejected row of a node claim. -/ -def rejectedRowValidB +@[expose] def rejectedRowValidB (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (index target : Nat) : Bool := if htarget : target < 8 then @@ -364,6 +372,7 @@ def rejectedRowValidB else false /-- Check one rejected row and record its target. -/ +@[expose] def processRejectedRow (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (cursor : RejectionCursor) (index : Nat) : RejectionCursor := @@ -376,6 +385,7 @@ def processRejectedRow remainingTargets⟩ /-- Validate at most five rejected rows using one semantic conflict each. -/ +@[expose] def rejectedWordValidB (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (indices targets : List Nat) : Bool := @@ -384,7 +394,7 @@ def rejectedWordValidB result.ok && result.targets.isEmpty /-- Semantic column-conflict consequence recorded for one rejected row. -/ -def RejectedRowValid +@[expose] def RejectedRowValid (claim : NodeClaim) (centre : Vertex) (remaining : List Vertex) (index : Nat) : Prop := ∃ target, rejectedRowValidB claim centre remaining index target = true @@ -419,7 +429,7 @@ theorem rejectedRowValid_of_word · exact hindex /-- Validate the conservative pair/column row partition of one node. -/ -def nodePruningValidB (claims : BranchClaims) (identifier : Nat) : Bool := +@[expose] def nodePruningValidB (claims : BranchClaims) (identifier : Nat) : Bool := if identifier < claims.nodeCount then let claim := claims.nodeAt identifier if claim.depth < searchCentres.length then @@ -447,7 +457,7 @@ def nodePruningValidB (claims : BranchClaims) (identifier : Nat) : Bool := else false /-- Validate the active row outcomes and child-state transitions of one node. -/ -def nodeTransitionsValidB (claims : BranchClaims) (identifier : Nat) : Bool := +@[expose] def nodeTransitionsValidB (claims : BranchClaims) (identifier : Nat) : Bool := if identifier < claims.nodeCount then let claim := claims.nodeAt identifier if claim.depth < searchCentres.length then @@ -460,15 +470,16 @@ def nodeTransitionsValidB (claims : BranchClaims) (identifier : Nat) : Bool := else false /-- Fail-closed local validation of one postorder node. -/ -def nodeLocalValidB (claims : BranchClaims) (identifier : Nat) : Bool := +@[expose] def nodeLocalValidB (claims : BranchClaims) (identifier : Nat) : Bool := nodePruningValidB claims identifier && nodeTransitionsValidB claims identifier /-- Validate a bounded consecutive chunk of postorder node identifiers. -/ -def nodeClaimChunkValidB +@[expose] def nodeClaimChunkValidB (claims : BranchClaims) (start count : Nat) : Bool := (List.range count).all fun offset => nodeLocalValidB claims (start + offset) /-- Every node in a flat branch passes its local checker. -/ +@[expose] def BranchClaims.LocallyValid (claims : BranchClaims) : Prop := ∀ identifier, identifier < claims.nodeCount → nodeLocalValidB claims identifier = true @@ -503,7 +514,7 @@ def allNodeClaimsValidB (claims : BranchClaims) : Bool := nodeClaimChunkValidB claims start (min 64 (claims.nodeCount - start)) /-- Validate the exact fixed-row root carried by one search claim array. -/ -def searchBranchRootValidB +@[expose] def searchBranchRootValidB (orbit : Fin 7) (rowTwo : Fin 35) (claims : BranchClaims) : Bool := if claims.rootId < claims.nodeCount then let root := claims.nodeAt claims.rootId @@ -521,7 +532,7 @@ def searchBranchRootValidB else false /-- Validate the immediate pattern or exact fixed-row state of one branch claim. -/ -def branchClaimRootValidB +@[expose] def branchClaimRootValidB (orbit : Fin 7) (rowTwo : Fin 35) (claim : BranchClaim) : Bool := let codeTwo := addRowCode (addRowCode 0 30 0) (canonicalRowMask orbit) 1 match claim with diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverSoundness.lean index 8af36a6464..ff2511d96e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverSoundness.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Global validity of the generated conflict covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverTypes.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverTypes.lean index 60e877b555..97e5b29a43 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverTypes.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCoverTypes.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Types and local audit for repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage @@ -30,7 +30,7 @@ structure ConflictCover where pairIndices : List Nat /-- Audit the short pair list and its precomputed row-mask union. -/ -def ConflictCover.validB (cover : ConflictCover) : Bool := +@[expose] def ConflictCover.validB (cover : ConflictCover) : Bool := if _hcentre : cover.centre < 8 then let masks := pairRowIndexMasks.getD cover.centre #[] cover.pairIndices.all (fun index => diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers.lean index 2d931938ef..f00fde1c6c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers.lean @@ -34,12 +34,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Deduplicated repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict covers in shallow 64-entry groups. -/ -def conflictCoverGroups : Array (Array ConflictCover) := +@[expose] def conflictCoverGroups : Array (Array ConflictCover) := #[conflictCovers00, conflictCovers01, conflictCovers02, conflictCovers03, conflictCovers04, conflictCovers05, conflictCovers06, conflictCovers07, conflictCovers08, conflictCovers09, conflictCovers10, conflictCovers11, conflictCovers12, conflictCovers13, conflictCovers14, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers00.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers00.lean index cde001b990..27fed302c5 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers00.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers00.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 0. -/ -def conflictCovers00 : Array ConflictCover := +@[expose] def conflictCovers00 : Array ConflictCover := #[⟨3, 4128, 477849075, [5, 12]⟩, ⟨4, 524322, 7524286463, [1, 5, 19]⟩, ⟨7, 528480, 8287944703, [5, 6, 12, 19]⟩, ⟨6, 2633888, 17179869183, [5, 7, 12, 13, 19, 21]⟩, ⟨5, 36028797287927814, 34359738367, [1, 2, 12, 19, 28, 55]⟩, @@ -81,7 +81,7 @@ theorem conflictCovers00_valid : decide /-- Conflict-cover data group 1. -/ -def conflictCovers01 : Array ConflictCover := +@[expose] def conflictCovers01 : Array ConflictCover := #[⟨6, 137439482894, 34091302911, [1, 2, 3, 10, 12, 19, 37]⟩, ⟨6, 137439491112, 34359721983, [3, 5, 10, 12, 13, 19, 37]⟩, ⟨7, 137439483936, 34326036471, [5, 11, 12, 19, 37]⟩, @@ -145,7 +145,7 @@ theorem conflictCovers01_valid : decide /-- Conflict-cover data group 2. -/ -def conflictCovers02 : Array ConflictCover := +@[expose] def conflictCovers02 : Array ConflictCover := #[⟨6, 540556288, 34359083007, [10, 11, 12, 13, 19, 20, 21, 29]⟩, ⟨5, 274882645008, 34359476223, [4, 10, 11, 14, 19, 22, 38]⟩, ⟨7, 274879500288, 34359377883, [12, 14, 19, 20, 38]⟩, @@ -208,7 +208,7 @@ theorem conflictCovers02_valid : decide /-- Conflict-cover data group 3. -/ -def conflictCovers03 : Array ConflictCover := +@[expose] def conflictCovers03 : Array ConflictCover := #[⟨6, 540545034, 34359214079, [1, 3, 12, 19, 20, 21, 29]⟩, ⟨7, 1576992, 16877748151, [5, 12, 19, 20]⟩, ⟨6, 549756343456, 34091302911, [5, 7, 10, 12, 19, 39]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers01.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers01.lean index 919ddac109..77f3c27703 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers01.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers01.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 4. -/ -def conflictCovers04 : Array ConflictCover := +@[expose] def conflictCovers04 : Array ConflictCover := #[⟨7, 70368744722464, 34359590911, [5, 12, 14, 19, 46]⟩, ⟨7, 3670112, 16173236207, [5, 6, 19, 20, 21]⟩, ⟨7, 1589280, 17112629231, [5, 14, 19, 20]⟩, ⟨6, 276825128, 33554431743, [3, 5, 10, 23, 28]⟩, @@ -85,7 +85,7 @@ theorem conflictCovers04_valid : decide /-- Conflict-cover data group 5. -/ -def conflictCovers05 : Array ConflictCover := +@[expose] def conflictCovers05 : Array ConflictCover := #[⟨7, 528420, 8287813567, [2, 5, 12, 19]⟩, ⟨6, 537407620, 25769803775, [2, 7, 12, 13, 19, 29]⟩, ⟨6, 1609888, 17179869183, [5, 7, 12, 15, 19, 20]⟩, ⟨7, 528424, 8287928311, [3, 5, 12, 19]⟩, ⟨7, 2625568, 16911286199, [5, 12, 19, 21]⟩, @@ -149,7 +149,7 @@ theorem conflictCovers05_valid : decide /-- Conflict-cover data group 6. -/ -def conflictCovers06 : Array ConflictCover := +@[expose] def conflictCovers06 : Array ConflictCover := #[⟨6, 538447876, 34325527999, [2, 12, 19, 20, 29]⟩, ⟨5, 36028797019525188, 34359607295, [2, 6, 12, 15, 19, 55]⟩, ⟨6, 1617924, 17178886143, [2, 12, 13, 15, 19, 20]⟩, @@ -214,7 +214,7 @@ theorem conflictCovers06_valid : decide /-- Conflict-cover data group 7. -/ -def conflictCovers07 : Array ConflictCover := +@[expose] def conflictCovers07 : Array ConflictCover := #[⟨6, 140737488914440, 34351325049, [3, 11, 15, 19, 47]⟩, ⟨5, 4753488, 17179869183, [4, 6, 11, 15, 19, 22]⟩, ⟨5, 2148013136, 25769803775, [4, 6, 10, 12, 19, 31]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers02.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers02.lean index 0a769fe98f..3888f6a5e0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers02.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers02.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 8. -/ -def conflictCovers08 : Array ConflictCover := +@[expose] def conflictCovers08 : Array ConflictCover := #[⟨6, 140737757315100, 34334572543, [2, 3, 4, 19, 28, 47]⟩, ⟨6, 140874928881824, 34225520623, [5, 7, 19, 20, 37, 47]⟩, ⟨6, 140875196268708, 34342961151, [2, 5, 7, 19, 28, 37, 47]⟩, @@ -87,7 +87,7 @@ theorem conflictCovers08_valid : decide /-- Conflict-cover data group 9. -/ -def conflictCovers09 : Array ConflictCover := +@[expose] def conflictCovers09 : Array ConflictCover := #[⟨5, 275952732288, 34359738363, [7, 11, 15, 20, 30, 38]⟩, ⟨7, 3670016, 16172252167, [19, 20, 21]⟩, ⟨6, 141287244694532, 34292563727, [2, 10, 19, 39, 47]⟩, ⟨6, 141287247317000, 34359738231, [3, 11, 20, 21, 39, 47]⟩, @@ -157,7 +157,7 @@ theorem conflictCovers09_valid : decide /-- Conflict-cover data group 10. -/ -def conflictCovers10 : Array ConflictCover := +@[expose] def conflictCovers10 : Array ConflictCover := #[⟨6, 140738025754644, 34359738303, [2, 4, 12, 19, 29, 47]⟩, ⟨6, 140737488885796, 34359607295, [2, 5, 11, 12, 19, 47]⟩, ⟨6, 1579044, 17146183679, [2, 5, 11, 12, 19, 20]⟩, @@ -227,7 +227,7 @@ theorem conflictCovers10_valid : decide /-- Conflict-cover data group 11. -/ -def conflictCovers11 : Array ConflictCover := +@[expose] def conflictCovers11 : Array ConflictCover := #[⟨4, 140737490976768, 33990278403, [19, 21, 47]⟩, ⟨6, 140737488883724, 34359738367, [2, 3, 12, 19, 47]⟩, ⟨5, 36029347848525828, 34359738367, [2, 11, 12, 30, 39, 55]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers03.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers03.lean index 4cf2fdfa0d..61f0ca6f6a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers03.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers03.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 12. -/ -def conflictCovers12 : Array ConflictCover := +@[expose] def conflictCovers12 : Array ConflictCover := #[⟨7, 805835776, 25769221567, [10, 12, 19, 28, 29]⟩, ⟨7, 70369550012416, 34359713715, [12, 19, 28, 29, 46]⟩, ⟨6, 805311494, 25769279487, [1, 2, 10, 12, 28, 29]⟩, @@ -86,7 +86,7 @@ theorem conflictCovers12_valid : decide /-- Conflict-cover data group 13. -/ -def conflictCovers13 : Array ConflictCover := +@[expose] def conflictCovers13 : Array ConflictCover := #[⟨6, 137976352780, 34326183423, [2, 3, 12, 19, 29, 37]⟩, ⟨6, 137441588232, 34359721983, [3, 10, 12, 13, 19, 21, 37]⟩, ⟨6, 140738294190084, 34359738303, [2, 12, 19, 28, 29, 47]⟩, @@ -157,7 +157,7 @@ theorem conflictCovers13_valid : decide /-- Conflict-cover data group 14. -/ -def conflictCovers14 : Array ConflictCover := +@[expose] def conflictCovers14 : Array ConflictCover := #[⟨5, 36028797287960644, 34359738367, [2, 6, 12, 15, 19, 28, 55]⟩, ⟨7, 70369015234568, 34342944373, [3, 19, 21, 28, 46]⟩, ⟨6, 807404556, 33822342271, [2, 3, 10, 21, 28, 29]⟩, @@ -227,7 +227,7 @@ theorem conflictCovers14_valid : decide /-- Conflict-cover data group 15. -/ -def conflictCovers15 : Array ConflictCover := +@[expose] def conflictCovers15 : Array ConflictCover := #[⟨5, 276830222, 34359214079, [1, 2, 3, 11, 12, 23, 28]⟩, ⟨6, 550293213224, 34326183927, [3, 5, 12, 19, 29, 39]⟩, ⟨6, 550294787080, 34359737855, [3, 10, 12, 21, 29, 39]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers04.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers04.lean index 3e0d8d44c4..e1c9ffcaea 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers04.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers04.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 16. -/ -def conflictCovers16 : Array ConflictCover := +@[expose] def conflictCovers16 : Array ConflictCover := #[⟨5, 550830099472, 34359705599, [4, 10, 11, 14, 19, 30, 39]⟩, ⟨7, 275146887168, 34359435227, [12, 14, 19, 28, 38]⟩, ⟨7, 275148967936, 34091040151, [12, 19, 21, 28, 38]⟩, @@ -87,7 +87,7 @@ theorem conflictCovers16_valid : decide /-- Conflict-cover data group 17. -/ -def conflictCovers17 : Array ConflictCover := +@[expose] def conflictCovers17 : Array ConflictCover := #[⟨5, 36029347044263940, 34359738239, [2, 11, 20, 28, 39, 55]⟩, ⟨6, 268964900, 25501368255, [2, 5, 10, 12, 19, 28]⟩, ⟨5, 277025395780, 34359738367, [2, 6, 10, 12, 31, 38]⟩, @@ -156,7 +156,7 @@ theorem conflictCovers17_valid : decide /-- Conflict-cover data group 18. -/ -def conflictCovers18 : Array ConflictCover := +@[expose] def conflictCovers18 : Array ConflictCover := #[⟨7, 537395236, 25039863471, [2, 5, 19, 29]⟩, ⟨6, 140737757315236, 34334572543, [2, 5, 7, 19, 28, 47]⟩, ⟨5, 1593488, 17179869183, [4, 7, 12, 14, 19, 20]⟩, @@ -228,7 +228,7 @@ theorem conflictCovers18_valid : decide /-- Conflict-cover data group 19. -/ -def conflictCovers19 : Array ConflictCover := +@[expose] def conflictCovers19 : Array ConflictCover := #[⟨6, 140738026804224, 34359607231, [10, 12, 19, 20, 29, 47]⟩, ⟨6, 140738026800160, 34225389231, [5, 10, 19, 20, 29, 47]⟩, ⟨5, 549765267464, 34359738367, [3, 14, 20, 23, 39]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers05.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers05.lean index 129416e0e5..77d355a8c7 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers05.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers05.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 20. -/ -def conflictCovers20 : Array ConflictCover := +@[expose] def conflictCovers20 : Array ConflictCover := #[⟨5, 2148028498, 25769803775, [1, 4, 6, 12, 14, 19, 31]⟩, ⟨5, 277874768, 33822867455, [4, 6, 11, 20, 23, 28]⟩, ⟨7, 70368748906528, 34359607037, [5, 11, 13, 19, 22, 46]⟩, @@ -82,7 +82,7 @@ theorem conflictCovers20_valid : decide /-- Conflict-cover data group 21. -/ -def conflictCovers21 : Array ConflictCover := +@[expose] def conflictCovers21 : Array ConflictCover := #[⟨4, 18496, 1056811765, [6, 11, 14]⟩, ⟨7, 22624, 1073740799, [5, 6, 11, 12, 14]⟩, ⟨7, 2103360, 15032318975, [6, 11, 12, 21]⟩, ⟨6, 270571520, 34358931455, [11, 12, 15, 21, 28]⟩, ⟨5, 276220118088, 34359721983, [3, 6, 10, 15, 28, 30, 38]⟩, @@ -143,7 +143,7 @@ theorem conflictCovers21_valid : decide /-- Conflict-cover data group 22. -/ -def conflictCovers22 : Array ConflictCover := +@[expose] def conflictCovers22 : Array ConflictCover := #[⟨5, 277025919168, 34326183935, [6, 7, 12, 19, 31, 38]⟩, ⟨7, 70368748902400, 34359533563, [11, 12, 19, 22, 46]⟩, ⟨6, 139586965536, 34326167543, [5, 12, 19, 31, 37]⟩, @@ -209,7 +209,7 @@ theorem conflictCovers22_valid : decide /-- Conflict-cover data group 23. -/ -def conflictCovers23 : Array ConflictCover := +@[expose] def conflictCovers23 : Array ConflictCover := #[⟨7, 2110560, 15032384511, [5, 6, 10, 12, 13, 21]⟩, ⟨6, 270545952, 34359717823, [5, 10, 12, 13, 21, 28]⟩, ⟨6, 270566448, 34359734271, [4, 5, 10, 15, 21, 28]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers06.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers06.lean index 18de33782f..937e490f67 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers06.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers06.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 24. -/ -def conflictCovers24 : Array ConflictCover := +@[expose] def conflictCovers24 : Array ConflictCover := #[⟨5, 276830272, 34359738367, [6, 11, 12, 23, 28]⟩, ⟨6, 271060996, 34090515871, [2, 12, 19, 21, 28]⟩, ⟨7, 2102368, 14763949055, [5, 6, 10, 12, 21]⟩, ⟨6, 140737490459680, 32212102143, [5, 10, 11, 12, 21, 47]⟩, @@ -83,7 +83,7 @@ theorem conflictCovers24_valid : decide /-- Conflict-cover data group 25. -/ -def conflictCovers25 : Array ConflictCover := +@[expose] def conflictCovers25 : Array ConflictCover := #[⟨6, 278959104, 34358951903, [10, 12, 15, 21, 23, 28]⟩, ⟨7, 70368746279936, 32212036511, [10, 12, 21, 46]⟩, ⟨6, 140737758921744, 34359734239, [4, 10, 15, 21, 28, 47]⟩, @@ -149,7 +149,7 @@ theorem conflictCovers25_valid : decide /-- Conflict-cover data group 26. -/ -def conflictCovers26 : Array ConflictCover := +@[expose] def conflictCovers26 : Array ConflictCover := #[⟨6, 268469280, 21474815999, [5, 10, 15, 28]⟩, ⟨4, 164, 1048543, [2, 5, 7]⟩, ⟨7, 5243936, 16173104815, [5, 10, 20, 22]⟩, ⟨6, 9472160, 17179869183, [5, 7, 11, 15, 20, 23]⟩, ⟨5, 550028462212, 34359738367, [2, 7, 11, 14, 22, 28, 39]⟩, @@ -210,7 +210,7 @@ theorem conflictCovers26_valid : decide /-- Conflict-cover data group 27. -/ -def conflictCovers27 : Array ConflictCover := +@[expose] def conflictCovers27 : Array ConflictCover := #[⟨4, 196, 1048559, [2, 6, 7]⟩, ⟨5, 277907520, 34359738367, [6, 11, 15, 20, 23, 28]⟩, ⟨7, 3146816, 16173170511, [6, 10, 20, 21]⟩, ⟨6, 3156096, 17179803647, [7, 11, 13, 20, 21]⟩, ⟨5, 276842576, 34359738367, [4, 6, 11, 14, 23, 28]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers07.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers07.lean index 18f8aa1a61..e4becc8b66 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers07.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers07.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 28. -/ -def conflictCovers28 : Array ConflictCover := +@[expose] def conflictCovers28 : Array ConflictCover := #[⟨6, 8917026, 16911302655, [1, 5, 12, 19, 23]⟩, ⟨6, 815267872, 33822867135, [5, 19, 20, 23, 28, 29]⟩, ⟨6, 548407296, 33822211199, [11, 20, 21, 23, 29]⟩, ⟨6, 11014144, 16910450079, [12, 19, 21, 23]⟩, @@ -82,7 +82,7 @@ theorem conflictCovers28_valid : decide /-- Conflict-cover data group 29. -/ -def conflictCovers29 : Array ConflictCover := +@[expose] def conflictCovers29 : Array ConflictCover := #[⟨5, 550833756292, 34359738367, [2, 7, 11, 12, 22, 30, 39]⟩, ⟨7, 2102304, 14763797439, [5, 10, 12, 21]⟩, ⟨5, 549765269636, 34359672831, [2, 7, 11, 14, 20, 23, 39]⟩, @@ -149,7 +149,7 @@ theorem conflictCovers29_valid : decide /-- Conflict-cover data group 30. -/ -def conflictCovers30 : Array ConflictCover := +@[expose] def conflictCovers30 : Array ConflictCover := #[⟨6, 140737490457632, 32212102079, [5, 10, 12, 21, 47]⟩, ⟨6, 140874927315104, 32212253695, [5, 7, 11, 12, 37, 47]⟩, ⟨4, 140737490453536, 29728925087, [5, 10, 21, 47]⟩, @@ -218,7 +218,7 @@ theorem conflictCovers30_valid : decide /-- Conflict-cover data group 31. -/ -def conflictCovers31 : Array ConflictCover := +@[expose] def conflictCovers31 : Array ConflictCover := #[⟨6, 538656, 8589787127, [5, 11, 12, 13, 19]⟩, ⟨6, 549756348548, 34359672831, [2, 7, 11, 13, 19, 39]⟩, ⟨6, 137439481988, 34057748447, [2, 7, 12, 19, 37]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers08.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers08.lean index 27ac408f81..0ce7de7e61 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers08.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers08.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 32. -/ -def conflictCovers32 : Array ConflictCover := +@[expose] def conflictCovers32 : Array ConflictCover := #[⟨6, 138244294816, 34359738365, [5, 7, 11, 15, 28, 29, 37]⟩, ⟨6, 139586451616, 34359737343, [5, 7, 11, 12, 13, 31, 37]⟩, ⟨6, 140875195746464, 34342961149, [5, 7, 11, 28, 37, 47]⟩, @@ -85,7 +85,7 @@ theorem conflictCovers32_valid : decide /-- Conflict-cover data group 33. -/ -def conflictCovers33 : Array ConflictCover := +@[expose] def conflictCovers33 : Array ConflictCover := #[⟨6, 140737756825632, 34351329277, [5, 11, 15, 28, 47]⟩, ⟨6, 140739635845152, 33285979127, [5, 11, 12, 31, 47]⟩, ⟨6, 140737490459648, 32212036607, [10, 11, 12, 21, 47]⟩, @@ -155,7 +155,7 @@ theorem conflictCovers33_valid : decide /-- Conflict-cover data group 34. -/ -def conflictCovers34 : Array ConflictCover := +@[expose] def conflictCovers34 : Array ConflictCover := #[⟨6, 549755820192, 28957473791, [5, 7, 11, 12, 39]⟩, ⟨6, 137707393184, 29756489726, [5, 7, 12, 28, 37]⟩, ⟨6, 549756344352, 34326183927, [5, 11, 12, 19, 39]⟩, @@ -225,7 +225,7 @@ theorem conflictCovers34_valid : decide /-- Conflict-cover data group 35. -/ -def conflictCovers35 : Array ConflictCover := +@[expose] def conflictCovers35 : Array ConflictCover := #[⟨6, 270541864, 34359721727, [3, 5, 10, 13, 21, 28]⟩, ⟨7, 70370088455168, 34359721599, [10, 11, 21, 28, 30, 46]⟩, ⟨5, 1350602756, 34359214079, [2, 12, 15, 23, 28, 30]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers09.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers09.lean index 623aea54c4..fd0f476018 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers09.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers09.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 36. -/ -def conflictCovers36 : Array ConflictCover := +@[expose] def conflictCovers36 : Array ConflictCover := #[⟨7, 272630816, 33554431679, [5, 10, 22, 28]⟩, ⟨6, 140737756791842, 34359717887, [1, 5, 10, 28, 47]⟩, ⟨7, 70369012623392, 34342940405, [5, 11, 13, 28, 46]⟩, ⟨7, 268437536, 20879224565, [5, 11, 28]⟩, @@ -85,7 +85,7 @@ theorem conflictCovers36_valid : decide /-- Conflict-cover data group 37. -/ -def conflictCovers37 : Array ConflictCover := +@[expose] def conflictCovers37 : Array ConflictCover := #[⟨7, 270537728, 34090495391, [10, 12, 21, 28]⟩, ⟨6, 141287514708992, 34359734271, [10, 11, 12, 21, 28, 39, 47]⟩, ⟨6, 550026380320, 34359734271, [5, 10, 15, 21, 28, 39]⟩, @@ -155,7 +155,7 @@ theorem conflictCovers37_valid : decide /-- Conflict-cover data group 38. -/ -def conflictCovers38 : Array ConflictCover := +@[expose] def conflictCovers38 : Array ConflictCover := #[⟨6, 2418049058, 34359721983, [1, 5, 15, 21, 28, 31]⟩, ⟨6, 2418029568, 34359197695, [10, 12, 13, 21, 28, 31]⟩, ⟨6, 2418021408, 34359721983, [5, 10, 12, 21, 28, 31]⟩, @@ -226,7 +226,7 @@ theorem conflictCovers38_valid : decide /-- Conflict-cover data group 39. -/ -def conflictCovers39 : Array ConflictCover := +@[expose] def conflictCovers39 : Array ConflictCover := #[⟨6, 140737499894784, 34359541663, [10, 12, 20, 21, 23, 47]⟩, ⟨6, 140737767277568, 34359737887, [10, 21, 23, 28, 47]⟩, ⟨5, 549760014408, 34359738359, [3, 6, 11, 12, 22, 39]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers10.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers10.lean index d091c2327e..aee755e4b9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers10.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers10.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 40. -/ -def conflictCovers40 : Array ConflictCover := +@[expose] def conflictCovers40 : Array ConflictCover := #[⟨6, 140874928364544, 34359601151, [10, 11, 12, 20, 37, 47]⟩, ⟨6, 140875195751424, 34359715839, [10, 11, 12, 28, 37, 47]⟩, ⟨7, 1074272320, 25736175611, [6, 11, 12, 19, 30]⟩, @@ -88,7 +88,7 @@ theorem conflictCovers40_valid : decide /-- Conflict-cover data group 41. -/ -def conflictCovers41 : Array ConflictCover := +@[expose] def conflictCovers41 : Array ConflictCover := #[⟨4, 36028797018966144, 31113270137, [7, 11, 55]⟩, ⟨6, 269487264, 29527900159, [5, 7, 10, 11, 20, 28]⟩, ⟨4, 70368744186912, 27648550303, [5, 10, 13, 46]⟩, ⟨6, 531488, 8589787135, [5, 10, 11, 12, 19]⟩, @@ -155,7 +155,7 @@ theorem conflictCovers41_valid : decide /-- Conflict-cover data group 42. -/ -def conflictCovers42 : Array ConflictCover := +@[expose] def conflictCovers42 : Array ConflictCover := #[⟨7, 70368748901376, 34359533471, [10, 12, 19, 22, 46]⟩, ⟨6, 268965024, 25501368319, [5, 7, 10, 12, 19, 28]⟩, ⟨4, 140737488389248, 28923843407, [7, 10, 15, 47]⟩, @@ -222,7 +222,7 @@ theorem conflictCovers42_valid : decide /-- Conflict-cover data group 43. -/ -def conflictCovers43 : Array ConflictCover := +@[expose] def conflictCovers43 : Array ConflictCover := #[⟨5, 275146900608, 34359738335, [7, 10, 15, 19, 28, 38]⟩, ⟨7, 268444768, 21474836479, [5, 6, 10, 13, 28]⟩, ⟨7, 1342178400, 25232932863, [5, 6, 10, 28, 30]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers11.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers11.lean index 5f497b2f56..01399da010 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers11.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers11.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 44. -/ -def conflictCovers44 : Array ConflictCover := +@[expose] def conflictCovers44 : Array ConflictCover := #[⟨6, 1055904, 12884901887, [5, 7, 10, 11, 12, 20]⟩, ⟨5, 36028797019491344, 34359738367, [4, 10, 11, 19, 55]⟩, ⟨6, 140737488885904, 34359738363, [4, 7, 11, 12, 19, 47]⟩, @@ -90,7 +90,7 @@ theorem conflictCovers44_valid : decide /-- Conflict-cover data group 45. -/ -def conflictCovers45 : Array ConflictCover := +@[expose] def conflictCovers45 : Array ConflictCover := #[⟨6, 140739637417984, 34359672819, [11, 12, 19, 20, 31, 47]⟩, ⟨7, 5246016, 16642930559, [6, 10, 11, 20, 22]⟩, ⟨6, 140738294744064, 34359734143, [10, 15, 20, 28, 29, 47]⟩, @@ -160,7 +160,7 @@ theorem conflictCovers45_valid : decide /-- Conflict-cover data group 46. -/ -def conflictCovers46 : Array ConflictCover := +@[expose] def conflictCovers46 : Array ConflictCover := #[⟨6, 140874928392196, 34359607295, [2, 11, 15, 20, 37, 47]⟩, ⟨6, 137439512612, 34359607295, [2, 5, 11, 15, 19, 37]⟩, ⟨6, 140874928916480, 34359607291, [11, 15, 19, 20, 37, 47]⟩, @@ -232,7 +232,7 @@ theorem conflictCovers46_valid : decide /-- Conflict-cover data group 47. -/ -def conflictCovers47 : Array ConflictCover := +@[expose] def conflictCovers47 : Array ConflictCover := #[⟨7, 4723776, 16911359967, [6, 10, 12, 19, 22]⟩, ⟨6, 140875196273664, 34359721887, [10, 12, 19, 28, 37, 47]⟩, ⟨6, 137439515776, 34359738335, [7, 10, 12, 15, 19, 37]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers12.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers12.lean index 89d64a0f52..4108586efc 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers12.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers12.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 48. -/ -def conflictCovers48 : Array ConflictCover := +@[expose] def conflictCovers48 : Array ConflictCover := #[⟨7, 70369012618240, 34359707551, [10, 12, 28, 46]⟩, ⟨6, 140737756791952, 34359736287, [4, 7, 10, 28, 47]⟩, ⟨4, 211106232534016, 29796032911, [10, 46, 47]⟩, @@ -90,7 +90,7 @@ theorem conflictCovers48_valid : decide /-- Conflict-cover data group 49. -/ -def conflictCovers49 : Array ConflictCover := +@[expose] def conflictCovers49 : Array ConflictCover := #[⟨7, 70369550534656, 34359733875, [11, 20, 28, 29, 46]⟩, ⟨6, 141287782091776, 34359734143, [10, 11, 20, 29, 39, 47]⟩, ⟨6, 141287514179584, 34359738227, [11, 19, 20, 28, 39, 47]⟩, @@ -160,7 +160,7 @@ theorem conflictCovers49_valid : decide /-- Conflict-cover data group 50. -/ -def conflictCovers50 : Array ConflictCover := +@[expose] def conflictCovers50 : Array ConflictCover := #[⟨6, 268972048, 25769508791, [4, 12, 13, 19, 28]⟩, ⟨5, 4739216, 17179869183, [4, 7, 12, 14, 19, 22]⟩, ⟨6, 536578, 8588894207, [1, 12, 13, 19]⟩, ⟨6, 1585168, 17179574199, [4, 12, 13, 19, 20]⟩, @@ -227,7 +227,7 @@ theorem conflictCovers50_valid : decide /-- Conflict-cover data group 51. -/ -def conflictCovers51 : Array ConflictCover := +@[expose] def conflictCovers51 : Array ConflictCover := #[⟨6, 3682306, 17178886143, [1, 12, 13, 19, 20, 21]⟩, ⟨6, 538456066, 34359050239, [1, 12, 13, 19, 20, 29]⟩, ⟨6, 538447888, 34326150579, [4, 12, 19, 20, 29]⟩, ⟨6, 2625542, 16910450687, [1, 2, 12, 19, 21]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers13.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers13.lean index 3d81dc5b64..23b77cf31a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers13.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers13.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 52. -/ -def conflictCovers52 : Array ConflictCover := +@[expose] def conflictCovers52 : Array ConflictCover := #[⟨6, 137707925536, 34359721911, [5, 12, 13, 19, 28, 37]⟩, ⟨6, 137440538656, 34359607223, [5, 12, 13, 19, 20, 37]⟩, ⟨7, 70368748924928, 34359533567, [12, 13, 14, 19, 22, 46]⟩, @@ -83,7 +83,7 @@ theorem conflictCovers52_valid : decide /-- Conflict-cover data group 53. -/ -def conflictCovers53 : Array ConflictCover := +@[expose] def conflictCovers53 : Array ConflictCover := #[⟨6, 140737488883842, 34359664639, [1, 7, 12, 19, 47]⟩, ⟨7, 70369818443776, 34267373121, [19, 30, 46]⟩, ⟨7, 70368748897280, 34158206479, [10, 19, 22, 46]⟩, @@ -150,7 +150,7 @@ theorem conflictCovers53_valid : decide /-- Conflict-cover data group 54. -/ -def conflictCovers54 : Array ConflictCover := +@[expose] def conflictCovers54 : Array ConflictCover := #[⟨6, 278924296, 33822342271, [3, 10, 11, 21, 23, 28]⟩, ⟨5, 273186896, 34359738367, [4, 6, 15, 19, 22, 28]⟩, ⟨6, 138252661760, 34359738303, [10, 12, 13, 23, 28, 29, 37]⟩, @@ -220,7 +220,7 @@ theorem conflictCovers54_valid : decide /-- Conflict-cover data group 55. -/ -def conflictCovers55 : Array ConflictCover := +@[expose] def conflictCovers55 : Array ConflictCover := #[⟨6, 268967944, 25752444661, [3, 13, 19, 28]⟩, ⟨5, 36028797023684752, 34342961151, [4, 7, 11, 19, 22, 55]⟩, ⟨5, 36028797028403272, 34359738111, [3, 6, 11, 20, 23, 55]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers14.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers14.lean index 991ae2d8f5..c1e3190c6d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers14.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers14.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 56. -/ -def conflictCovers56 : Array ConflictCover := +@[expose] def conflictCovers56 : Array ConflictCover := #[⟨6, 268961936, 25174212603, [4, 7, 11, 19, 28]⟩, ⟨5, 2151684240, 34359738367, [4, 7, 11, 12, 22, 31]⟩, ⟨5, 36028797024209032, 34359738239, [3, 7, 11, 20, 22, 55]⟩, @@ -90,7 +90,7 @@ theorem conflictCovers56_valid : decide /-- Conflict-cover data group 57. -/ -def conflictCovers57 : Array ConflictCover := +@[expose] def conflictCovers57 : Array ConflictCover := #[⟨7, 540540960, 33688518311, [5, 19, 20, 21, 29]⟩, ⟨7, 538444832, 33688518319, [5, 10, 19, 20, 29]⟩, ⟨6, 537922600, 33822867199, [3, 5, 10, 11, 20, 29]⟩, @@ -155,7 +155,7 @@ theorem conflictCovers57_valid : decide /-- Conflict-cover data group 58. -/ -def conflictCovers58 : Array ConflictCover := +@[expose] def conflictCovers58 : Array ConflictCover := #[⟨7, 70370355335168, 34359713787, [12, 14, 19, 29, 30, 46]⟩, ⟨7, 541594624, 34359074239, [10, 12, 19, 22, 29]⟩, ⟨5, 550830084288, 34326183935, [6, 7, 12, 19, 30, 39]⟩, @@ -227,7 +227,7 @@ theorem conflictCovers58_valid : decide /-- Conflict-cover data group 59. -/ -def conflictCovers59 : Array ConflictCover := +@[expose] def conflictCovers59 : Array ConflictCover := #[⟨7, 1079509056, 33755692875, [6, 19, 20, 22, 30]⟩, ⟨7, 1075315776, 33755692879, [6, 10, 19, 20, 30]⟩, ⟨6, 540027912, 34359213823, [3, 10, 11, 13, 20, 21, 29]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers15.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers15.lean index 13ca2fe6b1..9dcb9f1404 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers15.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers15.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 60. -/ -def conflictCovers60 : Array ConflictCover := +@[expose] def conflictCovers60 : Array ConflictCover := #[⟨7, 1076367360, 34359131607, [12, 19, 21, 30]⟩, ⟨7, 1078465536, 34359139807, [10, 12, 19, 22, 30]⟩, ⟨6, 137442660352, 34359345119, [12, 15, 19, 20, 21, 37]⟩, @@ -87,7 +87,7 @@ theorem conflictCovers60_valid : decide /-- Conflict-cover data group 61. -/ -def conflictCovers61 : Array ConflictCover := +@[expose] def conflictCovers61 : Array ConflictCover := #[⟨7, 70369820543008, 34342944501, [5, 11, 19, 21, 30, 46]⟩, ⟨5, 272649284, 34359738111, [2, 6, 10, 11, 14, 22, 28]⟩, ⟨4, 70368748896320, 33940160165, [6, 19, 22, 46]⟩, @@ -157,7 +157,7 @@ theorem conflictCovers61_valid : decide /-- Conflict-cover data group 62. -/ -def conflictCovers62 : Array ConflictCover := +@[expose] def conflictCovers62 : Array ConflictCover := #[⟨6, 140737490979968, 34359672703, [7, 10, 11, 19, 21, 47]⟩, ⟨7, 541591552, 33813814393, [11, 19, 22, 29]⟩, ⟨7, 1078462464, 33813879929, [11, 19, 22, 30]⟩, ⟨6, 137439484032, 34326183931, [7, 11, 12, 19, 37]⟩, @@ -223,7 +223,7 @@ theorem conflictCovers62_valid : decide /-- Conflict-cover data group 63. -/ -def conflictCovers63 : Array ConflictCover := +@[expose] def conflictCovers63 : Array ConflictCover := #[⟨5, 36028797019506832, 34342961151, [4, 7, 11, 14, 19, 55]⟩, ⟨6, 140737759412400, 34342961151, [4, 5, 7, 19, 21, 28, 47]⟩, ⟨4, 2622464, 16172219407, [10, 19, 21]⟩, ⟨7, 539503616, 34359066367, [10, 11, 13, 19, 21, 29]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers16.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers16.lean index f97ec87cb2..ec1a2d729f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers16.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers16.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 64. -/ -def conflictCovers64 : Array ConflictCover := +@[expose] def conflictCovers64 : Array ConflictCover := #[⟨7, 70368745752640, 34359672699, [6, 11, 19, 20, 46]⟩, ⟨7, 70368745751616, 34158346063, [6, 10, 19, 20, 46]⟩, ⟨7, 70369282099264, 34359738235, [6, 11, 20, 29, 46]⟩, @@ -88,7 +88,7 @@ theorem conflictCovers64_valid : decide /-- Conflict-cover data group 65. -/ -def conflictCovers65 : Array ConflictCover := +@[expose] def conflictCovers65 : Array ConflictCover := #[⟨5, 550029494400, 34359738239, [7, 11, 20, 22, 28, 39]⟩, ⟨7, 70369283681280, 34359590655, [10, 11, 13, 19, 21, 29, 46]⟩, ⟨5, 824634248198, 34359476223, [1, 2, 10, 11, 19, 38, 39]⟩, @@ -160,7 +160,7 @@ theorem conflictCovers65_valid : decide /-- Conflict-cover data group 66. -/ -def conflictCovers66 : Array ConflictCover := +@[expose] def conflictCovers66 : Array ConflictCover := #[⟨7, 70369820542976, 34342878837, [11, 19, 21, 30, 46]⟩, ⟨6, 140737490982912, 34359525367, [11, 12, 19, 21, 47]⟩, ⟨6, 140740173760512, 34359737971, [11, 20, 29, 31, 47]⟩, @@ -231,7 +231,7 @@ theorem conflictCovers66_valid : decide /-- Conflict-cover data group 67. -/ -def conflictCovers67 : Array ConflictCover := +@[expose] def conflictCovers67 : Array ConflictCover := #[⟨5, 549760536768, 34091302911, [6, 7, 12, 19, 22, 39]⟩, ⟨7, 541603840, 34359074815, [11, 12, 13, 19, 22, 29]⟩, ⟨6, 268972040, 25769222135, [3, 12, 13, 19, 28]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers17.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers17.lean index 95df8b23c8..e95a8def01 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers17.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers17.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 68. -/ -def conflictCovers68 : Array ConflictCover := +@[expose] def conflictCovers68 : Array ConflictCover := #[⟨6, 550304225280, 34359737855, [11, 12, 20, 21, 23, 29, 39]⟩, ⟨6, 549766828032, 34090974623, [12, 19, 21, 23, 39]⟩, ⟨6, 549758439424, 34090974615, [12, 19, 21, 39]⟩, @@ -89,7 +89,7 @@ theorem conflictCovers68_valid : decide /-- Conflict-cover data group 69. -/ -def conflictCovers69 : Array ConflictCover := +@[expose] def conflictCovers69 : Array ConflictCover := #[⟨6, 140738295234692, 34359738239, [2, 7, 19, 20, 28, 29, 47]⟩, ⟨6, 140738304152576, 34359738303, [10, 12, 21, 23, 28, 29, 47]⟩, ⟨5, 1346899974, 34359214079, [1, 2, 12, 19, 22, 28, 30]⟩, @@ -161,7 +161,7 @@ theorem conflictCovers69_valid : decide /-- Conflict-cover data group 70. -/ -def conflictCovers70 : Array ConflictCover := +@[expose] def conflictCovers70 : Array ConflictCover := #[⟨6, 552440696832, 34326142451, [12, 19, 29, 31, 39]⟩, ⟨5, 2417524742, 34359214079, [1, 2, 15, 19, 20, 28, 31]⟩, ⟨6, 140737759413250, 34359721983, [1, 10, 19, 21, 28, 47]⟩, @@ -229,7 +229,7 @@ theorem conflictCovers70_valid : decide /-- Conflict-cover data group 71. -/ -def conflictCovers71 : Array ConflictCover := +@[expose] def conflictCovers71 : Array ConflictCover := #[⟨5, 277025393684, 34359737855, [2, 4, 10, 11, 31, 38]⟩, ⟨7, 1342703616, 25173630065, [11, 19, 28, 30]⟩, ⟨6, 549756340258, 34317795327, [1, 5, 11, 19, 39]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers18.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers18.lean index 818e33e761..240480174a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers18.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers18.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 72. -/ -def conflictCovers72 : Array ConflictCover := +@[expose] def conflictCovers72 : Array ConflictCover := #[⟨6, 141287245742082, 34292563967, [1, 19, 20, 39, 47]⟩, ⟨6, 550292685956, 34359738223, [2, 7, 10, 29, 39]⟩, ⟨6, 549756339332, 34024128335, [2, 7, 10, 19, 39]⟩, @@ -80,7 +80,7 @@ theorem conflictCovers72_valid : decide /-- Conflict-cover data group 73. -/ -def conflictCovers73 : Array ConflictCover := +@[expose] def conflictCovers73 : Array ConflictCover := #[⟨6, 140737489405954, 34359535615, [1, 11, 20, 47]⟩, ⟨6, 140737757841410, 34359732223, [1, 11, 20, 28, 47]⟩, ⟨6, 140737489410056, 34359738355, [3, 11, 12, 20, 47]⟩, @@ -140,7 +140,7 @@ theorem conflictCovers73_valid : decide /-- Conflict-cover data group 74. -/ -def conflictCovers74 : Array ConflictCover := +@[expose] def conflictCovers74 : Array ConflictCover := #[⟨4, 140737488355328, 28605825280, [47]⟩, ⟨6, 140737497274384, 34359738363, [4, 11, 12, 19, 23, 47]⟩, ⟨7, 4176, 765458394, [4, 6, 12]⟩, ⟨6, 140737490457746, 32212254719, [1, 4, 7, 10, 12, 21, 47]⟩, @@ -202,7 +202,7 @@ theorem conflictCovers74_valid : decide /-- Conflict-cover data group 75. -/ -def conflictCovers75 : Array ConflictCover := +@[expose] def conflictCovers75 : Array ConflictCover := #[⟨7, 70368744187904, 31121507061, [11, 13, 46]⟩, ⟨6, 140737488883850, 34359730175, [1, 3, 7, 12, 19, 47]⟩, ⟨7, 70368744189952, 31134090166, [12, 13, 46]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers19.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers19.lean index b2e83b5ea5..48e4f85131 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers19.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers19.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 76. -/ -def conflictCovers76 : Array ConflictCover := +@[expose] def conflictCovers76 : Array ConflictCover := #[⟨6, 140737757347872, 34351333373, [5, 15, 19, 28, 47]⟩, ⟨7, 70369549502464, 34351320953, [11, 14, 28, 29, 46]⟩, ⟨7, 805308416, 25173625969, [11, 28, 29]⟩, ⟨6, 137447344138, 34359738367, [1, 3, 11, 23, 37]⟩, @@ -86,7 +86,7 @@ theorem conflictCovers76_valid : decide /-- Conflict-cover data group 77. -/ -def conflictCovers77 : Array ConflictCover := +@[expose] def conflictCovers77 : Array ConflictCover := #[⟨6, 140737756795908, 34359738271, [2, 10, 12, 28, 47]⟩, ⟨7, 70369012625472, 34355533822, [6, 12, 13, 28, 46]⟩, ⟨7, 1342183424, 25735665139, [11, 12, 28, 30]⟩, @@ -153,7 +153,7 @@ theorem conflictCovers77_valid : decide /-- Conflict-cover data group 78. -/ -def conflictCovers78 : Array ConflictCover := +@[expose] def conflictCovers78 : Array ConflictCover := #[⟨7, 70369817921568, 33260813045, [5, 11, 30, 46]⟩, ⟨7, 70369281050688, 32187079545, [6, 11, 29, 46]⟩, ⟨5, 5249098, 17179869183, [1, 3, 6, 11, 12, 20, 22]⟩, @@ -223,7 +223,7 @@ theorem conflictCovers78_valid : decide /-- Conflict-cover data group 79. -/ -def conflictCovers79 : Array ConflictCover := +@[expose] def conflictCovers79 : Array ConflictCover := #[⟨6, 140737756794920, 34353430519, [3, 5, 12, 28, 47]⟩, ⟨7, 70369281071104, 32212093947, [11, 12, 14, 29, 46]⟩, ⟨6, 140738026280960, 34359603187, [11, 12, 20, 29, 47]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers20.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers20.lean index 3f462d656a..22e1cf3d46 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers20.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers20.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 80. -/ -def conflictCovers80 : Array ConflictCover := +@[expose] def conflictCovers80 : Array ConflictCover := #[⟨7, 70369817933824, 33285903351, [11, 12, 13, 30, 46]⟩, ⟨6, 140874930460672, 34359603191, [11, 12, 20, 21, 37, 47]⟩, ⟨6, 140737489418240, 34359535607, [11, 12, 13, 20, 47]⟩, @@ -89,7 +89,7 @@ theorem conflictCovers80_valid : decide /-- Conflict-cover data group 81. -/ -def conflictCovers81 : Array ConflictCover := +@[expose] def conflictCovers81 : Array ConflictCover := #[⟨5, 36028797027878992, 34351349759, [4, 6, 11, 19, 23, 55]⟩, ⟨6, 140737757315248, 34334572543, [4, 5, 7, 19, 28, 47]⟩, ⟨6, 140737488892032, 34359664639, [7, 12, 13, 19, 47]⟩, @@ -157,7 +157,7 @@ theorem conflictCovers81_valid : decide /-- Conflict-cover data group 82. -/ -def conflictCovers82 : Array ConflictCover := +@[expose] def conflictCovers82 : Array ConflictCover := #[⟨6, 140738293667968, 34359730171, [7, 11, 12, 28, 29, 47]⟩, ⟨5, 36028798093756560, 34359738363, [4, 7, 11, 20, 30, 55]⟩, ⟨7, 70368744180738, 31138284543, [1, 10, 11, 46]⟩, @@ -227,7 +227,7 @@ theorem conflictCovers82_valid : decide /-- Conflict-cover data group 83. -/ -def conflictCovers83 : Array ConflictCover := +@[expose] def conflictCovers83 : Array ConflictCover := #[⟨6, 140874927867908, 34359607295, [2, 11, 15, 19, 37, 47]⟩, ⟨6, 139595388928, 34359738363, [11, 12, 15, 19, 23, 31, 37]⟩, ⟨7, 70368746279938, 32212036607, [1, 10, 12, 21, 46]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers21.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers21.lean index e8c62a5789..776bffd18a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers21.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateConflictCovers21.lean @@ -13,12 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded repeated-pair row-mask covers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Conflict-cover data group 84. -/ -def conflictCovers84 : Array ConflictCover := +@[expose] def conflictCovers84 : Array ConflictCover := #[⟨5, 36028797287404676, 34359738335, [2, 7, 10, 12, 28, 55]⟩, ⟨6, 3184644, 17178886143, [2, 11, 12, 15, 20, 21]⟩, ⟨6, 813732864, 34359205887, [10, 12, 15, 23, 28, 29]⟩, @@ -89,7 +89,7 @@ theorem conflictCovers84_valid : decide /-- Conflict-cover data group 85. -/ -def conflictCovers85 : Array ConflictCover := +@[expose] def conflictCovers85 : Array ConflictCover := #[⟨6, 270537858, 34091302911, [1, 7, 10, 12, 21, 28]⟩, ⟨6, 270536832, 34087108574, [7, 12, 21, 28]⟩, ⟨7, 70370086354944, 34332448336, [28, 30, 46]⟩, ⟨7, 70370086356992, 34334545521, [11, 28, 30, 46]⟩, @@ -159,7 +159,7 @@ theorem conflictCovers85_valid : decide /-- Conflict-cover data group 86. -/ -def conflictCovers86 : Array ConflictCover := +@[expose] def conflictCovers86 : Array ConflictCover := #[⟨6, 140738294712320, 34359733875, [11, 20, 28, 29, 47]⟩, ⟨7, 70506451568704, 34342959097, [6, 11, 28, 37, 46]⟩, ⟨6, 140874927835144, 34342944497, [3, 11, 19, 37, 47]⟩, @@ -230,7 +230,7 @@ theorem conflictCovers86_valid : decide /-- Conflict-cover data group 87. -/ -def conflictCovers87 : Array ConflictCover := +@[expose] def conflictCovers87 : Array ConflictCover := #[⟨6, 141287512610848, 34359734263, [5, 11, 12, 28, 39, 47]⟩, ⟨6, 550026348578, 34359734271, [1, 5, 11, 21, 28, 39]⟩, ⟨6, 141287512606882, 34351349759, [1, 5, 7, 11, 28, 39, 47]⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData00.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData00.lean index 7d6477d21f..dedced34e9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData00.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData00.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (1, 4), group 00. -/ +@[expose] def branchClaims1And4Group00 : Array NodeClaim := #[⟨4, 7401666836966878494, 36240593415372030, 36028935270069478, 4, 0, 0, 0, #[]⟩, @@ -183,6 +184,7 @@ def branchClaims1And4Group00 : Array NodeClaim := 37, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 4), group 01. -/ +@[expose] def branchClaims1And4Group01 : Array NodeClaim := #[⟨3, 5116090043776314654, 36240044724911358, 36028797019518062, 36, 25769803776, 0, 17179869184, #[⟨6, [], [354], [63], []⟩]⟩, @@ -319,10 +321,12 @@ def branchClaims1And4Group01 : Array NodeClaim := ⟨6, [7, 6], [], [78, 87, 100], []⟩]⟩] /-- Flat postorder claims for branch (1, 4). -/ +@[expose] def branchClaims1Row4 : BranchClaims := ⟨#[branchClaims1And4Group00, branchClaims1And4Group01], 102, 101⟩ /-- Coverage claims for branch (1, 5), group 00. -/ +@[expose] def branchClaims1And5Group00 : Array NodeClaim := #[⟨4, 7401666836432104734, 36240868293278974, 140738300507366, 70, 0, 0, 0, #[]⟩, @@ -522,6 +526,7 @@ def branchClaims1And5Group00 : Array NodeClaim := 119, 32768, 0, 0, #[⟨3, [], [], [], [6]⟩]⟩] /-- Coverage claims for branch (1, 5), group 01. -/ +@[expose] def branchClaims1And5Group01 : Array NodeClaim := #[⟨3, 8646912155160096030, 36240869362818174, 414199601152, 118, 512, 8, 0, #[⟨0, [5], [], [], []⟩, @@ -675,10 +680,12 @@ def branchClaims1And5Group01 : Array NodeClaim := ⟨6, [7], [], [68, 81, 86, 99], []⟩]⟩] /-- Flat postorder claims for branch (1, 5). -/ +@[expose] def branchClaims1Row5 : BranchClaims := ⟨#[branchClaims1And5Group00, branchClaims1And5Group01], 101, 100⟩ /-- Coverage claims for branch (1, 6), group 00. -/ +@[expose] def branchClaims1And6Group00 : Array NodeClaim := #[⟨4, 8410473151893548318, 36240868293278974, 71056752120038, 149, 268435456, 0, 0, #[⟨5, [], [], [], [38]⟩]⟩, @@ -872,6 +879,7 @@ def branchClaims1And6Group00 : Array NodeClaim := ⟨6, [], [177], [], []⟩]⟩] /-- Coverage claims for branch (1, 6), group 01. -/ +@[expose] def branchClaims1And6Group01 : Array NodeClaim := #[⟨4, 5456111916882799902, 36240869358623998, 211794236283114, 166, 33554432, 0, 33554432, #[⟨5, [], [370], [], []⟩]⟩, @@ -1074,10 +1082,12 @@ def branchClaims1And6Group01 : Array NodeClaim := ⟨6, [6], [], [77, 92, 103, 119], []⟩]⟩] /-- Flat postorder claims for branch (1, 6). -/ +@[expose] def branchClaims1Row6 : BranchClaims := ⟨#[branchClaims1And6Group00, branchClaims1And6Group01], 121, 120⟩ /-- Coverage claims for branch (1, 7), group 00. -/ +@[expose] def branchClaims1And7Group00 : Array NodeClaim := #[⟨3, 8358681756980948254, 36100128657439998, 70368752046310, 73, 17448304640, 0, 17448304640, #[⟨5, [], [1302], [], []⟩, @@ -1278,6 +1288,7 @@ def branchClaims1And7Group00 : Array NodeClaim := ⟨6, [], [], [61, 62], []⟩]⟩] /-- Coverage claims for branch (1, 7), group 01. -/ +@[expose] def branchClaims1And7Group01 : Array NodeClaim := #[⟨2, 849134955806, 36240591267855598, 12058724, 257, 18119393280, 67108880, 18119393280, #[⟨0, [6], [], [], []⟩, @@ -1475,10 +1486,12 @@ def branchClaims1And7Group01 : Array NodeClaim := ⟨6, [7], [], [78, 87, 98, 113], []⟩]⟩] /-- Flat postorder claims for branch (1, 7). -/ +@[expose] def branchClaims1Row7 : BranchClaims := ⟨#[branchClaims1And7Group00, branchClaims1And7Group01], 115, 114⟩ /-- Coverage claims for branch (1, 8), group 00. -/ +@[expose] def branchClaims1And8Group00 : Array NodeClaim := #[⟨3, 7638105815532121374, 36240180024769790, 537426150, 5, 8589934592, 0, 8589934592, #[⟨6, [], [880], [], []⟩]⟩, @@ -1684,6 +1697,7 @@ def branchClaims1And8Group00 : Array NodeClaim := ⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (1, 8), group 01. -/ +@[expose] def branchClaims1And8Group01 : Array NodeClaim := #[⟨3, 5404320535631047966, 36240729780583662, 36169534509996074, 316, 0, 16384, 0, #[⟨2, [5], [], [], []⟩]⟩, @@ -1908,6 +1922,7 @@ def branchClaims1And8Group01 : Array NodeClaim := ⟨6, [], [449, 438], [], []⟩]⟩] /-- Coverage claims for branch (1, 8), group 02. -/ +@[expose] def branchClaims1And8Group02 : Array NodeClaim := #[⟨4, 5446259766498372894, 36240867219537150, 211655992044718, 366, 0, 0, 0, #[]⟩, @@ -1985,10 +2000,12 @@ def branchClaims1And8Group02 : Array NodeClaim := ⟨6, [6], [], [93, 104, 122, 144], []⟩]⟩] /-- Flat postorder claims for branch (1, 8). -/ +@[expose] def branchClaims1Row8 : BranchClaims := ⟨#[branchClaims1And8Group00, branchClaims1And8Group01, branchClaims1And8Group02], 146, 145⟩ /-- Coverage claims for branch (1, 9), group 00. -/ +@[expose] def branchClaims1And9Group00 : Array NodeClaim := #[⟨4, 6460977595537370398, 36240319611206910, 36169535315294330, 12, 0, 0, 0, #[]⟩, @@ -2213,6 +2230,7 @@ def branchClaims1And9Group00 : Array NodeClaim := 12, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 9), group 01. -/ +@[expose] def branchClaims1And9Group01 : Array NodeClaim := #[⟨3, 3674938294325685534, 36240319602818302, 36099303742640162, 18, 131072, 0, 0, #[⟨3, [], [], [63], []⟩]⟩, @@ -2436,6 +2454,7 @@ def branchClaims1And9Group01 : Array NodeClaim := 327, 65536, 0, 65536, #[⟨3, [], [473], [], []⟩]⟩] /-- Coverage claims for branch (1, 9), group 02. -/ +@[expose] def branchClaims1And9Group02 : Array NodeClaim := #[⟨4, 7681171356460985630, 36240869362826494, 36240453815299208, 444, 8192, 0, 0, #[⟨2, [], [], [], [78]⟩]⟩, @@ -2506,10 +2525,12 @@ def branchClaims1And9Group02 : Array NodeClaim := ⟨6, [], [], [66, 74, 99, 117, 142], []⟩]⟩] /-- Flat postorder claims for branch (1, 9). -/ +@[expose] def branchClaims1Row9 : BranchClaims := ⟨#[branchClaims1And9Group00, branchClaims1And9Group01, branchClaims1And9Group02], 144, 143⟩ /-- Coverage claims for branch (1, 16), group 00. -/ +@[expose] def branchClaims1And16Group00 : Array NodeClaim := #[⟨4, 7397726186491686174, 36240868293278974, 70369287912692, 449, 17179869184, 0, 0, #[⟨6, [], [], [], [16]⟩]⟩, @@ -2725,6 +2746,7 @@ def branchClaims1And16Group00 : Array NodeClaim := ⟨5, [], [144], [], []⟩]⟩] /-- Coverage claims for branch (1, 16), group 01. -/ +@[expose] def branchClaims1And16Group01 : Array NodeClaim := #[⟨4, 5155215197915393310, 36240869367012606, 211246359514222, 473, 536870912, 0, 536870912, #[⟨5, [], [264], [], []⟩]⟩, @@ -2844,10 +2866,12 @@ def branchClaims1And16Group01 : Array NodeClaim := ⟨6, [7], [17], [70, 82, 90], []⟩]⟩] /-- Flat postorder claims for branch (1, 16). -/ +@[expose] def branchClaims1Row16 : BranchClaims := ⟨#[branchClaims1And16Group00, branchClaims1And16Group01], 92, 91⟩ /-- Coverage claims for branch (1, 17), group 00. -/ +@[expose] def branchClaims1And17Group00 : Array NodeClaim := #[⟨4, 7397726185422138654, 36240868293278974, 140738032073972, 83, 17179869184, 0, 17179869184, #[⟨6, [], [708], [], []⟩]⟩, @@ -3046,6 +3070,7 @@ def branchClaims1And17Group00 : Array NodeClaim := 506, 0, 64, 0, #[⟨1, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (1, 17), group 01. -/ +@[expose] def branchClaims1And17Group01 : Array NodeClaim := #[⟨3, 5404320535631965470, 36240867219528958, 36170084265777192, 507, 0, 8, 0, #[⟨0, [5], [], [], []⟩]⟩, @@ -3265,6 +3290,7 @@ def branchClaims1And17Group01 : Array NodeClaim := 298, 17179869184, 0, 17179869184, #[⟨6, [], [249], [], []⟩]⟩] /-- Coverage claims for branch (1, 17), group 02. -/ +@[expose] def branchClaims1And17Group02 : Array NodeClaim := #[⟨3, 5980780764251368734, 36240867219504382, 211106772047920, 98, 8, 0, 0, #[⟨0, [], [], [127], []⟩]⟩, @@ -3311,10 +3337,12 @@ def branchClaims1And17Group02 : Array NodeClaim := ⟨6, [6], [24], [106, 120, 136], []⟩]⟩] /-- Flat postorder claims for branch (1, 17). -/ +@[expose] def branchClaims1Row17 : BranchClaims := ⟨#[branchClaims1And17Group00, branchClaims1And17Group01, branchClaims1And17Group02], 138, 137⟩ /-- Coverage claims for branch (1, 18), group 00. -/ +@[expose] def branchClaims1And18Group00 : Array NodeClaim := #[⟨4, 5167881543939599646, 36240868284890366, 36170222507947126, 165, 0, 0, 0, #[]⟩, @@ -3572,6 +3600,7 @@ def branchClaims1And18Group00 : Array NodeClaim := ⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (1, 18), group 01. -/ +@[expose] def branchClaims1And18Group01 : Array NodeClaim := #[⟨4, 3714063290319580446, 36240868284890366, 36099578083719354, 97, 0, 0, 0, #[]⟩, @@ -3730,10 +3759,12 @@ def branchClaims1And18Group01 : Array NodeClaim := ⟨6, [], [29, 29], [75, 94, 104], []⟩]⟩] /-- Flat postorder claims for branch (1, 18). -/ +@[expose] def branchClaims1Row18 : BranchClaims := ⟨#[branchClaims1And18Group00, branchClaims1And18Group01], 106, 105⟩ /-- Coverage claims for branch (1, 19), group 00. -/ +@[expose] def branchClaims1And19Group00 : Array NodeClaim := #[⟨3, 7638105682392198430, 36240180020575486, 211106772057184, 102, 147456, 0, 147456, #[⟨2, [], [1209], [], []⟩, @@ -3944,6 +3975,7 @@ def branchClaims1And19Group00 : Array NodeClaim := 616, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 19), group 01. -/ +@[expose] def branchClaims1And19Group01 : Array NodeClaim := #[⟨3, 7638105821458541854, 36240592341630188, 36239903800445984, 615, 131328, 0, 256, #[⟨1, [], [425], [], []⟩, @@ -4115,10 +4147,12 @@ def branchClaims1And19Group01 : Array NodeClaim := ⟨6, [], [31, 31], [59, 85, 115], []⟩]⟩] /-- Flat postorder claims for branch (1, 19). -/ +@[expose] def branchClaims1Row19 : BranchClaims := ⟨#[branchClaims1And19Group00, branchClaims1And19Group01], 117, 116⟩ /-- Coverage claims for branch (1, 26), group 00. -/ +@[expose] def branchClaims1And26Group00 : Array NodeClaim := #[⟨4, 6463792214034230558, 36240867219537150, 141150085722348, 627, 268435456, 0, 0, #[⟨5, [], [], [], [20]⟩]⟩, @@ -4334,6 +4368,7 @@ def branchClaims1And26Group00 : Array NodeClaim := 634, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 26), group 01. -/ +@[expose] def branchClaims1And26Group01 : Array NodeClaim := #[⟨3, 5116089910619680030, 36240318529076462, 211106769960036, 641, 131072, 0, 131072, #[⟨3, [], [1215], [], []⟩]⟩, @@ -4504,6 +4539,7 @@ def branchClaims1And26Group01 : Array NodeClaim := ⟨6, [7], [17], [88, 100, 115], []⟩]⟩] /-- Flat postorder claims for branch (1, 26). -/ +@[expose] def branchClaims1Row26 : BranchClaims := ⟨#[branchClaims1And26Group00, branchClaims1And26Group01], 117, 116⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData01.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData01.lean index edfa906a78..29cef0b632 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData01.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData01.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (1, 27), group 00. -/ +@[expose] def branchClaims1And27Group00 : Array NodeClaim := #[⟨4, 8401747427617549598, 36240868293278974, 71056215257324, 245, 268435456, 0, 0, #[⟨5, [], [], [], [58]⟩]⟩, @@ -209,6 +210,7 @@ def branchClaims1And27Group00 : Array NodeClaim := ⟨2, [], [636], [], []⟩]⟩] /-- Coverage claims for branch (1, 27), group 01. -/ +@[expose] def branchClaims1And27Group01 : Array NodeClaim := #[⟨2, 998339915038, 36240869354421372, 211244208885792, 242, 147528, 0, 147456, #[⟨0, [], [], [61], []⟩, @@ -408,6 +410,7 @@ def branchClaims1And27Group01 : Array NodeClaim := 682, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 27), group 02. -/ +@[expose] def branchClaims1And27Group02 : Array NodeClaim := #[⟨4, 8180507706976775454, 36240867219537150, 71331363732516, 700, 262144, 0, 262144, #[⟨3, [], [467], [], []⟩]⟩, @@ -524,10 +527,12 @@ def branchClaims1And27Group02 : Array NodeClaim := ⟨6, [6], [24], [121, 137, 162], []⟩]⟩] /-- Flat postorder claims for branch (1, 27). -/ +@[expose] def branchClaims1Row27 : BranchClaims := ⟨#[branchClaims1And27Group00, branchClaims1And27Group01, branchClaims1And27Group02], 164, 163⟩ /-- Coverage claims for branch (1, 28), group 00. -/ +@[expose] def branchClaims1And28Group00 : Array NodeClaim := #[⟨2, 847783275806, 36099991218486510, 36028797019508836, 104, 25769803776, 0, 25769803776, #[⟨6, [], [428, 448], [], []⟩]⟩, @@ -755,6 +760,7 @@ def branchClaims1And28Group00 : Array NodeClaim := 292, 131072, 0, 0, #[⟨3, [], [], [], [80]⟩]⟩] /-- Coverage claims for branch (1, 28), group 01. -/ +@[expose] def branchClaims1And28Group01 : Array NodeClaim := #[⟨3, 7133702657823354142, 36100128657439982, 36099440648933476, 252, 17448304640, 131136, 17179869184, #[⟨1, [5], [], [], []⟩, @@ -925,10 +931,12 @@ def branchClaims1And28Group01 : Array NodeClaim := ⟨6, [], [29, 29], [84, 105, 118], []⟩]⟩] /-- Flat postorder claims for branch (1, 28). -/ +@[expose] def branchClaims1Row28 : BranchClaims := ⟨#[branchClaims1And28Group00, branchClaims1And28Group01], 120, 119⟩ /-- Coverage claims for branch (1, 29), group 00. -/ +@[expose] def branchClaims1And29Group00 : Array NodeClaim := #[⟨4, 5456111795538373918, 36240594489113854, 36169672752134254, 37, 0, 0, 0, #[]⟩, @@ -1153,6 +1161,7 @@ def branchClaims1And29Group00 : Array NodeClaim := ⟨6, [], [900], [], []⟩]⟩] /-- Coverage claims for branch (1, 29), group 01. -/ +@[expose] def branchClaims1And29Group01 : Array NodeClaim := #[⟨1, 3034721566, 36240591263693868, 140737492025344, 704, 369459876, 88, 369427108, #[⟨0, [6, 6], [199], [], []⟩, @@ -1176,10 +1185,12 @@ def branchClaims1And29Group01 : Array NodeClaim := ⟨6, [], [31, 31], [57, 64, 65], []⟩]⟩] /-- Flat postorder claims for branch (1, 29). -/ +@[expose] def branchClaims1Row29 : BranchClaims := ⟨#[branchClaims1And29Group00, branchClaims1And29Group01], 67, 66⟩ /-- Coverage claims for branch (1, 30), group 00. -/ +@[expose] def branchClaims1And30Group00 : Array NodeClaim := #[⟨4, 7180427521651387678, 36240869362826494, 70370625893610, 152, 8589934592, 0, 0, #[⟨6, [], [], [], [25]⟩]⟩, @@ -1385,6 +1396,7 @@ def branchClaims1And30Group00 : Array NodeClaim := ⟨2, [], [456], [], []⟩]⟩] /-- Coverage claims for branch (1, 30), group 01. -/ +@[expose] def branchClaims1And30Group01 : Array NodeClaim := #[⟨4, 5155215172095716638, 36240869358632190, 211244477369518, 799, 8589934592, 0, 8589934592, #[⟨6, [], [243], [], []⟩]⟩, @@ -1594,6 +1606,7 @@ def branchClaims1And30Group01 : Array NodeClaim := 829, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 30), group 02. -/ +@[expose] def branchClaims1And30Group02 : Array NodeClaim := #[⟨4, 6174998910444514590, 36240869358632188, 36240317449017444, 829, 0, 0, 0, #[]⟩, @@ -1800,6 +1813,7 @@ def branchClaims1And30Group02 : Array NodeClaim := 798, 320, 0, 0, #[⟨1, [], [], [189, 190], []⟩]⟩] /-- Coverage claims for branch (1, 30), group 03. -/ +@[expose] def branchClaims1And30Group03 : Array NodeClaim := #[⟨4, 5442319644095950110, 36240867215334638, 211245562596590, 860, 536870912, 0, 0, #[⟨5, [], [], [], [30]⟩]⟩, @@ -1981,6 +1995,7 @@ def branchClaims1And30Group03 : Array NodeClaim := ⟨5, [], [], [254], []⟩]⟩] /-- Coverage claims for branch (1, 30), group 04. -/ +@[expose] def branchClaims1And30Group04 : Array NodeClaim := #[⟨2, 841351703838, 36240317463715054, 36099166571069440, 792, 16794058, 0, 16777674, #[⟨0, [], [377, 160], [], []⟩, @@ -2054,11 +2069,13 @@ def branchClaims1And30Group04 : Array NodeClaim := ⟨6, [7], [17], [217, 248, 273], []⟩]⟩] /-- Flat postorder claims for branch (1, 30). -/ +@[expose] def branchClaims1Row30 : BranchClaims := ⟨#[branchClaims1And30Group00, branchClaims1And30Group01, branchClaims1And30Group02, branchClaims1And30Group03, branchClaims1And30Group04], 275, 274⟩ /-- Coverage claims for branch (1, 31), group 00. -/ +@[expose] def branchClaims1And31Group00 : Array NodeClaim := #[⟨4, 7395755877765491998, 36240869358632190, 140740443796714, 909, 8589934592, 0, 0, #[⟨6, [], [], [], [63]⟩]⟩, @@ -2285,6 +2302,7 @@ def branchClaims1And31Group00 : Array NodeClaim := 933, 512, 128, 512, #[⟨1, [7], [1079], [], []⟩]⟩] /-- Coverage claims for branch (1, 31), group 01. -/ +@[expose] def branchClaims1And31Group01 : Array NodeClaim := #[⟨2, 441605172510, 36240868284857596, 550563742720, 790, 537412416, 128, 537412352, #[⟨1, [6], [169, 173], [63], []⟩, @@ -2483,6 +2501,7 @@ def branchClaims1And31Group01 : Array NodeClaim := ⟨2, [], [349], [], []⟩]⟩] /-- Coverage claims for branch (1, 31), group 02. -/ +@[expose] def branchClaims1And31Group02 : Array NodeClaim := #[⟨3, 6124896474401090846, 36240868293246076, 211519362568196, 834, 64, 0, 64, #[⟨1, [], [620], [], []⟩]⟩, @@ -2675,6 +2694,7 @@ def branchClaims1And31Group02 : Array NodeClaim := 982, 640, 64, 640, #[⟨1, [5], [282, 119], [], []⟩]⟩] /-- Coverage claims for branch (1, 31), group 03. -/ +@[expose] def branchClaims1And31Group03 : Array NodeClaim := #[⟨3, 8214566561411247390, 36240868293278958, 36029759898537984, 983, 33284, 33554504, 33284, #[⟨0, [5], [111], [], []⟩, @@ -2866,11 +2886,13 @@ def branchClaims1And31Group03 : Array NodeClaim := ⟨6, [6], [24], [187, 221, 248], []⟩]⟩] /-- Flat postorder claims for branch (1, 31). -/ +@[expose] def branchClaims1Row31 : BranchClaims := ⟨#[branchClaims1And31Group00, branchClaims1And31Group01, branchClaims1And31Group02, branchClaims1And31Group03], 250, 249⟩ /-- Coverage claims for branch (1, 32), group 00. -/ +@[expose] def branchClaims1And32Group00 : Array NodeClaim := #[⟨3, 7638105819293691166, 36100131878665278, 36028798898568224, 1013, 0, 8589950976, 0, #[⟨2, [5], [], [], []⟩, @@ -3104,6 +3126,7 @@ def branchClaims1And32Group00 : Array NodeClaim := 541, 8192, 0, 8192, #[⟨2, [], [1296], [], []⟩]⟩] /-- Coverage claims for branch (1, 32), group 01. -/ +@[expose] def branchClaims1And32Group01 : Array NodeClaim := #[⟨3, 7638105684270656798, 36240731923873006, 36028798900694016, 1058, 524288, 16384, 0, #[⟨2, [5], [], [], []⟩, @@ -3342,6 +3365,7 @@ def branchClaims1And32Group01 : Array NodeClaim := ⟨2, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (1, 32), group 02. -/ +@[expose] def branchClaims1And32Group02 : Array NodeClaim := #[⟨3, 6124896227157355806, 36240731919662332, 36169812339591268, 950, 0, 256, 0, #[⟨1, [5], [], [], []⟩]⟩, @@ -3552,6 +3576,7 @@ def branchClaims1And32Group02 : Array NodeClaim := 848, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 32), group 03. -/ +@[expose] def branchClaims1And32Group03 : Array NodeClaim := #[⟨4, 3714063290320039198, 36240869358632126, 36099580499638314, 733, 0, 0, 0, #[]⟩, @@ -3738,11 +3763,13 @@ def branchClaims1And32Group03 : Array NodeClaim := ⟨6, [], [29, 29], [195, 229, 244], []⟩]⟩] /-- Flat postorder claims for branch (1, 32). -/ +@[expose] def branchClaims1Row32 : BranchClaims := ⟨#[branchClaims1And32Group00, branchClaims1And32Group01, branchClaims1And32Group02, branchClaims1And32Group03], 246, 245⟩ /-- Coverage claims for branch (1, 33), group 00. -/ +@[expose] def branchClaims1And33Group00 : Array NodeClaim := #[⟨3, 5404320399824006430, 36240044733267198, 36028798630107246, 1130, 8589934592, 33554432, 8589934592, #[⟨5, [4], [], [], []⟩, @@ -3973,6 +4000,7 @@ def branchClaims1And33Group00 : Array NodeClaim := 12, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 33), group 01. -/ +@[expose] def branchClaims1And33Group01 : Array NodeClaim := #[⟨3, 6124896209475218718, 36240182172253438, 36169535047894084, 1165, 128, 131088, 0, #[⟨0, [5], [], [], []⟩, @@ -4200,6 +4228,7 @@ def branchClaims1And33Group01 : Array NodeClaim := 705, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (1, 33), group 02. -/ +@[expose] def branchClaims1And33Group02 : Array NodeClaim := #[⟨4, 8181633997158755614, 36240869367004414, 36240043375368428, 37, 0, 0, 0, #[]⟩, @@ -4395,6 +4424,7 @@ def branchClaims1And33Group02 : Array NodeClaim := ⟨1, [5], [282], [], []⟩]⟩] /-- Coverage claims for branch (1, 33), group 03. -/ +@[expose] def branchClaims1And33Group03 : Array NodeClaim := #[⟨3, 8142508966839594270, 36240869362818302, 36240041230991456, 1208, 134218072, 131072, 134218072, #[⟨0, [], [119, 106], [], []⟩, @@ -4539,6 +4569,7 @@ def branchClaims1And33Group03 : Array NodeClaim := ⟨6, [], [31, 31], [187, 215, 230], []⟩]⟩] /-- Flat postorder claims for branch (1, 33). -/ +@[expose] def branchClaims1Row33 : BranchClaims := ⟨#[branchClaims1And33Group00, branchClaims1And33Group01, branchClaims1And33Group02, branchClaims1And33Group03], 232, 231⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData02.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData02.lean index 261b89d839..7a613ae210 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData02.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData02.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (1, 34), group 00. -/ +@[expose] def branchClaims1And34Group00 : Array NodeClaim := #[⟨3, 5404320399824530718, 36240867219504382, 36028934458447982, 61, 33554432, 0, 33554432, #[⟨5, [], [331], [], []⟩]⟩, @@ -259,6 +260,7 @@ def branchClaims1And34Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (1, 34), group 01. -/ +@[expose] def branchClaims1And34Group01 : Array NodeClaim := #[⟨3, 6413126310212676894, 36240867211148542, 211381381506088, 290, 16640, 0, 16640, #[⟨1, [], [118], [], []⟩, @@ -425,10 +427,12 @@ def branchClaims1And34Group01 : Array NodeClaim := ⟨6, [], [17, 24, 29, 31, 17], [], []⟩]⟩] /-- Flat postorder claims for branch (1, 34). -/ +@[expose] def branchClaims1Row34 : BranchClaims := ⟨#[branchClaims1And34Group00, branchClaims1And34Group01], 105, 104⟩ /-- Coverage claims for branch (2, 1), group 00. -/ +@[expose] def branchClaims2And1Group00 : Array NodeClaim := #[⟨3, 8214566560345056542, 36100128657439998, 70368745257190, 1241, 21474836480, 0, 21474836480, #[⟨6, [], [1303, 883], [], []⟩]⟩, @@ -640,6 +644,7 @@ def branchClaims2And1Group00 : Array NodeClaim := 1289, 536870912, 0, 536870912, #[⟨5, [], [792], [], []⟩]⟩] /-- Coverage claims for branch (2, 1), group 01. -/ +@[expose] def branchClaims2And1Group01 : Array NodeClaim := #[⟨3, 8646912125092717854, 36240867219537134, 70506991585378, 1288, 4096, 0, 0, #[⟨2, [], [], [63], []⟩]⟩, @@ -812,10 +817,12 @@ def branchClaims2And1Group01 : Array NodeClaim := ⟨6, [7], [16], [84, 93, 108], []⟩]⟩] /-- Flat postorder claims for branch (2, 1). -/ +@[expose] def branchClaims2Row1 : BranchClaims := ⟨#[branchClaims2And1Group00, branchClaims2And1Group01], 110, 109⟩ /-- Coverage claims for branch (2, 2), group 00. -/ +@[expose] def branchClaims2And2Group00 : Array NodeClaim := #[⟨4, 8262980118902433054, 212072348056830, 211106244622566, 115, 17179869184, 0, 17179869184, #[⟨6, [], [818], [], []⟩]⟩, @@ -1042,6 +1049,7 @@ def branchClaims2And2Group00 : Array NodeClaim := 1296, 4294967296, 0, 4294967296, #[⟨6, [], [1176], [], []⟩]⟩] /-- Coverage claims for branch (2, 2), group 01. -/ +@[expose] def branchClaims2And2Group01 : Array NodeClaim := #[⟨3, 8214566423428293918, 212069663702254, 211243674663010, 1295, 135168, 0, 4096, #[⟨2, [], [279], [], []⟩, @@ -1238,10 +1246,12 @@ def branchClaims2And2Group01 : Array NodeClaim := ⟨6, [7], [16], [73, 96, 113], []⟩]⟩] /-- Flat postorder claims for branch (2, 2). -/ +@[expose] def branchClaims2Row2 : BranchClaims := ⟨#[branchClaims2And2Group00, branchClaims2And2Group01], 115, 114⟩ /-- Coverage claims for branch (2, 3), group 00. -/ +@[expose] def branchClaims2And3Group00 : Array NodeClaim := #[⟨2, 973171549470, 36240455439547646, 70368745261188, 1383, 0, 196992, 0, #[⟨1, [6, 5], [], [], []⟩, @@ -1490,6 +1500,7 @@ def branchClaims2And3Group00 : Array NodeClaim := ⟨6, [], [141], [], []⟩]⟩] /-- Coverage claims for branch (2, 3), group 01. -/ +@[expose] def branchClaims2And3Group01 : Array NodeClaim := #[⟨3, 7566048227414992158, 36240594489105646, 70368759942248, 1435, 17179869184, 0, 17179869184, #[⟨6, [], [141], [], []⟩]⟩, @@ -1668,10 +1679,12 @@ def branchClaims2And3Group01 : Array NodeClaim := ⟨6, [], [16, 16], [76, 90, 110], []⟩]⟩] /-- Flat postorder claims for branch (2, 3). -/ +@[expose] def branchClaims2Row3 : BranchClaims := ⟨#[branchClaims2And3Group00, branchClaims2And3Group01], 112, 111⟩ /-- Coverage claims for branch (2, 4), group 00. -/ +@[expose] def branchClaims2And4Group00 : Array NodeClaim := #[⟨3, 7638105576885675294, 36099307244944638, 70368744732902, 305, 25769803776, 0, 25769803776, #[⟨6, [], [1297, 882], [], []⟩]⟩, @@ -1871,6 +1884,7 @@ def branchClaims2And4Group00 : Array NodeClaim := 493, 17179869184, 0, 17179869184, #[⟨6, [], [357], [], []⟩]⟩] /-- Coverage claims for branch (2, 4), group 01. -/ +@[expose] def branchClaims2And4Group01 : Array NodeClaim := #[⟨4, 5456111557944763678, 36240594489113854, 211246087960686, 1498, 8589934592, 0, 8589934592, #[⟨6, [], [366], [], []⟩]⟩, @@ -2064,10 +2078,12 @@ def branchClaims2And4Group01 : Array NodeClaim := ⟨6, [7], [16], [88, 98, 112], []⟩]⟩] /-- Flat postorder claims for branch (2, 4). -/ +@[expose] def branchClaims2Row4 : BranchClaims := ⟨#[branchClaims2And4Group00, branchClaims2And4Group01], 114, 113⟩ /-- Coverage claims for branch (2, 5), group 00. -/ +@[expose] def branchClaims2And5Group00 : Array NodeClaim := #[⟨4, 7688771072158819614, 212072348056830, 211106244622566, 115, 17179869184, 0, 17179869184, #[⟨6, [], [816], [], []⟩]⟩, @@ -2270,6 +2286,7 @@ def branchClaims2And5Group00 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (2, 5), group 01. -/ +@[expose] def branchClaims2And5Group01 : Array NodeClaim := #[⟨2, 733471794462, 36240181098511478, 4250688, 1336, 18253686784, 1024, 1073752064, #[⟨2, [5], [150, 150], [], []⟩, @@ -2517,10 +2534,12 @@ def branchClaims2And5Group01 : Array NodeClaim := ⟨6, [7], [16], [99, 110, 123], []⟩]⟩] /-- Flat postorder claims for branch (2, 5). -/ +@[expose] def branchClaims2Row5 : BranchClaims := ⟨#[branchClaims2And5Group00, branchClaims2And5Group01], 125, 124⟩ /-- Coverage claims for branch (2, 6), group 00. -/ +@[expose] def branchClaims2And6Group00 : Array NodeClaim := #[⟨3, 7638105834103465246, 36240457050160382, 70369820064960, 1395, 17179934720, 2147484672, 17179934720, #[⟨2, [5], [], [], []⟩, @@ -2738,6 +2757,7 @@ def branchClaims2And6Group00 : Array NodeClaim := 1639, 4294967296, 0, 4294967296, #[⟨6, [], [1270], [], []⟩]⟩] /-- Coverage claims for branch (2, 6), group 01. -/ +@[expose] def branchClaims2And6Group01 : Array NodeClaim := #[⟨3, 6413126843067753758, 36240866682666238, 211656259965008, 1638, 32, 4097, 0, #[⟨0, [5], [], [], []⟩, @@ -2927,10 +2947,12 @@ def branchClaims2And6Group01 : Array NodeClaim := ⟨6, [], [16, 16], [70, 89, 107], []⟩]⟩] /-- Flat postorder claims for branch (2, 6). -/ +@[expose] def branchClaims2Row6 : BranchClaims := ⟨#[branchClaims2And6Group00, branchClaims2And6Group01], 109, 108⟩ /-- Coverage claims for branch (2, 8), group 00. -/ +@[expose] def branchClaims2And8Group00 : Array NodeClaim := #[⟨4, 7688771070821885214, 212072348056830, 211106244622566, 115, 17179869184, 0, 0, #[⟨6, [], [], [], [184]⟩]⟩, @@ -3132,6 +3154,7 @@ def branchClaims2And8Group00 : Array NodeClaim := 1669, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (2, 8), group 01. -/ +@[expose] def branchClaims2And8Group01 : Array NodeClaim := #[⟨2, 742066971934, 36239906220604646, 140737503593504, 1686, 17851089152, 335544400, 134217728, #[⟨0, [6], [], [], []⟩, @@ -3351,6 +3374,7 @@ def branchClaims2And8Group01 : Array NodeClaim := 1712, 4096, 0, 4096, #[⟨2, [], [464], [], []⟩]⟩] /-- Coverage claims for branch (2, 8), group 02. -/ +@[expose] def branchClaims2And8Group02 : Array NodeClaim := #[⟨2, 870614000926, 36240593952242918, 140737491535904, 1711, 17716875528, 0, 4104, #[⟨0, [], [373], [], []⟩, @@ -3509,10 +3533,12 @@ def branchClaims2And8Group02 : Array NodeClaim := ⟨6, [], [16, 16], [136, 152, 162], []⟩]⟩] /-- Flat postorder claims for branch (2, 8). -/ +@[expose] def branchClaims2Row8 : BranchClaims := ⟨#[branchClaims2And8Group00, branchClaims2And8Group01, branchClaims2And8Group02], 164, 163⟩ /-- Coverage claims for branch (2, 9), group 00. -/ +@[expose] def branchClaims2And9Group00 : Array NodeClaim := #[⟨4, 7689896970193954078, 36240594489113854, 70509136476390, 1498, 8589934592, 0, 0, #[⟨6, [], [], [], [214]⟩]⟩, @@ -3718,6 +3744,7 @@ def branchClaims2And9Group00 : Array NodeClaim := 1727, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (2, 9), group 01. -/ +@[expose] def branchClaims2And9Group01 : Array NodeClaim := #[⟨3, 3674938174905476382, 36240044196429046, 36028797034214498, 1596, 17179869184, 131072, 0, #[⟨3, [5], [], [], []⟩, @@ -3961,6 +3988,7 @@ def branchClaims2And9Group01 : Array NodeClaim := ⟨6, [], [], [125, 126], []⟩]⟩] /-- Coverage claims for branch (2, 9), group 02. -/ +@[expose] def branchClaims2And9Group02 : Array NodeClaim := #[⟨3, 8214565908576953630, 36100128657439982, 36099440646322274, 1303, 21474836480, 135168, 21474836480, #[⟨2, [5], [], [], []⟩, @@ -4172,10 +4200,12 @@ def branchClaims2And9Group02 : Array NodeClaim := ⟨6, [], [16, 16], [127, 168, 180], []⟩]⟩] /-- Flat postorder claims for branch (2, 9). -/ +@[expose] def branchClaims2Row9 : BranchClaims := ⟨#[branchClaims2And9Group00, branchClaims2And9Group01, branchClaims2And9Group02], 182, 181⟩ /-- Coverage claims for branch (2, 10), group 00. -/ +@[expose] def branchClaims2And10Group00 : Array NodeClaim := #[⟨2, 870573499678, 36240594480725116, 137707427872, 1803, 4328542216, 0, 4328542216, #[⟨0, [], [162], [], []⟩, @@ -4259,10 +4289,12 @@ def branchClaims2And10Group00 : Array NodeClaim := ⟨6, [7], [190, 190, 16], [13], []⟩]⟩] /-- Flat postorder claims for branch (2, 10). -/ +@[expose] def branchClaims2Row10 : BranchClaims := ⟨#[branchClaims2And10Group00], 15, 14⟩ /-- Coverage claims for branch (2, 11), group 00. -/ +@[expose] def branchClaims2And11Group00 : Array NodeClaim := #[⟨2, 870575596830, 36240868821761148, 1342216256, 1808, 8623499268, 0, 8623499268, #[⟨0, [], [150], [], []⟩, @@ -4350,10 +4382,12 @@ def branchClaims2And11Group00 : Array NodeClaim := ⟨6, [7], [190, 190, 16], [13], []⟩]⟩] /-- Flat postorder claims for branch (2, 11). -/ +@[expose] def branchClaims2Row11 : BranchClaims := ⟨#[branchClaims2And11Group00], 15, 14⟩ /-- Coverage claims for branch (2, 12), group 00. -/ +@[expose] def branchClaims2And12Group00 : Array NodeClaim := #[⟨2, 732067095838, 212071265926396, 70371160111104, 1814, 20488, 10240, 20488, #[⟨0, [], [162], [], []⟩, @@ -4479,10 +4513,12 @@ def branchClaims2And12Group00 : Array NodeClaim := ⟨6, [], [190, 190, 190, 16], [26], []⟩]⟩] /-- Flat postorder claims for branch (2, 12). -/ +@[expose] def branchClaims2Row12 : BranchClaims := ⟨#[branchClaims2And12Group00], 28, 27⟩ /-- Coverage claims for branch (2, 14), group 00. -/ +@[expose] def branchClaims2And14Group00 : Array NodeClaim := #[⟨3, 8214566044957238558, 212072348024062, 70368745249004, 1320, 21508390912, 0, 21508390912, #[⟨5, [], [855], [], []⟩, @@ -4708,6 +4744,7 @@ def branchClaims2And14Group00 : Array NodeClaim := ⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (2, 14), group 01. -/ +@[expose] def branchClaims2And14Group01 : Array NodeClaim := #[⟨1, 2997445918, 211796388003052, 140737488359456, 1845, 5748591140, 5247049, 1084524580, #[⟨0, [6, 6], [199], [], []⟩, @@ -4964,6 +5001,7 @@ def branchClaims2And14Group01 : Array NodeClaim := ⟨6, [], [16, 16], [93, 110, 118], []⟩]⟩] /-- Flat postorder claims for branch (2, 14). -/ +@[expose] def branchClaims2Row14 : BranchClaims := ⟨#[branchClaims2And14Group00, branchClaims2And14Group01], 120, 119⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData03.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData03.lean index 5c358a508d..9712f59f23 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData03.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData03.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (2, 15), group 00. -/ +@[expose] def branchClaims2And15Group00 : Array NodeClaim := #[⟨4, 8266357303235142942, 36240869366988030, 71058892798188, 1868, 33554432, 0, 33554432, #[⟨5, [], [785], [], []⟩]⟩, @@ -245,6 +246,7 @@ def branchClaims2And15Group00 : Array NodeClaim := ⟨6, [5], [], [62], []⟩]⟩] /-- Coverage claims for branch (2, 15), group 01. -/ +@[expose] def branchClaims2And15Group01 : Array NodeClaim := #[⟨3, 4107283576662877470, 36240869367020796, 36028797289534568, 254, 0, 16384, 0, #[⟨2, [5], [], [], []⟩]⟩, @@ -515,6 +517,7 @@ def branchClaims2And15Group01 : Array NodeClaim := ⟨6, [], [417, 145], [], []⟩]⟩] /-- Coverage claims for branch (2, 15), group 02. -/ +@[expose] def branchClaims2And15Group02 : Array NodeClaim := #[⟨3, 3098477260635202846, 36240869367004398, 36239903253605480, 1919, 2147500288, 0, 2147500288, #[⟨1, [], [576], [], []⟩, @@ -563,10 +566,12 @@ def branchClaims2And15Group02 : Array NodeClaim := ⟨6, [], [16, 16], [108, 125, 133], []⟩]⟩] /-- Flat postorder claims for branch (2, 15). -/ +@[expose] def branchClaims2Row15 : BranchClaims := ⟨#[branchClaims2And15Group00, branchClaims2And15Group01, branchClaims2And15Group02], 135, 134⟩ /-- Coverage claims for branch (2, 17), group 00. -/ +@[expose] def branchClaims2And17Group00 : Array NodeClaim := #[⟨3, 7638105575014884638, 212072348024062, 70368744724724, 1528, 25803358208, 0, 25803358208, #[⟨5, [], [855], [], []⟩, @@ -789,6 +794,7 @@ def branchClaims2And17Group00 : Array NodeClaim := 1929, 0, 64, 0, #[⟨1, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (2, 17), group 01. -/ +@[expose] def branchClaims2And17Group01 : Array NodeClaim := #[⟨3, 6413126611443475742, 36240869367012604, 140737771996272, 1930, 0, 64, 0, #[⟨1, [5], [], [], []⟩]⟩, @@ -1048,10 +1054,12 @@ def branchClaims2And17Group01 : Array NodeClaim := ⟨6, [], [16, 24, 16, 24], [122], []⟩]⟩] /-- Flat postorder claims for branch (2, 17). -/ +@[expose] def branchClaims2Row17 : BranchClaims := ⟨#[branchClaims2And17Group00, branchClaims2And17Group01], 124, 123⟩ /-- Coverage claims for branch (2, 18), group 00. -/ +@[expose] def branchClaims2And18Group00 : Array NodeClaim := #[⟨4, 7689896970194871582, 36240869366988030, 71058892273908, 1951, 33554432, 0, 33554432, #[⟨5, [], [785], [], []⟩]⟩, @@ -1281,6 +1289,7 @@ def branchClaims2And18Group00 : Array NodeClaim := ⟨6, [], [998], [], []⟩]⟩] /-- Coverage claims for branch (2, 18), group 01. -/ +@[expose] def branchClaims2And18Group01 : Array NodeClaim := #[⟨2, 458602145054, 36099992292228340, 36099165767355456, 1373, 1073817728, 1024, 1073752064, #[⟨1, [], [], [62], []⟩, @@ -1545,6 +1554,7 @@ def branchClaims2And18Group01 : Array NodeClaim := ⟨3, [], [416], [], []⟩]⟩] /-- Coverage claims for branch (2, 18), group 02. -/ +@[expose] def branchClaims2And18Group02 : Array NodeClaim := #[⟨2, 733178062110, 36240868293262580, 141287247317056, 1322, 17716740096, 65664, 17716740096, #[⟨1, [6], [], [], []⟩, @@ -1607,10 +1617,12 @@ def branchClaims2And18Group02 : Array NodeClaim := ⟨6, [], [16, 29, 16, 29], [138], []⟩]⟩] /-- Flat postorder claims for branch (2, 18). -/ +@[expose] def branchClaims2Row18 : BranchClaims := ⟨#[branchClaims2And18Group00, branchClaims2And18Group01, branchClaims2And18Group02], 140, 139⟩ /-- Coverage claims for branch (2, 23), group 00. -/ +@[expose] def branchClaims2And23Group00 : Array NodeClaim := #[⟨2, 702586447134, 211657883712758, 70368745236644, 1249, 131328, 0, 131328, #[⟨1, [], [377], [], []⟩, @@ -1846,6 +1858,7 @@ def branchClaims2And23Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (2, 23), group 01. -/ +@[expose] def branchClaims2And23Group01 : Array NodeClaim := #[⟨3, 4107283739328537886, 36240594489113724, 70508066912288, 1269, 16392, 0, 16392, #[⟨0, [], [600], [], []⟩, @@ -2057,10 +2070,12 @@ def branchClaims2And23Group01 : Array NodeClaim := ⟨6, [], [], [98, 118], []⟩]⟩] /-- Flat postorder claims for branch (2, 23). -/ +@[expose] def branchClaims2Row23 : BranchClaims := ⟨#[branchClaims2And23Group00, branchClaims2And23Group01], 120, 119⟩ /-- Coverage claims for branch (2, 24), group 00. -/ +@[expose] def branchClaims2And24Group00 : Array NodeClaim := #[⟨3, 8214566560353379614, 36240868293278966, 70368745289924, 1735, 21474902016, 0, 21474902016, #[⟨3, [], [632], [], []⟩, @@ -2302,6 +2317,7 @@ def branchClaims2And24Group00 : Array NodeClaim := 919, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (2, 24), group 01. -/ +@[expose] def branchClaims2And24Group01 : Array NodeClaim := #[⟨3, 8214566560873473310, 36240868293278950, 211243674695744, 2065, 135168, 0, 131072, #[⟨2, [], [], [63], []⟩, @@ -2471,10 +2487,12 @@ def branchClaims2And24Group01 : Array NodeClaim := ⟨6, [], [16, 16], [85, 91, 108], []⟩]⟩] /-- Flat postorder claims for branch (2, 24). -/ +@[expose] def branchClaims2Row24 : BranchClaims := ⟨#[branchClaims2And24Group00, branchClaims2And24Group01], 110, 109⟩ /-- Coverage claims for branch (2, 25), group 00. -/ +@[expose] def branchClaims2And25Group00 : Array NodeClaim := #[⟨4, 8266357818631283998, 36240869367020790, 211795844331684, 1007, 0, 0, 0, #[]⟩, @@ -2713,6 +2731,7 @@ def branchClaims2And25Group00 : Array NodeClaim := ⟨6, [6], [145, 395, 406, 395], [], []⟩]⟩] /-- Coverage claims for branch (2, 25), group 01. -/ +@[expose] def branchClaims2And25Group01 : Array NodeClaim := #[⟨3, 7133702551488849182, 36240594489113702, 211108382701664, 2102, 16384, 0, 16384, #[⟨2, [], [584], [], []⟩]⟩, @@ -2891,10 +2910,12 @@ def branchClaims2And25Group01 : Array NodeClaim := ⟨6, [], [16, 16], [74, 89, 103], []⟩]⟩] /-- Flat postorder claims for branch (2, 25). -/ +@[expose] def branchClaims2Row25 : BranchClaims := ⟨#[branchClaims2And25Group00, branchClaims2And25Group01], 105, 104⟩ /-- Coverage claims for branch (2, 26), group 00. -/ +@[expose] def branchClaims2And26Group00 : Array NodeClaim := #[⟨2, 608332571934, 211520981630190, 70368744714404, 1497, 131136, 0, 131136, #[⟨1, [], [374], [], []⟩, @@ -3145,6 +3166,7 @@ def branchClaims2And26Group00 : Array NodeClaim := 1491, 131072, 0, 0, #[⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (2, 26), group 01. -/ +@[expose] def branchClaims2And26Group01 : Array NodeClaim := #[⟨3, 4107283602225653022, 36240318537464956, 70507003663392, 1493, 64, 0, 64, #[⟨1, [], [621], [], []⟩]⟩, @@ -3278,10 +3300,12 @@ def branchClaims2And26Group01 : Array NodeClaim := ⟨6, [], [], [82, 96], []⟩]⟩] /-- Flat postorder claims for branch (2, 26). -/ +@[expose] def branchClaims2Row26 : BranchClaims := ⟨#[branchClaims2And26Group00, branchClaims2And26Group01], 98, 97⟩ /-- Coverage claims for branch (2, 27), group 00. -/ +@[expose] def branchClaims2And27Group00 : Array NodeClaim := #[⟨3, 7638105576893998366, 36240594489113838, 70368744765636, 1761, 25769869312, 0, 25769869312, #[⟨3, [], [603], [], []⟩, @@ -3508,6 +3532,7 @@ def branchClaims2And27Group00 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (2, 27), group 01. -/ +@[expose] def branchClaims2And27Group01 : Array NodeClaim := #[⟨4, 3140417314926781726, 36240594489113854, 36240453557861412, 2159, 65536, 0, 0, #[⟨3, [], [], [], [202]⟩]⟩, @@ -3619,10 +3644,12 @@ def branchClaims2And27Group01 : Array NodeClaim := ⟨6, [], [16, 24, 16, 24], [88], []⟩]⟩] /-- Flat postorder claims for branch (2, 27). -/ +@[expose] def branchClaims2Row27 : BranchClaims := ⟨#[branchClaims2And27Group00, branchClaims2And27Group01], 90, 89⟩ /-- Coverage claims for branch (2, 28), group 00. -/ +@[expose] def branchClaims2And28Group00 : Array NodeClaim := #[⟨4, 7689896972073985310, 36240869367020782, 211658941724836, 952, 0, 0, 0, #[]⟩, @@ -3854,6 +3881,7 @@ def branchClaims2And28Group00 : Array NodeClaim := 2184, 4096, 0, 4096, #[⟨2, [], [936], [], []⟩]⟩] /-- Coverage claims for branch (2, 28), group 01. -/ +@[expose] def branchClaims2And28Group01 : Array NodeClaim := #[⟨3, 6413126327440925982, 36240729780583548, 70644966423616, 2019, 786432, 20480, 0, #[⟨2, [5, 5], [], [], []⟩, @@ -3991,10 +4019,12 @@ def branchClaims2And28Group01 : Array NodeClaim := ⟨6, [], [16, 29, 16, 29], [94], []⟩]⟩] /-- Flat postorder claims for branch (2, 28). -/ +@[expose] def branchClaims2Row28 : BranchClaims := ⟨#[branchClaims2And28Group00, branchClaims2And28Group01], 96, 95⟩ /-- Coverage claims for branch (2, 29), group 00. -/ +@[expose] def branchClaims2And29Group00 : Array NodeClaim := #[⟨4, 5456111555020219678, 36240594489113854, 211246087960686, 1498, 8589934592, 0, 8589934592, #[⟨6, [], [356], [], []⟩]⟩, @@ -4273,6 +4303,7 @@ def branchClaims2And29Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (2, 29), group 01. -/ +@[expose] def branchClaims2And29Group01 : Array NodeClaim := #[⟨3, 3674937621091607838, 36240591804759166, 211243674663010, 1295, 135168, 0, 135168, #[⟨2, [], [584], [], []⟩, @@ -4426,10 +4457,12 @@ def branchClaims2And29Group01 : Array NodeClaim := ⟨6, [], [], [80, 101], []⟩]⟩] /-- Flat postorder claims for branch (2, 29). -/ +@[expose] def branchClaims2Row29 : BranchClaims := ⟨#[branchClaims2And29Group00, branchClaims2And29Group01], 103, 102⟩ /-- Coverage claims for branch (2, 30), group 00. -/ +@[expose] def branchClaims2And30Group00 : Array NodeClaim := #[⟨2, 728323613982, 212072339643646, 70369549488288, 1804, 4214856, 1, 4214856, #[⟨0, [6], [162], [], []⟩, @@ -4655,6 +4688,7 @@ def branchClaims2And30Group00 : Array NodeClaim := ⟨4, [], [143], [], []⟩]⟩] /-- Coverage claims for branch (2, 30), group 01. -/ +@[expose] def branchClaims2And30Group01 : Array NodeClaim := #[⟨1, 3514328350, 36100129722735860, 70643890520128, 1583, 6899781960, 3146771, 6446665736, #[⟨0, [7, 7, 7], [488], [], []⟩, @@ -4841,6 +4875,7 @@ def branchClaims2And30Group01 : Array NodeClaim := 1264, 20480, 0, 0, #[⟨2, [], [], [125, 126], []⟩]⟩] /-- Coverage claims for branch (2, 30), group 02. -/ +@[expose] def branchClaims2And30Group02 : Array NodeClaim := #[⟨4, 5451889677306455326, 36240869367020782, 211245554785384, 1339, 16384, 0, 0, #[⟨2, [], [], [], [160]⟩]⟩, @@ -5046,6 +5081,7 @@ def branchClaims2And30Group02 : Array NodeClaim := 2234, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (2, 30), group 03. -/ +@[expose] def branchClaims2And30Group03 : Array NodeClaim := #[⟨3, 5404320269373826334, 36240867219537006, 70644979993664, 2025, 786944, 536871296, 512, #[⟨1, [7, 5], [136], [], []⟩, @@ -5100,6 +5136,7 @@ def branchClaims2And30Group03 : Array NodeClaim := ⟨6, [], [], [181, 204], []⟩]⟩] /-- Flat postorder claims for branch (2, 30). -/ +@[expose] def branchClaims2Row30 : BranchClaims := ⟨#[branchClaims2And30Group00, branchClaims2And30Group01, branchClaims2And30Group02, branchClaims2And30Group03], 206, 205⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData04.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData04.lean index d6109e0c5c..d84d7f430b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData04.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData04.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (2, 31), group 00. -/ +@[expose] def branchClaims2And31Group00 : Array NodeClaim := #[⟨3, 7638105832176510238, 36240594480692478, 70510209677408, 2282, 16392, 0, 16392, #[⟨0, [], [276], [], []⟩, @@ -250,6 +251,7 @@ def branchClaims2And31Group00 : Array NodeClaim := ⟨2, [], [830], [], []⟩]⟩] /-- Coverage claims for branch (2, 31), group 01. -/ +@[expose] def branchClaims2And31Group01 : Array NodeClaim := #[⟨2, 188202116382, 36240868284841214, 550561122400, 2317, 9177137152, 8388610, 8640266240, #[⟨0, [6], [], [], []⟩, @@ -454,6 +456,7 @@ def branchClaims2And31Group01 : Array NodeClaim := ⟨5, [], [], [125, 126], []⟩]⟩] /-- Coverage claims for branch (2, 31), group 02. -/ +@[expose] def branchClaims2And31Group02 : Array NodeClaim := #[⟨3, 3098477410253301022, 36240594489113838, 36028799975951464, 822, 9126805504, 16640, 9126805504, #[⟨1, [5], [], [], []⟩, @@ -678,6 +681,7 @@ def branchClaims2And31Group02 : Array NodeClaim := ⟨2, [5], [111], [], []⟩]⟩] /-- Coverage claims for branch (2, 31), group 03. -/ +@[expose] def branchClaims2And31Group03 : Array NodeClaim := #[⟨2, 879977063710, 36240594489113700, 36239905672134656, 2378, 8678, 8388608, 8198, #[⟨0, [], [143, 150], [], []⟩, @@ -812,11 +816,13 @@ def branchClaims2And31Group03 : Array NodeClaim := ⟨6, [], [16, 24, 16, 24], [221], []⟩]⟩] /-- Flat postorder claims for branch (2, 31). -/ +@[expose] def branchClaims2Row31 : BranchClaims := ⟨#[branchClaims2And31Group00, branchClaims2And31Group01, branchClaims2And31Group02, branchClaims2And31Group03], 223, 222⟩ /-- Coverage claims for branch (2, 32), group 00. -/ +@[expose] def branchClaims2And32Group00 : Array NodeClaim := #[⟨3, 5404320266678986014, 36240868830149758, 1344289890, 2398, 0, 20480, 0, #[⟨2, [5, 5], [], [], []⟩]⟩, @@ -1064,6 +1070,7 @@ def branchClaims2And32Group00 : Array NodeClaim := 2419, 33554432, 0, 33554432, #[⟨5, [], [988], [], []⟩]⟩] /-- Coverage claims for branch (2, 32), group 01. -/ +@[expose] def branchClaims2And32Group01 : Array NodeClaim := #[⟨2, 599984203038, 36240868821736702, 552171735200, 2307, 13455327232, 25186570, 12918456320, #[⟨0, [5, 5], [], [], []⟩, @@ -1275,6 +1282,7 @@ def branchClaims2And32Group01 : Array NodeClaim := ⟨5, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (2, 32), group 02. -/ +@[expose] def branchClaims2And32Group02 : Array NodeClaim := #[⟨3, 3098477285701346590, 36240731928067182, 36028799986961440, 2439, 0, 536871168, 0, #[⟨1, [5], [], [], []⟩, @@ -1521,6 +1529,7 @@ def branchClaims2And32Group02 : Array NodeClaim := 1632, 0, 4096, 0, #[⟨2, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (2, 32), group 03. -/ +@[expose] def branchClaims2And32Group03 : Array NodeClaim := #[⟨4, 7685675079637165342, 36240869367020782, 36240457037007072, 756, 0, 0, 0, #[]⟩, @@ -1627,11 +1636,13 @@ def branchClaims2And32Group03 : Array NodeClaim := ⟨6, [], [16, 29, 16, 29], [217], []⟩]⟩] /-- Flat postorder claims for branch (2, 32). -/ +@[expose] def branchClaims2Row32 : BranchClaims := ⟨#[branchClaims2And32Group00, branchClaims2And32Group01, branchClaims2And32Group02, branchClaims2And32Group03], 219, 218⟩ /-- Coverage claims for branch (2, 33), group 00. -/ +@[expose] def branchClaims2And33Group00 : Array NodeClaim := #[⟨4, 5454985655113770270, 36240594489081086, 211246904776814, 1299, 0, 0, 0, #[]⟩, @@ -1901,6 +1912,7 @@ def branchClaims2And33Group00 : Array NodeClaim := ⟨6, [5], [107], [], []⟩]⟩] /-- Coverage claims for branch (2, 33), group 01. -/ +@[expose] def branchClaims2And33Group01 : Array NodeClaim := #[⟨3, 5980781158536340766, 36240869367012598, 36239903255712880, 1940, 1073741824, 2147487808, 1073741824, #[⟨1, [5], [], [], []⟩, @@ -2177,6 +2189,7 @@ def branchClaims2And33Group01 : Array NodeClaim := ⟨6, [], [58], [], []⟩]⟩] /-- Coverage claims for branch (2, 33), group 02. -/ +@[expose] def branchClaims2And33Group02 : Array NodeClaim := #[⟨4, 6023846164303471902, 36240869366988030, 211658944288890, 2492, 33554432, 0, 33554432, #[⟨5, [], [230], [], []⟩]⟩, @@ -2318,10 +2331,12 @@ def branchClaims2And33Group02 : Array NodeClaim := ⟨6, [], [], [147, 164], []⟩]⟩] /-- Flat postorder claims for branch (2, 33). -/ +@[expose] def branchClaims2Row33 : BranchClaims := ⟨#[branchClaims2And33Group00, branchClaims2And33Group01, branchClaims2And33Group02], 166, 165⟩ /-- Coverage claims for branch (2, 34), group 00. -/ +@[expose] def branchClaims2And34Group00 : Array NodeClaim := #[⟨3, 5404320159306376478, 36240868830117118, 70506183661678, 61, 33554432, 0, 33554432, #[⟨5, [], [297], [], []⟩]⟩, @@ -2606,6 +2621,7 @@ def branchClaims2And34Group00 : Array NodeClaim := ⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (2, 34), group 01. -/ +@[expose] def branchClaims2And34Group01 : Array NodeClaim := #[⟨2, 324638106910, 36240866682625278, 70918501042244, 1325, 65664, 0, 65536, #[⟨1, [], [], [63], []⟩, @@ -2838,6 +2854,7 @@ def branchClaims2And34Group01 : Array NodeClaim := ⟨6, [], [342], [], []⟩]⟩] /-- Coverage claims for branch (2, 34), group 02. -/ +@[expose] def branchClaims2And34Group02 : Array NodeClaim := #[⟨2, 325460190494, 36240866682657902, 36099165767355456, 1373, 1073817728, 1024, 1073752064, #[⟨1, [], [], [126], []⟩, @@ -2964,10 +2981,12 @@ def branchClaims2And34Group02 : Array NodeClaim := ⟨6, [], [24, 29], [], []⟩]⟩] /-- Flat postorder claims for branch (2, 34). -/ +@[expose] def branchClaims2Row34 : BranchClaims := ⟨#[branchClaims2And34Group00, branchClaims2And34Group01, branchClaims2And34Group02], 162, 161⟩ /-- Coverage claims for branch (3, 1), group 00. -/ +@[expose] def branchClaims3And1Group00 : Array NodeClaim := #[⟨3, 7782220870489727262, 36240180024753406, 211106777279584, 615, 131328, 0, 131328, #[⟨1, [], [1204], [], []⟩, @@ -3166,6 +3185,7 @@ def branchClaims3And1Group00 : Array NodeClaim := 548, 16384, 0, 16384, #[⟨2, [], [515], [], []⟩]⟩] /-- Coverage claims for branch (3, 1), group 01. -/ +@[expose] def branchClaims3And1Group01 : Array NodeClaim := #[⟨3, 6413126310988341534, 36240729772195066, 36099440909515880, 2526, 12884901888, 16384, 8589934592, #[⟨2, [5], [], [], []⟩, @@ -3331,10 +3351,12 @@ def branchClaims3And1Group01 : Array NodeClaim := ⟨6, [], [30, 30], [94, 101, 109], []⟩]⟩] /-- Flat postorder claims for branch (3, 1). -/ +@[expose] def branchClaims3Row1 : BranchClaims := ⟨#[branchClaims3And1Group00, branchClaims3And1Group01], 111, 110⟩ /-- Coverage claims for branch (3, 2), group 00. -/ +@[expose] def branchClaims3And2Group00 : Array NodeClaim := #[⟨3, 8646911998410088734, 36240317459528958, 211245016812640, 2517, 4352, 0, 4352, #[⟨1, [], [979], [], []⟩, @@ -3534,6 +3556,7 @@ def branchClaims3And2Group00 : Array NodeClaim := 1151, 16384, 0, 16384, #[⟨2, [], [388], [], []⟩]⟩] /-- Coverage claims for branch (3, 2), group 01. -/ +@[expose] def branchClaims3And2Group01 : Array NodeClaim := #[⟨3, 7782220872588976414, 36240729780583658, 36239904327916608, 2565, 65536, 147456, 0, #[⟨2, [5], [], [], []⟩, @@ -3714,10 +3737,12 @@ def branchClaims3And2Group01 : Array NodeClaim := ⟨6, [], [30, 30], [93, 103, 114], []⟩]⟩] /-- Flat postorder claims for branch (3, 2). -/ +@[expose] def branchClaims3Row2 : BranchClaims := ⟨#[branchClaims3And2Group00, branchClaims3And2Group01], 116, 115⟩ /-- Coverage claims for branch (3, 3), group 00. -/ +@[expose] def branchClaims3And3Group00 : Array NodeClaim := #[⟨3, 6413126308360610078, 36240319065947390, 70369015762168, 2580, 536870912, 0, 536870912, #[⟨5, [], [318], [], []⟩]⟩, @@ -3908,6 +3933,7 @@ def branchClaims3And3Group00 : Array NodeClaim := 1159, 8192, 0, 0, #[⟨2, [], [], [], [715]⟩]⟩] /-- Coverage claims for branch (3, 3), group 01. -/ +@[expose] def branchClaims3And3Group01 : Array NodeClaim := #[⟨3, 7349875334135406878, 36240730854325482, 36239905401658496, 2613, 65536, 0, 0, #[⟨3, [], [], [63], []⟩]⟩, @@ -4024,10 +4050,12 @@ def branchClaims3And3Group01 : Array NodeClaim := ⟨6, [], [30, 30], [76, 85, 93], []⟩]⟩] /-- Flat postorder claims for branch (3, 3). -/ +@[expose] def branchClaims3Row3 : BranchClaims := ⟨#[branchClaims3And3Group00, branchClaims3And3Group01], 95, 94⟩ /-- Coverage claims for branch (3, 4), group 00. -/ +@[expose] def branchClaims3And4Group00 : Array NodeClaim := #[⟨4, 5454985655957578014, 36240593952210174, 211243683577066, 493, 17179869184, 0, 17179869184, #[⟨6, [], [1320], [], []⟩]⟩, @@ -4212,6 +4240,7 @@ def branchClaims3And4Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (3, 4), group 01. -/ +@[expose] def branchClaims3And4Group01 : Array NodeClaim := #[⟨4, 8686599989737283870, 36240319609109758, 36240043652201632, 1030, 8192, 0, 8192, #[⟨2, [], [515], [], []⟩]⟩, @@ -4389,10 +4418,12 @@ def branchClaims3And4Group01 : Array NodeClaim := ⟨6, [], [30, 30], [86, 100, 112], []⟩]⟩] /-- Flat postorder claims for branch (3, 4). -/ +@[expose] def branchClaims3Row4 : BranchClaims := ⟨#[branchClaims3And4Group00, branchClaims3And4Group01], 114, 113⟩ /-- Coverage claims for branch (3, 5), group 00. -/ +@[expose] def branchClaims3And5Group00 : Array NodeClaim := #[⟨4, 3149142646745981214, 36240868293246206, 211106244623594, 493, 17179869184, 0, 17179869184, #[⟨6, [], [904], [], []⟩]⟩, @@ -4584,6 +4615,7 @@ def branchClaims3And5Group00 : Array NodeClaim := 1980, 64, 0, 64, #[⟨1, [], [1168], [], []⟩]⟩] /-- Coverage claims for branch (3, 5), group 01. -/ +@[expose] def branchClaims3And5Group01 : Array NodeClaim := #[⟨3, 4107283327345746206, 36240317463715066, 36099166573188208, 2666, 8589934592, 64, 0, #[⟨1, [5], [], [], []⟩, @@ -4769,6 +4801,7 @@ def branchClaims3And5Group01 : Array NodeClaim := ⟨6, [], [30, 30], [86, 99, 114], []⟩]⟩] /-- Flat postorder claims for branch (3, 5). -/ +@[expose] def branchClaims3Row5 : BranchClaims := ⟨#[branchClaims3And5Group00, branchClaims3And5Group01], 116, 115⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData05.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData05.lean index 27360d31dc..c7a6c1d1c9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData05.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData05.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (3, 6), group 00. -/ +@[expose] def branchClaims3And6Group00 : Array NodeClaim := #[⟨3, 6413126064370082078, 36240729772195070, 70369015239928, 2682, 268435456, 0, 268435456, #[⟨5, [], [308], [], []⟩]⟩, @@ -211,6 +212,7 @@ def branchClaims3And6Group00 : Array NodeClaim := 172, 17179869184, 0, 0, #[⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (3, 6), group 01. -/ +@[expose] def branchClaims3And6Group01 : Array NodeClaim := #[⟨4, 4155697425695367454, 36240869367012602, 36240043646949552, 2701, 4, 0, 4, #[⟨0, [], [312], [], []⟩]⟩, @@ -323,10 +325,12 @@ def branchClaims3And6Group01 : Array NodeClaim := ⟨6, [], [30, 30], [67, 82, 95], []⟩]⟩] /-- Flat postorder claims for branch (3, 6). -/ +@[expose] def branchClaims3Row6 : BranchClaims := ⟨#[branchClaims3And6Group00, branchClaims3And6Group01], 97, 96⟩ /-- Coverage claims for branch (3, 10), group 00. -/ +@[expose] def branchClaims3And10Group00 : Array NodeClaim := #[⟨3, 8358681639739056414, 36240318529076478, 211244482038880, 2517, 4352, 0, 4352, #[⟨1, [], [580], [], []⟩, @@ -513,6 +517,7 @@ def branchClaims3And10Group00 : Array NodeClaim := ⟨2, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (3, 10), group 01. -/ +@[expose] def branchClaims3And10Group01 : Array NodeClaim := #[⟨4, 6162895347140649246, 36240318535367934, 211519355796724, 2738, 4294967296, 0, 4294967296, #[⟨6, [], [761], [], []⟩]⟩, @@ -692,6 +697,7 @@ def branchClaims3And10Group01 : Array NodeClaim := ⟨6, [], [413], [126], []⟩]⟩] /-- Coverage claims for branch (3, 10), group 02. -/ +@[expose] def branchClaims3And10Group02 : Array NodeClaim := #[⟨4, 5595160045847961886, 36240867219537148, 36239905131134056, 1151, 16384, 0, 16384, #[⟨2, [], [222], [], []⟩]⟩, @@ -748,10 +754,12 @@ def branchClaims3And10Group02 : Array NodeClaim := ⟨6, [], [190, 190, 190, 30, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (3, 10). -/ +@[expose] def branchClaims3Row10 : BranchClaims := ⟨#[branchClaims3And10Group00, branchClaims3And10Group01, branchClaims3And10Group02], 145, 144⟩ /-- Coverage claims for branch (3, 11), group 00. -/ +@[expose] def branchClaims3And11Group00 : Array NodeClaim := #[⟨3, 7782220886900859166, 36240182163848446, 211108114213984, 1086, 16640, 0, 16640, #[⟨1, [], [1203], [], []⟩, @@ -963,6 +971,7 @@ def branchClaims3And11Group00 : Array NodeClaim := 2753, 12884901888, 0, 0, #[⟨6, [], [], [61, 62], []⟩]⟩] /-- Coverage claims for branch (3, 11), group 01. -/ +@[expose] def branchClaims3And11Group01 : Array NodeClaim := #[⟨3, 7782220738909036830, 36240867219520766, 211107575272640, 2658, 8224, 0, 8224, #[⟨1, [], [1193], [], []⟩, @@ -1121,10 +1130,12 @@ def branchClaims3And11Group01 : Array NodeClaim := ⟨6, [], [190, 190, 190, 30, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (3, 11). -/ +@[expose] def branchClaims3Row11 : BranchClaims := ⟨#[branchClaims3And11Group00, branchClaims3And11Group01], 113, 112⟩ /-- Coverage claims for branch (3, 12), group 00. -/ +@[expose] def branchClaims3And12Group00 : Array NodeClaim := #[⟨4, 6029194457073180958, 36240731923840254, 211109187976434, 450, 8589934592, 0, 8589934592, #[⟨6, [], [1323], [], []⟩]⟩, @@ -1315,6 +1326,7 @@ def branchClaims3And12Group00 : Array NodeClaim := ⟨2, [6, 6], [892, 378], [], []⟩]⟩] /-- Coverage claims for branch (3, 12), group 01. -/ +@[expose] def branchClaims3And12Group01 : Array NodeClaim := #[⟨3, 7277817851230675230, 36240592878501116, 36240453279978720, 923, 0, 0, 0, #[]⟩, @@ -1449,10 +1461,12 @@ def branchClaims3And12Group01 : Array NodeClaim := ⟨6, [], [190, 190, 190, 30, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (3, 12). -/ +@[expose] def branchClaims3Row12 : BranchClaims := ⟨#[branchClaims3And12Group00, branchClaims3And12Group01], 107, 106⟩ /-- Coverage claims for branch (3, 23), group 00. -/ +@[expose] def branchClaims3And23Group00 : Array NodeClaim := #[⟨4, 5167881178860675358, 36240594486983934, 211246624832742, 457, 8589934592, 0, 8589934592, #[⟨6, [], [1318], [], []⟩]⟩, @@ -1644,6 +1658,7 @@ def branchClaims3And23Group00 : Array NodeClaim := 2633, 4096, 0, 4096, #[⟨2, [], [629], [], []⟩]⟩] /-- Coverage claims for branch (3, 23), group 01. -/ +@[expose] def branchClaims3And23Group01 : Array NodeClaim := #[⟨2, 713860768030, 36240042581622004, 211106235690016, 2519, 135424, 0, 256, #[⟨1, [], [1282], [], []⟩, @@ -1847,6 +1862,7 @@ def branchClaims3And23Group01 : Array NodeClaim := 2844, 131072, 0, 0, #[⟨3, [], [], [126], []⟩]⟩] /-- Coverage claims for branch (3, 23), group 02. -/ +@[expose] def branchClaims3And23Group02 : Array NodeClaim := #[⟨4, 3860430047649915166, 36240594489113846, 36239903800482992, 2817, 0, 0, 0, #[]⟩, @@ -2019,6 +2035,7 @@ def branchClaims3And23Group02 : Array NodeClaim := ⟨6, [], [145, 145], [], []⟩]⟩] /-- Coverage claims for branch (3, 23), group 03. -/ +@[expose] def branchClaims3And23Group03 : Array NodeClaim := #[⟨4, 3293257810865479966, 36240867215342830, 36240453556296868, 327, 65536, 0, 0, #[⟨3, [], [], [], [652]⟩]⟩, @@ -2201,6 +2218,7 @@ def branchClaims3And23Group03 : Array NodeClaim := 1293, 131072, 0, 131072, #[⟨3, [], [353], [], []⟩]⟩] /-- Coverage claims for branch (3, 23), group 04. -/ +@[expose] def branchClaims3And23Group04 : Array NodeClaim := #[⟨3, 5980781184348250398, 36240869366988018, 36239904335222848, 2869, 65540, 131072, 65540, #[⟨0, [], [601], [], []⟩, @@ -2332,11 +2350,13 @@ def branchClaims3And23Group04 : Array NodeClaim := ⟨6, [], [], [260, 295], []⟩]⟩] /-- Flat postorder claims for branch (3, 23). -/ +@[expose] def branchClaims3Row23 : BranchClaims := ⟨#[branchClaims3And23Group00, branchClaims3And23Group01, branchClaims3And23Group02, branchClaims3And23Group03, branchClaims3And23Group04], 297, 296⟩ /-- Coverage claims for branch (3, 24), group 00. -/ +@[expose] def branchClaims3And24Group00 : Array NodeClaim := #[⟨3, 8358681239978959134, 36240319602801918, 211243677268064, 103, 131080, 0, 131080, #[⟨0, [], [1191], [], []⟩, @@ -2524,6 +2544,7 @@ def branchClaims3And24Group00 : Array NodeClaim := ⟨3, [], [670], [], []⟩]⟩] /-- Coverage claims for branch (3, 24), group 01. -/ +@[expose] def branchClaims3And24Group01 : Array NodeClaim := #[⟨3, 8646912163202130206, 36240869364907250, 36239907278592128, 2615, 8196, 0, 8196, #[⟨0, [], [1191], [], []⟩, @@ -2722,6 +2743,7 @@ def branchClaims3And24Group01 : Array NodeClaim := 1158, 0, 16384, 0, #[⟨2, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (3, 24), group 02. -/ +@[expose] def branchClaims3And24Group02 : Array NodeClaim := #[⟨4, 8256505688460288286, 36240868293278972, 36239903798394020, 359, 65536, 0, 65536, #[⟨3, [], [225], [], []⟩]⟩, @@ -2893,6 +2915,7 @@ def branchClaims3And24Group02 : Array NodeClaim := 2792, 2048, 0, 2048, #[⟨2, [], [1211], [], []⟩]⟩] /-- Coverage claims for branch (3, 24), group 03. -/ +@[expose] def branchClaims3And24Group03 : Array NodeClaim := #[⟨3, 3819053336337506590, 36240318537465076, 36240040691563552, 2531, 135168, 0, 0, #[⟨2, [], [], [190], []⟩, @@ -3063,6 +3086,7 @@ def branchClaims3And24Group03 : Array NodeClaim := 1151, 16384, 0, 16384, #[⟨2, [], [1213], [], []⟩]⟩] /-- Coverage claims for branch (3, 24), group 04. -/ +@[expose] def branchClaims3And24Group04 : Array NodeClaim := #[⟨3, 5548435182541529374, 36240731919678700, 36239903256280128, 2559, 73728, 147456, 0, #[⟨2, [5], [], [254], []⟩, @@ -3245,6 +3269,7 @@ def branchClaims3And24Group04 : Array NodeClaim := ⟨2, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (3, 24), group 05. -/ +@[expose] def branchClaims3And24Group05 : Array NodeClaim := #[⟨4, 8227232402786410782, 36240868293278958, 36240178672073828, 140, 131072, 0, 131072, #[⟨3, [], [1048], [], []⟩]⟩, @@ -3338,6 +3363,7 @@ def branchClaims3And24Group05 : Array NodeClaim := ⟨6, [], [], [309, 347], []⟩]⟩] /-- Flat postorder claims for branch (3, 24). -/ +@[expose] def branchClaims3Row24 : BranchClaims := ⟨#[branchClaims3And24Group00, branchClaims3And24Group01, branchClaims3And24Group02, branchClaims3And24Group03, branchClaims3And24Group04, branchClaims3And24Group05], 349, 348⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData06.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData06.lean index d9c483d36b..b0358b1ecc 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData06.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData06.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (3, 25), group 00. -/ +@[expose] def branchClaims3And25Group00 : Array NodeClaim := #[⟨3, 8358681239981056286, 36240319065947390, 36099304281610336, 2553, 33554432, 131080, 33554432, #[⟨0, [5], [], [], []⟩, @@ -208,6 +209,7 @@ def branchClaims3And25Group00 : Array NodeClaim := 2792, 2048, 0, 0, #[⟨2, [], [], [], [831]⟩]⟩] /-- Coverage claims for branch (3, 25), group 01. -/ +@[expose] def branchClaims3And25Group01 : Array NodeClaim := #[⟨3, 3819052924576391454, 36240593943854326, 36099165766343856, 2923, 17179869184, 0, 0, #[⟨6, [], [], [63], []⟩]⟩, @@ -417,6 +419,7 @@ def branchClaims3And25Group01 : Array NodeClaim := ⟨2, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (3, 25), group 02. -/ +@[expose] def branchClaims3And25Group02 : Array NodeClaim := #[⟨2, 740458946846, 36239907294346464, 36239905401621504, 2928, 213120, 0, 0, #[⟨1, [], [], [119], []⟩, @@ -601,6 +604,7 @@ def branchClaims3And25Group02 : Array NodeClaim := 359, 65536, 0, 0, #[⟨3, [], [], [], [822]⟩]⟩] /-- Coverage claims for branch (3, 25), group 03. -/ +@[expose] def branchClaims3And25Group03 : Array NodeClaim := #[⟨4, 3285658118033957150, 36240869362826492, 36239905670102184, 1159, 8192, 0, 0, #[⟨2, [], [], [], [821]⟩]⟩, @@ -770,6 +774,7 @@ def branchClaims3And25Group03 : Array NodeClaim := 283, 131072, 0, 131072, #[⟨3, [], [1207], [], []⟩]⟩] /-- Coverage claims for branch (3, 25), group 04. -/ +@[expose] def branchClaims3And25Group04 : Array NodeClaim := #[⟨4, 5564479255679263006, 36240594480725244, 36240042037410920, 1151, 16384, 0, 0, #[⟨2, [], [], [], [845]⟩]⟩, @@ -959,6 +964,7 @@ def branchClaims3And25Group04 : Array NodeClaim := ⟨2, [5], [], [318], []⟩]⟩] /-- Coverage claims for branch (3, 25), group 05. -/ +@[expose] def branchClaims3And25Group05 : Array NodeClaim := #[⟨2, 307975872798, 36240593952234726, 36169534508387392, 2577, 21474904192, 0, 0, #[⟨1, [], [], [314], []⟩, @@ -1033,11 +1039,13 @@ def branchClaims3And25Group05 : Array NodeClaim := ⟨6, [], [], [307, 339], []⟩]⟩] /-- Flat postorder claims for branch (3, 25). -/ +@[expose] def branchClaims3Row25 : BranchClaims := ⟨#[branchClaims3And25Group00, branchClaims3And25Group01, branchClaims3And25Group02, branchClaims3And25Group03, branchClaims3And25Group04, branchClaims3And25Group05], 341, 340⟩ /-- Coverage claims for branch (3, 26), group 00. -/ +@[expose] def branchClaims3And26Group00 : Array NodeClaim := #[⟨4, 5599101104973603102, 36240868830149870, 36240041767894116, 283, 131072, 0, 131072, #[⟨3, [], [527], [], []⟩]⟩, @@ -1229,6 +1237,7 @@ def branchClaims3And26Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (3, 26), group 01. -/ +@[expose] def branchClaims3And26Group01 : Array NodeClaim := #[⟨4, 5596286338261508382, 36240319611206908, 36240040696282212, 283, 131072, 0, 131072, #[⟨3, [], [224], [], []⟩]⟩, @@ -1433,6 +1442,7 @@ def branchClaims3And26Group01 : Array NodeClaim := ⟨3, [], [], [126], []⟩]⟩] /-- Coverage claims for branch (3, 26), group 02. -/ +@[expose] def branchClaims3And26Group02 : Array NodeClaim := #[⟨2, 599793000734, 36240317996399850, 211106232581248, 2587, 2147635200, 1073818624, 2147614720, #[⟨2, [6, 6, 6], [], [124, 127], []⟩, @@ -1609,6 +1619,7 @@ def branchClaims3And26Group02 : Array NodeClaim := 1159, 8192, 0, 0, #[⟨2, [], [], [], [694]⟩]⟩] /-- Coverage claims for branch (3, 26), group 03. -/ +@[expose] def branchClaims3And26Group03 : Array NodeClaim := #[⟨3, 3242592465180614942, 36240318537465068, 36239903788956704, 102, 147456, 0, 0, #[⟨2, [], [], [190], []⟩, @@ -1788,6 +1799,7 @@ def branchClaims3And26Group03 : Array NodeClaim := ⟨6, [], [1239], [], []⟩]⟩] /-- Coverage claims for branch (3, 26), group 04. -/ +@[expose] def branchClaims3And26Group04 : Array NodeClaim := #[⟨2, 188247892254, 36240866143665386, 36099440642111520, 2993, 4104, 0, 0, #[⟨0, [], [], [254], []⟩, @@ -1915,11 +1927,13 @@ def branchClaims3And26Group04 : Array NodeClaim := ⟨6, [], [], [253, 296], []⟩]⟩] /-- Flat postorder claims for branch (3, 26). -/ +@[expose] def branchClaims3Row26 : BranchClaims := ⟨#[branchClaims3And26Group00, branchClaims3And26Group01, branchClaims3And26Group02, branchClaims3And26Group03, branchClaims3And26Group04], 298, 297⟩ /-- Coverage claims for branch (3, 27), group 00. -/ +@[expose] def branchClaims3And27Group00 : Array NodeClaim := #[⟨3, 5548435609169879326, 36240593943854318, 36169535581633636, 641, 0, 131072, 0, #[⟨3, [5], [], [], []⟩]⟩, @@ -2101,6 +2115,7 @@ def branchClaims3And27Group00 : Array NodeClaim := 309, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (3, 27), group 01. -/ +@[expose] def branchClaims3And27Group01 : Array NodeClaim := #[⟨3, 8142509004735832350, 36240868828036342, 36240040699401440, 2601, 0, 0, 0, #[]⟩, @@ -2298,6 +2313,7 @@ def branchClaims3And27Group01 : Array NodeClaim := ⟨6, [], [208, 208], [], []⟩]⟩] /-- Coverage claims for branch (3, 27), group 02. -/ +@[expose] def branchClaims3And27Group02 : Array NodeClaim := #[⟨3, 7782220480730292510, 36240592341630206, 211657063667904, 2592, 65540, 0, 65540, #[⟨0, [], [983], [], []⟩, @@ -2478,6 +2494,7 @@ def branchClaims3And27Group02 : Array NodeClaim := ⟨6, [0, 0], [], [], []⟩]⟩] /-- Coverage claims for branch (3, 27), group 03. -/ +@[expose] def branchClaims3And27Group03 : Array NodeClaim := #[⟨4, 5419238604506587422, 36240593952242942, 36240041772088416, 2554, 131072, 0, 0, #[⟨3, [], [], [], [785]⟩]⟩, @@ -2648,6 +2665,7 @@ def branchClaims3And27Group03 : Array NodeClaim := ⟨6, [0, 0], [], [], []⟩]⟩] /-- Coverage claims for branch (3, 27), group 04. -/ +@[expose] def branchClaims3And27Group04 : Array NodeClaim := #[⟨4, 3140416782350868766, 36240592341630206, 36240453558385824, 195, 65536, 0, 65536, #[⟨3, [], [653], [], []⟩]⟩, @@ -2831,6 +2849,7 @@ def branchClaims3And27Group04 : Array NodeClaim := ⟨2, [], [], [318], []⟩]⟩] /-- Coverage claims for branch (3, 27), group 05. -/ +@[expose] def branchClaims3And27Group05 : Array NodeClaim := #[⟨4, 6425792684982722846, 36240867219537148, 36240728161530984, 2781, 0, 0, 0, #[]⟩, @@ -2908,11 +2927,13 @@ def branchClaims3And27Group05 : Array NodeClaim := ⟨6, [], [], [295, 343], []⟩]⟩] /-- Flat postorder claims for branch (3, 27). -/ +@[expose] def branchClaims3Row27 : BranchClaims := ⟨#[branchClaims3And27Group00, branchClaims3And27Group01, branchClaims3And27Group02, branchClaims3And27Group03, branchClaims3And27Group04, branchClaims3And27Group05], 345, 344⟩ /-- Coverage claims for branch (3, 28), group 00. -/ +@[expose] def branchClaims3And28Group00 : Array NodeClaim := #[⟨4, 5599100692663034142, 36240867219537134, 36240454084754532, 620, 0, 0, 0, #[]⟩, @@ -3099,6 +3120,7 @@ def branchClaims3And28Group00 : Array NodeClaim := 596, 8589934592, 0, 0, #[⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (3, 28), group 01. -/ +@[expose] def branchClaims3And28Group01 : Array NodeClaim := #[⟨2, 466135212318, 36240729780575462, 36099165763703936, 2959, 73760, 147520, 32, #[⟨1, [5], [734], [], []⟩, @@ -3301,6 +3323,7 @@ def branchClaims3And28Group01 : Array NodeClaim := ⟨5, [], [334], [], []⟩]⟩] /-- Coverage claims for branch (3, 28), group 02. -/ +@[expose] def branchClaims3And28Group02 : Array NodeClaim := #[⟨2, 456706416926, 36240729770097908, 36099440642119744, 2670, 67588, 0, 4, #[⟨0, [], [1280], [], []⟩, @@ -3497,6 +3520,7 @@ def branchClaims3And28Group02 : Array NodeClaim := 1850, 20480, 0, 0, #[⟨2, [], [], [189, 190], []⟩]⟩] /-- Coverage claims for branch (3, 28), group 03. -/ +@[expose] def branchClaims3And28Group03 : Array NodeClaim := #[⟨4, 6425792975197102366, 36240731919678716, 36240178937396328, 440, 16384, 0, 0, #[⟨2, [], [], [], [866]⟩]⟩, @@ -3670,6 +3694,7 @@ def branchClaims3And28Group03 : Array NodeClaim := 2568, 10240, 20480, 0, #[⟨2, [5, 5], [], [253, 254], []⟩]⟩] /-- Coverage claims for branch (3, 28), group 04. -/ +@[expose] def branchClaims3And28Group04 : Array NodeClaim := #[⟨2, 458065371422, 36240729776389344, 36239903251561472, 2587, 228352, 3221225472, 1024, #[⟨2, [], [145], [240, 243, 246, 249], []⟩, @@ -3858,6 +3883,7 @@ def branchClaims3And28Group04 : Array NodeClaim := 620, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (3, 28), group 05. -/ +@[expose] def branchClaims3And28Group05 : Array NodeClaim := #[⟨4, 5564479255713341726, 36240867219537148, 36240590722585704, 388, 0, 0, 0, #[]⟩, @@ -3927,6 +3953,7 @@ def branchClaims3And28Group05 : Array NodeClaim := ⟨6, [], [], [297, 339], []⟩]⟩] /-- Flat postorder claims for branch (3, 28). -/ +@[expose] def branchClaims3Row28 : BranchClaims := ⟨#[branchClaims3And28Group00, branchClaims3And28Group01, branchClaims3And28Group02, branchClaims3And28Group03, branchClaims3And28Group04, branchClaims3And28Group05], 341, 340⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData07.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData07.lean index 1325cc8d3f..7c54c2eeeb 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData07.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData07.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (3, 30), group 00. -/ +@[expose] def branchClaims3And30Group00 : Array NodeClaim := #[⟨3, 5980781035954692382, 36240319598623990, 211381915761762, 2305, 20480, 0, 20480, #[⟨2, [], [629, 842], [], []⟩]⟩, @@ -214,6 +215,7 @@ def branchClaims3And30Group00 : Array NodeClaim := ⟨2, [], [], [60, 62], []⟩]⟩] /-- Coverage claims for branch (3, 30), group 01. -/ +@[expose] def branchClaims3And30Group01 : Array NodeClaim := #[⟨4, 3714625592566014238, 36240319607012606, 211245022592234, 1536, 0, 0, 0, #[]⟩, @@ -383,6 +385,7 @@ def branchClaims3And30Group01 : Array NodeClaim := 176, 32, 0, 32, #[⟨1, [], [539], [], []⟩]⟩] /-- Coverage claims for branch (3, 30), group 02. -/ +@[expose] def branchClaims3And30Group02 : Array NodeClaim := #[⟨3, 3242592585104548126, 36240867219537132, 36240041496319008, 241, 16384, 0, 0, #[⟨2, [], [], [127], []⟩]⟩, @@ -557,6 +560,7 @@ def branchClaims3And30Group02 : Array NodeClaim := 617, 320, 0, 256, #[⟨1, [], [1145], [190], []⟩]⟩] /-- Coverage claims for branch (3, 30), group 03. -/ +@[expose] def branchClaims3And30Group03 : Array NodeClaim := #[⟨4, 5128193479892590878, 36240869366988014, 36240042583657570, 3096, 0, 0, 0, #[]⟩, @@ -650,11 +654,13 @@ def branchClaims3And30Group03 : Array NodeClaim := ⟨6, [], [], [198, 221], []⟩]⟩] /-- Flat postorder claims for branch (3, 30). -/ +@[expose] def branchClaims3Row30 : BranchClaims := ⟨#[branchClaims3And30Group00, branchClaims3And30Group01, branchClaims3And30Group02, branchClaims3And30Group03], 223, 222⟩ /-- Coverage claims for branch (3, 31), group 00. -/ +@[expose] def branchClaims3And31Group00 : Array NodeClaim := #[⟨3, 5980780761080979742, 36240869354405110, 211107037871202, 2305, 20480, 0, 20480, #[⟨2, [], [1071, 1257], [], []⟩]⟩, @@ -844,6 +850,7 @@ def branchClaims3And31Group00 : Array NodeClaim := 3107, 8192, 0, 0, #[⟨2, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (3, 31), group 01. -/ +@[expose] def branchClaims3And31Group01 : Array NodeClaim := #[⟨4, 8371348135233511710, 36240868293270782, 36240591259473056, 947, 32, 0, 32, #[⟨1, [], [536], [], []⟩]⟩, @@ -1034,6 +1041,7 @@ def branchClaims3And31Group01 : Array NodeClaim := ⟨6, [], [], [126], []⟩]⟩] /-- Coverage claims for branch (3, 31), group 02. -/ +@[expose] def branchClaims3And31Group02 : Array NodeClaim := #[⟨3, 5404319722273038622, 36240869354405102, 211243939953762, 2305, 20480, 0, 20480, #[⟨2, [], [1255, 1072], [], []⟩]⟩, @@ -1204,6 +1212,7 @@ def branchClaims3And31Group02 : Array NodeClaim := 3045, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (3, 31), group 03. -/ +@[expose] def branchClaims3And31Group03 : Array NodeClaim := #[⟨4, 3858740914528248094, 36240869362826492, 36240593400649892, 952, 0, 0, 0, #[]⟩, @@ -1369,11 +1378,13 @@ def branchClaims3And31Group03 : Array NodeClaim := ⟨6, [], [], [219, 243], []⟩]⟩] /-- Flat postorder claims for branch (3, 31). -/ +@[expose] def branchClaims3Row31 : BranchClaims := ⟨#[branchClaims3And31Group00, branchClaims3And31Group01, branchClaims3And31Group02, branchClaims3And31Group03], 245, 244⟩ /-- Coverage claims for branch (3, 32), group 00. -/ +@[expose] def branchClaims3And32Group00 : Array NodeClaim := #[⟨3, 5980780761083076894, 36240731915451638, 36099441983257698, 3141, 12884901888, 20480, 12884901888, #[⟨2, [5, 5], [], [], []⟩, @@ -1578,6 +1589,7 @@ def branchClaims3And32Group00 : Array NodeClaim := ⟨6, [], [], [61, 62], []⟩]⟩] /-- Coverage claims for branch (3, 32), group 01. -/ +@[expose] def branchClaims3And32Group01 : Array NodeClaim := #[⟨1, 2480464158, 36240731376491762, 36029347043217536, 2707, 3448841362, 6293541, 3423675538, #[⟨0, [5, 5], [196, 196], [], []⟩, @@ -1756,6 +1768,7 @@ def branchClaims3And32Group01 : Array NodeClaim := 1087, 256, 0, 256, #[⟨1, [], [558], [], []⟩]⟩] /-- Coverage claims for branch (3, 32), group 02. -/ +@[expose] def branchClaims3And32Group02 : Array NodeClaim := #[⟨3, 6124895951289639198, 36240731928067316, 36240179472641088, 2915, 2048, 4352, 0, #[⟨1, [5], [], [], []⟩, @@ -1935,6 +1948,7 @@ def branchClaims3And32Group02 : Array NodeClaim := 1098, 8192, 0, 8192, #[⟨2, [], [244], [], []⟩]⟩] /-- Coverage claims for branch (3, 32), group 03. -/ +@[expose] def branchClaims3And32Group03 : Array NodeClaim := #[⟨3, 3242592172793979166, 36240869358632172, 36240453278381088, 1097, 64, 0, 0, #[⟨1, [], [], [191], []⟩]⟩, @@ -2105,6 +2119,7 @@ def branchClaims3And32Group03 : Array NodeClaim := ⟨2, [5], [625], [], []⟩]⟩] /-- Coverage claims for branch (3, 32), group 04. -/ +@[expose] def branchClaims3And32Group04 : Array NodeClaim := #[⟨3, 3242592190007402782, 36240869362793708, 36240454890031136, 573, 8, 0, 8, #[⟨0, [], [1137], [], []⟩]⟩, @@ -2149,11 +2164,13 @@ def branchClaims3And32Group04 : Array NodeClaim := ⟨6, [], [], [242, 266], []⟩]⟩] /-- Flat postorder claims for branch (3, 32). -/ +@[expose] def branchClaims3Row32 : BranchClaims := ⟨#[branchClaims3And32Group00, branchClaims3And32Group01, branchClaims3And32Group02, branchClaims3And32Group03, branchClaims3And32Group04], 268, 267⟩ /-- Coverage claims for branch (5, 4), group 00. -/ +@[expose] def branchClaims5And4Group00 : Array NodeClaim := #[⟨4, 6460977327360928798, 36240319611206910, 140739370072306, 3187, 8589934592, 0, 0, #[⟨6, [], [], [], [264]⟩]⟩, @@ -2367,6 +2384,7 @@ def branchClaims5And4Group00 : Array NodeClaim := 3209, 262144, 131072, 0, #[⟨3, [5], [], [62], []⟩]⟩] /-- Coverage claims for branch (5, 4), group 01. -/ +@[expose] def branchClaims5And4Group01 : Array NodeClaim := #[⟨2, 870606662686, 36240594489113650, 138516371456, 3208, 520, 0, 512, #[⟨0, [], [], [63], []⟩, @@ -2530,10 +2548,12 @@ def branchClaims5And4Group01 : Array NodeClaim := ⟨6, [7], [16], [71, 85, 112], []⟩]⟩] /-- Flat postorder claims for branch (5, 4). -/ +@[expose] def branchClaims5Row4 : BranchClaims := ⟨#[branchClaims5And4Group00, branchClaims5And4Group01], 114, 113⟩ /-- Coverage claims for branch (5, 5), group 00. -/ +@[expose] def branchClaims5And5Group00 : Array NodeClaim := #[⟨4, 4157949204818521118, 36240867219537150, 140875748872434, 3239, 268435456, 0, 0, #[⟨5, [], [], [], [276]⟩]⟩, @@ -2758,6 +2778,7 @@ def branchClaims5And5Group00 : Array NodeClaim := 133, 131072, 0, 131072, #[⟨3, [], [126], [], []⟩]⟩] /-- Coverage claims for branch (5, 5), group 01. -/ +@[expose] def branchClaims5And5Group01 : Array NodeClaim := #[⟨3, 2810247141704035358, 36240729780583542, 36099440648942594, 3264, 262144, 17180590080, 0, #[⟨3, [7, 5, 3], [], [63], []⟩, @@ -2884,10 +2905,12 @@ def branchClaims5And5Group01 : Array NodeClaim := ⟨6, [7], [16], [51, 69, 92], []⟩]⟩] /-- Flat postorder claims for branch (5, 5). -/ +@[expose] def branchClaims5Row5 : BranchClaims := ⟨#[branchClaims5And5Group00, branchClaims5And5Group01], 94, 93⟩ /-- Coverage claims for branch (5, 6), group 00. -/ +@[expose] def branchClaims5And6Group00 : Array NodeClaim := #[⟨3, 6413126579715795998, 211932761619710, 70370088980722, 3186, 268435456, 0, 268435456, #[⟨5, [], [301], [], []⟩]⟩, @@ -3085,6 +3108,7 @@ def branchClaims5And6Group00 : Array NodeClaim := 3041, 65536, 0, 65536, #[⟨3, [], [468], [], []⟩]⟩] /-- Coverage claims for branch (5, 6), group 01. -/ +@[expose] def branchClaims5And6Group01 : Array NodeClaim := #[⟨3, 7133702543465737246, 36240731928067314, 70919042676738, 3304, 32768, 0, 0, #[⟨3, [], [], [63], []⟩]⟩, @@ -3189,10 +3213,12 @@ def branchClaims5And6Group01 : Array NodeClaim := ⟨6, [], [16, 16], [52, 73, 91], []⟩]⟩] /-- Flat postorder claims for branch (5, 6). -/ +@[expose] def branchClaims5Row6 : BranchClaims := ⟨#[branchClaims5And6Group00, branchClaims5And6Group01], 93, 92⟩ /-- Coverage claims for branch (5, 7), group 00. -/ +@[expose] def branchClaims5And7Group00 : Array NodeClaim := #[⟨2, 711142370334, 211657883712758, 70368746803362, 155, 147456, 0, 147456, #[⟨2, [], [379], [], []⟩, @@ -3431,6 +3457,7 @@ def branchClaims5And7Group00 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 7), group 01. -/ +@[expose] def branchClaims5And7Group01 : Array NodeClaim := #[⟨3, 4107283576656194590, 36240867219537018, 70369552167968, 255, 16384, 0, 16384, #[⟨2, [], [586], [], []⟩]⟩, @@ -3567,10 +3594,12 @@ def branchClaims5And7Group01 : Array NodeClaim := ⟨6, [], [], [85, 97], []⟩]⟩] /-- Flat postorder claims for branch (5, 7). -/ +@[expose] def branchClaims5Row7 : BranchClaims := ⟨#[branchClaims5And7Group00, branchClaims5And7Group01], 99, 98⟩ /-- Coverage claims for branch (5, 8), group 00. -/ +@[expose] def branchClaims5And8Group00 : Array NodeClaim := #[⟨3, 4107283707673668638, 36240317463723262, 810029298, 156, 8623489024, 0, 8623489024, #[⟨5, [], [134], [], []⟩, @@ -3798,6 +3827,7 @@ def branchClaims5And8Group00 : Array NodeClaim := 666, 131072, 0, 131072, #[⟨3, [], [353], [], []⟩]⟩] /-- Coverage claims for branch (5, 8), group 01. -/ +@[expose] def branchClaims5And8Group01 : Array NodeClaim := #[⟨2, 870614002718, 36240594489113762, 140738565801984, 3386, 525064, 536936576, 520, #[⟨0, [], [373], [], []⟩, @@ -3904,10 +3934,12 @@ def branchClaims5And8Group01 : Array NodeClaim := ⟨6, [], [16, 16], [65, 69, 87], []⟩]⟩] /-- Flat postorder claims for branch (5, 8). -/ +@[expose] def branchClaims5Row8 : BranchClaims := ⟨#[branchClaims5And8Group00, branchClaims5And8Group01], 89, 88⟩ /-- Coverage claims for branch (5, 9), group 00. -/ +@[expose] def branchClaims5And9Group00 : Array NodeClaim := #[⟨3, 6413126578913635358, 36240317463723262, 1344803058, 3186, 268435456, 0, 268435456, #[⟨5, [], [306], [], []⟩]⟩, @@ -4144,6 +4176,7 @@ def branchClaims5And9Group00 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 9), group 01. -/ +@[expose] def branchClaims5And9Group01 : Array NodeClaim := #[⟨2, 716534148126, 36240729780583618, 36028797035250688, 412, 852640, 18186633552, 262656, #[⟨0, [5], [], [], []⟩, @@ -4246,6 +4279,7 @@ def branchClaims5And9Group01 : Array NodeClaim := ⟨6, [], [16, 16], [41, 68, 84], []⟩]⟩] /-- Flat postorder claims for branch (5, 9). -/ +@[expose] def branchClaims5Row9 : BranchClaims := ⟨#[branchClaims5And9Group00, branchClaims5And9Group01], 86, 85⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData08.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData08.lean index 85daa7af7b..8dc9586e86 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData08.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData08.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (5, 10), group 00. -/ +@[expose] def branchClaims5And10Group00 : Array NodeClaim := #[⟨3, 6124896333514501150, 36240317463715070, 813170932, 3444, 536870912, 0, 536870912, #[⟨5, [], [1298], [], []⟩]⟩, @@ -239,6 +240,7 @@ def branchClaims5And10Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (5, 10), group 01. -/ +@[expose] def branchClaims5And10Group01 : Array NodeClaim := #[⟨2, 840508730398, 36240592333241594, 138244820992, 3464, 33604168, 4, 33587784, #[⟨0, [6], [160], [], []⟩, @@ -455,6 +457,7 @@ def branchClaims5And10Group01 : Array NodeClaim := ⟨4, [], [143], [], []⟩]⟩] /-- Coverage claims for branch (5, 10), group 02. -/ +@[expose] def branchClaims5And10Group02 : Array NodeClaim := #[⟨3, 2810247009028107294, 36240867211148542, 36099304010023970, 3486, 16384, 0, 16384, #[⟨2, [], [655], [], []⟩]⟩, @@ -563,10 +566,12 @@ def branchClaims5And10Group02 : Array NodeClaim := ⟨6, [7], [190, 190, 16], [157], []⟩]⟩] /-- Flat postorder claims for branch (5, 10). -/ +@[expose] def branchClaims5Row10 : BranchClaims := ⟨#[branchClaims5And10Group00, branchClaims5And10Group01, branchClaims5And10Group02], 159, 158⟩ /-- Coverage claims for branch (5, 11), group 00. -/ +@[expose] def branchClaims5And11Group00 : Array NodeClaim := #[⟨3, 8214566560616508446, 36240317463723262, 70644966904000, 3409, 268435456, 32, 268435456, #[⟨1, [7], [], [], []⟩, @@ -787,6 +792,7 @@ def branchClaims5And11Group00 : Array NodeClaim := ⟨3, [], [631], [62], []⟩]⟩] /-- Coverage claims for branch (5, 11), group 01. -/ +@[expose] def branchClaims5And11Group01 : Array NodeClaim := #[⟨4, 3866622595585109022, 36240869358632190, 140876810064120, 399, 0, 0, 0, #[]⟩, @@ -1010,6 +1016,7 @@ def branchClaims5And11Group01 : Array NodeClaim := ⟨6, [], [141], [], []⟩]⟩] /-- Coverage claims for branch (5, 11), group 02. -/ +@[expose] def branchClaims5And11Group02 : Array NodeClaim := #[⟨3, 3819053325561195550, 36240867211140350, 36099579425849424, 3558, 268435968, 262248, 268435968, #[⟨0, [5], [], [], []⟩, @@ -1112,10 +1119,12 @@ def branchClaims5And11Group02 : Array NodeClaim := ⟨6, [7], [190, 190, 16], [151], []⟩]⟩] /-- Flat postorder claims for branch (5, 11). -/ +@[expose] def branchClaims5Row11 : BranchClaims := ⟨#[branchClaims5And11Group00, branchClaims5And11Group01, branchClaims5And11Group02], 153, 152⟩ /-- Coverage claims for branch (5, 12), group 00. -/ +@[expose] def branchClaims5And12Group00 : Array NodeClaim := #[⟨4, 8190359180047641630, 212072348056830, 211109192142068, 485, 536870912, 0, 0, #[⟨5, [], [], [], [308]⟩]⟩, @@ -1312,6 +1321,7 @@ def branchClaims5And12Group00 : Array NodeClaim := ⟨2, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (5, 12), group 01. -/ +@[expose] def branchClaims5And12Group01 : Array NodeClaim := #[⟨4, 5991758563169102878, 36240731919678718, 211109187960050, 450, 8589934592, 0, 8589934592, #[⟨6, [], [300], [], []⟩]⟩, @@ -1529,6 +1539,7 @@ def branchClaims5And12Group01 : Array NodeClaim := 3617, 268435456, 0, 268435456, #[⟨5, [], [424], [], []⟩]⟩] /-- Coverage claims for branch (5, 12), group 02. -/ +@[expose] def branchClaims5And12Group02 : Array NodeClaim := #[⟨3, 8142508838488730654, 36240869367012604, 71193648959664, 3617, 268435456, 0, 268435456, #[⟨5, [], [1298], [], []⟩]⟩, @@ -1730,6 +1741,7 @@ def branchClaims5And12Group02 : Array NodeClaim := 3643, 512, 0, 512, #[⟨1, [], [161], [], []⟩]⟩] /-- Coverage claims for branch (5, 12), group 03. -/ +@[expose] def branchClaims5And12Group03 : Array NodeClaim := #[⟨3, 5116089910873910302, 36240869358632158, 211658945858560, 3641, 8320, 0, 0, #[⟨1, [], [], [190], []⟩, @@ -1774,11 +1786,13 @@ def branchClaims5And12Group03 : Array NodeClaim := ⟨6, [], [190, 190, 190, 16], [200], []⟩]⟩] /-- Flat postorder claims for branch (5, 12). -/ +@[expose] def branchClaims5Row12 : BranchClaims := ⟨#[branchClaims5And12Group00, branchClaims5And12Group01, branchClaims5And12Group02, branchClaims5And12Group03], 202, 201⟩ /-- Coverage claims for branch (5, 14), group 00. -/ +@[expose] def branchClaims5And14Group00 : Array NodeClaim := #[⟨3, 6413126707794504734, 36240319602810110, 1882718456, 3444, 536870912, 0, 536870912, #[⟨5, [], [1298], [], []⟩]⟩, @@ -1991,6 +2005,7 @@ def branchClaims5And14Group00 : Array NodeClaim := 1131, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 14), group 01. -/ +@[expose] def branchClaims5And14Group01 : Array NodeClaim := #[⟨3, 3674937621373086750, 36240044733267198, 1615337706, 71, 8589934592, 33554432, 0, #[⟨5, [4], [], [], []⟩, @@ -2219,6 +2234,7 @@ def branchClaims5And14Group01 : Array NodeClaim := 784, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 14), group 02. -/ +@[expose] def branchClaims5And14Group02 : Array NodeClaim := #[⟨3, 5404320527024745502, 36240731919678714, 36239904862652616, 3705, 8396800, 16777350, 8388608, #[⟨0, [5, 4], [], [], []⟩, @@ -2423,6 +2439,7 @@ def branchClaims5And14Group02 : Array NodeClaim := 3719, 8192, 16384, 0, #[⟨2, [5], [], [190], []⟩]⟩] /-- Coverage claims for branch (5, 14), group 03. -/ +@[expose] def branchClaims5And14Group03 : Array NodeClaim := #[⟨4, 7175642451865594910, 36240594489113854, 211659748079776, 784, 0, 0, 0, #[]⟩, @@ -2640,6 +2657,7 @@ def branchClaims5And14Group03 : Array NodeClaim := ⟨5, [], [], [254], []⟩]⟩] /-- Coverage claims for branch (5, 14), group 04. -/ +@[expose] def branchClaims5And14Group04 : Array NodeClaim := #[⟨4, 6451125419464289310, 212072348056830, 211108123641066, 778, 536870912, 0, 536870912, #[⟨5, [], [1107], [], []⟩]⟩, @@ -2852,6 +2870,7 @@ def branchClaims5And14Group04 : Array NodeClaim := ⟨5, [], [106], [], []⟩]⟩] /-- Coverage claims for branch (5, 14), group 05. -/ +@[expose] def branchClaims5And14Group05 : Array NodeClaim := #[⟨3, 6413126040916945950, 36240869358583038, 211382992110632, 290, 256, 16384, 256, #[⟨1, [], [465], [], []⟩, @@ -3011,11 +3030,13 @@ def branchClaims5And14Group05 : Array NodeClaim := ⟨6, [], [16, 16], [278, 313, 362], []⟩]⟩] /-- Flat postorder claims for branch (5, 14). -/ +@[expose] def branchClaims5Row14 : BranchClaims := ⟨#[branchClaims5And14Group00, branchClaims5And14Group01, branchClaims5And14Group02, branchClaims5And14Group03, branchClaims5And14Group04, branchClaims5And14Group05], 364, 363⟩ /-- Coverage claims for branch (5, 15), group 00. -/ +@[expose] def branchClaims5And15Group00 : Array NodeClaim := #[⟨3, 8214566421305846814, 36240319602818302, 70507260555424, 3371, 0, 0, 0, #[]⟩, @@ -3233,6 +3254,7 @@ def branchClaims5And15Group00 : Array NodeClaim := 333, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 15), group 01. -/ +@[expose] def branchClaims5And15Group01 : Array NodeClaim := #[⟨2, 732657445918, 36240457050143964, 3759671424, 3670, 570982912, 396, 33587200, #[⟨0, [6, 5], [], [], []⟩, @@ -3458,6 +3480,7 @@ def branchClaims5And15Group01 : Array NodeClaim := ⟨4, [], [105], [], []⟩]⟩] /-- Coverage claims for branch (5, 15), group 02. -/ +@[expose] def branchClaims5And15Group02 : Array NodeClaim := #[⟨2, 733127207966, 36240594480708856, 140741246978176, 3701, 9177711368, 8396934, 9177710848, #[⟨0, [6, 6], [], [126], []⟩, @@ -3682,6 +3705,7 @@ def branchClaims5And15Group02 : Array NodeClaim := ⟨3, [], [], [188, 190], []⟩]⟩] /-- Coverage claims for branch (5, 15), group 03. -/ +@[expose] def branchClaims5And15Group03 : Array NodeClaim := #[⟨4, 3866903658789170206, 36240869358632190, 36099169524971616, 919, 0, 0, 0, #[]⟩, @@ -3910,6 +3934,7 @@ def branchClaims5And15Group03 : Array NodeClaim := ⟨1, [], [], [254], []⟩]⟩] /-- Coverage claims for branch (5, 15), group 04. -/ +@[expose] def branchClaims5And15Group04 : Array NodeClaim := #[⟨3, 8214565908040477726, 36240869366988010, 70507797428232, 3865, 8, 0, 8, #[⟨0, [], [599], [], []⟩]⟩, @@ -4145,6 +4170,7 @@ def branchClaims5And15Group04 : Array NodeClaim := 6, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 15), group 05. -/ +@[expose] def branchClaims5And15Group05 : Array NodeClaim := #[⟨3, 3674937604916735006, 36240869358599422, 36099304280560706, 3232, 268730368, 147456, 268697600, #[⟨2, [5], [], [], []⟩, @@ -4313,6 +4339,7 @@ def branchClaims5And15Group05 : Array NodeClaim := ⟨6, [], [16, 16], [286, 312, 363], []⟩]⟩] /-- Flat postorder claims for branch (5, 15). -/ +@[expose] def branchClaims5Row15 : BranchClaims := ⟨#[branchClaims5And15Group00, branchClaims5And15Group01, branchClaims5And15Group02, branchClaims5And15Group03, branchClaims5And15Group04, branchClaims5And15Group05], 365, 364⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData09.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData09.lean index bc45162152..6dfc807a59 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData09.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData09.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (5, 16), group 00. -/ +@[expose] def branchClaims5And16Group00 : Array NodeClaim := #[⟨4, 5167881283550931998, 212072348048630, 211794239427830, 452, 268435456, 0, 268435456, #[⟨5, [], [302], [], []⟩]⟩, @@ -282,6 +283,7 @@ def branchClaims5And16Group00 : Array NodeClaim := 3916, 8589934592, 0, 8589934592, #[⟨6, [], [1356], [], []⟩]⟩] /-- Coverage claims for branch (5, 16), group 01. -/ +@[expose] def branchClaims5And16Group01 : Array NodeClaim := #[⟨3, 5404320135658957854, 212070200573182, 70507257437250, 3915, 294912, 147456, 32768, #[⟨2, [5], [], [], []⟩, @@ -497,6 +499,7 @@ def branchClaims5And16Group01 : Array NodeClaim := ⟨3, [1], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 16), group 02. -/ +@[expose] def branchClaims5And16Group02 : Array NodeClaim := #[⟨2, 849135889438, 36240867219479796, 70506199384128, 3938, 134217776, 0, 134217744, #[⟨0, [], [900], [], []⟩, @@ -643,10 +646,12 @@ def branchClaims5And16Group02 : Array NodeClaim := ⟨6, [], [], [142, 168], []⟩]⟩] /-- Flat postorder claims for branch (5, 16). -/ +@[expose] def branchClaims5Row16 : BranchClaims := ⟨#[branchClaims5And16Group00, branchClaims5And16Group01, branchClaims5And16Group02], 170, 169⟩ /-- Coverage claims for branch (5, 17), group 00. -/ +@[expose] def branchClaims5And17Group00 : Array NodeClaim := #[⟨4, 3145202237277563934, 36240867219537150, 140738040446194, 228, 17179869184, 0, 17179869184, #[⟨6, [], [680], [], []⟩]⟩, @@ -896,6 +901,7 @@ def branchClaims5And17Group00 : Array NodeClaim := 3977, 32, 0, 32, #[⟨1, [], [306], [], []⟩]⟩] /-- Coverage claims for branch (5, 17), group 01. -/ +@[expose] def branchClaims5And17Group01 : Array NodeClaim := #[⟨3, 8214566569228987422, 36240867219537140, 211243686704256, 3371, 0, 0, 0, #[]⟩, @@ -1118,6 +1124,7 @@ def branchClaims5And17Group01 : Array NodeClaim := ⟨5, [2], [], [126], []⟩]⟩] /-- Coverage claims for branch (5, 17), group 02. -/ +@[expose] def branchClaims5And17Group02 : Array NodeClaim := #[⟨2, 428736605214, 36240867211148530, 70918500536352, 256, 147456, 0, 16384, #[⟨2, [], [378], [], []⟩, @@ -1341,6 +1348,7 @@ def branchClaims5And17Group02 : Array NodeClaim := ⟨5, [0, 0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 17), group 03. -/ +@[expose] def branchClaims5And17Group03 : Array NodeClaim := #[⟨2, 841087020062, 36240867219528946, 36029346780545152, 4015, 18053137060, 134349136, 17516266116, #[⟨0, [5], [887], [], []⟩, @@ -1436,11 +1444,13 @@ def branchClaims5And17Group03 : Array NodeClaim := ⟨6, [], [16, 24, 16, 24], [218], []⟩]⟩] /-- Flat postorder claims for branch (5, 17). -/ +@[expose] def branchClaims5Row17 : BranchClaims := ⟨#[branchClaims5And17Group00, branchClaims5And17Group01, branchClaims5And17Group02, branchClaims5And17Group03], 220, 219⟩ /-- Coverage claims for branch (5, 18), group 00. -/ +@[expose] def branchClaims5And18Group00 : Array NodeClaim := #[⟨4, 5456111658098322462, 36240869366988030, 141426564798706, 166, 33554432, 0, 33554432, #[⟨5, [], [1118], [], []⟩]⟩, @@ -1681,6 +1691,7 @@ def branchClaims5And18Group00 : Array NodeClaim := ⟨5, [], [135], [], []⟩]⟩] /-- Coverage claims for branch (5, 18), group 01. -/ +@[expose] def branchClaims5And18Group01 : Array NodeClaim := #[⟨4, 8262135316309175326, 36240869367020794, 211382723706056, 626, 0, 0, 0, #[]⟩, @@ -1892,6 +1903,7 @@ def branchClaims5And18Group01 : Array NodeClaim := 208, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 18), group 02. -/ +@[expose] def branchClaims5And18Group02 : Array NodeClaim := #[⟨3, 5404320263440526366, 36240867219504382, 70644698470592, 4030, 17179869184, 65536, 17179869184, #[⟨3, [7], [], [], []⟩, @@ -2120,6 +2132,7 @@ def branchClaims5And18Group02 : Array NodeClaim := 562, 8, 0, 0, #[⟨0, [], [], [], [462]⟩]⟩] /-- Coverage claims for branch (5, 18), group 03. -/ +@[expose] def branchClaims5And18Group03 : Array NodeClaim := #[⟨3, 4107283186089815070, 36240867211148538, 36099167642732632, 4072, 8623521792, 562037260, 33587200, #[⟨0, [7, 5], [], [], []⟩, @@ -2337,11 +2350,13 @@ def branchClaims5And18Group03 : Array NodeClaim := ⟨6, [], [16, 29, 16, 29], [252], []⟩]⟩] /-- Flat postorder claims for branch (5, 18). -/ +@[expose] def branchClaims5Row18 : BranchClaims := ⟨#[branchClaims5And18Group00, branchClaims5And18Group01, branchClaims5And18Group02, branchClaims5And18Group03], 254, 253⟩ /-- Coverage claims for branch (5, 19), group 00. -/ +@[expose] def branchClaims5And19Group00 : Array NodeClaim := #[⟨4, 5446260038209465374, 36240592341630206, 211107318349042, 1327, 0, 0, 0, #[]⟩, @@ -2551,6 +2566,7 @@ def branchClaims5And19Group00 : Array NodeClaim := 1955, 536870912, 0, 536870912, #[⟨5, [], [719], [], []⟩]⟩] /-- Coverage claims for branch (5, 19), group 01. -/ +@[expose] def branchClaims5And19Group01 : Array NodeClaim := #[⟨3, 5404320268323744798, 36240454902676734, 211107318336704, 2548, 65664, 0, 0, #[⟨1, [], [], [62], []⟩, @@ -2736,6 +2752,7 @@ def branchClaims5And19Group01 : Array NodeClaim := ⟨3, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 19), group 02. -/ +@[expose] def branchClaims5And19Group02 : Array NodeClaim := #[⟨4, 3862118888928013342, 36240594489113852, 36239906212187312, 2073, 0, 0, 0, #[]⟩, @@ -2921,6 +2938,7 @@ def branchClaims5And19Group02 : Array NodeClaim := 219, 65536, 0, 65536, #[⟨3, [], [570], [], []⟩]⟩] /-- Coverage claims for branch (5, 19), group 03. -/ +@[expose] def branchClaims5And19Group03 : Array NodeClaim := #[⟨3, 2810246901161618462, 36240731919678694, 36239903791037472, 102, 147456, 0, 131072, #[⟨2, [], [], [191], []⟩, @@ -3097,6 +3115,7 @@ def branchClaims5And19Group03 : Array NodeClaim := ⟨5, [], [465], [254], []⟩]⟩] /-- Coverage claims for branch (5, 19), group 04. -/ +@[expose] def branchClaims5And19Group04 : Array NodeClaim := #[⟨2, 171075267614, 36240729780534502, 36099165771007008, 602, 201458000, 0, 201326608, #[⟨0, [], [144], [], []⟩, @@ -3228,11 +3247,13 @@ def branchClaims5And19Group04 : Array NodeClaim := ⟨6, [], [], [248, 296], []⟩]⟩] /-- Flat postorder claims for branch (5, 19). -/ +@[expose] def branchClaims5Row19 : BranchClaims := ⟨#[branchClaims5And19Group00, branchClaims5And19Group01, branchClaims5And19Group02, branchClaims5And19Group03, branchClaims5And19Group04], 298, 297⟩ /-- Coverage claims for branch (5, 24), group 00. -/ +@[expose] def branchClaims5And24Group00 : Array NodeClaim := #[⟨2, 581727579166, 211522592226550, 70369281608704, 4115, 147712, 8320, 147712, #[⟨1, [6], [377], [], []⟩, @@ -3462,6 +3483,7 @@ def branchClaims5And24Group00 : Array NodeClaim := ⟨6, [], [449], [], []⟩]⟩] /-- Coverage claims for branch (5, 24), group 01. -/ +@[expose] def branchClaims5And24Group01 : Array NodeClaim := #[⟨3, 3674938265819573278, 36240869358615794, 36239903788906736, 309, 0, 0, 0, #[]⟩, @@ -3651,6 +3673,7 @@ def branchClaims5And24Group01 : Array NodeClaim := ⟨3, [], [1148], [], []⟩]⟩] /-- Coverage claims for branch (5, 24), group 02. -/ +@[expose] def branchClaims5And24Group02 : Array NodeClaim := #[⟨4, 5995699448614382622, 36240319611206902, 36239903796288624, 2817, 0, 0, 0, #[]⟩, @@ -3839,6 +3862,7 @@ def branchClaims5And24Group02 : Array NodeClaim := 4155, 524288, 131072, 0, #[⟨3, [5], [], [190], []⟩]⟩] /-- Coverage claims for branch (5, 24), group 03. -/ +@[expose] def branchClaims5And24Group03 : Array NodeClaim := #[⟨3, 8142508709674380318, 36240869367004406, 70644173147136, 4156, 524416, 131072, 524416, #[⟨1, [], [157], [], []⟩, @@ -4014,6 +4038,7 @@ def branchClaims5And24Group03 : Array NodeClaim := ⟨6, [], [193, 193, 193], [213, 240], []⟩]⟩] /-- Flat postorder claims for branch (5, 24). -/ +@[expose] def branchClaims5Row24 : BranchClaims := ⟨#[branchClaims5And24Group00, branchClaims5And24Group01, branchClaims5And24Group02, branchClaims5And24Group03], 242, 241⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData10.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData10.lean index 5fb74f8e38..9b1e8f238d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData10.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData10.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (5, 25), group 00. -/ +@[expose] def branchClaims5And25Group00 : Array NodeClaim := #[⟨2, 581729676318, 36099582122843382, 70369818479616, 4175, 73856, 16640, 73856, #[⟨1, [5], [377], [], []⟩, @@ -259,6 +260,7 @@ def branchClaims5And25Group00 : Array NodeClaim := 1758, 16384, 0, 16384, #[⟨2, [], [223], [], []⟩]⟩] /-- Coverage claims for branch (5, 25), group 01. -/ +@[expose] def branchClaims5And25Group01 : Array NodeClaim := #[⟨3, 5980780476439882782, 36240182163864822, 36099166839528546, 2569, 17179869184, 147456, 0, #[⟨2, [5], [], [], []⟩, @@ -440,6 +442,7 @@ def branchClaims5And25Group01 : Array NodeClaim := 3473, 32768, 0, 32768, #[⟨3, [], [1049], [], []⟩]⟩] /-- Coverage claims for branch (5, 25), group 02. -/ +@[expose] def branchClaims5And25Group02 : Array NodeClaim := #[⟨3, 3819052912211553310, 36240594480725110, 70507260606496, 666, 131072, 0, 0, #[⟨3, [], [], [127], []⟩]⟩, @@ -620,6 +623,7 @@ def branchClaims5And25Group02 : Array NodeClaim := ⟨3, [5], [], [190], []⟩]⟩] /-- Coverage claims for branch (5, 25), group 03. -/ +@[expose] def branchClaims5And25Group03 : Array NodeClaim := #[⟨2, 969400806430, 36240594489105632, 36239904328910848, 2953, 65928, 0, 65544, #[⟨0, [], [433], [], []⟩, @@ -835,11 +839,13 @@ def branchClaims5And25Group03 : Array NodeClaim := ⟨6, [], [16, 16], [193, 211, 252], []⟩]⟩] /-- Flat postorder claims for branch (5, 25). -/ +@[expose] def branchClaims5Row25 : BranchClaims := ⟨#[branchClaims5And25Group00, branchClaims5And25Group01, branchClaims5And25Group02, branchClaims5And25Group03], 254, 253⟩ /-- Coverage claims for branch (5, 26), group 00. -/ +@[expose] def branchClaims5And26Group00 : Array NodeClaim := #[⟨3, 4107283709012634654, 36240317463723262, 70506993168544, 3371, 0, 0, 0, #[]⟩, @@ -1041,6 +1047,7 @@ def branchClaims5And26Group00 : Array NodeClaim := ⟨3, [], [], [61, 62], []⟩]⟩] /-- Coverage claims for branch (5, 26), group 01. -/ +@[expose] def branchClaims5And26Group01 : Array NodeClaim := #[⟨3, 5116090042757049374, 36240319611174126, 70369824756932, 3418, 17179869184, 268501024, 17179869184, #[⟨1, [4], [], [], []⟩, @@ -1248,6 +1255,7 @@ def branchClaims5And26Group01 : Array NodeClaim := ⟨3, [], [128], [], []⟩]⟩] /-- Coverage claims for branch (5, 26), group 02. -/ +@[expose] def branchClaims5And26Group02 : Array NodeClaim := #[⟨2, 853380590622, 36240867219537072, 70506187871232, 3992, 131104, 0, 131072, #[⟨1, [], [], [127], []⟩, @@ -1459,6 +1467,7 @@ def branchClaims5And26Group02 : Array NodeClaim := ⟨3, [], [381], [], []⟩]⟩] /-- Coverage claims for branch (5, 26), group 03. -/ +@[expose] def branchClaims5And26Group03 : Array NodeClaim := #[⟨1, 2792516638, 211520444759040, 70368746812416, 4248, 426560, 268435488, 0, #[⟨1, [7], [], [174, 180], []⟩, @@ -1645,6 +1654,7 @@ def branchClaims5And26Group03 : Array NodeClaim := ⟨3, [], [351], [], []⟩]⟩] /-- Coverage claims for branch (5, 26), group 04. -/ +@[expose] def branchClaims5And26Group04 : Array NodeClaim := #[⟨3, 5404320282258336798, 36240869366988010, 70645238487048, 3749, 557568, 33554444, 557568, #[⟨0, [7, 5], [], [], []⟩, @@ -1682,11 +1692,13 @@ def branchClaims5And26Group04 : Array NodeClaim := ⟨6, [], [], [238, 261], []⟩]⟩] /-- Flat postorder claims for branch (5, 26). -/ +@[expose] def branchClaims5Row26 : BranchClaims := ⟨#[branchClaims5And26Group00, branchClaims5And26Group01, branchClaims5And26Group02, branchClaims5And26Group03, branchClaims5And26Group04], 263, 262⟩ /-- Coverage claims for branch (5, 27), group 00. -/ +@[expose] def branchClaims5And27Group00 : Array NodeClaim := #[⟨3, 6413126579717827614, 212070200573182, 211107577344096, 1127, 16456, 0, 16456, #[⟨0, [], [820], [], []⟩, @@ -1899,6 +1911,7 @@ def branchClaims5And27Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (5, 27), group 01. -/ +@[expose] def branchClaims5And27Group01 : Array NodeClaim := #[⟨2, 838956379166, 36240867211148502, 5804096, 4274, 17448370212, 0, 17448304644, #[⟨0, [], [391], [], []⟩, @@ -2109,6 +2122,7 @@ def branchClaims5And27Group01 : Array NodeClaim := 309, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 27), group 02. -/ +@[expose] def branchClaims5And27Group02 : Array NodeClaim := #[⟨2, 866068360222, 36240594489097452, 140738564722816, 3840, 541192, 65568, 0, #[⟨0, [], [], [123], []⟩, @@ -2320,6 +2334,7 @@ def branchClaims5And27Group02 : Array NodeClaim := ⟨1, [], [], [190], []⟩]⟩] /-- Coverage claims for branch (5, 27), group 03. -/ +@[expose] def branchClaims5And27Group03 : Array NodeClaim := #[⟨4, 5158029675979762718, 212072348056830, 211793969943796, 159, 268435456, 0, 268435456, #[⟨5, [], [235], [], []⟩]⟩, @@ -2540,6 +2555,7 @@ def branchClaims5And27Group03 : Array NodeClaim := 3839, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 27), group 04. -/ +@[expose] def branchClaims5And27Group04 : Array NodeClaim := #[⟨3, 3819052809919294494, 36240592333241598, 211244748904544, 103, 131080, 0, 131072, #[⟨0, [], [], [255], []⟩, @@ -2718,6 +2734,7 @@ def branchClaims5And27Group04 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 27), group 05. -/ +@[expose] def branchClaims5And27Group05 : Array NodeClaim := #[⟨4, 7148620850142538782, 36240594489113854, 36099304283763808, 4301, 131072, 0, 131072, #[⟨3, [], [87], [], []⟩]⟩, @@ -2901,6 +2918,7 @@ def branchClaims5And27Group05 : Array NodeClaim := 3041, 65536, 0, 0, #[⟨3, [], [], [], [379]⟩]⟩] /-- Coverage claims for branch (5, 27), group 06. -/ +@[expose] def branchClaims5And27Group06 : Array NodeClaim := #[⟨3, 3098477513567005726, 36240867219520746, 36240453549963296, 698, 8, 0, 0, #[⟨0, [], [], [383], []⟩]⟩, @@ -2936,12 +2954,14 @@ def branchClaims5And27Group06 : Array NodeClaim := ⟨6, [], [16, 24, 16, 24], [390], []⟩]⟩] /-- Flat postorder claims for branch (5, 27). -/ +@[expose] def branchClaims5Row27 : BranchClaims := ⟨#[branchClaims5And27Group00, branchClaims5And27Group01, branchClaims5And27Group02, branchClaims5And27Group03, branchClaims5And27Group04, branchClaims5And27Group05, branchClaims5And27Group06], 392, 391⟩ /-- Coverage claims for branch (5, 28), group 00. -/ +@[expose] def branchClaims5And28Group00 : Array NodeClaim := #[⟨3, 6413126579719924766, 36240729780583678, 70644966903904, 3335, 268435456, 16456, 268435456, #[⟨0, [5], [], [], []⟩, @@ -3169,6 +3189,7 @@ def branchClaims5And28Group00 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 28), group 01. -/ +@[expose] def branchClaims5And28Group01 : Array NodeClaim := #[⟨3, 4107283574566317086, 36240867219537020, 275691115536, 3479, 0, 0, 0, #[]⟩, @@ -3371,6 +3392,7 @@ def branchClaims5And28Group01 : Array NodeClaim := 4333, 0, 131072, 0, #[⟨3, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 28), group 02. -/ +@[expose] def branchClaims5And28Group02 : Array NodeClaim := #[⟨4, 8189233160422321182, 36240867219537150, 36099441193172064, 4339, 131072, 0, 131072, #[⟨3, [], [1346], [], []⟩]⟩, @@ -3591,6 +3613,7 @@ def branchClaims5And28Group02 : Array NodeClaim := 477, 262144, 0, 262144, #[⟨3, [], [1003], [], []⟩]⟩] /-- Coverage claims for branch (5, 28), group 03. -/ +@[expose] def branchClaims5And28Group03 : Array NodeClaim := #[⟨3, 6124895680890825758, 36240867211148542, 825176365104, 198, 33554432, 8, 0, #[⟨0, [5], [], [], []⟩, @@ -3798,6 +3821,7 @@ def branchClaims5And28Group03 : Array NodeClaim := 3547, 32768, 0, 32768, #[⟨3, [], [467], [], []⟩]⟩] /-- Coverage claims for branch (5, 28), group 04. -/ +@[expose] def branchClaims5And28Group04 : Array NodeClaim := #[⟨3, 8142508313768258590, 36240867219537018, 70644161625120, 3931, 147456, 0, 16384, #[⟨2, [], [450], [], []⟩, @@ -3988,6 +4012,7 @@ def branchClaims5And28Group04 : Array NodeClaim := ⟨1, [], [149], [], []⟩]⟩] /-- Coverage claims for branch (5, 28), group 05. -/ +@[expose] def branchClaims5And28Group05 : Array NodeClaim := #[⟨3, 7133702676076981278, 36240869367020778, 36099716596387904, 4354, 328224, 268435528, 328224, #[⟨0, [5], [], [], []⟩, @@ -4041,6 +4066,7 @@ def branchClaims5And28Group05 : Array NodeClaim := ⟨6, [], [16, 29, 16, 29], [332], []⟩]⟩] /-- Flat postorder claims for branch (5, 28). -/ +@[expose] def branchClaims5Row28 : BranchClaims := ⟨#[branchClaims5And28Group00, branchClaims5And28Group01, branchClaims5And28Group02, branchClaims5And28Group03, branchClaims5And28Group04, branchClaims5And28Group05], 334, 333⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData11.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData11.lean index c22453c244..0169ee5e97 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData11.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData11.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (5, 29), group 00. -/ +@[expose] def branchClaims5And29Group00 : Array NodeClaim := #[⟨4, 5447385933821406238, 36240594489113854, 211107577362618, 4356, 8589934592, 0, 8589934592, #[⟨6, [], [1262], [], []⟩]⟩, @@ -261,6 +262,7 @@ def branchClaims5And29Group00 : Array NodeClaim := ⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (5, 29), group 01. -/ +@[expose] def branchClaims5And29Group01 : Array NodeClaim := #[⟨2, 324637191198, 36240454902676702, 70369819510784, 3358, 65668, 0, 65540, #[⟨0, [], [391], [], []⟩, @@ -499,6 +501,7 @@ def branchClaims5And29Group01 : Array NodeClaim := ⟨5, [], [144], [], []⟩]⟩] /-- Coverage claims for branch (5, 29), group 02. -/ +@[expose] def branchClaims5And29Group02 : Array NodeClaim := #[⟨3, 3098476851557985310, 36240592333241598, 211106774150178, 4005, 147456, 0, 147456, #[⟨2, [], [128], [], []⟩, @@ -738,6 +741,7 @@ def branchClaims5And29Group02 : Array NodeClaim := 3207, 131072, 0, 131072, #[⟨3, [], [286], [], []⟩]⟩] /-- Coverage claims for branch (5, 29), group 03. -/ +@[expose] def branchClaims5And29Group03 : Array NodeClaim := #[⟨4, 4145282307175115806, 36240592341630206, 211245562645514, 262, 524288, 0, 524288, #[⟨3, [], [420], [], []⟩]⟩, @@ -923,11 +927,13 @@ def branchClaims5And29Group03 : Array NodeClaim := ⟨6, [], [], [211, 247], []⟩]⟩] /-- Flat postorder claims for branch (5, 29). -/ +@[expose] def branchClaims5Row29 : BranchClaims := ⟨#[branchClaims5And29Group00, branchClaims5And29Group01, branchClaims5And29Group02, branchClaims5And29Group03], 249, 248⟩ /-- Coverage claims for branch (5, 31), group 00. -/ +@[expose] def branchClaims5And31Group00 : Array NodeClaim := #[⟨4, 5162533412006292510, 36240594489081086, 140878960661734, 3104, 0, 0, 0, #[]⟩, @@ -1136,6 +1142,7 @@ def branchClaims5And31Group00 : Array NodeClaim := ⟨6, [], [898], [], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 01. -/ +@[expose] def branchClaims5And31Group01 : Array NodeClaim := #[⟨4, 5995699332063980574, 36240869367020790, 140875740533810, 3361, 262144, 0, 262144, #[⟨3, [], [939], [], []⟩]⟩, @@ -1341,6 +1348,7 @@ def branchClaims5And31Group01 : Array NodeClaim := 4412, 536870912, 0, 536870912, #[⟨5, [], [140], [], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 02. -/ +@[expose] def branchClaims5And31Group02 : Array NodeClaim := #[⟨3, 3819053324846001182, 36240594489105654, 36028935271088324, 4424, 0, 0, 0, #[]⟩, @@ -1547,6 +1555,7 @@ def branchClaims5And31Group02 : Array NodeClaim := ⟨1, [], [], [190], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 03. -/ +@[expose] def branchClaims5And31Group03 : Array NodeClaim := #[⟨4, 8261009417122114590, 36240869366988030, 212070186899648, 621, 0, 0, 0, #[]⟩, @@ -1756,6 +1765,7 @@ def branchClaims5And31Group03 : Array NodeClaim := 4387, 16384, 0, 16384, #[⟨2, [], [284], [], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 04. -/ +@[expose] def branchClaims5And31Group04 : Array NodeClaim := #[⟨3, 3819052792739818526, 36240594480684278, 211244484658276, 798, 320, 0, 320, #[⟨1, [], [619, 282], [], []⟩]⟩, @@ -1931,6 +1941,7 @@ def branchClaims5And31Group04 : Array NodeClaim := ⟨2, [1], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 05. -/ +@[expose] def branchClaims5And31Group05 : Array NodeClaim := #[⟨2, 866085530654, 36240594489097416, 140741517509632, 4456, 541440, 536871040, 16384, #[⟨1, [6], [], [316, 318], []⟩, @@ -2124,6 +2135,7 @@ def branchClaims5And31Group05 : Array NodeClaim := 935, 64, 0, 0, #[⟨1, [], [], [382], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 06. -/ +@[expose] def branchClaims5And31Group06 : Array NodeClaim := #[⟨2, 171039026206, 36240869358631974, 550563746816, 3477, 541248, 0, 576, #[⟨1, [], [441, 148], [], []⟩, @@ -2314,6 +2326,7 @@ def branchClaims5And31Group06 : Array NodeClaim := 3553, 8192, 16384, 0, #[⟨2, [5], [], [446], []⟩]⟩] /-- Coverage claims for branch (5, 31), group 07. -/ +@[expose] def branchClaims5And31Group07 : Array NodeClaim := #[⟨2, 600804191262, 36240594480725130, 211109185882112, 3593, 16648, 25174150, 16640, #[⟨0, [6, 6], [], [447], []⟩, @@ -2439,12 +2452,14 @@ def branchClaims5And31Group07 : Array NodeClaim := ⟨6, [], [16, 24, 16, 24], [484], []⟩]⟩] /-- Flat postorder claims for branch (5, 31). -/ +@[expose] def branchClaims5Row31 : BranchClaims := ⟨#[branchClaims5And31Group00, branchClaims5And31Group01, branchClaims5And31Group02, branchClaims5And31Group03, branchClaims5And31Group04, branchClaims5And31Group05, branchClaims5And31Group06, branchClaims5And31Group07], 486, 485⟩ /-- Coverage claims for branch (5, 32), group 00. -/ +@[expose] def branchClaims5And32Group00 : Array NodeClaim := #[⟨4, 5166755399220096030, 36240869366988030, 141428717524002, 3215, 0, 0, 0, #[]⟩, @@ -2659,6 +2674,7 @@ def branchClaims5And32Group00 : Array NodeClaim := 338, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 32), group 01. -/ +@[expose] def branchClaims5And32Group01 : Array NodeClaim := #[⟨2, 853152394270, 36240731928067234, 36028798365893632, 4513, 533152, 536871168, 524960, #[⟨1, [5], [374, 147, 147], [], []⟩, @@ -2893,6 +2909,7 @@ def branchClaims5And32Group01 : Array NodeClaim := 332, 805306368, 0, 805306368, #[⟨5, [], [335, 136], [], []⟩]⟩] /-- Coverage claims for branch (5, 32), group 02. -/ +@[expose] def branchClaims5And32Group02 : Array NodeClaim := #[⟨3, 8142508829684821022, 36240869367004406, 36099441987944672, 4532, 847249408, 8606711810, 847249408, #[⟨0, [5], [], [], []⟩, @@ -3120,6 +3137,7 @@ def branchClaims5And32Group02 : Array NodeClaim := 142, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (5, 32), group 03. -/ +@[expose] def branchClaims5And32Group03 : Array NodeClaim := #[⟨3, 8214566560826158110, 36240869358632178, 36100129178538112, 3609, 4, 301989920, 0, #[⟨0, [], [], [191], []⟩, @@ -3313,6 +3331,7 @@ def branchClaims5And32Group03 : Array NodeClaim := ⟨2, [], [], [254], []⟩]⟩] /-- Coverage claims for branch (5, 32), group 04. -/ +@[expose] def branchClaims5And32Group04 : Array NodeClaim := #[⟨4, 5991758563173231646, 36240731919678710, 36240182158572642, 3167, 16384, 0, 0, #[⟨2, [], [], [], [515]⟩]⟩, @@ -3529,6 +3548,7 @@ def branchClaims5And32Group04 : Array NodeClaim := ⟨2, [], [347], [], []⟩]⟩] /-- Coverage claims for branch (5, 32), group 05. -/ +@[expose] def branchClaims5And32Group05 : Array NodeClaim := #[⟨2, 710596389918, 36240869366987940, 70644966887424, 4563, 40, 0, 0, #[⟨0, [], [], [318], []⟩, @@ -3728,6 +3748,7 @@ def branchClaims5And32Group05 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 32), group 06. -/ +@[expose] def branchClaims5And32Group06 : Array NodeClaim := #[⟨4, 6030601547335363614, 36240869358632182, 36240729230046258, 3140, 0, 0, 0, #[]⟩, @@ -3912,6 +3933,7 @@ def branchClaims5And32Group06 : Array NodeClaim := ⟨6, [], [16, 29, 16, 29], [440], []⟩]⟩] /-- Flat postorder claims for branch (5, 32). -/ +@[expose] def branchClaims5Row32 : BranchClaims := ⟨#[branchClaims5And32Group00, branchClaims5And32Group01, branchClaims5And32Group02, branchClaims5And32Group03, branchClaims5And32Group04, branchClaims5And32Group05, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData12.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData12.lean index f2b3ef3343..27081bfe6a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData12.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData12.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (5, 34), group 00. -/ +@[expose] def branchClaims5And34Group00 : Array NodeClaim := #[⟨4, 5159155557670611998, 36240869366988030, 211793702556854, 3226, 268435456, 0, 268435456, #[⟨5, [], [1133], [], []⟩]⟩, @@ -231,6 +232,7 @@ def branchClaims5And34Group00 : Array NodeClaim := ⟨5, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (5, 34), group 01. -/ +@[expose] def branchClaims5And34Group01 : Array NodeClaim := #[⟨4, 3831156773779172382, 36240869358615806, 36099854572198074, 1062, 0, 0, 0, #[]⟩, @@ -461,6 +463,7 @@ def branchClaims5And34Group01 : Array NodeClaim := ⟨5, [], [144], [], []⟩]⟩] /-- Coverage claims for branch (5, 34), group 02. -/ +@[expose] def branchClaims5And34Group02 : Array NodeClaim := #[⟨3, 5116090040886258718, 36240869358591230, 36099304283702340, 3888, 268435968, 134611312, 268435968, #[⟨0, [5], [], [], []⟩, @@ -681,6 +684,7 @@ def branchClaims5And34Group02 : Array NodeClaim := ⟨5, [6], [144], [], []⟩]⟩] /-- Coverage claims for branch (5, 34), group 03. -/ +@[expose] def branchClaims5And34Group03 : Array NodeClaim := #[⟨4, 2858097753554185246, 36240869367020790, 36240453547895942, 4593, 65536, 0, 65536, #[⟨3, [], [309], [], []⟩]⟩, @@ -892,6 +896,7 @@ def branchClaims5And34Group03 : Array NodeClaim := ⟨3, [5], [], [254], []⟩]⟩] /-- Coverage claims for branch (5, 34), group 04. -/ +@[expose] def branchClaims5And34Group04 : Array NodeClaim := #[⟨4, 3714063170884627486, 36240869367020734, 36240040705694882, 4620, 65536, 0, 0, #[⟨3, [], [], [], [583]⟩]⟩, @@ -1119,6 +1124,7 @@ def branchClaims5And34Group04 : Array NodeClaim := ⟨4, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (5, 34), group 05. -/ +@[expose] def branchClaims5And34Group05 : Array NodeClaim := #[⟨1, 3320867870, 36240867219479748, 36099165767860224, 4109, 151142778, 0, 16392, #[⟨0, [], [49], [276, 281], []⟩, @@ -1316,6 +1322,7 @@ def branchClaims5And34Group05 : Array NodeClaim := 2694, 32, 0, 32, #[⟨1, [], [234], [], []⟩]⟩] /-- Coverage claims for branch (5, 34), group 06. -/ +@[expose] def branchClaims5And34Group06 : Array NodeClaim := #[⟨3, 3674938025121442846, 36240869367020730, 36240041232045088, 1174, 147520, 0, 131136, #[⟨1, [], [125], [], []⟩, @@ -1349,12 +1356,14 @@ def branchClaims5And34Group06 : Array NodeClaim := ⟨6, [], [24, 29], [], []⟩]⟩] /-- Flat postorder claims for branch (5, 34). -/ +@[expose] def branchClaims5Row34 : BranchClaims := ⟨#[branchClaims5And34Group00, branchClaims5And34Group01, branchClaims5And34Group02, branchClaims5And34Group03, branchClaims5And34Group04, branchClaims5And34Group05, branchClaims5And34Group06], 390, 389⟩ /-- Coverage claims for branch (6, 1), group 00. -/ +@[expose] def branchClaims6And1Group00 : Array NodeClaim := #[⟨4, 5600226975045903390, 36240594489113854, 36169672759445614, 3096, 0, 0, 0, #[]⟩, @@ -1593,6 +1602,7 @@ def branchClaims6And1Group00 : Array NodeClaim := ⟨6, [], [45, 56], [], []⟩]⟩] /-- Coverage claims for branch (6, 1), group 01. -/ +@[expose] def branchClaims6And1Group01 : Array NodeClaim := #[⟨0, 2876446, 36239904073071658, 2048, 369, 34359738367, 0, 33889510399, #[⟨0, [], [7, 8, 181, 181, 8], [], []⟩, @@ -1604,10 +1614,12 @@ def branchClaims6And1Group01 : Array NodeClaim := ⟨6, [], [16, 23, 28, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 1). -/ +@[expose] def branchClaims6Row1 : BranchClaims := ⟨#[branchClaims6And1Group00, branchClaims6And1Group01], 65, 64⟩ /-- Coverage claims for branch (6, 2), group 00. -/ +@[expose] def branchClaims6And2Group00 : Array NodeClaim := #[⟨3, 8646911985525187614, 36240317463723262, 211245016811554, 1703, 4096, 0, 4096, #[⟨2, [], [629], [], []⟩]⟩, @@ -1820,10 +1832,12 @@ def branchClaims6And2Group00 : Array NodeClaim := ⟨6, [], [16, 23, 28, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 2). -/ +@[expose] def branchClaims6Row2 : BranchClaims := ⟨#[branchClaims6And2Group00], 52, 51⟩ /-- Coverage claims for branch (6, 3), group 00. -/ +@[expose] def branchClaims6And3Group00 : Array NodeClaim := #[⟨3, 6413126295475708958, 36240319074335998, 70369015761018, 4639, 536870912, 0, 536870912, #[⟨5, [], [318], [], []⟩]⟩, @@ -2000,10 +2014,12 @@ def branchClaims6And3Group00 : Array NodeClaim := ⟨6, [], [16, 23, 28, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 3). -/ +@[expose] def branchClaims6Row3 : BranchClaims := ⟨#[branchClaims6And3Group00], 42, 41⟩ /-- Coverage claims for branch (6, 4), group 00. -/ +@[expose] def branchClaims6And4Group00 : Array NodeClaim := #[⟨4, 6176687085487121438, 36240868293278974, 36169672759447670, 12, 0, 0, 0, #[]⟩, @@ -2181,10 +2197,12 @@ def branchClaims6And4Group00 : Array NodeClaim := ⟨6, [], [16, 23, 28, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 4). -/ +@[expose] def branchClaims6Row4 : BranchClaims := ⟨#[branchClaims6And4Group00], 51, 50⟩ /-- Coverage claims for branch (6, 5), group 00. -/ +@[expose] def branchClaims6And5Group00 : Array NodeClaim := #[⟨3, 8646911480565064734, 36240317463723262, 211381918371874, 78, 16384, 0, 16384, #[⟨2, [], [654], [], []⟩]⟩, @@ -2333,10 +2351,12 @@ def branchClaims6And5Group00 : Array NodeClaim := ⟨6, [], [16, 23, 28, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 5). -/ +@[expose] def branchClaims6Row5 : BranchClaims := ⟨#[branchClaims6And5Group00], 40, 39⟩ /-- Coverage claims for branch (6, 6), group 00. -/ +@[expose] def branchClaims6And6Group00 : Array NodeClaim := #[⟨3, 6413126064319751198, 36240729780583678, 70369015238778, 13, 268435456, 0, 268435456, #[⟨5, [], [308], [], []⟩]⟩, @@ -2459,10 +2479,12 @@ def branchClaims6And6Group00 : Array NodeClaim := ⟨6, [], [16, 23, 28, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 6). -/ +@[expose] def branchClaims6Row6 : BranchClaims := ⟨#[branchClaims6And6Group00], 35, 34⟩ /-- Coverage claims for branch (6, 7), group 00. -/ +@[expose] def branchClaims6And7Group00 : Array NodeClaim := #[⟨4, 6176687084684960798, 36240868293278974, 211656801521782, 149, 268435456, 0, 268435456, #[⟨5, [], [355], [], []⟩]⟩, @@ -2740,6 +2762,7 @@ def branchClaims6And7Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (6, 7), group 01. -/ +@[expose] def branchClaims6And7Group01 : Array NodeClaim := #[⟨3, 3819052817715553310, 36240591804759166, 211243679363172, 243, 131136, 0, 131136, #[⟨1, [], [579], [], []⟩, @@ -2893,10 +2916,12 @@ def branchClaims6And7Group01 : Array NodeClaim := ⟨6, [], [23, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 7). -/ +@[expose] def branchClaims6Row7 : BranchClaims := ⟨#[branchClaims6And7Group00, branchClaims6And7Group01], 103, 102⟩ /-- Coverage claims for branch (6, 8), group 00. -/ +@[expose] def branchClaims6And8Group00 : Array NodeClaim := #[⟨4, 8688851250758018078, 36240867219537150, 211381927809206, 72, 268435456, 0, 268435456, #[⟨5, [], [250], [], []⟩]⟩, @@ -3149,6 +3174,7 @@ def branchClaims6And8Group00 : Array NodeClaim := ⟨6, [], [63], [], []⟩]⟩] /-- Coverage claims for branch (6, 8), group 01. -/ +@[expose] def branchClaims6And8Group01 : Array NodeClaim := #[⟨2, 325639726110, 36240729243712762, 36169534507321538, 4678, 31717402624, 2164261888, 31717402624, #[⟨2, [5], [385, 385], [], []⟩, @@ -3366,10 +3392,12 @@ def branchClaims6And8Group01 : Array NodeClaim := ⟨6, [], [16, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 8). -/ +@[expose] def branchClaims6Row8 : BranchClaims := ⟨#[branchClaims6And8Group00, branchClaims6And8Group01], 121, 120⟩ /-- Coverage claims for branch (6, 9), group 00. -/ +@[expose] def branchClaims6And9Group00 : Array NodeClaim := #[⟨3, 6413126063517590558, 36240317463723262, 36028797290025082, 13, 268435456, 0, 268435456, #[⟨5, [], [327], [], []⟩]⟩, @@ -3636,6 +3664,7 @@ def branchClaims6And9Group00 : Array NodeClaim := ⟨3, [], [285], [], []⟩]⟩] /-- Coverage claims for branch (6, 9), group 01. -/ +@[expose] def branchClaims6And9Group01 : Array NodeClaim := #[⟨2, 732053103646, 36240318537465074, 36239903251531840, 1397, 3246468230, 0, 3246466182, #[⟨0, [], [895, 373], [], []⟩, @@ -3867,10 +3896,12 @@ def branchClaims6And9Group01 : Array NodeClaim := ⟨6, [], [16, 23], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 9). -/ +@[expose] def branchClaims6Row9 : BranchClaims := ⟨#[branchClaims6And9Group00, branchClaims6And9Group01], 115, 114⟩ /-- Coverage claims for branch (6, 10), group 00. -/ +@[expose] def branchClaims6And10Group00 : Array NodeClaim := #[⟨3, 5548435579097179166, 36240042585816318, 36028797294216302, 4851, 536870912, 268435456, 536870912, #[⟨5, [4], [346], [], []⟩]⟩, @@ -4088,6 +4119,7 @@ def branchClaims6And10Group00 : Array NodeClaim := ⟨4, [], [143], [], []⟩]⟩] /-- Coverage claims for branch (6, 10), group 01. -/ +@[expose] def branchClaims6And10Group01 : Array NodeClaim := #[⟨3, 5548435474340242462, 36240044733299966, 36169535317379144, 448, 8396928, 16390, 8396928, #[⟨0, [5, 4], [], [], []⟩, @@ -4313,6 +4345,7 @@ def branchClaims6And10Group01 : Array NodeClaim := ⟨5, [], [338], [], []⟩]⟩] /-- Coverage claims for branch (6, 10), group 02. -/ +@[expose] def branchClaims6And10Group02 : Array NodeClaim := #[⟨2, 171030733854, 36240866145795134, 36028797289501728, 4888, 268456000, 0, 268435520, #[⟨1, [], [442], [], []⟩, @@ -4430,10 +4463,12 @@ def branchClaims6And10Group02 : Array NodeClaim := ⟨6, [], [190, 190, 190, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 10). -/ +@[expose] def branchClaims6Row10 : BranchClaims := ⟨#[branchClaims6And10Group00, branchClaims6And10Group01, branchClaims6And10Group02], 158, 157⟩ /-- Coverage claims for branch (6, 11), group 00. -/ +@[expose] def branchClaims6And11Group00 : Array NodeClaim := #[⟨3, 7638105806199186462, 36240180024769790, 36099167107443778, 4897, 524288, 282624, 524288, #[⟨2, [4, 5], [], [], []⟩, @@ -4669,6 +4704,7 @@ def branchClaims6And11Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (6, 11), group 01. -/ +@[expose] def branchClaims6And11Group01 : Array NodeClaim := #[⟨4, 3292413384323621918, 36240867219537150, 211518828844220, 500, 268435456, 0, 268435456, #[⟨5, [], [355], [], []⟩]⟩, @@ -4897,6 +4933,7 @@ def branchClaims6And11Group01 : Array NodeClaim := ⟨3, [], [], [125, 126], []⟩]⟩] /-- Coverage claims for branch (6, 11), group 02. -/ +@[expose] def branchClaims6And11Group02 : Array NodeClaim := #[⟨4, 3288472611706233886, 36240729780583678, 36240180011137064, 745, 16384, 0, 0, #[⟨2, [], [], [], [903]⟩]⟩, @@ -4952,6 +4989,7 @@ def branchClaims6And11Group02 : Array NodeClaim := ⟨6, [], [190, 190, 190, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 11). -/ +@[expose] def branchClaims6Row11 : BranchClaims := ⟨#[branchClaims6And11Group00, branchClaims6And11Group01, branchClaims6And11Group02], 142, 141⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData13.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData13.lean index 80bb1e7543..273d0df2a3 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData13.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData13.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (6, 12), group 00. -/ +@[expose] def branchClaims6And12Group00 : Array NodeClaim := #[⟨3, 7566048212165452830, 36240457050160382, 36099166033675498, 4939, 536870912, 268435456, 536870912, #[⟨5, [4], [346], [], []⟩]⟩, @@ -240,6 +241,7 @@ def branchClaims6And12Group00 : Array NodeClaim := ⟨6, [], [137, 137], [], []⟩]⟩] /-- Coverage claims for branch (6, 12), group 01. -/ +@[expose] def branchClaims6And12Group01 : Array NodeClaim := #[⟨2, 306865366046, 36240867756375262, 70369016828928, 2447, 10272, 0, 10240, #[⟨1, [], [], [63], []⟩, @@ -451,10 +453,12 @@ def branchClaims6And12Group01 : Array NodeClaim := ⟨6, [], [190, 190, 190, 16, 30], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 12). -/ +@[expose] def branchClaims6Row12 : BranchClaims := ⟨#[branchClaims6And12Group00, branchClaims6And12Group01], 125, 124⟩ /-- Coverage claims for branch (6, 13), group 00. -/ +@[expose] def branchClaims6And13Group00 : Array NodeClaim := #[⟨2, 838179873822, 36239905146862830, 36099165765239906, 4979, 2348811264, 0, 2348811264, #[⟨2, [], [145], [], []⟩, @@ -705,6 +709,7 @@ def branchClaims6And13Group00 : Array NodeClaim := ⟨6, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (6, 13), group 01. -/ +@[expose] def branchClaims6And13Group01 : Array NodeClaim := #[⟨2, 869016396830, 36240182172245116, 36099166842128448, 1365, 67716, 0, 67712, #[⟨0, [], [], [63], []⟩, @@ -983,6 +988,7 @@ def branchClaims6And13Group01 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (6, 13), group 02. -/ +@[expose] def branchClaims6And13Group02 : Array NodeClaim := #[⟨3, 3819053217684775966, 36240869367020668, 36239903791552544, 4819, 135168, 0, 135168, #[⟨2, [], [1140], [], []⟩, @@ -1014,10 +1020,12 @@ def branchClaims6And13Group02 : Array NodeClaim := ⟨6, [], [23, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 13). -/ +@[expose] def branchClaims6Row13 : BranchClaims := ⟨#[branchClaims6And13Group00, branchClaims6And13Group01, branchClaims6And13Group02], 133, 132⟩ /-- Coverage claims for branch (6, 14), group 00. -/ +@[expose] def branchClaims6And14Group00 : Array NodeClaim := #[⟨3, 6124896331407942686, 36240181098511614, 36169534514660582, 4995, 67108864, 134217728, 67108864, #[⟨5, [5], [106], [], []⟩]⟩, @@ -1258,6 +1266,7 @@ def branchClaims6And14Group00 : Array NodeClaim := 5034, 17179869184, 0, 17179869184, #[⟨6, [], [1331], [], []⟩]⟩] /-- Coverage claims for branch (6, 14), group 01. -/ +@[expose] def branchClaims6And14Group01 : Array NodeClaim := #[⟨3, 8214566043346658334, 36240319611174142, 211243674654760, 1860, 8, 0, 0, #[⟨0, [], [], [63], []⟩]⟩, @@ -1503,6 +1512,7 @@ def branchClaims6And14Group01 : Array NodeClaim := 4729, 2147483648, 0, 2147483648, #[⟨6, [], [107], [], []⟩]⟩] /-- Coverage claims for branch (6, 14), group 02. -/ +@[expose] def branchClaims6And14Group02 : Array NodeClaim := #[⟨3, 3819052942794286110, 36240869366988028, 36239903791515824, 4128, 0, 0, 0, #[]⟩, @@ -1702,10 +1712,12 @@ def branchClaims6And14Group02 : Array NodeClaim := ⟨6, [], [16, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 14). -/ +@[expose] def branchClaims6Row14 : BranchClaims := ⟨#[branchClaims6And14Group00, branchClaims6And14Group01, branchClaims6And14Group02], 178, 177⟩ /-- Coverage claims for branch (6, 15), group 00. -/ +@[expose] def branchClaims6And15Group00 : Array NodeClaim := #[⟨3, 5980780761082094622, 36240182172220670, 36099166839012418, 5062, 17180393472, 2147963904, 17180393472, #[⟨2, [5, 4, 5], [], [], []⟩, @@ -1947,6 +1959,7 @@ def branchClaims6And15Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (6, 15), group 01. -/ +@[expose] def branchClaims6And15Group01 : Array NodeClaim := #[⟨3, 4107283318176343070, 36240044733299962, 36239905130555560, 2302, 16777218, 0, 16777218, #[⟨0, [], [599], [], []⟩, @@ -2186,6 +2199,7 @@ def branchClaims6And15Group01 : Array NodeClaim := ⟨1, [], [], [126], []⟩]⟩] /-- Coverage claims for branch (6, 15), group 02. -/ +@[expose] def branchClaims6And15Group02 : Array NodeClaim := #[⟨2, 732657476638, 36240457050143964, 36169536664242304, 4793, 22046081536, 203148, 4865687552, #[⟨0, [6, 5], [], [], []⟩, @@ -2440,6 +2454,7 @@ def branchClaims6And15Group02 : Array NodeClaim := 5119, 2097152, 0, 2097152, #[⟨4, [], [69], [], []⟩]⟩] /-- Coverage claims for branch (6, 15), group 03. -/ +@[expose] def branchClaims6And15Group03 : Array NodeClaim := #[⟨3, 4107283288363230238, 36240594489113850, 36240040958898280, 5118, 4210696, 0, 4194312, #[⟨0, [], [599], [], []⟩, @@ -2488,11 +2503,13 @@ def branchClaims6And15Group03 : Array NodeClaim := ⟨6, [], [16, 23], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 15). -/ +@[expose] def branchClaims6Row15 : BranchClaims := ⟨#[branchClaims6And15Group00, branchClaims6And15Group01, branchClaims6And15Group02, branchClaims6And15Group03], 201, 200⟩ /-- Coverage claims for branch (6, 16), group 00. -/ +@[expose] def branchClaims6And16Group00 : Array NodeClaim := #[⟨2, 838180398110, 36240315853110518, 36099165765239906, 4979, 2348811264, 0, 2348811264, #[⟨2, [], [145], [], []⟩, @@ -2755,6 +2772,7 @@ def branchClaims6And16Group00 : Array NodeClaim := ⟨3, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (6, 16), group 01. -/ +@[expose] def branchClaims6And16Group01 : Array NodeClaim := #[⟨2, 582814393374, 36240865608908022, 211243679912960, 5128, 2147618880, 19488, 2147614720, #[⟨1, [6], [], [61], []⟩, @@ -2977,10 +2995,12 @@ def branchClaims6And16Group01 : Array NodeClaim := ⟨6, [], [23, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 16). -/ +@[expose] def branchClaims6Row16 : BranchClaims := ⟨#[branchClaims6And16Group00, branchClaims6And16Group01], 118, 117⟩ /-- Coverage claims for branch (6, 17), group 00. -/ +@[expose] def branchClaims6And17Group00 : Array NodeClaim := #[⟨3, 5548435579105043486, 36240591804759294, 36169534514136294, 5125, 67108864, 134217728, 67108864, #[⟨5, [5], [106], [], []⟩]⟩, @@ -3223,6 +3243,7 @@ def branchClaims6And17Group00 : Array NodeClaim := ⟨6, [], [63], [], []⟩]⟩] /-- Coverage claims for branch (6, 17), group 01. -/ +@[expose] def branchClaims6And17Group01 : Array NodeClaim := #[⟨3, 5548434911707391006, 36240591804759294, 36169534514136294, 5125, 67108864, 134217728, 67108864, #[⟨5, [5], [106], [], []⟩]⟩, @@ -3442,6 +3463,7 @@ def branchClaims6And17Group01 : Array NodeClaim := ⟨3, [], [127], [], []⟩]⟩] /-- Coverage claims for branch (6, 17), group 02. -/ +@[expose] def branchClaims6And17Group02 : Array NodeClaim := #[⟨4, 5559413134519821342, 36240868830149886, 36240041771039780, 4803, 131072, 0, 131072, #[⟨3, [], [88], [], []⟩]⟩, @@ -3610,10 +3632,12 @@ def branchClaims6And17Group02 : Array NodeClaim := ⟨6, [], [16, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 17). -/ +@[expose] def branchClaims6Row17 : BranchClaims := ⟨#[branchClaims6And17Group00, branchClaims6And17Group01, branchClaims6And17Group02], 171, 170⟩ /-- Coverage claims for branch (6, 18), group 00. -/ +@[expose] def branchClaims6And18Group00 : Array NodeClaim := #[⟨4, 5600226592569811998, 36240869366988030, 36240454893186116, 586, 0, 0, 0, #[]⟩, @@ -3824,6 +3848,7 @@ def branchClaims6And18Group00 : Array NodeClaim := ⟨5, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (6, 18), group 01. -/ +@[expose] def branchClaims6And18Group01 : Array NodeClaim := #[⟨2, 606459782174, 36240867756358910, 36028797027881104, 4723, 26072089088, 108, 8623522304, #[⟨0, [6, 5], [], [], []⟩, @@ -4081,6 +4106,7 @@ def branchClaims6And18Group01 : Array NodeClaim := 142, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (6, 18), group 02. -/ +@[expose] def branchClaims6And18Group02 : Array NodeClaim := #[⟨3, 5404319748044481566, 36240867219504382, 36099440643692616, 544, 17180393984, 16392, 17180393472, #[⟨0, [5], [], [], []⟩, @@ -4321,6 +4347,7 @@ def branchClaims6And18Group02 : Array NodeClaim := ⟨3, [], [324], [], []⟩]⟩] /-- Coverage claims for branch (6, 18), group 03. -/ +@[expose] def branchClaims6And18Group03 : Array NodeClaim := #[⟨2, 458266633246, 36240867219537104, 36240453007325184, 5105, 228360, 3221225472, 222208, #[⟨0, [], [], [189], []⟩, @@ -4345,11 +4372,13 @@ def branchClaims6And18Group03 : Array NodeClaim := ⟨6, [], [16, 23], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 18). -/ +@[expose] def branchClaims6Row18 : BranchClaims := ⟨#[branchClaims6And18Group00, branchClaims6And18Group01, branchClaims6And18Group02, branchClaims6And18Group03], 195, 194⟩ /-- Coverage claims for branch (6, 23), group 00. -/ +@[expose] def branchClaims6And23Group00 : Array NodeClaim := #[⟨2, 606453031966, 36240044733267134, 70368753104896, 2853, 147464, 73728, 147464, #[⟨0, [], [432], [], []⟩, @@ -4583,6 +4612,7 @@ def branchClaims6And23Group00 : Array NodeClaim := ⟨6, [], [145], [], []⟩]⟩] /-- Coverage claims for branch (6, 23), group 01. -/ +@[expose] def branchClaims6And23Group01 : Array NodeClaim := #[⟨4, 3716877264016303134, 36240592341630206, 36099166312102070, 12, 0, 0, 0, #[]⟩, @@ -4842,6 +4872,7 @@ def branchClaims6And23Group01 : Array NodeClaim := ⟨3, [], [116], [], []⟩]⟩] /-- Coverage claims for branch (6, 23), group 02. -/ +@[expose] def branchClaims6And23Group02 : Array NodeClaim := #[⟨2, 582797157406, 36240592341630134, 211106240924800, 5123, 2147635456, 1073818752, 2147631360, #[⟨1, [6], [377], [], []⟩, @@ -5074,6 +5105,7 @@ def branchClaims6And23Group02 : Array NodeClaim := 4777, 4096, 0, 4096, #[⟨2, [], [540], [], []⟩]⟩] /-- Coverage claims for branch (6, 23), group 03. -/ +@[expose] def branchClaims6And23Group03 : Array NodeClaim := #[⟨3, 6124896333735846942, 36240867219537110, 36239903256803392, 4776, 67584, 135168, 2048, #[⟨2, [5], [292], [], []⟩, @@ -5260,6 +5292,7 @@ def branchClaims6And23Group03 : Array NodeClaim := ⟨6, [], [23, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 23). -/ +@[expose] def branchClaims6Row23 : BranchClaims := ⟨#[branchClaims6And23Group00, branchClaims6And23Group01, branchClaims6And23Group02, branchClaims6And23Group03], 248, 247⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData14.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData14.lean index 5c3211597d..706e6c0077 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData14.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData14.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (6, 24), group 00. -/ +@[expose] def branchClaims6And24Group00 : Array NodeClaim := #[⟨3, 8646911616130671646, 36240319611190398, 211245555267584, 5236, 16392, 0, 16392, #[⟨0, [], [333], [], []⟩, @@ -254,6 +255,7 @@ def branchClaims6And24Group00 : Array NodeClaim := 55, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (6, 24), group 01. -/ +@[expose] def branchClaims6And24Group01 : Array NodeClaim := #[⟨4, 8185573994278872094, 36240868293278974, 36239906206943480, 433, 8388608, 0, 8388608, #[⟨4, [], [70], [], []⟩]⟩, @@ -517,6 +519,7 @@ def branchClaims6And24Group01 : Array NodeClaim := ⟨6, [], [385, 145], [], []⟩]⟩] /-- Coverage claims for branch (6, 24), group 02. -/ +@[expose] def branchClaims6And24Group02 : Array NodeClaim := #[⟨4, 5157466193449903134, 36240868293278974, 211106776259702, 228, 17179869184, 0, 0, #[⟨6, [], [], [], [975]⟩]⟩, @@ -748,6 +751,7 @@ def branchClaims6And24Group02 : Array NodeClaim := 710, 65536, 131072, 0, #[⟨3, [5], [], [190], []⟩]⟩] /-- Coverage claims for branch (6, 24), group 03. -/ +@[expose] def branchClaims6And24Group03 : Array NodeClaim := #[⟨4, 6140939737934521374, 36240868293278846, 36169810197920820, 3043, 0, 0, 0, #[]⟩, @@ -890,11 +894,13 @@ def branchClaims6And24Group03 : Array NodeClaim := ⟨6, [], [16, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 24). -/ +@[expose] def branchClaims6Row24 : BranchClaims := ⟨#[branchClaims6And24Group00, branchClaims6And24Group01, branchClaims6And24Group02, branchClaims6And24Group03], 235, 234⟩ /-- Coverage claims for branch (6, 25), group 00. -/ +@[expose] def branchClaims6And25Group00 : Array NodeClaim := #[⟨3, 6413126063518049310, 36240319611206782, 36028798363768888, 5277, 0, 8, 0, #[⟨0, [5], [], [], []⟩]⟩, @@ -1149,6 +1155,7 @@ def branchClaims6And25Group00 : Array NodeClaim := 954, 128, 0, 0, #[⟨1, [], [], [], [1040]⟩]⟩] /-- Coverage claims for branch (6, 25), group 01. -/ +@[expose] def branchClaims6And25Group01 : Array NodeClaim := #[⟨3, 8646911892889723934, 36240319611206830, 36239906750105728, 5256, 8320, 8388614, 128, #[⟨0, [5, 4], [], [], []⟩, @@ -1435,6 +1442,7 @@ def branchClaims6And25Group01 : Array NodeClaim := ⟨6, [], [145], [126], []⟩]⟩] /-- Coverage claims for branch (6, 25), group 02. -/ +@[expose] def branchClaims6And25Group02 : Array NodeClaim := #[⟨3, 7566047956785882142, 36240594489105662, 36239904333663392, 5149, 1073741824, 1024, 1073741824, #[⟨2, [5], [], [], []⟩, @@ -1650,6 +1658,7 @@ def branchClaims6And25Group02 : Array NodeClaim := 747, 4, 0, 4, #[⟨0, [], [229], [], []⟩]⟩] /-- Coverage claims for branch (6, 25), group 03. -/ +@[expose] def branchClaims6And25Group03 : Array NodeClaim := #[⟨3, 8142508322559026206, 36240869367020668, 36240040693110816, 326, 147456, 0, 16384, #[⟨2, [], [329], [], []⟩, @@ -1725,11 +1734,13 @@ def branchClaims6And25Group03 : Array NodeClaim := ⟨6, [], [16, 23], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 25). -/ +@[expose] def branchClaims6Row25 : BranchClaims := ⟨#[branchClaims6And25Group00, branchClaims6And25Group01, branchClaims6And25Group02, branchClaims6And25Group03], 211, 210⟩ /-- Coverage claims for branch (6, 26), group 00. -/ +@[expose] def branchClaims6And26Group00 : Array NodeClaim := #[⟨4, 5600226974815675422, 36240869367020782, 36240040965731398, 4, 0, 0, 0, #[]⟩, @@ -1930,6 +1941,7 @@ def branchClaims6And26Group00 : Array NodeClaim := ⟨2, [], [635], [], []⟩]⟩] /-- Coverage claims for branch (6, 26), group 01. -/ +@[expose] def branchClaims6And26Group01 : Array NodeClaim := #[⟨2, 333454697502, 36240316926852334, 211106237263872, 3022, 204864, 0, 131136, #[⟨1, [], [374], [], []⟩, @@ -2160,6 +2172,7 @@ def branchClaims6And26Group01 : Array NodeClaim := 2063, 512, 0, 512, #[⟨1, [], [226], [], []⟩]⟩] /-- Coverage claims for branch (6, 26), group 02. -/ +@[expose] def branchClaims6And26Group02 : Array NodeClaim := #[⟨3, 5548435471961613342, 36240319611206780, 211243679365124, 2852, 131072, 0, 0, #[⟨3, [], [], [127], []⟩]⟩, @@ -2417,6 +2430,7 @@ def branchClaims6And26Group02 : Array NodeClaim := ⟨3, [], [380], [], []⟩]⟩] /-- Coverage claims for branch (6, 26), group 03. -/ +@[expose] def branchClaims6And26Group03 : Array NodeClaim := #[⟨3, 3098476877320479774, 36240867219504382, 211243676219432, 249, 16392, 0, 16392, #[⟨0, [], [982], [], []⟩, @@ -2597,11 +2611,13 @@ def branchClaims6And26Group03 : Array NodeClaim := ⟨6, [], [23, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 26). -/ +@[expose] def branchClaims6Row26 : BranchClaims := ⟨#[branchClaims6And26Group00, branchClaims6And26Group01, branchClaims6And26Group02, branchClaims6And26Group03], 232, 231⟩ /-- Coverage claims for branch (6, 27), group 00. -/ +@[expose] def branchClaims6And27Group00 : Array NodeClaim := #[⟨4, 5564479652777616414, 36240592341630206, 36169672221570158, 37, 0, 0, 0, #[]⟩, @@ -2802,6 +2818,7 @@ def branchClaims6And27Group00 : Array NodeClaim := ⟨3, [], [], [62], []⟩]⟩] /-- Coverage claims for branch (6, 27), group 01. -/ +@[expose] def branchClaims6And27Group01 : Array NodeClaim := #[⟨3, 4107283192547042334, 36240592341630078, 211243944652904, 249, 16392, 0, 16392, #[⟨0, [], [333], [], []⟩, @@ -3023,6 +3040,7 @@ def branchClaims6And27Group01 : Array NodeClaim := ⟨3, [], [], [126], []⟩]⟩] /-- Coverage claims for branch (6, 27), group 02. -/ +@[expose] def branchClaims6And27Group02 : Array NodeClaim := #[⟨3, 5116090045177193502, 36240593952242806, 36169671953669124, 2944, 0, 131072, 0, #[⟨3, [5], [], [], []⟩]⟩, @@ -3292,6 +3310,7 @@ def branchClaims6And27Group02 : Array NodeClaim := 21, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (6, 27), group 03. -/ +@[expose] def branchClaims6And27Group03 : Array NodeClaim := #[⟨3, 5404319748025672734, 36240867219537022, 211243674114152, 246, 16392, 0, 8, #[⟨0, [], [333], [], []⟩, @@ -3443,11 +3462,13 @@ def branchClaims6And27Group03 : Array NodeClaim := ⟨6, [], [16, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 27). -/ +@[expose] def branchClaims6Row27 : BranchClaims := ⟨#[branchClaims6And27Group00, branchClaims6And27Group01, branchClaims6And27Group02, branchClaims6And27Group03], 224, 223⟩ /-- Coverage claims for branch (6, 28), group 00. -/ +@[expose] def branchClaims6And28Group00 : Array NodeClaim := #[⟨2, 451639698462, 36240729780583534, 36099165765243936, 1480, 2147636288, 0, 2147636288, #[⟨1, [], [422], [], []⟩, @@ -3669,6 +3690,7 @@ def branchClaims6And28Group00 : Array NodeClaim := 4779, 10240, 20480, 2048, #[⟨2, [5, 5], [992], [62], []⟩]⟩] /-- Coverage claims for branch (6, 28), group 01. -/ +@[expose] def branchClaims6And28Group01 : Array NodeClaim := #[⟨2, 731819205662, 36240730854325346, 36239903251560448, 4773, 228352, 3221225472, 21504, #[⟨2, [], [145, 426, 426], [58, 60], []⟩, @@ -3940,6 +3962,7 @@ def branchClaims6And28Group01 : Array NodeClaim := ⟨3, [], [], [126], []⟩]⟩] /-- Coverage claims for branch (6, 28), group 02. -/ +@[expose] def branchClaims6And28Group02 : Array NodeClaim := #[⟨3, 2810246899063514142, 36240730854325366, 36169809392614404, 5273, 65536, 131072, 65536, #[⟨3, [5], [285], [], []⟩]⟩, @@ -4183,6 +4206,7 @@ def branchClaims6And28Group02 : Array NodeClaim := ⟨2, [], [], [190], []⟩]⟩] /-- Coverage claims for branch (6, 28), group 03. -/ +@[expose] def branchClaims6And28Group03 : Array NodeClaim := #[⟨2, 599983842334, 36240867756399802, 36170084263172224, 5246, 30099145216, 3221453836, 12919276032, #[⟨0, [6, 5], [], [], []⟩, @@ -4257,11 +4281,13 @@ def branchClaims6And28Group03 : Array NodeClaim := ⟨6, [], [16, 23], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 28). -/ +@[expose] def branchClaims6Row28 : BranchClaims := ⟨#[branchClaims6And28Group00, branchClaims6And28Group01, branchClaims6And28Group02, branchClaims6And28Group03], 205, 204⟩ /-- Coverage claims for branch (6, 30), group 00. -/ +@[expose] def branchClaims6And30Group00 : Array NodeClaim := #[⟨4, 5598256649979094046, 36240867219537150, 36240042039444710, 3490, 0, 0, 0, #[]⟩, @@ -4461,6 +4487,7 @@ def branchClaims6And30Group00 : Array NodeClaim := 570, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (6, 30), group 01. -/ +@[expose] def branchClaims6And30Group01 : Array NodeClaim := #[⟨3, 3242592596395615262, 36240319611165950, 36099442522722376, 135, 512, 540680, 0, #[⟨0, [5], [], [], []⟩, @@ -4674,6 +4701,7 @@ def branchClaims6And30Group01 : Array NodeClaim := ⟨4, [], [143], [], []⟩]⟩] /-- Coverage claims for branch (6, 30), group 02. -/ +@[expose] def branchClaims6And30Group02 : Array NodeClaim := #[⟨4, 2849934464295429150, 36240869366988030, 211245024677038, 804, 536870912, 0, 0, #[⟨5, [], [], [], [948]⟩]⟩, @@ -4893,6 +4921,7 @@ def branchClaims6And30Group02 : Array NodeClaim := 55, 0, 0, 0, #[]⟩] /-- Coverage claims for branch (6, 30), group 03. -/ +@[expose] def branchClaims6And30Group03 : Array NodeClaim := #[⟨3, 5116089910351684638, 36240869367020758, 36240178938907712, 5175, 8320, 20736, 0, #[⟨1, [5], [], [190], []⟩, @@ -5081,6 +5110,7 @@ def branchClaims6And30Group03 : Array NodeClaim := 5376, 32, 0, 0, #[⟨1, [], [], [], [963]⟩]⟩] /-- Coverage claims for branch (6, 30), group 04. -/ +@[expose] def branchClaims6And30Group04 : Array NodeClaim := #[⟨3, 2810246896859800606, 36240869367020718, 36240178936812576, 1540, 20544, 0, 4160, #[⟨1, [], [338], [], []⟩, @@ -5123,6 +5153,7 @@ def branchClaims6And30Group04 : Array NodeClaim := ⟨6, [], [23, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 30). -/ +@[expose] def branchClaims6Row30 : BranchClaims := ⟨#[branchClaims6And30Group00, branchClaims6And30Group01, branchClaims6And30Group02, branchClaims6And30Group03, branchClaims6And30Group04], 265, 264⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData15.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData15.lean index 7d91c4270a..d198599aa6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData15.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateData15.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Sharded flat coverage-certificate data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Coverage claims for branch (6, 31), group 00. -/ +@[expose] def branchClaims6And31Group00 : Array NodeClaim := #[⟨3, 5548435579105502238, 36240594489113838, 36169534782571590, 786, 0, 0, 0, #[]⟩, @@ -201,6 +202,7 @@ def branchClaims6And31Group00 : Array NodeClaim := ⟨6, [], [501, 501], [], []⟩]⟩] /-- Coverage claims for branch (6, 31), group 01. -/ +@[expose] def branchClaims6And31Group01 : Array NodeClaim := #[⟨4, 3857052058242311198, 36240869367012606, 211244488332406, 5490, 268435456, 0, 268435456, #[⟨5, [], [328], [], []⟩]⟩, @@ -431,6 +433,7 @@ def branchClaims6And31Group01 : Array NodeClaim := ⟨4, [], [105], [], []⟩]⟩] /-- Coverage claims for branch (6, 31), group 02. -/ +@[expose] def branchClaims6And31Group02 : Array NodeClaim := #[⟨2, 324030489630, 36240869366979706, 211243939924032, 5505, 16779270, 0, 16777222, #[⟨0, [], [143, 390], [], []⟩, @@ -655,6 +658,7 @@ def branchClaims6And31Group02 : Array NodeClaim := 960, 524288, 0, 0, #[⟨3, [], [], [], [1013]⟩]⟩] /-- Coverage claims for branch (6, 31), group 03. -/ +@[expose] def branchClaims6And31Group03 : Array NodeClaim := #[⟨3, 5404320134589899806, 36240869367020750, 211243948334082, 5467, 2048, 0, 0, #[⟨2, [], [], [191], []⟩]⟩, @@ -845,11 +849,13 @@ def branchClaims6And31Group03 : Array NodeClaim := ⟨6, [], [16, 28], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 31). -/ +@[expose] def branchClaims6Row31 : BranchClaims := ⟨#[branchClaims6And31Group00, branchClaims6And31Group01, branchClaims6And31Group02, branchClaims6And31Group03], 250, 249⟩ /-- Coverage claims for branch (6, 32), group 00. -/ +@[expose] def branchClaims6And32Group00 : Array NodeClaim := #[⟨4, 6028350032147178526, 36240731928034558, 36240182158064674, 5286, 16384, 0, 0, #[⟨2, [], [], [], [1064]⟩]⟩, @@ -1056,6 +1062,7 @@ def branchClaims6And32Group00 : Array NodeClaim := 5545, 0, 16384, 0, #[⟨2, [5], [], [], []⟩]⟩] /-- Coverage claims for branch (6, 32), group 01. -/ +@[expose] def branchClaims6And32Group01 : Array NodeClaim := #[⟨4, 7653023869042222110, 36240869366988030, 36240182159104048, 5287, 8, 0, 0, #[⟨0, [], [], [], [1067]⟩]⟩, @@ -1289,6 +1296,7 @@ def branchClaims6And32Group01 : Array NodeClaim := 5402, 4, 0, 0, #[⟨0, [], [], [], [1070]⟩]⟩] /-- Coverage claims for branch (6, 32), group 02. -/ +@[expose] def branchClaims6And32Group02 : Array NodeClaim := #[⟨3, 3242592330617250846, 36240869366996222, 36099443059591208, 1078, 536870912, 16793866, 0, #[⟨0, [5, 5], [], [], []⟩, @@ -1514,6 +1522,7 @@ def branchClaims6And32Group02 : Array NodeClaim := 5192, 2048, 0, 0, #[⟨2, [], [], [], [1073]⟩]⟩] /-- Coverage claims for branch (6, 32), group 03. -/ +@[expose] def branchClaims6And32Group03 : Array NodeClaim := #[⟨3, 3098477125378303006, 36240869367020718, 36099440917888002, 5539, 796672, 0, 272384, #[⟨2, [], [831, 654], [], []⟩, @@ -1713,6 +1722,7 @@ def branchClaims6And32Group03 : Array NodeClaim := ⟨6, [0], [], [], []⟩]⟩] /-- Coverage claims for branch (6, 32), group 04. -/ +@[expose] def branchClaims6And32Group04 : Array NodeClaim := #[⟨0, 14214174, 36240731391138816, 36028797287399424, 2918, 3455286783, 0, 3253763073, #[⟨0, [], [192], [11, 30, 44, 57], []⟩, @@ -1724,6 +1734,7 @@ def branchClaims6And32Group04 : Array NodeClaim := ⟨6, [], [16, 23], [], []⟩]⟩] /-- Flat postorder claims for branch (6, 32). -/ +@[expose] def branchClaims6Row32 : BranchClaims := ⟨#[branchClaims6And32Group00, branchClaims6And32Group01, branchClaims6And32Group02, branchClaims6And32Group03, branchClaims6And32Group04], 257, 256⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts00.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts00.lean index 78ac09556f..eb161d85ef 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts00.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts00.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts01.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts01.lean index a4e73512b8..706e620261 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts01.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts01.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts02.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts02.lean index cd6beba09b..eeb311a37e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts02.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts02.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts03.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts03.lean index 35ec11232b..76977a6340 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts03.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts03.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts04.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts04.lean index c59818649e..4092a94bc9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts04.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts04.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts05.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts05.lean index bda1b98708..932ab54a42 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts05.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts05.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts06.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts06.lean index cd18652dae..3d99135e73 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts06.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts06.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts07.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts07.lean index e46e0ca909..2b1085f5b0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts07.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryFacts07.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummarySound /-! # Canonical audits for dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummarySoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummarySoundness.lean index 0e84f61b7d..a5d648fc57 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummarySoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummarySoundness.lean @@ -10,19 +10,19 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateLookup /-! # Canonical validity of dense certificate summary identifiers -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Check that a dense pattern summary agrees with its canonical source lookup. -/ -def patternSummaryCanonicalB (summary : PatternSummary) : Bool := +@[expose] def patternSummaryCanonicalB (summary : PatternSummary) : Bool := match patternSummaryForOriginLookup summary.origin with | none => false | some canonical => (canonical.origin == summary.origin) && (canonical.mask == summary.mask) /-- Check that a dense exact summary agrees with its canonical source lookup. -/ -def hardSummaryCanonicalB (summary : HardSummary) : Bool := +@[expose] def hardSummaryCanonicalB (summary : HardSummary) : Bool := match hardSummaryForOriginLookup summary.origin with | none => false | some canonical => diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryValidity.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryValidity.lean index a0016f0313..3e0e5cc0e7 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryValidity.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateDenseSummaryValidity.lean @@ -18,7 +18,7 @@ import LeanPool.Erdos97ConvexOctagon.CoverageCertificateDenseSummaryFacts07 /-! # Global validity of dense certificate summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts00.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts00.lean index 7229a0d6e4..99c0c20a8a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts00.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts00.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts01.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts01.lean index fecc82b5fb..6fda78245a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts01.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts01.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts02.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts02.lean index dbe5c6f629..5c79db164b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts02.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts02.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts03.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts03.lean index 9629bac831..cf3ce1f906 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts03.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts03.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts04.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts04.lean index 14087cc5f1..30c0453585 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts04.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts04.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts05.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts05.lean index 39c3a30d67..90a910b846 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts05.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts05.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts06.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts06.lean index c4cd123967..4b09bc82c6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts06.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts06.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts07.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts07.lean index 10aa652f6e..1da642265c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts07.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts07.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts08.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts08.lean index e31f031488..df59113c3e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts08.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts08.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts09.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts09.lean index 13e0b3f872..87d23d6f7f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts09.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts09.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts10.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts10.lean index c46a1c6d79..891ef9dccb 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts10.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts10.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts11.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts11.lean index 8aa7d78c9a..5c155d8d7e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts11.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts11.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts12.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts12.lean index ecd07f2174..94c1be3ed1 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts12.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts12.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts13.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts13.lean index 0b15e9e329..1bc58a061c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts13.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts13.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts14.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts14.lean index f6bf1793c2..d411376ba4 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts14.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts14.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts15.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts15.lean index edd58529bf..8c2ad8b4de 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts15.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts15.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts16.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts16.lean index 9c79896d00..82d87dcc9e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts16.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts16.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts17.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts17.lean index d335b356f4..f6d9d712ab 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts17.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts17.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts18.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts18.lean index 7f0283aa37..1a349e038b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts18.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts18.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts19.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts19.lean index 40506ac223..1e00cb51e8 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts19.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts19.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts20.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts20.lean index 1f05f0d26c..fda35ae3f0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts20.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts20.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts21.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts21.lean index ad7a53bebf..fb8e2da585 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts21.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts21.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts22.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts22.lean index ecd657cb09..0331cd5087 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts22.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts22.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts23.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts23.lean index 2c4e1a490b..9fbb849b30 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts23.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts23.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts24.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts24.lean index 07ba03c2e9..189d9b6d2a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts24.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts24.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts25.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts25.lean index 3b9df6aec8..419e8dd331 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts25.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts25.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts26.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts26.lean index f0b55451a6..e7c434ed7a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts26.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts26.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts27.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts27.lean index 477a1e4c67..0df933ce8a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts27.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts27.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts28.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts28.lean index 50edb4aa3c..0bd3bb9226 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts28.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts28.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts29.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts29.lean index d2091a6e25..ef9bb85406 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts29.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts29.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts30.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts30.lean index e3c5a1a0b4..b890a87d48 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts30.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts30.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts31.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts31.lean index add3b95a99..7259b0c107 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts31.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts31.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts32.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts32.lean index 8703d9d75e..08bfa26fe4 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts32.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts32.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts33.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts33.lean index dc950cf342..56c3563a60 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts33.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts33.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts34.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts34.lean index 6bbbb58ed5..c644d6f79c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts34.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts34.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts35.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts35.lean index 7f2aac15f5..354c35792e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts35.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts35.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts36.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts36.lean index 99f99881d6..0af036f363 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts36.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts36.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts37.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts37.lean index 4b66df9f62..ca44cdfb04 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts37.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts37.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts38.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts38.lean index 501e0fd4be..e4536bb72c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts38.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts38.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts39.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts39.lean index 3d4ef7fa11..b4c9c618e6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts39.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts39.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts40.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts40.lean index d26f2876a5..22d8a59ac8 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts40.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts40.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts41.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts41.lean index 2f1cb684ea..f51d2679a6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts41.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts41.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts42.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts42.lean index 8848ebc03e..0f71002b02 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts42.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts42.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts43.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts43.lean index 381aef7643..6aa7d0ba18 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts43.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts43.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts44.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts44.lean index 78057b912a..5b0e2e3d82 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts44.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts44.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts45.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts45.lean index dba7a57049..f24f8b378c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts45.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts45.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts46.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts46.lean index 94e9afb4b4..511dd27ac6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts46.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts46.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts47.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts47.lean index f05cce7924..3a79b3e28a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts47.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts47.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts48.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts48.lean index defce6ac78..8512b05544 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts48.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts48.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts49.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts49.lean index cccde8e1fb..cfb4f5573b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts49.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts49.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts50.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts50.lean index 0b628dc918..4d3cd94d3a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts50.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts50.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts51.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts51.lean index 419b19d528..feddabda1a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts51.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts51.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts52.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts52.lean index add9a708c2..b5959af833 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts52.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts52.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts53.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts53.lean index 0384f80fa9..d697c5e89f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts53.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts53.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts54.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts54.lean index b23a57c3c2..0682df8700 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts54.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts54.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts55.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts55.lean index 2419646a2a..fe97c13c87 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts55.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts55.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts56.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts56.lean index 8c87dce5de..cec198825a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts56.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts56.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts57.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts57.lean index 81f67170c1..337f75daee 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts57.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts57.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts58.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts58.lean index 240541ee77..28c962d5dd 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts58.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts58.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts59.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts59.lean index af41554d6d..42ca73a54a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts59.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts59.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts60.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts60.lean index 9eb05da563..87ef83794b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts60.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts60.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts61.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts61.lean index 2277e1c502..76cde2f6d9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts61.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts61.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts62.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts62.lean index 7826d79019..d50f142d0f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts62.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts62.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts63.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts63.lean index 56e746235d..8332343bbe 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts63.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts63.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts64.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts64.lean index 8db0c55d9a..5c96e8fb52 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts64.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts64.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts65.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts65.lean index c0c174db56..15caddf014 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts65.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts65.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts66.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts66.lean index 7bc67e85fe..cf78c29c72 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts66.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts66.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts67.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts67.lean index 7956884d2e..3078879d24 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts67.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts67.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts68.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts68.lean index c38934c891..3fce345ab1 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts68.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts68.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts69.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts69.lean index 11ba1be988..c938530b92 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts69.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts69.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts70.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts70.lean index 9ce097dbe3..a233e00643 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts70.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts70.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts71.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts71.lean index bf52b44003..f17b15ed09 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts71.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts71.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts72.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts72.lean index 907b837155..7c1b9d6431 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts72.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts72.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts73.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts73.lean index 6a51cdf9b3..eaefb65175 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts73.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts73.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts74.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts74.lean index 564f65ae01..b40d05bd0d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts74.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts74.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts75.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts75.lean index 8a7d56974c..b1db56b663 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts75.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts75.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts76.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts76.lean index b13de82fb1..122eecd404 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts76.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts76.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts77.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts77.lean index 83ba1efa0c..12dfd92310 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts77.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts77.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts78.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts78.lean index 5706f8ee30..a4deecf143 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts78.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts78.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts79.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts79.lean index 62ea2e786b..468297d30f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts79.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts79.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts80.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts80.lean index 01f4f57f26..1b41e08f84 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts80.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts80.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts81.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts81.lean index 65e79e7ea9..9f3cd77c1f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts81.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts81.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts82.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts82.lean index 316d73aa51..56a5205597 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts82.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts82.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts83.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts83.lean index 373fdda499..a0bc45e3ce 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts83.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts83.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts84.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts84.lean index 170f61d572..471ddb4832 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts84.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts84.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts85.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts85.lean index e34ce1a4a3..a3a9d8363f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts85.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts85.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts86.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts86.lean index 747fa5eaa8..837624ee0e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts86.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts86.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts87.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts87.lean index bb88c0cb6f..c1ae758aaa 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts87.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts87.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts88.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts88.lean index 75ebb2df91..90443b85f8 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts88.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts88.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts89.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts89.lean index 1d2e1d8473..c3771a19fb 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts89.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts89.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts90.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts90.lean index 346acbb002..8d16eecf7f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts90.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts90.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts91.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts91.lean index f6f6ec88fc..5491ac9085 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts91.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts91.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts92.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts92.lean index 2cf0800eba..8395624a0d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts92.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts92.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts93.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts93.lean index 829ca2c39f..52e6d317c1 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts93.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateFacts93.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Bounded coverage-certificate computation facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateLookup.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateLookup.lean index 51cece44c0..f0628b8746 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateLookup.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateLookup.lean @@ -9,17 +9,17 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryValidity /-! # Canonical lookup and validity of coverage summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Retrieve the generated pattern summary having one source origin. -/ -def patternSummaryForOriginLookup (origin : Nat) : Option PatternSummary := +@[expose] def patternSummaryForOriginLookup (origin : Nat) : Option PatternSummary := let group := patternSummaryBucketGroups.getD (origin % 256 / 8) #[] (group.getD (origin % 8) []).find? fun summary => summary.origin == origin /-- Retrieve the generated hard summary having one source origin. -/ -def hardSummaryForOriginLookup (origin : Nat) : Option HardSummary := +@[expose] def hardSummaryForOriginLookup (origin : Nat) : Option HardSummary := let group := hardSummaryBucketGroups.getD (origin % 256 / 8) #[] (group.getD (origin % 8) []).find? fun summary => summary.origin == origin diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateManifest.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateManifest.lean index 41a54db8d8..7f7edb4541 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateManifest.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateManifest.lean @@ -28,12 +28,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Exhaustive fixed-branch coverage-certificate manifest -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Certificate claim for each of the 245 canonical fixed-row branches. -/ -def coverageBranchClaim (orbit : Fin 7) (rowTwo : Fin 35) : BranchClaim := +@[expose] def coverageBranchClaim (orbit : Fin 7) (rowTwo : Fin 35) : BranchClaim := match orbit.val, rowTwo.val with | 0, 0 => .patternTwo 0 | 0, 1 => .patternTwo 0 diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateNodeSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateNodeSoundness.lean index 0a6f0574c1..17348e0399 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateNodeSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateNodeSoundness.lean @@ -10,7 +10,7 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageCertificateSupportSoundness /-! # Soundness of flat postorder coverage-certificate nodes -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSemanticSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSemanticSoundness.lean index 3d4578404c..2ede9915c0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSemanticSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSemanticSoundness.lean @@ -14,7 +14,7 @@ import LeanPool.Erdos97ConvexOctagon.CoverageSearchRowChoiceSoundness /-! # Semantic consequences of compact coverage certificates -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSoundness.lean index 517266f34c..9231ba2ed2 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSoundness.lean @@ -14,7 +14,7 @@ import LeanPool.Erdos97ConvexOctagon.RowSymmetry /-! # Soundness of the exhaustive coverage-certificate manifest -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSummaries.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSummaries.lean index a25cca2622..620df80588 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSummaries.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSummaries.lean @@ -13,11 +13,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Dense identifiers for audited coverage summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage /-- Shallow PatternSummary group 0. -/ +@[expose] def densePatternSummaries00 : Array PatternSummary := #[⟨0, 7196⟩, ⟨1, 1703962⟩, ⟨6, 6381824⟩, ⟨7, 6842368⟩, ⟨11, 10592512⟩, ⟨14, 12697856⟩, ⟨17, 14737408⟩, ⟨18, 369098774⟩, ⟨19, 589496320⟩, ⟨20, 620766464⟩, ⟨22, 825294848⟩, @@ -35,6 +36,7 @@ def densePatternSummaries00 : Array PatternSummary := ⟨89, 828941336576⟩, ⟨91, 833236369408⟩, ⟨92, 836478435328⟩, ⟨93, 841813640192⟩] /-- Shallow PatternSummary group 1. -/ +@[expose] def densePatternSummaries01 : Array PatternSummary := #[⟨94, 845101924352⟩, ⟨96, 859006566400⟩, ⟨97, 962072731648⟩, ⟨98, 962087354368⟩, ⟨99, 965830770688⟩, ⟨100, 15393162788878⟩, ⟨101, 24189255811094⟩, ⟨102, 28587302322202⟩, @@ -56,6 +58,7 @@ def densePatternSummaries01 : Array PatternSummary := ⟨170, 38562660219879424⟩, ⟨171, 38712704902365184⟩, ⟨173, 40813871632547840⟩] /-- Shallow PatternSummary group 2. -/ +@[expose] def densePatternSummaries02 : Array PatternSummary := #[⟨174, 40813874055741440⟩, ⟨175, 40973300809072640⟩, ⟨176, 45317471250456832⟩, ⟨177, 45317471260966912⟩, ⟨178, 45317473951547392⟩, ⟨179, 45318162740150272⟩, @@ -79,6 +82,7 @@ def densePatternSummaries02 : Array PatternSummary := ⟨261, 337182748⟩, ⟨262, 353435676⟩] /-- Shallow PatternSummary group 3. -/ +@[expose] def densePatternSummaries03 : Array PatternSummary := #[⟨263, 353894428⟩, ⟨265, 606743552⟩, ⟨270, 1112165376⟩, ⟨282, 12886147094⟩, ⟨283, 13203669018⟩, ⟨285, 21827158044⟩, ⟨287, 25771048982⟩, ⟨288, 30064772374⟩, ⟨290, 30064967702⟩, @@ -98,6 +102,7 @@ def densePatternSummaries03 : Array PatternSummary := ⟨425, 145839921037312⟩, ⟨426, 147334566683648⟩, ⟨429, 147334568779776⟩] /-- Shallow PatternSummary group 4. -/ +@[expose] def densePatternSummaries04 : Array PatternSummary := #[⟨431, 149536343851008⟩, ⟨432, 150258088673280⟩, ⟨436, 151735322583040⟩, ⟨437, 153933853491200⟩, ⟨438, 153934323253248⟩, ⟨439, 153934388264960⟩, ⟨440, 153934389837824⟩, @@ -121,6 +126,7 @@ def densePatternSummaries04 : Array PatternSummary := ⟨543, 13864158726455296⟩, ⟨549, 14074169742352384⟩, ⟨552, 14636853415116800⟩] /-- Shallow PatternSummary group 5. -/ +@[expose] def densePatternSummaries05 : Array PatternSummary := #[⟨554, 14637128288829440⟩, ⟨556, 14711895076372480⟩, ⟨557, 14724659726516224⟩, ⟨558, 15762772373536768⟩, ⟨560, 15763046177701888⟩, ⟨562, 15842210209595392⟩, @@ -146,6 +152,7 @@ def densePatternSummaries05 : Array PatternSummary := ⟨637, 2449958197300208640⟩] /-- Shallow PatternSummary group 6. -/ +@[expose] def densePatternSummaries06 : Array PatternSummary := #[⟨642, 2450119421771907072⟩, ⟨643, 2594073385376064512⟩, ⟨646, 2594220719923569664⟩, ⟨647, 2594227319744757760⟩, ⟨648, 2594236817460953088⟩, ⟨649, 2738188573443531776⟩, @@ -171,6 +178,7 @@ def densePatternSummaries06 : Array PatternSummary := ⟨733, 5514657743728279552⟩] /-- Shallow PatternSummary group 7. -/ +@[expose] def densePatternSummaries07 : Array PatternSummary := #[⟨735, 5764608364861456384⟩, ⟨736, 5764608385517355008⟩, ⟨738, 5806265819601043456⟩, ⟨739, 5807391722983915520⟩, ⟨743, 5908723544333795328⟩, ⟨744, 5945315291306131456⟩, @@ -192,6 +200,7 @@ def densePatternSummaries07 : Array PatternSummary := ⟨832, 3299122094346⟩, ⟨833, 3299122096138⟩] /-- Shallow PatternSummary group 8. -/ +@[expose] def densePatternSummaries08 : Array PatternSummary := #[⟨836, 3448858747154⟩, ⟨838, 5497560311046⟩, ⟨839, 5497560376582⟩, ⟨840, 5497560441094⟩, ⟨841, 5497560441862⟩, ⟨842, 5498114473996⟩, ⟨846, 5639295270932⟩, ⟨847, 5652180172820⟩, @@ -211,6 +220,7 @@ def densePatternSummaries08 : Array PatternSummary := ⟨977, 27527250706456⟩, ⟨978, 27629809827864⟩, ⟨979, 27630329921560⟩, ⟨981, 27660143034392⟩] /-- Shallow PatternSummary group 9. -/ +@[expose] def densePatternSummaries09 : Array PatternSummary := #[⟨982, 844424934409478⟩, ⟨983, 844424934475014⟩, ⟨984, 844424934539526⟩, ⟨985, 844424934540294⟩, ⟨988, 844426054222090⟩, ⟨989, 844426054223882⟩, ⟨992, 844712692957458⟩, @@ -235,6 +245,7 @@ def densePatternSummaries09 : Array PatternSummary := ⟨1106, 4785389227212824⟩, ⟨1107, 4785389478871064⟩, ⟨1115, 5066850233762816⟩] /-- Shallow PatternSummary group 10. -/ +@[expose] def densePatternSummaries10 : Array PatternSummary := #[⟨1119, 5066868750567424⟩, ⟨1127, 5154931417833472⟩, ⟨1128, 5348037442421010⟩, ⟨1133, 5348308025360658⟩, ⟨1137, 5629552421765120⟩, ⟨1138, 5629783007446016⟩, @@ -260,6 +271,7 @@ def densePatternSummaries10 : Array PatternSummary := ⟨1305, 11340364036202496⟩] /-- Shallow PatternSummary group 11. -/ +@[expose] def densePatternSummaries11 : Array PatternSummary := #[⟨1307, 11342562562408448⟩, ⟨1316, 11356169213837312⟩, ⟨1317, 11356169750708224⟩, ⟨1321, 11901114429497344⟩, ⟨1322, 11901114966353920⟩, ⟨1323, 11901114966368256⟩, @@ -282,6 +294,7 @@ def densePatternSummaries11 : Array PatternSummary := ⟨1474, 14333178282012⟩, ⟨1485, 19954418066710⟩, ⟨1489, 19971597936922⟩] /-- Shallow PatternSummary group 12. -/ +@[expose] def densePatternSummaries12 : Array PatternSummary := #[⟨1492, 20890724147478⟩, ⟨1494, 20891543019802⟩, ⟨1505, 22162034982940⟩, ⟨1506, 22166329884700⟩, ⟨1507, 22179213803548⟩, ⟨1508, 22183508705308⟩, ⟨1511, 23089831739420⟩, @@ -304,6 +317,7 @@ def densePatternSummaries12 : Array PatternSummary := ⟨1732, 3377701151834140⟩, ⟨1736, 3659175787775246⟩, ⟨1739, 3659196177842204⟩] /-- Shallow PatternSummary group 13. -/ +@[expose] def densePatternSummaries13 : Array PatternSummary := #[⟨1740, 3659214761230364⟩, ⟨1751, 5066850228520214⟩, ⟨1756, 5066871703357466⟩, ⟨1758, 5348024562827542⟩, ⟨1760, 5348025916473626⟩, ⟨1768, 5629787302395926⟩, @@ -329,6 +343,7 @@ def densePatternSummaries13 : Array PatternSummary := ⟨2108, 1369094879711330330⟩] /-- Shallow PatternSummary group 14. -/ +@[expose] def densePatternSummaries14 : Array PatternSummary := #[⟨2110, 1441152443408842774⟩, ⟨2111, 1441152456292761622⟩, ⟨2114, 1441152469179039772⟩, ⟨2120, 1729382822000459802⟩, ⟨2122, 1729382830623948828⟩, ⟨2123, 1729382851813572634⟩, @@ -352,6 +367,7 @@ def densePatternSummaries14 : Array PatternSummary := ⟨2467, 5497610710030⟩, ⟨2470, 5497644786702⟩, ⟨2502, 6597122729230⟩, ⟨2503, 6597122731022⟩] /-- Shallow PatternSummary group 15. -/ +@[expose] def densePatternSummaries15 : Array PatternSummary := #[⟨2512, 6609957823766⟩, ⟨2546, 9896175283214⟩, ⟨2554, 9896211456262⟩, ⟨2582, 10995670526990⟩, ⟨2612, 12095234516230⟩, ⟨2635, 13216423346204⟩, ⟨2654, 14294207046670⟩, ⟨2673, 18833433830678⟩, @@ -375,6 +391,7 @@ def densePatternSummaries15 : Array PatternSummary := ⟨3968, 433752939123884294⟩, ⟨3997, 720585838701879562⟩] /-- Shallow PatternSummary group 16. -/ +@[expose] def densePatternSummaries16 : Array PatternSummary := #[⟨4003, 723109218424504586⟩, ⟨4009, 731914107002871808⟩, ⟨4010, 731914107539742720⟩, ⟨4041, 936748724665877518⟩, ⟨4060, 1297056080165118226⟩, ⟨4066, 1301822600510488850⟩, @@ -400,6 +417,7 @@ def densePatternSummaries16 : Array PatternSummary := ⟨4331, 5233756715295467520⟩] /-- Shallow PatternSummary group 17. -/ +@[expose] def densePatternSummaries17 : Array PatternSummary := #[⟨4332, 5234321864278933504⟩, ⟨4333, 5235507137270016000⟩, ⟨4335, 5235522977109377024⟩, ⟨4342, 5802985736688893952⟩, ⟨4344, 5803170454122266648⟩, ⟨4355, 5805140522122608640⟩, @@ -423,6 +441,7 @@ def densePatternSummaries17 : Array PatternSummary := ⟨5238, 9570150835776524⟩] /-- Shallow PatternSummary group 18. -/ +@[expose] def densePatternSummaries18 : Array PatternSummary := #[⟨5242, 9570170690494738⟩, ⟨5263, 9649314666138638⟩, ⟨5291, 9663629171376406⟩, ⟨5301, 10133099218299916⟩, ⟨5315, 10205666933812238⟩, ⟨5410, 11259000696040460⟩, @@ -446,6 +465,7 @@ def densePatternSummaries18 : Array PatternSummary := ⟨6659, 7036875513660702⟩] /-- Shallow PatternSummary group 19. -/ +@[expose] def densePatternSummaries19 : Array PatternSummary := #[⟨6662, 7037153590856734⟩, ⟨6697, 9646015560838158⟩, ⟨6732, 9654812157174798⟩, ⟨6760, 9663749430469654⟩, ⟨6884, 10224358634037526⟩, ⟨6907, 10696050746731786⟩, @@ -470,6 +490,7 @@ def densePatternSummaries19 : Array PatternSummary := ⟨8450, 13583693067657502⟩, ⟨8533, 14637008314066186⟩, ⟨8561, 432345603193340190⟩] /-- Shallow PatternSummary group 20. -/ +@[expose] def densePatternSummaries20 : Array PatternSummary := #[⟨8563, 432345607472054558⟩, ⟨8578, 720575964103475486⟩, ⟨8603, 1297037268292895006⟩, ⟨8613, 1441172359171615758⟩, ⟨8622, 2450103333113331998⟩, ⟨8654, 2603854640815098894⟩, @@ -495,6 +516,7 @@ def densePatternSummaries20 : Array PatternSummary := ⟨10716, 5233270876129132574⟩] /-- Shallow PatternSummary group 21. -/ +@[expose] def densePatternSummaries21 : Array PatternSummary := #[⟨10746, 5809716641126755358⟩, ⟨10772, 6954279246022396958⟩, ⟨10773, 6954279246105693214⟩, ⟨10786, 6958204639972502558⟩, ⟨10787, 6958204640055798814⟩, ⟨10924, 2885263662928446486⟩, @@ -504,6 +526,7 @@ def densePatternSummaries21 : Array PatternSummary := ⟨10982, 5809715571966682382⟩, ⟨10984, 5809716671493514510⟩] /-- Shallow HardSummary group 0. -/ +@[expose] def denseHardSummaries00 : Array HardSummary := #[⟨0, 8697799730556775710⟩, ⟨1, 8697795349690133790⟩, ⟨2, 8410689778228604190⟩, ⟨3, 8693859081117707550⟩, ⟨4, 7397959300637994270⟩, ⟨5, 7684223732869704990⟩, @@ -529,6 +552,7 @@ def denseHardSummaries00 : Array HardSummary := ⟨63, 7395988974230580510⟩] /-- Shallow HardSummary group 1. -/ +@[expose] def denseHardSummaries01 : Array HardSummary := #[⟨64, 8400275203023187230⟩, ⟨65, 6166495397074709790⟩, ⟨66, 5157689080778599710⟩, ⟨67, 5162203559574908190⟩, ⟨68, 5442550540468235550⟩, ⟨69, 5155446064223366430⟩, @@ -554,6 +578,7 @@ def denseHardSummaries01 : Array HardSummary := ⟨687, 6453032278568428830⟩] /-- Shallow HardSummary group 2. -/ +@[expose] def denseHardSummaries02 : Array HardSummary := #[⟨688, 5446478027099301150⟩, ⟨689, 6020686714341254430⟩, ⟨690, 8695556580571833630⟩, ⟨691, 8262373201368802590⟩, ⟨692, 8693867756481373470⟩, ⟨693, 8694645099340719390⟩, @@ -579,6 +604,7 @@ def denseHardSummaries02 : Array HardSummary := ⟨751, 7680143312584008990⟩] /-- Shallow HardSummary group 3. -/ +@[expose] def denseHardSummaries03 : Array HardSummary := #[⟨752, 4147201482135594270⟩, ⟨753, 8230831648747971870⟩, ⟨754, 8661485077465294110⟩, ⟨755, 3714723978626622750⟩, ⟨756, 8694980340888986910⟩, ⟨757, 6453032276462757150⟩, @@ -604,6 +630,7 @@ def denseHardSummaries03 : Array HardSummary := ⟨815, 4155289489154008350⟩] /-- Shallow HardSummary group 4. -/ +@[expose] def denseHardSummaries04 : Array HardSummary := #[⟨816, 4147062961727366430⟩, ⟨817, 3714723994569565470⟩, ⟨818, 3714161053206078750⟩, ⟨819, 5420526133700486430⟩, ⟨820, 6427636857809429790⟩, ⟨821, 5996980143442126110⟩, @@ -629,6 +656,7 @@ def denseHardSummaries04 : Array HardSummary := ⟨1031, 3871062447718886430⟩] /-- Shallow HardSummary group 5. -/ +@[expose] def denseHardSummaries05 : Array HardSummary := #[⟨1032, 5420594277881441310⟩, ⟨1033, 5419406806330076190⟩, ⟨1034, 3713174884401638430⟩, ⟨1035, 5446490936687815710⟩, ⟨1036, 5455147529172249630⟩, ⟨1037, 8189464194495114270⟩, @@ -654,6 +682,7 @@ def denseHardSummaries05 : Array HardSummary := ⟨1095, 5446477729664363550⟩] /-- Shallow HardSummary group 6. -/ +@[expose] def denseHardSummaries06 : Array HardSummary := #[⟨1096, 5450925404522572830⟩, ⟨1097, 5162695045550730270⟩, ⟨1098, 5131229325436677150⟩, ⟨1099, 5131238018718919710⟩, ⟨1100, 8181864353213475870⟩, ⟨1101, 8184107220032056350⟩, @@ -679,6 +708,7 @@ def denseHardSummaries06 : Array HardSummary := ⟨1159, 6175166435649285150⟩] /-- Shallow HardSummary group 7. -/ +@[expose] def denseHardSummaries07 : Array HardSummary := #[⟨1160, 3871005816665041950⟩, ⟨1161, 3726892827612441630⟩, ⟨1162, 4158040199043640350⟩, ⟨1163, 3866783692266040350⟩, ⟨1164, 3722670703213440030⟩, ⟨1165, 4153385690690841630⟩, @@ -704,6 +734,7 @@ def denseHardSummaries07 : Array HardSummary := ⟨1223, 2851717181477514270⟩] /-- Shallow HardSummary group 8. -/ +@[expose] def denseHardSummaries08 : Array HardSummary := #[⟨1224, 6139399885039365150⟩, ⟨1225, 5995847646916930590⟩, ⟨1226, 5131169712601328670⟩, ⟨1227, 5991922390405770270⟩, ⟨1228, 5130608961671162910⟩, ⟨1229, 2860161297651624990⟩, @@ -729,6 +760,7 @@ def denseHardSummaries08 : Array HardSummary := ⟨1287, 2858261605449231390⟩] /-- Shallow HardSummary group 9. -/ +@[expose] def denseHardSummaries09 : Array HardSummary := #[⟨1288, 3140075081450941470⟩, ⟨1289, 2851844722479098910⟩, ⟨1290, 5130667230218972190⟩, ⟨1291, 5130666135002311710⟩, ⟨1292, 2858189038789094430⟩, ⟨1293, 2857907568107351070⟩, @@ -754,6 +786,7 @@ def denseHardSummaries09 : Array HardSummary := ⟨5407, 3284630213168390430⟩] /-- Shallow HardSummary group 10. -/ +@[expose] def denseHardSummaries10 : Array HardSummary := #[⟨5408, 6141095451432771870⟩, ⟨5409, 6425956923956977950⟩, ⟨5410, 5564643495222370590⟩, ⟨5411, 6137730945851777310⟩, ⟨5412, 5563521993362039070⟩, ⟨5413, 5132297956764606750⟩, @@ -779,6 +812,7 @@ def denseHardSummaries10 : Array HardSummary := ⟨5471, 5132289015213646110⟩] /-- Shallow HardSummary group 11. -/ +@[expose] def denseHardSummaries11 : Array HardSummary := #[⟨5472, 6164806280117018910⟩, ⟨5473, 3867059112994464030⟩, ⟨5474, 5590605597368705310⟩, ⟨5475, 3858832585567822110⟩, ⟨5476, 5560702845549338910⟩, ⟨5477, 3292858430246150430⟩, @@ -804,6 +838,7 @@ def denseHardSummaries11 : Array HardSummary := ⟨5535, 6453036381428179230⟩] /-- Shallow HardSummary group 12. -/ +@[expose] def denseHardSummaries12 : Array HardSummary := #[⟨5536, 5591722952693571870⟩, ⟨5537, 7825369142209470750⟩, ⟨5538, 4149447388533285150⟩, ⟨5539, 7797307423927230750⟩, ⟨5540, 3281954687505588510⟩, ⟨5541, 8659170591530737950⟩, @@ -829,6 +864,7 @@ def denseHardSummaries12 : Array HardSummary := ⟨5599, 3870928982686490910⟩] /-- Shallow HardSummary group 13. -/ +@[expose] def denseHardSummaries13 : Array HardSummary := #[⟨5600, 8688942511618187550⟩, ⟨5601, 8373204691001729310⟩, ⟨5602, 8230703860873355550⟩, ⟨5603, 8229582359013024030⟩, ⟨5604, 8401831412735074590⟩, ⟨5605, 4149307735173423390⟩, @@ -854,6 +890,7 @@ def denseHardSummaries13 : Array HardSummary := ⟨5663, 3858262609255522590⟩] /-- Shallow HardSummary group 14. -/ +@[expose] def denseHardSummaries14 : Array HardSummary := #[⟨5664, 6164798601768330270⟩, ⟨5665, 5590589649278592030⟩, ⟨5666, 6164798327964165150⟩, ⟨5667, 5590589375474426910⟩, ⟨5668, 3865088805855421470⟩, ⟨5669, 3288636849645020190⟩, @@ -879,6 +916,7 @@ def denseHardSummaries14 : Array HardSummary := ⟨5727, 5598408814949360670⟩] /-- Shallow HardSummary group 15. -/ +@[expose] def denseHardSummaries15 : Array HardSummary := #[⟨5728, 3292495849308349470⟩, ⟨5729, 3858823622709273630⟩, ⟨5730, 3284614670219535390⟩, ⟨5731, 2852269131761771550⟩, ⟨5732, 7148705516495692830⟩, ⟨5733, 7146462512775029790⟩, @@ -904,6 +942,7 @@ def denseHardSummaries15 : Array HardSummary := ⟨5791, 8182278732413199390⟩] /-- Shallow HardSummary group 16. -/ +@[expose] def denseHardSummaries16 : Array HardSummary := #[⟨5792, 8155327640832107550⟩, ⟨5793, 6137715128029209630⟩, ⟨5794, 5563506175539471390⟩, ⟨5795, 6136026303938749470⟩, ⟨5796, 8661431066944988190⟩, ⟨5797, 3726877582424663070⟩, @@ -929,7 +968,7 @@ def denseHardSummaries16 : Array HardSummary := ⟨5855, 3858256025070658590⟩] /-- Pattern summaries indexed by compact certificate identifier. -/ -def densePatternSummaryGroups : Array (Array PatternSummary) := +@[expose] def densePatternSummaryGroups : Array (Array PatternSummary) := #[densePatternSummaries00, densePatternSummaries01, densePatternSummaries02, densePatternSummaries03, densePatternSummaries04, densePatternSummaries05, densePatternSummaries06, densePatternSummaries07, densePatternSummaries08, @@ -940,7 +979,7 @@ def densePatternSummaryGroups : Array (Array PatternSummary) := densePatternSummaries21] /-- Exact summaries indexed by compact certificate identifier. -/ -def denseHardSummaryGroups : Array (Array HardSummary) := +@[expose] def denseHardSummaryGroups : Array (Array HardSummary) := #[denseHardSummaries00, denseHardSummaries01, denseHardSummaries02, denseHardSummaries03, denseHardSummaries04, denseHardSummaries05, denseHardSummaries06, denseHardSummaries07, denseHardSummaries08, denseHardSummaries09, denseHardSummaries10, denseHardSummaries11, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSupportSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSupportSoundness.lean index ec8ce8b739..00a19ab100 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSupportSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateSupportSoundness.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Support lemmas for compact coverage certificates -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateValidity.lean b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateValidity.lean index 51b91f0d31..264ef28a16 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageCertificateValidity.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageCertificateValidity.lean @@ -107,7 +107,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Assembled coverage-certificate validity facts -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData00.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData00.lean index 16b468be4d..085409e22f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData00.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData00.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 0–7 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets00 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets00 : Array (List PatternEntry) := #[ [ ⟨0, 7196, .sharedThree 0 1 2 3 4⟩, ⟨1280, 11272194355625984, .k4 2 [2, 3, 5, 6] 2 3 5 6⟩, @@ -88,7 +88,7 @@ def patternBuckets00 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets00 : Array (List HardEntry) := #[ +@[expose] def hardBuckets00 : Array (List HardEntry) := #[ [ ⟨0, 8697799730556775710, .cycleStrip 0 [0, 1, 2, 3, 4, 5, 6, 7] 0 1 3 5 7 6 4⟩, ⟨768, 6020701831342613790, .residual 104390639921009⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData01.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData01.lean index 9e86bb3117..2583e59f9e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData01.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData01.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 8–15 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets01 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets01 : Array (List PatternEntry) := #[ [ ⟨520, 11550371277176832, .k4 3 [3, 5, 6] 0 3 5 6⟩, ⟨1288, 11331567406311424, .k4 1 [1, 3, 5, 6] 1 3 5 6⟩, @@ -67,7 +67,7 @@ def patternBuckets01 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets01 : Array (List HardEntry) := #[ +@[expose] def hardBuckets01 : Array (List HardEntry) := #[ [ ⟨8, 8697799730289388830, .hubPentagon 0 [0, 1, 2, 3, 4, 5, 6, 7] 2 0 1 5 6 4⟩, ⟨776, 8266581603606816030, .residual 3916658220028291⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData02.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData02.lean index 14b21a6402..1d05efb3a9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData02.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData02.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 16–23 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets02 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets02 : Array (List PatternEntry) := #[ [ ⟨784, 12886017302, .k4 0 [0, 1, 2, 4] 0 1 2 4⟩, ⟨1040, 2533555322224664, .k4 0 [0, 3, 4, 6] 0 3 4 6⟩, @@ -74,7 +74,7 @@ def patternBuckets02 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets02 : Array (List HardEntry) := #[ +@[expose] def hardBuckets02 : Array (List HardEntry) := #[ [ ⟨16, 7397963681003285790, .residual 3918988239981699⟩, ⟨784, 8693728118512968990, .hubPentagon 0 [0, 1, 3, 4, 2, 5, 6, 7] 0 1 2 3 4 5⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData03.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData03.lean index 18fbf7852a..27bff2b1e5 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData03.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData03.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 24–31 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets03 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets03 : Array (List PatternEntry) := #[ [ ⟨24, 1157645568, .sharedThree 1 3 0 2 6⟩, ⟨1560, 79165414075392, .k4 1 [1, 2, 3, 5] 1 2 5 6⟩, @@ -73,7 +73,7 @@ def patternBuckets03 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets03 : Array (List HardEntry) := #[ +@[expose] def hardBuckets03 : Array (List HardEntry) := #[ [ ⟨24, 7184589160277617950, .residual 226406619532019⟩, ⟨792, 5420528452980860190, .residual 711896337513425⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData04.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData04.lean index 354de2c58a..46ba252cf3 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData04.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData04.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 32–39 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets04 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets04 : Array (List PatternEntry) := #[ [ ⟨32, 1886388224, .sharedThree 2 3 4 5 6⟩, ⟨288, 30064772374, .k4 0 [0, 1, 4] 0 1 2 4⟩, @@ -73,7 +73,7 @@ def patternBuckets04 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets04 : Array (List HardEntry) := #[ +@[expose] def hardBuckets04 : Array (List HardEntry) := #[ [ ⟨32, 5442549446321122590, .residual 3124966165754280⟩, ⟨800, 6028513861510391070, .residual 4350117082851461⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData05.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData05.lean index da5df8834e..f180ad4734 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData05.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData05.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 40–47 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets05 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets05 : Array (List PatternEntry) := #[ [ ⟨40, 2751505408, .sharedThree 1 3 2 5 7⟩, ⟨296, 47244642586, .k4 0 [0, 1, 4] 0 1 3 4⟩, @@ -80,7 +80,7 @@ def patternBuckets05 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets05 : Array (List HardEntry) := #[ +@[expose] def hardBuckets05 : Array (List HardEntry) := #[ [ ⟨40, 8697794253403925790, .residual 3919108499073158⟩, ⟨808, 5420526108165039390, .residual 128355992864626⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData06.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData06.lean index 06945f3d3d..1b6eacb7ba 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData06.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData06.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 48–55 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets06 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets06 : Array (List PatternEntry) := #[ [ ⟨48, 3503292416, .sharedThree 2 3 4 6 7⟩, ⟨304, 55918460956, .k4 0 [0, 3, 4] 0 2 3 4⟩, @@ -73,7 +73,7 @@ def patternBuckets06 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets06 : Array (List HardEntry) := #[ +@[expose] def hardBuckets06 : Array (List HardEntry) := #[ [ ⟨48, 8410690872108330270, .cycleStrip 0 [0, 1, 2, 3, 4, 5, 7, 6] 0 1 2 5 7 6 4⟩, ⟨816, 4147062961727366430, .residual 4189975189770273⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData07.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData07.lean index a867ee1bec..68d930a002 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData07.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData07.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 56–63 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets07 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets07 : Array (List PatternEntry) := #[ [ ⟨56, 176093669632, .sharedThree 1 4 0 3 5⟩, ⟨312, 163212043264, .k4 1 [1, 2, 4] 1 2 4 5⟩, @@ -80,7 +80,7 @@ def patternBuckets07 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets07 : Array (List HardEntry) := #[ +@[expose] def hardBuckets07 : Array (List HardEntry) := #[ [ ⟨56, 6020124028603280670, .residual 3919108499073152⟩, ⟨1080, 6425463230137789470, .residual 2983815835859488⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData08.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData08.lean index 699fa9fd15..15e78bcdb9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData08.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData08.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 64–71 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets08 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets08 : Array (List PatternEntry) := #[ [ ⟨64, 416611852544, .sharedThree 1 4 0 5 6⟩, ⟨832, 3299122094346, .k4 0 [0, 1, 3, 5] 0 1 3 5⟩, @@ -68,7 +68,7 @@ def patternBuckets08 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets08 : Array (List HardEntry) := #[ +@[expose] def hardBuckets08 : Array (List HardEntry) := #[ [ ⟨64, 8400275203023187230, .residual 779325855812563⟩, ⟨1088, 6459722501419330590, .residual 933047028627393⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData09.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData09.lean index f568ff7f73..e0c13e0c8a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData09.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData09.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 72–79 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets09 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets09 : Array (List PatternEntry) := #[ [ ⟨584, 39406498967191552, .k4 2 [2, 3, 6] 2 3 6 7⟩, ⟨840, 5497560441094, .k4 0 [0, 1, 2, 5] 0 1 2 5⟩, @@ -74,7 +74,7 @@ def patternBuckets09 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets09 : Array (List HardEntry) := #[ +@[expose] def hardBuckets09 : Array (List HardEntry) := #[ [ ⟨72, 7395849338384559390, .residual 1988157039375808⟩, ⟨1096, 5450925404522572830, .residual 4346719763574277⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData10.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData10.lean index 3c480aa9f6..6bb20745b9 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData10.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData10.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 80–87 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets10 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets10 : Array (List PatternEntry) := #[ [ ⟨80, 691500285952, .sharedThree 2 4 0 5 7⟩, ⟨1104, 4785370962067476, .k4 0 [0, 4, 2, 6] 0 2 4 6⟩, @@ -76,7 +76,7 @@ def patternBuckets10 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets10 : Array (List HardEntry) := #[ +@[expose] def hardBuckets10 : Array (List HardEntry) := #[ [ ⟨80, 7181721629143215390, .residual 1434001270554048⟩, ⟨1104, 3865150934157388830, .residual 2466098654466387⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData11.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData11.lean index 45832b7faf..d64f40a203 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData11.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData11.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 88–95 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets11 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets11 : Array (List PatternEntry) := #[ [ ⟨88, 828928737536, .sharedThree 1 4 0 6 7⟩, ⟨600, 42784784065232896, .k4 3 [3, 4, 6] 3 4 6 7⟩, @@ -71,7 +71,7 @@ def patternBuckets11 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets11 : Array (List HardEntry) := #[ +@[expose] def hardBuckets11 : Array (List HardEntry) := #[ [ ⟨88, 6028848096049900830, .residual 3918988239981697⟩, ⟨1112, 3858394538300697630, .residual 831277788613556⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData12.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData12.lean index 7ec91d2951..0cc0103cc4 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData12.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData12.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 96–103 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets12 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets12 : Array (List PatternEntry) := #[ [ ⟨96, 859006566400, .sharedThree 2 4 3 6 7⟩, ⟨608, 45741882738794496, .k4 1 [1, 5, 6] 1 5 6 7⟩, @@ -76,7 +76,7 @@ def patternBuckets12 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets12 : Array (List HardEntry) := #[ +@[expose] def hardBuckets12 : Array (List HardEntry) := #[ [ ⟨96, 6028799718126071070, .residual 4411689737676930⟩, ⟨1120, 2852278069844536350, .residual 4170004660737221⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData13.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData13.lean index 13959d1407..ccc99c304b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData13.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData13.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 104–111 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets13 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets13 : Array (List PatternEntry) := #[ [ ⟨104, 73667283451904, .sharedThree 2 5 0 1 6⟩, ⟨616, 47437333426864128, .k4 3 [3, 5, 6] 3 5 6 7⟩, @@ -79,7 +79,7 @@ def patternBuckets13 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets13 : Array (List HardEntry) := #[ +@[expose] def hardBuckets13 : Array (List HardEntry) := #[ [ ⟨104, 6170944581331856670, .residual 3911289779080210⟩, ⟨1128, 5131237749192944670, .residual 3793753402863879⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData14.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData14.lean index 55b0a83055..e799a87c20 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData14.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData14.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 112–119 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets14 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets14 : Array (List PatternEntry) := #[ [ ⟨112, 80577881440256, .sharedThree 4 5 0 3 6⟩, ⟨1392, 216173344754532626, .k4 0 [0, 1, 4, 7] 0 1 4 7⟩, @@ -87,7 +87,7 @@ def patternBuckets14 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets14 : Array (List HardEntry) := #[ +@[expose] def hardBuckets14 : Array (List HardEntry) := #[ [ ⟨1136, 3140087176546053150, .residual 1704648176168674⟩, ⟨5488, 5128989379177079070, .residual 201441638627824⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData15.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData15.lean index 690414996d..bc3779f8ea 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData15.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData15.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 120–127 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets15 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets15 : Array (List PatternEntry) := #[ [ ⟨120, 146237277863936, .sharedThree 3 5 0 2 7⟩, ⟨632, 1513209474805989396, .k4 0 [0, 2, 7] 0 2 4 7⟩, @@ -74,7 +74,7 @@ def patternBuckets15 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets15 : Array (List HardEntry) := #[ +@[expose] def hardBuckets15 : Array (List HardEntry) := #[ [ ⟨1144, 7149908365073280030, .residual 1886795562547506⟩, ⟨5496, 8686693566026277150, .residual 3917034029789442⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData16.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData16.lean index 0bc84bc041..8ca837715d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData16.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData16.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 128–135 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets16 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets16 : Array (List PatternEntry) := #[ [ ⟨128, 212205744210176, .sharedThree 1 5 0 6 7⟩, ⟨384, 72567773881344, .k4 1 [1, 2, 5] 1 2 5 6⟩, @@ -82,7 +82,7 @@ def patternBuckets16 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets16 : Array (List HardEntry) := #[ +@[expose] def hardBuckets16 : Array (List HardEntry) := #[ [ ⟨1152, 4158110292926622750, .residual 3363586684062080⟩, ⟨5504, 3285751713959174430, .residual 2675625636094546⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData17.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData17.lean index 2bbbd96891..b418bf3017 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData17.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData17.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 136–143 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets17 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets17 : Array (List PatternEntry) := #[ [ ⟨136, 215507567378432, .sharedThree 3 5 2 6 7⟩, ⟨648, 2594236817460953088, .k4 4 [4, 5, 7] 2 4 5 7⟩, @@ -77,7 +77,7 @@ def patternBuckets17 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets17 : Array (List HardEntry) := #[ +@[expose] def hardBuckets17 : Array (List HardEntry) := #[ [ ⟨1160, 3871005816665041950, .residual 4348869394664713⟩, ⟨5512, 4145376318603321630, .residual 1994389914580002⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData18.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData18.lean index d0a234d1de..774dff2a8a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData18.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData18.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 144–151 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets18 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets18 : Array (List PatternEntry) := #[ [ ⟨144, 3940649673949198, .sharedThree 0 6 1 2 3⟩, ⟨400, 81365504647168, .k4 1 [1, 5, 3] 1 3 5 6⟩, @@ -77,7 +77,7 @@ def patternBuckets18 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets18 : Array (List HardEntry) := #[ +@[expose] def hardBuckets18 : Array (List HardEntry) := #[ [ ⟨1168, 3722585502941015070, .residual 2771150958996673⟩, ⟨5520, 8371515816107761950, .residual 3363706943147266⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData19.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData19.lean index 7b77df8af9..5d296afbeb 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData19.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData19.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 152–159 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets19 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets19 : Array (List PatternEntry) := #[ [ ⟨664, 3026418952310923264, .k4 1 [1, 7, 3] 1 3 5 7⟩, ⟨920, 18842021536018, .k4 0 [0, 1, 4, 5] 0 1 4 5⟩, @@ -74,7 +74,7 @@ def patternBuckets19 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets19 : Array (List HardEntry) := #[ +@[expose] def hardBuckets19 : Array (List HardEntry) := #[ [ ⟨1176, 5456328253332679710, .residual 3915711179795969⟩, ⟨5528, 6425956512181182750, .residual 1479511857372754⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData20.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData20.lean index 2b04c717bc..776c059209 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData20.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData20.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 160–167 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets20 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets20 : Array (List PatternEntry) := #[ [ ⟨160, 36873221957681152, .sharedThree 2 6 0 1 7⟩, ⟨416, 97068139937792, .k4 3 [3, 4, 5] 3 4 5 6⟩, @@ -75,7 +75,7 @@ def patternBuckets20 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets20 : Array (List HardEntry) := #[ +@[expose] def hardBuckets20 : Array (List HardEntry) := #[ [ ⟨672, 8697238970799187230, .hubPentagon 0 [0, 1, 2, 3, 4, 6, 5, 7] 1 0 2 5 6 4⟩, ⟨1184, 4146624913950796830, .residual 1003398607615937⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData21.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData21.lean index 9cf57d1aa2..42c958710c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData21.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData21.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 168–175 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets21 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets21 : Array (List PatternEntry) := #[ [ ⟨424, 145138297339904, .k4 2 [2, 3, 5] 2 3 5 7⟩, ⟨2216, 3474747736396398592, .k4 4 [4, 7, 5, 6] 3 4 5 6⟩, @@ -75,7 +75,7 @@ def patternBuckets21 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets21 : Array (List HardEntry) := #[ +@[expose] def hardBuckets21 : Array (List HardEntry) := #[ [ ⟨680, 8694995735922566430, .hubPentagon 0 [0, 1, 2, 3, 4, 6, 5, 7] 1 0 2 5 6 3⟩, ⟨1192, 7148788942262922270, .residual 1557451065360065⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData22.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData22.lean index 2b10930dde..8c8567b3e3 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData22.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData22.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 176–183 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets22 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets22 : Array (List PatternEntry) := #[ [ ⟨176, 45317471250456832, .sharedThree 1 6 0 5 7⟩, ⟨432, 150258088673280, .k4 3 [3, 4, 5] 3 4 5 7⟩, @@ -76,7 +76,7 @@ def patternBuckets22 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets22 : Array (List HardEntry) := #[ +@[expose] def hardBuckets22 : Array (List HardEntry) := #[ [ ⟨688, 5446478027099301150, .residual 1180592915422816⟩, ⟨1200, 8190520808261053470, .residual 3340489419434384⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData23.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData23.lean index c22f7005bf..023c7a398f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData23.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData23.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 184–191 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets23 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets23 : Array (List PatternEntry) := #[ [ ⟨440, 153934389837824, .k4 2 [2, 5, 3] 2 3 5 7⟩, ⟨696, 4035383598751154176, .k4 3 [3, 7, 5] 3 4 5 7⟩, @@ -65,7 +65,7 @@ def patternBuckets23 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets23 : Array (List HardEntry) := #[ +@[expose] def hardBuckets23 : Array (List HardEntry) := #[ [ ⟨696, 3723520191431927070, .residual 4334705125450003⟩, ⟨1208, 3136570097621560350, .residual 3532334445632161⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData24.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData24.lean index 668f9eacc7..11e0a0a4b0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData24.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData24.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 192–199 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets24 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets24 : Array (List PatternEntry) := #[ [ ⟨192, 1008806316530991118, .sharedThree 0 7 1 2 3⟩, ⟨448, 163294668128256, .k4 2 [2, 4, 5] 2 4 5 7⟩, @@ -81,7 +81,7 @@ def patternBuckets24 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets24 : Array (List HardEntry) := #[ +@[expose] def hardBuckets24 : Array (List HardEntry) := #[ [ ⟨704, 3149311144688313630, .residual 4326046471266579⟩, ⟨1216, 8192763675079633950, .residual 1346452657004224⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData25.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData25.lean index 987dd3a65d..59f695df07 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData25.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData25.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 200–207 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets25 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets25 : Array (List PatternEntry) := #[ [ ⟨200, 2666130979403343104, .sharedThree 1 7 0 2 5⟩, ⟨712, 5044031582667686912, .k4 1 [1, 2, 7] 1 2 6 7⟩, @@ -72,7 +72,7 @@ def patternBuckets25 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets25 : Array (List HardEntry) := #[ +@[expose] def hardBuckets25 : Array (List HardEntry) := #[ [ ⟨712, 6022942919503668510, .residual 2400121526892880⟩, ⟨1224, 6139399885039365150, .residual 2912406333990722⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData26.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData26.lean index a5a4e350a0..d4b571d235 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData26.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData26.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 208–215 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets26 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets26 : Array (List PatternEntry) := #[ [ ⟨464, 1970324836992262, .k4 0 [0, 1, 6] 0 1 2 6⟩, ⟨720, 5227553267483410432, .k4 2 [2, 6, 7] 2 3 6 7⟩, @@ -78,7 +78,7 @@ def patternBuckets26 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets26 : Array (List HardEntry) := #[ +@[expose] def hardBuckets26 : Array (List HardEntry) := #[ [ ⟨720, 5452053504538993950, .residual 1452521171082801⟩, ⟨976, 6461210423826017310, .hubPentagon 0 [0, 2, 3, 4, 1, 5, 6, 7] 0 1 2 4 7 3⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData27.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData27.lean index b5d591c616..49e3b843ea 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData27.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData27.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 216–223 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets27 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets27 : Array (List PatternEntry) := #[ [ ⟨216, 4971973988617045248, .sharedThree 1 7 0 2 6⟩, ⟨472, 3659174702022668, .k4 0 [0, 2, 6] 0 2 3 6⟩, @@ -77,7 +77,7 @@ def patternBuckets27 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets27 : Array (List HardEntry) := #[ +@[expose] def hardBuckets27 : Array (List HardEntry) := #[ [ ⟨728, 3714855799054951710, .residual 1390963566763572⟩, ⟨984, 5166917172072115230, .residual 4408547969025538⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData28.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData28.lean index 863347f20c..b79af46b7b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData28.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData28.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 224–231 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets28 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets28 : Array (List PatternEntry) := #[ [ ⟨480, 5910974516232212, .k4 0 [0, 2, 6] 0 2 4 6⟩, ⟨736, 5764608385517355008, .k4 3 [3, 4, 7] 3 4 6 7⟩, @@ -85,7 +85,7 @@ def patternBuckets28 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets28 : Array (List HardEntry) := #[ +@[expose] def hardBuckets28 : Array (List HardEntry) := #[ [ ⟨736, 5997049396192830750, .residual 712033508203476⟩, ⟨992, 3714296387598904350, .residual 1836423914256852⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData29.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData29.lean index 133bb040a4..59fd28768b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData29.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData29.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 232–239 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets29 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets29 : Array (List PatternEntry) := #[ [ ⟨488, 9570149214610432, .k4 1 [1, 2, 6] 1 2 5 6⟩, ⟨744, 5945315291306131456, .k4 4 [4, 7, 6] 1 4 6 7⟩, @@ -76,7 +76,7 @@ def patternBuckets29 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets29 : Array (List HardEntry) := #[ +@[expose] def hardBuckets29 : Array (List HardEntry) := #[ [ ⟨744, 7689008565333484830, .residual 3362519384732035⟩, ⟨1000, 6172702974236912670, .residual 739416805833664⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData30.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData30.lean index a8e2f7ed31..4050ac7a29 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData30.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData30.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 240–247 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets30 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets30 : Array (List PatternEntry) := #[ [ ⟨240, 593166, .k4 0 [0, 1, 2] 0 1 2 3⟩, ⟨752, 6341068588064964608, .k4 3 [3, 4, 7] 3 4 6 7⟩, @@ -78,7 +78,7 @@ def patternBuckets30 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets30 : Array (List HardEntry) := #[ +@[expose] def hardBuckets30 : Array (List HardEntry) := #[ [ ⟨752, 4147201482135594270, .residual 1252425101647666⟩, ⟨1008, 5163820946576993310, .residual 4346855055058437⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageData31.lean b/LeanPool/Erdos97ConvexOctagon/CoverageData31.lean index a546addf03..d0b20b270e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageData31.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageData31.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageDataTypes /-! # Coverage certificate data, buckets 248–255 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Generated monotone-obstruction entries for this hash-bucket group. -/ -def patternBuckets31 : Array (List PatternEntry) := #[ +@[expose] def patternBuckets31 : Array (List PatternEntry) := #[ [ ⟨248, 51052558, .k4 0 [0, 2, 3] 0 1 2 3⟩, ⟨760, 7034975561185230848, .k4 5 [5, 6, 7] 0 5 6 7⟩, @@ -88,7 +88,7 @@ def patternBuckets31 : Array (List PatternEntry) := #[ ] /-- Generated exact-table entries for this hash-bucket group. -/ -def hardBuckets31 : Array (List HardEntry) := #[ +@[expose] def hardBuckets31 : Array (List HardEntry) := #[ [ ⟨760, 4149444092129076510, .residual 1253507433520946⟩, ⟨1016, 6459803068812979230, .residual 809648111079360⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageDataTypes.lean b/LeanPool/Erdos97ConvexOctagon/CoverageDataTypes.lean index da2b0962bd..18af58af54 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageDataTypes.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageDataTypes.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.PackedCertificates /-! # Erdős 97 convex-octagon formalization: Coverage Data Types -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence @@ -32,11 +32,11 @@ structure HardEntry where certificate : Certificate /-- Validate a pattern witness against precisely its required incidences. -/ -def PatternEntry.validB (entry : PatternEntry) : Bool := +@[expose] def PatternEntry.validB (entry : PatternEntry) : Bool := entry.certificate.toCertificate.validPackedB entry.mask /-- Validate an exact-table witness against its decoded incidence table. -/ -def HardEntry.validB (entry : HardEntry) : Bool := +@[expose] def HardEntry.validB (entry : HardEntry) : Bool := entry.certificate.validPackedB entry.code /-- A successful pattern audit supplies its mathematical witness. -/ diff --git a/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMaskSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMaskSoundness.lean index 95138ac447..647c6d2110 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMaskSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMaskSoundness.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Soundness of the transposed legal-row pair masks -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence diff --git a/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMasks.lean b/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMasks.lean index e43ab604d4..73450758ff 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMasks.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoveragePairRowIndexMasks.lean @@ -12,11 +12,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Precomputed legal-row index masks for bulk pair pruning -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- For each centre and packed pair bit, legal-row indices containing that pair. -/ +@[expose] def pairRowIndexMasks : Array (Array UInt64) := #[ #[ 0, 0, 0, 0, @@ -165,6 +166,7 @@ def pairRowIndexMasks : Array (Array UInt64) := #[ ] /-- Set-bit positions for each five-bit word. -/ +@[expose] def fiveBitIndices : Array (List Nat) := #[ [], [0], diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSearchCore.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSearchCore.lean index 779cffc5ed..9ac98434ea 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSearchCore.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSearchCore.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Lightweight state for finite coverage search -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage @@ -28,14 +28,14 @@ structure PairState where seenTwice : UInt64 /-- The empty pair-occurrence state. -/ -def PairState.empty : PairState := ⟨0, 0⟩ +@[expose] def PairState.empty : PairState := ⟨0, 0⟩ /-- Whether adding a row preserves pair sparsity. -/ -def PairState.compatible (state : PairState) (pairMask : UInt64) : Bool := +@[expose] def PairState.compatible (state : PairState) (pairMask : UInt64) : Bool := (state.seenTwice &&& pairMask) == 0 /-- Update pair occurrences after accepting one row. -/ -def PairState.add (state : PairState) (pairMask : UInt64) : PairState := +@[expose] def PairState.add (state : PairState) (pairMask : UInt64) : PairState := ⟨state.seenOnce ||| pairMask, state.seenTwice ||| (state.seenOnce &&& pairMask)⟩ @@ -45,41 +45,41 @@ structure ColumnState where counts : UInt64 /-- The empty column-count state. -/ -def ColumnState.empty : ColumnState := ⟨0⟩ +@[expose] def ColumnState.empty : ColumnState := ⟨0⟩ /-- Packed increments contributed by one target-row mask. -/ -def columnIncrements (row : UInt64) : UInt64 := +@[expose] def columnIncrements (row : UInt64) : UInt64 := (List.finRange 8).foldl (fun result target => if bitSetB row target.val then result + (1 <<< UInt64.ofNat (8 * target.val)) else result) 0 /-- Update packed column counts after accepting one row. -/ -def ColumnState.add (state : ColumnState) (row : UInt64) : ColumnState := +@[expose] def ColumnState.add (state : ColumnState) (row : UInt64) : ColumnState := ⟨state.counts + columnIncrements row⟩ /-- Read one packed column counter. -/ -def ColumnState.count (state : ColumnState) (target : Vertex) : Nat := +@[expose] def ColumnState.count (state : ColumnState) (target : Vertex) : Nat := ((state.counts >>> UInt64.ofNat (8 * target.val)) &&& 255).toNat /-- Number of remaining rows that can still select a target. -/ -def remainingColumnCapacity (remaining : List Vertex) (target : Vertex) : Nat := +@[expose] def remainingColumnCapacity (remaining : List Vertex) (target : Vertex) : Nat := (remaining.filter (· ≠ target)).length /-- Fast packed check that every column can still finish with exactly four entries. -/ -def ColumnState.feasible (state : ColumnState) (remaining : List Vertex) : Bool := +@[expose] def ColumnState.feasible (state : ColumnState) (remaining : List Vertex) : Bool := (List.finRange 8).all fun target => decide (state.count target ≤ 4) && decide (4 ≤ state.count target + remainingColumnCapacity remaining target) /-- Whether a target is selected by an assigned row. -/ -def selectedByAssignmentsB +@[expose] def selectedByAssignmentsB (assignments : List RowAssignment) (centre target : Vertex) : Bool := assignments.any fun assignment => (assignment.1 == centre) && bitSetB assignment.2 target.val /-- Number of assigned rows selecting one target, computed from the semantic prefix. -/ -def assignmentColumnCount +@[expose] def assignmentColumnCount (assignments : List RowAssignment) (target : Vertex) : Nat := (assignments.filter fun assignment => bitSetB assignment.2 target.val).length @@ -92,7 +92,7 @@ def columnFeasibleB remainingColumnCapacity remaining target) /-- Full semantic check that a packed pattern extends the assigned partial table. -/ -def patternExtendsAssignmentsB +@[expose] def patternExtendsAssignmentsB (assignments : List RowAssignment) (summary : PatternSummary) : Bool := (List.finRange 8).all fun centre => (List.finRange 8).all fun target => @@ -100,7 +100,7 @@ def patternExtendsAssignmentsB selectedByAssignmentsB assignments centre target /-- Full semantic check that an exact-table code equals all assigned rows. -/ -def hardEqualsAssignmentsB +@[expose] def hardEqualsAssignmentsB (assignments : List RowAssignment) (summary : HardSummary) : Bool := (List.finRange 8).all fun centre => (List.finRange 8).all fun target => @@ -108,6 +108,7 @@ def hardEqualsAssignmentsB selectedByAssignmentsB assignments centre target /-- Add one row to a packed 64-bit incidence-table prefix. -/ +@[expose] def addRowCode (code row : UInt64) (centre : Vertex) : UInt64 := code ||| ((row &&& 255) <<< UInt64.ofNat (8 * centre.val)) diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoiceSoundness.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoiceSoundness.lean index e710039c66..886ed22733 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoiceSoundness.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoiceSoundness.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! # Soundness and completeness of lightweight legal-row search data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- The lightweight choice at one legal-row index. -/ -def searchRowChoiceAt (centre : Vertex) (index : Fin 35) : SearchRowChoice := +@[expose] def searchRowChoiceAt (centre : Vertex) (index : Fin 35) : SearchRowChoice := (searchRowChoices.getD centre.val #[]).getD index.val ⟨0, 0⟩ /-- Each centre has exactly the expected 35 legal rows. -/ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoices.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoices.lean index 22db07e309..69f79bc11b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoices.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSearchRowChoices.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Lightweight legal-row search data -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence @@ -25,6 +25,7 @@ structure SearchRowChoice where pairMask : UInt64 /-- Packed search-row choices for vertex 0. -/ +@[expose] def searchRowChoices0 : Array SearchRowChoice := #[⟨30, 270015488⟩, ⟨46, 539503616⟩, ⟨78, 1078479872⟩, ⟨142, 2156432384⟩, ⟨54, 137442112512⟩, ⟨86, 274883171328⟩, ⟨150, 549765288960⟩, ⟨102, 70368750494720⟩, ⟨166, 140737498883072⟩, @@ -38,6 +39,7 @@ def searchRowChoices0 : Array SearchRowChoice := ⟨240, 36240865324171264⟩] /-- Packed search-row choices for vertex 1. -/ +@[expose] def searchRowChoices1 : Array SearchRowChoice := #[⟨29, 270008348⟩, ⟨45, 539492396⟩, ⟨77, 1078460492⟩, ⟨141, 2156396684⟩, ⟨53, 137442099252⟩, ⟨85, 274883149908⟩, ⟨149, 549765251220⟩, ⟨101, 70368750469220⟩, ⟨165, 140737498841252⟩, @@ -51,6 +53,7 @@ def searchRowChoices1 : Array SearchRowChoice := ⟨240, 36240865324171264⟩] /-- Packed search-row choices for vertex 2. -/ +@[expose] def searchRowChoices2 : Array SearchRowChoice := #[⟨27, 268441626⟩, ⟨43, 536881194⟩, ⟨75, 1073760330⟩, ⟨139, 2147518602⟩, ⟨51, 137438965810⟩, ⟨83, 274877927506⟩, ⟨147, 549755850898⟩, ⟨99, 70368744202338⟩, ⟨163, 140737488396450⟩, @@ -64,6 +67,7 @@ def searchRowChoices2 : Array SearchRowChoice := ⟨240, 36240865324171264⟩] /-- Packed search-row choices for vertex 3. -/ +@[expose] def searchRowChoices3 : Array SearchRowChoice := #[⟨23, 1053718⟩, ⟨39, 2106406⟩, ⟨71, 4211782⟩, ⟨135, 8422534⟩, ⟨51, 137438965810⟩, ⟨83, 274877927506⟩, ⟨147, 549755850898⟩, ⟨99, 70368744202338⟩, ⟨163, 140737488396450⟩, @@ -77,6 +81,7 @@ def searchRowChoices3 : Array SearchRowChoice := ⟨240, 36240865324171264⟩] /-- Packed search-row choices for vertex 4. -/ +@[expose] def searchRowChoices4 : Array SearchRowChoice := #[⟨15, 527374⟩, ⟨39, 2106406⟩, ⟨71, 4211782⟩, ⟨135, 8422534⟩, ⟨43, 536881194⟩, ⟨75, 1073760330⟩, ⟨139, 2147518602⟩, ⟨99, 70368744202338⟩, ⟨163, 140737488396450⟩, ⟨195, 36028797019013314⟩, @@ -89,6 +94,7 @@ def searchRowChoices4 : Array SearchRowChoice := ⟨204, 36028800253296640⟩, ⟨228, 36239903266177024⟩, ⟨232, 36239907009593344⟩] /-- Packed search-row choices for vertex 5. -/ +@[expose] def searchRowChoices5 : Array SearchRowChoice := #[⟨15, 527374⟩, ⟨23, 1053718⟩, ⟨71, 4211782⟩, ⟨135, 8422534⟩, ⟨27, 268441626⟩, ⟨75, 1073760330⟩, ⟨139, 2147518602⟩, ⟨83, 274877927506⟩, ⟨147, 549755850898⟩, ⟨195, 36028797019013314⟩, @@ -101,6 +107,7 @@ def searchRowChoices5 : Array SearchRowChoice := ⟨216, 36029625142345728⟩] /-- Packed search-row choices for vertex 6. -/ +@[expose] def searchRowChoices6 : Array SearchRowChoice := #[⟨15, 527374⟩, ⟨23, 1053718⟩, ⟨39, 2106406⟩, ⟨135, 8422534⟩, ⟨27, 268441626⟩, ⟨43, 536881194⟩, ⟨139, 2147518602⟩, ⟨51, 137438965810⟩, ⟨147, 549755850898⟩, ⟨163, 140737488396450⟩, @@ -112,6 +119,7 @@ def searchRowChoices6 : Array SearchRowChoice := ⟨172, 140740183719936⟩, ⟨180, 141424694657024⟩, ⟨184, 141427635912704⟩] /-- Packed search-row choices for vertex 7. -/ +@[expose] def searchRowChoices7 : Array SearchRowChoice := #[⟨15, 527374⟩, ⟨23, 1053718⟩, ⟨39, 2106406⟩, ⟨71, 4211782⟩, ⟨27, 268441626⟩, ⟨43, 536881194⟩, ⟨75, 1073760330⟩, ⟨51, 137438965810⟩, ⟨83, 274877927506⟩, ⟨99, 70368744202338⟩, ⟨29, 270008348⟩, @@ -123,12 +131,14 @@ def searchRowChoices7 : Array SearchRowChoice := ⟨108, 70370361606144⟩, ⟨116, 70781068378112⟩, ⟨120, 70782940086272⟩] /-- All lightweight choices, in the same order as the generated pattern choices. -/ +@[expose] def searchRowChoices : Array (Array SearchRowChoice) := #[ searchRowChoices0, searchRowChoices1, searchRowChoices2, searchRowChoices3, searchRowChoices4, searchRowChoices5, searchRowChoices6, searchRowChoices7 ] /-- Retrieve one lightweight choice by its row mask. -/ +@[expose] def searchChoiceForRow (centre : Vertex) (row : UInt64) : SearchRowChoice := ((searchRowChoices.getD centre.val #[]).find? (fun choice => choice.rowMask == row)).getD ⟨0, 0⟩ diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData.lean index 5a91c3b8ab..f812b57bc8 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData.lean @@ -40,12 +40,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryData31 /-! # Aggregated lightweight coverage summaries -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- The 32 groups containing all lightweight pattern summaries. -/ -def patternSummaryBucketGroups : Array (Array (List PatternSummary)) := #[ +@[expose] def patternSummaryBucketGroups : Array (Array (List PatternSummary)) := #[ patternSummaryBuckets00, patternSummaryBuckets01, patternSummaryBuckets02, @@ -81,7 +81,7 @@ def patternSummaryBucketGroups : Array (Array (List PatternSummary)) := #[ ] /-- The 32 groups containing all lightweight exact-table summaries. -/ -def hardSummaryBucketGroups : Array (Array (List HardSummary)) := #[ +@[expose] def hardSummaryBucketGroups : Array (Array (List HardSummary)) := #[ hardSummaryBuckets00, hardSummaryBuckets01, hardSummaryBuckets02, @@ -117,6 +117,7 @@ def hardSummaryBucketGroups : Array (Array (List HardSummary)) := #[ ] /-- Check that a pattern summary occurs in the unique generated summary data. -/ +@[expose] def PatternSummary.memberB (summary : PatternSummary) : Bool := let group := patternSummaryBucketGroups.getD (summary.origin % 256 / 8) #[] match (group.getD (summary.origin % 8) []).find? @@ -125,6 +126,7 @@ def PatternSummary.memberB (summary : PatternSummary) : Bool := | none => false /-- Check that a hard summary occurs in the unique generated summary data. -/ +@[expose] def HardSummary.memberB (summary : HardSummary) : Bool := let group := hardSummaryBucketGroups.getD (summary.origin % 256 / 8) #[] match (group.getD (summary.origin % 8) []).find? diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData00.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData00.lean index 745f1ec6bd..aeed211132 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData00.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData00.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 0–7 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets00 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets00 : Array (List PatternSummary) := #[ [ ⟨0, 7196⟩, ⟨1280, 11272194355625984⟩, @@ -89,7 +89,7 @@ def patternSummaryBuckets00 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets00 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets00 : Array (List HardSummary) := #[ [ ⟨0, 8697799730556775710⟩, ⟨768, 6020701831342613790⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData01.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData01.lean index 60e96faf0d..562193a57e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData01.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData01.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 8–15 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets01 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets01 : Array (List PatternSummary) := #[ [ ⟨520, 11550371277176832⟩, ⟨1288, 11331567406311424⟩, @@ -68,7 +68,7 @@ def patternSummaryBuckets01 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets01 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets01 : Array (List HardSummary) := #[ [ ⟨8, 8697799730289388830⟩, ⟨776, 8266581603606816030⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData02.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData02.lean index 9a3e59b02e..50c293108c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData02.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData02.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 16–23 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets02 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets02 : Array (List PatternSummary) := #[ [ ⟨784, 12886017302⟩, ⟨1040, 2533555322224664⟩, @@ -75,7 +75,7 @@ def patternSummaryBuckets02 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets02 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets02 : Array (List HardSummary) := #[ [ ⟨16, 7397963681003285790⟩, ⟨784, 8693728118512968990⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData03.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData03.lean index 490f841e95..7ff844b38d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData03.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData03.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 24–31 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets03 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets03 : Array (List PatternSummary) := #[ [ ⟨24, 1157645568⟩, ⟨1560, 79165414075392⟩, @@ -74,7 +74,7 @@ def patternSummaryBuckets03 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets03 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets03 : Array (List HardSummary) := #[ [ ⟨24, 7184589160277617950⟩, ⟨792, 5420528452980860190⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData04.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData04.lean index 55361fcf5c..8cdf407873 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData04.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData04.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 32–39 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets04 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets04 : Array (List PatternSummary) := #[ [ ⟨32, 1886388224⟩, ⟨288, 30064772374⟩, @@ -74,7 +74,7 @@ def patternSummaryBuckets04 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets04 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets04 : Array (List HardSummary) := #[ [ ⟨32, 5442549446321122590⟩, ⟨800, 6028513861510391070⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData05.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData05.lean index 950ed7c15c..cf8360f6b0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData05.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData05.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 40–47 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets05 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets05 : Array (List PatternSummary) := #[ [ ⟨40, 2751505408⟩, ⟨296, 47244642586⟩, @@ -81,7 +81,7 @@ def patternSummaryBuckets05 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets05 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets05 : Array (List HardSummary) := #[ [ ⟨40, 8697794253403925790⟩, ⟨808, 5420526108165039390⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData06.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData06.lean index 33773436fe..9c25f05a7e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData06.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData06.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 48–55 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets06 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets06 : Array (List PatternSummary) := #[ [ ⟨48, 3503292416⟩, ⟨304, 55918460956⟩, @@ -74,7 +74,7 @@ def patternSummaryBuckets06 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets06 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets06 : Array (List HardSummary) := #[ [ ⟨48, 8410690872108330270⟩, ⟨816, 4147062961727366430⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData07.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData07.lean index 15e0f74d5f..acabee3eae 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData07.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData07.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 56–63 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets07 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets07 : Array (List PatternSummary) := #[ [ ⟨56, 176093669632⟩, ⟨312, 163212043264⟩, @@ -81,7 +81,7 @@ def patternSummaryBuckets07 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets07 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets07 : Array (List HardSummary) := #[ [ ⟨56, 6020124028603280670⟩, ⟨1080, 6425463230137789470⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData08.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData08.lean index 8bbdc8ba78..a989311c9f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData08.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData08.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 64–71 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets08 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets08 : Array (List PatternSummary) := #[ [ ⟨64, 416611852544⟩, ⟨832, 3299122094346⟩, @@ -69,7 +69,7 @@ def patternSummaryBuckets08 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets08 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets08 : Array (List HardSummary) := #[ [ ⟨64, 8400275203023187230⟩, ⟨1088, 6459722501419330590⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData09.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData09.lean index d011ec57e5..72dd3be43e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData09.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData09.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 72–79 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets09 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets09 : Array (List PatternSummary) := #[ [ ⟨584, 39406498967191552⟩, ⟨840, 5497560441094⟩, @@ -75,7 +75,7 @@ def patternSummaryBuckets09 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets09 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets09 : Array (List HardSummary) := #[ [ ⟨72, 7395849338384559390⟩, ⟨1096, 5450925404522572830⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData10.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData10.lean index 1a2b3dcbea..0cf4380cc6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData10.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData10.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 80–87 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets10 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets10 : Array (List PatternSummary) := #[ [ ⟨80, 691500285952⟩, ⟨1104, 4785370962067476⟩, @@ -77,7 +77,7 @@ def patternSummaryBuckets10 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets10 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets10 : Array (List HardSummary) := #[ [ ⟨80, 7181721629143215390⟩, ⟨1104, 3865150934157388830⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData11.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData11.lean index 6045ee93e0..a48505b207 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData11.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData11.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 88–95 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets11 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets11 : Array (List PatternSummary) := #[ [ ⟨88, 828928737536⟩, ⟨600, 42784784065232896⟩, @@ -72,7 +72,7 @@ def patternSummaryBuckets11 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets11 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets11 : Array (List HardSummary) := #[ [ ⟨88, 6028848096049900830⟩, ⟨1112, 3858394538300697630⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData12.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData12.lean index 58d970466a..d49fae695c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData12.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData12.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 96–103 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets12 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets12 : Array (List PatternSummary) := #[ [ ⟨96, 859006566400⟩, ⟨608, 45741882738794496⟩, @@ -77,7 +77,7 @@ def patternSummaryBuckets12 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets12 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets12 : Array (List HardSummary) := #[ [ ⟨96, 6028799718126071070⟩, ⟨1120, 2852278069844536350⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData13.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData13.lean index 9680d7f891..238d0591c6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData13.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData13.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 104–111 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets13 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets13 : Array (List PatternSummary) := #[ [ ⟨104, 73667283451904⟩, ⟨616, 47437333426864128⟩, @@ -80,7 +80,7 @@ def patternSummaryBuckets13 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets13 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets13 : Array (List HardSummary) := #[ [ ⟨104, 6170944581331856670⟩, ⟨1128, 5131237749192944670⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData14.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData14.lean index 00d394fd9d..337a45852c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData14.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData14.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 112–119 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets14 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets14 : Array (List PatternSummary) := #[ [ ⟨112, 80577881440256⟩, ⟨1392, 216173344754532626⟩, @@ -88,7 +88,7 @@ def patternSummaryBuckets14 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets14 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets14 : Array (List HardSummary) := #[ [ ⟨1136, 3140087176546053150⟩, ⟨5488, 5128989379177079070⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData15.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData15.lean index 92f452b631..1e92571ecd 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData15.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData15.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 120–127 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets15 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets15 : Array (List PatternSummary) := #[ [ ⟨120, 146237277863936⟩, ⟨632, 1513209474805989396⟩, @@ -75,7 +75,7 @@ def patternSummaryBuckets15 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets15 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets15 : Array (List HardSummary) := #[ [ ⟨1144, 7149908365073280030⟩, ⟨5496, 8686693566026277150⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData16.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData16.lean index 9959bf24e0..23583c793e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData16.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData16.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 128–135 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets16 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets16 : Array (List PatternSummary) := #[ [ ⟨128, 212205744210176⟩, ⟨384, 72567773881344⟩, @@ -83,7 +83,7 @@ def patternSummaryBuckets16 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets16 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets16 : Array (List HardSummary) := #[ [ ⟨1152, 4158110292926622750⟩, ⟨5504, 3285751713959174430⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData17.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData17.lean index 4f9a99a407..834aef8dbd 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData17.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData17.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 136–143 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets17 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets17 : Array (List PatternSummary) := #[ [ ⟨136, 215507567378432⟩, ⟨648, 2594236817460953088⟩, @@ -78,7 +78,7 @@ def patternSummaryBuckets17 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets17 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets17 : Array (List HardSummary) := #[ [ ⟨1160, 3871005816665041950⟩, ⟨5512, 4145376318603321630⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData18.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData18.lean index bfc49874b2..2a3add6cd1 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData18.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData18.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 144–151 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets18 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets18 : Array (List PatternSummary) := #[ [ ⟨144, 3940649673949198⟩, ⟨400, 81365504647168⟩, @@ -78,7 +78,7 @@ def patternSummaryBuckets18 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets18 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets18 : Array (List HardSummary) := #[ [ ⟨1168, 3722585502941015070⟩, ⟨5520, 8371515816107761950⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData19.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData19.lean index e5e3d677e0..51222a773c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData19.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData19.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 152–159 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets19 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets19 : Array (List PatternSummary) := #[ [ ⟨664, 3026418952310923264⟩, ⟨920, 18842021536018⟩, @@ -75,7 +75,7 @@ def patternSummaryBuckets19 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets19 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets19 : Array (List HardSummary) := #[ [ ⟨1176, 5456328253332679710⟩, ⟨5528, 6425956512181182750⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData20.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData20.lean index 719333d504..157f3fb33a 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData20.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData20.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 160–167 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets20 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets20 : Array (List PatternSummary) := #[ [ ⟨160, 36873221957681152⟩, ⟨416, 97068139937792⟩, @@ -76,7 +76,7 @@ def patternSummaryBuckets20 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets20 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets20 : Array (List HardSummary) := #[ [ ⟨672, 8697238970799187230⟩, ⟨1184, 4146624913950796830⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData21.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData21.lean index fece963253..ab614ef21b 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData21.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData21.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 168–175 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets21 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets21 : Array (List PatternSummary) := #[ [ ⟨424, 145138297339904⟩, ⟨2216, 3474747736396398592⟩, @@ -76,7 +76,7 @@ def patternSummaryBuckets21 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets21 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets21 : Array (List HardSummary) := #[ [ ⟨680, 8694995735922566430⟩, ⟨1192, 7148788942262922270⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData22.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData22.lean index c366054d19..943f9d64e3 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData22.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData22.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 176–183 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets22 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets22 : Array (List PatternSummary) := #[ [ ⟨176, 45317471250456832⟩, ⟨432, 150258088673280⟩, @@ -77,7 +77,7 @@ def patternSummaryBuckets22 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets22 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets22 : Array (List HardSummary) := #[ [ ⟨688, 5446478027099301150⟩, ⟨1200, 8190520808261053470⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData23.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData23.lean index 028058e131..137498ba90 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData23.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData23.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 184–191 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets23 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets23 : Array (List PatternSummary) := #[ [ ⟨440, 153934389837824⟩, ⟨696, 4035383598751154176⟩, @@ -66,7 +66,7 @@ def patternSummaryBuckets23 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets23 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets23 : Array (List HardSummary) := #[ [ ⟨696, 3723520191431927070⟩, ⟨1208, 3136570097621560350⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData24.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData24.lean index 74828de8fe..46a5deed7f 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData24.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData24.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 192–199 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets24 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets24 : Array (List PatternSummary) := #[ [ ⟨192, 1008806316530991118⟩, ⟨448, 163294668128256⟩, @@ -82,7 +82,7 @@ def patternSummaryBuckets24 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets24 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets24 : Array (List HardSummary) := #[ [ ⟨704, 3149311144688313630⟩, ⟨1216, 8192763675079633950⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData25.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData25.lean index 64e93b75bf..be91d424d6 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData25.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData25.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 200–207 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets25 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets25 : Array (List PatternSummary) := #[ [ ⟨200, 2666130979403343104⟩, ⟨712, 5044031582667686912⟩, @@ -73,7 +73,7 @@ def patternSummaryBuckets25 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets25 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets25 : Array (List HardSummary) := #[ [ ⟨712, 6022942919503668510⟩, ⟨1224, 6139399885039365150⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData26.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData26.lean index 624e4eacfc..bb2f50303e 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData26.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData26.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 208–215 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets26 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets26 : Array (List PatternSummary) := #[ [ ⟨464, 1970324836992262⟩, ⟨720, 5227553267483410432⟩, @@ -79,7 +79,7 @@ def patternSummaryBuckets26 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets26 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets26 : Array (List HardSummary) := #[ [ ⟨720, 5452053504538993950⟩, ⟨976, 6461210423826017310⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData27.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData27.lean index 53bf0bcbf0..8689fd58ea 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData27.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData27.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 216–223 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets27 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets27 : Array (List PatternSummary) := #[ [ ⟨216, 4971973988617045248⟩, ⟨472, 3659174702022668⟩, @@ -78,7 +78,7 @@ def patternSummaryBuckets27 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets27 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets27 : Array (List HardSummary) := #[ [ ⟨728, 3714855799054951710⟩, ⟨984, 5166917172072115230⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData28.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData28.lean index 8b39d6824a..f8f5327753 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData28.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData28.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 224–231 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets28 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets28 : Array (List PatternSummary) := #[ [ ⟨480, 5910974516232212⟩, ⟨736, 5764608385517355008⟩, @@ -86,7 +86,7 @@ def patternSummaryBuckets28 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets28 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets28 : Array (List HardSummary) := #[ [ ⟨736, 5997049396192830750⟩, ⟨992, 3714296387598904350⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData29.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData29.lean index 1f2e904384..6b5451e4b0 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData29.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData29.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 232–239 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets29 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets29 : Array (List PatternSummary) := #[ [ ⟨488, 9570149214610432⟩, ⟨744, 5945315291306131456⟩, @@ -77,7 +77,7 @@ def patternSummaryBuckets29 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets29 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets29 : Array (List HardSummary) := #[ [ ⟨744, 7689008565333484830⟩, ⟨1000, 6172702974236912670⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData30.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData30.lean index 4e5a13bc12..96d9456119 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData30.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData30.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 240–247 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets30 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets30 : Array (List PatternSummary) := #[ [ ⟨240, 593166⟩, ⟨752, 6341068588064964608⟩, @@ -79,7 +79,7 @@ def patternSummaryBuckets30 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets30 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets30 : Array (List HardSummary) := #[ [ ⟨752, 4147201482135594270⟩, ⟨1008, 5163820946576993310⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData31.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData31.lean index b725dc49f3..177b80ddee 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData31.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryData31.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryDataTypes /-! # Lightweight coverage summaries, buckets 248–255 -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Lightweight monotone-obstruction summaries for this hash-bucket group. -/ -def patternSummaryBuckets31 : Array (List PatternSummary) := #[ +@[expose] def patternSummaryBuckets31 : Array (List PatternSummary) := #[ [ ⟨248, 51052558⟩, ⟨760, 7034975561185230848⟩, @@ -89,7 +89,7 @@ def patternSummaryBuckets31 : Array (List PatternSummary) := #[ ] /-- Lightweight exact-table summaries for this hash-bucket group. -/ -def hardSummaryBuckets31 : Array (List HardSummary) := #[ +@[expose] def hardSummaryBuckets31 : Array (List HardSummary) := #[ [ ⟨760, 4149444092129076510⟩, ⟨1016, 6459803068812979230⟩, diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryDataTypes.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryDataTypes.lean index 96249a7c7b..ced068887c 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryDataTypes.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryDataTypes.lean @@ -10,12 +10,12 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryTypes /-! # Lightweight coverage-summary data validation -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Check a pattern summary against one eight-bucket data shard. -/ -def PatternSummary.validAgainstB +@[expose] def PatternSummary.validAgainstB (buckets : Array (List PatternEntry)) (summary : PatternSummary) : Bool := match (buckets.getD (summary.origin % 8) []).find? (fun entry => entry.origin == summary.origin) with @@ -23,7 +23,7 @@ def PatternSummary.validAgainstB | none => false /-- Check an exact-table summary against one eight-bucket data shard. -/ -def HardSummary.validAgainstB +@[expose] def HardSummary.validAgainstB (buckets : Array (List HardEntry)) (summary : HardSummary) : Bool := match (buckets.getD (summary.origin % 8) []).find? (fun entry => entry.origin == summary.origin) with diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryTypes.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryTypes.lean index c1927b8e5e..cc375be49d 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryTypes.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryTypes.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Lightweight coverage-summary types -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence @@ -47,24 +47,25 @@ structure SummaryRowChoice where patterns : PatternSummaryBuckets /-- Vertex pairs in tuple form for packed pair masks. -/ -def vertexPairTuples : List (Vertex × Vertex) := +@[expose] def vertexPairTuples : List (Vertex × Vertex) := vertexPairs.filterMap fun pair => match pair with | [first, second] => some (first, second) | _ => none /-- Whether one row selects both endpoints of a vertex pair. -/ -def pairSelectedB (rowMask : UInt64) (pair : Vertex × Vertex) : Bool := +@[expose] def pairSelectedB (rowMask : UInt64) (pair : Vertex × Vertex) : Bool := bitSetB rowMask pair.1.val && bitSetB rowMask pair.2.val /-- Add one selected pair to a packed pair mask. -/ -def addPairBit +@[expose] def addPairBit (rowMask : UInt64) (result : UInt64) (pair : Vertex × Vertex) : UInt64 := if pairSelectedB rowMask pair then result ||| (1 <<< UInt64.ofNat (varIndex pair.1 pair.2)) else result /-- Compute the unordered vertex-pair bits selected together by a row mask. -/ +@[expose] def rowPairMask (rowMask : UInt64) : UInt64 := vertexPairTuples.foldl (addPairBit rowMask) 0 diff --git a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryValidity.lean b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryValidity.lean index b92ab82d6a..1397cd65fb 100644 --- a/LeanPool/Erdos97ConvexOctagon/CoverageSummaryValidity.lean +++ b/LeanPool/Erdos97ConvexOctagon/CoverageSummaryValidity.lean @@ -9,17 +9,17 @@ public import LeanPool.Erdos97ConvexOctagon.CoverageSummaryData /-! # Soundness of lightweight coverage-summary audits -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- A pattern summary denotes a checked obstruction with the advertised fields. -/ -def PatternSummary.Valid (summary : PatternSummary) : Prop := +@[expose] def PatternSummary.Valid (summary : PatternSummary) : Prop := ∃ entry : PatternEntry, entry.origin = summary.origin ∧ entry.mask = summary.mask ∧ entry.validB = true /-- An exact-table summary denotes a checked obstruction with the advertised fields. -/ -def HardSummary.Valid (summary : HardSummary) : Prop := +@[expose] def HardSummary.Valid (summary : HardSummary) : Prop := ∃ entry : HardEntry, entry.origin = summary.origin ∧ entry.code = summary.code ∧ entry.validB = true diff --git a/LeanPool/Erdos97ConvexOctagon/CycleStrip.lean b/LeanPool/Erdos97ConvexOctagon/CycleStrip.lean index 744fd3994e..1c62cd8b27 100644 --- a/LeanPool/Erdos97ConvexOctagon/CycleStrip.lean +++ b/LeanPool/Erdos97ConvexOctagon/CycleStrip.lean @@ -10,7 +10,7 @@ import LeanPool.Erdos97ConvexOctagon.Gram /-! # Erdős 97 convex-octagon formalization: Cycle Strip -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/EquidistantFour.lean b/LeanPool/Erdos97ConvexOctagon/EquidistantFour.lean index 1216b11550..ea08e2ce26 100644 --- a/LeanPool/Erdos97ConvexOctagon/EquidistantFour.lean +++ b/LeanPool/Erdos97ConvexOctagon/EquidistantFour.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.Basic /-! # Erdős 97 convex-octagon formalization: Equidistant Four -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/FiniteModel.lean b/LeanPool/Erdos97ConvexOctagon/FiniteModel.lean index b4a61440a3..0859047d30 100644 --- a/LeanPool/Erdos97ConvexOctagon/FiniteModel.lean +++ b/LeanPool/Erdos97ConvexOctagon/FiniteModel.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Erdős 97 convex-octagon formalization: Finite Model -/ -@[expose] public section +public section namespace Erdos97Octagon @@ -27,6 +27,7 @@ namespace RawIncidence abbrev SearchRow := Finset Vertex /-- All four-element rows available at a specified centre. -/ +@[expose] def rowOptions (v : Vertex) : List SearchRow := (((List.finRange 8).filter (· ≠ v)).sublistsLen 4).map List.toFinset @@ -57,19 +58,20 @@ theorem target_row_mem_rowOptions (Q : OctagonIncidence) (v : Vertex) : Finset.sort_toFinset _ _⟩ /-- The zero-based SAT variable representing one directed incidence. -/ -def varIndex (centre target : Vertex) : ℕ := +@[expose] def varIndex (centre target : Vertex) : ℕ := 8 * centre.val + target.val /-- Test one bit of a packed 64-bit incidence table. -/ -def bitSetB (code : UInt64) (index : ℕ) : Bool := +@[expose] def bitSetB (code : UInt64) (index : ℕ) : Bool := ((code >>> UInt64.ofNat index) &&& 1) != 0 /-- Decode one three-bit entry of a packed permutation. -/ +@[expose] def decodeMap (code : UInt64) (vertex : Vertex) : Vertex := Fin.ofNat 8 (((code >>> UInt64.ofNat (3 * vertex.val)) &&& 7).toNat) /-- Decode an eight-bit row mask as a set of octagon vertices. -/ -def packedRow (mask : UInt64) : Finset Vertex := +@[expose] def packedRow (mask : UInt64) : Finset Vertex := Finset.univ.filter fun target => bitSetB mask target.val @[simp] theorem mem_packedRow (mask : UInt64) (target : Vertex) : @@ -77,11 +79,11 @@ def packedRow (mask : UInt64) : Finset Vertex := simp [packedRow] /-- Vertex pairs in the lexicographic order used by the finite search. -/ -def vertexPairs : List (List Vertex) := +@[expose] def vertexPairs : List (List Vertex) := ((List.finRange 8).sublistsLen 2).reverse /-- Read one directed incidence from a packed table. -/ -def packedSelectsB (code : UInt64) (centre target : Vertex) : Bool := +@[expose] def packedSelectsB (code : UInt64) (centre target : Vertex) : Bool := bitSetB code (varIndex centre target) /-- Decode a packed table to the mathematical finite-set model. -/ diff --git a/LeanPool/Erdos97ConvexOctagon/GeometryReduction.lean b/LeanPool/Erdos97ConvexOctagon/GeometryReduction.lean index 0a051387b7..fb9b3fd1af 100644 --- a/LeanPool/Erdos97ConvexOctagon/GeometryReduction.lean +++ b/LeanPool/Erdos97ConvexOctagon/GeometryReduction.lean @@ -13,7 +13,7 @@ import Mathlib.Geometry.Euclidean.PerpBisector /-! # Erdős 97 convex-octagon formalization: Geometry Reduction -/ -@[expose] public section +public section namespace Erdos97Octagon @@ -25,7 +25,7 @@ def HasFourEquidistant (p : Vertex → Plane) (v : Vertex) : Prop := ∃ r : ℝ, ∀ w ∈ S, dist (p v) (p w) = r /-- A labelled incidence system is realised by equal-distance rows in the plane. -/ -def Realises (p : Vertex → Plane) (Q : OctagonIncidence) : Prop := +@[expose] def Realises (p : Vertex → Plane) (Q : OctagonIncidence) : Prop := ∀ v, ∃ r : ℝ, ∀ w ∈ Q.targets v, dist (p v) (p w) = r private lemma three_centres_collinear diff --git a/LeanPool/Erdos97ConvexOctagon/Gram.lean b/LeanPool/Erdos97ConvexOctagon/Gram.lean index 1516d600d2..585ccca499 100644 --- a/LeanPool/Erdos97ConvexOctagon/Gram.lean +++ b/LeanPool/Erdos97ConvexOctagon/Gram.lean @@ -9,7 +9,7 @@ public import LeanPool.Erdos97ConvexOctagon.Basic /-! # Erdős 97 convex-octagon formalization: Gram -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/Incidence.lean b/LeanPool/Erdos97ConvexOctagon/Incidence.lean index c598ca2bbd..72c648607a 100644 --- a/LeanPool/Erdos97ConvexOctagon/Incidence.lean +++ b/LeanPool/Erdos97ConvexOctagon/Incidence.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # Erdős 97 convex-octagon formalization: Incidence -/ -@[expose] public section +public section namespace Erdos97Octagon @@ -46,19 +46,20 @@ theorem OctagonIncidence.ext {Q R : OctagonIncidence} (h : Q.targets = R.targets namespace OctagonIncidence /-- The number of witness rows containing `a`. -/ -def indegree (Q : OctagonIncidence) (a : Vertex) : ℕ := +@[expose] def indegree (Q : OctagonIncidence) (a : Vertex) : ℕ := ∑ v, if a ∈ Q.targets v then 1 else 0 /-- The number of witness rows containing both `a` and `b`. -/ -def pairMultiplicity (Q : OctagonIncidence) (a b : Vertex) : ℕ := +@[expose] def pairMultiplicity (Q : OctagonIncidence) (a b : Vertex) : ℕ := ∑ v, if a ∈ Q.targets v ∧ b ∈ Q.targets v then 1 else 0 /-- No distinct pair occurs together in more than two witness rows. -/ +@[expose] def PairSparse (Q : OctagonIncidence) : Prop := ∀ ⦃a b⦄, a ≠ b → Q.pairMultiplicity a b ≤ 2 /-- Every vertex occurs in exactly four witness rows. -/ -def Balanced (Q : OctagonIncidence) : Prop := +@[expose] def Balanced (Q : OctagonIncidence) : Prop := ∀ a, Q.indegree a = 4 private lemma row_pair_sum (Q : OctagonIncidence) (a v : Vertex) : diff --git a/LeanPool/Erdos97ConvexOctagon/Main.lean b/LeanPool/Erdos97ConvexOctagon/Main.lean index 233e676b0e..46763eea16 100644 --- a/LeanPool/Erdos97ConvexOctagon/Main.lean +++ b/LeanPool/Erdos97ConvexOctagon/Main.lean @@ -28,4 +28,4 @@ This is the eight-point convex case only. It does not prove the general open problem. -/ -@[expose] public section +public section diff --git a/LeanPool/Erdos97ConvexOctagon/Obstructions.lean b/LeanPool/Erdos97ConvexOctagon/Obstructions.lean index c4fc4fc73f..14cdfdc18c 100644 --- a/LeanPool/Erdos97ConvexOctagon/Obstructions.lean +++ b/LeanPool/Erdos97ConvexOctagon/Obstructions.lean @@ -13,7 +13,7 @@ import Mathlib.Geometry.Euclidean.PerpBisector /-! # Erdős 97 convex-octagon formalization: Obstructions -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/PackedCertificates.lean b/LeanPool/Erdos97ConvexOctagon/PackedCertificates.lean index f08be4c0e3..5ee2d483c3 100644 --- a/LeanPool/Erdos97ConvexOctagon/PackedCertificates.lean +++ b/LeanPool/Erdos97ConvexOctagon/PackedCertificates.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.Certificates /-! # Fast validation of certificates against packed incidence tables -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Validate the tail of a mutual-edge tree directly against a packed table. -/ -def packedExtendsTreeB +@[expose] def packedExtendsTreeB (code : UInt64) (reached : Finset Vertex) : List Vertex → Bool | [] => true | vertex :: remaining => @@ -25,20 +25,20 @@ def packedExtendsTreeB packedExtendsTreeB code (insert vertex reached) remaining /-- Validate a mutual-edge spanning tree directly against a packed table. -/ -def packedComponentTreeB +@[expose] def packedComponentTreeB (code : UInt64) (root : Vertex) : List Vertex → Bool | [] => false | first :: remaining => decide (first = root) && packedExtendsTreeB code {root} remaining /-- Test whether a packed code selects an edge incident to the given component. -/ -def packedTreeLabelledEdgeB +@[expose] def packedTreeLabelledEdgeB (code : UInt64) (component : List Vertex) (a b : Vertex) : Bool := (decide (a ∈ component) && packedSelectsB code a b) || (decide (b ∈ component) && packedSelectsB code b a) /-- Check the residual certificate encoded by a packed code and payload. -/ -def packedResidualValidB (code payload : UInt64) : Bool := +@[expose] def packedResidualValidB (code payload : UInt64) : Bool := let classIndex := payloadClass payload let forward := decodeMap (payloadForwardCode payload) let inverse := decodeMap (payloadInverseCode payload) @@ -52,7 +52,7 @@ def packedResidualValidB (code payload : UInt64) : Bool := (residualRepresentative (Fin.ofNat 13 classIndex)).targets (forward vertex)))) /-- Kernel-check a certificate without first materializing eight finite sets. -/ -def Certificate.validPackedB (code : UInt64) : Certificate → Bool +@[expose] def Certificate.validPackedB (code : UInt64) : Certificate → Bool | .k4 root component a b c d => packedComponentTreeB code root component && decide [a, b, c, d].Nodup && packedTreeLabelledEdgeB code component a b && diff --git a/LeanPool/Erdos97ConvexOctagon/PairCompatibility.lean b/LeanPool/Erdos97ConvexOctagon/PairCompatibility.lean index 53578aaf7b..1af9d43af8 100644 --- a/LeanPool/Erdos97ConvexOctagon/PairCompatibility.lean +++ b/LeanPool/Erdos97ConvexOctagon/PairCompatibility.lean @@ -13,18 +13,18 @@ import Mathlib.Tactic.NormNum.GCD /-! # Pair-sparsity guard for direct incidence-table search -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- Number of processed row masks containing both vertices. -/ -def pairCount +@[expose] def pairCount (assignments : List (Vertex × UInt64)) (a b : Vertex) : ℕ := (assignments.filter fun previous => bitSetB previous.2 a.val && bitSetB previous.2 b.val).length /-- Boolean guard that prevents a new row from making any pair occur three times. -/ -def pairCompatibleB +@[expose] def pairCompatibleB (assignments : List (Vertex × UInt64)) (row : UInt64) : Bool := (((List.finRange 8).sublistsLen 2).reverse).all fun pair => match pair with diff --git a/LeanPool/Erdos97ConvexOctagon/PairStateExactness.lean b/LeanPool/Erdos97ConvexOctagon/PairStateExactness.lean index 5823b6c057..93849ef439 100644 --- a/LeanPool/Erdos97ConvexOctagon/PairStateExactness.lean +++ b/LeanPool/Erdos97ConvexOctagon/PairStateExactness.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! # Exactness of packed pair-occurrence states -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence.StaticDirectCoverage diff --git a/LeanPool/Erdos97ConvexOctagon/Pentagon.lean b/LeanPool/Erdos97ConvexOctagon/Pentagon.lean index e3baae7582..e1ec98ca4a 100644 --- a/LeanPool/Erdos97ConvexOctagon/Pentagon.lean +++ b/LeanPool/Erdos97ConvexOctagon/Pentagon.lean @@ -10,7 +10,7 @@ import LeanPool.Erdos97ConvexOctagon.Gram /-! # Erdős 97 convex-octagon formalization: Pentagon -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/Radius.lean b/LeanPool/Erdos97ConvexOctagon/Radius.lean index d8190623c8..7a5ee46f41 100644 --- a/LeanPool/Erdos97ConvexOctagon/Radius.lean +++ b/LeanPool/Erdos97ConvexOctagon/Radius.lean @@ -9,22 +9,24 @@ public import LeanPool.Erdos97ConvexOctagon.GeometryReduction /-! # Erdős 97 convex-octagon formalization: Radius -/ -@[expose] public section +public section namespace Erdos97Octagon namespace OctagonIncidence /-- Two centres are mutually selected. -/ -def Mutual (Q : OctagonIncidence) (a b : Vertex) : Prop := +@[expose] def Mutual (Q : OctagonIncidence) (a b : Vertex) : Prop := b ∈ Q.targets a ∧ a ∈ Q.targets b /-- Two centres lie in the same connected component of mutual selections. -/ +@[expose] def SameComponent (Q : OctagonIncidence) (a b : Vertex) : Prop := Relation.ReflTransGen Q.Mutual a b /-- An undirected pair is labelled by the radius of a mutual component when one endpoint in that component selects the other. -/ +@[expose] def LabelledEdge (Q : OctagonIncidence) (root a b : Vertex) : Prop := (Q.SameComponent root a ∧ b ∈ Q.targets a) ∨ (Q.SameComponent root b ∧ a ∈ Q.targets b) diff --git a/LeanPool/Erdos97ConvexOctagon/Relabelling.lean b/LeanPool/Erdos97ConvexOctagon/Relabelling.lean index 1b20280872..4190844660 100644 --- a/LeanPool/Erdos97ConvexOctagon/Relabelling.lean +++ b/LeanPool/Erdos97ConvexOctagon/Relabelling.lean @@ -9,12 +9,12 @@ public import LeanPool.Erdos97ConvexOctagon.GeometryReduction /-! # Erdős 97 convex-octagon formalization: Relabelling -/ -@[expose] public section +public section namespace Erdos97Octagon /-- The canonical first witness row used by the finite classification. -/ -def standardTargets : Finset Vertex := {1, 2, 3, 4} +@[expose] def standardTargets : Finset Vertex := {1, 2, 3, 4} /-- The canonical witness row has four vertices. -/ @[simp] theorem card_standardTargets : standardTargets.card = 4 := by @@ -27,12 +27,14 @@ def standardTargets : Finset Vertex := {1, 2, 3, 4} namespace OctagonIncidence /-- Simultaneously relabel the centres and every entry of their witness rows. -/ +@[expose] def relabel (Q : OctagonIncidence) (e : Vertex ≃ Vertex) : OctagonIncidence where targets v := (Q.targets (e.symm v)).map e.toEmbedding card_targets v := by simp [Q.card_targets] centre_not_mem v := by simpa using Q.centre_not_mem (e.symm v) /-- A system is normalized when row zero is the canonical four-set. -/ +@[expose] def Normalized (Q : OctagonIncidence) : Prop := Q.targets 0 = standardTargets diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra00.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra00.lean index eae8b21046..639faced35 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra00.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra00.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra00 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra01.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra01.lean index 48611ab53e..c2200841d5 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra01.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra01.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra01 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra02.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra02.lean index 11a76bb0ce..725cbb540b 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra02.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra02.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra02 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra03.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra03.lean index 99ac6842ed..fdf5b2dd6d 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra03.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra03.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra03 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra04.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra04.lean index f6e14be70b..41d090963a 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra04.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra04.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra04 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra05.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra05.lean index f060de04c5..cf222265d1 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra05.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra05.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra05 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra06.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra06.lean index d80fbf45d9..b1a579c184 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra06.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra06.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra06 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra07.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra07.lean index 7aee7d01b9..3b7819d088 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra07.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra07.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra07 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra08.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra08.lean index e79b98d3f4..9db030670b 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra08.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra08.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra08 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra09.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra09.lean index bb73051b63..d2452348a3 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra09.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra09.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra09 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra10.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra10.lean index db7aa37e26..4a799344bc 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra10.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra10.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra10 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra11.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra11.lean index 1ca1dc8b20..d72b7c0a32 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra11.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra11.lean @@ -16,7 +16,7 @@ parameter. Each of its two possible ranges puts a labelled vertex in the convex hull of four other vertices. -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra12.lean b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra12.lean index 8df5cc24d2..022426393b 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra12.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualAlgebra12.lean @@ -11,7 +11,7 @@ import LeanPool.Erdos97ConvexOctagon.CayleyMenger /-! # Erdős 97 convex-octagon formalization: Residual Algebra12 -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualObstructions.lean b/LeanPool/Erdos97ConvexOctagon/ResidualObstructions.lean index 1d9b5f1a17..326bf7fe62 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualObstructions.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualObstructions.lean @@ -23,7 +23,7 @@ import LeanPool.Erdos97ConvexOctagon.ResidualAlgebra12 /-! # Erdős 97 convex-octagon formalization: Residual Obstructions -/ -@[expose] public section +public section namespace Erdos97Octagon diff --git a/LeanPool/Erdos97ConvexOctagon/ResidualRepresentatives.lean b/LeanPool/Erdos97ConvexOctagon/ResidualRepresentatives.lean index 209bc16bf4..f04e706bed 100644 --- a/LeanPool/Erdos97ConvexOctagon/ResidualRepresentatives.lean +++ b/LeanPool/Erdos97ConvexOctagon/ResidualRepresentatives.lean @@ -19,11 +19,12 @@ module defines the systems exactly but makes no claim that they exhaust all normalized, balanced, pair-sparse incidence systems. -/ -@[expose] public section +public section namespace Erdos97Octagon /-- The exact residual incidence representative of class 0. -/ +@[expose] def residualRepresentative00 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {0, 4, 5, 6}, {2, 4, 5, 7}, @@ -33,6 +34,7 @@ def residualRepresentative00 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 1. -/ +@[expose] def residualRepresentative01 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {0, 4, 5, 6}, {2, 4, 6, 7}, @@ -42,6 +44,7 @@ def residualRepresentative01 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 2. -/ +@[expose] def residualRepresentative02 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {0, 5, 6, 7}, {2, 4, 6, 7}, @@ -51,6 +54,7 @@ def residualRepresentative02 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 3. -/ +@[expose] def residualRepresentative03 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {0, 1, 4, 6}, {0, 4, 5, 7}, @@ -60,6 +64,7 @@ def residualRepresentative03 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 4. -/ +@[expose] def residualRepresentative04 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {0, 1, 4, 6}, {2, 4, 6, 7}, @@ -69,6 +74,7 @@ def residualRepresentative04 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 5. -/ +@[expose] def residualRepresentative05 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 5, 6}, {3, 4, 5, 7}, {1, 2, 6, 7}, @@ -78,6 +84,7 @@ def residualRepresentative05 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 6. -/ +@[expose] def residualRepresentative06 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {0, 1, 4, 6}, {0, 1, 5, 7}, @@ -87,6 +94,7 @@ def residualRepresentative06 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 7. -/ +@[expose] def residualRepresentative07 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {3, 4, 6, 7}, {2, 5, 6, 7}, @@ -96,6 +104,7 @@ def residualRepresentative07 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 8. -/ +@[expose] def residualRepresentative08 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {3, 4, 5, 6}, {2, 4, 5, 7}, @@ -105,6 +114,7 @@ def residualRepresentative08 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 9. -/ +@[expose] def residualRepresentative09 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {3, 4, 5, 6}, {2, 4, 5, 7}, @@ -114,6 +124,7 @@ def residualRepresentative09 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 10. -/ +@[expose] def residualRepresentative10 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 3, 5}, {3, 4, 5, 6}, {2, 4, 5, 7}, @@ -123,6 +134,7 @@ def residualRepresentative10 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 11. -/ +@[expose] def residualRepresentative11 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 2, 5, 6}, {3, 4, 5, 6}, {0, 4, 5, 7}, @@ -132,6 +144,7 @@ def residualRepresentative11 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The exact residual incidence representative of class 12. -/ +@[expose] def residualRepresentative12 : OctagonIncidence where targets := ![ {1, 2, 3, 4}, {0, 5, 6, 7}, {1, 3, 5, 6}, {1, 4, 5, 7}, @@ -141,7 +154,7 @@ def residualRepresentative12 : OctagonIncidence where centre_not_mem v := by fin_cases v <;> decide /-- The thirteen residual representatives as one finite family. -/ -def residualRepresentative : Fin 13 → OctagonIncidence := ![ +@[expose] def residualRepresentative : Fin 13 → OctagonIncidence := ![ residualRepresentative00, residualRepresentative01, residualRepresentative02, residualRepresentative03, residualRepresentative04, residualRepresentative05, residualRepresentative06, residualRepresentative07, residualRepresentative08, diff --git a/LeanPool/Erdos97ConvexOctagon/RowMasks.lean b/LeanPool/Erdos97ConvexOctagon/RowMasks.lean index 60a48a104c..e5d9f2c1d9 100644 --- a/LeanPool/Erdos97ConvexOctagon/RowMasks.lean +++ b/LeanPool/Erdos97ConvexOctagon/RowMasks.lean @@ -14,15 +14,17 @@ import Mathlib.Tactic.NormNum.GCD /-! # Explicit row masks for the finite incidence-table search -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence /-- The seven canonical first-row masks, in certificate order. -/ +@[expose] def canonicalRowMask : Fin 7 → UInt64 := ![29, 45, 101, 225, 60, 108, 228] /-- All first-row masks in the lexicographic search order. -/ +@[expose] def rowOneMask : Fin 35 → UInt64 := ![ 29, 45, 77, 141, 53, 85, 149, 101, 165, 197, 57, 89, 153, 105, 169, 201, 113, 177, 209, 225, 60, 92, 156, 108, 172, 204, 116, 180, 212, 228, 120, @@ -30,6 +32,7 @@ def rowOneMask : Fin 35 → UInt64 := ![ ] /-- All second-row masks in the lexicographic search order. -/ +@[expose] def rowTwoMask : Fin 35 → UInt64 := ![ 27, 43, 75, 139, 51, 83, 147, 99, 163, 195, 57, 89, 153, 105, 169, 201, 113, 177, 209, 225, 58, 90, 154, 106, 170, 202, 114, 178, 210, 226, 120, @@ -37,6 +40,6 @@ def rowTwoMask : Fin 35 → UInt64 := ![ ] /-- Order in which the direct audit assigns the five noncanonical rows. -/ -def searchCentres : List Vertex := [3, 4, 7, 6, 5] +@[expose] def searchCentres : List Vertex := [3, 4, 7, 6, 5] end Erdos97Octagon.RawIncidence diff --git a/LeanPool/Erdos97ConvexOctagon/RowSymmetry.lean b/LeanPool/Erdos97ConvexOctagon/RowSymmetry.lean index 3c7c9de00f..5becf2bcf0 100644 --- a/LeanPool/Erdos97ConvexOctagon/RowSymmetry.lean +++ b/LeanPool/Erdos97ConvexOctagon/RowSymmetry.lean @@ -18,7 +18,7 @@ to seven canonical orbits. The small table below records an explicit forward and inverse permutation for every row. -/ -@[expose] public section +public section namespace Erdos97Octagon.RawIncidence @@ -58,6 +58,7 @@ structure RowSymmetryCertificate where inverseCode : UInt64 /-- Mathematical validity of a row-symmetry certificate. -/ +@[expose] def RowSymmetryCertificate.Valid (certificate : RowSymmetryCertificate) (sourceMask : UInt64) : Prop := let forward := decodeMap certificate.forwardCode diff --git a/LeanPool/ErdosMoser.lean b/LeanPool/ErdosMoser.lean index 2edaacdeff..df04e89d31 100644 --- a/LeanPool/ErdosMoser.lean +++ b/LeanPool/ErdosMoser.lean @@ -19,7 +19,7 @@ Tags: additive-combinatorics, number-theory, distinct-subset-sums, erdos-problem MSC: 11B13, 11B75 -/ -@[expose] public section +public section /-! Guy's 1982 account states the exact finite sum-of-squares inequality as diff --git a/LeanPool/ErdosMoser/Basic.lean b/LeanPool/ErdosMoser/Basic.lean index 48d896210c..589f8d3522 100644 --- a/LeanPool/ErdosMoser/Basic.lean +++ b/LeanPool/ErdosMoser/Basic.lean @@ -24,7 +24,7 @@ establishes the elementary upper bound on their sum of squares in terms of their largest element. -/ -@[expose] public section +public section namespace LeanPool.ErdosMoser @@ -32,7 +32,7 @@ open Finset /-- A finite set has distinct subset sums if the subset-sum map on its powerset is injective. -/ -def HasDistinctSubsetSums (A : Finset ℕ) : Prop := +@[expose] def HasDistinctSubsetSums (A : Finset ℕ) : Prop := ∀ S ∈ A.powerset, ∀ T ∈ A.powerset, S.sum id = T.sum id → S = T /-- The powerset of a finite set has cardinality `2 ^ A.card`. -/ diff --git a/LeanPool/ErdosMoser/Bounds.lean b/LeanPool/ErdosMoser/Bounds.lean index 361e16341f..954e27ba44 100644 --- a/LeanPool/ErdosMoser/Bounds.lean +++ b/LeanPool/ErdosMoser/Bounds.lean @@ -17,7 +17,7 @@ This file derives direct and square-root forms of the largest-element bound from Leo Moser's exact sum-of-squares inequality. -/ -@[expose] public section +public section namespace LeanPool.ErdosMoser diff --git a/LeanPool/ErdosMoser/DiscreteVariance.lean b/LeanPool/ErdosMoser/DiscreteVariance.lean index dd92566221..49c2ef5b41 100644 --- a/LeanPool/ErdosMoser/DiscreteVariance.lean +++ b/LeanPool/ErdosMoser/DiscreteVariance.lean @@ -29,7 +29,7 @@ compares all pairwise differences with those of an initial interval, and evaluates the resulting quadratic sum. -/ -@[expose] public section +public section namespace LeanPool.ErdosMoser diff --git a/LeanPool/ErdosMoser/SubsetSums.lean b/LeanPool/ErdosMoser/SubsetSums.lean index 5c139fb96f..0a77808f69 100644 --- a/LeanPool/ErdosMoser/SubsetSums.lean +++ b/LeanPool/ErdosMoser/SubsetSums.lean @@ -25,7 +25,7 @@ combines them with the discrete variance bound to obtain Leo Moser's exact finite sum-of-squares inequality. -/ -@[expose] public section +public section namespace LeanPool.ErdosMoser diff --git a/LeanPool/ErdosTuzaValtr.lean b/LeanPool/ErdosTuzaValtr.lean index e3639a8734..012a192bfa 100644 --- a/LeanPool/ErdosTuzaValtr.lean +++ b/LeanPool/ErdosTuzaValtr.lean @@ -26,7 +26,7 @@ Tags: combinatorics, discrete-geometry, convex-geometry, ramsey-theory MSC: 52C10, 05D10 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/ErdosTuzaValtr/All.lean b/LeanPool/ErdosTuzaValtr/All.lean index 3ae624d48d..d0efcdbdd5 100644 --- a/LeanPool/ErdosTuzaValtr/All.lean +++ b/LeanPool/ErdosTuzaValtr/All.lean @@ -42,4 +42,4 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.All`. -/ -@[expose] public section +public section diff --git a/LeanPool/ErdosTuzaValtr/Config/Default.lean b/LeanPool/ErdosTuzaValtr/Config/Default.lean index 3b2dc8d3b7..6cb9db7a67 100644 --- a/LeanPool/ErdosTuzaValtr/Config/Default.lean +++ b/LeanPool/ErdosTuzaValtr/Config/Default.lean @@ -22,4 +22,4 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Config.Default`. -/ -@[expose] public section +public section diff --git a/LeanPool/ErdosTuzaValtr/Config/Defs.lean b/LeanPool/ErdosTuzaValtr/Config/Defs.lean index efe5c6cb04..26649b80db 100644 --- a/LeanPool/ErdosTuzaValtr/Config/Defs.lean +++ b/LeanPool/ErdosTuzaValtr/Config/Defs.lean @@ -13,7 +13,7 @@ public import LeanPool.ErdosTuzaValtr.Lib.List.Defs Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Config.Defs`. -/ -@[expose] public section +public section /-- A configuration: a decidable ternary "cup" relation on a linearly ordered type. -/ @@ -29,7 +29,7 @@ variable {α : Type _} [ord : LinearOrder α] (C : Config α) attribute [instance] Config.DecidableCup3 /-- The 3-cap relation is the negation of the 3-cup relation. -/ -def Cap3 (a b c : α) : Prop := +@[expose] def Cap3 (a b c : α) : Prop := ¬C.Cup3 a b c /-- The 3-cap relation is decidable. -/ @@ -39,43 +39,42 @@ def DecidableCap3 : DecidableRel3 C.Cap3 := fun a b c => @instDecidableNot _ (C. attribute [instance] DecidableCap3 /-- A cap is a strictly increasing list whose consecutive triples are 3-caps. -/ -def Cap (l : List α) : Prop := +@[expose] def Cap (l : List α) : Prop := l.IsChain (· < ·) ∧ l.Chain3' C.Cap3 /-- A cup is a strictly increasing list whose consecutive triples are 3-cups. -/ -def Cup (l : List α) : Prop := +@[expose] def Cup (l : List α) : Prop := l.IsChain (· < ·) ∧ l.Chain3' C.Cup3 /-- A gon is a cap and a cup of length at least 2 sharing their first and last endpoints. -/ -@[simp] -def Gon (l1 l2 : List α) : Prop := +@[simp, expose] def Gon (l1 l2 : List α) : Prop := 2 ≤ l1.length ∧ C.Cap l1 ∧ 2 ≤ l2.length ∧ C.Cup l2 ∧ l1.head? = l2.head? ∧ l1.getLast? = l2.getLast? instance DecidableCup {l : List α} : Decidable (C.Cup l) := by rw [Cup]; infer_instance /-- An `n`-cap is a cap of length `n`. -/ -def NCap (n : ℕ) (l : List α) : Prop := +@[expose] def NCap (n : ℕ) (l : List α) : Prop := C.Cap l ∧ l.length = n /-- An `n`-cup is a cup of length `n`. -/ -def NCup (n : ℕ) (l : List α) : Prop := +@[expose] def NCup (n : ℕ) (l : List α) : Prop := C.Cup l ∧ l.length = n /-- An `n`-gon is a gon whose cap and cup lengths sum to `n + 2`. -/ -def NGon (n : ℕ) (l1 l2 : List α) : Prop := +@[expose] def NGon (n : ℕ) (l1 l2 : List α) : Prop := C.Gon l1 l2 ∧ l1.length + l2.length = n + 2 /-- A finset has an `n`-cap if some `n`-cap lies inside it. -/ -def HasNCap (n : ℕ) (S : Finset α) : Prop := +@[expose] def HasNCap (n : ℕ) (S : Finset α) : Prop := ∃ l : List α, C.NCap n l ∧ l.In S /-- A finset has an `n`-cup if some `n`-cup lies inside it. -/ -def HasNCup (n : ℕ) (S : Finset α) : Prop := +@[expose] def HasNCup (n : ℕ) (S : Finset α) : Prop := ∃ l : List α, C.NCup n l ∧ l.In S /-- A finset has an `n`-gon if some `n`-gon lies inside it. -/ -def HasNGon (n : ℕ) (S : Finset α) : Prop := +@[expose] def HasNGon (n : ℕ) (S : Finset α) : Prop := ∃ l1 l2 : List α, C.NGon n l1 l2 ∧ l1.In S ∧ l2.In S end Config diff --git a/LeanPool/ErdosTuzaValtr/Config/Lemmas.lean b/LeanPool/ErdosTuzaValtr/Config/Lemmas.lean index 5ad62f391a..06f6a89f66 100644 --- a/LeanPool/ErdosTuzaValtr/Config/Lemmas.lean +++ b/LeanPool/ErdosTuzaValtr/Config/Lemmas.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Config.Lemmas`. -/ -@[expose] public section +public section variable {α : Type _} [LinearOrder α] {C : Config α} diff --git a/LeanPool/ErdosTuzaValtr/Config/Mirror.lean b/LeanPool/ErdosTuzaValtr/Config/Mirror.lean index 05e4658ddd..4af46f268d 100644 --- a/LeanPool/ErdosTuzaValtr/Config/Mirror.lean +++ b/LeanPool/ErdosTuzaValtr/Config/Mirror.lean @@ -17,7 +17,7 @@ import LeanPool.ErdosTuzaValtr.Lib.List.Lemmas Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Config.Mirror`. -/ -@[expose] public section +public section variable {α : Type _} [LinearOrder α] (C : Config α) @@ -26,7 +26,7 @@ open OrderDual -- to_dual : α → αᵒᵈ -- of_dual : αᵒᵈ → α /-- The mirror configuration on the order dual, obtained by reversing the cup relation. -/ -def Config.Mirror : Config (OrderDual α) := +@[expose] def Config.Mirror : Config (OrderDual α) := ⟨Mirror3 C.Cup3, C.DecidableCup3.Mirror3⟩ variable {C} diff --git a/LeanPool/ErdosTuzaValtr/Etv/AlphaBeta.lean b/LeanPool/ErdosTuzaValtr/Etv/AlphaBeta.lean index fbba4ddbac..ea3ba7b493 100644 --- a/LeanPool/ErdosTuzaValtr/Etv/AlphaBeta.lean +++ b/LeanPool/ErdosTuzaValtr/Etv/AlphaBeta.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Etv.AlphaBeta`. -/ -@[expose] public section +public section noncomputable section @@ -180,7 +180,7 @@ namespace Config variable (C) (S) /-- A candidate beta-cup ending at `a`: a cup in `S` ending at `a`. -/ -def IsBetaCup (a : α) (c : List α) : Prop := +@[expose] def IsBetaCup (a : α) (c : List α) : Prop := (c ++ [a]).In S ∧ C.Cup (c ++ [a]) open Classical in diff --git a/LeanPool/ErdosTuzaValtr/Etv/Default.lean b/LeanPool/ErdosTuzaValtr/Etv/Default.lean index 84382543ad..2ed7d0d20e 100644 --- a/LeanPool/ErdosTuzaValtr/Etv/Default.lean +++ b/LeanPool/ErdosTuzaValtr/Etv/Default.lean @@ -23,4 +23,4 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Etv.Default`. -/ -@[expose] public section +public section diff --git a/LeanPool/ErdosTuzaValtr/Etv/Defs.lean b/LeanPool/ErdosTuzaValtr/Etv/Defs.lean index 4ea69b1f18..b2b7064df3 100644 --- a/LeanPool/ErdosTuzaValtr/Etv/Defs.lean +++ b/LeanPool/ErdosTuzaValtr/Etv/Defs.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Etv.Defs`. -/ -@[expose] public section +public section variable {α : Type _} [LinearOrder α] (C : Config α) @@ -26,7 +26,7 @@ namespace Config /-- `p` and `q` are laced of order `n` in `S`: an `n`-cup from `p` to `q` extends on both sides to cups whose lengths sum to `n`. -/ -def HasLaced (n : ℕ) (S : Finset α) (p q : α) : Prop := +@[expose] def HasLaced (n : ℕ) (S : Finset α) (p q : α) : Prop := ∃ (a b : ℕ) (cp c cq : List α) (_ : C.NCup a cp) (_ : C.NCup n c) (_ : C.NCup b cq), (cp.In S ∧ c.In S ∧ cq.In S) ∧ a + b = n ∧ p ∈ cp.getLast? ∧ p ∈ c.head? ∧ q ∈ c.getLast? ∧ q ∈ cq.head? @@ -41,11 +41,11 @@ theorem mem_ends {C : Config α} {n : ℕ} {S : Finset α} {p q : α} (h : C.Has end HasLaced /-- Two interweaving laced pairs `(p, r)` and `(q, s)` with `p < q ≤ r < s`. -/ -def HasInterweavedLaced (n : ℕ) (S : Finset α) (p q r s : α) : Prop := +@[expose] def HasInterweavedLaced (n : ℕ) (S : Finset α) (p q r s : α) : Prop := (p < q ∧ q ≤ r ∧ r < s) ∧ C.HasLaced n S p r ∧ C.HasLaced n S q s /-- A join of an `a`-cup and a `b`-cup in `S` meeting at a common point `p`. -/ -def HasJoin (a b : ℕ) (S : Finset α) : Prop := +@[expose] def HasJoin (a b : ℕ) (S : Finset α) : Prop := ∃ (p : α) (cl cr : List α), (C.NCup a cl ∧ cl.In S ∧ p ∈ cl.getLast?) ∧ C.NCup b cr ∧ cr.In S ∧ p ∈ cr.head? diff --git a/LeanPool/ErdosTuzaValtr/Etv/Label.lean b/LeanPool/ErdosTuzaValtr/Etv/Label.lean index 244a116932..5fadc9537a 100644 --- a/LeanPool/ErdosTuzaValtr/Etv/Label.lean +++ b/LeanPool/ErdosTuzaValtr/Etv/Label.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Etv.Label`. -/ -@[expose] public section +public section variable {α : Type _} [LinearOrder α] (C : Config α) @@ -43,7 +43,7 @@ structure Config.Label (S : Finset α) where /-- The canonical slope on a finset: `a, b` has this slope when every earlier point forms a 3-cup with `a, b`. -/ -def Cap4FreeSlope (S : Finset α) (a b : α) : Prop := +@[expose] def Cap4FreeSlope (S : Finset α) (a b : α) : Prop := ∀ c : S, ↑c < a → C.Cup3 c a b instance decidableCap4FreeSlope (S : Finset α) : diff --git a/LeanPool/ErdosTuzaValtr/Etv/Mirror.lean b/LeanPool/ErdosTuzaValtr/Etv/Mirror.lean index f6ab756a98..3b4aa4b2d6 100644 --- a/LeanPool/ErdosTuzaValtr/Etv/Mirror.lean +++ b/LeanPool/ErdosTuzaValtr/Etv/Mirror.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Etv.Mirror`. -/ -@[expose] public section +public section open OrderDual diff --git a/LeanPool/ErdosTuzaValtr/Lib/Core/Rel3.lean b/LeanPool/ErdosTuzaValtr/Lib/Core/Rel3.lean index 9bc0572d47..2755630d4b 100644 --- a/LeanPool/ErdosTuzaValtr/Lib/Core/Rel3.lean +++ b/LeanPool/ErdosTuzaValtr/Lib/Core/Rel3.lean @@ -13,22 +13,23 @@ public import Mathlib.Order.OrderDual Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Lib.Core.Rel3`. -/ -@[expose] public section +public section universe u v open OrderDual /-- Mirror a binary relation/function to the order dual, swapping argument order. -/ +@[expose] def Mirror2 {α : Type u} {β : Sort v} (f : α → α → β) : αᵒᵈ → αᵒᵈ → β := fun a b => f (ofDual b) (ofDual a) /-- Mirror a ternary relation/function to the order dual, reversing argument order. -/ -def Mirror3 {α : Type u} {β : Sort v} (f : α → α → α → β) : αᵒᵈ → αᵒᵈ → αᵒᵈ → β := +@[expose] def Mirror3 {α : Type u} {β : Sort v} (f : α → α → α → β) : αᵒᵈ → αᵒᵈ → αᵒᵈ → β := fun a b c => f (ofDual c) (ofDual b) (ofDual a) /-- Decidability of a ternary relation: each instance is decidable. -/ -@[reducible] +@[expose, reducible] def DecidableRel3 {α : Sort u} (r : α → α → α → Prop) := ∀ a b c : α, Decidable (r a b c) diff --git a/LeanPool/ErdosTuzaValtr/Lib/List/Chain3.lean b/LeanPool/ErdosTuzaValtr/Lib/List/Chain3.lean index ad77ab1c61..70e9f7ffbc 100644 --- a/LeanPool/ErdosTuzaValtr/Lib/List/Chain3.lean +++ b/LeanPool/ErdosTuzaValtr/Lib/List/Chain3.lean @@ -13,7 +13,7 @@ public import LeanPool.ErdosTuzaValtr.Lib.List.Defs Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Lib.List.Chain3`. -/ -@[expose] public section +public section variable {α : Type _} {R : α → α → α → Prop} diff --git a/LeanPool/ErdosTuzaValtr/Lib/List/Default.lean b/LeanPool/ErdosTuzaValtr/Lib/List/Default.lean index c2701e700c..2b6de2a880 100644 --- a/LeanPool/ErdosTuzaValtr/Lib/List/Default.lean +++ b/LeanPool/ErdosTuzaValtr/Lib/List/Default.lean @@ -19,4 +19,4 @@ import Mathlib.Tactic.SetLike Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Lib.List.Default`. -/ -@[expose] public section +public section diff --git a/LeanPool/ErdosTuzaValtr/Lib/List/Defs.lean b/LeanPool/ErdosTuzaValtr/Lib/List/Defs.lean index 71b770b2b5..36842e02a8 100644 --- a/LeanPool/ErdosTuzaValtr/Lib/List/Defs.lean +++ b/LeanPool/ErdosTuzaValtr/Lib/List/Defs.lean @@ -14,30 +14,30 @@ public import LeanPool.ErdosTuzaValtr.Lib.Core.Rel3 Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Lib.List.Defs`. -/ -@[expose] public section +public section variable {α : Type _} /-- Local notion for a list whose elements all lie in a finset. -/ -protected def List.In (l : List α) (S : Finset α) : Prop := +@[expose] protected def List.In (l : List α) (S : Finset α) : Prop := ∀ a : α, a ∈ l → a ∈ S /-- The image of a finset under the order-dual embedding. -/ -protected def Finset.Mirror [LinearOrder α] (S : Finset α) : Finset αᵒᵈ := +@[expose] protected def Finset.Mirror [LinearOrder α] (S : Finset α) : Finset αᵒᵈ := Finset.image OrderDual.toDual S /-- The image of a finset of order-dual elements back under `ofDual`. -/ -protected def Finset.ofMirror [LinearOrder α] (S : Finset αᵒᵈ) : Finset α := +@[expose] protected def Finset.ofMirror [LinearOrder α] (S : Finset αᵒᵈ) : Finset α := Finset.image OrderDual.ofDual S namespace List /-- Flip a list of elements together with its order, landing in the order dual. -/ -protected def Mirror (l : List α) : List αᵒᵈ := +@[expose] protected def Mirror (l : List α) : List αᵒᵈ := (List.map OrderDual.toDual l).reverse /-- Recover a list from its mirror in the order dual. -/ -protected def ofMirror (l : List αᵒᵈ) : List α := +@[expose] protected def ofMirror (l : List αᵒᵈ) : List α := (List.map OrderDual.ofDual l).reverse variable (R : α → α → α → Prop) @@ -48,7 +48,7 @@ inductive Chain3 : α → α → List α → Prop | cons : ∀ {a b c : α} {l : List α}, R a b c → Chain3 b c l → Chain3 a b (c :: l) /-- `Chain3' R l` means `R` holds for every three consecutive entries of `l`. -/ -def Chain3' : List α → Prop +@[expose] def Chain3' : List α → Prop | nil => True | [_] => True | a :: b :: l => Chain3 R a b l diff --git a/LeanPool/ErdosTuzaValtr/Lib/List/Lemmas.lean b/LeanPool/ErdosTuzaValtr/Lib/List/Lemmas.lean index a453dc50a7..79e2f55426 100644 --- a/LeanPool/ErdosTuzaValtr/Lib/List/Lemmas.lean +++ b/LeanPool/ErdosTuzaValtr/Lib/List/Lemmas.lean @@ -15,7 +15,7 @@ import Mathlib.Data.List.Chain Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Lib.List.Lemmas`. -/ -@[expose] public section +public section variable {α : Type _} diff --git a/LeanPool/ErdosTuzaValtr/Main/CapCup.lean b/LeanPool/ErdosTuzaValtr/Main/CapCup.lean index 39713e82d1..f8aa591aa6 100644 --- a/LeanPool/ErdosTuzaValtr/Main/CapCup.lean +++ b/LeanPool/ErdosTuzaValtr/Main/CapCup.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Ring.RingNF Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.CapCup`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/ErdosTuzaValtr/Main/Defs.lean b/LeanPool/ErdosTuzaValtr/Main/Defs.lean index 63ecc5d595..fbe91115bc 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Defs.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Defs.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Defs`. -/ -@[expose] public section +public section noncomputable section @@ -28,13 +28,13 @@ variable {α : Type _} [LinearOrder α] (C : Config α) /-- The configuration-relative main goal at level `n`: any large cap-free, cup-free finset contains an interweaved laced configuration. -/ -def Config.MainGoal (n : ℕ) : Prop := +@[expose] def Config.MainGoal (n : ℕ) : Prop := ∀ S : Finset α, Nat.choose (n + 2) 2 + 2 ≤ S.card → ¬C.HasNCap 4 S → ¬C.HasNCup (n + 3) S → ∃ p q r s, C.HasInterweavedLaced (n + 2) S p q r s /-- The main goal under the without-loss-of-generality assumption that a certain join is absent. -/ -def Config.MainGoalWlog (n : ℕ) : Prop := +@[expose] def Config.MainGoalWlog (n : ℕ) : Prop := ∀ S : Finset α, ¬C.HasJoin (n + 2) (n + 1) S → Nat.choose (n + 2) 2 + 2 ≤ S.card → diff --git a/LeanPool/ErdosTuzaValtr/Main/InductionStep.lean b/LeanPool/ErdosTuzaValtr/Main/InductionStep.lean index 75382e5db1..7cf64517a5 100644 --- a/LeanPool/ErdosTuzaValtr/Main/InductionStep.lean +++ b/LeanPool/ErdosTuzaValtr/Main/InductionStep.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.OfScientific Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.InductionStep`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/ErdosTuzaValtr/Main/Lemmas/Default.lean b/LeanPool/ErdosTuzaValtr/Main/Lemmas/Default.lean index 20bc4c523f..2a98eb7cc3 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Lemmas/Default.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Lemmas/Default.lean @@ -23,4 +23,4 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Lemmas.Default`. -/ -@[expose] public section +public section diff --git a/LeanPool/ErdosTuzaValtr/Main/Lemmas/InterweavedLacedNgon.lean b/LeanPool/ErdosTuzaValtr/Main/Lemmas/InterweavedLacedNgon.lean index d0afb7d862..40acc4a700 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Lemmas/InterweavedLacedNgon.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Lemmas/InterweavedLacedNgon.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Lemmas.InterweavedLacedNgon`. -/ -@[expose] public section +public section open OrderDual diff --git a/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N2.lean b/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N2.lean index aeaaadf551..9111bc94e4 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N2.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N2.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Lemmas.JoinN2N2`. -/ -@[expose] public section +public section open OrderDual diff --git a/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3JoinN3N2.lean b/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3JoinN3N2.lean index 136d37c055..99cc43aa25 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3JoinN3N2.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3JoinN3N2.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Lemmas.JoinN2N3JoinN3N2`. -/ -@[expose] public section +public section open OrderDual diff --git a/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3N2.lean b/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3N2.lean index d7ec81e4ad..1c898f1974 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3N2.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Lemmas/JoinN2N3N2.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Lemmas.JoinN2N3N2`. -/ -@[expose] public section +public section open OrderDual diff --git a/LeanPool/ErdosTuzaValtr/Main/Main.lean b/LeanPool/ErdosTuzaValtr/Main/Main.lean index b6af202140..d234f1457b 100644 --- a/LeanPool/ErdosTuzaValtr/Main/Main.lean +++ b/LeanPool/ErdosTuzaValtr/Main/Main.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ErdosTuzaValtr.Main.Main`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/EvenGraphCycles.lean b/LeanPool/EvenGraphCycles.lean index e69d6b2958..83cd7580df 100644 --- a/LeanPool/EvenGraphCycles.lean +++ b/LeanPool/EvenGraphCycles.lean @@ -69,7 +69,7 @@ minimum positive degree at least two, so a path of maximal length closes up into * `Finset.edgeSupport`: the set of vertices incident with an edge of a finite edge set. -/ -@[expose] public section +public section open Finset @@ -78,7 +78,7 @@ namespace List variable {V : Type*} /-- The list of edges of the walk `l`: the pairs of consecutive vertices of `l`. -/ -def pathEdges : List V → List (Sym2 V) +@[expose] def pathEdges : List V → List (Sym2 V) | [] => [] | [_] => [] | a :: b :: l => s(a, b) :: pathEdges (b :: l) diff --git a/LeanPool/EventStructures.lean b/LeanPool/EventStructures.lean index 7f07de803e..47b963ff8d 100644 --- a/LeanPool/EventStructures.lean +++ b/LeanPool/EventStructures.lean @@ -26,7 +26,7 @@ Tags: concurrency, order-theory, reversible-computation, event-structures MSC: 68Q85, 06A06 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/EventStructures/Basic.lean b/LeanPool/EventStructures/Basic.lean index 6b965e588f..561a73fe7c 100644 --- a/LeanPool/EventStructures/Basic.lean +++ b/LeanPool/EventStructures/Basic.lean @@ -17,7 +17,7 @@ with the derived consistency, concurrency, minimal-conflict and past/future notions used throughout the development, and decidability data for events. -/ -@[expose] public section +public section namespace EventStructures @@ -43,7 +43,7 @@ instance : PartialOrder es.Event := es.poEvent local infixl:50 " # " => es.conflict /-- Consistency relation: two events are consistent if they are not in conflict. -/ -@[simp] +@[expose, simp] def consistent (e₁ e₂ : es.Event) : Prop := ¬ (e₁ # e₂) /-- Consistency is reflexive. -/ @@ -71,7 +71,7 @@ lemma concurrent_symm : ∀ ⦃e₁ e₂⦄, es.concurrent e₁ e₂ → es.conc /-- Minimal conflict relation: (e₁, e₂) is a minimal conflicting pair if they conflict and there is no proper reduction of either that still produces a conflict. Formally: e₁ # e₂ and for all e₁' ≤ e₁, e₂' ≤ e₂, if e₁' # e₂' then e₁' = e₁ ∧ e₂' = e₂ -/ -@[simp] +@[expose, simp] def minimalConflict (e₁ e₂ : es.Event) : Prop := es.conflict e₁ e₂ ∧ ∀ e₁' e₂', e₁' ≤ e₁ → e₂' ≤ e₂ → es.conflict e₁' e₂' → e₁' = e₁ ∧ e₂' = e₂ @@ -98,10 +98,10 @@ lemma minimalConflict_minimal {e₁ e₂ e₁' e₂' : es.Event} (h : es.minimal h.2 e₁' e₂' he₁ he₂ hConf /-- The strict past of an event: all events strictly preceding it. -/ -@[simp] def past (e : es.Event) : Set es.Event := {x | x < e} +@[expose, simp] def past (e : es.Event) : Set es.Event := {x | x < e} /-- The future (upset) of an event: all events causally succeeding it. -/ -@[simp] def future (e : es.Event) : Set es.Event := {x | e ≤ x} +@[expose, simp] def future (e : es.Event) : Set es.Event := {x | e ≤ x} end EventStructure diff --git a/LeanPool/EventStructures/Computation.lean b/LeanPool/EventStructures/Computation.lean index 692538e5a0..6563a3fc26 100644 --- a/LeanPool/EventStructures/Computation.lean +++ b/LeanPool/EventStructures/Computation.lean @@ -17,7 +17,7 @@ configurations, and linearisations, and relates computations to the configurations they reach. -/ -@[expose] public section +public section namespace EventStructures @@ -40,11 +40,11 @@ def emptyConf : Conf es := starting at the empty configuration and ending at `c`. Equivalently, a computation records a causal execution up to trace equivalence of the underlying path. -/ -def Computation (c : Conf es) : Type _ := +@[expose] def Computation (c : Conf es) : Type _ := Path.Async es (emptyConf es) c /-- The type of all computations, paired with their target configuration. -/ -def Computations : Type _ := Σ c : Conf es, Computation es c +@[expose] def Computations : Type _ := Σ c : Conf es, Computation es c /-- A list of events `t` is a linearisation of configuration `c` if it is trace-equivalent to the trace of some path from the @@ -60,7 +60,7 @@ lemma computation_is_linearisation {c : Conf es} (comp : Computation es c) : refine ⟨Path.trace es p, ⟨p, TraceEquiv.refl _⟩⟩ /-- Configurations that are reachable by a computation. -/ -def ReachableConf : Type _ := {c : Conf es // Nonempty (Computation es c)} +@[expose] def ReachableConf : Type _ := {c : Conf es // Nonempty (Computation es c)} /-- Every computation targets a reachable configuration. -/ def computationToReachable : Computations es → ReachableConf es := diff --git a/LeanPool/EventStructures/Configuration.lean b/LeanPool/EventStructures/Configuration.lean index 9cfa54d67c..7b56bcf95e 100644 --- a/LeanPool/EventStructures/Configuration.lean +++ b/LeanPool/EventStructures/Configuration.lean @@ -18,19 +18,19 @@ enabling relation between a configuration and an event, and proves that enabling an event extends a configuration. -/ -@[expose] public section +public section namespace EventStructures variable (es : EventStructure) /-- A set of events is a configuration if it is conflict-free and downward closed. -/ -@[simp] def isConf (X : Set es.Event) : Prop := +@[expose, simp] def isConf (X : Set es.Event) : Prop := (∀ {e₁ e₂}, e₁ ∈ X → e₂ ∈ X → ¬ es.conflict e₁ e₂) ∧ (∀ {e e'}, e ∈ X → e' ≤ e → e' ∈ X) /-- Type of all configurations of an event structure. -/ -def Conf : Type := {X : Set es.Event // isConf es X} +@[expose] def Conf : Type := {X : Set es.Event // isConf es X} /-- Type of all finite configurations of an event structure. -/ def FinConf : Type := {X : Finset es.Event // isConf es (X : Set es.Event)} @@ -40,7 +40,7 @@ namespace Configuration /-- A configuration c enables an event e if e is fresh (not already in c), e is consistent with all events in c, and the past of e is contained in c. Freshness rules out self-loop edges in the configuration graph. -/ -def enables (c : Set es.Event) (e : es.Event) : Prop := +@[expose] def enables (c : Set es.Event) (e : es.Event) : Prop := isConf es c ∧ e ∉ c ∧ (∀ e' ∈ c, es.consistent e e') ∧ diff --git a/LeanPool/EventStructures/FinitePoset.lean b/LeanPool/EventStructures/FinitePoset.lean index bbdf88c11e..105a5e3842 100644 --- a/LeanPool/EventStructures/FinitePoset.lean +++ b/LeanPool/EventStructures/FinitePoset.lean @@ -16,7 +16,7 @@ of a partial order with well-founded strict order (or, constructively, of any partial order) has a minimal element. -/ -@[expose] public section +public section namespace EventStructures diff --git a/LeanPool/EventStructures/Log.lean b/LeanPool/EventStructures/Log.lean index 281563535f..cceee3fc4a 100644 --- a/LeanPool/EventStructures/Log.lean +++ b/LeanPool/EventStructures/Log.lean @@ -16,7 +16,7 @@ have a minimal conflict with some event outside the configuration), and the notion of a computation being compatible with a log. -/ -@[expose] public section +public section namespace EventStructures @@ -75,7 +75,7 @@ lemma log_has_conflict_outside {c : Conf es} {e : es.Event} (he : e ∈ log es c 1. All events in l are in σ's target configuration 2. Events in σ are consistent with events in l 3. If an event in σ conflicts with any event, it must be in l -/ -@[simp] +@[expose, simp] def compatibleWithLog (σ : Computations es) (l : Set es.Event) : Prop := (∀ e ∈ l, e ∈ σ.1.1) ∧ (∀ e ∈ σ.1.1, ∀ e' ∈ l, ¬ (e # e')) ∧ @@ -100,7 +100,7 @@ lemma compatibleWithLog_conflict_in_log {σ : Computations es} {l : Set es.Event h.2.2 e he e' hconf /-- The type of all computations compatible with a given log. -/ -def CompatibleComputations (l : Set es.Event) : Type _ := +@[expose] def CompatibleComputations (l : Set es.Event) : Type _ := {σ : Computations es // σ ⊨ l} /-- Extract the underlying computation from a compatible computation. -/ diff --git a/LeanPool/EventStructures/Path.lean b/LeanPool/EventStructures/Path.lean index ab2b9353ef..254373669c 100644 --- a/LeanPool/EventStructures/Path.lean +++ b/LeanPool/EventStructures/Path.lean @@ -20,7 +20,7 @@ quotient of paths by trace equivalence (asynchronous paths), and the resulting (synchronous and asynchronous) path categories. -/ -@[expose] public section +public section namespace EventStructures @@ -49,18 +49,18 @@ inductive Path : Conf es → Conf es → Type _ namespace Path /-- Identity path. -/ -def pathId (c : Conf es) : Path es c c := +@[expose] def pathId (c : Conf es) : Path es c c := Path.refl /-- Composition of paths. -/ -def pathComp {c₁ c₂ c₃ : Conf es} (h₁₂ : Path es c₁ c₂) (h₂₃ : Path es c₂ c₃) : +@[expose] def pathComp {c₁ c₂ c₃ : Conf es} (h₁₂ : Path es c₁ c₂) (h₂₃ : Path es c₂ c₃) : Path es c₁ c₃ := match h₁₂ with | refl => h₂₃ | step hEdge hPath => Path.step hEdge (pathComp hPath h₂₃) /-- Next configuration after executing an enabled event. -/ -def nextConf (c : Conf es) (e : es.Event) (h : c.val ⊢ e) : Conf es := +@[expose] def nextConf (c : Conf es) (e : es.Event) (h : c.val ⊢ e) : Conf es := ⟨c.val ∪ {e}, enables_extension (es:=es) h⟩ /-- Execute a list of events from a configuration. -/ @@ -94,13 +94,13 @@ lemma path_comp_assoc {c₁ c₂ c₃ c₄ : Conf es} simp only [pathComp, ih] /-- Trace of the path -/ -def trace {c₁ c₂ : Conf es} (hPath : Path es c₁ c₂) : List es.Event := +@[expose] def trace {c₁ c₂ : Conf es} (hPath : Path es c₁ c₂) : List es.Event := match hPath with | refl => [] | step hEdge hPath' => hEdge.event :: trace hPath' /-- Length of a path, defined as the length of its trace. -/ -def length {c₁ c₂ : Conf es} (hPath : Path es c₁ c₂) : Nat := +@[expose] def length {c₁ c₂ : Conf es} (hPath : Path es c₁ c₂) : Nat := (trace es hPath).length @[simp] lemma length_refl {c : Conf es} : length es (Path.refl (c:=c)) = 0 := @@ -279,7 +279,7 @@ lemma trace_comp {c₁ c₂ c₃ : Conf es} (p₁₂ : Path es c₁ c₂) (p₂ simp only [pathComp, trace, ih, List.cons_append] /-- Asynchronous path: paths quotiented by path equivalence. -/ -def Async (c₁ c₂ : Conf es) : Type _ := +@[expose] def Async (c₁ c₂ : Conf es) : Type _ := Quotient (pathSetoid es c₁ c₂) namespace Async diff --git a/LeanPool/EventStructures/Replay.lean b/LeanPool/EventStructures/Replay.lean index 31f72d59d6..fda35a9f78 100644 --- a/LeanPool/EventStructures/Replay.lean +++ b/LeanPool/EventStructures/Replay.lean @@ -20,7 +20,7 @@ existence is established relative to a computation compatible with the log that reaches the corresponding replay set, not unconditionally. -/ -@[expose] public section +public section namespace EventStructures diff --git a/LeanPool/EventStructures/Rollback.lean b/LeanPool/EventStructures/Rollback.lean index 80a016ab69..112cf8a824 100644 --- a/LeanPool/EventStructures/Rollback.lean +++ b/LeanPool/EventStructures/Rollback.lean @@ -19,7 +19,7 @@ and causal safety, and—given a finite representation—correctness (the origin configuration is reachable from the rollback) and minimality. -/ -@[expose] public section +public section namespace EventStructures @@ -80,7 +80,7 @@ lemma rollback_future_isConf {c : Conf es} {e : es.Event} : exact ⟨c.2.2 hxc hy, fun hyf => hxf (le_trans hyf hy)⟩ /-- The canonical rollback configuration: remove all events causally after `e`. -/ -def rollbackFuture (c : Conf es) (e : es.Event) : Conf es := +@[expose] def rollbackFuture (c : Conf es) (e : es.Event) : Conf es := ⟨c.1 \ es.future e, rollback_future_isConf (es := es) (c := c)⟩ @[simp] lemma rollbackFuture_val (c : Conf es) (e : es.Event) : diff --git a/LeanPool/EventStructures/Trace.lean b/LeanPool/EventStructures/Trace.lean index 2caf4521e8..8fbdcaa9c9 100644 --- a/LeanPool/EventStructures/Trace.lean +++ b/LeanPool/EventStructures/Trace.lean @@ -17,7 +17,7 @@ relation and a congruence for concatenation, and builds the trace monoid as the quotient of lists of events by trace equivalence. -/ -@[expose] public section +public section namespace EventStructures @@ -105,32 +105,41 @@ instance traceEquivSetoid : Setoid (List es.Event) where iseqv := ⟨@traceEquiv_refl es, @traceEquiv_symm es, @traceEquiv_trans es⟩ /-- The trace monoid: lists of events quotiented by trace equivalence. -/ -def TraceMonoid : Type := Quotient (traceEquivSetoid es) +@[expose] def TraceMonoid : Type := Quotient (traceEquivSetoid es) namespace Monoid /-- Lift a list to the trace monoid. -/ -def mk (t : List es.Event) : TraceMonoid es := Quotient.mk (traceEquivSetoid es) t +@[expose] def mk (t : List es.Event) : TraceMonoid es := Quotient.mk (traceEquivSetoid es) t /-- Multiplication in the trace monoid (concatenation of traces). -/ instance : Mul (TraceMonoid es) where mul := Quotient.lift₂ (fun t₁ t₂ => mk es (t₁ ++ t₂)) - (fun _ _ _ _ h₁ h₂ => Quotient.sound (traceEquiv_append es h₁ h₂)) + (by + intro _ _ _ _ h₁ h₂ + exact Quotient.sound (traceEquiv_append es h₁ h₂)) /-- Identity element in the trace monoid (empty trace). -/ instance : One (TraceMonoid es) where one := mk es [] +@[simp] theorem mk_mul (t₁ t₂ : List es.Event) : + mk es t₁ * mk es t₂ = mk es (t₁ ++ t₂) := by rfl + +@[simp] theorem mk_one : (1 : TraceMonoid es) = mk es [] := by rfl + /-- Left identity law for trace monoid. -/ lemma one_mul (x : TraceMonoid es) : 1 * x = x := by obtain ⟨t, rfl⟩ := Quotient.exists_rep x - change mk es ([] ++ t) = mk es t + change mk es [] * mk es t = mk es t + rw [mk_mul] simp /-- Right identity law for trace monoid. -/ lemma mul_one (x : TraceMonoid es) : x * 1 = x := by obtain ⟨t, rfl⟩ := Quotient.exists_rep x - change mk es (t ++ []) = mk es t + change mk es t * mk es [] = mk es t + rw [mk_mul] simp /-- Associativity law for trace monoid. -/ @@ -138,8 +147,9 @@ lemma mul_assoc (x y z : TraceMonoid es) : (x * y) * z = x * (y * z) := by obtain ⟨t₁, rfl⟩ := Quotient.exists_rep x obtain ⟨t₂, rfl⟩ := Quotient.exists_rep y obtain ⟨t₃, rfl⟩ := Quotient.exists_rep z - change mk es ((t₁ ++ t₂) ++ t₃) = mk es (t₁ ++ (t₂ ++ t₃)) - simp + change (mk es t₁ * mk es t₂) * mk es t₃ = + mk es t₁ * (mk es t₂ * mk es t₃) + simp only [mk_mul, List.append_assoc] /-- The trace monoid is a monoid. -/ instance : Monoid (TraceMonoid es) where diff --git a/LeanPool/ExpChaotic/Basic.lean b/LeanPool/ExpChaotic/Basic.lean index 0a991356b5..7ff83f5d07 100644 --- a/LeanPool/ExpChaotic/Basic.lean +++ b/LeanPool/ExpChaotic/Basic.lean @@ -22,7 +22,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity @@ -51,18 +51,21 @@ theorem expIterate_succ (n : ℕ) (z : ℂ) : simp [expIterate, exponentialMap, Function.iterate_succ_apply'] /-- The closed horizontal strip used in Misiurewicz's proof. -/ -def centralStrip : Set ℂ := {z | |z.im| ≤ Real.pi / 3} +@[expose] def centralStrip : Set ℂ := {z | |z.im| ≤ Real.pi / 3} /-- The right half-plane used in Misiurewicz's proof. -/ +@[expose] def rightHalfPlane : Set ℂ := {z | 4 < z.re} /-- The wider closed strip occurring in Lemma 5. -/ +@[expose] def wideStrip : Set ℂ := {z | |z.im| ≤ 2 * Real.pi} /-- A complex number lies on the embedded real axis. -/ -def OnRealAxis (z : ℂ) : Prop := z.im = 0 +@[expose] def OnRealAxis (z : ℂ) : Prop := z.im = 0 /-- Some forward image of `V` meets the real axis. -/ +@[expose] def EventuallyMeetsRealAxis (V : Set ℂ) : Prop := ∃ n : ℕ, ∃ z ∈ V, OnRealAxis (expIterate n z) diff --git a/LeanPool/ExpChaotic/Covering.lean b/LeanPool/ExpChaotic/Covering.lean index 1a31b64ccd..9cda7fa793 100644 --- a/LeanPool/ExpChaotic/Covering.lean +++ b/LeanPool/ExpChaotic/Covering.lean @@ -19,7 +19,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity diff --git a/LeanPool/ExpChaotic/Dynamics.lean b/LeanPool/ExpChaotic/Dynamics.lean index 7bc44d6a57..b60dcaf683 100644 --- a/LeanPool/ExpChaotic/Dynamics.lean +++ b/LeanPool/ExpChaotic/Dynamics.lean @@ -20,7 +20,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity @@ -38,6 +38,7 @@ whose orbit visits each member of a fixed countable basis of the plane. -/ /-- A point escapes to infinity if its orbit eventually leaves every centred Euclidean ball. -/ +@[expose] def EscapesToInfinity (z : ℂ) : Prop := ∀ R : ℝ, ∃ N : ℕ, ∀ n ≥ N, R ≤ ‖expIterate n z‖ diff --git a/LeanPool/ExpChaotic/Expansion.lean b/LeanPool/ExpChaotic/Expansion.lean index a7ebbc808e..33cd88ca6c 100644 --- a/LeanPool/ExpChaotic/Expansion.lean +++ b/LeanPool/ExpChaotic/Expansion.lean @@ -23,7 +23,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity diff --git a/LeanPool/ExpChaotic/HalfPlane.lean b/LeanPool/ExpChaotic/HalfPlane.lean index db26036190..f0b3c66c81 100644 --- a/LeanPool/ExpChaotic/HalfPlane.lean +++ b/LeanPool/ExpChaotic/HalfPlane.lean @@ -21,7 +21,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity diff --git a/LeanPool/ExpChaotic/Normality.lean b/LeanPool/ExpChaotic/Normality.lean index f823cf8147..c29006ccae 100644 --- a/LeanPool/ExpChaotic/Normality.lean +++ b/LeanPool/ExpChaotic/Normality.lean @@ -27,7 +27,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity diff --git a/LeanPool/ExpChaotic/PaperConsequences.lean b/LeanPool/ExpChaotic/PaperConsequences.lean index c2cdb5a5d8..78d7029391 100644 --- a/LeanPool/ExpChaotic/PaperConsequences.lean +++ b/LeanPool/ExpChaotic/PaperConsequences.lean @@ -22,7 +22,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric diff --git a/LeanPool/ExpChaotic/Periodic.lean b/LeanPool/ExpChaotic/Periodic.lean index 6f7955ae6d..746d0324ed 100644 --- a/LeanPool/ExpChaotic/Periodic.lean +++ b/LeanPool/ExpChaotic/Periodic.lean @@ -22,7 +22,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity diff --git a/LeanPool/ExpChaotic/RealAxis.lean b/LeanPool/ExpChaotic/RealAxis.lean index aaecd098de..190c48a118 100644 --- a/LeanPool/ExpChaotic/RealAxis.lean +++ b/LeanPool/ExpChaotic/RealAxis.lean @@ -20,7 +20,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity diff --git a/LeanPool/ExpChaotic/Results.lean b/LeanPool/ExpChaotic/Results.lean index eb5afe6783..d71805bfa7 100644 --- a/LeanPool/ExpChaotic/Results.lean +++ b/LeanPool/ExpChaotic/Results.lean @@ -26,7 +26,7 @@ escaping set, John Harrison's HOL Light formalisation of Misiurewicz's original See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric diff --git a/LeanPool/ExpChaotic/Spherical.lean b/LeanPool/ExpChaotic/Spherical.lean index 0ff85eef52..7c866fe8e6 100644 --- a/LeanPool/ExpChaotic/Spherical.lean +++ b/LeanPool/ExpChaotic/Spherical.lean @@ -23,7 +23,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity @@ -87,6 +87,7 @@ def riemannSphereUniformEquivUnitSphere : uniformContinuous_invFun := CompactSpace.uniformContinuous_of_continuous e.symm.continuous } /-- The exponential iterates from the Euclidean plane to the Riemann sphere. -/ +@[expose] def sphericalExpIterate (n : ℕ) (z : ℂ) : RiemannSphere := (expIterate n z : OnePoint ℂ) diff --git a/LeanPool/ExpChaotic/StripGeometry.lean b/LeanPool/ExpChaotic/StripGeometry.lean index bd8725b44d..9640565e7b 100644 --- a/LeanPool/ExpChaotic/StripGeometry.lean +++ b/LeanPool/ExpChaotic/StripGeometry.lean @@ -22,7 +22,7 @@ The initial proof architecture uses John Harrison's HOL Light formalisation. See `LeanPool.ExpChaotic` for attribution and the upstream source. -/ -@[expose] public section +public section open Function Filter Set Metric open scoped Topology NNReal Uniformity @@ -69,6 +69,7 @@ since `cos ((2m+1)π) = -1`. Getting an odd multiple needs an imaginary spread o rather than `π`, which both branches of Lemma 4 in fact supply. -/ /-- Some forward image of `V` lands on the negative real axis. -/ +@[expose] def EventuallyMeetsNegativeRealAxis (V : Set ℂ) : Prop := ∃ n : ℕ, ∃ z ∈ V, (expIterate n z).im = 0 ∧ (expIterate n z).re < 0 diff --git a/LeanPool/FactorizationSystems.lean b/LeanPool/FactorizationSystems.lean index 544652c501..b1205d7613 100644 --- a/LeanPool/FactorizationSystems.lean +++ b/LeanPool/FactorizationSystems.lean @@ -24,4 +24,4 @@ Tags: category-theory, factorization-systems, orthogonality MSC: 18A32, 18A40 -/ -@[expose] public section +public section diff --git a/LeanPool/FactorizationSystems/Basic.lean b/LeanPool/FactorizationSystems/Basic.lean index b437f03d2c..c3001a04df 100644 --- a/LeanPool/FactorizationSystems/Basic.lean +++ b/LeanPool/FactorizationSystems/Basic.lean @@ -12,14 +12,14 @@ import Mathlib.Tactic.Attr.Core # LeanPool.FactorizationSystems.Basic -/ -@[expose] public section +public section namespace CategoryTheory universe u v u' v' variable {C : Type u} [Category.{v} C] {D : Type u'} [Category.{v'} D] /-- The predicate that a class of morphism contains the isomorphisms -/ -def containsIsos (W : MorphismProperty C) : Prop := +@[expose] def containsIsos (W : MorphismProperty C) : Prop := ∀ ⦃X Y : C⦄ (f : X ≅ Y) , W f.hom /-- The predicate of a class of morphisms being closed under compositin -/ diff --git a/LeanPool/FactorizationSystems/Characterization.lean b/LeanPool/FactorizationSystems/Characterization.lean index 04c5ac264f..3756b7f31b 100644 --- a/LeanPool/FactorizationSystems/Characterization.lean +++ b/LeanPool/FactorizationSystems/Characterization.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.SetLike # LeanPool.FactorizationSystems.Characterization -/ -@[expose] public section +public section namespace CategoryTheory universe u v @@ -83,7 +83,7 @@ def WFSOfFS (L R : MorphismProperty C) (F : FactorizationSystem L R) : /- The predicate of classes of morphisms being orthogonal -/ /-- Imported FactorizationSystems declaration. -/ -def orthogonalClass (L R : MorphismProperty C) := +@[expose] def orthogonalClass (L R : MorphismProperty C) := ∀ ⦃A B X Y : C⦄ (l : A ⟶ B) (_ : L l) (r : X ⟶ Y) (_ : R r) , orthogonal l r /- Towards the proof that the two classes of a factorization system are orthogonal -/ diff --git a/LeanPool/FactorizationSystems/Examples.lean b/LeanPool/FactorizationSystems/Examples.lean index 0828b9b660..f0ebf42997 100644 --- a/LeanPool/FactorizationSystems/Examples.lean +++ b/LeanPool/FactorizationSystems/Examples.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.SetLike # LeanPool.FactorizationSystems.Examples -/ -@[expose] public section +public section namespace CategoryTheory universe u v @@ -62,7 +62,7 @@ lemma monomorphismsClosedUnderComp : is_closed_comp (MorphismProperty.monomorphi /- The image of a function of sets -/ /-- Imported FactorizationSystems declaration. -/ -def imageSet {X Y : Type u} (f : X ⟶ Y) : Type u := {y : Y // ∃ x : X , f x = y} +@[expose] def imageSet {X Y : Type u} (f : X ⟶ Y) : Type u := {y : Y // ∃ x : X , f x = y} /- Left map of the image factorization of a map -/ /-- Imported FactorizationSystems declaration. -/ diff --git a/LeanPool/FactorizationSystems/OrthogonalComplements.lean b/LeanPool/FactorizationSystems/OrthogonalComplements.lean index c2ad123b0a..a9665a93f4 100644 --- a/LeanPool/FactorizationSystems/OrthogonalComplements.lean +++ b/LeanPool/FactorizationSystems/OrthogonalComplements.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.SetLike # LeanPool.FactorizationSystems.OrthogonalComplements -/ -@[expose] public section +public section namespace CategoryTheory universe u v @@ -24,13 +24,13 @@ variable {C : Type u} [Category.{v} C] /- The right orthogonal complement of a class of morphisms W in a category C -/ /-- Imported FactorizationSystems declaration. -/ -def rightOrthogonalComplement : (W : MorphismProperty C) → MorphismProperty C := by +@[expose] def rightOrthogonalComplement : (W : MorphismProperty C) → MorphismProperty C := by intro W _ _ f exact ∀ ⦃A B : C ⦄ (g : A ⟶ B) (p : W g) , (homOrthogonal g f) /- The left orthogonal complement of a class of morphisms W in a category C-/ /-- Imported FactorizationSystems declaration. -/ -def leftOrthogonalComplement : (W : MorphismProperty C) → MorphismProperty C := by +@[expose] def leftOrthogonalComplement : (W : MorphismProperty C) → MorphismProperty C := by intro W _ _ f exact ∀ ⦃A B : C⦄ (g : A ⟶ B) (p : W g) , (homOrthogonal f g) diff --git a/LeanPool/FactorizationSystems/Orthogonality.lean b/LeanPool/FactorizationSystems/Orthogonality.lean index 748eeaf23a..4fcbcc9952 100644 --- a/LeanPool/FactorizationSystems/Orthogonality.lean +++ b/LeanPool/FactorizationSystems/Orthogonality.lean @@ -14,7 +14,7 @@ import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits # LeanPool.FactorizationSystems.Orthogonality -/ -@[expose] public section +public section /- Given two morphisms l: A ⟶ B and r: X ⟶ Y in a category C, we say that l is left orthogonal to r @@ -155,7 +155,7 @@ def homSquare : {A B X Y : C} → (l : A ⟶ B) → (r : X ⟶ Y) → /- The canonical pullback of the cospan given by the right and bottom maps in the hom square -/ /-- Imported FactorizationSystems declaration. -/ -def homCospanPullback : {A B X Y : C} → (l : A ⟶ B) → (r : X ⟶ Y) → Type v := by +@[expose] def homCospanPullback : {A B X Y : C} → (l : A ⟶ B) → (r : X ⟶ Y) → Type v := by intro A B X Y l r exact Limits.pullback (homSquareRight l r) (homSquareBot l r) @@ -432,13 +432,13 @@ lemma diagonals_comm {A B X Y : C} (l : A ⟶ B) (r : X ⟶ Y) : := by rw [(homSquare l r).comm] /-- Imported FactorizationSystems declaration. -/ -def diagonalsCone +@[expose] def diagonalsCone {A B X Y : C} (l : A ⟶ B) (r : X ⟶ Y) : Limits.PullbackCone (homSquare l r).right (homSquare l r).bot := Limits.PullbackCone.mk (homSquare l r).top (homSquare l r).left (diagonals_comm l r) /-- Imported FactorizationSystems declaration. -/ -def diagonalsConePoint +@[expose] def diagonalsConePoint {A B X Y : C} (l : A ⟶ B) (r : X ⟶ Y) : Type v := (diagonalsCone l r).pt diff --git a/LeanPool/Feige.lean b/LeanPool/Feige.lean index 9a36832c8a..7acca191c2 100644 --- a/LeanPool/Feige.lean +++ b/LeanPool/Feige.lean @@ -19,7 +19,7 @@ Tags: probability, concentration-inequalities, convex-geometry, sharp-constants MSC: 60E15, 52A20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Feige/AugmentedLatentSupport.lean b/LeanPool/Feige/AugmentedLatentSupport.lean index fcdc848fb6..9dbbd4f4e3 100644 --- a/LeanPool/Feige/AugmentedLatentSupport.lean +++ b/LeanPool/Feige/AugmentedLatentSupport.lean @@ -12,7 +12,7 @@ public import LeanPool.Feige.AugmentedParameterization # Support of the augmented latent parameterization -/ -@[expose] public section +public section open Set MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/AugmentedParameterization.lean b/LeanPool/Feige/AugmentedParameterization.lean index fc64c846ab..0471992792 100644 --- a/LeanPool/Feige/AugmentedParameterization.lean +++ b/LeanPool/Feige/AugmentedParameterization.lean @@ -16,7 +16,7 @@ parametrization `γ = 0`, `β = 1`. A genuine support pair `(x,y)` is represented by `γ = 1-x`, `β = y-1`. -/ -@[expose] public section +public section open MeasureTheory @@ -37,7 +37,7 @@ def augmentedBeta (p : AugmentedTwoPointParams) : ℝ := | Sum.inr q => q.1.2 - 1 /-- The nonnegativity condition on an augmented two-point parameter. -/ -def AugmentedParamNonnegative (p : AugmentedTwoPointParams) : Prop := +@[expose] def AugmentedParamNonnegative (p : AugmentedTwoPointParams) : Prop := match p with | Sum.inl _ => True | Sum.inr q => 0 ≤ q.1.1 ∧ 1 < q.1.2 @@ -45,7 +45,7 @@ def AugmentedParamNonnegative (p : AugmentedTwoPointParams) : Prop := /-- The condition enjoyed by latent parameters sampled from a nonnegative mean-one law: genuine lower support points are nonnegative and genuine upper support points are strictly above one. -/ -def AugmentedParamsNonnegative {n : ℕ} +@[expose] def AugmentedParamsNonnegative {n : ℕ} (p : Fin n → AugmentedTwoPointParams) : Prop := ∀ i, AugmentedParamNonnegative (p i) diff --git a/LeanPool/Feige/AugmentedTwoPointKernel.lean b/LeanPool/Feige/AugmentedTwoPointKernel.lean index 6baf24eb07..f499763b73 100644 --- a/LeanPool/Feige/AugmentedTwoPointKernel.lean +++ b/LeanPool/Feige/AugmentedTwoPointKernel.lean @@ -15,7 +15,7 @@ strict below/above pair. Thus a single latent parameter always determines a mean-one law supported on at most two points. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set @@ -87,7 +87,7 @@ theorem augmentedTwoPointKernel_support /-- The complete latent law: its left branch carries the atom at one, and its right branch carries the nondegenerate parameter measure. -/ -noncomputable def augmentedLatentMeasure (μ : Measure ℝ) (M : ℝ) : +@[expose] noncomputable def augmentedLatentMeasure (μ : Measure ℝ) (M : ℝ) : Measure AugmentedTwoPointParams := μ {1} • Measure.dirac (Sum.inl ()) + (latentParamsMeasure μ M).map Sum.inr diff --git a/LeanPool/Feige/BooleanChain.lean b/LeanPool/Feige/BooleanChain.lean index 1d1f62d8f0..c16ad4e10d 100644 --- a/LeanPool/Feige/BooleanChain.lean +++ b/LeanPool/Feige/BooleanChain.lean @@ -20,7 +20,7 @@ chain structure and the exact one-element insertion step needed by the mass transport argument. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Feige/BoundaryNull.lean b/LeanPool/Feige/BoundaryNull.lean index cddabe6007..9cc4d23bea 100644 --- a/LeanPool/Feige/BoundaryNull.lean +++ b/LeanPool/Feige/BoundaryNull.lean @@ -18,7 +18,7 @@ nonnegative exponential law and then applies the product decomposition of a finite `Option`-indexed product. -/ -@[expose] public section +public section open scoped BigOperators ENNReal open MeasureTheory ProbabilityTheory Set diff --git a/LeanPool/Feige/Calibration.lean b/LeanPool/Feige/Calibration.lean index 3e16b85293..7d2bd846f4 100644 --- a/LeanPool/Feige/Calibration.lean +++ b/LeanPool/Feige/Calibration.lean @@ -15,7 +15,7 @@ This file contains the probability/calibration interfaces shared by the Vlassis--Thomas theorem and the reduction to Feige's inequality. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory @@ -24,6 +24,7 @@ namespace Feige /-- Abstract form of Theorem 2.1: `K` is super-uniform for every independent family of nonnegative random variables whose coordinate means are at most one. -/ +@[expose] def CalibrationProperty {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) {n : ℕ} (K : (Fin n → ℝ) → ℝ) : Prop := ∀ (Y : Fin n → Ω → ℝ), @@ -37,6 +38,7 @@ def CalibrationProperty {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) {n : /-- The calibration property, uniformly over all (small-universe) probability spaces. -/ +@[expose] def UniversalCalibration {n : ℕ} (K : (Fin n → ℝ) → ℝ) : Prop := ∀ (Ω : Type) (_ : MeasurableSpace Ω) (μ : Measure Ω) (_ : IsProbabilityMeasure μ), diff --git a/LeanPool/Feige/ChainCalibration.lean b/LeanPool/Feige/ChainCalibration.lean index e256c8b57e..8984f57321 100644 --- a/LeanPool/Feige/ChainCalibration.lean +++ b/LeanPool/Feige/ChainCalibration.lean @@ -25,14 +25,14 @@ exactly `K t`, which gives exact chain calibration whenever the rejected states form that terminal segment. -/ -@[expose] public section +public section open scoped BigOperators namespace Feige /-- Adjacent-difference mass associated with a decreasing sequence. -/ -def chainMass (K : ℕ → ℝ) (j : ℕ) : ℝ := +@[expose] def chainMass (K : ℕ → ℝ) (j : ℕ) : ℝ := K j - K (j + 1) /-- A decreasing chain of `m + 1` statistic values, extended by a zero @@ -49,6 +49,7 @@ namespace CalibratedChain variable {m : ℕ} (C : CalibratedChain m) /-- Total chain mass of states whose statistic does not exceed `α`. -/ +@[expose] noncomputable def rejectedMass (α : ℝ) : ℝ := by classical exact ∑ j ∈ (Finset.range (m + 1)).filter (fun j ↦ C.K j ≤ α), diff --git a/LeanPool/Feige/ChainFromBoolean.lean b/LeanPool/Feige/ChainFromBoolean.lean index 34a4c74ff8..9cbc416b16 100644 --- a/LeanPool/Feige/ChainFromBoolean.lean +++ b/LeanPool/Feige/ChainFromBoolean.lean @@ -18,13 +18,13 @@ extends the resulting finite sequence by zero. The extension is a immediately. -/ -@[expose] public section +public section namespace Feige /-- The two-point statistic along the maximal chain encoded by `σ`, extended by zero from the sentinel index `m + 1` onwards. -/ -noncomputable def booleanChainK {m : ℕ} (γ β : Fin m → ℝ) +@[expose] noncomputable def booleanChainK {m : ℕ} (γ β : Fin m → ℝ) (σ : Equiv.Perm (Fin m)) (j : ℕ) : ℝ := if hj : j < m + 1 then twoPointKFinset γ β (chainState σ ⟨j, hj⟩) @@ -83,7 +83,7 @@ theorem booleanChainK_initial {m : ℕ} (γ β : Fin m → ℝ) exact twoPointK_empty γ β hγ /-- The calibrated sequence carried by a maximal Boolean-lattice chain. -/ -noncomputable def booleanCalibratedChain {m : ℕ} (γ β : Fin m → ℝ) +@[expose] noncomputable def booleanCalibratedChain {m : ℕ} (γ β : Fin m → ℝ) (σ : Equiv.Perm (Fin m)) (hγ : ∀ i, 0 ≤ γ i) (hβ : ∀ i, 0 ≤ β i) : CalibratedChain m where K := booleanChainK γ β σ diff --git a/LeanPool/Feige/ChainInsertion.lean b/LeanPool/Feige/ChainInsertion.lean index 2d4c12e36c..e98476df41 100644 --- a/LeanPool/Feige/ChainInsertion.lean +++ b/LeanPool/Feige/ChainInsertion.lean @@ -19,14 +19,14 @@ chain with the new element adjoined. These are the two cases of the inserted-chain construction used in the proof of Theorem 2.1. -/ -@[expose] public section +public section open Finset namespace Feige /-- Lift a Boolean-lattice state to the enlarged ground set. -/ -def liftChainState {n : ℕ} (S : Finset (Fin n)) : Finset (Fin (n + 1)) := +@[expose] def liftChainState {n : ℕ} (S : Finset (Fin n)) : Finset (Fin (n + 1)) := S.map Fin.castSuccEmb @[simp] @@ -108,7 +108,7 @@ private theorem succAbove_val_lt_succ_of_le {n : ℕ} /-- The states of the enlarged maximal chain, written directly in the two cases before and after the insertion rank. -/ -def insertedChainState {n : ℕ} (σ : Equiv.Perm (Fin n)) +@[expose] def insertedChainState {n : ℕ} (σ : Equiv.Perm (Fin n)) (J : Fin (n + 1)) (j : Fin (n + 2)) : Finset (Fin (n + 1)) := if h : j.val ≤ J.val then liftChainState (chainState σ diff --git a/LeanPool/Feige/ChainMeasure.lean b/LeanPool/Feige/ChainMeasure.lean index 171117a9e4..88d9f2da9f 100644 --- a/LeanPool/Feige/ChainMeasure.lean +++ b/LeanPool/Feige/ChainMeasure.lean @@ -16,7 +16,7 @@ packages its expectation and relates the indicator of a threshold rejection event to `rejectedMass`. -/ -@[expose] public section +public section open scoped BigOperators @@ -28,7 +28,7 @@ variable {m : ℕ} (C : CalibratedChain m) /-- Expectation of a payoff on the `m + 1` genuine levels of a calibrated chain. -/ -noncomputable def expectation (g : ℕ → ℝ) : ℝ := +@[expose] noncomputable def expectation (g : ℕ → ℝ) : ℝ := ∑ j ∈ Finset.range (m + 1), chainMass C.K j * g j theorem expectation_one : C.expectation (fun _ ↦ 1) = 1 := by @@ -67,7 +67,7 @@ end CalibratedChain section BooleanChain /-- Expectation `E_{ν_C} g` for the auxiliary maximal-chain law. -/ -noncomputable def booleanChainExpectation {m : ℕ} +@[expose] noncomputable def booleanChainExpectation {m : ℕ} (γ β : Fin m → ℝ) (σ : Equiv.Perm (Fin m)) (hγ : ∀ i, 0 ≤ γ i) (hβ : ∀ i, 0 ≤ β i) (g : Finset (Fin m) → ℝ) : ℝ := @@ -76,7 +76,7 @@ noncomputable def booleanChainExpectation {m : ℕ} if hj : j < m + 1 then g (chainState σ ⟨j, hj⟩) else 0) /-- Increasing rejection payoff on the Boolean lattice. -/ -noncomputable def booleanRejectionPayoff {m : ℕ} +@[expose] noncomputable def booleanRejectionPayoff {m : ℕ} (γ β : Fin m → ℝ) (α : ℝ) (S : Finset (Fin m)) : ℝ := if twoPointKFinset γ β S ≤ α then 1 else 0 diff --git a/LeanPool/Feige/ConditionalMainTheorem.lean b/LeanPool/Feige/ConditionalMainTheorem.lean index 8045f2db63..090e53b475 100644 --- a/LeanPool/Feige/ConditionalMainTheorem.lean +++ b/LeanPool/Feige/ConditionalMainTheorem.lean @@ -17,7 +17,7 @@ are fully discharged: Theorem 2.1, the simplex/exponential identification of (2.1), and the `α = 0` centroid-halfspace inequality are the only inputs. -/ -@[expose] public section +public section namespace Feige diff --git a/LeanPool/Feige/ConditionalProductKernel.lean b/LeanPool/Feige/ConditionalProductKernel.lean index 17c8aa9c8a..6081cae561 100644 --- a/LeanPool/Feige/ConditionalProductKernel.lean +++ b/LeanPool/Feige/ConditionalProductKernel.lean @@ -15,7 +15,7 @@ has, at every fixed latent parameter vector, exactly the ordinary finite product of the selected one-coordinate laws. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/ConditionalTwoPointCalibration.lean b/LeanPool/Feige/ConditionalTwoPointCalibration.lean index e26bbc491e..dc04162275 100644 --- a/LeanPool/Feige/ConditionalTwoPointCalibration.lean +++ b/LeanPool/Feige/ConditionalTwoPointCalibration.lean @@ -18,7 +18,7 @@ conditional product law selected by any admissible augmented latent vector inherits the same rejection bound. -/ -@[expose] public section +public section open MeasureTheory @@ -28,7 +28,7 @@ noncomputable section /-- The finite two-point rejection estimate needed by the mixture argument, including the closed boundary `0 ≤ γᵢ ≤ 1`. -/ -def TwoPointRejectionBound : Prop := +@[expose] def TwoPointRejectionBound : Prop := ∀ {m : ℕ} (γ β : Fin m → ℝ), (∀ i, 0 ≤ γ i) → (∀ i, γ i ≤ 1) → diff --git a/LeanPool/Feige/Constants.lean b/LeanPool/Feige/Constants.lean index 3d9e1c0d16..0cd51ec74e 100644 --- a/LeanPool/Feige/Constants.lean +++ b/LeanPool/Feige/Constants.lean @@ -19,14 +19,14 @@ which is the `δ = 1` value of the second branch in (1.1). The probability-theoretic proof is kept in later modules. -/ -@[expose] public section +public section namespace Feige open Filter Topology /-- The unit-slack sharp constant `bₙ,₁` in dimension `n`. -/ -noncomputable def sharpConstant (n : ℕ) : ℝ := +@[expose] noncomputable def sharpConstant (n : ℕ) : ℝ := ((n : ℝ) / (n + 1)) ^ n @[simp] theorem sharpConstant_zero : sharpConstant 0 = 1 := by diff --git a/LeanPool/Feige/ConvolutionLogConcave.lean b/LeanPool/Feige/ConvolutionLogConcave.lean index 832ab84205..f1900a9064 100644 --- a/LeanPool/Feige/ConvolutionLogConcave.lean +++ b/LeanPool/Feige/ConvolutionLogConcave.lean @@ -20,7 +20,7 @@ one-dimensional closure is proved by the TP2/Cauchy--Binet argument in `Feige.FiniteSignedExp`. -/ -@[expose] public section +public section open MeasureTheory open scoped ENNReal diff --git a/LeanPool/Feige/FiniteSignedExp.lean b/LeanPool/Feige/FiniteSignedExp.lean index 3693ccc546..d586f076f7 100644 --- a/LeanPool/Feige/FiniteSignedExp.lean +++ b/LeanPool/Feige/FiniteSignedExp.lean @@ -19,7 +19,7 @@ density and derives its four-point log-concavity from translation TP2 closure under convolution. -/ -@[expose] public section +public section open scoped ENNReal open MeasureTheory ProbabilityTheory @@ -101,7 +101,7 @@ structure SignedExpFactor where namespace SignedExpFactor /-- The one-sided exponential density associated with a signed factor. -/ -def density (F : SignedExpFactor) : ℝ → ℝ≥0∞ := +@[expose] def density (F : SignedExpFactor) : ℝ → ℝ≥0∞ := match F.direction with | .positive => rightExponentialDensity F.scale | .negative => leftExponentialDensity F.scale @@ -240,7 +240,7 @@ instance instIsProbabilityMeasureWithDensityFiniteSignedExpSum /-- The same finite signed-exponential law constructed directly by successive convolution of its absolutely continuous factor laws. -/ -def finiteSignedExpSumMeasure : +@[expose] def finiteSignedExpSumMeasure : List SignedExpFactor → Measure ℝ | [] => volume.withDensity (rightExponentialDensity 1) | F :: Fs => diff --git a/LeanPool/Feige/GeometryBridge.lean b/LeanPool/Feige/GeometryBridge.lean index b11a3eb1d9..39c550b063 100644 --- a/LeanPool/Feige/GeometryBridge.lean +++ b/LeanPool/Feige/GeometryBridge.lean @@ -19,12 +19,13 @@ the `α = 0` centroid-halfspace theorem supplies the `δ = 1` `LargeSumBridge` consumed by the final reduction. -/ -@[expose] public section +public section namespace Feige /-- Equality of the simplex-volume and exponential presentations of the Dirichlet statistic. -/ +@[expose] def SimplexExponentialIdentification (n : ℕ) : Prop := ∀ y : Fin n → ℝ, dirichletK y = simplexK y diff --git a/LeanPool/Feige/Grunbaum/Definitions.lean b/LeanPool/Feige/Grunbaum/Definitions.lean index 6d06b74773..c42c9afe44 100644 --- a/LeanPool/Feige/Grunbaum/Definitions.lean +++ b/LeanPool/Feige/Grunbaum/Definitions.lean @@ -18,7 +18,7 @@ have nonempty interior. `FullDimensionalConvexBody` records precisely that standard convention. -/ -@[expose] public section +public section open MeasureTheory Set @@ -80,13 +80,13 @@ theorem volume_ne_top {d : ℕ} (C : FullDimensionalConvexBody d) : C.isCompact.measure_lt_top.ne /-- The volume centroid of a full-dimensional convex body. -/ -noncomputable def centroid {d : ℕ} (C : FullDimensionalConvexBody d) : Euc d := +@[expose] noncomputable def centroid {d : ℕ} (C : FullDimensionalConvexBody d) : Euc d := ⨍ x in (C : Set (Euc d)), x ∂volume end FullDimensionalConvexBody /-- The closed halfspace cut out by `ℓ x ≤ a`. -/ -def closedHalfspace {d : ℕ} (ℓ : Euc d →L[ℝ] ℝ) (a : ℝ) : Set (Euc d) := +@[expose] def closedHalfspace {d : ℕ} (ℓ : Euc d →L[ℝ] ℝ) (a : ℝ) : Set (Euc d) := ℓ ⁻¹' Iic a /-- A (proper) closed halfspace, represented by a nonzero continuous linear @@ -119,13 +119,13 @@ theorem isClosed {d : ℕ} (H : ClosedHalfspace d) : end ClosedHalfspace /-- The normalized volume of a body's intersection with a closed halfspace. -/ -noncomputable def halfspaceVolumeRatio {d : ℕ} (C : FullDimensionalConvexBody d) +@[expose] noncomputable def halfspaceVolumeRatio {d : ℕ} (C : FullDimensionalConvexBody d) (ℓ : Euc d →L[ℝ] ℝ) (a : ℝ) : ℝ := (volume ((C : Set (Euc d)) ∩ closedHalfspace ℓ a) / volume (C : Set (Euc d))).toReal /-- The sharp constant `(n / (n + 1)) ^ n` in dimension `n = d + 1`. -/ -noncomputable def grunbaumConstant (d : ℕ) : ℝ := +@[expose] noncomputable def grunbaumConstant (d : ℕ) : ℝ := (((d + 1 : ℕ) : ℝ) / (d + 2 : ℕ)) ^ (d + 1) end Grunbaum diff --git a/LeanPool/Feige/Grunbaum/FinalBridge.lean b/LeanPool/Feige/Grunbaum/FinalBridge.lean index 7e9fff8e91..987ed964bc 100644 --- a/LeanPool/Feige/Grunbaum/FinalBridge.lean +++ b/LeanPool/Feige/Grunbaum/FinalBridge.lean @@ -11,7 +11,7 @@ public import LeanPool.Feige.Grunbaum.TruncationConcavity # From truncation concavity to the Grünbaum volume bound -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/Feige/Grunbaum/Main.lean b/LeanPool/Feige/Grunbaum/Main.lean index 22a97eec55..9860aa3d1e 100644 --- a/LeanPool/Feige/Grunbaum/Main.lean +++ b/LeanPool/Feige/Grunbaum/Main.lean @@ -21,7 +21,7 @@ proof. The public theorem `grunbaum_centroid_halfspace` has only the assumptions in the mathematical statement. -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Set open scoped ENNReal Topology diff --git a/LeanPool/Feige/Grunbaum/ProbabilityCore.lean b/LeanPool/Feige/Grunbaum/ProbabilityCore.lean index 9de3251376..cf68dfed5f 100644 --- a/LeanPool/Feige/Grunbaum/ProbabilityCore.lean +++ b/LeanPool/Feige/Grunbaum/ProbabilityCore.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Integral.Layercake # Probability lemmas for Grünbaum's inequality -/ -@[expose] public section +public section open Filter MeasureTheory ProbabilityTheory Set open scoped ENNReal Topology @@ -315,11 +315,11 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Measure.IsAddHaarMeasure (volume : Measure E)] /-- Lebesgue volume restricted to `K` and normalized to total mass one. -/ -def uniformVolume (K : Set E) : Measure E := +@[expose] def uniformVolume (K : Set E) : Measure E := (volume K)⁻¹ • volume.restrict K /-- The centroid of `K` defined by its set average. -/ -def volumeCentroid (K : Set E) : E := +@[expose] def volumeCentroid (K : Set E) : E := ⨍ x in K, x omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] diff --git a/LeanPool/Feige/Grunbaum/Sharpness.lean b/LeanPool/Feige/Grunbaum/Sharpness.lean index e013ff0463..464fe84138 100644 --- a/LeanPool/Feige/Grunbaum/Sharpness.lean +++ b/LeanPool/Feige/Grunbaum/Sharpness.lean @@ -19,7 +19,7 @@ layer-cake formula and proves that every universal project-level lower bound is at most `grunbaumConstant`. -/ -@[expose] public section +public section noncomputable section @@ -42,7 +42,7 @@ theorem coordinateSum_apply (n : ℕ) (x : SimplexE n) : simp [coordinateSum] /-- The full-dimensional standard simplex `xᵢ ≥ 0`, `∑ xᵢ ≤ 1`. -/ -def simplexSet (n : ℕ) : Set (SimplexE n) := +@[expose] def simplexSet (n : ℕ) : Set (SimplexE n) := {x | (∀ i, 0 ≤ x i) ∧ coordinateSum n x ≤ 1} @[simp] @@ -250,7 +250,7 @@ theorem integral_coordinateSum (n : ℕ) : (fun _ hx ↦ ht1.trans hx) obs /-- The volume centroid of the standard simplex. -/ -def simplexCentroid (n : ℕ) : SimplexE n := +@[expose] def simplexCentroid (n : ℕ) : SimplexE n := ⨍ x in simplexSet n, x ∂volume /-- The scalar coordinate needed to locate the sharp supporting hyperplane. -/ @@ -298,6 +298,7 @@ theorem sharpHalfspaceSet_volume_ratio {n : ℕ} (hn : 0 < n) : /-- The standard simplex, regarded as a full-dimensional body in project dimension `d + 1`. -/ +@[expose] def simplexFullBody (d : ℕ) : FullDimensionalConvexBody d where carrier := simplexSet (d + 1) convex' := convex_simplexSet (d + 1) @@ -306,7 +307,7 @@ def simplexFullBody (d : ℕ) : FullDimensionalConvexBody d where theorem simplexFullBody_centroid (d : ℕ) : (simplexFullBody d).centroid = simplexCentroid (d + 1) := - rfl + by rfl /-- The sharp halfspace for the standard simplex. -/ def sharpClosedHalfspace (d : ℕ) : ClosedHalfspace d where diff --git a/LeanPool/Feige/Grunbaum/SimplexCentroidCoordinates.lean b/LeanPool/Feige/Grunbaum/SimplexCentroidCoordinates.lean index 7676bce5f5..16633240cb 100644 --- a/LeanPool/Feige/Grunbaum/SimplexCentroidCoordinates.lean +++ b/LeanPool/Feige/Grunbaum/SimplexCentroidCoordinates.lean @@ -19,7 +19,7 @@ simplex. Hence all centroid coordinates agree; their value follows from the already computed coordinate sum. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Feige/Grunbaum/StrictBoundaryBridge.lean b/LeanPool/Feige/Grunbaum/StrictBoundaryBridge.lean index 30e68211e9..2e86f19578 100644 --- a/LeanPool/Feige/Grunbaum/StrictBoundaryBridge.lean +++ b/LeanPool/Feige/Grunbaum/StrictBoundaryBridge.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # Passing from closed to strict halfspaces -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/Feige/Grunbaum/TruncationConcavity.lean b/LeanPool/Feige/Grunbaum/TruncationConcavity.lean index 5b224a9b04..d69991c84a 100644 --- a/LeanPool/Feige/Grunbaum/TruncationConcavity.lean +++ b/LeanPool/Feige/Grunbaum/TruncationConcavity.lean @@ -13,7 +13,7 @@ import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar # Concavity of truncated-volume roots -/ -@[expose] public section +public section open MeasureTheory Set open scoped Pointwise @@ -21,7 +21,7 @@ open scoped Pointwise namespace Grunbaum /-- The part of `C` cut out by the sublevel halfspace of `ℓ` at `t`. -/ -def trunc {d : ℕ} (C : Set (Euc d)) (ℓ : Euc d →L[ℝ] ℝ) (t : ℝ) : Set (Euc d) := +@[expose] def trunc {d : ℕ} (C : Set (Euc d)) (ℓ : Euc d →L[ℝ] ℝ) (t : ℝ) : Set (Euc d) := C ∩ ℓ ⁻¹' Set.Iic t /-- The dimension-normalized root of a truncation's volume. -/ @@ -30,11 +30,12 @@ noncomputable def truncRoot {d : ℕ} (C : Set (Euc d)) (volume (trunc C ℓ t) ^ ((d : ℝ) + 1)⁻¹).toReal /-- The dimension-normalized root of the truncation's volume ratio. -/ -noncomputable def cdfRoot {d : ℕ} (C : Set (Euc d)) +@[expose] noncomputable def cdfRoot {d : ℕ} (C : Set (Euc d)) (ℓ : Euc d →L[ℝ] ℝ) (t : ℝ) : ℝ := ((volume (trunc C ℓ t) / volume C) ^ ((d : ℝ) + 1)⁻¹).toReal /-- Thresholds for which the corresponding truncation is nonempty. -/ +@[expose] def truncDomain {d : ℕ} (C : Set (Euc d)) (ℓ : Euc d →L[ℝ] ℝ) : Set ℝ := {t | (trunc C ℓ t).Nonempty} diff --git a/LeanPool/Feige/GrunbaumImport.lean b/LeanPool/Feige/GrunbaumImport.lean index c26eb0d34f..1777539873 100644 --- a/LeanPool/Feige/GrunbaumImport.lean +++ b/LeanPool/Feige/GrunbaumImport.lean @@ -20,7 +20,7 @@ between the coordinate-function model used by `Feige` and Mathlib's `EuclideanSpace` model used by `Grunbaum`. -/ -@[expose] public section +public section open Set MeasureTheory diff --git a/LeanPool/Feige/GrunbaumSimplexProperty.lean b/LeanPool/Feige/GrunbaumSimplexProperty.lean index 6994036d0f..7930853aac 100644 --- a/LeanPool/Feige/GrunbaumSimplexProperty.lean +++ b/LeanPool/Feige/GrunbaumSimplexProperty.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # The Grünbaum property for the standard simplex -/ -@[expose] public section +public section open scoped BigOperators ENNReal open Set MeasureTheory diff --git a/LeanPool/Feige/GrunbaumWeightedForm.lean b/LeanPool/Feige/GrunbaumWeightedForm.lean index f679972986..4ac838afc0 100644 --- a/LeanPool/Feige/GrunbaumWeightedForm.lean +++ b/LeanPool/Feige/GrunbaumWeightedForm.lean @@ -20,7 +20,7 @@ with the positive-dimensional Euclidean model used by the Grünbaum formalization. -/ -@[expose] public section +public section open scoped BigOperators open Set diff --git a/LeanPool/Feige/HighSetLaw.lean b/LeanPool/Feige/HighSetLaw.lean index ec69fe1e8c..52fceeb8fc 100644 --- a/LeanPool/Feige/HighSetLaw.lean +++ b/LeanPool/Feige/HighSetLaw.lean @@ -19,7 +19,7 @@ finite two-point calibration result can be stated directly as a probability bound. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped BigOperators ENNReal @@ -62,7 +62,7 @@ theorem highSetPMF_apply {m : ℕ} (p : Fin m → ℝ) (hp0 : ∀ i, 0 ≤ p i) (hp1 : ∀ i, p i ≤ 1) (S : Finset (Fin m)) : highSetPMF p hp0 hp1 S = ENNReal.ofReal (highSetMass p S) := - rfl + by rfl /-- Probability of a finite collection of high sets. -/ theorem highSetMeasure_apply_finset {m : ℕ} (p : Fin m → ℝ) @@ -87,7 +87,7 @@ theorem highSetMeasure_real_apply_finset {m : ℕ} (p : Fin m → ℝ) simp [ENNReal.toReal_ofReal (highSetMass_nonneg hp0 hp1 S)] /-- The rejection event in the high-set sample space. -/ -noncomputable def twoPointRejectionEvent {m : ℕ} (γ β : Fin m → ℝ) (α : ℝ) : +@[expose] noncomputable def twoPointRejectionEvent {m : ℕ} (γ β : Fin m → ℝ) (α : ℝ) : Finset (Finset (Fin m)) := Finset.univ.filter fun S ↦ twoPointKFinset γ β S ≤ α @@ -122,7 +122,7 @@ theorem canonicalTwoPoint_coordinate_mean_one {m : ℕ} /-- Equivalent product-`Bool` realization of the canonical two-point vector. This model makes coordinate independence available directly from the product-measure API. -/ -def canonicalTwoPointPiVector {m : ℕ} +@[expose] def canonicalTwoPointPiVector {m : ℕ} (γ β : Fin m → ℝ) (ω : Fin m → Bool) (i : Fin m) : ℝ := if ω i then highValue (β i) else lowValue (γ i) diff --git a/LeanPool/Feige/IndependentCalibrationAssembly.lean b/LeanPool/Feige/IndependentCalibrationAssembly.lean index b7683c681e..5b029a3ef6 100644 --- a/LeanPool/Feige/IndependentCalibrationAssembly.lean +++ b/LeanPool/Feige/IndependentCalibrationAssembly.lean @@ -22,7 +22,7 @@ joint law is then the product of their marginal laws, which is represented by the augmented latent mixture and averaged using the two-point bound. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set diff --git a/LeanPool/Feige/InsertionAlgebra.lean b/LeanPool/Feige/InsertionAlgebra.lean index c0f5d5e56d..b7b9d77696 100644 --- a/LeanPool/Feige/InsertionAlgebra.lean +++ b/LeanPool/Feige/InsertionAlgebra.lean @@ -17,7 +17,7 @@ step is kept separate: once that step supplies the sign of `η`, the results bel chain mixture as an upward transfer inside each pair `{Cⱼ, Hⱼ}`. -/ -@[expose] public section +public section namespace Feige @@ -34,15 +34,15 @@ def insertedLowerMass (B w θ : ℕ → ℝ) (j : ℕ) : ℝ := θ (j + 1) * (B j - B (j + 1)) + insertionWeight θ j * w j /-- Averaged mass placed at the upper state `Hⱼ`. -/ -def insertedUpperMass (A θ : ℕ → ℝ) (j : ℕ) : ℝ := +@[expose] def insertedUpperMass (A θ : ℕ → ℝ) (j : ℕ) : ℝ := (1 - θ (j + 1)) * (A j - A (j + 1)) /-- Mass at `Cⱼ` before replacing the independent Bernoulli reveal. -/ -def independentLowerMass (F : ℕ → ℝ) (p : ℝ) (j : ℕ) : ℝ := +@[expose] def independentLowerMass (F : ℕ → ℝ) (p : ℝ) (j : ℕ) : ℝ := (1 - p) * (F j - F (j + 1)) /-- Mass at `Hⱼ` before replacing the independent Bernoulli reveal. -/ -def independentUpperMass (F : ℕ → ℝ) (p : ℝ) (j : ℕ) : ℝ := +@[expose] def independentUpperMass (F : ℕ → ℝ) (p : ℝ) (j : ℕ) : ℝ := p * (F j - F (j + 1)) /-- Mass assigned to `Cⱼ` by the chain whose insertion rank is `J`. @@ -66,7 +66,7 @@ noncomputable def insertionPairScore /-- The same inserted-chain score indexed by its consecutive chain level: levels through `J` are lower states and later levels are upper states. -/ -noncomputable def insertionLevelScore +@[expose] noncomputable def insertionLevelScore (A B w gLower gUpper : ℕ → ℝ) (J r : ℕ) : ℝ := if r ≤ J then lowerMassForInsertion B w J r * gLower r @@ -138,7 +138,7 @@ theorem insertionPairScore_eq_levelScore /-- Statistic sequence along the chain with insertion rank `J`: the pre-insertion levels use `B`, and the post-insertion levels use `A` with their index shifted by one. -/ -def insertionStatisticSequence (A B : ℕ → ℝ) (J r : ℕ) : ℝ := +@[expose] def insertionStatisticSequence (A B : ℕ → ℝ) (J r : ℕ) : ℝ := if r ≤ J then B r else A (r - 1) /-- At a lower state `Cⱼ` which is present in the rank-`J` chain, the @@ -169,7 +169,7 @@ theorem chainMass_insertionStatisticSequence_upper congr 1 /-- The upward mass-transfer coefficient. -/ -def insertionTransfer (A F θ : ℕ → ℝ) (p : ℝ) (j : ℕ) : ℝ := +@[expose] def insertionTransfer (A F θ : ℕ → ℝ) (p : ℝ) (j : ℕ) : ℝ := insertedUpperMass A θ j - independentUpperMass F p j /-- The lower and upper mass formulas preserve the total mass of each pair diff --git a/LeanPool/Feige/InsertionAnalyticAssembly.lean b/LeanPool/Feige/InsertionAnalyticAssembly.lean index 40e7d5afaf..d271ddbf5f 100644 --- a/LeanPool/Feige/InsertionAnalyticAssembly.lean +++ b/LeanPool/Feige/InsertionAnalyticAssembly.lean @@ -20,7 +20,7 @@ transfer hypotheses required by `exists_insertChainPerm_dominates_reveal` follow automatically. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/Feige/InsertionCommonDensity.lean b/LeanPool/Feige/InsertionCommonDensity.lean index f7184706a0..f845e3d3b6 100644 --- a/LeanPool/Feige/InsertionCommonDensity.lean +++ b/LeanPool/Feige/InsertionCommonDensity.lean @@ -16,7 +16,7 @@ negative scaled exponential. This file packages those factors and applies the finite-convolution TP2 theorem to the common part of any genuine edge. -/ -@[expose] public section +public section namespace Feige namespace LikelihoodRatio @@ -24,7 +24,7 @@ namespace LikelihoodRatio noncomputable section /-- The signed exponential contributed by coordinate `i` in state `S`. -/ -def stateFactor {ι : Type*} [DecidableEq ι] +@[expose] def stateFactor {ι : Type*} [DecidableEq ι] (γ β : ι → ℝ) (hγ : ∀ i, 0 < γ i) (hβ : ∀ i, 0 < β i) (S : Finset ι) (i : ι) : SignedExpFactor := if i ∈ S then @@ -40,7 +40,7 @@ def stateFactor {ι : Type*} [DecidableEq ι] All signed exponential factors shared by the two endpoints of the edge which changes `changed`. -/ -def commonFactors {ι : Type*} [Fintype ι] [DecidableEq ι] +@[expose] def commonFactors {ι : Type*} [Fintype ι] [DecidableEq ι] (γ β : ι → ℝ) (hγ : ∀ i, 0 < γ i) (hβ : ∀ i, 0 < β i) (S : Finset ι) (changed : ι) : List SignedExpFactor := (Finset.univ.erase changed).toList.map diff --git a/LeanPool/Feige/InsertionCommonLaw.lean b/LeanPool/Feige/InsertionCommonLaw.lean index 2f0000befb..e9fe2728f0 100644 --- a/LeanPool/Feige/InsertionCommonLaw.lean +++ b/LeanPool/Feige/InsertionCommonLaw.lean @@ -19,7 +19,7 @@ The event defining `twoPointKFinset` is rewritten as nonnegativity of the corresponding signed exponential sum. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set open scoped BigOperators ENNReal @@ -34,7 +34,7 @@ local instance : IsProbabilityMeasure (expMeasure 1) := variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- The signed exponential statistic at Boolean state `S`. -/ -def stateSignedSum (γ β : ι → ℝ) (S : Finset ι) +@[expose] def stateSignedSum (γ β : ι → ℝ) (S : Finset ι) (e : Option ι → NNReal) : ℝ := (e none : ℝ) + ∑ i, if i ∈ S then -(β i * (e (some i) : ℝ)) @@ -54,7 +54,7 @@ theorem measurable_stateSignedSum (γ β : ι → ℝ) (S : Finset ι) : fun_prop /-- Pushforward law of the signed sum at state `S`. -/ -noncomputable def stateLaw (γ β : ι → ℝ) (S : Finset ι) : Measure ℝ := +@[expose] noncomputable def stateLaw (γ β : ι → ℝ) (S : Finset ι) : Measure ℝ := Measure.map (stateSignedSum γ β S) (expProductMeasure ι) instance stateLaw_isProbability (γ β : ι → ℝ) (S : Finset ι) : @@ -165,7 +165,7 @@ theorem stateSignedSum_insert_eq_common_sub /-- The common law on an insertion edge, constructed as the convolution of the unchanged signed exponential factors together with the distinguished rate-one exponential `E₀`. -/ -noncomputable def insertionCommonLaw +@[expose] noncomputable def insertionCommonLaw (γ β : ι → ℝ) (hγ : ∀ i, 0 < γ i) (hβ : ∀ i, 0 < β i) (S : Finset ι) (changed : ι) : Measure ℝ := LikelihoodRatio.finiteSignedExpSumMeasure @@ -192,7 +192,7 @@ theorem insertionCommonLaw_eq_withDensity /-- Law of the low endpoint obtained by adding the changed coordinate's positive scaled exponential to the common part. -/ -noncomputable def insertionLowEndpointLaw +@[expose] noncomputable def insertionLowEndpointLaw (γ β : ι → ℝ) (hγ : ∀ i, 0 < γ i) (hβ : ∀ i, 0 < β i) (S : Finset ι) (changed : ι) : Measure ℝ := TransferStein.zPlusLaw @@ -200,7 +200,7 @@ noncomputable def insertionLowEndpointLaw /-- Law of the high endpoint obtained by subtracting the changed coordinate's scaled exponential from the common part. -/ -noncomputable def insertionHighEndpointLaw +@[expose] noncomputable def insertionHighEndpointLaw (γ β : ι → ℝ) (hγ : ∀ i, 0 < γ i) (hβ : ∀ i, 0 < β i) (S : Finset ι) (changed : ι) : Measure ℝ := TransferStein.zMinusLaw diff --git a/LeanPool/Feige/InsertionEdgeRealization.lean b/LeanPool/Feige/InsertionEdgeRealization.lean index a6cb5106c6..2a364f9b87 100644 --- a/LeanPool/Feige/InsertionEdgeRealization.lean +++ b/LeanPool/Feige/InsertionEdgeRealization.lean @@ -22,7 +22,7 @@ new high-side scale. This identifies every nonterminal edge with the finite signed-exponential instance of the local transfer step. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/Feige/InsertionExpectation.lean b/LeanPool/Feige/InsertionExpectation.lean index 02ddead687..7510e51dd8 100644 --- a/LeanPool/Feige/InsertionExpectation.lean +++ b/LeanPool/Feige/InsertionExpectation.lean @@ -17,7 +17,7 @@ from concrete Boolean chains to the pairwise mass-transport calculation in the proof of Theorem 2.1. -/ -@[expose] public section +public section open scoped BigOperators @@ -78,7 +78,7 @@ noncomputable def insertionUpperPayoff {n : ℕ} /-- Payoff after independently revealing the new last coordinate with probability `p`. -/ -noncomputable def revealedLastPayoff {n : ℕ} +@[expose] noncomputable def revealedLastPayoff {n : ℕ} (p : ℝ) (g : Finset (Fin (n + 1)) → ℝ) (S : Finset (Fin n)) : ℝ := (1 - p) * g (liftChainState S) + diff --git a/LeanPool/Feige/InsertionK.lean b/LeanPool/Feige/InsertionK.lean index ce50afb8f1..315f504d7e 100644 --- a/LeanPool/Feige/InsertionK.lean +++ b/LeanPool/Feige/InsertionK.lean @@ -16,13 +16,13 @@ This file connects the concrete inserted Boolean chain to the abstract `A`/`B` statistic sequences used in the mass-transport proof of Theorem 2.1. -/ -@[expose] public section +public section namespace Feige /-- The `Bᵣ` value at the lifted lower state `Cᵣ`, extended by zero after the old chain's sentinel. -/ -noncomputable def insertionLowerK {n : ℕ} +@[expose] noncomputable def insertionLowerK {n : ℕ} (γ β : Fin (n + 1) → ℝ) (σ : Equiv.Perm (Fin n)) (r : ℕ) : ℝ := if hr : r < n + 1 then twoPointKFinset γ β @@ -31,7 +31,7 @@ noncomputable def insertionLowerK {n : ℕ} /-- The `Aᵣ` value at the lifted upper state `Hᵣ`, extended by zero after the old chain's sentinel. -/ -noncomputable def insertionUpperK {n : ℕ} +@[expose] noncomputable def insertionUpperK {n : ℕ} (γ β : Fin (n + 1) → ℝ) (σ : Equiv.Perm (Fin n)) (r : ℕ) : ℝ := if hr : r < n + 1 then twoPointKFinset γ β @@ -40,18 +40,18 @@ noncomputable def insertionUpperK {n : ℕ} /-- The old `n`-coordinate statistic sequence `Fᵣ`, including its zero sentinel. -/ -noncomputable def insertionOldK {n : ℕ} +@[expose] noncomputable def insertionOldK {n : ℕ} (γ β : Fin (n + 1) → ℝ) (σ : Equiv.Perm (Fin n)) (r : ℕ) : ℝ := booleanChainK (fun i ↦ γ i.castSucc) (fun i ↦ β i.castSucc) σ r /-- Band width `wᵣ = Bᵣ - Aᵣ`. -/ -noncomputable def insertionWidth {n : ℕ} +@[expose] noncomputable def insertionWidth {n : ℕ} (γ β : Fin (n + 1) → ℝ) (σ : Equiv.Perm (Fin n)) (r : ℕ) : ℝ := insertionLowerK γ β σ r - insertionUpperK γ β σ r /-- Conditional interpolation parameter `θᵣ = (Fᵣ - Aᵣ) / (Bᵣ - Aᵣ)`. -/ -noncomputable def insertionTheta {n : ℕ} +@[expose] noncomputable def insertionTheta {n : ℕ} (γ β : Fin (n + 1) → ℝ) (σ : Equiv.Perm (Fin n)) (r : ℕ) : ℝ := (insertionOldK γ β σ r - insertionUpperK γ β σ r) / insertionWidth γ β σ r diff --git a/LeanPool/Feige/InsertionLastCoordinateLaw.lean b/LeanPool/Feige/InsertionLastCoordinateLaw.lean index a7e4978814..dc8f6d606a 100644 --- a/LeanPool/Feige/InsertionLastCoordinateLaw.lean +++ b/LeanPool/Feige/InsertionLastCoordinateLaw.lean @@ -18,7 +18,7 @@ exponential shifts of the old law. These are the dimension-change identifications used at every chain-insertion edge. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/Feige/InsertionTerminalLaw.lean b/LeanPool/Feige/InsertionTerminalLaw.lean index 2837c06490..51503d8079 100644 --- a/LeanPool/Feige/InsertionTerminalLaw.lean +++ b/LeanPool/Feige/InsertionTerminalLaw.lean @@ -19,7 +19,7 @@ The common variable on the terminal edge is the sum of the negative old coordinates, with the distinguished positive exponential removed. -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/Feige/KContinuity.lean b/LeanPool/Feige/KContinuity.lean index c280a811f9..b5bd8250f6 100644 --- a/LeanPool/Feige/KContinuity.lean +++ b/LeanPool/Feige/KContinuity.lean @@ -18,7 +18,7 @@ that `dirichletK` is sequentially continuous at every parameter whose boundary hyperplane has zero product-exponential measure. -/ -@[expose] public section +public section open scoped BigOperators open Filter MeasureTheory ProbabilityTheory Set Topology @@ -30,7 +30,7 @@ section variable {ι : Type*} [Fintype ι] /-- The affine functional defining the moving halfspace in `kEvent`. -/ -def kLinear (y : ι → ℝ) (e : Option ι → NNReal) : ℝ := +@[expose] def kLinear (y : ι → ℝ) (e : Option ι → NNReal) : ℝ := ∑ i, (y i - 1) * (e (some i) : ℝ) theorem continuous_kLinear (e : Option ι → NNReal) : @@ -58,7 +58,7 @@ theorem eventually_mem_kEvent_iff fun h ↦ False.elim ((not_lt_of_ge h) hgt)⟩ /-- The boundary set for a fixed parameter. -/ -def kBoundary (y : ι → ℝ) : Set (Option ι → NNReal) := +@[expose] def kBoundary (y : ι → ℝ) : Set (Option ι → NNReal) := {e | kLinear y e = (e none : ℝ)} theorem measurableSet_kBoundary (y : ι → ℝ) : diff --git a/LeanPool/Feige/KStatistic.lean b/LeanPool/Feige/KStatistic.lean index 2a032f8142..0739829f62 100644 --- a/LeanPool/Feige/KStatistic.lean +++ b/LeanPool/Feige/KStatistic.lean @@ -20,7 +20,7 @@ exponentials on `ℝ≥0`, so their nonnegativity is encoded by the type and the coordinatewise antitonicity of `K` is a pointwise set inclusion. -/ -@[expose] public section +public section open scoped BigOperators ENNReal @@ -36,6 +36,7 @@ The source exponential law is already supported on the nonnegative reals. Using the push-forward makes nonnegativity definitional in all later finite sum arguments. -/ +@[expose] noncomputable def nnexpMeasure : Measure NNReal := (expMeasure 1).map Real.toNNReal @@ -48,7 +49,7 @@ noncomputable instance nnexpMeasure.isProbabilityMeasure : /-- The joint law of `E₀` and an `ι`-indexed family of independent rate-one exponentials. -/ -noncomputable def expProductMeasure (ι : Type*) [Fintype ι] : +@[expose] noncomputable def expProductMeasure (ι : Type*) [Fintype ι] : Measure (Option ι → NNReal) := Measure.pi fun _ ↦ nnexpMeasure @@ -65,7 +66,7 @@ section Statistic variable {ι : Type*} [Fintype ι] /-- The exponential event corresponding to the simplex event in (2.1). -/ -def kEvent (y : ι → ℝ) : Set (Option ι → NNReal) := +@[expose] def kEvent (y : ι → ℝ) : Set (Option ι → NNReal) := {e | ∑ i, (y i - 1) * (e (some i) : ℝ) ≤ (e none : ℝ)} theorem measurableSet_kEvent (y : ι → ℝ) : MeasurableSet (kEvent y) := by @@ -77,7 +78,7 @@ theorem measurableSet_kEvent (y : ι → ℝ) : MeasurableSet (kEvent y) := by /-- The Dirichlet statistic from (2.1), represented internally by independent rate-one exponentials. -/ -noncomputable def dirichletK (y : ι → ℝ) : ℝ := +@[expose] noncomputable def dirichletK (y : ι → ℝ) : ℝ := (expProductMeasure ι).real (kEvent y) theorem dirichletK_nonneg (y : ι → ℝ) : 0 ≤ dirichletK y := diff --git a/LeanPool/Feige/KernelAveraging.lean b/LeanPool/Feige/KernelAveraging.lean index 05b690138d..29bbc126d7 100644 --- a/LeanPool/Feige/KernelAveraging.lean +++ b/LeanPool/Feige/KernelAveraging.lean @@ -16,7 +16,7 @@ two-point decomposition: an almost-everywhere event bound for the conditional Markov kernel survives averaging over a probability law. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/Lemma43.lean b/LeanPool/Feige/Lemma43.lean index c458f3a6fa..4955678961 100644 --- a/LeanPool/Feige/Lemma43.lean +++ b/LeanPool/Feige/Lemma43.lean @@ -17,7 +17,7 @@ order comparison in forms intended for pointwise use along an insertion chain. -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal @@ -29,31 +29,31 @@ namespace Lemma43 open TransferStein TransferTestFunctions ProbabilityTheory /-- The probability quantities attached to one law. -/ -noncomputable def F (ν : Measure ℝ) : ℝ := +@[expose] noncomputable def F (ν : Measure ℝ) : ℝ := ENNReal.toReal (ν (Ici 0)) /-- The upper transfer-test expectation for `ν`. -/ -noncomputable def A (ν : Measure ℝ) (d : ℝ) : ℝ := +@[expose] noncomputable def A (ν : Measure ℝ) (d : ℝ) : ℝ := ∫ z, transferPhi d z ∂ν /-- The lower transfer-test expectation for `ν`. -/ -noncomputable def B (ν : Measure ℝ) (c : ℝ) : ℝ := +@[expose] noncomputable def B (ν : Measure ℝ) (c : ℝ) : ℝ := ∫ z, transferPsi c z ∂ν /-- The upper crossing probability for `ν`. -/ -noncomputable def u (ν : Measure ℝ) (d : ℝ) : ℝ := +@[expose] noncomputable def u (ν : Measure ℝ) (d : ℝ) : ℝ := uProbability ν d /-- The lower crossing probability for `ν`. -/ -noncomputable def v (ν : Measure ℝ) (c : ℝ) : ℝ := +@[expose] noncomputable def v (ν : Measure ℝ) (c : ℝ) : ℝ := vProbability ν c /-- The sum of the upper and lower crossing probabilities. -/ -noncomputable def w (ν : Measure ℝ) (c d : ℝ) : ℝ := +@[expose] noncomputable def w (ν : Measure ℝ) (c d : ℝ) : ℝ := u ν d + v ν c /-- The upper crossing probability normalized by total crossing mass. -/ -noncomputable def theta (ν : Measure ℝ) (c d : ℝ) : ℝ := +@[expose] noncomputable def theta (ν : Measure ℝ) (c d : ℝ) : ℝ := u ν d / w ν c d theorem w_pos @@ -88,6 +88,7 @@ theorem w_pos /-- Explicit, auditable identification between the actual tail probabilities of two laws and the four likelihood-ratio integrals. -/ +@[expose] def DensityIdentification (f : ℝ → ℝ≥0∞) (νP νM : Measure ℝ) (a b c d : ℝ) : Prop := @@ -102,6 +103,7 @@ def DensityIdentification /-- The four elementary relations among `A,B,F,u,v,w`, kept as an explicit proposition so that no probability identification is hidden. -/ +@[expose] def ProbabilityRelations (νP νM : Measure ℝ) (c d : ℝ) : Prop := B νP c = A νP d + w νP c d ∧ diff --git a/LeanPool/Feige/Lemma43ArbitraryBase.lean b/LeanPool/Feige/Lemma43ArbitraryBase.lean index 42e221bfd8..6adf4e6975 100644 --- a/LeanPool/Feige/Lemma43ArbitraryBase.lean +++ b/LeanPool/Feige/Lemma43ArbitraryBase.lean @@ -14,7 +14,7 @@ import LeanPool.Feige.Lemma43Relations # Local transfer identity for an arbitrary base law -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal diff --git a/LeanPool/Feige/Lemma43Complete.lean b/LeanPool/Feige/Lemma43Complete.lean index ee71bd1a11..a821e5e9f9 100644 --- a/LeanPool/Feige/Lemma43Complete.lean +++ b/LeanPool/Feige/Lemma43Complete.lean @@ -17,7 +17,7 @@ Stein identities and assembles the probability relations and density identifications. -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal diff --git a/LeanPool/Feige/Lemma43Density.lean b/LeanPool/Feige/Lemma43Density.lean index c7b5b144f3..4fc6570be1 100644 --- a/LeanPool/Feige/Lemma43Density.lean +++ b/LeanPool/Feige/Lemma43Density.lean @@ -14,7 +14,7 @@ This file connects the pushforward laws `zPlusLaw` and `zMinusLaw` to the convolution densities `LikelihoodRatio.fPlus` and `fMinus`. -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal diff --git a/LeanPool/Feige/Lemma43Endpoints.lean b/LeanPool/Feige/Lemma43Endpoints.lean index 3924552f50..356580a536 100644 --- a/LeanPool/Feige/Lemma43Endpoints.lean +++ b/LeanPool/Feige/Lemma43Endpoints.lean @@ -13,7 +13,7 @@ import LeanPool.Feige.TransferProbability # Endpoint tail identities for the local transfer step -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal diff --git a/LeanPool/Feige/Lemma43FiniteSigned.lean b/LeanPool/Feige/Lemma43FiniteSigned.lean index d5d1fe8897..ca4fcfb377 100644 --- a/LeanPool/Feige/Lemma43FiniteSigned.lean +++ b/LeanPool/Feige/Lemma43FiniteSigned.lean @@ -18,7 +18,7 @@ likelihood-ratio results to the exact common laws appearing on genuine Boolean-lattice insertion edges. -/ -@[expose] public section +public section open MeasureTheory @@ -30,7 +30,7 @@ open LikelihoodRatio /-- The complete four-part local-transfer conclusion for the two exponential shifts of a base density. -/ -def CompleteConclusion +@[expose] def CompleteConclusion (f : ℝ → ENNReal) (a b c d : ℝ) : Prop := let νP := zPlusLaw (volume.withDensity f) a let νM := zMinusLaw (volume.withDensity f) b diff --git a/LeanPool/Feige/Lemma43Insertion.lean b/LeanPool/Feige/Lemma43Insertion.lean index abddeb63f9..e6ccc59012 100644 --- a/LeanPool/Feige/Lemma43Insertion.lean +++ b/LeanPool/Feige/Lemma43Insertion.lean @@ -18,7 +18,7 @@ an old Boolean chain. This file records the exact, purely algebraic interface between those two presentations. -/ -@[expose] public section +public section open MeasureTheory @@ -33,7 +33,7 @@ theorem theta_nonneg (ν : Measure ℝ) (c d : ℝ) : /-- The entries of the insertion sequences at one edge are represented by the two laws occurring in the local transfer step. -/ -def RealizesInsertionEdge +@[expose] def RealizesInsertionEdge (upper old width interpolation : ℕ → ℝ) (j : ℕ) (νP νM : Measure ℝ) (c d : ℝ) : Prop := upper j = A νP d ∧ diff --git a/LeanPool/Feige/Lemma43Relations.lean b/LeanPool/Feige/Lemma43Relations.lean index e56d45aabb..4f7fcd83b6 100644 --- a/LeanPool/Feige/Lemma43Relations.lean +++ b/LeanPool/Feige/Lemma43Relations.lean @@ -16,7 +16,7 @@ tails. Consequently the `ProbabilityRelations` input of `Lemma43.complete` holds for every finite law and need not remain an external hypothesis. -/ -@[expose] public section +public section open MeasureTheory Real Set diff --git a/LeanPool/Feige/LikelihoodRatio.lean b/LeanPool/Feige/LikelihoodRatio.lean index cea6b19875..0db5252ed7 100644 --- a/LeanPool/Feige/LikelihoodRatio.lean +++ b/LeanPool/Feige/LikelihoodRatio.lean @@ -17,7 +17,7 @@ exponential transfer step used in the proof of Theorem 2.1. We use an auxiliary integrability assumptions. -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal @@ -32,6 +32,7 @@ For nonnegative functions on the line this is the exact multiplicative inequality needed below. Ordinary log-concave densities with convex support satisfy this property by concavity of `log f`. -/ +@[expose] def FourPointLogConcave (f : ℝ → ℝ≥0∞) : Prop := ∀ ⦃r p q s : ℝ⦄, r ≤ p → p ≤ q → r ≤ s → s ≤ q → p + s = r + q → @@ -56,7 +57,7 @@ theorem four_point_exponential_shifts simpa [mul_comm] using h /-- The exponential convolution weight. -/ -noncomputable def expWeight (s : ℝ) : ℝ≥0∞ := +@[expose] noncomputable def expWeight (s : ℝ) : ℝ≥0∞ := ENNReal.ofReal (exp (-s)) theorem measurable_expWeight : Measurable expWeight := by @@ -64,10 +65,12 @@ theorem measurable_expWeight : Measurable expWeight := by fun_prop /-- The positive-shift density `f₊`, expressed as a nonnegative integral. -/ +@[expose] noncomputable def fPlus (f : ℝ → ℝ≥0∞) (a x : ℝ) : ℝ≥0∞ := ∫⁻ s in Ici 0, f (x - a * s) * expWeight s /-- The negative-shift density `f₋`, expressed as a nonnegative integral. -/ +@[expose] noncomputable def fMinus (f : ℝ → ℝ≥0∞) (b x : ℝ) : ℝ≥0∞ := ∫⁻ t in Ici 0, f (x + b * t) * expWeight t @@ -129,11 +132,11 @@ theorem measurable_fMinus {f : ℝ → ℝ≥0∞} (hf : Measurable f) (b : ℝ) (measurable_expWeight.comp measurable_snd) /-- The lower-tail transfer functional `u` for a nonnegative density `g`. -/ -noncomputable def uIntegral (g : ℝ → ℝ≥0∞) (d : ℝ) : ℝ≥0∞ := +@[expose] noncomputable def uIntegral (g : ℝ → ℝ≥0∞) (d : ℝ) : ℝ≥0∞ := ∫⁻ x in Ici 0, g x * ENNReal.ofReal (exp (-x / d)) /-- The upper-tail transfer functional `v` for a nonnegative density `g`. -/ -noncomputable def vIntegral (g : ℝ → ℝ≥0∞) (c : ℝ) : ℝ≥0∞ := +@[expose] noncomputable def vIntegral (g : ℝ → ℝ≥0∞) (c : ℝ) : ℝ≥0∞ := ∫⁻ y in Iio 0, g y * ENNReal.ofReal (exp (y / c)) /-- Integrating the likelihood-ratio comparison against the two exponential diff --git a/LeanPool/Feige/MainTheorem.lean b/LeanPool/Feige/MainTheorem.lean index 402bd9fc5d..7771054e2c 100644 --- a/LeanPool/Feige/MainTheorem.lean +++ b/LeanPool/Feige/MainTheorem.lean @@ -17,7 +17,7 @@ All probabilistic, analytic, and geometric inputs for the `δ = 1` specialization of Theorem 1.1 are discharged here. -/ -@[expose] public section +public section namespace Feige diff --git a/LeanPool/Feige/MarginalLaw.lean b/LeanPool/Feige/MarginalLaw.lean index 335e8d52c1..13801be9ad 100644 --- a/LeanPool/Feige/MarginalLaw.lean +++ b/LeanPool/Feige/MarginalLaw.lean @@ -17,7 +17,7 @@ random variables by their product of marginal distributions: integrability, the first moment, and nonnegative support. -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/Feige/MeanOneAugmentedMixture.lean b/LeanPool/Feige/MeanOneAugmentedMixture.lean index d4594bbfac..649d9b21c5 100644 --- a/LeanPool/Feige/MeanOneAugmentedMixture.lean +++ b/LeanPool/Feige/MeanOneAugmentedMixture.lean @@ -17,7 +17,7 @@ latent law is simply the atom branch. This removes the artificial coordinatewise strict-moment assumption from the finite product mixture. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory @@ -26,7 +26,7 @@ namespace Feige noncomputable section /-- The augmented latent law, including the degenerate zero-below-moment case. -/ -def meanOneAugmentedLatent (μ : Measure ℝ) : +@[expose] def meanOneAugmentedLatent (μ : Measure ℝ) : Measure AugmentedTwoPointParams := if belowMoment μ = 0 then Measure.dirac (Sum.inl ()) diff --git a/LeanPool/Feige/MeanOneReduction.lean b/LeanPool/Feige/MeanOneReduction.lean index 39f9cd5d07..684c7c09e3 100644 --- a/LeanPool/Feige/MeanOneReduction.lean +++ b/LeanPool/Feige/MeanOneReduction.lean @@ -14,7 +14,7 @@ public import Mathlib.Probability.Independence.Basic This is the final mean-normalization reduction in the proof of Theorem 2.1. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set Filter diff --git a/LeanPool/Feige/MeasurableTwoPointKernel.lean b/LeanPool/Feige/MeasurableTwoPointKernel.lean index c267d46106..b53d2aa44e 100644 --- a/LeanPool/Feige/MeasurableTwoPointKernel.lean +++ b/LeanPool/Feige/MeasurableTwoPointKernel.lean @@ -17,7 +17,7 @@ This file supplies the measurable-kernel interface needed to condition on the latent two-point parameters in the proof of Theorem 2.1. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set @@ -35,6 +35,7 @@ theorem measurable_twoPointMeasure_apply {B : Set ℝ} (hB : MeasurableSet B) : fun_prop /-- Admissible parameters `x ≤ 1 ≤ y`, with distinct support points. -/ +@[expose] def TwoPointParams := {p : ℝ × ℝ // p.1 ≤ 1 ∧ 1 ≤ p.2 ∧ p.1 < p.2} @@ -52,7 +53,7 @@ noncomputable def twoPointKernel : Kernel TwoPointParams ℝ where @[simp] theorem twoPointKernel_apply (p : TwoPointParams) : twoPointKernel p = twoPointMeasure p.1.1 p.1.2 := - rfl + by rfl instance : IsMarkovKernel twoPointKernel where isProbabilityMeasure p := @@ -103,7 +104,7 @@ theorem kernelTwoPointMixture_apply_le _ = c := by simp /-- The strict below-above region used for the nondegenerate latent pair. -/ -def strictPairSet : Set (ℝ × ℝ) := +@[expose] def strictPairSet : Set (ℝ × ℝ) := {p | p.1 < 1 ∧ 1 < p.2} theorem measurableSet_strictPairSet : MeasurableSet strictPairSet := by @@ -122,7 +123,7 @@ local instance : DecidablePred (· ∈ strictPairSet) := /-- A total measurable map into `TwoPointParams`; outside the strict region we use the harmless default pair `(0,2)`. The weighted latent measure below is supported on the strict region. -/ -noncomputable def pairToParams (p : ℝ × ℝ) : TwoPointParams := +@[expose] noncomputable def pairToParams (p : ℝ × ℝ) : TwoPointParams := if hp : p ∈ strictPairSet then ⟨p, strictPairSet_admissible hp⟩ else ⟨(0, 2), by norm_num⟩ @@ -147,7 +148,7 @@ theorem measurable_pairToParams : Measurable pairToParams := by /-- The unnormalized product law on a strict below point and a strict above point. -/ -noncomputable def belowAboveProduct (μ : Measure ℝ) : Measure (ℝ × ℝ) := +@[expose] noncomputable def belowAboveProduct (μ : Measure ℝ) : Measure (ℝ × ℝ) := (μ.restrict (Iio 1)).prod (μ.restrict (Ioi 1)) /-- The density `(y-x)/M` of the latent below/above pair, written in @@ -161,7 +162,7 @@ theorem measurable_latentPairDensity (M : ℝ) : fun_prop /-- The concrete weighted below×above latent measure. -/ -noncomputable def latentPairMeasure (μ : Measure ℝ) (M : ℝ) : +@[expose] noncomputable def latentPairMeasure (μ : Measure ℝ) (M : ℝ) : Measure (ℝ × ℝ) := (belowAboveProduct μ).withDensity (latentPairDensity M) @@ -192,7 +193,7 @@ instance (μ : Measure ℝ) [SFinite μ] (M : ℝ) : /-- The weighted pair measure, transported to the admissible parameter subtype on which `twoPointKernel` is Markov. -/ -noncomputable def latentParamsMeasure (μ : Measure ℝ) (M : ℝ) : +@[expose] noncomputable def latentParamsMeasure (μ : Measure ℝ) (M : ℝ) : Measure TwoPointParams := (latentPairMeasure μ M).map pairToParams @@ -204,6 +205,7 @@ theorem latentParamsMeasure_apply (μ : Measure ℝ) (M : ℝ) /-- The resulting genuine kernel mixture of the nondegenerate latent component. -/ +@[expose] noncomputable def nondegenerateKernelMixture (μ : Measure ℝ) (M : ℝ) : Measure ℝ := kernelTwoPointMixture (latentParamsMeasure μ M) @@ -384,6 +386,7 @@ theorem latentPairMeasure_univ_meanOne /-- The full kernel mixture: the atom at one plus the nondegenerate latent two-point component. -/ +@[expose] noncomputable def fullKernelMixture (μ : Measure ℝ) (M : ℝ) : Measure ℝ := μ {1} • Measure.dirac 1 + nondegenerateKernelMixture μ M diff --git a/LeanPool/Feige/MixtureCalibration.lean b/LeanPool/Feige/MixtureCalibration.lean index b8f6b7475d..2abc5cd2df 100644 --- a/LeanPool/Feige/MixtureCalibration.lean +++ b/LeanPool/Feige/MixtureCalibration.lean @@ -17,7 +17,7 @@ It is kept separate from the construction of the latent law: any probability measure on augmented parameters that is almost surely admissible can be used. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/NNRealExponentialLaw.lean b/LeanPool/Feige/NNRealExponentialLaw.lean index f655dbee6f..dbfc973585 100644 --- a/LeanPool/Feige/NNRealExponentialLaw.lean +++ b/LeanPool/Feige/NNRealExponentialLaw.lean @@ -16,7 +16,7 @@ This module isolates the elementary push-forward identity relating the measure. -/ -@[expose] public section +public section open Set MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/NormalizedExponential.lean b/LeanPool/Feige/NormalizedExponential.lean index a70a12e580..e9fc5efc42 100644 --- a/LeanPool/Feige/NormalizedExponential.lean +++ b/LeanPool/Feige/NormalizedExponential.lean @@ -26,7 +26,7 @@ The forward map is and its inverse divides all nonzero-total vectors by their total mass. -/ -@[expose] public section +public section open scoped BigOperators ENNReal open Set @@ -37,7 +37,7 @@ namespace Feige variable {n : ℕ} /-- Total mass of an `E₀,E₁,...,Eₙ` vector in product coordinates. -/ -def exponentialTotal (e : ℝ × (Fin n → ℝ)) : ℝ := +@[expose] def exponentialTotal (e : ℝ × (Fin n → ℝ)) : ℝ := e.1 + ∑ i, e.2 i /-- Polar/simplex coordinate map used for normalized exponentials. -/ @@ -47,6 +47,7 @@ def exponentialSimplexForward /-- Inverse normalized-coordinate map. It is used only on the domain where the total is positive. -/ +@[expose] noncomputable def exponentialSimplexInverse (e : ℝ × (Fin n → ℝ)) : ℝ × (Fin n → ℝ) := (exponentialTotal e, fun i ↦ e.2 i / exponentialTotal e) @@ -56,6 +57,7 @@ def exponentialSimplexSource : Set (ℝ × (Fin n → ℝ)) := {z | 0 < z.1 ∧ z.2 ∈ fullSimplex (Fin n)} /-- Nonnegative exponential vectors with nonzero total mass. -/ +@[expose] def positiveExponentialOrthant : Set (ℝ × (Fin n → ℝ)) := {e | 0 ≤ e.1 ∧ (∀ i, 0 ≤ e.2 i) ∧ 0 < exponentialTotal e} @@ -239,6 +241,7 @@ theorem fderiv_exponentialSimplexForward /-- Identify an `Option (Fin n)` coordinate vector with radial/product coordinates. -/ +@[expose] def optionVectorToProduct (v : Option (Fin n) → ℝ) : ℝ × (Fin n → ℝ) := (v none, fun i ↦ v (some i)) @@ -283,26 +286,26 @@ theorem exponentialSimplexJacobianMatrix_none_none (z : ℝ × (Fin n → ℝ)) : exponentialSimplexJacobianMatrix z none none = 1 - ∑ i, z.2 i := - rfl + by rfl @[simp] theorem exponentialSimplexJacobianMatrix_none_some (z : ℝ × (Fin n → ℝ)) (j : Fin n) : exponentialSimplexJacobianMatrix z none (some j) = -z.1 := - rfl + by rfl @[simp] theorem exponentialSimplexJacobianMatrix_some_none (z : ℝ × (Fin n → ℝ)) (i : Fin n) : exponentialSimplexJacobianMatrix z (some i) none = z.2 i := - rfl + by rfl @[simp] theorem exponentialSimplexJacobianMatrix_some_some (z : ℝ × (Fin n → ℝ)) (i j : Fin n) : exponentialSimplexJacobianMatrix z (some i) (some j) = if i = j then z.1 else 0 := - rfl + by rfl theorem exponentialSimplexJacobianMatrix_mulVec_none (z : ℝ × (Fin n → ℝ)) (v : Option (Fin n) → ℝ) : @@ -577,7 +580,7 @@ theorem lintegral_exponentialRadial_mul_test /-- The measure on simplex coordinates obtained from independent unit-rate exponentials: factorial times Lebesgue measure restricted to the full simplex. -/ -noncomputable def normalizedExponentialSimplexMeasure : +@[expose] noncomputable def normalizedExponentialSimplexMeasure : Measure (Fin n → ℝ) := (n.factorial : ℝ≥0∞) • (volume.restrict (fullSimplex (Fin n))) @@ -611,7 +614,7 @@ theorem lintegral_normalizedExponential_eq_simplex /-- The unit-rate exponential density, extended by zero to the negative half-line. -/ -noncomputable def unitExponentialDensity (t : ℝ) : ℝ := +@[expose] noncomputable def unitExponentialDensity (t : ℝ) : ℝ := (Ici (0 : ℝ)).indicator (fun t ↦ Real.exp (-t)) t theorem integral_unitExponentialDensity : diff --git a/LeanPool/Feige/NormalizedExponentialProbability.lean b/LeanPool/Feige/NormalizedExponentialProbability.lean index eb80ee7d8b..998295d174 100644 --- a/LeanPool/Feige/NormalizedExponentialProbability.lean +++ b/LeanPool/Feige/NormalizedExponentialProbability.lean @@ -16,7 +16,7 @@ This module supplies the product-density normalization needed to turn the normalized-exponential integral identity into a probability-law statement. -/ -@[expose] public section +public section open scoped BigOperators ENNReal open Set MeasureTheory @@ -43,7 +43,7 @@ theorem integrable_pi_unitExponentialDensity : exact Integrable.fintype_prod fun _ ↦ integrable_unitExponentialDensity /-- Real-valued joint density on `ℝ × (Fin n → ℝ)`. -/ -noncomputable def jointUnitExponentialDensity +@[expose] noncomputable def jointUnitExponentialDensity (e : ℝ × (Fin n → ℝ)) : ℝ := unitExponentialDensity e.1 * ∏ i, unitExponentialDensity (e.2 i) diff --git a/LeanPool/Feige/OneSidedDensity.lean b/LeanPool/Feige/OneSidedDensity.lean index 355dc50ae7..c3c2189317 100644 --- a/LeanPool/Feige/OneSidedDensity.lean +++ b/LeanPool/Feige/OneSidedDensity.lean @@ -16,7 +16,7 @@ negative scaled exponentials. This file verifies the four-point log-concavity condition for each individual one-sided exponential factor. -/ -@[expose] public section +public section open scoped ENNReal @@ -24,7 +24,7 @@ namespace Feige namespace LikelihoodRatio /-- Density of `aE`, up to the canonical Lebesgue interpretation. -/ -noncomputable def rightExponentialDensity (a x : ℝ) : ℝ≥0∞ := +@[expose] noncomputable def rightExponentialDensity (a x : ℝ) : ℝ≥0∞ := if 0 ≤ x then ENNReal.ofReal (Real.exp (-x / a) / a) else 0 theorem measurable_rightExponentialDensity (a : ℝ) : @@ -71,7 +71,7 @@ theorem FourPointLogConcave.reflect {f : ℝ → ℝ≥0∞} simpa [mul_comm] using h /-- Density of `-bE`. -/ -noncomputable def leftExponentialDensity (b x : ℝ) : ℝ≥0∞ := +@[expose] noncomputable def leftExponentialDensity (b x : ℝ) : ℝ≥0∞ := rightExponentialDensity b (-x) theorem measurable_leftExponentialDensity (b : ℝ) : diff --git a/LeanPool/Feige/OrderedTwoPointInduction.lean b/LeanPool/Feige/OrderedTwoPointInduction.lean index 7fe6790344..b28847ec35 100644 --- a/LeanPool/Feige/OrderedTwoPointInduction.lean +++ b/LeanPool/Feige/OrderedTwoPointInduction.lean @@ -18,7 +18,7 @@ the last coordinate, the induction hypothesis constructs a chain on the old coordinates, and one insertion of the new coordinate completes the step. -/ -@[expose] public section +public section open scoped BigOperators @@ -26,7 +26,7 @@ namespace Feige /-- The uniform local conclusion needed at every induction stage, restricted to the strict ordered systems to which the analytic insertion proof applies. -/ -def StrictOrderedLocalInsertion : Prop := +@[expose] def StrictOrderedLocalInsertion : Prop := ∀ {n : ℕ} (γ β : Fin (n + 1) → ℝ) (hγpos : ∀ i, 0 < γ i) (_hγle : ∀ i, γ i ≤ 1) diff --git a/LeanPool/Feige/PaperAssembly.lean b/LeanPool/Feige/PaperAssembly.lean index 41732928db..611a865f6c 100644 --- a/LeanPool/Feige/PaperAssembly.lean +++ b/LeanPool/Feige/PaperAssembly.lean @@ -20,7 +20,7 @@ The remaining parameter is the `α = 0` centroid-halfspace bound used by the `δ = 1` specialization of the geometric argument in §2.2. -/ -@[expose] public section +public section namespace Feige diff --git a/LeanPool/Feige/ProductSplit.lean b/LeanPool/Feige/ProductSplit.lean index e2c3d7d830..5483f8e475 100644 --- a/LeanPool/Feige/ProductSplit.lean +++ b/LeanPool/Feige/ProductSplit.lean @@ -16,7 +16,7 @@ induction for Theorem 2.1. Every high set on `Fin (n + 1)` is uniquely a lifted old high set, with or without the last coordinate. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Feige/ProductTwoPointKernel.lean b/LeanPool/Feige/ProductTwoPointKernel.lean index 24f685567c..235d35fc61 100644 --- a/LeanPool/Feige/ProductTwoPointKernel.lean +++ b/LeanPool/Feige/ProductTwoPointKernel.lean @@ -18,7 +18,7 @@ finite independent product. It is the product-measure interface used in the proof of Theorem 2.1 before conditioning on all latent pairs. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set @@ -28,7 +28,7 @@ noncomputable section /-- Given all latent coordinates, the observations are conditionally independent with the augmented two-point conditional marginals. -/ -noncomputable def augmentedConditionalProduct {n : ℕ} +@[expose] noncomputable def augmentedConditionalProduct {n : ℕ} (p : Fin n → AugmentedTwoPointParams) : Measure (Fin n → ℝ) := Measure.pi (fun i ↦ augmentedTwoPointKernel (p i)) @@ -80,7 +80,7 @@ theorem parallelComp_comp_prod_measure section RecursiveFiniteKernel /-- Measurable head/tail splitting of a homogeneous `Fin (n+1)` vector. -/ -noncomputable def finHeadTailEquiv (α : Type*) [MeasurableSpace α] (n : ℕ) : +@[expose] noncomputable def finHeadTailEquiv (α : Type*) [MeasurableSpace α] (n : ℕ) : (Fin (n + 1) → α) ≃ᵐ α × (Fin n → α) := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => α) 0 @@ -88,7 +88,7 @@ noncomputable def finHeadTailEquiv (α : Type*) [MeasurableSpace α] (n : ℕ) : coordinate kernels. This avoids the unavailable `Kernel.pi`: the successor case splits head and tail, uses `parallelComp`, and maps the output pair back to a `Fin (n+1)` vector. -/ -noncomputable def recursiveAugmentedKernel : +@[expose] noncomputable def recursiveAugmentedKernel : (n : ℕ) → Kernel (Fin n → AugmentedTwoPointParams) (Fin n → ℝ) | 0 => Kernel.const _ (Measure.dirac (fun i => Fin.elim0 i)) | n + 1 => @@ -134,7 +134,7 @@ theorem bind_congr_measurableEquiv /-- Recursive latent product aligned definitionally with `recursiveAugmentedKernel`. -/ -noncomputable def recursiveAugmentedLatent : +@[expose] noncomputable def recursiveAugmentedLatent : (n : ℕ) → (Fin n → Measure AugmentedTwoPointParams) → Measure (Fin n → AugmentedTwoPointParams) | 0 => fun _ => Measure.dirac (fun i => Fin.elim0 i) @@ -198,7 +198,7 @@ theorem recursiveAugmentedKernel_comp_latent /-- Zero-dimensional recursive product. -/ theorem recursiveRealProduct_zero (μ : Fin 0 → Measure ℝ) : recursiveRealProduct 0 μ = - Measure.dirac (fun i : Fin 0 => Fin.elim0 i) := rfl + Measure.dirac (fun i : Fin 0 => Fin.elim0 i) := by rfl /-- The head/tail recursive product is the standard finite `Measure.pi`. -/ theorem recursiveRealProduct_eq_pi diff --git a/LeanPool/Feige/RecursiveLatentProbability.lean b/LeanPool/Feige/RecursiveLatentProbability.lean index a9f2f77add..dd35612525 100644 --- a/LeanPool/Feige/RecursiveLatentProbability.lean +++ b/LeanPool/Feige/RecursiveLatentProbability.lean @@ -11,7 +11,7 @@ public import LeanPool.Feige.ProductTwoPointKernel # Probability instance for the recursive latent product -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/Feige/Reduction.lean b/LeanPool/Feige/Reduction.lean index f2408d688c..48f1b3b5fd 100644 --- a/LeanPool/Feige/Reduction.lean +++ b/LeanPool/Feige/Reduction.lean @@ -21,7 +21,7 @@ hypotheses. The result here is the shift, bad-event inclusion, and complement argument in the proof of Theorem 1.1. -/ -@[expose] public section +public section open scoped BigOperators open MeasureTheory ProbabilityTheory Set @@ -31,7 +31,7 @@ namespace Feige /-- Abstract form of the `δ = 1` geometric estimate in §2.2: a nonnegative vector with ordinary sum at least `n + 1` has Dirichlet statistic at most `1 - bₙ,₁`. -/ -def LargeSumBridge {n : ℕ} (K : (Fin n → ℝ) → ℝ) : Prop := +@[expose] def LargeSumBridge {n : ℕ} (K : (Fin n → ℝ) → ℝ) : Prop := ∀ y : Fin n → ℝ, (∀ i, 0 ≤ y i) → (n : ℝ) + 1 ≤ ∑ i, y i → @@ -40,7 +40,7 @@ def LargeSumBridge {n : ℕ} (K : (Fin n → ℝ) → ℝ) : Prop := /-- A candidate lower bound for the fixed-dimensional unit-slack Feige inequality, quantified over all admissible probability spaces and random variables. -/ -def FixedDimensionalFeigeLowerBound (n : ℕ) (c : ℝ) : Prop := +@[expose] def FixedDimensionalFeigeLowerBound (n : ℕ) (c : ℝ) : Prop := ∀ (Ω : Type) (_ : MeasurableSpace Ω) (μ : Measure Ω) (_ : IsProbabilityMeasure μ) (X : Fin n → Ω → ℝ), (∀ i, Measurable (X i)) → diff --git a/LeanPool/Feige/Sharpness.lean b/LeanPool/Feige/Sharpness.lean index c98af1d5f3..e816085eff 100644 --- a/LeanPool/Feige/Sharpness.lean +++ b/LeanPool/Feige/Sharpness.lean @@ -21,7 +21,7 @@ sample space is `(Fin n → Fin (n + 1))`, with its uniform law. Coordinate every coordinate has the two-point law used in the proof outline. -/ -@[expose] public section +public section open scoped BigOperators ENNReal open MeasureTheory Set @@ -68,7 +68,7 @@ theorem allLowEmbedding_injective (n : ℕ) : exact Fin.succ_inj.mp (congrFun h i) /-- The good event consists precisely of choices with no zero digit. -/ -def extremalGood (n : ℕ) : Set (ExtremalSpace n) := +@[expose] def extremalGood (n : ℕ) : Set (ExtremalSpace n) := Set.range (allLowEmbedding n) instance (n : ℕ) : Fintype (extremalGood n) := diff --git a/LeanPool/Feige/SignedExpLaw.lean b/LeanPool/Feige/SignedExpLaw.lean index beb40014ca..ee28345ecd 100644 --- a/LeanPool/Feige/SignedExpLaw.lean +++ b/LeanPool/Feige/SignedExpLaw.lean @@ -16,7 +16,7 @@ of exponential coordinates in `dirichletK` to the finite convolution law used by the TP2 proof. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set open scoped ENNReal @@ -136,6 +136,7 @@ theorem SignedExpFactor.map_expMeasure_one (F : SignedExpFactor) : map_neg_mul_expMeasure_one F.scale_pos /-- The pushforward law of one signed factor. -/ +@[expose] def SignedExpFactor.sourceLaw (F : SignedExpFactor) : Measure ℝ := Measure.map (fun x : ℝ ↦ @@ -155,7 +156,7 @@ and every signed factor. Convolution is the pushforward of the product law under addition, so this is an actual random-sum law rather than merely a density recursion. -/ -def finiteSignedExpSumSourceMeasure : +@[expose] def finiteSignedExpSumSourceMeasure : List SignedExpFactor → Measure ℝ | [] => Measure.map (fun x : ℝ ↦ x) (expMeasure 1) | F :: Fs => diff --git a/LeanPool/Feige/SimplexExponentialIdentification.lean b/LeanPool/Feige/SimplexExponentialIdentification.lean index 69d425d408..c14c50de65 100644 --- a/LeanPool/Feige/SimplexExponentialIdentification.lean +++ b/LeanPool/Feige/SimplexExponentialIdentification.lean @@ -18,7 +18,7 @@ simplex statistic in (2.1) and the internal exponential representation, in the `NNReal` coordinate model used by `expProductMeasure`. -/ -@[expose] public section +public section open scoped BigOperators ENNReal open Set MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/SimplexExponentialLaw.lean b/LeanPool/Feige/SimplexExponentialLaw.lean index 75847a9a43..011b2da349 100644 --- a/LeanPool/Feige/SimplexExponentialLaw.lean +++ b/LeanPool/Feige/SimplexExponentialLaw.lean @@ -18,7 +18,7 @@ the normalized-exponential calculation with the project's existing uniform simplex probability measure. -/ -@[expose] public section +public section open scoped ENNReal open MeasureTheory Set @@ -36,13 +36,14 @@ theorem normalizedExponentialSimplexMeasure_eq_uniform : rw [inv_inv] /-- The normalized-coordinate map on real product coordinates. -/ +@[expose] noncomputable def normalizedExponentialCoordinates (e : ℝ × (Fin n → ℝ)) : Fin n → ℝ := (exponentialSimplexInverse e).2 /-- Independent unit exponentials on the positive real orthant, written as an absolutely continuous measure in real product coordinates. -/ -noncomputable def realExponentialProductMeasure : +@[expose] noncomputable def realExponentialProductMeasure : Measure (ℝ × (Fin n → ℝ)) := (volume.restrict (positiveExponentialOrthant (n := n))).withDensity (fun e ↦ ENNReal.ofReal (Real.exp (-exponentialTotal e))) diff --git a/LeanPool/Feige/SimplexGeometry.lean b/LeanPool/Feige/SimplexGeometry.lean index c03c4352ce..6427f330ff 100644 --- a/LeanPool/Feige/SimplexGeometry.lean +++ b/LeanPool/Feige/SimplexGeometry.lean @@ -23,7 +23,7 @@ halfspace argument: the simplex, its centroid, and the value at that centroid of the linear functional determined by a coefficient vector. -/ -@[expose] public section +public section open scoped BigOperators ENNReal @@ -35,7 +35,7 @@ variable {ι : Type*} [Fintype ι] /-- The full-dimensional standard simplex in `ι → ℝ`, obtained by deleting one coordinate from the standard simplex on `Option ι`. -/ -def fullSimplex (ι : Type*) [Fintype ι] : Set (ι → ℝ) := +@[expose] def fullSimplex (ι : Type*) [Fintype ι] : Set (ι → ℝ) := {x | (∀ i, 0 ≤ x i) ∧ ∑ i, x i ≤ 1} theorem mem_fullSimplex_iff {x : ι → ℝ} : @@ -92,6 +92,7 @@ theorem volume_fullSimplex_lt_top : /-- The centroid of the full-dimensional standard simplex. Its `ι` coordinates, as well as the deleted coordinate, all equal `1 / (card ι + 1)`. -/ +@[expose] noncomputable def simplexCentroid (ι : Type*) [Fintype ι] : ι → ℝ := fun _ ↦ ((Fintype.card ι : ℝ) + 1)⁻¹ @@ -144,7 +145,7 @@ theorem volume_fullSimplex_pos : /-- The linear functional cutting out the simplex halfspace associated to the coefficient vector `y`. -/ -def simplexLinearForm (y x : ι → ℝ) : ℝ := +@[expose] def simplexLinearForm (y x : ι → ℝ) : ℝ := ∑ i, y i * x i theorem simplexLinearForm_apply (y x : ι → ℝ) : diff --git a/LeanPool/Feige/SimplexMeasure.lean b/LeanPool/Feige/SimplexMeasure.lean index d57d31bc15..4269a89d56 100644 --- a/LeanPool/Feige/SimplexMeasure.lean +++ b/LeanPool/Feige/SimplexMeasure.lean @@ -20,7 +20,7 @@ the `δ = 1` specialization of §2.2. Everything after that geometric input, including the strict-boundary/complement step, is proved here. -/ -@[expose] public section +public section open scoped BigOperators ENNReal open MeasureTheory ProbabilityTheory Set @@ -30,12 +30,12 @@ namespace Feige variable {ι : Type*} [Fintype ι] /-- Lebesgue measure restricted to the full-dimensional simplex. -/ -noncomputable def simplexRestrictedVolume (ι : Type*) [Fintype ι] : +@[expose] noncomputable def simplexRestrictedVolume (ι : Type*) [Fintype ι] : Measure (ι → ℝ) := volume.restrict (fullSimplex ι) /-- Uniform probability measure on the full-dimensional standard simplex. -/ -noncomputable def simplexUniformMeasure (ι : Type*) [Fintype ι] : +@[expose] noncomputable def simplexUniformMeasure (ι : Type*) [Fintype ι] : Measure (ι → ℝ) := (volume (fullSimplex ι))⁻¹ • simplexRestrictedVolume ι @@ -55,7 +55,7 @@ theorem simplexUniformMeasure_apply {s : Set (ι → ℝ)} (hs : MeasurableSet s smul_eq_mul, simplexRestrictedVolume, Measure.restrict_apply hs] /-- The simplex form of the Dirichlet statistic `Kₙ` in (2.1). -/ -noncomputable def simplexK (y : ι → ℝ) : ℝ := +@[expose] noncomputable def simplexK (y : ι → ℝ) : ℝ := (simplexUniformMeasure ι).real {x | simplexLinearForm y x ≤ 1} theorem measurableSet_simplexK_event (y : ι → ℝ) : @@ -76,6 +76,7 @@ theorem simplexK_le_one (y : ι → ℝ) : simplexK y ≤ 1 := by /-- The precise `α = 0` simplex centroid-halfspace conclusion used by the `δ = 1` geometric estimate in §2.2. -/ +@[expose] def SimplexCentroidHalfspaceProperty : Prop := ∀ y : ι → ℝ, (∀ i, 0 ≤ y i) → diff --git a/LeanPool/Feige/SteinIdentity.lean b/LeanPool/Feige/SteinIdentity.lean index 8867bdfbd2..b3d4578894 100644 --- a/LeanPool/Feige/SteinIdentity.lean +++ b/LeanPool/Feige/SteinIdentity.lean @@ -20,7 +20,7 @@ conditions and the boundary condition at infinity needed for improper integration by parts. -/ -@[expose] public section +public section open MeasureTheory Real Set Filter Topology diff --git a/LeanPool/Feige/StrictLocalInsertion.lean b/LeanPool/Feige/StrictLocalInsertion.lean index c2b2f9fdb3..2ad7847532 100644 --- a/LeanPool/Feige/StrictLocalInsertion.lean +++ b/LeanPool/Feige/StrictLocalInsertion.lean @@ -19,7 +19,7 @@ then feeds the resulting local insertion principle into the permutation reduction for an arbitrary (not initially ordered) strict system. -/ -@[expose] public section +public section namespace Feige diff --git a/LeanPool/Feige/TransferAlgebra.lean b/LeanPool/Feige/TransferAlgebra.lean index 74ccbbd767..2e3b759879 100644 --- a/LeanPool/Feige/TransferAlgebra.lean +++ b/LeanPool/Feige/TransferAlgebra.lean @@ -26,7 +26,7 @@ hypotheses are needed for these implications; only the denominators have to be nonzero. -/ -@[expose] public section +public section namespace Feige diff --git a/LeanPool/Feige/TransferProbability.lean b/LeanPool/Feige/TransferProbability.lean index dd37967e17..b09aa88927 100644 --- a/LeanPool/Feige/TransferProbability.lean +++ b/LeanPool/Feige/TransferProbability.lean @@ -16,7 +16,7 @@ rate-one exponential measure. In particular, the strict and non-strict tails agree, since this measure has no atoms. -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal diff --git a/LeanPool/Feige/TransferProbability23.lean b/LeanPool/Feige/TransferProbability23.lean index 958face0aa..9942c4a8a1 100644 --- a/LeanPool/Feige/TransferProbability23.lean +++ b/LeanPool/Feige/TransferProbability23.lean @@ -13,7 +13,7 @@ import LeanPool.Feige.TransferProbability # Probability-law formulation of the transfer Stein identities -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal @@ -27,11 +27,11 @@ local instance : IsProbabilityMeasure (expMeasure 1) := isProbabilityMeasure_expMeasure one_pos /-- Law of `Z₊ = Y + aE`, where `E` is an independent rate-one exponential. -/ -noncomputable def zPlusLaw (μ : Measure ℝ) (a : ℝ) : Measure ℝ := +@[expose] noncomputable def zPlusLaw (μ : Measure ℝ) (a : ℝ) : Measure ℝ := Measure.map (fun p : ℝ × ℝ => p.1 + a * p.2) (μ.prod (expMeasure 1)) /-- Law of `Z₋ = Y - bE`, where `E` is an independent rate-one exponential. -/ -noncomputable def zMinusLaw (μ : Measure ℝ) (b : ℝ) : Measure ℝ := +@[expose] noncomputable def zMinusLaw (μ : Measure ℝ) (b : ℝ) : Measure ℝ := Measure.map (fun p : ℝ × ℝ => p.1 - b * p.2) (μ.prod (expMeasure 1)) theorem measurable_zPlusMap (a : ℝ) : @@ -174,11 +174,12 @@ theorem integrable_vTailIntegrand /-- The probability `P(0 ≤ Z < dE')`, represented on the canonical independent product space. -/ -noncomputable def uProbability (ν : Measure ℝ) (d : ℝ) : ℝ := +@[expose] noncomputable def uProbability (ν : Measure ℝ) (d : ℝ) : ℝ := ENNReal.toReal (ν.prod (expMeasure 1) {p : ℝ × ℝ | 0 ≤ p.1 ∧ p.1 < d * p.2}) /-- The probability `P(-cE' ≤ Z < 0)`. -/ +@[expose] noncomputable def vProbability (ν : Measure ℝ) (c : ℝ) : ℝ := ENNReal.toReal (ν.prod (expMeasure 1) {p : ℝ × ℝ | p.1 < 0 ∧ -c * p.2 ≤ p.1}) diff --git a/LeanPool/Feige/TransferStein.lean b/LeanPool/Feige/TransferStein.lean index ab1cf59dbb..e784291662 100644 --- a/LeanPool/Feige/TransferStein.lean +++ b/LeanPool/Feige/TransferStein.lean @@ -16,7 +16,7 @@ The outer integrability assumptions are stated explicitly, making the result usable independently of how the law of `Y` is presented. -/ -@[expose] public section +public section open MeasureTheory Real Set @@ -27,11 +27,11 @@ namespace TransferStein open TransferTestFunctions /-- Real-valued conditional lower-tail transfer integrand `u`. -/ -noncomputable def uTailIntegrand (d z : ℝ) : ℝ := +@[expose] noncomputable def uTailIntegrand (d z : ℝ) : ℝ := if 0 ≤ z then exp (-z / d) else 0 /-- Real-valued conditional upper-tail transfer integrand `v`. -/ -noncomputable def vTailIntegrand (c z : ℝ) : ℝ := +@[expose] noncomputable def vTailIntegrand (c z : ℝ) : ℝ := if z < 0 then exp (z / c) else 0 /-- The formal derivative of `φ`, multiplied by `d`, is the conditional @@ -84,20 +84,20 @@ theorem c_mul_integral_transferPsiDeriv exact Filter.Eventually.of_forall fun z => c_mul_transferPsiDeriv hc /-- The positive `φ` expectation conditional on `Y = y`. -/ -noncomputable def phiPlus (d a y : ℝ) : ℝ := +@[expose] noncomputable def phiPlus (d a y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, transferPhi d (y + a * e) * exp (-e) /-- The negative `φ` expectation conditional on `Y = y`. -/ -noncomputable def phiMinus (d b y : ℝ) : ℝ := +@[expose] noncomputable def phiMinus (d b y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, transferPhi d (y - b * e) * exp (-e) /-- The positive derivative expectation conditional on `Y = y`. -/ -noncomputable def phiDerivPlus (d a y : ℝ) : ℝ := +@[expose] noncomputable def phiDerivPlus (d a y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, a * transferPhiDeriv d (y + a * e) * exp (-e) /-- The negative derivative expectation conditional on `Y = y`. -/ -noncomputable def phiDerivMinus (d b y : ℝ) : ℝ := +@[expose] noncomputable def phiDerivMinus (d b y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, b * transferPhiDeriv d (y - b * e) * exp (-e) @@ -177,20 +177,20 @@ theorem integral_phi_two_sided_prod simpa [phiPlus, phiMinus, phiDerivPlus, phiDerivMinus] using hiter /-- The positive `ψ` expectation conditional on `Y = y`. -/ -noncomputable def psiPlus (c a y : ℝ) : ℝ := +@[expose] noncomputable def psiPlus (c a y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, transferPsi c (y + a * e) * exp (-e) /-- The negative `ψ` expectation conditional on `Y = y`. -/ -noncomputable def psiMinus (c b y : ℝ) : ℝ := +@[expose] noncomputable def psiMinus (c b y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, transferPsi c (y - b * e) * exp (-e) /-- The positive derivative expectation conditional on `Y = y`. -/ -noncomputable def psiDerivPlus (c a y : ℝ) : ℝ := +@[expose] noncomputable def psiDerivPlus (c a y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, a * transferPsiDeriv c (y + a * e) * exp (-e) /-- The negative derivative expectation conditional on `Y = y`. -/ -noncomputable def psiDerivMinus (c b y : ℝ) : ℝ := +@[expose] noncomputable def psiDerivMinus (c b y : ℝ) : ℝ := ∫ e : ℝ in Ioi 0, b * transferPsiDeriv c (y - b * e) * exp (-e) @@ -268,37 +268,37 @@ theorem integral_psi_two_sided_prod section Equation23 /-- Analytic `A₊ = E φ(Z₊)`. -/ -noncomputable def APlus (μ : Measure ℝ) (d a : ℝ) : ℝ := +@[expose] noncomputable def APlus (μ : Measure ℝ) (d a : ℝ) : ℝ := ∫ y, phiPlus d a y ∂μ /-- Analytic `A₋ = E φ(Z₋)`. -/ -noncomputable def AMinus (μ : Measure ℝ) (d b : ℝ) : ℝ := +@[expose] noncomputable def AMinus (μ : Measure ℝ) (d b : ℝ) : ℝ := ∫ y, phiMinus d b y ∂μ /-- Analytic `B₊ = E ψ(Z₊)`. -/ -noncomputable def BPlus (μ : Measure ℝ) (c a : ℝ) : ℝ := +@[expose] noncomputable def BPlus (μ : Measure ℝ) (c a : ℝ) : ℝ := ∫ y, psiPlus c a y ∂μ /-- Analytic `B₋ = E ψ(Z₋)`. -/ -noncomputable def BMinus (μ : Measure ℝ) (c b : ℝ) : ℝ := +@[expose] noncomputable def BMinus (μ : Measure ℝ) (c b : ℝ) : ℝ := ∫ y, psiMinus c b y ∂μ /-- `u₊`, normalized as `d` times the `φ'` expectation. Since `phiDerivPlus` includes the affine chain-rule factor `a`, it is divided out here. -/ -noncomputable def uPlus (μ : Measure ℝ) (d a : ℝ) : ℝ := +@[expose] noncomputable def uPlus (μ : Measure ℝ) (d a : ℝ) : ℝ := (d / a) * ∫ y, phiDerivPlus d a y ∂μ /-- Analytic `u₋`. -/ -noncomputable def uMinus (μ : Measure ℝ) (d b : ℝ) : ℝ := +@[expose] noncomputable def uMinus (μ : Measure ℝ) (d b : ℝ) : ℝ := (d / b) * ∫ y, phiDerivMinus d b y ∂μ /-- `v₊`, normalized as `c` times the `ψ'` expectation. -/ -noncomputable def vPlus (μ : Measure ℝ) (c a : ℝ) : ℝ := +@[expose] noncomputable def vPlus (μ : Measure ℝ) (c a : ℝ) : ℝ := (c / a) * ∫ y, psiDerivPlus c a y ∂μ /-- Analytic `v₋`. -/ -noncomputable def vMinus (μ : Measure ℝ) (c b : ℝ) : ℝ := +@[expose] noncomputable def vMinus (μ : Measure ℝ) (c b : ℝ) : ℝ := (c / b) * ∫ y, psiDerivMinus c b y ∂μ /-- The lower-test Stein identity for the analytic quantities above. -/ diff --git a/LeanPool/Feige/TransferTestFunctions.lean b/LeanPool/Feige/TransferTestFunctions.lean index 1bf2987fc9..9956846817 100644 --- a/LeanPool/Feige/TransferTestFunctions.lean +++ b/LeanPool/Feige/TransferTestFunctions.lean @@ -19,7 +19,7 @@ equivalent to the corresponding indicator notation and makes global continuity transparent. -/ -@[expose] public section +public section open Real Set Filter Topology MeasureTheory @@ -191,10 +191,12 @@ theorem hasDerivAt_transferPsi_of_ne_zero exact hasDerivAt_transferPsi_of_pos hc hxpos /-- The a.e. derivative used when applying Stein's identity to `φ`. -/ +@[expose] noncomputable def transferPhiDeriv (d x : ℝ) : ℝ := if 0 < x then exp (-x / d) / d else 0 /-- The a.e. derivative used when applying Stein's identity to `ψ`. -/ +@[expose] noncomputable def transferPsiDeriv (c x : ℝ) : ℝ := if x < 0 then exp (x / c) / c else 0 diff --git a/LeanPool/Feige/TranslationTP2.lean b/LeanPool/Feige/TranslationTP2.lean index 70a146446b..f4c6860633 100644 --- a/LeanPool/Feige/TranslationTP2.lean +++ b/LeanPool/Feige/TranslationTP2.lean @@ -17,7 +17,7 @@ preservation of log-concavity under convolution. It is adapted to the existing `LikelihoodRatio.densityConvolution` definition. -/ -@[expose] public section +public section open scoped ENNReal open MeasureTheory diff --git a/LeanPool/Feige/TwoPoint.lean b/LeanPool/Feige/TwoPoint.lean index 8c331a4752..4b9227e01b 100644 --- a/LeanPool/Feige/TwoPoint.lean +++ b/LeanPool/Feige/TwoPoint.lean @@ -20,7 +20,7 @@ directly from the coordinatewise antitonicity of the exponential Dirichlet statistic. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Set @@ -29,14 +29,14 @@ namespace Feige section Parameters /-- Probability of the high value in a mean-one two-point law. -/ -noncomputable def highProbability (γ β : ℝ) : ℝ := +@[expose] noncomputable def highProbability (γ β : ℝ) : ℝ := γ / (γ + β) /-- The low value in the mean-one two-point parametrization. -/ -def lowValue (γ : ℝ) : ℝ := 1 - γ +@[expose] def lowValue (γ : ℝ) : ℝ := 1 - γ /-- The high value in the mean-one two-point parametrization. -/ -def highValue (β : ℝ) : ℝ := 1 + β +@[expose] def highValue (β : ℝ) : ℝ := 1 + β theorem highProbability_nonneg {γ β : ℝ} (hγ : 0 ≤ γ) (hβ : 0 < β) : 0 ≤ highProbability γ β := by @@ -71,13 +71,13 @@ variable {ι : Type*} [Fintype ι] /-- The vector encoded by a high set `S`: coordinates in `S` take their high value, and all remaining coordinates take their low value. -/ -noncomputable def twoPointVector (γ β : ι → ℝ) (S : Set ι) (i : ι) : ℝ := +@[expose] noncomputable def twoPointVector (γ β : ι → ℝ) (S : Set ι) (i : ι) : ℝ := by classical exact if i ∈ S then highValue (β i) else lowValue (γ i) /-- The Dirichlet statistic at the two-point vector encoded by `S`. -/ -noncomputable def twoPointK (γ β : ι → ℝ) (S : Set ι) : ℝ := +@[expose] noncomputable def twoPointK (γ β : ι → ℝ) (S : Set ι) : ℝ := dirichletK (twoPointVector γ β S) /-- At the bottom of the Boolean lattice every coefficient in the internal @@ -126,7 +126,7 @@ section ProductHighSet variable [DecidableEq ι] /-- Product-law mass of a high set. -/ -def highSetMass (p : ι → ℝ) (S : Finset ι) : ℝ := +@[expose] def highSetMass (p : ι → ℝ) (S : Finset ι) : ℝ := (∏ i ∈ S, p i) * ∏ i ∈ Finset.univ \ S, (1 - p i) theorem highSetMass_nonneg {p : ι → ℝ} @@ -145,7 +145,7 @@ theorem sum_highSetMass (p : ι → ℝ) : /-- Finset-indexed version of `Kₘ(S)`, convenient for finite products and maximal-chain constructions. -/ -noncomputable def twoPointKFinset (γ β : ι → ℝ) (S : Finset ι) : ℝ := +@[expose] noncomputable def twoPointKFinset (γ β : ι → ℝ) (S : Finset ι) : ℝ := twoPointK γ β (S : Set ι) omit [DecidableEq ι] in @@ -156,11 +156,12 @@ theorem twoPointKFinset_antitone {γ β : ι → ℝ} exact twoPointK_antitone hγ hβ (by simpa using hAB) /-- Coordinatewise high probabilities in the two-point parametrization. -/ -noncomputable def twoPointHighProbability (γ β : ι → ℝ) (i : ι) : ℝ := +@[expose] noncomputable def twoPointHighProbability (γ β : ι → ℝ) (i : ι) : ℝ := highProbability (γ i) (β i) /-- Rejection probability under the independent two-point product law, written as a finite sum over high sets. -/ +@[expose] noncomputable def twoPointRejectionMass (γ β : ι → ℝ) (α : ℝ) : ℝ := by classical diff --git a/LeanPool/Feige/TwoPointBoundary.lean b/LeanPool/Feige/TwoPointBoundary.lean index 055158305e..4a76c150e7 100644 --- a/LeanPool/Feige/TwoPointBoundary.lean +++ b/LeanPool/Feige/TwoPointBoundary.lean @@ -13,7 +13,7 @@ import LeanPool.Feige.StrictLocalInsertion # Removing strict positivity from the finite two-point bound -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/Feige/TwoPointInduction.lean b/LeanPool/Feige/TwoPointInduction.lean index 0814500a40..0e74d9ba3b 100644 --- a/LeanPool/Feige/TwoPointInduction.lean +++ b/LeanPool/Feige/TwoPointInduction.lean @@ -14,14 +14,14 @@ This file defines the independent product expectation and the rejection payoff used by the ordered insertion proof. -/ -@[expose] public section +public section open scoped BigOperators namespace Feige /-- Expectation under the independent product law on high sets. -/ -noncomputable def productHighSetExpectation {m : ℕ} +@[expose] noncomputable def productHighSetExpectation {m : ℕ} (p : Fin m → ℝ) (g : Finset (Fin m) → ℝ) : ℝ := ∑ S ∈ Finset.univ.powerset, highSetMass p S * g S diff --git a/LeanPool/Feige/TwoPointMixture.lean b/LeanPool/Feige/TwoPointMixture.lean index 3ac14ca479..9ce9eeb591 100644 --- a/LeanPool/Feige/TwoPointMixture.lean +++ b/LeanPool/Feige/TwoPointMixture.lean @@ -15,7 +15,7 @@ Theorem 2.1. It isolates the equality of the lower and upper first moments and constructs the mean-one two-point law `Q_{x,y}`. -/ -@[expose] public section +public section open MeasureTheory Set @@ -24,11 +24,11 @@ namespace Feige noncomputable section /-- The lower absolute first moment around one. -/ -def belowMoment (μ : Measure ℝ) : ℝ := +@[expose] def belowMoment (μ : Measure ℝ) : ℝ := ∫ x, (|x - 1| - (x - 1)) / 2 ∂μ /-- The upper absolute first moment around one. -/ -def aboveMoment (μ : Measure ℝ) : ℝ := +@[expose] def aboveMoment (μ : Measure ℝ) : ℝ := ∫ x, (|x - 1| + (x - 1)) / 2 ∂μ theorem integrable_sub_one {μ : Measure ℝ} @@ -60,11 +60,11 @@ theorem belowMoment_eq_aboveMoment {μ : Measure ℝ} ring /-- Lower weight in the mean-one law supported on `x < 1 < y`. -/ -def twoPointLowerWeight (x y : ℝ) : ℝ := +@[expose] def twoPointLowerWeight (x y : ℝ) : ℝ := (y - 1) / (y - x) /-- Upper weight in the mean-one law supported on `x < 1 < y`. -/ -def twoPointUpperWeight (x y : ℝ) : ℝ := +@[expose] def twoPointUpperWeight (x y : ℝ) : ℝ := (1 - x) / (y - x) theorem twoPointWeights_nonneg {x y : ℝ} (hxy : x < y) @@ -83,7 +83,7 @@ theorem twoPointWeights_add {x y : ℝ} (hxy : x ≠ y) : ring /-- The mean-one two-point law, expressed as a genuine nonnegative measure. -/ -def twoPointMeasure (x y : ℝ) : Measure ℝ := +@[expose] def twoPointMeasure (x y : ℝ) : Measure ℝ := ENNReal.ofReal (twoPointLowerWeight x y) • Measure.dirac x + ENNReal.ofReal (twoPointUpperWeight x y) • Measure.dirac y @@ -152,6 +152,7 @@ two-point mixture formula. The first restricted measure is multiplied by the upper moment (integration in `y`), and the second by the lower moment (integration in `x`). -/ +@[expose] def expandedTwoPointMixture (μ : Measure ℝ) (M : ℝ) : Measure ℝ := μ {1} • Measure.dirac 1 + (ENNReal.ofReal M)⁻¹ • diff --git a/LeanPool/Feige/TwoPointProductLaw.lean b/LeanPool/Feige/TwoPointProductLaw.lean index 8ab24905d3..6e365f7c97 100644 --- a/LeanPool/Feige/TwoPointProductLaw.lean +++ b/LeanPool/Feige/TwoPointProductLaw.lean @@ -13,7 +13,7 @@ import LeanPool.Feige.BoundaryNull # Product laws for two-point random variables -/ -@[expose] public section +public section open scoped BigOperators ENNReal open Set MeasureTheory ProbabilityTheory diff --git a/LeanPool/Feige/TwoPointReindex.lean b/LeanPool/Feige/TwoPointReindex.lean index 10e44809f3..f4d1e825ef 100644 --- a/LeanPool/Feige/TwoPointReindex.lean +++ b/LeanPool/Feige/TwoPointReindex.lean @@ -12,7 +12,7 @@ public import Mathlib.Data.Fin.Tuple.Sort # Reindexing and sorting finite two-point systems -/ -@[expose] public section +public section open MeasureTheory Set open scoped BigOperators diff --git a/LeanPool/Feige/VlassisThomas/Main.lean b/LeanPool/Feige/VlassisThomas/Main.lean index a88c23f5b0..92f953c954 100644 --- a/LeanPool/Feige/VlassisThomas/Main.lean +++ b/LeanPool/Feige/VlassisThomas/Main.lean @@ -21,7 +21,7 @@ measurable two-point mixing, and normalization to coordinatewise means at most one. -/ -@[expose] public section +public section namespace VlassisThomas diff --git a/LeanPool/FelConjecture.lean b/LeanPool/FelConjecture.lean index ce5957f5f4..8b3f818f9b 100644 --- a/LeanPool/FelConjecture.lean +++ b/LeanPool/FelConjecture.lean @@ -18,7 +18,7 @@ Tags: number-theory, combinatorics, polynomials MSC: 20M14, 13D02 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/FelConjecture/Solution.lean b/LeanPool/FelConjecture/Solution.lean index de79238aec..49f8273500 100644 --- a/LeanPool/FelConjecture/Solution.lean +++ b/LeanPool/FelConjecture/Solution.lean @@ -8,7 +8,7 @@ module public import Mathlib.NumberTheory.Bernoulli /-! # Fel's Conjecture for Numerical Semigroups -/ -@[expose] public section +public section /-- A *numerical semigroup*: an additive submonoid of `ℕ` with finite complement. -/ structure NumericalSemigroup where /-- The underlying set of natural numbers comprising the semigroup. -/ diff --git a/LeanPool/Fineqs.lean b/LeanPool/Fineqs.lean index fb525aeb38..8f946714a5 100644 --- a/LeanPool/Fineqs.lean +++ b/LeanPool/Fineqs.lean @@ -23,7 +23,7 @@ Tags: number-theory, finite-fields, algebraic-geometry MSC: 14G15, 11T06 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Fineqs/Main.lean b/LeanPool/Fineqs/Main.lean index 8b405707a9..031087493b 100644 --- a/LeanPool/Fineqs/Main.lean +++ b/LeanPool/Fineqs/Main.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Positivity.Finset Vendored from `nasqret/fineqs`. See `LeanPool/Fineqs.lean` for the project overview. -/ -@[expose] public section +public section namespace LeanPool.Fineqs diff --git a/LeanPool/FiniteGraphFundamentalGroup.lean b/LeanPool/FiniteGraphFundamentalGroup.lean index 4001d213db..a0f91fc6b1 100644 --- a/LeanPool/FiniteGraphFundamentalGroup.lean +++ b/LeanPool/FiniteGraphFundamentalGroup.lean @@ -22,4 +22,4 @@ Tags: algebraic-topology, graph-theory, fundamental-groups, free-groups, coverin MSC: 05C25, 55Q05, 20F65 -/ -@[expose] public section +public section diff --git a/LeanPool/FiniteGraphFundamentalGroup/Consequences.lean b/LeanPool/FiniteGraphFundamentalGroup/Consequences.lean index e49e86d938..dbdc956faa 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/Consequences.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/Consequences.lean @@ -15,7 +15,7 @@ import Mathlib.GroupTheory.FreeGroup.Reduce This module exposes the free basis, rank identities, basepoint independence, and abelianization. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.SingleObj Quiver FreeGroup diff --git a/LeanPool/FiniteGraphFundamentalGroup/Cover.lean b/LeanPool/FiniteGraphFundamentalGroup/Cover.lean index 5fcb9f83aa..d06b2df943 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/Cover.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/Cover.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.SetLike This module constructs the standard combinatorial unfolding of a rooted quiver. -/ -@[expose] public section +public section open CategoryTheory Quiver @@ -51,7 +51,7 @@ instance graphCoverQuiver {V : Type u} [Quiver.{u} V] (root : V) : x.2 ≫ (Quiver.FreeGroupoid.of V).map e = y.2} /-- The projection from the path-lifting cover to the original quiver. -/ -def graphCoverProjection {V : Type u} [Quiver.{u} V] (root : V) : +@[expose] def graphCoverProjection {V : Type u} [Quiver.{u} V] (root : V) : graphCoverVertex root ⥤q V where obj x := x.1 map e := e.1 @@ -73,7 +73,7 @@ lemma graphCoverCostar_ext {V : Type u} [Quiver.{u} V] {root : V} exact heq_of_eq (Subtype.ext (eq_of_heq h)) /-- Explicit lifting of a star at a cover vertex. -/ -def graphCoverStarEquiv {V : Type u} [Quiver.{u} V] (root : V) +@[expose] def graphCoverStarEquiv {V : Type u} [Quiver.{u} V] (root : V) (x : graphCoverVertex root) : Quiver.Star x ≃ Quiver.Star x.1 where toFun := (graphCoverProjection root).star x @@ -98,7 +98,7 @@ def graphCoverStarEquiv {V : Type u} [Quiver.{u} V] (root : V) rfl /-- Explicit lifting of a costar at a cover vertex. -/ -def graphCoverCostarEquiv {V : Type u} [Quiver.{u} V] (root : V) +@[expose] def graphCoverCostarEquiv {V : Type u} [Quiver.{u} V] (root : V) (x : graphCoverVertex root) : Quiver.Costar x ≃ Quiver.Costar x.1 where toFun := (graphCoverProjection root).costar x diff --git a/LeanPool/FiniteGraphFundamentalGroup/Proof.lean b/LeanPool/FiniteGraphFundamentalGroup/Proof.lean index 530b368744..febd44ae17 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/Proof.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/Proof.lean @@ -16,7 +16,7 @@ Mathlib's free groupoid and identifies a basis indexed by the edges outside a ge tree. -/ -@[expose] public section +public section attribute [local implicit_reducible] Quiver.Symmetrify IsFreeGroupoid.Generators @@ -450,10 +450,10 @@ noncomputable instance freeGroupoidGeneratorHomFintype {V : Type u} exact FiniteQuiver.finiteHom (V := V) a.as b.as /-- The number of vertices in a finite graph. -/ -def vertexCount {V : Type u} [Fintype V] : ℕ := Fintype.card V +@[expose] def vertexCount {V : Type u} [Fintype V] : ℕ := Fintype.card V /-- The total number of directed edges in a finite quiver. -/ -def edgeCount {V : Type u} [Quiver.{u} V] [Fintype V] [FiniteQuiver V] : ℕ := +@[expose] def edgeCount {V : Type u} [Quiver.{u} V] [Fintype V] [FiniteQuiver V] : ℕ := Fintype.card (Quiver.Total V) /-- The graph cycle rank, written to account for truncated subtraction in `ℕ`. @@ -496,7 +496,7 @@ def generatorTotalEquiv {V : Type u} [Quiver.{u} V] : right_inv e := by cases e; rfl /-- The complement of the geodesic tree, indexed by the actual non-tree generator arrows. -/ -noncomputable def graphGeneratorSet {V : Type u} [Quiver.{u} V] +@[expose] noncomputable def graphGeneratorSet {V : Type u} [Quiver.{u} V] [WeaklyConnected V] (root : V) : Set (Quiver.Total (IsFreeGroupoid.Generators (Quiver.FreeGroupoid V))) := (wideSubquiverEquivSetTotal diff --git a/LeanPool/FiniteGraphFundamentalGroup/Realization.lean b/LeanPool/FiniteGraphFundamentalGroup/Realization.lean index be40d26520..c52e90fa59 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/Realization.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/Realization.lean @@ -16,7 +16,7 @@ import Mathlib.Topology.WithTopology This module realizes vertices discretely and every directed edge as a separate interval cell. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.SingleObj Quiver @@ -86,7 +86,7 @@ instance graphRealizationSetoid {V : Type u} [Quiver.{u} V] : to a vertex away from its two prescribed endpoints. -/ /-- Labels the two endpoints of an edge interval and leaves interior points unlabeled. -/ -def graphRealizationEndpointLabel {V : Type u} [Quiver.{u} V] +@[expose] def graphRealizationEndpointLabel {V : Type u} [Quiver.{u} V] : graphRealizationPre V → Option V | Sum.inl v => some (graphVertexUnderlying v) | Sum.inr ⟨e, t⟩ => @@ -121,7 +121,7 @@ abbrev graphRealizationQuotient {V : Type u} [Quiver.{u} V] : Quotient.mk' /-- The point of the realization corresponding to a vertex. -/ -def graphVertex {V : Type u} [Quiver.{u} V] (v : V) : graphRealization V := +@[expose] def graphVertex {V : Type u} [Quiver.{u} V] (v : V) : graphRealization V := graphRealizationQuotient (Sum.inl (graphDiscreteVertex v)) /-- The endpoint label descends to the quotient as a set-theoretic invariant. -/ @@ -134,7 +134,7 @@ def graphRealizationEndpointLabelQuotient {V : Type u} [Quiver.{u} V] : theorem graphRealizationEndpointLabelQuotient_mk {V : Type u} [Quiver.{u} V] (x : graphRealizationPre V) : graphRealizationEndpointLabelQuotient (graphRealizationQuotient x) = - graphRealizationEndpointLabel x := rfl + graphRealizationEndpointLabel x := by rfl @[simp] theorem graphRealizationEndpointLabelQuotient_vertex {V : Type u} [Quiver.{u} V] @@ -172,7 +172,7 @@ theorem graphRealization_image_isOpen_of_saturated exact hopen /-- The characteristic path of the interval cell associated to an edge. -/ -def graphEdgePath {V : Type u} [Quiver.{u} V] (e : Quiver.Total V) : +@[expose] def graphEdgePath {V : Type u} [Quiver.{u} V] (e : Quiver.Total V) : C(I, graphRealization V) where toFun t := graphRealizationQuotient (Sum.inr ⟨graphDiscreteEdge e, t⟩) continuous_toFun := @@ -182,7 +182,7 @@ def graphEdgePath {V : Type u} [Quiver.{u} V] (e : Quiver.Total V) : @[simp] theorem graphRealizationQuotient_vertex {V : Type u} [Quiver.{u} V] (v : V) : - graphRealizationQuotient (Sum.inl (graphDiscreteVertex v)) = graphVertex v := rfl + graphRealizationQuotient (Sum.inl (graphDiscreteVertex v)) = graphVertex v := by rfl @[simp] theorem graphEdgePath_zero {V : Type u} [Quiver.{u} V] (e : Quiver.Total V) : @@ -207,7 +207,7 @@ theorem continuous_graphEdgePath {V : Type u} [Quiver.{u} V] (e : Quiver.Total V (graphEdgePath e).continuous /-- The interval cell, regarded as a path from the source to the target. -/ -def graphRealizationForwardPath {V : Type u} [Quiver.{u} V] +@[expose] def graphRealizationForwardPath {V : Type u} [Quiver.{u} V] {a b : V} (e : a ⟶ b) : Path (graphVertex a) (graphVertex b) where toContinuousMap := graphEdgePath ⟨a, b, e⟩ @@ -261,7 +261,7 @@ theorem graphRealizationPre_join_vertex {V : Type u} [Quiver.{u} V] reverse. -/ /-- The realization path of a symmetric edge, reversing the interval when necessary. -/ -def graphRealizationSymmetricEdgePath {V : Type u} [Quiver.{u} V] +@[expose] def graphRealizationSymmetricEdgePath {V : Type u} [Quiver.{u} V] {a b : V} (e : (Quiver.symmetrifyQuiver V).Hom a b) : Path (graphVertex (V := V) a) (graphVertex (V := V) b) := match e with @@ -269,7 +269,7 @@ def graphRealizationSymmetricEdgePath {V : Type u} [Quiver.{u} V] | Sum.inr e => (graphRealizationForwardPath e).symm /-- Concatenates realized edge paths along a quiver path. -/ -def graphRealizationQuiverPath {V : Type u} [Quiver.{u} V] +@[expose] def graphRealizationQuiverPath {V : Type u} [Quiver.{u} V] {a b : V} (p : @Quiver.Path (Quiver.Symmetrify V) (Quiver.symmetrifyQuiver V) a b) : @@ -282,7 +282,7 @@ theorem graphRealizationQuiverPath_nil {V : Type u} [Quiver.{u} V] (a : V) : graphRealizationQuiverPath (Quiver.Path.nil : @Quiver.Path (Quiver.Symmetrify V) - (Quiver.symmetrifyQuiver V) a a) = Path.refl (graphVertex a) := rfl + (Quiver.symmetrifyQuiver V) a a) = Path.refl (graphVertex a) := by rfl theorem graphRealization_pathConnected {V : Type u} [Quiver.{u} V] [WeaklyConnected V] (root : V) : @@ -306,7 +306,7 @@ theorem graphRealization_compact {V : Type u} [Quiver.{u} V] infer_instance /-- The prefunctor sending graph vertices and edges to their realization paths. -/ -def graphRealizationQuiverMap {V : Type u} [Quiver.{u} V] : +@[expose] def graphRealizationQuiverMap {V : Type u} [Quiver.{u} V] : V ⥤q FundamentalGroupoid (graphRealization V) where obj v := FundamentalGroupoid.mk (graphVertex v) map e := FundamentalGroupoid.fromPath @@ -317,7 +317,7 @@ def graphRealizationQuiverMap {V : Type u} [Quiver.{u} V] : fundamental groupoid of the realization. -/ /-- The functor from the free graph groupoid to the realization's fundamental groupoid. -/ -def graphFreeGroupoidToTopological {V : Type u} [Quiver.{u} V] : +@[expose] def graphFreeGroupoidToTopological {V : Type u} [Quiver.{u} V] : Quiver.FreeGroupoid V ⥤ FundamentalGroupoid (graphRealization V) := Quiver.FreeGroupoid.lift (graphRealizationQuiverMap (V := V)) @@ -331,7 +331,7 @@ theorem graphFreeGroupoidToTopological_restrict {V : Type u} [Quiver.{u} V] : below for the realization of the path-lifting cover. -/ /-- The map on vertex and edge-interval representatives induced by a quiver prefunctor. -/ -def graphRealizationPreMap {V W : Type u} [Quiver.{u} V] [Quiver.{u} W] +@[expose] def graphRealizationPreMap {V W : Type u} [Quiver.{u} V] [Quiver.{u} W] (F : V ⥤q W) : graphRealizationPre V → graphRealizationPre W := Sum.elim (fun v => Sum.inl (graphDiscreteVertex (F.obj (graphVertexUnderlying v)))) @@ -364,7 +364,7 @@ theorem graphRealizationPreMap_eqvGen {V W : Type u} [Quiver.{u} V] | trans x y z hxy hyz ihxy ihyz => exact Relation.EqvGen.trans _ _ _ ihxy ihyz /-- The continuous map of graph realizations induced by a quiver prefunctor. -/ -def graphRealizationMap {V W : Type u} [Quiver.{u} V] [Quiver.{u} W] +@[expose] def graphRealizationMap {V W : Type u} [Quiver.{u} V] [Quiver.{u} W] (F : V ⥤q W) : graphRealization V → graphRealization W := by let f : graphRealizationPre V → graphRealization W := fun x => graphRealizationQuotient (graphRealizationPreMap F x) @@ -424,7 +424,7 @@ theorem graphRealizationMap_forwardPath {V W : Type u} [Quiver.{u} V] in a finite one-dimensional cell complex. -/ /-- The homomorphism from combinatorial loops to loops in the topological realization. -/ -def graphCombinatorialToTopological {V : Type u} [Quiver.{u} V] +@[expose] def graphCombinatorialToTopological {V : Type u} [Quiver.{u} V] (root : V) : graphFundamentalGroup root →* FundamentalGroup (graphRealization V) (graphVertex root) := diff --git a/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean b/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean index e4e8b64721..533d67f52d 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean @@ -19,7 +19,7 @@ import Mathlib.Topology.WithTopology This module identifies the free-groupoid computation with the fundamental group of the realization. -/ -@[expose] public section +public section attribute [local implicit_reducible] Quiver.Symmetrify Quiver.FreeGroupoid Quiver.FreeGroupoid.of IsFreeGroupoid.Generators @@ -528,7 +528,7 @@ noncomputable instance graphCoverSymmetricRootedConnected graphCoverSymmetric_rootedConnected root /-- The canonical geodesic spanning tree of the symmetrified graph cover. -/ -noncomputable def graphCoverSymmetricTree {V : Type u} [Quiver.{u} V] +@[expose] noncomputable def graphCoverSymmetricTree {V : Type u} [Quiver.{u} V] (root : V) : WideSubquiver (Symmetrify (graphCoverVertex root)) := geodesicSubtree (graphCoverRootVertex root) @@ -648,7 +648,7 @@ theorem graphCoverSymmetric_edge_or_reverse_mem_tree {V : Type u} [Quiver.{u} V] exact hfmem /-- The representative-level realization map induced by a signed edge map. -/ -def graphRealizationSignedPreMap {U W : Type u} [Quiver.{u} U] [Quiver.{u} W] +@[expose] def graphRealizationSignedPreMap {U W : Type u} [Quiver.{u} U] [Quiver.{u} W] (f : U → W) (g : Quiver.Total U → Quiver.Total W) (r : Quiver.Total U → C(I, I)) : graphRealizationPre U → graphRealizationPre W := @@ -678,7 +678,7 @@ theorem graphRealizationSignedPreMap_continuous (r (graphEdgeUnderlying e)).continuous /-- The continuous realization map induced by a signed edge map. -/ -def graphRealizationSignedMap {U W : Type u} [Quiver.{u} U] [Quiver.{u} W] +@[expose] def graphRealizationSignedMap {U W : Type u} [Quiver.{u} U] [Quiver.{u} W] (f : U → W) (g : Quiver.Total U → Quiver.Total W) (r : Quiver.Total U → C(I, I)) (h0 : ∀ e : Quiver.Total U, @@ -737,7 +737,7 @@ theorem graphRealizationSignedMap_vertex (Sum.inr ⟨graphDiscreteEdge (g e), r e 1⟩) = graphVertex (f e.right)) (v : U) : - graphRealizationSignedMap f g r h0 h1 (graphVertex v) = graphVertex (f v) := rfl + graphRealizationSignedMap f g r h0 h1 (graphVertex v) = graphVertex (f v) := by rfl @[simp] theorem graphRealizationSignedMap_edgePath @@ -754,7 +754,7 @@ theorem graphRealizationSignedMap_edgePath graphVertex (f e.right)) (e : Quiver.Total U) (t : I) : graphRealizationSignedMap f g r h0 h1 (graphEdgePath e t) = - graphEdgePath (g e) (r e t) := rfl + graphEdgePath (g e) (r e t) := by rfl /-- The underlying cover edge represented by an edge of the symmetric cover tree. -/ def graphCoverTreeEdgeBase {V : Type u} [Quiver.{u} V] @@ -817,7 +817,7 @@ def graphCoverTreeVertexForget {V : Type u} [Quiver.{u} V] exact v /-- The continuous orientation-reversing involution of the unit interval. -/ -def graphRealizationIntervalSymm : C(I, I) where +@[expose] def graphRealizationIntervalSymm : C(I, I) where toFun := σ continuous_toFun := by fun_prop @@ -907,7 +907,7 @@ theorem graphCoverTreeFold_h1 {V : Type u} [Quiver.{u} V] rfl /-- The realization map folding the symmetric cover tree onto the canonical cover. -/ -noncomputable def graphCoverTreeToCover {V : Type u} [Quiver.{u} V] +@[expose] noncomputable def graphCoverTreeToCover {V : Type u} [Quiver.{u} V] (root : V) : graphRealization (graphCoverSymmetricTree root) → graphRealization (graphCoverVertex root) := @@ -927,7 +927,7 @@ theorem continuous_graphCoverTreeToCover {V : Type u} [Quiver.{u} V] theorem graphCoverTreeToCover_vertex {V : Type u} [Quiver.{u} V] (root : V) (v : graphCoverSymmetricTree root) : graphCoverTreeToCover root (graphVertex v) = - graphVertex (graphCoverTreeVertexForget root v) := rfl + graphVertex (graphCoverTreeVertexForget root v) := by rfl @[simp] theorem graphCoverTreeToCover_edgePath {V : Type u} [Quiver.{u} V] @@ -935,7 +935,7 @@ theorem graphCoverTreeToCover_edgePath {V : Type u} [Quiver.{u} V] (e : Quiver.Total (graphCoverSymmetricTree root)) (t : I) : graphCoverTreeToCover root (graphEdgePath e t) = graphEdgePath (graphCoverTreeEdgeBase root e) - (graphCoverTreeFoldCoordinate root e t) := rfl + (graphCoverTreeFoldCoordinate root e t) := by rfl /-- Embeds a canonical-cover vertex into the symmetric cover tree. -/ def graphCoverVertexEmbed {V : Type u} [Quiver.{u} V] @@ -1055,7 +1055,7 @@ theorem graphCoverSection_h1 {V : Type u} [Quiver.{u} V] rfl /-- A continuous section from the canonical cover realization to its symmetric tree model. -/ -noncomputable def graphCoverToTree {V : Type u} [Quiver.{u} V] +@[expose] noncomputable def graphCoverToTree {V : Type u} [Quiver.{u} V] (root : V) : graphRealization (graphCoverVertex root) → graphRealization (graphCoverSymmetricTree root) := @@ -1075,7 +1075,7 @@ theorem continuous_graphCoverToTree {V : Type u} [Quiver.{u} V] theorem graphCoverToTree_vertex {V : Type u} [Quiver.{u} V] (root : V) (v : graphCoverVertex root) : graphCoverToTree root (graphVertex v) = - graphVertex (graphCoverVertexEmbed root v) := rfl + graphVertex (graphCoverVertexEmbed root v) := by rfl @[simp] theorem graphCoverToTree_edgePath {V : Type u} [Quiver.{u} V] @@ -1083,7 +1083,7 @@ theorem graphCoverToTree_edgePath {V : Type u} [Quiver.{u} V] (t : I) : graphCoverToTree root (graphEdgePath e t) = graphEdgePath (graphCoverTreeEdgeChoice root e) - (graphCoverSectionCoordinate root e t) := rfl + (graphCoverSectionCoordinate root e t) := by rfl theorem graphRealization_map_ext {U W : Type u} [Quiver.{u} U] [Quiver.{u} W] (F G : graphRealization U → graphRealization W) diff --git a/LeanPool/FiniteGraphFundamentalGroup/TopologicalCover.lean b/LeanPool/FiniteGraphFundamentalGroup/TopologicalCover.lean index de3d5e1040..5739b47317 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/TopologicalCover.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/TopologicalCover.lean @@ -16,7 +16,7 @@ import Mathlib.Topology.WithTopology This module verifies the local topology needed to realize the combinatorial path-lifting cover. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.SingleObj Quiver @@ -39,12 +39,13 @@ the endpoint quotient is handled by a small saturation lemma. -/ /-- The midpoint of the unit interval used to separate the two incident-edge stars. -/ -def graphHalf : I := +@[expose] def graphHalf : I := ⟨(1 : ℝ) / 2, by constructor <;> norm_num⟩ @[simp] theorem graphHalf_coe : (graphHalf : ℝ) = (1 : ℝ) / 2 := rfl + @[simp] theorem graphHalf_pos : (0 : I) < graphHalf := by change (0 : ℝ) < (1 : ℝ) / 2 @@ -282,7 +283,7 @@ abbrev graphCoverRealization {V : Type u} [Quiver.{u} V] (root : V) := graphRealization (graphCoverVertex root) /-- The realization map induced by the canonical graph-cover projection. -/ -def graphCoverRealizationProjection {V : Type u} [Quiver.{u} V] (root : V) : +@[expose] def graphCoverRealizationProjection {V : Type u} [Quiver.{u} V] (root : V) : graphCoverRealization root → graphRealization V := graphRealizationMap (graphCoverProjection root) @@ -298,7 +299,7 @@ theorem graphRealizationMap_quotient {V W : Type u} [Quiver.{u} V] graphRealizationQuotient (graphRealizationPreMap F x) := rfl /-- The cover vertex represented by the identity path at the root. -/ -def graphCoverRootVertex {V : Type u} [Quiver.{u} V] (root : V) : +@[expose] def graphCoverRootVertex {V : Type u} [Quiver.{u} V] (root : V) : graphCoverVertex root := ⟨root, 𝟙 _⟩ @@ -307,7 +308,7 @@ theorem graphCoverRootVertex_projection {V : Type u} [Quiver.{u} V] (root : V) : (graphCoverRootVertex root).1 = root := rfl /-- The discrete fiber of cover vertices over a base vertex. -/ -def graphCoverVertexOver {V : Type u} [Quiver.{u} V] (root v : V) := +@[expose] def graphCoverVertexOver {V : Type u} [Quiver.{u} V] (root v : V) := {x : graphCoverVertex root // x.1 = v} instance graphCoverVertexOverTopology {V : Type u} [Quiver.{u} V] @@ -318,7 +319,7 @@ instance graphCoverVertexOver_discrete {V : Type u} [Quiver.{u} V] exact discreteTopology_bot _ /-- The symmetric-edge prefunctor from the canonical cover into the base free groupoid. -/ -def graphCoverSymmetricFreeGroupoidMap {V : Type u} [Quiver.{u} V] +@[expose] def graphCoverSymmetricFreeGroupoidMap {V : Type u} [Quiver.{u} V] (root : V) : (Quiver.Symmetrify (graphCoverVertex root)) ⥤q Quiver.FreeGroupoid V := @@ -1095,7 +1096,7 @@ def graphCoverEdgeProjection {V : Type u} [Quiver.{u} V] (root : V) ⟨d.left.1, d.right.1, d.hom.1⟩ /-- The discrete fiber of cover edges over a base edge. -/ -def graphCoverEdgeOver {V : Type u} [Quiver.{u} V] (root : V) +@[expose] def graphCoverEdgeOver {V : Type u} [Quiver.{u} V] (root : V) (e : Quiver.Total V) := {d : Quiver.Total (graphCoverVertex root) // graphCoverEdgeProjection root d = e} diff --git a/LeanPool/FiniteGraphFundamentalGroup/TreeContraction.lean b/LeanPool/FiniteGraphFundamentalGroup/TreeContraction.lean index 57a22598d4..f3af90d171 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/TreeContraction.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/TreeContraction.lean @@ -14,7 +14,7 @@ public import LeanPool.FiniteGraphFundamentalGroup.Realization This module constructs cellwise contraction data from the unique paths in an arborescence. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.SingleObj Quiver diff --git a/LeanPool/FiveEighthsTheorem.lean b/LeanPool/FiveEighthsTheorem.lean index b89838fcb2..88e187c37e 100644 --- a/LeanPool/FiveEighthsTheorem.lean +++ b/LeanPool/FiveEighthsTheorem.lean @@ -18,4 +18,4 @@ Tags: group-theory, finite-groups, commuting-probability MSC: 20P05 -/ -@[expose] public section +public section diff --git a/LeanPool/FiveEighthsTheorem/Basic.lean b/LeanPool/FiveEighthsTheorem/Basic.lean index d3212a35c8..74be38386c 100644 --- a/LeanPool/FiveEighthsTheorem/Basic.lean +++ b/LeanPool/FiveEighthsTheorem/Basic.lean @@ -39,7 +39,7 @@ The proof is the classical counting argument: All declarations live in the `FiveEighths` namespace. -/ -@[expose] public section +public section namespace FiveEighths diff --git a/LeanPool/Flean.lean b/LeanPool/Flean.lean index e15a65ec83..c1edf6dd2d 100644 --- a/LeanPool/Flean.lean +++ b/LeanPool/Flean.lean @@ -20,7 +20,7 @@ Tags: floating-point, numerical-analysis, ieee-754, rounding MSC: 65G50, 65G30, 68V20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Flean/Basic.lean b/LeanPool/Flean/Basic.lean index 957b10c99e..b0d852d123 100644 --- a/LeanPool/Flean/Basic.lean +++ b/LeanPool/Flean/Basic.lean @@ -26,7 +26,7 @@ and `toRat` between rationals and floats, and the round-trip and rounding-error correctness results such as `to_float_to_rat`. -/ -@[expose] public section +public section variable {C : FloatCfg} diff --git a/LeanPool/Flean/FloatCfg.lean b/LeanPool/Flean/FloatCfg.lean index 242aa0d3a8..c30d308ccb 100644 --- a/LeanPool/Flean/FloatCfg.lean +++ b/LeanPool/Flean/FloatCfg.lean @@ -18,7 +18,7 @@ describe a floating-point format, along with the available `RoundingMode`s and a `Rounding` typeclass selecting the mode in scope. -/ -@[expose] public section +public section /-- A floating-point format: a precision `prec` and an exponent range `[emin, emax]`. -/ diff --git a/LeanPool/Flean/FloatRep.lean b/LeanPool/Flean/FloatRep.lean index ecafaff082..4a0c50ef62 100644 --- a/LeanPool/Flean/FloatRep.lean +++ b/LeanPool/Flean/FloatRep.lean @@ -22,7 +22,7 @@ interpretation `coeQ`, negation, validity predicates, and an ordering `floatrepLe` proved equivalent to the order on the underlying rationals. -/ -@[expose] public section +public section /-- A sign/exponent/mantissa representation of a (normal) floating-point number in the format `α`. -/ @@ -46,10 +46,10 @@ def FloatRep.decEq (f1 f2 : FloatRep C) : Decidable (Eq f1 f2) := by exact instDecidableAnd /-- A representation has a valid mantissa when it is below the precision. -/ -def FloatRep.validM (f : FloatRep C) : Prop := f.m < C.prec +@[expose] def FloatRep.validM (f : FloatRep C) : Prop := f.m < C.prec /-- The rational value represented by a `FloatRep`. -/ -def coeQ : FloatRep C → ℚ +@[expose] def coeQ : FloatRep C → ℚ | ⟨b, e, m⟩ => let s := if b then -1 else 1 s * (m / C.prec + 1) * 2^e @@ -64,7 +64,7 @@ lemma coe_q_false_pos {e : ℤ} {m : ℕ} : _ < m/C.prec + 1 := lt_add_one _ /-- Negate a representation by flipping its sign bit. -/ -def FloatRep.neg {C : FloatCfg} : FloatRep C → FloatRep C +@[expose] def FloatRep.neg {C : FloatCfg} : FloatRep C → FloatRep C | ⟨s, e, m⟩ => ⟨!s, e, m⟩ lemma Flean.neg_neg : (@FloatRep.neg C) ∘ (@FloatRep.neg C) = id := by @@ -133,7 +133,7 @@ lemma coe_q_of_Cprec (b : Bool) (e : ℤ) : exact Nat.cast_ne_zero.mpr (by linarith [C.prec_pos]) /-- A representation has a valid exponent when it lies in `[emin, emax]`. -/ -def FloatRep.validE (f : FloatRep C) : Prop := C.emin ≤ f.e ∧ f.e ≤ C.emax +@[expose] def FloatRep.validE (f : FloatRep C) : Prop := C.emin ≤ f.e ∧ f.e ≤ C.emax lemma neg_valid_e {f : FloatRep C} : (FloatRep.neg f).validE ↔ (f.validE) := by @@ -211,10 +211,10 @@ lemma normal_range' (m : ℕ) (e : ℤ) (vm : m < C.prec) (ve2 : e ≤ C.emax) : simp_all /-- The largest finite rational representable in the format `C`. -/ -def maxFloatQ (C : FloatCfg) : ℚ := (2 - (1 : ℚ) / C.prec) * 2^C.emax +@[expose] def maxFloatQ (C : FloatCfg) : ℚ := (2 - (1 : ℚ) / C.prec) * 2^C.emax /-- The representation of the largest finite float of the format `C`. -/ -def maxFloatRep (C : FloatCfg) : FloatRep C := ⟨false, C.emax, C.prec - 1⟩ +@[expose] def maxFloatRep (C : FloatCfg) : FloatRep C := ⟨false, C.emax, C.prec - 1⟩ lemma coe_q_max_float_rep : coeQ (maxFloatRep C) = maxFloatQ C := by simp only [coeQ, maxFloatRep, Bool.false_eq_true, ↓reduceIte, one_mul, maxFloatQ, one_div, @@ -228,11 +228,11 @@ lemma coe_q_max_float_rep : coeQ (maxFloatRep C) = maxFloatQ C := by /-- Ordering on positive representations: larger exponent, or equal exponent and larger-or-equal mantissa. -/ -def floatrepLePos (f1 f2 : FloatRep C) : Prop := +@[expose] def floatrepLePos (f1 f2 : FloatRep C) : Prop := (f1.e < f2.e) ∨ (f1.e = f2.e ∧ f1.m ≤ f2.m) /-- An equivalent formulation of `floatrepLePos` as a conjunction. -/ -def floatrepLePos' (f1 f2 : FloatRep C) : Prop := +@[expose] def floatrepLePos' (f1 f2 : FloatRep C) : Prop := (f1.e ≤ f2.e) ∧ (f1.e = f2.e → f1.m ≤ f2.m) lemma floatrep_pos_equiv (f1 f2 : FloatRep C) : @@ -321,7 +321,7 @@ lemma floatrep_le_pos_iff_coe_q (f1 f2 : FloatRep C) (vm1 : f1.m ≤ C.prec) (vm /-- The full ordering on representations, accounting for signs. -/ -def floatrepLe (f1 f2 : FloatRep C) : Prop := +@[expose] def floatrepLe (f1 f2 : FloatRep C) : Prop := match (f1.s, f2.s) with | (false, false) => floatrepLePos f1 f2 | (false, true) => False diff --git a/LeanPool/Flean/IntRounding.lean b/LeanPool/Flean/IntRounding.lean index aa2262f572..233334653e 100644 --- a/LeanPool/Flean/IntRounding.lean +++ b/LeanPool/Flean/IntRounding.lean @@ -18,13 +18,13 @@ mantissa, together with their basic correctness properties such as round-to-even behaviour on half-integers. -/ -@[expose] public section +public section /-- An integer-valued rounding rule taking a sign bit and a rational mantissa. -/ abbrev IntRounder := Bool → ℚ → ℕ /-- Round toward zero: the rounded mantissa is `⌊q⌋`, ignoring the sign. -/ -def round0 (s : Bool) (q : ℚ) := if s then ⌊q⌋.natAbs else ⌊q⌋.natAbs +@[expose] def round0 (s : Bool) (q : ℚ) := if s then ⌊q⌋.natAbs else ⌊q⌋.natAbs /-- `round0` ignores its sign argument. -/ @[simp] lemma round0_apply (s : Bool) (q : ℚ) : round0 s q = ⌊q⌋.natAbs := by @@ -38,13 +38,13 @@ def roundinf (s : Bool) (q : ℚ) := if s then ⌈q⌉.natAbs else ⌈q⌉.natAb simp only [roundinf, ite_self] /-- Round down (toward negative infinity), branching on the sign. -/ -def roundup := fun (s : Bool) q => if s then round0 s q else roundinf s q +@[expose] def roundup := fun (s : Bool) q => if s then round0 s q else roundinf s q /-- Round up (toward positive infinity), branching on the sign. -/ -def rounddown := fun (s : Bool) (q : ℚ) => if s then roundinf s q else round0 s q +@[expose] def rounddown := fun (s : Bool) (q : ℚ) => if s then roundinf s q else round0 s q /-- Round to the nearest integer, with ties broken to the even integer. -/ -def roundNearInt (q : ℚ) := +@[expose] def roundNearInt (q : ℚ) := let i1 := ⌊q⌋ let i2 := ⌈q⌉ if Int.fract q < 1/2 then @@ -395,7 +395,7 @@ instance : ValidRounder roundnearest where /-- The rounder obtained by flipping the sign bit, used to relate rounding of `q` and `-q`. -/ -def IntRounder.neg (r : IntRounder) : IntRounder := fun s ↦ r !s +@[expose] def IntRounder.neg (r : IntRounder) : IntRounder := fun s ↦ r !s lemma neg_neg_r (r : IntRounder) : r.neg.neg = r := by diff --git a/LeanPool/Flean/LogRules.lean b/LeanPool/Flean/LogRules.lean index 336b3d011e..a8e2fe023d 100644 --- a/LeanPool/Flean/LogRules.lean +++ b/LeanPool/Flean/LogRules.lean @@ -16,7 +16,7 @@ This module proves facts in ℚ about the sizes and properties of values like x * b^e where x is in [1, b) and e is an integer. -/ -@[expose] public section +public section variable {C : FloatCfg} diff --git a/LeanPool/Flean/Rounding.lean b/LeanPool/Flean/Rounding.lean index 80d2ead691..a4730a5597 100644 --- a/LeanPool/Flean/Rounding.lean +++ b/LeanPool/Flean/Rounding.lean @@ -21,7 +21,7 @@ correctness and error-bound results (such as `roundf_close`) controlling the distance between a rational and its rounded floating-point value. -/ -@[expose] public section +public section variable {C : FloatCfg} @@ -61,7 +61,7 @@ lemma normalize_neg (f : FloatRep C) : split_ifs with h' <;> simp [h'] /-- Round a rational to a normal representation using the rounder `r`. -/ -def roundf (r : IntRounder) (q : ℚ) : FloatRep C := +@[expose] def roundf (r : IntRounder) (q : ℚ) : FloatRep C := let exp := Int.log 2 |q| let mantissa := (|q| * (2^exp)⁻¹ - 1) * C.prec FloatRep.normalize ⟨q < 0, exp, r (q < 0) mantissa⟩ @@ -270,7 +270,7 @@ lemma e_le_iff_log (f1 f2 : FloatRep C) (vm1 : f1.validM) (vm2 : f2.validM) : rw [q_exp_eq_exp vm1, q_exp_eq_exp vm2] /-- The `IntRounder` selected by the rounding mode in scope. -/ -def roundFunction (R : Rounding) := +@[expose] def roundFunction (R : Rounding) := match R.mode with | RoundingMode.nearest => roundnearest | RoundingMode.tozero => round0 @@ -284,7 +284,7 @@ instance (R : Rounding) : ValidRounder (roundFunction R) := by <;> infer_instance /-- Round a rational to a representation using the rounding mode in scope. -/ -def roundRep [R : Rounding] (q : ℚ) : FloatRep C := roundf (roundFunction R) q +@[expose] def roundRep [R : Rounding] (q : ℚ) : FloatRep C := roundf (roundFunction R) q lemma round_rep_coe [R : Rounding] (f : FloatRep C) (h : f.validM) : roundRep (coeQ f) = f := roundf_coe (roundFunction R) f h diff --git a/LeanPool/Flean/Subnorm.lean b/LeanPool/Flean/Subnorm.lean index e71aa628ef..1ea33d3404 100644 --- a/LeanPool/Flean/Subnorm.lean +++ b/LeanPool/Flean/Subnorm.lean @@ -20,7 +20,7 @@ floating-point numbers, its rational interpretation, rounding to subnormals, and the validity and error properties of subnormal rounding. -/ -@[expose] public section +public section variable {C : FloatCfg} @@ -32,20 +32,20 @@ structure SubnormRep (C : FloatCfg) where m : ℕ /-- Negate a subnormal representation by flipping its sign bit. -/ -def SubnormRep.neg (f : SubnormRep C) : SubnormRep C := +@[expose] def SubnormRep.neg (f : SubnormRep C) : SubnormRep C := ⟨¬f.s, f.m⟩ lemma neg_subnorm_involutive : Function.Involutive (@SubnormRep.neg C) := by simp [Function.Involutive, SubnormRep.neg] /-- A subnormal representation is nonzero when its mantissa is nonzero. -/ -def SubnormRep.nonzero (f : SubnormRep C) : Prop := f.m ≠ 0 +@[expose] def SubnormRep.nonzero (f : SubnormRep C) : Prop := f.m ≠ 0 lemma subnorm_neg_nonzero {f : SubnormRep C} (h : f.nonzero) : (f.neg).nonzero := h /-- The rational value represented by a subnormal representation. -/ -def subnormalToQ : SubnormRep C → ℚ +@[expose] def subnormalToQ : SubnormRep C → ℚ | ⟨b, m⟩ => let s := if b then -1 else 1 s * (m / C.prec) * 2^C.emin @@ -77,7 +77,7 @@ lemma subnormal_to_q_nonzero (s : SubnormRep C) : /-- Round a rational to a subnormal representation using the rounder `r`. -/ -def subnormalRound (r : IntRounder) (q : ℚ) : SubnormRep C := +@[expose] def subnormalRound (r : IntRounder) (q : ℚ) : SubnormRep C := ⟨q < 0, r (q < 0) (|q| * 2^(-C.emin) * C.prec)⟩ lemma neg_subnormal_round (r : IntRounder) {q : ℚ} (h : q ≠ 0) : @@ -215,7 +215,7 @@ lemma subnormal_exp_small {q : ℚ} (q_nonneg : q ≠ 0) /-- A subnormal rounding map is valid if it never overflows the precision on inputs below the smallest normal magnitude. -/ -def ValidSubnormalRounding (f : ℚ → SubnormRep C) : Prop := +@[expose] def ValidSubnormalRounding (f : ℚ → SubnormRep C) : Prop := ∀ q : ℚ, q ≠ 0 → Int.log 2 |q| < C.emin → (f q).2 ≤ C.prec lemma subnormal_round_valid (r : IntRounder) [rh : ValidRounder r] : diff --git a/LeanPool/FltRegular.lean b/LeanPool/FltRegular.lean index 1f4ed2973b..e0f6d46faa 100644 --- a/LeanPool/FltRegular.lean +++ b/LeanPool/FltRegular.lean @@ -18,4 +18,4 @@ Tags: algebraic-number-theory, fermats-last-theorem, cyclotomic-fields, class-gr MSC: 11D41, 11R18, 11R29 -/ -@[expose] public section +public section diff --git a/LeanPool/FltRegular/CaseI/Statement.lean b/LeanPool/FltRegular/CaseI/Statement.lean index edbdbe7a36..5b33d36b7c 100644 --- a/LeanPool/FltRegular/CaseI/Statement.lean +++ b/LeanPool/FltRegular/CaseI/Statement.lean @@ -20,7 +20,7 @@ This file proves the first case of Fermat's Last Theorem for regular primes, red statement to a normalized version and establishing the required cyclotomic ideal factorization. -/ -@[expose] public section +public section open Finset Nat IsCyclotomicExtension Ideal Polynomial Int Basis FltRegular.CaseI @@ -164,7 +164,7 @@ local instance : IsCyclotomicExtension {p} ℤ R := theorem exists_ideal {a b c : ℤ} (h5p : 5 ≤ p) (H : a ^ p + b ^ p = c ^ p) (hgcd : ({a, b, c} : Finset ℤ).gcd id = 1) (caseI : ¬↑p ∣ a * b * c) {ζ : R} (hζ : ζ ∈ nthRootsFinset p 1) : - ∃ I, span ({a + ζ * b} : Set R) = I ^ p := by + ∃ I : Ideal R, span ({a + ζ * b} : Set R) = I ^ p := by classical have H₁ := congr_arg (@Int.cast R _) H simp only [Int.cast_add, Int.cast_pow] at H₁ diff --git a/LeanPool/FltRegular/CaseII/AuxLemmas.lean b/LeanPool/FltRegular/CaseII/AuxLemmas.lean index 9c17ce7a23..5cf7fc48fe 100644 --- a/LeanPool/FltRegular/CaseII/AuxLemmas.lean +++ b/LeanPool/FltRegular/CaseII/AuxLemmas.lean @@ -16,7 +16,7 @@ public import Mathlib.RingTheory.FractionalIdeal.Operations Supporting ideal-theoretic and arithmetic lemmas used in the second case of Fermat's Last Theorem. -/ -@[expose] public section +public section variable {K : Type*} {p : ℕ} [Field K] [CharZero K] {ζ : K} diff --git a/LeanPool/FltRegular/CaseII/InductionStep.lean b/LeanPool/FltRegular/CaseII/InductionStep.lean index 96c64be8f2..fcbad6dac8 100644 --- a/LeanPool/FltRegular/CaseII/InductionStep.lean +++ b/LeanPool/FltRegular/CaseII/InductionStep.lean @@ -22,7 +22,7 @@ This file constructs the ideal and unit data that turn a Case II solution into t solution in the induction. -/ -@[expose] public section +public section open scoped nonZeroDivisors NumberField open Polynomial IsCyclotomicExtension.Rat diff --git a/LeanPool/FltRegular/CaseII/Statement.lean b/LeanPool/FltRegular/CaseII/Statement.lean index b1db540ff8..7245b49928 100644 --- a/LeanPool/FltRegular/CaseII/Statement.lean +++ b/LeanPool/FltRegular/CaseII/Statement.lean @@ -17,7 +17,7 @@ import Mathlib.NumberTheory.NumberField.Cyclotomic.Ideal This file states the second-case contradiction in the cyclotomic-number-field setting. -/ -@[expose] public section +public section open scoped nonZeroDivisors NumberField open Polynomial diff --git a/LeanPool/FltRegular/FltRegular.lean b/LeanPool/FltRegular/FltRegular.lean index 4d48c279b0..e50396e41c 100644 --- a/LeanPool/FltRegular/FltRegular.lean +++ b/LeanPool/FltRegular/FltRegular.lean @@ -19,7 +19,7 @@ This file combines the first and second cases to prove Fermat's Last Theorem at prime exponent. -/ -@[expose] public section +public section open FltRegular diff --git a/LeanPool/FltRegular/MayAssume/Lemmas.lean b/LeanPool/FltRegular/MayAssume/Lemmas.lean index 9e77c2e624..29387fa30f 100644 --- a/LeanPool/FltRegular/MayAssume/Lemmas.lean +++ b/LeanPool/FltRegular/MayAssume/Lemmas.lean @@ -17,7 +17,7 @@ import Mathlib.FieldTheory.Finite.Basic This file develops primitive and coprimality reductions used in the regular-prime argument. -/ -@[expose] public section +public section open Int Finset diff --git a/LeanPool/FltRegular/NumberTheory/Cyclotomic/CaseI.lean b/LeanPool/FltRegular/NumberTheory/Cyclotomic/CaseI.lean index a0b944caec..31ea3415f8 100644 --- a/LeanPool/FltRegular/NumberTheory/Cyclotomic/CaseI.lean +++ b/LeanPool/FltRegular/NumberTheory/Cyclotomic/CaseI.lean @@ -19,7 +19,7 @@ This file establishes the complex-conjugation congruence used in the first case Theorem for regular primes. -/ -@[expose] public section +public section open scoped NumberField nonZeroDivisors diff --git a/LeanPool/FltRegular/NumberTheory/Cyclotomic/CyclRat.lean b/LeanPool/FltRegular/NumberTheory/Cyclotomic/CyclRat.lean index 706f5501c2..794712df22 100644 --- a/LeanPool/FltRegular/NumberTheory/Cyclotomic/CyclRat.lean +++ b/LeanPool/FltRegular/NumberTheory/Cyclotomic/CyclRat.lean @@ -17,7 +17,7 @@ This file develops coprimality criteria for ideals generated by `x + yη` and a divisibility result for integral linear combinations of roots of unity. -/ -@[expose] public section +public section open FiniteDimensional Polynomial Algebra Nat Finset Fintype @@ -32,6 +32,7 @@ open Ideal IsCyclotomicExtension local notation "R" => 𝓞 (CyclotomicField p ℚ) /-- The principal ideal generated by `x + y ζ^i` for integer `x` and `y` -/ +@[expose] noncomputable def fltIdeals (x y : ℤ) (η : R) : Ideal R := Ideal.span ({x + η * y} : Set R) diff --git a/LeanPool/FltRegular/NumberTheory/Cyclotomic/MoreLemmas.lean b/LeanPool/FltRegular/NumberTheory/Cyclotomic/MoreLemmas.lean index 3fcf63bf08..786f79b4ae 100644 --- a/LeanPool/FltRegular/NumberTheory/Cyclotomic/MoreLemmas.lean +++ b/LeanPool/FltRegular/NumberTheory/Cyclotomic/MoreLemmas.lean @@ -17,7 +17,7 @@ This file proves divisibility results for cyclotomic integers, traces, and norms the surrounding FLT development. -/ -@[expose] public section +public section variable {K : Type*} {p : ℕ} [hpri : Fact p.Prime] [Field K] [CharZero K] [IsCyclotomicExtension {p} ℚ K] diff --git a/LeanPool/FltRegular/NumberTheory/Cyclotomic/UnitLemmas.lean b/LeanPool/FltRegular/NumberTheory/Cyclotomic/UnitLemmas.lean index 25e5d494d1..ba831fa5f5 100644 --- a/LeanPool/FltRegular/NumberTheory/Cyclotomic/UnitLemmas.lean +++ b/LeanPool/FltRegular/NumberTheory/Cyclotomic/UnitLemmas.lean @@ -18,7 +18,7 @@ This file records how complex conjugation acts on cyclotomic units and proves th of a unit by its conjugate is a square of a root of unity. -/ -@[expose] public section +public section variable {p : ℕ} [NeZero p] {K : Type*} [Field K] diff --git a/LeanPool/FltRegular/NumberTheory/CyclotomicRing.lean b/LeanPool/FltRegular/NumberTheory/CyclotomicRing.lean index c5376162b6..424cfed006 100644 --- a/LeanPool/FltRegular/NumberTheory/CyclotomicRing.lean +++ b/LeanPool/FltRegular/NumberTheory/CyclotomicRing.lean @@ -16,7 +16,7 @@ This file defines cyclotomic integers using `AdjoinRoot` and relates them to the integers of the corresponding rational cyclotomic field. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ local instance : IsCyclotomicExtension {p} ℚ (CyclotomicField p ℚ) := CyclotomicField.isCyclotomicExtension p ℚ /-- The cyclotomic integers of conductor `p`, defined as an `AdjoinRoot`. -/ -def CyclotomicIntegers : Type := AdjoinRoot (cyclotomic p ℤ) +@[expose] def CyclotomicIntegers : Type := AdjoinRoot (cyclotomic p ℤ) instance : CommRing (CyclotomicIntegers p) := by delta CyclotomicIntegers @@ -48,8 +48,7 @@ namespace CyclotomicIntegers /-- The canonical equivalence between `CyclotomicIntegers p` and the ring of integers of the `p`-th cyclotomic field. -/ -@[simps! -isSimp] -def equiv : +@[expose, simps! -isSimp] def equiv : CyclotomicIntegers p ≃+* 𝓞 (CyclotomicField p ℚ) := by have H := IsCyclotomicExtension.zeta_spec p ℚ (CyclotomicField p ℚ) have hH : minpoly ℤ H.integralPowerBasis.gen = cyclotomic p ℤ := @@ -63,7 +62,7 @@ instance : IsDomain (CyclotomicIntegers p) := (cyclotomic.irreducible hpri.out.pos)) /-- The tautological primitive root of unity in `CyclotomicIntegers p`. -/ -def zeta : CyclotomicIntegers p := AdjoinRoot.root _ +@[expose] def zeta : CyclotomicIntegers p := AdjoinRoot.root _ lemma equiv_zeta : equiv p (zeta p) = (IsCyclotomicExtension.zeta_spec p ℚ (CyclotomicField p ℚ)).toInteger := by diff --git a/LeanPool/FltRegular/NumberTheory/Hilbert92.lean b/LeanPool/FltRegular/NumberTheory/Hilbert92.lean index 71b96db19e..998a2510ca 100644 --- a/LeanPool/FltRegular/NumberTheory/Hilbert92.lean +++ b/LeanPool/FltRegular/NumberTheory/Hilbert92.lean @@ -18,7 +18,7 @@ This file studies systems of relative units in cyclic extensions for the proof o Hilbert's theorem 92. -/ -@[expose] public section +public section open scoped NumberField nonZeroDivisors open FiniteDimensional NumberField @@ -180,7 +180,7 @@ variable (hσ : ∀ x, x ∈ Subgroup.zpowers σ) /-- Relative units of an extension, modulo units coming from the base field. -/ -def RelativeUnits (k K : Type*) [Field k] [Field K] [Algebra k K] := +@[expose] def RelativeUnits (k K : Type*) [Field k] [Field K] [Algebra k K] := (𝓞 K)ˣ ⧸ MonoidHom.range (Units.map (algebraMap (𝓞 k) (𝓞 K) : (𝓞 k) →* (𝓞 K))) @@ -231,7 +231,7 @@ def relativeUnitsMap (σ : K →ₐ[k] K) : RelativeUnits k K →* RelativeUnits lemma relativeUnitsMap_mk (σ : K →ₐ[k] K) (x : (𝓞 K)ˣ) : relativeUnitsMap σ (QuotientGroup.mk x) = - QuotientGroup.mk (Units.map (galRestrictHom (𝓞 k) k K (𝓞 K) σ) x) := rfl + QuotientGroup.mk (Units.map (galRestrictHom (𝓞 k) k K (𝓞 K) σ) x) := by rfl private lemma relativeUnitsMap_addMonoidEndRingEquivInt_apply (σ : K →ₐ[k] K) (x : (𝓞 K)ˣ) : @@ -267,7 +267,7 @@ def relativeUnitsMapHom : (K →ₐ[k] K) →* (Monoid.End (RelativeUnits k K)) @[simp] theorem relativeUnitsMapHom_apply (σ : K →ₐ[k] K) : - relativeUnitsMapHom σ = relativeUnitsMap σ := rfl + relativeUnitsMapHom σ = relativeUnitsMap σ := by rfl private lemma sum_ofMul_quotient_mk_eq_zero_iff {U ι : Type*} [CommGroup U] (N : Subgroup U) diff --git a/LeanPool/FltRegular/NumberTheory/Hilbert94.lean b/LeanPool/FltRegular/NumberTheory/Hilbert94.lean index eca62afc77..927c222aac 100644 --- a/LeanPool/FltRegular/NumberTheory/Hilbert94.lean +++ b/LeanPool/FltRegular/NumberTheory/Hilbert94.lean @@ -18,7 +18,7 @@ import LeanPool.FltRegular.NumberTheory.Unramified This file proves the class-number divisibility result used in the regular-prime argument. -/ -@[expose] public section +public section open scoped NumberField diff --git a/LeanPool/FltRegular/NumberTheory/KummersLemma/Field.lean b/LeanPool/FltRegular/NumberTheory/KummersLemma/Field.lean index 71682ba9ec..2f6ab58bbb 100644 --- a/LeanPool/FltRegular/NumberTheory/KummersLemma/Field.lean +++ b/LeanPool/FltRegular/NumberTheory/KummersLemma/Field.lean @@ -19,7 +19,7 @@ This file constructs Kummer's auxiliary polynomial and proves the associated spl unramified. -/ -@[expose] public section +public section open scoped NumberField diff --git a/LeanPool/FltRegular/NumberTheory/KummersLemma/KummersLemma.lean b/LeanPool/FltRegular/NumberTheory/KummersLemma/KummersLemma.lean index 6df94f683e..974dfaa127 100644 --- a/LeanPool/FltRegular/NumberTheory/KummersLemma/KummersLemma.lean +++ b/LeanPool/FltRegular/NumberTheory/KummersLemma/KummersLemma.lean @@ -21,7 +21,7 @@ import LeanPool.FltRegular.NumberTheory.KummersLemma.Field This file proves the unit form of Kummer's lemma for regular primes. -/ -@[expose] public section +public section open Polynomial IsCyclotomicExtension.Rat open scoped NumberField diff --git a/LeanPool/FltRegular/NumberTheory/RegularPrimes.lean b/LeanPool/FltRegular/NumberTheory/RegularPrimes.lean index 957cc3a575..fae2abba66 100644 --- a/LeanPool/FltRegular/NumberTheory/RegularPrimes.lean +++ b/LeanPool/FltRegular/NumberTheory/RegularPrimes.lean @@ -20,7 +20,7 @@ import Mathlib.NumberTheory.NumberField.Cyclotomic.PID -/ -@[expose] public section +public section noncomputable section @@ -31,11 +31,11 @@ open scoped NumberField variable (n p : ℕ) /-- A natural number `n` is regular if `n` is coprime with the cardinal of the class group. -/ -def IsRegularNumber : Prop := +@[expose] def IsRegularNumber : Prop := n.Coprime <| Fintype.card <| ClassGroup (𝓞 <| CyclotomicField n ℚ) /-- The definition of regular primes. -/ -def IsRegularPrime : Prop := +@[expose] def IsRegularPrime : Prop := IsRegularNumber p section TwoRegular diff --git a/LeanPool/FltRegular/NumberTheory/SystemOfUnits.lean b/LeanPool/FltRegular/NumberTheory/SystemOfUnits.lean index c7303c579b..1b615d1626 100644 --- a/LeanPool/FltRegular/NumberTheory/SystemOfUnits.lean +++ b/LeanPool/FltRegular/NumberTheory/SystemOfUnits.lean @@ -14,7 +14,7 @@ public import LeanPool.FltRegular.NumberTheory.CyclotomicRing This file develops linearly independent systems of units in cyclotomic modules. -/ -@[expose] public section +public section open FiniteDimensional open NumberField diff --git a/LeanPool/FltRegular/NumberTheory/Unramified.lean b/LeanPool/FltRegular/NumberTheory/Unramified.lean index 0bdd4a73d3..562c6c8658 100644 --- a/LeanPool/FltRegular/NumberTheory/Unramified.lean +++ b/LeanPool/FltRegular/NumberTheory/Unramified.lean @@ -22,7 +22,7 @@ public import Mathlib.RingTheory.Unramified.Locus `f'(α) mod p` is separable for the prime below `P`, then `S/R` is unramified at `P`. -/ -@[expose] public section +public section open UniqueFactorizationMonoid Ideal attribute [local instance] FractionRing.liftAlgebra diff --git a/LeanPool/FoZfc.lean b/LeanPool/FoZfc.lean index b07ed3b26c..a17eeac8e1 100644 --- a/LeanPool/FoZfc.lean +++ b/LeanPool/FoZfc.lean @@ -23,7 +23,7 @@ Tags: model-theory, set-theory, zf MSC: 03B10, 03E30 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/FoZfc/Axioms.lean b/LeanPool/FoZfc/Axioms.lean index 67af43b0e2..9d6b3ac14a 100644 --- a/LeanPool/FoZfc/Axioms.lean +++ b/LeanPool/FoZfc/Axioms.lean @@ -46,7 +46,7 @@ public import LeanPool.FoZfc.BoundedFormulaOps -/ -@[expose] public section +public section open FirstOrder open FirstOrder.Language diff --git a/LeanPool/FoZfc/Basic.lean b/LeanPool/FoZfc/Basic.lean index bdf20db9d4..e7c1a2fd89 100644 --- a/LeanPool/FoZfc/Basic.lean +++ b/LeanPool/FoZfc/Basic.lean @@ -38,7 +38,7 @@ public import Mathlib.ModelTheory.Semantics -/ -@[expose] public section +public section namespace FirstOrder open FirstOrder.Language @@ -57,7 +57,7 @@ deriving DecidableEq namespace Language /-- Language of Set Theory. -/ -def LZFC : Language := +@[expose] def LZFC : Language := { Functions := fun _ => Empty Relations := LSetRel @@ -113,7 +113,7 @@ class ModelSets (V : Type u) extends LZFC.Structure V, Inhabited V where variable {V : Type u} /-- The negation of `ModelSets.isEltOf`. -/ -def notIsEltOf [ModelSets V] (a b : V) : Prop := +@[expose] def notIsEltOf [ModelSets V] (a b : V) : Prop := ¬ (ModelSets.isEltOf a b) @[inherit_doc ModelSets.isEltOf] infix : 120 " ∈ " => ModelSets.isEltOf @@ -154,11 +154,13 @@ theorem realize_neq [ModelSets V] {n : ℕ} {s : ℕ → V} {xs : Fin n → V} simp [intNotEqual] /-- Make a free variable in LSet with n implicit. -/ -def fv' {n : ℕ} (k : ℕ) : Language.LZFC.Term (ℕ ⊕ Fin n) := Language.Term.var (Sum.inl k) +@[expose] def fv' {n : ℕ} (k : ℕ) : Language.LZFC.Term (ℕ ⊕ Fin n) := + Language.Term.var (Sum.inl k) /-- Make a to-be bounded variable indexed by (k : Fin n), in which free variables are indexed by ℕ with n implicit. -/ -def bv' {n : ℕ} (k : Fin n) : Language.LZFC.Term (ℕ ⊕ Fin n) := Language.Term.var (Sum.inr k) +@[expose] def bv' {n : ℕ} (k : Fin n) : Language.LZFC.Term (ℕ ⊕ Fin n) := + Language.Term.var (Sum.inr k) /-- Make a to-be bounded variable indexed by (k : ℕ), in which free variables are indexed by ℕ with n implicit. -/ diff --git a/LeanPool/FoZfc/BoundedFormulaOps.lean b/LeanPool/FoZfc/BoundedFormulaOps.lean index 9d35c9e6f2..d7ae11ce3f 100644 --- a/LeanPool/FoZfc/BoundedFormulaOps.lean +++ b/LeanPool/FoZfc/BoundedFormulaOps.lean @@ -36,7 +36,7 @@ import LeanPool.FoZfc.FixedSnoc -/ -@[expose] public section +public section open FirstOrder open FirstOrder.Language @@ -52,13 +52,13 @@ variable {V : Type u} {L : Language} {α : Type v} namespace BoundedFormula /-- Or operator in the formula. -/ -@[match_pattern] +@[expose, match_pattern] def or {n : ℕ} (ϕ1 ϕ2 : L.BoundedFormula α n) : L.BoundedFormula α n := (∼ϕ1)⟹ϕ2 @[inherit_doc] infix : 63 "∨'" => BoundedFormula.or /-- And operator in the formula. -/ -@[match_pattern] +@[expose, match_pattern] def and {n : ℕ} (ϕ1 ϕ2 : L.BoundedFormula α n) : L.BoundedFormula α n := ∼(ϕ1⟹∼ϕ2) @[inherit_doc] infix : 64 "∧'" => BoundedFormula.and @@ -109,14 +109,14 @@ match ϕ with /-- Make a function on `ℕ` whose value at `k` is `ts k` if `k < m + 1` and `fv' k` otherwise. -/ -def makeTsN {n m : ℕ} (ts : Fin (m + 1) → L.Term (ℕ ⊕ Fin n)) (k : ℕ) := +@[expose] def makeTsN {n m : ℕ} (ts : Fin (m + 1) → L.Term (ℕ ⊕ Fin n)) (k : ℕ) := if k < m + 1 then ts (Fin.ofNat (m+1) k) else Term.var (Sum.inl k) /-- Replace the initial part of `s : ℕ → V` by `xs : Fin (n + 1) → V`. -/ -def replaceInitialValues {n : ℕ} (s : ℕ → V) +@[expose] def replaceInitialValues {n : ℕ} (s : ℕ → V) (xs : Fin (n + 1) → V) (k : ℕ) := if k < n + 1 then xs (Fin.ofNat (n+1) k) @@ -124,7 +124,7 @@ def replaceInitialValues {n : ℕ} (s : ℕ → V) s k /-- Apply `liftAt n' m` and `replace (makeTsN ts)` in one call. -/ -@[simp] +@[expose, simp] def liftAndReplaceFV {n l : ℕ} (ϕ : L.BoundedFormula ℕ n) (n' m : ℕ) (ts : Fin (l + 1) → L.Term (ℕ ⊕ Fin (n + n'))) : L.BoundedFormula ℕ (n+n') := (ϕ.liftAt n' m).replaceFV (makeTsN ts) diff --git a/LeanPool/FoZfc/FixedSnoc.lean b/LeanPool/FoZfc/FixedSnoc.lean index 3fdb08dd44..36dfaf8bea 100644 --- a/LeanPool/FoZfc/FixedSnoc.lean +++ b/LeanPool/FoZfc/FixedSnoc.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.Attr.Core -/ -@[expose] public section +public section universe u @@ -36,7 +36,7 @@ namespace FirstOrder.ZFC.FixedSnoc variable {V : Type u} /-- Fin.snoc for the type V. -/ -def fixedSnoc {n : ℕ} (xs : Fin n → V) (b : V) := +@[expose] def fixedSnoc {n : ℕ} (xs : Fin n → V) (b : V) := (fun (k : Fin (n + 1)) => if h : k.val < n then xs (Fin.castLT k h) else b) /-- Fin.snoc = fixedSnoc when applied to V. -/ diff --git a/LeanPool/FoZfc/Replacement.lean b/LeanPool/FoZfc/Replacement.lean index 283cdab2fb..7c3a0f2e29 100644 --- a/LeanPool/FoZfc/Replacement.lean +++ b/LeanPool/FoZfc/Replacement.lean @@ -28,7 +28,7 @@ public import LeanPool.FoZfc.Axioms -/ -@[expose] public section +public section open FirstOrder open FirstOrder.Language diff --git a/LeanPool/FoZfc/Tostring.lean b/LeanPool/FoZfc/Tostring.lean index d21a1c2d76..bc82901e59 100644 --- a/LeanPool/FoZfc/Tostring.lean +++ b/LeanPool/FoZfc/Tostring.lean @@ -17,7 +17,7 @@ strings, with two flavors (with and without depth information). -/ -@[expose] public section +public section open FirstOrder open FirstOrder.Language diff --git a/LeanPool/FormalLearningTheory.lean b/LeanPool/FormalLearningTheory.lean index f0aefb41fc..cdb1bff25a 100644 --- a/LeanPool/FormalLearningTheory.lean +++ b/LeanPool/FormalLearningTheory.lean @@ -21,7 +21,7 @@ Tags: learning-theory, probability, combinatorics, online-learning MSC: 68Q32, 68T05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/FormalLearningTheory/Basic.lean b/LeanPool/FormalLearningTheory/Basic.lean index 2e9f05ca57..a5a834ade2 100644 --- a/LeanPool/FormalLearningTheory/Basic.lean +++ b/LeanPool/FormalLearningTheory/Basic.lean @@ -24,7 +24,7 @@ commented-out variants for different proof contexts (decidable, RE, measurable, multiclass, Bayesian). -/ -@[expose] public section +public section universe u v @@ -161,10 +161,11 @@ They are universal across paradigms (PAC uses expected loss, online uses cumulat -/ /-- A loss function measures the discrepancy between a prediction and true label. -/ +@[expose] def LossFunction (Y : Type v) := Y → Y → ℝ /-- The 0-1 loss for classification. -/ -noncomputable def zeroOneLoss (Y : Type v) [DecidableEq Y] : LossFunction Y := +@[expose] noncomputable def zeroOneLoss (Y : Type v) [DecidableEq Y] : LossFunction Y := fun y₁ y₂ => if y₁ = y₂ then 0 else 1 /-- Squared loss for regression (Y = ℝ). -/ diff --git a/LeanPool/FormalLearningTheory/Bridge.lean b/LeanPool/FormalLearningTheory/Bridge.lean index 05cc5422b4..4a5fc1551c 100644 --- a/LeanPool/FormalLearningTheory/Bridge.lean +++ b/LeanPool/FormalLearningTheory/Bridge.lean @@ -33,7 +33,7 @@ paradigm-specific types: | B₇ | BatchLearner ↔ GoldLearner | Cross-paradigm | No common parent (BP₁) | -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Complexity.lean b/LeanPool/FormalLearningTheory/Complexity.lean index 10e04ec197..ab69fd807f 100644 --- a/LeanPool/FormalLearningTheory/Complexity.lean +++ b/LeanPool/FormalLearningTheory/Complexity.lean @@ -26,4 +26,4 @@ import Mathlib.MeasureTheory.Covering.Besicovitch Imported Lean Pool material for `LeanPool.FormalLearningTheory.Complexity`. -/ -@[expose] public section +public section diff --git a/LeanPool/FormalLearningTheory/Complexity/Amalgamation.lean b/LeanPool/FormalLearningTheory/Complexity/Amalgamation.lean index 119006f1b2..b2bb7f55f4 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Amalgamation.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Amalgamation.lean @@ -37,7 +37,7 @@ The proof proceeds by: - Interpolation.lean (piecewise concepts, interpClassFixed) -/ -@[expose] public section +public section universe u diff --git a/LeanPool/FormalLearningTheory/Complexity/BorelAnalyticBridge.lean b/LeanPool/FormalLearningTheory/Complexity/BorelAnalyticBridge.lean index 54d06c2a1b..92f4c3a489 100644 --- a/LeanPool/FormalLearningTheory/Complexity/BorelAnalyticBridge.lean +++ b/LeanPool/FormalLearningTheory/Complexity/BorelAnalyticBridge.lean @@ -39,7 +39,7 @@ but KrappWirthWellBehaved fails. See Theorem/BorelAnalyticSeparation.lean. - This kernel: NullMeasurableSet weakening discovered during Lean4 formalization -/ -@[expose] public section +public section universe u @@ -74,6 +74,7 @@ def paramBadEvent /-- Patched evaluation: combine two concept families using a region selector. patchEval(θ₁, θ₂, ρ)(x) = e₁(θ₁)(x) if r(ρ)(x), else e₂(θ₂)(x). Used for the closure principle (Theorem F). -/ +@[expose] def patchEval {X : Type u} {Θ₁ Θ₂ Ρ : Type*} diff --git a/LeanPool/FormalLearningTheory/Complexity/Compression.lean b/LeanPool/FormalLearningTheory/Complexity/Compression.lean index 4f484c9115..f5c777b0fa 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Compression.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Compression.lean @@ -38,7 +38,7 @@ and finite games — no MeasureTheory.Measure, IsProbabilityMeasure, Measure.dir or MeasurableSpace hypotheses. -/ -@[expose] public section +public section open Finset noncomputable section diff --git a/LeanPool/FormalLearningTheory/Complexity/DualVC.lean b/LeanPool/FormalLearningTheory/Complexity/DualVC.lean index 730f1fa3b9..1669bfb516 100644 --- a/LeanPool/FormalLearningTheory/Complexity/DualVC.lean +++ b/LeanPool/FormalLearningTheory/Complexity/DualVC.lean @@ -28,7 +28,7 @@ on the domain `↥C` where each point `x : X` induces a concept `c ↦ c x`. * `dual_vcdim_le_pow` - Assouad's bound: `VCDim*(C) ≤ 2^(VCDim(C)+1) - 1` -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/FormalLearningTheory/Complexity/FiniteSupportUC.lean b/LeanPool/FormalLearningTheory/Complexity/FiniteSupportUC.lean index b6e8bec46b..ff47613d39 100644 --- a/LeanPool/FormalLearningTheory/Complexity/FiniteSupportUC.lean +++ b/LeanPool/FormalLearningTheory/Complexity/FiniteSupportUC.lean @@ -20,7 +20,7 @@ forward along `Sum.inl`. This forces the growth-function path in the symmetrizat proof, giving a sample bound depending only on d and ε, not on |H| or |A|. -/ -@[expose] public section +public section open Finset MeasureTheory noncomputable section diff --git a/LeanPool/FormalLearningTheory/Complexity/GameInfra.lean b/LeanPool/FormalLearningTheory/Complexity/GameInfra.lean index 419d31b5c6..451ea37a54 100644 --- a/LeanPool/FormalLearningTheory/Complexity/GameInfra.lean +++ b/LeanPool/FormalLearningTheory/Complexity/GameInfra.lean @@ -29,7 +29,7 @@ Definitions and interface lemmas for the online learning game: Characterization theorems live in `FLT_Proofs.Theorem.Online`. -/ -@[expose] public section +public section -- ============================================================ -- CORRECTED DEFINITIONS: Depth-indexed complete Littlestone trees @@ -42,7 +42,7 @@ inductive LTree (X : Type) : ℕ → Type where /-- Path-wise shattering for complete trees. Path B: leaf case requires C.Nonempty (NA₁₀). -/ -def LTree.isShattered {X : Type} {n : ℕ} (C : ConceptClass X Bool) : LTree X n → Prop +@[expose] def LTree.isShattered {X : Type} {n : ℕ} (C : ConceptClass X Bool) : LTree X n → Prop | .leaf => C.Nonempty -- Path B: was True, now C.Nonempty (Γ₂₁ fix) | .branch x l r => (∃ c ∈ C, c x = true) ∧ (∃ c ∈ C, c x = false) ∧ @@ -74,7 +74,7 @@ theorem LTree.isShattered_mono {X : Type} {n : ℕ} (T : LTree X n) /-- Littlestone dimension: the maximum depth of a complete shattered tree. Path B: returns WithBot (WithTop ℕ) so Ldim(∅) = ⊥ (NA₁₀). -/ -noncomputable def LittlestoneDim (X : Type) (C : ConceptClass X Bool) : +@[expose] noncomputable def LittlestoneDim (X : Type) (C : ConceptClass X Bool) : WithBot (WithTop ℕ) := ⨆ (n : ℕ) (_ : ∃ T : LTree X n, T.isShattered C), (↑(↑n : WithTop ℕ) : WithBot (WithTop ℕ)) @@ -124,12 +124,12 @@ theorem mistakesFrom_init_eq {X : Type} -- ============================================================ /-- Version space after observing a history. -/ -def versionSpace {X : Type} (C : ConceptClass X Bool) (history : List (X × Bool)) : +@[expose] def versionSpace {X : Type} (C : ConceptClass X Bool) (history : List (X × Bool)) : ConceptClass X Bool := {c ∈ C | ∀ p ∈ history, c p.1 = p.2} /-- The Standard Optimal Algorithm (SOA). -/ -noncomputable def SOA (X : Type) (C : ConceptClass X Bool) : OnlineLearner X Bool where +@[expose] noncomputable def SOA (X : Type) (C : ConceptClass X Bool) : OnlineLearner X Bool where State := List (X × Bool) init := [] predict := fun history x => diff --git a/LeanPool/FormalLearningTheory/Complexity/Generalization.lean b/LeanPool/FormalLearningTheory/Complexity/Generalization.lean index 0b36ca9b2f..0f6c126654 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Generalization.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Generalization.lean @@ -14,4 +14,4 @@ public import LeanPool.FormalLearningTheory.Complexity.Generalization.Tail Import-only index for the generalization infrastructure. -/ -@[expose] public section +public section diff --git a/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean b/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean index 1cd153da4f..e9e3f13753 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean @@ -20,14 +20,14 @@ The numerical quantities that PAC learning bounds. Includes the canonical PAC learner (ERM). -/ -@[expose] public section +public section universe u v /-- Sample complexity of PAC learning: the minimum number of samples needed to achieve (ε,δ)-PAC learning. m_C(ε,δ) = sInf{m | ∃ L, ∀ D prob, ∀ c ∈ C, D^m{S : error(L(S)) ≤ ε} ≥ 1-δ}. -/ -noncomputable def SampleComplexity (X : Type u) [MeasurableSpace X] +@[expose] noncomputable def SampleComplexity (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : ℝ → ℝ → ℕ := fun ε δ => sInf { m : ℕ | ∃ (L : BatchLearner X Bool), ∀ (D : MeasureTheory.Measure X), MeasureTheory.IsProbabilityMeasure D → @@ -60,6 +60,7 @@ noncomputable def LabelComplexity (X : Type u) L.learnMQ mq = c } /-- Mistake bound: minimum worst-case mistakes for online learning of C. -/ +@[expose] noncomputable def OptimalMistakeBound (X : Type u) (C : ConceptClass X Bool) : WithTop ℕ := ⨅ (M : ℕ) (_ : MistakeBounded X Bool C M), (M : WithTop ℕ) @@ -72,7 +73,7 @@ noncomputable def GeneralizationError (X : Type u) (Y : Type v) ∫ p, loss (h p.1) p.2 ∂D /-- Empirical error: average loss on a finite sample. -/ -noncomputable def EmpiricalError (X : Type u) (Y : Type v) +@[expose] noncomputable def EmpiricalError (X : Type u) (Y : Type v) (h : Concept X Y) {m : ℕ} (S : Fin m → X × Y) (loss : LossFunction Y) : ℝ := if m = 0 then 0 @@ -157,14 +158,14 @@ lemmas (e.g., ε-δ bounds with subtraction), swap to: /-- True error (0-1 loss, realizable case): D-probability of disagreement. This is what PACLearnable's success event measures. -/ -noncomputable def TrueError (X : Type u) [MeasurableSpace X] +@[expose] noncomputable def TrueError (X : Type u) [MeasurableSpace X] (h : Concept X Bool) (c : Concept X Bool) (D : MeasureTheory.Measure X) : ENNReal := D { x | h x ≠ c x } /-- True error in ℝ: for use in bounds involving subtraction/absolute value. COUNTER-1 of TrueError. The toReal bridge loses information when the measure is ⊤. -/ -noncomputable def TrueErrorReal (X : Type u) [MeasurableSpace X] +@[expose] noncomputable def TrueErrorReal (X : Type u) [MeasurableSpace X] (h : Concept X Bool) (c : Concept X Bool) (D : MeasureTheory.Measure X) : ℝ := (TrueError X h c D).toReal @@ -741,6 +742,7 @@ What is the Lean4 type-theoretic status of this? -/ making uc_imp_pac unprovable (PACLearnable's mf must be independent of D, c). Repaired: ∃ m₀ is now BEFORE ∀ D, ∀ c. This STRENGTHENS the definition (A5-valid: adds content, doesn't simplify). -/ +@[expose] def HasUniformConvergence (X : Type u) [MeasurableSpace X] (H : HypothesisSpace X Bool) : Prop := ∀ (ε δ : ℝ), 0 < ε → 0 < δ → @@ -1363,7 +1365,7 @@ needs Measure.count normalized by Fintype.card, or a manual Dirac sum. /-- Uniform probability measure on a Fintype: (1/|X|) · count. This gives each point probability 1/|X|. Requires |X| > 0 (nonempty). -/ -noncomputable def uniformMeasure (X : Type u) [MeasurableSpace X] [Fintype X] +@[expose] noncomputable def uniformMeasure (X : Type u) [MeasurableSpace X] [Fintype X] (hne : Nonempty X) : MeasureTheory.Measure X := let _nonemptyWitness := hne (1 / (Fintype.card X : ENNReal)) • MeasureTheory.Measure.count diff --git a/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean b/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean index 4141b0f208..047ce4628d 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean @@ -15,7 +15,7 @@ import Mathlib.Probability.ProductMeasure # LeanPool.FormalLearningTheory.Complexity.Generalization.Tail -/ -@[expose] public section +public section universe u v @@ -24,11 +24,11 @@ section FinBlockInfrastructure open Equiv in /-- Extract block j from a flat array of k*m elements, using finProdFinEquiv. -/ -def blockExtract {α : Type*} (k m : ℕ) (S : Fin (k * m) → α) (j : Fin k) : Fin m → α := +@[expose] def blockExtract {α : Type*} (k m : ℕ) (S : Fin (k * m) → α) (j : Fin k) : Fin m → α := fun i => S (finProdFinEquiv (j, i)) /-- Boolean majority vote: returns true iff strictly more than half the votes are true. -/ -def majorityVote (k : ℕ) (votes : Fin k → Bool) : Bool := +@[expose] def majorityVote (k : ℕ) (votes : Fin k → Bool) : Bool := decide (2 * (Finset.univ.filter (fun j => votes j = true)).card > k) /-- Block index sets are disjoint for distinct blocks. -/ diff --git a/LeanPool/FormalLearningTheory/Complexity/GeneralizationResults.lean b/LeanPool/FormalLearningTheory/Complexity/GeneralizationResults.lean index 8065b53448..8269815b20 100644 --- a/LeanPool/FormalLearningTheory/Complexity/GeneralizationResults.lean +++ b/LeanPool/FormalLearningTheory/Complexity/GeneralizationResults.lean @@ -27,7 +27,7 @@ The public statements use the primed uniform-convergence route from - `rademacher_vanishing_imp_pac` : uniform Rademacher vanishing → PAC -/ -@[expose] public section +public section universe u diff --git a/LeanPool/FormalLearningTheory/Complexity/Interpolation.lean b/LeanPool/FormalLearningTheory/Complexity/Interpolation.lean index 3150559048..fe09417d18 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Interpolation.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Interpolation.lean @@ -36,7 +36,7 @@ not stay at the Borel level. - BorelAnalyticBridge.lean (this kernel) -/ -@[expose] public section +public section universe u @@ -64,7 +64,7 @@ noncomputable def routerOfSetFamily {X : Type u} /-! ## Concept Class Definitions -/ /-- Interpolation with a fixed region A. -/ -def interpClassFixed {X : Type u} +@[expose] def interpClassFixed {X : Type u} (C₁ C₂ : ConceptClass X Bool) (A : Set X) : ConceptClass X Bool := {h | ∃ h₁ ∈ C₁, ∃ h₂ ∈ C₂, h = piecewiseConcept A h₁ h₂} diff --git a/LeanPool/FormalLearningTheory/Complexity/Littlestone.lean b/LeanPool/FormalLearningTheory/Complexity/Littlestone.lean index 2e695b79ea..aa7236d120 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Littlestone.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Littlestone.lean @@ -18,7 +18,7 @@ The online-learning analog of VC dimension. Characterizes mistake-bounded learnability. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Complexity/Measurability.lean b/LeanPool/FormalLearningTheory/Complexity/Measurability.lean index 3c6c7c8335..3d62435a51 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Measurability.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Measurability.lean @@ -47,7 +47,7 @@ Combined with `MeasurableBatchLearner` (Learner/Core.lean), these two typeclasse provide the complete regularity infrastructure for PAC learning proofs. -/ -@[expose] public section +public section universe u @@ -174,7 +174,7 @@ Uses sSup over value sets (not ⨆) to avoid class-inference ambiguity. V-measurability is ONE-SIDED (not absolute) to match WellBehavedVC's event shape. -/ /-- One-sided ghost-sample empirical error gap. -/ -noncomputable def oneSidedGhostGap +@[expose] noncomputable def oneSidedGhostGap {X : Type u} (h : Concept X Bool) (c : Concept X Bool) (m : ℕ) (p : (Fin m → X) × (Fin m → X)) : ℝ := @@ -189,7 +189,7 @@ noncomputable def absGhostGap |oneSidedGhostGap h c m p| /-- Value set of one-sided ghost gaps over a concept class. -/ -noncomputable def ghostGapVals +@[expose] noncomputable def ghostGapVals {X : Type u} (C : ConceptClass X Bool) (c : Concept X Bool) (m : ℕ) (p : (Fin m → X) × (Fin m → X)) : Set ℝ := @@ -203,7 +203,7 @@ noncomputable def absGhostGapVals {r | ∃ h ∈ C, r = absGhostGap h c m p} /-- Supremum of one-sided ghost gaps over a concept class. -/ -noncomputable def ghostGapSup +@[expose] noncomputable def ghostGapSup {X : Type u} (C : ConceptClass X Bool) (c : Concept X Bool) (m : ℕ) (p : (Fin m → X) × (Fin m → X)) : ℝ := @@ -225,6 +225,7 @@ because WellBehavedVC's event is one-sided. The paper-faithful ABSOLUTE version is KrappWirthVAbs, kept separately. -/ /-- V-measurability (one-sided): the ghost gap sup map is measurable. -/ +@[expose] def KrappWirthV (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : Prop := ∀ (c : Concept X Bool) (m : ℕ), @@ -396,6 +397,7 @@ the quantification to measurable targets. -/ This is the correct target for the Borel-analytic positive bridge: Borel parameterization ⇒ analytic bad event ⇒ NullMeasurableSet, but only when c is measurable (so the ghost-gap map is measurable). -/ +@[expose] def WellBehavedVCMeasTarget (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : Prop := @@ -412,6 +414,7 @@ def WellBehavedVCMeasTarget /-- OPEN QUESTION (measurable-target version): Does WellBehavedVCMeasTarget separate from KrappWirthWellBehaved? The Borel-analytic bridge (BorelAnalyticBridge.lean) closes this. -/ +@[expose] def KrappWirthSeparationMeasTarget : Prop := ∃ (C : ConceptClass ℝ Bool), MeasurableHypotheses ℝ C ∧ diff --git a/LeanPool/FormalLearningTheory/Complexity/MindChange.lean b/LeanPool/FormalLearningTheory/Complexity/MindChange.lean index e133a0672f..c4a5503d4e 100644 --- a/LeanPool/FormalLearningTheory/Complexity/MindChange.lean +++ b/LeanPool/FormalLearningTheory/Complexity/MindChange.lean @@ -15,11 +15,12 @@ public import Mathlib.SetTheory.Ordinal.Basic Counts how often a Gold learner changes its conjecture before converging. -/ -@[expose] public section +public section universe u v /-- The data prefix: the first t examples from a data stream, as a list. -/ +@[expose] def DataStream.prefix {X : Type u} {Y : Type v} (T : DataStream X Y) (t : ℕ) : List (X × Y) := (List.range t).map T.observe @@ -43,7 +44,7 @@ open Classical in Design rationale: encoding correctness at the definition level makes the backward direction of mind_change_characterization provable - `MindChangeOrdinal < ω` directly entails both convergence and correctness without needing to extract them separately. -/ -noncomputable def MindChangeOrdinal (X : Type u) (L : GoldLearner X Bool) +@[expose] noncomputable def MindChangeOrdinal (X : Type u) (L : GoldLearner X Bool) (c : Concept X Bool) (T : DataStream X Bool) : Ordinal := let changes := { t : ℕ | L.conjecture (T.prefix t) ≠ L.conjecture (T.prefix (t + 1)) } if h : changes.Finite then diff --git a/LeanPool/FormalLearningTheory/Complexity/Ordinal.lean b/LeanPool/FormalLearningTheory/Complexity/Ordinal.lean index 3cebadc4e5..83c6662698 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Ordinal.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Ordinal.lean @@ -22,7 +22,7 @@ The embedding ℕ∞ ↪ Ordinal sends n ↦ n and ⊤ ↦ ω, but ordinal VC di can take values beyond ω. -/ -@[expose] public section +public section universe u v @@ -60,6 +60,7 @@ structure VCLTree (X : Type u) where conceptClass : ConceptClass X Bool /-- Ordinal VC dimension: extends VCdim to ordinal values. -/ +@[expose] noncomputable def OrdinalVCDim (X : Type u) (C : ConceptClass X Bool) : Ordinal := ⨆ (S : Finset X) (_ : Shatters X C S), ((S.card : ℕ) : Ordinal) diff --git a/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean b/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean index 62e1fd67bc..a22765163a 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean @@ -26,12 +26,12 @@ Upper bounded by VC dimension. Bridges to lean-rademacher library (K₂). - `vcdim_finite_imp_rademacher_vanishing` : VCDim < ⊤ → Rad → 0 -/ -@[expose] public section +public section universe u v /-- Convert Bool labels to ±1 reals. true ↦ 1, false ↦ -1. -/ -noncomputable def boolToSign (b : Bool) : ℝ := if b then 1 else -1 +@[expose] noncomputable def boolToSign (b : Bool) : ℝ := if b then 1 else -1 theorem boolToSign_abs_eq_one (b : Bool) : |boolToSign b| = 1 := by unfold boolToSign; cases b <;> simp diff --git a/LeanPool/FormalLearningTheory/Complexity/Structures.lean b/LeanPool/FormalLearningTheory/Complexity/Structures.lean index 1946b0d2db..03ab0505b9 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Structures.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Structures.lean @@ -17,7 +17,7 @@ real-valued dimensions, teaching/eluder dimensions, SQ dimension, KL complexity, margin theory, covering numbers. -/ -@[expose] public section +public section universe u v @@ -154,7 +154,7 @@ noncomputable def FatShatteringDim (X : Type u) (C : ConceptClass X ℝ) pairwise small correlations under D. Captures the hardness of learning C using only statistical queries (expected values of functions of the sample). M-DefinitionRepair: added distribution parameter D (originally missing). -/ -noncomputable def SQDimension (X : Type u) [MeasurableSpace X] +@[expose] noncomputable def SQDimension (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) (D : MeasureTheory.Measure X) (τ : ℝ) : WithTop ℕ := ⨆ (S : Finset (Concept X Bool)) (_ : ↑S ⊆ C ∧ ∀ c₁ ∈ S, ∀ c₂ ∈ S, c₁ ≠ c₂ → @@ -250,7 +250,7 @@ attribute [instance] CompressionSchemeWithInfo.infoFinite kernel size + number of side information states. (The paper uses k + log₂(|I|+1); we use the simpler k + |I| which is an upper bound and avoids importing Real.log.) -/ -noncomputable def CompressionSchemeWithInfo.size +@[expose] noncomputable def CompressionSchemeWithInfo.size {X : Type u} {Y : Type v} {C : ConceptClass X Y} (cs : CompressionSchemeWithInfo X Y C) : ℕ := cs.kernelSize + Fintype.card cs.Info diff --git a/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean b/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean index 9c0cb89a2f..eeb0ed20d8 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean @@ -38,7 +38,7 @@ NOT the relaxed iid Rademacher approach. This is the structurally correct argume that avoids introducing unnecessary independence assumptions. -/ -@[expose] public section +public section universe u v @@ -704,7 +704,7 @@ theorem finite_exchangeability_bound /-- A concept class is well-behaved if the ghost gap event is null-measurable. This is the minimal regularity assumption for the symmetrization proof. -/ -def WellBehavedVC (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : Prop := +@[expose] def WellBehavedVC (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : Prop := ∀ (D : MeasureTheory.Measure X) [MeasureTheory.IsProbabilityMeasure D] (c : Concept X Bool) (m : ℕ) (ε : ℝ), MeasureTheory.NullMeasurableSet diff --git a/LeanPool/FormalLearningTheory/Complexity/VCDimension.lean b/LeanPool/FormalLearningTheory/Complexity/VCDimension.lean index f28440dcb8..be8c98e6b8 100644 --- a/LeanPool/FormalLearningTheory/Complexity/VCDimension.lean +++ b/LeanPool/FormalLearningTheory/Complexity/VCDimension.lean @@ -20,24 +20,24 @@ The foundational complexity measure for PAC learning. Bridges to Mathlib's `Finset.vcDim` via `Bridge.lean`. -/ -@[expose] public section +public section universe u v /-- A set S ⊆ X is shattered by concept class C if every labeling of S is realized by some concept in C. -/ -def Shatters (X : Type u) (C : ConceptClass X Bool) (S : Finset X) : Prop := +@[expose] def Shatters (X : Type u) (C : ConceptClass X Bool) (S : Finset X) : Prop := ∀ f : S → Bool, ∃ c ∈ C, ∀ x : S, c (x : X) = f x /-- VC dimension of a concept class: the size of the largest shattered set. Returns ℕ∞ = WithTop ℕ. -/ -noncomputable def VCDim (X : Type u) (C : ConceptClass X Bool) : WithTop ℕ := +@[expose] noncomputable def VCDim (X : Type u) (C : ConceptClass X Bool) : WithTop ℕ := ⨆ (S : Finset X) (_ : Shatters X C S), (S.card : WithTop ℕ) /-- Growth function (shattering coefficient): π_C(m) = max_{|S|=m} |{c|_S : c ∈ C}|. For each m-element set S, counts the number of distinct restrictions of C to S, then takes the supremum over all such S. -/ -noncomputable def GrowthFunction (X : Type u) +@[expose] noncomputable def GrowthFunction (X : Type u) (C : ConceptClass X Bool) : ℕ → ℕ := fun m => sSup (Set.range fun (S : { S : Finset X // S.card = m }) => ({ f : ↥S.val → Bool | ∃ c ∈ C, ∀ x : ↥S.val, c ↑x = f x } : Set (↥S.val → Bool)).ncard) diff --git a/LeanPool/FormalLearningTheory/Computation.lean b/LeanPool/FormalLearningTheory/Computation.lean index 54c4d8d170..7565c1a863 100644 --- a/LeanPool/FormalLearningTheory/Computation.lean +++ b/LeanPool/FormalLearningTheory/Computation.lean @@ -26,7 +26,7 @@ Computability-theoretic substrate for Gold-style learning theory. Contains: - Execution traces for program synthesis -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Criterion.lean b/LeanPool/FormalLearningTheory/Criterion.lean index 6d9a6928f7..c0aea33f3d 100644 --- a/LeanPool/FormalLearningTheory/Criterion.lean +++ b/LeanPool/FormalLearningTheory/Criterion.lean @@ -16,4 +16,4 @@ public import LeanPool.FormalLearningTheory.Criterion.Extended Imported Lean Pool material for `LeanPool.FormalLearningTheory.Criterion`. -/ -@[expose] public section +public section diff --git a/LeanPool/FormalLearningTheory/Criterion/Extended.lean b/LeanPool/FormalLearningTheory/Criterion/Extended.lean index dd7bca96bd..3dce76cc1a 100644 --- a/LeanPool/FormalLearningTheory/Criterion/Extended.lean +++ b/LeanPool/FormalLearningTheory/Criterion/Extended.lean @@ -18,7 +18,7 @@ EX under drift, universal learning, Bayesian criteria (posterior consistency, PAC-Bayes, information-theoretic bounds). -/ -@[expose] public section +public section universe u v @@ -46,6 +46,7 @@ def EXUnderDrift (X : Type u) (C : ConceptClass X Bool) over D^m, the learner's error is at most rate(m). Γ₄₈ fix: changed from existential Dm to Measure.pi (CNA₁₁ definition repair). -/ +@[expose] def UniversalLearnable (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : Prop := ∃ (L : BatchLearner X Bool) (rate : ℕ → ℝ), diff --git a/LeanPool/FormalLearningTheory/Criterion/Gold.lean b/LeanPool/FormalLearningTheory/Criterion/Gold.lean index 0a447ee4a9..3ea1b39ae7 100644 --- a/LeanPool/FormalLearningTheory/Criterion/Gold.lean +++ b/LeanPool/FormalLearningTheory/Criterion/Gold.lean @@ -20,17 +20,18 @@ All share the quantifier pattern: The variation is in what "..." requires. -/ -@[expose] public section +public section universe u v /-- Helper: the data seen up to time t from a data stream. -/ -def dataUpTo {X : Type u} {Y : Type v} (T : DataStream X Y) (t : ℕ) : List (X × Y) := +@[expose] def dataUpTo {X : Type u} {Y : Type v} (T : DataStream X Y) (t : ℕ) : List (X × Y) := (List.range (t + 1)).map T.observe /-- EX-learning (explanatory learning, identification in the limit): The learner eventually converges to a hypothesis extensionally equal to c. Gold's original definition (1967). -/ +@[expose] def EXLearnable (X : Type u) (C : ConceptClass X Bool) : Prop := ∃ (L : GoldLearner X Bool), ∀ (c : Concept X Bool), c ∈ C → @@ -49,6 +50,7 @@ def BCLearnable (X : Type u) (C : ConceptClass X Bool) : Prop := /-- Finite learning: EX-learning where the learner makes at most finitely many mind changes and eventually outputs a CORRECT hypothesis. Stronger than EX. -/ +@[expose] def FiniteLearnable (X : Type u) (C : ConceptClass X Bool) : Prop := ∃ (L : GoldLearner X Bool), ∀ (c : Concept X Bool), c ∈ C → diff --git a/LeanPool/FormalLearningTheory/Criterion/Online.lean b/LeanPool/FormalLearningTheory/Criterion/Online.lean index 84f6141ed4..40dd116c91 100644 --- a/LeanPool/FormalLearningTheory/Criterion/Online.lean +++ b/LeanPool/FormalLearningTheory/Criterion/Online.lean @@ -18,12 +18,12 @@ Mistake-bounded learning, online learnability, and regret bounds. Characterized by Littlestone dimension. -/ -@[expose] public section +public section universe u v /-- Count mistakes from an arbitrary online-learner state. -/ -noncomputable def OnlineLearner.mistakesFrom {X : Type u} {Y : Type v} [DecidableEq Y] +@[expose] noncomputable def OnlineLearner.mistakesFrom {X : Type u} {Y : Type v} [DecidableEq Y] (L : OnlineLearner X Y) (state : L.State) (c : Concept X Y) : List X → ℕ | [] => 0 | x :: xs => @@ -31,12 +31,13 @@ noncomputable def OnlineLearner.mistakesFrom {X : Type u} {Y : Type v} [Decidabl L.mistakesFrom (L.update state x (c x)) c xs /-- Helper: run an online learner on a sequence, counting mistakes. -/ -noncomputable def OnlineLearner.mistakes {X : Type u} {Y : Type v} [DecidableEq Y] +@[expose] noncomputable def OnlineLearner.mistakes {X : Type u} {Y : Type v} [DecidableEq Y] (L : OnlineLearner X Y) (c : Concept X Y) (seq : List X) : ℕ := L.mistakesFrom L.init c seq /-- Mistake-bounded learning: the learner makes at most M mistakes on ANY sequence. No distribution assumption. Characterized by Littlestone dimension. -/ +@[expose] def MistakeBounded (X : Type u) (Y : Type v) [DecidableEq Y] (C : ConceptClass X Y) (M : ℕ) : Prop := ∃ (L : OnlineLearner X Y), @@ -44,6 +45,7 @@ def MistakeBounded (X : Type u) (Y : Type v) [DecidableEq Y] ∀ (seq : List X), L.mistakes c seq ≤ M /-- Online learnable: there exists a finite mistake bound. -/ +@[expose] def OnlineLearnable (X : Type u) (Y : Type v) [DecidableEq Y] (C : ConceptClass X Y) : Prop := ∃ (M : ℕ), MistakeBounded X Y C M diff --git a/LeanPool/FormalLearningTheory/Criterion/PAC.lean b/LeanPool/FormalLearningTheory/Criterion/PAC.lean index 1681f7882d..7582049fba 100644 --- a/LeanPool/FormalLearningTheory/Criterion/PAC.lean +++ b/LeanPool/FormalLearningTheory/Criterion/PAC.lean @@ -43,7 +43,7 @@ function xs ↦ D{x | L(S(xs)) x ≠ c x} to be measurable - a deep technical condition that specific proofs (Hoeffding, Sauer-Shelah) will establish. -/ -@[expose] public section +public section universe u v @@ -53,6 +53,7 @@ universe u v Sample space: Fin m → X with i.i.d. product measure D^m. Labels: derived deterministically from target concept c (realizable case). Error: D-probability of disagreement between learner output and c. -/ +@[expose] def PACLearnable (X : Type u) [MeasurableSpace X] (C : ConceptClass X Bool) : Prop := ∃ (L : BatchLearner X Bool) (mf : ℝ → ℝ → ℕ), diff --git a/LeanPool/FormalLearningTheory/Data.lean b/LeanPool/FormalLearningTheory/Data.lean index 9d5237b02f..b7c47796ff 100644 --- a/LeanPool/FormalLearningTheory/Data.lean +++ b/LeanPool/FormalLearningTheory/Data.lean @@ -24,7 +24,7 @@ Also includes query-learning interfaces (MembershipOracle, EquivalenceOracle), noisy data, and advice. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Learner.lean b/LeanPool/FormalLearningTheory/Learner.lean index f74ef6d209..b2799bc38f 100644 --- a/LeanPool/FormalLearningTheory/Learner.lean +++ b/LeanPool/FormalLearningTheory/Learner.lean @@ -16,4 +16,4 @@ public import LeanPool.FormalLearningTheory.Learner.Bayesian Imported Lean Pool material for `LeanPool.FormalLearningTheory.Learner`. -/ -@[expose] public section +public section diff --git a/LeanPool/FormalLearningTheory/Learner/Active.lean b/LeanPool/FormalLearningTheory/Learner/Active.lean index 3234f24ec2..548f8ea505 100644 --- a/LeanPool/FormalLearningTheory/Learner/Active.lean +++ b/LeanPool/FormalLearningTheory/Learner/Active.lean @@ -16,7 +16,7 @@ Meta-learners learn to learn. Also includes synthesizers and verifiers for the CEGIS paradigm. -/ -@[expose] public section +public section universe u v @@ -125,6 +125,7 @@ structure LLMCritic (X : Type u) (Y : Type v) extends Teacher X Y where critiqueQuality : ℝ /-- A synthesizer: produces candidate concepts from specifications. -/ +@[expose] def Synthesizer (X : Type u) (Y : Type v) := List (X × Y) → Concept X Y /-- A verifier: checks whether a candidate concept satisfies a specification. -/ diff --git a/LeanPool/FormalLearningTheory/Learner/Bayesian.lean b/LeanPool/FormalLearningTheory/Learner/Bayesian.lean index 279881d481..3d13c254d4 100644 --- a/LeanPool/FormalLearningTheory/Learner/Bayesian.lean +++ b/LeanPool/FormalLearningTheory/Learner/Bayesian.lean @@ -20,7 +20,7 @@ BayesianLearner extends BatchLearner with Bayesian inference machinery. GibbsPosterior adds temperature for PAC-Bayes optimization. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Learner/Closure.lean b/LeanPool/FormalLearningTheory/Learner/Closure.lean index 9e08cbfa69..c23ce2947e 100644 --- a/LeanPool/FormalLearningTheory/Learner/Closure.lean +++ b/LeanPool/FormalLearningTheory/Learner/Closure.lean @@ -19,7 +19,7 @@ The algebra of `MeasurableBatchLearner`s is closed under: -/ -@[expose] public section +public section universe u @@ -149,6 +149,7 @@ hypothesis space is the union of the component spaces. No measurability requirem `sel` is imposed at the definition level; the accompanying `measurableBatchLearner_concat` theorem adds that hypothesis to derive closure under the uniform-measurable family. The construction underlying the monadic `bind`. -/ +@[expose] noncomputable def concatLearner {X : Type u} (L : ℕ → BatchLearner X Bool) diff --git a/LeanPool/FormalLearningTheory/Learner/Core.lean b/LeanPool/FormalLearningTheory/Learner/Core.lean index be30ffafe4..ede54b1f71 100644 --- a/LeanPool/FormalLearningTheory/Learner/Core.lean +++ b/LeanPool/FormalLearningTheory/Learner/Core.lean @@ -28,7 +28,7 @@ This is intentional: a common parent would erase the structural properties that make each paradigm's theorems non-trivial. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Learner/Monad.lean b/LeanPool/FormalLearningTheory/Learner/Monad.lean index 62a4699211..c45208b0da 100644 --- a/LeanPool/FormalLearningTheory/Learner/Monad.lean +++ b/LeanPool/FormalLearningTheory/Learner/Monad.lean @@ -21,7 +21,7 @@ lives in the pure math layer. This file adds the measurability certificate. - Monad laws: inherited from ReaderSel, verified at evaluation level -/ -@[expose] public section +public section universe u diff --git a/LeanPool/FormalLearningTheory/Learner/Properties.lean b/LeanPool/FormalLearningTheory/Learner/Properties.lean index 9023d61cb1..a83481489e 100644 --- a/LeanPool/FormalLearningTheory/Learner/Properties.lean +++ b/LeanPool/FormalLearningTheory/Learner/Properties.lean @@ -19,7 +19,7 @@ conservative, passive. These are `Prop` predicates, not separate types. Also includes probabilistic and team learner variants. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Learner/VersionSpace.lean b/LeanPool/FormalLearningTheory/Learner/VersionSpace.lean index fc0e6d635a..523e7dee2f 100644 --- a/LeanPool/FormalLearningTheory/Learner/VersionSpace.lean +++ b/LeanPool/FormalLearningTheory/Learner/VersionSpace.lean @@ -40,7 +40,7 @@ Measurability follows from `measurable_to_countable'` (Mathlib). the countable restriction) -/ -@[expose] public section +public section universe u @@ -49,6 +49,7 @@ open MeasureTheory Set /-! ## Definitions -/ /-- Consistency: hypothesis h predicts correctly on every example in sample S. -/ +@[expose] def IsSampleConsistent {X : Type u} (h : Concept X Bool) {m : ℕ} (S : Fin m → X × Bool) : Prop := ∀ i, h (S i).1 = (S i).2 diff --git a/LeanPool/FormalLearningTheory/Process.lean b/LeanPool/FormalLearningTheory/Process.lean index 0283047eab..b61d026026 100644 --- a/LeanPool/FormalLearningTheory/Process.lean +++ b/LeanPool/FormalLearningTheory/Process.lean @@ -23,7 +23,7 @@ Concrete learning processes, algorithms, and scope boundaries: - Granger causality (causal inference connection) -/ -@[expose] public section +public section universe u v @@ -107,6 +107,7 @@ structure LifelongLearning (X : Type u) (Y : Type v) where /-- Background knowledge: domain-specific information that guides learning. In ILP: a set of known rules/facts that constrain the hypothesis space. Analogous to advice. -/ +@[expose] def BackgroundKnowledge (B : Type*) := B /-- Inductive Logic Programming: learning first-order logic programs diff --git a/LeanPool/FormalLearningTheory/PureMath/AnalyticMeasurability.lean b/LeanPool/FormalLearningTheory/PureMath/AnalyticMeasurability.lean index 8d090c6c5d..3498e66510 100644 --- a/LeanPool/FormalLearningTheory/PureMath/AnalyticMeasurability.lean +++ b/LeanPool/FormalLearningTheory/PureMath/AnalyticMeasurability.lean @@ -21,7 +21,7 @@ This file is independent of learning theory and is a candidate for contribution - `analyticSet_nullMeasurableSet`: analytic sets are null-measurable for finite Borel measures -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/FormalLearningTheory/PureMath/ApproxMinimax.lean b/LeanPool/FormalLearningTheory/PureMath/ApproxMinimax.lean index bb2ab4f9da..007ae2d27c 100644 --- a/LeanPool/FormalLearningTheory/PureMath/ApproxMinimax.lean +++ b/LeanPool/FormalLearningTheory/PureMath/ApproxMinimax.lean @@ -35,7 +35,7 @@ utilities, payoff analysis, covering arguments, and MWU potential bounds. - Arora, Hazan, Kale, "The Multiplicative Weights Update Method", ToC 8(1), 2012 -/ -@[expose] public section +public section open Finset @@ -56,7 +56,7 @@ def normalizeToPMF {C : Type*} [Fintype C] [Nonempty C] lemma normalizeToPMF_prob {C : Type*} [Fintype C] [Nonempty C] (w : C → ℝ) (hw : ∀ c, 0 < w c) (c : C) : - (normalizeToPMF w hw).prob c = w c / ∑ c' : C, w c' := rfl + (normalizeToPMF w hw).prob c = w c / ∑ c' : C, w c' := by rfl /-- Point mass PMF at a single element. -/ def pointMassPMF {C : Type*} [Fintype C] [DecidableEq C] (c₀ : C) : @@ -84,10 +84,15 @@ def empiricalPMF {α : Type*} [Fintype α] [DecidableEq α] (fun t _ => mem_univ (rs t)) simp_all +/-- The probability assigned by an empirical distribution is its sample frequency. -/ +lemma empiricalPMF_prob {α : Type*} [Fintype α] [DecidableEq α] + {T : ℕ} (hT : 0 < T) (rs : Fin T → α) (a : α) : + (empiricalPMF hT rs).prob a = (univ.filter (fun t => rs t = a)).card / (T : ℝ) := by rfl + /-! ## Boolean Game Payoff -/ /-- Expected payoff of distribution p against column c in a Boolean game. -/ -def boolGamePayoff {R C : Type*} [Fintype R] +@[expose] def boolGamePayoff {R C : Type*} [Fintype R] (M : R → C → Bool) (p : FinitePMF R) (c : C) : ℝ := ∑ r : R, p.prob r * (if M r c then (1 : ℝ) else 0) diff --git a/LeanPool/FormalLearningTheory/PureMath/BinaryMatrix.lean b/LeanPool/FormalLearningTheory/PureMath/BinaryMatrix.lean index 7e8da9f6d3..a1e649a73e 100644 --- a/LeanPool/FormalLearningTheory/PureMath/BinaryMatrix.lean +++ b/LeanPool/FormalLearningTheory/PureMath/BinaryMatrix.lean @@ -16,7 +16,7 @@ Pure combinatorics: VC dimension on binary matrices, bridged to Mathlib's `Finset.Shatters` infrastructure. No learning theory types. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/FormalLearningTheory/PureMath/ChoquetCapacity.lean b/LeanPool/FormalLearningTheory/PureMath/ChoquetCapacity.lean index d2ddbf6168..6020a14d24 100644 --- a/LeanPool/FormalLearningTheory/PureMath/ChoquetCapacity.lean +++ b/LeanPool/FormalLearningTheory/PureMath/ChoquetCapacity.lean @@ -29,7 +29,7 @@ This file is independent of learning theory and is a candidate for contribution - Kechris, "Classical Descriptive Set Theory", Theorem 30.13 -/ -@[expose] public section +public section universe u @@ -40,6 +40,7 @@ open MeasureTheory Set Filter Topology /-- Compact capacity of a set `s` relative to a measure `μ`: the supremum of `μ K` over compact subsets `K ⊆ s`. The inner-regularity functional whose equality with `μ s` characterises measurability for analytic sets. -/ +@[expose] noncomputable def MeasureTheory.compactCap {α : Type*} [TopologicalSpace α] [MeasurableSpace α] (μ : MeasureTheory.Measure α) (s : Set α) : ENNReal := diff --git a/LeanPool/FormalLearningTheory/PureMath/Concentration.lean b/LeanPool/FormalLearningTheory/PureMath/Concentration.lean index a84e1eaa7c..c61a4130a0 100644 --- a/LeanPool/FormalLearningTheory/PureMath/Concentration.lean +++ b/LeanPool/FormalLearningTheory/PureMath/Concentration.lean @@ -29,7 +29,7 @@ No learning-theory types. - Boucheron, Lugosi, Massart, "Concentration Inequalities", Chapter 2 -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/FormalLearningTheory/PureMath/Exchangeability.lean b/LeanPool/FormalLearningTheory/PureMath/Exchangeability.lean index 9409e4d5de..449e4c02b6 100644 --- a/LeanPool/FormalLearningTheory/PureMath/Exchangeability.lean +++ b/LeanPool/FormalLearningTheory/PureMath/Exchangeability.lean @@ -30,7 +30,7 @@ valid splits, and split measures. No learning-theory types. - Kakade & Tewari, Lecture 19: Symmetrization -/ -@[expose] public section +public section universe u diff --git a/LeanPool/FormalLearningTheory/PureMath/FiniteVCApprox.lean b/LeanPool/FormalLearningTheory/PureMath/FiniteVCApprox.lean index 76c48db497..a746d19cd5 100644 --- a/LeanPool/FormalLearningTheory/PureMath/FiniteVCApprox.lean +++ b/LeanPool/FormalLearningTheory/PureMath/FiniteVCApprox.lean @@ -22,7 +22,7 @@ finite samples. - `boolFamilyToFinsetFamily` / `Finset.boolVCDim` : VC dimension for Boolean function families -/ -@[expose] public section +public section open Finset @@ -33,7 +33,7 @@ noncomputable section /-- Expected value `∑ h, μ.prob h * f h` of a real-valued test under a finitely supported distribution. The base expectation primitive of the approximation layer; specialised to indicator tests in `boolTestExpectation`. -/ -def trueExpectation {H : Type*} [Fintype H] +@[expose] def trueExpectation {H : Type*} [Fintype H] (μ : FinitePMF H) (f : H → ℝ) : ℝ := ∑ h : H, μ.prob h * f h @@ -41,7 +41,7 @@ def trueExpectation {H : Type*} [Fintype H] indicator embedding `if f h then 1 else 0`. The central quantity of the finite-VC approximation layer: a TV bound on distributions translates to a uniform bound on test expectations via `expectation_approx_of_tv`. -/ -def boolTestExpectation {H : Type*} [Fintype H] +@[expose] def boolTestExpectation {H : Type*} [Fintype H] (μ : FinitePMF H) (f : H → Bool) : ℝ := trueExpectation μ (fun h => if f h then (1 : ℝ) else 0) @@ -143,7 +143,7 @@ lemma boolTestExpectation_empirical_eq_avg {T : ℕ} (hT : 0 < T) (hs : Fin T → H) (f : H → Bool) : boolTestExpectation (empiricalPMF hT hs) f = (∑ t : Fin T, if f (hs t) then (1 : ℝ) else 0) / T := by - simp only [boolTestExpectation, trueExpectation, empiricalPMF] + simp only [boolTestExpectation, trueExpectation, empiricalPMF_prob] conv_lhs => arg 2; ext h; rw [div_mul_eq_mul_div] rw [← Finset.sum_div] congr 1 @@ -182,14 +182,14 @@ lemma boolGamePayoff_eq_boolTestExpectation accepting sets. The set-system view is what Mathlib's `Finset.Shatters` and `Finset.vcDim` consume, so this is the entry point from the function-class view to the combinatorial VC machinery. -/ -def boolFamilyToFinsetFamily {H : Type*} [Fintype H] [DecidableEq H] +@[expose] def boolFamilyToFinsetFamily {H : Type*} [Fintype H] [DecidableEq H] (A : Finset (H → Bool)) : Finset (Finset H) := A.image (fun f => Finset.univ.filter (fun h => f h = true)) /-- VC dimension of a finite `Bool`-valued family, computed via the set-system image `boolFamilyToFinsetFamily` and Mathlib's `Finset.vcDim`. Declared `noncomputable` because the underlying `vcDim` is. -/ -noncomputable def Finset.boolVCDim {H : Type*} [Fintype H] [DecidableEq H] +@[expose] noncomputable def Finset.boolVCDim {H : Type*} [Fintype H] [DecidableEq H] (A : Finset (H → Bool)) : ℕ := (boolFamilyToFinsetFamily A).vcDim diff --git a/LeanPool/FormalLearningTheory/PureMath/KLDivergence.lean b/LeanPool/FormalLearningTheory/PureMath/KLDivergence.lean index 10a7f78ae2..ff9b06ca72 100644 --- a/LeanPool/FormalLearningTheory/PureMath/KLDivergence.lean +++ b/LeanPool/FormalLearningTheory/PureMath/KLDivergence.lean @@ -26,7 +26,7 @@ KL divergence, cross-entropy, and expected values. No learning-theory types. - Cover & Thomas, "Elements of Information Theory", Chapter 2 -/ -@[expose] public section +public section open Finset @@ -48,13 +48,13 @@ noncomputable def klDivFinitePMF {H : Type*} [Fintype H] /-- Cross-entropy: ∑_h Q(h) · log(1/P(h)). Equals KL(Q‖P) + H(Q) where H(Q) is Shannon entropy. -/ -noncomputable def crossEntropyFinitePMF {H : Type*} [Fintype H] +@[expose] noncomputable def crossEntropyFinitePMF {H : Type*} [Fintype H] (Q P : FinitePMF H) : ℝ := ∑ h : H, if Q.prob h = 0 then 0 else Q.prob h * Real.log (1 / P.prob h) /-- Expected value of a real-valued function under a FinitePMF. -/ -noncomputable def expectFinitePMF {H : Type*} [Fintype H] +@[expose] noncomputable def expectFinitePMF {H : Type*} [Fintype H] (Q : FinitePMF H) (f : H → ℝ) : ℝ := ∑ h : H, Q.prob h * f h diff --git a/LeanPool/FormalLearningTheory/PureMath/ReaderMonad.lean b/LeanPool/FormalLearningTheory/PureMath/ReaderMonad.lean index c1bc0383d9..105ec1e8c7 100644 --- a/LeanPool/FormalLearningTheory/PureMath/ReaderMonad.lean +++ b/LeanPool/FormalLearningTheory/PureMath/ReaderMonad.lean @@ -15,7 +15,7 @@ The three monad laws hold definitionally (by `rfl`). This structure underlies MeasurableBatchLearner composition in the learning theory layer, but the monad itself is pure mathematics with zero dependencies. --/@[expose] public section +-/public section universe u v w @@ -49,15 +49,15 @@ def ReaderSel.bind {ι : Type u} {α : Type v} {γ : Type w} theorem ReaderSel.left_unit {ι : Type u} {α : Type v} {γ : Type w} (i₀ : ι) (f : α → γ) (g : γ → ReaderSel ι α γ) (a : α) : - (ReaderSel.pure i₀ f |>.bind g).eval a = (g (f a)).eval a := rfl + (ReaderSel.pure i₀ f |>.bind g).eval a = (g (f a)).eval a := by rfl /-- Right unit: bind r (fun v => pure (const v)) a = r.eval a -/ theorem ReaderSel.right_unit {ι : Type u} {α : Type v} {γ : Type w} (r : ReaderSel ι α γ) (i₀ : ι) (a : α) : - (r.bind (fun v => ReaderSel.pure i₀ (fun _ => v))).eval a = r.eval a := rfl + (r.bind (fun v => ReaderSel.pure i₀ (fun _ => v))).eval a = r.eval a := by rfl /-- Associativity: bind (bind r f) g = bind r (fun v => bind (f v) g) -/ theorem ReaderSel.assoc {ι : Type u} {α : Type v} {γ : Type w} (r : ReaderSel ι α γ) (f : γ → ReaderSel ι α γ) (g : γ → ReaderSel ι α γ) (a : α) : - ((r.bind f).bind g).eval a = (r.bind (fun v => (f v).bind g)).eval a := rfl + ((r.bind f).bind g).eval a = (r.bind (fun v => (f v).bind g)).eval a := by rfl diff --git a/LeanPool/FormalLearningTheory/Theorem.lean b/LeanPool/FormalLearningTheory/Theorem.lean index 17c6631af4..8607fa968d 100644 --- a/LeanPool/FormalLearningTheory/Theorem.lean +++ b/LeanPool/FormalLearningTheory/Theorem.lean @@ -19,4 +19,4 @@ import Mathlib.MeasureTheory.Covering.Besicovitch Imported Lean Pool material for `LeanPool.FormalLearningTheory.Theorem`. -/ -@[expose] public section +public section diff --git a/LeanPool/FormalLearningTheory/Theorem/BorelAnalyticSeparation.lean b/LeanPool/FormalLearningTheory/Theorem/BorelAnalyticSeparation.lean index 5c13bcc1b3..65c1786d0d 100644 --- a/LeanPool/FormalLearningTheory/Theorem/BorelAnalyticSeparation.lean +++ b/LeanPool/FormalLearningTheory/Theorem/BorelAnalyticSeparation.lean @@ -27,7 +27,7 @@ KrappWirthWellBehaved (MeasurableSet/Borel). - `singleton_badEvent_not_measurable`: the sample-space bad event is NOT Borel -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/FormalLearningTheory/Theorem/Extended.lean b/LeanPool/FormalLearningTheory/Theorem/Extended.lean index 153ae4a540..5023393705 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Extended.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Extended.lean @@ -19,7 +19,7 @@ Advice reduction, meta-learning lower-bound infrastructure, and separation results for compression and SQ dimension. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Theorem/Gold.lean b/LeanPool/FormalLearningTheory/Theorem/Gold.lean index d746268544..984305863e 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Gold.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Gold.lean @@ -15,7 +15,7 @@ import Mathlib.SetTheory.Ordinal.Arithmetic The foundational results of inductive inference theory. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Theorem/Online.lean b/LeanPool/FormalLearningTheory/Theorem/Online.lean index 1b5a07029b..5f38772c28 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Online.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Online.lean @@ -22,7 +22,7 @@ Main results: - `optimal_mistake_bound_eq_ldim`: OptimalMistakeBound = LittlestoneDim (for nonempty C) -/ -@[expose] public section +public section -- ============================================================ -- FORWARD DIRECTION: OnlineLearnable → LittlestoneDim < ⊤ diff --git a/LeanPool/FormalLearningTheory/Theorem/PAC.lean b/LeanPool/FormalLearningTheory/Theorem/PAC.lean index e4d39be6f1..ba32a5769d 100644 --- a/LeanPool/FormalLearningTheory/Theorem/PAC.lean +++ b/LeanPool/FormalLearningTheory/Theorem/PAC.lean @@ -46,7 +46,7 @@ construction: if VCDim = ∞, construct a distribution D where any learner fails with probability > δ for some ε. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/FormalLearningTheory/Theorem/PACBayes.lean b/LeanPool/FormalLearningTheory/Theorem/PACBayes.lean index 1b53e97fb0..1d65e689c7 100644 --- a/LeanPool/FormalLearningTheory/Theorem/PACBayes.lean +++ b/LeanPool/FormalLearningTheory/Theorem/PACBayes.lean @@ -32,7 +32,7 @@ plus a complexity term involving KL(Q‖P). - McAllester, "Simplified PAC-Bayesian Margin Bounds", COLT 2003 -/ -@[expose] public section +public section universe u diff --git a/LeanPool/FormalLearningTheory/Theorem/Separation.lean b/LeanPool/FormalLearningTheory/Theorem/Separation.lean index 70d300ce74..304da0d784 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Separation.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Separation.lean @@ -22,7 +22,7 @@ These prove that the paradigms are genuinely different — the criteria do NOT imply each other. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/FormalizationOfBoundedArithmetic.lean b/LeanPool/FormalizationOfBoundedArithmetic.lean index b4fb4a1867..d8f2f3b9d1 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic.lean @@ -38,4 +38,4 @@ Tags: logic, bounded-arithmetic, model-theory, computational-complexity MSC: 03F30, 03D15 -/ -@[expose] public section +public section diff --git a/LeanPool/FormalizationOfBoundedArithmetic/Algebra.lean b/LeanPool/FormalizationOfBoundedArithmetic/Algebra.lean index 6eec2db118..be1ef64e39 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/Algebra.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/Algebra.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.FormalizationOfBoundedArithmetic.Algebra -/ -@[expose] public section +public section -- INSTANCES! diff --git a/LeanPool/FormalizationOfBoundedArithmetic/AxiomSchemes.lean b/LeanPool/FormalizationOfBoundedArithmetic/AxiomSchemes.lean index a0089656bf..65059fe743 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/AxiomSchemes.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/AxiomSchemes.lean @@ -15,7 +15,7 @@ public import LeanPool.FormalizationOfBoundedArithmetic.Order # LeanPool.FormalizationOfBoundedArithmetic.AxiomSchemes -/ -@[expose] public section +public section open FirstOrder Language BoundedFormula Formula @@ -31,6 +31,7 @@ open FirstOrder Language BoundedFormula Formula -- expect 1 displayed free variable (`x`), thus DisplayedFV1 -- but we can have more free vars - we `forall` over them! /-- Build the universal closure of an induction axiom for a displayed variable. -/ +@[expose] def mkInductionSentence {a} [IsEnum a] {name} {L : Language} diff --git a/LeanPool/FormalizationOfBoundedArithmetic/BasicSingleSorted.lean b/LeanPool/FormalizationOfBoundedArithmetic/BasicSingleSorted.lean index d476be70d0..5dcc7f0e34 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/BasicSingleSorted.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/BasicSingleSorted.lean @@ -11,7 +11,7 @@ public import LeanPool.FormalizationOfBoundedArithmetic.LanguagePeano # LeanPool.FormalizationOfBoundedArithmetic.BasicSingleSorted -/ -@[expose] public section +public section open FirstOrder FirstOrder.Language @@ -65,6 +65,7 @@ class BASICModelExt (num : Type u) extends BASICModel num where variable {M} [BASICModel M] /-- Interpret natural-number literals in a BASIC model by iterating successor. -/ +@[expose] def natToM : Nat -> M | 0 => 0 | 1 => 1 diff --git a/LeanPool/FormalizationOfBoundedArithmetic/Complexity.lean b/LeanPool/FormalizationOfBoundedArithmetic/Complexity.lean index 4c4761dd5a..9a44935cf4 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/Complexity.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/Complexity.lean @@ -13,7 +13,7 @@ import LeanPool.FormalizationOfBoundedArithmetic.Register # LeanPool.FormalizationOfBoundedArithmetic.Complexity -/ -@[expose] public section +public section open FirstOrder Language diff --git a/LeanPool/FormalizationOfBoundedArithmetic/DisplayedVariables.lean b/LeanPool/FormalizationOfBoundedArithmetic/DisplayedVariables.lean index 97ba6674ba..4fe83f7081 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/DisplayedVariables.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/DisplayedVariables.lean @@ -15,7 +15,7 @@ import Std.Tactic.BVDecide.Normalize.Prop # LeanPool.FormalizationOfBoundedArithmetic.DisplayedVariables -/ -@[expose] public section +public section /-- Names used for displayed free variables in formulas. -/ inductive FvName | x | y | z | X @@ -140,15 +140,19 @@ variable {α : Type u} {L : FirstOrder.Language} /-- The selected variable named `X`. -/ @[delta0_simps] def X.name [h : HasVar .X α] := h.fv /-- The first-order term for the displayed variable named `x`. -/ -@[delta0_simps] def x {k} [h : HasVar .x α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv +@[expose, delta0_simps] +def x {k} [h : HasVar .x α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv /-- The first-order term for the displayed variable named `y`. -/ -@[delta0_simps] def y {k} [h : HasVar .y α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv +@[expose, delta0_simps] +def y {k} [h : HasVar .y α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv /-- The first-order term for the displayed variable named `z`. -/ -@[delta0_simps] def z {k} [h : HasVar .z α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv +@[expose, delta0_simps] +def z {k} [h : HasVar .z α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv /-- The first-order term for the displayed variable named `X`. -/ @[delta0_simps] def X {k} [h : HasVar .X α] : L.Term (α ⊕ Fin k) := L.var <| Sum.inl h.fv /-- Display a one-variable formula as a formula over an explicit sum context. -/ +@[expose] def FirstOrder.Language.Formula.display1 {n1 : FvName} (phi : L.Formula (Vars1 n1)) @@ -167,6 +171,7 @@ def FirstOrder.Language.Formula.display1 } /-- Display a two-variable formula by isolating the named left variable. -/ +@[expose] def FirstOrder.Language.Formula.display2 (name : FvName) {other : FvName} @@ -185,6 +190,7 @@ def FirstOrder.Language.Formula.display2 } /-- Display a three-variable formula by isolating the named left variable. -/ +@[expose] def FirstOrder.Language.Formula.display3 (name : FvName) {other1 other2 : FvName} @@ -207,6 +213,7 @@ def FirstOrder.Language.Formula.display3 } /-- Display a four-variable formula by isolating the named left variable. -/ +@[expose] def FirstOrder.Language.Formula.display4 (name : FvName) {o1 o2 o3 : FvName} @@ -231,6 +238,7 @@ def FirstOrder.Language.Formula.display4 } /-- Reassociate displayed variables from `x | (y,z)` to `(x,y) | z`. -/ +@[expose] def FirstOrder.Language.Formula.displaySwapleft {n1 n2 n3 : FvName} (phi : L.Formula (Vars1 n1 ⊕ Vars2 n2 n3)) @@ -260,6 +268,7 @@ def FirstOrder.Language.Formula.displaySwapleft } /-- Reassociate displayed variables from `x | (y,z)` to `(x | y) | z`. -/ +@[expose] def FirstOrder.Language.Formula.displaySwapleft' {n1 n2 n3 : FvName} (phi : L.Formula (Vars1 n1 ⊕ Vars2 n2 n3)) @@ -293,6 +302,7 @@ private lemma displayedVariablesDelimiter2 : True := by -- Vars2 .x .y -> Vars2 .y .x /-- Swap the two variables in a two-variable displayed formula. -/ +@[expose] def FirstOrder.Language.Formula.rotate21 {n1 n2 : FvName} (phi : L.Formula (Vars2 n1 n2)) @@ -313,6 +323,7 @@ def FirstOrder.Language.Formula.rotate21 -- Vars3 .x .y .z -> Vars3 .y .x. .z /-- Swap the first two variables in a three-variable displayed formula. -/ +@[expose] def FirstOrder.Language.Formula.rotate213 (n1 n2 n3 : FvName) (phi : L.Formula (Vars3 n1 n2 n3)) @@ -335,6 +346,7 @@ def FirstOrder.Language.Formula.rotate213 -- Vars3 .x .y .z -> Vars3 .y .x. .z /-- Rotate the variables in a three-variable displayed formula. -/ +@[expose] def FirstOrder.Language.Formula.rotate231 (n1 n2 n3 : FvName) (phi : L.Formula (Vars3 n1 n2 n3)) @@ -361,6 +373,7 @@ private lemma displayedVariablesDelimiter3 : True := by variable {β} /-- Flip the two sides of the free-variable sum in a bounded formula. -/ +@[expose] def FirstOrder.Language.BoundedFormula.flip {n} (phi : L.BoundedFormula (α ⊕ β) n) : L.BoundedFormula (β ⊕ α) n := phi.relabelEquiv { @@ -371,6 +384,7 @@ def FirstOrder.Language.BoundedFormula.flip {n} } /-- Flip the two sides of the free-variable sum in a formula. -/ +@[expose] def FirstOrder.Language.Formula.flip (phi : L.Formula (α ⊕ β)) : L.Formula (β ⊕ α) := phi.relabelEquiv { toFun := Sum.swap (α := α) (β := β) @@ -383,6 +397,7 @@ def FirstOrder.Language.Formula.flip (phi : L.Formula (α ⊕ β)) : L.Formula ( -- : phi.flip.Realize v <-> phi.Realize (v ∘ ) /-- Embed a formula into a sum context by putting all variables on the left. -/ +@[expose] def FirstOrder.Language.Formula.mkInl (phi : L.Formula α) : L.Formula (α ⊕ Empty) := phi.relabelEquiv { toFun := Sum.inl diff --git a/LeanPool/FormalizationOfBoundedArithmetic/IDelta0.lean b/LeanPool/FormalizationOfBoundedArithmetic/IDelta0.lean index 2b2eda6f5d..8814a3ec91 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/IDelta0.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/IDelta0.lean @@ -19,7 +19,7 @@ import Std.Tactic.BVDecide.Normalize.Prop # LeanPool.FormalizationOfBoundedArithmetic.IDelta0 -/ -@[expose] public section +public section open FirstOrder Language BoundedFormula diff --git a/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean b/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean index 994b425b25..2ab6a79f23 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean @@ -22,7 +22,7 @@ import Std.Tactic.BVDecide.Normalize.Prop # LeanPool.FormalizationOfBoundedArithmetic.IOPEN -/ -@[expose] public section +public section open FirstOrder Language BoundedFormula diff --git a/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean b/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean index 89474fea7a..812426b3f0 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean @@ -20,7 +20,7 @@ import Mathlib.Data.List.OfFn # LeanPool.FormalizationOfBoundedArithmetic.IsEnum -/ -@[expose] public section +public section open Lean Elab Parser Term Command diff --git a/LeanPool/FormalizationOfBoundedArithmetic/LanguagePeano.lean b/LeanPool/FormalizationOfBoundedArithmetic/LanguagePeano.lean index e0fe0d4903..b698492e33 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/LanguagePeano.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/LanguagePeano.lean @@ -13,7 +13,7 @@ import LeanPool.FormalizationOfBoundedArithmetic.Register # LeanPool.FormalizationOfBoundedArithmetic.LanguagePeano -/ -@[expose] public section +public section universe u v @@ -44,7 +44,7 @@ inductive PeanoRel : Nat -> Type* deriving DecidableEq /-- The first-order language of Peano arithmetic used by the formalization. -/ -def peano : Language := +@[expose] def peano : Language := { Functions := PeanoFunc, Relations := PeanoRel } @@ -77,7 +77,7 @@ instance : Language.IsOrdered peano where @[inherit_doc] scoped[FirstOrder.Language] infixl:89 " <' " => Term.lt /-- The not-equal relation of two terms as a bounded formula -/ -@[delta0_simps] +@[expose, delta0_simps] def _root_.FirstOrder.Term.neq {a : Type u} {n} {L : Language} (t1 t2 : L.Term (a ⊕ Fin n)) : L.BoundedFormula a n := @@ -105,6 +105,7 @@ instance {M} [h : Language.peano.Structure M] : LT M := ⟨fun x y => x <= y ∧ ¬ y <= x⟩ /-- Interpret natural-number literals in a structure for the Peano language. -/ +@[expose] def natToM {M} [h : Language.peano.Structure M] : Nat -> M | 0 => 0 | 1 => 1 diff --git a/LeanPool/FormalizationOfBoundedArithmetic/LanguageZambella.lean b/LeanPool/FormalizationOfBoundedArithmetic/LanguageZambella.lean index 5f3cf512be..4dfa558fa1 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/LanguageZambella.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/LanguageZambella.lean @@ -14,7 +14,7 @@ import LeanPool.FormalizationOfBoundedArithmetic.Register # LeanPool.FormalizationOfBoundedArithmetic.LanguageZambella -/ -@[expose] public section +public section universe u v u' @@ -43,7 +43,7 @@ inductive ZambellaRel : Nat -> Type u deriving DecidableEq /-- The two-sorted language for bounded arithmetic. -/ -def zambella : Language := +@[expose] def zambella : Language := { Functions := ZambellaFunc, Relations := ZambellaRel } @@ -189,6 +189,7 @@ lemma realize_leq_to_leq {M} [h : zambella.Structure M] {a} {env : a → M} namespace Term /-- Formula asserting that a term denotes a number. -/ +@[expose] def IsNum (t : zambella.Term (a ⊕ Fin 0)) : zambella.Formula a := Relations.boundedFormula₁ ZambellaRel.isnum t @@ -209,7 +210,7 @@ def _root_.FirstOrder.Term.in {a : Type u} {n} @[inherit_doc] scoped[FirstOrder.Language] infixl:88 " ∈' " => Term.in /-- The not-mem relation of two terms as a bounded formula -/ -@[delta0_simps] +@[expose, delta0_simps] def _root_.FirstOrder.Term.notin {a : Type u} {n} (t1 t2 : zambella.Term (a ⊕ (Fin n))) : zambella.BoundedFormula a n := ∼(t1 ∈' t2) diff --git a/LeanPool/FormalizationOfBoundedArithmetic/MathlibSimps.lean b/LeanPool/FormalizationOfBoundedArithmetic/MathlibSimps.lean index e2626a17c4..0426c776f7 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/MathlibSimps.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/MathlibSimps.lean @@ -17,7 +17,7 @@ import LeanPool.FormalizationOfBoundedArithmetic.Register # LeanPool.FormalizationOfBoundedArithmetic.MathlibSimps -/ -@[expose] public section +public section open Lean Elab Command diff --git a/LeanPool/FormalizationOfBoundedArithmetic/Order.lean b/LeanPool/FormalizationOfBoundedArithmetic/Order.lean index fcb63dc3e9..f83bd75bc6 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/Order.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/Order.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.FinCases # LeanPool.FormalizationOfBoundedArithmetic.Order -/ -@[expose] public section +public section namespace FirstOrder.Language.Formula @@ -28,13 +28,13 @@ variable {n r} (a b : L.BoundedFormula n r) /-- Existential quantification bounded by a term. -/ -def iBdEx' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) +@[expose] def iBdEx' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) (φ : L.Formula (α ⊕ (Vars1 n))) : L.Formula α := let bd := (var (.inl (Sum.inr (.fv1)))).le <| bdTerm.relabel (Sum.map .inl id) iExs' <| bd ⊓ φ /-- Universal quantification bounded by a term. -/ -def iBdAll' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) +@[expose] def iBdAll' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) (φ : L.Formula (α ⊕ (Vars1 n))) : L.Formula α := let bd := (var (.inl (Sum.inr (.fv1)))).le <| bdTerm.relabel (Sum.map .inl id) iAlls' <| bd ⟹ φ @@ -42,7 +42,7 @@ def iBdAll' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) -- TODO: there should only be Lt constructors in Complexity -- and iBd should be an alias to iBdLt with term + 1 /-- Universal quantification bounded strictly by a term. -/ -def iBdAllLt' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) +@[expose] def iBdAllLt' {α n} (bdTerm : L.Term (α ⊕ Fin 0)) (φ : L.Formula (α ⊕ (Vars1 n))) : L.Formula α := let bd := (var (.inl (Sum.inr (.fv1)))).lt <| bdTerm.relabel (Sum.map .inl id) iAlls' <| bd ⟹ φ @@ -64,7 +64,7 @@ def iBdExStr' iBdEx' bdTerm <| (var <| Sum.inl <| Sum.inr <| .fv1).IsStr ⊓ φ /-- Universal quantification bounded by a term and guarded as numeric. -/ -def iBdAllNum' +@[expose] def iBdAllNum' {α n} (bdTerm : zambella.Term (α ⊕ Fin 0)) (φ : zambella.Formula (α ⊕ (Vars1 n))) diff --git a/LeanPool/FormalizationOfBoundedArithmetic/Register.lean b/LeanPool/FormalizationOfBoundedArithmetic/Register.lean index 7dbf849ab3..c54cf1b877 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/Register.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/Register.lean @@ -18,6 +18,6 @@ import Lean.Meta.Tactic.Simp.RegisterCommand Imported Lean Pool material for `LeanPool.FormalizationOfBoundedArithmetic.Register`. -/ -@[expose] public section +public section /-- Simp set used by the bounded-arithmetic import for formula normalization. -/ register_simp_attr delta0_simps diff --git a/LeanPool/FormalizationOfBoundedArithmetic/Semantics.lean b/LeanPool/FormalizationOfBoundedArithmetic/Semantics.lean index ea0dcad420..91eeb5807e 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/Semantics.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/Semantics.lean @@ -20,7 +20,7 @@ import LeanPool.FormalizationOfBoundedArithmetic.SimpRules # LeanPool.FormalizationOfBoundedArithmetic.Semantics -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/FormalizationOfBoundedArithmetic/SimpRules.lean b/LeanPool/FormalizationOfBoundedArithmetic/SimpRules.lean index 6e94be7fc9..ec1135b694 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/SimpRules.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/SimpRules.lean @@ -15,7 +15,7 @@ import Mathlib.Data.Rat.Floor # LeanPool.FormalizationOfBoundedArithmetic.SimpRules -/ -@[expose] public section +public section attribute [delta0_simps] Sum.elim_inl diff --git a/LeanPool/FormalizationOfBoundedArithmetic/Syntax.lean b/LeanPool/FormalizationOfBoundedArithmetic/Syntax.lean index 11b3addff7..aa22576d56 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/Syntax.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/Syntax.lean @@ -13,7 +13,7 @@ public import LeanPool.FormalizationOfBoundedArithmetic.IsEnum # LeanPool.FormalizationOfBoundedArithmetic.Syntax -/ -@[expose] public section +public section namespace FirstOrder namespace Language @@ -37,10 +37,12 @@ end BoundedFormula namespace Formula /-- Computable finite universal closure over an explicitly enumerated type. -/ +@[expose] def iAlls' [enum : IsEnum β] (φ : L.Formula (α ⊕ β)) : L.Formula α := (BoundedFormula.relabel (fun a => Sum.map id enum.toIdx a) φ).alls /-- Computable finite existential closure over an explicitly enumerated type. -/ +@[expose] def iExs' [enum : IsEnum β] (φ : L.Formula (α ⊕ β)) : L.Formula α := (BoundedFormula.relabel (fun a => Sum.map id enum.toIdx a) φ).exs diff --git a/LeanPool/FormalizationOfBoundedArithmetic/V0.lean b/LeanPool/FormalizationOfBoundedArithmetic/V0.lean index a01938552e..2bdf76d922 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/V0.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/V0.lean @@ -29,7 +29,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.FormalizationOfBoundedArithmetic.V0 -/ -@[expose] public section +public section open FirstOrder Language open HasTypesIs @@ -529,7 +529,7 @@ class HasSucc (α : Type*) where succ : α -> α /-- Carry predicate for binary string addition below position `i`. -/ -def Carry {num str} [V0Model num str] (i : num) (X Y : str) := +@[expose] def Carry {num str} [V0Model num str] (i : num) (X Y : str) := ∃ k < i, (k ∈ X ∧ k ∈ Y ∧ ∀ j < i, (k < j → (j ∈ X ∨ j ∈ Y))) /-- Extension of `V0` with string successor and string addition. -/ @@ -567,6 +567,7 @@ lemma len_empty : len (0 : str) = (0 : num) := by exact @not_lt_zero _ _ _ pred ((@ax_empty _ _ M pred).mp (L2 pred_eq)) /-- Majority predicate on three propositions. -/ +@[expose] def Maj (P Q R : Prop) := (P ∧ Q ∧ ¬ R) ∨ (P ∧ ¬ Q ∧ R) ∨ (¬ P ∧ Q ∧ R) ∨ (P ∧ Q ∧ R) diff --git a/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddAssoc.lean b/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddAssoc.lean index 2c8869c09b..1db83ac571 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddAssoc.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddAssoc.lean @@ -20,7 +20,7 @@ import Std.Tactic.BVDecide.Normalize.Prop # LeanPool.FormalizationOfBoundedArithmetic.V0StrAddAssoc -/ -@[expose] public section +public section variable {num str : Type} [M : V0ExtModel num str] open FirstOrder Language diff --git a/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddComm.lean b/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddComm.lean index d894867b5e..9f0afb16b6 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddComm.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/V0StrAddComm.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.FormalizationOfBoundedArithmetic.V0StrAddComm -/ -@[expose] public section +public section variable {num str : Type} [M : V0ExtModel num str] open FirstOrder Language diff --git a/LeanPool/FormalizationOfBoundedArithmetic/V0StrSuccAssoc.lean b/LeanPool/FormalizationOfBoundedArithmetic/V0StrSuccAssoc.lean index dddd248990..89e21a147d 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/V0StrSuccAssoc.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/V0StrSuccAssoc.lean @@ -14,7 +14,7 @@ import Std.Tactic.BVDecide.Normalize.Prop # LeanPool.FormalizationOfBoundedArithmetic.V0StrSuccAssoc -/ -@[expose] public section +public section -- This file proves: -- ∀ {X Y : str}, X + succ Y = succ (X + Y) diff --git a/LeanPool/FourAP/Basic.lean b/LeanPool/FourAP/Basic.lean index 833cf216a4..0ef0a3abef 100644 --- a/LeanPool/FourAP/Basic.lean +++ b/LeanPool/FourAP/Basic.lean @@ -21,13 +21,13 @@ together with `a ≠ b`, are equivalent to having a nonzero **integer** common difference. Thus decreasing progressions are included throughout. -/ -@[expose] public section +public section namespace FourAP /-- Four consecutive terms of a nonconstant arithmetic progression, as in the paper's main theorem. The equations avoid truncated subtraction in `ℕ`. -/ -def IsAP4 (a b c d : ℕ) : Prop := +@[expose] def IsAP4 (a b c d : ℕ) : Prop := a ≠ b ∧ a + c = 2 * b ∧ b + d = 2 * c /-- The equation-based representation used in this formalization is equivalent @@ -46,18 +46,18 @@ theorem isAP4_iff_integer_progression {a b c d : ℕ} : /-- The paper's definition of a 4AP-free order, applied to a strict relation. The relation need not be bundled as a linear order for this predicate. -/ -def APFree (R : ℕ → ℕ → Prop) : Prop := +@[expose] def APFree (R : ℕ → ℕ → Prop) : Prop := ∀ ⦃a b c d : ℕ⦄, IsAP4 a b c d → R a b → R b c → R c d → False /-- The completion `𝒞(P)` from the paragraph preceding Lemma 1, with an arbitrary background relation `R`. `List.idxOf` is the length of the list for a missing entry, so the first disjunct orders the prefix and puts it before the tail. -/ -def Completion (R : ℕ → ℕ → Prop) (P : List ℕ) (a b : ℕ) : Prop := +@[expose] def Completion (R : ℕ → ℕ → Prop) (P : List ℕ) (a b : ℕ) : Prop := P.idxOf a < P.idxOf b ∨ (a ∉ P ∧ b ∉ P ∧ R a b) /-- A safe word in the sense of the paper: a word without repetitions whose completion is 4AP-free. The background order is made explicit here. -/ -def Safe (R : ℕ → ℕ → Prop) (P : List ℕ) : Prop := +@[expose] def Safe (R : ℕ → ℕ → Prop) (P : List ℕ) : Prop := P.Nodup ∧ APFree (Completion R P) end FourAP diff --git a/LeanPool/FourAP/Binary.lean b/LeanPool/FourAP/Binary.lean index e59e45c087..3ee8fb284c 100644 --- a/LeanPool/FourAP/Binary.lean +++ b/LeanPool/FourAP/Binary.lean @@ -18,14 +18,14 @@ removes a common least significant bit. We use this recursive description both for a computable comparison and for the elementary proofs in the paper. -/ -@[expose] public section +public section namespace FourAP /-- The binary comparison from the paragraph defining `◁` in the paper. It returns `true` precisely when the first argument precedes the second. The special case `(0, 0)` ends the recursion after all bits have been removed. -/ -def binaryCompare (a b : ℕ) : Bool := +@[expose] def binaryCompare (a b : ℕ) : Bool := if a + b = 0 then false else if a % 2 = b % 2 then binaryCompare (a / 2) (b / 2) else decide (b % 2 < a % 2) @@ -34,7 +34,7 @@ decreasing_by omega /-- The paper's strict order `◁`, the reverse order on binary strings when compared at their first unequal bit starting from the least significant end. -/ -def bits (a b : ℕ) : Prop := binaryCompare a b = true +@[expose] def bits (a b : ℕ) : Prop := binaryCompare a b = true /-- Binary comparison is decidable by the recursion defining the paper's order. -/ instance bitsDecidable : DecidableRel bits := fun _ _ => inferInstanceAs (Decidable (_ = true)) diff --git a/LeanPool/FourAP/Completion.lean b/LeanPool/FourAP/Completion.lean index 06ce76172f..2b9a4bfdc4 100644 --- a/LeanPool/FourAP/Completion.lean +++ b/LeanPool/FourAP/Completion.lean @@ -15,7 +15,7 @@ These elementary bookkeeping facts make precise the paper's statements that prefix does not move any of its old entries. They are independent of the special binary order. -/ -@[expose] public section +public section namespace FourAP diff --git a/LeanPool/FourAP/Construction.lean b/LeanPool/FourAP/Construction.lean index 9469fff658..c6e3b5b528 100644 --- a/LeanPool/FourAP/Construction.lean +++ b/LeanPool/FourAP/Construction.lean @@ -23,7 +23,7 @@ The numerical prefixes from the remark are checked separately in its upstream numerical examples module, using the stabilization results proved here. -/ -@[expose] public section +public section namespace FourAP @@ -102,7 +102,7 @@ theorem explicitPermutation_prefix (n m : ℕ) (hm : m ≤ (algorithmStage n).le /-- Add one to the executable permutation, as in the last sentence of the proof and the second displayed prefix in the final remark. Positions remain zero-based here so the sequence can be read directly using Lean lists. -/ -def explicitPositiveSequence : ℕ ≃ ℕ+ := +@[expose] def explicitPositiveSequence : ℕ ≃ ℕ+ := explicitPermutation.trans Equiv.pnatEquivNat.symm /-- The positive sequence is the nonnegative permutation shifted by one, diff --git a/LeanPool/FourAP/Extension.lean b/LeanPool/FourAP/Extension.lean index 781f7896a4..2d39792bc8 100644 --- a/LeanPool/FourAP/Extension.lean +++ b/LeanPool/FourAP/Extension.lean @@ -23,7 +23,7 @@ and target coverage in one induction. The paper's existential Lemma 2 is the immediate corollary `safe_extend`. -/ -@[expose] public section +public section namespace FourAP @@ -56,7 +56,7 @@ theorem parityWord_max_lt {P : List ℕ} {p : ℕ} (hp : p < 2) /-- An insertion-sort implementation of the reverse listing in Lemma 1. It is extensionally identical to `reverseWord`; using structural insertion sort also allows the displayed numerical example to reduce in Lean's kernel. -/ -def reverseWordExecutable (T : Finset ℕ) : List ℕ := +@[expose] def reverseWordExecutable (T : Finset ℕ) : List ℕ := Quot.liftOn T.val (List.insertionSort reverseBitsLE) fun l₁ l₂ h => ((List.perm_insertionSort reverseBitsLE l₁).trans (h.trans (List.perm_insertionSort reverseBitsLE l₂).symm)).eq_of_pairwise' @@ -94,7 +94,7 @@ decreasing_by /-- The specification asserted in Lemma 2: a safe extension, preserving the old prefix and containing every prescribed target. This predicate packages the three conclusions without hiding the actual output word. -/ -def ExtensionResult (P : List ℕ) (T : Finset ℕ) (Q : List ℕ) : Prop := +@[expose] def ExtensionResult (P : List ℕ) (T : Finset ℕ) (Q : List ℕ) : Prop := Safe bits Q ∧ P.IsPrefix Q ∧ ∀ t ∈ T, t ∈ Q /-- Splitting off the newly appended suffix recovers the entire extension. diff --git a/LeanPool/FourAP/Glue.lean b/LeanPool/FourAP/Glue.lean index f4bed4c74b..e8a06e90c3 100644 --- a/LeanPool/FourAP/Glue.lean +++ b/LeanPool/FourAP/Glue.lean @@ -21,7 +21,7 @@ The guard on the odd target set is exactly the paper's requirement that all normalized odd entries below `h` have been included. -/ -@[expose] public section +public section namespace FourAP diff --git a/LeanPool/FourAP/Limit.lean b/LeanPool/FourAP/Limit.lean index f0fa5b3dd6..bacc5c9983 100644 --- a/LeanPool/FourAP/Limit.lean +++ b/LeanPool/FourAP/Limit.lean @@ -26,7 +26,7 @@ in the paper's remark: stop at *any* stage long enough to contain the position. Neither direction of the equivalence uses a choice of preimage. -/ -@[expose] public section +public section namespace FourAP @@ -34,7 +34,7 @@ namespace FourAP at increasing positions form a nonconstant arithmetic progression. Because `IsAP4` uses equations rather than natural subtraction, decreasing arithmetic progressions are excluded as well. -/ -def SequenceAPFree (f : ℕ → ℕ) : Prop := +@[expose] def SequenceAPFree (f : ℕ → ℕ) : Prop := ∀ ⦃i j k l : ℕ⦄, i < j → j < k → k < l → ¬ IsAP4 (f i) (f j) (f k) (f l) @@ -94,7 +94,7 @@ theorem safeStages_idxOf_eq (P : ℕ → List ℕ) paper from computable safe stages. Its forward map reads a bounded stage, and its inverse searches a bounded finite word; the proofs below verify that these explicitly given maps are mutually inverse. -/ -def permutationOfSafeStages (R : ℕ → ℕ → Prop) (P : ℕ → List ℕ) +@[expose] def permutationOfSafeStages (R : ℕ → ℕ → Prop) (P : ℕ → List ℕ) (hsafe : ∀ n, Safe R (P n)) (hstep : ∀ n, (P n).IsPrefix (P (n + 1))) (hcover : ∀ n t, t < n → t ∈ P n) : ℕ ≃ ℕ where diff --git a/LeanPool/FourAP/Main.lean b/LeanPool/FourAP/Main.lean index c9fa671ed5..3338ddb790 100644 --- a/LeanPool/FourAP/Main.lean +++ b/LeanPool/FourAP/Main.lean @@ -17,7 +17,7 @@ integers”. For the closest match to the displayed theorem in the paper, see as positions and as values, and an arbitrary nonzero integer difference. Each existential statement below uses the explicit, verified construction. -/ -@[expose] public section +public section namespace FourAP diff --git a/LeanPool/FourAP/Splice.lean b/LeanPool/FourAP/Splice.lean index f6f45bd5e6..e1e2fcb297 100644 --- a/LeanPool/FourAP/Splice.lean +++ b/LeanPool/FourAP/Splice.lean @@ -17,7 +17,7 @@ and the odd-before-even comparison in equation (2) holds. We isolate this argument so that the subsequent recursive construction can be read separately from its safety proof. -/ -@[expose] public section +public section namespace FourAP diff --git a/LeanPool/FourAP/Words.lean b/LeanPool/FourAP/Words.lean index a1ce5fa592..378f23be3d 100644 --- a/LeanPool/FourAP/Words.lean +++ b/LeanPool/FourAP/Words.lean @@ -19,7 +19,7 @@ The two arithmetic-progression equations used below include both increasing and decreasing progressions. -/ -@[expose] public section +public section namespace FourAP @@ -200,7 +200,7 @@ theorem safe_of_reverse_pairwise {P : List ℕ} (hn : P.Nodup) /-- The non-strict reverse of `◁`, used solely for sorting the finite set in Lemma 1 and in the base case of the Extension Lemma. -/ -def reverseBitsLE (a b : ℕ) : Prop := a = b ∨ bits b a +@[expose] def reverseBitsLE (a b : ℕ) : Prop := a = b ∨ bits b a /-- The finite sorting relation in Lemma 1 has a computable comparison. -/ instance reverseBitsLEDecidable : DecidableRel reverseBitsLE := @@ -235,7 +235,7 @@ instance reverseBitsLETotal : Std.Total reverseBitsLE where /-- List a finite set in reverse `◁` order, exactly as prescribed in Lemma 1. This definition is computable, using mathlib's finite-set merge sort. -/ -def reverseWord (T : Finset ℕ) : List ℕ := T.sort reverseBitsLE +@[expose] def reverseWord (T : Finset ℕ) : List ℕ := T.sort reverseBitsLE /-- The reverse listing contains each and only each prescribed entry. -/ @[simp] theorem mem_reverseWord {T : Finset ℕ} {x : ℕ} : diff --git a/LeanPool/FriezePatterns.lean b/LeanPool/FriezePatterns.lean index f0da05e5c4..6d3daa13d6 100644 --- a/LeanPool/FriezePatterns.lean +++ b/LeanPool/FriezePatterns.lean @@ -23,4 +23,4 @@ Tags: combinatorics, frieze-patterns, fibonacci, coxeter MSC: 05E15, 11B39, 13F60 -/ -@[expose] public section +public section diff --git a/LeanPool/FriezePatterns/Chapter1.lean b/LeanPool/FriezePatterns/Chapter1.lean index 9f519377b1..a11966d2c0 100644 --- a/LeanPool/FriezePatterns/Chapter1.lean +++ b/LeanPool/FriezePatterns/Chapter1.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Ring.RingNF Imported Lean Pool material for `LeanPool.FriezePatterns.Chapter1`. -/ -@[expose] public section +public section /-- A field-valued frieze pattern of height `n`: a function `f : ℕ × ℕ → F` with `0`s on the row `i = 0`, `1`s on rows `i = 1` and `i = n`, `0`s on rows `i ≥ n + 1`, satisfying the diff --git a/LeanPool/FriezePatterns/Chapter2.lean b/LeanPool/FriezePatterns/Chapter2.lean index ed0ab6ad27..7977274b6c 100644 --- a/LeanPool/FriezePatterns/Chapter2.lean +++ b/LeanPool/FriezePatterns/Chapter2.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.FriezePatterns.Chapter2`. -/ -@[expose] public section +public section ---- n-Flutes ---- /-- An `n`-flute: a positive integer sequence `a` with `a 0 = 1`, periodic with period @@ -53,7 +53,7 @@ def fluteSet (n : ℕ) : Set (flute n) := Set.univ /-- The underlying sequence of the Fibonacci-maximal `(2k+1)`-flute. -/ -def aOdd (k i : ℕ) : ℕ := +@[expose] def aOdd (k i : ℕ) : ℕ := if k = 0 then 1 else if i ≥ 2 * k then @@ -180,7 +180,7 @@ def fibFluteOdd (k : ℕ) : flute (2*k+1) := by exact ⟨aOdd k, pos, hd, period, div⟩ /-- The underlying sequence of the Fibonacci-maximal `(2k+2)`-flute. -/ -def aEven (k i : ℕ) : ℕ := +@[expose] def aEven (k i : ℕ) : ℕ := if i ≥ 2 * k + 1 then aEven k (i - 2 * k - 1) else if i < k + 1 then @@ -856,3 +856,14 @@ theorem FluteBounded (n : ℕ) (hn : n > 0) (f : flute n) : · simp [hj, add_assoc] at hf₁; omega · have := key₁ i hi hij exact ⟨(by omega), (by omega)⟩ + +/-- The Fibonacci-maximal odd flute has underlying sequence `aOdd`. -/ +lemma fibFluteOdd_a (k i : ℕ) : (fibFluteOdd k).a i = aOdd k i := by + by_cases hk : k = 0 + · subst k + simp [fibFluteOdd, aOdd] + · simp only [fibFluteOdd, hk, ↓reduceDIte] + +/-- The Fibonacci-maximal even flute has underlying sequence `aEven`. -/ +lemma fibFluteEven_a (k i : ℕ) : (fibFluteEven k).a i = aEven k i := by + rfl diff --git a/LeanPool/FriezePatterns/Chapter3.lean b/LeanPool/FriezePatterns/Chapter3.lean index 8c4e149d83..2e45832ec5 100644 --- a/LeanPool/FriezePatterns/Chapter3.lean +++ b/LeanPool/FriezePatterns/Chapter3.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.FriezePatterns.Chapter3`. -/ -@[expose] public section +public section /-- An *arithmetic frieze pattern* of height `n`: a rational-valued frieze pattern with all @@ -497,16 +497,9 @@ lemma main2 (n : ℕ) (hn : n ≠ 0) : have h₃ : ¬ 2 * j + 2 ≤ j := by omega simp only [friezeF, Nat.add_eq_zero_iff, one_ne_zero, and_false, ↓reduceIte, ge_iff_le, add_le_add_iff_right, h₃, add_tsub_cancel_right, Nat.cast_inj] - unfold fibFluteEven - by_cases h₂ : j = 0 - · simp only [h₂, mul_zero, zero_add, Nat.fib_two] - unfold aEven - simp - -- j ≠ 0 - simp only + rw [fibFluteEven_a] have h₄ : ¬ j ≥ 2 * j + 1 := by omega - unfold aEven - simp [h₄] + simp [aEven, h₄] simp_all -- odd case · use friezeF (fibFluteOdd k) @@ -520,17 +513,12 @@ lemma main2 (n : ℕ) (hn : n ≠ 0) : have h₃ : ¬ 2 * k + 1 ≤ k := by omega simp only [friezeF, Nat.add_eq_zero_iff, one_ne_zero, and_false, ↓reduceIte, ge_iff_le, add_le_add_iff_right, h₃, add_tsub_cancel_right, Nat.cast_inj] - unfold fibFluteOdd + rw [fibFluteOdd_a] by_cases h₂ : k = 0 - · simp only [h₂, ↓reduceDIte, Pi.natCast_apply, Nat.cast_id, mul_zero, zero_add, Nat.fib_one] - unfold aOdd - simp - -- k ≠ 0 - simp only [h₂, ↓reduceDIte] + · simp [h₂, aOdd] have h₄ : ¬ 2 * k ≤ k := by omega have h₅ : 1 + 4 * k - 2 * k = 2 * k + 1 := by omega - unfold aOdd - simp [h₂, h₄, h₅] + simp [aOdd, h₂, h₄, h₅] simp_all theorem main3 (n : ℕ) (hn : n ≠ 0) : ∃ (g : ℕ × ℕ → ℚ) (_ : arith_fp g n), diff --git a/LeanPool/FrontierMathOpenHypergraphs.lean b/LeanPool/FrontierMathOpenHypergraphs.lean index 936885d571..8ee3a09d26 100644 --- a/LeanPool/FrontierMathOpenHypergraphs.lean +++ b/LeanPool/FrontierMathOpenHypergraphs.lean @@ -24,4 +24,4 @@ Tags: combinatorics, hypergraphs, ramsey-theory, extremal-combinatorics, frontie MSC: 05C65, 05D10, 03E02 -/ -@[expose] public section +public section diff --git a/LeanPool/FrontierMathOpenHypergraphs/Basic.lean b/LeanPool/FrontierMathOpenHypergraphs/Basic.lean index c8d6c2b9e7..8714b5b700 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Basic.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Basic.lean @@ -13,7 +13,7 @@ public import Mathlib.Order.Lattice.Nat Basic definitions and the substitution theorem for the hypergraph lower bound. -/ -@[expose] public section +public section open Finset @@ -28,17 +28,17 @@ abbrev Hypergraph (V : Type*) := Finset (Finset V) abbrev HypergraphFamily (ι : Type*) (V : Type*) := ι → Hypergraph V /-- The vertex set of a hypergraph given by its edge set: the union of all edges. -/ -noncomputable def vertexSet {V : Type*} [DecidableEq V] +@[expose] noncomputable def vertexSet {V : Type*} [DecidableEq V] (edges : Hypergraph V) : Finset V := edges.biUnion id /-- The unique coverage count: the number of vertices belonging to exactly one edge in P. -/ -noncomputable def uniqueCoverage {V : Type*} [DecidableEq V] +@[expose] noncomputable def uniqueCoverage {V : Type*} [DecidableEq V] (edges : Hypergraph V) (P : Hypergraph V) : ℕ := (vertexSet edges).filter (fun v => (P.filter (fun e => v ∈ e)).card = 1) |>.card /-- A hypergraph contains no partition of size greater than n. -/ -def NoLargePartition {V : Type*} [DecidableEq V] +@[expose] def NoLargePartition {V : Type*} [DecidableEq V] (edges : Hypergraph V) (n : ℕ) : Prop := ∀ P : Hypergraph V, P ⊆ edges → uniqueCoverage edges P ≤ n @@ -47,7 +47,7 @@ def NoLargePartition {V : Type*} [DecidableEq V] In this development hypergraphs are encoded by their edge sets, so "no isolated vertices" is reflected by taking the vertex set to be the union of the edges. -/ -noncomputable def H (n : ℕ) : ℕ := +@[expose] noncomputable def H (n : ℕ) : ℕ := sSup {k : ℕ | ∃ (edges : Hypergraph ℕ), (vertexSet edges).card = k ∧ NoLargePartition edges n} @@ -55,7 +55,7 @@ noncomputable def H (n : ℕ) : ℕ := /-- The benchmark sequence k(n) defined by k(1) = 1 and k(n) = ⌊n/2⌋ + k(⌊n/2⌋) + k(⌊(n+1)/2⌋) for n ≥ 2. -/ -def k : ℕ → ℕ +@[expose] def k : ℕ → ℕ | 0 => 0 | 1 => 1 | n + 2 => diff --git a/LeanPool/FrontierMathOpenHypergraphs/Lubell.lean b/LeanPool/FrontierMathOpenHypergraphs/Lubell.lean index de080aedfc..d50cdbaa5c 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Lubell.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Lubell.lean @@ -16,7 +16,7 @@ import Mathlib.NumberTheory.Harmonic.Bounds # Lubell frames and asymptotic context -/ -@[expose] public section +public section namespace HypergraphLowerBound diff --git a/LeanPool/FrontierMathOpenHypergraphs/Substitution.lean b/LeanPool/FrontierMathOpenHypergraphs/Substitution.lean index c73ec269b6..292cb28f39 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Substitution.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Substitution.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow # Support gadgets and the substitution theorem -/ -@[expose] public section +public section open Finset @@ -27,7 +27,7 @@ namespace HypergraphLowerBound /-! ## Support patterns and frames -/ /-- A support pattern on `[t]` is a subset of `Fin t` of size at least `2`. -/ -def SupportPattern (t : ℕ) := { S : Finset (Fin t) // 2 ≤ S.card } +@[expose] def SupportPattern (t : ℕ) := { S : Finset (Fin t) // 2 ≤ S.card } /-- The block hypergraphs used in a substitution construction. -/ abbrev BlockFamily (t : ℕ) := HypergraphFamily (Fin t) ℕ @@ -36,20 +36,20 @@ abbrev BlockFamily (t : ℕ) := HypergraphFamily (Fin t) ℕ abbrev SupportOcc {t : ℕ} (F : Multiset (SupportPattern t)) := Fin F.card /-- The support pattern attached to a given support-vertex occurrence. -/ -noncomputable def supportPatternAt {t : ℕ} +@[expose] noncomputable def supportPatternAt {t : ℕ} (F : Multiset (SupportPattern t)) (s : SupportOcc F) : SupportPattern t := F.toList.get ⟨s.1, by simp_all ⟩ /-- The underlying subset of `[t]` attached to a support occurrence. -/ -noncomputable def supportSetAt {t : ℕ} +@[expose] noncomputable def supportSetAt {t : ℕ} (F : Multiset (SupportPattern t)) (s : SupportOcc F) : Finset (Fin t) := (supportPatternAt F s).1 /-- `omegaCount F T I` counts the occurrences of support patterns `S` in `F` with `S ⊆ T` and `|S ∩ I| = 1`, counting multiplicity. -/ -noncomputable def omegaCount {t : ℕ} +@[expose] noncomputable def omegaCount {t : ℕ} (F : Multiset (SupportPattern t)) (T I : Finset (Fin t)) : ℕ := ((Finset.univ : Finset (Fin F.card)).filter fun s => @@ -57,7 +57,7 @@ noncomputable def omegaCount {t : ℕ} /-- A support multiset `F` is an `n`-frame if the frame inequality holds for every `I ⊆ T ⊆ [t]`. -/ -def IsFrame {t : ℕ} +@[expose] def IsFrame {t : ℕ} (F : Multiset (SupportPattern t)) (cap : Fin t → ℕ) : Prop := ∀ T I : Finset (Fin t), I ⊆ T → @@ -82,7 +82,7 @@ noncomputable def supportVerticesOnBlock {t : ℕ} SubstVertex.new /-- Lift one edge from block `i` into the substituted hypergraph. -/ -noncomputable def liftBlockEdge {t : ℕ} +@[expose] noncomputable def liftBlockEdge {t : ℕ} (F : Multiset (SupportPattern t)) (i : Fin t) (e : Finset ℕ) : Finset (SubstVertex t F) := (e.image fun v => SubstVertex.old i v) ∪ supportVerticesOnBlock F i @@ -90,7 +90,7 @@ noncomputable def liftBlockEdge {t : ℕ} /-- The substitution hypergraph `F[G_1, ..., G_t]`, realized as the hypergraph whose vertices are tagged block vertices plus support vertices, and whose edges are the lifted edges of the blocks. -/ -noncomputable def substitutionHypergraph {t : ℕ} +@[expose] noncomputable def substitutionHypergraph {t : ℕ} (F : Multiset (SupportPattern t)) (blocks : BlockFamily t) : SubstitutedHypergraph F := ((Finset.univ : Finset (Fin t)).biUnion fun i => diff --git a/LeanPool/FrontierMathOpenHypergraphs/Uniform.lean b/LeanPool/FrontierMathOpenHypergraphs/Uniform.lean index d435a4f9d3..b082d757ce 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Uniform.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Uniform.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Ring.RingNF # The uniform 26/25 factor and the finite bootstrap -/ -@[expose] public section +public section namespace HypergraphLowerBound diff --git a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameBoosters.lean b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameBoosters.lean index 454fdb25ba..3a0110eac1 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameBoosters.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameBoosters.lean @@ -20,7 +20,7 @@ The larger checks are split into blocks of 128 masks to bound kernel memory. Each block is evaluated directly by the kernel. -/ -@[expose] public section +public section namespace HypergraphLowerBound diff --git a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameDefs.lean b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameDefs.lean index 2defd34702..80f409bc90 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameDefs.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameDefs.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.OfScientific # The uniform 26/25 factor and the finite bootstrap -/ -@[expose] public section +public section namespace HypergraphLowerBound @@ -40,15 +40,15 @@ structure FrameSpec where ∀ s ∈ rawSupports, s.Nodup ∧ (∀ i ∈ s, i < parts.length) ∧ 2 ≤ s.length /-- The arity of a frame specification. -/ -def FrameSpec.t (spec : FrameSpec) : ℕ := +@[expose] def FrameSpec.t (spec : FrameSpec) : ℕ := spec.parts.length /-- The capacity vector of a frame specification. -/ -def FrameSpec.cap (spec : FrameSpec) : Fin spec.t → ℕ := +@[expose] def FrameSpec.cap (spec : FrameSpec) : Fin spec.t → ℕ := fun i => spec.parts.get i /-- Encode a list of support indices as a support pattern. -/ -def supportPatternOfList {t : ℕ} (s : List ℕ) +@[expose] def supportPatternOfList {t : ℕ} (s : List ℕ) (hIn : ∀ i ∈ s, i < t) (hNodup : s.Nodup) (hCard : 2 ≤ s.length) : SupportPattern t := by let finList : List (Fin t) := s.pmap (fun i hi => (⟨i, hi⟩ : Fin t)) hIn @@ -60,7 +60,7 @@ def supportPatternOfList {t : ℕ} (s : List ℕ) simpa [finList] using hCard /-- The support list of a frame specification, interpreted on `Fin spec.t`. -/ -def FrameSpec.supportList (spec : FrameSpec) : List (SupportPattern spec.t) := +@[expose] def FrameSpec.supportList (spec : FrameSpec) : List (SupportPattern spec.t) := (spec.rawSupports.pmap (fun s hs => supportPatternOfList s (fun i hi => (spec.rawSupports_ok s hs).2.1 i hi) @@ -70,25 +70,25 @@ def FrameSpec.supportList (spec : FrameSpec) : List (SupportPattern spec.t) := simp_all) : List (SupportPattern spec.t)) /-- The support multiset of a frame specification, interpreted on `Fin spec.t`. -/ -def FrameSpec.supports (spec : FrameSpec) : Multiset (SupportPattern spec.t) := +@[expose] def FrameSpec.supports (spec : FrameSpec) : Multiset (SupportPattern spec.t) := spec.supportList /-- The total number of support occurrences in a frame specification. -/ -def FrameSpec.bonus (spec : FrameSpec) : ℕ := +@[expose] def FrameSpec.bonus (spec : FrameSpec) : ℕ := spec.rawSupports.length /-- Decide whether a support pattern contributes to the frame inequality for `T` and `I`. -/ -def frameWitnesses {t : ℕ} (T I : Finset (Fin t)) (S : SupportPattern t) : Bool := +@[expose] def frameWitnesses {t : ℕ} (T I : Finset (Fin t)) (S : SupportPattern t) : Bool := decide (S.1 ⊆ T ∧ ((S.1 ∩ I).card = 1)) /-- The computable count of support occurrences contributing to the frame inequality. -/ -def FrameSpec.countWitnesses (spec : FrameSpec) +@[expose] def FrameSpec.countWitnesses (spec : FrameSpec) (T I : Finset (Fin spec.t)) : ℕ := spec.supportList.countP (frameWitnesses T I) /-- A frame specification is valid when its support multiset satisfies the corresponding frame inequalities. -/ -def FrameSpec.IsValid (spec : FrameSpec) : Prop := +@[expose] def FrameSpec.IsValid (spec : FrameSpec) : Prop := ∀ T I : Finset (Fin spec.t), I ⊆ T → spec.countWitnesses T I ≤ (T \ I).sum spec.cap @@ -97,21 +97,21 @@ instance (spec : FrameSpec) : Decidable spec.IsValid := by infer_instance /-- A support list with 2 specified indices. -/ -def sup2 (a b : ℕ) : List ℕ := [a, b] +@[expose] def sup2 (a b : ℕ) : List ℕ := [a, b] /-- A support list with 3 specified indices. -/ -def sup3 (a b c : ℕ) : List ℕ := [a, b, c] +@[expose] def sup3 (a b c : ℕ) : List ℕ := [a, b, c] /-- A support list with 4 specified indices. -/ -def sup4 (a b c d : ℕ) : List ℕ := [a, b, c, d] +@[expose] def sup4 (a b c d : ℕ) : List ℕ := [a, b, c, d] /-- A support list with 5 specified indices. -/ -def sup5 (a b c d e : ℕ) : List ℕ := [a, b, c, d, e] +@[expose] def sup5 (a b c d e : ℕ) : List ℕ := [a, b, c, d, e] /-- A support list with 6 specified indices. -/ -def sup6 (a b c d e f : ℕ) : List ℕ := [a, b, c, d, e, f] +@[expose] def sup6 (a b c d e f : ℕ) : List ℕ := [a, b, c, d, e, f] /-- A support list with 7 specified indices. -/ -def sup7 (a b c d e f g : ℕ) : List ℕ := [a, b, c, d, e, f, g] +@[expose] def sup7 (a b c d e f g : ℕ) : List ℕ := [a, b, c, d, e, f, g] /-- A support list with 8 specified indices. -/ -def sup8 (a b c d e f g h : ℕ) : List ℕ := [a, b, c, d, e, f, g, h] +@[expose] def sup8 (a b c d e f g h : ℕ) : List ℕ := [a, b, c, d, e, f, g, h] /-- A support list with 9 specified indices. -/ -def sup9 (a b c d e f g h i : ℕ) : List ℕ := [a, b, c, d, e, f, g, h, i] +@[expose] def sup9 (a b c d e f g h i : ℕ) : List ℕ := [a, b, c, d, e, f, g, h, i] local notation "s2" => sup2 local notation "s3" => sup3 @@ -123,7 +123,7 @@ local notation "s8" => sup8 local notation "s9" => sup9 /-- Build a frame specification from its parts and raw support lists. -/ -def mkFrame (parts : List ℕ) (rawSupports : List (List ℕ)) +@[expose] def mkFrame (parts : List ℕ) (rawSupports : List (List ℕ)) (h : ∀ s ∈ rawSupports, s.Nodup ∧ (∀ i ∈ s, i < parts.length) ∧ 2 ≤ s.length) : FrameSpec where parts := parts @@ -160,7 +160,7 @@ private structure ChoiceSpec where private instance : Inhabited ChoiceSpec := ⟨⟨.base, [], 0⟩⟩ /-- The support lists of the four-core frame. -/ -def core4Supports : List (List ℕ) := +@[expose] def core4Supports : List (List ℕ) := [ s2 0 1 , s2 0 2 , s2 0 3 @@ -177,11 +177,11 @@ def core4Supports : List (List ℕ) := ] /-- The four-part core gadget used in the residue construction. -/ -def core4Spec : FrameSpec := +@[expose] def core4Spec : FrameSpec := frame [3, 3, 3, 3] core4Supports (by decide) /-- The exact small frames listed in Appendix A. -/ -def exactSmallFrames : List FrameSpec := +@[expose] def exactSmallFrames : List FrameSpec := [ frame! [2, 2, 2] [ s2 0 1, @@ -773,7 +773,7 @@ def exactSmallFrames : List FrameSpec := ] /-- The explicit boosters listed in Appendix B. -/ -def boosters : List FrameSpec := +@[expose] def boosters : List FrameSpec := [ frame! [2, 2, 2, 2, 2, 2, 3] [ s2 0 2, @@ -1044,7 +1044,7 @@ def boosters : List FrameSpec := ] /-- The residue gadgets `R_r` used by the balanced four-way construction. -/ -def residueGadgets : List FrameSpec := +@[expose] def residueGadgets : List FrameSpec := [ frame! [0, 0, 0, 0] [ ], @@ -1195,7 +1195,7 @@ private def under60Choices : List ChoiceSpec := ] /-- The bonus terms e_r(m) for the balanced four-way construction. -/ -def eBonus (r : ℕ) (m : ℕ) : ℕ := +@[expose] def eBonus (r : ℕ) (m : ℕ) : ℕ := match r % 4 with | 0 => (13 * m) / 3 | 1 => (13 * m + 1) / 3 @@ -1203,7 +1203,7 @@ def eBonus (r : ℕ) (m : ℕ) : ℕ := | _ => (13 * m + 6) / 3 /-- The bootstrap table values for A_n, 0 ≤ n < 60. -/ -def bootstrapValues : List ℕ := +@[expose] def bootstrapValues : List ℕ := [0, 1, 3, 4, 6, 7, 10, 11, 14, 17, -- 0-9 19, 21, 24, 28, 30, 45, 50, 52, 57, 60, -- 10-19 65, 68, 73, 75, 82, 84, 89, 93, 98, 101, -- 20-29 @@ -1212,7 +1212,7 @@ def bootstrapValues : List ℕ := 195, 199, 204, 208, 214, 218, 224, 229, 234, 238] -- 50-59 /-- The sequence A(n) of vertex counts for the explicit hypergraph family. -/ -def A (n : ℕ) : ℕ := +@[expose] def A (n : ℕ) : ℕ := if n = 0 then 0 else if n < 60 then bootstrapValues[n]! @@ -1466,11 +1466,11 @@ private theorem bit_testBit_gt {n i : Nat} (hi : n < i) : simp_all /-- The frame coordinates selected by a natural-number bit mask. -/ -def maskFinset (spec : FrameSpec) (mask : Nat) : Finset (Fin spec.t) := +@[expose] def maskFinset (spec : FrameSpec) (mask : Nat) : Finset (Fin spec.t) := Finset.univ.filter fun i => mask.testBit i.1 /-- Recursively check the maximal witness set for each right-hand side support mask. -/ -def checkComplementMasksDown (spec : FrameSpec) : Nat → Nat → Bool +@[expose] def checkComplementMasksDown (spec : FrameSpec) : Nat → Nat → Bool | 0, mask => let U := maskFinset spec mask decide (spec.countWitnesses Finset.univ Uᶜ ≤ U.sum spec.cap) @@ -1534,7 +1534,7 @@ private theorem checkComplementMasksDown_sound (spec : FrameSpec) : · exact hrep j (by omega) /-- A Boolean validator using only maximal witness sets for each capacity support. -/ -def FrameSpec.checkComplementValid (spec : FrameSpec) : Bool := +@[expose] def FrameSpec.checkComplementValid (spec : FrameSpec) : Bool := checkComplementMasksDown spec spec.t 0 /-- The complement-based checker implies all frame inequalities. -/ diff --git a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameExact.lean b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameExact.lean index e5ddf5f67b..7618b7a989 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameExact.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameExact.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Pow # Exact small-frame validations -/ -@[expose] public section +public section namespace HypergraphLowerBound diff --git a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameResidues.lean b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameResidues.lean index 7096abf6ac..70ba018b7f 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameResidues.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Uniform/FrameResidues.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Pow # Residue-gadget validations -/ -@[expose] public section +public section namespace HypergraphLowerBound diff --git a/LeanPool/FrontierMathOpenHypergraphs/Uniform/Frames.lean b/LeanPool/FrontierMathOpenHypergraphs/Uniform/Frames.lean index a2f0e20fa9..c4e77d1de8 100644 --- a/LeanPool/FrontierMathOpenHypergraphs/Uniform/Frames.lean +++ b/LeanPool/FrontierMathOpenHypergraphs/Uniform/Frames.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow # Finite frame bank -/ -@[expose] public section +public section namespace HypergraphLowerBound diff --git a/LeanPool/FundamentalInequality.lean b/LeanPool/FundamentalInequality.lean index d89a98f44c..4fb46393e6 100644 --- a/LeanPool/FundamentalInequality.lean +++ b/LeanPool/FundamentalInequality.lean @@ -18,7 +18,7 @@ Tags: valued-fields, number-theory, valuation-theory MSC: 12J20 -/ -@[expose] public section +public section /-! # Ramification Index, Residue Degree, and the Fundamental Inequality diff --git a/LeanPool/GKPCarry.lean b/LeanPool/GKPCarry.lean index ca69668f87..676ac13e7b 100644 --- a/LeanPool/GKPCarry.lean +++ b/LeanPool/GKPCarry.lean @@ -29,4 +29,4 @@ Tags: number-theory, finite-automata, asymptotic-density MSC: 11A63, 11B65, 68Q45 -/ -@[expose] public section +public section diff --git a/LeanPool/GKPCarry/BadCarryCounting.lean b/LeanPool/GKPCarry/BadCarryCounting.lean index 34881b12e5..a2750366b4 100644 --- a/LeanPool/GKPCarry/BadCarryCounting.lean +++ b/LeanPool/GKPCarry/BadCarryCounting.lean @@ -20,14 +20,14 @@ when doubled. The theorem below uses the subtraction-free parameterization `m = n + 2`. -/ -@[expose] public section +public section namespace GKPCarry open scoped BigOperators /-- Convert a fixed-length word over `Fin 3` to a list of natural digits. -/ -def ternaryWordDigits {length : ℕ} +@[expose] def ternaryWordDigits {length : ℕ} (word : List.Vector (Fin 3) length) : List ℕ := word.toList.map Fin.val diff --git a/LeanPool/GKPCarry/BadCarryLanguage.lean b/LeanPool/GKPCarry/BadCarryLanguage.lean index d8c616cd0c..674752fbdb 100644 --- a/LeanPool/GKPCarry/BadCarryLanguage.lean +++ b/LeanPool/GKPCarry/BadCarryLanguage.lean @@ -19,7 +19,7 @@ explicit digit patterns. This turns the remaining GKP power-of-two condition into an exact regular-language avoidance statement. -/ -@[expose] public section +public section namespace GKPCarry @@ -35,7 +35,7 @@ inductive BadCarryState where deriving DecidableEq, Repr /-- One transition of the deficient-carry automaton. -/ -def badCarryStateStep : BadCarryState → ℕ → BadCarryState +@[expose] def badCarryStateStep : BadCarryState → ℕ → BadCarryState | .good, _ => .good | .zeroCarry, digit => if digit = 2 then .oneCarryOut @@ -46,7 +46,7 @@ def badCarryStateStep : BadCarryState → ℕ → BadCarryState if digit < 2 then .oneCarryNoCarry else .good /-- Run the automaton from an arbitrary state. -/ -def badCarryStateAux : List ℕ → BadCarryState → BadCarryState +@[expose] def badCarryStateAux : List ℕ → BadCarryState → BadCarryState | [], state => state | digit :: digits, state => badCarryStateAux digits (badCarryStateStep state digit) @@ -60,14 +60,14 @@ def badCarryLanguage (digits : List ℕ) : Bool := decide (badCarryState digits ≠ .good) /-- Incoming arithmetic carry represented by an automaton state. -/ -def BadCarryState.incomingCarry : BadCarryState → ℕ +@[expose] def BadCarryState.incomingCarry : BadCarryState → ℕ | .zeroCarry => 0 | .oneCarryOut => 1 | .oneCarryNoCarry => 0 | .good => 0 /-- Additional carries required to reach the accepting state. -/ -def BadCarryState.neededCarries : BadCarryState → ℕ +@[expose] def BadCarryState.neededCarries : BadCarryState → ℕ | .zeroCarry => 2 | .oneCarryOut => 1 | .oneCarryNoCarry => 1 @@ -131,7 +131,7 @@ def badCarryExactlyOneTwoFollowedByZero (digits : List ℕ) : Prop := digits = lows ++ 2 :: 0 :: highs /-- The union of the three concrete deficient-carry shapes. -/ -def badCarryLanguageShape (digits : List ℕ) : Prop := +@[expose] def badCarryLanguageShape (digits : List ℕ) : Prop := badCarryAllZeroOrOne digits ∨ badCarryExactlyOneTopTwo digits ∨ badCarryExactlyOneTwoFollowedByZero digits diff --git a/LeanPool/GKPCarry/BinaryReduction.lean b/LeanPool/GKPCarry/BinaryReduction.lean index 0eff5d50d6..31693fc05f 100644 --- a/LeanPool/GKPCarry/BinaryReduction.lean +++ b/LeanPool/GKPCarry/BinaryReduction.lean @@ -19,7 +19,7 @@ binomial coefficient with binary popcount. Hence every positive non-power of two already satisfies the divisibility-by-four branch of GKP. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/CarryArithmetic.lean b/LeanPool/GKPCarry/CarryArithmetic.lean index 8192e58dad..6ce8ee1636 100644 --- a/LeanPool/GKPCarry/CarryArithmetic.lean +++ b/LeanPool/GKPCarry/CarryArithmetic.lean @@ -19,14 +19,14 @@ a little-endian ternary word. This file proves that, on the canonical ternary digits of `n`, twice that count is exactly Kummer's ternary digit excess. -/ -@[expose] public section +public section namespace GKPCarry open Nat /-- Kummer's ternary digit excess for a central binomial coefficient. -/ -def ternaryDigitExcess (n : ℕ) : ℕ := +@[expose] def ternaryDigitExcess (n : ℕ) : ℕ := 2 * (Nat.digits 3 n).sum - (Nat.digits 3 (2 * n)).sum /-- Fixed-length output digits emitted while doubling a ternary word. The diff --git a/LeanPool/GKPCarry/Definitions.lean b/LeanPool/GKPCarry/Definitions.lean index 472ec712dd..cfe9f8d513 100644 --- a/LeanPool/GKPCarry/Definitions.lean +++ b/LeanPool/GKPCarry/Definitions.lean @@ -15,31 +15,31 @@ bounded C3 corollary. Ternary digit lists are little-endian, following `Nat.digits`. -/ -@[expose] public section +public section namespace GKPCarry /-- Length of the canonical base-three expansion of `n`. -/ -def ternaryLength (n : ℕ) : ℕ := +@[expose] def ternaryLength (n : ℕ) : ℕ := (Nat.digits 3 n).length /-- The first `depth` ternary digits of `n` contain at least two `2`s. -/ -def hasTwoTernaryTwosBelow (depth n : ℕ) : Prop := +@[expose] def hasTwoTernaryTwosBelow (depth n : ℕ) : Prop := 2 ≤ ((Nat.digits 3 n).take depth).count 2 /-- One outgoing-carry step when a ternary digit is doubled. -/ -def ternaryDoubleCarryStep (carry digit : ℕ) : ℕ := +@[expose] def ternaryDoubleCarryStep (carry digit : ℕ) : ℕ := if 3 ≤ 2 * digit + carry then 1 else 0 /-- Count outgoing carries while doubling a little-endian ternary digit list. -/ -def ternaryDoubleCarryCountAux : List ℕ → ℕ → ℕ +@[expose] def ternaryDoubleCarryCountAux : List ℕ → ℕ → ℕ | [], _ => 0 | digit :: digits, carry => let next := ternaryDoubleCarryStep carry digit next + ternaryDoubleCarryCountAux digits next /-- Count carries while doubling a little-endian ternary digit list. -/ -def ternaryDoubleCarryCount (digits : List ℕ) : ℕ := +@[expose] def ternaryDoubleCarryCount (digits : List ℕ) : ℕ := ternaryDoubleCarryCountAux digits 0 /-- Number of doubling carries visible in the first `depth` ternary digits. -/ diff --git a/LeanPool/GKPCarry/DensityOne.lean b/LeanPool/GKPCarry/DensityOne.lean index 6fe9231d16..fba133178f 100644 --- a/LeanPool/GKPCarry/DensityOne.lean +++ b/LeanPool/GKPCarry/DensityOne.lean @@ -30,7 +30,7 @@ The universal conjecture remains open because a density-zero failure set need not be empty. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/FiniteRange.lean b/LeanPool/GKPCarry/FiniteRange.lean index 2501bf07c7..8cbdd66327 100644 --- a/LeanPool/GKPCarry/FiniteRange.lean +++ b/LeanPool/GKPCarry/FiniteRange.lean @@ -22,13 +22,13 @@ Their soundness is transported through proved modular exponentiation and ternary prefix lemmas, yielding the headline carry theorem at the end of this file. -/ -@[expose] public section +public section namespace GKPCarry /-- Test whether the ternary expansion contains at least `required` twos, stopping as soon as enough have been found. -/ -def hasAtLeastTernaryTwos : (required n : ℕ) → Bool +@[expose] def hasAtLeastTernaryTwos : (required n : ℕ) → Bool | 0, _ => true | required + 1, n => if hzero : n = 0 then false diff --git a/LeanPool/GKPCarry/FiniteRangeCorollary.lean b/LeanPool/GKPCarry/FiniteRangeCorollary.lean index 13d5235dbe..c3852a39af 100644 --- a/LeanPool/GKPCarry/FiniteRangeCorollary.lean +++ b/LeanPool/GKPCarry/FiniteRangeCorollary.lean @@ -19,7 +19,7 @@ Kummer carry theorem: divisibility by nine for a finite family of central binomial coefficients indexed by powers of four. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/GKPCharacterization.lean b/LeanPool/GKPCarry/GKPCharacterization.lean index 7dbf9f6004..37b92b8cec 100644 --- a/LeanPool/GKPCarry/GKPCharacterization.lean +++ b/LeanPool/GKPCarry/GKPCharacterization.lean @@ -24,7 +24,7 @@ explicit regular language by nonexceptional powers of two. This equivalence is a reduction of the open conjecture, not a proof of it. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/InfiniteSieve.lean b/LeanPool/GKPCarry/InfiniteSieve.lean index f9cd483495..7cb169be73 100644 --- a/LeanPool/GKPCarry/InfiniteSieve.lean +++ b/LeanPool/GKPCarry/InfiniteSieve.lean @@ -32,7 +32,7 @@ at each finite depth may acquire carries later; this theorem neither decides them nor proves the universal GKP conjecture. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/InfiniteSlices.lean b/LeanPool/GKPCarry/InfiniteSlices.lean index 7d573c7e90..4ec8bdd90d 100644 --- a/LeanPool/GKPCarry/InfiniteSlices.lean +++ b/LeanPool/GKPCarry/InfiniteSlices.lean @@ -26,7 +26,7 @@ This is an infinite scoped result. The other nine residue classes are not settled here, and the universal GKP conjecture remains open. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/Kummer.lean b/LeanPool/GKPCarry/Kummer.lean index 97abfb53ac..eda52f11ce 100644 --- a/LeanPool/GKPCarry/Kummer.lean +++ b/LeanPool/GKPCarry/Kummer.lean @@ -19,7 +19,7 @@ Kummer's digit-sum formula is specialized to `Nat.centralBinom`. The resulting bridge turns digit and carry estimates into divisibility statements. -/ -@[expose] public section +public section namespace GKPCarry diff --git a/LeanPool/GKPCarry/ModularPrefix.lean b/LeanPool/GKPCarry/ModularPrefix.lean index 78e9a884f0..bdcb4da922 100644 --- a/LeanPool/GKPCarry/ModularPrefix.lean +++ b/LeanPool/GKPCarry/ModularPrefix.lean @@ -18,7 +18,7 @@ binary-digit modular exponentiation function below lets the finite certificate evaluate those residues without first constructing the enormous value `4 ^ m`. -/ -@[expose] public section +public section namespace GKPCarry @@ -83,14 +83,14 @@ theorem hasTwoTernaryTwosBelow_iff_mod (depth n : ℕ) : rw [count_two_take_eq_count_two_mod_pow depth n] /-- Modular exponentiation over a little-endian list of binary digits. -/ -def powModDigits (base modulus : ℕ) : List ℕ → ℕ +@[expose] def powModDigits (base modulus : ℕ) : List ℕ → ℕ | [] => 1 % modulus | digit :: digits => let rest := powModDigits (base * base % modulus) modulus digits if digit = 0 then rest else base * rest % modulus /-- Modular exponentiation by repeated squaring over binary exponent digits. -/ -def powMod (base exponent modulus : ℕ) : ℕ := +@[expose] def powMod (base exponent modulus : ℕ) : ℕ := powModDigits base modulus (Nat.digits 2 exponent) theorem powModDigits_eq_pow_mod diff --git a/LeanPool/GKPCarry/PowerResidues.lean b/LeanPool/GKPCarry/PowerResidues.lean index f7dc111c8d..427f2ac328 100644 --- a/LeanPool/GKPCarry/PowerResidues.lean +++ b/LeanPool/GKPCarry/PowerResidues.lean @@ -17,12 +17,12 @@ of three. At level `n`, its order modulo `3 ^ (n + 1)` is exactly unit group. -/ -@[expose] public section +public section namespace GKPCarry /-- The unit represented by `2` modulo `3 ^ (level + 1)`. -/ -def twoUnit (level : ℕ) : (ZMod (3 ^ (level + 1)))ˣ := +@[expose] def twoUnit (level : ℕ) : (ZMod (3 ^ (level + 1)))ˣ := ZMod.unitOfCoprime 2 ((by decide : Nat.Coprime 2 3).pow_right (level + 1)) @@ -72,7 +72,7 @@ theorem card_units_three_pow_succ (level : ℕ) : /-- Send an exponent in one complete period to the corresponding power of `2` in the unit group. -/ -def twoPowerUnitMap (level : ℕ) : +@[expose] def twoPowerUnitMap (level : ℕ) : Fin (2 * 3 ^ level) → (ZMod (3 ^ (level + 1)))ˣ := fun exponent => twoUnit level ^ exponent.val @@ -87,7 +87,7 @@ lemma twoPowerUnitMap_injective (level : ℕ) : /-- A complete period of exponents is equivalent to all units modulo the corresponding power of three. -/ -noncomputable def twoPowerUnitEquiv (level : ℕ) : +@[expose] noncomputable def twoPowerUnitEquiv (level : ℕ) : Fin (2 * 3 ^ level) ≃ (ZMod (3 ^ (level + 1)))ˣ := Equiv.ofBijective (twoPowerUnitMap level) <| (Fintype.bijective_iff_injective_and_card _).2 diff --git a/LeanPool/GKPCarry/Statement.lean b/LeanPool/GKPCarry/Statement.lean index ee98795fb9..6ade50a6cf 100644 --- a/LeanPool/GKPCarry/Statement.lean +++ b/LeanPool/GKPCarry/Statement.lean @@ -14,18 +14,18 @@ This file records the conjecture from Exercise 5.112 of *Concrete Mathematics* and its restriction to powers of two. The conjecture itself remains open. -/ -@[expose] public section +public section namespace GKPCarry /-- The Graham--Knuth--Patashnik conjecture: if `n > 4` and `n ∉ {64, 256}`, then `Nat.centralBinom n` is divisible by `4` or by `9`. -/ -def gkpConjecture : Prop := +@[expose] def gkpConjecture : Prop := ∀ n : ℕ, 4 < n → n ≠ 64 → n ≠ 256 → (4 ∣ Nat.centralBinom n ∨ 9 ∣ Nat.centralBinom n) /-- The power-of-two restriction of the GKP conjecture. -/ -def gkpPowerOfTwoConjecture : Prop := +@[expose] def gkpPowerOfTwoConjecture : Prop := ∀ k : ℕ, 2 < k → k ≠ 6 → k ≠ 8 → 9 ∣ Nat.centralBinom (2 ^ k) diff --git a/LeanPool/GKPCarry/UnitCarryCounting.lean b/LeanPool/GKPCarry/UnitCarryCounting.lean index 55d031d233..d529a092eb 100644 --- a/LeanPool/GKPCarry/UnitCarryCounting.lean +++ b/LeanPool/GKPCarry/UnitCarryCounting.lean @@ -31,7 +31,7 @@ count to that unit slice. Among unit words of length `n + 3`, exactly `(n + 9) * 2 ^ n` create fewer than two doubling carries. -/ -@[expose] public section +public section namespace GKPCarry @@ -112,7 +112,7 @@ theorem card_ternaryUnitWords (length : ℕ) : /-- Convert a ternary unit word to the corresponding unit modulo a power of three. -/ -def ternaryUnitWordToUnit (length : ℕ) : +@[expose] def ternaryUnitWordToUnit (length : ℕ) : TernaryUnitWords length → (ZMod (3 ^ (length + 1)))ˣ := fun word => ZMod.unitOfCoprime (ternaryWordValue word.val) ((ternaryWordValue_coprime_three_pow_iff word.val).mpr word.property) @@ -138,7 +138,7 @@ lemma ternaryUnitWordToUnit_injective (length : ℕ) : /-- Unit words are equivalent to the full unit group modulo the corresponding power of three. -/ -noncomputable def ternaryUnitWordEquiv (length : ℕ) : +@[expose] noncomputable def ternaryUnitWordEquiv (length : ℕ) : TernaryUnitWords length ≃ (ZMod (3 ^ (length + 1)))ˣ := Equiv.ofBijective (ternaryUnitWordToUnit length) <| (Fintype.bijective_iff_injective_and_card _).2 diff --git a/LeanPool/GapCVP/Part01A.lean b/LeanPool/GapCVP/Part01A.lean index 14d0e7caa9..d268ab6966 100644 --- a/LeanPool/GapCVP/Part01A.lean +++ b/LeanPool/GapCVP/Part01A.lean @@ -15,7 +15,7 @@ public import Mathlib.Computability.TuringMachine.Computable /-! # GapCVP proof, part 01 -/ -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ noncomputable def latticeDistance (I : GapCVPInstance) : ℝ := Metric.infDist I.targetPoint (Set.range I.latticePoint) /-- GapCVP reduction support. -/ -noncomputable def IsYes (I : GapCVPInstance) : Bool := +@[expose] noncomputable def IsYes (I : GapCVPInstance) : Bool := @decide ( I.latticeDistance ≤ (I.radius : ℝ) ) (Classical.propDecidable _) @@ -162,7 +162,7 @@ section open scoped BigOperators /-- GapCVP reduction support. -/ -def squaredDistance (I : GapCVPInstance) +@[expose] def squaredDistance (I : GapCVPInstance) (z : Fin I.dimension → ℤ) : ℝ := ∑ i : Fin I.dimension, (((I.target i : ℚ) : ℝ) - @@ -170,13 +170,13 @@ def squaredDistance (I : GapCVPInstance) (I.basis i j : ℝ) * (z j : ℝ)) ^ 2 /-- GapCVP reduction support. -/ -noncomputable def SquaredYes (I : GapCVPInstance) : Bool := +@[expose] noncomputable def SquaredYes (I : GapCVPInstance) : Bool := @decide ( ∃ z : Fin I.dimension → ℤ, squaredDistance I z ≤ (I.radius : ℝ) ^ 2 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def SquaredNoAt (c : ℝ) (I : GapCVPInstance) : Bool := +@[expose] noncomputable def SquaredNoAt (c : ℝ) (I : GapCVPInstance) : Bool := @decide ( ∀ z : Fin I.dimension → ℤ, (((I.dimension : ℝ) ^ c) * (I.radius : ℝ)) ^ 2 < @@ -343,17 +343,17 @@ noncomputable def clauseHasDistinctVariables (c : ThreeClause) : Bool := Function.Injective (fun i : Fin 3 => (c i).1) ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def literalSatisfied (assignment : ℕ → Bool) (l : Literal) : Bool := +@[expose] noncomputable def literalSatisfied (assignment : ℕ → Bool) (l : Literal) : Bool := @decide ( assignment l.1 = l.2 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def clauseSatisfied (assignment : ℕ → Bool) (c : ThreeClause) : Bool := +@[expose] noncomputable def clauseSatisfied (assignment : ℕ → Bool) (c : ThreeClause) : Bool := @decide ( ∃ i : Fin 3, literalSatisfied assignment (c i) ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def threeCNFSatisfiable (φ : ThreeCNF) : Bool := +@[expose] noncomputable def threeCNFSatisfiable (φ : ThreeCNF) : Bool := @decide ( (∀ c ∈ φ, clauseHasDistinctVariables c) ∧ ∃ assignment : ℕ → Bool, ∀ c ∈ φ, clauseSatisfied assignment c @@ -370,12 +370,12 @@ structure GapCVPInstance where radius : ℚ /-- GapCVP reduction support. -/ -noncomputable def gapCVPWellFormed (I : GapCVPInstance) : Bool := +@[expose] noncomputable def gapCVPWellFormed (I : GapCVPInstance) : Bool := @decide ( 0 < I.dimension ∧ I.basis.det ≠ 0 ∧ 0 < I.radius ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def distanceSquared (I : GapCVPInstance) +@[expose] noncomputable def distanceSquared (I : GapCVPInstance) (z : Fin I.dimension → ℤ) : ℝ := ∑ i : Fin I.dimension, (((∑ j : Fin I.dimension, @@ -392,7 +392,7 @@ class BinaryBitCodec (α : Type*) where namespace BinaryEncoding /-- GapCVP reduction support. -/ -def lengthPrefixedWord (word : List Bool) : List Bool := +@[expose] def lengthPrefixedWord (word : List Bool) : List Bool := List.replicate word.length true ++ false :: word @[simp] theorem lengthPrefixedWord_length (word : List Bool) : @@ -401,7 +401,7 @@ def lengthPrefixedWord (word : List Bool) : List Bool := omega /-- GapCVP reduction support. -/ -def readUnaryPrefix : List Bool → Option (ℕ × List Bool) +@[expose] def readUnaryPrefix : List Bool → Option (ℕ × List Bool) | [] => none | false :: rest => some (0, rest) | true :: rest => @@ -419,7 +419,7 @@ def readUnaryPrefix : List Bool → Option (ℕ × List Bool) simp only [List.replicate_succ, List.cons_append, readUnaryPrefix, ih] /-- GapCVP reduction support. -/ -def readLengthPrefixedWord (bits : List Bool) : +@[expose] def readLengthPrefixedWord (bits : List Bool) : Option (List Bool × List Bool) := match readUnaryPrefix bits with | none => none @@ -439,7 +439,7 @@ def readLengthPrefixedWord (bits : List Bool) : List.drop_left'] /-- GapCVP reduction support. -/ -def encodeLiteral (literal : Literal) : List Bool := +@[expose] def encodeLiteral (literal : Literal) : List Bool := lengthPrefixedWord (Computability.encodeNat literal.1) ++ [literal.2] /-- GapCVP reduction support. -/ @@ -458,7 +458,7 @@ def readLiteral (bits : List Bool) : Option (Literal × List Bool) := readLengthPrefixedWord_append, Computability.decode_encodeNat] /-- GapCVP reduction support. -/ -def encodeThreeClause (clause : ThreeClause) : List Bool := +@[expose] def encodeThreeClause (clause : ThreeClause) : List Bool := encodeLiteral (clause 0) ++ encodeLiteral (clause 1) ++ encodeLiteral (clause 2) @@ -509,7 +509,7 @@ def readThreeClauses : ℕ → List Bool → Option (ThreeCNF × List Bool) ih] /-- GapCVP reduction support. -/ -def encodeThreeCNF (clauses : ThreeCNF) : List Bool := +@[expose] def encodeThreeCNF (clauses : ThreeCNF) : List Bool := lengthPrefixedWord (Computability.encodeNat clauses.length) ++ clauses.flatMap encodeThreeClause @@ -545,7 +545,7 @@ end namespace BinaryEncoding /-- GapCVP reduction support. -/ -def encodeAtomic {α : Type*} [Encodable α] (a : α) : List Bool := +@[expose] def encodeAtomic {α : Type*} [Encodable α] (a : α) : List Bool := lengthPrefixedWord (Computability.encodeNat (Encodable.encode a)) /-- GapCVP reduction support. -/ @@ -566,7 +566,7 @@ def readAtomic {α : Type*} [Encodable α] (bits : List Bool) : Encodable.encodek] /-- GapCVP reduction support. -/ -def encodeFinValues {α : Type*} [Encodable α] : +@[expose] def encodeFinValues {α : Type*} [Encodable α] : (n : ℕ) → (Fin n → α) → List Bool | 0, _ => [] | n + 1, values => @@ -607,7 +607,7 @@ def readFinValues {α : Type*} [Encodable α] : simp only [readFinValues, encodeFinValues, List.append_assoc, readAtomic_append, ih, hvalues] /-- GapCVP reduction support. -/ -def encodeMatrixRows : +@[expose] def encodeMatrixRows : (m n : ℕ) → (Fin m → Fin n → ℤ) → List Bool | 0, _, _ => [] | m + 1, n, matrix => @@ -651,7 +651,7 @@ def readMatrixRows : hmatrix] /-- GapCVP reduction support. -/ -def encodeGapCVPInstance (I : GapCVPInstance) : List Bool := +@[expose] def encodeGapCVPInstance (I : GapCVPInstance) : List Bool := encodeAtomic I.dimension ++ encodeAtomic I.radius ++ encodeFinValues I.dimension I.target ++ @@ -708,7 +708,7 @@ noncomputable instance (priority := 2000) instBinaryBitCodecGapCVPInstance : open Computability /-- GapCVP reduction support. -/ -noncomputable def binaryFinEncoding (α : Type*) +@[expose] noncomputable def binaryFinEncoding (α : Type*) [BinaryBitCodec α] : Encoding α Bool where encode := BinaryBitCodec.encode decode := BinaryBitCodec.decode @@ -737,7 +737,7 @@ abbrev VerifierTM (verifier : List Bool × List Bool → Bool) := pairBitEncoding Computability.encodeBool verifier /-- GapCVP reduction support. -/ -noncomputable def IsNP (L : BitLanguage) : Bool := +@[expose] noncomputable def IsNP (L : BitLanguage) : Bool := @decide ( ∃ (bound : Polynomial ℕ) (verifier : List Bool × List Bool → Bool), Nonempty (VerifierTM verifier) ∧ @@ -763,7 +763,7 @@ noncomputable def PolynomialTimeClosedUnderComposition : Bool := Nonempty (BitTM (g ∘ f)) ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def NPHard (L : BitLanguage) : Bool := +@[expose] noncomputable def NPHard (L : BitLanguage) : Bool := @decide ( ∀ A : BitLanguage, IsNP A → Nonempty (PolynomialReduction A L) ) (Classical.propDecidable _) @@ -792,7 +792,7 @@ structure PromiseReduction (A : BitLanguage) (P : PromiseProblem) where soundness : ∀ x, ¬ A x → P.no (map x) /-- GapCVP reduction support. -/ -noncomputable def NPHardPromise (P : PromiseProblem) : Bool := +@[expose] noncomputable def NPHardPromise (P : PromiseProblem) : Bool := @decide ( ∀ A : BitLanguage, IsNP A → Nonempty (PromiseReduction A P) ) (Classical.propDecidable _) @@ -801,7 +801,7 @@ end section /-- GapCVP reduction support. -/ -noncomputable def gapYES (I : GapCVPInstance) : Bool := +@[expose] noncomputable def gapYES (I : GapCVPInstance) : Bool := @decide ( gapCVPWellFormed I ∧ ∃ z : Fin I.dimension → ℤ, @@ -1197,6 +1197,7 @@ noncomputable def liftSecondStmt | .halt => .halt /-- GapCVP reduction support. -/ +@[expose] noncomputable def machine {f g : List Bool → List Bool} (first : BitTM f) @@ -1228,6 +1229,7 @@ noncomputable def machine } /-- GapCVP reduction support. -/ +@[expose] noncomputable def auxiliary {f g : List Bool → List Bool} (first : BitTM f) @@ -1960,11 +1962,11 @@ abbrev Clause (T S : ℕ) := Finset (SignedLiteral T S) abbrev Formula (T S : ℕ) := Finset (Clause T S) /-- GapCVP reduction support. -/ -def positive {T S : ℕ} (v : Variable T S) : SignedLiteral T S := +@[expose] def positive {T S : ℕ} (v : Variable T S) : SignedLiteral T S := (v, true) /-- GapCVP reduction support. -/ -def negative {T S : ℕ} (v : Variable T S) : SignedLiteral T S := +@[expose] def negative {T S : ℕ} (v : Variable T S) : SignedLiteral T S := (v, false) private noncomputable def satisfiesClause {T S : ℕ} @@ -1978,22 +1980,22 @@ private noncomputable def satisfiesFormula {T S : ℕ} ∀ clause ∈ formula, satisfiesClause assignment clause ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -def atLeastOneClause {T S : ℕ} +@[expose] def atLeastOneClause {T S : ℕ} (t : Time T) (i : Position T) : Clause T S := Finset.univ.image (fun s : Symbol S => positive (t, i, s)) /-- GapCVP reduction support. -/ -def atMostOneClause {T S : ℕ} +@[expose] def atMostOneClause {T S : ℕ} (t : Time T) (i : Position T) (a b : Symbol S) : Clause T S := {negative (t, i, a), negative (t, i, b)} /-- GapCVP reduction support. -/ -def initialClause {T S : ℕ} +@[expose] def initialClause {T S : ℕ} (input : Position T → Symbol S) (i : Position T) : Clause T S := {positive ((0 : Time T), i, input i)} /-- GapCVP reduction support. -/ -def acceptanceClause {T S : ℕ} (accept : Symbol S) : Clause T S := +@[expose] def acceptanceClause {T S : ℕ} (accept : Symbol S) : Clause T S := Finset.univ.image (fun i : Position T => positive ((Fin.last T), i, accept)) @@ -2002,20 +2004,22 @@ abbrev Window (T : ℕ) := { ti : Time T × Position T // ti.1.val + 1 < T + 1 } /-- GapCVP reduction support. -/ -def nextTime {T : ℕ} (w : Window T) : Time T := +@[expose] def nextTime {T : ℕ} (w : Window T) : Time T := ⟨w.1.1.val + 1, w.2⟩ /-- GapCVP reduction support. -/ +@[expose] def leftPosition {T : ℕ} (w : Window T) : Position T := ⟨w.1.2.val - 1, Nat.lt_of_le_of_lt (Nat.sub_le _ _) w.1.2.isLt⟩ /-- GapCVP reduction support. -/ +@[expose] def rightPosition {T : ℕ} (w : Window T) : Position T := ⟨min (w.1.2.val + 1) T, Nat.lt_succ_of_le (Nat.min_le_right _ _)⟩ /-- GapCVP reduction support. -/ -def windowAt {T : ℕ} (t : Fin T) (i : Position T) : Window T := +@[expose] def windowAt {T : ℕ} (t : Fin T) (i : Position T) : Window T := ⟨(⟨t.val, Nat.lt_trans t.isLt (Nat.lt_succ_self T)⟩, i), Nat.add_lt_add_right t.isLt 1⟩ @@ -2024,7 +2028,7 @@ abbrev WindowSymbols (S : ℕ) := Symbol S × Symbol S × Symbol S × Symbol S /-- GapCVP reduction support. -/ -def transitionClause {T S : ℕ} +@[expose] def transitionClause {T S : ℕ} (w : Window T) (symbols : WindowSymbols S) : Clause T S := { negative (w.1.1, leftPosition w, symbols.1), negative (w.1.1, w.1.2, symbols.2.1), @@ -2041,7 +2045,7 @@ structure Specification (T S : ℕ) where allowed : WindowSymbols S → Bool /-- GapCVP reduction support. -/ -def structuralClauses (T S : ℕ) : Formula T S := +@[expose] def structuralClauses (T S : ℕ) : Formula T S := (Finset.univ.image fun p : Time T × Position T => atLeastOneClause p.1 p.2) ∪ ((Finset.univ.filter fun p : @@ -2050,22 +2054,22 @@ def structuralClauses (T S : ℕ) : Formula T S := atMostOneClause p.1.1 p.1.2 p.2.1 p.2.2) /-- GapCVP reduction support. -/ -def initialClauses {T S : ℕ} (spec : Specification T S) : Formula T S := +@[expose] def initialClauses {T S : ℕ} (spec : Specification T S) : Formula T S := Finset.univ.image fun i : Position T => initialClause spec.input i /-- GapCVP reduction support. -/ -def transitionClauses {T S : ℕ} +@[expose] def transitionClauses {T S : ℕ} (spec : Specification T S) : Formula T S := ((Finset.univ.filter fun p : Window T × WindowSymbols S => spec.allowed p.2 = false).image fun p => transitionClause p.1 p.2) /-- GapCVP reduction support. -/ -def tableauFormula {T S : ℕ} (spec : Specification T S) : Formula T S := +@[expose] def tableauFormula {T S : ℕ} (spec : Specification T S) : Formula T S := structuralClauses T S ∪ initialClauses spec ∪ {acceptanceClause spec.accept} ∪ transitionClauses spec /-- GapCVP reduction support. -/ -noncomputable def ValidTrace {T S : ℕ} (spec : Specification T S) +@[expose] noncomputable def ValidTrace {T S : ℕ} (spec : Specification T S) (trace : Time T → Position T → Symbol S) : Bool := @decide ( (∀ i, trace 0 i = spec.input i) ∧ @@ -2450,7 +2454,7 @@ namespace ThreeCNFReduction open GapCVP.CL /-- GapCVP reduction support. -/ -def sortedElements {α : Type} [Encodable α] (s : Finset α) : List α := by +@[expose] def sortedElements {α : Type} [Encodable α] (s : Finset α) : List α := by letI : IsTrans α (fun a b : α => Encodable.encode a ≤ Encodable.encode b) := ⟨fun _ _ _ hab hbc => Nat.le_trans hab hbc⟩ @@ -2494,7 +2498,7 @@ private noncomputable def satisfies (assignment : ℕ → Bool) (formula : Three simp only [satisfies, List.mem_cons, List.not_mem_nil, or_false, forall_eq, Bool.decide_eq_true] /-- GapCVP reduction support. -/ -noncomputable def allDistinct (formula : ThreeCNF) : Bool := +@[expose] noncomputable def allDistinct (formula : ThreeCNF) : Bool := @decide ( ∀ clause ∈ formula, clauseHasDistinctVariables clause ) (Classical.propDecidable _) @@ -2520,11 +2524,11 @@ private theorem threeCNFSatisfiable_iff (formula : ThreeCNF) : GapCVP.ThreeCNFReduction.satisfies, decide_eq_true_eq] /-- GapCVP reduction support. -/ -def sourceVariable {T S : ℕ} (v : Variable T S) : ℕ := +@[expose] def sourceVariable {T S : ℕ} (v : Variable T S) : ℕ := 4 * Encodable.encode v /-- GapCVP reduction support. -/ -def accumulatorVariable (clauseIndex prefixIndex : ℕ) : ℕ := +@[expose] def accumulatorVariable (clauseIndex prefixIndex : ℕ) : ℕ := 4 * Encodable.encode (clauseIndex, prefixIndex) + 1 private theorem accumulatorVariable_injective : @@ -2575,7 +2579,7 @@ private theorem consecutive_accumulatorVariables_ne omega /-- GapCVP reduction support. -/ -def triple (a b c : Literal) : ThreeClause := ![a, b, c] +@[expose] def triple (a b c : Literal) : ThreeClause := ![a, b, c] @[simp] private theorem clauseSatisfied_triple (assignment : ℕ → Bool) (a b c : Literal) : @@ -2596,7 +2600,7 @@ private theorem triple_distinct (a b c : Literal) simp_all [triple] /-- GapCVP reduction support. -/ -def paddedBinary (a b : Literal) : ThreeCNF := +@[expose] def paddedBinary (a b : Literal) : ThreeCNF := [triple a b (2, true), triple a b (2, false)] @@ -2622,7 +2626,7 @@ private theorem paddedBinary_allDistinct (a b : Literal) exact triple_distinct _ _ _ hab ha hb /-- GapCVP reduction support. -/ -def paddedUnary (a : Literal) : ThreeCNF := +@[expose] def paddedUnary (a : Literal) : ThreeCNF := [triple a (2, false) (3, false), triple a (2, false) (3, true), triple a (2, true) (3, false), @@ -2649,7 +2653,7 @@ private theorem paddedUnary_allDistinct (a : Literal) exact triple_distinct _ _ _ ha₀ ha₁ (by decide) /-- GapCVP reduction support. -/ -def negate (a : Literal) : Literal := (a.1, !a.2) +@[expose] def negate (a : Literal) : Literal := (a.1, !a.2) @[simp] private theorem literalSatisfied_negate (assignment : ℕ → Bool) (a : Literal) : @@ -2660,7 +2664,7 @@ def negate (a : Literal) : Literal := (a.1, !a.2) simp [negate, literalSatisfied] /-- GapCVP reduction support. -/ -def orGate (a b output : Literal) : ThreeCNF := +@[expose] def orGate (a b output : Literal) : ThreeCNF := paddedBinary (negate a) output ++ paddedBinary (negate b) output ++ [triple a b (negate output)] @@ -2708,17 +2712,17 @@ private theorem orGate_allDistinct (a b output : Literal) List.length_nil, zero_add, Nat.reduceAdd] /-- GapCVP reduction support. -/ -def sourceLiteral {T S : ℕ} +@[expose] def sourceLiteral {T S : ℕ} (literal : SignedLiteral T S) : Literal := (sourceVariable literal.1, literal.2) /-- GapCVP reduction support. -/ -def accumulatorLiteral +@[expose] def accumulatorLiteral (clauseIndex prefixIndex : ℕ) (value : Bool) : Literal := (accumulatorVariable clauseIndex prefixIndex, value) /-- GapCVP reduction support. -/ -def gateList {T S : ℕ} (clauseIndex : ℕ) : +@[expose] def gateList {T S : ℕ} (clauseIndex : ℕ) : ℕ → List (SignedLiteral T S) → ThreeCNF | _, [] => [] | prefixIndex, literal :: remaining => @@ -2750,7 +2754,7 @@ private theorem gateList_allDistinct {T S : ℕ} clauseIndex prefixIndex /-- GapCVP reduction support. -/ -def encodeClause {T S : ℕ} +@[expose] def encodeClause {T S : ℕ} (clauseIndex : ℕ) (clause : Clause T S) : ThreeCNF := paddedUnary (accumulatorLiteral clauseIndex 0 true) ++ gateList clauseIndex 0 (sortedElements clause) ++ @@ -2772,7 +2776,7 @@ private theorem encodeClause_allDistinct {T S : ℕ} clauseIndex (sortedElements clause).length)⟩ /-- GapCVP reduction support. -/ -def encodeFormulaFrom {T S : ℕ} : +@[expose] def encodeFormulaFrom {T S : ℕ} : ℕ → List (Clause T S) → ThreeCNF | _, [] => [] | clauseIndex, clause :: remaining => @@ -2790,7 +2794,7 @@ private theorem encodeFormulaFrom_allDistinct {T S : ℕ} ih (clauseIndex + 1)⟩ /-- Encode a finite formula as clauses for the reduction. -/ -def encodeFormula {T S : ℕ} (formula : Formula T S) : ThreeCNF := +@[expose] def encodeFormula {T S : ℕ} (formula : Formula T S) : ThreeCNF := encodeFormulaFrom 0 (sortedElements formula) theorem encodeFormula_allDistinct {T S : ℕ} (formula : Formula T S) : @@ -3094,7 +3098,7 @@ private theorem encodeFormula_satisfiable_iff {T S : ℕ} encodeFormula_complete formula assignment hsatisfied⟩ /-- GapCVP reduction support. -/ -def encodeTableau {T S : ℕ} (spec : Specification T S) : ThreeCNF := +@[expose] def encodeTableau {T S : ℕ} (spec : Specification T S) : ThreeCNF := encodeFormula (tableauFormula spec) private theorem encodeTableau_satisfiable_iff_validTrace {T S : ℕ} @@ -3145,7 +3149,7 @@ theorem encodeNat_length_eq_size (n : ℕ) : simp only [Num.of_natCast, Nat.cast_id] /-- GapCVP reduction support. -/ -def verifierInput +@[expose] def verifierInput {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (x certificate : List Bool) : List (machine.tm.Γ machine.tm.k₀) := @@ -3545,7 +3549,7 @@ structure TableauSimulation Nonempty (AcceptedExecution bound machine x) /-- GapCVP reduction support. -/ -noncomputable def encodedTableau +@[expose] noncomputable def encodedTableau {bound : Polynomial ℕ} {verifier : List Bool × List Bool → Bool} {machine : VerifierTM verifier} @@ -3649,7 +3653,7 @@ inductive GuessStep (.verifying certificate next) /-- GapCVP reduction support. -/ -def oneStepEvalsTo +@[expose] def oneStepEvalsTo (tm : Turing.FinTM2) (configuration next : tm.Cfg) (hstep : tm.step configuration = some next) : @@ -3879,14 +3883,14 @@ private noncomputable def configurationTraceRun exact hprefix steps (le_refl steps) /-- GapCVP reduction support. -/ -noncomputable def guessTimePolynomial +@[expose] noncomputable def guessTimePolynomial (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) : Polynomial ℕ := bound + 1 + witnessTimePolynomial bound machine /-- GapCVP reduction support. -/ -noncomputable def nondeterministicTableauDimensionPolynomial +@[expose] noncomputable def nondeterministicTableauDimensionPolynomial (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) : Polynomial ℕ := @@ -4075,7 +4079,7 @@ structure LocalTableauCompiler GuessingExecution bound machine x /-- GapCVP reduction support. -/ -noncomputable def tableauSimulationOfLocalCompiler +@[expose] noncomputable def tableauSimulationOfLocalCompiler (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -4228,6 +4232,7 @@ def pushSourceOfSlot (tm : Turing.FinTM2) exact slot.2.isLt⟩ /-- GapCVP reduction support. -/ +@[expose] def cellAtomValue {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -4506,7 +4511,7 @@ namespace CLCellRows open Computability GapCVP.CLBoundedStates GapCVP.CLPushAlphabet /-- GapCVP reduction support. -/ -def paddedAtom {tm : Turing.FinTM2} +@[expose] def paddedAtom {tm : Turing.FinTM2} (atoms : List (CellAtom tm)) (index : ℕ) : CellAtom tm := (atoms[index]?).getD none @@ -4535,7 +4540,7 @@ theorem paddedAtom_decode | succ index => simpa only [paddedAtom, List.getElem?_cons_succ] using ih index /-- GapCVP reduction support. -/ -def certificatePhase (certificate : List Bool) (index : ℕ) : PhaseTag := +@[expose] def certificatePhase (certificate : List Bool) (index : ℕ) : PhaseTag := if h : index < certificate.length then if certificate.get ⟨index, h⟩ then .verifying @@ -4576,7 +4581,7 @@ abbrev CellRow (tm : Turing.FinTM2) (width : ℕ) := Fin (width + 1) → LocalCellSymbol tm /-- GapCVP reduction support. -/ -def guessingRow (tm : Turing.FinTM2) (width : ℕ) +@[expose] def guessingRow (tm : Turing.FinTM2) (width : ℕ) (certificate : List Bool) : CellRow tm width := fun index => (certificatePhase certificate index.val, @@ -4585,7 +4590,7 @@ def guessingRow (tm : Turing.FinTM2) (width : ℕ) false) /-- GapCVP reduction support. -/ -def configurationControl (tm : Turing.FinTM2) +@[expose] def configurationControl (tm : Turing.FinTM2) (configuration : tm.Cfg) : tm.Λ × tm.σ := (configuration.l.getD tm.main, configuration.var) @@ -4654,6 +4659,7 @@ private theorem statementStackActions_le_max (Finset.mem_univ label) /-- GapCVP reduction support. -/ +@[expose] def blockSize (tm : Turing.FinTM2) : ℕ := maxStackEditsPerStep tm + 1 @@ -4676,7 +4682,7 @@ instance instFintypeBlockCell (tm : Turing.FinTM2) : infer_instance /-- GapCVP reduction support. -/ -def blankCell (tm : Turing.FinTM2) : LocalCellSymbol tm := +@[expose] def blankCell (tm : Turing.FinTM2) : LocalCellSymbol tm := (.guessing, none, fun _ => none, false) /-- A row of blocks covering the encoded machine configuration. -/ @@ -4684,7 +4690,7 @@ abbrev BlockRow (tm : Turing.FinTM2) (width : ℕ) := Fin (width + 1) → BlockCell tm /-- GapCVP reduction support. -/ -def packRow (tm : Turing.FinTM2) (width : ℕ) +@[expose] def packRow (tm : Turing.FinTM2) (width : ℕ) (row : CellRow tm width) : BlockRow tm width := fun block offset => if h : block.val * blockSize tm + offset.val < width + 1 then @@ -4693,14 +4699,14 @@ def packRow (tm : Turing.FinTM2) (width : ℕ) blankCell tm /-- GapCVP reduction support. -/ -def coordinateBlock (tm : Turing.FinTM2) (width : ℕ) +@[expose] def coordinateBlock (tm : Turing.FinTM2) (width : ℕ) (index : Fin (width + 1)) : Fin (width + 1) := ⟨index.val / blockSize tm, Nat.lt_of_le_of_lt (Nat.div_le_self index.val (blockSize tm)) index.isLt⟩ /-- GapCVP reduction support. -/ -def coordinateOffset (tm : Turing.FinTM2) (width : ℕ) +@[expose] def coordinateOffset (tm : Turing.FinTM2) (width : ℕ) (index : Fin (width + 1)) : Fin (blockSize tm) := ⟨index.val % blockSize tm, Nat.mod_lt index.val (blockSize_pos tm)⟩ @@ -4730,13 +4736,13 @@ theorem packRow_cell simpa only [coordinateBlock, coordinateOffset] using hcoordinate /-- GapCVP reduction support. -/ -def leftBlock (width : ℕ) +@[expose] def leftBlock (width : ℕ) (index : Fin (width + 1)) : Fin (width + 1) := ⟨index.val - 1, Nat.lt_of_le_of_lt (Nat.sub_le _ _) index.isLt⟩ /-- GapCVP reduction support. -/ -def rightBlock (width : ℕ) +@[expose] def rightBlock (width : ℕ) (index : Fin (width + 1)) : Fin (width + 1) := ⟨min (index.val + 1) width, Nat.lt_succ_of_le (Nat.min_le_right _ _)⟩ @@ -4781,7 +4787,7 @@ open Computability GapCVP.CLBoundedStates GapCVP.CLCellRows GapCVP.CLLocalWindow abbrev GuessPhaseWindow := PhaseTag × PhaseTag × PhaseTag × PhaseTag /-- GapCVP reduction support. -/ -noncomputable def GuessPhaseAllowed (window : GuessPhaseWindow) : Bool := +@[expose] noncomputable def GuessPhaseAllowed (window : GuessPhaseWindow) : Bool := @decide ( (window.2.1 = .accepting ∧ window.2.2.1 = .guessing ∧ @@ -4795,7 +4801,7 @@ noncomputable def GuessPhaseAllowed (window : GuessPhaseWindow) : Bool := window.2.2.2 = window.2.1) ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -def guessPhaseWindowAt (width : ℕ) +@[expose] def guessPhaseWindowAt (width : ℕ) (first next : List Bool) (index : Fin (width + 1)) : GuessPhaseWindow := (certificatePhase first (leftBlock width index).val, @@ -4938,7 +4944,7 @@ namespace CLExactStackRules open Computability GapCVP.CLBoundedStates GapCVP.CLPushAlphabet /-- GapCVP reduction support. -/ -noncomputable def SupportedStackValue +@[expose] noncomputable def SupportedStackValue {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (stack : machine.tm.K) @@ -4989,7 +4995,7 @@ theorem canonicalCellAtom_decode (by simpa only [SupportedStackValue, decide_eq_true_eq] using hsupported) /-- GapCVP reduction support. -/ -def canonicalStackAtoms +@[expose] def canonicalStackAtoms {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (stack : machine.tm.K) @@ -5125,7 +5131,7 @@ namespace CLExactVerifierRules open Computability GapCVP.CLLocalWindows /-- GapCVP reduction support. -/ -noncomputable def StackPrefixAgreement +@[expose] noncomputable def StackPrefixAgreement {K : Type} {Γ : K → Type} (radius : ℕ) (first next : ∀ stack : K, List (Γ stack)) : Bool := @@ -5261,7 +5267,7 @@ instance instFintypeSingleStackHint (tm : Turing.FinTM2) : infer_instance /-- GapCVP reduction support. -/ -def atomBlockAt (tm : Turing.FinTM2) +@[expose] def atomBlockAt (tm : Turing.FinTM2) (atoms : List (CellAtom tm)) (index : ℕ) : AtomBlock tm := fun offset => paddedAtom atoms (index * blockSize tm + offset.val) @@ -5271,7 +5277,7 @@ abbrev StackShiftWindow (tm : Turing.FinTM2) := AtomBlock tm × AtomBlock tm × AtomBlock tm × AtomBlock tm × Bool /-- GapCVP reduction support. -/ -def stackShiftWindowAt (tm : Turing.FinTM2) (width : ℕ) +@[expose] def stackShiftWindowAt (tm : Turing.FinTM2) (width : ℕ) (first next : List (CellAtom tm)) (index : Fin (width + 1)) : StackShiftWindow tm := (atomBlockAt tm first (leftBlock width index).val, @@ -5281,7 +5287,7 @@ def stackShiftWindowAt (tm : Turing.FinTM2) (width : ℕ) decide (index.val = 0)) /-- GapCVP reduction support. -/ -def shiftedWindowAtom (tm : Turing.FinTM2) +@[expose] def shiftedWindowAtom (tm : Turing.FinTM2) (hint : SingleStackHint tm) (window : StackShiftWindow tm) (offset : Fin (blockSize tm)) : CellAtom tm := @@ -5305,7 +5311,7 @@ def shiftedWindowAtom (tm : Turing.FinTM2) omega⟩ /-- GapCVP reduction support. -/ -noncomputable def StackShiftAllowed (tm : Turing.FinTM2) +@[expose] noncomputable def StackShiftAllowed (tm : Turing.FinTM2) (hint : SingleStackHint tm) (window : StackShiftWindow tm) : Bool := @decide ( @@ -5335,7 +5341,7 @@ open Computability GapCVP.CLBoundedStates GapCVP.CLPushAlphabet GapCVP.CLCellRow open GapCVP.CLExactStackRules GapCVP.CLCompleteLocalCompiler /-- GapCVP reduction support. -/ -noncomputable def NoBlankAtoms (tm : Turing.FinTM2) +@[expose] noncomputable def NoBlankAtoms (tm : Turing.FinTM2) (atoms : List (CellAtom tm)) : Bool := @decide ( ∀ atom ∈ atoms, atom ≠ none @@ -5464,7 +5470,7 @@ noncomputable def AllStackShiftWindows (tm : Turing.FinTM2) (width : ℕ) (stackShiftWindowAt tm width first next index) = true ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def PrefixHintCorrect (tm : Turing.FinTM2) +@[expose] noncomputable def PrefixHintCorrect (tm : Turing.FinTM2) (hint : SingleStackHint tm) (next : List (CellAtom tm)) : Bool := @decide ( @@ -5787,7 +5793,7 @@ instance instFintypeFiniteVerifierHint (tm : Turing.FinTM2) : infer_instance /-- GapCVP reduction support. -/ -noncomputable def AllVerifierStackWindows +@[expose] noncomputable def AllVerifierStackWindows {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (width : ℕ) @@ -6175,7 +6181,7 @@ theorem filterMap_ofFn_getElem true_and] using ih rest /-- GapCVP reduction support. -/ -def decodedAtomBlock +@[expose] def decodedAtomBlock {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (stack : machine.tm.K) @@ -6218,7 +6224,7 @@ abbrev FiniteVerifierHeadQuery (tm : Turing.FinTM2) := (Option tm.Λ × tm.σ) /-- GapCVP reduction support. -/ -def finiteHeadConfiguration +@[expose] def finiteHeadConfiguration {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (control : Option machine.tm.Λ × machine.tm.σ) @@ -6229,7 +6235,7 @@ def finiteHeadConfiguration stk stack := decodedAtomBlock machine stack (heads stack) /-- Turn a finite query into a head-position query. -/ -def finiteHeadQueryOf +@[expose] def finiteHeadQueryOf {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (first next : machine.tm.Cfg) @@ -6321,7 +6327,7 @@ structure PrefixScript {K : Type} (Γ : K → Type) where pushed : ∀ stack : K, List (Γ stack) /-- GapCVP reduction support. -/ -def scriptStacks {K : Type} {Γ : K → Type} +@[expose] def scriptStacks {K : Type} {Γ : K → Type} (original : ∀ stack : K, List (Γ stack)) (script : PrefixScript Γ) : ∀ stack : K, List (Γ stack) := @@ -6695,7 +6701,7 @@ private theorem emptyPrefixScript_bounds exact ⟨hdrop.trans_lt hstatement, hpush.trans_lt hstatement⟩ /-- GapCVP reduction support. -/ -def finiteHeadScriptRun +@[expose] def finiteHeadScriptRun {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (label : machine.tm.Λ) @@ -6817,7 +6823,7 @@ private theorem finiteHeadScriptRun_eq_actual exact hscript.symm /-- GapCVP reduction support. -/ -def scriptVerifierQueryOf +@[expose] def scriptVerifierQueryOf {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (first next : machine.tm.Cfg) @@ -7211,13 +7217,13 @@ open GapCVP.CLFiniteShiftWindows GapCVP.CLExactVerifierTransition GapCVP.CLLocal open GapCVP.CLGlobalTableauSimulation /-- GapCVP reduction support. -/ -def stackAtomsOfBlock (tm : Turing.FinTM2) +@[expose] def stackAtomsOfBlock (tm : Turing.FinTM2) (block : BlockCell tm) (stack : tm.K) : AtomBlock tm := fun offset => (block offset).2.2.1 stack /-- GapCVP reduction support. -/ -def machineControlOfBlock (tm : Turing.FinTM2) +@[expose] def machineControlOfBlock (tm : Turing.FinTM2) (block : BlockCell tm) : Option (Option tm.Λ × tm.σ) := match (block ⟨0, blockSize_pos tm⟩).2.1 with | none => none @@ -7246,7 +7252,7 @@ abbrev ScriptBlockWindow (tm : Turing.FinTM2) := ScriptBlockCell tm × ScriptBlockCell tm /-- GapCVP reduction support. -/ -def scriptBlockWindowAt (tm : Turing.FinTM2) +@[expose] def scriptBlockWindowAt (tm : Turing.FinTM2) (width : ℕ) (first next : ScriptBlockRow tm width) (index : Fin (width + 1)) : ScriptBlockWindow tm := @@ -7256,7 +7262,7 @@ def scriptBlockWindowAt (tm : Turing.FinTM2) next index) /-- GapCVP reduction support. -/ -def canonicalVerifyingRow +@[expose] def canonicalVerifyingRow {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (width : ℕ) @@ -7312,7 +7318,7 @@ theorem stackAtomsOfBlock_pack_canonical (index.val * blockSize machine.tm + offset.val) hbound] /-- GapCVP reduction support. -/ -def canonicalScriptBlockRow +@[expose] def canonicalScriptBlockRow {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (width : ℕ) @@ -7357,7 +7363,7 @@ theorem machineControlOfBlock_pack_canonical Option.isSome_some, ↓reduceIte] /-- GapCVP reduction support. -/ -def scriptQueryOfBlockWindow +@[expose] def scriptQueryOfBlockWindow {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : ScriptBlockWindow machine.tm) : @@ -7377,7 +7383,7 @@ def scriptQueryOfBlockWindow | _, _ => none /-- GapCVP reduction support. -/ -def stackWindowOfScriptBlock +@[expose] def stackWindowOfScriptBlock (tm : Turing.FinTM2) (window : ScriptBlockWindow tm) (stack : tm.K) : StackShiftWindow tm := @@ -7388,7 +7394,7 @@ def stackWindowOfScriptBlock window.2.1.2.2) /-- GapCVP reduction support. -/ -noncomputable def ScriptBlockCoherent (tm : Turing.FinTM2) +@[expose] noncomputable def ScriptBlockCoherent (tm : Turing.FinTM2) (window : ScriptBlockWindow tm) : Bool := @decide ( window.1.1.2 = window.2.1.1.2 ∧ @@ -7799,7 +7805,7 @@ inductive PairedInputTag where deriving DecidableEq, Fintype /-- GapCVP reduction support. -/ -def pairedInputTagAt (x certificate : List Bool) +@[expose] def pairedInputTagAt (x certificate : List Bool) (index : ℕ) : PairedInputTag := match (pairBitEncoding (x, certificate))[index]? with | some value => .bit value diff --git a/LeanPool/GapCVP/Part01B.lean b/LeanPool/GapCVP/Part01B.lean index 2fe36f69ce..e70d84c713 100644 --- a/LeanPool/GapCVP/Part01B.lean +++ b/LeanPool/GapCVP/Part01B.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part01A /-! # GapCVP proof, part 01, continuation 02 -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ abbrev PhaseMaskBlock (tm : Turing.FinTM2) := Fin (blockSize tm) → Bool /-- GapCVP reduction support. -/ -def pairedInputBlockAt (tm : Turing.FinTM2) +@[expose] def pairedInputBlockAt (tm : Turing.FinTM2) (width : ℕ) (x certificate : List Bool) (position : Fin (width + 1)) : PairedInputBlock tm := fun offset => @@ -50,14 +50,14 @@ def pairedInputBlockAt (tm : Turing.FinTM2) .blank /-- GapCVP reduction support. -/ -def phaseRangeBlockAt (tm : Turing.FinTM2) +@[expose] def phaseRangeBlockAt (tm : Turing.FinTM2) (width : ℕ) (position : Fin (width + 1)) : PhaseMaskBlock tm := fun offset => decide (position.val * blockSize tm + offset.val < width + 1) /-- GapCVP reduction support. -/ -def phaseBudgetBlockAt +@[expose] def phaseBudgetBlockAt (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -70,7 +70,7 @@ def phaseBudgetBlockAt x.length + bound.eval x.length) /-- GapCVP reduction support. -/ -def initialPairedAtom +@[expose] def initialPairedAtom {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (stack : machine.tm.K) @@ -91,7 +91,7 @@ def initialPairedAtom | .blank => none /-- GapCVP reduction support. -/ -def initializedPhaseBlock +@[expose] def initializedPhaseBlock {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (old : BlockCell machine.tm) @@ -161,28 +161,28 @@ abbrev CompletePhaseWindow (tm : Turing.FinTM2) := CompletePhaseCell tm × CompletePhaseCell tm /-- GapCVP reduction support. -/ -def completeMachineBlock (tm : Turing.FinTM2) +@[expose] def completeMachineBlock (tm : Turing.FinTM2) (cell : CompletePhaseCell tm) : BlockCell tm := cell.script.1.1 /-- GapCVP reduction support. -/ -def completeMachineHead (tm : Turing.FinTM2) +@[expose] def completeMachineHead (tm : Turing.FinTM2) (cell : CompletePhaseCell tm) : BlockCell tm := cell.script.1.2 /-- GapCVP reduction support. -/ -def completeIsFirstBlock (tm : Turing.FinTM2) +@[expose] def completeIsFirstBlock (tm : Turing.FinTM2) (cell : CompletePhaseCell tm) : Bool := cell.script.2.2 /-- GapCVP reduction support. -/ -def lastPhaseOffset (tm : Turing.FinTM2) : Fin (blockSize tm) := +@[expose] def lastPhaseOffset (tm : Turing.FinTM2) : Fin (blockSize tm) := ⟨blockSize tm - 1, by have hpositive := blockSize_pos tm omega⟩ /-- GapCVP reduction support. -/ -def phaseLeftOffset {α : Type} +@[expose] def phaseLeftOffset {α : Type} (tm : Turing.FinTM2) (first : Bool) (left center : Fin (blockSize tm) → α) @@ -195,7 +195,7 @@ def phaseLeftOffset {α : Type} omega⟩ /-- GapCVP reduction support. -/ -def phaseRightOffset {α : Type} +@[expose] def phaseRightOffset {α : Type} (tm : Turing.FinTM2) (center right : Fin (blockSize tm) → α) (offset : Fin (blockSize tm)) : α := @@ -205,7 +205,7 @@ def phaseRightOffset {α : Type} right ⟨0, blockSize_pos tm⟩ /-- GapCVP reduction support. -/ -def completeWitnessWindow +@[expose] def completeWitnessWindow (tm : Turing.FinTM2) (window : CompletePhaseWindow tm) (offset : Fin (blockSize tm)) : GuessPhaseWindow := @@ -226,7 +226,7 @@ def completeWitnessWindow (completeMachineBlock tm window.2.2.2 offset).1) /-- GapCVP reduction support. -/ -def completePayloadWindow +@[expose] def completePayloadWindow (tm : Turing.FinTM2) (window : CompletePhaseWindow tm) (offset : Fin (blockSize tm)) : @@ -240,7 +240,7 @@ def completePayloadWindow window.2.2.2.payload offset) /-- GapCVP reduction support. -/ -noncomputable def PairedInputGuessAllowed +@[expose] noncomputable def PairedInputGuessAllowed (bit : Bool) (window : PairedInputTag × PairedInputTag × @@ -257,7 +257,7 @@ noncomputable def PairedInputGuessAllowed window.2.2.2 = window.2.1) ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def BroadcastWitnessGuessAllowed +@[expose] noncomputable def BroadcastWitnessGuessAllowed (bit : Bool) (window : GuessPhaseWindow) : Bool := @decide ( @@ -267,7 +267,7 @@ noncomputable def BroadcastWitnessGuessAllowed if bit then PhaseTag.verifying else PhaseTag.guessing) ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def CompletePhaseCoherent +@[expose] noncomputable def CompletePhaseCoherent (tm : Turing.FinTM2) (window : CompletePhaseWindow tm) : Bool := @decide ( @@ -281,14 +281,14 @@ noncomputable def CompletePhaseCoherent window.2.2.1.rangeHead = window.2.1.rangeHead ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -def completeScriptWindow +@[expose] def completeScriptWindow (tm : Turing.FinTM2) (window : CompletePhaseWindow tm) : ScriptBlockWindow tm := (window.1.script, window.2.1.script, window.2.2.1.script, window.2.2.2.script) /-- GapCVP reduction support. -/ -noncomputable def CompleteStaticTracksPreserved +@[expose] noncomputable def CompleteStaticTracksPreserved (tm : Turing.FinTM2) (window : CompletePhaseWindow tm) : Bool := @decide ( @@ -301,7 +301,7 @@ noncomputable def CompleteStaticTracksPreserved completeIsFirstBlock tm window.2.1 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -def canonicalGuessingScriptRow +@[expose] def canonicalGuessingScriptRow {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (width : ℕ) @@ -316,7 +316,7 @@ def canonicalGuessingScriptRow hint, decide (position.val = 0)) /-- GapCVP reduction support. -/ -def initialPhaseCell +@[expose] def initialPhaseCell (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -339,7 +339,7 @@ def initialPhaseCell guessBit := false /-- GapCVP reduction support. -/ -def acceptingPhaseCell +@[expose] def acceptingPhaseCell (tm : Turing.FinTM2) : CompletePhaseCell tm where mode := .accepting script := defaultScriptBlockCell tm @@ -351,7 +351,7 @@ def acceptingPhaseCell guessBit := false /-- GapCVP reduction support. -/ -noncomputable def AcceptingPhaseBlock +@[expose] noncomputable def AcceptingPhaseBlock {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (cell : CompletePhaseCell machine.tm) : Bool := @@ -374,7 +374,7 @@ noncomputable def AcceptingPhaseBlock none ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def CompleteInitializationAllowed +@[expose] noncomputable def CompleteInitializationAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -391,7 +391,7 @@ noncomputable def CompleteInitializationAllowed window.2.1.payloadHead window.2.1.rangeHead ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def CompleteVerificationAllowed +@[expose] noncomputable def CompleteVerificationAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -402,7 +402,7 @@ noncomputable def CompleteVerificationAllowed (completeScriptWindow machine.tm window) = true ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def CompleteAcceptanceAllowed +@[expose] noncomputable def CompleteAcceptanceAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -428,7 +428,7 @@ theorem completePhaseSymbolCount_card omega /-- GapCVP reduction support. -/ -def completePhaseSymbolEquiv +@[expose] def completePhaseSymbolEquiv (tm : Turing.FinTM2) : CompletePhaseCell tm ≃ Symbol (completePhaseSymbolCount tm) := (Fintype.equivFin (CompletePhaseCell tm)).trans diff --git a/LeanPool/GapCVP/Part02.lean b/LeanPool/GapCVP/Part02.lean index da6b6b69a4..ca9b95368c 100644 --- a/LeanPool/GapCVP/Part02.lean +++ b/LeanPool/GapCVP/Part02.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part01 /-! # GapCVP proof, part 02 -/ -@[expose] public section +public section noncomputable section @@ -67,6 +67,7 @@ namespace CLPhaseCompleteness open Computability Turing GapCVP.CL GapCVP.CLCompleteVerifierSimulation /-- GapCVP reduction support. -/ +@[expose] def decodeCorrectedPhaseRow {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -124,7 +125,7 @@ noncomputable def AnchoredInitializationAllowed FirstBlockAnchored machine.tm window.2.2.2 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def AnchoredVerificationAllowed +@[expose] noncomputable def AnchoredVerificationAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -134,7 +135,7 @@ noncomputable def AnchoredVerificationAllowed FirstBlockAnchored machine.tm window.2.2.2 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def AnchoredAcceptanceAllowed +@[expose] noncomputable def AnchoredAcceptanceAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -352,7 +353,7 @@ open GapCVP.CLTableauSimulationCert GapCVP.CLCompleteVerifierSimulation open GapCVP.CLPhaseTableauSimulation GapCVP.CLPhaseTraceInduction /-- GapCVP reduction support. -/ -def anchoredVerifierWindowAt +@[expose] def anchoredVerifierWindowAt (tm : Turing.FinTM2) (width : ℕ) (first next : Position width → CompletePhaseCell tm) (position : Position width) : CompletePhaseWindow tm := @@ -859,7 +860,7 @@ abbrev AnchoredPhaseTrace Symbol (completePhaseSymbolCount machine.tm) /-- GapCVP reduction support. -/ -noncomputable def AnchoredPhaseMasks +@[expose] noncomputable def AnchoredPhaseMasks (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -1529,7 +1530,7 @@ private theorem canonicalVerifierScriptHints_occupied simp only [hvalueBound, getElem?_pos, Option.isSome_some] /-- GapCVP reduction support. -/ -noncomputable def StackSoundAnchoredVerificationAllowed +@[expose] noncomputable def StackSoundAnchoredVerificationAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -1538,7 +1539,7 @@ noncomputable def StackSoundAnchoredVerificationAllowed OccupiedVerifierPrefix machine window.2.1.script.2.1 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def StackSoundAnchoredPhaseAllowed +@[expose] noncomputable def StackSoundAnchoredPhaseAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -1555,6 +1556,7 @@ noncomputable def StackSoundAnchoredPhaseAllowed window.2.2.2 = acceptingPhaseCell machine.tm ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ +@[expose] def stackSoundAnchoredPhaseAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -1598,6 +1600,7 @@ private theorem stackSoundAnchoredPhaseAllowed_implies_anchored simpa only [mode] using hallowed'.2 /-- GapCVP reduction support. -/ +@[expose] def stackSoundAnchoredPhaseSymbolAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -1609,6 +1612,7 @@ def stackSoundAnchoredPhaseSymbolAllowed (completePhaseSymbolEquiv machine.tm).symm window.2.2.2) /-- GapCVP reduction support. -/ +@[expose] def stackSoundAnchoredPhaseSpecification (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} @@ -6595,7 +6599,7 @@ open GapCVP.CLCompactWindowSoundness GapCVP.CLBoundedRowInduction open GapCVP.CLFullStackStepSoundness GapCVP.CLFullTraceReachability GapCVP.CLNaturalTimeCompiler /-- GapCVP reduction support. -/ -noncomputable def ReplicatedMachineHeadCoherent +@[expose] noncomputable def ReplicatedMachineHeadCoherent (tm : Turing.FinTM2) (window : CompletePhaseWindow tm) : Bool := @decide ( @@ -6605,7 +6609,7 @@ noncomputable def ReplicatedMachineHeadCoherent completeMachineHead tm window.2.1 ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def TrueOutputMachineHead +@[expose] noncomputable def TrueOutputMachineHead {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (cell : CompletePhaseCell machine.tm) : Bool := @@ -6621,7 +6625,7 @@ noncomputable def TrueOutputMachineHead none ) (Classical.propDecidable _) /-- GapCVP reduction support. -/ -noncomputable def AcceptanceAnchoredPhaseAllowed +@[expose] noncomputable def AcceptanceAnchoredPhaseAllowed {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) (window : CompletePhaseWindow machine.tm) : Bool := @@ -7276,7 +7280,7 @@ private theorem actualStep_iff_acceptanceAnchoredCanonicalVerifierWindows exact hwindow.1 /-- GapCVP reduction support. -/ -noncomputable def AllCanonicalAcceptanceAnchoredVerifierTraceWindows +@[expose] noncomputable def AllCanonicalAcceptanceAnchoredVerifierTraceWindows (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) diff --git a/LeanPool/GapCVP/Part03A.lean b/LeanPool/GapCVP/Part03A.lean index 9ee06b5d4f..558a3f5241 100644 --- a/LeanPool/GapCVP/Part03A.lean +++ b/LeanPool/GapCVP/Part03A.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part02 /-! # GapCVP proof, part 03 -/ -@[expose] public section +public section noncomputable section @@ -93,7 +93,7 @@ def paddedAcceptancePhaseSymbolAllowed (completePhaseSymbolEquiv machine.tm).symm window.2.2.2) /-- GapCVP reduction support. -/ -def paddedAcceptancePhaseSpecification +@[expose] def paddedAcceptancePhaseSpecification (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -1106,7 +1106,7 @@ private theorem acceptedExecution_paddedAcceptance_validTrace bound machine execution supported hint hwindows⟩ /-- Internal support shared across GapCVP continuation modules. -/ -def paddedAcceptanceLocalTableauCompiler +@[expose] def paddedAcceptanceLocalTableauCompiler (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) : @@ -1130,7 +1130,7 @@ namespace CLStructuralCNFVariableBounds open GapCVP.CL GapCVP.ThreeCNFReduction /-- GapCVP reduction support. -/ -def tableauFiniteVariableCodeBound (T S : ℕ) : ℕ := +@[expose] def tableauFiniteVariableCodeBound (T S : ℕ) : ℕ := ((T + S + 2) ^ 2 + 1) ^ 2 theorem tableauVariable_encode_lt @@ -1504,7 +1504,7 @@ noncomputable def prependWordComputable (word : List Bool) : (prependBitComputable bit) /-- GapCVP reduction support. -/ -def formulaVariables (formula : ThreeCNF) : List ℕ := +@[expose] def formulaVariables (formula : ThreeCNF) : List ℕ := formula.flatMap fun clause => [(clause 0).1, (clause 1).1, (clause 2).1] @@ -1530,7 +1530,7 @@ theorem mem_formulaVariables fin_cases i <;> simp /-- GapCVP reduction support. -/ -def variableRank (formula : ThreeCNF) (index : ℕ) : ℕ := +@[expose] def variableRank (formula : ThreeCNF) (index : ℕ) : ℕ := (formulaVariables formula).idxOf index end SourceMachineCert @@ -1540,7 +1540,7 @@ namespace SourceMachineRouting open SourceMachineCert /-- GapCVP reduction support. -/ -def canonicalYesInstance : GapCVPInstance where +@[expose] def canonicalYesInstance : GapCVPInstance where dimension := 1 basis := Matrix.of fun _ _ => 1 target _ := 0 @@ -1569,7 +1569,7 @@ theorem canonicalYesInstance_gapYES : gapYES canonicalYesInstance := by norm_num [canonicalYesInstance] /-- GapCVP reduction support. -/ -def canonicalYesWord : List Bool := +@[expose] def canonicalYesWord : List Bool := BinaryEncoding.encodeGapCVPInstance canonicalYesInstance end SourceMachineRouting @@ -1772,7 +1772,7 @@ private theorem unaryPrefixMachine_finish_drain (count : ℕ) : cases stack <;> simp [Function.update] /-- GapCVP reduction support. -/ -def unaryPrefixLength : List Bool → ℕ +@[expose] def unaryPrefixLength : List Bool → ℕ | [] => 0 | false :: _ => 0 | true :: rest => unaryPrefixLength rest + 1 @@ -1784,7 +1784,7 @@ def unaryPrefixHasDelimiter : List Bool → Bool | true :: rest => unaryPrefixHasDelimiter rest /-- GapCVP reduction support. -/ -def unaryPrefixOutput (input : List Bool) : List Bool := +@[expose] def unaryPrefixOutput (input : List Bool) : List Bool := unaryPrefixHasDelimiter input :: List.replicate (unaryPrefixLength input) true diff --git a/LeanPool/GapCVP/Part03B.lean b/LeanPool/GapCVP/Part03B.lean index 1ccd09e85e..feecf1ef4f 100644 --- a/LeanPool/GapCVP/Part03B.lean +++ b/LeanPool/GapCVP/Part03B.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03A /-! # GapCVP proof, part 03, continuation 02 -/ -@[expose] public section +public section noncomputable section @@ -237,7 +237,7 @@ def payloadTruncatedTrace } /-- GapCVP reduction support. -/ -def payloadDecodeOutput (input : List Bool) : List Bool := +@[expose] def payloadDecodeOutput (input : List Bool) : List Bool := match BinaryEncoding.readLengthPrefixedWord input with | some (payload, _) => true :: payload | none => [false] @@ -453,7 +453,7 @@ noncomputable def dropHeadComputable : } /-- GapCVP reduction support. -/ -def firstFieldContents (input : List Bool) : List Bool := +@[expose] def firstFieldContents (input : List Bool) : List Bool := (payloadDecodeOutput input).tail /-- GapCVP reduction support. -/ @@ -534,7 +534,7 @@ abbrev suffixDecoderMachine : Turing.FinTM2 where .halt))))) /-- Internal support shared across GapCVP continuation modules. -/ -def suffixConfiguration +@[expose] def suffixConfiguration (phase : Fin 6) (input counter reversed output : List Bool) : suffixDecoderMachine.Cfg where diff --git a/LeanPool/GapCVP/Part03C.lean b/LeanPool/GapCVP/Part03C.lean index 39306df059..2dbd8b7b68 100644 --- a/LeanPool/GapCVP/Part03C.lean +++ b/LeanPool/GapCVP/Part03C.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03B /-! # GapCVP proof, part 03, continuation 03 -/ -@[expose] public section +public section noncomputable section @@ -342,7 +342,7 @@ def suffixTruncatedTrace } /-- GapCVP reduction support. -/ -def firstFieldSuffix (input : List Bool) : List Bool := +@[expose] def firstFieldSuffix (input : List Bool) : List Bool := match BinaryEncoding.readLengthPrefixedWord input with | some (_, suffix) => suffix | none => [] @@ -463,7 +463,7 @@ noncomputable def firstFieldSuffixComputable : } /-- GapCVP reduction support. -/ -def literalSuffix : List Bool → List Bool := +@[expose] def literalSuffix : List Bool → List Bool := List.tail ∘ firstFieldSuffix /-- GapCVP reduction support. -/ @@ -484,7 +484,7 @@ noncomputable def literalSuffixComputable : Function.comp_apply, firstFieldSuffix_valid, List.tail_cons] /-- GapCVP reduction support. -/ -def clauseSuffix : List Bool → List Bool := +@[expose] def clauseSuffix : List Bool → List Bool := literalSuffix ∘ literalSuffix ∘ literalSuffix /-- GapCVP reduction support. -/ @@ -527,7 +527,7 @@ def variablePayloadLabel (position : Fin 3) : Fin 7 := ⟨position.val + 3, by omega⟩ /-- Internal support shared across GapCVP continuation modules. -/ -def nextLiteralPosition (position : Fin 3) : Fin 3 := +@[expose] def nextLiteralPosition (position : Fin 3) : Fin 3 := if position = 0 then 1 else if position = 1 then 2 else 0 /-- Parse a literal's unary prefix or enter its payload or failure phase. -/ @@ -1031,7 +1031,7 @@ namespace FormulaTuringTM open Turing GapCVP.SourceVariableFormulaDecoder /-- Internal support shared across GapCVP continuation modules. -/ -def binaryStackValue : List Bool → ℕ +@[expose] def binaryStackValue : List Bool → ℕ | [] => 0 | bit :: rest => (if bit then 1 else 0) + 2 * binaryStackValue rest @@ -1284,7 +1284,7 @@ abbrev canonicalFormulaMachine : Turing.FinTM2 where (.push 5 (fun _ => true) .halt))) /-- GapCVP reduction support. -/ -def canonicalConfiguration +@[expose] def canonicalConfiguration (phase : Fin 17) (input counter field binary borrow output : List Bool) : canonicalFormulaMachine.Cfg where @@ -1860,7 +1860,7 @@ namespace FormulaCert open Turing GapCVP.SourceVariableFormulaDecoder GapCVP.FormulaTuringTM /-- Internal support shared across GapCVP continuation modules. -/ -def isCanonicalBinaryWord (word : List Bool) : Bool := +@[expose] def isCanonicalBinaryWord (word : List Bool) : Bool := match word.reverse with | [] => true | true :: _ => true @@ -2129,7 +2129,7 @@ open Turing GapCVP.SourceTotalStructuralDecoder GapCVP.SourceVariableFormulaDeco open GapCVP.FormulaTuringTM GapCVP.FormulaCert /-- GapCVP reduction support. -/ -def canonicalFormulaExpected (input : List Bool) : List Bool := +@[expose] def canonicalFormulaExpected (input : List Bool) : List Bool := match BinaryEncoding.decodeThreeCNF input with | none => [false] | some formula => diff --git a/LeanPool/GapCVP/Part03D.lean b/LeanPool/GapCVP/Part03D.lean index 532220e358..0752d235f3 100644 --- a/LeanPool/GapCVP/Part03D.lean +++ b/LeanPool/GapCVP/Part03D.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03C /-! # GapCVP proof, part 03, continuation 04 -/ -@[expose] public section +public section noncomputable section @@ -674,7 +674,7 @@ def canonicalMachineOutput (input : List Bool) : List Bool := simp only [canonicalMachineOutput, BinaryEncoding.readLengthPrefixedWord_append, Fin.isValue] /-- GapCVP reduction support. -/ -def canonicalInputBudget (input : List Bool) : ℕ := +@[expose] def canonicalInputBudget (input : List Bool) : ℕ := 64 * (input.length + 1) * (input.length + 1) + 64 /-- A bounded execution parsing a length-prefixed header and its following formula body. -/ @@ -2128,7 +2128,7 @@ open GapCVP.BinaryEncoding GapCVP.CLStructuralPrefixWriter open GapCVP.CLStructuralNaturalBinaryWriter /-- GapCVP reduction support. -/ -def structuralAtomicNaturalWord (input : List Bool) : List Bool := +@[expose] def structuralAtomicNaturalWord (input : List Bool) : List Bool := encodeAtomic input.length theorem structuralAtomicNaturalWord_eq_prefix (input : List Bool) : @@ -2159,7 +2159,7 @@ open GapCVP.CLCellRowBounds GapCVP.CLCompleteVerifierSimulation open GapCVP.CLPaddedAcceptanceCompiler GapCVP.BinaryEncoding GapCVP.ThreeCNFReduction /-- GapCVP reduction support. -/ -def paddedStructuralTableauSimulation +@[expose] def paddedStructuralTableauSimulation (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) : @@ -2168,7 +2168,7 @@ def paddedStructuralTableauSimulation (paddedAcceptanceLocalTableauCompiler bound machine) /-- GapCVP reduction support. -/ -def structuralWholeSourceClauses +@[expose] def structuralWholeSourceClauses (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -2180,7 +2180,7 @@ def structuralWholeSourceClauses bound machine x)) /-- GapCVP reduction support. -/ -def structuralWholeThreeCNF +@[expose] def structuralWholeThreeCNF (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -2189,7 +2189,7 @@ def structuralWholeThreeCNF (structuralWholeSourceClauses bound machine x) /-- GapCVP reduction support. -/ -def structuralWholeCNFWord +@[expose] def structuralWholeCNFWord (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -2295,25 +2295,25 @@ noncomputable instance : Fintype EncodedWordOrdering where complete ordering := by cases ordering <;> simp /-- GapCVP reduction support. -/ -def encodedWordOrderingFirst : EncodedWordOrdering → Bool +@[expose] def encodedWordOrderingFirst : EncodedWordOrdering → Bool | .invalid => false | .less => false | .equal => true | .greater => true /-- GapCVP reduction support. -/ -def encodedWordOrderingSecond : EncodedWordOrdering → Bool +@[expose] def encodedWordOrderingSecond : EncodedWordOrdering → Bool | .invalid => false | .less => true | .equal => false | .greater => true /-- GapCVP reduction support. -/ -def encodedWordOrderingWord (outcome : EncodedWordOrdering) : List Bool := +@[expose] def encodedWordOrderingWord (outcome : EncodedWordOrdering) : List Bool := [encodedWordOrderingFirst outcome, encodedWordOrderingSecond outcome] /-- GapCVP reduction support. -/ -def lexicographicEncodedWordOrdering : +@[expose] def lexicographicEncodedWordOrdering : List Bool → List Bool → EncodedWordOrdering | [], [] => .equal | [], _ :: _ => .less @@ -2326,7 +2326,7 @@ def lexicographicEncodedWordOrdering : lexicographicEncodedWordOrdering left right /-- GapCVP reduction support. -/ -def delimitedPairWordOrdering (input : List Bool) : EncodedWordOrdering := +@[expose] def delimitedPairWordOrdering (input : List Bool) : EncodedWordOrdering := match readLengthPrefixedWord input with | none => .invalid | some (first, suffix) => @@ -2336,7 +2336,7 @@ def delimitedPairWordOrdering (input : List Bool) : EncodedWordOrdering := lexicographicEncodedWordOrdering first second /-- GapCVP reduction support. -/ -def sourcePreservingDelimitedPairComparisonWord +@[expose] def sourcePreservingDelimitedPairComparisonWord (input : List Bool) : List Bool := lengthPrefixedWord input ++ encodedWordOrderingWord (delimitedPairWordOrdering input) diff --git a/LeanPool/GapCVP/Part03E.lean b/LeanPool/GapCVP/Part03E.lean index 89398de957..ee33d8d9b9 100644 --- a/LeanPool/GapCVP/Part03E.lean +++ b/LeanPool/GapCVP/Part03E.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03D /-! # GapCVP proof, part 03, continuation 05 -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ structure DelimitedPairComparisonState where deriving Fintype /-- GapCVP reduction support. -/ -def delimitedComparePeekFirst (stack : Fin 10) +@[expose] def delimitedComparePeekFirst (stack : Fin 10) (present absent : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState) : @@ -49,7 +49,7 @@ def delimitedComparePeekFirst (stack : Fin 10) (.branch (fun state => state.first.isSome) present absent) /-- GapCVP reduction support. -/ -def delimitedComparePeekSecond (stack : Fin 10) +@[expose] def delimitedComparePeekSecond (stack : Fin 10) (present absent : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState) : @@ -59,7 +59,7 @@ def delimitedComparePeekSecond (stack : Fin 10) (.branch (fun state => state.second.isSome) present absent) /-- GapCVP reduction support. -/ -def delimitedComparePop (stack : Fin 10) +@[expose] def delimitedComparePop (stack : Fin 10) (continuation : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState) : @@ -68,7 +68,7 @@ def delimitedComparePop (stack : Fin 10) .pop stack (fun state _ => state) continuation /-- GapCVP reduction support. -/ -def delimitedComparePushFirst (stack : Fin 10) +@[expose] def delimitedComparePushFirst (stack : Fin 10) (continuation : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState) : @@ -77,7 +77,7 @@ def delimitedComparePushFirst (stack : Fin 10) .push stack (fun state => state.first.getD false) continuation /-- GapCVP reduction support. -/ -def delimitedComparePushConstant (stack : Fin 10) (bit : Bool) +@[expose] def delimitedComparePushConstant (stack : Fin 10) (bit : Bool) (continuation : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState) : @@ -86,14 +86,14 @@ def delimitedComparePushConstant (stack : Fin 10) (bit : Bool) .push stack (fun _ => bit) continuation /-- GapCVP reduction support. -/ -def delimitedCompareGoto (phase : Fin 12) : +@[expose] def delimitedCompareGoto (phase : Fin 12) : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := .load (fun state => ⟨none, none, state.outcome⟩) (.goto (fun _ => phase)) /-- GapCVP reduction support. -/ -def delimitedCompareSetOutcome +@[expose] def delimitedCompareSetOutcome (outcome : EncodedWordOrdering) (phase : Fin 12) : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := @@ -101,7 +101,7 @@ def delimitedCompareSetOutcome (.goto (fun _ => phase)) /-- GapCVP reduction support. -/ -def delimitedCompareFirstPrefixStatement : +@[expose] def delimitedCompareFirstPrefixStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 0 @@ -115,7 +115,7 @@ def delimitedCompareFirstPrefixStatement : (delimitedCompareSetOutcome .invalid 7) /-- GapCVP reduction support. -/ -def delimitedCompareFirstPayloadStatement : +@[expose] def delimitedCompareFirstPayloadStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 1 @@ -130,7 +130,7 @@ def delimitedCompareFirstPayloadStatement : (delimitedCompareGoto 2) /-- GapCVP reduction support. -/ -def delimitedCompareSecondPrefixStatement : +@[expose] def delimitedCompareSecondPrefixStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 0 @@ -144,7 +144,7 @@ def delimitedCompareSecondPrefixStatement : (delimitedCompareSetOutcome .invalid 7) /-- GapCVP reduction support. -/ -def delimitedCompareSecondPayloadStatement : +@[expose] def delimitedCompareSecondPayloadStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 3 @@ -159,7 +159,7 @@ def delimitedCompareSecondPayloadStatement : (delimitedCompareGoto 4) /-- GapCVP reduction support. -/ -def delimitedCompareReverseFirstStatement : +@[expose] def delimitedCompareReverseFirstStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 2 @@ -168,7 +168,7 @@ def delimitedCompareReverseFirstStatement : (delimitedCompareGoto 5) /-- GapCVP reduction support. -/ -def delimitedCompareReverseSecondStatement : +@[expose] def delimitedCompareReverseSecondStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 4 @@ -194,7 +194,7 @@ def delimitedCompareWordsStatement : (delimitedCompareSetOutcome .equal 7)) /-- GapCVP reduction support. -/ -def delimitedCompareCleanupStatement : +@[expose] def delimitedCompareCleanupStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 1 @@ -212,7 +212,7 @@ def delimitedCompareCleanupStatement : (delimitedCompareGoto 8)))))) /-- GapCVP reduction support. -/ -def delimitedCompareTrailingStatement : +@[expose] def delimitedCompareTrailingStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 0 @@ -223,7 +223,7 @@ def delimitedCompareTrailingStatement : (delimitedCompareGoto 9) /-- GapCVP reduction support. -/ -def delimitedCompareOutcomeStatement : +@[expose] def delimitedCompareOutcomeStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := .push 9 (fun state => encodedWordOrderingSecond state.outcome) @@ -231,7 +231,7 @@ def delimitedCompareOutcomeStatement : (delimitedCompareGoto 10)) /-- GapCVP reduction support. -/ -def delimitedCompareSourceStatement : +@[expose] def delimitedCompareSourceStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 7 @@ -241,7 +241,7 @@ def delimitedCompareSourceStatement : (delimitedCompareGoto 11)) /-- GapCVP reduction support. -/ -def delimitedComparePrefixStatement : +@[expose] def delimitedComparePrefixStatement : Turing.TM2.Stmt (fun _ : Fin 10 => Bool) (Fin 12) DelimitedPairComparisonState := delimitedComparePeekFirst 8 @@ -287,7 +287,7 @@ abbrev delimitedPairComparisonMachine : Turing.FinTM2 where delimitedComparePrefixStatement /-- GapCVP reduction support. -/ -def delimitedCompareConfiguration (phase : Fin 12) +@[expose] def delimitedCompareConfiguration (phase : Fin 12) (outcome : EncodedWordOrdering) (input firstCounter firstReversed secondCounter secondReversed firstForward secondForward source sourcePrefix output : List Bool) : diff --git a/LeanPool/GapCVP/Part03F.lean b/LeanPool/GapCVP/Part03F.lean index 11d759a236..45012f95b5 100644 --- a/LeanPool/GapCVP/Part03F.lean +++ b/LeanPool/GapCVP/Part03F.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03E /-! # GapCVP proof, part 03, continuation 06 -/ -@[expose] public section +public section noncomputable section @@ -182,7 +182,7 @@ def DelimitedCompareTrace.prefix EvalsToInTime.trans chosenStep _ _ _ _ _ hfirst hrest /-- GapCVP reduction support. -/ -def delimitedCompareRestoredWord +@[expose] def delimitedCompareRestoredWord (outcome : EncodedWordOrdering) (input source sourcePrefix output : List Bool) : List Bool := List.replicate (input.length + sourcePrefix.length) true ++ diff --git a/LeanPool/GapCVP/Part03G.lean b/LeanPool/GapCVP/Part03G.lean index 0111141e0c..b93a931af4 100644 --- a/LeanPool/GapCVP/Part03G.lean +++ b/LeanPool/GapCVP/Part03G.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03F /-! # GapCVP proof, part 03, continuation 07 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/GapCVP/Part04A.lean b/LeanPool/GapCVP/Part04A.lean index 98477e99e7..6f438dd4bb 100644 --- a/LeanPool/GapCVP/Part04A.lean +++ b/LeanPool/GapCVP/Part04A.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part03 /-! # GapCVP proof, part 04 -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ namespace CNFFiniteRecordSort open Computability Turing GapCVP.ThreeCNFReduction /-- GapCVP reduction support. -/ -def sourceOrderedDistinctRecords +@[expose] def sourceOrderedDistinctRecords {α : Type} [Encodable α] [DecidableEq α] (records : List α) : List α := sortedElements records.toFinset @@ -196,7 +196,7 @@ def delimitedNaturalPairOrdering (input : List Bool) : | some (second, _) => littleEndianNaturalOrdering first second /-- GapCVP reduction support. -/ -def sourcePreservingDelimitedNaturalComparisonWord +@[expose] def sourcePreservingDelimitedNaturalComparisonWord (input : List Bool) : List Bool := lengthPrefixedWord input ++ encodedWordOrderingWord (delimitedNaturalPairOrdering input) @@ -293,7 +293,7 @@ abbrev delimitedNaturalComparisonMachine : Turing.FinTM2 where delimitedComparePrefixStatement /-- Internal support shared across GapCVP continuation modules. -/ -def naturalCompareConfiguration (phase : Fin 12) +@[expose] def naturalCompareConfiguration (phase : Fin 12) (outcome : EncodedWordOrdering) (input firstCounter firstReversed secondCounter secondReversed firstForward secondForward source sourcePrefix output : List Bool) : diff --git a/LeanPool/GapCVP/Part04B.lean b/LeanPool/GapCVP/Part04B.lean index 594232b9a0..83f00adfeb 100644 --- a/LeanPool/GapCVP/Part04B.lean +++ b/LeanPool/GapCVP/Part04B.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part04A /-! # GapCVP proof, part 04, continuation 02 -/ -@[expose] public section +public section noncomputable section @@ -679,7 +679,7 @@ namespace CNFPolynomialRowMarkerTM open Computability Turing GapCVP.BinaryEncoding GapCVP.SourceFormulaStructuralDecoder /-- GapCVP reduction support. -/ -def sourcePreservingPolynomialMarkerWord +@[expose] def sourcePreservingPolynomialMarkerWord (polynomial : Polynomial ℕ) (input : List Bool) : List Bool := lengthPrefixedWord input ++ @@ -711,7 +711,7 @@ theorem firstFieldSuffix_sourcePreservingPolynomialMarkerWord rw [read_sourcePreservingPolynomialMarkerWord] /-- Internal support shared across GapCVP continuation modules. -/ -def polynomialRowMarkerHorner +@[expose] def polynomialRowMarkerHorner (polynomial : Polynomial ℕ) (value : ℕ) : ℕ → ℕ → ℕ | 0, accumulator => accumulator @@ -755,7 +755,7 @@ abbrev PolynomialRowMarkerStage (polynomial : Polynomial ℕ) := Fin (polynomial.natDegree + 1) /-- Internal support shared across GapCVP continuation modules. -/ -def polynomialRowMarkerTopStage +@[expose] def polynomialRowMarkerTopStage (polynomial : Polynomial ℕ) : PolynomialRowMarkerStage polynomial := ⟨polynomial.natDegree, by omega⟩ @@ -940,7 +940,7 @@ def polynomialRowMarkerRestoreBaseStatement (polynomialRowMarkerGoto polynomial 1 stage) /-- Internal support shared across GapCVP continuation modules. -/ -def polynomialRowMarkerPredStage +@[expose] def polynomialRowMarkerPredStage (polynomial : Polynomial ℕ) (stage : PolynomialRowMarkerStage polynomial) (_hstage : stage.val ≠ 0) : diff --git a/LeanPool/GapCVP/Part04C.lean b/LeanPool/GapCVP/Part04C.lean index 609344d363..9dcd7def5c 100644 --- a/LeanPool/GapCVP/Part04C.lean +++ b/LeanPool/GapCVP/Part04C.lean @@ -11,7 +11,7 @@ public import LeanPool.GapCVP.StatementLifting /-! # GapCVP proof, part 04, continuation 03 -/ -@[expose] public section +public section noncomputable section @@ -626,14 +626,14 @@ open Computability Turing GapCVP.CL GapCVP.CNFClauseLoop mem_clauseLoopFiniteElements α value /-- GapCVP reduction support. -/ -def executableAtLeastOneFamilyClauses (T S : ℕ) : +@[expose] def executableAtLeastOneFamilyClauses (T S : ℕ) : List (Clause T S) := (clauseLoopFiniteElements (Time T × Position T)).map (fun position => atLeastOneClause (S := S) position.1 position.2) /-- Internal support shared across GapCVP continuation modules. -/ -def executableAtMostOneFamilyClauses (T S : ℕ) : +@[expose] def executableAtMostOneFamilyClauses (T S : ℕ) : List (Clause T S) := (clauseLoopFiniteElements ((Time T × Position T) × (Symbol S × Symbol S))).filterMap @@ -645,18 +645,18 @@ def executableAtMostOneFamilyClauses (T S : ℕ) : none) /-- GapCVP reduction support. -/ -def executableInitialFamilyClauses {T S : ℕ} +@[expose] def executableInitialFamilyClauses {T S : ℕ} (specification : Specification T S) : List (Clause T S) := (clauseLoopFiniteElements (Position T)).map (initialClause specification.input) /-- GapCVP reduction support. -/ -def executableAcceptanceFamilyClauses {T S : ℕ} +@[expose] def executableAcceptanceFamilyClauses {T S : ℕ} (specification : Specification T S) : List (Clause T S) := [acceptanceClause specification.accept] /-- Internal support shared across GapCVP continuation modules. -/ -def executableForbiddenTransitionFamilyClauses {T S : ℕ} +@[expose] def executableForbiddenTransitionFamilyClauses {T S : ℕ} (specification : Specification T S) : List (Clause T S) := (clauseLoopFiniteElements (Window T × WindowSymbols S)).filterMap (fun window => @@ -666,7 +666,7 @@ def executableForbiddenTransitionFamilyClauses {T S : ℕ} none) /-- Internal support shared across GapCVP continuation modules. -/ -def executableFiveFamilySourceClauseCandidates {T S : ℕ} +@[expose] def executableFiveFamilySourceClauseCandidates {T S : ℕ} (specification : Specification T S) : List (Clause T S) := executableAtLeastOneFamilyClauses T S ++ executableAtMostOneFamilyClauses T S ++ @@ -743,7 +743,7 @@ namespace OutputPolynomialCompositionClosure open Turing /-- GapCVP reduction support. -/ -def markerConditionalOutput +@[expose] def markerConditionalOutput (valid : List Bool → List Bool) (fallback : List Bool) : List Bool → List Bool | true :: input => valid input @@ -818,7 +818,7 @@ noncomputable abbrev markerConditionalMachine } /-- GapCVP reduction support. -/ -noncomputable def validConfiguration +@[expose] noncomputable def validConfiguration {valid : List Bool → List Bool} (computer : BitTM valid) (fallback : List Bool) diff --git a/LeanPool/GapCVP/Part04D.lean b/LeanPool/GapCVP/Part04D.lean index 61e98d6df9..d11f40bd22 100644 --- a/LeanPool/GapCVP/Part04D.lean +++ b/LeanPool/GapCVP/Part04D.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part04C /-! # GapCVP proof, part 04, continuation 04 -/ -@[expose] public section +public section noncomputable section @@ -212,7 +212,7 @@ open GapCVP.CNFPolynomialRowMarkerTM GapCVP.SourceFormulaStructuralDecoder open GapCVP.CLStructuralCNFOutputMachinesUnconditional GapCVP.CNFDependentFiveFamilyRecordTM /-- GapCVP reduction support. -/ -def actualWindowIndexEquiv (T : ℕ) : +@[expose] def actualWindowIndexEquiv (T : ℕ) : Window T ≃ (Fin T × Position T) where toFun window := (⟨window.1.1.val, by have h := window.2; omega⟩, @@ -231,7 +231,7 @@ def actualWindowIndexEquiv (T : ℕ) : · rfl /-- GapCVP reduction support. -/ -def totalAtMostOneFamilyClauses (T S : ℕ) : List (Clause T S) := +@[expose] def totalAtMostOneFamilyClauses (T S : ℕ) : List (Clause T S) := (clauseLoopFiniteElements ((Time T × Position T) × (Symbol S × Symbol S))).map (fun candidate => @@ -242,7 +242,7 @@ def totalAtMostOneFamilyClauses (T S : ℕ) : List (Clause T S) := atLeastOneClause candidate.1.1 candidate.1.2) /-- GapCVP reduction support. -/ -def totalForbiddenTransitionFamilyClauses {T S : ℕ} +@[expose] def totalForbiddenTransitionFamilyClauses {T S : ℕ} (specification : Specification T S) : List (Clause T S) := (clauseLoopFiniteElements (Window T × WindowSymbols S)).map (fun candidate => @@ -252,7 +252,7 @@ def totalForbiddenTransitionFamilyClauses {T S : ℕ} atLeastOneClause candidate.1.1.1 candidate.1.1.2) /-- GapCVP reduction support. -/ -def totalFiveFamilySourceClauseCandidates {T S : ℕ} +@[expose] def totalFiveFamilySourceClauseCandidates {T S : ℕ} (specification : Specification T S) : List (Clause T S) := executableAtLeastOneFamilyClauses T S ++ totalAtMostOneFamilyClauses T S ++ @@ -471,7 +471,7 @@ open Turing rfl /-- GapCVP reduction support. -/ -def parseUnaryBoundedFold : List Bool → Option (ℕ × List Bool) +@[expose] def parseUnaryBoundedFold : List Bool → Option (ℕ × List Bool) | [] => none | false :: remaining => some (0, remaining) | true :: remaining => @@ -479,7 +479,7 @@ def parseUnaryBoundedFold : List Bool → Option (ℕ × List Bool) (fun parsed => (parsed.1 + 1, parsed.2)) /-- GapCVP reduction support. -/ -def unaryBoundedFoldWord (count : ℕ) (seed : List Bool) : List Bool := +@[expose] def unaryBoundedFoldWord (count : ℕ) (seed : List Bool) : List Bool := List.replicate count true ++ false :: seed @[simp] theorem parseUnaryBoundedFold_word @@ -497,7 +497,7 @@ def unaryBoundedFoldWord (count : ℕ) (seed : List Bool) : List Bool := congrArg (Option.map (fun parsed : ℕ × List Bool => (parsed.1 + 1, parsed.2))) ih /-- GapCVP reduction support. -/ -def boundedRecordFoldOutput +@[expose] def boundedRecordFoldOutput (worker : List Bool → List Bool) (input : List Bool) : List Bool := match parseUnaryBoundedFold input with | none => [] @@ -529,7 +529,7 @@ theorem parsedUnaryFold_count_le_length omega /-- GapCVP reduction support. -/ -noncomputable def PolynomiallyBoundedFoldStates +@[expose] noncomputable def PolynomiallyBoundedFoldStates (worker : List Bool → List Bool) (bound : Polynomial ℕ) : Bool := @decide ( @@ -562,7 +562,7 @@ abbrev liftBoundedFoldWorkerStatement (tm : Turing.FinTM2) := (.goto (fun _ => .inr (2 : Fin 5)))) /-- Internal support shared across GapCVP continuation modules. -/ -noncomputable def boundedDependentRecordFoldMachine +@[expose] noncomputable def boundedDependentRecordFoldMachine {worker : List Bool → List Bool} (computer : BitTM worker) : Turing.FinTM2 := by classical diff --git a/LeanPool/GapCVP/Part04E.lean b/LeanPool/GapCVP/Part04E.lean index 0838889819..746fb2b1dc 100644 --- a/LeanPool/GapCVP/Part04E.lean +++ b/LeanPool/GapCVP/Part04E.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part04D /-! # GapCVP proof, part 04, continuation 05 -/ -@[expose] public section +public section noncomputable section @@ -583,11 +583,11 @@ open Computability Turing GapCVP.BinaryEncoding GapCVP.SourceTotalStructuralDeco open GapCVP.OutputBoundedDependentRecordFold GapCVP.CNFTypedRecordWorkerTM /-- GapCVP reduction support. -/ -def flatSignedLiteralDescriptor (literal : Literal) : List Bool := +@[expose] def flatSignedLiteralDescriptor (literal : Literal) : List Bool := lengthPrefixedWord (literal.2 :: encodeNat literal.1) /-- Internal support shared across GapCVP continuation modules. -/ -def flatLiteralRecordStep (input : List Bool) : List Bool := +@[expose] def flatLiteralRecordStep (input : List Bool) : List Bool := match readLengthPrefixedWord input with | some (sign :: payload, suffix) => suffix ++ lengthPrefixedWord payload ++ [sign] @@ -604,7 +604,7 @@ def flatLiteralRecordStep (input : List Bool) : List Bool := List.append_assoc, encodeLiteral] /-- GapCVP reduction support. -/ -def flatSignedLiteralDescriptorStream +@[expose] def flatSignedLiteralDescriptorStream (literals : List Literal) : List Bool := literals.flatMap flatSignedLiteralDescriptor diff --git a/LeanPool/GapCVP/Part04F.lean b/LeanPool/GapCVP/Part04F.lean index 284c97403a..df40b6a557 100644 --- a/LeanPool/GapCVP/Part04F.lean +++ b/LeanPool/GapCVP/Part04F.lean @@ -11,7 +11,7 @@ import all Mathlib.Logic.Equiv.Multiset /-! # GapCVP proof, part 04, continuation 06 -/ -@[expose] public section +public section noncomputable section @@ -520,7 +520,7 @@ noncomputable def actualFlatLiteralRecordFoldComputable : flatLiteralRecordStep_polynomiallyBoundedFoldStates /-- GapCVP reduction support. -/ -def flatThreeClauseLiterals (clauses : ThreeCNF) : List Literal := +@[expose] def flatThreeClauseLiterals (clauses : ThreeCNF) : List Literal := clauses.flatMap (fun clause => [clause 0, clause 1, clause 2]) @[simp] private theorem flatThreeClauseLiterals_length @@ -569,7 +569,7 @@ private theorem flatSourceListValue_map_encode Encodable.encode_list_cons] /-- GapCVP reduction support. -/ -def cappedFlatSourceListValue (cap : ℕ) : List ℕ → ℕ +@[expose] def cappedFlatSourceListValue (cap : ℕ) : List ℕ → ℕ | [] => 0 | head :: tail => min cap @@ -601,7 +601,7 @@ private theorem cappedFlatSourceListValue_eq_min simp only [Nat.min_eq_right hle, Nat.succ_eq_add_one] /-- GapCVP reduction support. -/ -def flatSourceNaturalOrdering (first second : ℕ) : EncodedWordOrdering := +@[expose] def flatSourceNaturalOrdering (first second : ℕ) : EncodedWordOrdering := if first < second then .less else if second < first then .greater else .equal @@ -649,7 +649,7 @@ private theorem flatSourceNaturalOrdering_capped_left Order.lt_one_iff, hlt, right_eq_ite_iff, reduceCtorEq, imp_false, not_lt, Nat.le_of_lt hlt] /-- GapCVP reduction support. -/ -def resolveFlatSourceOrder +@[expose] def resolveFlatSourceOrder (major : EncodedWordOrdering) (first second : ℕ) : EncodedWordOrdering := match major with @@ -733,7 +733,7 @@ private theorem flatSourceListValue_cons_eq_square rw [Nat.pair, ite_eq_left hlt, pow_two] /-- GapCVP reduction support. -/ -def flatSortedSourceListOrdering : +@[expose] def flatSortedSourceListOrdering : List ℕ → List ℕ → EncodedWordOrdering | [], [] => .equal | [], _ :: _ => .less @@ -822,7 +822,7 @@ private theorem flatSortedSourceListOrdering_eq_godel hfirstTail hsecondTail] /-- GapCVP reduction support. -/ -def flatSourceFinsetCodes +@[expose] def flatSourceFinsetCodes {α : Type} [Encodable α] (records : Finset α) : List ℕ := (sortedElements records).map Encodable.encode @@ -917,7 +917,7 @@ private theorem flatLiteralRecordStep_iterate_preservedSuffix encodeLiteral literal) /-- GapCVP reduction support. -/ -def structuralThreeCNFFlatFoldInput +@[expose] def structuralThreeCNFFlatFoldInput (clauses : ThreeCNF) : List Bool := unaryBoundedFoldWord (3 * clauses.length) (flatSignedLiteralDescriptorStream @@ -937,7 +937,7 @@ private theorem boundedRecordFoldOutput_structuralThreeCNF rfl /-- GapCVP reduction support. -/ -def totalVerifierSortedFiveFamilyFlatFoldInput +@[expose] def totalVerifierSortedFiveFamilyFlatFoldInput (bound : Polynomial ℕ) {verifier : List Bool × List Bool → Bool} (machine : VerifierTM verifier) @@ -992,7 +992,7 @@ namespace CNFFlatSourceOrderPolynomialBounds open GapCVP.CL GapCVP.CLStructuralCNFVariableBounds GapCVP.CNFFlatSourceOrder /-- GapCVP reduction support. -/ -def tableauSignedLiteralCodeBound (time symbols : ℕ) : ℕ := +@[expose] def tableauSignedLiteralCodeBound (time symbols : ℕ) : ℕ := (tableauFiniteVariableCodeBound time symbols + 2) ^ 2 private theorem tableauSignedLiteral_encode_lt @@ -1031,7 +1031,7 @@ open GapCVP.SourceMachineCert GapCVP.CNFBoundedRecordFoldTM open GapCVP.CNFFlatStructuralRecordWorkerTM /-- GapCVP reduction support. -/ -def polynomialSignedLiteralDescriptorWord +@[expose] def polynomialSignedLiteralDescriptorWord (polynomial : Polynomial ℕ) (sign : Bool) (input : List Bool) : List Bool := lengthPrefixedWord @@ -1080,7 +1080,7 @@ noncomputable def tableauSourceSignedLiteralDescriptorComputable sourceVariable] /-- GapCVP reduction support. -/ -def accumulatorSignedLiteralDescriptorWord +@[expose] def accumulatorSignedLiteralDescriptorWord (sign : Bool) : List Bool → List Bool := polynomialSignedLiteralDescriptorWord (4 * Polynomial.X + 1) sign @@ -1133,12 +1133,12 @@ namespace CNFUnaryPairIndexTM open Computability Turing GapCVP.BinaryEncoding /-- GapCVP reduction support. -/ -def unarySourcePairWord (first second : ℕ) : List Bool := +@[expose] def unarySourcePairWord (first second : ℕ) : List Bool := List.replicate first true ++ false :: (List.replicate second true ++ [false]) /-- GapCVP reduction support. -/ -def unarySourcePairOutput (input : List Bool) : List Bool := +@[expose] def unarySourcePairOutput (input : List Bool) : List Bool := match readUnaryPrefix input with | none => [] | some (first, remaining) => diff --git a/LeanPool/GapCVP/Part04G.lean b/LeanPool/GapCVP/Part04G.lean index 956d43c7f4..d4f64925d4 100644 --- a/LeanPool/GapCVP/Part04G.lean +++ b/LeanPool/GapCVP/Part04G.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part04F /-! # GapCVP proof, part 04, continuation 07 -/ -@[expose] public section +public section noncomputable section @@ -198,7 +198,7 @@ def unaryPairSquareTrace simpa only [FinTM2.step, Fin.isValue, List.replicate_succ, htarget] using hbounded /-- GapCVP reduction support. -/ -def unaryPairComparedConfiguration +@[expose] def unaryPairComparedConfiguration (first second matched : ℕ) : actualUnaryPairIndexMachine.Cfg := if first < second then diff --git a/LeanPool/GapCVP/Part05A.lean b/LeanPool/GapCVP/Part05A.lean index dd6eb25b46..a138ad29c6 100644 --- a/LeanPool/GapCVP/Part05A.lean +++ b/LeanPool/GapCVP/Part05A.lean @@ -10,7 +10,7 @@ public import LeanPool.GapCVP.Part04 /-! # GapCVP proof, part 05 -/ -@[expose] public section +public section noncomputable section @@ -411,7 +411,7 @@ open GapCVP.CNFFlatSourceGridDescriptorTM GapCVP.CNFUnaryPairIndexTM open GapCVP.CNFUnaryPairIndexTotalRuntimeCert /-- GapCVP reduction support. -/ -def pairedAccumulatorSignedLiteralDescriptorWord +@[expose] def pairedAccumulatorSignedLiteralDescriptorWord (sign : Bool) (input : List Bool) : List Bool := accumulatorSignedLiteralDescriptorWord sign (unarySourcePairOutput input) @@ -446,7 +446,7 @@ namespace CNFSourcePairPrefixWorkerTM open Computability Turing GapCVP.BinaryEncoding GapCVP.CNFUnaryPairIndexTM /-- GapCVP reduction support. -/ -def sourcePairPrefixOutput (input : List Bool) : List Bool := +@[expose] def sourcePairPrefixOutput (input : List Bool) : List Bool := match readUnaryPrefix input with | none => [] | some (first, remaining) => diff --git a/LeanPool/GapCVP/StatementLifting.lean b/LeanPool/GapCVP/StatementLifting.lean index 8dd3db3dd8..baa42f4acb 100644 --- a/LeanPool/GapCVP/StatementLifting.lean +++ b/LeanPool/GapCVP/StatementLifting.lean @@ -9,7 +9,7 @@ public import Mathlib.Computability.TuringMachine.StackTuringMachine /-! # Transporting stack-machine statements into a larger machine -/ -@[expose] public section +public section namespace GapCVP diff --git a/LeanPool/GaussianMomentsCounterexamples.lean b/LeanPool/GaussianMomentsCounterexamples.lean index 59e680d757..3aa96a87bf 100644 --- a/LeanPool/GaussianMomentsCounterexamples.lean +++ b/LeanPool/GaussianMomentsCounterexamples.lean @@ -24,7 +24,7 @@ Tags: gaussian-measure, polynomial-moments, counterexamples, formal-power-series MSC: 60E05, 13F20 -/ -@[expose] public section +public section /- Upstream: https://github.com/long-mathematics/gaussian-moments-counterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/AlgebraicMoments.lean b/LeanPool/GaussianMomentsCounterexamples/AlgebraicMoments.lean index 59c77c8195..d7fdd6fe7c 100644 --- a/LeanPool/GaussianMomentsCounterexamples/AlgebraicMoments.lean +++ b/LeanPool/GaussianMomentsCounterexamples/AlgebraicMoments.lean @@ -14,7 +14,7 @@ public import Mathlib.Algebra.Polynomial.AlgebraMap /-! Algebraic Gaussian moment functionals and their coefficient identities. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory MvPolynomial Finset @@ -22,7 +22,7 @@ open scoped BigOperators namespace GaussianMomentsCounterexamples /-- The contraction of a normalized conjugate Gaussian pair. -/ -def pairMoment (a b : ℕ) : ℂ := if a = b then (a.factorial : ℂ) else 0 +@[expose] def pairMoment (a b : ℕ) : ℂ := if a = b then (a.factorial : ℂ) else 0 /-- Linear extension from monomials of the three-coordinate Gaussian moments. -/ def naturalMoment3 : MvPolynomial (Fin 3) ℂ →ₗ[ℂ] ℂ := diff --git a/LeanPool/GaussianMomentsCounterexamples/CoefficientContraction.lean b/LeanPool/GaussianMomentsCounterexamples/CoefficientContraction.lean index c25ff8bac6..47545d4096 100644 --- a/LeanPool/GaussianMomentsCounterexamples/CoefficientContraction.lean +++ b/LeanPool/GaussianMomentsCounterexamples/CoefficientContraction.lean @@ -10,7 +10,7 @@ public import Mathlib.Algebra.Polynomial.Inductions /-! Gaussian coefficient contraction for arbitrary univariate polynomials. -/ -@[expose] public section +public section noncomputable section namespace GaussianMomentsCounterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/CoefficientIdentities.lean b/LeanPool/GaussianMomentsCounterexamples/CoefficientIdentities.lean index 192e003225..82142dce99 100644 --- a/LeanPool/GaussianMomentsCounterexamples/CoefficientIdentities.lean +++ b/LeanPool/GaussianMomentsCounterexamples/CoefficientIdentities.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Ring /-! Finite coefficient identities underlying the Gaussian counterexamples. -/ -@[expose] public section +public section namespace GaussianMomentsCounterexamples open Finset diff --git a/LeanPool/GaussianMomentsCounterexamples/ComplexContractions.lean b/LeanPool/GaussianMomentsCounterexamples/ComplexContractions.lean index 3416112ff4..16a08ad253 100644 --- a/LeanPool/GaussianMomentsCounterexamples/ComplexContractions.lean +++ b/LeanPool/GaussianMomentsCounterexamples/ComplexContractions.lean @@ -10,18 +10,18 @@ public import LeanPool.GaussianMomentsCounterexamples.Coordinates /-! Normalized complex Gaussian contractions, derived from real Gaussian Stein identities. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory MvPolynomial namespace GaussianMomentsCounterexamples /-- Differentiation with respect to Z in the invertible (W,Z) coordinates. -/ -def derivZ {n : ℕ} (i j : Fin n) : Derivation ℂ (MvPolynomial (Fin n) ℂ) +@[expose] def derivZ {n : ℕ} (i j : Fin n) : Derivation ℂ (MvPolynomial (Fin n) ℂ) (MvPolynomial (Fin n) ℂ) := normalization • (pderiv i - Complex.I • pderiv j) /-- Differentiation with respect to W in the invertible (W,Z) coordinates. -/ -def derivW {n : ℕ} (i j : Fin n) : Derivation ℂ (MvPolynomial (Fin n) ℂ) +@[expose] def derivW {n : ℕ} (i j : Fin n) : Derivation ℂ (MvPolynomial (Fin n) ℂ) (MvPolynomial (Fin n) ℂ) := normalization • (pderiv i + Complex.I • pderiv j) diff --git a/LeanPool/GaussianMomentsCounterexamples/Coordinates.lean b/LeanPool/GaussianMomentsCounterexamples/Coordinates.lean index 5f5f59e90c..61d3c88606 100644 --- a/LeanPool/GaussianMomentsCounterexamples/Coordinates.lean +++ b/LeanPool/GaussianMomentsCounterexamples/Coordinates.lean @@ -16,17 +16,17 @@ import Mathlib.Tactic.LinearCombination /-! Explicit polynomials and normalized complex Gaussian coordinates. -/ -@[expose] public section +public section noncomputable section namespace GaussianMomentsCounterexamples open MvPolynomial /-- Natural complex coordinates are ordered `W, Z, T`. -/ -def naturalP3 : MvPolynomial (Fin 3) ℂ := +@[expose] def naturalP3 : MvPolynomial (Fin 3) ℂ := (1 + X 1) * (X 0 - C (1 / 2) * (2 + X 1) * X 2 ^ 2) /-- Natural complex coordinates are ordered `W₁, Z₁, W₂, Z₂`. -/ -def naturalP4 : MvPolynomial (Fin 4) ℂ := +@[expose] def naturalP4 : MvPolynomial (Fin 4) ℂ := (1 + X 3) * (X 0 * (1 - X 1) + X 2) theorem naturalP3_expansion : naturalP3 = @@ -145,7 +145,7 @@ theorem naturalP4_ne_zero : naturalP4 ≠ 0 := by simp [h] at this /-- The normalization used in the manuscript. -/ -def normalization : ℂ := ((Real.sqrt 2 : ℝ) : ℂ)⁻¹ +@[expose] def normalization : ℂ := ((Real.sqrt 2 : ℝ) : ℂ)⁻¹ lemma normalization_sq : normalization ^ 2 = 1 / 2 := by unfold normalization @@ -153,11 +153,11 @@ lemma normalization_sq : normalization ^ 2 = 1 / 2 := by norm_num [Real.sq_sqrt] /-- The normalized complex coordinate (Xᵢ + iXⱼ)/√2. -/ -def normalizedZ {n : ℕ} (i j : Fin n) : MvPolynomial (Fin n) ℂ := +@[expose] def normalizedZ {n : ℕ} (i j : Fin n) : MvPolynomial (Fin n) ℂ := C normalization * (X i + C Complex.I * X j) /-- The conjugate normalized coordinate (Xᵢ - iXⱼ)/√2. -/ -def normalizedW {n : ℕ} (i j : Fin n) : MvPolynomial (Fin n) ℂ := +@[expose] def normalizedW {n : ℕ} (i j : Fin n) : MvPolynomial (Fin n) ℂ := C normalization * (X i - C Complex.I * X j) lemma recoverX {n : ℕ} (i j : Fin n) : @@ -200,35 +200,35 @@ lemma recombineZ {n : ℕ} (a b : MvPolynomial (Fin n) ℂ) : linear_combination b * h /-- Substitution from natural complex coordinates into the real-coordinate polynomial ring. -/ -def normalizedSub3 : MvPolynomial (Fin 3) ℂ →ₐ[ℂ] MvPolynomial (Fin 3) ℂ := +@[expose] def normalizedSub3 : MvPolynomial (Fin 3) ℂ →ₐ[ℂ] MvPolynomial (Fin 3) ℂ := aeval ![normalizedW 0 1, normalizedZ 0 1, X 2] /-- Substitute two normalized conjugate pairs into four real coordinates. -/ -def normalizedSub4 : MvPolynomial (Fin 4) ℂ →ₐ[ℂ] MvPolynomial (Fin 4) ℂ := +@[expose] def normalizedSub4 : MvPolynomial (Fin 4) ℂ →ₐ[ℂ] MvPolynomial (Fin 4) ℂ := aeval ![normalizedW 0 1, normalizedZ 0 1, normalizedW 2 3, normalizedZ 2 3] /-- Recover three original coordinates from the natural complex coordinates. -/ -def inverseSub3 : MvPolynomial (Fin 3) ℂ →ₐ[ℂ] MvPolynomial (Fin 3) ℂ := +@[expose] def inverseSub3 : MvPolynomial (Fin 3) ℂ →ₐ[ℂ] MvPolynomial (Fin 3) ℂ := aeval ![C normalization * (X 0 + X 1), C (Complex.I * normalization) * (X 0 - X 1), X 2] /-- Recover four original coordinates from two natural conjugate pairs. -/ -def inverseSub4 : MvPolynomial (Fin 4) ℂ →ₐ[ℂ] MvPolynomial (Fin 4) ℂ := +@[expose] def inverseSub4 : MvPolynomial (Fin 4) ℂ →ₐ[ℂ] MvPolynomial (Fin 4) ℂ := aeval ![C normalization * (X 0 + X 1), C (Complex.I * normalization) * (X 0 - X 1), C normalization * (X 2 + X 3), C (Complex.I * normalization) * (X 2 - X 3)] /-- The explicit three-variable counterexample, on the original real coordinates. -/ -def P3 : MvPolynomial (Fin 3) ℂ := normalizedSub3 naturalP3 +@[expose] def P3 : MvPolynomial (Fin 3) ℂ := normalizedSub3 naturalP3 /-- The linear multiplier witnessing nonvanishing mixed moments in three dimensions. -/ -def Q3 : MvPolynomial (Fin 3) ℂ := normalizedZ 0 1 +@[expose] def Q3 : MvPolynomial (Fin 3) ℂ := normalizedZ 0 1 /-- The explicit four-variable counterexample, on the original real coordinates. -/ -def P4 : MvPolynomial (Fin 4) ℂ := normalizedSub4 naturalP4 +@[expose] def P4 : MvPolynomial (Fin 4) ℂ := normalizedSub4 naturalP4 /-- The linear multiplier witnessing nonvanishing mixed moments in four dimensions. -/ -def Q4 : MvPolynomial (Fin 4) ℂ := normalizedZ 2 3 +@[expose] def Q4 : MvPolynomial (Fin 4) ℂ := normalizedZ 2 3 end GaussianMomentsCounterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/CoordinatesProperties.lean b/LeanPool/GaussianMomentsCounterexamples/CoordinatesProperties.lean index 92befe3409..8b3506a6fb 100644 --- a/LeanPool/GaussianMomentsCounterexamples/CoordinatesProperties.lean +++ b/LeanPool/GaussianMomentsCounterexamples/CoordinatesProperties.lean @@ -10,7 +10,7 @@ public import Mathlib.Algebra.MvPolynomial.CommRing /-! Invertible coordinate substitutions, polynomial degree and explicit formulas. -/ -@[expose] public section +public section noncomputable section namespace GaussianMomentsCounterexamples open MvPolynomial diff --git a/LeanPool/GaussianMomentsCounterexamples/Counterexamples.lean b/LeanPool/GaussianMomentsCounterexamples/Counterexamples.lean index 919351b646..7fa2187537 100644 --- a/LeanPool/GaussianMomentsCounterexamples/Counterexamples.lean +++ b/LeanPool/GaussianMomentsCounterexamples/Counterexamples.lean @@ -10,7 +10,7 @@ public import LeanPool.GaussianMomentsCounterexamples.DimensionExtension /-! The unconditional Gaussian counterexamples and genuine failure of GMC in all n ≥ 3. -/ -@[expose] public section +public section noncomputable section open MvPolynomial namespace GaussianMomentsCounterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/DimensionExtension.lean b/LeanPool/GaussianMomentsCounterexamples/DimensionExtension.lean index 091caea294..fdfb6ee274 100644 --- a/LeanPool/GaussianMomentsCounterexamples/DimensionExtension.lean +++ b/LeanPool/GaussianMomentsCounterexamples/DimensionExtension.lean @@ -12,7 +12,7 @@ public import Mathlib.Algebra.MvPolynomial.Rename /-! Marginal compatibility for any injective selection of real Gaussian coordinates. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/GaussianMomentsCounterexamples/DimensionTwo.lean b/LeanPool/GaussianMomentsCounterexamples/DimensionTwo.lean index 6129512416..236c48c0b1 100644 --- a/LeanPool/GaussianMomentsCounterexamples/DimensionTwo.lean +++ b/LeanPool/GaussianMomentsCounterexamples/DimensionTwo.lean @@ -11,18 +11,18 @@ public import Mathlib.Data.Finset.Order /-! Elementary weight arguments in dimension two. No claim resolving GMC(2). -/ -@[expose] public section +public section noncomputable section open MvPolynomial Finset open scoped BigOperators Pointwise namespace GaussianMomentsCounterexamples /-- Natural coordinates [W,Z] for one normalized complex Gaussian pair. -/ -def pairSub : MvPolynomial (Fin 2) ℂ →ₐ[ℂ] MvPolynomial (Fin 2) ℂ := +@[expose] def pairSub : MvPolynomial (Fin 2) ℂ →ₐ[ℂ] MvPolynomial (Fin 2) ℂ := aeval ![normalizedW 0 1, normalizedZ 0 1] /-- Actual Gaussian expectation expressed in the two natural complex coordinates. -/ -def pairExpectation : MvPolynomial (Fin 2) ℂ →ₗ[ℂ] ℂ := +@[expose] def pairExpectation : MvPolynomial (Fin 2) ℂ →ₗ[ℂ] ℂ := (expectationLinear 2).comp pairSub.toLinearMap @[simp] theorem pairExpectation_monomial (d : Fin 2 →₀ ℕ) (c : ℂ) : diff --git a/LeanPool/GaussianMomentsCounterexamples/Discovery.lean b/LeanPool/GaussianMomentsCounterexamples/Discovery.lean index 966ea5c76a..128acf8d5e 100644 --- a/LeanPool/GaussianMomentsCounterexamples/Discovery.lean +++ b/LeanPool/GaussianMomentsCounterexamples/Discovery.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Ring /-! Exact formal inverse-branch calculations for the two explicit examples. These do not assert a general Lagrange–Good or half-pair inversion theorem. -/ -@[expose] public section +public section noncomputable section namespace GaussianMomentsCounterexamples open PowerSeries @@ -49,7 +49,7 @@ theorem geometricSeries_eq_inv : geometricSeries = (1 - X : ℂ⟦X⟧)⁻¹ := simp /-- The branch t/(1-t), with formal division by a unit. -/ -def branchZeta : ℂ⟦X⟧ := X * geometricSeries +@[expose] def branchZeta : ℂ⟦X⟧ := X * geometricSeries lemma one_add_branchZeta : 1 + branchZeta = geometricSeries := by unfold branchZeta @@ -77,7 +77,7 @@ theorem discoveryBranch_equation (i : Fin 2) : rw [one_add_branchZeta]; rfl /-- The polynomial map whose evaluation is `discoveryH`. -/ -def discoveryHPolynomial : Fin 2 → MvPolynomial (Fin 2) ℂ := +@[expose] def discoveryHPolynomial : Fin 2 → MvPolynomial (Fin 2) ℂ := ![(1 - MvPolynomial.X 0) * (1 + MvPolynomial.X 1), 1 + MvPolynomial.X 1] theorem discoveryHPolynomial_eval (z : Fin 2 → ℂ⟦X⟧) (i : Fin 2) : diff --git a/LeanPool/GaussianMomentsCounterexamples/GaussianBridge.lean b/LeanPool/GaussianMomentsCounterexamples/GaussianBridge.lean index d3d593e721..25353781be 100644 --- a/LeanPool/GaussianMomentsCounterexamples/GaussianBridge.lean +++ b/LeanPool/GaussianMomentsCounterexamples/GaussianBridge.lean @@ -10,7 +10,7 @@ public import LeanPool.GaussianMomentsCounterexamples.AlgebraicMoments /-! Agreement of the natural-coordinate algebraic moment functionals with actual integrals. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory MvPolynomial namespace GaussianMomentsCounterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/GaussianMeasure.lean b/LeanPool/GaussianMomentsCounterexamples/GaussianMeasure.lean index 06eb6f5b29..ac3ecd7ec4 100644 --- a/LeanPool/GaussianMomentsCounterexamples/GaussianMeasure.lean +++ b/LeanPool/GaussianMomentsCounterexamples/GaussianMeasure.lean @@ -12,7 +12,7 @@ public import Mathlib.Algebra.MvPolynomial.Eval /-! The canonical Gaussian probability space and its polynomial integrability. All expectations in this development are genuine Bochner integrals. -/ -@[expose] public section +public section noncomputable section @@ -22,7 +22,7 @@ open scoped BigOperators namespace GaussianMomentsCounterexamples /-- The law of `n` independent standard real Gaussian coordinates. -/ -def gaussianMeasure (n : ℕ) : Measure (Fin n → ℝ) := +@[expose] def gaussianMeasure (n : ℕ) : Measure (Fin n → ℝ) := Measure.pi (fun _ => gaussianReal 0 1) instance (n : ℕ) : IsProbabilityMeasure (gaussianMeasure n) := by @@ -30,11 +30,11 @@ instance (n : ℕ) : IsProbabilityMeasure (gaussianMeasure n) := by infer_instance /-- Evaluate a complex polynomial on real coordinates. -/ -def realEval {n : ℕ} (P : MvPolynomial (Fin n) ℂ) (x : Fin n → ℝ) : ℂ := +@[expose] def realEval {n : ℕ} (P : MvPolynomial (Fin n) ℂ) (x : Fin n → ℝ) : ℂ := MvPolynomial.eval (fun i => (x i : ℂ)) P /-- Genuine Gaussian expectation of a complex polynomial. -/ -def expectation {n : ℕ} (P : MvPolynomial (Fin n) ℂ) : ℂ := +@[expose] def expectation {n : ℕ} (P : MvPolynomial (Fin n) ℂ) : ℂ := ∫ x, realEval P x ∂gaussianMeasure n lemma integrable_real_pow (k : ℕ) : @@ -65,7 +65,7 @@ theorem integrable_realEval {n : ℕ} (P : MvPolynomial (Fin n) ℂ) : exact hP.add hQ /-- The conjecture with its actual eventual-vanishing quantifiers. -/ -def GMC (n : ℕ) : Prop := +@[expose] def GMC (n : ℕ) : Prop := ∀ P : MvPolynomial (Fin n) ℂ, (∀ m : ℕ, 1 ≤ m → expectation (P ^ m) = 0) → ∀ Q : MvPolynomial (Fin n) ℂ, @@ -118,7 +118,7 @@ theorem expectation_X_pow {n : ℕ} (i : Fin n) (k : ℕ) : (integrable_complex_pow k).aestronglyMeasurable /-- The integral is a complex-linear functional on the entire polynomial ring. -/ -def expectationLinear (n : ℕ) : MvPolynomial (Fin n) ℂ →ₗ[ℂ] ℂ where +@[expose] def expectationLinear (n : ℕ) : MvPolynomial (Fin n) ℂ →ₗ[ℂ] ℂ where toFun := expectation map_add' := expectation_add map_smul' c P := by diff --git a/LeanPool/GaussianMomentsCounterexamples/GaussianStein.lean b/LeanPool/GaussianMomentsCounterexamples/GaussianStein.lean index 16d23908d5..b521bfe90d 100644 --- a/LeanPool/GaussianMomentsCounterexamples/GaussianStein.lean +++ b/LeanPool/GaussianMomentsCounterexamples/GaussianStein.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Ring /-! Polynomial Gaussian integration by parts on the canonical product space. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory MvPolynomial open scoped BigOperators diff --git a/LeanPool/GaussianMomentsCounterexamples/GeneratingFunctions.lean b/LeanPool/GaussianMomentsCounterexamples/GeneratingFunctions.lean index fb7dbc9c52..ffa31c8ddd 100644 --- a/LeanPool/GaussianMomentsCounterexamples/GeneratingFunctions.lean +++ b/LeanPool/GaussianMomentsCounterexamples/GeneratingFunctions.lean @@ -11,7 +11,7 @@ public import LeanPool.GaussianMomentsCounterexamples.Discovery /-! Coefficientwise exponential generating functions of genuine Gaussian moments. No analytic exponential integrability or infinite-sum/integral interchange is asserted. -/ -@[expose] public section +public section noncomputable section namespace GaussianMomentsCounterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/MomentDetails.lean b/LeanPool/GaussianMomentsCounterexamples/MomentDetails.lean index 944a5bbfaa..acd61cbb01 100644 --- a/LeanPool/GaussianMomentsCounterexamples/MomentDetails.lean +++ b/LeanPool/GaussianMomentsCounterexamples/MomentDetails.lean @@ -10,7 +10,7 @@ public import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! Factorial and double-factorial expressions for Gaussian moments. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/GaussianMomentsCounterexamples/RadialMoments.lean b/LeanPool/GaussianMomentsCounterexamples/RadialMoments.lean index 00aef891dd..d5e19c1876 100644 --- a/LeanPool/GaussianMomentsCounterexamples/RadialMoments.lean +++ b/LeanPool/GaussianMomentsCounterexamples/RadialMoments.lean @@ -10,7 +10,7 @@ public import LeanPool.GaussianMomentsCounterexamples.DimensionTwo /-! Exact radial and two-weight moment formulas in dimension two. No one-variable Factorial Conjecture or two-dimensional exclusion theorem is assumed. -/ -@[expose] public section +public section noncomputable section open MvPolynomial Finset open scoped BigOperators diff --git a/LeanPool/GaussianMomentsCounterexamples/RealCoefficients.lean b/LeanPool/GaussianMomentsCounterexamples/RealCoefficients.lean index 30193cf5e3..85dda0d9d1 100644 --- a/LeanPool/GaussianMomentsCounterexamples/RealCoefficients.lean +++ b/LeanPool/GaussianMomentsCounterexamples/RealCoefficients.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Measure.OpenPos /-! A real-coefficient polynomial whose Gaussian second moment vanishes is zero. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory MvPolynomial namespace GaussianMomentsCounterexamples diff --git a/LeanPool/GaussianMomentsCounterexamples/RealMoments.lean b/LeanPool/GaussianMomentsCounterexamples/RealMoments.lean index 06ea5dc2cc..b10f64aeca 100644 --- a/LeanPool/GaussianMomentsCounterexamples/RealMoments.lean +++ b/LeanPool/GaussianMomentsCounterexamples/RealMoments.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.NormNum /-! All-order Gaussian moments from integration by parts. -/ -@[expose] public section +public section noncomputable section open MeasureTheory ProbabilityTheory diff --git a/LeanPool/GoemansFlow/Basic.lean b/LeanPool/GoemansFlow/Basic.lean index 52f0831988..7864b0bdec 100644 --- a/LeanPool/GoemansFlow/Basic.lean +++ b/LeanPool/GoemansFlow/Basic.lean @@ -11,7 +11,7 @@ public import Mathlib.Data.Fintype.Basic /-! # Directed walks, unsplittable loads, and Goemans' cost conjecture -/ -@[expose] public section +public section namespace GoemansFlow @@ -21,7 +21,7 @@ variable {W E : Type} /-- `IsWalk tail head x l y`: the list of arcs `l`, read left to right, is a walk from vertex `x` to vertex `y`. Repeated vertices and arcs are permitted. -/ -def IsWalk (tail head : E → W) : W → List E → W → Prop +@[expose] def IsWalk (tail head : E → W) : W → List E → W → Prop | x, [], y => x = y | x, e :: l, y => tail e = x ∧ IsWalk tail head (head e) l y @@ -32,7 +32,7 @@ def IsWalk (tail head : E → W) : W → List E → W → Prop IsWalk tail head x (e :: l) y ↔ (tail e = x ∧ IsWalk tail head (head e) l y) := Iff.rfl /-- Boolean decision procedure for `IsWalk` (kernel-friendly). -/ -def walkBool [DecidableEq W] (tail head : E → W) : W → List E → W → Bool +@[expose] def walkBool [DecidableEq W] (tail head : E → W) : W → List E → W → Bool | x, [], y => decide (x = y) | x, e :: l, y => decide (tail e = x) && walkBool tail head (head e) l y @@ -50,7 +50,7 @@ end Walks /-- Load induced on arc `a` by routing `P` with demands `d`, counting every traversal. For arc-simple paths this is the sum of demands of commodities whose path contains `a`. -/ -def unsplittableLoad {R K E : Type} [AddCommMonoid R] [Fintype K] [DecidableEq E] +@[expose] def unsplittableLoad {R K E : Type} [AddCommMonoid R] [Fintype K] [DecidableEq E] (d : K → R) (P : K → List E) (a : E) : R := ∑ k : K, (P k).count a • d k @@ -70,6 +70,7 @@ A refutation of this restricted form also refutes the conjecture over general di The conclusion allows arbitrary walks; the counterexample proves that every admissible walk is a simple path. The coefficient ring is generic, with the rational case matching the source's setting. -/ +@[expose] def GoemansCostConjectureFull (R : Type) [CommRing R] [LinearOrder R] : Prop := ∀ (W E K : Type) [Fintype W] [DecidableEq W] [Fintype E] [DecidableEq E] [Fintype K] diff --git a/LeanPool/GoemansFlow/Counterexample.lean b/LeanPool/GoemansFlow/Counterexample.lean index a2ec579c30..f47f80b6a5 100644 --- a/LeanPool/GoemansFlow/Counterexample.lean +++ b/LeanPool/GoemansFlow/Counterexample.lean @@ -21,7 +21,7 @@ maximum-demand capacity bound costs at least 60, and this lower bound is attaine Generic coefficient transfer gives refutations over all linearly ordered commutative rings. -/ -@[expose] public section +public section namespace GoemansFlow diff --git a/LeanPool/GranvilleMoore/BinomPoly.lean b/LeanPool/GranvilleMoore/BinomPoly.lean index 851c2875cf..d1a0761540 100644 --- a/LeanPool/GranvilleMoore/BinomPoly.lean +++ b/LeanPool/GranvilleMoore/BinomPoly.lean @@ -62,7 +62,7 @@ verified pointwise with `Polynomial.funext`, whose right-hand side is visibly th polynomial over `ℤ`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/GranvilleMoore/CoefficientAnalysis.lean b/LeanPool/GranvilleMoore/CoefficientAnalysis.lean index 08e8c4dc8b..253cce46be 100644 --- a/LeanPool/GranvilleMoore/CoefficientAnalysis.lean +++ b/LeanPool/GranvilleMoore/CoefficientAnalysis.lean @@ -40,7 +40,7 @@ avoids composing `cPoly` with `-X` to get there. for it, and in particular no `Finset.sum_range_id_eq_choose_two`, which does not exist. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/GranvilleMoore/CollapsedCoeff.lean b/LeanPool/GranvilleMoore/CollapsedCoeff.lean index a21fff3c7a..35f1c0cc44 100644 --- a/LeanPool/GranvilleMoore/CollapsedCoeff.lean +++ b/LeanPool/GranvilleMoore/CollapsedCoeff.lean @@ -74,7 +74,7 @@ to give the congruence's right-hand side a meaning, and the forms above clear `j inverting it. They need only `2 ≤ p`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/GranvilleMoore/Defs/TheFermatQuotient.lean b/LeanPool/GranvilleMoore/Defs/TheFermatQuotient.lean index fb8173fa47..2c747693fd 100644 --- a/LeanPool/GranvilleMoore/Defs/TheFermatQuotient.lean +++ b/LeanPool/GranvilleMoore/Defs/TheFermatQuotient.lean @@ -37,7 +37,7 @@ about itself, so every `pow` lemma in Mathlib applies to it unchanged. cancel the denominator, see `GranvilleMoore.natCast_mul_fermatQuotient`. -/ -@[expose] public section +public section namespace GranvilleMoore @@ -53,6 +53,7 @@ abbrev fermatUnit (p : ℕ) (x : ℤ) : ℤ := x ^ (p - 1) `q_p(x) = (x ^ (p - 1) - 1) / p`, the quotient being taken in `ℚ`. For `p` prime with `p ∤ x` this rational number is an integer. -/ +@[expose] def fermatQuotient (p : ℕ) (x : ℤ) : ℚ := ((fermatUnit p x - 1 : ℤ) : ℚ) / (p : ℚ) /-- The Fermat quotient written out with the numerator cast to `ℚ` termwise. -/ @@ -79,7 +80,7 @@ theorem fermatQuotient_one (p : ℕ) : fermatQuotient p 1 = 0 := by It is the exponent for which `(x ^ (p - 1)) ^ e_k = x ^ (p ^ k - 1)`, since `(p - 1) * e_k = p ^ k - 1`. -/ -def frobeniusExponent (p k : ℕ) : ℕ := ∑ r ∈ range k, p ^ r +@[expose] def frobeniusExponent (p k : ℕ) : ℕ := ∑ r ∈ range k, p ^ r /-- The Frobenius exponent is the truncated geometric sum, which is how Mathlib's geometric-sum API applies to it. -/ diff --git a/LeanPool/GranvilleMoore/Defs/TheIteratedFermatQuotients.lean b/LeanPool/GranvilleMoore/Defs/TheIteratedFermatQuotients.lean index 2a65cfd744..23f55ff252 100644 --- a/LeanPool/GranvilleMoore/Defs/TheIteratedFermatQuotients.lean +++ b/LeanPool/GranvilleMoore/Defs/TheIteratedFermatQuotients.lean @@ -39,7 +39,7 @@ a theorem about them (`GranvilleMoore.exists_intCast_iteratedFermatQuot` and * `GranvilleMoore.collapsedCoeff` — `A_j(m)`. -/ -@[expose] public section +public section namespace GranvilleMoore @@ -53,7 +53,7 @@ open Polynomial The value is a rational number; that it is in fact an integer for prime `p` is `GranvilleMoore.exists_intCast_iteratedFermatQuot`. The recursion is on `j`, uniformly in `k`. -/ -def iteratedFermatQuot (p : ℕ) : ℕ → ℕ → ℤ → ℚ +@[expose] def iteratedFermatQuot (p : ℕ) : ℕ → ℕ → ℤ → ℚ | 0, k, x => (x : ℚ) ^ p ^ k | j + 1, k, x => (iteratedFermatQuot p j (k + 1) x - iteratedFermatQuot p j k x) / (p : ℚ) ^ (k + 1) @@ -75,10 +75,10 @@ theorem iteratedFermatQuot_succ (p j k : ℕ) (x : ℤ) : /-- The falling `p`-power product `∏_{r m` (`binomPolyCoeff_eq_zero_of_lt`), so no bound on `n` is built into the definition. -/ +@[expose] noncomputable def binomPolyCoeff (p m n : ℕ) : ℚ := (binomPoly p m).coeff n /-- The empty rescaled binomial polynomial is `1`. -/ @@ -197,6 +198,7 @@ quantities in the master expansion `GranvilleMoore.iteratedFermatQuot_eq_mul_sum though the summands are integers. Its content is in `GranvilleMoore.collapsedCoeff_eq_sum`, `GranvilleMoore.collapsedCoeff_eq_zero`, `GranvilleMoore.le_padicValRat_collapsedCoeff` and `GranvilleMoore.collapsedCoeff_self_eq`. -/ +@[expose] noncomputable def collapsedCoeff (p j m : ℕ) : ℚ := ∑ i ∈ Finset.range (j + 1), (-1) ^ (j - i) * (cCoeff p j i : ℚ) * ((∑ r ∈ Finset.range i, p ^ r).choose m : ℚ) diff --git a/LeanPool/GranvilleMoore/Defs/TheMooreDeterminant.lean b/LeanPool/GranvilleMoore/Defs/TheMooreDeterminant.lean index 684b38c991..216f04f596 100644 --- a/LeanPool/GranvilleMoore/Defs/TheMooreDeterminant.lean +++ b/LeanPool/GranvilleMoore/Defs/TheMooreDeterminant.lean @@ -48,7 +48,7 @@ first regime. Fermat quotients*. -/ -@[expose] public section +public section namespace GranvilleMoore @@ -63,6 +63,7 @@ variable [Monoid R] /-- The **Moore matrix** of `x = (x 1, …, x d)` at `p`: the `d × d` matrix whose `(i, j)` entry is `x j ^ p ^ i`, so that its `i`-th row is the image of `x` under the `i`-th iterate of the `p`-power map. -/ +@[expose] def mooreMatrix (p : ℕ) (x : Fin d → R) : Matrix (Fin d) (Fin d) R := Matrix.of fun i j => x j ^ p ^ (i : ℕ) @@ -99,6 +100,7 @@ quotients `F⁽⁰⁾_0, F⁽¹⁾_0, …, F⁽ⁱ⁾_0, F⁽ⁱ⁾_1, …, F⁽ⁱ⁾_(d - 1 - i)` evaluated at `x`; that is, the row at index `r` is `fun j => iteratedFermatQuot p a b (x j)` with `(a, b) = (min r i, r - i)`. -/ +@[expose] def ladderMatrix (p : ℕ) (x : Fin d → ℤ) (i : ℕ) : Matrix (Fin d) (Fin d) ℚ := Matrix.of fun r j => iteratedFermatQuot p (min (r : ℕ) i) ((r : ℕ) - i) (x j) diff --git a/LeanPool/GranvilleMoore/ExplicitForm.lean b/LeanPool/GranvilleMoore/ExplicitForm.lean index 70d18975e7..0cf996f605 100644 --- a/LeanPool/GranvilleMoore/ExplicitForm.lean +++ b/LeanPool/GranvilleMoore/ExplicitForm.lean @@ -41,7 +41,7 @@ proved from `Nat.choose_succ_succ` rather than `Nat.choose_two_right`, whose div is gratuitous here. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/GranvilleMoore/Ladder.lean b/LeanPool/GranvilleMoore/Ladder.lean index 99f400fe70..c9957aa9ed 100644 --- a/LeanPool/GranvilleMoore/Ladder.lean +++ b/LeanPool/GranvilleMoore/Ladder.lean @@ -52,7 +52,7 @@ is genuinely needed, to divide in the recursion for `iteratedFermatQuot`. Fermat quotients*. -/ -@[expose] public section +public section open Finset Matrix diff --git a/LeanPool/GranvilleMoore/MasterExpansion.lean b/LeanPool/GranvilleMoore/MasterExpansion.lean index b8c41d67e9..a5ae46639f 100644 --- a/LeanPool/GranvilleMoore/MasterExpansion.lean +++ b/LeanPool/GranvilleMoore/MasterExpansion.lean @@ -77,7 +77,7 @@ into the monic `∏_{s v j ^ (i : ℕ)`. -/ -@[expose] public section +public section open Finset Matrix diff --git a/LeanPool/GrothendieckVanishing.lean b/LeanPool/GrothendieckVanishing.lean index 2c031e0720..db17481062 100644 --- a/LeanPool/GrothendieckVanishing.lean +++ b/LeanPool/GrothendieckVanishing.lean @@ -25,4 +25,4 @@ Tags: algebraic-geometry, sheaf-theory, topology MSC: 14F06, 18F20 -/ -@[expose] public section +public section diff --git a/LeanPool/GrothendieckVanishing/ClosedImmersion.lean b/LeanPool/GrothendieckVanishing/ClosedImmersion.lean index 4616280c9b..8a37681d21 100644 --- a/LeanPool/GrothendieckVanishing/ClosedImmersion.lean +++ b/LeanPool/GrothendieckVanishing/ClosedImmersion.lean @@ -44,7 +44,7 @@ Main results: `0 → ker(η) → F → i_*(i^*F) → 0` associated to a closed immersion. -/ -@[expose] public section +public section open CategoryTheory TopologicalSpace Opposite Limits @@ -62,6 +62,10 @@ namespace TopCat def closedIncl {X : TopCat.{u}} {s : Set X} (hs : IsClosed s) : TopCat.of s ⟶ X := TopCat.ofHom ⟨Subtype.val, hs.isClosedEmbedding_subtypeVal.continuous⟩ +/-- A closed inclusion sends a subtype point to its underlying point. -/ +lemma closedIncl_apply {X : TopCat.{u}} {s : Set X} (hs : IsClosed s) (x : s) : + (ConcreteCategory.hom (closedIncl hs)) x = x.1 := by rfl + lemma set_range_closedIncl {X : TopCat.{u}} {s : Set X} (hs : IsClosed s) : Set.range (closedIncl hs : s → X) = s := by ext x @@ -510,7 +514,7 @@ theorem epi_unit_of_closedImmersion /-- The short exact sequence `0 → ker(η) → F → i_*(i^*F) → 0` from a closed immersion, where `η` is the pullback-pushforward adjunction unit and `i : Z ↪ X` is the inclusion of a closed subset. -/ -noncomputable def closedImmersionSES +@[expose] noncomputable def closedImmersionSES {X : TopCat.{u}} (Z : Set X) (hZ : IsClosed Z) (F : TopCat.Sheaf AddCommGrpCat.{u} X) : ShortComplex (TopCat.Sheaf AddCommGrpCat.{u} X) := diff --git a/LeanPool/GrothendieckVanishing/ClosedImmersionCohomology.lean b/LeanPool/GrothendieckVanishing/ClosedImmersionCohomology.lean index 84e74e3a4a..6b32937c5f 100644 --- a/LeanPool/GrothendieckVanishing/ClosedImmersionCohomology.lean +++ b/LeanPool/GrothendieckVanishing/ClosedImmersionCohomology.lean @@ -25,7 +25,7 @@ in `ClosedImmersion.lean`. LES-facing `Sheaf.H` wrappers come from `CohomologyAP and the flasque infrastructure from `FlasqueVanishing.lean`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/CohomologyAPI.lean b/LeanPool/GrothendieckVanishing/CohomologyAPI.lean index 82c6f86b4a..ee4b35c355 100644 --- a/LeanPool/GrothendieckVanishing/CohomologyAPI.lean +++ b/LeanPool/GrothendieckVanishing/CohomologyAPI.lean @@ -61,7 +61,7 @@ calculations internal so downstream files never need to unfold `Sheaf.H` directl surjective morphisms -/ -@[expose] public section +public section universe w' w v u @@ -219,7 +219,7 @@ private theorem sheafH_comp_extClass_naturality {X : TopCat.{u}} exact congrArg (fun t ↦ y.comp t rfl) (extClass_naturality hS₁ hS₂ φ).symm /-- Successor connecting morphism attached to a short exact sequence of sheaves. -/ -noncomputable def sheafHSuccMap {X : TopCat.{u}} +@[expose] noncomputable def sheafHSuccMap {X : TopCat.{u}} {S : ShortComplex (TopCat.Sheaf AddCommGrpCat.{u} X)} (hS : S.ShortExact) (n : ℕ) : @@ -593,7 +593,7 @@ theorem sheafH_subsingleton_of_isEmpty {X : TopCat.{u}} [IsEmpty X] /-- The sheaf cohomology functor `H^n : Sheaf(X, Ab) ⥤ Ab`, defined as the covariant Ext functor `Ext^n(ℤ_X, −)` where `ℤ_X` is the constant sheaf of integers. -/ -noncomputable def sheafCohomologyFunctor (X : TopCat.{u}) (n : ℕ) : +@[expose] noncomputable def sheafCohomologyFunctor (X : TopCat.{u}) (n : ℕ) : TopCat.Sheaf AddCommGrpCat.{u} X ⥤ AddCommGrpCat.{u} := extFunctorObj ((constantSheaf (Opens.grothendieckTopology X) AddCommGrpCat).obj (AddCommGrpCat.of (ULift.{u} ℤ))) n @@ -666,6 +666,7 @@ theorem sheafH1_cokernel_iso_of_subsingleton_middle_natural {X : TopCat.{u}} ((sheafH0EquivSections S₁.X₃).symm s)).symm /-- The degree-`0` sheaf cohomology functor is naturally isomorphic to taking sections on `⊤`. -/ +@[expose] noncomputable def sheafH0NatIsoSections {X : TopCat.{u}} : sheafCohomologyFunctor X 0 ≅ sheafToPresheaf (Opens.grothendieckTopology X) AddCommGrpCat.{u} ⋙ diff --git a/LeanPool/GrothendieckVanishing/ConstantSheafFlasque.lean b/LeanPool/GrothendieckVanishing/ConstantSheafFlasque.lean index 542e419547..89b9951fbd 100644 --- a/LeanPool/GrothendieckVanishing/ConstantSheafFlasque.lean +++ b/LeanPool/GrothendieckVanishing/ConstantSheafFlasque.lean @@ -25,7 +25,7 @@ relies crucially on `nonempty_preirreducible_inter` for irreducible spaces. * `isFlasqueSheaf_zeroOutsideInt_top` -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean b/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean index 39e17b59e0..cb19f047f8 100644 --- a/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean +++ b/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean @@ -36,7 +36,7 @@ The `isFlasque_filtered_colimit` and `sheafHPreservesFilteredColimits` building live in the `PresheafFilteredColimit` modules. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean b/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean index 56c279f828..2b889bcbbf 100644 --- a/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean +++ b/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean @@ -33,7 +33,7 @@ adapted from Brian Nugent's Mathlib PR #35790. Generic `Sheaf.H` and `Ext` API lives in `CohomologyAPI.lean`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean b/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean index 1a3243af88..66b0660a84 100644 --- a/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean +++ b/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean @@ -25,7 +25,7 @@ sections. `zeroOutsideInt` generators of `F`, together with its `Epi` instance. -/ -@[expose] public section +public section universe u @@ -123,7 +123,7 @@ abbrev finsetGeneratedSheaf {X : TopCat.{u}} (fun σ ↦ sectionHom hF σ.1) /-- Coproduct inclusion induced by `S ⊆ S'` on the finite generator coproducts. -/ -noncomputable def finsetCoproductInclGen {X : TopCat.{u}} +@[expose] noncomputable def finsetCoproductInclGen {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} {S S' : Finset (SectionIndex F)} (h : S ⊆ S') : @@ -133,6 +133,7 @@ noncomputable def finsetCoproductInclGen {X : TopCat.{u}} Sigma.ι (fun τ : {τ // τ ∈ S'} ↦ TopCat.Sheaf.zeroOutsideInt τ.1.1) ⟨σ.1, h σ.2⟩ /-- Inclusion of finitely generated subsheaves induced by `S ⊆ S'`. -/ +@[expose] noncomputable def finsetImageInclGen {X : TopCat.{u}} {F : TopCat.Presheaf AddCommGrpCat.{u} X} (hF : F.IsSheaf) {S S' : Finset (SectionIndex F)} diff --git a/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean b/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean index 6bf2fbe1d6..0960b0377f 100644 --- a/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean +++ b/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean @@ -30,7 +30,7 @@ The dimension-zero base case is proved here; the positive-dimensional irreducibl lives in `IrreducibleStep.lean`. -/ -@[expose] public section +public section universe u @@ -78,12 +78,10 @@ theorem reducible_vanishing by_cases hxZ : x ∈ Z · -- closedIncl_unit_stalk_isIso: iso on stalks at z ∈ Z have : IsIso ((TopCat.Presheaf.stalkFunctor AddCommGrpCat.{u} x).map S.g.hom) := by - change IsIso - ((TopCat.Presheaf.stalkFunctor AddCommGrpCat.{u} - ((ConcreteCategory.hom (TopCat.closedIncl hZ_closed)) ⟨x, hxZ⟩)).map S.g.hom) - simpa [S, closedImmersionSES] using - (TopCat.closedIncl_unit_stalk_isIso (C := AddCommGrpCat.{u}) - (hs := hZ_closed) Gsh ⟨x, hxZ⟩) + have hi := TopCat.closedIncl_unit_stalk_isIso (C := AddCommGrpCat.{u}) + (hs := hZ_closed) Gsh ⟨x, hxZ⟩ + erw [TopCat.closedIncl_apply hZ_closed ⟨x, hxZ⟩] at hi + simpa [S, closedImmersionSES] using hi exact stalk_zero_of_ses_g_iso S hSE x inferInstance a · exact stalk_zero_of_shortExact_kernel S hSE x (hG_stalks x (by simp_all)) a diff --git a/LeanPool/GrothendieckVanishing/GrothendieckVanishingOverview.lean b/LeanPool/GrothendieckVanishing/GrothendieckVanishingOverview.lean index 5ecbf3f267..0e09aafbe1 100644 --- a/LeanPool/GrothendieckVanishing/GrothendieckVanishingOverview.lean +++ b/LeanPool/GrothendieckVanishing/GrothendieckVanishingOverview.lean @@ -24,4 +24,4 @@ For a Noetherian topological space `X` of dimension `n` and a sheaf `F` of abeli on `X`, the imports below assemble `Hⁱ(X, F) = 0` for all `i > n`. -/ -@[expose] public section +public section diff --git a/LeanPool/GrothendieckVanishing/IrreducibleStep.lean b/LeanPool/GrothendieckVanishing/IrreducibleStep.lean index 8e80f74b47..e186a9bbeb 100644 --- a/LeanPool/GrothendieckVanishing/IrreducibleStep.lean +++ b/LeanPool/GrothendieckVanishing/IrreducibleStep.lean @@ -45,7 +45,7 @@ neighbourhood by minimality. * `irreducible_pos_vanishing` — the headline assembly. -/ -@[expose] public section +public section universe u @@ -420,12 +420,10 @@ theorem closedComplementVanishing sheaf_isZero_of_zero_stalks X S.X₁.property (fun x a ↦ by by_cases hxY : x ∈ Y · have : IsIso ((TopCat.Presheaf.stalkFunctor AddCommGrpCat.{u} x).map S.g.hom) := by - change IsIso - ((TopCat.Presheaf.stalkFunctor AddCommGrpCat.{u} - ((ConcreteCategory.hom (TopCat.closedIncl hYcl)) ⟨x, hxY⟩)).map S.g.hom) - simpa [S, closedImmersionSES, closedIncl, Csh] using - (TopCat.closedIncl_unit_stalk_isIso (C := AddCommGrpCat.{u}) - (hs := hYcl) Csh ⟨x, hxY⟩) + have hi := TopCat.closedIncl_unit_stalk_isIso (C := AddCommGrpCat.{u}) + (hs := hYcl) Csh ⟨x, hxY⟩ + erw [TopCat.closedIncl_apply hYcl ⟨x, hxY⟩] at hi + simpa [S, closedImmersionSES, closedIncl, Csh] using hi exact stalk_zero_of_ses_g_iso S hSE x inferInstance a · exact stalk_zero_of_shortExact_kernel S hSE x (fun b ↦ hStalksOnV x (by rwa [Set.mem_compl_iff, not_not] at hxY) b) diff --git a/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean b/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean index 2739029489..098dd5a2e4 100644 --- a/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean +++ b/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean @@ -16,7 +16,7 @@ with filtered colimits on Noetherian spaces, building on the presheaf-boundary a successor-stage infrastructure in `PresheafFilteredColimitCore`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean b/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean index 004b1851f6..8d83ec67c6 100644 --- a/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean +++ b/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean @@ -22,7 +22,7 @@ Noetherian spaces: degree-`n+1` colimit comparison. -/ -@[expose] public section +public section universe u @@ -123,6 +123,7 @@ variable (Y' : J' ⥤ TopCat.Sheaf AddCommGrpCat.{u} X) variable [Zero (TopCat.Sheaf AddCommGrpCat.{u} X)] /-- The arrow diagram used in the successor-step dimension-shift construction. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccToArrow : J' ⥤ Arrow (TopCat.Sheaf AddCommGrpCat.{u} X) := { obj := fun j ↦ Arrow.mk (0 : Y'.obj j ⟶ 0) @@ -133,6 +134,7 @@ noncomputable def sheafHFilteredColimitSuccToArrow : map_comp := fun f g ↦ by ext <;> aesop_cat } /-- Objectwise injective envelopes coming from functorial factorization of `0 : Y_j ⟶ 0`. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccInj : J' ⥤ TopCat.Sheaf AddCommGrpCat.{u} X := sheafHFilteredColimitSuccToArrow Y' ⋙ @@ -159,6 +161,7 @@ theorem sheafH_filtered_colimit_succ_eta_mono (j : J') : exact ffData.hi ((sheafHFilteredColimitSuccToArrow Y').obj j) /-- The colimit cocone of the injective replacement diagram. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccInjCocone : Cocone (sheafHFilteredColimitSuccInj Y') := colimit.cocone (sheafHFilteredColimitSuccInj Y') @@ -201,6 +204,7 @@ noncomputable instance sheafH_filtered_colimit_succ_iota_mono (sheafH_filtered_colimit_succ_iota_fac Y' c' hc') /-- The short exact sequence on colimit objects obtained from the injective replacement. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccShortComplex (c' : Cocone Y') (hc' : IsColimit c') : ShortComplex (TopCat.Sheaf AddCommGrpCat.{u} X) := @@ -218,7 +222,7 @@ theorem sheafH_filtered_colimit_succ_shortExact (ShortComplex.exact_of_g_is_cokernel _ (cokernelIsCokernel ι')) inferInstance inferInstance /-- The quotient diagram obtained by objectwise cokernels of the injective replacement maps. -/ -noncomputable def sheafHFilteredColimitSuccQuotient : +@[expose] noncomputable def sheafHFilteredColimitSuccQuotient : J' ⥤ TopCat.Sheaf AddCommGrpCat.{u} X := { obj := fun j ↦ cokernel ((sheafHFilteredColimitSuccEta Y').app j) map := fun {j j'} f ↦ @@ -231,6 +235,7 @@ noncomputable def sheafHFilteredColimitSuccQuotient : attribute [local implicit_reducible] sheafHFilteredColimitSuccQuotient /-- The quotient cocone on the cokernel diagram induced by the colimit short exact sequence. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccQuotientCocone (c' : Cocone Y') (hc' : IsColimit c') : Cocone (sheafHFilteredColimitSuccQuotient Y') := @@ -399,6 +404,7 @@ theorem sheafH_filtered_colimit_succ_stage_shortExact (j : J') : /-- The morphism between stagewise short exact sequences induced by a transition map in the filtered diagram. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccStageMapHom {j j' : J'} (f : j ⟶ j') : ShortComplex.mk ((sheafHFilteredColimitSuccEta Y').app j) @@ -415,6 +421,7 @@ noncomputable def sheafHFilteredColimitSuccStageMapHom (cokernel.π_desc _ _ _).symm /-- The morphism from the stagewise short exact sequence to the colimit short exact sequence. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccStageHom (c' : Cocone Y') (hc' : IsColimit c') (j : J') : ShortComplex.mk ((sheafHFilteredColimitSuccEta Y').app j) @@ -473,6 +480,7 @@ noncomputable def sheafHFilteredColimitSuccShiftDomainIso /-- The colimit-level dimension-shift isomorphism for the short exact sequence obtained from the injective replacement of the filtered colimit cocone. -/ +@[expose] noncomputable def sheafHFilteredColimitSuccShiftCodomainIso (c' : Cocone Y') (hc' : IsColimit c') (n : ℕ) (h_colim_n : @@ -510,6 +518,7 @@ theorem sheafH_filtered_colimit_succ_inj_subsingleton end SheafHFilteredColimitSucc /-- The canonical comparison morphism `colim H^n(F_j) ⟶ H^n(colim F_j)` induced by a cocone. -/ +@[expose] noncomputable def sheafHFilteredColimitComparison {X : TopCat.{u}} {J' : Type u} [SmallCategory J'] diff --git a/LeanPool/GrothendieckVanishing/PresheafFilteredColimitGeneral.lean b/LeanPool/GrothendieckVanishing/PresheafFilteredColimitGeneral.lean index ec4ff1088e..31157d5844 100644 --- a/LeanPool/GrothendieckVanishing/PresheafFilteredColimitGeneral.lean +++ b/LeanPool/GrothendieckVanishing/PresheafFilteredColimitGeneral.lean @@ -24,7 +24,7 @@ finite-cover separation, eventual vanishing, compatible representative extractio finite-subcover gluing in cocone points. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/TopologicalKrullDim.lean b/LeanPool/GrothendieckVanishing/TopologicalKrullDim.lean index 0a2f3aefae..4b812d234d 100644 --- a/LeanPool/GrothendieckVanishing/TopologicalKrullDim.lean +++ b/LeanPool/GrothendieckVanishing/TopologicalKrullDim.lean @@ -33,7 +33,7 @@ API for topological Krull dimension on irreducible spaces. strictly smaller dimension -/ -@[expose] public section +public section universe u diff --git a/LeanPool/GrothendieckVanishing/ZeroOutside.lean b/LeanPool/GrothendieckVanishing/ZeroOutside.lean index 90b2525619..c05ea5372f 100644 --- a/LeanPool/GrothendieckVanishing/ZeroOutside.lean +++ b/LeanPool/GrothendieckVanishing/ZeroOutside.lean @@ -41,7 +41,7 @@ finitely-generated subsheaf reduction in the Grothendieck vanishing proof. canonical germ. -/ -@[expose] public section +public section universe u @@ -327,6 +327,7 @@ namespace Sheaf open Presheaf /-- Sheafification of the integer-valued zero-outside presheaf. -/ +@[expose] def zeroOutsideInt {X : TopCat.{u}} (U : Opens X) : Sheaf AddCommGrpCat.{u} X := (presheafToSheaf _ _).obj (Presheaf.constZ.zeroOutside U) @@ -343,7 +344,7 @@ def generator : (zeroOutsideInt U).presheaf.obj (op U) := variable {U} /-- The canonical morphism `zeroOutsideInt V ⟶ zeroOutsideInt U` for `V ≤ U`. -/ -@[simps] +@[expose, simps] def openHom {X : TopCat.{u}} {V U : Opens X} (h : V ≤ U) : zeroOutsideInt V ⟶ zeroOutsideInt U where hom := sheafifyMap _ (Presheaf.zeroOutsideOpenHom (F := Presheaf.constZ) h) diff --git a/LeanPool/HSDInteriorPointLP.lean b/LeanPool/HSDInteriorPointLP.lean index f64fd37ddc..f88f9d052c 100644 --- a/LeanPool/HSDInteriorPointLP.lean +++ b/LeanPool/HSDInteriorPointLP.lean @@ -18,7 +18,7 @@ Tags: linear-programming, interior-point-methods, optimization, homogeneous-self MSC: 90C05, 90C51 -/ -@[expose] public section +public section /-! Top-level import for the HSD interior-point LP proof. diff --git a/LeanPool/HSDInteriorPointLP/FixedYTMTheory.lean b/LeanPool/HSDInteriorPointLP/FixedYTMTheory.lean index 525704fdc0..07d7f07ea9 100644 --- a/LeanPool/HSDInteriorPointLP/FixedYTMTheory.lean +++ b/LeanPool/HSDInteriorPointLP/FixedYTMTheory.lean @@ -24,7 +24,7 @@ That older interface was removed because the generated-algorithm interface in algorithm dependency clearer. -/ -@[expose] public section +public section noncomputable section open scoped BigOperators @@ -1087,7 +1087,7 @@ theorem corrector_step_guarantee_of_wide {n : Nat} /-- The contraction factor appearing in the two-step YTM estimate. -/ -def ytmContraction (n : Nat) : ℝ := +@[expose] def ytmContraction (n : Nat) : ℝ := 1 - ytmStepConstant / Real.sqrt (hdim n) /-- The two-step contraction factor is nonnegative. -/ @@ -1216,7 +1216,7 @@ theorem ytm_exp_mul_gap_le_of_log_bound {n : Nat} /-- Pair bound written using `L = log(gap0 / ε)`. -/ -def ytmLogPairBoundL (n : Nat) (L : ℝ) : Nat := +@[expose] def ytmLogPairBoundL (n : Nat) (L : ℝ) : Nat := Nat.ceil ((Real.sqrt (hdim n) / ytmStepConstant) * L) /-- Ordinary iteration bound written using `L = log(gap0 / ε)`. -/ @@ -1224,6 +1224,7 @@ def ytmLogIterationBoundL (n : Nat) (L : ℝ) : Nat := 2 * ytmLogPairBoundL n L /-- Gap-based stopping condition used by the formalized iteration bound. -/ +@[expose] def YTMGapStop {n : Nat} (ε : ℝ) (w : HSState n) : Prop := gap w ≤ ε diff --git a/LeanPool/HSDInteriorPointLP/GeneratedConvergence.lean b/LeanPool/HSDInteriorPointLP/GeneratedConvergence.lean index c6f756c335..a71374cca0 100644 --- a/LeanPool/HSDInteriorPointLP/GeneratedConvergence.lean +++ b/LeanPool/HSDInteriorPointLP/GeneratedConvergence.lean @@ -21,7 +21,7 @@ Lean-reading hints for beginners: * `omega` solves arithmetic goals over natural numbers and integers. -/ -@[expose] public section +public section noncomputable section open scoped BigOperators diff --git a/LeanPool/HSDInteriorPointLP/LocalNeighborhoodEstimates.lean b/LeanPool/HSDInteriorPointLP/LocalNeighborhoodEstimates.lean index a2ce944d45..1beb63a032 100644 --- a/LeanPool/HSDInteriorPointLP/LocalNeighborhoodEstimates.lean +++ b/LeanPool/HSDInteriorPointLP/LocalNeighborhoodEstimates.lean @@ -28,7 +28,7 @@ Lean-reading hints for beginners: * `field_simp` clears denominators after you provide nonzero-denominator proofs. -/ -@[expose] public section +public section noncomputable section open scoped BigOperators diff --git a/LeanPool/HSDInteriorPointLP/NewtonSystem.lean b/LeanPool/HSDInteriorPointLP/NewtonSystem.lean index 5af0fe1d39..6269061545 100644 --- a/LeanPool/HSDInteriorPointLP/NewtonSystem.lean +++ b/LeanPool/HSDInteriorPointLP/NewtonSystem.lean @@ -28,7 +28,7 @@ Lean-reading hints for beginners: `defs`, then close the goal by `h`. -/ -@[expose] public section +public section noncomputable section open scoped BigOperators @@ -1108,14 +1108,14 @@ structure CorrectorStepGuarantee {n : Nat} /-- The tight neighborhood parameter used in the YTM proof. -/ -def ytmBetaTight : ℝ := 1 / 4 +@[expose] def ytmBetaTight : ℝ := 1 / 4 /-- The wide neighborhood parameter used in the YTM proof. -/ -def ytmBetaWide : ℝ := 1 / 2 +@[expose] def ytmBetaWide : ℝ := 1 / 2 /-- The predictor step-size constant appearing in YTM Theorem 6. Mathematically this is `8^{-2.5}`. -/ -def ytmStepConstant : ℝ := 1 / ((8 : ℝ) ^ 2 * Real.sqrt 8) +@[expose] def ytmStepConstant : ℝ := 1 / ((8 : ℝ) ^ 2 * Real.sqrt 8) /-! ### Corrector local estimate diff --git a/LeanPool/HSDInteriorPointLP/PrimalDualData.lean b/LeanPool/HSDInteriorPointLP/PrimalDualData.lean index 4cb3596add..a97e32cf1d 100644 --- a/LeanPool/HSDInteriorPointLP/PrimalDualData.lean +++ b/LeanPool/HSDInteriorPointLP/PrimalDualData.lean @@ -28,7 +28,7 @@ Lean-reading hints for beginners: `simp` in a long proof because the simplification set does not change silently. -/ -@[expose] public section +public section noncomputable section @@ -87,7 +87,7 @@ structure LPData (m n : Nat) where This says that the only linear combination of the rows of `A` equal to zero is the trivial one. This is the standard full-row-rank assumption used in primal-dual IPM analyses. -/ -def FullRowRank {m n : Nat} (P : LPData m n) : Prop := +@[expose] def FullRowRank {m n : Nat} (P : LPData m n) : Prop := ∀ y : Vec m, (∀ j : Fin n, ∑ i : Fin m, y i * P.A i j = 0) → ∀ i : Fin m, y i = 0 /-- Standard assumptions for the LP-level HLP skeleton. @@ -98,18 +98,18 @@ structure LPStandardAssumptions {m n : Nat} (P : LPData m n) : Prop where full_row_rank : FullRowRank P /-- Homogeneous complementarity dimension `n + 1`. -/ -def hdim (n : Nat) : ℝ := (n : ℝ) + 1 +@[expose] def hdim (n : Nat) : ℝ := (n : ℝ) + 1 /-- Euclidean dot product on finite real vectors. -/ -def dot {n : Nat} (u v : Vec n) : ℝ := +@[expose] def dot {n : Nat} (u v : Vec n) : ℝ := ∑ i, u i * v i /-- Pairing of `(x,τ)` and `(s,κ)`: `xᵀs + τκ`. -/ -def hdot {n : Nat} (x : Vec n) (tau : ℝ) (s : Vec n) (kappa : ℝ) : ℝ := +@[expose] def hdot {n : Nat} (x : Vec n) (tau : ℝ) (s : Vec n) (kappa : ℝ) : ℝ := dot x s + tau * kappa /-- Squared centrality deviation for `(xᵢsᵢ, τκ)` from `μe`. -/ -def centerSq {n : Nat} (x : Vec n) (tau : ℝ) (s : Vec n) (kappa : ℝ) (μ : ℝ) : ℝ := +@[expose] def centerSq {n : Nat} (x : Vec n) (tau : ℝ) (s : Vec n) (kappa : ℝ) (μ : ℝ) : ℝ := (∑ i, (x i * s i - μ) ^ 2) + (tau * kappa - μ) ^ 2 /-- Homogeneous self-dual state with primal and dual/complementarity variables. -/ @@ -135,25 +135,26 @@ structure HSDirection (n : Nat) where dkappa : ℝ /-- Strict positivity of every HSD state component. -/ -def Interior {n : Nat} (w : HSState n) : Prop := +@[expose] def Interior {n : Nat} (w : HSState n) : Prop := (∀ i, 0 < w.x i) ∧ 0 < w.tau ∧ (∀ i, 0 < w.s i) ∧ 0 < w.kappa /-- Complementarity gap of an HSD state. -/ -def gap {n : Nat} (w : HSState n) : ℝ := +@[expose] def gap {n : Nat} (w : HSState n) : ℝ := hdot w.x w.tau w.s w.kappa /-- Average complementarity measure. -/ -def mu {n : Nat} (w : HSState n) : ℝ := +@[expose] def mu {n : Nat} (w : HSState n) : ℝ := gap w / hdim n /-- HSDE central neighborhood corresponding to the YTM neighborhood `‖(Xs, τκ) - μe‖ ≤ β μ`, written with squared Euclidean norm. -/ +@[expose] def HSDNeighborhood {n : Nat} (β : ℝ) (w : HSState n) : Prop := Interior w ∧ 0 < β ∧ β < 1 ∧ centerSq w.x w.tau w.s w.kappa (mu w) ≤ (β * mu w) ^ 2 /-- Apply a scalar step along an HSD search direction. -/ -def addStep {n : Nat} (w : HSState n) (d : HSDirection n) (α : ℝ) : HSState n := +@[expose] def addStep {n : Nat} (w : HSState n) (d : HSDirection n) (α : ℝ) : HSState n := { x := fun i => w.x i + α * d.dx i tau := w.tau + α * d.dtau s := fun i => w.s i + α * d.ds i @@ -217,11 +218,11 @@ The earlier `HSDirectionEquation` works only with the reduced variables -/ /-- Matrix-vector multiplication for the row-indexed constraint matrix. -/ -def matVec {m n : Nat} (A : Matrix (Fin m) (Fin n) ℝ) (x : Vec n) : Vec m := +@[expose] def matVec {m n : Nat} (A : Matrix (Fin m) (Fin n) ℝ) (x : Vec n) : Vec m := fun i => ∑ j, A i j * x j /-- Transposed matrix-vector multiplication. -/ -def tMatVec {m n : Nat} (A : Matrix (Fin m) (Fin n) ℝ) (y : Vec m) : Vec n := +@[expose] def tMatVec {m n : Nat} (A : Matrix (Fin m) (Fin n) ℝ) (y : Vec m) : Vec n := fun j => ∑ i, A i j * y i /-- Finite-dimensional adjointness of `matVec` and `tMatVec`. -/ @@ -246,18 +247,18 @@ theorem dot_tMatVec_eq_dot_matVec {m n : Nat} ring /-- All-ones vector. -/ -def ones {n : Nat} : Vec n := fun _ => 1 +@[expose] def ones {n : Nat} : Vec n := fun _ => 1 /-- The YTM simplified HLP uses `bbar = b - A e`. -/ -def bbar {m n : Nat} (P : LPData m n) : Vec m := +@[expose] def bbar {m n : Nat} (P : LPData m n) : Vec m := fun i => P.b i - matVec P.A (ones : Vec n) i /-- The YTM simplified HLP uses `cbar = c - e`. -/ -def cbar {m n : Nat} (P : LPData m n) : Vec n := +@[expose] def cbar {m n : Nat} (P : LPData m n) : Vec n := fun j => P.c j - 1 /-- The YTM simplified HLP uses `zbar = cᵀe + 1`. -/ -def zbar {m n : Nat} (P : LPData m n) : ℝ := +@[expose] def zbar {m n : Nat} (P : LPData m n) : ℝ := dot P.c (ones : Vec n) + 1 /-- Full HLP direction, including the equality-multiplier direction `dy` and the @@ -278,6 +279,7 @@ structure HLPFullDirection (m n : Nat) where /-- Forget the free/equality components and retain the reduced complementarity variables. -/ +@[expose] def HLPFullDirection.toHSDirection {m n : Nat} (D : HLPFullDirection m n) : HSDirection n := { dx := D.dx dtau := D.dtau @@ -312,11 +314,11 @@ structure HLPFullDirectionEquation {m n : Nat} w.tau * D.dkappa + w.kappa * D.dtau = γ * mu w - w.tau * w.kappa /-- Right-hand side of the complementarity part of the YTM Newton system. -/ -def complRhs {n : Nat} (w : HSState n) (γ : ℝ) : Vec n := +@[expose] def complRhs {n : Nat} (w : HSState n) (γ : ℝ) : Vec n := fun i => γ * mu w - w.x i * w.s i /-- Right-hand side of the scalar complementarity equation. -/ -def scalarComplRhs {n : Nat} (w : HSState n) (γ : ℝ) : ℝ := +@[expose] def scalarComplRhs {n : Nat} (w : HSState n) (γ : ℝ) : ℝ := γ * mu w - w.tau * w.kappa /-- The full HLP Newton block operator, written as equations rather than as a single @@ -400,12 +402,12 @@ injective; in finite dimension, injectivity of a self-map implies surjectivity. abbrev HLPBlockSpace (m n : Nat) := Vec m × Vec n × ℝ × ℝ × Vec n × ℝ /-- Encode a full HLP direction as a vector in the product block space. -/ -def HLPFullDirection.toBlockVector {m n : Nat} (D : HLPFullDirection m n) : +@[expose] def HLPFullDirection.toBlockVector {m n : Nat} (D : HLPFullDirection m n) : HLPBlockSpace m n := (D.dy, D.dx, D.dtau, D.dtheta, D.ds, D.dkappa) /-- Decode a product block vector as a full HLP direction. -/ -def HLPFullDirection.ofBlockVector {m n : Nat} (u : HLPBlockSpace m n) : +@[expose] def HLPFullDirection.ofBlockVector {m n : Nat} (u : HLPBlockSpace m n) : HLPFullDirection m n := { dy := u.1 dx := u.2.1 @@ -427,7 +429,7 @@ def HLPFullDirection.ofBlockVector {m n : Nat} (u : HLPBlockSpace m n) : rfl /-- Right-hand side of the full Newton block system in the same block space. -/ -def HLPNewtonBlockRhs {n : Nat} (w : HSState n) (γ : ℝ) (m : Nat) : +@[expose] def HLPNewtonBlockRhs {n : Nat} (w : HSState n) (γ : ℝ) (m : Nat) : HLPBlockSpace m n := (0, 0, 0, 0, complRhs w γ, scalarComplRhs w γ) diff --git a/LeanPool/HadwigerNelsonBounds.lean b/LeanPool/HadwigerNelsonBounds.lean index c156c93c46..981758cd6c 100644 --- a/LeanPool/HadwigerNelsonBounds.lean +++ b/LeanPool/HadwigerNelsonBounds.lean @@ -18,7 +18,7 @@ Tags: graph-theory, geometric-graph-theory, graph-coloring, hadwiger-nelson MSC: 05C15, 52C10 -/ -@[expose] public section +public section /-! # Kernel-checked Hadwiger--Nelson bounds diff --git a/LeanPool/HadwigerNelsonBounds/Basic.lean b/LeanPool/HadwigerNelsonBounds/Basic.lean index a4e7a56fe2..0e699111c4 100644 --- a/LeanPool/HadwigerNelsonBounds/Basic.lean +++ b/LeanPool/HadwigerNelsonBounds/Basic.lean @@ -15,7 +15,7 @@ This module defines the Euclidean plane graph and the lattice geometry used by the seven-color construction. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -42,7 +42,7 @@ def unitDistanceGraph : SimpleGraph R2 := /-- Lattice basis spacing. Any value in the interval `(1/(√7 − 2/√3), √3/2) ≈ (0.671, 0.866)` is geometrically valid; we pick the clean rational `3/4`. -/ -noncomputable def isbellLatticeStep : ℝ := 3 / 4 +@[expose] noncomputable def isbellLatticeStep : ℝ := 3 / 4 /-- The triangular-lattice point at integer coords `(i, j)`: `i · (a, 0) + j · (a/2, a·√3/2)`. -/ @@ -53,11 +53,11 @@ noncomputable def isbellLatticePoint (i j : ℤ) : R2 := @[simp] lemma isbellLatticePoint_zero (i j : ℤ) : (isbellLatticePoint i j) 0 - = (i : ℝ) * isbellLatticeStep + (j : ℝ) * (isbellLatticeStep / 2) := rfl + = (i : ℝ) * isbellLatticeStep + (j : ℝ) * (isbellLatticeStep / 2) := by rfl @[simp] lemma isbellLatticePoint_one (i j : ℤ) : (isbellLatticePoint i j) 1 - = (j : ℝ) * (isbellLatticeStep * Real.sqrt 3 / 2) := rfl + = (j : ℝ) * (isbellLatticeStep * Real.sqrt 3 / 2) := by rfl /-- `√3 * √3 = 3`, hoisted to file scope for use in the squared-distance computation. -/ diff --git a/LeanPool/HadwigerNelsonBounds/IsbellColoring.lean b/LeanPool/HadwigerNelsonBounds/IsbellColoring.lean index dc90c01251..bf6b5fea10 100644 --- a/LeanPool/HadwigerNelsonBounds/IsbellColoring.lean +++ b/LeanPool/HadwigerNelsonBounds/IsbellColoring.lean @@ -16,7 +16,7 @@ This module proves the numerical gap estimates, constructs the plane coloring, and establishes the seven-color upper bound. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/LatticeSeparation.lean b/LeanPool/HadwigerNelsonBounds/LatticeSeparation.lean index ce25f23901..5d5dcbfbcd 100644 --- a/LeanPool/HadwigerNelsonBounds/LatticeSeparation.lean +++ b/LeanPool/HadwigerNelsonBounds/LatticeSeparation.lean @@ -14,7 +14,7 @@ This module proves the modular quadratic-form estimate that separates distinct lattice points carrying the same residue color. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsCanonicalTriangle.lean b/LeanPool/HadwigerNelsonBounds/PartsCanonicalTriangle.lean index 002a84e252..762f69a60f 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCanonicalTriangle.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCanonicalTriangle.lean @@ -16,7 +16,7 @@ The checked Parts certificate rules out a monochromatic copy of its canonical equilateral triangle in every proper four-coloring of the plane. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -31,10 +31,10 @@ lemma partsColorEquiv_spec {triple center : Fin 4} (hne : triple ≠ center) : fin_cases triple <;> fin_cases center <;> revert hne <;> decide /-- First vertex of the canonical equilateral triangle in the Parts graph. -/ -noncomputable def partsTriangleA : R2 := (partsPoint 195).toR2 +@[expose] noncomputable def partsTriangleA : R2 := (partsPoint 195).toR2 /-- Second vertex of the canonical equilateral triangle in the Parts graph. -/ -noncomputable def partsTriangleB : R2 := (partsPoint 205).toR2 +@[expose] noncomputable def partsTriangleB : R2 := (partsPoint 205).toR2 /-- Third vertex of the canonical equilateral triangle in the Parts graph. -/ noncomputable def partsTriangleC : R2 := (partsPoint 215).toR2 diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificate.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificate.lean index 54abb932c1..8b27cd150b 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificate.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificate.lean @@ -16,7 +16,7 @@ the same certificate as the source coloring diagram, but avoids artificial recursion depth from long chains of forced assignments. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -40,7 +40,7 @@ structure PartsTreeNode where namespace PartsTreeNode /-- Decode zero as no child and `n + 1` as child index `n`. -/ -def child (node : PartsTreeNode) (color : Fin 4) : Option Nat := +@[expose] def child (node : PartsTreeNode) (color : Fin 4) : Option Nat := match node.children color with | 0 => none | n + 1 => some n @@ -57,7 +57,7 @@ structure PartsCertificate where nodes : Array (Array PartsTreeNode) /-- Constant-depth lookup in a tree stored as 64-node chunks. -/ -def partsTreeNodeAt (nodes : Array (Array PartsTreeNode)) (index : Nat) : +@[expose] def partsTreeNodeAt (nodes : Array (Array PartsTreeNode)) (index : Nat) : Option PartsTreeNode := match nodes[index / 64]? with | none => none @@ -69,7 +69,7 @@ def PartsBlocks (path : List PartsAssignment) (vertex : Fin 481) (color : Fin 4) assignment.color = color ∧ partsAdjacent vertex assignment.vertex = true /-- A coloring agrees with every assignment on a certificate path. -/ -def PartsExtends (coloring : Fin 481 → Fin 4) (path : List PartsAssignment) : Prop := +@[expose] def PartsExtends (coloring : Fin 481 → Fin 4) (path : List PartsAssignment) : Prop := ∀ assignment ∈ path, coloring assignment.vertex = assignment.color /-- Properness for the exact unit edges recognized by the certificate. -/ @@ -77,13 +77,14 @@ def PartsProper (coloring : Fin 481 → Fin 4) : Prop := ∀ ⦃v w : Fin 481⦄, partsAdjacent v w = true → coloring v ≠ coloring w /-- The four colors, as data for the executable checker. -/ -def partsColors : List (Fin 4) := [0, 1, 2, 3] +@[expose] def partsColors : List (Fin 4) := [0, 1, 2, 3] lemma mem_partsColors (color : Fin 4) : color ∈ partsColors := by fin_cases color <;> simp [partsColors] /-- Executable counterpart of `PartsBlocks`. -/ -def PartsBlocksB (path : List PartsAssignment) (vertex : Fin 481) (color : Fin 4) : Bool := +@[expose] def PartsBlocksB (path : List PartsAssignment) (vertex : Fin 481) + (color : Fin 4) : Bool := path.any fun assignment => assignment.color == color && partsAdjacent vertex assignment.vertex @@ -99,12 +100,12 @@ lemma partsBlocksB_eq_true {path : List PartsAssignment} {vertex : Fin 481} exact ⟨assignment, hin, by simp [hcolor, hadj]⟩ /-- A forced assignment is the only color not blocked by the current path. -/ -def PartsForcedB (path : List PartsAssignment) (assignment : PartsAssignment) : Bool := +@[expose] def PartsForcedB (path : List PartsAssignment) (assignment : PartsAssignment) : Bool := partsColors.all fun color => color == assignment.color || PartsBlocksB path assignment.vertex color /-- Execute a sequence of forced assignments, returning the extended path. -/ -def PartsRunStemB : List PartsAssignment → List PartsAssignment → +@[expose] def PartsRunStemB : List PartsAssignment → List PartsAssignment → Option (List PartsAssignment) | [], path => some path | assignment :: stem, path => @@ -114,7 +115,7 @@ def PartsRunStemB : List PartsAssignment → List PartsAssignment → none /-- Executable checker for a compressed coloring tree. -/ -def PartsVerifiesNodeB (nodes : Array (Array PartsTreeNode)) : +@[expose] def PartsVerifiesNodeB (nodes : Array (Array PartsTreeNode)) : Nat → List PartsAssignment → Nat → Bool | 0, _, _ => false | fuel + 1, path, index => @@ -133,7 +134,7 @@ def PartsVerifiesNodeB (nodes : Array (Array PartsTreeNode)) : (⟨node.vertex, color⟩ :: extended) child /-- Check a certificate from node zero with enough fuel for an acyclic tree. -/ -def PartsCertificate.Verifies (certificate : PartsCertificate) : Prop := +@[expose] def PartsCertificate.Verifies (certificate : PartsCertificate) : Prop := PartsVerifiesNodeB certificate.nodes (certificate.nodeCount + 1) certificate.roots 0 = true diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData.lean index 938e983fbc..7f57643370 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData.lean @@ -21,12 +21,12 @@ Together with swapping the two unused color names, they expand 36 orbit representatives to all 432 proper normalized root colorings. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- The 36 normalized coloring-tree representatives. -/ -def partsBaseCertificates : Array PartsCertificate := #[ +@[expose] def partsBaseCertificates : Array PartsCertificate := #[ partsBaseCertificate0, partsBaseCertificate1, partsBaseCertificate2, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData0.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData0.lean index 81b2ca208d..96d4a86531 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData0.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 0 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 10, checked by Parts tree `S`. -/ -def partsBaseCertificate10 : PartsCertificate := { +@[expose] def partsBaseCertificate10 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -31,7 +31,7 @@ def partsBaseCertificate10 : PartsCertificate := { } /-- Normalized root orbit 13, checked by Parts tree `L5`. -/ -def partsBaseCertificate13 : PartsCertificate := { +@[expose] def partsBaseCertificate13 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -59,7 +59,7 @@ def partsBaseCertificate13 : PartsCertificate := { } /-- Normalized root orbit 16, checked by Parts tree `L8`. -/ -def partsBaseCertificate16 : PartsCertificate := { +@[expose] def partsBaseCertificate16 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -178,7 +178,7 @@ def partsBaseCertificate16 : PartsCertificate := { } /-- Normalized root orbit 26, checked by Parts tree `S`. -/ -def partsBaseCertificate26 : PartsCertificate := { +@[expose] def partsBaseCertificate26 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, @@ -195,7 +195,7 @@ def partsBaseCertificate26 : PartsCertificate := { } /-- Normalized root orbit 35, checked by Parts tree `S`. -/ -def partsBaseCertificate35 : PartsCertificate := { +@[expose] def partsBaseCertificate35 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData1.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData1.lean index 74ef4bd50b..0acd2f5e65 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData1.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 1 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 3, checked by Parts tree `L2`. -/ -def partsBaseCertificate3 : PartsCertificate := { +@[expose] def partsBaseCertificate3 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 1⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -37,7 +37,7 @@ def partsBaseCertificate3 : PartsCertificate := { } /-- Normalized root orbit 17, checked by Parts tree `L8`. -/ -def partsBaseCertificate17 : PartsCertificate := { +@[expose] def partsBaseCertificate17 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -156,7 +156,7 @@ def partsBaseCertificate17 : PartsCertificate := { } /-- Normalized root orbit 23, checked by Parts tree `L2`. -/ -def partsBaseCertificate23 : PartsCertificate := { +@[expose] def partsBaseCertificate23 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -179,7 +179,7 @@ def partsBaseCertificate23 : PartsCertificate := { } /-- Normalized root orbit 28, checked by Parts tree `S`. -/ -def partsBaseCertificate28 : PartsCertificate := { +@[expose] def partsBaseCertificate28 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData2.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData2.lean index efc05c0a0d..621167ce29 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData2.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 2 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 0, checked by Parts tree `S`. -/ -def partsBaseCertificate0 : PartsCertificate := { +@[expose] def partsBaseCertificate0 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 1⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -31,7 +31,7 @@ def partsBaseCertificate0 : PartsCertificate := { } /-- Normalized root orbit 4, checked by Parts tree `L2`. -/ -def partsBaseCertificate4 : PartsCertificate := { +@[expose] def partsBaseCertificate4 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 1⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -54,7 +54,7 @@ def partsBaseCertificate4 : PartsCertificate := { } /-- Normalized root orbit 14, checked by Parts tree `S`. -/ -def partsBaseCertificate14 : PartsCertificate := { +@[expose] def partsBaseCertificate14 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -71,7 +71,7 @@ def partsBaseCertificate14 : PartsCertificate := { } /-- Normalized root orbit 19, checked by Parts tree `L8`. -/ -def partsBaseCertificate19 : PartsCertificate := { +@[expose] def partsBaseCertificate19 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -190,7 +190,7 @@ def partsBaseCertificate19 : PartsCertificate := { } /-- Normalized root orbit 29, checked by Parts tree `S`. -/ -def partsBaseCertificate29 : PartsCertificate := { +@[expose] def partsBaseCertificate29 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData3.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData3.lean index 795a58f3b0..3550d37515 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData3.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 3 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 2, checked by Parts tree `S`. -/ -def partsBaseCertificate2 : PartsCertificate := { +@[expose] def partsBaseCertificate2 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 1⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -31,7 +31,7 @@ def partsBaseCertificate2 : PartsCertificate := { } /-- Normalized root orbit 11, checked by Parts tree `L2`. -/ -def partsBaseCertificate11 : PartsCertificate := { +@[expose] def partsBaseCertificate11 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -54,7 +54,7 @@ def partsBaseCertificate11 : PartsCertificate := { } /-- Normalized root orbit 15, checked by Parts tree `S`. -/ -def partsBaseCertificate15 : PartsCertificate := { +@[expose] def partsBaseCertificate15 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -71,7 +71,7 @@ def partsBaseCertificate15 : PartsCertificate := { } /-- Normalized root orbit 24, checked by Parts tree `L8`. -/ -def partsBaseCertificate24 : PartsCertificate := { +@[expose] def partsBaseCertificate24 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -190,7 +190,7 @@ def partsBaseCertificate24 : PartsCertificate := { } /-- Normalized root orbit 30, checked by Parts tree `S`. -/ -def partsBaseCertificate30 : PartsCertificate := { +@[expose] def partsBaseCertificate30 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData4.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData4.lean index f044bcf0d3..695a7387ca 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData4.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData4.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 4 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 5, checked by Parts tree `S`. -/ -def partsBaseCertificate5 : PartsCertificate := { +@[expose] def partsBaseCertificate5 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 1⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -31,7 +31,7 @@ def partsBaseCertificate5 : PartsCertificate := { } /-- Normalized root orbit 18, checked by Parts tree `S`. -/ -def partsBaseCertificate18 : PartsCertificate := { +@[expose] def partsBaseCertificate18 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -48,7 +48,7 @@ def partsBaseCertificate18 : PartsCertificate := { } /-- Normalized root orbit 20, checked by Parts tree `L2`. -/ -def partsBaseCertificate20 : PartsCertificate := { +@[expose] def partsBaseCertificate20 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -71,7 +71,7 @@ def partsBaseCertificate20 : PartsCertificate := { } /-- Normalized root orbit 25, checked by Parts tree `L8`. -/ -def partsBaseCertificate25 : PartsCertificate := { +@[expose] def partsBaseCertificate25 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -190,7 +190,7 @@ def partsBaseCertificate25 : PartsCertificate := { } /-- Normalized root orbit 31, checked by Parts tree `S`. -/ -def partsBaseCertificate31 : PartsCertificate := { +@[expose] def partsBaseCertificate31 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData5.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData5.lean index 15b3d25ff0..29d14900a4 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData5.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData5.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 5 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 6, checked by Parts tree `S`. -/ -def partsBaseCertificate6 : PartsCertificate := { +@[expose] def partsBaseCertificate6 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -31,7 +31,7 @@ def partsBaseCertificate6 : PartsCertificate := { } /-- Normalized root orbit 8, checked by Parts tree `L3`. -/ -def partsBaseCertificate8 : PartsCertificate := { +@[expose] def partsBaseCertificate8 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -96,7 +96,7 @@ def partsBaseCertificate8 : PartsCertificate := { } /-- Normalized root orbit 9, checked by Parts tree `L4`. -/ -def partsBaseCertificate9 : PartsCertificate := { +@[expose] def partsBaseCertificate9 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -135,7 +135,7 @@ def partsBaseCertificate9 : PartsCertificate := { } /-- Normalized root orbit 12, checked by Parts tree `L4`. -/ -def partsBaseCertificate12 : PartsCertificate := { +@[expose] def partsBaseCertificate12 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -174,7 +174,7 @@ def partsBaseCertificate12 : PartsCertificate := { } /-- Normalized root orbit 21, checked by Parts tree `S`. -/ -def partsBaseCertificate21 : PartsCertificate := { +@[expose] def partsBaseCertificate21 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -191,7 +191,7 @@ def partsBaseCertificate21 : PartsCertificate := { } /-- Normalized root orbit 32, checked by Parts tree `S`. -/ -def partsBaseCertificate32 : PartsCertificate := { +@[expose] def partsBaseCertificate32 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCertificateData6.lean b/LeanPool/HadwigerNelsonBounds/PartsCertificateData6.lean index 43f3336b31..13b1c039d6 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCertificateData6.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCertificateData6.lean @@ -9,12 +9,12 @@ public import LeanPool.HadwigerNelsonBounds.PartsCertificate /-! Generated chunk 6 of the Parts coloring-tree certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Normalized root orbit 1, checked by Parts tree `L1`. -/ -def partsBaseCertificate1 : PartsCertificate := { +@[expose] def partsBaseCertificate1 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 1⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -76,7 +76,7 @@ def partsBaseCertificate1 : PartsCertificate := { } /-- Normalized root orbit 7, checked by Parts tree `S`. -/ -def partsBaseCertificate7 : PartsCertificate := { +@[expose] def partsBaseCertificate7 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 2⟩, @@ -93,7 +93,7 @@ def partsBaseCertificate7 : PartsCertificate := { } /-- Normalized root orbit 22, checked by Parts tree `S`. -/ -def partsBaseCertificate22 : PartsCertificate := { +@[expose] def partsBaseCertificate22 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 1⟩, ⟨78, 3⟩, @@ -110,7 +110,7 @@ def partsBaseCertificate22 : PartsCertificate := { } /-- Normalized root orbit 27, checked by Parts tree `L6`. -/ -def partsBaseCertificate27 : PartsCertificate := { +@[expose] def partsBaseCertificate27 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, @@ -141,7 +141,7 @@ def partsBaseCertificate27 : PartsCertificate := { } /-- Normalized root orbit 33, checked by Parts tree `S`. -/ -def partsBaseCertificate33 : PartsCertificate := { +@[expose] def partsBaseCertificate33 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, @@ -158,7 +158,7 @@ def partsBaseCertificate33 : PartsCertificate := { } /-- Normalized root orbit 34, checked by Parts tree `L7`. -/ -def partsBaseCertificate34 : PartsCertificate := { +@[expose] def partsBaseCertificate34 : PartsCertificate := { roots := [ ⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩, ⟨210, 1⟩, ⟨220, 1⟩, ⟨200, 2⟩, ⟨72, 2⟩, ⟨78, 3⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsCoordinates.lean b/LeanPool/HadwigerNelsonBounds/PartsCoordinates.lean index 01f610b535..2e82be204e 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsCoordinates.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsCoordinates.lean @@ -14,12 +14,12 @@ The order and coordinates are transcribed from `JP/Pink/g481.vtx` in the Polymath 16 data archive accompanying Jaan Parts, arXiv:2010.12661. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Coordinate lookup chunk 0. -/ -def partsPointChunk0 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk0 (index : Nat) : PartsPoint := match index with | 0 => ⟨0, 0, 0, 0⟩ | 1 => ⟨-5, 1, 3, -1⟩ @@ -88,7 +88,7 @@ def partsPointChunk0 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 1. -/ -def partsPointChunk1 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk1 (index : Nat) : PartsPoint := match index with | 0 => ⟨-4, 0, 6, -2⟩ | 1 => ⟨3, -1, -3, 3⟩ @@ -157,7 +157,7 @@ def partsPointChunk1 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 2. -/ -def partsPointChunk2 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk2 (index : Nat) : PartsPoint := match index with | 0 => ⟨-8, 0, 6, -2⟩ | 1 => ⟨-13, 1, 1, 1⟩ @@ -226,7 +226,7 @@ def partsPointChunk2 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 3. -/ -def partsPointChunk3 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk3 (index : Nat) : PartsPoint := match index with | 0 => ⟨-4, 0, 2, 2⟩ | 1 => ⟨-5, 1, 5, 1⟩ @@ -295,7 +295,7 @@ def partsPointChunk3 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 4. -/ -def partsPointChunk4 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk4 (index : Nat) : PartsPoint := match index with | 0 => ⟨0, 0, -8, 0⟩ | 1 => ⟨-4, 0, 0, -4⟩ @@ -364,7 +364,7 @@ def partsPointChunk4 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 5. -/ -def partsPointChunk5 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk5 (index : Nat) : PartsPoint := match index with | 0 => ⟨4, 2, 0, -2⟩ | 1 => ⟨2, 2, -2, -2⟩ @@ -433,7 +433,7 @@ def partsPointChunk5 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 6. -/ -def partsPointChunk6 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk6 (index : Nat) : PartsPoint := match index with | 0 => ⟨4, 0, -4, -4⟩ | 1 => ⟨-4, 0, -4, -4⟩ @@ -502,7 +502,7 @@ def partsPointChunk6 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Coordinate lookup chunk 7. -/ -def partsPointChunk7 (index : Nat) : PartsPoint := +@[expose] def partsPointChunk7 (index : Nat) : PartsPoint := match index with | 0 => ⟨8, 2, 4, 2⟩ | 1 => ⟨10, 2, 2, 2⟩ @@ -540,7 +540,7 @@ def partsPointChunk7 (index : Nat) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- The exact coordinate attached to a vertex number in the base graph. -/ -def partsPoint (v : Fin 481) : PartsPoint := +@[expose] def partsPoint (v : Fin 481) : PartsPoint := match v.val / 64 with | 0 => partsPointChunk0 (v.val % 64) | 1 => partsPointChunk1 (v.val % 64) @@ -553,7 +553,7 @@ def partsPoint (v : Fin 481) : PartsPoint := | _ => ⟨0, 0, 0, 0⟩ /-- Decidable unit adjacency used by the lower-bound certificate checker. -/ -def partsAdjacent (v w : Fin 481) : Bool := +@[expose] def partsAdjacent (v w : Fin 481) : Bool := ((partsPoint v).sub (partsPoint w)).IsUnit lemma dist_partsPoint_eq_one {v w : Fin 481} (h : partsAdjacent v w) : diff --git a/LeanPool/HadwigerNelsonBounds/PartsFirstStage.lean b/LeanPool/HadwigerNelsonBounds/PartsFirstStage.lean index 4573565a6f..3cd1ec74b3 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsFirstStage.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsFirstStage.lean @@ -22,25 +22,25 @@ root symmetries and the remaining color swap. The resulting 432 certificates cover every proper normalized coloring of the 13-vertex 2-Golomb root. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Swap the two colors not fixed by the normalized root. -/ -def partsSwapMiddleColor (color : Fin 4) : Fin 4 := ![0, 2, 1, 3] color +@[expose] def partsSwapMiddleColor (color : Fin 4) : Fin 4 := ![0, 2, 1, 3] color /-- The color renaming used by a certificate variant. -/ -def partsTransformColor (swap : Bool) (color : Fin 4) : Fin 4 := +@[expose] def partsTransformColor (swap : Bool) (color : Fin 4) : Fin 4 := if swap then partsSwapMiddleColor color else color /-- Rename the vertices and optionally the two free colors of an assignment. -/ -def partsTransformAssignment (symmetry : Fin 6) (swap : Bool) +@[expose] def partsTransformAssignment (symmetry : Fin 6) (swap : Bool) (assignment : PartsAssignment) : PartsAssignment := { vertex := partsPermuteVertex symmetry assignment.vertex color := partsTransformColor swap assignment.color } /-- Transform a root path without materializing a second copy of its tree. -/ -def partsTransformPath (symmetry : Fin 6) (swap : Bool) : +@[expose] def partsTransformPath (symmetry : Fin 6) (swap : Bool) : List PartsAssignment → List PartsAssignment | [] => [] | assignment :: path => @@ -251,7 +251,7 @@ private lemma partsRunStemB_transform (symmetry : Fin 6) (swap : Bool) : · rfl /-- Select one of the 36 normalized root-orbit certificates. -/ -def partsBaseCertificate (base : Fin 36) : PartsCertificate := +@[expose] def partsBaseCertificate (base : Fin 36) : PartsCertificate := match base.val with | 0 => partsBaseCertificate0 | 1 => partsBaseCertificate1 @@ -374,7 +374,7 @@ private lemma partsVerifiesVariantNodeB_transform (symmetry : Fin 6) (swap : Boo partsTransformColor_involutive] /-- One of the 432 symmetry-expanded certificates passes the checker. -/ -def PartsCertificateVariantVerifies (base : Fin 36) (symmetry : Fin 6) +@[expose] def PartsCertificateVariantVerifies (base : Fin 36) (symmetry : Fin 6) (swap : Bool) : Prop := let certificate := partsBaseCertificate base PartsVerifiesVariantNodeB symmetry swap certificate.nodes diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetCases.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetCases.lean index 80eaabaf5e..6120e946b6 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetCases.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetCases.lean @@ -21,7 +21,7 @@ unblocked color branch. Certificate soundness remains a theorem of Lean, while each small tree is independently reduced by the kernel. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -33,7 +33,7 @@ inductive PartsGadgetCaseNode (certificateCount : Nat) where namespace PartsGadgetCaseNode /-- Decode zero as no child and `n + 1` as child index `n`. -/ -def child {certificateCount : Nat} +@[expose] def child {certificateCount : Nat} (node : PartsGadgetCaseNode certificateCount) (color : Fin 4) : Option Nat := match node with @@ -55,7 +55,7 @@ structure PartsGadgetCaseTree (certificateCount : Nat) where nodes : Array (PartsGadgetCaseNode certificateCount) /-- Check routing, but leave each selected certificate proof as a separate fact. -/ -def PartsGadgetCaseVerifiesNodeB {certificateCount : Nat} +@[expose] def PartsGadgetCaseVerifiesNodeB {certificateCount : Nat} (certificates : Fin certificateCount → PartsGadgetCertificate) (nodes : Array (PartsGadgetCaseNode certificateCount)) : Nat → List PartsGadgetAssignment → Nat → Bool @@ -75,7 +75,7 @@ def PartsGadgetCaseVerifiesNodeB {certificateCount : Nat} (path ++ [⟨vertex, color⟩]) child /-- The root-routing check for a case tree. -/ -def PartsGadgetCaseTree.VerifiesRouting {certificateCount : Nat} +@[expose] def PartsGadgetCaseTree.VerifiesRouting {certificateCount : Nat} (tree : PartsGadgetCaseTree certificateCount) (certificates : Fin certificateCount → PartsGadgetCertificate) : Prop := PartsGadgetCaseVerifiesNodeB certificates tree.nodes (tree.nodeCount + 1) diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetCertificate.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetCertificate.lean index 596650c637..dd7d9220b9 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetCertificate.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetCertificate.lean @@ -21,7 +21,7 @@ sqrt-three triples. Unary stretches of its coloring trees are stored as forced stems, exactly as in the first-stage Parts certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -45,7 +45,7 @@ structure PartsGadgetTreeNode where namespace PartsGadgetTreeNode /-- Decode zero as no child and `n + 1` as child index `n`. -/ -def child (node : PartsGadgetTreeNode) (color : Fin 4) : Option Nat := +@[expose] def child (node : PartsGadgetTreeNode) (color : Fin 4) : Option Nat := match node.children color with | 0 => none | index + 1 => some index @@ -62,7 +62,7 @@ structure PartsGadgetCertificate where nodes : Array (Array PartsGadgetTreeNode) /-- Constant-depth lookup in a tree stored as 64-node chunks. -/ -def partsGadgetTreeNodeAt (nodes : Array (Array PartsGadgetTreeNode)) +@[expose] def partsGadgetTreeNodeAt (nodes : Array (Array PartsGadgetTreeNode)) (index : Nat) : Option PartsGadgetTreeNode := match nodes[index / 64]? with | none => none @@ -83,7 +83,7 @@ def PartsGadgetValid (coloring : Fin 73 → Fin 4) : Prop := PartsGadgetProper coloring ∧ PartsGadgetNoMono coloring /-- A coloring agrees with every assignment on a certificate path. -/ -def PartsGadgetExtends (coloring : Fin 73 → Fin 4) +@[expose] def PartsGadgetExtends (coloring : Fin 73 → Fin 4) (path : List PartsGadgetAssignment) : Prop := ∀ assignment ∈ path, coloring assignment.vertex = assignment.color @@ -104,13 +104,13 @@ def PartsGadgetBlocks (path : List PartsGadgetAssignment) PartsGadgetHasColor path pair.2 color /-- The four colors, as executable data. -/ -def partsGadgetColors : List (Fin 4) := [0, 1, 2, 3] +@[expose] def partsGadgetColors : List (Fin 4) := [0, 1, 2, 3] lemma mem_partsGadgetColors (color : Fin 4) : color ∈ partsGadgetColors := by fin_cases color <;> simp [partsGadgetColors] /-- Executable path-color lookup. -/ -def PartsGadgetHasColorB (path : List PartsGadgetAssignment) +@[expose] def PartsGadgetHasColorB (path : List PartsGadgetAssignment) (vertex : Fin 73) (color : Fin 4) : Bool := path.any fun assignment => assignment.vertex == vertex && assignment.color == color @@ -128,7 +128,7 @@ lemma partsGadgetHasColorB_eq_true {path : List PartsGadgetAssignment} exact ⟨assignment, hin, by simp⟩ /-- Executable counterpart of `PartsGadgetBlocks`. -/ -def PartsGadgetBlocksB (path : List PartsGadgetAssignment) +@[expose] def PartsGadgetBlocksB (path : List PartsGadgetAssignment) (vertex : Fin 73) (color : Fin 4) : Bool := path.any (fun assignment => assignment.color == color && @@ -169,14 +169,14 @@ lemma partsGadgetBlocksB_eq_true {path : List PartsGadgetAssignment} partsGadgetHasColorB_eq_true.mpr hright⟩⟩ /-- A forced assignment is the only color not blocked by the path. -/ -def PartsGadgetForcedB (path : List PartsGadgetAssignment) +@[expose] def PartsGadgetForcedB (path : List PartsGadgetAssignment) (assignment : PartsGadgetAssignment) : Bool := partsGadgetColors.all fun color => color == assignment.color || PartsGadgetBlocksB path assignment.vertex color /-- Execute a sequence of forced assignments. -/ -def PartsGadgetRunStemB : List PartsGadgetAssignment → +@[expose] def PartsGadgetRunStemB : List PartsGadgetAssignment → List PartsGadgetAssignment → Option (List PartsGadgetAssignment) | [], path => some path | assignment :: stem, path => @@ -186,7 +186,7 @@ def PartsGadgetRunStemB : List PartsGadgetAssignment → none /-- Executable checker for a compressed contradiction tree. -/ -def PartsGadgetVerifiesNodeB (nodes : Array (Array PartsGadgetTreeNode)) : +@[expose] def PartsGadgetVerifiesNodeB (nodes : Array (Array PartsGadgetTreeNode)) : Nat → List PartsGadgetAssignment → Nat → Bool | 0, _, _ => false | fuel + 1, path, index => @@ -205,7 +205,7 @@ def PartsGadgetVerifiesNodeB (nodes : Array (Array PartsGadgetTreeNode)) : (⟨node.vertex, color⟩ :: extended) child /-- Check a certificate from node zero with enough acyclic-tree fuel. -/ -def PartsGadgetCertificate.Verifies +@[expose] def PartsGadgetCertificate.Verifies (certificate : PartsGadgetCertificate) : Prop := PartsGadgetVerifiesNodeB certificate.nodes (certificate.nodeCount + 1) certificate.roots 0 = true diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetData.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetData.lean index e05eeb029a..dab522b61a 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetData.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetData.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated exact combinatorics for the finite second-stage Parts gadget. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -29,7 +29,7 @@ structure PartsGadgetVertex where deriving DecidableEq /-- Exact descriptor of one of the 73 gadget vertices. -/ -def partsGadgetVertex (vertex : Fin 73) : PartsGadgetVertex := +@[expose] def partsGadgetVertex (vertex : Fin 73) : PartsGadgetVertex := match vertex.val with | 0 => ⟨false, -3, 0⟩ | 1 => ⟨false, -3, 1⟩ @@ -121,7 +121,7 @@ deriving DecidableEq /-- A vertex has the requested axial coordinates in the requested patch. The common origin belongs to both patches. -/ -def partsGadgetAxialAt (rotated : Bool) (q r : Int) +@[expose] def partsGadgetAxialAt (rotated : Bool) (q r : Int) (vertex : Fin 73) : Prop := let descriptor := partsGadgetVertex vertex descriptor.q = q ∧ descriptor.r = r ∧ @@ -133,7 +133,7 @@ instance (rotated : Bool) (q r : Int) (vertex : Fin 73) : infer_instance /-- Decidable equality-up-to-permutation for three named vertices. -/ -def partsGadgetSameTriple (a b c x y z : Fin 73) : Prop := +@[expose] def partsGadgetSameTriple (a b c x y z : Fin 73) : Prop := (a = x ∧ b = y ∧ c = z) ∨ (a = x ∧ b = z ∧ c = y) ∨ (a = y ∧ b = x ∧ c = z) ∨ (a = y ∧ b = z ∧ c = x) ∨ (a = z ∧ b = x ∧ c = y) ∨ (a = z ∧ b = y ∧ c = x) @@ -144,7 +144,7 @@ instance (a b c x y z : Fin 73) : infer_instance /-- Exact validity conditions for a triangle witness. -/ -def PartsGadgetTriangleWitnessData.Valid +@[expose] def PartsGadgetTriangleWitnessData.Valid (witness : PartsGadgetTriangleWitnessData) (root : Fin 73) : Prop := partsGadgetSameTriple witness.a witness.b witness.c root witness.left witness.right ∧ @@ -165,7 +165,7 @@ instance (witness : PartsGadgetTriangleWitnessData) (root : Fin 73) : infer_instance /-- Geometric witnesses for every listed sqrt-three triple. -/ -def partsGadgetTriangleWitnesses (vertex : Fin 73) : +@[expose] def partsGadgetTriangleWitnesses (vertex : Fin 73) : List PartsGadgetTriangleWitnessData := match vertex.val with | 0 => [ @@ -545,7 +545,7 @@ def partsGadgetTriangleWitnesses (vertex : Fin 73) : | _ => [] /-- Unit-edge neighbors used by the executable certificate checker. -/ -def partsGadgetNeighbors (vertex : Fin 73) : List (Fin 73) := +@[expose] def partsGadgetNeighbors (vertex : Fin 73) : List (Fin 73) := match vertex.val with | 0 => [1, 4, 5] | 1 => [0, 2, 5, 6] @@ -623,12 +623,12 @@ def partsGadgetNeighbors (vertex : Fin 73) : List (Fin 73) := | _ => [] /-- Opposite pairs completing sqrt-three triples at a vertex. -/ -def partsGadgetTriplePairs (vertex : Fin 73) : List (Fin 73 × Fin 73) := +@[expose] def partsGadgetTriplePairs (vertex : Fin 73) : List (Fin 73 × Fin 73) := (partsGadgetTriangleWitnesses vertex).map fun witness => (witness.left, witness.right) /-- Central inversion of both lattice patches. -/ -def partsGadgetNegation (vertex : Fin 73) : Fin 73 := +@[expose] def partsGadgetNegation (vertex : Fin 73) : Fin 73 := match vertex.val with | 0 => 36 | 1 => 35 diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification.lean index 5c5b76cc99..13364eeb99 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification.lean @@ -13,7 +13,7 @@ import LeanPool.HadwigerNelsonBounds.PartsGadgetEdgeVerification3 /-! Aggregated edge-geometry checks for the finite gadget. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification0.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification0.lean index a88dd488ed..34f3cfb847 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification0.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsGadgetEmbeddingCore /-! Generated edge-geometry checks, group 0. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification1.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification1.lean index 46165603cf..0e81b4eafc 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification1.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsGadgetEmbeddingCore /-! Generated edge-geometry checks, group 1. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification2.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification2.lean index d826938276..2d8c8e4126 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification2.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsGadgetEmbeddingCore /-! Generated edge-geometry checks, group 2. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification3.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification3.lean index d5006448ac..af5c8bafbd 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEdgeVerification3.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsGadgetEmbeddingCore /-! Generated edge-geometry checks, group 3. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbedding.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbedding.lean index 29e5dbe360..963beb77bc 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbedding.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbedding.lean @@ -18,7 +18,7 @@ Every combinatorial edge is a unit segment and every hyperedge is a rigid copy of the canonical triangle ruled out by the checked 481-vertex certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbeddingCore.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbeddingCore.lean index 76da00de16..27953a98bf 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbeddingCore.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetEmbeddingCore.lean @@ -15,7 +15,7 @@ The 73 descriptors encode two radius-three triangular-lattice patches with a common center. The second patch is rotated through cosine `7/8`. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetForcedPair.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetForcedPair.lean index a35db1bf0d..eba763150d 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetForcedPair.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetForcedPair.lean @@ -21,7 +21,7 @@ to have the same color. Color renamings and central inversion reduce every case to the independently checked normalized trees. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData.lean index 234cae9a63..6ab76b7fff 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData.lean @@ -21,12 +21,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated aggregation and routing for the hard normalized cases. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- All independently checked hard-case certificates. -/ -def partsGadgetHardCertificates (index : Fin 31) : PartsGadgetCertificate := +@[expose] def partsGadgetHardCertificates (index : Fin 31) : PartsGadgetCertificate := match index.val with | 0 => partsGadgetHardCertificate0 | 1 => partsGadgetHardCertificate1 @@ -62,7 +62,7 @@ def partsGadgetHardCertificates (index : Fin 31) : PartsGadgetCertificate := | _ => partsGadgetHardCertificate0 /-- Routing nodes covering every unblocked hard normalized coloring. -/ -def partsGadgetHardCaseNodes : Array (PartsGadgetCaseNode 31) := #[ +@[expose] def partsGadgetHardCaseNodes : Array (PartsGadgetCaseNode 31) := #[ PartsGadgetCaseNode.branch 19 ![0, 0, 2, 29], PartsGadgetCaseNode.branch 12 ![0, 3, 0, 4], PartsGadgetCaseNode.leaf 0, @@ -115,7 +115,7 @@ def partsGadgetHardCaseNodes : Array (PartsGadgetCaseNode 31) := #[ ] /-- The complete hard-case routing tree. -/ -def partsGadgetHardCaseTree : PartsGadgetCaseTree 31 := { +@[expose] def partsGadgetHardCaseTree : PartsGadgetCaseTree 31 := { roots := [⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩] nodeCount := 49 nodes := partsGadgetHardCaseNodes diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData0.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData0.lean index cd9eef7a05..4b68fa684a 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData0.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 0. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate0`. -/ -def partsGadgetHardCertificate0 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate0 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 1⟩ ] @@ -33,7 +33,7 @@ def partsGadgetHardCertificate0 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate1`. -/ -def partsGadgetHardCertificate1 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate1 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 1⟩, ⟨4, 1⟩ @@ -243,7 +243,7 @@ def partsGadgetHardCertificate1 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate2`. -/ -def partsGadgetHardCertificate2 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate2 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 1⟩, ⟨4, 2⟩ @@ -453,7 +453,7 @@ def partsGadgetHardCertificate2 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate3`. -/ -def partsGadgetHardCertificate3 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate3 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 1⟩, ⟨4, 3⟩ @@ -467,7 +467,7 @@ def partsGadgetHardCertificate3 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate4`. -/ -def partsGadgetHardCertificate4 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate4 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 1⟩, ⟨22, 1⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData1.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData1.lean index 6150be2de7..36bb5c242f 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData1.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 1. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate5`. -/ -def partsGadgetHardCertificate5 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate5 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 1⟩, ⟨22, 2⟩ @@ -230,7 +230,7 @@ def partsGadgetHardCertificate5 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate6`. -/ -def partsGadgetHardCertificate6 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate6 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 1⟩, ⟨22, 3⟩ @@ -440,7 +440,7 @@ def partsGadgetHardCertificate6 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate7`. -/ -def partsGadgetHardCertificate7 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate7 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 2⟩ @@ -454,7 +454,7 @@ def partsGadgetHardCertificate7 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate8`. -/ -def partsGadgetHardCertificate8 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate8 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 3⟩, ⟨9, 1⟩, ⟨22, 1⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData2.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData2.lean index b9d754dc09..b8582447b0 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData2.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 2. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate9`. -/ -def partsGadgetHardCertificate9 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate9 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 3⟩, ⟨9, 1⟩, ⟨22, 2⟩ @@ -230,7 +230,7 @@ def partsGadgetHardCertificate9 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate10`. -/ -def partsGadgetHardCertificate10 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate10 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 3⟩, ⟨9, 1⟩, ⟨22, 3⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData3.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData3.lean index 898c48ada9..592eb38a5b 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData3.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 3. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate11`. -/ -def partsGadgetHardCertificate11 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate11 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 3⟩, ⟨9, 2⟩ @@ -230,7 +230,7 @@ def partsGadgetHardCertificate11 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate12`. -/ -def partsGadgetHardCertificate12 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate12 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 0⟩, ⟨1, 3⟩, ⟨9, 3⟩ @@ -246,7 +246,7 @@ def partsGadgetHardCertificate12 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate13`. -/ -def partsGadgetHardCertificate13 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate13 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 1⟩ @@ -264,7 +264,7 @@ def partsGadgetHardCertificate13 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate14`. -/ -def partsGadgetHardCertificate14 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate14 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 2⟩, ⟨16, 3⟩ @@ -278,7 +278,7 @@ def partsGadgetHardCertificate14 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate15`. -/ -def partsGadgetHardCertificate15 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate15 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 0⟩, ⟨17, 3⟩ @@ -295,7 +295,7 @@ def partsGadgetHardCertificate15 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate16`. -/ -def partsGadgetHardCertificate16 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate16 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 1⟩ @@ -311,7 +311,7 @@ def partsGadgetHardCertificate16 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate17`. -/ -def partsGadgetHardCertificate17 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate17 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 2⟩, ⟨12, 3⟩, ⟨7, 2⟩ @@ -325,7 +325,7 @@ def partsGadgetHardCertificate17 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate18`. -/ -def partsGadgetHardCertificate18 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate18 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 1⟩, ⟨1, 1⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData4.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData4.lean index bdf472375b..b076d62342 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData4.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData4.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 4. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate19`. -/ -def partsGadgetHardCertificate19 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate19 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 1⟩, ⟨1, 2⟩ @@ -231,7 +231,7 @@ def partsGadgetHardCertificate19 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate20`. -/ -def partsGadgetHardCertificate20 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate20 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 1⟩, ⟨1, 3⟩ @@ -248,7 +248,7 @@ def partsGadgetHardCertificate20 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate21`. -/ -def partsGadgetHardCertificate21 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate21 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 1⟩ @@ -266,7 +266,7 @@ def partsGadgetHardCertificate21 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate22`. -/ -def partsGadgetHardCertificate22 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate22 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 1⟩ @@ -476,7 +476,7 @@ def partsGadgetHardCertificate22 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate23`. -/ -def partsGadgetHardCertificate23 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate23 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 1⟩, ⟨8, 1⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData5.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData5.lean index 3812f30ca3..6d76df341f 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData5.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData5.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 5. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate24`. -/ -def partsGadgetHardCertificate24 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate24 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 1⟩, ⟨8, 2⟩ @@ -230,7 +230,7 @@ def partsGadgetHardCertificate24 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate25`. -/ -def partsGadgetHardCertificate25 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate25 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 1⟩, ⟨8, 3⟩ @@ -440,7 +440,7 @@ def partsGadgetHardCertificate25 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate26`. -/ -def partsGadgetHardCertificate26 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate26 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 2⟩ @@ -457,7 +457,7 @@ def partsGadgetHardCertificate26 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate27`. -/ -def partsGadgetHardCertificate27 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate27 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 3⟩, ⟨8, 1⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData6.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData6.lean index 5d840f571e..fae742e2e0 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData6.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardCasesData6.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated hard-case certificates, data group 6. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Independently checked hard-case certificate `partsGadgetHardCertificate28`. -/ -def partsGadgetHardCertificate28 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate28 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 3⟩, ⟨8, 2⟩ @@ -230,7 +230,7 @@ def partsGadgetHardCertificate28 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate29`. -/ -def partsGadgetHardCertificate29 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate29 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 0⟩, ⟨1, 2⟩, ⟨4, 3⟩, ⟨8, 3⟩ @@ -440,7 +440,7 @@ def partsGadgetHardCertificate29 : PartsGadgetCertificate := { } /-- Independently checked hard-case certificate `partsGadgetHardCertificate30`. -/ -def partsGadgetHardCertificate30 : PartsGadgetCertificate := { +@[expose] def partsGadgetHardCertificate30 : PartsGadgetCertificate := { roots := [ ⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 0⟩, ⟨25, 1⟩, ⟨19, 3⟩, ⟨12, 2⟩, ⟨6, 3⟩, ⟨7, 1⟩ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification.lean index 137ed2bd67..6c749e1f92 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Aggregated kernel and routing checks for the hard normalized cases. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification0.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification0.lean index 979f42dc21..aeb8f7986c 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification0.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 0. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification1.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification1.lean index b972693528..ec96fe8d0e 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification1.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 1. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification2.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification2.lean index 84cea6fc61..1938baebb5 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification2.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 2. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification3.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification3.lean index 3daee93a70..bf9a20893b 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification3.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 3. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification4.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification4.lean index ac28cbc09a..54ac98fdb1 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification4.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification4.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 4. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification5.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification5.lean index 29199c8bfe..3758e41f13 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification5.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification5.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 5. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification6.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification6.lean index 9f91ad7bfd..44e30d5ddc 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification6.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification6.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 6. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification7.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification7.lean index aee96128fa..20212c1499 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification7.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetHardVerification7.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel checks for hard-case certificate group 7. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData.lean index cce54ad38a..174cca7a6f 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData.lean @@ -14,12 +14,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Aggregation of the generated `Middle` certificate. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- The checked `Middle` contradiction tree. -/ -def partsGadgetMiddleCertificate : PartsGadgetCertificate := { +@[expose] def partsGadgetMiddleCertificate : PartsGadgetCertificate := { roots := [⟨5, 0⟩, ⟨31, 3⟩, ⟨18, 1⟩] nodeCount := 17 nodes := #[ diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData0.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData0.lean index 95474c9fd4..f20b926d4a 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetMiddleData0.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated `Middle` certificate chunks 0 through 0. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- `Middle` certificate chunk 0. -/ -def partsGadgetMiddleChunk0 : Array PartsGadgetTreeNode := #[ +@[expose] def partsGadgetMiddleChunk0 : Array PartsGadgetTreeNode := #[ ⟨[], 11, ![0, 0, 2, 11]⟩, ⟨[], 12, ![3, 0, 0, 8]⟩, ⟨[⟨17, 3⟩, ⟨10, 1⟩, ⟨6, 3⟩], 19, ![0, 0, 4, 5]⟩, diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry.lean index 0ed333f753..ac6bea9203 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Aggregated central-inversion facts for the finite gadget. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry0.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry0.lean index a0ba8574ed..49a1d944c9 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry0.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated central-inversion checks, group 0. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry1.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry1.lean index 823660836a..0f068f9586 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry1.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated central-inversion checks, group 1. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry2.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry2.lean index c3a4968128..1810ce5229 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry2.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated central-inversion checks, group 2. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry3.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry3.lean index b593b1ed56..439742dc00 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetSymmetry3.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Generated central-inversion checks, group 3. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGadgetVerification.lean b/LeanPool/HadwigerNelsonBounds/PartsGadgetVerification.lean index d5c48833f5..954174417d 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGadgetVerification.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGadgetVerification.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD /-! Kernel verification of the two normalized second-stage coloring trees. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsGeometry.lean b/LeanPool/HadwigerNelsonBounds/PartsGeometry.lean index ec283879ad..6d4f40d848 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsGeometry.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsGeometry.lean @@ -18,7 +18,7 @@ The equivalent coordinates below use only `sqrt 33` and `sqrt 3`; this makes the unit-distance check an integer calculation. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -37,18 +37,18 @@ deriving DecidableEq namespace PartsPoint /-- Difference of two exact Parts coordinates. -/ -def sub (p q : PartsPoint) : PartsPoint := +@[expose] def sub (p q : PartsPoint) : PartsPoint := ⟨p.a - q.a, p.b - q.b, p.c - q.c, p.d - q.d⟩ /-- Rational coefficient of 144 times the squared norm. -/ -def normNumerator (p : PartsPoint) : Int := +@[expose] def normNumerator (p : PartsPoint) : Int := p.a ^ 2 + 33 * p.b ^ 2 + 3 * p.c ^ 2 + 11 * p.d ^ 2 /-- Coefficient of `2 * sqrt 33` in 144 times the squared norm. -/ -def radicalCoefficient (p : PartsPoint) : Int := p.a * p.b + p.c * p.d +@[expose] def radicalCoefficient (p : PartsPoint) : Int := p.a * p.b + p.c * p.d /-- Exact decidable test that an integer coordinate vector has length one. -/ -def IsUnit (p : PartsPoint) : Bool := +@[expose] def IsUnit (p : PartsPoint) : Bool := decide (p.normNumerator = 144 ∧ p.radicalCoefficient = 0) lemma isUnit_iff (p : PartsPoint) : @@ -56,7 +56,7 @@ lemma isUnit_iff (p : PartsPoint) : simp [IsUnit] /-- Embed exact certificate coordinates in the Euclidean plane. -/ -noncomputable def toR2 (p : PartsPoint) : R2 := +@[expose] noncomputable def toR2 (p : PartsPoint) : R2 := WithLp.toLp 2 ![((p.a : ℝ) + (p.b : ℝ) * Real.sqrt 33) / 12, (3 * (p.c : ℝ) + (p.d : ℝ) * Real.sqrt 33) / (12 * Real.sqrt 3)] diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutationData0.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutationData0.lean index d073db6739..c06eaa8ea9 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutationData0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutationData0.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Exact vertex permutation 0 for the Parts root stabilizer. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Permutation 0, lookup chunk 0. -/ -def partsVertexPermutation0Chunk0 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk0 (index : Nat) : Fin 481 := match index with | 0 => 0 | 1 => 1 @@ -89,7 +89,7 @@ def partsVertexPermutation0Chunk0 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 1. -/ -def partsVertexPermutation0Chunk1 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk1 (index : Nat) : Fin 481 := match index with | 0 => 64 | 1 => 65 @@ -158,7 +158,7 @@ def partsVertexPermutation0Chunk1 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 2. -/ -def partsVertexPermutation0Chunk2 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk2 (index : Nat) : Fin 481 := match index with | 0 => 128 | 1 => 129 @@ -227,7 +227,7 @@ def partsVertexPermutation0Chunk2 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 3. -/ -def partsVertexPermutation0Chunk3 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk3 (index : Nat) : Fin 481 := match index with | 0 => 192 | 1 => 193 @@ -296,7 +296,7 @@ def partsVertexPermutation0Chunk3 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 4. -/ -def partsVertexPermutation0Chunk4 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk4 (index : Nat) : Fin 481 := match index with | 0 => 256 | 1 => 257 @@ -365,7 +365,7 @@ def partsVertexPermutation0Chunk4 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 5. -/ -def partsVertexPermutation0Chunk5 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk5 (index : Nat) : Fin 481 := match index with | 0 => 320 | 1 => 321 @@ -434,7 +434,7 @@ def partsVertexPermutation0Chunk5 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 6. -/ -def partsVertexPermutation0Chunk6 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk6 (index : Nat) : Fin 481 := match index with | 0 => 384 | 1 => 385 @@ -503,7 +503,7 @@ def partsVertexPermutation0Chunk6 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 0, lookup chunk 7. -/ -def partsVertexPermutation0Chunk7 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation0Chunk7 (index : Nat) : Fin 481 := match index with | 0 => 448 | 1 => 449 @@ -541,7 +541,7 @@ def partsVertexPermutation0Chunk7 (index : Nat) : Fin 481 := | _ => 0 /-- Exact base-graph automorphism 0. -/ -def partsVertexPermutation0 (vertex : Fin 481) : Fin 481 := +@[expose] def partsVertexPermutation0 (vertex : Fin 481) : Fin 481 := match vertex.val / 64 with | 0 => partsVertexPermutation0Chunk0 (vertex.val % 64) | 1 => partsVertexPermutation0Chunk1 (vertex.val % 64) diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutationData1.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutationData1.lean index 4cb9e93a80..7f082037bc 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutationData1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutationData1.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Exact vertex permutation 1 for the Parts root stabilizer. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Permutation 1, lookup chunk 0. -/ -def partsVertexPermutation1Chunk0 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk0 (index : Nat) : Fin 481 := match index with | 0 => 0 | 1 => 9 @@ -89,7 +89,7 @@ def partsVertexPermutation1Chunk0 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 1. -/ -def partsVertexPermutation1Chunk1 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk1 (index : Nat) : Fin 481 := match index with | 0 => 58 | 1 => 59 @@ -158,7 +158,7 @@ def partsVertexPermutation1Chunk1 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 2. -/ -def partsVertexPermutation1Chunk2 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk2 (index : Nat) : Fin 481 := match index with | 0 => 120 | 1 => 121 @@ -227,7 +227,7 @@ def partsVertexPermutation1Chunk2 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 3. -/ -def partsVertexPermutation1Chunk3 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk3 (index : Nat) : Fin 481 := match index with | 0 => 188 | 1 => 213 @@ -296,7 +296,7 @@ def partsVertexPermutation1Chunk3 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 4. -/ -def partsVertexPermutation1Chunk4 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk4 (index : Nat) : Fin 481 := match index with | 0 => 250 | 1 => 251 @@ -365,7 +365,7 @@ def partsVertexPermutation1Chunk4 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 5. -/ -def partsVertexPermutation1Chunk5 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk5 (index : Nat) : Fin 481 := match index with | 0 => 336 | 1 => 313 @@ -434,7 +434,7 @@ def partsVertexPermutation1Chunk5 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 6. -/ -def partsVertexPermutation1Chunk6 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk6 (index : Nat) : Fin 481 := match index with | 0 => 380 | 1 => 381 @@ -503,7 +503,7 @@ def partsVertexPermutation1Chunk6 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 1, lookup chunk 7. -/ -def partsVertexPermutation1Chunk7 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation1Chunk7 (index : Nat) : Fin 481 := match index with | 0 => 464 | 1 => 465 @@ -541,7 +541,7 @@ def partsVertexPermutation1Chunk7 (index : Nat) : Fin 481 := | _ => 0 /-- Exact base-graph automorphism 1. -/ -def partsVertexPermutation1 (vertex : Fin 481) : Fin 481 := +@[expose] def partsVertexPermutation1 (vertex : Fin 481) : Fin 481 := match vertex.val / 64 with | 0 => partsVertexPermutation1Chunk0 (vertex.val % 64) | 1 => partsVertexPermutation1Chunk1 (vertex.val % 64) diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutationData2.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutationData2.lean index f105703296..97137c92e9 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutationData2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutationData2.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Exact vertex permutation 2 for the Parts root stabilizer. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Permutation 2, lookup chunk 0. -/ -def partsVertexPermutation2Chunk0 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk0 (index : Nat) : Fin 481 := match index with | 0 => 0 | 1 => 5 @@ -89,7 +89,7 @@ def partsVertexPermutation2Chunk0 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 1. -/ -def partsVertexPermutation2Chunk1 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk1 (index : Nat) : Fin 481 := match index with | 0 => 52 | 1 => 53 @@ -158,7 +158,7 @@ def partsVertexPermutation2Chunk1 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 2. -/ -def partsVertexPermutation2Chunk2 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk2 (index : Nat) : Fin 481 := match index with | 0 => 112 | 1 => 113 @@ -227,7 +227,7 @@ def partsVertexPermutation2Chunk2 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 3. -/ -def partsVertexPermutation2Chunk3 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk3 (index : Nat) : Fin 481 := match index with | 0 => 184 | 1 => 203 @@ -296,7 +296,7 @@ def partsVertexPermutation2Chunk3 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 4. -/ -def partsVertexPermutation2Chunk4 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk4 (index : Nat) : Fin 481 := match index with | 0 => 262 | 1 => 263 @@ -365,7 +365,7 @@ def partsVertexPermutation2Chunk4 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 5. -/ -def partsVertexPermutation2Chunk5 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk5 (index : Nat) : Fin 481 := match index with | 0 => 328 | 1 => 329 @@ -434,7 +434,7 @@ def partsVertexPermutation2Chunk5 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 6. -/ -def partsVertexPermutation2Chunk6 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk6 (index : Nat) : Fin 481 := match index with | 0 => 388 | 1 => 389 @@ -503,7 +503,7 @@ def partsVertexPermutation2Chunk6 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 2, lookup chunk 7. -/ -def partsVertexPermutation2Chunk7 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation2Chunk7 (index : Nat) : Fin 481 := match index with | 0 => 456 | 1 => 457 @@ -541,7 +541,7 @@ def partsVertexPermutation2Chunk7 (index : Nat) : Fin 481 := | _ => 0 /-- Exact base-graph automorphism 2. -/ -def partsVertexPermutation2 (vertex : Fin 481) : Fin 481 := +@[expose] def partsVertexPermutation2 (vertex : Fin 481) : Fin 481 := match vertex.val / 64 with | 0 => partsVertexPermutation2Chunk0 (vertex.val % 64) | 1 => partsVertexPermutation2Chunk1 (vertex.val % 64) diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutationData3.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutationData3.lean index 34f1db7046..13ffd6d7a3 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutationData3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutationData3.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Exact vertex permutation 3 for the Parts root stabilizer. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Permutation 3, lookup chunk 0. -/ -def partsVertexPermutation3Chunk0 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk0 (index : Nat) : Fin 481 := match index with | 0 => 0 | 1 => 242 @@ -89,7 +89,7 @@ def partsVertexPermutation3Chunk0 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 1. -/ -def partsVertexPermutation3Chunk1 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk1 (index : Nat) : Fin 481 := match index with | 0 => 346 | 1 => 338 @@ -158,7 +158,7 @@ def partsVertexPermutation3Chunk1 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 2. -/ -def partsVertexPermutation3Chunk2 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk2 (index : Nat) : Fin 481 := match index with | 0 => 368 | 1 => 373 @@ -227,7 +227,7 @@ def partsVertexPermutation3Chunk2 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 3. -/ -def partsVertexPermutation3Chunk3 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk3 (index : Nat) : Fin 481 := match index with | 0 => 47 | 1 => 213 @@ -296,7 +296,7 @@ def partsVertexPermutation3Chunk3 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 4. -/ -def partsVertexPermutation3Chunk4 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk4 (index : Nat) : Fin 481 := match index with | 0 => 247 | 1 => 257 @@ -365,7 +365,7 @@ def partsVertexPermutation3Chunk4 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 5. -/ -def partsVertexPermutation3Chunk5 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk5 (index : Nat) : Fin 481 := match index with | 0 => 148 | 1 => 149 @@ -434,7 +434,7 @@ def partsVertexPermutation3Chunk5 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 6. -/ -def partsVertexPermutation3Chunk6 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk6 (index : Nat) : Fin 481 := match index with | 0 => 89 | 1 => 92 @@ -503,7 +503,7 @@ def partsVertexPermutation3Chunk6 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 3, lookup chunk 7. -/ -def partsVertexPermutation3Chunk7 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation3Chunk7 (index : Nat) : Fin 481 := match index with | 0 => 30 | 1 => 35 @@ -541,7 +541,7 @@ def partsVertexPermutation3Chunk7 (index : Nat) : Fin 481 := | _ => 0 /-- Exact base-graph automorphism 3. -/ -def partsVertexPermutation3 (vertex : Fin 481) : Fin 481 := +@[expose] def partsVertexPermutation3 (vertex : Fin 481) : Fin 481 := match vertex.val / 64 with | 0 => partsVertexPermutation3Chunk0 (vertex.val % 64) | 1 => partsVertexPermutation3Chunk1 (vertex.val % 64) diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutationData4.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutationData4.lean index 88eed46c34..3bc7a10e1b 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutationData4.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutationData4.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Exact vertex permutation 4 for the Parts root stabilizer. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Permutation 4, lookup chunk 0. -/ -def partsVertexPermutation4Chunk0 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk0 (index : Nat) : Fin 481 := match index with | 0 => 0 | 1 => 246 @@ -89,7 +89,7 @@ def partsVertexPermutation4Chunk0 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 1. -/ -def partsVertexPermutation4Chunk1 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk1 (index : Nat) : Fin 481 := match index with | 0 => 352 | 1 => 344 @@ -158,7 +158,7 @@ def partsVertexPermutation4Chunk1 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 2. -/ -def partsVertexPermutation4Chunk2 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk2 (index : Nat) : Fin 481 := match index with | 0 => 376 | 1 => 357 @@ -227,7 +227,7 @@ def partsVertexPermutation4Chunk2 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 3. -/ -def partsVertexPermutation4Chunk3 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk3 (index : Nat) : Fin 481 := match index with | 0 => 39 | 1 => 193 @@ -296,7 +296,7 @@ def partsVertexPermutation4Chunk3 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 4. -/ -def partsVertexPermutation4Chunk4 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk4 (index : Nat) : Fin 481 := match index with | 0 => 253 | 1 => 263 @@ -365,7 +365,7 @@ def partsVertexPermutation4Chunk4 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 5. -/ -def partsVertexPermutation4Chunk5 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk5 (index : Nat) : Fin 481 := match index with | 0 => 156 | 1 => 133 @@ -434,7 +434,7 @@ def partsVertexPermutation4Chunk5 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 6. -/ -def partsVertexPermutation4Chunk6 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk6 (index : Nat) : Fin 481 := match index with | 0 => 93 | 1 => 96 @@ -503,7 +503,7 @@ def partsVertexPermutation4Chunk6 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 4, lookup chunk 7. -/ -def partsVertexPermutation4Chunk7 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation4Chunk7 (index : Nat) : Fin 481 := match index with | 0 => 14 | 1 => 19 @@ -541,7 +541,7 @@ def partsVertexPermutation4Chunk7 (index : Nat) : Fin 481 := | _ => 0 /-- Exact base-graph automorphism 4. -/ -def partsVertexPermutation4 (vertex : Fin 481) : Fin 481 := +@[expose] def partsVertexPermutation4 (vertex : Fin 481) : Fin 481 := match vertex.val / 64 with | 0 => partsVertexPermutation4Chunk0 (vertex.val % 64) | 1 => partsVertexPermutation4Chunk1 (vertex.val % 64) diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutationData5.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutationData5.lean index 81ae75b87b..d4a51bf6d5 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutationData5.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutationData5.lean @@ -15,12 +15,12 @@ import Mathlib.Tactic.NormNum.GCD /-! Exact vertex permutation 5 for the Parts root stabilizer. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Permutation 5, lookup chunk 0. -/ -def partsVertexPermutation5Chunk0 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk0 (index : Nat) : Fin 481 := match index with | 0 => 0 | 1 => 238 @@ -89,7 +89,7 @@ def partsVertexPermutation5Chunk0 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 1. -/ -def partsVertexPermutation5Chunk1 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk1 (index : Nat) : Fin 481 := match index with | 0 => 340 | 1 => 350 @@ -158,7 +158,7 @@ def partsVertexPermutation5Chunk1 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 2. -/ -def partsVertexPermutation5Chunk2 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk2 (index : Nat) : Fin 481 := match index with | 0 => 360 | 1 => 365 @@ -227,7 +227,7 @@ def partsVertexPermutation5Chunk2 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 3. -/ -def partsVertexPermutation5Chunk3 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk3 (index : Nat) : Fin 481 := match index with | 0 => 43 | 1 => 203 @@ -296,7 +296,7 @@ def partsVertexPermutation5Chunk3 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 4. -/ -def partsVertexPermutation5Chunk4 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk4 (index : Nat) : Fin 481 := match index with | 0 => 259 | 1 => 251 @@ -365,7 +365,7 @@ def partsVertexPermutation5Chunk4 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 5. -/ -def partsVertexPermutation5Chunk5 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk5 (index : Nat) : Fin 481 := match index with | 0 => 140 | 1 => 141 @@ -434,7 +434,7 @@ def partsVertexPermutation5Chunk5 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 6. -/ -def partsVertexPermutation5Chunk6 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk6 (index : Nat) : Fin 481 := match index with | 0 => 85 | 1 => 88 @@ -503,7 +503,7 @@ def partsVertexPermutation5Chunk6 (index : Nat) : Fin 481 := | _ => 0 /-- Permutation 5, lookup chunk 7. -/ -def partsVertexPermutation5Chunk7 (index : Nat) : Fin 481 := +@[expose] def partsVertexPermutation5Chunk7 (index : Nat) : Fin 481 := match index with | 0 => 22 | 1 => 27 @@ -541,7 +541,7 @@ def partsVertexPermutation5Chunk7 (index : Nat) : Fin 481 := | _ => 0 /-- Exact base-graph automorphism 5. -/ -def partsVertexPermutation5 (vertex : Fin 481) : Fin 481 := +@[expose] def partsVertexPermutation5 (vertex : Fin 481) : Fin 481 := match vertex.val / 64 with | 0 => partsVertexPermutation5Chunk0 (vertex.val % 64) | 1 => partsVertexPermutation5Chunk1 (vertex.val % 64) diff --git a/LeanPool/HadwigerNelsonBounds/PartsPermutations.lean b/LeanPool/HadwigerNelsonBounds/PartsPermutations.lean index 8c7a72e347..87e2f34aa2 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPermutations.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPermutations.lean @@ -19,12 +19,12 @@ import Mathlib.Tactic.NormNum.GCD /-! The six exact automorphisms of the normalized Parts root. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds /-- Apply one of the six stored automorphisms of the exact base graph. -/ -def partsPermuteVertex (symmetry : Fin 6) (vertex : Fin 481) : Fin 481 := +@[expose] def partsPermuteVertex (symmetry : Fin 6) (vertex : Fin 481) : Fin 481 := match symmetry.val with | 0 => partsVertexPermutation0 vertex | 1 => partsVertexPermutation1 vertex diff --git a/LeanPool/HadwigerNelsonBounds/PartsPlaneGeometry.lean b/LeanPool/HadwigerNelsonBounds/PartsPlaneGeometry.lean index abdb8cfcd1..883addff17 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsPlaneGeometry.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsPlaneGeometry.lean @@ -15,7 +15,7 @@ distance-preserving rotations. The two exact cosines are the angles used in Parts' doubled wheel and spindle. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -181,7 +181,7 @@ lemma partsPatchRotation_displacement_sq (p : R2) : planeRotation_zero _ _ /-- Apply the doubled-wheel rotation exactly when selecting its second patch. -/ -noncomputable def partsApplyPatch (rotated : Bool) (p : R2) : R2 := +@[expose] noncomputable def partsApplyPatch (rotated : Bool) (p : R2) : R2 := if rotated then partsPatchRotation p else p lemma partsApplyPatch_dist_eq (rotated : Bool) (p q : R2) : diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecision.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecision.lean index 565222db03..1c7db9fe92 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecision.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecision.lean @@ -17,7 +17,7 @@ The 1,023-node trie has 432 leaves, one for each proper normalized coloring of the 13-vertex 2-Golomb root. Every leaf names a separately checked Parts tree. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionCore.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionCore.lean index 8ce236fb8b..e7bf239dcd 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionCore.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionCore.lean @@ -15,7 +15,7 @@ root. Its leaves point to the appropriate one of the 432 checked symmetry and color variants from `PartsFirstStage`. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -115,7 +115,7 @@ lemma partsRootVerifiesNodeB_unsat {nodes : Array (Array PartsRootNode)} · exact hextends assignment hin /-- The four fixed assignments after color normalization. -/ -def partsNormalizedRootPath : List PartsAssignment := +@[expose] def partsNormalizedRootPath : List PartsAssignment := [⟨0, 3⟩, ⟨195, 0⟩, ⟨205, 0⟩, ⟨215, 0⟩] /-- A checked root trie eliminates every proper coloring extending the fixed root. -/ diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData0.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData0.lean index b20113ba37..42ba595fa6 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData0.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData0.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 0 through 3. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean index e67bf1ab3a..ce7d3556d9 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData1.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 4 through 7. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean index ea129d3eb8..0502fa04e1 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData2.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 8 through 11. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean index 4bc6dd050f..c0a5095430 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsRootDecisionData3.lean @@ -9,7 +9,7 @@ public import LeanPool.HadwigerNelsonBounds.PartsRootDecisionCore /-! Generated root-decision chunks 12 through 15. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/PartsSpindle.lean b/LeanPool/HadwigerNelsonBounds/PartsSpindle.lean index ed43d9692f..e9cc1408bf 100644 --- a/LeanPool/HadwigerNelsonBounds/PartsSpindle.lean +++ b/LeanPool/HadwigerNelsonBounds/PartsSpindle.lean @@ -17,7 +17,7 @@ second copy through cosine `31/32` makes the remaining endpoints unit-adjacent, contradicting a proper four-coloring. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HadwigerNelsonBounds/Voronoi.lean b/LeanPool/HadwigerNelsonBounds/Voronoi.lean index e46fbe321c..43bf032aae 100644 --- a/LeanPool/HadwigerNelsonBounds/Voronoi.lean +++ b/LeanPool/HadwigerNelsonBounds/Voronoi.lean @@ -15,7 +15,7 @@ This module converts the unit-square quadratic estimate into a covering-radius theorem for the triangular lattice and defines the chosen nearest lattice cell. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds @@ -151,13 +151,13 @@ lemma nearestLatticeIdx_spec (p : R2) : (exists_lattice_point_within_circumradius p).choose_spec /-- Cast an integer residue modulo seven to the corresponding finite color. -/ -noncomputable def toFin7 (n : ℤ) : Fin 7 := +@[expose] noncomputable def toFin7 (n : ℤ) : Fin 7 := (ZMod.finEquiv 7).symm (n : ZMod 7) /-- The Isbell 7-coloring assigns to each point `p ∈ R²` the color `(i + 3·j) mod 7`, where `(i, j) = nearestLatticeIdx p` are the integer coordinates of a nearest lattice point. -/ -noncomputable def isbellColor : R2 → Fin 7 := +@[expose] noncomputable def isbellColor : R2 → Fin 7 := fun p => toFin7 ((nearestLatticeIdx p).1 + 3 * (nearestLatticeIdx p).2) /-! ### The remaining geometric fact -/ diff --git a/LeanPool/HadwigerNelsonBounds/VoronoiQuadratic.lean b/LeanPool/HadwigerNelsonBounds/VoronoiQuadratic.lean index f919d72be9..b74cf486f5 100644 --- a/LeanPool/HadwigerNelsonBounds/VoronoiQuadratic.lean +++ b/LeanPool/HadwigerNelsonBounds/VoronoiQuadratic.lean @@ -15,7 +15,7 @@ This module proves that one of the four corners of a lattice-coordinate unit square lies within the required quadratic-form radius. -/ -@[expose] public section +public section namespace HadwigerNelsonBounds diff --git a/LeanPool/HansonWright.lean b/LeanPool/HansonWright.lean index 43dbff4b08..cf600b4dc9 100644 --- a/LeanPool/HansonWright.lean +++ b/LeanPool/HansonWright.lean @@ -18,4 +18,4 @@ Tags: probability-theory, concentration-inequalities, high-dimensional-probabili MSC: 60E15, 60B20, 62H12 -/ -@[expose] public section +public section diff --git a/LeanPool/HansonWright/MeasureTheory/Integral/LayerCake.lean b/LeanPool/HansonWright/MeasureTheory/Integral/LayerCake.lean index 8eff7bb904..04e14fd12f 100644 --- a/LeanPool/HansonWright/MeasureTheory/Integral/LayerCake.lean +++ b/LeanPool/HansonWright/MeasureTheory/Integral/LayerCake.lean @@ -22,7 +22,7 @@ This module introduces no new definitions. * `lintegral_eq_lintegral_tail`: a nonnegative function is the integral of its upper tails. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HansonWright/Probability/Concentration/Bernstein.lean b/LeanPool/HansonWright/Probability/Concentration/Bernstein.lean index f0cc257315..74927cca6a 100644 --- a/LeanPool/HansonWright/Probability/Concentration/Bernstein.lean +++ b/LeanPool/HansonWright/Probability/Concentration/Bernstein.lean @@ -34,7 +34,7 @@ real random variables. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HansonWright/Probability/Concentration/Chernoff.lean b/LeanPool/HansonWright/Probability/Concentration/Chernoff.lean index 7112e0c85b..2c6f64b942 100644 --- a/LeanPool/HansonWright/Probability/Concentration/Chernoff.lean +++ b/LeanPool/HansonWright/Probability/Concentration/Chernoff.lean @@ -22,7 +22,7 @@ This module introduces no new definitions. * `chernoff_bound_subGaussian`: the optimized sub-Gaussian specialization. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean b/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean index d21d6e4790..018bba9eb2 100644 --- a/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean +++ b/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean @@ -49,7 +49,7 @@ two-scale Chernoff bound. using the maximum coordinate least global-MGF sub-Gaussian scale. -/ -@[expose] public section +public section namespace LeanPool @@ -154,6 +154,7 @@ def randomQuadraticForm {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) fun ω => quadraticForm A fun i => X i ω /-- The coordinate random vector as an element of Euclidean space. -/ +@[expose] def randomVector {n : ℕ} (X : Fin n → Ω → ℝ) : Ω → EuclideanSpace ℝ (Fin n) := fun ω => WithLp.toLp 2 fun i => X i ω @@ -225,6 +226,7 @@ def cutMatrix {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (s : Finset (Fin n)) : fun i j => if i ∈ s ∧ j ∉ s then A i j else 0 /-- Coordinate projection onto a finite set of coordinates. -/ +@[expose] def coordinateMask {n : ℕ} (s : Finset (Fin n)) (x : EuclideanSpace ℝ (Fin n)) : EuclideanSpace ℝ (Fin n) := WithLp.toLp 2 fun i => if i ∈ s then x i else 0 @@ -236,6 +238,7 @@ lemma coordinateMask_apply {n : ℕ} (s : Finset (Fin n)) /-- Embed a tuple indexed by a finite set into Euclidean space, filling other coordinates by zero. -/ +@[expose] def subtypeMask {n : ℕ} (s : Finset (Fin n)) (x : s → ℝ) : EuclideanSpace ℝ (Fin n) := WithLp.toLp 2 fun i => if h : i ∈ s then x ⟨i, h⟩ else 0 diff --git a/LeanPool/HansonWright/Probability/Moments/Cumulant.lean b/LeanPool/HansonWright/Probability/Moments/Cumulant.lean index 9d1d4d0e9a..04f69c9065 100644 --- a/LeanPool/HansonWright/Probability/Moments/Cumulant.lean +++ b/LeanPool/HansonWright/Probability/Moments/Cumulant.lean @@ -32,7 +32,7 @@ This module extends Mathlib's existing moment-generating and tilted-measure defi * `ProbabilityTheory.cgf_deriv_two`: second derivative of the cumulant generating function. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HansonWright/Probability/Moments/Exponential.lean b/LeanPool/HansonWright/Probability/Moments/Exponential.lean index 0333f7d123..e8e3eb94ce 100644 --- a/LeanPool/HansonWright/Probability/Moments/Exponential.lean +++ b/LeanPool/HansonWright/Probability/Moments/Exponential.lean @@ -27,7 +27,7 @@ This module introduces no new definitions. summands without requiring independence. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HansonWright/Probability/Process/FiniteMaximum.lean b/LeanPool/HansonWright/Probability/Process/FiniteMaximum.lean index 8b2084b1c1..2afa27fa93 100644 --- a/LeanPool/HansonWright/Probability/Process/FiniteMaximum.lean +++ b/LeanPool/HansonWright/Probability/Process/FiniteMaximum.lean @@ -24,7 +24,7 @@ This module introduces no new definitions. * `expected_max_subGaussian`: expected maximum of a finite sub-Gaussian family. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HansonWright/Probability/Process/SubGaussian.lean b/LeanPool/HansonWright/Probability/Process/SubGaussian.lean index f52a54bf05..257c1d219a 100644 --- a/LeanPool/HansonWright/Probability/Process/SubGaussian.lean +++ b/LeanPool/HansonWright/Probability/Process/SubGaussian.lean @@ -44,7 +44,7 @@ entropy integral bound. -/ -@[expose] public section +public section namespace LeanPool diff --git a/LeanPool/HardSphereNBC.lean b/LeanPool/HardSphereNBC.lean index 1435f0cf96..35237cbabf 100644 --- a/LeanPool/HardSphereNBC.lean +++ b/LeanPool/HardSphereNBC.lean @@ -35,4 +35,4 @@ Tags: mathematical-physics MSC: 05C15, 82B05 -/ -@[expose] public section +public section diff --git a/LeanPool/HardSphereNBC/GraphicMatroid.lean b/LeanPool/HardSphereNBC/GraphicMatroid.lean index b7d588aed0..9fb94a16f3 100644 --- a/LeanPool/HardSphereNBC/GraphicMatroid.lean +++ b/LeanPool/HardSphereNBC/GraphicMatroid.lean @@ -18,7 +18,7 @@ public import Mathlib.Combinatorics.SimpleGraph.Finite Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereClosePair.lean b/LeanPool/HardSphereNBC/HardSphereClosePair.lean index 07e8d83a02..bbdef9d8dc 100644 --- a/LeanPool/HardSphereNBC/HardSphereClosePair.lean +++ b/LeanPool/HardSphereNBC/HardSphereClosePair.lean @@ -18,7 +18,7 @@ public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereCompound.lean b/LeanPool/HardSphereNBC/HardSphereCompound.lean index 93b68917ef..0febb001d2 100644 --- a/LeanPool/HardSphereNBC/HardSphereCompound.lean +++ b/LeanPool/HardSphereNBC/HardSphereCompound.lean @@ -14,7 +14,7 @@ public import LeanPool.HardSphereNBC.HardSphereTreeEdges Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereFork.lean b/LeanPool/HardSphereNBC/HardSphereFork.lean index 54b7ff604d..7081458e53 100644 --- a/LeanPool/HardSphereNBC/HardSphereFork.lean +++ b/LeanPool/HardSphereNBC/HardSphereFork.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls /-! ### Concrete tree and fork regions -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereForkPackingCoordinates.lean b/LeanPool/HardSphereNBC/HardSphereForkPackingCoordinates.lean index dfb29f04e4..ae681cc722 100644 --- a/LeanPool/HardSphereNBC/HardSphereForkPackingCoordinates.lean +++ b/LeanPool/HardSphereNBC/HardSphereForkPackingCoordinates.lean @@ -14,7 +14,7 @@ public import LeanPool.HardSphereNBC.HardSphereClosePair Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereGeometry.lean b/LeanPool/HardSphereNBC/HardSphereGeometry.lean index 09a667d533..bdd85a0dc6 100644 --- a/LeanPool/HardSphereNBC/HardSphereGeometry.lean +++ b/LeanPool/HardSphereNBC/HardSphereGeometry.lean @@ -15,7 +15,7 @@ public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereMeasure.lean b/LeanPool/HardSphereNBC/HardSphereMeasure.lean index a49dde52b6..c19a2eccb8 100644 --- a/LeanPool/HardSphereNBC/HardSphereMeasure.lean +++ b/LeanPool/HardSphereNBC/HardSphereMeasure.lean @@ -16,7 +16,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereNBC.lean b/LeanPool/HardSphereNBC/HardSphereNBC.lean index 3fc10210c2..906966080e 100644 --- a/LeanPool/HardSphereNBC/HardSphereNBC.lean +++ b/LeanPool/HardSphereNBC/HardSphereNBC.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace /-! ### The canonical particle and edge conventions -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereTree.lean b/LeanPool/HardSphereNBC/HardSphereTree.lean index e59bd70266..f5431efb9a 100644 --- a/LeanPool/HardSphereNBC/HardSphereTree.lean +++ b/LeanPool/HardSphereNBC/HardSphereTree.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic /-! ### Elementary tree-coordinate shears -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereTreeDifference.lean b/LeanPool/HardSphereNBC/HardSphereTreeDifference.lean index 1320acbf3f..2f61a34d78 100644 --- a/LeanPool/HardSphereNBC/HardSphereTreeDifference.lean +++ b/LeanPool/HardSphereNBC/HardSphereTreeDifference.lean @@ -12,7 +12,7 @@ public import Mathlib.LinearAlgebra.Matrix.Block /-! ### Triangular difference maps -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/HardSphereTreeEdges.lean b/LeanPool/HardSphereNBC/HardSphereTreeEdges.lean index 3b7adb2b11..b6ca54a621 100644 --- a/LeanPool/HardSphereNBC/HardSphereTreeEdges.lean +++ b/LeanPool/HardSphereNBC/HardSphereTreeEdges.lean @@ -14,7 +14,7 @@ public import LeanPool.HardSphereNBC.HardSphereTreeDifference Graph, coordinate, and measure constructions for the hard-sphere NBC volume identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/MayerNBC.lean b/LeanPool/HardSphereNBC/MayerNBC.lean index 5af3bb6fa6..4f9f70ef65 100644 --- a/LeanPool/HardSphereNBC/MayerNBC.lean +++ b/LeanPool/HardSphereNBC/MayerNBC.lean @@ -20,7 +20,7 @@ public import Mathlib.MeasureTheory.Measure.MeasureSpaceDef occur in the finite tree sum. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/NBCGraph.lean b/LeanPool/HardSphereNBC/NBCGraph.lean index 8e1dc5a62c..fb2eb79cc2 100644 --- a/LeanPool/HardSphereNBC/NBCGraph.lean +++ b/LeanPool/HardSphereNBC/NBCGraph.lean @@ -22,7 +22,7 @@ public import Mathlib.Algebra.BigOperators.Group.Finset.Basic presentations. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/NBCMatroid.lean b/LeanPool/HardSphereNBC/NBCMatroid.lean index a79598ca4d..6288a69a4f 100644 --- a/LeanPool/HardSphereNBC/NBCMatroid.lean +++ b/LeanPool/HardSphereNBC/NBCMatroid.lean @@ -19,7 +19,7 @@ public import Mathlib.Data.Finset.Max avoids hiding it behind a library theorem. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/NBCVolume.lean b/LeanPool/HardSphereNBC/NBCVolume.lean index 45984fe499..19839385e0 100644 --- a/LeanPool/HardSphereNBC/NBCVolume.lean +++ b/LeanPool/HardSphereNBC/NBCVolume.lean @@ -23,7 +23,7 @@ public import LeanPool.HardSphereNBC.GraphicMatroid weight sum with Lebesgue integration after this algebraic identity. -/ -@[expose] public section +public section namespace HsVirial diff --git a/LeanPool/HardSphereNBC/Solution.lean b/LeanPool/HardSphereNBC/Solution.lean index 61c11f0ab9..6ae2a55365 100644 --- a/LeanPool/HardSphereNBC/Solution.lean +++ b/LeanPool/HardSphereNBC/Solution.lean @@ -18,7 +18,7 @@ exposes the same declarations as `Challenge.lean` and connects them to the machine-checked flat-coordinate and fork-packing theorems. -/ -@[expose] public section +public section namespace PalomarHS diff --git a/LeanPool/HasseMinkowski.lean b/LeanPool/HasseMinkowski.lean index 0684446702..91b1a75356 100644 --- a/LeanPool/HasseMinkowski.lean +++ b/LeanPool/HasseMinkowski.lean @@ -18,5 +18,5 @@ Tags: number-theory, quadratic-forms, local-global, p-adic MSC: 11E12, 11E08, 11E88 -/ -@[expose] public section +public section diff --git a/LeanPool/HasseMinkowski/Basic.lean b/LeanPool/HasseMinkowski/Basic.lean index ea3e439f0b..92268fb083 100644 --- a/LeanPool/HasseMinkowski/Basic.lean +++ b/LeanPool/HasseMinkowski/Basic.lean @@ -41,7 +41,7 @@ nondegeneracy with orthogonal sums and base change. This file supplies them. * `Indefinite.isotropic`: an indefinite real form is isotropic (intermediate value theorem). -/ -@[expose] public section +public section open Module QuadraticMap @@ -55,7 +55,7 @@ variable {R M N : Type*} [CommSemiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] /-- A quadratic map is *isotropic* if it vanishes on some nonzero vector. -/ -def Isotropic (Q : QuadraticMap R M N) : Prop := ∃ x, x ≠ 0 ∧ Q x = 0 +@[expose] def Isotropic (Q : QuadraticMap R M N) : Prop := ∃ x, x ≠ 0 ∧ Q x = 0 -- Theorem: isotropy is exactly the negation of Mathlib's anisotropy. theorem isotropic_iff_not_anisotropic (Q : QuadraticMap R M N) : @@ -86,7 +86,7 @@ variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] For `a ≠ 0` the restriction to nonzero vectors is immaterial, since `Q 0 = 0`; for `a = 0` it makes the notion agree with isotropy, as in the classical theory. -/ -def represents (Q : QuadraticForm R M) (a : R) : Prop := ∃ x, x ≠ 0 ∧ Q x = a +@[expose] def represents (Q : QuadraticForm R M) (a : R) : Prop := ∃ x, x ≠ 0 ∧ Q x = a -- Theorem: a form represents `0` iff it is isotropic. theorem represents_zero_iff_isotropic (Q : QuadraticForm R M) : diff --git a/LeanPool/HasseMinkowski/HasseInvariant.lean b/LeanPool/HasseMinkowski/HasseInvariant.lean index 1c6b72921c..5332a79b31 100644 --- a/LeanPool/HasseMinkowski/HasseInvariant.lean +++ b/LeanPool/HasseMinkowski/HasseInvariant.lean @@ -54,7 +54,7 @@ with any concrete list of weights. The diagonal-level statements (`hasseMinkows proved here are exactly the part of the development that does not need that machinery. -/ -@[expose] public section +public section namespace HasseMinkowski @@ -70,7 +70,7 @@ noncomputable def hasseMinkowskiInvAux {n : ℕ} (w : Fin n → kˣ) : ℤ := -- Theorem: definitional unfolding of `hasseMinkowskiInvAux`. theorem hasseMinkowskiInvAux_def {n : ℕ} (w : Fin n → kˣ) : hasseMinkowskiInvAux w = - ∏ p : Fin n × Fin n with p.1 < p.2, hilbertSym (w p.1 : k) (w p.2 : k) := rfl + ∏ p : Fin n × Fin n with p.1 < p.2, hilbertSym (w p.1 : k) (w p.2 : k) := by rfl -- Theorem: the invariant of the empty diagonal form (rank `0`) is `1`. theorem hasseMinkowskiInvAux_zero (w : Fin 0 → kˣ) : hasseMinkowskiInvAux w = 1 := by diff --git a/LeanPool/HasseMinkowski/HighRank.lean b/LeanPool/HasseMinkowski/HighRank.lean index 612c7ae698..775a9fbb29 100644 --- a/LeanPool/HasseMinkowski/HighRank.lean +++ b/LeanPool/HasseMinkowski/HighRank.lean @@ -29,7 +29,7 @@ The rank-three criterion of `RankCriteria.lean` together with `hilbertSym_padicI turns the local isotropy into the vanishing of a Hilbert symbol of two `p`-adic units. -/ -@[expose] public section +public section open Module QuadraticMap @@ -226,7 +226,7 @@ high-rank induction be developed and checked independently of the rank-four proo rational weights that is isotropic over every `p`-adic completion and over `ℝ` is isotropic over `ℚ`. This is the WP4.2 statement, recorded as a `Prop` so that the rank-`≥ 5` induction can be stated against it. -/ -def RankFourDiagonalHM : Prop := +@[expose] def RankFourDiagonalHM : Prop := ∀ w : Fin 4 → ℚ, (∀ i, w i ≠ 0) → (∀ (p : ℕ) [Fact (Nat.Prime p)], (weightedSumSquares ℚ_[p] (fun i => (w i : ℚ_[p]))).Isotropic) → @@ -763,7 +763,7 @@ end Assembly weights that is isotropic over every `p`-adic completion and over `ℝ` is isotropic over `ℚ`. This is the WP5.3 statement, recorded as a `Prop` so that the assembly of `hasseMinkowski` (WP6.2) can be developed against it while the induction is proved. -/ -def RankFiveLeDiagonalHM : Prop := +@[expose] def RankFiveLeDiagonalHM : Prop := ∀ {n : ℕ}, 5 ≤ n → ∀ w : Fin n → ℚ, (∀ i, w i ≠ 0) → (∀ (p : ℕ) [Fact (Nat.Prime p)], (weightedSumSquares ℚ_[p] (fun i => (w i : ℚ_[p]))).Isotropic) → diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Defs.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Defs.lean index bc8bc4bf32..1ad78596c9 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Defs.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Defs.lean @@ -17,14 +17,14 @@ basic vanishing, symmetry and value-set properties, and the class `HasBilinHilbe recording multiplicativity in the first argument. -/ -@[expose] public section +public section namespace HasseMinkowski attribute [local instance] Classical.propDecidable /-- The Hilbert symbol `(a,b)_k`, valued in `{0, ±1}`. -/ -noncomputable def hilbertSym {k : Type*} [Field k] (a b : k) : ℤ := +@[expose] noncomputable def hilbertSym {k : Type*} [Field k] (a b : k) : ℤ := if a = 0 ∨ b = 0 then 0 else if ∃ z x y : k, (z, x, y) ≠ (0, 0, 0) ∧ z ^ 2 - a * x ^ 2 - b * y ^ 2 = 0 then 1 else -1 diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Existence.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Existence.lean index f29ef3eb06..69b06d02b2 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Existence.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Existence.lean @@ -61,7 +61,7 @@ what upstream proves. Upstream declaration names are kept so that the two developments can be compared side by side. See the repository NOTICE file. -/ -@[expose] public section +public section namespace HasseMinkowski diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Local.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Local.lean index 03add9493d..ec316b8fc9 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Local.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Local.lean @@ -24,7 +24,7 @@ The two-adic case is imported from `HilbertSymbol/Two.lean`; for odd `p` the res `hilbertSym_padic_odd_mul_left`. -/ -@[expose] public section +public section open Module QuadraticMap diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Norm.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Norm.lean index 6c8c4ebb07..1f6c4f7456 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Norm.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Norm.lean @@ -24,7 +24,7 @@ reads `z² = b y²`, which forces `b` to be a square unless `y = z = 0`, contrad nontriviality. -/ -@[expose] public section +public section namespace HasseMinkowski diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Padic.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Padic.lean index 93a9086440..03deac27cf 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Padic.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Padic.lean @@ -30,7 +30,7 @@ are recorded in `HANDOFF-hilbertpadic.md` as the outstanding work; only `p = 2` scope entirely. -/ -@[expose] public section +public section namespace HasseMinkowski @@ -762,6 +762,7 @@ lemma padicUnit_spec (a : ℚ_[p]) (ha : a ≠ 0) : _ = (p : ℚ_[p]) ^ a.valuation * (a * (p : ℚ_[p]) ^ (-(a.valuation))) := by ring /-- `parityPow b n` is `b ^ n` when `b = ±1`, well defined for negative `n`. -/ +@[expose] def parityPow (b n : ℤ) : ℤ := if Even n then 1 else b -- Theorem: `parityPow b n = 1` when `n` is even. diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Real.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Real.lean index 40c658ce6d..2ea83c7202 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Real.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Real.lean @@ -20,7 +20,7 @@ are negative, and `1` otherwise (for nonzero arguments). Geometrically, the coni `(√b, 0, 1)`, while two negative coefficients force `z² ≤ 0`, hence `z = x = y = 0`. -/ -@[expose] public section +public section namespace HasseMinkowski diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Reciprocity.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Reciprocity.lean index 0a33ababec..8656ce401c 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Reciprocity.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Reciprocity.lean @@ -31,7 +31,7 @@ This file records the two global properties: square (`prod_eq_one_of_isSquare`, where every local symbol is `1`) as a step. -/ -@[expose] public section +public section namespace HasseMinkowski @@ -193,7 +193,7 @@ formalises. We record the statement as a `Prop` for downstream reference. -/ /-- Hilbert reciprocity for `ℚ`: for nonzero rationals `a, b`, the product of the local Hilbert symbols over all places (the finite places `ℚ_[p]` and the archimedean place `ℝ`) is `1`. Stated for reference; not proved in this file. -/ -def HilbertReciprocity : Prop := +@[expose] def HilbertReciprocity : Prop := ∀ a b : ℚ, a ≠ 0 → b ≠ 0 → (∏ᶠ p : Nat.Primes, hilbertSym (a : ℚ_[p]) (b : ℚ_[p])) * hilbertSym (a : ℝ) (b : ℝ) = 1 @@ -210,6 +210,7 @@ cases themselves (the content of quadratic reciprocity) are Phase 2. -/ /-- The product of the local Hilbert symbols of `a` and `b` over all places of `ℚ`: the finite places `ℚ_[p]` together with the archimedean place `ℝ`. -/ +@[expose] noncomputable def hilbertProd (a b : ℚ) : ℤ := (∏ᶠ p : Nat.Primes, hilbertSym (a : ℚ_[p]) (b : ℚ_[p])) * hilbertSym (a : ℝ) (b : ℝ) diff --git a/LeanPool/HasseMinkowski/HilbertSymbol/Two.lean b/LeanPool/HasseMinkowski/HilbertSymbol/Two.lean index 41ad981453..ba88dac20e 100644 --- a/LeanPool/HasseMinkowski/HilbertSymbol/Two.lean +++ b/LeanPool/HasseMinkowski/HilbertSymbol/Two.lean @@ -30,7 +30,7 @@ Note that the "two units have symbol `1`" statement that holds for odd `p` is ** at `p = 2`: `(3,3)_2 = -1`. -/ -@[expose] public section +public section namespace HasseMinkowski @@ -390,6 +390,7 @@ private lemma two_padic_ne_zero : (2 : ℚ_[2]) ≠ 0 := by norm_num at hnorm /-- The unit part of a nonzero `2`-adic number: `a = 2 ^ a.valuation * twoAdicUnit a ha`. -/ +@[expose] noncomputable def twoAdicUnit (a : ℚ_[2]) (ha : a ≠ 0) : ℤ_[2]ˣ := padicUnit (p := 2) a ha @@ -534,9 +535,11 @@ private lemma parityPow_neg_one_of_odd {n : ℤ} (h : ¬ Even n) : parityPow (-1 rw [parityPow, ite_eq_right h] /-- Serre's `ε` character: `ε(u) = 0` iff `u ≡ 1 (mod 4)`. -/ +@[expose] noncomputable def eps (u : ℤ_[2]ˣ) : ℤ := if (u : ℤ_[2]).toZModPow 2 = 1 then 0 else 1 /-- Serre's `ω` character: `ω(u) = 0` iff `u ≡ ±1 (mod 8)`. -/ +@[expose] noncomputable def omg (u : ℤ_[2]ˣ) : ℤ := if (u : ℤ_[2]).toZModPow 3 = 1 ∨ (u : ℤ_[2]).toZModPow 3 = 7 then 0 else 1 diff --git a/LeanPool/HasseMinkowski/Legendre.lean b/LeanPool/HasseMinkowski/Legendre.lean index b9de4e4fe3..f414ce9f7f 100644 --- a/LeanPool/HasseMinkowski/Legendre.lean +++ b/LeanPool/HasseMinkowski/Legendre.lean @@ -29,7 +29,7 @@ Geometrically, `t + √a` has norm `t ^ 2 - a = b * b'` in `k(√a)`, so if `b` `(b, a)_k = 1` exactly when `b` is a norm from `k(√a)`, the two symbols agree. -/ -@[expose] public section +public section namespace HasseMinkowski diff --git a/LeanPool/HasseMinkowski/Locally.lean b/LeanPool/HasseMinkowski/Locally.lean index e477fc1a16..b087c33e70 100644 --- a/LeanPool/HasseMinkowski/Locally.lean +++ b/LeanPool/HasseMinkowski/Locally.lean @@ -29,7 +29,7 @@ The tensor-product object `Q.baseChange A` is Mathlib's `QuadraticForm.baseChang on `A ⊗[ℚ] V`. -/ -@[expose] public section +public section open Module QuadraticMap TensorProduct @@ -99,6 +99,7 @@ variable {V : Type*} [AddCommGroup V] [Module ℚ V] /-- A quadratic form over `ℚ` is *everywhere locally isotropic* if it is isotropic over every completion of `ℚ`: over `ℝ` and over every `p`-adic field `ℚ_[p]`. -/ +@[expose] def EverywhereLocallyIsotropic (Q : QuadraticForm ℚ V) : Prop := (∀ (p : ℕ) [Fact (Nat.Prime p)], Isotropic (QuadraticForm.baseChange ℚ_[p] Q)) ∧ Isotropic (QuadraticForm.baseChange ℝ Q) diff --git a/LeanPool/HasseMinkowski/Main.lean b/LeanPool/HasseMinkowski/Main.lean index 48af49dbd8..a24ff087fb 100644 --- a/LeanPool/HasseMinkowski/Main.lean +++ b/LeanPool/HasseMinkowski/Main.lean @@ -35,7 +35,7 @@ and `meyer` below specialise them with `rankFourDiagonalHM` and * `meyer_of` (WP6.3): an indefinite form of rank `≥ 5` over `ℚ` is isotropic. -/ -@[expose] public section +public section open Module QuadraticMap diff --git a/LeanPool/HasseMinkowski/Padics/Squares.lean b/LeanPool/HasseMinkowski/Padics/Squares.lean index f695b911e0..39c5aae6ef 100644 --- a/LeanPool/HasseMinkowski/Padics/Squares.lean +++ b/LeanPool/HasseMinkowski/Padics/Squares.lean @@ -37,7 +37,7 @@ what upstream proves. Upstream declaration names are kept so that the two developments can be compared side by side. See the repository NOTICE file. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/HasseMinkowski/Prod.lean b/LeanPool/HasseMinkowski/Prod.lean index 08583652c0..91f11a4cce 100644 --- a/LeanPool/HasseMinkowski/Prod.lean +++ b/LeanPool/HasseMinkowski/Prod.lean @@ -28,7 +28,7 @@ The proofs mirror the reference development, adapted to Mathlib 4.33's API (`baseChange_ext` on pure tensors avoids the bilinear-form machinery of the original). -/ -@[expose] public section +public section open Module QuadraticMap TensorProduct diff --git a/LeanPool/HasseMinkowski/RankCriteria.lean b/LeanPool/HasseMinkowski/RankCriteria.lean index a85a797474..e67185b082 100644 --- a/LeanPool/HasseMinkowski/RankCriteria.lean +++ b/LeanPool/HasseMinkowski/RankCriteria.lean @@ -43,7 +43,7 @@ what upstream proves. Upstream declaration names are kept so that the two developments can be compared side by side. See the repository NOTICE file. -/ -@[expose] public section +public section open Module QuadraticMap diff --git a/LeanPool/HasseMinkowski/RankFour.lean b/LeanPool/HasseMinkowski/RankFour.lean index 98cc3093bc..9cddf3af4a 100644 --- a/LeanPool/HasseMinkowski/RankFour.lean +++ b/LeanPool/HasseMinkowski/RankFour.lean @@ -25,7 +25,7 @@ behaviour, and then `isotropic_of_rank_three'` shows each half represents `x` ov (WP4.3). -/ -@[expose] public section +public section open Module QuadraticMap diff --git a/LeanPool/HasseMinkowski/RankThree.lean b/LeanPool/HasseMinkowski/RankThree.lean index 11252928af..c853012959 100644 --- a/LeanPool/HasseMinkowski/RankThree.lean +++ b/LeanPool/HasseMinkowski/RankThree.lean @@ -38,7 +38,7 @@ reduction below is independent of the descent proof. Every declaration below is * `isotropic_of_rank_three`: the rank-three case, conditional on `HilbertSymLocalGlobal`. -/ -@[expose] public section +public section open Module QuadraticMap TensorProduct @@ -54,6 +54,7 @@ This is the Hasse norm theorem for the quadratic extension `ℚ(√B)` (or `√A rank-three local–global principle; it is proved by elementary descent (CRT plus the norm criterion) in `HasseMinkowski/Legendre.lean` (`hilbertSymLocalGlobal`). It is kept as a `def`/`Prop` here so that the rank-three reduction does not depend on that proof. -/ +@[expose] def HilbertSymLocalGlobal : Prop := ∀ A B : ℚ, A ≠ 0 → B ≠ 0 → (∀ (p : ℕ) [Fact (Nat.Prime p)], hilbertSym (A : ℚ_[p]) (B : ℚ_[p]) = 1) → diff --git a/LeanPool/HasseMinkowski/RankTwo.lean b/LeanPool/HasseMinkowski/RankTwo.lean index 9aeaf51c37..c8aa77fd48 100644 --- a/LeanPool/HasseMinkowski/RankTwo.lean +++ b/LeanPool/HasseMinkowski/RankTwo.lean @@ -32,7 +32,7 @@ are direct adaptations of the classical arguments. * `QuadraticMap.Equivalent.represents_iff`: equivalent forms represent the same values. -/ -@[expose] public section +public section open Module QuadraticMap TensorProduct diff --git a/LeanPool/HasseMinkowski/RatApproximation.lean b/LeanPool/HasseMinkowski/RatApproximation.lean index ddd122cb65..0f01e3d64c 100644 --- a/LeanPool/HasseMinkowski/RatApproximation.lean +++ b/LeanPool/HasseMinkowski/RatApproximation.lean @@ -30,7 +30,7 @@ multiplier of the form `s / L^j` with `L` a prime outside the finite set is `p`- integral for every `p` in the set while being dense in `ℝ`. This gives the real approximation. -/ -@[expose] public section +public section namespace Rat diff --git a/LeanPool/HasseMinkowski/RatSquares.lean b/LeanPool/HasseMinkowski/RatSquares.lean index eb43d7d88f..b4aeef5648 100644 --- a/LeanPool/HasseMinkowski/RatSquares.lean +++ b/LeanPool/HasseMinkowski/RatSquares.lean @@ -26,7 +26,7 @@ divisible by any given prime, so the evenness of the difference forces the two exponents to be even individually. -/ -@[expose] public section +public section namespace HasseMinkowski diff --git a/LeanPool/Incompleteness.lean b/LeanPool/Incompleteness.lean index 218a8ba578..3211740918 100644 --- a/LeanPool/Incompleteness.lean +++ b/LeanPool/Incompleteness.lean @@ -28,7 +28,7 @@ Tags: incompleteness, provability, first-order-arithmetic, mathematical-logic MSC: 03F40, 03F30 -/ -@[expose] public section +public section namespace LeanPool.Incompleteness diff --git a/LeanPool/Incompleteness/Arith/D1.lean b/LeanPool/Incompleteness/Arith/D1.lean index 6cc0cec64c..1a1cb92126 100644 --- a/LeanPool/Incompleteness/Arith/D1.lean +++ b/LeanPool/Incompleteness/Arith/D1.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.SuccPred /-! # D1 -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arith/D3.lean b/LeanPool/Incompleteness/Arith/D3.lean index 682a17793c..5b66bf7c6f 100644 --- a/LeanPool/Incompleteness/Arith/D3.lean +++ b/LeanPool/Incompleteness/Arith/D3.lean @@ -15,7 +15,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arith/DC.lean b/LeanPool/Incompleteness/Arith/DC.lean index 310aca4c8a..0f09d0aecf 100644 --- a/LeanPool/Incompleteness/Arith/DC.lean +++ b/LeanPool/Incompleteness/Arith/DC.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # DC -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arith/First.lean b/LeanPool/Incompleteness/Arith/First.lean index 51b794d4c1..6f133c0474 100644 --- a/LeanPool/Incompleteness/Arith/First.lean +++ b/LeanPool/Incompleteness/Arith/First.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # First -/ -@[expose] public section +public section diff --git a/LeanPool/Incompleteness/Arith/FormalizedArithmetic.lean b/LeanPool/Incompleteness/Arith/FormalizedArithmetic.lean index 71fe51b7d0..bc3d1246d4 100644 --- a/LeanPool/Incompleteness/Arith/FormalizedArithmetic.lean +++ b/LeanPool/Incompleteness/Arith/FormalizedArithmetic.lean @@ -16,7 +16,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arith/Second.lean b/LeanPool/Incompleteness/Arith/Second.lean index ed3edb4cf5..f48a27f802 100644 --- a/LeanPool/Incompleteness/Arith/Second.lean +++ b/LeanPool/Incompleteness/Arith/Second.lean @@ -17,7 +17,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Corollaries /-! # Second -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arith/Theory.lean b/LeanPool/Incompleteness/Arith/Theory.lean index f956b39342..e4fc5dc199 100644 --- a/LeanPool/Incompleteness/Arith/Theory.lean +++ b/LeanPool/Incompleteness/Arith/Theory.lean @@ -16,7 +16,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Completeness -/ -@[expose] public section +public section namespace LO namespace FirstOrder diff --git a/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean b/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean index 5a12871dd6..497c9230fe 100644 --- a/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean +++ b/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean @@ -13,7 +13,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # IOpen -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Basic/Ind.lean b/LeanPool/Incompleteness/Arithmetization/Basic/Ind.lean index 6ea5e1f4d3..8d8a1de341 100644 --- a/LeanPool/Incompleteness/Arithmetization/Basic/Ind.lean +++ b/LeanPool/Incompleteness/Arithmetization/Basic/Ind.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Sub.Basic /-! # Ind -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Basic/PeanoMinus.lean b/LeanPool/Incompleteness/Arithmetization/Basic/PeanoMinus.lean index 36b1d47715..80a66c9f93 100644 --- a/LeanPool/Incompleteness/Arithmetization/Basic/PeanoMinus.lean +++ b/LeanPool/Incompleteness/Arithmetization/Basic/PeanoMinus.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Prime.Lemmas /-! # PeanoMinus -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Definability/Absoluteness.lean b/LeanPool/Incompleteness/Arithmetization/Definability/Absoluteness.lean index 4ef7b49050..377c13ff89 100644 --- a/LeanPool/Incompleteness/Arithmetization/Definability/Absoluteness.lean +++ b/LeanPool/Incompleteness/Arithmetization/Definability/Absoluteness.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Arith.CobhamR0 /-! # Absoluteness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Definability/Boldface.lean b/LeanPool/Incompleteness/Arithmetization/Definability/Boldface.lean index c8a4221715..3e63dc2776 100644 --- a/LeanPool/Incompleteness/Arithmetization/Definability/Boldface.lean +++ b/LeanPool/Incompleteness/Arithmetization/Definability/Boldface.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Sub.Basic /-! # Boldface -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Definability/BoundedBoldface.lean b/LeanPool/Incompleteness/Arithmetization/Definability/BoundedBoldface.lean index 99e5ad7539..16cd87e08a 100644 --- a/LeanPool/Incompleteness/Arithmetization/Definability/BoundedBoldface.lean +++ b/LeanPool/Incompleteness/Arithmetization/Definability/BoundedBoldface.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Sub.Basic /-! # BoundedBoldface -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Definability/Hierarchy.lean b/LeanPool/Incompleteness/Arithmetization/Definability/Hierarchy.lean index 8f0267333b..4d92ef3a1c 100644 --- a/LeanPool/Incompleteness/Arithmetization/Definability/Hierarchy.lean +++ b/LeanPool/Incompleteness/Arithmetization/Definability/Hierarchy.lean @@ -24,7 +24,7 @@ This file defines the $\Sigma_n / \Pi_n / \Delta_n$ formulas of arithmetic of fi -/ -@[expose] public section +public section namespace LO namespace FirstOrder @@ -234,7 +234,7 @@ lemma _root_.LO.FirstOrder.Arith.HierarchySymbol.Semiformula.ProvablyProperOn.pr end «lp_section_1» /-- Imported declaration from the Incompleteness formalization. -/ -def rew (ω : Rew ℒₒᵣ ξ₁ n₁ ξ₂ n₂) : {Γ : +@[expose] def rew (ω : Rew ℒₒᵣ ξ₁ n₁ ξ₂ n₂) : {Γ : HierarchySymbol} → Γ.Semiformula ξ₁ n₁ → Γ.Semiformula ξ₂ n₂ | Sg-[_], mkSigma φ hp => mkSigma (ω ▹ φ) (by simpa using hp) | Pg-[_], mkPi φ hp => mkPi (ω ▹ φ) (by simpa using hp) @@ -329,6 +329,7 @@ def ofZero {Γ'} (φ : Γ'-[0].Semiformula ξ k) : (Γ : HierarchySymbol) → Γ | Dlt-[_] => mkDelta (mkSigma φ.val φ.sigmaZero.of_zero) (mkPi φ.val φ.sigmaZero.of_zero) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def ofDeltaOne (φ : Dlt1.Semiformula ξ k) : (Γ : SigmaPiDelta) → (m : ℕ) → Γ-[m+1].Semiformula ξ k | Sg, m => mkSigma φ.sigma.val (φ.sigma.sigma_prop.mono (by simp)) | Pg, m => mkPi φ.pi.val (φ.pi.pi_prop.mono (by simp)) @@ -572,7 +573,7 @@ lemma _root_.LO.FirstOrder.Arith.HierarchySymbol.Semiformula.ProperWithParamOn.b intro e; simp [Semiformula.bex, hp.iff] /-- Imported declaration from the Incompleteness formalization. -/ -def graphDelta (φ : Sg-[m].Semiformula ξ (k + 1)) : Dlt-[m].Semiformula ξ (k + 1) := +@[expose] def graphDelta (φ : Sg-[m].Semiformula ξ (k + 1)) : Dlt-[m].Semiformula ξ (k + 1) := match m with | 0 => φ.ofZero _ | m + 1 => mkDelta φ (mkPi “x. ∀ y, !φ.val y ⋯ → y = x” (by simp)) diff --git a/LeanPool/Incompleteness/Arithmetization/Definability/Init.lean b/LeanPool/Incompleteness/Arithmetization/Definability/Init.lean index db8f0d5166..0d5facef1a 100644 --- a/LeanPool/Incompleteness/Arithmetization/Definability/Init.lean +++ b/LeanPool/Incompleteness/Arithmetization/Definability/Init.lean @@ -7,6 +7,6 @@ module import Aesop.Frontend.Command -@[expose] public section +public section declare_aesop_rule_sets [Definability] diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Bit.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Bit.lean index 23c0a25d9a..774ecf025a 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Bit.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Bit.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Bit -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -319,7 +319,7 @@ section «lp_section_5» open Classical in /-- Imported declaration from the Incompleteness formalization. -/ -noncomputable def bitInsert (i a : V) : V := if i ∈ a then a else a + exp i +@[expose] noncomputable def bitInsert (i a : V) : V := if i ∈ a then a else a + exp i open Classical in /-- Imported declaration from the Incompleteness formalization. -/ diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Basic.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Basic.lean index f78140b8aa..06fce27f4e 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Basic.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Basic.lean @@ -14,7 +14,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -701,7 +701,7 @@ theorem sigma₁_replacement₂ {f : V → V → V} (hf : Sg1-Function₂ f) (s section «lp_section_13» /-- Imported declaration from the Incompleteness formalization. -/ -def fstIdx (p : V) : V := π₁ (p - 1) +@[expose] def fstIdx (p : V) : V := π₁ (p - 1) @[simp] lemma fstIdx_le_self (p : V) : fstIdx p ≤ p := le_trans (by simp [fstIdx]) (show p - 1 ≤ p by simp) @@ -725,7 +725,7 @@ end «lp_section_13» section «lp_section_14» /-- Imported declaration from the Incompleteness formalization. -/ -def sndIdx (p : V) : V := π₂ (p - 1) +@[expose] def sndIdx (p : V) : V := π₂ (p - 1) @[simp] lemma sndIdx_le_self (p : V) : sndIdx p ≤ p := le_trans (by simp [sndIdx]) (show p - 1 ≤ p by simp) diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Coding.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Coding.lean index e623ca760e..cd4b6a0d49 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Coding.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Coding.lean @@ -10,7 +10,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # Coding -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Fixpoint.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Fixpoint.lean index 2ac0a4e769..b9abc2f2b1 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Fixpoint.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Fixpoint.lean @@ -14,7 +14,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/PRF.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/PRF.lean index a359eb29cb..15ead6bb95 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/PRF.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/PRF.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Sub.Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Seq.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Seq.lean index d3332a3d10..4162aaf7e9 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Seq.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Seq.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Sub.Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -166,7 +166,7 @@ lemma _root_.LO.Arith.Seq.lt_lh_of_mem {s : V} (h : Seq s) {i x} (hix : ⟪i, x h.lt_lh_iff.mpr (mem_domain_iff.mpr ⟨x, hix⟩) /-- Imported declaration from the Incompleteness formalization. -/ -def seqCons (s x : V) : V := insert ⟪lh s, x⟫ s +@[expose] def seqCons (s x : V) : V := insert ⟪lh s, x⟫ s section «lp_section_2» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Vec.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Vec.lean index 0105fd0fa8..10d211db41 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Vec.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/HFS/Vec.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Sub.Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/CodedTheory.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/CodedTheory.lean index 6677c25248..fb3081fa30 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/CodedTheory.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/CodedTheory.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # CodedTheory -/ -@[expose] public section +public section namespace LO @@ -34,7 +34,7 @@ variable {L : Language} variable {M : Type*} [Structure L M] /-- Imported declaration from the Incompleteness formalization. -/ -def curve (σ : Semisentence L 1) : Set M := {x | M ⊧/![x] σ} +@[expose] def curve (σ : Semisentence L 1) : Set M := {x | M ⊧/![x] σ} variable {σ π : Semisentence L 1} @@ -67,7 +67,7 @@ class Delta1Definable (T : Theory L) extends Arith.LDef.TDef L.lDef where isDelta1 : ch.ProvablyProperOn 𝐈Sg1 /-- Imported declaration from the Incompleteness formalization. -/ -def tDef (T : Theory L) [d : T.Delta1Definable] : L.lDef.TDef := d.toTDef +@[expose] def tDef (T : Theory L) [d : T.Delta1Definable] : L.lDef.TDef := d.toTDef @[simp] lemma _root_.LO.FirstOrder.Theory.Delta1Definable.mem_iff' (T : Theory L) [d : T.Delta1Definable] : @@ -103,7 +103,7 @@ instance tDef_defined : (T.codeIn V).Defined T.tDef where variable (T V) /-- Imported declaration from the Incompleteness formalization. -/ -def tCodeIn (T : Theory L) [T.Delta1Definable] : (L.codeIn V).TTheory where +@[expose] def tCodeIn (T : Theory L) [T.Delta1Definable] : (L.codeIn V).TTheory where thy := T.codeIn V pthy := T.tDef diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Coding.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Coding.lean index 79756595b4..0e222c5f02 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Coding.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Coding.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Coding -/ -@[expose] public section +public section namespace LO namespace FirstOrder diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Basic.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Basic.lean index afbd63d396..f685b5a031 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Basic.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Basic.lean @@ -10,7 +10,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -25,28 +25,28 @@ variable {V : Type*} [ORingStruc V] [V ⊧ₘ* 𝐈Sg1] variable {L : Arith.Language V} {pL : LDef} [Arith.Language.Defined L pL] /-- Imported declaration from the Incompleteness formalization. -/ -def qqRel (k r v : V) : V := ⟪0, k, r, v⟫ + 1 +@[expose] def qqRel (k r v : V) : V := ⟪0, k, r, v⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ def qqNRel (k r v : V) : V := ⟪1, k, r, v⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqVerum : V := ⟪2, 0⟫ + 1 +@[expose] def qqVerum : V := ⟪2, 0⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqFalsum : V := ⟪3, 0⟫ + 1 +@[expose] def qqFalsum : V := ⟪3, 0⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqAnd (p q : V) : V := ⟪4, p, q⟫ + 1 +@[expose] def qqAnd (p q : V) : V := ⟪4, p, q⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqOr (p q : V) : V := ⟪5, p, q⟫ + 1 +@[expose] def qqOr (p q : V) : V := ⟪5, p, q⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqAll (p : V) : V := ⟪6, p⟫ + 1 +@[expose] def qqAll (p : V) : V := ⟪6, p⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ -def qqEx (p : V) : V := ⟪7, p⟫ + 1 +@[expose] def qqEx (p : V) : V := ⟪7, p⟫ + 1 /-- Imported declaration from the Incompleteness formalization. -/ scoped prefix:max "^rel " => qqRel diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean index 7d7fe02a9e..88afc8f1c3 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # Functions -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -883,6 +883,7 @@ end «lp_section_9» variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.substs₁ (t u : V) : V := L.substs ?[t] u variable {L} @@ -917,6 +918,7 @@ end «lp_section_12» variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.free (p : V) : V := L.substs₁ ^&0 (L.shift p) variable {L} @@ -952,16 +954,16 @@ end «lp_section_14» namespace Formalized /-- Imported declaration from the Incompleteness formalization. -/ -def qqEQ (x y : V) : V := ^rel 2 (eqIndex : V) ?[x, y] +@[expose] def qqEQ (x y : V) : V := ^rel 2 (eqIndex : V) ?[x, y] /-- Imported declaration from the Incompleteness formalization. -/ -def qqNEQ (x y : V) : V := ^nrel 2 (eqIndex : V) ?[x, y] +@[expose] def qqNEQ (x y : V) : V := ^nrel 2 (eqIndex : V) ?[x, y] /-- Imported declaration from the Incompleteness formalization. -/ -def qqLT (x y : V) : V := ^rel 2 (ltIndex : V) ?[x, y] +@[expose] def qqLT (x y : V) : V := ^rel 2 (ltIndex : V) ?[x, y] /-- Imported declaration from the Incompleteness formalization. -/ -def qqNLT (x y : V) : V := ^nrel 2 (ltIndex : V) ?[x, y] +@[expose] def qqNLT (x y : V) : V := ^nrel 2 (ltIndex : V) ?[x, y] /-- Imported declaration from the Incompleteness formalization. -/ notation:75 x:75 " ^= " y:76 => qqEQ x y diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Iteration.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Iteration.lean index cbf44ae39a..8e98efe939 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Iteration.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Iteration.lean @@ -10,7 +10,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # Iteration -/ -@[expose] public section +public section namespace LO @@ -30,7 +30,7 @@ lemma replicate_succ (p : Semiformula L ξ n) (k : ℕ) : p.replicate (k + 1) = p ⋏ p.replicate k := by simp [replicate] /-- Imported declaration from the Incompleteness formalization. -/ -def weight (k : ℕ) : Semiformula L ξ n := (List.replicate k ⊤).conj +@[expose] def weight (k : ℕ) : Semiformula L ξ n := (List.replicate k ⊤).conj end Semiformula end FirstOrder diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Typed.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Typed.lean index c1959324ef..15758b53c4 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Typed.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Typed.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Sub.Basic -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -70,6 +70,7 @@ scoped instance : LogicalConnective (L.Semiformula n) where arrow (p q) := ⟨L.imp p.val q.val, by simp⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiformula.cast (p : L.Semiformula n) (eq : n = n' := by simp) : L.Semiformula n' := eq ▸ p @@ -150,7 +151,7 @@ lemma imp_def (p q : L.Semiformula n) : p ==> q = ∼p ⋎ q := by ext; simp [im def shift (p : L.Semiformula n) : L.Semiformula n := ⟨L.shift p.val, p.prop.shift⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def substs (p : L.Semiformula n) (w : L.SemitermVec n m) : L.Semiformula m := +@[expose] def substs (p : L.Semiformula n) (w : L.SemitermVec n m) : L.Semiformula m := ⟨L.substs w.val p.val, p.prop.substs w.prop⟩ @[simp] lemma val_shift (p : L.Semiformula n) : p.shift.val = L.shift p.val := rfl @@ -283,21 +284,25 @@ end «lp_section_1» open Formalized /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiterm.equals {n : V} (t u : ⌜ℒₒᵣ⌝.Semiterm n) : ⌜ℒₒᵣ⌝.Semiformula n := ⟨t.val ^= u.val, by simp [qqEQ]⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiterm.notEquals {n : V} (t u : ⌜ℒₒᵣ⌝.Semiterm n) : ⌜ℒₒᵣ⌝.Semiformula n := ⟨t.val ^≠ u.val, by simp [qqNEQ]⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiterm.lessThan {n : V} (t u : ⌜ℒₒᵣ⌝.Semiterm n) : ⌜ℒₒᵣ⌝.Semiformula n := ⟨t.val ^< u.val, by simp [qqLT]⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiterm.notLessThan {n : V} (t u : ⌜ℒₒᵣ⌝.Semiterm n) : ⌜ℒₒᵣ⌝.Semiformula n := ⟨t.val ^ Language.Semiterm.lessThan scoped infix:75 " Language.Semiterm.notLessThan /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.Semiformula.ball {n : V} (t : ⌜ℒₒᵣ⌝.Semiterm n) (p : ⌜ℒₒᵣ⌝.Semiformula (n + 1)) : ⌜ℒₒᵣ⌝.Semiformula n := (⌜ℒₒᵣ⌝.bvar 0 qqBvar diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Functions.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Functions.lean index 08de8262a7..368bc70b6c 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Functions.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Functions.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Functions -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -535,6 +535,7 @@ end «lp_section_6» variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.qVec (w : V) : V := ^#0 ∷ L.termBShiftVec (len w) w variable {L} @@ -660,6 +661,7 @@ section «lp_section_8» variable (L) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.IsTermFVFree (n t : V) : Prop := L.IsSemiterm n t ∧ L.termShift t = t variable {L} @@ -677,16 +679,16 @@ end «lp_section_1» namespace Formalized /-- Imported declaration from the Incompleteness formalization. -/ -protected def zero : ℕ := ^func 0 zeroIndex 0 +@[expose] protected def zero : ℕ := ^func 0 zeroIndex 0 /-- Imported declaration from the Incompleteness formalization. -/ -protected def one : ℕ := ^func 0 oneIndex 0 +@[expose] protected def one : ℕ := ^func 0 oneIndex 0 /-- Imported declaration from the Incompleteness formalization. -/ -def qqAdd (x y : V) := ^func 2 (addIndex : V) ?[x, y] +@[expose] def qqAdd (x y : V) := ^func 2 (addIndex : V) ?[x, y] /-- Imported declaration from the Incompleteness formalization. -/ -def qqMul (x y : V) := ^func 2 (mulIndex : V) ?[x, y] +@[expose] def qqMul (x y : V) := ^func 2 (mulIndex : V) ?[x, y] /-- Imported declaration from the Incompleteness formalization. -/ notation "qqZero" => Formalized.zero diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Typed.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Typed.lean index 309c48b9c8..391e2943aa 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Typed.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Term/Typed.lean @@ -14,7 +14,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -72,6 +72,7 @@ def _root_.LO.Arith.Language.bvar {n : V} (z : V) (hz : z < n := by simp) : L.Se def _root_.LO.Arith.Language.fvar {n : V} (x : V) : L.Semiterm n := ⟨^&x, by simp⟩ /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Arith.Language.func {n k f : V} (hf : L.Func k f) (v : L.SemitermVec k n) : L.Semiterm n := ⟨^func k f v.val , by simp [hf]⟩ @@ -122,7 +123,7 @@ namespace Language namespace Semiterm /-- Imported declaration from the Incompleteness formalization. -/ -def shift (t : L.Semiterm n) : L.Semiterm n := +@[expose] def shift (t : L.Semiterm n) : L.Semiterm n := ⟨L.termShift t.val, Language.IsSemiterm.termShift t.prop⟩ /-- Imported declaration from the Incompleteness formalization. -/ @@ -130,7 +131,7 @@ def bShift (t : L.Semiterm n) : L.Semiterm (n + 1) := ⟨L.termBShift t.val, Language.IsSemiterm.termBShift t.prop⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def substs (t : L.Semiterm n) (w : L.SemitermVec n m) : L.Semiterm m := +@[expose] def substs (t : L.Semiterm n) (w : L.SemitermVec n m) : L.Semiterm m := ⟨L.termSubst w.val t.val, w.prop.termSubst t.prop⟩ @[simp] lemma val_shift (t : L.Semiterm n) : t.shift.val = L.termShift t.val := rfl @@ -157,7 +158,7 @@ def bShift (v : L.SemitermVec k n) : L.SemitermVec k (n + 1) := ⟨L.termBShiftVec k v.val, Language.IsSemitermVec.termBShiftVec v.prop⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def substs (v : L.SemitermVec k n) (w : L.SemitermVec n m) : L.SemitermVec k m := +@[expose] def substs (v : L.SemitermVec k n) (w : L.SemitermVec n m) : L.SemitermVec k m := ⟨L.termSubstVec k w.val v.val, Language.IsSemitermVec.termSubstVec w.prop v.prop⟩ @[simp] lemma val_shift (v : L.SemitermVec k n) : v.shift.val = L.termShiftVec k v.val := rfl diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Exp.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Exp.lean index 7323db08d5..b33925137f 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Exp.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Exp.lean @@ -11,7 +11,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Exp -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Log.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Log.lean index c9f9c66b5d..de36ebfb1d 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Log.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Log.lean @@ -11,7 +11,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Log -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/PPow2.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/PPow2.lean index ec5e64cd12..b23dc90f91 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/PPow2.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/PPow2.lean @@ -11,7 +11,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # PPow2 -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Pow2.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Pow2.lean index de708e5015..990dd7cc39 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Pow2.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaZero/Exponential/Pow2.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Pow2 -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» @@ -124,7 +124,7 @@ lemma _root_.LO.Arith.Pow2.elim' {p : V} : Pow2 p ↔ p = 1 ∨ 1 < p ∧ ∃ q, section «lp_section_2» /-- $\mathrm{LenBit} (2^i, a) \iff \text{$i$th-bit of $a$ is $1$}$. -/ -def LenBit (i a : V) : Prop := ¬2 ∣ (a / i) +@[expose] def LenBit (i a : V) : Prop := ¬2 ∣ (a / i) /-- Imported declaration from the Incompleteness formalization. -/ def _root_.LO.FirstOrder.Arith.lenbitDef : Sg0.Semisentence 2 := diff --git a/LeanPool/Incompleteness/Arithmetization/Vorspiel/ExistsUnique.lean b/LeanPool/Incompleteness/Arithmetization/Vorspiel/ExistsUnique.lean index 94aa112b81..45b4d93441 100644 --- a/LeanPool/Incompleteness/Arithmetization/Vorspiel/ExistsUnique.lean +++ b/LeanPool/Incompleteness/Arithmetization/Vorspiel/ExistsUnique.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.SetLike /-! # ExistsUnique -/ -@[expose] public section +public section namespace Classical diff --git a/LeanPool/Incompleteness/Arithmetization/Vorspiel/Graph.lean b/LeanPool/Incompleteness/Arithmetization/Vorspiel/Graph.lean index 91b6a5486b..c1f0569a34 100644 --- a/LeanPool/Incompleteness/Arithmetization/Vorspiel/Graph.lean +++ b/LeanPool/Incompleteness/Arithmetization/Vorspiel/Graph.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.SetLike /-! # Graph -/ -@[expose] public section +public section namespace Function diff --git a/LeanPool/Incompleteness/Arithmetization/Vorspiel/Lemmata.lean b/LeanPool/Incompleteness/Arithmetization/Vorspiel/Lemmata.lean index 57876c0e12..18b85c5b48 100644 --- a/LeanPool/Incompleteness/Arithmetization/Vorspiel/Lemmata.lean +++ b/LeanPool/Incompleteness/Arithmetization/Vorspiel/Lemmata.lean @@ -11,7 +11,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # Lemmata -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Arithmetization/Vorspiel/Vorspiel.lean b/LeanPool/Incompleteness/Arithmetization/Vorspiel/Vorspiel.lean index da59821d37..1280e7923a 100644 --- a/LeanPool/Incompleteness/Arithmetization/Vorspiel/Vorspiel.lean +++ b/LeanPool/Incompleteness/Arithmetization/Vorspiel/Vorspiel.lean @@ -13,7 +13,7 @@ import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Vorspiel -/ -@[expose] public section +public section instance [Zero α] : Nonempty α := ⟨0⟩ diff --git a/LeanPool/Incompleteness/DC/Basic.lean b/LeanPool/Incompleteness/DC/Basic.lean index 34bc3663fa..3dd53d9bee 100644 --- a/LeanPool/Incompleteness/DC/Basic.lean +++ b/LeanPool/Incompleteness/DC/Basic.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Supplemental /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Basic.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Basic.lean index f32deff5f6..da83f12675 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Basic.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Corollaries /-! # Basic -/ -@[expose] public section +public section namespace LO @@ -27,7 +27,7 @@ namespace ORingStruc variable {α : Type*} [ORingStruc α] /-- Imported declaration from the Incompleteness formalization. -/ -def numeral : ℕ → α +@[expose] def numeral : ℕ → α | 0 => 0 | 1 => 1 | n + 2 => numeral (n + 1) + 1 @@ -183,11 +183,11 @@ namespace Semiformula variable {L : Language} [L.LT] [L.Zero] [L.One] [L.Add] /-- Imported declaration from the Incompleteness formalization. -/ -def ballLTSucc (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : +@[expose] def ballLTSucc (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : Semiformula L ξ n := φ.ballLT ‘!!t + 1’ /-- Imported declaration from the Incompleteness formalization. -/ -def bexLTSucc (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : +@[expose] def bexLTSucc (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : Semiformula L ξ n := φ.bexLT ‘!!t + 1’ variable {M : Type*} {s : Structure L M} [LT M] [One M] [Add M] [Structure.LT L M] diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/CobhamR0.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/CobhamR0.lean index 8ffdaf5cd5..10cd7789d2 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/CobhamR0.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/CobhamR0.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Corollaries /-! # CobhamR0 -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Hierarchy.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Hierarchy.lean index 48734cd843..0ed3c0e94c 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Hierarchy.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Hierarchy.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.FirstOrder.Arith.Basic /-! # Hierarchy -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Model.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Model.lean index ea22519533..bc83153bd8 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Model.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Model.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Corollaries /-! # Model -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/PeanoMinus.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/PeanoMinus.lean index 93a86df9fb..0ddb2baa17 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/PeanoMinus.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/PeanoMinus.lean @@ -11,7 +11,7 @@ import Mathlib.Data.Nat.Cast.Order.Basic /-! # PeanoMinus -/ -@[expose] public section +public section noncomputable section «lp_nc_section_1» diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Representation.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Representation.lean index 7945bc46c9..1675d75e15 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Representation.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Representation.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Arith.CobhamR0 /-! # Representation -/ -@[expose] public section +public section namespace Part diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/StrictHierarchy.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/StrictHierarchy.lean index 289216cac6..9091e48a60 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/StrictHierarchy.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/StrictHierarchy.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.FirstOrder.Arith.Hierarchy /-! # StrictHierarchy -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Theory.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Theory.lean index f5165c257d..7c3747af27 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Theory.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Arith/Theory.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.FirstOrder.Arith.Hierarchy /-! # Theory -/ -@[expose] public section +public section namespace LO @@ -21,7 +21,7 @@ open Arith variable {L : Language} [L.ORing] {ξ : Type*} [DecidableEq ξ] /-- Imported declaration from the Incompleteness formalization. -/ -def succInd {ξ} (φ : Semiformula L ξ 1) : +@[expose] def succInd {ξ} (φ : Semiformula L ξ 1) : Formula L ξ := “!φ 0 → (∀ x, !φ x → !φ (x + 1)) → ∀ x, !φ x” /-- Imported declaration from the Incompleteness formalization. -/ @@ -119,7 +119,7 @@ notation "𝐏𝐀⁻" => PeanoMinus variable (L) /-- Imported declaration from the Incompleteness formalization. -/ -def indScheme (Γ : Semiformula L ℕ 1 → Prop) : Theory L := +@[expose] def indScheme (Γ : Semiformula L ℕ 1 → Prop) : Theory L := { ψ | ∃ φ : Semiformula L ℕ 1, Γ φ ∧ ψ = succInd φ } /-- Imported declaration from the Incompleteness formalization. -/ diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/BinderNotation.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/BinderNotation.lean index 6352807114..22d07e96d7 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/BinderNotation.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/BinderNotation.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # BinderNotation -/ -@[expose] public section +public section open Lean PrettyPrinter Delaborator SubExpr diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus.lean index 7fce3b1200..c7884a59f0 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Supplemental /-! # Calculus -/ -@[expose] public section +public section namespace LO @@ -56,7 +56,7 @@ variable {T U : Theory L} {Δ Δ₁ Δ₂ Γ : Sequent L} {φ ψ r : SyntacticFo open Rewriting LawfulSyntacticRewriting /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.FirstOrder.Derivation.length {Δ : Sequent L} : T ⟹ Δ → ℕ +@[expose] def _root_.LO.FirstOrder.Derivation.length {Δ : Sequent L} : T ⟹ Δ → ℕ | axL _ _ _ => 0 | verum _ => 0 | or d => d.length.succ diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus2.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus2.lean index 049bbaf58f..8950834f74 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus2.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Calculus2.lean @@ -15,7 +15,7 @@ Different characterizations of proof. -/ -@[expose] public section +public section namespace LO namespace FirstOrder diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Coding.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Coding.lean index 1167d3dedd..01e2d5dc0f 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Coding.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Coding.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # Coding -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Eq.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Eq.lean index 9270602601..a712a7ff92 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Eq.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Eq.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Basic.Soundness /-! # Eq -/ -@[expose] public section +public section namespace Matrix diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Model.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Model.lean index 2da612d7dd..d242832c68 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Model.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Model.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Bound.Init /-! # Model -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Operator.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Operator.lean index d74c04e80f..95d962ea41 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Operator.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Operator.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Bound.Init /-! # Operator -/ -@[expose] public section +public section namespace LO @@ -199,6 +199,7 @@ lemma _root_.LO.FirstOrder.Semiterm.Operator.Star.term_eq [L.Star] : open Language Semiterm /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def numeral (L : Language) [Operator.Zero L] [Operator.One L] [Operator.Add L] : ℕ → Const L | 0 => Zero.zero | n + 1 => Add.add.foldr One.one (List.replicate n One.one) @@ -383,7 +384,7 @@ abbrev Const (L : Language.{u}) := Operator L 0 namespace Operator /-- Imported declaration from the Incompleteness formalization. -/ -def operator {arity : ℕ} (o : Operator L arity) (v : Fin arity → Semiterm L ξ n) : +@[expose] def operator {arity : ℕ} (o : Operator L arity) (v : Fin arity → Semiterm L ξ n) : Semiformula L ξ n := Rewriting.embedding o.sentence <~ v /-- Imported declaration from the Incompleteness formalization. -/ @@ -409,7 +410,7 @@ lemma operator_comp (o : Operator L k) (w : Fin k → Semiterm.Operator L l) (v def and {k} (o₁ o₂ : Operator L k) : Operator L k := ⟨o₁.sentence ⋏ o₂.sentence⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def or {k} (o₁ o₂ : Operator L k) : Operator L k := ⟨o₁.sentence ⋎ o₂.sentence⟩ +@[expose] def or {k} (o₁ o₂ : Operator L k) : Operator L k := ⟨o₁.sentence ⋎ o₂.sentence⟩ @[simp] lemma operator_and (o₁ o₂ : Operator L k) (v : Fin k → Semiterm L ξ n) : (o₁.and o₂).operator v = o₁.operator v ⋏ o₂.operator v := by simp [operator, and] @@ -514,6 +515,7 @@ variable {L : Language} end Operator /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.FirstOrder.Semiformula.Operator.val {M : Type w} [s : Structure L M] {k} (o : Operator L k) (v : Fin k → M) : @@ -554,11 +556,11 @@ lemma eval_operator {k} {o : Operator L k} {v : Fin k → Semiterm L ξ n} : end «lp_section_5» /-- Imported declaration from the Incompleteness formalization. -/ -def ballLT [Operator.LT L] (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : +@[expose] def ballLT [Operator.LT L] (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : Semiformula L ξ n := ∀[Operator.LT.lt.operator ![#0, Rew.bShift t]] φ /-- Imported declaration from the Incompleteness formalization. -/ -def bexLT [Operator.LT L] (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : +@[expose] def bexLT [Operator.LT L] (t : Semiterm L ξ n) (φ : Semiformula L ξ (n + 1)) : Semiformula L ξ n := ∃[Operator.LT.lt.operator ![#0, Rew.bShift t]] φ /-- Imported declaration from the Incompleteness formalization. -/ diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Elementary.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Elementary.lean index d5eddc28cb..a5b3537fe7 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Elementary.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Elementary.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # Elementary -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Semantics.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Semantics.lean index 54059bb180..f144e67f92 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Semantics.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Semantics/Semantics.lean @@ -17,7 +17,7 @@ definition. -/ -@[expose] public section +public section namespace LO @@ -52,7 +52,7 @@ instance [n : Nonempty M] : Nonempty (Structure L M) := by exact ⟨{ func := fun _ _ _ => x, rel := fun _ _ _ => True }⟩ /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[reducible, expose] protected def lMap (φ : L₁ →ᵥ L₂) {M : Type w} (S : Structure L₂ M) : Structure L₁ M where func := fun _ f => S.func (φ.func f) rel := fun _ r => S.rel (φ.rel r) @@ -67,8 +67,8 @@ variable (φ : L₁ →ᵥ L₂) {M : Type w} (s₂ : Structure L₂ M) {k} {r : L₁.Rel k} {v : Fin k → M} : (s₂.lMap φ).rel r v ↔ s₂.rel (φ.rel r) v := of_eq rfl /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] -def ofEquiv {M : Type w} [Structure L M] {N : Type w'} (Θ : M ≃ N) : Structure L N where +@[reducible, expose] def ofEquiv {M : Type w} [Structure L M] {N : Type w'} + (Θ : M ≃ N) : Structure L N where func := fun _ f v => Θ (func f (Θ.symm ∘ v)) rel := fun _ r v => rel r (Θ.symm ∘ v) @@ -80,7 +80,7 @@ noncomputable instance [Structure L M] : Structure.Decidable L M := fun r v => Classical.dec (rel r v) /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] def toStruc [i : Nonempty M] (s : Structure L M) : Struc L := ⟨M, i, s⟩ +@[reducible, expose] def toStruc [i : Nonempty M] (s : Structure L M) : Struc L := ⟨M, i, s⟩ end Structure @@ -100,7 +100,7 @@ variable {ε : ξ → M} {ε₁ : μ₁ → M} {ε₂ : μ₂ → M} /-- Imported declaration from the Incompleteness formalization. -/ -def val (s : Structure L M) (e : Fin n → M) (ε : ξ → M) : Semiterm L ξ n → M +@[expose] def val (s : Structure L M) (e : Fin n → M) (ε : ξ → M) : Semiterm L ξ n → M | #x => e x | &x => ε x | func f v => s.func f (fun i => (v i).val s e ε) diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Soundness.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Soundness.lean index deacc38f6d..67bc22b326 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Soundness.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Soundness.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.FirstOrder.Basic.Calculus /-! # Soundness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Formula.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Formula.lean index d287092c01..b4be8a6042 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Formula.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Formula.lean @@ -21,7 +21,7 @@ The quantification is represented by de Bruijn index. -/ -@[expose] public section +public section namespace LO @@ -61,7 +61,7 @@ variable {n n₁ n₂ n₂ m m₁ m₂ m₃ : ℕ} /-- Imported declaration from the Incompleteness formalization. -/ -def neg {n} : Semiformula L ξ n → Semiformula L ξ n +@[expose] def neg {n} : Semiformula L ξ n → Semiformula L ξ n | verum => falsum | falsum => verum | rel r v => nrel r v @@ -199,7 +199,7 @@ abbrev «rel!» (L : Language) (k) (r : L.Rel k) (v : Fin k → Semiterm L ξ n) abbrev «nrel!» (L : Language) (k) (r : L.Rel k) (v : Fin k → Semiterm L ξ n) := nrel r v /-- Imported declaration from the Incompleteness formalization. -/ -def complexity {n : ℕ} : Semiformula L ξ n → ℕ +@[expose] def complexity {n : ℕ} : Semiformula L ξ n → ℕ | ⊤ => 0 | ⊥ => 0 | rel _ _ => 0 @@ -374,7 +374,7 @@ end «lp_section_2» section «lp_section_3» /-- Imported declaration from the Incompleteness formalization. -/ -def qr : ∀ {n}, Semiformula L ξ n → ℕ +@[expose] def qr : ∀ {n}, Semiformula L ξ n → ℕ | _, ⊤ => 0 | _, ⊥ => 0 | _, rel _ _ => 0 @@ -416,7 +416,7 @@ end «lp_section_3» section «lp_section_4» /-- Imported declaration from the Incompleteness formalization. -/ -def Open (φ : Semiformula L ξ n) : Prop := φ.qr = 0 +@[expose] def Open (φ : Semiformula L ξ n) : Prop := φ.qr = 0 lemma open_top : (⊤ : Semiformula L ξ n).Open := rfl @@ -451,7 +451,7 @@ section «lp_section_5» variable [DecidableEq ξ] /-- Imported declaration from the Incompleteness formalization. -/ -def freeVariables : {n : ℕ} → Semiformula L ξ n → Finset ξ +@[expose] def freeVariables : {n : ℕ} → Semiformula L ξ n → Finset ξ | _, rel _ v => .biUnion .univ fun i ↦ (v i).freeVariables | _, nrel _ v => .biUnion .univ fun i ↦ (v i).freeVariables | _, ⊤ => ∅ @@ -526,7 +526,7 @@ abbrev «FVar?» (φ : Semiformula L ξ n) (x : ξ) : Prop := x ∈ φ.freeVaria (∀* φ).FVar? x ↔ φ.FVar? x := by simp [FVar?] /-- Imported declaration from the Incompleteness formalization. -/ -def fvSup (φ : SyntacticSemiformula L n) : ℕ := (φ.freeVariables.max).recBotCoe 0 .succ +@[expose] def fvSup (φ : SyntacticSemiformula L n) : ℕ := (φ.freeVariables.max).recBotCoe 0 .succ lemma «lt_fvSup_of_fvar?» {φ : SyntacticSemiformula L n} : φ.FVar? m → m < φ.fvSup := by unfold fvSup FVar? @@ -573,7 +573,7 @@ lemma ne_of_ne_complexity {φ ψ : Semiformula L ξ n} (h : φ.complexity ≠ ψ variable {L : Language} {L₁ : Language} {L₂ : Language} {L₃ : Language} {ξ : Type*} {Φ : L₁ →ᵥ L₂} /-- Imported declaration from the Incompleteness formalization. -/ -def lMapAux (Φ : L₁ →ᵥ L₂) : ∀ {n}, Semiformula L₁ ξ n → Semiformula L₂ ξ n +@[expose] def lMapAux (Φ : L₁ →ᵥ L₂) : ∀ {n}, Semiformula L₁ ξ n → Semiformula L₂ ξ n | _, ⊤ => ⊤ | _, ⊥ => ⊥ | _, rel r v => rel (Φ.rel r) (Semiterm.lMap Φ ∘ v) @@ -587,7 +587,7 @@ lemma lMapAux_neg {n} (φ : Semiformula L₁ ξ n) : (∼φ).lMapAux Φ = ∼φ. by induction φ using Semiformula.rec' <;> simp[*, lMapAux] /-- Imported declaration from the Incompleteness formalization. -/ -def lMap (Φ : L₁ →ᵥ L₂) {n} : Semiformula L₁ ξ n →ˡᶜ Semiformula L₂ ξ n where +@[expose] def lMap (Φ : L₁ →ᵥ L₂) {n} : Semiformula L₁ ξ n →ˡᶜ Semiformula L₂ ξ n where toTr := lMapAux Φ map_top' := by simp[lMapAux] map_bot' := by simp[lMapAux] @@ -678,7 +678,7 @@ instance : Collection (SyntacticFormula L) (Theory L) := inferInstance instance : Collection (Sentence L) (ClosedTheory L) := inferInstance /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.FirstOrder.Theory.lMap (Φ : L₁ →ᵥ L₂) (T : Theory L₁) : +@[expose] def _root_.LO.FirstOrder.Theory.lMap (Φ : L₁ →ᵥ L₂) (T : Theory L₁) : Theory L₂ := Semiformula.lMap Φ '' T namespace Theory diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Rew.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Rew.lean index 0889c7e4df..e90cafb6f2 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Rew.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Basic/Syntax/Rew.lean @@ -31,7 +31,7 @@ Rewritings `LO.FirstOrder.Rew` is naturally converted to formula Rewritings by -/ -@[expose] public section +public section namespace Finset @@ -53,7 +53,7 @@ namespace FirstOrder namespace Semiformula /-- Imported declaration from the Incompleteness formalization. -/ -def rewAux ⦃n₁ n₂ : ℕ⦄ (ω : Rew L ξ₁ n₁ ξ₂ n₂) : Semiformula L ξ₁ n₁ → Semiformula L ξ₂ n₂ +@[expose] def rewAux ⦃n₁ n₂ : ℕ⦄ (ω : Rew L ξ₁ n₁ ξ₂ n₂) : Semiformula L ξ₁ n₁ → Semiformula L ξ₂ n₂ | ⊤ => ⊤ | ⊥ => ⊥ | rel r v => rel r (ω ∘ v) @@ -70,7 +70,7 @@ lemma ext_rewAux' {ω₁ ω₂ : Rew L ξ₁ n₁ ξ₂ n₂} (h : ω₁ = ω₂ rewAux ω₁ φ = rewAux ω₂ φ:= by simp [h] /-- Imported declaration from the Incompleteness formalization. -/ -def rew (ω : Rew L ξ₁ n₁ ξ₂ n₂) : Semiformula L ξ₁ n₁ →ˡᶜ Semiformula L ξ₂ n₂ where +@[expose] def rew (ω : Rew L ξ₁ n₁ ξ₂ n₂) : Semiformula L ξ₁ n₁ →ˡᶜ Semiformula L ξ₂ n₂ where toTr := rewAux ω map_top' := by rfl map_bot' := by rfl @@ -496,6 +496,7 @@ private lemma «not_fvar?_fixitr_fvSup» (φ : SyntacticFormula L) : simp_all /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def close (φ : SyntacticFormula L) : SyntacticFormula L := ∀* (@Rew.fixitr L 0 φ.fvSup ▹ φ) /-- Imported declaration from the Incompleteness formalization. -/ @@ -517,7 +518,7 @@ lemma close_eq_self_of (φ : SyntacticFormula L) (h : φ.freeVariables = ∅) : close_eq_self_of (∀∀φ) (by simp) /-- Imported declaration from the Incompleteness formalization. -/ -def toEmpty [DecidableEq ξ] {n : ℕ} : (φ : +@[expose] def toEmpty [DecidableEq ξ] {n : ℕ} : (φ : Semiformula L ξ n) → φ.freeVariables = ∅ → Semisentence L n | rel R v, h => rel R fun i ↦ (v i).toEmpty (by @@ -575,7 +576,7 @@ def toEmpty [DecidableEq ξ] {n : ℕ} : (φ : (∃' φ).toEmpty h = ∃' (φ.toEmpty (by simpa using h)) := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def close₀ (φ : SyntacticFormula L) : Sentence L := (∀∀φ).toEmpty (by simp) +@[expose] def close₀ (φ : SyntacticFormula L) : Sentence L := (∀∀φ).toEmpty (by simp) /-- Imported declaration from the Incompleteness formalization. -/ scoped [LO.FirstOrder] prefix:max "∀∀₀" => LO.FirstOrder.Semiformula.close₀ diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Coding.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Coding.lean index 87803bbd0a..6b0bc76d1f 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Coding.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Coding.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Bound.Init /-! # Coding -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Completeness.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Completeness.lean index 842d26b50d..82f0a935fe 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Completeness.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Completeness.lean @@ -13,7 +13,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Ultraproduct /-! # Completeness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Corollaries.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Corollaries.lean index 0e4677be53..34f4bbb183 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Corollaries.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/Corollaries.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Completeness /-! # Corollaries -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SearchTree.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SearchTree.lean index d152e15f2c..6454903896 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SearchTree.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SearchTree.lean @@ -12,7 +12,7 @@ public import LeanPool.Incompleteness.Foundation.FirstOrder.Basic.Semantics.Sema /-! # SearchTree -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SubLanguage.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SubLanguage.lean index 9465151249..a230a44f03 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SubLanguage.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Completeness/SubLanguage.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Bound.Init /-! # SubLanguage -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Order/Le.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Order/Le.lean index 96f1f3a612..44a5aaa58f 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Order/Le.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Order/Le.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.FirstOrder.Completeness.Completeness /-! # Le -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/FirstOrder/Ultraproduct.lean b/LeanPool/Incompleteness/Foundation/FirstOrder/Ultraproduct.lean index 5e88552355..6c202e1a10 100644 --- a/LeanPool/Incompleteness/Foundation/FirstOrder/Ultraproduct.lean +++ b/LeanPool/Incompleteness/Foundation/FirstOrder/Ultraproduct.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Bound.Init /-! # Ultraproduct -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Formula.lean b/LeanPool/Incompleteness/Foundation/IntProp/Formula.lean index d1ba5fbfd5..862addd400 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Formula.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Formula.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # Formula -/ -@[expose] public section +public section namespace LO @@ -82,7 +82,7 @@ lemma top_def : (⊤ : Formula α) = ⊥ ==> ⊥ := rfl lemma iff_def (φ ψ : Formula α) : φ <=> ψ = (φ ==> ψ) ⋏ (ψ ==> φ) := by rfl /-- Imported declaration from the Incompleteness formalization. -/ -def complexity : Formula α → ℕ +@[expose] def complexity : Formula α → ℕ | atom _ => 0 | ⊥ => 0 | φ ==> ψ => max φ.complexity ψ.complexity + 1 diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Basic.lean b/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Basic.lean index 807f929b69..069517db6e 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Basic.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Basic /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Int.lean b/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Int.lean index 3962e63351..f0de7cd8f6 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Int.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/Int.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.IntProp.Hilbert.Basic /-! # Int -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/WellKnown.lean b/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/WellKnown.lean index 7226af74d4..f7a89b2094 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/WellKnown.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Hilbert/WellKnown.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Supplemental /-! # WellKnown -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Basic.lean b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Basic.lean index efd7a621fa..fc39737377 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Basic.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Bound.Init /-! # Basic -/ -@[expose] public section +public section namespace LO @@ -92,7 +92,7 @@ namespace Formula namespace Kripke /-- Imported declaration from the Incompleteness formalization. -/ -def Satisfies (M : Kripke.Model) (w : M.World) : Formula ℕ → Prop +@[expose] def Satisfies (M : Kripke.Model) (w : M.World) : Formula ℕ → Prop | atom a => M w a | ⊥ => False | φ ⋏ ψ => Satisfies M w φ ∧ Satisfies M w ψ @@ -304,7 +304,7 @@ end ValidOnModel /-- Imported declaration from the Incompleteness formalization. -/ -def ValidOnFrame (F : Frame) (φ : Formula ℕ) := ∀ V, (⟨F, V⟩ : Kripke.Model) ⊧ φ +@[expose] def ValidOnFrame (F : Frame) (φ : Formula ℕ) := ∀ V, (⟨F, V⟩ : Kripke.Model) ⊧ φ namespace ValidOnFrame @@ -394,7 +394,7 @@ end ValidOnFrame /-- Imported declaration from the Incompleteness formalization. -/ -def ValidOnFrameClass (C : FrameClass) (φ : Formula ℕ) := ∀ F, F ∈ C → F ⊧ φ +@[expose] def ValidOnFrameClass (C : FrameClass) (φ : Formula ℕ) := ∀ F, F ∈ C → F ⊧ φ namespace ValidOnFrameClass diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Basic.lean b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Basic.lean index bc7bd04c83..a155b6131e 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Basic.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.IntProp.Kripke.Hilbert.Soundness /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Classical.lean b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Classical.lean index 2e92df9afb..e88083654f 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Classical.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Cl/Classical.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.IntProp.Kripke.Hilbert.Cl.Basic /-! # Classical -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Soundness.lean b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Soundness.lean index 87c20538d4..fb7ad608f3 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Soundness.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Kripke/Hilbert/Soundness.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.IntProp.Kripke.Basic /-! # Soundness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/IntProp/Substitution.lean b/LeanPool/Incompleteness/Foundation/IntProp/Substitution.lean index 7d34e746db..be23b01322 100644 --- a/LeanPool/Incompleteness/Foundation/IntProp/Substitution.lean +++ b/LeanPool/Incompleteness/Foundation/IntProp/Substitution.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # Substitution -/ -@[expose] public section +public section namespace LO @@ -27,7 +27,7 @@ namespace Formula variable {φ ψ : Formula α} {s : Substitution α} /-- Imported declaration from the Incompleteness formalization. -/ -def subst (s : Substitution α) : Formula α → Formula α +@[expose] def subst (s : Substitution α) : Formula α → Formula α | atom a => (s a) | ⊥ => ⊥ | φ ⋏ ψ => φ.subst s ⋏ ψ.subst s diff --git a/LeanPool/Incompleteness/Foundation/Logic/Axioms.lean b/LeanPool/Incompleteness/Foundation/Logic/Axioms.lean index 98291acad7..de9daf561f 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Axioms.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Axioms.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # Axioms -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/Calculus.lean b/LeanPool/Incompleteness/Foundation/Logic/Calculus.lean index d2479974d7..a7cf535864 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Calculus.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Calculus.lean @@ -18,7 +18,7 @@ This file defines a characterization of Tait style calculus and Gentzen style ca -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/Disjunctive.lean b/LeanPool/Incompleteness/Foundation/Logic/Disjunctive.lean index 2a79fafa5e..771c8db248 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Disjunctive.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Disjunctive.lean @@ -10,7 +10,7 @@ import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Supplemental /-! # Disjunctive -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/Entailment.lean b/LeanPool/Incompleteness/Foundation/Logic/Entailment.lean index c4ebe63b2d..5f23d991bc 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Entailment.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Entailment.lean @@ -34,7 +34,7 @@ Also defines soundness and completeness. -/ -@[expose] public section +public section namespace LO @@ -55,7 +55,7 @@ section «lp_section_1» variable (𝓢 : S) /-- Imported declaration from the Incompleteness formalization. -/ -def Provable (f : F) : Prop := Nonempty (𝓢 ⊢ f) +@[expose] def Provable (f : F) : Prop := Nonempty (𝓢 ⊢ f) /-- Imported declaration from the Incompleteness formalization. -/ abbrev Unprovable (f : F) : Prop := ¬Provable 𝓢 f @@ -67,10 +67,10 @@ infix:45 " ⊢! " => Provable infix:45 " ⊬ " => Unprovable /-- Imported declaration from the Incompleteness formalization. -/ -def PrfSet (s : Set F) : Type _ := {f : F} → f ∈ s → 𝓢 ⊢ f +@[expose] def PrfSet (s : Set F) : Type _ := {f : F} → f ∈ s → 𝓢 ⊢ f /-- Imported declaration from the Incompleteness formalization. -/ -def ProvableSet (s : Set F) : Prop := ∀ {f}, f ∈ s → 𝓢 ⊢! f +@[expose] def ProvableSet (s : Set F) : Prop := ∀ {f}, f ∈ s → 𝓢 ⊢! f /-- Imported declaration from the Incompleteness formalization. -/ infix:45 " ⊢* " => PrfSet @@ -79,7 +79,7 @@ infix:45 " ⊢* " => PrfSet infix:45 " ⊢!* " => ProvableSet /-- Imported declaration from the Incompleteness formalization. -/ -def theory : Set F := {f | 𝓢 ⊢! f} +@[expose] def theory : Set F := {f | 𝓢 ⊢! f} end «lp_section_1» @@ -189,7 +189,7 @@ end «lp_section_2» @[simp] lemma provableSet_theory (𝓢 : S) : 𝓢 ⊢!* theory 𝓢 := fun hf ↦ hf /-- Imported declaration from the Incompleteness formalization. -/ -def Inconsistent (𝓢 : S) : Prop := ∀ f, 𝓢 ⊢! f +@[expose] def Inconsistent (𝓢 : S) : Prop := ∀ f, 𝓢 ⊢! f /-- Imported declaration from the Incompleteness formalization. -/ class Consistent (𝓢 : S) : Prop where @@ -278,14 +278,14 @@ variable [Entailment F'' S''] instance (𝓢 : S) (𝓣 : S') : CoeFun (𝓢 ↝ 𝓣) (fun _ ↦ F → F') := ⟨Translation.toFun⟩ /-- Imported declaration from the Incompleteness formalization. -/ -protected def id (𝓢 : S) : 𝓢 ↝ 𝓢 where +@[expose] protected def id (𝓢 : S) : 𝓢 ↝ 𝓢 where toFun := id prf := id @[simp] lemma id_app (𝓢 : S) (f : F) : Translation.id 𝓢 f = f := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def comp {𝓢 : S} {𝓣 : S'} {𝓤 : S''} (φ : 𝓣 ↝ 𝓤) (ψ : 𝓢 ↝ 𝓣) : 𝓢 ↝ 𝓤 where +@[expose] def comp {𝓢 : S} {𝓣 : S'} {𝓤 : S''} (φ : 𝓣 ↝ 𝓤) (ψ : 𝓢 ↝ 𝓣) : 𝓢 ↝ 𝓤 where toFun := φ.toFun ∘ ψ.toFun prf := φ.prf ∘ ψ.prf @@ -336,7 +336,7 @@ variable [Entailment F'' S''] instance (𝓢 : S) (𝓣 : S') : CoeFun (𝓢 ↝¹ 𝓣) (fun _ ↦ F → F') := ⟨fun t ↦ t.toFun⟩ /-- Imported declaration from the Incompleteness formalization. -/ -protected def id (𝓢 : S) : 𝓢 ↝¹ 𝓢 where +@[expose] protected def id (𝓢 : S) : 𝓢 ↝¹ 𝓢 where toFun := id prf := id prfInv := id @@ -344,7 +344,7 @@ protected def id (𝓢 : S) : 𝓢 ↝¹ 𝓢 where @[simp] lemma id_app (𝓢 : S) (f : F) : FaithfulTranslation.id 𝓢 f = f := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def comp {𝓢 : S} {𝓣 : S'} {𝓤 : S''} (φ : 𝓣 ↝¹ 𝓤) (ψ : 𝓢 ↝¹ 𝓣) : 𝓢 ↝¹ 𝓤 where +@[expose] def comp {𝓢 : S} {𝓣 : S'} {𝓤 : S''} (φ : 𝓣 ↝¹ 𝓤) (ψ : 𝓢 ↝¹ 𝓣) : 𝓢 ↝¹ 𝓤 where toFun := φ.toFun ∘ ψ.toFun prf := φ.prf ∘ ψ.prf prfInv := ψ.prfInv ∘ φ.prfInv @@ -366,7 +366,7 @@ variable [LogicalConnective F] variable (𝓢 : S) /-- Imported declaration from the Incompleteness formalization. -/ -def Complete : Prop := ∀ f, 𝓢 ⊢! f ∨ 𝓢 ⊢! ∼f +@[expose] def Complete : Prop := ∀ f, 𝓢 ⊢! f ∨ 𝓢 ⊢! ∼f /-- Imported declaration from the Incompleteness formalization. -/ def Undecidable (f : F) : Prop := 𝓢 ⊬ f ∧ 𝓢 ⊬ ∼f diff --git a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Basic.lean b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Basic.lean index 6c427b161e..73bfea89a9 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Basic.lean @@ -11,7 +11,7 @@ public import Mathlib.Algebra.Order.Ring.Nat /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Context.lean b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Context.lean index cbd2edb935..00cb153809 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Context.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Context.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Basic /-! # Context -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Lukasiewicz.lean b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Lukasiewicz.lean index f1813de36c..a83c5adfb3 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Lukasiewicz.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Lukasiewicz.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Basic /-! # Lukasiewicz -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Supplemental.lean b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Supplemental.lean index a62f6aaf94..f5ec0af8e7 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Supplemental.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/HilbertStyle/Supplemental.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Context /-! # Supplemental -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Logic/LogicSymbol.lean b/LeanPool/Incompleteness/Foundation/Logic/LogicSymbol.lean index a054c30faf..f74901ee24 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/LogicSymbol.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/LogicSymbol.lean @@ -23,7 +23,7 @@ a function that preserves logical connectives. -/ -@[expose] public section +public section namespace LO @@ -94,7 +94,7 @@ section «lp_section_2» variable {α : Type*} [LogicalConnective α] /-- Imported declaration from the Incompleteness formalization. -/ -@[match_pattern] def iff (a b : α) := (a ==> b) ⋏ (b ==> a) +@[expose, match_pattern] def iff (a b : α) := (a ==> b) ⋏ (b ==> a) /-- Imported declaration from the Incompleteness formalization. -/ infix:61 " <=> " => LogicalConnective.iff @@ -199,7 +199,7 @@ instance : HomClass (α →ˡᶜ β) α β where variable (f : α →ˡᶜ β) (a b : α) /-- Imported declaration from the Incompleteness formalization. -/ -protected def id : α →ˡᶜ α where +@[expose] protected def id : α →ˡᶜ α where toTr := id map_top' := by simp map_bot' := by simp @@ -211,7 +211,7 @@ protected def id : α →ˡᶜ α where @[simp] lemma app_id (a : α) : LogicalConnective.Hom.id a = a := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def comp (g : β →ˡᶜ γ) (f : α →ˡᶜ β) : α →ˡᶜ γ where +@[expose] def comp (g : β →ˡᶜ γ) (f : α →ˡᶜ β) : α →ˡᶜ γ where toTr := g ∘ f map_top' := by simp map_bot' := by simp @@ -277,7 +277,7 @@ section «lp_section_4» variable {α β : Type*} [LogicalConnective α] [LogicalConnective β] /-- Imported declaration from the Incompleteness formalization. -/ -def conjLt (φ : ℕ → α) : ℕ → α +@[expose] def conjLt (φ : ℕ → α) : ℕ → α | 0 => ⊤ | k + 1 => φ k ⋏ conjLt φ k @@ -303,7 +303,7 @@ def conjLt (φ : ℕ → α) : ℕ → α exact ⟨h k (by simp), fun i hi ↦ h i (Nat.lt_add_right 1 hi)⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def disjLt (φ : ℕ → α) : ℕ → α +@[expose] def disjLt (φ : ℕ → α) : ℕ → α | 0 => ⊥ | k + 1 => φ k ⋎ disjLt φ k @@ -341,7 +341,7 @@ variable {α : Type*} variable [LogicalConnective α] [LogicalConnective β] /-- Imported declaration from the Incompleteness formalization. -/ -def conjVec : {n : ℕ} → (Fin n → α) → α +@[expose] def conjVec : {n : ℕ} → (Fin n → α) → α | 0, _ => ⊤ | _ + 1, v => v 0 ⋏ conjVec (vecTail v) @@ -372,7 +372,7 @@ lemma hom_conj₂ [FunLike F α β] [LogicalConnective.HomClass F α β] (f : F) hom_conj f v /-- Imported declaration from the Incompleteness formalization. -/ -def disj : {n : ℕ} → (Fin n → α) → α +@[expose] def disj : {n : ℕ} → (Fin n → α) → α | 0, _ => ⊥ | _ + 1, v => v 0 ⋎ disj (vecTail v) @@ -414,7 +414,7 @@ section «lp_section_6» variable {α : Type*} [LogicalConnective α] /-- Imported declaration from the Incompleteness formalization. -/ -def conj : List α → α +@[expose] def conj : List α → α | [] => ⊤ | a :: as => a ⋏ as.conj @@ -432,7 +432,7 @@ lemma map_conj_append [FunLike F α Prop] [LogicalConnective.HomClass F α Prop] induction l₁ <;> induction l₂ <;> aesop; /-- Imported declaration from the Incompleteness formalization. -/ -def disj : List α → α +@[expose] def disj : List α → α | [] => ⊥ | a :: as => a ⋎ as.disj @@ -457,7 +457,7 @@ variable {F : Type u} [LogicalConnective F] variable {φ ψ : F} /-- Remark: `[φ].conj₂ = φ ≠ φ ⋏ ⊤ = [φ].conj` -/ -def conj₂ : List F → F +@[expose] def conj₂ : List F → F | [] => ⊤ | [φ] => φ | φ :: ψ :: rs => φ ⋏ (ψ :: rs).conj₂ @@ -478,7 +478,7 @@ prefix:80 "⋀" => List.conj₂ | cons ψ rs => simp [List.conj₂] /-- Remark: `[φ].disj = φ ≠ φ ⋎ ⊥ = [φ].disj` -/ -def disj₂ : List F → F +@[expose] def disj₂ : List F → F | [] => ⊥ | [φ] => φ | φ :: ψ :: rs => φ ⋎ (ψ :: rs).disj₂ @@ -509,7 +509,7 @@ section «lp_section_8» variable [LogicalConnective α] /-- Imported declaration from the Incompleteness formalization. -/ -noncomputable def conj (s : Finset α) : α := s.toList.conj +@[expose] noncomputable def conj (s : Finset α) : α := s.toList.conj lemma map_conj [FunLike F α Prop] [LogicalConnective.HomClass F α Prop] (f : F) (s : Finset α) : f s.conj ↔ ∀ a ∈ s, f a := by @@ -522,7 +522,7 @@ lemma map_conj_union [DecidableEq α] [FunLike F α Prop] [LogicalConnective.Hom aesop /-- Imported declaration from the Incompleteness formalization. -/ -noncomputable def disj (s : Finset α) : α := s.toList.disj +@[expose] noncomputable def disj (s : Finset α) : α := s.toList.disj lemma map_disj [FunLike F α Prop] [LogicalConnective.HomClass F α Prop] (f : F) (s : Finset α) : f s.disj ↔ ∃ a ∈ s, f a := by diff --git a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Language.lean b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Language.lean index 1855e74406..ac5a83b47c 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Language.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Language.lean @@ -21,7 +21,7 @@ This file defines the language of first-order logic. - `LO.FirstOrder.Language.oRing`, `ℒₒᵣ` is the language of ordered ring. -/ -@[expose] public section +public section namespace LO @@ -87,7 +87,7 @@ inductive EqRel : ℕ → Type | equal : EqRel 2 /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] +@[expose, reducible] def equal : Language where Func := fun _ => Empty Rel := EqRel @@ -127,8 +127,7 @@ inductive Rel : ℕ → Type end ORing /-- Imported declaration from the Incompleteness formalization. -/ -@[reducible] -def oRing : Language where +@[expose, reducible] def oRing : Language where Func := ORing.Func Rel := ORing.Rel @@ -263,7 +262,8 @@ section «lp_section_1» variable (C : Type*) /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.FirstOrder.Language.constLang : Language := ⟨Constant.Func C, fun _ => PEmpty⟩ +@[expose] def _root_.LO.FirstOrder.Language.constLang : Language := + ⟨Constant.Func C, fun _ => PEmpty⟩ --instance : Coe (Type*) Language := ⟨constLang⟩ @@ -282,13 +282,14 @@ end «lp_section_1» def ofFunc (F : ℕ → Type v) : Language := ⟨F, fun _ => PEmpty⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def add (L₁ : Language.{u₁}) (L₂ : Language.{u₂}) : Language := +@[expose] def add (L₁ : Language.{u₁}) (L₂ : Language.{u₂}) : Language := ⟨fun k => L₁.Func k ⊕ L₂.Func k, fun k => L₁.Rel k ⊕ L₂.Rel k⟩ instance : _root_.Add Language := ⟨add⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def sigma (L : ι → Language) : Language := ⟨fun k => Σ i, (L i).Func k, fun k => Σ i, (L i).Rel k⟩ +@[expose] def sigma (L : ι → Language) : Language := + ⟨fun k => Σ i, (L i).Func k, fun k => Σ i, (L i).Rel k⟩ /-- Imported declaration from the Incompleteness formalization. -/ protected class Eq (L : Language) where @@ -406,10 +407,10 @@ def comp (Ψ : L₂ →ᵥ L₃) (Φ : L₁ →ᵥ L₂) : L₁ →ᵥ L₃ wher rel := Ψ.rel ∘ Φ.rel /-- Imported declaration from the Incompleteness formalization. -/ -def add₁ (L₁ : Language) (L₂ : Language) : L₁ →ᵥ L₁.add L₂ := ⟨Sum.inl, Sum.inl⟩ +@[expose] def add₁ (L₁ : Language) (L₂ : Language) : L₁ →ᵥ L₁.add L₂ := ⟨Sum.inl, Sum.inl⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def add₂ (L₁ : Language) (L₂ : Language) : L₂ →ᵥ L₁.add L₂ := ⟨Sum.inr, Sum.inr⟩ +@[expose] def add₂ (L₁ : Language) (L₂ : Language) : L₂ →ᵥ L₁.add L₂ := ⟨Sum.inr, Sum.inr⟩ /-- Imported declaration from the Incompleteness formalization. -/ lemma func_add₁ (L₁ : Language) (L₂ : Language) (f : L₁.Func k) : @@ -446,7 +447,8 @@ lemma rel_add₂ (L₁ : Language) (L₂ : Language) (r : L₂.Rel k) : (add₁ L₁ L₂).rel LT.lt = LT.lt := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def sigma (L : ι → Language) (i : ι) : L i →ᵥ Language.sigma L := ⟨fun f => ⟨i, f⟩, fun r => ⟨i, r⟩⟩ +@[expose] def sigma (L : ι → Language) (i : ι) : L i →ᵥ Language.sigma L := + ⟨fun f => ⟨i, f⟩, fun r => ⟨i, r⟩⟩ lemma func_sigma (L : ι → Language) (i : ι) (f : (L i).Func k) : (sigma L i).func f = ⟨i, f⟩ := rfl diff --git a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Quantifier.lean b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Quantifier.lean index 2138f530fd..84b5bb4f84 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Quantifier.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Quantifier.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.Bound.Init /-! # Quantifier -/ -@[expose] public section +public section @@ -54,7 +54,7 @@ instance : SigmaSymbol Polarity := ⟨sigma⟩ instance : PiSymbol Polarity := ⟨pi⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def alt : Polarity → Polarity +@[expose] def alt : Polarity → Polarity | Sg => Pg | Pg => Sg @@ -82,7 +82,7 @@ instance : PiSymbol SigmaPiDelta := ⟨pi⟩ instance : DeltaSymbol SigmaPiDelta := ⟨delta⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def alt : SigmaPiDelta → SigmaPiDelta +@[expose] def alt : SigmaPiDelta → SigmaPiDelta | Sg => Pg | Pg => Sg | Dlt => Dlt @@ -141,7 +141,7 @@ section «lp_section_1» variable {α : ℕ → Type*} [UnivQuantifier α] [ExQuantifier α] /-- Imported declaration from the Incompleteness formalization. -/ -def quant : Polarity → α (n + 1) → α n +@[expose] def quant : Polarity → α (n + 1) → α n | Sg, φ => ∃' φ | Pg, φ => ∀' φ @@ -156,7 +156,7 @@ section «lp_section_2» variable {α : ℕ → Type*} [UnivQuantifier α] /-- Imported declaration from the Incompleteness formalization. -/ -def univClosure : {n : ℕ} → α n → α 0 +@[expose] def univClosure : {n : ℕ} → α n → α 0 | 0, a => a | _ + 1, a => univClosure (∀' a) @@ -168,7 +168,7 @@ prefix:64 "∀* " => univClosure lemma univClosure_succ {n} (a : α (n + 1)) : ∀* a = ∀* ∀' a := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def univItr : (k : ℕ) → α (n + k) → α n +@[expose] def univItr : (k : ℕ) → α (n + k) → α n | 0, a => a | k + 1, a => univItr k (∀' a) @@ -188,7 +188,7 @@ section «lp_section_3» variable {α : ℕ → Type*} [ExQuantifier α] /-- Imported declaration from the Incompleteness formalization. -/ -def exClosure : {n : ℕ} → α n → α 0 +@[expose] def exClosure : {n : ℕ} → α n → α 0 | 0, a => a | _ + 1, a => exClosure (∃' a) @@ -200,7 +200,7 @@ prefix:64 "∃* " => exClosure lemma exClosure_succ {n} (a : α (n + 1)) : ∃* a = ∃* ∃' a := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def exItr : (k : ℕ) → α (n + k) → α n +@[expose] def exItr : (k : ℕ) → α (n + k) → α n | 0, a => a | k + 1, a => exItr k (∃' a) @@ -220,10 +220,11 @@ section «lp_section_4» variable {α : ℕ → Type*} /-- Imported declaration from the Incompleteness formalization. -/ -def ball [UnivQuantifier α] [Arrow (α (n + 1))] (φ : α (n + 1)) (ψ : α (n + 1)) : α n := +@[expose] def ball [UnivQuantifier α] [Arrow (α (n + 1))] (φ : α (n + 1)) (ψ : α (n + 1)) : α n := ∀' (φ ==> ψ) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def bex [ExQuantifier α] [Wedge (α (n + 1))] (φ : α (n + 1)) (ψ : α (n + 1)) : α n := ∃' (φ ⋏ ψ) /-- Imported declaration from the Incompleteness formalization. -/ diff --git a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Rew.lean b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Rew.lean index d1ddd60f40..e70883ef15 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Rew.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Rew.lean @@ -29,7 +29,7 @@ Rewritings `LO.FirstOrder.Rew` is naturally converted to formula Rewritings by -/ -@[expose] public section +public section namespace LO @@ -90,13 +90,14 @@ lemma func'' {k} (f : L.Func k) (v : Fin k → Semiterm L ξ₁ n₁) : lemma ext' {ω₁ ω₂ : Rew L ξ₁ n₁ ξ₂ n₂} (h : ω₁ = ω₂) (t) : ω₁ t = ω₂ t := by simp[h] /-- Imported declaration from the Incompleteness formalization. -/ -protected def id : Rew L ξ n ξ n where +@[expose] protected def id : Rew L ξ n ξ n where toFun := id func' := fun _ _ => rfl @[simp] lemma id_app (t : Semiterm L ξ n) : Rew.id t = t := rfl /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] protected def comp (ω₂ : Rew L ξ₂ n₂ ξ₃ n₃) (ω₁ : Rew L ξ₁ n₁ ξ₂ n₂) : Rew L ξ₁ n₁ ξ₃ n₃ where toFun := fun t => ω₂ (ω₁ t) func' := fun f v => by simp[func'']; rfl @@ -109,32 +110,33 @@ lemma comp_app (ω₂ : Rew L ξ₂ n₂ ξ₃ n₃) (ω₁ : Rew L ξ₁ n₁ @[simp] lemma comp_id (ω : Rew L ξ₁ n₁ ξ₂ n₂) : ω.comp Rew.id = ω := by ext <;> simp[comp_app] /-- Imported declaration from the Incompleteness formalization. -/ -def bindAux (b : Fin n₁ → Semiterm L ξ₂ n₂) (e : ξ₁ → Semiterm L ξ₂ n₂) : +@[expose] def bindAux (b : Fin n₁ → Semiterm L ξ₂ n₂) (e : ξ₁ → Semiterm L ξ₂ n₂) : Semiterm L ξ₁ n₁ → Semiterm L ξ₂ n₂ | (#x) => b x | (&x) => e x | (func f v) => func f (fun i => bindAux b e (v i)) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def bind (b : Fin n₁ → Semiterm L ξ₂ n₂) (e : ξ₁ → Semiterm L ξ₂ n₂) : Rew L ξ₁ n₁ ξ₂ n₂ where toFun := bindAux b e func' := fun _ _ => rfl /-- Imported declaration from the Incompleteness formalization. -/ -def rewrite (f : ξ₁ → Semiterm L ξ₂ n) : Rew L ξ₁ n ξ₂ n := bind Semiterm.bvar f +@[expose] def rewrite (f : ξ₁ → Semiterm L ξ₂ n) : Rew L ξ₁ n ξ₂ n := bind Semiterm.bvar f /-- Imported declaration from the Incompleteness formalization. -/ -def rewriteMap (e : ξ₁ → ξ₂) : Rew L ξ₁ n ξ₂ n := rewrite (fun m => &(e m)) +@[expose] def rewriteMap (e : ξ₁ → ξ₂) : Rew L ξ₁ n ξ₂ n := rewrite (fun m => &(e m)) /-- Imported declaration from the Incompleteness formalization. -/ -def map (b : Fin n₁ → Fin n₂) (e : ξ₁ → ξ₂) : Rew L ξ₁ n₁ ξ₂ n₂ := +@[expose] def map (b : Fin n₁ → Fin n₂) (e : ξ₁ → ξ₂) : Rew L ξ₁ n₁ ξ₂ n₂ := bind (fun n => #(b n)) (fun m => &(e m)) /-- Imported declaration from the Incompleteness formalization. -/ -def substs {n'} (v : Fin n → Semiterm L ξ n') : Rew L ξ n ξ n' := bind v fvar +@[expose] def substs {n'} (v : Fin n → Semiterm L ξ n') : Rew L ξ n ξ n' := bind v fvar /-- Imported declaration from the Incompleteness formalization. -/ -def emb {o : Type v₁} [h : IsEmpty o] {ξ : Type v₂} {n} : Rew L o n ξ n := map id h.elim +@[expose] def emb {o : Type v₁} [h : IsEmpty o] {ξ : Type v₂} {n} : Rew L o n ξ n := map id h.elim /-- Imported declaration from the Incompleteness formalization. -/ abbrev embs {o : Type v₁} [IsEmpty o] {n} : Rew L o n ℕ n := emb @@ -143,28 +145,29 @@ abbrev embs {o : Type v₁} [IsEmpty o] {n} : Rew L o n ℕ n := emb def empty {o : Type v₁} [h : IsEmpty o] {ξ : Type v₂} {n} : Rew L o 0 ξ n := map Fin.elim0 h.elim /-- Imported declaration from the Incompleteness formalization. -/ -def bShift : Rew L ξ n ξ (n + 1) := map Fin.succ id +@[expose] def bShift : Rew L ξ n ξ (n + 1) := map Fin.succ id /-- Imported declaration from the Incompleteness formalization. -/ -def bShiftAdd (m : ℕ) : Rew L ξ n ξ (n + m) := map (Fin.addNat · m) id +@[expose] def bShiftAdd (m : ℕ) : Rew L ξ n ξ (n + m) := map (Fin.addNat · m) id /-- Imported declaration from the Incompleteness formalization. -/ -def cast {n n' : ℕ} (h : n = n') : Rew L ξ n ξ n' := map (Fin.cast h) id +@[expose] def cast {n n' : ℕ} (h : n = n') : Rew L ξ n ξ n' := map (Fin.cast h) id /-- Imported declaration from the Incompleteness formalization. -/ -def castLE {n n' : ℕ} (h : n ≤ n') : Rew L ξ n ξ n' := map (Fin.castLE h) id +@[expose] def castLE {n n' : ℕ} (h : n ≤ n') : Rew L ξ n ξ n' := map (Fin.castLE h) id /-- Imported declaration from the Incompleteness formalization. -/ -def toS : Rew L (Fin n) 0 Empty n := Rew.bind ![] (#·) +@[expose] def toS : Rew L (Fin n) 0 Empty n := Rew.bind ![] (#·) /-- Imported declaration from the Incompleteness formalization. -/ -def toF : Rew L Empty n (Fin n) 0 := Rew.bind (&·) Empty.elim +@[expose] def toF : Rew L Empty n (Fin n) 0 := Rew.bind (&·) Empty.elim /-- Imported declaration from the Incompleteness formalization. -/ -def embSubsts (v : Fin k → Semiterm L ξ n) : Rew L Empty k ξ n := Rew.bind v Empty.elim +@[expose] def embSubsts (v : Fin k → Semiterm L ξ n) : Rew L Empty k ξ n := + Rew.bind v Empty.elim /-- Imported declaration from the Incompleteness formalization. -/ -protected def q (ω : Rew L ξ₁ n₁ ξ₂ n₂) : Rew L ξ₁ (n₁ + 1) ξ₂ (n₂ + 1) := +@[expose] protected def q (ω : Rew L ξ₁ n₁ ξ₂ n₂) : Rew L ξ₁ (n₁ + 1) ξ₂ (n₂ + 1) := bind (#0 :> bShift ∘ ω ∘ bvar) (bShift ∘ ω ∘ fvar) lemma eq_id_of_eq {ω : Rew L ξ n ξ n} (hb : ∀ x, ω #x = #x) (he : ∀ x, ω &x = &x) (t) : @@ -173,7 +176,7 @@ lemma eq_id_of_eq {ω : Rew L ξ n ξ n} (hb : ∀ x, ω #x = #x) (he : ∀ x, simp[this] /-- Imported declaration from the Incompleteness formalization. -/ -def qpow (ω : Rew L ξ₁ n₁ ξ₂ n₂) : (k : ℕ) → Rew L ξ₁ (n₁ + k) ξ₂ (n₂ + k) +@[expose] def qpow (ω : Rew L ξ₁ n₁ ξ₂ n₂) : (k : ℕ) → Rew L ξ₁ (n₁ + k) ξ₂ (n₂ + k) | 0 => ω | k + 1 => (ω.qpow k).q @@ -521,7 +524,7 @@ section «lp_section_14» -/ /-- Imported declaration from the Incompleteness formalization. -/ -def shift : SyntacticRew L n n := map id Nat.succ +@[expose] def shift : SyntacticRew L n n := map id Nat.succ /- #0 #1 ... #(n - 1) #n &0 &1 ... @@ -530,9 +533,10 @@ def shift : SyntacticRew L n n := map id Nat.succ -/ /-- Imported declaration from the Incompleteness formalization. -/ -def free : SyntacticRew L (n + 1) n := bind (bvar <: &0) (fun m => &(Nat.succ m)) +@[expose] def free : SyntacticRew L (n + 1) n := bind (bvar <: &0) (fun m => &(Nat.succ m)) /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def fix : SyntacticRew L n (n + 1) := bind (fun x => #(Fin.castSucc x)) (#(Fin.last n) :>ₙ fvar) /-- Imported declaration from the Incompleteness formalization. -/ @@ -886,7 +890,7 @@ lemma «fvar?_rew» [DecidableEq ξ₁] [DecidableEq ξ₂] induction t <;> simp [Rew.func, *] /-- Imported declaration from the Incompleteness formalization. -/ -def toEmpty [DecidableEq ξ] {n : ℕ} : (t : +@[expose] def toEmpty [DecidableEq ξ] {n : ℕ} : (t : Semiterm L ξ n) → t.freeVariables = ∅ → Semiterm L Empty n | #x, _ => #x | &x, h => by simp at h @@ -963,7 +967,7 @@ abbrev free [Rewriting L ℕ F ℕ F] (φ : F (n + 1)) : F n := @Rew.free L n abbrev fix [Rewriting L ℕ F ℕ F] (φ : F n) : F (n + 1) := @Rew.fix L n ▹ φ /-- Imported declaration from the Incompleteness formalization. -/ -def shifts [Rewriting L ℕ F ℕ F] (Γ : List (F n)) : List (F n) := Γ.map Rewriting.shift +@[expose] def shifts [Rewriting L ℕ F ℕ F] (Γ : List (F n)) : List (F n) := Γ.map Rewriting.shift /-- Imported declaration from the Incompleteness formalization. -/ scoped[LO.FirstOrder] postfix:max "⁺" => FirstOrder.Rewriting.shifts @@ -1113,7 +1117,7 @@ lemma rewrite_free_eq_subst (t : SyntacticTerm L) (φ : S 1) : simpa [←comp_app] using smul_ext' <| by ext x <;> simp [Rew.comp_app, Fin.fin_one_eq_zero] /-- Imported declaration from the Incompleteness formalization. -/ -def shiftEmb : S n ↪ S n where +@[expose] def shiftEmb : S n ↪ S n where toFun := shift inj' := shift_injective diff --git a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Term.lean b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Term.lean index e2615db869..1874a0ea1b 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Predicate/Term.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Predicate/Term.lean @@ -22,7 +22,7 @@ variables of `ξ`. -/ -@[expose] public section +public section namespace LO @@ -102,7 +102,7 @@ instance : DecidableEq (Semiterm L ξ n) := hasDecEq end «lp_section_2» /-- Imported declaration from the Incompleteness formalization. -/ -def complexity : Semiterm L ξ n → ℕ +@[expose] def complexity : Semiterm L ξ n → ℕ | #_ => 0 | &_ => 0 | func _ v => Finset.sup Finset.univ (fun i ↦ complexity (v i)) + 1 @@ -124,7 +124,7 @@ lemma complexity_func {k} (f : L.Func k) (v : Fin k → Semiterm L ξ n) : abbrev «func!» (k) (f : L.Func k) (v : Fin k → Semiterm L ξ n) := func f v /-- Imported declaration from the Incompleteness formalization. -/ -def bv : Semiterm L ξ n → Finset (Fin n) +@[expose] def bv : Semiterm L ξ n → Finset (Fin n) | #x => {x} | &_ => ∅ | func _ v => .biUnion .univ fun i ↦ bv (v i) @@ -140,7 +140,7 @@ lemma bv_func {k} (f : L.Func k) (v : Fin k → Semiterm L ξ n) : @[simp] lemma bv_constant (f : L.Func 0) (v : Fin 0 → Semiterm L ξ n) : (func f v).bv = ∅ := rfl /-- Imported declaration from the Incompleteness formalization. -/ -def Positive (t : Semiterm L ξ (n + 1)) : Prop := ∀ x ∈ t.bv, 0 < x +@[expose] def Positive (t : Semiterm L ξ (n + 1)) : Prop := ∀ x ∈ t.bv, 0 < x namespace Positive @@ -173,7 +173,7 @@ section «lp_section_3» variable [DecidableEq ξ] /-- Imported declaration from the Incompleteness formalization. -/ -def freeVariables : Semiterm L ξ n → Finset ξ +@[expose] def freeVariables : Semiterm L ξ n → Finset ξ | #_ => ∅ | &x => {x} | func _ v => .biUnion .univ fun i ↦ freeVariables (v i) @@ -209,7 +209,7 @@ section «lp_section_4» variable (Φ : L₁ →ᵥ L₂) /-- Imported declaration from the Incompleteness formalization. -/ -def lMap (Φ : L₁ →ᵥ L₂) : Semiterm L₁ ξ n → Semiterm L₂ ξ n +@[expose] def lMap (Φ : L₁ →ᵥ L₂) : Semiterm L₁ ξ n → Semiterm L₂ ξ n | #x => #x | &x => &x | func f v => func (Φ.func f) (fun i => lMap Φ (v i)) diff --git a/LeanPool/Incompleteness/Foundation/Logic/Semantics.lean b/LeanPool/Incompleteness/Foundation/Logic/Semantics.lean index 7015b7f122..87e5d36f60 100644 --- a/LeanPool/Incompleteness/Foundation/Logic/Semantics.lean +++ b/LeanPool/Incompleteness/Foundation/Logic/Semantics.lean @@ -25,7 +25,7 @@ Also provides 𝓜 characterization of compactness. -/ -@[expose] public section +public section namespace LO @@ -121,18 +121,18 @@ infix:45 " ⊧* " => RealizeSet variable (M) /-- Imported declaration from the Incompleteness formalization. -/ -def Valid (f : F) : Prop := ∀ 𝓜 : M, 𝓜 ⊧ f +@[expose] def Valid (f : F) : Prop := ∀ 𝓜 : M, 𝓜 ⊧ f /-- Imported declaration from the Incompleteness formalization. -/ -def Satisfiable (T : Set F) : Prop := ∃ 𝓜 : M, 𝓜 ⊧* T +@[expose] def Satisfiable (T : Set F) : Prop := ∃ 𝓜 : M, 𝓜 ⊧* T /-- Imported declaration from the Incompleteness formalization. -/ -def models (T : Set F) : Set M := {𝓜 | 𝓜 ⊧* T} +@[expose] def models (T : Set F) : Set M := {𝓜 | 𝓜 ⊧* T} variable {M} /-- Imported declaration from the Incompleteness formalization. -/ -def theory (𝓜 : M) : Set F := {φ | 𝓜 ⊧ φ} +@[expose] def theory (𝓜 : M) : Set F := {φ | 𝓜 ⊧ φ} /-- Imported declaration from the Incompleteness formalization. -/ class Meaningful (𝓜 : M) : Prop where @@ -200,7 +200,7 @@ instance : Semantics F (Set M) := ⟨fun s f ↦ ∀ ⦃𝓜⦄, 𝓜 ∈ s → @[simp] lemma empty_models (f : F) : (∅ : Set M) ⊧ f := by rintro h; simp /-- Imported declaration from the Incompleteness formalization. -/ -def Consequence (T : Set F) (f : F) : Prop := models M T ⊧ f +@[expose] def Consequence (T : Set F) (f : F) : Prop := models M T ⊧ f -- note that ⊨ (\vDash) is *NOT* ⊧ (\models) /-- Imported declaration from the Incompleteness formalization. -/ diff --git a/LeanPool/Incompleteness/Foundation/Modal/Axioms.lean b/LeanPool/Incompleteness/Foundation/Modal/Axioms.lean index ca8f939a34..3f19d95f82 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Axioms.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Axioms.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Bound.Init /-! # Axioms -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Complement.lean b/LeanPool/Incompleteness/Foundation/Modal/Complement.lean index 2661e254e5..f5bed21a10 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Complement.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Complement.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Subformulas /-! # Complement -/ -@[expose] public section +public section @@ -20,7 +20,7 @@ namespace Modal namespace Formula /-- Imported declaration from the Incompleteness formalization. -/ -def complement : Formula α → Formula α +@[expose] def complement : Formula α → Formula α | ∼φ => φ | φ => ∼φ /-- Imported declaration from the Incompleteness formalization. -/ @@ -71,6 +71,7 @@ namespace FormulaFinset variable [DecidableEq α] /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def complementary (P : FormulaFinset α) : FormulaFinset α := P ∪ (P.image (Formula.complement)) /-- Imported declaration from the Incompleteness formalization. -/ postfix:80 "⁻" => complementary diff --git a/LeanPool/Incompleteness/Foundation/Modal/ComplementClosedConsistentFinset.lean b/LeanPool/Incompleteness/Foundation/Modal/ComplementClosedConsistentFinset.lean index fe77a1d0f6..d9c88341e7 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/ComplementClosedConsistentFinset.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/ComplementClosedConsistentFinset.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Finset.Powerset /-! # ComplementClosedConsistentFinset -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/Basic.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/Basic.lean index 25827bb972..6371f3e439 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/Basic.lean @@ -11,7 +11,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Context /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/GL.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/GL.lean index 47c025681b..64e45bca86 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/GL.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/GL.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.K4 /-! # GL -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/Grz.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/Grz.lean index a7a2aa7027..7815154b4e 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/Grz.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/Grz.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.K /-! # Grz -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/K.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/K.lean index c3e15b4c35..1972cbf4d1 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/K.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/K.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Supplemental /-! # K -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/K4.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/K4.lean index aecfc2f03f..a5e5fc861b 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/K4.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/K4.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.K /-! # K4 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/K5.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/K5.lean index c9c22e195a..aa3bfaa5ed 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/K5.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/K5.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.SetLike /-! # K5 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KD.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KD.lean index e8da81e861..9a12af3623 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KD.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KD.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.Basic /-! # KD -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KP.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KP.lean index 48321a6755..e42df0dcfe 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KP.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KP.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.K /-! # KP -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KT.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KT.lean index 2e76f9de33..c7e964ec55 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KT.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KT.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.KP /-! # KT -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KTc.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KTc.lean index ca2becd243..46d7376cc2 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/KTc.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/KTc.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.K /-! # KTc -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/S5.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/S5.lean index b837d8aa8f..062b722aac 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/S5.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/S5.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.K /-! # S5 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Entailment/Triv.lean b/LeanPool/Incompleteness/Foundation/Modal/Entailment/Triv.lean index aca4736533..7dc1d68cb2 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Entailment/Triv.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Entailment/Triv.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Entailment.Basic /-! # Triv -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Formula.lean b/LeanPool/Incompleteness/Foundation/Modal/Formula.lean index cc1d4990c1..c614072d22 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Formula.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Formula.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.LogicSymbol /-! # Formula -/ -@[expose] public section +public section namespace LO @@ -131,14 +131,14 @@ instance : ModalDeMorgan (Formula α) where -/ /-- Formula complexity -/ -def complexity : Formula α → ℕ +@[expose] def complexity : Formula α → ℕ | atom _ => 0 | ⊥ => 0 | φ ==> ψ => max φ.complexity ψ.complexity + 1 | □φ => φ.complexity + 1 /-- Max numbers of `□` -/ -def degree : Formula α → Nat +@[expose] def degree : Formula α → Nat | atom _ => 0 | ⊥ => 0 | φ ==> ψ => max φ.degree ψ.degree diff --git a/LeanPool/Incompleteness/Foundation/Modal/Geachean.lean b/LeanPool/Incompleteness/Foundation/Modal/Geachean.lean index 9221f04ac3..5e42e651bc 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Geachean.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Geachean.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.SetLike /-! # Geachean -/ -@[expose] public section +public section /-- Imported declaration from the Incompleteness formalization. -/ @@ -29,7 +29,7 @@ structure Geachean.Taple where n : ℕ /-- Imported declaration from the Incompleteness formalization. -/ -def Geachean (t : Geachean.Taple) (R : Rel α α) := ∀ {x y z : +@[expose] def Geachean (t : Geachean.Taple) (R : Rel α α) := ∀ {x y z : α}, (R.iterate t.i x y) ∧ (R.iterate t.j x z) → ∃ u, (R.iterate t.m y u) ∧ (R.iterate t.n z u) @@ -96,4 +96,4 @@ end Geachean /-- Imported declaration from the Incompleteness formalization. -/ -def MultiGeachean (G : Set Geachean.Taple) (R : Rel α α) := ∀ g ∈ G, Geachean g R +@[expose] def MultiGeachean (G : Set Geachean.Taple) (R : Rel α α) := ∀ g ∈ G, Geachean g R diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Basic.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Basic.lean index d64cedfd79..4733643b10 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Basic.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Logic.HilbertStyle.Supplemental /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Geach.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Geach.lean index dd656b1445..9e2ddc6025 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Geach.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Geach.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Hilbert.WellKnown /-! # Geach -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/K.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/K.lean index 5f9680663a..b2c3a02d1d 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/K.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/K.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Hilbert.Basic /-! # K -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Basic.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Basic.lean index 069e3a5b62..16f7a9702a 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Basic.lean @@ -11,7 +11,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.IntProp /-! # Basic -/ -@[expose] public section +public section namespace LO @@ -22,7 +22,7 @@ variable {α} [DecidableEq α] namespace Formula /-- Imported declaration from the Incompleteness formalization. -/ -def TrivTranslation : Formula α → Formula α +@[expose] def TrivTranslation : Formula α → Formula α | .atom a => atom a | □φ => φ.TrivTranslation | ⊥ => ⊥ @@ -45,7 +45,7 @@ end TrivTranslation /-- Imported declaration from the Incompleteness formalization. -/ -def VerTranslation : Formula α → Formula α +@[expose] def VerTranslation : Formula α → Formula α | atom a => atom a | □_ => ⊤ | ⊥ => ⊥ diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Unprovability.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Unprovability.lean index 2a8f6111dc..e7525b71a7 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Unprovability.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/Maximal/Unprovability.lean @@ -10,7 +10,7 @@ import LeanPool.Incompleteness.Foundation.IntProp.Kripke.Hilbert.Cl.Classical /-! # Unprovability -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/S5Grz.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/S5Grz.lean index 1392834a7a..5c4a5bbbfa 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/S5Grz.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/S5Grz.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Entailment.Triv /-! # S5Grz -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/WellKnown.lean b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/WellKnown.lean index ddc19bb746..b2ad2d37a5 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Hilbert/WellKnown.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Hilbert/WellKnown.lean @@ -10,7 +10,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Entailment.Grz /-! # WellKnown -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/IntProp.lean b/LeanPool/Incompleteness/Foundation/Modal/IntProp.lean index 12bfeddaaa..592cdfbaba 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/IntProp.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/IntProp.lean @@ -10,13 +10,14 @@ public import LeanPool.Incompleteness.Foundation.Modal.Formula /-! # IntProp -/ -@[expose] public section +public section namespace LO namespace IntProp /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.IntProp.Formula.toModalFormula : Formula α → Modal.Formula α | .atom a => Modal.Formula.atom a | ⊥ => ⊥ @@ -54,7 +55,7 @@ namespace LO namespace Modal /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.Modal.Formula.toPropFormula (φ : Formula α) (_ : φ.degree = 0 := +@[expose] def _root_.LO.Modal.Formula.toPropFormula (φ : Formula α) (_ : φ.degree = 0 := by simp_all [Formula.degree, Formula.degree_neg, Formula.degree_imp]) : IntProp.Formula α := match φ with diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomDot3.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomDot3.lean index c2956f9151..ecc4f161ed 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomDot3.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomDot3.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.Basic /-! # AxiomDot3 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomGrz.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomGrz.lean index 7bada31cbb..d001820f57 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomGrz.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomGrz.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.TautoSet /-! # AxiomGrz -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomL.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomL.lean index 42f55c804a..f91f232d45 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomL.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomL.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.FiniteFrame /-! # AxiomL -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomVer.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomVer.lean index e8897b9476..44e82a4eba 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomVer.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/AxiomVer.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.Basic /-! # AxiomVer -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Basic.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Basic.lean index af26612279..c197bf2e98 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Basic.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Substitution /-! # Basic -/ -@[expose] public section +public section namespace LO @@ -69,7 +69,7 @@ namespace Formula namespace Kripke /-- Imported declaration from the Incompleteness formalization. -/ -def Satisfies (M : Kripke.Model) (x : M.World) : Formula ℕ → Prop +@[expose] def Satisfies (M : Kripke.Model) (x : M.World) : Formula ℕ → Prop | atom a => M x a | ⊥ => False | φ ==> ψ => (Satisfies M x φ) ==> (Satisfies M x ψ) @@ -183,7 +183,7 @@ end Satisfies /-- Imported declaration from the Incompleteness formalization. -/ -def ValidOnModel (M : Kripke.Model) (φ : Formula ℕ) := ∀ x : M.World, x ⊧ φ +@[expose] def ValidOnModel (M : Kripke.Model) (φ : Formula ℕ) := ∀ x : M.World, x ⊧ φ namespace ValidOnModel @@ -248,7 +248,7 @@ end ValidOnModel /-- Imported declaration from the Incompleteness formalization. -/ -def ValidOnFrame (F : Kripke.Frame) (φ : Formula ℕ) := ∀ V, (⟨F, V⟩ : Kripke.Model) ⊧ φ +@[expose] def ValidOnFrame (F : Kripke.Frame) (φ : Formula ℕ) := ∀ V, (⟨F, V⟩ : Kripke.Model) ⊧ φ namespace ValidOnFrame @@ -329,7 +329,7 @@ end ValidOnFrame /-- Imported declaration from the Incompleteness formalization. -/ -def ValidOnFrameClass (C : Kripke.FrameClass) (φ : Formula ℕ) := ∀ {F}, F ∈ C → F ⊧ φ +@[expose] def ValidOnFrameClass (C : Kripke.FrameClass) (φ : Formula ℕ) := ∀ {F}, F ∈ C → F ⊧ φ namespace ValidOnFrameClass diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Closure.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Closure.lean index a7c7240c32..fc9e47c7ca 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Closure.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Closure.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.Basic /-! # Closure -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Completeness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Completeness.lean index ef421ea063..a0eee1ff2e 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Completeness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Completeness.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.TautoSet /-! # Completeness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Filteration.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Filteration.lean index dae7487448..1ab240405e 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Filteration.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Filteration.lean @@ -12,7 +12,7 @@ import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Filteration -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/FiniteFrame.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/FiniteFrame.lean index 95bc879114..da95c6b834 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/FiniteFrame.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/FiniteFrame.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.Basic /-! # FiniteFrame -/ -@[expose] public section +public section namespace LO @@ -37,7 +37,7 @@ def _root_.LO.Modal.Kripke.FrameClass.restrictFinite (C : FrameClass) : FiniteFr FiniteFrame | F.toFrame ∈ C } /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.Modal.Kripke.FiniteFrameClass.toFrameClass (C : FiniteFrameClass) : +@[expose] def _root_.LO.Modal.Kripke.FiniteFrameClass.toFrameClass (C : FiniteFrameClass) : FrameClass := C.image (·.toFrame) @@ -61,7 +61,7 @@ namespace Formula namespace Kripke /-- Imported declaration from the Incompleteness formalization. -/ -def ValidOnFiniteFrame (F : Kripke.FiniteFrame) (φ : Formula ℕ) := F.toFrame ⊧ φ +@[expose] def ValidOnFiniteFrame (F : Kripke.FiniteFrame) (φ : Formula ℕ) := F.toFrame ⊧ φ namespace ValidOnFiniteFrame @@ -103,6 +103,7 @@ end ValidOnFiniteFrame /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def ValidOnFiniteFrameClass (C : Kripke.FiniteFrameClass) (φ : Formula ℕ) := C.toFrameClass ⊧ φ namespace ValidOnFiniteFrameClass diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Completeness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Completeness.lean index 0116af096b..a6d21cc517 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Completeness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Completeness.lean @@ -13,7 +13,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.GL.Soundne /-! # Completeness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/MDP.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/MDP.lean index 55f44a93e6..f6d94c31a0 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/MDP.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/MDP.lean @@ -15,7 +15,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.GL.Unnecessitatio /-! # MDP -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Soundness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Soundness.lean index 70e538761d..0a2fbb46e3 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Soundness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Soundness.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # Soundness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Tree.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Tree.lean index 626523d7fe..03e3c1b60d 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Tree.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Tree.lean @@ -13,7 +13,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.GL.Soundness /-! # Tree -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Unnecessitation.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Unnecessitation.lean index 872ce3e68a..13e085705e 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Unnecessitation.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/GL/Unnecessitation.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.SimpleExtension /-! # Unnecessitation -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Geach.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Geach.lean index 0c4e06dadb..2b686be6cd 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Geach.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Geach.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # Geach -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Completeness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Completeness.lean index 8e883f6d51..46d94a7ce0 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Completeness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Completeness.lean @@ -14,7 +14,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.KT /-! # Completeness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Soundness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Soundness.lean index 20c894783c..70067e8b4d 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Soundness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Grz/Soundness.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # Soundness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K.lean index 0c3a06b07c..65afc803c7 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K.lean @@ -13,7 +13,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # K -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K4.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K4.lean index bcb563670e..3b729d8ccb 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K4.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K4.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # K4 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K45.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K45.lean index 615da1a486..893d019e03 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K45.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K45.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # K45 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K5.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K5.lean index 0b71b3432a..f17cbe4f2e 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K5.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/K5.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # K5 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB.lean index eaaf742d26..00b196d5a0 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KB -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB4.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB4.lean index 078168043a..d9b2c7e6b2 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB4.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB4.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KB4 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB5.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB5.lean index da60fdb205..26a7e5b580 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB5.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KB5.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KB5 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD.lean index 11be5bc70e..b73c759f63 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KD -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD4.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD4.lean index 43d2cfe87e..93f1f6ca09 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD4.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD4.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KD4 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD45.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD45.lean index 3041d02c3a..5eac7e52fd 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD45.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD45.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KD45 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD5.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD5.lean index 00759880c9..a98c7b7613 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD5.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KD5.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KD5 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KDB.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KDB.lean index b6dff65373..38e3296dfa 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KDB.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KDB.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KDB -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT.lean index 05cf223a56..b57c3e9ad2 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KT -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT4B.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT4B.lean index 7a23d47842..5044f1075f 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT4B.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KT4B.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KT4B -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KTB.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KTB.lean index 1a130449b3..9fb3bfc2d0 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KTB.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/KTB.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # KTB -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4.lean index db913be264..41cc693688 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # S4 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot2.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot2.lean index a2d04314be..516a05ffc0 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot2.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot2.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # S4Dot2 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot3.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot3.lean index 599599b035..1a81c96973 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot3.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S4Dot3.lean @@ -14,7 +14,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # S4Dot3 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S5.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S5.lean index cde80c50c4..06a43a4bce 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S5.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/S5.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Preservation /-! # S5 -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Soundness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Soundness.lean index d1a6599af0..e2cbf2336c 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Soundness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Soundness.lean @@ -10,7 +10,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.FiniteFrame /-! # Soundness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Triv.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Triv.lean index eb5164846e..2e584d2ebd 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Triv.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Triv.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Geach /-! # Triv -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Ver.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Ver.lean index 784482d595..748ef26a6d 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Ver.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Hilbert/Ver.lean @@ -12,7 +12,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # Ver -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/KHIncompleteness.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/KHIncompleteness.lean index 0a48229c66..33e547eb83 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/KHIncompleteness.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/KHIncompleteness.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.TautoSet /-! # KHIncompleteness -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Preservation.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Preservation.lean index 33fc71e994..1c70c8d021 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Preservation.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Preservation.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Kripke.Closure /-! # Preservation -/ -@[expose] public section +public section namespace LO @@ -228,7 +228,8 @@ structure RootedFrame extends Kripke.Frame where section «lp_section_4» /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.Modal.Kripke.Frame.PointGenerated (F : Kripke.Frame) (r : F.World) : +@[expose] def _root_.LO.Modal.Kripke.Frame.PointGenerated + (F : Kripke.Frame) (r : F.World) : Kripke.RootedFrame where World := { w | w = r ∨ r ≺ w } Rel x y := x.1 ≺ y.1 @@ -279,7 +280,8 @@ add_decl_doc LO.Modal.Kripke.RootedModel.toRootedFrame /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.LO.Modal.Kripke.Model.PointGenerated (M : Kripke.Model) (r : M.World) : +@[expose] def _root_.LO.Modal.Kripke.Model.PointGenerated + (M : Kripke.Model) (r : M.World) : Kripke.RootedModel := letI rF := M.toFrame↾r; { diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean index ba6b0f3049..19252dabca 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean @@ -10,7 +10,7 @@ public import Mathlib.Basic.Finite.Sum /-! # SimpleExtension -/ -@[expose] public section +public section namespace LO @@ -18,6 +18,7 @@ namespace Modal namespace Kripke /-- Imported declaration from the Incompleteness formalization. -/ +@[expose] def _root_.LO.Modal.Kripke.FiniteTransitiveTree.SimpleExtension (F : FiniteTransitiveTree) : Kripke.FiniteTransitiveTree where World := Unit ⊕ F.World diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Tree.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Tree.lean index afa035cfe7..4c5ca73eaf 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/Tree.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/Tree.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Vorspiel.Chain /-! # Tree -/ -@[expose] public section +public section namespace LO namespace Modal diff --git a/LeanPool/Incompleteness/Foundation/Modal/Logic/Basic.lean b/LeanPool/Incompleteness/Foundation/Modal/Logic/Basic.lean index 71d1d1cb02..eed5829a72 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Logic/Basic.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Logic/Basic.lean @@ -14,7 +14,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Soundness /-! # Basic -/ -@[expose] public section +public section diff --git a/LeanPool/Incompleteness/Foundation/Modal/Logic/WellKnown.lean b/LeanPool/Incompleteness/Foundation/Modal/Logic/WellKnown.lean index c484f574a1..e2e76f3124 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Logic/WellKnown.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Logic/WellKnown.lean @@ -37,7 +37,7 @@ import LeanPool.Incompleteness.Foundation.Modal.Kripke.Hilbert.Ver /-! # WellKnown -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/LogicSymbol.lean b/LeanPool/Incompleteness/Foundation/Modal/LogicSymbol.lean index 40b29311b6..3333d82419 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/LogicSymbol.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/LogicSymbol.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Bound.Init /-! # LogicSymbol -/ -@[expose] public section +public section open Function diff --git a/LeanPool/Incompleteness/Foundation/Modal/MaximalConsistentSet.lean b/LeanPool/Incompleteness/Foundation/Modal/MaximalConsistentSet.lean index 4120119fb2..260d874003 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/MaximalConsistentSet.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/MaximalConsistentSet.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.TautoSet /-! # MaximalConsistentSet -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Modal/Subformulas.lean b/LeanPool/Incompleteness/Foundation/Modal/Subformulas.lean index de26304443..24da694486 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Subformulas.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Subformulas.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Formula /-! # Subformulas -/ -@[expose] public section +public section diff --git a/LeanPool/Incompleteness/Foundation/Modal/Substitution.lean b/LeanPool/Incompleteness/Foundation/Modal/Substitution.lean index 2774bcfed9..c2696c4577 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Substitution.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Substitution.lean @@ -9,7 +9,7 @@ public import LeanPool.Incompleteness.Foundation.Modal.Formula /-! # Substitution -/ -@[expose] public section +public section namespace LO @@ -26,7 +26,7 @@ namespace Formula variable {φ ψ : Formula α} {s : Substitution α} /-- Imported declaration from the Incompleteness formalization. -/ -def subst (s : Substitution α) : Formula α → Formula α +@[expose] def subst (s : Substitution α) : Formula α → Formula α | atom a => (s a) | ⊥ => ⊥ | □φ => □(φ.subst s) diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/Arith.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/Arith.lean index 3dbee096c1..62248141a9 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/Arith.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/Arith.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Foundation.Vorspiel.Vorspiel /-! # Arith -/ -@[expose] public section +public section open Mathlib List.Vector Part @@ -21,10 +21,10 @@ namespace Nat lemma pos_of_eq_one (h : n = 1) : 0 < n := by simp[h] /-- Imported declaration from the Incompleteness formalization. -/ -def isEqNat (n m : ℕ) : ℕ := if n = m then 1 else 0 +@[expose] def isEqNat (n m : ℕ) : ℕ := if n = m then 1 else 0 /-- Imported declaration from the Incompleteness formalization. -/ -def isLtNat (n m : ℕ) : ℕ := if n < m then 1 else 0 +@[expose] def isLtNat (n m : ℕ) : ℕ := if n < m then 1 else 0 /-- Imported declaration from the Incompleteness formalization. -/ def isLeNat (n m : ℕ) : ℕ := if n ≤ m then 1 else 0 @@ -45,10 +45,10 @@ def isDvdNat (n m : ℕ) : ℕ := if n ∣ m then 1 else 0 0 < isDvdNat n m ↔ n ∣ m := by simp[isDvdNat]; by_cases n ∣ m <;> simp[*] /-- Imported declaration from the Incompleteness formalization. -/ -def inv (n : ℕ) : ℕ := isEqNat n 0 +@[expose] def inv (n : ℕ) : ℕ := isEqNat n 0 /-- Imported declaration from the Incompleteness formalization. -/ -def pos (n : ℕ) : ℕ := isLtNat 0 n +@[expose] def pos (n : ℕ) : ℕ := isLtNat 0 n @[simp] lemma inv_zero : inv 0 = 1 := rfl diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/BinaryRelations.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/BinaryRelations.lean index 183297891f..c57bca05a2 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/BinaryRelations.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/BinaryRelations.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Bound.Init /-! # BinaryRelations -/ -@[expose] public section +public section @@ -24,44 +24,44 @@ variable {α : Type u} (rel : α → α → Prop) local infix:50 " ≺ " => rel /-- Imported declaration from the Incompleteness formalization. -/ -def IsSymmetric := ∀ ⦃x y⦄, x ≺ y → y ≺ x +@[expose] def IsSymmetric := ∀ ⦃x y⦄, x ≺ y → y ≺ x -- NOTE: Another convention uses `x ≺ y → x ≺ z → y ≺ z`. /-- Imported declaration from the Incompleteness formalization. -/ -def Euclidean := ∀ ⦃x y z⦄, x ≺ y → x ≺ z → z ≺ y +@[expose] def Euclidean := ∀ ⦃x y z⦄, x ≺ y → x ≺ z → z ≺ y /-- Imported declaration from the Incompleteness formalization. -/ -def Serial := ∀ x, ∃ y, x ≺ y +@[expose] def Serial := ∀ x, ∃ y, x ≺ y /-- Imported declaration from the Incompleteness formalization. -/ -def Confluent := ∀ ⦃x y z⦄, ((x ≺ y ∧ x ≺ z) → ∃ w, (y ≺ w ∧ z ≺ w)) +@[expose] def Confluent := ∀ ⦃x y z⦄, ((x ≺ y ∧ x ≺ z) → ∃ w, (y ≺ w ∧ z ≺ w)) /-- Imported declaration from the Incompleteness formalization. -/ -def _root_.RelDense := ∀ ⦃x y⦄, x ≺ y → ∃z, x ≺ z ∧ z ≺ y +@[expose] def _root_.RelDense := ∀ ⦃x y⦄, x ≺ y → ∃z, x ≺ z ∧ z ≺ y /-- Imported declaration from the Incompleteness formalization. -/ -def Connected := ∀ ⦃x y z⦄, x ≺ y ∧ x ≺ z → y ≺ z ∨ z ≺ y +@[expose] def Connected := ∀ ⦃x y z⦄, x ≺ y ∧ x ≺ z → y ≺ z ∨ z ≺ y /-- Imported declaration from the Incompleteness formalization. -/ -def Functional := ∀ ⦃x y z⦄, x ≺ y ∧ x ≺ z → y = z +@[expose] def Functional := ∀ ⦃x y z⦄, x ≺ y ∧ x ≺ z → y = z /-- Imported declaration from the Incompleteness formalization. -/ def RightConvergent := ∀ ⦃x y z⦄, x ≺ y ∧ x ≺ z → y ≺ z ∨ z ≺ y ∨ y = z /-- Imported declaration from the Incompleteness formalization. -/ -def Coreflexive := ∀ ⦃x y⦄, x ≺ y → x = y +@[expose] def Coreflexive := ∀ ⦃x y⦄, x ≺ y → x = y /-- Imported declaration from the Incompleteness formalization. -/ def Equality := ∀ ⦃x y⦄, x ≺ y ↔ x = y /-- Imported declaration from the Incompleteness formalization. -/ -def Isolated := ∀ ⦃x y⦄, ¬(x ≺ y) +@[expose] def Isolated := ∀ ⦃x y⦄, ¬(x ≺ y) /-- Imported declaration from the Incompleteness formalization. -/ def Assymetric := ∀ ⦃x y⦄, (x ≺ y) → ¬(y ≺ x) /-- Imported declaration from the Incompleteness formalization. -/ -def Universal := ∀ ⦃x y⦄, x ≺ y +@[expose] def Universal := ∀ ⦃x y⦄, x ≺ y /-- Imported declaration from the Incompleteness formalization. -/ abbrev ConverseWellFounded := WellFounded <| flip (· ≺ ·) @@ -158,7 +158,7 @@ lemma WellFounded.trivial_wellfounded : WellFounded (α := α) (fun _ _ => False ⟨fun a => ⟨a, fun _ h => h.elim⟩⟩ /-- Imported declaration from the Incompleteness formalization. -/ -def Relation.IrreflGen (R : α → α → Prop) := fun x y => x ≠ y ∧ R x y +@[expose] def Relation.IrreflGen (R : α → α → Prop) := fun x y => x ≠ y ∧ R x y /-- Imported declaration from the Incompleteness formalization. -/ diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/Chain.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/Chain.lean index d0b0735825..2b35fdad44 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/Chain.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/Chain.lean @@ -15,7 +15,7 @@ import Mathlib.Data.Fintype.List /-! # Chain -/ -@[expose] public section +public section namespace List diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/Collection.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/Collection.lean index 2f3ea0a077..fb2c8f1c38 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/Collection.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/Collection.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Bound.Init /-! # Collection -/ -@[expose] public section +public section /-- Imported declaration from the Incompleteness formalization. -/ @@ -66,7 +66,7 @@ namespace Collection variable {β α : Type*} [Collection β α] /-- Imported declaration from the Incompleteness formalization. -/ -def set : α → Set β := fun a ↦ {x | x ∈ a} +@[expose] def set : α → Set β := fun a ↦ {x | x ∈ a} @[simp] lemma mem_set_iff {x : β} {a : α} : x ∈ (set a : Set β) ↔ x ∈ a := by simp [set] @@ -93,7 +93,7 @@ lemma subset_antisymm {a b : α} (ha : a ⊆ b) (hb : b ⊆ a) : set a = set b : @[simp] lemma set_cons (z : β) (a : α) : set (cons z a) = insert z (set a) := by ext; simp [set] /-- Imported declaration from the Incompleteness formalization. -/ -def Finite (a : α) : Prop := (set a).Finite +@[expose] def Finite (a : α) : Prop := (set a).Finite @[simp] lemma empty_finite : Finite (∅ : α) := by simp [Finite] diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/ExistsUnique.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/ExistsUnique.lean index 4df7bbd006..8cea040b00 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/ExistsUnique.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/ExistsUnique.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.SetLike /-! # ExistsUnique -/ -@[expose] public section +public section namespace Classical diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/NotationClass.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/NotationClass.lean index a8b18c36be..8e4cda7a9c 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/NotationClass.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/NotationClass.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.SetLike /-! # NotationClass -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/Order.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/Order.lean index 119548eef5..2c2a920e70 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/Order.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/Order.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.SetLike /-! # Order -/ -@[expose] public section +public section section «lp_section_1» @@ -29,7 +29,7 @@ local infix:50 " ≺ " => r def IsInfiniteDescendingChain (c : ℕ → α) : Prop := ∀ i, c (i + 1) ≺ c i /-- Imported declaration from the Incompleteness formalization. -/ -noncomputable def descendingChain (z : α) : ℕ → α +@[expose] noncomputable def descendingChain (z : α) : ℕ → α | 0 => z | (i + 1) => @Classical.epsilon α ⟨z⟩ (fun y => y ≺ descendingChain z i ∧ ¬Acc r y) diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/RelItr.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/RelItr.lean index ed915bfac6..17958b8bde 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/RelItr.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/RelItr.lean @@ -14,11 +14,11 @@ import Mathlib.Tactic.SetLike /-! # RelItr -/ -@[expose] public section +public section /-- Imported declaration from the Incompleteness formalization. -/ -def Rel.iterate (R : Rel α α) : ℕ → α → α → Prop +@[expose] def Rel.iterate (R : Rel α α) : ℕ → α → α → Prop | 0 => (· = ·) | n + 1 => fun x y ↦ ∃ z, R x z ∧ R.iterate n z y diff --git a/LeanPool/Incompleteness/Foundation/Vorspiel/Vorspiel.lean b/LeanPool/Incompleteness/Foundation/Vorspiel/Vorspiel.lean index b5d9f80341..864616d3f0 100644 --- a/LeanPool/Incompleteness/Foundation/Vorspiel/Vorspiel.lean +++ b/LeanPool/Incompleteness/Foundation/Vorspiel/Vorspiel.lean @@ -24,14 +24,14 @@ import Mathlib.Order.ConditionallyCompleteLattice.Basic /-! # Vorspiel -/ -@[expose] public section +public section namespace Nat variable {α : ℕ → Sort u} /-- Imported declaration from the Incompleteness formalization. -/ -def cases (hzero : α 0) (hsucc : ∀ n, α (n + 1)) : ∀ n, α n +@[expose] def cases (hzero : α 0) (hsucc : ∀ n, α (n + 1)) : ∀ n, α n | 0 => hzero | n + 1 => hsucc n @@ -227,7 +227,7 @@ end «lp_section_1» variable {α : Type _} /-- Imported declaration from the Incompleteness formalization. -/ -def toList : {n : ℕ} → (Fin n → α) → List α +@[expose] def toList : {n : ℕ} → (Fin n → α) → List α | 0, _ => [] | _ + 1, v => v 0 :: toList (v ∘ Fin.succ) @@ -266,7 +266,7 @@ lemma getM_pure [LawfulMonad m] {n} {β : Fin n → Type u} (v : (i : Fin n) → getM (fun i => (some (v i) : Option (β i))) = some v := getM_pure v /-- Imported declaration from the Incompleteness formalization. -/ -def appendr {n m} (v : Fin n → α) (w : Fin m → α) : Fin (m + n) → α := +@[expose] def appendr {n m} (v : Fin n → α) (w : Fin m → α) : Fin (m + n) → α := Matrix.vecAppend (add_comm m n) v w @[simp] lemma appendr_nil {m} (w : Fin m → α) : appendr ![] w = w := by funext i; simp [appendr] @@ -278,7 +278,7 @@ def appendr {n m} (v : Fin n → α) (w : Fin m → α) : Fin (m + n) → α := section «lp_section_3» /-- Imported declaration from the Incompleteness formalization. -/ -def vecToNat : {n : ℕ} → (Fin n → ℕ) → ℕ +@[expose] def vecToNat : {n : ℕ} → (Fin n → ℕ) → ℕ | 0, _ => 0 | _ + 1, v => Nat.pair (v 0) (vecToNat <| v ∘ Fin.succ) + 1 @@ -303,7 +303,7 @@ def vecEmpty : Fin 0 → α := variable {n} {α : Fin (n + 1) → Type*} /-- Imported declaration from the Incompleteness formalization. -/ -def vecCons (h : α 0) (t : (i : Fin n) → α i.succ) : (i : Fin n.succ) → α i := +@[expose] def vecCons (h : α 0) (t : (i : Fin n) → α i.succ) : (i : Fin n.succ) → α i := Fin.cons h t /-- Imported declaration from the Incompleteness formalization. -/ @@ -464,7 +464,7 @@ namespace Function variable {α : Type u} {β : Type v} /-- Imported declaration from the Incompleteness formalization. -/ -def funEqOn (φ : α → Prop) (f g : α → β) : Prop := ∀ a, φ a → f a = g a +@[expose] def funEqOn (φ : α → Prop) (f g : α → β) : Prop := ∀ a, φ a → f a = g a lemma _root_.Function.funEqOn.of_subset {φ ψ : α → Prop} {f g : α → β} (e : funEqOn φ f g) (h : ∀ a, ψ a → φ a) : @@ -483,7 +483,7 @@ lemma inductionOnVec {φ : (Fin n → Quotient s) → Prop} (v : Fin n → Quoti Quotient.induction_on_pi v h /-- Imported declaration from the Incompleteness formalization. -/ -def liftVec : ∀ {n} (f : (Fin n → α) → β), +@[expose] def liftVec : ∀ {n} (f : (Fin n → α) → β), (∀ v₁ v₂ : Fin n → α, (∀ n, v₁ n ≈ v₂ n) → f v₁ = f v₂) → (Fin n → Quotient s) → β | 0, f, _, _ => f ![] | n + 1, f, h, v => @@ -531,7 +531,7 @@ def subsetSet (l : List α) (s : Set α) [DecidablePred s] : Bool := l.foldr (fun a ih => s a && ih) true /-- Imported declaration from the Incompleteness formalization. -/ -def upper : List ℕ → ℕ +@[expose] def upper : List ℕ → ℕ | [] => 0 | n :: ns => max (n + 1) ns.upper @@ -565,7 +565,7 @@ section «lp_section_6» variable [SemilatticeSup α] [OrderBot α] /-- Imported declaration from the Incompleteness formalization. -/ -def sup : List α → α +@[expose] def sup : List α → α | [] => ⊥ | a :: as => a ⊔ as.sup diff --git a/LeanPool/Incompleteness/ProvabilityLogic/Basic.lean b/LeanPool/Incompleteness/ProvabilityLogic/Basic.lean index d4cdc86640..9b4a71ec15 100644 --- a/LeanPool/Incompleteness/ProvabilityLogic/Basic.lean +++ b/LeanPool/Incompleteness/ProvabilityLogic/Basic.lean @@ -11,7 +11,7 @@ import LeanPool.Incompleteness.Arithmetization.Definability.Init /-! # Basic -/ -@[expose] public section +public section namespace LO diff --git a/LeanPool/Incompleteness/ToFoundation/Basic.lean b/LeanPool/Incompleteness/ToFoundation/Basic.lean index 32eaf02a08..0277ab5e4e 100644 --- a/LeanPool/Incompleteness/ToFoundation/Basic.lean +++ b/LeanPool/Incompleteness/ToFoundation/Basic.lean @@ -10,13 +10,13 @@ import Mathlib.Algebra.Order.Ring.Nat /-! # Basic -/ -@[expose] public section +public section namespace Fin /-- Imported declaration from the Incompleteness formalization. -/ -@[inline] def addCast (m) : Fin n → Fin (m + n) := castLE <| Nat.le_add_left n m +@[expose, inline] def addCast (m) : Fin n → Fin (m + n) := castLE <| Nat.le_add_left n m @[simp] lemma addCast_val (i : Fin n) : (i.addCast m : ℕ) = i := rfl diff --git a/LeanPool/InfinitaryLogic.lean b/LeanPool/InfinitaryLogic.lean index 828ff62b9a..bd8d2da186 100644 --- a/LeanPool/InfinitaryLogic.lean +++ b/LeanPool/InfinitaryLogic.lean @@ -39,4 +39,4 @@ Tags: mathematical-logic, infinitary-logic, model-theory, descriptive-set-theory MSC: 03C75, 03E15, 03C30 -/ -@[expose] public section +public section diff --git a/LeanPool/InfinitaryLogic/Admissible/Family.lean b/LeanPool/InfinitaryLogic/Admissible/Family.lean index 07f2f55bb7..1d68991bbd 100644 --- a/LeanPool/InfinitaryLogic/Admissible/Family.lean +++ b/LeanPool/InfinitaryLogic/Admissible/Family.lean @@ -35,7 +35,7 @@ on. - `CodedFamily`, `codedIInf`, `codedISup`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -136,7 +136,7 @@ presentation definitionally (`hfAmbient_toFamilyPresentation`). -/ /-- **The HF family view.** No code names an infinitary family; the remaining fields are discharged by the empty code subdomain. -/ -def hfFamily (L : Language.{u, v}) : FamilyPresentation.{u, v, 0, 0} L where +@[expose] def hfFamily (L : Language.{u, v}) : FamilyPresentation.{u, v, 0, 0} L where Element := ℕ IsFamilyCode _ := False Index c := c.2.elim diff --git a/LeanPool/InfinitaryLogic/Admissible/Fragment/Honest.lean b/LeanPool/InfinitaryLogic/Admissible/Fragment/Honest.lean index f4e74a5bfd..b95247411a 100644 --- a/LeanPool/InfinitaryLogic/Admissible/Fragment/Honest.lean +++ b/LeanPool/InfinitaryLogic/Admissible/Fragment/Honest.lean @@ -25,7 +25,7 @@ This does **not** wrap the legacy `AdmissibleFragmentCore`, which an honest HF f cannot instantiate: its `closed_iInf`/`closed_iSup` are *upward* over arbitrary external ℕ-families. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Admissible/HF.lean b/LeanPool/InfinitaryLogic/Admissible/HF.lean index d8d02a0563..35cfce2a04 100644 --- a/LeanPool/InfinitaryLogic/Admissible/HF.lean +++ b/LeanPool/InfinitaryLogic/Admissible/HF.lean @@ -37,7 +37,7 @@ returns Mathlib's canonical model in `Type (max u v)`. The compatibility theore placeholder; nothing here uses it, and nothing here may be proved from it. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean b/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean index dfd3db6eb7..fec404dd13 100644 --- a/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean +++ b/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean @@ -58,7 +58,7 @@ feeding `c'` to the arity-`(n+1)` inductive hypothesis homogenizes `G` outright. (abstract well-ordered source); **regression**: `pairER_from_endHomogeneous`. -/ -@[expose] public section +public section universe u @@ -75,7 +75,7 @@ variable {I : Type*} [LinearOrder I] {n : ℕ} /-- Append a strict upper bound `x` to an `(n+1)`-tuple `s`, giving an `(n+2)`-tuple. The underlying function is `Fin.snoc s x`; the `<`-proof `hx` enters only the strict-monotonicity argument, so the embedding's data depends on `s` and `x` alone. -/ -def appendLastOE (s : Fin (n + 1) ↪o I) (x : I) (hx : ∀ k, s k < x) : +@[expose] def appendLastOE (s : Fin (n + 1) ↪o I) (x : I) (hx : ∀ k, s k < x) : Fin (n + 2) ↪o I := OrderEmbedding.ofStrictMono (Fin.snoc (⇑s) x) (by intro p q hpq diff --git a/LeanPool/InfinitaryLogic/Combinatorics/FiniteArityErdosRadoInduction.lean b/LeanPool/InfinitaryLogic/Combinatorics/FiniteArityErdosRadoInduction.lean index 5fcc851e5c..74537366dc 100644 --- a/LeanPool/InfinitaryLogic/Combinatorics/FiniteArityErdosRadoInduction.lean +++ b/LeanPool/InfinitaryLogic/Combinatorics/FiniteArityErdosRadoInduction.lean @@ -43,7 +43,7 @@ At `κ = ℶ₁` every level sits below `ℶ_{ω₁}` (`finiteERBound_le_beth_om `succ ∘ (2 ^ ·)` is absorbed by two beth steps (`finiteERBound_beth_one_le`). -/ -@[expose] public section +public section open FirstOrder.Combinatorics.PairERGen open FirstOrder.Combinatorics.EndHomogER diff --git a/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean b/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean index e655daee68..f8feab7ce3 100644 --- a/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean +++ b/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean @@ -34,7 +34,7 @@ This file develops the canonical partition tree and extracts a live node of leng - **Consumer interface**: `exists_live_node_ge`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/InfinitaryLogic/Conditional/GandyHarrington.lean b/LeanPool/InfinitaryLogic/Conditional/GandyHarrington.lean index d6a1a4d215..075e6ab470 100644 --- a/LeanPool/InfinitaryLogic/Conditional/GandyHarrington.lean +++ b/LeanPool/InfinitaryLogic/Conditional/GandyHarrington.lean @@ -32,7 +32,7 @@ the hard core of Silver is exactly the non-smooth relations — the `G₀`-dicho the category route. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Conditional/MorleyHanfSchemaDischarge.lean b/LeanPool/InfinitaryLogic/Conditional/MorleyHanfSchemaDischarge.lean index 031a2d557e..ed027cb526 100644 --- a/LeanPool/InfinitaryLogic/Conditional/MorleyHanfSchemaDischarge.lean +++ b/LeanPool/InfinitaryLogic/Conditional/MorleyHanfSchemaDischarge.lean @@ -30,7 +30,7 @@ constants pass through; the degenerate `IsEmpty J` case is served by the source So: **`ℶ_{ω₁}` is a Hanf bound for every `L_{ω₁ω}` sentence, unconditionally.** -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean b/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean index ec9bcb02ed..41abca222f 100644 --- a/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean +++ b/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean @@ -29,7 +29,7 @@ Both are placed in `Conditional/` to make the external dependency visible. - [KK04], §1.6 -/ -@[expose] public section +public section universe u v @@ -247,7 +247,7 @@ namespace FirstOrder.Language namespace HeightCex /-- The counterexample language: unary predicates `Pᵢ` indexed by `i : ℕ`, nothing else. -/ -def Lang : Language.{0, 0} where +@[expose] def Lang : Language.{0, 0} where Functions _ := Empty Relations n := match n with | 1 => ℕ @@ -269,12 +269,12 @@ noncomputable def emb : ℕ ↪ Carrier := Infinite.natEmbedding Carrier noncomputable def hgt (x : Carrier) : ℕ := Function.invFun emb x /-- The unary atom `Pᵢ x₀`. -/ -def P (i : ℕ) : Lang.BoundedFormulaω Empty 1 := +@[expose] def P (i : ℕ) : Lang.BoundedFormulaω Empty 1 := BoundedFormulaω.rel (n := 1) (show Lang.Relations 1 from i) (fun _ => Term.var (Sum.inr (0 : Fin 1))) /-- The countable conjunction `⋀ᵢ Pᵢ x₀`. -/ -def conj : Lang.BoundedFormulaω Empty 1 := BoundedFormulaω.iInf P +@[expose] def conj : Lang.BoundedFormulaω Empty 1 := BoundedFormulaω.iInf P /-- The seed: `⋀ᵢ Pᵢ` first, then every `Pᵢ`. -/ def seed : ℕ → Σ n, Lang.BoundedFormulaω Empty n := fun k => diff --git a/LeanPool/InfinitaryLogic/Conditional/SilverCategoryRoute.lean b/LeanPool/InfinitaryLogic/Conditional/SilverCategoryRoute.lean index ab9cfee008..82900ad41b 100644 --- a/LeanPool/InfinitaryLogic/Conditional/SilverCategoryRoute.lean +++ b/LeanPool/InfinitaryLogic/Conditional/SilverCategoryRoute.lean @@ -62,7 +62,7 @@ for this route; it remains the assembly point for the closed case (`silver_core_ whole chain through `gandy_harrington_of_gSGraphHom` is unconditional. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/InfinitaryLogic/Descriptive/AnalyticTree.lean b/LeanPool/InfinitaryLogic/Descriptive/AnalyticTree.lean index 06815bdc1c..3d7025b442 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/AnalyticTree.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/AnalyticTree.lean @@ -26,7 +26,7 @@ index, so the chosen points converge to `(queryCode c, g)`, continuity gives analytic set is served by the branchless tree. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/BFEquivBorel.lean b/LeanPool/InfinitaryLogic/Descriptive/BFEquivBorel.lean index 9f35f29b05..005ef95f8b 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/BFEquivBorel.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/BFEquivBorel.lean @@ -37,7 +37,7 @@ Direct transfinite induction on `α` matching `BFEquiv`'s definition: - **Limit β**: `⋂_{γ < β} IH` — countable intersection (since `β < ω₁`). -/ -@[expose] public section +public section universe u v @@ -58,7 +58,7 @@ instance : MeasurableSpace (StructurePairSpace L) := MeasurableSpace.prod inferInstance inferInstance /-- The set of code pairs where `BFEquiv α n a b` holds. -/ -def BFEquivSet (α : Ordinal.{0}) (n : ℕ) +@[expose] def BFEquivSet (α : Ordinal.{0}) (n : ℕ) (a : Fin n → ℕ) (b : Fin n → ℕ) : Set (StructurePairSpace L) := {p | @BFEquiv L ℕ p.1.toStructure ℕ p.2.toStructure α n a b} diff --git a/LeanPool/InfinitaryLogic/Descriptive/CodeTransport.lean b/LeanPool/InfinitaryLogic/Descriptive/CodeTransport.lean index c35c3a1d00..b5ff801734 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/CodeTransport.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/CodeTransport.lean @@ -21,7 +21,7 @@ finite-specific and are the transport layer the López–Escobar converse (issue so they live here at the `StructureSpaceOn` level. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/CountingDichotomy.lean b/LeanPool/InfinitaryLogic/Descriptive/CountingDichotomy.lean index 8fc7ede649..75a72a3b1a 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/CountingDichotomy.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/CountingDichotomy.lean @@ -31,7 +31,7 @@ The isomorphism relation `isoSetoid` this file counts is defined in among coded ℕ-models is either ≤ ℵ₀ or exactly 2^ℵ₀. -/ -@[expose] public section +public section universe u v w @@ -44,7 +44,7 @@ open Cardinal Ordinal /-- The Silver–Burgess dichotomy for Borel equivalence relations: on a standard Borel space, a Borel equivalence relation has either at most countably many classes or exactly continuum-many. -/ -def SilverBurgessDichotomy : Prop := +@[expose] def SilverBurgessDichotomy : Prop := ∀ {X : Type w} [MeasurableSpace X] [StandardBorelSpace X] (r : Setoid X), MeasurableSet {p : X × X | r.r p.1 p.2} → diff --git a/LeanPool/InfinitaryLogic/Descriptive/FiniteCarrier.lean b/LeanPool/InfinitaryLogic/Descriptive/FiniteCarrier.lean index 1f8c4690b8..b9c9459487 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/FiniteCarrier.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/FiniteCarrier.lean @@ -31,7 +31,7 @@ gives a counting dichotomy for all countable models. - `allCodedIsoClasses_dichotomy`: Combined counting dichotomy for all countable models. -/ -@[expose] public section +public section universe u v @@ -101,7 +101,7 @@ structures they decode on `Fin n` are `L`-isomorphic. Stated on all of This mirrors `structureIsoSetoid` at the `ℕ` tier, and for the same reason: perfectness of a set of codes must be a property of the ambient space, not of whichever refinement was chosen to make one model class Polish. -/ -def structureIsoSetoidOn (L : Language.{u, v}) [L.IsRelational] (n : ℕ) : +@[expose] def structureIsoSetoidOn (L : Language.{u, v}) [L.IsRelational] (n : ℕ) : Setoid (StructureSpaceOn L (Fin n)) where r c₁ c₂ := Nonempty (@Language.Equiv L (Fin n) (Fin n) (StructureSpaceOn.toStructure c₁) (StructureSpaceOn.toStructure c₂)) @@ -180,7 +180,7 @@ theorem counting_fin_models_dichotomy /-- The type of all coded isomorphism classes across all carrier tiers: ℕ-models plus Fin n-models for each n. -/ -def AllCodedIsoClasses (φ : L.Sentenceω) := +@[expose] def AllCodedIsoClasses (φ : L.Sentenceω) := Quotient (isoSetoid φ) ⊕ Σ n, Quotient (isoSetoidOn φ n) omit [Countable ((l : ℕ) × L.Relations l)] in diff --git a/LeanPool/InfinitaryLogic/Descriptive/G0Dichotomy.lean b/LeanPool/InfinitaryLogic/Descriptive/G0Dichotomy.lean index 1f6e6bf292..809a42c2e9 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/G0Dichotomy.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/G0Dichotomy.lean @@ -49,7 +49,7 @@ extracting the continuous homomorphism build on these in completed proof map. -/ -@[expose] public section +public section open Set Function MeasureTheory diff --git a/LeanPool/InfinitaryLogic/Descriptive/G0Fusion.lean b/LeanPool/InfinitaryLogic/Descriptive/G0Fusion.lean index 55cdd4bf12..e5db0a4ba3 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/G0Fusion.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/G0Fusion.lean @@ -40,7 +40,7 @@ extraction `exists_gsGraph_hom` — the classical `G₀`-dichotomy construction Silver's theorem. -/ -@[expose] public section +public section open Set Function MeasureTheory diff --git a/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean b/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean index ee02fd3b9d..0c0d0f9cef 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean @@ -47,7 +47,7 @@ applied to the part of the symmetric difference inside each child cylinder). A c `(prependWord (s ++ [false]) x, prependWord (s ++ [true]) x)` inside `B`. -/ -@[expose] public section +public section open Set Filter Topology @@ -164,7 +164,7 @@ private theorem wordCylinder_wordOf (x : ℕ → Bool) (n : ℕ) : /-- The graph `G_S(2^ℕ)` on Cantor space associated to a set `S` of finite binary words: edges connect `s ⌢ i ⌢ x` and `s ⌢ !i ⌢ x` for `s ∈ S`. -/ -def GSGraph (S : Set (List Bool)) (y z : ℕ → Bool) : Prop := +@[expose] def GSGraph (S : Set (List Bool)) (y z : ℕ → Bool) : Prop := ∃ s ∈ S, ∃ i : Bool, ∃ x : ℕ → Bool, y = prependWord (s ++ [i]) x ∧ z = prependWord (s ++ [!i]) x @@ -212,7 +212,7 @@ theorem length_canonicalWord (n : ℕ) : (canonicalWord n).length = canonicalLen length_padTo (le_canonicalLen n) /-- The canonical dense and sparse set of finite binary words. -/ -def canonicalS : Set (List Bool) := Set.range canonicalWord +@[expose] def canonicalS : Set (List Bool) := Set.range canonicalWord theorem denseWords_canonicalS : DenseWords canonicalS := by intro r diff --git a/LeanPool/InfinitaryLogic/Descriptive/InvariantMeasurableSpace.lean b/LeanPool/InfinitaryLogic/Descriptive/InvariantMeasurableSpace.lean index e01d612b68..3b357dde17 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/InvariantMeasurableSpace.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/InvariantMeasurableSpace.lean @@ -17,7 +17,7 @@ The complement of an isomorphism-invariant class of coded structures is again in elementary lemma is the only closure property needed by the retained López–Escobar branch. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/IsomorphismBorel.lean b/LeanPool/InfinitaryLogic/Descriptive/IsomorphismBorel.lean index 15c0e8df0e..858caa656a 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/IsomorphismBorel.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/IsomorphismBorel.lean @@ -26,7 +26,7 @@ This file proves that isomorphism restricted to models of a sentence is Borel is measurable. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean b/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean index ccb2fd9342..8aec5bce1b 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean @@ -35,7 +35,7 @@ in the Baire space `X` are non-meager, some such `x₁` lies in `G`. Then space. -/ -@[expose] public section +public section open Set Filter Topology TopologicalSpace diff --git a/LeanPool/InfinitaryLogic/Descriptive/LogicAction.lean b/LeanPool/InfinitaryLogic/Descriptive/LogicAction.lean index 9aa5f3f034..aa6de9dcfb 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/LogicAction.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/LogicAction.lean @@ -28,7 +28,7 @@ this is the `ℕ`-tier that issue #27 packages (and that #28 will build its σ-a topology, Polish-group structure, and `ContinuousSMul` are the *next* milestones of #27, not here. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Descriptive/LopezEscobar.lean b/LeanPool/InfinitaryLogic/Descriptive/LopezEscobar.lean index 523aa2266d..c0fb21b342 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/LopezEscobar.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/LopezEscobar.lean @@ -33,7 +33,7 @@ Only the hard direction is new; the reverse of each is the easy direction, and t adds no mathematical content beyond the orbit = isomorphism identification. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/LopezEscobarEasy.lean b/LeanPool/InfinitaryLogic/Descriptive/LopezEscobarEasy.lean index da11632c8d..2f1dd39767 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/LopezEscobarEasy.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/LopezEscobarEasy.lean @@ -30,7 +30,7 @@ route through Craig interpolation and PC-separation — is **proved**: `lopez_es in `Descriptive/LopezEscobar.lean`. -/ -@[expose] public section +public section namespace FirstOrder @@ -40,7 +40,7 @@ variable {L : Language.{u, v}} [L.IsRelational] /-- **Isomorphism invariance** of a class of coded structures, in isomorphism-closed form: an `L`-isomorphism of the decoded structures transports membership. -/ -def IsomorphismInvariant (B : Set (StructureSpace L)) : Prop := +@[expose] def IsomorphismInvariant (B : Set (StructureSpace L)) : Prop := ∀ c d : StructureSpace L, Nonempty (@Language.Equiv L ℕ ℕ c.toStructure d.toStructure) → (c ∈ B ↔ d ∈ B) diff --git a/LeanPool/InfinitaryLogic/Descriptive/Measurable.lean b/LeanPool/InfinitaryLogic/Descriptive/Measurable.lean index 4cbf81974b..216b0233c6 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/Measurable.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/Measurable.lean @@ -25,7 +25,7 @@ sets (sets determined by a single relation query) are measurable. - `measurableSet_relHolds`: The set of codes where a given relation query holds is measurable. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Descriptive/ModelClassStandardBorel.lean b/LeanPool/InfinitaryLogic/Descriptive/ModelClassStandardBorel.lean index 62b844bcd2..049355d4d7 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/ModelClassStandardBorel.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/ModelClassStandardBorel.lean @@ -21,7 +21,7 @@ inherits `StandardBorelSpace` as a measurable subspace of the structure space. - `modelsOf_standardBorel`: The subtype `↥(ModelsOf φ)` is standard Borel. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Descriptive/Mycielski.lean b/LeanPool/InfinitaryLogic/Descriptive/Mycielski.lean index e87ce43aed..53ed8748c4 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/Mycielski.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/Mycielski.lean @@ -50,7 +50,7 @@ since `Bool` has a `UniformSpace` instance, the plain `PiNat.metricSpace` would second, non-defeq uniform structure). -/ -@[expose] public section +public section open Set PiNat Filter Topology diff --git a/LeanPool/InfinitaryLogic/Descriptive/PerfectAntichain.lean b/LeanPool/InfinitaryLogic/Descriptive/PerfectAntichain.lean index c3672e6306..b9358a0d3e 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/PerfectAntichain.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/PerfectAntichain.lean @@ -45,7 +45,7 @@ through `mk_eq_continuum`, which is what lets it drop second countability — it the lower bound. -/ -@[expose] public section +public section open Cardinal Set diff --git a/LeanPool/InfinitaryLogic/Descriptive/Polish.lean b/LeanPool/InfinitaryLogic/Descriptive/Polish.lean index 5f37c2cd5d..4e7a9b4c78 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/Polish.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/Polish.lean @@ -36,7 +36,7 @@ see through it. We provide the intermediate instances explicitly. - Analogous instances for the pair space `StructureSpace L × StructureSpace L`. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Descriptive/QueryCode.lean b/LeanPool/InfinitaryLogic/Descriptive/QueryCode.lean index 2ba6d3a62f..4c20add70f 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/QueryCode.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/QueryCode.lean @@ -33,7 +33,7 @@ This is the stop/go gate's first half; the analytic tree normal form (Unit 0b) b cylinder tree in `(ℕ → Bool) × (ℕ → ℕ)` on top of it. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorel.lean b/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorel.lean index d3a7047694..eb9fb3bf32 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorel.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorel.lean @@ -27,7 +27,7 @@ This file specializes the carrier-parametric result to structures on `ℕ`. - `modelsOf_measurableSet`: Satisfaction of any Lω₁ω sentence is measurable. -/ -@[expose] public section +public section universe u v u' @@ -44,14 +44,14 @@ section Measurability variable [L.IsRelational] [Countable (Σ l, L.Relations l)] /-- The set of codes where a bounded formula is realized, given variable assignments. -/ -def ModelsOfBounded +@[expose] def ModelsOfBounded {α : Type u'} {n : ℕ} (φ : L.BoundedFormulaω α n) (v : α → ℕ) (xs : Fin n → ℕ) : Set (StructureSpace L) := {c | @BoundedFormulaω.Realize L ℕ c.toStructure α n φ v xs} /-- The set of codes where a sentence is realized. -/ -def ModelsOf (φ : L.Sentenceω) : Set (StructureSpace L) := +@[expose] def ModelsOf (φ : L.Sentenceω) : Set (StructureSpace L) := ModelsOfBounded φ Empty.elim Fin.elim0 omit [Countable (Σ l, L.Relations l)] in diff --git a/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorelOn.lean b/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorelOn.lean index 70a7cceec2..d963a08a79 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorelOn.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/SatisfactionBorelOn.lean @@ -33,7 +33,7 @@ This file proves that satisfaction of Lω₁ω formulas is measurable on - `modelsOfOn_measurableSet`: Satisfaction of any Lω₁ω sentence is measurable. -/ -@[expose] public section +public section universe u v u' @@ -58,14 +58,14 @@ variable [L.IsRelational] {α : Type*} /-- The set of codes in `StructureSpaceOn L α` where a bounded formula is realized, given variable assignments. -/ -def ModelsOfBoundedOn +@[expose] def ModelsOfBoundedOn {β : Type u'} {n : ℕ} (φ : L.BoundedFormulaω β n) (v : β → α) (xs : Fin n → α) : Set (StructureSpaceOn L α) := {c | @BoundedFormulaω.Realize L α (StructureSpaceOn.toStructure c) β n φ v xs} /-- The set of codes in `StructureSpaceOn L α` where a sentence is realized. -/ -def ModelsOfOn (φ : L.Sentenceω) : Set (StructureSpaceOn L α) := +@[expose] def ModelsOfOn (φ : L.Sentenceω) : Set (StructureSpaceOn L α) := ModelsOfBoundedOn φ Empty.elim Fin.elim0 private theorem modelsOfBoundedOn_falsum {β : Type u'} {n : ℕ} diff --git a/LeanPool/InfinitaryLogic/Descriptive/StructureIsoSetoid.lean b/LeanPool/InfinitaryLogic/Descriptive/StructureIsoSetoid.lean index 4aa025cf71..338127ba0a 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/StructureIsoSetoid.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/StructureIsoSetoid.lean @@ -25,7 +25,7 @@ theorem about it. The sentence-level predicates below then quantify over perfec statements. -/ -@[expose] public section +public section open Cardinal Set @@ -38,7 +38,8 @@ variable {L : Language.{u, v}} [L.IsRelational] /-- **The ambient isomorphism relation**: two codes are related iff the structures they decode on `ℕ` are `L`-isomorphic. Stated on all of `StructureSpace L`, with no reference to any sentence. -/ -def structureIsoSetoid (L : Language.{u, v}) [L.IsRelational] : Setoid (StructureSpace L) where +@[expose] def structureIsoSetoid (L : Language.{u, v}) [L.IsRelational] : + Setoid (StructureSpace L) where r c₁ c₂ := Nonempty (@Language.Equiv L ℕ ℕ c₁.toStructure c₂.toStructure) iseqv := { refl := fun c => ⟨@Language.Equiv.refl L ℕ c.toStructure⟩ @@ -51,7 +52,7 @@ variable [Countable (Σ l, L.Relations l)] /-- The isomorphism equivalence relation on coded ℕ-models of φ: the ambient relation restricted to the models of `φ`. Two codes are related iff the decoded structures on ℕ are L-isomorphic. -/ -def isoSetoid (φ : L.Sentenceω) : Setoid ↥(ModelsOf φ) := +@[expose] def isoSetoid (φ : L.Sentenceω) : Setoid ↥(ModelsOf φ) := (structureIsoSetoid L).comap Subtype.val /-! ### Sentence-level predicates diff --git a/LeanPool/InfinitaryLogic/Descriptive/StructureSpace.lean b/LeanPool/InfinitaryLogic/Descriptive/StructureSpace.lean index 1bb8d3a8fd..167afe3178 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/StructureSpace.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/StructureSpace.lean @@ -32,7 +32,7 @@ while `RelQuery L` and `StructureSpace L` specialize to carrier ℕ. preserves relation satisfaction. -/ -@[expose] public section +public section universe u v @@ -46,10 +46,10 @@ variable (L : Language.{u, v}) /-- A carrier-parametric relation query: a choice of relation symbol and a tuple of elements from the carrier type α. -/ -def RelQueryOn (α : Type*) := Σ (R : Σ l, L.Relations l), (Fin R.1 → α) +@[expose] def RelQueryOn (α : Type*) := Σ (R : Σ l, L.Relations l), (Fin R.1 → α) /-- A relation query for carrier ℕ. -/ -def RelQuery := RelQueryOn L ℕ +@[expose] def RelQuery := RelQueryOn L ℕ variable {L} @@ -68,7 +68,7 @@ abbrev StructureSpaceOn (L : Language.{u, v}) (α : Type*) := RelQueryOn L α /-- The coding space for countable L-structures on ℕ: for each relation query, does the relation hold on that tuple? -/ -def StructureSpace (L : Language.{u, v}) := StructureSpaceOn L ℕ +@[expose] def StructureSpace (L : Language.{u, v}) := StructureSpaceOn L ℕ namespace StructureSpaceOn @@ -76,7 +76,7 @@ variable {α : Type*} /-- Decode a code into an L-structure on carrier α. Relations are determined by the code; functions are eliminated by `IsRelational`. -/ -@[reducible] noncomputable def toStructure [L.IsRelational] +@[expose, reducible] noncomputable def toStructure [L.IsRelational] (c : StructureSpaceOn L α) : L.Structure α where funMap := fun f => isEmptyElim f RelMap := fun {_} R v => c ⟨⟨_, R⟩, v⟩ = true @@ -90,7 +90,7 @@ theorem relMap_toStructure [L.IsRelational] (c : StructureSpaceOn L α) /-- Encode an L-structure on carrier α into a code. Takes an explicit structure instance rather than using the typeclass. -/ -noncomputable def ofStructure [_isRelational : L.IsRelational] +@[expose] noncomputable def ofStructure [_isRelational : L.IsRelational] (inst : L.Structure α) : StructureSpaceOn L α := fun ⟨⟨_, R⟩, v⟩ => @decide _ (Classical.dec (@Structure.RelMap _ _ inst _ R v)) @@ -107,7 +107,7 @@ end StructureSpaceOn namespace StructureSpace /-- Decode a code into an L-structure on ℕ. -/ -@[reducible] noncomputable def toStructure [L.IsRelational] +@[expose, reducible] noncomputable def toStructure [L.IsRelational] (c : StructureSpace L) : L.Structure ℕ := StructureSpaceOn.toStructure c @@ -119,7 +119,7 @@ theorem relMap_toStructure [L.IsRelational] (c : StructureSpace L) Iff.rfl /-- Encode an L-structure on ℕ into a code. -/ -noncomputable def ofStructure [L.IsRelational] +@[expose] noncomputable def ofStructure [L.IsRelational] (inst : L.Structure ℕ) : StructureSpace L := StructureSpaceOn.ofStructure inst diff --git a/LeanPool/InfinitaryLogic/Descriptive/Topology.lean b/LeanPool/InfinitaryLogic/Descriptive/Topology.lean index 7a5a6519c7..09ecb0dd25 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/Topology.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/Topology.lean @@ -26,7 +26,7 @@ with `Bool` discrete) and proves that cylinder sets are clopen. - `isOpen_relHolds`, `isClosed_relHolds`: Components of the clopen result. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean b/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean index 37144df00d..047abb2fda 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean @@ -41,7 +41,7 @@ That second consumer is why `isWellOrder_of_realize_of_modelsOf_subset` is the p - `isWellOrder_of_realize`: the equality-form corollary. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/WellOrderClass.lean b/LeanPool/InfinitaryLogic/Descriptive/WellOrderClass.lean index 1c79b8da4a..77b370d029 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/WellOrderClass.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/WellOrderClass.lean @@ -32,7 +32,7 @@ The comparison structures are the arbitrary-language ones already built for generic code-transport API. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Descriptive/WellOrderNonBorel.lean b/LeanPool/InfinitaryLogic/Descriptive/WellOrderNonBorel.lean index 7735295997..fb5c4da46f 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/WellOrderNonBorel.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/WellOrderNonBorel.lean @@ -41,7 +41,7 @@ Marker's Corollary 4.27 then bounds the order types of all models of `φ ⊓ inf single countable ordinal, which `exists_code_type_eq` contradicts. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Karp/CarrierTheorem.lean b/LeanPool/InfinitaryLogic/Karp/CarrierTheorem.lean index 7614e25307..77e1171a70 100644 --- a/LeanPool/InfinitaryLogic/Karp/CarrierTheorem.lean +++ b/LeanPool/InfinitaryLogic/Karp/CarrierTheorem.lean @@ -52,7 +52,7 @@ The common-carrier formulation with `IndexCoding` is this formalization's presen a statement made in those sources; the mathematics is Karp's. -/ -@[expose] public section +public section universe u v w w' uι uκ diff --git a/LeanPool/InfinitaryLogic/Karp/PotentialIso.lean b/LeanPool/InfinitaryLogic/Karp/PotentialIso.lean index f8efa1b518..688327728d 100644 --- a/LeanPool/InfinitaryLogic/Karp/PotentialIso.lean +++ b/LeanPool/InfinitaryLogic/Karp/PotentialIso.lean @@ -30,7 +30,7 @@ back-and-forth equivalence at all ordinal levels. - [KK04], Theorem 1.2.1 -/ -@[expose] public section +public section universe u v w w' diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/CountableIndex.lean b/LeanPool/InfinitaryLogic/Lomega1omega/CountableIndex.lean index 50ecf43184..db9a111eb7 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/CountableIndex.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/CountableIndex.lean @@ -30,7 +30,7 @@ encoding is noncanonical, so definitional commutation statements would be unplea consumers should work through `realize_ciInf`/`realize_ciSup`. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Depth.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Depth.lean index db5b9b0c61..3f89c2658a 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Depth.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Depth.lean @@ -21,7 +21,7 @@ structural subterm. `depth` uses `Ordinal.iSup` at the countable connectives an by `castLE`, `relabel`, `openBounds`, and `subst`, with strict decrease into every connective. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Entailment.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Entailment.lean index 2491578e22..d78c6ceefc 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Entailment.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Entailment.lean @@ -17,7 +17,7 @@ base structure by constant interpretations, which no empty carrier admits). `Language.{0,0}` throughout, per the arc's D2 freeze. -/ -@[expose] public section +public section namespace FirstOrder @@ -27,12 +27,12 @@ variable {L : Language.{0, 0}} /-- **Semantic entailment from a theory** (the primitive form): every nonempty `Type 0` model of `T` realizes `ψ`. -/ -def Theoryω.Entails (T : L.Theoryω) (ψ : L.Sentenceω) : Prop := +@[expose] def Theoryω.Entails (T : L.Theoryω) (ψ : L.Sentenceω) : Prop := ∀ (M : Type) [L.Structure M] [Nonempty M], T.Model M → Sentenceω.Realize ψ M /-- **Semantic entailment between sentences** — the headline convention, derived from the set-level primitive. -/ -def Sentenceω.Entails (φ ψ : L.Sentenceω) : Prop := +@[expose] def Sentenceω.Entails (φ ψ : L.Sentenceω) : Prop := Theoryω.Entails {φ} ψ namespace Theoryω diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/FiniteQuantification.lean b/LeanPool/InfinitaryLogic/Lomega1omega/FiniteQuantification.lean index 1c2b13f560..8417620e38 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/FiniteQuantification.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/FiniteQuantification.lean @@ -33,7 +33,7 @@ The environment in the realization lemmas is the plain `Fin.append xs ys` (well- syntax infrastructure independent of any particular application. -/ -@[expose] public section +public section universe u v w u' @@ -48,12 +48,12 @@ variable {α : Type u'} {n : ℕ} namespace BoundedFormulaω /-- Existentially quantify the last `k` bound variables of a formula, by iterating `ex`. -/ -def existsBlock : ∀ {k : ℕ}, L.BoundedFormulaω α (n + k) → L.BoundedFormulaω α n +@[expose] def existsBlock : ∀ {k : ℕ}, L.BoundedFormulaω α (n + k) → L.BoundedFormulaω α n | 0, φ => φ | _ + 1, φ => existsBlock φ.ex /-- Universally quantify the last `k` bound variables of a formula, by iterating `all`. -/ -def forallBlock : ∀ {k : ℕ}, L.BoundedFormulaω α (n + k) → L.BoundedFormulaω α n +@[expose] def forallBlock : ∀ {k : ℕ}, L.BoundedFormulaω α (n + k) → L.BoundedFormulaω α n | 0, φ => φ | _ + 1, φ => forallBlock φ.all diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/FirstOrderImage.lean b/LeanPool/InfinitaryLogic/Lomega1omega/FirstOrderImage.lean index b2bab41b8e..de0cdc88e0 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/FirstOrderImage.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/FirstOrderImage.lean @@ -22,7 +22,7 @@ same `cases … <;> simp [toLω]` inversion. With them the HF fragment's closure one-liners. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Fragment.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Fragment.lean index babae990dc..c3f13ab4f5 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Fragment.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Fragment.lean @@ -19,7 +19,7 @@ connectives (destroys countability), syntactic substitution closure (subsumed by parameters), and formal-negation closure (an NNF concern, #14). -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/InfiniteAxiom.lean b/LeanPool/InfinitaryLogic/Lomega1omega/InfiniteAxiom.lean index 054f0a5f70..74bfa713ca 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/InfiniteAxiom.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/InfiniteAxiom.lean @@ -20,7 +20,7 @@ infinite) to a statement about arbitrary models of a sentence, where a finite mo otherwise escape. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/OpenBoundsSemantics.lean b/LeanPool/InfinitaryLogic/Lomega1omega/OpenBoundsSemantics.lean index b5a06fbd2a..7ec1baeb25 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/OpenBoundsSemantics.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/OpenBoundsSemantics.lean @@ -24,7 +24,7 @@ Both were previously proved inside `Scott/Formula.lean` and `Methods/Henkin/Cons respectively; the statements and names are unchanged. -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Operations.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Operations.lean index 3e77e87304..580d7ce461 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Operations.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Operations.lean @@ -27,7 +27,7 @@ sense at an arbitrary branching carrier belongs upstream on `BoundedFormulaInf`; handles transport between carriers. -/ -@[expose] public section +public section universe u v u' @@ -45,14 +45,13 @@ keeping the first `n` as free variables. Used for quantifying over the last posi This function is used by `openBounds` (for the `all` case) and by `existsLastVar`/`forallLastVar` in `Scott/Formula.lean`. -/ -def insertLastBound {n : ℕ} : Fin (n + 1) → Fin n ⊕ Fin 1 := +@[expose] def insertLastBound {n : ℕ} : Fin (n + 1) → Fin n ⊕ Fin 1 := fun i => if h : i.val < n then Sum.inl ⟨i.val, h⟩ else Sum.inr 0 namespace BoundedFormulaω /-- Casts a bounded formula to one with more bound variables. -/ -@[simp] -def castLE : ∀ {m n : ℕ} (_h : m ≤ n), L.BoundedFormulaω α m → L.BoundedFormulaω α n +@[expose, simp] def castLE : ∀ {m n : ℕ} (_h : m ≤ n), L.BoundedFormulaω α m → L.BoundedFormulaω α n | _, _, _, falsum => falsum | _, _, h, equal t₁ t₂ => equal (t₁.relabel (Sum.map id (Fin.castLE h))) (t₂.relabel (Sum.map id (Fin.castLE h))) @@ -119,10 +118,11 @@ theorem realize_castLE_self {n : ℕ} (φ : L.BoundedFormulaω α n) (h : n ≤ realize_castLE_of_eq φ h rfl v xs /-- A function to help relabel the variables in bounded formulas. -/ -def relabelAux (g : α → β ⊕ Fin n) (k : ℕ) : α ⊕ Fin k → β ⊕ Fin (n + k) := +@[expose] def relabelAux (g : α → β ⊕ Fin n) (k : ℕ) : α ⊕ Fin k → β ⊕ Fin (n + k) := Sum.map id finSumFinEquiv ∘ Equiv.sumAssoc _ _ _ ∘ Sum.map g id /-- Relabels a bounded formula's free variables. -/ +@[expose] def relabel (g : α → β ⊕ Fin n) : ∀ {k}, L.BoundedFormulaω α k → L.BoundedFormulaω β (n + k) | _, falsum => falsum | _, equal t₁ t₂ => equal (t₁.relabel (relabelAux g _)) (t₂.relabel (relabelAux g _)) @@ -254,7 +254,7 @@ theorem realize_relabel_sumInr_zero {n : ℕ} (φ : L.Formulaω (Fin n)) (xs : F exact h /-- Substitutes the free variables in a bounded formula with terms. -/ -def subst : ∀ {n : ℕ}, L.BoundedFormulaω α n → (α → L.Term β) → L.BoundedFormulaω β n +@[expose] def subst : ∀ {n : ℕ}, L.BoundedFormulaω α n → (α → L.Term β) → L.BoundedFormulaω β n | _, falsum, _ => falsum | _, equal t₁ t₂, tf => equal (t₁.subst (Sum.elim (Term.relabel Sum.inl ∘ tf) (Term.var ∘ Sum.inr))) @@ -310,7 +310,7 @@ the bound variables `Fin n` become the only variables, now treated as free. For the `all` case, the last free variable is re-bound using `relabel` with `insertLastBound`. -/ -def openBounds : ∀ {n : ℕ}, L.BoundedFormulaω Empty n → L.Formulaω (Fin n) +@[expose] def openBounds : ∀ {n : ℕ}, L.BoundedFormulaω Empty n → L.Formulaω (Fin n) | _, .falsum => .falsum | _, .equal t₁ t₂ => .equal (t₁.relabel (Sum.elim Empty.elim Sum.inl)) @@ -335,7 +335,7 @@ def openBounds : ∀ {n : ℕ}, L.BoundedFormulaω Empty n → L.Formulaω (Fin This maps function and relation symbols in the formula using the language homomorphism, while preserving the variable structure. It is the Lω₁ω analogue of Mathlib's `LHom.onBoundedFormula`. -/ -def mapLanguage {L' : Language.{u, v}} (g : L →ᴸ L') : +@[expose] def mapLanguage {L' : Language.{u, v}} (g : L →ᴸ L') : ∀ {n}, L.BoundedFormulaω α n → L'.BoundedFormulaω α n | _, falsum => falsum | _, equal t₁ t₂ => equal (g.onTerm t₁) (g.onTerm t₂) @@ -406,7 +406,7 @@ theorem term_subst_empty_aux (t t' : L.Term Empty) : namespace BoundedFormula /-- Embeds a first-order bounded formula into Lω₁ω. -/ -def toLω : ∀ {n : ℕ}, L.BoundedFormula α n → L.BoundedFormulaω α n +@[expose] def toLω : ∀ {n : ℕ}, L.BoundedFormula α n → L.BoundedFormulaω α n | _, falsum => BoundedFormulaω.falsum | _, equal t₁ t₂ => BoundedFormulaω.equal t₁ t₂ | _, rel R ts => BoundedFormulaω.rel R ts diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Polarity.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Polarity.lean index ab1df0e8cf..169b15d366 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Polarity.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Polarity.lean @@ -33,7 +33,7 @@ Only the **generic** `relationsInSigned` equations are `@[simp]`; the `positiveR installed alongside them and nothing can loop through `not`, `and`, `or`, or `ex`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -45,7 +45,7 @@ variable {L : Language.{0, 0}} {α : Type} symbols with a positive occurrence in `φ`, and `relationsInSigned false φ` those with a negative occurrence: antecedents flip the sign, quantifiers and the countable connectives preserve it, and equality contributes nothing. -/ -def relationsInSigned : +@[expose] def relationsInSigned : ∀ {n : ℕ}, Bool → L.BoundedFormulaω α n → Set (Σ n, L.Relations n) | _, _, .falsum => ∅ | _, _, .equal _ _ => ∅ @@ -66,27 +66,27 @@ abbrev negativeRelationsIn {n : ℕ} (φ : L.BoundedFormulaω α n) : Set (Σ n, /-! ## Constructor equations -/ @[simp] theorem relationsInSigned_falsum {n : ℕ} (s : Bool) : - relationsInSigned s (BoundedFormulaω.falsum : L.BoundedFormulaω α n) = ∅ := rfl + relationsInSigned s (BoundedFormulaω.falsum : L.BoundedFormulaω α n) = ∅ := by rfl @[simp] theorem relationsInSigned_equal {n : ℕ} (s : Bool) (t₁ t₂ : L.Term (α ⊕ Fin n)) : - relationsInSigned s (BoundedFormulaω.equal t₁ t₂) = ∅ := rfl + relationsInSigned s (BoundedFormulaω.equal t₁ t₂) = ∅ := by rfl @[simp] theorem relationsInSigned_rel {n l : ℕ} (s : Bool) (R : L.Relations l) (ts : Fin l → L.Term (α ⊕ Fin n)) : - relationsInSigned s (BoundedFormulaω.rel R ts) = if s then {⟨l, R⟩} else ∅ := rfl + relationsInSigned s (BoundedFormulaω.rel R ts) = if s then {⟨l, R⟩} else ∅ := by rfl @[simp] theorem relationsInSigned_imp {n : ℕ} (s : Bool) (φ ψ : L.BoundedFormulaω α n) : - relationsInSigned s (φ.imp ψ) = relationsInSigned (!s) φ ∪ relationsInSigned s ψ := rfl + relationsInSigned s (φ.imp ψ) = relationsInSigned (!s) φ ∪ relationsInSigned s ψ := by rfl @[simp] theorem relationsInSigned_all {n : ℕ} (s : Bool) (φ : L.BoundedFormulaω α (n + 1)) : - relationsInSigned s φ.all = relationsInSigned s φ := rfl + relationsInSigned s φ.all = relationsInSigned s φ := by rfl @[simp] theorem relationsInSigned_iSup {n : ℕ} (s : Bool) (φs : ℕ → L.BoundedFormulaω α n) : - relationsInSigned s (BoundedFormulaω.iSup φs) = ⋃ i, relationsInSigned s (φs i) := rfl + relationsInSigned s (BoundedFormulaω.iSup φs) = ⋃ i, relationsInSigned s (φs i) := by rfl @[simp] theorem relationsInSigned_iInf {n : ℕ} (s : Bool) (φs : ℕ → L.BoundedFormulaω α n) : - relationsInSigned s (BoundedFormulaω.iInf φs) = ⋃ i, relationsInSigned s (φs i) := rfl + relationsInSigned s (BoundedFormulaω.iInf φs) = ⋃ i, relationsInSigned s (φs i) := by rfl /-! ## Negation swaps and the derived connectives -/ diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierClass.lean b/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierClass.lean index b31e767163..c7b7b7f23a 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierClass.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierClass.lean @@ -29,7 +29,7 @@ reused by any preservation theorem (issue #15's interpolation and relative prese #16's end extensions), not to live inside the interpolation development. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -40,7 +40,7 @@ variable {L : Language.{0, 0}} {α β : Type} /-- **The signed quantifier class.** `universalSigned true φ` says `φ` is *universal* (`∀₁`) and `universalSigned false φ` says `φ` is *existential* (`∃₁`). An antecedent flips the sign, the countable connectives preserve it, and `all` is admissible only at the universal sign. -/ -def universalSigned : ∀ {n : ℕ}, Bool → L.BoundedFormulaω α n → Prop +@[expose] def universalSigned : ∀ {n : ℕ}, Bool → L.BoundedFormulaω α n → Prop | _, _, .falsum => True | _, _, .equal _ _ => True | _, _, .rel _ _ => True diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierOccurrence.lean b/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierOccurrence.lean index bce64c19d4..33c1fe5296 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierOccurrence.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/QuantifierOccurrence.lean @@ -28,7 +28,7 @@ positive sign only. Nothing here mentions interpolation; the set-level versions the separator budgets are stated against. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Semantics.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Semantics.lean index 2e87052955..008f246d77 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Semantics.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Semantics.lean @@ -40,7 +40,7 @@ Mathlib semantics, and that the historical `Fin.elim0` spellings of the arity-0 agree with Mathlib's `default`. -/ -@[expose] public section +public section universe u v w u' diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Syntax.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Syntax.lean index 6401c2a29c..361925709d 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Syntax.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Syntax.lean @@ -40,7 +40,7 @@ to it (`not falsum` reduces to `imp falsum falsum`). -/ -@[expose] public section +public section universe u v u' @@ -109,26 +109,26 @@ the fix belongs upstream on the fork, not here. -/ /-! ### Derived connectives Mathlib does not provide -/ /-- Conjunction of two formulas, defined via De Morgan. -/ -@[match_pattern] -protected def and (φ ψ : L.BoundedFormulaω α n) : L.BoundedFormulaω α n := +@[expose, match_pattern] protected def and + (φ ψ : L.BoundedFormulaω α n) : L.BoundedFormulaω α n := (φ.imp ψ.not).not instance : Min (L.BoundedFormulaω α n) := ⟨BoundedFormulaω.and⟩ /-- Disjunction of two formulas. -/ -@[match_pattern] -protected def or (φ ψ : L.BoundedFormulaω α n) : L.BoundedFormulaω α n := +@[expose, match_pattern] protected def or + (φ ψ : L.BoundedFormulaω α n) : L.BoundedFormulaω α n := φ.not.imp ψ instance : Max (L.BoundedFormulaω α n) := ⟨BoundedFormulaω.or⟩ /-- Biconditional between formulas. -/ -protected def iff (φ ψ : L.BoundedFormulaω α n) : L.BoundedFormulaω α n := +@[expose] protected def iff (φ ψ : L.BoundedFormulaω α n) : L.BoundedFormulaω α n := (φ.imp ψ) ⊓ (ψ.imp φ) /-- Indexed conjunction over any `Encodable` type. This extends `iInf` from ℕ-indexed to general countable indices by encoding. -/ -def einf {ι : Type*} [Encodable ι] (φs : ι → L.BoundedFormulaω α n) : +@[expose] def einf {ι : Type*} [Encodable ι] (φs : ι → L.BoundedFormulaω α n) : L.BoundedFormulaω α n := iInf fun k => match Encodable.decode (α := ι) k with | some i => φs i @@ -136,7 +136,7 @@ def einf {ι : Type*} [Encodable ι] (φs : ι → L.BoundedFormulaω α n) : /-- Indexed disjunction over any `Encodable` type. This extends `iSup` from ℕ-indexed to general countable indices by encoding. -/ -def esup {ι : Type*} [Encodable ι] (φs : ι → L.BoundedFormulaω α n) : +@[expose] def esup {ι : Type*} [Encodable ι] (φs : ι → L.BoundedFormulaω α n) : L.BoundedFormulaω α n := iSup fun k => match Encodable.decode (α := ι) k with | some i => φs i diff --git a/LeanPool/InfinitaryLogic/Lomega1omega/Theory.lean b/LeanPool/InfinitaryLogic/Lomega1omega/Theory.lean index 20f7eb33fd..de935e9e4a 100644 --- a/LeanPool/InfinitaryLogic/Lomega1omega/Theory.lean +++ b/LeanPool/InfinitaryLogic/Lomega1omega/Theory.lean @@ -35,7 +35,7 @@ in Lω₁ω (countable infinitary logic with countable conjunctions/disjunctions - [KK04] -/ -@[expose] public section +public section universe u v w w' @@ -57,7 +57,7 @@ namespace Theoryω variable {T T' : L.Theoryω} {φ : L.Sentenceω} /-- A structure M is a model of theory T if it satisfies all sentences in T. -/ -def Model (T : L.Theoryω) (M : Type w) [L.Structure M] : Prop := +@[expose] def Model (T : L.Theoryω) (M : Type w) [L.Structure M] : Prop := ∀ φ ∈ T, Sentenceω.Realize φ M /-- The empty theory has every structure as a model. -/ @@ -75,12 +75,12 @@ The final universe parameter is part of the semantic specification: `IsSatisfiableIn.{u, v, w} T` asks for a model whose carrier lies in `Type w`, independently of the universes `u`, `v` of the language. Use this form when a construction chooses the model universe; the older `IsSatisfiable` below is its universe-zero specialization. -/ -def IsSatisfiableIn (T : L.Theoryω) : Prop := +@[expose] def IsSatisfiableIn (T : L.Theoryω) : Prop := ∃ (M : Type w) (_ : L.Structure M) (_ : Nonempty M), T.Model M /-- **Finite satisfiability in a selected carrier universe** — every ordinarily finite subtheory has a model in `Type w`. -/ -def IsFinitelySatisfiableIn (T : L.Theoryω) : Prop := +@[expose] def IsFinitelySatisfiableIn (T : L.Theoryω) : Prop := ∀ T₀ ⊆ T, T₀.Finite → IsSatisfiableIn.{u, v, w} T₀ /-- **Satisfiability**, named rather than written out. The existential-model statement was @@ -90,13 +90,13 @@ satisfiability with the `A`-finite kind, which are different hypotheses. Named This published predicate retains its original universe-zero meaning. Constructions that select a different model universe should use `IsSatisfiableIn`. -/ -def IsSatisfiable (T : L.Theoryω) : Prop := +@[expose] def IsSatisfiable (T : L.Theoryω) : Prop := ∃ (M : Type) (_ : L.Structure M) (_ : Nonempty M), T.Model M /-- **Finite satisfiability** — every *ordinarily* finite subtheory has a model. Contrast `AFinitelySatisfiable`, the Barwise premise, which quantifies over `A`-finite subtheories instead; at `A = HF` the two coincide, and nowhere else. -/ -def IsFinitelySatisfiable (T : L.Theoryω) : Prop := +@[expose] def IsFinitelySatisfiable (T : L.Theoryω) : Prop := ∀ T₀ ⊆ T, T₀.Finite → T₀.IsSatisfiable /-- Satisfiability in a fixed carrier universe is monotone under shrinking the theory. -/ @@ -157,7 +157,7 @@ theorem BoundedFormulaω.realize_equiv {M N : Type w} [L.Structure M] [L.Structu /-! ### Lω₁ω Elementary Equivalence -/ /-- Two structures are Lω₁ω-elementarily equivalent if they satisfy the same Lω₁ω sentences. -/ -def LomegaEquiv (L : Language) (M N : Type*) [L.Structure M] [L.Structure N] : Prop := +@[expose] def LomegaEquiv (L : Language) (M N : Type*) [L.Structure M] [L.Structure N] : Prop := ∀ φ : L.Sentenceω, Sentenceω.Realize φ M ↔ Sentenceω.Realize φ N namespace LomegaEquiv diff --git a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/IndexCoding.lean b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/IndexCoding.lean index 0c85b478e3..b577ac633c 100644 --- a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/IndexCoding.lean +++ b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/IndexCoding.lean @@ -30,7 +30,7 @@ infinitary formulas are transported between carriers (`Infinitary/Reindex.lean`) - `IndexCoding.toEmbedding`: the underlying embedding (`decode_encode` forces injectivity). -/ -@[expose] public section +public section universe uι uκ uμ uν diff --git a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Reindex.lean b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Reindex.lean index ff88317fbb..4d22a3de64 100644 --- a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Reindex.lean +++ b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Reindex.lean @@ -28,7 +28,7 @@ Karp's theorem is the motivating consumer: its `M`-indexed and `N`-indexed separ conjunctions are `iInfAlong` at the two sum codings into the single carrier `M ⊕ N`. -/ -@[expose] public section +public section universe u v u' uι uκ uμ w diff --git a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Semantics.lean b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Semantics.lean index 1d92c7dbe6..ba0694f34a 100644 --- a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Semantics.lean +++ b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Semantics.lean @@ -32,7 +32,7 @@ Realization of the coded connectives and of carrier transport is in `Infinitary/Reindex.lean`. -/ -@[expose] public section +public section universe u v u' uι w @@ -46,7 +46,7 @@ namespace BoundedFormulaInf /-- Realization of an infinitary bounded formula in a structure, given valuations of the free and bound variables. One recursion serves every carrier. -/ -def Realize {M : Type w} [L.Structure M] : +@[expose] def Realize {M : Type w} [L.Structure M] : ∀ {n}, L.BoundedFormulaInf ι α n → (α → M) → (Fin n → M) → Prop | _, .falsum, _, _ => False | _, .equal t₁ t₂, v, xs => t₁.realize (Sum.elim v xs) = t₂.realize (Sum.elim v xs) @@ -119,11 +119,13 @@ theorem realize_ex {φ : L.BoundedFormulaInf ι α (n + 1)} : end BoundedFormulaInf /-- Realization of an `L_{∞ω}` formula (no free bound variables). -/ -def FormulaInf.Realize {M : Type w} [L.Structure M] (φ : L.FormulaInf ι α) (v : α → M) : Prop := +@[expose] def FormulaInf.Realize {M : Type w} [L.Structure M] + (φ : L.FormulaInf ι α) (v : α → M) : Prop := BoundedFormulaInf.Realize φ v default /-- Realization of an `L_{∞ω}` sentence in a structure. -/ -def SentenceInf.Realize (φ : L.SentenceInf ι) (M : Type w) [L.Structure M] : Prop := +@[expose] def SentenceInf.Realize (φ : L.SentenceInf ι) (M : Type w) + [L.Structure M] : Prop := FormulaInf.Realize (M := M) φ Empty.elim end Language diff --git a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Syntax.lean b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Syntax.lean index 075998a3f4..d181b33968 100644 --- a/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Syntax.lean +++ b/LeanPool/InfinitaryLogic/Mathlib/ModelTheory/Infinitary/Syntax.lean @@ -38,7 +38,7 @@ quantifying over a fresh index type at every node. Consequences: carrier-generic finitary embedding `BoundedFormula.toInf`. -/ -@[expose] public section +public section universe u v u' uι w @@ -95,12 +95,12 @@ variable {L} {ι : Type uι} {α : Type u'} {n : ℕ} namespace BoundedFormulaInf /-- The negation of an infinitary formula. -/ -@[match_pattern] +@[expose, match_pattern] protected def not (φ : L.BoundedFormulaInf ι α n) : L.BoundedFormulaInf ι α n := φ.imp .falsum /-- The true formula. -/ -protected def verum : L.BoundedFormulaInf ι α n := +@[expose] protected def verum : L.BoundedFormulaInf ι α n := BoundedFormulaInf.not .falsum instance : Bot (L.BoundedFormulaInf ι α n) := @@ -110,7 +110,7 @@ instance : Top (L.BoundedFormulaInf ι α n) := ⟨BoundedFormulaInf.verum⟩ /-- Existential quantification over the last bound variable. -/ -@[match_pattern] +@[expose, match_pattern] protected def ex (φ : L.BoundedFormulaInf ι α (n + 1)) : L.BoundedFormulaInf ι α n := φ.not.all.not diff --git a/LeanPool/InfinitaryLogic/Methods/ConstantAbstraction.lean b/LeanPool/InfinitaryLogic/Methods/ConstantAbstraction.lean index 3b40f1dbf6..43e56103c5 100644 --- a/LeanPool/InfinitaryLogic/Methods/ConstantAbstraction.lean +++ b/LeanPool/InfinitaryLogic/Methods/ConstantAbstraction.lean @@ -30,7 +30,7 @@ on `M`: Pure realization surgery: no `InsepAt`, no interpolation-specific commitments. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -96,7 +96,7 @@ private theorem BoundedFormulaω.realize_congr_instances (S S' : L.Structure M) /-! ## The controlled single-layer structure `wc base h` -/ /-- The `L[[ℕ]]`-structure on `M` with base reduct `base` and constants interpreted by `h`. -/ -@[reducible] def wc (base : L.Structure M) (h : ℕ → M) : L[[ℕ]].Structure M := +@[expose, reducible] def wc (base : L.Structure M) (h : ℕ → M) : L[[ℕ]].Structure M := @Language.withConstantsStructure L M base ℕ (constantsOn.structure h) @[simp] theorem wc_funMap_inl (base : L.Structure M) (h : ℕ → M) {l : ℕ} @@ -228,7 +228,7 @@ noncomputable def Term.abstractConst (j : ℕ) {n : ℕ} : | @Term.func _ _ (_ + 1) (Sum.inr k) _ => nomatch k /-- Withdraw the constant `c_j` from a formula into the fresh free variable `0 : Fin 1`. -/ -noncomputable def BoundedFormulaω.abstractConst (j : ℕ) : +@[expose] noncomputable def BoundedFormulaω.abstractConst (j : ℕ) : ∀ {n : ℕ}, L[[ℕ]].BoundedFormulaω Empty n → L[[ℕ]].BoundedFormulaω (Fin 1) n | _, .falsum => .falsum | _, .equal t u => .equal (t.abstractConst j) (u.abstractConst j) diff --git a/LeanPool/InfinitaryLogic/Methods/ConstantInstances.lean b/LeanPool/InfinitaryLogic/Methods/ConstantInstances.lean index b94a0eb998..9baa8b31a2 100644 --- a/LeanPool/InfinitaryLogic/Methods/ConstantInstances.lean +++ b/LeanPool/InfinitaryLogic/Methods/ConstantInstances.lean @@ -17,7 +17,7 @@ This neutral module defines the two closing operations by the auxiliary constant constants `c_{τ i}`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -27,11 +27,11 @@ variable {L : Language.{0, 0}} /-- The constant instance `ψ(c)`: open the bound variable of `ψ` and substitute the constant `c_c`. -/ -def instConst (c : ℕ) (ψ : L[[ℕ]].BoundedFormulaω Empty 1) : L[[ℕ]].Sentenceω := +@[expose] def instConst (c : ℕ) (ψ : L[[ℕ]].BoundedFormulaω Empty 1) : L[[ℕ]].Sentenceω := (ψ.openBounds).subst (fun _ => constTerm c) /-- The closing substitution of a bounded formula by constants. -/ -noncomputable def closeBy {n : ℕ} (φ : L[[ℕ]].BoundedFormulaω Empty n) (τ : Fin n → ℕ) : +@[expose] noncomputable def closeBy {n : ℕ} (φ : L[[ℕ]].BoundedFormulaω Empty n) (τ : Fin n → ℕ) : L[[ℕ]].Sentenceω := (φ.openBounds).subst (fun i => constTerm (τ i)) diff --git a/LeanPool/InfinitaryLogic/Methods/ConstantSupport.lean b/LeanPool/InfinitaryLogic/Methods/ConstantSupport.lean index 806d069818..594632cb30 100644 --- a/LeanPool/InfinitaryLogic/Methods/ConstantSupport.lean +++ b/LeanPool/InfinitaryLogic/Methods/ConstantSupport.lean @@ -30,7 +30,7 @@ freshness arguments must CARRY a finite support rather than compute one). Craig transport (the `A = ∅` root gate of the interpolation argument). -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -334,7 +334,7 @@ variable {L' : Language.{0, 0}} {J : Type} (`functionsIn_countable` — countably-branching connectives); freshness arguments *demand* containment in a finite set rather than computing one. Generic in the base language, so it also serves iterated expansion layers (`L := L'[[J]]`, constants `ℕ`). -/ -def sentenceJConsts {α : Type} {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n) : Set J := +@[expose] def sentenceJConsts {α : Type} {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n) : Set J := {j | (⟨0, (Sum.inr j : L'[[J]].Functions 0)⟩ : Σ n, L'[[J]].Functions n) ∈ BoundedFormulaω.functionsIn φ} @@ -377,12 +377,12 @@ theorem sentenceJConsts_imp_right {α : Type} {n : ℕ} (φ ψ : L'[[J]].Bounded exact Set.mem_union_right _ hj /-- The constant support of an expansion term. -/ -def Term.jConsts {β : Type} (t : L'[[J]].Term β) : Set J := +@[expose] def Term.jConsts {β : Type} (t : L'[[J]].Term β) : Set J := {j | (⟨0, (Sum.inr j : L'[[J]].Functions 0)⟩ : Σ n, L'[[J]].Functions n) ∈ Term.functionsIn t} /-- The `j`-th constant of the expansion, as a closed term. -/ -def constTerm (j : J) : L'[[J]].Term Empty := +@[expose] def constTerm (j : J) : L'[[J]].Term Empty := Term.func (Sum.inr j : L'[[J]].Functions 0) Fin.elim0 theorem constTerm_functionsIn (j : J) : @@ -421,12 +421,12 @@ theorem sentenceJConsts_subst_constTerm (φ : L'[[J]].Formulaω (Fin 1)) (j : J) exact Set.mem_singleton_iff.mpr (Sum.inr.injEq j' j ▸ hinj) /-- The base function symbols of an expansion formula (the `Sum.inl` layer). -/ -def BoundedFormulaω.baseFunctionsIn {α : Type} {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n) : +@[expose] def BoundedFormulaω.baseFunctionsIn {α : Type} {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n) : Set (Σ n, L'.Functions n) := {s | (⟨s.1, Sum.inl s.2⟩ : Σ n, L'[[J]].Functions n) ∈ φ.functionsIn} /-- The base relation symbols of an expansion formula (the constant layer adds none). -/ -def BoundedFormulaω.baseRelationsIn {α : Type} {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n) : +@[expose] def BoundedFormulaω.baseRelationsIn {α : Type} {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n) : Set (Σ n, L'.Relations n) := {s | (⟨s.1, Sum.inl s.2⟩ : Σ n, L'[[J]].Relations n) ∈ φ.relationsIn} @@ -492,7 +492,7 @@ theorem Term.functionsIn_stripConsts {β : Type} : | succ l => exact nomatch c /-- Strip a constant-free expansion formula to the base language. -/ -def BoundedFormulaω.stripConsts {α : Type} : +@[expose] def BoundedFormulaω.stripConsts {α : Type} : ∀ {n : ℕ} (φ : L'[[J]].BoundedFormulaω α n), sentenceJConsts (L' := L') φ ⊆ ∅ → L'.BoundedFormulaω α n | _, .falsum, _ => .falsum diff --git a/LeanPool/InfinitaryLogic/Methods/ConstantSurgery.lean b/LeanPool/InfinitaryLogic/Methods/ConstantSurgery.lean index e85b29a96c..b08203bc5b 100644 --- a/LeanPool/InfinitaryLogic/Methods/ConstantSurgery.lean +++ b/LeanPool/InfinitaryLogic/Methods/ConstantSurgery.lean @@ -27,7 +27,7 @@ The `instConst` dependency is why this file currently sits under `Methods` besid machinery rather than in the syntax layer; #39's consolidation is where that is resolved. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/EM/FragmentAdapter.lean b/LeanPool/InfinitaryLogic/Methods/EM/FragmentAdapter.lean index 2a0871e752..62bf9e7e32 100644 --- a/LeanPool/InfinitaryLogic/Methods/EM/FragmentAdapter.lean +++ b/LeanPool/InfinitaryLogic/Methods/EM/FragmentAdapter.lean @@ -23,7 +23,7 @@ general. `Realization.lean`'s model-input endpoints are the honest residual ben take the model itself, and the oracle factors through them. -/ -@[expose] public section +public section universe u v w @@ -88,7 +88,7 @@ theorem realize_templateSentence_of_structure /-! ### Morley–Hanf-oriented corollaries -/ /-- The 2-ary Lω₁ω disequality formula `x₀ ≠ x₁`. -/ -def disEqFormula : L.BoundedFormulaω Empty 2 := +@[expose] def disEqFormula : L.BoundedFormulaω Empty 2 := (BoundedFormulaω.equal (Term.var (Sum.inr (0 : Fin 2)) : L.Term (Empty ⊕ Fin 2)) (Term.var (Sum.inr (1 : Fin 2)) : L.Term (Empty ⊕ Fin 2))).not @@ -100,7 +100,7 @@ The honest tail-template residual quantifies over exactly this seed formula sequences: an arbitrary sequence can enumerate `{Pᵢ x}ᵢ ∪ {⋀ᵢ Pᵢ x}` against a "height" model, whose tail template is finitely satisfiable but unsatisfiable — a genuine `L_{ω₁ω}` compactness failure. -/ -def morleySeed (φ : L.Sentenceω) : ℕ → Σ n, L.BoundedFormulaω Empty n := fun i => +@[expose] def morleySeed (φ : L.Sentenceω) : ℕ → Σ n, L.BoundedFormulaω Empty n := fun i => match i with | 0 => ⟨0, φ⟩ | 1 => ⟨2, disEqFormula⟩ diff --git a/LeanPool/InfinitaryLogic/Methods/EM/Indiscernible.lean b/LeanPool/InfinitaryLogic/Methods/EM/Indiscernible.lean index e7af568042..c4e7d0a1d2 100644 --- a/LeanPool/InfinitaryLogic/Methods/EM/Indiscernible.lean +++ b/LeanPool/InfinitaryLogic/Methods/EM/Indiscernible.lean @@ -16,7 +16,7 @@ formula holds on one iff it holds on the other. Standalone API — does not advance the Hanf boundary. -/ -@[expose] public section +public section universe u v w @@ -48,7 +48,7 @@ Motivation: the EM pipeline only uses indiscernibility on the countable family `Set.range s` for a chosen formula enumeration `s`, not on all Lω₁ω formulas. Weakening to the restricted form lets callers supply the genuinely-needed hypothesis rather than the stronger full indiscernibility. -/ -def IsLomega1omegaIndiscernibleOn (a : I → M) +@[expose] def IsLomega1omegaIndiscernibleOn (a : I → M) (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : Prop := ∀ {n : ℕ} {φ : L.BoundedFormulaω Empty n}, ⟨n, φ⟩ ∈ Γ → ∀ (s t : Fin n → I), StrictMono s → StrictMono t → diff --git a/LeanPool/InfinitaryLogic/Methods/EM/Realization.lean b/LeanPool/InfinitaryLogic/Methods/EM/Realization.lean index c352098ff9..54864a03ba 100644 --- a/LeanPool/InfinitaryLogic/Methods/EM/Realization.lean +++ b/LeanPool/InfinitaryLogic/Methods/EM/Realization.lean @@ -38,7 +38,7 @@ inherits the continuum size of the Lω₁ω formula syntax. Any future model-realizing tranche will need to restrict to a countable sub-theory. -/ -@[expose] public section +public section universe u v w @@ -58,7 +58,7 @@ variable {J : Type u} [LinearOrder J] interpreted as the constants `c_{t 0}, …, c_{t (n-1)}`". Built by lifting `φ` to `L[[J]]`, opening its bound variables, and substituting them with the closed terms for the constants `t 0, …, t (n-1)`. -/ -def templateSentence +@[expose] def templateSentence {n : ℕ} (φ : L.BoundedFormulaω Empty n) (t : Fin n ↪o J) : L[[J]].Sentenceω := let φ' : L[[J]].BoundedFormulaω Empty n := φ.mapLanguage (L.lhomWithConstants J) @@ -107,7 +107,7 @@ sentences for formulas whose `(arity, φ)`-pair lies in the family `Γ`. When `Γ` and `J` are both countable, the resulting theory is countable (see `templateTheoryOn_countable`), making it a candidate input to `model_existence` — which the full `templateTheory` can never be. -/ -def templateTheoryOn +@[expose] def templateTheoryOn (T : Lomega1omegaTemplate L) (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) (J : Type u) [LinearOrder J] : @@ -140,7 +140,7 @@ variable {J : Type u} [LinearOrder J] /-- Sequence-based restricted template theory: same content as `templateTheoryOn T (Set.range s) J`, with a dedicated name for callers that want to hand a sequence rather than a set. -/ -def templateTheoryOfSeq +@[expose] def templateTheoryOfSeq (T : Lomega1omegaTemplate L) (s : ℕ → Σ n, L.BoundedFormulaω Empty n) (J : Type u) [LinearOrder J] : diff --git a/LeanPool/InfinitaryLogic/Methods/EM/TailAdapter.lean b/LeanPool/InfinitaryLogic/Methods/EM/TailAdapter.lean index 71b70fc93f..90e6d9879e 100644 --- a/LeanPool/InfinitaryLogic/Methods/EM/TailAdapter.lean +++ b/LeanPool/InfinitaryLogic/Methods/EM/TailAdapter.lean @@ -46,7 +46,7 @@ The downstream consumer is `hasArbLargeModels_of_tail_extraction` in `InfinitaryLogic/Conditional/MorleyHanfTransfer.lean`. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Methods/EM/Template.lean b/LeanPool/InfinitaryLogic/Methods/EM/Template.lean index 8ce951a1b8..cbeae752fd 100644 --- a/LeanPool/InfinitaryLogic/Methods/EM/Template.lean +++ b/LeanPool/InfinitaryLogic/Methods/EM/Template.lean @@ -14,7 +14,7 @@ The downstream EM modules construct templates from indiscernible sequences and d realization properties. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Methods/GeneratedSublanguage.lean b/LeanPool/InfinitaryLogic/Methods/GeneratedSublanguage.lean index 14a945a9d9..fce4452aa2 100644 --- a/LeanPool/InfinitaryLogic/Methods/GeneratedSublanguage.lean +++ b/LeanPool/InfinitaryLogic/Methods/GeneratedSublanguage.lean @@ -23,7 +23,7 @@ the full language. Pure syntax + set-countability; no EM, no local stack, no `Conditional/`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -32,7 +32,7 @@ variable {L : Language.{0, 0}} /-! ## Function symbols mentioned by a term / formula -/ /-- The function symbols occurring in a term. -/ -def Term.functionsIn {α : Type} : L.Term α → Set (Σ n, L.Functions n) +@[expose] def Term.functionsIn {α : Type} : L.Term α → Set (Σ n, L.Functions n) | .var _ => ∅ | .func f ts => insert ⟨_, f⟩ (⋃ i, (ts i).functionsIn) @@ -42,7 +42,7 @@ theorem Term.functionsIn_countable {α : Type} (t : L.Term α) : t.functionsIn.C | func f ts ih => exact (Set.countable_iUnion ih).insert _ /-- The function symbols occurring in a formula (through all countable connectives). -/ -def BoundedFormulaω.functionsIn {α : Type} : +@[expose] def BoundedFormulaω.functionsIn {α : Type} : ∀ {n : ℕ}, L.BoundedFormulaω α n → Set (Σ n, L.Functions n) | _, .falsum => ∅ | _, .equal t u => t.functionsIn ∪ u.functionsIn @@ -76,7 +76,7 @@ a formula mentions: `relationsIn` + countability, the two-sorted `symbSublang`, restriction `restrictSymbols`, and the left-inverse law. -/ /-- The relation symbols occurring in a formula (through all countable connectives). -/ -def BoundedFormulaω.relationsIn {α : Type} : +@[expose] def BoundedFormulaω.relationsIn {α : Type} : ∀ {n : ℕ}, L.BoundedFormulaω α n → Set (Σ n, L.Relations n) | _, .falsum => ∅ | _, .equal _ _ => ∅ @@ -99,13 +99,13 @@ theorem BoundedFormulaω.relationsIn_countable {α : Type} {n : ℕ} /-- The sublanguage of `L` generated by a set `F` of function symbols AND a set `R` of relation symbols, both as subtypes. -/ -def symbSublang (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : +@[expose] def symbSublang (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : Language.{0, 0} where Functions n := {f : L.Functions n // ⟨n, f⟩ ∈ F} Relations n := {r : L.Relations n // ⟨n, r⟩ ∈ R} /-- The inclusion of the two-sorted generated sublanguage. -/ -def symbSublangIncl (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : +@[expose] def symbSublangIncl (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : symbSublang (L := L) F R →ᴸ L where onFunction := fun {_} f => f.1 onRelation := fun {_} r => r.1 diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/ConsistencyProperty.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/ConsistencyProperty.lean index 7bdd6cb61e..9a775670ce 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/ConsistencyProperty.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/ConsistencyProperty.lean @@ -24,7 +24,7 @@ of sentences satisfying closure conditions that guarantee model existence. - [Kei71] -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/Construction.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/Construction.lean index a459bdc632..7ec32fee1d 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/Construction.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/Construction.lean @@ -37,7 +37,7 @@ existence theorem for Lω₁ω. The construction proceeds in several stages: - [Kei71] -/ -@[expose] public section +public section universe u v @@ -303,14 +303,14 @@ private theorem termEquiv_equivalence (C : ConsistencyPropertyEq L) (S : Set L.S /-! ### Term Setoid and Quotient -/ /-- The Setoid on closed terms induced by the equivalence relation from S*. -/ -def termSetoid (C : ConsistencyPropertyEq L) (S : Set L.Sentenceω) +@[expose] def termSetoid (C : ConsistencyPropertyEq L) (S : Set L.Sentenceω) (hmax : C.toConsistencyProperty.MaximalConsistent S) : Setoid (L.Term Empty) where r := termEquiv C S hmax iseqv := by exact termEquiv_equivalence C S hmax /-- The carrier of the term model: closed terms quotiented by the equivalence relation `t₁ ~ t₂ ↔ (t₁ = t₂) ∈ S*`. -/ -def TermModel (C : ConsistencyPropertyEq L) (S : Set L.Sentenceω) +@[expose] def TermModel (C : ConsistencyPropertyEq L) (S : Set L.Sentenceω) (hmax : C.toConsistencyProperty.MaximalConsistent S) : Type _ := Quotient (termSetoid C S hmax) @@ -333,7 +333,7 @@ def TermModel.mk (t : L.Term Empty) : TermModel C S hmax := Quotient.mk (termSetoid C S hmax) t /-- The constant family of setoids for the quotient lifting. -/ -def termSetoidFamily (C : ConsistencyPropertyEq L) (S : Set L.Sentenceω) +@[expose] def termSetoidFamily (C : ConsistencyPropertyEq L) (S : Set L.Sentenceω) (hmax : C.toConsistencyProperty.MaximalConsistent S) (n : ℕ) : ∀ (_ : Fin n), Setoid (L.Term Empty) := fun _ => termSetoid C S hmax diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/ConsistencyPropertyEqOn.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/ConsistencyPropertyEqOn.lean index df1c31d563..e9c5d1ed23 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/ConsistencyPropertyEqOn.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/ConsistencyPropertyEqOn.lean @@ -26,7 +26,7 @@ no general `C6` (a countable `U` cannot close under arbitrary substitution templ finiteness** — finiteness belongs to the inseparable-pair instance (commit 4). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/FairEnumeration.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/FairEnumeration.lean index 73774431e1..93e77e418e 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/FairEnumeration.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/FairEnumeration.lean @@ -23,7 +23,7 @@ The remaining piece (the `HenkinComplete Sstar` acceptance theorem) is the per-f it consumes `request_fires_after` plus per-request "what `process` adds" facts. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/GeneratedUniverse.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/GeneratedUniverse.lean index b2204a52c6..2270eccf24 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/GeneratedUniverse.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/GeneratedUniverse.lean @@ -30,7 +30,7 @@ The relational-core collapse lemma `exists_eq_constTerm` (every closed term is a included — it drives the later term-model plumbing. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -57,7 +57,7 @@ theorem exists_eq_constTerm [L.IsRelational] (t : L[[ℕ]].Term Empty) : /-! ## Seeds -/ /-- A constant as a term inside a sentence (`Empty ⊕ Fin 0` variable context). -/ -def constTermS (c : ℕ) : L[[ℕ]].Term (Empty ⊕ Fin 0) := +@[expose] def constTermS (c : ℕ) : L[[ℕ]].Term (Empty ⊕ Fin 0) := Term.func (Sum.inr c : L[[ℕ]].Functions 0) Fin.elim0 /-- The closed constant `constTerm a`, relabeled into the sentence-term context, is @@ -71,11 +71,11 @@ theorem constTerm_relabel_inl (a : ℕ) : exact i.elim0 /-- The constant equality `c_a = c_b`. -/ -def constEq (a b : ℕ) : L[[ℕ]].Sentenceω := +@[expose] def constEq (a b : ℕ) : L[[ℕ]].Sentenceω := BoundedFormulaω.equal (constTermS a) (constTermS b) /-- The atomic relation instance `R(c_{g 0}, …)`. -/ -def relInst {l : ℕ} (R : L.Relations l) (g : Fin l → ℕ) : L[[ℕ]].Sentenceω := +@[expose] def relInst {l : ℕ} (R : L.Relations l) (g : Fin l → ℕ) : L[[ℕ]].Sentenceω := BoundedFormulaω.rel (Sum.inl R : L[[ℕ]].Relations l) (fun i => constTermS (g i)) /-- The seed: the two roots, all constant equalities, all constant atomic relation instances. -/ diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTermModel.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTermModel.lean index e87788c013..5ee6dc2835 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTermModel.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTermModel.lean @@ -36,7 +36,7 @@ constant-specialized equality and congruence laws. congruence, and `C0` alone. There is no `M ⊨ φ ↔ φ ∈ S` for arbitrary `φ`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTruthLemma.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTruthLemma.lean index 91c66f2568..2d245ea04e 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTruthLemma.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/CountableCompletion/QuotientTruthLemma.lean @@ -44,7 +44,7 @@ the shape of the legacy `Methods/Henkin/Construction.lean` truth lemma: from `(a discharges the universal (dually for the negated universal via `neg_all_witness`). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Henkin/ModelExistence.lean b/LeanPool/InfinitaryLogic/Methods/Henkin/ModelExistence.lean index eaabec3448..c06846c5b4 100644 --- a/LeanPool/InfinitaryLogic/Methods/Henkin/ModelExistence.lean +++ b/LeanPool/InfinitaryLogic/Methods/Henkin/ModelExistence.lean @@ -25,7 +25,7 @@ that belongs to a consistency property has a countable model. - [Kei71] -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/InfinitaryLogic/Methods/HighlyOrderTransitive.lean b/LeanPool/InfinitaryLogic/Methods/HighlyOrderTransitive.lean index 16791096dc..d97b29294c 100644 --- a/LeanPool/InfinitaryLogic/Methods/HighlyOrderTransitive.lean +++ b/LeanPool/InfinitaryLogic/Methods/HighlyOrderTransitive.lean @@ -21,14 +21,14 @@ This file supplies the consumer-shaped definition. Existence results via ordered `HighlyTransitiveField.lean` and `HighlyTransitiveExistence.lean`. -/ -@[expose] public section +public section namespace FirstOrder /-- A linear order is **highly order-transitive** when every isomorphism between two finite increasing tuples extends to an order automorphism: for all `n` and increasing `n`-tuples `s, t`, some `e : J ≃o J` has `e (s i) = t i` for all `i`. -/ -def HighlyOrderTransitive (J : Type*) [LinearOrder J] : Prop := +@[expose] def HighlyOrderTransitive (J : Type*) [LinearOrder J] : Prop := ∀ (n : ℕ) (s t : Fin n ↪o J), ∃ e : J ≃o J, ∀ i, e (s i) = t i end FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveExistence.lean b/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveExistence.lean index 29d18ccc9e..ccde469bc8 100644 --- a/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveExistence.lean +++ b/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveExistence.lean @@ -32,7 +32,7 @@ Implementation note: `Mathlib.RingTheory.HahnSeries.Summable` must be imported e the lexicographic Hahn import alone does not load the field instance. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveField.lean b/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveField.lean index 996fdf0b38..4ac0711113 100644 --- a/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveField.lean +++ b/LeanPool/InfinitaryLogic/Methods/HighlyTransitiveField.lean @@ -32,7 +32,7 @@ The automorphism is built as a piecewise strictly monotone surjection (`StrictMono.orderIsoOfSurjective`) — no order-sum gluing needed. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/BackTranslate.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/BackTranslate.lean index e89c10550f..680948801f 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/BackTranslate.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/BackTranslate.lean @@ -33,7 +33,7 @@ graph axioms, choice, or reconstruction enters. relationalization is semantically the original formula (no syntactic identity claimed). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/BaseOccurrenceProjections.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/BaseOccurrenceProjections.lean index 8d8499658e..e5037f96fd 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/BaseOccurrenceProjections.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/BaseOccurrenceProjections.lean @@ -23,7 +23,7 @@ the boundary now matches the proof architecture. Declaration names and namespac so no compatibility shims are needed. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPair.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPair.lean index b7b42066c2..3bebd73668 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPair.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPair.lean @@ -58,7 +58,7 @@ Stern's model-theoretic forcing proof is identified as the semantic dual, but it **unverified** — the paper has not been read. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -69,7 +69,7 @@ variable {L : Language.{0, 0}} {M : Type} /-! ## The constant support of a labelled side -/ /-- The Henkin constants occurring anywhere in a set of sentences. -/ -def theoryJConsts (T : Set L[[ℕ]].Sentenceω) : Set ℕ := +@[expose] def theoryJConsts (T : Set L[[ℕ]].Sentenceω) : Set ℕ := ⋃ σ ∈ T, sentenceJConsts (L' := L) (J := ℕ) σ variable {T T' : Set L[[ℕ]].Sentenceω} {σ : L[[ℕ]].Sentenceω} {c : ℕ} diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairCompletion.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairCompletion.lean index f1d1ac1500..0516ed7d29 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairCompletion.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairCompletion.lean @@ -28,7 +28,7 @@ ripple outward. converted locally — the interpolation consumer holds the former. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairModel.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairModel.lean index cd8105808a..fbb7d881ea 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairModel.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/BudgetedPairModel.lean @@ -27,7 +27,7 @@ This is the countermodel that contradicts `r₁ ⊨ r₂` in the final interpola seeded; the negative direction of the truth lemma is discarded, so no polarity argument is needed. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantElimination.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantElimination.lean index 5e6401d47e..4be72656d0 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantElimination.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantElimination.lean @@ -24,7 +24,7 @@ invariance-outside-support congruence (`realize_congr_const`), bridged to arbitr separator from constant support `insert c A` back to `A` (the InsepAt C7 step). -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -34,7 +34,7 @@ variable {L : Language.{0, 0}} {M : Type} /-- Existentially generalize the constant `c_j` out of a sentence: abstract `c_j` into the free variable `0`, then existentially quantify it. -/ -noncomputable def genEx (j : ℕ) (ρ : L[[ℕ]].Sentenceω) : L[[ℕ]].Sentenceω := +@[expose] noncomputable def genEx (j : ℕ) (ρ : L[[ℕ]].Sentenceω) : L[[ℕ]].Sentenceω := ((ρ.abstractConst j).relabel (Sum.inr : Fin 1 → Empty ⊕ Fin 1)).ex /-- Realizing the generalization is existentially witnessing the original with `c_j` diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantGeneralization.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantGeneralization.lean index 48b4315be3..b0726387f8 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantGeneralization.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/ConstantGeneralization.lean @@ -33,7 +33,7 @@ Nothing here is specific to Malitz interpolation (issue #15) or to end extension consume it. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigArbitrary.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigArbitrary.lean index 940365ed58..d93ec04f24 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigArbitrary.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigArbitrary.lean @@ -35,7 +35,7 @@ assembly of the relationalization layer over the relational core: `craig_pcSeparation_relational` stays, in the exact form issue #10 consumes). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigRelational.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigRelational.lean index d35391ce28..9aee2cffac 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigRelational.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigRelational.lean @@ -41,7 +41,7 @@ semantic contraposition — contradiction. Feeding the inseparable root pair to gives one model with `M ⊨ r₁` and `¬ M ⊨ r₂`; its base reduct contradicts `r₁ ⊨ r₂`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSeparation.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSeparation.lean index 4d53f08aeb..f81fcc970b 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSeparation.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSeparation.lean @@ -34,7 +34,7 @@ intersection (`functionsIn_not`/`relationsIn_not` strip the negation), then `res into `L₀` and read both directions off the reduct realization bridge (`realize_mapLanguage`). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSublanguage.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSublanguage.lean index 7f482e2366..172204456b 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSublanguage.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/CraigSublanguage.lean @@ -30,7 +30,7 @@ craig_interpolation_relational [L.IsRelational] : ``` -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphAxioms.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphAxioms.lean index 87ccda920f..41f272d5a7 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphAxioms.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphAxioms.lean @@ -34,7 +34,7 @@ the graph-relation convention `funMap f args = output`. Unit 5b consumes these to reconstruct an `L`-structure from any model of `graphAxioms F`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphLanguage.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphLanguage.lean index 1d32a7190a..4b6ff0adc8 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphLanguage.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphLanguage.lean @@ -33,7 +33,7 @@ computation. * `relSym` and the intersection identity `relSym_inter`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -59,7 +59,7 @@ to be type-correct at `implicit` transparency before `rw`/`simp` will act, that identification has to hold there too; otherwise every generic lemma about `graphLanguage` formulas needs a specialized copy with the symbol spelled `GraphRelation.base`/`.graph`. This is a direct structure literal with no proof content, so reducibility costs nothing. -/ -@[reducible] def graphLanguage (L : Language.{0, 0}) : Language.{0, 0} where +@[expose, reducible] def graphLanguage (L : Language.{0, 0}) : Language.{0, 0} where Functions _ := Empty Relations n := GraphRelation L n @@ -80,7 +80,7 @@ def graphRelMap (M : Type) [L.Structure M] : /-- The **graph expansion** of an `L`-structure to a `graphLanguage L`-structure: `G_f(xs, y) ↔ f(xs) = y`, base relations preserved, and no function symbols to interpret. -/ -@[reducible] def graphExpansion (L : Language.{0, 0}) (M : Type) [L.Structure M] : +@[expose, reducible] def graphExpansion (L : Language.{0, 0}) (M : Type) [L.Structure M] : (graphLanguage L).Structure M where funMap f _ := nomatch f RelMap := graphRelMap M @@ -99,12 +99,12 @@ def graphRelMap (M : Type) [L.Structure M] : /-- Embed an original relation symbol as a base graph-language relation symbol. (Codomain uses `GraphRelation L n`, definitionally `(graphLanguage L).Relations n`, so the constructor's injectivity/no-confusion lemmas apply directly.) -/ -def baseRelSym (L : Language.{0, 0}) : +@[expose] def baseRelSym (L : Language.{0, 0}) : (Σ n, L.Relations n) → (Σ n, GraphRelation L n) := fun p => ⟨p.1, GraphRelation.base p.2⟩ /-- Embed an original `n`-ary function symbol as its `(n+1)`-ary graph relation symbol. -/ -def graphRelSym (L : Language.{0, 0}) : +@[expose] def graphRelSym (L : Language.{0, 0}) : (Σ n, L.Functions n) → (Σ n, GraphRelation L n) := fun p => ⟨p.1 + 1, GraphRelation.graph p.2⟩ @@ -162,7 +162,8 @@ theorem baseRelSym_preimage_graph_singleton (q : Σ n, L.Functions n) : /-- The relation symbols of the relationalization coming from a function-symbol set `F` and a relation-symbol set `R`: base relations from `R`, graph relations from `F`. -/ -def relSym (L : Language.{0, 0}) (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) : +@[expose] def relSym (L : Language.{0, 0}) (F : Set (Σ n, L.Functions n)) + (R : Set (Σ n, L.Relations n)) : Set (Σ n, GraphRelation L n) := baseRelSym L '' R ∪ graphRelSym L '' F diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphReconstruction.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphReconstruction.lean index fd7eb2f1aa..8c212d0b33 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphReconstruction.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/GraphReconstruction.lean @@ -23,7 +23,7 @@ occurrence-aware congruence `realize_congr_symbolsIn`, the exact occurrence iden `relationsIn_relationalizeFormula`, and Unit 4's `realize_relationalizeFormula`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/Inseparability.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/Inseparability.lean index d8a813aa3c..d581720dfa 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/Inseparability.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/Inseparability.lean @@ -22,7 +22,7 @@ existential pair at support `A`. The full inseparability consistency-property in Henkin model existence belong to tranche 2. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -32,7 +32,7 @@ variable {L : Language.{0, 0}} /-- **Support-parameterized inseparability**: no separator with base symbols in `(F, R)`, constant support in `A`, entailed by `Γ` and refuted on `Δ`. -/ -def InsepAt (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) +@[expose] def InsepAt (F : Set (Σ n, L.Functions n)) (R : Set (Σ n, L.Relations n)) (A : Finset ℕ) (Γ Δ : Set L[[ℕ]].Sentenceω) : Prop := ¬ ∃ σ : L[[ℕ]].Sentenceω, σ.baseFunctionsIn ⊆ F ∧ σ.baseRelationsIn ⊆ R ∧ diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/InseparablePairFamily.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/InseparablePairFamily.lean index 64da878193..2cbb21c78c 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/InseparablePairFamily.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/InseparablePairFamily.lean @@ -34,7 +34,7 @@ The two moving parts are: `GeneratedUniverse` reachability lemmas) and finiteness (via `Set.Finite.insert`). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonArbitrary.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonArbitrary.lean index 4115d62437..0c9440b865 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonArbitrary.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonArbitrary.lean @@ -39,7 +39,7 @@ The assembly is Craig's, reused verbatim wherever polarity is irrelevant: * both entailments are Craig's graph-expansion arguments, unchanged. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonClosures.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonClosures.lean index d25beb3d23..bedea4c324 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonClosures.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonClosures.lean @@ -46,7 +46,7 @@ projections this file consumes now live in the neutral universe. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonInseparability.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonInseparability.lean index 07c5825eb7..2aa1715d8f 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonInseparability.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonInseparability.lean @@ -39,7 +39,7 @@ equation. `SentBndPol`, the one-sided closure suite, and the paired family are López–Escobar 1965, Theorem 4.0(.4). -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -52,7 +52,7 @@ variable {L : Language.{0, 0}} /-- **Polarity-refined support-parameterized inseparability**: no separator whose base function symbols lie in `F`, whose base **positively** occurring relations lie in `P` and **negatively** occurring ones in `N`, whose constant support lies in `A`, entailed by `Γ` and refuted on `Δ`. -/ -def LyndonInsepAt (F : Set (Σ n, L.Functions n)) (P N : Set (Σ n, L.Relations n)) +@[expose] def LyndonInsepAt (F : Set (Σ n, L.Functions n)) (P N : Set (Σ n, L.Relations n)) (A : Finset ℕ) (Γ Δ : Set L[[ℕ]].Sentenceω) : Prop := ¬ ∃ σ : L[[ℕ]].Sentenceω, σ.baseFunctionsIn ⊆ F ∧ σ.basePositiveRelations ⊆ P ∧ σ.baseNegativeRelations ⊆ N ∧ diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedCP.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedCP.lean index 4a81ab2ec5..737375bf56 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedCP.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedCP.lean @@ -43,7 +43,7 @@ for `exists_lyndon_paired_model_neg`. Root inseparability itself is **not** proved here; that (and interpolation) is Unit 5. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedFamily.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedFamily.lean index 1d07737a7e..19fda709cc 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedFamily.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonPairedFamily.lean @@ -39,7 +39,7 @@ Unit 4b adds the sixteen consistency-property fields, the Henkin completion, and endpoint. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelational.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelational.lean index 75e4d849bc..692a647d25 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelational.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelational.lean @@ -36,7 +36,7 @@ polarity bounds `(Pos (r₂.not), Neg (r₂.not))`, so the engine maintains the the endpoint's `(Pos r₁ ∩ Pos r₂, Neg r₁ ∩ Neg r₂)`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelationalize.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelationalize.lean index 522d6cd74a..ebc1cf05dc 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelationalize.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRelationalize.lean @@ -47,7 +47,7 @@ for Craig's graph antecedent `(graphAxioms F).and (relationalizeFormula r)` and `(graphAxioms F).imp (relationalizeFormula r)`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRootGate.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRootGate.lean index ec2e3d229b..ce5a58140d 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRootGate.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonRootGate.lean @@ -24,7 +24,7 @@ occurrence calculus, so the paired/countable-completion machinery enters the Lyn only at the countable core (`LyndonRelational.lean`), which is its first semantic consumer. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonSublanguage.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonSublanguage.lean index bdcfe2979e..8b06de8310 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonSublanguage.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/LyndonSublanguage.lean @@ -38,7 +38,7 @@ clause (.4) in full, with clause (.3)'s equality-occurrence condition deliberate recoverable without duplicating the existing `craig_interpolation_relational`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRelational.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRelational.lean index 7c8b3a2d0d..34e9433aca 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRelational.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRelational.lean @@ -31,7 +31,7 @@ converts into universality of the separator. This is the sense in which the lab for" the interpolant's class. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRootGate.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRootGate.lean index d9f06a4ecc..2b448c16c1 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRootGate.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzRootGate.lean @@ -21,7 +21,7 @@ universality is the class-preservation lemma proved alongside `stripConsts` itse composition only. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzSublanguage.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzSublanguage.lean index 89c1a8ab4b..27c9111d97 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzSublanguage.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/MalitzSublanguage.lean @@ -23,7 +23,7 @@ into the sublanguage, and `universalSigned_mapLanguage` carries it back out. Th proving those as *exact* equivalences rather than one-way implications. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInsepFamily.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInsepFamily.lean index 7e56b67c91..3063eea6d2 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInsepFamily.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInsepFamily.lean @@ -34,7 +34,7 @@ pair `(Γ, Δ)` with `Γ ⊆ SentBnd F₁ R₁`, `Δ ⊆ SentBnd F₂ R₂`, ins `M ⊨ r₁ ∧ ¬ M ⊨ r₂`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInseparability.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInseparability.lean index 17ac0318b9..994d8b8199 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInseparability.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/PairedInseparability.lean @@ -42,7 +42,7 @@ closures, the `ConsistencyPropertyEqOn` instance over the union, and the `{r₁, endpoint yielding `M ⊨ r₁ ∧ ¬ M ⊨ r₂`) is assembled on top of these gates in the next tranche. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/QuantifierRoundTrip.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/QuantifierRoundTrip.lean index 60605dbae3..2c0d422ff7 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/QuantifierRoundTrip.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/QuantifierRoundTrip.lean @@ -22,7 +22,7 @@ The Henkin truth lemma will meet an arbitrary existential `ψ.ex` (or negated un C7 consumers for arbitrary existential / negated-universal parents. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/Relationalize.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/Relationalize.lean index cfff103771..c261904226 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/Relationalize.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/Relationalize.lean @@ -37,7 +37,7 @@ lifted variable embedding `ctxLiftEmb` (no term relabeling of built formulas). * The nested-formula pilot `R(f(g(x), h(c)))`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -70,7 +70,7 @@ def relGraph {k : ℕ} (R : L.Relations k) (ts : Fin k → L.Term (α ⊕ Fin n) /-- Relationalize a formula: atoms via their term-graph flattenings (`equalGraph`/`relGraph`), connectives and quantifiers structurally. -/ -def relationalizeFormula : ∀ {n : ℕ}, L.BoundedFormulaω α n → +@[expose] def relationalizeFormula : ∀ {n : ℕ}, L.BoundedFormulaω α n → (graphLanguage L).BoundedFormulaω α n | _, .falsum => .falsum | _, .equal t u => equalGraph t u diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/RootGate.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/RootGate.lean index f751c7fd1d..f8db7a97d7 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/RootGate.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/RootGate.lean @@ -24,7 +24,7 @@ turns that *syntactic* left inverse into the *semantic* bridge the argument need documented future composition. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/Interpolation/TermGraph.lean b/LeanPool/InfinitaryLogic/Methods/Interpolation/TermGraph.lean index fc4c2c370a..900865f205 100644 --- a/LeanPool/InfinitaryLogic/Methods/Interpolation/TermGraph.lean +++ b/LeanPool/InfinitaryLogic/Methods/Interpolation/TermGraph.lean @@ -46,7 +46,7 @@ are ever needed. - The nested-term pilot `f(g(x), h(c))` (genuinely nested, includes a `0`-ary application). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LanguageMapOccurrence.lean b/LeanPool/InfinitaryLogic/Methods/LanguageMapOccurrence.lean index e9fa561d25..acda68344e 100644 --- a/LeanPool/InfinitaryLogic/Methods/LanguageMapOccurrence.lean +++ b/LeanPool/InfinitaryLogic/Methods/LanguageMapOccurrence.lean @@ -19,7 +19,7 @@ across `SchemaCompletion.lean`, `Interpolation/CraigRelational.lean` and order. Consolidating here removes that hazard. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LocalColimit.lean b/LeanPool/InfinitaryLogic/Methods/LocalColimit.lean index f7ff5b9e6a..ad7466ad85 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalColimit.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalColimit.lean @@ -39,7 +39,7 @@ Next chunks (not here): the local atom/deForm seed and its countability, then th re-base over `localColim`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -164,7 +164,7 @@ variable {M : Type} [s₀.Lang.Structure M] [Nonempty M] /-- The **stage-`k` structure** on a fixed `s₀.Lang`-model `M`: stage `0` is `M`'s own structure, and each successor stage adds the Hilbert-choice interpretation of the new *local* Skolem symbols (`localSkolemStructure`) on top of the previous stage, via the sum structure. -/ -@[implicit_reducible] noncomputable def localStageStructure : +@[expose, implicit_reducible] noncomputable def localStageStructure : (k : ℕ) → (Llocal s₀ k).Structure M | 0 => ‹s₀.Lang.Structure M› | k + 1 => @@ -232,7 +232,7 @@ end Structures /-- Transport an arity-tagged stage-`k` formula into the local colimit language along the cocone inclusion. -/ -def toLocalColimFormula (k : ℕ) (p : Σ n, (Llocal s₀ k).BoundedFormulaω Empty n) : +@[expose] def toLocalColimFormula (k : ℕ) (p : Σ n, (Llocal s₀ k).BoundedFormulaω Empty n) : Σ n, (localColim s₀).BoundedFormulaω Empty n := ⟨p.1, p.2.mapLanguage (LlocalInclusion s₀ k)⟩ diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMCardinality.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMCardinality.lean index 6e3213eaee..e843d10148 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMCardinality.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMCardinality.lean @@ -29,7 +29,7 @@ embedding travels WITH the code, expansion is a total function (`LocatedTermCode countable base language, injective deep sequence. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMCompression.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMCompression.lean index 1e9e4a3aa7..9600478e23 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMCompression.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMCompression.lean @@ -29,7 +29,7 @@ for a countable base language (`countable_localEMTupleCode`) — the quotient-tu the orbit theorem are unit 3b (`LocalEMTupleOrbit.lean`). -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMContext.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMContext.lean index eb848af252..8f25ec049c 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMContext.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMContext.lean @@ -49,7 +49,7 @@ Next layers (subsequent chunks): the `skolemNeedSymbol` witness-term transport a family-membership-carrying restricted truth lemma. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -292,7 +292,7 @@ theorem locDeepInterp_snoc (d : ℕ) (S : Finset J) {n : ℕ} /-- **Eventual deep equality**: closed terms `t, u` are identified when, for all sufficiently deep interpretations of their **combined** skeleton support, they evaluate equally in `M`. (The combined support means both terms are read against the same ordered finite skeleton.) -/ -def LocalEMEq (t u : Λ[[J]].Term Empty) : Prop := +@[expose] def LocalEMEq (t u : Λ[[J]].Term Empty) : Prop := ∀ᶠ d in Filter.atTop, locDeepInterp Λ J a d (locJSupport Λ J t ∪ locJSupport Λ J u) t = locDeepInterp Λ J a d (locJSupport Λ J t ∪ locJSupport Λ J u) u diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMEquivariance.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMEquivariance.lean index 48ba447d01..049a4e0b7b 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMEquivariance.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMEquivariance.lean @@ -37,7 +37,7 @@ targeted expanded-language equivariance (`carrierEquiv_funMap` under the renamed infinitary formula is invariant under the induced automorphism. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMFamily.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMFamily.lean index e82e30af26..7199ada251 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMFamily.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMFamily.lean @@ -46,7 +46,7 @@ The GENERIC semantic (realize) bridges live in `LocalEMContext.lean`; the old syntactic. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -57,7 +57,7 @@ variable (Λ : Language.{0, 0}) /-- The **canonical equality atom** of two `Fin m`-variable terms: the arity-`m` formula `t = u` with the variables rebound. Every de-substituted equality atom (over any `J`, any support) is definitionally of this shape. -/ -def canonEqAtom {m : ℕ} (t u : Λ.Term (Fin m)) : Λ.BoundedFormulaω Empty m := +@[expose] def canonEqAtom {m : ℕ} (t u : Λ.Term (Fin m)) : Λ.BoundedFormulaω Empty m := BoundedFormulaω.equal (t.relabel Sum.inr) (u.relabel Sum.inr) /-- The **canonical equality-atom seed**: all canonical equality atoms, over all arities. -/ @@ -75,7 +75,7 @@ private theorem canonEqAtoms_countable (hf : Countable (Σ n, Λ.Functions n)) : /-- The **canonical relation atom**: a relation symbol applied to rebound `Fin m`-variable terms. -/ -def canonRelAtom {m l : ℕ} (R : Λ.Relations l) (ts : Fin l → Λ.Term (Fin m)) : +@[expose] def canonRelAtom {m l : ℕ} (R : Λ.Relations l) (ts : Fin l → Λ.Term (Fin m)) : Λ.BoundedFormulaω Empty m := BoundedFormulaω.rel R fun i => (ts i).relabel Sum.inr @@ -98,13 +98,14 @@ private theorem canonRelAtoms_countable (hf : Countable (Σ n, Λ.Functions n)) terms: open the bound variables, substitute the terms, rebind the `p` positions — the `openBounds → subst → relabel` template of `EMTermModel.deForm`, with the `J`-dependence already factored out. -/ +@[expose] def canonDeForm {n : ℕ} (φ : Λ.BoundedFormulaω Empty n) {p : ℕ} (g : Fin n → Λ.Term (Fin p)) : Λ.BoundedFormulaω Empty p := (φ.openBounds.subst g).relabel Sum.inr /-- The **canonical deForm closure** of a base family `Γc`: all canonical deForms of its members, over all target arities and term tuples. -/ -def canonDeForms (Γc : Set (Σ n, Λ.BoundedFormulaω Empty n)) : +@[expose] def canonDeForms (Γc : Set (Σ n, Λ.BoundedFormulaω Empty n)) : Set (Σ n, Λ.BoundedFormulaω Empty n) := ⋃ q ∈ Γc, Set.range fun r : Σ p, Fin q.1 → Λ.Term (Fin p) => (⟨r.1, canonDeForm Λ q.2 r.2⟩ : Σ n, Λ.BoundedFormulaω Empty n) @@ -134,12 +135,12 @@ variable (J : Type) [LinearOrder J] /-- The `J`-constant carried by a function symbol of `Λ[[J]]`: only an arity-`0` symbol from the `constantsOn J` summand is a skeleton constant. -/ -def locJConstOf : {n : ℕ} → Λ[[J]].Functions n → Finset J +@[expose] def locJConstOf : {n : ℕ} → Λ[[J]].Functions n → Finset J | 0, Sum.inr j => {j} | _, _ => ∅ /-- The finite set of `J`-constants (skeleton constants) mentioned in a `Λ[[J]]`-term. -/ -def locJSupport {α : Type} : Λ[[J]].Term α → Finset J +@[expose] def locJSupport {α : Type} : Λ[[J]].Term α → Finset J | .var _ => ∅ | .func f ts => (Finset.univ.biUnion fun i => locJSupport (ts i)) ∪ locJConstOf Λ J f @@ -167,7 +168,7 @@ theorem locConstantsToVars_varFinset_subset (t : Λ[[J]].Term Empty) : /-- The **de-substituted term at ordered support positions**: each skeleton constant `c_j` becomes the `ℕ`-variable `deepRank S j`. -/ -def locDeTermPos (S : Finset J) (t : Λ[[J]].Term Empty) : Λ.Term ℕ := +@[expose] def locDeTermPos (S : Finset J) (t : Λ[[J]].Term Empty) : Λ.Term ℕ := t.constantsToVars.relabel (Sum.elim (fun j => deepRank J S j) Empty.elim) /-- The ordered-position term uses only variables `< S.card` once `S` covers the term's skeleton @@ -185,7 +186,7 @@ theorem locDeTermPos_varFinset_subset {S : Finset J} {t : Λ[[J]].Term Empty} /-- The **de-substituted term at `Fin S.card` positions**: `locDeTermPos` with its variables packaged as genuine `Fin S.card` indices. The finite-variable term through which every `J`-dependent atom/deForm factors. -/ -def locDeTermFin (S : Finset J) (t : Λ[[J]].Term Empty) (hsub : locJSupport Λ J t ⊆ S) : +@[expose] def locDeTermFin (S : Finset J) (t : Λ[[J]].Term Empty) (hsub : locJSupport Λ J t ⊆ S) : Λ.Term (Fin S.card) := (locDeTermPos Λ J S t).restrictVar (fun x => ⟨x.1, Finset.mem_range.mp (locDeTermPos_varFinset_subset (Λ := Λ) (J := J) hsub x.2)⟩) @@ -194,7 +195,7 @@ def locDeTermFin (S : Finset J) (t : Λ[[J]].Term Empty) (hsub : locJSupport Λ /-- The **local de-substituted equality atom**: definitionally a canonical equality atom, so its membership in `canonEqAtoms` is by construction. -/ -def locDeEqAtom (S : Finset J) (t u : Λ[[J]].Term Empty) +@[expose] def locDeEqAtom (S : Finset J) (t u : Λ[[J]].Term Empty) (ht : locJSupport Λ J t ⊆ S) (hu : locJSupport Λ J u ⊆ S) : Λ.BoundedFormulaω Empty S.card := canonEqAtom Λ (locDeTermFin Λ J S t ht) (locDeTermFin Λ J S u hu) @@ -207,7 +208,7 @@ private theorem locDeEqAtom_mem_canonEqAtoms (S : Finset J) (t u : Λ[[J]].Term ⟨⟨S.card, (locDeTermFin Λ J S t ht, locDeTermFin Λ J S u hu)⟩, rfl⟩ /-- The **local de-substituted relation atom**: definitionally a canonical relation atom. -/ -def locDeRelAtom (S : Finset J) {l : ℕ} (R : Λ.Relations l) +@[expose] def locDeRelAtom (S : Finset J) {l : ℕ} (R : Λ.Relations l) (ts : Fin l → Λ[[J]].Term Empty) (ht : ∀ i, locJSupport Λ J (ts i) ⊆ S) : Λ.BoundedFormulaω Empty S.card := canonRelAtom Λ R fun i => locDeTermFin Λ J S (ts i) (ht i) @@ -220,7 +221,7 @@ private theorem locDeRelAtom_mem_canonRelAtoms (S : Finset J) {l : ℕ} (R : Λ. ⟨⟨S.card, l, (R, fun i => locDeTermFin Λ J S (ts i) (ht i))⟩, rfl⟩ /-- The **local general de-substituted formula**: definitionally a canonical deForm of `φ`. -/ -def locDeForm (S : Finset J) {n : ℕ} (φ : Λ.BoundedFormulaω Empty n) +@[expose] def locDeForm (S : Finset J) {n : ℕ} (φ : Λ.BoundedFormulaω Empty n) (ts : Fin n → Λ[[J]].Term Empty) (hsub : ∀ i, locJSupport Λ J (ts i) ⊆ S) : Λ.BoundedFormulaω Empty S.card := canonDeForm Λ φ fun i => locDeTermFin Λ J S (ts i) (hsub i) diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMSmall.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMSmall.lean index d30c23c237..8d744c6744 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMSmall.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMSmall.lean @@ -26,7 +26,7 @@ subsingletons is countable. Transport to the original language is `Lomega1omegaS (`ModelTheory/InfinitaryTypes.lean`), not re-proved here. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMSmallModel.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMSmallModel.lean index d94d301da8..def5e04e4b 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMSmallModel.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMSmallModel.lean @@ -32,7 +32,7 @@ realized types (`lomega1omegaSmall` on the `localColim` reduct, descended to the by `Lomega1omegaSmall.of_expansion`). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMSupport.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMSupport.lean index 67cc79812c..16779eb86e 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMSupport.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMSupport.lean @@ -24,7 +24,7 @@ Language-independent lemmas consumed by BOTH the original `skolemColim`-based EM `Finset.orderEmbOfFin`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -63,7 +63,7 @@ variable (J : Type) [LinearOrder J] /-- The **rank** of `j` in a finite support `S`: the number of support elements below it, i.e. its 0-indexed position in the increasing `J`-order. So a support `{j₀ < j₁ < …}` has ranks `0, 1, …` and the deep interpretation sends it to `a_d, a_{d+1}, …` (a strictly-increasing deep tuple). -/ -def deepRank (S : Finset J) (j : J) : ℕ := (S.filter (· < j)).card +@[expose] def deepRank (S : Finset J) (j : J) : ℕ := (S.filter (· < j)).card /-- On the support, ranks strictly increase with `J`-order: the deep tuple is strictly increasing, hence injective on the support. -/ diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean index 881eddd9fb..c23b308709 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean @@ -70,7 +70,7 @@ part of the pure local stack guarded by `check_local_boundary.sh`'s EM-free root downstream Conditional-touching file. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMTruth.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMTruth.lean index db6e5e4193..27fc395614 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMTruth.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMTruth.lean @@ -47,7 +47,7 @@ This is the local analogue of `EMTermModel.lean:114–180`. It is a pure file (i stays off the EM stack. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -68,7 +68,7 @@ support `S`: `φ` holds in `M` on the deep interpretations of the terms, for all deep `d`. The right-hand side of the restricted truth lemma. Local analogue of `EMContext.eventualDeepTruth`. -/ -def LocalEMContext.eventualDeepTruth (ctx : LocalEMContext Λ J (M := M)) {n : ℕ} +@[expose] def LocalEMContext.eventualDeepTruth (ctx : LocalEMContext Λ J (M := M)) {n : ℕ} (φ : Λ.BoundedFormulaω Empty n) (ts : Fin n → Λ[[J]].Term Empty) (S : Finset J) : Prop := ∀ᶠ d in Filter.atTop, φ.Realize Empty.elim fun i => locDeepInterp Λ J ctx.a d S (ts i) @@ -284,7 +284,7 @@ the local Skolem symbol `skolemNeedSymbol h` (witnessing `∃ xₙ, ¬ψ`), in t summand of `Llocal s₀ (k+1)`, included through `LlocalInclusion s₀ (k+1)` and then `lhomWithConstants`, applied to the closed argument terms `ts`. Local analogue of `skWitnessTerm`. -/ -def locSkWitnessTerm {k n : ℕ} {ψ : (Llocal s₀ k).BoundedFormulaω Empty (n + 1)} +@[expose] def locSkWitnessTerm {k n : ℕ} {ψ : (Llocal s₀ k).BoundedFormulaω Empty (n + 1)} (h : (⟨n, .all ψ⟩ : Σ n, (Llocal s₀ k).BoundedFormulaω Empty n) ∈ Γlocal s₀ k) (ts : Fin n → (localColim s₀)[[J]].Term Empty) : (localColim s₀)[[J]].Term Empty := Term.func ((lhomWithConstants (localColim s₀) J).onFunction diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMTruthLemma.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMTruthLemma.lean index 2d2a2e1256..27593f95dc 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMTruthLemma.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMTruthLemma.lean @@ -63,7 +63,7 @@ as is the final connection to `TailTemplateRealizable`. This is a pure file (imp `LocalEMTruth`, hence the pure local stack only) — no EM-stack or `Conditional/` reach. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMTupleOrbit.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMTupleOrbit.lean index db066712bf..9ab03cbd79 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMTupleOrbit.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMTupleOrbit.lean @@ -27,7 +27,7 @@ only creates more codes, and countability plus "same code ⇒ same orbit" is all countably-many-types argument consumes. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/LocalSkolem.lean b/LeanPool/InfinitaryLogic/Methods/LocalSkolem.lean index ebd423f706..4dc29454c8 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalSkolem.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalSkolem.lean @@ -25,7 +25,7 @@ This file builds the language, its Hilbert-choice structure, and its countabilit recursive language/closure tower is a later chunk. -/ -@[expose] public section +public section universe u v w @@ -38,7 +38,7 @@ for each `(n+1)`-ary formula **that lies in `Γ`** (witnessing its last existential), and no relation symbols. Unlike `skolem₁ω L` (which Skolemizes *all* formulas and is uncountable), this stays countable whenever `Γ` is. -/ -def localSkolem (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : Language.{0, 0} where +@[expose] def localSkolem (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : Language.{0, 0} where Functions n := {φ : L.BoundedFormulaω Empty (n + 1) // (⟨n + 1, φ⟩ : Σ n, L.BoundedFormulaω Empty n) ∈ Γ} Relations _ := Empty @@ -48,7 +48,7 @@ variable {L} /-- The **local Skolem structure** on `M`: each symbol (a formula `φ` of `Γ`) is interpreted as a Hilbert-choice witness for `∃ xₙ, φ`, exactly as in `skolem₁ωStructure` but only for the symbols of the restricted family. -/ -noncomputable instance localSkolemStructure {M : Type w} [L.Structure M] [Nonempty M] +@[expose] noncomputable instance localSkolemStructure {M : Type w} [L.Structure M] [Nonempty M] (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : (localSkolem L Γ).Structure M where funMap {_} φ x := Classical.epsilon fun a => φ.1.Realize (Empty.elim : Empty → M) (Fin.snoc x a) RelMap {_} r := r.elim diff --git a/LeanPool/InfinitaryLogic/Methods/LocalSkolemUniversal.lean b/LeanPool/InfinitaryLogic/Methods/LocalSkolemUniversal.lean index 8a3107e900..1ad44d1cb3 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalSkolemUniversal.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalSkolemUniversal.lean @@ -29,7 +29,7 @@ as wrappers supplying the canonical proof) and discharges it for `schemaTermStru restricted schema truth lemma. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LocalTower.lean b/LeanPool/InfinitaryLogic/Methods/LocalTower.lean index ef747316e2..bd53cd4946 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalTower.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalTower.lean @@ -36,7 +36,7 @@ this chunk** is that every stage is countable — both the language's symbol typ countability live in `LocalColimit.lean`; here we stop at the tower and its stagewise countability. -/ -@[expose] public section +public section universe u v w @@ -113,7 +113,7 @@ private theorem allNegBody_countable (p : Σ n, L.BoundedFormulaω Empty n) : /-- The **Skolem-need family**: `Γ` together with the negated bodies of its universal members. This — not `Γ` itself — is the family the successor stage Skolemizes. -/ -def skolemNeed (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : +@[expose] def skolemNeed (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : Set (Σ n, L.BoundedFormulaω Empty n) := Γ ∪ ⋃ p ∈ Γ, allNegBody p @@ -149,7 +149,7 @@ when `Γ` is, so the whole seed is. -/ /-- The **lift** of `Γ` into the successor language `L.sum (localSkolem L Γ)` along the left injection `LHom.sumInl`. Arity is preserved. -/ -def liftGamma (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : +@[expose] def liftGamma (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : Set (Σ n, (L.sum (localSkolem L Γ)).BoundedFormulaω Empty n) := (fun p : Σ n, L.BoundedFormulaω Empty n => (⟨p.1, p.2.mapLanguage (LHom.sumInl : L →ᴸ L.sum (localSkolem L Γ))⟩ : @@ -241,7 +241,7 @@ symbol for `¬ψ` of each `∀ψ ∈ Gamma` exists) and replace the family by it Every countability certificate is carried forward: the family via `localGammaNext_countable`, the language via `sum_sigma_functions_countable` / `sum_sigma_relations_countable` together with `localSkolem`'s own countability (fed by `skolemNeed_countable`). -/ -def LocalStage.succ (s : LocalStage) : LocalStage where +@[expose] def LocalStage.succ (s : LocalStage) : LocalStage where Lang := s.Lang.sum (localSkolem s.Lang (skolemNeed s.Gamma)) Gamma := localGammaNext (skolemNeed s.Gamma) gamma_countable := by exact localGammaNext_countable (skolemNeed_countable s.gamma_countable) @@ -255,22 +255,22 @@ def LocalStage.succ (s : LocalStage) : LocalStage where /-- The **local Skolem tower** seeded at `s₀`: stage `0` is the seed and each successor Skolemizes the current stage. -/ -def localStage (s₀ : LocalStage) : ℕ → LocalStage +@[expose] def localStage (s₀ : LocalStage) : ℕ → LocalStage | 0 => s₀ | k + 1 => (localStage s₀ k).succ /-! ### Projections consumed by the later local-colimit chunk -/ /-- The **stage-`k` local language** `L_k`. -/ -def Llocal (s₀ : LocalStage) (k : ℕ) : Language.{0, 0} := (localStage s₀ k).Lang +@[expose] def Llocal (s₀ : LocalStage) (k : ℕ) : Language.{0, 0} := (localStage s₀ k).Lang /-- The **stage-`k` local family** `Γ_k`. -/ -def Γlocal (s₀ : LocalStage) (k : ℕ) : Set (Σ n, (Llocal s₀ k).BoundedFormulaω Empty n) := +@[expose] def Γlocal (s₀ : LocalStage) (k : ℕ) : Set (Σ n, (Llocal s₀ k).BoundedFormulaω Empty n) := (localStage s₀ k).Gamma /-- The **stage-`k` → stage-`(k+1)` language inclusion**: the left injection of the Skolemizing sum. The later colimit's cocone is assembled from these. -/ -def LlocalHom (s₀ : LocalStage) (k : ℕ) : Llocal s₀ k →ᴸ Llocal s₀ (k + 1) := LHom.sumInl +@[expose] def LlocalHom (s₀ : LocalStage) (k : ℕ) : Llocal s₀ k →ᴸ Llocal s₀ (k + 1) := LHom.sumInl /-- Each stage-`k` family is countable. -/ theorem Γlocal_countable (s₀ : LocalStage) (k : ℕ) : (Γlocal s₀ k).Countable := diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/CodeClass.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/CodeClass.lean index da98a25871..3971a985b1 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/CodeClass.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/CodeClass.lean @@ -25,7 +25,7 @@ sentence, read a branch off it, and land the base reduct back in `B` — **the o `codeReduct '' ModelsOf (pcSentence side T) = B`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Disjoint.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Disjoint.lean index 4897018c9a..1a8baa569e 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Disjoint.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Disjoint.lean @@ -28,7 +28,7 @@ Endpoints: `pcMem_disjoint` and `pcSentences_entails_not`, the latter being exac Unit 5 feeds to `craig_pcSeparation_relational`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/FunctionalTheta.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/FunctionalTheta.lean index 5a5aa8f4b0..22347743f1 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/FunctionalTheta.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/FunctionalTheta.lean @@ -40,7 +40,7 @@ with `queryCode` of the base-reduct code `pulledCode`); the tree pinning as an * (`realize_treeDiagram`); and the bundled `functionalTheta T`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCMem.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCMem.lean index 5748104c7d..c62e7f6bc4 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCMem.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCMem.lean @@ -21,7 +21,7 @@ membership in `codeReduct '' ModelsOf Θ`. This freezes the PC-class interface of López–Escobar's tree machinery. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCSentence.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCSentence.lean index cc48444232..876f32d37f 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCSentence.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/PCSentence.lean @@ -36,7 +36,7 @@ Acceptance gates (audit v2, Unit 2b): `pcSentence_relationsIn_inter` is the two-presentation intersection bound. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -100,7 +100,7 @@ private theorem sideEmb_onRelation_mem (side : PCSide) (p : Σ n, (MidLang L).Re variable (L) in /-- **The side-parametric functional PC sentence**: `functionalTheta` mapped into the tagged language along the side's embedding — defined once, instantiated twice. -/ -noncomputable def functionalPCSentence [Countable (Σ l, L.Relations l)] (side : PCSide) +@[expose] noncomputable def functionalPCSentence [Countable (Σ l, L.Relations l)] (side : PCSide) (T : (n : ℕ) → Set ((Fin n → Bool) × (Fin n → ℕ))) : (KLang L).Sentenceω := (functionalTheta L T).mapLanguage (sideEmb L side) diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Separation.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Separation.lean index 4ad94ca5b2..81544c1136 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Separation.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/Separation.lean @@ -33,7 +33,7 @@ So `IsomorphismInvariant` is consumed exactly where Unit 3b/Unit 4 already consu inside `pcSentences_entails_not`; this unit adds no further use of it. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/SharedDecoder.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/SharedDecoder.lean index 24cdd8366d..34e4423830 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/SharedDecoder.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/SharedDecoder.lean @@ -32,7 +32,7 @@ Contents: sentence holds in the sublanguage reduct of `d` iff its decoding holds in `codeReduct d`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/StandardModel.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/StandardModel.lean index 1f90bae25d..42351fccd9 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/StandardModel.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/StandardModel.lean @@ -27,7 +27,7 @@ Forward acceptance gate (`subset_pcClass`): `c ∈ B → ∃ d, codeReduct d = c d ∈ ModelsOf (pcSentence side T)` — **without** `IsomorphismInvariant`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/TaggedGlue.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/TaggedGlue.lean index a4aa0e22f0..d7f42d34c5 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/TaggedGlue.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/TaggedGlue.lean @@ -27,7 +27,7 @@ Endpoint (`pcMem_glue`): `PCMem ψleft M ∧ PCMem ψright M → ∃ S, Realize the realizations using `S`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/WitnessLang.lean b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/WitnessLang.lean index abb48681c2..16b3b79f47 100644 --- a/LeanPool/InfinitaryLogic/Methods/LopezEscobar/WitnessLang.lean +++ b/LeanPool/InfinitaryLogic/Methods/LopezEscobar/WitnessLang.lean @@ -24,7 +24,7 @@ witness, and right witness symbols; the tagged symbol-image sets; and their pair disjointness (the combinatorial half of the Unit-1 occurrence gate). -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -43,7 +43,7 @@ inductive WitnessRel : ℕ → Type | tree (n : ℕ) : WitnessRel (2 * n) /-- **The functional witness language** (Marker's `τ*`, audit v2 D4). -/ -def WitnessLang : Language.{0, 0} where +@[expose] def WitnessLang : Language.{0, 0} where Functions := WitnessFun Relations := WitnessRel diff --git a/LeanPool/InfinitaryLogic/Methods/MarkerStage.lean b/LeanPool/InfinitaryLogic/Methods/MarkerStage.lean index db26866356..55009f7751 100644 --- a/LeanPool/InfinitaryLogic/Methods/MarkerStage.lean +++ b/LeanPool/InfinitaryLogic/Methods/MarkerStage.lean @@ -89,7 +89,7 @@ witness index (enabled by the finite-Henkin-support invariant — see the Layer note), then the Henkin construction/model-existence adapter decision. -/ -@[expose] public section +public section universe u @@ -357,7 +357,7 @@ abbrev henkinConstsIn {α : Type} {n : ℕ} /-- The `J`-constant support of an expansion formula: the `J`-constants sit inside the base `L''[[J]]` layer, under `Sum.inl ∘ Sum.inr`. -/ -def expJConstsIn {α : Type} {n : ℕ} (φ : ((L''[[J]])[[ℕ]]).BoundedFormulaω α n) : Set J := +@[expose] def expJConstsIn {α : Type} {n : ℕ} (φ : ((L''[[J]])[[ℕ]]).BoundedFormulaω α n) : Set J := {j | (⟨0, (Sum.inl (Sum.inr j) : ((L''[[J]])[[ℕ]]).Functions 0)⟩ : Σ n, ((L''[[J]])[[ℕ]]).Functions n) ∈ BoundedFormulaω.functionsIn φ} @@ -378,7 +378,7 @@ variable {L'' : Language.{0, 0}} {J : Type} {M : Type} [L''.Structure M] /-- Evaluation of an expansion term under a skeleton interpretation `σ : J → M` and a Henkin interpretation `h : ℕ → M`. -/ -def termValueWith (σ : J → M) (h : ℕ → M) {β : Type} +@[expose] def termValueWith (σ : J → M) (h : ℕ → M) {β : Type} (t : ((L''[[J]])[[ℕ]]).Term β) (v : β → M) : M := letI : (constantsOn J).Structure M := constantsOn.structure σ letI : (constantsOn ℕ).Structure M := constantsOn.structure h diff --git a/LeanPool/InfinitaryLogic/Methods/PolarityCalculus.lean b/LeanPool/InfinitaryLogic/Methods/PolarityCalculus.lean index ffad38d8d8..b5bd323477 100644 --- a/LeanPool/InfinitaryLogic/Methods/PolarityCalculus.lean +++ b/LeanPool/InfinitaryLogic/Methods/PolarityCalculus.lean @@ -31,7 +31,7 @@ Acceptance gates of Unit 0 (all in this file or its Core companion): No semantics and no inseparability notions appear in Unit 0. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaCompletion.lean b/LeanPool/InfinitaryLogic/Methods/SchemaCompletion.lean index abcf72b95b..76b58f87b3 100644 --- a/LeanPool/InfinitaryLogic/Methods/SchemaCompletion.lean +++ b/LeanPool/InfinitaryLogic/Methods/SchemaCompletion.lean @@ -40,7 +40,7 @@ No completion, Zorn, term model, or `realizeWith` bridge appears here — this c pins the countable substrate. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaLocalEMSource.lean b/LeanPool/InfinitaryLogic/Methods/SchemaLocalEMSource.lean index 7e883ecb58..e3a4aaab3d 100644 --- a/LeanPool/InfinitaryLogic/Methods/SchemaLocalEMSource.lean +++ b/LeanPool/InfinitaryLogic/Methods/SchemaLocalEMSource.lean @@ -30,7 +30,7 @@ a contradiction. The universal sentence is therefore positive, and the truth lem into the quotient. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaOmegaWitness.lean b/LeanPool/InfinitaryLogic/Methods/SchemaOmegaWitness.lean index c3dd838ebc..d0aa9cf731 100644 --- a/LeanPool/InfinitaryLogic/Methods/SchemaOmegaWitness.lean +++ b/LeanPool/InfinitaryLogic/Methods/SchemaOmegaWitness.lean @@ -29,7 +29,7 @@ No enumeration, Zorn, or term model appears here — this is the interface miles the shape the ω-stage completion (Layer 7b) must produce. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaTermModel.lean b/LeanPool/InfinitaryLogic/Methods/SchemaTermModel.lean index d2cfc8eed4..ebc32e26a1 100644 --- a/LeanPool/InfinitaryLogic/Methods/SchemaTermModel.lean +++ b/LeanPool/InfinitaryLogic/Methods/SchemaTermModel.lean @@ -30,7 +30,7 @@ sequence `schemaSeq` (the classes of the `d`-constants). No `iSup`, `all`, or tr that is checkpoint 5b. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SchemaTermTruth.lean b/LeanPool/InfinitaryLogic/Methods/SchemaTermTruth.lean index 984e4eb7eb..0007b0bc6e 100644 --- a/LeanPool/InfinitaryLogic/Methods/SchemaTermTruth.lean +++ b/LeanPool/InfinitaryLogic/Methods/SchemaTermTruth.lean @@ -24,7 +24,7 @@ proof is the same contrapositive Hilbert-choice argument — `localSkolem_funMap tuple-shape hypothesis, so nothing about `σ` is used beyond interpreting the argument terms. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SkolemClosure.lean b/LeanPool/InfinitaryLogic/Methods/SkolemClosure.lean index d600c96b24..bfff7aca02 100644 --- a/LeanPool/InfinitaryLogic/Methods/SkolemClosure.lean +++ b/LeanPool/InfinitaryLogic/Methods/SkolemClosure.lean @@ -20,7 +20,7 @@ The concrete formula `stepOne` (subformulas / components / Skolem witnesses / re to the lifted EM starting family. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/SkolemColimit.lean b/LeanPool/InfinitaryLogic/Methods/SkolemColimit.lean index b4bb8a7694..99be18af92 100644 --- a/LeanPool/InfinitaryLogic/Methods/SkolemColimit.lean +++ b/LeanPool/InfinitaryLogic/Methods/SkolemColimit.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.SetLike tower uses this generic construction for its function and relation symbols. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -26,11 +26,11 @@ namespace FirstOrder.Language /-- The sequential colimit of a tower of types `F 0 → F 1 → …` along maps `φ`, as the quotient of `Σ k, F k` identifying `⟨k, x⟩` with `⟨k+1, φ k x⟩`. -/ -def DirectedColim (F : ℕ → Type) (φ : ∀ k, F k → F (k + 1)) : Type := +@[expose] def DirectedColim (F : ℕ → Type) (φ : ∀ k, F k → F (k + 1)) : Type := Quot (fun a b : Σ k, F k => b = ⟨a.1 + 1, φ a.1 a.2⟩) /-- The canonical inclusion of stage `k` into the colimit. -/ -def DirectedColim.incl {F : ℕ → Type} {φ : ∀ k, F k → F (k + 1)} (k : ℕ) (x : F k) : +@[expose] def DirectedColim.incl {F : ℕ → Type} {φ : ∀ k, F k → F (k + 1)} (k : ℕ) (x : F k) : DirectedColim F φ := Quot.mk _ ⟨k, x⟩ diff --git a/LeanPool/InfinitaryLogic/Methods/SymbSublangExpansion.lean b/LeanPool/InfinitaryLogic/Methods/SymbSublangExpansion.lean index ee2b3806ea..be39f348c2 100644 --- a/LeanPool/InfinitaryLogic/Methods/SymbSublangExpansion.lean +++ b/LeanPool/InfinitaryLogic/Methods/SymbSublangExpansion.lean @@ -27,7 +27,7 @@ of any `Conditional` file. via the expansion of an arbitrary sublanguage model. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/TailIndiscernible.lean b/LeanPool/InfinitaryLogic/Methods/TailIndiscernible.lean index e23cdb9ea1..bd015bd443 100644 --- a/LeanPool/InfinitaryLogic/Methods/TailIndiscernible.lean +++ b/LeanPool/InfinitaryLogic/Methods/TailIndiscernible.lean @@ -20,7 +20,7 @@ surface (imported by `TailAdapter.lean` → `Admissible.lean`); being neutral an harmless, unlike routing the def through the WIP-excluded `LocalEMSupport.lean`. -/ -@[expose] public section +public section universe u v @@ -32,7 +32,7 @@ variable {L : Language.{u, v}} {M : Type*} [L.Structure M] beyond which all strictly monotone tuples of the sequence agree. Weaker than `IsLomega1omegaIndiscernibleOn` (which is the cutoff-`0` case), and the form actually produced by Erdős–Rado extraction arguments. -/ -def IsLomega1omegaIndiscernibleOnTail (a : ℕ → M) +@[expose] def IsLomega1omegaIndiscernibleOnTail (a : ℕ → M) (Γ : Set (Σ n, L.BoundedFormulaω Empty n)) : Prop := ∀ {n : ℕ} {φ : L.BoundedFormulaω Empty n}, ⟨n, φ⟩ ∈ Γ → ∃ N : ℕ, ∀ s t : Fin n → ℕ, StrictMono s → StrictMono t → diff --git a/LeanPool/InfinitaryLogic/Methods/UniformCollapse.lean b/LeanPool/InfinitaryLogic/Methods/UniformCollapse.lean index a532621664..4977e42c64 100644 --- a/LeanPool/InfinitaryLogic/Methods/UniformCollapse.lean +++ b/LeanPool/InfinitaryLogic/Methods/UniformCollapse.lean @@ -31,7 +31,7 @@ supplied generically (`realize_mapLanguage`) and smallness descends by of the collapsed sentence. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/BaseMember.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/BaseMember.lean index e804b0f3c2..1f16f16763 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/BaseMember.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/BaseMember.lean @@ -27,7 +27,7 @@ This separately certifies that the strengthened terminal/bottom-margin invariant that is consumed. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/ClosureFields.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/ClosureFields.lean index f9bae37c68..2c936ab41e 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/ClosureFields.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/ClosureFields.lean @@ -27,7 +27,7 @@ changes nothing); the genuine extensions go through `WOMem.extend`, whose three `StarWitness` operations of the previous commits. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/CofinalFiber.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/CofinalFiber.lean index 849f5fa76f..7d4037e44d 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/CofinalFiber.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/CofinalFiber.lean @@ -24,7 +24,7 @@ Proof: if every fiber were bounded, the supremum of countably many bounds would `ω₁` — contradicting the regularity of `ℵ₁` (via `Ordinal.iSup_lt_omega_one`). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/Constants.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/Constants.lean index e5718bf89d..8765775de0 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/Constants.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/Constants.lean @@ -21,7 +21,7 @@ This commit is the coding layer only: the two index functions, their injectivity disjointness, and the term/sentence-level wrappers over the kernel's `constTerm`/`constTermS`. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -50,6 +50,6 @@ theorem ratConstIdx_ne_henkinConstIdx (q : ℚ) (n : ℕ) : variable {L : Language.{0, 0}} /-- The rational constant `d_q` as a closed `L[[ℕ]]`-term. -/ -def ratConstTerm (q : ℚ) : L[[ℕ]].Term Empty := constTerm (ratConstIdx q) +@[expose] def ratConstTerm (q : ℚ) : L[[ℕ]].Term Empty := constTerm (ratConstIdx q) end FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/Descent.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/Descent.lean index e896c90cc1..b1dde0dbbd 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/Descent.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/Descent.lean @@ -24,7 +24,7 @@ model extraction involved: strict-order hypotheses, so `RelEmbedding.natGT` is deliberately not used). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapInsertion.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapInsertion.lean index 3f7b66ab26..f7a671c908 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapInsertion.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapInsertion.lean @@ -21,7 +21,7 @@ margin obligation is ordinal-rank arithmetic, and the four cases collapse into a `Fin.succAbove` case analysis. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapWitness.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapWitness.lean index 41225eb71a..d8006c6eec 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapWitness.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GapWitness.lean @@ -32,7 +32,7 @@ the uniform insertion lemma) needs the chain to be long enough to contain rank ` `GapWitness.mono` is the downward closure in `α` consumed by the `ω₁` fiber argument (C4). -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -43,7 +43,7 @@ variable {L : Language.{0, 0}} /-! ## The base diagram -/ /-- The positive order atom `d_q < d_r` (over the rational constants of the coding layer). -/ -def ratLtAtom (lt : L.Relations 2) (q r : ℚ) : L[[ℕ]].Sentenceω := +@[expose] def ratLtAtom (lt : L.Relations 2) (q r : ℚ) : L[[ℕ]].Sentenceω := relInst lt ![ratConstIdx q, ratConstIdx r] /-- **The base diagram** `Bφ = {φ} ∪ {d_q < d_r : q < r}`: the lifted sentence together with diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean index d1a743cda5..b38b920ce0 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean @@ -31,7 +31,7 @@ The four public **arbitrary-language** endpoints of issue #12 live here: `wellOrder_type_boundedness` (Marker Corollary 4.27), and `wellOrdering_undefinable`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/MarkExtension.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/MarkExtension.lean index da31979a0b..db15ff8ef5 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/MarkExtension.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/MarkExtension.lean @@ -35,7 +35,7 @@ like Henkin constants, as ordinary auxiliary constants with no rank insertion). invariant. Already-marked rationals need only downward closure. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/ModelExtraction.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/ModelExtraction.lean index c508f1eb6f..c51fd48734 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/ModelExtraction.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/ModelExtraction.lean @@ -21,7 +21,7 @@ quotient term model (the relational-core collapse of closed terms to constants), the later transport step, not done here. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/StarCondition.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/StarCondition.lean index cc545b592e..f9e84f10a8 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/StarCondition.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/StarCondition.lean @@ -33,7 +33,7 @@ universe containment (the kernel's `GenU`, whose seed already holds every consta atom — in particular all of `Bφ`'s diagram), and (*) at every countable ordinal. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/SymbolCountability.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/SymbolCountability.lean index d85280974c..6dde210d62 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/SymbolCountability.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/SymbolCountability.lean @@ -26,7 +26,7 @@ relation survives the restriction): the separate arbitrary-function-language graph translation, not this wrapper. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/Undefinability.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/Undefinability.lean index 08d17d2ef5..d1a6a58a5d 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/Undefinability.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/Undefinability.lean @@ -28,7 +28,7 @@ every other arity as empty — this avoids deciding equality against the disting `lt`, which a general language does not support. -/ -@[expose] public section +public section namespace FirstOrder.Language @@ -36,7 +36,7 @@ open FirstOrder /-- The all-arities relation family on an ordinal's type: binary positions get the ordinal order, every other arity is empty. -/ -def ordRel (α : Ordinal.{0}) : ∀ n, (Fin n → α.ToType) → Prop +@[expose] def ordRel (α : Ordinal.{0}) : ∀ n, (Fin n → α.ToType) → Prop | 2, v => v 0 < v 1 | _, _ => False diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/WOConsistency.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/WOConsistency.lean index c8fa1a2da0..5cfd966228 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/WOConsistency.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/WOConsistency.lean @@ -32,7 +32,7 @@ Step 5 consumes the returned `S` opaquely: the quotient term model realizes the `RelPreserving`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/WORealization.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/WORealization.lean index be19f13ea3..eefe1fa3ab 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/WORealization.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/WORealization.lean @@ -31,7 +31,7 @@ The shared semantic tools the fifteen closure fields consume, isolated per revie `lift_eq_falsum_reflect`). -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/ModelTheory/AElementary.lean b/LeanPool/InfinitaryLogic/ModelTheory/AElementary.lean index 9d99b6ee2b..c712b1a4dd 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/AElementary.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/AElementary.lean @@ -20,7 +20,7 @@ universals to full A-elementarity — witnesses are ELEMENTS (semantic parameter syntactic substitution enters the induction. -/ -@[expose] public section +public section namespace FirstOrder @@ -31,7 +31,7 @@ variable {L : Language.{u, v}} {M N P : Type w} /-- **A-elementarity**: truth agreement on every fragment member, at every tuple, along an embedding. -/ -def AElementary (A : Fragment L) (f : N ↪[L] M) : Prop := +@[expose] def AElementary (A : Fragment L) (f : N ↪[L] M) : Prop := ∀ {n : ℕ} (φ : L.BoundedFormulaω Empty n), (⟨n, φ⟩ : Σ n, L.BoundedFormulaω Empty n) ∈ A.toSet → ∀ a : Fin n → N, (φ.Realize Empty.elim (⇑f ∘ a) ↔ φ.Realize Empty.elim a) diff --git a/LeanPool/InfinitaryLogic/ModelTheory/ArbitraryStabilization.lean b/LeanPool/InfinitaryLogic/ModelTheory/ArbitraryStabilization.lean index a1fc80f0a9..195581eefe 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/ArbitraryStabilization.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/ArbitraryStabilization.lean @@ -29,7 +29,7 @@ of the audited thin bridge) then upgrades stabilized `BFEquiv α` to EVERY ordin (`bfEquiv_all_of_stabilizesCompletely_arbitrary`). -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/CountableCompanion.lean b/LeanPool/InfinitaryLogic/ModelTheory/CountableCompanion.lean index 3cbffe5bbb..94846f8bd2 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/CountableCompanion.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/CountableCompanion.lean @@ -23,7 +23,7 @@ Still language-general (countable function symbols only — relationality first BF/Scott packaging boundary, per the frozen audit). -/ -@[expose] public section +public section namespace FirstOrder @@ -37,7 +37,7 @@ variable {L : Language.{u, v}} {M : Type w} [L.Structure M] /-- The controlling seed: all isolators, and the existential closures of all isolators of one higher arity. -/ -def isolatorSeed (hsmall : Lomega1omegaSmall (L := L) M) : +@[expose] def isolatorSeed (hsmall : Lomega1omegaSmall (L := L) M) : Set (Σ n, L.BoundedFormulaω Empty n) := (⋃ n : ℕ, (fun p : Set (L.BoundedFormulaω Empty n) => (⟨n, isolatingFormula (hsmall n) p⟩ : Σ n, L.BoundedFormulaω Empty n)) '' diff --git a/LeanPool/InfinitaryLogic/ModelTheory/CountingModels.lean b/LeanPool/InfinitaryLogic/ModelTheory/CountingModels.lean index cf74a02ad6..8c9e2e87e6 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/CountingModels.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/CountingModels.lean @@ -28,7 +28,7 @@ to the structure of the isomorphism relation. - [KK04] -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/InfinitaryLogic/ModelTheory/FragmentLowenheimSkolem.lean b/LeanPool/InfinitaryLogic/ModelTheory/FragmentLowenheimSkolem.lean index 966ccdfc3c..55fbbc086f 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/FragmentLowenheimSkolem.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/FragmentLowenheimSkolem.lean @@ -35,7 +35,7 @@ compared therefore start in three different universes, so every bound is stated same-universe form, where those lifts are identities. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/Hanf.lean b/LeanPool/InfinitaryLogic/ModelTheory/Hanf.lean index 43327d7928..0ac0b5ff62 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/Hanf.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/Hanf.lean @@ -35,7 +35,7 @@ arbitrary language — is proved in `Conditional/MorleyHanfSchemaDischarge.lean` - [Mar16], §5 -/ -@[expose] public section +public section universe u v @@ -49,13 +49,13 @@ open FirstOrder Structure Cardinal /-- A sentence has arbitrarily large models if for every cardinal κ, there exists a model of size ≥ κ. -/ -def HasArbLargeModels (φ : L.Sentenceω) : Prop := +@[expose] def HasArbLargeModels (φ : L.Sentenceω) : Prop := ∀ κ : Cardinal, ∃ (M : Type) (_ : L.Structure M), Sentenceω.Realize φ M ∧ Cardinal.mk M ≥ κ /-- A cardinal κ is a Hanf bound for a sentence φ if the existence of a model of size ≥ κ implies that φ has arbitrarily large models. -/ -def IsHanfBound (φ : L.Sentenceω) (κ : Cardinal) : Prop := +@[expose] def IsHanfBound (φ : L.Sentenceω) (κ : Cardinal) : Prop := (∃ (M : Type) (_ : L.Structure M), Sentenceω.Realize φ M ∧ Cardinal.mk M ≥ κ) → HasArbLargeModels φ diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/BethLadder.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/BethLadder.lean index f9940711fd..eeb3169c37 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/BethLadder.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/BethLadder.lean @@ -25,7 +25,7 @@ upper bound `Lomega1omegaHanfNumber_le_beth_omega1`: Reference: Marker, *Lectures on Infinitary Model Theory*, Exercise 5.3 and Theorem 5.4. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/CardinalBounds.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/CardinalBounds.lean index ab85898fdb..c324280e22 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/CardinalBounds.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/CardinalBounds.lean @@ -30,7 +30,7 @@ the right side is the empty supremum), so Mathlib's `beth_zero`/`beth_succ`/`bet used directly as the formal interface; no second recursive beth is introduced. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/IndexOrder.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/IndexOrder.lean index 334e634b34..abb2a2fc18 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/IndexOrder.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/IndexOrder.lean @@ -23,7 +23,7 @@ use to interpret indices as ordinals: discharged for every `α < ω₁`. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderBound.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderBound.lean index 41e6ccc891..a477ae7ff2 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderBound.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderBound.lean @@ -21,7 +21,7 @@ level is a countable union of earlier levels (`CardinalBounds.mk_iUnion_le_of_co The top clause then bounds the whole model by `|U_⊤| ≤ ℶ_{α+1}`. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean index 7ee34d0091..4b9871e836 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean @@ -36,7 +36,7 @@ equivalent to the six named clause predicates bundled in `IsLadderModel` — dow never unfold binders, `ciInf`/`ciSup`, or valuation bookkeeping again. -/ -@[expose] public section +public section namespace FirstOrder @@ -77,7 +77,7 @@ noncomputable instance (α : Ordinal.{0}) : OrderTop (Index α) where /-- The ladder language: `ℕ` constants, `Index α`-indexed unary level predicates, one binary relation. `Language.{0,0}` for every `α`. -/ -def ladderLang (α : Ordinal.{0}) : Language.{0, 0} := +@[expose] def ladderLang (α : Ordinal.{0}) : Language.{0, 0} := ⟨fun n => match n with | 0 => ℕ | _ => Empty, @@ -172,15 +172,15 @@ section Semantics variable (α) {M : Type} [(ladderLang α).Structure M] /-- The value of the `n`-th constant. -/ -def constVal (n : ℕ) : M := +@[expose] def constVal (n : ℕ) : M := Structure.funMap (L := ladderLang α) (show (ladderLang α).Functions 0 from n) Fin.elim0 /-- The level predicate `U_i`. -/ -def Level (i : Index α) (x : M) : Prop := +@[expose] def Level (i : Index α) (x : M) : Prop := Structure.RelMap (L := ladderLang α) (show (ladderLang α).Relations 1 from i) (fun _ => x) /-- The edge relation `E`. -/ -def Edge (x y : M) : Prop := +@[expose] def Edge (x y : M) : Prop := Structure.RelMap (L := ladderLang α) (show (ladderLang α).Relations 2 from ()) ![x, y] /-- **The six clauses of a ladder model** — the interface every semantic file works with. -/ diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/VonNeumannModel.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/VonNeumannModel.lean index d3b5e210d6..5327010522 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/VonNeumannModel.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/VonNeumannModel.lean @@ -25,7 +25,7 @@ The upper-bound half (every ladder model has size `≤ ℶ_{α+1}`) is `LadderBo per-stage endpoint and the supremum assembly are `BethLadder.lean`. -/ -@[expose] public section +public section namespace FirstOrder @@ -77,7 +77,7 @@ private theorem omegaEnumZ_surjective {z : ZFSet.{0}} (hz : z ∈ ladderLevel 0) variable (α : Ordinal.{0}) /-- The model carrier: the members of `V_{ω+α+1}`, shrunk to `Type 0`. -/ -noncomputable def VCarrier : Type := Shrink.{0} ↥(ladderLevel (α + 1)) +@[expose] noncomputable def VCarrier : Type := Shrink.{0} ↥(ladderLevel (α + 1)) /-- The underlying `ZFSet` of a carrier element. -/ noncomputable def toZ (x : VCarrier α) : ZFSet.{0} := diff --git a/LeanPool/InfinitaryLogic/ModelTheory/InfinitaryTypes.lean b/LeanPool/InfinitaryLogic/ModelTheory/InfinitaryTypes.lean index fd27703ffe..87c9f75642 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/InfinitaryTypes.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/InfinitaryTypes.lean @@ -22,7 +22,7 @@ image); it does NOT ascend through arbitrary expansions, which is why the arbitr endpoint of issue #11 must go through a canonical uniform expansion rather than this lemma. -/ -@[expose] public section +public section namespace FirstOrder @@ -32,18 +32,18 @@ variable {L : Language.{u, v}} /-- The complete infinitary type of a tuple over the empty set: all `L_{ω₁ω}`-formulas (in `n` free variables) it realizes. -/ -def infinitaryType (M : Type w) [L.Structure M] {n : ℕ} (a : Fin n → M) : +@[expose] def infinitaryType (M : Type w) [L.Structure M] {n : ℕ} (a : Fin n → M) : Set (L.BoundedFormulaω Empty n) := { ψ | ψ.Realize Empty.elim a } /-- The realized complete types of `M` at arity `n`. -/ -def RealizedInfinitaryTypes (M : Type w) [L.Structure M] (n : ℕ) : +@[expose] def RealizedInfinitaryTypes (M : Type w) [L.Structure M] (n : ℕ) : Set (Set (L.BoundedFormulaω Empty n)) := Set.range fun a : Fin n → M => infinitaryType M a /-- **Smallness**: `M` realizes only countably many complete `L_{ω₁ω}`-types, across all finite arities. -/ -def Lomega1omegaSmall (M : Type w) [L.Structure M] : Prop := +@[expose] def Lomega1omegaSmall (M : Type w) [L.Structure M] : Prop := ∀ n, (RealizedInfinitaryTypes (L := L) M n).Countable /-- **Isomorphism transport for types**: an `L`-isomorphism carries the complete type of a diff --git a/LeanPool/InfinitaryLogic/ModelTheory/MorleyCounting.lean b/LeanPool/InfinitaryLogic/ModelTheory/MorleyCounting.lean index eed2c2ebbe..32e9eca0bf 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/MorleyCounting.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/MorleyCounting.lean @@ -33,7 +33,7 @@ each α, the iso classes with height ≤ α inject into BFEquiv_α classes, givi by `SilverBurgessDichotomy` (proved in this repository). -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/InfinitaryLogic/ModelTheory/MorleyHanf.lean b/LeanPool/InfinitaryLogic/ModelTheory/MorleyHanf.lean index 281dc0c027..c3f3c63741 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/MorleyHanf.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/MorleyHanf.lean @@ -30,7 +30,7 @@ together with the corollaries packaged here: arbitrarily large models (via `Theoryω.conjunction`). -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/PCClass.lean b/LeanPool/InfinitaryLogic/ModelTheory/PCClass.lean index c06d34b537..5414c54cb7 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/PCClass.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/PCClass.lean @@ -19,7 +19,7 @@ Deliberately language-generic and free of any nonemptiness assumption; the Lópe specialization (`baseGraphEmb`, code compatibility) lives in `Methods/LopezEscobar/PCMem.lean`. -/ -@[expose] public section +public section namespace FirstOrder.Language diff --git a/LeanPool/InfinitaryLogic/ModelTheory/ScottCompletion.lean b/LeanPool/InfinitaryLogic/ModelTheory/ScottCompletion.lean index 638f97e3cb..eb846a118b 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/ScottCompletion.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/ScottCompletion.lean @@ -41,7 +41,7 @@ Everything is for countable relational vocabularies (`[L.IsRelational]`, `[Countable (Σ l, L.Relations l)]`), inherited from the Scott/Karp stack per the frozen audit. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/TypeIsolation.lean b/LeanPool/InfinitaryLogic/ModelTheory/TypeIsolation.lean index de3bd8ff9a..49719bb8ee 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/TypeIsolation.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/TypeIsolation.lean @@ -27,7 +27,7 @@ relation symbols, no relationality assumption. The characterization: `realize_isolatingFormula_iff : χ_p.Realize Empty.elim a ↔ infinitaryType M a = p`. -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/ModelTheory/TypePreservingBF.lean b/LeanPool/InfinitaryLogic/ModelTheory/TypePreservingBF.lean index a88df0f323..44d4008f00 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/TypePreservingBF.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/TypePreservingBF.lean @@ -26,7 +26,7 @@ two extensions is `BFEquiv` at EVERY ordinal — one `limitRecOn` induction whos the substructure inclusion reflects them). -/ -@[expose] public section +public section namespace FirstOrder diff --git a/LeanPool/InfinitaryLogic/OrdinalUtil.lean b/LeanPool/InfinitaryLogic/OrdinalUtil.lean index 22e124745a..c579e16101 100644 --- a/LeanPool/InfinitaryLogic/OrdinalUtil.lean +++ b/LeanPool/InfinitaryLogic/OrdinalUtil.lean @@ -19,7 +19,7 @@ Both shapes of the countability statement are provided: `Set.Countable (Set.Iio at each site is noise. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/InfinitaryLogic/Scott/AtomicDiagram.lean b/LeanPool/InfinitaryLogic/Scott/AtomicDiagram.lean index cdd8608025..4978e133a1 100644 --- a/LeanPool/InfinitaryLogic/Scott/AtomicDiagram.lean +++ b/LeanPool/InfinitaryLogic/Scott/AtomicDiagram.lean @@ -25,7 +25,7 @@ We restrict to relational languages (`L.IsRelational`) so that the atomic diagra tuple is determined by equality and relation holding information. -/ -@[expose] public section +public section universe u v w w' @@ -65,7 +65,7 @@ instance [Countable (Σ l, L.Relations l)] : Countable (L.AtomicIdx n) := by omit [L.IsRelational] in /-- Evaluates whether an atomic formula indexed by `idx` holds for a tuple `a`. -/ -def holds (idx : L.AtomicIdx n) (a : Fin n → M) : Prop := +@[expose] def holds (idx : L.AtomicIdx n) (a : Fin n → M) : Prop := match idx with | eq i j => a i = a j | rel R f => RelMap R (a ∘ f) @@ -138,7 +138,7 @@ the notion of "same atomic type" only captures the full atomic equivalence for r languages. With function symbols, `AtomicIdx` doesn't cover terms built from functions, so this would be a weaker notion than the standard "same atomic type" in model theory. For Scott analysis, we restrict to relational languages where this captures the full notion. -/ -def SameAtomicType {N : Type w'} [L.Structure N] (a : Fin n → M) (b : Fin n → N) : Prop := +@[expose] def SameAtomicType {N : Type w'} [L.Structure N] (a : Fin n → M) (b : Fin n → N) : Prop := ∀ idx : L.AtomicIdx n, idx.holds a ↔ idx.holds b omit [L.IsRelational] in diff --git a/LeanPool/InfinitaryLogic/Scott/BackAndForth.lean b/LeanPool/InfinitaryLogic/Scott/BackAndForth.lean index 1c95d76805..a677c35da0 100644 --- a/LeanPool/InfinitaryLogic/Scott/BackAndForth.lean +++ b/LeanPool/InfinitaryLogic/Scott/BackAndForth.lean @@ -96,7 +96,7 @@ equivalence relations with matching finite-class structure but different arrange infinite classes. -/ -@[expose] public section +public section universe u v w w' diff --git a/LeanPool/InfinitaryLogic/Scott/Formula.lean b/LeanPool/InfinitaryLogic/Scott/Formula.lean index 3a38a142db..8d5c9792c6 100644 --- a/LeanPool/InfinitaryLogic/Scott/Formula.lean +++ b/LeanPool/InfinitaryLogic/Scott/Formula.lean @@ -40,7 +40,7 @@ a formula φ(x₀,...,xₙ) with n+1 free variables and want to existentially qu over the last variable, we use `relabel` to move it into a bound position. -/ -@[expose] public section +public section universe u v w w' diff --git a/LeanPool/InfinitaryLogic/Scott/Height/CanonicalSentence.lean b/LeanPool/InfinitaryLogic/Scott/Height/CanonicalSentence.lean index 7f3a3530ef..34560576a6 100644 --- a/LeanPool/InfinitaryLogic/Scott/Height/CanonicalSentence.lean +++ b/LeanPool/InfinitaryLogic/Scott/Height/CanonicalSentence.lean @@ -26,7 +26,7 @@ Scott sentence. - `canonicalScottSentence_qrank`: Quantifier rank bounded by scottHeight + ω. -/ -@[expose] public section +public section universe u v w w' @@ -45,7 +45,7 @@ height level for the empty tuple. This is the "optimal" Scott sentence in the sense that its quantifier rank is minimized (among Scott formulas). It characterizes the structure up to potential isomorphism, and for countable structures, up to isomorphism. -/ -noncomputable def canonicalScottSentence (M : Type w) [L.Structure M] [Countable M] : +@[expose] noncomputable def canonicalScottSentence (M : Type w) [L.Structure M] [Countable M] : L.Formulaω (Fin 0) := scottFormula (L := L) (M := M) Fin.elim0 (scottHeight (L := L) M) diff --git a/LeanPool/InfinitaryLogic/Scott/Height/Defs.lean b/LeanPool/InfinitaryLogic/Scott/Height/Defs.lean index fe4a41e64a..d58caf876a 100644 --- a/LeanPool/InfinitaryLogic/Scott/Height/Defs.lean +++ b/LeanPool/InfinitaryLogic/Scott/Height/Defs.lean @@ -24,7 +24,7 @@ formula analysis stabilizes for all tuples simultaneously. - `scottHeight_eq_of_equiv`: Scott height is invariant under L-isomorphism. -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/InfinitaryLogic/Scott/Rank.lean b/LeanPool/InfinitaryLogic/Scott/Rank.lean index c205ef4371..31620e37c7 100644 --- a/LeanPool/InfinitaryLogic/Scott/Rank.lean +++ b/LeanPool/InfinitaryLogic/Scott/Rank.lean @@ -29,7 +29,7 @@ least ordinal α such that any tuple extending with a is determined by its α-ty This is equivalent to the stabilization ordinal approach but more compositional. -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/InfinitaryLogic/Scott/RefinementCount.lean b/LeanPool/InfinitaryLogic/Scott/RefinementCount.lean index e3639cfced..177391c2f9 100644 --- a/LeanPool/InfinitaryLogic/Scott/RefinementCount.lean +++ b/LeanPool/InfinitaryLogic/Scott/RefinementCount.lean @@ -33,7 +33,7 @@ The proof uses the "constant chain" argument: - `countableRefinementHypothesis` : `CountableRefinementHypothesis L` -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/InfinitaryLogic/Scott/Sentence.lean b/LeanPool/InfinitaryLogic/Scott/Sentence.lean index 62d1ef03d1..d3e2f24804 100644 --- a/LeanPool/InfinitaryLogic/Scott/Sentence.lean +++ b/LeanPool/InfinitaryLogic/Scott/Sentence.lean @@ -33,7 +33,7 @@ The proof proceeds by showing: 3. The Scott formula at the stabilization ordinal captures exactly this. -/ -@[expose] public section +public section universe u v w u' @@ -62,13 +62,13 @@ def StabilizesAt (M : Type w) [L.Structure M] (α : Ordinal) : Prop := /-- BFEquiv α on n-tuples from M equals BFEquiv (succ α) for all countable N. This captures when the BFEquiv relation has stopped distinguishing tuples at level α. -/ -def StabilizesForTuples (M : Type w) [L.Structure M] (α : Ordinal) (n : ℕ) : Prop := +@[expose] def StabilizesForTuples (M : Type w) [L.Structure M] (α : Ordinal) (n : ℕ) : Prop := ∀ (N : Type w) [L.Structure N] [Countable N] (a : Fin n → M) (b : Fin n → N), BFEquiv (L := L) α n a b ↔ BFEquiv (L := L) (Order.succ α) n a b /-- All tuple sizes stabilize at α. This is the key condition for the back-and-forth argument to yield an isomorphism. -/ -def StabilizesCompletely (M : Type w) [L.Structure M] (α : Ordinal) : Prop := +@[expose] def StabilizesCompletely (M : Type w) [L.Structure M] (α : Ordinal) : Prop := ∀ n : ℕ, StabilizesForTuples (L := L) M α n omit [L.IsRelational] [Countable (Σ l, L.Relations l)] in @@ -131,7 +131,7 @@ omit [L.IsRelational] [Countable (Σ l, L.Relations l)] in /-- Self-stabilization: BFEquiv α on n-tuples from M vs M equals BFEquiv (succ α) for all n. This is weaker than `StabilizesCompletely` which requires the iff to hold for all countable N, not just M itself. -/ -def SelfStabilizesCompletely (M : Type w) [L.Structure M] (α : Ordinal) : Prop := +@[expose] def SelfStabilizesCompletely (M : Type w) [L.Structure M] (α : Ordinal) : Prop := ∀ (n : ℕ) (a a' : Fin n → M), BFEquiv (L := L) α n a a' ↔ BFEquiv (L := L) (Order.succ α) n a a' @@ -466,7 +466,7 @@ such splits. **Boundary**: This is the sole non-trivial hypothesis in the Scott analysis pipeline. All other reasoning (descent lemmas, stabilization from countability, Scott rank bounds) is fully formalized. -/ -def CountableRefinementHypothesis (L : Language.{u, v}) +@[expose] def CountableRefinementHypothesis (L : Language.{u, v}) [_isRelational : L.IsRelational] [_countableRelations : Countable (Σ l, L.Relations l)] : Prop := ∀ (M : Type w) [L.Structure M] [Countable M] (n : ℕ) (a : Fin n → M), @@ -631,6 +631,7 @@ noncomputable def scottSentence (M : Type w) [L.Structure M] [Countable M] : L.F (stabilizationOrdinal (L := L) M) /-- Realize a formula with no free variables as a sentence in a structure. -/ +@[expose] def Formulaω.realizeAsSentence (φ : L.Formulaω (Fin 0)) (N : Type w) [L.Structure N] : Prop := φ.Realize (Fin.elim0 : Fin 0 → N) diff --git a/LeanPool/InfinitaryLogic/Util.lean b/LeanPool/InfinitaryLogic/Util.lean index 4c2bc5dbf5..0dcfbde260 100644 --- a/LeanPool/InfinitaryLogic/Util.lean +++ b/LeanPool/InfinitaryLogic/Util.lean @@ -14,7 +14,7 @@ Small lemmas about `Empty.elim`, `Fin.elim0`, `Fin.snoc`, and `Fin.append` that across the infinitary logic library but not (yet) in Mathlib. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/IsTranscendentalPi.lean b/LeanPool/IsTranscendentalPi.lean index 4f3c05dbd9..caffe18bf2 100644 --- a/LeanPool/IsTranscendentalPi.lean +++ b/LeanPool/IsTranscendentalPi.lean @@ -19,4 +19,4 @@ Tags: transcendence, pi, number-theory, niven MSC: 11A41 -/ -@[expose] public section +public section diff --git a/LeanPool/IsTranscendentalPi/AnalyticEstimates.lean b/LeanPool/IsTranscendentalPi/AnalyticEstimates.lean index 75e155cedc..61c596585f 100644 --- a/LeanPool/IsTranscendentalPi/AnalyticEstimates.lean +++ b/LeanPool/IsTranscendentalPi/AnalyticEstimates.lean @@ -17,7 +17,7 @@ Uniform bounds on the Niven auxiliary polynomials, controlling the size of the integral appearing in Niven's proof of the transcendence of `π`. -/ -@[expose] public section +public section open Polynomial open Complex diff --git a/LeanPool/IsTranscendentalPi/CalculusOnPoly.lean b/LeanPool/IsTranscendentalPi/CalculusOnPoly.lean index c0dfc521e2..b1784355db 100644 --- a/LeanPool/IsTranscendentalPi/CalculusOnPoly.lean +++ b/LeanPool/IsTranscendentalPi/CalculusOnPoly.lean @@ -21,7 +21,7 @@ The integral `∫₀¹ x · exp(-(t · x)) · T(t · x) dt` and the polynomial ` together with the calculus identities relating them for Niven's argument. -/ -@[expose] public section +public section open Polynomial open Complex @@ -32,7 +32,7 @@ open scoped BigOperators noncomputable section /-- The integral `∫₀¹ x * exp(-(t * x)) * T(t * x) dt`. -/ -def intExpNegPoly (T : ℤ[X]) (x : ℂ) : ℂ := +@[expose] def intExpNegPoly (T : ℤ[X]) (x : ℂ) : ℂ := ∫ t in 0..1, (fun (t : ℝ) => x * cexp (-(t * x)) * aeval (t * x) T) t /-- The polynomial `∑ᵢ₌₀ᵈ T⁽ⁱ⁾` with `d = deg(T)`. -/ diff --git a/LeanPool/IsTranscendentalPi/ComplexExponential.lean b/LeanPool/IsTranscendentalPi/ComplexExponential.lean index 1d94592189..20677652ff 100644 --- a/LeanPool/IsTranscendentalPi/ComplexExponential.lean +++ b/LeanPool/IsTranscendentalPi/ComplexExponential.lean @@ -21,7 +21,7 @@ multiset of roots into zero- and nonzero-sum subset contributions, the analytic heart of Niven's proof of the transcendence of `π`. -/ -@[expose] public section +public section open Polynomial @@ -107,11 +107,11 @@ lemma prod_one_add_cexp_split (s : Multiset ℂ) : simp [Complex.exp_multiset_sum] /-- The multiset of all subset sums of `s`, i.e. `{ ∑_{x ∈ t} x | t ⊆ s }`. -/ -def subsetSums {α : Type*} [AddCommMonoid α] (s : Multiset α) : Multiset α := +@[expose] def subsetSums {α : Type*} [AddCommMonoid α] (s : Multiset α) : Multiset α := (s.powerset).map sum /-- The multiset of all nonzero subset sums of `s`, i.e. `{ ∑_{x ∈ t} x ≠ 0 | t ⊆ s }`. -/ -def nonzeroSubsetSums {α : Type*} [AddCommMonoid α] [DecidableEq α] (s : Multiset α) : +@[expose] def nonzeroSubsetSums {α : Type*} [AddCommMonoid α] [DecidableEq α] (s : Multiset α) : Multiset α := (subsetSums s).filter (· ≠ 0) /-- Every element of `{ ∑_{x ∈ t} x ≠ 0 | t ⊆ s }` is nonzero. -/ diff --git a/LeanPool/IsTranscendentalPi/IncrementalDerivatives.lean b/LeanPool/IsTranscendentalPi/IncrementalDerivatives.lean index 121b95a9bf..ef7862c152 100644 --- a/LeanPool/IsTranscendentalPi/IncrementalDerivatives.lean +++ b/LeanPool/IsTranscendentalPi/IncrementalDerivatives.lean @@ -17,7 +17,7 @@ Differentiability and derivative formulas for the maps `t ↦ f⁽ᵏ⁾(t · x) finite sums, used to differentiate the exponential factors in Niven's argument. -/ -@[expose] public section +public section open Polynomial open Complex diff --git a/LeanPool/IsTranscendentalPi/Main.lean b/LeanPool/IsTranscendentalPi/Main.lean index 4ea161bbc4..93d666cd99 100644 --- a/LeanPool/IsTranscendentalPi/Main.lean +++ b/LeanPool/IsTranscendentalPi/Main.lean @@ -18,7 +18,7 @@ transcendental over `ℚ`, assembling the analytic and algebraic estimates of th preceding modules into Niven's contradiction argument. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/IsTranscendentalPi/NivenPolynomials.lean b/LeanPool/IsTranscendentalPi/NivenPolynomials.lean index 1f188090fa..72e2fca85e 100644 --- a/LeanPool/IsTranscendentalPi/NivenPolynomials.lean +++ b/LeanPool/IsTranscendentalPi/NivenPolynomials.lean @@ -16,7 +16,7 @@ The auxiliary polynomials `Fₚ = Xᵖ⁻¹ Tᵖ` and basic facts about their de to build the integer that drives the contradiction in Niven's proof. -/ -@[expose] public section +public section open Polynomial open Complex @@ -27,7 +27,7 @@ open scoped BigOperators noncomputable section /-- `Fₚ = Xᵖ⁻¹ Tᵖ`. -/ -def Fp {R : Type*} [Semiring R] (T : R[X]) (p : ℕ) : R[X] := X^(p - 1) * T^p +@[expose] def Fp {R : Type*} [Semiring R] (T : R[X]) (p : ℕ) : R[X] := X^(p - 1) * T^p /-- If `T ≠ 0`, then `deg(Fₚ) = (p - 1) + p deg(T)`. -/ lemma natDegree_Fp {R : Type*} [Semiring R] [Nontrivial R] [NoZeroDivisors R] @@ -132,7 +132,7 @@ lemma aeval_Fpd (T : ℤ[X]) (p m : ℕ) (a : ℂ) (hT : T ≠ 0) (hm := by simpa using hmFp)) /-- The definition of `∑ᵢ₌ₚᵈ Fₚ⁽ⁱ⁾` with `d = deg(Fₚ)`. -/ -def sumStartpDerivFp {R : Type*} [Semiring R] (T : R[X]) (p : ℕ) : R[X] +@[expose] def sumStartpDerivFp {R : Type*} [Semiring R] (T : R[X]) (p : ℕ) : R[X] := ∑ i ∈ Finset.Icc p (Fp T p).natDegree, derivative^[i] (Fp T p) /-- If `a` is a root of `T`, then `T ≠ 0`. -/ diff --git a/LeanPool/IsTranscendentalPi/ScaledAuxiliaryPolynomial.lean b/LeanPool/IsTranscendentalPi/ScaledAuxiliaryPolynomial.lean index 4a60344fec..7bb2c6f14e 100644 --- a/LeanPool/IsTranscendentalPi/ScaledAuxiliaryPolynomial.lean +++ b/LeanPool/IsTranscendentalPi/ScaledAuxiliaryPolynomial.lean @@ -16,7 +16,7 @@ The symmetric polynomial `∑ᵢ T(Xᵢ)` and its evaluation, providing the alge input to the auxiliary integer in Niven's proof. -/ -@[expose] public section +public section open Polynomial open Multiset diff --git a/LeanPool/IsTranscendentalPi/SubsetSumPolynomial.lean b/LeanPool/IsTranscendentalPi/SubsetSumPolynomial.lean index 4c2110b907..fc52f92a7c 100644 --- a/LeanPool/IsTranscendentalPi/SubsetSumPolynomial.lean +++ b/LeanPool/IsTranscendentalPi/SubsetSumPolynomial.lean @@ -18,7 +18,7 @@ according to the vanishing subset sums, used to track integer divisibility in Niven's argument. -/ -@[expose] public section +public section open Polynomial open Multiset diff --git a/LeanPool/IsTranscendentalPi/SymmetricPolynomials.lean b/LeanPool/IsTranscendentalPi/SymmetricPolynomials.lean index 141b62a8e2..2454ad5164 100644 --- a/LeanPool/IsTranscendentalPi/SymmetricPolynomials.lean +++ b/LeanPool/IsTranscendentalPi/SymmetricPolynomials.lean @@ -22,7 +22,7 @@ Multisets `{b₀, …, bₙ₋₁}` attached to maps `b : Fin n → α` and symm machinery feeding the algebraic estimates of Niven's proof. -/ -@[expose] public section +public section open Polynomial open Multiset @@ -31,7 +31,7 @@ open scoped Polynomial open scoped BigOperators /-- The multiset `{b₀, …, bₙ₋₁}` attached to `b : Fin n → α`. -/ -def valuesFin {α : Type*} {n : ℕ} (b : Fin n → α) : Multiset α := +@[expose] def valuesFin {α : Type*} {n : ℕ} (b : Fin n → α) : Multiset α := (Finset.univ : Finset (Fin n)).val.map b /-- Every multiset can be indexed by a map `a : Fin n → α`. -/ diff --git a/LeanPool/IsoGraph.lean b/LeanPool/IsoGraph.lean index e331e5d9e2..e2f335ec21 100644 --- a/LeanPool/IsoGraph.lean +++ b/LeanPool/IsoGraph.lean @@ -23,7 +23,7 @@ Tags: graph-theory, graph-isomorphism, canonical-labelling, verified-algorithms MSC: 05C60, 68R10 -/ -@[expose] public section +public section /-! ## Imported scope diff --git a/LeanPool/IsoGraph/Canon/Algorithm.lean b/LeanPool/IsoGraph/Canon/Algorithm.lean index 4717f6e3c1..9c6400fbeb 100644 --- a/LeanPool/IsoGraph/Canon/Algorithm.lean +++ b/LeanPool/IsoGraph/Canon/Algorithm.lean @@ -54,7 +54,7 @@ Two prunings make this fast: Note that hash collisions can only *weaken* pruning: an invariant path is used solely as the first component of a total order on leaves, and any isomorphism-invariant function works there. --/@[expose] public section +-/public section namespace IsoGraph namespace Canon @@ -82,7 +82,7 @@ Written with `Array.ofFn`/`Array.filter` rather than as an imperative fill: the same, but every entry is then definitionally the oracle, which is what makes the lemmas in `IsoGraph/Canon/Equivariance.lean` about this function short. `vs` is shared across the rows so the `nbr` pass allocates only the neighbour lists themselves. -/ -def Graph.ofOracle (n : Nat) (f : Nat → Nat → Bool) : Graph := +@[expose] def Graph.ofOracle (n : Nat) (f : Nat → Nat → Bool) : Graph := let vs := Array.range n { n := n adj := Array.ofFn (n := n) fun v => Array.ofFn (n := n) fun w => f v.1 w.1 @@ -134,7 +134,7 @@ structure Part where deriving Inhabited /-- The one-cell (unit) partition of `{0, …, n-1}`. -/ -def Part.unit (n : Nat) : Part := +@[expose] def Part.unit (n : Nat) : Part := { lab := Array.range n pos := Array.range n cst := Array.replicate n 0 @@ -147,13 +147,13 @@ They are written as structural recursions on an explicit fuel rather than as `fo everything about them is proved. `n` is always enough fuel: there are at most `n` cells. -/ /-- Fold the cell sizes from cell start `i` into the hash `h`. -/ -def cenHashFrom (cen : Array Nat) (n : Nat) : Nat → Nat → UInt64 → UInt64 +@[expose] def cenHashFrom (cen : Array Nat) (n : Nat) : Nat → Nat → UInt64 → UInt64 | 0, _, h => h | fuel + 1, i, h => if i ≥ n then h else cenHashFrom cen n fuel cen[i]! (mixN h (cen[i]! - i)) /-- Start of the first non-singleton cell at or after cell start `i`, if any. -/ -def cenTargetFrom (cen : Array Nat) (n : Nat) : Nat → Nat → Option Nat +@[expose] def cenTargetFrom (cen : Array Nat) (n : Nat) : Nat → Nat → Option Nat | 0, _ => none | fuel + 1, i => if i ≥ n then none @@ -161,11 +161,11 @@ def cenTargetFrom (cen : Array Nat) (n : Nat) : Nat → Nat → Option Nat else cenTargetFrom cen n fuel cen[i]! /-- Hash of the sequence of cell sizes. Isomorphism-invariant. -/ -def Part.shapeHash (p : Part) (n : Nat) : UInt64 := cenHashFrom p.cen n n 0 hashSeed +@[expose] def Part.shapeHash (p : Part) (n : Nat) : UInt64 := cenHashFrom p.cen n n 0 hashSeed /-- Start position of the first non-singleton cell, if any. This is the target cell for individualisation; picking the *first* one is an isomorphism-invariant rule. -/ -def Part.targetCell (p : Part) (n : Nat) : Option Nat := cenTargetFrom p.cen n n 0 +@[expose] def Part.targetCell (p : Part) (n : Nat) : Option Nat := cenTargetFrom p.cen n n 0 /-! ## Refinement -/ @@ -191,7 +191,7 @@ structure Scratch where /-- Cleared scratch space for a graph on `n` vertices. Counts never exceed `n`, so `bc` needs `n + 1` entries. -/ -def Scratch.empty (n : Nat) : Scratch := +@[expose] def Scratch.empty (n : Nat) : Scratch := { cnt := Array.replicate n 0, hit := Array.replicate n false, bc := Array.replicate (n + 1) 0 } /-- Bump `cnt[v]` for every `v` in `nbrs[j:]`, pushing each newly-touched vertex onto `touched`. @@ -200,6 +200,7 @@ Like `cenHashFrom` above this is a structural recursion on an explicit fuel (onl `nbrs.size - j`) rather than a `for` loop, so that the equivariance proof can read off the resulting count at each index; the `j < nbrs.size` that a `for` loop hides is exactly what the proof needs. -/ +@[expose] def bumpFrom (nbrs : Array Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat × Array Nat | 0, _, cnt, touched => (cnt, touched) | fuel + 1, j, cnt, touched => @@ -212,7 +213,7 @@ def bumpFrom (nbrs : Array Nat) : Nat → Nat → Array Nat → Array Nat → Ar /-- Accumulate into `cnt` the number of neighbours each vertex has among `lab[k:e]`, recording in `touched` the vertices whose count became nonzero. This is phase (1) of `refineStep`, and is the hot loop of the whole algorithm: it costs the splitter cell's degree sum. -/ -def countFrom (G : Graph) (lab : Array Nat) (e : Nat) : +@[expose] def countFrom (G : Graph) (lab : Array Nat) (e : Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat × Array Nat | 0, _, cnt, touched => (cnt, touched) | fuel + 1, k, cnt, touched => @@ -229,12 +230,13 @@ the sorted order of the cells and of the counts *is* part of what makes the trac this goes through `List.mergeSort`, which does. The round trip through `List` costs nothing measurable on the benchmarks: both call sites sort at most one entry per cell of the partition, against a refinement step that already costs the splitter's degree sum. -/ +@[expose] def sortNats (a : Array Nat) : Array Nat := (a.toList.mergeSort (fun x y => x ≤ y)).toArray /-- Collect the distinct cell starts of the vertices in `touched[j:]`, using `hit` to deduplicate. Phase (2) of `refineStep`, as a structural recursion on fuel; `fuel` is only ever `touched.size - j`. -/ -def collectFrom (pos cst touched : Array Nat) : +@[expose] def collectFrom (pos cst touched : Array Nat) : Nat → Nat → Array Bool → Array Nat → Array Bool × Array Nat | 0, _, hit, cells => (hit, cells) | fuel + 1, j, hit, cells => @@ -247,7 +249,7 @@ def collectFrom (pos cst touched : Array Nat) : /-- Bucket the cell `lab[k:ec]` by neighbour count: `bc[t]` counts the members whose count is `t`, and `ks` lists the counts that occur, in first-occurrence order. Phase (3a) of `refineStep`, and another fuel recursion in place of a `for` loop; `fuel` is only ever `ec - k`. -/ -def bucketFrom (lab cnt : Array Nat) (ec : Nat) : +@[expose] def bucketFrom (lab cnt : Array Nat) (ec : Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat × Array Nat | 0, _, bc, ks => (bc, ks) | fuel + 1, k, bc, ks => @@ -259,7 +261,7 @@ def bucketFrom (lab cnt : Array Nat) (ec : Nat) : /-- Turn the bucket sizes into the fragment sizes `sizes[j]` and the bucket *offsets* `bc[ks[j]]` (relative to the start of the cell). `acc` is the running offset. Phase (3b). -/ -def offsetFrom (ks : Array Nat) : +@[expose] def offsetFrom (ks : Array Nat) : Nat → Nat → Array Nat → Array Nat → Nat → Array Nat × Array Nat | 0, _, sizes, bc, _ => (sizes, bc) | fuel + 1, j, sizes, bc, acc => @@ -271,7 +273,7 @@ def offsetFrom (ks : Array Nat) : /-- Scatter the cell's vertices into `block` in count order, each bucket keeping the order it had in the cell. Phase (3c). -/ -def scatterFrom (lab cnt : Array Nat) (ec : Nat) : +@[expose] def scatterFrom (lab cnt : Array Nat) (ec : Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat × Array Nat | 0, _, block, bc => (block, bc) | fuel + 1, k, block, bc => @@ -283,13 +285,13 @@ def scatterFrom (lab cnt : Array Nat) (ec : Nat) : scatterFrom lab cnt ec fuel (k + 1) (block.set! o v) (bc.set! t (o + 1)) /-- Zero the buckets the cell used, leaving `bc` clear for the next cell. Phase (3d). -/ -def clearBcFrom (ks : Array Nat) : Nat → Nat → Array Nat → Array Nat +@[expose] def clearBcFrom (ks : Array Nat) : Nat → Nat → Array Nat → Array Nat | 0, _, bc => bc | fuel + 1, j, bc => if j ≥ ks.size then bc else clearBcFrom ks fuel (j + 1) (bc.set! ks[j]! 0) /-- Copy the sorted block back into `lab[c:]`, keeping `pos` its inverse. Phase (3e). -/ -def writeFrom (block : Array Nat) (c : Nat) : +@[expose] def writeFrom (block : Array Nat) (c : Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat × Array Nat | 0, _, lab, pos => (lab, pos) | fuel + 1, k, lab, pos => @@ -299,6 +301,7 @@ def writeFrom (block : Array Nat) (c : Nat) : writeFrom block c fuel (k + 1) (lab.set! (c + k) v) (pos.set! v (c + k)) /-- Write the boundaries of the fragment `[st, en)` into `cst`/`cen`. Phase (4a). -/ +@[expose] def fillBoundsFrom (st en : Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat × Array Nat | 0, _, cst, cen => (cst, cen) | fuel + 1, i, cst, cen => @@ -307,7 +310,7 @@ def fillBoundsFrom (st en : Nat) : Nat → Nat → Array Nat → Array Nat → A /-- Install the boundaries of every fragment of a split cell, collecting the fragment starts and hashing each fragment's size and count into the trace. Phase (4). -/ -def boundsFrom (ks sizes : Array Nat) : +@[expose] def boundsFrom (ks sizes : Array Nat) : Nat → Nat → Array Nat → Array Nat → Array Nat → Nat → UInt64 → Array Nat × Array Nat × Array Nat × UInt64 | 0, _, cst, cen, starts, _, tr => (cst, cen, starts, tr) @@ -342,13 +345,13 @@ def markExceptFrom (starts : Array Nat) (bi : Nat) : Nat → Nat → Array Bool else markExceptFrom starts bi fuel (k + 1) (if k != bi then inW.set! starts[k]! true else inW) /-- Zero the counts of the touched vertices. Phase (6). -/ -def clearCntFrom (touched : Array Nat) : Nat → Nat → Array Nat → Array Nat +@[expose] def clearCntFrom (touched : Array Nat) : Nat → Nat → Array Nat → Array Nat | 0, _, cnt => cnt | fuel + 1, j, cnt => if j ≥ touched.size then cnt else clearCntFrom touched fuel (j + 1) (cnt.set! touched[j]! 0) /-- Unmark the cells that were collected. Phase (6). -/ -def clearHitFrom (cells : Array Nat) : Nat → Nat → Array Bool → Array Bool +@[expose] def clearHitFrom (cells : Array Nat) : Nat → Nat → Array Bool → Array Bool | 0, _, hit => hit | fuel + 1, j, hit => if j ≥ cells.size then hit else clearHitFrom cells fuel (j + 1) (hit.set! cells[j]! false) @@ -373,7 +376,7 @@ structure SplitState where /-- Split the cell starting at position `c` by neighbour count, phases (3) to (5). Written as a chain of `match`es rather than a `do` block for the same reason as the loops above. -/ -def splitCell (cnt : Array Nat) (c : Nat) (st : SplitState) : SplitState := +@[expose] def splitCell (cnt : Array Nat) (c : Nat) (st : SplitState) : SplitState := -- Read the cell's extent *before* splitting it; splits stay inside `[c, ec)`, so the cells -- collected by phase (2) keep their starts. let ec := st.cen[c]! @@ -407,7 +410,7 @@ def splitCell (cnt : Array Nat) (c : Nat) (st : SplitState) : SplitState := { lab, pos, cst, cen, inW, tr, bc := clearBcFrom ks ks.size 0 bc } /-- Split every cell in `cells[j:]`, left to right. -/ -def splitCellsFrom (cnt cells : Array Nat) : Nat → Nat → SplitState → SplitState +@[expose] def splitCellsFrom (cnt cells : Array Nat) : Nat → Nat → SplitState → SplitState | 0, _, st => st | fuel + 1, j, st => if j ≥ cells.size then st @@ -420,6 +423,7 @@ Returns the new partition, the updated worklist (`inW`, indexed by cell start po updated trace hash, and the scratch space, restored to its cleared state. Cells created by a split are pushed onto the worklist following Hopcroft's rule: all fragments if the parent was queued, otherwise all but a largest fragment. -/ +@[expose] def refineStep (G : Graph) (p : Part) (inW : Array Bool) (s : Nat) (tr : UInt64) (sc : Scratch) : Part × Array Bool × UInt64 × Scratch := let e := p.cen[s]! @@ -447,7 +451,7 @@ def refineStep (G : Graph) (p : Part) (inW : Array Bool) (s : Nat) (tr : UInt64) bc := st.bc }) /-- Index of the first `true` entry of `a`. -/ -def firstSet (a : Array Bool) : Option Nat := Id.run do +@[expose] def firstSet (a : Array Bool) : Option Nat := Id.run do for j in [0:a.size] do if a[j]! then return some j return none @@ -458,7 +462,7 @@ The guard `s < G.n && p.cst[s]! == s` is never false in a real run — only cell queued, and a cell start stays one when its cell is split — but checking it costs one array read per pop and saves `Equivariance.refineLoop_equiv` from having to carry the worklist invariant. Popping a position that is not a cell start simply drops it. -/ -def refineLoop (G : Graph) : Nat → Part → Array Bool → UInt64 → Scratch → Part × UInt64 +@[expose] def refineLoop (G : Graph) : Nat → Part → Array Bool → UInt64 → Scratch → Part × UInt64 | 0, p, _, tr, _ => (p, tr) | fuel + 1, p, inW, tr, sc => match firstSet inW with @@ -476,11 +480,11 @@ the trace hash of the refinement. The fuel `n² + n + 1` is a genuine bound: a cell start enters the worklist once initially and once per fragment of each split, there are at most `n - 1` splits, and each split creates at most `n` fragments. -/ -def refine (G : Graph) (p : Part) (inW : Array Bool) (tr : UInt64) : Part × UInt64 := +@[expose] def refine (G : Graph) (p : Part) (inW : Array Bool) (tr : UInt64) : Part × UInt64 := refineLoop G (G.n * G.n + G.n + 1) p inW tr (Scratch.empty G.n) /-- Refine from the unit partition: equivalently, the coarsest equitable partition of `G`. -/ -def initialRefine (G : Graph) : Part × UInt64 := +@[expose] def initialRefine (G : Graph) : Part × UInt64 := let p := Part.unit G.n let inW := if G.n == 0 then #[] else (Array.replicate G.n false).set! 0 true refine G p inW hashSeed @@ -488,7 +492,7 @@ def initialRefine (G : Graph) : Part × UInt64 := /-- Write `c + 1` into `cst[j]` for every `j ∈ [j₀, ec)`, where `j₀` is the second argument. A structural recursion rather than a `for` loop so that `Equivariance.setCstFrom_getElemD` can read off each entry; `fuel` is only ever `ec - j₀`, so the work is the same. -/ -def setCstFrom (c ec : Nat) : Nat → Nat → Array Nat → Array Nat +@[expose] def setCstFrom (c ec : Nat) : Nat → Nat → Array Nat → Array Nat | 0, _, cst => cst | fuel + 1, j, cst => if j ≥ ec then cst else setCstFrom c ec fuel (j + 1) (cst.set! j (c + 1)) @@ -496,7 +500,7 @@ def setCstFrom (c ec : Nat) : Nat → Nat → Array Nat → Array Nat /-- Split the vertex `v` off from its cell, placing it first. Returns the new partition and the position of the new singleton cell `{v}` (which is the only splitter needed to re-refine, since the input partition is assumed equitable). -/ -def individualize (p : Part) (v : Nat) : Part × Nat := +@[expose] def individualize (p : Part) (v : Nat) : Part × Nat := let i := p.pos[v]! let c := p.cst[i]! let ec := p.cen[i]! @@ -510,7 +514,7 @@ def individualize (p : Part) (v : Nat) : Part × Nat := /-! ## Certificates -/ /-- Number of 64-bit words used for one row of a certificate. -/ -def rowWords (n : Nat) : Nat := (n + 63) / 64 +@[expose] def rowWords (n : Nat) : Nat := (n + 63) / 64 /-- An `n × n` bit matrix packed into 64-bit words: row `i` occupies words `[i * rowWords n, (i+1) * rowWords n)`, and column `j` of a row is bit `63 - j % 64` of word @@ -524,7 +528,7 @@ Like the partition walks above, the two loops are structural recursions on fuel `for` loops, so that induction applies to them: `fuel` counts the entries still to do and `j` (resp. `i`) the position reached, and `j + fuel = n` is the invariant that gives `j < n` inside the body — which is exactly what a proof about the loop needs and what a `for` loop hides. -/ -def certRow (n : Nat) (b : Nat → Bool) : +@[expose] def certRow (n : Nat) (b : Nat → Bool) : Nat → Nat → UInt64 → Nat → Array UInt64 → Array UInt64 | 0, _, acc, k, out => if n % 64 != 0 then out.set! k (acc <<< UInt64.ofNat (64 - n % 64)) else out @@ -534,13 +538,12 @@ def certRow (n : Nat) (b : Nat → Bool) : else certRow n b fuel (j + 1) acc k out /-- Pack rows `i, i+1, …` of the matrix, `fuel` of them, into `out`. -/ -def certRowsFrom (n : Nat) (bit : Nat → Nat → Bool) (w : Nat) : +@[expose] def certRowsFrom (n : Nat) (bit : Nat → Nat → Bool) (w : Nat) : Nat → Nat → Array UInt64 → Array UInt64 | 0, _, out => out | fuel + 1, i, out => certRowsFrom n bit w fuel (i + 1) (certRow n (bit i) n 0 0 (i * w) out) -@[inherit_doc certRow] -def certBits (n : Nat) (bit : Nat → Nat → Bool) : Array UInt64 := +@[expose, inherit_doc certRow] def certBits (n : Nat) (bit : Nat → Nat → Bool) : Array UInt64 := certRowsFrom n bit (rowWords n) n 0 (Array.replicate (n * rowWords n) 0) /-- The adjacency matrix of `G` read off in the order `lab`, packed by `certBits`. @@ -548,13 +551,13 @@ def certBits (n : Nat) (bit : Nat → Nat → Bool) : Array UInt64 := Packing bits most-significant-first means that comparing the word arrays lexicographically, as unsigned integers, compares the bit strings lexicographically. Two labellings give the same certificate exactly when they differ by an automorphism. -/ -def certOf (G : Graph) (lab : Array Nat) : Array UInt64 := +@[expose] def certOf (G : Graph) (lab : Array Nat) : Array UInt64 := certBits G.n fun i => let row := G.adj[lab[i]!]!; fun j => row[lab[j]!]! /-- Lexicographic comparison of `a` and `b` from index `i` on, with `fuel` bounding the number of positions still to look at. Written as a structural recursion rather than a `for` loop so that the order lemmas in `IsoGraph.Canon.Search` can be proved by induction on `fuel`. -/ -def lexCmpFrom (a b : Array UInt64) : Nat → Nat → Ordering +@[expose] def lexCmpFrom (a b : Array UInt64) : Nat → Nat → Ordering | 0, _ => compare a.size b.size | fuel + 1, i => if i < min a.size b.size then @@ -564,7 +567,7 @@ def lexCmpFrom (a b : Array UInt64) : Nat → Nat → Ordering else compare a.size b.size /-- Lexicographic comparison of `UInt64` arrays (shorter is smaller on a common prefix). -/ -def lexCmpU64 (a b : Array UInt64) : Ordering := lexCmpFrom a b (min a.size b.size) 0 +@[expose] def lexCmpU64 (a b : Array UInt64) : Ordering := lexCmpFrom a b (min a.size b.size) 0 /-! ## Automorphisms -/ @@ -573,7 +576,7 @@ def lexCmpU64 (a b : Array UInt64) : Ordering := lexCmpFrom a b (min a.size b.si Written as a `foldl` over `List.range n` rather than as a `for` loop so that `IsoGraph.Canon.Autos.autoOf_get` can read off each entry; the work is the same. -/ -def autoOf (n : Nat) (σ τ : Array Nat) : Array Nat := +@[expose] def autoOf (n : Nat) (σ τ : Array Nat) : Array Nat := (List.range n).foldl (init := Array.replicate n 0) fun g i => g.set! σ[i]! τ[i]! /-- Whether a permutation moves some point. -/ @@ -584,7 +587,7 @@ def moves (g : Array Nat) : Bool := Id.run do /-- One step of orbit closure: mark the images of `v` under all generators. A `foldl` rather than a `for` loop so that `IsoGraph.Canon.Orbits` can induct on the generator list. -/ -def closureStep (gens : Array (Array Nat)) (mark : Array Bool) (stack : Array Nat) +@[expose] def closureStep (gens : Array (Array Nat)) (mark : Array Bool) (stack : Array Nat) (v : Nat) : Array Bool × Array Nat := gens.foldl (init := (mark, stack)) fun ms g => let w := g[v]! @@ -592,7 +595,7 @@ def closureStep (gens : Array (Array Nat)) (mark : Array Bool) (stack : Array Na /-- Close `mark` under the generators, using `stack` as the frontier. `fuel` bounds the number of pops, which is at most the number of marked points. -/ -def closureLoop (gens : Array (Array Nat)) : Nat → Array Bool → Array Nat → Array Bool +@[expose] def closureLoop (gens : Array (Array Nat)) : Nat → Array Bool → Array Nat → Array Bool | 0, mark, _ => mark | fuel + 1, mark, stack => if stack.isEmpty then mark @@ -602,7 +605,7 @@ def closureLoop (gens : Array (Array Nat)) : Nat → Array Bool → Array Nat closureLoop gens fuel mark stack /-- The union of the `gens`-orbits of the vertices in `seed`, as a membership array of size `n`. -/ -def orbitClosure (n : Nat) (gens : Array (Array Nat)) (seed : Array Nat) : Array Bool := +@[expose] def orbitClosure (n : Nat) (gens : Array (Array Nat)) (seed : Array Nat) : Array Bool := closureLoop gens (n + 1) (seed.foldl (init := Array.replicate n false) fun mark v => mark.set! v true) seed /-! ## The search -/ @@ -610,7 +613,7 @@ def orbitClosure (n : Nat) (gens : Array (Array Nat)) (seed : Array Nat) : Array /-- Scan for the first disagreement at or after `i`, stopping at `m`. A structural recursion on fuel rather than a `for` loop with a `break`, for the same reason as the partition walks above: `IsoGraph.Canon.Jump` needs to induct on it. -/ -def commonPrefixFrom (a b : Array Nat) (m : Nat) : Nat → Nat → Nat +@[expose] def commonPrefixFrom (a b : Array Nat) (m : Nat) : Nat → Nat → Nat | 0, i => i | fuel + 1, i => if i ≥ m then m @@ -618,7 +621,7 @@ def commonPrefixFrom (a b : Array Nat) (m : Nat) : Nat → Nat → Nat else i /-- Length of the longest common prefix of two paths. -/ -def commonPrefix (a b : Array Nat) : Nat := +@[expose] def commonPrefix (a b : Array Nat) : Nat := let m := min a.size b.size commonPrefixFrom a b m m 0 @@ -654,7 +657,7 @@ pruning, so this is a pure performance guard. -/ def maxGens : Nat := 256 /-- Record a newly found automorphism, ignoring the identity and duplicates. -/ -def St.addAuto (st : St) (g : Array Nat) : St := +@[expose] def St.addAuto (st : St) (g : Array Nat) : St := if !moves g then st else if st.autos.size ≥ maxGens then st else if st.autos.any (fun h => h == g) then st @@ -663,7 +666,7 @@ def St.addAuto (st : St) (g : Array Nat) : St := /-- Invariant pruning at a node. Returns `none` if the whole subtree is dominated by the current best leaf, and otherwise the state to continue with (with the incumbent discarded if the subtree is guaranteed to beat it). -/ -def pruneNode (invPath : Array UInt64) (st : St) : Option St := +@[expose] def pruneNode (invPath : Array UInt64) (st : St) : Option St := match st.best with | none => some st | some b => @@ -682,7 +685,7 @@ onto `ζ`'s. Since depth-first search had already *finished* `ζ`'s branch befo every leaf still unexplored below `ν`'s branch is a `γ`-image of one already seen, and carries the same certificate. So the whole remainder of that branch can be abandoned: we request a backjump to depth `k`. -/ -def leafUpdate (G : Graph) (path : Array Nat) (invPath : Array UInt64) (lab : Array Nat) +@[expose] def leafUpdate (G : Graph) (path : Array Nat) (invPath : Array UInt64) (lab : Array Nat) (st : St) : St := Id.run do let cert := certOf G lab let leaf : Leaf := { path, invPath, cert, lab } @@ -712,7 +715,7 @@ def leafUpdate (G : Graph) (path : Array Nat) (invPath : Array UInt64) (lab : Ar /-- The automorphisms found so far that fix every vertex of `path`. Only these may be used to prune the children of the node reached by `path`. -/ -def usableAutos (autos : Array (Array Nat)) (path : Array Nat) : Array (Array Nat) := +@[expose] def usableAutos (autos : Array (Array Nat)) (path : Array Nat) : Array (Array Nat) := if autos.isEmpty then autos else autos.filter fun g => path.all fun x => g[x]! == x /-- Cached orbit information for the children of one search-tree node: the orbit of the already @@ -732,6 +735,7 @@ mutual /-- Visit one node of the search tree. `p` is the (already refined) ordered partition, `path` the vertices individualised to reach it, and `invPath` the node invariants along that path. -/ +@[expose] def dfsNode (G : Graph) (fuel : Nat) (path : Array Nat) (invPath : Array UInt64) (p : Part) (st : St) : St := match fuel with @@ -754,6 +758,7 @@ def dfsNode (G : Graph) (fuel : Nat) (path : Array Nat) (invPath : Array UInt64) /-- Visit the remaining children `verts` of a node, skipping those in the orbit of an already visited child, and honouring any backjump request coming back from below. -/ +@[expose] def dfsChildren (G : Graph) (fuel : Nat) (path : Array Nat) (invPath : Array UInt64) (p : Part) (verts : List Nat) (processed : Array Nat) (orb : Orbits) (st : St) : St := match verts with @@ -808,7 +813,7 @@ structure Result where `Result.lab` is a permutation of `{0, …, n-1}` such that `Result.cert` depends only on the isomorphism class of `G`. -/ -def canonical (G : Graph) : Result := +@[expose] def canonical (G : Graph) : Result := let (p, tr) := initialRefine G let inv0 : Array UInt64 := #[mix tr (p.shapeHash G.n)] let st := dfsNode G (G.n + 1) #[] inv0 p @@ -826,14 +831,14 @@ def canonicalForm (G : Graph) : Array UInt64 := /-- Positional inverse of `a`: if `a` is a permutation of `{0, …, n-1}` then this is the array with `invLab n a` at position `a[i]!` equal to `i`. Used only to *check* that, so nothing is claimed about it when `a` is not a permutation. -/ -def invLab (n : Nat) (a : Array Nat) : Array Nat := +@[expose] def invLab (n : Nat) (a : Array Nat) : Array Nat := (List.range n).foldl (init := Array.replicate n 0) fun b i => if a[i]! < n then b.set! a[i]! i else b /-- Is `a` a permutation of `{0, …, n-1}`? `O(n)`: build the positional inverse and check that it really inverts, which gives injectivity for free (if `a[v]! = a[w]!` then `v = b[a[v]!]! = b[a[w]!]! = w`). -/ -def isPermArray (n : Nat) (a : Array Nat) : Bool := +@[expose] def isPermArray (n : Nat) (a : Array Nat) : Bool := a.size == n && (let b := invLab n a (List.range n).all fun i => a[i]! < n && b[a[i]!]! == i) @@ -843,7 +848,7 @@ def isPermArray (n : Nat) (a : Array Nat) : Bool := The search's output is checked to be a permutation of `{0, …, n-1}` before being returned, and the identity is substituted if it is not. The check costs `O(n)` against an `Ω(n²)` search, and makes the returned array a permutation whatever the search does (`Spec.labellingIsPerm`). -/ -def canonicalLabellingOfOracle (n : Nat) (f : Nat → Nat → Bool) : Array Nat := +@[expose] def canonicalLabellingOfOracle (n : Nat) (f : Nat → Nat → Bool) : Array Nat := let a := (canonical (Graph.ofOracle n f)).lab if isPermArray n a then a else Array.range n diff --git a/LeanPool/IsoGraph/Canon/Autos.lean b/LeanPool/IsoGraph/Canon/Autos.lean index b16fe14109..7eab0f4ba0 100644 --- a/LeanPool/IsoGraph/Canon/Autos.lean +++ b/LeanPool/IsoGraph/Canon/Autos.lean @@ -32,7 +32,7 @@ The bridge between the two is `ofOracle_congr`: an automorphism `γ` of `G` sati `IsoGraph.Canon.Equivariance` into a statement about the action of `Aut G` on the tree. -/ -@[expose] public section +public section namespace IsoGraph diff --git a/LeanPool/IsoGraph/Canon/Branch.lean b/LeanPool/IsoGraph/Canon/Branch.lean index e651e846fa..6a2598ba43 100644 --- a/LeanPool/IsoGraph/Canon/Branch.lean +++ b/LeanPool/IsoGraph/Canon/Branch.lean @@ -36,7 +36,7 @@ the bookkeeping for the third and hardest one, backjumping. not already dominated. This is `jump_sound` fed by `Jmp`. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -94,25 +94,25 @@ theorem mem_usableAutos {autos : Array (Array Nat)} {path : Array Nat} {g : Arra /-! ## The running invariants -/ /-- A leaf the state records. -/ -def Rec (st : St) (l : Leaf) : Prop := st.best = some l ∨ st.first = some l +@[expose] def Rec (st : St) (l : Leaf) : Prop := st.best = some l ∨ st.first = some l /-- No recorded leaf lies below the current node. -/ -def Pth (st : St) (path : Array Nat) : Prop := ∀ l, Rec st l → ¬ PathPre path l.path +@[expose] def Pth (st : St) (path : Array Nat) : Prop := ∀ l, Rec st l → ¬ PathPre path l.path /-- **The backjump invariant**, relative to a target predicate `P` on leaf keys. Every branch a recorded leaf went down and that the current path has already left behind consists entirely of keys satisfying `P`. At the use site `P` is "dominated by the incumbent, or already accounted for by the caller". -/ -def Jmp (n : Nat) (f : Nat → Nat → Bool) (P : List (List UInt64) → Prop) (path : Array Nat) - (st : St) : Prop := +@[expose] def Jmp (n : Nat) (f : Nat → Nat → Bool) (P : List (List UInt64) → Prop) + (path : Array Nat) (st : St) : Prop := ∀ l, Rec st l → ∀ j, j < path.size → j < l.path.size → path.toList.take j = l.path.toList.take j → path[j]! ≠ l.path[j]! → ∀ k, ancReach n f l.path (j + 1) k → P k /-- The same, also covering the branches leaving the current node itself: what holds while a node is working through its children. -/ -def JmpC (n : Nat) (f : Nat → Nat → Bool) (P : List (List UInt64) → Prop) (path : Array Nat) - (st : St) : Prop := +@[expose] def JmpC (n : Nat) (f : Nat → Nat → Bool) (P : List (List UInt64) → Prop) + (path : Array Nat) (st : St) : Prop := ∀ l, Rec st l → ∀ j, j ≤ path.size → j < l.path.size → path.toList.take j = l.path.toList.take j → (j < path.size → path[j]! ≠ l.path[j]!) → ∀ k, ancReach n f l.path (j + 1) k → P k diff --git a/LeanPool/IsoGraph/Canon/Correct.lean b/LeanPool/IsoGraph/Canon/Correct.lean index 47903ede65..417f7ee413 100644 --- a/LeanPool/IsoGraph/Canon/Correct.lean +++ b/LeanPool/IsoGraph/Canon/Correct.lean @@ -33,7 +33,7 @@ That is exactly what `Spec.LabellingInvariant` needs, once `certOf_get` is used adjacency matrix back out of the packed certificate (`canonical_get`). -/ -@[expose] public section +public section namespace IsoGraph namespace Canon diff --git a/LeanPool/IsoGraph/Canon/Dominate.lean b/LeanPool/IsoGraph/Canon/Dominate.lean index f0619899a9..c3c2704094 100644 --- a/LeanPool/IsoGraph/Canon/Dominate.lean +++ b/LeanPool/IsoGraph/Canon/Dominate.lean @@ -29,7 +29,7 @@ dominated by the incumbent, and about moving a subtree along an automorphism. `γ w` onto the leaves below the child `w`, so the two children are interchangeable. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -42,7 +42,7 @@ theorem Beaten.dom {st : St} {k : List (List UInt64)} (h : Beaten st k) : Dom st /-- The depth to which a returning call guarantees that everything below is dominated: the node itself if it finished, the backjump target's child if it was cut short. -/ -def stopDepth (d : Nat) : Option Nat → Nat +@[expose] def stopDepth (d : Nat) : Option Nat → Nat | none => d | some j => min (j + 1) d diff --git a/LeanPool/IsoGraph/Canon/Equivariance.lean b/LeanPool/IsoGraph/Canon/Equivariance.lean index d256ba01ff..74ef63d48f 100644 --- a/LeanPool/IsoGraph/Canon/Equivariance.lean +++ b/LeanPool/IsoGraph/Canon/Equivariance.lean @@ -50,7 +50,7 @@ Each piece of the search respects `≈`: the discreteness at the leaves. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -2295,7 +2295,7 @@ theorem fragStart_eq {n : Nat} {p : Part} {c : Nat} {cnt ks sizes : Array Nat} rw [fragStart, hs, key] /-- The partition carried by the cell loop's state. -/ -def SplitState.part (st : SplitState) : Part := +@[expose] def SplitState.part (st : SplitState) : Part := { lab := st.lab, pos := st.pos, cst := st.cst, cen := st.cen } /-- **What splitting one cell does.** Outside the cell `[c, cen[c])` nothing moves; inside, each @@ -2573,11 +2573,11 @@ kernel should never be asked to do. -/ theorem part_mk (lab pos cst cen : Array Nat) (inW : Array Bool) (tr : UInt64) (bc : Array Nat) : (SplitState.mk lab pos cst cen inW tr bc).part - = { lab := lab, pos := pos, cst := cst, cen := cen } := rfl + = { lab := lab, pos := pos, cst := cst, cen := cen } := by rfl theorem part_update (st : SplitState) (inW : Array Bool) (tr : UInt64) (bc : Array Nat) : ({ lab := st.lab, pos := st.pos, cst := st.cst, cen := st.cen, inW, tr, bc } : - SplitState).part = st.part := rfl + SplitState).part = st.part := by rfl /-- A singleton cell: only the trace hash moves. -/ theorem splitCell_eq_singleton {cnt : Array Nat} {c : Nat} {st : SplitState} @@ -4468,6 +4468,7 @@ here, stated with the intermediates named by `orbRefresh` and `unwind`. Proofs ever use these, never the definitions. -/ /-- The orbit cache of `dfsChildren`, refreshed if new generators have turned up. -/ +@[expose] def orbRefresh (G : Graph) (path : Array Nat) (processed : Array Nat) (orb : Orbits) (st : St) : Orbits := if orb.nGens == st.autos.size then orb @@ -4476,7 +4477,7 @@ def orbRefresh (G : Graph) (path : Array Nat) (processed : Array Nat) (orb : Orb { nGens := st.autos.size, gens, mark := orbitClosure G.n gens processed } /-- Absorb a backjump request aimed at this depth. -/ -def unwind (path : Array Nat) (st : St) : St := +@[expose] def unwind (path : Array Nat) (st : St) : St := match st.abortTo with | some k => if k ≥ path.size then { st with abortTo := none } else st | none => st @@ -4753,7 +4754,7 @@ theorem isPermArray_of {n : Nat} {a : Array Nat} (hsize : a.size = n) /-! ### The search's output is an honest leaf -/ /-- The `Leaf` view of a `Result`, so that `LeafOk` can be reused for it. -/ -def resultLeaf (r : Result) : Leaf := +@[expose] def resultLeaf (r : Result) : Leaf := { path := #[], invPath := #[], cert := r.cert, lab := r.lab } /-- **The canonical labelling is a permutation and its certificate is the graph read at it.** -/ @@ -4777,7 +4778,10 @@ theorem canonical_ok (n : Nat) (f : Nat → Nat → Bool) : | some b => have hbo := hst.1 b hb exact ⟨hbo.size, hbo.lt, hbo.inj, hbo.cert⟩ - exact key _ (dfsNode_ok n f _ _ _ _ _ (initialRefine_wf f) ⟨by simp, by simp⟩) + exact key _ (dfsNode_ok n f _ _ _ _ + { best := none, first := none, autos := #[], nodes := 0, abortTo := none } + (initialRefine_wf f) + (by simp [StOk])) theorem canonical_cert (n : Nat) (f : Nat → Nat → Bool) : (canonical (Graph.ofOracle n f)).cert diff --git a/LeanPool/IsoGraph/Canon/Jump.lean b/LeanPool/IsoGraph/Canon/Jump.lean index 0b3f36c5c0..f6bb42e2a1 100644 --- a/LeanPool/IsoGraph/Canon/Jump.lean +++ b/LeanPool/IsoGraph/Canon/Jump.lean @@ -34,7 +34,7 @@ current leaf and the deepest node the two leaves share. This file justifies tha therefore already recorded under the second — the branch depth-first search has *finished*. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon diff --git a/LeanPool/IsoGraph/Canon/Leaves.lean b/LeanPool/IsoGraph/Canon/Leaves.lean index f17df369ae..3d8565d812 100644 --- a/LeanPool/IsoGraph/Canon/Leaves.lean +++ b/LeanPool/IsoGraph/Canon/Leaves.lean @@ -31,7 +31,7 @@ Bookkeeping for the optimality proof, one layer above `Jump.lean`. tree, and every generator it records is a genuine automorphism. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -71,7 +71,7 @@ theorem nodePath_take_succ (n : Nat) (f : Nat → Nat → Bool) (path : Array Na rw [he, nodePath_append] /-- The leaves below the depth-`j` ancestor of `path`. -/ -def ancReach (n : Nat) (f : Nat → Nat → Bool) (path : Array Nat) (j : Nat) +@[expose] def ancReach (n : Nat) (f : Nat → Nat → Bool) (path : Array Nat) (j : Nat) (k : List (List UInt64)) : Prop := Reach n f (nodePath n f (path.toList.take j)).1 (nodePath n f (path.toList.take j)).2 k @@ -100,11 +100,11 @@ theorem Node.ancestor_targetCell {n : Nat} {f : Nat → Nat → Bool} {path : Ar /-! ## Children -/ /-- `w` is a child of the node `p`: a vertex of its target cell. -/ -def Chld (n : Nat) (p : Part) (w : Nat) : Prop := +@[expose] def Chld (n : Nat) (p : Part) (w : Nat) : Prop := ∃ c, p.targetCell n = some c ∧ w < n ∧ p.cst[p.pos[w]!]! = c /-- The leaves below the child `w`. -/ -def SubR (n : Nat) (f : Nat → Nat → Bool) (invPath : Array UInt64) (p : Part) (w : Nat) +@[expose] def SubR (n : Nat) (f : Nat → Nat → Bool) (invPath : Array UInt64) (p : Part) (w : Nat) (k : List (List UInt64)) : Prop := Reach n f (childInv (Graph.ofOracle n f) invPath p w) (child (Graph.ofOracle n f) p w).1 k @@ -201,7 +201,7 @@ theorem invAuto_isAuto {n : Nat} {f : Nat → Nat → Bool} {g : Array Nat} (hg /-- `l` really is a leaf of the search tree: its path individualises down to a discrete partition, and its labelling and certificate are that partition's. -/ -def LeafNode (n : Nat) (f : Nat → Nat → Bool) (l : Leaf) : Prop := +@[expose] def LeafNode (n : Nat) (f : Nat → Nat → Bool) (l : Leaf) : Prop := ∃ p, Node n f l.path l.invPath p ∧ p.targetCell n = none ∧ l.lab = p.lab ∧ l.cert = certOf (Graph.ofOracle n f) p.lab @@ -216,7 +216,7 @@ theorem LeafNode.cert_eq {n : Nat} {f : Nat → Nat → Bool} {l : Leaf} (h : Le rw [hc, hlab] /-- Everything a state remembers is genuine: both recorded leaves, and every generator. -/ -def StGood (n : Nat) (f : Nat → Nat → Bool) (st : St) : Prop := +@[expose] def StGood (n : Nat) (f : Nat → Nat → Bool) (st : St) : Prop := (∀ l, st.best = some l → LeafNode n f l) ∧ (∀ l, st.first = some l → LeafNode n f l) ∧ (∀ g ∈ st.autos, IsAutoArr n f g) diff --git a/LeanPool/IsoGraph/Canon/Monotone.lean b/LeanPool/IsoGraph/Canon/Monotone.lean index 8aae84fd29..536709ab7c 100644 --- a/LeanPool/IsoGraph/Canon/Monotone.lean +++ b/LeanPool/IsoGraph/Canon/Monotone.lean @@ -31,7 +31,7 @@ The comparison used throughout is `compare k k' ≠ .gt` on `leafKey`s, the same is stated with. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -59,7 +59,7 @@ theorem lexCmpU64_gt_symm {a b : Array UInt64} (h : lexCmpU64 a b = .gt) : /-! ## Domination -/ /-- `k` is no better than the leaf the state holds. -/ -def Dom (st : St) (k : List (List UInt64)) : Prop := +@[expose] def Dom (st : St) (k : List (List UInt64)) : Prop := ∃ l, st.best = some l ∧ compare k (leafKey l.invPath l.cert) ≠ .gt /-- The incumbent never gets worse. -/ diff --git a/LeanPool/IsoGraph/Canon/Node.lean b/LeanPool/IsoGraph/Canon/Node.lean index ab3e49f3ca..751c667ee8 100644 --- a/LeanPool/IsoGraph/Canon/Node.lean +++ b/LeanPool/IsoGraph/Canon/Node.lean @@ -32,7 +32,7 @@ It packages the facts that the recursion needs about a node it is sitting at: `usableAutos` filters for. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon diff --git a/LeanPool/IsoGraph/Canon/Optimal.lean b/LeanPool/IsoGraph/Canon/Optimal.lean index 4c0468dadb..0917afdd57 100644 --- a/LeanPool/IsoGraph/Canon/Optimal.lean +++ b/LeanPool/IsoGraph/Canon/Optimal.lean @@ -44,12 +44,13 @@ The other pieces: it returned normally, only the part above the backjump target if it asked to jump. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon /-- Dominated by the incumbent, or already accounted for by whoever called us. -/ +@[expose] def DomD (D : List (List UInt64) → Prop) (st : St) (k : List (List UInt64)) : Prop := Dom st k ∨ D k @@ -180,6 +181,7 @@ theorem Dchild.self_of {n : Nat} {f : Nat → Nat → Bool} {D : List (List UInt /-- What a returning call guarantees: it never asks to jump above the node it was called at, and every leaf below the depth it vouches for is accounted for. `st0` is the state it started from, whose incumbent it never loses. -/ +@[expose] def Guar (n : Nat) (f : Nat → Nat → Bool) (D : List (List UInt64) → Prop) (path : Array Nat) (st0 st : St) : Prop := (∀ j, st.abortTo = some j → j < path.size) ∧ diff --git a/LeanPool/IsoGraph/Canon/Orbits.lean b/LeanPool/IsoGraph/Canon/Orbits.lean index dd9a9f5305..a331658b1f 100644 --- a/LeanPool/IsoGraph/Canon/Orbits.lean +++ b/LeanPool/IsoGraph/Canon/Orbits.lean @@ -34,7 +34,7 @@ Instantiated with `P w := "the subtree below the child w is dominated"` and comb `Autos.reach_child_auto`, this says that skipping a marked child loses no leaf key. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -44,9 +44,10 @@ namespace Canon variable {P : Nat → Prop} /-- `mark` only ever flags points satisfying `P`. -/ -def MarkP (P : Nat → Prop) (mark : Array Bool) : Prop := ∀ w, mark[w]! = true → P w +@[expose] def MarkP (P : Nat → Prop) (mark : Array Bool) : Prop := ∀ w, mark[w]! = true → P w /-- Every entry of the frontier satisfies `P`. -/ +@[expose] def StackP (P : Nat → Prop) (stack : Array Nat) : Prop := ∀ i, i < stack.size → P stack[i]! theorem markP_set {mark : Array Bool} {w : Nat} (hm : MarkP P mark) (hw : P w) : diff --git a/LeanPool/IsoGraph/Canon/Paths.lean b/LeanPool/IsoGraph/Canon/Paths.lean index 4dc96b532e..bf1eea14a2 100644 --- a/LeanPool/IsoGraph/Canon/Paths.lean +++ b/LeanPool/IsoGraph/Canon/Paths.lean @@ -28,7 +28,7 @@ which leaf is *best*. invariant "the incumbent's path does not go down a branch we have not explored yet". -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -59,7 +59,8 @@ theorem extract_nodup {n : Nat} {p : Part} (hp : Part.WF n p) (a b : Nat) : /-! ## Prefixes of paths -/ /-- `a` is an initial segment of `b`. -/ -def PathPre (a b : Array Nat) : Prop := a.size ≤ b.size ∧ ∀ i, i < a.size → a[i]! = b[i]! +@[expose] def PathPre (a b : Array Nat) : Prop := + a.size ≤ b.size ∧ ∀ i, i < a.size → a[i]! = b[i]! theorem PathPre.refl (a : Array Nat) : PathPre a a := ⟨Nat.le_refl _, fun _ _ => rfl⟩ @@ -95,7 +96,7 @@ theorem PathPre.push_iff {a b : Array Nat} {v : Nat} : /-! ## The search only records leaves of the subtree it is in -/ /-- Every leaf a state remembers — incumbent or first — has a path satisfying `P`. -/ -def StQ (P : Array Nat → Prop) (st : St) : Prop := +@[expose] def StQ (P : Array Nat → Prop) (st : St) : Prop := (∀ l, st.best = some l → P l.path) ∧ (∀ l, st.first = some l → P l.path) theorem StQ.mono {P P' : Array Nat → Prop} {st : St} (h : StQ P st) (hPP : ∀ Q, P Q → P' Q) : diff --git a/LeanPool/IsoGraph/Canon/Pinned.lean b/LeanPool/IsoGraph/Canon/Pinned.lean index f29fc3d828..e489d89c06 100644 --- a/LeanPool/IsoGraph/Canon/Pinned.lean +++ b/LeanPool/IsoGraph/Canon/Pinned.lean @@ -32,7 +32,7 @@ two equal-certificate leaves visibly map one branch onto the other. Along the way `nodePath` makes a node an honest function of its path (`Node.det`). -/ -@[expose] public section +public section namespace IsoGraph namespace Canon @@ -253,7 +253,7 @@ theorem child_pinned_new {n : Nat} {f : Nat → Nat → Bool} {p : Part} {v : Na /-- The node reached by individualising `path`, in order, from the root. `Node` is the graph of this function (`Node.nodePath_eq`); having it as an actual function is what lets two branches of the search that share a path prefix be identified. -/ -def nodePath (n : Nat) (f : Nat → Nat → Bool) (path : List Nat) : Array UInt64 × Part := +@[expose] def nodePath (n : Nat) (f : Nat → Nat → Bool) (path : List Nat) : Array UInt64 × Part := path.foldl (fun s v => (childInv (Graph.ofOracle n f) s.1 s.2 v, (child (Graph.ofOracle n f) s.2 v).1)) (rootInv n f, rootPart n f) diff --git a/LeanPool/IsoGraph/Canon/Progress.lean b/LeanPool/IsoGraph/Canon/Progress.lean index d329f4d25c..a04801c76d 100644 --- a/LeanPool/IsoGraph/Canon/Progress.lean +++ b/LeanPool/IsoGraph/Canon/Progress.lean @@ -28,7 +28,7 @@ the *first* child of a node is never orbit-pruned, which holds because the orbit empty and is only refreshed when an automorphism has been found — which happens only at a leaf. -/ -@[expose] public section +public section namespace IsoGraph namespace Canon diff --git a/LeanPool/IsoGraph/Canon/Search.lean b/LeanPool/IsoGraph/Canon/Search.lean index 7ebfdfd9b7..7954188703 100644 --- a/LeanPool/IsoGraph/Canon/Search.lean +++ b/LeanPool/IsoGraph/Canon/Search.lean @@ -32,7 +32,7 @@ largest key, i.e. that none of the three pruning rules ever discards it — is ` `IsoGraph/Canon/Optimal.lean`; the two are joined in `IsoGraph/Canon/Correct.lean`. -/ -@[expose] public section +public section namespace IsoGraph @@ -111,7 +111,8 @@ theorem lexCmpU64_refl (a : Array UInt64) : lexCmpU64 a a = .eq := /-- The key a leaf is judged by: its node-invariant path first, its certificate second. Packing the two as a `List (List UInt64)` makes lexicographic `compare` on the pair — exactly the comparison `leafUpdate` performs — available with all of Std's order lemmas. -/ -def leafKey (invPath cert : Array UInt64) : List (List UInt64) := [invPath.toList, cert.toList] +@[expose] def leafKey (invPath cert : Array UInt64) : List (List UInt64) := + [invPath.toList, cert.toList] /-- `compare` on keys is the two-stage comparison of `leafUpdate`. -/ theorem compare_leafKey (i c i' c' : Array UInt64) : @@ -137,12 +138,12 @@ tree, in which every vertex of the target cell is individualised in turn — has /-- The child of `p` obtained by individualising `v` and re-refining, with the trace of the refinement. This is exactly the step `dfsChildren` takes. -/ -def child (G : Graph) (p : Part) (v : Nat) : Part × UInt64 := +@[expose] def child (G : Graph) (p : Part) (v : Nat) : Part × UInt64 := refine G (individualize p v).1 ((Array.replicate G.n false).set! (individualize p v).2 true) hashSeed /-- The node invariant of that child, appended to the path invariant. -/ -def childInv (G : Graph) (invPath : Array UInt64) (p : Part) (v : Nat) : Array UInt64 := +@[expose] def childInv (G : Graph) (invPath : Array UInt64) (p : Part) (v : Nat) : Array UInt64 := invPath.push (mix (child G p v).2 ((child G p v).1.shapeHash G.n)) /-- The leaves of the unpruned search tree below `p`, described by their keys. -/ @@ -228,19 +229,19 @@ theorem reach_transfer' {n : Nat} {σ : Nat → Nat} {f : Nat → Nat → Bool} /-! ### The specification, and its invariance -/ /-- The root of the search: the initially refined partition and its one-entry invariant path. -/ -def rootPart (n : Nat) (f : Nat → Nat → Bool) : Part := +@[expose] def rootPart (n : Nat) (f : Nat → Nat → Bool) : Part := (initialRefine (Graph.ofOracle n f)).1 /-- The invariant path at the root. -/ -def rootInv (n : Nat) (f : Nat → Nat → Bool) : Array UInt64 := +@[expose] def rootInv (n : Nat) (f : Nat → Nat → Bool) : Array UInt64 := #[mix (initialRefine (Graph.ofOracle n f)).2 ((rootPart n f).shapeHash n)] /-- `k` is the key of a leaf of the whole (unpruned) search tree. -/ -def Leafkey (n : Nat) (f : Nat → Nat → Bool) (k : List (List UInt64)) : Prop := +@[expose] def Leafkey (n : Nat) (f : Nat → Nat → Bool) (k : List (List UInt64)) : Prop := Reach n f (rootInv n f) (rootPart n f) k /-- **The specification of `canonical`**: the largest key of any leaf. -/ -def BestKey (n : Nat) (f : Nat → Nat → Bool) (k : List (List UInt64)) : Prop := +@[expose] def BestKey (n : Nat) (f : Nat → Nat → Bool) (k : List (List UInt64)) : Prop := Leafkey n f k ∧ ∀ k', Leafkey n f k' → compare k' k ≠ .gt theorem bestKey_unique {n : Nat} {f : Nat → Nat → Bool} {k k' : List (List UInt64)} @@ -324,7 +325,7 @@ the state holds afterwards. Taking `P` to be "is a leaf key of the whole tree" `canonical_leafkey`. -/ /-- Every leaf the state holds satisfies `P`. -/ -def StP (P : List (List UInt64) → Prop) (st : St) : Prop := +@[expose] def StP (P : List (List UInt64) → Prop) (st : St) : Prop := ∀ l, st.best = some l → P (leafKey l.invPath l.cert) theorem pruneNode_P {P : List (List UInt64) → Prop} {invPath : Array UInt64} {st st' : St} @@ -442,7 +443,7 @@ theorem dfsNode_reach (n : Nat) (f : Nat → Nat → Bool) (P : List (List UInt6 /-! ### The winner is a leaf of the whole tree -/ /-- The final state of the search on `Graph.ofOracle n f`. -/ -def canonSt (n : Nat) (f : Nat → Nat → Bool) : St := +@[expose] def canonSt (n : Nat) (f : Nat → Nat → Bool) : St := dfsNode (Graph.ofOracle n f) (n + 1) #[] (rootInv n f) (rootPart n f) { best := none, first := none, autos := #[], nodes := 0, abortTo := none } @@ -452,7 +453,7 @@ theorem canonical_eq (n : Nat) (f : Nat → Nat → Bool) : | none => { lab := Array.range n, cert := certOf (Graph.ofOracle n f) (Array.range n), autos := #[], nodes := (canonSt n f).nodes } | some b => { lab := b.lab, cert := b.cert, autos := (canonSt n f).autos, - nodes := (canonSt n f).nodes } := rfl + nodes := (canonSt n f).nodes } := by rfl /-- **Soundness of the search.** Whatever leaf the search ends up holding really is a leaf of the (unpruned) tree. -/ @@ -504,7 +505,7 @@ theorem compare_leafKey_lt {ip b tail c c' : List UInt64} /-! ### Invariant pruning is sound -/ /-- `k` is beaten by the leaf the state currently holds. -/ -def Beaten (st : St) (k : List (List UInt64)) : Prop := +@[expose] def Beaten (st : St) (k : List (List UInt64)) : Prop := ∃ l, st.best = some l ∧ compare k (leafKey l.invPath l.cert) = .lt theorem lexCmpU64_extract {a b : Array UInt64} : diff --git a/LeanPool/IsoGraph/Canon/Spec.lean b/LeanPool/IsoGraph/Canon/Spec.lean index bf46bb5dc1..e102a81a6a 100644 --- a/LeanPool/IsoGraph/Canon/Spec.lean +++ b/LeanPool/IsoGraph/Canon/Spec.lean @@ -41,7 +41,7 @@ Write `relabel σ adj` for `adj` with its vertices renamed along `σ`. Two stat `IsoGraph/Canon/Correct.lean` obtains from the soundness and optimality of the search. -/ -@[expose] public section +public section namespace IsoGraph.Canon @@ -112,12 +112,12 @@ is the canonical one. **This is the specification, not the way to compute.** Lean η-expands every function-typed definition, so each query `canonAdj n adj i j` re-runs the whole search. To compute, use `canonMatrix`, whose result is a structure and therefore shares the search across queries. -/ -def canonAdj (n : Nat) (adj : Fin n → Fin n → Bool) : Fin n → Fin n → Bool := +@[expose] def canonAdj (n : Nat) (adj : Fin n → Fin n → Bool) : Fin n → Fin n → Bool := let σ := canonPerm n adj fun i j ↦ adj (σ i) (σ j) /-- `Fin m ≃ Fin n` from `m = n`. Unlike `Equiv.cast` this has a definitional `val`. -/ -def finEq {m n : Nat} (h : m = n) : Fin m ≃ Fin n where +@[expose] def finEq {m n : Nat} (h : m = n) : Fin m ≃ Fin n where toFun i := ⟨i.1, h ▸ i.2⟩ invFun j := ⟨j.1, h ▸ j.2⟩ left_inv _ := rfl @@ -170,7 +170,7 @@ theorem ext' {n : Nat} {M N : AdjMatrix n} (h : M.adj = N.adj) : M = N := by cases M; cases N; cases h; rfl /-- Query a matrix at plain naturals; `false` out of range. -/ -def get {n : Nat} (M : AdjMatrix n) (a b : Nat) : Bool := oracleOfFin n M.adj a b +@[expose] def get {n : Nat} (M : AdjMatrix n) (a b : Nat) : Bool := oracleOfFin n M.adj a b theorem get_eq {n : Nat} (M : AdjMatrix n) {a b : Nat} (ha : a < n) (hb : b < n) : M.get a b = M.adj ⟨a, ha⟩ ⟨b, hb⟩ := oracleOfFin_apply _ ha hb @@ -180,7 +180,7 @@ theorem get_eq {n : Nat} (M : AdjMatrix n) {a b : Nat} (ha : a < n) (hb : b < n) This is the one place where an index set of the "wrong" size is tolerated, and it is what lets the canonical form of a graph be stated on `Fin (Fintype.card V)` while being computed from a listing whose length is only *provably* that. -/ -def reindex {n : Nat} (M : AdjMatrix n) (m : Nat) : AdjMatrix m := +@[expose] def reindex {n : Nat} (M : AdjMatrix n) (m : Nat) : AdjMatrix m := ⟨fun i j ↦ M.get i.1 j.1⟩ @[simp] theorem reindex_adj {n m : Nat} (M : AdjMatrix n) (i j : Fin m) : @@ -206,13 +206,14 @@ theorem heq_of_adj {m n : Nat} (h : m = n) {M : AdjMatrix m} {N : AdjMatrix n} end AdjMatrix /-- The graph `adj` read through the permutation `σ`, as a matrix. -/ +@[expose] def matrixOfPerm (n : Nat) (adj : Fin n → Fin n → Bool) (σ : Equiv.Perm (Fin n)) : AdjMatrix n := ⟨fun i j ↦ adj (σ i) (σ j)⟩ /-- **The canonical form of a graph on `Fin n`, computed.** The search runs once, when this is forced — `σ` is an argument of `matrixOfPerm`, so it is evaluated before the closure is built — and each query of the resulting `adj` is then `O(1)`. -/ -def canonMatrix (n : Nat) (adj : Fin n → Fin n → Bool) : AdjMatrix n := +@[expose] def canonMatrix (n : Nat) (adj : Fin n → Fin n → Bool) : AdjMatrix n := matrixOfPerm n adj (canonPerm n adj) @[simp] theorem canonMatrix_adj (n : Nat) (adj : Fin n → Fin n → Bool) : @@ -227,6 +228,7 @@ variable {n : Nat} /-- `adj` with its vertices renamed along `σ`: the vertex `i` of `relabel σ adj` plays the role of the vertex `σ i` of `adj`. -/ +@[expose] def relabel (σ : Equiv.Perm (Fin n)) (adj : Fin n → Fin n → Bool) : Fin n → Fin n → Bool := fun i j ↦ adj (σ i) (σ j) diff --git a/LeanPool/IsoGraph/ForMathlib/Array.lean b/LeanPool/IsoGraph/ForMathlib/Array.lean index 6a06714c60..1daaea0461 100644 --- a/LeanPool/IsoGraph/ForMathlib/Array.lean +++ b/LeanPool/IsoGraph/ForMathlib/Array.lean @@ -22,7 +22,7 @@ something in the library needed them, and they are collected in `ForMathlib` so can be contributed upstream, or deleted when Mathlib grows its own. -/ -@[expose] public section +public section theorem array_extD {α : Type _} [Inhabited α] {a b : Array α} (hs : a.size = b.size) diff --git a/LeanPool/IsoGraph/ForMathlib/Bits.lean b/LeanPool/IsoGraph/ForMathlib/Bits.lean index e123a649c9..de0380e1cf 100644 --- a/LeanPool/IsoGraph/ForMathlib/Bits.lean +++ b/LeanPool/IsoGraph/ForMathlib/Bits.lean @@ -22,7 +22,7 @@ something in the library needed them, and they are collected in `ForMathlib` so can be contributed upstream, or deleted when Mathlib grows its own. -/ -@[expose] public section +public section theorem eq_of_testBit_lt {n a b : ℕ} (ha : a < 2 ^ n) (hb : b < 2 ^ n) diff --git a/LeanPool/Isoperimetric.lean b/LeanPool/Isoperimetric.lean index 871514e450..6c3d5867c0 100644 --- a/LeanPool/Isoperimetric.lean +++ b/LeanPool/Isoperimetric.lean @@ -23,7 +23,7 @@ Tags: measure-theory, geometric-inequalities MSC: 28A75, 52A40, 49Q20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Isoperimetric/Basic.lean b/LeanPool/Isoperimetric/Basic.lean index 5c237d0a51..f638c40942 100644 --- a/LeanPool/Isoperimetric/Basic.lean +++ b/LeanPool/Isoperimetric/Basic.lean @@ -15,7 +15,7 @@ powers of `ENNReal`-valued functions used throughout the formalization of the Prékopa–Leindler, Brunn–Minkowski, and isoperimetric inequalities. -/ -@[expose] public section +public section /-- The sum of two bounded indexed suprema in `ENNReal` equals the indexed supremum of the pointwise sums. -/ diff --git a/LeanPool/Isoperimetric/BrunnMinkowski.lean b/LeanPool/Isoperimetric/BrunnMinkowski.lean index dae31a8cfc..20e2278723 100644 --- a/LeanPool/Isoperimetric/BrunnMinkowski.lean +++ b/LeanPool/Isoperimetric/BrunnMinkowski.lean @@ -19,7 +19,7 @@ inequality, both for the standard product measure on `ℝⁿ` and for the Euclidean structure `EuclideanSpace ℝ (Fin n)`. -/ -@[expose] public section +public section open MeasureTheory Set open scoped Pointwise diff --git a/LeanPool/Isoperimetric/Isoperimetric.lean b/LeanPool/Isoperimetric/Isoperimetric.lean index 43bfa8a152..2fc8c13041 100644 --- a/LeanPool/Isoperimetric/Isoperimetric.lean +++ b/LeanPool/Isoperimetric/Isoperimetric.lean @@ -19,7 +19,7 @@ relating `volume A`, the volume of the unit ball, and the volume of the `ε`-thickening of `A`. -/ -@[expose] public section +public section open MeasureTheory Set open scoped Pointwise diff --git a/LeanPool/Isoperimetric/PrekopaLeindler.lean b/LeanPool/Isoperimetric/PrekopaLeindler.lean index 8a84c4527f..268fdf8748 100644 --- a/LeanPool/Isoperimetric/PrekopaLeindler.lean +++ b/LeanPool/Isoperimetric/PrekopaLeindler.lean @@ -19,7 +19,7 @@ proceeds by reducing to the one-dimensional case via the layer-cake formula and then induction on the dimension. -/ -@[expose] public section +public section open MeasureTheory Set open scoped Pointwise @@ -602,7 +602,7 @@ lemma lintegral_fix_lintegral_eq_lintegral (fun _ : Fin (d + 2) ↦ ℝ) (Fin.last (d + 1))).symm.map_eq /-- The hypotheses of the Prékopa–Leindler inequality bundled together. -/ -def PLConditions (n : ℕ) (θ : ℝ) (f g h : (Fin n → ℝ) → ENNReal) : Prop := +@[expose] def PLConditions (n : ℕ) (θ : ℝ) (f g h : (Fin n → ℝ) → ENNReal) : Prop := 0 < θ ∧ θ < 1 ∧ Measurable f ∧ Measurable g ∧ Measurable h ∧ (∀ x y, (f x)^(1-θ) * (g y)^θ ≤ h (x + y)) diff --git a/LeanPool/JacobianDiffgeo.lean b/LeanPool/JacobianDiffgeo.lean index 40c5fb9802..f5c7183087 100644 --- a/LeanPool/JacobianDiffgeo.lean +++ b/LeanPool/JacobianDiffgeo.lean @@ -53,4 +53,4 @@ Tags: riemann-surfaces, complex-geometry, abel-jacobi, riemann-roch, serre-duali MSC: 14H40, 30F30, 32G20 -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Abel.lean b/LeanPool/JacobianDiffgeo/Abel.lean index a154217271..ebf285162d 100644 --- a/LeanPool/JacobianDiffgeo/Abel.lean +++ b/LeanPool/JacobianDiffgeo/Abel.lean @@ -175,4 +175,4 @@ every breakpoint, including the case where the path revisits its own basepoint). ``` -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Abel/AreaPairing.lean b/LeanPool/JacobianDiffgeo/Abel/AreaPairing.lean index 82530e550b..f310cc694d 100644 --- a/LeanPool/JacobianDiffgeo/Abel/AreaPairing.lean +++ b/LeanPool/JacobianDiffgeo/Abel/AreaPairing.lean @@ -48,7 +48,7 @@ single-chart-supported `(0,1)`-data. No independence-of-`PU` statement is ever n downstream conclusion is a `Prop` quantified over a single fixed `PU`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set MeasureTheory @@ -278,7 +278,7 @@ theorem chart_mem_maximalAtlas (i : Fin PU.n) : PU.chart i ∈ maximalAtlas 𝓘 IsManifold.chart_mem_maximalAtlas _ /-- The compact planar carrier of the `i`-th partition member. -/ -def K (i : Fin PU.n) : Set ℂ := ⇑(PU.chart i) '' tsupport (PU.ψ i) +@[expose] def K (i : Fin PU.n) : Set ℂ := ⇑(PU.chart i) '' tsupport (PU.ψ i) omit [IsManifold 𝓘(ℂ, ℂ) ω X] [T2Space X] in theorem isCompact_K (i : Fin PU.n) : IsCompact (PU.K i) := by @@ -312,7 +312,7 @@ theorem psi_symm_eventually_zero (i : Fin PU.n) {z : ℂ} (hzK : z ∉ PU.K i) : · exact Set.indicator_of_notMem hwT _ /-- The complexified partition function read through an arbitrary chart. -/ -def psiC (i : Fin PU.n) (e : OpenPartialHomeomorph X ℂ) : ℂ → ℂ := +@[expose] def psiC (i : Fin PU.n) (e : OpenPartialHomeomorph X ℂ) : ℂ → ℂ := fun w => ((PU.ψ i (e.symm w) : ℝ) : ℂ) omit [T2Space X] [CompactSpace X] [IsManifold 𝓘(ℂ, ℂ) ω X] in @@ -392,6 +392,7 @@ variable [T2Space X] [CompactSpace X] /-- The `i`-th planar integrand of the Serre pairing: `ψ_i · σ_i · ω_i` read in the `i`-th chart, extended by `0` off the chart target. -/ +@[expose] def pairingTerm (PU : SurfPoU X) (σ : RS.Form01 X) (θ : RS.Form1 X) (i : Fin PU.n) : ℂ → ℂ := ((PU.chart i).target).indicator (fun z => PU.ψ i ((PU.chart i).symm z) • @@ -439,6 +440,7 @@ theorem integrable_pairingTerm (PU : SurfPoU X) (σ : RS.Form01 X) (θ : RS.Form /-- **The Serre area pairing** over the fixed partition datum `PU`: `∑ i, ∫ z, ψ_i(z) σ_i(z) ω_i(z) dA(z)`. -/ +@[expose] def pairing (PU : SurfPoU X) (σ : RS.Form01 X) (θ : RS.Form1 X) : ℂ := ∑ i, ∫ z : ℂ, pairingTerm PU σ θ i z diff --git a/LeanPool/JacobianDiffgeo/Abel/ChartSupported.lean b/LeanPool/JacobianDiffgeo/Abel/ChartSupported.lean index fb2a0cd107..169dab55ba 100644 --- a/LeanPool/JacobianDiffgeo/Abel/ChartSupported.lean +++ b/LeanPool/JacobianDiffgeo/Abel/ChartSupported.lean @@ -37,7 +37,7 @@ Also here: the inverse-derivative units `deriv_trans_mul_deriv_trans_symm` / `Form01.coeffAt_finsetSum`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set MeasureTheory diff --git a/LeanPool/JacobianDiffgeo/Abel/DolbeaultBridge.lean b/LeanPool/JacobianDiffgeo/Abel/DolbeaultBridge.lean index 9370eced91..d60698e3e2 100644 --- a/LeanPool/JacobianDiffgeo/Abel/DolbeaultBridge.lean +++ b/LeanPool/JacobianDiffgeo/Abel/DolbeaultBridge.lean @@ -70,7 +70,7 @@ explicitly does not build this global object) is independent, substantial new an not an external blocker — flagged precisely in `Sufficiency.lean`. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/Abel/LinkData.lean b/LeanPool/JacobianDiffgeo/Abel/LinkData.lean index 2a40fbd017..ca375fe234 100644 --- a/LeanPool/JacobianDiffgeo/Abel/LinkData.lean +++ b/LeanPool/JacobianDiffgeo/Abel/LinkData.lean @@ -44,7 +44,7 @@ plus a factor limit pin `meromorphicOrderAt`, via mathlib's removable-singularit `wirtingerDbar_finset_prod`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set MeasureTheory Filter Topology @@ -166,7 +166,7 @@ variable {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ) ω X] /-- The contribution of the link `(A ↦ pole, B ↦ zero)` to the order at `x`. -/ -def linkOrd [DecidableEq X] (A B x : X) : ℤ := +@[expose] def linkOrd [DecidableEq X] (A B x : X) : ℤ := (if x = B then 1 else 0) - (if x = A then 1 else 0) omit [TopologicalSpace X] [T2Space X] [CompactSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ, ℂ) ω X] diff --git a/LeanPool/JacobianDiffgeo/Abel/LogPiece.lean b/LeanPool/JacobianDiffgeo/Abel/LogPiece.lean index 821457633b..0fef13dc7e 100644 --- a/LeanPool/JacobianDiffgeo/Abel/LogPiece.lean +++ b/LeanPool/JacobianDiffgeo/Abel/LogPiece.lean @@ -41,7 +41,7 @@ pole at `α`), interpolated to `1` across the bump annulus `ρ < rIn ≤ ‖z - (`DiffContOnCl.circleIntegral_sub_inv_smul`) evaluates it. -/ -@[expose] public section +public section open scoped ContDiff open Complex Metric Set MeasureTheory Filter Topology diff --git a/LeanPool/JacobianDiffgeo/Abel/Loops.lean b/LeanPool/JacobianDiffgeo/Abel/Loops.lean index 5231b69eeb..0b306ab64d 100644 --- a/LeanPool/JacobianDiffgeo/Abel/Loops.lean +++ b/LeanPool/JacobianDiffgeo/Abel/Loops.lean @@ -30,7 +30,7 @@ Unit: abel-theorem. Namespace `RS.Abel`. Two deliverables: of `RS.pathIntegralₗ` and `Module.Basis.ext`). -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean b/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean index 9c0d5d481d..dec81c1a33 100644 --- a/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean +++ b/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean @@ -31,7 +31,7 @@ moment `period-lattice-rank` registers `instance : DiscreteTopology (RS.periodSu `WeakSolutionUpgrade X` is proved (see `Sufficiency.lean` for the precise remaining roadmap). -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -61,6 +61,8 @@ theorem ofCurve_inj' (hupgrade : RS.Abel.WeakSolutionUpgrade X) (P : X) (h : 0 < have hxy' : (fun i => RS.pathIntegral (PathConnectedSpace.somePath P x) (RS.basis X i)) - (fun i => RS.pathIntegral (PathConnectedSpace.somePath P y) (RS.basis X i)) ∈ (RS.periodSubgroup X).topologicalClosure := by + rw [ofCurve_eq_of_path P x (PathConnectedSpace.somePath P x), + ofCurve_eq_of_path P y (PathConnectedSpace.somePath P y)] at hxy have := ULift.up.injEq .. |>.mp hxy rwa [QuotientAddGroup.eq_iff_sub_mem] at this rw [hclosure_eq] at hxy' diff --git a/LeanPool/JacobianDiffgeo/Abel/SerreFunctional.lean b/LeanPool/JacobianDiffgeo/Abel/SerreFunctional.lean index 6cb9ce4def..a3918a103e 100644 --- a/LeanPool/JacobianDiffgeo/Abel/SerreFunctional.lean +++ b/LeanPool/JacobianDiffgeo/Abel/SerreFunctional.lean @@ -54,7 +54,7 @@ concrete planar Stokes/residue computations — the shape `DolbeaultBridge.lean` residue-pairing hypothesis does not directly offer. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set MeasureTheory @@ -667,7 +667,7 @@ def pairingH01 (PU : SurfPoU X) (θ : RS.Form1 X) : RS.H01 X →ₗ[ℂ] ℂ := omit [T2Space X] in @[simp] theorem pairingH01_mk (PU : SurfPoU X) (θ : RS.Form1 X) (σ : RS.Form01 X) : - pairingH01 PU θ (RS.H01.mk σ) = pairing PU σ θ := rfl + pairingH01 PU θ (RS.H01.mk σ) = pairing PU σ θ := by rfl /-- The Serre functional `θ ↦ ∫∫ · ∧ θ`, as a linear map into the dual of `H01 X`. -/ def pairingDual (PU : SurfPoU X) : RS.Form1 X →ₗ[ℂ] Module.Dual ℂ (RS.H01 X) where @@ -748,7 +748,10 @@ theorem tailToH1_zero_surjective_iff_finrank_le : (LinearMap.finrank_le_finrank_of_injective hinj).antisymm (hle.trans_eq hgen.symm) have hsurj' : Function.Surjective (RS.LaurentTail.H1Tail.toH1 (0 : RS.Divisor X)) := (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hfr).mp hinj - exact hsurj'.comp (RS.LaurentTail.H1Tail.mk_surjective (0 : RS.Divisor X)) + intro y + obtain ⟨ξ, rfl⟩ := hsurj' y + obtain ⟨τ, rfl⟩ := RS.LaurentTail.H1Tail.mk_surjective (0 : RS.Divisor X) ξ + exact ⟨τ, (RS.LaurentTail.H1Tail.toH1_mk (0 : RS.Divisor X) τ).symm⟩ end RS.Abel diff --git a/LeanPool/JacobianDiffgeo/Abel/Sufficiency.lean b/LeanPool/JacobianDiffgeo/Abel/Sufficiency.lean index 302bbc4143..963d738da2 100644 --- a/LeanPool/JacobianDiffgeo/Abel/Sufficiency.lean +++ b/LeanPool/JacobianDiffgeo/Abel/Sufficiency.lean @@ -69,7 +69,7 @@ The **easy/necessity direction** (§2.2, "`∃F` with one simple pole `⟹` `gen built, no admitted steps: `genus_eq_zero_of_exists_simple_pole` (`WeakToMero.lean`). -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -109,7 +109,7 @@ hypothesis off `{P, Q}`, plus a short direct `wirtingerDbar f P = 0` computation extend holomorphy of the local `ψ`-cofactor across the puncture) similarly at `Q`. Investigated and found tractable in outline this pass (recorded above and in the build log) but not completed on top of everything else — this is precisely the boundary of what this pass closed. -/ -def WeakSolutionUpgrade (X : Type*) [TopologicalSpace X] [T2Space X] +@[expose] def WeakSolutionUpgrade (X : Type*) [TopologicalSpace X] [T2Space X] [ConnectedSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ) ω X] : Prop := ∀ {f : X → ℂ} {P Q : X}, Q ≠ P → ∀ δ : Path Q P, RS.AbelWeak.IsWeakSolutionOfPair f P Q → (∀ θ : RS.Form1 X, RS.pathIntegral δ θ = 0) → @@ -158,7 +158,7 @@ multiplicativity (weak solutions of pairwise-disjoint pairs multiply, `IsWeakSol and 7 run once for the assembled product weak solution (`η := ∑ i, η i`, the design's own account of the `k`-point case, §4.1). Same discharge roadmap as `WeakSolutionUpgrade`'s own docstring, mechanically re-run for a `Finset`-indexed family instead of a single pair. -/ -def WeakSolutionUpgradeFinset (X : Type*) [TopologicalSpace X] [T2Space X] +@[expose] def WeakSolutionUpgradeFinset (X : Type*) [TopologicalSpace X] [T2Space X] [ConnectedSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ) ω X] (ι : Type*) [Fintype ι] : Prop := ∀ {f : X → ℂ} {a x : ι → X}, diff --git a/LeanPool/JacobianDiffgeo/Abel/UpgradeDischarge.lean b/LeanPool/JacobianDiffgeo/Abel/UpgradeDischarge.lean index 95852e1c6c..26add61fe8 100644 --- a/LeanPool/JacobianDiffgeo/Abel/UpgradeDischarge.lean +++ b/LeanPool/JacobianDiffgeo/Abel/UpgradeDischarge.lean @@ -48,7 +48,7 @@ external fact (the same gate as `DolbeaultBridge.lean`; the weak-solution hypoth `WeakSolutionUpgrade` shapes are simply not needed: the construction builds its own pieces). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set MeasureTheory Filter Topology diff --git a/LeanPool/JacobianDiffgeo/Abel/WeakToMero.lean b/LeanPool/JacobianDiffgeo/Abel/WeakToMero.lean index 94e034f764..956c61b008 100644 --- a/LeanPool/JacobianDiffgeo/Abel/WeakToMero.lean +++ b/LeanPool/JacobianDiffgeo/Abel/WeakToMero.lean @@ -36,7 +36,7 @@ Unit: abel-theorem. Namespace `RS.Abel`. Two deliverables: imported anywhere in this unit, matching the design's finding (§2.2). -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/AbelWeak.lean b/LeanPool/JacobianDiffgeo/AbelWeak.lean index 8c5f165bc4..303d9a8ba5 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak.lean @@ -134,4 +134,4 @@ tightened `Builds on:` line (§2.5) plus the `ChartChain` dependency the general needed. No file here imports `Jacobian.Monodromy`, `Jacobian.FormTrace`, or `Jacobian.Meromorphic`. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/AbelWeak/ChainAssembly.lean b/LeanPool/JacobianDiffgeo/AbelWeak/ChainAssembly.lean index 61210deb2e..92b4d3095a 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak/ChainAssembly.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak/ChainAssembly.lean @@ -48,7 +48,7 @@ induction gluing `SingleChart` pieces at every interior breakpoint via a fully g order-additive `IsWeakSolutionAt.mul`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/AbelWeak/GeneralChain.lean b/LeanPool/JacobianDiffgeo/AbelWeak/GeneralChain.lean index fab13ad347..c3ab745a49 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak/GeneralChain.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak/GeneralChain.lean @@ -38,7 +38,7 @@ THREE points (`M 0`, `M m`, `M (m+1)`, with the possible coincidences `M 0 = M m off-`U` value if `P ∉ U`). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/AbelWeak/PlanarLogBranch.lean b/LeanPool/JacobianDiffgeo/AbelWeak/PlanarLogBranch.lean index 87b78fb905..cdf3dba36e 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak/PlanarLogBranch.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak/PlanarLogBranch.lean @@ -28,7 +28,7 @@ imports (matches `Path/Planar.lean`'s hygiene). Two facts: machinery needed). -/ -@[expose] public section +public section open Complex Metric Set diff --git a/LeanPool/JacobianDiffgeo/AbelWeak/Rechart.lean b/LeanPool/JacobianDiffgeo/AbelWeak/Rechart.lean index deef1eb378..ed84bf3dc4 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak/Rechart.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak/Rechart.lean @@ -39,7 +39,7 @@ uniformly for every `k1, k2` (no case split needed: `Function.update`'s value when `k1 + k2 = 0`, AND the generic case, `= 0`, matching what the naive product already gives). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Filter Topology Set diff --git a/LeanPool/JacobianDiffgeo/AbelWeak/SingleChart.lean b/LeanPool/JacobianDiffgeo/AbelWeak/SingleChart.lean index df6b89efbe..053077c4fe 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak/SingleChart.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak/SingleChart.lean @@ -31,7 +31,7 @@ beyond `Set.EqOn`-rewriting** on the transition annulus (the same shape the desi describes). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Metric Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/AbelWeak/WeakSolution.lean b/LeanPool/JacobianDiffgeo/AbelWeak/WeakSolution.lean index 39cee26746..60ecca7b08 100644 --- a/LeanPool/JacobianDiffgeo/AbelWeak/WeakSolution.lean +++ b/LeanPool/JacobianDiffgeo/AbelWeak/WeakSolution.lean @@ -29,7 +29,7 @@ two-point pairs — the degenerate, already-disjoint case `abel-theorem`'s own 2 construction sets up (no general chain/homology bookkeeping needed). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Filter Topology Set @@ -43,6 +43,7 @@ variable {X : Type*} [TopologicalSpace X] [T2Space X] [ChartedSpace ℂ X] [IsMa /-- Forster 20.1's local model at a single point `a`: `f` agrees, in some maximal-atlas chart `e` at `a`, with `ψ (e ·) * (e · - e a) ^ k` near `a`, for `ψ` smooth and non-vanishing near `e a`. `k : ℤ` ranges over all integers (a genuine `zpow`, allowing a pole `k < 0`). -/ +@[expose] def IsWeakSolutionAt (f : X → ℂ) (a : X) (k : ℤ) : Prop := ∃ e : OpenPartialHomeomorph X ℂ, e ∈ IsManifold.maximalAtlas 𝓘(ℂ) ω X ∧ a ∈ e.source ∧ ∃ ψ : ℂ → ℂ, (∀ᶠ z in 𝓝 (e a), ψ z ≠ 0) ∧ ContDiffAt ℝ ∞ ψ (e a) ∧ diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms.lean b/LeanPool/JacobianDiffgeo/CanonicalForms.lean index 9fef7a8543..77ff99e359 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms.lean @@ -98,4 +98,4 @@ congruences; the raw files remain the foundation every proof works through via r the clean home, and `residue-theorem` now imports it from here). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/Differential.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/Differential.lean index d492a8dc71..a00dffa97b 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/Differential.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/Differential.lean @@ -44,7 +44,7 @@ Quotient layer (`MForm`, the honest 1-form type): pointwise engine). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold Filter Topology @@ -112,7 +112,7 @@ namespace MFormData open scoped Classical in /-- The holomorphic special case: a `Form1` gives an `MFormData` with the same chart coefficients (no poles). `compat` is exactly `coeffIn_trans` — no new work. -/ -noncomputable def ofForm1 (η : Form1 X) : MFormData X where +@[expose] noncomputable def ofForm1 (η : Form1 X) : MFormData X where coeffAt x z := if z ∈ (chartAt ℂ x).target then coeffIn (chartAt ℂ x) η z else 0 coeffAt_zero_off x z hz := ite_eq_right hz meromorphicOn_coeffAt x := by @@ -196,10 +196,13 @@ noncomputable def smul (h : ℳ X) (θ : MFormData X) : MFormData X where rw [θ.compat x y (chartAt ℂ y p) ⟨p, hp, rfl⟩, hsy, (chartAt ℂ x).left_inv hp.1] ring +theorem coeffAt_smul_meromorphic (h : ℳ X) (θ : MFormData X) (x : X) (z : ℂ) : + (smul h θ).coeffAt x z = h.holoRepr ((chartAt ℂ x).symm z) * θ.coeffAt x z := by rfl + instance : SMul (ℳ X) (MFormData X) := ⟨smul⟩ @[simp] theorem coeffAt_smul_mero (h : ℳ X) (θ : MFormData X) (x : X) (z : ℂ) : - (h • θ).coeffAt x z = h.holoRepr ((chartAt ℂ x).symm z) * θ.coeffAt x z := rfl + (h • θ).coeffAt x z = h.holoRepr ((chartAt ℂ x).symm z) * θ.coeffAt x z := by rfl /-! ### `MFormData.d`: the differential of a meromorphic function (D7, P1) -/ @@ -322,7 +325,7 @@ theorem Mero.ord_eq_meromorphicOrderAt_holoRepr (f : ℳ X) (x : X) : namespace MForm /-- D7: the holomorphic embedding, on classes. -/ -noncomputable def ofForm1 (η : Form1 X) : MForm X := mk (MFormData.ofForm1 η) +@[expose] noncomputable def ofForm1 (η : Form1 X) : MForm X := mk (MFormData.ofForm1 η) theorem ofForm1_ord_nonneg (η : Form1 X) (x : X) : 0 ≤ (ofForm1 η).ord x := MFormData.ofForm1_ord_nonneg η x @@ -450,6 +453,8 @@ theorem ord_smul_mero (h : ℳ X) (Θ : MForm X) (x : X) : `Classical.choice`-free function `ℳ X → MForm X` via `holoRepr`). -/ noncomputable def d (f : ℳ X) : MForm X := mk (MFormData.d f) +theorem d_eq_mk (f : ℳ X) : d f = mk (MFormData.d f) := by rfl + theorem d_const (c : ℂ) : d (algebraMap ℂ (ℳ X) c) = 0 := congrArg mk (MFormData.d_const c) diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/Existence.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/Existence.lean index 8080f170e3..5647230f99 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/Existence.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/Existence.lean @@ -56,7 +56,7 @@ plan flagged as "the ONLY file gated on finiteness-and-chi" can finally be writt instantiated at all; D9 supplies it). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold Filter Topology @@ -120,7 +120,9 @@ theorem MForm.d_ne_zero [T2Space X] [ConnectedSpace X] {f : ℳ X} rw [hd0] exact MForm.ord_zero x₁ have h2 : (MForm.d f).ord x₁ - = meromorphicOrderAt ((MFormData.d f).coeffAt x₁) (chartAt ℂ x₁ x₁) := rfl + = meromorphicOrderAt ((MFormData.d f).coeffAt x₁) (chartAt ℂ x₁ x₁) := by + rw [MForm.d_eq_mk, MForm.ord_mk] + rfl rw [h2] at h1 have h3 : (MFormData.d f).coeffAt x₁ =ᶠ[𝓝[≠] (chartAt ℂ x₁ x₁)] deriv (f.holoRepr ∘ ⇑(chartAt ℂ x₁).symm) := by @@ -128,9 +130,7 @@ theorem MForm.d_ne_zero [T2Space X] [ConnectedSpace X] {f : ℳ X} eventually_nhdsWithin_of_eventually_nhds ((chartAt ℂ x₁).open_target.mem_nhds (mem_chart_target ℂ x₁)) filter_upwards [htarget] with z hz - change (if z ∈ (chartAt ℂ x₁).target then - deriv (f.holoRepr ∘ ⇑(chartAt ℂ x₁).symm) z else 0) = _ - rw [ite_eq_left hz] + exact MFormData.coeffAt_d f x₁ hz rw [meromorphicOrderAt_congr h3] at h1 exact h1 have hderiv0 : deriv (f.holoRepr ∘ ⇑(chartAt ℂ x₁).symm) diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/LinearSystems.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/LinearSystems.lean index 6a2263176c..883b31d369 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/LinearSystems.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/LinearSystems.lean @@ -41,7 +41,7 @@ Unit: canonical-forms (`docs/design/canonical-forms.md` §2 D11–D13, §4.5, pr `Realizes.resAt_eq`: a thin `X`-level wrapper around residue-calculus's `PrincipalPartData`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold Filter Topology @@ -100,7 +100,7 @@ theorem mem_omegaSpace_iff {D : Divisor X} {Θ : MForm X} : Θ ∈ OmegaSpace D ↔ ∀ x, ((-(D x) : ℤ) : WithTop ℤ) ≤ Θ.ord x := Iff.rfl /-- Index of speciality: `dim Ω(D)`. -/ -noncomputable def i (D : Divisor X) : ℕ := Module.finrank ℂ (OmegaSpace D) +@[expose] noncomputable def i (D : Divisor X) : ℕ := Module.finrank ℂ (OmegaSpace D) end MForm diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/MForm.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/MForm.lean index 8876999110..2ad423d9c4 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/MForm.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/MForm.lean @@ -44,7 +44,7 @@ Main declarations: in `Differential.lean`), offered for future covering-family constructions (e.g. laurent-tails). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/OneDimensional.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/OneDimensional.lean index df1077645f..9760cd5bed 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/OneDimensional.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/OneDimensional.lean @@ -38,7 +38,7 @@ Hypothesis note: D8 needs only `[T1Space X] [ConnectedSpace X]` (the design list `[T2Space X]`, which is not required — the dichotomy and `Mero.ord_ne_top` are `T1`-level). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold Filter Topology @@ -183,7 +183,7 @@ theorem exists_smul_eq {Θ₀ : MForm X} (h₀ : Θ₀ ≠ 0) (Θ : MForm X) : ((chartAt ℂ x).open_target.mem_nhds (mem_chart_target ℂ x)) filter_upwards [hnz, hq, htarget] with z h1 h2 h3 simp only [Function.comp_apply] at h2 - change θ.coeffAt x z = h.holoRepr ((chartAt ℂ x).symm z) * θ₀.coeffAt x z + rw [MFormData.coeffAt_smul_meromorphic] rw [h2] have hqz : q x ((chartAt ℂ x).symm z) = θ.coeffAt x z / θ₀.coeffAt x z := by change θ.coeffAt x (chartAt ℂ x ((chartAt ℂ x).symm z)) / diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/OrdRes.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/OrdRes.lean index 880e55ec2f..b50dc61da7 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/OrdRes.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/OrdRes.lean @@ -33,7 +33,7 @@ order, `MeroGermOn.divisorOn`'s proof exactly. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold Filter Topology @@ -47,11 +47,11 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( namespace MFormData /-- D4: the order of `θ` at `x`, read via the (fixed) preferred chart at `x`. -/ -noncomputable def ord (θ : MFormData X) (x : X) : WithTop ℤ := +@[expose] noncomputable def ord (θ : MFormData X) (x : X) : WithTop ℤ := meromorphicOrderAt (θ.coeffAt x) (chartAt ℂ x x) /-- D4: the residue of `θ` at `x`, read via the (fixed) preferred chart at `x`. -/ -noncomputable def resAt (θ : MFormData X) (x : X) : ℂ := +@[expose] noncomputable def resAt (θ : MFormData X) (x : X) : ℂ := RS.resAt (θ.coeffAt x) (chartAt ℂ x x) theorem meromorphicAt_coeffAt (θ : MFormData X) (x : X) : @@ -259,7 +259,7 @@ noncomputable def divisor [T1Space X] (θ : MFormData X) : Divisor X exact Set.Finite.subset (Set.finite_singleton z) hsub @[simp] theorem divisor_apply [T1Space X] (θ : MFormData X) (x : X) : - θ.divisor x = (θ.ord x).untop₀ := rfl + θ.divisor x = (θ.ord x).untop₀ := by rfl /-- D6: the degree of `θ`'s divisor. -/ noncomputable def degree [T1Space X] [T2Space X] [CompactSpace X] (θ : MFormData X) : ℤ := diff --git a/LeanPool/JacobianDiffgeo/CanonicalForms/Quotient.lean b/LeanPool/JacobianDiffgeo/CanonicalForms/Quotient.lean index c58ed1f91b..1cf18da0c1 100644 --- a/LeanPool/JacobianDiffgeo/CanonicalForms/Quotient.lean +++ b/LeanPool/JacobianDiffgeo/CanonicalForms/Quotient.lean @@ -34,7 +34,7 @@ meromorphic functions by codiscrete agreement (`Jacobian/Meromorphic/GermSpace.l `MForm.ord_ne_top`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold Filter Topology @@ -50,7 +50,7 @@ namespace MFormData /-- Codiscrete/germ agreement of raw chart-coefficient families: the preferred-chart coefficients agree on a punctured neighborhood of every chart center (CC3 pattern; see the module docstring for why this is the right granularity). -/ -def Eqv (θ η : MFormData X) : Prop := +@[expose] def Eqv (θ η : MFormData X) : Prop := ∀ x : X, θ.coeffAt x =ᶠ[𝓝[≠] (chartAt ℂ x x)] η.coeffAt x theorem eqv_refl (θ : MFormData X) : Eqv θ θ := fun _ => Filter.EventuallyEq.rfl @@ -68,12 +68,12 @@ end MFormData variable (X) in /-- D1 (revised): a meromorphic 1-form on `X` — the quotient of raw chart-coefficient families (`MFormData X`) by codiscrete/germ agreement, the same CC3 quotient pattern as `ℳ X`. -/ -def MForm : Type _ := Quotient (MFormData.instSetoid (X := X)) +@[expose] def MForm : Type _ := Quotient (MFormData.instSetoid (X := X)) namespace MForm /-- The class of a raw chart-coefficient family. -/ -def mk (θ : MFormData X) : MForm X := Quotient.mk MFormData.instSetoid θ +@[expose] def mk (θ : MFormData X) : MForm X := Quotient.mk MFormData.instSetoid θ theorem exists_rep (Θ : MForm X) : ∃ θ : MFormData X, mk θ = Θ := Quotient.exists_rep Θ @@ -116,13 +116,13 @@ instance : SMul ℂ (MForm X) := @[simp] theorem mk_zero : (mk (0 : MFormData X)) = (0 : MForm X) := rfl -@[simp] theorem mk_add (θ η : MFormData X) : mk θ + mk η = mk (θ + η) := rfl +@[simp] theorem mk_add (θ η : MFormData X) : mk θ + mk η = mk (θ + η) := by rfl -@[simp] theorem mk_neg (θ : MFormData X) : -mk θ = mk (-θ) := rfl +@[simp] theorem mk_neg (θ : MFormData X) : -mk θ = mk (-θ) := by rfl -@[simp] theorem mk_sub (θ η : MFormData X) : mk θ - mk η = mk (θ - η) := rfl +@[simp] theorem mk_sub (θ η : MFormData X) : mk θ - mk η = mk (θ - η) := by rfl -@[simp] theorem mk_smul (c : ℂ) (θ : MFormData X) : c • mk θ = mk (c • θ) := rfl +@[simp] theorem mk_smul (c : ℂ) (θ : MFormData X) : c • mk θ = mk (c • θ) := by rfl instance : AddCommGroup (MForm X) where add_assoc a b c := Quotient.inductionOn₃ a b c fun θ η ζ => congrArg mk (add_assoc θ η ζ) @@ -151,16 +151,16 @@ noncomputable def ofCoeffs {ι : Type*} (D : MFormCoeffData X ι) : MForm X := /-- D4: the order of a meromorphic 1-form at `x` (read via the preferred chart at `x`; descends because `meromorphicOrderAt` is a germ functional). -/ -noncomputable def ord (Θ : MForm X) (x : X) : WithTop ℤ := +@[expose] noncomputable def ord (Θ : MForm X) (x : X) : WithTop ℤ := Quotient.liftOn Θ (fun θ => θ.ord x) fun _ _ h => meromorphicOrderAt_congr (h x) -@[simp] theorem ord_mk (θ : MFormData X) (x : X) : (mk θ).ord x = θ.ord x := rfl +@[simp] theorem ord_mk (θ : MFormData X) (x : X) : (mk θ).ord x = θ.ord x := by rfl /-- D4: the residue of a meromorphic 1-form at `x`. -/ -noncomputable def resAt (Θ : MForm X) (x : X) : ℂ := +@[expose] noncomputable def resAt (Θ : MForm X) (x : X) : ℂ := Quotient.liftOn Θ (fun θ => θ.resAt x) fun _ _ h => resAt_congr (h x) -@[simp] theorem resAt_mk (θ : MFormData X) (x : X) : (mk θ).resAt x = θ.resAt x := rfl +@[simp] theorem resAt_mk (θ : MFormData X) (x : X) : (mk θ).resAt x = θ.resAt x := by rfl /-- The `k`-th Laurent coefficient of a meromorphic 1-form at `x`, read in the preferred chart (consumed by `MLFormData.Realizes`, D13). -/ @@ -169,7 +169,7 @@ noncomputable def laurentCoeffAt (Θ : MForm X) (x : X) (k : ℤ) : ℂ := fun _ _ h => laurentCoeffAt_congr (h x) k @[simp] theorem laurentCoeffAt_mk (θ : MFormData X) (x : X) (k : ℤ) : - (mk θ).laurentCoeffAt x k = RS.laurentCoeffAt (θ.coeffAt x) (chartAt ℂ x x) k := rfl + (mk θ).laurentCoeffAt x k = RS.laurentCoeffAt (θ.coeffAt x) (chartAt ℂ x x) k := by rfl theorem resAt_eq_laurentCoeffAt (Θ : MForm X) (x : X) : Θ.resAt x = Θ.laurentCoeffAt x (-1) := by @@ -197,17 +197,17 @@ theorem eventually_ord_eq_zero {Θ : MForm X} {x : X} (h : Θ.ord x ≠ ⊤) : noncomputable def divisor [T1Space X] (Θ : MForm X) : Divisor X := Quotient.liftOn Θ MFormData.divisor fun θ η h => Function.locallyFinsuppWithin.ext fun y => by - change (θ.ord y).untop₀ = (η.ord y).untop₀ + rw [MFormData.divisor_apply, MFormData.divisor_apply] have hord : θ.ord y = η.ord y := meromorphicOrderAt_congr (h y) rw [hord] @[simp] theorem divisor_mk [T1Space X] (θ : MFormData X) : - (mk θ).divisor = θ.divisor := rfl + (mk θ).divisor = θ.divisor := by rfl @[simp] theorem divisor_apply [T1Space X] (Θ : MForm X) (x : X) : Θ.divisor x = (Θ.ord x).untop₀ := by obtain ⟨θ, rfl⟩ := exists_rep Θ - rfl + rw [divisor_mk, ord_mk, MFormData.divisor_apply] /-- D6: the degree of the divisor. -/ noncomputable def degree [T1Space X] [T2Space X] [CompactSpace X] (Θ : MForm X) : ℤ := diff --git a/LeanPool/JacobianDiffgeo/Cech.lean b/LeanPool/JacobianDiffgeo/Cech.lean index 00f734331b..4e2f0e9e6c 100644 --- a/LeanPool/JacobianDiffgeo/Cech.lean +++ b/LeanPool/JacobianDiffgeo/Cech.lean @@ -62,4 +62,4 @@ dimension counts, and the full six-term fragment, all previously deferred) is pr sorries. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Cech/Cochains.lean b/LeanPool/JacobianDiffgeo/Cech/Cochains.lean index 4612a7a5ec..5e1052b67b 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Cochains.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Cochains.lean @@ -23,7 +23,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.2). * `Z1`/`B1`/`H1Cover` — the cover-level Čech `H¹(𝒰,D)`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -35,7 +35,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( /-! ### `LinSysOn.restrictL` -/ /-- Restriction as a `ℂ`-linear map of relative linear systems (wrapper on mero's `restrict`). -/ -noncomputable def LinSysOn.restrictL {V U : Opens X} (D : RS.Divisor X) (h : V ≤ U) : +@[expose] noncomputable def LinSysOn.restrictL {V U : Opens X} (D : RS.Divisor X) (h : V ≤ U) : RS.LinSysOn D (U : Set X) →ₗ[ℂ] RS.LinSysOn D (V : Set X) := LinearMap.restrict (RS.MeroGermOn.restrict h).toLinearMap (fun _φ hφ => RS.restrict_mem_linSysOn h V.2 U.2 hφ) @@ -44,7 +44,7 @@ omit [IsManifold 𝓘(ℂ, ℂ) ω X] in @[simp] theorem restrictL_apply_coe {V U : Opens X} (D : RS.Divisor X) (h : V ≤ U) (φ : RS.LinSysOn D (U : Set X)) : (LinSysOn.restrictL D h φ : RS.MeroGermOn X (V : Set X)) = - RS.MeroGermOn.restrict h (φ : RS.MeroGermOn X (U : Set X)) := rfl + RS.MeroGermOn.restrict h (φ : RS.MeroGermOn X (U : Set X)) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem restrictL_restrictL {W V U : Opens X} (D : RS.Divisor X) (h1 : V ≤ U) (h2 : W ≤ V) @@ -74,7 +74,7 @@ namespace MeroGermOn /-- Transport along a propositional set equality (D6): built from `restrict` both ways using the presheaf laws. Used to move gluing targets `⋃ i, ↑(U i)` against `↑Ω`. -/ -noncomputable def congrSet {U V : Set X} (h : U = V) : +@[expose] noncomputable def congrSet {U V : Set X} (h : U = V) : RS.MeroGermOn X U ≃ₗ[ℂ] RS.MeroGermOn X V := LinearEquiv.ofLinearMap (RS.MeroGermOn.restrict h.ge).toLinearMap (RS.MeroGermOn.restrict h.le).toLinearMap @@ -106,7 +106,7 @@ abbrev C2 : Type _ := ∀ t : Fin 𝒰.n × Fin 𝒰.n × Fin 𝒰.n, /-! ### The coboundary maps -/ /-- `(δ⁰f)_{ij} = f_j − f_i` (after restriction to `U i ⊓ U j`). -/ -noncomputable def d0 : C0 D 𝒰 →ₗ[ℂ] C1 D 𝒰 := +@[expose] noncomputable def d0 : C0 D 𝒰 →ₗ[ℂ] C1 D 𝒰 := LinearMap.pi fun p : Fin 𝒰.n × Fin 𝒰.n => (LinSysOn.restrictL D (inf_le_right : 𝒰.U p.1 ⊓ 𝒰.U p.2 ≤ 𝒰.U p.2)).comp (LinearMap.proj p.2) @@ -116,10 +116,10 @@ noncomputable def d0 : C0 D 𝒰 →ₗ[ℂ] C1 D 𝒰 := omit [IsManifold 𝓘(ℂ, ℂ) ω X] in @[simp] theorem d0_apply (f : C0 D 𝒰) (p : Fin 𝒰.n × Fin 𝒰.n) : d0 D 𝒰 f p = LinSysOn.restrictL D inf_le_right (f p.2) - - LinSysOn.restrictL D inf_le_left (f p.1) := rfl + LinSysOn.restrictL D inf_le_left (f p.1) := by rfl /-- `(δ¹f)_{ijk} = f_{jk} − f_{ik} + f_{ij}` (after restriction to `U i ⊓ U j ⊓ U k`). -/ -noncomputable def d1 : C1 D 𝒰 →ₗ[ℂ] C2 D 𝒰 := +@[expose] noncomputable def d1 : C1 D 𝒰 →ₗ[ℂ] C2 D 𝒰 := LinearMap.pi fun t : Fin 𝒰.n × Fin 𝒰.n × Fin 𝒰.n => (LinSysOn.restrictL D (le_inf (inf_le_left.trans inf_le_right) inf_le_right : @@ -140,7 +140,7 @@ omit [IsManifold 𝓘(ℂ, ℂ) ω X] in (f (t.2.1, t.2.2)) - LinSysOn.restrictL D (le_inf (inf_le_left.trans inf_le_left) inf_le_right) (f (t.1, t.2.2)) - + LinSysOn.restrictL D inf_le_left (f (t.1, t.2.1)) := rfl + + LinSysOn.restrictL D inf_le_left (f (t.1, t.2.1)) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem d1_comp_d0 : (d1 D 𝒰) ∘ₗ (d0 D 𝒰) = 0 := by @@ -168,7 +168,7 @@ theorem d1_comp_d0 : (d1 D 𝒰) ∘ₗ (d0 D 𝒰) = 0 := by noncomputable def Z1 : Submodule ℂ (C1 D 𝒰) := LinearMap.ker (d1 D 𝒰) /-- `1`-coboundaries. -/ -noncomputable def B1 : Submodule ℂ (C1 D 𝒰) := LinearMap.range (d0 D 𝒰) +@[expose] noncomputable def B1 : Submodule ℂ (C1 D 𝒰) := LinearMap.range (d0 D 𝒰) /-- Registered explicitly (rather than left to ad-hoc re-derivation at `H1Cover`'s `⧸`): the newer toolchain's `synthInstance` no longer reliably re-discharges the *dependent* Pi-instance @@ -193,7 +193,7 @@ theorem mem_Z1_iff (f : C1 D 𝒰) : f ∈ Z1 D 𝒰 ↔ ∀ t, d1 D 𝒰 f t = noncomputable abbrev H1Cover : Type _ := Z1 D 𝒰 ⧸ (B1 D 𝒰).comap (Z1 D 𝒰).subtype /-- The quotient map onto `H¹(𝒰,D)`. -/ -noncomputable def H1Cover.mk : Z1 D 𝒰 →ₗ[ℂ] H1Cover D 𝒰 := Submodule.mkQ _ +@[expose] noncomputable def H1Cover.mk : Z1 D 𝒰 →ₗ[ℂ] H1Cover D 𝒰 := Submodule.mkQ _ omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem H1Cover.mk_surjective : Function.Surjective (H1Cover.mk D 𝒰) := Submodule.mkQ_surjective _ diff --git a/LeanPool/JacobianDiffgeo/Cech/Colimit.lean b/LeanPool/JacobianDiffgeo/Cech/Colimit.lean index b49d6fa731..f1d68acd70 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Colimit.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Colimit.lean @@ -29,7 +29,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.5, §5). cofinality) does not need 12.4 and is proved here. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech Module @@ -76,7 +76,7 @@ noncomputable abbrev H1 (D : RS.Divisor X) : Type _ := Module.DirectLimit (fun 𝒰 : FinCover (⊤ : Opens X) => H1Cover D 𝒰) (fun _ _ h => resH1' D h) /-- The canonical map from a cover-level `H¹` to the colimit. -/ -noncomputable def toH1 (𝒰 : FinCover (⊤ : Opens X)) : H1Cover D 𝒰 →ₗ[ℂ] H1 D := +@[expose] noncomputable def toH1 (𝒰 : FinCover (⊤ : Opens X)) : H1Cover D 𝒰 →ₗ[ℂ] H1 D := Module.DirectLimit.of ℂ (FinCover (⊤ : Opens X)) (fun 𝒰 => H1Cover D 𝒰) (fun _ _ h => resH1' D h) 𝒰 @@ -197,21 +197,23 @@ theorem inclusion_restrictL_comm {V U : Opens X} (h' : V ≤ U) (hD : D ≤ D') Subtype.ext rfl /-- `D`-inclusion of `1`-cochains (`Submodule.inclusion`, componentwise). -/ +@[expose] noncomputable def inclC1 {Ω : Opens X} (𝒰 : FinCover Ω) (h : D ≤ D') : C1 D 𝒰 →ₗ[ℂ] C1 D' 𝒰 := LinearMap.pi fun p => (Submodule.inclusion (RS.Cech.linSysOn_mono h)).comp (LinearMap.proj p) omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem inclC1_apply {Ω : Opens X} {𝒰 : FinCover Ω} (h : D ≤ D') (f : C1 D 𝒰) (p : Fin 𝒰.n × Fin 𝒰.n) : - inclC1 D 𝒰 h f p = Submodule.inclusion (RS.Cech.linSysOn_mono h) (f p) := rfl + inclC1 D 𝒰 h f p = Submodule.inclusion (RS.Cech.linSysOn_mono h) (f p) := by rfl /-- `D`-inclusion of `0`-cochains. -/ +@[expose] noncomputable def inclC0 {Ω : Opens X} (𝒰 : FinCover Ω) (h : D ≤ D') : C0 D 𝒰 →ₗ[ℂ] C0 D' 𝒰 := LinearMap.pi fun i => (Submodule.inclusion (RS.Cech.linSysOn_mono h)).comp (LinearMap.proj i) omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem inclC0_apply {Ω : Opens X} {𝒰 : FinCover Ω} (h : D ≤ D') (f : C0 D 𝒰) (i : Fin 𝒰.n) : - inclC0 D 𝒰 h f i = Submodule.inclusion (RS.Cech.linSysOn_mono h) (f i) := rfl + inclC0 D 𝒰 h f i = Submodule.inclusion (RS.Cech.linSysOn_mono h) (f i) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem inclC1_mem_Z1 {Ω : Opens X} {𝒰 : FinCover Ω} (h : D ≤ D') {f : C1 D 𝒰} @@ -224,7 +226,7 @@ theorem inclC1_mem_Z1 {Ω : Opens X} {𝒰 : FinCover Ω} (h : D ≤ D') {f : C1 ← map_sub, ← map_add, ← d1_apply, (mem_Z1_iff D 𝒰 f).1 hf (i, j, k), map_zero] /-- `D`-inclusion on cover-level `H¹`. -/ -noncomputable def h1CoverIncl {Ω : Opens X} (𝒰 : FinCover Ω) (h : D ≤ D') : +@[expose] noncomputable def h1CoverIncl {Ω : Opens X} (𝒰 : FinCover Ω) (h : D ≤ D') : H1Cover D 𝒰 →ₗ[ℂ] H1Cover D' 𝒰 := Submodule.mapQ _ _ (LinearMap.restrict (inclC1 D 𝒰 h) (fun _ hf => inclC1_mem_Z1 D h hf)) (fun z hz => by diff --git a/LeanPool/JacobianDiffgeo/Cech/Covers.lean b/LeanPool/JacobianDiffgeo/Cech/Covers.lean index df284dbb45..85140ef899 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Covers.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Covers.lean @@ -22,7 +22,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.1, D2–D4, proof pl * `FinCover.IsAdapted`: adapted covers (Miranda IX Ex. 3.6), `exists_adapted_refinement`. -/ -@[expose] public section +public section open Set Filter Topology TopologicalSpace @@ -54,6 +54,7 @@ instance : Nonempty (FinCover Ω) := ⟨FinCover.single Ω⟩ /-- `τ` is a valid refinement index from `𝒰` to `𝒱`: each member of `𝒱` sits inside the `τ`-indexed member of `𝒰` (D3). -/ +@[expose] def IsRefIdx (𝒰 𝒱 : FinCover Ω) (τ : Fin 𝒱.n → Fin 𝒰.n) : Prop := ∀ k, 𝒱.U k ≤ 𝒰.U (τ k) instance : Preorder (FinCover Ω) where @@ -98,12 +99,12 @@ noncomputable instance : DecidableEq (FinCover Ω) := Classical.decEq _ variable [ChartedSpace ℂ X] /-- `V` is a chart disk: some chart maps it bijectively onto a round ball (D4). -/ -def IsChartDisk (V : Opens X) : Prop := +@[expose] def IsChartDisk (V : Opens X) : Prop := ∃ (x : X) (r : ℝ), 0 < r ∧ x ∈ V ∧ (V : Set X) ⊆ (chartAt ℂ x).source ∧ chartAt ℂ x '' V = Metric.ball (chartAt ℂ x x) r /-- A cover all of whose members are chart disks. -/ -def FinCover.IsGood (𝒰 : FinCover Ω) : Prop := ∀ i, IsChartDisk (𝒰.U i) +@[expose] def FinCover.IsGood (𝒰 : FinCover Ω) : Prop := ∀ i, IsChartDisk (𝒰.U i) /-- Every neighbourhood of a point contains a chart-disk neighbourhood of it (§6.3). -/ theorem exists_chartDisk_basis {x : X} {W : Set X} (hW : W ∈ 𝓝 x) : @@ -233,7 +234,7 @@ theorem exists_good_refinement_closure [CompactSpace X] [T2Space X] /-! ### Adapted covers (Miranda IX Ex. 3.6) -/ /-- `𝒰` is adapted to the finite set `S`: each point of `S` lies in exactly one member. -/ -def FinCover.IsAdapted (𝒰 : FinCover Ω) (S : Finset X) : Prop := ∀ p ∈ S, ∃! i, p ∈ 𝒰.U i +@[expose] def FinCover.IsAdapted (𝒰 : FinCover Ω) (S : Finset X) : Prop := ∀ p ∈ S, ∃! i, p ∈ 𝒰.U i /-- The open complement of a finite set (`[T1Space X]`). -/ def compOpens [T1Space X] (T : Finset X) : Opens X := ⟨(T : Set X)ᶜ, T.isClosed.isOpen_compl⟩ diff --git a/LeanPool/JacobianDiffgeo/Cech/H0.lean b/LeanPool/JacobianDiffgeo/Cech/H0.lean index 1e7bdf8ecc..b1b76cd3c7 100644 --- a/LeanPool/JacobianDiffgeo/Cech/H0.lean +++ b/LeanPool/JacobianDiffgeo/Cech/H0.lean @@ -20,7 +20,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.3). * `h0Equiv`: the global form `H⁰(𝒰,D) ≃ L(D)` for covers of `X`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -31,12 +31,12 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( variable (D : RS.Divisor X) {Ω : Opens X} (𝒰 : FinCover Ω) /-- Restriction of a relative section to the cover. -/ -noncomputable def toC0 : RS.LinSysOn D (Ω : Set X) →ₗ[ℂ] C0 D 𝒰 := +@[expose] noncomputable def toC0 : RS.LinSysOn D (Ω : Set X) →ₗ[ℂ] C0 D 𝒰 := LinearMap.pi fun i => LinSysOn.restrictL D (𝒰.le_base i) omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem toC0_apply (φ : RS.LinSysOn D (Ω : Set X)) (i : Fin 𝒰.n) : - toC0 D 𝒰 φ i = LinSysOn.restrictL D (𝒰.le_base i) φ := rfl + toC0 D 𝒰 φ i = LinSysOn.restrictL D (𝒰.le_base i) φ := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem toC0_mem_ker (φ : RS.LinSysOn D (Ω : Set X)) : @@ -50,7 +50,7 @@ theorem toC0_mem_ker (φ : RS.LinSysOn D (Ω : Set X)) : exact sub_self _ /-- `toC0`, corestricted to land in `ker d0`. -/ -noncomputable def toC0' : RS.LinSysOn D (Ω : Set X) →ₗ[ℂ] LinearMap.ker (d0 D 𝒰) := +@[expose] noncomputable def toC0' : RS.LinSysOn D (Ω : Set X) →ₗ[ℂ] LinearMap.ker (d0 D 𝒰) := LinearMap.codRestrict _ (toC0 D 𝒰) (toC0_mem_ker D 𝒰) omit [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ, ℂ) ω X] in diff --git a/LeanPool/JacobianDiffgeo/Cech/Injectivity.lean b/LeanPool/JacobianDiffgeo/Cech/Injectivity.lean index de67efae1a..18a17e4e30 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Injectivity.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Injectivity.lean @@ -22,7 +22,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.4, §6.7). * `subsingleton_H1_iff`: the colimit vanishes iff every cover-level `H¹` vanishes. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -229,6 +229,7 @@ theorem resH1_injective : Function.Injective (resH1 D τ hτ) := by theorem toH1_injective (𝒰 : FinCover (⊤ : Opens X)) : Function.Injective (toH1 D 𝒰) := by intro c c' hc obtain ⟨𝒱, hij, hz⟩ := Module.DirectLimit.exists_eq_of_of_eq hc + rw [resH1'_eq_resH1 D hij (chosenRefIdx hij) (chosenRefIdx_spec hij)] at hz exact resH1_injective D (chosenRefIdx hij) (chosenRefIdx_spec hij) hz @[simp] theorem toH1_eq_zero_iff {𝒰 : FinCover (⊤ : Opens X)} (c : H1Cover D 𝒰) : diff --git a/LeanPool/JacobianDiffgeo/Cech/Refinement.lean b/LeanPool/JacobianDiffgeo/Cech/Refinement.lean index 113811318f..fbdef768af 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Refinement.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Refinement.lean @@ -25,7 +25,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.4, proof plans §6.4 (sheaf-axiom gluing argument via `injPatch`/`exists_injGlue`, no analysis). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -38,14 +38,16 @@ variable (D : RS.Divisor X) {Ω : Opens X} {𝒰 𝒱 : FinCover Ω} /-! ### Restriction along a refinement index -/ /-- Restriction of `0`-cochains along a refinement index `τ`. -/ +@[expose] noncomputable def resC0 (τ : Fin 𝒱.n → Fin 𝒰.n) (hτ : IsRefIdx 𝒰 𝒱 τ) : C0 D 𝒰 →ₗ[ℂ] C0 D 𝒱 := LinearMap.pi fun k => (LinSysOn.restrictL D (hτ k)).comp (LinearMap.proj (τ k)) omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem resC0_apply (τ : Fin 𝒱.n → Fin 𝒰.n) (hτ : IsRefIdx 𝒰 𝒱 τ) (f : C0 D 𝒰) (k : Fin 𝒱.n) : - resC0 D τ hτ f k = LinSysOn.restrictL D (hτ k) (f (τ k)) := rfl + resC0 D τ hτ f k = LinSysOn.restrictL D (hτ k) (f (τ k)) := by rfl /-- Restriction of `1`-cochains along a refinement index `τ`. -/ +@[expose] noncomputable def resC1 (τ : Fin 𝒱.n → Fin 𝒰.n) (hτ : IsRefIdx 𝒰 𝒱 τ) : C1 D 𝒰 →ₗ[ℂ] C1 D 𝒱 := LinearMap.pi fun p : Fin 𝒱.n × Fin 𝒱.n => (LinSysOn.restrictL D (inf_le_inf (hτ p.1) (hτ p.2))).comp (LinearMap.proj (τ p.1, τ p.2)) @@ -53,7 +55,7 @@ noncomputable def resC1 (τ : Fin 𝒱.n → Fin 𝒰.n) (hτ : IsRefIdx 𝒰 omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem resC1_apply (τ : Fin 𝒱.n → Fin 𝒰.n) (hτ : IsRefIdx 𝒰 𝒱 τ) (f : C1 D 𝒰) (p : Fin 𝒱.n × Fin 𝒱.n) : - resC1 D τ hτ f p = LinSysOn.restrictL D (inf_le_inf (hτ p.1) (hτ p.2)) (f (τ p.1, τ p.2)) := + resC1 D τ hτ f p = LinSysOn.restrictL D (inf_le_inf (hτ p.1) (hτ p.2)) (f (τ p.1, τ p.2)) := by rfl variable (τ : Fin 𝒱.n → Fin 𝒰.n) (hτ : IsRefIdx 𝒰 𝒱 τ) @@ -111,15 +113,15 @@ theorem resC1_mem_Z1 {f : C1 D 𝒰} (hf : f ∈ Z1 D 𝒰) : resC1 D τ hτ f /-! ### `resZ1`, `resH1` -/ /-- The induced map on `1`-cocycles. -/ -noncomputable def resZ1 : Z1 D 𝒰 →ₗ[ℂ] Z1 D 𝒱 := +@[expose] noncomputable def resZ1 : Z1 D 𝒰 →ₗ[ℂ] Z1 D 𝒱 := LinearMap.restrict (resC1 D τ hτ) (fun _ hf => resC1_mem_Z1 D τ hτ hf) omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem resZ1_apply_coe (f : Z1 D 𝒰) : - (resZ1 D τ hτ f : C1 D 𝒱) = resC1 D τ hτ (f : C1 D 𝒰) := rfl + (resZ1 D τ hτ f : C1 D 𝒱) = resC1 D τ hτ (f : C1 D 𝒰) := by rfl /-- The induced map on cover-level `H¹`. -/ -noncomputable def resH1 : H1Cover D 𝒰 →ₗ[ℂ] H1Cover D 𝒱 := +@[expose] noncomputable def resH1 : H1Cover D 𝒰 →ₗ[ℂ] H1Cover D 𝒱 := Submodule.mapQ _ _ (resZ1 D τ hτ) (fun z hz => by simp only [Submodule.mem_comap] at hz ⊢ exact resC1_mem_B1 D τ hτ hz) diff --git a/LeanPool/JacobianDiffgeo/Cech/SixTerm.lean b/LeanPool/JacobianDiffgeo/Cech/SixTerm.lean index c48115f0f6..292338a8fd 100644 --- a/LeanPool/JacobianDiffgeo/Cech/SixTerm.lean +++ b/LeanPool/JacobianDiffgeo/Cech/SixTerm.lean @@ -45,7 +45,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.7, §6.9). `0 → L(D) → L(D') → Window D D' → H¹(D) → H¹(D') → 0`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter TopologicalSpace RS.Cech diff --git a/LeanPool/JacobianDiffgeo/Cech/Skyscraper.lean b/LeanPool/JacobianDiffgeo/Cech/Skyscraper.lean index 16ea4eeafb..a975344856 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Skyscraper.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Skyscraper.lean @@ -32,7 +32,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.7). is proved in `SixTerm.lean`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -46,18 +46,18 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( variable {Ω : Opens X} {𝒰 : FinCover Ω} {D D' : RS.Divisor X} /-- A `C¹(D')`-cochain all of whose components satisfy the `D`-bound. -/ -def C1.MemLD (f : C1 D' 𝒰) (D : RS.Divisor X) : Prop := +@[expose] def C1.MemLD (f : C1 D' 𝒰) (D : RS.Divisor X) : Prop := ∀ p : Fin 𝒰.n × Fin 𝒰.n, (f p : RS.MeroGermOn X ((𝒰.U p.1 ⊓ 𝒰.U p.2 : Opens X) : Set X)) ∈ RS.LinSysOn D ((𝒰.U p.1 ⊓ 𝒰.U p.2 : Opens X) : Set X) /-- Re-tag a `D'`-cochain satisfying the `D`-bound as a `D`-cochain (same underlying germs). -/ -noncomputable def C1.retype (f : C1 D' 𝒰) (hf : f.MemLD D) : C1 D 𝒰 := +@[expose] noncomputable def C1.retype (f : C1 D' 𝒰) (hf : f.MemLD D) : C1 D 𝒰 := fun p => ⟨(f p : RS.MeroGermOn X _), hf p⟩ omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem C1.retype_apply_coe (f : C1 D' 𝒰) (hf : f.MemLD D) (p : Fin 𝒰.n × Fin 𝒰.n) : (C1.retype f hf p : RS.MeroGermOn X ((𝒰.U p.1 ⊓ 𝒰.U p.2 : Opens X) : Set X)) = - (f p : RS.MeroGermOn X _) := rfl + (f p : RS.MeroGermOn X _) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem C1.retype_mem_Z1 {g : C0 D' 𝒰} (hg : (d0 D' 𝒰 g).MemLD D) : @@ -73,7 +73,7 @@ variable {𝒰 : FinCover (⊤ : Opens X)} /-- The Mittag-Leffler atom (D7): a `D'`-`0`-cochain with `D`-bounded coboundary yields a class in `H¹(D)`. -/ -noncomputable def mlClass (𝒰 : FinCover (⊤ : Opens X)) (g : C0 D' 𝒰) +@[expose] noncomputable def mlClass (𝒰 : FinCover (⊤ : Opens X)) (g : C0 D' 𝒰) (hg : (d0 D' 𝒰 g).MemLD D) : H1 D := toH1 D 𝒰 (H1Cover.mk D 𝒰 ⟨C1.retype (d0 D' 𝒰 g) hg, C1.retype_mem_Z1 hg⟩) diff --git a/LeanPool/JacobianDiffgeo/Cech/Window.lean b/LeanPool/JacobianDiffgeo/Cech/Window.lean index 1e6c63f3dd..88094204a4 100644 --- a/LeanPool/JacobianDiffgeo/Cech/Window.lean +++ b/LeanPool/JacobianDiffgeo/Cech/Window.lean @@ -28,7 +28,7 @@ inputs) are exported from `WindowRank.lean` instead, via a one-step splitting needed); the *structural* exactness in this file does not depend on them. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set TopologicalSpace Filter @@ -40,6 +40,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( /-! ### `ordGe` -/ /-- Germs at the chart source of `p` with order `≥ m` at `p`. -/ +@[expose] noncomputable def ordGe (p : X) (m : ℤ) : Submodule ℂ (RS.MeroGermOn X ((chartAt ℂ p).source)) where carrier := {ψ | (m : WithTop ℤ) ≤ ψ.ord p} zero_mem' := by @@ -83,7 +84,7 @@ theorem meromorphicOnX_tailGerm (p : X) (m : ℤ) : rw [(chartAt ℂ p).right_inv hz] /-- The local tail germ `(z − z_p)^m` (junk off the chart source). -/ -noncomputable def tailGerm (p : X) (m : ℤ) : RS.MeroGermOn X ((chartAt ℂ p).source) := +@[expose] noncomputable def tailGerm (p : X) (m : ℤ) : RS.MeroGermOn X ((chartAt ℂ p).source) := RS.MeroGermOn.mk (fun y => (chartAt ℂ p y - chartAt ℂ p p) ^ m) (meromorphicOnX_tailGerm p m) theorem ord_tailGerm_self (p : X) (m : ℤ) : (tailGerm p m).ord p = (m : WithTop ℤ) := by @@ -101,7 +102,7 @@ theorem ord_tailGerm_self (p : X) (m : ℤ) : (tailGerm p m).ord p = (m : WithTo /-- The one-step leading-coefficient functional (D7): `ψ ↦ (θ_{p,−m}·ψ).evalAt p` on `ordGe p m`. -/ -noncomputable def leadCoeff (p : X) (m : ℤ) : ordGe p m →ₗ[ℂ] ℂ where +@[expose] noncomputable def leadCoeff (p : X) (m : ℤ) : ordGe p m →ₗ[ℂ] ℂ where toFun ψ := ((tailGerm p (-m)) * (ψ : RS.MeroGermOn X ((chartAt ℂ p).source))).evalAt p map_add' ψ ψ' := by have h1 : (0 : WithTop ℤ) ≤ (tailGerm p (-m) * (ψ : RS.MeroGermOn X _)).ord p := by @@ -143,7 +144,7 @@ noncomputable abbrev WindowAt (p : X) (d d' : ℤ) : Type _ := /-- The quotient map onto the window at `p`: a germ of order at least `-d'`, taken modulo those of order at least `-d`. -/ -noncomputable def WindowAt.mk (p : X) (d d' : ℤ) : ordGe p (-d') →ₗ[ℂ] WindowAt p d d' := +@[expose] noncomputable def WindowAt.mk (p : X) (d d' : ℤ) : ordGe p (-d') →ₗ[ℂ] WindowAt p d d' := Submodule.mkQ _ omit [IsManifold 𝓘(ℂ, ℂ) ω X] in @@ -191,7 +192,7 @@ omit [IsManifold 𝓘(ℂ, ℂ) ω X] [T2Space X] [CompactSpace X] in theorem restrictToChart_apply_coe (D' : RS.Divisor X) (q : X) (φ : RS.LinSys D') : (restrictToChart D' q φ : RS.MeroGermOn X ((chartAt ℂ q).source)) = RS.MeroGermOn.restrict (Set.subset_univ (chartAt ℂ q).source) - (φ : RS.MeroGermOn X (Set.univ : Set X)) := rfl + (φ : RS.MeroGermOn X (Set.univ : Set X)) := by rfl /-- Truncation `β : L(D') → Window D D'` — purely structural (D7). -/ noncomputable def windowMap {D D' : RS.Divisor X} (_h : D ≤ D') : @@ -201,7 +202,7 @@ noncomputable def windowMap {D D' : RS.Divisor X} (_h : D ≤ D') : omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem windowMap_apply {D D' : RS.Divisor X} (h : D ≤ D') (φ : RS.LinSys D') (q : diffSupp D D') : - windowMap h φ q = WindowAt.mk (q : X) (D q) (D' q) (restrictToChart D' q φ) := rfl + windowMap h φ q = WindowAt.mk (q : X) (D q) (D' q) (restrictToChart D' q φ) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem windowMap_eq_zero_iff {D D' : RS.Divisor X} (h : D ≤ D') (φ : RS.LinSys D') : diff --git a/LeanPool/JacobianDiffgeo/Cech/WindowRank.lean b/LeanPool/JacobianDiffgeo/Cech/WindowRank.lean index eeab469977..f3f48aeae4 100644 --- a/LeanPool/JacobianDiffgeo/Cech/WindowRank.lean +++ b/LeanPool/JacobianDiffgeo/Cech/WindowRank.lean @@ -25,7 +25,7 @@ Unit: cech-cohomology (`docs/design/cech-cohomology.md` §4.6, §6.8). `(d' - d).toNat` (no explicit basis/independence argument needed). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set TopologicalSpace RS.Cech Filter diff --git a/LeanPool/JacobianDiffgeo/CechCount.lean b/LeanPool/JacobianDiffgeo/CechCount.lean index 14acc8aef1..5f2c51d6a3 100644 --- a/LeanPool/JacobianDiffgeo/CechCount.lean +++ b/LeanPool/JacobianDiffgeo/CechCount.lean @@ -43,4 +43,4 @@ executed directly on the project's Čech colimit `RS.Cech.H1` (Hodge-free, duali **`Jacobian.ofCurve_inj`** (the challenge's `ofCurve_inj`, hypothesis-free). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/CechCount/Count.lean b/LeanPool/JacobianDiffgeo/CechCount/Count.lean index 415a6745d1..c441736a4d 100644 --- a/LeanPool/JacobianDiffgeo/CechCount/Count.lean +++ b/LeanPool/JacobianDiffgeo/CechCount/Count.lean @@ -39,7 +39,7 @@ hence injective — forcing `ξ = 0`. Contradiction; so `h⁰¹ ≤ g`. Exports: `RS.cechCount` (= `RS.finrank_H1_zero_le_genus`). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace diff --git a/LeanPool/JacobianDiffgeo/CechCount/Final.lean b/LeanPool/JacobianDiffgeo/CechCount/Final.lean index 28e3aa5f97..2d9f6a977a 100644 --- a/LeanPool/JacobianDiffgeo/CechCount/Final.lean +++ b/LeanPool/JacobianDiffgeo/CechCount/Final.lean @@ -41,7 +41,7 @@ gate of the project was reduced to. This file records the ungated finals: with no remaining hypotheses (the challenge's `ofCurve_inj`, ungated). -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/CechCount/Mul.lean b/LeanPool/JacobianDiffgeo/CechCount/Mul.lean index 53aca570df..733d243248 100644 --- a/LeanPool/JacobianDiffgeo/CechCount/Mul.lean +++ b/LeanPool/JacobianDiffgeo/CechCount/Mul.lean @@ -33,7 +33,7 @@ action level by level, mirroring `Colimit.lean`'s `H1Incl` construction verbatim epimorphism statement `mulH1_surjective`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech Module @@ -48,7 +48,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( /-- The pointwise order bound making multiplication by `f` carry `O_D`-cochains to `O_E`-cochains: `D x - E x ≤ ord_x f` for every `x` (in `WithTop ℤ`; for `f = 0` the order is `⊤` everywhere, so `MulBound 0 D E` always holds — multiplication by `0` is the zero map). -/ -def MulBound (f : ℳ X) (D E : RS.Divisor X) : Prop := +@[expose] def MulBound (f : ℳ X) (D E : RS.Divisor X) : Prop := ∀ x : X, ((D x - E x : ℤ) : WithTop ℤ) ≤ f.ord x omit [IsManifold 𝓘(ℂ, ℂ) ω X] in @@ -158,7 +158,7 @@ noncomputable def mulC0 (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) ( omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem mulC0_apply (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) {𝒰 : FinCover Ω} - (g : C0 D 𝒰) (i : Fin 𝒰.n) : mulC0 f hf 𝒰 g i = mulOn f hf (𝒰.U i) (g i) := rfl + (g : C0 D 𝒰) (i : Fin 𝒰.n) : mulC0 f hf 𝒰 g i = mulOn f hf (𝒰.U i) (g i) := by rfl /-- Multiplication by `f` on `1`-cochains (componentwise `mulOn`). -/ noncomputable def mulC1 (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) (𝒰 : FinCover Ω) : @@ -169,7 +169,7 @@ noncomputable def mulC1 (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) ( omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem mulC1_apply (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) {𝒰 : FinCover Ω} (c : C1 D 𝒰) (p : Fin 𝒰.n × Fin 𝒰.n) : - mulC1 f hf 𝒰 c p = mulOn f hf (𝒰.U p.1 ⊓ 𝒰.U p.2) (c p) := rfl + mulC1 f hf 𝒰 c p = mulOn f hf (𝒰.U p.1 ⊓ 𝒰.U p.2) (c p) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in /-- Multiplication commutes with the coboundary `d0`. -/ @@ -207,7 +207,7 @@ noncomputable def mulZ1 (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) ( omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem mulZ1_apply_coe (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) {𝒰 : FinCover Ω} - (c : Z1 D 𝒰) : (mulZ1 f hf 𝒰 c : C1 E 𝒰) = mulC1 f hf 𝒰 (c : C1 D 𝒰) := rfl + (c : Z1 D 𝒰) : (mulZ1 f hf 𝒰 c : C1 E 𝒰) = mulC1 f hf 𝒰 (c : C1 D 𝒰) := by rfl /-- Multiplication on cover-level `H¹`. -/ noncomputable def mulH1Cover (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) @@ -239,7 +239,9 @@ theorem mulH1Cover_resH1 (f : ℳ X) {D E : RS.Divisor X} (hf : MulBound f D E) obtain ⟨c, rfl⟩ := H1Cover.mk_surjective D 𝒰 ξ simp only [resH1_mk, mulH1Cover_mk] congr 1 - exact Subtype.ext (mulC1_resC1 f hf τ hτ (c : C1 D 𝒰)) + apply Subtype.ext + simpa only [mulZ1_apply_coe, resZ1_apply_coe] using + mulC1_resC1 f hf τ hτ (c : C1 D 𝒰) /-! ### The colimit map `mulH1` -/ diff --git a/LeanPool/JacobianDiffgeo/CechCount/Surjective.lean b/LeanPool/JacobianDiffgeo/CechCount/Surjective.lean index e3e47eeb09..f1321c7a05 100644 --- a/LeanPool/JacobianDiffgeo/CechCount/Surjective.lean +++ b/LeanPool/JacobianDiffgeo/CechCount/Surjective.lean @@ -25,7 +25,7 @@ primal form). Proof: factor through the intermediate divisor `D₁ := E + diviso * `mulH1 f hf` agrees with the composite (`mulH1_H1Incl`). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech Module @@ -44,9 +44,11 @@ theorem mulH1_surjective {f : ℳ X} (hf0 : f ≠ 0) {D E : RS.Divisor X} (hf : have hfinv0 : (f⁻¹ : ℳ X) ≠ 0 := inv_ne_zero hf0 -- the coe bookkeeping: `((divisor f x : ℤ) : WithTop ℤ) = f.ord x` for `f ≠ 0` have hcoe : ∀ x : X, ((RS.divisor f x : ℤ) : WithTop ℤ) = f.ord x := fun x => - WithTop.coe_untop₀_of_ne_top (RS.Mero.ord_ne_top hf0 x) + by simpa only [RS.divisor_apply] using + WithTop.coe_untop₀_of_ne_top (RS.Mero.ord_ne_top hf0 x) have hcoeinv : ∀ x : X, ((RS.divisor (f⁻¹) x : ℤ) : WithTop ℤ) = (f⁻¹ : ℳ X).ord x := fun x => - WithTop.coe_untop₀_of_ne_top (RS.Mero.ord_ne_top hfinv0 x) + by simpa only [RS.divisor_apply] using + WithTop.coe_untop₀_of_ne_top (RS.Mero.ord_ne_top hfinv0 x) -- the intermediate divisor set D₁ : RS.Divisor X := E + RS.divisor f with hD₁def have hD₁x : ∀ x, D₁ x = E x + RS.divisor f x := fun x => diff --git a/LeanPool/JacobianDiffgeo/Challenge.lean b/LeanPool/JacobianDiffgeo/Challenge.lean index 7ff9eea3bb..dc0f7e28dd 100644 --- a/LeanPool/JacobianDiffgeo/Challenge.lean +++ b/LeanPool/JacobianDiffgeo/Challenge.lean @@ -75,7 +75,7 @@ otherwise the gist's, and the (overwhelmingly common) same-universe uses — inc in `Type 0` — elaborate verbatim. -/ -@[expose] public section +public section open scoped ContDiff -- for ω notation diff --git a/LeanPool/JacobianDiffgeo/Dbar.lean b/LeanPool/JacobianDiffgeo/Dbar.lean index 439853d45e..b7f745db5b 100644 --- a/LeanPool/JacobianDiffgeo/Dbar.lean +++ b/LeanPool/JacobianDiffgeo/Dbar.lean @@ -36,4 +36,4 @@ API summary (see `docs/design/dbar-solvability.md`). Zero sorries throughout. included (see the file's docstring and the build log for the honest scope note). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Dbar/CauchyKernel.lean b/LeanPool/JacobianDiffgeo/Dbar/CauchyKernel.lean index 42b6eb2760..08fe4913aa 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/CauchyKernel.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/CauchyKernel.lean @@ -24,7 +24,7 @@ derivative package handles "differentiate under the integral", and the polar sub the kernel singularity cancel exactly. -/ -@[expose] public section +public section open MeasureTheory Metric Set Complex open scoped Convolution ContDiff @@ -36,7 +36,7 @@ namespace RS variable (g : ℂ → ℂ) /-- The Cauchy kernel `1/(π w)`. -/ -def cauchyKernel : ℂ → ℂ := fun w => (Real.pi * w)⁻¹ +@[expose] def cauchyKernel : ℂ → ℂ := fun w => (Real.pi * w)⁻¹ theorem measurable_cauchyKernel : Measurable cauchyKernel := (measurable_id.const_mul _).inv diff --git a/LeanPool/JacobianDiffgeo/Dbar/DiskAcyclic.lean b/LeanPool/JacobianDiffgeo/Dbar/DiskAcyclic.lean index d76b0b0b16..11321b8ad8 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/DiskAcyclic.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/DiskAcyclic.lean @@ -35,7 +35,7 @@ below is a complete, self-contained, fully admitted-free proof of disk acyclicit structure sheaf, which is the piece the design flags as needed with "no compactness". -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology TopologicalSpace diff --git a/LeanPool/JacobianDiffgeo/Dbar/Form01.lean b/LeanPool/JacobianDiffgeo/Dbar/Form01.lean index 8950967d3e..00aad27d12 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/Form01.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/Form01.lean @@ -30,7 +30,7 @@ reserved token in the ambient `ContDiff` scope's regularity level and cannot be ordinary identifier.) -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold @@ -292,7 +292,7 @@ noncomputable def Form01.ofCoeffs {ι : Type*} (Data : Form01CoeffData X ι) : F compat _ _ _ hz := Data.rawCoeffAt_trans _ _ hz @[simp] theorem Form01.coeffAt_ofCoeffs_apply {ι : Type*} (Data : Form01CoeffData X ι) (x : X) - (z : ℂ) : (Form01.ofCoeffs Data).coeffAt x z = Data.rawCoeffAt x z := rfl + (z : ℂ) : (Form01.ofCoeffs Data).coeffAt x z = Data.rawCoeffAt x z := by rfl /-- The preferred-chart coefficient of `Form01.ofCoeffs Data` at the chart center of a point of the `i`-th data chart's source, via the conjugated transition derivative — the shape diff --git a/LeanPool/JacobianDiffgeo/Dbar/Operator.lean b/LeanPool/JacobianDiffgeo/Dbar/Operator.lean index e4deac550b..e5e719067d 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/Operator.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/Operator.lean @@ -39,7 +39,7 @@ predicates (D7); `exists_dbar_solution_chart_ball` transports Forster 13.2 (`Sol through a chart. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold @@ -54,6 +54,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( omit [IsManifold 𝓘(ℂ, ℂ) ω X] in /-- Real-smooth `ℂ`-valued functions on `X`, as a private subtype (D6). -/ +@[expose] def SmoothC (X : Type*) [TopologicalSpace X] [ChartedSpace ℂ X] : Type _ := {f : X → ℂ // ContMDiff 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ) ∞ f} @@ -119,11 +120,11 @@ instance : SMul ℂ (SmoothC X) where (ContinuousLinearMap.mul ℝ ℂ c).contDiff.contDiffAt.comp _ (f.contDiffAt_comp_chartAt_symm_self x))⟩ -@[simp] theorem coe_add (f g : SmoothC X) (x : X) : (f + g) x = f x + g x := rfl -@[simp] theorem coe_neg (f : SmoothC X) (x : X) : (-f) x = -f x := rfl -@[simp] theorem coe_sub (f g : SmoothC X) (x : X) : (f - g) x = f x - g x := rfl -@[simp] theorem coe_zero (x : X) : (0 : SmoothC X) x = 0 := rfl -@[simp] theorem coe_smul (c : ℂ) (f : SmoothC X) (x : X) : (c • f) x = c * f x := rfl +@[simp] theorem coe_add (f g : SmoothC X) (x : X) : (f + g) x = f x + g x := by rfl +@[simp] theorem coe_neg (f : SmoothC X) (x : X) : (-f) x = -f x := by rfl +@[simp] theorem coe_sub (f g : SmoothC X) (x : X) : (f - g) x = f x - g x := by rfl +@[simp] theorem coe_zero (x : X) : (0 : SmoothC X) x = 0 := by rfl +@[simp] theorem coe_smul (c : ℂ) (f : SmoothC X) (x : X) : (c • f) x = c * f x := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem ext' {f g : SmoothC X} (h : ∀ x, f x = g x) : f = g := @@ -235,10 +236,12 @@ theorem coeffAt_dbar (f : SmoothC X) (x : X) {z : ℂ} (hz : z ∈ (chartAt ℂ /-! ### `IsDbarAt` / `IsDbarOn` (D7): chart-free local `dbar`-equations -/ /-- `u` solves `dbaru = η` at `x`, evaluated in `x`'s own preferred chart. -/ +@[expose] def IsDbarAt (u : X → ℂ) (η : Form01 X) (x : X) : Prop := wirtingerDbar (u ∘ ⇑(chartAt ℂ x).symm) (chartAt ℂ x x) = η.coeffAt x (chartAt ℂ x x) /-- `u` solves `dbaru = η` at every point of `s`. -/ +@[expose] def IsDbarOn (u : X → ℂ) (η : Form01 X) (s : Set X) : Prop := ∀ x ∈ s, IsDbarAt u η x theorem isDbarOn_dbar (f : SmoothC X) : IsDbarOn (⇑f) (dbar f) Set.univ := by diff --git a/LeanPool/JacobianDiffgeo/Dbar/PlanarCousin.lean b/LeanPool/JacobianDiffgeo/Dbar/PlanarCousin.lean index 0cb44d4119..7d9e5dff63 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/PlanarCousin.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/PlanarCousin.lean @@ -27,7 +27,7 @@ Cocycle convention matched to cech's `d0` (`(d0 h)_{ij} = h_j − h_i`) and `Z1. (`f_{jk} − f_{ik} + f_{ij} = 0`, i.e. `f i k = f i j + f j k`). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/JacobianDiffgeo/Dbar/PlanarPoU.lean b/LeanPool/JacobianDiffgeo/Dbar/PlanarPoU.lean index 452c947a94..6a42fd8f09 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/PlanarPoU.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/PlanarPoU.lean @@ -27,7 +27,7 @@ not the plain functions with prescribed exact `support` needed here) was confirm call by an upstream investigation of the manifold `PartitionOfUnity` API. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/JacobianDiffgeo/Dbar/SolveDisk.lean b/LeanPool/JacobianDiffgeo/Dbar/SolveDisk.lean index 4ff271ffb5..8421aab6c4 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/SolveDisk.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/SolveDisk.lean @@ -23,7 +23,7 @@ sum of the power series of the (holomorphic) difference `f_{n+1} - fₙ`, chosen that the corrected sequence converges locally uniformly to a solution on the whole disk. -/ -@[expose] public section +public section open MeasureTheory Metric Set Complex Filter Topology open scoped Convolution ContDiff NNReal diff --git a/LeanPool/JacobianDiffgeo/Dbar/Wirtinger.lean b/LeanPool/JacobianDiffgeo/Dbar/Wirtinger.lean index 117ab90f9f..e8c1d84151 100644 --- a/LeanPool/JacobianDiffgeo/Dbar/Wirtinger.lean +++ b/LeanPool/JacobianDiffgeo/Dbar/Wirtinger.lean @@ -28,7 +28,7 @@ project imports, no manifold variables, so downstream planar consumers (`planar- `hasCompactSupport_wirtingerDbar`. -/ -@[expose] public section +public section open scoped ContDiff @@ -45,7 +45,7 @@ def wirtingerD (f : ℂ → ℂ) (z : ℂ) : ℂ := /-- The Wirtinger `dbar` (anti-holomorphic) derivative, `(∂f/∂x + i ∂f/∂y)/2` in real coordinates. Junk `0` if `f` is not `ℝ`-differentiable at `z`. -/ -def wirtingerDbar (f : ℂ → ℂ) (z : ℂ) : ℂ := +@[expose] def wirtingerDbar (f : ℂ → ℂ) (z : ℂ) : ℂ := (fderiv ℝ f z 1 + Complex.I * fderiv ℝ f z Complex.I) / 2 /-! ### The Wirtinger decomposition of an `ℝ`-linear map -/ diff --git a/LeanPool/JacobianDiffgeo/DolbeaultComparison.lean b/LeanPool/JacobianDiffgeo/DolbeaultComparison.lean index 8f1c4064a3..aa172430e1 100644 --- a/LeanPool/JacobianDiffgeo/DolbeaultComparison.lean +++ b/LeanPool/JacobianDiffgeo/DolbeaultComparison.lean @@ -46,4 +46,4 @@ No Weyl lemma, no elliptic regularity, no harmonic theory anywhere: the only PDE consumed is dbar-solvability's `exists_dbar_solution_chart_ball`/disk acyclicity. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/DolbeaultComparison/Comparison.lean b/LeanPool/JacobianDiffgeo/DolbeaultComparison/Comparison.lean index 268b31518d..878e18e93c 100644 --- a/LeanPool/JacobianDiffgeo/DolbeaultComparison/Comparison.lean +++ b/LeanPool/JacobianDiffgeo/DolbeaultComparison/Comparison.lean @@ -26,7 +26,7 @@ the time of this build `Jacobian/Finiteness/H1Finite.lean` (the file that would hypothesis unconditionally) has not landed; see the unit's build-log entry. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -54,7 +54,7 @@ noncomputable instance : AddCommGroup (H1 (0 : RS.Divisor X)) := /-! ### `H01 X` -/ /-- The Dolbeault `H^{0,1}(X)`: the naked quotient of `Form01 X` by `range dbar` (D3). -/ -noncomputable def H01 (X : Type*) [TopologicalSpace X] [ChartedSpace ℂ X] +@[expose] noncomputable def H01 (X : Type*) [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ) ω X] : Type _ := Form01 X ⧸ LinearMap.range (RS.dbar (X := X)) @@ -65,7 +65,7 @@ noncomputable instance : Module ℂ (H01 X) := Submodule.Quotient.module _ /-- The quotient map onto `H01 X`. -/ -noncomputable def H01.mk : Form01 X →ₗ[ℂ] H01 X := Submodule.mkQ _ +@[expose] noncomputable def H01.mk : Form01 X →ₗ[ℂ] H01 X := Submodule.mkQ _ theorem H01.mk_surjective : Function.Surjective (H01.mk (X := X)) := Submodule.mkQ_surjective _ @@ -361,7 +361,7 @@ noncomputable def dolbeaultEquiv [T2Space X] [CompactSpace X] : -- `(X := X)` pins the equiv's implicit type argument before the `CoeFun` search starts; left to -- unification it searches with `H01 ?X` still a metavariable and exhausts the instance budget. @[simp] theorem dolbeaultEquiv_apply [T2Space X] [CompactSpace X] (ξ : H1 (0 : RS.Divisor X)) : - dolbeaultEquiv (X := X) ξ = cechToH01 ξ := rfl + dolbeaultEquiv (X := X) ξ = cechToH01 ξ := by rfl /-- The blueprint's stated purpose: Čech finiteness transfers to `H^{0,1}`. Gated on `[FiniteDimensional ℂ (H1 (0 : Divisor X))]` — the unconditional discharge of this hypothesis diff --git a/LeanPool/JacobianDiffgeo/DolbeaultComparison/GlueForm01.lean b/LeanPool/JacobianDiffgeo/DolbeaultComparison/GlueForm01.lean index 7a4803645a..40613eee31 100644 --- a/LeanPool/JacobianDiffgeo/DolbeaultComparison/GlueForm01.lean +++ b/LeanPool/JacobianDiffgeo/DolbeaultComparison/GlueForm01.lean @@ -27,7 +27,7 @@ chart-subordinate cover determine a UNIQUE global `Form01` solving `dbaru_i = ω * `DbarGlueData.isDbarOn_form`, `DbarGlueData.form_unique`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set IsManifold TopologicalSpace @@ -110,9 +110,9 @@ theorem chart_source (i : Fin d.n) : (d.chart i).source = (d.V i : Set X) := by rw [chart, (chartAt ℂ (d.center i)).restr_source' (d.V i : Set X) (d.V i).isOpen, Set.inter_eq_right.2 (d.subChart i)] -theorem coe_chart (i : Fin d.n) : ⇑(d.chart i) = ⇑(chartAt ℂ (d.center i)) := rfl +theorem coe_chart (i : Fin d.n) : ⇑(d.chart i) = ⇑(chartAt ℂ (d.center i)) := by rfl -theorem coe_chart_symm (i : Fin d.n) : ⇑(d.chart i).symm = ⇑(chartAt ℂ (d.center i)).symm := rfl +theorem coe_chart_symm (i : Fin d.n) : ⇑(d.chart i).symm = ⇑(chartAt ℂ (d.center i)).symm := by rfl theorem mem_chart_source_of_mem_V {i : Fin d.n} {x : X} (hx : x ∈ d.V i) : x ∈ (d.chart i).source := by rw [chart_source]; exact hx diff --git a/LeanPool/JacobianDiffgeo/DolbeaultComparison/Leray.lean b/LeanPool/JacobianDiffgeo/DolbeaultComparison/Leray.lean index e9d1c95af3..d091047152 100644 --- a/LeanPool/JacobianDiffgeo/DolbeaultComparison/Leray.lean +++ b/LeanPool/JacobianDiffgeo/DolbeaultComparison/Leray.lean @@ -30,7 +30,7 @@ under this unit's authorization) as black boxes — no `Form01`, no PoU, no dbar injectivity is cech's `toH1_injective`, ALREADY on disk) / `h1CoverEquiv`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -48,7 +48,7 @@ theorem inf_inf_inf_le (a b c : Opens X) : (a ⊓ b) ⊓ (a ⊓ c) ≤ b ⊓ c : /-! ### The induced cover of a member -/ /-- The induced cover of a member: `(V ⊓ 𝒱.U α)_α : FinCover V` for `V ≤ ⊤`. -/ -def FinCover.induced (𝒱 : FinCover (⊤ : Opens X)) (V : Opens X) : FinCover V where +@[expose] def FinCover.induced (𝒱 : FinCover (⊤ : Opens X)) (V : Opens X) : FinCover V where n := 𝒱.n U := fun α => V ⊓ 𝒱.U α le_base := fun _ => inf_le_left @@ -198,7 +198,7 @@ theorem patch_coe (gFam : ∀ i : Fin 𝒰.n, C0 D (𝒱.induced (𝒰.U i))) (i (RS.MeroGermOn.restrict (le_inf (inf_le_left.trans inf_le_left) inf_le_right : 𝒰.U i ⊓ 𝒰.U j ⊓ 𝒱.U α ≤ (𝒱.induced (𝒰.U i)).U α) - (gFam i α : RS.MeroGermOn X ((𝒱.induced (𝒰.U i)).U α : Set X))) := rfl + (gFam i α : RS.MeroGermOn X ((𝒱.induced (𝒰.U i)).U α : Set X))) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] [T2Space X] [CompactSpace X] in /-- `patch`, restricted further down to an arbitrary open `W` (`LinSysOn`-level unfolding of @@ -523,6 +523,6 @@ noncomputable def h1CoverEquiv (h𝒰 : 𝒰.IsGood) : H1Cover D 𝒰 ≃ₗ[ℂ LinearEquiv.ofBijective (toH1 D 𝒰) ⟨toH1_injective D 𝒰, toH1_surjective_of_isGood D h𝒰⟩ @[simp] theorem h1CoverEquiv_apply (h𝒰 : 𝒰.IsGood) (c : H1Cover D 𝒰) : - h1CoverEquiv D h𝒰 c = toH1 D 𝒰 c := rfl + h1CoverEquiv D h𝒰 c = toH1 D 𝒰 c := by rfl end RS.Cech diff --git a/LeanPool/JacobianDiffgeo/DolbeaultComparison/Splitting.lean b/LeanPool/JacobianDiffgeo/DolbeaultComparison/Splitting.lean index 633bdebd70..322c63f4e2 100644 --- a/LeanPool/JacobianDiffgeo/DolbeaultComparison/Splitting.lean +++ b/LeanPool/JacobianDiffgeo/DolbeaultComparison/Splitting.lean @@ -30,7 +30,7 @@ each splitting's PDE data as a `DbarGlueData` (via `GlueForm01.lean`), whose glu `dolbForm_mem_range_of_mem_B1`, `dolbForm_res_sub_mem`). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -42,7 +42,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( /-! ### `Z1.repr`: pointwise holomorphic representatives -/ /-- Pointwise holomorphic representative of a component of a `D = 0` cocycle. -/ -noncomputable def Z1.repr {𝒰 : FinCover (⊤ : Opens X)} (f : Z1 (0 : RS.Divisor X) 𝒰) +@[expose] noncomputable def Z1.repr {𝒰 : FinCover (⊤ : Opens X)} (f : Z1 (0 : RS.Divisor X) 𝒰) (p : Fin 𝒰.n × Fin 𝒰.n) : X → ℂ := RS.MeroGermOn.holoRepr ((f : C1 (0 : RS.Divisor X) 𝒰) p : RS.MeroGermOn X (𝒰.U p.1 ⊓ 𝒰.U p.2 : Set X)) @@ -259,7 +259,7 @@ theorem exists_smoothSplitting [T2Space X] [CompactSpace X] (𝒰 : FinCover ( /-! ### `SmoothSplitting.glueData`, `dolbForm` -/ /-- The glue data of a splitting on a GOOD cover, and its glued form (design §6.2). -/ -noncomputable def SmoothSplitting.glueData {𝒰 : FinCover (⊤ : Opens X)} (h𝒰 : 𝒰.IsGood) +@[expose] noncomputable def SmoothSplitting.glueData {𝒰 : FinCover (⊤ : Opens X)} (h𝒰 : 𝒰.IsGood) {f : Z1 (0 : RS.Divisor X) 𝒰} (s : SmoothSplitting 𝒰 f) : DbarGlueData X where n := 𝒰.n V := 𝒰.U @@ -278,7 +278,7 @@ noncomputable def SmoothSplitting.glueData {𝒰 : FinCover (⊤ : Opens X)} (h /-- The glued form of a chosen splitting of `f` on a good cover: the comparison map's core per-cover output (design §6.2). -/ -noncomputable def dolbForm [T2Space X] [CompactSpace X] {𝒰 : FinCover (⊤ : Opens X)} +@[expose] noncomputable def dolbForm [T2Space X] [CompactSpace X] {𝒰 : FinCover (⊤ : Opens X)} (h𝒰 : 𝒰.IsGood) (f : Z1 (0 : RS.Divisor X) 𝒰) : Form01 X := ((exists_smoothSplitting 𝒰 f).some.glueData h𝒰).form diff --git a/LeanPool/JacobianDiffgeo/Finiteness.lean b/LeanPool/JacobianDiffgeo/Finiteness.lean index d245c26313..af4af54736 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness.lean @@ -84,4 +84,4 @@ forbidden tactic. (monotonicity corollaries). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Finiteness/BddHolo.lean b/LeanPool/JacobianDiffgeo/Finiteness/BddHolo.lean index 3f33946fba..38da53451e 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/BddHolo.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/BddHolo.lean @@ -35,7 +35,7 @@ three named maps; the Banach files (`Chain.lean`, `CompactRestrict.lean`) never `MeroGermOn` internals directly, and the germ files never touch `→ᵇ` internals. -/ -@[expose] public section +public section open scoped ContDiff Manifold BoundedContinuousFunction open Set Filter Topology TopologicalSpace Metric @@ -80,7 +80,7 @@ theorem contMDiffOn_const_smul {U : Set X} (hU : IsOpen U) (c : ℂ) {g : X → /-- Bounded-holomorphic elements: BCF on the open subtype agreeing with a holomorphic function on `S`. -/ -noncomputable def BddHoloOn (S : Opens X) : Submodule ℂ (↥(S : Set X) →ᵇ ℂ) where +@[expose] noncomputable def BddHoloOn (S : Opens X) : Submodule ℂ (↥(S : Set X) →ᵇ ℂ) where carrier := {f | ∃ g : X → ℂ, ContMDiffOn 𝓘(ℂ) 𝓘(ℂ) ω g (S : Set X) ∧ ∀ z : ↥(S : Set X), f z = g z} zero_mem' := ⟨fun _ => 0, contMDiffOn_const, fun _ => rfl⟩ @@ -151,7 +151,7 @@ instance instCompleteSpaceBddHoloOn (S : Opens X) : CompleteSpace (BddHoloOn S) /-! ### `restrictCLM` -/ /-- The underlying restricted bounded continuous function. -/ -noncomputable def restrictFun {S' S : Opens X} (h : S' ≤ S) (f : BddHoloOn S) : +@[expose] noncomputable def restrictFun {S' S : Opens X} (h : S' ≤ S) (f : BddHoloOn S) : ↥(S' : Set X) →ᵇ ℂ := BoundedContinuousFunction.ofNormedAddCommGroup (fun z => (f : ↥(S : Set X) →ᵇ ℂ) (Set.inclusion h z)) @@ -180,6 +180,7 @@ theorem restrictFun_smul {S' S : Opens X} (h : S' ≤ S) (c : ℂ) (f : BddHoloO rfl /-- Restriction, norm `≤ 1`. -/ +@[expose] noncomputable def restrictCLM {S' S : Opens X} (h : S' ≤ S) : BddHoloOn S →L[ℂ] BddHoloOn S' := LinearMap.mkContinuous { toFun := fun f => ⟨restrictFun h f, restrictFun_mem h f⟩ @@ -192,7 +193,7 @@ noncomputable def restrictCLM {S' S : Opens X} (h : S' ≤ S) : BddHoloOn S →L theorem restrictCLM_apply_coe {S' S : Opens X} (h : S' ≤ S) (f : BddHoloOn S) (z : ↥(S' : Set X)) : - (restrictCLM h f : ↥(S' : Set X) →ᵇ ℂ) z = (f : ↥(S : Set X) →ᵇ ℂ) (Set.inclusion h z) := rfl + (restrictCLM h f : ↥(S' : Set X) →ᵇ ℂ) z = (f : ↥(S : Set X) →ᵇ ℂ) (Set.inclusion h z) := by rfl /-- Presheaf law: restrictions compose (the analogue of `MeroGermOn.restrict_restrict` / `LinSysOn.restrictL_restrictL`, needed for the cochain-level naturality of `resNC1`). -/ @@ -255,8 +256,7 @@ named `toGerm` application on their own). -/ theorem toGerm_eq_mk {S : Opens X} (f : BddHoloOn S) : toGerm S f = MeroGermOn.mk f.2.choose (fun _x hx => RS.ContMDiffAt.meromorphicAtX (f.2.choose_spec.1.contMDiffAt (S.2.mem_nhds - hx))) := - rfl + hx))) := by rfl omit [T1Space X] in theorem toGerm_mem_linSysOn {S : Opens X} (f : BddHoloOn S) : @@ -333,7 +333,7 @@ omit [T1Space X] [T2Space X] in theorem restrictGerm_apply {S' S : Opens X} (hc : closure (S' : Set X) ⊆ (S : Set X)) (φ : RS.LinSysOn (0 : RS.Divisor X) (S : Set X)) (z : ↥(S' : Set X)) : (restrictGerm hc φ : ↥(S' : Set X) →ᵇ ℂ) z - = RS.MeroGermOn.holoRepr (φ : RS.MeroGermOn X (S : Set X)) z := rfl + = RS.MeroGermOn.holoRepr (φ : RS.MeroGermOn X (S : Set X)) z := by rfl omit [T2Space X] [T1Space X] in theorem toGerm_restrictGerm {S' S : Opens X} (hc : closure (S' : Set X) ⊆ (S : Set X)) diff --git a/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean b/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean index 453808b569..c7b38ad532 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean @@ -50,7 +50,7 @@ not built here): the two `IsCompactOperator` assembly lemmas of design §4.4 Nothing here uses the forbidden tactic. -/ -@[expose] public section +public section open scoped ContDiff Manifold BoundedContinuousFunction open Set Filter Topology TopologicalSpace Metric RS.Cech @@ -125,28 +125,28 @@ theorem covers_Ustar (x : X) : ∃ i, x ∈ T.Ustar i := /-- The four `FinCover ⊤`s induced by a `ShrinkChain`. Reducible: their fields must unfold at `implicit` transparency, or applications like `C1 D T.coverW` are not type-correct there and every rewrite in such a goal fails. -/ -@[reducible] noncomputable def coverW : FinCover (⊤ : Opens X) where +@[reducible, expose] noncomputable def coverW : FinCover (⊤ : Opens X) where n := T.n U := T.W le_base _ := le_top covers x _ := T.covers_W x /-- The cover of `X` by the `V`-level opens. -/ -@[reducible] noncomputable def coverV : FinCover (⊤ : Opens X) where +@[reducible, expose] noncomputable def coverV : FinCover (⊤ : Opens X) where n := T.n U := T.V le_base _ := le_top covers x _ := T.covers_V x /-- The cover of `X` by the `U`-level opens. -/ -@[reducible] noncomputable def coverU : FinCover (⊤ : Opens X) where +@[reducible, expose] noncomputable def coverU : FinCover (⊤ : Opens X) where n := T.n U := T.U le_base _ := le_top covers x _ := T.covers_U x /-- The cover of `X` by the outermost `Ustar`-level opens. -/ -@[reducible] noncomputable def coverStar : FinCover (⊤ : Opens X) where +@[reducible, expose] noncomputable def coverStar : FinCover (⊤ : Opens X) where n := T.n U := T.Ustar le_base _ := le_top @@ -222,13 +222,13 @@ abbrev NC1 : Type _ := ∀ p : Fin T.n × Fin T.n, BddHoloOn (P p.1 ⊓ P p.2) /-- `(δ⁰f)_{ij} = f_j − f_i` (after restriction to `P i ⊓ P j`); the Banach-layer analogue of `Cech.d0`. -/ -noncomputable def deltaCLM : NC0 T P →L[ℂ] NC1 T P := +@[expose] noncomputable def deltaCLM : NC0 T P →L[ℂ] NC1 T P := ContinuousLinearMap.pi fun p : Fin T.n × Fin T.n => (restrictCLM (inf_le_right : P p.1 ⊓ P p.2 ≤ P p.2)).comp (ContinuousLinearMap.proj p.2) - (restrictCLM (inf_le_left : P p.1 ⊓ P p.2 ≤ P p.1)).comp (ContinuousLinearMap.proj p.1) @[simp] theorem deltaCLM_apply (f : NC0 T P) (p : Fin T.n × Fin T.n) : - deltaCLM T P f p = restrictCLM inf_le_right (f p.2) - restrictCLM inf_le_left (f p.1) := rfl + deltaCLM T P f p = restrictCLM inf_le_right (f p.2) - restrictCLM inf_le_left (f p.1) := by rfl /-- The `1`-to-`2`-cochain coboundary at level `P`, purely internal (used only to package `NZ1` as a continuous-kernel submodule — no `NC2` is ever exported). -/ @@ -251,10 +251,10 @@ closedness proof needed. -/ d1NC T P f t = restrictCLM (le_inf (inf_le_left.trans inf_le_right) inf_le_right) (f (t.2.1, t.2.2)) - restrictCLM (le_inf (inf_le_left.trans inf_le_left) inf_le_right) (f (t.1, t.2.2)) - + restrictCLM inf_le_left (f (t.1, t.2.1)) := rfl + + restrictCLM inf_le_left (f (t.1, t.2.1)) := by rfl /-- The norm-bounded cocycles at level `P`: the kernel of the bounded coboundary `d1NC`. -/ -noncomputable def NZ1 : Submodule ℂ (NC1 T P) := (d1NC T P).ker +@[expose] noncomputable def NZ1 : Submodule ℂ (NC1 T P) := (d1NC T P).ker instance : CompleteSpace (NZ1 T P) := ContinuousLinearMap.completeSpace_ker (d1NC T P) @@ -295,12 +295,12 @@ noncomputable def resNC0 (h : ∀ i, P' i ≤ P i) : NC0 T P →L[ℂ] NC0 T P' ContinuousLinearMap.pi fun i => (restrictCLM (h i)).comp (ContinuousLinearMap.proj i) /-- Restriction of `1`-cochains along a same-index shrinking `P' ≤ P`. -/ -noncomputable def resNC1 (h : ∀ i, P' i ≤ P i) : NC1 T P →L[ℂ] NC1 T P' := +@[expose] noncomputable def resNC1 (h : ∀ i, P' i ≤ P i) : NC1 T P →L[ℂ] NC1 T P' := ContinuousLinearMap.pi fun p : Fin T.n × Fin T.n => (restrictCLM (inf_le_inf (h p.1) (h p.2))).comp (ContinuousLinearMap.proj p) @[simp] theorem resNC1_apply (h : ∀ i, P' i ≤ P i) (f : NC1 T P) (p : Fin T.n × Fin T.n) : - resNC1 T P P' h f p = restrictCLM (inf_le_inf (h p.1) (h p.2)) (f p) := rfl + resNC1 T P P' h f p = restrictCLM (inf_le_inf (h p.1) (h p.2)) (f p) := by rfl /-- Restriction takes bounded cocycles to bounded cocycles (naturality of `d1NC`, via the `NZ1.rel_res` workhorse — mirrors `Cech.Refinement`'s `resC1_mem_Z1`). -/ @@ -315,7 +315,7 @@ theorem resNC1_mapsTo_NZ1 (h : ∀ i, P' i ≤ P i) {f : NC1 T P} (hf : f ∈ NZ (le_inf (le_inf hkh hlh) hmh) (le_inf hlh hmh) (le_inf hkh hmh) (le_inf hkh hlh) /-- Restriction of bounded cocycles between same-index levels. -/ -noncomputable def resZ (h : ∀ i, P' i ≤ P i) : NZ1 T P →L[ℂ] NZ1 T P' := +@[expose] noncomputable def resZ (h : ∀ i, P' i ≤ P i) : NZ1 T P →L[ℂ] NZ1 T P' := ((resNC1 T P P' h).comp (NZ1 T P).subtypeL).codRestrict (NZ1 T P') (fun f => resNC1_mapsTo_NZ1 T P P' h f.2) @@ -342,7 +342,7 @@ noncomputable def tradeDefect : tradeDefect T x p = restrictCLM (inf_le_inf (T.W_le_U p.1) (T.W_le_U p.2)) ((x.1 : NC1 T T.U) p) - restrictCLM (inf_le_inf (T.W_le_V p.1) (T.W_le_V p.2)) ((x.2.1 : NC1 T T.V) p) - - (restrictCLM inf_le_right (x.2.2 p.2) - restrictCLM inf_le_left (x.2.2 p.1)) := rfl + - (restrictCLM inf_le_right (x.2.2 p.2) - restrictCLM inf_le_left (x.2.2 p.1)) := by rfl /-- **Forster's subspace `L`** (14.6(b)): triples `(ζ, ξ, η)` with `ζ = ξ + δη` on `𝔚`, packaged as `ContinuousLinearMap.ker` (closed, hence complete for free). -/ @@ -381,23 +381,23 @@ noncomputable instance : NormedSpace ℂ (tradeSpace T) := surjectivity = the qualitative trade, proved in `TradeBounded.lean` as `tradePi_surjective`; the norm constant of 14.6(b) is recovered inside `schwartz_finite_cospan` by `exists_preimage_norm_le` — design §5 step 7). -/ -noncomputable def tradePi : tradeSpace T →L[ℂ] NZ1 T T.V := +@[expose] noncomputable def tradePi : tradeSpace T →L[ℂ] NZ1 T T.V := (ContinuousLinearMap.fst ℂ (NZ1 T T.V) (NC0 T T.W)).comp ((ContinuousLinearMap.snd ℂ (NZ1 T T.U) (NZ1 T T.V × NC0 T T.W)).comp (tradeSpace T).subtypeL) /-- **The compact leg** `v : L →L Z¹(𝔙)`, `(ζ, ξ, η) ↦ ζ|𝔙` (compactness = Montel, assembled from `isCompactOperator_restrictCLM` — deferred, see the end-of-file note). -/ -noncomputable def tradeCompact : tradeSpace T →L[ℂ] NZ1 T T.V := +@[expose] noncomputable def tradeCompact : tradeSpace T →L[ℂ] NZ1 T T.V := (resZ T T.U T.V T.V_le_U).comp ((ContinuousLinearMap.fst ℂ (NZ1 T T.U) (NZ1 T T.V × NC0 T T.W)).comp (tradeSpace T).subtypeL) @[simp] theorem tradePi_apply (x : tradeSpace T) : - tradePi T x = x.1.2.1 := rfl + tradePi T x = x.1.2.1 := by rfl @[simp] theorem tradeCompact_apply (x : tradeSpace T) : - tradeCompact T x = resZ T T.U T.V T.V_le_U x.1.1 := rfl + tradeCompact T x = resZ T T.U T.V T.V_le_U x.1.1 := by rfl /- NOTE (resolution of the former `TODO(blocker)`; recorded for future units). The four trade declarations above were blocked by what looked like an `IsTopologicalAddGroup`-on-`NZ1` diff --git a/LeanPool/JacobianDiffgeo/Finiteness/Chi.lean b/LeanPool/JacobianDiffgeo/Finiteness/Chi.lean index 97002cb5a2..3fc3cab628 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/Chi.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/Chi.lean @@ -33,7 +33,7 @@ Unit: finiteness-and-chi (`docs/design/finiteness-and-chi.md` §8). * `l_mono`/`l_le_l_add_degree`/`h1_le_of_le`/`h1_le_h1_add_degree`: monotonicity corollaries. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology TopologicalSpace RS.Cech @@ -71,10 +71,13 @@ instance finiteDimensional_linSys [ConnectedSpace X] (D : RS.Divisor X) : /-! ### The χ ledger's frozen definitions -/ /-- `h¹(D)`: the dimension of the first Čech cohomology of `𝒪_D`. -/ -noncomputable def h1 (D : RS.Divisor X) : ℕ := Module.finrank ℂ (H1 D) +@[expose] noncomputable def h1 (D : RS.Divisor X) : ℕ := Module.finrank ℂ (H1 D) + +omit [IsManifold 𝓘(ℂ, ℂ) ω X] [T1Space X] [T2Space X] [CompactSpace X] in +theorem h1_eq_finrank (D : RS.Divisor X) : h1 D = Module.finrank ℂ (H1 D) := by rfl /-- The Euler characteristic `χ(D) = l(D) - h¹(D)`. -/ -noncomputable def chi (D : RS.Divisor X) : ℤ := (RS.l D : ℤ) - (h1 D : ℤ) +@[expose] noncomputable def chi (D : RS.Divisor X) : ℤ := (RS.l D : ℤ) - (h1 D : ℤ) /-! ### The shared six-term rank bookkeeping -/ diff --git a/LeanPool/JacobianDiffgeo/Finiteness/CompactRestrict.lean b/LeanPool/JacobianDiffgeo/Finiteness/CompactRestrict.lean index 29650ad436..87681dd064 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/CompactRestrict.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/CompactRestrict.lean @@ -32,7 +32,7 @@ after the relevant definitions, by `IsCompactOperator.comp_clm`/`.clm_comp` comp lemma (per §6.3 step 5) — no mathematical content moves, only the file boundary. -/ -@[expose] public section +public section open scoped ContDiff Manifold BoundedContinuousFunction open Set Filter Topology TopologicalSpace Metric diff --git a/LeanPool/JacobianDiffgeo/Finiteness/H1Finite.lean b/LeanPool/JacobianDiffgeo/Finiteness/H1Finite.lean index 6f460d00db..7bd9df4f80 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/H1Finite.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/H1Finite.lean @@ -30,7 +30,7 @@ Unit: finiteness-and-chi (`docs/design/finiteness-and-chi.md` §6.4/§6.5, §7). cech's six-term skyscraper fragment, NOT twisted norms). -/ -@[expose] public section +public section open scoped ContDiff Manifold BoundedContinuousFunction open Set Filter Topology TopologicalSpace Metric RS.Cech diff --git a/LeanPool/JacobianDiffgeo/Finiteness/Schwartz.lean b/LeanPool/JacobianDiffgeo/Finiteness/Schwartz.lean index 99a1bb1b5f..2db7dfb993 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/Schwartz.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/Schwartz.lean @@ -43,7 +43,7 @@ perturbation `v` to correct for. Forster's open-mapping step 14.6(b) survives as timeout at `E →L[ℂ] F`, per the spike `scratch_finiteness.lean` §11). -/ -@[expose] public section +public section open Metric Function diff --git a/LeanPool/JacobianDiffgeo/Finiteness/TradeBounded.lean b/LeanPool/JacobianDiffgeo/Finiteness/TradeBounded.lean index 84182d0e8e..0f46788cef 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/TradeBounded.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/TradeBounded.lean @@ -30,7 +30,7 @@ step 5). This is the first of the three files that were blocked on the cech `Col Schwartz-consumer properties. -/ -@[expose] public section +public section open scoped ContDiff Manifold BoundedContinuousFunction open Set Filter Topology TopologicalSpace Metric RS.Cech @@ -219,7 +219,7 @@ noncomputable def toGermSub (S : Opens X) : omit [T1Space X] in theorem toGermSub_apply_coe (S : Opens X) (f : BddHoloOn S) : - (toGermSub S f : RS.MeroGermOn X (S : Set X)) = toGerm S f := rfl + (toGermSub S f : RS.MeroGermOn X (S : Set X)) = toGerm S f := by rfl omit [T1Space X] in theorem toGermSub_restrictCLM_comm {S' S : Opens X} (h : S' ≤ S) (f : BddHoloOn S) : @@ -235,7 +235,7 @@ lemmas typecheck for a bare `P : Fin T.n → Opens X` without needing `𝒰.n` t `T.n` — a genuine dependent-type obstruction for a free `𝒰 : FinCover (⊤ : Opens X)` variable). `T.coverU`/`T.coverV`/`T.coverW` are `rfl`-equal to `coverOfP T.U T.covers_U` etc. (same fields, `Prop`-irrelevant `covers` witness), so this is used transparently at call sites. -/ -@[reducible] noncomputable def coverOfP (P : Fin T.n → Opens X) (hcov : ∀ x, ∃ i, x ∈ P i) : +@[expose, reducible] noncomputable def coverOfP (P : Fin T.n → Opens X) (hcov : ∀ x, ∃ i, x ∈ P i) : FinCover (⊤ : Opens X) where n := T.n U := P @@ -250,7 +250,7 @@ noncomputable def toGermC1 (P : Fin T.n → Opens X) : omit [T1Space X] in theorem toGermC1_apply (P : Fin T.n → Opens X) (f : NC1 T P) (p : Fin T.n × Fin T.n) : - toGermC1 T P f p = toGermSub (P p.1 ⊓ P p.2) (f p) := rfl + toGermC1 T P f p = toGermSub (P p.1 ⊓ P p.2) (f p) := by rfl omit [T1Space X] in theorem toGermC1_mem_Z1 (P : Fin T.n → Opens X) (hcov : ∀ x, ∃ i, x ∈ P i) @@ -278,8 +278,7 @@ noncomputable def toGermZ1 (P : Fin T.n → Opens X) (hcov : ∀ x, ∃ i, x ∈ omit [T1Space X] in theorem toGermZ1_apply_coe (P : Fin T.n → Opens X) (hcov : ∀ x, ∃ i, x ∈ P i) (ξ : NZ1 T P) : (toGermZ1 T P hcov ξ : C1 (0 : RS.Divisor X) (coverOfP T P hcov)) = toGermC1 T P (ξ : NC1 T P) - := - rfl + := by rfl variable [T2Space X] [CompactSpace X] @@ -488,7 +487,7 @@ noncomputable def toGermC0 (P : Fin T.n → Opens X) : omit [T2Space X] [CompactSpace X] [T1Space X] in theorem toGermC0_apply (P : Fin T.n → Opens X) (h : NC0 T P) (i : Fin T.n) : - toGermC0 T P h i = toGermSub (P i) (h i) := rfl + toGermC0 T P h i = toGermSub (P i) (h i) := by rfl omit [T2Space X] [CompactSpace X] [T1Space X] in /-- Naturality: germifying a `0`-cochain then taking its cover-level coboundary agrees with @@ -506,7 +505,7 @@ noncomputable def toGermZ1W (ψ : NZ1 T T.W) : Z1 (0 : RS.Divisor X) T.coverW := omit [T2Space X] [CompactSpace X] [T1Space X] in theorem toGermZ1W_apply_coe (ψ : NZ1 T T.W) : - (toGermZ1W T ψ : C1 (0 : RS.Divisor X) T.coverW) = toGermC1 T T.W (ψ : NC1 T T.W) := rfl + (toGermZ1W T ψ : C1 (0 : RS.Divisor X) T.coverW) = toGermC1 T T.W (ψ : NC1 T T.W) := by rfl /-- **The Čech class map** (§5 step 8): bound `V`-level cocycles down to `W`, germify, take the Mittag-Leffler class. -/ @@ -528,8 +527,7 @@ noncomputable def classMap : NZ1 T T.V →ₗ[ℂ] H1Cover (0 : RS.Divisor X) T. omit [T2Space X] [CompactSpace X] [T1Space X] in theorem classMap_apply (ψ : NZ1 T T.V) : classMap T ψ = H1Cover.mk (0 : RS.Divisor X) T.coverW - (toGermZ1W T (resZ T T.V T.W T.W_le_V ψ)) := - rfl + (toGermZ1W T (resZ T T.V T.W T.W_le_V ψ)) := by rfl omit [T2Space X] [CompactSpace X] [T1Space X] in /-- The trade defect, restricted to `W`, is minus the coboundary of `x`'s `W`-component. -/ diff --git a/LeanPool/JacobianDiffgeo/FormTrace.lean b/LeanPool/JacobianDiffgeo/FormTrace.lean index 0303e67af3..7cbe457463 100644 --- a/LeanPool/JacobianDiffgeo/FormTrace.lean +++ b/LeanPool/JacobianDiffgeo/FormTrace.lean @@ -77,4 +77,4 @@ residues, chart handling, and residue-trace compatibility (Miranda Lemma 3.2 glo own §0.3 audit; unaffected by any of the findings above). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/FormTrace/PairForm.lean b/LeanPool/JacobianDiffgeo/FormTrace/PairForm.lean index 24175a9f9e..b92b3bc94a 100644 --- a/LeanPool/JacobianDiffgeo/FormTrace/PairForm.lean +++ b/LeanPool/JacobianDiffgeo/FormTrace/PairForm.lean @@ -48,7 +48,7 @@ than assumed away (see `ResidueTraceCompat.lean`). * Basic algebra: `resAtX_congr`, `resAtX_add`, `resAtX_const_mul`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Filter Topology Metric Function Set @@ -68,7 +68,7 @@ noncomputable def resAtX (F : X → Y) (h : X → ℂ) (x : X) : ℂ := omit [IsManifold 𝓘(ℂ) ω X] [IsManifold 𝓘(ℂ) ω Y] in theorem resAtX_def (F : X → Y) (h : X → ℂ) (x : X) : resAtX F h x = RS.resAt (fun z => h ((chartAt ℂ x).symm z) * - deriv (chartAt ℂ (F x) ∘ F ∘ (chartAt ℂ x).symm) z) (chartAt ℂ x x) := rfl + deriv (chartAt ℂ (F x) ∘ F ∘ (chartAt ℂ x).symm) z) (chartAt ℂ x x) := by rfl /-! ### Compat: the two-chart `ContMDiffAt ↔ AnalyticAt` bridge diff --git a/LeanPool/JacobianDiffgeo/FormTrace/ResidueTraceCompat.lean b/LeanPool/JacobianDiffgeo/FormTrace/ResidueTraceCompat.lean index 984ac9b5da..f5d5403d1b 100644 --- a/LeanPool/JacobianDiffgeo/FormTrace/ResidueTraceCompat.lean +++ b/LeanPool/JacobianDiffgeo/FormTrace/ResidueTraceCompat.lean @@ -48,7 +48,7 @@ EXPLICIT hypothesis `hcal` (satisfied by any stack built via `exists_fiberStack` (task item 5, §4.6), NOT gated on the calibration issue at all (pure value/finsum identities). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Filter Topology Metric Function Set @@ -63,7 +63,7 @@ noncomputable def resAtP1 (R : OnePoint ℂ → ℂ) (y₀ : OnePoint ℂ) : ℂ RS.resAt (R ∘ (chartAt ℂ y₀).symm) (chartAt ℂ y₀ y₀) theorem resAtP1_def (R : OnePoint ℂ → ℂ) (y₀ : OnePoint ℂ) : - resAtP1 R y₀ = RS.resAt (R ∘ (chartAt ℂ y₀).symm) (chartAt ℂ y₀ y₀) := rfl + resAtP1 R y₀ = RS.resAt (R ∘ (chartAt ℂ y₀).symm) (chartAt ℂ y₀ y₀) := by rfl theorem resAtP1_eq_resAtX_id (R : OnePoint ℂ → ℂ) (y₀ : OnePoint ℂ) : resAtP1 R y₀ = resAtX (id : OnePoint ℂ → OnePoint ℂ) R y₀ := by diff --git a/LeanPool/JacobianDiffgeo/FormTrace/TraceZkForm.lean b/LeanPool/JacobianDiffgeo/FormTrace/TraceZkForm.lean index 467e1e455c..6cbbadbbfd 100644 --- a/LeanPool/JacobianDiffgeo/FormTrace/TraceZkForm.lean +++ b/LeanPool/JacobianDiffgeo/FormTrace/TraceZkForm.lean @@ -40,7 +40,7 @@ the Jacobian factor" atom on top. identities, now UNCONDITIONALLY PROVABLE (mtrace's P6 landed, see `docs/build-log.md`). -/ -@[expose] public section +public section open Filter Topology @@ -50,12 +50,13 @@ variable {h g : ℂ → ℂ} {k : ℕ} /-- The Jacobian-weighted planar trace atom: divides the `k·v^{k-1}` Jacobian factor of `F^*(dz)` back out before applying `RS.MTrace.traceZk`. -/ +@[expose] noncomputable def traceZkForm (h : ℂ → ℂ) (k : ℕ) (w : ℂ) : ℂ := RS.MTrace.traceZk (fun v => h v * ((k : ℂ) * v ^ ((k : ℤ) - 1))⁻¹) k w theorem traceZkForm_def (h : ℂ → ℂ) (k : ℕ) (w : ℂ) : traceZkForm h k w = RS.MTrace.traceZk (fun v => h v * ((k : ℂ) * v ^ ((k : ℤ) - 1))⁻¹) k w := - rfl + by rfl /-- The cancellation identity (task item 2's core step), `w ≠ 0` form (see the module docstring for why the design's unconditional claim is false at `w = 0`). -/ diff --git a/LeanPool/JacobianDiffgeo/Forms.lean b/LeanPool/JacobianDiffgeo/Forms.lean index 75047b1b2a..39b711382b 100644 --- a/LeanPool/JacobianDiffgeo/Forms.lean +++ b/LeanPool/JacobianDiffgeo/Forms.lean @@ -57,4 +57,4 @@ Downstream units use `coeffIn`/`coeffAt` and the lemmas above — never raw bund (`Form1` is `abbrev`-only plumbing). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Forms/Analyticity.lean b/LeanPool/JacobianDiffgeo/Forms/Analyticity.lean index e1f53d1279..5362e07e58 100644 --- a/LeanPool/JacobianDiffgeo/Forms/Analyticity.lean +++ b/LeanPool/JacobianDiffgeo/Forms/Analyticity.lean @@ -30,7 +30,7 @@ Main declarations: targets (any maximal-atlas chart). -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle open Set IsManifold @@ -180,6 +180,7 @@ theorem contMDiffAt_section_iff_analyticAt_coeffInFun /-- Build a holomorphic 1-form from a raw covector section whose preferred-chart coefficient functions are analytic. -/ +@[expose] def Form1.ofSectionAnalytic (σ : ∀ x : X, TangentSpace 𝓘(ℂ) x →L[ℂ] Bundle.Trivial X ℂ x) (h : ∀ x, AnalyticAt ℂ (coeffInFun (chartAt ℂ x) σ) (chartAt ℂ x x)) : Form1 X := ⟨σ, fun x => (contMDiffAt_section_iff_analyticAt_coeffInFun σ x).mpr (h x)⟩ @@ -187,7 +188,7 @@ def Form1.ofSectionAnalytic (σ : ∀ x : X, TangentSpace 𝓘(ℂ) x →L[ℂ] @[simp] theorem Form1.coe_ofSectionAnalytic (σ : ∀ x : X, TangentSpace 𝓘(ℂ) x →L[ℂ] Bundle.Trivial X ℂ x) (h : ∀ x, AnalyticAt ℂ (coeffInFun (chartAt ℂ x) σ) (chartAt ℂ x x)) : - ⇑(Form1.ofSectionAnalytic σ h) = σ := rfl + ⇑(Form1.ofSectionAnalytic σ h) = σ := by rfl /-! ### Analyticity of the coefficients of a holomorphic 1-form -/ diff --git a/LeanPool/JacobianDiffgeo/Forms/Basic.lean b/LeanPool/JacobianDiffgeo/Forms/Basic.lean index ddb7818589..42013d83b7 100644 --- a/LeanPool/JacobianDiffgeo/Forms/Basic.lean +++ b/LeanPool/JacobianDiffgeo/Forms/Basic.lean @@ -25,7 +25,7 @@ bundle are all found by typeclass inference (checked by the `example`s below). E `η x v : ℂ` works through the reducible `Bundle.Trivial X ℂ x ≡ ℂ`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle diff --git a/LeanPool/JacobianDiffgeo/Forms/Coeffs.lean b/LeanPool/JacobianDiffgeo/Forms/Coeffs.lean index 9008b111d2..4c2360940c 100644 --- a/LeanPool/JacobianDiffgeo/Forms/Coeffs.lean +++ b/LeanPool/JacobianDiffgeo/Forms/Coeffs.lean @@ -28,7 +28,7 @@ Main results: All downstream units interact with 1-forms exclusively through this API. -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle open Set @@ -41,6 +41,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘( /-- The coefficient function of a raw covector section in the chart `e`: for `z ∈ e.target`, `coeffInFun e σ z = σ (e.symm z) (d(e.symm)_z 1)`. Junk (unspecified) off `e.target`. -/ +@[expose] def coeffInFun (e : OpenPartialHomeomorph X ℂ) (σ : ∀ x : X, TangentSpace 𝓘(ℂ) x →L[ℂ] Bundle.Trivial X ℂ x) (z : ℂ) : ℂ := σ (e.symm z) (mfderiv 𝓘(ℂ) 𝓘(ℂ) e.symm z (1 : ℂ)) @@ -48,6 +49,7 @@ def coeffInFun (e : OpenPartialHomeomorph X ℂ) /-- The coefficient function of a 1-form in the chart `e`: for `z ∈ e.target`, `coeffIn e η z = η (e.symm z) (d(e.symm)_z 1)`, i.e. "`η = (coeffIn e η) dz`" in the chart. Junk (unspecified) off `e.target`. -/ +@[expose] def coeffIn (e : OpenPartialHomeomorph X ℂ) (η : Form1 X) (z : ℂ) : ℂ := coeffInFun e (⇑η) z @@ -55,7 +57,7 @@ theorem coeffIn_def (e : OpenPartialHomeomorph X ℂ) (η : Form1 X) : coeffIn e η = coeffInFun e ⇑η := rfl /-- Coefficient in the preferred chart, at the image of the base point. -/ -def coeffAt (x : X) (η : Form1 X) : ℂ := coeffIn (chartAt ℂ x) η (chartAt ℂ x x) +@[expose] def coeffAt (x : X) (η : Form1 X) : ℂ := coeffIn (chartAt ℂ x) η (chartAt ℂ x x) /-- Restricting a chart does not change the coefficient function (the underlying chart maps are unchanged by `restr`). -/ @@ -128,13 +130,14 @@ abbrev tangentCoord {Y : Type*} [TopologicalSpace Y] [ChartedSpace ℂ Y] {y : Y /-- Non-dependent evaluation of a raw covector section, through the definitional equality `TangentSpace 𝓘(ℂ) q ≡ ℂ ≡ Bundle.Trivial X ℂ q`. Point-congruences for the dependent evaluation are done through this function. -/ +@[expose] def evalC (σ : ∀ x : X, TangentSpace 𝓘(ℂ) x →L[ℂ] Bundle.Trivial X ℂ x) (q : X) (w : ℂ) : ℂ := σ q w omit [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem coeffInFun_eq_evalC (e : OpenPartialHomeomorph X ℂ) (σ : ∀ x : X, TangentSpace 𝓘(ℂ) x →L[ℂ] Bundle.Trivial X ℂ x) (z : ℂ) : - coeffInFun e σ z = evalC σ (e.symm z) (mfderiv 𝓘(ℂ) 𝓘(ℂ) e.symm z (1 : ℂ)) := rfl + coeffInFun e σ z = evalC σ (e.symm z) (mfderiv 𝓘(ℂ) 𝓘(ℂ) e.symm z (1 : ℂ)) := by rfl omit [IsManifold 𝓘(ℂ, ℂ) ω X] in /-- Scalars pull out of the non-dependent evaluation (the fiberwise CLM is `ℂ`-linear). -/ diff --git a/LeanPool/JacobianDiffgeo/Forms/Finiteness.lean b/LeanPool/JacobianDiffgeo/Forms/Finiteness.lean index 3cce9322fc..d96147c36b 100644 --- a/LeanPool/JacobianDiffgeo/Forms/Finiteness.lean +++ b/LeanPool/JacobianDiffgeo/Forms/Finiteness.lean @@ -35,7 +35,7 @@ Main declarations: * `instance : FiniteDimensional ℂ (Form1 X)` (compact T2 `X`). -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle Topology open Set Filter IsManifold @@ -249,7 +249,7 @@ def J : Form1 X →ₗ[ℂ] G.P where @[simp] theorem J_apply (η : Form1 X) (i : Fin G.n) (z : G.K i) : - G.J η i z = coeffIn (G.e i) η z := rfl + G.J η i z = coeffIn (G.e i) η z := by rfl theorem norm_coeffIn_le_of_mem_K [CompactSpace X] (η : Form1 X) {i : Fin G.n} {z : ℂ} (hz : z ∈ G.K i) : ‖coeffIn (G.e i) η z‖ ≤ ‖G.J η‖ := diff --git a/LeanPool/JacobianDiffgeo/Forms/Genus.lean b/LeanPool/JacobianDiffgeo/Forms/Genus.lean index f23c51f7e6..30f6cce1dc 100644 --- a/LeanPool/JacobianDiffgeo/Forms/Genus.lean +++ b/LeanPool/JacobianDiffgeo/Forms/Genus.lean @@ -25,12 +25,13 @@ Main declarations: * `genus_eq_zero_iff_subsingleton` — `genus X = 0 ↔ Subsingleton (RS.Form1 X)`. -/ -@[expose] public section +public section open scoped ContDiff Manifold /-- The genus of a compact Riemann surface: the dimension of the space of global holomorphic 1-forms. -/ +@[expose] noncomputable def genus (X : Type*) [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ) ω X] : ℕ := Module.finrank ℂ (RS.Form1 X) diff --git a/LeanPool/JacobianDiffgeo/Forms/MDifferential.lean b/LeanPool/JacobianDiffgeo/Forms/MDifferential.lean index 4828873147..bc68fdfaea 100644 --- a/LeanPool/JacobianDiffgeo/Forms/MDifferential.lean +++ b/LeanPool/JacobianDiffgeo/Forms/MDifferential.lean @@ -25,7 +25,7 @@ Holomorphic 1-forms only — no meromorphic machinery here (meromorphic 1-forms `f • η` pairs in canonical-forms/meromorphic-trace). -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle open Set IsManifold @@ -128,7 +128,7 @@ def Form1.smulFun (f : X → ℂ) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) (η @[simp] theorem coeffIn_smulFun (e : OpenPartialHomeomorph X ℂ) (f : X → ℂ) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) (η : Form1 X) (z : ℂ) : - coeffIn e (Form1.smulFun f hf η) z = f (e.symm z) * coeffIn e η z := rfl + coeffIn e (Form1.smulFun f hf η) z = f (e.symm z) * coeffIn e η z := by rfl @[simp] theorem coeffAt_smulFun (x : X) (f : X → ℂ) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) (η : Form1 X) : diff --git a/LeanPool/JacobianDiffgeo/Forms/Montel.lean b/LeanPool/JacobianDiffgeo/Forms/Montel.lean index b7c3443eb8..07e1aff515 100644 --- a/LeanPool/JacobianDiffgeo/Forms/Montel.lean +++ b/LeanPool/JacobianDiffgeo/Forms/Montel.lean @@ -26,7 +26,7 @@ Main declarations: `C(K, ℂ)` (Cauchy estimate ⇒ equicontinuity ⇒ Arzelà–Ascoli). -/ -@[expose] public section +public section namespace RS @@ -45,6 +45,7 @@ theorem norm_deriv_le_of_bounded {Ω : Set ℂ} {g : ℂ → ℂ} {C : ℝ} (hΩ /-- The set of restrictions to a compact `K` of functions holomorphic on an open `Ω ⊇ K` and bounded by `C` there. -/ +@[expose] def montelFamily (Ω K : Set ℂ) (C : ℝ) : Set C(K, ℂ) := {f | ∃ g : ℂ → ℂ, DifferentiableOn ℂ g Ω ∧ (∀ z ∈ Ω, ‖g z‖ ≤ C) ∧ ∀ z : K, f z = g z} diff --git a/LeanPool/JacobianDiffgeo/Forms/OfCoeffs.lean b/LeanPool/JacobianDiffgeo/Forms/OfCoeffs.lean index f4b770ee86..02c36e2a9f 100644 --- a/LeanPool/JacobianDiffgeo/Forms/OfCoeffs.lean +++ b/LeanPool/JacobianDiffgeo/Forms/OfCoeffs.lean @@ -27,7 +27,7 @@ Main declarations: * `RS.Form1.ofCoeffs`, `RS.Form1.coeffIn_ofCoeffs`, `RS.Form1.coeffAt_ofCoeffs`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle open Set IsManifold @@ -72,7 +72,7 @@ def toSection (x : X) : TangentSpace 𝓘(ℂ) x →L[ℂ] Bundle.Trivial X ℂ theorem evalC_toSection (x : X) (w : ℂ) : evalC D.toSection x w = D.coeff (D.idx x) (D.chart (D.idx x) x) * - tangentCoord (mfderiv 𝓘(ℂ) 𝓘(ℂ) (D.chart (D.idx x)) x w) := rfl + tangentCoord (mfderiv 𝓘(ℂ) 𝓘(ℂ) (D.chart (D.idx x)) x w) := by rfl /-- **Master computation**: in any maximal-atlas chart `e'`, at a target point `z` whose base point lies in the `i`-th chart, the raw coefficient of `D.toSection` is the `i`-th coefficient diff --git a/LeanPool/JacobianDiffgeo/GenusSphereHeadline.lean b/LeanPool/JacobianDiffgeo/GenusSphereHeadline.lean index d8239276be..7bea28bc72 100644 --- a/LeanPool/JacobianDiffgeo/GenusSphereHeadline.lean +++ b/LeanPool/JacobianDiffgeo/GenusSphereHeadline.lean @@ -33,4 +33,4 @@ direction's finisher: `RS.homeoSphere_of_exists_simple_pole`). **Unit COMPLETE** be needed to slot it into the challenge file. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/GenusSphereHeadline/Basic.lean b/LeanPool/JacobianDiffgeo/GenusSphereHeadline/Basic.lean index b7ab58180d..6a3853c4e7 100644 --- a/LeanPool/JacobianDiffgeo/GenusSphereHeadline/Basic.lean +++ b/LeanPool/JacobianDiffgeo/GenusSphereHeadline/Basic.lean @@ -42,7 +42,7 @@ note). Assembles the two already-built halves: standing variables — a direct alias target for final assembly). -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/H1Genus.lean b/LeanPool/JacobianDiffgeo/H1Genus.lean index 68c924c79a..970f6268e4 100644 --- a/LeanPool/JacobianDiffgeo/H1Genus.lean +++ b/LeanPool/JacobianDiffgeo/H1Genus.lean @@ -31,4 +31,4 @@ produced, since it needs `H1Tail.equiv`'s full (unconditional) comparison, itsel addendum. See `Basic.lean`'s docstring for the full account. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/H1Genus/Basic.lean b/LeanPool/JacobianDiffgeo/H1Genus/Basic.lean index ca89b4d2bc..9198103571 100644 --- a/LeanPool/JacobianDiffgeo/H1Genus/Basic.lean +++ b/LeanPool/JacobianDiffgeo/H1Genus/Basic.lean @@ -35,7 +35,7 @@ scope for this challenge (per the orchestrator's 2026-07-08 addendum). Only the mentions Čech `H¹` — this gap does not block anything else in this project. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/Init.lean b/LeanPool/JacobianDiffgeo/Init.lean index e7f3e12241..b49a34143c 100644 --- a/LeanPool/JacobianDiffgeo/Init.lean +++ b/LeanPool/JacobianDiffgeo/Init.lean @@ -10,4 +10,4 @@ module Units live in subdirectories of `Jacobian/`; each unit has a root module `Jacobian/.lean` importing its files. See `CONVENTIONS.md`. --/@[expose] public section +-/public section diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial.lean b/LeanPool/JacobianDiffgeo/JacFunctorial.lean index 618c42c534..3200309edf 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial.lean @@ -130,4 +130,4 @@ reference chart and cancels a provably-nonzero transition factor. Anyone needing functoriality laws, `pushforward_pullback`) is gate-free. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/Challenge.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/Challenge.lean index aec94f0d68..20c227f094 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/Challenge.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/Challenge.lean @@ -29,7 +29,7 @@ unit** — see the root file's LEDGER and this builder's final report for the pr (`Form1.trace`'s branch-point analyticity and the trace–path-integral relation). -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/ChallengeLaws.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/ChallengeLaws.lean index dadc0d2a67..8937cab7f0 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/ChallengeLaws.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/ChallengeLaws.lean @@ -29,7 +29,7 @@ Unit: jacobian-functoriality. The remaining challenge exports Same-universe convention throughout (see `PeriodMaps.lean`'s universe warning). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Module @@ -191,9 +191,9 @@ theorem Jacobian.pushforward_pullback (f : X → Y) (hf : ContMDiff 𝓘(ℂ) (s := (RS.periodSubgroup Y).topologicalClosure) v := by exact map_nsmul (QuotientAddGroup.mk' _) (ContMDiff.degree f hf) v rw [h1] - exact map_nsmul (RS.uliftUpHom.toAddMonoidHom - (A := (Fin (genus Y) → ℂ) ⧸ (RS.periodSubgroup Y).topologicalClosure)) - (ContMDiff.degree f hf) _ + exact map_nsmul (AddEquiv.ulift + (α := (Fin (genus Y) → ℂ) ⧸ (RS.periodSubgroup Y).topologicalClosure)).symm.toAddMonoidHom + (ContMDiff.degree f hf) (QuotientAddGroup.mk v) end RS diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/Density.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/Density.lean index 63dfb54b83..a7c4d89fd0 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/Density.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/Density.lean @@ -34,7 +34,7 @@ hypothesis `coeffAt x η = coeffAt x η'` cancels it, reducing the comparison to argument (`tendsto_nhds_unique_of_eventuallyEq`). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter IsManifold diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/PeriodMaps.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/PeriodMaps.lean index a8ea65b1b9..875ba88651 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/PeriodMaps.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/PeriodMaps.lean @@ -27,7 +27,7 @@ trace–path-integral relation are not completed, so `pullbackT`/`Jacobian.pullb `pushforward_pullback` cannot be assembled here). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Module @@ -59,7 +59,7 @@ variable {Y : Type*} [TopologicalSpace Y] [T2Space Y] [CompactSpace Y] [Connecte /-- The induced `ℂ`-linear map on period spaces, from `Form1.pullback f hf`'s `dualMap` (contravariant: `Form1 Y →ₗ Form1 X` transposes to `Dual(Form1 X) →ₗ Dual(Form1 Y)`, exactly the pushforward direction). -/ -noncomputable def pushforwardT (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : +@[expose] noncomputable def pushforwardT (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : (Fin (genus X) → ℂ) →ₗ[ℂ] (Fin (genus Y) → ℂ) := (periodCoordEquiv Y).toLinearMap ∘ₗ ((Form1.pullback f hf).dualMap ∘ₗ (periodCoordEquiv X).symm.toLinearMap) @@ -114,7 +114,7 @@ variable {Y' : Type u} [TopologicalSpace Y'] [T2Space Y'] [CompactSpace Y'] [Con /-- **`Jacobian.pushforward` (§8.4)**: the pushforward map between Jacobians associated to a holomorphic map of the underlying curves. -/ -noncomputable def Jacobian.pushforward (f : X' → Y') (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : +@[expose] noncomputable def Jacobian.pushforward (f : X' → Y') (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : Jacobian X' →ₜ+ Jacobian Y' := Jacobian.inducedHom (periodSubgroup_le_comap_pushforwardT f hf) diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/Pullback.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/Pullback.lean index c5e363c234..9bdfd1778b 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/Pullback.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/Pullback.lean @@ -34,7 +34,7 @@ Main declarations: `RS.tangentCoord_mfderiv_comp`, reading the target through its own preferred chart. -/ -@[expose] public section +public section open scoped ContDiff Manifold Bundle open Set IsManifold @@ -235,7 +235,7 @@ noncomputable def Form1.pullback (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘( ring) @[simp] theorem Form1.pullback_apply (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) (η : Form1 Y) : - Form1.pullback f hf η = pullbackForm f hf η := rfl + Form1.pullback f hf η = pullbackForm f hf η := by rfl /-- The preferred-chart coefficient formula, restated for `Form1.pullback`. -/ theorem coeffAt_pullback (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) (η : Form1 Y) (x : X) : diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackIntegral.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackIntegral.lean index b82e630153..f064a687f2 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackIntegral.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackIntegral.lean @@ -18,7 +18,7 @@ primitive of `η` along `f ∘ K` pulls back to a primitive of `Form1.pullback f and its corollary `pathIntegral_pullback` (naturality of `pathIntegral` under pullback). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology unitInterval open Set Filter IsManifold diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackMaps.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackMaps.lean index b3549b0efa..c7d7b0db3e 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackMaps.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/PullbackMaps.lean @@ -25,7 +25,7 @@ via `RS.periodVector_traceForm_mem`, after conjugating the loop to a regular bas `PeriodMaps.lean`'s universe warning). -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Module @@ -44,7 +44,7 @@ variable {Y : Type*} [TopologicalSpace Y] [T2Space Y] [CompactSpace Y] [Connecte /-- The induced `ℂ`-linear map on period spaces for the pullback direction, from `Form1.trace f hf`'s `dualMap` (covariant trace transposes to the contravariant direction: `Dual (Form1 Y) →ₗ Dual (Form1 X)`, i.e. period space of `Y` to period space of `X`). -/ -noncomputable def pullbackT (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : +@[expose] noncomputable def pullbackT (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : (Fin (genus Y) → ℂ) →ₗ[ℂ] (Fin (genus X) → ℂ) := (periodCoordEquiv X).toLinearMap ∘ₗ ((Form1.trace f hf).dualMap ∘ₗ (periodCoordEquiv Y).symm.toLinearMap) @@ -123,7 +123,7 @@ variable {Y' : Type u} [TopologicalSpace Y'] [T2Space Y'] [CompactSpace Y'] [Con /-- **`Jacobian.pullback` (§8.4)**: the pullback map between Jacobians associated to a holomorphic map of the underlying curves. Equal to the zero map if the map on curves is constant (`Form1.trace`'s convention). -/ -noncomputable def Jacobian.pullback (f : X' → Y') (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : +@[expose] noncomputable def Jacobian.pullback (f : X' → Y') (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : Jacobian Y' →ₜ+ Jacobian X' := Jacobian.inducedHom (periodSubgroup_le_comap_pullbackT f hf) diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/Trace.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/Trace.lean index c1ad05540c..13733ae1a1 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/Trace.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/Trace.lean @@ -41,7 +41,7 @@ Main declarations: formula / functoriality laws / the trace–period relation). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter Metric IsManifold @@ -138,13 +138,13 @@ variable (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) (hne : ¬ ∃ c, ∀ x, f x = /-- The chart of the trace's coefficient data at index `y`: the preferred chart at `y`, restricted to the stack neighborhood `(stackAt hf hne y).V`. -/ -def traceChart (y : Y) : OpenPartialHomeomorph Y ℂ := +@[expose] def traceChart (y : Y) : OpenPartialHomeomorph Y ℂ := (chartAt ℂ y).restr (stackAt hf hne y).V -@[simp] theorem traceChart_coe (y : Y) : ⇑(traceChart hf hne y) = ⇑(chartAt ℂ y) := rfl +@[simp] theorem traceChart_coe (y : Y) : ⇑(traceChart hf hne y) = ⇑(chartAt ℂ y) := by rfl @[simp] theorem traceChart_symm_coe (y : Y) : - ⇑(traceChart hf hne y).symm = ⇑(chartAt ℂ y).symm := rfl + ⇑(traceChart hf hne y).symm = ⇑(chartAt ℂ y).symm := by rfl theorem traceChart_source (y : Y) : (traceChart hf hne y).source = (chartAt ℂ y).source ∩ (stackAt hf hne y).V := by @@ -168,7 +168,7 @@ theorem traceChart_mem_maximalAtlas (y : Y) : /-- The transition from the preferred chart's coordinate at `y` to the `i`-th branch's target chart coordinate. -/ -def branchTrans (y : Y) (i : Fin (stackAt hf hne y).n) : ℂ → ℂ := +@[expose] def branchTrans (y : Y) (i : Fin (stackAt hf hne y).n) : ℂ → ℂ := ⇑((stackAt hf hne y).A i).e' ∘ ⇑(chartAt ℂ y).symm theorem analyticAt_branchTrans (y : Y) {w : ℂ} (hw : w ∈ (traceChart hf hne y).target) @@ -186,7 +186,7 @@ theorem branchTrans_mem_ball (y : Y) {w : ℂ} (hw : w ∈ (traceChart hf hne y) /-- The coefficient of the trace in the chart at index `y`: the branch-transported sum of the repaired planar trace coefficients of `η`'s stack-chart coefficients. -/ -def traceCoeffFun (η : Form1 X) (y : Y) : ℂ → ℂ := fun w => +@[expose] def traceCoeffFun (η : Form1 X) (y : Y) : ℂ → ℂ := fun w => ∑ i, deriv (branchTrans hf hne y i) w * traceCoeff (coeffIn ((stackAt hf hne y).A i).e η) (multiplicity f ((stackAt hf hne y).pt i)) (branchTrans hf hne y i w) @@ -220,6 +220,7 @@ theorem analyticOnNhd_traceCoeffFun (η : Form1 X) (y : Y) : /-- The canonical (stack-independent) contribution of a fibre point `x` to the trace's coefficient in a target chart `e₀`: the coefficient of `η` at `x`, divided by the chart derivative of `f`. (Junk `0` at ramified `x`, where the chart derivative vanishes.) -/ +@[expose] def qCoeff (f : X → Y) (η : Form1 X) (e₀ : OpenPartialHomeomorph Y ℂ) (x : X) : ℂ := (deriv (⇑e₀ ∘ f ∘ ⇑(chartAt ℂ x).symm) (chartAt ℂ x x))⁻¹ * coeffAt x η diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/TraceCoeff.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/TraceCoeff.lean index d5f0a23936..2d0a365a65 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/TraceCoeff.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/TraceCoeff.lean @@ -35,7 +35,7 @@ proves the repair is genuinely analytic across `0`: `ℂ`-linearity in `h`, including at the repaired point `0` (by uniqueness of limits). -/ -@[expose] public section +public section open Filter Topology Set open RS.FormTrace RS.MTrace diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/TraceIntegral.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/TraceIntegral.lean index 9bb7d332b1..df0a671f03 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/TraceIntegral.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/TraceIntegral.lean @@ -34,7 +34,7 @@ Route (cheaper than the design's full `FiberChain`/monodromy construction, same loop. No cycle decomposition, no lifted-path concatenation. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology unitInterval open Set Filter Metric IsManifold @@ -129,7 +129,7 @@ def liftSeg (hm : multiplicity f (S.pt i) = 1) {a b : Y} (p : Path a b) omit [T2Space X] [CompactSpace X] [ConnectedSpace X] [IsManifold 𝓘(ℂ, ℂ) ω X] [T2Space Y] [IsManifold 𝓘(ℂ, ℂ) ω Y] in @[simp] theorem liftSeg_coe (hm : multiplicity f (S.pt i) = 1) {a b : Y} (p : Path a b) - (hV : ∀ s : I, p s ∈ S.V) : ⇑(liftSeg hm p hV) = fun s => sectionAt S i (p s) := rfl + (hV : ∀ s : I, p s ∈ S.V) : ⇑(liftSeg hm p hV) = fun s => sectionAt S i (p s) := by rfl /-! ### The segment lemma -/ @@ -263,7 +263,7 @@ def Path.segMap {a b : Y} (δ : Path a b) (t₀ t₁ : ℝ) : Path (δ.extend t omit [T2Space Y] [ChartedSpace ℂ Y] [IsManifold 𝓘(ℂ, ℂ) ω Y] in @[simp] theorem Path.segMap_coe {a b : Y} (δ : Path a b) (t₀ t₁ : ℝ) : - ⇑(Path.segMap δ t₀ t₁) = fun s : I => δ.extend ((1 - (s : ℝ)) * t₀ + (s : ℝ) * t₁) := rfl + ⇑(Path.segMap δ t₀ t₁) = fun s : I => δ.extend ((1 - (s : ℝ)) * t₀ + (s : ℝ) * t₁) := by rfl omit [T2Space Y] [ChartedSpace ℂ Y] [IsManifold 𝓘(ℂ, ℂ) ω Y] in theorem Path.segMap_mem_Icc {a b : Y} (_δ : Path a b) {t₀ t₁ : ℝ} (h : t₀ ≤ t₁) (s : I) : diff --git a/LeanPool/JacobianDiffgeo/JacFunctorial/TraceLaws.lean b/LeanPool/JacobianDiffgeo/JacFunctorial/TraceLaws.lean index 4bfdebf78b..53b8cd058a 100644 --- a/LeanPool/JacobianDiffgeo/JacFunctorial/TraceLaws.lean +++ b/LeanPool/JacobianDiffgeo/JacFunctorial/TraceLaws.lean @@ -28,7 +28,7 @@ All three are proved at regular values via `RS.coeffAt_traceForm_of_isRegularVal everywhere by `RS.Form1.eq_of_eqOn_dense` (density of regular values). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter Metric IsManifold diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction.lean index 145a15e91c..35dc77b14d 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction.lean @@ -85,4 +85,4 @@ abel-theorem, since it already needs period-naturality for its two-point argumen final-assembly addendum). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/Basic.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/Basic.lean index ed751ea2f7..4d042bbeb1 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/Basic.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/Basic.lean @@ -48,7 +48,7 @@ subgroup of a given `X`, Lean's instance search discharges all four automaticall needs to change here. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/ChartedSpaceKitV.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/ChartedSpaceKitV.lean index 0dfda70060..dd99851e9b 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/ChartedSpaceKitV.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/ChartedSpaceKitV.lean @@ -27,7 +27,7 @@ Namespace `RS` (Compat section, primed names to avoid clashing with Surface's or * `isManifold_of_family'`: family version. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set @@ -38,7 +38,7 @@ variable {Z : Type*} [TopologicalSpace Z] {ι : Type*} variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] /-- Package a covering family of `E`-valued charts as a `ChartedSpace`. -/ -@[reducible] def chartedSpaceOfFamily' (c : ι → OpenPartialHomeomorph Z E) (idx : Z → ι) +@[expose, reducible] def chartedSpaceOfFamily' (c : ι → OpenPartialHomeomorph Z E) (idx : Z → ι) (h : ∀ z, z ∈ (c (idx z)).source) : ChartedSpace E Z where atlas := Set.range c chartAt z := c (idx z) diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/Functorial.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/Functorial.lean index 9ba8a27885..6650bb12b5 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/Functorial.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/Functorial.lean @@ -23,7 +23,7 @@ blueprint unit currently owns "pullback of holomorphic `1`-forms along a holomor this unit's final report for the flag to the orchestrator. -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -48,10 +48,10 @@ def uliftDownHom : ULift.{u} G →ₜ+ G := continuous_toFun := (Homeomorph.ulift (X := G)).continuous } omit [IsTopologicalAddGroup G] in -@[simp] theorem uliftUpHom_apply (x : G) : uliftUpHom.{u} x = ULift.up x := rfl +@[simp] theorem uliftUpHom_apply (x : G) : uliftUpHom.{u} x = ULift.up x := by rfl omit [IsTopologicalAddGroup G] in -@[simp] theorem uliftDownHom_apply (x : ULift.{u} G) : uliftDownHom x = x.down := rfl +@[simp] theorem uliftDownHom_apply (x : ULift.{u} G) : uliftDownHom x = x.down := by rfl end RS @@ -69,7 +69,7 @@ functoriality substrate `Jacobian X →ₜ+ Jacobian Y`. The *closure*-level hyp `Torus.inducedHom` needs is derived from this one via minimality of the topological closure (`AddSubgroup.topologicalClosure_minimal`), since `(periodSubgroup Y).topologicalClosure` is already closed and `T` is continuous (finite-dimensional). -/ -noncomputable def inducedHom {T : (Fin (genus X) → ℂ) →ₗ[ℂ] (Fin (genus Y) → ℂ)} +@[expose] noncomputable def inducedHom {T : (Fin (genus X) → ℂ) →ₗ[ℂ] (Fin (genus Y) → ℂ)} (hT : RS.periodSubgroup X ≤ (RS.periodSubgroup Y).topologicalClosure.comap T.toAddMonoidHom) : Jacobian X →ₜ+ Jacobian Y := RS.uliftUpHom.comp diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/OfCurve.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/OfCurve.lean index fa8044f3da..53276b2e8f 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/OfCurve.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/OfCurve.lean @@ -30,7 +30,7 @@ lattice-shift computation as `Torus.contMDiff_add_torus`/`ULift.contMDiff_uliftU chart composite affine in `g (e z)`, hence analytic. -/ -@[expose] public section +public section open scoped ContDiff Manifold Convex Topology open IsManifold Metric Set Filter diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/Periods.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/Periods.lean index 1bfef32411..23cf038e9f 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/Periods.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/Periods.lean @@ -30,7 +30,7 @@ Main declarations: `periodVector (basis X)` over based loops at a fixed basepoint. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Module @@ -49,6 +49,7 @@ noncomputable def basis : Basis (Fin (genus X)) ℂ (Form1 X) := Module.finBasis /-- The period subgroup `Λ ≤ Fin (genus X) → ℂ`: the `ℤ`-span (as an additive subgroup) of the period vectors of based loops at a fixed basepoint. -/ +@[expose] def periodSubgroup : AddSubgroup (Fin (genus X) → ℂ) := AddSubgroup.closure (Set.range fun γ : Path (Classical.arbitrary X) (Classical.arbitrary X) => periodVector (basis X) γ) diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/Torus.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/Torus.lean index a83cba64ba..6bd4d4368d 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/Torus.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/Torus.lean @@ -36,7 +36,7 @@ fire once a caller supplies them — which is exactly the hook period-lattice-ra establishes discreteness/full-rank for the actual period subgroup. -/ -@[expose] public section +public section open scoped ContDiff Manifold Pointwise open Set Filter Topology Metric @@ -143,24 +143,25 @@ def rawChartAux (x : V) : OpenPartialHomeomorph V (V ⧸ L) := Metric.isOpen_ball omit [NormedSpace ℂ V] in -@[simp] theorem rawChartAux_apply (x z : V) : rawChartAux L x z = QuotientAddGroup.mk z := rfl +@[simp] theorem rawChartAux_apply (x z : V) : rawChartAux L x z = QuotientAddGroup.mk z := by rfl omit [NormedSpace ℂ V] in -@[simp] theorem rawChartAux_source (x : V) : (rawChartAux L x).source = ball x (injRadius L) := rfl +@[simp] theorem rawChartAux_source (x : V) : (rawChartAux L x).source = ball x (injRadius L) := by + rfl /-- The chart at representative `x : V`: sends a class near `x` to its unique representative in `ball x (injRadius L)`. -/ def chartAt' (x : V) : OpenPartialHomeomorph (V ⧸ L) V := (rawChartAux L x).symm omit [NormedSpace ℂ V] in -@[simp] theorem chartAt'_symm (x : V) : (chartAt' L x).symm = rawChartAux L x := rfl +@[simp] theorem chartAt'_symm (x : V) : (chartAt' L x).symm = rawChartAux L x := by rfl omit [NormedSpace ℂ V] in @[simp] theorem chartAt'_source (x : V) : - (chartAt' L x).source = QuotientAddGroup.mk '' ball x (injRadius L) := rfl + (chartAt' L x).source = QuotientAddGroup.mk '' ball x (injRadius L) := by rfl omit [NormedSpace ℂ V] in -@[simp] theorem chartAt'_target (x : V) : (chartAt' L x).target = ball x (injRadius L) := rfl +@[simp] theorem chartAt'_target (x : V) : (chartAt' L x).target = ball x (injRadius L) := by rfl omit [NormedSpace ℂ V] in /-- The defining property of `chartAt'`: on a representative `z` inside the ball, the chart diff --git a/LeanPool/JacobianDiffgeo/JacobianConstruction/ULift.lean b/LeanPool/JacobianDiffgeo/JacobianConstruction/ULift.lean index d19a59aafd..7edf5dfd75 100644 --- a/LeanPool/JacobianDiffgeo/JacobianConstruction/ULift.lean +++ b/LeanPool/JacobianDiffgeo/JacobianConstruction/ULift.lean @@ -31,7 +31,7 @@ continuous maps, so every chart composite involving them cancels by `rfl`. Conse analyticity computation. -/ -@[expose] public section +public section open scoped ContDiff Manifold Pointwise open Set Filter Topology Metric @@ -49,6 +49,7 @@ variable (L : AddSubgroup V) [DiscreteTopology L] /-- The chart family for `ULift (V ⧸ L)`: `chartAt' L x`, transported through `Homeomorph.ulift`. -/ +@[expose] def uliftChartAt (x : V) : OpenPartialHomeomorph (ULift.{u} (V ⧸ L)) V := (Homeomorph.ulift (X := V ⧸ L)).toOpenPartialHomeomorph.trans (chartAt' L x) @@ -70,7 +71,7 @@ omit [CompleteSpace V] [NormedSpace ℂ V] in /-- `Homeomorph.ulift`'s associated `OpenPartialHomeomorph.symm`, precomposed into a `uliftChartAt`, cancels by `rfl` (`PartialEquiv.coe_trans_symm`). -/ theorem uliftChartAt_symm_apply (x w : V) : - (uliftChartAt L x).symm w = ULift.up ((chartAt' L x).symm w) := rfl + (uliftChartAt L x).symm w = ULift.up ((chartAt' L x).symm w) := by rfl omit [CompleteSpace V] [NormedSpace ℂ V] in theorem uliftChartAt_target (x : V) : (uliftChartAt L x).target = (chartAt' L x).target := by diff --git a/LeanPool/JacobianDiffgeo/LaurentTail.lean b/LeanPool/JacobianDiffgeo/LaurentTail.lean index 4d98319666..61cca082bb 100644 --- a/LeanPool/JacobianDiffgeo/LaurentTail.lean +++ b/LeanPool/JacobianDiffgeo/LaurentTail.lean @@ -80,4 +80,4 @@ dimension-counting endgame). `mulTail`/`mulTailEquiv` are deliberately not built accounted for in that unit's design. `firstFormRR`/`g0` remain gated on `H1Tail.equiv` too. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/LaurentTail/Comparison.lean b/LeanPool/JacobianDiffgeo/LaurentTail/Comparison.lean index 4a249f0471..c67bf0edd9 100644 --- a/LeanPool/JacobianDiffgeo/LaurentTail/Comparison.lean +++ b/LeanPool/JacobianDiffgeo/LaurentTail/Comparison.lean @@ -60,7 +60,7 @@ accumulating ~25 `have`/`set` steps hits a severe elaboration performance wall r helpers (`alphaPatch`/`mlSumCochain`/…) were already structured — restores normal compile times. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace RS.Cech @@ -124,7 +124,7 @@ theorem mlClass_res {D D' : RS.Divisor X} {𝒰 𝒱 : RS.Cech.FinCover (⊤ : O /-! ### The per-point construction: realizing a clean representative -/ /-- The 2-member cover `{V, X ∖ {p}}`, used to realize a single tail datum at `p`. -/ -@[reducible] noncomputable def pairCover (p : X) (V : Opens X) (hpV : p ∈ V) : +@[expose, reducible] noncomputable def pairCover (p : X) (V : Opens X) (hpV : p ∈ V) : RS.Cech.FinCover (⊤ : Opens X) where n := 2 U := ![V, ⟨{p}ᶜ, isOpen_compl_singleton⟩] @@ -347,12 +347,12 @@ theorem restrict_ψ_mem_linSysOn (D : RS.Divisor X) (p : X) omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] [CompactSpace X] [ConnectedSpace X] in theorem gOf_apply_zero (p : X) (V : Opens X) (hpV : p ∈ V) (D' : RS.Divisor X) (ψV : RS.LinSysOn D' (V : Set X)) : - gOf p V hpV D' ψV (0 : Fin 2) = ψV := rfl + gOf p V hpV D' ψV (0 : Fin 2) = ψV := by rfl omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] [CompactSpace X] [ConnectedSpace X] in theorem gOf_apply_one (p : X) (V : Opens X) (hpV : p ∈ V) (D' : RS.Divisor X) (ψV : RS.LinSysOn D' (V : Set X)) : - gOf p V hpV D' ψV (1 : Fin 2) = 0 := rfl + gOf p V hpV D' ψV (1 : Fin 2) = 0 := by rfl /-- `ψ` restricted to its clean neighbourhood, as a section of the auxiliary linear system. -/ noncomputable def ψVOf (D : RS.Divisor X) (p : X) (ψ : RS.MeroGermOn X (chartAt ℂ p).source) : @@ -674,7 +674,7 @@ noncomputable def mlClassAtRaw (D : RS.Divisor X) (p : X) : omit [ConnectedSpace X] in theorem mlClassAtRaw_apply (D : RS.Divisor X) (p : X) (ψ : RS.MeroGermOn X (chartAt ℂ p).source) : - mlClassAtRaw D p ψ = mlClassAt D p ψ := rfl + mlClassAtRaw D p ψ = mlClassAt D p ψ := by rfl /-- The tail-to-cohomology map at a single point. -/ noncomputable def tailAtToH1 (D : RS.Divisor X) (p : X) : TailAt p D →ₗ[ℂ] RS.Cech.H1 D := diff --git a/LeanPool/JacobianDiffgeo/LaurentTail/RiemannRoch.lean b/LeanPool/JacobianDiffgeo/LaurentTail/RiemannRoch.lean index 4dffe76193..56a4d69bca 100644 --- a/LeanPool/JacobianDiffgeo/LaurentTail/RiemannRoch.lean +++ b/LeanPool/JacobianDiffgeo/LaurentTail/RiemannRoch.lean @@ -61,4 +61,4 @@ no new analysis, per the design doc §0/§6's own explicit recommendation not to Miranda's finiteness route independently. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/LaurentTail/TailSpace.lean b/LeanPool/JacobianDiffgeo/LaurentTail/TailSpace.lean index 1b8b318f22..b2af045272 100644 --- a/LeanPool/JacobianDiffgeo/LaurentTail/TailSpace.lean +++ b/LeanPool/JacobianDiffgeo/LaurentTail/TailSpace.lean @@ -32,7 +32,7 @@ own `mulInto` (built directly on `T D`/`TailAt p D` from this file) supersedes ` is a genuine scope relief, not a shortfall. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace @@ -54,7 +54,7 @@ noncomputable abbrev TailAt (p : X) (D : RS.Divisor X) : Type _ := RS.MeroGermOn X (chartAt ℂ p).source ⧸ RS.Cech.ordGe p (-(D p)) /-- The quotient map onto `TailAt p D`. -/ -noncomputable def TailAt.mk (p : X) (D : RS.Divisor X) : +@[expose] noncomputable def TailAt.mk (p : X) (D : RS.Divisor X) : RS.MeroGermOn X (chartAt ℂ p).source →ₗ[ℂ] TailAt p D := Submodule.mkQ _ omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] in @@ -81,7 +81,7 @@ noncomputable def windowAtToTailAt (p : X) (D : RS.Divisor X) (d' : ℤ) : omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem windowAtToTailAt_mk (p : X) (D : RS.Divisor X) (d' : ℤ) (ψ : RS.Cech.ordGe p (-d')) : - windowAtToTailAt p D d' (RS.Cech.WindowAt.mk p (D p) d' ψ) = TailAt.mk p D ψ := rfl + windowAtToTailAt p D d' (RS.Cech.WindowAt.mk p (D p) d' ψ) = TailAt.mk p D ψ := by rfl omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] in /-- Every tail class is *represented* by some finite window (the union-of-`ordGe` fact): every @@ -136,7 +136,7 @@ variable [CompactSpace X] /-- The finite skyscraper `Window D D'` embeds in the full tail space `T D` — the bridge that lets a future bridge file derive the tail-level six-term sequence from Cech's own (instead of re-proving it). -/ -noncomputable def windowToT (D D' : RS.Divisor X) (_h : D ≤ D') : +@[expose] noncomputable def windowToT (D D' : RS.Divisor X) (_h : D ≤ D') : RS.Cech.Window D D' →ₗ[ℂ] T D where toFun w := T.mk D (RS.Cech.diffSupp D D') (fun q => windowAtToTailAt (q : X) D (D' q) (w q)) diff --git a/LeanPool/JacobianDiffgeo/LaurentTail/Truncation.lean b/LeanPool/JacobianDiffgeo/LaurentTail/Truncation.lean index 00fde97b16..aae1fcd011 100644 --- a/LeanPool/JacobianDiffgeo/LaurentTail/Truncation.lean +++ b/LeanPool/JacobianDiffgeo/LaurentTail/Truncation.lean @@ -24,7 +24,7 @@ Unit: laurent-tails (`docs/design/laurent-tails.md`). `Cech.H1 D` is `Comparison.lean`'s job). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace @@ -97,7 +97,7 @@ noncomputable def alphaL (D : RS.Divisor X) : RS.Mero X →ₗ[ℂ] T D where rw [DFinsupp.smul_apply, alpha_apply, alpha_apply, map_smul, map_smul] rfl -@[simp] theorem alphaL_apply (D : RS.Divisor X) (f : RS.Mero X) : alphaL D f = alpha D f := rfl +@[simp] theorem alphaL_apply (D : RS.Divisor X) (f : RS.Mero X) : alphaL D f = alpha D f := by rfl /-- Miranda PDF 192: `L(D) = ker(α_D)`. -/ theorem ker_alphaL_eq_linSys (D : RS.Divisor X) : @@ -119,7 +119,7 @@ theorem ker_alphaL_eq_linSys (D : RS.Divisor X) : /-- Miranda's `H¹(D) := T[D]/α_D(ℳ)` (PDF 192-193). The comparison to `Cech.H1 D` (`RS.Cech.H1`) is `Comparison.lean`'s job. -/ -noncomputable def H1Tail (D : RS.Divisor X) : Type _ := T D ⧸ LinearMap.range (alphaL D) +@[expose] noncomputable def H1Tail (D : RS.Divisor X) : Type _ := T D ⧸ LinearMap.range (alphaL D) noncomputable instance instAddCommGroupH1Tail (D : RS.Divisor X) : AddCommGroup (H1Tail D) := inferInstanceAs (AddCommGroup (T D ⧸ LinearMap.range (alphaL D))) @@ -128,7 +128,7 @@ noncomputable instance instModuleH1Tail (D : RS.Divisor X) : Module ℂ (H1Tail inferInstanceAs (Module ℂ (T D ⧸ LinearMap.range (alphaL D))) /-- The quotient map onto `H¹Tail(D)`. -/ -noncomputable def H1Tail.mk (D : RS.Divisor X) : T D →ₗ[ℂ] H1Tail D := Submodule.mkQ _ +@[expose] noncomputable def H1Tail.mk (D : RS.Divisor X) : T D →ₗ[ℂ] H1Tail D := Submodule.mkQ _ theorem H1Tail.mk_surjective (D : RS.Divisor X) : Function.Surjective (H1Tail.mk D) := Submodule.mkQ_surjective _ diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity.lean index a373815d6c..ca567234a8 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity.lean @@ -40,4 +40,4 @@ API summary (see `docs/design/local-multiplicity.md`): `LMCompat` copy of the CC7 holomorphy bridge (canonical version: `Jacobian.Surface`). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity/AdaptedCharts.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity/AdaptedCharts.lean index 18cb1c5739..fe353f1ecb 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity/AdaptedCharts.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity/AdaptedCharts.lean @@ -26,7 +26,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic multiplicity). -/ -@[expose] public section +public section open Filter Set OpenPartialHomeomorph Metric open scoped ContDiff Manifold Topology diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity/ChartBridge.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity/ChartBridge.lean index 2d5a2aff63..256a8c9fa6 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity/ChartBridge.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity/ChartBridge.lean @@ -30,7 +30,7 @@ public import Mathlib.Geometry.Manifold.ContMDiff.Defs * `RS.map_nhdsNE` — an `OpenPartialHomeomorph` maps `𝓝[≠] x` to `𝓝[≠] (e x)` on its source. -/ -@[expose] public section +public section open Filter Set OpenPartialHomeomorph open scoped ContDiff Manifold Topology @@ -43,7 +43,7 @@ variable {X Y : Type*} /-- `F` read in the standard charts at `x` and `F x`, recentered to vanish at `chartAt ℂ x x`. Junk (from the charts' junk values) away from the chart sources; only its germ matters. -/ -noncomputable def inChartAt (F : X → Y) (x : X) : ℂ → ℂ := +@[expose] noncomputable def inChartAt (F : X → Y) (x : X) : ℂ → ℂ := fun z ↦ chartAt ℂ (F x) (F ((chartAt ℂ x).symm z)) - chartAt ℂ (F x) (F x) @[simp] theorem inChartAt_apply_chart (F : X → Y) (x : X) : diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity/Composition.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity/Composition.lean index da5b426257..3fad606638 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity/Composition.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity/Composition.lean @@ -29,7 +29,7 @@ import Mathlib.RingTheory.RootsOfUnity.Complex `mult F y = 1` (mapping-degree's "critical values are discrete" seed). -/ -@[expose] public section +public section open Filter Set OpenPartialHomeomorph Metric open scoped ContDiff Manifold Topology diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity/KthRoot.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity/KthRoot.lean index 16c6f84d9d..e60c69449c 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity/KthRoot.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity/KthRoot.lean @@ -24,7 +24,7 @@ Only `log (u z / a)` (value near `1`, inside `slitPlane`) needs *analyticity* of `exp (log a) = a` holds for every nonzero constant, so no case split on `arg (u z₀)` is needed. -/ -@[expose] public section +public section open Filter Complex open scoped Topology diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity/Multiplicity.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity/Multiplicity.lean index 05bc4bc83f..d0902a8791 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity/Multiplicity.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity/Multiplicity.lean @@ -30,7 +30,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic * CC3 compatibility: `RS.meromorphicOrderAt_chart_sub`, `RS.meromorphicOrderAt_chart_of_eq_zero`. -/ -@[expose] public section +public section open Filter Set OpenPartialHomeomorph open scoped ContDiff Manifold Topology @@ -43,15 +43,16 @@ variable {X Y : Type*} /-- ℕ∞-valued local multiplicity (CC4). `⊤` iff `F` is holomorphic and locally constant at `x`; `0` iff `inChartAt F x` is not analytic (junk). Honest value: the vanishing order `k ≥ 1`. -/ -noncomputable def multiplicityENat (F : X → Y) (x : X) : ℕ∞ := +@[expose] noncomputable def multiplicityENat (F : X → Y) (x : X) : ℕ∞ := analyticOrderAt (inChartAt F x) (chartAt ℂ x x) /-- CC4's `multiplicity F x : ℕ`: the order when finite; junk `0` when `F` is locally constant at `x` (order `⊤`) or not holomorphic at `x` (order junk `0`). -/ +@[expose] noncomputable def multiplicity (F : X → Y) (x : X) : ℕ := (multiplicityENat F x).toNat /-- `F` is ramified at `x` iff its local multiplicity is at least `2`. -/ -def IsRamifiedAt (F : X → Y) (x : X) : Prop := 2 ≤ multiplicity F x +@[expose] def IsRamifiedAt (F : X → Y) (x : X) : Prop := 2 ≤ multiplicity F x theorem multiplicityENat_def (F : X → Y) (x : X) : multiplicityENat F x = analyticOrderAt (inChartAt F x) (chartAt ℂ x x) := rfl diff --git a/LeanPool/JacobianDiffgeo/LocalMultiplicity/PlanarNormalForm.lean b/LeanPool/JacobianDiffgeo/LocalMultiplicity/PlanarNormalForm.lean index 52c707045e..60d6f79a57 100644 --- a/LeanPool/JacobianDiffgeo/LocalMultiplicity/PlanarNormalForm.lean +++ b/LeanPool/JacobianDiffgeo/LocalMultiplicity/PlanarNormalForm.lean @@ -28,7 +28,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic * `RS.image_pow_ball`: `(· ^ k)` maps `ball 0 ρ` onto `ball 0 (ρ ^ k)`. -/ -@[expose] public section +public section open Filter Complex Metric open scoped Topology diff --git a/LeanPool/JacobianDiffgeo/MappingDegree.lean b/LeanPool/JacobianDiffgeo/MappingDegree.lean index 9c83239b11..bfd3d75024 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree.lean @@ -56,4 +56,4 @@ structure; paths-and-integrals/abel-weak consume `branchLocus_finite` and `isCoveringMapOn_compl_branchLocus`. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/Basics.lean b/LeanPool/JacobianDiffgeo/MappingDegree/Basics.lean index b177395fca..cf45705299 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/Basics.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/Basics.lean @@ -34,7 +34,7 @@ Surface perfectness (`(𝓝[≠] x).NeBot`) is NOT re-proved here: surfaces-and- provides the instance `RS.nhdsNE_neBot` for any `ChartedSpace ℂ` space. -/ -@[expose] public section +public section open Filter Set Function open scoped ContDiff Manifold Topology @@ -51,11 +51,11 @@ variable {X Y : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] /-- Total multiplicity of `F` over `y` (the fiber-sum). Junk-free by convention: for holomorphic nonconstant `F` on compact `X` the fiber is finite and every summand is `≥ 1`; for constant `F` all summands are junk `0` (CC4), so the value is `0`. -/ -noncomputable def fiberMultSum (F : X → Y) (y : Y) : ℕ := +@[expose] noncomputable def fiberMultSum (F : X → Y) (y : Y) : ℕ := ∑ᶠ x ∈ F ⁻¹' {y}, multiplicity F x theorem fiberMultSum_def (F : X → Y) (y : Y) : - fiberMultSum F y = ∑ᶠ x ∈ F ⁻¹' {y}, multiplicity F x := rfl + fiberMultSum F y = ∑ᶠ x ∈ F ⁻¹' {y}, multiplicity F x := by rfl theorem fiberMultSum_eq_finset_sum {F : X → Y} {y : Y} (hfin : (F ⁻¹' {y}).Finite) : fiberMultSum F y = ∑ x ∈ hfin.toFinset, multiplicity F x := diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/Covering.lean b/LeanPool/JacobianDiffgeo/MappingDegree/Covering.lean index 7cc4c5c3e0..0d4760a2e4 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/Covering.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/Covering.lean @@ -33,7 +33,7 @@ Downstream may further compose with mathlib's `IsCoveringMapOn.isCoveringMap_res with `Topology/Homotopy/Lifting.lean` for path/homotopy lifting — no extra exports needed here. -/ -@[expose] public section +public section open Filter Set Function open scoped ContDiff Manifold Topology diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/Degree.lean b/LeanPool/JacobianDiffgeo/MappingDegree/Degree.lean index 0e6ec3676d..59f347c7a6 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/Degree.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/Degree.lean @@ -33,7 +33,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic `[CompactSpace Y]`, the only statement in the unit that does). -/ -@[expose] public section +public section open Filter Set Function open scoped ContDiff Manifold Topology @@ -57,7 +57,7 @@ noncomputable def degree (F : X → Y) : ℕ := fiberMultSum F (Classical.arbitr omit [T2Space X] [CompactSpace X] [ConnectedSpace X] [IsManifold 𝓘(ℂ) ω X] [T2Space Y] [IsManifold 𝓘(ℂ) ω Y] in -theorem degree_def (F : X → Y) : degree F = fiberMultSum F (Classical.arbitrary Y) := rfl +theorem degree_def (F : X → Y) : degree F = fiberMultSum F (Classical.arbitrary Y) := by rfl omit [T2Space X] [CompactSpace X] [ConnectedSpace X] [IsManifold 𝓘(ℂ) ω X] [T2Space Y] [IsManifold 𝓘(ℂ) ω Y] in @@ -164,7 +164,7 @@ noncomputable def homeomorphOfDegreeEqOne (hF : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω theorem coe_homeomorphOfDegreeEqOne (hF : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω F) (hne : ¬ ∃ c, ∀ x, F x = c) (h1 : degree F = 1) : - ⇑(homeomorphOfDegreeEqOne hF hne h1) = F := rfl + ⇑(homeomorphOfDegreeEqOne hF hne h1) = F := by rfl theorem isHomeomorph_of_degree_eq_one (hF : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω F) (hne : ¬ ∃ c, ∀ x, F x = c) (h1 : degree F = 1) : IsHomeomorph F := diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/LocalConstancy.lean b/LeanPool/JacobianDiffgeo/MappingDegree/LocalConstancy.lean index 6918666482..9ab9d16f66 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/LocalConstancy.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/LocalConstancy.lean @@ -32,7 +32,7 @@ connected `Y` — the well-definedness theorem for `degree`. `y : Y` (needs `[ConnectedSpace Y]`). -/ -@[expose] public section +public section open Filter Set Function open scoped ContDiff Manifold Topology diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/LocalStructure.lean b/LeanPool/JacobianDiffgeo/MappingDegree/LocalStructure.lean index 3d3d1bf914..a1fb2d4028 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/LocalStructure.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/LocalStructure.lean @@ -31,7 +31,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic `fiberMultSum` is locally constant. -/ -@[expose] public section +public section open Filter Set Function open scoped ContDiff Manifold Topology diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/Ramification.lean b/LeanPool/JacobianDiffgeo/MappingDegree/Ramification.lean index 592f902fcf..041d3be929 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/Ramification.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/Ramification.lean @@ -29,7 +29,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic existence `RS.exists_isRegularValue`. -/ -@[expose] public section +public section open Filter Set Function open scoped ContDiff Manifold Topology @@ -44,15 +44,17 @@ variable {X Y : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [TopologicalSpace Y] [ChartedSpace ℂ Y] /-- Points where `F` is ramified (local multiplicity `≥ 2`, CC4's `IsRamifiedAt`). -/ +@[expose] def ramificationLocus (F : X → Y) : Set X := {x | IsRamifiedAt F x} /-- Branch values (critical values): images of ramification points. -/ -def branchLocus (F : X → Y) : Set Y := F '' ramificationLocus F +@[expose] def branchLocus (F : X → Y) : Set Y := F '' ramificationLocus F /-- `y` is a regular value iff every point of its fiber is unramified. (For holomorphic nonconstant `F` this is equivalent to `y ∉ branchLocus F`, and then every fiber point has multiplicity exactly `1`.) Values NOT attained are regular (empty fiber) — harmless, since for nonconstant `F` every value is attained. -/ +@[expose] def IsRegularValue (F : X → Y) (y : Y) : Prop := ∀ x ∈ F ⁻¹' {y}, ¬ IsRamifiedAt F x theorem mem_ramificationLocus_iff {F : X → Y} {x : X} : diff --git a/LeanPool/JacobianDiffgeo/MappingDegree/RootCounting.lean b/LeanPool/JacobianDiffgeo/MappingDegree/RootCounting.lean index 24a85f2b2b..8c2a270b1a 100644 --- a/LeanPool/JacobianDiffgeo/MappingDegree/RootCounting.lean +++ b/LeanPool/JacobianDiffgeo/MappingDegree/RootCounting.lean @@ -33,7 +33,7 @@ This file has zero project imports; `LocalConstancy.lean` bridges `analyticOrder `RS.multiplicity` via local-multiplicity's chart invariance. -/ -@[expose] public section +public section open Filter Set Polynomial open scoped Topology diff --git a/LeanPool/JacobianDiffgeo/Meromorphic.lean b/LeanPool/JacobianDiffgeo/Meromorphic.lean index d802041560..11f2c80e27 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic.lean @@ -58,4 +58,4 @@ Every export listed in the design doc §4.1–§4.7 and the six hard proof plans including gluing) is proved; zero sorries. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/CodiscreteBridge.lean b/LeanPool/JacobianDiffgeo/Meromorphic/CodiscreteBridge.lean index 40945324b2..93a9ae36b9 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/CodiscreteBridge.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/CodiscreteBridge.lean @@ -28,7 +28,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.2, `Field (ℳ X)` and `divisor` well-definedness. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/Divisor.lean b/LeanPool/JacobianDiffgeo/Meromorphic/Divisor.lean index c268f44d14..69b6cc8b76 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/Divisor.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/Divisor.lean @@ -27,7 +27,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.6, `finite_setOf_ord_neg/pos`, `eventually_ord_eq_zero`). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology @@ -201,15 +201,15 @@ noncomputable def divisorOn [T1Space X] [IsManifold 𝓘(ℂ) ω X] (φ : MeroGe rw [hempty]; exact Set.finite_empty @[simp] theorem divisorOn_apply [T1Space X] [IsManifold 𝓘(ℂ) ω X] (φ : MeroGermOn X U) (x : X) : - φ.divisorOn x = (φ.ord x).untop₀ := rfl + φ.divisorOn x = (φ.ord x).untop₀ := by rfl end MeroGermOn /-- CC3's `div : ℳ X → Divisor X` (renamed `divisor`; total, `divisor 0 = 0` honestly). -/ noncomputable abbrev divisor [T1Space X] [IsManifold 𝓘(ℂ) ω X] (φ : ℳ X) : Divisor X := φ.divisorOn -@[simp] theorem divisor_apply [T1Space X] [IsManifold 𝓘(ℂ) ω X] (φ : ℳ X) (x : X) : - divisor φ x = (φ.ord x).untop₀ := rfl +theorem divisor_apply [T1Space X] [IsManifold 𝓘(ℂ) ω X] (φ : ℳ X) (x : X) : + divisor φ x = (φ.ord x).untop₀ := by rfl @[simp] theorem divisor_zero [T1Space X] [IsManifold 𝓘(ℂ) ω X] : divisor (0 : ℳ X) = 0 := by diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/Field.lean b/LeanPool/JacobianDiffgeo/Meromorphic/Field.lean index e55c3af465..e029e04d95 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/Field.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/Field.lean @@ -21,7 +21,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.5) zero class (`Mero.ord_eq_top_iff`) and gives `mul_inv_cancel₀`, assembling `Field (ℳ X)`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/GermSpace.lean b/LeanPool/JacobianDiffgeo/Meromorphic/GermSpace.lean index cd353e326d..ae8009d41a 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/GermSpace.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/GermSpace.lean @@ -29,7 +29,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.3, maps), with `restrict_mk`, `restrict_restrict`, `restrict_id`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology @@ -62,6 +62,7 @@ variable {U V : Set X} {f g : X → ℂ} variable (X) in /-- Germs over `codiscreteWithin U` admitting a meromorphic representative. -/ +@[expose] noncomputable def meroGermSubalgebra (U : Set X) : Subalgebra ℂ (Filter.Germ (Filter.codiscreteWithin U) ℂ) where carrier := {γ | ∃ f, MeromorphicOnX f U ∧ γ = (f : Filter.Germ (codiscreteWithin U) ℂ)} @@ -75,6 +76,7 @@ noncomputable def meroGermSubalgebra (U : Set X) : variable (X) in /-- The space of meromorphic germ classes on `U` (CC3 relativized; junk-free). -/ +@[expose] def MeroGermOn (U : Set X) : Type _ := meroGermSubalgebra X U variable (X) in @@ -100,6 +102,7 @@ instance instNontrivialMero [Nonempty X] : Nontrivial (ℳ X) := by namespace MeroGermOn /-- Constructor: the class of a meromorphic function. -/ +@[expose] noncomputable def mk (f : X → ℂ) (hf : MeromorphicOnX f U) : MeroGermOn X U := ⟨(f : Filter.Germ (codiscreteWithin U) ℂ), f, hf, rfl⟩ @@ -166,7 +169,7 @@ end MeroGermOn /-- The germ-level restriction map: pulling back a `codiscreteWithin U`-germ to a `codiscreteWithin V`-germ, for `V ⊆ U`. Meromorphy-free. -/ -noncomputable def restrictGerm (h : V ⊆ U) (γ : Filter.Germ (codiscreteWithin U) ℂ) : +@[expose] noncomputable def restrictGerm (h : V ⊆ U) (γ : Filter.Germ (codiscreteWithin U) ℂ) : Filter.Germ (codiscreteWithin V) ℂ := γ.liftOn (fun f => (f : Filter.Germ (codiscreteWithin V) ℂ)) (fun _f _g hfg => Filter.Germ.coe_eq.2 (hfg.filter_mono (codiscreteWithin_mono h))) @@ -174,7 +177,7 @@ noncomputable def restrictGerm (h : V ⊆ U) (γ : Filter.Germ (codiscreteWithin omit [ChartedSpace ℂ X] in @[simp] theorem restrictGerm_coe (h : V ⊆ U) (f : X → ℂ) : restrictGerm h (f : Filter.Germ (codiscreteWithin U) ℂ) = - (f : Filter.Germ (codiscreteWithin V) ℂ) := rfl + (f : Filter.Germ (codiscreteWithin V) ℂ) := by rfl omit [ChartedSpace ℂ X] in theorem restrictGerm_add (h : V ⊆ U) (γ₁ γ₂ : Filter.Germ (codiscreteWithin U) ℂ) : @@ -210,7 +213,7 @@ theorem restrictGerm_mem (h : V ⊆ U) {γ : Filter.Germ (codiscreteWithin U) namespace MeroGermOn /-- Restriction to a smaller open set (Čech's structure maps). -/ -noncomputable def restrict (h : V ⊆ U) : MeroGermOn X U →ₐ[ℂ] MeroGermOn X V where +@[expose] noncomputable def restrict (h : V ⊆ U) : MeroGermOn X U →ₐ[ℂ] MeroGermOn X V where toFun φ := ⟨restrictGerm h φ.1, restrictGerm_mem h φ.2⟩ map_one' := Subtype.ext (restrictGerm_one h) map_mul' φ ψ := Subtype.ext (restrictGerm_mul h φ.1 ψ.1) diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/Gluing.lean b/LeanPool/JacobianDiffgeo/Meromorphic/Gluing.lean index ef1583c2c2..adaa5025b8 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/Gluing.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/Gluing.lean @@ -22,7 +22,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.4, * `MeroGermOn.glue_unique`: the glued class is unique. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/LinSysMulEquiv.lean b/LeanPool/JacobianDiffgeo/Meromorphic/LinSysMulEquiv.lean index 1cbc140000..b703a8c96e 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/LinSysMulEquiv.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/LinSysMulEquiv.lean @@ -17,7 +17,7 @@ multiplication by `φ` is a `ℂ`-linear equivalence `L(D) ≃ₗ L(D - divisor vocabulary; riemann-roch's lattice tool). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology @@ -29,8 +29,9 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [T1Space X] [IsMa theorem mul_mem_linSys_sub_divisor [ConnectedSpace X] {φ : ℳ X} (hφ : φ ≠ 0) {D : Divisor X} {ψ : ℳ X} (hψ : ψ ∈ LinSys D) : φ * ψ ∈ LinSys (D - divisor φ) := by intro x - have hφx : ((divisor φ x : ℤ) : WithTop ℤ) = φ.ord x := - WithTop.coe_untop₀_of_ne_top (Mero.ord_ne_top hφ x) + have hφx : ((divisor φ x : ℤ) : WithTop ℤ) = φ.ord x := by + simpa only [divisor_apply] using + WithTop.coe_untop₀_of_ne_top (Mero.ord_ne_top hφ x) rw [MeroGermOn.ord_mul isOpen_univ (mem_univ x), Divisor.sub_apply] have hz : (-(D x - divisor φ x) : ℤ) = divisor φ x + -(D x) := by ring have hrw : ((-(D x - divisor φ x) : ℤ) : WithTop ℤ) = φ.ord x + ((-(D x) : ℤ) : WithTop ℤ) := by diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/LinearSystem.lean b/LeanPool/JacobianDiffgeo/Meromorphic/LinearSystem.lean index d63c3f8809..182434239b 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/LinearSystem.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/LinearSystem.lean @@ -32,7 +32,7 @@ bookkeeping for the two-sided bound is more delicate than the time budget allowe final report for the precise missing step. Everything else in §4.7 is proved. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology @@ -61,7 +61,7 @@ variable [T1Space X] [IsManifold 𝓘(ℂ) ω X] /-! ### `LinSys D` -/ /-- CC3's `L(D)` (carrier per D4; `0 ∈ L(D)` by `⊤`-arithmetic, not fiat). -/ -noncomputable def LinSys (D : Divisor X) : Submodule ℂ (ℳ X) where +@[expose] noncomputable def LinSys (D : Divisor X) : Submodule ℂ (ℳ X) where carrier := {φ | ∀ x, ((-(D x) : ℤ) : WithTop ℤ) ≤ φ.ord x} zero_mem' := by intro x @@ -103,13 +103,17 @@ theorem mem_linSys_iff_eq_zero_or_le_divisor [ConnectedSpace X] {φ : ℳ X} : have h := Function.locallyFinsuppWithin.le_def.1 hle x rw [Divisor.neg_apply, divisor_apply] at h calc ((-(D x) : ℤ) : WithTop ℤ) = (((-D) x : ℤ) : WithTop ℤ) := by rw [Divisor.neg_apply] - _ ≤ ((divisor φ x : ℤ) : WithTop ℤ) := by exact_mod_cast h - _ = φ.ord x := WithTop.coe_untop₀_of_ne_top (Mero.ord_ne_top hφ0 x) + _ ≤ ((divisor φ x : ℤ) : WithTop ℤ) := by + rw [Divisor.neg_apply, divisor_apply] + exact_mod_cast h + _ = φ.ord x := by + rw [divisor_apply] + exact WithTop.coe_untop₀_of_ne_top (Mero.ord_ne_top hφ0 x) /-- CC3: `l D`. Finiteness is NOT this unit's business (Čech/finiteness proves `FiniteDimensional`); until then `finrank` junk-returns `0` on infinite-dimensional spaces — no lemma here depends on finiteness. -/ -noncomputable def l (D : Divisor X) : ℕ := Module.finrank ℂ (LinSys D) +@[expose] noncomputable def l (D : Divisor X) : ℕ := Module.finrank ℂ (LinSys D) omit [T1Space X] [IsManifold 𝓘(ℂ) ω X] in theorem linSys_mono (h : D ≤ E) : LinSys D ≤ LinSys E := by @@ -233,6 +237,7 @@ theorem linSys_eq_bot_of_degree_neg [T2Space X] [CompactSpace X] [ConnectedSpace /-- Relative `L(D)` (CC8 Čech cochain spaces). Junk-gated on `IsOpen U` (D3): when `U` is not open, the condition is vacuous (every class qualifies), matching `ord`'s own junk convention so that `zero_mem'` holds unconditionally. -/ +@[expose] noncomputable def LinSysOn (D : Divisor X) (U : Set X) : Submodule ℂ (MeroGermOn X U) where carrier := {φ | IsOpen U → ∀ x ∈ U, ((-(D x) : ℤ) : WithTop ℤ) ≤ φ.ord x} zero_mem' := by diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/OrderEval.lean b/LeanPool/JacobianDiffgeo/Meromorphic/OrderEval.lean index 5db285c10d..fa20648c5f 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/OrderEval.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/OrderEval.lean @@ -29,7 +29,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.4, it recovers `φ` as a class. This is the rigidified normal form the blueprint needs for Čech. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology @@ -64,7 +64,7 @@ noncomputable def ord (φ : MeroGermOn X U) (x : X) : WithTop ℤ := open scoped Classical in theorem ord_apply_mk (f : X → ℂ) (hf : MeromorphicOnX f U) (x : X) : - (mk f hf).ord x = if IsOpen U ∧ x ∈ U then ordAtX f x else 0 := rfl + (mk f hf).ord x = if IsOpen U ∧ x ∈ U then ordAtX f x else 0 := by rfl @[simp] theorem ord_mk (hU : IsOpen U) (hx : x ∈ U) {f : X → ℂ} {hf : MeromorphicOnX f U} : (mk f hf).ord x = ordAtX f x := by @@ -132,7 +132,7 @@ theorem ord_algebraMap (hU : IsOpen U) (hx : x ∈ U) (hc : c ≠ 0) : open scoped Classical in /-- Canonical value (D5): the limit along `𝓝[≠] x` when `0 ≤ ord`, junk `0` else. -/ -noncomputable def evalAt (φ : MeroGermOn X U) (x : X) : ℂ := +@[expose] noncomputable def evalAt (φ : MeroGermOn X U) (x : X) : ℂ := φ.1.liftOn (fun f => if (IsOpen U ∧ x ∈ U) ∧ 0 ≤ ordAtX f x then Filter.limUnder (𝓝[≠] x) f else 0) (fun f g hfg => by @@ -155,7 +155,7 @@ noncomputable def evalAt (φ : MeroGermOn X U) (x : X) : ℂ := open scoped Classical in theorem evalAt_apply_mk (f : X → ℂ) (hf : MeromorphicOnX f U) (x : X) : (mk f hf).evalAt x = - if (IsOpen U ∧ x ∈ U) ∧ 0 ≤ ordAtX f x then Filter.limUnder (𝓝[≠] x) f else 0 := rfl + if (IsOpen U ∧ x ∈ U) ∧ 0 ≤ ordAtX f x then Filter.limUnder (𝓝[≠] x) f else 0 := by rfl theorem tendsto_evalAt (hU : IsOpen U) (hx : x ∈ U) (φ : MeroGermOn X U) (h : 0 ≤ φ.ord x) {f : X → ℂ} {hf : MeromorphicOnX f U} (hrep : mk f hf = φ) : @@ -251,7 +251,7 @@ theorem evalAt_restrict (h : V ⊆ U) (hV : IsOpen V) (hU : IsOpen U) {x : X} (h /-! ### `holoRepr` (D5) -/ /-- CC3's `holoRepr` (D5): the canonical repaired representative. -/ -noncomputable def holoRepr (φ : MeroGermOn X U) : X → ℂ := fun x => φ.evalAt x +@[expose] noncomputable def holoRepr (φ : MeroGermOn X U) : X → ℂ := fun x => φ.evalAt x /-- `holoRepr` agrees with any representative off `x` (unconditionally on `ord`: near `x` the representative is automatically chart-analytic, `MeromorphicAt.eventually_analyticAt`). -/ diff --git a/LeanPool/JacobianDiffgeo/Meromorphic/Predicates.lean b/LeanPool/JacobianDiffgeo/Meromorphic/Predicates.lean index bf05f09170..0bc9323c99 100644 --- a/LeanPool/JacobianDiffgeo/Meromorphic/Predicates.lean +++ b/LeanPool/JacobianDiffgeo/Meromorphic/Predicates.lean @@ -26,7 +26,7 @@ Unit: meromorphic-and-divisors (`docs/design/meromorphic-and-divisors.md` §4.1) (and back); every other transport lemma in this file is a one-line specialization of it. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology @@ -37,21 +37,22 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] variable {f g : X → ℂ} {x : X} {c : ℂ} /-- CC3 (frozen): meromorphy of the standard-chart composite. Junk-robust. -/ -def MeromorphicAtX (f : X → ℂ) (x : X) : Prop := +@[expose] def MeromorphicAtX (f : X → ℂ) (x : X) : Prop := MeromorphicAt (f ∘ (chartAt ℂ x).symm) (chartAt ℂ x x) /-- Relative CC3 predicate; the frozen global one is `MeromorphicOnX f Set.univ`. -/ -def MeromorphicOnX (f : X → ℂ) (U : Set X) : Prop := ∀ x ∈ U, MeromorphicAtX f x +@[expose] def MeromorphicOnX (f : X → ℂ) (U : Set X) : Prop := ∀ x ∈ U, MeromorphicAtX f x theorem meromorphicOnX_univ : MeromorphicOnX f univ ↔ ∀ x, MeromorphicAtX f x := by simp [MeromorphicOnX] /-- CC3 (frozen): the order at `x`, `WithTop ℤ`-valued, junk `0` off meromorphy. -/ +@[expose] noncomputable def ordAtX (f : X → ℂ) (x : X) : WithTop ℤ := meromorphicOrderAt (f ∘ (chartAt ℂ x).symm) (chartAt ℂ x x) theorem ordAtX_def (f : X → ℂ) (x : X) : - ordAtX f x = meromorphicOrderAt (f ∘ (chartAt ℂ x).symm) (chartAt ℂ x x) := rfl + ordAtX f x = meromorphicOrderAt (f ∘ (chartAt ℂ x).symm) (chartAt ℂ x x) := by rfl /-! ### The chart-transport workhorse -/ diff --git a/LeanPool/JacobianDiffgeo/MeromorphicTrace.lean b/LeanPool/JacobianDiffgeo/MeromorphicTrace.lean index 0b4cd03121..9d3e47c746 100644 --- a/LeanPool/JacobianDiffgeo/MeromorphicTrace.lean +++ b/LeanPool/JacobianDiffgeo/MeromorphicTrace.lean @@ -83,4 +83,4 @@ API summary (see `docs/design/meromorphic-trace.md`). Standing surface hypothese beyond what `residue-calculus`/`form-trace-tower` already mediate). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/MeromorphicTrace/ArgumentPrinciple.lean b/LeanPool/JacobianDiffgeo/MeromorphicTrace/ArgumentPrinciple.lean index 4077dc300b..fddd7474a2 100644 --- a/LeanPool/JacobianDiffgeo/MeromorphicTrace/ArgumentPrinciple.lean +++ b/LeanPool/JacobianDiffgeo/MeromorphicTrace/ArgumentPrinciple.lean @@ -36,7 +36,7 @@ design's routing warning; `proper-map-degree` needs the counting route, not a ge route). -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Filter Set Function Topology diff --git a/LeanPool/JacobianDiffgeo/MeromorphicTrace/FunctionTrace.lean b/LeanPool/JacobianDiffgeo/MeromorphicTrace/FunctionTrace.lean index 31070587a9..5beb644893 100644 --- a/LeanPool/JacobianDiffgeo/MeromorphicTrace/FunctionTrace.lean +++ b/LeanPool/JacobianDiffgeo/MeromorphicTrace/FunctionTrace.lean @@ -52,7 +52,7 @@ needed on `Y` itself). stability, though `trace_eq_finsum'` proves the identity at every point.) -/ -@[expose] public section +public section open scoped ContDiff Manifold open Filter Set Function Topology diff --git a/LeanPool/JacobianDiffgeo/MeromorphicTrace/OrderMultiplicity.lean b/LeanPool/JacobianDiffgeo/MeromorphicTrace/OrderMultiplicity.lean index 102b91f917..8345d1e62e 100644 --- a/LeanPool/JacobianDiffgeo/MeromorphicTrace/OrderMultiplicity.lean +++ b/LeanPool/JacobianDiffgeo/MeromorphicTrace/OrderMultiplicity.lean @@ -45,7 +45,7 @@ this lemma as a non-essential "cheap corollary... even though we do not need it dropped rather than patched into a different (correct) statement under the same name. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Filter Set Function Topology diff --git a/LeanPool/JacobianDiffgeo/MeromorphicTrace/PlanarTrace.lean b/LeanPool/JacobianDiffgeo/MeromorphicTrace/PlanarTrace.lean index 7c76d8eb17..640f262648 100644 --- a/LeanPool/JacobianDiffgeo/MeromorphicTrace/PlanarTrace.lean +++ b/LeanPool/JacobianDiffgeo/MeromorphicTrace/PlanarTrace.lean @@ -46,7 +46,7 @@ manifold content, independent of `ToP1`/`OrderMultiplicity`/`ArgumentPrinciple`. monomials, and residue-calculus's presentation-independent `laurentCoeffAt` characterization. -/ -@[expose] public section +public section open Filter Set Topology Metric Function @@ -62,7 +62,7 @@ noncomputable def traceZk (h : ℂ → ℂ) (k : ℕ) (w : ℂ) : ℂ := ∑ᶠ z ∈ {z : ℂ | z ^ k = w}, h z theorem traceZk_def (h : ℂ → ℂ) (k : ℕ) (w : ℂ) : - traceZk h k w = ∑ᶠ z ∈ {z : ℂ | z ^ k = w}, h z := rfl + traceZk h k w = ∑ᶠ z ∈ {z : ℂ | z ^ k = w}, h z := by rfl /-- Master conversion to a `Finset` sum, valid for every `w` (the root set is always finite once `k ≠ 0`, regardless of `w`). -/ diff --git a/LeanPool/JacobianDiffgeo/MeromorphicTrace/ToP1.lean b/LeanPool/JacobianDiffgeo/MeromorphicTrace/ToP1.lean index 55e8445b9e..402a3bd173 100644 --- a/LeanPool/JacobianDiffgeo/MeromorphicTrace/ToP1.lean +++ b/LeanPool/JacobianDiffgeo/MeromorphicTrace/ToP1.lean @@ -41,7 +41,7 @@ surface hypotheses throughout (`CONVENTIONS.md`). nonconstant `toP1 f`. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Filter Set Function Topology @@ -268,6 +268,7 @@ theorem invChart_toP1_holoRepr_eventuallyEq_of_neg (hf : MeromorphicOnX f Set.un /-- The natural raw-function nonconstancy hypothesis: `f` is not codiscretely equal to any single constant. (What callers holding `ℳ X` nonzero-ness will have once that field is in hand; stated here germ-level so we do not need it.) -/ +@[expose] def NotEventuallyConstX (f : X → ℂ) : Prop := ∀ c : ℂ, ¬ (fun x => f x - c) =ᶠ[codiscrete X] 0 omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in diff --git a/LeanPool/JacobianDiffgeo/Monodromy.lean b/LeanPool/JacobianDiffgeo/Monodromy.lean index a132429ef6..2bf9f3c464 100644 --- a/LeanPool/JacobianDiffgeo/Monodromy.lean +++ b/LeanPool/JacobianDiffgeo/Monodromy.lean @@ -76,4 +76,4 @@ solutions` needs only the function-level `dlog f` case above). See `docs/design/ for the sketch, should a future unit ever need it. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Monodromy/LogContinuation.lean b/LeanPool/JacobianDiffgeo/Monodromy/LogContinuation.lean index 0c26d43892..a943d09833 100644 --- a/LeanPool/JacobianDiffgeo/Monodromy/LogContinuation.lean +++ b/LeanPool/JacobianDiffgeo/Monodromy/LogContinuation.lean @@ -53,7 +53,7 @@ Main declarations: existence/uniqueness API). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter TopologicalSpace @@ -69,7 +69,7 @@ variable {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] [Connecte /-- The zero/pole locus of `f` as an open pole-free locus (`(divisor f).support` is finite by compactness, hence closed by `T2Space`). -/ -noncomputable def poleZeroLocus (f : ℳ X) : Opens X := +@[expose] noncomputable def poleZeroLocus (f : ℳ X) : Opens X := openLocusOfFinite (RS.finite_support_divisor f) theorem mem_poleZeroLocus_iff {f : ℳ X} (hf : f ≠ 0) {x : X} : diff --git a/LeanPool/JacobianDiffgeo/Monodromy/OpenLocus.lean b/LeanPool/JacobianDiffgeo/Monodromy/OpenLocus.lean index a577038c1e..483028ece4 100644 --- a/LeanPool/JacobianDiffgeo/Monodromy/OpenLocus.lean +++ b/LeanPool/JacobianDiffgeo/Monodromy/OpenLocus.lean @@ -31,7 +31,7 @@ Main declarations: in the open locus; `RS.Monodromy.Path.liftOpenLocus_extend` recovers `γ.extend` pointwise. -/ -@[expose] public section +public section open scoped ContDiff Manifold open TopologicalSpace Set @@ -43,6 +43,7 @@ namespace RS.Monodromy variable {X : Type*} [TopologicalSpace X] [T2Space X] [ChartedSpace ℂ X] [IsManifold 𝓘(ℂ) ω X] /-- The open locus determined by a closed "bad set" (in practice a divisor support). -/ +@[expose] def openLocus {S : Set X} (hS : IsClosed S) : Opens X := ⟨Sᶜ, hS.isOpen_compl⟩ /-- Finite bad sets are closed in a `T2Space` (`Set.Finite.isClosed`), hence give an open locus. diff --git a/LeanPool/JacobianDiffgeo/Path.lean b/LeanPool/JacobianDiffgeo/Path.lean index 8f2ba1e22c..183a3937d5 100644 --- a/LeanPool/JacobianDiffgeo/Path.lean +++ b/LeanPool/JacobianDiffgeo/Path.lean @@ -74,4 +74,4 @@ No `T2Space`/`CompactSpace`/`ConnectedSpace` anywhere in this unit (compactness the bridge/FTC lemma removes the only candidate dependency). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Path/Bridge.lean b/LeanPool/JacobianDiffgeo/Path/Bridge.lean index 03230bfee3..36300c4e0f 100644 --- a/LeanPool/JacobianDiffgeo/Path/Bridge.lean +++ b/LeanPool/JacobianDiffgeo/Path/Bridge.lean @@ -28,7 +28,7 @@ Main declarations: * `RS.pathIntegral_mdifferential` — FTC along a continuous path for `d f`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open IsManifold Metric Set Filter MeasureTheory diff --git a/LeanPool/JacobianDiffgeo/Path/Chain.lean b/LeanPool/JacobianDiffgeo/Path/Chain.lean index 5a432afa5c..a7d5b9f264 100644 --- a/LeanPool/JacobianDiffgeo/Path/Chain.lean +++ b/LeanPool/JacobianDiffgeo/Path/Chain.lean @@ -22,7 +22,7 @@ Main declarations: * `RS.exists_chartChain` — existence, for any continuous path `γ`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology unitInterval open IsManifold Metric Set Filter diff --git a/LeanPool/JacobianDiffgeo/Path/Continuation.lean b/LeanPool/JacobianDiffgeo/Path/Continuation.lean index 48d3ec0a5e..b837812cb8 100644 --- a/LeanPool/JacobianDiffgeo/Path/Continuation.lean +++ b/LeanPool/JacobianDiffgeo/Path/Continuation.lean @@ -27,7 +27,7 @@ Main declarations: * `RS.pathIntegral_add/smul/zero_form`, `RS.pathIntegralₗ`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology unitInterval open IsManifold Metric Set Filter @@ -43,7 +43,7 @@ variable {x y z : X} /-! ### The real-line clamp to `[0,1]` -/ /-- Clamp a real number into `[0,1]`. -/ -def clampI (u : ℝ) : ℝ := max 0 (min u 1) +@[expose] def clampI (u : ℝ) : ℝ := max 0 (min u 1) theorem clampI_mem (u : ℝ) : clampI u ∈ Icc (0 : ℝ) 1 := ⟨le_max_left _ _, max_le zero_le_one (min_le_right _ _)⟩ @@ -77,6 +77,7 @@ theorem extend_clampI (γ : Path x y) (u : ℝ) : γ.extend (clampI u) = γ.exte /-! ### `IsPrimitiveAlong`, existence, `pathIntegral` -/ /-- `F` is a primitive of `η` along the path `γ`. -/ +@[expose] def IsPrimitiveAlong (γ : Path x y) (η : Form1 X) (F : ℝ → ℂ) : Prop := IsPrimitiveAlongMap γ.extend η F Set.univ @@ -344,7 +345,7 @@ theorem pathIntegral_zero_form (γ : Path x y) : pathIntegral γ (0 : Form1 X) = ring /-- The integral of a fixed path, as a ℂ-linear map on 1-forms. -/ -noncomputable def pathIntegralₗ (γ : Path x y) : Form1 X →ₗ[ℂ] ℂ where +@[expose] noncomputable def pathIntegralₗ (γ : Path x y) : Form1 X →ₗ[ℂ] ℂ where toFun η := pathIntegral γ η map_add' := pathIntegral_add γ map_smul' c η := by simpa using pathIntegral_smul γ c η diff --git a/LeanPool/JacobianDiffgeo/Path/HomotopySquare.lean b/LeanPool/JacobianDiffgeo/Path/HomotopySquare.lean index b53782ab6d..f034809774 100644 --- a/LeanPool/JacobianDiffgeo/Path/HomotopySquare.lean +++ b/LeanPool/JacobianDiffgeo/Path/HomotopySquare.lean @@ -27,7 +27,7 @@ Main declarations: `RS.pathIntegral_eq_of_simplyConnected`, `RS.period_eq_zero_of_homotopic_refl`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology unitInterval open IsManifold Metric Set Filter @@ -410,7 +410,7 @@ noncomputable def pathIntegralQ (η : Form1 X) (q : Path.Homotopic.Quotient x y) Quotient.liftOn q (pathIntegral · η) fun _ _ h => pathIntegral_congr_homotopic h η @[simp] theorem pathIntegralQ_mk (γ : Path x y) (η : Form1 X) : - pathIntegralQ η (Path.Homotopic.Quotient.mk γ) = pathIntegral γ η := rfl + pathIntegralQ η (Path.Homotopic.Quotient.mk γ) = pathIntegral γ η := by rfl theorem pathIntegralQ_trans (p : Path.Homotopic.Quotient x y) (q : Path.Homotopic.Quotient y z) (η : Form1 X) : pathIntegralQ η (p.trans q) = pathIntegralQ η p + pathIntegralQ η q := by diff --git a/LeanPool/JacobianDiffgeo/Path/LocalPrimitive.lean b/LeanPool/JacobianDiffgeo/Path/LocalPrimitive.lean index 102db7c95b..498fa2c6c6 100644 --- a/LeanPool/JacobianDiffgeo/Path/LocalPrimitive.lean +++ b/LeanPool/JacobianDiffgeo/Path/LocalPrimitive.lean @@ -36,7 +36,7 @@ Main declarations: (`Continuation.lean`) and the 2D grid (`HomotopySquare.lean`). -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open IsManifold Metric Set Filter @@ -51,6 +51,7 @@ variable {α : Type*} [TopologicalSpace α] /-- `F` is a primitive of the 1-form `η` along the map `K` on `s`: near every `a ∈ s` (within `s`), `F` factors as `g ∘ e ∘ K` for a chart `e` at `K a` and a planar local primitive `g` of the chart coefficient of `η`. -/ +@[expose] def IsPrimitiveAlongMap (K : α → X) (η : Form1 X) (F : α → ℂ) (s : Set α) : Prop := ∀ a ∈ s, ∃ e : OpenPartialHomeomorph X ℂ, e ∈ maximalAtlas 𝓘(ℂ) ω X ∧ K a ∈ e.source ∧ ∃ g : ℂ → ℂ, (∀ᶠ z in 𝓝 (e (K a)), HasDerivAt g (coeffIn e η z) z) ∧ diff --git a/LeanPool/JacobianDiffgeo/Path/Periods.lean b/LeanPool/JacobianDiffgeo/Path/Periods.lean index f7f7d00e77..b032adc47c 100644 --- a/LeanPool/JacobianDiffgeo/Path/Periods.lean +++ b/LeanPool/JacobianDiffgeo/Path/Periods.lean @@ -26,7 +26,7 @@ Main declarations: `periodVector_trans/symm/refl`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open IsManifold Module @@ -60,7 +60,7 @@ theorem period_conj (σ : Path x' x) (γ : Path x x) (η : Form1 X) : ring /-- Period vector w.r.t. a basis of `Form1 X` (CC9 feed). -/ -noncomputable def periodVector {n : ℕ} (b : Basis (Fin n) ℂ (Form1 X)) (γ : Path x x) : +@[expose] noncomputable def periodVector {n : ℕ} (b : Basis (Fin n) ℂ (Form1 X)) (γ : Path x x) : Fin n → ℂ := fun i => period γ (b i) theorem periodVector_trans {n : ℕ} (b : Basis (Fin n) ℂ (Form1 X)) (γ γ' : Path x x) : diff --git a/LeanPool/JacobianDiffgeo/Path/Perturb.lean b/LeanPool/JacobianDiffgeo/Path/Perturb.lean index 25a0cea644..b1366f98d8 100644 --- a/LeanPool/JacobianDiffgeo/Path/Perturb.lean +++ b/LeanPool/JacobianDiffgeo/Path/Perturb.lean @@ -30,7 +30,7 @@ Main declarations: one avoiding `S` entirely. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology unitInterval open IsManifold Metric Set Filter diff --git a/LeanPool/JacobianDiffgeo/Path/Planar.lean b/LeanPool/JacobianDiffgeo/Path/Planar.lean index e932aeb59b..e8bba88f16 100644 --- a/LeanPool/JacobianDiffgeo/Path/Planar.lean +++ b/LeanPool/JacobianDiffgeo/Path/Planar.lean @@ -33,7 +33,7 @@ Main declarations: convex planar set are homotopic rel endpoints through the set (affine homotopy). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice.lean b/LeanPool/JacobianDiffgeo/PeriodLattice.lean index d6e868e3a9..02bdf4c164 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice.lean @@ -113,4 +113,4 @@ direct interest to `abel-theorem`'s `ofCurve_inj`/`ofCurve_eq_of_path` consumers `.topologicalClosure` from `Jac₀`'s defining quotient once discreteness is unconditional. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean index f06cd6411b..cd8aabbc4c 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean @@ -33,7 +33,7 @@ Main declarations: `RS.exists_isolating_nhds_periodSubgroup`, `RS.discreteTopolo `RS.periodSubgroup_topologicalClosure_eq`, `RS.discreteTopology_periodSubgroup_topologicalClosure`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter Metric IsManifold @@ -132,6 +132,7 @@ private theorem resAt_twisted_eq {a x : Fin (genus X) → X} have hcoeffAt : (MFormData.smul F (MFormData.ofForm1 (basis X k))).coeffAt (a j) =ᶠ[𝓝 (c₀ j)] fun z => F.holoRepr ((e j).symm z) * coeffIn (e j) (basis X k) z := by filter_upwards [(e j).open_target.mem_nhds (mem_chart_target ℂ (a j))] with z hz + rw [MFormData.coeffAt_smul_meromorphic] change F.holoRepr ((e j).symm z) * (if z ∈ (e j).target then coeffIn (e j) (basis X k) z else 0) = _ rw [ite_eq_left hz] diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/FormIdentity.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/FormIdentity.lean index 5aa5cacba1..fc52dd1355 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/FormIdentity.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/FormIdentity.lean @@ -23,7 +23,7 @@ whole neighborhood, `η = 0` identically. Needed by `Nondegeneracy.lean`'s maxim Main declaration: `RS.form1_eq_zero_of_eventually_coeffIn_zero`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology Metric IsManifold diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/FullRank.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/FullRank.lean index 98404a1f12..9cfd252084 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/FullRank.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/FullRank.lean @@ -30,7 +30,7 @@ Main declarations: `RS.span_real_periodSubgroup`, `RS.isZLattice_periodSubgroup_ `RS.finrank_int_periodSubgroup`. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/GenericPoints.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/GenericPoints.lean index b7e3d355b2..eecb91d60d 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/GenericPoints.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/GenericPoints.lean @@ -24,7 +24,7 @@ Main declarations: `RS.isOpen_coeffAt_ne_zero`, `RS.exists_coeffAt_ne_zero_notMe `RS.exists_genericPoints`, `RS.det_genericMatrix_ne_zero`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology IsManifold @@ -43,7 +43,7 @@ def evalAtₗ (x : X) : Form1 X →ₗ[ℂ] ℂ where map_smul' := coeffAt_smul x omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in -@[simp] theorem evalAtₗ_apply (x : X) (η : Form1 X) : evalAtₗ x η = coeffAt x η := rfl +@[simp] theorem evalAtₗ_apply (x : X) (η : Form1 X) : evalAtₗ x η = coeffAt x η := by rfl omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in /-- The nonvanishing locus of a form's coefficient is open. -/ diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/Membership.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/Membership.lean index 07e104f04c..5735c9a8dd 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/Membership.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/Membership.lean @@ -24,7 +24,7 @@ Main declarations: `RS.periodRange X`, `RS.periodSubgroup_eq_periodRange`, `RS.mem_periodSubgroup_iff`. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/Nondegeneracy.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/Nondegeneracy.lean index 1a1fed6c67..b7afab2dc6 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/Nondegeneracy.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/Nondegeneracy.lean @@ -25,7 +25,7 @@ the complex open mapping theorem — no Hodge, no de Rham, no dissection, no 2-f Main declaration: `RS.form1_eq_zero_of_re_period_eq_zero`. -/ -@[expose] public section +public section open scoped ContDiff Manifold Topology open Set Filter Metric IsManifold diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/Segment.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/Segment.lean index c602e0836f..fa31bbed32 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/Segment.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/Segment.lean @@ -19,7 +19,7 @@ since both sites need exactly the same construction (design §6.5's `segmentPath Main declarations: `RS.segmentPath`, `RS.pathIntegral_segmentPath`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Metric unitInterval diff --git a/LeanPool/JacobianDiffgeo/PlanarStokes.lean b/LeanPool/JacobianDiffgeo/PlanarStokes.lean index 6d144ca5f1..57101e3962 100644 --- a/LeanPool/JacobianDiffgeo/PlanarStokes.lean +++ b/LeanPool/JacobianDiffgeo/PlanarStokes.lean @@ -56,4 +56,4 @@ the three `integral_wirtingerDbar_mul_inv_sub*`/`integrable_wirtingerDbar_mul_in above for its Lemma-20.3 step — see the build-log entry for this unit for the full account. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/PlanarStokes/AnnulusResidue.lean b/LeanPool/JacobianDiffgeo/PlanarStokes/AnnulusResidue.lean index 587ff1b95f..6a723943e7 100644 --- a/LeanPool/JacobianDiffgeo/PlanarStokes/AnnulusResidue.lean +++ b/LeanPool/JacobianDiffgeo/PlanarStokes/AnnulusResidue.lean @@ -40,7 +40,7 @@ rectangle) — a shorter route to the same identity, using the same mathlib mach the design's own R2 fallback. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Metric open scoped Real diff --git a/LeanPool/JacobianDiffgeo/PlanarStokes/CompactSupport.lean b/LeanPool/JacobianDiffgeo/PlanarStokes/CompactSupport.lean index 71ff046152..94f88049a4 100644 --- a/LeanPool/JacobianDiffgeo/PlanarStokes/CompactSupport.lean +++ b/LeanPool/JacobianDiffgeo/PlanarStokes/CompactSupport.lean @@ -24,7 +24,7 @@ corollary (`integral_wirtingerDbar_mul_eq_zero_of_differentiableOn`, Atom 1b) is this chart" case residue-theorem needs for every PoU piece that misses every pole. -/ -@[expose] public section +public section open Complex MeasureTheory Set diff --git a/LeanPool/JacobianDiffgeo/PlanarStokes/Compat.lean b/LeanPool/JacobianDiffgeo/PlanarStokes/Compat.lean index 7fa5487fc1..8be824b3c3 100644 --- a/LeanPool/JacobianDiffgeo/PlanarStokes/Compat.lean +++ b/LeanPool/JacobianDiffgeo/PlanarStokes/Compat.lean @@ -30,7 +30,7 @@ Unit: planar-stokes-atoms (`docs/design/planar-stokes.md` §5.1). Mathlib-only ( `integral_eq_intervalIntegral_of_tsupport_subset_reProdIm`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter diff --git a/LeanPool/JacobianDiffgeo/ProjectiveLine.lean b/LeanPool/JacobianDiffgeo/ProjectiveLine.lean index 7c1236bc6e..c33055cc37 100644 --- a/LeanPool/JacobianDiffgeo/ProjectiveLine.lean +++ b/LeanPool/JacobianDiffgeo/ProjectiveLine.lean @@ -46,7 +46,7 @@ basepoints), meromorphic-and-divisors (`contMDiffAt_of_pole` + `ContMDiffAt.oneP two atoms for the future `ℳ.toP1` bridge, junk-value contract `coeChart ∞ = 0`). -/ -@[expose] public section +public section /-- The Riemann sphere, as the one-point compactification of `ℂ`. -/ scoped[RS.P1] notation "ℙ¹" => OnePoint ℂ diff --git a/LeanPool/JacobianDiffgeo/ProjectiveLine/Charts.lean b/LeanPool/JacobianDiffgeo/ProjectiveLine/Charts.lean index fc5918eccd..7e66a3ee10 100644 --- a/LeanPool/JacobianDiffgeo/ProjectiveLine/Charts.lean +++ b/LeanPool/JacobianDiffgeo/ProjectiveLine/Charts.lean @@ -24,7 +24,7 @@ and `IsManifold 𝓘(ℂ) ω (OnePoint ℂ)` from two charts: literally `id`/`Inv.inv` as total functions (junk values aligned by construction). -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter Topology OnePoint @@ -33,7 +33,7 @@ namespace RS.P1 /-- The identity chart on the finite part of `ℙ¹`: source `{∞}ᶜ`, target `univ`, `↑z ↦ z`, junk value `coeChart ∞ = 0`. -/ -noncomputable def coeChart : OpenPartialHomeomorph (OnePoint ℂ) ℂ where +@[expose] noncomputable def coeChart : OpenPartialHomeomorph (OnePoint ℂ) ℂ where toFun p := p.elim 0 id invFun := ((↑) : ℂ → OnePoint ℂ) source := {(∞ : OnePoint ℂ)}ᶜ @@ -50,11 +50,11 @@ noncomputable def coeChart : OpenPartialHomeomorph (OnePoint ℂ) ℂ where exact (continuousAt_coe.mpr (by exact continuousAt_id)).continuousWithinAt continuousOn_invFun := continuous_coe.continuousOn -@[simp] theorem coeChart_apply_coe (z : ℂ) : coeChart (z : OnePoint ℂ) = z := rfl -@[simp] theorem coeChart_apply_infty : coeChart (∞ : OnePoint ℂ) = 0 := rfl -@[simp] theorem coeChart_symm_apply (z : ℂ) : coeChart.symm z = (z : OnePoint ℂ) := rfl -@[simp] theorem coeChart_source : coeChart.source = {(∞ : OnePoint ℂ)}ᶜ := rfl -@[simp] theorem coeChart_target : coeChart.target = Set.univ := rfl +@[simp] theorem coeChart_apply_coe (z : ℂ) : coeChart (z : OnePoint ℂ) = z := by rfl +@[simp] theorem coeChart_apply_infty : coeChart (∞ : OnePoint ℂ) = 0 := by rfl +@[simp] theorem coeChart_symm_apply (z : ℂ) : coeChart.symm z = (z : OnePoint ℂ) := by rfl +@[simp] theorem coeChart_source : coeChart.source = {(∞ : OnePoint ℂ)}ᶜ := by rfl +@[simp] theorem coeChart_target : coeChart.target = Set.univ := by rfl /-- `inversion` never sends a finite point to `↑(0:ℂ)`. -/ theorem inversion_coe_ne_coe_zero (w : ℂ) : inversion (w : OnePoint ℂ) ≠ ((0 : ℂ) : OnePoint ℂ) := @@ -106,10 +106,10 @@ noncomputable def invChart : OpenPartialHomeomorph (OnePoint ℂ) ℂ where change coeChart (inversion ∞) = 0 simp -@[simp] theorem invChart_symm_apply (w : ℂ) : invChart.symm w = inversion (w : OnePoint ℂ) := rfl +@[simp] theorem invChart_symm_apply (w : ℂ) : invChart.symm w = inversion (w : OnePoint ℂ) := by rfl -@[simp] theorem invChart_source : invChart.source = {((0 : ℂ) : OnePoint ℂ)}ᶜ := rfl -@[simp] theorem invChart_target : invChart.target = Set.univ := rfl +@[simp] theorem invChart_source : invChart.source = {((0 : ℂ) : OnePoint ℂ)}ᶜ := by rfl +@[simp] theorem invChart_target : invChart.target = Set.univ := by rfl theorem invChart_comp_coe : ⇑invChart ∘ ((↑) : ℂ → OnePoint ℂ) = Inv.inv := by funext z @@ -132,14 +132,14 @@ noncomputable def chartFamily : Bool → OpenPartialHomeomorph (OnePoint ℂ) | false => coeChart | true => invChart -@[simp] theorem chartFamily_false : chartFamily false = coeChart := rfl -@[simp] theorem chartFamily_true : chartFamily true = invChart := rfl +@[simp] theorem chartFamily_false : chartFamily false = coeChart := by rfl +@[simp] theorem chartFamily_true : chartFamily true = invChart := by rfl /-- Index map: `∞ ↦ true` (use `invChart`), `↑z ↦ false` (use `coeChart`). -/ def chartIndex : OnePoint ℂ → Bool := fun p => p.elim true (fun _ => false) -@[simp] theorem chartIndex_infty : chartIndex ∞ = true := rfl -@[simp] theorem chartIndex_coe (z : ℂ) : chartIndex (z : OnePoint ℂ) = false := rfl +@[simp] theorem chartIndex_infty : chartIndex ∞ = true := by rfl +@[simp] theorem chartIndex_coe (z : ℂ) : chartIndex (z : OnePoint ℂ) = false := by rfl theorem mem_chartFamily_source (p : OnePoint ℂ) : p ∈ (chartFamily (chartIndex p)).source := by induction p using OnePoint.rec with @@ -149,10 +149,10 @@ theorem mem_chartFamily_source (p : OnePoint ℂ) : p ∈ (chartFamily (chartInd noncomputable instance instChartedSpace : ChartedSpace ℂ (OnePoint ℂ) := RS.chartedSpaceOfFamily chartFamily chartIndex mem_chartFamily_source -@[simp] theorem chartAt_coe (z : ℂ) : chartAt ℂ ((z : ℂ) : OnePoint ℂ) = coeChart := by +theorem chartAt_coe (z : ℂ) : chartAt ℂ ((z : ℂ) : OnePoint ℂ) = coeChart := by rw [RS.chartedSpaceOfFamily_chartAt]; simp -@[simp] theorem chartAt_infty : chartAt ℂ (∞ : OnePoint ℂ) = invChart := by +theorem chartAt_infty : chartAt ℂ (∞ : OnePoint ℂ) = invChart := by rw [RS.chartedSpaceOfFamily_chartAt]; simp theorem atlas_eq : atlas ℂ (OnePoint ℂ) = {coeChart, invChart} := by diff --git a/LeanPool/JacobianDiffgeo/ProjectiveLine/GenusZero.lean b/LeanPool/JacobianDiffgeo/ProjectiveLine/GenusZero.lean index fef8f484fc..aff6ab30cf 100644 --- a/LeanPool/JacobianDiffgeo/ProjectiveLine/GenusZero.lean +++ b/LeanPool/JacobianDiffgeo/ProjectiveLine/GenusZero.lean @@ -20,7 +20,7 @@ decays to `0` at infinity, hence vanishes identically by Liouville; the same tra forces `g ≡ 0`. So there are no nonzero holomorphic 1-forms on `ℙ¹` — the sphere has genus 0. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter Topology OnePoint diff --git a/LeanPool/JacobianDiffgeo/ProjectiveLine/Holomorphy.lean b/LeanPool/JacobianDiffgeo/ProjectiveLine/Holomorphy.lean index 961eb9fe17..8abc0f396d 100644 --- a/LeanPool/JacobianDiffgeo/ProjectiveLine/Holomorphy.lean +++ b/LeanPool/JacobianDiffgeo/ProjectiveLine/Holomorphy.lean @@ -30,7 +30,7 @@ anywhere) this file converts holomorphy of maps `Z → OnePoint ℂ` into planar * `contMDiff_inversion`/`inversionDiffeomorph`: inversion is a biholomorphic involution. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter Topology OnePoint @@ -206,6 +206,6 @@ noncomputable def inversionDiffeomorph : Diffeomorph 𝓘(ℂ) 𝓘(ℂ) (OnePoi contMDiff_toFun := contMDiff_inversion contMDiff_invFun := contMDiff_inversion -@[simp] theorem inversionDiffeomorph_apply : ⇑inversionDiffeomorph = inversion := rfl +@[simp] theorem inversionDiffeomorph_apply : ⇑inversionDiffeomorph = inversion := by rfl end RS.P1 diff --git a/LeanPool/JacobianDiffgeo/ProjectiveLine/Inversion.lean b/LeanPool/JacobianDiffgeo/ProjectiveLine/Inversion.lean index 23ade874e9..4671a163a4 100644 --- a/LeanPool/JacobianDiffgeo/ProjectiveLine/Inversion.lean +++ b/LeanPool/JacobianDiffgeo/ProjectiveLine/Inversion.lean @@ -23,7 +23,7 @@ Main declarations: `inversion`, `inversion_involutive`, `inversion_eq_infty_iff` `inversionHomeomorph`. -/ -@[expose] public section +public section open scoped OnePoint open Set Filter Topology OnePoint @@ -31,6 +31,7 @@ open Set Filter Topology OnePoint namespace RS.P1 /-- Inversion `z ↦ z⁻¹` on the Riemann sphere, with `∞ ↦ 0` and `0 ↦ ∞`. -/ +@[expose] noncomputable def inversion : OnePoint ℂ → OnePoint ℂ := fun p => p.elim ((0 : ℂ) : OnePoint ℂ) fun z => if z = 0 then (∞ : OnePoint ℂ) else ((z⁻¹ : ℂ) : OnePoint ℂ) @@ -123,6 +124,7 @@ theorem continuous_inversion : Continuous inversion := by exact (continuous_coe.continuousAt.comp (continuousAt_inv₀ hz)).congr heq /-- Inversion as a self-inverse homeomorphism of the Riemann sphere. -/ +@[expose] noncomputable def inversionHomeomorph : OnePoint ℂ ≃ₜ OnePoint ℂ where toFun := inversion invFun := inversion diff --git a/LeanPool/JacobianDiffgeo/ProjectiveLine/Sphere.lean b/LeanPool/JacobianDiffgeo/ProjectiveLine/Sphere.lean index d19c360a58..0baa020e61 100644 --- a/LeanPool/JacobianDiffgeo/ProjectiveLine/Sphere.lean +++ b/LeanPool/JacobianDiffgeo/ProjectiveLine/Sphere.lean @@ -21,7 +21,7 @@ space) and `ι := Fin 3` gives exactly the sphere model used by the challenge's `ContinuousLinearEquiv` via `Nonempty.some`); no consumer needs one (see design §3.4). -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint diff --git a/LeanPool/JacobianDiffgeo/ProperDegree.lean b/LeanPool/JacobianDiffgeo/ProperDegree.lean index 62bbe04ab8..df903a6f1f 100644 --- a/LeanPool/JacobianDiffgeo/ProperDegree.lean +++ b/LeanPool/JacobianDiffgeo/ProperDegree.lean @@ -56,4 +56,4 @@ unit's `Builds on:` list, per the design doc's non-blocking flag); final assembl `_root_.ContMDiff.degree` and friends verbatim. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/ProperDegree/ChallengeDegree.lean b/LeanPool/JacobianDiffgeo/ProperDegree/ChallengeDegree.lean index f07c6fa041..5c7c99402e 100644 --- a/LeanPool/JacobianDiffgeo/ProperDegree/ChallengeDegree.lean +++ b/LeanPool/JacobianDiffgeo/ProperDegree/ChallengeDegree.lean @@ -31,7 +31,7 @@ match "the exact challenge signature" this file declares `f` explicit throughout (dot notation) still works since `f` is fully determined by unification against `hf`'s type. -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -54,7 +54,7 @@ noncomputable def _root_.ContMDiff.degree (f : X → Y) (_hf : ContMDiff 𝓘( omit [T2Space X] [CompactSpace X] [ConnectedSpace X] [IsManifold 𝓘(ℂ, ℂ) ω X] [T2Space Y] [CompactSpace Y] [IsManifold 𝓘(ℂ, ℂ) ω Y] in @[simp] theorem _root_.ContMDiff.degree_eq (f : X → Y) (hf : ContMDiff 𝓘(ℂ) 𝓘(ℂ) ω f) : - hf.degree = RS.degree f := rfl + hf.degree = RS.degree f := by rfl omit [T2Space X] [CompactSpace X] [ConnectedSpace X] [IsManifold 𝓘(ℂ, ℂ) ω X] [T2Space Y] [CompactSpace Y] [IsManifold 𝓘(ℂ, ℂ) ω Y] in diff --git a/LeanPool/JacobianDiffgeo/ProperDegree/DivisorDegreeZero.lean b/LeanPool/JacobianDiffgeo/ProperDegree/DivisorDegreeZero.lean index 449199b575..4985a2b712 100644 --- a/LeanPool/JacobianDiffgeo/ProperDegree/DivisorDegreeZero.lean +++ b/LeanPool/JacobianDiffgeo/ProperDegree/DivisorDegreeZero.lean @@ -41,7 +41,7 @@ estimate of 40–60 lines (the extra margin is the constancy-translation case sp declaration, `CONVENTIONS.md` rule 4). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter diff --git a/LeanPool/JacobianDiffgeo/ProperDegree/GenusZeroFinisher.lean b/LeanPool/JacobianDiffgeo/ProperDegree/GenusZeroFinisher.lean index 4b3b8353bb..e661d06c7f 100644 --- a/LeanPool/JacobianDiffgeo/ProperDegree/GenusZeroFinisher.lean +++ b/LeanPool/JacobianDiffgeo/ProperDegree/GenusZeroFinisher.lean @@ -30,7 +30,7 @@ itself, cheaper than the general codiscrete-nonconstancy argument. Main declaration: `RS.homeoSphere_of_exists_simple_pole`. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus.lean index 89b38b3f05..d8df87128e 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus.lean @@ -47,4 +47,4 @@ planar-stokes-atoms; the residue functional `H¹(Ω) → ℂ` of Serre duality l serre-duality-cech/tails. Neither is built here. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/ChangeOfVariables.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/ChangeOfVariables.lean index f0e2f236dd..3f02c79b18 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/ChangeOfVariables.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/ChangeOfVariables.lean @@ -24,7 +24,7 @@ Main export: `RS.resAt_comp_mul_deriv`, and the `=ᶠ`-robust corollary `RS.resAt_comp_mul_deriv_of_eventuallyEq`. -/ -@[expose] public section +public section open Filter Topology Metric Function diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/GermFunctionals.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/GermFunctionals.lean index a2b15f90fe..c657f55edc 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/GermFunctionals.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/GermFunctionals.lean @@ -24,7 +24,7 @@ Main exports: `RS.MeromorphicGerm`, `RS.meromorphicGermsAt`, `RS.laurentCoeffL`, `RS.laurentCoeffL_mk`. -/ -@[expose] public section +public section open Filter Topology Metric Function @@ -33,13 +33,14 @@ namespace RS variable {z₀ : ℂ} /-- Meromorphy is a property of the punctured germ. -/ -def MeromorphicGerm (z₀ : ℂ) (γ : Filter.Germ (𝓝[≠] z₀) ℂ) : Prop := +@[expose] def MeromorphicGerm (z₀ : ℂ) (γ : Filter.Germ (𝓝[≠] z₀) ℂ) : Prop := γ.liftOn (MeromorphicAt · z₀) fun _ _ hfg => propext (MeromorphicAt.meromorphicAt_congr hfg) @[simp] theorem meromorphicGerm_coe {f : ℂ → ℂ} : MeromorphicGerm z₀ (f : Filter.Germ (𝓝[≠] z₀) ℂ) ↔ MeromorphicAt f z₀ := Iff.rfl /-- The ℂ-space of meromorphic germs at `z₀` (a submodule of the full germ module). -/ +@[expose] def meromorphicGermsAt (z₀ : ℂ) : Submodule ℂ (Filter.Germ (𝓝[≠] z₀) ℂ) where carrier := {γ | MeromorphicGerm z₀ γ} zero_mem' := analyticAt_const.meromorphicAt @@ -91,6 +92,6 @@ noncomputable def laurentCoeffL (z₀ : ℂ) (k : ℤ) : meromorphicGermsAt z₀ noncomputable def resL (z₀ : ℂ) : meromorphicGermsAt z₀ →ₗ[ℂ] ℂ := laurentCoeffL z₀ (-1) @[simp] theorem laurentCoeffL_mk {f : ℂ → ℂ} (hf : MeromorphicAt f z₀) (k : ℤ) : - laurentCoeffL z₀ k ⟨(f : Filter.Germ (𝓝[≠] z₀) ℂ), hf⟩ = laurentCoeffAt f z₀ k := rfl + laurentCoeffL z₀ k ⟨(f : Filter.Germ (𝓝[≠] z₀) ℂ), hf⟩ = laurentCoeffAt f z₀ k := by rfl end RS diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/IntegralBridge.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/IntegralBridge.lean index 2b49a2bb7c..3991603ea7 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/IntegralBridge.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/IntegralBridge.lean @@ -25,7 +25,7 @@ Main exports: `RS.circleIntegral_eq_two_pi_I_mul_resAt`, `RS.MeromorphicAt.eventually_circleIntegral_eq_two_pi_I_mul_resAt`. -/ -@[expose] public section +public section open Filter Topology Metric Function Real Complex diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/LaurentCoeff.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/LaurentCoeff.lean index 5457e0eb07..767b342032 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/LaurentCoeff.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/LaurentCoeff.lean @@ -31,7 +31,7 @@ Main exports: * `RS.forall_neg_laurentCoeffAt_eq_zero_iff` — vanishing tail ↔ analytic-after-repair. -/ -@[expose] public section +public section open Filter Topology Metric Function diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/MittagLeffler.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/MittagLeffler.lean index da7f2aaa88..f7d9e645c3 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/MittagLeffler.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/MittagLeffler.lean @@ -33,7 +33,7 @@ Main exports: `RS.PrincipalPartData`, `RS.PrincipalPartData.Realizes`, interface. -/ -@[expose] public section +public section open Filter Topology Metric Function @@ -79,6 +79,7 @@ def principalPartCarrier (U : Set ℂ) : Submodule ℂ (ℂ → (ℤ →₀ ℂ) /-- A Mittag-Leffler datum of principal parts on `U ⊆ ℂ`: at finitely many points, a finite tail of negative-exponent Laurent coefficients. -/ +@[expose] def PrincipalPartData (U : Set ℂ) : Type := ↥(principalPartCarrier U) namespace PrincipalPartData @@ -105,14 +106,15 @@ def mk' (coeff : ℂ → (ℤ →₀ ℂ)) (coeff_neg : ∀ p, ∀ k ∈ (coeff ⟨coeff, coeff_neg, mem_of_ne_zero, finite_support⟩ @[simp] theorem coeff_mk' (coeff) (coeff_neg) (mem_of_ne_zero) (finite_support) : - (mk' coeff coeff_neg mem_of_ne_zero finite_support : PrincipalPartData U).coeff = coeff := rfl + (mk' coeff coeff_neg mem_of_ne_zero finite_support : PrincipalPartData U).coeff = coeff := by + rfl -@[simp] theorem coeff_zero : (0 : PrincipalPartData U).coeff = 0 := rfl +@[simp] theorem coeff_zero : (0 : PrincipalPartData U).coeff = 0 := by rfl @[simp] theorem coeff_add (D E : PrincipalPartData U) : - (D + E).coeff = D.coeff + E.coeff := rfl -@[simp] theorem coeff_neg_fun (D : PrincipalPartData U) : (-D).coeff = -D.coeff := rfl + (D + E).coeff = D.coeff + E.coeff := by rfl +@[simp] theorem coeff_neg_fun (D : PrincipalPartData U) : (-D).coeff = -D.coeff := by rfl @[simp] theorem coeff_smul (c : ℂ) (D : PrincipalPartData U) : - (c • D).coeff = c • D.coeff := rfl + (c • D).coeff = c • D.coeff := by rfl /-- `f` realizes the datum on `U`: meromorphic with exactly these principal parts. -/ def Realizes (f : ℂ → ℂ) (D : PrincipalPartData U) : Prop := diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/PrincipalPart.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/PrincipalPart.lean index 395463d57b..fd4cf48605 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/PrincipalPart.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/PrincipalPart.lean @@ -27,7 +27,7 @@ Main exports: * `RS.eq_principalPart_of_eventuallyEq` — uniqueness of tail + analytic decompositions. -/ -@[expose] public section +public section open Filter Topology Metric Function @@ -38,7 +38,7 @@ variable {f g h : ℂ → ℂ} {z₀ : ℂ} {k n : ℤ} /-- The principal part of `f` at `z₀`: the finite sum of the negative-exponent Laurent terms. An honest function `ℂ → ℂ`, analytic on `ℂ \ {z₀}`, meromorphic at `z₀`. Zero (empty sum) when `f` is analytic-after-repair at `z₀`, not meromorphic there, or locally `0`. -/ -noncomputable def principalPartAt (f : ℂ → ℂ) (z₀ : ℂ) : ℂ → ℂ := fun z => +@[expose] noncomputable def principalPartAt (f : ℂ → ℂ) (z₀ : ℂ) : ℂ → ℂ := fun z => ∑ k ∈ Finset.Icc (meromorphicOrderAt f z₀).untop₀ (-1), laurentCoeffAt f z₀ k * (z - z₀) ^ k diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/Residue.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/Residue.lean index a20b439342..13495191da 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/Residue.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/Residue.lean @@ -31,7 +31,7 @@ Main exports: (Miranda VI.3 `Res_ω` shape `Σ c_n a_{−1−n}`). -/ -@[expose] public section +public section open Filter Topology Metric Function @@ -41,6 +41,7 @@ variable {f g h : ℂ → ℂ} {z₀ : ℂ} {k n : ℤ} /-- The residue of `f` at `z₀`: the `(-1)`-st Laurent coefficient. Purely algebraic; the circle-integral characterization is `RS.circleIntegral_eq_two_pi_I_mul_resAt`. -/ +@[expose] noncomputable def resAt (f : ℂ → ℂ) (z₀ : ℂ) : ℂ := laurentCoeffAt f z₀ (-1) theorem resAt_congr (hfg : f =ᶠ[𝓝[≠] z₀] g) : resAt f z₀ = resAt g z₀ := diff --git a/LeanPool/JacobianDiffgeo/ResidueCalculus/TaylorCoeff.lean b/LeanPool/JacobianDiffgeo/ResidueCalculus/TaylorCoeff.lean index d0b6340188..e0fdbe2a0e 100644 --- a/LeanPool/JacobianDiffgeo/ResidueCalculus/TaylorCoeff.lean +++ b/LeanPool/JacobianDiffgeo/ResidueCalculus/TaylorCoeff.lean @@ -28,7 +28,7 @@ Main exports: * `RS.AnalyticAt.exists_taylor_remainder` — exact, pointwise Taylor remainder factorization. -/ -@[expose] public section +public section open Filter Topology Metric Function @@ -39,6 +39,7 @@ variable {f g F : ℂ → ℂ} {z₀ : ℂ} /-- The `j`-th Taylor coefficient of `g` at `z₀`, extracted by iterated difference quotients. For `g` analytic at `z₀` with power series `p` this equals `p.coeff j`. Junk for non-smooth `g` (whatever the iterated `dslope` evaluates to). -/ +@[expose] noncomputable def taylorCoeffAt (g : ℂ → ℂ) (z₀ : ℂ) (j : ℕ) : ℂ := (Function.swap dslope z₀)^[j] g z₀ diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem.lean index c043954781..354f60114b 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem.lean @@ -96,4 +96,4 @@ Area-Gluing atom of §3–5 was NOT built, as instructed). at design time in `docs/design/residue-theorem.md` §11). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem/Calibrated.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem/Calibrated.lean index 4903adcf6b..9e919bd291 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem/Calibrated.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem/Calibrated.lean @@ -33,7 +33,7 @@ conclusion `∀ y, A.e' y = chartAt ℂ (F x) y - chartAt ℂ (F x) (F x)` threa recentered `chartAt ℂ y₀`; this discharges `resAtP1_trace_eq_sum`'s `hcal` verbatim. -/ -@[expose] public section +public section open Filter Set OpenPartialHomeomorph Metric Function open scoped ContDiff Manifold Topology diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem/MFormCompat.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem/MFormCompat.lean index 032ab21de8..9de230b9c8 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem/MFormCompat.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem/MFormCompat.lean @@ -26,7 +26,7 @@ quotient API live in a clearly-marked NEW file rather than editing `Jacobian/Can Request filed in `docs/requests/canonical-forms.md`-spirit: these belong upstream eventually. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem/P1Assembly.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem/P1Assembly.lean index 72686f5eeb..78dea7c7b8 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem/P1Assembly.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem/P1Assembly.lean @@ -42,7 +42,7 @@ key honesty input making the `∞`-chart congruences legitimate for a RAW repres forces `R` to be honestly analytic near `∞`. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter Topology OnePoint Real Complex MeasureTheory diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem/RationalOnP1.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem/RationalOnP1.lean index 09b675152c..093ba908fd 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem/RationalOnP1.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem/RationalOnP1.lean @@ -82,7 +82,7 @@ now-known-insufficient `Differentiable ℂ R_mid` hypothesis and would need re-t whichever fix is chosen. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter Topology OnePoint Real Complex MeasureTheory @@ -123,9 +123,10 @@ def formOfCoeFn (R : ℂ → ℂ) (hR : MeromorphicOn R Set.univ) | infty => rw [chartAt_infty] at hz ⊢ simp only [OnePoint.elim_infty] - have hval : invChart (invChart.symm z) = z := invChart.right_inv (Set.mem_univ z) + have hval : invChart (invChart.symm z) = z := + invChart.right_inv (by rw [invChart_target]; exact Set.mem_univ z) have heq : (⇑invChart ∘ ⇑invChart.symm : ℂ → ℂ) = id := by - funext w; exact invChart.right_inv (Set.mem_univ w) + funext w; exact invChart.right_inv (by rw [invChart_target]; exact Set.mem_univ w) rw [hval, heq, deriv_id, one_mul] | coe q => rw [chartAt_infty, chartAt_coe] at hz ⊢ @@ -183,6 +184,14 @@ def formOfCoeFn (R : ℂ → ℂ) (hR : MeromorphicOn R Set.univ) rw [hval, heq, deriv_id, one_mul] rfl +theorem formOfCoeFn_coeffAt_infty (R : ℂ → ℂ) (hR : MeromorphicOn R Set.univ) + (hR' : MeromorphicOn (fun w => -(w ^ 2)⁻¹ * R w⁻¹) Set.univ) : + (formOfCoeFn R hR hR').coeffAt ∞ = fun w => -(w ^ 2)⁻¹ * R w⁻¹ := by rfl + +theorem formOfCoeFn_coeffAt_coe (R : ℂ → ℂ) (hR : MeromorphicOn R Set.univ) + (hR' : MeromorphicOn (fun w => -(w ^ 2)⁻¹ * R w⁻¹) Set.univ) (a : ℂ) : + (formOfCoeFn R hR hR').coeffAt (a : OnePoint ℂ) = R := by rfl + /-- The `coeChart` reading of an `MFormData (OnePoint ℂ)` is the same function for every finite basepoint (`ℙ¹`'s finite points all share the identical `coeChart`, and `compat` with the identity transition forces literal equality of the raw functions, not just a germ agreement). -/ diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem/Reduction.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem/Reduction.lean index 445fe02504..b1badac0b6 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem/Reduction.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem/Reduction.lean @@ -57,7 +57,7 @@ duplicate the ~90-line proof or require importing residue-theorem back into cano (`import Jacobian.CanonicalForms.Existence`, above) — the call site below is unchanged. -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Filter Topology OnePoint Function @@ -78,7 +78,7 @@ omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in private theorem resAt_smul_d (h φ : ℳ X) (x : X) : (h • MForm.d φ).resAt x = RS.resAt (fun z => h.holoRepr ((chartAt ℂ x).symm z) * deriv (φ.holoRepr ∘ ⇑(chartAt ℂ x).symm) z) (chartAt ℂ x x) := by - have hd : MForm.d φ = MForm.mk (MFormData.d φ) := rfl + have hd : MForm.d φ = MForm.mk (MFormData.d φ) := MForm.d_eq_mk φ rw [hd, MForm.mero_smul_mk, MForm.resAt_mk] change RS.resAt ((MFormData.smul h (MFormData.d φ)).coeffAt x) (chartAt ℂ x x) = _ apply RS.resAt_congr @@ -86,9 +86,7 @@ private theorem resAt_smul_d (h φ : ℳ X) (x : X) : eventually_nhdsWithin_of_eventually_nhds ((chartAt ℂ x).open_target.mem_nhds (mem_chart_target ℂ x)) filter_upwards [htarget] with z hz - change h.holoRepr ((chartAt ℂ x).symm z) * - (if z ∈ (chartAt ℂ x).target then deriv (φ.holoRepr ∘ ⇑(chartAt ℂ x).symm) z else 0) = _ - rw [ite_eq_left hz] + rw [MFormData.coeffAt_smul_meromorphic, MFormData.coeffAt_d φ x hz] /-! ### Honesty of `toP1 ∘ holoRepr` at nonnegative-order points -/ @@ -366,8 +364,8 @@ theorem residue_sum_eq_zero_of_exists_nonconstant = RS.resAt (fun w => -(w ^ 2)⁻¹ * R_T w⁻¹) 0 := by change RS.resAt (θT.coeffAt (∞ : OnePoint ℂ)) (chartAt ℂ (∞ : OnePoint ℂ) (∞ : OnePoint ℂ)) = _ - rw [P1.chartAt_infty, P1.invChart_apply_infty] - rfl + rw [P1.chartAt_infty, P1.invChart_apply_infty, hθT_def, + P1.formOfCoeFn_coeffAt_infty] have hP1 : FormTrace.resAtP1 (MTrace.trace F Hinf) (∞ : OnePoint ℂ) = RS.resAt (MTrace.trace F Hinf ∘ ⇑P1.invChart.symm) 0 := by rw [FormTrace.resAtP1_def, P1.chartAt_infty, P1.invChart_apply_infty] @@ -389,8 +387,8 @@ theorem residue_sum_eq_zero_of_exists_nonconstant have hL : (MForm.mk θT).resAt ((a : ℂ) : OnePoint ℂ) = RS.resAt R_T a := by change RS.resAt (θT.coeffAt (((a : ℂ) : OnePoint ℂ))) (chartAt ℂ (((a : ℂ) : OnePoint ℂ)) (((a : ℂ) : OnePoint ℂ))) = _ - rw [P1.chartAt_coe, P1.coeChart_apply_coe] - rfl + rw [P1.chartAt_coe, P1.coeChart_apply_coe, hθT_def, + P1.formOfCoeFn_coeffAt_coe] have hP1 : FormTrace.resAtP1 (MTrace.trace F h.holoRepr) ((a : ℂ) : OnePoint ℂ) = RS.resAt R_T a := by rw [FormTrace.resAtP1_def, P1.chartAt_coe, P1.coeChart_apply_coe] diff --git a/LeanPool/JacobianDiffgeo/ResidueTheorem/Unconditional.lean b/LeanPool/JacobianDiffgeo/ResidueTheorem/Unconditional.lean index 1f40cddcf2..120fc5b7df 100644 --- a/LeanPool/JacobianDiffgeo/ResidueTheorem/Unconditional.lean +++ b/LeanPool/JacobianDiffgeo/ResidueTheorem/Unconditional.lean @@ -34,7 +34,7 @@ by discharging `hex` with `RS.exists_nonconstant_mero` — each a one-line corol the `Finset`-flexible unconditional corollary. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/RiemannRoch.lean b/LeanPool/JacobianDiffgeo/RiemannRoch.lean index 5ccad3f00d..58a567b953 100644 --- a/LeanPool/JacobianDiffgeo/RiemannRoch.lean +++ b/LeanPool/JacobianDiffgeo/RiemannRoch.lean @@ -39,4 +39,4 @@ and Serre-duality export bank; no new mathematics, no reference to `T D`/`pairT` `l(single P 1) ≥ 2`, extracting a function with a single simple pole). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/RiemannRoch/Basic.lean b/LeanPool/JacobianDiffgeo/RiemannRoch/Basic.lean index dea8c24b48..9653d81ca9 100644 --- a/LeanPool/JacobianDiffgeo/RiemannRoch/Basic.lean +++ b/LeanPool/JacobianDiffgeo/RiemannRoch/Basic.lean @@ -29,7 +29,7 @@ Serre-duality export bank (`l_sub_eq_h1T`, `h1T_zero_eq_genus`, `h1T_zero_eq_l_K `genus-zero-headline` (#30) consumes. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/SerrePairing.lean b/LeanPool/JacobianDiffgeo/SerrePairing.lean index bc8a191770..2d991142b7 100644 --- a/LeanPool/JacobianDiffgeo/SerrePairing.lean +++ b/LeanPool/JacobianDiffgeo/SerrePairing.lean @@ -137,4 +137,4 @@ spike-verified here) and citing `exists_tail_pair_ne_zero`'s shape directly; `Ta offered but not required. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/SerrePairing/Duality.lean b/LeanPool/JacobianDiffgeo/SerrePairing/Duality.lean index 899450985b..eeaf0338fc 100644 --- a/LeanPool/JacobianDiffgeo/SerrePairing/Duality.lean +++ b/LeanPool/JacobianDiffgeo/SerrePairing/Duality.lean @@ -37,7 +37,7 @@ is now instance-free and `Module.finrank` needs no topology, so both theorems he `CONVENTIONS.md`'s "drop hypotheses lemmas don't need, when free to do so". -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -54,6 +54,7 @@ the residue-calculus atom the whole injectivity core rests on). -/ theorem laurentCoeffAt_ord_ne_zero {Θ : MForm X} {x : X} (h : Θ.ord x ≠ ⊤) : Θ.laurentCoeffAt x (Θ.ord x).untop₀ ≠ 0 := by obtain ⟨θ, rfl⟩ := MForm.exists_rep Θ + rw [MForm.laurentCoeffAt_mk, MForm.ord_mk] exact RS.laurentCoeffAt_order_ne_zero (θ.meromorphicAt_coeffAt x) h end MForm @@ -73,7 +74,7 @@ theorem exists_tail_pair_ne_zero {D : RS.Divisor X} {Θ : MForm X} have hp : Θ.ord p ≠ ⊤ := MForm.ord_ne_top hΘ0 p set k : ℤ := (Θ.ord p).untop₀ with hk_def have hk_eq : ((k : ℤ) : WithTop ℤ) = Θ.ord p := WithTop.coe_untop₀_of_ne_top hp - have h1 : ((-((-D) p) : ℤ) : WithTop ℤ) ≤ Θ.ord p := hΘ p + have h1 : ((-((-D) p) : ℤ) : WithTop ℤ) ≤ Θ.ord p := (MForm.mem_omegaSpace_iff.mp hΘ) p rw [Divisor.neg_apply, neg_neg, ← hk_eq] at h1 have hDp : D p ≤ k := by exact_mod_cast h1 refine ⟨Tail.single p (-1 - k) 1, Tail.single_boundedBy (fun _ => by omega), ?_⟩ @@ -128,7 +129,7 @@ theorem pair_congr_of_toH_eq (toH : ↥(TailSpace D) →ₗ[ℂ] H) have hz := hwd Θ hΘ δ hδker rw [hδcoe] at hz have hlin : pair Θ ((τ : Tail X) - (σ : Tail X)) = pair Θ (τ : Tail X) - pair Θ (σ : Tail X) := - map_sub (pairL Θ) (τ : Tail X) (σ : Tail X) + by simpa only [pairL_apply] using map_sub (pairL Θ) (τ : Tail X) (σ : Tail X) rw [hlin] at hz exact sub_eq_zero.mp hz @@ -194,15 +195,14 @@ theorem finrank_omegaSpace_le (toH : ↥(TailSpace D) →ₗ[ℂ] H) (hsurj : Fu have hsub0 : Θ1.1 - Θ2.1 ≠ 0 := sub_ne_zero.2 hne have hmem : Θ1.1 - Θ2.1 ∈ MForm.OmegaSpace (-D) := Submodule.sub_mem _ Θ1.2 Θ2.2 obtain ⟨τ0, hτ0bd, hτ0ne⟩ := exists_tail_pair_ne_zero hmem hsub0 - have hτ0mem : τ0 ∈ TailSpace D := hτ0bd + have hτ0mem : τ0 ∈ TailSpace D := mem_tailSpace_iff.mpr hτ0bd apply hτ0ne have hΦ : resDual toH hwd hsurj Θ1 (toH ⟨τ0, hτ0mem⟩) = resDual toH hwd hsurj Θ2 (toH ⟨τ0, hτ0mem⟩) := LinearMap.ext_iff.1 heq (toH ⟨τ0, hτ0mem⟩) rw [resDual_apply_toH, resDual_apply_toH] at hΦ have hlin : pair (Θ1.1 - Θ2.1) τ0 = pair Θ1.1 τ0 - pair Θ2.1 τ0 := by - change pairL (Θ1.1 - Θ2.1) τ0 = pairL Θ1.1 τ0 - pairL Θ2.1 τ0 - rw [map_sub, LinearMap.sub_apply] + simp only [← pairL_apply, map_sub, LinearMap.sub_apply] rw [hlin, hΦ, sub_self] rw [show Module.finrank ℂ (MForm.OmegaSpace (-D)) = Module.finrank ℂ ↥(MForm.OmegaSpace (-D)) from rfl, ← Subspace.dual_finrank_eq (K := ℂ) (V := H)] diff --git a/LeanPool/JacobianDiffgeo/SerrePairing/Pairing.lean b/LeanPool/JacobianDiffgeo/SerrePairing/Pairing.lean index 7e03db68ad..a2b4769ae8 100644 --- a/LeanPool/JacobianDiffgeo/SerrePairing/Pairing.lean +++ b/LeanPool/JacobianDiffgeo/SerrePairing/Pairing.lean @@ -37,7 +37,7 @@ via representatives + residue-calculus's `laurentCoeffAt_fun_add`/`_const_mul`/` (coordination note filed to `docs/requests/canonical-forms.md`). -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -143,7 +143,7 @@ def pairL : MForm X →ₗ[ℂ] Tail X →ₗ[ℂ] ℂ where map_add' := pairTail_add_left map_smul' := pairTail_smul_left -@[simp] theorem pairL_apply (θ : MForm X) (τ : Tail X) : pairL θ τ = pair θ τ := rfl +@[simp] theorem pairL_apply (θ : MForm X) (τ : Tail X) : pairL θ τ = pair θ τ := by rfl theorem pair_add_left (θ η : MForm X) (τ : Tail X) : pair (θ + η) τ = pair θ τ + pair η τ := by change pairTail (θ + η) τ = pairTail θ τ + pairTail η τ diff --git a/LeanPool/JacobianDiffgeo/SerrePairing/TailSpace.lean b/LeanPool/JacobianDiffgeo/SerrePairing/TailSpace.lean index 206697f742..881e1dce2e 100644 --- a/LeanPool/JacobianDiffgeo/SerrePairing/TailSpace.lean +++ b/LeanPool/JacobianDiffgeo/SerrePairing/TailSpace.lean @@ -30,7 +30,7 @@ sibling unit laurent-tails independently discovered that a plain `def` wrapping every `Finsupp` instance transport for free), so no manual instances are needed at all. -/ -@[expose] public section +public section open scoped ContDiff Manifold @@ -86,7 +86,7 @@ omit [IsManifold 𝓘(ℂ, ℂ) ω X] [ChartedSpace ℂ X] in τ ∈ TailSpace D ↔ τ.BoundedBy D := Iff.rfl /-- A single-point, single-exponent test tail. -/ -noncomputable def Tail.single (p : X) (n : ℤ) (c : ℂ) : Tail X := +@[expose] noncomputable def Tail.single (p : X) (n : ℤ) (c : ℂ) : Tail X := Finsupp.single p (Finsupp.single n c) open scoped Classical in diff --git a/LeanPool/JacobianDiffgeo/SphereTopology.lean b/LeanPool/JacobianDiffgeo/SphereTopology.lean index 564bbc2ad4..341914f689 100644 --- a/LeanPool/JacobianDiffgeo/SphereTopology.lean +++ b/LeanPool/JacobianDiffgeo/SphereTopology.lean @@ -53,4 +53,4 @@ re-derive the same conclusion from its own chain-continuation `IsPrimitiveAlongM fact — both routes agree, no dependency is required either way). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/SphereTopology/GlobalPrimitive.lean b/LeanPool/JacobianDiffgeo/SphereTopology/GlobalPrimitive.lean index 84f29c7a12..b7440d686f 100644 --- a/LeanPool/JacobianDiffgeo/SphereTopology/GlobalPrimitive.lean +++ b/LeanPool/JacobianDiffgeo/SphereTopology/GlobalPrimitive.lean @@ -34,7 +34,7 @@ Main declarations: instance, and the headline `RS.SphereTopology.genus_eq_zero_of_simplyConnectedSpace`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology IsManifold RS Metric diff --git a/LeanPool/JacobianDiffgeo/SphereTopology/Headline.lean b/LeanPool/JacobianDiffgeo/SphereTopology/Headline.lean index 037a7e8b7e..2d02599b85 100644 --- a/LeanPool/JacobianDiffgeo/SphereTopology/Headline.lean +++ b/LeanPool/JacobianDiffgeo/SphereTopology/Headline.lean @@ -24,7 +24,7 @@ compact Riemann surface has genus `0`) into the exact backward-headline signatur Main declaration: `RS.SphereTopology.genus_eq_zero_of_homeo_sphere`. -/ -@[expose] public section +public section open scoped ContDiff Manifold diff --git a/LeanPool/JacobianDiffgeo/SphereTopology/SimplyConnectedP1.lean b/LeanPool/JacobianDiffgeo/SphereTopology/SimplyConnectedP1.lean index eb17442c43..55f374a5e3 100644 --- a/LeanPool/JacobianDiffgeo/SphereTopology/SimplyConnectedP1.lean +++ b/LeanPool/JacobianDiffgeo/SphereTopology/SimplyConnectedP1.lean @@ -38,7 +38,7 @@ Main declarations: * `RS.SphereTopology.simplyConnectedSpace_sphere` (the challenge sphere model). -/ -@[expose] public section +public section open scoped ContDiff Manifold OnePoint open Set Topology OnePoint RS RS.P1 diff --git a/LeanPool/JacobianDiffgeo/Surface.lean b/LeanPool/JacobianDiffgeo/Surface.lean index e2c0405f36..f8e87df6cc 100644 --- a/LeanPool/JacobianDiffgeo/Surface.lean +++ b/LeanPool/JacobianDiffgeo/Surface.lean @@ -39,4 +39,4 @@ API summary (see `docs/design/surfaces-and-charts.md`): `map_nhds_eq_of_deriv_ne_zero`). -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/Surface/Bridges.lean b/LeanPool/JacobianDiffgeo/Surface/Bridges.lean index 6e9cf06bb8..a3522384a0 100644 --- a/LeanPool/JacobianDiffgeo/Surface/Bridges.lean +++ b/LeanPool/JacobianDiffgeo/Surface/Bridges.lean @@ -30,7 +30,7 @@ manifold smoothness/holomorphy into planar statements about the chart composites `contMDiffOn_iff_analyticOnNhd_of_subset_source`: holomorphy may be read in ANY atlas chart. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology IsManifold diff --git a/LeanPool/JacobianDiffgeo/Surface/ChartedSpaceKit.lean b/LeanPool/JacobianDiffgeo/Surface/ChartedSpaceKit.lean index eb017dc2c4..e5ced30f2e 100644 --- a/LeanPool/JacobianDiffgeo/Surface/ChartedSpaceKit.lean +++ b/LeanPool/JacobianDiffgeo/Surface/ChartedSpaceKit.lean @@ -26,7 +26,7 @@ Toolkit for projective-line (CC5: two charts on `OnePoint ℂ`) and jacobian-con This file is standalone (it does not assume a pre-existing surface). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set @@ -36,7 +36,7 @@ namespace RS variable {Z : Type*} [TopologicalSpace Z] {ι : Type*} /-- Package a covering family of ℂ-charts as a `ChartedSpace`. -/ -@[reducible] def chartedSpaceOfFamily (c : ι → OpenPartialHomeomorph Z ℂ) (idx : Z → ι) +@[expose, reducible] def chartedSpaceOfFamily (c : ι → OpenPartialHomeomorph Z ℂ) (idx : Z → ι) (h : ∀ z, z ∈ (c (idx z)).source) : ChartedSpace ℂ Z where atlas := Set.range c chartAt z := c (idx z) diff --git a/LeanPool/JacobianDiffgeo/Surface/Identity.lean b/LeanPool/JacobianDiffgeo/Surface/Identity.lean index 89e2bc9361..9813db1655 100644 --- a/LeanPool/JacobianDiffgeo/Surface/Identity.lean +++ b/LeanPool/JacobianDiffgeo/Surface/Identity.lean @@ -29,7 +29,7 @@ For holomorphic maps between Riemann surfaces: (Forster 2.7; consumed by mapping-degree and the headline). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology IsManifold diff --git a/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean b/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean index eea981e1b6..2311db86e9 100644 --- a/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean +++ b/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean @@ -32,7 +32,7 @@ The planar input is mathlib's analytic inverse function theorem (`AnalyticAt.analyticAt_localInverse`, `HasStrictFDerivAt.toOpenPartialHomeomorph`). -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology IsManifold diff --git a/LeanPool/JacobianDiffgeo/Surface/RealSmooth.lean b/LeanPool/JacobianDiffgeo/Surface/RealSmooth.lean index 23d649ed78..4b94ca1669 100644 --- a/LeanPool/JacobianDiffgeo/Surface/RealSmooth.lean +++ b/LeanPool/JacobianDiffgeo/Surface/RealSmooth.lean @@ -29,7 +29,7 @@ instance. This file provides, once and for all: * `exists_smoothPartitionOfUnity` on a compact T2 surface. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set Filter Topology IsManifold diff --git a/LeanPool/JacobianDiffgeo/TailDuality.lean b/LeanPool/JacobianDiffgeo/TailDuality.lean index 30b6658494..e633c8a7a0 100644 --- a/LeanPool/JacobianDiffgeo/TailDuality.lean +++ b/LeanPool/JacobianDiffgeo/TailDuality.lean @@ -101,4 +101,4 @@ a finite-dimensional space). conditional equivalence as a hypothesis. -/ -@[expose] public section +public section diff --git a/LeanPool/JacobianDiffgeo/TailDuality/ChiLedger.lean b/LeanPool/JacobianDiffgeo/TailDuality/ChiLedger.lean index 97ea4691d3..159f61ab23 100644 --- a/LeanPool/JacobianDiffgeo/TailDuality/ChiLedger.lean +++ b/LeanPool/JacobianDiffgeo/TailDuality/ChiLedger.lean @@ -51,7 +51,7 @@ out of scope, per `Comparison.lean`/the root docstring) — it is not used here * **`chiT_eq_chiT_zero_add_degree (D) : chiT D = chiT 0 + D.degree`** — the primary deliverable. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace @@ -92,7 +92,7 @@ noncomputable def windowConnectT {D D' : RS.Divisor X} (h : D ≤ D') : (H1Tail.mk D).comp (RS.LaurentTail.windowToT D D' h) theorem windowConnectT_apply {D D' : RS.Divisor X} (h : D ≤ D') (w : RS.Cech.Window D D') : - windowConnectT h w = H1Tail.mk D (RS.LaurentTail.windowToT D D' h w) := rfl + windowConnectT h w = H1Tail.mk D (RS.LaurentTail.windowToT D D' h w) := by rfl omit [ConnectedSpace X] [T1Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] in /-- `windowToT`'s value off the witness `Finset` is `0` (unfolds `T.mk`). -/ diff --git a/LeanPool/JacobianDiffgeo/TailDuality/Counting.lean b/LeanPool/JacobianDiffgeo/TailDuality/Counting.lean index b13c789872..94d3f26e45 100644 --- a/LeanPool/JacobianDiffgeo/TailDuality/Counting.lean +++ b/LeanPool/JacobianDiffgeo/TailDuality/Counting.lean @@ -30,7 +30,7 @@ Unit: serre-duality-tails (`docs/design/serre-duality-tails.md` §6 P5, addendum * `exists_mul_functional_eq`: **MIRANDA LEMMA 3.4**. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace @@ -48,12 +48,13 @@ noncomputable instance instFiniteDimensional_H1Tail (D : RS.Divisor X) : FiniteDimensional.of_injective (H1Tail.toH1 D) (H1Tail.toH1_injective D) /-- The tail-level `h¹`. -/ -noncomputable def h1T (D : RS.Divisor X) : ℕ := Module.finrank ℂ (H1Tail D) +@[expose] noncomputable def h1T (D : RS.Divisor X) : ℕ := Module.finrank ℂ (H1Tail D) /-- `h1T D ≤ h1 D` (Čech), via the injection `H1Tail.toH1` — the ONE fact Lemma 3.4's arithmetic borrows from the Čech side (no tail-level six-term ledger needed). -/ -theorem h1T_le_h1 (D : RS.Divisor X) : h1T D ≤ RS.Finiteness.h1 D := - LinearMap.finrank_le_finrank_of_injective (H1Tail.toH1_injective D) +theorem h1T_le_h1 (D : RS.Divisor X) : h1T D ≤ RS.Finiteness.h1 D := by + rw [RS.Finiteness.h1_eq_finrank] + exact LinearMap.finrank_le_finrank_of_injective (H1Tail.toH1_injective D) /-! ### `nuPairDual`: the pair map into `Dual (H1Tail (A - C))` -/ diff --git a/LeanPool/JacobianDiffgeo/TailDuality/Duality.lean b/LeanPool/JacobianDiffgeo/TailDuality/Duality.lean index 6da03c00d2..01c7f2ee90 100644 --- a/LeanPool/JacobianDiffgeo/TailDuality/Duality.lean +++ b/LeanPool/JacobianDiffgeo/TailDuality/Duality.lean @@ -35,7 +35,7 @@ facts proved elementarily (no Čech `H1`/cochain machinery: `H1Tail D` being a l own docstring for the full account. riemann-roch (#28) now consumes `chiT`'s own ledger directly. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace @@ -281,7 +281,7 @@ theorem h1T_zero_eq_l_K {ω₀ : MForm X} (h₀ : ω₀ ≠ 0) : theorem h1T_zero_eq_genus : h1T (0 : RS.Divisor X) = genus X := by rw [← i_neg_eq_h1T (0 : RS.Divisor X), neg_zero] - exact RS.genus_eq_finrank_omegaSpace_zero.symm + exact (RS.genus_eq_finrank_omegaSpace_zero (X := X)).symm theorem h1T_canonical {ω₀ : MForm X} (h₀ : ω₀ ≠ 0) : h1T (RS.canonicalDivisorOf ω₀) = 1 := by @@ -292,6 +292,6 @@ theorem h1T_canonical {ω₀ : MForm X} (h₀ : ω₀ ≠ 0) : /-- The tail-level `χ`. Additivity (`chiT D = chiT 0 + deg D`) is NOT delivered — see the file docstring. -/ -noncomputable def chiT (D : RS.Divisor X) : ℤ := (RS.l D : ℤ) - (h1T D : ℤ) +@[expose] noncomputable def chiT (D : RS.Divisor X) : ℤ := (RS.l D : ℤ) - (h1T D : ℤ) end RS.TailDuality diff --git a/LeanPool/JacobianDiffgeo/TailDuality/Pairing.lean b/LeanPool/JacobianDiffgeo/TailDuality/Pairing.lean index bacb66a2e2..f09cabb435 100644 --- a/LeanPool/JacobianDiffgeo/TailDuality/Pairing.lean +++ b/LeanPool/JacobianDiffgeo/TailDuality/Pairing.lean @@ -35,7 +35,7 @@ functional needs). All PUBLIC lemmas are stated at the `MForm`/`laurentCoeffAt` * `resMap`/`resMap_injective`: the induced map `Ω(-D) →ₗ Dual(H1Tail D)`. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace Filter Topology @@ -71,7 +71,7 @@ noncomputable def readAt (p : X) : omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] in @[simp] theorem readAt_mk (p : X) {f : X → ℂ} (hf : RS.MeromorphicOnX f (chartAt ℂ p).source) : - readAt p (RS.MeroGermOn.mk f hf) = (f ∘ (chartAt ℂ p).symm : Filter.Germ _ ℂ) := rfl + readAt p (RS.MeroGermOn.mk f hf) = (f ∘ (chartAt ℂ p).symm : Filter.Germ _ ℂ) := by rfl omit [T2Space X] [IsManifold 𝓘(ℂ, ℂ) ω X] in theorem meromorphicGerm_readAt (p : X) (ψ : RS.MeroGermOn X (chartAt ℂ p).source) : @@ -156,7 +156,7 @@ omit [T2Space X] in theorem pairAtData_mk (θ : MFormData X) (p : X) {f : X → ℂ} (hf : RS.MeromorphicOnX f (chartAt ℂ p).source) : pairAtData θ p (RS.MeroGermOn.mk f hf) = - RS.resAt (fun z => f ((chartAt ℂ p).symm z) * θ.coeffAt p z) (chartAt ℂ p p) := rfl + RS.resAt (fun z => f ((chartAt ℂ p).symm z) * θ.coeffAt p z) (chartAt ℂ p p) := by rfl omit [T2Space X] in theorem pairAtData_congr {θ θ' : MFormData X} (p : X) @@ -176,7 +176,7 @@ noncomputable def pairAt (θ : MForm X) (p : X) : Quotient.liftOn θ (pairAtData · p) (fun _ _ hab => pairAtData_congr p (hab p)) omit [T2Space X] in -theorem pairAt_apply_mk (θ : MFormData X) (p : X) : pairAt (MForm.mk θ) p = pairAtData θ p := rfl +theorem pairAt_apply_mk (θ : MFormData X) (p : X) : pairAt (MForm.mk θ) p = pairAtData θ p := by rfl omit [T2Space X] in theorem pairAt_tailGerm (θ : MForm X) (p : X) (m : ℤ) : @@ -453,7 +453,7 @@ theorem pairT_alpha {D : RS.Divisor X} (θ : MForm X) (hθ : θ ∈ MForm.OmegaS (f : RS.Mero X) : pairT θ hθ (alphaL D f) = 0 := by have hsum : pairT θ hθ (alphaL D f) = ∑ p ∈ alphaFinset D f, (f • θ).resAt p := by - change pairT θ hθ (alpha D f) = _ + rw [alphaL_apply] rw [alpha_eq_sum_singleT, map_sum] apply Finset.sum_congr rfl intro p _ diff --git a/LeanPool/JacobianDiffgeo/TailDuality/TailOps.lean b/LeanPool/JacobianDiffgeo/TailDuality/TailOps.lean index fe788ac3ba..89bc55dfee 100644 --- a/LeanPool/JacobianDiffgeo/TailDuality/TailOps.lean +++ b/LeanPool/JacobianDiffgeo/TailDuality/TailOps.lean @@ -23,7 +23,7 @@ Unit: serre-duality-tails (`docs/design/serre-duality-tails.md` §3 D1/D3, §5.1 plus the `μ_{1/f}` inversion identity `nuL_mulInto_inv` the surjectivity endgame needs. -/ -@[expose] public section +public section open scoped ContDiff Manifold open Set TopologicalSpace @@ -93,14 +93,13 @@ theorem truncT_alpha [CompactSpace X] [ConnectedSpace X] {D₁ D₂ : RS.Divisor (h : D₁ ≤ D₂) (f : RS.Mero X) : truncT h (alphaL D₁ f) = alphaL D₂ f := by apply DFinsupp.ext intro p - rw [truncT_apply] - change truncAt p h (alpha D₁ f p) = alpha D₂ f p + rw [truncT_apply, alphaL_apply, alphaL_apply] rw [alpha_apply, truncAt_mk, alpha_apply] /-! ### `singleT` (the test-vector tails) -/ /-- A single-point test tail: the class of `ψ` at `p`, zero elsewhere. -/ -noncomputable def singleT (p : X) (D : RS.Divisor X) +@[expose] noncomputable def singleT (p : X) (D : RS.Divisor X) (ψ : RS.MeroGermOn X (chartAt ℂ p).source) : T D := DFinsupp.single p (TailAt.mk p D ψ) @@ -175,7 +174,7 @@ theorem mulIntoAt_surjective {f : RS.Mero X} (hf0 : f ≠ 0) [ConnectedSpace X] rw [mulIntoAt_mk, ← mul_assoc, ← map_mul, mul_inv_cancel₀ hf0, map_one, one_mul] /-- Miranda's `t ∘ μ_f : T D →ₗ T E`, uniform in `f` (linear in `f`, §3 D3). -/ -noncomputable def mulInto (f : RS.Mero X) {D E : RS.Divisor X} +@[expose] noncomputable def mulInto (f : RS.Mero X) {D E : RS.Divisor X} (hf : ∀ p, ((D p - E p : ℤ) : WithTop ℤ) ≤ f.ord p) : T D →ₗ[ℂ] T E where toFun τ := DFinsupp.mapRange (fun p => mulIntoAt f p (hf p)) (fun _ => map_zero _) τ map_add' τ σ := by @@ -233,8 +232,7 @@ theorem mulInto_alpha [CompactSpace X] [ConnectedSpace X] (f : RS.Mero X) mulInto f hf (alphaL D g) = alphaL E (f * g) := by apply DFinsupp.ext intro p - rw [mulInto_apply] - change mulIntoAt f p (hf p) (alpha D g p) = alpha E (f * g) p + rw [mulInto_apply, alphaL_apply, alphaL_apply] rw [alpha_apply, mulIntoAt_mk, ← map_mul, alpha_apply] omit [IsManifold 𝓘(ℂ, ℂ) ω X] [DecidableEq X] in @@ -279,7 +277,7 @@ noncomputable def nuL (A C : RS.Divisor X) [ConnectedSpace X] : omit [IsManifold 𝓘(ℂ, ℂ) ω X] [DecidableEq X] in theorem nuL_apply (A C : RS.Divisor X) [ConnectedSpace X] - (f : ↥(RS.LinSys C)) : nuL A C f = mulInto (f : RS.Mero X) (nu_bound A C f) := rfl + (f : ↥(RS.LinSys C)) : nuL A C f = mulInto (f : RS.Mero X) (nu_bound A C f) := by rfl theorem nuL_alpha (A C : RS.Divisor X) [CompactSpace X] [ConnectedSpace X] (f : ↥(RS.LinSys C)) (g : RS.Mero X) : diff --git a/LeanPool/JohnsonLindenstraussLean.lean b/LeanPool/JohnsonLindenstraussLean.lean index 7ce4ecb050..16377aced8 100644 --- a/LeanPool/JohnsonLindenstraussLean.lean +++ b/LeanPool/JohnsonLindenstraussLean.lean @@ -29,7 +29,7 @@ Tags: dimensionality-reduction, random-projection, johnson-lindenstrauss, gaussi MSC: 68W20, 60G15, 68P05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/JohnsonLindenstraussLean/ChiSquared.lean b/LeanPool/JohnsonLindenstraussLean/ChiSquared.lean index 14903c4f94..1269d42038 100644 --- a/LeanPool/JohnsonLindenstraussLean/ChiSquared.lean +++ b/LeanPool/JohnsonLindenstraussLean/ChiSquared.lean @@ -27,7 +27,7 @@ The analytic crux is reduced to two scalar logarithmic inequalities, proven by the monotonicity of an explicit auxiliary function. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real open scoped ENNReal NNReal @@ -144,6 +144,7 @@ lemma scalar_lower {ε : ℝ} (h0 : 0 < ε) (h1 : ε < 1) : /-! ## The chi-squared random variable and its MGF -/ /-- The product Gaussian measure on `Fin k → ℝ`: `k` i.i.d. `N(0,1)` coordinates. -/ +@[expose] noncomputable def gaussianVec (k : ℕ) : Measure (Fin k → ℝ) := Measure.pi (fun _ => stdGaussian) @@ -152,7 +153,7 @@ instance (k : ℕ) : IsProbabilityMeasure (gaussianVec k) := by /-- The chi-squared random variable with `k` degrees of freedom: the sum of the squared coordinates. -/ -noncomputable def chiSq (k : ℕ) : (Fin k → ℝ) → ℝ := fun ω => ∑ i, (ω i) ^ 2 +@[expose] noncomputable def chiSq (k : ℕ) : (Fin k → ℝ) → ℝ := fun ω => ∑ i, (ω i) ^ 2 /-- **Chi-squared MGF.** For `t < 1/2`, `E[exp (t · S)] = ((1 - 2t)^(-1/2))^k`. -/ theorem chiSq_mgf (k : ℕ) {t : ℝ} (ht : t < 1 / 2) : diff --git a/LeanPool/JohnsonLindenstraussLean/EndToEnd.lean b/LeanPool/JohnsonLindenstraussLean/EndToEnd.lean index fb1f288c4c..02a05cfc6d 100644 --- a/LeanPool/JohnsonLindenstraussLean/EndToEnd.lean +++ b/LeanPool/JohnsonLindenstraussLean/EndToEnd.lean @@ -33,7 +33,7 @@ The proof combines: is kept as a standalone lemma. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real diff --git a/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean b/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean index 38e81067be..4464f3e873 100644 --- a/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean +++ b/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean @@ -32,7 +32,7 @@ The route is: * `foldedNormal_subgaussian`: assembling the above into `HasSubgaussianMGF (|·| − √(2/π)) 1`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real Filter Set open scoped ENNReal NNReal Topology diff --git a/LeanPool/JohnsonLindenstraussLean/InnerProduct.lean b/LeanPool/JohnsonLindenstraussLean/InnerProduct.lean index 35b18a80e5..e9d300805d 100644 --- a/LeanPool/JohnsonLindenstraussLean/InnerProduct.lean +++ b/LeanPool/JohnsonLindenstraussLean/InnerProduct.lean @@ -27,7 +27,7 @@ mechanism behind QJL's one-bit guarantee, which instead rests on the asymmetric identity (`JL/QJL.lean`). -/ -@[expose] public section +public section open scoped RealInnerProductSpace diff --git a/LeanPool/JohnsonLindenstraussLean/Lemma.lean b/LeanPool/JohnsonLindenstraussLean/Lemma.lean index a486b2e469..20ea8de60b 100644 --- a/LeanPool/JohnsonLindenstraussLean/Lemma.lean +++ b/LeanPool/JohnsonLindenstraussLean/Lemma.lean @@ -28,7 +28,7 @@ and `hcard` is the union-bound counting condition implied by `k ≥ ⌈8 · log n / (ε² − ε³)⌉`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real diff --git a/LeanPool/JohnsonLindenstraussLean/NormPreservation.lean b/LeanPool/JohnsonLindenstraussLean/NormPreservation.lean index dc33e21dea..c7b2d5d11f 100644 --- a/LeanPool/JohnsonLindenstraussLean/NormPreservation.lean +++ b/LeanPool/JohnsonLindenstraussLean/NormPreservation.lean @@ -22,7 +22,7 @@ norm of any fixed vector to within a factor `1 ± ε`, except with the stated fa probability. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real diff --git a/LeanPool/JohnsonLindenstraussLean/Projection.lean b/LeanPool/JohnsonLindenstraussLean/Projection.lean index fa16029056..047e7325c3 100644 --- a/LeanPool/JohnsonLindenstraussLean/Projection.lean +++ b/LeanPool/JohnsonLindenstraussLean/Projection.lean @@ -30,7 +30,7 @@ row–vector products. Under the Gaussian law on `A`, each `Aᵢ · x` is `N(0, labeled hypothesis by the existence theorem. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/JohnsonLindenstraussLean/QJL.lean b/LeanPool/JohnsonLindenstraussLean/QJL.lean index eb0201f129..c1837dd341 100644 --- a/LeanPool/JohnsonLindenstraussLean/QJL.lean +++ b/LeanPool/JohnsonLindenstraussLean/QJL.lean @@ -38,7 +38,7 @@ one-bit key quantization. It is built in three increasing layers: product: `E[estimator] = ⟪key/‖key‖, q⟫`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real open scoped ENNReal NNReal RealInnerProductSpace @@ -247,7 +247,7 @@ theorem integral_eval_pi {m : ℕ} {E : Type*} [MeasurableSpace E] (P : Measure /-- **The QJL asymmetric 1-bit estimator.** Given an `m × d` sketch `S` whose rows `S i` are i.i.d. standard Gaussian vectors, a `key` and a `query` `q`, `estimator = √(π/2) · (1/m) · Σᵢ sign ⟪key/‖key‖, sᵢ⟫ · ⟪q, sᵢ⟫`. -/ -noncomputable def qjlEstimator {m d : ℕ} (key q : EuclideanSpace ℝ (Fin d)) +@[expose] noncomputable def qjlEstimator {m d : ℕ} (key q : EuclideanSpace ℝ (Fin d)) (S : Fin m → EuclideanSpace ℝ (Fin d)) : ℝ := Real.sqrt (π / 2) * ((m : ℝ)⁻¹ * ∑ i, Real.sign (⟪‖key‖⁻¹ • key, S i⟫) * ⟪q, S i⟫) diff --git a/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean b/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean index 7ae432aff1..27d081f9f2 100644 --- a/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean +++ b/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean @@ -35,7 +35,7 @@ normalized inner product `⟪key/‖key‖, q⟫` with high probability. It is b so `m = O(‖q‖²/(ε²δ))` sign-bits suffice for additive error `ε` with probability `1−δ`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real open scoped ENNReal NNReal RealInnerProductSpace diff --git a/LeanPool/JohnsonLindenstraussLean/Rotation.lean b/LeanPool/JohnsonLindenstraussLean/Rotation.lean index 47d67a45ab..9f2d3f4d3d 100644 --- a/LeanPool/JohnsonLindenstraussLean/Rotation.lean +++ b/LeanPool/JohnsonLindenstraussLean/Rotation.lean @@ -35,7 +35,7 @@ Combining this with the deterministic identity `‖jlMap A x‖² = (1/k)·∑ the projected squared norm `∑ᵢ (jlMap A w i)²` of any fixed `w ≠ 0` (`jlMap_concentration`). -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real diff --git a/LeanPool/JohnsonLindenstraussLean/SquaredGaussian.lean b/LeanPool/JohnsonLindenstraussLean/SquaredGaussian.lean index 9447e8ddbe..aedac8fd4c 100644 --- a/LeanPool/JohnsonLindenstraussLean/SquaredGaussian.lean +++ b/LeanPool/JohnsonLindenstraussLean/SquaredGaussian.lean @@ -22,7 +22,7 @@ The proof reduces the moment generating function to a Gaussian integral via mathlib's `integral_gaussian`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real open scoped ENNReal NNReal @@ -30,7 +30,7 @@ open scoped ENNReal NNReal namespace JL /-- The standard Gaussian measure `N(0,1)` on `ℝ`. -/ -noncomputable def stdGaussian : Measure ℝ := gaussianReal 0 1 +@[expose] noncomputable def stdGaussian : Measure ℝ := gaussianReal 0 1 instance : IsProbabilityMeasure stdGaussian := by unfold stdGaussian; infer_instance diff --git a/LeanPool/JohnsonLindenstraussLean/Verify.lean b/LeanPool/JohnsonLindenstraussLean/Verify.lean index 833c0ccd0a..adab192e8c 100644 --- a/LeanPool/JohnsonLindenstraussLean/Verify.lean +++ b/LeanPool/JohnsonLindenstraussLean/Verify.lean @@ -38,7 +38,7 @@ mathlib's standard axioms (`propext`, `Classical.choice`, `Quot.sound`) — i.e. genuinely `sorry`-free. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Real open scoped RealInnerProductSpace diff --git a/LeanPool/KahnKalai.lean b/LeanPool/KahnKalai.lean index 84894d1b5b..53d8f242a5 100644 --- a/LeanPool/KahnKalai.lean +++ b/LeanPool/KahnKalai.lean @@ -22,7 +22,7 @@ Tags: probabilistic-combinatorics, random-structures, threshold-phenomena, set-s MSC: 05C80, 60C05 -/ -@[expose] public section +public section namespace KahnKalai diff --git a/LeanPool/KahnKalai/Basic.lean b/LeanPool/KahnKalai/Basic.lean index 795544214c..d86cdf3ed0 100644 --- a/LeanPool/KahnKalai/Basic.lean +++ b/LeanPool/KahnKalai/Basic.lean @@ -13,7 +13,7 @@ cover cost as an attained infimum, and Fact 2.1 (level fractions of an upset are nondecreasing). -/ -@[expose] public section +public section open Finset @@ -26,41 +26,43 @@ def generate (F : Finset (Finset α)) : Finset (Finset α) := univ.filter fun T => ∃ S ∈ F, S ⊆ T /-- `G` covers `F` when every member of `F` contains a member of `G`. -/ +@[expose] def Covers (G F : Finset (Finset α)) : Prop := F ⊆ generate G /-- The expectation polynomial of a finite family at parameter `p`. -/ -def expectation (p : ℝ) (G : Finset (Finset α)) : ℝ := +@[expose] def expectation (p : ℝ) (G : Finset (Finset α)) : ℝ := ∑ S ∈ G, p ^ S.card /-- The infimum expectation among all covers of `H`. -/ -noncomputable def coverCost (p : ℝ) (H : Finset (Finset α)) : ℝ := +@[expose] noncomputable def coverCost (p : ℝ) (H : Finset (Finset α)) : ℝ := sInf ((fun G : Finset (Finset α) => expectation p G) '' {G | Covers G H}) /-- The `p`-biased product measure of a single finite set. -/ -def measure (p : ℝ) (S : Finset α) : ℝ := +@[expose] def measure (p : ℝ) (S : Finset α) : ℝ := p ^ S.card * (1 - p) ^ (Fintype.card α - S.card) /-- The `p`-biased measure of a finite family of sets. -/ -def measureFamily (p : ℝ) (F : Finset (Finset α)) : ℝ := +@[expose] def measureFamily (p : ℝ) (F : Finset (Finset α)) : ℝ := ∑ S ∈ F, measure p S /-- The least parameter where the upward closure of `F` has measure at least one half. -/ -noncomputable def threshold (F : Finset (Finset α)) : ℝ := +@[expose] noncomputable def threshold (F : Finset (Finset α)) : ℝ := sInf {p : ℝ | p ∈ Set.Icc 0 1 ∧ 1 / 2 ≤ measureFamily p (generate F)} /-- The largest parameter where the covering cost of `F` is at most one half. -/ -noncomputable def expectationThreshold (F : Finset (Finset α)) : ℝ := +@[expose] noncomputable def expectationThreshold (F : Finset (Finset α)) : ℝ := sSup {p : ℝ | p ∈ Set.Icc 0 1 ∧ coverCost p F ≤ 1 / 2} /-- A family is `ℓ`-bounded when each of its members has cardinality at most `ℓ`. -/ +@[expose] def IsBounded (F : Finset (Finset α)) (ℓ : ℕ) : Prop := ∀ S ∈ F, S.card ≤ ℓ /-- The explicit constant in the formalized Tran–Vu covering theorem. -/ -def coveringConstant : ℝ := 1000 +@[expose] def coveringConstant : ℝ := 1000 /-- The level supplied by the quantitative covering theorem. -/ -noncomputable def coveringLevel (p : ℝ) (N ℓ : ℕ) : ℕ := +@[expose] noncomputable def coveringLevel (p : ℝ) (N ℓ : ℕ) : ℕ := ⌊coveringConstant * p * N * Real.logb 2 (ℓ + 1 : ℝ)⌋₊ lemma mem_generate {F : Finset (Finset α)} {T : Finset α} : diff --git a/LeanPool/KahnKalai/Cost.lean b/LeanPool/KahnKalai/Cost.lean index dce8c9f2fc..4aa312c27f 100644 --- a/LeanPool/KahnKalai/Cost.lean +++ b/LeanPool/KahnKalai/Cost.lean @@ -12,7 +12,7 @@ Cover-cost calculus for Tran–Vu: the infimum is a minimum, subadditivity, empty-family / empty-set evaluation, and `⊆`-minimals. -/ -@[expose] public section +public section open Finset @@ -167,6 +167,7 @@ lemma coverCost_ge_union_sub {p : ℝ} (hp : 0 ≤ p) (A B : Finset (Finset α)) linarith /-- The inclusion-minimal members of a finite family. -/ +@[expose] def minimals (F : Finset (Finset α)) : Finset (Finset α) := F.filter fun T => ∀ U ∈ F, U ⊆ T → U = T @@ -256,6 +257,7 @@ def largeMinimals (H : Finset (Finset α)) (W : Finset α) (ℓ : ℕ) : Finset (minimals (restrictFamily H W)).filter fun T => ⌊((9 : ℝ) / 10) * ℓ⌋₊ + 1 ≤ T.card /-- Minimal restricted members whose size is at most `0.9 ℓ`. -/ +@[expose] def smallMinimals (H : Finset (Finset α)) (W : Finset α) (ℓ : ℕ) : Finset (Finset α) := (minimals (restrictFamily H W)).filter fun T => T.card ≤ ⌊((9 : ℝ) / 10) * ℓ⌋₊ diff --git a/LeanPool/KahnKalai/Covering.lean b/LeanPool/KahnKalai/Covering.lean index 67f990847e..b97d35e0e5 100644 --- a/LeanPool/KahnKalai/Covering.lean +++ b/LeanPool/KahnKalai/Covering.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset Tran–Vu Theorem 2.3: the covering theorem. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KahnKalai/DoubleCount.lean b/LeanPool/KahnKalai/DoubleCount.lean index d7a78c6f87..f7e1fa9d39 100644 --- a/LeanPool/KahnKalai/DoubleCount.lean +++ b/LeanPool/KahnKalai/DoubleCount.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset Tran–Vu Lemma 2.4 (double counting of large minimals `G_W`). -/ -@[expose] public section +public section open Finset @@ -25,7 +25,7 @@ variable {α : Type*} [DecidableEq α] [Fintype α] noncomputable section /-- `w = ⌊0.1 L p N⌋`. -/ -noncomputable def coveringWidth (p : ℝ) (N : ℕ) : ℕ := +@[expose] noncomputable def coveringWidth (p : ℝ) (N : ℕ) : ℕ := ⌊((1 : ℝ) / 10) * coveringConstant * p * N⌋₊ lemma coveringWidth_eq (p : ℝ) (N : ℕ) : diff --git a/LeanPool/KahnKalai/Numeric.lean b/LeanPool/KahnKalai/Numeric.lean index d8b56307f6..edb92bb0db 100644 --- a/LeanPool/KahnKalai/Numeric.lean +++ b/LeanPool/KahnKalai/Numeric.lean @@ -14,14 +14,14 @@ import Mathlib.Tactic.Positivity.Finset Numeric inequalities for Tran–Vu’s covering induction (`L = 1000`). -/ -@[expose] public section +public section namespace KahnKalai open Nat Finset /-- Least integer strictly larger than `0.9 ℓ`. -/ -noncomputable def kmin (ℓ : ℕ) : ℕ := ⌊((9 : ℝ) / 10) * ℓ⌋₊ + 1 +@[expose] noncomputable def kmin (ℓ : ℕ) : ℕ := ⌊((9 : ℝ) / 10) * ℓ⌋₊ + 1 lemma kmin_pos (ℓ : ℕ) : 1 ≤ kmin ℓ := Nat.succ_le_succ (Nat.zero_le _) diff --git a/LeanPool/KahnKalai/ParkPham.lean b/LeanPool/KahnKalai/ParkPham.lean index aee6d45260..54a155f67f 100644 --- a/LeanPool/KahnKalai/ParkPham.lean +++ b/LeanPool/KahnKalai/ParkPham.lean @@ -15,7 +15,7 @@ Tran–Vu Remark 2.5: binomial mixture of level fractions plus a `2^{-X}` Markov tail, yielding Park–Pham from the covering theorem. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KaltonRoberts.lean b/LeanPool/KaltonRoberts.lean index a021b27e1f..b93075debe 100644 --- a/LeanPool/KaltonRoberts.lean +++ b/LeanPool/KaltonRoberts.lean @@ -30,4 +30,4 @@ Tags: functional-analysis, finitely-additive-measures, kalton-roberts MSC: 46B20, 28A12, 05C35 -/ -@[expose] public section +public section diff --git a/LeanPool/KaltonRoberts/Collections.lean b/LeanPool/KaltonRoberts/Collections.lean index e5be982eb1..06497e370a 100644 --- a/LeanPool/KaltonRoberts/Collections.lean +++ b/LeanPool/KaltonRoberts/Collections.lean @@ -31,7 +31,7 @@ Weighted collections and the positive/negative mass decomposition of a dual certificate for the low-frequency construction and recombination pipeline. -/ -@[expose] public section +public section namespace KaltonRoberts @@ -68,7 +68,7 @@ structure WeightedCollection (U : Type v) [DecidableEq U] where attribute [instance] WeightedCollection.finJ WeightedCollection.decJ /-- Total weight of a weighted collection. -/ -noncomputable def WeightedCollection.totalWeight (C : WeightedCollection U) : ℝ := +@[expose] noncomputable def WeightedCollection.totalWeight (C : WeightedCollection U) : ℝ := ∑ j : C.J, C.weight j omit [Fintype U] in @@ -76,16 +76,16 @@ lemma WeightedCollection.totalWeight_pos (C : WeightedCollection U) : 0 < C.totalWeight := C.total_pos /-- Item frequency: the weighted fraction of sets containing item `i`. -/ -noncomputable def WeightedCollection.itemFreq (C : WeightedCollection U) (i : U) : ℝ := +@[expose] noncomputable def WeightedCollection.itemFreq (C : WeightedCollection U) (i : U) : ℝ := (∑ j : C.J, C.weight j * if i ∈ C.sets j then 1 else 0) / C.totalWeight /-- Weighted average deficit. -/ -noncomputable def WeightedCollection.avgDeficit +@[expose] noncomputable def WeightedCollection.avgDeficit (C : WeightedCollection U) (f : Finset U → ℝ) (M : ℝ) : ℝ := (∑ j : C.J, C.weight j * deficit f M (C.sets j)) / C.totalWeight /-- Weighted average surplus. -/ -noncomputable def WeightedCollection.avgSurplus +@[expose] noncomputable def WeightedCollection.avgSurplus (C : WeightedCollection U) (f : Finset U → ℝ) (M : ℝ) : ℝ := (∑ j : C.J, C.weight j * surplus f M (C.sets j)) / C.totalWeight @@ -109,12 +109,12 @@ lemma WeightedCollection.itemFreq_le_one (C : WeightedCollection U) (i : U) : /-! ## Certificate mass decomposition -/ /-- Positive mass of a dual certificate: `p = ∑_S max(λ(S), 0)`. -/ -noncomputable def DualCertificate.posMass +@[expose] noncomputable def DualCertificate.posMass {f : Finset U → ℝ} {M : ℝ} (cert : DualCertificate f M) : ℝ := ∑ S : Finset U, max (cert.lam S) 0 /-- Negative mass of a dual certificate: `q = ∑_S max(−λ(S), 0)`. -/ -noncomputable def DualCertificate.negMass +@[expose] noncomputable def DualCertificate.negMass {f : Finset U → ℝ} {M : ℝ} (cert : DualCertificate f M) : ℝ := ∑ S : Finset U, max (-cert.lam S) 0 @@ -230,7 +230,7 @@ lemma DualCertificate.neg_item_sum_le_posMass /-! ## Positive and negative weighted collections from a certificate -/ /-- The positive weighted collection from a dual certificate. -/ -noncomputable def DualCertificate.posCollection +@[expose] noncomputable def DualCertificate.posCollection {f : Finset U → ℝ} {M : ℝ} (cert : DualCertificate f M) (hp : 0 < cert.posMass) : WeightedCollection U where @@ -241,7 +241,7 @@ noncomputable def DualCertificate.posCollection total_pos := hp /-- The negative weighted collection from a dual certificate. -/ -noncomputable def DualCertificate.negCollection +@[expose] noncomputable def DualCertificate.negCollection {f : Finset U → ℝ} {M : ℝ} (cert : DualCertificate f M) (hq : 0 < cert.negMass) : WeightedCollection U where diff --git a/LeanPool/KaltonRoberts/Defs.lean b/LeanPool/KaltonRoberts/Defs.lean index 7c71503e93..a4fe3e4e3b 100644 --- a/LeanPool/KaltonRoberts/Defs.lean +++ b/LeanPool/KaltonRoberts/Defs.lean @@ -26,7 +26,7 @@ import Mathlib.Tactic.Positivity.Finset Core definitions used throughout the formalization of the companion paper. -/ -@[expose] public section +public section namespace KaltonRoberts @@ -37,7 +37,7 @@ open Finset BigOperators /-- A function `f : Finset U → ℝ` is `Δ`-additive if `f ∅ = 0` and `|f A + f B − f (A ∪ B)| ≤ Δ` for every pair of disjoint finite subsets `A, B`. **Reference**: Equation (1) in Section 1 of the companion paper. -/ -def IsApproxAdditive {U : Type*} [DecidableEq U] +@[expose] def IsApproxAdditive {U : Type*} [DecidableEq U] (f : Finset U → ℝ) (Δ : ℝ) : Prop := f ∅ = 0 ∧ ∀ A B : Finset U, Disjoint A B → |f A + f B - f (A ∪ B)| ≤ Δ @@ -47,19 +47,19 @@ bottom and is additive up to `Δ` on disjoint joins. This is the set-algebra formulation from Equation (1), with a set algebra represented by its Boolean algebra of events. A concrete algebra of subsets is the subtype of a `BooleanSubalgebra (Set Ω)`. -/ -def IsApproxAdditiveBA {α : Type*} [BooleanAlgebra α] +@[expose] def IsApproxAdditiveBA {α : Type*} [BooleanAlgebra α] (f : α → ℝ) (Δ : ℝ) : Prop := f ⊥ = 0 ∧ ∀ A B : α, Disjoint A B → |f A + f B - f (A ⊔ B)| ≤ Δ /-- A finitely additive signed measure on a Boolean algebra. -/ -def IsFinitelyAdditiveBA {α : Type*} [BooleanAlgebra α] (μ : α → ℝ) : Prop := +@[expose] def IsFinitelyAdditiveBA {α : Type*} [BooleanAlgebra α] (μ : α → ℝ) : Prop := μ ⊥ = 0 ∧ ∀ A B : α, Disjoint A B → μ (A ⊔ B) = μ A + μ B /-- An additive signed measure on `2^U` is identified with a function `A ↦ ∑ i ∈ A, a i` for some weight function `a : U → ℝ`. **Reference**: paragraph after Lemma 1.2 in Section 1 of the companion paper. -/ -def additiveFunction {U : Type*} (a : U → ℝ) : +@[expose] def additiveFunction {U : Type*} (a : U → ℝ) : Finset U → ℝ := fun A => ∑ i ∈ A, a i @@ -68,18 +68,18 @@ on `2^U`. **Reference**: last paragraph of Section 1 in the companion paper, where `M := ‖f‖_∞ = dist_∞(f, L)` after subtracting a closest additive approximant. -/ -noncomputable def distToAdditive {U : Type*} +@[expose] noncomputable def distToAdditive {U : Type*} (f : Finset U → ℝ) : ℝ := ⨅ a : U → ℝ, ⨆ S : Finset U, |f S - additiveFunction a S| /-- The deficit of a set `A` relative to `f` and the value `M`: this is `M − f(A)`. Used throughout Section 2–5 of the companion paper. -/ -def deficit {U : Type*} +@[expose] def deficit {U : Type*} (f : Finset U → ℝ) (M : ℝ) (A : Finset U) : ℝ := M - f A /-- The surplus of a set `A` relative to `f` and the value `M`: this is `M + f(A)`. Used throughout Section 2–5 of the companion paper. -/ -def surplus {U : Type*} +@[expose] def surplus {U : Type*} (f : Finset U → ℝ) (M : ℝ) (A : Finset U) : ℝ := M + f A /-- The Kalton–Roberts constant `K_KR` is the infimum of all `C ≥ 0` such that @@ -91,7 +91,7 @@ This abstract Boolean-algebra formulation captures the paper's statement for arbitrary set algebras: a set algebra is a Boolean subalgebra of `Set Ω`. **Reference**: paragraph after Equation (1) in Section 1 of the companion paper. -/ -noncomputable def krConstant : ℝ := +@[expose] noncomputable def krConstant : ℝ := sInf { C : ℝ | 0 ≤ C ∧ ∀ (α : Type) [BooleanAlgebra α] (f : α → ℝ), IsApproxAdditiveBA f 1 → @@ -123,7 +123,7 @@ def ExpandersExist (α : ℚ) (r : ℕ) (θ : ℚ) : Prop := /-! ## Strong expander witness (Section 3, refined interface) -/ /-- Edge-neighbor set of vertex `v` in a bipartite graph with labelled edges. -/ -def edgeNeighbors {V W : Type*} [DecidableEq W] +@[expose] def edgeNeighbors {V W : Type*} [DecidableEq W] {r : ℕ} (edge : V → Fin r → W) (v : V) : Finset W := Finset.univ.image (edge v) @@ -181,7 +181,7 @@ that expanders exist for all sufficiently large *admissible* `k`, where admissible sizes form an infinite arithmetic progression. **Reference**: Section 3 and Lemma 4.1 of the companion paper. -/ -def StrongExpandersExist (α : ℚ) (r : ℕ) (θ : ℚ) : Prop := +@[expose] def StrongExpandersExist (α : ℚ) (r : ℕ) (θ : ℚ) : Prop := ∃ (step : ℕ), 0 < step ∧ ∀ᶠ (k : ℕ) in Filter.atTop, step ∣ k → ∃ (E : FiniteExpanderWitness r), @@ -206,58 +206,58 @@ compatibility with the existing spine proofs. the definition of `Φ_{r,θ}`. **Reference**: paragraph before Equation (6) in Section 4 of the companion paper. -/ -noncomputable def hEntropy (a b : ℝ) : ℝ := +@[expose] noncomputable def hEntropy (a b : ℝ) : ℝ := a * Real.log a - b * Real.log b - (a - b) * Real.log (a - b) /-- The function `Φ_{r,θ}(x) = h(1,x) + h(θ,x) + h(rx/θ, rx) − h(r, rx)` from Equation (6) in Section 4 of the companion paper. -/ -noncomputable def Phi (r θ x : ℝ) : ℝ := +@[expose] noncomputable def Phi (r θ x : ℝ) : ℝ := hEntropy 1 x + hEntropy θ x + hEntropy (r * x / θ) (r * x) - hEntropy r (r * x) /-- The second derivative `Φ''_{r,θ}(x) = (r−2)/x + (r−1)/(1−x) − 1/(θ−x)`, from Equation (8) in Section 4 of the companion paper. -/ -noncomputable def Phi'' (r θ x : ℝ) : ℝ := +@[expose] noncomputable def Phi'' (r θ x : ℝ) : ℝ := (r - 2) / x + (r - 1) / (1 - x) - 1 / (θ - x) /-! ## Numerical constants from Section 5 -/ /-- The case-split parameter `q₀ = 7437/15625`. **Reference**: Equation (9) in Section 5 of the companion paper. -/ -def q₀ : ℚ := 7437 / 15625 +@[expose] def q₀ : ℚ := 7437 / 15625 /-- The complementary parameter `p₀ = 1 − q₀ = 8188/15625`. **Reference**: Equation (9) in Section 5 of the companion paper. -/ -def p₀ : ℚ := 8188 / 15625 +@[expose] def p₀ : ℚ := 8188 / 15625 /-- The frequency cap in Case 1: `α₁ = 1003/10000`. **Reference**: Equation (9) in Section 5 of the companion paper. -/ -def α₁ : ℚ := 1003 / 10000 +@[expose] def α₁ : ℚ := 1003 / 10000 /-- The frequency cap in Case 2: `α₂ = 47/625`. **Reference**: Equation (9) in Section 5 of the companion paper. -/ -def α₂ : ℚ := 47 / 625 +@[expose] def α₂ : ℚ := 47 / 625 /-- The mixing parameter `τ₁` from Equation (10) in Section 5 of the companion paper. Satisfies `(1 − τ₁) q₀³ + τ₁ q₀⁴ = α₁`. -/ -def τ₁ : ℚ := (q₀ ^ 3 - α₁) / (q₀ ^ 3 - q₀ ^ 4) +@[expose] def τ₁ : ℚ := (q₀ ^ 3 - α₁) / (q₀ ^ 3 - q₀ ^ 4) /-- The mixing parameter `τ₂` from Equation (10) in Section 5 of the companion paper. Satisfies `(1 − τ₂) p₀⁴ + τ₂ p₀⁵ = α₂`. -/ -def τ₂ : ℚ := (p₀ ^ 4 - α₂) / (p₀ ^ 4 - p₀ ^ 5) +@[expose] def τ₂ : ℚ := (p₀ ^ 4 - α₂) / (p₀ ^ 4 - p₀ ^ 5) /-- The Case 1 bound `C₁` from Equation (14) in Section 5 of the companion paper. -/ -def C₁ : ℚ := 23662339508853784054849 / 1192830849380162250000 +@[expose] def C₁ : ℚ := 23662339508853784054849 / 1192830849380162250000 /-- The Case 2 bound `C₂`, which is the final headline constant, from Equation (17) in Section 5 of the companion paper. -/ -def C₂ : ℚ := 694198146664396294486127753 / 34994834677886019996000000 +@[expose] def C₂ : ℚ := 694198146664396294486127753 / 34994834677886019996000000 /-- The simplified upper bound `9919/500 = 19.838`, from the statement of Theorem 1.1 in Section 1 of the companion paper. -/ -def krUpper : ℚ := 9919 / 500 +@[expose] def krUpper : ℚ := 9919 / 500 /-! ## Dual certificate structure (Section 2) -/ diff --git a/LeanPool/KaltonRoberts/DualCert.lean b/LeanPool/KaltonRoberts/DualCert.lean index 2caed44156..3ce281f253 100644 --- a/LeanPool/KaltonRoberts/DualCert.lean +++ b/LeanPool/KaltonRoberts/DualCert.lean @@ -30,7 +30,7 @@ Existence of a dual certificate for best `l∞` approximation from the additive subspace, using geometric Hahn-Banach separation. -/ -@[expose] public section +public section namespace KaltonRoberts @@ -41,7 +41,7 @@ variable {U : Type*} [DecidableEq U] [Fintype U] /-! ## Indicator function and basic properties -/ /-- Indicator function of a finset as a vector in `U → ℝ`. -/ -def _root_.Finset.indicator' (S : Finset U) : U → ℝ := +@[expose] def _root_.Finset.indicator' (S : Finset U) : U → ℝ := fun i => if i ∈ S then 1 else 0 omit [Fintype U] in diff --git a/LeanPool/KaltonRoberts/EpsilonRecombination.lean b/LeanPool/KaltonRoberts/EpsilonRecombination.lean index 75511ff0d7..ff0cffd168 100644 --- a/LeanPool/KaltonRoberts/EpsilonRecombination.lean +++ b/LeanPool/KaltonRoberts/EpsilonRecombination.lean @@ -37,7 +37,7 @@ Bridge from arbitrary real-weighted collections to finite-uniform recombination, with an epsilon loss in the recombination inequality. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/Intersections.lean b/LeanPool/KaltonRoberts/Intersections.lean index 015a5b0e0a..b3da4e2b8e 100644 --- a/LeanPool/KaltonRoberts/Intersections.lean +++ b/LeanPool/KaltonRoberts/Intersections.lean @@ -29,7 +29,7 @@ Product and mixed intersection collections with the frequency and deficit bounds needed for the mixed-intersection step. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/Lemmas.lean b/LeanPool/KaltonRoberts/Lemmas.lean index 345cb7913d..001c60fa97 100644 --- a/LeanPool/KaltonRoberts/Lemmas.lean +++ b/LeanPool/KaltonRoberts/Lemmas.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.Positivity.Finset Mathematical lemmas from Sections 1-4 of the companion paper. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/LogBounds.lean b/LeanPool/KaltonRoberts/LogBounds.lean index 2d94f872d4..a79856fa66 100644 --- a/LeanPool/KaltonRoberts/LogBounds.lean +++ b/LeanPool/KaltonRoberts/LogBounds.lean @@ -27,7 +27,7 @@ Numerical logarithm bounds proved via the atanh series and exact rational estimates. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/MainTheorem.lean b/LeanPool/KaltonRoberts/MainTheorem.lean index 7ccf0624d7..56fee81759 100644 --- a/LeanPool/KaltonRoberts/MainTheorem.lean +++ b/LeanPool/KaltonRoberts/MainTheorem.lean @@ -36,7 +36,7 @@ import Mathlib.Tactic.Positivity.Finset The final proof that the Kalton-Roberts constant is less than `9919 / 500`. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/Numerical.lean b/LeanPool/KaltonRoberts/Numerical.lean index c939f6f523..11a78c242f 100644 --- a/LeanPool/KaltonRoberts/Numerical.lean +++ b/LeanPool/KaltonRoberts/Numerical.lean @@ -27,7 +27,7 @@ Exact rational-arithmetic verifications for the parameter choices used in the final bound. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/PhiAnalysis.lean b/LeanPool/KaltonRoberts/PhiAnalysis.lean index 7e9764bb81..fff4ed0408 100644 --- a/LeanPool/KaltonRoberts/PhiAnalysis.lean +++ b/LeanPool/KaltonRoberts/PhiAnalysis.lean @@ -29,7 +29,7 @@ Convexity, endpoint bounds, and interval-negativity proofs for the Phi functions used in the expander table. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/PhiDeriv.lean b/LeanPool/KaltonRoberts/PhiDeriv.lean index 374a8173b8..199771d2e6 100644 --- a/LeanPool/KaltonRoberts/PhiDeriv.lean +++ b/LeanPool/KaltonRoberts/PhiDeriv.lean @@ -26,7 +26,7 @@ First and second derivative computations for the entropy expressions defining the Phi functions. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/Pipeline.lean b/LeanPool/KaltonRoberts/Pipeline.lean index cf9de9cb1f..92fc9302e4 100644 --- a/LeanPool/KaltonRoberts/Pipeline.lean +++ b/LeanPool/KaltonRoberts/Pipeline.lean @@ -33,7 +33,7 @@ Interfaces connecting weighted collections through mixed intersections and expander recombination to the final distance bound. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/PipelineEps.lean b/LeanPool/KaltonRoberts/PipelineEps.lean index 74fcedb60a..a01f14ffae 100644 --- a/LeanPool/KaltonRoberts/PipelineEps.lean +++ b/LeanPool/KaltonRoberts/PipelineEps.lean @@ -32,7 +32,7 @@ import Mathlib.Tactic.Positivity.Finset Spine theorems with epsilon-loss recombination and the final exact `C₂` bound. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/Pippenger.lean b/LeanPool/KaltonRoberts/Pippenger.lean index 522c47b2ef..f17a47e9fe 100644 --- a/LeanPool/KaltonRoberts/Pippenger.lean +++ b/LeanPool/KaltonRoberts/Pippenger.lean @@ -38,7 +38,7 @@ Row certificates and row-specific constructions for the probabilistic expander argument used in the Kalton-Roberts bound. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KaltonRoberts/PippengerProof.lean b/LeanPool/KaltonRoberts/PippengerProof.lean index 6dd33aa764..670f4257d7 100644 --- a/LeanPool/KaltonRoberts/PippengerProof.lean +++ b/LeanPool/KaltonRoberts/PippengerProof.lean @@ -27,7 +27,7 @@ Probabilistic counting argument proving existence of expanders for the rows needed by the Kalton-Roberts bound. -/ -@[expose] public section +public section namespace KaltonRoberts @@ -1294,7 +1294,7 @@ theorem good_matching_exists_of_ratio_sum_lt_one /-! ## Constructing FiniteExpanderWitness from a good edge function -/ /-- Package a good edge function into a FiniteExpanderWitness. -/ -noncomputable def finiteExpanderOfGoodEdge +@[expose] noncomputable def finiteExpanderOfGoodEdge (N L r : ℕ) (A : ℕ) (hN : 0 < N) (edge : Fin N → Fin r → Fin L) (hcov : ∀ w : Fin L, ∃ v : Fin N, ∃ e : Fin r, edge v e = w) diff --git a/LeanPool/KaltonRoberts/Recombination.lean b/LeanPool/KaltonRoberts/Recombination.lean index 79a1730fae..f9e0ce7a6f 100644 --- a/LeanPool/KaltonRoberts/Recombination.lean +++ b/LeanPool/KaltonRoberts/Recombination.lean @@ -30,7 +30,7 @@ Witness-level one-sided recombination theorem for approximate additive functions. -/ -@[expose] public section +public section namespace KaltonRoberts @@ -195,7 +195,7 @@ variable {r : ℕ} (edge : V → Fin r → W) variable (C : V → Finset U) /-- For each item `i`, the set of source vertices containing it. -/ -def sourceVertices (i : U) : Finset V := +@[expose] def sourceVertices (i : U) : Finset V := Finset.univ.filter (fun v => i ∈ C v) /-- Per-item Hall matching: for each item `i`, an injective map from diff --git a/LeanPool/KaltonRoberts/UniformRecombination.lean b/LeanPool/KaltonRoberts/UniformRecombination.lean index d1bdfe50c1..5319fc7b10 100644 --- a/LeanPool/KaltonRoberts/UniformRecombination.lean +++ b/LeanPool/KaltonRoberts/UniformRecombination.lean @@ -30,7 +30,7 @@ Finite-uniform version of the one-sided recombination theorem, producing a target weighted collection via expander recombination. -/ -@[expose] public section +public section namespace KaltonRoberts diff --git a/LeanPool/KasamiCyclicAdditive.lean b/LeanPool/KasamiCyclicAdditive.lean index 516a77fabf..c2857a852e 100644 --- a/LeanPool/KasamiCyclicAdditive.lean +++ b/LeanPool/KasamiCyclicAdditive.lean @@ -23,4 +23,4 @@ Tags: finite-fields, coding-theory, APN-functions, difference-sets, character-su MSC: 11T06, 11T71, 94A60 -/ -@[expose] public section +public section diff --git a/LeanPool/KasamiCyclicAdditive/Assembly/CoefficientReduction.lean b/LeanPool/KasamiCyclicAdditive/Assembly/CoefficientReduction.lean index 551bcc4c7a..dd50ce2f1d 100644 --- a/LeanPool/KasamiCyclicAdditive/Assembly/CoefficientReduction.lean +++ b/LeanPool/KasamiCyclicAdditive/Assembly/CoefficientReduction.lean @@ -26,7 +26,7 @@ modulus `|Kˣ|` used by the phase argument, and constructs the inverse exponent `D`. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive diff --git a/LeanPool/KasamiCyclicAdditive/Assembly/ElementaryInputs.lean b/LeanPool/KasamiCyclicAdditive/Assembly/ElementaryInputs.lean index 23019e3b3a..412d216720 100644 --- a/LeanPool/KasamiCyclicAdditive/Assembly/ElementaryInputs.lean +++ b/LeanPool/KasamiCyclicAdditive/Assembly/ElementaryInputs.lean @@ -25,7 +25,7 @@ Three bookkeeping inputs the assembled theorem needs: -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Assembly/GeometricChain.lean b/LeanPool/KasamiCyclicAdditive/Assembly/GeometricChain.lean index 6a3366d4b0..91feed7060 100644 --- a/LeanPool/KasamiCyclicAdditive/Assembly/GeometricChain.lean +++ b/LeanPool/KasamiCyclicAdditive/Assembly/GeometricChain.lean @@ -39,7 +39,7 @@ inverting the prime-to-3 isogeny factor `G` on `E(K)` directly preimage over `AlgebraicClosure K`. -/ -@[expose] public section +public section open Finset open KasamiCyclicAdditive.FermatCubic KasamiCyclicAdditive.PointFrobenius WeierstrassCurve diff --git a/LeanPool/KasamiCyclicAdditive/Assembly/Normalization.lean b/LeanPool/KasamiCyclicAdditive/Assembly/Normalization.lean index 51da81f01a..84284ca3d1 100644 --- a/LeanPool/KasamiCyclicAdditive/Assembly/Normalization.lean +++ b/LeanPool/KasamiCyclicAdditive/Assembly/Normalization.lean @@ -33,7 +33,7 @@ at the *same* slope: Frobenius acts on the coefficients, hence on the slope, as well. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Assembly/Reduction.lean b/LeanPool/KasamiCyclicAdditive/Assembly/Reduction.lean index 2be11ed6eb..e2e45aef03 100644 --- a/LeanPool/KasamiCyclicAdditive/Assembly/Reduction.lean +++ b/LeanPool/KasamiCyclicAdditive/Assembly/Reduction.lean @@ -28,7 +28,7 @@ form, with convenience wrappers taking only the half-size equation (and, in one case, also `DillonKashyapPhaseFormula`) supplied afterwards. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive diff --git a/LeanPool/KasamiCyclicAdditive/Counting/Average.lean b/LeanPool/KasamiCyclicAdditive/Counting/Average.lean index 38bd3ce7fe..fca67e2415 100644 --- a/LeanPool/KasamiCyclicAdditive/Counting/Average.lean +++ b/LeanPool/KasamiCyclicAdditive/Counting/Average.lean @@ -23,7 +23,7 @@ the average. Both are proved for an arbitrary `Δ : Finset K` and then specialized to `derivativeImage k K`. -/ -@[expose] public section +public section open Finset @@ -39,7 +39,7 @@ def slopeTripleCount (Delta : Finset K) (ρ : K) : ℕ := (fun p => p.1 + ρ * p.2.1 + (1 + ρ) * p.2.2 = 0)).card /-- Walsh coefficient of a finite subset: `∑_{x ∈ Δ} ψ(a x)`. -/ -noncomputable def walshCoefficient (Delta : Finset K) (psi : AddChar K ℂ) (a : K) : ℂ := +@[expose] noncomputable def walshCoefficient (Delta : Finset K) (psi : AddChar K ℂ) (a : K) : ℂ := ∑ x ∈ Delta, psi (a * x) /-! ### Auxiliary lemmas -/ diff --git a/LeanPool/KasamiCyclicAdditive/Counting/Definitions.lean b/LeanPool/KasamiCyclicAdditive/Counting/Definitions.lean index c801310552..a6a14d3e98 100644 --- a/LeanPool/KasamiCyclicAdditive/Counting/Definitions.lean +++ b/LeanPool/KasamiCyclicAdditive/Counting/Definitions.lean @@ -27,7 +27,7 @@ form used throughout the proof, indexed by `ρ = v₂/v₁`; relates the two. -/ -@[expose] public section +public section open Finset @@ -39,19 +39,19 @@ variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] normalised form of the triple count of the conjecture, obtained from the original `v₁ x + v₂ y + v₃ z = 0` by dividing through by `v₁` and setting `ρ = v₂/v₁`. -/ -def slopeTripleCount (k : ℕ) (ρ : K) : ℕ := +@[expose] def slopeTripleCount (k : ℕ) (ρ : K) : ℕ := (((derivativeImage k K) ×ˢ (derivativeImage k K) ×ˢ (derivativeImage k K)).filter (fun p => p.1 + ρ * p.2.1 + (1 + ρ) * p.2.2 = 0)).card /-- The Walsh coefficient `S(a) = ∑_{x ∈ Δ} ψ(a x)`. -/ -noncomputable def walshCoefficient (k : ℕ) (ψ : AddChar K ℂ) (a : K) : ℂ := +@[expose] noncomputable def walshCoefficient (k : ℕ) (ψ : AddChar K ℂ) (a : K) : ℂ := ∑ x ∈ derivativeImage k K, ψ (a * x) /-- The admissible slopes `ρ ≠ 0, 1`. -/ -def AdmissibleSlope (ρ : K) : Prop := ρ ≠ 0 ∧ ρ ≠ 1 +@[expose] def AdmissibleSlope (ρ : K) : Prop := ρ ≠ 0 ∧ ρ ≠ 1 /-- The finset of admissible slopes. -/ -def slopes (K : Type*) [Field K] [Fintype K] [DecidableEq K] : Finset K := +@[expose] def slopes (K : Type*) [Field K] [Fintype K] [DecidableEq K] : Finset K := Finset.univ.filter (fun r : K => r ≠ 0 ∧ r ≠ 1) end KasamiCyclicAdditive diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/BaseChange.lean b/LeanPool/KasamiCyclicAdditive/Geometry/BaseChange.lean index 7412f4409d..fde01b16e5 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/BaseChange.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/BaseChange.lean @@ -22,7 +22,7 @@ on points of the Fermat cubic, built the same way as `frobPt` (via the `G`-preimage identity from `E(K)` to `E(F) = E(AlgebraicClosure K)`. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.PointFrobenius diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/Descent/Arithmetic.lean b/LeanPool/KasamiCyclicAdditive/Geometry/Descent/Arithmetic.lean index c68b1bebd3..7cf7ad4eac 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/Descent/Arithmetic.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/Descent/Arithmetic.lean @@ -27,7 +27,7 @@ For even `n`, `c_n = (-2)^(n/2)` is the integer with `π^n = [c_n]`, and `Geometry/FrobeniusAnnihilator.lean`. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.Descent @@ -37,10 +37,10 @@ section EvenN variable (n : ℕ) /-- `c_n = (-2)^(n/2)`, the integer with `π^n = [c_n]` for even `n`. -/ -def cN : ℤ := (-2) ^ (n / 2) +@[expose] def cN : ℤ := (-2) ^ (n / 2) /-- `N = c_n - 1`. -/ -def nn : ℤ := cN n - 1 +@[expose] def nn : ℤ := cN n - 1 variable {n} diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/EvenCase.lean b/LeanPool/KasamiCyclicAdditive/Geometry/EvenCase.lean index c2f95fb261..aa4247fe05 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/EvenCase.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/EvenCase.lean @@ -51,7 +51,7 @@ The quotient-first route to `RootEqSolvable` in even dimension. fixed-field descent theorem is needed. -/ -@[expose] public section +public section open KasamiCyclicAdditive.FermatCubic KasamiCyclicAdditive.PointFrobenius WeierstrassCurve diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Chart.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Chart.lean index aed0883cd7..c958ee57b0 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Chart.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Chart.lean @@ -26,7 +26,7 @@ model `fer`. The main results are vanishes. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.FermatCubic @@ -55,7 +55,7 @@ lemma chart_nonsingular {w t : K} (h : w ^ 3 + t ^ 3 = 1) : linear_combination h + (-t ^ 3 - w * t ^ 2) * CharTwo.two_eq_zero (R := K) /-- The affine Fermat point `(w,t)` viewed in the Weierstrass model `fer`. -/ -def pt (w t : K) (h : w ^ 3 + t ^ 3 = 1) : (fer K).toAffine.Point := +@[expose] def pt (w t : K) (h : w ^ 3 + t ^ 3 = 1) : (fer K).toAffine.Point := Affine.Point.some _ _ (chart_nonsingular h) /-- `pt` is injective in its two coordinates. -/ diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Curve.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Curve.lean index 46442d78c1..799e8ac747 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Curve.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Curve.lean @@ -31,7 +31,7 @@ through `x = Z/(X+Y)`, `y = X/(X+Y)`. Under this isomorphism: All group-law statements are proved in this model. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.FermatCubic @@ -40,7 +40,7 @@ open WeierstrassCurve variable {K : Type*} [Field K] /-- The Weierstrass model `y^2 + y = x^3 + 1` of the Fermat cubic in characteristic two. -/ -def fer (K : Type*) [Field K] : WeierstrassCurve K := ⟨0, 0, 1, 0, 1⟩ +@[expose] def fer (K : Type*) [Field K] : WeierstrassCurve K := ⟨0, 0, 1, 0, 1⟩ /-! The Weierstrass coefficients of `fer`, as `simp` lemmas. -/ diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Frobenius.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Frobenius.lean index de5161a4af..8176cd2706 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Frobenius.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Frobenius.lean @@ -25,7 +25,7 @@ in the prime field `F_2`. No algebraic closedness is needed: `x^2 = x` already forces `x = 0` or `x = 1` in any field. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.FermatCubic diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Hessian.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Hessian.lean index 24a680c40e..2b1e6e4ef7 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Hessian.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Hessian.lean @@ -31,20 +31,20 @@ This file records the three polynomial identities behind the formula; they are a consequences of the two Fermat equations and of `2 = 0`. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.FermatCubic variable {K : Type*} [Field K] [CharP K 2] /-- The denominator `D0` of the Hessian addition formula. -/ -def hessD (w1 t1 w2 t2 : K) : K := w1 * t1 + w2 * t2 +@[expose] def hessD (w1 t1 w2 t2 : K) : K := w1 * t1 + w2 * t2 /-- The first numerator `N_x` of the Hessian addition formula. -/ -def hessX (w1 t1 w2 t2 : K) : K := t1 ^ 2 * w2 + t2 ^ 2 * w1 +@[expose] def hessX (w1 t1 w2 t2 : K) : K := t1 ^ 2 * w2 + t2 ^ 2 * w1 /-- The second numerator `N_y` of the Hessian addition formula. -/ -def hessY (w1 t1 w2 t2 : K) : K := w1 ^ 2 * t2 + w2 ^ 2 * t1 +@[expose] def hessY (w1 t1 w2 t2 : K) : K := w1 ^ 2 * t2 + w2 ^ 2 * t1 variable {w1 t1 w2 t2 : K} diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/IncidenceChart.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/IncidenceChart.lean index 693b1480c6..b000e3aef7 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/IncidenceChart.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/IncidenceChart.lean @@ -30,7 +30,7 @@ The Frobenius-twist hypothesis is stated as `pi^n Q = Q + C` with `C = ptInf c` the three points at infinity are the three points of `K0 = ker (1+pi)`, cf. `neg_ptInf`. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.FermatCubic @@ -91,7 +91,7 @@ section Group variable [DecidableEq K] /-- The `3`-torsion point `t3 = (1,0)`. -/ -def t3 (K : Type*) [Field K] [CharP K 2] : (fer K).toAffine.Point := +@[expose] def t3 (K : Type*) [Field K] [CharP K 2] : (fer K).toAffine.Point := pt 1 0 (by exact t3_fermat) /-- `t3 = (1,0)` is `3`-torsion. -/ @@ -113,7 +113,7 @@ lemma neg_add_t3 {x y d : K} (hx : x ≠ 0) (hy : y ≠ 0) (hd : d ≠ 0) field_simp /-- `phi k Q = -(Q + pi^k Q) + t3`. -/ -def phi (k : ℕ) (W T : K) (h : W ^ 3 + T ^ 3 = 1) : (fer K).toAffine.Point := +@[expose] def phi (k : ℕ) (W T : K) (h : W ^ 3 + T ^ 3 = 1) : (fer K).toAffine.Point := -(pt W T h + pt (W ^ 2 ^ k) (T ^ 2 ^ k) (frob_fermat h k)) + t3 K /-- If `Q + pi^k Q` is `3`-torsion then so is `Phi_k(Q)`. -/ diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Infinity.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Infinity.lean index c4c7d5da45..d50d48a695 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Infinity.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Infinity.lean @@ -27,7 +27,7 @@ The main result is the diagonal translation formula: ``` -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.FermatCubic @@ -56,7 +56,7 @@ variable [DecidableEq K] /-- The point at infinity `P_a = [1:a:0]` of the Fermat cubic, `a^3 = 1`, in the Weierstrass model. For `a = 1` this is the origin `O = [1:1:0]`. -/ -def ptInf (a : K) (ha : a ^ 3 = 1) : (fer K).toAffine.Point := +@[expose] def ptInf (a : K) (ha : a ^ 3 = 1) : (fer K).toAffine.Point := if ha1 : a = 1 then 0 else Affine.Point.some _ _ (inf_nonsingular (cube_root_rel ha ha1)) /-- `P_1` is the origin. -/ diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Quotient.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Quotient.lean index 04264260e9..356a2d2535 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Quotient.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/Quotient.lean @@ -27,7 +27,7 @@ Frobenius endomorphism, or algebraic closure is involved. Note the direction chosen afterwards. -/ -@[expose] public section +public section open KasamiCyclicAdditive.FermatCubic diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/RationalKernel.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/RationalKernel.lean index 40e2ff7bc9..4ed2a74010 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/RationalKernel.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FermatCubic/RationalKernel.lean @@ -64,7 +64,7 @@ in `rational_kernel_odd`, combined with the standard fact that a group homomorph kernel is injective; the group law on `E` itself is not developed here. -/ -@[expose] public section +public section open scoped BigOperators open scoped Real @@ -79,13 +79,13 @@ variable {K : Type*} [Field K] /-- `IsPoint X Y Z` says that `[X : Y : Z]` is a point of the projective Fermat cubic `X³ + Y³ = Z³`: the coordinates are not all zero and they satisfy the equation. -/ -def IsPoint (X Y Z : K) : Prop := +@[expose] def IsPoint (X Y Z : K) : Prop := ¬ (X = 0 ∧ Y = 0 ∧ Z = 0) ∧ X ^ 3 + Y ^ 3 = Z ^ 3 /-- `IsKernelPoint k X Y Z` says that `(1 + π^k) [X : Y : Z] = O`, equivalently `π^k [X : Y : Z] = -[X : Y : Z]`, i.e. that the triples `(X^(2^k), Y^(2^k), Z^(2^k))` and `(Y, X, Z)` define the same projective point. -/ -def IsKernelPoint (k : ℕ) (X Y Z : K) : Prop := +@[expose] def IsKernelPoint (k : ℕ) (X Y Z : K) : Prop := ∃ c : K, c ≠ 0 ∧ X ^ 2 ^ k = c * Y ∧ Y ^ 2 ^ k = c * X ∧ Z ^ 2 ^ k = c * Z /-! ### Basic facts about the origin and the points at infinity -/ diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/FrobeniusAnnihilator.lean b/LeanPool/KasamiCyclicAdditive/Geometry/FrobeniusAnnihilator.lean index de7292f925..742af3a011 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/FrobeniusAnnihilator.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/FrobeniusAnnihilator.lean @@ -31,7 +31,7 @@ it makes `G` bijective on `E(K)` — no algebraic closure and no kernel decomposition. -/ -@[expose] public section +public section open KasamiCyclicAdditive.FermatCubic diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/IsogenyFactor.lean b/LeanPool/KasamiCyclicAdditive/Geometry/IsogenyFactor.lean index df231c8438..0ae7bdde9d 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/IsogenyFactor.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/IsogenyFactor.lean @@ -27,19 +27,19 @@ with an endomorphism `π` satisfying `π² = [-2]`. No field, curve, Frobenius map or algebraic closure appears. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.Isogeny /-- The `n`-fold iterate of `pi`. -/ -def piIter +@[expose] def piIter {G : Type*} [AddCommGroup G] (pi : G →+ G) : ℕ → G → G | 0, x => x | n + 1, x => pi (piIter pi n x) /-- `a - b*pi`. -/ -def gMap +@[expose] def gMap {G : Type*} [AddCommGroup G] (pi : G →+ G) (a b : ℤ) (x : G) : G := a • x - b • pi x diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/PointFrobenius.lean b/LeanPool/KasamiCyclicAdditive/Geometry/PointFrobenius.lean index 51a7ec0ec4..e38e1f3c3f 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/PointFrobenius.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/PointFrobenius.lean @@ -39,7 +39,7 @@ at infinity `ptInf a`, or an affine Fermat point `pt w t`. This is what lets the two charts of `FermatCubic` be used exhaustively. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive.PointFrobenius @@ -164,7 +164,7 @@ theorem frobPt_frobPt (P : (fer K).toAffine.Point) : /-! ## Iterated Frobenius -/ /-- `π` as an element of the endomorphism monoid, so that `π ^ k` is available. -/ -noncomputable def frobEnd (K : Type*) [Field K] [DecidableEq K] [CharP K 2] : +@[expose] noncomputable def frobEnd (K : Type*) [Field K] [DecidableEq K] [CharP K 2] : AddMonoid.End ((fer K).toAffine.Point) := frobPt K /-- One step of the recursion for `π ^ k`. -/ diff --git a/LeanPool/KasamiCyclicAdditive/Geometry/RootEquation.lean b/LeanPool/KasamiCyclicAdditive/Geometry/RootEquation.lean index c222f50105..99ac302876 100644 --- a/LeanPool/KasamiCyclicAdditive/Geometry/RootEquation.lean +++ b/LeanPool/KasamiCyclicAdditive/Geometry/RootEquation.lean @@ -32,14 +32,14 @@ It lives in its own file so that `Geometry/EvenCase.lean`, which proves `Assembly/GeometricChain.lean` without an import cycle. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive /-- Solvability of the twisted root equation: at every affine Fermat target `(p, q)` with `p, q ≠ 0` there are `w, z` with `w + z = 1` and `w ^ m + p * z ^ m = q`. -/ -def RootEqSolvable (m : ℕ) (K : Type*) [Field K] : Prop := +@[expose] def RootEqSolvable (m : ℕ) (K : Type*) [Field K] : Prop := ∀ p q : K, p ≠ 0 → q ≠ 0 → p ^ 3 + q ^ 3 = 1 → ∃ w z : K, w + z = 1 ∧ w ^ m + p * z ^ m = q diff --git a/LeanPool/KasamiCyclicAdditive/MCM/CharacterArithmetic.lean b/LeanPool/KasamiCyclicAdditive/MCM/CharacterArithmetic.lean index 899edcd0ea..a8597385ad 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/CharacterArithmetic.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/CharacterArithmetic.lean @@ -23,7 +23,7 @@ cubic. This is the exceptional branch complementary to the generic Dickson permutation argument. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive diff --git a/LeanPool/KasamiCyclicAdditive/MCM/ComplementTransport.lean b/LeanPool/KasamiCyclicAdditive/MCM/ComplementTransport.lean index c9196cdb3e..0403c492fb 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/ComplementTransport.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/ComplementTransport.lean @@ -29,7 +29,7 @@ the derivative-image half-size equation at both `k` and the complementary parameter `n - k`. -/ -@[expose] public section +public section open Finset @@ -43,7 +43,7 @@ variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] [CharP K 2] The parameter `n` is not needed to define the equivalence; it enters only in the identity below relating the Kasami exponents at `k` and `n - k`. -/ -noncomputable def complementFrobeniusEquiv (k : ℕ) : K ≃+* K := by +@[expose] noncomputable def complementFrobeniusEquiv (k : ℕ) : K ≃+* K := by have hinj : Function.Injective (iterateFrobenius K 2 (2 * k)) := RingHom.injective _ have hbij : Function.Bijective (iterateFrobenius K 2 (2 * k)) := ⟨hinj, Finite.injective_iff_surjective.mp hinj⟩ diff --git a/LeanPool/KasamiCyclicAdditive/MCM/DicksonPermutation.lean b/LeanPool/KasamiCyclicAdditive/MCM/DicksonPermutation.lean index 0d93b9306e..930c6b17a8 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/DicksonPermutation.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/DicksonPermutation.lean @@ -32,7 +32,7 @@ consequence that `D_(3h)` and `D_3` have the same value distribution whenever `D_h` is a permutation. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/KasamiCyclicAdditive/MCM/DicksonPhase.lean b/LeanPool/KasamiCyclicAdditive/MCM/DicksonPhase.lean index c77acfbacc..8a98b1725f 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/DicksonPhase.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/DicksonPhase.lean @@ -20,7 +20,7 @@ every odd `k` coprime to `n`, `D_(2^k+1)` and `D_3` have equal sums against any function on `GF(2^n)`, even at the odd-dimensional bad residue `k ≡ 3 (mod 6)`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/KasamiCyclicAdditive/MCM/Fourier.lean b/LeanPool/KasamiCyclicAdditive/MCM/Fourier.lean index e45ebd4220..4aaa83bac0 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/Fourier.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/Fourier.lean @@ -28,7 +28,7 @@ For the complementary case of a nonprincipal cubic `χ` and odd `k`, the MCM map is invisible to `χ`: `χ(M_k s) = χ(s)`. -/ -@[expose] public section +public section open Finset Polynomial @@ -37,11 +37,12 @@ namespace KasamiCyclicAdditive variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] [CharP K 2] /-- Untwisted MCM character sum. Multiplicative characters vanish at zero. -/ -noncomputable def mcmCharSum (k : ℕ) (χ : MulChar K ℂ) : ℂ := +@[expose] noncomputable def mcmCharSum (k : ℕ) (χ : MulChar K ℂ) : ℂ := ∑ s : K, χ (mcmMap k s) /-- Additively twisted MCM character sum. -/ -noncomputable def mcmTwistedCharSum (k : ℕ) (ψ : AddChar K ℂ) (χ : MulChar K ℂ) : ℂ := +@[expose] noncomputable def mcmTwistedCharSum (k : ℕ) (ψ : AddChar K ℂ) + (χ : MulChar K ℂ) : ℂ := ∑ s : K, ψ s * χ (mcmMap k s) /-! ### Characteristic-two preliminaries -/ diff --git a/LeanPool/KasamiCyclicAdditive/MCM/FrobeniusSum.lean b/LeanPool/KasamiCyclicAdditive/MCM/FrobeniusSum.lean index 4bc4541612..b0fe2939fa 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/FrobeniusSum.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/FrobeniusSum.lean @@ -62,14 +62,14 @@ frobSum_one --------------+ ``` -/ -@[expose] public section +public section namespace KasamiCyclicAdditive variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] [CharP K 2] /-- `T_k(s)=s+s^2+...+s^(2^(k-1))`. -/ -def frobSum (k : ℕ) (s : K) : K := +@[expose] def frobSum (k : ℕ) (s : K) : K := ∑ i ∈ Finset.range k, s ^ (2 ^ i) omit [Fintype K] [DecidableEq K] [CharP K 2] in diff --git a/LeanPool/KasamiCyclicAdditive/MCM/HalfSize.lean b/LeanPool/KasamiCyclicAdditive/MCM/HalfSize.lean index 16ed850ef9..eeea77b7b5 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/HalfSize.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/HalfSize.lean @@ -26,7 +26,7 @@ Frobenius transport of `MCM/ComplementTransport.lean` preserves the cardinality derivative image. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/MCM/Halfspace.lean b/LeanPool/KasamiCyclicAdditive/MCM/Halfspace.lean index d5172accff..3fd16622bf 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/Halfspace.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/Halfspace.lean @@ -28,7 +28,7 @@ and `M_k(s) = T_k(s)^(2^k+1) / s^(2^k)` for the MCM map, the main identities are * consequently sums over `Δ` are half-space sums weighted by `1 + ψ(s)`. -/ -@[expose] public section +public section open Finset @@ -44,7 +44,7 @@ def asSet (K : Type*) [Field K] [Fintype K] [DecidableEq K] : Finset K := Finset.image artinSchreier Finset.univ /-- MCM map, with Lean's field convention making `M_k(0)=0`. -/ -def mcmMap (k : ℕ) (s : K) : K := +@[expose] def mcmMap (k : ℕ) (s : K) : K := frobSum k s ^ (2 ^ k + 1) / s ^ (2 ^ k) /-! ### Traces of finite fields are Frobenius invariant -/ diff --git a/LeanPool/KasamiCyclicAdditive/MCM/Permutation.lean b/LeanPool/KasamiCyclicAdditive/MCM/Permutation.lean index 59124f3bdc..79f9606323 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/Permutation.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/Permutation.lean @@ -28,7 +28,7 @@ that the MCM map has zero as its unique zero, this makes all multiplicative character sums preserved, hence the MCM map a permutation. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/KasamiCyclicAdditive/MCM/PhaseFormula.lean b/LeanPool/KasamiCyclicAdditive/MCM/PhaseFormula.lean index f00d59d402..09dbb45d8f 100644 --- a/LeanPool/KasamiCyclicAdditive/MCM/PhaseFormula.lean +++ b/LeanPool/KasamiCyclicAdditive/MCM/PhaseFormula.lean @@ -22,7 +22,7 @@ from the derivative-image half-size equation plus the MCM/Dickson identities — no Dillon--Kashyap or Dillon--Dobbertin Fourier theorem is imported. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/KasamiCyclicAdditive/Main.lean b/LeanPool/KasamiCyclicAdditive/Main.lean index 8755e7d1b2..c08b550789 100644 --- a/LeanPool/KasamiCyclicAdditive/Main.lean +++ b/LeanPool/KasamiCyclicAdditive/Main.lean @@ -28,7 +28,7 @@ coprime to `n` to `k % n` using the proved periodicity results in representative is also derived, not assumed. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive diff --git a/LeanPool/KasamiCyclicAdditive/Phase/AdditiveCharacter.lean b/LeanPool/KasamiCyclicAdditive/Phase/AdditiveCharacter.lean index c1026cab33..bc4423dcf0 100644 --- a/LeanPool/KasamiCyclicAdditive/Phase/AdditiveCharacter.lean +++ b/LeanPool/KasamiCyclicAdditive/Phase/AdditiveCharacter.lean @@ -17,7 +17,7 @@ records the elementary fact that any primitive complex additive character is nonprincipal. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive @@ -25,7 +25,7 @@ variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] /-- Mathlib's canonical primitive complex additive character on a finite field. -/ -noncomputable def primitiveAddChar (K : Type*) [Field K] [Fintype K] : AddChar K ℂ := +@[expose] noncomputable def primitiveAddChar (K : Type*) [Field K] [Fintype K] : AddChar K ℂ := AddChar.FiniteField.primitiveChar_to_Complex K omit [DecidableEq K] in diff --git a/LeanPool/KasamiCyclicAdditive/Phase/CharacterSums.lean b/LeanPool/KasamiCyclicAdditive/Phase/CharacterSums.lean index c29d60a1b6..4a177bd268 100644 --- a/LeanPool/KasamiCyclicAdditive/Phase/CharacterSums.lean +++ b/LeanPool/KasamiCyclicAdditive/Phase/CharacterSums.lean @@ -27,7 +27,7 @@ nonvanishing facts. Primitive-character nontriviality is supplied by `Phase/AdditiveCharacter.lean`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Phase/Definitions.lean b/LeanPool/KasamiCyclicAdditive/Phase/Definitions.lean index 9f8f2845f5..ad60112f2b 100644 --- a/LeanPool/KasamiCyclicAdditive/Phase/Definitions.lean +++ b/LeanPool/KasamiCyclicAdditive/Phase/Definitions.lean @@ -16,7 +16,7 @@ primitive additive character of `K` with values in `ℂ` (in the application `ψ x = (-1)^(Tr x)`), and `D` is an exponent inverse to `m` modulo `N = #Kˣ`. -/ -@[expose] public section +public section open Finset @@ -27,36 +27,38 @@ section Defs variable (K : Type*) [Field K] [Fintype K] [DecidableEq K] /-- `U = μ₃(K)`, the group of cube roots of unity of `K`, as a finset. -/ -def cubeRootsOne : Finset K := {u : K | u ^ 3 = 1} +@[expose] def cubeRootsOne : Finset K := {u : K | u ^ 3 = 1} /-- `c = |μ₃(K)|`. -/ -def mu3Card : ℕ := (cubeRootsOne K).card +@[expose] def mu3Card : ℕ := (cubeRootsOne K).card end Defs variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] /-- `Φ(x) = ∑_{u ∈ U} ψ(u x^D)`. -/ +@[expose] noncomputable def phi (ψ : AddChar K ℂ) (D : ℕ) (x : K) : ℂ := ∑ u ∈ cubeRootsOne K, ψ (u * x ^ D) /-- The additive Fourier transform `Φ̂(z) = ∑_{t ∈ K} Φ(t) ψ(z t)`. -/ +@[expose] noncomputable def phiHat (ψ : AddChar K ℂ) (D : ℕ) (z : K) : ℂ := ∑ t : K, phi ψ D t * ψ (z * t) /-- `W_{u,v} = ∑_{x,y ∈ K} ψ(u x^D + v (A x + B y)^D + y^D)`. -/ -noncomputable def weilSum (ψ : AddChar K ℂ) (D : ℕ) (A B u v : K) : ℂ := +@[expose] noncomputable def weilSum (ψ : AddChar K ℂ) (D : ℕ) (A B u v : K) : ℂ := ∑ x : K, ∑ y : K, ψ (u * x ^ D + v * (A * x + B * y) ^ D + y ^ D) /-- `R_{u,v}(A,B) = #{t ∈ K : u t^D + v (A t + B)^D = 1}`. -/ -def rootCount (D : ℕ) (A B u v : K) : ℕ := #{t : K | u * t ^ D + v * (A * t + B) ^ D = 1} +@[expose] def rootCount (D : ℕ) (A B u v : K) : ℕ := #{t : K | u * t ^ D + v * (A * t + B) ^ D = 1} /-- `Z(ρ) = ∑_{λ ∈ G} S(λ) S(ρ λ) S(σ λ)`. -/ -noncomputable def phaseTripleSum (S : K → ℂ) (rho sigma : K) : ℂ := +@[expose] noncomputable def phaseTripleSum (S : K → ℂ) (rho sigma : K) : ℂ := ∑ lam : Kˣ, S (lam : K) * S (rho * (lam : K)) * S (sigma * (lam : K)) /-- The all-character Walsh formula `2 S(a) = (Q/N) ∑_χ [G(χ^e)/G(χ^3)] χ(a)` for every `a ∈ Kˣ`, stated as a property of `S` rather than assumed. -/ -def WalshCharacterFormula (ψ : AddChar K ℂ) (e : ℕ) (S : K → ℂ) : Prop := +@[expose] def WalshCharacterFormula (ψ : AddChar K ℂ) (e : ℕ) (S : K → ℂ) : Prop := ∀ a : Kˣ, 2 * S (a : K) = (Fintype.card K : ℂ) / (Fintype.card Kˣ : ℂ) * ∑ χ : MulChar K ℂ, gaussSum (χ ^ e) ψ / gaussSum (χ ^ 3) ψ * χ (a : K) diff --git a/LeanPool/KasamiCyclicAdditive/Phase/DillonKashyapInterface.lean b/LeanPool/KasamiCyclicAdditive/Phase/DillonKashyapInterface.lean index 25e41686eb..86e9cf418e 100644 --- a/LeanPool/KasamiCyclicAdditive/Phase/DillonKashyapInterface.lean +++ b/LeanPool/KasamiCyclicAdditive/Phase/DillonKashyapInterface.lean @@ -27,7 +27,7 @@ difference set as the complement of this same `Δ`; the sign convention here is therefore opposite to theirs. -/ -@[expose] public section +public section open Finset @@ -41,7 +41,7 @@ variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] The substantive imported theorem: it supplies the *phases*, not merely the magnitudes, of the Kasami Fourier spectrum. Dillon--Kashyap Theorems 1--2, in the sign convention used here. -/ -def DillonKashyapPhaseFormula (k : ℕ) (ψ : AddChar K ℂ) : Prop := +@[expose] def DillonKashyapPhaseFormula (k : ℕ) (ψ : AddChar K ℂ) : Prop := ∀ χ : MulChar K ℂ, (∑ x : Kˣ, (if (x : K) ∈ derivativeImage k K then (1 : ℂ) else -1) * χ (x : K)) = gaussSum χ ψ * gaussSum (χ ^ (2 ^ k + 1)) ψ / gaussSum (χ ^ 3) ψ diff --git a/LeanPool/KasamiCyclicAdditive/Phase/PowerMap.lean b/LeanPool/KasamiCyclicAdditive/Phase/PowerMap.lean index 8ad4388b37..29d1bf3d74 100644 --- a/LeanPool/KasamiCyclicAdditive/Phase/PowerMap.lean +++ b/LeanPool/KasamiCyclicAdditive/Phase/PowerMap.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # Basic facts: the power map `x ↦ x^D` and the group `μ₃(K)` -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Phase/RootCount.lean b/LeanPool/KasamiCyclicAdditive/Phase/RootCount.lean index a372cb8ef5..d99e966a40 100644 --- a/LeanPool/KasamiCyclicAdditive/Phase/RootCount.lean +++ b/LeanPool/KasamiCyclicAdditive/Phase/RootCount.lean @@ -20,7 +20,7 @@ Assuming the all-character Walsh formula `WalshCharacterFormula`, we prove for `A, B ∈ K^*` with `A³ + B³ = 1` and `A³ ≠ 1`, where `ρ = A³`, `σ = B³`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Preliminaries/Arithmetic.lean b/LeanPool/KasamiCyclicAdditive/Preliminaries/Arithmetic.lean index 178f6ee971..3847a509c5 100644 --- a/LeanPool/KasamiCyclicAdditive/Preliminaries/Arithmetic.lean +++ b/LeanPool/KasamiCyclicAdditive/Preliminaries/Arithmetic.lean @@ -29,7 +29,7 @@ vice versa. `two_pow_two_mul_sub_one`: elementary arithmetic of `2 ^ k`. -/ -@[expose] public section +public section namespace KasamiCyclicAdditive diff --git a/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteAverage.lean b/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteAverage.lean index 34f7e64e92..225aa4abcc 100644 --- a/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteAverage.lean +++ b/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteAverage.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset Generic consequences of an average identity and pointwise nonnegativity. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteCharacterCriterion.lean b/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteCharacterCriterion.lean index 8d03963095..f4ab2ae919 100644 --- a/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteCharacterCriterion.lean +++ b/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteCharacterCriterion.lean @@ -28,7 +28,7 @@ every multiplicative-character sum, restrict it to the unit group and apply the additive criterion to `Additive Kˣ`. -/ -@[expose] public section +public section open Finset open scoped BigOperators diff --git a/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteFieldSums.lean b/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteFieldSums.lean index 74e06d6535..004ec2830a 100644 --- a/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteFieldSums.lean +++ b/LeanPool/KasamiCyclicAdditive/Preliminaries/FiniteFieldSums.lean @@ -21,7 +21,7 @@ over the whole field. This module is deliberately below the character-sum and MCM layers so that both can use the same finite-field infrastructure. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Prelude.lean b/LeanPool/KasamiCyclicAdditive/Prelude.lean index c8c84be273..f8fdc67906 100644 --- a/LeanPool/KasamiCyclicAdditive/Prelude.lean +++ b/LeanPool/KasamiCyclicAdditive/Prelude.lean @@ -45,4 +45,4 @@ dependency surface explicit so that the entry point does not pull in the whole Mathlib umbrella. -/ -@[expose] public section +public section diff --git a/LeanPool/KasamiCyclicAdditive/Statement/CoefficientForm.lean b/LeanPool/KasamiCyclicAdditive/Statement/CoefficientForm.lean index b42acc23be..3ebb541e5c 100644 --- a/LeanPool/KasamiCyclicAdditive/Statement/CoefficientForm.lean +++ b/LeanPool/KasamiCyclicAdditive/Statement/CoefficientForm.lean @@ -28,7 +28,7 @@ this module; `coefficient_form_nat_of_slope_form` is what carries the assembled slope theorem back to the coefficient form of the original conjecture. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/KasamiCyclicAdditive/Statement/Definitions.lean b/LeanPool/KasamiCyclicAdditive/Statement/Definitions.lean index d56fbd026a..218a487588 100644 --- a/LeanPool/KasamiCyclicAdditive/Statement/Definitions.lean +++ b/LeanPool/KasamiCyclicAdditive/Statement/Definitions.lean @@ -23,7 +23,7 @@ agreement with the independently structured literature specification was checked in the source project before this import. -/ -@[expose] public section +public section open Finset @@ -32,20 +32,21 @@ namespace KasamiCyclicAdditive variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] /-- The Kasami exponent `4^k - 2^k + 1`. -/ -def kasamiExponent (k : ℕ) : ℕ := 4 ^ k - 2 ^ k + 1 +@[expose] def kasamiExponent (k : ℕ) : ℕ := 4 ^ k - 2 ^ k + 1 /-- The normalized derivative of the Kasami monomial in direction `1`: `δ(b) = (b+1)^d + b^d + 1`. -/ -def kasamiDerivative (k : ℕ) (b : K) : K := +@[expose] def kasamiDerivative (k : ℕ) (b : K) : K := (b + 1) ^ kasamiExponent k + b ^ kasamiExponent k + 1 /-- The image `Δ` of the normalized Kasami derivative. -/ +@[expose] def derivativeImage (k : ℕ) (K : Type*) [Field K] [Fintype K] [DecidableEq K] : Finset K := Finset.image (kasamiDerivative k) Finset.univ /-- The number of triples `(x,y,z) ∈ Δ³` satisfying `v₁ x + v₂ y + (v₁+v₂) z = 0`. -/ -def coefficientTripleCount (k : ℕ) (v₁ v₂ : K) : ℕ := +@[expose] def coefficientTripleCount (k : ℕ) (v₁ v₂ : K) : ℕ := (((derivativeImage k K) ×ˢ (derivativeImage k K) ×ˢ (derivativeImage k K)).filter (fun p => v₁ * p.1 + v₂ * p.2.1 + (v₁ + v₂) * p.2.2 = 0)).card diff --git a/LeanPool/KasamiCyclicAdditive/Statement/ParameterReduction.lean b/LeanPool/KasamiCyclicAdditive/Statement/ParameterReduction.lean index 32e767af56..3380a45752 100644 --- a/LeanPool/KasamiCyclicAdditive/Statement/ParameterReduction.lean +++ b/LeanPool/KasamiCyclicAdditive/Statement/ParameterReduction.lean @@ -27,7 +27,7 @@ cardinality `2^n`. Thus the normalization used by the proof is a theorem, not an extra hypothesis in the statement. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Koethe.lean b/LeanPool/Koethe.lean index d80e2f3a29..6e19ad469f 100644 --- a/LeanPool/Koethe.lean +++ b/LeanPool/Koethe.lean @@ -30,7 +30,7 @@ Tags: ring-theory, nil-ideals, koethe-conjecture, counterexample, matrix-rings MSC: 16N40, 16S50 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Koethe/Counterexample.lean b/LeanPool/Koethe/Counterexample.lean index 9776cb2b5b..9255c05ec2 100644 --- a/LeanPool/Koethe/Counterexample.lean +++ b/LeanPool/Koethe/Counterexample.lean @@ -37,7 +37,7 @@ in an arbitrary universe, a nil two-sided ideal `I ⊆ R`, and a matrix in `M_2( not nilpotent. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/Disproof.lean b/LeanPool/Koethe/Disproof.lean index 25b8e4f14b..8ef91c05a6 100644 --- a/LeanPool/Koethe/Disproof.lean +++ b/LeanPool/Koethe/Disproof.lean @@ -39,7 +39,7 @@ the conjecture as originally stated. That implication is a standard argument and of this formal development. -/ -@[expose] public section +public section open Ideal TwoSidedIdeal Polynomial diff --git a/LeanPool/Koethe/Linearization/Basic.lean b/LeanPool/Koethe/Linearization/Basic.lean index 2fa8fbce5d..974a1d4bef 100644 --- a/LeanPool/Koethe/Linearization/Basic.lean +++ b/LeanPool/Koethe/Linearization/Basic.lean @@ -20,7 +20,7 @@ system. We construct this property directly, without needing a matrix inverse or a nilpotence assumption on the ambient algebra. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ universe u v variable {k : Type u} [Field k] {R : Type v} [Ring R] [Algebra k R] /-- Evaluate one homogeneous-linear edge, as a constant polynomial. -/ -def edge (a : Fin 3 → R) (c : Triple k) : Polynomial R := +@[expose] def edge (a : Fin 3 → R) (c : Triple k) : Polynomial R := Polynomial.C (∑ i : Fin 3, algebraMap k R (c i) * a i) @[simp] theorem edge_zero (a : Fin 3 → R) : edge a (0 : Triple k) = 0 := by @@ -77,6 +77,7 @@ attribute [instance] System.fintype System.decEq /-- Every solution of the internal equations gives the specified output. All equations take place in the polynomial ring over the possibly noncommutative algebra `R`. -/ +@[expose] def Represents (S : System k) (a : Fin 3 → R) (x : R) : Prop := ∀ (q₀ : Polynomial R) (q : S.State → Polynomial R), (∀ i, q i = edge a (S.input i) * q₀ + @@ -85,6 +86,7 @@ def Represents (S : System k) (a : Fin 3 → R) (x : R) : Prop := Polynomial.C x * q₀ /-- The elements admitting one of these finite linearizations. -/ +@[expose] def Linearizable (a : Fin 3 → R) (x : R) : Prop := ∃ S : System k, Represents S a x @@ -101,7 +103,7 @@ def atom (c : Triple k) : System k where step := Empty.elim /-- Disjoint union of systems, adding their output rows. -/ -def add (S T : System k) : System k where +@[expose] def add (S T : System k) : System k where State := S.State ⊕ T.State fintype := inferInstance decEq := inferInstance @@ -125,7 +127,7 @@ def smul (r : k) (S : System k) : System k where /-- Prepend a generator: a new internal state computes the old output, and one generator edge joins the new output to that state. -/ -def prepend (i : Fin 3) (S : System k) : System k where +@[expose] def prepend (i : Fin 3) (S : System k) : System k where State := Option S.State fintype := inferInstance decEq := inferInstance diff --git a/LeanPool/Koethe/Linearization/Nil.lean b/LeanPool/Koethe/Linearization/Nil.lean index 6735f24a0f..3c7e1022ac 100644 --- a/LeanPool/Koethe/Linearization/Nil.lean +++ b/LeanPool/Koethe/Linearization/Nil.lean @@ -28,7 +28,7 @@ multiplication by `x` preserves linearizability. At a generator this is the `prepend` construction; the multiplication step is then composition. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/Linearization/Pencil.lean b/LeanPool/Koethe/Linearization/Pencil.lean index 40f5204633..0fec199e28 100644 --- a/LeanPool/Koethe/Linearization/Pencil.lean +++ b/LeanPool/Koethe/Linearization/Pencil.lean @@ -20,7 +20,7 @@ root column gives `q = 1 + X * C(x) * q`. The coefficients of this polynomial are `x^n`, and their eventual vanishing proves nilpotence of `x`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/MaskSequence/Basic.lean b/LeanPool/Koethe/MaskSequence/Basic.lean index 62e178abe3..5d60b4c8c1 100644 --- a/LeanPool/Koethe/MaskSequence/Basic.lean +++ b/LeanPool/Koethe/MaskSequence/Basic.lean @@ -26,7 +26,7 @@ preserves this invariant. Thus no limiting density or geometric-series calculation is needed. -/ -@[expose] public section +public section noncomputable section @@ -36,6 +36,7 @@ namespace MaskSequence variable {k : Type*} [Field k] /-- All assignments, at all sites, of `M` persist in `N`. -/ +@[expose] def Extends (N M : PeriodicMask k) : Prop := ∀ n z, M.lookup n = some z → N.lookup n = some z @@ -133,7 +134,7 @@ def install (M : PeriodicMask k) (w : List (Triple k)) @[simp] theorem install_period (M : PeriodicMask k) (w : List (Triple k)) (hw : ∀ z ∈ w, z ≠ 0) : - (install M w hw).period = (4 * w.length + 1) * M.period := rfl + (install M w hw).period = (4 * w.length + 1) * M.period := by rfl theorem period_dvd_install (M : PeriodicMask k) (w : List (Triple k)) (hw : ∀ z ∈ w, z ≠ 0) : M.period ∣ (install M w hw).period := diff --git a/LeanPool/Koethe/MaskSequence/Chain.lean b/LeanPool/Koethe/MaskSequence/Chain.lean index 9a74fb9a8e..afdf587214 100644 --- a/LeanPool/Koethe/MaskSequence/Chain.lean +++ b/LeanPool/Koethe/MaskSequence/Chain.lean @@ -21,7 +21,7 @@ integral sparsity bound is retained. A pointwise choice then produces a nonzero sequence respecting every assignment at every stage. -/ -@[expose] public section +public section noncomputable section @@ -31,10 +31,12 @@ namespace MaskSequence variable {k : Type*} [Field k] /-- The word is installed at the beginning of a period, and fits in that period. -/ +@[expose] def Carries (M : PeriodicMask k) (w : List (Triple k)) : Prop := w.length ≤ M.period ∧ ∀ i : Fin w.length, M.lookup i.val = some (w.get i) /-- A mask contains a periodically recurring mortal word for this pencil. -/ +@[expose] def Kills {d : ℕ} (M : PeriodicMask k) (P : Pencil k d) : Prop := ∃ w : List (Triple k), Carries M w ∧ P.wordProd w = 0 diff --git a/LeanPool/Koethe/MaskSequence/Universal.lean b/LeanPool/Koethe/MaskSequence/Universal.lean index f956964ae2..3e8981eb7d 100644 --- a/LeanPool/Koethe/MaskSequence/Universal.lean +++ b/LeanPool/Koethe/MaskSequence/Universal.lean @@ -24,7 +24,7 @@ the abstract mortality assumption, and no assertion about the density of an infinite union of masks. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/Mortality/Degree.lean b/LeanPool/Koethe/Mortality/Degree.lean index 246b1ba130..09b9188d57 100644 --- a/LeanPool/Koethe/Mortality/Degree.lean +++ b/LeanPool/Koethe/Mortality/Degree.lean @@ -19,7 +19,7 @@ make the latter minors zero. Thus a single parameter row contributes at most one to the degree per factor, not the size of the minor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/Mortality/FormalWord.lean b/LeanPool/Koethe/Mortality/FormalWord.lean index 4c043bd0b1..2ed71e5d72 100644 --- a/LeanPool/Koethe/Mortality/FormalWord.lean +++ b/LeanPool/Koethe/Mortality/FormalWord.lean @@ -23,7 +23,7 @@ The common-zero theorem is applied to the coefficients of a single pivot minor. Its equation count is the full word length plus one. -/ -@[expose] public section +public section noncomputable section @@ -46,11 +46,13 @@ def letterCoeffs [Field k] : FormalLetter k N → Fin 3 → HoleRing k N /-- The multidegree of a formal letter: zero for a fixed letter, one unit of its block for a hole. -/ +@[expose] def letterDegree : FormalLetter k N → Fin N → ℕ | .inl _ => 0 | .inr b => blockUnit b /-- Specialize a formal letter at an assignment of the hole variables. -/ +@[expose] def specializeLetter (x : (Fin N × Fin 3) → k) : FormalLetter k N → Triple k | .inl a => a | .inr b => fun j => x (b, j) diff --git a/LeanPool/Koethe/Mortality/Homogeneous.lean b/LeanPool/Koethe/Mortality/Homogeneous.lean index 1295f7e613..1817e795a3 100644 --- a/LeanPool/Koethe/Mortality/Homogeneous.lean +++ b/LeanPool/Koethe/Mortality/Homogeneous.lean @@ -22,7 +22,7 @@ ring is a multivariate polynomial ring whose variables are grouped into independent triples. The zero polynomial is homogeneous of every degree. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ abbrev HoleRing (k : Type*) [CommSemiring k] (N : ℕ) := MvPolynomial (Fin N × Fin 3) k /-- The multidegree contributed by one occurrence of block `b`. -/ -def blockUnit {N : ℕ} (b : Fin N) : Fin N → ℕ := fun c => if c = b then 1 else 0 +@[expose] def blockUnit {N : ℕ} (b : Fin N) : Fin N → ℕ := fun c => if c = b then 1 else 0 section Homogeneity @@ -44,6 +44,7 @@ variable {k : Type*} [CommRing k] {N : ℕ} /-- The coefficients in the central parameter are all multihomogeneous of one and the same specified multidegree. -/ +@[expose] def CoeffHom (p : Polynomial (HoleRing k N)) (e : Fin N → ℕ) : Prop := ∀ j, IsMultiHomogeneous (p.coeff j) e @@ -132,6 +133,7 @@ theorem CoeffHom.prod {ι : Type*} (s : Finset ι) (ih (fun j hj => hf j (Finset.mem_insert_of_mem hj))) /-- The common multidegree of every coefficient of every matrix entry. -/ +@[expose] def MatrixCoeffHom {m n : Type*} (A : Matrix m n (Polynomial (HoleRing k N))) (e : Fin N → ℕ) : Prop := ∀ i j, CoeffHom (A i j) e diff --git a/LeanPool/Koethe/Mortality/Mask.lean b/LeanPool/Koethe/Mortality/Mask.lean index efaefc0308..2298e03e82 100644 --- a/LeanPool/Koethe/Mortality/Mask.lean +++ b/LeanPool/Koethe/Mortality/Mask.lean @@ -23,7 +23,7 @@ residue classes. In particular a connector of length `m * period` has `m * holes` distinct projective blocks. -/ -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ def connectorLetter (M : PeriodicMask k) (L : ℕ) (i : Fin L) : /-- The formal word of length `L` reading the mask: its fixed letter at each assigned position and a distinct hole at each free position. -/ -def formalConnector (M : PeriodicMask k) (L : ℕ) : +@[expose] def formalConnector (M : PeriodicMask k) (L : ℕ) : List (FormalLetter k (freeCount M L)) := List.ofFn (connectorLetter M L) @[simp] theorem formalConnector_length (M : PeriodicMask k) (L : ℕ) : diff --git a/LeanPool/Koethe/Mortality/MaskMortality.lean b/LeanPool/Koethe/Mortality/MaskMortality.lean index bd3cc674e8..056ecdfd51 100644 --- a/LeanPool/Koethe/Mortality/MaskMortality.lean +++ b/LeanPool/Koethe/Mortality/MaskMortality.lean @@ -30,7 +30,7 @@ in the constant field, and all products are in the forward word convention of `KoethePencilDefs`. No nilness or countability hypothesis is used. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/Mortality/Minors.lean b/LeanPool/Koethe/Mortality/Minors.lean index 6ecb2c9c65..8de6c5dae4 100644 --- a/LeanPool/Koethe/Mortality/Minors.lean +++ b/LeanPool/Koethe/Mortality/Minors.lean @@ -17,7 +17,7 @@ This avoids choosing bases for exterior powers. All matrix products in this file are ordinary products over a commutative scalar ring. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable {r : ℕ} /-- All minors of a specified size vanish. Repeated rows or columns are allowed in the indexing functions; their determinants are automatically zero. -/ -def MinorsVanish (A : Matrix n n R) (r : ℕ) : Prop := +@[expose] def MinorsVanish (A : Matrix n n R) (r : ℕ) : Prop := ∀ I J : Fin r → n, (A.submatrix I J).det = 0 theorem det_submatrix_zero_of_not_injective (A : Matrix n m R) diff --git a/LeanPool/Koethe/MultiProjective.lean b/LeanPool/Koethe/MultiProjective.lean index dc27d87f0f..aac943040c 100644 --- a/LeanPool/Koethe/MultiProjective.lean +++ b/LeanPool/Koethe/MultiProjective.lean @@ -27,7 +27,7 @@ is homogeneous of every multidegree. No projective intersection theorem is assumed as an axiom. -/ -@[expose] public section +public section noncomputable section @@ -42,7 +42,7 @@ variable {k : Type*} {N : ℕ} abbrev Vars (N : ℕ) := Fin N × Fin 3 /-- The degree of an exponent vector in one block. -/ -def blockDegree (d : Vars N →₀ ℕ) (b : Fin N) : ℕ := +@[expose] def blockDegree (d : Vars N →₀ ℕ) (b : Fin N) : ℕ := ∑ j : Fin 3, d (b, j) @[simp] theorem blockDegree_zero (b : Fin N) : blockDegree 0 b = 0 := by @@ -77,6 +77,7 @@ theorem Balanced.add_iff_right {d e : Vars N →₀ ℕ} (hd : Balanced d) : · exact hd.add /-- Coefficientwise multihomogeneity with a specified degree in each block. -/ +@[expose] def IsMultiHomogeneous [CommSemiring k] (f : MvPolynomial (Vars N) k) (r : Fin N → ℕ) : Prop := ∀ d, f.coeff d ≠ 0 → ∀ b, blockDegree d b = r b @@ -415,7 +416,7 @@ theorem balancedPart_mul {p : MvPolynomial (Vars N) k} _ = p * balancedPart q := by rw [← Finset.sum_mul, ← p.as_sum] /-- The same projection with codomain restricted to the balanced algebra. -/ -def balancedRetract : MvPolynomial (Vars N) k →ₗ[k] balancedAlgebra k N := +@[expose] def balancedRetract : MvPolynomial (Vars N) k →ₗ[k] balancedAlgebra k N := balancedPart.codRestrict (balancedAlgebra k N).toSubmodule balancedPart_mem @[simp] theorem coe_balancedRetract (p : MvPolynomial (Vars N) k) : @@ -477,7 +478,7 @@ section Height variable [Field k] /-- A Segre coordinate as an element of the balanced subalgebra. -/ -def segre (j : Fin N → Fin 3) : balancedAlgebra k N := +@[expose] def segre (j : Fin N → Fin 3) : balancedAlgebra k N := ⟨segreMonomial j, segreMonomial_mem j⟩ @[simp] theorem coe_segre (j : Fin N → Fin 3) : diff --git a/LeanPool/Koethe/Pencil.lean b/LeanPool/Koethe/Pencil.lean index f26d7bcdf6..6f65517218 100644 --- a/LeanPool/Koethe/Pencil.lean +++ b/LeanPool/Koethe/Pencil.lean @@ -23,7 +23,7 @@ matrix-mortality property proved in `LeanPool.Koethe.Mortality.MaskMortality`, a `LeanPool.Koethe.MaskSequence.Universal`. -/ -@[expose] public section +public section noncomputable section @@ -59,13 +59,13 @@ instance [Countable k] : Countable (Pencil k d) := by (fun _ _ h => Pencil.ext (congrArg Prod.fst h) (congrArg Prod.snd h)) /-- Evaluation at a constant letter vector. -/ -def eval (P : Pencil k d) (v : Triple k) : +@[expose] def eval (P : Pencil k d) (v : Triple k) : Matrix (Fin (d + 1)) (Fin (d + 1)) (Polynomial k) := fun row col => Polynomial.C (∑ i : Fin 3, v i * P.scalar i row col) + Polynomial.X * Polynomial.C (∑ i : Fin 3, v i * P.linear i row col) /-- Evaluation at three elements of an arbitrary algebra. -/ -def lift {R : Type*} [Ring R] [Algebra k R] (P : Pencil k d) (a : Fin 3 → R) : +@[expose] def lift {R : Type*} [Ring R] [Algebra k R] (P : Pencil k d) (a : Fin 3 → R) : Matrix (Fin (d + 1)) (Fin (d + 1)) (Polynomial R) := fun row col => Polynomial.C (∑ i : Fin 3, algebraMap k R (P.scalar i row col) * a i) + Polynomial.X * Polynomial.C @@ -73,7 +73,7 @@ def lift {R : Type*} [Ring R] [Algebra k R] (P : Pencil k d) (a : Fin 3 → R) : /-- Forward chronological multiplication. This is the transfer convention for backward shifts `(a_i u)(n) = v_n(i) u(n+1)`. -/ -def wordProd (P : Pencil k d) (w : List (Triple k)) : +@[expose] def wordProd (P : Pencil k d) (w : List (Triple k)) : Matrix (Fin (d + 1)) (Fin (d + 1)) (Polynomial k) := (w.map P.eval).prod @@ -84,7 +84,7 @@ def wordProd (P : Pencil k d) (w : List (Triple k)) : simp [wordProd] /-- The forward product of the pencil along `len` consecutive letters of `v` from `start`. -/ -def window (P : Pencil k d) (v : ℕ → Triple k) (start len : ℕ) : +@[expose] def window (P : Pencil k d) (v : ℕ → Triple k) (start len : ℕ) : Matrix (Fin (d + 1)) (Fin (d + 1)) (Polynomial k) := P.wordProd (List.ofFn fun i : Fin len => v (start + i.val)) @@ -107,30 +107,32 @@ namespace PeriodicMask variable {k : Type*} [Field k] /-- The assignment of the mask at a site, read off its residue. -/ -def lookup (M : PeriodicMask k) (n : ℕ) : Option (Triple k) := +@[expose] def lookup (M : PeriodicMask k) (n : ℕ) : Option (Triple k) := M.value ⟨n % M.period, Nat.mod_lt n M.period_pos⟩ /-- The number of free residues in one period. -/ -noncomputable def holes (M : PeriodicMask k) : ℕ := by +@[expose] noncomputable def holes (M : PeriodicMask k) : ℕ := by classical exact (Finset.univ.filter fun i => M.value i = none).card /-- The number of assigned residues in one period. -/ -noncomputable def assigned (M : PeriodicMask k) : ℕ := by +@[expose] noncomputable def assigned (M : PeriodicMask k) : ℕ := by classical exact (Finset.univ.filter fun i => M.value i ≠ none).card /-- A word agrees with the mask at every assigned position it covers. -/ -def Compatible (M : PeriodicMask k) (w : List (Triple k)) : Prop := +@[expose] def Compatible (M : PeriodicMask k) (w : List (Triple k)) : Prop := ∀ (i : Fin w.length) (z : Triple k), M.lookup i.val = some z → w.get i = z /-- A sequence agrees with the mask at every assigned site. -/ +@[expose] def SeqCompatible (M : PeriodicMask k) (v : ℕ → Triple k) : Prop := ∀ (n : ℕ) (z : Triple k), M.lookup n = some z → v n = z end PeriodicMask /-- The algebraic matrix-mortality property needed by the mask construction. -/ +@[expose] def MaskMortality (k : Type*) [Field k] : Prop := ∀ (d : ℕ) (P : Pencil k d) (M : PeriodicMask k), M.period < 2 * M.holes → @@ -139,7 +141,7 @@ def MaskMortality (k : Type*) [Field k] : Prop := /-- A nonvanishing edge sequence killing every one-row pencil on uniformly bounded windows. Nil bounds are permitted to depend on the pencil. -/ -def UniversalMortalSequence (k : Type*) [Field k] (v : ℕ → Triple k) : Prop := +@[expose] def UniversalMortalSequence (k : Type*) [Field k] (v : ℕ → Triple k) : Prop := (∀ n, v n ≠ 0) ∧ ∀ (d : ℕ) (P : Pencil k d), ∃ N : ℕ, 0 < N ∧ ∀ n : ℕ, P.window v n N = 0 diff --git a/LeanPool/Koethe/ShiftWitness/Band.lean b/LeanPool/Koethe/ShiftWitness/Band.lean index bbf67b8dfd..2b523fda05 100644 --- a/LeanPool/Koethe/ShiftWitness/Band.lean +++ b/LeanPool/Koethe/ShiftWitness/Band.lean @@ -16,7 +16,7 @@ The coefficientwise band identity below retains the pencil's independent formal variable. It does not deduce polynomial nilpotence from one specialization. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable {k : Type u} {K : Type v} [Field k] [Field K] [Algebra k K] /-- Backward weighted shifts: composition follows the forward chronological order of the shared `Pencil.wordProd`. -/ -def backShift (v : ℕ → Triple k) (i : Fin 3) : End K where +@[expose] def backShift (v : ℕ → Triple k) (i : Fin 3) : End K where toFun u n := algebraMap k K (v n i) * u (n + 1) map_add' u w := by ext n; simp [mul_add] map_smul' c u := by ext n; simp [mul_left_comm] diff --git a/LeanPool/Koethe/ShiftWitness/Eigenvector.lean b/LeanPool/Koethe/ShiftWitness/Eigenvector.lean index b4c68e6611..feb6e81023 100644 --- a/LeanPool/Koethe/ShiftWitness/Eigenvector.lean +++ b/LeanPool/Koethe/ShiftWitness/Eigenvector.lean @@ -16,7 +16,7 @@ in `RatFunc k` are invertible. Reciprocal prefix products produce a genuine (non-finitely-supported) eigenvector on the full function space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Koethe/ShiftWitness/Endpoint.lean b/LeanPool/Koethe/ShiftWitness/Endpoint.lean index c7cc6a0248..5c7cb215e3 100644 --- a/LeanPool/Koethe/ShiftWitness/Endpoint.lean +++ b/LeanPool/Koethe/ShiftWitness/Endpoint.lean @@ -19,7 +19,7 @@ nonzero eigenvalue after inverting `1 - a₀`. Squaring puts every entry in the nil ideal. No matrix-nilness principle is used. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable {R : Type w} [Ring R] /-- The action of a matrix of represented ring elements on two copies of the representation space. -/ -def matrixAction (φ : R →+* Module.End K M) : +@[expose] def matrixAction (φ : R →+* Module.End K M) : Matrix (Fin 2) (Fin 2) R →+* Module.End K (Fin 2 → M) := (endVecRingEquivMatrixEnd (Fin 2) K M).symm.toRingHom.comp φ.mapMatrix diff --git a/LeanPool/Koethe/ShiftWitness/Witness.lean b/LeanPool/Koethe/ShiftWitness/Witness.lean index 08a3fba609..3c1a8a5458 100644 --- a/LeanPool/Koethe/ShiftWitness/Witness.lean +++ b/LeanPool/Koethe/ShiftWitness/Witness.lean @@ -25,7 +25,7 @@ and its nil ideal is the kernel of the scalar projection. The universe of the existential witness is exactly the universe of the ground field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Komlos/Approximation.lean b/LeanPool/Komlos/Approximation.lean index 806f1d18cc..db75884c76 100644 --- a/LeanPool/Komlos/Approximation.lean +++ b/LeanPool/Komlos/Approximation.lean @@ -22,7 +22,7 @@ coordinate is at most `1 / N`, and no coordinate increases in absolute value. In the approximation does not increase the Euclidean norm. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/BeckFiala.lean b/LeanPool/Komlos/BeckFiala.lean index 1634a7a879..e951706d7d 100644 --- a/LeanPool/Komlos/BeckFiala.lean +++ b/LeanPool/Komlos/BeckFiala.lean @@ -22,7 +22,7 @@ an edge discrepancy bound of `36 * √t`. `Hypergraph.exists_isColouring_forall_abs_finsum_le` states it as a vertex colouring. -/ -@[expose] public section +public section namespace Hypergraph @@ -38,6 +38,7 @@ open Classical in /-- The incidence matrix of a hypergraph with finitely many vertices: its rows are indexed by the edges, its columns by the vertices, and an entry is `1` when the vertex lies in the edge and `0` otherwise. -/ +@[expose] noncomputable def incidenceMatrix (H : Hypergraph α) (hV : V(H).Finite) : Matrix (edgeSet_finite hV).toFinset hV.toFinset ℝ := Matrix.of fun e x ↦ if (x : α) ∈ (e : Set α) then 1 else 0 diff --git a/LeanPool/Komlos/Cube.lean b/LeanPool/Komlos/Cube.lean index 26f5aa1109..60c53a9643 100644 --- a/LeanPool/Komlos/Cube.lean +++ b/LeanPool/Komlos/Cube.lean @@ -20,14 +20,14 @@ with `Komlos.sum_gridF_sub_sq_le` and Weierstrass' product inequality gives `shiftDist (cubeP d N) h ^ 2 ≤ (∑ k, (h k / N) ^ 2) / 12`. -/ -@[expose] public section +public section namespace Komlos open Finset Finsupp /-- The `d`-dimensional product weight on the integer grid. -/ -noncomputable def cubeF (d N : ℕ) (g : Fin d → ℤ) : ℝ := ∏ k, gridF N (g k) +@[expose] noncomputable def cubeF (d N : ℕ) (g : Fin d → ℤ) : ℝ := ∏ k, gridF N (g k) lemma support_cubeF_sub_subset {d N : ℕ} {a : Fin d → ℤ} {K : Finset ℤ} (hK : ∀ k, Function.support (fun j ↦ gridF N (j - a k)) ⊆ K) : diff --git a/LeanPool/Komlos/Discrepancy.lean b/LeanPool/Komlos/Discrepancy.lean index 4d60e0a0f2..1d2cdbf784 100644 --- a/LeanPool/Komlos/Discrepancy.lean +++ b/LeanPool/Komlos/Discrepancy.lean @@ -23,7 +23,7 @@ A colouring is a function with values in `{-1, 1}`. For a matrix `A` and a colou satisfying that bound. The minimum is attained because there are finitely many colourings. -/ -@[expose] public section +public section namespace Komlos @@ -32,6 +32,7 @@ open Finset Matrix variable {m n : Type*} /-- A colouring of `n` is a `±1`-valued function on `n`. -/ +@[expose] def IsColouring (χ : n → ℝ) : Prop := ∀ j, χ j = 1 ∨ χ j = -1 /-- The colouring attached to a Boolean assignment. -/ @@ -52,6 +53,7 @@ lemma exists_ofBool_eq {χ : n → ℝ} (hχ : IsColouring χ) : ∃ b, ofBool b /-- The discrepancy of the colouring `χ` with respect to `A`: the supremum norm of the signed sum `A *ᵥ χ` of the columns of `A`. -/ +@[expose] noncomputable def colouringDiscrepancy [Fintype m] [Fintype n] (A : Matrix m n ℝ) (χ : n → ℝ) : ℝ := ‖A *ᵥ χ‖ diff --git a/LeanPool/Komlos/Distribution.lean b/LeanPool/Komlos/Distribution.lean index 4bdc94293f..dfb649796f 100644 --- a/LeanPool/Komlos/Distribution.lean +++ b/LeanPool/Komlos/Distribution.lean @@ -23,7 +23,7 @@ and the sum of the two means are preserved. `Komlos.mean_mem_convexHull` places probability distribution in the convex hull of its support. -/ -@[expose] public section +public section namespace Komlos @@ -32,9 +32,10 @@ open Finsupp Finset variable {E : Type*} /-- Total weight of a finitely supported real-valued function. -/ -noncomputable def mass (P : E →₀ ℝ) : ℝ := P.sum fun _ r ↦ r +@[expose] noncomputable def mass (P : E →₀ ℝ) : ℝ := P.sum fun _ r ↦ r /-- The weighted sum of the support points, without dividing by the total mass. -/ +@[expose] noncomputable def mean [AddCommGroup E] [Module ℝ E] (P : E →₀ ℝ) : E := P.sum fun x r ↦ r • x /-- A finitely supported probability distribution: nonnegative weights with total mass one. -/ diff --git a/LeanPool/Komlos/Grid.lean b/LeanPool/Komlos/Grid.lean index 6fd143463d..3f2155dd16 100644 --- a/LeanPool/Komlos/Grid.lean +++ b/LeanPool/Komlos/Grid.lean @@ -22,7 +22,7 @@ Its square has total mass `1`. The `L²` distance between `gridF N` and its tran integer `m` is at most `|m| / (N * √12)`. -/ -@[expose] public section +public section namespace Komlos @@ -36,7 +36,7 @@ noncomputable def gridZ (N : ℕ) : ℝ := ∑ j ∈ Finset.Icc (-(gridM N : ℤ)) (gridM N), tent (gridM N) j ^ 2 /-- The normalised one-dimensional weight. -/ -noncomputable def gridF (N : ℕ) (j : ℤ) : ℝ := tent (gridM N) j / Real.sqrt (gridZ N) +@[expose] noncomputable def gridF (N : ℕ) (j : ℤ) : ℝ := tent (gridM N) j / Real.sqrt (gridZ N) lemma cast_gridM (N : ℕ) : (gridM N : ℝ) = 6 * N := by rw [gridM, Nat.cast_mul, Nat.cast_ofNat] diff --git a/LeanPool/Komlos/GridCase.lean b/LeanPool/Komlos/GridCase.lean index f9974e48f0..8324259e64 100644 --- a/LeanPool/Komlos/GridCase.lean +++ b/LeanPool/Komlos/GridCase.lean @@ -19,7 +19,7 @@ Lemma 1.4 after scaling the vectors by `1 / 6`. The resulting signed sum has sup at most `36`. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/Hellinger.lean b/LeanPool/Komlos/Hellinger.lean index ab079446da..3e50fa7833 100644 --- a/LeanPool/Komlos/Hellinger.lean +++ b/LeanPool/Komlos/Hellinger.lean @@ -20,7 +20,7 @@ The file also proves Weierstrass' product inequality, used to compare product di in `Komlos.Cube`. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/Main.lean b/LeanPool/Komlos/Main.lean index 777928f4c8..aabf75069e 100644 --- a/LeanPool/Komlos/Main.lean +++ b/LeanPool/Komlos/Main.lean @@ -24,7 +24,7 @@ has discrepancy at most `36 + η` for the original matrix. Letting `η` tend to bound. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/NearInvariant.lean b/LeanPool/Komlos/NearInvariant.lean index ef208af8b5..9fb3f257e7 100644 --- a/LeanPool/Komlos/NearInvariant.lean +++ b/LeanPool/Komlos/NearInvariant.lean @@ -22,7 +22,7 @@ under every grid translation of Euclidean norm at most `1`. The distribution is the image of `cubeP d N` under coordinatewise division by `N`. -/ -@[expose] public section +public section namespace Komlos @@ -39,7 +39,7 @@ noncomputable def gridEmb (d N : ℕ) : (Fin d → ℤ) →+ (Fin d → ℝ) whe simp [add_div] @[simp] lemma gridEmb_apply (d N : ℕ) (g : Fin d → ℤ) (k : Fin d) : - gridEmb d N g k = (g k : ℝ) / N := rfl + gridEmb d N g k = (g k : ℝ) / N := by rfl lemma gridEmb_injective {d N : ℕ} (hN : 0 < N) : Function.Injective (gridEmb d N) := by intro g g' h diff --git a/LeanPool/Komlos/Pullback.lean b/LeanPool/Komlos/Pullback.lean index 434dbde937..fb618b6de3 100644 --- a/LeanPool/Komlos/Pullback.lean +++ b/LeanPool/Komlos/Pullback.lean @@ -23,7 +23,7 @@ For points with last coordinate `0`, choose one of the points `x ± 3 • w` in are chosen so that the change in the first coordinate is `e • w`. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/ShiftDistance.lean b/LeanPool/Komlos/ShiftDistance.lean index 0e0cf3905d..e9a2d169e6 100644 --- a/LeanPool/Komlos/ShiftDistance.lean +++ b/LeanPool/Komlos/ShiftDistance.lean @@ -19,7 +19,7 @@ Adapted for Lean Pool by changing module paths and selecting explicit imports. For probability distributions, overlap equals `1 - tvDist P Q`. -/ -@[expose] public section +public section namespace Komlos @@ -28,12 +28,15 @@ open Finsupp Finset variable {E : Type*} /-- Half the sum of absolute differences of the weights of two finitely supported functions. -/ +@[expose] noncomputable def tvDist (P Q : E →₀ ℝ) : ℝ := 2⁻¹ * (P - Q).sum fun _ r ↦ |r| /-- Total common weight, computed by taking the pointwise minimum. -/ +@[expose] noncomputable def overlap (P Q : E →₀ ℝ) : ℝ := mass (P ⊓ Q) /-- Total variation distance between a finitely supported function and its translate by `u`. -/ +@[expose] noncomputable def shiftDist [AddCommGroup E] (P : E →₀ ℝ) (u : E) : ℝ := tvDist P (tr u P) lemma tvDist_nonneg (P Q : E →₀ ℝ) : 0 ≤ tvDist P Q := by diff --git a/LeanPool/Komlos/SignedSums.lean b/LeanPool/Komlos/SignedSums.lean index 2ccccec7b7..d19f6e0ce2 100644 --- a/LeanPool/Komlos/SignedSums.lean +++ b/LeanPool/Komlos/SignedSums.lean @@ -21,7 +21,7 @@ The proof is by induction on the number of vectors. Split in the direction of th vector, apply the induction hypothesis in `E × ℝ`, and use the pullback lemma. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/Split.lean b/LeanPool/Komlos/Split.lean index a40d7fda45..52045e2620 100644 --- a/LeanPool/Komlos/Split.lean +++ b/LeanPool/Komlos/Split.lean @@ -22,7 +22,7 @@ is unchanged and the last component is `Komlos.splitBit v P`. Claim 3.2, shift distance in direction `u`. -/ -@[expose] public section +public section namespace Komlos @@ -31,6 +31,7 @@ open Finsupp Finset variable {E : Type*} /-- The embedding of `E` as the slice at height `b` of `E × ℝ`. -/ +@[expose] def incl (b : ℝ) : E ↪ E × ℝ := ⟨fun x ↦ (x, b), Prod.mk_left_injective b⟩ @[simp] lemma incl_apply (b : ℝ) (x : E) : incl b x = (x, b) := rfl diff --git a/LeanPool/Komlos/Tent.lean b/LeanPool/Komlos/Tent.lean index 89711cb39f..b6614028d6 100644 --- a/LeanPool/Komlos/Tent.lean +++ b/LeanPool/Komlos/Tent.lean @@ -28,7 +28,7 @@ The latter follows by expressing a shift as a sum of one-step differences and ap Cauchy–Schwarz. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/Komlos/Translation.lean b/LeanPool/Komlos/Translation.lean index 1aa088548d..81ea86ca77 100644 --- a/LeanPool/Komlos/Translation.lean +++ b/LeanPool/Komlos/Translation.lean @@ -16,7 +16,7 @@ Adapted for Lean Pool by changing module paths and selecting explicit imports. `mass P • u`, which is `u` when `P` is a probability distribution. -/ -@[expose] public section +public section namespace Komlos @@ -25,7 +25,7 @@ open Finsupp Finset variable {E : Type*} [AddCommGroup E] /-- Translation of a finitely supported function, carrying the weight at `x` to `x + u`. -/ -noncomputable def tr (u : E) (P : E →₀ ℝ) : E →₀ ℝ := +@[expose] noncomputable def tr (u : E) (P : E →₀ ℝ) : E →₀ ℝ := Finsupp.equivMapDomain (Equiv.addRight u) P @[simp] lemma tr_apply (u : E) (P : E →₀ ℝ) (x : E) : tr u P x = P (x - u) := by diff --git a/LeanPool/Komlos/Transport.lean b/LeanPool/Komlos/Transport.lean index c450c2abd1..558d6a366c 100644 --- a/LeanPool/Komlos/Transport.lean +++ b/LeanPool/Komlos/Transport.lean @@ -17,7 +17,7 @@ shift distance. These results allow the integer-lattice distribution to be mappe real grid by `g ↦ g / N` when `N > 0`. -/ -@[expose] public section +public section namespace Komlos diff --git a/LeanPool/KrafftSieve.lean b/LeanPool/KrafftSieve.lean index 5a2ef9d93a..9719014696 100644 --- a/LeanPool/KrafftSieve.lean +++ b/LeanPool/KrafftSieve.lean @@ -28,7 +28,7 @@ Tags: analytic-number-theory, sieve-theory, twin-primes, optimization MSC: 11N05, 11N35 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/KrafftSieve/Basic.lean b/LeanPool/KrafftSieve/Basic.lean index 35c73c3e4d..f89863bfa6 100644 --- a/LeanPool/KrafftSieve/Basic.lean +++ b/LeanPool/KrafftSieve/Basic.lean @@ -28,7 +28,7 @@ This module provides basic bounds and properties for the primes and the primorial $q(n)$ used throughout the Krafft Sieve formalization. -/ -@[expose] public section +public section namespace KrafftSieve diff --git a/LeanPool/KrafftSieve/Defs.lean b/LeanPool/KrafftSieve/Defs.lean index 4fbcdcacdc..d6a3d26784 100644 --- a/LeanPool/KrafftSieve/Defs.lean +++ b/LeanPool/KrafftSieve/Defs.lean @@ -35,7 +35,7 @@ This module establishes the foundational definitions for the sieve: - $sum1, sum2$: Weighted sums over the interval. -/ -@[expose] public section +public section namespace KrafftSieve @@ -45,36 +45,36 @@ noncomputable section /-- Definition of the set of primes primeWindow. Let $\mathcal{P}_n$ denote the set of primes $p$ such that $5 \le p < 6n+2$. -/ -def primeWindow (n : ℕ) : Finset ℕ := +@[expose] def primeWindow (n : ℕ) : Finset ℕ := (Finset.range (6 * n + 2)).filter (fun p => 5 ≤ p ∧ p.Prime) /-- Definition of the primorial q. Define the primorial $q = \prod_{p \in \mathcal{P}_n} p$. -/ -def q (n : ℕ) : ℕ := (primeWindow n).prod (fun p => p) +@[expose] def q (n : ℕ) : ℕ := (primeWindow n).prod (fun p => p) /-- Definition of w as the cardinality of primeWindow. Let $w = |\mathcal{P}_n|$ be the number of distinct prime factors of $q$. -/ -def w (n : ℕ) : ℕ := (primeWindow n).card +@[expose] def w (n : ℕ) : ℕ := (primeWindow n).card /-- Definition of the sorted list of primes and the accessor function p_i. Index the primes in $\mathcal{P}_n$ as $p_1, p_2, \dots, p_w$. -/ -def primesList (n : ℕ) : List ℕ := (primeWindow n).sort (· ≤ ·) +@[expose] def primesList (n : ℕ) : List ℕ := (primeWindow n).sort (· ≤ ·) /-- Access the $i$-th prime $p_i$. Note that we use 0-based indexing for the implementation, so $p_0$ corresponds to the user's $p_1$. -/ -def p (n : ℕ) (i : Fin (w n)) : ℕ := (primesList n).get (i.cast (by +@[expose] def p (n : ℕ) (i : Fin (w n)) : ℕ := (primesList n).get (i.cast (by unfold w primesList simp_all only [Finset.length_sort])) /-- Define r^K Define the Krafft tuple r^K such that for each 1 <= i <= w, r^K_i = floor((p_i+1)/6). -/ -def krafftResidue (n : ℕ) (i : Fin (w n)) : ℕ := (p n i + 1) / 6 +@[expose] def krafftResidue (n : ℕ) (i : Fin (w n)) : ℕ := (p n i + 1) / 6 /-- Define evalInterval Define the target interval of indices: evalInterval = {x in N | 6n^2 - 2n <= x <= 6n^2 + 10n + 3}. -/ -def evalInterval (n : ℕ) : Finset ℕ := +@[expose] def evalInterval (n : ℕ) : Finset ℕ := Finset.Icc (6 * n ^ 2 - 2 * n) (6 * n ^ 2 + 10 * n + 3) /-- Define the local hit function g_i(x) @@ -82,7 +82,7 @@ Define the local hit function $g_i : \mathbb{Z}/q\mathbb{Z} \to \mathbb{R}$ for each prime index $i \in \{1, \dots, w\}$. - $g_i(x) = 1$ if $x \equiv r^K_i \pmod{p_i}$ or $x \equiv -r^K_i \pmod{p_i}$. - Otherwise, $g_i(x) = 0$. -/ -noncomputable def g (n : ℕ) (i : Fin (w n)) (x : ZMod (q n)) : ℝ := +@[expose] noncomputable def g (n : ℕ) (i : Fin (w n)) (x : ZMod (q n)) : ℝ := if (x.cast : ZMod (p n i)) = (krafftResidue n i : ZMod (p n i)) ∨ (x.cast : ZMod (p n i)) = -(krafftResidue n i : ZMod (p n i)) then 1 else 0 @@ -91,19 +91,19 @@ noncomputable def g (n : ℕ) (i : Fin (w n)) (x : ZMod (q n)) : ℝ := Define the global additive hit counter $c : \mathbb{Z}/q\mathbb{Z} \to \mathbb{R}$ as the sum of all local hits: $$ c(x) = \sum_{i=1}^w g_i(x) $$ -/ -noncomputable def c (n : ℕ) (x : ZMod (q n)) : ℝ := +@[expose] noncomputable def c (n : ℕ) (x : ZMod (q n)) : ℝ := ∑ i : Fin (w n), g n i x /-- Define the total weighted mass of the interval sum1(n, W) Define the total weighted mass of the interval $sum1(n, W)$: $$ sum1(n, W) = \sum_{x \in \mathcal{A}_n} W(x) $$ -/ -noncomputable def sum1 (n : ℕ) (W : ZMod (q n) → ℝ) : ℝ := +@[expose] noncomputable def sum1 (n : ℕ) (W : ZMod (q n) → ℝ) : ℝ := ∑ x ∈ evalInterval n, W (x : ZMod (q n)) /-- Define the weighted hit count sum2(n, W) Define the weighted hit count $sum2(n, W)$: $$ sum2(n, W) = \sum_{x \in \mathcal{A}_n} W(x) c(x) $$ -/ -noncomputable def sum2 (n : ℕ) (W : ZMod (q n) → ℝ) : ℝ := +@[expose] noncomputable def sum2 (n : ℕ) (W : ZMod (q n) → ℝ) : ℝ := ∑ x ∈ evalInterval n, W (x : ZMod (q n)) * c n (x : ZMod (q n)) end diff --git a/LeanPool/KrafftSieve/MainTheorem.lean b/LeanPool/KrafftSieve/MainTheorem.lean index 392499ba84..00149eb5e4 100644 --- a/LeanPool/KrafftSieve/MainTheorem.lean +++ b/LeanPool/KrafftSieve/MainTheorem.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.RealSqrt -/ -@[expose] public section +public section namespace KrafftSieve diff --git a/LeanPool/KrafftSieve/OptimalWeights.lean b/LeanPool/KrafftSieve/OptimalWeights.lean index 5d0a0389e9..ac4f4495ae 100644 --- a/LeanPool/KrafftSieve/OptimalWeights.lean +++ b/LeanPool/KrafftSieve/OptimalWeights.lean @@ -31,7 +31,7 @@ This module constructs the truly multidimensional optimal weights $\lambda$ for and explores the properties of the resulting polynomial $P(x)$ and weight $W_\lambda(x)$. -/ -@[expose] public section +public section namespace KrafftSieve diff --git a/LeanPool/KrafftSieve/SelbergWeights.lean b/LeanPool/KrafftSieve/SelbergWeights.lean index 5d0e41c359..4f64fb599f 100644 --- a/LeanPool/KrafftSieve/SelbergWeights.lean +++ b/LeanPool/KrafftSieve/SelbergWeights.lean @@ -30,7 +30,7 @@ This module defines the permitted residue classes $localInterval$ and the global as well as the indicator function $f(x)$ for survivors in the Krafft Sieve. -/ -@[expose] public section +public section namespace KrafftSieve @@ -66,7 +66,7 @@ Definition of the indicator function f. Define the indicator function $f : \mathbb{Z}/q\mathbb{Z} \to \mathbb{R}$ such that $f(x) = 1$ if $x \in A$, and $f(x) = 0$ otherwise. -/ -noncomputable def f (n : ℕ) (r : Fin (w n) → ℕ) (x : ZMod (q n)) : ℝ := +@[expose] noncomputable def f (n : ℕ) (r : Fin (w n) → ℕ) (x : ZMod (q n)) : ℝ := if x ∈ A n r then 1 else 0 /- @@ -334,7 +334,7 @@ theorem weighted_existence_principle (n : ℕ) (W : ZMod (q n) → ℝ) (hW : Definition of the Krafft Sufficiency condition Existence of a weight function $W$ such that $sum2(n, W) < sum1(n, W)$. -/ -def KrafftSufficiency (n : ℕ) : Prop := +@[expose] def KrafftSufficiency (n : ℕ) : Prop := ∃ W : ZMod (q n) → ℝ, (∀ x, W x ≥ 0) ∧ (∀ x : ZMod (q n), x.val ∉ evalInterval n → W x = 0) ∧ sum2 n W < sum1 n W diff --git a/LeanPool/KrafftSieve/ThirdHarmonic.lean b/LeanPool/KrafftSieve/ThirdHarmonic.lean index 2c4f172fbd..2f820cc341 100644 --- a/LeanPool/KrafftSieve/ThirdHarmonic.lean +++ b/LeanPool/KrafftSieve/ThirdHarmonic.lean @@ -31,7 +31,7 @@ specifically expanding the hit counts into frequencies and isolating the main te and the key third harmonic contribution. -/ -@[expose] public section +public section namespace KrafftSieve diff --git a/LeanPool/KrafftSieve/Variance.lean b/LeanPool/KrafftSieve/Variance.lean index b6748343c5..daf65e9932 100644 --- a/LeanPool/KrafftSieve/Variance.lean +++ b/LeanPool/KrafftSieve/Variance.lean @@ -27,7 +27,7 @@ of the survivor distribution in the Krafft Sieve, and proves Parseval's identity to relate the variance to the Fourier coefficients. -/ -@[expose] public section +public section namespace KrafftSieve diff --git a/LeanPool/Kuramoto.lean b/LeanPool/Kuramoto.lean index cf89519273..bf34597a01 100644 --- a/LeanPool/Kuramoto.lean +++ b/LeanPool/Kuramoto.lean @@ -27,4 +27,4 @@ Tags: dynamical-systems, synchronization, kuramoto MSC: 34D06 -/ -@[expose] public section +public section diff --git a/LeanPool/Kuramoto/Connections.lean b/LeanPool/Kuramoto/Connections.lean index b338ce9415..6d87798b46 100644 --- a/LeanPool/Kuramoto/Connections.lean +++ b/LeanPool/Kuramoto/Connections.lean @@ -17,7 +17,7 @@ Relations between the weighted Kuramoto potential and the Hebbian Lyapunov funct zero weight regularisation they coincide, and the Hebbian penalty is convex in each weight. -/ -@[expose] public section +public section open Real Finset diff --git a/LeanPool/Kuramoto/Contraction.lean b/LeanPool/Kuramoto/Contraction.lean index e9a3bc78db..312ffcceef 100644 --- a/LeanPool/Kuramoto/Contraction.lean +++ b/LeanPool/Kuramoto/Contraction.lean @@ -16,7 +16,7 @@ The relative velocity of two oscillators and the resulting pairwise contraction: phase gap lies in `(0, π)` and the coupling is positive, the gap is contracting. -/ -@[expose] public section +public section open Real Finset diff --git a/LeanPool/Kuramoto/Frontier.lean b/LeanPool/Kuramoto/Frontier.lean index 5493b3b267..1be6309c97 100644 --- a/LeanPool/Kuramoto/Frontier.lean +++ b/LeanPool/Kuramoto/Frontier.lean @@ -28,7 +28,7 @@ We build on the algebraic identities proved in `Weighted.lean`, `Contraction.lea and `GradientFlow.lean`. -/ -@[expose] public section +public section open Real Finset diff --git a/LeanPool/Kuramoto/GradientFlow.lean b/LeanPool/Kuramoto/GradientFlow.lean index 251432e3c7..03a00f41dc 100644 --- a/LeanPool/Kuramoto/GradientFlow.lean +++ b/LeanPool/Kuramoto/GradientFlow.lean @@ -17,7 +17,7 @@ The Kuramoto potential `kuramotoV` and force field `kuramotoF`, together with th gradient identity expressing the force as the negative phase-derivative of the potential. -/ -@[expose] public section +public section open Real Finset @@ -26,7 +26,7 @@ noncomputable def kuramotoV (K : ℝ) (N : ℕ) (θ : Fin N → ℝ) : ℝ := -(K / (2 * N)) * ∑ i : Fin N, ∑ j : Fin N, Real.cos (θ j - θ i) /-- The Kuramoto force on oscillator `i`, `F_i = (K / N) ∑_j sin (θ_j - θ_i)`. -/ -noncomputable def kuramotoF (K : ℝ) (N : ℕ) (i : Fin N) (θ : Fin N → ℝ) : ℝ := +@[expose] noncomputable def kuramotoF (K : ℝ) (N : ℕ) (i : Fin N) (θ : Fin N → ℝ) : ℝ := (K / N) * ∑ j : Fin N, Real.sin (θ j - θ i) private lemma hasDerivAt_update_apply {N : ℕ} (θ : Fin N → ℝ) (i j : Fin N) : diff --git a/LeanPool/Kuramoto/Hebbian.lean b/LeanPool/Kuramoto/Hebbian.lean index 1e100ebc2e..0069618496 100644 --- a/LeanPool/Kuramoto/Hebbian.lean +++ b/LeanPool/Kuramoto/Hebbian.lean @@ -17,22 +17,22 @@ A joint phase/weight Lyapunov function `hebbianL` with a Frobenius weight penalt Hebbian weight flow `hebbianWeightF`, and the joint Lyapunov descent property. -/ -@[expose] public section +public section open Real Finset /-- Update a single weight entry `W i j` to `x` (used to differentiate in that entry). -/ -noncomputable def hebbianUpdateWeight {N : ℕ} (W : Fin N → Fin N → ℝ) +@[expose] noncomputable def hebbianUpdateWeight {N : ℕ} (W : Fin N → Fin N → ℝ) (i j : Fin N) (x : ℝ) : Fin N → Fin N → ℝ := Function.update W i (Function.update (W i) j x) /-- Joint phase/weight Lyapunov function with a Frobenius weight penalty. -/ -noncomputable def hebbianL (K lam : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) +@[expose] noncomputable def hebbianL (K lam : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) (θ : Fin N → ℝ) : ℝ := weightedKuramotoV K N W θ + (lam / 2) * ∑ i : Fin N, ∑ j : Fin N, W i j * W i j /-- Unprojected Hebbian weight flow, the negative weight-gradient of `hebbianL`. -/ -noncomputable def hebbianWeightF (K lam : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) +@[expose] noncomputable def hebbianWeightF (K lam : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) (θ : Fin N → ℝ) (i j : Fin N) : ℝ := (K / 2) * Real.cos (θ j - θ i) - lam * W i j diff --git a/LeanPool/Kuramoto/OrderParameter.lean b/LeanPool/Kuramoto/OrderParameter.lean index 84a45b3c17..5c68e1bf47 100644 --- a/LeanPool/Kuramoto/OrderParameter.lean +++ b/LeanPool/Kuramoto/OrderParameter.lean @@ -17,12 +17,12 @@ Each oscillator contributes a unit phasor `exp (i θ_k)`, and the main result is bound `‖R‖ ≤ 1` where `R = (∑_k exp (i θ_k)) / N`. -/ -@[expose] public section +public section open Complex Finset /-- The Kuramoto order parameter `R = (∑_k exp (i θ_k)) / N`. -/ -noncomputable def kuramotoR (N : ℕ) (θ : Fin N → ℝ) : ℂ := +@[expose] noncomputable def kuramotoR (N : ℕ) (θ : Fin N → ℝ) : ℂ := (∑ k, Complex.exp (θ k * Complex.I)) / N theorem kuramotoR_norm_le_one (N : ℕ) (hN : 0 < N) (θ : Fin N → ℝ) : diff --git a/LeanPool/Kuramoto/Weighted.lean b/LeanPool/Kuramoto/Weighted.lean index 06c8db0dac..df7f87e0a5 100644 --- a/LeanPool/Kuramoto/Weighted.lean +++ b/LeanPool/Kuramoto/Weighted.lean @@ -17,19 +17,19 @@ The weighted Kuramoto potential and vector field, where coupling strengths are g matrix `W`. For the gradient identity the coupling matrix is assumed symmetric. -/ -@[expose] public section +public section open Real Finset /-- The weighted Kuramoto potential `V = -(K / 2) ∑_{i,j} W i j * cos (θ_j - θ_i)`. -/ -noncomputable def weightedKuramotoV (K : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) +@[expose] noncomputable def weightedKuramotoV (K : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) (θ : Fin N → ℝ) : ℝ := -(K / 2) * ∑ i : Fin N, ∑ j : Fin N, W i j * Real.cos (θ j - θ i) /-- The weighted Kuramoto force on oscillator `i`, `F_i = K ∑_j W i j * sin (θ_j - θ_i)`. -/ -noncomputable def weightedKuramotoF (K : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) +@[expose] noncomputable def weightedKuramotoF (K : ℝ) (N : ℕ) (W : Fin N → Fin N → ℝ) (i : Fin N) (θ : Fin N → ℝ) : ℝ := K * ∑ j : Fin N, W i j * Real.sin (θ j - θ i) diff --git a/LeanPool/Kuramoto/WitnessGeometry.lean b/LeanPool/Kuramoto/WitnessGeometry.lean index ef0a8217bb..90425dc137 100644 --- a/LeanPool/Kuramoto/WitnessGeometry.lean +++ b/LeanPool/Kuramoto/WitnessGeometry.lean @@ -16,7 +16,7 @@ distances from the minimum, different quadratic curvatures give different restor magnitudes. -/ -@[expose] public section +public section open Real diff --git a/LeanPool/Kurosh/Deck.lean b/LeanPool/Kurosh/Deck.lean index 0fea882f8a..36f0291ad3 100644 --- a/LeanPool/Kurosh/Deck.lean +++ b/LeanPool/Kurosh/Deck.lean @@ -23,7 +23,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory @@ -54,7 +54,7 @@ noncomputable def quotientDeckEndHom (G : Type u) [Group G] (H : Subgroup G) @[simp] lemma quotientDeckEndHom_mk (G : Type u) [Group G] (H : Subgroup G) [H.Normal] [Fintype (G ⧸ H)] (g h : G) : - (quotientDeckEndHom G H (g : G ⧸ H)).hom ⟦h⟧ = ⟦h * g⁻¹⟧ := rfl + (quotientDeckEndHom G H (g : G ⧸ H)).hom ⟦h⟧ = ⟦h * g⁻¹⟧ := by rfl @[simp] lemma quotientDeckEndHom_apply_one (G : Type u) [Group G] (H : Subgroup G) @@ -99,7 +99,7 @@ noncomputable def quotientDeckHom (G : Type u) [Group G] (H : Subgroup G) lemma quotientDeckHom_hom (G : Type u) [Group G] (H : Subgroup G) [H.Normal] [Fintype (G ⧸ H)] (q : G ⧸ H) : - (quotientDeckHom G H q).hom.hom = (quotientDeckEndHom G H q).hom := rfl + (quotientDeckHom G H q).hom.hom = (quotientDeckEndHom G H q).hom := by rfl @[simp] lemma quotientDeckHom_apply_one (G : Type u) [Group G] (H : Subgroup G) diff --git a/LeanPool/Kurosh/IndexFormula.lean b/LeanPool/Kurosh/IndexFormula.lean index 0e0ce63652..f61666d76e 100644 --- a/LeanPool/Kurosh/IndexFormula.lean +++ b/LeanPool/Kurosh/IndexFormula.lean @@ -16,7 +16,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.ActionCategory CategoryTheory.SingleObj Quiver FreeGroup diff --git a/LeanPool/Kurosh/Kurosh.lean b/LeanPool/Kurosh/Kurosh.lean index 5cbe05bfc8..d6934cc193 100644 --- a/LeanPool/Kurosh/Kurosh.lean +++ b/LeanPool/Kurosh/Kurosh.lean @@ -36,7 +36,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory @@ -60,7 +60,7 @@ open Monoid.CoprodI abbrev FreeProduct (G : ι → Type u) [∀ i, Group (G i)] := Monoid.CoprodI G /-- The canonical inclusion of a factor into its free product. -/ -def factorInclusion (G : ι → Type u) [∀ i, Group (G i)] (i : ι) : +@[expose] def factorInclusion (G : ι → Type u) [∀ i, Group (G i)] (i : ι) : G i →* FreeProduct G := Monoid.CoprodI.of @[simp] @@ -80,7 +80,7 @@ appear literally in the Kurosh decomposition. -/ /-- Conjugation of a subgroup by an ambient-group element. -/ -def conjugateSubgroup {P : Type u} [Group P] (K : Subgroup P) (g : P) : Subgroup P := +@[expose] def conjugateSubgroup {P : Type u} [Group P] (K : Subgroup P) (g : P) : Subgroup P := K.map (MulAut.conj g) @[simp] @@ -94,12 +94,12 @@ theorem mem_conjugateSubgroup_iff {P : Type u} [Group P] (K : Subgroup P) (g x : simp [MulAut.conj_apply, mul_assoc] /-- The ambient subgroup obtained from a Kurosh factor. -/ -def intersectionFactor {G : ι → Type u} [∀ i, Group (G i)] +@[expose] def intersectionFactor {G : ι → Type u} [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (i : ι) (g : FreeProduct G) : Subgroup (FreeProduct G) := H ⊓ conjugateSubgroup (MonoidHom.range (factorInclusion G i)) g /-- The same factor regarded as a subgroup of `H`, so its inclusion into `H` is canonical. -/ -def intersectionFactorInH {G : ι → Type u} [∀ i, Group (G i)] +@[expose] def intersectionFactorInH {G : ι → Type u} [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (i : ι) (g : FreeProduct G) : Subgroup H := (intersectionFactor H i g).comap H.subtype @@ -156,6 +156,7 @@ construction. -/ /-- Invert a reduced word by reversing its letters and inverting each letter. -/ +@[expose] def wordInv {G : ι → Type u} [∀ i, Group (G i)] (w : Word G) : Word G := { toList := w.toList.reverse.map (fun x : Σ i, G i => ⟨x.1, x.2⁻¹⟩) @@ -172,7 +173,7 @@ def wordInv {G : ι → Type u} [∀ i, Group (G i)] @[simp] theorem wordInv_toList {G : ι → Type u} [∀ i, Group (G i)] (w : Word G) : (wordInv w).toList = w.toList.reverse.map (fun x : Σ i, G i => ⟨x.1, x.2⁻¹⟩) := - rfl + by rfl theorem wordInv_prod {G : ι → Type u} [∀ i, Group (G i)] (w : Word G) : (wordInv w).prod = w.prod⁻¹ := by @@ -186,7 +187,7 @@ theorem wordInv_wordInv {G : ι → Type u} [∀ i, Group (G i)] (w : Word G) : simp [wordInv, Function.comp_def, List.map_map] /-- The factor index of the last letter, or `none` for the empty word. -/ -def wordLastIdx {G : ι → Type u} [∀ i, Group (G i)] (w : Word G) : Option ι := +@[expose] def wordLastIdx {G : ι → Type u} [∀ i, Group (G i)] (w : Word G) : Option ι := (wordInv w).fstIdx private lemma head_reverse_map {α β : Type*} (f : α → β) (l : List α) : @@ -232,7 +233,7 @@ abbrev RightFactorWord {G : ι → Type u} [∀ i, Group (G i)] (i : ι) := {w : Word G // wordLastIdx w ≠ some i} /-- The right tail bundled with the fact that its last index differs from `i`. -/ -noncomputable def rightTailCanonical {G : ι → Type u} [∀ i, Group (G i)] +@[expose] noncomputable def rightTailCanonical {G : ι → Type u} [∀ i, Group (G i)] (i : ι) (w : Word G) : RightFactorWord (G := G) i := ⟨rightTail i w, rightTail_lastIdx_ne i w⟩ @@ -278,7 +279,7 @@ theorem right_syllable_decomposition {G : ι → Type u} [∀ i, Group (G i)] simp /-- Append a nonidentity factor-`i` letter to a word ending in a different factor. -/ -noncomputable def rightAppend {G : ι → Type u} [∀ i, Group (G i)] +@[expose] noncomputable def rightAppend {G : ι → Type u} [∀ i, Group (G i)] (i : ι) (w : Word G) (a : G i) (ha : a ≠ 1) (hw : wordLastIdx w ≠ some i) : Word G := wordInv (Word.cons a⁻¹ (wordInv w) @@ -365,7 +366,7 @@ theorem rightTail_eq_of_prod_eq_mul_factor {G : ι → Type u} [∀ i, Group (G simpa [rightTail_equiv_mul_factor] using htail /-- Append a nonidentity letter to a canonical representative for its factor coset. -/ -noncomputable def rightAppendCanonical {G : ι → Type u} [∀ i, Group (G i)] +@[expose] noncomputable def rightAppendCanonical {G : ι → Type u} [∀ i, Group (G i)] (i : ι) (w : RightFactorWord (G := G) i) (a : G i) (ha : a ≠ 1) : Word G := rightAppend i w.1 a ha w.2 @@ -468,7 +469,7 @@ theorem bassSerre_rootedConnected {ι : Type v} (G : ι → Type u) | factor i w => exact bassSerreFactor_path G i w /-- A geodesic spanning tree of the symmetrified word model. -/ -noncomputable def bassSerreTree {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def bassSerreTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : WideSubquiver (Quiver.Symmetrify (BassSerreVertex G)) := @Quiver.geodesicSubtree (Quiver.Symmetrify (BassSerreVertex G)) @@ -517,7 +518,7 @@ abbrev RightCoset {P : Type w} [Group P] (K : Subgroup P) := Quotient (rightCosetSetoid K) /-- The coset represented by a group element. -/ -def rightCosetMk {P : Type w} [Group P] (K : Subgroup P) (a : P) : RightCoset K := +@[expose] def rightCosetMk {P : Type w} [Group P] (K : Subgroup P) (a : P) : RightCoset K := Quotient.mk (rightCosetSetoid K) a theorem rightCosetMk_eq_iff {P : Type w} [Group P] (K : Subgroup P) (a b : P) : @@ -576,7 +577,7 @@ abbrev FactorCoset {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (i : RightCoset (MonoidHom.range (factorInclusion G i)) /-- The factor coset represented by an element of the free product. -/ -def factorCosetMk {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] +@[expose] def factorCosetMk {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (i : ι) (g : FreeProduct G) : FactorCoset G i := rightCosetMk (MonoidHom.range (factorInclusion G i)) g @@ -678,7 +679,7 @@ theorem rawBassSerre_rootedConnected {ι : Type v} (G : ι → Type u) | factor i c => exact rawBassSerreFactor_path G i c /-- A geodesic spanning tree of the symmetrified group-and-coset model. -/ -noncomputable def rawBassSerreTree {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def rawBassSerreTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : WideSubquiver (Quiver.Symmetrify (RawBassSerreVertex G)) := @Quiver.geodesicSubtree (Quiver.Symmetrify (RawBassSerreVertex G)) @@ -826,7 +827,7 @@ abbrev ActionOrbit (A : Type w) (X : Type w) [Group A] [MulAction A X] := MulAction.orbitRel.Quotient A X /-- Send a point to its group-action orbit. -/ -def actionOrbitMk (A : Type w) (X : Type w) [Group A] [MulAction A X] +@[expose] def actionOrbitMk (A : Type w) (X : Type w) [Group A] [MulAction A X] (x : X) : ActionOrbit A X := Quotient.mk (MulAction.orbitRel A X) x /-- Orbit equality expressed by an element carrying the first point to the second. @@ -847,16 +848,16 @@ theorem actionOrbitMk_smul (A : Type w) (X : Type w) [Group A] [MulAction A X] exact ⟨a⁻¹, by simp⟩ /-- An unbundled Bass-Serre edge is a group element paired with a factor index. -/ -def rawBassSerreEdgeData {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] := +@[expose] def rawBassSerreEdgeData {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] := FreeProduct G × ι /-- The central vertex at the source of an unbundled edge. -/ -def rawBassSerreEdgeDataSource {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreEdgeDataSource {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (e : rawBassSerreEdgeData G) : RawBassSerreVertex G := RawBassSerreVertex.central e.1 /-- The factor coset at the target of an unbundled edge. -/ -def rawBassSerreEdgeDataTarget {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreEdgeDataTarget {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (e : rawBassSerreEdgeData G) : RawBassSerreVertex G := RawBassSerreVertex.factor e.2 (factorCosetMk G e.2 e.1) @@ -909,6 +910,7 @@ instance rawBassSerreEdgeDataSubgroupMulAction {ι : Type v} (G : ι → Type u) mul_smul a b e := by simp [mul_smul] /-- Forget the endpoints of a bundled Bass-Serre edge. -/ +@[expose] def rawBassSerreEdgeDataOf {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] {a b : RawBassSerreVertex G} (e : a ⟶ b) : rawBassSerreEdgeData G := by @@ -1030,7 +1032,7 @@ theorem kuroshFactorOrbitVertex_eq_iff {ι : Type v} (G : ι → Type u) rfl /-- The source vertex orbit of an edge orbit. -/ -def rawBassSerreOrbitEdgeSource {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreOrbitEdgeSource {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (e : RawBassSerreOrbitEdge G H) : RawBassSerreOrbitVertex G H := Quotient.lift (fun x => actionOrbitMk H (RawBassSerreVertex G) @@ -1044,7 +1046,7 @@ def rawBassSerreOrbitEdgeSource {ι : Type v} (G : ι → Type u) (rawBassSerreEdgeDataSource G y)) e /-- The target vertex orbit of an edge orbit. -/ -def rawBassSerreOrbitEdgeTarget {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreOrbitEdgeTarget {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (e : RawBassSerreOrbitEdge G H) : RawBassSerreOrbitVertex G H := Quotient.lift (fun x => actionOrbitMk H (RawBassSerreVertex G) @@ -1058,7 +1060,7 @@ def rawBassSerreOrbitEdgeTarget {ι : Type v} (G : ι → Type u) (rawBassSerreEdgeDataTarget G y)) e /-- The quotient quiver whose edges are subgroup orbits with prescribed endpoints. -/ -@[reducible] +@[expose, reducible] def rawBassSerreOrbitQuiver {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : Quiver (RawBassSerreOrbitVertex G H) where @@ -1071,13 +1073,13 @@ instance rawBassSerreOrbitQuiver.inst {ι : Type v} (G : ι → Type u) Quiver (RawBassSerreOrbitVertex G H) := rawBassSerreOrbitQuiver G H /-- The subgroup orbit of an unbundled Bass-Serre edge. -/ -def rawBassSerreOrbitEdgeMk {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreOrbitEdgeMk {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (e : rawBassSerreEdgeData G) : RawBassSerreOrbitEdge G H := actionOrbitMk H (rawBassSerreEdgeData G) e /-- Bundle an edge orbit with its source and target vertex orbits. -/ -def rawBassSerreOrbitQuiverEdge {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreOrbitQuiverEdge {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (e : rawBassSerreEdgeData G) : rawBassSerreOrbitEdgeSource G H (rawBassSerreOrbitEdgeMk G H e) ⟶ @@ -1101,6 +1103,7 @@ theorem rawBassSerreOrbitEdgeTarget_mk {ι : Type v} (G : ι → Type u) actionOrbitMk] /-- Project a Bass-Serre edge to the quotient quiver. -/ +@[expose] def rawBassSerreOrbitEdgeMap {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a b : RawBassSerreVertex G} (e : a ⟶ b) : @@ -1153,7 +1156,7 @@ theorem rawBassSerreOrbitQuiver_rootedConnected {ι : Type v} (G : ι → Type u ⟨(rawBassSerreOrbitSymmPrefunctor G H).mapPath p⟩ /-- A geodesic spanning tree of the symmetrified quotient graph. -/ -noncomputable def rawBassSerreOrbitTree {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def rawBassSerreOrbitTree {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : WideSubquiver (Quiver.Symmetrify (RawBassSerreOrbitVertex G H)) := @Quiver.geodesicSubtree (Quiver.Symmetrify (RawBassSerreOrbitVertex G H)) @@ -1182,7 +1185,7 @@ noncomputable instance rawBassSerreOrbitTreeArborescence {ι : Type v} /- The distinguished quotient vertex corresponding to the identity of the subgroup. -/ /-- The subgroup orbit of the central vertex represented by the identity. -/ -def rawBassSerreOrbitRoot {ι : Type v} (G : ι → Type u) +@[expose] def rawBassSerreOrbitRoot {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : RawBassSerreOrbitVertex G H := actionOrbitMk H (RawBassSerreVertex G) (RawBassSerreVertex.central 1) @@ -1204,13 +1207,13 @@ theorem rawOrbitAlign_spec {ι : Type v} (G : ι → Type u) Classical.choose_spec ((actionOrbitMk_eq_iff H (RawBassSerreVertex G) x y).1 h) /-- The prefunctor forgetting membership in a wide subquiver. -/ -def wideSubquiverInclusion {V : Type u} [Quiver.{v} V] +@[expose] def wideSubquiverInclusion {V : Type u} [Quiver.{v} V] (W : WideSubquiver V) : W ⥤q V where obj := id map e := e.1 /-- Include the quotient spanning tree into the symmetrified quotient graph. -/ -def rawTreeInclusion {ι : Type v} (G : ι → Type u) +@[expose] def rawTreeInclusion {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : rawBassSerreOrbitTree G H ⥤q Quiver.Symmetrify (RawBassSerreOrbitVertex G H) where @@ -1235,7 +1238,7 @@ def rawTreeEdgeMap {ι : Type v} (G : ι → Type u) (rawTreeInclusion G H).map e /-- The quotient spanning tree expressed as a quiver on the ambient vertex type. -/ -@[reducible] def rawTreeQuiver {ι : Type v} (G : ι → Type u) +@[expose, reducible] def rawTreeQuiver {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : Quiver (RawBassSerreOrbitVertex G H) := { Hom := fun a b => @@ -1252,7 +1255,7 @@ noncomputable instance rawTreeQuiverArborescence {ι : Type v} exact rawBassSerreOrbitTreeArborescence G H /-- Forget tree-membership proofs along a path in the quotient spanning tree. -/ -def rawTreePathMap {ι : Type v} (G : ι → Type u) +@[expose] def rawTreePathMap {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : ∀ {a b : RawBassSerreOrbitVertex G H}, @Quiver.Path (RawBassSerreOrbitVertex G H) (rawTreeQuiver G H) a b → @@ -1269,7 +1272,7 @@ def rawTreePathMap {ι : Type v} (G : ι → Type u) Quiver.Path.cons (rawTreePathMap G H p) e.1 /-- The root of the quotient spanning tree on the ambient vertex type. -/ -def rawTreeQuiverRoot {ι : Type v} (G : ι → Type u) +@[expose] def rawTreeQuiverRoot {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : RawBassSerreOrbitVertex G H := @Quiver.Arborescence.root (RawBassSerreOrbitVertex G H) @@ -1315,7 +1318,7 @@ theorem rawTreePathMap_cons_raw {ι : Type v} (G : ι → Type u) simp [rawTreePathMap] /-- Choose a representative of a path endpoint by successively lifting quotient edges. -/ -noncomputable def rawTreeLiftPath {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def rawTreeLiftPath {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {b : RawBassSerreOrbitVertex G H} : ∀ _p : @Quiver.Path (Quiver.Symmetrify (RawBassSerreOrbitVertex G H)) _ @@ -1401,7 +1404,7 @@ noncomputable def rawTreeLiftPath {ι : Type v} (G : ι → Type u) exact hsource /-- The orbit representative obtained by lifting the chosen rooted tree path. -/ -noncomputable def rawTreeRepresentative {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def rawTreeRepresentative {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (b : RawBassSerreOrbitVertex G H) : RawBassSerreVertex G := (rawTreeLiftPath G H @@ -1417,7 +1420,7 @@ theorem rawTreeRepresentative_orbit {ι : Type v} (G : ι → Type u) ((rawTreeUniquePath G H b).default))).property /-- Choose an unbundled representative of an edge in the quotient graph. -/ -noncomputable def quotientEdgeRawData {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def quotientEdgeRawData {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a b : RawBassSerreOrbitVertex G H} (e : a ⟶ b) : rawBassSerreEdgeData G := @@ -1718,25 +1721,25 @@ private theorem freeGroupoid_isConnected_of_rootedConnected exact Zigzag.of_inv_hom (freeGroupoidPathHom pa) (freeGroupoidPathHom pb) /-- Recover the original vertex from an object of the free groupoid. -/ -def freeGroupoidBaseObj {V : Type u} [q : Quiver.{v} V] +@[expose] def freeGroupoidBaseObj {V : Type u} [q : Quiver.{v} V] (a : Quiver.FreeGroupoid V) : V := by exact a.as /-- The quiver underlying the category structure of the free groupoid. -/ -@[instance_reducible] def freeGroupoidCategoryQuiver {V : Type u} [q : Quiver.{v} V] : +@[expose, instance_reducible] def freeGroupoidCategoryQuiver {V : Type u} [q : Quiver.{v} V] : Quiver (Quiver.FreeGroupoid V) := by letI : CategoryTheory.Category (Quiver.FreeGroupoid V) := Quiver.FreeGroupoid.instCategory infer_instance /-- Original quiver arrows, lifted to the universe of free groupoid morphisms. -/ -@[instance_reducible] def freeGroupoidGeneratorQuiver {V : Type u} [q : Quiver.{v} V] : +@[expose, instance_reducible] def freeGroupoidGeneratorQuiver {V : Type u} [q : Quiver.{v} V] : Quiver.{max u v} (Quiver.FreeGroupoid V) := { Hom := fun a b => ULift.{u} (@Quiver.Hom V q (freeGroupoidBaseObj a) (freeGroupoidBaseObj b)) } /-- Include a lifted generating arrow into the free groupoid. -/ -def freeGroupoidGeneratorArrow {V : Type u} [q : Quiver.{v} V] +@[expose] def freeGroupoidGeneratorArrow {V : Type u} [q : Quiver.{v} V] {a b : Quiver.FreeGroupoid V} (e : ULift.{u} (@Quiver.Hom V q (freeGroupoidBaseObj a) (freeGroupoidBaseObj b))) : @@ -1819,7 +1822,7 @@ noncomputable def quotientTreePathHom {ι : Type v} (G : ι → Type u) (rawTreePathMap G H (rawTreePath G H a)) /-- Close a quotient edge to a based loop using the chosen tree paths. -/ -noncomputable def quotientEdgeLoop {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def quotientEdgeLoop {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a b : RawBassSerreOrbitVertex G H} (e : a ⟶ b) : KuroshFreePart G H := @@ -1946,7 +1949,7 @@ def rawBassSerreOrbitTreeRootVertex {ι : Type v} (G : ι → Type u) Quiver.root (rawBassSerreOrbitTree G H) /-- Map a tree path to the symmetrified quotient graph without bundled tree vertices. -/ -def rawTreeInclusionMapPathAsRaw {ι : Type v} (G : ι → Type u) +@[expose] def rawTreeInclusionMapPathAsRaw {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a b : WideSubquiver.toType (Quiver.Symmetrify (RawBassSerreOrbitVertex G H)) @@ -2249,7 +2252,7 @@ abbrev KuroshComponentIndex {ι : Type v} (G : ι → Type u) KuroshFactorIndex G H ⊕ PUnit /-- The component group at a Kurosh factor or at the free quotient graph. -/ -def KuroshComponent {ι : Type v} (G : ι → Type u) +@[expose] def KuroshComponent {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : KuroshComponentIndex G H → Type (max (u + 1) (v + 1)) := Sum.elim @@ -2285,7 +2288,7 @@ abbrev TreeKuroshComponentIndex {ι : Type v} (G : ι → Type u) RawBassSerreOrbitVertex G H ⊕ PUnit /-- The family of vertex stabilizers together with the quotient graph's loop group. -/ -def TreeKuroshComponent {ι : Type v} (G : ι → Type u) +@[expose] def TreeKuroshComponent {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : TreeKuroshComponentIndex G H → Type (max (u + 1) (v + 1)) := Sum.elim @@ -2311,7 +2314,7 @@ abbrev TreeKuroshProduct {ι : Type v} (G : ι → Type u) FreeProduct (TreeKuroshComponent G H) /-- Map each stabilizer by inclusion and the free part by evaluation in `H`. -/ -noncomputable def treeKuroshComponentHom {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def treeKuroshComponentHom {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (q : TreeKuroshComponentIndex G H) : TreeKuroshComponent G H q →* H := by diff --git a/LeanPool/Kurosh/KuroshActive.lean b/LeanPool/Kurosh/KuroshActive.lean index c4bb3e97ab..596215d7c4 100644 --- a/LeanPool/Kurosh/KuroshActive.lean +++ b/LeanPool/Kurosh/KuroshActive.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshCover.lean b/LeanPool/Kurosh/KuroshCover.lean index 5d6867e991..bad3193438 100644 --- a/LeanPool/Kurosh/KuroshCover.lean +++ b/LeanPool/Kurosh/KuroshCover.lean @@ -19,7 +19,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory @@ -58,7 +58,7 @@ abbrev CoverEdge {ι : Type v} (G : ι → Type u) Σ a b : RawBassSerreOrbitVertex G H, a ⟶ b /-- The based loop of a quotient edge included in the free factor of the covering group. -/ -noncomputable def coverEdgeLetter {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def coverEdgeLetter {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (e : CoverEdge G H) : CoverSource G H := treeKuroshFreeInclusion G H (quotientEdgeLoop G H e.2.2) @@ -190,7 +190,7 @@ noncomputable def coverVertexMap {ι : Type v} (G : ι → Type u) (treeKuroshProductToH G H p).1 • rawTreeRepresentative G H a := rfl /-- Project an auxiliary covering edge to the Bass-Serre graph. -/ -noncomputable def coverEdgeMap {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def coverEdgeMap {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {x y : CoverVertex G H} (d : @Quiver.Hom (CoverVertex G H) (coverQuiver G H) x y) : @@ -272,7 +272,7 @@ noncomputable def coverEdgeMap {ι : Type v} (G : ι → Type u) (rawBassSerreEdgeAction G h.1 base) /-- Construct an auxiliary covering vertex from a quotient vertex and a group element. -/ -def coverVertexMk {ι : Type v} (G : ι → Type u) +@[expose] def coverVertexMk {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) (a : RawBassSerreOrbitVertex G H) (p : CoverSource G H) : CoverVertex G H := @@ -329,7 +329,7 @@ def coverGraphLabelPrefunctor {ι : Type v} (G : ι → Type u) (coverEdgeLetter G H (coverBaseEdge G H e))⁻¹ /-- Interpret a raw symmetrified quotient path in its free groupoid. -/ -def coverFreeGroupoidPathHom {ι : Type v} (G : ι → Type u) +@[expose] def coverFreeGroupoidPathHom {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a : RawBassSerreOrbitVertex G H} : ∀ {b : RawBassSerreOrbitVertex G H}, @@ -519,7 +519,7 @@ theorem coverPathValue_neg {ι : Type v} (G : ι → Type u) rfl /-- The free-part loop determined by a path based at the quotient root. -/ -noncomputable def coverPathFreeLoop {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def coverPathFreeLoop {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) {a : RawBassSerreOrbitVertex G H} (p : @Quiver.Path (Quiver.Symmetrify (RawBassSerreOrbitVertex G H)) @@ -684,7 +684,7 @@ theorem coverPathLift_value {ι : Type v} (G : ι → Type u) rw [mul_assoc] /-- The projection from the auxiliary covering quiver to the Bass-Serre quiver. -/ -noncomputable def coverPrefunctor {ι : Type v} (G : ι → Type u) +@[expose] noncomputable def coverPrefunctor {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : CoverVertex G H ⥤q RawBassSerreVertex G where obj := coverVertexMap G H diff --git a/LeanPool/Kurosh/KuroshCoverAction.lean b/LeanPool/Kurosh/KuroshCoverAction.lean index e21224bdf1..d824adbb0c 100644 --- a/LeanPool/Kurosh/KuroshCoverAction.lean +++ b/LeanPool/Kurosh/KuroshCoverAction.lean @@ -16,7 +16,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshCoverConnected.lean b/LeanPool/Kurosh/KuroshCoverConnected.lean index 8b179084d6..e6dbe05e90 100644 --- a/LeanPool/Kurosh/KuroshCoverConnected.lean +++ b/LeanPool/Kurosh/KuroshCoverConnected.lean @@ -16,7 +16,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshCoverLift.lean b/LeanPool/Kurosh/KuroshCoverLift.lean index 65f1a6142c..0c026f3c69 100644 --- a/LeanPool/Kurosh/KuroshCoverLift.lean +++ b/LeanPool/Kurosh/KuroshCoverLift.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory @@ -153,7 +153,7 @@ structure CoverPathLiftData {ι : Type v} /-- Lift a Bass-Serre path starting at the identity vertex to a path starting at the auxiliary covering root. -/ -noncomputable def coverPathLiftData {ι : Type v} +@[expose] noncomputable def coverPathLiftData {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] (H : Subgroup (FreeProduct G)) : ∀ {v : Quiver.Symmetrify (RawBassSerreVertex G)}, @Quiver.Path (Quiver.Symmetrify (RawBassSerreVertex G)) diff --git a/LeanPool/Kurosh/KuroshCoverLocal.lean b/LeanPool/Kurosh/KuroshCoverLocal.lean index 3e5af5225e..41398d005f 100644 --- a/LeanPool/Kurosh/KuroshCoverLocal.lean +++ b/LeanPool/Kurosh/KuroshCoverLocal.lean @@ -16,7 +16,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshCoverStar.lean b/LeanPool/Kurosh/KuroshCoverStar.lean index e1dec66961..d1668cfb9c 100644 --- a/LeanPool/Kurosh/KuroshCoverStar.lean +++ b/LeanPool/Kurosh/KuroshCoverStar.lean @@ -16,7 +16,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshFreeCorollary.lean b/LeanPool/Kurosh/KuroshFreeCorollary.lean index d9d40af3da..0e89b1ce4c 100644 --- a/LeanPool/Kurosh/KuroshFreeCorollary.lean +++ b/LeanPool/Kurosh/KuroshFreeCorollary.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshFreeFiber.lean b/LeanPool/Kurosh/KuroshFreeFiber.lean index 58b92704d7..45d83cb7a6 100644 --- a/LeanPool/Kurosh/KuroshFreeFiber.lean +++ b/LeanPool/Kurosh/KuroshFreeFiber.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshFreePart.lean b/LeanPool/Kurosh/KuroshFreePart.lean index 5f5c71f779..c0acbb3dc6 100644 --- a/LeanPool/Kurosh/KuroshFreePart.lean +++ b/LeanPool/Kurosh/KuroshFreePart.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshKernel.lean b/LeanPool/Kurosh/KuroshKernel.lean index 68b38588e8..4e4ac08b1b 100644 --- a/LeanPool/Kurosh/KuroshKernel.lean +++ b/LeanPool/Kurosh/KuroshKernel.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshPathEndpoint.lean b/LeanPool/Kurosh/KuroshPathEndpoint.lean index ae4c766b89..0d116494f8 100644 --- a/LeanPool/Kurosh/KuroshPathEndpoint.lean +++ b/LeanPool/Kurosh/KuroshPathEndpoint.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshPathInjective.lean b/LeanPool/Kurosh/KuroshPathInjective.lean index 58192888ff..b372c1e6ae 100644 --- a/LeanPool/Kurosh/KuroshPathInjective.lean +++ b/LeanPool/Kurosh/KuroshPathInjective.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshPathRelation.lean b/LeanPool/Kurosh/KuroshPathRelation.lean index 91b95c5fa2..59a6a11b29 100644 --- a/LeanPool/Kurosh/KuroshPathRelation.lean +++ b/LeanPool/Kurosh/KuroshPathRelation.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshPathRelationInvariant.lean b/LeanPool/Kurosh/KuroshPathRelationInvariant.lean index 86490396ee..c3c1d312da 100644 --- a/LeanPool/Kurosh/KuroshPathRelationInvariant.lean +++ b/LeanPool/Kurosh/KuroshPathRelationInvariant.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshRawPathValue.lean b/LeanPool/Kurosh/KuroshRawPathValue.lean index 260918fa3e..36dc97a521 100644 --- a/LeanPool/Kurosh/KuroshRawPathValue.lean +++ b/LeanPool/Kurosh/KuroshRawPathValue.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshSolution.lean b/LeanPool/Kurosh/KuroshSolution.lean index a96c3673fd..316e3db639 100644 --- a/LeanPool/Kurosh/KuroshSolution.lean +++ b/LeanPool/Kurosh/KuroshSolution.lean @@ -23,7 +23,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Kurosh/KuroshTheorem.lean b/LeanPool/Kurosh/KuroshTheorem.lean index 4383482a11..cbc06b3933 100644 --- a/LeanPool/Kurosh/KuroshTheorem.lean +++ b/LeanPool/Kurosh/KuroshTheorem.lean @@ -21,7 +21,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory diff --git a/LeanPool/Kurosh/KuroshTree.lean b/LeanPool/Kurosh/KuroshTree.lean index 4cb02371e5..97fe903922 100644 --- a/LeanPool/Kurosh/KuroshTree.lean +++ b/LeanPool/Kurosh/KuroshTree.lean @@ -15,7 +15,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory @@ -342,6 +342,7 @@ theorem Internal.bassHeight_zero_iff {ι : Type v} (G : ι → Type u) exact Internal.bassHeight_root G /-- Include the directed word model into its symmetrification. -/ +@[expose] def Internal.bassToSymm {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : BassSerreVertex G ⥤q Quiver.Symmetrify (BassSerreVertex G) where @@ -538,6 +539,7 @@ noncomputable def Internal.rawCanonicalFactor {ι : Type v} (G : ι → Type u) rightTailCanonical i (Word.equiv (Quotient.out c)) /-- Convert a group-and-coset vertex into its canonical word-model vertex. -/ +@[expose] noncomputable def Internal.rawCanonicalVertex {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : RawBassSerreVertex G → BassSerreVertex G | RawBassSerreVertex.central g => BassSerreVertex.central (Word.equiv g) @@ -545,6 +547,7 @@ noncomputable def Internal.rawCanonicalVertex {ι : Type v} (G : ι → Type u) BassSerreVertex.factor i (Internal.rawCanonicalFactor G i c) /-- Evaluate a word-model vertex in the group-and-coset model. -/ +@[expose] def Internal.bassToRawVertex {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : BassSerreVertex G → RawBassSerreVertex G | BassSerreVertex.central w => RawBassSerreVertex.central w.prod @@ -617,7 +620,7 @@ theorem Internal.rawCanonicalVertex_bassToRawVertex {ι : Type v} exact ht.trans hw /-- The chosen word-model spanning tree on the ambient vertex type. -/ -@[reducible] def Internal.bassTreeQuiver {ι : Type v} (G : ι → Type u) +@[reducible, expose] def Internal.bassTreeQuiver {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : Quiver (BassSerreVertex G) := { Hom := fun a b => { e : @Quiver.Hom (Quiver.Symmetrify (BassSerreVertex G)) @@ -995,6 +998,7 @@ theorem Internal.rawCanonicalVertex_factorCosetMk {ι : Type v} (G : ι → Type exact congrArg (BassSerreVertex.factor i) ht /-- Evaluate word-model edges as morphisms in the raw model's free groupoid. -/ +@[expose] noncomputable def Internal.bassToRawPrefunctor {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : BassSerreVertex G ⥤q Quiver.FreeGroupoid (RawBassSerreVertex G) where @@ -1022,6 +1026,7 @@ noncomputable def Internal.bassToRawPrefunctor {ι : Type v} (G : ι → Type u) (RawBassSerreEdge.centralFactor q.prod i)) rfl hv') /-- Express group-and-coset edges as paths in the word model's free groupoid. -/ +@[expose] noncomputable def Internal.rawToBassPrefunctor {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : RawBassSerreVertex G ⥤q Quiver.FreeGroupoid (BassSerreVertex G) where @@ -1076,6 +1081,7 @@ noncomputable def Internal.rawToBassPrefunctor {ι : Type v} (G : ι → Type u) (BassSerreEdge.centralFactor w i hlast)) rfl ht' /-- Extend word evaluation to a functor between the two free groupoids. -/ +@[expose] noncomputable def Internal.bassToRawFunctor {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : Quiver.FreeGroupoid (BassSerreVertex G) ⥤ @@ -1083,6 +1089,7 @@ noncomputable def Internal.bassToRawFunctor {ι : Type v} (G : ι → Type u) Quiver.FreeGroupoid.lift (Internal.bassToRawPrefunctor G) /-- Extend canonical word representatives to a functor between the two free groupoids. -/ +@[expose] noncomputable def Internal.rawToBassFunctor {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : Quiver.FreeGroupoid (RawBassSerreVertex G) ⥤ @@ -1661,7 +1668,7 @@ def Internal.treeDataGenerated {ι : Type v} (G : ι → Type u) Subgroup.closure (Internal.treeDataGeneratorSet G H) /-- The raw model's chosen spanning tree on the ambient vertex type. -/ -@[reducible] def Internal.rawSpanningTreeQuiver {ι : Type v} (G : ι → Type u) +@[reducible, expose] def Internal.rawSpanningTreeQuiver {ι : Type v} (G : ι → Type u) [∀ i, Group (G i)] : Quiver (RawBassSerreVertex G) := { Hom := fun a b => { e : @Quiver.Hom (Quiver.Symmetrify (RawBassSerreVertex G)) diff --git a/LeanPool/Kurosh/SchreierCover.lean b/LeanPool/Kurosh/SchreierCover.lean index ea10a31a0a..800f884ab0 100644 --- a/LeanPool/Kurosh/SchreierCover.lean +++ b/LeanPool/Kurosh/SchreierCover.lean @@ -19,7 +19,7 @@ commit `911707126c8b9bb0c764bf853008fe1053c0aad9`: imports, API compatibility, and proof organization were revised. -/ -@[expose] public section +public section open Set Function open CategoryTheory CategoryTheory.ActionCategory CategoryTheory.SingleObj Quiver FreeGroup @@ -120,7 +120,7 @@ Nielsen--Schreier instance uses an abstract chosen basis; this version keeps the original generator type visible for the cardinality computation. -/ /-- Present the free-group action groupoid by its Schreier quiver of generator edges. -/ -@[reducible] def freeActionGroupoidIsFree (α : Type u) (A : Type u) +@[expose, reducible] def freeActionGroupoidIsFree (α : Type u) (A : Type u) [MulAction (FreeGroup α) A] : IsFreeGroupoid (ActionCategory (FreeGroup α) A) where quiverGenerators := diff --git a/LeanPool/LanguageGeneration/Core/Basic.lean b/LeanPool/LanguageGeneration/Core/Basic.lean index 19c89db3ec..94f0603716 100644 --- a/LeanPool/LanguageGeneration/Core/Basic.lean +++ b/LeanPool/LanguageGeneration/Core/Basic.lean @@ -17,7 +17,7 @@ Kleinberg--Mullainathan algorithm depends on the enumeration order and permits repeated languages. -/ -@[expose] public section +public section namespace GenLimit diff --git a/LeanPool/LanguageGeneration/Core/ClassGeneration.lean b/LeanPool/LanguageGeneration/Core/ClassGeneration.lean index 7a39fb4d85..08b2994e78 100644 --- a/LeanPool/LanguageGeneration/Core/ClassGeneration.lean +++ b/LeanPool/LanguageGeneration/Core/ClassGeneration.lean @@ -14,21 +14,22 @@ Paper-independent quantifier patterns for generation from positive data over an arbitrary example type. -/ -@[expose] public section +public section namespace GenLimit.Generic /-- Every language in the class is infinite. -/ +@[expose] def UUS (H : LanguageClass α) : Prop := ∀ L, L ∈ H → L.Infinite /-- `gen` eventually generates fresh elements of every presented target. -/ -def IsLimitGenerator (gen : Generator α) (H : LanguageClass α) : Prop := +@[expose] def IsLimitGenerator (gen : Generator α) (H : LanguageClass α) : Prop := ∀ L, L ∈ H → ∀ stream : Stream α, Presents stream L → ∃ T, ∀ s, T ≤ s → CorrectAt gen L stream s /-- Generation in the limit from positive presentations. -/ -def GeneratableInLimit (H : LanguageClass α) : Prop := +@[expose] def GeneratableInLimit (H : LanguageClass α) : Prop := ∃ gen : Generator α, IsLimitGenerator gen H /-- `d` is a uniform distinct-sample threshold for `gen` on `H`. -/ diff --git a/LeanPool/LanguageGeneration/Core/GenericGeneration.lean b/LeanPool/LanguageGeneration/Core/GenericGeneration.lean index a05fe4ed06..a0c78fbc67 100644 --- a/LeanPool/LanguageGeneration/Core/GenericGeneration.lean +++ b/LeanPool/LanguageGeneration/Core/GenericGeneration.lean @@ -22,7 +22,7 @@ A finite history of length `t` is represented by `Fin t → α`. Thus a `output G stream t` exposes only the prefix strictly before time `t`. -/ -@[expose] public section +public section namespace GenLimit.Generic @@ -44,6 +44,7 @@ abbrev Generator (α : Type*) := ∀ t : ℕ, (Fin t → α) → α /-- Exact presentation: repetitions are allowed, and every target element must eventually occur. -/ +@[expose] def Presents (stream : Stream α) (L : Language α) : Prop := Set.range stream = L @@ -57,6 +58,7 @@ noncomputable def sequenceSample {t : ℕ} (xs : Fin t → α) : Finset α := by exact Finset.univ.image xs /-- The distinct observations strictly before time `t`. -/ +@[expose] noncomputable def sample (stream : Stream α) (t : ℕ) : Finset α := by classical exact (Finset.range t).image stream @@ -81,7 +83,7 @@ theorem streamIn_historyThenFallback exact hfallback /-- Run `G` on the prefix of `stream` strictly before time `t`. -/ -def output (G : Generator α) (stream : Stream α) (t : ℕ) : α := +@[expose] def output (G : Generator α) (stream : Stream α) (t : ℕ) : α := G t (fun i => stream i) theorem mem_sequenceSample_iff {t : ℕ} {xs : Fin t → α} {x : α} : @@ -347,7 +349,7 @@ theorem exists_sample_card_eq_of_presents_infinite exact ⟨r, hr⟩ /-- The generated value is a fresh member of `L` at time `t`. -/ -def CorrectAt +@[expose] def CorrectAt (G : Generator α) (L : Language α) (stream : Stream α) (t : ℕ) : Prop := output G stream t ∈ L ∧ output G stream t ∉ sample stream t diff --git a/LeanPool/LanguageGeneration/Core/Text.lean b/LeanPool/LanguageGeneration/Core/Text.lean index 698b06c259..d662846e24 100644 --- a/LeanPool/LanguageGeneration/Core/Text.lean +++ b/LeanPool/LanguageGeneration/Core/Text.lean @@ -17,12 +17,12 @@ forgets order and repetitions; `textPrefix` retains both. The bridge theorem values. -/ -@[expose] public section +public section namespace GenLimit /-- The ordered observations strictly before time `t`. -/ -def textPrefix {α : Type*} (stream : ℕ → α) (t : ℕ) : List α := +@[expose] def textPrefix {α : Type*} (stream : ℕ → α) (t : ℕ) : List α := (List.range t).map stream @[simp] theorem textPrefix_length {α : Type*} (stream : ℕ → α) (t : ℕ) : diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Basic.lean b/LeanPool/LanguageGeneration/FiniteWitness/Basic.lean index d12b177128..9b16ae2398 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Basic.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Basic.lean @@ -14,7 +14,7 @@ This extension uses the upstream sequence-input model without redefining it. `SetDriven` below refers to dependence on the input set, not set-valued output. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness @@ -31,6 +31,7 @@ noncomputable def ofSet (g : Finset α → α) : Generator α := simp [output, ofSet, sequenceSample_prefix] /-- A finite set after which every consistent finite extension is good. -/ +@[expose] def Locks (g : Finset α → α) (L : Language α) : Prop := ∃ T : Finset α, (↑T : Set α) ⊆ L ∧ ∀ S : Finset α, T ⊆ S → (↑S : Set α) ⊆ L → g S ∈ L ∧ g S ∉ S @@ -40,16 +41,18 @@ def SetDrivenGeneratable (H : LanguageClass α) : Prop := ∃ g : Finset α → α, IsLimitGenerator (ofSet g) H /-- Consistent targets whose assigned positive witnesses have been observed. -/ +@[expose] def active (H : LanguageClass α) (T : Language α → Finset α) (S : Finset α) : Set (Language α) := {L | L ∈ H ∧ T L ⊆ S ∧ (↑S : Set α) ⊆ L} /-- The simultaneous common intersection of all active targets. -/ -def activeCore (H : LanguageClass α) (T : Language α → Finset α) +@[expose] def activeCore (H : LanguageClass α) (T : Language α → Finset α) (S : Finset α) : Set α := {x | ∀ L, L ∈ active H T S → x ∈ L} /-- The paper's condition, with an assignment extended arbitrarily off `H`. -/ +@[expose] def HasFiniteWitnesses (H : LanguageClass α) : Prop := ∃ T : Language α → Finset α, (∀ L, L ∈ H → (↑(T L) : Set α) ⊆ L) ∧ diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean b/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean index 4df4a7949f..777587ff9d 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean @@ -10,7 +10,7 @@ public import Mathlib.Basic.Denumerable /-! # The complete ordinary-generation finite-witness characterization -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Confirmation.lean b/LeanPool/LanguageGeneration/FiniteWitness/Confirmation.lean index 86f40fce6f..d9279be88c 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Confirmation.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Confirmation.lean @@ -9,7 +9,7 @@ public import LeanPool.LanguageGeneration.FiniteWitness.SampleSearch /-! # Finite positive confirmation of the canonical error priorities -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness @@ -85,7 +85,7 @@ theorem sampleRun_matches_true {F : List α → α} {L : Set α} classical intro k induction k with - | zero => intro _; rfl + | zero => intro _; simp only [sampleRun, trueRun_zero] | succ k ih => intro hkm have hk : k < m := by omega @@ -122,8 +122,7 @@ theorem sampleRun_matches_true {F : List α → α} {L : Set α} exact hselected.2.2.2.2.1 have hminimal : Encodable.encode (trueRun F L (k + 1)) ≤ Encodable.encode (sampleRun F S n (k + 1)) := by - rw [trueRun, dite_eq_left (hbefore k hk)] - exact leastCode_le _ (hbefore k hk) htrue + exact trueRun_code_le htrue omega exact Encodable.encode_injective (Nat.le_antisymm hupper (Nat.le_of_not_lt hnotlower)) diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Histories.lean b/LeanPool/LanguageGeneration/FiniteWitness/Histories.lean index ab0e2af8b0..1a7d3d6db8 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Histories.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Histories.lean @@ -12,7 +12,7 @@ public import Mathlib.Data.List.Infix /-! # Exhaustive limits of nested finite histories -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness @@ -40,11 +40,13 @@ def listOutput (G : Generator α) (xs : List α) : α := G xs.length xs.get simp /-- Eventual target validity of a list-input function; freshness is separate. -/ +@[expose] def EventuallyValid (F : List α → α) (L : Generic.Language α) : Prop := ∀ stream : Stream α, Generic.Presents stream L → ∃ t₀, ∀ t, t₀ ≤ t → F (GenLimit.textPrefix stream t) ∈ L /-- A list-input function always returns an element absent from its input. -/ +@[expose] def Fresh (F : List α → α) : Prop := ∀ xs, F xs ∉ xs /-- Replace a previously observed output by a fresh element of the infinite universe. -/ diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Normalization.lean b/LeanPool/LanguageGeneration/FiniteWitness/Normalization.lean index e1599f24fe..a6a950142e 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Normalization.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Normalization.lean @@ -20,7 +20,7 @@ both exhaust each target and agree between a sufficiently confirmed sample and that target. The sample search retains the `2 * S.card` length cutoff. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness @@ -93,6 +93,7 @@ theorem content_mono {p q : List α} (hpq : p <+: q) : p.toFinset ⊆ q.toFinset simp /-- The target-dependent genuine errors used only in the proof. -/ +@[expose] def BadExtension (F : List α → α) (L : Set α) (p : List α) (k : ℕ) (q : List α) : Prop := p <+: q ∧ p.length < q.length ∧ (↑q.toFinset : Set α) ⊆ L ∧ @@ -106,6 +107,10 @@ noncomputable def trueRun (F : List α → α) (L : Set α) : ℕ → List α exact if h : ∃ q, BadExtension F L (trueRun F L k) k q then leastCode _ h else trueRun F L k +/-- The canonical bad-extension sequence starts with the empty history. -/ +theorem trueRun_zero (F : List α → α) (L : Set α) : trueRun F L 0 = [] := by + rfl + theorem trueRun_next {F : List α → α} {L : Set α} {k : ℕ} (h : ∃ q, BadExtension F L (trueRun F L k) k q) : BadExtension F L (trueRun F L k) k (trueRun F L (k + 1)) := by @@ -113,6 +118,13 @@ theorem trueRun_next {F : List α → α} {L : Set α} {k : ℕ} simp only [trueRun, dite_eq_left h] exact leastCode_spec _ h +theorem trueRun_code_le {F : List α → α} {L : Set α} {k : ℕ} {q : List α} + (hq : BadExtension F L (trueRun F L k) k q) : + Encodable.encode (trueRun F L (k + 1)) ≤ Encodable.encode q := by + classical + rw [trueRun, dite_eq_left ⟨q, hq⟩] + exact leastCode_le _ ⟨q, hq⟩ hq + theorem trueRun_prefix (F : List α → α) (L : Set α) (k : ℕ) : trueRun F L k <+: trueRun F L (k + 1) := by classical diff --git a/LeanPool/LanguageGeneration/FiniteWitness/SampleSearch.lean b/LeanPool/LanguageGeneration/FiniteWitness/SampleSearch.lean index da871188a1..cd3c261ef4 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/SampleSearch.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/SampleSearch.lean @@ -9,20 +9,20 @@ public import LeanPool.LanguageGeneration.FiniteWitness.Normalization /-! # Target-free bounded search on the observed finite set -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness variable {α : Type*} [Encodable α] [DecidableEq α] /-- A tentative bad extension: its output is unconfirmed by the entire sample. -/ -def Candidate (F : List α → α) (S : Finset α) (n : ℕ) +@[expose] def Candidate (F : List α → α) (S : Finset α) (n : ℕ) (p : List α) (k : ℕ) (q : List α) : Prop := p <+: q ∧ p.length < q.length ∧ q.toFinset ⊆ S ∧ q.length ≤ 2 * n ∧ checkpoint (↑S : Set α) (k + 1) ⊆ q.toFinset ∧ F q ∉ S /-- Bounded iteration; an empty candidate set leaves the current word fixed. -/ -noncomputable def sampleRun (F : List α → α) (S : Finset α) (n : ℕ) : ℕ → List α +@[expose] noncomputable def sampleRun (F : List α → α) (S : Finset α) (n : ℕ) : ℕ → List α | 0 => [] | k + 1 => by classical @@ -76,7 +76,7 @@ theorem sampleRun_preserves_fresh {F : List α → α} {S : Finset α} {n k j : · simpa only [sampleRun, dite_eq_right h] using ih /-- The normalized output function is fixed before a target is selected. -/ -noncomputable def normalized (F : List α → α) (S : Finset α) : α := +@[expose] noncomputable def normalized (F : List α → α) (S : Finset α) : α := F (sampleRun F S S.card S.card) end GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Separation.lean b/LeanPool/LanguageGeneration/FiniteWitness/Separation.lean index da6353787b..4a5545a1f0 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Separation.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Separation.lean @@ -16,13 +16,14 @@ intersection. The subfamilies here are arbitrary sets of languages. This file extends, and does not alter, the previously checked characterization. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness variable {α : Type*} /-- Every finite-core subfamily contains a witness point missing from a member. -/ +@[expose] def Separates (H : Generic.LanguageClass α) (T : Generic.Language α → Finset α) : Prop := ∀ F : Set (Set α), F ⊆ H → F.Nonempty → (⋂₀ F).Finite → diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Capture.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Capture.lean index f6a449719f..547c323d8c 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Capture.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Capture.lean @@ -10,7 +10,7 @@ public import Mathlib.Order.Interval.Finset.Nat public import Mathlib.Tactic.Choose /-! Direct diagonal bounded capture, without a sunflower extraction. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Simplified variable {α : Type*} diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean index ec12966cf7..4b2fb1883e 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean @@ -12,7 +12,7 @@ public import Mathlib.Basic.Denumerable # Checkpoint interface and its construction from an enumeration -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Simplified diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Executable.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Executable.lean index 09d719c0ca..51217a487f 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Executable.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Executable.lean @@ -12,7 +12,7 @@ public import LeanPool.LanguageGeneration.FiniteWitness.Width.Executable # Finite-search implementation of the revised normalization -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Simplified @@ -43,13 +43,15 @@ theorem mem_codeWords {q : List ℕ} {b : ℕ} (h : Encodable.encode q ≤ b) : /-- Test a strict history extension that covers the next checkpoint and outputs outside the sample. -/ +@[expose] def testCandidate (F : List ℕ → ℕ) (S : Finset ℕ) (p : List ℕ) (k : ℕ) (q : List ℕ) : Prop := p <+: q ∧ p.length < q.length ∧ q.toFinset ⊆ S ∧ samplePoints S (k + 1) ⊆ q.toFinset ∧ F q ∉ S instance (F : List ℕ → ℕ) (S : Finset ℕ) (p : List ℕ) (k : ℕ) (q : List ℕ) : - Decidable (testCandidate F S p k q) := inferInstanceAs (Decidable (_ ∧ _ ∧ _ ∧ _ ∧ _)) + Decidable (testCandidate F S p k q) := + inferInstanceAs (Decidable (_ ∧ _ ∧ _ ∧ _ ∧ _)) theorem testCandidate_iff (F : List ℕ → ℕ) (S : Finset ℕ) (p : List ℕ) (k : ℕ) (q : List ℕ) : diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/FirstPoints.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/FirstPoints.lean index b595fdd819..f7c4a73a4c 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/FirstPoints.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/FirstPoints.lean @@ -10,7 +10,7 @@ public import Mathlib.Data.Nat.Nth /-! First-k checkpoints, exactly as in the simplified manuscript. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Simplified diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Normalization.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Normalization.lean index b5bab3218b..2a72d5568f 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Normalization.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Normalization.lean @@ -12,7 +12,7 @@ public import LeanPool.LanguageGeneration.FiniteWitness.Characterization # Locking and characterization through fixed-size checkpoints -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Simplified variable {α : Type*} [Encodable α] [DecidableEq α] diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Search.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Search.lean index f06cd96d36..23361b8dd5 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Search.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Search.lean @@ -12,18 +12,20 @@ public import Mathlib.Tactic.Push # Canonical candidate searches and target error sequences -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Simplified variable {α : Type*} [Encodable α] [DecidableEq α] /-- No word-length cutoff; freshness concerns the entire observed sample. -/ +@[expose] def Candidate (M : Checkpoints α) (F : List α → α) (S : Finset α) (p : List α) (k : ℕ) (q : List α) : Prop := p <+: q ∧ p.length < q.length ∧ q.toFinset ⊆ S ∧ M.points (↑S : Set α) (k + 1) ⊆ q.toFinset ∧ F q ∉ S /-- Iterate least-code candidate extensions relative to a finite observed sample. -/ +@[expose] noncomputable def sampleRun (M : Checkpoints α) (F : List α → α) (S : Finset α) : ℕ → List α | 0 => [] @@ -79,17 +81,20 @@ theorem candidate_exists (M : Checkpoints α) {F : List α → α} (hF : Fresh F ⟨_, append_candidate M hF hS (sampleRun_content M F S k) k⟩ /-- Evaluate the canonical history after a number of steps equal to the sample size. -/ +@[expose] noncomputable def normalized (M : Checkpoints α) (F : List α → α) (S : Finset α) : α := F (sampleRun M F S S.card) /-- A strict target-valid extension covering the next checkpoint whose output misses the target. -/ +@[expose] def BadExtension (M : Checkpoints α) (F : List α → α) (L : Set α) (p : List α) (k : ℕ) (q : List α) : Prop := p <+: q ∧ p.length < q.length ∧ (↑q.toFinset : Set α) ⊆ L ∧ M.points L (k + 1) ⊆ q.toFinset ∧ F q ∉ L /-- The canonical sequence of least-code target errors using the checkpoint interface. -/ +@[expose] noncomputable def trueRun (M : Checkpoints α) (F : List α → α) (L : Set α) : ℕ → List α | 0 => [] | k + 1 => by diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Anchored.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Anchored.lean index b083753bb9..76846b1a8a 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Anchored.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Anchored.lean @@ -13,7 +13,7 @@ public import Mathlib.Data.Finset.Preimage # Anchored families and their positive witness geometry -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Anchored @@ -21,14 +21,17 @@ namespace GenLimit.FiniteWitness.Anchored abbrev Point := ℕ ⊕ ℕ /-- A full left copy, all right anchors except one, and an arbitrary right tail. -/ +@[expose] def leftTarget {k : ℕ} (i : Fin k) (D : Set ℕ) : Set Point := Sum.elim (fun _ => True) (fun n => if n < k then n ≠ i.val else n - k ∈ D) /-- A full right copy, all left anchors except one, and an arbitrary left tail. -/ +@[expose] def rightTarget {k : ℕ} (j : Fin k) (E : Set ℕ) : Set Point := Sum.elim (fun n => if n < k then n ≠ j.val else n - k ∈ E) (fun _ => True) /-- The union of the left and right anchored target families with k anchors. -/ +@[expose] def family (k : ℕ) : Set (Set Point) := Set.range (fun p : Fin k × Set ℕ => leftTarget p.1 p.2) ∪ Set.range (fun p : Fin k × Set ℕ => rightTarget p.1 p.2) @@ -147,6 +150,7 @@ theorem card_rightAnchors_le (k : ℕ) (S : Finset Point) : (rightAnchors k S).c exact (Finset.card_preimage _ _ _).trans_le (Finset.card_filter_le _ _) /-- The common tail of all active left targets with a fixed missing anchor. -/ +@[expose] def leftCore {k} (T : Set Point → Finset Point) (i : Fin k) (S : Finset Point) : Set ℕ := {n | ∀ D, leftTarget i D ∈ active (family k) T S → n ∈ D} diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredLower.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredLower.lean index 11a836c6cf..2b50c55a84 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredLower.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredLower.lean @@ -18,7 +18,7 @@ public import Mathlib.Tactic.Push # Counting lower bounds for anchored witness assignments -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Anchored diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredUpper.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredUpper.lean index 0fd21f4569..847986d8da 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredUpper.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/AnchoredUpper.lean @@ -11,7 +11,7 @@ public import LeanPool.LanguageGeneration.FiniteWitness.Width.AnchoredLower # Witness assignments attaining the anchored lower bounds -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Anchored diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Barriers.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Barriers.lean index dc1280382e..a392473278 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Barriers.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Barriers.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic.Tauto # Obstructions to countable tests and finite observation profiles -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness @@ -52,7 +52,7 @@ def finiteTraces (H : Set (Set α)) (F : Finset α) : Set (Set α) := {E | ∃ L ∈ H, L ∩ (↑F : Set α) = E} /-- The intersection of all target languages consistent with a finite positive sample. -/ -def positiveClosure (H : Set (Set α)) (S : Finset α) : Set α := +@[expose] def positiveClosure (H : Set (Set α)) (S : Finset α) : Set α := {x | ∀ L ∈ H, (↑S : Set α) ⊆ L → x ∈ L} theorem full_finiteTraces_of_cofinite_subset {H : Set (Set α)} (hH : cofinite α ⊆ H) diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Capture.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Capture.lean index ce2052dafc..0bd91cc98f 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Capture.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Capture.lean @@ -15,7 +15,7 @@ These compatibility theorems keep the width API without maintaining a second finite-state construction and a separate induction on the cardinality bound. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Cost.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Cost.lean index d80ba82523..e025c4110e 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Cost.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Cost.lean @@ -12,7 +12,7 @@ public import Mathlib.Order.Lattice.Nat # Set-valued separators and their cardinality cost -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Divergence.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Divergence.lean index 2537943eeb..2ba15b5269 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Divergence.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Divergence.lean @@ -13,7 +13,7 @@ public import Mathlib.Order.Filter.AtTopBot.Basic # Witness-size divergence in the two-core family -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.TwoCore diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/EUC.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/EUC.lean index 8360334886..c250251b1d 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/EUC.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/EUC.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic.Choose # Eventually unbounded positive closure and bounded witnesses -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean index c2cff3130a..4dec994dbc 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean @@ -13,16 +13,17 @@ public import Mathlib.Basic.Denumerable # Endpoint examples and realization of the entire width range -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness variable {α : Type*} /-- The family of all infinite subsets of a universe. -/ +@[expose] def allInfinite (α : Type*) : Set (Set α) := {L | L.Infinite} /-- The family of subsets with finite complement. -/ -def cofinite (α : Type*) : Set (Set α) := {L | Lᶜ.Finite} +@[expose] def cofinite (α : Type*) : Set (Set α) := {L | Lᶜ.Finite} theorem allInfinite_uus : Generic.UUS (allInfinite α) := fun _ h => h diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Executable.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Executable.lean index ff50eec61b..9948b6d737 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Executable.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Executable.lean @@ -12,13 +12,14 @@ public import Mathlib.Data.Finset.Max # Finite-search implementation of the bounded normalization -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness variable {α : Type*} [DecidableEq α] [Encodable α] /-- The decidable candidate test with bounded history length and observed checkpoints. -/ +@[expose] def finiteCandidate (F : List α → α) (S : Finset α) (n : ℕ) (p : List α) (k : ℕ) (q : List α) : Prop := p <+: q ∧ p.length < q.length ∧ q.toFinset ⊆ S ∧ q.length ≤ 2 * n ∧ diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/FiniteQueries.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/FiniteQueries.lean index ac29a7f090..797a3638dc 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/FiniteQueries.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/FiniteQueries.lean @@ -12,7 +12,7 @@ public import Mathlib.Data.Finset.Prod # Finite history domains and query bounds for normalization -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Foundation.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Foundation.lean index 2ab1d7e48a..a7ca7bc60a 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Foundation.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Foundation.lean @@ -12,21 +12,23 @@ public import Mathlib.Tactic.Push /-! Fixed-assignment interfaces and arbitrary positive separating sets. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness variable {α : Type*} /-- Every assigned witness consists of positive examples from its target language. -/ -def Positive (H : Set (Set α)) (T : Set α → Finset α) : Prop := +@[expose] def Positive (H : Set (Set α)) (T : Set α → Finset α) : Prop := ∀ L ∈ H, (↑(T L) : Set α) ⊆ L /-- A positive witness assignment whose nonempty active subfamilies have infinite common cores. -/ +@[expose] def Valid (H : Set (Set α)) (T : Set α → Finset α) : Prop := Positive H T ∧ ∀ S, (active H T S).Nonempty → (activeCore H T S).Infinite /-- Existence of a valid witness assignment with a uniform finite cardinality bound. -/ +@[expose] def HasBoundedWitnesses (H : Set (Set α)) (d : ℕ) : Prop := ∃ T, Valid H T ∧ ∀ L ∈ H, (T L).card ≤ d @@ -81,7 +83,7 @@ theorem HasBoundedWitnesses.mono_bound {H : Set (Set α)} {d e : ℕ} /-- Every nonempty subfamily with finite intersection contains targets separated by an assigned set. -/ -def SetSeparates (H : Set (Set α)) (P : Set α → Set α) : Prop := +@[expose] def SetSeparates (H : Set (Set α)) (P : Set α → Set α) : Prop := ∀ F : Set (Set α), F ⊆ H → F.Nonempty → (⋂₀ F).Finite → ∃ L ∈ F, ∃ K ∈ F, ¬ P L ⊆ K diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Padding.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Padding.lean index e40c0a119c..aad4a50ac3 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Padding.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Padding.lean @@ -13,7 +13,7 @@ public import Mathlib.Tactic.Choose # Padding witnesses collapses the bad-sample dimension -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Singleton.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Singleton.lean index 50ce17ef6e..94651f2e99 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Singleton.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Singleton.lean @@ -14,7 +14,7 @@ public import Mathlib.Tactic.Push # Singleton witnesses for countable language families -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Sorting.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Sorting.lean index 8fd7be67a6..c16151c6e0 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Sorting.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Sorting.lean @@ -15,7 +15,7 @@ public import Mathlib.Tactic.SplitIfs # Sorting histories can destroy eventual generation -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.Sorting diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Transport.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Transport.lean index 2d9d526ee2..959676ad8e 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Transport.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Transport.lean @@ -11,18 +11,19 @@ public import LeanPool.LanguageGeneration.FiniteWitness.Width.Cost # Transport of language families, witnesses, and width along equivalences -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness variable {α β : Type*} /-- Transport a language family along an equivalence of universes. -/ +@[expose] def transportClass (e : α ≃ β) (H : Set (Set α)) : Set (Set β) := {K | e ⁻¹' K ∈ H} /-- Transport finite witnesses along an equivalence of universes. -/ -noncomputable def transportAssignment (e : α ≃ β) (T : Set α → Finset α) +@[expose] noncomputable def transportAssignment (e : α ≃ β) (T : Set α → Finset α) (K : Set β) : Finset β := (T (e ⁻¹' K)).map e.toEmbedding @[simp] theorem transportClass_inverse (e : α ≃ β) (H : Set (Set α)) : diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/TwoCore.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/TwoCore.lean index ddb6ffec17..9bc3d94d34 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/TwoCore.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/TwoCore.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic.Push # An explicit family with finite witnesses of unbounded size -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness.TwoCore @@ -20,15 +20,20 @@ namespace GenLimit.FiniteWitness.TwoCore abbrev Point := Anchored.Point /-- A language contains the entire left copy of the natural numbers. -/ +@[expose] def HasLeft (L : Set Point) : Prop := ∀ n, Sum.inl n ∈ L /-- A language contains the entire right copy of the natural numbers. -/ +@[expose] def HasRight (L : Set Point) : Prop := ∀ n, Sum.inr n ∈ L /-- The languages containing at least one of the two infinite copies. -/ +@[expose] def family : Set (Set Point) := {L | HasLeft L ∨ HasRight L} /-- A full left copy together with an arbitrary subset of the right copy. -/ +@[expose] def leftTarget (D : Set ℕ) : Set Point := Sum.elim (fun _ => True) (fun n => n ∈ D) /-- A full right copy together with an arbitrary subset of the left copy. -/ +@[expose] def rightTarget (E : Set ℕ) : Set Point := Sum.elim (fun n => n ∈ E) (fun _ => True) @[simp] theorem inl_left (D : Set ℕ) (n : ℕ) : Sum.inl n ∈ leftTarget D := trivial diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Value.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Value.lean index 5819235a6e..e497c978ab 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Value.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Value.lean @@ -10,7 +10,7 @@ public import Mathlib.Order.WithBot /-! The ordered range 0,1,2,...,omega,omega+1, and its exact threshold. -/ -@[expose] public section +public section namespace GenLimit.FiniteWitness @@ -18,9 +18,9 @@ namespace GenLimit.FiniteWitness abbrev SeparationValue := WithTop (WithTop ℕ) /-- Embed a finite witness bound into the separation-width range. -/ -def finiteValue (n : ℕ) : SeparationValue := ((n : WithTop ℕ) : SeparationValue) +@[expose] def finiteValue (n : ℕ) : SeparationValue := ((n : WithTop ℕ) : SeparationValue) /-- The width value for finite witnesses with no uniform finite bound. -/ -def omegaValue : SeparationValue := ((⊤ : WithTop ℕ) : SeparationValue) +@[expose] def omegaValue : SeparationValue := ((⊤ : WithTop ℕ) : SeparationValue) @[simp] theorem finiteValue_le_iff (m n : ℕ) : finiteValue m ≤ finiteValue n ↔ m ≤ n := by simp [finiteValue] @@ -40,7 +40,7 @@ def omegaValue : SeparationValue := ((⊤ : WithTop ℕ) : SeparationValue) /-- A convenient normal form for the optimized width. The accompanying minimum theorem identifies it with the paper's assignment-cost definition. -/ -noncomputable def separationWidth (H : Set (Set α)) : SeparationValue := by +@[expose] noncomputable def separationWidth (H : Set (Set α)) : SeparationValue := by classical exact if h : ∃ d, HasBoundedWitnesses H d then finiteValue (Nat.find h) else if HasFiniteWitnesses H then omegaValue else ⊤ diff --git a/LeanPool/LatticeTriangle.lean b/LeanPool/LatticeTriangle.lean index eed8c2f11e..5727a65a40 100644 --- a/LeanPool/LatticeTriangle.lean +++ b/LeanPool/LatticeTriangle.lean @@ -19,7 +19,7 @@ Tags: number-theory, combinatorics MSC: 11H06, 11B30 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/LatticeTriangle/Solution.lean b/LeanPool/LatticeTriangle/Solution.lean index 9a78f9dd8c..d1b873ddf9 100644 --- a/LeanPool/LatticeTriangle/Solution.lean +++ b/LeanPool/LatticeTriangle/Solution.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Set.Card.Arithmetic # LeanPool.LatticeTriangle.Solution -/ -@[expose] public section +public section /-- The largest prime factor of `n`, or `0` if `n` has no prime factors (i.e. `n ≤ 1`). -/ def largestPrimeFactor (n : ℕ) : ℕ := @@ -30,6 +30,7 @@ def truncatedObtuseRegion (n : ℕ) (η : ℝ) : Set (ℤ × ℤ) := Int.gcd (Int.gcd pq.1 pq.2) (n : ℤ) = 1} /-- The image in `ZMod n` of the integer interval `{1, …, m}`. -/ +@[expose] def intervalSet (n : ℕ) (m : ℕ) : Set (ZMod n) := {x : ZMod n | 1 ≤ ZMod.val x ∧ ZMod.val x ≤ m} diff --git a/LeanPool/Lean4GlCoalgebras.lean b/LeanPool/Lean4GlCoalgebras.lean index b30f4fb3e3..d892397f02 100644 --- a/LeanPool/Lean4GlCoalgebras.lean +++ b/LeanPool/Lean4GlCoalgebras.lean @@ -36,4 +36,4 @@ Tags: modal-logic, provability-logic, craig-interpolation, proof-theory MSC: 03B45, 03F45 -/ -@[expose] public section +public section diff --git a/LeanPool/Lean4GlCoalgebras/General/Completeness.lean b/LeanPool/Lean4GlCoalgebras/General/Completeness.lean index f9551bcbc1..7f14d303f4 100644 --- a/LeanPool/Lean4GlCoalgebras/General/Completeness.lean +++ b/LeanPool/Lean4GlCoalgebras/General/Completeness.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.Pow If Prover has a winning strategy in the game starting from `Γ`, then there is a proof of `Γ`, proven in `prover_win_builds_proof`, all other definitions and proofs in this file are helpers. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -125,12 +125,13 @@ lemma rewind_history_in_cone {Γ} (g : coalgebraGame.Pos) simp [rewindHistory] /-- This is the type of the coalgebra we will use to build the proof of `Γ`. -/ -def proof_type (Γ : Sequent) (strat : Strategy coalgebraGame Prover) := +@[expose] def proof_type (Γ : Sequent) (strat : Strategy coalgebraGame Prover) := {g // inMyCone strat (startPos Γ) g ∧ coalgebraGame.turn g = Builder} attribute [local implicit_reducible] proof_type /-- Auxiliary declaration used in the GL coalgebra development. -/ +@[expose] def builderRuleApp (g : coalgebraGame.Pos) (h : coalgebraGame.turn g = Builder) : RuleApp := match g with | ⟨Sum.inr R, _, _⟩ => R @@ -498,10 +499,12 @@ lemma rewind_history_correspondence (Γ g) (strat : Strategy coalgebraGame Prove exact rewind_history_correspondence_aux Γ info Γs Rs strat n h2 h3 h4 h6 in_cone /-- Defines the premise when we have a repeat. -/ -def repNext (Γ : Sequent) {Δ : Sequent} {strat : Strategy coalgebraGame Prover} +@[expose] def repNext (Γ : Sequent) {Δ : Sequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (rep : Δ ∈ g.1.2.1) : (proof_type Γ strat) := ⟨repPos g rep, - rewind_history_in_cone g.1 ⟨(2 * (Fin.find _ (List.mem_iff_get.1 rep)).1), _⟩ strat g.2.1, + by + exact rewind_history_in_cone g.1 + ⟨(2 * (Fin.find _ (List.mem_iff_get.1 rep)).1), _⟩ strat g.2.1, by have hbound : 2 * (Fin.find _ (List.mem_iff_get.1 rep)).1 < @@ -664,7 +667,7 @@ theorem prover_win_builds_proof {Γ : Sequent} (strat : Strategy coalgebraGame P case pos rep => simp only [rep, ↓reduceDIte, List.cons.injEq, and_true, exists_eq_left'] simp only [repNext] - exact rep_next_cor Γ + exact rep_next_cor (Δ := Δ \ {φ1 v φ2} ∪ {φ1, φ2}) Γ ⟨⟨Sum.inr (RuleApp.or Δ φ1 φ2 φ_in), Γs, Rs⟩, in_cone, b_move⟩ (by simp only [rep]) case neg nrep => @@ -680,7 +683,7 @@ theorem prover_win_builds_proof {Γ : Sequent} (strat : Strategy coalgebraGame P case pos rep => simp only [rep, ↓reduceDIte, List.cons.injEq, and_true, exists_eq_left'] simp only [repNext] - exact rep_next_cor Γ + exact rep_next_cor (Δ := (Δ \ {□φ1}).D ∪ {φ1}) Γ ⟨⟨Sum.inr (RuleApp.box Δ φ1 φ_in), Γs, Rs⟩, in_cone, b_move⟩ (by simp only [rep]) case neg nrep => diff --git a/LeanPool/Lean4GlCoalgebras/General/Game.lean b/LeanPool/Lean4GlCoalgebras/General/Game.lean index b85106efdf..d88ffe0ad5 100644 --- a/LeanPool/Lean4GlCoalgebras/General/Game.lean +++ b/LeanPool/Lean4GlCoalgebras/General/Game.lean @@ -22,7 +22,7 @@ plays an applicable sequent `Γ` in order to construct a counter-model. Prover g plays rule applications `R` in order to construct a proof. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -32,7 +32,7 @@ abbrev Builder := Player.A abbrev Prover := Player.B /-- The available rule applications for a sequent `Γ`. -/ -def Sequent.ruleApps (Γ : Sequent) : Finset RuleApp := +@[expose] def Sequent.ruleApps (Γ : Sequent) : Finset RuleApp := let f : Formula → Option RuleApp := fun φ ↦ if φ_in : φ ∈ Γ then match φ with | ⊤ => RuleApp.top Γ φ_in @@ -47,7 +47,7 @@ def Sequent.ruleApps (Γ : Sequent) : Finset RuleApp := cases φ <;> cases ψ <;> grind [f]) /-- The sequents possible after a rule application `R`. -/ -def RuleApp.sequents (R : RuleApp) : Finset Sequent := match R with +@[expose] def RuleApp.sequents (R : RuleApp) : Finset Sequent := match R with | RuleApp.top _ _ => ∅ | RuleApp.ax _ _ _ => ∅ | RuleApp.and Δ φ ψ _ => {(Δ \ {φ & ψ}) ∪ {φ}, (Δ \ {φ & ψ}) ∪ {ψ}} @@ -283,8 +283,7 @@ lemma matches_finite : WellFounded (Function.swap Move) := by cases this /-- Auxiliary declaration used in the GL coalgebra development. -/ -@[reducible] -def coalgebraGame : Game where +@[expose, reducible] def coalgebraGame : Game where Pos := GamePos -- = (Sequent ⊕ RuleApp) × List Sequent × List RuleApp turn | ⟨Sum.inl _, _, _⟩ => Prover -- Prover gets a sequent and picks a rule application diff --git a/LeanPool/Lean4GlCoalgebras/General/Proof.lean b/LeanPool/Lean4GlCoalgebras/General/Proof.lean index becfdc412c..53c3c20345 100644 --- a/LeanPool/Lean4GlCoalgebras/General/Proof.lean +++ b/LeanPool/Lean4GlCoalgebras/General/Proof.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow Here we define the GL-proof system along with finitization and basic properties. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -36,7 +36,7 @@ inductive RuleApp | box : (Δ : Sequent) → (φ : Formula) → (□ φ) ∈ Δ → RuleApp /-- Endofunctor for the GL-proof system. -/ -@[simp] def T : (CategoryTheory.Functor Type Type) where +@[expose, simp] def T : (CategoryTheory.Functor Type Type) where obj := fun X ↦ (RuleApp × List X) map := fun {X Y} f ↦ TypeCat.ofHom fun x ↦ @@ -46,7 +46,7 @@ inductive RuleApp map_comp := by aesop_cat /-- Given a RuleApp, obtain the principal formulas. -/ -def fₚ : RuleApp → Sequent +@[expose] def fₚ : RuleApp → Sequent | RuleApp.top _ _ => {⊤} | RuleApp.ax _ n _ => {at n, na n} | RuleApp.and _ A B _ => {A & B} @@ -54,7 +54,7 @@ def fₚ : RuleApp → Sequent | RuleApp.box _ A _ => {□ A} /-- Given a RuleApp, obtain the sequent. -/ -def f : RuleApp → Sequent +@[expose] def f : RuleApp → Sequent | RuleApp.top Δ _ => Δ | RuleApp.ax Δ _ _ => Δ | RuleApp.and Δ _ _ _ => Δ @@ -62,7 +62,7 @@ def f : RuleApp → Sequent | RuleApp.box Δ _ _ => Δ /-- Given a RuleApp, obtain the non-principal formulas. -/ -def fₙ : RuleApp → Sequent := fun r ↦ f r \ fₚ r +@[expose] def fₙ : RuleApp → Sequent := fun r ↦ f r \ fₚ r /-- Relating principal formulas, non-principal formulas, and sequent. -/ lemma fₙ_alternate (r : RuleApp) : fₙ r = match r with @@ -79,18 +79,18 @@ lemma fₙ_sub_f {r : RuleApp} : fₙ r ⊆ f r := by cases r <;> simp_all [fₙ, f] /-- Auxiliary declaration used in the GL coalgebra development. -/ -def RuleApp.isBox : RuleApp → Bool +@[expose] def RuleApp.isBox : RuleApp → Bool | RuleApp.box _ _ _ => true | _ => false /-- Get RuleApp of a node (first projection). -/ -def r {X : Type} (α : X → T.obj X) (x : X) := (α x).1 +@[expose] def r {X : Type} (α : X → T.obj X) (x : X) := (α x).1 /-- Get premises of a node (second projection). -/ -def p {X : Type} (α : X → T.obj X) (x : X) := (α x).2 +@[expose] def p {X : Type} (α : X → T.obj X) (x : X) := (α x).2 /-- Edge relation induced by `p`. -/ -def edge {X : Type} (α : X → T.obj X) (x y : X) : Prop := y ∈ p α x +@[expose] def edge {X : Type} (α : X → T.obj X) (x y : X) : Prop := y ∈ p α x /-- Definition of GL-proof. -/ structure Proof where @@ -114,9 +114,9 @@ def Proof.toCoalgebra (𝕏 : Proof) : CategoryTheory.Endofunctor.Coalgebra T wh str := TypeCat.ofHom 𝕏.α /-- A proof `𝕏` proves sequent `Δ` if some node of `𝕏` has sequent `Δ` as its sequent. -/ -def proves (𝕏 : Proof) (Δ : Sequent) : Prop := ∃ x : 𝕏.X, f (r 𝕏.α x) = Δ +@[expose] def proves (𝕏 : Proof) (Δ : Sequent) : Prop := ∃ x : 𝕏.X, f (r 𝕏.α x) = Δ /-- A sequent is provable if there exists a GL-proof of it. -/ -def Sequent.isTrue (Δ : Sequent) : Prop := ∃ 𝕏 : Proof, proves 𝕏 Δ +@[expose] def Sequent.isTrue (Δ : Sequent) : Prop := ∃ 𝕏 : Proof, proves 𝕏 Δ /-- Auxiliary declaration used in the GL coalgebra development. -/ infixr:6 "⊢" => proves @@ -198,7 +198,7 @@ lemma path_in_FL {𝕏 : Proof} {x y : 𝕏.X} List.pmap (fun x y ↦ ⟨x, y⟩) (𝕐.α y.1).2 (fun _ z_in ↦ Relation.ReflTransGen.tail y.2 z_in)⟩ /-- Point Generated Proof. -/ -def pointGeneratedProof (𝕐 : Proof) (x : 𝕐.X) : Proof where +@[expose] def pointGeneratedProof (𝕐 : Proof) (x : 𝕐.X) : Proof where X := {y : 𝕐.X // Relation.ReflTransGen (edge 𝕐.α) x y } α := αPoint 𝕐 x step := by diff --git a/LeanPool/Lean4GlCoalgebras/General/Soundness.lean b/LeanPool/Lean4GlCoalgebras/General/Soundness.lean index c2986637e7..05d8a6812b 100644 --- a/LeanPool/Lean4GlCoalgebras/General/Soundness.lean +++ b/LeanPool/Lean4GlCoalgebras/General/Soundness.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.Pow /-! ## Soundness of GL-proof system. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras diff --git a/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolants.lean b/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolants.lean index e1455a95d4..e4f1345ec6 100644 --- a/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolants.lean +++ b/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolants.lean @@ -26,7 +26,7 @@ import Mathlib.Tactic.NormNum.OfScientific Here we show that given a finite GL-split proof, we can always find suitable interpolants. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -100,7 +100,7 @@ lemma encodeVar_eq {𝕏 : Proof} {Fin_X : Fintype 𝕏.X} {x : 𝕏.X} {n : ℕ exact h2 /-- Auxiliary declaration used in the GL coalgebra development. -/ -noncomputable def equation {𝕏 : Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) : +@[expose] noncomputable def equation {𝕏 : Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) : Formula := match r : r 𝕏.α x with | RuleApp.topₗ _ _ => ⊥ | RuleApp.topᵣ _ _ => ⊤ @@ -1138,7 +1138,7 @@ decreasing_by simp [←Finset.card_sdiff_add_card_inter Y {leaf_in_Y.choose}, leaf_in] /-- Auxiliary declaration used in the GL coalgebra development. -/ -noncomputable def interpolant (𝕏 : Proof) [fin_X : Fintype 𝕏.X] : Formula → Formula +@[expose] noncomputable def interpolant (𝕏 : Proof) [fin_X : Fintype 𝕏.X] : Formula → Formula := partial_ <| @interpolantStrong 𝕏 _ fin_X.elems (by aesop) theorem interpolant_prop {𝕏 : Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) : diff --git a/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolation.lean b/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolation.lean index 54fc2a2546..d89714cf66 100644 --- a/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolation.lean +++ b/LeanPool/Lean4GlCoalgebras/Interpolation/Interpolation.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.OfScientific We use everything we have proven so far to show that GL has interpolation! -/ -@[expose] public section +public section namespace Lean4GlCoalgebras diff --git a/LeanPool/Lean4GlCoalgebras/Interpolation/PartialInterpolation.lean b/LeanPool/Lean4GlCoalgebras/Interpolation/PartialInterpolation.lean index e8ac931935..61914cb874 100644 --- a/LeanPool/Lean4GlCoalgebras/Interpolation/PartialInterpolation.lean +++ b/LeanPool/Lean4GlCoalgebras/Interpolation/PartialInterpolation.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.OfScientific All of the left and right partial interpolation proofs, split apart based on rule application. These are split apart since otherwise the file runs very slow. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -30,7 +30,7 @@ private abbrev encodeVar_mem_elems {𝕏 : Proof} [fin_X : Fintype 𝕏.X] (x : /-- Given a node `x`, defines what the root of the left interpolation proof should look like, i.e. `f(x)ˡ ∣ ιₓ` in on paper work. -/ -noncomputable def leftInterpolantSequent {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] +@[expose] noncomputable def leftInterpolantSequent {𝕏 : Split.Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) : SplitSequent := {Sum.inr (interpolant 𝕏 (at (encodeVar x)))} ∪ SplitSequent.filterLeft (f (r 𝕏.α x)) @@ -45,7 +45,7 @@ noncomputable def leftEquationSequent {𝕏 : Proof} [fin_X : Fintype 𝕏.X] /-- Given a node `x`, defines what the root of the right interpolation proof should look like, i.e. `~ιₓ ∣ f(x)ʳ ` in on paper work. -/ -noncomputable def rightInterpolantSequent {𝕏 : Proof} [fin_X : Fintype 𝕏.X] +@[expose] noncomputable def rightInterpolantSequent {𝕏 : Proof} [fin_X : Fintype 𝕏.X] (x : 𝕏.X) : SplitSequent := {Sum.inl (~ (interpolant 𝕏 (at (encodeVar x))))} ∪ SplitSequent.filterRight (f (r 𝕏.α x)) diff --git a/LeanPool/Lean4GlCoalgebras/Logic/FixedPointTheorem.lean b/LeanPool/Lean4GlCoalgebras/Logic/FixedPointTheorem.lean index 8f9013a912..820c05df19 100644 --- a/LeanPool/Lean4GlCoalgebras/Logic/FixedPointTheorem.lean +++ b/LeanPool/Lean4GlCoalgebras/Logic/FixedPointTheorem.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow Here we prove the fixed-point theorem for formulas of form `□φ` and `◇φ`. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras diff --git a/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean b/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean index 97ac4a4f9c..77050d36f2 100644 --- a/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean +++ b/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow Here we supply the semantics of GL. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -37,8 +37,7 @@ instance instModelIsIrref {α : Type} (M : Model α) : Std.Irrefl M.R where irrefl := fun a con ↦ (WellFounded.irrefl M.con_wf).irrefl a con /-- Standard semantics for Kripke models. -/ -@[simp] -def evaluate {α : Type} : Model α × α → Formula → Prop +@[expose, simp] def evaluate {α : Type} : Model α × α → Formula → Prop | (_, _), ⊥ => False | (_, _), ⊤ => True | (M, w), at n => M.V w n @@ -62,12 +61,11 @@ lemma evaluate_imp {α : Type} (M : Model α) (u : α) (φ ψ : Formula) : tauto /-- note: sequent are read disjunctively! -/ -@[simp] -def evaluateSeq {α : Type} : Model α × α → Sequent → Prop := +@[expose, simp] def evaluateSeq {α : Type} : Model α × α → Sequent → Prop := fun M_u Γ ↦ ∃ φ ∈ Γ, evaluate M_u φ /-- note: ignores the left/right annotation. -/ -def evaluateSSeq {α : Type} : Model α × α → SplitSequent → Prop := +@[expose] def evaluateSSeq {α : Type} : Model α × α → SplitSequent → Prop := fun M_u Γ ↦ ∃ φ ∈ Γ, evaluate M_u (Sum.elim id id φ) @[simp] @@ -78,15 +76,15 @@ lemma not_evaluateSSeq {α : Type} {M_u : Model α × α} {Γ : SplitSequent} : simp [evaluateSSeq] /-- A formula is valid if it holds at every world in every GL model. -/ -def Formula.isValid (φ : Formula) : Prop +@[expose] def Formula.isValid (φ : Formula) : Prop := ∀ (α : Type), ∀ M : Model α, ∀ u : α, evaluate ⟨M, u⟩ φ /-- A sequent is valid if some formula in it holds at every world in every GL model. -/ -def Sequent.isValid (Δ : Sequent) : Prop +@[expose] def Sequent.isValid (Δ : Sequent) : Prop := ∀ (α : Type), ∀ M : Model α, ∀ u : α, evaluateSeq ⟨M, u⟩ Δ /-- A split sequent is valid if some formula in it holds at every world in every GL model. -/ -def SplitSequent.isValid (Δ : SplitSequent) : Prop +@[expose] def SplitSequent.isValid (Δ : SplitSequent) : Prop := ∀ (α : Type), ∀ M : Model α, ∀ u : α, evaluateSSeq ⟨M, u⟩ Δ /-- Auxiliary declaration used in the GL coalgebra development. -/ @@ -97,7 +95,7 @@ prefix:40 "⊨" => Sequent.isValid prefix:40 "⊨" => SplitSequent.isValid /-- Two formulas are semantically equivalent if their biconditional is valid. -/ -def semEquiv : Formula → Formula → Prop := fun φ ψ ↦ ⊨ φ ⟷ ψ +@[expose] def semEquiv : Formula → Formula → Prop := fun φ ψ ↦ ⊨ φ ⟷ ψ /-- Model construction for substitution lemma. -/ diff --git a/LeanPool/Lean4GlCoalgebras/Logic/Syntax.lean b/LeanPool/Lean4GlCoalgebras/Logic/Syntax.lean index 67bd53e502..a2945803be 100644 --- a/LeanPool/Lean4GlCoalgebras/Logic/Syntax.lean +++ b/LeanPool/Lean4GlCoalgebras/Logic/Syntax.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.OfScientific Here we supply basic definitions, abbreviations, and lemmas about the syntax of BML. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -61,7 +61,7 @@ infixr:6 "v" => or @[simp] instance instTop : Top (Formula) where top := Formula.top /-- Negation of a BML Formula. -/ -@[simp] def neg : Formula → Formula +@[expose, simp] def neg : Formula → Formula | ⊥ => ⊤ | ⊤ => ⊥ | at n => na n @@ -93,7 +93,7 @@ def isNegAtomic : Formula → Bool | _ => false /-- Returns `true` if the formula is a diamond formula `◇ φ`. -/ -def isDiamond : Formula → Bool +@[expose] def isDiamond : Formula → Bool | ◇ _ => true | _ => false @@ -110,7 +110,7 @@ def unDi (φ : Formula) (h : φ.isDiamond) : Formula := match φ with | ◇ φ => φ /-- Returns `true` if the formula is a box formula `□ φ`. -/ -def isBox : Formula → Bool +@[expose] def isBox : Formula → Bool | □ _ => true | _ => false @@ -128,7 +128,7 @@ lemma neg_neg_eq (φ : Formula) : (~~φ) = φ := by induction φ <;> simp_all [Formula.neg] <;> rfl /-- Length of a BML Formula. -/ -def length : Formula → Nat +@[expose] def length : Formula → Nat | ⊥ => 0 | ⊤ => 0 | at _ => 1 @@ -140,7 +140,7 @@ def length : Formula → Nat /-- Vocab of a BML Formula. Expressed as underlying natural numbers. -/ -def vocab : Formula → Finset Nat +@[expose] def vocab : Formula → Finset Nat | ⊥ => ∅ | ⊤ => ∅ | at n => {n} @@ -173,7 +173,7 @@ def lit : Formula → Finset (Nat ⊕ Nat) | ◇ φ => lit φ /-- Get a fresh variable not occuring in a BML Formula. -/ -def freshVar : Formula → Nat +@[expose] def freshVar : Formula → Nat | ⊤ => 0 | ⊥ => 0 | at n => n + 1 @@ -184,7 +184,7 @@ def freshVar : Formula → Nat | ◇ φ => freshVar φ /-- Fischer-Ladner closure of a BML Formula. -/ -def FL : Formula → Sequent +@[expose] def FL : Formula → Sequent | ⊥ => {⊥} | ⊤ => {⊤} | at n => {at n} @@ -226,11 +226,11 @@ namespace Sequent /-! # Basic operations and simp lemmas for Sequents -/ /-- Length of a sequent. -/ -def length (Γ : Sequent) : Nat := Finset.sum Γ Formula.length +@[expose] def length (Γ : Sequent) : Nat := Finset.sum Γ Formula.length /- Vocabulary of a sequent. -/ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def vocab (Γ : Sequent) : Finset Nat := Finset.biUnion Γ Formula.vocab +@[expose] def vocab (Γ : Sequent) : Finset Nat := Finset.biUnion Γ Formula.vocab /- Literals of a sequent. -/ /-- Auxiliary declaration used in the GL coalgebra development. -/ @@ -242,13 +242,13 @@ def neg (Γ : Sequent) : Finset Formula := Finset.biUnion Γ (fun φ ↦ {Formul /- Given a sequent `Γ`, finds a variable not in `Γ`-/ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def freshVar (Γ : Finset Formula) : Nat := +@[expose] def freshVar (Γ : Finset Formula) : Nat := if h : Γ = {} then 0 else Finset.max' (Γ.image (Formula.freshVar)) (by by_contra con simp_all) /-- Auxiliary declaration used in the GL coalgebra development. -/ -def D (Γ : Sequent) : Sequent := Finset.filter ( +@[expose] def D (Γ : Sequent) : Sequent := Finset.filter ( fun x => decide (Formula.isDiamond x)) Γ ∪ Finset.filterMap Formula.opUnDi Γ (by simp_all) @@ -257,7 +257,7 @@ lemma form_in_seq_size_le {A : Formula} {Δ : Sequent} : A ∈ Δ → A.length fun A_in ↦ Finset.sum_le_sum_of_subset_of_nonneg (Finset.singleton_subset_iff.2 A_in) (by simp) /-- Fischer-Ladner closure of a sequent. -/ -def FL : Sequent → Sequent := fun Δ ↦ Finset.biUnion Δ Formula.FL +@[expose] def FL : Sequent → Sequent := fun Δ ↦ Finset.biUnion Δ Formula.FL /-! # Lemmas about FL Closure of Sequents -/ @@ -293,7 +293,7 @@ abbrev SplitSequent := Finset SplitFormula namespace SplitFormula /-- Auxiliary declaration used in the GL coalgebra development. -/ -def isDiamond : SplitFormula → Bool +@[expose] def isDiamond : SplitFormula → Bool | Sum.inl (◇ _) => true | Sum.inr (◇ _) => true | _ => false @@ -307,13 +307,13 @@ def opUnDi (φ : SplitFormula) : Option SplitFormula := match φ with /- Length of a Split Formula (i.e. length of underlying BML Fornula). -/ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def length : (Formula ⊕ Formula) → Nat +@[expose] def length : (Formula ⊕ Formula) → Nat | Sum.inl φ => φ.length | Sum.inr φ => φ.length /- Fischer-Ladner closure of a Split Formula (preserving the formula annotation). -/ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def FL : SplitFormula → SplitSequent +@[expose] def FL : SplitFormula → SplitSequent | Sum.inl ⊥ => {Sum.inl ⊥} | Sum.inr ⊥ => {Sum.inr ⊥} | Sum.inl ⊤ => {Sum.inl ⊤} @@ -387,7 +387,7 @@ namespace SplitSequent /-! # Lemmas about FL Closure of Split Sequents -/ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def FL : SplitSequent → SplitSequent := fun Δ ↦ Finset.biUnion Δ SplitFormula.FL +@[expose] def FL : SplitSequent → SplitSequent := fun Δ ↦ Finset.biUnion Δ SplitFormula.FL /-- Fischer-Ladner Closure is reflexive. -/ lemma FL_refl {Δ : SplitSequent} : Δ ⊆ FL Δ := by @@ -410,7 +410,7 @@ lemma FL_idem {Δ : SplitSequent} : FL (FL Δ) = FL Δ := by · exact FL_mon FL_refl /-- □₄⁻¹ operator for Split Sequents. -/ -def D (Γ : SplitSequent) : SplitSequent +@[expose] def D (Γ : SplitSequent) : SplitSequent := Finset.filter (fun x => decide (SplitFormula.isDiamond x)) Γ ∪ Finset.filterMap SplitFormula.opUnDi Γ (by intro φ ψ C C_in_A C_in_B @@ -424,10 +424,10 @@ def D (Γ : SplitSequent) : SplitSequent /-! # Basic operations and simp lemmas for Split Sequents -/ /-- Find underlying Sequent of a Split Sequent. -/ -def toSequent (Δ : SplitSequent) : Sequent := Finset.image (Sum.elim id id) Δ +@[expose] def toSequent (Δ : SplitSequent) : Sequent := Finset.image (Sum.elim id id) Δ /-- Length of a Split Sequent. -/ -def length (Δ : SplitSequent) : Nat := Finset.sum Δ (SplitFormula.length) +@[expose] def length (Δ : SplitSequent) : Nat := Finset.sum Δ (SplitFormula.length) @[simp] lemma opUnDi_eqₗₗ {φ ψ : Formula} : @@ -448,28 +448,26 @@ lemma opUnDi_eqᵣₗ {φ ψ : Formula} : ¬ (SplitFormula.opUnDi (Sum.inr φ) = cases φ <;> simp [SplitFormula.opUnDi] /-- Auxiliary declaration used in the GL coalgebra development. -/ -@[simp] -noncomputable def filterLeft : SplitSequent → SplitSequent := @Finset.filter _ +@[expose, simp] noncomputable def filterLeft : SplitSequent → SplitSequent := @Finset.filter _ (fun | Sum.inl _ => true | Sum.inr _ => false) (fun | Sum.inl _ => isTrue (by simp) | Sum.inr _ => isFalse (by simp)) /-- Auxiliary declaration used in the GL coalgebra development. -/ -@[simp] -noncomputable def filterRight : SplitSequent → SplitSequent := @Finset.filter _ +@[expose, simp] noncomputable def filterRight : SplitSequent → SplitSequent := @Finset.filter _ (fun | Sum.inl _ => false | Sum.inr _ => true) (fun | Sum.inl _ => isFalse (by simp) | Sum.inr _ => isTrue (by simp)) /-- Auxiliary declaration used in the GL coalgebra development. -/ -def left (Γ : SplitSequent) : Sequent := Γ.filterMap (Sum.getLeft?) (by aesop) +@[expose] def left (Γ : SplitSequent) : Sequent := Γ.filterMap (Sum.getLeft?) (by aesop) /-- Auxiliary declaration used in the GL coalgebra development. -/ -def right (Γ : SplitSequent) : Sequent := Γ.filterMap (Sum.getRight?) (by aesop) +@[expose] def right (Γ : SplitSequent) : Sequent := Γ.filterMap (Sum.getRight?) (by aesop) end SplitSequent /-! # Properties of Substitutions -/ /-- Substiting `p` with `ψ` in `φ` (`φ[ψ/p]`). -/ -def single (n : Nat) (ψ : Formula) : Formula → Formula +@[expose] def single (n : Nat) (ψ : Formula) : Formula → Formula | ⊥ => ⊥ | ⊤ => ⊤ | at k => if k == n then ψ else at k @@ -498,6 +496,7 @@ lemma single_identity (n : ℕ) (φ : Formula) : (single n (at n) φ) = φ := by induction φ <;> simp_all [single] <;> rfl /-- Simultaneous substitution for `p` meeting criteria `c`. -/ +@[expose] def partial_ {c : Nat → Prop} [DecidablePred c] (σ : Subtype c → Formula) : Formula → Formula | ⊥ => ⊥ | ⊤ => ⊤ diff --git a/LeanPool/Lean4GlCoalgebras/Pdl/Game.lean b/LeanPool/Lean4GlCoalgebras/Pdl/Game.lean index e65bf94ed0..0383f65ae1 100644 --- a/LeanPool/Lean4GlCoalgebras/Pdl/Game.lean +++ b/LeanPool/Lean4GlCoalgebras/Pdl/Game.lean @@ -16,7 +16,7 @@ must have a winning strategy: `gamedet` at the end. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -41,7 +41,7 @@ theorem Player.not_eq_B_iff_eq_A {p} : (¬ p = B) ↔ p = A := by cases p <;> si theorem Player.eq_A_or_eq_B {p} : p = A ∨ p = B := by cases p <;> simp /-- Auxiliary declaration used in the GL coalgebra development. -/ -def other : Player → Player +@[expose] def other : Player → Player | A => B | B => A @@ -104,7 +104,7 @@ instance {g : Game} : LT g.Pos := ⟨fun p q => g.wf.rel q p⟩ /-! ## Strategies -/ /-- A strategy in `g` for `i`, whenever it is `i`'s turn, chooses a move, if there are any. -/ -def Strategy (g : Game) (i : Player) : Type := +@[expose] def Strategy (g : Game) (i : Player) : Type := ∀ p : g.Pos, g.turn p = i → p.moves.Nonempty → p.moves /-- Auxiliary declaration used in the GL coalgebra development. -/ @@ -117,6 +117,7 @@ instance Strategy.instNonempty {g i} : Nonempty (Strategy g i) := ⟨fun _ _ => /-- Winner of a game, if the given strategies are used. A player loses iff it is their turn and there are no moves. A player wins if the opponent loses. -/ +@[expose] def winner {i} {g : Game} (sI : Strategy g i) (sJ : Strategy g (other i)) (p : g.Pos) : Player := if h1 : (g.moves p).Nonempty then if h2 : g.turn p = i -- @@ -130,7 +131,7 @@ decreasing_by apply g.move_rel; simp /-- A strategy is winning at `p` if it wins against all strategies of the other player. -/ -def winning {g : Game} {i : Player} (sI : Strategy g i) (p : g.Pos) : Prop := +@[expose] def winning {g : Game} {i : Player} (sI : Strategy g i) (p : g.Pos) : Prop := ∀ sJ : Strategy g (other i), winner sI sJ p = i /-! ## Good positions -/ diff --git a/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean b/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean index f9c0588f8c..fecac1c8db 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean @@ -22,7 +22,7 @@ If Prover has a winning strategy in the game starting from `Γ`, then there is a of `Γ`, proven in `prover_win_builds_proof`; all other definitions and proofs in this file are helpers. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -160,13 +160,13 @@ lemma rewind_history_zero (g : coalgebraGame.Pos) : rewindHistory g 0 = g := by simp [rewindHistory] /-- This is the type of the coalgebra we will use to build the proof of `Γ`. -/ -def proof_type (Γ : SplitSequent) (strat : Strategy coalgebraGame Prover) := +@[expose] def proof_type (Γ : SplitSequent) (strat : Strategy coalgebraGame Prover) := {g // inMyCone strat (startPos Γ) g ∧ coalgebraGame.turn g = Builder} attribute [local implicit_reducible] proof_type /-- Auxiliary declaration used in the GL coalgebra development. -/ -def builderRuleApp (g : coalgebraGame.Pos) (h : coalgebraGame.turn g = Builder) : +@[expose] def builderRuleApp (g : coalgebraGame.Pos) (h : coalgebraGame.turn g = Builder) : RuleApp := match g with | ⟨Sum.inr R, _, _⟩ => R | ⟨Sum.inl _, _, _⟩ => False.elim (by @@ -608,10 +608,12 @@ lemma rewind_history_correspondence (Γ g) (strat : Strategy coalgebraGame Prove exact rewind_history_correspondence_aux Γ info Γs Rs strat n h2 h3 h4 h6 in_cone /-- Defines the premise when we have a repeat. -/ -def repNext (Γ : SplitSequent) {Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} +@[expose] def repNext (Γ : SplitSequent) {Δ : SplitSequent} {strat : Strategy coalgebraGame Prover} (g : proof_type Γ strat) (rep : Δ ∈ g.1.2.1) : (proof_type Γ strat) := ⟨repPos g rep, - rewind_history_in_cone g.1 ⟨(2 * (Fin.find _ (List.mem_iff_get.1 rep)).1), _⟩ strat g.2.1, + by + exact rewind_history_in_cone g.1 + ⟨(2 * (Fin.find _ (List.mem_iff_get.1 rep)).1), _⟩ strat g.2.1, by have := @rewind_turn g.1 ⟨(2 * (Fin.find _ (List.mem_iff_get.1 rep)).1), by have length := history_length_in_cone strat g.1 g.2.1 diff --git a/LeanPool/Lean4GlCoalgebras/Split/CutProof.lean b/LeanPool/Lean4GlCoalgebras/Split/CutProof.lean index f7ead45bac..ea42d1e1cc 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/CutProof.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/CutProof.lean @@ -19,7 +19,7 @@ Here we define the GL-ext proof system along with finitization and basic propert namespace ExtSkip to distinguish from our general GL-proofs. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -48,7 +48,7 @@ inductive RuleApp | boxᵣ : (Δ : SplitSequent) → (A : Formula) → Sum.inr (□ A) ∈ Δ → RuleApp /-- Endofunctor for the GL-ext+skip proof system. -/ -@[simp] def T : (CategoryTheory.Functor Type Type) where +@[expose, simp] def T : (CategoryTheory.Functor Type Type) where obj := fun X ↦ (RuleApp × List X) map := fun {X Y} f ↦ TypeCat.ofHom fun x ↦ @@ -58,7 +58,7 @@ inductive RuleApp map_comp := by aesop_cat /-- Given a RuleApp, obtain the principal formulas. -/ -def fₚ : RuleApp → SplitSequent +@[expose] def fₚ : RuleApp → SplitSequent | RuleApp.skp _ => ∅ | RuleApp.cutₗ _ _ => ∅ | RuleApp.cutᵣ _ _ => ∅ @@ -78,7 +78,7 @@ def fₚ : RuleApp → SplitSequent | RuleApp.boxᵣ _ A _ => {Sum.inr (□ A)} /-- Given a RuleApp, obtain the split sequent. -/ -def f : RuleApp → SplitSequent +@[expose] def f : RuleApp → SplitSequent | RuleApp.skp Δ => Δ | RuleApp.cutₗ Δ _ => Δ | RuleApp.cutᵣ Δ _ => Δ @@ -121,19 +121,19 @@ lemma fₙ_alternate (r : RuleApp) : fₙ r = match r with | RuleApp.boxᵣ Δ A _ => Δ \ {Sum.inr (□ A)} := by cases r <;> simp [fₙ, f, fₚ] /-- Auxiliary declaration used in the GL coalgebra development. -/ -def RuleApp.isBox : RuleApp → Prop +@[expose] def RuleApp.isBox : RuleApp → Prop | RuleApp.boxₗ _ _ _ => true | RuleApp.boxᵣ _ _ _ => true | _ => false /-- Get RuleApp of a node (first projection). -/ -def r {X : Type} (α : X → T.obj X) (x : X) := (α x).1 +@[expose] def r {X : Type} (α : X → T.obj X) (x : X) := (α x).1 /-- Get premises of a node (second projection). -/ -def p {X : Type} (α : X → T.obj X) (x : X) := (α x).2 +@[expose] def p {X : Type} (α : X → T.obj X) (x : X) := (α x).2 /-- Edge relation induced by `p`. -/ -def edge {X : Type} (α : X → T.obj X) (x y : X) : Prop := y ∈ p α x +@[expose] def edge {X : Type} (α : X → T.obj X) (x y : X) : Prop := y ∈ p α x /-- Definition of GL-ext+skip proof. -/ structure Proof where @@ -179,9 +179,9 @@ structure Proof where ∀ n, ∃ m, (r α (f.1 (n + m))).isBox /-- Auxiliary declaration used in the GL coalgebra development. -/ -def proves (𝕏 : Proof) (Δ : SplitSequent) : Prop := ∃ x : 𝕏.X, f (r 𝕏.α x) = Δ +@[expose] def proves (𝕏 : Proof) (Δ : SplitSequent) : Prop := ∃ x : 𝕏.X, f (r 𝕏.α x) = Δ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def SplitSequent.isTrue (Δ : SplitSequent) : Prop := ∃ (𝕏 : Proof), proves 𝕏 Δ +@[expose] def SplitSequent.isTrue (Δ : SplitSequent) : Prop := ∃ (𝕏 : Proof), proves 𝕏 Δ /-- Auxiliary declaration used in the GL coalgebra development. -/ infixr:6 "⊢" => proves diff --git a/LeanPool/Lean4GlCoalgebras/Split/Game.lean b/LeanPool/Lean4GlCoalgebras/Split/Game.lean index 47e8791b89..09845be64b 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/Game.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/Game.lean @@ -22,7 +22,7 @@ plays an applicable sequent `Γ` in order to construct a counter-model. Prover g and plays rule applications `R` in order to construct a proof. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -35,7 +35,7 @@ abbrev Prover := Player.B -- `ruleApps` performs a large exhaustive case split over split formulas. /-- The available rule applications for a sequent `Γ`. -/ -def SplitSequent.ruleApps (Γ : SplitSequent) : Finset RuleApp := +@[expose] def SplitSequent.ruleApps (Γ : SplitSequent) : Finset RuleApp := let f : SplitFormula → Option RuleApp := fun φ ↦ if φ_in : φ ∈ Γ then match φ with | Sum.inl ⊤ => RuleApp.topₗ Γ φ_in @@ -83,7 +83,7 @@ def SplitSequent.ruleApps (Γ : SplitSequent) : Finset RuleApp := exact (source_eq φ_f).trans (source_eq ψ_f).symm) /-- The sequents possible after a rule application `R`. -/ -def RuleApp.splitSequents (R : RuleApp) : Finset SplitSequent := match R with +@[expose] def RuleApp.splitSequents (R : RuleApp) : Finset SplitSequent := match R with | RuleApp.topₗ _ _ => ∅ | RuleApp.topᵣ _ _ => ∅ | RuleApp.axₗₗ _ _ _ => ∅ @@ -420,8 +420,7 @@ lemma matches_finite : WellFounded (Function.swap Move) := by cases this /-- Auxiliary declaration used in the GL coalgebra development. -/ -@[reducible] -def coalgebraGame : Game where +@[expose, reducible] def coalgebraGame : Game where Pos := GamePos -- = (SplitSequent ⊕ RuleApp) × List SplitSequent × List RuleApp turn | ⟨Sum.inl _, _, _⟩ => Prover -- picks RuleApp diff --git a/LeanPool/Lean4GlCoalgebras/Split/Proof.lean b/LeanPool/Lean4GlCoalgebras/Split/Proof.lean index 02d0debb93..6fb5d7274d 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/Proof.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/Proof.lean @@ -23,7 +23,7 @@ Here we define the GL-split-proof system along with finitization and basic prope namespace Split to distinguish from our general GL-proofs. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -47,7 +47,7 @@ inductive RuleApp | boxᵣ : (Δ : SplitSequent) → (A : Formula) → Sum.inr (□ A) ∈ Δ → RuleApp /-- Endofunctor for the GL-split proof system. -/ -@[simp] def T : (CategoryTheory.Functor Type Type) where +@[expose, simp] def T : (CategoryTheory.Functor Type Type) where obj := fun X ↦ (RuleApp × List X) map := fun {X Y} f ↦ TypeCat.ofHom fun x ↦ @@ -57,7 +57,7 @@ inductive RuleApp map_comp := by aesop_cat /-- Given a RuleApp, obtain the principal formulas. -/ -def fₚ : RuleApp → SplitSequent +@[expose] def fₚ : RuleApp → SplitSequent | RuleApp.topₗ _ _ => {Sum.inl ⊤} | RuleApp.topᵣ _ _ => {Sum.inr ⊤} | RuleApp.axₗₗ _ n _ => {Sum.inl (at n), Sum.inl (na n)} @@ -72,7 +72,7 @@ def fₚ : RuleApp → SplitSequent | RuleApp.boxᵣ _ A _ => {Sum.inr (□ A)} /-- Given a RuleApp, obtain the split sequent. -/ -def f : RuleApp → SplitSequent +@[expose] def f : RuleApp → SplitSequent | RuleApp.topₗ Δ _ => Δ | RuleApp.topᵣ Δ _ => Δ | RuleApp.axₗₗ Δ _ _ => Δ @@ -87,7 +87,7 @@ def f : RuleApp → SplitSequent | RuleApp.boxᵣ Δ _ _ => Δ /-- Given a RuleApp, obtain the non-principal formulas. -/ -def fₙ : RuleApp → SplitSequent := fun Γ ↦ f Γ \ fₚ Γ +@[expose] def fₙ : RuleApp → SplitSequent := fun Γ ↦ f Γ \ fₚ Γ /-- Relating principal formulas, non-principal formulas, and the sequent. -/ lemma fₙ_alternate (r : RuleApp) : fₙ r = match r with @@ -107,19 +107,19 @@ lemma fₙ_alternate (r : RuleApp) : fₙ r = match r with lemma fₙ_sub_f {r : RuleApp} : fₙ r ⊆ f r := by simp [fₙ] /-- Auxiliary declaration used in the GL coalgebra development. -/ -def RuleApp.isBox : RuleApp → Prop +@[expose] def RuleApp.isBox : RuleApp → Prop | RuleApp.boxₗ _ _ _ => true | RuleApp.boxᵣ _ _ _ => true | _ => false /-- Get RuleApp of a node (first projection). -/ -def r {X : Type} (α : X → T.obj X) (x : X) := (α x).1 +@[expose] def r {X : Type} (α : X → T.obj X) (x : X) := (α x).1 /-- Get premises of a node (second projection). -/ -def p {X : Type} (α : X → T.obj X) (x : X) := (α x).2 +@[expose] def p {X : Type} (α : X → T.obj X) (x : X) := (α x).2 /-- Edge relation induced by `p`. -/ -def edge {X : Type} (α : X → T.obj X) (x y : X) : Prop := y ∈ p α x +@[expose] def edge {X : Type} (α : X → T.obj X) (x y : X) : Prop := y ∈ p α x /-- Definition of GL-split proof. -/ structure Proof where @@ -159,9 +159,9 @@ def Proof.toCoalgebra (𝕏 : Proof) : CategoryTheory.Endofunctor.Coalgebra T wh str := TypeCat.ofHom 𝕏.α /-- Auxiliary declaration used in the GL coalgebra development. -/ -def proves (𝕏 : Proof) (Δ : SplitSequent) : Prop := ∃ x : 𝕏.X, f (r 𝕏.α x) = Δ +@[expose] def proves (𝕏 : Proof) (Δ : SplitSequent) : Prop := ∃ x : 𝕏.X, f (r 𝕏.α x) = Δ /-- Auxiliary declaration used in the GL coalgebra development. -/ -def SplitSequent.isTrue (Δ : SplitSequent) : Prop := ∃ (𝕏 : Proof), proves 𝕏 Δ +@[expose] def SplitSequent.isTrue (Δ : SplitSequent) : Prop := ∃ (𝕏 : Proof), proves 𝕏 Δ /-- Auxiliary declaration used in the GL coalgebra development. -/ infixr:6 "⊢" => proves @@ -169,7 +169,7 @@ infixr:6 "⊢" => proves prefix:40 "⊢" => SplitSequent.isTrue /-- Auxiliary declaration used in the GL coalgebra development. -/ -def equiv (φ : Formula) (ψ : Formula) : Prop := +@[expose] def equiv (φ : Formula) (ψ : Formula) : Prop := (∃ (𝕏 : Proof), 𝕏 ⊢ {Sum.inl (~ψ), Sum.inr φ}) ∧ (∃ (𝕏 : Proof), 𝕏 ⊢ {Sum.inr ψ, Sum.inl (~φ)}) /-- Auxiliary declaration used in the GL coalgebra development. -/ @@ -287,7 +287,7 @@ lemma path_in_FL {𝕏 : Proof} {x y : 𝕏.X} (x_y : Relation.ReflTransGen (edg (fun _ z_in ↦ Relation.ReflTransGen.tail y.2 z_in)⟩ /-- Point Generated Split Proof. -/ -def pointGeneratedProof (𝕐 : Proof) (x : 𝕐.X) : Proof where +@[expose] def pointGeneratedProof (𝕐 : Proof) (x : 𝕐.X) : Proof where X := {y : 𝕐.X // Relation.ReflTransGen (edge 𝕐.α) x y } α := αPoint 𝕐 x step := by @@ -471,7 +471,7 @@ lemma exists_box_on_loop {𝕏 : Proof} (x : 𝕏.X) : Relation.TransGen (edge fun x_x ↦ exists_box_on_le_path x x x_x (by simp) /-- Edge relation restricted to nodes satisfying predicate `p`. -/ -def edgeRestr {𝕏 : Proof} (p : 𝕏.X → Prop) : 𝕏.X → 𝕏.X → Prop := +@[expose] def edgeRestr {𝕏 : Proof} (p : 𝕏.X → Prop) : 𝕏.X → 𝕏.X → Prop := fun x y ↦ edge 𝕏.α x y ∧ p x ∧ p y /-- Every restricted path of increasing size has a box rule application. -/ diff --git a/LeanPool/Lean4GlCoalgebras/Split/ProofTransformations.lean b/LeanPool/Lean4GlCoalgebras/Split/ProofTransformations.lean index 12e1f20035..3e1da0457b 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/ProofTransformations.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/ProofTransformations.lean @@ -21,7 +21,7 @@ Here we define the GL-ext+pre system. This system is different from the paper, w how we connect non-axiomatic leaf nodes into `RuleApp` directly. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras @@ -52,7 +52,7 @@ inductive RuleApp {𝕏 : Split.Proof} (x : 𝕏.X) (τ : 𝕏.X → SplitSequen | boxᵣ : (Δ : SplitSequent) → (A : Formula) → Sum.inr (□ A) ∈ Δ → RuleApp x τ /-- Given a RuleApp, obtain the principal formulas. -/ -def fₚ {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : RuleApp x τ → SplitSequent +@[expose] def fₚ {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : RuleApp x τ → SplitSequent | RuleApp.pre _ _ => ∅ | RuleApp.cutₗ _ _ => ∅ | RuleApp.cutᵣ _ _ => ∅ @@ -72,7 +72,7 @@ def fₚ {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : Rule | RuleApp.boxᵣ _ A _ => {Sum.inr (□ A)} /-- Given a RuleApp, obtain the split sequent. -/ -def f {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : RuleApp x τ → SplitSequent +@[expose] def f {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} : RuleApp x τ → SplitSequent | RuleApp.pre y _ => τ y | RuleApp.cutₗ Δ _ => Δ | RuleApp.cutᵣ Δ _ => Δ @@ -119,7 +119,7 @@ lemma fₙ_alternate {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSeq universe u /-- Auxiliary declaration used in the GL coalgebra development. -/ -@[simp] def T {𝕏 : Split.Proof} (x : 𝕏.X) (τ : 𝕏.X → SplitSequent) : +@[expose, simp] def T {𝕏 : Split.Proof} (x : 𝕏.X) (τ : 𝕏.X → SplitSequent) : CategoryTheory.Functor Type Type := { obj := fun X ↦ ((RuleApp x τ × List X) : Type) map := fun {X Y} f ↦ @@ -130,25 +130,25 @@ universe u map_comp := by aesop_cat } /-- Get RuleApp of a node (first projection). -/ -def r {X : Type} {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} +@[expose] def r {X : Type} {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} (α : X → (T x τ).obj X) (x : X) := (α x).1 /-- Get premises of a node (second projection). -/ -def p {X : Type} {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} +@[expose] def p {X : Type} {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} (α : X → (T x τ).obj X) (x : X) := (α x).2 /-- Edge relation induced by `p`. -/ -def edge {X : Type} {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} +@[expose] def edge {X : Type} {𝕏 : Split.Proof} {x : 𝕏.X} {τ : 𝕏.X → SplitSequent} (α : X → (T x τ).obj X) (x y : X) : Prop := y ∈ p α x /-- Auxiliary declaration used in the GL coalgebra development. -/ -def RuleApp.isBox {𝕏 : Split.Proof} {x : 𝕏.X} {τ} : RuleApp x τ → Prop +@[expose] def RuleApp.isBox {𝕏 : Split.Proof} {x : 𝕏.X} {τ} : RuleApp x τ → Prop | RuleApp.boxₗ _ _ _ => true | RuleApp.boxᵣ _ _ _ => true | _ => false /-- Auxiliary declaration used in the GL coalgebra development. -/ -def RuleApp.isNonAxLeaf {𝕏 : Split.Proof} {x : 𝕏.X} {τ} : RuleApp x τ → Prop +@[expose] def RuleApp.isNonAxLeaf {𝕏 : Split.Proof} {x : 𝕏.X} {τ} : RuleApp x τ → Prop | RuleApp.pre _ _ => true | _ => false @@ -197,7 +197,7 @@ structure PreProof {𝕏 : Split.Proof} (x : 𝕏.X) (τ : 𝕏.X → SplitSeque ∀ n, ∃ m, (r α (f.1 (n + m))).isBox /-- Auxiliary declaration used in the GL coalgebra development. -/ -def Proves {𝕏 : Split.Proof} (x : 𝕏.X) {σ} (𝕐 : PreProof x σ) +@[expose] def Proves {𝕏 : Split.Proof} (x : 𝕏.X) {σ} (𝕐 : PreProof x σ) (Δ : SplitSequent) : Prop := f (r 𝕐.α 𝕐.root) = Δ end Ext @@ -872,7 +872,7 @@ private theorem proofTransformation_path {𝕏 : Proof} {σ} known /-- Provides the proof transformation from local pre-proofs and its path witnesses. -/ -noncomputable def proofTransformation {𝕏 : Proof} {σ} +@[expose] noncomputable def proofTransformation {𝕏 : Proof} {σ} (partialProof : (x : 𝕏.X) → Ext.PreProof x σ) (root_prop : ∀ x, Ext.Proves x (partialProof x) (σ x)) (box_prop : ∀ x, (r 𝕏.α x).isBox → diff --git a/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean b/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean index 37b9f00f71..e65c5f3667 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.Pow /-! ## Soundness of GL-split proof system. -/ -@[expose] public section +public section namespace Lean4GlCoalgebras diff --git a/LeanPool/Lean4Itree.lean b/LeanPool/Lean4Itree.lean index 34f9cbcc7c..8bd38e9660 100644 --- a/LeanPool/Lean4Itree.lean +++ b/LeanPool/Lean4Itree.lean @@ -19,4 +19,4 @@ Tags: coinduction, interaction-trees, monads, qpf, semantics MSC: 68Q55, 18C50, 68N18 -/ -@[expose] public section +public section diff --git a/LeanPool/Lean4Itree/ITree.lean b/LeanPool/Lean4Itree/ITree.lean index cdd486f776..755b6255f2 100644 --- a/LeanPool/Lean4Itree/ITree.lean +++ b/LeanPool/Lean4Itree/ITree.lean @@ -19,4 +19,4 @@ coinductive definition and bisimulation (`Basic`), supporting utilities interpretation combinators (`EffectAlgebra`). -/ -@[expose] public section +public section diff --git a/LeanPool/Lean4Itree/ITree/Basic.lean b/LeanPool/Lean4Itree/ITree/Basic.lean index eaa7c1baa5..bb8e9bdb9a 100644 --- a/LeanPool/Lean4Itree/ITree/Basic.lean +++ b/LeanPool/Lean4Itree/ITree/Basic.lean @@ -17,7 +17,7 @@ injectivity lemmas for the constructors, and the bisimulation equality `IEq` that is proven to coincide with propositional equality (`ieq_iff_eq`). -/ -@[expose] public section +public section namespace Lean4Itree @@ -33,14 +33,14 @@ inductive ITree.shape (ε : Type u1 → Type v) (ρ : Type u2) /-- The arity (`B`-component) of each interaction-tree node shape: a `ret` node has no children, a `tau` node has one, and a `vis α e` node has one child per inhabitant of the response type `α`. -/ -def ITree.children {ε : Type u1 → Type v} {ρ : Type u2} +@[expose] def ITree.children {ε : Type u1 → Type v} {ρ : Type u2} : ITree.shape ε ρ → Type u1 | .ret _ => ULift (Fin2 0) | .tau => ULift (Fin2 1) | .vis α _ => α /-- The interaction-tree polynomial functor, packaging `shape` and `children`. -/ -def ITree.P (ε : Type u1 → Type v) (ρ : Type u2) : PFunctor := +@[expose] def ITree.P (ε : Type u1 → Type v) (ρ : Type u2) : PFunctor := ⟨ITree.shape ε ρ, ITree.children⟩ /-- @@ -53,7 +53,7 @@ coinductive ITree (ε : Type → Type) (ρ : Type) | vis {α : Type} (e : ε α) (k : α → ITree ε ρ) ``` -/ -def ITree (ε : Type u1 → Type v) (ρ : Type u2) := +@[expose] def ITree (ε : Type u1 → Type v) (ρ : Type u2) := (ITree.P ε ρ).M /-- A continuation tree: a function from `α` into interaction trees, i.e. a @@ -74,18 +74,18 @@ section variable {X : Type u} /-- One layer of a `ret` node in the polynomial functor: returns the value `v`. -/ -@[simp] +@[expose, simp] def ret' (v : ρ) : P ε ρ X := .mk (.ret v) elim0 /-- One layer of a `tau` node in the polynomial functor: a single silent child `t`. -/ -@[simp] +@[expose, simp] def tau' (t : X) : P ε ρ X := .mk .tau (fin1Const t) /-- One layer of a `vis` node in the polynomial functor: an effect `e` with continuation `k` indexed by the response type. -/ -@[simp] +@[expose, simp] def vis' {α : Type u1} (e : ε α) (k : α → X) : P ε ρ X := .mk (.vis α e) (k ·) @@ -94,12 +94,12 @@ end /- Type Constructors -/ /-- The interaction tree that immediately returns the value `v`. -/ -@[match_pattern, simp] +@[expose, match_pattern, simp] def ret (v : ρ) : ITree ε ρ := .mk <| ret' v /-- The interaction tree that takes one silent `tau` step into `t`. -/ -@[match_pattern, simp] +@[expose, match_pattern, simp] def tau (t : ITree ε ρ) : ITree ε ρ := .mk <| tau' t @@ -110,7 +110,7 @@ def tauN (n : Nat) (t : ITree ε ρ) : ITree ε ρ := | n + 1 => tau (tauN n t) /-- The interaction tree that performs the effect `e` and continues with `k`. -/ -@[match_pattern, simp] +@[expose, match_pattern, simp] def vis {α : Type u1} (e : ε α) (k : α → ITree ε ρ) : ITree ε ρ := .mk <| vis' e k @@ -283,6 +283,7 @@ theorem IEqF_monotone sim sim' (hsim : ∀ (t1 t2 : ITree ε ρ), sim t1 t2 → rename_i h _; apply h /-- Custom equality predicate between ITrees -/ +@[expose] def IEq (t1 t2 : ITree ε ρ) : Prop := IEqF IEq t1 t2 coinductive_fixpoint monotonicity fun sim' sim hsim => diff --git a/LeanPool/Lean4Itree/ITree/EffectAlgebra.lean b/LeanPool/Lean4Itree/ITree/EffectAlgebra.lean index c053e2cf9d..f48344b9c7 100644 --- a/LeanPool/Lean4Itree/ITree/EffectAlgebra.lean +++ b/LeanPool/Lean4Itree/ITree/EffectAlgebra.lean @@ -17,7 +17,7 @@ and sum effects (`VoidE`, `SumE`), the `MonadIter` class of iterable monads, the against an effect handler into an arbitrary iterable monad. -/ -@[expose] public section +public section namespace Lean4Itree diff --git a/LeanPool/Lean4Itree/ITree/Monad.lean b/LeanPool/Lean4Itree/ITree/Monad.lean index 26d8125b84..cf01b839dc 100644 --- a/LeanPool/Lean4Itree/ITree/Monad.lean +++ b/LeanPool/Lean4Itree/ITree/Monad.lean @@ -18,7 +18,7 @@ This module equips `ITree` with its functor and monad operations (`map`, `bind`, `bind_assoc`, using the parameterized-coinduction (Paco) tactics. -/ -@[expose] public section +public section namespace Lean4Itree diff --git a/LeanPool/Lean4Itree/ITree/Utils.lean b/LeanPool/Lean4Itree/ITree/Utils.lean index d43c9f0c68..9c598f5151 100644 --- a/LeanPool/Lean4Itree/ITree/Utils.lean +++ b/LeanPool/Lean4Itree/ITree/Utils.lean @@ -10,7 +10,7 @@ public import Mathlib.Data.PFunctor.Univariate.M /-! # ----------------------------------------------------------------------- -/ -@[expose] public section +public section /-! # --------------------Start Vector3 Utilities---------------------------- -/ /-! # ----------------------------------------------------------------------- -/ @@ -27,6 +27,7 @@ def elim0 {α : Sort u} (i : ULift (Fin2 0)) : α := i.down.elim0 (C := fun _ => α) /-- The constant function `ULift (Fin2 1) → α` returning `v` at the unique index. -/ +@[expose] def fin1Const {α} (v : α) := fun (i : ULift (Fin2 1)) => match i.down with | .ofNat' 0 => v diff --git a/LeanPool/Lean4Itree/Paco.lean b/LeanPool/Lean4Itree/Paco.lean index cb883aac09..02f192cf90 100644 --- a/LeanPool/Lean4Itree/Paco.lean +++ b/LeanPool/Lean4Itree/Paco.lean @@ -18,4 +18,4 @@ the parameterized least fixed point `plfp` and its accumulation principle (`Paco`). -/ -@[expose] public section +public section diff --git a/LeanPool/Lean4Itree/Paco/Paco.lean b/LeanPool/Lean4Itree/Paco/Paco.lean index 98aca39e50..b90b524b20 100644 --- a/LeanPool/Lean4Itree/Paco/Paco.lean +++ b/LeanPool/Lean4Itree/Paco/Paco.lean @@ -18,4 +18,4 @@ development are declared there with a `ₚ` suffix to avoid clashing with the into scope. -/ -@[expose] public section +public section diff --git a/LeanPool/Lean4Itree/Paco/PacoDefs.lean b/LeanPool/Lean4Itree/Paco/PacoDefs.lean index 090a28170e..d90ea3d30b 100644 --- a/LeanPool/Lean4Itree/Paco/PacoDefs.lean +++ b/LeanPool/Lean4Itree/Paco/PacoDefs.lean @@ -9,7 +9,7 @@ import all Init.Internal.Order.Basic import Std.Data.DTreeMap.Internal.Balancing import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section namespace Lean.Order.CompleteLattice diff --git a/LeanPool/LeanBooleanfun.lean b/LeanPool/LeanBooleanfun.lean index 942478f678..dcf4ee990a 100644 --- a/LeanPool/LeanBooleanfun.lean +++ b/LeanPool/LeanBooleanfun.lean @@ -22,7 +22,7 @@ Tags: boolean-functions, fourier-analysis, social-choice MSC: 06E30, 42C10, 91B14 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/LeanBooleanfun/Arrow.lean b/LeanPool/LeanBooleanfun/Arrow.lean index d0ab8de04e..5f2d8f31a8 100644 --- a/LeanPool/LeanBooleanfun/Arrow.lean +++ b/LeanPool/LeanBooleanfun/Arrow.lean @@ -30,7 +30,7 @@ This is mainly facilitated by introducing an auxiliary linear operator, see `_Tn * [R. O'Donnell, *Analysis of Boolean functions*][odonnell2014] -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanBooleanfun/AuxLemmas.lean b/LeanPool/LeanBooleanfun/AuxLemmas.lean index 6188e13103..179dfb06fd 100644 --- a/LeanPool/LeanBooleanfun/AuxLemmas.lean +++ b/LeanPool/LeanBooleanfun/AuxLemmas.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.BigOperators.Group.Finset.Basic General lemmas not specific to analysis of Boolean functions. -/ -@[expose] public section +public section namespace LeanPool.LeanBooleanfun.BooleanFun diff --git a/LeanPool/LeanBooleanfun/Basic.lean b/LeanPool/LeanBooleanfun/Basic.lean index 663d8699f1..4c6596a763 100644 --- a/LeanPool/LeanBooleanfun/Basic.lean +++ b/LeanPool/LeanBooleanfun/Basic.lean @@ -43,7 +43,7 @@ conventions in the context of Boolean functions, and the simplicity of working w * `⋆` denotes convolution -/ -@[expose] public section +public section namespace LeanPool.LeanBooleanfun.BooleanFun @@ -79,7 +79,7 @@ lemma sum_translate (a : Fin n → Fin 2) : ∑ x, f x = ∑ x, f (x + a) := by /-- The expectation of a Boolean function is its average value with respect to the uniform probability measure on `Fin n → Fin 2`. -/ -def expectation : BooleanFunc n →ₗ[ℝ] ℝ where +@[expose] def expectation : BooleanFunc n →ₗ[ℝ] ℝ where toFun := fun f ↦ (1 / 2) ^ n * ∑ i, f i map_add' := by intro f g @@ -235,9 +235,9 @@ theorem walsh_mul_eq : χ S * χ S' = χ (symmDiff S S') := by intro _ ha _ _ _ _ h simp_all -lemma inner_eq_expectation : ⟪f, g⟫ = 𝐄 (f * g) := rfl +lemma inner_eq_expectation : ⟪f, g⟫ = 𝐄 (f * g) := by rfl -lemma fourier_eq_inner : 𝓕 f S = ⟪χ S, f⟫ := rfl +lemma fourier_eq_inner : 𝓕 f S = ⟪χ S, f⟫ := by rfl /-- Flip the `i₀`th bit of `x`. -/ def flipAt (i₀ : Fin n) (x : Fin n → Fin 2) : Fin n → Fin 2 := diff --git a/LeanPool/LeanBooleanfun/BooleanValued.lean b/LeanPool/LeanBooleanfun/BooleanValued.lean index 4fb8d2e6f0..d5143240a5 100644 --- a/LeanPool/LeanBooleanfun/BooleanValued.lean +++ b/LeanPool/LeanBooleanfun/BooleanValued.lean @@ -19,7 +19,7 @@ and proves some basic properties specific to Boolean-valued functions. * `almost_character` -- a theorem on BLR linearity testing -/ -@[expose] public section +public section noncomputable section @@ -165,7 +165,7 @@ lemma eq_character_of_eq_sum_degree_one (hn : n > 0) have : ∀ i, 𝓕 g {i} = 𝓕 f {i₀.succAbove i} := by intro i calc - _ = ⟪χ {i}, g⟫ := by rfl + _ = ⟪χ {i}, g⟫ := by rw [fourier_eq_inner] _ = ⟪χ {i}, ∑ i, 𝓕 f {i₀.succAbove i} • χ {i}⟫ := by rw [hgeq] _ = ∑ i', 𝓕 f {i₀.succAbove i'} * ⟪χ {i}, χ {i'}⟫ := by rw [inner_sum]; conv => enter[1, 2, i']; rw [inner_smul_right] diff --git a/LeanPool/LeanBooleanfun/ToMathlib.lean b/LeanPool/LeanBooleanfun/ToMathlib.lean index e78b4c7ae1..5aaeb1064e 100644 --- a/LeanPool/LeanBooleanfun/ToMathlib.lean +++ b/LeanPool/LeanBooleanfun/ToMathlib.lean @@ -15,4 +15,4 @@ This index aggregates small auxiliary results that are not specific to Boolean functions and could plausibly live in Mathlib. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanBooleanfun/ToMathlib/Finset.lean b/LeanPool/LeanBooleanfun/ToMathlib/Finset.lean index 7a7f35200e..730aa1a145 100644 --- a/LeanPool/LeanBooleanfun/ToMathlib/Finset.lean +++ b/LeanPool/LeanBooleanfun/ToMathlib/Finset.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Bound.Init Small helper lemmas about `Finset` that are not specific to Boolean functions. -/ -@[expose] public section +public section namespace Finset diff --git a/LeanPool/LeanComplexAnalysis.lean b/LeanPool/LeanComplexAnalysis.lean index c9dd064fad..75ec652854 100644 --- a/LeanPool/LeanComplexAnalysis.lean +++ b/LeanPool/LeanComplexAnalysis.lean @@ -22,7 +22,7 @@ Tags: complex-analysis, harmonic-functions, poisson-integral, univalent-function MSC: 30A99, 31A05, 30C55 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/LeanComplexAnalysis/Harmonic.lean b/LeanPool/LeanComplexAnalysis/Harmonic.lean index 4b638beff1..b75265843f 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic.lean @@ -19,4 +19,4 @@ including Poisson integral formulas on the unit disc and arbitrary centered disc results about positive harmonic functions on the unit disc. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral.lean b/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral.lean index 7328a40da3..af35a6b661 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral.lean @@ -52,7 +52,7 @@ The proof follows from the harmonic function, Poisson integral, analytic function, unit disc -/ -@[expose] public section +public section namespace LeanPool.LeanComplexAnalysis diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral2.lean b/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral2.lean index 8dcd485bcd..54860bca1c 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral2.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegral2.lean @@ -53,7 +53,7 @@ The proof follows from ℂ-differentiable function, harmonic function, Poisson integral. -/ -@[expose] public section +public section open Complex Metric Real Set diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegralCircleAverage.lean b/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegralCircleAverage.lean index 27d872b0e7..d90fe8aedb 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegralCircleAverage.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/PoissonIntegralCircleAverage.lean @@ -18,4 +18,4 @@ circle-average versions of the scaled-disc Poisson integral formulas. In this Le those declarations are provided by `LeanPool.LeanComplexAnalysis.Harmonic.PoissonIntegral2`. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/Positive.lean b/LeanPool/LeanComplexAnalysis/Harmonic/Positive.lean index 6545c89c54..c3dde20bf1 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/Positive.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/Positive.lean @@ -18,4 +18,4 @@ including Harnack's inequality and the Herglotz–Riesz representation theorem (existence and uniqueness). -/ -@[expose] public section +public section diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HarnackIneq.lean b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HarnackIneq.lean index eb7bfed1ab..44a60c2bca 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HarnackIneq.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HarnackIneq.lean @@ -23,7 +23,7 @@ A positive harmonic function `u` on the unit disc satisfies the inequalities for all `z` in the unit disc. -/ -@[expose] public section +public section namespace LeanPool.LeanComplexAnalysis diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean index 9d3fef8852..ad56fca2ad 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean @@ -71,7 +71,7 @@ Herglotz theorem, Herglotz–Riesz theorem, Poisson integral, positive harmonic positive real part, unit disc -/ -@[expose] public section +public section namespace LeanPool.LeanComplexAnalysis diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszUnique.lean b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszUnique.lean index f9c788f8a7..95ceb7ef96 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszUnique.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszUnique.lean @@ -22,7 +22,7 @@ the two functions ∫ x, (x + z) / (x - z) ∂μ₁ and ∫ x, (x + z) / (x - z) identical on the unit disc, then `μ₁` = `μ₂`. -/ -@[expose] public section +public section namespace LeanPool.LeanComplexAnalysis diff --git a/LeanPool/LeanComplexAnalysis/UnivalentFunctions.lean b/LeanPool/LeanComplexAnalysis/UnivalentFunctions.lean index 8d9b96382b..aa1f991a20 100644 --- a/LeanPool/LeanComplexAnalysis/UnivalentFunctions.lean +++ b/LeanPool/LeanComplexAnalysis/UnivalentFunctions.lean @@ -17,4 +17,4 @@ unit disc, including the classes `S` and `Σ`, the square-root transform of clas and the connection between them. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean b/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean index 353edf9122..bf0b3ba9e4 100644 --- a/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean +++ b/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean @@ -25,7 +25,7 @@ univalent functions on the exterior of the closed unit disk with the expansion - If `f` is in `classS`, then `g(z) = 1/f(1/z)` is in `classSigma`; `inv_f_inv_in_Sigma`. -/ -@[expose] public section +public section namespace LeanPool.LeanComplexAnalysis diff --git a/LeanPool/LeanModelChecking.lean b/LeanPool/LeanModelChecking.lean index 2eb56a08bc..47fc591eed 100644 --- a/LeanPool/LeanModelChecking.lean +++ b/LeanPool/LeanModelChecking.lean @@ -26,4 +26,4 @@ Tags: model-checking, linear-temporal-logic, buchi-automaton, safety-liveness, o MSC: 68Q60, 03B44, 68Q45 -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModelChecking/ABW.lean b/LeanPool/LeanModelChecking/ABW.lean index 5a2977b8b6..485b8eaa8b 100644 --- a/LeanPool/LeanModelChecking/ABW.lean +++ b/LeanPool/LeanModelChecking/ABW.lean @@ -16,7 +16,7 @@ We define positive Boolean formulas (`PositiveBool`), alternating Büchi automat (`ABW`), their run DAGs (`RunDAG`), and the language they accept. -/ -@[expose] public section +public section namespace LeanModelChecking @@ -31,7 +31,7 @@ inductive PositiveBool (Q : Type) where /-- `PositiveBool.Sat Y f` holds when the set `Y` of atoms satisfies the positive Boolean formula `f` (reading atoms as "is a member of `Y`"). -/ -def PositiveBool.Sat {Q} (Y : Set Q) : PositiveBool Q → Prop +@[expose] def PositiveBool.Sat {Q} (Y : Set Q) : PositiveBool Q → Prop | atom q => q ∈ Y | true => True | false => False @@ -66,7 +66,7 @@ structure DAG Q extends DAG.Base Q where edge_closure : ∀ e ∈ E, e.1 ∈ V ∧ (e.2, e.1.2 + 1) ∈ V /-- Infinite path, with an arbitrary starting level. -/ -def DAG.path {Q} (G : DAG Q) (p : ℕ → Q) := +@[expose] def DAG.path {Q} (G : DAG Q) (p : ℕ → Q) := ∃ n, ∀ i, ((p i, n + i), p (i + 1)) ∈ G.E /-- A run DAG of the automaton `A` on the word `w`: a `DAG` rooted at the initial @@ -83,11 +83,11 @@ structure RunDAG {S Q} (A : ABW S Q) (w : ℕ → S) extends DAG Q where /-- A run DAG is accepting when every infinite path through it visits an accepting state infinitely often. -/ -def RunDAG.accepting {S Q} {A : ABW S Q} {w : ℕ → S} (G : RunDAG A w) := +@[expose] def RunDAG.accepting {S Q} {A : ABW S Q} {w : ℕ → S} (G : RunDAG A w) := ∀ p, G.path p → ∀ i, ∃ j ≥ i, p j ∈ A.F /-- The automaton `A` accepts the word `w` when it admits an accepting run DAG. -/ -def ABW.language {S Q} (A : ABW S Q) (w : Nat → S) := +@[expose] def ABW.language {S Q} (A : ABW S Q) (w : Nat → S) := ∃ (G : RunDAG A w), G.accepting end LeanModelChecking diff --git a/LeanPool/LeanModelChecking/ABWNBW.lean b/LeanPool/LeanModelChecking/ABWNBW.lean index b9dce935e8..2ceed9a56a 100644 --- a/LeanPool/LeanModelChecking/ABWNBW.lean +++ b/LeanPool/LeanModelChecking/ABWNBW.lean @@ -22,14 +22,14 @@ Miyano–Hayashi breakpoint construction (`ABW.toNBW`), and prove `ABW.toNBW.lang_eq`. -/ -@[expose] public section +public section namespace LeanModelChecking /-- The nondeterministic Büchi automaton obtained from an alternating one `A` by the Miyano–Hayashi breakpoint construction: states are pairs `(X, W)` of a current set `X` and an "obligation" set `W` of states still owing a visit to `A.F`. -/ -def ABW.toNBW {S Q} (A : ABW S Q) : NBW S := { +@[expose] def ABW.toNBW {S Q} (A : ABW S Q) : NBW S := { Q := (Set Q) × (Set Q) q₀ := {({A.q₀}, ∅)} δ := fun (X, W) s (X', W') => diff --git a/LeanPool/LeanModelChecking/LTLNBWResult.lean b/LeanPool/LeanModelChecking/LTLNBWResult.lean index 812297b702..bd9ea946b8 100644 --- a/LeanPool/LeanModelChecking/LTLNBWResult.lean +++ b/LeanPool/LeanModelChecking/LTLNBWResult.lean @@ -28,7 +28,7 @@ the (negation normal form of the) input formula, and the Miyano–Hayashi breakpoint construction squares that state space to pairs of subsets. -/ -@[expose] public section +public section namespace LeanModelChecking diff --git a/LeanPool/LeanModelChecking/LTLNBWStatement.lean b/LeanPool/LeanModelChecking/LTLNBWStatement.lean index f70a62f7a6..26bdb3e790 100644 --- a/LeanPool/LeanModelChecking/LTLNBWStatement.lean +++ b/LeanPool/LeanModelChecking/LTLNBWStatement.lean @@ -17,7 +17,7 @@ of nondeterministic Büchi automata (`NBW`), and state the theorem that every `LTL` formula has an equivalent finite-state `NBW`. -/ -@[expose] public section +public section namespace LeanModelChecking @@ -34,7 +34,7 @@ abbrev Letter (AP : Type) := Set AP /-- The language of a Linear Temporal Logic formula, defined as a predicate over a word. -/ -def LTL.language {AP} (f : LTL AP) (w : ℕ → Letter AP) : Prop := +@[expose] def LTL.language {AP} (f : LTL AP) (w : ℕ → Letter AP) : Prop := match f with | .atom p => p ∈ w 0 | .not φ => ¬language φ w @@ -58,12 +58,12 @@ structure NBW (S : Type) where /-- Whether the sequence of states `p` is a run on the word `w` on the Büchi automaton `A`. -/ -def NBW.run {S} (A : NBW S) (p : ℕ → A.Q) (w : ℕ → S) := +@[expose] def NBW.run {S} (A : NBW S) (p : ℕ → A.Q) (w : ℕ → S) := p 0 ∈ A.q₀ ∧ ∀ i, A.δ (p i) (w i) (p (i + 1)) /-- The language of a Büchi automaton, defined as a predicate over a word. -/ -def NBW.language {S} (A : NBW S) (w : ℕ → S) := +@[expose] def NBW.language {S} (A : NBW S) (w : ℕ → S) := ∃ p, A.run p w ∧ ∀ i, ∃ j ≥ i, p j ∈ A.F /-- The statement that every Linear Temporal Logic formula has an equivalent @@ -71,7 +71,7 @@ def NBW.language {S} (A : NBW S) (w : ℕ → S) := can be reused. Without the `Finite A.Q` conjunct the statement would be much weaker, since an automaton with infinitely many states can encode arbitrary languages. -/ -def forAnyLTLFormulaExistsAnEquivalentNBWStatement := +@[expose] def forAnyLTLFormulaExistsAnEquivalentNBWStatement := ∀ {AP} (φ : LTL AP), ∃ (A : NBW (Letter AP)), Finite A.Q ∧ φ.language = A.language end LeanModelChecking diff --git a/LeanPool/LeanModelChecking/LTLNNF.lean b/LeanPool/LeanModelChecking/LTLNNF.lean index 0485058568..2e252454aa 100644 --- a/LeanPool/LeanModelChecking/LTLNNF.lean +++ b/LeanPool/LeanModelChecking/LTLNNF.lean @@ -19,7 +19,7 @@ We define negation normal form (NNF) formulas, their language, and a translation `LTL.exists_equiv_nnf` shows every `LTL` formula has an equivalent NNF formula. -/ -@[expose] public section +public section namespace LeanModelChecking @@ -38,7 +38,7 @@ deriving DecidableEq /-- The language of an NNF formula: the predicate on infinite words `w` that holds exactly when `w` satisfies `f` at position `0`. -/ -def NNF.language {AP} (f : NNF AP) (w : Nat → Letter AP) : Prop := +@[expose] def NNF.language {AP} (f : NNF AP) (w : Nat → Letter AP) : Prop := match f with | .atom p => p ∈ w 0 | .not_atom p => p ∉ w 0 diff --git a/LeanPool/LeanModelChecking/NNFABW.lean b/LeanPool/LeanModelChecking/NNFABW.lean index 099637aea1..5c998d344a 100644 --- a/LeanPool/LeanModelChecking/NNFABW.lean +++ b/LeanPool/LeanModelChecking/NNFABW.lean @@ -20,7 +20,7 @@ We construct, for every negation normal form formula, an alternating Büchi automaton (`ABW`) accepting the same language, establishing `exists_ABW_lang_for_LTL`. -/ -@[expose] public section +public section namespace LeanModelChecking diff --git a/LeanPool/LeanModelChecking/SafetyLivenessDecomposition.lean b/LeanPool/LeanModelChecking/SafetyLivenessDecomposition.lean index 8e92442886..3b8a26947b 100644 --- a/LeanPool/LeanModelChecking/SafetyLivenessDecomposition.lean +++ b/LeanPool/LeanModelChecking/SafetyLivenessDecomposition.lean @@ -21,7 +21,7 @@ We prove that every linear-time property decomposes as the intersection of a safety property and a liveness property, following Alpern and Schneider. -/ -@[expose] public section +public section namespace SafetyLivenessDecomposition diff --git a/LeanPool/LeanModularForms.lean b/LeanPool/LeanModularForms.lean index 9c6633470e..f9fc629942 100644 --- a/LeanPool/LeanModularForms.lean +++ b/LeanPool/LeanModularForms.lean @@ -197,4 +197,4 @@ Tags: modular-forms, complex-analysis, residue-theorem, valence-formula MSC: 11F11, 30E20 -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean b/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean index b263ad3441..9fe5ab026f 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean @@ -28,7 +28,7 @@ to reduce PV computation to a single crossing-local limit. ratio at the crossing tends to L -/ -@[expose] public section +public section open Set MeasureTheory Complex Filter diff --git a/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean b/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean index ee82c060d3..5e21346d68 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean @@ -28,7 +28,7 @@ On the far segments, the cutoff condition is satisfied so the integrand equals right integrals of `(γ t - s)⁻¹ * deriv γ t`, where the middle part is zero. -/ -@[expose] public section +public section open Set MeasureTheory Complex Filter intervalIntegral diff --git a/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean b/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean index 25191bdf78..38f0330f35 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean @@ -25,7 +25,7 @@ the total integral reduces to log(g(t₀-δ)) - log(g(t₀+δ)). to the log difference at the crossing boundary -/ -@[expose] public section +public section open Set MeasureTheory Complex open scoped Interval diff --git a/LeanPool/LeanModularForms/ContourIntegral/WindingNumber.lean b/LeanPool/LeanModularForms/ContourIntegral/WindingNumber.lean index 85ea43aedd..b2f3312dca 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/WindingNumber.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/WindingNumber.lean @@ -23,7 +23,7 @@ This is the final step shared by all winding number computations. * `gWN_eq_neg_sixth_of_pv_tendsto` — specialized: L = -πi/3 implies gWN = -1/6 -/ -@[expose] public section +public section open Complex diff --git a/LeanPool/LeanModularForms/ForMathlib/AtImInfty.lean b/LeanPool/LeanModularForms/ForMathlib/AtImInfty.lean index bc690b0df4..6b43d1d6e6 100644 --- a/LeanPool/LeanModularForms/ForMathlib/AtImInfty.lean +++ b/LeanPool/LeanModularForms/ForMathlib/AtImInfty.lean @@ -11,7 +11,7 @@ public import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty /-! # AtImInfty -/ -@[expose] public section +public section open UpperHalfPlane diff --git a/LeanPool/LeanModularForms/ForMathlib/Bounds.lean b/LeanPool/LeanModularForms/ForMathlib/Bounds.lean index 3597684b7f..8e48020c56 100644 --- a/LeanPool/LeanModularForms/ForMathlib/Bounds.lean +++ b/LeanPool/LeanModularForms/ForMathlib/Bounds.lean @@ -23,4 +23,4 @@ All of the lemmas formerly defined here (`truncatedFundamentalDomain`, the famil (GL (Fin 2) ℝ)`. This file is now a re-export to keep the historical import path working. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgroupsCopy.lean b/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgroupsCopy.lean index c1c44bed45..142b2154b7 100644 --- a/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgroupsCopy.lean +++ b/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgroupsCopy.lean @@ -20,7 +20,7 @@ companion and add only the genuinely-local extras (`mem_conjGL'`, to an arbitrary finite-index `Γ`). -/ -@[expose] public section +public section open ConjAct Matrix.SpecialLinearGroup Matrix ModularGroup CongruenceSubgroup diff --git a/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean b/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean index 68efc496d8..37b258b6e8 100644 --- a/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean +++ b/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean @@ -18,7 +18,7 @@ It also contains basic results about congruence subgroups. -/ -@[expose] public section +public section open Matrix.SpecialLinearGroup Matrix ModularGroup CongruenceSubgroup diff --git a/LeanPool/LeanModularForms/ForMathlib/FunctionsBoundedAtInfty.lean b/LeanPool/LeanModularForms/ForMathlib/FunctionsBoundedAtInfty.lean index 50dd74fa99..edba36bbf5 100644 --- a/LeanPool/LeanModularForms/ForMathlib/FunctionsBoundedAtInfty.lean +++ b/LeanPool/LeanModularForms/ForMathlib/FunctionsBoundedAtInfty.lean @@ -9,7 +9,7 @@ public import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty /-! # FunctionsBoundedAtInfty -/ -@[expose] public section +public section open UpperHalfPlane diff --git a/LeanPool/LeanModularForms/ForMathlib/Hassumunifon.lean b/LeanPool/LeanModularForms/ForMathlib/Hassumunifon.lean index 183082389c..bd5264e980 100644 --- a/LeanPool/LeanModularForms/ForMathlib/Hassumunifon.lean +++ b/LeanPool/LeanModularForms/ForMathlib/Hassumunifon.lean @@ -16,4 +16,4 @@ name) into Mathlib (`Mathlib.Analysis.Series.LocallyUniform`, `Mathlib.Analysis.Complex.LocallyUniformLimit`, etc.). The remaining purely-local helpers were not imported by any other file in this project, so we retire this file as a stub. The original lemmas remain in git history for reference. --/@[expose] public section +-/public section diff --git a/LeanPool/LeanModularForms/ForMathlib/Identities.lean b/LeanPool/LeanModularForms/ForMathlib/Identities.lean index ec1a116949..e8675a4302 100644 --- a/LeanPool/LeanModularForms/ForMathlib/Identities.lean +++ b/LeanPool/LeanModularForms/ForMathlib/Identities.lean @@ -14,7 +14,7 @@ public import LeanPool.LeanModularForms.ForMathlib.CongruenceSubgrps Collection of useful identities of modular forms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanModularForms/ForMathlib/Instances.lean b/LeanPool/LeanModularForms/ForMathlib/Instances.lean index d368542e17..18af8cdc67 100644 --- a/LeanPool/LeanModularForms/ForMathlib/Instances.lean +++ b/LeanPool/LeanModularForms/ForMathlib/Instances.lean @@ -22,7 +22,7 @@ We also provide `IsScalarTower ℝ ℂ ℂ` which was previously redeclared in several files with different proof terms. -/ -@[expose] public section +public section noncomputable instance instNormSMulClassRealComplex : NormSMulClass ℝ ℂ := NormedSpace.toNormSMulClass diff --git a/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean b/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean index a89385bc97..b488b2db43 100644 --- a/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean +++ b/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean @@ -22,4 +22,4 @@ All of the lemmas formerly defined here have been upstreamed into a re-export. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean b/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean index 6342d65a8e..78f8e29eca 100644 --- a/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean +++ b/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean @@ -25,4 +25,4 @@ TODO: Add finite-dimensionality of these spaces of modular forms. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/ForMathlib/Petersson.lean b/LeanPool/LeanModularForms/ForMathlib/Petersson.lean index fabff9e558..2c06e453c9 100644 --- a/LeanPool/LeanModularForms/ForMathlib/Petersson.lean +++ b/LeanPool/LeanModularForms/ForMathlib/Petersson.lean @@ -17,7 +17,7 @@ with `[Γ.HasDetOne]`, whereas the rest of this project still works with a `Γ : Subgroup SL(2, ℤ)`. We provide thin wrappers that translate the SL version into the GL one. -/ -@[expose] public section +public section open ModularForm Complex UpperHalfPlane MatrixGroups diff --git a/LeanPool/LeanModularForms/ForMathlib/QExpansion.lean b/LeanPool/LeanModularForms/ForMathlib/QExpansion.lean index 63012a270c..7dff4e38c9 100644 --- a/LeanPool/LeanModularForms/ForMathlib/QExpansion.lean +++ b/LeanPool/LeanModularForms/ForMathlib/QExpansion.lean @@ -19,7 +19,7 @@ variants that are parameterised by `Γ.width ∣ h` rather than `h ∈ Γ.strict the rest of the project still uses. -/ -@[expose] public section +public section open scoped Real NNReal MatrixGroups CongruenceSubgroup diff --git a/LeanPool/LeanModularForms/ForMathlib/SlashActions.lean b/LeanPool/LeanModularForms/ForMathlib/SlashActions.lean index 5214268ba7..9703cffcdd 100644 --- a/LeanPool/LeanModularForms/ForMathlib/SlashActions.lean +++ b/LeanPool/LeanModularForms/ForMathlib/SlashActions.lean @@ -14,7 +14,7 @@ public import Mathlib.NumberTheory.ModularForms.SlashActions /-! # SlashActions -/ -@[expose] public section +public section local notation "GL(" n ", " R ")" "⁺" => @Matrix.GLPos (Fin n) R (instDecidableEqFin n) diff --git a/LeanPool/LeanModularForms/ForMathlib/UpperHalfPlane.lean b/LeanPool/LeanModularForms/ForMathlib/UpperHalfPlane.lean index ff1d9747c3..0fa5fd9485 100644 --- a/LeanPool/LeanModularForms/ForMathlib/UpperHalfPlane.lean +++ b/LeanPool/LeanModularForms/ForMathlib/UpperHalfPlane.lean @@ -14,7 +14,7 @@ public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup /-! # UpperHalfPlane -/ -@[expose] public section +public section theorem ModularGroup.modular_S_sq : S * S = -1 := by diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean index dba9b9bb0f..9f4c9e899c 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean @@ -31,14 +31,14 @@ Used for computing winding numbers, distances, and derivatives along circular ar * `sin_pos_of_mem_Ioo_zero_pi` - sin is positive on (0, π) -/ -@[expose] public section +public section open Complex Real Set namespace ArcCalculus /-- Unit circle arc from angle θ₁ to θ₂, linearly parameterized on [a,b]. -/ -noncomputable def unitArc (θ₁ θ₂ a b : ℝ) (t : ℝ) : ℂ := +@[expose] noncomputable def unitArc (θ₁ θ₂ a b : ℝ) (t : ℝ) : ℂ := exp (↑(θ₁ + (t - a) / (b - a) * (θ₂ - θ₁)) * I) /-- Points on the unit arc have norm 1. -/ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean index fa1a3834ba..6ee53034ec 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean @@ -19,7 +19,7 @@ Core definitions for piecewise C¹ curves, Cauchy principal value integrals, and generalized winding numbers following Hungerbühler–Wasem. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -49,7 +49,7 @@ instance : CoeFun PiecewiseC1Curve fun _ => ℝ → ℂ where coe := PiecewiseC1Curve.toFun /-- A closed curve has γ(a) = γ(b). -/ -def PiecewiseC1Curve.IsClosed (γ : PiecewiseC1Curve) : Prop := +@[expose] def PiecewiseC1Curve.IsClosed (γ : PiecewiseC1Curve) : Prop := γ.toFun γ.a = γ.toFun γ.b /-- A piecewise C¹ immersion: a piecewise C¹ curve with nonzero derivative. -/ @@ -61,7 +61,7 @@ structure PiecewiseC1Immersion extends PiecewiseC1Curve where ∃ L : ℂ, L ≠ 0 ∧ Tendsto (deriv toFun) (𝓝[>] p) (𝓝 L) /-- The Cauchy principal value integrand at cutoff ε. -/ -def cauchyPrincipalValueIntegrand' (f : ℂ → ℂ) (γ : ℝ → ℂ) +@[expose] def cauchyPrincipalValueIntegrand' (f : ℂ → ℂ) (γ : ℝ → ℂ) (z₀ : ℂ) (ε : ℝ) (t : ℝ) : ℂ := if ‖γ t - z₀‖ > ε then f (γ t) * deriv γ t else 0 @@ -78,12 +78,12 @@ theorem cauchyPrincipalValueIntegrand'_of_le {f : ℂ → ℂ} {γ : ℝ → ℂ simp only [cauchyPrincipalValueIntegrand', show ¬(‖γ t - z₀‖ > ε) from not_lt.mpr h, ite_false] /-- The Cauchy principal value of ∮_γ f(z) dz, excluding ε-neighborhoods of z₀. -/ -def cauchyPrincipalValue' (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : ℂ := +@[expose] def cauchyPrincipalValue' (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : ℂ := limUnder (𝓝[>] (0 : ℝ)) fun ε => ∫ t in a..b, if ‖γ t - z₀‖ > ε then f (γ t) * deriv γ t else 0 /-- The Cauchy principal value exists if the limit exists. -/ -def CauchyPrincipalValueExists' (f : ℂ → ℂ) (γ : ℝ → ℂ) +@[expose] def CauchyPrincipalValueExists' (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : Prop := ∃ L : ℂ, Tendsto (fun ε => ∫ t in a..b, if ‖γ t - z₀‖ > ε then f (γ t) * deriv γ t else 0) @@ -91,7 +91,7 @@ def CauchyPrincipalValueExists' (f : ℂ → ℂ) (γ : ℝ → ℂ) /-- The generalized winding number of γ around z₀, defined via principal value. `n_{z₀}(γ) = (1/2πi) · PV ∮_γ dz/(z - z₀)`. -/ -def generalizedWindingNumber' (γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : ℂ := +@[expose] def generalizedWindingNumber' (γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : ℂ := (2 * Real.pi * I)⁻¹ * cauchyPrincipalValue' (·⁻¹) (fun t => γ t - z₀) a b 0 /-- Two curves are homotopic relative to endpoints. -/ @@ -103,7 +103,7 @@ def CurvesHomotopic (Γ γ : ℝ → ℂ) (a b : ℝ) : Prop := (∀ s ∈ Icc (0 : ℝ) 1, H (a, s) = H (a, 0) ∧ H (b, s) = H (b, 0)) /-- Homotopy avoiding a point z₀. -/ -def CurvesHomotopicAvoiding (Γ γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : Prop := +@[expose] def CurvesHomotopicAvoiding (Γ γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : Prop := ∃ H : ℝ × ℝ → ℂ, Continuous H ∧ (∀ t ∈ Icc a b, H (t, 0) = Γ t) ∧ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Bridges.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Bridges.lean index fc5439a4fa..fabe35c861 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Bridges.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Bridges.lean @@ -17,7 +17,7 @@ We provide `PiecewiseC1Curve.toPath` and `PiecewiseC1Curve.toContinuousMap` that rescale the domain `[a,b]` to the unit interval `[0,1]` via `iccHomeoI`. -/ -@[expose] public section +public section open Complex Set Topology unitInterval @@ -59,11 +59,11 @@ def toContinuousMap (γ : PiecewiseC1Curve) : C(I, ℂ) := /-- `toPath` agrees with the original curve under rescaling. -/ theorem toPath_apply (γ : PiecewiseC1Curve) (t : I) : - γ.toPath t = γ.toFun ((iccHomeoI γ.a γ.b γ.hab).symm t) := rfl + γ.toPath t = γ.toFun ((iccHomeoI γ.a γ.b γ.hab).symm t) := by rfl /-- `toContinuousMap` agrees with the original curve under rescaling. -/ theorem toContinuousMap_apply (γ : PiecewiseC1Curve) (t : I) : - γ.toContinuousMap t = γ.toFun ((iccHomeoI γ.a γ.b γ.hab).symm t) := rfl + γ.toContinuousMap t = γ.toFun ((iccHomeoI γ.a γ.b γ.hab).symm t) := by rfl /-- A closed `PiecewiseC1Curve` gives a loop, i.e., a `Path` from `γ(a)` to itself. -/ def toLoop (γ : PiecewiseC1Curve) (hc : γ.IsClosed) : diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean index 8015138d19..a916109c86 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean @@ -24,7 +24,7 @@ open set S via the segment integral F(z) = ∫₀¹ f(c + t(z-c))·(z-c) dt. * `holomorphic_convex_primitive` — holomorphic on convex open ⇒ has primitive -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CurveAvoidance.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CurveAvoidance.lean index efc4c1d277..86fcded7c3 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CurveAvoidance.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CurveAvoidance.lean @@ -30,7 +30,7 @@ and establishing slitPlane membership for shifted curves. * `curve_sub_in_slitPlane` - shifted curve lands in slitPlane -/ -@[expose] public section +public section open Set Complex Metric diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Cycle.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Cycle.lean index aed80350b4..42b99d9687 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Cycle.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Cycle.lean @@ -42,7 +42,7 @@ contour integration and winding numbers extended by linearity. * `windingNumberCycle_isInt` -- winding number integrality. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean index 5e1da128cf..b536b4f9ae 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean @@ -40,7 +40,7 @@ All proofs delegate to the machinery in `HomologicalCauchy.lean` and Theorem 3.3. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Finset Real open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy.lean index 9a1f4fc5f7..b1d734a088 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy.lean @@ -23,4 +23,4 @@ Barrel file re-exporting the three submodules: * `Meromorphic` — meromorphic contour integral vanishing, higher-order cancellation -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Basic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Basic.lean index a3c0479680..23b5d838ef 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Basic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Basic.lean @@ -34,7 +34,7 @@ condition required by the generalized residue theorem of Hungerbuhler-Wasem. is null-homologous (bridge lemma) -/ -@[expose] public section +public section open Complex Set Filter Topology MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean index 503dc26418..d10988c637 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean @@ -44,7 +44,7 @@ is exactly mathlib's `dslope f z w`. We use this identification throughout. * `contourIntegral_eq_zero_of_nullHomologous` -- vanishing for holomorphic functions -/ -@[expose] public section +public section open Complex Set Filter Topology MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean index 5cadf6dac0..5d9dd00ec2 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean @@ -40,7 +40,7 @@ zero residues vanish along null-homologous curves. PV residue sum convergence for null-homologous curves -/ -@[expose] public section +public section open Complex Set Filter Topology MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/CircleParam.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/CircleParam.lean index 9cfff5de58..bfcb899984 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/CircleParam.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/CircleParam.lean @@ -25,7 +25,7 @@ their winding number computations. * `circleParamCW_winding_eq_neg_one` — winding number = -1 -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean index 128ba45837..671c73a3ab 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean @@ -35,7 +35,7 @@ that winding numbers of closed curves avoiding a point are integers. an integer -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -50,7 +50,7 @@ Use this when working with closed piecewise-smooth curves; it is strictly stronger than `CurvesHomotopicAvoiding` (which handles open-endpoint curves fixed at `z₀`) but weaker than `ClosedCurvesHomotopicAvoiding` (which requires a globally continuous derivative without a partition). -/ -def PiecewiseCurvesHomotopicAvoiding (γ₀ γ₁ : ℝ → ℂ) +@[expose] def PiecewiseCurvesHomotopicAvoiding (γ₀ γ₁ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) (P : Finset ℝ) : Prop := ∃ H : ℝ × ℝ → ℂ, Continuous H ∧ @@ -80,7 +80,7 @@ the curves and homotopy are genuinely smooth; it implies `PiecewiseCurvesHomotopicAvoiding` (via `ClosedCurvesHomotopicAvoiding.toPiecewise`) but does **not** directly imply `CurvesHomotopicAvoiding`, which has a different endpoint condition (endpoints fixed at `z₀` rather than identified). -/ -def ClosedCurvesHomotopicAvoiding (γ₀ γ₁ : ℝ → ℂ) +@[expose] def ClosedCurvesHomotopicAvoiding (γ₀ γ₁ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) : Prop := ∃ H : ℝ × ℝ → ℂ, Continuous H ∧ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean index 814d30375f..5ed93f1047 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean @@ -31,7 +31,7 @@ smooth), plus the classical winding number formula for curves avoiding a point. homotopy for holomorphic integrands -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/MathlibBridge.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/MathlibBridge.lean index ceaf2493c6..9db97cd15b 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/MathlibBridge.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/MathlibBridge.lean @@ -39,7 +39,7 @@ which in turn equals `(2πi)⁻¹ * circleIntegral (· - w)⁻¹ c R`. equals 1, via mathlib's `integral_sub_inv_of_mem_ball` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean index a7c0aa15d5..1bb8dc8a1e 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean @@ -31,7 +31,7 @@ homotopy invariance of contour integrals. zero -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean index bf9dc5ee79..3b9c6862d5 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean @@ -29,7 +29,7 @@ generalizing the specific computations used in winding number calculations. Common.lean version) -/ -@[expose] public section +public section open Set MeasureTheory Complex open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean index d0f2ff5853..06693b693f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean @@ -23,7 +23,7 @@ measurability of cutout integrands, arc angle injectivity, CPV avoidance and concatenation lemmas. These results work for arbitrary curves and functions. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean index a439d7b817..5567960dd3 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean @@ -29,7 +29,7 @@ crossing points, used in the dyadic PV convergence proof. bound on singular annulus integral -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean index a4b0ce13c3..cccd774f41 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean @@ -25,7 +25,7 @@ used in the dyadic PV limit proof for principal value convergence. outside nbhd -/ -@[expose] public section +public section open Complex Set Filter Topology open scoped Real diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean index c9b324bb8a..cae1f4038c 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean @@ -26,7 +26,7 @@ The key result `remainder_bounded_of_C2` shows that the remainder * `quadratic_approx_of_contDiffAt_two` — quadratic Taylor approximation -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean index ed6d4113bb..768cb7d4c8 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean @@ -27,7 +27,7 @@ bound used in the dyadic PV convergence proof. * `singular_annulus_bound_explicit` — epsilon-independent bound on singular integral -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean index 219e5976ab..cdae718976 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean @@ -31,7 +31,7 @@ cutoff integrals converge along dyadic subsequences. integral -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -304,7 +304,7 @@ lemma exists_delta_for_error_bound {γ : ℝ → ℂ} hγ_cont_deriv ((1 / 2) ^ n) (by positivity) /-- An auxiliary summable subsequence used in the step-bound estimates. -/ -def summableSubseqAux {γ : ℝ → ℂ} {t₀ : ℝ} +@[expose] def summableSubseqAux {γ : ℝ → ℂ} {t₀ : ℝ} {L : ℂ} (hL : L ≠ 0) (hγ_hasderiv : HasDerivAt γ L t₀) (hγ_cont_deriv : ContinuousAt (deriv γ) t₀) @@ -326,7 +326,7 @@ lemma summableSubseqAux_zero {γ : ℝ → ℂ} hγ_cont_deriv δ₀ 0 = min δ₀ ((exists_delta_for_error_bound hL hγ_hasderiv hγ_cont_deriv 0).choose) / - 2 := rfl + 2 := by rfl lemma summableSubseqAux_succ {γ : ℝ → ℂ} {t₀ : ℝ} {L : ℂ} (hL : L ≠ 0) @@ -339,7 +339,7 @@ lemma summableSubseqAux_succ {γ : ℝ → ℂ} (exists_delta_for_error_bound hL hγ_hasderiv hγ_cont_deriv m).choose ε (n + 1) = - min (ε n / 2) (δ (n + 1)) / 2 := rfl + min (ε n / 2) (δ (n + 1)) / 2 := by rfl lemma summableSubseqAux_pos {γ : ℝ → ℂ} {t₀ : ℝ} {L : ℂ} (hL : L ≠ 0) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean index e85e19c66e..4cb84a534f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean @@ -28,7 +28,7 @@ annulus bound into a single epsilon-independent estimate. with epsilon-independent constant -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean index ce1ed0b958..66046fcfe1 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean @@ -27,7 +27,7 @@ consecutive segment defined by the partition. each consecutive interval [pᵢ, pᵢ₊₁] -/ -@[expose] public section +public section open Set MeasureTheory Complex diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean index e060ce633e..1ab2b5fbb4 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean @@ -18,7 +18,7 @@ Theory of Cauchy principal value integrals for piecewise C¹ contour integration The principal value approach allows contours to pass through singularities. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean index c83dcb264a..a183e0887f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean @@ -35,7 +35,7 @@ generalized residue theorem for piecewise C¹ immersions. * `pv_integral_simple_pole` — PV of c/(z-s) = 2πi · winding · c -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -43,14 +43,14 @@ open scoped Real Interval noncomputable section /-- Multi-point PV integrand: zero near any s in S, else f(γ(t))·γ'(t). -/ -def cauchyPrincipalValueIntegrandOn +@[expose] def cauchyPrincipalValueIntegrandOn (S : Finset ℂ) (f : ℂ → ℂ) (γ : ℝ → ℂ) (ε : ℝ) (t : ℝ) : ℂ := if ∃ s ∈ S, ‖γ t - s‖ ≤ ε then 0 else f (γ t) * deriv γ t /-- The multi-point Cauchy principal value. -/ -def cauchyPrincipalValueOn +@[expose] def cauchyPrincipalValueOn (S : Finset ℂ) (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) : ℂ := limUnder (𝓝[>] (0 : ℝ)) fun ε => @@ -58,7 +58,7 @@ def cauchyPrincipalValueOn cauchyPrincipalValueIntegrandOn S f γ ε t /-- Existence of the multi-point PV. -/ -def CauchyPrincipalValueExistsOn +@[expose] def CauchyPrincipalValueExistsOn (S : Finset ℂ) (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) : Prop := ∃ L : ℂ, Tendsto (fun ε => @@ -68,12 +68,12 @@ def CauchyPrincipalValueExistsOn /-- Residue of f at z₀ via the limit formula `lim_{z → z₀} (z - z₀) · f(z)`. -/ -def residueSimplePole (f : ℂ → ℂ) (z₀ : ℂ) : ℂ := +@[expose] def residueSimplePole (f : ℂ → ℂ) (z₀ : ℂ) : ℂ := limUnder (𝓝[≠] z₀) fun z => (z - z₀) * f z /-- Simple pole decomposition: f(z) = c/(z-z₀) + g(z) near z₀ with g analytic. -/ -def HasSimplePoleAt (f : ℂ → ℂ) (z₀ : ℂ) : Prop := +@[expose] def HasSimplePoleAt (f : ℂ → ℂ) (z₀ : ℂ) : Prop := ∃ c : ℂ, ∃ g : ℂ → ℂ, AnalyticAt ℂ g z₀ ∧ ∀ᶠ z in 𝓝[≠] z₀, f z = c / (z - z₀) + g z diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean index 532ee03807..0ce8215d5b 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean @@ -38,7 +38,7 @@ the generalized residue theorem with higher-order poles. Reference: Hungerbuhler-Wasem, arXiv:1808.00997v2, Definition 3.2. -/ -@[expose] public section +public section open Complex Set Filter Topology Asymptotics open scoped Real Interval @@ -51,11 +51,11 @@ noncomputable section /-- The orthogonal projection of `w` onto the real line spanned by `L` in C, where C is viewed as R^2. This computes `(Re(w * conj L) / ||L||^2) * L`. -/ -def orthogonalProjectionComplex (w L : ℂ) : ℂ := +@[expose] def orthogonalProjectionComplex (w L : ℂ) : ℂ := ((w * starRingEnd ℂ L).re / Complex.normSq L) • L /-- The tangent deviation: the component of `w` orthogonal to `L`. -/ -def tangentDeviation (w L : ℂ) : ℂ := +@[expose] def tangentDeviation (w L : ℂ) : ℂ := w - orthogonalProjectionComplex w L theorem orthogonalProjectionComplex_zero_left (L : ℂ) : @@ -280,7 +280,7 @@ theorem isFlatOfOrder_one (γ : PiecewiseC1Immersion) (t₀ : ℝ) /-- The pole order of a meromorphic function at a point, as a natural number. Returns 0 if `f` is analytic at `x` (including the case where `f` is identically zero near `x`). Returns `n` if `f` has a pole of order `n` (i.e., `meromorphicOrderAt f x = -n`). -/ -noncomputable def poleOrderAt (f : ℂ → ℂ) (x : ℂ) : ℕ := +@[expose] noncomputable def poleOrderAt (f : ℂ → ℂ) (x : ℂ) : ℕ := (-(meromorphicOrderAt f x).untop₀).toNat /-! ### Condition (A): Flatness condition for higher-order poles -/ @@ -303,6 +303,7 @@ def SatisfiesConditionA (γ : PiecewiseC1Immersion) (S0 : Finset ℂ) : Prop := /-- Condition (A) for a specific pole order function. Given a function assigning pole orders to singular points, the curve must be flat of the corresponding order at each crossing. -/ +@[expose] def SatisfiesConditionA' (γ : PiecewiseC1Immersion) (S0 : Finset ℂ) (poleOrder : ℂ → ℕ) : Prop := ∀ s ∈ S0, ∀ t₀ ∈ Icc γ.a γ.b, γ.toFun t₀ = s → diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer.lean index 619ad5e26a..3a0a4c79d5 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer.lean @@ -29,7 +29,7 @@ built from `conditionsAB_imply_higherOrderCancel_nh` and conditions (A')+(B), convex domain. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Finset Real open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean index 0b0144c91b..6860e8128f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean @@ -27,7 +27,7 @@ angle conditions with flatness rate (L3). * `cutoff_zpow_infrastructure`: full infrastructure for cutoff zpow integrals -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Finset Real open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CPVExistence.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CPVExistence.lean index 475b303813..dd2b190ff9 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CPVExistence.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CPVExistence.lean @@ -28,7 +28,7 @@ null-homologous residue theorems. with a unique crossing through `z₀`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Finset Real open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean index e0935d0bf6..64f4f1a286 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean @@ -27,7 +27,7 @@ vanishing foundations to provide the `cutoff_zpow_infrastructure` lemma. * `cutoff_zpow_infrastructure` — combined FTC + direction infrastructure -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean index 4080b2d6a6..9e017d66ff 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean @@ -33,7 +33,7 @@ The convex-domain specializations (`higherOrderCancel_assembly`, `conditionsAB_imply_higherOrderCancel`) are in `FlatnessTransfer.lean`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Finset Real open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean index b14f1fe594..94a445bb13 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean @@ -32,7 +32,7 @@ integrals, multi-point CPV, holomorphic CPV vanishing, and assembly helpers. * `tendsto_cpv_of_continuousOn_zero_integral`: CPV → 0 for continuous functions with zero integral -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Finset Real open scoped Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean index ff67196a60..7eed6f6250 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean @@ -33,7 +33,7 @@ per-term vanishing into the complete higher-order cancellation. * `cpv_tendsto_zero_of_add_decomposition` — final assembly -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean index 9e171f9eb4..fc448b751d 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean @@ -23,4 +23,4 @@ parts of the project — `Cycle.lean`, `ViazovskaMagicFunction.lean` — actuall We retire this duplicate as a re-export. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean index 50a6ca5c01..ba31fc6ef8 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean @@ -42,7 +42,7 @@ The convex-domain theorems `generalizedResidueTheorem`, where they are proved as corollaries of the null-homologous versions. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval @@ -493,7 +493,7 @@ lemma CauchyPrincipalValueExists'.const_mul This is well-defined for meromorphic functions and agrees with `residueSimplePole` when `f` has a simple pole at `z₀`. -/ -def residueAt (f : ℂ → ℂ) (z₀ : ℂ) : ℂ := +@[expose] def residueAt (f : ℂ → ℂ) (z₀ : ℂ) : ℂ := limUnder (𝓝[>] (0 : ℝ)) fun r => (2 * ↑Real.pi * I)⁻¹ * ∮ z in C(z₀, r), f z diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MathlibBridge.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MathlibBridge.lean index 586ed10411..282df61c5f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MathlibBridge.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MathlibBridge.lean @@ -36,7 +36,7 @@ For higher-order poles, the project's `residueAt_eq_laurent_head_coeff` (in Laurent coefficient. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeasureHelpers.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeasureHelpers.lean index 7d6ebaab07..ef3721cba2 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeasureHelpers.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeasureHelpers.lean @@ -21,7 +21,7 @@ Countability of isolated point sets and measure-zero results for preimages of singletons under piecewise C¹ immersions. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicLaurent.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicLaurent.lean index a2729c7256..b240be1dff 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicLaurent.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicLaurent.lean @@ -35,7 +35,7 @@ These are now thin wrappers around: * Mathlib `MeromorphicAt`, `meromorphicOrderAt` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicPrincipalPart.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicPrincipalPart.lean index 6af33b2866..3a48105015 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicPrincipalPart.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MeromorphicPrincipalPart.lean @@ -55,7 +55,7 @@ of pp = 0. * Mathlib `MeromorphicAt`, `meromorphicOrderAt` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval @@ -92,7 +92,7 @@ noncomputable def meromorphicFactor (f : ℂ → ℂ) (s : ℂ) If `f` has a pole of order `N` at `s` (i.e., `meromorphicOrderAt f s = -(N : ℤ)` with N > 0), the principal part is a rational function that captures the singular behavior. If `f` is analytic at `s` or not meromorphic, returns 0. -/ -noncomputable def meromorphicPrincipalPart (f : ℂ → ℂ) (s : ℂ) : ℂ → ℂ := +@[expose] noncomputable def meromorphicPrincipalPart (f : ℂ → ℂ) (s : ℂ) : ℂ → ℂ := if h : MeromorphicAt f s ∧ meromorphicOrderAt f s < 0 then fun z => (Finset.range (poleOrderNat f s)).sum fun k => (iteratedDeriv k (meromorphicFactor f s h.1 h.2.ne_top) s / diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean index 6c1e40019b..e9de300ea8 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean @@ -32,7 +32,7 @@ sums of single-point PVs. sum of single-point PVs when regular integral vanishes -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean index c353fc2d40..81395440e0 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean @@ -27,7 +27,7 @@ a.e. limit, norm bounds, measurability, and the main convergence theorems. single-point PVs when regular integral vanishes -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean index 40c80c9fa9..8d1f8a6a5b 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean @@ -46,7 +46,7 @@ The PV of `dz/z` along this curve decomposes as: Reference: Hungerbuhler-Wasem, arXiv:1808.00997v2, Lemma 3.1. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -61,7 +61,7 @@ noncomputable section - [0,1]: radial ray from 0 to r along the positive real axis - [1,2]: circular arc of radius r from angle 0 to angle alpha - [2,3]: radial ray from r*exp(i*alpha) back to 0 -/ -def sectorCurve (r : ℝ) (α : ℝ) (t : ℝ) : ℂ := +@[expose] def sectorCurve (r : ℝ) (α : ℝ) (t : ℝ) : ℂ := if t ≤ 1 then ↑(t * r) else if t ≤ 2 then diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean index 7ff9fe4817..aa095c27e9 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean @@ -33,7 +33,7 @@ model sector-curve defined in `SectorCurve.lean`. * `generalizedWindingNumber_sectorCurve` -- winding number equals `alpha / (2 * pi)` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber.lean index 2049ec509b..c28f042fbc 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber.lean @@ -23,4 +23,4 @@ Barrel file re-exporting the three submodules: * `Decomposition` — H-W Prop 2.2, main decomposition theorems -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean index c4c499db9a..557610e9c0 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean @@ -32,7 +32,7 @@ Contains the core monotonicity, cutoff boundary, and direction convergence lemma * `tendsto_exp_cutoff_integral_crossing` — exp(R(ε)) → exp(-iα) -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean index fc49e80104..1a2c0f7bf4 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean @@ -32,7 +32,7 @@ winding contribution and crossing angle contributions. * `windingNumberWithAngles_union` — additivity over disjoint crossings -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean index 25880aa20d..f95bffcad1 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean @@ -32,7 +32,7 @@ including the Hungerbühler-Wasem angle-based approach. * `angleAtCrossing_translate` — translation invariance of crossing angle -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -43,7 +43,7 @@ noncomputable section /-- The angle at a crossing point where γ passes through z₀. `arg(L_out) - arg(-L_in)` where L_in and L_out are one-sided derivative limits. At smooth points (not in partition), returns π. -/ -def angleAtCrossing (γ : PiecewiseC1Immersion) (t₀ : ℝ) +@[expose] def angleAtCrossing (γ : PiecewiseC1Immersion) (t₀ : ℝ) (ht₀ : t₀ ∈ Ioo γ.a γ.b) : ℝ := if h : t₀ ∈ γ.toPiecewiseC1Curve.partition then let L_left := @@ -59,7 +59,7 @@ theorem angleAtCrossing_smooth (γ : PiecewiseC1Immersion) angleAtCrossing γ t₀ ht₀ = Real.pi := by simp only [angleAtCrossing, hsmooth, ↓reduceDIte] /-- Winding number via explicit angle sum at crossings. -/ -def windingNumberWithAngles' +@[expose] def windingNumberWithAngles' (γ : PiecewiseC1Immersion) (z₀ : ℂ) (crossings : Finset ℝ) (hcrossings_in : ∀ t ∈ crossings, t ∈ Ioo γ.a γ.b) @@ -143,7 +143,7 @@ theorem integral_inv_real_axis (r ε : ℝ) (hr : 0 < r) Complex.ofReal_log hr.le, Complex.ofReal_log hε.le] /-- Translate a piecewise C¹ immersion by a constant. -/ -def PiecewiseC1Immersion.translate +@[expose] def PiecewiseC1Immersion.translate (γ : PiecewiseC1Immersion) (c : ℂ) : PiecewiseC1Immersion where toFun := fun t => γ.toFun t + c @@ -194,7 +194,7 @@ of the modified curve Λ that detours around z₀ (H-W Proposition 2.2). The decomposition is `n_{z₀}(γ) = N - α/(2π)`, so `N = n_{z₀}(γ) + α/(2π)`. When `N = 0`, the generalized winding number equals `-α/(2π)`. -/ -def externalWindingContribution (γ : PiecewiseC1Immersion) +@[expose] def externalWindingContribution (γ : PiecewiseC1Immersion) (z₀ : ℂ) (t₀ : ℝ) (ht₀ : t₀ ∈ Ioo γ.a γ.b) : ℂ := generalizedWindingNumber' γ.toFun γ.a γ.b z₀ + (angleAtCrossing γ t₀ ht₀ : ℂ) / (2 * Real.pi) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean index 3bea9273e3..8aa09d9da1 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean @@ -37,7 +37,7 @@ also gives isolation on each side via strict monotonicity of a real projection. The crossing set is closed and has no accumulation points, hence finite by compactness. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing.lean index 5b73adfcf4..669a0f22a9 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing.lean @@ -32,4 +32,4 @@ This file re-exports the Hecke ring construction, split across: * `Degree` — degree ring homomorphism `deg : 𝕋 P ℤ →+* ℤ` (Shimura Prop 3.3) -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Associativity.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Associativity.lean index d7ee7350d9..f80198e4e4 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Associativity.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Associativity.lean @@ -22,7 +22,7 @@ which is equivalent to associativity of multiplication in the Hecke ring. This i Proposition 3.4. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean index bd6078c579..1e72016256 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean @@ -23,7 +23,7 @@ spaces `HeckeCoset` and `HeckeLeftCoset`, the Hecke ring type `𝕋`, and founda lemmas. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable @@ -77,7 +77,7 @@ structure HeckePair (G : Type*) [Group G] where h₁ : Δ ≤ (commensurator H).toSubmonoid /-- Two elements of `Δ` define the same double coset `HgH = HhH`. -/ -def dcRel (P : HeckePair G) (g h : P.Δ) : Prop := +@[expose] def dcRel (P : HeckePair G) (g h : P.Δ) : Prop := DoubleCoset.doubleCoset (g : G) P.H P.H = DoubleCoset.doubleCoset (h : G) P.H P.H /-- The setoid on `Δ` identifying elements with the same double coset. -/ @@ -92,7 +92,7 @@ abbrev HeckeCoset (P : HeckePair G) := Quotient (dcSetoid P) noncomputable instance (P : HeckePair G) : DecidableEq (HeckeCoset P) := Classical.decEq _ /-- Two elements of `Δ` define the same left coset `gH = hH`. -/ -def lcRel (P : HeckePair G) (g h : P.Δ) : Prop := +@[expose] def lcRel (P : HeckePair G) (g h : P.Δ) : Prop := ({(g : G)} : Set G) * (P.H : Set G) = {(h : G)} * P.H /-- The setoid on `Δ` identifying elements with the same left coset. -/ @@ -101,7 +101,7 @@ instance lcSetoid (P : HeckePair G) : Setoid P.Δ where iseqv := ⟨fun _ => rfl, Eq.symm, Eq.trans⟩ /-- A Hecke left coset: an equivalence class of `Δ`-elements under `gH = hH`. -/ -def HeckeLeftCoset (P : HeckePair G) := Quotient (lcSetoid P) +@[expose] def HeckeLeftCoset (P : HeckePair G) := Quotient (lcSetoid P) noncomputable instance (P : HeckePair G) : DecidableEq (HeckeLeftCoset P) := Classical.decEq _ @@ -110,12 +110,12 @@ namespace HeckeCoset variable {P : HeckePair G} /-- The underlying set `HgH`, well-defined on the quotient. -/ -noncomputable def toSet (D : HeckeCoset P) : Set G := +@[expose] noncomputable def toSet (D : HeckeCoset P) : Set G := Quotient.lift (fun (g : P.Δ) => DoubleCoset.doubleCoset (g : G) P.H P.H) (fun a b (h : @Setoid.r _ (dcSetoid P) a b) => h) D /-- A representative `g : Δ` (via `Quotient.out`). -/ -noncomputable def rep (D : HeckeCoset P) : P.Δ := Quotient.out D +@[expose] noncomputable def rep (D : HeckeCoset P) : P.Δ := Quotient.out D /-- `⟦g⟧ = ⟦h⟧ ↔ HgH = HhH`. -/ lemma eq_iff (g h : P.Δ) : (⟦g⟧ : HeckeCoset P) = ⟦h⟧ ↔ @@ -124,7 +124,7 @@ lemma eq_iff (g h : P.Δ) : (⟦g⟧ : HeckeCoset P) = ⟦h⟧ ↔ /-- The carrier set of `⟦g⟧` is definitionally `HgH`. -/ @[simp] lemma toSet_mk (g : P.Δ) : - HeckeCoset.toSet (⟦g⟧ : HeckeCoset P) = DoubleCoset.doubleCoset (g : G) P.H P.H := rfl + HeckeCoset.toSet (⟦g⟧ : HeckeCoset P) = DoubleCoset.doubleCoset (g : G) P.H P.H := by rfl /-- Membership in `toSet ⟦g⟧` is membership in the double coset `HgH`. -/ lemma mem_toSet_mk (g : P.Δ) (x : G) : @@ -168,7 +168,7 @@ lemma eq_mk_of_mem {g₁ g₂ : P.Δ} (eq_iff g₁ g₂).mpr (doubleCoset_eq_of_mem h) /-- The identity double coset `H1H = H`. -/ -def one (P : HeckePair G) : HeckeCoset P := ⟦⟨1, P.Δ.one_mem⟩⟧ +@[expose] def one (P : HeckePair G) : HeckeCoset P := ⟦⟨1, P.Δ.one_mem⟩⟧ /-- Induction: to prove something for all double cosets, prove it for `⟦g⟧`. -/ protected lemma ind {motive : HeckeCoset P → Prop} @@ -195,12 +195,12 @@ namespace HeckeLeftCoset variable {P : HeckePair G} /-- The underlying set `gH`, well-defined on the quotient. -/ -noncomputable def toSet (D : HeckeLeftCoset P) : Set G := +@[expose] noncomputable def toSet (D : HeckeLeftCoset P) : Set G := Quotient.lift (fun (g : P.Δ) => ({(g : G)} : Set G) * (P.H : Set G)) (fun _ _ (h : lcRel P _ _) => h) D /-- A representative `g : Δ`. -/ -noncomputable def rep (D : HeckeLeftCoset P) : P.Δ := Quotient.out D +@[expose] noncomputable def rep (D : HeckeLeftCoset P) : P.Δ := Quotient.out D /-- The identity left coset `1H = H`. -/ def one (P : HeckePair G) : HeckeLeftCoset P := ⟦⟨1, P.Δ.one_mem⟩⟧ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean index 5569235e7e..6c2a1a2dd9 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean @@ -23,7 +23,7 @@ Shimura Proposition 3.8: if an arithmetic group pair admits an anti-automorphism Hecke ring `𝕋 P ℤ` is commutative. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable Finsupp @@ -49,7 +49,7 @@ namespace AntiInvolution variable (ι : AntiInvolution P) /-- The underlying function of the anti-involution, mapping `g` to `ι(g)` viewed in `G`. -/ -def bar (g : G) : G := (ι.toFun g).unop +@[expose] def bar (g : G) : G := (ι.toFun g).unop /-- The anti-involution is an involution: `bar(bar(g)) = g`. -/ @[simp] lemma bar_bar (g : G) : ι.bar (ι.bar g) = g := ι.involutive g @@ -93,6 +93,7 @@ lemma bar_doubleCoset_eq (g₁ g₂ : G) ⟨ι.bar h₁, ι.bar_mem_H hh₁⟩ _ /-- The induced action of the anti-involution on double cosets, defined via `Quotient.lift`. -/ +@[expose] noncomputable def onHeckeCoset (D : HeckeCoset P) : HeckeCoset P := Quotient.lift (fun (g : P.Δ) => (⟦⟨ι.bar (g : G), ι.bar_mem_Δ g.2⟩⟧ : HeckeCoset P)) diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean index 330d9293d2..36f23df421 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean @@ -44,7 +44,7 @@ result is `coeffSum(f • m) = deg(f) * coeffSum(m)`, which follows from the orb lemma `smulOrbit_card`. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable @@ -59,7 +59,7 @@ open Finsupp /-- The degree of a double coset: `deg(HgH) = [H : H ∩ gHg⁻¹]`, the number of left cosets in the decomposition of `HgH`. -/ -noncomputable def HeckeCosetDeg (D : HeckeCoset P) : ℤ := +@[expose] noncomputable def HeckeCosetDeg (D : HeckeCoset P) : ℤ := Fintype.card (decompQuot P (HeckeCoset.rep D)) /-- The degree of the identity double coset is 1. -/ @@ -148,7 +148,7 @@ end CoeffSum section DegreeMap /-- The underlying function of the degree map: `Σ_D a_D * deg(D)`. -/ -noncomputable def degFun (f : 𝕋 P ℤ) : ℤ := f.sum fun D a => a * HeckeCosetDeg P D +@[expose] noncomputable def degFun (f : 𝕋 P ℤ) : ℤ := f.sum fun D a => a * HeckeCosetDeg P D /-- The degree function of zero is zero. -/ @[simp] lemma deg_fun_zero : degFun P (0 : 𝕋 P ℤ) = 0 := Finsupp.sum_zero_index @@ -202,7 +202,7 @@ lemma deg_fun_mul (f g : 𝕋 P ℤ) : /-- The degree ring homomorphism `deg : 𝕋 P ℤ →+* ℤ`, sending each double coset to the number of left cosets it contains (Shimura Proposition 3.3). -/ -noncomputable def deg : 𝕋 P ℤ →+* ℤ where +@[expose] noncomputable def deg : 𝕋 P ℤ →+* ℤ where toFun := degFun P map_zero' := deg_fun_zero P map_one' := deg_fun_one P diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean index 2b6c3a3e78..1b761c873e 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean @@ -20,7 +20,7 @@ The module action of `𝕋 P ℤ` on `HeckeModule P ℤ` (formal sums of left co theorem `eq_of_smul_eq_smul_𝕋`. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable @@ -40,14 +40,14 @@ noncomputable instance (priority := 1100) instSMul𝕋 : SMul (𝕋 P ℤ) (𝕋 smul x y := y * x /-- The left coset represented by `β · i · g` in the orbit indexed by `i`. -/ -noncomputable def smulOrbitElement (g β : P.Δ) (i : decompQuot P g) : +@[expose] noncomputable def smulOrbitElement (g β : P.Δ) (i : decompQuot P g) : HeckeLeftCoset P := ⟦⟨(β : G) * (i.out : G) * (g : G), delta_mul_mem P.H P.Δ i.out β g P.h₀⟩⟧ /-- The orbit of a left coset representative `β` under double coset representative `g`: the set of left cosets `{β · σ_i · g | σ_i ∈ H/(H ∩ gHg⁻¹)}`. -/ -noncomputable def smulOrbit (g : P.Δ) (β : P.Δ) : +@[expose] noncomputable def smulOrbit (g : P.Δ) (β : P.Δ) : Finset (HeckeLeftCoset P) := Finset.image (smulOrbitElement P g β) ⊤ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean index 06ad408534..de53d3ab31 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean @@ -26,7 +26,7 @@ on `𝕋 P ℤ`, and the `NonUnitalNonAssocSemiring` instance. Proves that `HeckeCoset.one` is the identity element. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable @@ -120,7 +120,7 @@ private lemma mul_mem_delta (a : H) (g : Δ) /-- The map sending a pair of coset representatives `(σ_i, τ_j)` to the double coset of their product `H(σ_i τ_j)H`. -/ -noncomputable def mulMap (g₁ g₂ : P.Δ) +@[expose] noncomputable def mulMap (g₁ g₂ : P.Δ) (i : decompQuot P g₁ × decompQuot P g₂) : HeckeCoset P := ⟦⟨i.1.out * g₁ * (i.2.out * g₂), Submonoid.mul_mem _ (by exact mul_mem_delta P.H P.Δ i.1.out g₁ P.h₀) @@ -128,14 +128,14 @@ noncomputable def mulMap (g₁ g₂ : P.Δ) /-- Shimura's multiplicity (Proposition 3.2): `heckeMultiplicity(g₁, g₂, d)` counts pairs `(i,j)` such that `σᵢ τⱼ H = ξ H`. -/ -noncomputable def heckeMultiplicity (g₁ g₂ d : P.Δ) : ℤ := +@[expose] noncomputable def heckeMultiplicity (g₁ g₂ d : P.Δ) : ℤ := Nat.card {⟨i, j⟩ : decompQuot P g₁ × decompQuot P g₂ | ({(i.out : G) * (g₁ : G)} : Set G) * {(j.out : G) * (g₂ : G)} * P.H = {(d : G)} * (P.H : Set G)} /-- The finite set of double cosets appearing in the product `D1 * D2`. -/ -noncomputable def mulSupport (g₁ g₂ : P.Δ) : Finset (HeckeCoset P) := +@[expose] noncomputable def mulSupport (g₁ g₂ : P.Δ) : Finset (HeckeCoset P) := Finset.image (mulMap P g₁ g₂) ⊤ /-- If `σ_i τ_j H = ξ H` then the double coset of `σ_i τ_j` equals @@ -500,7 +500,7 @@ lemma heckeMultiplicity_one_mul (g₁ d : P.Δ) : /-- The multiplication finsupp: `m(g₁, g₂)` is the formal sum `Σ_d heckeMultiplicity(g₁, g₂, d) · d` encoding the product of two double cosets. -/ -noncomputable def m (g₁ g₂ : P.Δ) : (HeckeCoset P) →₀ ℤ := +@[expose] noncomputable def m (g₁ g₂ : P.Δ) : (HeckeCoset P) →₀ ℤ := ⟨mulSupport P g₁ g₂, fun d => heckeMultiplicity P g₁ g₂ (HeckeCoset.rep d), fun a => diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean index 348d9000b4..5f9b5588ae 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean @@ -21,7 +21,7 @@ import Mathlib.Topology.MetricSpace.Bounded The `Ring (𝕋 P ℤ)` instance and user-facing API lemmas for working with Hecke rings. -/ -@[expose] public section +public section open MulOpposite Set DoubleCoset Subgroup Subgroup.Commensurable diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean index 8c8dc14fa8..a89b745030 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean @@ -33,7 +33,7 @@ structural lemmas for Shimura's Theorem 3.24. * Shimura, Theorem 3.24 -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise HeckeRing DoubleCoset HeckeRing.GLn @@ -43,7 +43,7 @@ namespace HeckeRing.GL2 /-- `T(a,d)` for n=2: the Hecke basis element for diagonal `(a,d)` with `a | d`. Returns 0 when `a = 0` or `d = 0` or `a ∤ d`. -/ -noncomputable def TAd (a d : ℕ) : HeckeAlgebra 2 := +@[expose] noncomputable def TAd (a d : ℕ) : HeckeAlgebra 2 := if _ : 0 < a ∧ 0 < d ∧ a ∣ d then TElem ![a, d] else 0 /-- Unfold `TAd` to `TElem` when all positivity and divisibility conditions hold. -/ @@ -56,7 +56,7 @@ lemma T_ad_eq_zero {a d : ℕ} (h : ¬(0 < a ∧ 0 < d ∧ a ∣ d)) : TAd a d = dite_eq_right h /-- `T(p,p)`: the scalar double coset for prime `p`, equal to `TAd p p`. -/ -noncomputable def TPp (p : ℕ) : HeckeAlgebra 2 := TAd p p +@[expose] noncomputable def TPp (p : ℕ) : HeckeAlgebra 2 := TAd p p /-- For `p` prime, `T(p,p)` equals the scalar diagonal element `TElem(p,p)`. -/ lemma T_pp_of_pos (p : ℕ) (hp : p.Prime) : TPp p = TElem (fun _ : Fin 2 => p) := by @@ -78,7 +78,7 @@ lemma T_elem_ones_eq : TElem (fun _ : Fin 2 => 1) = 1 := by (funext fun i => by fin_cases i <;> rfl)).trans T_elem_ones_eq /-- `T(m) = Σ_{a | m} T(a, m/a)`. -/ -noncomputable def TSum (m : ℕ+) : HeckeAlgebra 2 := +@[expose] noncomputable def TSum (m : ℕ+) : HeckeAlgebra 2 := ∑ a ∈ (m : ℕ).divisors, TAd a ((m : ℕ) / a) section Structural diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/CongruenceIndex.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/CongruenceIndex.lean index 054a62fb7a..b8a7550f72 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/CongruenceIndex.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/CongruenceIndex.lean @@ -24,7 +24,7 @@ Computes the index `[SL₂(ℤ) : Γ₀(pᵏ)] = pᵏ⁻¹(p + 1)` for prime `p` * Shimura, Theorem 3.24 -/ -@[expose] public section +public section open Matrix.SpecialLinearGroup Matrix ModularGroup CongruenceSubgroup diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean index 4800bf9e67..521e92ef0f 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean @@ -33,7 +33,7 @@ Shimura Theorem 3.24, identities 6 and 7: degree formulas for the GL₂ Hecke al * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, Theorem 3.24 -/ -@[expose] public section +public section open HeckeRing HeckeRing.GLn HeckeRing.GL2 open scoped ArithmeticFunction.sigma diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean index f5fc1c3d26..c52ba0528d 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean @@ -37,7 +37,7 @@ anti-involution preserving `Γ` and fixing every double coset (`GL_pair_onHeckeC * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, §3.4, Prop 3.30 -/ -@[expose] public section +public section open Matrix Matrix.SpecialLinearGroup Subgroup.Commensurable Pointwise open HeckeRing DoubleCoset HeckeRing.GLn @@ -46,7 +46,7 @@ open scoped Pointwise ModularForm MatrixGroups UpperHalfPlane namespace HeckeRing.GL2 /-- Embed `GL₂(ℚ)` into `GL₂(ℝ)` via `ℚ ↪ ℝ`. -/ -noncomputable def glMap : GL (Fin 2) ℚ →* GL (Fin 2) ℝ := +@[expose] noncomputable def glMap : GL (Fin 2) ℚ →* GL (Fin 2) ℝ := GeneralLinearGroup.map (algebraMap ℚ ℝ) /-- Slash action on `GL₂(ℚ)` induced from `GL₂(ℝ)` via the embedding `ℚ ↪ ℝ`. @@ -117,7 +117,7 @@ noncomputable abbrev tRep (D : HeckeCoset (GLPair 2)) where `ΓδΓ = ⊔ᵢ (σᵢδ)Γ` is the right coset decomposition. Each `(σᵢδ)ᵀ = δᵀσᵢᵀ` is a left coset representative, giving genuinely distinct terms `f ∣[k] (δᵀσᵢᵀ)`. -/ -noncomputable def heckeSlash (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : ℍ → ℂ) : ℍ → ℂ := +@[expose] noncomputable def heckeSlash (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : ℍ → ℂ) : ℍ → ℂ := ∑ i : decompQuot (GLPair 2) (HeckeCoset.rep D), f ∣[k] tRep D i /-- The Hecke slash action distributes over addition of functions. -/ @@ -306,7 +306,7 @@ lemma heckeSlash_slash_invariant (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : ℍ rfl /-- The `SlashInvariantForm` obtained by applying a Hecke operator. -/ -noncomputable def heckeSlashInvariant (k : ℤ) (D : HeckeCoset (GLPair 2)) +@[expose] noncomputable def heckeSlashInvariant (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : SlashInvariantForm 𝒮ℒ k) : SlashInvariantForm 𝒮ℒ k where toFun := heckeSlash k D f slash_action_eq' γ hγ := heckeSlash_slash_invariant k D f diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean index f82a2f6cc0..a8a3ed35e9 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean @@ -26,7 +26,7 @@ proving holomorphicity, linearity, and boundedness at cusps. * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, §3.4 -/ -@[expose] public section +public section open Matrix Matrix.SpecialLinearGroup Subgroup.Commensurable Pointwise open HeckeRing DoubleCoset HeckeRing.GLn HeckeRing.GL2 @@ -62,6 +62,7 @@ lemma heckeSlash_bdd_at_cusps (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : Modular OnePoint.IsBoundedAt.smul_iff.mp (f.bdd_at_cusps' (glMap_smul_isCusp _ hc)) /-- The Hecke operator `T(D)` on modular forms, preserving slash invariance and holomorphicity. -/ +@[expose] noncomputable def heckeOperator (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : ModularForm 𝒮ℒ k) : ModularForm 𝒮ℒ k where toSlashInvariantForm := heckeSlashInvariant k D f.toSlashInvariantForm @@ -286,9 +287,8 @@ private theorem heckeSlash_comp (k : ℤ) (D₁ D₂ : HeckeCoset (GLPair 2)) (f unfold heckeSlashExt; rw [mul_singleton_𝕋]; simp] have h_comm : m (GLPair 2) (HeckeCoset.rep D₂) (HeckeCoset.rep D₁) = m (GLPair 2) (HeckeCoset.rep D₁) (HeckeCoset.rep D₂) := by - rw [← @T_single_one_mul_T_single_one _ _ (GLPair 2) D₂ D₁, - ← @T_single_one_mul_T_single_one _ _ (GLPair 2) D₁ D₂] - exact (instCommRingHeckeAlgebra (n := 2)).mul_comm _ _ + exact (GLPairAntiInvolution 2).m_comm_of_onHeckeCoset_eq + (GL_pair_onHeckeCoset_eq 2) D₂ D₁ rw [h_comm]; simp_rw [heckeSlash] rw [show (∑ i : decompQuot (GLPair 2) (HeckeCoset.rep D₁), (∑ j : decompQuot (GLPair 2) (HeckeCoset.rep D₂), diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean index 2d6e705a91..391dd63f39 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean @@ -38,7 +38,7 @@ Degree formulas (identities 6--7) are in `GL2.Degree`. * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, Theorem 3.24 -/ -@[expose] public section +public section open HeckeRing HeckeRing.GLn HeckeRing.GL2 open scoped ArithmeticFunction.sigma @@ -102,7 +102,8 @@ private theorem HA_mul_assoc (a b c : HeckeAlgebra 2) : private theorem HA_mul_comm (a b : HeckeAlgebra 2) : a * b = b * a := - (instCommRingHeckeAlgebra (n := 2)).mul_comm a b + (GLPairAntiInvolution 2).mul_comm_of_antiInvolution + (GL_pair_onHeckeCoset_eq 2) a b end HeckeAlgRing diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean index 2023a1df24..f045b4e068 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean @@ -34,7 +34,7 @@ This is the foundation for the Hecke ring of GL_n following Shimura §3.2. * `posDetInt_le_commensurator` — `Δ ⊆ commensurator(SL_n(ℤ))` -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise Matrix.SpecialLinearGroup @@ -64,7 +64,7 @@ section PosDetInt /-- An element of `GL_n(ℚ)` has integer matrix entries if its underlying matrix is the image of an integer matrix under `ℤ → ℚ`. -/ -def HasIntEntries (g : GL (Fin n) ℚ) : Prop := +@[expose] def HasIntEntries (g : GL (Fin n) ℚ) : Prop := ∃ A : Matrix (Fin n) (Fin n) ℤ, (↑g : Matrix (Fin n) (Fin n) ℚ) = A.map (Int.cast : ℤ → ℚ) @@ -99,7 +99,7 @@ private lemma intMat_map_mul (A B : Matrix (Fin n) (Fin n) ℤ) : /-- The submonoid of `GL_n(ℚ)` consisting of invertible matrices with integer entries and positive determinant. This is Shimura's `Δ`. -/ -noncomputable def posDetIntSubmonoid : Submonoid (GL (Fin n) ℚ) where +@[expose] noncomputable def posDetIntSubmonoid : Submonoid (GL (Fin n) ℚ) where carrier := {g | HasIntEntries n g ∧ 0 < (↑g : Matrix (Fin n) (Fin n) ℚ).det} one_mem' := ⟨hasIntEntries_one n, by simp⟩ mul_mem' := fun ⟨ha, hda⟩ ⟨hb, hdb⟩ => @@ -356,7 +356,7 @@ lemma posDetInt_le_commensurator : /-- The standard arithmetic group pair for number theory: `SL_n(ℤ) ≤ Δ ≤ commensurator(SL_n(ℤ))` in `GL_n(ℚ)`. -/ -noncomputable def GLPair : HeckePair (GL (Fin n) ℚ) where +@[expose] noncomputable def GLPair : HeckePair (GL (Fin n) ℚ) where H := SLnZSubgroup n Δ := posDetIntSubmonoid n h₀ := SLnZ_le_posDetInt n diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean index 0f20cdaf51..f04c144b04 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean @@ -33,7 +33,7 @@ Scalar double cosets T(c,...,c) act by scaling. * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, §3.2 -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise HeckeRing DoubleCoset Matrix.SpecialLinearGroup diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/CosetDecomposition.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/CosetDecomposition.lean index 89655d1739..d7304298ba 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/CosetDecomposition.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/CosetDecomposition.lean @@ -36,7 +36,7 @@ distinct left cosets. * Shimura, Proposition 3.22 -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise HeckeRing Matrix.SpecialLinearGroup @@ -81,7 +81,7 @@ abbrev UpperTriRep (a : Fin n → ℕ) (hdiv : DivChain n a) := (p : { ij : Fin n × Fin n // ij.1 < ij.2 }) → Fin (a p.val.2 / a p.val.1) /-- Upper-triangular matrix with diagonal `a` and off-diagonal `M_{ij} = a_i * B_{ij}`. -/ -def upperTriMat (a : Fin n → ℕ) (hdiv : DivChain n a) (B : UpperTriRep n a hdiv) : +@[expose] def upperTriMat (a : Fin n → ℕ) (hdiv : DivChain n a) (B : UpperTriRep n a hdiv) : Matrix (Fin n) (Fin n) ℤ := fun i j => if h : i < j then (a i : ℤ) * (B ⟨(i, j), h⟩ : ℕ) @@ -121,6 +121,7 @@ lemma upperTriMat_injective (a : Fin n → ℕ) (hpos : ∀ i, 0 < a i) (hdiv : exact Fin.ext (by exact_mod_cast mul_left_cancel₀ h_ai_pos h_eq) /-- The upper-triangular representative as a `GL_n(ℚ)` element. -/ +@[expose] noncomputable def upperTriGL (a : Fin n → ℕ) (hpos : ∀ i, 0 < a i) (hdiv : DivChain n a) (B : UpperTriRep n a hdiv) : GL (Fin n) ℚ := @@ -153,7 +154,7 @@ lemma upperTriGL_mem_posDetInt (a : Fin n → ℕ) (hpos : ∀ i, 0 < a i) exact_mod_cast this⟩ /-- The unipotent upper-triangular matrix with `1` on the diagonal and `B_{ij}` above. -/ -def unipMat (a : Fin n → ℕ) (hdiv : DivChain n a) (B : UpperTriRep n a hdiv) : +@[expose] def unipMat (a : Fin n → ℕ) (hdiv : DivChain n a) (B : UpperTriRep n a hdiv) : Matrix (Fin n) (Fin n) ℤ := fun i j => if h : i < j then (B ⟨(i, j), h⟩ : ℕ) diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean index 3486a3c457..195f5a19ce 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean @@ -44,7 +44,7 @@ function `ψ(d) = d · ∏_{p | d} (1 + 1/p)`. For the prime-power case needed f * Shimura, Proposition 3.14, 3.18, Theorem 3.24 -/ -@[expose] public section +public section open HeckeRing HeckeRing.GL2 Finset CongruenceSubgroup Matrix.SpecialLinearGroup Matrix ModularGroup diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean index c93270bb7c..fe9d5bb07d 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean @@ -36,7 +36,7 @@ representative (elementary divisor theorem / Smith normal form). * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, §3.2 -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise HeckeRing Matrix.SpecialLinearGroup @@ -95,7 +95,7 @@ section HeckeDiagonal variable [NeZero n] /-- The diagonal matrix `diag(a₁,...,aₙ)` as an element of Shimura's `Δ`. -/ -noncomputable def diagMatDelta (a : Fin n → ℕ) : (GLPair n).Δ := +@[expose] noncomputable def diagMatDelta (a : Fin n → ℕ) : (GLPair n).Δ := if h : ∀ i, 0 < a i then ⟨diagMat n a, diagMat_mem_posDetInt n a h⟩ else ⟨1, (GLPair n).Δ.one_mem⟩ @@ -107,6 +107,7 @@ noncomputable def diagMatDelta (a : Fin n → ℕ) : (GLPair n).Δ := end HeckeDiagonal /-- The divisibility chain condition `a₁ | a₂ | ... | aₙ` for positive integer sequences. -/ +@[expose] def DivChain (a : Fin n → ℕ) : Prop := ∀ (i : ℕ) (hi : i + 1 < n), a ⟨i, by omega⟩ ∣ a ⟨i + 1, hi⟩ @@ -135,11 +136,11 @@ variable {n} [NeZero n] /-- `T(a₁,...,aₙ) = Γ · diag[a₁,...,aₙ] · Γ` as a double coset. Hypotheses `ha` (positivity) and `hdiv` (divisibility chain) belong in lemmas, not the definition; the result is junk when they fail. -/ -noncomputable def TDiag (a : Fin n → ℕ) : HeckeCoset (GLPair n) := +@[expose] noncomputable def TDiag (a : Fin n → ℕ) : HeckeCoset (GLPair n) := ⟦diagMatDelta n a⟧ /-- `T(a₁,...,aₙ)` as a Hecke ring element with coefficient `1`. -/ -noncomputable def TElem (a : Fin n → ℕ) : HeckeAlgebra n := +@[expose] noncomputable def TElem (a : Fin n → ℕ) : HeckeAlgebra n := Finsupp.single (TDiag a) 1 /-- The representative of TDiag lies in the double coset of diagMat. -/ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean index ee9fd8ba86..9497a63b16 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean @@ -39,7 +39,7 @@ ring `ℤ[X₁,...,Xₙ]` in `n` variables. * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, §3.2, Theorem 3.20 -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise HeckeRing DoubleCoset diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PrimeDecomposition.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PrimeDecomposition.lean index acdef97e55..956b04df36 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PrimeDecomposition.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PrimeDecomposition.lean @@ -39,7 +39,7 @@ Every `T(a₁,...,aₙ)` factors into a product of p-power `T`-elements via copr * Shimura, *Introduction to the Arithmetic Theory of Automorphic Functions*, §3.2 -/ -@[expose] public section +public section open Matrix Subgroup.Commensurable Pointwise HeckeRing DoubleCoset @@ -54,7 +54,7 @@ variable (n : ℕ) section PPow /-- p-power diagonal: entries are `p^(e i)`. -/ -def ppowDiag (p : ℕ) (e : Fin n → ℕ) : Fin n → ℕ := +@[expose] def ppowDiag (p : ℕ) (e : Fin n → ℕ) : Fin n → ℕ := fun i => p ^ e i lemma ppowDiag_pos (p : ℕ) (hp : p.Prime) (e : Fin n → ℕ) : diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean index f30f69b1c1..5f37eb935a 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean @@ -19,15 +19,17 @@ transvection matrices `E_{ij}(c) = I + c·e_{ij}`. of transvections. -/ -@[expose] public section +public section /-- An elementary transvection in `SL_m(ℤ)`: the matrix `I + c·e_{ij}`. -/ +@[expose] def slTransvecG {m : ℕ} (i j : Fin m) (hij : i ≠ j) (c : ℤ) : Matrix.SpecialLinearGroup (Fin m) ℤ := ⟨Matrix.transvection i j c, Matrix.det_transvection_of_ne i j hij c⟩ /-- A matrix in `SL_m(ℤ)` is a transvection if it equals `slTransvecG i j hij c` for some `i ≠ j` and scalar `c`. -/ +@[expose] def IsTransvec {m : ℕ} (E : Matrix.SpecialLinearGroup (Fin m) ℤ) : Prop := ∃ (i j : Fin m) (hij : i ≠ j) (c : ℤ), E = slTransvecG i j hij c diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/TransposeAntiInvolution.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/TransposeAntiInvolution.lean index ea49dc0eaf..4be82410f7 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/TransposeAntiInvolution.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/TransposeAntiInvolution.lean @@ -26,7 +26,7 @@ gives commutativity of the Hecke ring. * `instCommRingHeckeAlgebra` -- `CommRing (HeckeAlgebra n)` -/ -@[expose] public section +public section open Matrix HeckeRing HeckeRing.GLn Matrix.SpecialLinearGroup diff --git a/LeanPool/LeanModularForms/Modularforms/AtImInfty.lean b/LeanPool/LeanModularForms/Modularforms/AtImInfty.lean index afe8af07f6..999cbf3714 100644 --- a/LeanPool/LeanModularForms/Modularforms/AtImInfty.lean +++ b/LeanPool/LeanModularForms/Modularforms/AtImInfty.lean @@ -11,7 +11,7 @@ public import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty /-! # AtImInfty -/ -@[expose] public section +public section /- Probably put this at Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean diff --git a/LeanPool/LeanModularForms/Modularforms/BigO.lean b/LeanPool/LeanModularForms/Modularforms/BigO.lean index 7718e2c7d4..ec57b541b0 100644 --- a/LeanPool/LeanModularForms/Modularforms/BigO.lean +++ b/LeanPool/LeanModularForms/Modularforms/BigO.lean @@ -16,7 +16,7 @@ import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable /-! # BigO -/ -@[expose] public section +public section open EisensteinSeries UpperHalfPlane TopologicalSpace Set Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/Cauchylems.lean b/LeanPool/LeanModularForms/Modularforms/Cauchylems.lean index 8dc288e927..89b6bc39f9 100644 --- a/LeanPool/LeanModularForms/Modularforms/Cauchylems.lean +++ b/LeanPool/LeanModularForms/Modularforms/Cauchylems.lean @@ -15,7 +15,7 @@ import Mathlib.Data.Int.Star /-! # Cauchylems -/ -@[expose] public section +public section open EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean b/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean index 25a00645b8..c0d29d9004 100644 --- a/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean @@ -16,7 +16,7 @@ import Mathlib.LinearAlgebra.Complex.FiniteDimensional /-! # ClogArgLems -/ -@[expose] public section +public section open UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/Cotangent.lean b/LeanPool/LeanModularForms/Modularforms/Cotangent.lean index e02031caa0..08fdbb7020 100644 --- a/LeanPool/LeanModularForms/Modularforms/Cotangent.lean +++ b/LeanPool/LeanModularForms/Modularforms/Cotangent.lean @@ -27,4 +27,4 @@ import the upstream module directly and resolve `cot_series_rep'` and `pi_mul_cot_pi_q_exp` against Mathlib's versions. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/Modularforms/Csqrt.lean b/LeanPool/LeanModularForms/Modularforms/Csqrt.lean index cc229926de..982531bbb2 100644 --- a/LeanPool/LeanModularForms/Modularforms/Csqrt.lean +++ b/LeanPool/LeanModularForms/Modularforms/Csqrt.lean @@ -19,7 +19,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc /-! # Csqrt -/ -@[expose] public section +public section open UpperHalfPlane TopologicalSpace Set MeasureTheory Metric Filter Function Complex @@ -30,7 +30,7 @@ open ArithmeticFunction /-- The principal complex square root `a ↦ exp ((1 / 2) * log a)`. -/ -noncomputable def csqrt : ℂ → ℂ := (fun a : ℂ => cexp ((1 / (2 : ℂ))* (log a))) +@[expose] noncomputable def csqrt : ℂ → ℂ := (fun a : ℂ => cexp ((1 / (2 : ℂ))* (log a))) lemma csqrt_deriv (z : ℍ) : deriv (fun a : ℂ => cexp ((1 / (2 : ℂ))* (log a))) z = (2 : ℂ)⁻¹ • (fun a : ℂ => cexp (-(1 / (2 : ℂ)) * (log a))) z:= by diff --git a/LeanPool/LeanModularForms/Modularforms/Delta.lean b/LeanPool/LeanModularForms/Modularforms/Delta.lean index 79582dbfff..d6e077fc98 100644 --- a/LeanPool/LeanModularForms/Modularforms/Delta.lean +++ b/LeanPool/LeanModularForms/Modularforms/Delta.lean @@ -21,7 +21,7 @@ import Mathlib.Analysis.Normed.Group.Tannery /-! # Delta -/ -@[expose] public section +public section open ModularForm EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex MatrixGroups @@ -34,7 +34,7 @@ noncomputable section Definitions /- The discriminant form -/ /-- The modular discriminant `Δ` on the upper half-plane, via its product expansion. -/ -def Δ (z : UpperHalfPlane) := cexp (2 * π * Complex.I * z) * ∏' (n : ℕ), +@[expose] def Δ (z : UpperHalfPlane) := cexp (2 * π * Complex.I * z) * ∏' (n : ℕ), (1 - cexp (2 * π * Complex.I * (n + 1) * z)) ^ 24 lemma DiscriminantProductFormula (z : ℍ) : Δ z = cexp (2 * π * Complex.I * z) * ∏' (n : ℕ+), @@ -314,6 +314,7 @@ lemma Discriminant_zeroAtImInfty : · apply Delta_boundedfactor /-- The modular discriminant as a weight-12 cusp form on `SL(2, ℤ)`. -/ +@[expose] def Delta : CuspForm (CongruenceSubgroup.Gamma 1) 12 where toFun := DiscriminantSIF slash_action_eq' := DiscriminantSIF.slash_action_eq' @@ -408,7 +409,7 @@ theorem div_Delta_is_SIF (k : ℤ) (f : CuspForm (CongruenceSubgroup.Gamma 1) k) ring /-- Divides a weight-`k` cusp form by `Δ` to obtain a weight-`(k - 12)` modular form. -/ -def CuspFormDivDiscriminant (k : ℤ) (f : CuspForm (CongruenceSubgroup.Gamma 1) k) : +@[expose] def CuspFormDivDiscriminant (k : ℤ) (f : CuspForm (CongruenceSubgroup.Gamma 1) k) : ModularForm (CongruenceSubgroup.Gamma 1) (k - 12) where toFun := f / Delta slash_action_eq' := fun γ hγ => div_Delta_is_SIF _ _ γ hγ @@ -467,7 +468,9 @@ def CuspFormDivDiscriminant (k : ℤ) (f : CuspForm (CongruenceSubgroup.Gamma 1) · simp_all lemma CuspForm_div_Discriminant_apply (k : ℤ) (f : CuspForm (CongruenceSubgroup.Gamma 1) k) - (z : ℍ) : (CuspFormDivDiscriminant k f) z = f z / Δ z := rfl + (z : ℍ) : (CuspFormDivDiscriminant k f) z = f z / Δ z := by + change f z / Delta z = f z / Δ z + rw [Delta_apply] theorem CuspForm_div_Discriminant_Add (k : ℤ) (x y : CuspForm (CongruenceSubgroup.Gamma 1) k) : (fun f ↦ CuspFormDivDiscriminant k f) (x + y) = diff --git a/LeanPool/LeanModularForms/Modularforms/Derivative.lean b/LeanPool/LeanModularForms/Modularforms/Derivative.lean index c162faaf4a..8166db6721 100644 --- a/LeanPool/LeanModularForms/Modularforms/Derivative.lean +++ b/LeanPool/LeanModularForms/Modularforms/Derivative.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Complex.Liouville /-! # Derivative -/ -@[expose] public section +public section open UpperHalfPlane hiding I open Real Complex CongruenceSubgroup SlashAction SlashInvariantForm ContinuousMap @@ -47,7 +47,7 @@ Definition of (Serre) derivative of modular forms. Prove Ramanujan's formulas on derivatives of Eisenstein series. -/ /-- The Serre/Ramanujan derivative `D = (2πi)⁻¹ d/dz` of a function on the upper half-plane. -/ -noncomputable def D (F : ℍ → ℂ) : ℍ → ℂ := +@[expose] noncomputable def D (F : ℍ → ℂ) : ℍ → ℂ := fun (z : ℍ) => (2 * π * I)⁻¹ * ((deriv (F ∘ ofComplex)) z) /-- @@ -344,7 +344,7 @@ theorem D_qexp_tsum_pnat (a : ℕ+ → ℂ) (z : ℍ) Serre derivative of weight $k$. Note that the definition makes sense for any analytic function $F : \mathbb{H} \to \mathbb{C}$. -/ -noncomputable def serreD (k : ℂ) : (ℍ → ℂ) → (ℍ → ℂ) := +@[expose] noncomputable def serreD (k : ℂ) : (ℍ → ℂ) → (ℍ → ℂ) := fun (F : ℍ → ℂ) => (fun z => D F z - k * 12⁻¹ * E₂ z * F z) @[simp] diff --git a/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean b/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean index 77863a2f1b..966b2727e7 100644 --- a/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean +++ b/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Rat.Star /-! # DimensionFormulas -/ -@[expose] public section +public section open ModularForm hiding E₄ E₆ open LevelOneEisenstein @@ -27,7 +27,7 @@ open scoped Interval Real NNReal ENNReal Topology BigOperators Nat noncomputable section /-- Multiplication by the discriminant `Δ`, as a map from weight `k - 12` to weight `k`. -/ -def mulDeltaMap (k : ℤ) (f : ModularForm (CongruenceSubgroup.Gamma 1) (k - 12)) : +@[expose] def mulDeltaMap (k : ℤ) (f : ModularForm (CongruenceSubgroup.Gamma 1) (k - 12)) : ModularForm (CongruenceSubgroup.Gamma 1) k := by have := (f.mul (ModFormMk _ 12 Delta)) have hk : k - 12 + 12 = k := by ring diff --git a/LeanPool/LeanModularForms/Modularforms/E2.lean b/LeanPool/LeanModularForms/Modularforms/E2.lean index 7531094bce..1576ab9b33 100644 --- a/LeanPool/LeanModularForms/Modularforms/E2.lean +++ b/LeanPool/LeanModularForms/Modularforms/E2.lean @@ -14,7 +14,7 @@ import Mathlib.NumberTheory.ModularForms.EisensteinSeries.E2.Transform /-! # E2 -/ -@[expose] public section +public section open ModularForm UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex MatrixGroups @@ -29,10 +29,10 @@ noncomputable section def G₂ : ℍ → ℂ := EisensteinSeries.G2 /-- Compatibility alias for Mathlib's `EisensteinSeries.E2`. -/ -def E₂ : ℍ → ℂ := EisensteinSeries.E2 +@[expose] def E₂ : ℍ → ℂ := EisensteinSeries.E2 /-- Compatibility alias for Mathlib's `EisensteinSeries.D2`. -/ -def D₂ (γ : SL(2, ℤ)) : ℍ → ℂ := EisensteinSeries.D2 γ +@[expose] def D₂ (γ : SL(2, ℤ)) : ℍ → ℂ := EisensteinSeries.D2 γ lemma D₂_apply (γ : SL(2, ℤ)) (z : ℍ) : D₂ γ z = (2 * π * Complex.I * γ 1 0) / (γ 1 0 * z + γ 1 1) := by rfl diff --git a/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean b/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean index 0db6dba017..25128ae887 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean @@ -21,7 +21,7 @@ import Mathlib.Data.Int.Star /-! # Eisenstein -/ -@[expose] public section +public section open ModularForm hiding E₄ E₆ open LevelOneEisenstein @@ -116,14 +116,14 @@ noncomputable section /- φ₀, φ₋₂ and φ₋₄, except we can't use - signs in subscripts for definitions... -/ /-- The auxiliary quotient `((E₂ E₄ - E₆) ^ 2) / Δ` on the upper half-plane. -/ -def φ₀ (z : ℍ) := (((E₂ z) * (E₄ z) - (E₆ z)) ^ 2) / (Δ z) +@[expose] def φ₀ (z : ℍ) := (((E₂ z) * (E₄ z) - (E₆ z)) ^ 2) / (Δ z) /-- The auxiliary quotient `E₄ (E₂ E₄ - E₆) / Δ` on the upper half-plane. -/ -def φ₂' (z : ℍ) := (E₄ z) * ((E₂ z) * (E₄ z) - (E₆ z)) / (Δ z) +@[expose] def φ₂' (z : ℍ) := (E₄ z) * ((E₂ z) * (E₄ z) - (E₆ z)) / (Δ z) /-- The auxiliary quotient `E₄ ^ 2 / Δ` on the upper half-plane. -/ -def φ₄' (z : ℍ) := ((E₄ z) ^ 2) / (Δ z) +@[expose] def φ₄' (z : ℍ) := ((E₄ z) ^ 2) / (Δ z) /- We extend these definitions to ℂ for convenience. -/ /-- The extension of `φ₀` to all of `ℂ`, set to `0` off the upper half-plane. -/ -def φ₀'' (z : ℂ) : ℂ := if hz : 0 < z.im then φ₀ ⟨z, hz⟩ else 0 +@[expose] def φ₀'' (z : ℂ) : ℂ := if hz : 0 < z.im then φ₀ ⟨z, hz⟩ else 0 /-- The extension of `φ₂'` to all of `ℂ`, set to `0` off the upper half-plane. -/ def φ₂'' (z : ℂ) : ℂ := if hz : 0 < z.im then φ₂' ⟨z, hz⟩ else 0 /-- The extension of `φ₄'` to all of `ℂ`, set to `0` off the upper half-plane. -/ @@ -610,7 +610,7 @@ theorem E4E6_coeff_zero_eq_zero : simp /-- The discriminant cusp form built from `E₄` and `E₆` via `(E₄ ^ 3 - E₆ ^ 2) / 1728`. -/ -def DeltaE4E6Aux : CuspForm (CongruenceSubgroup.Gamma 1) 12 := +@[expose] def DeltaE4E6Aux : CuspForm (CongruenceSubgroup.Gamma 1) 12 := let F := DirectSum.of _ 4 E₄ let G := DirectSum.of _ 6 E₆ cuspFormOfCoeffZero ((1 / 1728 : ℂ) • (F ^ 3 - G ^ 2) 12) E4E6_coeff_zero_eq_zero diff --git a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean index 34dd656613..feb8a0c00b 100644 --- a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean +++ b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Real.Pi.Bounds /-! # EisensteinAsymptotics -/ -@[expose] public section +public section /-! # Asymptotic Behavior of Eisenstein Series diff --git a/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean b/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean index 0d6e89664b..7bbfdf8980 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean @@ -19,7 +19,7 @@ import Mathlib.Topology.Separation.CompletelyRegular /-! # Eisensteinqexpansions -/ -@[expose] public section +public section open ModularForm EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex @@ -39,7 +39,7 @@ namespace LevelOneEisenstein Namespaced to avoid a whole-library name clash with the root-level `E` declared in another pooled project (`Rupert`). -/ -def E (k : ℤ) (hk : 3 ≤ k) : ModularForm (CongruenceSubgroup.Gamma ↑1) k := +@[expose] def E (k : ℤ) (hk : 3 ≤ k) : ModularForm (CongruenceSubgroup.Gamma ↑1) k := (1/2 : ℂ) • eisensteinSeriesMF hk standardcongruencecondition /-they need 1/2 for the normalization to match up (since the sum here is taken over coprime integers).-/ diff --git a/LeanPool/LeanModularForms/Modularforms/Equivs.lean b/LeanPool/LeanModularForms/Modularforms/Equivs.lean index 55a40290ca..87b1d515f2 100644 --- a/LeanPool/LeanModularForms/Modularforms/Equivs.lean +++ b/LeanPool/LeanModularForms/Modularforms/Equivs.lean @@ -21,7 +21,7 @@ import Mathlib.Topology.MetricSpace.Bounded /-! # Equivs -/ -@[expose] public section +public section @@ -31,7 +31,7 @@ open TopologicalSpace Set /-- Negation as an equivalence `ℤ ≃ ℤ`. -/ -def negEquiv : ℤ ≃ ℤ where +@[expose] def negEquiv : ℤ ≃ ℤ where toFun n := -n invFun n := -n left_inv := neg_neg @@ -50,15 +50,15 @@ def succEquiv : ℤ ≃ ℤ where /-- Swaps the two entries of a length-2 vector. -/ -def swap {α : Type*} : (Fin 2 → α) → (Fin 2 → α) := fun x => ![x 1, x 0] +@[expose] def swap {α : Type*} : (Fin 2 → α) → (Fin 2 → α) := fun x => ![x 1, x 0] @[simp] -lemma swap_apply {α : Type*} (b : Fin 2 → α) : swap b = ![b 1, b 0] := rfl +lemma swap_apply {α : Type*} (b : Fin 2 → α) : swap b = ![b 1, b 0] := by rfl lemma swap_involutive {α : Type*} (b : Fin 2 → α) : swap (swap b) = b := by ext i fin_cases i <;> rfl /-- Swapping the two entries of a length-2 vector as an equivalence. -/ -def swapEquiv {α : Type*} : Equiv (Fin 2 → α) (Fin 2 → α) := Equiv.mk swap swap +@[expose] def swapEquiv {α : Type*} : Equiv (Fin 2 → α) (Fin 2 → α) := Equiv.mk swap swap swap_involutive swap_involutive diff --git a/LeanPool/LeanModularForms/Modularforms/Eta.lean b/LeanPool/LeanModularForms/Modularforms/Eta.lean index c7470ca78f..41d15b0ea9 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eta.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eta.lean @@ -14,7 +14,7 @@ import LeanPool.LeanModularForms.Modularforms.Upperhalfplane /-! # Eta -/ -@[expose] public section +public section open ModularForm EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean b/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean index 9136f135cd..20259ef6d3 100644 --- a/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean +++ b/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean @@ -21,7 +21,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt /-! # EtaCleanup -/ -@[expose] public section +public section open ModularForm EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral @@ -73,7 +73,7 @@ local notation "ηₚ" => etaProdTerm /-- The Dedekind eta function, defined on all of `ℂ` so that its logarithmic derivative can be taken. -/ -noncomputable def dedekindEtaFun' (z : ℂ) := (𝕢 24 z) * ηₚ z +@[expose] noncomputable def dedekindEtaFun' (z : ℂ) := (𝕢 24 z) * ηₚ z local notation "η" => dedekindEtaFun' diff --git a/LeanPool/LeanModularForms/Modularforms/ExpLems.lean b/LeanPool/LeanModularForms/Modularforms/ExpLems.lean index 7cbd01e8cf..f0b2c88b7b 100644 --- a/LeanPool/LeanModularForms/Modularforms/ExpLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/ExpLems.lean @@ -12,7 +12,7 @@ public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic /-! # ExpLems -/ -@[expose] public section +public section open UpperHalfPlane TopologicalSpace Set diff --git a/LeanPool/LeanModularForms/Modularforms/ForMathlibCusps.lean b/LeanPool/LeanModularForms/Modularforms/ForMathlibCusps.lean index bb72932b6a..ac3cbc24ea 100644 --- a/LeanPool/LeanModularForms/Modularforms/ForMathlibCusps.lean +++ b/LeanPool/LeanModularForms/Modularforms/ForMathlibCusps.lean @@ -11,7 +11,7 @@ public import Mathlib.NumberTheory.ModularForms.BoundedAtCusp /-! # ForMathlibCusps -/ -@[expose] public section +public section open scoped MatrixGroups ModularForm UpperHalfPlane diff --git a/LeanPool/LeanModularForms/Modularforms/ForMathlibUpperHalfPlane.lean b/LeanPool/LeanModularForms/Modularforms/ForMathlibUpperHalfPlane.lean index d8e6cee08b..2943123ada 100644 --- a/LeanPool/LeanModularForms/Modularforms/ForMathlibUpperHalfPlane.lean +++ b/LeanPool/LeanModularForms/Modularforms/ForMathlibUpperHalfPlane.lean @@ -11,7 +11,7 @@ public import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup /-! # ForMathlibUpperHalfPlane -/ -@[expose] public section +public section -- Probably put it at LinearAlgebra/Matrix/SpecialLinearGroup.lean diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean index 0528155bee..ab200aa772 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean @@ -19,7 +19,7 @@ along with basic API lemmas (evaluation on generators, odd-weight vanishing, monomial weight existence, and `Δ ∈ range evalE₄E₆`). -/ -@[expose] public section +public section open ModularForm hiding E₄ E₆ open LevelOneEisenstein @@ -32,7 +32,7 @@ open scoped Interval Real NNReal ENNReal Topology BigOperators Nat noncomputable section /-- Weight function assigning weight 4 to E₄ (variable 0) and weight 6 to E₆ (variable 1). -/ -def E₄E₆Weight : Fin 2 → ℕ := ![4, 6] +@[expose] def E₄E₆Weight : Fin 2 → ℕ := ![4, 6] /-- Evaluation homomorphism sending `ℂ[X₀, X₁]` to the graded ring of level 1 modular forms via `X₀ ↦ E₄` and `X₁ ↦ E₆`. -/ @@ -45,7 +45,7 @@ noncomputable def evalE₄E₆ : /-- The polynomial `Δ_poly = (1/1728)(X₀³ - X₁²)` in `ℂ[X₀, X₁]`, mapping to `Δ` under `evalE₄E₆`. -/ -noncomputable def DeltaPoly : MvPolynomial (Fin 2) ℂ := +@[expose] noncomputable def DeltaPoly : MvPolynomial (Fin 2) ℂ := (1 / 1728 : ℂ) • (MvPolynomial.X 0 ^ 3 - MvPolynomial.X 1 ^ 2) /-! ## Odd-weight vanishing -/ diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean index ddfb2498bc..ff6d3e6979 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean @@ -23,7 +23,7 @@ the algebra isomorphism `modularFormsEquivMvPolynomial` and the generation theorem `E₄E₆_generate`. -/ -@[expose] public section +public section open ModularForm hiding E₄ E₆ open EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean index 47b7b9e1ad..1f55dff337 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean @@ -18,7 +18,7 @@ We prove that `evalE₄E₆` is surjective by showing each `DirectSum.of _ k f` its range (strong induction on weight), then using the subalgebra closure of the range. -/ -@[expose] public section +public section open ModularForm hiding E₄ E₆ open EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral diff --git a/LeanPool/LeanModularForms/Modularforms/IccIcoLems.lean b/LeanPool/LeanModularForms/Modularforms/IccIcoLems.lean index 1015f448af..8ae6e3b49f 100644 --- a/LeanPool/LeanModularForms/Modularforms/IccIcoLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/IccIcoLems.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.ContinuousFunctionalCalculus /-! # IccIcoLems -/ -@[expose] public section +public section open TopologicalSpace Set Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean b/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean index 3bfdd6513a..ac257f16af 100644 --- a/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean +++ b/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.SpecialFunctions.Bernstein /-! # IsCuspForm -/ -@[expose] public section +public section open ModularForm UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex MatrixGroups @@ -35,7 +35,7 @@ variable {k : ℤ} {F : Type*} [FunLike F ℍ ℂ] {Γ : Subgroup SL(2, ℤ)} (n open scoped Real MatrixGroups CongruenceSubgroup /-- Views a cusp form as a modular form. -/ -def ModFormMk (Γ : Subgroup SL(2, ℤ)) (k : ℤ) (f : CuspForm Γ k) : ModularForm Γ k where +@[expose] def ModFormMk (Γ : Subgroup SL(2, ℤ)) (k : ℤ) (f : CuspForm Γ k) : ModularForm Γ k where toFun := f slash_action_eq' := f.slash_action_eq' holo' := f.holo' @@ -50,6 +50,7 @@ lemma ModForm_mk_inj (Γ : Subgroup SL(2, ℤ)) (k : ℤ) (f : CuspForm Γ k) (h exact hx /-- The linear inclusion of cusp forms into modular forms. -/ +@[expose] def CuspFormToModularForm (Γ : Subgroup SL(2, ℤ)) (k : ℤ) : CuspForm Γ k →ₗ[ℂ] ModularForm Γ k where toFun f := ModFormMk Γ k f @@ -57,7 +58,7 @@ def CuspFormToModularForm (Γ : Subgroup SL(2, ℤ)) (k : ℤ) : CuspForm Γ k map_smul' _ _ := rfl /-- The submodule of modular forms that are cusp forms. -/ -def CuspFormSubmodule (Γ : Subgroup SL(2, ℤ)) (k : ℤ) : Submodule ℂ (ModularForm Γ k) := +@[expose] def CuspFormSubmodule (Γ : Subgroup SL(2, ℤ)) (k : ℤ) : Submodule ℂ (ModularForm Γ k) := LinearMap.range (CuspFormToModularForm Γ k) /-- The linear isomorphism between cusp forms and the cusp-form submodule. -/ @@ -89,7 +90,7 @@ instance (Γ : Subgroup SL(2, ℤ)) (k : ℤ) : CuspFormClass (CuspFormSubmodule exact g.zero_at_cusps' hc /-- The predicate that a modular form lies in the cusp-form submodule. -/ -def IsCuspForm (Γ : Subgroup SL(2, ℤ)) (k : ℤ) (f : ModularForm Γ k) : Prop := +@[expose] def IsCuspForm (Γ : Subgroup SL(2, ℤ)) (k : ℤ) (f : ModularForm Γ k) : Prop := f ∈ CuspFormSubmodule Γ k /-- Promotes a modular form satisfying `IsCuspForm` to a cusp form. -/ @@ -180,4 +181,3 @@ lemma IsCuspForm_iff_coeffZero_eq_zero (k : ℤ) (f : ModularForm Γ(1) k) : lemma CuspFormSubmodule_mem_iff_coeffZero_eq_zero (k : ℤ) (f : ModularForm Γ(1) k) : f ∈ CuspFormSubmodule Γ(1) k ↔ (qExpansion 1 f).coeff 0 = 0 := IsCuspForm_iff_coeffZero_eq_zero k f - diff --git a/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean b/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean index 3dfe52b2fa..f934c48cb5 100644 --- a/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean +++ b/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.SpecialFunctions.ExpDeriv /-! # Iteratedderivs -/ -@[expose] public section +public section open UpperHalfPlane TopologicalSpace Set Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean b/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean index 2c2131bbb9..c4cc095232 100644 --- a/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean +++ b/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean @@ -23,7 +23,7 @@ import Mathlib.Order.CompletePartialOrder /-! # JacobiTheta -/ -@[expose] public section +public section /-! # Jacobi theta functions diff --git a/LeanPool/LeanModularForms/Modularforms/LimunderLems.lean b/LeanPool/LeanModularForms/Modularforms/LimunderLems.lean index f2de4a4043..c5b883f22d 100644 --- a/LeanPool/LeanModularForms/Modularforms/LimunderLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/LimunderLems.lean @@ -12,7 +12,7 @@ import LeanPool.LeanModularForms.Modularforms.IccIcoLems /-! # LimunderLems -/ -@[expose] public section +public section open TopologicalSpace Set Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean b/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean index b5256f79b9..0544270bf7 100644 --- a/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Complex.LocallyUniformLimit /-! # LogDerivLems -/ -@[expose] public section +public section diff --git a/LeanPool/LeanModularForms/Modularforms/MDifferentiableFunProp.lean b/LeanPool/LeanModularForms/Modularforms/MDifferentiableFunProp.lean index f1526d8a24..505088f4d8 100644 --- a/LeanPool/LeanModularForms/Modularforms/MDifferentiableFunProp.lean +++ b/LeanPool/LeanModularForms/Modularforms/MDifferentiableFunProp.lean @@ -12,7 +12,7 @@ public import LeanPool.LeanModularForms.Modularforms.Eisenstein /-! # MDifferentiableFunProp -/ -@[expose] public section +public section open scoped Manifold UpperHalfPlane EisensteinSeries diff --git a/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean b/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean index 27c86e2c61..ab9c5d83ed 100644 --- a/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.SpecialFunctions.Log.Summable /-! # MultipliableLems -/ -@[expose] public section +public section open EisensteinSeries UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/PhiTransform.lean b/LeanPool/LeanModularForms/Modularforms/PhiTransform.lean index 4fd15a169a..0cae4c4788 100644 --- a/LeanPool/LeanModularForms/Modularforms/PhiTransform.lean +++ b/LeanPool/LeanModularForms/Modularforms/PhiTransform.lean @@ -11,7 +11,7 @@ public import LeanPool.LeanModularForms.Modularforms.Eisenstein /-! # PhiTransform -/ -@[expose] public section +public section /-! # Transformation Rules for φ₀ diff --git a/LeanPool/LeanModularForms/Modularforms/QExpansion.lean b/LeanPool/LeanModularForms/Modularforms/QExpansion.lean index 2db28b1031..0e7c81cf8b 100644 --- a/LeanPool/LeanModularForms/Modularforms/QExpansion.lean +++ b/LeanPool/LeanModularForms/Modularforms/QExpansion.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Normed.Group.Tannery /-! # QExpansion -/ -@[expose] public section +public section /-! # Limits at infinity diff --git a/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean b/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean index 5affd4dd57..05d1b936ee 100644 --- a/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean @@ -12,7 +12,7 @@ public import Mathlib.NumberTheory.ModularForms.QExpansion /-! # QExpansionLems -/ -@[expose] public section +public section open ModularForm UpperHalfPlane TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex MatrixGroups diff --git a/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean b/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean index 723f114c53..0394ec85fc 100644 --- a/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean +++ b/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Int.Star /-! # RamanujanIdentities -/ -@[expose] public section +public section /-! # Ramanujan Identities for Eisenstein Series diff --git a/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean b/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean index b67593a7c5..08bb9bf42e 100644 --- a/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean +++ b/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean @@ -16,7 +16,7 @@ import Mathlib.NumberTheory.ModularForms.QExpansion /-! # ResToImagAxis -/ -@[expose] public section +public section open UpperHalfPlane hiding I @@ -28,13 +28,13 @@ open scoped Interval Real Topology Manifold ModularForm MatrixGroups Restrict a function `F : ℍ → ℂ` to the positive imaginary axis, i.e. `t ↦ F (I * t)`. If $t \le 0$, then `F (I * t)` is not defined, and we return `0` in that case. -/ -noncomputable def ResToImagAxis (F : ℍ → ℂ) : ℝ → ℂ := +@[expose] noncomputable def ResToImagAxis (F : ℍ → ℂ) : ℝ → ℂ := fun t => if ht : 0 < t then F ⟨(I * t), by simp [ht]⟩ else 0 namespace Function /-- Dot notation alias for `ResToImagAxis`. -/ -noncomputable def resToImagAxis (F : ℍ → ℂ) : ℝ → ℂ := ResToImagAxis F +@[expose] noncomputable def resToImagAxis (F : ℍ → ℂ) : ℝ → ℂ := ResToImagAxis F @[simp] lemma resToImagAxis_eq_resToImagAxis (F : ℍ → ℂ) : F.resToImagAxis = ResToImagAxis F := rfl @@ -48,14 +48,14 @@ end Function Function $F : \mathbb{H} \to \mathbb{C}$ whose restriction to the imaginary axis is real-valued, i.e. imaginary part is zero. -/ -@[fun_prop] +@[fun_prop, expose] noncomputable def ResToImagAxis.Real (F : ℍ → ℂ) : Prop := ∀ t : ℝ, 0 < t → (F.resToImagAxis t).im = 0 /-- Function $F : \mathbb{H} \to \mathbb{C}$ is real and positive on the imaginary axis. -/ -@[fun_prop] +@[fun_prop, expose] noncomputable def ResToImagAxis.Pos (F : ℍ → ℂ) : Prop := ResToImagAxis.Real F ∧ ∀ t : ℝ, 0 < t → 0 < (F.resToImagAxis t).re diff --git a/LeanPool/LeanModularForms/Modularforms/RiemannZetalems.lean b/LeanPool/LeanModularForms/Modularforms/RiemannZetalems.lean index b396d62c87..21f1117262 100644 --- a/LeanPool/LeanModularForms/Modularforms/RiemannZetalems.lean +++ b/LeanPool/LeanModularForms/Modularforms/RiemannZetalems.lean @@ -12,7 +12,7 @@ public import Mathlib.NumberTheory.LSeries.RiemannZeta /-! # RiemannZetalems -/ -@[expose] public section +public section open TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/SerreDerivativeSlash.lean b/LeanPool/LeanModularForms/Modularforms/SerreDerivativeSlash.lean index fafe396ba8..372e5c3a53 100644 --- a/LeanPool/LeanModularForms/Modularforms/SerreDerivativeSlash.lean +++ b/LeanPool/LeanModularForms/Modularforms/SerreDerivativeSlash.lean @@ -11,7 +11,7 @@ public import LeanPool.LeanModularForms.Modularforms.Derivative /-! # SerreDerivativeSlash -/ -@[expose] public section +public section /-! # Slash Invariance of Serre Derivative of E₂ diff --git a/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean b/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean index 24f6e0c259..6bbf764d1b 100644 --- a/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean +++ b/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean @@ -14,7 +14,7 @@ import Mathlib.LinearAlgebra.Matrix.FixedDetMatrices /-! # SlashActionAuxil -/ -@[expose] public section +public section /-! # Auxiliary theorems for the slash actions groups SL(2, ℤ) and Γ(2) diff --git a/LeanPool/LeanModularForms/Modularforms/SummableLems.lean b/LeanPool/LeanModularForms/Modularforms/SummableLems.lean index e16f59fa86..b9d99e4f34 100644 --- a/LeanPool/LeanModularForms/Modularforms/SummableLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/SummableLems.lean @@ -24,7 +24,7 @@ import Mathlib.Topology.Separation.CompletelyRegular /-! # SummableLems -/ -@[expose] public section +public section open EisensteinSeries UpperHalfPlane TopologicalSpace Set diff --git a/LeanPool/LeanModularForms/Modularforms/Tendstolems.lean b/LeanPool/LeanModularForms/Modularforms/Tendstolems.lean index 94dc653caf..3a897cf2c6 100644 --- a/LeanPool/LeanModularForms/Modularforms/Tendstolems.lean +++ b/LeanPool/LeanModularForms/Modularforms/Tendstolems.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.SpecificLimits.Normed /-! # Tendstolems -/ -@[expose] public section +public section open TopologicalSpace Set Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean b/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean index 84b4803992..30985e0181 100644 --- a/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean +++ b/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean @@ -16,7 +16,7 @@ import Mathlib.Data.Int.Star /-! # ThetaDerivIdentities -/ -@[expose] public section +public section /-! # Theta Derivative Identities diff --git a/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean b/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean index 4888913963..472c62b470 100644 --- a/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean +++ b/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean @@ -20,7 +20,7 @@ import Mathlib.Topology.ContinuousMap.Compact /-! # TsumderivWithin -/ -@[expose] public section +public section open UpperHalfPlane TopologicalSpace Set diff --git a/LeanPool/LeanModularForms/Modularforms/Uniformcts.lean b/LeanPool/LeanModularForms/Modularforms/Uniformcts.lean index 131a66d083..a780671310 100644 --- a/LeanPool/LeanModularForms/Modularforms/Uniformcts.lean +++ b/LeanPool/LeanModularForms/Modularforms/Uniformcts.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset /-! # Uniformcts -/ -@[expose] public section +public section /-! diff --git a/LeanPool/LeanModularForms/Modularforms/Upperhalfplane.lean b/LeanPool/LeanModularForms/Modularforms/Upperhalfplane.lean index d991b7b2ac..fd6795e9ab 100644 --- a/LeanPool/LeanModularForms/Modularforms/Upperhalfplane.lean +++ b/LeanPool/LeanModularForms/Modularforms/Upperhalfplane.lean @@ -11,7 +11,7 @@ public import Mathlib.Analysis.Complex.UpperHalfPlane.Basic /-! # Upperhalfplane -/ -@[expose] public section +public section open UpperHalfPlane TopologicalSpace Set Metric Filter Function Complex diff --git a/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean b/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean index c510bea9c4..fed29fd070 100644 --- a/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean +++ b/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean @@ -40,7 +40,7 @@ The proof chain is: 7. Combined with `Delta = Theta(exp(-2*pi*Im))`, `phi0` is bounded -/ -@[expose] public section +public section open Complex Set Filter Topology MeasureTheory ModularFormClass diff --git a/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean b/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean index 0ade6a1407..1cff087524 100644 --- a/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean +++ b/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean @@ -18,7 +18,7 @@ the Dedekind eta function. Since η is holomorphic and nonvanishing on ℍ, `logDeriv(η)` is holomorphic, hence E₂ is holomorphic. -/ -@[expose] public section +public section open UpperHalfPlane Set Filter Topology Function open scoped Real diff --git a/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean b/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean index be89db0ab9..03489ae31f 100644 --- a/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean +++ b/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean @@ -87,7 +87,7 @@ singularities directly: residue theorem." arXiv:1808.00997v2. -/ -@[expose] public section +public section open Complex Set Filter Topology MeasureTheory open scoped Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean index f8733dea16..60fde609c1 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean @@ -25,7 +25,7 @@ for SL₂(ℤ), both at fixed height `heightCutoff` and at variable height `H`. * `seg5QRadiusH` — q-expansion radius e^(-2πH) -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -33,7 +33,7 @@ open scoped Real Interval noncomputable section /-- Height cutoff for the finite-height fundamental domain boundary. -/ -def heightCutoff : ℝ := Real.sqrt 3 / 2 + 1 +@[expose] def heightCutoff : ℝ := Real.sqrt 3 / 2 + 1 lemma one_lt_heightCutoff : 1 < heightCutoff := by unfold heightCutoff; linarith [Real.sqrt_pos_of_pos (show (3 : ℝ) > 0 by norm_num)] @@ -42,28 +42,28 @@ lemma sqrt3_div2_lt_heightCutoff : Real.sqrt 3 / 2 < heightCutoff := by unfold heightCutoff; linarith /-- Segment 1: right vertical from (1/2 + H·i) down to ρ+1. -/ -def fdBoundarySeg1 : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg1 : ℝ → ℂ := fun t => 1 / 2 + (heightCutoff - t * (heightCutoff - Real.sqrt 3 / 2)) * I /-- Segment 2: arc from ρ+1 to i (angle π/3 → π/2). -/ -def fdBoundarySeg2 : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg2 : ℝ → ℂ := fun t => Complex.exp ((Real.pi / 3 + (t - 1) * (Real.pi / 2 - Real.pi / 3)) * I) /-- Segment 3: arc from i to ρ (angle π/2 → 2π/3). -/ -def fdBoundarySeg3 : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg3 : ℝ → ℂ := fun t => Complex.exp ((Real.pi / 2 + (t - 2) * (2 * Real.pi / 3 - Real.pi / 2)) * I) /-- Segment 4: left vertical from ρ up to (-1/2 + H·i). -/ -def fdBoundarySeg4 : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg4 : ℝ → ℂ := fun t => -1 / 2 + (Real.sqrt 3 / 2 + (t - 3) * (heightCutoff - Real.sqrt 3 / 2)) * I /-- Segment 5: horizontal from (-1/2 + H·i) to (1/2 + H·i). -/ -def fdBoundarySeg5 : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg5 : ℝ → ℂ := fun t => (t - 9 / 2) + heightCutoff * I /-- Boundary of the standard fundamental domain at fixed height `heightCutoff`, parameterized over [0, 5]. -/ -def fdBoundary : ℝ → ℂ := fun t => +@[expose] def fdBoundary : ℝ → ℂ := fun t => if t ≤ 1 then 1 / 2 + (heightCutoff - t * (heightCutoff - Real.sqrt 3 / 2)) * I @@ -83,10 +83,10 @@ def fdBoundary : ℝ → ℂ := fun t => (t - 9 / 2) + heightCutoff * I /-- Interior partition points of fdBoundary. -/ -def fdPartition : Finset ℝ := {1, 2, 3, 4} +@[expose] def fdPartition : Finset ℝ := {1, 2, 3, 4} /-- Full partition including endpoints. -/ -def fdBoundaryFullPartition : Finset ℝ := {0, 1, 2, 3, 4, 5} +@[expose] def fdBoundaryFullPartition : Finset ℝ := {0, 1, 2, 3, 4, 5} lemma fdBoundary_at_zero : fdBoundary 0 = 1 / 2 + heightCutoff * I := by @@ -142,25 +142,25 @@ lemma fdBoundary_closed : fdBoundary 0 = fdBoundary 5 := by /-- Segment 1 at height H: right vertical from (1/2 + H·i) down to ρ+1. -/ -def fdBoundarySeg1H (H : ℝ) : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg1H (H : ℝ) : ℝ → ℂ := fun t => 1 / 2 + (H - t * (H - Real.sqrt 3 / 2)) * I /-- Segment 2 at height H (H-independent): arc from ρ+1 to i. -/ -def fdBoundarySeg2H : ℝ → ℂ := fdBoundarySeg2 +@[expose] def fdBoundarySeg2H : ℝ → ℂ := fdBoundarySeg2 /-- Segment 3 at height H (H-independent): arc from i to ρ. -/ -def fdBoundarySeg3H : ℝ → ℂ := fdBoundarySeg3 +@[expose] def fdBoundarySeg3H : ℝ → ℂ := fdBoundarySeg3 /-- Segment 4 at height H: left vertical from ρ up to (-1/2 + H·i). -/ -def fdBoundarySeg4H (H : ℝ) : ℝ → ℂ := fun t => +@[expose] def fdBoundarySeg4H (H : ℝ) : ℝ → ℂ := fun t => -1 / 2 + (Real.sqrt 3 / 2 + (t - 3) * (H - Real.sqrt 3 / 2)) * I /-- Segment 5 at height H: horizontal from (-1/2 + H·i) to (1/2 + H·i). -/ -def fdBoundarySeg5H (H : ℝ) : ℝ → ℂ := fun t => (t - 9 / 2) + H * I +@[expose] def fdBoundarySeg5H (H : ℝ) : ℝ → ℂ := fun t => (t - 9 / 2) + H * I /-- Boundary of the standard fundamental domain at variable height H, parameterized over [0, 5]. -/ -def fdBoundaryH (H : ℝ) : ℝ → ℂ := fun t => +@[expose] def fdBoundaryH (H : ℝ) : ℝ → ℂ := fun t => if t ≤ 1 then 1 / 2 + (H - t * (H - Real.sqrt 3 / 2)) * I else if t ≤ 2 then @@ -180,10 +180,10 @@ def fdBoundaryH (H : ℝ) : ℝ → ℂ := fun t => /-- Non-differentiable corner points of fdBoundaryH (excluding smooth transitions at t = 2). -/ -def fdBoundaryHPartition : Finset ℝ := {1, 3, 4} +@[expose] def fdBoundaryHPartition : Finset ℝ := {1, 3, 4} /-- The q-expansion radius at height H: e^(-2πH). -/ -def seg5QRadiusH (H : ℝ) : ℝ := Real.exp (-2 * Real.pi * H) +@[expose] def seg5QRadiusH (H : ℝ) : ℝ := Real.exp (-2 * Real.pi * H) theorem fdBoundary_eq_fdBoundary_H : fdBoundary = fdBoundaryH heightCutoff := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean index 3f4f0d8bfe..3af4f6affe 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean @@ -23,7 +23,7 @@ fundamental domain boundary. * `fdBoundary_continuous` — continuity of fixed-height boundary -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean index d0590025e6..467f729b20 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean @@ -25,7 +25,7 @@ for the fundamental domain boundary. * `fdBoundaryImmersion` — fixed-height boundary as `PiecewiseC1Immersion` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval @@ -568,7 +568,7 @@ lemma fdBoundary_H_right_deriv_limit (H : ℝ) · linarith /-- The H-parameterized boundary as a `PiecewiseC1Curve`. -/ -noncomputable def fdBoundaryHCurve (H : ℝ) : +@[expose] noncomputable def fdBoundaryHCurve (H : ℝ) : PiecewiseC1Curve where toFun := fdBoundaryH H a := 0 @@ -595,6 +595,7 @@ noncomputable def fdBoundaryHCurve (H : ℝ) : /-- The H-parameterized boundary as a `PiecewiseC1Immersion`. Requires H > √3/2 for nonzero derivative. -/ +@[expose] noncomputable def fdBoundaryHImmersion (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : PiecewiseC1Immersion where diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean index 129bb3b970..b8ae1959a4 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean @@ -50,7 +50,7 @@ The `SingleCrossingData` structure bundles the 8 obligations of making it easy to instantiate for each geometric case. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean index cc867f0ed9..0e5af18cac 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean @@ -25,7 +25,7 @@ Proves `generalizedWindingNumber' (fdBoundaryH H) 0 5 s = -1/2` for points `s` on the left vertical edge of the fundamental domain (`s.re = -1/2`, `√3/2 < s.im < H`). -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean index 893745c307..27bcb7023a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean @@ -25,7 +25,7 @@ Proves `generalizedWindingNumber' (fdBoundaryH H) 0 5 s = -1/2` for points `s` on the right vertical edge of the fundamental domain (`s.re = 1/2`, `√3/2 < s.im < H`). -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean index 3f70f41898..4303af4639 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean @@ -27,7 +27,7 @@ Uses the helper lemmas from `UnitArcHelpers` together with log ratio/diff tendst and strict norm monotonicity on the arc. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean index 0705568216..8bb2d71853 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean @@ -25,7 +25,7 @@ for points `s` on the unit circle arc of the fundamental domain Contains parameterization, separation, slitPlane conditions, and the FTC value computation. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm diff --git a/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean b/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean index f15c7c6ad5..daac68cd87 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean @@ -29,7 +29,7 @@ The orbit-sum valence formula applied to the canonical zero set `s₀`. * `valence_formula_orbit_sum` — orbit-sum with boundary weight hypothesis -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/Definitions.lean b/LeanPool/LeanModularForms/ValenceFormula/Definitions.lean index a5f7c528e0..6b7494a25f 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Definitions.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Definitions.lean @@ -18,7 +18,7 @@ orbifold coefficients, the order of vanishing, and the canonical fundamental dom We use `ModularGroup.fd` (notation `𝒟`) from mathlib for the standard fundamental domain. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular @@ -28,13 +28,13 @@ attribute [local instance] Classical.propDecidable noncomputable section /-- The elliptic point i as an element of ℍ. -/ -def ellipticPointI' : UpperHalfPlane := ⟨I, by simp [Complex.I_im]⟩ +@[expose] def ellipticPointI' : UpperHalfPlane := ⟨I, by simp [Complex.I_im]⟩ /-- The elliptic point `i` as a complex number. -/ abbrev ellipticPointI : ℂ := (ellipticPointI' : ℂ) /-- The elliptic point ρ = e^{2πi/3} = -1/2 + (√3/2)i as an element of ℍ. -/ -def ellipticPointRho' : UpperHalfPlane := +@[expose] def ellipticPointRho' : UpperHalfPlane := ⟨-1/2 + (Real.sqrt 3 / 2) * I, by simp_all⟩ @@ -42,7 +42,7 @@ def ellipticPointRho' : UpperHalfPlane := abbrev ellipticPointRho : ℂ := (ellipticPointRho' : ℂ) /-- The T-translate ρ+1 = e^{πi/3} = 1/2 + (√3/2)i. -/ -def ellipticPointRhoPlusOne' : UpperHalfPlane := +@[expose] def ellipticPointRhoPlusOne' : UpperHalfPlane := ⟨1/2 + (Real.sqrt 3 / 2) * I, by simp_all⟩ @@ -98,10 +98,11 @@ lemma ellipticPointI_ne_rho : ellipticPointI' ≠ ellipticPointRho' := by simp only [ellipticPointI', ellipticPointRho'] at h1; norm_num at h1 /-- Order of vanishing of f at a point in ℍ. -/ -def orderOfVanishingAt' (f : UpperHalfPlane → ℂ) (z : UpperHalfPlane) : ℤ := +@[expose] def orderOfVanishingAt' (f : UpperHalfPlane → ℂ) (z : UpperHalfPlane) : ℤ := (meromorphicOrderAt (fun w : ℂ => if h : 0 < w.im then f ⟨w, h⟩ else 0) (z : ℂ)).untop₀ /-- The order of vanishing at the cusp (in the q-expansion). -/ +@[expose] noncomputable def orderAtCusp' {k : ℤ} (f : ModularForm (CongruenceSubgroup.Gamma 1) k) : ℤ := (UpperHalfPlane.qExpansion 1 f).order.toNat diff --git a/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean b/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean index 772ba7652d..64acd6fab2 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean @@ -32,7 +32,7 @@ around any strict interior point equals -1. for any strict interior point with im < H -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean b/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean index 09d7b298d0..6e82e7eba8 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean @@ -19,7 +19,7 @@ We also provide: * Cusp nonvanishing (`exists_height_cusp_nonvanishing`) -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular @@ -254,7 +254,7 @@ lemma ord_S_eq (p : ℍ) : _ = meromorphicOrderAt G p_cplx := by simp [meromorphicOrderAt_zpow_eq_zero p_cplx hp_ne] /-- An open box containing the truncated fundamental domain. -/ -def fdBox (M : ℝ) : Set ℂ := {z : ℂ | -1 < z.re ∧ z.re < 1 ∧ (1 : ℝ)/2 < z.im ∧ z.im < M} +@[expose] def fdBox (M : ℝ) : Set ℂ := {z : ℂ | -1 < z.re ∧ z.re < 1 ∧ (1 : ℝ)/2 < z.im ∧ z.im < M} lemma fdBox_im_pos {M : ℝ} {z : ℂ} (hz : z ∈ fdBox M) : 0 < z.im := by linarith [hz.2.2.1] diff --git a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean index 3078e1aff9..98b595d820 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean @@ -26,7 +26,7 @@ Bridge lemmas, elliptic point CPV, segment geometry helpers, arc injectivity, and CPV helper lemmas (avoidance, concatenation, sub-interval extension, integrability). -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean index 28d172ecf2..e1af6f2709 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean @@ -24,7 +24,7 @@ Cauchy principal value existence at the endpoint `1/2 + H*I` and corner `-1/2 + of the fundamental domain boundary `fdBoundaryH H`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean index 75d33667ad..597b155742 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean @@ -24,7 +24,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.Misc For any point `s` on `fdBoundaryH H`, the CPV integral of `(z - s)⁻¹` exists. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean b/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean index 69d3db0688..d0a89af5e3 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean @@ -21,7 +21,7 @@ pairing left/right vertical and arc contributions. * `sum_ord_rightArc_eq_sum_ord_leftArc`: Orders on right arc equal orders on left arc. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular @@ -168,11 +168,11 @@ theorem S_smul_mem_fd_of_unit (p : ℍ) (hp_fd : p ∈ 𝒟) (hp_norm : ‖(p : exact habs_re /-- The left-vertical filter of S: points with `re = -1/2` and `‖p‖ > 1`. -/ -def sLeftVert (S : Finset ℍ) : Finset ℍ := +@[expose] def sLeftVert (S : Finset ℍ) : Finset ℍ := S.filter (fun p => (p : ℂ).re = -1/2 ∧ ‖(p : ℂ)‖ > 1) /-- The right-vertical filter of S: points with `re = 1/2` and `‖p‖ > 1`. -/ -def sRightVert (S : Finset ℍ) : Finset ℍ := +@[expose] def sRightVert (S : Finset ℍ) : Finset ℍ := S.filter (fun p => (p : ℂ).re = 1/2 ∧ ‖(p : ℂ)‖ > 1) /-- T-translation maps `sLeftVert S` into `sRightVert S`. -/ @@ -209,11 +209,11 @@ lemma ord_vAdd_neg_one_eq (p : ℍ) : simp_all /-- The left-arc filter: points on the unit circle with negative real part. -/ -def sLeftArc (S : Finset ℍ) : Finset ℍ := +@[expose] def sLeftArc (S : Finset ℍ) : Finset ℍ := S.filter (fun p => ‖(p : ℂ)‖ = 1 ∧ (p : ℂ).re < 0) /-- The right-arc filter: points on the unit circle with positive real part. -/ -def sRightArc (S : Finset ℍ) : Finset ℍ := +@[expose] def sRightArc (S : Finset ℍ) : Finset ℍ := S.filter (fun p => ‖(p : ℂ)‖ = 1 ∧ (p : ℂ).re > 0) private lemma S_mul_S : ModularGroup.S * ModularGroup.S = -1 := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean b/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean index 93ac75101b..c64da0160a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean @@ -23,7 +23,7 @@ on orbits and establish finite support for the orbit sum. * `finite_support_ordOrbit` — finitely many orbits have nonzero `ordOrbit` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups @@ -58,10 +58,10 @@ theorem ord_smul_eq (g : SL(2, ℤ)) (p : ℍ) : abbrev Orbit := MulAction.orbitRel.Quotient SL(2, ℤ) ℍ /-- The canonical map from `ℍ` to its orbit. -/ -def orb (p : ℍ) : Orbit := Quotient.mk'' p +@[expose] def orb (p : ℍ) : Orbit := Quotient.mk'' p /-- The order of vanishing lifted to orbits. Well-defined by `ord_smul_eq`. -/ -def ordOrbit (q : Orbit) : ℤ := +@[expose] def ordOrbit (q : Orbit) : ℤ := Quotient.liftOn' q (fun p => orderOfVanishingAt' (⇑f) p) (fun a b hab => by rw [MulAction.orbitRel_apply] at hab obtain ⟨g, hg⟩ := hab @@ -71,13 +71,14 @@ def ordOrbit (q : Orbit) : ℤ := theorem ordOrbit_mk (p : ℍ) : ordOrbit f (orb p) = orderOfVanishingAt' (⇑f) p := rfl /-- The orbit of `i`. -/ -def oi : Orbit := orb ellipticPointI' +@[expose] def oi : Orbit := orb ellipticPointI' /-- The orbit of `ρ`. -/ +@[expose] def orho : Orbit := orb ellipticPointRho' /-- A non-elliptic orbit is one distinct from both `oi` and `orho`. -/ -def NonEllOrbit := {q : Orbit // q ≠ oi ∧ q ≠ orho} +@[expose] def NonEllOrbit := {q : Orbit // q ≠ oi ∧ q ≠ orho} /-- Every orbit has a representative in the fundamental domain `𝒟`. -/ theorem orbit_has_fd_rep (q : Orbit) : ∃ p : ℍ, orb p = q ∧ p ∈ 𝒟 := by @@ -229,7 +230,7 @@ theorem finite_support_ordOrbit_nonEll (hf : f ≠ 0) : exact hq /-- The canonical finite set of zeros (with nonzero order) in `𝒟`. -/ -noncomputable def s₀ (hf : f ≠ 0) : Finset ℍ := (finite_zeros_in_fd f hf).toFinset +@[expose] noncomputable def s₀ (hf : f ≠ 0) : Finset ℍ := (finite_zeros_in_fd f hf).toFinset /-- Every point in `s₀` lies in the fundamental domain `𝒟`. -/ theorem s₀_mem_fd (hf : f ≠ 0) : ∀ p ∈ s₀ f hf, p ∈ 𝒟 := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean index 2cf2532e00..7546ffa453 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean @@ -22,7 +22,7 @@ The key identity `pv_chain_identity` follows by uniqueness of limits: both sides are limits of the same ε-truncated integral, so they are equal. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean index b3e4e635d1..c99c2d301c 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean @@ -32,7 +32,7 @@ where `m(ε) → 2`. * `tendsto_pvIntegral_arc_bridge` — final bridge for Assembly.lean -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean index a984f27884..9d906d3cc6 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean @@ -31,7 +31,7 @@ using `Tendsto` statements for the ε-truncated integrals. `fdBoundaryH H` tends to `-(2πi · (k/12 - ord_∞(f)))`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean index fdb860b3b8..f5822b4168 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean @@ -28,7 +28,7 @@ integral of `f'/f` around `fdBoundaryH H` tends to `2πi · Σ gWN · ord`. `2πi · Σ gWN · ord` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean index 30cc8d4868..9157fa7a66 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean @@ -31,7 +31,7 @@ that are needed to prove `pv_modular_side` and `pv_residue_side`. `fdBoundaryH H` equals `2πi · Σ gWN · ord`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups @@ -45,18 +45,18 @@ variable {k : ℤ} (f : ModularForm (Gamma 1) k) (hf : f ≠ 0) /-- The ε-truncated integrand for the PV integral of `f'/f` along `γ`, with singular set `S₀`. Zero when `γ(t)` is within `ε` of any `s ∈ S₀`, otherwise `logDeriv f (γ t) * γ'(t)`. -/ -noncomputable def pvIntegrand {k : ℤ} (f : ModularForm (Gamma 1) k) (γ : ℝ → ℂ) +@[expose] noncomputable def pvIntegrand {k : ℤ} (f : ModularForm (Gamma 1) k) (γ : ℝ → ℂ) (S₀ : Finset ℂ) (ε : ℝ) (t : ℝ) : ℂ := cauchyPrincipalValueIntegrandOn S₀ (logDeriv (modularFormCompOfComplex f)) γ ε t /-- Arc singular set: unit-circle zeros (and S-transforms) plus ρ, ρ+1. -/ -noncomputable def sArcOfS (S : Finset UpperHalfPlane) : Finset ℂ := +@[expose] noncomputable def sArcOfS (S : Finset UpperHalfPlane) : Finset ℂ := (S.filter (fun (p : ℍ) => ‖(↑p : ℂ)‖ = 1)).image (↑· : ℍ → ℂ) ∪ (S.filter (fun (p : ℍ) => ‖(↑p : ℂ)‖ = 1)).image (fun (p : ℍ) => -(1 : ℂ) / (↑p : ℂ)) ∪ {ellipticPointRho, ellipticPointRhoPlusOne} /-- Vertical singular set: re = ±1/2, ‖z‖ > 1 zeros, plus T-shifts. -/ -noncomputable def sVertOfS (S : Finset UpperHalfPlane) : Finset ℂ := +@[expose] noncomputable def sVertOfS (S : Finset UpperHalfPlane) : Finset ℂ := (S.filter (fun p : ℍ => (↑p : ℂ).re = 1/2 ∧ ‖(↑p : ℂ)‖ > 1)).image (↑· : ℍ → ℂ) ∪ (S.filter (fun p : ℍ => (↑p : ℂ).re = 1/2 ∧ ‖(↑p : ℂ)‖ > 1)).image diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean index 90b5ed0b57..134bac73d0 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean @@ -29,7 +29,7 @@ point is captured by one of the singular sets `sArcOfS S` or `sVertOfS S`. * `oncurve_full_capture` — full assembly for all t ∈ [0,5] -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean index dff1216f35..ff42b060ce 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean @@ -35,7 +35,7 @@ Infrastructure lemmas needed to apply `generalizedResidueTheorem'` to * `residueSimplePole_logDeriv_eq_zero_at_nonzero` — residue = 0 at non-zeros -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups @@ -366,7 +366,7 @@ private lemma residueSimplePole_congr_local (F G : ℂ → ℂ) (z₀ : ℂ) omit f hf in /-- The logarithmic derivative of `F`, patched to a fixed value at the points of `S0`. -/ -noncomputable def logDerivPatched (F : ℂ → ℂ) (S0 : Finset ℂ) +@[expose] noncomputable def logDerivPatched (F : ℂ → ℂ) (S0 : Finset ℂ) (hsp : ∀ s ∈ S0, HasSimplePoleAt F s) : ℂ → ℂ := fun z => if h : z ∈ S0 then Classical.choose (Classical.choose_spec (hsp z h)) z diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean index d5faad294c..f7baf02f97 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean @@ -39,7 +39,7 @@ circle integral using the factorization `F(q) = q^m · g(q)`: `PVChain.Assembly`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean index aaec35d38b..801d628087 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean @@ -25,7 +25,7 @@ branch cut crossing on segment 4, constructs a lifted angle that tracks the full * `winding_fdPolygon_center_invariant` — winding number preserved under center translation -/ -@[expose] public section +public section open Complex Set Metric Filter Topology @@ -165,7 +165,7 @@ lemma arg_Q2 (z : ℂ) (hz_re : z.re < 0) (hz_im : 0 < z.im) : · exact (Complex.arg_mem_Ioc z).2 /-- The unique time on seg4 where (fdPolygon t - p) crosses the negative real axis. -/ -noncomputable def tL (p : ℂ) : ℝ := +@[expose] noncomputable def tL (p : ℂ) : ℝ := 3 + (p.im - Real.sqrt 3 / 2) / (HHeight - Real.sqrt 3 / 2) /-- tL is in (3, 4) for interior points. -/ @@ -285,7 +285,7 @@ lemma fdPolygonRadialCircle_angle_eq_arg (p : ℂ) (t : ℝ) (hne : fdPolygon t exact arg_normalize_eq dir (sub_ne_zero.mpr hne) /-- Lifted angle function that accounts for branch cut crossing. -/ -noncomputable def fdPolygonRadialCircleAngleLifted (p : ℂ) : +@[expose] noncomputable def fdPolygonRadialCircleAngleLifted (p : ℂ) : ℝ → ℝ := fun t => if t < tL p then Complex.arg (fdPolygon t - p) else Complex.arg (fdPolygon t - p) - 2 * Real.pi @@ -377,6 +377,7 @@ lemma circleParamCW_wrapCount : noncomputable def refY₀ : ℝ := (1 + HHeight) / 2 /-- The reference point p₀ = I * Y₀ on the imaginary axis. -/ +@[expose] noncomputable def refP₀ : ℂ := Complex.I * (refY₀ : ℂ) lemma ref_Y₀_pos : 0 < refY₀ := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean index 8c280c27ad..52eba752c6 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean @@ -17,7 +17,7 @@ Proves that the derivative norm of each segment of `fdBoundaryToPolygonHomotopy` is bounded by 5. -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDiff.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDiff.lean index e82dbe86ca..c25a03930a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDiff.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDiff.lean @@ -16,7 +16,7 @@ Proves that each segment of `fdBoundaryToPolygonHomotopy` is differentiable in t. -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean index 0520fdb956..66d8273507 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean @@ -17,7 +17,7 @@ Proves the homotopy is not differentiable at t ∈ {1, 3, 4} (left/right derivat differ) and that the per-segment derivatives are continuous. -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean index 1e75deabda..5397296b6c 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean @@ -23,7 +23,7 @@ the winding number of `fdBoundary` around interior points is -1. * `RectHomotopyProof.HHeight` — height parameter (= `heightCutoff`) -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology Metric open scoped Real Interval @@ -33,13 +33,13 @@ noncomputable section namespace RectHomotopyProof /-- The elliptic point ρ = e^{2πi/3} = -1/2 + √3/2 · i -/ -def rho : ℂ := -1/2 + Real.sqrt 3 / 2 * I +@[expose] def rho : ℂ := -1/2 + Real.sqrt 3 / 2 * I /-- The elliptic point ρ' = e^{πi/3} = 1/2 + √3/2 · i -/ -def rho' : ℂ := 1/2 + Real.sqrt 3 / 2 * I +@[expose] def rho' : ℂ := 1/2 + Real.sqrt 3 / 2 * I /-- The elliptic point i -/ -def iPoint : ℂ := I +@[expose] def iPoint : ℂ := I lemma rho_norm : ‖rho‖ = 1 := by rw [Complex.norm_eq_sqrt_sq_add_sq] @@ -69,7 +69,7 @@ lemma outside_closed_unit_ball (z : ℂ) (hz : ‖z‖ > 1) : z ∉ closedBall (0 : ℂ) 1 := by simpa only [mem_closedBall, dist_zero_right, not_le] using hz /-- The chord (straight line segment) from z₁ to z₂. -/ -def chordSegment (z₁ z₂ : ℂ) : ℝ → ℂ := +@[expose] def chordSegment (z₁ z₂ : ℂ) : ℝ → ℂ := fun t => (1 - t) • z₁ + t • z₂ lemma chordSegment_in_convex {z₁ z₂ : ℂ} {S : Set ℂ} (hS : Convex ℝ S) (hz₁ : z₁ ∈ S) (hz₂ : z₂ ∈ S) @@ -145,9 +145,9 @@ lemma arc2_in_closed_unit_ball (t : ℝ) (_ : t ∈ Icc 0 1) : simp only [mem_closedBall, dist_zero_right, arc2_on_unit_circle, le_refl] /-- The straight chord from `ρ'` to `i`. -/ -def chord1 : ℝ → ℂ := chordSegment rho' iPoint +@[expose] def chord1 : ℝ → ℂ := chordSegment rho' iPoint /-- The straight chord from `i` to `ρ`. -/ -def chord2 : ℝ → ℂ := chordSegment iPoint rho +@[expose] def chord2 : ℝ → ℂ := chordSegment iPoint rho lemma chord1_in_closed_unit_ball (t : ℝ) (ht : t ∈ Icc 0 1) : chord1 t ∈ closedBall (0 : ℂ) 1 := @@ -179,12 +179,12 @@ lemma circleIntegral_winding (p : ℂ) (ε : ℝ) (hε : 0 < ε) : circleIntegral.integral_sub_inv_of_mem_ball (Metric.mem_ball_self hε) /-- Height parameter H = √3/2 + 1 for FD boundary. -/ -noncomputable def HHeight : ℝ := Real.sqrt 3 / 2 + 1 +@[expose] noncomputable def HHeight : ℝ := Real.sqrt 3 / 2 + 1 -lemma H_height_eq_heightCutoff : HHeight = heightCutoff := rfl +lemma H_height_eq_heightCutoff : HHeight = heightCutoff := by rfl /-- Polygon: FD boundary with arcs replaced by chords. -/ -noncomputable def fdPolygon : ℝ → ℂ := fun t => +@[expose] noncomputable def fdPolygon : ℝ → ℂ := fun t => if t ≤ 1 then 1/2 + (HHeight - t * (HHeight - Real.sqrt 3 / 2)) * I @@ -198,7 +198,7 @@ noncomputable def fdPolygon : ℝ → ℂ := fun t => /-- The FD boundary curve (local copy matching clean folder's `fdBoundary`). -/ -noncomputable def fdBoundary : ℝ → ℂ := fun t => +@[expose] noncomputable def fdBoundary : ℝ → ℂ := fun t => if t ≤ 1 then 1/2 + (HHeight - t * (HHeight - Real.sqrt 3 / 2)) * I @@ -213,7 +213,7 @@ noncomputable def fdBoundary : ℝ → ℂ := fun t => /-- The homotopy from FD boundary (s=0) to polygon (s=1). Segments 1,4,5 unchanged; segments 2,3 use arc-to-chord interpolation. -/ -noncomputable def fdBoundaryToPolygonHomotopy : +@[expose] noncomputable def fdBoundaryToPolygonHomotopy : ℝ × ℝ → ℂ := fun (t, s) => if t ≤ 1 then 1/2 + (HHeight - t * (HHeight - diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean index e957f40a87..b9574a7ef3 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean @@ -23,7 +23,7 @@ continuity and matching at breakpoints, and establishes the main results: * `circleAround` and `polygonToCircleHomotopy` -/ -@[expose] public section +public section open Complex Set Metric Filter diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheorem.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheorem.lean index ae023834f6..e27ec11ea3 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheorem.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheorem.lean @@ -23,7 +23,7 @@ The generalized winding number of `fdBoundary` around interior points equals -1 (clockwise). -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean index d257e77414..93706bce39 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean @@ -19,7 +19,7 @@ Proves a uniform bound `‖deriv_t H(t,s)‖ ≤ 5` for all `(t,s) ∈ [0,5] × handling each segment case and the non-differentiable fallback. -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean index 113d4a20d8..c13f7d6cfd 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean @@ -18,7 +18,7 @@ on each partition piece `(p₁, p₂) × [0, 1]`, where `(p₁, p₂)` avoids th partition points `{1, 2, 3, 4}`. -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonProps.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonProps.lean index 1ae9c9e1af..6c1a92fd3a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonProps.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonProps.lean @@ -21,7 +21,7 @@ Defines per-segment functions `fdPolygonSeg1`..`fdPolygonSeg5` and proves: * Segment differentiability and `fdPolygon_differentiableAt_off_partition` -/ -@[expose] public section +public section open Complex Set Metric Filter Topology @@ -57,23 +57,23 @@ lemma fdPolygon_at_t4 : simp only [HHeight]; push_cast; ring /-- The first segment of the boundary polygon (right vertical edge). -/ -noncomputable def fdPolygonSeg1 : ℝ → ℂ := fun t => +@[expose] noncomputable def fdPolygonSeg1 : ℝ → ℂ := fun t => 1/2 + (HHeight - t * (HHeight - Real.sqrt 3 / 2)) * I /-- The second segment of the boundary polygon (chord from `ρ'` to `i`). -/ -noncomputable def fdPolygonSeg2 : ℝ → ℂ := fun t => +@[expose] noncomputable def fdPolygonSeg2 : ℝ → ℂ := fun t => chordSegment rho' iPoint (t - 1) /-- The third segment of the boundary polygon (chord from `i` to `ρ`). -/ -noncomputable def fdPolygonSeg3 : ℝ → ℂ := fun t => +@[expose] noncomputable def fdPolygonSeg3 : ℝ → ℂ := fun t => chordSegment iPoint rho (t - 2) /-- The fourth segment of the boundary polygon (left vertical edge). -/ -noncomputable def fdPolygonSeg4 : ℝ → ℂ := fun t => +@[expose] noncomputable def fdPolygonSeg4 : ℝ → ℂ := fun t => -1/2 + (Real.sqrt 3 / 2 + (t - 3) * (HHeight - Real.sqrt 3 / 2)) * I /-- The fifth segment of the boundary polygon (top horizontal edge). -/ -noncomputable def fdPolygonSeg5 : ℝ → ℂ := fun t => (t - 9/2) + HHeight * I +@[expose] noncomputable def fdPolygonSeg5 : ℝ → ℂ := fun t => (t - 9/2) + HHeight * I lemma fdPolygon_seg1_continuous : Continuous fdPolygonSeg1 := by unfold fdPolygonSeg1; continuity diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean index 022e23e841..177530d268 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean @@ -21,7 +21,7 @@ non-differentiability at partition points `{1,2,3,4}`, and global derivative bou * `fdPolygon_deriv_bounded` — `∃ M, ∀ t ∈ Icc 0 5, ‖deriv fdPolygon t‖ ≤ M` -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean index 8d44df5774..fe0b483df0 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean @@ -27,7 +27,7 @@ of `PiecewiseCurvesHomotopicAvoiding`. * `winding_fdPolygon_eq_radialCircle` — winding numbers are equal -/ -@[expose] public section +public section open Complex Set Metric Filter Topology @@ -35,7 +35,7 @@ namespace RectHomotopyProof /-- Radial homotopy from polygon to unit circle around p. H(t, s) = p + ((1-s)·‖z-p‖ + s) · (z-p)/‖z-p‖ -/ -noncomputable def polygonToCircleRadial (p : ℂ) : ℝ × ℝ → ℂ := fun (t, s) => +@[expose] noncomputable def polygonToCircleRadial (p : ℂ) : ℝ × ℝ → ℂ := fun (t, s) => let z := fdPolygon t let dir := z - p p + ((1 - s) * ‖dir‖ + s) • (dir / ‖dir‖) @@ -68,7 +68,7 @@ lemma polygonToCircleRadial_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p /-- The radial circle around p: normalized projection of fdPolygon onto unit circle around p. This is polygonToCircleRadial at s=1. -/ -noncomputable def fdPolygonRadialCircle (p : ℂ) : ℝ → ℂ := fun t => +@[expose] noncomputable def fdPolygonRadialCircle (p : ℂ) : ℝ → ℂ := fun t => polygonToCircleRadial p (t, 1) /-- fdPolygonRadialCircle is on the unit circle around p. -/ diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean index f40745bc80..9382bfdacd 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean @@ -26,7 +26,7 @@ computation for the fundamental domain boundary. * `tendsto_arg_w_left`, `tendsto_arg_w_right` — limits of arg at tL from left/right -/ -@[expose] public section +public section open Complex Set Metric Filter Topology diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingProof.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingProof.lean index 5d62b515b9..261a709b1d 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingProof.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingProof.lean @@ -26,7 +26,7 @@ using FTC with lifted angle functions and S1 curve comparisons. * `winding_fdPolygon_eq_circleParamCW` — matches circleParamCW winding -/ -@[expose] public section +public section open Complex Set Metric Filter Topology MeasureTheory diff --git a/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean b/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean index 6a2581cd0a..074435ff4e 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean @@ -20,7 +20,7 @@ finsets used by `valence_formula_orbit_sum_s₀`. there exists `p ∈ repCanon f hf` with `orb p = q`. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups @@ -32,19 +32,19 @@ noncomputable section variable {k : ℤ} (f : ModularForm (Gamma 1) k) (hf : f ≠ 0) /-- Strict interior representatives: points in s₀ with ‖p‖ > 1, |re| < 1/2, not elliptic. -/ -noncomputable def repStrict : Finset ℍ := +@[expose] noncomputable def repStrict : Finset ℍ := (s₀ f hf).filter (fun p => p ≠ ellipticPointI' ∧ p ≠ ellipticPointRho' ∧ p ≠ ellipticPointRhoPlusOne' ∧ ‖(p : ℂ)‖ > 1 ∧ |(p : ℂ).re| < 1/2) /-- Left vertical edge representatives: points in s₀ with re = -1/2, ‖p‖ > 1. -/ -noncomputable def repLeftVert : Finset ℍ := sLeftVert (s₀ f hf) +@[expose] noncomputable def repLeftVert : Finset ℍ := sLeftVert (s₀ f hf) /-- Left arc representatives: points in s₀ with ‖p‖ = 1, re < 0, not ρ. -/ -noncomputable def repLeftArc : Finset ℍ := +@[expose] noncomputable def repLeftArc : Finset ℍ := (s₀ f hf).filter (fun p => p ≠ ellipticPointRho' ∧ ‖(p : ℂ)‖ = 1 ∧ (p : ℂ).re < 0) /-- The canonical representative finset: union of strict interior, left vertical, and left arc. -/ -noncomputable def repCanon : Finset ℍ := +@[expose] noncomputable def repCanon : Finset ℍ := repStrict f hf ∪ repLeftVert f hf ∪ repLeftArc f hf lemma repStrict_mem_s₀ {p : ℍ} (hp : p ∈ repStrict f hf) : p ∈ s₀ f hf := diff --git a/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean b/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean index e9e0be0132..da899b12d3 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean @@ -23,7 +23,7 @@ non-elliptic orbits of `SL₂(ℤ)` acting on `ℍ`. * `valence_formula_textbook_orbit_finsum` — the valence formula with `∑ᶠ` -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology CongruenceSubgroup open scoped Real Interval UpperHalfPlane ModularForm Modular MatrixGroups diff --git a/LeanPool/LeanModularForms/ValenceFormula/TrigLemmas.lean b/LeanPool/LeanModularForms/ValenceFormula/TrigLemmas.lean index 8b6e3d876b..64a9eb0195 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/TrigLemmas.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/TrigLemmas.lean @@ -19,7 +19,7 @@ Euler-formula expansion of `exp(θ * I)` and exact values at `2π/3`, used by both `WindingWeights/Common.lean` and `RectHomotopy/HomotopyDef.lean`. -/ -@[expose] public section +public section open Complex diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights.lean index 221502d2a0..a73730df79 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights.lean @@ -27,7 +27,7 @@ fundamental domain boundary around the elliptic points i, ρ, ρ+1. * `effectiveWinding_i_eq_neg_gWN` — 1/2 = -gWN(i) -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean index 1fc27274a6..0fc757ceca 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean @@ -22,7 +22,7 @@ trigonometric identities, old-style segment selectors, the unified arc formula, and FTC lemmas for log-derivative integrals. -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean index 9bb4d0fc33..91c3def65e 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean @@ -28,7 +28,7 @@ around the point i. * `gWN_fdBoundary_H_at_i` — gWN = -1/2 at i -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean index 4af904e45e..5c063faddb 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean @@ -28,7 +28,7 @@ around the elliptic point ρ = e^{2πi/3}. * `gWN_fdBoundary_H_at_rho` — gWN = -1/6 at ρ -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean index c2bbe6a38f..d64fd712cd 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean @@ -28,7 +28,7 @@ around the elliptic point ρ+1 = e^{πi/3}. * `gWN_fdBoundary_H_at_rho_plus_one` — gWN = -1/6 at ρ+1 -/ -@[expose] public section +public section open Complex MeasureTheory Set Filter Topology open scoped Real Interval diff --git a/LeanPool/LeanPolyABC.lean b/LeanPool/LeanPolyABC.lean index ea1c08d17e..0b4d8b6cda 100644 --- a/LeanPool/LeanPolyABC.lean +++ b/LeanPool/LeanPolyABC.lean @@ -32,7 +32,7 @@ Tags: number-theory, polynomials, algebra, mason-stothers MSC: 11C08, 12E05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/LeanPolyABC/All.lean b/LeanPool/LeanPolyABC/All.lean index 1639598181..b8dd3c28a4 100644 --- a/LeanPool/LeanPolyABC/All.lean +++ b/LeanPool/LeanPolyABC/All.lean @@ -31,4 +31,4 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.LeanPolyABC.All`. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanPolyABC/Corollaries/Davenport.lean b/LeanPool/LeanPolyABC/Corollaries/Davenport.lean index 682e825867..ff2d6ea56f 100644 --- a/LeanPool/LeanPolyABC/Corollaries/Davenport.lean +++ b/LeanPool/LeanPolyABC/Corollaries/Davenport.lean @@ -13,7 +13,7 @@ import LeanPool.LeanPolyABC.MasonStothers # LeanPool.LeanPolyABC.Corollaries.Davenport -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean b/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean index 85e1bee505..e70f5f4f50 100644 --- a/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean +++ b/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean @@ -16,7 +16,7 @@ import Mathlib.Data.Sym.Sym2.Init # LeanPool.LeanPolyABC.Corollaries.FltCatalan -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanPolyABC/Corollaries/NoParametrization.lean b/LeanPool/LeanPolyABC/Corollaries/NoParametrization.lean index 45d85b4b22..bb0c4bbf27 100644 --- a/LeanPool/LeanPolyABC/Corollaries/NoParametrization.lean +++ b/LeanPool/LeanPolyABC/Corollaries/NoParametrization.lean @@ -13,7 +13,7 @@ import LeanPool.LeanPolyABC.Corollaries.FltCatalan # LeanPool.LeanPolyABC.Corollaries.NoParametrization -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanPolyABC/Lib/DivRadical.lean b/LeanPool/LeanPolyABC/Lib/DivRadical.lean index 0061c4cc6f..95c54333f8 100644 --- a/LeanPool/LeanPolyABC/Lib/DivRadical.lean +++ b/LeanPool/LeanPolyABC/Lib/DivRadical.lean @@ -13,7 +13,7 @@ import Mathlib.RingTheory.UniqueFactorizationDomain.Multiplicative # LeanPool.LeanPolyABC.Lib.DivRadical -/ -@[expose] public section +public section /- On `a.divRadical = a / radical a`. The purpose of this file is to prove our "main lemma" that diff --git a/LeanPool/LeanPolyABC/Lib/Max3.lean b/LeanPool/LeanPolyABC/Lib/Max3.lean index c5d4026a39..c9d534a432 100644 --- a/LeanPool/LeanPolyABC/Lib/Max3.lean +++ b/LeanPool/LeanPolyABC/Lib/Max3.lean @@ -12,11 +12,12 @@ module Imported Lean Pool material for `LeanPool.LeanPolyABC.Lib.Max3`. -/ -@[expose] public section +public section namespace Nat /-- The maximum of three natural numbers, `max (max a b) c`. -/ +@[expose] def max₃ (a b c : Nat) : Nat := max (max a b) c diff --git a/LeanPool/LeanPolyABC/Lib/Radical.lean b/LeanPool/LeanPolyABC/Lib/Radical.lean index 8d79fa5024..9fd0caceb3 100644 --- a/LeanPool/LeanPolyABC/Lib/Radical.lean +++ b/LeanPool/LeanPolyABC/Lib/Radical.lean @@ -11,7 +11,7 @@ public import Mathlib.Algebra.Polynomial.FieldDivision # LeanPool.LeanPolyABC.Lib.Radical -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanPolyABC/Lib/Wronskian.lean b/LeanPool/LeanPolyABC/Lib/Wronskian.lean index 0952d0bca5..3a3e3b996e 100644 --- a/LeanPool/LeanPolyABC/Lib/Wronskian.lean +++ b/LeanPool/LeanPolyABC/Lib/Wronskian.lean @@ -11,7 +11,7 @@ public import Mathlib.Algebra.Polynomial.Derivative # LeanPool.LeanPolyABC.Lib.Wronskian -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ namespace LeanPolyABC variable {R : Type _} [CommRing R] /-- Wronskian: W(a, b) = ab' - a'b. -/ -def wronskian (a b : R[X]) : R[X] := +@[expose] def wronskian (a b : R[X]) : R[X] := a * derivative b - derivative a * b @[simp] diff --git a/LeanPool/LeanPolyABC/MasonStothers.lean b/LeanPool/LeanPolyABC/MasonStothers.lean index abfb67612f..869c2d1501 100644 --- a/LeanPool/LeanPolyABC/MasonStothers.lean +++ b/LeanPool/LeanPolyABC/MasonStothers.lean @@ -13,7 +13,7 @@ import Mathlib.RingTheory.Polynomial.Content # LeanPool.LeanPolyABC.MasonStothers -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanQuantumAlg.lean b/LeanPool/LeanQuantumAlg.lean index 04899e1f0c..f63c3ce85b 100644 --- a/LeanPool/LeanQuantumAlg.lean +++ b/LeanPool/LeanQuantumAlg.lean @@ -27,4 +27,4 @@ Tags: quantum-computing, quantum-algorithms, quantum-signal-processing, quantum- MSC: 81P68, 81P45, 68Q12 -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Algorithms.lean b/LeanPool/LeanQuantumAlg/Algorithms.lean index c83a6f568a..0acaceb434 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms.lean @@ -25,4 +25,4 @@ public import LeanPool.LeanQuantumAlg.Algorithms.AmplitudeEstimation This module re-exports the algorithm endpoints. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Algorithms/AmplitudeEstimation.lean b/LeanPool/LeanQuantumAlg/Algorithms/AmplitudeEstimation.lean index 406901b2be..2ba762a49c 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/AmplitudeEstimation.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/AmplitudeEstimation.lean @@ -19,7 +19,7 @@ phase-register basis vector, and the estimate `sin^2(pi*j/2^t)` equals the good-state probability in the two-dimensional amplitude-amplification model. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Algorithms/BernsteinVazirani.lean b/LeanPool/LeanQuantumAlg/Algorithms/BernsteinVazirani.lean index 77bf4ddbe0..4f76af1e81 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/BernsteinVazirani.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/BernsteinVazirani.lean @@ -50,7 +50,7 @@ disagree). circuit is exactly `|s⟩ ⊗ |−⟩`: one query recovers the hidden string. -/ -@[expose] public section +public section namespace QuantumAlg @@ -236,11 +236,11 @@ def timedFinalJointState (s : Fin (2 ^ n)) : Timed (PureState (n + 1)) := @[simp] theorem timedFinalJointState_ret (s : Fin (2 ^ n)) : - (timedFinalJointState s).ret = WalshHadamard.finalJointState (oracle s) := rfl + (timedFinalJointState s).ret = WalshHadamard.finalJointState (oracle s) := by rfl @[simp] theorem timedFinalJointState_time (s : Fin (2 ^ n)) : - (timedFinalJointState s).time = 1 := rfl + (timedFinalJointState s).time = 1 := by rfl /-- Public resource profile for the Bernstein-Vazirani circuit: one oracle query and two `n`-qubit Hadamard layers plus the target Hadamard. -/ @@ -252,15 +252,15 @@ def resourceProfile (n : ℕ) : ResourceProfile where @[simp] theorem resourceProfile_oracleQueries (n : ℕ) : - (resourceProfile n).oracleQueries = 1 := rfl + (resourceProfile n).oracleQueries = 1 := by rfl @[simp] theorem resourceProfile_hadamardGates (n : ℕ) : - (resourceProfile n).hadamardGates = 2 * n + 1 := rfl + (resourceProfile n).hadamardGates = 2 * n + 1 := by rfl @[simp] theorem resourceProfile_elementaryGates (n : ℕ) : - (resourceProfile n).elementaryGates = 2 * n + 1 := rfl + (resourceProfile n).elementaryGates = 2 * n + 1 := by rfl theorem resourceProfile_exact (n : ℕ) : ResourceProfile.HasExactCounts (resourceProfile n) 1 (2 * n + 1) (2 * n + 1) 0 := by @@ -272,11 +272,11 @@ def profiledFinalJointState (s : Fin (2 ^ n)) : Profiled (PureState (n + 1)) := @[simp] theorem profiledFinalJointState_ret (s : Fin (2 ^ n)) : - (profiledFinalJointState s).ret = WalshHadamard.finalJointState (oracle s) := rfl + (profiledFinalJointState s).ret = WalshHadamard.finalJointState (oracle s) := by rfl @[simp] theorem profiledFinalJointState_resources (s : Fin (2 ^ n)) : - (profiledFinalJointState s).resources = resourceProfile n := rfl + (profiledFinalJointState s).resources = resourceProfile n := by rfl /-- **Bernstein-Vazirani correctness**: running the Deutsch-Jozsa circuit with the inner-product oracle of hidden string `s` leaves the joint register diff --git a/LeanPool/LeanQuantumAlg/Algorithms/DeutschJozsa.lean b/LeanPool/LeanQuantumAlg/Algorithms/DeutschJozsa.lean index 24e20be5cc..f47b7ef368 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/DeutschJozsa.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/DeutschJozsa.lean @@ -41,7 +41,7 @@ nonzero decides the promise problem exactly. constant. -/ -@[expose] public section +public section namespace QuantumAlg @@ -193,11 +193,11 @@ def timedFinalJointState (f : WalshHadamard.Oracle n) : Timed (PureState (n + 1) @[simp] theorem timedFinalJointState_ret (f : WalshHadamard.Oracle n) : - (timedFinalJointState f).ret = WalshHadamard.finalJointState f := rfl + (timedFinalJointState f).ret = WalshHadamard.finalJointState f := by rfl @[simp] theorem timedFinalJointState_time (f : WalshHadamard.Oracle n) : - (timedFinalJointState f).time = 1 := rfl + (timedFinalJointState f).time = 1 := by rfl /-- Public resource profile for the Deutsch-Jozsa circuit: one oracle query and two `n`-qubit Hadamard layers plus the target Hadamard. -/ @@ -218,11 +218,11 @@ def profiledFinalJointState (f : WalshHadamard.Oracle n) : @[simp] theorem profiledFinalJointState_ret (f : WalshHadamard.Oracle n) : - (profiledFinalJointState f).ret = WalshHadamard.finalJointState f := rfl + (profiledFinalJointState f).ret = WalshHadamard.finalJointState f := by rfl @[simp] theorem profiledFinalJointState_resources (f : WalshHadamard.Oracle n) : - (profiledFinalJointState f).resources = resourceProfile n := rfl + (profiledFinalJointState f).resources = resourceProfile n := by rfl /-- The TimeM return value is the same final state used by the amplitude test. -/ theorem reportsConstant_iff_timedFinalJointState diff --git a/LeanPool/LeanQuantumAlg/Algorithms/GHZ.lean b/LeanPool/LeanQuantumAlg/Algorithms/GHZ.lean index 76da39887a..af9cdd58d8 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/GHZ.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/GHZ.lean @@ -42,7 +42,7 @@ locally-equivalent three-qubit state powers Mermin's game - `LeanPool.LeanQuantumAlg.norm_ghz` — the GHZ state is normalized. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Algorithms/Grover.lean b/LeanPool/LeanQuantumAlg/Algorithms/Grover.lean index a428a527d7..551fe7f1c7 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/Grover.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/Grover.lean @@ -33,7 +33,7 @@ closed-form rotation core used by those refinements. measurement probability. -/ -@[expose] public section +public section namespace QuantumAlg @@ -142,11 +142,11 @@ def timedIterate (M : GroverModel) (k : ℕ) : Timed (PureState 1) := theorem timedIterate_ret (M : GroverModel) (k : ℕ) : (timedIterate M k).ret = Gate.apply ((M.diffusion * M.phaseOracle) ^ k) - (amplitudeAmplificationState M.θ 0) := rfl + (amplitudeAmplificationState M.θ 0) := by rfl @[simp] theorem timedIterate_time (M : GroverModel) (k : ℕ) : - (timedIterate M k).time = k := rfl + (timedIterate M k).time = k := by rfl /-- Grover correctness, phrased through the TimeM return value. -/ theorem timedIterate_correct (M : GroverModel) (k : ℕ) : @@ -164,7 +164,9 @@ theorem timedIterate_ret_eq_amplitudeAmplification (M : GroverModel) (k : ℕ) : (timedIterate M k).ret = (AmplitudeAmplification.timedIterate - M.toAmplitudeAmplificationModel k).ret := rfl + M.toAmplitudeAmplificationModel k).ret := by + rw [AmplitudeAmplification.timedIterate_ret] + rfl /-- Trusted public resource profile for `k` Grover iterations on `n` index qubits: `k` oracle queries and a linear-in-`n` elementary-gate representative diff --git a/LeanPool/LeanQuantumAlg/Algorithms/OrderFinding.lean b/LeanPool/LeanQuantumAlg/Algorithms/OrderFinding.lean index 3fe41e4c17..6be05f391c 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/OrderFinding.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/OrderFinding.lean @@ -18,7 +18,7 @@ estimation returns the basis index `j = s * (2^t / r)` exactly, and a classical gcd recovers the order. -/ -@[expose] public section +public section namespace QuantumAlg @@ -109,8 +109,7 @@ def modExpOracleTarget {N x t m : ℕ} (A : ModExpOracleAccess N x t m) @[simp] theorem modExpOracleTarget_val {N x t m : ℕ} (A : ModExpOracleAccess N x t m) (a : Fin (2 ^ t)) (y : Fin (2 ^ m)) : - (modExpOracleTarget A a y).val = Nat.xor y.val (x ^ a.val % N) := - rfl + (modExpOracleTarget A a y).val = Nat.xor y.val (x ^ a.val % N) := by rfl /-- The basis permutation underlying the modular-exponentiation oracle. -/ def modExpOraclePerm {N x t m : ℕ} (A : ModExpOracleAccess N x t m) : @@ -125,13 +124,11 @@ def modExpOraclePerm {N x t m : ℕ} (A : ModExpOracleAccess N x t m) : @[simp] theorem modExpOraclePerm_apply {N x t m : ℕ} (A : ModExpOracleAccess N x t m) (p : Fin (2 ^ t) × Fin (2 ^ m)) : - modExpOraclePerm A p = (p.1, modExpOracleTarget A p.1 p.2) := - rfl + modExpOraclePerm A p = (p.1, modExpOracleTarget A p.1 p.2) := by rfl @[simp] theorem modExpOraclePerm_symm {N x t m : ℕ} (A : ModExpOracleAccess N x t m) : - (modExpOraclePerm A).symm = modExpOraclePerm A := - rfl + (modExpOraclePerm A).symm = modExpOraclePerm A := by rfl /-- The modular-exponentiation oracle gate in the public access model: `U_x |a,y> = |a, y xor (x^a mod N)>`. -/ diff --git a/LeanPool/LeanQuantumAlg/Algorithms/QPE.lean b/LeanPool/LeanQuantumAlg/Algorithms/QPE.lean index a4501e7e85..eabc6a19ef 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/QPE.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/QPE.lean @@ -35,7 +35,7 @@ maps that raw phase vector to the computational-basis vector `|j>`. outcome `j` has probability one after the exact readout. -/ -@[expose] public section +public section namespace QuantumAlg @@ -135,8 +135,7 @@ def phaseState (t : Nat) (phi : Real) : StateVector t := @[simp] theorem phaseState_apply (t : Nat) (phi : Real) (k : Fin (2 ^ t)) : phaseState t phi k = - invSqrtN t * Complex.exp (2 * Real.pi * phi * k.val * Complex.I) := - rfl + invSqrtN t * Complex.exp (2 * Real.pi * phi * k.val * Complex.I) := by rfl /-- Dyadic/Fourier bridge: when the eigenphase is `j / 2^t`, the QPE phase superposition is exactly `QFT t |j>`. -/ diff --git a/LeanPool/LeanQuantumAlg/Algorithms/Simon.lean b/LeanPool/LeanQuantumAlg/Algorithms/Simon.lean index 2e077dc9db..81ed4b23d7 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/Simon.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/Simon.lean @@ -37,7 +37,7 @@ mask [dW19, qcnotes.tex:1460]. is the hidden nonzero mask. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Algorithms/SuperdenseCoding.lean b/LeanPool/LeanQuantumAlg/Algorithms/SuperdenseCoding.lean index cedb125851..9d5824a0e4 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/SuperdenseCoding.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/SuperdenseCoding.lean @@ -35,7 +35,7 @@ due to Bennett and Wiesner (1992). `decode (encode a b |Φ⁺⟩) = |b a⟩`. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Algorithms/Teleportation.lean b/LeanPool/LeanQuantumAlg/Algorithms/Teleportation.lean index d133eb8d25..275b3427bd 100644 --- a/LeanPool/LeanQuantumAlg/Algorithms/Teleportation.lean +++ b/LeanPool/LeanQuantumAlg/Algorithms/Teleportation.lean @@ -42,7 +42,7 @@ bit is `1` [dW19, qcnotes.tex:804], recovering Alice's original qubit Alice's circuit yields the four branches, and every branch corrects back. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Core.lean b/LeanPool/LeanQuantumAlg/Core.lean index 05703cd498..06187d7fef 100644 --- a/LeanPool/LeanQuantumAlg/Core.lean +++ b/LeanPool/LeanQuantumAlg/Core.lean @@ -21,4 +21,4 @@ This module re-exports the base state, gate, tensor, measurement, and cost interfaces. Named components are re-exported by `LeanPool.LeanQuantumAlg.Core.Components`. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Core/Components.lean b/LeanPool/LeanQuantumAlg/Core/Components.lean index c9af5b34cd..fb6839a193 100644 --- a/LeanPool/LeanQuantumAlg/Core/Components.lean +++ b/LeanPool/LeanQuantumAlg/Core/Components.lean @@ -19,4 +19,4 @@ public import LeanPool.LeanQuantumAlg.Core.Components.Control This module re-exports named kets, gates, oracle blocks, and control blocks. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Core/Components/Control.lean b/LeanPool/LeanQuantumAlg/Core/Components/Control.lean index 205dc75d19..7e7d4ab98c 100644 --- a/LeanPool/LeanQuantumAlg/Core/Components/Control.lean +++ b/LeanPool/LeanQuantumAlg/Core/Components/Control.lean @@ -19,7 +19,7 @@ is the block decomposition `c-U = |0><0| ⊗ 1 + |1><1| ⊗ U`. The projectors `proj0` and `proj1` are `HilbertOperator`s, not gates. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Core/Components/Gates.lean b/LeanPool/LeanQuantumAlg/Core/Components/Gates.lean index df505dd46d..8ea8d03555 100644 --- a/LeanPool/LeanQuantumAlg/Core/Components/Gates.lean +++ b/LeanPool/LeanQuantumAlg/Core/Components/Gates.lean @@ -17,7 +17,7 @@ The standard named gates as `Components` (concrete instances built on the `HilbertOperator`s, then bundled into `Gate`s with their unitarity proofs. -/ -@[expose] public section +public section namespace QuantumAlg @@ -30,6 +30,7 @@ namespace Gate /-! ## Pauli, Hadamard, and CNOT -/ /-- Raw Hadamard operator `H = (1/sqrt 2) [[1, 1], [1, -1]]`. -/ +@[expose] def HOp : HilbertOperator 1 := invSqrt2 • !![(1 : ℂ), 1; 1, -1] @@ -49,9 +50,11 @@ theorem HOp_mem_unitaryGroup : simp_all /-- The Hadamard gate. -/ +@[expose] def H : Gate 1 := ofUnitary HOp HOp_mem_unitaryGroup /-- The Pauli-X (NOT) gate, as the basis permutation `|0> ↔ |1>`. -/ +@[expose] def X : Gate 1 := ofPerm (Equiv.swap 0 1) /-- Raw Pauli-Y operator `[[0, -i], [i, 0]]`. -/ @@ -68,7 +71,7 @@ theorem YOp_mem_unitaryGroup : def Y : Gate 1 := ofUnitary YOp YOp_mem_unitaryGroup /-- Raw Pauli-Z operator `[[1, 0], [0, -1]]`. -/ -def ZOp : HilbertOperator 1 := !![(1 : ℂ), 0; 0, -1] +@[expose] def ZOp : HilbertOperator 1 := !![(1 : ℂ), 0; 0, -1] theorem ZOp_mem_unitaryGroup : ZOp ∈ Matrix.unitaryGroup (Fin (2 ^ 1)) ℂ := by @@ -78,9 +81,10 @@ theorem ZOp_mem_unitaryGroup : simp [ZOp, Matrix.mul_apply, Matrix.star_apply] /-- The Pauli-Z gate. -/ -def Z : Gate 1 := ofUnitary ZOp ZOp_mem_unitaryGroup +@[expose] def Z : Gate 1 := ofUnitary ZOp ZOp_mem_unitaryGroup /-- The controlled-NOT gate on two qubits, control = qubit 0. -/ +@[expose] def CNOT : Gate 2 := ofPerm (Equiv.swap 2 3) theorem X_mem_unitaryGroup : (X : HilbertOperator 1) @@ -262,7 +266,7 @@ end Gate /-! ## Rotation gates (QSP / QNN conventions) -/ /-- Raw processing rotation `e^{i phi Z}`. -/ -def rotZOp (phi : ℝ) : HilbertOperator 1 := +@[expose] def rotZOp (phi : ℝ) : HilbertOperator 1 := !![Complex.exp (phi * Complex.I), 0; 0, Complex.exp (-(phi * Complex.I))] theorem rotZOp_mem_unitaryGroup (phi : ℝ) : @@ -274,7 +278,7 @@ theorem rotZOp_mem_unitaryGroup (phi : ℝ) : conj_exp_neg_I, exp_I_mul_exp_neg_I, exp_neg_I_mul_exp_I] /-- The processing rotation `e^{i phi Z}`. -/ -def rotZ (phi : ℝ) : Gate 1 := Gate.ofUnitary (rotZOp phi) (rotZOp_mem_unitaryGroup phi) +@[expose] def rotZ (phi : ℝ) : Gate 1 := Gate.ofUnitary (rotZOp phi) (rotZOp_mem_unitaryGroup phi) theorem rotZ_mul_rotZ (a b : ℝ) : rotZ a * rotZ b = rotZ (a + b) := by ext i j @@ -304,7 +308,7 @@ theorem rotZ_mul_rotZ_neg (phi : ℝ) : rotZ phi * rotZ (-phi) = 1 := by rw [rotZ_mul_rotZ, add_neg_cancel, rotZ_zero] /-- Raw standard `R_Y(theta)`. -/ -def rotYOp (theta : ℝ) : HilbertOperator 1 := +@[expose] def rotYOp (theta : ℝ) : HilbertOperator 1 := !![(Real.cos (theta / 2) : ℂ), -(Real.sin (theta / 2) : ℂ); (Real.sin (theta / 2) : ℂ), (Real.cos (theta / 2) : ℂ)] @@ -324,11 +328,11 @@ theorem rotYOp_mem_unitaryGroup (theta : ℝ) : try linear_combination hcs' /-- The standard `R_Y(theta)` gate. -/ -def rotY (theta : ℝ) : Gate 1 := +@[expose] def rotY (theta : ℝ) : Gate 1 := Gate.ofUnitary (rotYOp theta) (rotYOp_mem_unitaryGroup theta) /-- The standard `R_Z(phi) = e^{-i phi Z/2}`. -/ -def rotZStd (phi : ℝ) : Gate 1 := rotZ (-(phi / 2)) +@[expose] def rotZStd (phi : ℝ) : Gate 1 := rotZ (-(phi / 2)) @[simp] theorem rotZStd_zero : rotZStd 0 = 1 := by diff --git a/LeanPool/LeanQuantumAlg/Core/Components/Kets.lean b/LeanPool/LeanQuantumAlg/Core/Components/Kets.lean index ef108d0395..c4c54d1fe1 100644 --- a/LeanPool/LeanQuantumAlg/Core/Components/Kets.lean +++ b/LeanPool/LeanQuantumAlg/Core/Components/Kets.lean @@ -22,7 +22,7 @@ Linear combinations are formed at the raw `StateVector` layer and then bundled as `PureState` values once their unit norm has been proved. -/ -@[expose] public section +public section namespace QuantumAlg @@ -31,10 +31,10 @@ namespace PureState noncomputable section /-- `|0>`, the first one-qubit basis ket. -/ -def ket0 : PureState 1 := ket 0 +@[expose] def ket0 : PureState 1 := ket 0 /-- `|1>`, the second one-qubit basis ket. -/ -def ket1 : PureState 1 := ket 1 +@[expose] def ket1 : PureState 1 := ket 1 /-- `(sqrt 2)^-1 : ℂ`, the ubiquitous normalization scalar. -/ def invSqrt2 : ℂ := (Real.sqrt 2 : ℂ)⁻¹ @@ -71,11 +71,11 @@ theorem invSqrt2_ne_zero : invSqrt2 ≠ 0 := Real.sqrt_ne_zero'.mpr (by norm_num) /-- Raw vector for the Hadamard-basis state `|+⟩`. -/ -def ketPlusVec : StateVector 1 := +@[expose] def ketPlusVec : StateVector 1 := invSqrt2 • ((ket0 : StateVector 1) + (ket1 : StateVector 1)) /-- Raw vector for the Hadamard-basis state `|-⟩`. -/ -def ketMinusVec : StateVector 1 := +@[expose] def ketMinusVec : StateVector 1 := invSqrt2 • ((ket0 : StateVector 1) - (ket1 : StateVector 1)) @[simp] @@ -111,10 +111,10 @@ theorem norm_ketMinusVec : ‖ketMinusVec‖ = 1 := by norm_num /-- `|+> = (|0> + |1>)/sqrt 2`. -/ -def ketPlus : PureState 1 := ofVec ketPlusVec norm_ketPlusVec +@[expose] def ketPlus : PureState 1 := ofVec ketPlusVec norm_ketPlusVec /-- `|-> = (|0> - |1>)/sqrt 2`. -/ -def ketMinus : PureState 1 := ofVec ketMinusVec norm_ketMinusVec +@[expose] def ketMinus : PureState 1 := ofVec ketMinusVec norm_ketMinusVec @[simp] theorem ketPlus_apply (i : Fin (2 ^ 1)) : ketPlus i = invSqrt2 := by diff --git a/LeanPool/LeanQuantumAlg/Core/Components/Oracle.lean b/LeanPool/LeanQuantumAlg/Core/Components/Oracle.lean index b2f0bfee9c..09d2c671f4 100644 --- a/LeanPool/LeanQuantumAlg/Core/Components/Oracle.lean +++ b/LeanPool/LeanQuantumAlg/Core/Components/Oracle.lean @@ -44,7 +44,7 @@ Pinned Mathlib API: `Equiv.permCongr` (`permCongr_apply`), `Fin.rev` `Equiv.symm_apply_eq`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -68,12 +68,12 @@ def xorPerm (f : Fin (2 ^ n) → Bool) : @[simp] theorem xorPerm_apply (f : Fin (2 ^ n) → Bool) (p : Fin (2 ^ n) × Fin (2 ^ 1)) : xorPerm f p = (p.1, if f p.1 then p.2.rev else p.2) := - rfl + by rfl /-- The XOR oracle is an involution. -/ @[simp] theorem xorPerm_symm (f : Fin (2 ^ n) → Bool) : (xorPerm f).symm = xorPerm f := - rfl + by rfl /-- The XOR (bit-flip) oracle of `f`, as a permutation gate on `n + 1` qubits: `U_f |x⟩|b⟩ = |x⟩|b ⊕ f(x)⟩` (input register first/most significant, diff --git a/LeanPool/LeanQuantumAlg/Core/Cost.lean b/LeanPool/LeanQuantumAlg/Core/Cost.lean index 8786ef2495..cf9986b578 100644 --- a/LeanPool/LeanQuantumAlg/Core/Cost.lean +++ b/LeanPool/LeanQuantumAlg/Core/Cost.lean @@ -27,7 +27,7 @@ Hoare-style semantics for quantum while programs, are future extensions rather than prerequisites for this TimeM layer. -/ -@[expose] public section +public section namespace QuantumAlg @@ -43,6 +43,7 @@ structure Timed (α : Type u) where namespace Timed /-- Attach a trusted cost to a return value. -/ +@[expose] def trusted {α : Type u} (cost : ℕ) (ret : α) : Timed α := ⟨ret, cost⟩ @[simp] @@ -81,6 +82,7 @@ def zero : ResourceProfile where classicalOps := 0 /-- Sequential composition adds every resource counter. -/ +@[expose] def sequential (left right : ResourceProfile) : ResourceProfile where oracleQueries := left.oracleQueries + right.oracleQueries hadamardGates := left.hadamardGates + right.hadamardGates @@ -88,11 +90,12 @@ def sequential (left right : ResourceProfile) : ResourceProfile where classicalOps := left.classicalOps + right.classicalOps /-- Tensor/parallel circuit composition uses the same additive counters. -/ +@[expose] def tensor (left right : ResourceProfile) : ResourceProfile := sequential left right /-- Exact counter claim used by supporting public theorem statements. -/ -def HasExactCounts (profile : ResourceProfile) +@[expose] def HasExactCounts (profile : ResourceProfile) (oracleQueries hadamardGates elementaryGates classicalOps : ℕ) : Prop := profile.oracleQueries = oracleQueries ∧ profile.hadamardGates = hadamardGates ∧ @@ -154,7 +157,7 @@ deriving DecidableEq namespace CircuitGateProfile /-- Exact fixed-circuit gate-count claim. -/ -def HasExactCounts (profile : CircuitGateProfile) +@[expose] def HasExactCounts (profile : CircuitGateProfile) (hadamardGates controlledPhaseGates swapGates : ℕ) : Prop := profile.hadamardGates = hadamardGates ∧ profile.controlledPhaseGates = controlledPhaseGates ∧ @@ -172,6 +175,7 @@ structure Profiled (α : Type u) where namespace Profiled /-- Attach a trusted resource profile to a return value. -/ +@[expose] def trusted {α : Type u} (resources : ResourceProfile) (ret : α) : Profiled α := ⟨ret, resources⟩ @@ -198,7 +202,7 @@ deriving DecidableEq namespace CommunicationProfile /-- Exact communication-resource claim for protocol supporting theorems. -/ -def HasExactCounts (profile : CommunicationProfile) +@[expose] def HasExactCounts (profile : CommunicationProfile) (classicalBits transmittedQubits bellPairs : ℕ) : Prop := profile.classicalBits = classicalBits ∧ profile.transmittedQubits = transmittedQubits ∧ diff --git a/LeanPool/LeanQuantumAlg/Core/Gate.lean b/LeanPool/LeanQuantumAlg/Core/Gate.lean index 767429aced..0f9aca27cb 100644 --- a/LeanPool/LeanQuantumAlg/Core/Gate.lean +++ b/LeanPool/LeanQuantumAlg/Core/Gate.lean @@ -27,7 +27,7 @@ Pinned Mathlib API: `Matrix.mulVec` (and `mulVec_add/smul/single_one`, `Matrix.permMatrix_one`), `Finset.sum_ite_eq'`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -41,7 +41,7 @@ section variable {n : ℕ} /-- A Hilbert operator acts on a raw state vector by matrix-vector multiplication. -/ -noncomputable def applyVec (A : HilbertOperator n) (ψ : StateVector n) : StateVector n := +@[expose] noncomputable def applyVec (A : HilbertOperator n) (ψ : StateVector n) : StateVector n := WithLp.toLp 2 (A.mulVec ψ.ofLp) @[simp] @@ -192,13 +192,13 @@ theorem ext {G K : Gate n} (h : ∀ i j, G i j = K i j) : G = K := by simp_all /-- Build a gate from a unitary Hilbert operator. -/ -def ofUnitary (U : HilbertOperator n) +@[expose] def ofUnitary (U : HilbertOperator n) (hU : U ∈ Matrix.unitaryGroup (Fin (2 ^ n)) ℂ) : Gate n := ⟨U, hU⟩ @[simp] theorem coe_ofUnitary (U : HilbertOperator n) (hU : U ∈ Matrix.unitaryGroup (Fin (2 ^ n)) ℂ) : - ((ofUnitary U hU : Gate n) : HilbertOperator n) = U := rfl + ((ofUnitary U hU : Gate n) : HilbertOperator n) = U := by rfl instance : Monoid (Gate n) where one := ofUnitary 1 (one_mem _) @@ -219,14 +219,15 @@ instance : Monoid (Gate n) where rw [Matrix.mul_assoc] @[simp] -theorem coe_one : (((1 : Gate n) : HilbertOperator n)) = 1 := rfl +theorem coe_one : (((1 : Gate n) : HilbertOperator n)) = 1 := by rfl @[simp] theorem coe_mul (G K : Gate n) : (((G * K : Gate n) : HilbertOperator n)) - = (G : HilbertOperator n) * (K : HilbertOperator n) := rfl + = (G : HilbertOperator n) * (K : HilbertOperator n) := by rfl /-- Conjugate transpose of a unitary gate, again as a gate. -/ +@[expose] def conjTranspose (G : Gate n) : Gate n := ofUnitary ((G : HilbertOperator n).conjTranspose) (by rw [Matrix.mem_unitaryGroup_iff, Matrix.star_eq_conjTranspose, @@ -238,13 +239,14 @@ instance : Inv (Gate n) := ⟨conjTranspose⟩ @[simp] theorem coe_conjTranspose (G : Gate n) : ((G.conjTranspose : Gate n) : HilbertOperator n) - = (G : HilbertOperator n).conjTranspose := rfl + = (G : HilbertOperator n).conjTranspose := by rfl /-- A gate acts on a raw vector by its underlying Hilbert operator. -/ -def applyVec (G : Gate n) (ψ : StateVector n) : StateVector n := +@[expose] def applyVec (G : Gate n) (ψ : StateVector n) : StateVector n := HilbertOperator.applyVec (G : HilbertOperator n) ψ /-- A gate evolves a pure state to a pure state. -/ +@[expose] def apply (G : Gate n) (ψ : PureState n) : PureState n := PureState.ofVec (G.applyVec (ψ : StateVector n)) (by change ‖HilbertOperator.applyVec (G : HilbertOperator n) (ψ : StateVector n)‖ = 1 @@ -330,6 +332,7 @@ theorem apply_ket (G : Gate n) (x : Fin (2 ^ n)) (i : Fin (2 ^ n)) : /-- The gate permuting the computational basis by `σ`: `(ofPerm σ).apply (ket x) = ket (σ⁻¹ x)`. Unitary by construction. -/ +@[expose] def ofPerm (σ : Equiv.Perm (Fin (2 ^ n))) : Gate n := ofUnitary (σ.permMatrix ℂ) (by rw [Matrix.mem_unitaryGroup_iff, Matrix.star_eq_conjTranspose, diff --git a/LeanPool/LeanQuantumAlg/Core/Measurement.lean b/LeanPool/LeanQuantumAlg/Core/Measurement.lean index a6d582927d..bfeee326ba 100644 --- a/LeanPool/LeanQuantumAlg/Core/Measurement.lean +++ b/LeanPool/LeanQuantumAlg/Core/Measurement.lean @@ -24,7 +24,7 @@ states. The `PureState` wrappers automatically form probability distributions, because normalization is part of `PureState`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -36,7 +36,7 @@ variable {n : ℕ} /-- Born rule [dW19, qcnotes.tex:406]: the probability of observing outcome `x` when measuring `psi` in the computational basis. -/ -noncomputable def probOutcome (psi : StateVector n) (x : Fin (2 ^ n)) : ℝ := +@[expose] noncomputable def probOutcome (psi : StateVector n) (x : Fin (2 ^ n)) : ℝ := ‖psi x‖ ^ 2 theorem probOutcome_nonneg (psi : StateVector n) (x : Fin (2 ^ n)) : @@ -60,6 +60,7 @@ theorem probOutcome_ket (x y : Fin (2 ^ n)) : /-- Probability that measuring qubit 0 of a `1 + n`-qubit raw state vector yields `b`, leaving the other qubits unobserved. -/ +@[expose] noncomputable def probQubit0 (psi : StateVector (1 + n)) (b : Fin (2 ^ 1)) : ℝ := ∑ y : Fin (2 ^ n), ‖psi (prodEquiv (b, y))‖ ^ 2 @@ -86,6 +87,7 @@ noncomputable section variable {n : ℕ} /-- Born-rule probability for a pure state. -/ +@[expose] def probOutcome (psi : PureState n) (x : Fin (2 ^ n)) : ℝ := StateVector.probOutcome (psi : StateVector n) x @@ -112,12 +114,13 @@ theorem probOutcome_ket (x y : Fin (2 ^ n)) : /-- Expectation value `` of an observable `O`, represented as a real number via the real part. Hermiticity is a property of the observable, not part of the raw `HilbertOperator` type. -/ +@[expose] def expVal (psi : PureState n) (O : HilbertOperator n) : ℝ := (inner ℂ (psi : StateVector n) (HilbertOperator.applyVec O (psi : StateVector n))).re /-- Probability that measuring qubit 0 of a `1 + n`-qubit pure state yields `b`, leaving the other qubits unobserved. -/ -def probQubit0 (psi : PureState (1 + n)) (b : Fin (2 ^ 1)) : ℝ := +@[expose] def probQubit0 (psi : PureState (1 + n)) (b : Fin (2 ^ 1)) : ℝ := StateVector.probQubit0 (psi : StateVector (1 + n)) b theorem probQubit0_nonneg (psi : PureState (1 + n)) (b : Fin (2 ^ 1)) : diff --git a/LeanPool/LeanQuantumAlg/Core/State.lean b/LeanPool/LeanQuantumAlg/Core/State.lean index e90bfe6ac9..5b8c9f4d18 100644 --- a/LeanPool/LeanQuantumAlg/Core/State.lean +++ b/LeanPool/LeanQuantumAlg/Core/State.lean @@ -55,7 +55,7 @@ Pinned Mathlib API: `PiLp.single`, `PiLp.single_apply`, `PiLp.norm_single`, `EuclideanSpace.norm_eq`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -110,6 +110,7 @@ theorem hSMul_apply (c : ℂ) (ψ : PureState n) (i : Fin (2 ^ n)) : (c • ψ : StateVector n) i = c * ψ i := rfl /-- Build a pure state from a normalized Hilbert-space vector. -/ +@[expose] def ofVec (v : StateVector n) (h : ‖v‖ = 1) : PureState n := ⟨v, h⟩ @[simp] @@ -138,7 +139,7 @@ theorem ext {ψ φ : PureState n} (h : ∀ i, ψ i = φ i) : ψ = φ := by /-- The computational basis ket `|x⟩ : PureState n`, big-endian (qubit 0 is the most significant bit of `x`). -/ -def ket (x : Fin (2 ^ n)) : PureState n := +@[expose] def ket (x : Fin (2 ^ n)) : PureState n := ofVec (PiLp.single 2 x 1) (by simp) @[simp] diff --git a/LeanPool/LeanQuantumAlg/Core/Tensor.lean b/LeanPool/LeanQuantumAlg/Core/Tensor.lean index 47a64d52c9..ce575d0c67 100644 --- a/LeanPool/LeanQuantumAlg/Core/Tensor.lean +++ b/LeanPool/LeanQuantumAlg/Core/Tensor.lean @@ -17,7 +17,7 @@ layers. `PureState.tensor` and `Gate.tensor` wrap these raw tensors with the normalization/unitarity proofs needed to stay in their semantic types. -/ -@[expose] public section +public section namespace QuantumAlg @@ -30,6 +30,7 @@ namespace StateVector section /-- Tensor product of raw Hilbert-space vectors. -/ +@[expose] noncomputable def tensor (ψ : StateVector m) (φ : StateVector n) : StateVector (m + n) := WithLp.toLp 2 fun i => ψ (prodEquiv.symm i).1 * φ (prodEquiv.symm i).2 @@ -37,7 +38,7 @@ noncomputable def tensor (ψ : StateVector m) (φ : StateVector n) : StateVector theorem tensor_apply (ψ : StateVector m) (φ : StateVector n) (i : Fin (2 ^ (m + n))) : tensor ψ φ i = ψ (prodEquiv.symm i).1 * φ (prodEquiv.symm i).2 := - rfl + by rfl theorem tensor_apply_prod (ψ : StateVector m) (φ : StateVector n) (x : Fin (2 ^ m)) (y : Fin (2 ^ n)) : @@ -154,6 +155,7 @@ namespace PureState section /-- Tensor product of pure states. -/ +@[expose] noncomputable def tensor (ψ : PureState m) (φ : PureState n) : PureState (m + n) := ofVec (StateVector.tensor (ψ : StateVector m) (φ : StateVector n)) (by rw [StateVector.norm_tensor, ψ.norm_eq_one, φ.norm_eq_one, one_mul]) @@ -254,6 +256,7 @@ namespace HilbertOperator section /-- Tensor product of Hilbert-space operators. -/ +@[expose] noncomputable def tensor (G : HilbertOperator m) (K : HilbertOperator n) : HilbertOperator (m + n) := Matrix.reindex prodEquiv prodEquiv (G ⊗ₖ K) @@ -263,7 +266,7 @@ theorem tensor_apply (G : HilbertOperator m) (K : HilbertOperator n) (i j : Fin (2 ^ (m + n))) : tensor G K i j = G (prodEquiv.symm i).1 (prodEquiv.symm j).1 - * K (prodEquiv.symm i).2 (prodEquiv.symm j).2 := rfl + * K (prodEquiv.symm i).2 (prodEquiv.symm j).2 := by rfl @[simp] theorem zero_tensor (K : HilbertOperator n) : @@ -339,6 +342,7 @@ namespace Gate noncomputable section /-- Tensor product of unitary gates. -/ +@[expose] def tensor (G : Gate m) (K : Gate n) : Gate (m + n) := ofUnitary (HilbertOperator.tensor (G : HilbertOperator m) (K : HilbertOperator n)) (HilbertOperator.tensor_mem_unitaryGroup G.unitary K.unitary) @@ -348,7 +352,7 @@ theorem tensor_apply (G : Gate m) (K : Gate n) (i j : Fin (2 ^ (m + n))) : G.tensor K i j = G (prodEquiv.symm i).1 (prodEquiv.symm j).1 - * K (prodEquiv.symm i).2 (prodEquiv.symm j).2 := rfl + * K (prodEquiv.symm i).2 (prodEquiv.symm j).2 := by rfl theorem tensor_mul_tensor (G G' : Gate m) (K K' : Gate n) : G.tensor K * G'.tensor K' = tensor (G * G') (K * K') := by diff --git a/LeanPool/LeanQuantumAlg/Init.lean b/LeanPool/LeanQuantumAlg/Init.lean index 01a89c5a86..3a71d7bea1 100644 --- a/LeanPool/LeanQuantumAlg/Init.lean +++ b/LeanPool/LeanQuantumAlg/Init.lean @@ -15,4 +15,4 @@ public import Mathlib.Data.Nat.Notation This module sets up the public QuantumAlg import environment. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Primitives.lean b/LeanPool/LeanQuantumAlg/Primitives.lean index 6f60ad9f1c..87d96062e0 100644 --- a/LeanPool/LeanQuantumAlg/Primitives.lean +++ b/LeanPool/LeanQuantumAlg/Primitives.lean @@ -31,4 +31,4 @@ import Mathlib.Tactic.Positivity.Finset This module re-exports reusable quantum primitives. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Primitives/AmplitudeAmplification.lean b/LeanPool/LeanQuantumAlg/Primitives/AmplitudeAmplification.lean index 58f695c5bb..8854e775f7 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/AmplitudeAmplification.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/AmplitudeAmplification.lean @@ -30,7 +30,7 @@ with `amplitudeAmplificationStep θ` on this plane. good-state measurement probability. -/ -@[expose] public section +public section namespace QuantumAlg @@ -39,7 +39,7 @@ open PureState Gate noncomputable section /-- The angle after `k` amplitude-amplification iterates: `(2k+1)θ`. -/ -def amplitudeAmplificationAngle (θ : ℝ) (k : ℕ) : ℝ := ((2 : ℝ) * k + 1) * θ +@[expose] def amplitudeAmplificationAngle (θ : ℝ) (k : ℕ) : ℝ := ((2 : ℝ) * k + 1) * θ /-- The good/bad-plane state with bad amplitude `cos((2k+1)θ)` and good amplitude `sin((2k+1)θ)`. In this two-dimensional model, `|0⟩` is the bad axis @@ -258,11 +258,11 @@ def timedIterate (M : AmplitudeAmplificationModel) (k : ℕ) : Timed (PureState theorem timedIterate_ret (M : AmplitudeAmplificationModel) (k : ℕ) : (timedIterate M k).ret = Gate.apply ((M.startReflection * M.goodReflection) ^ k) - (amplitudeAmplificationState M.θ 0) := rfl + (amplitudeAmplificationState M.θ 0) := by rfl @[simp] theorem timedIterate_time (M : AmplitudeAmplificationModel) (k : ℕ) : - (timedIterate M k).time = k := rfl + (timedIterate M k).time = k := by rfl /-- Amplitude-amplification correctness, phrased through the TimeM return value. -/ theorem timedIterate_correct (M : AmplitudeAmplificationModel) (k : ℕ) : diff --git a/LeanPool/LeanQuantumAlg/Primitives/BellPair.lean b/LeanPool/LeanQuantumAlg/Primitives/BellPair.lean index a418c4ffd0..8be501d423 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/BellPair.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/BellPair.lean @@ -30,7 +30,7 @@ another. The registered `bell-state-prep` target is `bell_state_prep` here. - `LeanPool.LeanQuantumAlg.norm_bell` — the Bell state is normalized. -/ -@[expose] public section +public section namespace QuantumAlg @@ -40,7 +40,7 @@ noncomputable section /-- Raw Bell-state vector `( |00⟩ + |11⟩ ) / √2` [dW19, qcnotes.tex:622]. In the big-endian basis labelling, `|00⟩ = ket 0` and `|11⟩ = ket 3`. -/ -def bellVec : StateVector 2 := +@[expose] def bellVec : StateVector 2 := invSqrt2 • ((ket 0 : PureState 2) + (ket 3 : PureState 2) : StateVector 2) /-- The raw Bell-state vector has unit norm. -/ @@ -61,7 +61,7 @@ theorem norm_bellVec : ‖bellVec‖ = 1 := by rw [h, inv_mul_cancel₀ (Real.sqrt_ne_zero'.mpr (by norm_num))] /-- The Bell state (EPR-pair) as a normalized pure state. -/ -def bell : PureState 2 := ofVec bellVec norm_bellVec +@[expose] def bell : PureState 2 := ofVec bellVec norm_bellVec /-- The Bell state in per-qubit tensor form: `(|0⟩⊗|0⟩ + |1⟩⊗|1⟩)/√2`. -/ theorem bell_eq_tensor : diff --git a/LeanPool/LeanQuantumAlg/Primitives/ControlledTransform.lean b/LeanPool/LeanQuantumAlg/Primitives/ControlledTransform.lean index ebd0cff2f4..4f4140871a 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/ControlledTransform.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/ControlledTransform.lean @@ -63,7 +63,7 @@ leaves only the parity phase `(e^{-iθ/2})^{L mod 2}`. the eigenphase by some QPP word. -/ -@[expose] public section +public section namespace QuantumAlg @@ -271,8 +271,7 @@ def qppYZZYZ (U : Gate n) (φ θ₀ φ₀ : ℝ) (ps : List (ℝ × ℝ)) : Gate @[simp] theorem qppYZZYZ_nil (U : Gate n) (φ θ₀ φ₀ : ℝ) : qppYZZYZ U φ θ₀ φ₀ [] - = Gate.tensor (rotZStd φ * (rotY θ₀ * rotZStd φ₀)) (1 : Gate n) := - rfl + = Gate.tensor (rotZStd φ * (rotY θ₀ * rotZStd φ₀)) (1 : Gate n) := by rfl theorem qppYZZYZ_concat (U : Gate n) (φ θ₀ φ₀ : ℝ) (ps : List (ℝ × ℝ)) (p : ℝ × ℝ) : diff --git a/LeanPool/LeanQuantumAlg/Primitives/HadamardTest.lean b/LeanPool/LeanQuantumAlg/Primitives/HadamardTest.lean index cd9acb5dff..70550962b2 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/HadamardTest.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/HadamardTest.lean @@ -21,7 +21,7 @@ Pure-state normalization and gate unitarity are carried by the `PureState` and `Gate` types themselves. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/LCU.lean b/LeanPool/LeanQuantumAlg/Primitives/LCU.lean index 8eecc9822e..bd0afe8b25 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/LCU.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/LCU.lean @@ -20,7 +20,7 @@ operators used inside a block encoding, not themselves declared as unitary `Gate`s in this file. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/ParameterShift.lean b/LeanPool/LeanQuantumAlg/Primitives/ParameterShift.lean index 2b05a6259b..6b630f5410 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/ParameterShift.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/ParameterShift.lean @@ -37,7 +37,7 @@ Farhi, Goldstone, Gutmann (2014), *A Quantum Approximate Optimization Algorithm* - `LeanPool.LeanQuantumAlg.varCost_ket0_Z_parameter_shift` — the parameter-shift rule for it. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/PhaseKickback.lean b/LeanPool/LeanQuantumAlg/Primitives/PhaseKickback.lean index 70807ea143..a463c65ff8 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/PhaseKickback.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/PhaseKickback.lean @@ -39,7 +39,7 @@ is "kicked back" in front of the `|1⟩` component of the control `U |u⟩ = e^{iθ} |u⟩`. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/QFT.lean b/LeanPool/LeanQuantumAlg/Primitives/QFT.lean index af9db41705..a16f8630e8 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QFT.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QFT.lean @@ -53,7 +53,7 @@ Pinned Mathlib API: `Complex.exp`, `Complex.exp_nat_mul`, `Complex.exp_eq_one_if `Int.abs_sub_lt_of_lt_lt`, `Matrix.mem_unitaryGroup_iff'`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -66,7 +66,7 @@ noncomputable section /-- Primitive `2^n`-th root of unity: `ω_n = e^{2πi/2^n}` [dW19, qcnotes.tex:1690]. Forward-transform sign convention (`+2πi`, not `−2πi`). -/ -def omega (n : ℕ) : ℂ := +@[expose] def omega (n : ℕ) : ℂ := Complex.exp (↑(2 * Real.pi / (2 : ℝ) ^ n) * Complex.I) -- [dW19, qcnotes.tex:1690]: ω_N = e^{2πi/N} @@ -204,10 +204,10 @@ theorem QFT_mem_unitaryGroup (n : ℕ) : rw [sum_omega_zpow_eq_zero n hd, mul_zero] /-- The quantum Fourier transform on `n` qubits as a unitary gate. -/ -def QFT (n : ℕ) : Gate n := Gate.ofUnitary (QFTMatrix n) (QFT_mem_unitaryGroup n) +@[expose] def QFT (n : ℕ) : Gate n := Gate.ofUnitary (QFTMatrix n) (QFT_mem_unitaryGroup n) @[simp] -theorem QFT_coe (n : ℕ) : ((QFT n : Gate n) : HilbertOperator n) = QFTMatrix n := rfl +theorem QFT_coe (n : ℕ) : ((QFT n : Gate n) : HilbertOperator n) = QFTMatrix n := by rfl /-! ### Action on basis kets -/ diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel.lean index b2ece07867..004779c1de 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel.lean @@ -36,4 +36,4 @@ Umbrella module for the quantum-kernel development; re-exports the genuine resul (`eqk_realizes`, Gil-Fuster 2023). -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean index 2bd5d3c2b8..b93e56aea2 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean @@ -27,7 +27,7 @@ Source: Liu, Arunachalam, Temme (2021), *A rigorous and robust quantum speed-up machine learning*. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean index ae446a24b9..2383b09ac7 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean @@ -20,7 +20,7 @@ invariance each coordinate reduces to a uniform variable on `[-π,π]`, so we st `Var[κ]=(3/8)ⁿ-(1/4)ⁿ`), giving genuine exponential concentration with NO Haar assumption. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean index 0390b41911..77c333b776 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean @@ -18,7 +18,7 @@ for one secret breaks every secret (and hence the discrete-log problem). Pure fi theory; no Haar / complexity assumptions. -/ -@[expose] public section +public section namespace QuantumAlg @@ -80,7 +80,7 @@ theorem dlogConcept_reduction (s : ZMod (Nat.card G)) (y : G) : rw [dlogConcept_shift, show s - (s - 1) = 1 from by ring] /-- Uniform (counting) accuracy of a Boolean predictor `p` against the concept `f_s`. -/ -noncomputable def acc (p : G → Bool) (s : ZMod (Nat.card G)) : ℝ := +@[expose] noncomputable def acc (p : G → Bool) (s : ZMod (Nat.card G)) : ℝ := ((Finset.univ.filter (fun x => p x = dlogConcept g hg s x)).card : ℝ) / (Nat.card G : ℝ) omit [IsCyclic G] in diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Expressivity.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Expressivity.lean index a2659fadee..48ba2507fc 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Expressivity.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Expressivity.lean @@ -17,7 +17,7 @@ realizable, up to a positive affine transform, by valid density matrices via the quantum kernel `tr{ρ(x)ρ(x')}`. Converse of `quantumKernel_gram_posSemidef`. No assumptions. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fidelity.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fidelity.lean index bfac7d1ecd..76c18fc226 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fidelity.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fidelity.lean @@ -42,7 +42,7 @@ methods*. - `LeanPool.LeanQuantumAlg.quantumKernel_self` — the diagonal value on a pure state. -/ -@[expose] public section +public section namespace QuantumAlg @@ -64,7 +64,7 @@ noncomputable def conjState (ψ : PureState n) : PureState n := @[simp] theorem conjState_apply (ψ : PureState n) (i : Fin (2 ^ n)) : - conjState ψ i = starRingEnd ℂ (ψ i) := rfl + conjState ψ i = starRingEnd ℂ (ψ i) := by rfl /-- Conjugating both arguments conjugates the inner product. -/ theorem inner_conjState (a b : PureState n) : diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fourier.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fourier.lean index 3614387ab6..ffca5eb8e4 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fourier.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Fourier.lean @@ -25,7 +25,7 @@ applying a constant matrix and a diagonal phase gate), hence the overlap and its modulus are `TrigPolynomial`s; collecting by frequency gives the representation. -/ -@[expose] public section +public section namespace QuantumAlg @@ -200,7 +200,7 @@ theorem featComp_eval (W : Fin (N + 1) → Matrix (Fin d) (Fin d) ℂ) (lam : Fi /-! ### Feature-component frequency invariant -/ theorem tpVecConst_freqs (w : Fin d → ℂ) (m : Fin d) : - (tpVecConst w m).freqs = ({0} : Finset (Fin N → ℝ)) := rfl + (tpVecConst w m).freqs = ({0} : Finset (Fin N → ℝ)) := by rfl theorem tpVecConstMul_freqs (M : Matrix (Fin d) (Fin d) ℂ) (V : Fin d → TrigPolynomial N) (m : Fin d) : diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN.lean index f4f30c22a1..7a61a60737 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN.lean @@ -33,4 +33,4 @@ Umbrella module for the quantum-neural-network and barren-plateau development. - `QNN.PauliPropagation` — Pauli-propagation truncation error. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/DynamicalLieAlgebra.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/DynamicalLieAlgebra.lean index e928d25e03..ab72f85296 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/DynamicalLieAlgebra.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/DynamicalLieAlgebra.lean @@ -41,7 +41,7 @@ QAOA*. universal property: it is the smallest Lie subalgebra containing the generators. -/ -@[expose] public section +public section attribute [local instance 100] LieRing.ofAssociativeRing @@ -54,7 +54,7 @@ variable {N : ℕ} /-- The dynamical Lie algebra generated by a set of matrix generators: the smallest Lie subalgebra of `gl(N, ℂ)` (with the commutator bracket) containing them — the Lie closure under nested commutators. -/ -def dynamicalLieAlgebra (gens : Set (Matrix (Fin N) (Fin N) ℂ)) : +@[expose] def dynamicalLieAlgebra (gens : Set (Matrix (Fin N) (Fin N) ℂ)) : LieSubalgebra ℂ (Matrix (Fin N) (Fin N) ℂ) := LieSubalgebra.lieSpan ℂ (Matrix (Fin N) (Fin N) ℂ) gens diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/FullDLABasis.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/FullDLABasis.lean index 2d564b903b..e39f63714c 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/FullDLABasis.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/FullDLABasis.lean @@ -27,7 +27,7 @@ family with an **exponentially vanishing** loss variance: a genuine barren plate witnessing that the capstone is not vacuous on the canonical physical case. -/ -@[expose] public section +public section attribute [local instance 100] LieRing.ofAssociativeRing diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/LieAlgebraicBP.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/LieAlgebraicBP.lean index 2eb36daee4..236ebc096c 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/LieAlgebraicBP.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/LieAlgebraicBP.lean @@ -53,7 +53,7 @@ Source: Ragone, Bakalov, Sauvage, Kemper, Ortiz Marrero, Larocca, Cerezo (2023), *A Lie algebraic theory of barren plateaus* (arXiv:2309.09342). -/ -@[expose] public section +public section attribute [local instance 100] LieRing.ofAssociativeRing @@ -71,7 +71,7 @@ variable {N : ℕ} /-- The **dimension of the dynamical Lie algebra** of a generator set: the `ℂ`-finrank of the formalized `dynamicalLieAlgebra` (a subspace of `gl(N, ℂ)`). This is the genuine `dim g` of the Lie-algebraic variance law, not an opaque parameter. -/ -def dlaDim (gens : Set (Matrix (Fin N) (Fin N) ℂ)) : ℕ := +@[expose] def dlaDim (gens : Set (Matrix (Fin N) (Fin N) ℂ)) : ℕ := Module.finrank ℂ (dynamicalLieAlgebra gens).toSubmodule /-! ### Tier 1 — barren plateau from exponential growth of the *real* dimension -/ diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/Overparametrization.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/Overparametrization.lean index cef3799991..f457cfc2d3 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/Overparametrization.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/Overparametrization.lean @@ -40,7 +40,7 @@ Source: Larocca, Ju, García-Martín, Coles, Cerezo (2021), arXiv:2109.11676. overparametrized, adding parameters keeps the QNN overparametrized. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean index 8c9fc730fe..dd01fc8a42 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean @@ -24,7 +24,7 @@ Source: Rudolph, Jones, Teng, Angrisani, Holmes (2025), *Pauli Propagation* (arXiv:2505.21606), Theory Box 3. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/Trainability.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/Trainability.lean index 3b5ff0eb73..91223d62b1 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/Trainability.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/Trainability.lean @@ -29,7 +29,7 @@ Sources: McClean, Boixo, Smelyanskiy, Babbush, Neven (2018); Cerezo, Sone, Volko Cincio, Coles (2021); Ragone et al. (2023); Thanasilp, Wang, Cerezo, Holmes (2022). -/ -@[expose] public section +public section namespace QuantumAlg @@ -37,6 +37,7 @@ open Filter Topology /-- **Exponential concentration.** `X n` deviates from `μ` by at most `C / b ^ n` for some base `b > 1` (McClean 2018; Thanasilp 2022, Def. 1). -/ +@[expose] def ExpConcentrated (X : ℕ → ℝ) (μ : ℝ) : Prop := ∃ b : ℝ, 1 < b ∧ ∃ C : ℝ, 0 ≤ C ∧ ∀ n, |X n - μ| ≤ C / b ^ n @@ -59,6 +60,7 @@ theorem ExpConcentrated.tendsto {X : ℕ → ℝ} {μ : ℝ} (h : ExpConcentrate /-- A model has a **barren plateau** when its loss/gradient variance is exponentially concentrated to `0` (so the trainable signal vanishes with system size). -/ +@[expose] def HasBarrenPlateau (variance : ℕ → ℝ) : Prop := ExpConcentrated variance 0 /-- Under a barren plateau the variance vanishes in the large-system limit. -/ diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/VarianceFormula.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/VarianceFormula.lean index 32d278e326..9b460839d3 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/VarianceFormula.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/VarianceFormula.lean @@ -40,7 +40,7 @@ form — is machine-checked. `⟪C, H⊗H⟫ = P_g(H)`). -/ -@[expose] public section +public section attribute [local instance 100] LieRing.ofAssociativeRing diff --git a/LeanPool/LeanQuantumAlg/Primitives/QSP.lean b/LeanPool/LeanQuantumAlg/Primitives/QSP.lean index 0f1a5dc8dc..c420c90ecb 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QSP.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QSP.lean @@ -41,4 +41,4 @@ The two families are genuinely different transforms with different inputs - `LeanPool.LeanQuantumAlg.qsp_yzy_iff`, `LeanPool.LeanQuantumAlg.qsp_yzzyz_iff` — Fourier basis. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Primitives/QSP/Chebyshev.lean b/LeanPool/LeanQuantumAlg/Primitives/QSP/Chebyshev.lean index d9859ee86c..b7ea5045d0 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QSP/Chebyshev.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QSP/Chebyshev.lean @@ -64,7 +64,7 @@ Pinned Mathlib API: `Polynomial.coeff_X_mul`, `Polynomial.coeff_mul`, `Set.Icc.infinite`, `List.reverseRecOn`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -88,7 +88,7 @@ def qspO (φ₀ : ℝ) (φs : List ℝ) (x : ℝ) : HilbertOperator 1 := φs.foldl (fun U φ => U * (signalO x * rotZ φ)) (rotZ φ₀ : HilbertOperator 1) @[simp] -theorem qspO_nil (φ₀ : ℝ) (x : ℝ) : qspO φ₀ [] x = rotZ φ₀ := rfl +theorem qspO_nil (φ₀ : ℝ) (x : ℝ) : qspO φ₀ [] x = rotZ φ₀ := by rfl theorem qspO_concat (φ₀ : ℝ) (φs : List ℝ) (φ : ℝ) (x : ℝ) : qspO φ₀ (φs ++ [φ]) x = qspO φ₀ φs x * (signalO x * rotZ φ) := by @@ -622,7 +622,7 @@ def qspW (φ₀ : ℝ) (φs : List ℝ) (x : ℝ) : HilbertOperator 1 := φs.foldl (fun U φ => U * (signalW x * rotZ φ)) (rotZ φ₀ : HilbertOperator 1) @[simp] -theorem qspW_nil (φ₀ : ℝ) (x : ℝ) : qspW φ₀ [] x = rotZ φ₀ := rfl +theorem qspW_nil (φ₀ : ℝ) (x : ℝ) : qspW φ₀ [] x = rotZ φ₀ := by rfl theorem qspW_concat (φ₀ : ℝ) (φs : List ℝ) (φ : ℝ) (x : ℝ) : qspW φ₀ (φs ++ [φ]) x = qspW φ₀ φs x * (signalW x * rotZ φ) := by diff --git a/LeanPool/LeanQuantumAlg/Primitives/QSP/Fourier.lean b/LeanPool/LeanQuantumAlg/Primitives/QSP/Fourier.lean index fdd0c744f6..4bfc1313e0 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QSP/Fourier.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QSP/Fourier.lean @@ -60,7 +60,7 @@ Pinned Mathlib API: `Polynomial.reflect`, `Polynomial.divX`, `Set.Ioo.infinite`, `List.reverseRecOn`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -154,7 +154,7 @@ def qspYZY (θ₀ : ℝ) (θs : List ℝ) (x : ℝ) : Gate 1 := θs.foldl (fun U θ => U * (rotZStd x * rotY θ)) (rotY θ₀) @[simp] -theorem qspYZY_nil (θ₀ : ℝ) (x : ℝ) : qspYZY θ₀ [] x = rotY θ₀ := rfl +theorem qspYZY_nil (θ₀ : ℝ) (x : ℝ) : qspYZY θ₀ [] x = rotY θ₀ := by rfl theorem qspYZY_concat (θ₀ : ℝ) (θs : List ℝ) (θ : ℝ) (x : ℝ) : qspYZY θ₀ (θs ++ [θ]) x = qspYZY θ₀ θs x * (rotZStd x * rotY θ) := by @@ -169,7 +169,7 @@ def qspYZZYZ (φ θ₀ φ₀ : ℝ) (ps : List (ℝ × ℝ)) (x : ℝ) : Gate 1 @[simp] theorem qspYZZYZ_nil (φ θ₀ φ₀ : ℝ) (x : ℝ) : - qspYZZYZ φ θ₀ φ₀ [] x = rotZStd φ * (rotY θ₀ * rotZStd φ₀) := rfl + qspYZZYZ φ θ₀ φ₀ [] x = rotZStd φ * (rotY θ₀ * rotZStd φ₀) := by rfl theorem qspYZZYZ_concat (φ θ₀ φ₀ : ℝ) (ps : List (ℝ × ℝ)) (p : ℝ × ℝ) (x : ℝ) : diff --git a/LeanPool/LeanQuantumAlg/Primitives/SwapTest.lean b/LeanPool/LeanQuantumAlg/Primitives/SwapTest.lean index 8d1176336b..33495eaa4c 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/SwapTest.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/SwapTest.lean @@ -17,7 +17,7 @@ run the Hadamard test with the unitary that swaps the two registers probability `(1 - ||^2)/2` [BCWdW01, main.tex:328]. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Primitives/WalshHadamard.lean b/LeanPool/LeanQuantumAlg/Primitives/WalshHadamard.lean index 291be969e1..68e42aa4d1 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/WalshHadamard.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/WalshHadamard.lean @@ -41,7 +41,7 @@ orthogonality and string recovery for Bernstein-Vazirani). with `finalJointState_eq_finalState_tensor` factoring off the `|−⟩` target. -/ -@[expose] public section +public section namespace QuantumAlg @@ -61,7 +61,7 @@ abbrev Oracle (n : ℕ) : Type := Fin (2 ^ n) → Bool abbrev oracleGate (f : Oracle n) : Gate (n + 1) := Gate.xorOracle f /-- The phase `(-1)^{f x}`, written as a complex scalar. -/ -def phaseSign (f : Oracle n) (x : Fin (2 ^ n)) : ℂ := +@[expose] def phaseSign (f : Oracle n) (x : Fin (2 ^ n)) : ℂ := if f x then -1 else 1 /-! ### The Walsh-Hadamard transform -/ @@ -69,14 +69,15 @@ def phaseSign (f : Oracle n) (x : Fin (2 ^ n)) : ℂ := /-- The bit of a basis label used in the Walsh-Hadamard character. The bit order only affects nonzero rows; the zero row used by Deutsch-Jozsa is independent of it. -/ +@[expose] def bit (x : Fin (2 ^ n)) (k : Fin n) : Bool := x.val.testBit k.val /-- Parity of the bitwise inner product of two basis labels. -/ -def dotParity (x y : Fin (2 ^ n)) : Bool := +@[expose] def dotParity (x y : Fin (2 ^ n)) : Bool := Odd ((Finset.univ.filter fun k : Fin n => bit x k && bit y k).card) /-- The Walsh-Hadamard sign `(-1)^{x · y}`. -/ -def walshSign (x y : Fin (2 ^ n)) : ℂ := if dotParity x y then -1 else 1 +@[expose] def walshSign (x y : Fin (2 ^ n)) : ℂ := if dotParity x y then -1 else 1 /-- `(√(2^n))⁻¹`, the normalization scalar of the `n`-qubit Hadamard layer. -/ def invSqrtCard (n : ℕ) : ℂ := (Real.sqrt ((2 ^ n : ℕ) : ℝ) : ℂ)⁻¹ @@ -270,7 +271,7 @@ theorem norm_phaseSign (f : Oracle n) (x : Fin (2 ^ n)) : by_cases h : f x <;> simp [h] /-- Raw `n`-qubit Hadamard layer in Walsh-Hadamard closed form. -/ -def hadamardLayerOp (n : ℕ) : HilbertOperator n := +@[expose] def hadamardLayerOp (n : ℕ) : HilbertOperator n := fun y x => invSqrtCard n * walshSign y x /-- The Walsh-Hadamard closed-form matrix is unitary. -/ @@ -300,7 +301,7 @@ theorem hadamardLayerOp_mem_unitaryGroup (n : ℕ) : · rw [ite_eq_right hys, Matrix.one_apply_ne hys, mul_zero] /-- The `n`-qubit Hadamard layer as a unitary gate. -/ -def hadamardLayer (n : ℕ) : Gate n := +@[expose] def hadamardLayer (n : ℕ) : Gate n := Gate.ofUnitary (hadamardLayerOp n) (hadamardLayerOp_mem_unitaryGroup n) /-- Raw uniform input-register vector produced by the first Hadamard layer. -/ @@ -317,8 +318,7 @@ def uniformState (n : ℕ) : PureState n := PureState.ofVec (uniformStateVec n) (norm_uniformStateVec n) @[simp] -theorem uniformState_apply (x : Fin (2 ^ n)) : uniformState n x = invSqrtCard n := - rfl +theorem uniformState_apply (x : Fin (2 ^ n)) : uniformState n x = invSqrtCard n := by rfl /-- The first Hadamard layer sends `|0^n⟩` to the uniform superposition. -/ theorem hadamardLayer_apply_zero : @@ -350,7 +350,7 @@ def postOracleState (f : Oracle n) : PureState (n + 1) := /-- The input-register state after rewriting the oracle query by phase kickback: `(√(2^n))⁻¹ ∑ x, (-1)^{f x}|x⟩`. -/ -def afterPhaseQueryVec (f : Oracle n) : StateVector n := +@[expose] def afterPhaseQueryVec (f : Oracle n) : StateVector n := WithLp.toLp 2 fun x => invSqrtCard n * phaseSign f x /-- The phase-query vector has unit norm. -/ @@ -359,7 +359,7 @@ theorem norm_afterPhaseQueryVec (f : Oracle n) : ‖afterPhaseQueryVec f‖ = 1 simp_all /-- The input register after the XOR oracle has been converted into a phase query. -/ -def afterPhaseQuery (f : Oracle n) : PureState n := +@[expose] def afterPhaseQuery (f : Oracle n) : PureState n := PureState.ofVec (afterPhaseQueryVec f) (norm_afterPhaseQueryVec f) /-- The actual XOR-oracle query on the uniform input register and `|−⟩` @@ -378,6 +378,7 @@ theorem postOracleState_eq_afterPhaseQuery_tensor (f : Oracle n) : /-- The final input-register state after the second Hadamard layer, in the phase-query view. -/ +@[expose] def finalState (f : Oracle n) : PureState n := (hadamardLayer n).apply (afterPhaseQuery f) diff --git a/LeanPool/LeanQuantumAlg/Util.lean b/LeanPool/LeanQuantumAlg/Util.lean index 9d09f9d2c3..1a21568983 100644 --- a/LeanPool/LeanQuantumAlg/Util.lean +++ b/LeanPool/LeanQuantumAlg/Util.lean @@ -22,4 +22,4 @@ import Mathlib.Tactic.Positivity.Finset This module re-exports the quantum-free utility layer. -/ -@[expose] public section +public section diff --git a/LeanPool/LeanQuantumAlg/Util/Complex.lean b/LeanPool/LeanQuantumAlg/Util/Complex.lean index e403dd3ade..a82ad8fb42 100644 --- a/LeanPool/LeanQuantumAlg/Util/Complex.lean +++ b/LeanPool/LeanQuantumAlg/Util/Complex.lean @@ -22,7 +22,7 @@ SU(2)/unit-circle parameterizations (`mul_conj_eq_norm_sq`, `exists_unit_mul`, These are upstream candidates for Mathlib; nothing here mentions `Gate`/`PureState`. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Util/Concentration.lean b/LeanPool/LeanQuantumAlg/Util/Concentration.lean index ef883a4767..87d865d867 100644 --- a/LeanPool/LeanQuantumAlg/Util/Concentration.lean +++ b/LeanPool/LeanQuantumAlg/Util/Concentration.lean @@ -16,7 +16,7 @@ small variance, and hence (by Chebyshev) concentrates exponentially around its m Quantum-free; built on Mathlib's `variance` and Chebyshev inequality. -/ -@[expose] public section +public section namespace QuantumAlg diff --git a/LeanPool/LeanQuantumAlg/Util/FinPow.lean b/LeanPool/LeanQuantumAlg/Util/FinPow.lean index 6e8d30ca08..15cbaa8cdb 100644 --- a/LeanPool/LeanQuantumAlg/Util/FinPow.lean +++ b/LeanPool/LeanQuantumAlg/Util/FinPow.lean @@ -25,7 +25,7 @@ on `Gate`/`PureState`. Pinned Mathlib API: `finProdFinEquiv` (`(x, y) ↦ y + n * x`), `finCongr`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -33,6 +33,7 @@ variable {m n : ℕ} /-- Big-endian pairing of basis labels: `(x, y) ↦ y + 2 ^ n * x`, so the first (lower-qubit-index) factor carries the most significant bits. -/ +@[expose] def prodEquiv : Fin (2 ^ m) × Fin (2 ^ n) ≃ Fin (2 ^ (m + n)) := finProdFinEquiv.trans (finCongr (pow_add (2 : ℕ) m n).symm) diff --git a/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean b/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean index b481b9602e..b85ddd2d8c 100644 --- a/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean +++ b/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean @@ -24,7 +24,7 @@ bases, is obtained separately by transport along the linear isometry to `EuclideanSpace ℂ (m × m)`.) -/ -@[expose] public section +public section namespace QuantumAlg @@ -35,7 +35,7 @@ variable {m : Type*} [Fintype m] /-- The Hilbert–Schmidt (Frobenius) inner product `⟪A, B⟫ = Tr[Aᴴ B]`. Conjugate-linear in the first argument, linear in the second. -/ -def hsInner (A B : Matrix m m ℂ) : ℂ := (Aᴴ * B).trace +@[expose] def hsInner (A B : Matrix m m ℂ) : ℂ := (Aᴴ * B).trace @[simp] theorem hsInner_def (A B : Matrix m m ℂ) : hsInner A B = (Aᴴ * B).trace := rfl diff --git a/LeanPool/LeanQuantumAlg/Util/Polynomial.lean b/LeanPool/LeanQuantumAlg/Util/Polynomial.lean index 11be5873de..7a99b8ad24 100644 --- a/LeanPool/LeanQuantumAlg/Util/Polynomial.lean +++ b/LeanPool/LeanQuantumAlg/Util/Polynomial.lean @@ -31,7 +31,7 @@ no dependency on the quantum framework: These are upstream candidates for Mathlib; nothing here mentions `Gate`/`PureState`. -/ -@[expose] public section +public section namespace QuantumAlg @@ -41,6 +41,7 @@ open Polynomial Complex /-- `conjP P` conjugates every coefficient of `P : ℂ[X]`; this is the `P*` of the QSP literature (for real `x`, `(conjP P).eval x = conj (P.eval x)`). -/ +@[expose] noncomputable def conjP (P : ℂ[X]) : ℂ[X] := P.map (starRingEnd ℂ) @[simp] diff --git a/LeanPool/LeanQuantumAlg/Util/TrigPolynomial.lean b/LeanPool/LeanQuantumAlg/Util/TrigPolynomial.lean index 22e530edbb..b5ae02dc72 100644 --- a/LeanPool/LeanQuantumAlg/Util/TrigPolynomial.lean +++ b/LeanPool/LeanQuantumAlg/Util/TrigPolynomial.lean @@ -24,7 +24,7 @@ This module is quantum-free: it only knows about `ℂ`, finite sums, the real pa `⟨ω, x⟩ = ∑ i, ω i * x i`, and real one-variable trigonometric identities. -/ -@[expose] public section +public section namespace QuantumAlg @@ -33,7 +33,7 @@ open Complex BigOperators variable {k : ℕ} /-- The real pairing `⟨ω, x⟩ = ∑ i, ω i * x i` of a frequency vector with a data point. -/ -def freqDot (ω x : Fin k → ℝ) : ℝ := ∑ i, ω i * x i +@[expose] def freqDot (ω x : Fin k → ℝ) : ℝ := ∑ i, ω i * x i /-- An **trigonometric polynomial** in `k` real variables: the function `x ↦ ∑_{ω ∈ freqs} coeff ω · exp(i⟨ω, x⟩)`. The data is a finite set of @@ -45,7 +45,7 @@ structure TrigPolynomial (k : ℕ) where coeff : (Fin k → ℝ) → ℂ /-- Evaluate an trigonometric polynomial at a data point `x`. -/ -noncomputable def TrigPolynomial.eval (f : TrigPolynomial k) (x : Fin k → ℝ) : ℂ := +@[expose] noncomputable def TrigPolynomial.eval (f : TrigPolynomial k) (x : Fin k → ℝ) : ℂ := ∑ ω ∈ f.freqs, f.coeff ω * Complex.exp (Complex.I * (freqDot ω x : ℂ)) /-- The pairing is additive in the frequency argument. -/ @@ -76,6 +76,7 @@ def TrigPolynomial.zero : TrigPolynomial k where simp [TrigPolynomial.eval, TrigPolynomial.zero] /-- Scale an trigonometric polynomial by a complex constant. -/ +@[expose] def TrigPolynomial.smul (c : ℂ) (f : TrigPolynomial k) : TrigPolynomial k where freqs := f.freqs coeff := fun ω => c * f.coeff ω @@ -99,6 +100,7 @@ theorem TrigPolynomial.eval_add (f g : TrigPolynomial k) (x : Fin k → ℝ) : /-- Multiply an trigonometric polynomial by the character `e^{i⟨a,x⟩}`: shifts every frequency by `a` and leaves the coefficients (re-indexed) unchanged. -/ +@[expose] noncomputable def TrigPolynomial.expMul (a : Fin k → ℝ) (f : TrigPolynomial k) : TrigPolynomial k where freqs := f.freqs.image (fun ω => ω + a) @@ -117,6 +119,7 @@ theorem TrigPolynomial.eval_expMul (a : Fin k → ℝ) (f : TrigPolynomial k) /-- A finite sum of trigonometric polynomials: frequencies union over the index, with coefficients added. -/ +@[expose] noncomputable def TrigPolynomial.sum {ι : Type*} (s : Finset ι) (F : ι → TrigPolynomial k) : TrigPolynomial k where freqs := s.biUnion (fun i => (F i).freqs) @@ -134,6 +137,7 @@ theorem TrigPolynomial.eval_sum {ι : Type*} (s : Finset ι) (F : ι → TrigPol /-- Product of two trigonometric polynomials: realised as the sum, over `f`'s frequencies, of `g` shifted by that frequency and scaled by `f`'s coefficient. -/ +@[expose] noncomputable def TrigPolynomial.mul (f g : TrigPolynomial k) : TrigPolynomial k := TrigPolynomial.sum f.freqs (fun ω => (g.expMul ω).smul (f.coeff ω)) @@ -148,6 +152,7 @@ theorem TrigPolynomial.eval_mul (f g : TrigPolynomial k) (x : Fin k → ℝ) : rfl /-- Complex conjugate of an trigonometric polynomial: negate frequencies, conjugate coefficients. -/ +@[expose] noncomputable def TrigPolynomial.conj (f : TrigPolynomial k) : TrigPolynomial k where freqs := f.freqs.image (fun ω => -ω) coeff := fun ω => (starRingEnd ℂ) (f.coeff (-ω)) @@ -200,6 +205,7 @@ theorem exp_I_real_inj {a b : ℝ} /-- The character `x ↦ exp(i⟨ω,x⟩)` as a monoid homomorphism from the additive group of data points (written multiplicatively) to `ℂ`. -/ +@[expose] noncomputable def chiHom (ω : Fin k → ℝ) : Multiplicative (Fin k → ℝ) →* ℂ where toFun := fun y => Complex.exp (Complex.I * (freqDot ω (Multiplicative.toAdd y) : ℂ)) map_one' := by @@ -321,11 +327,13 @@ theorem freqDot_append_right (ω : Fin n → ℝ) (x : Fin m → ℝ) (y : Fin n zero_mul, Finset.sum_const_zero, zero_add] /-- Embed an `m`-variable trigonometric polynomial into `m + n` variables on the first block. -/ +@[expose] noncomputable def TrigPolynomial.embedL (f : TrigPolynomial m) : TrigPolynomial (m + n) where freqs := f.freqs.image (fun ω => Fin.append ω (0 : Fin n → ℝ)) coeff := fun σ => f.coeff (fun i => σ (Fin.castAdd n i)) /-- Embed an `n`-variable trigonometric polynomial into `m + n` variables on the second block. -/ +@[expose] noncomputable def TrigPolynomial.embedR (f : TrigPolynomial n) : TrigPolynomial (m + n) where freqs := f.freqs.image (fun ω => Fin.append (0 : Fin m → ℝ) ω) coeff := fun σ => f.coeff (fun i => σ (Fin.natAdd m i)) diff --git a/LeanPool/LeanStationaryHarmonicMaps.lean b/LeanPool/LeanStationaryHarmonicMaps.lean index 9da9b3cc72..5b917ea35c 100644 --- a/LeanPool/LeanStationaryHarmonicMaps.lean +++ b/LeanPool/LeanStationaryHarmonicMaps.lean @@ -53,4 +53,4 @@ Tags: analysis, pde, harmonic-maps, monotonicity-formula, sobolev MSC: 58E20, 35J50 -/ -@[expose] public section +public section diff --git a/LeanPool/LeanStationaryHarmonicMaps/Examples/StationaryMonotonicity.lean b/LeanPool/LeanStationaryHarmonicMaps/Examples/StationaryMonotonicity.lean index 608d9884a7..3e8dbb272a 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/Examples/StationaryMonotonicity.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/Examples/StationaryMonotonicity.lean @@ -18,7 +18,7 @@ the public API and apply both the witness-style stationary Sobolev monotonicity formula/theorem and the older componentwise convenience wrappers. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/Examples/UseMainTheorem.lean b/LeanPool/LeanStationaryHarmonicMaps/Examples/UseMainTheorem.lean index 3abf92637c..f9727b3eb5 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/Examples/UseMainTheorem.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/Examples/UseMainTheorem.lean @@ -19,7 +19,7 @@ formula and the monotonicity inequality for the weak energy density associated with the package's displayed weak gradient. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/API.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/API.lean index 716e2c1a0f..bb85811f83 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/API.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/API.lean @@ -37,7 +37,7 @@ Implementation-route theorems in the radial/coarea files should normally be treated as internal scaffolding. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BallIntegralAC.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BallIntegralAC.lean index c7e137b3aa..7826f553a0 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BallIntegralAC.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BallIntegralAC.lean @@ -16,7 +16,7 @@ This module contains thin-shell estimates and the resulting absolute continuity of scalar ball-integral radius functions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Basic.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Basic.lean index 782f98e324..7822c540fc 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Basic.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Basic.lean @@ -18,7 +18,7 @@ computation behind the coarea/radial representation, together with the ambient Sobolev setup on which the later files build. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryBasics.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryBasics.lean index 6e364ce960..451d2fd110 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryBasics.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryBasics.lean @@ -21,7 +21,7 @@ boundary and radius statements so the proof can be checked modularly, but they are not intended as the public API of the project. -/ -@[expose] public section +public section noncomputable section @@ -42,7 +42,7 @@ def BoundaryIdentity {n m : ℕ} (u : Domain n → Target m) (a : Domain n) (R0 /-- Weak a.e. boundary identity, stated directly in terms of the weak gradient energy and weak radial energy. -/ -def WeakBoundaryIdentity {n m : ℕ} +@[expose] def WeakBoundaryIdentity {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (R0 : ℝ) : Prop := ∀ᵐ rho ∂(volume.restrict (Ioo (0 : ℝ) R0)), rho * deriv (weakBallEnergy Du a) rho - ((n : ℝ) - 2) * weakBallEnergy Du a rho @@ -66,7 +66,7 @@ def WeakSharpCutoffRadiusIdentityAt {n m : ℕ} -(2 * rho * deriv (weakBallRadialEnergy Du a) rho) /-- The scalar defect whose vanishing is the sharp-cutoff radius identity. -/ -def weakSharpCutoffDefect {n m : ℕ} +@[expose] def weakSharpCutoffDefect {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (rho : ℝ) : ℝ := ((n : ℝ) - 2) * weakBallEnergy Du a rho - rho * deriv (weakBallEnergy Du a) rho @@ -101,7 +101,7 @@ def WeakSharpCutoffLimitIdentity {n m : ℕ} /-- Distributional form of the sharp-cutoff limit: the sharp-cutoff defect pairs to zero against every compactly supported smooth test function in `(0, R0)`. -/ -def WeakSharpCutoffDistributionIdentity {n m : ℕ} +@[expose] def WeakSharpCutoffDistributionIdentity {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (R0 : ℝ) : Prop := ∀ g : ℝ → ℝ, ContDiff ℝ (⊤ : ℕ∞) g → @@ -177,19 +177,19 @@ theorem weakSharpCutoffLimitIdentity_iff_boundaryIdentity {n m : ℕ} /-- The analytic cutoff-limit step still to be supplied: approximate the sharp radial cutoff in the weak radial stationarity identity and pass to a.e. radii. -/ -def WeakRadialCutoffLimitStep {n m : ℕ} +@[expose] def WeakRadialCutoffLimitStep {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakRadialStationarityIdentity Du R0 → WeakSharpCutoffLimitIdentity Du (0 : Domain n) R0 /-- Main one-dimensional radial integrand after applying coarea. -/ -def weakRadialOneDimensionalMainIntegrand {n m : ℕ} +@[expose] def weakRadialOneDimensionalMainIntegrand {n m : ℕ} (Du : Domain n → Gradient n m) (phi : ℝ → ℝ) (rho : ℝ) : ℝ := (((n : ℝ) - 2) * phi rho + rho * deriv phi rho) * deriv (weakBallEnergy Du (0 : Domain n)) rho /-- Radial-energy one-dimensional integrand after applying coarea. -/ -def weakRadialOneDimensionalRhsIntegrand {n m : ℕ} +@[expose] def weakRadialOneDimensionalRhsIntegrand {n m : ℕ} (Du : Domain n → Gradient n m) (phi : ℝ → ℝ) (rho : ℝ) : ℝ := (rho * deriv phi rho) * deriv (weakBallRadialEnergy Du (0 : Domain n)) rho @@ -197,7 +197,7 @@ def weakRadialOneDimensionalRhsIntegrand {n m : ℕ} /-- One-dimensional radius form of the weak radial identity. This is the coarea/absolute-continuity form of `WeakRadialStationarityIdentity`: the ball integrals have been converted into derivatives of the ball energy functions. -/ -def WeakRadialOneDimensionalIdentity {n m : ℕ} +@[expose] def WeakRadialOneDimensionalIdentity {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → @@ -332,7 +332,7 @@ theorem weak_radial_scalar_cutoff_identity_from_stationarity_of_W12Loc_vectorFie /-- The true coarea/radius-integral content, separated from vector-field regularity and support bookkeeping. -/ -def WeakRadialCoareaIntegralFormula {n m : ℕ} +@[expose] def WeakRadialCoareaIntegralFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → @@ -387,7 +387,7 @@ theorem radiusWeightOn_indicator_thetaFactor {n : ℕ} {R0 s r : ℝ} /-- Radius-integration formula for weak energy density. This is the exact coarea/ball-derivative statement needed for the energy part. -/ -def WeakEnergyRadiusIntegralFormula {n m : ℕ} +@[expose] def WeakEnergyRadiusIntegralFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ c : ℝ → ℝ, (∫ x in Metric.ball (0 : Domain n) R0, c ‖x‖ * weakEnergyDensity Du x) @@ -397,7 +397,7 @@ def WeakEnergyRadiusIntegralFormula {n m : ℕ} /-- Radius-integration formula for weak energy density, restricted to measurable essentially bounded radius weights. -/ -def WeakEnergyRadiusIntegralFormulaForWeights {n m : ℕ} +@[expose] def WeakEnergyRadiusIntegralFormulaForWeights {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ c : ℝ → ℝ, RadiusWeightOn R0 c → @@ -407,7 +407,7 @@ def WeakEnergyRadiusIntegralFormulaForWeights {n m : ℕ} c rho * deriv (weakBallEnergy Du (0 : Domain n)) rho) /-- Radius-integration formula for weak radial-energy density. -/ -def WeakRadialEnergyRadiusIntegralFormula {n m : ℕ} +@[expose] def WeakRadialEnergyRadiusIntegralFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ c : ℝ → ℝ, (∫ x in Metric.ball (0 : Domain n) R0, @@ -418,7 +418,7 @@ def WeakRadialEnergyRadiusIntegralFormula {n m : ℕ} /-- Radius-integration formula for weak radial-energy density, restricted to measurable essentially bounded radius weights. -/ -def WeakRadialEnergyRadiusIntegralFormulaForWeights {n m : ℕ} +@[expose] def WeakRadialEnergyRadiusIntegralFormulaForWeights {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ c : ℝ → ℝ, RadiusWeightOn R0 c → @@ -430,13 +430,13 @@ def WeakRadialEnergyRadiusIntegralFormulaForWeights {n m : ℕ} /-- The two radius-derivative/coarea formulas needed for the weak monotonicity argument, bundled as a single reusable analytic input. -/ -def WeakRadiusIntegralFormulas {n m : ℕ} +@[expose] def WeakRadiusIntegralFormulas {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakEnergyRadiusIntegralFormula Du R0 ∧ WeakRadialEnergyRadiusIntegralFormula Du R0 /-- The restricted-weight version of the bundled radius formulas. -/ -def WeakRadiusIntegralFormulasForWeights {n m : ℕ} +@[expose] def WeakRadiusIntegralFormulasForWeights {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakEnergyRadiusIntegralFormulaForWeights Du R0 ∧ WeakRadialEnergyRadiusIntegralFormulaForWeights Du R0 @@ -566,7 +566,7 @@ theorem weakRadialCoareaDerivativeFormula_of_contDiff_and_integral {n m : ℕ} /-- The coarea and radius-derivative step translating the spatial radial identity into its one-dimensional radius form. -/ -def WeakRadialCoareaDerivativeStep {n m : ℕ} +@[expose] def WeakRadialCoareaDerivativeStep {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakRadialStationarityIdentity Du R0 → WeakRadialOneDimensionalIdentity Du R0 diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryFromRadial.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryFromRadial.lean index 45cd873451..fbcafe6834 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryFromRadial.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/BoundaryFromRadial.lean @@ -20,7 +20,7 @@ stationarity to the boundary identity. The recommended public entry point is the final theorem in `MainTheorem.lean`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/CenterTranslation.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/CenterTranslation.lean index e7196db34e..ff266db9cc 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/CenterTranslation.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/CenterTranslation.lean @@ -17,7 +17,7 @@ This module starts the passage from the origin-centered theorem to arbitrary centers by isolating the translation identities needed for `weakTheta`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/EnergyQuantities.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/EnergyQuantities.lean index 6e45022f5a..34575e9f75 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/EnergyQuantities.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/EnergyQuantities.lean @@ -13,7 +13,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial # Energy Quantities -/ -@[expose] public section +public section noncomputable section @@ -32,12 +32,12 @@ def ballRadialEnergy {n m : ℕ} (u : Domain n → Target m) (a : Domain n) (r : ∫ x in Metric.ball a r, radialEnergyDensity u a x /-- Weak energy on a ball, written in terms of the chosen weak gradient. -/ -def weakBallEnergy {n m : ℕ} +@[expose] def weakBallEnergy {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (r : ℝ) : ℝ := ∫ x in Metric.ball a r, weakEnergyDensity Du x /-- Weak radial energy on a ball, written in terms of the chosen weak gradient. -/ -def weakBallRadialEnergy {n m : ℕ} +@[expose] def weakBallRadialEnergy {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (r : ℝ) : ℝ := ∫ x in Metric.ball a r, weakRadialEnergyDensity Du a x @@ -54,7 +54,7 @@ theorem weakBallRadialEnergy_zero_radius {n m : ℕ} simp [weakBallRadialEnergy, Metric.ball_eq_empty.mpr le_rfl] /-- The factor `r^(2-n)` as an integer power. -/ -def thetaFactor (n : ℕ) (r : ℝ) : ℝ := +@[expose] def thetaFactor (n : ℕ) (r : ℝ) : ℝ := r ^ (2 - (n : ℤ)) /-- The monotonicity factor is continuous on any closed interval bounded away @@ -73,7 +73,7 @@ def theta {n m : ℕ} (u : Domain n → Target m) (a : Domain n) (r : ℝ) : ℝ thetaFactor n r * ballEnergy u a r /-- Weak monotonicity quantity, using the weak gradient energy. -/ -def weakTheta {n m : ℕ} +@[expose] def weakTheta {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (r : ℝ) : ℝ := thetaFactor n r * weakBallEnergy Du a r @@ -145,7 +145,7 @@ def monotonicityRhs {n m : ℕ} (u : Domain n → Target m) (a : Domain n) (s r annulusWeight n a x * radialEnergyDensity u a x /-- Right-hand side of the weak monotonicity formula on `B_r(a) \ B_s(a)`. -/ -def weakMonotonicityRhs {n m : ℕ} +@[expose] def weakMonotonicityRhs {n m : ℕ} (Du : Domain n → Gradient n m) (a : Domain n) (s r : ℝ) : ℝ := 2 * ∫ x in Metric.ball a r \ Metric.ball a s, ‖x - a‖ ^ (2 - (n : ℤ)) * weakRadialEnergyDensity Du a x @@ -164,11 +164,11 @@ theorem weakMonotonicityRhs_nonneg {n m : ℕ} (sq_nonneg ‖weakRadialDerivative Du a x‖))) /-- Coefficient multiplying the weak energy density in the radial identity. -/ -def weakRadialMainCoeff (n : ℕ) (phi : ℝ → ℝ) (x : Domain n) : ℝ := +@[expose] def weakRadialMainCoeff (n : ℕ) (phi : ℝ → ℝ) (x : Domain n) : ℝ := ((n : ℝ) - 2) * phi ‖x‖ + ‖x‖ * deriv phi ‖x‖ /-- Coefficient multiplying the weak radial-energy density in the radial identity. -/ -def weakRadialRhsCoeff {n : ℕ} (phi : ℝ → ℝ) (x : Domain n) : ℝ := +@[expose] def weakRadialRhsCoeff {n : ℕ} (phi : ℝ → ℝ) (x : Domain n) : ℝ := ‖x‖ * deriv phi ‖x‖ /-- Continuity of the main radial cutoff coefficient, assuming `phi` and `phi'` diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Euclidean.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Euclidean.lean index fc30b298d0..889de6fe54 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Euclidean.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Euclidean.lean @@ -18,7 +18,7 @@ This file is the local boundary between the project and mathlib's concrete calls to `EuclideanSpace.*`. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ namespace LeanStationaryHarmonicMaps namespace StationaryHarmonicMap /-- The `i`-th coordinate vector in the project domain `ℝⁿ`. -/ -def domainCoordUnit {n : ℕ} (i : Fin n) : Domain n := +@[expose] def domainCoordUnit {n : ℕ} (i : Fin n) : Domain n := EuclideanSpace.single i (1 : ℝ) /-- Coordinate extraction via the Euclidean inner product. -/ diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/FirstVariationBridge.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/FirstVariationBridge.lean index 1acf75c99f..e31016e3e9 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/FirstVariationBridge.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/FirstVariationBridge.lean @@ -19,7 +19,7 @@ stationary Sobolev map hypothesis, even though the formula only depends on test-function interface as the distributional weak-gradient bridge. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/L2LocBridge.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/L2LocBridge.lean index b4a0b31aca..4e4f14bc7f 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/L2LocBridge.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/L2LocBridge.lean @@ -19,7 +19,7 @@ energy integrability part, while global a.e. measurability on an arbitrary domain is a separate measurable-cover problem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MainTheorem.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MainTheorem.lean index cca230ea53..7175e81f2b 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MainTheorem.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MainTheorem.lean @@ -16,7 +16,7 @@ cutoff, and boundary routes are internal scaffolding hidden behind the stationary Sobolev map package. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Monotonicity.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Monotonicity.lean index fc005ae33e..fb3afae129 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Monotonicity.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/Monotonicity.lean @@ -22,7 +22,7 @@ modules should discharge its `WeakStationaryMapIn` hypothesis and then call this theorem, rather than reopening the radial monotonicity proof chain. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityEuclidean.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityEuclidean.lean index 44917aa075..ce14600ae5 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityEuclidean.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityEuclidean.lean @@ -26,7 +26,7 @@ coarea and thin-shell ingredients before `MainTheorem.lean` packages the final user-facing statement. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityFinal.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityFinal.lean index d2bf1b50f0..8327e86bb3 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityFinal.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityFinal.lean @@ -17,7 +17,7 @@ This module contains the final radius integration step and converts the boundary identity into monotonicity of the weak theta quantity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityRoutes.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityRoutes.lean index a1e57746a1..e47900ae04 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityRoutes.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/MonotonicityRoutes.lean @@ -23,7 +23,7 @@ code should normally import `MainTheorem.lean` or `API.lean` instead of relying on a particular route theorem in this file. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/PrimitiveCutoffs.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/PrimitiveCutoffs.lean index a5d008c313..d6f45b4604 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/PrimitiveCutoffs.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/PrimitiveCutoffs.lean @@ -16,7 +16,7 @@ This module contains the primitive cutoff realization and the abstract one-dimensional sharp-cutoff inputs. -/ -@[expose] public section +public section noncomputable section @@ -27,21 +27,21 @@ namespace LeanStationaryHarmonicMaps namespace StationaryHarmonicMap /-- The purely one-dimensional sharp-cutoff approximation step. -/ -def WeakOneDimensionalSharpCutoffStep {n m : ℕ} +@[expose] def WeakOneDimensionalSharpCutoffStep {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakRadialOneDimensionalIdentity Du R0 → WeakSharpCutoffLimitIdentity Du (0 : Domain n) R0 /-- Intermediate distributional form of the one-dimensional sharp-cutoff argument. -/ -def WeakOneDimensionalToDistributionStep {n m : ℕ} +@[expose] def WeakOneDimensionalToDistributionStep {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakRadialOneDimensionalIdentity Du R0 → WeakSharpCutoffDistributionIdentity Du (0 : Domain n) R0 /-- After the one-dimensional radial identity is integrated by parts, the defect pairs to zero against derivatives of compactly supported radial cutoffs. -/ -def WeakOneDimensionalDefectDerivativeIdentity {n m : ℕ} +@[expose] def WeakOneDimensionalDefectDerivativeIdentity {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → @@ -55,7 +55,7 @@ def WeakOneDimensionalDefectDerivativeIdentity {n m : ℕ} argument. It says every smooth compactly supported test function in `(0, R0)` can be represented, for pairing with the defect, as `-phi'` for an admissible radial cutoff primitive. -/ -def WeakOneDimensionalPrimitiveTestFamily {n m : ℕ} +@[expose] def WeakOneDimensionalPrimitiveTestFamily {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ g : ℝ → ℝ, ContDiff ℝ (⊤ : ℕ∞) g → @@ -77,7 +77,7 @@ def WeakOneDimensionalPrimitiveTestFamily {n m : ℕ} test function in `(0, R0)` is the negative derivative, on `(0, R0)`, of a compactly supported radial cutoff. This predicate contains only the one-dimensional construction, independent of the map `Du`. -/ -def WeakPrimitiveCutoffRealization (R0 : ℝ) : Prop := +@[expose] def WeakPrimitiveCutoffRealization (R0 : ℝ) : Prop := ∀ g : ℝ → ℝ, ContDiff ℝ (⊤ : ℕ∞) g → HasCompactSupport g → diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialCutoffs.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialCutoffs.lean index 31d002727f..e505c29bc3 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialCutoffs.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialCutoffs.lean @@ -16,7 +16,7 @@ This module packages the scalar radial cutoffs used to test weak stationarity. It is deliberately independent of the later radial integral identities. -/ -@[expose] public section +public section noncomputable section @@ -211,7 +211,7 @@ theorem exists_deriv_bound_on_Icc_of_contDiff {phi : ℝ → ℝ} /-- A scalar cutoff is constant in a symmetric neighborhood of the origin. This is the exact local regularity needed to make `x ↦ phi ‖x‖ • x` differentiable at the origin without proving the full general radial-extension theorem. -/ -def ConstNearOrigin (phi : ℝ → ℝ) : Prop := +@[expose] def ConstNearOrigin (phi : ℝ → ℝ) : Prop := ∃ ε : ℝ, 0 < ε ∧ ∀ t : ℝ, |t| < ε → phi t = phi 0 /-- A scalar `C¹` cutoff supported before `R0` and flat near the origin gives diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialGeometry.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialGeometry.lean index b089dff688..3a382f5905 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialGeometry.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialGeometry.lean @@ -13,7 +13,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial # Radial Geometry -/ -@[expose] public section +public section noncomputable section @@ -28,17 +28,17 @@ def coordUnit {n : ℕ} (i : Fin n) : Domain n := domainCoordUnit i /-- The classical coordinate derivative `∂ᵢ u`, in the smooth model. -/ -def partialDerivative {n m : ℕ} (u : Domain n → Target m) (i : Fin n) +@[expose] def partialDerivative {n m : ℕ} (u : Domain n → Target m) (i : Fin n) (x : Domain n) : Target m := fderiv ℝ u x (coordUnit i) /-- Coordinate derivative of a vector field component: `∂ᵢ Xⱼ`. -/ -def vectorFieldPartial {n : ℕ} (X : Domain n → Domain n) (i j : Fin n) +@[expose] def vectorFieldPartial {n : ℕ} (X : Domain n → Domain n) (i j : Fin n) (x : Domain n) : ℝ := partialDerivative X i x j /-- Divergence of a smooth vector field in coordinates: `div X = ∑ᵢ ∂ᵢ Xᵢ`. -/ -def divergence {n : ℕ} (X : Domain n → Domain n) (x : Domain n) : ℝ := +@[expose] def divergence {n : ℕ} (X : Domain n → Domain n) (x : Domain n) : ℝ := ∑ i : Fin n, vectorFieldPartial X i i x /-- The radial unit vector based at `a`. At `x = a` this definition gives `0`, @@ -47,12 +47,12 @@ def radialUnit {n : ℕ} (a x : Domain n) : Domain n := (‖x - a‖)⁻¹ • (x - a) /-- Pointwise Hilbert-Schmidt energy of a gradient matrix. -/ -def gradientEnergy {n m : ℕ} (A : Gradient n m) : ℝ := +@[expose] def gradientEnergy {n m : ℕ} (A : Gradient n m) : ℝ := ∑ i : Fin n, ‖A i‖ ^ 2 /-- Radial derivative associated to a pointwise gradient matrix, evaluated in the radial direction from the origin to `x`. -/ -def gradientRadialDerivative {n m : ℕ} (A : Gradient n m) (x : Domain n) : Target m := +@[expose] def gradientRadialDerivative {n m : ℕ} (A : Gradient n m) (x : Domain n) : Target m := SMul.smul (‖x‖⁻¹) (∑ i : Fin n, SMul.smul (x i) (A i)) /-- Radial energy associated to a pointwise gradient matrix. -/ @@ -64,16 +64,16 @@ def smoothGradient {n m : ℕ} (u : Domain n → Target m) (x : Domain n) : Grad fun i => partialDerivative u i x /-- Energy density built from an arbitrary gradient field. -/ -def weakEnergyDensity {n m : ℕ} (Du : Domain n → Gradient n m) (x : Domain n) : ℝ := +@[expose] def weakEnergyDensity {n m : ℕ} (Du : Domain n → Gradient n m) (x : Domain n) : ℝ := gradientEnergy (Du x) /-- Radial derivative built from an arbitrary gradient field. -/ -def weakRadialDerivative {n m : ℕ} +@[expose] def weakRadialDerivative {n m : ℕ} (Du : Domain n → Gradient n m) (a x : Domain n) : Target m := gradientRadialDerivative (Du x) (x - a) /-- Radial energy density built from an arbitrary gradient field. -/ -def weakRadialEnergyDensity {n m : ℕ} +@[expose] def weakRadialEnergyDensity {n m : ℕ} (Du : Domain n → Gradient n m) (a x : Domain n) : ℝ := ‖weakRadialDerivative Du a x‖ ^ 2 @@ -93,7 +93,7 @@ def radialEnergyDensity {n m : ℕ} (u : Domain n → Target m) (a x : Domain n) ‖radialDerivative u a x‖ ^ 2 /-- The radial test vector field `X(x) = φ(|x|) x`, centered at the origin. -/ -def radialVectorField {n : ℕ} (phi : ℝ → ℝ) (x : Domain n) : Domain n := +@[expose] def radialVectorField {n : ℕ} (phi : ℝ → ℝ) (x : Domain n) : Domain n := phi ‖x‖ • x /-- The differential of the Euclidean norm away from the origin: @@ -184,7 +184,7 @@ theorem radialVectorFieldDerivativeFormula {n : ℕ} {phi : ℝ → ℝ} /-- Divergence formula for the radial vector field: `div X = n φ(r) + r φ'(r)`. -/ -def RadialVectorFieldDivergenceFormula {n : ℕ} (phi : ℝ → ℝ) : Prop := +@[expose] def RadialVectorFieldDivergenceFormula {n : ℕ} (phi : ℝ → ℝ) : Prop := ∀ x : Domain n, x ≠ 0 → divergence (radialVectorField phi) x = (n : ℝ) * phi ‖x‖ + ‖x‖ * deriv phi ‖x‖ @@ -564,7 +564,7 @@ theorem radialDerivative_zero_eq_sum {n m : ℕ} @[simp] theorem gradientEnergy_smoothGradient {n m : ℕ} (u : Domain n → Target m) (x : Domain n) : - gradientEnergy (smoothGradient u x) = energyDensity u x := rfl + gradientEnergy (smoothGradient u x) = energyDensity u x := by rfl theorem gradientRadialDerivative_smoothGradient_zero {n m : ℕ} (u : Domain n → Target m) (x : Domain n) : diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIdentity.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIdentity.lean index b5f3063ee2..a7865c0eb1 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIdentity.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIdentity.lean @@ -16,7 +16,7 @@ the weak radial integral identity, with integrability side conditions supplied by `RadialIntegrability`. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ def RadialStationarityIdentity {n m : ℕ} (u : Domain n → Target m) (R0 : ℝ /-- Weak radial identity obtained by testing stationarity with `X(x)=phi(|x|)x`, stated at center `0`. -/ -def WeakRadialStationarityIdentity {n m : ℕ} +@[expose] def WeakRadialStationarityIdentity {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIntegrability.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIntegrability.lean index 6e193dfe36..a3e8b84cdf 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIntegrability.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialIntegrability.lean @@ -17,7 +17,7 @@ This module contains the weak radial integrands and the integrability lemmas that discharge the side conditions in the radial stationarity identity. -/ -@[expose] public section +public section noncomputable section @@ -28,12 +28,12 @@ namespace LeanStationaryHarmonicMaps namespace StationaryHarmonicMap /-- The main energy integrand in the weak radial identity at center `0`. -/ -def weakRadialMainIntegrand {n m : ℕ} +@[expose] def weakRadialMainIntegrand {n m : ℕ} (Du : Domain n → Gradient n m) (phi : ℝ → ℝ) (x : Domain n) : ℝ := weakRadialMainCoeff n phi x * weakEnergyDensity Du x /-- The radial-energy integrand in the weak radial identity at center `0`. -/ -def weakRadialRhsIntegrand {n m : ℕ} +@[expose] def weakRadialRhsIntegrand {n m : ℕ} (Du : Domain n → Gradient n m) (phi : ℝ → ℝ) (x : Domain n) : ℝ := weakRadialRhsCoeff phi x * weakRadialEnergyDensity Du 0 x diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialMeasure.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialMeasure.lean index 043aebc3c6..56a74c2dff 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialMeasure.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadialMeasure.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.VectorMeasure.Decomposition.RadonNikodym # Radial Measure -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ namespace LeanStationaryHarmonicMaps namespace StationaryHarmonicMap /-- The one-dimensional measure on the radius interval `(0, R0)`. -/ -def radiusIntervalMeasure (R0 : ℝ) : Measure ℝ := +@[expose] def radiusIntervalMeasure (R0 : ℝ) : Measure ℝ := volume.restrict (Ioo (0 : ℝ) R0) instance sigmaFinite_radiusIntervalMeasure (R0 : ℝ) : @@ -195,7 +195,7 @@ theorem radialVectorMeasure_absolutelyContinuous_euclidean {n : ℕ} [NeZero n] /-- The Radon-Nikodym density of the radial signed pushforward of `f dx` on `B_R0`, with respect to the radius interval measure. -/ -noncomputable def radialRNDensity {n : ℕ} (f : Domain n → ℝ) (R0 : ℝ) : ℝ → ℝ := +@[expose] noncomputable def radialRNDensity {n : ℕ} (f : Domain n → ℝ) (R0 : ℝ) : ℝ → ℝ := SignedMeasure.rnDeriv (((volume.restrict (Metric.ball (0 : Domain n) R0)).withDensityᵥ f).map (fun x : Domain n => norm x)) diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusAnalysis.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusAnalysis.lean index 660450ff9e..8397f2a94a 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusAnalysis.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusAnalysis.lean @@ -20,7 +20,7 @@ coarea and one-dimensional calculus steps can be audited independently, while public users should rely on `MainTheorem.lean`. -/ -@[expose] public section +public section noncomputable section @@ -32,14 +32,14 @@ namespace StationaryHarmonicMap /-- The one-dimensional integration-by-parts step to be proved from `WeakRadialOneDimensionalIdentity`. -/ -def WeakOneDimensionalIBPStep {n m : ℕ} +@[expose] def WeakOneDimensionalIBPStep {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakRadialOneDimensionalIdentity Du R0 → WeakOneDimensionalDefectDerivativeIdentity Du R0 /-- The concrete integration-by-parts identity needed to turn the one-dimensional radial identity into a defect-derivative identity. -/ -def WeakOneDimensionalIBPFormula {n m : ℕ} +@[expose] def WeakOneDimensionalIBPFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → @@ -58,7 +58,7 @@ def WeakOneDimensionalIBPFormula {n m : ℕ} /-- The genuine one-dimensional energy integration-by-parts input: `∫ -phi' ((n-2)E) = ∫ ((n-2)phi) E'`. This is the part that ultimately comes from absolute continuity of the ball energy function. -/ -def WeakBallEnergyIntegrationByPartsFormula {n m : ℕ} +@[expose] def WeakBallEnergyIntegrationByPartsFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → @@ -75,7 +75,7 @@ def WeakBallEnergyIntegrationByPartsFormula {n m : ℕ} /-- Integrability side conditions needed only to justify splitting the Bochner integrals in the one-dimensional IBP algebra. -/ -def WeakOneDimensionalIBPIntegrability {n m : ℕ} +@[expose] def WeakOneDimensionalIBPIntegrability {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := ∀ phi : ℝ → ℝ, Differentiable ℝ phi → @@ -106,7 +106,7 @@ def WeakOneDimensionalIBPIntegrability {n m : ℕ} /-- The absolute-continuity target for the radius functions used in the weak monotonicity proof. This is the analytic statement one ultimately gets from coarea/radius differentiation in the `W^{1,2}_{loc}` setting. -/ -def WeakEnergyAbsolutelyContinuousOnRadii {n m : ℕ} +@[expose] def WeakEnergyAbsolutelyContinuousOnRadii {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := (∀ {a b : ℝ}, 0 ≤ a → a ≤ b → b ≤ R0 → AbsolutelyContinuousOnInterval (weakBallEnergy Du (0 : Domain n)) a b) ∧ @@ -116,7 +116,7 @@ def WeakEnergyAbsolutelyContinuousOnRadii {n m : ℕ} /-- Absolute continuity, in the radius variable, of the ball integral generated by a scalar integrand. This is the generic analytic statement supplied by the coarea/radius theorem for `L¹` functions. -/ -def BallIntegralRadiusAbsolutelyContinuous {n : ℕ} +@[expose] def BallIntegralRadiusAbsolutelyContinuous {n : ℕ} (f : Domain n → ℝ) (R0 : ℝ) : Prop := ∀ {a b : ℝ}, 0 ≤ a → a ≤ b → b ≤ R0 → AbsolutelyContinuousOnInterval @@ -127,7 +127,7 @@ estimates: in positive dimension, every `L¹` scalar integrand on `B_R0` has an absolutely continuous ball-integral radius function on `[0, R0]`. The positive dimension assumption is essential: in dimension zero the open ball jumps at radius `0`. -/ -def BallIntegralRadiusACOfIntegrableOnBall (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusACOfIntegrableOnBall (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -169,7 +169,7 @@ geometrically: every `L¹` scalar density on a ball has the radius integration formula against arbitrary scalar radius weights. The specialized weak energy and radial-energy formulas below are just applications of this statement to the two relevant densities. -/ -def BallIntegralRadiusDerivativeFormula (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusDerivativeFormula (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -183,7 +183,7 @@ def BallIntegralRadiusDerivativeFormula (n : ℕ) : Prop := /-- Restricted-weight version of `BallIntegralRadiusDerivativeFormula`, using the measurable essentially bounded radius weights that occur in the weak monotonicity proof. -/ -def BallIntegralRadiusDerivativeFormulaForWeights (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusDerivativeFormulaForWeights (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -198,7 +198,7 @@ def BallIntegralRadiusDerivativeFormulaForWeights (n : ℕ) : Prop := /-- Pure radial pushforward/coarea input: a scalar density on a Euclidean ball has some one-dimensional radial density `D` representing all integrals against radius weights. No derivative of the ball integral is mentioned here. -/ -def BallIntegralRadiusWeightedRepresentation (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusWeightedRepresentation (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -210,7 +210,7 @@ def BallIntegralRadiusWeightedRepresentation (n : ℕ) : Prop := (∫ rho in Ioo (0 : ℝ) R0, c rho * D rho) /-- Restricted-weight version of the pure radial pushforward/coarea input. -/ -def BallIntegralRadiusWeightedRepresentationForWeights (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusWeightedRepresentationForWeights (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -225,7 +225,7 @@ def BallIntegralRadiusWeightedRepresentationForWeights (n : ℕ) : Prop := /-- One-dimensional identification input: whenever a radial density represents all radius-weighted integrals of `f`, it agrees a.e. with the derivative of the ball integral radius function. -/ -def BallIntegralRadiusDerivativeIdentification (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusDerivativeIdentification (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ} {D : ℝ → ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -241,7 +241,7 @@ def BallIntegralRadiusDerivativeIdentification (n : ℕ) : Prop := /-- Restricted-weight version of the one-dimensional derivative identification input. This is the realistic version of the uniqueness step: bounded measurable test weights determine equality a.e. on the radius interval. -/ -def BallIntegralRadiusDerivativeIdentificationForWeights (n : ℕ) : Prop := +@[expose] def BallIntegralRadiusDerivativeIdentificationForWeights (n : ℕ) : Prop := [NeZero n] → ∀ {f : Domain n → ℝ} {R0 : ℝ} {D : ℝ → ℝ}, IntegrableOn f (Metric.ball (0 : Domain n) R0) volume → @@ -386,18 +386,18 @@ def EuclideanBallVolumeAbsolutelyContinuous (n : ℕ) : Prop := /-- The radial open shell between two radii. We use the unordered endpoints so that the shell attached to an interval in the absolute-continuity definition is independent of its orientation. -/ -def RadialOpenShell {n : ℕ} (r s : ℝ) : Set (Domain n) := +@[expose] def RadialOpenShell {n : ℕ} (r s : ℝ) : Set (Domain n) := {x | ‖x‖ ∈ Ioo (min r s) (max r s)} /-- The union of the radial open shells associated to a finite interval family from the absolute-continuity filter. -/ -def RadialOpenShells {n : ℕ} (E : ℕ × (ℕ → ℝ × ℝ)) : Set (Domain n) := +@[expose] def RadialOpenShells {n : ℕ} (E : ℕ × (ℕ → ℝ × ℝ)) : Set (Domain n) := ⋃ i ∈ Finset.range E.1, RadialOpenShell (n := n) (E.2 i).1 (E.2 i).2 /-- The geometric thin-annulus estimate needed for the `L¹` radius theorem: finite unions of radial shells have volume tending to zero when the total one-dimensional length of the generating intervals tends to zero. -/ -def RadialOpenShellsVolumeTendstoZero (n : ℕ) : Prop := +@[expose] def RadialOpenShellsVolumeTendstoZero (n : ℕ) : Prop := [NeZero n] → ∀ {a b : ℝ}, 0 ≤ a → a ≤ b → Filter.Tendsto @@ -739,7 +739,7 @@ theorem weakEnergyAbsolutelyContinuousOnRadii_of_W12LocIn_ballIntegralAC radial stationarity has been reduced to scalar cutoffs. The first field records the intended absolute-continuity theorem; the last two fields are the concrete IBP and integrability consequences consumed by the existing algebra. -/ -def WeakBallEnergyOneDimensionalCalculus {n m : ℕ} +@[expose] def WeakBallEnergyOneDimensionalCalculus {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := WeakEnergyAbsolutelyContinuousOnRadii Du R0 ∧ WeakBallEnergyIntegrationByPartsFormula Du R0 ∧ diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusFormulas.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusFormulas.lean index 0af144e82d..def4647877 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusFormulas.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusFormulas.lean @@ -18,7 +18,7 @@ This module constructs the weak radius integration and one-dimensional calculus packages from local L2, coarea, and annulus inputs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusPrimitive.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusPrimitive.lean index fdf08c558d..5099c57944 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusPrimitive.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusPrimitive.lean @@ -17,7 +17,7 @@ This module contains primitive, increment, annulus, and interval-indicator forms of the radius derivative calculus. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ namespace StationaryHarmonicMap both ball-energy functions are equal to their interval primitive of the stated derivative. This is the exact one-dimensional FTC statement extracted from coarea/radius differentiation. -/ -def WeakEnergyRadiusPrimitiveFormula {n m : ℕ} +@[expose] def WeakEnergyRadiusPrimitiveFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := (∀ {a b : ℝ}, 0 ≤ a → a ≤ b → b ≤ R0 → IntervalIntegrable (deriv (weakBallEnergy Du (0 : Domain n))) volume a b ∧ @@ -52,7 +52,7 @@ def WeakEnergyRadiusPrimitiveFormula {n m : ℕ} /-- Increment form of the radius calculus: the two ball-energy functions satisfy the fundamental theorem of calculus on every subinterval of `[0, R0]`. -/ -def WeakEnergyRadiusIncrementFormula {n m : ℕ} +@[expose] def WeakEnergyRadiusIncrementFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := (∀ {a b : ℝ}, 0 ≤ a → a ≤ b → b ≤ R0 → IntervalIntegrable (deriv (weakBallEnergy Du (0 : Domain n))) volume a b ∧ @@ -69,7 +69,7 @@ def WeakEnergyRadiusIncrementFormula {n m : ℕ} /-- Interval integrability of the two radius derivatives on every subinterval of `[0, R0]`. -/ -def WeakEnergyRadiusDerivativeIntegrability {n m : ℕ} +@[expose] def WeakEnergyRadiusDerivativeIntegrability {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := (∀ {a b : ℝ}, 0 ≤ a → a ≤ b → b ≤ R0 → IntervalIntegrable (deriv (weakBallEnergy Du (0 : Domain n))) volume a b) ∧ @@ -270,7 +270,7 @@ theorem weakEnergyRadiusDerivativeIntegrability_of_radiusIncrement {n m : ℕ} /-- Annulus form of the ball-energy increments. The open annulus is enough: the missing boundary spheres are null in the eventual geometric proof. -/ -def WeakEnergyAnnulusFormula {n m : ℕ} +@[expose] def WeakEnergyAnnulusFormula {n m : ℕ} (Du : Domain n → Gradient n m) (R0 : ℝ) : Prop := (∀ {a b : ℝ}, 0 ≤ a → a ≤ b → b ≤ R0 → weakBallEnergy Du (0 : Domain n) b - diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedDerivative.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedDerivative.lean index e28cef087f..bccc1b6cb2 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedDerivative.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedDerivative.lean @@ -18,7 +18,7 @@ This module upgrades interval-indicator radius derivative formulas to general radius weights and identifies the radial derivative density. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedRepresentation.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedRepresentation.lean index c168d10f7b..e50e1d7c3f 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedRepresentation.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeightedRepresentation.lean @@ -16,7 +16,7 @@ to the measurable, essentially bounded radius weights used by the weak monotonicity argument. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeights.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeights.lean index 8af8a6c993..4410b5418d 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeights.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/RadiusWeights.lean @@ -15,7 +15,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # Radius Weights -/ -@[expose] public section +public section noncomputable section @@ -128,7 +128,7 @@ theorem radiusWeightOn_finset_sum_indicator_const_Ioo /-- Pointwise finite interval-step approximation by uniformly bounded radius weights. This is the concrete approximation package needed to pass the finite-interval formula to a limiting radius weight by dominated convergence. -/ -def RadiusWeightFiniteIntervalStepApprox (R0 : ℝ) (c : ℝ → ℝ) : Prop := +@[expose] def RadiusWeightFiniteIntervalStepApprox (R0 : ℝ) (c : ℝ → ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∃ s : ℕ → Finset ℕ, ∃ a b k : ℕ → ℕ → ℝ, (∀ N i, i ∈ s N → 0 ≤ a N i) ∧ @@ -148,7 +148,7 @@ def RadiusWeightFiniteIntervalStepApprox (R0 : ℝ) (c : ℝ → ℝ) : Prop := convergence is required on `(0, R0)` away from a countable set of bad radii. This matches the grid-partition approximations used for continuous weights, where all possible partition boundaries form a countable exceptional set. -/ -def RadiusWeightFiniteIntervalStepApproxAE (R0 : ℝ) (c : ℝ → ℝ) : Prop := +@[expose] def RadiusWeightFiniteIntervalStepApproxAE (R0 : ℝ) (c : ℝ → ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∃ bad : Set ℝ, bad.Countable ∧ ∃ s : ℕ → Finset ℕ, ∃ a b k : ℕ → ℕ → ℝ, diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevBridge.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevBridge.lean index a5452bcad0..7c742640f1 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevBridge.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevBridge.lean @@ -22,7 +22,7 @@ that their preferred Sobolev assumptions imply `WeakStationaryMapIn`, then call that theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevWitness.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevWitness.lean index 211b5a5337..4479751a90 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevWitness.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/SobolevWitness.lean @@ -19,7 +19,7 @@ No stationarity or monotonicity theorem is defined here; those live in `StationaryMap.lean` and `MainTheorem.lean`. -/ -@[expose] public section +public section noncomputable section @@ -49,7 +49,7 @@ structure W12LocMapWitness {n m : Nat} namespace W12LocMapWitness /-- Build a local Sobolev witness from its component hypotheses. -/ -def ofComponents {n m : Nat} +@[expose] def ofComponents {n m : Nat} {u : Domain n -> Target m} {Du : Domain n -> Gradient n m} {Omega : Set (Domain n)} (hu_memLp : LocallyMemLpTwoIn u Omega) diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationarityBridge.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationarityBridge.lean index 0fd33b9d20..506db417dc 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationarityBridge.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationarityBridge.lean @@ -20,7 +20,7 @@ compactly supported `C¹` tests. It bridges to the custom `WeakStationaryIn Du interface used by the proved monotonicity theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationaryMap.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationaryMap.lean index a88e52fd4e..2e898b061f 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationaryMap.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/StationaryMap.lean @@ -20,7 +20,7 @@ The target-manifold constraint is intentionally absent. The monotonicity proof uses only this stationary package. -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,7 @@ structure StationaryW12LocMap {n m : Nat} namespace StationaryW12LocMap /-- Build a stationary Sobolev witness from component hypotheses. -/ -def ofComponents {n m : Nat} +@[expose] def ofComponents {n m : Nat} {u : Domain n -> Target m} {Du : Domain n -> Gradient n m} {Omega : Set (Domain n)} (hu_memLp : LocallyMemLpTwoIn u Omega) diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakGradientBridge.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakGradientBridge.lean index 2638f33d19..a21844657c 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakGradientBridge.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakGradientBridge.lean @@ -17,7 +17,7 @@ support, and support-in-domain data, so future mathlib distribution/test-functio work has a single interface to refine. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakStationarity.lean b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakStationarity.lean index 16ca356eb7..d223430cb6 100644 --- a/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakStationarity.lean +++ b/LeanPool/LeanStationaryHarmonicMaps/StationaryHarmonicMap/WeakStationarity.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial # Weak Stationarity -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,7 @@ def SmoothStationaryIn {n m : ℕ} (u : Domain n → Target m) (Ω : Set (Domain /-- Stationarity integrand written directly in terms of an arbitrary gradient field `Du`. This is the expression used for `W^{1,2}_{loc}` maps. -/ -def weakStationarityIntegrand {n m : ℕ} +@[expose] def weakStationarityIntegrand {n m : ℕ} (Du : Domain n → Gradient n m) (X : Domain n → Domain n) (x : Domain n) : ℝ := weakEnergyDensity Du x * divergence X x - 2 * ∑ i : Fin n, ∑ j : Fin n, @@ -63,7 +63,7 @@ theorem weakStationarityIntegrand_eq_zero_of_notMem_tsupport {n m : ℕ} /-- Weak stationarity in the domain-variation sense, stated in terms of the weak gradient field `Du`. -/ -def WeakStationaryIn {n m : ℕ} +@[expose] def WeakStationaryIn {n m : ℕ} (Du : Domain n → Gradient n m) (Ω : Set (Domain n)) : Prop := ∀ X : Domain n → Domain n, ContDiff ℝ 1 X → @@ -99,26 +99,26 @@ theorem weakStationaryIn_of_subset {n m : ℕ} rwa [heq] at hzero_Ω /-- Local integrability of a scalar function on compact subsets of `Ω`. -/ -def LocallyIntegrableScalarIn {n : ℕ} +@[expose] def LocallyIntegrableScalarIn {n : ℕ} (f : Domain n → ℝ) (Ω : Set (Domain n)) : Prop := ∀ K : Set (Domain n), IsCompact K → K ⊆ Ω → IntegrableOn f K volume /-- The `L²_loc` requirement for the map itself, stated as local integrability of `|u|²`. -/ -def MapLocallyL2In {n m : ℕ} +@[expose] def MapLocallyL2In {n m : ℕ} (u : Domain n → Target m) (Ω : Set (Domain n)) : Prop := LocallyIntegrableScalarIn (fun x => ‖u x‖ ^ 2) Ω /-- The `L²_loc` requirement for a gradient field, stated as local integrability of its Hilbert-Schmidt energy. -/ -def GradientLocallyL2In {n m : ℕ} +@[expose] def GradientLocallyL2In {n m : ℕ} (Du : Domain n → Gradient n m) (Ω : Set (Domain n)) : Prop := LocallyIntegrableScalarIn (fun x => weakEnergyDensity Du x) Ω /-- The chosen weak gradient is a.e. strongly measurable on the domain. This is kept separate from local `L²` control: integrability of the scalar energy density alone does not imply measurability of the full gradient field. -/ -def GradientAEStronglyMeasurableIn {n m : ℕ} +@[expose] def GradientAEStronglyMeasurableIn {n m : ℕ} (Du : Domain n → Gradient n m) (Ω : Set (Domain n)) : Prop := AEStronglyMeasurable Du (volume.restrict Ω) @@ -159,7 +159,7 @@ theorem gradientLocallyL2In_integrableOn_ball {n m : ℕ} For each coordinate direction `i`, the `i`-th component of `Du` is the weak derivative of `u` if integration by parts holds against every compactly supported target-valued test map. -/ -def HasWeakGradientIn {n m : ℕ} +@[expose] def HasWeakGradientIn {n m : ℕ} (u : Domain n → Target m) (Du : Domain n → Gradient n m) (Ω : Set (Domain n)) : Prop := ∀ i : Fin n, ∀ ψ : Domain n → Target m, @@ -171,7 +171,7 @@ def HasWeakGradientIn {n m : ℕ} -∫ x in Ω, inner ℝ (Du x i) (ψ x) /-- A concrete `W^{1,2}_{loc}` interface for maps with a chosen weak gradient. -/ -def W12LocIn {n m : ℕ} +@[expose] def W12LocIn {n m : ℕ} (u : Domain n → Target m) (Du : Domain n → Gradient n m) (Ω : Set (Domain n)) : Prop := MapLocallyL2In u Ω ∧ @@ -181,7 +181,7 @@ def W12LocIn {n m : ℕ} /-- A weak stationary map: `u ∈ W^{1,2}_{loc}` with weak gradient `Du`, and the domain-variation stationarity identity holds in terms of `Du`. -/ -def WeakStationaryMapIn {n m : ℕ} +@[expose] def WeakStationaryMapIn {n m : ℕ} (u : Domain n → Target m) (Du : Domain n → Gradient n m) (Ω : Set (Domain n)) : Prop := W12LocIn u Du Ω ∧ WeakStationaryIn Du Ω diff --git a/LeanPool/LehmerE10.lean b/LeanPool/LehmerE10.lean index 75f694dbd2..7e2ba1af29 100644 --- a/LeanPool/LehmerE10.lean +++ b/LeanPool/LehmerE10.lean @@ -25,7 +25,7 @@ Tags: number-theory, mahler-measure, salem-numbers, coxeter-groups MSC: 11R06, 11C08, 20F55 -/ -@[expose] public section +public section /-! # Lehmer's polynomial and the E10 Coxeter element diff --git a/LeanPool/LehmerE10/CoxeterE8.lean b/LeanPool/LehmerE10/CoxeterE8.lean index 4bc04ac747..b9a985b6cd 100644 --- a/LeanPool/LehmerE10/CoxeterE8.lean +++ b/LeanPool/LehmerE10/CoxeterE8.lean @@ -34,7 +34,7 @@ spectrum on the unit circle ⟹ roots of unity ⟹ finite order, versus one eige the circle ⟹ infinite order — with Lehmer's number as the first exit. -/ -@[expose] public section +public section open Matrix diff --git a/LeanPool/LehmerE10/CyclotomicKill.lean b/LeanPool/LehmerE10/CyclotomicKill.lean index ffc5270188..0b760ece77 100644 --- a/LeanPool/LehmerE10/CyclotomicKill.lean +++ b/LeanPool/LehmerE10/CyclotomicKill.lean @@ -28,7 +28,7 @@ Cayley–Hamilton + minimal-polynomial divisibility + degree count. Axiom footprint: `propext`, `Classical.choice`, `Quot.sound` only. -/ -@[expose] public section +public section namespace LehmerE10 diff --git a/LeanPool/LehmerE10/Defs.lean b/LeanPool/LehmerE10/Defs.lean index b4feb9f866..33c2601819 100644 --- a/LeanPool/LehmerE10/Defs.lean +++ b/LeanPool/LehmerE10/Defs.lean @@ -19,7 +19,7 @@ lattice in the basis of simple roots, and a Coxeter element as the product of th ten simple reflections. -/ -@[expose] public section +public section open Polynomial @@ -27,13 +27,13 @@ open Polynomial `x¹⁰ + x⁹ − x⁷ − x⁶ − x⁵ − x⁴ − x³ + x + 1`. Its Mahler measure `λ ≈ 1.17628` is the smallest known Mahler measure `> 1` of an integer polynomial. -/ -noncomputable def lehmerPolynomial : Polynomial ℤ := +@[expose] noncomputable def lehmerPolynomial : Polynomial ℤ := X ^ 10 + X ^ 9 - X ^ 7 - X ^ 6 - X ^ 5 - X ^ 4 - X ^ 3 + X + 1 /-- The generalized Cartan matrix of the rank-10 hyperbolic Kac–Moody root system **E₁₀**: nodes `0–8` form an A₉ chain and node `9` is attached to node `2` (Bourbaki-style E-series labelling, extended once more past E₉ = E₈⁽¹⁾). -/ -def cartanE10 : Matrix (Fin 10) (Fin 10) ℤ := +@[expose] def cartanE10 : Matrix (Fin 10) (Fin 10) ℤ := !![ 2, -1, 0, 0, 0, 0, 0, 0, 0, 0; -1, 2, -1, 0, 0, 0, 0, 0, 0, 0; 0, -1, 2, -1, 0, 0, 0, 0, 0, -1; @@ -48,10 +48,10 @@ def cartanE10 : Matrix (Fin 10) (Fin 10) ℤ := /-- The simple reflection `sᵢ` of the E₁₀ Weyl group acting on the root lattice, in the basis of simple roots: `sᵢ(αⱼ) = αⱼ − aᵢⱼ αᵢ`, so as a matrix `(sᵢ)ⱼₖ = δⱼₖ − δⱼᵢ aᵢₖ`. -/ -def simpleReflection (i : Fin 10) : Matrix (Fin 10) (Fin 10) ℤ := +@[expose] def simpleReflection (i : Fin 10) : Matrix (Fin 10) (Fin 10) ℤ := Matrix.of fun j k => (if j = k then 1 else 0) - (if j = i then cartanE10 i k else 0) /-- A **Coxeter element** of the E₁₀ Weyl group: the product `s₀ s₁ ⋯ s₉` of the ten simple reflections, as a matrix acting on the root lattice. -/ -def coxeterE10 : Matrix (Fin 10) (Fin 10) ℤ := +@[expose] def coxeterE10 : Matrix (Fin 10) (Fin 10) ℤ := ((List.finRange 10).map simpleReflection).prod diff --git a/LeanPool/LehmerE10/Ergodic.lean b/LeanPool/LehmerE10/Ergodic.lean index d0d7909d0b..60d420011f 100644 --- a/LeanPool/LehmerE10/Ergodic.lean +++ b/LeanPool/LehmerE10/Ergodic.lean @@ -32,7 +32,7 @@ the moduli space of these automorphisms is uncountable or countable by the same lemma records the *ergodicity* half — provable now — not the entropy value. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/LehmerE10/Kronecker.lean b/LeanPool/LehmerE10/Kronecker.lean index d7639ef5e4..d22f1ca7ab 100644 --- a/LeanPool/LehmerE10/Kronecker.lean +++ b/LeanPool/LehmerE10/Kronecker.lean @@ -27,7 +27,7 @@ Contents: Axiom footprint: `propext`, `Classical.choice`, `Quot.sound` only. -/ -@[expose] public section +public section namespace LehmerE10 diff --git a/LeanPool/LehmerE10/Mahler.lean b/LeanPool/LehmerE10/Mahler.lean index 58bd24bd88..0d8f67d9af 100644 --- a/LeanPool/LehmerE10/Mahler.lean +++ b/LeanPool/LehmerE10/Mahler.lean @@ -37,7 +37,7 @@ series crosses from torsion (spectrum on the unit circle) to a Salem element exa rank 10, and the crossing value is Lehmer's number. -/ -@[expose] public section +public section open Polynomial @@ -151,7 +151,7 @@ theorem coxeterE10_infinite_order {n : ℕ} (hn : 0 < n) : coxeterE10 ^ n ≠ 1 have h := Polynomial.map_dvd (algebraMap ℚ ℂ) hdvdQ have hmapL : Lq.map (algebraMap ℚ ℂ) = LC := by rw [hLq, Polynomial.map_map] - exact congrArg lehmerPolynomial.map (Subsingleton.elim _ _) + exact congrArg (fun f : ℤ →+* ℂ => lehmerPolynomial.map f) (Subsingleton.elim _ _) have hmapX : ((X : Polynomial ℚ) ^ n - 1).map (algebraMap ℚ ℂ) = (X : Polynomial ℂ) ^ n - 1 := by rw [Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_X, Polynomial.map_one] diff --git a/LeanPool/LehmerE10/Main.lean b/LeanPool/LehmerE10/Main.lean index 717bd54894..a571990be9 100644 --- a/LeanPool/LehmerE10/Main.lean +++ b/LeanPool/LehmerE10/Main.lean @@ -44,7 +44,7 @@ is NOT claimed anywhere in this repository. Axiom footprint: `propext`, `Classical.choice`, `Quot.sound` only. -/ -@[expose] public section +public section namespace LehmerE10 @@ -197,7 +197,7 @@ lemma dtrace_y5_ne_zero : dtraceQC (y5 : ℂ) ≠ 0 := by /-! ### Lehmer over ℂ: evaluation bridge, derivative, and the derivative–trace identity. -/ /-- Lehmer's polynomial over ℂ. -/ -noncomputable def LC : Polynomial ℂ := lehmerPolynomial.map (Int.castRingHom ℂ) +@[expose] noncomputable def LC : Polynomial ℂ := lehmerPolynomial.map (Int.castRingHom ℂ) lemma LC_poly : LC = X ^ 10 + X ^ 9 - X ^ 7 - X ^ 6 - X ^ 5 - X ^ 4 - X ^ 3 + X + 1 := by unfold LC lehmerPolynomial @@ -247,7 +247,7 @@ lemma deriv_trace_identity {z : ℂ} (hz : z ≠ 0) : into the reciprocal pair. -/ noncomputable def s5 : ℝ := Real.sqrt (y5 ^ 2 - 4) /-- Lehmer's number `μ ≈ 1.17628`: the larger root of `x² − y₅·x + 1`. -/ -noncomputable def mu : ℝ := (y5 + s5) / 2 +@[expose] noncomputable def mu : ℝ := (y5 + s5) / 2 /-- The reciprocal root `1/μ`: the smaller root of `x² − y₅·x + 1`. -/ noncomputable def nu : ℝ := (y5 - s5) / 2 diff --git a/LeanPool/LehmerE10/SalemSymmetry.lean b/LeanPool/LehmerE10/SalemSymmetry.lean index b2f9b64652..659167e363 100644 --- a/LeanPool/LehmerE10/SalemSymmetry.lean +++ b/LeanPool/LehmerE10/SalemSymmetry.lean @@ -29,7 +29,7 @@ element as an integer lattice automorphism: as a conjugate. Equivalently, the Coxeter element and its inverse share a charpoly. -/ -@[expose] public section +public section open Polynomial Matrix diff --git a/LeanPool/LehmerE10/TraceQuintic.lean b/LeanPool/LehmerE10/TraceQuintic.lean index 52844bbb59..a7cdda470e 100644 --- a/LeanPool/LehmerE10/TraceQuintic.lean +++ b/LeanPool/LehmerE10/TraceQuintic.lean @@ -25,20 +25,20 @@ carried out here. Axiom footprint: `propext`, `Classical.choice`, `Quot.sound` only. -/ -@[expose] public section +public section namespace LehmerE10 /-- Lehmer's polynomial as a function on ℂ. -/ -noncomputable def lehmerC (z : ℂ) : ℂ := +@[expose] noncomputable def lehmerC (z : ℂ) : ℂ := z ^ 10 + z ^ 9 - z ^ 7 - z ^ 6 - z ^ 5 - z ^ 4 - z ^ 3 + z + 1 /-- The degree-5 TRACE polynomial over ℝ (for root location). -/ def traceQ (y : ℝ) : ℝ := y ^ 5 + y ^ 4 - 5 * y ^ 3 - 5 * y ^ 2 + 4 * y + 3 /-- Trace polynomial over ℂ. -/ -noncomputable def traceQC (y : ℂ) : ℂ := y ^ 5 + y ^ 4 - 5 * y ^ 3 - 5 * y ^ 2 + 4 * y + 3 +@[expose] noncomputable def traceQC (y : ℂ) : ℂ := y ^ 5 + y ^ 4 - 5 * y ^ 3 - 5 * y ^ 2 + 4 * y + 3 @[simp] theorem traceQC_ofReal (y : ℝ) : traceQC (y : ℂ) = (traceQ y : ℂ) := by unfold traceQC traceQ; push_cast; ring diff --git a/LeanPool/LehmerE10/UnitCircleFactors.lean b/LeanPool/LehmerE10/UnitCircleFactors.lean index 817196426b..678aa0efc4 100644 --- a/LeanPool/LehmerE10/UnitCircleFactors.lean +++ b/LeanPool/LehmerE10/UnitCircleFactors.lean @@ -30,7 +30,7 @@ Contents: Axiom footprint: `propext`, `Classical.choice`, `Quot.sound` only. -/ -@[expose] public section +public section namespace LehmerE10 diff --git a/LeanPool/Lentil.lean b/LeanPool/Lentil.lean index f56a9b6b77..3d7d9ad97f 100644 --- a/LeanPool/Lentil.lean +++ b/LeanPool/Lentil.lean @@ -26,7 +26,7 @@ Tags: temporal-logic, tla, formal-verification, proof-mode MSC: 03B44, 68Q60 -/ -@[expose] public section +public section /-! # Lentil: Temporal Logic of Actions (TLA) in Lean 4 diff --git a/LeanPool/Lentil/Basic.lean b/LeanPool/Lentil/Basic.lean index 447c584557..e6f7f22f58 100644 --- a/LeanPool/Lentil/Basic.lean +++ b/LeanPool/Lentil/Basic.lean @@ -15,7 +15,7 @@ public meta import Lean.PrettyPrinter.Delaborator.Basic public import Lean.PrettyPrinter.Delaborator.Basic public meta import Lean.PrettyPrinter.Parenthesizer -@[expose] public section +public section open Lean LentilLib @@ -33,36 +33,41 @@ namespace TLA -/ /-- An execution: an infinite sequence of states indexed by `Nat`. -/ -def exec (σ : Type u) := Nat → σ +@[expose] def exec (σ : Type u) := Nat → σ /-- A temporal predicate: a property of executions. -/ -def pred (σ : Type u) := exec σ → Prop +@[expose] def pred (σ : Type u) := exec σ → Prop /-- Lift a state property to the temporal predicate that holds at the first state. -/ -def statePred {σ : Type u} (f : σ → Prop) : pred σ := +@[expose] def statePred {σ : Type u} (f : σ → Prop) : pred σ := fun e => f (e 0) /-- An action: a binary relation between the current and next state. -/ -def action (σ : Type u) := σ → σ → Prop +@[expose] def action (σ : Type u) := σ → σ → Prop /-- Lift an action to the temporal predicate that holds on the first two states. -/ -def actionPred {σ : Type u} (a : action σ) : pred σ := +@[expose] def actionPred {σ : Type u} (a : action σ) : pred σ := fun e => a (e 0) (e 1) /-- Lift a `Prop` to the temporal predicate that holds iff the `Prop` does. -/ -def purePred {α : Type u} (p : Prop) : pred α := statePred (fun _ => p) +@[expose] def purePred {α : Type u} (p : Prop) : pred α := statePred (fun _ => p) /-- The temporal predicate that always holds. -/ -def tlaTrue {α : Type u} : pred α := purePred True +@[expose] def tlaTrue {α : Type u} : pred α := purePred True /-- The temporal predicate that never holds. -/ -def tlaFalse {α : Type u} : pred α := purePred False +@[expose] def tlaFalse {α : Type u} : pred α := purePred False /-- Conjunction of temporal predicates. -/ +@[expose] def tlaAnd {α : Type u} (p q : pred α) : pred α := fun σ => p σ ∧ q σ /-- Disjunction of temporal predicates. -/ +@[expose] def tlaOr {α : Type u} (p q : pred α) : pred α := fun σ => p σ ∨ q σ /-- Implication of temporal predicates. -/ +@[expose] def tlaImplies {α : Type u} (p q : pred α) : pred α := fun σ => p σ → q σ /-- Negation of a temporal predicate. -/ -def tlaNot {α : Type u} (p : pred α) : pred α := fun σ => ¬ p σ +@[expose] def tlaNot {α : Type u} (p : pred α) : pred α := fun σ => ¬ p σ /-- Universal quantification over temporal predicates. -/ +@[expose] def tlaForall {α : Sort u} {β : Type v} (p : α → pred β) : pred β := fun σ => ∀ x, p x σ /-- Existential quantification over temporal predicates. -/ +@[expose] def tlaExists {α : Sort u} {β : Type v} (p : α → pred β) : pred β := fun σ => ∃ x, p x σ -- NOTE: this all could be automatically lifted, but to avoid dependency circles, we don't do that @@ -79,40 +84,50 @@ instance {α : Type u} : Std.Associative (@tlaOr α) := by constructor; intros; unfold tlaOr; funext e; ac_rfl /-- Drop the first `k` states of an execution. -/ -def exec.drop {α : Type u} (k : Nat) (σ : exec α) : exec α := λ n => σ (n + k) +@[expose] def exec.drop {α : Type u} (k : Nat) (σ : exec α) : exec α := λ n => σ (n + k) /-- The list of the first `k` states of an execution. -/ def exec.take {α : Type u} (k : Nat) (σ : exec α) : List α := List.range k |>.map σ /-- The list of `k` states of an execution starting at index `start`. -/ def exec.takeFrom {α : Type u} (start k : Nat) (σ : exec α) : List α := List.range' start k |>.map σ /-- The `always` (box) modality: `p` holds on every suffix. -/ +@[expose] def always {α : Type u} (p : pred α) : pred α := λ σ => ∀ k, p <| σ.drop k /-- The `eventually` (diamond) modality: `p` holds on some suffix. -/ +@[expose] def eventually {α : Type u} (p : pred α) : pred α := λ σ => ∃ k, p <| σ.drop k /-- The `later` (next) modality: `p` holds on the suffix dropping one state. -/ -def later {α : Type u} (p : pred α) : pred α := λ σ => p <| σ.drop 1 +@[expose] def later {α : Type u} (p : pred α) : pred α := λ σ => p <| σ.drop 1 /-- An execution satisfies a temporal predicate. -/ +@[expose] def exec.satisfies {α : Type u} (p : pred α) (σ : exec α) : Prop := p σ /-- A temporal predicate is valid: it holds on every execution. -/ +@[expose] def valid {α : Type u} (p : pred α) : Prop := ∀ (σ : exec α), σ.satisfies p /-- Entailment between temporal predicates over all executions. -/ +@[expose] def predImplies {α : Type u} (p q : pred α) : Prop := ∀ (σ : exec α), σ.satisfies p → σ.satisfies q /-- An action is enabled at a state if some successor state exists. -/ +@[expose] def enabled {α : Type u} (a : action α) (s : α) : Prop := ∃ s', a s s' /-- The temporal predicate asserting that an action is enabled. -/ +@[expose] def tlaEnabled {α : Type u} (a : action α) : pred α := statePred (enabled a) /-- Big conjunction of temporal predicates over a foldable collection. -/ +@[expose] def tlaBigwedge {α : Type u} {β : Type v} {c} [Foldable c] (f : β → pred α) (s : c β) : pred α := Foldable.fold tlaAnd tlaTrue f s /-- Big disjunction of temporal predicates over a foldable collection. -/ +@[expose] def tlaBigvee {α : Type u} {β : Type v} {c} [Foldable c] (f : β → pred α) (s : c β) : pred α := Foldable.fold tlaOr tlaFalse f s /-- The `until` modality: `p` holds until `q` becomes true. -/ +@[expose] def tlaUntil {α : Type u} (p q : pred α) : pred α := λ σ => ∃ i, (q <| σ.drop i) ∧ ∀ j < i, (p <| σ.drop j) end TLA @@ -213,10 +228,13 @@ macro_rules -- these definitions are not necessarily required, but for delaboration purposes /-- The leads-to operator `p ↝ q`, defined as `□ (p → ◇ q)`. -/ +@[expose] def TLA.leadsTo {α : Type u} (p q : TLA.pred α) : TLA.pred α := [tlafml| □ (p → ◇ q) ] /-- The always-implies operator `p ⇒ q`, defined as `□ (p → q)`. -/ +@[expose] def TLA.alwaysImplies {α : Type u} (p q : TLA.pred α) : TLA.pred α := [tlafml| □ (p → q) ] /-- Weak fairness of an action. -/ +@[expose] def TLA.weakFairness {α : Type u} (a : action α) : pred α := [tlafml| □ ((□ (Enabled a)) → ◇ ⟨a⟩)] macro_rules diff --git a/LeanPool/Lentil/Expr.lean b/LeanPool/Lentil/Expr.lean index 18006e42f4..f485152fe5 100644 --- a/LeanPool/Lentil/Expr.lean +++ b/LeanPool/Lentil/Expr.lean @@ -8,7 +8,7 @@ module public import Lean.Meta.Basic import LeanPool.Lentil.Basic -@[expose] public section +public section namespace TLA.Expr diff --git a/LeanPool/Lentil/Foldable.lean b/LeanPool/Lentil/Foldable.lean index cb6274da5f..7200ca2287 100644 --- a/LeanPool/Lentil/Foldable.lean +++ b/LeanPool/Lentil/Foldable.lean @@ -12,7 +12,7 @@ A small typeclass abstracting collections that can be folded with a commutative-associative operation, used to give big-conjunction and big-disjunction TLA operators a uniform definition. -/ -@[expose] public section +public section namespace TLA diff --git a/LeanPool/Lentil/ProofMode/Basic.lean b/LeanPool/Lentil/ProofMode/Basic.lean index 897d300814..d4f8744402 100644 --- a/LeanPool/Lentil/ProofMode/Basic.lean +++ b/LeanPool/Lentil/ProofMode/Basic.lean @@ -14,7 +14,7 @@ import LeanPool.Lentil.Rules.BigOp import LeanPool.Lentil.Util import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section namespace TLA.ProofMode @@ -29,9 +29,10 @@ structure NamedPred (σ : Type u) where -- FIXME: How to unify this with `tlaBigwedge`? /-- Right-fold a list of predicates into a single conjunction. -/ -def repeatedAnd (ps : List (pred σ)) : pred σ := (List.foldrD tlaAnd tlaTrue ps) +@[expose] def repeatedAnd (ps : List (pred σ)) : pred σ := (List.foldrD tlaAnd tlaTrue ps) /-- Right-fold a list of predicates into a chain of implications to `q`. -/ +@[expose] def repeatedImplies (ps : List (pred σ)) (q : pred σ) : pred σ := ps.foldr tlaImplies q -- FIXME: This is not satisfactory ... @@ -74,7 +75,7 @@ theorem repeatedImplies_apply {σ : Type u} {hs : List (pred σ)} {goal : pred | cons p ps ih => rw [repeatedAnd_cons, repeatedImplies, List.foldr_cons]; tlaUnfoldSimp; aesop /-- The proof-mode entailment: the conjunction of hypotheses entails the goal. -/ -def Entails (hyps : List (NamedPred σ)) (goal : pred σ) : Prop := +@[expose] def Entails (hyps : List (NamedPred σ)) (goal : pred σ) : Prop := TLA.predImplies (repeatedAnd (hyps.map NamedPred.pred)) goal theorem repeatedAnd_modifyHyp_reorder {σ : Type u} (hyps : List (NamedPred σ)) @@ -97,6 +98,7 @@ theorem repeatedAnd_map_comm {σ : Type u} (hyps : List (pred σ)) (f : pred σ | cons p hyps ih => simp [bigwedge_list_cons, ih]; rw [h] /-- Specification relating a hypothesis list to its modification at a given index. -/ +@[expose] def ModifyHypSpecWithIndex (hyps hyps' : List (NamedPred σ)) (f : NamedPred σ → NamedPred σ) (idx : Nat) := hyps = hyps' ∨ (idx < hyps.length ∧ hyps' = hyps.modify idx f) @@ -122,7 +124,7 @@ theorem ModifyHypSpec_implies_ModifyHypSpecWithIndex {hyps hyps' : List (NamedPr unfold ModifyHypSpecWithIndex ModifyHypSpec; aesop /-- Modify the hypothesis with the given name by applying `f`. -/ -def modifyHypByName {σ : Type u} (hyps : List (NamedPred σ)) (name : String) +@[expose] def modifyHypByName {σ : Type u} (hyps : List (NamedPred σ)) (name : String) (f : NamedPred σ → NamedPred σ) : List (NamedPred σ) := letI idx? := hyps.findIdx? fun h => h.name == name idx?.elim hyps fun idx => hyps.modify idx f diff --git a/LeanPool/Lentil/ProofMode/Tactics/Apply.lean b/LeanPool/Lentil/ProofMode/Tactics/Apply.lean index 9b197f0f5a..d8bbbb56e3 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Apply.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Apply.lean @@ -10,7 +10,7 @@ public meta import LeanPool.Lentil.Expr public import LeanPool.Lentil.ProofMode.Tactics.Have import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Assumption.lean b/LeanPool/Lentil/ProofMode/Tactics/Assumption.lean index b52aa4e00b..851a49960b 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Assumption.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Assumption.lean @@ -9,7 +9,7 @@ public meta import LeanPool.Lentil.ProofMode.Basic public import LeanPool.Lentil.ProofMode.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Clear.lean b/LeanPool/Lentil/ProofMode/Tactics/Clear.lean index 0e75dbe947..62b367c5f9 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Clear.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Clear.lean @@ -10,7 +10,7 @@ public meta import LeanPool.Lentil.ProofMode.Basic public import LeanPool.Lentil.ProofMode.Basic import Lean.Meta.Tactic.Simp.BuiltinSimprocs.String -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Contradiction.lean b/LeanPool/Lentil/ProofMode/Tactics/Contradiction.lean index cefe2880ba..5d9061da04 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Contradiction.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Contradiction.lean @@ -13,7 +13,7 @@ import LeanPool.Lentil.ProofMode.Tactics.Revert import LeanPool.Lentil.ProofMode.Tactics.Specialize import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Exists.lean b/LeanPool/Lentil/ProofMode/Tactics/Exists.lean index c336b32e94..d916869f38 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Exists.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Exists.lean @@ -8,7 +8,7 @@ module public import LeanPool.Lentil.ProofMode.Basic import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Exit.lean b/LeanPool/Lentil/ProofMode/Tactics/Exit.lean index 6d59cab8d0..f7a96884af 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Exit.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Exit.lean @@ -10,7 +10,7 @@ public meta import LeanPool.Lentil.ProofMode.Basic import LeanPool.Lentil.ProofMode.Basic import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Have.lean b/LeanPool/Lentil/ProofMode/Tactics/Have.lean index 0689ddf812..67d29cd012 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Have.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Have.lean @@ -11,7 +11,7 @@ import LeanPool.Lentil.ProofMode.Tactics.Clear public import LeanPool.Lentil.ProofMode.Tactics.Specialize import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Intro.lean b/LeanPool/Lentil/ProofMode/Tactics/Intro.lean index 8f98f9b07a..d7d364fe79 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Intro.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Intro.lean @@ -13,7 +13,7 @@ public import LeanPool.Lentil.ProofMode.Basic import LeanPool.Lentil.Rules.Basic import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/LeftRight.lean b/LeanPool/Lentil/ProofMode/Tactics/LeftRight.lean index 31ab562709..8ff327bc14 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/LeftRight.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/LeftRight.lean @@ -8,7 +8,7 @@ module public import LeanPool.Lentil.ProofMode.Basic import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/ModalityMisc.lean b/LeanPool/Lentil/ProofMode/Tactics/ModalityMisc.lean index 43598cd195..c284bd17cd 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/ModalityMisc.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/ModalityMisc.lean @@ -9,7 +9,7 @@ public import LeanPool.Lentil.ProofMode.Tactics.Monotone meta import LeanPool.Lentil.ProofMode.Basic import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Monotone.lean b/LeanPool/Lentil/ProofMode/Tactics/Monotone.lean index 2ae1632d13..90e64d8176 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Monotone.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Monotone.lean @@ -12,7 +12,7 @@ import LeanPool.Lentil.Rules.Basic import LeanPool.Lentil.Util import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Normalize.lean b/LeanPool/Lentil/ProofMode/Tactics/Normalize.lean index c8c7149c3f..55b212eda3 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Normalize.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Normalize.lean @@ -8,7 +8,7 @@ module public import LeanPool.Lentil.Rules.Basic import LeanPool.Lentil.Util -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/PurePred.lean b/LeanPool/Lentil/ProofMode/Tactics/PurePred.lean index 74d9c914c2..793990488b 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/PurePred.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/PurePred.lean @@ -12,7 +12,7 @@ import LeanPool.Lentil.ProofMode.Tactics.Intro import LeanPool.Lentil.ProofMode.Tactics.Revert import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/RCases.lean b/LeanPool/Lentil/ProofMode/Tactics/RCases.lean index 515d58f878..71d6d246ff 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/RCases.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/RCases.lean @@ -16,7 +16,7 @@ import LeanPool.Lentil.Rules.Basic import LeanPool.Lentil.Util import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Rename.lean b/LeanPool/Lentil/ProofMode/Tactics/Rename.lean index e0970d8f76..3d1362c621 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Rename.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Rename.lean @@ -12,7 +12,7 @@ public import LeanPool.Lentil.ProofMode.Basic import Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core import Lean.Meta.Tactic.Simp.BuiltinSimprocs.String -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Revert.lean b/LeanPool/Lentil/ProofMode/Tactics/Revert.lean index 37aff903a9..c749cd150a 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Revert.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Revert.lean @@ -12,7 +12,7 @@ import Lean.Meta.Tactic.Simp.BuiltinSimprocs.String import LeanPool.Lentil.ProofMode.Tactics.Intro import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Rewrite.lean b/LeanPool/Lentil/ProofMode/Tactics/Rewrite.lean index 0a012a9fe4..d4fb32900d 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Rewrite.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Rewrite.lean @@ -15,7 +15,7 @@ meta import LeanPool.Lentil.ProofMode.Basic meta import LeanPool.Lentil.ProofMode.Location public import LeanPool.Lentil.ProofMode.Location -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Simp.lean b/LeanPool/Lentil/ProofMode/Tactics/Simp.lean index a020da0ec3..878aadc8aa 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Simp.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Simp.lean @@ -11,7 +11,7 @@ public meta import LeanPool.Lentil.ProofMode.Basic public import LeanPool.Lentil.ProofMode.Location meta import LeanPool.Lentil.ProofMode.Location -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/Specialize.lean b/LeanPool/Lentil/ProofMode/Tactics/Specialize.lean index ea67bdfc07..4a0ee02b49 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Specialize.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Specialize.lean @@ -15,7 +15,7 @@ meta import LeanPool.Lentil.ProofMode.Location import LeanPool.Lentil.Rules.Basic import LeanPool.Lentil.Util -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/ProofMode/Tactics/SplitAnds.lean b/LeanPool/Lentil/ProofMode/Tactics/SplitAnds.lean index 70b3cfee58..9d14917ab6 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/SplitAnds.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/SplitAnds.lean @@ -9,7 +9,7 @@ public import LeanPool.Lentil.ProofMode.Basic import Batteries.Tactic.Init import LeanPool.Lentil.Rules.Basic -@[expose] public section +public section namespace TLA.ProofMode diff --git a/LeanPool/Lentil/Rules/Basic.lean b/LeanPool/Lentil/Rules/Basic.lean index f4a4f89d61..b919d1516b 100644 --- a/LeanPool/Lentil/Rules/Basic.lean +++ b/LeanPool/Lentil/Rules/Basic.lean @@ -15,7 +15,7 @@ import Std.Tactic.BVDecide.Normalize.Prop /-! Basic theorems about TLA. -/ -@[expose] public section +public section open Classical LentilLib diff --git a/LeanPool/Lentil/Rules/BigOp.lean b/LeanPool/Lentil/Rules/BigOp.lean index 9ead1af1c5..5744f590af 100644 --- a/LeanPool/Lentil/Rules/BigOp.lean +++ b/LeanPool/Lentil/Rules/BigOp.lean @@ -15,7 +15,7 @@ import Std.Tactic.BVDecide.Normalize.Prop /-! Theorems about big operators (e.g., `⋀`, `⋁`). -/ -@[expose] public section +public section open Classical LentilLib diff --git a/LeanPool/Lentil/Rules/LeadsTo.lean b/LeanPool/Lentil/Rules/LeadsTo.lean index 1a32f634f5..f98aaba6e6 100644 --- a/LeanPool/Lentil/Rules/LeadsTo.lean +++ b/LeanPool/Lentil/Rules/LeadsTo.lean @@ -14,7 +14,7 @@ import LeanPool.Lentil.Util /-! Theorems about the leads-to operator. -/ -@[expose] public section +public section open Classical diff --git a/LeanPool/Lentil/Rules/StatePred.lean b/LeanPool/Lentil/Rules/StatePred.lean index 2798b00a94..ddda114d6d 100644 --- a/LeanPool/Lentil/Rules/StatePred.lean +++ b/LeanPool/Lentil/Rules/StatePred.lean @@ -17,7 +17,7 @@ import LeanPool.Lentil.Util states before/after an action, instead of being in the form of `|-tla-`. -/ -@[expose] public section +public section open Classical diff --git a/LeanPool/Lentil/Rules/WF.lean b/LeanPool/Lentil/Rules/WF.lean index fed70c2480..248f9578c2 100644 --- a/LeanPool/Lentil/Rules/WF.lean +++ b/LeanPool/Lentil/Rules/WF.lean @@ -20,7 +20,7 @@ import Std.Tactic.BVDecide.Normalize.Prop /-! Theorems about weak-fairness. -/ -@[expose] public section +public section open Classical diff --git a/LeanPool/Lentil/Tactics/Basic.lean b/LeanPool/Lentil/Tactics/Basic.lean index f78d2daf72..20763e573e 100644 --- a/LeanPool/Lentil/Tactics/Basic.lean +++ b/LeanPool/Lentil/Tactics/Basic.lean @@ -12,7 +12,7 @@ public import Lean.Meta.Tactic.Replace public import Std.Do.Triple.SpecLemmas import LeanPool.Lentil.Util -@[expose] public section +public section open Lean Meta Elab Tactic diff --git a/LeanPool/Lentil/Tactics/FiniteWindow.lean b/LeanPool/Lentil/Tactics/FiniteWindow.lean index bb47561769..65bb9fb332 100644 --- a/LeanPool/Lentil/Tactics/FiniteWindow.lean +++ b/LeanPool/Lentil/Tactics/FiniteWindow.lean @@ -14,7 +14,7 @@ public import LeanPool.Lentil.Tactics.Basic import LeanPool.Lentil.Util import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section open Lean @@ -46,6 +46,7 @@ For example, `IteratedHomPred 2 σ` reduces to `σ → σ → ULift Prop`. The ` in the base case is deliberate: for universe-polymorphic `σ : Type u`, the successor case lives in `Type u`, so the base proposition also has to be lifted into `Type u`. The user-facing goals are later simplified through `.down`. -/ +@[expose] def IteratedHomPred : Nat → Type u → Type u | 0, _ => ULift.{u} Prop | n + 1, σ => σ → IteratedHomPred n σ @@ -60,6 +61,7 @@ def evalExec {σ : Type u} : (n : Nat) → IteratedHomPred n σ → exec σ → /-- View an `n`-state core as an `m`-state core when `n ≤ m`, ignoring the additional trailing states. This is used to combine two formulas with different window sizes into a common `max` window. -/ +@[expose] def weaken {σ : Type u} : (n m : Nat) → n ≤ m → IteratedHomPred n σ → IteratedHomPred m σ | 0, 0, _, p => p | 0, m + 1, _, p => fun _ => weaken 0 m (Nat.zero_le m) p @@ -82,6 +84,7 @@ share the same recursion shape, so the generic constructors below keep the named logical constructors small. -/ /-- Negate an iterated finite-window predicate. -/ +@[expose] def mkNot {σ : Type u} : (n : Nat) → IteratedHomPred n σ → IteratedHomPred n σ | 0, p => ULift.up (¬ p.down) | n + 1, p => fun s => mkNot n (p s) @@ -93,6 +96,7 @@ theorem evalExec_mkNot {σ : Type u} : | n + 1, p, e => evalExec_mkNot n (p (e 0)) (e.drop 1) /-- Combine two iterated finite-window predicates with a binary connective. -/ +@[expose] def mkBinary {σ : Type u} (op : Prop → Prop → Prop) : (n : Nat) → IteratedHomPred n σ → IteratedHomPred n σ → IteratedHomPred n σ @@ -106,6 +110,7 @@ theorem evalExec_mkBinary {σ : Type u} (op : Prop → Prop → Prop) : | n + 1, p, q, e => evalExec_mkBinary op n (p (e 0)) (q (e 0)) (e.drop 1) /-- Conjoin two iterated finite-window predicates. -/ +@[expose] def mkAnd {σ : Type u} : (n : Nat) → IteratedHomPred n σ → IteratedHomPred n σ → IteratedHomPred n σ := mkBinary (fun p q => p ∧ q) @@ -116,6 +121,7 @@ theorem evalExec_mkAnd {σ : Type u} : evalExec_mkBinary (fun p q => p ∧ q) /-- Disjoin two iterated finite-window predicates. -/ +@[expose] def mkOr {σ : Type u} : (n : Nat) → IteratedHomPred n σ → IteratedHomPred n σ → IteratedHomPred n σ := mkBinary (fun p q => p ∨ q) @@ -126,6 +132,7 @@ theorem evalExec_mkOr {σ : Type u} : evalExec_mkBinary (fun p q => p ∨ q) /-- Form the implication of two iterated finite-window predicates. -/ +@[expose] def mkImplies {σ : Type u} : (n : Nat) → IteratedHomPred n σ → IteratedHomPred n σ → IteratedHomPred n σ := mkBinary (fun p q => p → q) @@ -136,6 +143,7 @@ theorem evalExec_mkImplies {σ : Type u} : evalExec_mkBinary (fun p q => p → q) /-- Bind a quantifier over an iterated finite-window predicate. -/ +@[expose] def mkBinder {σ : Type u} {α : Sort v} (op : (α → Prop) → Prop) : (n : Nat) → (α → IteratedHomPred n σ) → IteratedHomPred n σ @@ -149,6 +157,7 @@ theorem evalExec_mkBinder {σ : Type u} {α : Sort v} (op : (α → Prop) → Pr | n + 1, p, e => evalExec_mkBinder op n (fun x => p x (e 0)) (e.drop 1) /-- Universally quantify an iterated finite-window predicate. -/ +@[expose] def mkForall {σ : Type u} {α : Sort v} : (n : Nat) → (α → IteratedHomPred n σ) → IteratedHomPred n σ := mkBinder (fun p => ∀ x, p x) @@ -159,6 +168,7 @@ theorem evalExec_mkForall {σ : Type u} {α : Sort v} : evalExec_mkBinder (fun p => ∀ x, p x) /-- Existentially quantify an iterated finite-window predicate. -/ +@[expose] def mkExists {σ : Type u} {α : Sort v} : (n : Nat) → (α → IteratedHomPred n σ) → IteratedHomPred n σ := mkBinder (fun p => ∃ x, p x) @@ -171,6 +181,7 @@ theorem evalExec_mkExists {σ : Type u} {α : Sort v} : end IteratedHomPred /-- Universal closure of a finite core over all its state arguments. -/ +@[expose] def IteratedForall {σ : Type u} : (n : Nat) → IteratedHomPred n σ → Prop | 0, p => p.down | n + 1, p => ∀ s, IteratedForall n (p s) @@ -202,6 +213,7 @@ class HasFiniteWindow {σ : Type u} (p : pred σ) (n : outParam Nat) where /-- Extract the semantic certificate from the tactic-facing class. Keeping this as a definition, not an instance for `FiniteWindow`, prevents arbitrary `FiniteWindow` facts from becoming part of instance search. -/ +@[expose] def finiteWindowOfHasFiniteWindow {σ : Type u} {p : pred σ} {n : Nat} [h : HasFiniteWindow p n] : FiniteWindow p n := h.finite @@ -220,6 +232,7 @@ theorem HasFiniteWindow.valid_of_forall {σ : Type u} {p : pred σ} {n : Nat} /- Base finite-window certificates. -/ /-- Finite-window certificate for a pure predicate. -/ +@[expose] def finiteWindowPure {σ : Type u} (P : Prop) : FiniteWindow (purePred (α := σ) P) 0 where core := ULift.up P iff_of_eval := by simp [purePred, statePred, IteratedHomPred.evalExec] @@ -228,6 +241,7 @@ instance hasFiniteWindowPure {σ : Type u} (P : Prop) : HasFiniteWindow (purePre finite := finiteWindowPure P /-- Finite-window certificate for `⊤`. -/ +@[expose] def finiteWindowTrue {σ : Type u} : FiniteWindow (tlaTrue (α := σ)) 0 where core := ULift.up True iff_of_eval := by simp [tlaTrue, purePred, statePred, IteratedHomPred.evalExec] @@ -236,6 +250,7 @@ instance hasFiniteWindowTrue {σ : Type u} : HasFiniteWindow (tlaTrue (α := σ) finite := finiteWindowTrue /-- Finite-window certificate for `⊥`. -/ +@[expose] def finiteWindowFalse {σ : Type u} : FiniteWindow (tlaFalse (α := σ)) 0 where core := ULift.up False iff_of_eval := by simp [tlaFalse, purePred, statePred, IteratedHomPred.evalExec] @@ -244,6 +259,7 @@ instance hasFiniteWindowFalse {σ : Type u} : HasFiniteWindow (tlaFalse (α := finite := finiteWindowFalse /-- Finite-window certificate for a state predicate. -/ +@[expose] def finiteWindowState {σ : Type u} (p : σ → Prop) : FiniteWindow (statePred p) 1 where core := fun s => ULift.up (p s) iff_of_eval := by simp [statePred, IteratedHomPred.evalExec] @@ -252,6 +268,7 @@ instance hasFiniteWindowState {σ : Type u} (p : σ → Prop) : HasFiniteWindow finite := finiteWindowState p /-- Finite-window certificate for an action predicate. -/ +@[expose] def finiteWindowAction {σ : Type u} (a : action σ) : FiniteWindow (actionPred a) 2 where core := fun s s' => ULift.up (a s s') iff_of_eval := by simp [actionPred, IteratedHomPred.evalExec, exec.drop] @@ -260,6 +277,7 @@ instance hasFiniteWindowAction {σ : Type u} (a : action σ) : HasFiniteWindow ( finite := finiteWindowAction a /-- Finite-window certificate for an enabledness predicate. -/ +@[expose] def finiteWindowEnabled {σ : Type u} (a : action σ) : FiniteWindow (tlaEnabled a) 1 := finiteWindowState (enabled a) @@ -270,6 +288,7 @@ instance hasFiniteWindowEnabled {σ : Type u} (a : action σ) : HasFiniteWindow both cores to the common `max` window, then combine them pointwise. -/ /-- Finite-window certificate for a binary connective of predicates. -/ +@[expose] def finiteWindowBinary {σ : Type u} (op : Prop → Prop → Prop) (p q : pred σ) (n m : Nat) (hp : FiniteWindow p n) (hq : FiniteWindow q m) : FiniteWindow (fun e => op (p e) (q e)) (max n m) where @@ -283,6 +302,7 @@ def finiteWindowBinary {σ : Type u} (op : Prop → Prop → Prop) (p q : pred rw [IteratedHomPred.evalExec_weaken, IteratedHomPred.evalExec_weaken] /-- Finite-window certificate for a conjunction. -/ +@[expose] def finiteWindowAnd {σ : Type u} (p q : pred σ) (n m : Nat) (hp : FiniteWindow p n) (hq : FiniteWindow q m) : FiniteWindow (tlaAnd p q) (max n m) := @@ -294,6 +314,7 @@ instance hasFiniteWindowAnd {σ : Type u} (p q : pred σ) (n m : Nat) finite := finiteWindowAnd p q n m finiteWindowOfHasFiniteWindow finiteWindowOfHasFiniteWindow /-- Finite-window certificate for a disjunction. -/ +@[expose] def finiteWindowOr {σ : Type u} (p q : pred σ) (n m : Nat) (hp : FiniteWindow p n) (hq : FiniteWindow q m) : FiniteWindow (tlaOr p q) (max n m) := @@ -305,6 +326,7 @@ instance hasFiniteWindowOr {σ : Type u} (p q : pred σ) (n m : Nat) finite := finiteWindowOr p q n m finiteWindowOfHasFiniteWindow finiteWindowOfHasFiniteWindow /-- Finite-window certificate for a negation. -/ +@[expose] def finiteWindowNot {σ : Type u} (p : pred σ) (n : Nat) (hp : FiniteWindow p n) : FiniteWindow (tlaNot p) n where core := IteratedHomPred.mkNot n hp.core @@ -319,6 +341,7 @@ instance hasFiniteWindowNot {σ : Type u} (p : pred σ) (n : Nat) [HasFiniteWind finite := finiteWindowNot p n finiteWindowOfHasFiniteWindow /-- Finite-window certificate for an implication. -/ +@[expose] def finiteWindowImplies {σ : Type u} (p q : pred σ) (n m : Nat) (hp : FiniteWindow p n) (hq : FiniteWindow q m) : FiniteWindow (tlaImplies p q) (max n m) := @@ -330,6 +353,7 @@ instance hasFiniteWindowImplies {σ : Type u} (p q : pred σ) (n m : Nat) finite := finiteWindowImplies p q n m finiteWindowOfHasFiniteWindow finiteWindowOfHasFiniteWindow /-- Finite-window certificate for the `◯` modality. -/ +@[expose] def finiteWindowLater {σ : Type u} (p : pred σ) (n : Nat) (hp : FiniteWindow p n) : FiniteWindow (later p) (n + 1) where core := fun _ => hp.core @@ -346,6 +370,7 @@ are kept as certificate constructors rather than typeclass instances, since inferring such a uniform window is a separate problem. -/ /-- Finite-window certificate for a quantifier binder. -/ +@[expose] def finiteWindowBinder {σ : Type u} {α : Sort v} (op : (α → Prop) → Prop) (op_congr : ∀ {p q : α → Prop}, (∀ x, p x ↔ q x) → (op p ↔ op q)) (p : α → pred σ) (n : Nat) (hp : ∀ x, FiniteWindow (p x) n) : @@ -357,12 +382,14 @@ def finiteWindowBinder {σ : Type u} {α : Sort v} (op : (α → Prop) → Prop) exact op_congr fun x => (hp x).iff_of_eval e /-- Finite-window certificate for a universal quantifier. -/ +@[expose] def finiteWindowForall {σ : Type u} {α : Sort v} (p : α → pred σ) (n : Nat) (hp : ∀ x, FiniteWindow (p x) n) : FiniteWindow (tlaForall p) n := finiteWindowBinder (fun r => ∀ x, r x) forall_congr' p n hp /-- Finite-window certificate for an existential quantifier. -/ +@[expose] def finiteWindowExists {σ : Type u} {α : Sort v} (p : α → pred σ) (n : Nat) (hp : ∀ x, FiniteWindow (p x) n) : FiniteWindow (tlaExists p) n := diff --git a/LeanPool/Lentil/Util.lean b/LeanPool/Lentil/Util.lean index e28f65a7d0..22e92c8c8c 100644 --- a/LeanPool/Lentil/Util.lean +++ b/LeanPool/Lentil/Util.lean @@ -10,7 +10,7 @@ public meta import Lean.Meta.Tactic.Simp.Simproc meta import Lean.Meta.Tactic.Simp.Attr import Lean.Meta.Tactic.Simp.RegisterCommand -@[expose] public section +public section open Lean diff --git a/LeanPool/Lentil/Utils/MiscLemmas.lean b/LeanPool/Lentil/Utils/MiscLemmas.lean index 3f5308429e..356804a2b3 100644 --- a/LeanPool/Lentil/Utils/MiscLemmas.lean +++ b/LeanPool/Lentil/Utils/MiscLemmas.lean @@ -9,7 +9,7 @@ public import Std.Data.HashSet.Basic import Std.Data.DTreeMap.Internal.Operations import Std.Tactic.BVDecide.Normalize.Prop -@[expose] public section +public section namespace LentilLib @@ -60,7 +60,7 @@ theorem findFindIdx {α : Type u} {l : List α} {p : α → Bool} {res : α} · rw [List.findIdx?_eq_some_iff_getElem]; grind /-- Right-fold a non-empty list, returning the default `d` on the empty list. -/ -def foldrD {β : Type v} (f : β → β → β) (d : β) : List β → β +@[expose] def foldrD {β : Type v} (f : β → β → β) (d : β) : List β → β | [a] => a | a :: as => f a (foldrD f d as) | [] => d diff --git a/LeanPool/Lentil/Utils/SyntaxUtil.lean b/LeanPool/Lentil/Utils/SyntaxUtil.lean index abefa69088..3660638d79 100644 --- a/LeanPool/Lentil/Utils/SyntaxUtil.lean +++ b/LeanPool/Lentil/Utils/SyntaxUtil.lean @@ -8,7 +8,7 @@ module meta import Lean.Parser.Term import Lean.Parser.Term -@[expose] public section +public section open Lean diff --git a/LeanPool/LocalComplexGeometry.lean b/LeanPool/LocalComplexGeometry.lean index 306b02b4b4..c71a28f324 100644 --- a/LeanPool/LocalComplexGeometry.lean +++ b/LeanPool/LocalComplexGeometry.lean @@ -29,7 +29,7 @@ Tags: complex-analysis, analytic-geometry, nullstellensatz, weierstrass-preparat MSC: 32A05, 32A10, 32B05, 32C25, 13E05 -/ -@[expose] public section +public section /-! # Local complex-analytic geometry diff --git a/LeanPool/LocalComplexGeometry/Algebra/NoetherianByRemainder.lean b/LeanPool/LocalComplexGeometry/Algebra/NoetherianByRemainder.lean index 71e2f0c87e..b891c576d4 100644 --- a/LeanPool/LocalComplexGeometry/Algebra/NoetherianByRemainder.lean +++ b/LeanPool/LocalComplexGeometry/Algebra/NoetherianByRemainder.lean @@ -19,7 +19,7 @@ contains an element `p` and reduction modulo `p` lands in a Noetherian module, then finitely many lifted remainders together with `p` generate the ideal. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/LocalComplexGeometry/Analytic/ConstantRank.lean b/LeanPool/LocalComplexGeometry/Analytic/ConstantRank.lean index 7849c0839f..1a55e402c1 100644 --- a/LeanPool/LocalComplexGeometry/Analytic/ConstantRank.lean +++ b/LeanPool/LocalComplexGeometry/Analytic/ConstantRank.lean @@ -19,7 +19,7 @@ finite-dimensional complements, and the mean-value theorem on the kernel factor. -/ -@[expose] public section +public section open Filter Metric diff --git a/LeanPool/LocalComplexGeometry/Analytic/ConstantRankLinear.lean b/LeanPool/LocalComplexGeometry/Analytic/ConstantRankLinear.lean index d98523466f..ba5707617c 100644 --- a/LeanPool/LocalComplexGeometry/Analytic/ConstantRankLinear.lean +++ b/LeanPool/LocalComplexGeometry/Analytic/ConstantRankLinear.lean @@ -23,7 +23,7 @@ composition, a vertical-kernel criterion, and canonical product coordinates on `Fin (r + k) → ℂ`. -/ -@[expose] public section +public section namespace LocalComplexGeometry @@ -32,7 +32,7 @@ noncomputable section /-- Range dimension for a continuous complex-linear map between arbitrary complex normed spaces. -/ -def complexLinearRank +@[expose] def complexLinearRank {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] diff --git a/LeanPool/LocalComplexGeometry/Analytic/LevelSet.lean b/LeanPool/LocalComplexGeometry/Analytic/LevelSet.lean index f9b7cdb60a..3ab253c0a6 100644 --- a/LeanPool/LocalComplexGeometry/Analytic/LevelSet.lean +++ b/LeanPool/LocalComplexGeometry/Analytic/LevelSet.lean @@ -21,7 +21,7 @@ an analytic ambient fiber-coordinate map and eventual two-sided inverse laws, so the conclusion is stronger than a dimension count. -/ -@[expose] public section +public section open Filter diff --git a/LeanPool/LocalComplexGeometry/Analytic/LocalBiholomorph.lean b/LeanPool/LocalComplexGeometry/Analytic/LocalBiholomorph.lean index 2a41520d96..afdef81e74 100644 --- a/LeanPool/LocalComplexGeometry/Analytic/LocalBiholomorph.lean +++ b/LeanPool/LocalComplexGeometry/Analytic/LocalBiholomorph.lean @@ -21,7 +21,7 @@ analytic maps in both directions, carrying `a` to `b`, whose two composites agre with the identity on neighborhoods of the relevant base points. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -181,7 +181,7 @@ theorem eventually_bijective_fderiv_invFun [CompleteSpace E] [CompleteSpace F] e.symm.eventually_bijective_fderiv_toFun /-- Compose two local biholomorphisms with matching middle base point. -/ -def trans (e : LocalBiholomorphAt E F a b) +@[expose] def trans (e : LocalBiholomorphAt E F a b) (h : LocalBiholomorphAt F G b c) : LocalBiholomorphAt E G a c where toFun := h.toFun ∘ e.toFun @@ -221,7 +221,7 @@ def ofContinuousLinearEquiv (e : E ≃L[ℂ] F) (a : E) : /-- A continuous complex-linear equivalence regarded as a biholomorphic germ at the origin in both spaces. -/ -def ofContinuousLinearEquivAtZero (e : E ≃L[ℂ] F) : +@[expose] def ofContinuousLinearEquivAtZero (e : E ≃L[ℂ] F) : LocalBiholomorphAt E F 0 0 where toFun := e invFun := e.symm @@ -233,7 +233,7 @@ def ofContinuousLinearEquivAtZero (e : E ≃L[ℂ] F) : right_inv := Filter.Eventually.of_forall e.apply_symm_apply /-- The affine biholomorphism with linear part `e` sending `a` to `b`. -/ -def affine (e : E ≃L[ℂ] F) (a : E) (b : F) : +@[expose] def affine (e : E ≃L[ℂ] F) (a : E) (b : F) : LocalBiholomorphAt E F a b where toFun := fun x ↦ e (x - a) + b invFun := fun y ↦ e.symm (y - b) + a @@ -260,7 +260,7 @@ def translation (a b : E) : LocalBiholomorphAt E E a b := /-- A triangular analytic change of coordinates on a product, subtracting an analytic function from the second coordinate. -/ -def fiberShearAtZero +@[expose] def fiberShearAtZero {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℂ X] [NormedAddCommGroup Y] [NormedSpace ℂ Y] @@ -284,7 +284,7 @@ def fiberShearAtZero ext <;> simp /-- An analytic map with an explicitly invertible derivative is locally biholomorphic. -/ -def ofAnalyticAtOfFDerivEquiv [CompleteSpace E] +@[expose] def ofAnalyticAtOfFDerivEquiv [CompleteSpace E] {f : E → F} {a : E} (hf : AnalyticAt ℂ f a) (e : E ≃L[ℂ] F) (he : fderiv ℂ f a = (e : E →L[ℂ] F)) : LocalBiholomorphAt E F a (f a) := by diff --git a/LeanPool/LocalComplexGeometry/Analytic/Rank.lean b/LeanPool/LocalComplexGeometry/Analytic/Rank.lean index 490fb933e1..b30e3e5b29 100644 --- a/LeanPool/LocalComplexGeometry/Analytic/Rank.lean +++ b/LeanPool/LocalComplexGeometry/Analytic/Rank.lean @@ -22,7 +22,7 @@ definition for arbitrary `n`, `m`, and `r`; its rank is exactly `r` when `r ≤ n` and `r ≤ m`. -/ -@[expose] public section +public section namespace LocalComplexGeometry @@ -30,7 +30,7 @@ namespace LocalComplexGeometry noncomputable section /-- The complex dimension of the range of a continuous complex-linear map. -/ -def complexRank {n m : ℕ} +@[expose] def complexRank {n m : ℕ} (A : ComplexEuclidean n →L[ℂ] ComplexEuclidean m) : ℕ := Module.finrank ℂ (LinearMap.range A.toLinearMap) @@ -80,7 +80,7 @@ theorem standardRankMap_apply (n m r : ℕ) simp [standardRankMap] /-- Restrict a coordinate vector to its first `r` coordinates. -/ -def takeFirstContinuousLinearMap {n r : ℕ} (hrn : r ≤ n) : +@[expose] def takeFirstContinuousLinearMap {n r : ℕ} (hrn : r ≤ n) : ComplexEuclidean n →L[ℂ] ComplexEuclidean r := ContinuousLinearMap.pi fun j ↦ ContinuousLinearMap.proj (R := ℂ) (i := Fin.castLE hrn j) diff --git a/LeanPool/LocalComplexGeometry/Analytic/Regularization.lean b/LeanPool/LocalComplexGeometry/Analytic/Regularization.lean index b055de4012..47a9546558 100644 --- a/LeanPool/LocalComplexGeometry/Analytic/Regularization.lean +++ b/LeanPool/LocalComplexGeometry/Analytic/Regularization.lean @@ -17,7 +17,7 @@ in the last variable. This is the coordinate-change input required before Weierstrass preparation can be applied in Rückert's arguments. -/ -@[expose] public section +public section open Filter open scoped ENNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/AnalyticSeries.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/AnalyticSeries.lean index 9411cb164f..92dc8d3389 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/AnalyticSeries.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/AnalyticSeries.lean @@ -17,23 +17,23 @@ series at the ambient origin to Taylor coefficients at the moving centers an analytic function of `z`, with all radii controlled by the original series. -/ -@[expose] public section +public section namespace ClassicalComplexWPT /-- Continuous-linear inclusion of the distinguished complex axis. -/ -noncomputable def lastAxis (n : ℕ) : ℂ →L[ℂ] Ambient n := +@[expose] noncomputable def lastAxis (n : ℕ) : ℂ →L[ℂ] Ambient n := ContinuousLinearMap.inr ℂ (Base n) ℂ @[simp] theorem lastAxis_apply (n : ℕ) (w : ℂ) : lastAxis n w = (0, w) := rfl /-- The unit vector in the distinguished complex direction. -/ -def lastDirection (n : ℕ) : Ambient n := (0, 1) +@[expose] def lastDirection (n : ℕ) : Ambient n := (0, 1) /-- The `k`-th (factorial-normalized) distinguished-variable Taylor coefficient at `(z, 0)`. -/ -noncomputable def lastTaylorCoefficient {n : ℕ} +@[expose] noncomputable def lastTaylorCoefficient {n : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (k : ℕ) (z : Base n) : ℂ := p.changeOrigin (z, 0) k (fun _ ↦ lastDirection n) diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Basic.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Basic.lean index 6658299661..9fc5e1f2bc 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Basic.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Basic.lean @@ -16,7 +16,7 @@ definitions used by the proof development. The independently audited public statement remains in `Challenge.lean`. -/ -@[expose] public section +public section open scoped BigOperators Topology @@ -34,7 +34,7 @@ theorem ambient_zero_eq (n : ℕ) : (0 : Ambient n) = ((0 : Base n), 0) := by ext <;> simp /-- Restriction of a function to the distinguished-variable axis. -/ -def lastSlice {n : ℕ} (f : Ambient n → ℂ) : ℂ → ℂ := +@[expose] def lastSlice {n : ℕ} (f : Ambient n → ℂ) : ℂ → ℂ := fun w ↦ f (0, w) @[simp] @@ -46,12 +46,12 @@ The distinguished-variable slice has a zero of exact order `d` at the origin: all derivatives of order below `d` vanish and the derivative of order `d` does not vanish. -/ -def ExactOrderInLastVariable {n : ℕ} (f : Ambient n → ℂ) (d : ℕ) : Prop := +@[expose] def ExactOrderInLastVariable {n : ℕ} (f : Ambient n → ℂ) (d : ℕ) : Prop := (∀ k < d, iteratedDeriv k (lastSlice f) 0 = 0) ∧ iteratedDeriv d (lastSlice f) 0 ≠ 0 /-- The monic degree-`d` polynomial in the distinguished variable. -/ -def preparedPolynomial {n : ℕ} (d : ℕ) (a : Fin d → Base n → ℂ) +@[expose] def preparedPolynomial {n : ℕ} (d : ℕ) (a : Fin d → Base n → ℂ) (x : Ambient n) : ℂ := x.2 ^ d + ∑ i : Fin d, a i x.1 * x.2 ^ (i : ℕ) @@ -60,7 +60,7 @@ def preparedPolynomial {n : ℕ} (d : ℕ) (a : Fin d → Base n → ℂ) distinguished-variable polynomial whose lower coefficients are analytic and vanish at the base origin. -/ -def IsWeierstrassPreparation {n : ℕ} (f : Ambient n → ℂ) (d : ℕ) +@[expose] def IsWeierstrassPreparation {n : ℕ} (f : Ambient n → ℂ) (d : ℕ) (a : Fin d → Base n → ℂ) (u : Ambient n → ℂ) : Prop := (∀ i, AnalyticAt ℂ (a i) 0) ∧ (∀ i, a i 0 = 0) ∧ diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/EdgeCases.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/EdgeCases.lean index 750eb69f98..f5f9e584ac 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/EdgeCases.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/EdgeCases.lean @@ -15,7 +15,7 @@ The degree-zero case is independent of analytic division: the distinguished polynomial is `1`, so the original analytic germ is the unit. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/ExactOrder.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/ExactOrder.lean index 5fd1702394..755a3265ca 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/ExactOrder.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/ExactOrder.lean @@ -16,7 +16,7 @@ properties of the distinguished-variable slice. The deeper comparison with analytic order is developed separately from these edge-case lemmas. -/ -@[expose] public section +public section open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Examples.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Examples.lean index c5d5d79614..e4823c42b8 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Examples.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Examples.lean @@ -16,7 +16,7 @@ monicity, genuine parameter dependence, nonconstant units, and the `n = 0` and `d = 0` semantics of the public interface. -/ -@[expose] public section +public section open scoped BigOperators Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Germs.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Germs.lean index a5bb1512a8..6d1475a6de 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Germs.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Germs.lean @@ -18,7 +18,7 @@ lemmas record the corresponding ring-theoretic unit fact without introducing a separate sheaf or stalk API into the public statement. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1Division.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1Division.lean index 57f4d805ed..99a2013dba 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1Division.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1Division.lean @@ -17,7 +17,7 @@ and the specialized one-variable quotient and remainder operators used in complex-analytic Weierstrass preparation. -/ -@[expose] public section +public section open Finset open scoped ENNReal NNReal Topology @@ -180,7 +180,7 @@ lemma convolution_smul_right (c : ℂ) (f g : L1Coeff A) : rw [convolution_comm f, convolution_smul_left, convolution_comm g] /-- Right convolution depends continuously and linearly on the coefficient family. -/ -def convolutionRightMap : +@[expose] def convolutionRightMap : L1Coeff A →L[ℂ] (L1Coeff A →L[ℂ] L1Coeff A) := ({ toFun := convolutionRight @@ -203,7 +203,7 @@ def convolutionRightMap : convolutionRightMap p = convolutionRight p := rfl /-- The high-shifted convolution perturbation used by division. -/ -def divisionPerturbation (d : ℕ) (p : L1Coeff (A × ℕ)) : +@[expose] def divisionPerturbation (d : ℕ) (p : L1Coeff (A × ℕ)) : L1Coeff (A × ℕ) →L[ℂ] L1Coeff (A × ℕ) := highShiftCLM d ∘L convolutionRight p @@ -220,7 +220,7 @@ theorem norm_divisionPerturbation_le (d : ℕ) (p : L1Coeff (A × ℕ)) : _ = ‖p‖ := one_mul _ /-- The operator-valued linear map `p ↦ S_d C_p`. -/ -def divisionPerturbationMap (d : ℕ) : +@[expose] def divisionPerturbationMap (d : ℕ) : L1Coeff (A × ℕ) →L[ℂ] (L1Coeff (A × ℕ) →L[ℂ] L1Coeff (A × ℕ)) := ({ toFun := divisionPerturbation d @@ -281,7 +281,7 @@ noncomputable def divisionQuotient (d : ℕ) (p : L1Coeff (A × ℕ)) (hp : ‖p divisionInverse d p hp (highShift d f) /-- Proof-independent quotient map, defined on all coefficient pairs by total ring inversion. -/ -noncomputable def divisionQuotientGlobal (d : ℕ) +@[expose] noncomputable def divisionQuotientGlobal (d : ℕ) (pf : L1Coeff (A × ℕ) × L1Coeff (A × ℕ)) : L1Coeff (A × ℕ) := Ring.inverse (1 + divisionPerturbation d pf.1) (highShift d pf.2) @@ -319,14 +319,14 @@ theorem analyticAt_inverseOneAdd_apply simpa [op, Function.comp_def] using hcomp /-- Extract the divisor perturbation operator from divisor/dividend input. -/ -def divisionOperatorInput (d : ℕ) : +@[expose] def divisionOperatorInput (d : ℕ) : (L1Coeff (A × ℕ) × L1Coeff (A × ℕ)) →L[ℂ] (L1Coeff (A × ℕ) →L[ℂ] L1Coeff (A × ℕ)) := divisionPerturbationMap d ∘L ContinuousLinearMap.fst ℂ (L1Coeff (A × ℕ)) (L1Coeff (A × ℕ)) /-- Extract and high-shift the right-hand side from divisor/dividend input. -/ -def divisionRhsInput (d : ℕ) : +@[expose] def divisionRhsInput (d : ℕ) : (L1Coeff (A × ℕ) × L1Coeff (A × ℕ)) →L[ℂ] L1Coeff (A × ℕ) := highShiftCLM d ∘L ContinuousLinearMap.snd ℂ (L1Coeff (A × ℕ)) (L1Coeff (A × ℕ)) @@ -435,7 +435,7 @@ end Division section NatDivision /-- Delete the first `d` coefficients of a one-variable `ℓ¹` sequence. -/ -def seqHighShift (d : ℕ) (f : L1Coeff ℕ) : L1Coeff ℕ := +@[expose] def seqHighShift (d : ℕ) (f : L1Coeff ℕ) : L1Coeff ℕ := ⟨fun n ↦ f (n + d), by apply memℓp_gen simpa [Function.comp_def] using @@ -467,7 +467,7 @@ lemma seqHighShift_smul (d : ℕ) (c : ℂ) (f : L1Coeff ℕ) : rfl /-- High shift on one-variable sequences as a contraction. -/ -def seqHighShiftCLM (d : ℕ) : L1Coeff ℕ →L[ℂ] L1Coeff ℕ := +@[expose] def seqHighShiftCLM (d : ℕ) : L1Coeff ℕ →L[ℂ] L1Coeff ℕ := ({ toFun := seqHighShift d map_add' := seqHighShift_add d @@ -572,7 +572,7 @@ theorem seqLowShift_highShift_add_lowCut (d : ℕ) (f : L1Coeff ℕ) : simp [Nat.sub_add_cancel (Nat.le_of_not_gt hn)] /-- The high-shifted convolution perturbation `S_d C_p` on `ℓ¹(ℕ)`. -/ -def seqDivisionPerturbation (d : ℕ) (p : L1Coeff ℕ) : L1Coeff ℕ →L[ℂ] L1Coeff ℕ := +@[expose] def seqDivisionPerturbation (d : ℕ) (p : L1Coeff ℕ) : L1Coeff ℕ →L[ℂ] L1Coeff ℕ := seqHighShiftCLM d ∘L convolutionRight p @[simp] lemma seqDivisionPerturbation_apply (d : ℕ) (p q : L1Coeff ℕ) : @@ -595,7 +595,7 @@ theorem norm_seqDivisionPerturbation_le (d : ℕ) (p : L1Coeff ℕ) : _ = ‖p‖ := one_mul _ /-- The continuous-linear family of one-variable division perturbations. -/ -def seqDivisionPerturbationMap (d : ℕ) : +@[expose] def seqDivisionPerturbationMap (d : ℕ) : L1Coeff ℕ →L[ℂ] (L1Coeff ℕ →L[ℂ] L1Coeff ℕ) := ({ toFun := seqDivisionPerturbation d @@ -657,18 +657,18 @@ noncomputable def seqDivisionQuotient (d : ℕ) (p : L1Coeff ℕ) (hp : ‖p‖ seqDivisionInverse d p hp (seqHighShift d f) /-- The low-degree remainder sequence produced by division. -/ -noncomputable def seqDivisionRemainder (d : ℕ) (p : L1Coeff ℕ) (hp : ‖p‖ < 1) +@[expose] noncomputable def seqDivisionRemainder (d : ℕ) (p : L1Coeff ℕ) (hp : ‖p‖ < 1) (f : L1Coeff ℕ) : L1Coeff ℕ := seqLowCut d (f - convolution (seqDivisionQuotient d p hp f) p) /-- Extract the sequence perturbation operator from paired input. -/ -def seqDivisionOperatorInput (d : ℕ) : +@[expose] def seqDivisionOperatorInput (d : ℕ) : (L1Coeff ℕ × L1Coeff ℕ) →L[ℂ] (L1Coeff ℕ →L[ℂ] L1Coeff ℕ) := seqDivisionPerturbationMap d ∘L ContinuousLinearMap.fst ℂ (L1Coeff ℕ) (L1Coeff ℕ) /-- Extract and high-shift the sequence right-hand side from paired input. -/ -def seqDivisionRhsInput (d : ℕ) : +@[expose] def seqDivisionRhsInput (d : ℕ) : (L1Coeff ℕ × L1Coeff ℕ) →L[ℂ] L1Coeff ℕ := seqHighShiftCLM d ∘L ContinuousLinearMap.snd ℂ (L1Coeff ℕ) (L1Coeff ℕ) diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PolynomialEvaluation.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PolynomialEvaluation.lean index 1a3562bca5..1301593cd1 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PolynomialEvaluation.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PolynomialEvaluation.lean @@ -16,7 +16,7 @@ These lemmas translate the normalized sequence factorization into the monic polynomial identity used by the public preparation witness. -/ -@[expose] public section +public section open Finset open scoped ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PowerSeries.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PowerSeries.lean index 16334678b6..b9a8bb9445 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PowerSeries.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/L1PowerSeries.lean @@ -19,7 +19,7 @@ zero. The proof packages the coordinate evaluations into an operator-valued formal multilinear series with radius at least one. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology noncomputable section @@ -31,7 +31,7 @@ namespace ClassicalComplexWPT abbrev L1Sequence := L1Coeff ℕ /-- Evaluation of the `k`-th coefficient as a continuous linear functional. -/ -noncomputable def coefficientEval (k : ℕ) : L1Sequence →L[ℂ] ℂ := +@[expose] noncomputable def coefficientEval (k : ℕ) : L1Sequence →L[ℂ] ℂ := lp.evalCLM ℂ (fun _ : ℕ ↦ ℂ) 1 k theorem norm_coefficientEval_le (k : ℕ) : ‖coefficientEval k‖ ≤ 1 := by @@ -41,7 +41,7 @@ theorem norm_coefficientEval_le (k : ℕ) : ‖coefficientEval k‖ ≤ 1 := by simpa using lp.norm_apply_le_norm (by norm_num) a k /-- The operator-valued series `w ↦ (a ↦ ∑ k, a k * w^k)`. -/ -noncomputable def l1OperatorSeries : +@[expose] noncomputable def l1OperatorSeries : FormalMultilinearSeries ℂ ℂ (L1Sequence →L[ℂ] ℂ) := fun k ↦ (ContinuousMultilinearMap.mkPiAlgebraFin ℂ k ℂ).smulRight (coefficientEval k) @@ -56,7 +56,7 @@ theorem one_le_radius_l1OperatorSeries : 1 ≤ l1OperatorSeries.radius := by simpa using norm_l1OperatorSeries_le k /-- The continuous-linear evaluation operator at `w`. -/ -noncomputable def l1EvalOperator (w : ℂ) : L1Sequence →L[ℂ] ℂ := +@[expose] noncomputable def l1EvalOperator (w : ℂ) : L1Sequence →L[ℂ] ℂ := l1OperatorSeries.sum w theorem analyticAt_l1EvalOperator : AnalyticAt ℂ l1EvalOperator 0 := by @@ -64,7 +64,7 @@ theorem analyticAt_l1EvalOperator : AnalyticAt ℂ l1EvalOperator 0 := by (lt_of_lt_of_le (by norm_num : (0 : ℝ≥0∞) < 1) one_le_radius_l1OperatorSeries)).analyticAt /-- Evaluate an `ℓ¹` sequence as a one-variable power series. -/ -noncomputable def evalL1PowerSeries (a : L1Sequence) (w : ℂ) : ℂ := +@[expose] noncomputable def evalL1PowerSeries (a : L1Sequence) (w : ℂ) : ℂ := l1EvalOperator w a /-- Evaluation is jointly analytic in the sequence and scalar at scalar coordinate zero. -/ diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Main.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Main.lean index 3a52c47602..fe1ca037e4 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Main.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/Main.lean @@ -16,7 +16,7 @@ This module assembles the general analytic existence construction and its full germ uniqueness theorem into the exact independently frozen public result. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalSum.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalSum.lean index 31d691ae36..3ff6f95e7f 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalSum.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalSum.lean @@ -16,7 +16,7 @@ with one common positive-radius majorant lets us exchange the family sum and the homogeneous-degree sum and produces a `HasFPowerSeriesOnBall` witness. -/ -@[expose] public section +public section open Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalizedCoefficients.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalizedCoefficients.lean index 97f340da2b..6ba34b7606 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalizedCoefficients.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/NormalizedCoefficients.lean @@ -17,7 +17,7 @@ degree-`d` monomial in the ordinary complex `ℓ¹` norm. This is the Archimedean tail-scaling estimate needed by the Banach-algebra proof. -/ -@[expose] public section +public section open Filter open scoped BigOperators ENNReal NNReal Topology @@ -42,7 +42,7 @@ noncomputable def monomialSeq (d : ℕ) : OriginSeq := lp.single 1 d 1 simp [monomialSeq, lp.single_apply, h] /-- Diagonal rescaling of an `ℓ¹` sequence by powers of `t ≤ 1`. -/ -noncomputable def scaleSeq (t : ℝ≥0) (ht : t ≤ 1) (f : OriginSeq) : OriginSeq := +@[expose] noncomputable def scaleSeq (t : ℝ≥0) (ht : t ≤ 1) (f : OriginSeq) : OriginSeq := ⟨fun k ↦ (t : ℂ) ^ k * f k, by apply memℓp_gen have hs : Summable (fun k ↦ ‖(t : ℂ) ^ k * f k‖) := @@ -57,7 +57,7 @@ noncomputable def scaleSeq (t : ℝ≥0) (ht : t ≤ 1) (f : OriginSeq) : Origin scaleSeq t ht f k = (t : ℂ) ^ k * f k := rfl /-- Rescale a sequence and normalize its coefficient in degree `d` to one. -/ -noncomputable def normalizedScale (t : ℝ≥0) (ht : t ≤ 1) +@[expose] noncomputable def normalizedScale (t : ℝ≥0) (ht : t ≤ 1) (f : OriginSeq) (d : ℕ) : OriginSeq := ((scaleSeq t ht f d)⁻¹) • scaleSeq t ht f @@ -155,7 +155,7 @@ theorem exists_scale_normalized_close_half (f : OriginSeq) (d : ℕ) nlinarith /-- Distinguished-variable coefficients at the base origin, weighted by `R^k`. -/ -noncomputable def originWeightedCoeffs {n : ℕ} +@[expose] noncomputable def originWeightedCoeffs {n : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (R : ℝ≥0) (hR : (R : ℝ≥0∞) < p.radius) : OriginSeq := ⟨fun k ↦ (R : ℂ) ^ k * lastTaylorCoefficient p k 0, by @@ -220,7 +220,7 @@ lemma scaleSeq_originWeightedCoeffs {n : ℕ} ring /-- Normalize the radially weighted Taylor coefficients at the origin. -/ -noncomputable def normalizedOriginCoeffs {n : ℕ} +@[expose] noncomputable def normalizedOriginCoeffs {n : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (r : ℝ≥0) (hr : (r : ℝ≥0∞) < p.radius) (d : ℕ) : OriginSeq := ((originWeightedCoeffs p r hr d)⁻¹) • originWeightedCoeffs p r hr @@ -262,7 +262,7 @@ theorem exists_radius_normalizedOrigin_close_half {n d : ℕ} {f : Ambient n → exact hclose /-- Normalize any analytic coefficient map by a fixed scalar. -/ -noncomputable def normalizedCoefficientMap {n : ℕ} +@[expose] noncomputable def normalizedCoefficientMap {n : ℕ} (C : Base n → OriginSeq) (denom : ℂ) : Base n → OriginSeq := fun z ↦ denom⁻¹ • C z @@ -291,7 +291,7 @@ theorem eventually_norm_normalizedCoefficientMap_sub_monomial_lt_one {n d : ℕ} /-- The analytic weighted coefficient map normalized by its degree-`d` coefficient at the base origin. -/ -noncomputable def analyticNormalizedCoefficientMap {n : ℕ} +@[expose] noncomputable def analyticNormalizedCoefficientMap {n : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (r : ℝ≥0) (hr : (r : ℝ≥0∞) < p.radius) (d : ℕ) : Base n → OriginSeq := normalizedCoefficientMap (weightedCoefficientSeries p r).sum diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationSequences.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationSequences.lean index 231e283531..7eda8587c6 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationSequences.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationSequences.lean @@ -18,7 +18,7 @@ forces the remainder to vanish and the quotient to have constant coefficient one. -/ -@[expose] public section +public section open Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationUniqueness.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationUniqueness.lean index 08abf32c2b..9773cc02c4 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationUniqueness.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PreparationUniqueness.lean @@ -33,7 +33,7 @@ Since both remainders are supported in degrees below `d`, uniqueness of division identifies both the quotient and the remainder. -/ -@[expose] public section +public section open Filter open scoped ENNReal NNReal Topology @@ -75,7 +75,7 @@ convolution. -/ /-- The normalized weighted low-degree tail of a prepared polynomial. Its `i`-th coordinate is `r^i / r^d * a_i(z)`; adding the shifted constant sequence gives the coefficients of `r^{-d} P(z,rw)`. -/ -noncomputable def preparedTailSeq {n : ℕ} (r : ℝ≥0) (d : ℕ) +@[expose] noncomputable def preparedTailSeq {n : ℕ} (r : ℝ≥0) (d : ℕ) (a : Fin d → Base n → ℂ) (z : Base n) : L1Sequence := ∑ i : Fin d, (((r : ℂ) ^ d)⁻¹ * (r : ℂ) ^ (i : ℕ)) • lp.single 1 (i : ℕ) (a i z) diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PublicExistence.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PublicExistence.lean index 4c4e1b5972..584acff4e6 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PublicExistence.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/PublicExistence.lean @@ -18,7 +18,7 @@ from the normalized `ℓ¹(ℕ)` quotient/remainder supplied by `PreparationSequences`. -/ -@[expose] public section +public section open Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedCoefficientMap.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedCoefficientMap.lean index ad159d3095..05335b1da7 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedCoefficientMap.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedCoefficientMap.lean @@ -23,7 +23,7 @@ ultrametric multiplication estimates for restricted or Gauss-norm power series. -/ -@[expose] public section +public section open scoped NNReal ENNReal Topology @@ -34,7 +34,7 @@ namespace ClassicalComplexWPT noncomputable abbrev WeightedSeq := lp (fun _ : ℕ ↦ ℂ) 1 /-- Include the base variables into the ambient space at last coordinate zero. -/ -noncomputable def baseInclusion (n : ℕ) : Base n →L[ℂ] Ambient n := +@[expose] noncomputable def baseInclusion (n : ℕ) : Base n →L[ℂ] Ambient n := ContinuousLinearMap.inl ℂ (Base n) ℂ /-- Evaluate a multilinear form on copies of the last coordinate direction. -/ @@ -410,7 +410,7 @@ theorem weightedCoefficientSeries_sum_apply_lastTaylorCoefficient {n : ℕ} weightedCoefficientSeries_sum_apply p r z j hr hzq hzp /-- The weighted last-direction Taylor coefficients at an ambient point. -/ -noncomputable def weightedLastCoeffs {n : ℕ} +@[expose] noncomputable def weightedLastCoeffs {n : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (r : ℝ≥0) (x : Ambient n) (hr : (r : ℝ≥0∞) < (p.changeOrigin x).radius) : WeightedSeq := ⟨fun k ↦ (r : ℂ) ^ k * p.changeOrigin x k (fun _ ↦ lastDirection n), by diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedEvaluation.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedEvaluation.lean index be3d0f9ff8..900e731909 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedEvaluation.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedEvaluation.lean @@ -17,7 +17,7 @@ change-of-origin expansion converges. A second theorem identifies the result with any function represented by that series on a ball. -/ -@[expose] public section +public section open scoped ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedGermEvaluation.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedGermEvaluation.lean index c594948a6a..10e6c6008d 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedGermEvaluation.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedGermEvaluation.lean @@ -17,7 +17,7 @@ This file packages their simultaneous neighborhood shrinking into the germ identity needed by preparation and uniqueness. -/ -@[expose] public section +public section open Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean index 852aaf4568..1f15b351a9 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean @@ -17,7 +17,7 @@ high shifts and low cuts have operator norm at most one, and evaluation on the unit polydisc is bounded by the `ℓ¹` norm. -/ -@[expose] public section +public section open Finset open scoped ENNReal NNReal Topology @@ -45,7 +45,7 @@ section Convolution variable {A : Type*} [AddCommMonoid A] [Finset.HasAntidiagonal A] /-- Antidiagonal Cauchy product of two `ℓ¹` coefficient families. -/ -def convolutionFun (f g : L1Coeff A) (n : A) : ℂ := +@[expose] def convolutionFun (f g : L1Coeff A) (n : A) : ℂ := ∑ kl ∈ Finset.antidiagonal n, f kl.1 * g kl.2 lemma summable_antidiagonal_norm_product (f g : L1Coeff A) : @@ -67,7 +67,7 @@ lemma summable_norm_convolutionFun (f g : L1Coeff A) : exact norm_mul_le _ _ /-- Antidiagonal convolution as an `ℓ¹` coefficient family. -/ -def convolution (f g : L1Coeff A) : L1Coeff A := +@[expose] def convolution (f g : L1Coeff A) : L1Coeff A := ⟨convolutionFun f g, by apply memℓp_gen simpa using summable_norm_convolutionFun f g⟩ @@ -115,13 +115,13 @@ lemma convolution_smul_left (c : ℂ) (f g : L1Coeff A) : Finset.mul_sum] /-- Right convolution as a linear map. -/ -def convolutionRightLinear (g : L1Coeff A) : L1Coeff A →ₗ[ℂ] L1Coeff A where +@[expose] def convolutionRightLinear (g : L1Coeff A) : L1Coeff A →ₗ[ℂ] L1Coeff A where toFun f := convolution f g map_add' f₁ f₂ := convolution_add_left f₁ f₂ g map_smul' c f := convolution_smul_left c f g /-- Right convolution as a continuous linear map. -/ -def convolutionRight (g : L1Coeff A) : L1Coeff A →L[ℂ] L1Coeff A := +@[expose] def convolutionRight (g : L1Coeff A) : L1Coeff A →L[ℂ] L1Coeff A := (convolutionRightLinear g).mkContinuous ‖g‖ (fun f ↦ by change ‖convolution f g‖ ≤ ‖g‖ * ‖f‖ simpa [mul_comm] using norm_convolution_le f g) @@ -142,7 +142,7 @@ section DistinguishedShift variable {A : Type*} /-- Index map which discards the first `d` distinguished-variable coefficients. -/ -def highIndex (d : ℕ) : A × ℕ → A × ℕ := fun x ↦ (x.1, x.2 + d) +@[expose] def highIndex (d : ℕ) : A × ℕ → A × ℕ := fun x ↦ (x.1, x.2 + d) lemma highIndex_injective (d : ℕ) : Function.Injective (highIndex (A := A) d) := by rintro ⟨a, n⟩ ⟨b, m⟩ h @@ -150,7 +150,7 @@ lemma highIndex_injective (d : ℕ) : Function.Injective (highIndex (A := A) d) exact ⟨h.1, Nat.add_right_cancel h.2⟩ /-- Delete the first `d` distinguished-variable coefficient layers. -/ -def highShift (d : ℕ) (f : L1Coeff (A × ℕ)) : L1Coeff (A × ℕ) := +@[expose] def highShift (d : ℕ) (f : L1Coeff (A × ℕ)) : L1Coeff (A × ℕ) := ⟨fun x ↦ f (highIndex d x), by apply memℓp_gen simpa [Function.comp_def] using @@ -185,13 +185,13 @@ lemma highShift_smul (d : ℕ) (c : ℂ) (f : L1Coeff (A × ℕ)) : rfl /-- High shift as a complex-linear map. -/ -def highShiftLinear (d : ℕ) : L1Coeff (A × ℕ) →ₗ[ℂ] L1Coeff (A × ℕ) where +@[expose] def highShiftLinear (d : ℕ) : L1Coeff (A × ℕ) →ₗ[ℂ] L1Coeff (A × ℕ) where toFun := highShift d map_add' := highShift_add d map_smul' := highShift_smul d /-- High shift as a contraction. -/ -def highShiftCLM (d : ℕ) : L1Coeff (A × ℕ) →L[ℂ] L1Coeff (A × ℕ) := +@[expose] def highShiftCLM (d : ℕ) : L1Coeff (A × ℕ) →L[ℂ] L1Coeff (A × ℕ) := (highShiftLinear d).mkContinuous 1 (by intro f change ‖highShift d f‖ ≤ 1 * ‖f‖ diff --git a/LeanPool/LocalComplexGeometry/FiniteProjection/Main.lean b/LeanPool/LocalComplexGeometry/FiniteProjection/Main.lean index b3a60f0f1d..41e4a67ee1 100644 --- a/LeanPool/LocalComplexGeometry/FiniteProjection/Main.lean +++ b/LeanPool/LocalComplexGeometry/FiniteProjection/Main.lean @@ -20,7 +20,7 @@ This module exposes the frozen algebraic predicate and combines the prepared quotient power basis with the genuine local proper finite-projection theorem. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -40,7 +40,7 @@ def baseInclusion (n : ℕ) : lowerDimensionalInclusion n /-- The principal ideal of a hypersurface germ. -/ -def hypersurfaceIdeal {n : ℕ} (f : HolomorphicGerm (n + 1)) : +@[expose] def hypersurfaceIdeal {n : ℕ} (f : HolomorphicGerm (n + 1)) : Ideal (HolomorphicGerm (n + 1)) := Ideal.span ({f} : Set (HolomorphicGerm (n + 1))) @@ -57,7 +57,7 @@ def hypersurfaceBaseRingHom {n : ℕ} /-- A noncircular finite-free rank-`d` predicate with the explicit power basis `1,w,...,w^(d-1)`. -/ -def IsFiniteFreeOfRankOverBase {n : ℕ} +@[expose] def IsFiniteFreeOfRankOverBase {n : ℕ} (f : HolomorphicGerm (n + 1)) (d : ℕ) : Prop := let q := Ideal.Quotient.mk (hypersurfaceIdeal f) letI : Algebra (HolomorphicGerm n) (HypersurfaceQuotient f) := diff --git a/LeanPool/LocalComplexGeometry/FiniteProjection/PreparedQuotient.lean b/LeanPool/LocalComplexGeometry/FiniteProjection/PreparedQuotient.lean index 8dde88102b..a9d6428d48 100644 --- a/LeanPool/LocalComplexGeometry/FiniteProjection/PreparedQuotient.lean +++ b/LeanPool/LocalComplexGeometry/FiniteProjection/PreparedQuotient.lean @@ -17,7 +17,7 @@ Transporting the standard function-space basis gives the classes of `1, w, ..., w^(d-1)`. -/ -@[expose] public section +public section open scoped BigOperators @@ -29,14 +29,14 @@ noncomputable section /-- The principal ideal generated by a fixed prepared polynomial germ. -/ -def preparedPolynomialIdeal {n d : ℕ} +@[expose] def preparedPolynomialIdeal {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) : Ideal (HolomorphicGerm (n + 1)) := Ideal.span ({preparedPolynomialGerm a ha} : Set (HolomorphicGerm (n + 1))) /-- Assemble a degree-`< d` polynomial from its coefficient vector, as a base-linear map. -/ -def remainderPolynomialGermLinearMap (n d : ℕ) : +@[expose] def remainderPolynomialGermLinearMap (n d : ℕ) : (Fin d → HolomorphicGerm n) →ₗ[HolomorphicGerm n] HolomorphicGerm (n + 1) where toFun := remainderPolynomialGerm @@ -44,7 +44,7 @@ def remainderPolynomialGermLinearMap (n d : ℕ) : map_smul' := remainderPolynomialGerm_smul /-- Remainder descends to the quotient by the prepared polynomial. -/ -def preparedQuotientRemainderLinearMap {n d : ℕ} +@[expose] def preparedQuotientRemainderLinearMap {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (ha0 : ∀ i, a i 0 = 0) : (HolomorphicGerm (n + 1) ⧸ preparedPolynomialIdeal a ha) →ₗ[HolomorphicGerm n] @@ -69,7 +69,7 @@ theorem preparedQuotientRemainderLinearMap_mk {n d : ℕ} /-- The inverse map sends a coefficient vector to the class of its remainder polynomial. -/ -def preparedQuotientRemainderSection {n d : ℕ} +@[expose] def preparedQuotientRemainderSection {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) : (Fin d → HolomorphicGerm n) →ₗ[HolomorphicGerm n] (HolomorphicGerm (n + 1) ⧸ preparedPolynomialIdeal a ha) := @@ -134,7 +134,7 @@ theorem preparedQuotientRemainder_leftInverse {n d : ℕ} /-- The quotient by a prepared polynomial, as a base-linear copy of its degree-`< d` coefficient vectors. -/ -def preparedQuotientRemainderEquiv {n d : ℕ} +@[expose] def preparedQuotientRemainderEquiv {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (ha0 : ∀ i, a i 0 = 0) : (HolomorphicGerm (n + 1) ⧸ preparedPolynomialIdeal a ha) ≃ₗ[HolomorphicGerm n] diff --git a/LeanPool/LocalComplexGeometry/Geometry/FiniteProjection.lean b/LeanPool/LocalComplexGeometry/Geometry/FiniteProjection.lean index 6016d55314..acda99b512 100644 --- a/LeanPool/LocalComplexGeometry/Geometry/FiniteProjection.lean +++ b/LeanPool/LocalComplexGeometry/Geometry/FiniteProjection.lean @@ -18,7 +18,7 @@ preparation. The source is the actual zero locus in an open vertical tube, and properness is asserted over the open base neighborhood itself. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology @@ -31,12 +31,12 @@ noncomputable section /-! ## Coordinate and zero-locus definitions -/ /-- Projection to the first `n` standard complex coordinates. -/ -def dropLastCLM (n : ℕ) : +@[expose] def dropLastCLM (n : ℕ) : ComplexEuclidean (n + 1) →L[ℂ] ComplexEuclidean n := baseProjectionCLM n /-- Append a distinguished last coordinate. -/ -def appendLastCLE (n : ℕ) : +@[expose] def appendLastCLE (n : ℕ) : (ComplexEuclidean n × ℂ) ≃L[ℂ] ComplexEuclidean (n + 1) := (wptAmbientEquiv n).symm @@ -63,7 +63,7 @@ theorem wptAmbientEquiv_eq_dropLast_lastCoordinate (n : ℕ) rfl /-- Evaluation of a monic prepared polynomial in its base and last variables. -/ -def preparedValue {n d : ℕ} +@[expose] def preparedValue {n d : ℕ} (a : Fin d → ComplexEuclidean n → ℂ) (z : ComplexEuclidean n) (w : ℂ) : ℂ := w ^ d + ∑ i, a i z * w ^ (i : ℕ) @@ -85,7 +85,7 @@ abbrev LocalHypersurface {n : ℕ} ‖lastCoordinateCLM n x‖ < R ∧ F x = 0} /-- Projection of the local hypersurface to its open base. -/ -def localProjection {n : ℕ} +@[expose] def localProjection {n : ℕ} (F : ComplexEuclidean (n + 1) → ℂ) (U : Set (ComplexEuclidean n)) (R : ℝ) : LocalHypersurface F U R → U := @@ -105,7 +105,7 @@ An explicit local finite projection, including analytic preparation on a tube, vertical boundary control, finite fibers, surjectivity, and genuine properness over the open base `U`. -/ -def HasGeometricFiniteProjection {n : ℕ} +@[expose] def HasGeometricFiniteProjection {n : ℕ} (F : ComplexEuclidean (n + 1) → ℂ) (d : ℕ) : Prop := ∃ (a : Fin d → ComplexEuclidean n → ℂ) (u : ComplexEuclidean (n + 1) → ℂ) @@ -135,7 +135,7 @@ def HasGeometricFiniteProjection {n : ℕ} /-! ## The polynomial associated to one vertical fiber -/ /-- The prepared value at `z`, regarded as a polynomial in the last variable. -/ -def preparedPolynomialAt {n d : ℕ} +@[expose] def preparedPolynomialAt {n d : ℕ} (a : Fin d → ComplexEuclidean n → ℂ) (z : ComplexEuclidean n) : Polynomial ℂ := Polynomial.X ^ d + diff --git a/LeanPool/LocalComplexGeometry/Germs/Basic.lean b/LeanPool/LocalComplexGeometry/Germs/Basic.lean index f02a68cd2d..80e10ddc0c 100644 --- a/LeanPool/LocalComplexGeometry/Germs/Basic.lean +++ b/LeanPool/LocalComplexGeometry/Germs/Basic.lean @@ -22,7 +22,7 @@ the same `Filter.Germ` model and `AnalyticAt` predicate as the pinned WPT project. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -40,7 +40,7 @@ abbrev FunctionGerm (n : ℕ) := Filter.Germ (𝓝 (0 : ComplexEuclidean n)) ℂ /-- Function germs which have a representative analytic at the origin. -/ -def holomorphicGermSubring (n : ℕ) : Subring (FunctionGerm n) where +@[expose] def holomorphicGermSubring (n : ℕ) : Subring (FunctionGerm n) where carrier := {φ | ∃ f : ComplexEuclidean n → ℂ, AnalyticAt ℂ f 0 ∧ (f : FunctionGerm n) = φ} zero_mem' := ⟨0, analyticAt_const, rfl⟩ @@ -59,7 +59,7 @@ def holomorphicGermSubring (n : ℕ) : Subring (FunctionGerm n) where abbrev HolomorphicGerm (n : ℕ) := holomorphicGermSubring n /-- Pass from an analytic representative to its holomorphic germ. -/ -def HolomorphicGerm.ofFunction {n : ℕ} (f : ComplexEuclidean n → ℂ) +@[expose] def HolomorphicGerm.ofFunction {n : ℕ} (f : ComplexEuclidean n → ℂ) (hf : AnalyticAt ℂ f 0) : HolomorphicGerm n := ⟨(f : FunctionGerm n), ⟨f, hf, rfl⟩⟩ @@ -76,7 +76,7 @@ theorem HolomorphicGerm.exists_rep {n : ℕ} (φ : HolomorphicGerm n) : φ.property /-- Evaluation at the origin, as a ring homomorphism. -/ -def evalAtOriginHom (n : ℕ) : HolomorphicGerm n →+* ℂ := +@[expose] def evalAtOriginHom (n : ℕ) : HolomorphicGerm n →+* ℂ := (Filter.Germ.valueRingHom : FunctionGerm n →+* ℂ).comp (holomorphicGermSubring n).subtype diff --git a/LeanPool/LocalComplexGeometry/Germs/Coordinates.lean b/LeanPool/LocalComplexGeometry/Germs/Coordinates.lean index efda4ea044..e100e3ce03 100644 --- a/LeanPool/LocalComplexGeometry/Germs/Coordinates.lean +++ b/LeanPool/LocalComplexGeometry/Germs/Coordinates.lean @@ -18,7 +18,7 @@ contravariant pullback homomorphisms on holomorphic germs, the inclusion of lower-dimensional base germs, and the resulting algebra structure. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -31,7 +31,7 @@ noncomputable section /-! ## The standard successor-coordinate splitting -/ /-- Split the last coordinate of `ℂⁿ⁺¹`, as a complex-linear equivalence. -/ -def wptAmbientLinearEquiv (n : ℕ) : +@[expose] def wptAmbientLinearEquiv (n : ℕ) : ComplexEuclidean (n + 1) ≃ₗ[ℂ] ClassicalComplexWPT.Ambient n where toFun x := (fun i ↦ x i.castSucc, x (Fin.last n)) invFun x := Fin.lastCases x.2 x.1 @@ -49,7 +49,7 @@ def wptAmbientLinearEquiv (n : ℕ) : The codomain is definitionally WPT's `(Fin n → ℂ) × ℂ` ambient space. -/ -def wptAmbientEquiv (n : ℕ) : +@[expose] def wptAmbientEquiv (n : ℕ) : ComplexEuclidean (n + 1) ≃L[ℂ] ClassicalComplexWPT.Ambient n := (wptAmbientLinearEquiv n).toContinuousLinearEquiv @@ -120,7 +120,7 @@ theorem eventuallyEq_comp_wptAmbientEquiv_iff (n : ℕ) /-! ## Pullback of function germs and holomorphic germs -/ /-- Precomposition of function germs by a continuous linear map fixing the origin. -/ -def functionGermPullbackHom {n m : ℕ} +@[expose] def functionGermPullbackHom {n m : ℕ} (L : ComplexEuclidean n →L[ℂ] ComplexEuclidean m) : FunctionGerm m →+* FunctionGerm n where toFun φ := φ.compTendsto L (by @@ -231,7 +231,7 @@ theorem functionGermPullbackHom_rightInverse {n m : ℕ} rfl /-- Pullback of holomorphic germs by a continuous complex-linear map. -/ -def holomorphicGermPullbackHom {n m : ℕ} +@[expose] def holomorphicGermPullbackHom {n m : ℕ} (L : ComplexEuclidean n →L[ℂ] ComplexEuclidean m) : HolomorphicGerm m →+* HolomorphicGerm n where toFun φ := @@ -302,7 +302,7 @@ theorem holomorphicGermPullbackHom_comp {n m k : ℕ} The direction is contravariant: an equivalence `L : ℂⁿ ≃L[ℂ] ℂᵐ` induces an equivalence from germs on `ℂᵐ` to germs on `ℂⁿ`. -/ -def coordinatePullback {n m : ℕ} +@[expose] def coordinatePullback {n m : ℕ} (L : ComplexEuclidean n ≃L[ℂ] ComplexEuclidean m) : HolomorphicGerm m ≃+* HolomorphicGerm n where toFun := holomorphicGermPullbackHom @@ -370,7 +370,7 @@ theorem coordinatePullback_symm {n m : ℕ} /-! ## Base inclusion and the last coordinate -/ /-- Projection from `ℂⁿ⁺¹` to its first `n` coordinates. -/ -def baseProjectionCLM (n : ℕ) : +@[expose] def baseProjectionCLM (n : ℕ) : ComplexEuclidean (n + 1) →L[ℂ] ComplexEuclidean n := (ContinuousLinearMap.fst ℂ (ComplexEuclidean n) ℂ).comp (wptAmbientEquiv n : ComplexEuclidean (n + 1) →L[ℂ] @@ -398,7 +398,7 @@ theorem baseSectionCLM_last (n : ℕ) (z : ComplexEuclidean n) : simp [baseSectionCLM] /-- Extraction of the last coordinate of `ℂⁿ⁺¹`. -/ -def lastCoordinateCLM (n : ℕ) : ComplexEuclidean (n + 1) →L[ℂ] ℂ := +@[expose] def lastCoordinateCLM (n : ℕ) : ComplexEuclidean (n + 1) →L[ℂ] ℂ := (ContinuousLinearMap.snd ℂ (ComplexEuclidean n) ℂ).comp (wptAmbientEquiv n : ComplexEuclidean (n + 1) →L[ℂ] ClassicalComplexWPT.Ambient n) @@ -418,7 +418,7 @@ theorem baseProjectionCLM_comp_baseSectionCLM (n : ℕ) : simp /-- Include a base germ as a germ independent of the last coordinate. -/ -def lowerDimensionalInclusion (n : ℕ) : +@[expose] def lowerDimensionalInclusion (n : ℕ) : HolomorphicGerm n →+* HolomorphicGerm (n + 1) := holomorphicGermPullbackHom (baseProjectionCLM n) @@ -483,7 +483,7 @@ theorem lowerDimensionalInclusion_injective (n : ℕ) : rfl /-- The germ of the last coordinate `w` on `ℂⁿ⁺¹`. -/ -def lastCoordinateGerm (n : ℕ) : HolomorphicGerm (n + 1) := +@[expose] def lastCoordinateGerm (n : ℕ) : HolomorphicGerm (n + 1) := HolomorphicGerm.ofFunction (lastCoordinateCLM n) ((lastCoordinateCLM n).analyticAt 0) diff --git a/LeanPool/LocalComplexGeometry/Germs/Representatives.lean b/LeanPool/LocalComplexGeometry/Germs/Representatives.lean index 00e8483408..9ac780a3f6 100644 --- a/LeanPool/LocalComplexGeometry/Germs/Representatives.lean +++ b/LeanPool/LocalComplexGeometry/Germs/Representatives.lean @@ -17,7 +17,7 @@ representative for each germ and retain the theorem identifying its raw function germ. -/ -@[expose] public section +public section namespace LocalComplexGeometry @@ -43,7 +43,7 @@ theorem HolomorphicGerm.coe_representative {n : ℕ} (Classical.choose_spec (HolomorphicGerm.exists_rep f)).2 /-- Chosen representatives of a finite coefficient vector. -/ -def HolomorphicGerm.coefficientRepresentatives {n k : ℕ} +@[expose] def HolomorphicGerm.coefficientRepresentatives {n k : ℕ} (c : Fin k → HolomorphicGerm n) : Fin k → ComplexEuclidean n → ℂ := fun i ↦ HolomorphicGerm.representative (c i) diff --git a/LeanPool/LocalComplexGeometry/Germs/Ring.lean b/LeanPool/LocalComplexGeometry/Germs/Ring.lean index 02ddab5d9f..f6e99b1d80 100644 --- a/LeanPool/LocalComplexGeometry/Germs/Ring.lean +++ b/LeanPool/LocalComplexGeometry/Germs/Ring.lean @@ -20,7 +20,7 @@ This file packages the constant inclusion, identifies the residue field with `ℂ`, and supplies the zero-dimensional base case used by Rückert induction. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -31,7 +31,7 @@ namespace LocalComplexGeometry noncomputable section /-- Embed a complex number as a constant holomorphic germ. -/ -def constantGermHom (n : ℕ) : ℂ →+* HolomorphicGerm n where +@[expose] def constantGermHom (n : ℕ) : ℂ →+* HolomorphicGerm n where toFun c := HolomorphicGerm.ofFunction (fun _ ↦ c) analyticAt_const map_zero' := by apply Subtype.ext @@ -97,7 +97,7 @@ theorem evalAtOrigin_injective_zero : exact hfg0 /-- The zero-dimensional holomorphic germ ring is canonically `ℂ`. -/ -def holomorphicGermZeroEquiv : HolomorphicGerm 0 ≃+* ℂ := +@[expose] def holomorphicGermZeroEquiv : HolomorphicGerm 0 ≃+* ℂ := RingEquiv.ofBijective (evalAtOriginHom 0) ⟨evalAtOrigin_injective_zero, evalAtOrigin_surjective 0⟩ diff --git a/LeanPool/LocalComplexGeometry/Noetherian/Ruckert.lean b/LeanPool/LocalComplexGeometry/Noetherian/Ruckert.lean index 5723bda5d2..73c212b83b 100644 --- a/LeanPool/LocalComplexGeometry/Noetherian/Ruckert.lean +++ b/LeanPool/LocalComplexGeometry/Noetherian/Ruckert.lean @@ -23,7 +23,7 @@ an associated distinguished polynomial, and Weierstrass division maps the ideal into a finite lower-dimensional remainder module. -/ -@[expose] public section +public section namespace LocalComplexGeometry diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/Coordinates.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/Coordinates.lean index df942620e5..a4c302dd1e 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/Coordinates.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/Coordinates.lean @@ -18,7 +18,7 @@ coordinates. This file records that invariance at the predicate-germ level, without evaluating abstract function germs away from the origin. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisibilitySpecialization.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisibilitySpecialization.lean index 2dc1eb8ce5..6ea67d4eab 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisibilitySpecialization.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisibilitySpecialization.lean @@ -22,7 +22,7 @@ denominator, every root of the lifted minimal polynomial is therefore a root of the certified divisible polynomial. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisionRepresentatives.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisionRepresentatives.lean index f8c8f688b4..69f5034369 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisionRepresentatives.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/DivisionRepresentatives.lean @@ -21,7 +21,7 @@ prepared-root locality then specializes it simultaneously at every root of a nearby prepared fiber. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/FiberCancellation.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/FiberCancellation.lean index c02778df32..fd109783e5 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/FiberCancellation.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/FiberCancellation.lean @@ -20,7 +20,7 @@ the good locus, so multiplying by the bad factor extends the conclusion over the exceptional locus as well. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/GenericFiber.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/GenericFiber.lean index 2d5a3d2978..2682a9f0c1 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/GenericFiber.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/GenericFiber.lean @@ -23,7 +23,7 @@ minimal polynomial. The last section clears all coefficients of that minimal polynomial back to the contracted quotient. -/ -@[expose] public section +public section namespace LocalComplexGeometry @@ -50,7 +50,7 @@ abbrev AmbientGermQuotient {n : ℕ} HolomorphicGerm (n + 1) ⧸ P /-- The canonical quotient-base map induced by `lowerDimensionalInclusion`. -/ -def contractedQuotientMap {n : ℕ} +@[expose] def contractedQuotientMap {n : ℕ} (P : Ideal (HolomorphicGerm (n + 1))) : ContractedGermQuotient P →+* AmbientGermQuotient P := algebraMap _ _ @@ -207,20 +207,20 @@ def lastCoordinateQuotientClass {n : ℕ} /-! The explicit polynomials represented by prepared and remainder germs. -/ /-- The analytic coefficient `a i`, regarded as a lower-dimensional germ. -/ -def preparedCoefficientGerm {n d : ℕ} +@[expose] def preparedCoefficientGerm {n d : ℕ} (a : Fin d → ClassicalComplexWPT.Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (i : Fin d) : HolomorphicGerm n := HolomorphicGerm.ofFunction (a i) (ha i) /-- The prepared monic polynomial with coefficients in the base germ ring. -/ -def preparedGermPolynomial {n d : ℕ} +@[expose] def preparedGermPolynomial {n d : ℕ} (a : Fin d → ClassicalComplexWPT.Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) : Polynomial (HolomorphicGerm n) := Polynomial.X ^ d + ∑ i : Fin d, Polynomial.C (preparedCoefficientGerm a ha i) * Polynomial.X ^ (i : ℕ) /-- A WPT coefficient vector, assembled as a polynomial over the base germ ring. -/ -def remainderGermPolynomial {n d : ℕ} +@[expose] def remainderGermPolynomial {n d : ℕ} (r : Fin d → HolomorphicGerm n) : Polynomial (HolomorphicGerm n) := ∑ i : Fin d, Polynomial.C (r i) * Polynomial.X ^ (i : ℕ) @@ -1210,7 +1210,7 @@ theorem ambientGermRemainderModMinpolyLiftCertificate_mem_of_coeff_mem /-- The product of the leading coefficient and the fixed-size derivative resultant is one common specialization bad factor outside the contraction. -/ -def genericMinpolyLiftSpecializationBadFactor {d : ℕ} +@[expose] def genericMinpolyLiftSpecializationBadFactor {d : ℕ} (a : Fin d → ClassicalComplexWPT.Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (ha0 : ∀ i, a i 0 = 0) diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/IdealRepresentatives.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/IdealRepresentatives.lean index 2d0ea09187..ad0081a8d0 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/IdealRepresentatives.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/IdealRepresentatives.lean @@ -18,7 +18,7 @@ file chooses analytic representatives of those generators and records the exact pointwise predicate representing the ideal's local zero-set germ. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -34,7 +34,7 @@ abbrev IdealGeneratorIndex {n : ℕ} (I : Ideal (HolomorphicGerm n)) := idealGeneratorFinset I /-- Chosen analytic representatives of the chosen generators of an ideal. -/ -def idealGeneratorRepresentatives {n : ℕ} +@[expose] def idealGeneratorRepresentatives {n : ℕ} [IsNoetherianRing (HolomorphicGerm n)] (I : Ideal (HolomorphicGerm n)) : IdealGeneratorIndex I → ComplexEuclidean n → ℂ := @@ -68,7 +68,7 @@ theorem idealGenerator_mem {n : ℕ} /-- Pointwise representative of the ideal zero-set germ furnished by the chosen finite generating family. -/ -def idealGeneratorZeroPredicate {n : ℕ} +@[expose] def idealGeneratorZeroPredicate {n : ℕ} [IsNoetherianRing (HolomorphicGerm n)] (I : Ideal (HolomorphicGerm n)) (z : ComplexEuclidean n) : Prop := ∀ f : IdealGeneratorIndex I, idealGeneratorRepresentatives I f z = 0 diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/Main.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/Main.lean index 09effd2932..a8fcf0a88c 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/Main.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/Main.lean @@ -20,7 +20,7 @@ dimension. This module exposes its unconditional ideal-theoretic and representative-level consequences. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/MinpolyResultant.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/MinpolyResultant.lean index 475a157419..178f72f1d5 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/MinpolyResultant.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/MinpolyResultant.lean @@ -20,7 +20,7 @@ away from one analytic exceptional factor, its complex specializations keep their generic degree and have only simple roots. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/OneVariable.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/OneVariable.lean index 4538e4e30f..5ccc390f97 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/OneVariable.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/OneVariable.lean @@ -20,7 +20,7 @@ all generators are zero germs, the common-zero hypothesis forces the target to be the zero germ. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology @@ -33,7 +33,7 @@ noncomputable section /-! ## The standard coordinate on `ComplexEuclidean 1` -/ /-- Evaluation at the unique coordinate, as a complex-linear equivalence. -/ -def oneCoordinateLinearEquiv : ComplexEuclidean 1 ≃ₗ[ℂ] ℂ where +@[expose] def oneCoordinateLinearEquiv : ComplexEuclidean 1 ≃ₗ[ℂ] ℂ where toFun x := x 0 invFun z := fun _ ↦ z left_inv x := by @@ -44,7 +44,7 @@ def oneCoordinateLinearEquiv : ComplexEuclidean 1 ≃ₗ[ℂ] ℂ where map_smul' _ _ := rfl /-- The continuous complex-linear identification `ℂ¹ ≃ ℂ`. -/ -def oneCoordinateEquiv : ComplexEuclidean 1 ≃L[ℂ] ℂ := +@[expose] def oneCoordinateEquiv : ComplexEuclidean 1 ≃L[ℂ] ℂ := oneCoordinateLinearEquiv.toContinuousLinearEquiv @[simp] diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialFibers.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialFibers.lean index da6115a044..51f7b73f90 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialFibers.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialFibers.lean @@ -19,7 +19,7 @@ This file packages that fact for the coefficient-vector convention used by Weierstrass division. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,7 +30,7 @@ noncomputable section /-- A degree-`< d` coefficient vector, evaluated as a polynomial in the last variable at a fixed base point. -/ -def remainderPolynomialAt {n d : ℕ} +@[expose] def remainderPolynomialAt {n d : ℕ} (b : Fin d → ComplexEuclidean n → ℂ) (z : ComplexEuclidean n) : Polynomial ℂ := ∑ i : Fin d, Polynomial.C (b i z) * Polynomial.X ^ (i : ℕ) diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialRepresentativeOperations.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialRepresentativeOperations.lean index 7702f0ae4c..8789917efd 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialRepresentativeOperations.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialRepresentativeOperations.lean @@ -19,7 +19,7 @@ polynomial shapes occurring in Weierstrass division and records independence of an inessential larger degree bound. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialSpecialization.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialSpecialization.lean index 16e2b34d4f..ace2afa317 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialSpecialization.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PolynomialSpecialization.lean @@ -20,7 +20,7 @@ neighborhood. This is the finite-uniformity step needed when cleared generic fiber identities are specialized over the analytic base. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -31,7 +31,7 @@ namespace LocalComplexGeometry noncomputable section /-- The ring homomorphism sending a function to its germ at the origin. -/ -def functionToGermRingHom (n : ℕ) : +@[expose] def functionToGermRingHom (n : ℕ) : (ComplexEuclidean n → ℂ) →+* FunctionGerm n := Filter.Germ.coeRingHom (𝓝 (0 : ComplexEuclidean n)) diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrime.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrime.lean index 2315324a0d..dfea1793ea 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrime.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrime.lean @@ -22,7 +22,7 @@ This file constructs the finite pointwise certificate from generic-fibre data and closes the prepared-prime induction step. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrimeCore.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrimeCore.lean index 8946387584..a2d453b95a 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrimeCore.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedPrimeCore.lean @@ -24,7 +24,7 @@ finite pointwise information used by the geometric argument. Its fields are later furnished by denominator-cleared minimal-polynomial identities. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedRootLocality.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedRootLocality.lean index a4ad8af4d6..73a6b48117 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedRootLocality.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PreparedRootLocality.lean @@ -18,7 +18,7 @@ bridge which allows ambient germ identities to be applied simultaneously to every root of a nearby specialized fiber. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeBase.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeBase.lean index 05512df016..354647e39c 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeBase.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeBase.lean @@ -20,7 +20,7 @@ germ ring there is canonically `ℂ`, so its only prime ideal is zero; the zero ideal has the full neighborhood as its zero-set germ. -/ -@[expose] public section +public section namespace LocalComplexGeometry diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeCancellation.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeCancellation.lean index dbd1a46ceb..5791cf172c 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeCancellation.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeCancellation.lean @@ -20,7 +20,7 @@ the lower-dimensional prime theorem puts the product in the prime, and primality cancels `D`. -/ -@[expose] public section +public section namespace LocalComplexGeometry diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeInduction.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeInduction.lean index 950a993d62..a1a9540ffa 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeInduction.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/PrimeInduction.lean @@ -23,7 +23,7 @@ polynomial. Coordinate invariance then reduces the prime zero-set theorem to the prepared-prime step isolated below. -/ -@[expose] public section +public section namespace LocalComplexGeometry @@ -35,7 +35,7 @@ noncomputable section /-- The single remaining successor step in prepared coordinates. Unlike the comparator theorem, its hypotheses expose the exact prepared polynomial that drives generic-fiber elimination. -/ -def PreparedPrimeZeroSetStep (n : ℕ) : Prop := +@[expose] def PreparedPrimeZeroSetStep (n : ℕ) : Prop := ∀ {d : ℕ} (_hd : 0 < d) (a : Fin d → ClassicalComplexWPT.Base n → ℂ) diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/QuotientPolynomialSpecialization.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/QuotientPolynomialSpecialization.lean index ef88a4fe49..b04187a462 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/QuotientPolynomialSpecialization.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/QuotientPolynomialSpecialization.lean @@ -20,7 +20,7 @@ fixed-degree family of chosen representatives therefore specializes to equal complex polynomials on the ideal's local zero set, on one common neighborhood. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -31,7 +31,7 @@ namespace LocalComplexGeometry noncomputable section /-- Chosen representatives of all coefficients through a fixed degree bound. -/ -def germPolynomialCoefficientRepresentatives {n m : ℕ} +@[expose] def germPolynomialCoefficientRepresentatives {n m : ℕ} (p : Polynomial (HolomorphicGerm n)) : Fin (m + 1) → ComplexEuclidean n → ℂ := fun i ↦ HolomorphicGerm.representative (p.coeff (i : ℕ)) @@ -43,7 +43,7 @@ theorem analyticAt_germPolynomialCoefficientRepresentatives {n m : ℕ} /-- The fixed-degree complex polynomial obtained by specializing the chosen coefficient representatives at a base point. -/ -def germPolynomialRepresentativeAt {n : ℕ} (m : ℕ) +@[expose] def germPolynomialRepresentativeAt {n : ℕ} (m : ℕ) (p : Polynomial (HolomorphicGerm n)) (z : ComplexEuclidean n) : Polynomial ℂ := fixedDegreePolynomialAt diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/RadicalReduction.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/RadicalReduction.lean index dc6cda70fd..c2f75893b9 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/RadicalReduction.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/RadicalReduction.lean @@ -22,7 +22,7 @@ for the radical theorem, the finite-family representative-level theorem, and the arbitrary-ideal zero-set equality. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology @@ -37,7 +37,7 @@ The prime-ideal zero-set statement in complex dimension `n`: every prime ideal is exactly the ideal of holomorphic germs vanishing on the local zero-set germ of any finite generating set selected for that prime. -/ -def PrimeZeroSetProperty (n : ℕ) : Prop := +@[expose] def PrimeZeroSetProperty (n : ℕ) : Prop := ∀ P : Ideal (HolomorphicGerm n), P.IsPrime → vanishingIdeal (idealZeroSetGerm P) = P diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/ResultantSpecialization.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/ResultantSpecialization.lean index 558b2e4f5d..cfb2459d28 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/ResultantSpecialization.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/ResultantSpecialization.lean @@ -20,7 +20,7 @@ are part of every definition, so specialization remains valid even when a fiber drops degree. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology @@ -34,12 +34,12 @@ noncomputable section /-- Assemble coefficients indexed by `Fin (d + 1)` into a polynomial of degree at most `d`. -/ -def fixedDegreePolynomial {R : Type*} [Semiring R] {d : ℕ} +@[expose] def fixedDegreePolynomial {R : Type*} [Semiring R] {d : ℕ} (c : Fin (d + 1) → R) : Polynomial R := ∑ i : Fin (d + 1), Polynomial.C (c i) * Polynomial.X ^ (i : ℕ) /-- Specialize a fixed-degree polynomial family at a parameter. -/ -def fixedDegreePolynomialAt {R X : Type*} [Semiring R] {d : ℕ} +@[expose] def fixedDegreePolynomialAt {R X : Type*} [Semiring R] {d : ℕ} (c : Fin (d + 1) → X → R) (x : X) : Polynomial R := fixedDegreePolynomial (fun i ↦ c i x) diff --git a/LeanPool/LocalComplexGeometry/Nullstellensatz/ZeroSetGerms.lean b/LeanPool/LocalComplexGeometry/Nullstellensatz/ZeroSetGerms.lean index 1c7cf90a0d..bd91d9cd50 100644 --- a/LeanPool/LocalComplexGeometry/Nullstellensatz/ZeroSetGerms.lean +++ b/LeanPool/LocalComplexGeometry/Nullstellensatz/ZeroSetGerms.lean @@ -17,7 +17,7 @@ function germ at points away from the base point. Only finite intersections are used; arbitrary intersections would not have a uniform neighborhood. -/ -@[expose] public section +public section open Filter open scoped Topology @@ -32,7 +32,7 @@ abbrev LocalSetGerm (n : ℕ) := Filter.Germ (𝓝 (0 : ComplexEuclidean n)) Prop /-- The local zero set of a holomorphic function germ. -/ -def germZeroLocus {n : ℕ} (f : HolomorphicGerm n) : LocalSetGerm n := +@[expose] def germZeroLocus {n : ℕ} (f : HolomorphicGerm n) : LocalSetGerm n := Filter.Germ.map (fun z : ℂ ↦ z = 0) (f : FunctionGerm n) @[simp] @@ -115,7 +115,7 @@ theorem germZeroLocus_eq_top_iff {n : ℕ} (f : HolomorphicGerm n) : exact germZeroLocus_zero n /-- Holomorphic germs vanishing on a fixed local set germ form an ideal. -/ -def vanishingIdeal {n : ℕ} (Z : LocalSetGerm n) : Ideal (HolomorphicGerm n) where +@[expose] def vanishingIdeal {n : ℕ} (Z : LocalSetGerm n) : Ideal (HolomorphicGerm n) where carrier := {f | Z ≤ germZeroLocus f} zero_mem' := by simp add_mem' := by @@ -140,13 +140,13 @@ theorem vanishingIdeal_top (n : ℕ) : germZeroLocus_eq_top_iff] /-- Common zero set of a finite family of germs. -/ -def finiteCommonZeroSet {n : ℕ} (S : Finset (HolomorphicGerm n)) : +@[expose] def finiteCommonZeroSet {n : ℕ} (S : Finset (HolomorphicGerm n)) : LocalSetGerm n := S.inf germZeroLocus /-- Common zero-set germ of a finite indexed family. Unlike a `Finset` of germs, this retains the indices used by the comparator-facing certificate. -/ -def indexedCommonZeroSet {n s : ℕ} +@[expose] def indexedCommonZeroSet {n s : ℕ} (f : Fin s → HolomorphicGerm n) : LocalSetGerm n := Finset.univ.inf fun i ↦ germZeroLocus (f i) @@ -292,7 +292,7 @@ theorem finiteCommonZeroSet_eq_of_span_eq {n : ℕ} · exact finiteCommonZeroSet_antitone_span S T h.le /-- A fixed finite generating set selected from Noetherianity. -/ -def idealGeneratorFinset {n : ℕ} [IsNoetherianRing (HolomorphicGerm n)] +@[expose] def idealGeneratorFinset {n : ℕ} [IsNoetherianRing (HolomorphicGerm n)] (I : Ideal (HolomorphicGerm n)) : Finset (HolomorphicGerm n) := Classical.choose (Ideal.fg_of_isNoetherianRing I) @@ -303,7 +303,7 @@ theorem span_idealGeneratorFinset {n : ℕ} Classical.choose_spec (Ideal.fg_of_isNoetherianRing I) /-- The zero-set germ of an ideal, defined through a finite generating set. -/ -def idealZeroSetGerm {n : ℕ} [IsNoetherianRing (HolomorphicGerm n)] +@[expose] def idealZeroSetGerm {n : ℕ} [IsNoetherianRing (HolomorphicGerm n)] (I : Ideal (HolomorphicGerm n)) : LocalSetGerm n := finiteCommonZeroSet (idealGeneratorFinset I) diff --git a/LeanPool/LocalComplexGeometry/Palomar.lean b/LeanPool/LocalComplexGeometry/Palomar.lean index 6f8f81908a..b904bfe7d2 100644 --- a/LeanPool/LocalComplexGeometry/Palomar.lean +++ b/LeanPool/LocalComplexGeometry/Palomar.lean @@ -21,7 +21,7 @@ coordinate, quotient-basis, and local-biholomorphism structures remain in the proof development and are eliminated from the public statement surface. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology diff --git a/LeanPool/LocalComplexGeometry/WPTBridge/Division.lean b/LeanPool/LocalComplexGeometry/WPTBridge/Division.lean index 57b844b171..5052baf45e 100644 --- a/LeanPool/LocalComplexGeometry/WPTBridge/Division.lean +++ b/LeanPool/LocalComplexGeometry/WPTBridge/Division.lean @@ -17,7 +17,7 @@ This file reconstructs function-level analytic quotients and polynomial remainders from the sequence-level division operators. -/ -@[expose] public section +public section open Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/WPTBridge/DivisionCore.lean b/LeanPool/LocalComplexGeometry/WPTBridge/DivisionCore.lean index 306279d812..02274a0ec0 100644 --- a/LeanPool/LocalComplexGeometry/WPTBridge/DivisionCore.lean +++ b/LeanPool/LocalComplexGeometry/WPTBridge/DivisionCore.lean @@ -14,7 +14,7 @@ This file packages the analytic quotient and remainder sequence operators for prepared divisors so the local complex-geometry development can reuse them. -/ -@[expose] public section +public section open Filter open scoped ENNReal NNReal Topology @@ -26,19 +26,19 @@ open ClassicalComplexWPT noncomputable section /-- Analytic divisor-tail/dividend input for WPT's total sequence division maps. -/ -def divisionInput {n d : ℕ} +@[expose] def divisionInput {n d : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (r : ℝ≥0) (a : Fin d → Base n → ℂ) (z : Base n) : L1Sequence × L1Sequence := (preparedTailSeq r d a z, (weightedCoefficientSeries p r).sum z) /-- Sequence quotient supplied by the pinned WPT division operator. -/ -def quotientSeq {n d : ℕ} +@[expose] def quotientSeq {n d : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (r : ℝ≥0) (a : Fin d → Base n → ℂ) (z : Base n) : L1Sequence := seqDivisionQuotientGlobal d (divisionInput p r a z) /-- Sequence remainder supplied by the pinned WPT division operator. -/ -def remainderSeq {n d : ℕ} +@[expose] def remainderSeq {n d : ℕ} (p : FormalMultilinearSeries ℂ (Ambient n) ℂ) (r : ℝ≥0) (a : Fin d → Base n → ℂ) (z : Base n) : L1Sequence := seqDivisionRemainderGlobal d (divisionInput p r a z) diff --git a/LeanPool/LocalComplexGeometry/WPTBridge/DivisionUniqueness.lean b/LeanPool/LocalComplexGeometry/WPTBridge/DivisionUniqueness.lean index aa609a9f20..e2a5932802 100644 --- a/LeanPool/LocalComplexGeometry/WPTBridge/DivisionUniqueness.lean +++ b/LeanPool/LocalComplexGeometry/WPTBridge/DivisionUniqueness.lean @@ -17,7 +17,7 @@ This file proves germ-level uniqueness of the analytic quotient and the finite-degree remainder coefficients. -/ -@[expose] public section +public section open Filter open scoped BigOperators ENNReal NNReal Topology diff --git a/LeanPool/LocalComplexGeometry/WPTBridge/GermDivision.lean b/LeanPool/LocalComplexGeometry/WPTBridge/GermDivision.lean index b1b917a7e7..ec2afd441f 100644 --- a/LeanPool/LocalComplexGeometry/WPTBridge/GermDivision.lean +++ b/LeanPool/LocalComplexGeometry/WPTBridge/GermDivision.lean @@ -18,7 +18,7 @@ the coefficients of the prepared divisor; its coefficients are analytic and vanish at the origin. -/ -@[expose] public section +public section open Filter open scoped BigOperators Topology @@ -32,7 +32,7 @@ noncomputable section /-- The prepared polynomial, written in the standard `Fin (n + 1) -> C` coordinate model used by `HolomorphicGerm`. -/ -def preparedPolynomialFunction {n d : ℕ} +@[expose] def preparedPolynomialFunction {n d : ℕ} (a : Fin d → Base n → ℂ) : ComplexEuclidean (n + 1) → ℂ := fun x ↦ preparedPolynomial d a (wptAmbientEquiv n x) @@ -55,21 +55,21 @@ theorem analyticAt_preparedPolynomialFunction {n d : ℕ} ComplexEuclidean (n + 1) →L[ℂ] Ambient n)) (x := 0) /-- The germ of a fixed prepared polynomial. -/ -def preparedPolynomialGerm {n d : ℕ} +@[expose] def preparedPolynomialGerm {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) : HolomorphicGerm (n + 1) := HolomorphicGerm.ofFunction (preparedPolynomialFunction a) (analyticAt_preparedPolynomialFunction a ha) /-- The degree-`< d` polynomial germ with a prescribed coefficient vector. -/ -def remainderPolynomialGerm {n d : ℕ} +@[expose] def remainderPolynomialGerm {n d : ℕ} (r : Fin d → HolomorphicGerm n) : HolomorphicGerm (n + 1) := ∑ i : Fin d, lowerDimensionalInclusion n (r i) * lastCoordinateGerm n ^ (i : ℕ) /-- A quotient and coefficient vector satisfy Weierstrass division at the level of germs. -/ -def IsPreparedGermDivision {n d : ℕ} +@[expose] def IsPreparedGermDivision {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (h q : HolomorphicGerm (n + 1)) (r : Fin d → HolomorphicGerm n) : Prop := h = q * preparedPolynomialGerm a ha + remainderPolynomialGerm r @@ -374,7 +374,7 @@ def preparedGermDivisionQuotient {n d : ℕ} Classical.choose (exists_preparedGermDivision a ha ha0 h) /-- The canonical coefficient vector of the degree-`< d` remainder. -/ -def preparedGermDivisionRemainder {n d : ℕ} +@[expose] def preparedGermDivisionRemainder {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (ha0 : ∀ i, a i 0 = 0) (h : HolomorphicGerm (n + 1)) : Fin d → HolomorphicGerm n := @@ -469,7 +469,7 @@ theorem preparedGermDivisionRemainder_smul {n d : ℕ} /-- The base-linear coefficient-remainder map supplied by analytic Weierstrass division. -/ -def preparedGermDivisionRemainderLinearMap {n d : ℕ} +@[expose] def preparedGermDivisionRemainderLinearMap {n d : ℕ} (a : Fin d → Base n → ℂ) (ha : ∀ i, AnalyticAt ℂ (a i) 0) (ha0 : ∀ i, a i 0 = 0) : HolomorphicGerm (n + 1) →ₗ[HolomorphicGerm n] diff --git a/LeanPool/LocalComplexGeometry/WPTBridge/Preparation.lean b/LeanPool/LocalComplexGeometry/WPTBridge/Preparation.lean index c96f5fde26..0afc706a41 100644 --- a/LeanPool/LocalComplexGeometry/WPTBridge/Preparation.lean +++ b/LeanPool/LocalComplexGeometry/WPTBridge/Preparation.lean @@ -20,7 +20,7 @@ equality of raw function germs, so downstream commutative-algebra arguments do not depend on a hidden choice of representative. -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/LocalComplexGeometry/WPTBridge/PreparedAssociate.lean b/LeanPool/LocalComplexGeometry/WPTBridge/PreparedAssociate.lean index 95a0201d24..9dc4d15711 100644 --- a/LeanPool/LocalComplexGeometry/WPTBridge/PreparedAssociate.lean +++ b/LeanPool/LocalComplexGeometry/WPTBridge/PreparedAssociate.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.NNReal # The prepared divisor is associate to the regularized germ -/ -@[expose] public section +public section open Filter open scoped Topology @@ -25,7 +25,7 @@ open ClassicalComplexWPT noncomputable section /-- Transport an analytic WPT unit from product coordinates to standard coordinates. -/ -def standardPreparationUnitGerm {n : ℕ} (u : Ambient n → ℂ) +@[expose] def standardPreparationUnitGerm {n : ℕ} (u : Ambient n → ℂ) (hu : AnalyticAt ℂ u 0) : HolomorphicGerm (n + 1) := HolomorphicGerm.ofFunction (fun x ↦ u (wptAmbientEquiv n x)) (by diff --git a/LeanPool/LongGapsBetweenPrimes.lean b/LeanPool/LongGapsBetweenPrimes.lean index 75ea3567aa..2bda0f640f 100644 --- a/LeanPool/LongGapsBetweenPrimes.lean +++ b/LeanPool/LongGapsBetweenPrimes.lean @@ -21,4 +21,4 @@ Tags: analytic-number-theory, prime-gaps, sieve-theory, erdos-rankin MSC: 11N05 -/ -@[expose] public section +public section diff --git a/LeanPool/LongGapsBetweenPrimes/Main.lean b/LeanPool/LongGapsBetweenPrimes/Main.lean index 681941479b..7ec010aaee 100644 --- a/LeanPool/LongGapsBetweenPrimes/Main.lean +++ b/LeanPool/LongGapsBetweenPrimes/Main.lean @@ -37,7 +37,7 @@ The main results are `short_translates` (Proposition 1.2) and κ = 1/8, and a larger fixed constant in the auxiliary smoothness cutoff. -/ -@[expose] public section +public section namespace LongGapsBetweenPrimes noncomputable section @@ -2230,7 +2230,7 @@ lemma assignmentVariance_tuple {P k : ℕ} (hP : Squarefree P) (r : DivisorTuple (hpair : ∀ i j, i ≠ j → Nat.Coprime (r i).val (r j).val) : assignmentVariance (fun p : PrimeIndex P => p.val) (tupleAssignment r) = ∏ i, 1 / ((r i).val.totient : ℝ) := by - rw [assignmentVariance, tupleAssignment_prod r hpair (fun p _ => 1 / ((p.val : ℝ) - 1))] + refine (tupleAssignment_prod r hpair (fun p _ => 1 / ((p.val : ℝ) - 1))).trans ?_ apply Finset.prod_congr rfl intro i _ have hd := (Nat.mem_divisors.mp (r i).property).1 diff --git a/LeanPool/LowDimSolvClassification.lean b/LeanPool/LowDimSolvClassification.lean index 69b3af8498..aa535b4471 100644 --- a/LeanPool/LowDimSolvClassification.lean +++ b/LeanPool/LowDimSolvClassification.lean @@ -27,7 +27,7 @@ Tags: lie-algebras, solvable, classification MSC: 17B30 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/LowDimSolvClassification/Classification1.lean b/LeanPool/LowDimSolvClassification/Classification1.lean index 8a019858d0..ae414df009 100644 --- a/LeanPool/LowDimSolvClassification/Classification1.lean +++ b/LeanPool/LowDimSolvClassification/Classification1.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.GCD # LeanPool.LowDimSolvClassification.Classification1 -/ -@[expose] public section +public section open Module open Submodule diff --git a/LeanPool/LowDimSolvClassification/Classification2.lean b/LeanPool/LowDimSolvClassification/Classification2.lean index a9b1b99432..1f13cc03cc 100644 --- a/LeanPool/LowDimSolvClassification/Classification2.lean +++ b/LeanPool/LowDimSolvClassification/Classification2.lean @@ -12,7 +12,7 @@ import LeanPool.LowDimSolvClassification.Classification1 # LeanPool.LowDimSolvClassification.Classification2 -/ -@[expose] public section +public section open Module open Submodule diff --git a/LeanPool/LowDimSolvClassification/Classification3.lean b/LeanPool/LowDimSolvClassification/Classification3.lean index 27ee296576..08d0eaf8b6 100644 --- a/LeanPool/LowDimSolvClassification/Classification3.lean +++ b/LeanPool/LowDimSolvClassification/Classification3.lean @@ -12,7 +12,7 @@ import LeanPool.LowDimSolvClassification.LemmasDim3 # LeanPool.LowDimSolvClassification.Classification3 -/ -@[expose] public section +public section open Module open Submodule diff --git a/LeanPool/LowDimSolvClassification/GeneralResults.lean b/LeanPool/LowDimSolvClassification/GeneralResults.lean index f56834d6a6..6beeb3c980 100644 --- a/LeanPool/LowDimSolvClassification/GeneralResults.lean +++ b/LeanPool/LowDimSolvClassification/GeneralResults.lean @@ -12,7 +12,7 @@ public import Mathlib.Algebra.Lie.Nilpotent # LeanPool.LowDimSolvClassification.GeneralResults -/ -@[expose] public section +public section ---possible generalizations to commutative rings instead of fields @@ -276,7 +276,7 @@ def LinearMap.ofProd {M₁ M₂ : Type*} [AddCommGroup M₁] [AddCommGroup M₂] theorem LinearMap.ofProd_apply {M₁ M₂ : Type*} [AddCommGroup M₁] [AddCommGroup M₂] [Module K M₁] [Module K M₂] (f : M₁ →ₗ[K] L) (g : M₂ →ₗ[K] L) (x : M₁ × M₂) : - LinearMap.ofProd f g x = f x.1 + g x.2 := rfl + LinearMap.ofProd f g x = f x.1 + g x.2 := by rfl variable {K L : Type*} [CommRing K] [AddCommGroup L] [Module K L] {p q : Submodule K L} @@ -319,7 +319,7 @@ noncomputable def LinearEquiv.ofComplSubmodules (h : IsCompl p q) : @[simp] theorem LinearEquiv.ofComplSubmodules_apply (h : IsCompl p q) (x : p × q) : - (LinearEquiv.ofComplSubmodules h) x = x.1.val + x.2.val := rfl + (LinearEquiv.ofComplSubmodules h) x = x.1.val + x.2.val := by rfl theorem LinearEquiv.ofComplSubmodules_symm_apply (h : IsCompl p q) (x y z : L) (hy : y ∈ p) (hz : z ∈ q) (hx : x = y + z) : @@ -571,6 +571,7 @@ lemma binary_predicate_3_choose_2 {P : Fin 3 → Fin 3 → Prop} (h₀₁ : P 0 attribute [local instance 100] LieRing.ofAssociativeRing /-- `LinearMap.smulRight` as a Lie algebra homomorphism. -/ +@[expose] def LieHom.smulRight (f : End K L) : K →ₗ⁅K⁆ End K L := { LinearMap.smulRight (LinearMap.id : K →ₗ[K] K) f with map_lie' := by @@ -582,9 +583,9 @@ def LieHom.smulRight (f : End K L) : K →ₗ⁅K⁆ End K L := { } @[simp] -theorem LieHom.coe_smulRight (f : End K L) : ⇑(LieHom.smulRight f) = fun (a : K) => a • f := rfl +theorem LieHom.coe_smulRight (f : End K L) : ⇑(LieHom.smulRight f) = fun (a : K) => a • f := by rfl -theorem LieHom.smulRight_apply (f : End K L) (a : K) : (LieHom.smulRight f) a = a • f := rfl +theorem LieHom.smulRight_apply (f : End K L) (a : K) : (LieHom.smulRight f) a = a • f := by rfl namespace LieAlgebra @@ -684,7 +685,7 @@ theorem isTwoStepNilpotent_iff_lowerCentral' : --here L is necesarily finite dimensional (if K is a field). Could generalize this to --infinite dimensions. /-- A Lie algebra is almost abelian if it has a codimension one abelian ideal. -/ -def IsAlmostAbelian : Prop := +@[expose] def IsAlmostAbelian : Prop := ∃ I : LieIdeal K L, IsLieAbelian I ∧ Module.finrank K L = Module.finrank K I + 1 theorem isAlmostAbelian_iff : @@ -888,11 +889,11 @@ def LieEquiv.commutatorEquiv theorem LieEquiv.commutator_equiv_apply (e : L ≃ₗ⁅K⁆ L') (x : L) (hx : x ∈ LieAlgebra.commutator K L) : LieEquiv.commutatorEquiv e ⟨x, hx⟩ = ⟨e x, LieEquiv.commutator_map e ▸ LieIdeal.mem_map hx ⟩ := - rfl + by rfl theorem LieEquiv.commutator_equiv_symm (e : L ≃ₗ⁅K⁆ L') : e.commutatorEquiv.symm = e.symm.commutatorEquiv := - rfl + by rfl theorem LieAlgebra.dim_commutator_eq_of_lieEquiv (e : L ≃ₗ⁅K⁆ L') : Module.finrank K (LieAlgebra.commutator K L) = Module.finrank K (LieAlgebra.commutator K L') := diff --git a/LeanPool/LowDimSolvClassification/InstancesConstructions.lean b/LeanPool/LowDimSolvClassification/InstancesConstructions.lean index dae3786e4b..23ad134c1c 100644 --- a/LeanPool/LowDimSolvClassification/InstancesConstructions.lean +++ b/LeanPool/LowDimSolvClassification/InstancesConstructions.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.NormNum.GCD # LeanPool.LowDimSolvClassification.InstancesConstructions -/ -@[expose] public section +public section open Module open Submodule @@ -30,6 +30,7 @@ section mkAbelian /-- The abelian Lie algebra constructed from a vector space by setting the bracket to zero. The unused `Module K V` instance is consumed by `inferInstance` so the `unusedArguments` linter accepts the definition; the result is still a synonym for `V`. -/ +@[expose] def mkAbelian (K : Type*) [CommRing K] (V : Type*) [AddCommGroup V] [Module K V] : Type _ := (inferInstance : Module K V).toDistribMulAction.toMulAction.toSMul |> fun _ ↦ V @@ -60,7 +61,7 @@ end mkAbelian section abelianDerivation /-- TODO. -/ -def _root_.LieAlgebra.Abelian.DerivationOfLinearMap' {K : Type*} [CommRing K] {L : Type*} +@[expose] def _root_.LieAlgebra.Abelian.DerivationOfLinearMap' {K : Type*} [CommRing K] {L : Type*} [LieRing L] [LieAlgebra K L] [IsLieAbelian L] (f : End K L) : LieDerivation K L L := { toLinearMap := f, @@ -70,7 +71,7 @@ def _root_.LieAlgebra.Abelian.DerivationOfLinearMap' {K : Type*} [CommRing K] {L } /-- If `L` is an abelian Lie algebra, any linear endomorphism of L is also a derivation of L. -/ -def _root_.LieAlgebra.Abelian.DerivationOfLinearMap (K L : Type*) [CommRing K] [LieRing L] +@[expose] def _root_.LieAlgebra.Abelian.DerivationOfLinearMap (K L : Type*) [CommRing K] [LieRing L] [LieAlgebra K L] [IsLieAbelian L] : End K L ≃ₗ⁅K⁆ LieDerivation K L L := { toFun := Abelian.DerivationOfLinearMap', @@ -102,17 +103,17 @@ def _root_.LieAlgebra.Abelian.DerivationOfLinearMap (K L : Type*) [CommRing K] [ @[simp] theorem _root_.LieAlgebra.Abelian.DerivationCoeLinearMap {K : Type*} [CommRing K] {L : Type*} [LieRing L] [LieAlgebra K L] [IsLieAbelian L] (f : L →ₗ[K] L) : - (Abelian.DerivationOfLinearMap K L f).toLinearMap = f := rfl + (Abelian.DerivationOfLinearMap K L f).toLinearMap = f := by rfl @[simp] theorem _root_.LieAlgebra.Abelian.DerivationCoeFun {K : Type*} [CommRing K] {L : Type*} [LieRing L] [LieAlgebra K L] [IsLieAbelian L] (f : L →ₗ[K] L) : - ⇑(Abelian.DerivationOfLinearMap K L f) = ⇑f := rfl + ⇑(Abelian.DerivationOfLinearMap K L f) = ⇑f := by rfl @[simp] theorem _root_.LieAlgebra.Abelian.DerivationCoeFun' {K : Type*} [CommRing K] {L : Type*} [LieRing L] [LieAlgebra K L] [IsLieAbelian L] (f : L →ₗ[K] L) : - ⇑((Abelian.DerivationOfLinearMap K L).toLieHom f) = ⇑f := rfl + ⇑((Abelian.DerivationOfLinearMap K L).toLieHom f) = ⇑f := by rfl end abelianDerivation @@ -123,7 +124,8 @@ variable (K : Type*) [CommRing K] (V : Type*) [AddCommGroup V] [Module K V] example : LieAlgebra K (Module.End K V) := inferInstance /-- TODO. -/ -def _root_.LieAlgebra.ofAffineEquivAux := (Abelian.DerivationOfLinearMap K (mkAbelian K V)).toLieHom +@[expose] def _root_.LieAlgebra.ofAffineEquivAux := + (Abelian.DerivationOfLinearMap K (mkAbelian K V)).toLieHom /-- The Lie algebra of the general affine group on a vector space `V`, constructed as semidirect product of `V →ₗ[K] V` with the abelian Lie algebra `V`. -/ @@ -143,11 +145,12 @@ variable (K : Type*) [CommRing K] (V : Type*) [AddCommGroup V] [Module K V] (L : [LieRing L] [LieAlgebra K L] [IsLieAbelian L] /-- TODO. -/ -def _root_.LieAlgebra.RealHyperbolicAux' : K →ₗ⁅K⁆ LieDerivation K L L := +@[expose] def _root_.LieAlgebra.RealHyperbolicAux' : K →ₗ⁅K⁆ LieDerivation K L L := LieHom.comp (Abelian.DerivationOfLinearMap K L) (LieHom.smulRight (LinearMap.id : End K L)) /-- TODO. -/ -def _root_.LieAlgebra.RealHyperbolicAux : K →ₗ⁅K⁆ LieDerivation K (mkAbelian K V) (mkAbelian K V) +@[expose] def _root_.LieAlgebra.RealHyperbolicAux : + K →ₗ⁅K⁆ LieDerivation K (mkAbelian K V) (mkAbelian K V) := RealHyperbolicAux' K (mkAbelian K V) /-- The almost abelian Lie algebra associated to real hyperbolic space, diff --git a/LeanPool/LowDimSolvClassification/InstancesLowDim.lean b/LeanPool/LowDimSolvClassification/InstancesLowDim.lean index 58d06a555a..c54b47c61f 100644 --- a/LeanPool/LowDimSolvClassification/InstancesLowDim.lean +++ b/LeanPool/LowDimSolvClassification/InstancesLowDim.lean @@ -13,7 +13,7 @@ public import LeanPool.LowDimSolvClassification.InstancesConstructions # LeanPool.LowDimSolvClassification.InstancesLowDim -/ -@[expose] public section +public section open Module open Submodule @@ -34,7 +34,7 @@ variable (K : Type*) [CommRing K] abbrev Abelian := mkAbelian K (Fin 2 → K) /-- TODO. -/ -def Affine := Fin 2 → K +@[expose] def Affine := Fin 2 → K attribute [local implicit_reducible] Affine instance : LieRing (Affine K) := { @@ -186,7 +186,7 @@ variable (K : Type*) [CommRing K] abbrev _root_.LieAlgebra.Dim3.Abelian := mkAbelian K (Fin 3 → K) /-- The three-dimensional Heisenberg Lie algebra. -/ -def _root_.LieAlgebra.Dim3.Heisenberg := Fin 3 → K +@[expose] def _root_.LieAlgebra.Dim3.Heisenberg := Fin 3 → K attribute [local implicit_reducible] LieAlgebra.Dim3.Heisenberg instance : LieRing (Heisenberg K) := { @@ -223,7 +223,7 @@ instance : LieAlgebra K (Heisenberg K) := { } /-- The three-dimensional Lie algebra which has one-dimensional commutator and is not nilpotent. -/ -def _root_.LieAlgebra.Dim3.AffinePlusAbelian := Fin 3 → K +@[expose] def _root_.LieAlgebra.Dim3.AffinePlusAbelian := Fin 3 → K attribute [local implicit_reducible] LieAlgebra.Dim3.AffinePlusAbelian instance : LieRing (AffinePlusAbelian K) := { @@ -260,7 +260,7 @@ instance : LieAlgebra K (AffinePlusAbelian K):= { } /-- The three-dimensional solvable Lie algebra associated to real hyperbolic space. -/ -def _root_.LieAlgebra.Dim3.Hyperbolic := Fin 3 → K +@[expose] def _root_.LieAlgebra.Dim3.Hyperbolic := Fin 3 → K attribute [local implicit_reducible] LieAlgebra.Dim3.Hyperbolic instance : LieRing (Hyperbolic K) := { @@ -299,7 +299,7 @@ theorem _root_.LieAlgebra.Dim3.Hyperbolic.bracket (l r : Hyperbolic K) : /-- The two-parameter family of solvable Lie algebras appearing in the classification of 3-dimensional Lie algebras. The two `K` parameters are phantom: they index the bracket structure but do not appear in the underlying type; consuming them via `id` keeps the linter happy. -/ -def _root_.LieAlgebra.Dim3.Family (α β : K) : Type _ := +@[expose] def _root_.LieAlgebra.Dim3.Family (α β : K) : Type _ := (id (α, β) : K × K) |> fun _ ↦ Fin 3 → K attribute [local implicit_reducible] LieAlgebra.Dim3.Family @@ -703,6 +703,7 @@ theorem _root_.LieAlgebra.Dim3.Hyperbolic.dim_commutator {K : Type*} [Field K] : rw [finrank_eq_card_basis commutatorBasis, Fintype.card_fin] /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Hyperbolic.adjoint (x : Hyperbolic K) := ad K (Hyperbolic K) x /-- TODO. -/ @@ -719,6 +720,7 @@ theorem _root_.LieAlgebra.Dim3.Hyperbolic.ad_preserves_commutator (x : Hyperboli simp_all /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Hyperbolic.adRestr (x : Hyperbolic K) : (commutator K (Hyperbolic K)) →ₗ[K] (commutator K (Hyperbolic K)) := LinearMap.restrict (adjoint x) (ad_preserves_commutator x) @@ -902,14 +904,17 @@ theorem _root_.LieAlgebra.Dim3.Family.M_trace {α β : K} : Matrix.trace (M α Matrix.cons_val_one, zero_add] /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.e₁ : Family K α β := ![1, 0, 0] theorem _root_.LieAlgebra.Dim3.Family.e₁_def : (e₁ : Family K α β) = ![1, 0, 0] := by rfl /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.e₂ : Family K α β := ![0, 1, 0] theorem _root_.LieAlgebra.Dim3.Family.e₂_def : (e₂ : Family K α β) = ![0, 1, 0] := by rfl /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.e₃ : Family K α β := ![0, 0, 1] theorem _root_.LieAlgebra.Dim3.Family.e₃_def : (e₃ : Family K α β) = ![0, 0, 1] := by rfl @@ -973,6 +978,7 @@ theorem _root_.LieAlgebra.Dim3.Family.commutator_is_span_e₂e₃ (hα : α ≠ · apply subset_span (R:=K) (M:=Family K α β) (s := {x | ∃ y z, ⁅y, z⁆ = x}) /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.B (α β : K) : Fin 2 → Family K α β := ![e₂, e₃] theorem _root_.LieAlgebra.Dim3.Family.B_is_li_ambient : LinearIndependent K (M @@ -1020,125 +1026,13 @@ lemma _root_.LieAlgebra.Dim3.Family.e₃_in_comm : e₃ ∈ commutator K (Family /-- TODO. -/ noncomputable def _root_.LieAlgebra.Dim3.Family.commutatorBasis (α β : K) (hα : α ≠ 0) : Basis (Fin 2) K (commutator K (Family K α β)) := by - -- Basis are ![0,1,0] and ![0,0,1] - let e₁α : Family K α β := ![α⁻¹, 0, 0] - let e₂β : Family K α β := ![0, -β, 1] - let e₁ : Family K α β := ![1, 0, 0] - let e₂ : Family K α β := e₂ - let e₃ : Family K α β := e₃ - have e₂_bracket : ⁅e₁α, e₂β⁆ = e₂ := by - rw [Family.bracket] - unfold e₂β e₁α e₂ - simp only [Matrix.cons_val_zero, - Matrix.cons_val_two, Matrix.tail_cons, Matrix.head_cons, mul_one, mul_zero, sub_zero, - Matrix.cons_val_one, mul_neg, add_neg_cancel, sub_self] - simp_all only [ne_eq, isUnit_iff_ne_zero, not_false_eq_true, IsUnit.inv_mul_cancel, e₂_def] - rfl - have e₃_bracket : ⁅e₁, e₂⁆ = e₃ := by - rw [Family.bracket] - unfold e₁ e₂ e₃ - simp only [Matrix.cons_val_zero, - Matrix.cons_val_two, Matrix.tail_cons, Matrix.head_cons, mul_zero, sub_self, zero_mul, - Matrix.cons_val_one, mul_one, zero_add, sub_zero, e₂_def, e₃_def] - rfl - have B_setrange {hα : α ≠ 0} : Set.range (B α β) ⊆ commutator K (Family K α β) := by - simp_all only [ne_eq, Matrix.range_cons, - Matrix.range_empty, Set.union_empty, Set.union_singleton, B] - intro e Be - simp_all only [Set.mem_insert_iff, Set.mem_singleton_iff] - cases Be with - | inl h => subst h; simp_all only [SetLike.mem_coe, e₁α, e₂β, e₂, e₁, e₃, e₃_in_comm] - | inr h => subst h; simp_all only [SetLike.mem_coe, e₁α, e₂β, e₂, e₁, e₃, - e₂_in_comm (hα := hα)] - have B_setrange_eq : Set.range (B α β) = {e₂, e₃} := by - simp_all only [ne_eq, Matrix.range_cons, - Matrix.range_empty, Set.union_empty, Set.union_singleton, B] - simp_all only [derivedSeriesOfIdeal_succ, derivedSeriesOfIdeal_zero, e₁, e₂β, e₃, e₂, e₁α] - ext x : 1 - simp_all only [Set.mem_insert_iff, Set.mem_singleton_iff] - apply Iff.intro - · intro a - cases a with - | inl h => - simp_all - | inr h_1 => - simp_all - · intro a - cases a with - | inl h => - simp_all - | inr h_1 => - simp_all - let B_is_li_comm := linearIndependent_from_ambient (K := K) (commutator K (Family K α β)) ![e₂, - e₃] B_is_li_ambient (B_setrange (hα := hα)) - have : Set.range (Set.mapIntoSubtype (↑(↑(commutator K (Family K α β)))) (B α β) (B_setrange - (hα:=hα) )) = - ({⟨e₂, e₂_in_comm (hα := hα)⟩, ⟨e₃, e₃_in_comm⟩} : Set (↥(commutator K (Family K α β)))) := by - unfold Set.range - simp only [SetLike.coe_sort_coe] - ext j - constructor - · intro j_in - simp only [Fin.exists_fin_two, Fin.isValue, Set.mem_ofPred_eq] at j_in - rcases j_in with hy | hy - · have := Set.map_into_subtype_apply (↑(commutator K (Family K α β))) (B α β) - (B_setrange (hα:=hα)) 0 - rw [hy] at this - unfold B at this - simp only [Set.mem_insert_iff, Set.mem_singleton_iff] - left - apply Subtype.ext - simp only [Matrix.cons_val_zero] at this - exact this - · have := Set.map_into_subtype_apply (↑(commutator K (Family K α β))) (B α β) - (B_setrange (hα:=hα)) 1 - rw [hy] at this - unfold B at this - simp only [Set.mem_insert_iff, Set.mem_singleton_iff] - right - apply Subtype.ext - simp only [Matrix.cons_val_one, Matrix.cons_val_fin_one] at this - exact this - · intro e - simp_all only [Set.mem_insert_iff, Set.mem_singleton_iff, e₁, e₂β, e₁α] - rcases e with (e0 | e1) - · subst e0 - simp only [Set.mem_ofPred_eq] - use 0 - apply Subtype.ext - rw [Set.map_into_subtype_apply (↑(commutator K (Family K α β))) (B α β) (B_setrange) (0)] - · unfold B - simp only [e₂_def] - unfold e₂ - simp only [e₂_def] - rfl - · exact hα - · subst e1 - simp only [Set.mem_ofPred_eq] - use 1 - apply Subtype.ext - rw [Set.map_into_subtype_apply (↑(commutator K (Family K α β))) (B α β) (B_setrange) (1)] - · unfold B - simp only [Matrix.cons_val_one, e₃_def] - unfold e₃ - simp only [e₃_def] - simp [] - rfl - · exact hα - let B_basis : Basis (Fin 2) K (commutator K (Family K α β)) := - Basis.mk B_is_li_comm (by - intro ⟨x, hx⟩ - simp only [mem_top, LieIdeal.toLieSubalgebra_toSubmodule, forall_const] - norm_cast - unfold B at this - rw [this] - have : x ∈ span K {e₂, e₃} := by - rw [← commutator_is_span_e₂e₃ (hα := hα)] - · exact hx - rw [@mem_span_pair] - rw [@mem_span_pair] at this - simp_all) - exact B_basis + have range_B : Set.range (B α β) = {e₂, e₃} := by + simp only [B, Matrix.range_cons, Matrix.range_empty, + Set.union_empty, Set.union_singleton] + exact Set.pair_comm e₃ e₂ + exact (Basis.span (B_is_li_ambient (α := α) (β := β))).map + (LinearEquiv.ofEq _ (commutator K (Family K α β)).toSubmodule + (by rw [range_B, commutator_is_span_e₂e₃ hα])) theorem _root_.LieAlgebra.Dim3.Family.dim_commutator {hα : α ≠ 0} : finrank K (commutator K (Family K α β)) = 2 := by @@ -1146,13 +1040,13 @@ theorem _root_.LieAlgebra.Dim3.Family.dim_commutator {hα : α ≠ 0} : finrank theorem _root_.LieAlgebra.Dim3.Family.B_basis_0 {hα : α ≠ 0} : ((commutatorBasis α β hα) 0).val = (e₂ : Family K α β) := by - simp only [commutatorBasis] - exact congrArg (fun x : commutator K (Family K α β) => x.val) (Basis.mk_apply _ _ 0) + simp only [commutatorBasis, Basis.map_apply, LinearEquiv.coe_ofEq_apply, + Basis.coe_span_apply, B, Matrix.cons_val_zero] theorem _root_.LieAlgebra.Dim3.Family.B_basis_1 {hα : α ≠ 0} : ((commutatorBasis α β hα) 1).val = (e₃ : Family K α β) := by - simp only [commutatorBasis] - exact congrArg (fun x : commutator K (Family K α β) => x.val) (Basis.mk_apply _ _ 1) + simp only [commutatorBasis, Basis.map_apply, LinearEquiv.coe_ofEq_apply, + Basis.coe_span_apply, B, Matrix.cons_val_one, Matrix.cons_val_fin_one] theorem _root_.LieAlgebra.Dim3.Family.B_basis_repr {hα : α ≠ 0} {x : commutator K (Family K α β)} : (commutatorBasis α β hα).repr x = ![x.val 1, x.val 2] := by @@ -1213,6 +1107,7 @@ theorem _root_.LieAlgebra.Dim3.Family.B_basis_repr {hα : α ≠ 0} {x : commuta def _root_.LieAlgebra.Dim3.Family.ade₁ := ad K (Family K α β) e₁ /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.adjoint (x : Family K α β) := ad K (Family K α β) x theorem _root_.LieAlgebra.Dim3.Family.ade₁_pc : ∀ x ∈ (commutator K (Family K α β)), @@ -1228,11 +1123,13 @@ theorem _root_.LieAlgebra.Dim3.Family.ad_pc (x : Family K α β) : ∀ y ∈ (co simpa only [ad_apply] using lie_mem_commutator x y /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.adRestr (x : Family K α β) : (commutator K (Family K α β)) →ₗ[K] (commutator K (Family K α β)) := LinearMap.restrict (adjoint x) (ad_pc x) /-- TODO. -/ +@[expose] def _root_.LieAlgebra.Dim3.Family.ade₁Restr (α β : K) := adRestr e₁ (α:=α) (β:=β) theorem _root_.LieAlgebra.Dim3.Family.ad_restr_apply (x : Family K α β) (y : Family K α β) diff --git a/LeanPool/LowDimSolvClassification/LemmasDim3.lean b/LeanPool/LowDimSolvClassification/LemmasDim3.lean index b38ece0f2a..f76f5ec7e9 100644 --- a/LeanPool/LowDimSolvClassification/LemmasDim3.lean +++ b/LeanPool/LowDimSolvClassification/LemmasDim3.lean @@ -13,7 +13,7 @@ import Mathlib.LinearAlgebra.Dimension.OrzechProperty # LeanPool.LowDimSolvClassification.LemmasDim3 -/ -@[expose] public section +public section open Module open Submodule diff --git a/LeanPool/LowDimSolvClassification/QuotientSolvable.lean b/LeanPool/LowDimSolvClassification/QuotientSolvable.lean index 40870b1075..61e11e530b 100644 --- a/LeanPool/LowDimSolvClassification/QuotientSolvable.lean +++ b/LeanPool/LowDimSolvClassification/QuotientSolvable.lean @@ -13,7 +13,7 @@ import Mathlib.Data.Rat.Floor # LeanPool.LowDimSolvClassification.QuotientSolvable -/ -@[expose] public section +public section namespace LieIdeal diff --git a/LeanPool/LowDimSolvClassification/Semidirect.lean b/LeanPool/LowDimSolvClassification/Semidirect.lean index 525ad702db..898517f2cc 100644 --- a/LeanPool/LowDimSolvClassification/Semidirect.lean +++ b/LeanPool/LowDimSolvClassification/Semidirect.lean @@ -12,7 +12,7 @@ import LeanPool.LowDimSolvClassification.Tactics # LeanPool.LowDimSolvClassification.Semidirect -/ -@[expose] public section +public section section lie_semidirect @@ -23,7 +23,7 @@ variable {K : Type*} (L J : Type*) [CommRing K] [LieRing L] [LieRing J] [LieAlge /-- The semidirect product of two Lie algebras `L` and `J`, defined by specifying a homomorphism from `L` to the Lie algebra of derivations of `J`. The homomorphism `φ` indexes the type, but does not appear in the underlying carrier; consuming it via `id` keeps the linter happy. -/ -def LieSemidirectProduct (φ : L →ₗ⁅K⁆ LieDerivation K J J) : Type _ := +@[expose] def LieSemidirectProduct (φ : L →ₗ⁅K⁆ LieDerivation K J J) : Type _ := (id φ : L →ₗ⁅K⁆ LieDerivation K J J) |> fun _ ↦ L × J attribute [local implicit_reducible] LieSemidirectProduct @@ -169,22 +169,22 @@ def fst : L ⋉[φ] J →ₗ⁅K⁆ L := { } @[simp] -theorem fst_inl (x : L) : fst (inl x : L ⋉[φ] J) = x := rfl +theorem fst_inl (x : L) : fst (inl x : L ⋉[φ] J) = x := by rfl @[simp] -theorem fst_inr (x : J) : fst (inr x : L ⋉[φ] J) = 0 := rfl +theorem fst_inr (x : J) : fst (inr x : L ⋉[φ] J) = 0 := by rfl @[simp] -theorem fst_inl' (x : L) : (inl x : L ⋉[φ] J).1 = x := rfl +theorem fst_inl' (x : L) : (inl x : L ⋉[φ] J).1 = x := by rfl @[simp] -theorem fst_inr' (x : J) : (inr x : L ⋉[φ] J).1 = 0 := rfl +theorem fst_inr' (x : J) : (inr x : L ⋉[φ] J).1 = 0 := by rfl @[simp] -theorem snd_inl' (x : L) : (inl x : L ⋉[φ] J).2 = 0 := rfl +theorem snd_inl' (x : L) : (inl x : L ⋉[φ] J).2 = 0 := by rfl @[simp] -theorem snd_inr' (x : J) : (inr x : L ⋉[φ] J).2 = x := rfl +theorem snd_inr' (x : J) : (inr x : L ⋉[φ] J).2 = x := by rfl @[simp] theorem inl_left_add_inr_right (x : L ⋉[φ] J) : inl x.1 + inr x.2 = x := by diff --git a/LeanPool/LowWeightPauliDynamics/BlockNorm.lean b/LeanPool/LowWeightPauliDynamics/BlockNorm.lean index 0ebaa47a65..42872cfffa 100644 --- a/LeanPool/LowWeightPauliDynamics/BlockNorm.lean +++ b/LeanPool/LowWeightPauliDynamics/BlockNorm.lean @@ -62,7 +62,7 @@ open scoped Matrix.Norms.L2Operator open Matrix Finset WithLp -@[expose] public section +public section namespace Lean4LPD @@ -73,7 +73,7 @@ variable {𝕜 : Type*} [RCLike 𝕜] /-- Restriction of coordinates along `f : p → m`, as a continuous linear map of Euclidean spaces: `x ↦ x ∘ f`. Mathlib's `EuclideanSpace.restrict₂` covers only the inclusion of one `Finset` in another and comes with no norm lemma. -/ -noncomputable def restrictCLM (𝕜 : Type*) [RCLike 𝕜] {p m : Type*} +@[expose] noncomputable def restrictCLM (𝕜 : Type*) [RCLike 𝕜] {p m : Type*} (f : p → m) : EuclideanSpace 𝕜 m →L[𝕜] EuclideanSpace 𝕜 p where toFun x := toLp 2 (fun i => ofLp x (f i)) map_add' x y := by ext; simp diff --git a/LeanPool/LowWeightPauliDynamics/Constants/AssemblyBound.lean b/LeanPool/LowWeightPauliDynamics/Constants/AssemblyBound.lean index 1c5aa8c273..7d542bf94d 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/AssemblyBound.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/AssemblyBound.lean @@ -51,7 +51,7 @@ its layer inflow are supplied in `Lean4LPD/Pauli/LayerError.lean`. * `MultiLadder.sum_block_epsJump_le_cZero`: the `c₀`-form bound for the concrete jump norms. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Constants/C0.lean b/LeanPool/LowWeightPauliDynamics/Constants/C0.lean index 936b7bf708..8e3e14baa6 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/C0.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/C0.lean @@ -88,7 +88,7 @@ The script `scripts/c0_scan.py` evaluates `c₀` in floating point on a paramete witness points above. -/ -@[expose] public section +public section namespace Lean4LPD @@ -97,12 +97,14 @@ open Real /-- The constant `c₀` of `apd:thm:one_step_truncation_error`, as `apd:eq:c0` defines it: `c₀ = (r+1)/r · exp((9/4)(m*+1)/(rΓ)) · (1+B)^{1/(m*+1)}`, where `B` stands for the paper's `4eβ`. All four arguments are real, so the bounds below apply in particular to natural `r`, `m*`, `Γ`. -/ +@[expose] noncomputable def cZero (r m G B : ℝ) : ℝ := (r + 1) / r * exp (9 / 4 * (m + 1) / (r * G)) * (1 + B) ^ ((1 : ℝ) / (m + 1)) /-- The truncation threshold `t₀ = 1/(c₀ Γ (k_h − 1) α)` of `apd:eq:time_condition`, as a function of the constant `c`, the layer count `G`, the Hamiltonian locality `kh` and the coupling scale `a` (standing for `α`). -/ +@[expose] noncomputable def tZero (c G kh a : ℝ) : ℝ := 1 / (c * G * (kh - 1) * a) /-- The step-count conditions of `apd:thm:one_step_truncation_error` that constrain the triple @@ -113,7 +115,7 @@ multiplicatively, `8(m*+1)² ≤ rΓ`, so that no division appears. The hypotheses `1 ≤ m*` and `5 ≤ r` of `cZero_le_two` are deliberately not part of this predicate: they are separate arguments there, and the necessity witnesses (`two_lt_cZero_of_m_zero`, `two_lt_cZero_of_admissible_four`, …) are stated against `Admissible` itself. -/ -def Admissible (r m G : ℝ) : Prop := +@[expose] def Admissible (r m G : ℝ) : Prop := 1 ≤ r ∧ 0 ≤ m ∧ 0 < G ∧ m ≤ r ∧ 8 * (m + 1) ^ 2 ≤ r * G /-- `exp y ≤ 1/(1-y)` for `y < 1`, the upper bound on `Real.exp` used below. It is the diff --git a/LeanPool/LowWeightPauliDynamics/Constants/ChainWeights.lean b/LeanPool/LowWeightPauliDynamics/Constants/ChainWeights.lean index e4708d830a..7d1ba7f769 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/ChainWeights.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/ChainWeights.lean @@ -40,7 +40,7 @@ the all-ones weight. The zero angle `a = 0` is therefore included, which a state bounds with the paper's entry constant `1 + 4eβ` in place of `1 + 2β`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -49,6 +49,7 @@ open Finset /-- The all-ones chain weight `a^m ∏_{ν=2}^{m+1} w_ν`, with value `1` at `m = 0`. It is the weight of the chain of `m` single jumps in `apd:eq:composition_majorant`, and the reference weight `W` of `chain_le_weighted_choose` in `apd:eq:total_high_weight_norm`. -/ +@[expose] noncomputable def chainWeight (kh1 c a : ℝ) (m : ℕ) : ℝ := a ^ m * ∏ i ∈ range m, rungW kh1 c (i + 2) diff --git a/LeanPool/LowWeightPauliDynamics/Constants/Entry.lean b/LeanPool/LowWeightPauliDynamics/Constants/Entry.lean index 4af847818e..12bd74b3a4 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/Entry.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/Entry.lean @@ -62,7 +62,7 @@ The constant `1 + 2β` is smaller than the paper's `1 + 4eβ`; the bound `c₀ exception to them; only `k_h ≥ 2`, i.e. `k_h − 1 > 0`, is required. -/ -@[expose] public section +public section namespace Lean4LPD @@ -73,15 +73,17 @@ open Finset anti-commuting `k_h`-local rotations, and the threshold of rung `m` in `apd:eq:def_high_weight_norm`. It is real-valued so that no `ℕ` subtraction occurs. `kh1` is `k_h − 1`. Note `w₂ = (k_h−1)(1+c) = k_o+k_h−1`. -/ -def rungW (kh1 c : ℝ) (m : ℕ) : ℝ := kh1 * ((m : ℝ) - 1 + c) +@[expose] def rungW (kh1 c : ℝ) (m : ℕ) : ℝ := kh1 * ((m : ℝ) - 1 + c) /-- The `j`-jump block norm into rung `ν`, `ε_j^{(ν)} = (w_{ν+j}·a)^j / j!` (`apd:rmk:multijump`), with `a = sin(dt)`. -/ +@[expose] noncomputable def epsJump (kh1 c a : ℝ) (j nu : ℕ) : ℝ := (rungW kh1 c (nu + j) * a) ^ j / (Nat.factorial j : ℝ) /-- The expansion parameter `β = 2e·w₂·a` of the multi-jump analysis (`apd:rmk:multijump`), with `a = sin(dt)`. -/ +@[expose] noncomputable def betaOf (kh1 c a : ℝ) : ℝ := 2 * Real.exp 1 * rungW kh1 c 2 * a lemma rungW_nonneg {kh1 c : ℝ} (hkh : 0 < kh1) (hc : 0 ≤ c) {m : ℕ} (hm : 1 ≤ m) : @@ -216,6 +218,7 @@ theorem epsJump_ratio {kh1 c a : ℝ} (hkh : 0 < kh1) (hc : 0 ≤ c) (ha : 0 ≤ /-- The entry factor `E_ν = ∑_{j≥ν} ε_j^{(ν)}` of `apd:eq:composition_majorant`, written as a `tsum` over the shift `j = ν + i`. This is the only infinite sum in the multi-jump development; the ladder itself takes `E` abstractly (see `Lean4LPD.MultiLadder`). -/ +@[expose] noncomputable def entryFactor (kh1 c a : ℝ) (nu : ℕ) : ℝ := ∑' i : ℕ, epsJump kh1 c a (nu + i) nu diff --git a/LeanPool/LowWeightPauliDynamics/Constants/PartFactor.lean b/LeanPool/LowWeightPauliDynamics/Constants/PartFactor.lean index 2964594327..b7e569ec48 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/PartFactor.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/PartFactor.lean @@ -50,7 +50,7 @@ every `j ≥ 2`; the only numerical input is `exp(4/3) ≤ 4.03`. The bound is a at `j = σ = 2`, `c = 0`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -63,6 +63,7 @@ open Finset The product runs over `s−j+1, …, s`, which is the product `∏_{i=σ-j+1}^{σ}(i+c)` of the module docstring written in increasing order so that no `ℕ` subtraction occurs. -/ +@[expose] noncomputable def partFactor (j : ℕ) (s : ℝ) : ℝ := (s + j - 1) ^ j / ((Nat.factorial j : ℝ) * ∏ i ∈ range j, (s - j + 1 + i)) diff --git a/LeanPool/LowWeightPauliDynamics/Constants/StepSum.lean b/LeanPool/LowWeightPauliDynamics/Constants/StepSum.lean index 81ca4469fa..18c08e09ab 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/StepSum.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/StepSum.lean @@ -60,7 +60,7 @@ powers and a harmonic-sum bound, and is proved in `Lean4LPD.Constants.AssemblyBo product). -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Constants/Threshold.lean b/LeanPool/LowWeightPauliDynamics/Constants/Threshold.lean index 4813ec1c7e..27b07f54ac 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/Threshold.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/Threshold.lean @@ -48,7 +48,7 @@ Choosing a larger numerical step count is separate from constructing the corresp angles. Nothing here assumes a fixed angle family still satisfies `a ≤ αt/r` after `r` changes. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Constants/Total.lean b/LeanPool/LowWeightPauliDynamics/Constants/Total.lean index 116452795c..758dd4d3df 100644 --- a/LeanPool/LowWeightPauliDynamics/Constants/Total.lean +++ b/LeanPool/LowWeightPauliDynamics/Constants/Total.lean @@ -78,7 +78,7 @@ caller supplies it either. All of this is at the level of the normalized Pauli 2 conversion to an error in expectation (`apd:thm:triangle`) is not part of this file. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/Assembly.lean b/LeanPool/LowWeightPauliDynamics/Ladder/Assembly.lean index 92e3e8a584..9c58aaa76d 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/Assembly.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/Assembly.lean @@ -35,7 +35,7 @@ theorem next to `ChainBound.lean`. * `MultiLadder.sum_steps_le`: the bound on the globally sampled mass. -/ -@[expose] public section +public section namespace Lean4LPD.MultiLadder diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/ChainBound.lean b/LeanPool/LowWeightPauliDynamics/Ladder/ChainBound.lean index c5d37bcb0f..abf7ba7593 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/ChainBound.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/ChainBound.lean @@ -47,7 +47,7 @@ Pauli evolution in `Lean4LPD/Pauli/LayerError.lean`. `chain (k+1) m ≤ C · R^{m-(k+1)} · W m · C(m-1, k)`. -/ -@[expose] public section +public section namespace Lean4LPD.MultiLadder diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/Defs.lean b/LeanPool/LowWeightPauliDynamics/Ladder/Defs.lean index b4667f0d39..d3f5755c29 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/Defs.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/Defs.lean @@ -47,7 +47,7 @@ inflow from the rung below. * `Ladder`: the damped ladder with damping factor `a` and total mass `M`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -67,6 +67,7 @@ right-hand side. With rung `0` distinguished, the model (`PauliString.ladderN`) `N 0 g := ‖O^{(g)}‖_{2,normalized} = ‖O‖_{2,normalized}`, satisfies `reservoir` with equality, makes `step` at `m = 1` weaker than the true flow bound and hence implied by it, and reads only real rungs at `m ≥ 2`. -/ +@[expose] def rungWeight (ko kh m : ℕ) : ℕ := ko + (m - 1) * (kh - 1) @[simp] lemma rungWeight_one (ko kh : ℕ) : rungWeight ko kh 1 = ko := by diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/HockeyStick.lean b/LeanPool/LowWeightPauliDynamics/Ladder/HockeyStick.lean index 6168a6e9b7..8bbca505f7 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/HockeyStick.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/HockeyStick.lean @@ -28,7 +28,7 @@ reconciling the index ranges, and avoids `ℕ`-subtraction at `g = 0`. * `sum_range_choose_real`: the same identity with both sides cast to `ℝ`. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/MultiJump.lean b/LeanPool/LowWeightPauliDynamics/Ladder/MultiJump.lean index 46834ebf85..30128df05d 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/MultiJump.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/MultiJump.lean @@ -86,7 +86,7 @@ plausible one. * `MultiLadder.majorant_mono`: the majorant is monotone in the number of layers. -/ -@[expose] public section +public section namespace Lean4LPD @@ -102,7 +102,7 @@ reservoir once and climb to rung `m` through exactly `k` jumps at strictly incre The recursion is on the number of jumps `k`, not on the rung `m`, so it is structural. The sum over `Finset.Ico 1 m` keeps `1 ≤ j < m`, hence `1 ≤ m - j`: no `ℕ` truncated subtraction is ever evaluated outside its intended range. -/ -def chain (eps : ℕ → ℕ → ℝ) (E : ℕ → ℝ) : ℕ → ℕ → ℝ +@[expose] def chain (eps : ℕ → ℕ → ℝ) (E : ℕ → ℝ) : ℕ → ℕ → ℝ | 0, _ => 0 | 1, m => E m | (k + 2), m => ∑ j ∈ Ico 1 m, eps j m * chain eps E (k + 1) (m - j) @@ -212,7 +212,7 @@ number of layers `T`: In `apd:eq:composition_majorant` the outer sum is `∑_{k=1}^{min(m,T)}`; the extra terms here vanish, at `k = 0` by definition and at `k > m` by `chain_eq_zero_of_lt`. Summing to `T` rather than to `min(m,T)` is what makes the Pascal step below a two-line rewrite. -/ -noncomputable def majorant (eps : ℕ → ℕ → ℝ) (E : ℕ → ℝ) (M : ℝ) (m T : ℕ) : ℝ := +@[expose] noncomputable def majorant (eps : ℕ → ℕ → ℝ) (E : ℕ → ℝ) (M : ℝ) (m T : ℕ) : ℝ := M * ∑ k ∈ range (T + 1), (T.choose k : ℝ) * chain eps E k m variable {eps : ℕ → ℕ → ℝ} {E : ℕ → ℝ} diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/Recursion.lean b/LeanPool/LowWeightPauliDynamics/Ladder/Recursion.lean index bbb005b6c6..f31acf897f 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/Recursion.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/Recursion.lean @@ -32,7 +32,7 @@ conclusion have the same shape. * `Ladder.cumulation`: `N m g ≤ C(g, m) · a^m · M`. -/ -@[expose] public section +public section namespace Lean4LPD.Ladder diff --git a/LeanPool/LowWeightPauliDynamics/Ladder/Weighted.lean b/LeanPool/LowWeightPauliDynamics/Ladder/Weighted.lean index 8a60a412c0..cf6cf84bce 100644 --- a/LeanPool/LowWeightPauliDynamics/Ladder/Weighted.lean +++ b/LeanPool/LowWeightPauliDynamics/Ladder/Weighted.lean @@ -64,7 +64,7 @@ distinguished reservoir rather than a computed `rungWeight _ _ 0`. * `satLadder_cumulation_eq`: the cumulation bound is attained by `satLadder`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -210,6 +210,6 @@ noncomputable def satLadder {c : ℕ → ℝ} {M : ℝ} (hc : ∀ j, 0 ≤ c j) /-- The bound of `cumulation` is **attained**: at the saturating family it is an equality. -/ lemma satLadder_cumulation_eq {c : ℕ → ℝ} {M : ℝ} (hc : ∀ j, 0 ≤ c j) (hM : 0 ≤ M) (m g : ℕ) : - (satLadder hc hM).N m g = (g.choose m : ℝ) * (∏ j ∈ Icc 1 m, c j) * M := rfl + (satLadder hc hM).N m g = (g.choose m : ℝ) * (∏ j ∈ Icc 1 m, c j) * M := by rfl end Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Basic.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Basic.lean index ababcdb0f1..75fac3e7e0 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Basic.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Basic.lean @@ -93,7 +93,7 @@ both `Y` and `−Y`. The canonical signless representative needs `phase = #{Y-si is a finer condition than the parity one and is not used here. -/ -@[expose] public section +public section namespace Lean4LPD @@ -103,7 +103,7 @@ namespace Lean4LPD check over `ZMod 2`, discharged by `decide`. -/ /-- `signPhase a` is the `ZMod 4` phase exponent of the sign `(-1)^a`, defined as `2a`. -/ -def signPhase (a : ZMod 2) : ZMod 4 := 2 * (a.val : ZMod 4) +@[expose] def signPhase (a : ZMod 2) : ZMod 4 := 2 * (a.val : ZMod 4) @[simp] lemma signPhase_zero : signPhase 0 = 0 := rfl @@ -261,7 +261,7 @@ instance : StarMul (PauliString n) where /-- The symplectic form `⟪s,t⟫ = ∑ᵢ (x_s(i) z_t(i) + z_s(i) x_t(i))` over `ZMod 2`, written with Mathlib's `dotProduct`. It is the obstruction to commuting: see `commute_iff_sympForm_eq_zero`. -/ -def sympForm (s t : PauliString n) : ZMod 2 := s.x ⬝ᵥ t.z + s.z ⬝ᵥ t.x +@[expose] def sympForm (s t : PauliString n) : ZMod 2 := s.x ⬝ᵥ t.z + s.z ⬝ᵥ t.x lemma sympForm_eq_sum (s t : PauliString n) : sympForm s t = ∑ i, (s.x i * t.z i + s.z i * t.x i) := by @@ -290,6 +290,7 @@ lemma sympForm_mul_left (s t u : PauliString n) : exact bit_add_self _ /-- `phaseMul k s` is `i^k · s`: the same bit vectors, the phase shifted by `k`. -/ +@[expose] def phaseMul (k : ZMod 4) (s : PauliString n) : PauliString n := ⟨s.x, s.z, s.phase + k⟩ @[simp] lemma phaseMul_x (k : ZMod 4) (s : PauliString n) : (phaseMul k s).x = s.x := rfl @@ -458,14 +459,14 @@ every `x` and `z` is `0`, and `sympForm` is identically zero, so the whole antic vacuous there. One qubit is enough to make it non-vacuous. -/ /-- The one-qubit `X`. -/ -def X1 : PauliString 1 := ⟨1, 0, 0⟩ +@[expose] def X1 : PauliString 1 := ⟨1, 0, 0⟩ /-- The one-qubit `Z`. -/ -def Z1 : PauliString 1 := ⟨0, 1, 0⟩ +@[expose] def Z1 : PauliString 1 := ⟨0, 1, 0⟩ /-- The one-qubit `Y`, whose phase is one of the two `isSelfAdjoint_iff_phase` admits. It is `+Y` rather than `−Y`; `Pauli/Matrix.lean` checks that entrywise. -/ -def Y1 : PauliString 1 := ⟨1, 1, 1⟩ +@[expose] def Y1 : PauliString 1 := ⟨1, 1, 1⟩ theorem isSelfAdjoint_X1 : IsSelfAdjoint X1 := isSelfAdjoint_iff_phase.2 (by decide) diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Branch.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Branch.lean index fadcd6d036..6975cccedb 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Branch.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Branch.lean @@ -77,7 +77,7 @@ the tensor product `P₁ ⊗ ⋯ ⊗ Pₙ` of one-qubit Pauli matrices is `toMat `Pauli/Tensor.lean`; the one-qubit case is also checked entry by entry in `Pauli/Matrix.lean`. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Coeff.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Coeff.lean index fd1090a0a6..66eee366c4 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Coeff.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Coeff.lean @@ -91,7 +91,7 @@ and hence vanishing entries. Neither a `finrank` count nor an `InnerProductSpace needed for it. -/ -@[expose] public section +public section namespace Lean4LPD @@ -113,7 +113,7 @@ variable {n : ℕ} /-! ### Classes and their Hermitian representatives -/ /-- The class of a Pauli string. -/ -def cls (s : PauliString n) : PauliIndex n := (s.x, s.z) +@[expose] def cls (s : PauliString n) : PauliIndex n := (s.x, s.z) @[simp] lemma cls_fst (s : PauliString n) : (cls s).1 = s.x := rfl @@ -122,7 +122,7 @@ def cls (s : PauliString n) : PauliIndex n := (s.x, s.z) /-- The **self-adjoint representative** of a class, `i^{z ⬝ᵥ x} X^x Z^z`. Defined, not characterized: `isSelfAdjoint_iff_phase` admits two phases differing by `2`, and this picks the one in `{0, 1}`. See `herm_eq_or_eq_neg` for what the other choice would cost. -/ -def herm (p : PauliIndex n) : PauliString n := ⟨p.1, p.2, ((p.2 ⬝ᵥ p.1).val : ZMod 4)⟩ +@[expose] def herm (p : PauliIndex n) : PauliString n := ⟨p.1, p.2, ((p.2 ⬝ᵥ p.1).val : ZMod 4)⟩ @[simp] lemma herm_x (p : PauliIndex n) : (herm p).x = p.1 := rfl @@ -166,6 +166,7 @@ lemma weight_congr {s t : PauliString n} (hx : s.x = t.x) (hz : s.z = t.z) : /-- **The weight of a Pauli class**, `def:pauli_weight` transported to the index set. Well defined because the weight cannot see a phase. -/ +@[expose] def wt (p : PauliIndex n) : ℕ := weight (herm p) @[simp] lemma wt_cls (s : PauliString n) : wt (cls s) = weight s := weight_congr rfl rfl @@ -174,11 +175,13 @@ def wt (p : PauliIndex n) : ℕ := weight (herm p) /-- **The Pauli coefficient vector** `x_P = 2^{-n} Tr(P O)`, with `P` the self-adjoint representative of the class `p`. -/ +@[expose] noncomputable def coeff (O : Matrix (Bits n) (Bits n) ℂ) (p : PauliIndex n) : ℂ := ((2 : ℂ) ^ n)⁻¹ * (toMatrix (herm p) * O).trace /-- The squared **Pauli 2-norm** `‖O‖_{2,normalized}² = 2^{-n} Tr(O† O)`, written entrywise as `2^{-n} ∑_{a,b} |O_{ab}|²`. `pauliNormSq_eq_trace` is the equality with the trace form. -/ +@[expose] noncomputable def pauliNormSq (O : Matrix (Bits n) (Bits n) ℂ) : ℝ := ((2 : ℝ) ^ n)⁻¹ * ∑ a : Bits n, ∑ b : Bits n, ‖O a b‖ ^ 2 @@ -186,6 +189,7 @@ noncomputable def pauliNormSq (O : Matrix (Bits n) (Bits n) ℂ) : ℝ := `‖O‖_{2,normalized}² = 2^{-n} Tr(O† O)`, so that every Pauli string has norm one. This is the norm in which the high-weight norm of `apd:eq:def_high_weight_norm` is measured. -/ +@[expose] noncomputable def pauliNorm (O : Matrix (Bits n) (Bits n) ℂ) : ℝ := Real.sqrt (pauliNormSq O) lemma pauliNormSq_nonneg (O : Matrix (Bits n) (Bits n) ℂ) : 0 ≤ pauliNormSq O := by @@ -359,6 +363,7 @@ Minkowski's inequality on that space, so the coefficients are packaged as an ele inner product. -/ /-- **The coefficient vector** `x = (x_P)_P` of an operator, as a vector in `ℓ²(PauliIndex n)`. -/ +@[expose] noncomputable def coeffVec (O : Matrix (Bits n) (Bits n) ℂ) : EuclideanSpace ℂ (PauliIndex n) := WithLp.toLp 2 (coeff O) @@ -376,6 +381,7 @@ theorem norm_coeffVec (O : Matrix (Bits n) (Bits n) ℂ) : ‖coeffVec O‖ = pa For `S` the high-weight region this is the block `x_R` of the splitting `x = x_R + x_B` used in the proof of `apd:thm:local_flow_k_local`; for its complement it is the coefficient side of the truncation `Π_{≤ w}` (see `truncOp` in `Pauli/Truncate.lean`). -/ +@[expose] noncomputable def restr (S : Finset (PauliIndex n)) (y : EuclideanSpace ℂ (PauliIndex n)) : EuclideanSpace ℂ (PauliIndex n) := WithLp.toLp 2 fun p => if p ∈ S then y.ofLp p else 0 @@ -423,6 +429,7 @@ lemma restr_add_restr_compl (S : Finset (PauliIndex n)) (y : EuclideanSpace ℂ /-! ### The high-weight region -/ /-- The high-weight region `R = {p : |p| > w}`: the classes of weight above the threshold `w`. -/ +@[expose] def highSet (n w : ℕ) : Finset (PauliIndex n) := univ.filter fun p => w < wt p @[simp] lemma mem_highSet {n w : ℕ} {p : PauliIndex n} : p ∈ highSet n w ↔ w < wt p := by @@ -430,6 +437,7 @@ def highSet (n w : ℕ) : Finset (PauliIndex n) := univ.filter fun p => w < wt p /-- **The high-weight norm** `‖O_{≥ w+1}‖_{2,normalized}` of `apd:eq:def_high_weight_norm`, at threshold `w`: the `ℓ²` mass of the coefficients on classes of weight `> w`. -/ +@[expose] noncomputable def highNorm (w : ℕ) (O : Matrix (Bits n) (Bits n) ℂ) : ℝ := ‖restr (highSet n w) (coeffVec O)‖ diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Count.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Count.lean index 8bda506b1d..158cdad585 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Count.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Count.lean @@ -46,7 +46,7 @@ matters: an upper bound on the number of stored Paulis is what bounds the runtim * `card_lowSet_le_pow`: `(lowSet n w).card ≤ 4 ^ w * n ^ w` for `w ≤ n`. -/ -@[expose] public section +public section namespace Lean4LPD.PauliString open Finset @@ -62,6 +62,7 @@ def lowSet (n w : ℕ) : Finset (PauliIndex n) := (highSet n w)ᶜ /-- A Pauli class read site by site: the pair of `x` and `z` bits at each qubit. The pair is `0` exactly when the class is the identity at that site. -/ +@[expose] def siteFun (p : PauliIndex n) : Fin n → ZMod 2 × ZMod 2 := fun i => (p.1 i, p.2 i) /-- `siteFun` as an equivalence between Pauli classes and functions from sites to bit pairs. -/ @@ -72,6 +73,7 @@ def siteEquiv : PauliIndex n ≃ (Fin n → ZMod 2 × ZMod 2) where right_inv _ := funext fun _ => rfl /-- The sites at which the class is not the identity. `wt` counts exactly these. -/ +@[expose] def psupp (p : PauliIndex n) : Finset (Fin n) := univ.filter fun i => siteFun p i ≠ 0 lemma wt_eq_card_psupp (p : PauliIndex n) : wt p = (psupp p).card := rfl diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Discard.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Discard.lean index f78ad160f2..749847428d 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Discard.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Discard.lean @@ -39,7 +39,7 @@ represented by the entrywise model `toMatrix`. norm `highNorm w O`. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/DiscardWitness.lean b/LeanPool/LowWeightPauliDynamics/Pauli/DiscardWitness.lean index 477ae5267f..9be8155f4c 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/DiscardWitness.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/DiscardWitness.lean @@ -36,7 +36,7 @@ proved separately, in `RotationExp` and `Pauli/Tensor`. operator is `Q`, it is nonzero, and its Pauli norm is one. -/ -@[expose] public section +public section namespace Lean4LPD.DiscardWitness diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Flow.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Flow.lean index 575b7f43dd..fc21fc7943 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Flow.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Flow.lean @@ -119,7 +119,7 @@ scalars: `coeff O p : ℂ`. It is not needed — the transformation is by real p coefficient `sin θ` on it real. -/ -@[expose] public section +public section namespace Lean4LPD @@ -144,6 +144,7 @@ involution because the `X`- and `Z`-parts live in characteristic two. -/ /-- The **partner class** of `p` under `G`: the class of `G · herm p`, hence of the partner `±i G s` of `s = herm p`. -/ +@[expose] def partner (G : PauliString n) (p : PauliIndex n) : PauliIndex n := (G.x + p.1, G.z + p.2) @[simp] lemma cls_mul_herm (G : PauliString n) (p : PauliIndex n) : @@ -185,6 +186,7 @@ rotation on the pair `{s, s'}` an *orthogonal* map rather than merely a bounded /-- The sign relating the Hermitian partner `i G s` to the canonical self-adjoint representative of its class: `toMatrix (i G herm p) = partnerSign G p • toMatrix (herm (partner G p))`. -/ +@[expose] noncomputable def partnerSign (G : PauliString n) (p : PauliIndex n) : ℂ := iPow ((phaseMul 1 (G * herm p)).phase - (herm (partner G p)).phase) @@ -256,6 +258,7 @@ coefficient vectors (no matrix is built): the identity on classes commuting with planar rotation `x_s ↦ cos(θ)x_s ∓ sin(θ)x_{s'}` on each anticommuting pair, with the sign given by `partnerSign`. That this *is* conjugation is `coeffVec_conj`; that it is *orthogonal* is `norm_rotAct`. -/ +@[expose] noncomputable def rotAct (G : PauliString n) (θ : ℝ) (y : EuclideanSpace ℂ (PauliIndex n)) : EuclideanSpace ℂ (PauliIndex n) := WithLp.toLp 2 fun p => @@ -550,6 +553,7 @@ lemma rungWeight_add_two (ko kh m : ℕ) : the product of the first `g` rotations `e^{-i G_l θ_l/2}`. In `Rotation.lean`'s angle convention `rot G θ` is the `+` exponential `e^{+i G θ/2}`, so one step of the Heisenberg evolution is `O ↦ rot G θ * O * rot G (-θ)` and the conjugation angle is `θ`. -/ +@[expose] noncomputable def traj (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ | 0 => O diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/LayerCounterexample.lean b/LeanPool/LowWeightPauliDynamics/Pauli/LayerCounterexample.lean index 041ad415c8..5cdec5d83e 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/LayerCounterexample.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/LayerCounterexample.lean @@ -56,7 +56,7 @@ expanded; every other branch the recurrence meets is shown to vanish by the soun `partnerSign`. Nothing is evaluated numerically. -/ -@[expose] public section +public section namespace Lean4LPD.LayerCounterexample diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/LayerError.lean b/LeanPool/LowWeightPauliDynamics/Pauli/LayerError.lean index 2d40d41699..c7e83503c8 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/LayerError.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/LayerError.lean @@ -77,7 +77,7 @@ All bounds are in the normalized Pauli 2-norm. Expectation values in a state, an of the Trotter circuit with the Hamiltonian evolution, are not treated here. -/ -@[expose] public section +public section namespace Lean4LPD @@ -125,6 +125,7 @@ variable {n : ℕ} /-- The untruncated evolution through the first `i` layers of a fixed block, as used to define `Õ^{(d)}_{≥w*+1}` in `apd:eq:step_component`. -/ +@[expose] noncomputable def layerBlockTraj (layers : ℕ → List (PauliString n × ℝ)) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ | 0 => O @@ -142,6 +143,7 @@ theorem layerBlockTraj_succ (layers : ℕ → List (PauliString n × ℝ)) /-- The LPD recurrence: evolve through a whole block of `Γ` layers, then keep Pauli weights at most `wstar`. This is the recurrence of the kept operator in `apd:eq:step_component`. It is defined directly, not as a subsequence of `layerScheduledTraj`. -/ +@[expose] noncomputable def layerStepTraj (layers : ℕ → List (PauliString n × ℝ)) (Γ wstar : ℕ) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ | 0 => O @@ -161,6 +163,7 @@ theorem layerStepTraj_succ (layers : ℕ → List (PauliString n × ℝ)) /-- Execute the repeated fixed block with a cut after each multiple of `Γ` **layers**. This uses the boundary convention of `apd:thm:triangle`. -/ +@[expose] noncomputable def layerScheduledTraj (layers : ℕ → List (PauliString n × ℝ)) (Γ wstar : ℕ) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ := layerTraj (fun T => layers (T % Γ)) (trotterSchedule Γ wstar) O @@ -346,7 +349,9 @@ theorem sum_pauliNorm_discardedLayerStep_le_chain (entryFactor_nonneg_all hkh1 hc ha) (pauliNorm_nonneg O) hm hΓ r (layerStepMass layers Γ (rungWeight ko kh m) O) (fun d _ => layerStepMass_reset layers (Nat.le_add_right ko _) hloc d) - (fun d _ i hi => layerStepMass_inflow layers Γ O hkh hL hherm ha hsin hm hb d i hi) + (fun d _ i hi => by + simpa only [ML, pauliMultiLadder_N] using + layerStepMass_inflow layers Γ O hkh hL hherm ha hsin hm hb d i hi) simpa only [pauliNorm_discardedLayerStep, layerStepMass] using h /-- Layer conjugation is additive, supporting the operator telescope of @@ -395,7 +400,8 @@ noncomputable def layerBlockEnd (layers : ℕ → List (PauliString n × ℝ)) ( /-- `layerBlockEnd` applies the matrix evolution `layerBlockTraj` through `Γ` layers (`apd:thm:triangle`). -/ @[simp] theorem layerBlockEnd_apply (layers : ℕ → List (PauliString n × ℝ)) (Γ : ℕ) - (A : Matrix (Bits n) (Bits n) ℂ) : layerBlockEnd layers Γ A = layerBlockTraj layers A Γ := rfl + (A : Matrix (Bits n) (Bits n) ℂ) : layerBlockEnd layers Γ A = layerBlockTraj layers A Γ := by + rfl /-- **The operator telescope for layered steps.** This is the identity in `apd:thm:triangle`: the untruncated evolution minus the LPD output after `r` steps is the sum of the discarded @@ -509,7 +515,10 @@ theorem sum_pauliNorm_discardedLayerStep_le_cZero have h := MultiLadder.sum_block_epsJump_le_cZero ML hkh1 hc ha hb hA (pauliNorm_nonneg O) hΓ hr haA m (layerStepMass layers Γ (rungWeight ko kh (m + 1)) O) (fun d _ => layerStepMass_reset layers (Nat.le_add_right ko _) hloc d) - (fun d _ i hi => layerStepMass_inflow layers Γ O hkh hL hherm ha hsin (by omega) hb1 d i hi) + (fun d _ i hi => by + simpa only [ML, pauliMultiLadder_N] using + layerStepMass_inflow layers Γ O (m := m + 1) hkh hL hherm ha hsin + (by omega) hb1 d i hi) simpa only [pauliNorm_discardedLayerStep, layerStepMass] using h /-- The truncation error obeys the `c₀` bound diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/LayerFlow.lean b/LeanPool/LowWeightPauliDynamics/Pauli/LayerFlow.lean index 596f4156a6..cb72c9fb7e 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/LayerFlow.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/LayerFlow.lean @@ -76,7 +76,7 @@ No `MultiLadder` is constructed here; the passage from the finite inflow sum to with the infinite entry factor is in `LayerLadder.lean`. -/ -@[expose] public section +public section namespace Lean4LPD.PauliString @@ -87,6 +87,7 @@ variable {n : ℕ} /-- The unchanged branch of a rotation: identity on commuting coordinates and cosine on anticommuting coordinates (`apd:thm:layer_inflow`). -/ +@[expose] noncomputable def stayAct (G : PauliString n) (θ : ℝ) (y : EuclideanSpace ℂ (PauliIndex n)) : EuclideanSpace ℂ (PauliIndex n) := WithLp.toLp 2 fun p => @@ -94,6 +95,7 @@ noncomputable def stayAct (G : PauliString n) (θ : ℝ) /-- The sine branch, with the coefficient-side partner sign fixed by `coeffVec_conj`. Supporting definition for `apd:thm:layer_inflow`. -/ +@[expose] noncomputable def jumpAct (G : PauliString n) (θ : ℝ) (y : EuclideanSpace ℂ (PauliIndex n)) : EuclideanSpace ℂ (PauliIndex n) := WithLp.toLp 2 fun p => @@ -157,6 +159,7 @@ theorem jumpAct_add (G : PauliString n) (θ : ℝ) /-- Coefficient action of a finite ordered list of rotations, the composition of their `rotAct` (the head of the list acts last). For disjoint supports this is the layer of `apd:thm:layer_inflow`. -/ +@[expose] noncomputable def layerAct : List (PauliString n × ℝ) → EuclideanSpace ℂ (PauliIndex n) → EuclideanSpace ℂ (PauliIndex n) | [], y => y @@ -165,6 +168,7 @@ noncomputable def layerAct : List (PauliString n × ℝ) → /-- Matrix conjugation by the rotations of a list, in the same order as `layerAct`. It is defined from the rotation matrices `rot`, independently of the branch expansion (`apd:thm:layer_inflow`). -/ +@[expose] noncomputable def layerConj : List (PauliString n × ℝ) → Matrix (Bits n) (Bits n) ℂ → Matrix (Bits n) (Bits n) ℂ | [], O => O diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/LayerLadder.lean b/LeanPool/LowWeightPauliDynamics/Pauli/LayerLadder.lean index 84d71b75e2..b062062dee 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/LayerLadder.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/LayerLadder.lean @@ -57,7 +57,7 @@ high-weight norm before the cut. The two are related in `LayerError.lean`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -157,6 +157,7 @@ theorem layer_factor_eq_epsJump {ko kh m : ℕ} (hkh : 2 ≤ kh) (hm : 1 ≤ m) `Ls T` and then project onto the retained set `S T`. The trajectory is defined at operator level; its rung masses `layerN` are computed from it, and their recurrence is a theorem (`layerN_step`). -/ +@[expose] noncomputable def layerTraj (Ls : ℕ → List (PauliString n × ℝ)) (S : ℕ → Finset (PauliIndex n)) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ @@ -361,6 +362,16 @@ noncomputable def pauliMultiLadder (Ls : ℕ → List (PauliString n × ℝ)) init := layerN_init Ls S hloc step := layerN_step Ls S O hkh hL hherm ha hsin hb +/-- The Pauli ladder records the rung masses of the kept layer trajectory. -/ +@[simp] theorem pauliMultiLadder_N (Ls : ℕ → List (PauliString n × ℝ)) + (S : ℕ → Finset (PauliIndex n)) (O : Matrix (Bits n) (Bits n) ℂ) {ko kh : ℕ} + (hkh : 2 ≤ kh) (hL : ∀ T, IsLayer kh ((Ls T).map Prod.fst)) + (hherm : ∀ T, ∀ g ∈ Ls T, IsSelfAdjoint g.1) {a : ℝ} (ha : 0 ≤ a) + (hsin : ∀ T, ∀ g ∈ Ls T, |Real.sin g.2| ≤ a) + (hb : betaOf (kh - 1 : ℕ) ((ko : ℝ) / (kh - 1 : ℕ)) a < 1) + (hloc : ∀ p : PauliIndex n, ko < wt p → coeff O p = 0) : + (pauliMultiLadder Ls S O hkh hL hherm ha hsin hb hloc).N = layerN Ls S O ko kh := by rfl + /-- **The first-passage majorant for truncated Pauli layers.** The abstract bound `MultiLadder.le_majorant` (`apd:eq:composition_majorant`) applied to `pauliMultiLadder`: the mass of `layerTraj` above every rung `m ≥ 1` is at most the majorant built from `epsJump` and diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/LayerWitness.lean b/LeanPool/LowWeightPauliDynamics/Pauli/LayerWitness.lean index c09093fe00..7f8676501a 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/LayerWitness.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/LayerWitness.lean @@ -82,7 +82,7 @@ layer's supports are disjoint; each contributes at most `k_h` sites, and each of least one site of `p`. That is where the sharp factor `k_h` comes from rather than `k_h + 1`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -177,7 +177,7 @@ theorem support_subset_of_mem_branch (hq : q ∈ branch G p) : /-- **One layer**, applied generator by generator. The generators of a layer have disjoint supports and so commute, which is why the order in the list is immaterial to the result and why `branch`'s test can be read off the string entering the layer. -/ -def oneLayer : (L : List (PauliString n)) → (p : PauliString n) → Finset (PauliString n) +@[expose] def oneLayer : (L : List (PauliString n)) → (p : PauliString n) → Finset (PauliString n) | [], p => {p} | G :: Gs, p => (branch G p).biUnion (oneLayer Gs) @@ -189,7 +189,7 @@ def oneLayer : (L : List (PauliString n)) → (p : PauliString n) → Finset (Pa /-- **A sequence of layers**, applied one after another, the head of the list first. One Trotter step of the `p`th-order product formula `apd:eq:suzuki` is a sequence of `ΥΓ` layers. -/ -def reachable : (layers : List (List (PauliString n))) → (p : PauliString n) → +@[expose] def reachable : (layers : List (List (PauliString n))) → (p : PauliString n) → Finset (PauliString n) | [], p => {p} | L :: Ls, p => (oneLayer L p).biUnion (reachable Ls) @@ -415,9 +415,11 @@ Enough notation to write a concrete brickwork down. Both carry phase `0`, which choice for a string with no `Y` site (`isSelfAdjoint_iff_phase`). -/ /-- The single-site `X_i`. -/ +@[expose] def X (i : Fin n) : PauliString n := ⟨fun j => if j = i then 1 else 0, 0, 0⟩ /-- The single-site `Z_i`. -/ +@[expose] def Z (i : Fin n) : PauliString n := ⟨0, fun j => if j = i then 1 else 0, 0⟩ end PauliString @@ -431,9 +433,11 @@ namespace LayerWitness open PauliString /-- The **even** brickwork layer: generators on qubit pairs `(0,1)`, `(2,3)`, `(4,5)`, `(6,7)`. -/ +@[expose] def L₁ : List (PauliString 8) := [X 0 * Z 1, X 2 * X 3, Z 4 * X 5, X 6 * X 7] /-- The **odd** brickwork layer: generators on `(1,2)`, `(3,4)`, `(5,6)`. -/ +@[expose] def L₂ : List (PauliString 8) := [X 1 * Z 2, X 3 * X 4, X 5 * X 6] /-- Both layers are layers of `2`-local generators with disjoint supports: `k_h = 2`. -/ @@ -492,6 +496,7 @@ def P₄ : PauliString 8 := ⟨![0, 1, 1, 0, 1, 0, 0, 0], ![0, 0, 1, 1, 0, 0, 0, /-- The weight-`6` witness: site types `X Y Y Z Y X` on qubits `0,…,5`. Reachable from `Z₃` in `[L₁, L₂, L₁]`; its weight exceeds `w* k_h^Γ = 4`. -/ +@[expose] def P₆ : PauliString 8 := ⟨![1, 1, 1, 0, 1, 1, 0, 0], ![0, 1, 1, 1, 1, 0, 0, 0], 3⟩ theorem isSelfAdjoint_P₄ : IsSelfAdjoint P₄ := isSelfAdjoint_iff_phase.2 (by decide) diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Matrix.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Matrix.lean index 565708eb1a..85893883cb 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Matrix.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Matrix.lean @@ -77,7 +77,7 @@ by the matrix model. `Pauli/Branch.lean` assembles these into the paper's branching rule. -/ -@[expose] public section +public section namespace Lean4LPD @@ -99,9 +99,10 @@ private lemma pow_mod_of_pow_eq_one {x : ℂ} {N : ℕ} (hx : x ^ N = 1) (m : rw [pow_add, pow_mul, hx, one_pow, one_mul] /-- `i^k` for an exponent in `ZMod 4`. Well defined because `I ^ 4 = 1`. -/ -noncomputable def iPow (k : ZMod 4) : ℂ := Complex.I ^ k.val +@[expose] noncomputable def iPow (k : ZMod 4) : ℂ := Complex.I ^ k.val /-- `(-1)^a` for an exponent in `ZMod 2`. -/ +@[expose] noncomputable def negOnePow (a : ZMod 2) : ℂ := (-1 : ℂ) ^ a.val @[simp] lemma iPow_zero : iPow 0 = 1 := by simp [iPow] @@ -224,7 +225,7 @@ on bit strings: the entry in row `a`, column `b` is non-zero only when `a = b + This is a *definition*. That it deserves the name is `toMatrix_one`, `toMatrix_mul`, `toMatrix_star` (it is a `*`-monoid homomorphism) and `toMatrix_injective` (it is faithful). -/ -noncomputable def toMatrix (s : PauliString n) : Matrix (Bits n) (Bits n) ℂ := +@[expose] noncomputable def toMatrix (s : PauliString n) : Matrix (Bits n) (Bits n) ℂ := Matrix.of fun a b => if a = b + s.x then iPow s.phase * negOnePow (s.z ⬝ᵥ b) else 0 lemma toMatrix_apply (s : PauliString n) (a b : Bits n) : diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Tensor.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Tensor.lean index d1cd783f20..85e57d6ffb 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Tensor.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Tensor.lean @@ -46,7 +46,7 @@ binary or lexicographic ordering of the bit strings. * `bitsMatrixEquiv_star`: the change of index type preserves the adjoint. -/ -@[expose] public section +public section namespace Lean4LPD.PauliString @@ -124,6 +124,7 @@ theorem yPhase_succ {n : ℕ} (x z : Bits (n + 1)) : /-- Iterated, genuine Kronecker product of the independently specified one-qubit Paulis. The empty tensor is the one-by-one identity (`def:pauli_basis`). -/ +@[expose] noncomputable def tensorPauli : (n : ℕ) → Bits n → Bits n → Matrix (Bits n) (Bits n) ℂ | 0, _, _ => 1 | n + 1, x, z => @@ -211,6 +212,7 @@ theorem toMatrix_eq_phase_tensor : ∀ {n : ℕ} (s : PauliString n), /-- The positive tensor representative of a signless class, as in `def:pauli_basis`. Unlike `herm`, its phase is the full count of `Y` sites modulo four, not only the parity. -/ +@[expose] def tensorRepresentative {n : ℕ} (p : PauliIndex n) : PauliString n := ⟨p.1, p.2, yPhase p.1 p.2⟩ @@ -285,6 +287,7 @@ noncomputable def bitsEquivFin (n : ℕ) : Bits n ≃ Fin (2 ^ n) := /-- The bit-indexed and dimension-indexed matrix algebras are isomorphic, the type-level bridge needed by `def:pauli_basis`. -/ +@[expose] noncomputable def bitsMatrixEquiv (n : ℕ) : Matrix (Bits n) (Bits n) ℂ ≃ₐ[ℂ] Matrix (Fin (2 ^ n)) (Fin (2 ^ n)) ℂ := Matrix.reindexAlgEquiv ℂ ℂ (bitsEquivFin n) diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Trace.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Trace.lean index 80af77cb89..f562a0b292 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Trace.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Trace.lean @@ -56,7 +56,7 @@ and the sum is `2^n` at `u.z = 0` and `0` otherwise. The pairing statement then `toMatrix_star` and `toMatrix_mul`, since `(star s * t).x = s.x + t.x` in characteristic two. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/TrotterTruncate.lean b/LeanPool/LowWeightPauliDynamics/Pauli/TrotterTruncate.lean index ea5038f594..5da30485b4 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/TrotterTruncate.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/TrotterTruncate.lean @@ -45,7 +45,7 @@ nor any bound on the angles. The telescoping error estimate is in `TruncationErr layer-level version with its quantitative bound is in `LayerError.lean`. -/ -@[expose] public section +public section namespace Lean4LPD namespace PauliString @@ -56,6 +56,7 @@ variable {n : ℕ} /-- The end-of-step schedule of `apd:thm:triangle`: rotation `g` is followed by a cut exactly when `g+1` is a multiple of the block length. -/ +@[expose] def trotterSchedule (period wstar : ℕ) (g : ℕ) : Finset (PauliIndex n) := if (g + 1) % period = 0 then (highSet n wstar)ᶜ else univ @@ -78,6 +79,7 @@ theorem trotterSchedule_boundary (period wstar d : ℕ) (hp : 0 < period) : /-- Rotation-indexed execution of a fixed repeated block with end-of-step truncation (`apd:thm:triangle`; `apd:eq:step_component`). -/ +@[expose] noncomputable def trotterTraj (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (period wstar : ℕ) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ := @@ -101,6 +103,7 @@ theorem trotterTraj_succ (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) /-- The step-indexed recurrence, defined independently of `trotterTraj`: evolve through a whole block, then cut (`apd:eq:step_component`; `apd:thm:triangle`). -/ +@[expose] noncomputable def trotterStepTraj (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (period wstar : ℕ) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ @@ -171,6 +174,7 @@ theorem trotterTraj_at_boundary (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) /-- The discarded operator `X_{d+1}` of `apd:eq:step_component`: the operator at the end of the block before truncation, minus the kept operator. The zero-based index `d` is the number of steps completed before. -/ +@[expose] noncomputable def discardedStep (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (period wstar : ℕ) (O : Matrix (Bits n) (Bits n) ℂ) (d : ℕ) : Matrix (Bits n) (Bits n) ℂ := diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Truncate.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Truncate.lean index d900705016..49ab00f246 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Truncate.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Truncate.lean @@ -99,7 +99,7 @@ matrices `toMatrix`; their identification with the matrix exponential and with t proved in `RotationExp.lean` and `Pauli/Tensor.lean`. -/ -@[expose] public section +public section namespace Lean4LPD @@ -121,6 +121,7 @@ Defined as the rebuild `∑_{p ∈ S} x_p P_p` from the retained coefficients `x `P_p` the self-adjoint representative `herm p`. That this *is* a truncation — that it keeps the coefficients in `S` and kills the rest — is `coeff_truncOp`, and it does not depend on the Pauli expansion being complete. -/ +@[expose] noncomputable def truncOp (S : Finset (PauliIndex n)) (O : Matrix (Bits n) (Bits n) ℂ) : Matrix (Bits n) (Bits n) ℂ := ∑ p ∈ S, coeff O p • toMatrix (herm p) @@ -220,6 +221,7 @@ The retained set is a *family* `S : ℕ → Finset (PauliIndex n)`, one per rota algorithm truncates at the end of each Trotter step rather than after each rotation: `S g = univ` inside a step and `S g = (highSet n w*)ᶜ` at its boundary is that schedule. `trajTrunc_univ` records that the all-`univ` family is `traj` itself. -/ +@[expose] noncomputable def trajTrunc (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (S : ℕ → Finset (PauliIndex n)) (O : Matrix (Bits n) (Bits n) ℂ) : ℕ → Matrix (Bits n) (Bits n) ℂ diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/TruncationError.lean b/LeanPool/LowWeightPauliDynamics/Pauli/TruncationError.lean index 590f05aadb..05017f449f 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/TruncationError.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/TruncationError.lean @@ -45,7 +45,7 @@ expectation values in a state, where the entanglement of the evolved state enter formalized. The quantitative bound on the sum of the discarded norms is in `LayerError.lean`. -/ -@[expose] public section +public section namespace Lean4LPD namespace PauliString @@ -114,6 +114,7 @@ theorem traj_zero_input (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (g : ℕ /-- A complete untruncated rotation block, as an additive endomorphism. Its powers represent the residual whole-step evolutions in `apd:thm:triangle`. -/ +@[expose] noncomputable def blockEnd (Gs : ℕ → PauliString n) (θ : ℕ → ℝ) (period : ℕ) : AddMonoid.End (Matrix (Bits n) (Bits n) ℂ) where toFun A := traj Gs θ A period diff --git a/LeanPool/LowWeightPauliDynamics/Pauli/Weight.lean b/LeanPool/LowWeightPauliDynamics/Pauli/Weight.lean index bddcb7b79f..6e7cad7446 100644 --- a/LeanPool/LowWeightPauliDynamics/Pauli/Weight.lean +++ b/LeanPool/LowWeightPauliDynamics/Pauli/Weight.lean @@ -78,7 +78,7 @@ harmless, because the additive forms (`weight_le_weight_mul_add`, `weight_le_wei are proved first and the subtractive ones are derived from them. -/ -@[expose] public section +public section namespace Lean4LPD @@ -94,7 +94,7 @@ identity, `(1,0)` is `X`-type, `(0,1)` is `Z`-type, `(1,1)` is `Y`-type. These are labels up to phase, which is all the weight needs. At phase zero the `(1,1)` factor is literally `X Z = −i Y`, not `Y`; which of `Y`, `−Y` or a non-Hermitian multiple it is depends on the string's global phase, and the weight cannot see that (`weight_phaseMul`). -/ -def site (s : PauliString n) (i : Fin n) : ZMod 2 × ZMod 2 := (s.x i, s.z i) +@[expose] def site (s : PauliString n) (i : Fin n) : ZMod 2 × ZMod 2 := (s.x i, s.z i) @[simp] lemma site_mul (s t : PauliString n) (i : Fin n) : site (s * t) i = site s i + site t i := rfl @@ -110,14 +110,14 @@ def site (s : PauliString n) (i : Fin n) : ZMod 2 × ZMod 2 := (s.x i, s.z i) This is the support of a *single* Pauli string. `def:support` builds the support of a general operator from it, as the union of the supports of the Pauli strings that carry a non-zero coefficient. -/ -def support (s : PauliString n) : Finset (Fin n) := +@[expose] def support (s : PauliString n) : Finset (Fin n) := Finset.univ.filter (fun i => site s i ≠ 0) @[simp] lemma mem_support : i ∈ support s ↔ site s i ≠ 0 := by simp [support] /-- **The weight** `|s|` of a Pauli string, `def:pauli_weight`: the number of qubits on which it acts non-trivially. -/ -def weight (s : PauliString n) : ℕ := (support s).card +@[expose] def weight (s : PauliString n) : ℕ := (support s).card @[simp] lemma weight_one : weight (1 : PauliString n) = 0 := by simp [weight, support] diff --git a/LeanPool/LowWeightPauliDynamics/Rotation.lean b/LeanPool/LowWeightPauliDynamics/Rotation.lean index f01842c6fc..0185a18a9f 100644 --- a/LeanPool/LowWeightPauliDynamics/Rotation.lean +++ b/LeanPool/LowWeightPauliDynamics/Rotation.lean @@ -89,7 +89,7 @@ analogue of the anticommuting case is `CliffordAlgebra.ι_mul_ι_comm_of_isOrtho through it would cost more than the direct proof: the conjugator there is a vector, not a rotor. -/ -@[expose] public section +public section namespace Lean4LPD @@ -107,7 +107,7 @@ As a definition it is unconditional. When `G * G = 1` its two-sided inverse is ` and parity of `cos` and `sin` is what supplies that negative-angle expression, so no separate inverse definition is needed. Drop the involution hypothesis and there need be no inverse at all — `rot (0 : ℂ) π = 0`. -/ -noncomputable def rot (G : A) (θ : ℝ) : A := +@[expose] noncomputable def rot (G : A) (θ : ℝ) : A := (Real.cos (θ / 2) : ℂ) • 1 + (Complex.I * Real.sin (θ / 2)) • G /-- A zero-angle rotation is the identity. -/ diff --git a/LeanPool/LowWeightPauliDynamics/RotationExp.lean b/LeanPool/LowWeightPauliDynamics/RotationExp.lean index dfc1654ad7..9df5dc8b5e 100644 --- a/LeanPool/LowWeightPauliDynamics/RotationExp.lean +++ b/LeanPool/LowWeightPauliDynamics/RotationExp.lean @@ -41,7 +41,7 @@ product of one-qubit Pauli matrices is a separate statement, proved in `Pauli/Te for the matrix of a Hermitian Pauli string. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/LowWeightPauliDynamics/SchurCore.lean b/LeanPool/LowWeightPauliDynamics/SchurCore.lean index 91e7ef1c38..4c33e35894 100644 --- a/LeanPool/LowWeightPauliDynamics/SchurCore.lean +++ b/LeanPool/LowWeightPauliDynamics/SchurCore.lean @@ -20,7 +20,7 @@ This lightweight module depends only on Mathlib and is shared by the Pauli-dynam block/spectral-sensitivity developments. -/ -@[expose] public section +public section namespace Lean4LPD diff --git a/LeanPool/MRiscX.lean b/LeanPool/MRiscX.lean index 85df9d9748..5a77fd834b 100644 --- a/LeanPool/MRiscX.lean +++ b/LeanPool/MRiscX.lean @@ -23,7 +23,7 @@ Tags: hoare-logic, program-verification, risc-v, assembly, formal-methods MSC: 68Q60 -/ -@[expose] public section +public section /-! # MRiscX: a Hoare logic for unstructured RISC-V-like assembly in Lean diff --git a/LeanPool/MRiscX/AbstractSyntax/AbstractSyntax.lean b/LeanPool/MRiscX/AbstractSyntax/AbstractSyntax.lean index 78ad284368..f6f832a47f 100644 --- a/LeanPool/MRiscX/AbstractSyntax/AbstractSyntax.lean +++ b/LeanPool/MRiscX/AbstractSyntax/AbstractSyntax.lean @@ -14,7 +14,7 @@ public import LeanPool.MRiscX.AbstractSyntax.Instr This module provides core abstract-syntax types of the MRiscX assembly language. -/ -@[expose] public section +public section open Nat open Lean Lean.Elab /-- @@ -61,7 +61,7 @@ is the instruction Instr.Panic. IM := {uint64_1 ↦ instr_1, uint64_2 ↦ instr_2, ..., uint64_n ↦ instr_n} / default: Instr.IPanic -/ -def InstructionMap := TMap InstructionIndex Instr +@[expose] def InstructionMap := TMap InstructionIndex Instr deriving Repr, Inhabited instance : ToString InstructionMap where @@ -78,7 +78,7 @@ to an unsigned 64-bit integers. LM := {l_1 ↦ uint64_1, l_2 ↦ uint64_2, ..., l_n ↦ uint64_n} -/ -def LabelMap := PMap String UInt64 +@[expose] def LabelMap := PMap String UInt64 deriving Repr, Inhabited instance : ToString LabelMap where @@ -156,7 +156,7 @@ end Code Definiton of the registers R := {r_1 ↦ w_1, … , r_k ↦ w_k} -/ -def Registers := TMap Register UInt64 +@[expose] def Registers := TMap Register UInt64 deriving Repr /-- @@ -170,7 +170,7 @@ def EmptyRegisters : Registers := TMap.empty 0 Definiton of the memory M := {m_1 ↦ w_1, … , m_k ↦ w_k} -/ -def Memory := TMap MemoryAddress UInt64 +@[expose] def Memory := TMap MemoryAddress UInt64 deriving Repr diff --git a/LeanPool/MRiscX/AbstractSyntax/Instr.lean b/LeanPool/MRiscX/AbstractSyntax/Instr.lean index c44cd28768..1b65c6d0c7 100644 --- a/LeanPool/MRiscX/AbstractSyntax/Instr.lean +++ b/LeanPool/MRiscX/AbstractSyntax/Instr.lean @@ -5,7 +5,7 @@ Authors: Julius Marx -/ module -@[expose] public section +public section /-- Definition of the Instructions. diff --git a/LeanPool/MRiscX/AbstractSyntax/MState.lean b/LeanPool/MRiscX/AbstractSyntax/MState.lean index 638f738375..3d028ba3ce 100644 --- a/LeanPool/MRiscX/AbstractSyntax/MState.lean +++ b/LeanPool/MRiscX/AbstractSyntax/MState.lean @@ -16,7 +16,7 @@ while the termination flag indicates whether the machine state has halted or if evaluation should continue. -/ -@[expose] public section +public section /-- The state of the abstract machine: its memory, registers, program counter, loaded code, and termination flag. -/ structure MState where @@ -44,27 +44,27 @@ functions. namespace MState /-- The instruction at the current program counter. -/ - def currInstruction (ms:MState) : Instr := + @[expose] def currInstruction (ms:MState) : Instr := ms.code.instructionMap.get (ms.pc) /-- Increment the program counter by one. -/ - def incPc (ms:MState) : MState := + @[expose] def incPc (ms:MState) : MState := {ms with pc := ms.pc + 1} /-- Set the program counter to `p`. -/ - def setPc (ms:MState) (p:UInt64) : MState := + @[expose] def setPc (ms:MState) (p:UInt64) : MState := {ms with pc := p} /-- Replace the register file with `r`. -/ - def setRegister (ms:MState) (r:Registers) : MState := + @[expose] def setRegister (ms:MState) (r:Registers) : MState := {ms with registers := r} /-- Set register `i` to value `v`. -/ - def addRegister (ms:MState) (i:UInt64) (v:UInt64): MState := + @[expose] def addRegister (ms:MState) (i:UInt64) (v:UInt64): MState := {ms with registers := (i ↦ v; ms.registers)} /-- Read the value of register `i`. -/ - def getRegisterAt (ms:MState) (i:UInt64) : UInt64 := + @[expose] def getRegisterAt (ms:MState) (i:UInt64) : UInt64 := ms.registers.get (i) /-- Replace the memory with `m`. -/ @@ -72,11 +72,11 @@ namespace MState {ms with memory := m} /-- Set memory address `i` to value `v`. -/ - def addMemory (ms:MState) (i:UInt64) (v:UInt64) : MState := + @[expose] def addMemory (ms:MState) (i:UInt64) (v:UInt64) : MState := {ms with memory := (i ↦ v; ms.memory)} /-- Read the value at memory address `i`. -/ - def getMemoryAt (ms:MState) (i:UInt64) : UInt64 := + @[expose] def getMemoryAt (ms:MState) (i:UInt64) : UInt64 := ms.memory.get (i) /-- Replace the instruction map of the loaded code. -/ @@ -92,11 +92,11 @@ namespace MState {ms with code.labels := l} /-- Set the termination flag. -/ - def setTerminated (ms:MState) (bool:Bool) : MState := + @[expose] def setTerminated (ms:MState) (bool:Bool) : MState := {ms with terminated := bool} /-- Look up the target index of label `s`, if present. -/ - def getLabelAt (ms:MState) (s:String) : Option UInt64 := + @[expose] def getLabelAt (ms:MState) (s:String) : Option UInt64 := ms.code.labels.get s /-- Build a fresh machine state running the code `c`. -/ @@ -107,7 +107,7 @@ namespace MState This creates a Machine state with the pointer which the label [s] points to. If there is no label [s] in code.labels, terminated is set to true. -/ - def jump (ms:MState) (s:String) : MState := + @[expose] def jump (ms:MState) (s:String) : MState := match ms.code.labels.get s with | some i => {ms with pc := i} | none => {ms with terminated := true} diff --git a/LeanPool/MRiscX/AbstractSyntax/Map.lean b/LeanPool/MRiscX/AbstractSyntax/Map.lean index 5fb5c96e0f..4866640619 100644 --- a/LeanPool/MRiscX/AbstractSyntax/Map.lean +++ b/LeanPool/MRiscX/AbstractSyntax/Map.lean @@ -14,7 +14,7 @@ These maps are converted from -/ module -@[expose] public section +public section /-- Total map as recursive type with a key type α and value of type β. @@ -42,7 +42,7 @@ namespace TMap Let k ∈ α and v, d ∈ β. The function TMap.get(k) returns either the value v assigned to k or d as the default value if no assignment to k. -/ - def get {α : Type} [BEq α] [LawfulBEq α] {β : Type} (map : TMap α β) (k : α):= + @[expose] def get {α : Type} [BEq α] [LawfulBEq α] {β : Type} (map : TMap α β) (k : α):= match map with | TMap.empty d => d | TMap.put k' v t => if k == k' then v else TMap.get t k diff --git a/LeanPool/MRiscX/Basic.lean b/LeanPool/MRiscX/Basic.lean index 655d42c859..b89b22d5c3 100644 --- a/LeanPool/MRiscX/Basic.lean +++ b/LeanPool/MRiscX/Basic.lean @@ -19,4 +19,4 @@ public import LeanPool.MRiscX.Tactics.CodeProofTactics This module provides the top-level entry point gathering the MRiscX modules. -/ -@[expose] public section +public section diff --git a/LeanPool/MRiscX/Examples/Examples.lean b/LeanPool/MRiscX/Examples/Examples.lean index 3141a61bcc..e39bba3b1b 100644 --- a/LeanPool/MRiscX/Examples/Examples.lean +++ b/LeanPool/MRiscX/Examples/Examples.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Finiteness.Attr New Code Proofs -/ -@[expose] public section +public section attribute [local implicit_reducible] Registers Memory diff --git a/LeanPool/MRiscX/Examples/OtpProof.lean b/LeanPool/MRiscX/Examples/OtpProof.lean index a90cdf832c..da37a251d4 100644 --- a/LeanPool/MRiscX/Examples/OtpProof.lean +++ b/LeanPool/MRiscX/Examples/OtpProof.lean @@ -22,13 +22,13 @@ import Std.Tactic.BVDecide.Normalize.Prop This module provides the end-to-end One-Time-Pad correctness proof. -/ -@[expose] public section +public section /-- The precondition of the One-Time-Pad correctness proof, constraining the plaintext `p`, key `k`, ciphertext `c`, and length `l` addresses. -/ -def iPre (p k c l : UInt64) := +@[expose] def iPre (p k c l : UInt64) := p < k ∧ k < c ∧ c.toNat + l.toNat < UInt64.size ∧ (p + l - 1 < k ∧ k + l - 1 < c) diff --git a/LeanPool/MRiscX/Examples/SingleProofsOTP.lean b/LeanPool/MRiscX/Examples/SingleProofsOTP.lean index 3f796479e8..c223c36e50 100644 --- a/LeanPool/MRiscX/Examples/SingleProofsOTP.lean +++ b/LeanPool/MRiscX/Examples/SingleProofsOTP.lean @@ -19,7 +19,7 @@ import Std.Tactic.BVDecide.Normalize.Prop This module provides the per-instruction lemmas of the One-Time-Pad proof. -/ -@[expose] public section +public section attribute [local implicit_reducible] Registers Memory @@ -35,7 +35,7 @@ in the very long proof took quite a while on every change. /-- The precondition shared by the per-instruction One-Time-Pad proofs, constraining the plaintext `p`, key `k`, ciphertext `c`, and length `l` addresses. -/ -def iPre' (p k c l : UInt64) := +@[expose] def iPre' (p k c l : UInt64) := p < k ∧ k < c ∧ c.toNat + l.toNat < UInt64.size ∧ (p + l - 1 < k ∧ k + l - 1 < c) @@ -122,7 +122,7 @@ theorem help_I_pre''''' : ∀ (p k c l i x: UInt64), /-- The One-Time-Pad program, parameterised by the plaintext `p`, key `k`, ciphertext `c`, and length `l` memory addresses. -/ -def otpCode (p k c l : UInt64) := +@[expose] def otpCode (p k c l : UInt64) := mriscx main: la x 0, p @@ -273,6 +273,12 @@ theorem inc_otp_0 : ∀ (p k c l : UInt64), h_x7, h_x3, h_I_pre'⟩, h_terminated⟩ rw [←h_code'] rw [show ({10} : Set UInt64) = {9 + 1} by simp] + have h_step : p + (l - x) + 1 = p + (l - (x - 1)) := by + have h_sub : (l - x) + 1 = l - (x - 1) := by + rw [UInt64.sub_eq_add_neg l x, UInt64.sub_eq_add_neg l (x - 1), + UInt64.neg_sub, UInt64.sub_eq_add_neg 1 x] + ac_rfl + simpa only [UInt64.add_assoc] using congrArg (p + ·) h_sub apply specification_Increment (dst := 0) · simp · simp @@ -280,9 +286,13 @@ theorem inc_otp_0 : ∀ (p k c l : UInt64), · simpCurrInstr · exact h_pc · repeat (constructor <;> try assumption) - · simp at * - grind · simp_all + · have h_index : p + (l - x) = p + (l - (x - 1)) - 1 := by + calc + p + (l - x) = (p + (l - x) + 1) - 1 := + (UInt64.add_sub_cancel _ _).symm + _ = p + (l - (x - 1)) - 1 := by rw [h_step] + simp_all diff --git a/LeanPool/MRiscX/Examples/SpecAutomation.lean b/LeanPool/MRiscX/Examples/SpecAutomation.lean index 78ba07450e..f7b2959ebb 100644 --- a/LeanPool/MRiscX/Examples/SpecAutomation.lean +++ b/LeanPool/MRiscX/Examples/SpecAutomation.lean @@ -23,7 +23,7 @@ each branch of the instruction-dispatch in `Tactics/ApplySpec.lean` is covered b proved Hoare triple. -/ -@[expose] public section +public section /- Store via the inferred specification (`specification_StoreWordImmediate`). diff --git a/LeanPool/MRiscX/Hoare/HoareCore.lean b/LeanPool/MRiscX/Hoare/HoareCore.lean index 9fa85e7fb0..51172fe139 100644 --- a/LeanPool/MRiscX/Hoare/HoareCore.lean +++ b/LeanPool/MRiscX/Hoare/HoareCore.lean @@ -33,14 +33,14 @@ state before and after the execution of a command. This can be used to perform a structured proof later. -/ -@[expose] public section +public section /-- An assertion is a predicate on machine states. -/ abbrev Assertion : Type := MState → Prop /-- Conjunction of two assertions, holding when both hold. -/ -def Assertion.And (P Q : Assertion) : Assertion := fun st => (P st) ∧ (Q st) +@[expose] def Assertion.And (P Q : Assertion) : Assertion := fun st => (P st) ∧ (Q st) /-- Negation of an assertion, holding when the assertion does not. -/ -def Assertion.Not (P : Assertion) : Assertion := fun st => ¬(P st) +@[expose] def Assertion.Not (P : Assertion) : Assertion := fun st => ¬(P st) @@ -70,7 +70,7 @@ intermediate state between `s` and `s'` has a program counter in `L_w`. With the help of this relation, unambiguous statements can be made about the flow of the program. -/ -def weak (s s' : MState) (L_w L_b : Set UInt64) (c : Code) : Prop := +@[expose] def weak (s s' : MState) (L_w L_b : Set UInt64) (c : Code) : Prop := s.code = c → ∃ (n:Nat), n > 0 ∧ s.runNSteps n = s' ∧ (s'.pc) ∈ L_w ∧ ∀ (n':Nat), 0 < n' ∧ n' < n → @@ -88,7 +88,7 @@ there exists a successor state `s'` for which both the relation `weak(s, L_w ∪ L_b, s')` and `Q(s')`, `I(s')` and `s'.pc ∉ L_w` are satisfied. -/ -def hoareTripleUp (P Q : Assertion) (l : UInt64) (L_w L_b : Set UInt64) +@[expose] def hoareTripleUp (P Q : Assertion) (l : UInt64) (L_w L_b : Set UInt64) (c : Code) := L_w ∩ L_b = ∅ → @@ -104,7 +104,7 @@ Essentially the same as the `hoareTripleUp`, but instead of inspecting a whole c this relation only focusses on the instruction which is executed next. This can be used to reason about single instructions in order to define their specification. -/ -def hoare_triple_up_1 (P Q : Assertion) (l : UInt64) (L_w L_b : Set UInt64) (i : Instr) +@[expose] def hoare_triple_up_1 (P Q : Assertion) (l : UInt64) (L_w L_b : Set UInt64) (i : Instr) := L_w ∩ L_b = ∅ → L_w ≠ ∅ → diff --git a/LeanPool/MRiscX/Hoare/HoareRules.lean b/LeanPool/MRiscX/Hoare/HoareRules.lean index 581e5a1dfc..10bfe8cdb0 100644 --- a/LeanPool/MRiscX/Hoare/HoareRules.lean +++ b/LeanPool/MRiscX/Hoare/HoareRules.lean @@ -30,7 +30,7 @@ These statements must be valid in order for the conditions for applying the assu TODO: prove of S_LOOP -/ -@[expose] public section +public section /-- Allows to weaken the Hoare triple by removing a set diff --git a/LeanPool/MRiscX/Hoare/HoareTheory.lean b/LeanPool/MRiscX/Hoare/HoareTheory.lean index 151ecfc147..7cca064de2 100644 --- a/LeanPool/MRiscX/Hoare/HoareTheory.lean +++ b/LeanPool/MRiscX/Hoare/HoareTheory.lean @@ -15,7 +15,7 @@ This file contains some minor lemmas to ease the prove in the "main" file "Hoare Also, those lemmas can be used to deepen the understanding of the weak function. -/ -@[expose] public section +public section theorem weak_with_less_BL_weakens : ∀ (s s' : MState) (L_w L_b L : Set UInt64) (c : Code), weak s s' L_w L_b c → diff --git a/LeanPool/MRiscX/Parser/AssemblySyntax.lean b/LeanPool/MRiscX/Parser/AssemblySyntax.lean index be93961602..912daff140 100644 --- a/LeanPool/MRiscX/Parser/AssemblySyntax.lean +++ b/LeanPool/MRiscX/Parser/AssemblySyntax.lean @@ -13,7 +13,7 @@ public meta import Lean.Parser.Term This module provides the parser/grammar for MRiscX assembly syntax. -/ -@[expose] public section +public section open Lean Parser /- In this file, we extend Lean by introducing a new term. This term allows diff --git a/LeanPool/MRiscX/Parser/HoareSyntax.lean b/LeanPool/MRiscX/Parser/HoareSyntax.lean index 9195fa58fc..2c4806fe99 100644 --- a/LeanPool/MRiscX/Parser/HoareSyntax.lean +++ b/LeanPool/MRiscX/Parser/HoareSyntax.lean @@ -10,7 +10,7 @@ public import LeanPool.MRiscX.Parser.AssemblySyntax Syntax for hoare terms -/ -@[expose] public section +public section /-- Syntax category for a full MRiscX Hoare triple together with its program. -/ declare_syntax_cat hoareTerm diff --git a/LeanPool/MRiscX/Semantics/MsTheory.lean b/LeanPool/MRiscX/Semantics/MsTheory.lean index 40bfffd710..0ea9ba81bc 100644 --- a/LeanPool/MRiscX/Semantics/MsTheory.lean +++ b/LeanPool/MRiscX/Semantics/MsTheory.lean @@ -31,7 +31,7 @@ the `@[simp]`. This can shorten proofs because lean can apply these theorems with simp automatically. -/ -@[expose] public section +public section namespace MState diff --git a/LeanPool/MRiscX/Semantics/Run.lean b/LeanPool/MRiscX/Semantics/Run.lean index 75875189f8..003387ec34 100644 --- a/LeanPool/MRiscX/Semantics/Run.lean +++ b/LeanPool/MRiscX/Semantics/Run.lean @@ -13,7 +13,7 @@ public import LeanPool.MRiscX.AbstractSyntax.MState This module provides the operational `run` semantics of MRiscX. -/ -@[expose] public section +public section open Nat @@ -27,7 +27,7 @@ namespace MState /-- Conditional jump on one register: jump to `lbl` if `cond` holds of register `reg`, otherwise advance the program counter. -/ - def jif (ms: MState) (reg : UInt64) (lbl : String) (cond : UInt64 → Bool) := + @[expose] def jif (ms: MState) (reg : UInt64) (lbl : String) (cond : UInt64 → Bool) := let regCont := ms.getRegisterAt reg if cond regCont then ms.jump lbl @@ -36,6 +36,7 @@ namespace MState /-- Conditional jump on two registers: jump to `lbl` if `cond` holds of registers `reg1` and `reg2`, otherwise advance the program counter. -/ + @[expose] def jif' (ms: MState) (reg1 reg2 :UInt64) (lbl:String) (cond : UInt64 → UInt64 → Bool) := let reg1Cont := ms.getRegisterAt reg1 let reg2Cont := ms.getRegisterAt reg2 @@ -58,7 +59,7 @@ namespace MState When the instruction is not legal (e.g. jmp s, there is no label `s`), `terminated` is set to `true`. -/ - def runOneStep (ms:MState) : MState := + @[expose] def runOneStep (ms:MState) : MState := if ms.terminated then ms else let instr := ms.currInstruction @@ -115,7 +116,7 @@ namespace MState In: International Conference on Software Engineering and Formal Methods. Cham: Springer International Publishing, 2020. S. 193-213.` -/ - def runNSteps (ms:MState) (n:Nat) : MState := + @[expose] def runNSteps (ms:MState) (n:Nat) : MState := match n with | zero => ms | succ n' => ms.runOneStep.runNSteps n' diff --git a/LeanPool/MRiscX/Semantics/Specification.lean b/LeanPool/MRiscX/Semantics/Specification.lean index 9daab7de62..083e921081 100644 --- a/LeanPool/MRiscX/Semantics/Specification.lean +++ b/LeanPool/MRiscX/Semantics/Specification.lean @@ -22,7 +22,7 @@ import Std.Tactic.BVDecide.Normalize.Prop This module provides the per-instruction Hoare specifications. -/ -@[expose] public section +public section open Lean Elab Tactic /- diff --git a/LeanPool/MRiscX/Tactics/CodeProofTactics.lean b/LeanPool/MRiscX/Tactics/CodeProofTactics.lean index 8d40eae14a..ad149d8b71 100644 --- a/LeanPool/MRiscX/Tactics/CodeProofTactics.lean +++ b/LeanPool/MRiscX/Tactics/CodeProofTactics.lean @@ -30,7 +30,7 @@ import Mathlib.Tactic.Finiteness.Attr This module provides tactics for discharging MRiscX code-proof goals. -/ -@[expose] public section +public section open Lean Meta Elab Parser Tactic RCases diff --git a/LeanPool/MRiscX/Tactics/GeneralCustomTactics.lean b/LeanPool/MRiscX/Tactics/GeneralCustomTactics.lean index eaafb880ae..5850bf9602 100644 --- a/LeanPool/MRiscX/Tactics/GeneralCustomTactics.lean +++ b/LeanPool/MRiscX/Tactics/GeneralCustomTactics.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Finiteness.Attr This module provides general-purpose custom tactics for MRiscX. -/ -@[expose] public section +public section open Lean Elab Tactic Meta diff --git a/LeanPool/MRiscX/Tactics/SpecificationTactics.lean b/LeanPool/MRiscX/Tactics/SpecificationTactics.lean index ec3fa02645..54f03269fe 100644 --- a/LeanPool/MRiscX/Tactics/SpecificationTactics.lean +++ b/LeanPool/MRiscX/Tactics/SpecificationTactics.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Finiteness.Attr This module provides tactics proving the per-instruction specifications. -/ -@[expose] public section +public section open Lean Elab Tactic diff --git a/LeanPool/MRiscX/Tactics/TacticUtil.lean b/LeanPool/MRiscX/Tactics/TacticUtil.lean index 04656118e1..e3e921033a 100644 --- a/LeanPool/MRiscX/Tactics/TacticUtil.lean +++ b/LeanPool/MRiscX/Tactics/TacticUtil.lean @@ -13,7 +13,7 @@ public import Lean.Meta.Basic This module provides small utilities shared by the MRiscX tactics. -/ -@[expose] public section +public section open Lean Meta /-- Find the type of the local hypothesis named `n` in `ctx`, if present. -/ diff --git a/LeanPool/MRiscX/Util/BasicTheorems.lean b/LeanPool/MRiscX/Util/BasicTheorems.lean index 4d11974999..7b0281adf9 100644 --- a/LeanPool/MRiscX/Util/BasicTheorems.lean +++ b/LeanPool/MRiscX/Util/BasicTheorems.lean @@ -19,7 +19,7 @@ Some of them might actually already exists in the mathlib but i had trouble finding them. -/ -@[expose] public section +public section theorem excluded_middle_implication : ∀ (P Q C : Prop), (P ∧ Q → C) ∧ (P ∧ ¬Q → C) → diff --git a/LeanPool/MassFormula/Convergence.lean b/LeanPool/MassFormula/Convergence.lean index cf7a064e45..95aee10e37 100644 --- a/LeanPool/MassFormula/Convergence.lean +++ b/LeanPool/MassFormula/Convergence.lean @@ -30,7 +30,7 @@ summable `toReal`s (`ENNReal.summable_toReal`); identifying the terms is `toReal degré donné d'un corps local*, C. R. Acad. Sci. Paris **286** (1978), Série A, 1031–1036. -/ -@[expose] public section +public section open ValuativeRel open scoped ENNReal diff --git a/LeanPool/MassFormula/Defs.lean b/LeanPool/MassFormula/Defs.lean index 4dc0b05399..f6a5d5bdf9 100644 --- a/LeanPool/MassFormula/Defs.lean +++ b/LeanPool/MassFormula/Defs.lean @@ -57,7 +57,7 @@ short well-formedness facts are proved here. * [Serre1979] J-P. Serre, *Local fields*, Graduate Texts in Mathematics **67**, Springer, 1979. -/ -@[expose] public section +public section open ValuativeRel @@ -68,7 +68,7 @@ variable (K : Type*) [Field K] [ValuativeRel K] [UniformSpace K] [IsUniformAddGr /-- `q K` is the cardinality of the finite residue field `𝓀[K]` of `K`, that is `Nat.card 𝓀[K]` ([Serre 1978, p.1031][Serre1978]). -/ -noncomputable def q : ℕ := +@[expose] noncomputable def q : ℕ := Nat.card 𝓀[K] omit [IsUniformAddGroup K] in @@ -81,7 +81,7 @@ variable {K} /-- The ring of integers of a subextension `L` of `SeparableClosure K` / `K`: the integral closure of `𝒪[K]` in `L` ([Serre 1978, §3, p.1032][Serre1978]). (Introduced by the paper only in Section 3, but needed already here to say what *totally ramified* means.) -/ -noncomputable def integers (L : IntermediateField K (SeparableClosure K)) : +@[expose] noncomputable def integers (L : IntermediateField K (SeparableClosure K)) : Subalgebra ↥𝒪[K] ↥L := integralClosure ↥𝒪[K] ↥L @@ -89,18 +89,18 @@ noncomputable def integers (L : IntermediateField K (SeparableClosure K)) : extended along `algebraMap 𝒪[K] (integers L)`. For `L` / `K` finite this is the unique maximal ideal of the local ring `integers L`, but the definition itself carries no such obligations, and is junk for `L` infinite over `K`. -/ -noncomputable def maximalIdealAbove (L : IntermediateField K (SeparableClosure K)) : +@[expose] noncomputable def maximalIdealAbove (L : IntermediateField K (SeparableClosure K)) : Ideal (integers L) := (Ideal.map (algebraMap 𝒪[K] (integers L)) 𝓂[K]).radical /-- The ramification index of `L` / `K`: the exponent of `maximalIdealAbove L` in the extension of `𝓂[K]` to `integers L`, via Mathlib's junk-tolerant `Ideal.ramificationIdx'`. -/ -noncomputable def ramificationIdx (L : IntermediateField K (SeparableClosure K)) : ℕ := +@[expose] noncomputable def ramificationIdx (L : IntermediateField K (SeparableClosure K)) : ℕ := Ideal.ramificationIdx' 𝓂[K] (maximalIdealAbove L) /-- `L` / `K` is *totally ramified* when its ramification index equals its degree `Module.finrank K ↥L` ([Serre 1978, p.1031][Serre1978]). -/ -def IsTotallyRamified (L : IntermediateField K (SeparableClosure K)) : Prop := +@[expose] def IsTotallyRamified (L : IntermediateField K (SeparableClosure K)) : Prop := ramificationIdx L = Module.finrank K ↥L variable (K) @@ -108,7 +108,7 @@ variable (K) /-- The set of subextensions `L` of `SeparableClosure K` that are totally ramified over `K` and satisfy `Module.finrank K ↥L = n` ([Serre 1978, p.1031][Serre1978]). For `n = 0` the set is junk (the paper takes `1 ≤ n`), which is why every main theorem assumes `0 < n`. -/ -def sigma (n : ℕ) : Set (IntermediateField K (SeparableClosure K)) := +@[expose] def sigma (n : ℕ) : Set (IntermediateField K (SeparableClosure K)) := {L | Module.finrank K ↥L = n ∧ IsTotallyRamified L} variable {K} @@ -126,30 +126,32 @@ integral `K`-basis spans a sublattice of finite index in `integers L`, and the d sublattice is the square of the index times the discriminant of `integers L`. The present form needs no freeness or Dedekind-domain instances. For `L` infinite over `K` no such basis exists and the ideal is `⊥`—junk, as usual. -/ +@[expose] noncomputable def discIdeal (L : IntermediateField K (SeparableClosure K)) : Ideal ↥𝒪[K] := Ideal.span {x : ↥𝒪[K] | ∃ b : Module.Basis (Fin (Module.finrank K ↥L)) K ↥L, (∀ i, IsIntegral 𝒪[K] (b i)) ∧ algebraMap 𝒪[K] K x = Algebra.discr K ⇑b} /-- The valuation of the discriminant of `L` over `K`: the multiplicity of the maximal ideal `𝓂[K]` in `discIdeal L`, in the monoid of ideals of `𝒪[K]` ([Serre 1978, p.1031][Serre1978]). -/ -noncomputable def d (L : IntermediateField K (SeparableClosure K)) : ℕ := +@[expose] noncomputable def d (L : IntermediateField K (SeparableClosure K)) : ℕ := multiplicity 𝓂[K] (discIdeal L) /-- `c L` is `d L - n + 1`, where `n` is the degree `Module.finrank K ↥L`, written in the truncation-safe form `d L + 1 - n` ([Serre 1978, p.1031][Serre1978]). The bound `n - 1 ≤ d L` making the truncated subtraction faithful is the paper's own claim that `c L` is a nonnegative integer, the theorem `sub_one_le_d`. -/ -noncomputable def c (L : IntermediateField K (SeparableClosure K)) : ℕ := +@[expose] noncomputable def c (L : IntermediateField K (SeparableClosure K)) : ℕ := d L + 1 - Module.finrank K ↥L /-- The number of `K`-automorphisms of `L` ([Serre 1978, Remark 3°, p.1031][Serre1978]). -/ -noncomputable def w (L : IntermediateField K (SeparableClosure K)) : ℕ := +@[expose] noncomputable def w (L : IntermediateField K (SeparableClosure K)) : ℕ := Nat.card (↥L ≃ₐ[K] ↥L) /-- The paper's set of representatives, as a predicate rather than a quotient: `R` is a *set of representatives of the isomorphism classes of the elements of* `sigma K n`—it consists of elements of `sigma K n`, and every element of `sigma K n` is `K`-isomorphic to exactly one member of `R` ([Serre 1978, Remark 3°, p.1031][Serre1978]). -/ +@[expose] def IsRepresentativeSet (n : ℕ) (R : Set (IntermediateField K (SeparableClosure K))) : Prop := R ⊆ sigma K n ∧ ∀ L ∈ sigma K n, ∃! M, M ∈ R ∧ Nonempty (↥L ≃ₐ[K] ↥M) diff --git a/LeanPool/MassFormula/Discriminant.lean b/LeanPool/MassFormula/Discriminant.lean index f1dadf9909..c1a5a68e12 100644 --- a/LeanPool/MassFormula/Discriminant.lean +++ b/LeanPool/MassFormula/Discriminant.lean @@ -41,7 +41,7 @@ that uniformizer, and that derivative has valuation at least `n - 1` term by ter * [Serre1979] J-P. Serre, *Local fields*, Graduate Texts in Mathematics **67**, Springer, 1979. -/ -@[expose] public section +public section open ValuativeRel IntermediateField diff --git a/LeanPool/MassFormula/EisensteinMonogenic.lean b/LeanPool/MassFormula/EisensteinMonogenic.lean index 2ad772c95f..000da82744 100644 --- a/LeanPool/MassFormula/EisensteinMonogenic.lean +++ b/LeanPool/MassFormula/EisensteinMonogenic.lean @@ -36,7 +36,7 @@ identification. (The English translation of *Corps locaux*, whose numbering it keeps.) -/ -@[expose] public section +public section open ValuativeRel IntermediateField diff --git a/LeanPool/MassFormula/Finiteness.lean b/LeanPool/MassFormula/Finiteness.lean index 01412b0e46..9cff408f64 100644 --- a/LeanPool/MassFormula/Finiteness.lean +++ b/LeanPool/MassFormula/Finiteness.lean @@ -56,7 +56,7 @@ import Mathlib.RingTheory.Valuation.Integral * [Serre1979] J-P. Serre, *Local fields*, Graduate Texts in Mathematics **67**, Springer, 1979. -/ -@[expose] public section +public section open ValuativeRel IsDiscreteValuationRing open scoped ENNReal diff --git a/LeanPool/MassFormula/First.lean b/LeanPool/MassFormula/First.lean index 9f6506c4ea..019a11e1c6 100644 --- a/LeanPool/MassFormula/First.lean +++ b/LeanPool/MassFormula/First.lean @@ -76,7 +76,7 @@ of Theorem 1 (`tsum_one_div_q_pow_c`). * [Serre1979] J-P. Serre, *Local fields*, Graduate Texts in Mathematics **67**, Springer, 1979. -/ -@[expose] public section +public section open ValuativeRel MeasureTheory open scoped ENNReal Pointwise diff --git a/LeanPool/MassFormula/HaarScaling.lean b/LeanPool/MassFormula/HaarScaling.lean index 0b6a9994f2..1adf17ae03 100644 --- a/LeanPool/MassFormula/HaarScaling.lean +++ b/LeanPool/MassFormula/HaarScaling.lean @@ -62,7 +62,7 @@ Modeling decisions, local to this file: degré donné d'un corps local*, C. R. Acad. Sci. Paris **286** (1978), Série A, 1031–1036. -/ -@[expose] public section +public section open ValuativeRel MeasureTheory Module open scoped ENNReal Pointwise @@ -224,7 +224,7 @@ theorem card_quotient_range {n : ℕ} (M : Matrix (Fin n) (Fin n) 𝒪[K]) (hdet variable (K) in /-- The integer box of the coefficient space—the normalizing set of the paper's measure, which gives `𝒪[K]` volume `1` coordinatewise ([Serre 1978, p.1032][Serre1978]). -/ -def integerBox (n : ℕ) : Set (Fin n → K) := +@[expose] def integerBox (n : ℕ) : Set (Fin n → K) := Set.univ.pi fun _ => (𝒪[K] : Set K) /-- The image lattice `M · 𝒪^n` of an integral matrix, inside the coefficient space. -/ @@ -243,14 +243,14 @@ def box {n : ℕ} (π : 𝒪[K]) (e : Fin n → ℕ) : Set (Fin n → K) := /-- The coordinatewise inclusion of the integer box into the coefficient space, as an additive monoid homomorphism—the integral picture of the box. -/ -def toCoeff {n : ℕ} : (Fin n → 𝒪[K]) →+ (Fin n → K) where +@[expose] def toCoeff {n : ℕ} : (Fin n → 𝒪[K]) →+ (Fin n → K) where toFun y := fun i => (y i : K) map_zero' := by funext i; simp map_add' y z := by funext i; simp omit [UniformSpace K] [IsUniformAddGroup K] [IsNonarchimedeanLocalField K] in lemma toCoeff_apply {n : ℕ} (y : Fin n → 𝒪[K]) (i : Fin n) : - toCoeff y i = (y i : K) := rfl + toCoeff y i = (y i : K) := by rfl omit [UniformSpace K] [IsUniformAddGroup K] [IsNonarchimedeanLocalField K] in lemma toCoeff_injective {n : ℕ} : Function.Injective (toCoeff (K := K) (n := n)) := by diff --git a/LeanPool/MassFormula/Orbit.lean b/LeanPool/MassFormula/Orbit.lean index fcc7d18a47..9991f9c6a9 100644 --- a/LeanPool/MassFormula/Orbit.lean +++ b/LeanPool/MassFormula/Orbit.lean @@ -43,7 +43,7 @@ of the class is itself a corollary of the count. degré donné d'un corps local*, C. R. Acad. Sci. Paris **286** (1978), Série A, 1031–1036. -/ -@[expose] public section +public section open ValuativeRel diff --git a/LeanPool/MassFormula/RootLifting.lean b/LeanPool/MassFormula/RootLifting.lean index e674ef9134..b06dca8a7b 100644 --- a/LeanPool/MassFormula/RootLifting.lean +++ b/LeanPool/MassFormula/RootLifting.lean @@ -67,7 +67,7 @@ No topology on `L` enters anywhere: the completeness of `integers L` is the alge degré donné d'un corps local*, C. R. Acad. Sci. Paris **286** (1978), Série A, 1031–1036. -/ -@[expose] public section +public section open ValuativeRel IntermediateField IsDiscreteValuationRing @@ -255,7 +255,7 @@ variable {π : 𝒪[K]} {x : SeparableClosure K} /-- The generator `x` of `K⟮x⟯`, seen inside the integral closure—the canonical lift of `IntermediateField.AdjoinSimple.gen K x`. -/ -noncomputable def integralGen (hint : IsIntegral 𝒪[K] x) : +@[expose] noncomputable def integralGen (hint : IsIntegral 𝒪[K] x) : ↥(integers (IntermediateField.adjoin K {x})) := by have : IsScalarTower ↥𝒪[K] ↥(IntermediateField.adjoin K {x}) (SeparableClosure K) := IsScalarTower.of_algebraMap_eq' rfl @@ -404,7 +404,7 @@ lemma adjoinRootEquiv_root (hπ : Irreducible π) (hint : IsIntegral 𝒪[K] x) /-- The integral closure as a power basis over `𝒪[K]`, generated by the Eisenstein generator: the presentation of `integers L` as `𝒪[K][X]` modulo `(G)` carries the power basis of `AdjoinRoot` across. -/ -noncomputable def powerBasisOfEisenstein (hπ : Irreducible π) (hint : IsIntegral 𝒪[K] x) +@[expose] noncomputable def powerBasisOfEisenstein (hπ : Irreducible π) (hint : IsIntegral 𝒪[K] x) (hei : (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π})) : PowerBasis 𝒪[K] ↥(integers (IntermediateField.adjoin K {x})) := (AdjoinRoot.powerBasis' (minpoly.monic hint)).map (adjoinRootEquiv hπ hint hei) diff --git a/LeanPool/MassFormula/Second.lean b/LeanPool/MassFormula/Second.lean index 3357558dae..58c4a39014 100644 --- a/LeanPool/MassFormula/Second.lean +++ b/LeanPool/MassFormula/Second.lean @@ -41,7 +41,7 @@ elements of `sigma K n`, the sum of `1 / ((w M.1 : ℝ≥0∞) * (q K : ℝ≥0 degré donné d'un corps local*, C. R. Acad. Sci. Paris **286** (1978), Série A, 1031–1036. -/ -@[expose] public section +public section open ValuativeRel open scoped ENNReal diff --git a/LeanPool/MassFormula/Tame.lean b/LeanPool/MassFormula/Tame.lean index d0e1512080..154d86f3bc 100644 --- a/LeanPool/MassFormula/Tame.lean +++ b/LeanPool/MassFormula/Tame.lean @@ -44,7 +44,7 @@ Classically this is the characterization of tame ramification by `d = e - 1` * [Serre1979] J-P. Serre, *Local fields*, Graduate Texts in Mathematics **67**, Springer, 1979. -/ -@[expose] public section +public section open ValuativeRel IsDiscreteValuationRing diff --git a/LeanPool/MassFormula/UniformizerParam.lean b/LeanPool/MassFormula/UniformizerParam.lean index d9ac242855..486f16fe5a 100644 --- a/LeanPool/MassFormula/UniformizerParam.lean +++ b/LeanPool/MassFormula/UniformizerParam.lean @@ -71,7 +71,7 @@ Eisenstein polynomials enters it. degré donné d'un corps local*, C. R. Acad. Sci. Paris **286** (1978), Série A, 1031–1036. -/ -@[expose] public section +public section open ValuativeRel IsDiscreteValuationRing MeasureTheory open scoped ENNReal @@ -419,7 +419,7 @@ variable {R A : Type*} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {π : R} {ξ : A} {n : ℕ} /-- The polynomial expanding `y` in a power basis. -/ -noncomputable def expand (b : Module.Basis (Fin n) R A) (y : A) : Polynomial R := +@[expose] noncomputable def expand (b : Module.Basis (Fin n) R A) (y : A) : Polynomial R := ∑ i : Fin n, Polynomial.C (b.repr y i) * Polynomial.X ^ (i : ℕ) omit [IsDomain R] [IsDiscreteValuationRing R] [IsDomain A] [IsDiscreteValuationRing A] in @@ -443,7 +443,7 @@ private lemma degree_expand_lt (b : Module.Basis (Fin n) R A) (y : A) : /-- The monic degree-`n` annihilator of `y` read off a power basis at `y`: `y ^ n` minus its expansion in the lower powers. -/ -noncomputable def annih (b : Module.Basis (Fin n) R A) (y : A) : Polynomial R := +@[expose] noncomputable def annih (b : Module.Basis (Fin n) R A) (y : A) : Polynomial R := Polynomial.X ^ n - expand b (y ^ n) omit [IsDomain A] [IsDiscreteValuationRing A] in @@ -1016,7 +1016,7 @@ theorem toCoeff_equivFun_mem_imageLattice_iff (hπ : Irreducible π) (hint : IsI /-- The coordinate embedding of `integers L` into the coefficient space, in the monogenic basis (`basisOfEisenstein`): the chart in which the balls of `integers L` become the lattices of `HaarScaling.lean`. -/ -noncomputable def coord (hπ : Irreducible π) (hint : IsIntegral 𝒪[K] x) +@[expose] noncomputable def coord (hπ : Irreducible π) (hint : IsIntegral 𝒪[K] x) (hei : (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π})) (y : ↥(integers (IntermediateField.adjoin K {x}))) : Fin (minpoly 𝒪[K] x).natDegree → K := diff --git a/LeanPool/MatchingLogic.lean b/LeanPool/MatchingLogic.lean index be098157a6..631a5da74f 100644 --- a/LeanPool/MatchingLogic.lean +++ b/LeanPool/MatchingLogic.lean @@ -31,4 +31,4 @@ Tags: matching-logic, mathematical-logic, modal-logic, completeness, formal-meth MSC: 03B45, 03B70 -/ -@[expose] public section +public section diff --git a/LeanPool/MatchingLogic/Applicative.lean b/LeanPool/MatchingLogic/Applicative.lean index 4c5376b62c..1a17c78b8b 100644 --- a/LeanPool/MatchingLogic/Applicative.lean +++ b/LeanPool/MatchingLogic/Applicative.lean @@ -37,7 +37,7 @@ import LeanPool.MatchingLogic.Composite # MatchingLogic.Applicative -/ -@[expose] public section +public section namespace MatchingLogic namespace Applicative diff --git a/LeanPool/MatchingLogic/Boxes.lean b/LeanPool/MatchingLogic/Boxes.lean index ab05a7e015..78503fcc0a 100644 --- a/LeanPool/MatchingLogic/Boxes.lean +++ b/LeanPool/MatchingLogic/Boxes.lean @@ -25,7 +25,7 @@ import Mathlib.Data.Set.Lattice.Order # MatchingLogic.Boxes -/ -@[expose] public section +public section namespace MatchingLogic @@ -37,17 +37,17 @@ coordinate has a constant as its first component. -/ abbrev Coord (S : Signature) : Type := (σ : S.Sym) × Fin (S.arity σ) /-- `⟨e⟩ψ := σ(⊤, …, ψ, …, ⊤)` with `ψ` in position `i` (Definition 3). -/ -def dia (e : Coord S) (ψ : Pattern S Var) : Pattern S Var := +@[expose] def dia (e : Coord S) (ψ : Pattern S Var) : Pattern S Var := .app e.1 (fun j => if j = e.2 then ψ else Pattern.tp) /-- `[e]ψ := ⟨e⟩(ψ → ⊥) → ⊥` (Definition 3). -/ -def box (e : Coord S) (ψ : Pattern S Var) : Pattern S Var := +@[expose] def box (e : Coord S) (ψ : Pattern S Var) : Pattern S Var := .imp (dia e (.imp ψ .bot)) .bot /-- `[p]ψ := [e₁]⋯[eₘ]ψ` for a word `p = e₁⋯eₘ`, with `[ε]ψ := ψ` (Definition 3). Words are lists of coordinates; every word composes because there is only one sort. -/ -def boxes : List (Coord S) → Pattern S Var → Pattern S Var +@[expose] def boxes : List (Coord S) → Pattern S Var → Pattern S Var | [], ψ => ψ | e :: p, ψ => box e (boxes p ψ) @@ -58,7 +58,7 @@ def boxes : List (Coord S) → Pattern S Var → Pattern S Var namespace Model /-- One backward step along a single coordinate: `u ⇝_e v` (Definition 2). -/ -def stepAt (M : Model S) (e : Coord S) (u v : M.carrier) : Prop := +@[expose] def stepAt (M : Model S) (e : Coord S) (u v : M.carrier) : Prop := ∃ a : Fin (S.arity e.1) → M.carrier, u ∈ M.interp e.1 a ∧ v = a e.2 /-- `⇝_p` for a word `p`, the relational composite, with `⇝_ε = id` diff --git a/LeanPool/MatchingLogic/BoxesControl.lean b/LeanPool/MatchingLogic/BoxesControl.lean index b413e45e9f..3d2f98e3ca 100644 --- a/LeanPool/MatchingLogic/BoxesControl.lean +++ b/LeanPool/MatchingLogic/BoxesControl.lean @@ -25,7 +25,7 @@ import Mathlib.Order.BooleanAlgebra.Set # MatchingLogic.BoxesControl -/ -@[expose] public section +public section namespace MatchingLogic namespace BoxesControl diff --git a/LeanPool/MatchingLogic/Completeness.lean b/LeanPool/MatchingLogic/Completeness.lean index 65ff2d3ad4..a558837370 100644 --- a/LeanPool/MatchingLogic/Completeness.lean +++ b/LeanPool/MatchingLogic/Completeness.lean @@ -26,7 +26,7 @@ import LeanPool.MatchingLogic.Composite # MatchingLogic.Completeness -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/Composite.lean b/LeanPool/MatchingLogic/Composite.lean index 49e46fd95b..7ec0536656 100644 --- a/LeanPool/MatchingLogic/Composite.lean +++ b/LeanPool/MatchingLogic/Composite.lean @@ -23,7 +23,7 @@ import LeanPool.MatchingLogic.Locality # MatchingLogic.Composite -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/Core.lean b/LeanPool/MatchingLogic/Core.lean index 90bf8a302a..3e7e47459e 100644 --- a/LeanPool/MatchingLogic/Core.lean +++ b/LeanPool/MatchingLogic/Core.lean @@ -45,7 +45,7 @@ import Mathlib.Data.Set.Lattice.Order # MatchingLogic.Core -/ -@[expose] public section +public section namespace MatchingLogic @@ -122,12 +122,12 @@ variable {S : Signature} /-- The pointwise extension of a symbol to sets: `σ_M(A₁,…,Aₙ) = ⋃ {σ_M(a₁,…,aₙ) | aᵢ ∈ Aᵢ}`. It is `∅` as soon as some `Aᵢ` is (paper, Section 2). -/ -def app (M : Model S) (σ : S.Sym) (A : Fin (S.arity σ) → Set M.carrier) : +@[expose] def app (M : Model S) (σ : S.Sym) (A : Fin (S.arity σ) → Set M.carrier) : Set M.carrier := {u | ∃ a : Fin (S.arity σ) → M.carrier, (∀ i, a i ∈ A i) ∧ u ∈ M.interp σ a} /-- The denotation `ρ(φ) ⊆ M` (paper, Section 2). -/ -def denote {Var : Type} [DecidableEq Var] (M : Model S) : +@[expose] def denote {Var : Type} [DecidableEq Var] (M : Model S) : (Var → M.carrier) → Pattern S Var → Set M.carrier | ρ, .var x => {ρ x} | _, .bot => ∅ @@ -183,12 +183,12 @@ variable {S : Signature} (M : Model S) /-- One backward step: `u ⇝ v` when `u ∈ σ_M(a₁,…,aₙ)` for some tuple `a` with `v = a i` (paper, Definition 2). Constants contribute no steps, since `Fin 0` is empty. -/ -def Step (u v : M.carrier) : Prop := +@[expose] def Step (u v : M.carrier) : Prop := ∃ (σ : S.Sym) (a : Fin (S.arity σ) → M.carrier) (i : Fin (S.arity σ)), u ∈ M.interp σ a ∧ v = a i /-- `C` is backward closed when `⇝[C] ⊆ C` (paper, Definition 2). -/ -def BackwardClosed (C : Set M.carrier) : Prop := +@[expose] def BackwardClosed (C : Set M.carrier) : Prop := ∀ ⦃u⦄, u ∈ C → ∀ ⦃v⦄, M.Step u v → v ∈ C /-- The concrete form used in the proofs: if a point of `C` is produced by a diff --git a/LeanPool/MatchingLogic/Definedness.lean b/LeanPool/MatchingLogic/Definedness.lean index c107f85f5c..b5af97bb4f 100644 --- a/LeanPool/MatchingLogic/Definedness.lean +++ b/LeanPool/MatchingLogic/Definedness.lean @@ -44,7 +44,7 @@ import Mathlib.Data.Set.Insert # MatchingLogic.Definedness -/ -@[expose] public section +public section namespace MatchingLogic @@ -73,7 +73,7 @@ def definednessAxiom (x : Var) : Pattern (defSig S) Var := defined (.var x) symbols, and definedness interpreted as constantly everything on singletons — which the pointwise extension turns into `univ` on nonempty arguments and `∅` on empty ones. -/ -def expand (M : Model S) : Model (defSig S) where +@[expose] def expand (M : Model S) : Model (defSig S) where carrier := M.carrier nonempty := M.nonempty interp := fun s => match s with diff --git a/LeanPool/MatchingLogic/DoubleCover.lean b/LeanPool/MatchingLogic/DoubleCover.lean index b05b1372a3..917f1e191a 100644 --- a/LeanPool/MatchingLogic/DoubleCover.lean +++ b/LeanPool/MatchingLogic/DoubleCover.lean @@ -32,7 +32,7 @@ import Mathlib.Data.Set.Insert # MatchingLogic.DoubleCover -/ -@[expose] public section +public section namespace MatchingLogic @@ -56,14 +56,14 @@ assumptions in their own signatures -- only `C.Nonempty`, which the carrier needs. Backward closure, and `star ∉ C`, are hypotheses of Lemma 11 instead. So `cover` and `proj` are well formed outside the paper's domain, where they mean nothing; every theorem about them restores the assumptions. -/ -def cover (hne : C.Nonempty) : Model S where +@[expose] def cover (hne : C.Nonempty) : Model S where carrier := C × Bool nonempty := ⟨(⟨hne.choose, hne.choose_spec⟩, false)⟩ interp := coverInterp M C /-- The projections `π_i : N → M` of Definition 10: keep copy `i`, and send the other copy to a fixed `star ∈ M \ C`. -/ -def proj (star : M.carrier) (i : Bool) (p : C × Bool) : M.carrier := +@[expose] def proj (star : M.carrier) (i : Bool) (p : C × Bool) : M.carrier := if p.2 = i then (p.1 : M.carrier) else star private theorem proj_update (star : M.carrier) (i : Bool) diff --git a/LeanPool/MatchingLogic/EntryIII/All.lean b/LeanPool/MatchingLogic/EntryIII/All.lean index ee004ea38d..ee4916eb37 100644 --- a/LeanPool/MatchingLogic/EntryIII/All.lean +++ b/LeanPool/MatchingLogic/EntryIII/All.lean @@ -19,4 +19,4 @@ import Mathlib.Tactic.SetLike # MatchingLogic.EntryIII.All -/ -@[expose] public section +public section diff --git a/LeanPool/MatchingLogic/EntryIII/Alpha.lean b/LeanPool/MatchingLogic/EntryIII/Alpha.lean index e8550c5541..e93f8ab368 100644 --- a/LeanPool/MatchingLogic/EntryIII/Alpha.lean +++ b/LeanPool/MatchingLogic/EntryIII/Alpha.lean @@ -21,7 +21,7 @@ public import LeanPool.MatchingLogic.ProofSystem # MatchingLogic.EntryIII.Alpha -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/AlphaFreshWitnessed.lean b/LeanPool/MatchingLogic/EntryIII/AlphaFreshWitnessed.lean index 368c193d81..5d116ca3e1 100644 --- a/LeanPool/MatchingLogic/EntryIII/AlphaFreshWitnessed.lean +++ b/LeanPool/MatchingLogic/EntryIII/AlphaFreshWitnessed.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.FinCases # MatchingLogic.EntryIII.AlphaFreshWitnessed -/ -@[expose] public section +public section namespace MatchingLogic @@ -119,7 +119,7 @@ abbrev AlphaWitnessSig : Signature where /-- Public because `alphaBlocked` is public and unfolds through it: a private name in the type of a public declaration cannot be reached by the pin list. -/ -def pairArgs (p q : Pattern AlphaWitnessSig Nat) : +@[expose] def pairArgs (p q : Pattern AlphaWitnessSig Nat) : Fin 2 → Pattern AlphaWitnessSig Nat | ⟨0, _⟩ => p | ⟨1, _⟩ => q @@ -147,7 +147,7 @@ abbrev alphaWitnessModel : Model AlphaWitnessSig where def alphaWitnessRho : Nat → alphaWitnessModel.carrier := fun n => n = 0 /-- The complete pointed theory of `alphaWitnessModel` at `true`. -/ -def alphaWitnessTheory : Set (Pattern AlphaWitnessSig Nat) := +@[expose] def alphaWitnessTheory : Set (Pattern AlphaWitnessSig Nat) := pointedTheory alphaWitnessModel alphaWitnessRho true private theorem alphaWitnessRho_surjective : diff --git a/LeanPool/MatchingLogic/EntryIII/CanonicalChoice.lean b/LeanPool/MatchingLogic/EntryIII/CanonicalChoice.lean index d4093ebfee..5c89b2d6b7 100644 --- a/LeanPool/MatchingLogic/EntryIII/CanonicalChoice.lean +++ b/LeanPool/MatchingLogic/EntryIII/CanonicalChoice.lean @@ -22,7 +22,7 @@ import LeanPool.MatchingLogic.EntryIII.MCSAlpha # MatchingLogic.EntryIII.CanonicalChoice -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/CanonicalConstruction.lean b/LeanPool/MatchingLogic/EntryIII/CanonicalConstruction.lean index fbc4360df3..8ff16609bd 100644 --- a/LeanPool/MatchingLogic/EntryIII/CanonicalConstruction.lean +++ b/LeanPool/MatchingLogic/EntryIII/CanonicalConstruction.lean @@ -16,7 +16,7 @@ import LeanPool.MatchingLogic.EntryIII.WitnessElim # MatchingLogic.EntryIII.CanonicalConstruction -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/CanonicalCore.lean b/LeanPool/MatchingLogic/EntryIII/CanonicalCore.lean index 71d40a3b9e..def2ebceae 100644 --- a/LeanPool/MatchingLogic/EntryIII/CanonicalCore.lean +++ b/LeanPool/MatchingLogic/EntryIII/CanonicalCore.lean @@ -21,7 +21,7 @@ import LeanPool.MatchingLogic.EntryIII.MCSAlpha # MatchingLogic.EntryIII.CanonicalCore -/ -@[expose] public section +public section namespace MatchingLogic @@ -37,7 +37,7 @@ local instance instDecidableEqPatternNatCanonicalCore : DecidableEq (Pattern S N /-- A point of the canonical model is a maximal locally consistent set with fresh Henkin witnesses. The ordinary witnessed interface is recovered below. -/ -def CanonicalCarrier (S : Signature) := +@[expose] def CanonicalCarrier (S : Signature) := {Gamma : Set (Pattern S Nat) // IsMCS Gamma ∧ FreshWitnessed Gamma} instance CanonicalCarrier.coeSet : @@ -89,7 +89,7 @@ theorem CanonicalCarrier.exists_var_mem (Gamma : CanonicalCarrier S) : /-- Source Definition 72: `Gamma` is an output of `sigma` at component worlds `components` exactly when every pointwise choice of patterns from those worlds forms a `sigma`-application belonging to `Gamma`. -/ -def canonicalInterp (sigma : S.Sym) +@[expose] def canonicalInterp (sigma : S.Sym) (components : Fin (S.arity sigma) → CanonicalCarrier S) : Set (CanonicalCarrier S) := {Gamma | ∀ args : Fin (S.arity sigma) → Pattern S Nat, diff --git a/LeanPool/MatchingLogic/EntryIII/CanonicalExistence.lean b/LeanPool/MatchingLogic/EntryIII/CanonicalExistence.lean index 9a9fa3cbfa..482ab89dee 100644 --- a/LeanPool/MatchingLogic/EntryIII/CanonicalExistence.lean +++ b/LeanPool/MatchingLogic/EntryIII/CanonicalExistence.lean @@ -21,7 +21,7 @@ import LeanPool.MatchingLogic.EntryIII.MCSAlpha # MatchingLogic.EntryIII.CanonicalExistence -/ -@[expose] public section +public section namespace MatchingLogic @@ -34,7 +34,7 @@ noncomputable section /-- The exact one-sorted universal statement of the source's canonical Existence Lemma. It lives with the stage-system interface so the construction precedes, rather than imports, the Truth Lemma that consumes it. -/ -def CanonicalExistenceProperty (S : Signature) : Prop := +@[expose] def CanonicalExistenceProperty (S : Signature) : Prop := ∀ (Gamma : CanonicalCarrier S) (sigma : S.Sym) (args : Fin (S.arity sigma) → Pattern S Nat), Pattern.app sigma args ∈ Gamma.val → diff --git a/LeanPool/MatchingLogic/EntryIII/CaptureAvoiding.lean b/LeanPool/MatchingLogic/EntryIII/CaptureAvoiding.lean index 9d56e3a867..e69fafabf7 100644 --- a/LeanPool/MatchingLogic/EntryIII/CaptureAvoiding.lean +++ b/LeanPool/MatchingLogic/EntryIII/CaptureAvoiding.lean @@ -27,7 +27,7 @@ import Mathlib.Algebra.BigOperators.Group.Finset.Basic # MatchingLogic.EntryIII.CaptureAvoiding -/ -@[expose] public section +public section namespace MatchingLogic @@ -145,7 +145,7 @@ namespace Pattern open scoped BigOperators /-- Name-insensitive structural complexity for strong induction in the Truth Lemma. -/ -def complexity : Pattern S Nat → Nat +@[expose] def complexity : Pattern S Nat → Nat | .var _ => 1 | .bot => 1 | .app _ args => 1 + ∑ i, (args i).complexity @@ -239,7 +239,7 @@ theorem denote_eq {p q : Pattern S Nat} (h : AlphaEq p q) end AlphaEq /-- No existential binder in a pattern uses `y` as its raw name. -/ -def AvoidsBinder (y : Nat) : Pattern S Nat → Prop +@[expose] def AvoidsBinder (y : Nat) : Pattern S Nat → Prop | .var _ => True | .bot => True | .app _ args => ∀ i, AvoidsBinder y (args i) @@ -247,7 +247,7 @@ def AvoidsBinder (y : Nat) : Pattern S Nat → Prop | .ex z p => z ≠ y ∧ AvoidsBinder y p /-- Alpha-normalize all binders named `y`. -/ -def avoidBinder (y : Nat) : Pattern S Nat → Pattern S Nat +@[expose] def avoidBinder (y : Nat) : Pattern S Nat → Pattern S Nat | .var x => .var x | .bot => .bot | .app sigma args => .app sigma (fun i => avoidBinder y (args i)) @@ -351,7 +351,7 @@ theorem avoidBinder_eq_self_of_not_mem_allVars {y : Nat} {p : Pattern S Nat} simp [avoidBinder, Ne.symm hy.1, ih hy.2] /-- Total source-style capture-avoiding substitution on raw `Nat` names. -/ -def captureAvoidingSubst (x y : Nat) (p : Pattern S Nat) : Pattern S Nat := +@[expose] def captureAvoidingSubst (x y : Nat) (p : Pattern S Nat) : Pattern S Nat := substVar x y (avoidBinder y p) /-- Relational specification exposing the alpha-equivalent, capture-free body diff --git a/LeanPool/MatchingLogic/EntryIII/Compactness.lean b/LeanPool/MatchingLogic/EntryIII/Compactness.lean index fef24feb84..4e56d4b3af 100644 --- a/LeanPool/MatchingLogic/EntryIII/Compactness.lean +++ b/LeanPool/MatchingLogic/EntryIII/Compactness.lean @@ -12,7 +12,7 @@ public import Mathlib.ModelTheory.Satisfiability # MatchingLogic.EntryIII.Compactness -/ -@[expose] public section +public section namespace MatchingLogic.EntryIII @@ -25,7 +25,7 @@ variable {S : Signature} {Var : Type} [DecidableEq Var] /-- The relational first-order signature associated to a matching-logic signature. `sigma` of matching arity `k` becomes a relation of arity `k + 1`; coordinate zero is the output/current point. -/ -def relLanguage (S : Signature) : FirstOrder.Language where +@[expose] def relLanguage (S : Signature) : FirstOrder.Language where Functions := fun _ => Empty Relations := fun n => { sigma : S.Sym // S.arity sigma + 1 = n } diff --git a/LeanPool/MatchingLogic/EntryIII/Completion.lean b/LeanPool/MatchingLogic/EntryIII/Completion.lean index fb13a0d6d5..0e8178920d 100644 --- a/LeanPool/MatchingLogic/EntryIII/Completion.lean +++ b/LeanPool/MatchingLogic/EntryIII/Completion.lean @@ -21,7 +21,7 @@ public import LeanPool.MatchingLogic.EntryIII.Generated # MatchingLogic.EntryIII.Completion -/ -@[expose] public section +public section namespace MatchingLogic @@ -42,19 +42,19 @@ def Missing (root : CanonicalCarrier S) : Prop := /-- The source's conditional completion: all generated worlds are present, while `none` is a legal point exactly when `Missing root` holds. -/ -def CompletedCarrier (root : CanonicalCarrier S) := +@[expose] def CompletedCarrier (root : CanonicalCarrier S) := {o : Option (GeneratedCarrier root) // o = none → Missing root} namespace CompletedCarrier /-- A completed point is the added star precisely when its option is `none`. -/ -def isStar {root : CanonicalCarrier S} (point : CompletedCarrier root) : Prop := +@[expose] def isStar {root : CanonicalCarrier S} (point : CompletedCarrier root) : Prop := point.val = none end CompletedCarrier /-- Embed a generated world into the completed carrier. -/ -def completedEmbed (root : CanonicalCarrier S) (world : GeneratedCarrier root) : +@[expose] def completedEmbed (root : CanonicalCarrier S) (world : GeneratedCarrier root) : CompletedCarrier root := ⟨some world, by simp⟩ @@ -113,7 +113,7 @@ theorem completedCarrier_cases {root : CanonicalCarrier S} three cases exact: a star input admits no tuple; real outputs are the generated interpretation; and star is an additional output exactly when some real input is the generated root. -/ -def completedInterp (root : CanonicalCarrier S) (sigma : S.Sym) +@[expose] def completedInterp (root : CanonicalCarrier S) (sigma : S.Sym) (inputs : Fin (S.arity sigma) → CompletedCarrier root) : Set (CompletedCarrier root) := {output | ∃ components : Fin (S.arity sigma) → GeneratedCarrier root, diff --git a/LeanPool/MatchingLogic/EntryIII/Conclusion.lean b/LeanPool/MatchingLogic/EntryIII/Conclusion.lean index 7e02c586b5..852daa9ccb 100644 --- a/LeanPool/MatchingLogic/EntryIII/Conclusion.lean +++ b/LeanPool/MatchingLogic/EntryIII/Conclusion.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.Bound.Init # MatchingLogic.EntryIII.Conclusion -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/Countertheory.lean b/LeanPool/MatchingLogic/EntryIII/Countertheory.lean index 6b6445a3c4..fe22ed678a 100644 --- a/LeanPool/MatchingLogic/EntryIII/Countertheory.lean +++ b/LeanPool/MatchingLogic/EntryIII/Countertheory.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.SetLike # MatchingLogic.EntryIII.Countertheory -/ -@[expose] public section +public section namespace MatchingLogic @@ -33,7 +33,7 @@ variable {S : Signature} {Var : Type} [DecidableEq Var] /-- Finite pointed-model existence: every locally consistent theory presented by a list has a model, valuation, and point matching all its members. -/ -def FiniteLocalModelExistence (S : Signature) (Var : Type) [DecidableEq Var] : Prop := +@[expose] def FiniteLocalModelExistence (S : Signature) (Var : Type) [DecidableEq Var] : Prop := ∀ l : List (Pattern S Var), LocConsistent {delta | delta ∈ l} → ∃ (M : Model S) (rho : Var → M.carrier) (u : M.carrier), u ∈ M.denoteSet rho {delta | delta ∈ l} diff --git a/LeanPool/MatchingLogic/EntryIII/EmbeddingSemantics.lean b/LeanPool/MatchingLogic/EntryIII/EmbeddingSemantics.lean index f487fa53b2..16f6a4fff2 100644 --- a/LeanPool/MatchingLogic/EntryIII/EmbeddingSemantics.lean +++ b/LeanPool/MatchingLogic/EntryIII/EmbeddingSemantics.lean @@ -18,4 +18,4 @@ import Mathlib.Tactic.SetLike # MatchingLogic.EntryIII.EmbeddingSemantics -/ -@[expose] public section +public section diff --git a/LeanPool/MatchingLogic/EntryIII/FiniteReduction.lean b/LeanPool/MatchingLogic/EntryIII/FiniteReduction.lean index 1a07f5075b..6194557659 100644 --- a/LeanPool/MatchingLogic/EntryIII/FiniteReduction.lean +++ b/LeanPool/MatchingLogic/EntryIII/FiniteReduction.lean @@ -14,14 +14,14 @@ import LeanPool.MatchingLogic.EntryIII.Compactness # MatchingLogic.EntryIII.FiniteReduction -/ -@[expose] public section +public section namespace MatchingLogic variable {S : Signature} {Var : Type} [DecidableEq Var] /-- Strong local completeness restricted to theories presented by finite lists. -/ -def FiniteLocalCompleteness (S : Signature) (Var : Type) [DecidableEq Var] : Prop := +@[expose] def FiniteLocalCompleteness (S : Signature) (Var : Type) [DecidableEq Var] : Prop := ∀ (l : List (Pattern S Var)) (phi : Pattern S Var), LocalCons {delta | delta ∈ l} phi → Provable (∅ : Set (Pattern S Var)) (.imp (conj l) phi) diff --git a/LeanPool/MatchingLogic/EntryIII/Fresh.lean b/LeanPool/MatchingLogic/EntryIII/Fresh.lean index 8d0ef36ad7..e622da4f60 100644 --- a/LeanPool/MatchingLogic/EntryIII/Fresh.lean +++ b/LeanPool/MatchingLogic/EntryIII/Fresh.lean @@ -22,7 +22,7 @@ public import Mathlib.Data.Fintype.Basic # MatchingLogic.EntryIII.Fresh -/ -@[expose] public section +public section namespace MatchingLogic @@ -31,7 +31,7 @@ variable {S : Signature} {Var : Type} [DecidableEq Var] namespace Pattern /-- The finite set of every free or bound variable name occurring in a pattern. -/ -def allVars : Pattern S Var → Finset Var +@[expose] def allVars : Pattern S Var → Finset Var | .var x => {x} | .bot => ∅ | .app _ args => Finset.univ.biUnion (fun i => (args i).allVars) diff --git a/LeanPool/MatchingLogic/EntryIII/FreshWitnessElim.lean b/LeanPool/MatchingLogic/EntryIII/FreshWitnessElim.lean index bfbcbe0366..1fee5c7d3c 100644 --- a/LeanPool/MatchingLogic/EntryIII/FreshWitnessElim.lean +++ b/LeanPool/MatchingLogic/EntryIII/FreshWitnessElim.lean @@ -23,7 +23,7 @@ import LeanPool.MatchingLogic.EntryIII.MCSAlpha # MatchingLogic.EntryIII.FreshWitnessElim -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/Generated.lean b/LeanPool/MatchingLogic/EntryIII/Generated.lean index 1c591b1a06..0c23979753 100644 --- a/LeanPool/MatchingLogic/EntryIII/Generated.lean +++ b/LeanPool/MatchingLogic/EntryIII/Generated.lean @@ -23,7 +23,7 @@ import LeanPool.MatchingLogic.EntryIII.MCSAlpha # MatchingLogic.EntryIII.Generated -/ -@[expose] public section +public section namespace MatchingLogic @@ -77,7 +77,7 @@ def canonicalStep (parent child : CanonicalCarrier S) : Prop := /-- The smallest set of canonical worlds containing `root` and closed under backwards canonical symbol steps. -/ -def Generated (root world : CanonicalCarrier S) : Prop := +@[expose] def Generated (root world : CanonicalCarrier S) : Prop := Relation.ReflTransGen canonicalStep root world /-- The carrier of the submodel generated by `root`. -/ @@ -99,11 +99,11 @@ theorem witnessed {root : CanonicalCarrier S} (world : GeneratedCarrier root) : end GeneratedCarrier /-- The root as a point of its generated carrier. -/ -def generatedRoot (root : CanonicalCarrier S) : GeneratedCarrier root := +@[expose] def generatedRoot (root : CanonicalCarrier S) : GeneratedCarrier root := ⟨root, Relation.ReflTransGen.refl⟩ /-- The canonical interpretation restricted to generated inputs and outputs. -/ -def generatedInterp (root : CanonicalCarrier S) (sigma : S.Sym) +@[expose] def generatedInterp (root : CanonicalCarrier S) (sigma : S.Sym) (components : Fin (S.arity sigma) → GeneratedCarrier root) : Set (GeneratedCarrier root) := {world | world.val ∈ canonicalInterp sigma (fun i => (components i).val)} @@ -152,7 +152,7 @@ inductive GeneratingPath (root : CanonicalCarrier S) : /-- The one-step context for a generating coordinate, with `top` in all sibling positions as required by source Definition 76. -/ -def generatingStepContext (e : Coord S) : AppCtx S Nat := +@[expose] def generatingStepContext (e : Coord S) : AppCtx S Nat := .node e.1 e.2 (fun _ => Pattern.tp) .hole @[simp] theorem generatingStepContext_plug (e : Coord S) (p : Pattern S Nat) : @@ -162,7 +162,7 @@ def generatingStepContext (e : Coord S) : AppCtx S Nat := /-- The symbol context `C_path`, obtained by nesting one-step contexts in path order. -/ -def generatingContext (path : List (Coord S)) : AppCtx S Nat := +@[expose] def generatingContext (path : List (Coord S)) : AppCtx S Nat := path.foldl (fun C e => C.comp (generatingStepContext e)) .hole @[simp] theorem generatingContext_nil : diff --git a/LeanPool/MatchingLogic/EntryIII/Injection.lean b/LeanPool/MatchingLogic/EntryIII/Injection.lean index f367209efa..1447eca929 100644 --- a/LeanPool/MatchingLogic/EntryIII/Injection.lean +++ b/LeanPool/MatchingLogic/EntryIII/Injection.lean @@ -20,4 +20,4 @@ import Mathlib.Tactic.SetLike # MatchingLogic.EntryIII.Injection -/ -@[expose] public section +public section diff --git a/LeanPool/MatchingLogic/EntryIII/Lindenbaum.lean b/LeanPool/MatchingLogic/EntryIII/Lindenbaum.lean index 26bafa08eb..d1a0842fe2 100644 --- a/LeanPool/MatchingLogic/EntryIII/Lindenbaum.lean +++ b/LeanPool/MatchingLogic/EntryIII/Lindenbaum.lean @@ -21,7 +21,7 @@ import Mathlib.Order.Zorn # MatchingLogic.EntryIII.Lindenbaum -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/LocalTheory.lean b/LeanPool/MatchingLogic/EntryIII/LocalTheory.lean index 146d363c29..e83bb9d8cd 100644 --- a/LeanPool/MatchingLogic/EntryIII/LocalTheory.lean +++ b/LeanPool/MatchingLogic/EntryIII/LocalTheory.lean @@ -21,7 +21,7 @@ public import Mathlib.Data.Set.BooleanAlgebra # MatchingLogic.EntryIII.LocalTheory -/ -@[expose] public section +public section namespace MatchingLogic @@ -222,17 +222,17 @@ private theorem Provable.imp_imp_and {Gamma : Set (Pattern S Var)} /-- `Γ ⊢loc φ`: a finite list of premises from `Γ` has a theorem implication to `φ`. Lists, rather than finite sets, are the pinned representation of the finite conjunction and make its bracketing explicit. -/ -def LocProvable (Gamma : Set (Pattern S Var)) (phi : Pattern S Var) : Prop := +@[expose] def LocProvable (Gamma : Set (Pattern S Var)) (phi : Pattern S Var) : Prop := ∃ l : List (Pattern S Var), (∀ delta ∈ l, delta ∈ Gamma) ∧ Provable (∅ : Set (Pattern S Var)) (.imp (conj l) phi) /-- Definition 68: local consistency. -/ -def LocConsistent (Gamma : Set (Pattern S Var)) : Prop := +@[expose] def LocConsistent (Gamma : Set (Pattern S Var)) : Prop := ¬ LocProvable Gamma (.bot : Pattern S Var) /-- Definition 68: a locally consistent set with no locally consistent strict extension. -/ -def IsMCS (Gamma : Set (Pattern S Var)) : Prop := +@[expose] def IsMCS (Gamma : Set (Pattern S Var)) : Prop := LocConsistent Gamma ∧ ∀ {Delta : Set (Pattern S Var)}, Gamma ⊂ Delta → ¬ LocConsistent Delta namespace LocProvable diff --git a/LeanPool/MatchingLogic/EntryIII/MCSAlpha.lean b/LeanPool/MatchingLogic/EntryIII/MCSAlpha.lean index f940e5f699..f065a81304 100644 --- a/LeanPool/MatchingLogic/EntryIII/MCSAlpha.lean +++ b/LeanPool/MatchingLogic/EntryIII/MCSAlpha.lean @@ -21,7 +21,7 @@ public import LeanPool.MatchingLogic.EntryIII.LocalTheory # MatchingLogic.EntryIII.MCSAlpha -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/ModelExistence.lean b/LeanPool/MatchingLogic/EntryIII/ModelExistence.lean index 50423db4f9..271aab5623 100644 --- a/LeanPool/MatchingLogic/EntryIII/ModelExistence.lean +++ b/LeanPool/MatchingLogic/EntryIII/ModelExistence.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Bound.Init # MatchingLogic.EntryIII.ModelExistence -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/Regression.lean b/LeanPool/MatchingLogic/EntryIII/Regression.lean index 80ead66d9f..5a0a12f294 100644 --- a/LeanPool/MatchingLogic/EntryIII/Regression.lean +++ b/LeanPool/MatchingLogic/EntryIII/Regression.lean @@ -28,7 +28,7 @@ import Mathlib.Data.Nat.SuccPred # MatchingLogic.EntryIII.Regression -/ -@[expose] public section +public section namespace MatchingLogic.EntryIIIRegression diff --git a/LeanPool/MatchingLogic/EntryIII/Renaming.lean b/LeanPool/MatchingLogic/EntryIII/Renaming.lean index 42e6bdde3b..6c2d405be7 100644 --- a/LeanPool/MatchingLogic/EntryIII/Renaming.lean +++ b/LeanPool/MatchingLogic/EntryIII/Renaming.lean @@ -22,7 +22,7 @@ public import Mathlib.Basic.Denumerable # MatchingLogic.EntryIII.Renaming -/ -@[expose] public section +public section namespace MatchingLogic @@ -31,7 +31,7 @@ variable {S : Signature} {Var Var' Var'' : Type} namespace Pattern /-- Rename every free and bound element-variable occurrence. -/ -def rename (f : Var → Var') : Pattern S Var → Pattern S Var' +@[expose] def rename (f : Var → Var') : Pattern S Var → Pattern S Var' | .var x => .var (f x) | .app σ args => .app σ (fun i => (args i).rename f) | .imp φ ψ => .imp (φ.rename f) (ψ.rename f) diff --git a/LeanPool/MatchingLogic/EntryIII/SignatureReduction.lean b/LeanPool/MatchingLogic/EntryIII/SignatureReduction.lean index ae22c77fbe..b563d81edb 100644 --- a/LeanPool/MatchingLogic/EntryIII/SignatureReduction.lean +++ b/LeanPool/MatchingLogic/EntryIII/SignatureReduction.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Bound.Init # MatchingLogic.EntryIII.SignatureReduction -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/SignatureRestriction.lean b/LeanPool/MatchingLogic/EntryIII/SignatureRestriction.lean index 7a017ee22f..49d7388fee 100644 --- a/LeanPool/MatchingLogic/EntryIII/SignatureRestriction.lean +++ b/LeanPool/MatchingLogic/EntryIII/SignatureRestriction.lean @@ -22,7 +22,7 @@ public import Mathlib.Logic.Equiv.List # MatchingLogic.EntryIII.SignatureRestriction -/ -@[expose] public section +public section namespace MatchingLogic @@ -31,7 +31,7 @@ variable {S : Signature} {Var : Type} [DecidableEq Var] namespace Signature /-- The sub-signature containing exactly the symbols in `F`. -/ -def restrict (F : Finset S.Sym) : Signature where +@[expose] def restrict (F : Finset S.Sym) : Signature where Sym := {sigma : S.Sym // sigma ∈ F} arity sigma := S.arity sigma.1 @@ -40,7 +40,7 @@ end Signature namespace Pattern /-- Regard a pattern over a finite sub-signature as a pattern over `S`. -/ -def liftSignature [DecidableEq S.Sym] (F : Finset S.Sym) : +@[expose] def liftSignature [DecidableEq S.Sym] (F : Finset S.Sym) : Pattern (S.restrict F) Var → Pattern S Var | .var x => .var x | .app sigma args => .app sigma.1 (fun i => (args i).liftSignature F) @@ -182,7 +182,7 @@ theorem PForm.subst_liftSignature [DecidableEq S.Sym] (F : Finset S.Sym) namespace AppCtx /-- Regard an application context over a finite sub-signature as one over `S`. -/ -def liftSignature [DecidableEq S.Sym] (F : Finset S.Sym) : +@[expose] def liftSignature [DecidableEq S.Sym] (F : Finset S.Sym) : AppCtx (S.restrict F) Var → AppCtx S Var | .hole => .hole | .node sigma i args C => diff --git a/LeanPool/MatchingLogic/EntryIII/SymbolSupport.lean b/LeanPool/MatchingLogic/EntryIII/SymbolSupport.lean index 620432ce1c..302f61e51e 100644 --- a/LeanPool/MatchingLogic/EntryIII/SymbolSupport.lean +++ b/LeanPool/MatchingLogic/EntryIII/SymbolSupport.lean @@ -15,7 +15,7 @@ public import Mathlib.Data.Fintype.Basic # MatchingLogic.EntryIII.SymbolSupport -/ -@[expose] public section +public section namespace MatchingLogic @@ -24,7 +24,7 @@ variable {S : Signature} {Var : Type} namespace Pattern /-- The finite set of signature symbols occurring in a pattern. -/ -def symbolSupport [DecidableEq S.Sym] : Pattern S Var → Finset S.Sym +@[expose] def symbolSupport [DecidableEq S.Sym] : Pattern S Var → Finset S.Sym | .var _ => ∅ | .bot => ∅ | .app sigma args => insert sigma (Finset.univ.biUnion (fun i => (args i).symbolSupport)) diff --git a/LeanPool/MatchingLogic/EntryIII/Truth.lean b/LeanPool/MatchingLogic/EntryIII/Truth.lean index ccfad40f5a..3c80385293 100644 --- a/LeanPool/MatchingLogic/EntryIII/Truth.lean +++ b/LeanPool/MatchingLogic/EntryIII/Truth.lean @@ -23,7 +23,7 @@ import Mathlib.Algebra.Order.BigOperators.Group.Finset # MatchingLogic.EntryIII.Truth -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/WitnessElim.lean b/LeanPool/MatchingLogic/EntryIII/WitnessElim.lean index 03a8970dea..6beead979b 100644 --- a/LeanPool/MatchingLogic/EntryIII/WitnessElim.lean +++ b/LeanPool/MatchingLogic/EntryIII/WitnessElim.lean @@ -24,7 +24,7 @@ import LeanPool.MatchingLogic.Soundness # MatchingLogic.EntryIII.WitnessElim -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/EntryIII/WitnessPush.lean b/LeanPool/MatchingLogic/EntryIII/WitnessPush.lean index 3b13dc17e1..f032c15ab2 100644 --- a/LeanPool/MatchingLogic/EntryIII/WitnessPush.lean +++ b/LeanPool/MatchingLogic/EntryIII/WitnessPush.lean @@ -23,7 +23,7 @@ import LeanPool.MatchingLogic.EntryIII.LocalTheory # MatchingLogic.EntryIII.WitnessPush -/ -@[expose] public section +public section namespace MatchingLogic @@ -33,7 +33,7 @@ namespace Pattern /-- Nested source notation `exists y1 ... exists yn, p`, with the list order giving the outer-to-inner binder order. -/ -def exList : List Nat -> Pattern S Nat -> Pattern S Nat +@[expose] def exList : List Nat -> Pattern S Nat -> Pattern S Nat | [], p => p | y :: ys, p => .ex y (exList ys p) diff --git a/LeanPool/MatchingLogic/EntryIII/WitnessSupply.lean b/LeanPool/MatchingLogic/EntryIII/WitnessSupply.lean index 0eb58c0ecd..d8fd060a8e 100644 --- a/LeanPool/MatchingLogic/EntryIII/WitnessSupply.lean +++ b/LeanPool/MatchingLogic/EntryIII/WitnessSupply.lean @@ -13,7 +13,7 @@ import Mathlib.Data.Set.Finite.Basic # MatchingLogic.EntryIII.WitnessSupply -/ -@[expose] public section +public section /-! The variable-supply hypothesis separating ordinary and fresh witnessedness. diff --git a/LeanPool/MatchingLogic/EntryIII/Witnessed.lean b/LeanPool/MatchingLogic/EntryIII/Witnessed.lean index 50bbb7715c..f5e9c2334b 100644 --- a/LeanPool/MatchingLogic/EntryIII/Witnessed.lean +++ b/LeanPool/MatchingLogic/EntryIII/Witnessed.lean @@ -24,7 +24,7 @@ import LeanPool.MatchingLogic.EntryIII.Lindenbaum # MatchingLogic.EntryIII.Witnessed -/ -@[expose] public section +public section namespace MatchingLogic @@ -40,14 +40,14 @@ local instance instDecidableEqPatternNatWitnessed : DecidableEq (Pattern S Nat) /-- A theory is witnessed when every existential it contains has a Henkin implication to one of its capture-avoiding variable instances. -/ -def Witnessed (Gamma : Set (Pattern S Nat)) : Prop := +@[expose] def Witnessed (Gamma : Set (Pattern S Nat)) : Prop := ∀ {x : Nat} {p : Pattern S Nat}, .ex x p ∈ Gamma → ∃ y : Nat, .imp (.ex x p) (Pattern.captureAvoidingSubst x y p) ∈ Gamma /-- A witnessed theory whose Henkin name is fresh for every raw occurrence in the existential body. This is the source construction's actual stronger invariant; `Witnessed` is its interface needed by the basic Truth Lemma. -/ -def FreshWitnessed (Gamma : Set (Pattern S Nat)) : Prop := +@[expose] def FreshWitnessed (Gamma : Set (Pattern S Nat)) : Prop := ∀ {x : Nat} {p : Pattern S Nat}, .ex x p ∈ Gamma → ∃ y : Nat, y ∉ p.allVars ∧ .imp (.ex x p) (Pattern.captureAvoidingSubst x y p) ∈ Gamma @@ -163,13 +163,13 @@ theorem locConsistent_insert_captureAvoidingWitness /-! ### Shared Henkin-stage infrastructure -/ /-- Iterate a witness-adjunction operation along an enumeration. -/ -def henkinStages {α : Type} (step : List α → α → List α) +@[expose] def henkinStages {α : Type} (step : List α → α → List α) (enum : Nat → α) (base : List α) : Nat → List α | 0 => base | n + 1 => step (henkinStages step enum base n) (enum n) /-- The union of the theories represented by all finite Henkin stages. -/ -def henkinLimit {α : Type} (stageTheory : List α → Set α) +@[expose] def henkinLimit {α : Type} (stageTheory : List α → Set α) (step : List α → α → List α) (enum : Nat → α) (base : List α) : Set α := {q | ∃ n, q ∈ stageTheory (henkinStages step enum base n)} diff --git a/LeanPool/MatchingLogic/EntryIII/WitnessedCollapse.lean b/LeanPool/MatchingLogic/EntryIII/WitnessedCollapse.lean index 679a3f2de0..73ab489679 100644 --- a/LeanPool/MatchingLogic/EntryIII/WitnessedCollapse.lean +++ b/LeanPool/MatchingLogic/EntryIII/WitnessedCollapse.lean @@ -17,7 +17,7 @@ import LeanPool.MatchingLogic.Soundness # MatchingLogic.EntryIII.WitnessedCollapse -/ -@[expose] public section +public section namespace MatchingLogic @@ -28,7 +28,7 @@ noncomputable section variable {S : Signature} /-- The complete theory of a model at one point under a fixed valuation. -/ -def pointedTheory (M : Model S) (rho : Nat → M.carrier) (u : M.carrier) : +@[expose] def pointedTheory (M : Model S) (rho : Nat → M.carrier) (u : M.carrier) : Set (Pattern S Nat) := {p | u ∈ M.denote rho p} @@ -103,10 +103,10 @@ abbrev witnessCollapseModel : Model WitnessCollapseSig where interp e := Empty.elim e /-- Variable `0` names `true`; every other variable names `false`. -/ -def witnessCollapseRho : Nat → witnessCollapseModel.carrier := fun n => n = 0 +@[expose] def witnessCollapseRho : Nat → witnessCollapseModel.carrier := fun n => n = 0 /-- The complete pointed theory at `true`. -/ -def witnessCollapseTheory : Set (Pattern WitnessCollapseSig Nat) := +@[expose] def witnessCollapseTheory : Set (Pattern WitnessCollapseSig Nat) := pointedTheory witnessCollapseModel witnessCollapseRho true private theorem witnessCollapseRho_surjective : Function.Surjective witnessCollapseRho := by diff --git a/LeanPool/MatchingLogic/EntryPoints.lean b/LeanPool/MatchingLogic/EntryPoints.lean index b8684ce787..f5c39320af 100644 --- a/LeanPool/MatchingLogic/EntryPoints.lean +++ b/LeanPool/MatchingLogic/EntryPoints.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Finiteness.Attr # MatchingLogic.EntryPoints -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/Independence.lean b/LeanPool/MatchingLogic/Independence.lean index 006450861a..ff1a5e5a47 100644 --- a/LeanPool/MatchingLogic/Independence.lean +++ b/LeanPool/MatchingLogic/Independence.lean @@ -41,7 +41,7 @@ import Mathlib.Data.Set.Lattice.Order # MatchingLogic.Independence -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MatchingLogic/Locality.lean b/LeanPool/MatchingLogic/Locality.lean index 40160acf26..4aa62de005 100644 --- a/LeanPool/MatchingLogic/Locality.lean +++ b/LeanPool/MatchingLogic/Locality.lean @@ -26,7 +26,7 @@ import Mathlib.Data.Set.Insert # MatchingLogic.Locality -/ -@[expose] public section +public section namespace MatchingLogic @@ -34,7 +34,7 @@ variable {S : Signature} {Var : Type} [DecidableEq Var] /-- The agreement condition of Lemma 9: on `C` the two valuations coincide, and off `C` they are both off `C`. -/ -def AgreeOn {M : Model S} (C : Set M.carrier) (ρ ρ' : Var → M.carrier) : Prop := +@[expose] def AgreeOn {M : Model S} (C : Set M.carrier) (ρ ρ' : Var → M.carrier) : Prop := ∀ x, (ρ x = ρ' x ∧ ρ x ∈ C) ∨ (ρ x ∉ C ∧ ρ' x ∉ C) /-- The concrete identity behind the `app`/symbol case of the paper's proof: diff --git a/LeanPool/MatchingLogic/Localization.lean b/LeanPool/MatchingLogic/Localization.lean index 6eb661bc35..cd56dc8f51 100644 --- a/LeanPool/MatchingLogic/Localization.lean +++ b/LeanPool/MatchingLogic/Localization.lean @@ -27,14 +27,14 @@ import Mathlib.Data.Set.Basic # MatchingLogic.Localization -/ -@[expose] public section +public section namespace MatchingLogic variable {S : Signature} {Var : Type} [DecidableEq Var] /-- **Definition 6 (localization).** `Δ_Γ := {[p]γ | γ ∈ Γ, p ∈ E*}`. -/ -def localize (Γ : Set (Pattern S Var)) : Set (Pattern S Var) := +@[expose] def localize (Γ : Set (Pattern S Var)) : Set (Pattern S Var) := {ψ | ∃ γ ∈ Γ, ∃ p : List (Coord S), ψ = boxes p γ} omit [DecidableEq Var] in diff --git a/LeanPool/MatchingLogic/Necessity.lean b/LeanPool/MatchingLogic/Necessity.lean index 2a9c76e3ae..c21a6536ed 100644 --- a/LeanPool/MatchingLogic/Necessity.lean +++ b/LeanPool/MatchingLogic/Necessity.lean @@ -27,7 +27,7 @@ import Mathlib.Data.Set.Insert # MatchingLogic.Necessity -/ -@[expose] public section +public section namespace MatchingLogic namespace Necessity diff --git a/LeanPool/MatchingLogic/ProofSystem.lean b/LeanPool/MatchingLogic/ProofSystem.lean index 88e1837d23..4e3c209464 100644 --- a/LeanPool/MatchingLogic/ProofSystem.lean +++ b/LeanPool/MatchingLogic/ProofSystem.lean @@ -52,7 +52,7 @@ import Mathlib.Data.Set.Insert # MatchingLogic.ProofSystem -/ -@[expose] public section +public section namespace MatchingLogic @@ -68,16 +68,16 @@ inductive PForm where deriving DecidableEq /-- Boolean evaluation under an assignment to the atoms. -/ -def PForm.eval (v : Nat → Bool) : PForm → Bool +@[expose] def PForm.eval (v : Nat → Bool) : PForm → Bool | .atom n => v n | .bot => false | .imp a b => !(a.eval v) || b.eval v /-- A propositional tautology. -/ -def PForm.Taut (p : PForm) : Prop := ∀ v, p.eval v = true +@[expose] def PForm.Taut (p : PForm) : Prop := ∀ v, p.eval v = true /-- Substituting patterns for the propositional atoms. -/ -def PForm.subst (θ : Nat → Pattern S Var) : PForm → Pattern S Var +@[expose] def PForm.subst (θ : Nat → Pattern S Var) : PForm → Pattern S Var | .atom n => θ n | .bot => .bot | .imp a b => .imp (PForm.subst θ a) (PForm.subst θ b) @@ -86,7 +86,7 @@ def PForm.subst (θ : Nat → Pattern S Var) : PForm → Pattern S Var /-- `φ[y/x]`, replacing the element variable `x` by `y`. Naive: it stops at a binder for `x`, but does not itself avoid capture of `y`. -/ -def substVar (x y : Var) : Pattern S Var → Pattern S Var +@[expose] def substVar (x y : Var) : Pattern S Var → Pattern S Var | .var z => if z = x then .var y else .var z | .bot => .bot | .app σ f => .app σ (fun i => substVar x y (f i)) @@ -109,7 +109,7 @@ strictly TOO STRONG: it rejected genuinely capture-safe substitutions, which would have made rule (3) weaker than Figure 2 and could have left Corollary 15 unprovable, with nothing failing to compile anywhere. See `captureFree_needs_notFree` below for a substitution the old version rejected. -/ -def CaptureFree (x y : Var) : Pattern S Var → Prop +@[expose] def CaptureFree (x y : Var) : Pattern S Var → Prop | .var _ => True | .bot => True | .app _ f => ∀ i, CaptureFree x y (f i) @@ -135,7 +135,7 @@ inductive AppCtx (S : Signature) (Var : Type) where (Fin (S.arity σ) → Pattern S Var) → AppCtx S Var → AppCtx S Var /-- `C[φ]`. -/ -def AppCtx.plug : AppCtx S Var → Pattern S Var → Pattern S Var +@[expose] def AppCtx.plug : AppCtx S Var → Pattern S Var → Pattern S Var | .hole, φ => φ | .node σ i args c, φ => .app σ (Function.update args i (c.plug φ)) @@ -299,7 +299,7 @@ theorem necessitation {Γ : Set (Pattern S Var)} {ψ : Pattern S Var} /-! ### The two black boxes -/ /-- Finite conjunction, `⋀ l`. -/ -def conj : List (Pattern S Var) → Pattern S Var +@[expose] def conj : List (Pattern S Var) → Pattern S Var | [] => Pattern.tp | φ :: l => Pattern.and φ (conj l) @@ -319,14 +319,14 @@ statement; strong local completeness is Theorem 3.7 (Theorem 83 of Chen and Rosu, *Matching μ-Logic*, 2019 technical report, https://hdl.handle.net/2142/102281). See `FINDINGS.md`. -/ -def StrongLocalCompleteness (S : Signature) (Var : Type) [DecidableEq Var] : Prop := +@[expose] def StrongLocalCompleteness (S : Signature) (Var : Type) [DecidableEq Var] : Prop := ∀ (Δ : Set (Pattern S Var)) (φ : Pattern S Var), LocalCons Δ φ → ∃ l : List (Pattern S Var), (∀ δ ∈ l, δ ∈ Δ) ∧ Provable (∅ : Set (Pattern S Var)) (.imp (conj l) φ) /-- **(S) Soundness.** `Γ ⊢ φ` implies `Γ ⊨ φ`. The paper uses this as a black box too, but unlike (L) it is within reach here: see `soundness` below. -/ -def Soundness (S : Signature) (Var : Type) [DecidableEq Var] : Prop := +@[expose] def Soundness (S : Signature) (Var : Type) [DecidableEq Var] : Prop := ∀ (Γ : Set (Pattern S Var)) (φ : Pattern S Var), Provable Γ φ → GlobalCons Γ φ end MatchingLogic diff --git a/LeanPool/MatchingLogic/Sanity.lean b/LeanPool/MatchingLogic/Sanity.lean index 8cd062cfed..928d274196 100644 --- a/LeanPool/MatchingLogic/Sanity.lean +++ b/LeanPool/MatchingLogic/Sanity.lean @@ -21,7 +21,7 @@ import Mathlib.Data.Set.Basic # MatchingLogic.Sanity -/ -@[expose] public section +public section namespace MatchingLogic namespace Model diff --git a/LeanPool/MatchingLogic/Semantics.lean b/LeanPool/MatchingLogic/Semantics.lean index 6435c3d6a3..e0c8d9cc55 100644 --- a/LeanPool/MatchingLogic/Semantics.lean +++ b/LeanPool/MatchingLogic/Semantics.lean @@ -20,14 +20,14 @@ import Mathlib.Data.Set.Insert # MatchingLogic.Semantics -/ -@[expose] public section +public section namespace MatchingLogic variable {S : Signature} {Var : Type} [DecidableEq Var] /-- The free variables of a pattern. `∃x` binds `x`. -/ -def FV : Pattern S Var → Set Var +@[expose] def FV : Pattern S Var → Set Var | .var x => {x} | .bot => ∅ | .app _ f => ⋃ i, FV (f i) @@ -37,7 +37,7 @@ def FV : Pattern S Var → Set Var /-- A pattern is closed when it has no free variables. The paper assumes throughout Sections 3-5 that `Γ` and `φ` are closed, without loss of generality. -/ -def Closed (φ : Pattern S Var) : Prop := FV φ = ∅ +@[expose] def Closed (φ : Pattern S Var) : Prop := FV φ = ∅ omit [DecidableEq Var] in @[simp] theorem FV_var (x : Var) : FV (.var x : Pattern S Var) = {x} := rfl @@ -105,26 +105,26 @@ theorem denote_closed (M : Model S) {φ : Pattern S Var} (hφ : Closed φ) /-! ### Definition 1: totality and the three consequence relations -/ /-- `φ` is total in `M` under `ρ` when `ρ(φ) = M`. -/ -def Model.Total (M : Model S) (ρ : Var → M.carrier) (φ : Pattern S Var) : Prop := +@[expose] def Model.Total (M : Model S) (ρ : Var → M.carrier) (φ : Pattern S Var) : Prop := M.denote ρ φ = Set.univ /-- `M ⊨ φ`: `φ` is total in `M` under every valuation. -/ -def Model.Sat (M : Model S) (φ : Pattern S Var) : Prop := ∀ ρ, M.Total ρ φ +@[expose] def Model.Sat (M : Model S) (φ : Pattern S Var) : Prop := ∀ ρ, M.Total ρ φ /-- `M ⊨ Γ`. -/ -def Model.SatSet (M : Model S) (Γ : Set (Pattern S Var)) : Prop := ∀ γ ∈ Γ, M.Sat γ +@[expose] def Model.SatSet (M : Model S) (Γ : Set (Pattern S Var)) : Prop := ∀ γ ∈ Γ, M.Sat γ /-- `ρ(Δ) = ⋂_{δ ∈ Δ} ρ(δ)`, with value `M` when `Δ = ∅`. -/ -def Model.denoteSet (M : Model S) (ρ : Var → M.carrier) +@[expose] def Model.denoteSet (M : Model S) (ρ : Var → M.carrier) (Δ : Set (Pattern S Var)) : Set M.carrier := ⋂ δ ∈ Δ, M.denote ρ δ /-- `Δ ⊨loc φ`: local consequence, comparing denotations pointwise. -/ -def LocalCons (Δ : Set (Pattern S Var)) (φ : Pattern S Var) : Prop := +@[expose] def LocalCons (Δ : Set (Pattern S Var)) (φ : Pattern S Var) : Prop := ∀ (M : Model S) (ρ : Var → M.carrier), M.denoteSet ρ Δ ⊆ M.denote ρ φ /-- `Γ ⊨ φ`: global consequence, asking for totality. -/ -def GlobalCons (Γ : Set (Pattern S Var)) (φ : Pattern S Var) : Prop := +@[expose] def GlobalCons (Γ : Set (Pattern S Var)) (φ : Pattern S Var) : Prop := ∀ M : Model S, M.SatSet Γ → M.Sat φ /-- For closed `φ`, `M ⊨ φ` says exactly `⟦φ⟧ = M`, with no valuation diff --git a/LeanPool/MatchingLogic/SetVariables.lean b/LeanPool/MatchingLogic/SetVariables.lean index 11df145544..1df58ee89d 100644 --- a/LeanPool/MatchingLogic/SetVariables.lean +++ b/LeanPool/MatchingLogic/SetVariables.lean @@ -34,7 +34,7 @@ import Mathlib.Data.Set.Insert # MatchingLogic.SetVariables -/ -@[expose] public section +public section namespace MatchingLogic namespace SetVariables diff --git a/LeanPool/MatchingLogic/Sorted.lean b/LeanPool/MatchingLogic/Sorted.lean index 1e115d24b2..77e67823e1 100644 --- a/LeanPool/MatchingLogic/Sorted.lean +++ b/LeanPool/MatchingLogic/Sorted.lean @@ -45,7 +45,7 @@ import Mathlib.Data.Set.Lattice.Order # MatchingLogic.Sorted -/ -@[expose] public section +public section namespace MatchingLogic namespace Sorted @@ -110,21 +110,21 @@ abbrev MVal (M : MModel S) (Var : Type) : Type := (s : S.Srt) → Var → M.carr /-- Updating a sorted valuation at one variable of one sort. This is the only place the sort indexing costs anything: the new value has sort `s'`, so it can only be installed at sort `s'`, and the equality has to be transported. -/ -noncomputable def mupdate (M : MModel S) (ρ : MVal M Var) (s' : S.Srt) (x : Var) +@[expose] noncomputable def mupdate (M : MModel S) (ρ : MVal M Var) (s' : S.Srt) (x : Var) (a : M.carrier s') : MVal M Var := letI := Classical.decEq S.Srt letI := Classical.decEq Var fun t y => if y = x then (if ht : t = s' then ht ▸ a else ρ t y) else ρ t y /-- The pointwise extension of a symbol, at its sorts. -/ -def MModel.app (M : MModel S) (σ : S.Sym) +@[expose] def MModel.app (M : MModel S) (σ : S.Sym) (A : (i : Fin (S.arity σ)) → Set (M.carrier (S.argSort σ i))) : Set (M.carrier (S.resSort σ)) := {u | ∃ a : (i : Fin (S.arity σ)) → M.carrier (S.argSort σ i), (∀ i, a i ∈ A i) ∧ u ∈ M.interp σ a} /-- The denotation, sort by sort. -/ -noncomputable def mdenote (M : MModel S) (ρ : MVal M Var) : +@[expose] noncomputable def mdenote (M : MModel S) (ρ : MVal M Var) : {s : S.Srt} → MPattern S Var s → Set (M.carrier s) | _, .var x s => {ρ s x} | _, .bot => ∅ @@ -152,7 +152,7 @@ theorem MModel.app_eq_empty (M : MModel S) (σ : S.Sym) exact hi /-- `M ⊨ φ`: `φ` is total at its own sort under every valuation. -/ -def MModel.Sat (M : MModel S) {s : S.Srt} (φ : MPattern S Var s) : Prop := +@[expose] def MModel.Sat (M : MModel S) {s : S.Srt} (φ : MPattern S Var s) : Prop := ∀ ρ : MVal M Var, mdenote M ρ φ = Set.univ /-- `M ⊨ Γ` for a HETEROGENEOUS theory: a set of sorted patterns, each total at @@ -166,7 +166,7 @@ def MModel.SatSetHet (M : MModel S) what Proposition 30 needs, since its `Γ` is a singleton of sort `a`. It is a special case of `SatSetHet`, not a different notion — `satSetHet_homogeneous` below records that. -/ -def MModel.SatSet (M : MModel S) {s : S.Srt} (Γ : Set (MPattern S Var s)) : Prop := +@[expose] def MModel.SatSet (M : MModel S) {s : S.Srt} (Γ : Set (MPattern S Var s)) : Prop := ∀ γ ∈ Γ, M.Sat γ /-- The homogeneous notion is the heterogeneous one restricted to a single @@ -184,7 +184,7 @@ theorem satSetHet_homogeneous (M : MModel S) {s : S.Srt} /-- `Γ ⊨ φ`, where `Γ` and `φ` may live at DIFFERENT sorts -- which is exactly the situation Proposition 30 exploits. -/ -def MGlobalCons {sΓ sφ : S.Srt} (Γ : Set (MPattern S Var sΓ)) +@[expose] def MGlobalCons {sΓ sφ : S.Srt} (Γ : Set (MPattern S Var sΓ)) (φ : MPattern S Var sφ) : Prop := ∀ M : MModel S, M.SatSet Γ → M.Sat φ diff --git a/LeanPool/MatchingLogic/SortedProof.lean b/LeanPool/MatchingLogic/SortedProof.lean index bd96ac80ed..f9aaaa7e3d 100644 --- a/LeanPool/MatchingLogic/SortedProof.lean +++ b/LeanPool/MatchingLogic/SortedProof.lean @@ -58,7 +58,7 @@ import Mathlib.Data.Set.Lattice.Order # MatchingLogic.SortedProof -/ -@[expose] public section +public section -- `PForm` lives in ProofSystem.lean. Without this import, `autoImplicit` turns -- every mention of it into a fresh type VARIABLE and the file still elaborates @@ -203,6 +203,7 @@ theories, whereas the paper's many-sorted theories may mix sorts. That is exactly sufficient for Proposition 30, whose `Γ` is a singleton at sort `a`, and it keeps the induction below stated in terms of a single `sΓ`. An audit flagged the narrowing, so it is recorded here rather than silent. -/ +@[expose] def MSoundness (S : MSignature) (Var : Type) [DecidableEq S.Srt] [DecidableEq Var] : Prop := ∀ {sΓ sφ : S.Srt} (Γ : Set (MPattern S Var sΓ)) (φ : MPattern S Var sφ), MProvable Γ φ → MGlobalCons Γ φ diff --git a/LeanPool/MatchingLogic/Soundness.lean b/LeanPool/MatchingLogic/Soundness.lean index a513274df3..4b386569fb 100644 --- a/LeanPool/MatchingLogic/Soundness.lean +++ b/LeanPool/MatchingLogic/Soundness.lean @@ -25,7 +25,7 @@ import Mathlib.Data.Set.BooleanAlgebra # MatchingLogic.Soundness -/ -@[expose] public section +public section namespace MatchingLogic diff --git a/LeanPool/MaxFlowMinCut.lean b/LeanPool/MaxFlowMinCut.lean index 747f89b77c..133f430ee9 100644 --- a/LeanPool/MaxFlowMinCut.lean +++ b/LeanPool/MaxFlowMinCut.lean @@ -57,7 +57,7 @@ The development is `sorry`-free and uses only the standard axioms `propext`, `Classical.choice`, `Quot.sound`. -/ -@[expose] public section +public section namespace Contrib.MaxFlowMinCut diff --git a/LeanPool/MetricCodes.lean b/LeanPool/MetricCodes.lean index 00226faf8a..ba235d21fe 100644 --- a/LeanPool/MetricCodes.lean +++ b/LeanPool/MetricCodes.lean @@ -18,7 +18,7 @@ Tags: coding-theory, spherical-codes, kissing-number, harmonic-analysis, asympto MSC: 94B65, 52C17, 41A60 -/ -@[expose] public section +public section /-! ## Provenance diff --git a/LeanPool/MetricCodes/Binary.lean b/LeanPool/MetricCodes/Binary.lean index e6c9dd0f14..7a01c5513c 100644 --- a/LeanPool/MetricCodes/Binary.lean +++ b/LeanPool/MetricCodes/Binary.lean @@ -14,7 +14,7 @@ import all Mathlib.Analysis.SpecialFunctions.BinaryEntropy Asymptotic Johnson-scheme estimates and the binary-code variational bound. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -31,19 +31,19 @@ open scoped Topology namespace Asymptotics /-- The shell weight used in the Johnson-code argument. -/ -def shellWeight (a : ℝ) (n : ℕ) : ℕ := +@[expose] def shellWeight (a : ℝ) (n : ℕ) : ℕ := MetricCodes.Hamming.longitudinalDegree a n /-- The support degree used in the Johnson-code argument. -/ -def supportDegree (b : ℝ) (n : ℕ) : ℕ := +@[expose] def supportDegree (b : ℝ) (n : ℕ) : ℕ := MetricCodes.Hamming.longitudinalDegree b n /-- The complement degree used in the Johnson-code argument. -/ -def complementDegree (g : ℝ) (n : ℕ) : ℕ := +@[expose] def complementDegree (g : ℝ) (n : ℕ) : ℕ := MetricCodes.Hamming.longitudinalDegree g n /-- The terminal degree used in the Johnson-code argument. -/ -def terminalDegree (u : ℝ) (n : ℕ) : ℕ := +@[expose] def terminalDegree (u : ℝ) (n : ℕ) : ℕ := MetricCodes.Hamming.longitudinalDegree u n theorem tendsto_shellWeight_ratio {a : ℝ} (ha : 0 ≤ a) : @@ -624,7 +624,7 @@ theorem tendsto_logb_johnsonAmbientDimension hterminal hchoose hlower hupper /-- The window fibre quotient used in the Johnson-code argument. -/ -def windowFibreQuotient (a b g u : ℝ) (n : ℕ) : ℝ := +@[expose] def windowFibreQuotient (a b g u : ℝ) (n : ℕ) : ℝ := (MetricCodes.johnsonAmbientDimension n (supportDegree b n + complementDegree g n) (terminalDegree u n) : ℝ) / @@ -699,7 +699,7 @@ theorem tendsto_logb_windowFibreQuotient ring /-- The bassalygo factor used in the Johnson-code argument. -/ -def bassalygoFactor (a : ℝ) (n : ℕ) : ℝ := +@[expose] def bassalygoFactor (a : ℝ) (n : ℕ) : ℝ := (2 : ℝ) ^ n / (n.choose (shellWeight a n) : ℝ) theorem tendsto_logb_shellChoose @@ -751,7 +751,7 @@ theorem tendsto_logb_bassalygoFactor ring /-- The bassalygo window fibre quotient used in the Johnson-code argument. -/ -def bassalygoWindowFibreQuotient +@[expose] def bassalygoWindowFibreQuotient (a b g u : ℝ) (n : ℕ) : ℝ := bassalygoFactor a n * windowFibreQuotient a b g u n @@ -2010,7 +2010,7 @@ theorem AdmissibleDegrees.window_degree_le_weight omega /-- The global harmonic vector used in the Johnson-code argument. -/ -def globalHarmonicVector {n j : ℕ} +@[expose] def globalHarmonicVector {n j : ℕ} (f : MetricCodes.Boolean.Function n) (hf : MetricCodes.Boolean.IsHarmonic j f) : MetricCodes.Boolean.harmonicEuclideanLayer n j := @@ -2055,7 +2055,7 @@ theorem AdmissibleDegrees.window_degree_half omega /-- The coupled degree vector used in the Johnson-code argument. -/ -def coupledDegreeVector {n w p q L : ℕ} +@[expose] def coupledDegreeVector {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (x : JohnsonSphere n w) (i : Index p q L) (a : HarmonicFibreIndex n w p q) : @@ -2067,7 +2067,7 @@ def coupledDegreeVector {n w p q L : ℕ} (h.complementResidual_bound i) a) /-- The coupled degree coordinates used in the Johnson-code argument. -/ -def coupledDegreeCoordinates {n w p q L : ℕ} +@[expose] def coupledDegreeCoordinates {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (x : JohnsonSphere n w) (i : Index p q L) (a : HarmonicFibreIndex n w p q) @@ -2137,7 +2137,7 @@ theorem coupledDegreeCoordinates_pairing {n w p q L : ℕ} (h.complementResidual_bound i) a b /-- The johnson window fibre matrix used in the Johnson-code argument. -/ -def johnsonWindowFibreMatrix {n w p q L : ℕ} +@[expose] def johnsonWindowFibreMatrix {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (v : Space p q L) (x : JohnsonSphere n w) : Matrix (ShellWindowIndex n p q L) @@ -2191,7 +2191,7 @@ theorem johnsonWindowFibreMatrix_transpose_mul · simp only [hab, ↓reduceIte, mul_zero, Finset.sum_const_zero] /-- The johnson fibre matrix used in the Johnson-code argument. -/ -def johnsonFibreMatrix {n w p q L : ℕ} +@[expose] def johnsonFibreMatrix {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (v : Space p q L) (x : JohnsonSphere n w) : Matrix (Fin (MetricCodes.johnsonAmbientDimension n (p + q) L)) @@ -2252,7 +2252,7 @@ theorem johnsonFibreMatrix_transpose_mul {n w p q L : ℕ} hmatrix /-- The johnson projection family used in the Johnson-code argument. -/ -def johnsonProjectionFamily {n w p q L : ℕ} +@[expose] def johnsonProjectionFamily {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (v : Space p q L) (hv : ∀ i : Index p q L, 0 < v i) : @@ -4278,7 +4278,7 @@ theorem johnsonAdjacentChannel_orthogonal omega /-- The johnson axis tensor used in the Johnson-code argument. -/ -def johnsonAxisTensor {n w : ℕ} +@[expose] def johnsonAxisTensor {n w : ℕ} (x : JohnsonSphere n w) (f : MetricCodes.Boolean.Function n) : MetricCodes.Boolean.CoordinateFunction n := fun a => (geometricAxis x a) • f diff --git a/LeanPool/MetricCodes/Branching.lean b/LeanPool/MetricCodes/Branching.lean index 1ef328cd9e..b235bcee04 100644 --- a/LeanPool/MetricCodes/Branching.lean +++ b/LeanPool/MetricCodes/Branching.lean @@ -17,7 +17,7 @@ public import Mathlib.RingTheory.Regular.RegularSequence Trace ideals, Clebsch decompositions, and arbitrary-rank branching constructions. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -607,7 +607,7 @@ section open scoped BigOperators /-- The raise weight used in the spherical-code argument. -/ -def raiseWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) +@[expose] def raiseWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) (ℓ : Fin (r + 1)) : Fin (r + 1) → ℕ := Function.update lam ℓ (lam ℓ + 1) @@ -1011,7 +1011,7 @@ open scoped BigOperators Topology open MetricCodes.Spherical.HigherHierarchy /-- The floored coordinates used in the spherical-code argument. -/ -def flooredCoordinates {I : Type*} (a : I → ℝ) (n : ℕ) : I → ℕ := +@[expose] def flooredCoordinates {I : Type*} (a : I → ℝ) (n : ℕ) : I → ℕ := fun i => ⌊a i * (n : ℝ)⌋₊ theorem tendsto_flooredCoordinates_ratio {I : Type*} @@ -1278,7 +1278,7 @@ open MetricCodes.Spherical.HigherChannel abbrev Vertex (r m : ℕ) := Fin (r + 1) → Fin (m + 1) /-- The signature used in the spherical-code argument. -/ -def signature {r : ℕ} (a : Fin (r + 1) → ℝ) +@[expose] def signature {r : ℕ} (a : Fin (r + 1) → ℝ) (n : ℕ) {m : ℕ} (v : Vertex r m) : Fin (r + 1) → ℕ := fun i => flooredCoordinates a n i + (v i).val @@ -1620,7 +1620,7 @@ theorem tendsto_log_dimensionSum_div_log_two {r m : ℕ} exact tendsto_log_vertexDimension_div_log_two a ha hanti (fun _ => v) /-- The next vertex used in the spherical-code argument. -/ -def nextVertex {r m : ℕ} (v : Vertex r m) +@[expose] def nextVertex {r m : ℕ} (v : Vertex r m) (i : Fin (r + 1)) (h : (v i).val < m) : Vertex r m := Function.update v i ⟨(v i).val + 1, by omega⟩ @@ -3523,7 +3523,7 @@ abbrev BoxIndex (r m : ℕ) := (MetricCodes.Spherical.HigherHierarchy.RectangularVertices.Vertex r m)) /-- The box signature used in the spherical-code argument. -/ -def boxSignature {r m : ℕ} (a : Fin (r + 1) → ℝ) (n : ℕ) +@[expose] def boxSignature {r m : ℕ} (a : Fin (r + 1) → ℝ) (n : ℕ) (i : BoxIndex r m) : Fin (r + 1) → ℕ := MetricCodes.Spherical.HigherHierarchy.RectangularVertices.signature a n ((Fintype.equivFin @@ -3941,18 +3941,18 @@ def precedingRows {r : ℕ} (row : Fin (r + 1)) : Finset (Fin (r + 1)) := simp only [precedingRows, Finset.mem_filter, Finset.mem_univ, true_and] /-- The shifted row gap used in the spherical-code argument. -/ -def shiftedRowGap {r : ℕ} +@[expose] def shiftedRowGap {r : ℕ} (lam : Fin (r + 1) → ℕ) (row i : Fin (r + 1)) : ℝ := ((lam i - lam row : ℕ) : ℝ) + ((row.val - i.val - 1 : ℕ) : ℝ) /-- The arbitrary row leading scalar used in the spherical-code argument. -/ -def arbitraryRowLeadingScalar {r : ℕ} +@[expose] def arbitraryRowLeadingScalar {r : ℕ} (lam : Fin (r + 1) → ℕ) (row : Fin (r + 1)) : ℝ := ∏ i ∈ precedingRows row, shiftedRowGap lam row i /-- The lower polarization path used in the spherical-code argument. -/ -def lowerPolarizationPath {r n : ℕ} : +@[expose] def lowerPolarizationPath {r n : ℕ} : List (Fin (r + 1)) → (PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n) | [] => LinearMap.id @@ -3962,19 +3962,19 @@ def lowerPolarizationPath {r n : ℕ} : (lowerPolarizationPath (j :: rest)) /-- The polarization path start used in the spherical-code argument. -/ -def polarizationPathStart {r : ℕ} +@[expose] def polarizationPathStart {r : ℕ} (row : Fin (r + 1)) (S : Finset (Fin (r + 1))) : Fin (r + 1) := if h : S.Nonempty then S.min' h else row /-- The polarization path coefficient used in the spherical-code argument. -/ -def polarizationPathCoefficient {r : ℕ} +@[expose] def polarizationPathCoefficient {r : ℕ} (lam : Fin (r + 1) → ℕ) (row : Fin (r + 1)) (S : Finset (Fin (r + 1))) : ℝ := (-1 : ℝ) ^ S.card * ∏ i ∈ precedingRows row \ S, shiftedRowGap lam row i /-- The arbitrary row axial raise used in the spherical-code argument. -/ -def arbitraryRowAxialRaise {r n : ℕ} +@[expose] def arbitraryRowAxialRaise {r n : ℕ} (lam : Fin (r + 1) → ℕ) (row : Fin (r + 1)) (k : Fin n) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := ∑ S ∈ (precedingRows row).powerset, @@ -4061,7 +4061,7 @@ open MetricCodes.Spherical.ThreeRowYoungBranching open MetricCodes.Spherical.HigherHarmonicYoung.AllRankArbitraryRowBranchingOperator /-- The interlacing gap used in the spherical-code argument. -/ -def interlacingGap {r : ℕ} +@[expose] def interlacingGap {r : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (row : Fin (r + 2)) : ℕ := lam row - appendZeroWeight mu row @@ -4093,7 +4093,7 @@ theorem interlaces_of_between_appendZero_and_target {r : ℕ} · exact (hupper i.succ).trans (h i).2 /-- The interlacing row schedule used in the spherical-code argument. -/ -def interlacingRowSchedule {r : ℕ} +@[expose] def interlacingRowSchedule {r : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) : List (Fin (r + 2)) := (List.finRange (r + 2)).flatMap fun row => @@ -4219,7 +4219,7 @@ theorem foldl_arbitraryRowLeadingScalar_pos_of_count_lt_gap {r : ℕ} row j hrow hj /-- The reverse interlacing row schedule used in the spherical-code argument. -/ -def reverseInterlacingRowSchedule {r : ℕ} +@[expose] def reverseInterlacingRowSchedule {r : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) : List (Fin (r + 2)) := (interlacingRowSchedule lam mu).reverse @@ -4291,12 +4291,12 @@ abbrev UpperGramPair (r : ℕ) := {z : Fin (r + 1) × Fin (r + 1) // z.1 ≤ z.2} /-- The gram pair polynomial used in the spherical-code argument. -/ -def gramPairPolynomial {r : ℕ} (n : ℕ) +@[expose] def gramPairPolynomial {r : ℕ} (n : ℕ) (z : UpperGramPair r) : PolynomialSpace r n := rowPairingPolynomial (n := n) z.val.1 z.val.2 /-- The gram quadratic list used in the spherical-code argument. -/ -def gramQuadraticList (r n : ℕ) : List (PolynomialSpace r n) := +@[expose] def gramQuadraticList (r n : ℕ) : List (PolynomialSpace r n) := (Finset.univ : Finset (UpperGramPair r)).toList.map (gramPairPolynomial n) @@ -4349,7 +4349,7 @@ def gramPivot {r n : ℕ} (hn : 2 * r < n) (gramPivot hn z).val = z.val.1.val + z.val.2.val := rfl /-- The gram pivot variables used in the spherical-code argument. -/ -def gramPivotVariables {r n : ℕ} (hn : 2 * r < n) +@[expose] def gramPivotVariables {r n : ℕ} (hn : 2 * r < n) (z : UpperGramPair r) : Finset (Fin ((r + 1) * n)) := {variableIndex z.val.1 (gramPivot hn z), variableIndex z.val.2 (gramPivot hn z)} @@ -6139,14 +6139,14 @@ theorem arbitraryRowAxialRaise_sub_mem_youngGramRadialIdeal exact arbitraryRowAxialRaise_mem_youngGramRadialIdeal lam row k h /-- The arbitrary row path weight used in the spherical-code argument. -/ -def arbitraryRowPathWeight {r : ℕ} +@[expose] def arbitraryRowPathWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) : List (Fin (r + 1)) → (Fin (r + 1) → ℕ) | [] => lam | row :: rows => arbitraryRowPathWeight (raiseWeight lam row) rows /-- The iterated arbitrary row axial raise used in the spherical-code argument. -/ -def iteratedArbitraryRowAxialRaise {r n : ℕ} +@[expose] def iteratedArbitraryRowAxialRaise {r n : ℕ} (lam : Fin (r + 1) → ℕ) (k : Fin n) : List (Fin (r + 1)) → (PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n) diff --git a/LeanPool/MetricCodes/Conclusion.lean b/LeanPool/MetricCodes/Conclusion.lean index f93fcccccd..9a0e23ffee 100644 --- a/LeanPool/MetricCodes/Conclusion.lean +++ b/LeanPool/MetricCodes/Conclusion.lean @@ -13,7 +13,7 @@ public import LeanPool.MetricCodes.SpectralDecomposition The unconditional characteristic-minor argument and the final headline theorems. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable diff --git a/LeanPool/MetricCodes/Foundations.lean b/LeanPool/MetricCodes/Foundations.lean index 0d38f8ab6c..5a4fe6f40f 100644 --- a/LeanPool/MetricCodes/Foundations.lean +++ b/LeanPool/MetricCodes/Foundations.lean @@ -25,7 +25,7 @@ public import Mathlib.Analysis.SpecialFunctions.Log.Base Elementary coding-theory definitions, projection certificates, and the finite Johnson bound. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -86,7 +86,7 @@ theorem hammingCorrelation_le_of_dist_le linarith /-- The spherical entropy used in the metric-code argument. -/ -def sphericalEntropy (u : ℝ) : ℝ := +@[expose] def sphericalEntropy (u : ℝ) : ℝ := (1 + u) * Real.logb 2 (1 + u) - u * Real.logb 2 u @[simp] theorem sphericalEntropy_zero : sphericalEntropy 0 = 0 := by @@ -125,7 +125,7 @@ theorem binaryEntropy_nonneg {u : ℝ} (hu : 0 ≤ u) (hu' : u ≤ 1) : linarith /-- The gamma used in the metric-code argument. -/ -def Gamma (a b : ℝ) : ℝ := +@[expose] def Gamma (a b : ℝ) : ℝ := ((a - b) * (1 + a + b)) / ((1 + 2 * a) * Real.sqrt (a * (1 + a))) @@ -138,7 +138,7 @@ theorem Gamma_eq_sub (a b : ℝ) : ring /-- The classical threshold used in the metric-code argument. -/ -def classicalThreshold (s : ℝ) : ℝ := +@[expose] def classicalThreshold (s : ℝ) : ℝ := (1 / Real.sqrt (1 - s ^ 2) - 1) / 2 @[simp] theorem classicalThreshold_zero : classicalThreshold 0 = 0 := by @@ -159,7 +159,7 @@ theorem classicalThreshold_pos {s : ℝ} (hs : 0 < s) (hs' : s < 1) : linarith /-- The boolean harmonic dimension used in the metric-code argument. -/ -def booleanHarmonicDimension (n : ℕ) : ℕ → ℕ +@[expose] def booleanHarmonicDimension (n : ℕ) : ℕ → ℕ | 0 => 1 | k + 1 => n.choose (k + 1) - n.choose k @@ -189,7 +189,7 @@ abbrev hammingFibreDimension (n k : ℕ) : ℕ := booleanHarmonicDimension n k /-- The johnson fibre dimension used in the metric-code argument. -/ -def johnsonFibreDimension (n w p q : ℕ) : ℕ := +@[expose] def johnsonFibreDimension (n w p q : ℕ) : ℕ := booleanHarmonicDimension w p * booleanHarmonicDimension (n - w) q @@ -242,42 +242,42 @@ def hammingGamma (a b : ℝ) : ℝ := Real.sqrt (a * (1 - a)) /-- The johnson j1 used in the metric-code argument. -/ -def johnsonJ1 (w p : ℕ) : ℝ := +@[expose] def johnsonJ1 (w p : ℕ) : ℝ := (w : ℝ) / 2 - (p : ℝ) /-- The johnson j2 used in the metric-code argument. -/ -def johnsonJ2 (n w q : ℕ) : ℝ := +@[expose] def johnsonJ2 (n w q : ℕ) : ℝ := ((n - w : ℕ) : ℝ) / 2 - (q : ℝ) /-- The johnson j used in the metric-code argument. -/ -def johnsonJ (n j : ℕ) : ℝ := +@[expose] def johnsonJ (n j : ℕ) : ℝ := (n : ℝ) / 2 - (j : ℝ) /-- The johnson m used in the metric-code argument. -/ -def johnsonM (n w : ℕ) : ℝ := +@[expose] def johnsonM (n w : ℕ) : ℝ := (n : ℝ) / 2 - (w : ℝ) /-- The johnson sigma used in the metric-code argument. -/ -def johnsonSigma (n w p q : ℕ) : ℝ := +@[expose] def johnsonSigma (n w p q : ℕ) : ℝ := johnsonJ1 w p + johnsonJ2 n w q /-- The johnson delta used in the metric-code argument. -/ -def johnsonDelta (n w p q : ℕ) : ℝ := +@[expose] def johnsonDelta (n w p q : ℕ) : ℝ := johnsonJ2 n w q - johnsonJ1 w p /-- The johnson last degree used in the metric-code argument. -/ -def johnsonLastDegree (n w p q : ℕ) : ℕ := +@[expose] def johnsonLastDegree (n w p q : ℕ) : ℕ := min w (min (w - p + q) (n - w + p - q)) /-- The johnson mu used in the metric-code argument. -/ -def johnsonMu (n w p q j : ℕ) : ℝ := +@[expose] def johnsonMu (n w p q j : ℕ) : ℝ := (johnsonM n w / 2) * (johnsonJ2 n w q * (johnsonJ2 n w q + 1) - johnsonJ1 w p * (johnsonJ1 w p + 1)) / (johnsonJ n j * (johnsonJ n j + 1)) /-- The johnson nu used in the metric-code argument. -/ -def johnsonNu (n w p q j : ℕ) : ℝ := +@[expose] def johnsonNu (n w p q j : ℕ) : ℝ := Real.sqrt ((johnsonJ n j ^ 2 - johnsonM n w ^ 2) * (johnsonJ n j ^ 2 - johnsonDelta n w p q ^ 2) * @@ -287,30 +287,30 @@ def johnsonNu (n w p q j : ℕ) : ℝ := (2 * johnsonJ n j + 1))) /-- The johnson diagonal used in the metric-code argument. -/ -def johnsonDiagonal (n w p q j : ℕ) : ℝ := +@[expose] def johnsonDiagonal (n w p q j : ℕ) : ℝ := ((n : ℝ) * johnsonMu n w p q j - johnsonM n w ^ 2) / ((w : ℝ) * ((n - w : ℕ) : ℝ)) /-- The johnson edge used in the metric-code argument. -/ -def johnsonEdge (n w p q j : ℕ) : ℝ := +@[expose] def johnsonEdge (n w p q j : ℕ) : ℝ := ((n : ℝ) * johnsonNu n w p q j) / ((w : ℝ) * ((n - w : ℕ) : ℝ)) /-- The johnson zonal diagonal used in the metric-code argument. -/ -def johnsonZonalDiagonal (n w j : ℕ) : ℝ := +@[expose] def johnsonZonalDiagonal (n w j : ℕ) : ℝ := johnsonDiagonal n w 0 0 j /-- The johnson zonal edge used in the metric-code argument. -/ -def johnsonZonalEdge (n w j : ℕ) : ℝ := +@[expose] def johnsonZonalEdge (n w j : ℕ) : ℝ := johnsonEdge n w 0 0 j /-- The johnson hatted diagonal used in the metric-code argument. -/ -def johnsonHattedDiagonal (n w p q j : ℕ) : ℝ := +@[expose] def johnsonHattedDiagonal (n w p q j : ℕ) : ℝ := if j = 0 then 0 else johnsonDiagonal n w p q j ^ 2 / johnsonZonalDiagonal n w j /-- The johnson hatted edge used in the metric-code argument. -/ -def johnsonHattedEdge (n w p q j : ℕ) : ℝ := +@[expose] def johnsonHattedEdge (n w p q j : ℕ) : ℝ := johnsonEdge n w p q j ^ 2 / johnsonZonalEdge n w j theorem johnsonHattedDiagonal_nonneg {n w p q j : ℕ} @@ -320,7 +320,7 @@ theorem johnsonHattedDiagonal_nonneg {n w p q j : ℕ} split <;> positivity /-- The johnson jacobi matrix used in the metric-code argument. -/ -def johnsonJacobiMatrix (n w p q L : ℕ) : +@[expose] def johnsonJacobiMatrix (n w p q L : ℕ) : Matrix (Fin (L - (p + q) + 1)) (Fin (L - (p + q) + 1)) ℝ := fun i j => @@ -374,27 +374,27 @@ theorem card_level (n k : ℕ) : simp only [Level, Fintype.card_finset_len, Fintype.card_fin] /-- The raise at used in the binary-code argument. -/ -def raiseAt {n : ℕ} (a : Fin n) (f : Function n) (S : Finset (Fin n)) : ℝ := +@[expose] def raiseAt {n : ℕ} (a : Fin n) (f : Function n) (S : Finset (Fin n)) : ℝ := if a ∈ S then f (S.erase a) else 0 /-- The lower at used in the binary-code argument. -/ -def lowerAt {n : ℕ} (a : Fin n) (f : Function n) (S : Finset (Fin n)) : ℝ := +@[expose] def lowerAt {n : ℕ} (a : Fin n) (f : Function n) (S : Finset (Fin n)) : ℝ := if a ∈ S then 0 else f (insert a S) /-- The raise used in the binary-code argument. -/ -def raise {n : ℕ} (f : Function n) (S : Finset (Fin n)) : ℝ := +@[expose] def raise {n : ℕ} (f : Function n) (S : Finset (Fin n)) : ℝ := ∑ a : Fin n, raiseAt a f S /-- The lower used in the binary-code argument. -/ -def lower {n : ℕ} (f : Function n) (S : Finset (Fin n)) : ℝ := +@[expose] def lower {n : ℕ} (f : Function n) (S : Finset (Fin n)) : ℝ := ∑ a : Fin n, lowerAt a f S /-- The predicate asserting level. -/ -def IsLevel {n : ℕ} (k : ℕ) (f : Function n) : Prop := +@[expose] def IsLevel {n : ℕ} (k : ℕ) (f : Function n) : Prop := ∀ S : Finset (Fin n), S.card ≠ k → f S = 0 /-- The predicate asserting harmonic. -/ -def IsHarmonic {n : ℕ} (k : ℕ) (f : Function n) : Prop := +@[expose] def IsHarmonic {n : ℕ} (k : ℕ) (f : Function n) : Prop := IsLevel k f ∧ ∀ S : Finset (Fin n), lower f S = 0 variable {n : ℕ} @@ -550,19 +550,19 @@ theorem lower_smul (c : ℝ) (f : Function n) : by_cases ha : a ∈ S <;> simp [ha] /-- The raise linear used in the binary-code argument. -/ -def raiseLinear (n : ℕ) : Function n →ₗ[ℝ] Function n where +@[expose] def raiseLinear (n : ℕ) : Function n →ₗ[ℝ] Function n where toFun := raise map_add' := raise_add map_smul' := raise_smul /-- The lower linear used in the binary-code argument. -/ -def lowerLinear (n : ℕ) : Function n →ₗ[ℝ] Function n where +@[expose] def lowerLinear (n : ℕ) : Function n →ₗ[ℝ] Function n where toFun := lower map_add' := lower_add map_smul' := lower_smul @[simp] theorem raiseLinear_apply (f : Function n) : - raiseLinear n f = raise f := rfl + raiseLinear n f = raise f := by rfl theorem IsLevel.raise {k : ℕ} {f : Function n} (hf : IsLevel k f) : IsLevel (k + 1) (raise f) := by @@ -600,7 +600,7 @@ theorem IsLevel.lower {k : ℕ} {f : Function n} simp only [lowerAt, ha, ↓reduceIte, hf (insert a S) hinsert] /-- The raised used in the binary-code argument. -/ -def raised {n : ℕ} (f : Function n) : ℕ → Function n +@[expose] def raised {n : ℕ} (f : Function n) : ℕ → Function n | 0 => f | r + 1 => raise (raised f r) @@ -618,7 +618,7 @@ theorem IsLevel.raised {k : ℕ} {f : Function n} simpa only [raised_succ, Nat.add_assoc] using ih.raise /-- The harmonic coefficient used in the binary-code argument. -/ -def harmonicCoefficient (n k r : ℕ) : ℝ := +@[expose] def harmonicCoefficient (n k r : ℕ) : ℝ := (r : ℝ) * ((n : ℝ) - 2 * (k : ℝ) - (r : ℝ) + 1) @[simp] theorem harmonicCoefficient_zero (n k : ℕ) : @@ -683,7 +683,7 @@ private def toggleEquiv (a : Fin n) : Finset (Fin n) ≃ Finset (Fin n) where right_inv := toggle_toggle a /-- The dot used in the binary-code argument. -/ -def dot (f g : Function n) : ℝ := +@[expose] def dot (f g : Function n) : ℝ := ∑ S : Finset (Fin n), f S * g S theorem dot_raiseAt_eq_lowerAt (a : Fin n) (f g : Function n) : @@ -778,7 +778,7 @@ namespace ProjectionFamily variable {X : Type*} {D d : ℕ} /-- The overlap used in the metric-code argument. -/ -def overlap (P : ProjectionFamily X D d) (x y : X) : ℝ := +@[expose] def overlap (P : ProjectionFamily X D d) (x y : X) : ℝ := Matrix.trace (P.projection x * P.projection y) @[simp] theorem overlap_self (P : ProjectionFamily X D d) (x : X) : @@ -1148,11 +1148,11 @@ theorem IsLevel.twist {k : ℕ} {f : Function n} abbrev CoordinateFunction (n : ℕ) := Fin n → Function n /-- The coordinate dot used in the binary-code argument. -/ -def coordinateDot (f g : CoordinateFunction n) : ℝ := +@[expose] def coordinateDot (f g : CoordinateFunction n) : ℝ := ∑ a : Fin n, dot (f a) (g a) /-- The delete channel used in the binary-code argument. -/ -def deleteChannel (i : ℕ) (f : Function n) : CoordinateFunction n := +@[expose] def deleteChannel (i : ℕ) (f : Function n) : CoordinateFunction n := fun a => (Real.sqrt (i : ℝ))⁻¹ • lowerAt a f /-- The coordinate raising channels scaled by the inverse square root of `n - i`. -/ @@ -1335,7 +1335,7 @@ def layerExtend {n k : ℕ} (f : LayerFunction n k) : Function n := fun S => if h : S.card = k then f ⟨S, h⟩ else 0 /-- The layer restrict used in the binary-code argument. -/ -def layerRestrict (k : ℕ) (f : Function n) : LayerFunction n k := +@[expose] def layerRestrict (k : ℕ) (f : Function n) : LayerFunction n k := fun S => f S.val theorem isLevel_layerExtend {k : ℕ} (f : LayerFunction n k) : @@ -1402,11 +1402,11 @@ def layerDown (n k : ℕ) : ((lowerLinear n).comp (layerExtendLinear n (k + 1))) @[simp] theorem layerUp_apply {k : ℕ} (f : LayerFunction n k) : - layerUp n k f = layerRestrict (k + 1) (raise (layerExtend f)) := rfl + layerUp n k f = layerRestrict (k + 1) (raise (layerExtend f)) := by rfl @[simp] theorem layerDown_apply {k : ℕ} (f : LayerFunction n (k + 1)) : - layerDown n k f = layerRestrict k (lower (layerExtend f)) := rfl + layerDown n k f = layerRestrict k (lower (layerExtend f)) := by rfl theorem layerUp_injective {k : ℕ} (hk : 2 * k < n) : Function.Injective (layerUp n k) := by @@ -1441,7 +1441,7 @@ theorem layerUp_injective {k : ℕ} (hk : 2 * k < n) : exact sub_eq_zero.mp hdiffzero /-- The layer dot used in the binary-code argument. -/ -def layerDot {n k : ℕ} (f g : LayerFunction n k) : ℝ := +@[expose] def layerDot {n k : ℕ} (f g : LayerFunction n k) : ℝ := ∑ S : Level n k, f S * g S theorem dot_layerExtend {k : ℕ} (f g : LayerFunction n k) : @@ -1734,7 +1734,7 @@ theorem dot_raised_of_harmonic {k : ℕ} ring /-- The harmonic embedding used in the binary-code argument. -/ -def harmonicEmbedding (k r : ℕ) (f : Function n) : Function n := +@[expose] def harmonicEmbedding (k r : ℕ) (f : Function n) : Function n := (Real.sqrt (harmonicNormFactor n k r))⁻¹ • raised f r /-- The normalized harmonic embedding twisted by the Boolean character of `x`. -/ @@ -1862,7 +1862,7 @@ theorem mem_harmonicLayer_iff {k : ℕ} (f : LayerFunction n k) : abbrev EuclideanLayer (n k : ℕ) := EuclideanSpace ℝ (Level n k) /-- The harmonic euclidean layer used in the binary-code argument. -/ -def harmonicEuclideanLayer (n k : ℕ) : +@[expose] def harmonicEuclideanLayer (n k : ℕ) : Submodule ℝ (EuclideanLayer n k) := (harmonicLayer n k).map (WithLp.linearEquiv 2 ℝ (LayerFunction n k)).symm.toLinearMap @@ -1893,6 +1893,7 @@ def harmonicOrthonormalBasis (finCongr (harmonicEuclideanLayer_finrank n k hk)) /-- The harmonic basis function used in the binary-code argument. -/ +@[expose] def harmonicBasisFunction (n k : ℕ) (hk : 2 * k ≤ n) (p : Fin (MetricCodes.hammingFibreDimension n k)) : Function n := @@ -2412,6 +2413,7 @@ theorem matrixHilbertSchmidtFeature_inner rfl /-- The matrix axis lift used in the binary-code argument. -/ +@[expose] def matrixAxisLift {κ ι ρ : Type*} (z : κ → ℝ) (A : Matrix ι ρ ℝ) : Matrix (κ × ι) ρ ℝ := @@ -4350,7 +4352,7 @@ theorem choose_monotone_to_half (n : ℕ) {i j : ℕ} exact Finset.sum_le_sum_of_subset (Finset.range_mono (by omega)) /-- The johnson ambient dimension used in the metric-code argument. -/ -def johnsonAmbientDimension (n a L : ℕ) : ℕ := +@[expose] def johnsonAmbientDimension (n a L : ℕ) : ℕ := ∑ j ∈ Finset.Icc a L, booleanHarmonicDimension n j theorem johnsonAmbientDimension_eq (n a L : ℕ) @@ -4715,7 +4717,7 @@ abbrev Index (k L : ℕ) := Fin (L - k + 1) abbrev Space (k L : ℕ) := EuclideanSpace ℝ (Index k L) /-- The matrix used in the binary-code argument. -/ -def matrix (n k L : ℕ) : Matrix (Index k L) (Index k L) ℝ := +@[expose] def matrix (n k L : ℕ) : Matrix (Index k L) (Index k L) ℝ := MetricCodes.hammingJacobiMatrix n k L theorem matrix_hermitian (n k L : ℕ) : (matrix n k L).IsHermitian := by @@ -4727,7 +4729,7 @@ theorem matrix_hermitian (n k L : ℕ) : (matrix n k L).IsHermitian := by simpa only [matrix, star_trivial, Matrix.transpose_apply] using h /-- The operator used in the binary-code argument. -/ -def operator (n k L : ℕ) : Space k L →ₗ[ℝ] Space k L := +@[expose] def operator (n k L : ℕ) : Space k L →ₗ[ℝ] Space k L := Matrix.toEuclideanLin (matrix n k L) theorem operator_isSymmetric (n k L : ℕ) : @@ -5472,11 +5474,11 @@ theorem variationalRate_lt_classicalRate {δ : ℝ} exact (variationalRate_le_of_feasible hfeasible).trans_lt himprove /-- The longitudinal degree used in the binary-code argument. -/ -def longitudinalDegree (a : ℝ) (n : ℕ) : ℕ := +@[expose] def longitudinalDegree (a : ℝ) (n : ℕ) : ℕ := Nat.floor (a * (n : ℝ)) /-- The transverse degree used in the binary-code argument. -/ -def transverseDegree (b : ℝ) (n : ℕ) : ℕ := +@[expose] def transverseDegree (b : ℝ) (n : ℕ) : ℕ := Nat.floor (b * (n : ℝ)) theorem tendsto_longitudinal_ratio {a : ℝ} (ha : 0 ≤ a) : @@ -5651,7 +5653,7 @@ theorem tridiagonal_quadratic_sum ring /-- The terminal indicator used in the binary-code argument. -/ -def terminalIndicator (d m p : ℕ) : ℝ := +@[expose] def terminalIndicator (d m p : ℕ) : ℝ := if d - m ≤ p then 1 else 0 theorem terminal_indicator_sum (d m : ℕ) (hm : m ≤ d) : @@ -5702,7 +5704,7 @@ theorem terminal_indicator_edge_sum simp only [terminalIndicator, ite_eq_left h₁, ite_eq_left h₂, mul_one] /-- The terminal vector used in the binary-code argument. -/ -def terminalVector (k L m : ℕ) : Space k L := +@[expose] def terminalVector (k L m : ℕ) : Space k L := WithLp.toLp 2 (fun p : Fin (L - k + 1) => terminalIndicator (L - k) m p.val) @@ -6999,7 +7001,7 @@ def correlation {n w : ℕ} (x y : JohnsonSphere n w) : ℝ := CharP.cast_eq_zero, mul_zero, zero_div, sub_zero] /-- The threshold used in the Johnson-code argument. -/ -def threshold (n w d : ℕ) : ℝ := +@[expose] def threshold (n w d : ℕ) : ℝ := 1 - (n : ℝ) * (d : ℝ) / (2 * (w : ℝ) * ((n - w : ℕ) : ℝ)) @@ -7066,7 +7068,7 @@ theorem correlation_le_threshold_of_code {n w d : ℕ} exact hxy (Subtype.ext hval) /-- The coordinate indicator used in the Johnson-code argument. -/ -def coordinateIndicator {n : ℕ} (x : BinaryWord n) +@[expose] def coordinateIndicator {n : ℕ} (x : BinaryWord n) (i : Fin n) : ℝ := if i ∈ MetricCodes.wordSupport x then 1 else 0 @@ -7142,7 +7144,7 @@ theorem centered_coordinate_inner_sum {n w : ℕ} field_simp [hn']; ring /-- The geometric axis used in the Johnson-code argument. -/ -def geometricAxis {n w : ℕ} (x : JohnsonSphere n w) : MetricCodes.Ambient n := +@[expose] def geometricAxis {n w : ℕ} (x : JohnsonSphere n w) : MetricCodes.Ambient n := WithLp.toLp 2 (fun i : Fin n => Real.sqrt ((n : ℝ) / ((w : ℝ) * ((n - w : ℕ) : ℝ))) * @@ -7317,7 +7319,7 @@ abbrev Index (p q L : ℕ) := Fin (L - (p + q) + 1) abbrev Space (p q L : ℕ) := EuclideanSpace ℝ (Index p q L) /-- The matrix used in the Johnson-code argument. -/ -def matrix (n w p q L : ℕ) : +@[expose] def matrix (n w p q L : ℕ) : Matrix (Index p q L) (Index p q L) ℝ := MetricCodes.johnsonJacobiMatrix n w p q L @@ -7331,7 +7333,7 @@ theorem matrix_hermitian (n w p q L : ℕ) : simpa only [matrix, star_trivial, Matrix.transpose_apply] using h /-- The operator used in the Johnson-code argument. -/ -def operator (n w p q L : ℕ) : Space p q L →ₗ[ℝ] Space p q L := +@[expose] def operator (n w p q L : ℕ) : Space p q L →ₗ[ℝ] Space p q L := Matrix.toEuclideanLin (matrix n w p q L) theorem operator_isSymmetric (n w p q L : ℕ) : @@ -7964,7 +7966,7 @@ def johnsonRecurrenceWeight v i /-- The johnson source channel coefficient used in the Johnson-code argument. -/ -def johnsonSourceChannelCoefficient +@[expose] def johnsonSourceChannelCoefficient (n w p q L : ℕ) (m i : Index p q L) : ℝ := matrix n w p q L m i * Real.sqrt (MetricCodes.booleanHarmonicDimension n (p + q + m.val) : ℝ) / @@ -8069,7 +8071,7 @@ theorem johnsonRecurrenceWeight_eigenrecurrence ring /-- The johnson adjacent block coefficient used in the Johnson-code argument. -/ -def johnsonAdjacentBlockCoefficient +@[expose] def johnsonAdjacentBlockCoefficient (n w p q L : ℕ) (v : Space p q L) (lam : ℝ) (target source : Index p q L) : ℝ := Real.sqrt @@ -8122,7 +8124,7 @@ def johnsonRecurrenceNormalization ∑ i : Index p q L, johnsonRecurrenceWeight n w p q L v i /-- The johnson fibre amplitude used in the Johnson-code argument. -/ -def johnsonFibreAmplitude +@[expose] def johnsonFibreAmplitude (n w p q L : ℕ) (v : Space p q L) (i : Index p q L) : ℝ := Real.sqrt (johnsonRecurrenceWeight n w p q L v i / @@ -8338,11 +8340,11 @@ theorem finite_binaryCodeNumber_bound_of_projection_gram hfactor /-- The centered eta used in the Johnson-code argument. -/ -def centeredEta (α β γ : ℝ) : ℝ := +@[expose] def centeredEta (α β γ : ℝ) : ℝ := 1 - 2 * α + 2 * β - 2 * γ /-- The spectral limit used in the Johnson-code argument. -/ -def spectralLimit (α β γ u : ℝ) : ℝ := +@[expose] def spectralLimit (α β γ u : ℝ) : ℝ := let z := (1 - 2 * u) let m := (1 - 2 * α) let σ := (1 - 2 * β - 2 * γ) @@ -8477,16 +8479,16 @@ theorem spectralLimit_zero_fibre_boundary {α u : ℝ} field_simp [hmraw, hA, hfourA, hplusraw]; ring /-- The asymptotic threshold used in the Johnson-code argument. -/ -def asymptoticThreshold (δ α : ℝ) : ℝ := +@[expose] def asymptoticThreshold (δ α : ℝ) : ℝ := 1 - δ / (2 * α * (1 - α)) /-- The rank penalty used in the Johnson-code argument. -/ -def rankPenalty (α β γ : ℝ) : ℝ := +@[expose] def rankPenalty (α β γ : ℝ) : ℝ := α * MetricCodes.binaryEntropy (β / α) + (1 - α) * MetricCodes.binaryEntropy (γ / (1 - α)) /-- The shell rate used in the Johnson-code argument. -/ -def shellRate (α β γ u : ℝ) : ℝ := +@[expose] def shellRate (α β γ u : ℝ) : ℝ := 1 - MetricCodes.binaryEntropy α + MetricCodes.binaryEntropy u - rankPenalty α β γ @@ -8630,16 +8632,16 @@ end AsymptoticParameters simp only [shellRate, rankPenalty, zero_div, binaryEntropy_zero, mul_zero, add_zero, sub_zero] /-- The predicate asserting spectrally feasible. -/ -def IsSpectrallyFeasible (δ α β γ u : ℝ) : Prop := +@[expose] def IsSpectrallyFeasible (δ α β γ u : ℝ) : Prop := asymptoticThreshold δ α < spectralLimit α β γ u /-- The feasible used in the Johnson-code argument. -/ -def Feasible (δ α β γ u : ℝ) : Prop := +@[expose] def Feasible (δ α β γ u : ℝ) : Prop := AsymptoticParameters δ α β γ u ∧ IsSpectrallyFeasible δ α β γ u /-- The rate set used in the Johnson-code argument. -/ -def rateSet (δ : ℝ) : Set ℝ := +@[expose] def rateSet (δ : ℝ) : Set ℝ := {r | ∃ α β γ u : ℝ, Feasible δ α β γ u ∧ r = shellRate α β γ u} @@ -8650,7 +8652,7 @@ theorem rateSet_bddBelow (δ : ℝ) : exact hparameter.shellRate_lower /-- The variational rate used in the Johnson-code argument. -/ -def variationalRate (δ : ℝ) : ℝ := +@[expose] def variationalRate (δ : ℝ) : ℝ := sInf (rateSet δ) theorem variationalRate_le_of_feasible {δ α β γ u : ℝ} @@ -8659,7 +8661,7 @@ theorem variationalRate_le_of_feasible {δ α β γ u : ℝ} exact csInf_le (rateSet_bddBelow δ) ⟨α, β, γ, u, h, rfl⟩ /-- The mrrw g used in the Johnson-code argument. -/ -def mrrwG (v : ℝ) : ℝ := +@[expose] def mrrwG (v : ℝ) : ℝ := MetricCodes.binaryEntropy ((1 - Real.sqrt (1 - v)) / 2) @[simp] theorem mrrwG_one : mrrwG 1 = 1 := by @@ -8687,7 +8689,7 @@ theorem mrrwG_nonneg {v : ℝ} (hv : 0 ≤ v) : · linarith /-- The mrrw objective used in the Johnson-code argument. -/ -def mrrwObjective (δ r : ℝ) : ℝ := +@[expose] def mrrwObjective (δ r : ℝ) : ℝ := 1 + mrrwG (r ^ 2) - mrrwG (r ^ 2 + 2 * δ * r + 2 * δ) @@ -8873,7 +8875,7 @@ theorem mrrw_endpoint_dichotomy {δ : ℝ} exact lt_or_eq_of_le (mrrwRate_le_classicalRate hδ hhalf) /-- The combined variational rate used in the Johnson-code argument. -/ -def combinedVariationalRate (δ : ℝ) : ℝ := +@[expose] def combinedVariationalRate (δ : ℝ) : ℝ := min (MetricCodes.Hamming.variationalRate δ) (variationalRate δ) theorem combinedVariationalRate_le_hamming (δ : ℝ) : diff --git a/LeanPool/MetricCodes/HarmonicAnalysis.lean b/LeanPool/MetricCodes/HarmonicAnalysis.lean index 40b6713cf8..2b82a37082 100644 --- a/LeanPool/MetricCodes/HarmonicAnalysis.lean +++ b/LeanPool/MetricCodes/HarmonicAnalysis.lean @@ -17,7 +17,7 @@ public import Mathlib.Topology.MetricSpace.CoveringNumbers Harmonic polynomial, Gegenbauer, Perron, and adjacent-channel constructions. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -31,7 +31,7 @@ namespace MetricCodes abbrev Sphere (n : ℕ) := {x : Ambient n // ‖x‖ = 1} /-- The spherical inner used in the metric-code argument. -/ -def sphericalInner {n : ℕ} (x y : Sphere n) : ℝ := +@[expose] def sphericalInner {n : ℕ} (x y : Sphere n) : ℝ := ⟪(x : Ambient n), (y : Ambient n)⟫_ℝ theorem spherical_dist_sq {n : ℕ} (x y : Sphere n) : @@ -42,7 +42,7 @@ theorem spherical_dist_sq {n : ℕ} (x y : Sphere n) : ring /-- The predicate asserting spherical code. -/ -def IsSphericalCode {n : ℕ} (s : ℝ) (C : Finset (Sphere n)) : Prop := +@[expose] def IsSphericalCode {n : ℕ} (s : ℝ) (C : Finset (Sphere n)) : Prop := ∀ ⦃x⦄, x ∈ C → ∀ ⦃y⦄, y ∈ C → x ≠ y → sphericalInner x y ≤ s /-- Data encoding the spherical code construction. -/ @@ -52,7 +52,7 @@ structure SphericalCode (n : ℕ) (s : ℝ) where inner_le : IsSphericalCode s points /-- The spherical code number used in the metric-code argument. -/ -def sphericalCodeNumber (n : ℕ) (s : ℝ) : ℕ∞ := +@[expose] def sphericalCodeNumber (n : ℕ) (s : ℝ) : ℕ∞ := ⨆ C : SphericalCode n s, (C.points.card : ℕ∞) theorem sphericalCodeNumber_le {n : ℕ} {s : ℝ} {B : ℕ∞} @@ -151,7 +151,7 @@ theorem Gamma_pos {a b : ℝ} (hb : 0 ≤ b) (hab : b < a) : (Real.sqrt_pos.2 (mul_pos ha (by linarith))) /-- The harmonic dimension used in the metric-code argument. -/ -def harmonicDimension (n : ℕ) : ℕ → ℕ +@[expose] def harmonicDimension (n : ℕ) : ℕ → ℕ | 0 => 1 | i + 1 => (n + i - 1).choose (i + 1) + (n + i - 2).choose i @@ -283,7 +283,7 @@ def polynomialLaplacian (n : ℕ) : Finset.sum_apply, Function.comp_apply] /-- The harmonic homogeneous submodule used in the spherical-code argument. -/ -def harmonicHomogeneousSubmodule (n k : ℕ) : +@[expose] def harmonicHomogeneousSubmodule (n k : ℕ) : Submodule ℝ (MvPolynomial (Fin n) ℝ) := MvPolynomial.homogeneousSubmodule (Fin n) ℝ k ⊓ LinearMap.ker (polynomialLaplacian n) @@ -446,7 +446,7 @@ def backwardCoefficient (n i : ℕ) : ℝ := (i : ℝ) / recurrenceDenominator n i /-- The normalized used in the spherical-code argument. -/ -def normalized (n : ℕ) : ℕ → Polynomial ℝ +@[expose] def normalized (n : ℕ) : ℕ → Polynomial ℝ | 0 => 1 | 1 => Polynomial.X | i + 2 => @@ -528,7 +528,7 @@ theorem normalized_natDegree {n : ℕ} (hn : 2 ≤ n) (i : ℕ) : exact hmain /-- The harmonic dimension used in the spherical-code argument. -/ -def harmonicDimension (n : ℕ) : ℕ → ℕ +@[expose] def harmonicDimension (n : ℕ) : ℕ → ℕ | 0 => 1 | i + 1 => (n + i - 1).choose (i + 1) + (n + i - 2).choose i @@ -753,7 +753,7 @@ theorem directionalDerivative_mul ring /-- The axis polynomial used in the spherical-code argument. -/ -def axisPolynomial (n : ℕ) (x : Euclidean n) : +@[expose] def axisPolynomial (n : ℕ) (x : Euclidean n) : MvPolynomial (Fin n) ℝ := ∑ i : Fin n, MvPolynomial.C (x i) * MvPolynomial.X i @@ -923,7 +923,7 @@ abbrev CoefficientSpace (n m : ℕ) := Finsupp.degree_eq_sum] /-- The multi factorial used in the spherical-code argument. -/ -def multiFactorial {n : ℕ} (a : MultiIndex n) : ℝ := +@[expose] def multiFactorial {n : ℕ} (a : MultiIndex n) : ℝ := ∏ i : Fin n, (a i).factorial theorem multiFactorial_pos {n : ℕ} (a : MultiIndex n) : @@ -1004,7 +1004,7 @@ theorem coeff_pderiv (n : ℕ) (i : Fin n) (a : MultiIndex n) ring /-- The polynomial inner used in the spherical-code argument. -/ -def polynomialInner (n : ℕ) +@[expose] def polynomialInner (n : ℕ) (p q : MvPolynomial (Fin n) ℝ) : ℝ := Finsupp.sum (AddMonoidAlgebra.coeff p) fun a c => multiFactorial a * c * q.coeff a @@ -1273,7 +1273,7 @@ theorem polynomialInner_axis_directional (n : ℕ) MvPolynomial.pderiv i q)).symm /-- The coefficient embedding used in the spherical-code argument. -/ -def coefficientEmbedding (n m : ℕ) : +@[expose] def coefficientEmbedding (n m : ℕ) : Homogeneous n m →ₗ[ℝ] CoefficientSpace n m where toFun p := WithLp.toLp 2 fun a : DegreeIndex n m => @@ -1333,7 +1333,7 @@ theorem coefficientEmbedding_injective (n m : ℕ) : MvPolynomial.IsHomogeneous.coeff_eq_zero q.property ha] /-- The coefficient embedding restricted to homogeneous harmonic polynomials. -/ -def harmonicCoefficientEmbedding (n m : ℕ) : +@[expose] def harmonicCoefficientEmbedding (n m : ℕ) : SpherePacking.harmonicHomogeneousSubmodule n m →ₗ[ℝ] CoefficientSpace n m := (coefficientEmbedding n m).comp @@ -1461,7 +1461,7 @@ theorem homogeneousInner_eq_polynomialInner (n m : ℕ) (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := rfl /-- The harmonic inner used in the spherical-code argument. -/ -def harmonicInner (n m : ℕ) +@[expose] def harmonicInner (n m : ℕ) (p q : SpherePacking.harmonicHomogeneousSubmodule n m) : ℝ := @inner ℝ (CoefficientSpace n m) _ (harmonicCoefficientEmbedding n m p) @@ -1786,7 +1786,7 @@ theorem finrank_homogeneousSubmodule (n m : ℕ) : homogeneousExponentFinset_card n m /-- Multiplication by the radial polynomial, from homogeneous degree `m` to degree `m + 2`. -/ -def homogeneousRadialMultiplication (n m : ℕ) : +@[expose] def homogeneousRadialMultiplication (n m : ℕ) : MvPolynomial.homogeneousSubmodule (Fin n) ℝ m →ₗ[ℝ] MvPolynomial.homogeneousSubmodule (Fin n) ℝ (m + 2) := (LinearMap.mulLeft ℝ (radialPolynomial n)).restrict @@ -1846,7 +1846,7 @@ theorem surjective_of_injective_inner_adjoint LinearMap.finrank_range_of_inj hinj] /-- The polynomial Laplacian restricted from homogeneous degree `m + 2` to degree `m`. -/ -def homogeneousLaplacian (n m : ℕ) : +@[expose] def homogeneousLaplacian (n m : ℕ) : MvPolynomial.homogeneousSubmodule (Fin n) ℝ (m + 2) →ₗ[ℝ] MvPolynomial.homogeneousSubmodule (Fin n) ℝ m := LinearMap.codRestrict @@ -2220,7 +2220,7 @@ def harmonicAxisParameter (n k : ℕ) : ℝ := (n : ℝ) + 2 * (k : ℝ) /-- The solid harmonic axis lift used in the spherical-code argument. -/ -def solidHarmonicAxisLift (n k : ℕ) (x : Euclidean n) : +@[expose] def solidHarmonicAxisLift (n k : ℕ) (x : Euclidean n) : ℕ → (MvPolynomial (Fin n) ℝ →ₗ[ℝ] MvPolynomial (Fin n) ℝ) | 0 => LinearMap.id @@ -2499,7 +2499,7 @@ theorem harmonicAxisProjectionOperator_mem_harmonic rw [hscalar, sub_self] /-- The harmonic axis lift used in the spherical-code argument. -/ -def harmonicAxisLift +@[expose] def harmonicAxisLift {n : ℕ} (hn : 0 < n) (k : ℕ) (x : Euclidean n) : harmonicHomogeneousSubmodule n (k + 1) →ₗ[ℝ] harmonicHomogeneousSubmodule n (k + 2) := @@ -2966,7 +2966,7 @@ open scoped BigOperators namespace NumericalCertificate /-- The binary entropy used in the spherical-code argument. -/ -def binaryEntropy (u : ℝ) : ℝ := +@[expose] def binaryEntropy (u : ℝ) : ℝ := ((1 + u) * Real.log (1 + u) - u * Real.log u) / Real.log 2 /-- The gamma used in the spherical-code argument. -/ @@ -2988,11 +2988,11 @@ namespace Spherical section /-- The boundary quadratic used in the spherical-code argument. -/ -def boundaryQuadratic (s a : ℝ) : ℝ := +@[expose] def boundaryQuadratic (s a : ℝ) : ℝ := a * (1 + a) - (s / 2) * (1 + 2 * a) * Real.sqrt (a * (1 + a)) /-- The boundary degree used in the spherical-code argument. -/ -def boundaryDegree (s a : ℝ) : ℝ := +@[expose] def boundaryDegree (s a : ℝ) : ℝ := (Real.sqrt (1 + 4 * boundaryQuadratic s a) - 1) / 2 theorem spectral_iff_quadratic {s a b : ℝ} (ha : 0 < a) : @@ -3459,7 +3459,7 @@ theorem truncatedHarmonicDimension_le_successor Gegenbauer.harmonicDimension_branch_sum hn L /-- The truncated dimension quotient used in the spherical-code argument. -/ -def truncatedDimensionQuotient (a b : ℝ) (n : ℕ) : ℝ := +@[expose] def truncatedDimensionQuotient (a b : ℝ) (n : ℕ) : ℝ := (truncatedHarmonicDimension n ⌊b * (n : ℝ)⌋₊ ⌊a * (n : ℝ)⌋₊ : ℝ) / (Gegenbauer.fibreDimension n ⌊b * (n : ℝ)⌋₊ : ℝ) @@ -3698,7 +3698,7 @@ theorem tendsto_floored_ratio {a : ℝ} (ha : 0 ≤ a) : (tendsto_nat_floor_mul_div_atTop ha).comp (tendsto_natCast_atTop_atTop (R := ℝ)) /-- The normalized coefficient used in the spherical-code argument. -/ -def normalizedCoefficient (x y z : ℝ) : ℝ := +@[expose] def normalizedCoefficient (x y z : ℝ) : ℝ := ((x - y + z) * (x + y + 1 - 2 * z)) / Real.sqrt ((x + z) * (x + 1 - 2 * z) * @@ -6634,7 +6634,7 @@ theorem sourceAdjacentHarmonicRow_inner_axis_fibre /-- The linear embedding applying a row isometry to each matrix column, with a zero leading channel. -/ -def spectralMatrixEmbeddingLinearMap +@[expose] def spectralMatrixEmbeddingLinearMap (n k L : ℕ) (row : CertificateAmbient n k L →ₗᵢ[ℝ] HarmonicRowChannelSpace n k L) : @@ -6841,7 +6841,7 @@ def firstFibreVector (n k : ℕ) (hn : 3 ≤ n) : /-- The rank-one map extracting the first fibre coordinate and multiplying a prescribed channel vector. -/ -def rankOneChannelMap +@[expose] def rankOneChannelMap (n k L : ℕ) (hn : 3 ≤ n) (v : ProjectionChannelSpace n k L) : CertificateFibre n k →ₗ[ℝ] ProjectionChannelSpace n k L where diff --git a/LeanPool/MetricCodes/Hierarchy.lean b/LeanPool/MetricCodes/Hierarchy.lean index 45b1bba569..09c4648090 100644 --- a/LeanPool/MetricCodes/Hierarchy.lean +++ b/LeanPool/MetricCodes/Hierarchy.lean @@ -13,7 +13,7 @@ public import LeanPool.MetricCodes.HarmonicAnalysis General spectral bounds, localization, compactification, and strict hierarchy estimates. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable diff --git a/LeanPool/MetricCodes/HighestWeights.lean b/LeanPool/MetricCodes/HighestWeights.lean index 489894c1c3..66d8eb5c2e 100644 --- a/LeanPool/MetricCodes/HighestWeights.lean +++ b/LeanPool/MetricCodes/HighestWeights.lean @@ -13,7 +13,7 @@ public import LeanPool.MetricCodes.Interlacing Diamond relations, Lie irreducibility, and isotropic highest-weight constructions. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -3472,7 +3472,7 @@ structure CanonicalBoxForwardPolynomialData {r m n : ℕ} (Weyl.flooredWeight b (n + 1)) row /-- The canonical box adjacent fischer recurrence used in the spherical-code argument. -/ -def CanonicalBoxAdjacentFischerRecurrence {r m n : ℕ} +@[expose] def CanonicalBoxAdjacentFischerRecurrence {r m n : ℕ} (a : Fin (r + 2) → ℝ) (b : Fin (r + 1) → ℝ) (hstable : ∀ v : RectangularVertices.Vertex (r + 1) m, FiniteInterlacing (n + 1) @@ -3706,12 +3706,12 @@ def sourceColumnRoot {m : ℕ} (i j : Fin m) : rfl /-- The source row degree used in the spherical-code argument. -/ -def sourceRowDegree {m : ℕ} +@[expose] def sourceRowDegree {m : ℕ} (d : Fin m × Fin m →₀ ℕ) (i : Fin m) : ℕ := ∑ j : Fin m, d (i, j) /-- The source column degree used in the spherical-code argument. -/ -def sourceColumnDegree {m : ℕ} +@[expose] def sourceColumnDegree {m : ℕ} (d : Fin m × Fin m →₀ ℕ) (j : Fin m) : ℕ := ∑ i : Fin m, d (i, j) @@ -4146,7 +4146,7 @@ theorem polynomialImaginaryPart_complex_smul {r n : ℕ} (c : ℂ) AddMonoidAlgebra.coeff_add, Finsupp.add_apply, coeff_polynomialRealPart] /-- The polynomial complex span used in the spherical-code argument. -/ -def polynomialComplexSpan {r n : ℕ} +@[expose] def polynomialComplexSpan {r n : ℕ} (W : Submodule ℝ (PolynomialSpace r n)) : Submodule ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) := Submodule.span ℂ (polynomialComplexification '' (W : Set (PolynomialSpace r n))) @@ -4308,7 +4308,7 @@ theorem complexAmbientCoordinateDerivation_complexification rw [map_mul, MvPolynomial.map_X, MvPolynomial.pderiv_map] /-- The complex ambient rotation used in the spherical-code argument. -/ -def complexAmbientRotation {r n : ℕ} (a b : Fin n) : +@[expose] def complexAmbientRotation {r n : ℕ} (a b : Fin n) : Derivation ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) (MvPolynomial (Fin ((r + 1) * n)) ℂ) := complexAmbientCoordinateDerivation (r := r) a b - @@ -4331,7 +4331,7 @@ theorem complexAmbientRotation_complexification complexAmbientCoordinateDerivation_complexification, map_sub] /-- The young real polynomial image used in the spherical-code argument. -/ -def youngRealPolynomialImage {r n : ℕ} +@[expose] def youngRealPolynomialImage {r n : ℕ} (lam : Fin (r + 1) → ℕ) (W : Submodule ℝ (HarmonicYoungSpace (n := n) lam)) : Submodule ℝ (PolynomialSpace r n) := @@ -4382,14 +4382,14 @@ theorem youngRealPolynomialImage_inf_orthogonal_eq_bot {r n : ℕ} simp only [hzzero, zero_mem] /-- The young complex polynomial span used in the spherical-code argument. -/ -def youngComplexPolynomialSpan {r n : ℕ} +@[expose] def youngComplexPolynomialSpan {r n : ℕ} (lam : Fin (r + 1) → ℕ) (W : Submodule ℝ (HarmonicYoungSpace (n := n) lam)) : Submodule ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) := polynomialComplexSpan (youngRealPolynomialImage lam W) /-- The full young complex polynomial span used in the spherical-code argument. -/ -def fullYoungComplexPolynomialSpan {r n : ℕ} +@[expose] def fullYoungComplexPolynomialSpan {r n : ℕ} (lam : Fin (r + 1) → ℕ) : Submodule ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) := polynomialComplexSpan (harmonicYoungSubmodule lam) @@ -4461,7 +4461,7 @@ theorem commute_rootOperatorWord hcomm i, ← LinearMap.comp_assoc] /-- The operator word span used in the spherical-code argument. -/ -def operatorWordSpan +@[expose] def operatorWordSpan {K V I : Type*} [Semiring K] [AddCommMonoid V] [Module K V] (R : I → V →ₗ[K] V) (v : V) : Submodule K V := @@ -5944,7 +5944,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.DeterminantVectors open MetricCodes.Spherical.HigherYoungPenultimateRowProjectedLower /-- The arbitrary row raise tensor gram scalar used in the spherical-code argument. -/ -def arbitraryRowRaiseTensorGramScalar +@[expose] def arbitraryRowRaiseTensorGramScalar {r n : ℕ} (high : Fin (r + 1) → ℕ) (row : Fin (r + 1)) : ℝ := internalRowLowerGramScalar high row * @@ -6658,7 +6658,7 @@ def ambientPairIndex {r n : ℕ} omega /-- The isotropic coordinate generator used in the spherical-code argument. -/ -def isotropicCoordinateGenerator {r n : ℕ} (h : 2 * (r + 1) ≤ n) +@[expose] def isotropicCoordinateGenerator {r n : ℕ} (h : 2 * (r + 1) ≤ n) (v : Fin ((r + 1) * n)) : MvPolynomial (Fin ((r + 1) * n)) ℂ := let a := ((finProdFinEquiv (m := r + 1) (n := n)).symm v).1 diff --git a/LeanPool/MetricCodes/Interlacing.lean b/LeanPool/MetricCodes/Interlacing.lean index 3352d30920..05dd078347 100644 --- a/LeanPool/MetricCodes/Interlacing.lean +++ b/LeanPool/MetricCodes/Interlacing.lean @@ -15,7 +15,7 @@ public import Mathlib.RingTheory.Derivation.Basic Mickelsson operators, interlacing schedules, and canonical projected-axis witnesses. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -35,7 +35,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.ArbitraryRankLowerRowBranching open MetricCodes.Spherical.HigherHarmonicYoung.AllRankArbitraryRowBranchingOperator /-- The upper polarization path commutator used in the spherical-code argument. -/ -def upperPolarizationPathCommutator {r n : ℕ} +@[expose] def upperPolarizationPathCommutator {r n : ℕ} (a b : Fin (r + 1)) : List (Fin (r + 1)) → (PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n) @@ -4147,7 +4147,7 @@ section open scoped BigOperators InnerProductSpace /-- The young ambient casimir used in the spherical-code argument. -/ -def youngAmbientCasimir {r n : ℕ} (lam : Fin (r + 1) → ℕ) : +@[expose] def youngAmbientCasimir {r n : ℕ} (lam : Fin (r + 1) → ℕ) : HarmonicYoungSpace (n := n) lam →ₗ[ℝ] HarmonicYoungSpace (n := n) lam := (2 : ℝ)⁻¹ • @@ -4790,7 +4790,7 @@ open scoped BigOperators InnerProductSpace open MetricCodes.Spherical.HigherHarmonicYoung.ArbitraryRankLowerRowBranching /-- The all rank casimir eigenvalue used in the spherical-code argument. -/ -def allRankCasimirEigenvalue {r : ℕ} +@[expose] def allRankCasimirEigenvalue {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℝ := ∑ i : Fin (r + 1), (lam i : ℝ) * ((lam i : ℝ) + (n : ℝ) - 2 - 2 * (i.val : ℝ)) @@ -5505,7 +5505,7 @@ theorem boxWeylDimensions_of_actualWeyl {r m n : ℕ} exact (boxSignature_interlaces a b hstable j).antitone_ambient /-- The box axis used in the spherical-code argument. -/ -def boxAxis (n : ℕ) (hn : 0 < n) : SpherePoint n := by +@[expose] def boxAxis (n : ℕ) (hn : 0 < n) : SpherePoint n := by cases n with | zero => omega | succ d => @@ -5929,7 +5929,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] /-- The adjacent normalized axis coefficient used in the spherical-code argument. -/ -def adjacentNormalizedAxisCoefficient +@[expose] def adjacentNormalizedAxisCoefficient (sourceGram targetGram coefficient : ℝ) : ℝ := coefficient * Real.sqrt targetGram / Real.sqrt sourceGram @@ -6848,7 +6848,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.BGGRootComplex open MetricCodes.Spherical.HigherYoungInternalRowPolarizationDescent /-- The lowered internal young weight used in the spherical-code argument. -/ -def loweredInternalYoungWeight {r : ℕ} +@[expose] def loweredInternalYoungWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) (a : Fin (r + 1)) : Fin (r + 1) → ℕ := Function.update lam a (lam a - 1) diff --git a/LeanPool/MetricCodes/MatrixPerron.lean b/LeanPool/MetricCodes/MatrixPerron.lean index 1f9cebd2ce..3ccc4de890 100644 --- a/LeanPool/MetricCodes/MatrixPerron.lean +++ b/LeanPool/MetricCodes/MatrixPerron.lean @@ -18,7 +18,7 @@ bounds. It requires no coding-theory definitions. Positivity is propagated along positive matrix entries, allowing arbitrary finite index sets rather than just tridiagonal grids. -/ -@[expose] public section +public section noncomputable section @@ -39,15 +39,15 @@ structure ConnectedNonnegativeMatrix (A : Matrix I I ℝ) : Prop where ⟨fun i j => PLift (0 < A i j)⟩ /-- The linear operator associated to a real matrix. -/ -def operator (A : Matrix I I ℝ) : Space I →ₗ[ℝ] Space I := +@[expose] def operator (A : Matrix I I ℝ) : Space I →ₗ[ℝ] Space I := Matrix.toEuclideanLin A /-- The continuous linear operator associated to a finite real matrix. -/ -def continuousOperator (A : Matrix I I ℝ) : Space I →L[ℝ] Space I := +@[expose] def continuousOperator (A : Matrix I I ℝ) : Space I →L[ℝ] Space I := LinearMap.toContinuousLinearMap (operator A) /-- The Rayleigh quotient of the matrix operator. -/ -def rayleigh (A : Matrix I I ℝ) (x : Space I) : ℝ := +@[expose] def rayleigh (A : Matrix I I ℝ) (x : Space I) : ℝ := (continuousOperator A).rayleighQuotient x omit [Nonempty I] in @@ -60,7 +60,7 @@ theorem rayleigh_bddAbove (A : Matrix I I ℝ) : ((continuousOperator A).rayleighQuotient_le_norm x) /-- The supremum of the Rayleigh quotient over nonzero vectors. -/ -def topEigenvalue (A : Matrix I I ℝ) : ℝ := +@[expose] def topEigenvalue (A : Matrix I I ℝ) : ℝ := ⨆ x : {x : Space I // x ≠ 0}, rayleigh A x omit [Nonempty I] in @@ -93,7 +93,7 @@ theorem exists_topEigenvector (A : Matrix I I ℝ) exact ⟨x, hx.2, hx.apply_eq_smul⟩ /-- Take the absolute value of each coordinate. -/ -def coordinateAbs (x : Space I) : Space I := +@[expose] def coordinateAbs (x : Space I) : Space I := WithLp.toLp 2 fun i : I => |x i| omit [DecidableEq I] [Nonempty I] in diff --git a/LeanPool/MetricCodes/Rates.lean b/LeanPool/MetricCodes/Rates.lean index b459a11cd1..2d7effcb29 100644 --- a/LeanPool/MetricCodes/Rates.lean +++ b/LeanPool/MetricCodes/Rates.lean @@ -18,7 +18,7 @@ public import Mathlib.Probability.Distributions.Beta The MRRW comparison and the first spherical hierarchy and numerical bounds. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -1324,6 +1324,7 @@ theorem johnsonWindowBasis_dot_coupled (h.complementResidual_bound source) a) b /-- The adjacent Johnson channel matrix indexed by shell-window harmonic coordinates. -/ +@[expose] def johnsonWindowChannelMatrix {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (hstrict : 2 * w < n) @@ -1515,6 +1516,7 @@ theorem johnsonWindowChannelMatrix_transpose_mul ring /-- The shell-window channel matrix reindexed by the total Johnson ambient dimension. -/ +@[expose] def johnsonChannelMatrix {n w p q L : ℕ} (h : AdmissibleDegrees n w p q L) (hstrict : 2 * w < n) @@ -3699,11 +3701,11 @@ def kissingA : ℝ := 0.08570143806746 def kissingB : ℝ := 0.00370282933568 /-- The log series lower used in the metric-code argument. -/ -def logSeriesLower (x : ℝ) (m : ℕ) : ℝ := +@[expose] def logSeriesLower (x : ℝ) (m : ℕ) : ℝ := 2 * ∑ i ∈ Finset.range m, x ^ (2 * i + 1) / (2 * (i : ℝ) + 1) /-- The log series upper used in the metric-code argument. -/ -def logSeriesUpper (x : ℝ) (m : ℕ) : ℝ := +@[expose] def logSeriesUpper (x : ℝ) (m : ℕ) : ℝ := logSeriesLower x m + 2 * (x ^ (2 * m + 1) / (1 - x ^ 2)) theorem log_ratio_lower {x : ℝ} (hx : 0 ≤ x) (hx' : x < 1) (m : ℕ) : @@ -3939,16 +3941,16 @@ theorem sphericalEntropy_sub_nonneg {a b : ℝ} (sphericalEntropy_strictMono.monotoneOn hb ha hba) /-- The feasible used in the spherical-code argument. -/ -def Feasible (s a b : ℝ) : Prop := +@[expose] def Feasible (s a b : ℝ) : Prop := 0 < b ∧ b < a ∧ s < 2 * MetricCodes.Gamma a b /-- The rate set used in the spherical-code argument. -/ -def rateSet (s : ℝ) : Set ℝ := +@[expose] def rateSet (s : ℝ) : Set ℝ := {r | ∃ a b : ℝ, Feasible s a b ∧ r = MetricCodes.sphericalEntropy a - MetricCodes.sphericalEntropy b} /-- The variational rate used in the spherical-code argument. -/ -def variationalRate (s : ℝ) : ℝ := sInf (rateSet s) +@[expose] def variationalRate (s : ℝ) : ℝ := sInf (rateSet s) theorem rateSet_bddBelow (s : ℝ) : BddBelow (rateSet s) := by refine ⟨0, ?_⟩ @@ -4024,7 +4026,7 @@ theorem classicalThreshold_spectral exact (div_eq_iff hlin.ne').2 htarget /-- The spherical improvement path used in the spherical-code argument. -/ -def sphericalImprovementPath (a b : ℝ) : ℝ := +@[expose] def sphericalImprovementPath (a b : ℝ) : ℝ := a + (4 * a + 3) * b theorem sphericalImprovementSlope_gt_one {a : ℝ} (ha : 0 < a) : @@ -4310,40 +4312,40 @@ open scoped BigOperators namespace HigherHierarchy /-- The spectral atom used in the spherical-code argument. -/ -def spectralAtom (u : ℝ) : ℝ := +@[expose] def spectralAtom (u : ℝ) : ℝ := Real.sqrt (u * (1 + u)) / (1 + 2 * u) /-- The interlacing used in the spherical-code argument. -/ -def Interlacing {r : ℕ} +@[expose] def Interlacing {r : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) : Prop := 0 ≤ a (Fin.last r) ∧ ∀ i : Fin r, a i.castSucc > b i ∧ b i > a i.succ /-- The lagrange numerator used in the spherical-code argument. -/ -def lagrangeNumerator {r : ℕ} +@[expose] def lagrangeNumerator {r : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (ℓ : Fin (r + 1)) : ℝ := ∏ m : Fin r, (((a ℓ) * (1 + (a ℓ))) - ((b m) * (1 + (b m)))) /-- The lagrange denominator used in the spherical-code argument. -/ -def lagrangeDenominator {r : ℕ} +@[expose] def lagrangeDenominator {r : ℕ} (a : Fin (r + 1) → ℝ) (ℓ : Fin (r + 1)) : ℝ := ∏ m : Fin r, (((a ℓ) * (1 + (a ℓ))) - ((a (ℓ.succAbove m)) * (1 + (a (ℓ.succAbove m))))) /-- The lagrange weight used in the spherical-code argument. -/ -def lagrangeWeight {r : ℕ} +@[expose] def lagrangeWeight {r : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (ℓ : Fin (r + 1)) : ℝ := lagrangeNumerator a b ℓ / lagrangeDenominator a ℓ /-- The gamma used in the spherical-code argument. -/ -def Gamma {r : ℕ} +@[expose] def Gamma {r : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) : ℝ := ∑ ℓ : Fin (r + 1), lagrangeWeight a b ℓ * spectralAtom (a ℓ) /-- The phi used in the spherical-code argument. -/ -def Phi {r : ℕ} +@[expose] def Phi {r : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) : ℝ := (∑ ℓ : Fin (r + 1), MetricCodes.sphericalEntropy (a ℓ)) - ∑ m : Fin r, MetricCodes.sphericalEntropy (b m) @@ -5198,12 +5200,12 @@ theorem Interlacing.Phi_nonneg {r : ℕ} ring /-- The hierarchy rate set used in the spherical-code argument. -/ -def hierarchyRateSet (s : ℝ) : Set ℝ := +@[expose] def hierarchyRateSet (s : ℝ) : Set ℝ := {z | ∃ (r : ℕ) (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ), Interlacing a b ∧ s < 2 * Gamma a b ∧ z = Phi a b} /-- The hierarchy variational rate used in the spherical-code argument. -/ -def hierarchyVariationalRate (s : ℝ) : ℝ := sInf (hierarchyRateSet s) +@[expose] def hierarchyVariationalRate (s : ℝ) : ℝ := sInf (hierarchyRateSet s) theorem hierarchyRateSet_bddBelow (s : ℝ) : BddBelow (hierarchyRateSet s) := by @@ -5234,7 +5236,7 @@ def stieltjesPhase {r : ℕ} (t + u)⁻¹ /-- The stieltjes phase product used in the spherical-code argument. -/ -def stieltjesPhaseProduct {r : ℕ} +@[expose] def stieltjesPhaseProduct {r : ℕ} (a : Fin (r + 1) → ℝ) (b : Fin r → ℝ) (t : ℝ) : ℝ := t * (∏ i : Fin r, (t + ((b i) * (1 + (b i))))) / (∏ i : Fin (r + 1), (t + ((a i) * (1 + (a i))))) diff --git a/LeanPool/MetricCodes/Representation.lean b/LeanPool/MetricCodes/Representation.lean index 0ce98730b4..ed4504e81e 100644 --- a/LeanPool/MetricCodes/Representation.lean +++ b/LeanPool/MetricCodes/Representation.lean @@ -16,7 +16,7 @@ public import Mathlib.Analysis.InnerProductSpace.TensorProduct Associated Gegenbauer systems, harmonic Young spaces, and higher projection graphs. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -409,7 +409,7 @@ abbrev PolynomialSpace (r n : ℕ) := MvPolynomial (Fin ((r + 1) * n)) ℝ /-- The variable index used in the spherical-code argument. -/ -def variableIndex {r n : ℕ} (i : Fin (r + 1)) (j : Fin n) : +@[expose] def variableIndex {r n : ℕ} (i : Fin (r + 1)) (j : Fin n) : Fin ((r + 1) * n) := finProdFinEquiv (i, j) @@ -1219,7 +1219,7 @@ def rowAxisHomogeneous {r n : ℕ} v)).mul p.property.1) /-- The projected coordinate raise used in the spherical-code argument. -/ -def projectedCoordinateRaise {r n : ℕ} +@[expose] def projectedCoordinateRaise {r n : ℕ} (mu lam : Fin (r + 1) → ℕ) (hdeg : (∑ i, mu i) = (∑ i, lam i) + 1) (i : Fin (r + 1)) (v : SpherePacking.Euclidean n) : @@ -1520,11 +1520,11 @@ open scoped BigOperators Nat Topology namespace HigherHierarchy.Weyl /-- The tail length used in the spherical-code argument. -/ -def tailLength (n r : ℕ) (i : Fin (r + 1)) : ℕ := +@[expose] def tailLength (n r : ℕ) (i : Fin (r + 1)) : ℕ := n - i.val - r - 3 /-- The row tail used in the spherical-code argument. -/ -def rowTail {r : ℕ} (i : Fin (r + 1)) : ℕ := +@[expose] def rowTail {r : ℕ} (i : Fin (r + 1)) : ℕ := r - i.val /-- The row factor used in the spherical-code argument. -/ @@ -1538,7 +1538,7 @@ def rowFactor {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) ((lam i + rowTail i).factorial : ℝ)) /-- The pair factor used in the spherical-code argument. -/ -def pairFactor {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) +@[expose] def pairFactor {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (i j : Fin (r + 1)) : ℝ := (((lam i : ℝ) - (lam j : ℝ) + (j.val : ℝ) - (i.val : ℝ)) / ((j.val : ℝ) - (i.val : ℝ))) * @@ -1547,7 +1547,7 @@ def pairFactor {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) ((n : ℝ) - (i.val : ℝ) - (j.val : ℝ) - 2)) /-- The dimension used in the spherical-code argument. -/ -def dimension {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℝ := +@[expose] def dimension {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℝ := (∏ i, rowFactor n lam i) * ∏ i, ∏ j, if i < j then pairFactor n lam i j else 1 @@ -2133,7 +2133,7 @@ theorem tendsto_log_dimension_div_log_two exact h /-- The floored weight used in the spherical-code argument. -/ -def flooredWeight {r : ℕ} (a : Fin (r + 1) → ℝ) (n : ℕ) +@[expose] def flooredWeight {r : ℕ} (a : Fin (r + 1) → ℝ) (n : ℕ) (i : Fin (r + 1)) : ℕ := ⌊a i * (n : ℝ)⌋₊ @@ -2417,7 +2417,7 @@ theorem card_rowDegreeFamilies {r n : ℕ} simp only [Finset.card_finsuppAntidiag_nat_eq_choose, Finset.card_univ, Fintype.card_fin] /-- The young multihomogeneous exponents used in the spherical-code argument. -/ -def youngMultihomogeneousExponents {r : ℕ} (n : ℕ) +@[expose] def youngMultihomogeneousExponents {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Finset (Fin ((r + 1) * n) →₀ ℕ) := (rowDegreeFamilies (n := n) lam).image flattenRowExponents @@ -3775,7 +3775,7 @@ section open scoped BigOperators /-- The row pairing polynomial used in the spherical-code argument. -/ -def rowPairingPolynomial {r n : ℕ} (i j : Fin (r + 1)) : +@[expose] def rowPairingPolynomial {r n : ℕ} (i j : Fin (r + 1)) : PolynomialSpace r n := ∑ k : Fin n, MvPolynomial.X (variableIndex i k) * @@ -4871,7 +4871,7 @@ theorem fullBranchOfInterlaces_signature {r : ℕ} · simp only [fullBranchOfInterlaces_castSucc, Fin.snoc_castSucc] /-- The weyl branching recurrence used in the spherical-code argument. -/ -def WeylBranchingRecurrence {r : ℕ} (n : ℕ) +@[expose] def WeylBranchingRecurrence {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Prop := Weyl.dimension n lam = ∑ mu : FullBranchWeight lam, @@ -4993,7 +4993,7 @@ def complexRowEuler {r n : ℕ} (i : Fin (r + 1)) MvPolynomial.pderiv (variableIndex i j) p /-- The complex trace operator used in the spherical-code argument. -/ -def complexTraceOperator {r n : ℕ} (i j : Fin (r + 1)) +@[expose] def complexTraceOperator {r n : ℕ} (i j : Fin (r + 1)) (p : MvPolynomial (Fin ((r + 1) * n)) ℂ) : MvPolynomial (Fin ((r + 1) * n)) ℂ := ∑ k : Fin n, @@ -5248,7 +5248,7 @@ theorem pderiv_nullRowLinearForm {r m n : ℕ} · simp only [Ne.symm hi, false_and, ↓reduceIte, mul_zero, Finset.sum_const_zero, hi] /-- The null substitution used in the spherical-code argument. -/ -def nullSubstitution {r m n : ℕ} (hn : 2 * m ≤ n) : +@[expose] def nullSubstitution {r m n : ℕ} (hn : 2 * m ≤ n) : MvPolynomial (Fin (r + 1) × Fin m) ℂ →ₐ[ℂ] MvPolynomial (Fin ((r + 1) * n)) ℂ := MvPolynomial.aeval fun z => nullRowLinearForm hn z.1 z.2 @@ -5454,12 +5454,12 @@ theorem nullSubstitution_injective {r m n : ℕ} namespace DeterminantVectors /-- The even coordinate used in the spherical-code argument. -/ -def evenCoordinate {r n : ℕ} (h : 2 * (r + 1) ≤ n) +@[expose] def evenCoordinate {r n : ℕ} (h : 2 * (r + 1) ≤ n) (j : Fin (r + 1)) : Fin n := ⟨2 * j.val, by have := j.isLt; omega⟩ /-- The odd coordinate used in the spherical-code argument. -/ -def oddCoordinate {r n : ℕ} (h : 2 * (r + 1) ≤ n) +@[expose] def oddCoordinate {r n : ℕ} (h : 2 * (r + 1) ≤ n) (j : Fin (r + 1)) : Fin n := ⟨2 * j.val + 1, by have := j.isLt; omega⟩ @@ -5514,7 +5514,7 @@ theorem evenCoordinate_ne_oddCoordinate {r n : ℕ} rfl /-- The isotropic variable used in the spherical-code argument. -/ -def isotropicVariable {r n : ℕ} (h : 2 * (r + 1) ≤ n) +@[expose] def isotropicVariable {r n : ℕ} (h : 2 * (r + 1) ≤ n) (i j : Fin (r + 1)) : MvPolynomial (Fin ((r + 1) * n)) ℂ := MvPolynomial.X (variableIndex i (evenCoordinate h j)) + MvPolynomial.C Complex.I * @@ -5662,7 +5662,7 @@ theorem derivation_det_eq_zero {σ ι : Type*} simp only [smul_eq_mul, mul_zero, add_zero] /-- The minor index used in the spherical-code argument. -/ -def minorIndex {r : ℕ} (k : Fin (r + 1)) +@[expose] def minorIndex {r : ℕ} (k : Fin (r + 1)) (i : Fin (k.val + 1)) : Fin (r + 1) := ⟨i.val, by have := i.isLt; have := k.isLt; omega⟩ @@ -5835,7 +5835,7 @@ theorem isotropicVariable_eq_nullRowLinearForm {r n : ℕ} rfl /-- The source leading minor used in the spherical-code argument. -/ -def sourceLeadingMinor {r : ℕ} (k : Fin (r + 1)) : +@[expose] def sourceLeadingMinor {r : ℕ} (k : Fin (r + 1)) : MvPolynomial (Fin (r + 1) × Fin (r + 1)) ℂ := Matrix.det (Matrix.of fun i j : Fin (k.val + 1) => MvPolynomial.X (minorIndex k i, minorIndex k j)) @@ -5906,7 +5906,7 @@ def highestWeightPolynomial {r n : ℕ} (h : 2 * (r + 1) ≤ n) ∏ k : Fin (r + 1), leadingMinor h k ^ e k /-- The source highest weight polynomial used in the spherical-code argument. -/ -def sourceHighestWeightPolynomial {r : ℕ} +@[expose] def sourceHighestWeightPolynomial {r : ℕ} (e : Fin (r + 1) → ℕ) : MvPolynomial (Fin (r + 1) × Fin (r + 1)) ℂ := ∏ k : Fin (r + 1), sourceLeadingMinor k ^ e k @@ -5978,7 +5978,7 @@ theorem highestWeightPolynomial_ne_zero {r n : ℕ} simp only [hz, map_zero, zero_ne_one] at this /-- The determinant weight used in the spherical-code argument. -/ -def determinantWeight {r : ℕ} (e : Fin (r + 1) → ℕ) +@[expose] def determinantWeight {r : ℕ} (e : Fin (r + 1) → ℕ) (i : Fin (r + 1)) : ℕ := ∑ k : Fin (r + 1), if i ≤ k then e k else 0 @@ -6150,7 +6150,7 @@ theorem finrank_harmonicYoung_pos_of_antitone {r n : ℕ} (dominantHighestWeightWitness h lam hdom) /-- The conjugate isotropic variable used in the spherical-code argument. -/ -def conjugateIsotropicVariable {r n : ℕ} +@[expose] def conjugateIsotropicVariable {r n : ℕ} (h : 2 * (r + 1) ≤ n) (i j : Fin (r + 1)) : MvPolynomial (Fin ((r + 1) * n)) ℂ := MvPolynomial.X (variableIndex i (evenCoordinate h j)) - @@ -6388,7 +6388,7 @@ theorem ambientPositiveRoot_dominantHighestWeightWitness {r n : ℕ} (signatureExponent lam) p q hpq /-- The antiholomorphic derivative used in the spherical-code argument. -/ -def antiholomorphicDerivative {r n : ℕ} +@[expose] def antiholomorphicDerivative {r n : ℕ} (h : 2 * (r + 1) ≤ n) (a p : Fin (r + 1)) : Derivation ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) (MvPolynomial (Fin ((r + 1) * n)) ℂ) := @@ -6416,7 +6416,7 @@ theorem antiholomorphicDerivative_isotropicVariable {r n : ℕ} · simp only [hij, ↓reduceIte, mul_zero, add_zero] /-- The ambient sum positive root used in the spherical-code argument. -/ -def ambientSumPositiveRoot {r n : ℕ} +@[expose] def ambientSumPositiveRoot {r n : ℕ} (h : 2 * (r + 1) ≤ n) (p q : Fin (r + 1)) : Derivation ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) (MvPolynomial (Fin ((r + 1) * n)) ℂ) := @@ -6578,7 +6578,7 @@ theorem ambientShortPositiveRoot_dominantHighestWeightWitness {r n : ℕ} (signatureExponent lam) p t ht /-- The ambient cartan used in the spherical-code argument. -/ -def ambientCartan {r n : ℕ} +@[expose] def ambientCartan {r n : ℕ} (h : 2 * (r + 1) ≤ n) (p : Fin (r + 1)) : Derivation ℂ (MvPolynomial (Fin ((r + 1) * n)) ℂ) (MvPolynomial (Fin ((r + 1) * n)) ℂ) := @@ -6721,17 +6721,17 @@ def FiniteInterlacing {r : ℕ} (n : ℕ) ∀ m : Fin r, mu m ≤ lam m.castSucc ∧ lam m.succ ≤ mu m /-- The ambient shift used in the spherical-code argument. -/ -def ambientShift {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) +@[expose] def ambientShift {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (ℓ : Fin (r + 1)) : ℝ := (lam ℓ : ℝ) + (n : ℝ) / 2 - ((ℓ.val : ℝ) + 1) /-- The stabilizer shift used in the spherical-code argument. -/ -def stabilizerShift {r : ℕ} (n : ℕ) (mu : Fin r → ℕ) +@[expose] def stabilizerShift {r : ℕ} (n : ℕ) (mu : Fin r → ℕ) (m : Fin r) : ℝ := (mu m : ℝ) + ((n : ℝ) - 1) / 2 - ((m.val : ℝ) + 1) /-- The wall shift used in the spherical-code argument. -/ -def wallShift (n r : ℕ) : ℝ := +@[expose] def wallShift (n r : ℕ) : ℝ := (n : ℝ) / 2 - (r : ℝ) - 1 theorem FiniteInterlacing.wallShift_pos {r n : ℕ} @@ -6818,13 +6818,13 @@ theorem FiniteInterlacing.stabilizerShift_pos {r n : ℕ} linarith [h.stabilizerShift_ge_succ m] /-- The active denominator used in the spherical-code argument. -/ -def activeDenominator {r : ℕ} +@[expose] def activeDenominator {r : ℕ} (L : Fin (r + 1) → ℝ) (ℓ : Fin (r + 1)) : ℝ := 2 * L ℓ * ∏ q : Fin r, (L ℓ ^ 2 - L (ℓ.succAbove q) ^ 2) /-- The plus probability used in the spherical-code argument. -/ -def plusProbability {r : ℕ} (n : ℕ) +@[expose] def plusProbability {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (mu : Fin r → ℕ) (ℓ : Fin (r + 1)) : ℝ := ((ambientShift n lam ℓ + wallShift n r) * @@ -6834,7 +6834,7 @@ def plusProbability {r : ℕ} (n : ℕ) activeDenominator (ambientShift n lam) ℓ /-- The minus probability used in the spherical-code argument. -/ -def minusProbability {r : ℕ} (n : ℕ) +@[expose] def minusProbability {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (mu : Fin r → ℕ) (ℓ : Fin (r + 1)) : ℝ := ((ambientShift n lam ℓ - wallShift n r) * @@ -6974,7 +6974,7 @@ theorem FiniteInterlacing.minusProbability_nonneg {r n : ℕ} (Finset.prod_nonneg fun m _ => h.minusFactor_nonneg ℓ m) /-- The signed node used in the spherical-code argument. -/ -def signedNode {r : ℕ} (L : Fin (r + 1) → ℝ) +@[expose] def signedNode {r : ℕ} (L : Fin (r + 1) → ℝ) (z : Fin (r + 1) × Bool) : ℝ := if z.2 then L z.1 else -L z.1 @@ -6993,7 +6993,7 @@ theorem signedNode_injective {r : ℕ} · exact Prod.ext (hinj heq) rfl /-- The channel numerator polynomial used in the spherical-code argument. -/ -def channelNumeratorPolynomial {r : ℕ} +@[expose] def channelNumeratorPolynomial {r : ℕ} (rho : ℝ) (M : Fin r → ℝ) : Polynomial ℝ := (Polynomial.X + Polynomial.C rho) * ∏ m : Fin r, @@ -8436,7 +8436,7 @@ section open scoped BigOperators /-- The young gram radial ideal used in the spherical-code argument. -/ -def youngGramRadialIdeal (r n : ℕ) : Ideal (PolynomialSpace r n) := +@[expose] def youngGramRadialIdeal (r n : ℕ) : Ideal (PolynomialSpace r n) := Ideal.span (Set.range fun ij : Fin (r + 1) × Fin (r + 1) => rowPairingPolynomial (n := n) ij.1 ij.2) @@ -8479,7 +8479,7 @@ theorem polynomialInner_youngGramRadialIdeal_eq_zero_of_traceFree simpa only [one_mul] using hstrong 1 /-- The young gram radial weight submodule used in the spherical-code argument. -/ -def youngGramRadialWeightSubmodule {r : ℕ} +@[expose] def youngGramRadialWeightSubmodule {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Submodule ℝ (youngMultihomogeneousSubmodule n lam) := ((youngGramRadialIdeal r n).restrictScalars ℝ).comap diff --git a/LeanPool/MetricCodes/Rigidity.lean b/LeanPool/MetricCodes/Rigidity.lean index 14a77c8278..bc4c20012b 100644 --- a/LeanPool/MetricCodes/Rigidity.lean +++ b/LeanPool/MetricCodes/Rigidity.lean @@ -13,7 +13,7 @@ public import LeanPool.MetricCodes.Weyl Completion of the root complex and rigidity of harmonic highest-weight vectors. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable diff --git a/LeanPool/MetricCodes/RootComplex.lean b/LeanPool/MetricCodes/RootComplex.lean index 5ce601fca0..dbdf0e1ae3 100644 --- a/LeanPool/MetricCodes/RootComplex.lean +++ b/LeanPool/MetricCodes/RootComplex.lean @@ -17,7 +17,7 @@ public import Mathlib.Data.Set.PowersetCard Orthogonal root kernels and the universal BGG complex used in the all-rank argument. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -1055,7 +1055,7 @@ open MetricCodes.Spherical.HigherYoungMaximalCartanNullSubstitutionRange open MetricCodes.Spherical.HigherYoungTwoRowLieIrreducibility /-- The young complex pair used in the spherical-code argument. -/ -def youngComplexPair {r n : ℕ} (lam : Fin (r + 1) → ℕ) +@[expose] def youngComplexPair {r n : ℕ} (lam : Fin (r + 1) → ℕ) (p q : HarmonicYoungSpace (n := n) lam) : MvPolynomial (Fin ((r + 1) * n)) ℂ := polynomialComplexification (p : PolynomialSpace r n) + @@ -1602,7 +1602,7 @@ abbrev PositiveRoot (r : ℕ) := {z : Fin (r + 1) × Fin (r + 1) // z.1 < z.2} /-- The positive root operator used in the spherical-code argument. -/ -def positiveRootOperator {r : ℕ} (n : ℕ) (α : PositiveRoot r) : +@[expose] def positiveRootOperator {r : ℕ} (n : ℕ) (α : PositiveRoot r) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := polarization r n α.val.2 α.val.1 @@ -1619,7 +1619,7 @@ section variable {α : Type*} [LinearOrder α] /-- The exterior root sign used in the spherical-code argument. -/ -def exteriorRootSign (s : Finset α) (a : α) : ℤ := +@[expose] def exteriorRootSign (s : Finset α) (a : α) : ℤ := (-1 : ℤ) ^ (s.filter fun x => x < a).card theorem exteriorRoot_predecessorCard_erase_lt (s : Finset α) {a b : α} @@ -1683,11 +1683,11 @@ abbrev RootWedge (r k : ℕ) := {S : Finset (PositiveRoot r) // S.card = k} /-- The positive root first used in the spherical-code argument. -/ -def positiveRootFirst {r : ℕ} (α : PositiveRoot r) : Fin (r + 1) := +@[expose] def positiveRootFirst {r : ℕ} (α : PositiveRoot r) : Fin (r + 1) := α.val.1 /-- The positive root second used in the spherical-code argument. -/ -def positiveRootSecond {r : ℕ} (α : PositiveRoot r) : Fin (r + 1) := +@[expose] def positiveRootSecond {r : ℕ} (α : PositiveRoot r) : Fin (r + 1) := α.val.2 @[simp] theorem positiveRootFirst_lt_second {r : ℕ} @@ -1699,7 +1699,7 @@ theorem positiveRootFirst_ne_second {r : ℕ} (α : PositiveRoot r) : ne_of_lt (positiveRootFirst_lt_second α) /-- The root charge used in the spherical-code argument. -/ -def rootCharge {r : ℕ} (α : PositiveRoot r) +@[expose] def rootCharge {r : ℕ} (α : PositiveRoot r) (i : Fin (r + 1)) : ℤ := if i = positiveRootFirst α then 1 else if i = positiveRootSecond α then -1 @@ -1721,7 +1721,7 @@ theorem rootCharge_eq_zero_of_ne {r : ℕ} simp only [rootCharge, hfirst, ↓reduceIte, hsecond] /-- The root family charge used in the spherical-code argument. -/ -def rootFamilyCharge {r : ℕ} (S : Finset (PositiveRoot r)) +@[expose] def rootFamilyCharge {r : ℕ} (S : Finset (PositiveRoot r)) (i : Fin (r + 1)) : ℤ := ∑ α ∈ S, rootCharge α i @@ -1754,7 +1754,7 @@ theorem rootFamilyCharge_erase {r : ℕ} omega /-- The signed root weight used in the spherical-code argument. -/ -def signedRootWeight {r : ℕ} +@[expose] def signedRootWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) (S : Finset (PositiveRoot r)) (i : Fin (r + 1)) : ℤ := @@ -1823,12 +1823,12 @@ open MetricCodes.Spherical.HigherHarmonicYoung.BGGRootComplex abbrev RootVector (r : ℕ) := PositiveRoot r →₀ ℝ /-- The root structure constant used in the spherical-code argument. -/ -def rootStructureConstant {r : ℕ} (α β γ : PositiveRoot r) : ℝ := +@[expose] def rootStructureConstant {r : ℕ} (α β γ : PositiveRoot r) : ℝ := (if α.val.1 = β.val.2 ∧ γ.val = (β.val.1, α.val.2) then 1 else 0) - (if β.val.1 = α.val.2 ∧ γ.val = (α.val.1, β.val.2) then 1 else 0) /-- The root bracket used in the spherical-code argument. -/ -def rootBracket {r : ℕ} (α β : PositiveRoot r) : RootVector r := +@[expose] def rootBracket {r : ℕ} (α β : PositiveRoot r) : RootVector r := ∑ γ : PositiveRoot r, rootStructureConstant α β γ • Finsupp.single γ (1 : ℝ) @@ -1991,7 +1991,7 @@ def rootWedgeInsert {r k : ℕ} (T : RootWedge r k) (rootWedgeInsert T α hα).val = insert α T.val := rfl /-- The real exterior root sign used in the spherical-code argument. -/ -def realExteriorRootSign {α : Type*} [LinearOrder α] +@[expose] def realExteriorRootSign {α : Type*} [LinearOrder α] (S : Finset α) (a : α) : ℝ := (exteriorRootSign S a : ℝ) @@ -2971,7 +2971,7 @@ open scoped BigOperators open ArbitraryRankMixedTraceRegularity /-- The gram pair row degree used in the spherical-code argument. -/ -def gramPairRowDegree {r : ℕ} +@[expose] def gramPairRowDegree {r : ℕ} (z : UpperGramPair r) (i : Fin (r + 1)) : ℕ := (if z.val.1 = i then 1 else 0) + (if z.val.2 = i then 1 else 0) @@ -2983,7 +2983,7 @@ theorem gramPairRowDegree_eq_youngGramPairDegree {r : ℕ} simp only [gramPairRowDegree, eq_comm, youngGramPairDegree, Pi.add_apply, Pi.single_apply] /-- The gram family row degree used in the spherical-code argument. -/ -def gramFamilyRowDegree {r : ℕ} +@[expose] def gramFamilyRowDegree {r : ℕ} (s : Finset (UpperGramPair r)) (i : Fin (r + 1)) : ℕ := ∑ z ∈ s, gramPairRowDegree z i @@ -2995,7 +2995,7 @@ def gramFamilyRowDegree {r : ℕ} simp only [gramFamilyRowDegree, hz, not_false_eq_true, Finset.sum_insert] /-- The shifted young ambient coefficient used in the spherical-code argument. -/ -def shiftedYoungAmbientCoefficient {r : ℕ} +@[expose] def shiftedYoungAmbientCoefficient {r : ℕ} (n : ℕ) (lam delta : Fin (r + 1) → ℕ) : ℕ := ∏ i : Fin (r + 1), if delta i ≤ lam i then @@ -3034,7 +3034,7 @@ theorem shiftedYoungAmbientCoefficient_add {r n : ℕ} · rw [ite_eq_right (mt hiff.mp h), ite_eq_right h] /-- The gram koszul coefficient used in the spherical-code argument. -/ -def gramKoszulCoefficient {r : ℕ} +@[expose] def gramKoszulCoefficient {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (s : Finset (UpperGramPair r)) : ℤ := ∑ t ∈ s.powerset, @@ -3110,7 +3110,7 @@ theorem gramKoszulCoefficient_insert {r n : ℕ} rw [hsum, add_zero] /-- The full gram koszul coefficient used in the spherical-code argument. -/ -def fullGramKoszulCoefficient {r : ℕ} +@[expose] def fullGramKoszulCoefficient {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℤ := gramKoszulCoefficient n lam (Finset.univ : Finset (UpperGramPair r)) @@ -3243,19 +3243,19 @@ theorem finrank_youngGramPrefixWeightQuotient_eq_gramKoszulCoefficient_of_recurr · rfl /-- The weyl shift used in the spherical-code argument. -/ -def weylShift {r : ℕ} (lam : Fin (r + 1) → ℕ) +@[expose] def weylShift {r : ℕ} (lam : Fin (r + 1) → ℕ) (σ : Equiv.Perm (Fin (r + 1))) (i : Fin (r + 1)) : ℤ := (lam i : ℤ) - (i.val : ℤ) + ((σ i).val : ℤ) /-- The signed full gram koszul coefficient used in the spherical-code argument. -/ -def signedFullGramKoszulCoefficient {r : ℕ} +@[expose] def signedFullGramKoszulCoefficient {r : ℕ} (n : ℕ) (mu : Fin (r + 1) → ℤ) : ℤ := if ∀ i, 0 ≤ mu i then fullGramKoszulCoefficient n (fun i => (mu i).toNat) else 0 /-- The alternating gram koszul coefficient used in the spherical-code argument. -/ -def alternatingGramKoszulCoefficient {r : ℕ} +@[expose] def alternatingGramKoszulCoefficient {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℤ := ∑ σ : Equiv.Perm (Fin (r + 1)), (Equiv.Perm.sign σ : ℤ) * @@ -3600,7 +3600,7 @@ theorem bgg_range_eq_ker_of_fischerCore_hodgeLaplacian_injective simpa only [← hd, ← he] using hinj /-- The signed joint harmonic weight dimension used in the spherical-code argument. -/ -def signedJointHarmonicWeightDimension {r : ℕ} +@[expose] def signedJointHarmonicWeightDimension {r : ℕ} (n : ℕ) (mu : Fin (r + 1) → ℤ) : ℤ := if _h : ∀ i, 0 ≤ mu i then (Module.finrank ℝ @@ -3688,7 +3688,7 @@ def finitePiFischerCore {ι : Type*} [Fintype ι] hsum i (Finset.mem_univ i) /-- The finite fischer root laplacian used in the spherical-code argument. -/ -def finiteFischerRootLaplacian {ι V : Type*} +@[expose] def finiteFischerRootLaplacian {ι V : Type*} [Fintype ι] [AddCommGroup V] [Module ℝ V] (W : ι → Type*) @@ -3778,7 +3778,7 @@ abbrev ActivePositiveRoot {r : ℕ} (lam : Fin (r + 1) → ℕ) := {α : PositiveRoot r // 0 < lam (positiveRootSecond α)} /-- The active root base weight used in the spherical-code argument. -/ -def activeRootBaseWeight {r : ℕ} +@[expose] def activeRootBaseWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) (α : ActivePositiveRoot lam) : Fin (r + 1) → ℕ := Function.update lam (positiveRootSecond α.val) @@ -3798,7 +3798,7 @@ def activeRootBaseWeight {r : ℕ} Function.update_of_ne] /-- The active root raised weight used in the spherical-code argument. -/ -def activeRootRaisedWeight {r : ℕ} +@[expose] def activeRootRaisedWeight {r : ℕ} (lam : Fin (r + 1) → ℕ) (α : ActivePositiveRoot lam) : Fin (r + 1) → ℕ := Function.update (activeRootBaseWeight lam α) @@ -4917,14 +4917,14 @@ theorem signedJointHarmonicWeightDimension_signedRootWeight rfl /-- The root exterior euler characteristic used in the spherical-code argument. -/ -def rootExteriorEulerCharacteristic {r : ℕ} +@[expose] def rootExteriorEulerCharacteristic {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℤ := ∑ k ∈ Finset.range (Fintype.card (PositiveRoot r) + 1), (-1 : ℤ) ^ k * (Module.finrank ℝ (RootJointHarmonicChain n lam k) : ℤ) /-- The root family euler characteristic used in the spherical-code argument. -/ -def rootFamilyEulerCharacteristic {r : ℕ} +@[expose] def rootFamilyEulerCharacteristic {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℤ := ∑ S : Finset (PositiveRoot r), (-1 : ℤ) ^ S.card * @@ -5035,7 +5035,7 @@ theorem rootAction_injective {r n : ℕ} simpa only [rootAction_X_coefficient] using hcoeff /-- The root vector bracket used in the spherical-code argument. -/ -def rootVectorBracket {r : ℕ} (x y : RootVector r) : RootVector r := +@[expose] def rootVectorBracket {r : ℕ} (x y : RootVector r) : RootVector r := Finsupp.linearCombination ℝ (fun α : PositiveRoot r => Finsupp.linearCombination ℝ (rootBracket α) y) x @@ -5144,7 +5144,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The root bracket boundary coefficient used in the spherical-code argument. -/ -def rootBracketBoundaryCoefficient {r k : ℕ} +@[expose] def rootBracketBoundaryCoefficient {r k : ℕ} (S : RootWedge r (k + 1)) (T : RootWedge r k) : ℝ := by classical exact ∑ α ∈ S.val, ∑ β ∈ S.val.erase α, @@ -5160,7 +5160,7 @@ def rootBracketBoundaryCoefficient {r k : ℕ} else 0 /-- The root wedge singleton used in the spherical-code argument. -/ -def rootWedgeSingleton {r : ℕ} (α : PositiveRoot r) : RootWedge r 1 := +@[expose] def rootWedgeSingleton {r : ℕ} (α : PositiveRoot r) : RootWedge r 1 := ⟨{α}, by simp only [Finset.card_singleton]⟩ /-- The root bracket boundary used in the spherical-code argument. -/ @@ -5197,7 +5197,7 @@ def rootBracketBoundary (r n k : ℕ) : Finset.erase_eq_of_notMem, insert_empty_eq, true_and, Finset.sum_empty] /-- The root chevalley eilenberg boundary used in the spherical-code argument. -/ -def rootChevalleyEilenbergBoundary (r n k : ℕ) : +@[expose] def rootChevalleyEilenbergBoundary (r n k : ℕ) : RootPolynomialChain r n (k + 1) →ₗ[ℝ] RootPolynomialChain r n k := rootActionBoundary r n k + rootBracketBoundary r n k @@ -5415,7 +5415,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The weighted chevalley eilenberg differential used in the spherical-code argument. -/ -def weightedChevalleyEilenbergDifferential {r : ℕ} +@[expose] def weightedChevalleyEilenbergDifferential {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam (k + 1) →ₗ[ℝ] RootJointHarmonicChain n lam k := diff --git a/LeanPool/MetricCodes/SpectralDecomposition.lean b/LeanPool/MetricCodes/SpectralDecomposition.lean index 0dd136ec3d..04b7cb7070 100644 --- a/LeanPool/MetricCodes/SpectralDecomposition.lean +++ b/LeanPool/MetricCodes/SpectralDecomposition.lean @@ -13,7 +13,7 @@ public import LeanPool.MetricCodes.Rigidity Gelfand--Tsetlin completeness, Pieri channels, and projected-axis sufficiency. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -2926,7 +2926,7 @@ namespace HigherYoungAllRankGTCharacteristicResidue open MetricCodes.Spherical.HigherChannel /-- The signed ambient characteristic used in the spherical-code argument. -/ -def signedAmbientCharacteristic {r : ℕ} +@[expose] def signedAmbientCharacteristic {r : ℕ} (L : Fin (r + 1) → ℝ) : Polynomial ℝ := Lagrange.nodal (Finset.univ : Finset (Fin (r + 1) × Bool)) @@ -3515,7 +3515,7 @@ theorem gtTensorCasimir_tmul {r n : ℕ} congr 1 /-- The gt mixed rotation operator used in the spherical-code argument. -/ -def gtMixedRotationOperator {r n : ℕ} +@[expose] def gtMixedRotationOperator {r n : ℕ} (lam : Fin (r + 1) → ℕ) : Module.End ℝ (SpherePacking.Euclidean n ⊗[ℝ] HarmonicYoungSpace (n := n) lam) := @@ -3726,7 +3726,7 @@ open MetricCodes.Spherical.HigherRepresentationGraph (Interlaces) open MetricCodes.Spherical.HigherYoungAllRankGTCharacteristicResidue /-- The gt axis compressed signed projector coefficient used in the spherical-code argument. -/ -def gtAxisCompressedSignedProjectorCoefficient +@[expose] def gtAxisCompressedSignedProjectorCoefficient {r n : ℕ} (lam : Fin (r + 2) → ℕ) (mu : Fin (r + 1) → ℕ) (h : Interlaces lam mu) (hgram : PositiveGelfandTsetlinFischerGram (n := n) lam mu h) @@ -6625,7 +6625,7 @@ theorem loweredInternalYoungWeight_appendZeroWeight_castSucc not_false_eq_true, Function.update_of_ne, h] /-- The retained padded pieri signed node used in the spherical-code argument. -/ -def retainedPaddedPieriSignedNode {r : ℕ} +@[expose] def retainedPaddedPieriSignedNode {r : ℕ} (lam : Fin (r + 1) → ℕ) : {i : PaddedPieriChannel (appendZeroWeight lam) // retainedPaddedPieriChannel lam i} → Fin (r + 1) × Bool @@ -6845,7 +6845,7 @@ namespace HigherYoungAllRankGTArrowheadSchurComplement open MetricCodes.Spherical.HigherChannel /-- The gt stabilizer arrowhead node used in the spherical-code argument. -/ -def gtStabilizerArrowheadNode {r : ℕ} (rho : ℝ) (M : Fin r → ℝ) : +@[expose] def gtStabilizerArrowheadNode {r : ℕ} (rho : ℝ) (M : Fin r → ℝ) : Unit ⊕ (Fin r × Bool) → ℝ | .inl _ => -rho | .inr (m, true) => M m - 1 / 2 @@ -6862,7 +6862,7 @@ def gtStabilizerArrowheadNode {r : ℕ} (rho : ℝ) (M : Fin r → ℝ) : -M m - 1 / 2 := rfl /-- The gt stabilizer arrowhead minor used in the spherical-code argument. -/ -def gtStabilizerArrowheadMinor {r : ℕ} +@[expose] def gtStabilizerArrowheadMinor {r : ℕ} (rho : ℝ) (M : Fin r → ℝ) : Polynomial ℝ := Lagrange.nodal (Finset.univ : Finset (Unit ⊕ (Fin r × Bool))) diff --git a/LeanPool/MetricCodes/Weyl.lean b/LeanPool/MetricCodes/Weyl.lean index 53e6dd79ad..945e743d4a 100644 --- a/LeanPool/MetricCodes/Weyl.lean +++ b/LeanPool/MetricCodes/Weyl.lean @@ -13,7 +13,7 @@ public import LeanPool.MetricCodes.RootComplex Euler groupings, orthogonal denominator formulas, and all-rank Weyl evaluations. -/ -@[expose] public section +public section noncomputable section MetricCodesNoncomputable @@ -1055,13 +1055,13 @@ open scoped BigOperators namespace HigherWeylBinomialDeterminant /-- The orthogonal complete symmetric coefficient used in the spherical-code argument. -/ -def orthogonalCompleteSymmetricCoefficient (n : ℕ) (k : ℤ) : ℤ := +@[expose] def orthogonalCompleteSymmetricCoefficient (n : ℕ) (k : ℤ) : ℤ := if 0 ≤ k then (((n + k.toNat - 1).choose k.toNat : ℕ) : ℤ) else 0 /-- The orthogonal jacobi trudi matrix used in the spherical-code argument. -/ -def orthogonalJacobiTrudiMatrix {r : ℕ} (n : ℕ) +@[expose] def orthogonalJacobiTrudiMatrix {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : Matrix (Fin (r + 1)) (Fin (r + 1)) ℤ := fun i j => @@ -1071,7 +1071,7 @@ def orthogonalJacobiTrudiMatrix {r : ℕ} (n : ℕ) ((lam i : ℤ) - (i.val : ℤ) - (j.val : ℤ) - 2) /-- The orthogonal jacobi trudi dimension used in the spherical-code argument. -/ -def orthogonalJacobiTrudiDimension {r : ℕ} (n : ℕ) +@[expose] def orthogonalJacobiTrudiDimension {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) : ℤ := (orthogonalJacobiTrudiMatrix n lam).det @@ -3160,7 +3160,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung open MetricCodes.Spherical.HigherHarmonicYoung.BGGRootComplex /-- The positive root upper operator used in the spherical-code argument. -/ -def positiveRootUpperOperator {r : ℕ} (n : ℕ) (α : PositiveRoot r) : +@[expose] def positiveRootUpperOperator {r : ℕ} (n : ℕ) (α : PositiveRoot r) : PolynomialSpace r n →ₗ[ℝ] PolynomialSpace r n := polarization r n (positiveRootFirst α) (positiveRootSecond α) @@ -4823,7 +4823,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The root swap exterior hodge sign used in the spherical-code argument. -/ -def rootSwapExteriorHodgeSign {r k : ℕ} +@[expose] def rootSwapExteriorHodgeSign {r k : ℕ} {lam : Fin (r + 1) → ℕ} (S : AdmissibleRootWedge lam k) (α β : PositiveRoot r) : ℝ := @@ -4881,7 +4881,7 @@ def rootJointHarmonicActionLowerRootStructureCross {r : ℕ} else 0 /-- The root joint harmonic action hodge off diagonal used in the spherical-code argument. -/ -def rootJointHarmonicActionHodgeOffDiagonal {r : ℕ} +@[expose] def rootJointHarmonicActionHodgeOffDiagonal {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam k →ₗ[ℝ] RootJointHarmonicChain n lam k := @@ -5261,7 +5261,7 @@ section open MetricCodes.Spherical.HigherHarmonicYoung /-- The root joint harmonic polynomial inclusion used in the spherical-code argument. -/ -def rootJointHarmonicPolynomialInclusion {r : ℕ} +@[expose] def rootJointHarmonicPolynomialInclusion {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam k →ₗ[ℝ] RootPolynomialChain r n k where @@ -7023,7 +7023,7 @@ theorem actualExteriorRootContraction_creation_contraction_contraction_anticommu split_ifs <;> simp /-- The actual exterior root bracket coboundary used in the spherical-code argument. -/ -def actualExteriorRootBracketCoboundary [Fintype ι] +@[expose] def actualExteriorRootBracketCoboundary [Fintype ι] (structureConstant : ι → ι → ι → ℝ) : Module.End ℝ (Finset ι → M) := ∑ b : ι, ∑ c : ι, ∑ d : ι, @@ -7160,18 +7160,18 @@ theorem actualExteriorRootContraction_mul_self_zero simp [actualExteriorRootContraction_apply, h] /-- The full root exterior action atom used in the spherical-code argument. -/ -def fullRootExteriorActionAtom (r n : ℕ) (α : PositiveRoot r) : +@[expose] def fullRootExteriorActionAtom (r n : ℕ) (α : PositiveRoot r) : Module.End ℝ (FullRootExteriorPolynomialChain r n) := fullRootExteriorPolynomialAction r n α * actualExteriorRootContraction (PolynomialSpace r n) α /-- The full root exterior action used in the spherical-code argument. -/ -def fullRootExteriorAction (r n : ℕ) : +@[expose] def fullRootExteriorAction (r n : ℕ) : Module.End ℝ (FullRootExteriorPolynomialChain r n) := ∑ α : PositiveRoot r, fullRootExteriorActionAtom r n α /-- The full root exterior bracket atom used in the spherical-code argument. -/ -def fullRootExteriorBracketAtom (r n : ℕ) +@[expose] def fullRootExteriorBracketAtom (r n : ℕ) (α β γ : PositiveRoot r) : Module.End ℝ (FullRootExteriorPolynomialChain r n) := actualExteriorRootCreation (PolynomialSpace r n) γ * @@ -7179,7 +7179,7 @@ def fullRootExteriorBracketAtom (r n : ℕ) actualExteriorRootContraction (PolynomialSpace r n) α) /-- The full root exterior bracket used in the spherical-code argument. -/ -def fullRootExteriorBracket (r n : ℕ) : +@[expose] def fullRootExteriorBracket (r n : ℕ) : Module.End ℝ (FullRootExteriorPolynomialChain r n) := by classical exact ∑ α : PositiveRoot r, ∑ β : PositiveRoot r, @@ -7909,7 +7909,7 @@ theorem rootStructureConstant_coboundaryIncidence_swap (actualExteriorRootCreation M b * actualExteriorRootContraction M d) /-- The actual ordered root bracket coboundary used in the spherical-code argument. -/ -def actualOrderedRootBracketCoboundary {r : ℕ} : +@[expose] def actualOrderedRootBracketCoboundary {r : ℕ} : Module.End ℝ (Finset (PositiveRoot r) → M) := ((2 : ℝ)⁻¹) • actualExteriorRootBracketCoboundary (M := M) @@ -7958,7 +7958,7 @@ open scoped BigOperators open MetricCodes.Spherical.HigherHarmonicYoung /-- The root joint harmonic bracket action mixed used in the spherical-code argument. -/ -def rootJointHarmonicBracketActionMixed {r : ℕ} +@[expose] def rootJointHarmonicBracketActionMixed {r : ℕ} (n : ℕ) (lam : Fin (r + 1) → ℕ) (k : ℕ) : RootJointHarmonicChain n lam (k + 1) →ₗ[ℝ] RootJointHarmonicChain n lam (k + 1) := @@ -8096,7 +8096,7 @@ theorem fullRootExteriorPolynomialAction_orderedBracketCoboundary_commute _ = _ := by noncomm_ring /-- The full root exterior lower root structure incidence used in the spherical-code argument. -/ -def fullRootExteriorLowerRootStructureIncidence (r n : ℕ) : +@[expose] def fullRootExteriorLowerRootStructureIncidence (r n : ℕ) : Module.End ℝ (FullRootExteriorPolynomialChain r n) := ∑ α : PositiveRoot r, ∑ β : PositiveRoot r, ∑ γ : PositiveRoot r, rootStructureConstant γ α β • diff --git a/LeanPool/MinModulusUniqueMultisetSum.lean b/LeanPool/MinModulusUniqueMultisetSum.lean index 6493e667f6..8e84304b09 100644 --- a/LeanPool/MinModulusUniqueMultisetSum.lean +++ b/LeanPool/MinModulusUniqueMultisetSum.lean @@ -27,4 +27,4 @@ Tags: additive-combinatorics, multiset-sums, finite-groups, permanent MSC: 11B75, 05D99 -/ -@[expose] public section +public section diff --git a/LeanPool/MinModulusUniqueMultisetSum/ElemAbelian2.lean b/LeanPool/MinModulusUniqueMultisetSum/ElemAbelian2.lean index aa3e1c19fb..b63baf2b61 100644 --- a/LeanPool/MinModulusUniqueMultisetSum/ElemAbelian2.lean +++ b/LeanPool/MinModulusUniqueMultisetSum/ElemAbelian2.lean @@ -20,7 +20,7 @@ the all-ones multiset — then `n - 1 ≤ k` the elementary-abelian case of the minimum-modulus problem. -/ -@[expose] public section +public section namespace MinModulus diff --git a/LeanPool/MinModulusUniqueMultisetSum/UniqueSums.lean b/LeanPool/MinModulusUniqueMultisetSum/UniqueSums.lean index 8d654507dd..8807d8993d 100644 --- a/LeanPool/MinModulusUniqueMultisetSum/UniqueSums.lean +++ b/LeanPool/MinModulusUniqueMultisetSum/UniqueSums.lean @@ -44,7 +44,7 @@ Contents: no axioms beyond propext / Classical.choice / Quot.sound** -/ -@[expose] public section +public section namespace MinModulus diff --git a/LeanPool/MinimumDegreeMatching/BKLO.lean b/LeanPool/MinimumDegreeMatching/BKLO.lean index 1e8e248bd6..b2b33cc61c 100644 --- a/LeanPool/MinimumDegreeMatching/BKLO.lean +++ b/LeanPool/MinimumDegreeMatching/BKLO.lean @@ -23,7 +23,7 @@ greedy process. The formal proof instead uses the deterministic pessimistic-esti `BKLOSelection`. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/MinimumDegreeMatching/BKLOInfrastructure.lean b/LeanPool/MinimumDegreeMatching/BKLOInfrastructure.lean index fd1343c9cb..0e17ef6f2d 100644 --- a/LeanPool/MinimumDegreeMatching/BKLOInfrastructure.lean +++ b/LeanPool/MinimumDegreeMatching/BKLOInfrastructure.lean @@ -16,7 +16,7 @@ matching theorem. It is extracted from the independently frozen Paper III develo separate from the theorem-facing API. -/ -@[expose] public section +public section open Finset @@ -36,7 +36,7 @@ theorem mem_cliqueEdgesV {t : Finset V} {e : Sym2 V} : /-- The number of edges of `E` at `v`. -/ -def edeg (E : Finset (Sym2 V)) (v : V) : ℕ := (E.filter (fun e => v ∈ e)).card +@[expose] def edeg (E : Finset (Sym2 V)) (v : V) : ℕ := (E.filter (fun e => v ∈ e)).card /-- `N_E(x, S)`: the neighbours of `x` inside `S`. -/ @@ -44,7 +44,7 @@ def nbhdIn (E : Finset (Sym2 V)) (x : V) (S : Finset V) : Finset V := S.filter (fun y => s(x, y) ∈ E) /-- `d_E(x, S) = |N_E(x, S)|`. -/ -def degTo (E : Finset (Sym2 V)) (x : V) (S : Finset V) : ℕ := (nbhdIn E x S).card +@[expose] def degTo (E : Finset (Sym2 V)) (x : V) (S : Finset V) : ℕ := (nbhdIn E x S).card theorem mem_nbhdIn {E : Finset (Sym2 V)} {x y : V} {S : Finset V} : y ∈ nbhdIn E x S ↔ y ∈ S ∧ s(x, y) ∈ E := by @@ -56,7 +56,7 @@ theorem nbhdIn_subset (E : Finset (Sym2 V)) (x : V) (S : Finset V) : nbhdIn E x /-- `E[S]`: the edges of `E` with both ends in `S`. -/ -def edgesIn (E : Finset (Sym2 V)) (S : Finset V) : Finset (Sym2 V) := +@[expose] def edgesIn (E : Finset (Sym2 V)) (S : Finset V) : Finset (Sym2 V) := E.filter (fun e => e ∈ S.sym2) /-- `E[S, T]`: the edges of `E` with one end in `S` and the other in `T`. -/ @@ -89,12 +89,12 @@ theorem edgesIn_subset (E : Finset (Sym2 V)) (S : Finset V) : edgesIn E S ⊆ E /-- `d_E({x,y}, W) = |N_E(x,W) ∩ N_E(y,W)|`, the codegree of the pair `x, y` inside `W`. -/ -def codegTo (E : Finset (Sym2 V)) (x y : V) (W : Finset V) : ℕ := +@[expose] def codegTo (E : Finset (Sym2 V)) (x y : V) (W : Finset V) : ℕ := (nbhdIn E x W ∩ nbhdIn E y W).card /-- The edges of a triangle family. -/ -def famEdges (P : Finset (Finset V)) : Finset (Sym2 V) := P.biUnion cliqueEdges +@[expose] def famEdges (P : Finset (Finset V)) : Finset (Sym2 V) := P.biUnion cliqueEdges /-- A `Finset (Finset V)` is a **matching** avoiding `x`: every member is a `2`-element set, the diff --git a/LeanPool/MinimumDegreeMatching/BKLOSelection.lean b/LeanPool/MinimumDegreeMatching/BKLOSelection.lean index e90e6165b0..9d7d91719a 100644 --- a/LeanPool/MinimumDegreeMatching/BKLOSelection.lean +++ b/LeanPool/MinimumDegreeMatching/BKLOSelection.lean @@ -23,7 +23,7 @@ keeping all previously selected matching edges disjoint. This is the determinist the `r = 2` specialization of BKLO Lemma 10.7. -/ -@[expose] public section +public section open Finset @@ -34,10 +34,11 @@ variable {V : Type*} [DecidableEq V] /-- The number of edges of the used set `F` at `y` lying inside the apex neighbourhood `N_H(x,W)`. This is exactly the amount by which the Dirac degree of `y` in `H[N_H(x,W)]` has been eroded. -/ -def usedCnt (H : Finset (Sym2 V)) (W : Finset V) (F : Finset (Sym2 V)) (x y : V) : ℕ := +@[expose] def usedCnt (H : Finset (Sym2 V)) (W : Finset V) (F : Finset (Sym2 V)) (x y : V) : ℕ := edeg (edgesIn F (nbhdIn H x W)) y /-- **The pessimistic-estimator potential.** `R` is the set of apices not yet processed. -/ +@[expose] noncomputable def pot (H : Finset (Sym2 V)) (W : Finset V) (q : ℝ) (F : Finset (Sym2 V)) (R : Finset V) : ℝ := ∑ x ∈ R, ∑ y ∈ nbhdIn H x W, (2 : ℝ) ^ (usedCnt H W F x y) * (1 + q) ^ (degTo H y R) diff --git a/LeanPool/MinimumDegreeMatching/Basic.lean b/LeanPool/MinimumDegreeMatching/Basic.lean index 83c9e77bf8..738be88f06 100644 --- a/LeanPool/MinimumDegreeMatching/Basic.lean +++ b/LeanPool/MinimumDegreeMatching/Basic.lean @@ -30,7 +30,7 @@ reduced to it by adjoining a universal apex vertex and deleting that vertex from perfect matching. Both public formulations therefore share one proof of the degree criterion. -/ -@[expose] public section +public section namespace SimpleGraph diff --git a/LeanPool/MinimumDegreeMatching/Spread.lean b/LeanPool/MinimumDegreeMatching/Spread.lean index c00a31c09b..9682ecd22a 100644 --- a/LeanPool/MinimumDegreeMatching/Spread.lean +++ b/LeanPool/MinimumDegreeMatching/Spread.lean @@ -48,7 +48,7 @@ the matching could be augmented), so the partner involution injects the neighbou the complement of the neighbourhood of `v`, contradicting the degree hypothesis. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Monlib4.lean b/LeanPool/Monlib4.lean index b0579bf293..445e86777f 100644 --- a/LeanPool/Monlib4.lean +++ b/LeanPool/Monlib4.lean @@ -31,7 +31,7 @@ Tags: linear-algebra, operator-algebras, quantum-sets, quantum-graphs, represent MSC: 15A69, 16W20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Monlib4/LinearAlgebra.lean b/LeanPool/Monlib4/LinearAlgebra.lean index 0602b591dd..b17c8a49c2 100644 --- a/LeanPool/Monlib4/LinearAlgebra.lean +++ b/LeanPool/Monlib4/LinearAlgebra.lean @@ -35,4 +35,4 @@ public import LeanPool.Monlib4.LinearAlgebra.ToMatrixOfEquiv Import-only index for the `LinearAlgebra` directory of the monlib4 import. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/LinearAlgebra/Coalgebra.lean b/LeanPool/Monlib4/LinearAlgebra/Coalgebra.lean index 913e8bd2e3..94d2b9bae2 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Coalgebra.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Coalgebra.lean @@ -17,4 +17,4 @@ Import-only index for the `LinearAlgebra/Coalgebra` directory of the monlib4 import. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean index 684c1ca5f0..4de0429b51 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.Coalgebra.FiniteDimensional`. -/ -@[expose] public section +public section variable {R A : Type*} local notation "lT" => LinearMap.lTensor @@ -36,8 +36,9 @@ open scoped TensorProduct lemma algebraMapCLM_eq_ket_one {R A : Type*} [RCLike R] [NormedAddCommGroupOfRing A] [InnerProductSpace R A] [SMulCommClass R A A] [IsScalarTower R A A] : - algebraMapCLM R A = ket R 1 := -rfl + algebraMapCLM R A = ket R 1 := by + ext + simp only [algebraMapCLM_apply, ket_apply_apply, Algebra.smul_def, mul_one] lemma algebraMapCLM_adjoint_eq_bra_one {R A : Type*} [RCLike R] [NormedAddCommGroupOfRing A] [InnerProductSpace R A] [SMulCommClass R A A] [IsScalarTower R A A] [CompleteSpace A] : @@ -75,7 +76,7 @@ lemma TensorProduct.rid_adjoint {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGro (fun z w hz hw => by simp only [_root_.map_add, inner_add_right, hz, hw]) -@[reducible, instance] +@[reducible, instance, expose] noncomputable def Coalgebra.ofFiniteDimensionalHilbertAlgebra [RCLike R] [NormedAddCommGroupOfRing A] [InnerProductSpace R A] @@ -106,13 +107,13 @@ lemma Coalgebra.comul_eq_mul_adjoint Coalgebra.comul = (LinearMap.adjoint (LinearMap.mul' R A : (A ⊗[R] A) →ₗ[R] A) : A →ₗ[R] A ⊗[R] A) := -rfl +by rfl -- open scoped ofFiniteDimensionalHilbertAlgebra in lemma Coalgebra.counit_eq_unit_adjoint [RCLike R] [NormedAddCommGroupOfRing A] [InnerProductSpace R A] [SMulCommClass R A A] [IsScalarTower R A A] [FiniteDimensional R A] : Coalgebra.counit = (LinearMap.adjoint (Algebra.linearMap R A : R →ₗ[R] A) : A →ₗ[R] R) := -rfl +by rfl open scoped InnerProductSpace -- open scoped ofFiniteDimensionalHilbertAlgebra in @@ -186,8 +187,7 @@ theorem Coalgebra.lTensor_mul_comp_rTensor_mul_adjoint_of Coalgebra.lTensor_mul_comp_rTensor_comul_of h /-- Construct the Frobenius algebra structure from finite-dimensional Hilbert-algebra data. -/ -@[reducible] -noncomputable def FiniteDimensionalCoAlgebraIsFrobeniusAlgebraOf +@[reducible, expose] noncomputable def FiniteDimensionalCoAlgebraIsFrobeniusAlgebraOf [RCLike R] [NormedAddCommGroupOfRing A] [InnerProductSpace R A] [SMulCommClass R A A] [IsScalarTower R A A] [FiniteDimensional R A] (h : ∃ σ : A → A, ∀ x y z : A, ⟪x * y, z⟫_R = ⟪y, σ x * z⟫_R) : diff --git a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/Lemmas.lean b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/Lemmas.lean index ef70b71810..abfa34be6e 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/Lemmas.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/Lemmas.lean @@ -15,7 +15,7 @@ import Mathlib.RingTheory.Coalgebra.CoassocSimps Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.Coalgebra.Lemmas`. -/ -@[expose] public section +public section theorem TensorProduct.map_left_up {R A B C D : Type*} [CommSemiring R] diff --git a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/MulOpposite.lean b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/MulOpposite.lean index b283c23e37..0d93ab4d90 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/MulOpposite.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/MulOpposite.lean @@ -17,7 +17,7 @@ import Mathlib.RingTheory.Coalgebra.CoassocSimps Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.Coalgebra.MulOpposite`. -/ -@[expose] public section +public section open scoped TensorProduct @@ -40,7 +40,7 @@ lemma TensorProduct.opLinearEquiv_tmul (x : A) (y : B) : opLinearEquiv (MulOpposite.op (x ⊗ₜ[R] y)) = MulOpposite.op x ⊗ₜ[R] MulOpposite.op y := -rfl +by rfl @[simp] lemma TensorProduct.opLinearEquiv_symm_tmul {R A B : Type*} [CommSemiring R] @@ -49,7 +49,7 @@ lemma TensorProduct.opLinearEquiv_symm_tmul (x : Aᵐᵒᵖ) (y : Bᵐᵒᵖ) : opLinearEquiv.symm (x ⊗ₜ[R] y) = MulOpposite.op (x.unop ⊗ₜ[R] y.unop) := -rfl +by rfl noncomputable instance MulOpposite.coalgebraStruct {R A : Type*} [CommSemiring R] @@ -74,7 +74,7 @@ lemma MulOpposite.comul_def' (TensorProduct.map (MulOpposite.opLinearEquiv R).toLinearMap (MulOpposite.opLinearEquiv R).toLinearMap) ∘ₗ CoalgebraStruct.comul ∘ₗ (MulOpposite.opLinearEquiv R).symm.toLinearMap := -rfl +by rfl lemma MulOpposite.counit_def {R A : Type*} [CommSemiring R] [AddCommMonoid A] [Module R A] diff --git a/LeanPool/Monlib4/LinearAlgebra/DirectSumFromTo.lean b/LeanPool/Monlib4/LinearAlgebra/DirectSumFromTo.lean index aa6e5aa38d..3e09cee981 100644 --- a/LeanPool/Monlib4/LinearAlgebra/DirectSumFromTo.lean +++ b/LeanPool/Monlib4/LinearAlgebra/DirectSumFromTo.lean @@ -17,11 +17,12 @@ import Mathlib.Tactic.NormNum.Basic -/ -@[expose] public section +public section /-- Composition of the `i`-th injection and the `j`-th projection of a dependent direct sum, giving a linear map `M₁ i →ₗ[R] M₁ j`. -/ +@[expose] def directSumFromTo {R : Type*} [Semiring R] {ι₁ : Type*} [DecidableEq ι₁] {M₁ : ι₁ → Type*} [∀ i₁ : ι₁, AddCommGroup (M₁ i₁)] [∀ i₁ : ι₁, Module R (M₁ i₁)] (i j : ι₁) : M₁ i →ₗ[R] M₁ j := LinearMap.proj j ∘ₗ LinearMap.single _ _ i diff --git a/LeanPool/Monlib4/LinearAlgebra/End.lean b/LeanPool/Monlib4/LinearAlgebra/End.lean index d59a712fc5..4e68c64130 100644 --- a/LeanPool/Monlib4/LinearAlgebra/End.lean +++ b/LeanPool/Monlib4/LinearAlgebra/End.lean @@ -13,7 +13,7 @@ public import Mathlib.LinearAlgebra.Eigenspace.Basic This file contains some obvious lemmas on `module.End`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Monlib4/LinearAlgebra/InnerAut.lean b/LeanPool/Monlib4/LinearAlgebra/InnerAut.lean index 348a6a176a..fd2695bd14 100644 --- a/LeanPool/Monlib4/LinearAlgebra/InnerAut.lean +++ b/LeanPool/Monlib4/LinearAlgebra/InnerAut.lean @@ -24,7 +24,7 @@ names for the matrix-algebra specialization and its trace, spectrum, and Hermitian-preservation lemmas. -/ -@[expose] public section +public section open scoped ComplexOrder @@ -682,8 +682,7 @@ def _root_.Matrix.unitaryGroup.conj [Fintype n] [DecidableEq n] @[norm_cast] theorem _root_.Matrix.unitaryGroup.conj_coe [Fintype n] [DecidableEq n] (U : unitaryGroup n 𝕜) : - (unitaryGroup.conj U : Matrix n n 𝕜) = (U : Matrix n n 𝕜)ᴴᵀ := - rfl + (unitaryGroup.conj U : Matrix n n 𝕜) = (U : Matrix n n 𝕜)ᴴᵀ := by rfl theorem _root_.Matrix.innerAut.conj [Fintype n] [DecidableEq n] (U : unitaryGroup n 𝕜) (x : Matrix n n 𝕜) : @@ -714,8 +713,7 @@ def _root_.Matrix.unitaryGroup.kronecker [Fintype n] [DecidableEq n] theorem _root_.Matrix.unitaryGroup.kronecker_coe [Fintype n] [DecidableEq n] [Fintype p] [DecidableEq p] (U₁ : unitaryGroup n 𝕜) (U₂ : unitaryGroup p 𝕜) : (unitaryGroup.kronecker U₁ U₂ : Matrix (n × p) (n × p) 𝕜) = - (U₁ : Matrix n n 𝕜) ⊗ₖ (U₂ : Matrix p p 𝕜) := - rfl + (U₁ : Matrix n n 𝕜) ⊗ₖ (U₂ : Matrix p p 𝕜) := by rfl theorem _root_.Matrix.innerAut_kronecker [Fintype n] [DecidableEq n] [Fintype p] [DecidableEq p] (U₁ : unitaryGroup n 𝕜) (U₂ : unitaryGroup p 𝕜) diff --git a/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean b/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean index 9d792a0efa..7d22a99135 100644 --- a/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean +++ b/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Continuity.Init This file defines and proves basic results on invariant submodules. -/ -@[expose] public section +public section namespace Submodule diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips.lean b/LeanPool/Monlib4/LinearAlgebra/Ips.lean index 323e4b490f..492452957e 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips.lean @@ -27,4 +27,4 @@ public import LeanPool.Monlib4.LinearAlgebra.Ips.Vn Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.Ips`. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Basic.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Basic.lean index 4f5f6d7967..86a343e34b 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Basic.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Basic.lean @@ -17,7 +17,7 @@ This files provides some useful and obvious results for linear maps and continuo -/ -@[expose] public section +public section theorem _root_.ext_inner_left_iff {𝕜 E : Type _} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] (x y : E) : diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Frob.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Frob.lean index ed64f19d7c..c95901df8f 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Frob.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Frob.lean @@ -20,7 +20,7 @@ import LeanPool.Monlib4.Preq.Ites This file contains the proof of the Frobenius equations. -/ -@[expose] public section +public section variable {n p : Type _} [Fintype n] [Fintype p] [DecidableEq n] [DecidableEq p] @@ -34,6 +34,7 @@ open scoped Matrix Kronecker TensorProduct BigOperators Functional InnerProductS open Matrix /-- Tensor product of two matrix-valued module dual functionals. -/ +@[expose] noncomputable def Module.Dual.tensorMul {n p : Type _} (φ₁ : Module.Dual ℂ (Matrix n n ℂ)) (φ₂ : Module.Dual ℂ (Matrix p p ℂ)) : Module.Dual ℂ (Matrix n n ℂ ⊗[ℂ] Matrix p p ℂ) := (TensorProduct.lid ℂ ℂ : ℂ ⊗[ℂ] ℂ →ₗ[ℂ] ℂ) ∘ₗ TensorProduct.map φ₁ φ₂ diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Functional.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Functional.lean index 289d655cd5..d820c48e92 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Functional.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Functional.lean @@ -27,7 +27,7 @@ This file contains results for linear functionals on the set of $n \times n$ mat -/ -@[expose] public section +public section open scoped Matrix BigOperators @@ -89,8 +89,7 @@ theorem Module.Dual.apply (φ : Module.Dual R (Matrix n n R)) (a : Matrix n n R) /-- we linear maps `φ_i : M_[n_i] →ₗ[R] R`, we define its direct sum as the linear map `(Π i, M_[n_i]) →ₗ[R] R`. -/ -@[simps] -def Module.Dual.pi {k : Type _} [Fintype k] {s : k → Type _} +@[expose] def Module.Dual.pi {k : Type _} [Fintype k] {s : k → Type _} (φ : ∀ i, Module.Dual R (Matrix (s i) (s i) R)) : Module.Dual R (PiMat R k s) where toFun a := ∑ i : k, φ i (a i) @@ -98,13 +97,20 @@ def Module.Dual.pi {k : Type _} [Fintype k] {s : k → Type _} map_smul' r x := by simp only [_root_.map_smul, Pi.smul_apply, Finset.smul_sum, RingHom.id_apply] +@[simp] theorem Module.Dual.pi_apply {k : Type _} [Fintype k] {s : k → Type _} + (φ : ∀ i, Module.Dual R (Matrix (s i) (s i) R)) (a : PiMat R k s) : + Module.Dual.pi φ a = ∑ i : k, φ i (a i) := by rfl + /-- Restrict a linear functional on a product of matrix algebras to each block. -/ -@[simps!] def Module.Dual.piOf {k : Type _} [DecidableEq k] {s : k → Type _} (φ : Module.Dual R (PiMat R k s)) : Π i, Module.Dual R (Matrix (s i) (s i) R) := fun _ => φ ∘ₗ includeBlock +@[simp] theorem Module.Dual.piOf_apply {k : Type _} [DecidableEq k] {s : k → Type _} + (φ : Module.Dual R (PiMat R k s)) (i : k) (x : Matrix (s i) (s i) R) : + Module.Dual.piOf φ i x = φ (includeBlock x) := by rfl + /-- for direct sums, we get `φ x = ∑ i, ((φ i).matrix ⬝ x i).trace` -/ theorem Module.Dual.pi.apply {k : Type _} [Fintype k] {s : k → Type _} [∀ i, Fintype (s i)] [∀ i, DecidableEq (s i)] (φ : ∀ i, Module.Dual R (Matrix (s i) (s i) R)) @@ -236,6 +242,7 @@ open scoped ComplexOrder open scoped DirectSum /-- A linear functional $φ$ on $M_n$ is positive if $0 ≤ φ (x^*x)$ for all $x \in M_n$. -/ +@[expose] def Module.Dual.IsPosMap {A : Type _} [NonUnitalSemiring A] [StarRing A] [Module 𝕜 A] (φ : Module.Dual 𝕜 A) : Prop := ∀ a : A, 0 ≤ φ (star a * a) @@ -289,6 +296,7 @@ lemma Module.Dual.pi_isPosMap_iff {k : Type _} [Fintype k] simp_rw [← eq_piOf_pi] /-- A linear functional $φ$ on $M_n$ is unital if $φ(1) = 1$. -/ +@[expose] def Module.Dual.IsUnital {A : Type _} [AddCommMonoid A] [Module R A] [One A] (φ : Module.Dual R A) : Prop := φ (1 : A) = 1 @@ -313,7 +321,7 @@ theorem Module.Dual.isPosMap_of_matrix (φ : Module.Dual 𝕜 (Matrix n n 𝕜)) /-- A linear functional $f$ on $M_n$ is said to be faithful if $f(x^*x)=0$ if and only if $x=0$ for any $x \in M_n$. -/ -def Module.Dual.IsFaithful {A : Type _} [NonUnitalSemiring A] [StarRing A] [Module 𝕜 A] +@[expose] def Module.Dual.IsFaithful {A : Type _} [NonUnitalSemiring A] [StarRing A] [Module 𝕜 A] (φ : Module.Dual 𝕜 A) : Prop := ∀ a : A, φ (star a * a) = 0 ↔ a = 0 @@ -474,6 +482,7 @@ theorem Module.Dual.isFaithful_state_iff_of_matrix (φ : Module.Dual ℂ (Matrix exact hQ.1.2 /-- A linear functional $f$ is tracial if and only if $f(xy)=f(yx)$ for all $x,y$. -/ +@[expose] def Module.Dual.IsTracial {A : Type _} [NonUnitalSemiring A] [Module 𝕜 A] (φ : Module.Dual 𝕜 A) : Prop := ∀ x y : A, φ (x * y) = φ (y * x) @@ -627,7 +636,7 @@ theorem Module.Dual.pi.IsPosMap.isReal {k : Type _} [Fintype k] {s : k → Type forall_true_iff] /-- A function $H \times H \to 𝕜$ defines an inner product if it satisfies the following. -/ -def IsInner {H : Type _} [AddCommMonoid H] [Module 𝕜 H] (φ : H × H → 𝕜) : Prop := +@[expose] def IsInner {H : Type _} [AddCommMonoid H] [Module 𝕜 H] (φ : H × H → 𝕜) : Prop := (∀ x y : H, φ (x, y) = star (φ (y, x))) ∧ (∀ x : H, 0 ≤ RCLike.re (φ (x, x))) ∧ (∀ x : H, φ (x, x) = 0 ↔ x = 0) ∧ @@ -680,7 +689,7 @@ section variable {n : Type _} [Fintype n] [DecidableEq n] (φ : Module.Dual ℂ (Matrix n n ℂ)) /-- The normed additive group structure induced by a faithful positive functional on matrices. -/ -@[reducible] +@[expose, reducible] noncomputable def Module.Dual.NormedAddCommGroup [hφ : φ.IsFaithfulPosMap] : _root_.NormedAddCommGroup (Matrix n n ℂ) := @InnerProductSpace.Core.toNormedAddCommGroup ℂ (Matrix n n ℂ) _ _ _ @@ -697,7 +706,7 @@ variable [hφ : φ.IsFaithfulPosMap] /-- The inner product space structure induced by a faithful positive functional on matrices. -/ -@[reducible] +@[expose, reducible] noncomputable def Module.Dual.InnerProductSpace : @_root_.InnerProductSpace ℂ (Matrix n n ℂ) _ ((Module.Dual.NormedAddCommGroup φ).toSeminormedAddCommGroup) := by @@ -715,7 +724,7 @@ variable {k : Type _} [Fintype k] {s : k → Type _} [Π i, Fintype (s i)] [Π i, DecidableEq (s i)] /-- The finite product inner-product core induced by faithful positive matrix functionals. -/ -@[reducible] +@[expose, reducible] noncomputable def Module.Dual.PiInnerProductCore {φ : Π i, Module.Dual ℂ (Matrix (s i) (s i) ℂ)} [hφ : Π i, (φ i).IsFaithfulPosMap] : @@ -757,15 +766,14 @@ noncomputable def Module.Dual.PiInnerProductCore /-- The normed additive group on a finite product induced by faithful positive matrix functionals. -/ -@[reducible] -noncomputable def Module.Dual.PiNormedAddCommGroup +@[expose, reducible] noncomputable def Module.Dual.PiNormedAddCommGroup {φ : Π i, Module.Dual ℂ (Matrix (s i) (s i) ℂ)} [_hφ : Π i, (φ i).IsFaithfulPosMap] : _root_.NormedAddCommGroup (PiMat ℂ k s) := (Module.Dual.PiInnerProductCore (φ := φ)).toNormedAddCommGroup /-- The inner product space on a finite product induced by faithful positive matrix functionals. -/ -@[reducible] +@[expose, reducible] noncomputable def Module.Dual.pi.InnerProductSpace {φ : Π i, Module.Dual ℂ (Matrix (s i) (s i) ℂ)} [hφ : Π i, (φ i).IsFaithfulPosMap] : @@ -776,6 +784,7 @@ noncomputable def Module.Dual.pi.InnerProductSpace Module.Dual.PiNormedAddCommGroup (_hφ := hφ) letI : InnerProductSpace.Core ℂ (PiMat ℂ k s) := Module.Dual.PiInnerProductCore (φ := φ) - exact InnerProductSpace.ofCore _ + exact InnerProductSpace.ofCore + (inferInstance : PreInnerProductSpace.Core ℂ (PiMat ℂ k s)) scoped[Functional] attribute [instance high] Module.Dual.pi.InnerProductSpace diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Ips.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Ips.lean index 8a42ae7cdb..37e1696314 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Ips.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Ips.lean @@ -23,7 +23,7 @@ and `↥P _` for the extended orthogonal projection `orthogonal_projection' _`. We let $V$ be an inner product space over $\mathbb{k}$. -/ -@[expose] public section +public section variable {V 𝕜 : Type _} [RCLike 𝕜] [NormedAddCommGroup V] [InnerProductSpace 𝕜 V] diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/MatIps.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/MatIps.lean index d8626da812..0701aa881d 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/MatIps.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/MatIps.lean @@ -20,7 +20,7 @@ This file contains some basic results on the inner product space on finite dimen -/ -@[expose] public section +public section open scoped TensorProduct @@ -100,7 +100,7 @@ A lemma that states the inner product of two direct sum matrices is the sum of t of their components. -/ theorem inner_pi_eq_sum [∀ i, (ψ i).IsFaithfulPosMap] (x y : PiMat ℂ k s) : withPiInner[ψ] (⟪x, y⟫_ℂ = ∑ i, ⟪x i, y i⟫_ℂ) := - rfl + by rfl theorem blockDiagonal'_includeBlock_trace' {R k : Type _} [CommSemiring R] [Fintype k] [DecidableEq k] {s : k → Type _} [∀ i, Fintype (s i)] @@ -161,7 +161,7 @@ theorem Module.Dual.pi.apply_eq_of (ψ : ∀ i, Module.Dual ℂ (Matrix (s i) (s simp_rw [ha', ← Module.Dual.pi.apply_single_block, ← Pi.mul_apply, ← blockDiagonal'_includeBlock_trace, ← ha', Pi.mul_apply, ← ha'] simp only [← blockDiagonal'AlgHom_apply, ← _root_.map_mul, a', hMul_includeBlock] at h - exact h + simpa only [blockDiagonal'AlgHom_apply] using h theorem unitary.inj_hMul {A : Type _} [Monoid A] [StarMul A] (U : unitary A) (x y : A) : @@ -188,7 +188,7 @@ open scoped Classical in omit [DecidableEq n] in theorem inner_eq [φ.IsFaithfulPosMap] (x y : Matrix n n ℂ) : withMatrixInner[φ] (⟪x, y⟫_ℂ = φ (xᴴ * y)) := -rfl +by rfl theorem inner_eq' (hφ : φ.IsFaithfulPosMap) (x y : Matrix n n ℂ) : withMatrixInner[φ] (⟪x, y⟫_ℂ = (φ.matrix * xᴴ * y).trace) := by @@ -199,7 +199,7 @@ theorem matrixIsPosDef (hφ : φ.IsFaithfulPosMap) : PosDef φ.matrix := φ.isFaithfulPosMap_iff_of_matrix.mp hφ /-- Modular automorphism associated to a faithful positive functional on matrices. -/ -@[simps] +@[expose] noncomputable def _root_.sig (hφ : φ.IsFaithfulPosMap) (z : ℝ) : Matrix n n ℂ ≃ₐ[ℂ] Matrix n n ℂ where toFun a := hφ.matrixIsPosDef.rpow (-z) * a * hφ.matrixIsPosDef.rpow z @@ -218,8 +218,17 @@ noncomputable def _root_.sig (hφ : φ.IsFaithfulPosMap) (z : ℝ) : simp_rw [Matrix.mul_assoc, ← Matrix.mul_assoc (hφ.matrixIsPosDef.rpow _), PosDef.rpow_mul_rpow, add_neg_cancel, PosDef.rpow_zero, Matrix.one_mul] +@[simp] theorem _root_.sig_apply (hφ : φ.IsFaithfulPosMap) (z : ℝ) (a : Matrix n n ℂ) : + (_root_.sig hφ z) a = hφ.matrixIsPosDef.rpow (-z) * a * hφ.matrixIsPosDef.rpow z := + by rfl + +@[simp] theorem _root_.sig_symm_apply (hφ : φ.IsFaithfulPosMap) (z : ℝ) (a : Matrix n n ℂ) : + (_root_.sig hφ z).symm a = + hφ.matrixIsPosDef.rpow z * a * hφ.matrixIsPosDef.rpow (-z) := + by rfl + /-- The modular automorphism associated to a faithful positive matrix functional. -/ -@[reducible] +@[reducible, expose] noncomputable def sig (hφ : φ.IsFaithfulPosMap) (z : ℝ) : Matrix n n ℂ ≃ₐ[ℂ] Matrix n n ℂ := _root_.sig hφ z @@ -424,6 +433,7 @@ theorem starAlgEquiv_is_isometry_tFAE [hφ : φ.IsFaithfulPosMap] tfae_finish /-- The matrix-unit basis normalized by the square root of the density matrix. -/ +@[expose] protected noncomputable def basis (hφ : φ.IsFaithfulPosMap) : Basis (n × n) ℂ (Matrix n n ℂ) := by let hQ := hφ.matrixIsPosDef refine Basis.mk @@ -477,7 +487,7 @@ protected noncomputable def toMatrixLinEquiv (hφ : φ.IsFaithfulPosMap) (hψ : LinearMap.toMatrix hφ.basis hψ.basis /-- Matrix representation of endomorphisms for a faithful matrix inner product. -/ -protected noncomputable def toMatrix (hφ : φ.IsFaithfulPosMap) : +@[expose] protected noncomputable def toMatrix (hφ : φ.IsFaithfulPosMap) : (Matrix n n ℂ →ₗ[ℂ] Matrix n n ℂ) ≃ₐ[ℂ] Matrix (n × n) (n × n) ℂ := LinearMap.toMatrixAlgEquiv hφ.basis @@ -702,6 +712,7 @@ theorem adjoint_eq [hψ : ∀ i, (ψ i).IsFaithfulPosMap] : rfl /-- The dependent pi basis obtained from the normalized bases of each block. -/ +@[expose] protected noncomputable def basis (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : Basis (Σ i, s i × s i) ℂ (PiMat ℂ k s) := Pi.basis fun i => (hψ i).basis @@ -903,7 +914,7 @@ theorem matrixBlock_self_hMul_inv (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : mul_inv_of_invertible] /-- Matrix representation of maps between two faithful pi inner products. -/ -noncomputable def toMatrixLinEquiv (hψ : ∀ i, (ψ i).IsFaithfulPosMap) +@[expose] noncomputable def toMatrixLinEquiv (hψ : ∀ i, (ψ i).IsFaithfulPosMap) (hφ : ∀ i, (φ i).IsFaithfulPosMap) : ((PiMat ℂ k s) →ₗ[ℂ] (PiMat ℂ k₂ s₂)) ≃ₗ[ℂ] Matrix (Σ i, s₂ i × s₂ i) (Σ i, s i × s i) ℂ := @@ -911,7 +922,7 @@ LinearMap.toMatrix (Module.Dual.pi.IsFaithfulPosMap.basis hψ) (Module.Dual.pi.IsFaithfulPosMap.basis hφ) /-- Matrix representation of endomorphisms for a faithful pi inner product. -/ -noncomputable def toMatrix (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : +@[expose] noncomputable def toMatrix (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : ((PiMat ℂ k s) →ₗ[ℂ] PiMat ℂ k s) ≃ₐ[ℂ] Matrix (Σ i, s i × s i) (Σ i, s i × s i) ℂ := LinearMap.toMatrixAlgEquiv (Module.Dual.pi.IsFaithfulPosMap.basis hψ) @@ -922,8 +933,7 @@ lemma toMatrixLinEquiv_eq_toMatrix (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : rfl /-- Basis for block diagonal matrices induced by the faithful pi basis. -/ -@[simps] -noncomputable def isBlockDiagonalBasis (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : +@[simps, expose] noncomputable def isBlockDiagonalBasis (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : Basis (Σ i, s i × s i) ℂ { x : Matrix (Σ i, s i) (Σ i, s i) ℂ // x.IsBlockDiagonal } where repr := isBlockDiagonalPiAlgEquiv.toLinearEquiv.trans (Module.Dual.pi.IsFaithfulPosMap.basis hψ).repr diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean index 88a6072351..2959ffda24 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean @@ -51,7 +51,7 @@ we finally have (i) if and only if (iv) for idempotent self-adjoint operators on -/ -@[expose] public section +public section open Module.End diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/MulOp.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/MulOp.lean index 015a364d49..76d96f2dbe 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/MulOp.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/MulOp.lean @@ -18,7 +18,7 @@ opposite inner product space. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Nontracial.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Nontracial.lean index e2951662d5..4956cec364 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Nontracial.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Nontracial.lean @@ -26,7 +26,7 @@ This file contains some results on the Hilbert space on finite-dimensional C*-al -/ -@[expose] public section +public section variable {n : Type _} [Fintype n] @@ -183,7 +183,7 @@ theorem Module.Dual.pi.IsFaithfulPosMap.matrixIsPosDef {k : Type _} {s : k → T (hψ : ∀ i, (ψ i).IsFaithfulPosMap) : ∀ i, (ψ i).matrix.PosDef := fun i => (hψ i).matrixIsPosDef /-- Pointwise real powers of a positive-definite element of `PiMat`. -/ -noncomputable def Pi.PosDef.rpow {k : Type _} {s : k → Type _} [∀ i, Fintype (s i)] +@[expose] noncomputable def Pi.PosDef.rpow {k : Type _} {s : k → Type _} [∀ i, Fintype (s i)] [∀ i, DecidableEq (s i)] {a : PiMat ℂ k s} (ha : ∀ i, (a i).PosDef) (r : ℝ) := fun i => (ha i).rpow r @@ -257,6 +257,7 @@ theorem pi_includeBlock_left_rankOne [hψ : ∀ i, (ψ i).IsFaithfulPosMap] rfl /-- The modular automorphism on a direct product of matrix blocks. -/ +@[expose] noncomputable def Module.Dual.pi.IsFaithfulPosMap.sig (hψ : ∀ i, (ψ i).IsFaithfulPosMap) (z : ℝ) : PiMat ℂ k s ≃ₐ[ℂ] PiMat ℂ k s := let hQ := Module.Dual.pi.IsFaithfulPosMap.matrixIsPosDef hψ @@ -558,7 +559,7 @@ theorem Module.Dual.pi.IsFaithfulPosMap.psiToFun'_apply [hψ : ∀ i, (ψ i).IsF /-- Transpose each matrix block of a product as an algebra equivalence to the opposite algebra. -/ -@[simps] +@[simps, expose] def Pi.transposeAlgEquiv (p : Type _) (n : p → Type _) [∀ i, Fintype (n i)] [∀ i, DecidableEq (n i)] : (PiMat ℂ p n) ≃ₐ[ℂ] (PiMat ℂ p n)ᵐᵒᵖ @@ -680,7 +681,7 @@ theorem Module.Dual.pi.IsFaithfulPosMap.Psi_right_inv [hψ : ∀ i, (ψ i).IsFai /-- Linear equivalence between linear maps and tensor products for faithful positive block functionals. -/ -@[simps] +@[simps, expose] noncomputable def Module.Dual.pi.IsFaithfulPosMap.psi (hψ : ∀ i, (ψ i).IsFaithfulPosMap) (hψ₂ : ∀ i, (ψ₂ i).IsFaithfulPosMap) (t r : ℝ) : (PiMat ℂ k s →ₗ[ℂ] PiMat ℂ k₂ s₂) ≃ₗ[ℂ] ((PiMat ℂ k₂ s₂) ⊗[ℂ] (PiMat ℂ k s)ᵐᵒᵖ) := diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/OpUnop.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/OpUnop.lean index 586fc702a0..15eb4ce59d 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/OpUnop.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/OpUnop.lean @@ -19,7 +19,7 @@ swaps the tensor factors while keeping the `ᵒᵖ` in place. -/ -@[expose] public section +public section variable {R A : Type _} [CommSemiring R] [AddCommMonoid A] [Module R A] diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean index 17810134e6..f20d1786ec 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean @@ -28,7 +28,7 @@ for linear maps: -/ -@[expose] public section +public section open InnerProductSpace RCLike @@ -45,6 +45,7 @@ open scoped ComplexOrder /-- `T` is (semi-definite) **positive** if `T` is symmetric and `∀ x : V, 0 ≤ re ⟪x, T x⟫` -/ +@[expose] def IsPositive' (T : E →ₗ[𝕜] E) : Prop := T.IsSymmetric ∧ ∀ x : E, 0 ≤ ⟪x, T x⟫ @@ -194,7 +195,7 @@ noncomputable def rePow section /-- Complex functional calculus power of a positive linear map. -/ -noncomputable def cpow [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] +@[expose] noncomputable def cpow [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] (T : E →ₗ[ℂ] E) (hT : T.IsPositive') (c : ℂ) : E →ₗ[ℂ] E where toFun v := ∑ i, (α hT.1 rfl i ^ c : ℂ) • ⟪e hT.1 rfl i, v⟫_ℂ • e hT.1 rfl i @@ -213,7 +214,7 @@ end theorem _root_.LinearMap.rePow_apply (hT : T.IsSymmetric) (r : ℝ) (v : E) : T.rePow hT r v = ∑ i, (((α hT rfl i : ℝ) ^ r : ℝ) : 𝕜) • ⟪e hT rfl i, v⟫ • e hT rfl i := - rfl + by rfl /-- the square root of a symmetric linear map can then directly be defined with `re_pow` -/ noncomputable def _root_.LinearMap.sqrt diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/RankOne.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/RankOne.lean index d7b6e68901..2a29cdbbe6 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/RankOne.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/RankOne.lean @@ -18,7 +18,7 @@ This defines the rank one operator $| x \rangle\langle y |$ for continuous linea -/ -@[expose] public section +public section section rankOne @@ -30,7 +30,6 @@ noncomputable abbrev bra (𝕜 : Type*) {E : Type*} [RCLike 𝕜] [NormedAddComm E →L⋆[𝕜] (E →L[𝕜] 𝕜) := innerSL 𝕜 /-- The ket map sending a vector to scalar multiplication by that vector. -/ -@[simps!] noncomputable def ket (𝕜 : Type*) {E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] : E →L[𝕜] (𝕜 →L[𝕜] E) where @@ -45,6 +44,11 @@ noncomputable def ket (𝕜 : Type*) {E : Type*} [RCLike 𝕜] [NormedAddCommGro intro simp only [ContinuousLinearMap.coe_mk', LinearMap.coe_mk, AddHom.coe_mk] exact continuous_const_smul _ + +@[simp] +theorem ket_apply_apply (𝕜 : Type*) {E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] + [InnerProductSpace 𝕜 E] (x : E) (a : 𝕜) : ket 𝕜 x a = a • x := by rfl + @[simp high] lemma ket_one_apply {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] @@ -123,7 +127,6 @@ lemma bra_comp_continuousLinearMap {𝕜 E₁ E₂ : Type*} [RCLike 𝕜] [Norme /-- we define the rank one operator $| x \rangle\langle y |$ by $x \mapsto \langle y,z\rangle x$ -/ -@[simps] def rankOne (𝕜 : Type*) {E₁ E₂ : Type*} [RCLike 𝕜] [NormedAddCommGroup E₁] [InnerProductSpace 𝕜 E₁] [NormedAddCommGroup E₂] [InnerProductSpace 𝕜 E₂] : @@ -144,13 +147,17 @@ def rankOne (𝕜 : Type*) {E₁ E₂ : Type*} [RCLike 𝕜] [NormedAddCommGroup variable {𝕜 E₁ E₂ : Type*} [RCLike 𝕜] [NormedAddCommGroup E₁] [InnerProductSpace 𝕜 E₁] [NormedAddCommGroup E₂] [InnerProductSpace 𝕜 E₂] +@[simp] +theorem rankOne_apply_apply_apply (x : E₁) (y z : E₂) : + rankOne 𝕜 x y z = ⟪y,z⟫_𝕜 • x := by rfl + @[simp] theorem rankOne_apply {x : E₁} {y : E₂} (z : E₂) : rankOne 𝕜 x y z = ⟪y,z⟫_𝕜 • x := -rfl +by rfl theorem ket_bra_eq_rankOne {x : E₁} {y : E₂} : ket 𝕜 x ∘L bra 𝕜 y = rankOne 𝕜 x y := -rfl +by rfl theorem ket_eq_rankOne_one (x : E₁) : ket 𝕜 x = rankOne 𝕜 x 1 := by diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Strict.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Strict.lean index abb6d0cfb9..233ccf0113 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Strict.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Strict.lean @@ -11,7 +11,7 @@ public import Mathlib.LinearAlgebra.TensorProduct.Associator # Strict tensor product (wip) -/ -@[expose] public section +public section variable {R E F G : Type _} [CommSemiring R] [AddCommGroup E] [AddCommGroup F] [AddCommGroup G] @@ -19,12 +19,12 @@ variable {R E F G : Type _} [CommSemiring R] [AddCommGroup E] [AddCommGroup F] [ open scoped TensorProduct -@[reducible, instance] +@[expose, reducible, instance] noncomputable def TensorProduct.assocHasCoe : CoeFun ((E ⊗[R] F) ⊗[R] G) (fun _ ↦ E ⊗[R] (F ⊗[R] G)) where coe x := TensorProduct.assoc R E F G x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def TensorProduct.assocSymmHasCoe : CoeFun (E ⊗[R] (F ⊗[R] G)) (fun _ ↦ (E ⊗[R] F) ⊗[R] G) where coe x := (TensorProduct.assoc R E F G).symm x @@ -43,22 +43,22 @@ theorem TensorProduct.tmul_assoc_coe (a : E) (b : F) (c : G) : theorem TensorProduct.coe_coe_assoc (a : E ⊗[R] (F ⊗[R] G)) : a = ↑(a : (E ⊗[R] F) ⊗[R] G) := by simp only [LinearEquiv.apply_symm_apply] -@[reducible, instance] +@[expose, reducible, instance] noncomputable def TensorProduct.lidHasCoe : CoeFun (R ⊗[R] E) (fun _ => E) where coe x := TensorProduct.lid R E x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def TensorProduct.ridHasCoe : CoeFun (E ⊗[R] R) (fun _ => E) where coe x := TensorProduct.rid R E x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def TensorProduct.lidSymmHasCoe : Coe E (R ⊗[R] E) where coe x := (TensorProduct.lid R E).symm x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def TensorProduct.ridSymmHasCoe : Coe E (E ⊗[R] R) where coe x := (TensorProduct.rid R E).symm x @@ -119,7 +119,7 @@ noncomputable def funLidHasCoe {A : Type _} : CoeFun (R ⊗[R] E → A) (fun _ ↦ E → A) where coe f x := f x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def LinearMap.tensorProductLidHasCoe {A : Type _} [AddCommMonoid A] [Module R A] : Coe (R ⊗[R] E →ₗ[R] A) (E →ₗ[R] A) where coe f := f ∘ₗ ↑(TensorProduct.lid R E).symm @@ -129,7 +129,7 @@ noncomputable def funLidHasCoe' {A : Type _} : Coe (E → A) (R ⊗[R] E → A) where coe f x := f x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def LinearMap.tensorProductLidHasCoe' {A : Type _} [AddCommMonoid A] [Module R A] : Coe (E →ₗ[R] A) (R ⊗[R] E →ₗ[R] A) where coe f := f ∘ₗ ↑(TensorProduct.lid R E) @@ -139,7 +139,7 @@ noncomputable def funRidHasCoe {A : Type _} : CoeFun (E ⊗[R] R → A) (fun _ => E → A) where coe f x := f x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def LinearMap.tensorProductRidHasCoe {A : Type _} [AddCommMonoid A] [Module R A] : Coe (E ⊗[R] R →ₗ[R] A) (E →ₗ[R] A) where coe f := f ∘ₗ ↑(TensorProduct.rid R E).symm @@ -149,7 +149,7 @@ noncomputable def funRidHasCoe' {A : Type _} : Coe (E → A) (E ⊗[R] R → A) where coe f x := f x -@[reducible, instance] +@[expose, reducible, instance] noncomputable def LinearMap.tensorProductRidHasCoe' {A : Type _} [AddCommMonoid A] [Module R A] : Coe (E →ₗ[R] A) (E ⊗[R] R →ₗ[R] A) where coe f := f ∘ₗ ↑(TensorProduct.rid R E) diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Symm.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Symm.lean index 8778961a70..f65d45255d 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Symm.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Symm.lean @@ -16,7 +16,7 @@ This file provides the polarization identity for self adjoint continuous linear -/ -@[expose] public section +public section variable {𝕜 E : Type _} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean index 9acb11b53f..0db0ef2d3d 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean @@ -16,7 +16,7 @@ inner product space structure now lives in Mathlib. -/ -@[expose] public section +public section open scoped TensorProduct BigOperators diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Vn.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Vn.lean index 1e3fbebfd1..247d888006 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Vn.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Vn.lean @@ -18,7 +18,7 @@ This file contains two simple results about von Neumann algebras. -/ -@[expose] public section +public section namespace VonNeumannAlgebra diff --git a/LeanPool/Monlib4/LinearAlgebra/IsProjPrime.lean b/LeanPool/Monlib4/LinearAlgebra/IsProjPrime.lean index c3d2ecde79..3864f91d94 100644 --- a/LeanPool/Monlib4/LinearAlgebra/IsProjPrime.lean +++ b/LeanPool/Monlib4/LinearAlgebra/IsProjPrime.lean @@ -15,7 +15,7 @@ This file contains the definition of `linear_map.is_proj'` and lemmas relating t essentially `linear_map.is_proj` but as a linear map from `E` to `U`. -/ -@[expose] public section +public section section @@ -29,7 +29,7 @@ def isProj' {p : E →ₗ[R] E} (hp : LinearMap.IsProj U p) : E →ₗ[R] U map_smul' r x := by simp_rw [LinearMap.map_smul, RingHom.id_apply, SetLike.mk_smul_mk] theorem isProj'_apply {p : E →ₗ[R] E} (hp : LinearMap.IsProj U p) (x : E) : ↑(isProj' hp x) = p x := - rfl + by rfl theorem isProj'_eq {p : E →ₗ[R] E} (hp : LinearMap.IsProj U p) : ∀ x : U, isProj' hp (x : E) = x := by @@ -53,7 +53,7 @@ theorem orthogonalProjection_eq_linear_proj'' Submodule.orthogonalProjectionOnto_apply_eq_projectionOnto x /-- The orthogonal projection onto a submodule as an endomorphism of the ambient space. -/ -noncomputable def orthogonalProjection' +@[expose] noncomputable def orthogonalProjection' (U : Submodule 𝕜 E) [U.HasOrthogonalProjection] : E →L[𝕜] E := U.starProjection diff --git a/LeanPool/Monlib4/LinearAlgebra/IsReal.lean b/LeanPool/Monlib4/LinearAlgebra/IsReal.lean index fcd174361f..e6f06a2f24 100644 --- a/LeanPool/Monlib4/LinearAlgebra/IsReal.lean +++ b/LeanPool/Monlib4/LinearAlgebra/IsReal.lean @@ -18,10 +18,10 @@ This file defines `LinearMap.real`, the star-conjugate of a linear map, when `φ = φ.real`. -/ -@[expose] public section +public section /-- A function-like map is real if it commutes with star. -/ -def LinearMap.IsReal {M₁ M₂ : Type*} {F : Type*} [FunLike F M₁ M₂] +@[expose] def LinearMap.IsReal {M₁ M₂ : Type*} {F : Type*} [FunLike F M₁ M₂] [Star M₁] [Star M₂] (φ : F) : Prop := ∀ x, φ (star x) = star (φ x) @@ -36,7 +36,7 @@ variable {E F K : Type _} [AddCommMonoid E] [StarAddMonoid E] [AddCommMonoid F] [StarAddMonoid F] /-- The star-conjugate of a linear map. -/ -@[simps!] +@[expose, simps!] def LinearMap.real [Semiring K] [Module K E] [Module K F] [InvolutiveStar K] [StarModule K E] [StarModule K F] (φ : E →ₗ[K] F) : @@ -46,7 +46,6 @@ def LinearMap.real map_smul' _ _ := by simp only [star_smul, _root_.map_smul, star_star, RingHom.id_apply] /-- Star-conjugating a linear map is a semilinear involution. -/ -@[simps! apply_apply] def LinearMap.realSLinearEquiv [CommSemiring K] [Module K E] [Module K F] [StarRing K] [StarModule K E] [StarModule K F] : @@ -67,6 +66,12 @@ def LinearMap.realSLinearEquiv simp only [LinearMap.smul_apply, star_smul, real_apply] rfl +@[simp] +theorem LinearMap.realSLinearEquiv_apply_apply + [CommSemiring K] [Module K E] [Module K F] + [StarRing K] [StarModule K E] [StarModule K F] (φ : E →ₗ[K] F) (x : E) : + LinearMap.realSLinearEquiv φ x = star (φ (star x)) := by rfl + variable [Semiring K] [Module K E] [Module K F] [InvolutiveStar K] [StarModule K E] [StarModule K F] diff --git a/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean b/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean index b062705cda..1d5f56ac98 100644 --- a/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean +++ b/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean @@ -20,7 +20,7 @@ This file contains the definition of `tensorToKronecker` and -/ -@[expose] public section +public section open scoped TensorProduct BigOperators Kronecker @@ -126,14 +126,12 @@ theorem Matrix.kroneckerToTensorProduct_hMul (x y : Matrix m m R) (z w : Matrix Algebra.TensorProduct.tmul_mul_tmul] /-- Algebra equivalence from the tensor product of matrix algebras to Kronecker matrices. -/ -@[simps!] -noncomputable def tensorToKronecker : +@[expose, simps!] noncomputable def tensorToKronecker : Matrix m m R ⊗[R] Matrix n n R ≃ₐ[R] Matrix (m × n) (m × n) R := Matrix.kroneckerAlgEquiv m n R /-- Algebra equivalence from Kronecker matrices to the tensor product of matrix algebras. -/ -@[simps!] -noncomputable def kroneckerToTensor : +@[expose, simps!] noncomputable def kroneckerToTensor : Matrix (m × n) (m × n) R ≃ₐ[R] Matrix m m R ⊗[R] Matrix n n R := (Matrix.kroneckerAlgEquiv m n R).symm @@ -147,13 +145,13 @@ theorem Matrix.kroneckerToTensorProduct_star {R m n : Type _} [Field R] [StarRin theorem kroneckerToTensor_toLinearMap_eq : (kroneckerToTensor : Matrix (n × m) (n × m) R ≃ₐ[R] _).toLinearMap = (kroneckerToTensorProduct : Matrix (n × m) (n × m) R →ₗ[R] Matrix n n R ⊗[R] Matrix m m R) := - rfl + by rfl theorem tensorToKronecker_toLinearMap_eq : ((@tensorToKronecker R m n _ _ _ _ _ : Matrix m m R ⊗[R] Matrix n n R ≃ₐ[R] _).toLinearMap : Matrix m m R ⊗[R] Matrix n n R →ₗ[R] Matrix (m × n) (m × n) R) = (TensorProduct.toKronecker : Matrix m m R ⊗[R] Matrix n n R →ₗ[R] Matrix (m × n) (m × n) R) := - rfl + by rfl end diff --git a/LeanPool/Monlib4/LinearAlgebra/LinearMapOp.lean b/LeanPool/Monlib4/LinearAlgebra/LinearMapOp.lean index 13fe661c12..9872eb9496 100644 --- a/LeanPool/Monlib4/LinearAlgebra/LinearMapOp.lean +++ b/LeanPool/Monlib4/LinearAlgebra/LinearMapOp.lean @@ -13,10 +13,10 @@ public import Mathlib.Algebra.Algebra.Opposite Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.LinearMapOp`. -/ -@[expose] public section +public section /-- Push a semilinear map between modules through the multiplicative opposite. -/ -@[simps] +@[expose, simps] def LinearMap.op {R S : Type*} [Semiring R] [Semiring S] {σ : R →+* S} {M M₂ : Type*} [AddCommMonoid M] [AddCommMonoid M₂] [Module R M] [Module S M₂] (f : M →ₛₗ[σ] M₂) : Mᵐᵒᵖ →ₛₗ[σ] M₂ᵐᵒᵖ where @@ -25,7 +25,7 @@ def LinearMap.op {R S : Type*} [Semiring R] [Semiring S] {σ : R →+* S} map_smul' _ _ := by simp only [MulOpposite.unop_smul, LinearMap.map_smulₛₗ, MulOpposite.op_smul] /-- Pull a semilinear map between opposite modules back through the multiplicative opposite. -/ -@[simps] +@[expose, simps] def LinearMap.unop {R S : Type*} [Semiring R] [Semiring S] {σ : R →+* S} {M M₂ : Type*} [AddCommMonoid M] [AddCommMonoid M₂] [Module R M] [Module S M₂] (f : Mᵐᵒᵖ →ₛₗ[σ] M₂ᵐᵒᵖ) : M →ₛₗ[σ] M₂ where diff --git a/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean b/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean index 239b778e15..1bbda1b04f 100644 --- a/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean +++ b/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean @@ -18,7 +18,7 @@ The left and right multiplication maps, copied from `LinearMap.mulLeft` and -/ -@[expose] public section +public section section @@ -67,7 +67,7 @@ theorem right_module_map_iff {H₂ : Type _} [Semiring H₂] [Algebra R H₂] {x · rw [h, ← mul_assoc, ← h] /-- The linear map sending an element to left multiplication by that element. -/ -def lmul : H₁ →ₗ[R] l(R,H₁) where +@[expose] def lmul : H₁ →ₗ[R] l(R,H₁) where toFun x := LinearMap.mulLeft R x map_add' x y := by ext1 @@ -77,14 +77,14 @@ def lmul : H₁ →ₗ[R] l(R,H₁) where simp only [LinearMap.mulLeft_apply, LinearMap.smul_apply, RingHom.id_apply, smul_mul_assoc] theorem lmul_apply (x y : H₁) : (lmul x : l(R,H₁)) y = x * y := - rfl + by rfl theorem lmul_eq_mul (x : H₁) : lmul x = LinearMap.mulLeft R x := - rfl + by rfl theorem lmul_eq_alg_lmul {H₁ : Type _} [Semiring H₁] [Algebra R H₁] (x : H₁) : (lmul x : l(R,H₁)) = Algebra.lmul R H₁ x := - rfl + by rfl theorem lmul_one {H₁ : Type _} [NonAssocSemiring H₁] [Module R H₁] [SMulCommClass R H₁ H₁] [IsScalarTower R H₁ H₁] : (lmul (1 : H₁) : l(R,H₁)) = 1 := by @@ -92,7 +92,7 @@ theorem lmul_one {H₁ : Type _} [NonAssocSemiring H₁] [Module R H₁] [SMulCo simp_rw [lmul_apply, Module.End.one_apply, one_mul] /-- The linear map sending an element to right multiplication by that element. -/ -def rmul : H₂ →ₗ[R] l(R,H₂) where +@[expose] def rmul : H₂ →ₗ[R] l(R,H₂) where toFun x := LinearMap.mulRight R x map_add' x y := by ext1 @@ -102,10 +102,10 @@ def rmul : H₂ →ₗ[R] l(R,H₂) where simp only [LinearMap.mulRight_apply, LinearMap.smul_apply, RingHom.id_apply, mul_smul_comm] theorem rmul_apply (x y : H₂) : (rmul x : l(R,H₂)) y = y * x := - rfl + by rfl theorem rmul_eq_mul (x : H₂) : rmul x = LinearMap.mulRight R x := - rfl + by rfl theorem rmul_one {H₁ : Type _} [NonAssocSemiring H₁] [Module R H₁] [SMulCommClass R H₁ H₁] [IsScalarTower R H₁ H₁] : (rmul (1 : H₁) : l(R,H₁)) = 1 := by @@ -117,7 +117,7 @@ open scoped TensorProduct local notation x " ⊗ₘ " y => TensorProduct.map x y /-- Tensor right multiplication on the left factor with left multiplication on the right factor. -/ -noncomputable def rmulMapLmul {R H₁ H₂ : Type*} [CommSemiring R] +@[expose] noncomputable def rmulMapLmul {R H₁ H₂ : Type*} [CommSemiring R] [NonUnitalNonAssocSemiring H₁] [Module R H₁] [SMulCommClass R H₁ H₁] [IsScalarTower R H₁ H₁] [NonUnitalNonAssocSemiring H₂] [Module R H₂] [SMulCommClass R H₂ H₂] [IsScalarTower R H₂ H₂] : H₁ ⊗[R] H₂ →ₗ[R] ((H₁ ⊗[R] H₂) →ₗ[R] (H₁ ⊗[R] H₂)) := @@ -217,14 +217,14 @@ theorem LinearMap.mulLeft_apply_inj {H₁ : Type _} [Semiring H₁] [Module R H theorem lmul_op {R A : Type*} [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A] [SMulCommClass R A A] [IsScalarTower R A A] (x : Aᵐᵒᵖ) : lmul x = (rmul (x.unop) : A →ₗ[R] A).op := - rfl + by rfl theorem lmul_op' {R A : Type*} [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A] [SMulCommClass R A A] [IsScalarTower R A A] (x : A) : lmul (MulOpposite.op x) = (rmul x : A →ₗ[R] A).op := - rfl + by rfl theorem rmul_op' {R A : Type*} [CommSemiring R] [NonUnitalNonAssocSemiring A] [Module R A] [SMulCommClass R A A] [IsScalarTower R A A] (x : A) : rmul (MulOpposite.op x) = (lmul x : A →ₗ[R] A).op := - rfl + by rfl diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix.lean index eab62cf1a5..4eed554a50 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix.lean @@ -23,4 +23,4 @@ public import LeanPool.Monlib4.LinearAlgebra.Matrix.StarOrderedRing Import-only index for the `Matrix` directory of the monlib4 import. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/Basic.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/Basic.lean index 2c377ccad1..798b1d7050 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/Basic.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/Basic.lean @@ -17,7 +17,7 @@ Basic matrix lemmas used by the monlib4 automorphism-of-matrix-algebras formalization. -/ -@[expose] public section +public section namespace Matrix @@ -380,7 +380,7 @@ lemma _root_.Matrix.smul_one_eq_one_iff {𝕜 n : Type*} [DecidableEq n] [Field · simp_all /-- A linear equivalence of `R^n` gives an invertible matrix. -/ -@[reducible] +@[expose, reducible] def LinearEquiv.toInvertibleMatrix {n R : Type _} [CommSemiring R] [Fintype n] [DecidableEq n] (x : (n → R) ≃ₗ[R] n → R) : Invertible (LinearMap.toMatrix' (x : (n → R) →ₗ[R] n → R)) := by diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/Cast.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/Cast.lean index ee101d2c70..28d5ab653a 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/Cast.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/Cast.lean @@ -13,7 +13,7 @@ public import Mathlib.Data.Matrix.Mul Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.Matrix.Cast`. -/ -@[expose] public section +public section variable {R k : Type*} {s : k → Type _} diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/Conj.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/Conj.lean index 61de7e287d..810b27db50 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/Conj.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/Conj.lean @@ -15,7 +15,7 @@ This file defines the conjugate of a matrix, `matrix.conj` with the notation ` (i.e., `xᴴᵀ i j = star (x i j)`), and shows basic properties about it. -/ -@[expose] public section +public section namespace Matrix @@ -26,6 +26,7 @@ variable {α n₁ n₂ : Type _} /-- conjugate of matrix defined as $\bar{x} := {(x^*)}^\top$, i.e., $\bar{x}_{ij}=\overline{x_{ij}}$ -/ +@[expose] def conj [Star α] (x : Matrix n₁ n₂ α) : Matrix n₁ n₂ α := xᴴᵀ diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/IncludeBlock.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/IncludeBlock.lean index cc56de28cb..cdea5c3bab 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/IncludeBlock.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/IncludeBlock.lean @@ -21,7 +21,7 @@ import Mathlib.Analysis.SpecialFunctions.Bernstein -/ -@[expose] public section +public section open scoped BigOperators @@ -34,6 +34,7 @@ theorem Finset.sum_sigma_univ {β α : Type _} [AddCommMonoid β] [Fintype α] { namespace Matrix /-- The algebra homomorphism from block-indexed matrices to their block diagonal matrix. -/ +@[expose] def blockDiagonal'AlgHom {o : Type _} {m' : o → Type _} {α : Type _} [Fintype o] [DecidableEq o] [∀ i, Fintype (m' i)] [∀ i, DecidableEq (m' i)] [CommSemiring α] : PiMat α o m' →ₐ[α] Matrix (Σ i : o, m' i) (Σ i : o, m' i) α @@ -49,7 +50,7 @@ def blockDiagonal'AlgHom {o : Type _} {m' : o → Type _} {α : Type _} [Fintype theorem blockDiagonal'AlgHom_apply {o : Type _} {m' : o → Type _} {α : Type _} [Fintype o] [DecidableEq o] [∀ i, Fintype (m' i)] [∀ i, DecidableEq (m' i)] [CommSemiring α] (x : PiMat α o m') : Matrix.blockDiagonal'AlgHom x = blockDiagonal' x := - rfl + by rfl /-- The linear map sending a matrix to the family of its diagonal blocks. -/ def blockDiag'LinearMap {o : Type _} {m' n' : o → Type _} {α : Type _} [Semiring α] : @@ -62,7 +63,7 @@ def blockDiag'LinearMap {o : Type _} {m' n' : o → Type _} {α : Type _} [Semir theorem blockDiag'LinearMap_apply {o : Type _} {m' : o → Type _} {n' : o → Type _} {α : Type _} [Semiring α] (x : Matrix (Σ i : o, m' i) (Σ i : o, n' i) α) : Matrix.blockDiag'LinearMap x = blockDiag' x := - rfl + by rfl theorem blockDiag'LinearMap_blockDiagonal'AlgHom {o : Type _} {m' : o → Type _} {α : Type _} [Fintype o] [DecidableEq o] [∀ i, Fintype (m' i)] [∀ i, DecidableEq (m' i)] [CommSemiring α] @@ -81,7 +82,7 @@ def IsBlockDiagonal {o : Type _} {m' n' : o → Type _} {α : Type _} [Decidable blockDiagonal' (blockDiag' x) = x /-- Include a single matrix block in the corresponding component of a block-indexed family. -/ -def includeBlock {o : Type _} [DecidableEq o] {m' : o → Type _} {α : Type _} [Semiring α] +@[expose] def includeBlock {o : Type _} [DecidableEq o] {m' : o → Type _} {α : Type _} [Semiring α] {i : o} : Matrix (m' i) (m' i) α →ₗ[α] (PiMat α o m') := @LinearMap.single α o _ (fun j => Matrix (m' j) (m' j) α) _ _ _ i @@ -193,7 +194,7 @@ theorem add {k : Type _} [DecidableEq k] {s : k → Type _} end IsBlockDiagonal /-- The subtype of block-diagonal square matrices indexed by a sigma type. -/ -@[reducible] +@[reducible, expose] def BlockDiagonals (R k : Type _) [Zero R] [DecidableEq k] (s : k → Type _) := { x : Matrix (Σ i, s i) (Σ i, s i) R // IsBlockDiagonal x } @@ -433,7 +434,7 @@ theorem coe_mul {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} ((x * y : (BlockDiagonals R k s)) : Matrix (Σ i, s i) (Σ i, s i) R) = x * y := - rfl + by rfl theorem one {k : Type _} [DecidableEq k] {s : k → Type _} [∀ i, DecidableEq (s i)] : (1 : Matrix (Σ i, s i) (Σ i, s i) R).IsBlockDiagonal := by @@ -448,7 +449,7 @@ theorem coe_one {k : Type _} [DecidableEq k] {s : k → Type _} [∀ i, Decidabl ((1 : (BlockDiagonals R k s)) : Matrix (Σ i, s i) (Σ i, s i) R) = 1 := - rfl + by rfl theorem coe_nsmul {k : Type _} [DecidableEq k] {s : k → Type _} (n : ℕ) (x : (BlockDiagonals R k s)) : @@ -478,9 +479,9 @@ theorem coe_npow {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} ((x ^ n : (BlockDiagonals R k s)) : Matrix (Σ i, s i) (Σ i, s i) R) = x ^ n := - rfl + by rfl -@[reducible, instance] +@[reducible, instance, expose] def semiring {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} [∀ i, Fintype (s i)] [∀ i, DecidableEq (s i)] : Semiring (BlockDiagonals R k s) @@ -518,7 +519,7 @@ def semiring {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} simp_rw [IsBlockDiagonal.coe_npow, pow_add, IsBlockDiagonal.coe_mul, pow_one, IsBlockDiagonal.coe_npow] -@[reducible, instance] +@[reducible, instance, expose] def algebra {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} [∀ i, Fintype (s i)] [∀ i, DecidableEq (s i)] : Algebra R (BlockDiagonals R k s) @@ -555,7 +556,7 @@ theorem coe_blockDiagonal'_blockDiag' {k : Type _} [DecidableEq k] {s : k → Ty end IsBlockDiagonal /-- Block-diagonal matrices are algebra-equivalent to block-indexed matrix families. -/ -@[simps] +@[expose, simps] def isBlockDiagonalPiAlgEquiv {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} [∀ i, Fintype (s i)] [∀ i, DecidableEq (s i)] : (BlockDiagonals R k s) ≃ₐ[R] PiMat R k s @@ -617,7 +618,7 @@ theorem coe_star {R : Type _} [CommSemiring R] [StarAddMonoid R] {k : Type _} [DecidableEq k] {s : k → Type _} (y : (BlockDiagonals R k s)) : ((Star.star y : BlockDiagonals R k s) : Matrix (Σ i, s i) (Σ i, s i) R) = yᴴ := - rfl + by rfl end IsBlockDiagonal @@ -647,8 +648,7 @@ end isBlockDiagonalPiAlgEquiv namespace Equiv /-- A variant of `Equiv.sigmaProdDistrib` with the product coordinate first. -/ -@[simps!] -def sigmaProdDistrib' {ι : Type _} (β : Type _) (α : ι → Type _) : +@[expose] def sigmaProdDistrib' {ι : Type _} (β : Type _) (α : ι → Type _) : (β × Σ i : ι, α i) ≃ Σ i : ι, β × α i := by let this : (Σ i : ι, β × α i) ≃ Σ i : ι, α i × β := by apply Equiv.sigmaCongrRight @@ -656,11 +656,24 @@ def sigmaProdDistrib' {ι : Type _} (β : Type _) (α : ι → Type _) : exact Equiv.prodComm _ _ exact ((Equiv.prodComm _ _).trans (Equiv.sigmaProdDistrib _ _)).trans this.symm +@[simp] theorem sigmaProdDistrib'_apply_fst {ι : Type _} (β : Type _) (α : ι → Type _) + (x : β × Σ i, α i) : ((sigmaProdDistrib' β α) x).1 = x.2.1 := by + rfl + +@[simp] theorem sigmaProdDistrib'_apply_snd {ι : Type _} (β : Type _) (α : ι → Type _) + (x : β × Σ i, α i) : + ((sigmaProdDistrib' β α) x).2 = (Equiv.prodComm (α x.2.1) β) (x.2.2, x.1) := by + rfl + +@[simp] theorem sigmaProdDistrib'_symm_apply {ι : Type _} (β : Type _) (α : ι → Type _) + (x : Σ i, β × α i) : + (sigmaProdDistrib' β α).symm x = (x.2.1, ⟨x.1, x.2.2⟩) := by + rfl + end Equiv /-- Distribute a product of sigma types into a nested sigma type. -/ -@[simps] -def sigmaProdSigma {α β : Type _} {ζ : α → Type _} {℘ : β → Type _} : +@[expose] def sigmaProdSigma {α β : Type _} {ζ : α → Type _} {℘ : β → Type _} : ((Σ i, ζ i) × Σ i, ℘ i) ≃ Σ i j, ζ i × ℘ j where toFun x := by @@ -674,6 +687,27 @@ def sigmaProdSigma {α β : Type _} {ζ : α → Type _} {℘ : β → Type _} : rcases x with ⟨i, j, z, p⟩ rfl +@[simp] theorem sigmaProdSigma_apply_fst {α β : Type _} {ζ : α → Type _} + {℘ : β → Type _} (x : (Σ i, ζ i) × Σ i, ℘ i) : + (sigmaProdSigma x).1 = ((Equiv.sigmaProdDistrib ζ ((i : β) × ℘ i)) x).1 := by + rfl + +@[simp] theorem sigmaProdSigma_apply_snd_fst {α β : Type _} {ζ : α → Type _} + {℘ : β → Type _} (x : (Σ i, ζ i) × Σ i, ℘ i) : + (sigmaProdSigma x).2.1 = + ((Equiv.sigmaProdDistrib' ((i : α) × ζ i) ℘) x).1 := by + rfl + +@[simp] theorem sigmaProdSigma_apply_snd_snd {α β : Type _} {ζ : α → Type _} + {℘ : β → Type _} (x : (Σ i, ζ i) × Σ i, ℘ i) : + (sigmaProdSigma x).2.2 = (x.1.2, x.2.2) := by + rfl + +@[simp] theorem sigmaProdSigma_symm_apply {α β : Type _} {ζ : α → Type _} + {℘ : β → Type _} (x : Σ i j, ζ i × ℘ j) : + sigmaProdSigma.symm x = (⟨x.1, x.2.2.1⟩, ⟨x.2.1, x.2.2.2⟩) := by + rfl + namespace IsBlockDiagonal theorem apply_of_ne {R : Type _} [CommSemiring R] {k : Type _} [DecidableEq k] @@ -705,7 +739,7 @@ theorem kronecker_hMul {R : Type _} [CommSemiring R] {k : Type _} [DecidableEq k end IsBlockDiagonal /-- Conjugation by the block-diagonal/pi-matrix algebra equivalence on endomorphisms. -/ -@[simps!] +@[expose, simps!] def directSumLinearMapAlgEquivIsBlockDiagonalLinearMap {R : Type _} [CommSemiring R] {k : Type _} [Fintype k] [DecidableEq k] {s : k → Type _} [∀ i, Fintype (s i)] [∀ i, DecidableEq (s i)] : ((PiMat R k s) →ₗ[R] PiMat R k s) ≃ₐ[R] diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean index 897ee587b6..46e7d9571e 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset We say a matrix `x` is `is_almost_hermitian` if there exists some scalar `α ∈ ℂ`. -/ -@[expose] public section +public section namespace Matrix @@ -32,7 +32,7 @@ open scoped Matrix /-- a matrix $x \in M_n(\mathbb{k})$ is ``almost Hermitian'' if there exists some $\alpha\in\mathbb{k}$ and $y\in M_n(\mathbb{k})$ such that $\alpha y = x$ and $y$ is Hermitian -/ -def IsAlmostHermitian [Star 𝕜] [SMul 𝕜 (Matrix n n 𝕜)] (x : Matrix n n 𝕜) : Prop := +@[expose] def IsAlmostHermitian [Star 𝕜] [SMul 𝕜 (Matrix n n 𝕜)] (x : Matrix n n 𝕜) : Prop := ∃ (α : 𝕜) (y : Matrix n n 𝕜), α • y = x ∧ y.IsHermitian open scoped Kronecker diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/PiMat.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/PiMat.lean index 0ffcd5fe10..4704992bdf 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/PiMat.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/PiMat.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.SetLike Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.Matrix.PiMat`. -/ -@[expose] public section +public section /-- Square matrices over `R` indexed by `n`. -/ abbrev Mat (R n : Type*) := Matrix n n R diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/PosDefRpow.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/PosDefRpow.lean index c7e0b41213..f62905f7e7 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/PosDefRpow.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/PosDefRpow.lean @@ -19,7 +19,7 @@ semidefinite and positive definite matrices. The definitions are stated in terms of the current Mathlib Hermitian spectral theorem. -/ -@[expose] public section +public section namespace Matrix @@ -34,6 +34,7 @@ theorem _root_.Matrix.IsHermitian.eigenvectorMatrix_conjTranspose_mul {A : Matri exact UnitaryGroup.star_mul_self _ /-- Real powers of a Hermitian matrix, defined by spectral calculus. -/ +@[expose] noncomputable def _root_.Matrix.IsHermitian.rpow {Q : Matrix n n 𝕜} (hQ : IsHermitian Q) (r : ℝ) : Matrix n n 𝕜 := @@ -56,7 +57,7 @@ lemma _root_.Matrix.PosDef.rpow_eq {Q : Matrix n n 𝕜} (hQ : Q.PosDef) (r : hQ.rpow r = Matrix.innerAut hQ.1.eigenvectorUnitary (Matrix.diagonal (RCLike.ofReal ∘ (hQ.1.eigenvalues ^ r : n → ℝ) : n → 𝕜)) := - rfl + by rfl theorem _root_.Matrix.PosSemidef.rpow_mul_rpow (r₁ r₂ : NNRealˣ) {Q : Matrix n n 𝕜} (hQ : PosSemidef Q) : diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/PosEqLinearMapIsPositive.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/PosEqLinearMapIsPositive.lean index 819a179554..88559b0609 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/PosEqLinearMapIsPositive.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/PosEqLinearMapIsPositive.lean @@ -16,7 +16,7 @@ import LeanPool.Monlib4.Preq.RCLikeLe Compatibility wrappers for the part of Monlib's matrix-positive API now covered by Mathlib. -/ -@[expose] public section +public section namespace Matrix @@ -204,8 +204,10 @@ theorem _root_.rankOne.EuclideanSpace.toEuclideanLin_symm {𝕜 : Type*} [RCLike (Matrix.replicateCol (Fin 1) (y : m → 𝕜))ᴴ := by have hrank : (rankOne 𝕜 x y).toLinearMap = (InnerProductSpace.rankOne 𝕜 x y).toLinearMap := by - ext z i - rfl + apply LinearMap.ext + intro z + change rankOne 𝕜 x y z = InnerProductSpace.rankOne 𝕜 x y z + simp only [_root_.rankOne_apply, InnerProductSpace.rankOne_apply] rw [hrank, InnerProductSpace.symm_toEuclideanLin_rankOne, Matrix.vecMulVec_eq (Fin 1), Matrix.conjTranspose_replicateCol] rfl diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/Reshape.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/Reshape.lean index a4be00e264..67d5fe97de 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/Reshape.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/Reshape.lean @@ -16,7 +16,7 @@ and shows some obvious properties of this identification. -/ -@[expose] public section +public section namespace Matrix @@ -27,15 +27,15 @@ variable {R I J : Type _} [Semiring R] /-- identifies matrices $M_{I\times J}(R)$ with $R^{I \times J}$, this is given by $\varrho (x)_{(i,j)} = x_{ij}$ -/ -def reshape : Matrix I J R ≃ₗ[R] I × J → R := +@[expose] def reshape : Matrix I J R ≃ₗ[R] I × J → R := (LinearEquiv.curry R _ _ _).symm theorem reshape_apply (x : Matrix I J R) (ij : I × J) : reshape x ij = x ij.1 ij.2 := - rfl + by rfl theorem reshape_symm_apply (x : I × J → R) (i : I) (j : J) : (reshape : Matrix I J R ≃ₗ[R] I × J → R).symm x i j = x (i, j) := - rfl + by rfl theorem reshape_symm_apply' (x : I × J → R) (ij : I × J) : (reshape : Matrix I J R ≃ₗ[R] I × J → R).symm x ij.1 ij.2 = x ij := by diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/Spectra.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/Spectra.lean index 9118ea04ee..392522c3a5 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/Spectra.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/Spectra.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.SpecialFunctions.Bernstein Spectral helpers for Hermitian and almost-Hermitian matrices. -/ -@[expose] public section +public section instance multisetCoe {α β : Type _} [Coe α β] : Coe (Multiset α) (Multiset β) where coe s := s.map (Coe.coe : α → β) @@ -71,6 +71,7 @@ theorem _root_.Matrix.IsAlmostHermitian.matrix_isHermitian {n : Type _} {x : Mat simp_all /-- Eigenvalues of the Hermitian factor, rescaled by the almost-Hermitian scalar. -/ +@[expose] noncomputable def _root_.Matrix.IsAlmostHermitian.eigenvalues {x : Matrix n n 𝕜} (hx : x.IsAlmostHermitian) : n → 𝕜 := diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/StarOrderedRing.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/StarOrderedRing.lean index 021cf67401..9667676612 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/StarOrderedRing.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/StarOrderedRing.lean @@ -21,7 +21,7 @@ order and `StarOrderedRing` instance, so this file restores the Monlib-facing negative definiteness definitions, spectral criteria, and compatibility names. -/ -@[expose] public section +public section namespace Matrix @@ -57,12 +57,12 @@ protected def _root_.Matrix.LE {n : Type _} : ⟨fun x y => (y - x).PosSemidef⟩ /-- A matrix is negative semidefinite when its Hermitian quadratic form is nonpositive. -/ -def _root_.Matrix.NegSemidef {𝕜 n : Type _} [RCLike 𝕜] [Fintype n] +@[expose] def _root_.Matrix.NegSemidef {𝕜 n : Type _} [RCLike 𝕜] [Fintype n] (x : Matrix n n 𝕜) : Prop := x.IsHermitian ∧ ∀ a : n → 𝕜, dotProduct (Star.star a) (x *ᵥ a) ≤ 0 /-- A matrix is negative definite when its quadratic form is negative on nonzero inputs. -/ -def _root_.Matrix.NegDef {𝕜 n : Type _} [RCLike 𝕜] [Fintype n] +@[expose] def _root_.Matrix.NegDef {𝕜 n : Type _} [RCLike 𝕜] [Fintype n] (x : Matrix n n 𝕜) : Prop := x.IsHermitian ∧ ∀ a : n → 𝕜, a ≠ 0 → (star a) ⬝ᵥ (x *ᵥ a) < 0 diff --git a/LeanPool/Monlib4/LinearAlgebra/MulPrimePrime.lean b/LeanPool/Monlib4/LinearAlgebra/MulPrimePrime.lean index e0e62b6473..4d6c5895ca 100644 --- a/LeanPool/Monlib4/LinearAlgebra/MulPrimePrime.lean +++ b/LeanPool/Monlib4/LinearAlgebra/MulPrimePrime.lean @@ -19,7 +19,7 @@ this defines the multiplication map $M_{n\times n} \to M_n$ -/ -@[expose] public section +public section open Matrix @@ -156,6 +156,6 @@ def mulToClm (𝕜 X : Type _) [RCLike 𝕜] [NormedAddCommGroupOfRing X] [Norme theorem mulToClm_apply {𝕜 X : Type _} [RCLike 𝕜] [NormedAddCommGroupOfRing X] [NormedSpace 𝕜 X] [SMulCommClass 𝕜 X X] [IsScalarTower 𝕜 X X] [FiniteDimensional 𝕜 X] (x y : X) : mulToClm 𝕜 X x y = x * y := - rfl + by rfl end LinearMap diff --git a/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean b/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean index 990f301f27..ce0e45b1d2 100644 --- a/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean +++ b/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean @@ -20,7 +20,7 @@ We define (A-A)-bimodules, where A is a commutative semiring, and show basic properties of them. -/ -@[expose] public section +public section variable {R H₁ H₂ : Type _} [CommSemiring R] [Semiring H₁] [Semiring H₂] [Algebra R H₁] @@ -31,10 +31,12 @@ open scoped TensorProduct local notation x " ⊗ₘ " y => TensorProduct.map x y /-- Left multiplication on the left tensor factor. -/ +@[expose] noncomputable def Bimodule.lsmul (x : H₁) (y : H₁ ⊗[R] H₂) : H₁ ⊗[R] H₂ := (LinearMap.mulLeft R x ⊗ₘ 1) y /-- Right multiplication on the right tensor factor. -/ +@[expose] noncomputable def Bimodule.rsmul (x : H₁ ⊗[R] H₂) (y : H₂) : H₁ ⊗[R] H₂ := (1 ⊗ₘ LinearMap.mulRight R y) x @@ -47,10 +49,10 @@ scoped[Bimodule] infixl:72 " •ᵣ " => Bimodule.rsmul open scoped Bimodule BigOperators theorem Bimodule.lsmul_apply (x a : H₁) (b : H₂) : x •ₗ a ⊗ₜ b = (x * a) ⊗ₜ[R] b := - rfl + by rfl theorem Bimodule.rsmul_apply (a : H₁) (x b : H₂) : a ⊗ₜ b •ᵣ x = a ⊗ₜ[R] (b * x) := - rfl + by rfl theorem Bimodule.lsmul_rsmul_assoc (x : H₁) (y : H₂) (a : H₁ ⊗[R] H₂) : x •ₗ a •ᵣ y = x •ₗ (a •ᵣ y) := by @@ -58,14 +60,14 @@ theorem Bimodule.lsmul_rsmul_assoc (x : H₁) (y : H₂) (a : H₁ ⊗[R] H₂) LinearMap.one_comp, LinearMap.comp_one] theorem Bimodule.lsmul_zero (x : H₁) : x •ₗ (0 : H₁ ⊗[R] H₂) = 0 := - rfl + by rfl theorem Bimodule.zero_lsmul (x : H₁ ⊗[R] H₂) : 0 •ₗ x = 0 := by rw [Bimodule.lsmul, LinearMap.mulLeft_zero_eq_zero, TensorProduct.map_zero_left, LinearMap.zero_apply] theorem Bimodule.zero_rsmul (x : H₂) : (0 : H₁ ⊗[R] H₂) •ᵣ x = 0 := - rfl + by rfl theorem Bimodule.rsmul_zero (x : H₁ ⊗[R] H₂) : x •ᵣ 0 = 0 := by rw [Bimodule.rsmul, LinearMap.mulRight_zero_eq_zero, TensorProduct.map_zero_right, @@ -273,8 +275,7 @@ theorem rmulMapLmul_mem_isBimoduleMaps (x : H₁ ⊗[R] H₂) : rmulMapLmul_apply_one] /-- The tensor product is linearly equivalent to its bimodule endomorphism submodule. -/ -@[simps] -noncomputable def TensorProduct.toIsBimoduleMap +@[expose] noncomputable def TensorProduct.toIsBimoduleMap {R : Type*} {H₁ H₂ : Type*} [CommSemiring R] [Semiring H₁] [Semiring H₂] [Algebra R H₁] [Algebra R H₂] : (H₁ ⊗[R] H₂) ≃ₗ[R] LinearMap.IsBimoduleMaps R H₁ H₂ where @@ -287,3 +288,15 @@ noncomputable def TensorProduct.toIsBimoduleMap simp only congr rw [LinearMap.isBimoduleMap_iff'.mp f.property] + +@[simp] theorem TensorProduct.toIsBimoduleMap_apply_coe + {R : Type*} {H₁ H₂ : Type*} [CommSemiring R] [Semiring H₁] + [Semiring H₂] [Algebra R H₁] [Algebra R H₂] (x : H₁ ⊗[R] H₂) : + ((TensorProduct.toIsBimoduleMap x : LinearMap.IsBimoduleMaps R H₁ H₂) : + l(R, H₁ ⊗[R] H₂)) = rmulMapLmul x := by rfl + +@[simp] theorem TensorProduct.toIsBimoduleMap_symm_apply + {R : Type*} {H₁ H₂ : Type*} [CommSemiring R] [Semiring H₁] + [Semiring H₂] [Algebra R H₁] [Algebra R H₂] + (f : LinearMap.IsBimoduleMaps R H₁ H₂) : + TensorProduct.toIsBimoduleMap.symm f = (f : l(R, H₁ ⊗[R] H₂)) 1 := by rfl diff --git a/LeanPool/Monlib4/LinearAlgebra/MySpec.lean b/LeanPool/Monlib4/LinearAlgebra/MySpec.lean index 7207cb35d6..f368460504 100644 --- a/LeanPool/Monlib4/LinearAlgebra/MySpec.lean +++ b/LeanPool/Monlib4/LinearAlgebra/MySpec.lean @@ -15,7 +15,7 @@ import LeanPool.Monlib4.LinearAlgebra.End This file just proves that the spectrum of a linear map is commutative. -/ -@[expose] public section +public section theorem isUnit_comm (K E : Type _) [DivisionRing K] [AddCommGroup E] [Module K E] diff --git a/LeanPool/Monlib4/LinearAlgebra/Nacgor.lean b/LeanPool/Monlib4/LinearAlgebra/Nacgor.lean index b0401d4d88..6f9ba76e3c 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Nacgor.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Nacgor.lean @@ -14,7 +14,7 @@ This file contains the `NormedAddCommGroupOfRing` class, which bundles the ring structure together with the normed additive commutative group structure. -/ -@[expose] public section +public section open scoped BigOperators @@ -26,7 +26,7 @@ attribute [instance] NormedAddCommGroupOfRing.toRing attribute [instance] NormedAddCommGroupOfRing.toNorm /-- The algebra structure coming from compatible scalar multiplication and multiplication. -/ -@[reducible] +@[expose, reducible] def Algebra.ofIsScalarTowerSmulCommClass {R A : Type*} [CommSemiring R] [Semiring A] [Module R A] [SMulCommClass R A A] [IsScalarTower R A A] : Algebra R A := Algebra.ofModule smul_mul_assoc mul_smul_comm diff --git a/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean b/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean index 2be3de54f8..c22256faad 100644 --- a/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean +++ b/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.OfNorm`. -/ -@[expose] public section +public section open scoped ComplexOrder @@ -202,7 +202,7 @@ def IsContinuousLinearMap.mk' {𝕜 : Type _} [NormedField 𝕜] {E : Type _} [N theorem IsContinuousLinearMap.coe_mk' {𝕜 : Type _} [NormedField 𝕜] {E : Type _} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type _} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {f : E → F} (h : IsContinuousLinearMap 𝕜 f) : f = h.mk' := - rfl + by rfl theorem isBoundedLinearMap_iff_isContinuousLinearMap {𝕜 E : Type _} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type _} [NormedAddCommGroup F] [NormedSpace 𝕜 F] @@ -632,7 +632,7 @@ example {𝕜 X Y Z : Type _} [RCLike 𝕜] [NormedAddCommGroup X] LinearIsometryEquiv.apply_symm_apply] /-- Pull back continuous linear functionals along a continuous linear map. -/ -@[simps] def NormedSpace.Dual.transpose {E F : Type*} (𝕜 : Type*) [RCLike 𝕜] +@[expose, simps] def NormedSpace.Dual.transpose {E F : Type*} (𝕜 : Type*) [RCLike 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] (f : E →L[𝕜] F) : StrongDual 𝕜 F →ₗ[𝕜] StrongDual 𝕜 E := @@ -654,7 +654,7 @@ lemma NormedSpace.Dual.transpose_isometry open NormedSpace in /-- Pull back continuous linear functionals along a linear isometry equivalence. -/ -@[simps] noncomputable def LinearEquiv.transpose {E F : Type*} (𝕜 : Type*) [RCLike 𝕜] +@[expose, simps] noncomputable def LinearEquiv.transpose {E F : Type*} (𝕜 : Type*) [RCLike 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] (f : E ≃ₗᵢ[𝕜] F) : diff --git a/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean b/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean index 1d1a6be6ab..a98b536e04 100644 --- a/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean +++ b/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.PiDirectSum`. -/ -@[expose] public section +public section open scoped TensorProduct @@ -63,6 +63,7 @@ noncomputable def Pi.tensorProj {R : Type _} [CommSemiring R] {ι₁ ι₂ : Typ @LinearMap.proj R ι₁ _ M₁ _ _ i.fst ⊗ₘ @LinearMap.proj R ι₂ _ M₂ _ _ i.snd /-- The coordinatewise map from a tensor product of dependent functions to tensor factors. -/ +@[expose] noncomputable def directSumTensorToFun {R : Type _} [CommSemiring R] {ι₁ : Type _} {ι₂ : Type _} {M₁ : ι₁ → Type _} {M₂ : ι₂ → Type _} [∀ i₁ : ι₁, AddCommGroup (M₁ i₁)] [∀ i₂ : ι₂, AddCommGroup (M₂ i₂)] [∀ i₁ : ι₁, Module R (M₁ i₁)] [∀ i₂ : ι₂, Module R (M₂ i₂)] : @@ -81,7 +82,7 @@ theorem directSumTensorToFun_apply {R : Type _} [CommSemiring R] {ι₁ : Type _ [∀ i₂ : ι₂, AddCommGroup (M₂ i₂)] [∀ i₁ : ι₁, Module R (M₁ i₁)] [∀ i₂ : ι₂, Module R (M₂ i₂)] (x : ∀ i, M₁ i) (y : ∀ i, M₂ i) (i : ι₁ × ι₂) : directSumTensorToFun (x ⊗ₜ[R] y) i = x i.1 ⊗ₜ[R] y i.2 := - rfl + by rfl open scoped BigOperators @@ -171,7 +172,7 @@ theorem directSumTensorToFun_apply_inv_fun {R : Type _} [CommRing R] {ι₁ : Ty /-- Linear equivalence between tensor products of finite dependent products and products of tensor factors. -/ -@[simps] +@[expose, simps] noncomputable def directSumTensor {R : Type _} [CommRing R] {ι₁ : Type _} {ι₂ : Type _} [DecidableEq ι₁] [DecidableEq ι₂] [Fintype ι₁] [Fintype ι₂] {M₁ : ι₁ → Type _} {M₂ : ι₂ → Type _} @@ -210,10 +211,10 @@ theorem directSumTensorToFun.map_one {R : Type _} [CommRing R] {ι₁ : Type _} [∀ i₂ : ι₂, Ring (M₂ i₂)] [∀ i₁ : ι₁, Algebra R (M₁ i₁)] [∀ i₂ : ι₂, Algebra R (M₂ i₂)] : directSumTensorToFun (1 : (∀ i, M₁ i) ⊗[R] ∀ i, M₂ i) = 1 := - rfl + by rfl /-- Algebra equivalence induced by `directSumTensor` for finite dependent products. -/ -@[simps] +@[expose, simps] noncomputable def directSumTensorAlgEquiv (R : Type _) {ι₁ ι₂ : Type _} [CommRing R] [Fintype ι₁] [Fintype ι₂] [DecidableEq ι₁] [DecidableEq ι₂] (M₁ : ι₁ → Type _) (M₂ : ι₂ → Type _) [∀ i₁ : ι₁, Ring (M₁ i₁)] @@ -260,7 +261,7 @@ theorem Pi.tensor_ext {R : Type _} [CommRing R] {ι₁ : Type _} {ι₂ : Type _ simp only [imp_self] /-- Reindex linear maps out of a product-shaped dependent family. -/ -@[simps!] +@[expose, simps!] def LinearMap.piPiProd (R : Type _) {ι₁ ι₂ : Type _} [Semiring R] (φ : ι₁ → Type _) (ψ : ι₂ → Type _) [∀ i, AddCommMonoid (φ i)] [∀ i, Module R (φ i)] [∀ i, AddCommMonoid (ψ i)] [∀ i, Module R (ψ i)] (S : Type _) [Semiring S] @@ -275,7 +276,7 @@ def LinearMap.piPiProd (R : Type _) {ι₁ ι₂ : Type _} [Semiring R] (φ : ι right_inv _ := rfl /-- Swap the two function arguments in a doubly-indexed family of linear maps. -/ -@[simps!] +@[expose, simps!] def LinearMap.piProdSwap (R : Type _) {ι₁ ι₂ : Type _} [Semiring R] (φ : ι₁ → Type _) (ψ : ι₂ → Type _) [∀ i, AddCommMonoid (φ i)] [∀ i, Module R (φ i)] [∀ i, AddCommMonoid (ψ i)] [∀ i, Module R (ψ i)] (S : Type _) [Semiring S] @@ -290,7 +291,7 @@ def LinearMap.piProdSwap (R : Type _) {ι₁ ι₂ : Type _} [Semiring R] (φ : right_inv _ := rfl /-- Linear equivalence between maps into a dependent product and dependent products of maps. -/ -@[simps!] +@[expose, simps!] def LinearMap.rsum (R : Type _) {M : Type _} {ι : Type _} [Semiring R] (φ : ι → Type _) [∀ i : ι, AddCommMonoid (φ i)] [∀ i : ι, Module R (φ i)] (S : Type _) [AddCommMonoid M] [Module R M] [Semiring S] [∀ i, Module S (φ i)] [∀ i, SMulCommClass R S (φ i)] : @@ -307,7 +308,7 @@ def LinearMap.rsum (R : Type _) {M : Type _} {ι : Type _} [Semiring R] (φ : ι simp_all /-- Combine `piPiProd`, `piProdSwap`, `lsum`, and `rsum` into a two-sided reindexing equivalence. -/ -@[simps!] +@[expose, simps!] def LinearMap.lrsum (R : Type _) {ι₁ ι₂ : Type _} [Semiring R] (φ : ι₁ → Type _) (ψ : ι₂ → Type _) [∀ i, AddCommMonoid (φ i)] [∀ i, Module R (φ i)] [∀ i, AddCommMonoid (ψ i)] [∀ i, Module R (ψ i)] (S : Type _) [Fintype ι₁] [DecidableEq ι₁] [Semiring S] diff --git a/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean b/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean index 4f5b2530c6..5011538aba 100644 --- a/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean +++ b/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow This file contains the definition of `pi.star_ordered_ring`. -/ -@[expose] public section +public section /-- Coordinate projection of a set of dependent functions along `Pi.single`. -/ def Set.ofPi {ι : Type _} {B : ι → Type _} [DecidableEq ι] [∀ i, Zero (B i)] (s : Set (∀ i, B i)) : diff --git a/LeanPool/Monlib4/LinearAlgebra/PosMapIsReal.lean b/LeanPool/Monlib4/LinearAlgebra/PosMapIsReal.lean index d76070dd1c..967ce0fc55 100644 --- a/LeanPool/Monlib4/LinearAlgebra/PosMapIsReal.lean +++ b/LeanPool/Monlib4/LinearAlgebra/PosMapIsReal.lean @@ -24,14 +24,14 @@ import Mathlib.Analysis.InnerProductSpace.StarOrder Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.PosMapIsReal`. -/ -@[expose] public section +public section variable {A : Type _} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] [PartialOrder A] [_root_.StarOrderedRing A] /-- we say a map $f \colon M_1 \to M_2$ is a positive map if for all positive $x \in M_1$, we also get $f(x)$ is positive -/ -def LinearMap.IsPosMap +@[expose] def LinearMap.IsPosMap {M₁ M₂ : Type*} [Zero M₁] [Zero M₂] [PartialOrder M₁] [PartialOrder M₂] {F : Type*} [FunLike F M₁ M₂] (f : F) : Prop := ∀ ⦃x : M₁⦄, 0 ≤ x → 0 ≤ f x @@ -115,14 +115,14 @@ lemma ContinuousLinearMap.toLinearMapAlgEquiv_apply [InnerProductSpace 𝕜 B] [FiniteDimensional 𝕜 B] (f : B →L[𝕜] B) : ContinuousLinearMap.toLinearMapAlgEquiv f = f.toLinearMap := -rfl +by rfl lemma ContinuousLinearMap.toLinearMapAlgEquiv_symm_apply {𝕜 B : Type*} [RCLike 𝕜] [NormedAddCommGroup B] [InnerProductSpace 𝕜 B] [FiniteDimensional 𝕜 B] (f : B →ₗ[𝕜] B) : ContinuousLinearMap.toLinearMapAlgEquiv.symm f = LinearMap.toContinuousLinearMap f := -rfl +by rfl theorem ContinuousLinearMap.spectrum_coe {𝕜 B : Type*} [RCLike 𝕜] [NormedAddCommGroup B] [InnerProductSpace 𝕜 B] [FiniteDimensional 𝕜 B] (T : B →L[𝕜] B) : diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet.lean index fbc621e457..c5db5b7217 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet.lean @@ -23,4 +23,4 @@ public import LeanPool.Monlib4.LinearAlgebra.QuantumSet.TensorProduct Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.QuantumSet`. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean index f02b5df07d..ceb00faffe 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean @@ -30,7 +30,7 @@ comultiplication on `ℂ`, and the `Psi`/`Upsilon` equivalences used by downstream quantum-graph files. -/ -@[expose] public section +public section /-- A star algebra over `ℂ` equipped with a real-parameter modular automorphism group. -/ class starAlgebra (A : Type _) extends @@ -278,7 +278,7 @@ theorem QuantumSet.modAut_isCoalgHom and_true, Algebra.algebraMap_eq_smul_one, map_smul, map_one] /-- A quantum set carries the Frobenius algebra structure induced by its coalgebra. -/ -@[reducible, instance] +@[expose, reducible, instance] noncomputable def QuantumSet.isFrobeniusAlgebra [QuantumSet A] : FrobeniusAlgebra ℂ A := FiniteDimensionalCoAlgebraIsFrobeniusAlgebraOf @@ -297,13 +297,7 @@ theorem lmul_adjoint [hB : QuantumSet B] (a : B) : lemma QuantumSet.inner_eq_counit' [QuantumSet B] : (⟪(1 : B), ·⟫_ℂ) = Coalgebra.counit := by - simp_rw [Coalgebra.counit] - ext - apply ext_inner_left ℂ - intro a - simp_rw [LinearMap.adjoint_inner_right, Algebra.linearMap_apply, - Algebra.algebraMap_eq_smul_one, inner_smul_left] - rw [RCLike.inner_apply'] + exact Coalgebra.inner_eq_counit' lemma QuantumSet.inner_eq_counit [QuantumSet B] (x y : B) : ⟪x, y⟫_ℂ = Coalgebra.counit (star x * modAut (k B) y) := by @@ -430,7 +424,6 @@ theorem Psi_right_inv [hA : QuantumSet A] [hB : QuantumSet B] simp_all /-- The linear equivalence between maps and tensors used in the quantum-set formalism. -/ -@[simps] noncomputable def Psi [hA : QuantumSet A] [hB : QuantumSet B] (t r : ℝ) : (A →ₗ[ℂ] B) ≃ₗ[ℂ] (B ⊗[ℂ] Aᵐᵒᵖ) where toFun x := PsiToFun t r x @@ -445,6 +438,16 @@ noncomputable def Psi [hA : QuantumSet A] [hB : QuantumSet B] map_smul' r x := by simp_all +@[simp] +theorem Psi_apply [QuantumSet A] [QuantumSet B] (t r : ℝ) (x : A →ₗ[ℂ] B) : + Psi t r x = PsiToFun t r x := by + rfl + +@[simp] +theorem Psi_symm_apply [QuantumSet A] [QuantumSet B] (t r : ℝ) (x : B ⊗[ℂ] Aᵐᵒᵖ) : + (Psi t r).symm x = PsiInvFun (A := B) (B := A) t r x := by + rfl + end QuantumSet open QuantumSet @@ -793,11 +796,25 @@ theorem QuantumSet.Psi_symm_apply_one [QuantumSet A] [QuantumSet B] (t r : ℝ) rw [← QuantumSet.Psi_apply_one_one t r, LinearEquiv.symm_apply_apply] /-- The `Psi` equivalence with tensor factors swapped back from the opposite space. -/ -@[simps! -isSimp] noncomputable abbrev Upsilon [QuantumSet A] [QuantumSet B] : (A →ₗ[ℂ] B) ≃ₗ[ℂ] (A ⊗[ℂ] B) := (Psi 0 (k A + 1)).trans ((tenSwap ℂ).trans (LinearEquiv.lTensor _ (unop ℂ))) +theorem Upsilon_apply [QuantumSet A] [QuantumSet B] (x : A →ₗ[ℂ] B) : + Upsilon x = + (LinearEquiv.lTensor A (unop ℂ)) + ((LinearEquiv.TensorProduct.map (unop ℂ) (op ℂ)) + ((TensorProduct.comm ℂ B Aᵐᵒᵖ) (PsiToFun 0 (k A + 1) x))) := by + rfl + +theorem Upsilon_symm_apply [QuantumSet A] [QuantumSet B] (x : A ⊗[ℂ] B) : + Upsilon.symm x = + PsiInvFun (A := B) (B := A) 0 (k A + 1) + ((TensorProduct.comm ℂ Aᵐᵒᵖ B) + ((LinearEquiv.TensorProduct.map (op ℂ) (unop ℂ)) + ((LinearEquiv.lTensor A (op ℂ)) x))) := by + rfl + theorem Upsilon_apply_one_one [QuantumSet A] [QuantumSet B] : Upsilon (rankOne ℂ (1 : B) (1 : A)) = (1 : A ⊗[ℂ] B) := by rw [Upsilon, LinearEquiv.trans_apply, QuantumSet.Psi_apply_one_one] @@ -942,7 +959,7 @@ private lemma rmulMapLmul_apply_Upsilon_aux_apply [QuantumSet A] [QuantumSet B] lemma Upsilon_rankOne [QuantumSet A] [QuantumSet B] (a : A) (b : B) : Upsilon (rankOne ℂ a b).toLinearMap = (modAut (-k B - 1) (star b)) ⊗ₜ[ℂ] a := by rw [Upsilon_apply, QuantumSet.PsiToFun_apply, TensorProduct.comm_tmul, - TensorProduct.map_tmul, LinearEquiv.lTensor_tmul, starAlgebra.modAut_star, + LinearEquiv.TensorProduct.map_tmul, LinearEquiv.lTensor_tmul, starAlgebra.modAut_star, starAlgebra.modAut_zero] ring_nf rfl @@ -952,7 +969,7 @@ lemma Upsilon_symm_tmul [QuantumSet A] [QuantumSet B] (a : A) (b : B) : (rankOne ℂ b (modAut (-k A - 1) (star a))).toLinearMap := by rw [Upsilon_symm_apply] simp only [LinearEquiv.lTensor_tmul, op_apply, - TensorProduct.map_tmul, LinearEquiv.coe_coe, unop_apply, MulOpposite.unop_op, + LinearEquiv.TensorProduct.map_tmul, unop_apply, MulOpposite.unop_op, TensorProduct.comm_tmul, QuantumSet.PsiInvFun_apply, starAlgebra.modAut_zero, neg_zero] ring_nf rfl @@ -993,4 +1010,4 @@ lemma rmulMapLmul_apply_Upsilon_eq [QuantumSet A] [QuantumSet B] (x : A →ₗ[ nth_rw 2 [QuantumSet.inner_conj_left] simp_rw [starAlgebra.modAut_star, modAut_apply_modAut, star_star, add_neg_cancel, starAlgebra.modAut_zero] - rfl + simp [lmul_apply] diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/DeltaForm.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/DeltaForm.lean index 27f289e60a..6083a7d995 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/DeltaForm.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/DeltaForm.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.QuantumSet.DeltaForm`. -/ -@[expose] public section +public section open scoped ComplexOrder diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Instances.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Instances.lean index 0f28eec414..91f768c884 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Instances.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Instances.lean @@ -16,7 +16,7 @@ import LeanPool.Monlib4.RepTheory.AutMat Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.QuantumSet.Instances`. -/ -@[expose] public section +public section -- import LeanPool.Monlib4.LinearAlgebra.Ips.Frob variable {n : Type*} [Fintype n] [DecidableEq n] {φ : Module.Dual ℂ (Matrix n n ℂ)} @@ -339,7 +339,7 @@ theorem Module.Dual.pi_isTracial_iff {k : Type*} [Fintype k] simp [h _ _] /-- The modular star-algebra structure on matrices induced by a faithful positive functional. -/ -@[reducible] +@[reducible, expose] noncomputable def Matrix.isStarAlgebra [hφ : φ.IsFaithfulPosMap] : starAlgebra (Matrix n n ℂ) where modAut := sig hφ @@ -349,7 +349,7 @@ noncomputable def Matrix.isStarAlgebra [hφ : φ.IsFaithfulPosMap] : neg_neg, (Matrix.PosDef.rpow.isPosDef _ _).1.eq, mul_assoc] -@[reducible, instance] +@[reducible, instance, expose] noncomputable def Module.Dual.IsFaithfulPosMap.innerProductAlgebra [hφ : φ.IsFaithfulPosMap] : @InnerProductAlgebra (Matrix n n ℂ) (Matrix.isStarAlgebra (φ := φ)) := by letI : starAlgebra (Matrix n n ℂ) := Matrix.isStarAlgebra (φ := φ) @@ -365,7 +365,7 @@ noncomputable def Module.Dual.IsFaithfulPosMap.innerProductAlgebra [hφ : φ.IsF add_left := inner_add_left smul_left := inner_smul_left } -@[reducible, instance] +@[reducible, instance, expose] noncomputable def Module.Dual.IsFaithfulPosMap.quantumSet [hφ : φ.IsFaithfulPosMap] : @QuantumSet (Matrix n n ℂ) (Matrix.isStarAlgebra (φ := φ)) := by @@ -419,6 +419,7 @@ variable {p : Type*} [Fintype p] [DecidableEq p] {ψ : Module.Dual ℂ (Matrix p p ℂ)} /-- Matrix-specialized `Psi` equivalence for faithful positive functionals. -/ +@[expose] noncomputable def Module.Dual.IsFaithfulPosMap.psi (hφ : φ.IsFaithfulPosMap) [hψ : ψ.IsFaithfulPosMap] (t r : ℝ) : (Matrix n n ℂ →ₗ[ℂ] Matrix p p ℂ) ≃ₗ[ℂ] @@ -440,6 +441,7 @@ variable {k : Type*} [Fintype k] [DecidableEq k] {s : k → Type*} [Π i, Fintyp /-- Apply the modular automorphism to each matrix block in a family. -/ +@[expose] noncomputable def piSig (hψ : ∀ i, (ψ i).IsFaithfulPosMap) (z : ℝ) : PiMat ℂ k s ≃ₐ[ℂ] PiMat ℂ k s where toFun x i := sig (hψ i) z (x i) @@ -487,7 +489,7 @@ private theorem piSig_star (hψ : ∀ i, (ψ i).IsFaithfulPosMap) mul_assoc] /-- The modular star-algebra structure on a finite product of matrix blocks. -/ -@[reducible] +@[reducible, expose] noncomputable def PiMat.isStarAlgebra [_hψ : ∀ i, (ψ i).IsFaithfulPosMap] : starAlgebra (PiMat ℂ k s) where modAut := piSig _hψ @@ -496,7 +498,7 @@ noncomputable def PiMat.isStarAlgebra [_hψ : ∀ i, (ψ i).IsFaithfulPosMap] : -- attribute [-instance] Pi.module.Dual.isNormedAddCommGroupOfRing -@[reducible, instance] +@[reducible, instance, expose] noncomputable def Module.Dual.pi.IsFaithfulPosMap.innerProductAlgebra [∀ i, (ψ i).IsFaithfulPosMap] : @@ -695,7 +697,7 @@ def Matrix.quantumSetDeltaForm [Nonempty n] {φ : Module.Dual ℂ (Matrix n n mul_comp_comul_eq := LinearMap.mul'_comp_mul'_adjoint_of_delta_form (φ := φ) } /-- The delta-form quantum-set structure for a finite product of matrix algebras. -/ -@[reducible] +@[reducible, expose] noncomputable def PiMat.quantumSetDeltaForm [Nonempty k] [∀ i, Nontrivial (s i)] {d : ℂ} {φ : Π i, Module.Dual ℂ (Matrix (s i) (s i) ℂ)} [hφ : ∀ i, (φ i).IsFaithfulPosMap] [hφ₂ : Fact (∀ i, (φ i).matrix⁻¹.trace = d)] : diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/PhiMap.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/PhiMap.lean index 66d79e2510..4aab770dad 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/PhiMap.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/PhiMap.lean @@ -19,7 +19,7 @@ equivalence and records the one-vector inner-product identities used by downstream quantum graph files. -/ -@[expose] public section +public section /-- The `Upsilon` equivalence viewed through the tensor-product bimodule map API. -/ noncomputable abbrev PhiMap {A B : Type*} [starAlgebra B] [starAlgebra A] [QuantumSet A] diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Pi.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Pi.lean index a65e544915..f22f8b448e 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Pi.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Pi.lean @@ -17,7 +17,7 @@ This file restores the finite-product quantum set instance from upstream `Monlib.LinearAlgebra.QuantumSet.Pi`. -/ -@[expose] public section +public section open scoped BigOperators InnerProductSpace @@ -81,9 +81,9 @@ noncomputable def Pi.modAut (r : ℝ) : PiQ A ≃ₐ[ℂ] PiQ A := @[simp] lemma Pi.modAut_apply (r : ℝ) (x : PiQ A) (i : ι) : Pi.modAut r x i = (hA i).modAut r (x i) := - rfl + by rfl -@[reducible, instance] +@[expose, reducible, instance] noncomputable def piStarAlgebra : starAlgebra (PiQ A) where modAut r := Pi.modAut r modAut_trans r s := by @@ -96,14 +96,15 @@ noncomputable def piStarAlgebra : starAlgebra (PiQ A) where @[simp] lemma piStarAlgebra_modAut_apply (r : ℝ) (x : PiQ A) (i : ι) : piStarAlgebra.modAut r x i = (hA i).modAut r (x i) := - rfl + by rfl variable [hQ : (i : ι) -> QuantumSet (A i)] variable [Fintype ι] -noncomputable instance piInnerProductAlgebra : InnerProductAlgebra (PiQ A) where - norm_smul_le := norm_smul_le - norm_sq_eq_inner := norm_sq_eq_re_inner +@[expose, instance_reducible] noncomputable def piInnerProductAlgebra : + InnerProductAlgebra (PiQ A) where + norm_smul_le c x := NormedSpace.norm_smul_le (𝕜 := ℂ) (E := PiQ A) c x + norm_sq_eq_inner x := norm_sq_eq_re_inner (𝕜 := ℂ) x dist_eq x y := by rw [dist_eq_norm'] congr 1 @@ -113,6 +114,8 @@ noncomputable instance piInnerProductAlgebra : InnerProductAlgebra (PiQ A) where add_left := inner_add_left smul_left := inner_smul_left +attribute [instance] piInnerProductAlgebra + theorem piInnerProductAlgebra_inner_apply (a b : PiQ A) : ⟪a, b⟫_ℂ = ∑ i, ⟪a i, b i⟫_ℂ := by rw [PiLp.inner_apply] @@ -122,6 +125,7 @@ theorem piInnerProductAlgebra.inner_apply (a b : PiQ A) : piInnerProductAlgebra_inner_apply a b noncomputable instance Pi.quantumSet [Fact (∀ i, (hQ i).k = 0)] : QuantumSet (PiQ A) where + toInnerProductAlgebra := piInnerProductAlgebra modAut_isSymmetric r x y := by rw [piInnerProductAlgebra_inner_apply, piInnerProductAlgebra_inner_apply] simp_all diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean index e633ddab86..9d183048e7 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.QuantumSet.QIso`. -/ -@[expose] public section +public section local notation "lT" => LinearMap.lTensor local notation "rT" => LinearMap.rTensor @@ -466,13 +466,13 @@ lemma QFun.qBijective.toLinearEquiv_toLinearMap {P : (B₁ ⊗[ℂ] H) →ₗ[ℂ] (H ⊗[ℂ] B₂)} [hp : QFun H P] (h : hp.qBijective) : h.toLinearEquiv.toLinearMap = P := -rfl +by rfl lemma QFun.qBijective.toLinearEquiv_symm_toLinearMap {P : (B₁ ⊗[ℂ] H) →ₗ[ℂ] (H ⊗[ℂ] B₂)} [hp : QFun H P] (h : hp.qBijective) : h.toLinearEquiv.symm.toLinearMap = LinearMap.adjoint P := -rfl +by rfl theorem QFun.qBijective_iso_id {P : (B₁ ⊗[ℂ] H) →ₗ[ℂ] (H ⊗[ℂ] B₂)} [hp : QFun H P] (h : hp.qBijective) : diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean index 9a0f355bf1..1d324212c6 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean @@ -21,7 +21,7 @@ Hilbert-algebra coalgebra instance and tensor-product infrastructure that are no in the current monlib4 slice. -/ -@[expose] public section +public section open scoped TensorProduct BigOperators @@ -31,8 +31,7 @@ local notation x " ⊗ₘ " y => TensorProduct.map x y open Coalgebra /-- Schur product `x •ₛ y := m ∘ (x ⊗ y) ∘ comul`. -/ -@[simps] -noncomputable def schurMul {B C : Type*} +@[expose] noncomputable def schurMul {B C : Type*} [AddCommMonoid B] [NonUnitalNonAssocSemiring C] [Module ℂ B] [Module ℂ C] [CoalgebraStruct ℂ B] [SMulCommClass ℂ C C] [IsScalarTower ℂ C C] : @@ -53,6 +52,13 @@ noncomputable def schurMul {B C : Type*} LinearMap.ext_iff, LinearMap.smul_apply, LinearMap.coe_mk, RingHom.id_apply] simp_all +@[simp] theorem schurMul_apply_apply {B C : Type*} + [AddCommMonoid B] [NonUnitalNonAssocSemiring C] + [Module ℂ B] [Module ℂ C] [CoalgebraStruct ℂ B] + [SMulCommClass ℂ C C] [IsScalarTower ℂ C C] + (x y : B →ₗ[ℂ] C) : + schurMul x y = (m C) ∘ₗ (x ⊗ₘ y) ∘ₗ comul := by rfl + @[inherit_doc schurMul] notation3:80 (name := schurMulNotation) x:81 " •ₛ " y:80 => schurMul x y @@ -214,7 +220,7 @@ theorem schurMul_one_right_rankOne (a b : A) : apply Finset.sum_congr rfl intro i _ rw [schurMul.apply_rankOne, LinearMap.rankOne_comp', LinearMap.comp_rankOne] - rfl + simp only [lmul_apply] · rfl theorem schurMul_one_left_rankOne (a b : A) : @@ -226,7 +232,7 @@ theorem schurMul_one_left_rankOne (a b : A) : apply Finset.sum_congr rfl intro i _ rw [schurMul.apply_rankOne, LinearMap.rankOne_comp', LinearMap.comp_rankOne] - rfl + simp only [rmul_apply] · rfl theorem schurMul_adjoint (x y : A →ₗ[ℂ] B) : diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMulTensor.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMulTensor.lean index b87751730b..c7507d70be 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMulTensor.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMulTensor.lean @@ -17,7 +17,7 @@ This file relates Schur multiplication on tensor-product coalgebras to the fourfold tensor shuffle used by the Monlib4 quantum-set tensor product. -/ -@[expose] public section +public section open scoped TensorProduct diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Subset.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Subset.lean index 5b22c090e2..960fa0c83f 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Subset.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Subset.lean @@ -17,15 +17,15 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.QuantumSet.Subset`. -/ -@[expose] public section +public section /-- Type synonym for a quantum set with its modular exponent shifted to `k`. -/ -def QuantumSet.toSubset (k : ℝ) (A : Type*) : Type _ := +@[expose] def QuantumSet.toSubset (k : ℝ) (A : Type*) : Type _ := let _ : ℝ := k A /-- The tautological equivalence from a type to its shifted quantum-set synonym. -/ -def QuantumSet.toSubsetEquiv (k : ℝ) {A : Type*} : +@[expose] def QuantumSet.toSubsetEquiv (k : ℝ) {A : Type*} : A ≃ QuantumSet.toSubset k A := Equiv.refl _ /-- Abbreviation for the shifted quantum-set type synonym. -/ @@ -42,7 +42,7 @@ instance {A : Type*} [Star A] [SMul ℂ A] [h : StarModule ℂ A] : StarModule ℂ (QuantumSet.subset new_k A) := h /-- The tautological algebra equivalence from a type to its shifted quantum-set synonym. -/ -def QuantumSet.toSubsetAlgEquiv (k : ℝ) {A : Type*} [Ring A] [Algebra ℂ A] : +@[expose] def QuantumSet.toSubsetAlgEquiv (k : ℝ) {A : Type*} [Ring A] [Algebra ℂ A] : A ≃ₐ[ℂ] QuantumSet.subset k A := AlgEquiv.refl lemma QuantumSet.toSubsetAlgEquiv_eq_toSubsetEquiv {A : Type*} [Ring A] [Algebra ℂ A] @@ -74,7 +74,7 @@ lemma QuantumSet.subsetStarAlgebra_modAut_apply'' (r : ℝ) (x : QuantumSet.subs ((ha.modAut r ((toSubsetEquiv new_k).symm x : A)) : A) := rfl /-- The normed additive group structure induced by shifting the quantum-set inner product. -/ -@[reducible] +@[expose, reducible] noncomputable def QuantumSet.subsetNormedAddCommGroup [hA : QuantumSet A] (new_k : ℝ) : letI : starAlgebra (QuantumSet.subset new_k A) := QuantumSet.subsetStarAlgebra new_k @@ -97,7 +97,7 @@ noncomputable def QuantumSet.subsetNormedAddCommGroup [hA : QuantumSet A] add_left := fun _ _ _ => by simp only [← inner_add_left]; rfl smul_left := fun _ _ _ => by simp only [← inner_smul_left]; rfl } /-- The inner product space structure induced by shifting the quantum-set inner product. -/ -@[reducible] +@[expose, reducible] noncomputable def QuantumSet.subsetInnerProductSpace (hA : QuantumSet A) (new_k : ℝ) : letI := hA.subsetNormedAddCommGroup new_k InnerProductSpace ℂ (subset new_k A) := @@ -106,7 +106,7 @@ InnerProductSpace.ofCore _ /-- The inner product algebra structure induced by shifting the quantum-set inner product. -/ -@[reducible] +@[expose, reducible] noncomputable def QuantumSet.subsetInnerProductAlgebra (hA : QuantumSet A) (new_k : ℝ) : letI : starAlgebra (subset new_k A) := QuantumSet.subsetStarAlgebra new_k @@ -127,7 +127,7 @@ lemma QuantumSet.subset_inner_eq [hA : QuantumSet A] (new_k : ℝ) (x y : subset (hA.subsetInnerProductAlgebra new_k).inner x y = hA.inner ((toSubsetEquiv new_k).symm x : A) (ha.modAut (new_k + -hA.k) ((toSubsetEquiv new_k).symm y)) := -rfl +by rfl lemma QuantumSet.inner_eq_subset_inner [hA : QuantumSet A] (new_k : ℝ) (x y : A) : letI : starAlgebra (subset new_k A) := QuantumSet.subsetStarAlgebra _ hA.inner x y @@ -138,8 +138,8 @@ lemma QuantumSet.inner_eq_subset_inner [hA : QuantumSet A] (new_k : ℝ) (x y : open scoped InnerProductSpace /-- A shifted quantum-set synonym inherits a quantum-set structure with exponent `new_k`. -/ -@[reducible] -noncomputable def QuantumSet.instSubset (hA : QuantumSet A) (new_k : ℝ) : +@[expose, reducible] noncomputable def QuantumSet.instSubset + (hA : QuantumSet A) (new_k : ℝ) : letI : starAlgebra (subset new_k A) := QuantumSet.subsetStarAlgebra _ QuantumSet (subset new_k A) := letI st : starAlgebra (subset new_k A) := QuantumSet.subsetStarAlgebra _ @@ -256,7 +256,7 @@ theorem QuantumSet.toSubsetAlgEquiv_symm_adjoint [hA : QuantumSet A] (sk₁ : open QuantumSet in lemma LinearMap.toSubsetQuantumSet_apply {B : Type*} [starAlgebra B] [QuantumSet A] [QuantumSet B] (f : A →ₗ[ℂ] B) (sk₁ sk₂ : ℝ) (x : subset sk₁ A) : - f.toSubsetQuantumSet sk₁ sk₂ x = toSubsetEquiv sk₂ (f ((toSubsetEquiv sk₁).symm x)) := rfl + f.toSubsetQuantumSet sk₁ sk₂ x = toSubsetEquiv sk₂ (f ((toSubsetEquiv sk₁).symm x)) := by rfl open QuantumSet in theorem LinearMap.toSubsetQuantumSet_adjoint_apply {B : Type*} [hb : starAlgebra B] @@ -323,13 +323,13 @@ theorem rankOne_ofSubsetQuantumSet {B : Type*} [starAlgebra B] theorem QuantumSet.subset_k {A : Type*} [starAlgebra A] [h : QuantumSet A] (r : ℝ) : letI := QuantumSet.instSubset h r k (QuantumSet.subset r A) = r := -rfl +by rfl @[simp] theorem QuantumSet.subset_n {A : Type*} [starAlgebra A] [h : QuantumSet A] (r : ℝ) : letI := QuantumSet.instSubset h r n (QuantumSet.subset r A) = n A := -rfl +by rfl open scoped TensorProduct /-- The tautological algebra equivalence between tensor products of shifted synonyms. -/ @@ -345,14 +345,14 @@ theorem QuantumSet.subsetTensorAlgEquiv_tmul {A B : Type*} [starAlgebra A] [star (QuantumSet.subsetTensorAlgEquiv (A := A) (B := B) r) (x ⊗ₜ[ℂ] y) = QuantumSet.toSubsetAlgEquiv r ((QuantumSet.toSubsetAlgEquiv r).symm x ⊗ₜ[ℂ] (QuantumSet.toSubsetAlgEquiv r).symm y) := -rfl +by rfl theorem QuantumSet.subsetTensorAlgEquiv_symm_tmul {A B : Type*} [starAlgebra A] [starAlgebra B] (r : ℝ) (a : A) (b : B) : (QuantumSet.subsetTensorAlgEquiv (A := A) (B := B) r).symm (QuantumSet.toSubsetAlgEquiv r (a ⊗ₜ[ℂ] b)) = (QuantumSet.toSubsetAlgEquiv r) ((QuantumSet.toSubsetAlgEquiv r a) ⊗ₜ[ℂ] (QuantumSet.toSubsetAlgEquiv r b)) := -rfl +by rfl theorem LinearMap.mul'_quantumSet_subset_eq {A : Type*} [starAlgebra A] [QuantumSet A] (r : ℝ) : @@ -489,7 +489,11 @@ theorem QuantumSet.toSubset_onb (r : ℝ) (i : n A) : this.onb i = toSubsetAlgEquiv r (modAut ((k A / 2) + -(r / 2)) (hA.onb i)) := by let := hA.instSubset r - simp [onb] + have hsingle : hA.onb.repr.symm + ((WithLp.linearEquiv 2 ℂ (n A → ℂ)).symm (Pi.single i 1)) = hA.onb i := by + change hA.onb.repr.symm (EuclideanSpace.single i (1 : ℂ)) = hA.onb i + exact hA.onb.repr_symm_single i + simp [onb, hsingle] lemma QuantumSet.comul_of_subset (r : ℝ) : letI := hA.instSubset r; diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean index f428b541b8..46f6f53cf6 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean @@ -21,10 +21,10 @@ This file restores the upstream symmetry map on linear maps between quantum sets, together with its interaction with modular automorphisms and `Psi`. -/ -@[expose] public section +public section /-- The symmetry map sends a linear map to the adjoint of its real conjugate. -/ -@[simps] +@[expose] noncomputable def symmMap (R : Type _) [RCLike R] (M₁ M₂ : Type _) [NormedAddCommGroup M₁] [NormedAddCommGroup M₂] [InnerProductSpace R M₁] [InnerProductSpace R M₂] [StarAddMonoid M₁] @@ -41,6 +41,20 @@ noncomputable def symmMap (R : Type _) [RCLike R] (M₁ M₂ : Type _) [NormedAd simp only [LinearMap.real_smul, LinearMap.adjoint_smul, starRingEnd_self_apply, RingHom.id_apply] +@[simp] theorem symmMap_apply (R : Type _) [RCLike R] (M₁ M₂ : Type _) + [NormedAddCommGroup M₁] [NormedAddCommGroup M₂] + [InnerProductSpace R M₁] [InnerProductSpace R M₂] + [StarAddMonoid M₁] [StarAddMonoid M₂] [StarModule R M₁] [StarModule R M₂] + [FiniteDimensional R M₁] [FiniteDimensional R M₂] (f : M₁ →ₗ[R] M₂) : + symmMap R M₁ M₂ f = LinearMap.adjoint (LinearMap.real f) := by rfl + +@[simp] theorem symmMap_symm_apply (R : Type _) [RCLike R] (M₁ M₂ : Type _) + [NormedAddCommGroup M₁] [NormedAddCommGroup M₂] + [InnerProductSpace R M₁] [InnerProductSpace R M₂] + [StarAddMonoid M₁] [StarAddMonoid M₂] [StarModule R M₁] [StarModule R M₂] + [FiniteDimensional R M₁] [FiniteDimensional R M₂] (f : M₂ →ₗ[R] M₁) : + (symmMap R M₁ M₂).symm f = (LinearMap.adjoint f).real := by rfl + theorem symmMap_real {R : Type _} [RCLike R] {M : Type _} [NormedAddCommGroup M] [InnerProductSpace R M] [StarAddMonoid M] [StarModule R M] [FiniteDimensional R M] : LinearMap.real (symmMap R M M : (M →ₗ[R] M) →ₗ[R] M →ₗ[R] M) = diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean index f8c1ee3ac3..5ebb7b186b 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean @@ -18,7 +18,7 @@ This file restores the upstream tensor-product quantum-set instance and the fourfold tensor-shuffle lemmas used by later quantum-graph files. -/ -@[expose] public section +public section variable {A : Type*} [ha : starAlgebra A] {B : Type*} [hb : starAlgebra B] @@ -161,7 +161,7 @@ lemma swapMiddleTensor_tmul_apply (x : A) (y : B) (z : C) (w : D) : swapMiddleTensor R A B C D ((x ⊗ₜ[R] y) ⊗ₜ[R] (z ⊗ₜ[R] w)) = (x ⊗ₜ z) ⊗ₜ (y ⊗ₜ w) := - rfl + by rfl @[simp] lemma swapMiddleTensor_symm @@ -169,7 +169,7 @@ lemma swapMiddleTensor_symm [AddCommMonoid A] [AddCommMonoid B] [AddCommMonoid C] [AddCommMonoid D] [Module R A] [Module R B] [Module R C] [Module R D] : (swapMiddleTensor R A B C D).symm = swapMiddleTensor R A C B D := - rfl + by rfl lemma swapMiddleTensor_comp_map {R : Type*} [CommSemiring R] {A B C D E F G H : Type*} diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct.lean index cad05d9777..e7cba82d36 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct.lean @@ -18,4 +18,4 @@ import Mathlib.Analysis.SpecialFunctions.Bernstein Import-only index for the `TensorProduct` directory of the monlib4 import. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean index 5f4561834e..8aec340c34 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean @@ -13,7 +13,7 @@ import Mathlib.LinearAlgebra.Basis.VectorSpace # Some lemmas about `tensor_product` -/ -@[expose] public section +public section open scoped TensorProduct BigOperators diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean index 111eb9e71f..d87ffe74ff 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean @@ -18,7 +18,7 @@ star modules and proves compatibility lemmas for tensor-product maps. -/ -@[expose] public section +public section open scoped TensorProduct BigOperators @@ -160,6 +160,7 @@ StarAlgEquiv.ofAlgEquiv (fun _ _ h1 h2 => by simp only [star_add, map_add, h1, h2])) /-- Tensor a pair of star algebra equivalences. -/ +@[expose] noncomputable def StarAlgEquiv.TensorProduct.map {R A B C D : Type*} [RCLike R] [Ring A] [Ring B] [Ring C] [Ring D] [Algebra R A] [Algebra R B] [Algebra R C] [Algebra R D] @@ -180,20 +181,20 @@ theorem StarAlgEquiv.TensorProduct.map_tmul {R A B C D : Type*} [RCLike R] [StarAddMonoid A] [StarAddMonoid B] [StarAddMonoid C] [StarAddMonoid D] [StarModule R A] [StarModule R B] [StarModule R C] [StarModule R D] (f : A ≃⋆ₐ[R] B) (g : C ≃⋆ₐ[R] D) (x : A) (y : C) : - (StarAlgEquiv.TensorProduct.map f g) (x ⊗ₜ[R] y) = f x ⊗ₜ g y := -rfl + (StarAlgEquiv.TensorProduct.map f g) (x ⊗ₜ[R] y) = f x ⊗ₜ g y := by + rfl theorem StarAlgEquiv.TensorProduct.map_symm_tmul {R A B C D : Type*} [RCLike R] [Ring A] [Ring B] [Ring C] [Ring D] [Algebra R A] [Algebra R B] [Algebra R C] [Algebra R D] [StarAddMonoid A] [StarAddMonoid B] [StarAddMonoid C] [StarAddMonoid D] [StarModule R A] [StarModule R B] [StarModule R C] [StarModule R D] (f : A ≃⋆ₐ[R] B) (g : C ≃⋆ₐ[R] D) (x : B) (y : D) : - (StarAlgEquiv.TensorProduct.map f g).symm (x ⊗ₜ[R] y) = f.symm x ⊗ₜ g.symm y := -rfl + (StarAlgEquiv.TensorProduct.map f g).symm (x ⊗ₜ[R] y) = f.symm x ⊗ₜ g.symm y := by + rfl /-- Tensor a star algebra equivalence on the left by a fixed algebra. -/ -noncomputable def StarAlgEquiv.lTensor {R A B : Type*} (C : Type*) [RCLike R] +@[expose] noncomputable def StarAlgEquiv.lTensor {R A B : Type*} (C : Type*) [RCLike R] [Ring A] [Ring B] [Ring C] [Algebra R A] [Algebra R B] [Algebra R C] [StarAddMonoid A] [StarAddMonoid B] [StarAddMonoid C] diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean index 99108f8fc7..5bd9e48a77 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean @@ -15,7 +15,7 @@ This file contains compatibility lemmas and equivalences for tensor-product maps used by the Monlib4 port. -/ -@[expose] public section +public section open scoped TensorProduct @@ -41,6 +41,7 @@ theorem TensorProduct.map_apply_map_apply {R : Type _} [CommSemiring R] {A B C D simp_all /-- Tensor two algebra equivalences. -/ +@[expose] noncomputable def AlgEquiv.TensorProduct.map {R : Type _} [CommSemiring R] {A B C D : Type _} [Semiring A] [Semiring B] [Semiring C] [Semiring D] [Algebra R A] [Algebra R B] [Algebra R C] [Algebra R D] @@ -63,10 +64,10 @@ lemma AlgEquiv.TensorProduct.map_tmul {R : Type _} [CommSemiring R] {A B C D : T [Semiring B] [Semiring C] [Semiring D] [Algebra R A] [Algebra R B] [Algebra R C] [Algebra R D] (f : A ≃ₐ[R] B) (g : C ≃ₐ[R] D) (x : A) (y : C) : AlgEquiv.TensorProduct.map f g (x ⊗ₜ[R] y) = f x ⊗ₜ[R] g y := -rfl +by rfl /-- Tensor two linear equivalences. -/ -@[simps!] +@[expose, simps!] noncomputable def LinearEquiv.TensorProduct.map {R : Type _} [CommSemiring R] {A B C D : Type _} [AddCommMonoid A] [AddCommMonoid B] [AddCommMonoid C] [AddCommMonoid D] [Module R A] [Module R B] [Module R C] [Module R D] (f : A ≃ₗ[R] B) (g : C ≃ₗ[R] D) : @@ -95,7 +96,7 @@ lemma AlgEquiv.TensorProduct.map_toLinearMap [Semiring B] [Semiring C] [Semiring D] [Algebra R A] [Algebra R B] [Algebra R C] [Algebra R D] (f : A ≃ₐ[R] B) (g : C ≃ₐ[R] D) : (AlgEquiv.TensorProduct.map f g).toLinearMap = f.toLinearMap ⊗ₘ g.toLinearMap := -rfl +by rfl lemma AlgEquiv.TensorProduct.map_map_toLinearMap {R : Type _} [CommSemiring R] {A B C D E F : Type _} [Semiring A] [Semiring B] [Semiring C] [Semiring D] [Semiring E] [Semiring F] @@ -114,7 +115,7 @@ lemma AlgEquiv.TensorProduct.map_symm (h : B ≃ₐ[R] E) (i : D ≃ₐ[R] F) : (AlgEquiv.TensorProduct.map h i).symm = (AlgEquiv.TensorProduct.map h.symm i.symm) := -rfl +by rfl lemma AlgEquiv.op_trans {R A B C : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Semiring C] [Algebra R A] [Algebra R B] [Algebra R C] @@ -143,7 +144,8 @@ lemma LinearEquiv.TensorProduct.map_tmul by simp [LinearEquiv.TensorProduct.map, _root_.TensorProduct.map_tmul] /-- Tensor an algebra equivalence on the left by a fixed algebra. -/ -noncomputable def AlgEquiv.lTensor {R A B : Type*} (C : Type*) [CommSemiring R] [Semiring A] +@[expose] noncomputable def AlgEquiv.lTensor {R A B : Type*} (C : Type*) + [CommSemiring R] [Semiring A] [Semiring B] [Semiring C] [Algebra R A] [Algebra R B] [Algebra R C] (f : A ≃ₐ[R] B) : (C ⊗[R] A) ≃ₐ[R] (C ⊗[R] B) := @@ -158,9 +160,9 @@ lemma AlgEquiv.lTensor_tmul {R A B C : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Semiring C] [Algebra R A] [Algebra R B] [Algebra R C] (f : A ≃ₐ[R] B) (x : C) (y : A) : (AlgEquiv.lTensor C f) (x ⊗ₜ[R] y) = x ⊗ₜ f (y) := -rfl +by rfl lemma AlgEquiv.lTensor_symm_tmul {R A B C : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Semiring C] [Algebra R A] [Algebra R B] [Algebra R C] (f : A ≃ₐ[R] B) (x : C) (y : B) : (AlgEquiv.lTensor C f).symm (x ⊗ₜ[R] y) = x ⊗ₜ f.symm (y) := -rfl +by rfl diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/OrthonormalBasis.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/OrthonormalBasis.lean index 872f915afb..a8141cd631 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/OrthonormalBasis.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/OrthonormalBasis.lean @@ -19,7 +19,7 @@ including `OrthonormalBasis.tensorProduct` and its simp lemmas, are already avai from current Mathlib through the imports above. -/ -@[expose] public section +public section open scoped TensorProduct diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Submodule.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Submodule.lean index 1213d1853a..b943a7d1cb 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Submodule.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Submodule.lean @@ -21,7 +21,7 @@ import Mathlib.FieldTheory.Finiteness Imported Lean Pool material for `LeanPool.Monlib4.LinearAlgebra.TensorProduct.Submodule`. -/ -@[expose] public section +public section open scoped TensorProduct @@ -242,9 +242,12 @@ def piProdUnitEquivPi {R n : Type*} [Semiring R] : (n × Unit → R) ≃ₗ[R] n map_smul' r x := by simp only [RingHom.id_apply]; rfl /-- `matrix.replicateCol` written as a linear equivalence -/ -def Matrix.ofReplicateCol {R n : Type*} [Semiring R] : Matrix n Unit R ≃ₗ[R] n → R := +@[expose] def Matrix.ofReplicateCol {R n : Type*} [Semiring R] : Matrix n Unit R ≃ₗ[R] n → R := (reshape : Matrix n Unit R ≃ₗ[R] n × Unit → R).trans piProdUnitEquivPi +@[simp] theorem Matrix.ofReplicateCol_apply {R n : Type*} [Semiring R] + (x : Matrix n Unit R) (i : n) : Matrix.ofReplicateCol x i = x i () := by rfl + /-- Remove a trailing `Unit` factor from the column index of a matrix. -/ def matrixProdUnitRight {R n m : Type*} [Semiring R] : Matrix n (m × Unit) R ≃ₗ[R] Matrix n m R where @@ -256,6 +259,10 @@ def matrixProdUnitRight {R n m : Type*} [Semiring R] : Matrix n (m × Unit) R map_add' x y := by rfl map_smul' r x := by simp only [RingHom.id_apply]; rfl +@[simp] theorem matrixProdUnitRight_apply {R n m : Type*} [Semiring R] + (x : Matrix n (m × Unit) R) (i : n) (j : m) : + matrixProdUnitRight x i j = x i (j, ()) := by rfl + open Kronecker /-- `vec_mulVec x y` written as a kronecker product -/ theorem replicateCol_hMul_replicateCol_conjTranspose_is_kronecker_of_vectors @@ -265,8 +272,11 @@ theorem replicateCol_hMul_replicateCol_conjTranspose_is_kronecker_of_vectors reshape.symm (Matrix.ofReplicateCol (matrixProdUnitRight (replicateCol Unit x ⊗ₖ replicateCol Unit y))) := by - ext - rfl + ext i j + rw [reshape_symm_apply] + rw [vecMulVec_apply] + simp only [Matrix.ofReplicateCol_apply, matrixProdUnitRight_apply, + kroneckerMap_apply, replicateCol_apply] section @@ -276,7 +286,6 @@ variable {ι₁ ι₂ : Type*} [DecidableEq ι₁] [DecidableEq ι₂] [Fintype [(i₁ : ι₁) → InnerProductSpace 𝕜 (M₁ i₁)] [(i₂ : ι₂) → InnerProductSpace 𝕜 (M₂ i₂)] /-- Tensor products commute with finite `PiLp 2` products as a linear equivalence. -/ -@[simps!] noncomputable def PiLpTensorEquiv : (PiLp 2 M₁ ⊗[𝕜] PiLp 2 M₂) ≃ₗ[𝕜] PiLp 2 (fun (i : ι₁ × ι₂) => (M₁ i.1) ⊗[𝕜] (M₂ i.2)) := @@ -285,6 +294,24 @@ noncomputable def PiLpTensorEquiv : (WithLp.linearEquiv 2 𝕜 (∀ i, M₂ i))).trans directSumTensor).trans (WithLp.linearEquiv 2 𝕜 (∀ i : ι₁ × ι₂, M₁ i.1 ⊗[𝕜] M₂ i.2)).symm +@[simp] theorem PiLpTensorEquiv_apply + (x : PiLp 2 M₁ ⊗[𝕜] PiLp 2 M₂) : + PiLpTensorEquiv x = + (((TensorProduct.congr + (WithLp.linearEquiv 2 𝕜 (∀ i, M₁ i)) + (WithLp.linearEquiv 2 𝕜 (∀ i, M₂ i))).trans directSumTensor).trans + (WithLp.linearEquiv 2 𝕜 + (∀ i : ι₁ × ι₂, M₁ i.1 ⊗[𝕜] M₂ i.2)).symm) x := by rfl + +theorem PiLpTensorEquiv_symm_apply + (x : PiLp 2 (fun (i : ι₁ × ι₂) => M₁ i.1 ⊗[𝕜] M₂ i.2)) : + PiLpTensorEquiv.symm x = + (((TensorProduct.congr + (WithLp.linearEquiv 2 𝕜 (∀ i, M₁ i)) + (WithLp.linearEquiv 2 𝕜 (∀ i, M₂ i))).trans directSumTensor).trans + (WithLp.linearEquiv 2 𝕜 + (∀ i : ι₁ × ι₂, M₁ i.1 ⊗[𝕜] M₂ i.2)).symm).symm x := by rfl + theorem PiLpTensorEquiv_tmul (x : PiLp 2 M₁) (y : PiLp 2 M₂) (i : ι₁ × ι₂) : PiLpTensorEquiv (x ⊗ₜ y) i = x i.1 ⊗ₜ[𝕜] y i.2 := by simp [PiLpTensorEquiv, TensorProduct.congr_tmul, directSumTensor_apply, @@ -307,13 +334,24 @@ theorem PiLpTensorEquiv_norm_map simp only [TensorProduct.inner_tmul] /-- `PiLpTensorEquiv` as a linear isometry equivalence. -/ -@[simps! -isSimp] noncomputable abbrev PiLpTensorLinearIsometryEquiv : (PiLp 2 M₁ ⊗[𝕜] PiLp 2 M₂) ≃ₗᵢ[𝕜] PiLp 2 (fun (i : ι₁ × ι₂) => (M₁ i.1) ⊗[𝕜] (M₂ i.2)) where toLinearEquiv := PiLpTensorEquiv norm_map' := PiLpTensorEquiv_norm_map +omit [(i : ι₁) → FiniteDimensional 𝕜 (M₁ i)] + [(i : ι₂) → FiniteDimensional 𝕜 (M₂ i)] in +theorem PiLpTensorLinearIsometryEquiv_apply + (x : PiLp 2 M₁ ⊗[𝕜] PiLp 2 M₂) : + PiLpTensorLinearIsometryEquiv x = PiLpTensorEquiv x := by rfl + +omit [(i : ι₁) → FiniteDimensional 𝕜 (M₁ i)] + [(i : ι₂) → FiniteDimensional 𝕜 (M₂ i)] in +theorem PiLpTensorLinearIsometryEquiv_symm_apply + (x : PiLp 2 (fun (i : ι₁ × ι₂) => M₁ i.1 ⊗[𝕜] M₂ i.2)) : + PiLpTensorLinearIsometryEquiv.symm x = PiLpTensorEquiv.symm x := by rfl + omit [(i : ι₁) → FiniteDimensional 𝕜 (M₁ i)] [(i : ι₂) → FiniteDimensional 𝕜 (M₂ i)] in theorem PiLpTensorLinearIsometryEquiv_tmul @@ -339,7 +377,6 @@ lemma euclideanSpaceTensor_apply {R : Type*} [RCLike R] {ι₁ ι₂ : Type*} PiLpTensorLinearIsometryEquiv_tmul x y i /-- The left unit tensor equivalence as a linear isometry equivalence. -/ -@[simps!] noncomputable def TensorProduct.lidLinearIsometryEquiv (𝕜 E : Type*) [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [FiniteDimensional 𝕜 E] : @@ -351,6 +388,17 @@ noncomputable def TensorProduct.lidLinearIsometryEquiv TensorProduct.lid_adjoint] simp only [LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply, ← norm_eq_sqrt_re_inner] +@[simp] theorem TensorProduct.lidLinearIsometryEquiv_apply + (𝕜 E : Type*) [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [FiniteDimensional 𝕜 E] (x : 𝕜 ⊗[𝕜] E) : + TensorProduct.lidLinearIsometryEquiv 𝕜 E x = TensorProduct.lid 𝕜 E x := by rfl + +theorem TensorProduct.lidLinearIsometryEquiv_symm_apply + (𝕜 E : Type*) [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + [FiniteDimensional 𝕜 E] (x : E) : + (TensorProduct.lidLinearIsometryEquiv 𝕜 E).symm x = + (TensorProduct.lid 𝕜 E).symm x := by rfl + /-- Tensor product equivalence for finite Euclidean spaces, using `R ⊗[R] R ≃ R`. -/ noncomputable abbrev euclideanSpaceTensor' {R : Type*} [RCLike R] {ι₁ ι₂ : Type*} [Fintype ι₁] [Fintype ι₂] diff --git a/LeanPool/Monlib4/LinearAlgebra/ToMatrixOfEquiv.lean b/LeanPool/Monlib4/LinearAlgebra/ToMatrixOfEquiv.lean index 63327058de..6c48e9e5aa 100644 --- a/LeanPool/Monlib4/LinearAlgebra/ToMatrixOfEquiv.lean +++ b/LeanPool/Monlib4/LinearAlgebra/ToMatrixOfEquiv.lean @@ -17,7 +17,7 @@ Mathlib's `LinearEquiv.conjAlgEquiv` is the current version of the upstream `LinearEquiv.innerConj` construction used by the Monlib4 `IncludeBlock` slice. -/ -@[expose] public section +public section open scoped BigOperators open Matrix Module.End InnerProductSpace @@ -68,14 +68,14 @@ theorem OrthonormalBasis.toMatrix_apply {n E : Type _} [Fintype n] [DecidableEq [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [FiniteDimensional 𝕜 E] (b : OrthonormalBasis n 𝕜 E) (x : E →ₗ[𝕜] E) (i j : n) : b.toMatrix x i j = inner 𝕜 (b i) (x (b j)) := - rfl + by rfl theorem OrthonormalBasis.toMatrix_symm_apply {n E : Type _} [Fintype n] [DecidableEq n] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [FiniteDimensional 𝕜 E] (b : OrthonormalBasis n 𝕜 E) (x : Matrix n n 𝕜) : b.toMatrix.symm x = ∑ i, ∑ j, x i j • (InnerProductSpace.rankOne 𝕜 (b i) (b j)).toLinearMap := - rfl + by rfl theorem OrthonormalBasis.toMatrix_symm_apply' {n E : Type _} [Fintype n] [DecidableEq n] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [FiniteDimensional 𝕜 E] @@ -155,7 +155,7 @@ theorem OrthonormalBasis.std_toMatrix {n : Type _} [Fintype n] [DecidableEq n] : namespace LinearEquiv /-- Conjugate endomorphism algebras along a linear equivalence. -/ -def innerConj {R E F : Type*} [CommSemiring R] [AddCommMonoid E] [AddCommMonoid F] +@[expose] def innerConj {R E F : Type*} [CommSemiring R] [AddCommMonoid E] [AddCommMonoid F] [Module R E] [Module R F] (e : E ≃ₗ[R] F) : Module.End R E ≃ₐ[R] Module.End R F := e.conjAlgEquiv R @@ -164,7 +164,7 @@ theorem innerConj_apply {R E F : Type*} [CommSemiring R] [AddCommMonoid E] [AddCommMonoid F] [Module R E] [Module R F] (e : E ≃ₗ[R] F) (f : Module.End R E) : e.innerConj f = e.toLinearMap ∘ₗ f ∘ₗ e.symm.toLinearMap := - rfl + by rfl end LinearEquiv @@ -190,7 +190,7 @@ theorem Matrix.stdBasis_repr_eq_reshape {R I J : Type _} [Fintype I] [Finite J] calc Matrix.reshape (Matrix.stdBasis R I J i) j = Matrix.reshape (Matrix.single i.1 i.2 (1 : R)) j := by rw [Matrix.stdBasis_eq_single] - _ = Matrix.single i.1 i.2 (1 : R) j.1 j.2 := rfl + _ = Matrix.single i.1 i.2 (1 : R) j.1 j.2 := by rfl _ = if i = j then 1 else 0 := by simp_rw [Matrix.single, Matrix.of_apply, ← Prod.eq_iff_fst_eq_snd_eq]) x ij @@ -204,14 +204,14 @@ theorem toMatrix_stdBasis_stdBasis {K L : Type _} [Fintype K] [Finite L] toMatrix (Matrix.stdBasis R I J) (Matrix.stdBasis R K L) x = LinearMap.toMatrix' (Matrix.reshape.toLinearMap ∘ₗ x ∘ₗ Matrix.reshape.symm.toLinearMap) := - rfl + by rfl theorem toLin_stdBasis_stdBasis {K L : Type _} [Fintype K] [Finite L] (x : Matrix (K × L) (I × J) R) : (toLin (Matrix.stdBasis R I J) (Matrix.stdBasis R K L)) x = (Matrix.reshape : Matrix K L R ≃ₗ[R] _).symm.toLinearMap ∘ₗ toLin' x ∘ₗ (Matrix.reshape : Matrix I J R ≃ₗ[R] _).toLinearMap := - rfl + by rfl /-- Identify endomorphisms of a matrix space with matrices on the reshaped index type. -/ def toMatrixOfAlgEquiv : (Matrix I J R →ₗ[R] Matrix I J R) ≃ₐ[R] @@ -222,13 +222,13 @@ theorem toMatrixOfAlgEquiv_apply (x : Matrix I J R →ₗ[R] Matrix I J R) : toMatrixOfAlgEquiv x = toMatrixAlgEquiv' ((Matrix.reshape : Matrix I J R ≃ₗ[R] _).toLinearMap ∘ₗ x ∘ₗ (Matrix.reshape : Matrix I J R ≃ₗ[R] _).symm.toLinearMap) := - rfl + by rfl theorem toMatrixOfAlgEquiv_symm_apply (x : Matrix (I × J) (I × J) R) : toMatrixOfAlgEquiv.symm x = (Matrix.reshape : Matrix I J R ≃ₗ[R] _).symm.toLinearMap ∘ₗ toMatrixAlgEquiv'.symm x ∘ₗ (Matrix.reshape : Matrix I J R ≃ₗ[R] _).toLinearMap := - rfl + by rfl theorem toMatrixOfAlgEquiv_apply' (x : Matrix I J R →ₗ[R] Matrix I J R) (ij kl : I × J) : @@ -257,7 +257,7 @@ theorem toLinOfAlgEquiv_apply (x : Matrix (I × J) (I × J) R) (y : Matrix I J R) : toLinOfAlgEquiv x y = (reshape : Matrix I J R ≃ₗ[R] I × J → R).symm (toLinAlgEquiv' x (reshape y)) := - rfl + by rfl /-- Rank-one endomorphism on the standard basis of a matrix space. -/ def rankOneStdBasis {I J : Type _} [DecidableEq I] [DecidableEq J] @@ -271,7 +271,7 @@ def rankOneStdBasis {I J : Type _} [DecidableEq I] [DecidableEq J] theorem rankOneStdBasis_apply {I J : Type _} [DecidableEq I] [DecidableEq J] (ij kl : I × J) (r : R) (x : Matrix I J R) : rankOneStdBasis ij kl r x = single ij.1 ij.2 (r • r • x kl.1 kl.2) := - rfl + by rfl open scoped BigOperators diff --git a/LeanPool/Monlib4/Monlib.lean b/LeanPool/Monlib4/Monlib.lean index 3c2e42f91b..0008360411 100644 --- a/LeanPool/Monlib4/Monlib.lean +++ b/LeanPool/Monlib4/Monlib.lean @@ -23,4 +23,4 @@ import Mathlib.Tactic.NormNum.GCD Compatibility root corresponding to upstream `Monlib.lean`. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/Other.lean b/LeanPool/Monlib4/Other.lean index c75cac7108..b7aeee0af2 100644 --- a/LeanPool/Monlib4/Other.lean +++ b/LeanPool/Monlib4/Other.lean @@ -19,4 +19,4 @@ import Mathlib.Tactic.NormNum.Pow Import-only index for miscellaneous self-contained monlib4 files. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/Other/Sonia.lean b/LeanPool/Monlib4/Other/Sonia.lean index 317b6d0212..4206fa75f4 100644 --- a/LeanPool/Monlib4/Other/Sonia.lean +++ b/LeanPool/Monlib4/Other/Sonia.lean @@ -34,7 +34,7 @@ In both of the following results, `b` is a natural number greater than `1`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Monlib4/Preq.lean b/LeanPool/Monlib4/Preq.lean index 7e30094817..e37565883a 100644 --- a/LeanPool/Monlib4/Preq.lean +++ b/LeanPool/Monlib4/Preq.lean @@ -23,4 +23,4 @@ import Mathlib.Tactic.Positivity.Finset Import-only index for the `Preq` directory of the monlib4 import. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/Preq/Complex.lean b/LeanPool/Monlib4/Preq/Complex.lean index 533bda99a0..d3ca7ed2b2 100644 --- a/LeanPool/Monlib4/Preq/Complex.lean +++ b/LeanPool/Monlib4/Preq/Complex.lean @@ -17,7 +17,7 @@ This file contains some basic lemmas about complex numbers. -/ -@[expose] public section +public section open scoped ComplexConjugate BigOperators diff --git a/LeanPool/Monlib4/Preq/Dite.lean b/LeanPool/Monlib4/Preq/Dite.lean index bee6e8da96..b4cb1cbd97 100644 --- a/LeanPool/Monlib4/Preq/Dite.lean +++ b/LeanPool/Monlib4/Preq/Dite.lean @@ -12,7 +12,7 @@ public import Mathlib.LinearAlgebra.TensorProduct.Defs # Some stuff on dites -/ -@[expose] public section +public section theorem ite_eq_ite_iff {α : Type _} (a b c : α) : (∀ {p : Prop} [hp : Decidable p], @ite α p hp a c diff --git a/LeanPool/Monlib4/Preq/Equiv.lean b/LeanPool/Monlib4/Preq/Equiv.lean index 66ed1cf522..4a5fbdd607 100644 --- a/LeanPool/Monlib4/Preq/Equiv.lean +++ b/LeanPool/Monlib4/Preq/Equiv.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monlib4.Preq.Equiv`. -/ -@[expose] public section +public section theorem Equiv.Perm.ToPequiv.toMatrix_mem_unitaryGroup {n : Type _} [DecidableEq n] [Fintype n] {𝕜 : Type _} [CommRing 𝕜] [StarRing 𝕜] (σ : Equiv.Perm n) : diff --git a/LeanPool/Monlib4/Preq/Finset.lean b/LeanPool/Monlib4/Preq/Finset.lean index 8eedd117b5..6c2508ff36 100644 --- a/LeanPool/Monlib4/Preq/Finset.lean +++ b/LeanPool/Monlib4/Preq/Finset.lean @@ -17,7 +17,7 @@ In this file we provide some elementary results for summations -/ -@[expose] public section +public section namespace Finset diff --git a/LeanPool/Monlib4/Preq/Ites.lean b/LeanPool/Monlib4/Preq/Ites.lean index ce9120fa1f..8f0ca967a2 100644 --- a/LeanPool/Monlib4/Preq/Ites.lean +++ b/LeanPool/Monlib4/Preq/Ites.lean @@ -14,7 +14,7 @@ public import Mathlib.LinearAlgebra.TensorProduct.Map Some lemmas about `ite` and `coe` for `star` and `tensor_product`. -/ -@[expose] public section +public section @[simp] diff --git a/LeanPool/Monlib4/Preq/RCLikeLe.lean b/LeanPool/Monlib4/Preq/RCLikeLe.lean index 5f7ccf1f81..5682c6ee6b 100644 --- a/LeanPool/Monlib4/Preq/RCLikeLe.lean +++ b/LeanPool/Monlib4/Preq/RCLikeLe.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.RCLike.Basic This file contains extra lemmas on `RCLike`. -/ -@[expose] public section +public section namespace RCLike diff --git a/LeanPool/Monlib4/Preq/Set.lean b/LeanPool/Monlib4/Preq/Set.lean index 389b1fa98d..7585ed1361 100644 --- a/LeanPool/Monlib4/Preq/Set.lean +++ b/LeanPool/Monlib4/Preq/Set.lean @@ -18,4 +18,4 @@ import Mathlib.Tactic.SetLike the relevant imports for downstream files. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/Preq/StarAlgEquiv.lean b/LeanPool/Monlib4/Preq/StarAlgEquiv.lean index 662612ce26..ec0a956d45 100644 --- a/LeanPool/Monlib4/Preq/StarAlgEquiv.lean +++ b/LeanPool/Monlib4/Preq/StarAlgEquiv.lean @@ -15,7 +15,7 @@ import Mathlib.LinearAlgebra.Span.Basic This file contains some obvious definitions and lemmas on star algebra equivalences. -/ -@[expose] public section +public section theorem AlgEquiv.comp_inj {R A B C : Type _} [CommSemiring R] [Semiring A] [Semiring B] [Semiring C] @@ -29,7 +29,7 @@ theorem AlgEquiv.inj_comp {R A B C : Type _} [CommSemiring R] [Semiring A] [Semi simp_all /-- The linear map underlying a star algebra equivalence. -/ -@[simps] +@[expose, simps] def StarAlgEquiv.toLinearMap {R A B : Type*} [Semiring R] [AddCommMonoid A] [AddCommMonoid B] [Mul A] [Mul B] [Module R A] [Module R B] [Star A] [Star B] @@ -64,7 +64,7 @@ theorem StarAlgEquiv.inj_comp {R A B C : Type*} [Semiring R] [AddCommMonoid A] simp_all /-- The linear equivalence underlying a star algebra equivalence. -/ -@[simps] +@[expose, simps] def StarAlgEquiv.toLinearEquiv {R A B : Type*} [Semiring R] [AddCommMonoid A] [AddCommMonoid B] [Mul A] [Mul B] [Module R A] [Module R B] [Star A] [Star B] @@ -210,7 +210,7 @@ lemma NonUnitalAlgEquiv.map_span_center {F R A B : Type*} [Semiring R] /-- Assemble pointwise star algebra equivalences into a star algebra equivalence of dependent functions. -/ -@[simps apply] +@[expose, simps apply] def StarAlgEquiv.piCongrRight {R ι : Type*} {A₁ A₂ : ι → Type*} [(i : ι) → Add (A₁ i)] [(i : ι) → Add (A₂ i)] [(i : ι) → Mul (A₁ i)] [(i : ι) → Mul (A₂ i)] diff --git a/LeanPool/Monlib4/QuantumGraph.lean b/LeanPool/Monlib4/QuantumGraph.lean index fdad422a1f..0479d57e93 100644 --- a/LeanPool/Monlib4/QuantumGraph.lean +++ b/LeanPool/Monlib4/QuantumGraph.lean @@ -25,4 +25,4 @@ public import LeanPool.Monlib4.QuantumGraph.ToProjections Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph`. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/QuantumGraph/Basic.lean b/LeanPool/Monlib4/QuantumGraph/Basic.lean index d3fa298c56..9e37de42d8 100644 --- a/LeanPool/Monlib4/QuantumGraph/Basic.lean +++ b/LeanPool/Monlib4/QuantumGraph/Basic.lean @@ -26,7 +26,7 @@ import LeanPool.Monlib4.Preq.Finset Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.Basic`. -/ -@[expose] public section +public section local notation x " ⊗ₘ " y => TensorProduct.map x y @@ -37,8 +37,7 @@ instance FiniteDimensional.innerProductSpace.complete {E : Type*} [NormedAddComm theorem symmMap_apply_schurMul {A B : Type*} [starAlgebra A] [starAlgebra B] [hA : QuantumSet A] [QuantumSet B] (f g : A →ₗ[ℂ] B) : symmMap ℂ _ _ (f •ₛ g) = (symmMap _ _ _ g) •ₛ (symmMap _ _ _ f) := by - rw [symmMap_apply, schurMul_real, schurMul_adjoint] - rfl + simp only [symmMap_apply, schurMul_real, schurMul_adjoint] alias QuantumSet.modAut_star := starAlgebra.modAut_star alias QuantumSet.modAut_zero := starAlgebra.modAut_zero @@ -358,7 +357,7 @@ theorem QuantumSet.innerOne_map_one_isReal_ofReal rw [hf, QuantumSet.counit_isReal] simp /-- The star-algebra structure transported to the opposite algebra. -/ -@[reducible] +@[reducible, expose] noncomputable def starAlgebra.mulOpposite {A : Type*} [starAlgebra A] : starAlgebra Aᵐᵒᵖ where modAut r := (modAut (-r)).op @@ -366,8 +365,7 @@ noncomputable def starAlgebra.mulOpposite {A : Type*} [starAlgebra A] : modAut_star _ x := by simp [← MulOpposite.op_star] attribute [local instance] starAlgebra.mulOpposite /-- The inner-product algebra structure transported to the opposite algebra. -/ -@[reducible] -noncomputable def InnerProductAlgebra.mulOpposite {A : +@[reducible, expose] noncomputable def InnerProductAlgebra.mulOpposite {A : Type*} [starAlgebra A] [InnerProductAlgebra A] : InnerProductAlgebra (Aᵐᵒᵖ) where norm_smul_le c x := by @@ -430,7 +428,7 @@ theorem QuantumSet.counit_isFaithful {A : Type*} [starAlgebra A] [QuantumSet A] map_eq_zero_iff _ (AlgEquiv.injective _)] /-- Opposite-algebra version of a module dual functional. -/ -def Module.Dual.op {R A : Type*} [CommSemiring R] [AddCommMonoid A] [Module R A] +@[expose] def Module.Dual.op {R A : Type*} [CommSemiring R] [AddCommMonoid A] [Module R A] (f : Module.Dual R A) : Module.Dual R Aᵐᵒᵖ := (unop R).toLinearMap ∘ₗ LinearMap.op f @@ -858,7 +856,7 @@ theorem rfl /-- Linear map sending a tensor to its first-coordinate orthonormal-basis expansion data. -/ -noncomputable def TensorProduct.ofOrthonormalBasisProd₁Lm +@[expose] noncomputable def TensorProduct.ofOrthonormalBasisProd₁Lm {𝕜 E F : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] {ι₁ ι₂ : Type*} [Fintype ι₁] [Fintype ι₂] (b₁ : OrthonormalBasis ι₁ 𝕜 E) @@ -930,7 +928,7 @@ theorem StarAlgEquiv.tensorProduct_map_isometry_of LinearMap.tensorProduct_map_isometry_of hf hg /-- Tensor product of two linear isometry equivalences. -/ -@[simps!] +@[simps!, expose] noncomputable def LinearIsometryEquiv.TensorProduct.map {𝕜 A B C D : Type*} [RCLike 𝕜] [NormedAddCommGroup A] [NormedAddCommGroup B] [NormedAddCommGroup C] [NormedAddCommGroup D] [InnerProductSpace 𝕜 A] [InnerProductSpace 𝕜 B] [InnerProductSpace 𝕜 C] [InnerProductSpace 𝕜 D] @@ -1108,6 +1106,7 @@ theorem lTensor_counit_PhiMap_rTensor_algebraLinearMap (x : B →ₗ[ℂ] B) : simp only [LinearMap.comp_assoc, LinearMap.rTensor_comp, LinearMap.lTensor_comp] /-- Linear functional computing the weighted number of edges of a quantum graph. -/ +@[expose] noncomputable def QuantumGraph.NumOfEdges {A : Type*} [starAlgebra A] [QuantumSet A] : (A →ₗ[ℂ] A) →ₗ[ℂ] ℂ where toFun f := ⟪1, f 1⟫_ℂ diff --git a/LeanPool/Monlib4/QuantumGraph/Degree.lean b/LeanPool/Monlib4/QuantumGraph/Degree.lean index 83b712e9b7..abc266d5e7 100644 --- a/LeanPool/Monlib4/QuantumGraph/Degree.lean +++ b/LeanPool/Monlib4/QuantumGraph/Degree.lean @@ -19,7 +19,7 @@ import LeanPool.Monlib4.Preq.RCLikeLe Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.Degree`. -/ -@[expose] public section +public section open scoped InnerProductSpace ComplexOrder @@ -137,7 +137,7 @@ theorem QuantumGraph.Real.innerOne_map_one_eq_norm_pow_four_iff simp_rw [← QuantumSet.toSubsetAlgEquiv_symm_eq_toSubsetEquiv, map_one]] /-- Out-degree operator of a quantum graph. -/ -@[simps] +@[expose, simps] noncomputable def QuantumGraph.outDegree {A : Type*} [starAlgebra A] [QuantumSet A] : (A →ₗ[ℂ] A) →ₗ[ℂ] (A →ₗ[ℂ] A) where toFun f := LinearMap.mul' ℂ _ ∘ₗ (LinearMap.rTensor _ f) @@ -156,7 +156,7 @@ theorem QuantumGraph.outDegree_eq {A : Type*} [starAlgebra A] [QuantumSet A] {f lmul_apply, LinearMap.mul'_apply] /-- In-degree operator of a quantum graph. -/ -@[simps] +@[expose, simps] noncomputable def QuantumGraph.inDegree {A : Type*} [starAlgebra A] [QuantumSet A] : (A →ₗ[ℂ] A) →ₗ⋆[ℂ] (A →ₗ[ℂ] A) where toFun f := LinearMap.mul' ℂ _ ∘ₗ (LinearMap.lTensor _ (LinearMap.adjoint f)) diff --git a/LeanPool/Monlib4/QuantumGraph/Example.lean b/LeanPool/Monlib4/QuantumGraph/Example.lean index a4ec4c2e51..405fdfd238 100644 --- a/LeanPool/Monlib4/QuantumGraph/Example.lean +++ b/LeanPool/Monlib4/QuantumGraph/Example.lean @@ -25,7 +25,7 @@ import Mathlib.Analysis.SpecialFunctions.Bernstein such as the complete graph and the trivial graph. -/ -@[expose] public section +public section -- import quantum_graph.basic @@ -76,6 +76,7 @@ local notation "τ⁻¹" => local notation "id" => (1 : ℍ →ₗ[ℂ] ℍ) /-- The complete quantum adjacency map between two Hilbert spaces with chosen units. -/ +@[expose] noncomputable def Qam.completeGraph (E₁ E₂ : Type _) [One E₁] [One E₂] [NormedAddCommGroup E₁] [NormedAddCommGroup E₂] [InnerProductSpace ℂ E₁] [InnerProductSpace ℂ E₂] : E₂ →ₗ[ℂ] E₁ := @@ -95,7 +96,7 @@ theorem Qam.completeGraph_eq' : rw [Coalgebra.counit_eq_bra_one] ext simp [Algebra.algebraMap_eq_smul_one] - rfl + simp [Qam.completeGraph] open scoped schurMul theorem Qam.Nontracial.CompleteGraph.qam : @@ -361,7 +362,7 @@ theorem Qam.complement'_eq {E₁ E₂ : Type _} [NormedAddCommGroupOfRing E₁] [NormedAddCommGroupOfRing E₂] [InnerProductSpace ℂ E₁] [InnerProductSpace ℂ E₂] (a : E₂ →ₗ[ℂ] E₁) : Qam.complement' a = Qam.completeGraph E₁ E₂ - a := - rfl + by rfl theorem Qam.irreflexiveComplement_is_irreflexive_qam_iff_irreflexive_qam [hA2 : QuantumSetDeltaForm A] {x : l(A)} (hx : LinearMap.IsReal x) : diff --git a/LeanPool/Monlib4/QuantumGraph/Grad.lean b/LeanPool/Monlib4/QuantumGraph/Grad.lean index b0260c2806..99e027359c 100644 --- a/LeanPool/Monlib4/QuantumGraph/Grad.lean +++ b/LeanPool/Monlib4/QuantumGraph/Grad.lean @@ -15,7 +15,7 @@ import LeanPool.Monlib4.LinearAlgebra.Ips.TensorHilbert Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.Grad`. -/ -@[expose] public section +public section variable {B : Type*} [starAlgebra B] [QuantumSet B] @@ -28,6 +28,7 @@ local notation "τ" => TensorProduct.lid ℂ local notation "τ'" => TensorProduct.rid ℂ /-- Gradient map associated to a quantum graph adjacency operator. -/ +@[expose] noncomputable def QuantumGraph.Grad : (B →ₗ[ℂ] B) →+ (B →ₗ[ℂ] B ⊗[ℂ] B) where toFun f := (rT _ (LinearMap.adjoint f) - lT _ f) ∘ₗ Coalgebra.comul diff --git a/LeanPool/Monlib4/QuantumGraph/Iso.lean b/LeanPool/Monlib4/QuantumGraph/Iso.lean index 65fc2494be..d001e202c0 100644 --- a/LeanPool/Monlib4/QuantumGraph/Iso.lean +++ b/LeanPool/Monlib4/QuantumGraph/Iso.lean @@ -20,7 +20,7 @@ import LeanPool.Monlib4.LinearAlgebra.MySpec This file defines isomorphisms between quantum graphs. -/ -@[expose] public section +public section open TensorProduct Matrix diff --git a/LeanPool/Monlib4/QuantumGraph/Matrix.lean b/LeanPool/Monlib4/QuantumGraph/Matrix.lean index 1aba7aaae6..cfec6b1ccc 100644 --- a/LeanPool/Monlib4/QuantumGraph/Matrix.lean +++ b/LeanPool/Monlib4/QuantumGraph/Matrix.lean @@ -15,7 +15,7 @@ import LeanPool.Monlib4.Preq.Finset Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.Matrix`. -/ -@[expose] public section +public section open scoped Functional MatrixOrder ComplexOrder TensorProduct Matrix diff --git a/LeanPool/Monlib4/QuantumGraph/Nontracial.lean b/LeanPool/Monlib4/QuantumGraph/Nontracial.lean index f82b3f1552..b07fafa2ec 100644 --- a/LeanPool/Monlib4/QuantumGraph/Nontracial.lean +++ b/LeanPool/Monlib4/QuantumGraph/Nontracial.lean @@ -14,7 +14,7 @@ public import LeanPool.Monlib4.LinearAlgebra.QuantumSet.Instances This file defines the quantum adjacency matrix of a quantum graph. -/ -@[expose] public section +public section variable {n p : Type _} [Fintype n] [Fintype p] [DecidableEq n] [DecidableEq p] diff --git a/LeanPool/Monlib4/QuantumGraph/OfClassicalGraph.lean b/LeanPool/Monlib4/QuantumGraph/OfClassicalGraph.lean index bebaa496d3..e3d8daff49 100644 --- a/LeanPool/Monlib4/QuantumGraph/OfClassicalGraph.lean +++ b/LeanPool/Monlib4/QuantumGraph/OfClassicalGraph.lean @@ -17,7 +17,7 @@ import LeanPool.Monlib4.Preq.Ites Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.OfClassicalGraph`. -/ -@[expose] public section +public section noncomputable instance {n : Type*} : starAlgebra (PiQ (fun _ : n => ℂ)) := diff --git a/LeanPool/Monlib4/QuantumGraph/PiMat.lean b/LeanPool/Monlib4/QuantumGraph/PiMat.lean index 10a0126645..a35063cc49 100644 --- a/LeanPool/Monlib4/QuantumGraph/PiMat.lean +++ b/LeanPool/Monlib4/QuantumGraph/PiMat.lean @@ -26,7 +26,7 @@ import LeanPool.Monlib4.RepTheory.AutMat Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.PiMat`. -/ -@[expose] public section +public section variable {ι : Type*} {p : ι → Type*} [Fintype ι] [DecidableEq ι] [Π i, Fintype (p i)] [Π i, DecidableEq (p i)] @@ -64,7 +64,7 @@ macro_rules /-- Transpose each matrix block of a `PiMat` as a star-algebra equivalence to the opposite algebra. -/ -@[simps] +@[expose, simps] noncomputable def PiMat.transposeStarAlgEquiv (ι : Type*) (p : ι → Type*) [Π i, Fintype (p i)] : PiMat ℂ ι p ≃⋆ₐ[ℂ] (PiMat ℂ ι p)ᵐᵒᵖ where @@ -109,7 +109,7 @@ theorem kroneckerTMulLinearEquiv_map_lid_tmul exact kroneckerLinearEquiv_tmul x y /-- Tensor-product equivalence for direct products of matrix algebras. -/ -@[simps!] +@[expose, simps!] noncomputable def PiMatTensorProductEquiv {ι₁ ι₂ : Type*} {p₁ : ι₁ → Type*} {p₂ : ι₂ → Type*} [Fintype ι₁] [DecidableEq ι₁] [Fintype ι₂] [DecidableEq ι₂] @@ -122,8 +122,8 @@ StarAlgEquiv.ofAlgEquiv (AlgEquiv.piCongrRight (fun i => tensorToKronecker))) (fun x => by ext1 i - change TensorProduct.toKronecker (directSumTensorToFun (star x) i) = - star (TensorProduct.toKronecker (directSumTensorToFun x i)) + simp only [AlgEquiv.trans_apply, Pi.star_apply, + AlgEquiv.piCongrRight_apply, directSumTensorAlgEquiv_apply] rw [TensorProduct.toKronecker_star] congr 1 obtain ⟨S, rfl⟩ := TensorProduct.exists_finset x @@ -1099,6 +1099,7 @@ theorem Matrix.UnitaryGroup.toEuclideanLinearEquiv_apply {n : Type*} [Fintype n] rfl /-- A unitary matrix as a linear isometry equivalence of Euclidean space. -/ +@[expose] noncomputable def Matrix.UnitaryGroup.toEuclideanLinearIsometryEquiv {n : Type*} [Fintype n] [DecidableEq n] (A : ↥(Matrix.unitaryGroup n ℂ)) : @@ -1158,8 +1159,10 @@ theorem unitaryTensorEuclidean_apply {U : (i : ι) → Matrix.unitaryGroup (p i) ((WithLp.toLp 2 ((U i.1 : Matrix _ _ ℂ) *ᵥ x.ofLp)) ⊗ₜ WithLp.toLp 2 ((U i.2 : Matrix _ _ ℂ)ᴴᵀ *ᵥ y.ofLp)) := by rw [unitaryTensorEuclidean, LinearIsometryEquiv.trans_apply, - LinearIsometryEquiv.symm_apply_apply] - rfl + LinearIsometryEquiv.symm_apply_apply, LinearIsometryEquiv.trans_apply] + simp only [LinearIsometryEquiv.TensorProduct.map_tmul, + Matrix.UnitaryGroup.toEuclideanLinearIsometryEquiv_apply, + Matrix.unitaryGroup.conj_coe, Matrix.conj_conjTranspose] omit [Fintype ι] [DecidableEq ι] in theorem unitaryTensorEuclidean_apply' {U : (i : ι) → Matrix.unitaryGroup (p i) ℂ} (i : @@ -1704,6 +1707,7 @@ lemma Matrix.trace_piMatTensorProductEquiv_lTensor_unop_tenSwap rfl /-- Build a linear isometry equivalence from a linear equivalence whose adjoint is its inverse. -/ +@[expose] def LinearIsometryEquiv.ofLinearEquiv {𝕜 E F : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [NormedAddCommGroup F] [InnerProductSpace 𝕜 E] @@ -1726,6 +1730,7 @@ lemma LinearIsometryEquiv.ofLinearEquiv_apply {𝕜 E F : Type*} [RCLike 𝕜] [ rfl /-- Tensor-product commutativity as a linear isometry equivalence. -/ +@[expose] noncomputable def TensorProduct.commLinearIsometryEquiv (𝕜 E F : Type*) [RCLike 𝕜] [NormedAddCommGroup E] [NormedAddCommGroup F] [InnerProductSpace 𝕜 E] diff --git a/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean b/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean index 26646db27c..7012f29be7 100644 --- a/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean +++ b/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean @@ -17,7 +17,7 @@ import LeanPool.Monlib4.Preq.Finset Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.PiMatFinTwo`. -/ -@[expose] public section +public section open scoped Functional MatrixOrder ComplexOrder TensorProduct Matrix diff --git a/LeanPool/Monlib4/QuantumGraph/QamA.lean b/LeanPool/Monlib4/QuantumGraph/QamA.lean index 9899aa1c40..e09b67eac8 100644 --- a/LeanPool/Monlib4/QuantumGraph/QamA.lean +++ b/LeanPool/Monlib4/QuantumGraph/QamA.lean @@ -20,7 +20,7 @@ This file defines the single-edged quantum graph, and proves that it is a `QAM`. -/ -@[expose] public section +public section variable {n : Type _} [Fintype n] [DecidableEq n] diff --git a/LeanPool/Monlib4/QuantumGraph/QamAExample.lean b/LeanPool/Monlib4/QuantumGraph/QamAExample.lean index e07579f23b..e1bba57f0e 100644 --- a/LeanPool/Monlib4/QuantumGraph/QamAExample.lean +++ b/LeanPool/Monlib4/QuantumGraph/QamAExample.lean @@ -16,7 +16,7 @@ import LeanPool.Monlib4.LinearAlgebra.Ips.Basic Imported Lean Pool material for `LeanPool.Monlib4.QuantumGraph.QamAExample`. -/ -@[expose] public section +public section section diff --git a/LeanPool/Monlib4/QuantumGraph/ToProjections.lean b/LeanPool/Monlib4/QuantumGraph/ToProjections.lean index b56cca4e5b..d94ce26c5f 100644 --- a/LeanPool/Monlib4/QuantumGraph/ToProjections.lean +++ b/LeanPool/Monlib4/QuantumGraph/ToProjections.lean @@ -18,7 +18,7 @@ This file contains the definition of a quantum graph as a projection, and the pr -/ -@[expose] public section +public section variable {p : Type _} [Fintype p] [DecidableEq p] {n : p → Type _} [∀ i, Fintype (n i)] diff --git a/LeanPool/Monlib4/RepTheory.lean b/LeanPool/Monlib4/RepTheory.lean index dfbf4c9121..8fa7b46247 100644 --- a/LeanPool/Monlib4/RepTheory.lean +++ b/LeanPool/Monlib4/RepTheory.lean @@ -13,4 +13,4 @@ public import LeanPool.Monlib4.RepTheory.AutMat Import-only index for the `RepTheory` directory of the monlib4 import. -/ -@[expose] public section +public section diff --git a/LeanPool/Monlib4/RepTheory/AutMat.lean b/LeanPool/Monlib4/RepTheory/AutMat.lean index d69b7c522c..3ac62dc77c 100644 --- a/LeanPool/Monlib4/RepTheory/AutMat.lean +++ b/LeanPool/Monlib4/RepTheory/AutMat.lean @@ -19,7 +19,7 @@ corollaries package the implementing matrix as a linear equivalence or as an element of the general linear group. -/ -@[expose] public section +public section open scoped BigOperators Matrix @@ -188,7 +188,7 @@ def autInner {R E : Type _} [CommSemiring R] [Semiring E] theorem autInner_apply {R E : Type _} [CommSemiring R] [Semiring E] [Algebra R E] (x : E) [Invertible x] (y : E) : (autInner x : E ≃ₐ[R] E) y = x * y * ⅟ x := - rfl + by rfl end Algebra @@ -290,12 +290,12 @@ abbrev autInner {R E : Type _} [CommSemiring R] [Semiring E] theorem autInner_apply {R E : Type _} [CommSemiring R] [Semiring E] [Algebra R E] (x : E) [Invertible x] (y : E) : (autInner x : E ≃ₐ[R] E) y = x * y * ⅟ x := - rfl + by rfl theorem autInner_symm_apply {R E : Type _} [CommSemiring R] [Semiring E] [Algebra R E] (x : E) [Invertible x] (y : E) : (autInner x : E ≃ₐ[R] E).symm y = ⅟ x * y * x := - rfl + by rfl theorem coe_autInner_eq_rmul_comp_lmul {R E : Type _} [CommSemiring R] [Semiring E] [Algebra R E] (x : E) [Invertible x] : @@ -351,7 +351,6 @@ def IsInner {R E : Type*} [CommSemiring R] [Semiring E] ∃ (a : E) (_ : Invertible a), f = Algebra.autInner a /-- Product of algebra equivalences, acting componentwise on a product algebra. -/ -@[simps] def prodMap {K R₁ R₂ R₃ R₄ : Type*} [CommSemiring K] [Semiring R₁] [Semiring R₂] [Semiring R₃] [Semiring R₄] [Algebra K R₁] [Algebra K R₂] [Algebra K R₃] [Algebra K R₄] @@ -365,8 +364,19 @@ def prodMap {K R₁ R₂ R₃ R₄ : Type*} [CommSemiring K] map_mul' := fun x y => by aesop commutes' := fun r => by aesop +@[simp] theorem prodMap_apply {K R₁ R₂ R₃ R₄ : Type*} [CommSemiring K] + [Semiring R₁] [Semiring R₂] [Semiring R₃] [Semiring R₄] + [Algebra K R₁] [Algebra K R₂] [Algebra K R₃] [Algebra K R₄] + (f : R₁ ≃ₐ[K] R₂) (g : R₃ ≃ₐ[K] R₄) (x : R₁ × R₃) : + prodMap f g x = (f x.1, g x.2) := by rfl + +@[simp] theorem prodMap_symm_apply {K R₁ R₂ R₃ R₄ : Type*} [CommSemiring K] + [Semiring R₁] [Semiring R₂] [Semiring R₃] [Semiring R₄] + [Algebra K R₁] [Algebra K R₂] [Algebra K R₃] [Algebra K R₄] + (f : R₁ ≃ₐ[K] R₂) (g : R₃ ≃ₐ[K] R₄) (x : R₂ × R₄) : + (prodMap f g).symm x = (f.symm x.1, g.symm x.2) := by rfl + /-- Dependent-function algebra equivalence induced by pointwise algebra equivalences. -/ -@[simps] def Pi {K ι : Type*} [CommSemiring K] {R : ι → Type*} [∀ i, Semiring (R i)] [∀ i, Algebra K (R i)] (f : Π i, R i ≃ₐ[K] R i) : @@ -379,6 +389,16 @@ def Pi {K ι : Type*} [CommSemiring K] {R : ι → Type*} map_mul' := fun x y => funext fun i => _root_.map_mul _ (x i) (y i) commutes' := fun r => funext fun i => (f i).commutes r +@[simp] theorem Pi_apply {K ι : Type*} [CommSemiring K] {R : ι → Type*} + [∀ i, Semiring (R i)] [∀ i, Algebra K (R i)] + (f : Π i, R i ≃ₐ[K] R i) (x : Π i, R i) (i : ι) : + Pi f x i = f i (x i) := by rfl + +@[simp] theorem Pi_symm_apply {K ι : Type*} [CommSemiring K] {R : ι → Type*} + [∀ i, Semiring (R i)] [∀ i, Algebra K (R i)] + (f : Π i, R i ≃ₐ[K] R i) (x : Π i, R i) (i : ι) : + (Pi f).symm x i = (f i).symm (x i) := by rfl + end AlgEquiv /-- Square matrix algebras of finite types are linearly equivalent exactly when @@ -801,7 +821,7 @@ theorem matrixPiFinAlgEquivPiFinTwo_apply {𝕜 : Type*} [CommSemiring 𝕜] [∀ i, Fintype (n i)] [∀ i, DecidableEq (n i)] (x : Π i : Fin (k + 1), Mat 𝕜 (n i)) : matrixPiFinAlgEquivPiFinTwo x = (x 0, fun j : Fin k => x j.succ) := - rfl + by rfl theorem matrixPiFinAlgEquivPiFinTwo_symm_apply {𝕜 : Type*} [CommSemiring 𝕜] {k : ℕ} {n : Fin (k + 1) → Type*} @@ -845,7 +865,7 @@ theorem matrixPiFinTwoAlgEquivProd_apply {𝕜 : Type*} [CommSemiring 𝕜] {n : Fin 2 → Type*} [∀ i, Fintype (n i)] [∀ i, DecidableEq (n i)] (x : Π i : Fin 2, Mat 𝕜 (n i)) : matrixPiFinTwoAlgEquivProd x = (x 0, x 1) := - rfl + by rfl @[simp] theorem matrixPiFinTwoAlgEquivProd_symm_apply {𝕜 : Type*} [CommSemiring 𝕜] @@ -1077,7 +1097,7 @@ theorem AlgEquiv.matrix_prod_aut' {𝕜 n m : Type*} [Field 𝕜] [Fintype n] AlgEquiv.ofProdMap₂₂ f h.2 use f₁, f₂ ext1 x - simp_rw [AlgEquiv.prodMap_apply, Prod.map_apply'] + simp_rw [AlgEquiv.prodMap_apply] calc f x = f (x.1, 0) + f (0, x.2) := by rw [← map_add, Prod.fst_add_snd] @@ -1097,8 +1117,7 @@ theorem AlgEquiv.matrix_prod_aut' {𝕜 n m : Type*} [Field 𝕜] [Fintype n] AlgEquiv.ofProdMap₂₁ f h.2 use g₂, g₁ ext1 x - simp_rw [Function.comp_apply, Prod.swap, AlgEquiv.prodMap_apply, - Prod.map_apply] + simp_rw [Function.comp_apply, Prod.swap, AlgEquiv.prodMap_apply] calc f x = f (0, x.2) + f (x.1, 0) := by rw [← map_add, add_comm, Prod.fst_add_snd] diff --git a/LeanPool/Monsky.lean b/LeanPool/Monsky.lean index ca380b7e1c..84d9ef3583 100644 --- a/LeanPool/Monsky.lean +++ b/LeanPool/Monsky.lean @@ -30,7 +30,7 @@ Tags: geometry, combinatorics, measure-theory MSC: 52C20, 05B45 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Monsky/Appendix.lean b/LeanPool/Monsky/Appendix.lean index 551ef97c45..6d59a77279 100644 --- a/LeanPool/Monsky/Appendix.lean +++ b/LeanPool/Monsky/Appendix.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.Appendix`. -/ -@[expose] public section +public section namespace LeanPool.Monsky diff --git a/LeanPool/Monsky/BasicDefinitions.lean b/LeanPool/Monsky/BasicDefinitions.lean index 228e9dd91e..87bd7ec05f 100644 --- a/LeanPool/Monsky/BasicDefinitions.lean +++ b/LeanPool/Monsky/BasicDefinitions.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.BasicDefinitions`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -30,30 +30,31 @@ open Finset The closedHulls of the polygons cover X. -/ /-- `X` equals the union of the closed hulls of the polygons in `S`. -/ -def isCover {n : ℕ} (X : Set ℝ²) (S : Set (Fin n → ℝ²)) : Prop := +@[expose] def isCover {n : ℕ} (X : Set ℝ²) (S : Set (Fin n → ℝ²)) : Prop := (X = ⋃ (P ∈ S), closedHull P) /- The openHulls of the polygons do not intersect. -/ /-- The open hulls of distinct polygons in `S` are pairwise disjoint. -/ -def isDisjointPolygonSet {n : ℕ} (S : Set (Fin n → ℝ²)) : Prop := +@[expose] def isDisjointPolygonSet {n : ℕ} (S : Set (Fin n → ℝ²)) : Prop := (∀ T₁ ∈ S, ∀ T₂ ∈ S, T₁ ≠ T₂ → Disjoint (openHull T₁) (openHull T₂)) /-- `isDisjointCover X S` states that `S` covers `X` and its open hulls are pairwise disjoint. -/ -def isDisjointCover {n : ℕ} (X : Set ℝ²) (S : Set (Fin n → ℝ²)) : Prop := +@[expose] def isDisjointCover {n : ℕ} (X : Set ℝ²) (S : Set (Fin n → ℝ²)) : Prop := isCover X S ∧ isDisjointPolygonSet S /- For now we use this formula as the definition of the area.-/ /-- The area of a triangle, given by half the absolute value of its determinant. -/ -noncomputable def triangleArea (T : Triangle) : ℝ := +@[expose] noncomputable def triangleArea (T : Triangle) : ℝ := abs (det T) / 2 /- -/ /-- A disjoint cover of `X` by triangles all having the same area. -/ +@[expose] def isEqualAreaCover (X : Set ℝ²) (S : Set Triangle) : Prop := isDisjointCover X S ∧ (∃ (area : ℝ), ∀ T, (T ∈ S) → triangleArea T = area) diff --git a/LeanPool/Monsky/MainStatement.lean b/LeanPool/Monsky/MainStatement.lean index 55088c5811..459d9d00ac 100644 --- a/LeanPool/Monsky/MainStatement.lean +++ b/LeanPool/Monsky/MainStatement.lean @@ -21,7 +21,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch Imported Lean Pool material for `LeanPool.Monsky.MainStatement`. -/ -@[expose] public section +public section namespace LeanPool.Monsky diff --git a/LeanPool/Monsky/Miscellaneous.lean b/LeanPool/Monsky/Miscellaneous.lean index 7c4f1d6e4b..9c43b7cf1c 100644 --- a/LeanPool/Monsky/Miscellaneous.lean +++ b/LeanPool/Monsky/Miscellaneous.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.Miscellaneous`. -/ -@[expose] public section +public section namespace LeanPool.Monsky open BigOperators diff --git a/LeanPool/Monsky/MonskyEven.lean b/LeanPool/Monsky/MonskyEven.lean index 10e3db1958..3e98f68c4f 100644 --- a/LeanPool/Monsky/MonskyEven.lean +++ b/LeanPool/Monsky/MonskyEven.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monsky.MonskyEven`. -/ -@[expose] public section +public section namespace LeanPool.Monsky diff --git a/LeanPool/Monsky/RainbowTriangles.lean b/LeanPool/Monsky/RainbowTriangles.lean index a71b5324fc..cf45cfce7a 100644 --- a/LeanPool/Monsky/RainbowTriangles.lean +++ b/LeanPool/Monsky/RainbowTriangles.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.RainbowTriangles`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -105,6 +105,7 @@ lemma blue_region (X : ℝ²) : (coloring v X = Color.Blue) → v (X 0) ≥ v (1 -- Record our definition of a rainbow triangle /-- A triangle is rainbow if its three vertices receive all three colors. -/ +@[expose] def rainbowTriangle (T : Fin 3 → ℝ²) : Prop := Function.Surjective (coloring v ∘ T) -- We need a few inequalities that will be used in the proof of the main lemma. diff --git a/LeanPool/Monsky/SegmentCounting.lean b/LeanPool/Monsky/SegmentCounting.lean index 343cb27cf4..e68275e1b3 100644 --- a/LeanPool/Monsky/SegmentCounting.lean +++ b/LeanPool/Monsky/SegmentCounting.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.Monsky.SegmentCounting`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -74,10 +74,10 @@ noncomputable def chainToBigSegment {u v : ℝ²} (C : Chain u v) : Segment := | _ => toSegment u v lemma chainToBigSegment_join {u v w} (h : colin u v w) (C : Chain v w) : - chainToBigSegment (Chain.join h C) = toSegment u w := rfl + chainToBigSegment (Chain.join h C) = toSegment u w := by rfl lemma chainToBigSegment_glue {u v w : ℝ²} (h : colin u v w) (CL : Chain u v) - (CR : Chain v w) : chainToBigSegment (glueChains h CL CR) = toSegment u w := rfl + (CR : Chain v w) : chainToBigSegment (glueChains h CL CR) = toSegment u w := by rfl lemma glueChains_assoc {u v w x : ℝ²} (C₁ : Chain u v) (C₂ : Chain v w) (C₃ : Chain w x) (h₁ : colin u v w) (h₂ : colin v w x) : diff --git a/LeanPool/Monsky/SegmentTriangle.lean b/LeanPool/Monsky/SegmentTriangle.lean index 892c8cc26b..227470f33f 100644 --- a/LeanPool/Monsky/SegmentTriangle.lean +++ b/LeanPool/Monsky/SegmentTriangle.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.SegmentTriangle`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -39,7 +39,7 @@ open Finset /- 'Determinant' of a triangle. -/ /-- The determinant (signed area form) attached to a triangle's three vertices. -/ -def det (T : Triangle) : ℝ +@[expose] def det (T : Triangle) : ℝ := (T 0 1 - T 1 1) * (T 2 0) + (T 1 0 - T 0 0) * (T 2 1) + ((T 0 0) * (T 1 1) - (T 1 0) * (T 0 1)) /-- The `2×2` determinant of two plane vectors. -/ @@ -47,30 +47,32 @@ def det₂ (x y : ℝ²) : ℝ := x 0 * y 1 - x 1 * y 0 /- The vector pointing from the start of the segment to the end.-/ /-- The direction vector of a segment, from its first to its second endpoint. -/ +@[expose] noncomputable def segVec (L : Segment) : ℝ² := L 1 - L 0 /-- The sign of the determinant of a triangle, as an element of `ℝ`. -/ -def signSeg (L : Segment) (v : ℝ²) : ℝ := det (fun | 0 => L 0 | 1 => L 1 | 2 => v) +@[expose] def signSeg (L : Segment) (v : ℝ²) : ℝ := det (fun | 0 => L 0 | 1 => L 1 | 2 => v) /-- The segment with the two given endpoints. -/ -def toSegment (a b : ℝ²) : Segment := fun | 0 => a | 1 => b +@[expose] def toSegment (a b : ℝ²) : Segment := fun | 0 => a | 1 => b /-- The segment with its two endpoints swapped. -/ -def reverseSegment (L : Segment) : Segment := toSegment (L 1) (L 0) +@[expose] def reverseSegment (L : Segment) : Segment := toSegment (L 1) (L 0) /-- `colin u v w` states that `v` lies strictly between the distinct points `u` and `w`. -/ +@[expose] def colin (u v w : ℝ²) : Prop := u ≠ w ∧ v ∈ openHull (toSegment u w) /- Tside i defines the 'directed' opposite side of T i.-/ /-- The `i`-th side of a triangle, as a segment. -/ -def Tside (T : Triangle) : Fin 3 → Segment := fun +@[expose] def Tside (T : Triangle) : Fin 3 → Segment := fun | 0 => (fun | 0 => T 1 | 1 => T 2) | 1 => (fun | 0 => T 2 | 1 => T 0) | 2 => (fun | 0 => T 0 | 1 => T 1) /- Barycentric coordinates on triangle T. -/ /-- The `i`-th barycentric coordinate of a point with respect to a triangle. -/ -noncomputable def Tco (T : Triangle) (x : ℝ²) : Fin 3 → ℝ := +@[expose] noncomputable def Tco (T : Triangle) (x : ℝ²) : Fin 3 → ℝ := fun i ↦ (signSeg (Tside T i) x) / det T /- @@ -1799,7 +1801,7 @@ lemma open_sub_closed_sub (S L : Segment) (h : openHull S ⊆ openHull L) : /-- A small segment centered at `x` in the direction of a given vector. -/ -noncomputable def segmentAroundX (x y : ℝ²) (ε₁ ε₂ : ℝ) +@[expose] noncomputable def segmentAroundX (x y : ℝ²) (ε₁ ε₂ : ℝ) : Segment := toSegment (x + (1 * ε₁) • y) (x + (-1 * ε₂) • y) lemma openHull_segment_around {x y : ℝ²} {ε₁ ε₂ : ℝ} (h₁ : 0 < ε₁) diff --git a/LeanPool/Monsky/SimplexBasic.lean b/LeanPool/Monsky/SimplexBasic.lean index e81112ee15..6366f4aca3 100644 --- a/LeanPool/Monsky/SimplexBasic.lean +++ b/LeanPool/Monsky/SimplexBasic.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.SimplexBasic`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -30,7 +30,7 @@ open Finset -- Shorthand for defining an element of ℝ² /-- The plane vector with the two given real coordinates. -/ -def v (x y : ℝ) : ℝ² := !₂[x, y] +@[expose] def v (x y : ℝ) : ℝ² := !₂[x, y] @[simp] lemma v₀_val {x y : ℝ} : (v x y) 0 = x := by simp [v] @@ -40,9 +40,9 @@ lemma v₁_val {x y : ℝ} : (v x y) 1 = y := by simp [v] -- Definition of an n-dimensional standard simplex. /-- The closed standard `n`-simplex of nonnegative weights summing to one. -/ -def closedSimplex (n : ℕ) : Set (Fin n → ℝ) := {α | (∀ i, 0 ≤ α i) ∧ ∑ i, α i = 1} +@[expose] def closedSimplex (n : ℕ) : Set (Fin n → ℝ) := {α | (∀ i, 0 ≤ α i) ∧ ∑ i, α i = 1} /-- The open standard `n`-simplex of positive weights summing to one. -/ -def openSimplex (n : ℕ) : Set (Fin n → ℝ) := {α | (∀ i, 0 < α i) ∧ ∑ i, α i = 1} +@[expose] def openSimplex (n : ℕ) : Set (Fin n → ℝ) := {α | (∀ i, 0 < α i) ∧ ∑ i, α i = 1} /- The Fin n → ℝ² in the following definitions represents the vertices of a polygon. @@ -53,8 +53,10 @@ def openSimplex (n : ℕ) : Set (Fin n → ℝ) := {α | (∀ i, 0 < α i) ∧ Also when f i = P for all i, both the closedHull and openHull are {P i}. -/ /-- The closed convex hull of a finite point family, via the closed simplex. -/ +@[expose] def closedHull {n : ℕ} (f : Fin n → ℝ²) : Set ℝ² := (fun α ↦ ∑ i, α i • f i) '' closedSimplex n /-- The open convex hull of a finite point family, via the open simplex. -/ +@[expose] def openHull {n : ℕ} (f : Fin n → ℝ²) : Set ℝ² := (fun α ↦ ∑ i, α i • f i) '' openSimplex n @@ -128,6 +130,7 @@ lemma openHull_zero_dim (f : Fin 0 → ℝ²) : openHull f = ∅ := by /-- The point obtained as a weighted combination of a point family. -/ +@[expose] noncomputable def linearCombination {n : ℕ} (α : Fin n → ℝ) (f : Fin n → ℝ²) : ℝ² := ∑ i, α i • f i @@ -199,7 +202,7 @@ lemma simplex_open_sub_fin2 {α : Fin 2 → ℝ} (h : α ∈ openSimplex 2) : simplex_closed_sub_fin2 (open_sub_closedSimplex h) /-- Encodes a real `x` as the pair of weights `(x, 1 - x)`. -/ -def real_to_fin_2 (x : ℝ) : (Fin 2 → ℝ) := fun | 0 => x | 1 => 1 - x +@[expose] def real_to_fin_2 (x : ℝ) : (Fin 2 → ℝ) := fun | 0 => x | 1 => 1 - x lemma real_to_fin_2_closed {x : ℝ} (h₁ : 0 ≤ x) (h₂ : x ≤ 1) : real_to_fin_2 x ∈ closedSimplex 2 := @@ -253,7 +256,7 @@ lemma closedHull_openHull_com {n : ℕ} {P : Fin n → ℝ²} {x y : ℝ²} -/ /-- The boundary of the convex hull of a point family: closed hull minus open hull. -/ -def boundary {n : ℕ} (P : Fin n → ℝ²) : Set ℝ² := (closedHull P) \ (openHull P) +@[expose] def boundary {n : ℕ} (P : Fin n → ℝ²) : Set ℝ² := (closedHull P) \ (openHull P) lemma boundary_sub_closed {n : ℕ} (P : Fin n → ℝ²) : boundary P ⊆ closedHull P := Set.sdiff_subset diff --git a/LeanPool/Monsky/Square.lean b/LeanPool/Monsky/Square.lean index d63520f98f..17fc851374 100644 --- a/LeanPool/Monsky/Square.lean +++ b/LeanPool/Monsky/Square.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Monsky.Square`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -33,7 +33,7 @@ open Finset -/ /-- The unit square as a four-vertex polygon. -/ -def unitSquare : Fin 4 → ℝ² := (fun | 0 => v 0 0 | 1 => v 1 0 | 2 => v 1 1 | 3 => v 0 1) +@[expose] def unitSquare : Fin 4 → ℝ² := (fun | 0 => v 0 0 | 1 => v 1 0 | 2 => v 1 1 | 3 => v 0 1) lemma closed_unitSquare_eq : closedHull unitSquare = {x | ∀ i, 0 ≤ x i ∧ x i ≤ 1} := by @@ -436,14 +436,14 @@ lemma segment_triangle_pairing_boundary (S : Finset Triangle) -- Lemmas and Theorems about the square boundary /-- The `i`-th side of the unit square, as a segment. -/ -def squareBoundaryBig : Fin 4 → Segment := fun +@[expose] def squareBoundaryBig : Fin 4 → Segment := fun | 0 => (fun | 0 => v 0 0 | 1 => v 1 0) | 1 => (fun | 0 => v 1 0 | 1 => v 1 1) | 2 => (fun | 0 => v 1 1 | 1 => v 0 1) | 3 => (fun | 0 => v 0 1 | 1 => v 0 0) /-- The four sides of the unit square, as a set of segments. -/ -noncomputable def squareBoundaryBigSet : Finset Segment := +@[expose] noncomputable def squareBoundaryBigSet : Finset Segment := @Finset.biUnion (Fin 4) Segment _ ⊤ (fun i ↦ {squareBoundaryBig i}) @@ -464,8 +464,10 @@ lemma square_boundary_sides_nonDegen (i : Fin 4) : /-- The index of the coordinate that is constant along side `i` of the square. -/ +@[expose] def boundaryLine : Fin 4 → Fin 2 := fun | 0 => 0 | 1 => 1 | 2 => 0 | 3 => 1 /-- The constant coordinate value along side `i` of the unit square. -/ +@[expose] def bc : Fin 4 → ℝ := fun | 0 => 0 | 1 => 1 | 2 => 1 | 3 => 0 @[simp] diff --git a/LeanPool/Monsky/TriangleCorollary.lean b/LeanPool/Monsky/TriangleCorollary.lean index 2eff7a7555..56807f3f19 100644 --- a/LeanPool/Monsky/TriangleCorollary.lean +++ b/LeanPool/Monsky/TriangleCorollary.lean @@ -18,7 +18,7 @@ import Mathlib.MeasureTheory.Measure.Lebesgue.Integral Imported Lean Pool material for `LeanPool.Monsky.TriangleCorollary`. -/ -@[expose] public section +public section namespace LeanPool.Monsky @@ -73,7 +73,7 @@ theorem map_pres (X : Set ℝ²) : volume X = volume (idMap '' X) := (volume_preserving_finTwoArrow ℝ)) X /-- `idMap` sends a Euclidean plane vector to the pair of its coordinates. -/ -@[simp] lemma idMap_apply (x : ℝ²) : idMap x = (x 0, x 1) := rfl +@[simp] lemma idMap_apply (x : ℝ²) : idMap x = (x 0, x 1) := by rfl /-- The unit triangle with vertices `(0,0)`, `(1,0)` and `(0,1)`. -/ def unitTriangle : Triangle := fun | 0 => (v 0 0) | 1 => (v 1 0) | 2 => (v 0 1) diff --git a/LeanPool/MooreBound/DegreeDiameter/All.lean b/LeanPool/MooreBound/DegreeDiameter/All.lean index 17c9486f2e..748ff72393 100644 --- a/LeanPool/MooreBound/DegreeDiameter/All.lean +++ b/LeanPool/MooreBound/DegreeDiameter/All.lean @@ -39,7 +39,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/Asymptotics.lean b/LeanPool/MooreBound/DegreeDiameter/Asymptotics.lean index 2c4b04567b..f139068517 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Asymptotics.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Asymptotics.lean @@ -21,7 +21,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -34,7 +34,7 @@ open SimpleGraph /-- The exact interface required from the halved flag-graph construction. The intentionally slightly weaker degree estimate `(p+1)^(2*k)` is the estimate proved directly by the construction and is all that the limiting arguments need. -/ -noncomputable def AsymptoticHalvedWitness (k p : ℕ) : Prop := +@[expose] noncomputable def AsymptoticHalvedWitness (k p : ℕ) : Prop := ∃ (V : Type) (G : SimpleGraph V) (Δ : ℕ), Finite V ∧ p ^ (2 * k * k) ≤ Nat.card V ∧ @@ -43,7 +43,7 @@ noncomputable def AsymptoticHalvedWitness (k p : ℕ) : Prop := G.ediam ≤ (k : ℕ∞) /-- A construction theorem in precisely the form consumed below. -/ -def AsymptoticHalvedWitnessHypothesis : Prop := +@[expose] def AsymptoticHalvedWitnessHypothesis : Prop := ∀ k p : ℕ, 0 < k → Nat.Prime p → AsymptoticHalvedWitness k p lemma maxDegreeLE_of_regular {V : Type*} {G : SimpleGraph V} {Δ : ℕ} diff --git a/LeanPool/MooreBound/DegreeDiameter/AsymptoticsLimits.lean b/LeanPool/MooreBound/DegreeDiameter/AsymptoticsLimits.lean index 08c78ea8c2..fc3c5511c0 100644 --- a/LeanPool/MooreBound/DegreeDiameter/AsymptoticsLimits.lean +++ b/LeanPool/MooreBound/DegreeDiameter/AsymptoticsLimits.lean @@ -24,7 +24,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -35,7 +35,7 @@ namespace DegreeDiameter noncomputable section /-- Abstract form of the sole PNT consequence used in the analytic reduction. -/ -def PrimeIntervalHypothesis : Prop := +@[expose] def PrimeIntervalHypothesis : Prop := ∀ {η : ℝ}, 0 < η → ∀ᶠ x : ℝ in atTop, ∃ p : ℕ, Nat.Prime p ∧ x < p ∧ p < (1 + η) * x @@ -114,7 +114,7 @@ lemma eventually_prime_near_nthRoot (hprime : PrimeIntervalHypothesis) omega /-- The real comparison used in both lower-bound arguments. -/ -def rootComparison (D : ℕ → ℕ) (m t : ℕ) (η : ℝ) (d : ℕ) : ℝ := +@[expose] def rootComparison (D : ℕ → ℕ) (m t : ℕ) (η : ℝ) (d : ℕ) : ℝ := ((Nat.nthRoot m (D d) : ℝ) / ((Nat.nthRoot m (D d) : ℝ) + 1) / (1 + η)) ^ (m * t) diff --git a/LeanPool/MooreBound/DegreeDiameter/CommonBasis.lean b/LeanPool/MooreBound/DegreeDiameter/CommonBasis.lean index f415ea4010..77c874e438 100644 --- a/LeanPool/MooreBound/DegreeDiameter/CommonBasis.lean +++ b/LeanPool/MooreBound/DegreeDiameter/CommonBasis.lean @@ -23,7 +23,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -63,7 +63,7 @@ theorem ext {F G : CompleteFlag K V n} (h : ∀ i, F i = G i) : F = G := by rfl /-- The complete flag of prefix spans of an ordered basis. -/ -noncomputable def ofBasis (b : Basis (Fin n) K V) : CompleteFlag K V n where +@[expose] noncomputable def ofBasis (b : Basis (Fin n) K V) : CompleteFlag K V n where space := b.flag strictMono_space := b.flag_strictMono finrank_space := by @@ -79,10 +79,12 @@ noncomputable def ofBasis (b : Basis (Fin n) K V) : CompleteFlag K V n where space_zero := b.flag_zero space_last := b.flag_last +theorem ofBasis_space (b : Basis (Fin n) K V) : (ofBasis b).space = b.flag := by rfl + end CompleteFlag /-- The set of entries appearing before rank `i` in an ordering `σ`. -/ -def PrefixSet {n : ℕ} (σ : Equiv.Perm (Fin n)) (i : Fin (n + 1)) : Set (Fin n) := +@[expose] def PrefixSet {n : ℕ} (σ : Equiv.Perm (Fin n)) (i : Fin (n + 1)) : Set (Fin n) := σ '' {j | j.castSucc < i} theorem ofBasis_reindex_apply {n : ℕ} (b : Basis (Fin n) K V) diff --git a/LeanPool/MooreBound/DegreeDiameter/CompletionCount.lean b/LeanPool/MooreBound/DegreeDiameter/CompletionCount.lean index be08e045b2..28fb9b15a4 100644 --- a/LeanPool/MooreBound/DegreeDiameter/CompletionCount.lean +++ b/LeanPool/MooreBound/DegreeDiameter/CompletionCount.lean @@ -25,7 +25,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -261,17 +261,17 @@ def oddUpperRank (k : ℕ) (j : Fin k) : Fin ((2 * k + 1) + 1) := ⟨2 * j.val + 3, by omega⟩ @[simp] theorem evenLowerRank_val (k : ℕ) (j : Fin k) : - (evenLowerRank k j).val = 2 * j.val := rfl + (evenLowerRank k j).val = 2 * j.val := by rfl @[simp] theorem oddMiddleRank_val (k : ℕ) (j : Fin k) : - (oddMiddleRank k j).val = 2 * j.val + 1 := rfl + (oddMiddleRank k j).val = 2 * j.val + 1 := by rfl @[simp] theorem evenUpperRank_val (k : ℕ) (j : Fin k) : - (evenUpperRank k j).val = 2 * j.val + 2 := rfl + (evenUpperRank k j).val = 2 * j.val + 2 := by rfl @[simp] theorem oddLowerRank_val (k : ℕ) (j : Fin k) : - (oddLowerRank k j).val = 2 * j.val + 1 := rfl + (oddLowerRank k j).val = 2 * j.val + 1 := by rfl @[simp] theorem evenMiddleRank_val (k : ℕ) (j : Fin k) : - (evenMiddleRank k j).val = 2 * j.val + 2 := rfl + (evenMiddleRank k j).val = 2 * j.val + 2 := by rfl @[simp] theorem oddUpperRank_val (k : ℕ) (j : Fin k) : - (oddUpperRank k j).val = 2 * j.val + 3 := rfl + (oddUpperRank k j).val = 2 * j.val + 3 := by rfl omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem ofComplete_space_eq_of_mod @@ -341,7 +341,7 @@ theorem completeFlagOfRankedSpaces_apply {n : ℕ} (hstep : ∀ i : Fin n, S i.castSucc ≤ S i.succ) (hzero : S 0 = ⊥) (hlast : S (Fin.last n) = ⊤) (i : Fin (n + 1)) : - completeFlagOfRankedSpaces S hrank hstep hzero hlast i = S i := rfl + completeFlagOfRankedSpaces S hrank hstep hzero hlast i = S i := by rfl /-- The product of the `k` projective-line intervals in which an even partial flag can be completed. -/ @@ -403,7 +403,7 @@ theorem evenCompletionCoordinates_space (k : ℕ) (x : {Q : OddPartialFlag (K := K) (V := V) (n := 2 * k + 1) // Compatible P Q}) (j : Fin k) : (evenCompletionCoordinates k P x j).space = - completeOfEvenCompatibility k P x (oddMiddleRank k j) := rfl + completeOfEvenCompatibility k P x (oddMiddleRank k j) := by rfl omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem evenCompletionCoordinates_injective (k : ℕ) @@ -578,7 +578,7 @@ omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem completeFlagOfEvenCoordinates_apply (k : ℕ) (P : EvenPartialFlag (K := K) (V := V) (n := 2 * k + 1)) (c : EvenCompletionCoordinates k P) (i : Fin ((2 * k + 1) + 1)) : - completeFlagOfEvenCoordinates k P c i = evenCompletedSpace k P c i := rfl + completeFlagOfEvenCoordinates k P c i = evenCompletedSpace k P c i := by rfl omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem completeFlagOfEvenCoordinates_evenPart (k : ℕ) @@ -715,7 +715,7 @@ theorem oddCompletionCoordinates_space (k : ℕ) (x : {P : EvenPartialFlag (K := K) (V := V) (n := 2 * k + 1) // Compatible P Q}) (j : Fin k) : (oddCompletionCoordinates k Q x j).space = - completeOfOddCompatibility k Q x (evenMiddleRank k j) := rfl + completeOfOddCompatibility k Q x (evenMiddleRank k j) := by rfl omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem oddCompletionCoordinates_injective (k : ℕ) @@ -889,7 +889,7 @@ omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem completeFlagOfOddCoordinates_apply (k : ℕ) (Q : OddPartialFlag (K := K) (V := V) (n := 2 * k + 1)) (c : OddCompletionCoordinates k Q) (i : Fin ((2 * k + 1) + 1)) : - completeFlagOfOddCoordinates k Q c i = oddCompletedSpace k Q c i := rfl + completeFlagOfOddCoordinates k Q c i = oddCompletedSpace k Q c i := by rfl omit [FiniteDimensional K V] [Finite K] [Finite V] in theorem completeFlagOfOddCoordinates_oddPart (k : ℕ) diff --git a/LeanPool/MooreBound/DegreeDiameter/Construction.lean b/LeanPool/MooreBound/DegreeDiameter/Construction.lean index 65eb17e231..848a9f92e1 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Construction.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Construction.lean @@ -22,7 +22,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/Corollary12FromProposition31.lean b/LeanPool/MooreBound/DegreeDiameter/Corollary12FromProposition31.lean index c0a1020be0..27d33c9509 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Corollary12FromProposition31.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Corollary12FromProposition31.lean @@ -29,7 +29,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/EdgeReduction.lean b/LeanPool/MooreBound/DegreeDiameter/EdgeReduction.lean index de00e9cf59..34fd39801a 100644 --- a/LeanPool/MooreBound/DegreeDiameter/EdgeReduction.lean +++ b/LeanPool/MooreBound/DegreeDiameter/EdgeReduction.lean @@ -19,7 +19,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -79,7 +79,7 @@ def bipartiteEdge (H : SimpleGraph V) (x y : V) (hxy : Linked H x y) : @[simp] lemma bipartiteEdge_val (H : SimpleGraph V) (x y : V) (hxy : Linked H x y) : (bipartiteEdge H x y hxy : Sym2 (V ⊕ V)) = s(.inl x, .inr y) := - rfl + by rfl lemma setOf_linked_eq_insert_neighborSet (H : SimpleGraph V) (x : V) : {y : V | Linked H x y} = insert x (H.neighborSet x) := by diff --git a/LeanPool/MooreBound/DegreeDiameter/ExactDiameter.lean b/LeanPool/MooreBound/DegreeDiameter/ExactDiameter.lean index 3ea218e0a3..b235aa1fc1 100644 --- a/LeanPool/MooreBound/DegreeDiameter/ExactDiameter.lean +++ b/LeanPool/MooreBound/DegreeDiameter/ExactDiameter.lean @@ -30,7 +30,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/ExactOrder.lean b/LeanPool/MooreBound/DegreeDiameter/ExactOrder.lean index c715a33670..53bd17dc41 100644 --- a/LeanPool/MooreBound/DegreeDiameter/ExactOrder.lean +++ b/LeanPool/MooreBound/DegreeDiameter/ExactOrder.lean @@ -25,7 +25,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/FiniteFieldModels.lean b/LeanPool/MooreBound/DegreeDiameter/FiniteFieldModels.lean index 4932e27900..94ac4bd201 100644 --- a/LeanPool/MooreBound/DegreeDiameter/FiniteFieldModels.lean +++ b/LeanPool/MooreBound/DegreeDiameter/FiniteFieldModels.lean @@ -28,7 +28,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/FlagEnumeration.lean b/LeanPool/MooreBound/DegreeDiameter/FlagEnumeration.lean index f3a9a64c2c..cd0b488ce0 100644 --- a/LeanPool/MooreBound/DegreeDiameter/FlagEnumeration.lean +++ b/LeanPool/MooreBound/DegreeDiameter/FlagEnumeration.lean @@ -32,7 +32,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -42,7 +42,7 @@ open scoped BigOperators namespace DegreeDiameter /-- The `q`-integer `[n]_q = 1 + q + ... + q^(n-1)`. -/ -def qInteger (q n : ℕ) : ℕ := +@[expose] def qInteger (q n : ℕ) : ℕ := ∑ i ∈ Finset.range n, q ^ i /-- The `q`-factorial `[n]_q! = [n]_q [n-1]_q ... [1]_q`. @@ -110,6 +110,7 @@ variable {K V : Type*} [Field K] [AddCommGroup V] [Module K V] /-- A vector which advances the complete flag `F` from rank `i` to rank `i+1`. -/ +@[expose] def FlagStepVector (F : CompleteFlag K V n) (i : Fin n) := {x : F i.succ // (x : V) ∉ F i.castSucc} @@ -119,7 +120,7 @@ noncomputable instance flagStepVectorFinite [Finite V] infer_instance /-- One advancing vector at every rank of a complete flag. -/ -def FlagStepChoices (F : CompleteFlag K V n) := +@[expose] def FlagStepChoices (F : CompleteFlag K V n) := (i : Fin n) → FlagStepVector F i noncomputable instance flagStepChoicesFinite [Finite V] @@ -129,6 +130,7 @@ noncomputable instance flagStepChoicesFinite [Finite V] /-- A complete flag together with a choice of one advancing vector at every rank. -/ +@[expose] def AdaptedFlagBasis (K V : Type*) [Field K] [AddCommGroup V] [Module K V] (n : ℕ) := Σ F : CompleteFlag K V n, FlagStepChoices F @@ -273,9 +275,13 @@ noncomputable def adaptedFlagBasisEquivLinearIndependent simp [hV]) let F : CompleteFlag K V n := CompleteFlag.ofBasis b let a : FlagStepChoices F := fun i ↦ - ⟨⟨b i, b.self_mem_flag (by simp)⟩, by + ⟨⟨b i, by + simpa only [F, CompleteFlag.ofBasis_space] using + b.self_mem_flag (i := i) (k := i.succ) (by simp)⟩, by intro hmem - exact (lt_irrefl i.castSucc) ((b.self_mem_flag_iff).mp hmem)⟩ + have hmem' : b i ∈ b.flag i.castSucc := by + simpa only [F, CompleteFlag.ofBasis_space] using hmem + exact (lt_irrefl i.castSucc) ((b.self_mem_flag_iff).mp hmem')⟩ refine ⟨⟨F, a⟩, ?_⟩ apply Subtype.ext funext i diff --git a/LeanPool/MooreBound/DegreeDiameter/FlagSpace.lean b/LeanPool/MooreBound/DegreeDiameter/FlagSpace.lean index 329114d06d..d05b42ddf5 100644 --- a/LeanPool/MooreBound/DegreeDiameter/FlagSpace.lean +++ b/LeanPool/MooreBound/DegreeDiameter/FlagSpace.lean @@ -23,7 +23,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -40,7 +40,7 @@ abbrev FlagSpace (K : Type u) : ℕ → Type u /-- The dimension of `FlagSpace`, kept recursive so adjoining its first two coordinates remains definitionally transparent. -/ -def flagDim : ℕ → ℕ +@[expose] def flagDim : ℕ → ℕ | 0 => 1 | k + 1 => flagDim k + 2 diff --git a/LeanPool/MooreBound/DegreeDiameter/Framework.lean b/LeanPool/MooreBound/DegreeDiameter/Framework.lean index d5e8073855..17ffe39f4f 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Framework.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Framework.lean @@ -28,7 +28,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -42,13 +42,14 @@ universe u /-- Every vertex of `G` has degree at most `d`, expressed without choosing a decidable adjacency relation. For a finite vertex type, `Set.ncard (G.neighborSet v)` is the ordinary vertex degree. -/ +@[expose] noncomputable def MaxDegreeLE {V : Type*} (G : SimpleGraph V) (d : ℕ) : Prop := ∀ v, (G.neighborSet v).ncard ≤ d /-! ## A coarse breadth-first bound -/ /-- One legal breadth-first move: stay at the current vertex, or cross one edge. -/ -def ClosedNeighbor {V : Type u} (G : SimpleGraph V) (x : V) := +@[expose] def ClosedNeighbor {V : Type u} (G : SimpleGraph V) (x : V) := {y : V // x = y ∨ G.Adj x y} instance finite_closedNeighbor {V : Type u} [Finite V] (G : SimpleGraph V) (x : V) : @@ -86,6 +87,7 @@ instance finite_bfsCode (d n : ℕ) : Finite (BFSCode d n) := by | succ n ih => simp [BFSCode, ih, pow_succ, mul_comm] /-- Exact-length breadth-first routes. Unlike graph walks, these permit stationary moves. -/ +@[expose] def BFSRouteCode {V : Type u} (G : SimpleGraph V) : V → ℕ → Type u | _, 0 => PUnit | x, n + 1 => Σ y : ClosedNeighbor G x, BFSRouteCode G y.1 n @@ -275,6 +277,7 @@ lemma maxDegreeLE_lineGraph {V : Type u} [Finite V] {G : SimpleGraph V} {d : ℕ The quantified vertex type is kept native instead of transporting every construction to `Fin n`. `Finite V` makes `Nat.card V` and the set cardinalities mathematically meaningful. -/ +@[expose] noncomputable def OrderAdmissible (k d n : ℕ) : Prop := ∃ (V : Type) (G : SimpleGraph V), Finite V ∧ Nat.card V = n ∧ MaxDegreeLE G d ∧ G.ediam ≤ (k : ℕ∞) @@ -298,6 +301,7 @@ noncomputable def nKD (k d : ℕ) : ℕ := /-- A finite simple graph with `m` edges, maximum degree at most `d`, and line-graph diameter at most `ell`. -/ +@[expose] noncomputable def EdgeAdmissible (ell d m : ℕ) : Prop := ∃ (V : Type) (G : SimpleGraph V), Finite V ∧ G.edgeSet.ncard = m ∧ MaxDegreeLE G d ∧ @@ -321,11 +325,11 @@ lemma edgeAdmissible_set_bddAbove (ell d : ℕ) : /-- The paper defines `h_ell(d) - 1` as the maximum admissible edge count, so we define `h` to be one plus that maximum. -/ -noncomputable def h (ell d : ℕ) : ℕ := +@[expose] noncomputable def h (ell d : ℕ) : ℕ := 1 + sSup {m : ℕ | EdgeAdmissible ell d m} /-- The exact Moore expression. -/ -def mooreBound (k d : ℕ) : ℕ := +@[expose] def mooreBound (k d : ℕ) : ℕ := 1 + d * ∑ j ∈ Finset.range k, (d - 1) ^ j lemma maxDegreeLE_mono {V : Type*} {G : SimpleGraph V} {d d' : ℕ} diff --git a/LeanPool/MooreBound/DegreeDiameter/HalvedFlags.lean b/LeanPool/MooreBound/DegreeDiameter/HalvedFlags.lean index b352394cb2..69830a144c 100644 --- a/LeanPool/MooreBound/DegreeDiameter/HalvedFlags.lean +++ b/LeanPool/MooreBound/DegreeDiameter/HalvedFlags.lean @@ -22,7 +22,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -34,11 +34,12 @@ variable {K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] {n : ℕ} /-- Keep the ranks congruent to `parity` modulo two and erase the others. -/ -def flagPart (parity : ℕ) (F : CompleteFlag K V n) : +@[expose] def flagPart (parity : ℕ) (F : CompleteFlag K V n) : Fin (n + 1) → Submodule K V := fun i ↦ if i.val % 2 = parity % 2 then F i else ⊥ /-- Partial complete flags supported on one parity of ranks. -/ +@[expose] def PartialFlag (parity : ℕ) := {P : Fin (n + 1) → Submodule K V // ∃ F : CompleteFlag K V n, flagPart parity F = P} @@ -66,7 +67,7 @@ theorem ext {parity : ℕ} exact funext h /-- The partial flag of a complete flag at the selected parity. -/ -def ofComplete (parity : ℕ) (F : CompleteFlag K V n) : +@[expose] def ofComplete (parity : ℕ) (F : CompleteFlag K V n) : PartialFlag (K := K) (V := V) (n := n) parity := ⟨flagPart parity F, F, rfl⟩ @@ -78,7 +79,7 @@ end PartialFlag /-- An even and an odd partial flag are compatible when they are the two parts of one complete flag. -/ -def Compatible (P : EvenPartialFlag (K := K) (V := V) (n := n)) +@[expose] def Compatible (P : EvenPartialFlag (K := K) (V := V) (n := n)) (Q : OddPartialFlag (K := K) (V := V) (n := n)) : Prop := ∃ F : CompleteFlag K V n, PartialFlag.ofComplete 0 F = P ∧ PartialFlag.ofComplete 1 F = Q diff --git a/LeanPool/MooreBound/DegreeDiameter/Lemma21.lean b/LeanPool/MooreBound/DegreeDiameter/Lemma21.lean index df856f906d..b6bdf8ea46 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Lemma21.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Lemma21.lean @@ -25,7 +25,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -62,6 +62,7 @@ theorem ofBasis_reindex_eq_at_of_prefixSet_eq {n : ℕ} (b : Basis (Fin n) K V) /-- Step `s + 1` may change only ranks with the same parity as `s + 1`. Equivalently, every rank of the other parity is frozen. -/ +@[expose] def AlternatingStep {n : ℕ} (s : Fin n) (F G : CompleteFlag K V n) : Prop := ∀ i : Fin (n + 1), i.val % 2 ≠ (s.val + 1) % 2 → F i = G i diff --git a/LeanPool/MooreBound/DegreeDiameter/LowerBound.lean b/LeanPool/MooreBound/DegreeDiameter/LowerBound.lean index 05a8870b4a..6431bcd452 100644 --- a/LeanPool/MooreBound/DegreeDiameter/LowerBound.lean +++ b/LeanPool/MooreBound/DegreeDiameter/LowerBound.lean @@ -28,7 +28,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -152,7 +152,7 @@ def skewEquiv (L : (Fin 2 → K) →ₗ[K] Y) : @[simp] theorem skewEquiv_apply (L : (Fin 2 → K) →ₗ[K] Y) (z : (Fin 2 → K) × Y) : - skewEquiv L z = (z.1, z.2 + L z.1) := rfl + skewEquiv L z = (z.1, z.2 + L z.1) := by rfl /-- The image of the horizontal two-space under the skew equivalence is the graph of `L`. -/ diff --git a/LeanPool/MooreBound/DegreeDiameter/MooreBound.lean b/LeanPool/MooreBound/DegreeDiameter/MooreBound.lean index bc7ad76976..7844fde276 100644 --- a/LeanPool/MooreBound/DegreeDiameter/MooreBound.lean +++ b/LeanPool/MooreBound/DegreeDiameter/MooreBound.lean @@ -24,7 +24,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -38,6 +38,7 @@ universe u /-- A possible next vertex after traversing `previous -- current`, excluding the immediate reverse step. -/ +@[expose] def ForwardNeighbor {V : Type u} (G : SimpleGraph V) (previous current : V) := {next : V // G.Adj current next ∧ next ≠ previous} @@ -47,6 +48,7 @@ instance finite_forwardNeighbor {V : Type u} [Finite V] (G : SimpleGraph V) /-- An exact-length nonbacktracking continuation, after an initial directed edge `previous -- current` has already been traversed. -/ +@[expose] def NBContinuation {V : Type u} (G : SimpleGraph V) : V → V → ℕ → Type u | _, _, 0 => PUnit | previous, current, n + 1 => @@ -70,6 +72,7 @@ instance finite_nbContinuation {V : Type u} [Finite V] (G : SimpleGraph V) infer_instance /-- An exact-length nonbacktracking route beginning at `root`. -/ +@[expose] def ExactNBRoute {V : Type u} (G : SimpleGraph V) (root : V) : ℕ → Type u | 0 => PUnit | n + 1 => Σ first : G.neighborSet root, NBContinuation G root first.1 n @@ -224,6 +227,7 @@ lemma natCard_exactNBRoute_succ_le {V : Type u} [Finite V] {G : SimpleGraph V} /-- Routes of length at most `k`, presented recursively as the disjoint union of the earlier layers and the exact length-`k` layer. -/ +@[expose] def BoundedNBRoute {V : Type u} (G : SimpleGraph V) (root : V) : ℕ → Type u | 0 => PUnit | k + 1 => BoundedNBRoute G root k ⊕ ExactNBRoute G root (k + 1) diff --git a/LeanPool/MooreBound/DegreeDiameter/OddEvenRoute.lean b/LeanPool/MooreBound/DegreeDiameter/OddEvenRoute.lean index 79faa1a631..bbc161443e 100644 --- a/LeanPool/MooreBound/DegreeDiameter/OddEvenRoute.lean +++ b/LeanPool/MooreBound/DegreeDiameter/OddEvenRoute.lean @@ -17,18 +17,20 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound namespace OddEvenSorting /-- Sort each disjoint consecutive pair of list entries. -/ +@[expose] def pairPhase {α : Type*} [LinearOrder α] : List α → List α | a :: b :: xs => min a b :: max a b :: pairPhase xs | xs => xs /-- Apply a comparator layer, optionally leaving the first entry fixed. -/ +@[expose] def phase {α : Type*} [LinearOrder α] (shifted : Bool) (xs : List α) : List α := if shifted then match xs with @@ -249,6 +251,7 @@ def countTrue (xs : List Bool) : ℕ := xs.count true simp [phaseN] /-- Iterate alternating comparator layers starting with round q. -/ +@[expose] def evolve {α : Type*} [LinearOrder α] (q : ℕ) (xs : List α) : ℕ → List α | 0 => xs | t + 1 => phaseN (q + t) (evolve q xs t) @@ -846,11 +849,11 @@ theorem permOfList_finRange {n : ℕ} : simpa using permOfList_map_finRange (Equiv.refl (Fin n)) /-- The image of an initial rank segment under a permutation. -/ -def PrefixSet2 {n : ℕ} (σ : Equiv.Perm (Fin n)) (i : Fin (n + 1)) : Set (Fin n) := +@[expose] def PrefixSet2 {n : ℕ} (σ : Equiv.Perm (Fin n)) (i : Fin (n + 1)) : Set (Fin n) := σ '' {j | j.castSucc < i} /-- A layer preserves prefix sets at every inactive rank. -/ -def OrderingStep2 {n : ℕ} (s : Fin n) +@[expose] def OrderingStep2 {n : ℕ} (s : Fin n) (σ τ : Equiv.Perm (Fin n)) : Prop := ∀ i : Fin (n + 1), i.val % 2 ≠ (s.val + 1) % 2 → PrefixSet2 σ i = PrefixSet2 τ i diff --git a/LeanPool/MooreBound/DegreeDiameter/PrimeIntervals.lean b/LeanPool/MooreBound/DegreeDiameter/PrimeIntervals.lean index 2241271110..4dbecdd4f3 100644 --- a/LeanPool/MooreBound/DegreeDiameter/PrimeIntervals.lean +++ b/LeanPool/MooreBound/DegreeDiameter/PrimeIntervals.lean @@ -21,7 +21,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/Proposition31.lean b/LeanPool/MooreBound/DegreeDiameter/Proposition31.lean index f60132cb14..86b2d518db 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Proposition31.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Proposition31.lean @@ -30,7 +30,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/Proposition31Asymptotics.lean b/LeanPool/MooreBound/DegreeDiameter/Proposition31Asymptotics.lean index 5b281bf71d..4859d8e720 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Proposition31Asymptotics.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Proposition31Asymptotics.lean @@ -28,7 +28,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -40,12 +40,12 @@ namespace DegreeDiameter noncomputable section /-- The factor `A_q = (q+1)^k` in Proposition 3.1. -/ -def proposition31Amplitude (q k : ℕ) : ℕ := +@[expose] def proposition31Amplitude (q k : ℕ) : ℕ := (q + 1) ^ k /-- The sharp displayed degree cap `K_q = (q+1)^k ((q+1)^k-1)`. -/ -def proposition31DegreeCap (q k : ℕ) : ℕ := +@[expose] def proposition31DegreeCap (q k : ℕ) : ℕ := proposition31Amplitude q k * (proposition31Amplitude q k - 1) /-- The order of the concrete graph over the chosen field of order `q`. -/ diff --git a/LeanPool/MooreBound/DegreeDiameter/Proposition31Full.lean b/LeanPool/MooreBound/DegreeDiameter/Proposition31Full.lean index 114e6a7369..f5f6ab8297 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Proposition31Full.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Proposition31Full.lean @@ -21,7 +21,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/Results.lean b/LeanPool/MooreBound/DegreeDiameter/Results.lean index b392051a71..1949031573 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Results.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Results.lean @@ -22,7 +22,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/DegreeDiameter/Symmetry.lean b/LeanPool/MooreBound/DegreeDiameter/Symmetry.lean index 088c929467..ee770cab92 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Symmetry.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Symmetry.lean @@ -21,7 +21,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -52,7 +52,7 @@ noncomputable def map (e : V ≃ₗ[K] V) (F : CompleteFlag K V n) : CompleteFla @[simp] theorem map_apply (e : V ≃ₗ[K] V) (F : CompleteFlag K V n) (i : Fin (n + 1)) : - F.map e i = (Submodule.orderIsoMapComap e) (F i) := rfl + F.map e i = (Submodule.orderIsoMapComap e) (F i) := by rfl @[simp] theorem map_symm_map (e : V ≃ₗ[K] V) (F : CompleteFlag K V n) : @@ -95,7 +95,7 @@ noncomputable def map {parity : ℕ} (e : V ≃ₗ[K] V) @[simp] theorem map_val {parity : ℕ} (e : V ≃ₗ[K] V) (P : PartialFlag (K := K) (V := V) (n := n) parity) (i : Fin (n + 1)) : - (P.map e).1 i = (Submodule.orderIsoMapComap e) (P.1 i) := rfl + (P.map e).1 i = (Submodule.orderIsoMapComap e) (P.1 i) := by rfl @[simp] theorem map_symm_map {parity : ℕ} (e : V ≃ₗ[K] V) @@ -123,7 +123,7 @@ noncomputable def mapEquiv {parity : ℕ} (e : V ≃ₗ[K] V) : @[simp] theorem mapEquiv_apply {parity : ℕ} (e : V ≃ₗ[K] V) (P : PartialFlag (K := K) (V := V) (n := n) parity) : - mapEquiv e P = P.map e := rfl + mapEquiv e P = P.map e := by rfl @[simp] theorem map_ofComplete {parity : ℕ} (e : V ≃ₗ[K] V) @@ -183,7 +183,7 @@ noncomputable def halvedFlagGraphIso (e : V ≃ₗ[K] V) : @[simp] theorem halvedFlagGraphIso_apply (e : V ≃ₗ[K] V) (P : EvenPartialFlag (K := K) (V := V) (n := n)) : - halvedFlagGraphIso e P = P.map e := rfl + halvedFlagGraphIso e P = P.map e := by rfl /-- Transitivity on even partial flags. -/ theorem exists_halvedFlagGraphIso_map_eq diff --git a/LeanPool/MooreBound/DegreeDiameter/Theorem11FromProposition31.lean b/LeanPool/MooreBound/DegreeDiameter/Theorem11FromProposition31.lean index 44e5e7b540..eb84586928 100644 --- a/LeanPool/MooreBound/DegreeDiameter/Theorem11FromProposition31.lean +++ b/LeanPool/MooreBound/DegreeDiameter/Theorem11FromProposition31.lean @@ -26,7 +26,7 @@ Lean Pool port of wewantmoore commit d59bd80ea93fabb9faf769e790ab47692645e022. The port adds a namespace and adapts proofs to the current Mathlib APIs and repository style. -/ -@[expose] public section +public section namespace MooreBound @@ -38,14 +38,13 @@ noncomputable section /-- A prime, viewed as one of the prime-power field orders used in Proposition 3.1. -/ -def proposition31PrimePowerIndexOfPrime (p : ℕ) (hp : p.Prime) : +@[expose] def proposition31PrimePowerIndexOfPrime (p : ℕ) (hp : p.Prime) : PrimePowerIndex := ⟨p, hp.isPrimePow⟩ @[simp] theorem proposition31PrimePowerIndexOfPrime_val (p : ℕ) (hp : p.Prime) : - (proposition31PrimePowerIndexOfPrime p hp).1 = p := - rfl + (proposition31PrimePowerIndexOfPrime p hp).1 = p := by rfl instance proposition31PrimePowerIndex_nonempty : Nonempty PrimePowerIndex := ⟨proposition31PrimePowerIndexOfPrime 2 Nat.prime_two⟩ @@ -146,7 +145,7 @@ theorem proposition31_eventually_prime_near_nthRoot eventually_prime_near_nthRoot (fun hη => prime_between hη) hD hm hη /-- The root comparison factor used in the lower bound. -/ -def proposition31RootComparison +@[expose] def proposition31RootComparison (D : ℕ → ℕ) (m t : ℕ) (η : ℝ) (d : ℕ) : ℝ := ((Nat.nthRoot m (D d) : ℝ) / ((Nat.nthRoot m (D d) : ℝ) + 1) / (1 + η)) ^ (m * t) diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Consequences.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Consequences.lean index 1afff53f62..178f5f72ee 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Consequences.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Consequences.lean @@ -18,7 +18,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean index 0ce031cf8e..f84818de61 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean @@ -22,7 +22,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound @@ -45,7 +45,7 @@ noncomputable def e (u : ℝ) : ℝ →ᵇ ℂ where map_bounded' := ⟨2, fun x y => (dist_le_norm_add_norm _ _).trans (by simp only [Circle.norm_coe]; norm_num)⟩ -@[simp] lemma e_apply (u : ℝ) (v : ℝ) : e u v = 𝐞 (-v * u) := rfl +@[simp] lemma e_apply (u : ℝ) (v : ℝ) : e u v = 𝐞 (-v * u) := by rfl theorem hasDerivAt_e {u x : ℝ} : HasDerivAt (e u) (-2 * π * u * I * e u x) x := by have l2 : HasDerivAt (fun v => -v * u) (-u) x := by diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Algebra/Notation/Support.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Algebra/Notation/Support.lean index 7625b2a1b8..6693221cb3 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Algebra/Notation/Support.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Algebra/Notation/Support.lean @@ -17,7 +17,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean index 61bb7ccce7..f03bb013b1 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean @@ -21,7 +21,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/SmoothExistence.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/SmoothExistence.lean index 49d70ae10b..5484a50335 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/SmoothExistence.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/SmoothExistence.lean @@ -20,7 +20,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Sobolev.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Sobolev.lean index ff77e2e67e..df37e8f67c 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Sobolev.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Sobolev.lean @@ -19,7 +19,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound @@ -78,6 +78,7 @@ instance : Coe (CS n ℝ) (CS n ℂ) where coe f := ⟨fun x => f x, contDiff_ofReal.of_le (mod_cast le_top) |>.comp f.h1, f.h2.comp_left (g := ofReal) rfl⟩ /-- Pointwise negation preserves smoothness and compact support. -/ +@[expose] def neg (f : CS n E) : CS n E where toFun := -f h1 := f.h1.neg @@ -88,6 +89,7 @@ instance : Neg (CS n E) where neg := neg @[simp] lemma neg_apply {x : ℝ} : (-f) x = - (f x) := rfl /-- Multiply a compactly supported smooth function by a real scalar. -/ +@[expose] def smul (R : ℝ) (f : CS n E) : CS n E := ⟨R • f, f.h1.const_smul R, f.h2.smul_left⟩ instance : HSMul ℝ (CS n E) (CS n E) where hSMul := smul @@ -97,6 +99,7 @@ instance : HSMul ℝ (CS n E) (CS n E) where hSMul := smul lemma continuous (f : CS n E) : Continuous f := f.h1.continuous /-- Differentiate a compactly supported function, lowering its smoothness index. -/ +@[expose] noncomputable def deriv (f : CS (n + 1) E) : CS n E where toFun := _root_.deriv f h1 := (contDiff_succ_iff_deriv.mp f.h1).2.2 @@ -187,7 +190,7 @@ lemma iteratedDeriv_sub {f g : ℝ → E} (hf : ContDiff ℝ n f) (hg : ContDiff simp_rw [iteratedDeriv_succ', ← ih hf' hg', hfg] /-- Differentiate a function with integrable derivatives, lowering its index. -/ -noncomputable def deriv (f : W1 (n + 1) E) : W1 n E where +@[expose] noncomputable def deriv (f : W1 (n + 1) E) : W1 n E where toFun := _root_.deriv f smooth := contDiff_succ_iff_deriv.mp f.smooth |>.2.2 integrable k hk := by @@ -197,6 +200,7 @@ lemma hasDerivAt (f : W1 (n + 1) E) (x : ℝ) : HasDerivAt f (f.deriv x) x := f.differentiable.differentiableAt.hasDerivAt /-- Subtract two functions with integrable derivatives. -/ +@[expose] def sub (f g : W1 n E) : W1 n E where toFun := f - g smooth := f.smooth.sub g.smooth @@ -213,6 +217,7 @@ lemma integrable_iteratedDeriv_Schwarz {f : 𝓢(ℝ, ℂ)} : Integrable (iterat | succ n ih => simpa [iteratedDeriv_succ'] using! ih (f := SchwartzMap.derivCLM ℝ ℂ f) /-- A Schwartz function has integrable derivatives of every finite order. -/ +@[expose] noncomputable def ofSchwartz (f : 𝓢(ℝ, ℂ)) : W1 n ℂ where toFun := f smooth := f.smooth n @@ -225,7 +230,7 @@ namespace W21 variable {f : W21} /-- The L¹ size of a function plus the scaled L¹ size of its second derivative. -/ -noncomputable def norm (f : ℝ → ℂ) : ℝ := +@[expose] noncomputable def norm (f : ℝ → ℂ) : ℝ := (∫ v, ‖f v‖) + (4 * π ^ 2)⁻¹ * (∫ v, ‖deriv (deriv f) v‖) lemma norm_nonneg {f : ℝ → ℂ} : 0 ≤ norm f := @@ -237,6 +242,7 @@ noncomputable instance : Norm W21 where norm := norm ∘ W1.toFun noncomputable instance : Coe 𝓢(ℝ, ℂ) W21 where coe := W1.ofSchwartz /-- Regard a compactly supported C² function as an element of W21. -/ +@[expose] def ofCS2 (f : CS 2 ℂ) : W21 := by refine ⟨f, f.h1, fun k hk => ?_⟩; match k with | 0 => exact f.h1.continuous.integrable_of_hasCompactSupport f.h2 diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean index 640d54faf3..b588b091a3 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean @@ -31,7 +31,7 @@ Wiener and Consequences retain the PNT and prime-interval dependency closure; unrelated later developments and LeanArchitect annotations are omitted. -/ -@[expose] public section +public section namespace MooreBound @@ -446,6 +446,7 @@ section nabla variable {α E : Type*} [OfNat α 1] [Add α] [Sub α] {u : α → ℂ} /-- The sum of the sequence over indices strictly below n. -/ +@[expose] def cumsum [AddCommMonoid E] (u : ℕ → E) (n : ℕ) : E := ∑ i ∈ Finset.range n, u i /-- The forward difference u(n+1)-u(n). -/ diff --git a/LeanPool/MoserLatticeColorings.lean b/LeanPool/MoserLatticeColorings.lean index baa42cd1d6..89701d72d1 100644 --- a/LeanPool/MoserLatticeColorings.lean +++ b/LeanPool/MoserLatticeColorings.lean @@ -20,4 +20,4 @@ Tags: combinatorics, graph-coloring, discrete-geometry, unit-distance-graphs, mo MSC: 05C15 -/ -@[expose] public section +public section diff --git a/LeanPool/MoserLatticeColorings/Basic.lean b/LeanPool/MoserLatticeColorings/Basic.lean index 3343f29dec..14872a4e81 100644 --- a/LeanPool/MoserLatticeColorings/Basic.lean +++ b/LeanPool/MoserLatticeColorings/Basic.lean @@ -21,7 +21,7 @@ the paper, and proves that each is proper and geometric on the whole lattice. The uniqueness assertion in Theorem 3.2 is not formalized here. -/ -@[expose] public section +public section namespace LeanPool.MoserLatticeColorings @@ -59,7 +59,7 @@ def normRadical (p : Coeff) : ℤ := p.b * p.c - p.a * p.d /-- The Euclidean coordinates of `a + b * ω₁ + c * ω₃ + d * ω₁ * ω₃`, where `ω₁ = 1 / 2 + i * √3 / 2` and `ω₃ = 5 / 6 + i * √11 / 6`. -/ -noncomputable def toR2 (p : Coeff) : R2 := +@[expose] noncomputable def toR2 (p : Coeff) : R2 := WithLp.toLp 2 ![ ((12 * p.a + 6 * p.b + 10 * p.c + 5 * p.d : ℤ) : ℝ) / 12 - (p.d : ℝ) * Real.sqrt 33 / 12, diff --git a/LeanPool/MoserLatticeColorings/Ring.lean b/LeanPool/MoserLatticeColorings/Ring.lean index 4d6664e6da..adc137f382 100644 --- a/LeanPool/MoserLatticeColorings/Ring.lean +++ b/LeanPool/MoserLatticeColorings/Ring.lean @@ -24,7 +24,7 @@ six-chromatic witness, but it does not determine the chromatic number of the plane. -/ -@[expose] public section +public section namespace LeanPool.MoserLatticeColorings @@ -288,6 +288,7 @@ def moserRingSetoid : Setoid RingRep where /-- The Moser ring `{(a + bω₁ + cω₃ + dω₁ω₃) / 3^k : a, b, c, d ∈ ℤ, k ∈ ℕ}`, quotiented by equality of Euclidean embeddings. -/ +@[expose] def MoserRing := Quotient moserRingSetoid namespace MoserRing diff --git a/LeanPool/MulticolorTriangleRamsey.lean b/LeanPool/MulticolorTriangleRamsey.lean index 5868db29ca..c976eaf5fc 100644 --- a/LeanPool/MulticolorTriangleRamsey.lean +++ b/LeanPool/MulticolorTriangleRamsey.lean @@ -24,7 +24,7 @@ Tags: extremal-combinatorics, ramsey-theory, graph-coloring, erdos-problems MSC: 05D10, 05C55 -/ -@[expose] public section +public section namespace ErdosProblems.MulticolourTriangleRamsey diff --git a/LeanPool/NagataFactoriality.lean b/LeanPool/NagataFactoriality.lean index 19b80cc378..6d62e58627 100644 --- a/LeanPool/NagataFactoriality.lean +++ b/LeanPool/NagataFactoriality.lean @@ -38,4 +38,4 @@ Tags: commutative-algebra MSC: 13F15 -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality.lean b/LeanPool/NagataFactoriality/NagataFactoriality.lean index f378380fe5..96c03832f8 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality.lean @@ -17,4 +17,4 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Applications Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Applications.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Applications.lean index 9bc4addf82..8ae70c280c 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Applications.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Applications.lean @@ -17,4 +17,4 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Applications.Exampl Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Examples.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Examples.lean index 68c404cd1b..72fe8a8e00 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Examples.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Examples.lean @@ -16,7 +16,7 @@ public import Mathlib.RingTheory.Polynomial.UniqueFactorization Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/FractionField.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/FractionField.lean index 3d828c70bc..431a35d0ba 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/FractionField.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/FractionField.lean @@ -41,7 +41,7 @@ with `R[T;T⁻¹]`. then `R[X]` is a UFD, proved by localizing at constant primes and using Nagata's theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Gauss.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Gauss.lean index 0b4ec5b265..a8128301b3 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Gauss.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Gauss.lean @@ -16,7 +16,7 @@ public import Mathlib.RingTheory.Polynomial.UniqueFactorization Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Laurent.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Laurent.lean index cd5fb2fac9..d4e83d178b 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Laurent.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Applications/Laurent.lean @@ -19,7 +19,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Nagata.Theorem Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Basic.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Basic.lean index fcd183f0cc..4253fcd85d 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Basic.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Basic.lean @@ -17,4 +17,4 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Basic.UFD Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Divisibility.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Divisibility.lean index f0696f0dd8..9c20f1a294 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Divisibility.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Divisibility.lean @@ -15,7 +15,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Basic.Ring Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Noetherian.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Noetherian.lean index aa51b0ecf8..365da5ebdf 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Noetherian.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Noetherian.lean @@ -15,7 +15,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Basic.Divisibility Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Ring.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Ring.lean index 1a4a875007..40043b220c 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Ring.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/Ring.lean @@ -16,7 +16,7 @@ public import Mathlib.Tactic Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/UFD.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/UFD.lean index d2f7d64522..3a08b3f9b6 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Basic/UFD.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Basic/UFD.lean @@ -15,7 +15,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Basic.Noetherian Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Localization.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Localization.lean index 12f6fd7518..5f37653118 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Localization.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Localization.lean @@ -17,4 +17,4 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Localization.Proper Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/IsLocalization.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/IsLocalization.lean index d92130235c..4f190db3c5 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/IsLocalization.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/IsLocalization.lean @@ -15,7 +15,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Localization.MultSe Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Localization.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Localization.lean index 0d958ff929..1c902efc5e 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Localization.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Localization.lean @@ -14,7 +14,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Localization.IsLoca Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality @@ -30,7 +30,7 @@ def mk (a s : α) (hs : s ∈ S) : Localization S := _root_.Localization.mk a ⟨s, hs⟩ /-- The canonical map from the ring into its localization. -/ -def of (a : α) : Localization S := +@[expose] def of (a : α) : Localization S := algebraMap α (Localization S) a @[simp] theorem mk_one (a : α) : mk (S := S) a 1 S.one_mem = of (S := S) a := by diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/MultSet.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/MultSet.lean index 4e21c64f12..badba64921 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/MultSet.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/MultSet.lean @@ -14,7 +14,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Basic.Divisibility Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Properties.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Properties.lean index c7faabdce9..f0830bf432 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Properties.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Localization/Properties.lean @@ -15,4 +15,4 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Localization.IsLoca Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Nagata.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Nagata.lean index 6f56ae214b..f822ff7580 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Nagata.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Nagata.lean @@ -15,4 +15,4 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Nagata.Theorem Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Lemmas.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Lemmas.lean index 6f9fb0f44b..0bf5e9142c 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Lemmas.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Lemmas.lean @@ -16,7 +16,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Basic.UFD Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Theorem.lean b/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Theorem.lean index 956952a401..8ed8255deb 100644 --- a/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Theorem.lean +++ b/LeanPool/NagataFactoriality/NagataFactoriality/Nagata/Theorem.lean @@ -14,7 +14,7 @@ public import LeanPool.NagataFactoriality.NagataFactoriality.Nagata.Lemmas Supporting results for Nagata’s factoriality theorem. -/ -@[expose] public section +public section namespace NagataFactoriality diff --git a/LeanPool/NashWilliams.lean b/LeanPool/NashWilliams.lean index 75e23e45a3..6a64ea2cd3 100644 --- a/LeanPool/NashWilliams.lean +++ b/LeanPool/NashWilliams.lean @@ -25,4 +25,4 @@ Tags: infinitary-combinatorics, ramsey-theory, better-quasi-orders, well-quasi-o MSC: 03E05, 05D10, 06A07 -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Combinatorics.lean b/LeanPool/NashWilliams/Combinatorics.lean index f7002545e8..91493e44ee 100644 --- a/LeanPool/NashWilliams/Combinatorics.lean +++ b/LeanPool/NashWilliams/Combinatorics.lean @@ -10,4 +10,4 @@ public import LeanPool.NashWilliams.Combinatorics.Ramsey /-! Combinatorial results about fronts and infinite Ramsey theory. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Combinatorics/Front.lean b/LeanPool/NashWilliams/Combinatorics/Front.lean index f790d61d46..020a67b84a 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front.lean @@ -9,4 +9,4 @@ public import LeanPool.NashWilliams.Combinatorics.Front.NashWilliams /-! Nash-Williams fronts, their ranks and restrictions, and the Nash-Williams theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Defs.lean b/LeanPool/NashWilliams/Combinatorics/Front/Defs.lean index 83b43b8357..3272155959 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Defs.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Defs.lean @@ -57,7 +57,7 @@ increasing enumeration (a sorted `List ℕ`) and bridge to `Finset ℕ` only at `Finset`-based (e.g. Ramsey) statements, via `Finset.sort` / `List.toFinset`. -/ -@[expose] public section +public section open Set List @@ -80,7 +80,7 @@ namespace Front /-- `IsInit s N` : the sorted list `s` is the initial segment of the increasing enumeration `N : ℕ → ℕ`, i.e. `s = [N 0, N 1, …, N (s.length - 1)]`. This is the prefix relation `⊑` between a finite set and an infinite set. -/ -def IsInit (s : List ℕ) (N : ℕ → ℕ) : Prop := +@[expose] def IsInit (s : List ℕ) (N : ℕ → ℕ) : Prop := s = (List.range s.length).map N /-- `List.range` is monotone for the prefix order. -/ @@ -159,7 +159,7 @@ increasing lists of length `k` whose entries lie in `M`. -/ /-- `[M]^k` : the strictly increasing lists of length `k` contained in `M`. -/ -def powK (M : ℕ → ℕ) (k : ℕ) : Set (List ℕ) := +@[expose] def powK (M : ℕ → ℕ) (k : ℕ) : Set (List ℕ) := {s | s.length = k ∧ s.Pairwise (· < ·) ∧ ∀ x ∈ s, x ∈ Set.range M} /-- The first `k` values of `M ∘ e` forms a size-`k` subset of `M`, for `e` strictly @@ -215,7 +215,7 @@ first genuinely non-uniform front — the lists' length varies with where the li /-- The Schreier front on `M`: increasing lists `s ⊆ M` whose length is one more than their first element. -/ -def schreier (M : ℕ → ℕ) : Set (List ℕ) := +@[expose] def schreier (M : ℕ → ℕ) : Set (List ℕ) := {s | (∃ a, s.head? = some a ∧ s.length = a + 1) ∧ s.Pairwise (· < ·) ∧ ∀ x ∈ s, x ∈ Set.range M} diff --git a/LeanPool/NashWilliams/Combinatorics/Front/NashWilliams.lean b/LeanPool/NashWilliams/Combinatorics/Front/NashWilliams.lean index 94a1d45766..2106d757c9 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/NashWilliams.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/NashWilliams.lean @@ -41,7 +41,7 @@ import that one. The only lemmas the two developments share are the generic help `NashWilliams.Data`. -/ -@[expose] public section +public section open Set List diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean b/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean index e0de7c0995..4de36aedb9 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean @@ -34,7 +34,7 @@ strictly longer. * `Front.schreier_rank`: the Schreier front has rank `ω`. -/ -@[expose] public section +public section open Set List Ordinal @@ -67,14 +67,14 @@ theorem RelHom.rank_le {α β : Type u} {r : α → α → Prop} {s : β → β namespace Front /-- The tree of a front `F`: all prefixes (initial segments) of elements of `F`. -/ -def tree (F : Set (List ℕ)) : Set (List ℕ) := +@[expose] def tree (F : Set (List ℕ)) : Set (List ℕ) := {s | ∃ t ∈ F, s <+: t} /-- Proper end-extension inside the tree of `F`: `treeExt F a b` holds when `a` properly extends `b` and both lie in the tree. Its well-foundedness is what allows ranking a front. Note the recursion direction: `WellFounded.rank (treeExt F) s` is the supremum of `succ (rank s')` over the proper extensions `s'` of `s`, matching the usual rank of a front. -/ -def treeExt (F : Set (List ℕ)) (a b : List ℕ) : Prop := +@[expose] def treeExt (F : Set (List ℕ)) (a b : List ℕ) : Prop := a ∈ tree F ∧ b ∈ tree F ∧ b <+: a ∧ b ≠ a /-- If every finite initial segment of `b` is strictly increasing, then `b` is strictly @@ -175,7 +175,7 @@ theorem IsFront.wellFounded_treeExt {F : Set (List ℕ)} {M : ℕ → ℕ} (hF : /-- The ordinal **rank of a front**: the rank of the root `[]` in the well-founded tree of proper end-extensions. -/ -def IsFront.rank {F : Set (List ℕ)} {M : ℕ → ℕ} (hF : IsFront F M) : Ordinal := +@[expose] def IsFront.rank {F : Set (List ℕ)} {M : ℕ → ℕ} (hF : IsFront F M) : Ordinal := have : WellFounded (treeExt F) := hF.wellFounded_treeExt WellFounded.rank (treeExt F) [] diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean b/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean index e3b034c1eb..0b2cbe638a 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean @@ -42,7 +42,7 @@ The trivial front is `{[]}` (rank `0`). For a front, `[] ∉ F`, `F ≠ {[]}`, ` (see `IsFront.nil_not_mem_iff`). -/ -@[expose] public section +public section open Set List @@ -96,7 +96,7 @@ variable {F : Set (List ℕ)} /-- `F after a` (the *ray* of `F` at `a`): strip the leading `a` from the elements of `F` that start with `a`. -/ -def ray (F : Set (List ℕ)) (a : ℕ) : Set (List ℕ) := {t | a :: t ∈ F} +@[expose] def ray (F : Set (List ℕ)) (a : ℕ) : Set (List ℕ) := {t | a :: t ∈ F} /-- Density transported: any strictly monotone subsequence of `M` has an initial segment in `F`. -/ theorem exists_frontElem_isInit (hF : IsFront F M) {N : ℕ → ℕ} (hN : StrictMono N) diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean b/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean index 7d03965a35..5bada14c1e 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean @@ -29,7 +29,7 @@ formalized here.) * `Front.shrink_isFront` : `shrink F (M ∘ E)` is a front on `M ∘ E`. -/ -@[expose] public section +public section open Set List @@ -41,13 +41,13 @@ variable {F : Set (List ℕ)} {M : ℕ → ℕ} /-- The restriction of `F` to the infinite subset enumerated by `N`: the elements of `F` whose entries all lie in `range N`. -/ -def shrink (F : Set (List ℕ)) (N : ℕ → ℕ) : Set (List ℕ) := +@[expose] def shrink (F : Set (List ℕ)) (N : ℕ → ℕ) : Set (List ℕ) := {s | s ∈ F ∧ ∀ x ∈ s, x ∈ Set.range N} /-- The restriction of `F` to a set `X` (the survey's `F ↾ X`): the elements of `F` whose entries all lie in `X`. Definitionally `shrink F N = shrinkOn F (Set.range N)`, so the enumeration-based `shrink` and this set-based restriction agree on `X = Set.range N`. -/ -def shrinkOn (F : Set (List ℕ)) (X : Set ℕ) : Set (List ℕ) := +@[expose] def shrinkOn (F : Set (List ℕ)) (X : Set ℕ) : Set (List ℕ) := {s | s ∈ F ∧ ∀ x ∈ s, x ∈ X} theorem shrink_eq_shrinkOn_range (F : Set (List ℕ)) (N : ℕ → ℕ) : diff --git a/LeanPool/NashWilliams/Combinatorics/Ramsey.lean b/LeanPool/NashWilliams/Combinatorics/Ramsey.lean index 9d8470ce60..ca1ed4cd04 100644 --- a/LeanPool/NashWilliams/Combinatorics/Ramsey.lean +++ b/LeanPool/NashWilliams/Combinatorics/Ramsey.lean @@ -9,4 +9,4 @@ public import LeanPool.NashWilliams.Combinatorics.Ramsey.Infinite /-! Infinite Ramsey theory for finite colorings. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Combinatorics/Ramsey/Infinite.lean b/LeanPool/NashWilliams/Combinatorics/Ramsey/Infinite.lean index 3031d1e477..c96807ca1c 100644 --- a/LeanPool/NashWilliams/Combinatorics/Ramsey/Infinite.lean +++ b/LeanPool/NashWilliams/Combinatorics/Ramsey/Infinite.lean @@ -40,7 +40,7 @@ instantiating the Nash-Williams theorem at the uniform front `[M]^k`. Both are k file imports the other: they share only the generic helpers in `NashWilliams.Data`. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/NashWilliams/Data.lean b/LeanPool/NashWilliams/Data.lean index a117369ee0..9fec09e53f 100644 --- a/LeanPool/NashWilliams/Data.lean +++ b/LeanPool/NashWilliams/Data.lean @@ -13,4 +13,4 @@ import Mathlib.Tactic.SetLike /-! Supporting results for finite types and natural numbers. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Data/Fintype.lean b/LeanPool/NashWilliams/Data/Fintype.lean index 76b43586a8..3c1784a4e4 100644 --- a/LeanPool/NashWilliams/Data/Fintype.lean +++ b/LeanPool/NashWilliams/Data/Fintype.lean @@ -12,4 +12,4 @@ import Mathlib.Tactic.SetLike /-! Infinite-pigeonhole helpers for finite codomains. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Data/Fintype/Pigeonhole.lean b/LeanPool/NashWilliams/Data/Fintype/Pigeonhole.lean index 609820ba79..97ee75b51e 100644 --- a/LeanPool/NashWilliams/Data/Fintype/Pigeonhole.lean +++ b/LeanPool/NashWilliams/Data/Fintype/Pigeonhole.lean @@ -24,7 +24,7 @@ is kept here rather than in either of them. Upstream target: `Mathlib/Data/Fintype/Pigeonhole.lean`. -/ -@[expose] public section +public section /-- **Infinite pigeonhole.** A sequence `f : ℕ → κ` with `κ` finite takes some value `k` on an infinite set of indices. -/ diff --git a/LeanPool/NashWilliams/Data/Nat.lean b/LeanPool/NashWilliams/Data/Nat.lean index 46fe25b2df..3c5325acac 100644 --- a/LeanPool/NashWilliams/Data/Nat.lean +++ b/LeanPool/NashWilliams/Data/Nat.lean @@ -12,4 +12,4 @@ import Mathlib.Tactic.SetLike /-! Strictly monotone enumerations of infinite sets of natural numbers. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Data/Nat/Nth.lean b/LeanPool/NashWilliams/Data/Nat/Nth.lean index 09ad7182a1..5046f5a88b 100644 --- a/LeanPool/NashWilliams/Data/Nat/Nth.lean +++ b/LeanPool/NashWilliams/Data/Nat/Nth.lean @@ -29,7 +29,7 @@ what turns the `Set`-valued conclusion of `infinite_ramsey` into the sequence fo Upstream target: `Mathlib/Data/Nat/Nth.lean`. -/ -@[expose] public section +public section /-- **Enumeration bridge.** Every infinite set of naturals is the range of its (unique) strictly monotone enumeration. This recovers, from a set-valued carrier `X`, the enumeration `N` on which diff --git a/LeanPool/NashWilliams/Order.lean b/LeanPool/NashWilliams/Order.lean index cdf6251946..e921af2144 100644 --- a/LeanPool/NashWilliams/Order.lean +++ b/LeanPool/NashWilliams/Order.lean @@ -15,4 +15,4 @@ import Mathlib.Tactic.NormNum.Pow /-! Results about well- and better-quasi-orders. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Order/TwoBQO.lean b/LeanPool/NashWilliams/Order/TwoBQO.lean index acc6acf719..ec722089b0 100644 --- a/LeanPool/NashWilliams/Order/TwoBQO.lean +++ b/LeanPool/NashWilliams/Order/TwoBQO.lean @@ -52,7 +52,7 @@ embedding relation (`TwoBQO.embedForAll_wqo`). * `TwoBQO.embedForAll_wqo`: `EmbedForAll r` is WQO on `ℕ → Q` whenever `r` is 2-BQO on `Q`. -/ -@[expose] public section +public section open Set Preorder diff --git a/LeanPool/NashWilliams/Order/WellQuasiOrder.lean b/LeanPool/NashWilliams/Order/WellQuasiOrder.lean index d581d11ac1..f935327f69 100644 --- a/LeanPool/NashWilliams/Order/WellQuasiOrder.lean +++ b/LeanPool/NashWilliams/Order/WellQuasiOrder.lean @@ -10,4 +10,4 @@ public import LeanPool.NashWilliams.Order.WellQuasiOrder.Regular /-! Monotone subsequences and regular sequences in well-quasi-orders. -/ -@[expose] public section +public section diff --git a/LeanPool/NashWilliams/Order/WellQuasiOrder/Basic.lean b/LeanPool/NashWilliams/Order/WellQuasiOrder/Basic.lean index 01f108b9d7..f02bd50ac8 100644 --- a/LeanPool/NashWilliams/Order/WellQuasiOrder/Basic.lean +++ b/LeanPool/NashWilliams/Order/WellQuasiOrder/Basic.lean @@ -28,7 +28,7 @@ property of a WQO does not need the preorder (in particular transitivity) hypoth the current Mathlib `WellQuasiOrdered.exists_monotone_subseq`. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/NashWilliams/Order/WellQuasiOrder/Regular.lean b/LeanPool/NashWilliams/Order/WellQuasiOrder/Regular.lean index 960abb1255..c7bc10232d 100644 --- a/LeanPool/NashWilliams/Order/WellQuasiOrder/Regular.lean +++ b/LeanPool/NashWilliams/Order/WellQuasiOrder/Regular.lean @@ -34,7 +34,7 @@ many later terms. This file shows that in a WQO every sequence has a regular tai * `WellQuasiOrdered.sublistForall₂`: Higman's order is a WQO on `List Q` when `r` is a WQO on `Q`. -/ -@[expose] public section +public section open Set Preorder @@ -47,7 +47,7 @@ if for every `i : ℕ`, the set `{j : ℕ | f i ≤ f j}` is infinite. -/ namespace Preorder /-- A sequence is *regular* if every term dominates infinitely many later terms. -/ -def IsRegularSeq {Q : Type*} (r : Q → Q → Prop) (f : ℕ → Q) : Prop := +@[expose] def IsRegularSeq {Q : Type*} (r : Q → Q → Prop) (f : ℕ → Q) : Prop := ∀ i : ℕ, {j : ℕ | r (f i) (f j)}.Infinite /-- A regular sequence has arbitrarily large indices dominating any given index: diff --git a/LeanPool/NaslundCounterexample/Asymptotics.lean b/LeanPool/NaslundCounterexample/Asymptotics.lean index 233c48b34a..9222049f5f 100644 --- a/LeanPool/NaslundCounterexample/Asymptotics.lean +++ b/LeanPool/NaslundCounterexample/Asymptotics.lean @@ -24,7 +24,7 @@ so the lower limit of the left side is at least `L/8`. Finally `16/21 ≤ L/8` i comparison `3^128 ≤ 810^21`, and `16/21 = 0.76190…` is the stated bound. -/ -@[expose] public section +public section namespace NaslundCounterexample diff --git a/LeanPool/NaslundCounterexample/Bases.lean b/LeanPool/NaslundCounterexample/Bases.lean index 1102f27750..1f3deebecc 100644 --- a/LeanPool/NaslundCounterexample/Bases.lean +++ b/LeanPool/NaslundCounterexample/Bases.lean @@ -23,7 +23,7 @@ the square of a linear polynomial `v + u T`, with constant term `v^2` and `T^2`- `u^2`; so `v^2 + u^2 = 0`, which in `F_3` forces `u = v = 0`. -/ -@[expose] public section +public section namespace NaslundCounterexample diff --git a/LeanPool/NaslundCounterexample/Below.lean b/LeanPool/NaslundCounterexample/Below.lean index aa6bc12c6c..b55e90eedd 100644 --- a/LeanPool/NaslundCounterexample/Below.lean +++ b/LeanPool/NaslundCounterexample/Below.lean @@ -20,7 +20,7 @@ This file is the toolkit: the coefficient characterisation, the passage to `natD under the operations the lift performs, and the two multiplication bounds for `P` and `Q`. -/ -@[expose] public section +public section namespace NaslundCounterexample @@ -28,9 +28,10 @@ open Polynomial /-- `f` has degree below `m`: membership in `P_{3,m}`, the polynomials of degree less than `m`. For `m = 0` this says `f = 0`, since `degree 0 = ⊥`. -/ -def Below (m : ℕ) (f : (ZMod 3)[X]) : Prop := f.degree < m +@[expose] def Below (m : ℕ) (f : (ZMod 3)[X]) : Prop := f.degree < m /-- Every element of `B` has degree below `m`, that is, `B ⊆ P_{3,m}`. -/ +@[expose] def AllBelow (m : ℕ) (B : Finset (ZMod 3)[X]) : Prop := ∀ f ∈ B, Below m f /-- Degree below `m` read off the coefficients: all coefficients from `T^m` on vanish. -/ diff --git a/LeanPool/NaslundCounterexample/Code.lean b/LeanPool/NaslundCounterexample/Code.lean index 546b13a6e5..187ed4de7b 100644 --- a/LeanPool/NaslundCounterexample/Code.lean +++ b/LeanPool/NaslundCounterexample/Code.lean @@ -22,7 +22,7 @@ together with the three facts about squares in `F_3` it is used with. Everything check over `Fin 4 → ZMod 3` and `ZMod 3`, decided by the kernel. -/ -@[expose] public section +public section namespace NaslundCounterexample diff --git a/LeanPool/NaslundCounterexample/Definitions.lean b/LeanPool/NaslundCounterexample/Definitions.lean index cc9750559b..a2ab43cd0c 100644 --- a/LeanPool/NaslundCounterexample/Definitions.lean +++ b/LeanPool/NaslundCounterexample/Definitions.lean @@ -47,30 +47,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/ -@[expose] public section +public section namespace NaslundCounterexample /-- A finite set of polynomials over `F_3` is *square-difference-free*: no two of its elements differ by a nonzero square. -/ +@[expose] def SquareDifferenceFree (A : Finset (Polynomial (ZMod 3))) : Prop := ∀ f ∈ A, ∀ g ∈ A, ∀ z : Polynomial (ZMod 3), g - f = z ^ 2 → z = 0 /-- Every element of `A` has degree below `n`. For `n ≥ 1` this says `A ⊆ P_{3,n}`, the polynomials of degree less than `n` (the zero polynomial has `natDegree 0`). -/ -def DegreeBelow (n : ℕ) (A : Finset (Polynomial (ZMod 3))) : Prop := +@[expose] def DegreeBelow (n : ℕ) (A : Finset (Polynomial (ZMod 3))) : Prop := ∀ f ∈ A, f.natDegree < n /-- The polynomials of degree below `n` over `F_3`, as a finite set: the image of the coefficient vectors `Fin n → ZMod 3` under `c ↦ Σ c_i T^i`. -/ -noncomputable def polynomialsBelow (n : ℕ) : Finset (Polynomial (ZMod 3)) := +@[expose] noncomputable def polynomialsBelow (n : ℕ) : Finset (Polynomial (ZMod 3)) := open scoped Classical in (Finset.univ : Finset (Fin n → ZMod 3)).image (fun c => ∑ i : Fin n, Polynomial.C (c i) * Polynomial.X ^ (i : ℕ)) /-- `maximumCardinality n`: the largest size of a square-difference-free set of polynomials of degree below `n` over `F_3`. -/ -noncomputable def maximumCardinality (n : ℕ) : ℕ := +@[expose] noncomputable def maximumCardinality (n : ℕ) : ℕ := open scoped Classical in ((polynomialsBelow n).powerset.filter SquareDifferenceFree).sup Finset.card diff --git a/LeanPool/NaslundCounterexample/Families.lean b/LeanPool/NaslundCounterexample/Families.lean index df489592ea..d87ca69aae 100644 --- a/LeanPool/NaslundCounterexample/Families.lean +++ b/LeanPool/NaslundCounterexample/Families.lean @@ -21,7 +21,7 @@ Each induction step needs the lift's three conclusions at an even degree bound: are both even, which is why the two families together cover every multiple of `4`. -/ -@[expose] public section +public section namespace NaslundCounterexample diff --git a/LeanPool/NaslundCounterexample/Lift.lean b/LeanPool/NaslundCounterexample/Lift.lean index d9e073b123..93aebac907 100644 --- a/LeanPool/NaslundCounterexample/Lift.lean +++ b/LeanPool/NaslundCounterexample/Lift.lean @@ -28,7 +28,7 @@ lifted polynomials therefore has all four coordinates of `s' - s` in `{0, 1}`, s property gives `s = s'`; what is left is a square difference inside `B`, which `B` does not have. -/ -@[expose] public section +public section namespace NaslundCounterexample diff --git a/LeanPool/NaslundCounterexample/Main.lean b/LeanPool/NaslundCounterexample/Main.lean index 3f960f3696..0f26552fcb 100644 --- a/LeanPool/NaslundCounterexample/Main.lean +++ b/LeanPool/NaslundCounterexample/Main.lean @@ -29,7 +29,7 @@ it is `3^{6e+3} = 27 · 729^e < 27 · 810^e`. The growth rate is the theorem of The statements below are proved from the explicit polynomial families. -/ -@[expose] public section +public section namespace NaslundCounterexample diff --git a/LeanPool/NaslundCounterexample/Polynomials.lean b/LeanPool/NaslundCounterexample/Polynomials.lean index 272d48568d..fb709f12fa 100644 --- a/LeanPool/NaslundCounterexample/Polynomials.lean +++ b/LeanPool/NaslundCounterexample/Polynomials.lean @@ -26,7 +26,7 @@ square-freeness argument needs: a polynomial of degree at most `2` vanishing on and `P` divides any polynomial vanishing on `F_3`. -/ -@[expose] public section +public section namespace NaslundCounterexample @@ -36,7 +36,7 @@ open Polynomial noncomputable def P : (ZMod 3)[X] := X ^ 3 - X /-- `Q = P^2 = T^6 + T^4 + T^2`, the multiplier of the lift. -/ -noncomputable def Q : (ZMod 3)[X] := P ^ 2 +@[expose] noncomputable def Q : (ZMod 3)[X] := P ^ 2 /-- The interpolant `V_s = s_0 + (s_2 - s_1) T - (s_0 + s_1 + s_2) T^2`, whose value at `c` is `s_c` for `c = 0, 1, 2`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionBudget.lean index d377cc1ca0..5c9a03b490 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionBudget.lean @@ -19,7 +19,7 @@ section /-! Whole-interval inviscid correction retaining quantitative Gevrey bounds and its actual finite-Sobolev pressure equation. -/ -@[expose] public section +public section noncomputable section @@ -94,7 +94,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionCoherence.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionCoherence.lean index c083a01745..f0cee46e7d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionCoherence.lean @@ -19,7 +19,7 @@ section /-! Exact repeated restriction of coherent prescribed coefficient and field data. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,7 @@ section /-! The literal inviscid correction equation follows from the actual strongly convergent viscous family. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionData.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionData.lean index fdb6022c4d..25a8eb6ed6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionData.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionLowerData /-! Coherent prescribed cylinder data at every finite Sobolev order. -/ -@[expose] public section +public section noncomputable section @@ -86,6 +86,7 @@ structure Data (T : ℝ) where residual : FieldTower period T /-- The literal finite-order correction data extracted from a coherent prescribed tower. -/ +@[expose] def Data.atOrder {T : ℝ} (A : Data period T) (q : ℕ) : CorrectionData period q (Icc (0 : ℝ) T) where κ := A.κ direction := A.direction diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionStability.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionStability.lean index b04d7eda68..041aabd5de 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionStability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderCorrectionStability.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.GevreyStabilityBudget /-! One concrete stability budget compares every finite realization of the same prescribed data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftBudget.lean index 58d539f50c..0e2d2a71ad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftBudget.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionEnergyMajorants /-! Actual all-order Gevrey input budgets with radius loss controlled by the transport drift. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftCorrection.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftCorrection.lean index 9eeadf1184..22157f3eaf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftCorrection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftCorrection.lean @@ -32,7 +32,7 @@ section /-! Genuine pointwise time differentiation of the generically assembled correction. -/ -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftEquation.lean index 426cf4a79e..5e77ade59b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftEquation.lean @@ -25,7 +25,7 @@ They neither construct the approximate packet nor identify arbitrary coefficient with the physical Euler equation in parent-flow coordinates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFieldDecomposition.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFieldDecomposition.lean index 376034f1ca..17460c7852 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFieldDecomposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFieldDecomposition.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.AllOrderDriftGraph The identities concern the constructed exact packet, not an arbitrary pair satisfying an energy bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFinite.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFinite.lean index 9d42bc21cc..4175d2c9e4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFinite.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftFinite.lean @@ -20,7 +20,7 @@ section /-! Drift-aware version: Whole-interval inviscid correction retaining quantitative Gevrey bounds and its actual finite-Sobolev pressure equation. -/ -@[expose] public section +public section noncomputable section @@ -98,7 +98,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftGraph.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftGraph.lean index 4c0c62b24c..4b504f4f40 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftGraph.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftGraph.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real on every fixed continuous phase graph, including every cylinder word and the genuine time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressure.lean index 886f5de82f..e420bf93ba 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressure.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CorrectionAssemblyPressureParity /-! Actual common pressure and a canonically normalized scalar graph pressure constructed from all-order drift-aware input budgets. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressureBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressureBounds.lean index f7017fc09c..c67b5677ef 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressureBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftPressureBounds.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Smaller-radius quantitative bounds for the constructed common pressure and the actual first time derivative of the correction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftRadiusBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftRadiusBounds.lean index d495684644..88d2810545 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftRadiusBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AllOrderDriftRadiusBounds.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.GevreyRadiusReduction /-! Actual weighted correction and derivative bounds at a fixed positive radius. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ variable {T : ℝ} {hT : 0 < T} {A : Data period T} def Budget.reducedRadius (B : Budget period hT A) : ℝ := B.initialRadius/4 /-- The actual target-error envelope converted from metric energy to the fixed H⁶ word norm. -/ -def Budget.correctionSize (B : Budget period hT A) : ℝ := +@[expose] def Budget.correctionSize (B : Budget period hT A) : ℝ := metricAmplification B.metric.c*(B.delta/2) theorem Budget.growth_pos (B : Budget period hT A) : 0 < B.growthCoefficient := diff --git a/LeanPool/NavierStokesAndEuler/Euler/AngleMeanZeroPrimitive.lean b/LeanPool/NavierStokesAndEuler/Euler/AngleMeanZeroPrimitive.lean index dbe9538b66..f7d8581d47 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AngleMeanZeroPrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AngleMeanZeroPrimitive.lean @@ -20,7 +20,7 @@ curve such as a time-L² pressure coefficient. Periodicity is proved from the zero integral of the forcing; subtracting the actual mean fixes the constant. -/ -@[expose] public section +public section noncomputable section @@ -32,10 +32,10 @@ open MeasureTheory Set variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- The raw angular primitive, anchored at angle zero. -/ -def rawPrimitive (f : ℝ → E) (θ : ℝ) : E := ∫ s in 0..θ, f s +@[expose] def rawPrimitive (f : ℝ → E) (θ : ℝ) : E := ∫ s in 0..θ, f s /-- The actual angular primitive with its mean over one period removed. -/ -def primitive (P : ℝ) (f : ℝ → E) (θ : ℝ) : E := +@[expose] def primitive (P : ℝ) (f : ℝ → E) (θ : ℝ) : E := rawPrimitive f θ - P⁻¹ • (∫ s in 0..P, rawPrimitive f s) /-- The explicit integral has the actual derivative prescribed by the forcing. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveMap.lean b/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveMap.lean index 3948783b40..e6dcfa158b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveMap.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.AngleMeanZeroPrimitive /-! Bounded linear maps commute with the literal normalized angular integral. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveParity.lean b/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveParity.lean index 8529eacbfa..b731f0e8ec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveParity.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Comp /-! The normalized angular primitive reverses joint reflection parity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveSpatialRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveSpatialRegularity.lean index 1a7ae3481f..80e07b8284 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveSpatialRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AnglePrimitiveSpatialRegularity.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! The actual angular primitive is jointly smooth in spatial labels and angle. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/AsymmetricTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/AsymmetricTransport.lean index f8ec83d4b3..99c2f18d34 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/AsymmetricTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/AsymmetricTransport.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.GevreyOrderZero /-! The actual asymmetric Sobolev transport map needed for the parabolic source upgrade. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerGuards.lean index 1a3ee1a5f3..66b78c66de 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerGuards.lean @@ -21,7 +21,7 @@ section base interval. The normal and uncut velocity are the constructed source trajectories; their equations and the parent Riccati equation give the bound. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerPacketForwardFactorization /-- First sign rate, given by `4*(3*CM^2+CH)`. -/ -def firstSignRate (CM CH : ℝ) : ℝ := 4*(3*CM^2+CH) +@[expose] def firstSignRate (CM CH : ℝ) : ℝ := 4*(3*CM^2+CH) private theorem numerator_derivative_bound (CM CH : ℝ) (hCM : 0 ≤ CM) (hCH : 0 ≤ CH) (m m₁ v v₁ : Space) (A A₁ : Space →L[ℝ] Space) @@ -166,7 +166,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerSign.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerSign.lean index 44b84ee383..7cbc910554 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerSign.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerSign.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentPacketStrainEvolution normal and the actual homogeneous transverse velocity. Initial plateau data are the only geometric inputs; all time equations are constructed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean index 249a60a8b1..955a0309a7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean @@ -80,7 +80,7 @@ section equation: identity pressure metric, zero lower-order coefficients, spatial scale one and angular direction zero. No solution is included in the data. -/ -@[expose] public section +public section noncomputable section @@ -286,7 +286,7 @@ section a quadratic residual envelope at every Sobolev order. No residual estimate or differential equation is postulated. -/ -@[expose] public section +public section noncomputable section @@ -379,7 +379,7 @@ quadratic residual envelope in the all-order correction regime. The growth constant belongs to the identity-metric equation, not to an assumed solution. -/ -@[expose] public section +public section noncomputable section @@ -490,7 +490,7 @@ end end -@[expose] public section +public section noncomputable section @@ -631,7 +631,7 @@ section angle-independent cylinder field. Tensor bounds give a fixed mixed Sobolev word bound, and classical divergence zero gives the actual lifted constraint. -/ -@[expose] public section +public section noncomputable section @@ -749,7 +749,7 @@ section spatial convection, at every finite Sobolev order. This verifies the equation input to the correction theorem rather than assuming it. -/ -@[expose] public section +public section noncomputable section @@ -833,7 +833,7 @@ end end -@[expose] public section +public section noncomputable section @@ -913,7 +913,7 @@ section slice of the actual exact lifted solution solves ordinary three-dimensional Euler. The scalar pressure is the canonical normalized graph potential. -/ -@[expose] public section +public section noncomputable section @@ -1062,7 +1062,7 @@ section /-! The genuine Euler time/amplitude scaling. A solution starting from ε u₀ on [0,1] gives a solution starting from u₀ on [0,ε]. -/ -@[expose] public section +public section noncomputable section @@ -1165,7 +1165,7 @@ solenoidal Gevrey datum. The initial velocity is the original datum, not its small multiple. All spatial derivative tensors remain continuous L² paths after the actual Euler time/amplitude rescaling. -/ -@[expose] public section +public section noncomputable section @@ -1354,7 +1354,7 @@ section the Euler amplitude/time scaling. The time interval is shortened by the same positive amplitude used to normalize the initial velocity. -/ -@[expose] public section +public section noncomputable section @@ -1418,7 +1418,7 @@ section have smooth bounded spatial jets continuous in time. This includes the one-sided derivatives at both endpoints. -/ -@[expose] public section +public section noncomputable section @@ -1521,7 +1521,7 @@ section are functions of the datum's supplied Gevrey bounds and the fixed period; none depends on which datum realizes those bounds. -/ -@[expose] public section +public section noncomputable section @@ -1652,7 +1652,7 @@ section /-! Quantitative spatial jet bounds under actual Euler time/amplitude rescaling. The constants are explicit and the spatial radius is unchanged. -/ -@[expose] public section +public section noncomputable section @@ -1716,7 +1716,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1996,7 +1996,7 @@ section the first parent particle data. Its horizon can be shortened by an explicit positive amount before applying the uniform flow-jet estimate. -/ -@[expose] public section +public section noncomputable section @@ -2216,7 +2216,7 @@ section for the base flow. The displacement estimate integrates the real spatial jets of the flow, and the other two estimates use volume preservation. -/ -@[expose] public section +public section noncomputable section @@ -2477,7 +2477,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2576,7 +2576,7 @@ section correction. In particular the actual convection residual is odd; this is proved from its derivative formula. -/ -@[expose] public section +public section noncomputable section @@ -2623,7 +2623,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2732,7 +2732,7 @@ section constructed smooth coefficient paths. In particular the local velocity has a true one-sided time derivative at the initial and terminal times. -/ -@[expose] public section +public section noncomputable section @@ -2794,7 +2794,7 @@ section /-! Oddness of the genuine base velocity propagates through its actual flow to the base parent, using ODE uniqueness. -/ -@[expose] public section +public section noncomputable section @@ -2819,7 +2819,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2999,7 +2999,7 @@ section /-! The compact initial velocity in the manuscript is constructed using the fixed factorial-bounded outer cutoff and the actual curl potential. -/ -@[expose] public section +public section noncomputable section @@ -3118,7 +3118,7 @@ section /-! Pointwise factorial estimates suffice when one factor has compact support. In particular polynomial factors need not be globally bounded. -/ -@[expose] public section +public section noncomputable section @@ -3194,7 +3194,7 @@ section /-! Compact support turns actual uniform tensor bounds into the ordinary L² tensor bounds used in the label Sobolev estimates. -/ -@[expose] public section +public section noncomputable section @@ -3228,7 +3228,7 @@ end end -@[expose] public section +public section noncomputable section @@ -3419,7 +3419,7 @@ section In particular this covers β=x₀⁻² with x₀≥1, independently of the eventual frequency and iteration scales. -/ -@[expose] public section +public section noncomputable section @@ -3513,7 +3513,7 @@ end end -@[expose] public section +public section noncomputable section @@ -3618,7 +3618,7 @@ section /-! The actual normalized Euler pressure force has smooth ordinary L² slices, with all derivative tensors continuous in time. -/ -@[expose] public section +public section noncomputable section @@ -3674,7 +3674,7 @@ section both velocity and pressure force. Consequently its Euler equation holds strongly in every finite Sobolev order, including endpoint derivatives. -/ -@[expose] public section +public section noncomputable section @@ -3722,7 +3722,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketScales.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketScales.lean index 706e177a1a..6ca339f4c4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketScales.lean @@ -21,7 +21,7 @@ section /-! The manuscript's literal first-packet scales have a fixed monomial frequency cost. The exponent and coefficient do not depend on J or X. -/ -@[expose] public section +public section noncomputable section @@ -115,7 +115,7 @@ end end -@[expose] public section +public section noncomputable section @@ -127,11 +127,11 @@ open Real Filter EulerPacketBaseScales EulerPacketBaseGuardScales EulerPacketSou open scoped Topology /-- Literal initial error, given by `(X^D)^(-(1/4 : ℝ))`. -/ -def literalInitialError (D : ℕ) (X : ℝ) : ℝ := (X^D)^(-(1/4 : ℝ)) +@[expose] def literalInitialError (D : ℕ) (X : ℝ) : ℝ := (X^D)^(-(1/4 : ℝ)) /-- Literal initial pressure cost, given by `2*initialCoefficientCost*X^(-1010 : ℝ)*(X^1000*firstRatio)+literalInitialError D X`. -/ -def literalInitialPressureCost (D : ℕ) (X : ℝ) : ℝ := +@[expose] def literalInitialPressureCost (D : ℕ) (X : ℝ) : ℝ := 2*initialCoefficientCost*X^(-1010 : ℝ)*(X^1000*firstRatio)+literalInitialError D X theorem literalInitialError_nonneg (D : ℕ) (X : ℝ) (hX : 0 ≤ X) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketSupport.lean index 42f71f97f5..3cb6797789 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseFirstPacketSupport.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentChoiceInitialSupport supported: it is the compact smooth datum plus its first packet's literal compact initial increment. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseInductionStage.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseInductionStage.lean index 88c1026776..b3811d2a8f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseInductionStage.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseInductionStage.lean @@ -48,7 +48,7 @@ section /-! Exact low-order propagation for the first homogeneous packet, whose amplitude is delta times the desired initial shear. -/ -@[expose] public section +public section noncomputable section @@ -174,7 +174,7 @@ end end -@[expose] public section +public section noncomputable section @@ -287,7 +287,7 @@ section /-! The first packet's size and sign hypotheses are proved for the concrete base solution on its actual restricted horizon. -/ -@[expose] public section +public section noncomputable section @@ -362,7 +362,7 @@ end end -@[expose] public section +public section noncomputable section @@ -468,7 +468,7 @@ end end -@[expose] public section +public section noncomputable section @@ -604,7 +604,7 @@ section the normalized packet's gradient. At the fixed center this is the same quantity used by the source error bound and geometric renewal. -/ -@[expose] public section +public section noncomputable section @@ -675,7 +675,7 @@ end end -@[expose] public section +public section noncomputable section @@ -820,7 +820,7 @@ section /-! Exact initial frame parameters for the first normal stage: its coupling is one, tilt is beta, and shear is the prescribed first shear. -/ -@[expose] public section +public section noncomputable section @@ -918,7 +918,7 @@ section /-! The literal base scale constructs the first actual smooth Euler packet state and its localized source bounds. -/ -@[expose] public section +public section noncomputable section @@ -1015,7 +1015,7 @@ section /-! The first actual packet has the precise initial frame parameters a=1, sigma=sqrt(beta), and the prescribed polynomial shear. -/ -@[expose] public section +public section noncomputable section @@ -1076,7 +1076,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BasePacketSetup.lean b/LeanPool/NavierStokesAndEuler/Euler/BasePacketSetup.lean index f6887230c4..52eb434bbe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BasePacketSetup.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BasePacketSetup.lean @@ -19,7 +19,7 @@ section state: the physical Euler solution, all Sobolev orders, particle labels, and odd symmetry all refer to the same solution. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ end end -@[expose] public section +public section noncomputable section @@ -79,7 +79,7 @@ open Set InnerProductSpace EulerSmoothLimit EulerParentPacketFrames EulerTransverseFrameCoordinates EulerBaseEulerGuards EulerPacketSupport /-- First normal, given by `EuclideanSpace.single 0 1`. -/ -def firstNormal : Space := EuclideanSpace.single 0 1 +@[expose] def firstNormal : Space := EuclideanSpace.single 0 1 theorem firstNormal_unit : ‖firstNormal‖=1 := by simp [firstNormal] diff --git a/LeanPool/NavierStokesAndEuler/Euler/BasePacketUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/BasePacketUniformCosts.lean index 269281544f..02a0631cb7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BasePacketUniformCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BasePacketUniformCosts.lean @@ -20,7 +20,7 @@ section /-! The genuine short-time forward factory obeys the same source polynomial, using its proved constant profile and physical propagator cost 2. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -158,7 +158,7 @@ open Set EulerSmoothLimit EulerPacketSupport EulerParentPacketFrames EulerParentInitializedRadius /-- First parameter size, given by `4+solutionLabelConstant+T⁻¹+δ⁻¹+hchild`. -/ -def firstParameterSize (T δ hchild : ℝ) : ℝ := +@[expose] def firstParameterSize (T δ hchild : ℝ) : ℝ := 4+solutionLabelConstant+T⁻¹+δ⁻¹+hchild theorem firstParameterSize_bounds (T δ hchild : ℝ) (hT : 0 < T) (hδ : 0 < δ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/BasePressureCommutator.lean b/LeanPool/NavierStokesAndEuler/Euler/BasePressureCommutator.lean index 457eee61a5..d64ba723cd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BasePressureCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BasePressureCommutator.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.H6PressureCommutator /-! The actual base-order pressure commutator needs only one fewer pressure derivative. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- Sum of the strictly positive coefficient derivative bounds at the fixed base index six. -/ -def baseCoefficientSum {A : SmoothCoefficient period} +@[expose] def baseCoefficientSum {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection 6 A) : ℝ := ∑ l ∈ Finset.range 6, boundLevel period K (l+1) @@ -86,7 +86,7 @@ theorem base_sum_bound {A : SmoothCoefficient period} {p : LiftL2 period} exact h.trans_eq (by simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul]; ring) /-- The actual base pressure commutators after an external derivative word. -/ -def basePressureBlock {s : ℕ} {A : SmoothCoefficient period} {p : LiftL2 period} +@[expose] def basePressureBlock {s : ℕ} {A : SmoothCoefficient period} {p : LiftL2 period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection 6 A) (J : EulerSpatialSobolevInverse.SpatialJet period standardDirection s p) (n : ℕ) (hn : n + 6 ≤ s) diff --git a/LeanPool/NavierStokesAndEuler/Euler/BoundedCoefficientSmooth.lean b/LeanPool/NavierStokesAndEuler/Euler/BoundedCoefficientSmooth.lean index a3bb84a07a..90b7d8de9f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BoundedCoefficientSmooth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BoundedCoefficientSmooth.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanCoefficientSpatial /-! All-order parameter regularity of actual bounded smooth coefficient translations. -/ -@[expose] public section +public section noncomputable section @@ -54,7 +54,7 @@ def derivativeBundling : (Space →ᵇ (Space →L[ℝ] V)) →L[ℝ] simpa only [one_mul] using fieldDerivativeMap_norm_le A) @[simp] theorem derivativeBundling_apply (A : Space →ᵇ (Space →L[ℝ] V)) : - derivativeBundling A = fieldDerivativeMap A := rfl + derivativeBundling A = fieldDerivativeMap A := by rfl /-- A concrete smooth coefficient with globally bounded actual derivatives of every order. -/ structure BoundedSmoothField (V : Type u) [NormedAddCommGroup V] [NormedSpace ℝ V] where @@ -76,7 +76,7 @@ def derivative (A : BoundedSmoothField V) : BoundedSmoothField (Space →L[ℝ] simpa only [norm_iteratedFDeriv_fderiv] using A.bounded (n+1) @[simp] theorem derivative_field_apply (A : BoundedSmoothField V) (x : Space) : - A.derivative.field x = fderiv ℝ (A.field : Space → V) x := rfl + A.derivative.field x = fderiv ℝ (A.field : Space → V) x := by rfl theorem translation_hasFDerivAt (A : BoundedSmoothField V) (a : Space) : HasFDerivAt (translated A.field) (fieldDerivativeMap (translated A.derivative.field a)) a := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldCalculus.lean index 56f0fdde70..cdf741a623 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldCalculus.lean @@ -20,7 +20,7 @@ maps to compact time paths preserves their norm bounds. These are the coefficient maps used to construct the actual source forward generator. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ local instance instBoundedFieldCalculus9 : NormedAddCommGroup (α →ᵇ G) := i local instance instBoundedFieldCalculus10 : NormedSpace ℝ (α →ᵇ G) := inferInstance /-- The literal pointwise bounded bilinear field. -/ -def bilinearValue (B : E →L[ℝ] F →L[ℝ] G) (f : α →ᵇ E) (g : α →ᵇ F) : α →ᵇ G := +@[expose] def bilinearValue (B : E →L[ℝ] F →L[ℝ] G) (f : α →ᵇ E) (g : α →ᵇ F) : α →ᵇ G := BoundedContinuousFunction.ofNormedAddCommGroup (fun x => B (f x) (g x)) ((B.continuous.comp f.continuous).clm_apply g.continuous) (‖B‖*‖f‖*‖g‖) (fun x => (B.le_opNorm₂ (f x) (g x)).trans @@ -78,7 +78,7 @@ theorem bilinearValue_norm (B : E →L[ℝ] F →L[ℝ] G) (f : α →ᵇ E) (g BoundedContinuousFunction.norm_ofNormedAddCommGroup_le _ (by positivity) _ /-- Bilinearity is proved on the actual coefficient functions. -/ -def bilinearLinear (B : E →L[ℝ] F →L[ℝ] G) : (α →ᵇ E) →ₗ[ℝ] (α →ᵇ F) →ₗ[ℝ] (α →ᵇ G) where +@[expose] def bilinearLinear (B : E →L[ℝ] F →L[ℝ] G) : (α →ᵇ E) →ₗ[ℝ] (α →ᵇ F) →ₗ[ℝ] (α →ᵇ G) where toFun f := { toFun := bilinearValue B f map_add' g h := by @@ -103,7 +103,7 @@ def bilinearLinear (B : E →L[ℝ] F →L[ℝ] G) : (α →ᵇ E) →ₗ[ℝ] ( exact congrArg (fun L : F →L[ℝ] G => L (h x)) (map_smul B r (f x)) /-- The actual bilinear map on bounded continuous fields. -/ -def bilinearMap (B : E →L[ℝ] F →L[ℝ] G) : (α →ᵇ E) →L[ℝ] (α →ᵇ F) →L[ℝ] (α →ᵇ G) := +@[expose] def bilinearMap (B : E →L[ℝ] F →L[ℝ] G) : (α →ᵇ E) →L[ℝ] (α →ᵇ F) →L[ℝ] (α →ᵇ G) := (bilinearLinear B).mkContinuous₂ ‖B‖ (bilinearValue_norm B) @[simp] theorem bilinearMap_apply (B : E →L[ℝ] F →L[ℝ] G) (f : α →ᵇ E) (g : α →ᵇ F) (x : α) : @@ -167,7 +167,7 @@ local instance instBoundedFieldCalculus24 : NormedSpace ℝ ((α →ᵇ U →L[ := inferInstance /-- The literal composition of two bounded operator fields. -/ -def compositionMap : (α →ᵇ E →L[ℝ] F) →L[ℝ] (α →ᵇ U →L[ℝ] E) →L[ℝ] (α →ᵇ U →L[ℝ] F) := +@[expose] def compositionMap : (α →ᵇ E →L[ℝ] F) →L[ℝ] (α →ᵇ U →L[ℝ] E) →L[ℝ] (α →ᵇ U →L[ℝ] F) := bilinearMap (compL ℝ U E F) theorem compositionMap_norm : ‖compositionMap (α := α) (U := U) (E := E) (F := F)‖ ≤ 1 := @@ -221,7 +221,7 @@ local instance instBoundedFieldCalculus34 : NormedSpace ℝ (C(K,α →ᵇ U → inferInstance /-- Pointwise spatial composition, uniformly along a compact time path. -/ -def pathCompositionMap : C(K,α →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def pathCompositionMap : C(K,α →ᵇ E →L[ℝ] F) →L[ℝ] C(K,α →ᵇ U →L[ℝ] E) →L[ℝ] C(K,α →ᵇ U →L[ℝ] F) := (EulerContinuousPathCalculus.coefficientMap (K := K) (E := α →ᵇ U →L[ℝ] E) (F := α →ᵇ U →L[ℝ] F)) ∘L @@ -309,7 +309,7 @@ local instance instBoundedFieldCalculus44 : NormedSpace ℝ ((α →ᵇ U →L[ := inferInstance /-- The actual adjoint of every bounded coefficient operator. -/ -def adjointMap : (α →ᵇ U →L[ℝ] E) →L[ℝ] (α →ᵇ E →L[ℝ] U) := +@[expose] def adjointMap : (α →ᵇ U →L[ℝ] E) →L[ℝ] (α →ᵇ E →L[ℝ] U) := (realAdjoint (U := U) (E := E)).compLeftContinuousBounded α @[simp] theorem adjointMap_apply (A : α →ᵇ U →L[ℝ] E) (x : α) : adjointMap A x = (A x).adjoint := @@ -353,7 +353,7 @@ local instance instBoundedFieldCalculus50 : NormedSpace ℝ (C(K,α →ᵇ U → inferInstance /-- The bounded adjoint map on entire coefficient paths. -/ -def pathAdjointMap : C(K,α →ᵇ U →L[ℝ] E) →L[ℝ] C(K,α →ᵇ E →L[ℝ] U) := +@[expose] def pathAdjointMap : C(K,α →ᵇ U →L[ℝ] E) →L[ℝ] C(K,α →ᵇ E →L[ℝ] U) := (adjointMap (α := α) (U := U) (E := E)).compLeftContinuous ℝ K omit [CompactSpace K] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldTimeDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldTimeDerivative.lean index 6b60075705..fd847db831 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldTimeDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BoundedFieldTimeDerivative.lean @@ -18,7 +18,7 @@ both the field and prescribed derivative are continuous in that norm. The proof uses the Bochner fundamental theorem of calculus and bounded evaluation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BoundedFlowContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/BoundedFlowContinuity.lean index b9c71cf712..65d61034b0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BoundedFlowContinuity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BoundedFlowContinuity.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Exp and the initial point. Reversing its two time arguments gives its genuine continuous inverse, so each fixed-time map is a homeomorphism. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BoundedInverseGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/BoundedInverseGevrey.lean index 19da07a031..c672f71f4e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BoundedInverseGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BoundedInverseGevrey.lean @@ -19,7 +19,7 @@ of the frozen operator. This form applies to continuous path spaces as well as Hilbert spaces, without assigning a Hilbert structure to a uniform norm. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/BoundedLipschitzFlow.lean b/LeanPool/NavierStokesAndEuler/Euler/BoundedLipschitzFlow.lean index 79d8fb1f83..cf83e4d919 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BoundedLipschitzFlow.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BoundedLipschitzFlow.lean @@ -20,7 +20,7 @@ bounded velocity and Grönwall estimate will give joint continuity in both times and the initial point. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CanonicalGraphPotential.lean b/LeanPool/NavierStokesAndEuler/Euler/CanonicalGraphPotential.lean index 7da691ae97..ed85e0c9d4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CanonicalGraphPotential.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CanonicalGraphPotential.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Radial reconstruction of a canonically normalized scalar potential. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ open MeasureTheory Set InnerProductSpace EulerLiftedGradientSpace open scoped ContDiff /-- The scalar radial integral of a spatial vector field, based at the origin. -/ -def radialPotential (V : Vector3 → Vector3) (x : Vector3) : ℝ := +@[expose] def radialPotential (V : Vector3 → Vector3) (x : Vector3) : ℝ := ∫ s in (0 : ℝ)..1, ⟪V (s • x), x⟫_ℝ /-- The radial integral is normalized to vanish at the origin. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/CanonicalVorticityConfinement.lean b/LeanPool/NavierStokesAndEuler/Euler/CanonicalVorticityConfinement.lean index 19e8d5fb7b..bf3fd1c899 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CanonicalVorticityConfinement.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CanonicalVorticityConfinement.lean @@ -51,7 +51,7 @@ section /-! Conservation of the antisymmetric frame pairing for a particle flow whose acceleration gradient is a symmetric operator. -/ -@[expose] public section +public section noncomputable section @@ -124,7 +124,7 @@ section # Curl Matrix Symmetry -/ -@[expose] public section +public section noncomputable section @@ -188,7 +188,7 @@ section because its actual gradient is smooth. Its curvature operator is therefore symmetric, as required by the particle-map vorticity transport argument. -/ -@[expose] public section +public section noncomputable section @@ -225,7 +225,7 @@ end end -@[expose] public section +public section noncomputable section @@ -309,7 +309,7 @@ bound on its velocity or velocity gradients. Vorticity confinement additionally requires its transport identity along these particle maps. -/ -@[expose] public section +public section noncomputable section @@ -460,7 +460,7 @@ The hypotheses below are explicit: this file does not yet assert their instantiation for the packet choices made by the development. -/ -@[expose] public section +public section namespace Euler.ComparatorBridge @@ -578,7 +578,7 @@ section /-! The curl of a differentiable field has support inside the support of that field. This elementary locality fact does not assume spatial norm bounds. -/ -@[expose] public section +public section namespace EulerMeanCutoffCurl @@ -600,7 +600,7 @@ end end -@[expose] public section +public section noncomputable section @@ -686,7 +686,7 @@ with the tail of the packet family would bound the divergent activation gradients. This applies the proved varying-horizon H³ stability theorem. -/ -@[expose] public section +public section noncomputable section @@ -776,7 +776,7 @@ section /-! Convergence of ordinary Euler velocities in the initial H³ norm gives pointwise convergence of their curls at every time in their common interval. -/ -@[expose] public section +public section noncomputable section @@ -854,7 +854,7 @@ section throughout its horizon. Initial support, the actual vorticity transport law, and the summable particle-map displacement bound supply the three ingredients. -/ -@[expose] public section +public section noncomputable section @@ -883,7 +883,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean index 9571791a4f..907705cb17 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean @@ -22,7 +22,7 @@ section jets, so a parent satisfying (21) supplies every outer L² input needed by the volume-preserving composition estimate. -/ -@[expose] public section +public section noncomputable section @@ -84,7 +84,7 @@ end end -@[expose] public section +public section noncomputable section @@ -133,15 +133,15 @@ namespace Data variable (G : Data) /-- Inner, given by `x+G.displacement.field x`. -/ -def inner (x : Space) : Space := x+G.displacement.field x +@[expose] def inner (x : Space) : Space := x+G.displacement.field x /-- Composition radius, given by `(1+G.rad)*((1+G.amp)*s+2)`. -/ -def compositionRadius (s : ℝ) : ℝ := (1+G.rad)*((1+G.amp)*s+2) +@[expose] def compositionRadius (s : ℝ) : ℝ := (1+G.rad)*((1+G.amp)*s+2) /-- Radius, given by `G.compositionRadius (16*G.K)+G.rad`. -/ def radius : ℝ := G.compositionRadius (16*G.K)+G.rad /-- First amplitude, given by `(embeddingCost*G.K)*G.K`. -/ -def firstAmplitude : ℝ := (embeddingCost*G.K)*G.K +@[expose] def firstAmplitude : ℝ := (embeddingCost*G.K)*G.K /-- Second amplitude, given by `G.firstAmplitude*(4*G.K)`. -/ -def secondAmplitude : ℝ := G.firstAmplitude*(4*G.K) +@[expose] def secondAmplitude : ℝ := G.firstAmplitude*(4*G.K) /-- Amplitude, given by `G.K+G.amp+9*G.firstAmplitude*G.amp+9*G.secondAmplitude*G.amp^2`. -/ def amplitude : ℝ := G.K+G.amp+9*G.firstAmplitude*G.amp+9*G.secondAmplitude*G.amp^2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/ClassicalBridge.lean b/LeanPool/NavierStokesAndEuler/Euler/ClassicalBridge.lean index eb26fad676..d476e156bb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ClassicalBridge.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ClassicalBridge.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Comp /-! Ordinary spatial smoothness, finite energy, and the pointwise time equation follow from the independent Comparator solution class. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ClassicalDivergence.lean b/LeanPool/NavierStokesAndEuler/Euler/ClassicalDivergence.lean index 03f348f008..acaeb59597 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ClassicalDivergence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ClassicalDivergence.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! Actual smooth representatives of the closed divergence-free space have pointwise lifted divergence zero. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ClassicalPressureCurl.lean b/LeanPool/NavierStokesAndEuler/Euler/ClassicalPressureCurl.lean index c9d37ca269..6a14f679ff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ClassicalPressureCurl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ClassicalPressureCurl.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Mul /-! Classical lifted closedness of actual smooth representatives of the closed L² gradient space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ClosedIntervalDerivativeExtension.lean b/LeanPool/NavierStokesAndEuler/Euler/ClosedIntervalDerivativeExtension.lean index 24b3db8c5b..0a946caff3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ClosedIntervalDerivativeExtension.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ClosedIntervalDerivativeExtension.lean @@ -16,7 +16,7 @@ closed time interval into ordinary derivatives there. It uses affine tails whose slopes are the actual endpoint derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ClosedTranslationGraph.lean b/LeanPool/NavierStokesAndEuler/Euler/ClosedTranslationGraph.lean index bae04c616e..02b7d1a232 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ClosedTranslationGraph.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ClosedTranslationGraph.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.Calculus.UniformLimitsDeriv /-! Closed graphs of the genuine strong cylinder translation derivatives. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,8 @@ theorem translation_orbits_tendstoUniformly {ι : Type*} {l : Filter ι} simpa only [Metric.mem_ball, dist_comm] using hn /-- The graph of one genuine strong L² translation derivative, as a linear subspace. -/ -def translationDerivativeGraph (a : LiftTangent) : Submodule ℝ (LiftL2 period × LiftL2 period) where +@[expose] def translationDerivativeGraph (a : LiftTangent) : + Submodule ℝ (LiftL2 period × LiftL2 period) where carrier := {p | HasDerivAt (fun t => translation period (translationPath period a t) p.1) p.2 0} zero_mem' := by change HasDerivAt (fun t => translation period (translationPath period a t) 0) 0 0 diff --git a/LeanPool/NavierStokesAndEuler/Euler/CoefficientCostMonotone.lean b/LeanPool/NavierStokesAndEuler/Euler/CoefficientCostMonotone.lean index 1a83c077b0..c1c4c205d9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CoefficientCostMonotone.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CoefficientCostMonotone.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Joint monotonicity and genuine polynomial formulas for fixed-order coefficient and pressure constants. These give uniform parent-scale bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CoefficientJetPressureBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CoefficientJetPressureBounds.lean index 4f9af4f73b..822da6ca00 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CoefficientJetPressureBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CoefficientJetPressureBounds.lean @@ -14,7 +14,7 @@ actual coefficient derivative tree. At each fixed Sobolev order these costs are finite polynomials in the coefficient bound and inverse coercivity. -/ -@[expose] public section +public section noncomputable section @@ -24,13 +24,13 @@ namespace EulerCoefficientJetPressureBounds open Finset EulerLiftedGradientSpace EulerSpatialSobolevInverse EulerJetProductBounds /-- Product cost as an element of `ℕ → ℝ | 0 => B | q+1 => B+8*productCost B q`. -/ -def productCost (B : ℝ) : ℕ → ℝ +@[expose] def productCost (B : ℝ) : ℕ → ℝ | 0 => B | q+1 => B+8*productCost B q /-- Pressure cost as an element of `ℕ → ℝ | 0 => c⁻¹ | q+1 => c⁻¹+4*(pressureCost c B q*(1+productCost B q*pressureCost c B q))`. -/ -def pressureCost (c B : ℝ) : ℕ → ℝ +@[expose] def pressureCost (c B : ℝ) : ℕ → ℝ | 0 => c⁻¹ | q+1 => c⁻¹+4*(pressureCost c B q*(1+productCost B q*pressureCost c B q)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathOrbit.lean b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathOrbit.lean index 1ce484f90c..b3aca025fd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathOrbit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathOrbit.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! A genuinely smooth bounded-coefficient translation orbit supplies actual bounded spatial derivatives, continuously over the time parameter. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean index 1b2f2e325f..f2f4e1b4dc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Normed.Operator.Prod /-! Genuine bounded smooth cylinder coefficients and all their derivative jets are constructed from the actual coefficient translation orbit. -/ -@[expose] public section +public section noncomputable section @@ -120,13 +120,13 @@ def smoothCoefficient (t : K) : SmoothCoefficient P where omit [Fact (0 < P)] in @[simp] theorem smoothCoefficient_apply (t : K) (x : LiftDomain P) : - (smoothCoefficient P A hA t).coefficient x = A t x.1 := rfl + (smoothCoefficient P A hA t).coefficient x = A t x.1 := by rfl end Basic /-- Coefficient jet as an element of `CoefficientJet P standardDirection q (smoothCoefficient P A hA t)`. -/ -def coefficientJet (P : ℝ) [Fact (0 < P)] +@[expose] def coefficientJet (P : ℝ) [Fact (0 < P)] (A : C(K, Space →ᵇ Space →L[ℝ] Space)) (hA : ContDiff ℝ ∞ (translateCoefficientPath A)) (q : ℕ) (t : K) : CoefficientJet P standardDirection q (smoothCoefficient P A hA t) := @@ -137,7 +137,13 @@ def coefficientJet (P : ℝ) [Fact (0 < P)] (orbitDerivativePath_orbit A hA (standardDirection i).1) t) (fun i => coefficientJet P (orbitDerivativePath A (standardDirection i).1) (orbitDerivativePath_orbit A hA (standardDirection i).1) n t) - (fun i x => (cylinder_fieldDerivative P A hA t (standardDirection i) x).symm) + (fun i x => by + have hcoefficient : (smoothCoefficient P A hA t).coefficient = + fun z => A t z.1 := by + funext z + exact smoothCoefficient_apply P A hA t z + rw [hcoefficient] + exact (cylinder_fieldDerivative P A hA t (standardDirection i) x).symm) variable (P : ℝ) [Fact (0 < P)] (A : C(K, Space →ᵇ Space →L[ℝ] Space)) @@ -151,7 +157,8 @@ theorem smoothCoefficient_operator (t : K) : filter_upwards [(smoothCoefficient P A hA t).operator_ae f, EulerLpOperatorField.full_ae (liftMeasure P) (EulerLpCylinderTranslation.fieldLift P (A t)) f] with x h₁ h₂ - exact h₁.trans h₂.symm + simp only [smoothCoefficient_apply, EulerLpCylinderTranslation.fieldLift_apply] at h₁ h₂ + simpa only [fullOperatorMap_apply] using h₁.trans h₂.symm theorem smoothCoefficient_operator_continuous : Continuous (fun t => (smoothCoefficient P A hA t).operator) := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/CommonPressureRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/CommonPressureRepresentative.lean index 9f1c7e3d1c..0f1eea7c23 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CommonPressureRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CommonPressureRepresentative.lean @@ -21,7 +21,7 @@ section /-! Constructed compatible inviscid corrections at every finite Sobolev order. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ section /-! The actual nonlinear source and signed coercive pressure agree across the constructed Sobolev solutions. -/ -@[expose] public section +public section noncomputable section @@ -217,7 +217,7 @@ section /-! A common actual lifted inviscid correction with genuine jets of every order and smooth spatial representatives. -/ -@[expose] public section +public section noncomputable section @@ -322,7 +322,7 @@ end end -@[expose] public section +public section noncomputable section @@ -396,7 +396,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CompactParameterIntegral.lean b/LeanPool/NavierStokesAndEuler/Euler/CompactParameterIntegral.lean index 78ba40993d..a407107821 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CompactParameterIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CompactParameterIntegral.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.ParametricIntegral /-! Smooth parameter dependence of an actual integral over a compact interval. -/ -@[expose] public section +public section noncomputable section @@ -29,6 +29,7 @@ variable {X : Type} [NormedAddCommGroup X] [NormedSpace ℝ X] [ProperSpace X] {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- Parameter derivative, given by `(fderiv ℝ F p).comp (ContinuousLinearMap.inl ℝ X ℝ)`. -/ +@[expose] def parameterDerivative (F : X × ℝ → E) (p : X × ℝ) : X →L[ℝ] E := (fderiv ℝ F p).comp (ContinuousLinearMap.inl ℝ X ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CompactProjectedEulerLaw.lean b/LeanPool/NavierStokesAndEuler/Euler/CompactProjectedEulerLaw.lean index f4b969a7e5..02e9f834cc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CompactProjectedEulerLaw.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CompactProjectedEulerLaw.lean @@ -48,7 +48,7 @@ The scalar pressure needs only ordinary smoothness. In particular, neither the pressure nor its gradient is assumed to be globally square integrable. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ end end -@[expose] public section +public section noncomputable section @@ -283,7 +283,7 @@ The curl-curl identity reduces the orthogonal complement of compact smooth curls inside the solenoidal space to globally weakly harmonic L² fields. -/ -@[expose] public section +public section noncomputable section @@ -485,7 +485,7 @@ the ordinary spatial integral against advection. Compactly supported smooth tests automatically satisfy the required `L²` assumption. -/ -@[expose] public section +public section noncomputable section @@ -549,7 +549,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CompactSmoothTimeField.lean b/LeanPool/NavierStokesAndEuler/Euler/CompactSmoothTimeField.lean index 22e07a976b..1820c17b1d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CompactSmoothTimeField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CompactSmoothTimeField.lean @@ -14,7 +14,7 @@ import Mathlib.Topology.Algebra.Module.PerfectSpace The compact support is common to the time slices, so compact joint continuity upgrades to continuity in the uniform spatial norm at every derivative order. -/ -@[expose] public section +public section noncomputable section @@ -83,10 +83,10 @@ def reparametrize (A : SmoothTimeField K E V) (r : C(L, K)) : SmoothTimeField L jet_eq n t x := A.jet_eq n (r t) x @[simp] theorem reparametrize_apply (A : SmoothTimeField K E V) (r : C(L, K)) - (t : L) (x : E) : (A.reparametrize r).field t x = A.field (r t) x := rfl + (t : L) (x : E) : (A.reparametrize r).field t x = A.field (r t) x := by rfl @[simp] theorem reparametrize_jet_apply (A : SmoothTimeField K E V) (r : C(L, K)) - (n : ℕ) (t : L) (x : E) : (A.reparametrize r).jet n t x = A.jet n (r t) x := rfl + (n : ℕ) (t : L) (x : E) : (A.reparametrize r).jet n t x = A.jet n (r t) x := by rfl end SmoothTimeField @@ -113,7 +113,7 @@ local instance instCompactSmoothTimeField4 (n : ℕ) : NormedSpace ℝ (E →ᵇ /-- Continuous spatial jets with one common compact support yield a bounded smooth coefficient path. The support condition on derivatives is derived. -/ -def ofCompactSupportJets (u : A × E → V) (hu : Continuous u) +@[expose] def ofCompactSupportJets (u : A × E → V) (hu : Continuous u) (hsmooth : ∀ t, ContDiff ℝ ∞ (fun x => u (t, x))) (hjet : ∀ n : ℕ, Continuous (fun z : A × E => iteratedFDeriv ℝ n (fun x => u (z.1, x)) z.2)) @@ -131,7 +131,7 @@ def ofCompactSupportJets (u : A × E → V) (hu : Continuous u) (fun z : A × E => iteratedFDeriv ℝ n (fun x => u (z.1, x)) z.2)) (K : Set E) (hK : IsCompact K) (hsupp : ∀ t, tsupport (fun x => u (t, x)) ⊆ K) (t : A) (x : E) : - (ofCompactSupportJets u hu hsmooth hjet K hK hsupp).field t x = u (t, x) := rfl + (ofCompactSupportJets u hu hsmooth hjet K hK hsupp).field t x = u (t, x) := by rfl end SmoothTimeField @@ -143,7 +143,7 @@ variable {P E V : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- A jointly smooth family on a compact parameter set with common compact spatial support has all spatial jets continuous in the uniform norm. -/ -def ofContDiffOnCompactSupport (s : Set P) [CompactSpace s] +@[expose] def ofContDiffOnCompactSupport (s : Set P) [CompactSpace s] (u : P × E → V) (hu : ContDiffOn ℝ ∞ u (s ×ˢ univ)) (K : Set E) (hK : IsCompact K) (hsupp : ∀ t ∈ s, tsupport (fun x => u (t, x)) ⊆ K) : @@ -166,7 +166,7 @@ def ofContDiffOnCompactSupport (s : Set P) [CompactSpace s] (u : P × E → V) (hu : ContDiffOn ℝ ∞ u (s ×ˢ univ)) (K : Set E) (hK : IsCompact K) (hsupp : ∀ t ∈ s, tsupport (fun x => u (t, x)) ⊆ K) (t : s) (x : E) : - (ofContDiffOnCompactSupport s u hu K hK hsupp).field t x = u (t, x) := rfl + (ofContDiffOnCompactSupport s u hu K hK hsupp).field t x = u (t, x) := by rfl @[simp] theorem ofContDiffOnCompactSupport_jet_apply (s : Set P) [CompactSpace s] (u : P × E → V) (hu : ContDiffOn ℝ ∞ u (s ×ˢ univ)) @@ -174,6 +174,6 @@ def ofContDiffOnCompactSupport (s : Set P) [CompactSpace s] (hsupp : ∀ t ∈ s, tsupport (fun x => u (t, x)) ⊆ K) (n : ℕ) (t : s) (x : E) : (ofContDiffOnCompactSupport s u hu K hK hsupp).jet n t x = - iteratedFDeriv ℝ n (fun y => u (t, y)) x := rfl + iteratedFDeriv ℝ n (fun y => u (t, y)) x := by rfl end SmoothTimeField diff --git a/LeanPool/NavierStokesAndEuler/Euler/CompactSupportBoundedPath.lean b/LeanPool/NavierStokesAndEuler/Euler/CompactSupportBoundedPath.lean index 6de6d0978e..1697d24def 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CompactSupportBoundedPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CompactSupportBoundedPath.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.ContinuousMap.Bounded.Basic /-! Continuous families with a common compact spatial support give continuous paths in the space of bounded continuous functions, equipped with the uniform norm. -/ -@[expose] public section +public section open Set Filter Topology @@ -25,14 +25,14 @@ variable {A E V : Type*} [TopologicalSpace A] [TopologicalSpace E] [NormedAddCommGroup V] /-- A continuous, compactly supported function, regarded as a bounded continuous function. -/ -def boundedOfCompactSupport (f : E → V) (hf : Continuous f) +@[expose] def boundedOfCompactSupport (f : E → V) (hf : Continuous f) (hs : HasCompactSupport f) : E →ᵇ V where toFun := f continuous_toFun := hf map_bounded' := Metric.isBounded_range_iff.mp (hs.isCompact_range hf).isBounded @[simp] theorem boundedOfCompactSupport_apply (f : E → V) (hf : Continuous f) - (hs : HasCompactSupport f) (x : E) : boundedOfCompactSupport f hf hs x = f x := rfl + (hs : HasCompactSupport f) (x : E) : boundedOfCompactSupport f hf hs x = f x := by rfl /-- Uniformly compact spatial support upgrades joint continuity to continuity in the bounded-continuous-function norm. No compactness assumption on the parameter space is needed. -/ @@ -66,7 +66,7 @@ theorem continuous_boundedOfCompactSupport /-- A continuous family with one common compact spatial support, bundled as a continuous path of bounded continuous functions. -/ -def compactSupportBoundedPath +@[expose] def compactSupportBoundedPath (u : A × E → V) (hu : Continuous u) (K : Set E) (hK : IsCompact K) (hs : ∀ t, tsupport (fun x => u (t, x)) ⊆ K) : C(A, E →ᵇ V) where toFun t := boundedOfCompactSupport (fun x => u (t, x)) @@ -77,6 +77,6 @@ def compactSupportBoundedPath @[simp] theorem compactSupportBoundedPath_apply (u : A × E → V) (hu : Continuous u) (K : Set E) (hK : IsCompact K) (hs : ∀ t, tsupport (fun x => u (t, x)) ⊆ K) (t : A) (x : E) : - compactSupportBoundedPath u hu K hK hs t x = u (t, x) := rfl + compactSupportBoundedPath u hu K hK hs t x = u (t, x) := by rfl end EulerComparator diff --git a/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityContradiction.lean b/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityContradiction.lean index 59738c712f..99f71a23ef 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityContradiction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityContradiction.lean @@ -22,7 +22,7 @@ section /-! Joint smoothness in the reference bounds spatial derivatives on every fixed compact spatial set and closed finite time interval, including time zero. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ section /-! Joint smoothness bounds the actual spatial vorticity on every fixed compact spatial set and every closed finite time interval. -/ -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityTimeUpgrade.lean b/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityTimeUpgrade.lean index bfc81635db..cde82a0f4d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityTimeUpgrade.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CompactVorticityTimeUpgrade.lean @@ -37,7 +37,7 @@ integral equation and hence its strong derivative when the right-hand side is continuous. -/ -@[expose] public section +public section noncomputable section @@ -235,7 +235,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ComparatorEvolutionIdentification.lean b/LeanPool/NavierStokesAndEuler/Euler/ComparatorEvolutionIdentification.lean index 85612bcfd9..276386ac3c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ComparatorEvolutionIdentification.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ComparatorEvolutionIdentification.lean @@ -25,7 +25,7 @@ section /-! Restriction of an ordinary Euler evolution to a translated closed interval. -/ -@[expose] public section +public section noncomputable section @@ -104,7 +104,7 @@ section /-! Time translation preserves the independent whole-space Euler class, including its one-sided initial-time equation and uniform energy bound. -/ -@[expose] public section +public section noncomputable section @@ -160,7 +160,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ComparatorIdentification.lean b/LeanPool/NavierStokesAndEuler/Euler/ComparatorIdentification.lean index ab4c9daf67..931a3fbfb4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ComparatorIdentification.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ComparatorIdentification.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OrdinaryEulerMaximal /-! Local recovery and ordinary uniqueness identify the canonical maximal velocity with every global Comparator solution. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalCompactVorticity.lean b/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalCompactVorticity.lean index c4f86d8f26..9d21df873c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalCompactVorticity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalCompactVorticity.lean @@ -38,7 +38,7 @@ The maps are clamped outside the chosen interval, preserving volume at every real parameter. Reversing from the other endpoint recovers the original coefficient and supplies the forward paths used in local trapping arguments. -/ -@[expose] public section +public section noncomputable section @@ -258,7 +258,7 @@ endpoint maps in one common ball. These hypotheses exclude all nonzero vorticity outside that ball; no global pointwise velocity bound is needed. -/ -@[expose] public section +public section noncomputable section @@ -408,7 +408,7 @@ section /-! Short-time confinement uses a velocity bound only inside the trapping ball. -/ -@[expose] public section +public section noncomputable section @@ -521,7 +521,7 @@ section /-! Nonzero vorticity cannot disappear on an existing reverse-time particle trajectory of a Comparator solution. -/ -@[expose] public section +public section noncomputable section @@ -579,7 +579,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalEvolution.lean index bfc2a0e6e4..7ace9a93ef 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ComparatorLocalEvolution.lean @@ -51,7 +51,7 @@ therefore gives a finite constant converting the sum of the scalar coordinate energies into a bound for the literal tensor norm. -/ -@[expose] public section +public section noncomputable section @@ -108,7 +108,7 @@ end end -@[expose] public section +public section noncomputable section @@ -263,7 +263,7 @@ section /-! Joint spatial coordinate derivatives and uniform energy bounds for families supported in a fixed compact set. -/ -@[expose] public section +public section noncomputable section @@ -385,7 +385,7 @@ vorticity stays in one compact set on a finite time interval. Ordinary joint smoothness supplies the compact source bounds, and elliptic recovery supplies the velocity derivative bounds. -/ -@[expose] public section +public section noncomputable section @@ -480,7 +480,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ComparatorMaximalSolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ComparatorMaximalSolution.lean index 3366278efe..d8325e8dee 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ComparatorMaximalSolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ComparatorMaximalSolution.lean @@ -28,7 +28,7 @@ section /-! The extended spatial suprema in the independent challenge agree with the ordinary development's bounded-function norms on every smooth Sobolev slice. -/ -@[expose] public section +public section noncomputable section @@ -76,7 +76,7 @@ end end -@[expose] public section +public section noncomputable section @@ -208,7 +208,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ComparatorSobolevEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ComparatorSobolevEvolution.lean index 1b3dc403e1..71d7aa41fd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ComparatorSobolevEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ComparatorSobolevEvolution.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanClassicalConstraints /-! Repackaging the reference's ordinary functions as the development's smooth L² fields. The scalar Euler equations and time-regularity hypotheses coincide. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationForcing.lean index f7f0856cb7..80a9bbfaea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationForcing.lean @@ -20,7 +20,7 @@ factorial bound are proved in the uniform time norm and are shared by the mean and transverse strong equations. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,9 @@ variable {K P U E : Type*} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The literal continuous forcing in the projected acceleration equation. -/ -def forcing (Q Q₁ : P → C(K, U →L[ℝ] E)) (f : P → C(K, E)) (v : P → C(K, U)) (x : P) : C(K,U) := +@[expose] +def forcing (Q Q₁ : P → C(K, U →L[ℝ] E)) (f : P → C(K, E)) + (v : P → C(K, U)) (x : P) : C(K,U) := multiplier (adjointMap (Q x)) (f x - (2 : ℝ) • multiplier (Q₁ x) (v x)) /-- Actual uniform-time regularity of the acceleration forcing. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationGevrey.lean index 629f2ef565..3aa91bd4bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousAccelerationGevrey.lean @@ -21,7 +21,7 @@ to its literal forcing. Smoothness and factorial estimates therefore apply to the actual continuous path, including its endpoint values. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousForcingTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousForcingTranslation.lean index 11d3a678a2..83a553e8a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousForcingTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousForcingTranslation.lean @@ -34,7 +34,7 @@ The proof uses a quadratic Taylor remainder and loses no derivative-bound constant. No uniform-path differentiability is assumed. -/ -@[expose] public section +public section noncomputable section @@ -97,7 +97,7 @@ def derivativeMap (D : C(K, Space →L[ℝ] V)) : Space →L[ℝ] C(K,V) where (direction_norm_le D) @[simp] theorem derivativeMap_apply (D : C(K, Space →L[ℝ] V)) (a : Space) (t : K) : - derivativeMap D a t = D t a := rfl + derivativeMap D a t = D t a := by rfl theorem derivativeMap_norm_le (D : C(K, Space →L[ℝ] V)) : ‖derivativeMap D‖ ≤ ‖D‖ := (derivativeMap D).opNorm_le_bound (norm_nonneg D) (direction_norm_le D) @@ -221,7 +221,7 @@ def derivative (A : SpatialFamily K V) : SpatialFamily K (Space →L[ℝ] V) whe exact A.bounded (n+1) a t @[simp] theorem derivative_bound (A : SpatialFamily K V) (n : ℕ) : - A.derivative.bound n = A.bound (n+1) := rfl + A.derivative.bound n = A.bound (n+1) := by rfl theorem taylor_bound (A : SpatialFamily K V) (a b : Space) : ‖A.field b-A.field a-derivativeMap (A.derivative.field a) (b-a)‖ ≤ @@ -313,7 +313,7 @@ end end -@[expose] public section +public section noncomputable section @@ -332,7 +332,7 @@ def translate (a : Space) (f : C(K, L2Space V)) : C(K,L2Space V) := omit [CompactSpace K] in @[simp] theorem translate_apply (a : Space) (f : C(K, L2Space V)) (t : K) : - translate a f t = EulerLpTranslation.translation a (f t) := rfl + translate a f t = EulerLpTranslation.translation a (f t) := by rfl variable (A : K → SmoothL2Field V) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramAcceleration.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramAcceleration.lean index 26a1bf50a8..fecd74a831 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramAcceleration.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramAcceleration.lean @@ -17,7 +17,7 @@ Its norm and its identification with the strong L² acceleration are proved directly, for arbitrary complete real Hilbert coefficient spaces. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable (T : ℝ) (Q Q₁ : C(Icc (0 : ℝ) T, U →L[ℝ] E)) (c : ℝ) (hc : 0 < c) (hQ : ∀ t v, c * ‖v‖ ^ 2 ≤ ‖Q t v‖ ^ 2) /-- The actual continuous acceleration recovered from velocity and forcing. -/ -def accelerationPath (v : C(Icc (0 : ℝ) T, U)) (f : C(Icc (0 : ℝ) T, E)) : +@[expose] def accelerationPath (v : C(Icc (0 : ℝ) T, U)) (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T, U) := ⟨fun t => gramInverse (Q t) c hc (hQ t) ((Q t).adjoint (f t-(2 : ℝ) • Q₁ t (v t))), diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramGevrey.lean index 7c4781ad2d..9667ea0bd2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramGevrey.lean @@ -23,7 +23,7 @@ frozen-coefficient recurrence in the uniform norm gives actual inverse-path and solution estimates, without a Hilbert structure on the path space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramPath.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramPath.lean index 20deab13f0..b1779fbef7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramPath.lean @@ -21,7 +21,7 @@ smoothness follows from inversion at units of that algebra. No smoothness of a pre-existing inverse is assumed. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ theorem gramInversePath_eq_ringInverse : (Ring.inverse_unit (M₀ := C(Icc (0 : ℝ) T,U →L[ℝ] U)) (gramPathUnit T Q c hc hQ)).symm /-- The actual inverse acting on continuous forcing paths. -/ -def solve : C(Icc (0 : ℝ) T,U) →L[ℝ] C(Icc (0 : ℝ) T,U) := +@[expose] def solve : C(Icc (0 : ℝ) T,U) →L[ℝ] C(Icc (0 : ℝ) T,U) := multiplier (gramInversePath T Q c hc hQ) /-- The continuous solution satisfies the actual coefficient equation. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramSobolev.lean index d24a167f31..b145363cdb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousGramSobolev.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ContinuousPathCalculus /-! The actual uniform-time Gram inverse in fixed Sobolev word blocks. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousInverseDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousInverseDerivative.lean index 74b4c26515..598faeed13 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousInverseDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousInverseDerivative.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.FDeriv.OfCompLeft This is the easy half of the inverse function theorem; no differentiability of the inverse is an independent assumption. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathCalculus.lean index 2efb59ecaf..24538d3a74 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathCalculus.lean @@ -21,7 +21,7 @@ derivatives, and factorial estimates therefore come directly from the coefficient, with no loss in the coefficient amplitude. -/ -@[expose] public section +public section noncomputable section @@ -61,7 +61,7 @@ synthesis. -/ local instance instContinuousPathCalculus10 : NormedSpace ℝ (C(K,E) →L[ℝ] C(K,F)) := inferInstance /-- The actual coefficient-to-continuous-multiplier map is linear. -/ -def coefficientLinear : C(K,E →L[ℝ] F) →ₗ[ℝ] (C(K,E) →L[ℝ] C(K,F)) where +@[expose] def coefficientLinear : C(K,E →L[ℝ] F) →ₗ[ℝ] (C(K,E) →L[ℝ] C(K,F)) where toFun := multiplier map_add' A B := by apply ContinuousLinearMap.ext @@ -77,7 +77,7 @@ def coefficientLinear : C(K,E →L[ℝ] F) →ₗ[ℝ] (C(K,E) →L[ℝ] C(K,F)) rfl /-- A bounded linear map in the actual uniform coefficient norm. -/ -def coefficientMap : C(K,E →L[ℝ] F) →L[ℝ] (C(K,E) →L[ℝ] C(K,F)) where +@[expose] def coefficientMap : C(K,E →L[ℝ] F) →L[ℝ] (C(K,E) →L[ℝ] C(K,F)) where toLinearMap := coefficientLinear cont := AddMonoidHomClass.continuous_of_bound (coefficientLinear (K := K) (E := E) (F := F)) 1 (fun A => by diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathComposition.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathComposition.lean index 3855849106..ec32f6c37c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathComposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousPathComposition.lean @@ -22,7 +22,7 @@ norm. Their regularity and factorial bounds are consequently genuine derivative statements in that norm. -/ -@[expose] public section +public section noncomputable section @@ -97,7 +97,7 @@ theorem postcomposition_norm (A : E →L[ℝ] F) : (mul_le_mul_of_nonneg_left (p.norm_coe_le_norm t) (norm_nonneg A)) /-- Lift the actual operator composition bilinear map to the coefficient path. -/ -def compositionLift : C(K,E →L[ℝ] F) →L[ℝ] C(K,(U →L[ℝ] E) →L[ℝ] U →L[ℝ] F) := +@[expose] def compositionLift : C(K,E →L[ℝ] F) →L[ℝ] C(K,(U →L[ℝ] E) →L[ℝ] U →L[ℝ] F) := (compL ℝ U E F).compLeftContinuous ℝ K include U E F in @@ -105,7 +105,7 @@ theorem compositionLift_norm : ‖compositionLift (K := K) (U := U) (E := E) (F (postcomposition_norm (K := K) (compL ℝ U E F)).trans (norm_compL_le ℝ U E F) /-- Literal pointwise composition of two continuous coefficient paths. -/ -def compose (A : C(K, E →L[ℝ] F)) (B : C(K, U →L[ℝ] E)) : C(K,U →L[ℝ] F) := +@[expose] def compose (A : C(K, E →L[ℝ] F)) (B : C(K, U →L[ℝ] E)) : C(K,U →L[ℝ] F) := multiplier (compositionLift A) B @[simp] theorem compose_apply (A : C(K, E →L[ℝ] F)) (B : C(K, U →L[ℝ] E)) (t : K) : @@ -171,7 +171,7 @@ local instance instContinuousPathComposition23 : NormedAddCommGroup C(K,E →L[ local instance instContinuousPathComposition24 : NormedSpace ℝ C(K,E →L[ℝ] U) := inferInstance /-- Actual adjoint at every parameter in the compact path domain. -/ -def adjointMap : C(K,U →L[ℝ] E) →L[ℝ] C(K,E →L[ℝ] U) := +@[expose] def adjointMap : C(K,U →L[ℝ] E) →L[ℝ] C(K,E →L[ℝ] U) := (realAdjoint (U := U) (E := E)).compLeftContinuous ℝ K omit [CompactSpace K] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeIntegral.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeIntegral.lean index dc1493bfd3..4c8b60ddb6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeIntegral.lean @@ -20,7 +20,7 @@ primitive has the prescribed derivative, including the one-sided endpoint statements, and the uniform bound is exactly the interval length. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ variable {K E F : Type*} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Pointwise multiplication by an operator-valued continuous path. -/ -def multiplierLinear (A : C(K, E →L[ℝ] F)) : C(K,E) →ₗ[ℝ] C(K,F) where +@[expose] def multiplierLinear (A : C(K, E →L[ℝ] F)) : C(K,E) →ₗ[ℝ] C(K,F) where toFun f := ⟨fun t => A t (f t), A.continuous.clm_apply f.continuous⟩ map_add' f g := by ext t; exact map_add (A t) (f t) (g t) map_smul' r f := by ext t; exact map_smul (A t) r (f t) @@ -50,11 +50,11 @@ theorem multiplierLinear_bound (A : C(K, E →L[ℝ] F)) (f : C(K, E)) : (mul_le_mul (A.norm_coe_le_norm t) (f.norm_coe_le_norm t) (norm_nonneg _) (norm_nonneg A)) /-- The genuine bounded multiplier on continuous time paths. -/ -def multiplier (A : C(K, E →L[ℝ] F)) : C(K,E) →L[ℝ] C(K,F) := +@[expose] def multiplier (A : C(K, E →L[ℝ] F)) : C(K,E) →L[ℝ] C(K,F) := (multiplierLinear A).mkContinuous ‖A‖ (multiplierLinear_bound A) @[simp] theorem multiplier_apply (A : C(K, E →L[ℝ] F)) (f : C(K, E)) (t : K) : - multiplier A f t = A t (f t) := rfl + multiplier A f t = A t (f t) := by rfl /-- No derivative-dependent loss enters continuous path multiplication. -/ theorem multiplier_norm (A : C(K, E →L[ℝ] F)) : ‖multiplier A‖ ≤ ‖A‖ := @@ -65,7 +65,7 @@ section Primitive variable [CompleteSpace E] (T : ℝ) (hT : 0 ≤ T) /-- The literal zero-initial-time integral. -/ -def realIntegral (f : C(Icc (0 : ℝ) T, E)) : ℝ → E := +@[expose] def realIntegral (f : C(Icc (0 : ℝ) T, E)) : ℝ → E := fun t => ∫ s in (0 : ℝ)..t, extendPath T hT f s /-- The integral has the actual classical derivative. -/ @@ -104,7 +104,7 @@ def integral : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,E) := (integralLinear T hT).mkContinuous T (integralLinear_bound T hT) @[simp] theorem integral_apply (f : C(Icc (0 : ℝ) T, E)) (t : Icc (0 : ℝ) T) : - integral T hT f t = realIntegral T hT f t := rfl + integral T hT f t = realIntegral T hT f t := by rfl /-- The exact operator bound for the initial primitive. -/ theorem integral_norm : ‖integral (E := E) T hT‖ ≤ T := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeWeight.lean index 6adb38c384..265d22dd43 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ContinuousTimeWeight.lean @@ -16,7 +16,7 @@ The norm of a normalized path is bounded directly by its profile estimate; no quotient of the maximum and minimum profile enters that estimate. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ variable {K E : Type*} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Multiplication by the literal scalar profile. -/ -def weight (g : C(K, ℝ)) : C(K,E) →L[ℝ] C(K,E) := +@[expose] def weight (g : C(K, ℝ)) : C(K,E) →L[ℝ] C(K,E) := multiplier ⟨fun t => g t • ContinuousLinearMap.id ℝ E, g.continuous.smul continuous_const⟩ @@ -38,11 +38,11 @@ def weight (g : C(K, ℝ)) : C(K,E) →L[ℝ] C(K,E) := weight g f t = g t • f t := rfl /-- The reciprocal of a positive continuous profile is an actual continuous path. -/ -def reciprocal (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : C(K,ℝ) := +@[expose] def reciprocal (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : C(K,ℝ) := ⟨fun t => (g t)⁻¹, g.continuous.inv₀ (fun t => (hg t).ne')⟩ /-- Profile division as a genuine bounded linear map. -/ -def normalize (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : C(K,E) →L[ℝ] C(K,E) := +@[expose] def normalize (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : C(K,E) →L[ℝ] C(K,E) := weight (reciprocal g hg) @[simp] theorem normalize_apply (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) (f : C(K, E)) (t : K) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyCompatibility.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyCompatibility.lean index 10676d457e..0cee2b35d2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyCompatibility.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyCompatibility.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.InviscidCorrectionUniqueness /-! Compatibility of independently supplied actual finite-order corrections, proved from their equations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyData.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyData.lean index 0c63e23cd5..12d7c71ef5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyData.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.GevreyStabilityBudget /-! Actual finite correction families and input comparison bounds, independent of any Gevrey radius-loss budget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyParity.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyParity.lean index 5322e49437..3fef1f376c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyParity.lean @@ -25,7 +25,7 @@ section /-! Reflection invariance of the concrete lifted-gradient space and pressure solve. -/ -@[expose] public section +public section noncomputable section @@ -153,7 +153,7 @@ section /-! Joint reflection on the actual complete cylinder Sobolev spaces. -/ -@[expose] public section +public section noncomputable section @@ -296,7 +296,7 @@ section /-! Reflection covariance of the literal Sobolev product, transport and pressure operators. -/ -@[expose] public section +public section noncomputable section @@ -512,7 +512,7 @@ end end -@[expose] public section +public section noncomputable section @@ -685,7 +685,7 @@ section /-! Odd parity of actual inviscid correction solutions, proved by genuine PDE uniqueness. -/ -@[expose] public section +public section noncomputable section @@ -780,7 +780,7 @@ section /-! Genuine continuous Sobolev realizations of the assembled correction and its actual pressure at every order. -/ -@[expose] public section +public section noncomputable section @@ -838,7 +838,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressure.lean index 7dd6864722..112f1cf0a4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressure.lean @@ -20,7 +20,7 @@ section /-! A common actual smooth lifted correction assembled from finite solves and proved uniqueness. -/ -@[expose] public section +public section noncomputable section @@ -91,7 +91,7 @@ theorem FiniteFamily.realizes_common (F : FiniteFamily period hT A) (C : Compari /-- Bounded H3 evaluation fixes a canonical actual pointwise representative of the common correction. -/ -def FiniteFamily.pointField (F : FiniteFamily period hT A) +@[expose] def FiniteFamily.pointField (F : FiniteFamily period hT A) (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Vector3 := pointEvaluation period x (restrictOperator period (by omega : 3 ≤ 7) (F.solution 6 le_rfl t)) @@ -138,7 +138,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressureParity.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressureParity.lean index ba5e464214..ac192b3e79 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressureParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyPressureParity.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionAssemblyReconstructi /-! Pointwise parity and canonical normalization of the assembled actual pressure. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyReconstruction.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyReconstruction.lean index 2837f0b8e6..dc24cf7ef5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyReconstruction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblyReconstruction.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevJointEvaluation /-! Canonical smooth pressure reconstruction for the generic finite-solution assembly. -/ -@[expose] public section +public section noncomputable section @@ -67,7 +67,7 @@ theorem FiniteFamily.pointPressure_smooth (F : FiniteFamily period hT A) (C : Co exact hg x /-- The genuine signed pressure-gradient vector field on the oscillatory physical graph. -/ -def FiniteFamily.graphPressure (F : FiniteFamily period hT A) (k : ℝ) +@[expose] def FiniteFamily.graphPressure (F : FiniteFamily period hT A) (k : ℝ) (t : Icc (0 : ℝ) T) (x : Vector3) : Vector3 := A.κ • F.pointPressure period t (cylinderGraph period k A.direction x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblySourceTower.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblySourceTower.lean index 9c29b0e82c..0fa788554f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblySourceTower.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionAssemblySourceTower.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.InviscidSobolevEvolution /-! Continuous all-order realizations of the actual nonlinear source and time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionBudgetRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionBudgetRestriction.lean index 9677784f6f..57f9b692ce 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionBudgetRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionBudgetRestriction.lean @@ -14,7 +14,7 @@ section /-! Actual correction coefficient data restricted along continuous time maps. -/ -@[expose] public section +public section noncomputable section @@ -74,7 +74,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifference.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifference.lean index f1ccb0786f..d8c4a7e21e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifference.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifference.lean @@ -15,7 +15,7 @@ section /-! Actual L² bounds for the lower-order difference terms in nonlinear transport. -/ -@[expose] public section +public section noncomputable section @@ -133,7 +133,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferenceMetric.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferenceMetric.lean index 69b020b06b..1226675f66 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferenceMetric.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferenceMetric.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real /-! The actual nonlinear viscosity-difference PDE implies a fixed squared metric energy inequality. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferencePDE.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferencePDE.lean index 0ded36ca83..ed532d0188 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferencePDE.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionDifferencePDE.lean @@ -18,7 +18,7 @@ section /-! Every actual continued mild correction obeys the literal viscous PDE with its genuine coercive pressure. -/ -@[expose] public section +public section noncomputable section @@ -62,7 +62,7 @@ end end -@[expose] public section +public section noncomputable section @@ -86,7 +86,7 @@ local instance differenceSobolevSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace /-- The literal right side of the viscosity-difference equation, including its genuine pressure difference. -/ -def differenceRhs {q : ℕ} {T : Type*} [TopologicalSpace T] +@[expose] def differenceRhs {q : ℕ} {T : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (hq : 6 ≤ q) (ν μ : ℝ) (t : T) (u v : SobolevSpace period (q + 1)) : LiftL2 period := ν • laplacianEvaluation period (q+1) (by omega) (u-v) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyBootstrap.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyBootstrap.lean index cb1bbb76c7..1033645fd9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyBootstrap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyBootstrap.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! The actual nonlinear viscous correction closes its shrinking-radius Gevrey bootstrap from the constructed mild equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyData.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyData.lean index 8f249b58c1..69a367b9e3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyData.lean @@ -19,7 +19,7 @@ section /-! Fixed continuous majorants for metric growth; no time continuity of arbitrary bound witnesses is required. -/ -@[expose] public section +public section noncomputable section @@ -29,10 +29,10 @@ open EulerLiftedGradientSpace EulerSpatialSobolevInverse EulerCylinderSobolevSpa EulerCylinderViscousEnergy EulerWeightedCylinderEnergy EulerGevreyMetricEstimate /-- A fixed bound for the metric derivative and viscosity contribution. -/ -def growthBudgetBase (c D L : ℝ) : ℝ := (D+4*L^2/c^2)/(2*c^2) +@[expose] def growthBudgetBase (c D L : ℝ) : ℝ := (D+4*L^2/c^2)/(2*c^2) /-- A fixed bound for the velocity-dependent metric transport slope. -/ -def growthBudgetSlope (c L : ℝ) : ℝ := 2*L/(2*c^2) +@[expose] def growthBudgetSlope (c L : ℝ) : ℝ := 2*L/(2*c^2) variable (period : ℝ) [Fact (0 < period)] @@ -92,7 +92,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyMajorants.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyMajorants.lean index a9b557eb1d..4d8873d795 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyMajorants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyMajorants.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.GevreyRestriction /-! Continuous scalar majorants derived from actual coefficient budgets and actual nonlinear time fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyRestriction.lean index f44e0b6b58..1a7a23d532 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyRestriction.lean @@ -31,7 +31,7 @@ section /-! The constructed higher nonlinear source and pressure restrict exactly to the actual lower mild equation. -/ -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ section /-! Actual finite-Sobolev viscous PDE energy with continuous scalar majorants, requiring no measurability of coefficient-bound witnesses. -/ -@[expose] public section +public section noncomputable section @@ -266,7 +266,7 @@ section /-! Actual PDE energy passage with continuous scalar majorants on every time subinterval. -/ -@[expose] public section +public section noncomputable section @@ -376,7 +376,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyScalar.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyScalar.lean index e70a706dfb..9189ff0209 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyScalar.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyScalar.lean @@ -22,7 +22,7 @@ section /-! The actual correction energy right-hand side has the scalar shrinking-radius form, including its exact zero initial trace. -/ -@[expose] public section +public section noncomputable section @@ -117,7 +117,7 @@ section /-! Shrinking-radius Gevrey bootstrap from actual integral energy inequalities, including zero norms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyTime.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyTime.lean index d958c21d5d..90878318b4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionEnergyTime.lean @@ -27,7 +27,7 @@ section /-! Actual coercive projected sources have precisely the signed energy forcing required by the differentiated equation. -/ -@[expose] public section +public section noncomputable section @@ -114,7 +114,7 @@ end end -@[expose] public section +public section noncomputable section @@ -187,7 +187,7 @@ section /-! Actual representatives of linear source, transport, and pressure combinations in Bochner time spaces. -/ -@[expose] public section +public section noncomputable section @@ -228,7 +228,7 @@ end end -@[expose] public section +public section noncomputable section @@ -311,7 +311,7 @@ section /-! The constructed Bochner correction source is literally the higher-order nonlinear correction almost everywhere. -/ -@[expose] public section +public section noncomputable section @@ -369,7 +369,7 @@ end end -@[expose] public section +public section noncomputable section @@ -404,6 +404,7 @@ def velocityPath {q : ℕ} {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 (truncateOperator period (q+1)).compLeftContinuous ℝ (Icc (0 : ℝ) T) D.approximation + e /-- The actual continuous order-zero source along the original energy-level solution. -/ +@[expose] def lowerOrderPath {q : ℕ} (hq : 6 ≤ q + 1) {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) : C(Icc (0 : ℝ) T, SobolevSpace period @@ -459,7 +460,7 @@ def weightedCorrectionForcing {q : ℕ} (hq : 6 ≤ q + 1) (T : ℝ) (hT : 0 ≤ /-- The seven literal spatial correction terms evaluated on an actual higher Sobolev representative. -/ -def correctionArray {q : ℕ} (hq : 6 ≤ q + 1) {T : ℝ} +@[expose] def correctionArray {q : ℕ} (hq : 6 ≤ q + 1) {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (K6 : ∀ t, CoefficientJet period standardDirection 6 (D.metric.coefficient t)) (N : ℕ) (hN : N + 6 ≤ q + 1) (e : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionFamilyCompactness.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionFamilyCompactness.lean index 0bf84334c5..ad7ef91264 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionFamilyCompactness.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionFamilyCompactness.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ViscosityCauchy /-! Strong lower-Sobolev compactness of an actual uniformly bounded correction family. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionLimitPathDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionLimitPathDerivative.lean index 888dce6666..b76f617230 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionLimitPathDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionLimitPathDerivative.lean @@ -18,7 +18,7 @@ section /-! The actual viscous derivative expressed using the identical lower-order nonlinear source. -/ -@[expose] public section +public section noncomputable section @@ -80,7 +80,7 @@ section /-! A pointwise viscous derivative expressed as a continuous path. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionLowerData.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionLowerData.lean index a2255b1e5a..8a46126c12 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionLowerData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionLowerData.lean @@ -16,7 +16,7 @@ section /-! Exact almost-everywhere restriction of the actual nonlinear source and pressure time fields. -/ -@[expose] public section +public section noncomputable section @@ -138,7 +138,7 @@ end end -@[expose] public section +public section noncomputable section @@ -159,7 +159,7 @@ local instance lowerDataGroup (q : ℕ) : NormedAddCommGroup (SobolevSpace perio local instance lowerDataSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The same genuine correction coefficients and background restricted by one Sobolev order. -/ -def lowerData {q : ℕ} {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) +@[expose] def lowerData {q : ℕ} {T : ℝ} (D : CorrectionData period (q + 1) (Icc (0 : ℝ) T)) (KG : ∀ t, CoefficientJet period standardDirection q (D.metric.coefficient t)) (KL : ∀ t, CoefficientJet period standardDirection q (D.linear.coefficient t)) (KQ : ∀ i t, CoefficientJet period standardDirection q ((D.quadratic i).coefficient t)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionMildEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionMildEnergy.lean index 49d7562a99..c847c56bad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionMildEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionMildEnergy.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevMaximalRegularity /-! Actual nonlinear correction mild solutions obey the full-order continuous scalar integral energy estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionOperators.lean index 7c87addc67..a329a62b7a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionOperators.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.VectorCylinder /-! The literal transport and order-zero quadratic operators in the Euler correction equation. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ theorem algebraicBilinear_apply {q : ℕ} (hq : 6 ≤ q) simp only [algebraicBilinear, sum_apply, postcompose_apply] /-- The full bilinear nonlinearity of the transformed Euler equation. -/ -def eulerBilinear {q : ℕ} (hq : 6 ≤ q) +@[expose] def eulerBilinear {q : ℕ} (hq : 6 ≤ q) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) (C : Fin 3 → SobolevSpace period q →L[ℝ] SobolevSpace period q) : SobolevSpace period (q+1) →L[ℝ] SobolevSpace period (q+1) →L[ℝ] SobolevSpace period q := diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionResidualCancellation.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionResidualCancellation.lean index 5215ab0396..33ba9eecaa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionResidualCancellation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionResidualCancellation.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add /-! Adding the actual correction removes a genuine approximate-solution residual. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionSourceRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionSourceRestriction.lean index 61f30dd2cc..572942a3d9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionSourceRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionSourceRestriction.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevNonlinearCompatibility /-! The actual nonlinear correction source is identical across compatible Sobolev levels. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityBudget.lean index 137e9c462f..f0ebf74e95 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityBudget.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionStabilityConstants /-! Concrete coefficient and inverse-metric data for actual vanishing-viscosity stability. -/ -@[expose] public section +public section noncomputable section @@ -76,13 +76,13 @@ def StabilityBudget.operatorPath {q : ℕ} {T : ℝ} {hT : 0 ≤ T} /-- The fixed squared-energy growth coefficient obtained from the actual background path and a solution norm bound. -/ -def StabilityBudget.growth {q : ℕ} {T : ℝ} {hT : 0 ≤ T} +@[expose] def StabilityBudget.growth {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) (R : ℝ) : ℝ := growthConstant B.c B.bound B.first B.time (velocityBound period q ‖D.approximation‖ R) (lowerConstant period q B.linear B.quadratic ‖D.approximation‖ R) /-- The explicit finite-interval Lipschitz coefficient for viscosity in continuous L². -/ -def StabilityBudget.comparisonConstant {q : ℕ} {T : ℝ} {hT : 0 ≤ T} +@[expose] def StabilityBudget.comparisonConstant {q : ℕ} {T : ℝ} {hT : 0 ≤ T} {D : CorrectionData period q (Icc (0 : ℝ) T)} (B : StabilityBudget period hT D) (R : ℝ) : ℝ := Real.sqrt (defectConstant B.bound R*T*Real.exp (B.growth period R*T))/B.c diff --git a/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityConstants.lean index b0acdd49a6..a88d9192cc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityConstants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CorrectionStabilityConstants.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionDifference /-! Fixed, actual coefficient budgets for L² viscosity stability. -/ -@[expose] public section +public section noncomputable section @@ -26,11 +26,11 @@ def lowerConstant (period : ℝ) [Fact (0 < period)] (q : ℕ) (A0 A2 Z R : ℝ) A0+(4+2*A2)*sobolevEmbeddingConstant period q*(Z+R) /-- A fixed pointwise bound for the actual background-plus-error advecting velocity. -/ -def velocityBound (period : ℝ) [Fact (0 < period)] (q : ℕ) (Z R : ℝ) : ℝ := +@[expose] def velocityBound (period : ℝ) [Fact (0 < period)] (q : ℕ) (Z R : ℝ) : ℝ := sobolevEmbeddingConstant period q*(Z+R) /-- The squared-metric growth coefficient after the genuine transport and heat cancellations. -/ -def growthConstant (c Kb Kx Kt V L : ℝ) : ℝ := +@[expose] def growthConstant (c Kb Kx Kt V L : ℝ) : ℝ := (Kt+2*Kx*V+4*Kx^2/c^2+2*Kb*L+1)/c^2 /-- The fixed coefficient of the squared viscosity difference. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/CurlTimeDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/CurlTimeDerivative.lean index 242c7d09be..0c5fbfd6ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CurlTimeDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CurlTimeDerivative.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Symmetric /-! Local mixed-derivative commutation for the ordinary spatial curl. -/ -@[expose] public section +public section noncomputable section @@ -94,7 +94,7 @@ theorem time_deriv_differentiableAt {u : ℝ × Space → Space} {t : ℝ} {x : exact (hf.clm_apply contDiffAt_const).differentiableAt (by norm_num) /-- The continuous linear coordinate antisymmetrization defining curl. -/ -def curlMatrixCLM : (Space →L[ℝ] Space) →L[ℝ] Space := +@[expose] def curlMatrixCLM : (Space →L[ℝ] Space) →L[ℝ] Space := (show (Space →L[ℝ] Space) →ₗ[ℝ] Space from { toFun := curlMatrix map_add' := curlMatrix_add diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderActionWords.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderActionWords.lean index d04b300cb0..d23c7fc7bc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderActionWords.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderActionWords.lean @@ -29,7 +29,7 @@ independent of the translation parameter, with constant one and no radius change. This applies equally to spatial L² and its time-function spaces. -/ -@[expose] public section +public section noncomputable section @@ -152,7 +152,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverage.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverage.lean index ccc4adbb70..c0343c9c0c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverage.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverage.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.LpCylinderRectangular /-! Actual angular averaging on the cylinder, including its supported spaces. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ section Average variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] [CompleteSpace V] /-- Angle curve, given by `translate P (0,s) u`. -/ -def angleCurve (u : CylinderL2 P V) (s : ℝ) : CylinderL2 P V := +@[expose] def angleCurve (u : CylinderL2 P V) (s : ℝ) : CylinderL2 P V := translate P (0,s) u omit [CompleteSpace V] in @@ -92,7 +92,13 @@ def average : CylinderL2 P V →L[ℝ] CylinderL2 P V := omit [CompleteSpace V] in @[simp] theorem average_apply (u : CylinderL2 P V) : - average P u = averageIntegral P u := rfl + average P u = averageIntegral P u := by rfl + +omit [CompleteSpace V] in +theorem average_eq_integral (u : CylinderL2 P V) : + average P u = P⁻¹ • (∫ s in (0 : ℝ)..P, angleCurve P u s) := by + rw [average_apply] + rfl omit [CompleteSpace V] in theorem average_norm : ‖average (V := V) P‖ ≤ 1 := @@ -122,7 +128,7 @@ def pathAverage : C(K,CylinderL2 P V) →L[ℝ] C(K,CylinderL2 P V) := omit [CompactSpace K] [CompleteSpace V] in @[simp] theorem pathAverage_apply (u : C(K, CylinderL2 P V)) (t : K) : - pathAverage P u t = average P (u t) := rfl + pathAverage P u t = average P (u t) := by rfl omit [CompleteSpace V] in theorem pathAverage_norm : ‖pathAverage (K := K) (V := V) P‖ ≤ 1 := by @@ -181,7 +187,8 @@ theorem pathAverage_fullMultiplier (A : C(K, Space →ᵇ E →L[ℝ] F)) pathAverage P (fullMultiplierMap P A u) = fullMultiplierMap P A (pathAverage P u) := by apply ContinuousMap.ext intro t - exact average_fullOperator P (A t) (u t) + simpa only [pathAverage_apply, fullMultiplierMap_apply] using + average_fullOperator P (A t) (u t) end Coefficients @@ -217,7 +224,7 @@ def supportedAverage : Supported P V S hS →L[ℝ] Supported P V S hS := (Supported P V S hS) (average_mem P S hS) @[simp] theorem supportedAverage_coe (u : Supported P V S hS) : - (supportedAverage P S hS u : CylinderL2 P V) = average P (u : CylinderL2 P V) := rfl + (supportedAverage P S hS u : CylinderL2 P V) = average P (u : CylinderL2 P V) := by rfl theorem supportedAverage_norm : ‖supportedAverage (V := V) P S hS‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageRepresentative.lean index 5082fd9249..6f3742f995 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageRepresentative.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderAngleRepresentative /-! The actual L² angular average equals the literal mean of every continuous H³ representative. -/ -@[expose] public section +public section noncomputable section @@ -36,6 +36,10 @@ theorem average_full_translation (a : LiftDomain P) (u : LiftL2 P) : def sobolevAverage (q : ℕ) : SobolevSpace P q →L[ℝ] SobolevSpace P q := liftOperator P q (average P) (average_full_translation P) +@[simp] theorem value_sobolevAverage {q : ℕ} (u : SobolevSpace P q) : + value P (sobolevAverage P q u) = average P (value P u) := + liftOperator_apply P (average P) (average_full_translation P) u (emptyWord q) + theorem sobolevAverage_norm (q : ℕ) : ‖sobolevAverage P q‖ ≤ 1 := (norm_liftOperator_le P q (average P) (average_full_translation P)).trans (average_norm P) @@ -48,6 +52,7 @@ theorem sobolevAverage_eq_integral {q : ℕ} (u : SobolevSpace P q) : sobolevAverage P q u = P⁻¹ • (∫ s in (0 : ℝ)..P, sobolevTranslation P q (EulerCylinderAnglePrimitive.angleShift P s) u) := by apply value_injective P + rw [value_sobolevAverage] change average P (value P u) = (valueOperator P q) (P⁻¹ • (∫ s in (0 : ℝ)..P, sobolevTranslation P q (EulerCylinderAnglePrimitive.angleShift P s) u)) @@ -92,6 +97,7 @@ theorem average_eq_zero_iff (u : SobolevSpace P 3) · intro h y have hz : sobolevAverage P 3 u = 0 := by apply value_injective P + rw [value_sobolevAverage] change average P (value P u) = (valueOperator P 3) 0 simpa only [map_zero] using h have he := pointEvaluation_average_mean P u f hf hrep y 0 @@ -105,11 +111,12 @@ theorem average_eq_zero_iff (u : SobolevSpace P 3) · rfl · exact hθ.symm rw [hx] - change pointEvaluation P (x.1,(θ : AddCircle P)) (sobolevAverage P 3 u) = 0 + rw [← pointEvaluation_apply] rw [pointEvaluation_average_mean P u f hf hrep, h, smul_zero] apply Lp.ext filter_upwards [representative_ae P (sobolevAverage P 3 u), Lp.coeFn_zero Vector3 2 (liftMeasure P)] with x hx hzero + rw [value_sobolevAverage] at hx exact hx.trans ((he x).trans hzero.symm) end EulerCylinderAngleAverage diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageTime.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageTime.lean index 81df6d513b..9c42a82c8b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleAverageTime.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderAngleAverageRepresentative /-! Actual angular means of the reconstructed continuous-time cylinder fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderAnglePrimitive.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderAnglePrimitive.lean index 6f31571c04..9cbf0231bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderAnglePrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderAnglePrimitive.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.CylinderMollifier /-! A genuine bounded angular primitive on the full cylinder L² space. -/ -@[expose] public section +public section noncomputable section @@ -24,14 +24,14 @@ open Set MeasureTheory EulerLiftedGradientSpace EulerCylinderSobolevSpace variable (P : ℝ) [Fact (0 < P)] /-- Angle shift, given by `(0,(s : AddCircle P))`. -/ -def angleShift (s : ℝ) : LiftDomain P := (0,(s : AddCircle P)) +@[expose] def angleShift (s : ℝ) : LiftDomain P := (0,(s : AddCircle P)) omit [Fact (0 < P)] in theorem angleShift_continuous : Continuous (angleShift P) := continuous_const.prodMk (AddCircle.continuous_mk' P) /-- Kernel curve, given by `s • translation P (angleShift P s) u`. -/ -def kernelCurve (u : LiftL2 P) (s : ℝ) : LiftL2 P := +@[expose] def kernelCurve (u : LiftL2 P) (s : ℝ) : LiftL2 P := s • translation P (angleShift P s) u theorem kernelCurve_continuous (u : LiftL2 P) : Continuous (kernelCurve P u) := @@ -89,7 +89,7 @@ def primitiveLinear : LiftL2 P →ₗ[ℝ] LiftL2 P where def primitive : LiftL2 P →L[ℝ] LiftL2 P := (primitiveLinear P).mkContinuous P (kernelIntegral_norm P) -@[simp] theorem primitive_apply (u : LiftL2 P) : primitive P u = kernelIntegral P u := rfl +@[simp] theorem primitive_apply (u : LiftL2 P) : primitive P u = kernelIntegral P u := by rfl theorem primitive_norm : ‖primitive P‖ ≤ P := ContinuousLinearMap.opNorm_le_bound _ (le_of_lt (Fact.out : 0 < P)) (kernelIntegral_norm P) @@ -114,6 +114,13 @@ theorem primitive_translation (a : LiftDomain P) (u : LiftL2 P) : def sobolevPrimitive (q : ℕ) : SobolevSpace P q →L[ℝ] SobolevSpace P q := liftOperator P q (primitive P) (primitive_translation P) +@[simp] theorem value_sobolevPrimitive {q : ℕ} (u : SobolevSpace P q) : + value P (sobolevPrimitive P q u) = primitive P (value P u) := by + exact liftOperator_apply P (primitive P) (primitive_translation P) u (emptyWord q) + +theorem primitive_eq_integral (u : LiftL2 P) : + primitive P u = P⁻¹ • (∫ s in (0 : ℝ)..P, kernelCurve P u s) := by rfl + theorem sobolevPrimitive_norm (q : ℕ) : ‖sobolevPrimitive P q‖ ≤ P := (norm_liftOperator_le P q (primitive P) (primitive_translation P)).trans (primitive_norm P) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleRepresentative.lean index 1a108eeccf..93462a5f34 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderAngleRepresentative.lean @@ -18,7 +18,7 @@ section /-! A translation-kernel formula for the literal normalized periodic primitive. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ end end -@[expose] public section +public section noncomputable section @@ -84,12 +84,12 @@ theorem sobolevPrimitive_eq_integral {q : ℕ} (u : SobolevSpace P q) : sobolevPrimitive P q u = P⁻¹ • (∫ s in (0 : ℝ)..P, s • sobolevTranslation P q (angleShift P s) u) := by apply value_injective P + rw [value_sobolevPrimitive] change primitive P (value P u) = (valueOperator P q) (P⁻¹ • (∫ s in (0 : ℝ)..P, s • sobolevTranslation P q (angleShift P s) u)) rw [map_smul, ← (valueOperator P q).intervalIntegral_comp_comm ((sobolevKernel_continuous P u).intervalIntegrable 0 P)] - change P⁻¹ • (∫ s in (0 : ℝ)..P, kernelCurve P (value P u) s) = _ - congr 1 + rw [primitive_eq_integral] theorem pointEvaluation_translation (u : SobolevSpace P 3) (a x : LiftDomain P) : pointEvaluation P x (sobolevTranslation P 3 a u) = representative P u (x+a) := by @@ -99,7 +99,7 @@ theorem pointEvaluation_translation (u : SobolevSpace P 3) (a x : LiftDomain P) filter_upwards [translation_ae P a (value P u), (measurePreserving_translation P a).quasiMeasurePreserving.ae (representative_ae P u)] with y hy hr - change translation P a (value P u) y = _ + rw [value_sobolevTranslation] exact hy.trans hr theorem pointEvaluation_primitive_kernel (u : SobolevSpace P 3) (x : LiftDomain P) : @@ -148,8 +148,9 @@ theorem primitive_ae_classical (u : SobolevSpace P 3) · rfl · exact hθ.symm rw [hx] - exact (pointEvaluation_primitive_classical P u f hf hrep hmean x.1 θ).trans (hq x.1 θ).symm + simpa only [pointEvaluation_apply] using + (pointEvaluation_primitive_classical P u f hf hrep hmean x.1 θ).trans (hq x.1 θ).symm filter_upwards [representative_ae P (sobolevPrimitive P 3 u)] with x hx - exact hx.trans (he x) + simpa only [value_sobolevPrimitive] using hx.trans (he x) end EulerCylinderAnglePrimitive diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderBoundedCover.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderBoundedCover.lean index 44f4013267..1cee458b60 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderBoundedCover.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderBoundedCover.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderTimeRegularity continuous. This construction uses the cylinder norm, never an L² norm on the full real covering space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalSolenoidal.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalSolenoidal.lean index b87581981b..5a1e175120 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalSolenoidal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalSolenoidal.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Comp /-! Classical lifted divergence zero implies membership in the actual closed L² constraint space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalWordBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalWordBounds.lean index 2fc5d4b74c..b4e5a18b8a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalWordBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderClassicalWordBounds.lean @@ -20,7 +20,7 @@ translation words. Consequently the fixed-Hq external-word sum equals the block used by the inverse estimate, with no alphabet factor or radius loss. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ open scoped ContDiff variable (period : ℝ) [Fact (0 < period)] /-- The actual strong L² derivative for an ordered mixed word. -/ -def strongWord (u : LiftL2 period) {n : ℕ} (w : Fin n → Fin 4) : LiftL2 period := +@[expose] def strongWord (u : LiftL2 period) {n : ℕ} (w : Fin n → Fin 4) : LiftL2 period := wordDerivative standardDirection (fun a : LiftTangent => translate period a u) w 0 @[simp] theorem strongWord_zero (u : LiftL2 period) (w : Fin 0 → Fin 4) : strongWord period u w = u diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderCompactTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderCompactTranslation.lean index fb16c2daef..d09d25ecc8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderCompactTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderCompactTranslation.lean @@ -21,7 +21,7 @@ The compact support argument controls every small covering translation, including its angular component, before dominated L² differentiation. -/ -@[expose] public section +public section noncomputable section @@ -61,7 +61,7 @@ theorem toLp_ae (A : CompactField P V) : A.toLp =ᵐ[liftMeasure P] A.field := (A.continuous.memLp_of_hasCompactSupport A.compact).coeFn_toLp /-- Derivative, bundling `field`, `compact`, `smooth`. -/ -def derivative (A : CompactField P V) : CompactField P (LiftTangent →L[ℝ] V) where +@[expose] def derivative (A : CompactField P V) : CompactField P (LiftTangent →L[ℝ] V) where field := fieldFDeriv P A.field compact := fieldFDeriv_compact P A.field A.compact smooth := fieldFDeriv_smooth P A.field A.smooth @@ -165,8 +165,9 @@ theorem translation_hasFDerivAt (A : CompactField P V) (a : LiftTangent) : theorem translation_fderiv (A : CompactField P V) : fderiv ℝ (fun a : LiftTangent => translate P a A.toLp) = - fun a => derivativeBundling (liftMeasure P) (translate P a A.derivative.toLp) := - funext (fun a => (A.translation_hasFDerivAt a).fderiv) + fun a => derivativeBundling (liftMeasure P) (translate P a A.derivative.toLp) := by + funext a + simpa only [derivativeBundling_apply] using (A.translation_hasFDerivAt a).fderiv private theorem translation_contDiff_aux (n : ℕ) : ∀ (V : Type u) [NormedAddCommGroup V] [NormedSpace ℝ V] (A : CompactField P V), diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMap.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMap.lean index aea8bd80bc..5846a6e180 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMap.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.LpCylinderTranslation /-! Fixed bounded maps on actual cylinder L² classes and continuous paths. -/ -@[expose] public section +public section noncomputable section @@ -61,12 +61,13 @@ theorem map_translation (L : E →L[ℝ] F) (a : LiftTangent) (u : CylinderL2 pe variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- Path map, given by `(map period L).compLeftContinuous ℝ K`. -/ -def pathMap (L : E →L[ℝ] F) : C(K,CylinderL2 period E) →L[ℝ] C(K,CylinderL2 period F) := +@[expose] def pathMap (L : E →L[ℝ] F) : + C(K,CylinderL2 period E) →L[ℝ] C(K,CylinderL2 period F) := (map period L).compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem pathMap_apply (L : E →L[ℝ] F) (u : C(K, CylinderL2 period E)) (t : K) : - pathMap period L u t = map period L (u t) := rfl + pathMap period L u t = map period L (u t) := by rfl theorem pathMap_norm (L : E →L[ℝ] F) : ‖pathMap (K := K) period L‖ ≤ ‖L‖ := by apply opNorm_le_bound _ (norm_nonneg L) @@ -82,7 +83,7 @@ theorem pathMap_translation (L : E →L[ℝ] F) (a : LiftTangent) (u : C(K, Cyli pathMap period L (pathTranslate period a u) = pathTranslate period a (pathMap period L u) := by apply ContinuousMap.ext intro t - exact map_translation period L a (u t) + simpa only [pathMap_apply, pathTranslate_apply] using map_translation period L a (u t) theorem pathMap_orbit_contDiff (L : E →L[ℝ] F) (u : C(K, CylinderL2 period E)) (hu : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate period a u)) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMapBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMapBounds.lean index 4ef3c0714b..6b1ff689c8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMapBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderConstantMapBounds.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevLinear /-! Fixed bounded maps preserve the same external-word radius for actual cylinder paths. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderCorrectorMeanZero.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderCorrectorMeanZero.lean index a4b15c0ca6..6d992b2898 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderCorrectorMeanZero.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderCorrectorMeanZero.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderAngleAverage /-! The actual potential and slow curl preserve the zero angular mean required by the packet recursion. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverDescent.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverDescent.lean index 2923025728..3586b95b92 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverDescent.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverDescent.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderMeasureDescent /-! Canonical descent of periodic cover fields and deck-equivariant maps to the cylinder, with genuine continuity, inverse and volume properties. -/ -@[expose] public section +public section noncomputable section @@ -24,6 +24,7 @@ open Set Function MeasureTheory EulerLiftedGradientSpace variable (P : ℝ) [Fact (0 < P)] /-- Section point, given by `(q.1,(AddCircle.equivIoc P 0 q.2 : ℝ))`. -/ +@[expose] def sectionPoint (q : LiftDomain P) : LiftTangent := (q.1,(AddCircle.equivIoc P 0 q.2 : ℝ)) @@ -35,6 +36,7 @@ theorem sectionPoint_measurable : Measurable (sectionPoint P) := (AddCircle.measurableEquivIoc P 0).measurable).comp measurable_snd) /-- Descend, given by `f (sectionPoint P q)`. -/ +@[expose] def descend {V : Type*} (f : LiftTangent → V) (q : LiftDomain P) : V := f (sectionPoint P q) theorem descend_cover {V : Type*} (f : LiftTangent → V) @@ -83,6 +85,7 @@ theorem fiber_constant_of_deck {V : Type*} (f : LiftTangent → V) exact hf c b /-- Descend map, given by `descend P (coveringMap P ∘ f)`. -/ +@[expose] def descendMap (f : LiftTangent → LiftTangent) : LiftDomain P → LiftDomain P := descend P (coveringMap P ∘ f) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverTensor.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverTensor.lean index 7bab3a050f..0e66136b15 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverTensor.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderCoverTensor.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Exact coordinate words and tensor norm bounds for the real periodic cover of a smooth cylinder field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderCoveringDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderCoveringDerivative.lean index eeab5ef0e3..18a274fcbb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderCoveringDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderCoveringDerivative.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.SmoothLimit /-! Exact ordinary derivatives of the raw covering field of a smooth cylinder representative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDescentJets.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDescentJets.lean index be20f84853..3842b9d78e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDescentJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDescentJets.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations the cylinder. Their composition is the literal finite Taylor composition used by the cylinder L² estimate. -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,7 @@ theorem iteratedFDeriv_deck (n : ℕ) (c : AddSubgroup.zmultiples P) (z : LiftTa rw [← shift,← iteratedFDeriv_comp_add_right n a z,he] /-- Jet series, defined pointwise by `descend P (iteratedFDeriv ℝ n f) q`. -/ -def jetSeries (q : LiftDomain P) : FormalMultilinearSeries ℝ LiftTangent W := +@[expose] def jetSeries (q : LiftDomain P) : FormalMultilinearSeries ℝ LiftTangent W := fun n => descend P (iteratedFDeriv ℝ n f) q include hperiod in diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletData.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletData.lean index 0566e7f0a5..8eb5666cc6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletData.lean @@ -21,7 +21,7 @@ Pointwise tangency is encoded by the frame range, not by orthogonality to one vector in L². No solution or operator inverse is part of the input data. -/ -@[expose] public section +public section noncomputable section @@ -83,9 +83,10 @@ def hessian : C(Icc (0 : ℝ) T,CylinderL2 P E →L[ℝ] CylinderL2 P E) := full omit [CompleteSpace U] [CompleteSpace E] in theorem frame_lower (t : Icc (0 : ℝ) T) (u : CylinderL2 P U) : - D.lower*‖u‖^2 ≤ ‖D.frame P t u‖^2 := - EulerLpOperatorField.full_norm_sq_lower (liftMeasure P) (fieldLift P (D.Q t)) - D.lower D.lower_pos.le (fun x v => D.lower_bound t x.1 v) u + D.lower*‖u‖^2 ≤ ‖D.frame P t u‖^2 := by + simpa only [frame, fullPathMap_apply, fullOperatorMap_apply] using + (EulerLpOperatorField.full_norm_sq_lower (liftMeasure P) (fieldLift P (D.Q t)) + D.lower D.lower_pos.le (fun x v => D.lower_bound t x.1 v) u) omit [CompleteSpace U] in theorem frame_derivative (t : Icc (0 : ℝ) T) : @@ -101,15 +102,17 @@ theorem frame_second_derivative (t : Icc (0 : ℝ) T) : omit [CompleteSpace U] [CompleteSpace E] in theorem frame_equation (t : Icc (0 : ℝ) T) : - D.frameSecond P t = -((D.hessian P t).comp (D.frame P t)) := - EulerLpOperatorField.full_eq_neg_comp (liftMeasure P) (fieldLift P (D.Q₂ t)) - (fieldLift P (D.H t)) (fieldLift P (D.Q t)) (fun x v => D.jacobi t x.1 v) + D.frameSecond P t = -((D.hessian P t).comp (D.frame P t)) := by + simpa only [frameSecond, hessian, frame, fullPathMap_apply, fullOperatorMap_apply] using + (EulerLpOperatorField.full_eq_neg_comp (liftMeasure P) (fieldLift P (D.Q₂ t)) + (fieldLift P (D.H t)) (fieldLift P (D.Q t)) (fun x v => D.jacobi t x.1 v)) omit [CompleteSpace U] [CompleteSpace E] in theorem hessian_upper (t : Icc (0 : ℝ) T) (u : CylinderL2 P E) : - ⟪D.hessian P t u,u⟫_ℝ ≤ D.potential*‖u‖^2 := - EulerLpOperatorField.full_quadratic_upper (liftMeasure P) (fieldLift P (D.H t)) - D.potential (fun x v => D.potential_bound t x.1 v) u + ⟪D.hessian P t u,u⟫_ℝ ≤ D.potential*‖u‖^2 := by + simpa only [hessian, fullPathMap_apply, fullOperatorMap_apply] using + (EulerLpOperatorField.full_quadratic_upper (liftMeasure P) (fieldLift P (D.H t)) + D.potential (fun x v => D.potential_bound t x.1 v) u) /-- The fixed-space coercive construction, with every L² hypothesis derived from the actual pointwise fields. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletMean.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletMean.lean index cb850048a9..422088d457 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletMean.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletMean.lean @@ -23,7 +23,7 @@ velocity therefore preserve zero mean. No pointwise mean condition is assumed on the solution. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletNaturality.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletNaturality.lean index c5763813f5..d6dd2476f3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletNaturality.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletNaturality.lean @@ -41,7 +41,7 @@ commute with the constructed coercive solve. This covers translations and spatial support projections on actual L², not just pointwise model solutions. -/ -@[expose] public section +public section noncomputable section @@ -158,7 +158,7 @@ end end -@[expose] public section +public section noncomputable section @@ -287,7 +287,7 @@ section /-! Compatible spatial maps commute with the genuine positive Gram inverse. -/ -@[expose] public section +public section noncomputable section @@ -353,7 +353,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletParity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletParity.lean index e419ea4721..fc6b8e605f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletParity.lean @@ -18,7 +18,7 @@ The genuine coercive inverse therefore preserves odd forcing, including its continuous velocity and acceleration representatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletRegularity.lean index 4a8569f433..f9222a62cc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletRegularity.lean @@ -19,7 +19,7 @@ identifies that family with the translation orbit of the constructed field. No regularity assumption is imposed on a solved history field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean index 83656f2bdb..21c962787a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean @@ -27,7 +27,7 @@ section /-! Actual mixed coefficient jets in the uniform-time L² operator norm. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSupport.lean index 927c83c14c..1451e40648 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSupport.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.LpOperatorFieldAlgebra /-! Spatial support is preserved by the actual zero-endpoint history inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTimeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTimeBounds.lean index 363acdb469..e207d5fe0e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTimeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTimeBounds.lean @@ -22,7 +22,7 @@ jets lift to L² operator paths with constant one, and the true fixed-space inverse adds one shift while preserving the external radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTranslation.lean index 1c4dd3e9cb..6f9f618755 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletTranslation.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderTranslationAdjoint /-! The actual history solve commutes with all mixed spatial/angular translations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointBudget.lean index 1a5e866edb..0a342699a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointBudget.lean @@ -15,7 +15,7 @@ forcing is bounded for unit terminal data; no terminal amplitude, derivative shift, or recursive grade occurs in the radius conditions. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ open Set ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients EulerGevrey open scoped ContDiff BoundedContinuousFunction /-- Endpoint forcing cost, given by `6*sobolevCoefficientAmplitude ι q Rc C₁*T⁻¹`. -/ -def endpointForcingCost (ι : Type*) [Fintype ι] (q : ℕ) (T Rc C₁ : ℝ) : ℝ := +@[expose] def endpointForcingCost (ι : Type*) [Fintype ι] (q : ℕ) (T Rc C₁ : ℝ) : ℝ := 6*sobolevCoefficientAmplitude ι q Rc C₁*T⁻¹ variable {T : ℝ} {U E : Type*} @@ -84,12 +84,12 @@ theorem radius_bounds : 1 ≤ L.R ∧ sobolevCoefficientRadius ι L.Rc ≤ L.R : L.C₀_nonneg L.C₁_nonneg L.CH_nonneg L.forcingCost_nonneg L.weak_radius /-- Coordinate cost, given by `T⁻¹+traceCost T`. -/ -def coordinateCost (_L : EndpointBudget D ι q) : ℝ := T⁻¹+traceCost T +@[expose] def coordinateCost (_L : EndpointBudget D ι q) : ℝ := T⁻¹+traceCost T /-- Velocity cost, given by `3*sobolevCoefficientAmplitude ι q L.Rc L.C₀*L.coordinateCost`. -/ def velocityCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀*L.coordinateCost /-- Derivative cost, given by `3*sobolevCoefficientAmplitude ι q L.Rc L.C₁*L.coordinateCost + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀`. -/ -def derivativeCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₁*L.coordinateCost + +@[expose] def derivativeCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₁*L.coordinateCost + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀ theorem coordinateCost_nonneg : 0 ≤ L.coordinateCost := diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointData.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointData.lean index bbddc6147e..b0ddd171ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointData.lean @@ -20,7 +20,7 @@ the same coercive form as the forced history inverse. In particular, no spatially constant nonzero vector is silently treated as L² data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointEquation.lean index f0cf04bd11..770b9e199d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointEquation.lean @@ -16,7 +16,7 @@ terminal cylinder history. Pointwise tangency and the normal residual are deduced from the actual frame range; there is no single L² normal vector. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointForcing.lean index f45a29adb5..a05e656dbd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointForcing.lean @@ -27,7 +27,7 @@ potential term. Its variational correction is exactly the already constructed zero-endpoint inverse applied to `2 Q₁(t) (Y/T)`. -/ -@[expose] public section +public section noncomputable section @@ -181,7 +181,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointLabels.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointLabels.lean index 49f2c9bd68..791ec35070 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointLabels.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointLabels.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransverseEndpointCoordinates /-! Evaluation of the actual cylinder coefficients at a spatial label. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointParity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointParity.lean index 8e62c45962..75b91ad241 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointParity.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderDirichletParity /-! Actual odd terminal data give odd endpoint histories under even coefficients. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointPointwise.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointPointwise.lean index 73fb3ed2d8..233b084466 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointPointwise.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointPointwise.lean @@ -31,7 +31,7 @@ evaluation. This will apply to the two-dimensional reference plane, without identifying an L² normal with a pointwise normal vector. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ section /-! Initial time integration commutes with the genuine mixed cylinder action. -/ -@[expose] public section +public section noncomputable section @@ -172,7 +172,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointRegularity.lean index 749abbd429..43ac42b547 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointRegularity.lean @@ -16,7 +16,7 @@ inverse. The terminal datum's actual translation orbit is the only field regularity assumption; output regularity follows from the forced inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointSupport.lean index 045b702499..febdff47bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointSupport.lean @@ -17,7 +17,7 @@ cylinder inverse. Both properties are inherited from its genuine L² terminal datum through the explicit forced reduction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointUnitBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointUnitBounds.lean index 6c833bd00b..ab019d4f1c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointUnitBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderEndpointUnitBounds.lean @@ -23,7 +23,7 @@ radius is unchanged; the coordinate/velocity use two shifts and the true time derivative uses three. Every inverse guard is source-only. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderFieldReflection.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderFieldReflection.lean index af75b17dab..142a12d194 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderFieldReflection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderFieldReflection.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ClassicalPressureCurl /-! Joint reflection for arbitrary Hilbert-valued cylinder fields and their actual supported spaces. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ def pathReflection : C(K,CylinderL2 P V) →L[ℝ] C(K,CylinderL2 P V) := omit [CompactSpace K] in @[simp] theorem pathReflection_apply (u : C(K, CylinderL2 P V)) (t : K) : - pathReflection P u t = reflection P (u t) := rfl + pathReflection P u t = reflection P (u t) := by rfl end Basic @@ -96,9 +96,10 @@ theorem reflection_fullOperator (A : Space →ᵇ E →L[ℝ] F) (EulerLpOperatorField.full_ae (liftMeasure P) (fieldLift P A) u), EulerLpOperatorField.full_ae (liftMeasure P) (fieldLift P A) (reflection P u), reflection_ae P u] with x hr hn hf hu - change fullOperatorMap P A u (-x) = A (-x.1) (u (-x)) at hn - change fullOperatorMap P A (reflection P u) x = A x.1 (reflection P u x) at hf - rw [hr,hn,hf,hu,hA] + simp only [fullOperatorMap_apply, fieldLift_apply] at hr hn hf ⊢ + rw [hr,hn,hf,hu] + change A (-x.1) _ = A x.1 _ + rw [hA] end Coefficients @@ -127,7 +128,8 @@ def supportedReflection : Supported P V S hS →L[ℝ] Supported P V S hS := (Supported P V S hS) (reflection_mem P S hS hSym) @[simp] theorem supportedReflection_coe (u : Supported P V S hS) : - (supportedReflection P S hS hSym u : CylinderL2 P V) = reflection P (u : CylinderL2 P V) := rfl + (supportedReflection P S hS hSym u : CylinderL2 P V) = reflection P (u : CylinderL2 P V) := by + rfl variable {K : Type*} [TopologicalSpace K] [CompactSpace K] @@ -138,7 +140,7 @@ def supportedPathReflection : C(K,Supported P V S hS) →L[ℝ] C(K,Supported P omit [CompactSpace K] in @[simp] theorem supportedPathReflection_apply (u : C(K, Supported P V S hS)) (t : K) : - supportedPathReflection P S hS hSym u t = supportedReflection P S hS hSym (u t) := rfl + supportedPathReflection P S hS hSym u t = supportedReflection P S hS hSym (u t) := by rfl end Supported @@ -153,7 +155,8 @@ theorem supportedReflection_operator (A : Space →ᵇ E →L[ℝ] F) supportedReflection P S hS hSym (supportedOperatorMap P S hS A u) = supportedOperatorMap P S hS A (supportedReflection P S hS hSym u) := by apply Subtype.ext - exact reflection_fullOperator P A hA (u : CylinderL2 P E) + simpa only [supportedReflection_coe, supportedOperatorMap_coe] using + reflection_fullOperator P A hA (u : CylinderL2 P E) end SupportedCoefficients end EulerCylinderFieldReflection diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderGraphGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderGraphGevrey.lean index 01e00a0dd2..3b0074e150 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderGraphGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderGraphGevrey.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder The L² trace uses one extra angular derivative but no extra factor of the graph frequency. Only the n physical derivatives cost its n-th power. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ open scoped ContDiff variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] [CompleteSpace W] /-- Graph factor, given by `1+|k| * ‖m‖`. -/ -def graphFactor (k : ℝ) (m : Vector3) : ℝ := 1+|k| * ‖m‖ +@[expose] def graphFactor (k : ℝ) (m : Vector3) : ℝ := 1+|k| * ‖m‖ theorem graphFactor_nonneg (k : ℝ) (m : Vector3) : 0 ≤ graphFactor k m := by unfold graphFactor diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean index a3aedb1c16..619dbb0c88 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Comp One extra angular derivative suffices, and its norm is controlled by the next actual cover tensor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean index 78f8df4e49..dd1ceae1e9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean @@ -19,7 +19,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder lie in cylinder L² whenever its actual coordinate words do. The bound keeps the ordered-word sum; there is no extra alphabet factor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLpMap.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLpMap.lean index 780a4767bb..d309e56328 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLpMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLpMap.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder L² classes. In particular the small normal component is retained in the four-dimensional transport estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderLocalSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderLocalSupport.lean index f88ca35ddd..9c642150e8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderLocalSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderLocalSupport.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderRawSupport /-! Spatial support is preserved by the actual angular primitive, mixed derivative, and slow curl paths. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderMeasureDescent.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderMeasureDescent.lean index 581f80d7da..e857da125a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderMeasureDescent.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderMeasureDescent.lean @@ -13,7 +13,7 @@ with deck translations induces a measure-preserving cylinder map. The proof compares genuine fundamental domains; it does not integrate a nonzero periodic function over the whole real cover. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderOrbitSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderOrbitSobolev.lean index a3042ab067..20de8c73c5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderOrbitSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderOrbitSobolev.lean @@ -17,7 +17,7 @@ word. The complete Sobolev norm is bounded by the exact finite word sum, and uniform-time mixed orbit regularity yields a continuous Sobolev path. -/ -@[expose] public section +public section noncomputable section @@ -75,8 +75,9 @@ theorem spatialJet_word (n q : ℕ) (hn : n ≤ q) (u : LiftL2 period) theorem sobolev_coordinate (q : ℕ) (u : LiftL2 period) (hu : SmoothOrbit period u) (w : SobolevWord q) : (sobolev period q u hu).val w = - wordDerivative standardDirection (fun a : LiftTangent => translate period a u) w.2 0 := - spatialJet_word period w.1.val q (Nat.le_of_lt_succ w.1.isLt) u hu w.2 + wordDerivative standardDirection (fun a : LiftTangent => translate period a u) w.2 0 := by + rw [sobolev, ofJet_apply] + exact spatialJet_word period w.1.val q (Nat.le_of_lt_succ w.1.isLt) u hu w.2 /-- A complete Sobolev norm is controlled by the genuine fixed-order word sum. -/ theorem sobolev_norm_le_baseSize (q : ℕ) (u : LiftL2 period) (hu : SmoothOrbit period u) : @@ -130,7 +131,7 @@ theorem path_sobolev_continuous (q : ℕ) (p : C(K, LiftL2 period)) 0).continuous /-- The actual continuous Sobolev path. -/ -def sobolevPath (q : ℕ) (p : C(K, LiftL2 period)) +@[expose] def sobolevPath (q : ℕ) (p : C(K, LiftL2 period)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate period a p)) : C(K,SobolevSpace period q) := ⟨fun t => sobolev period q (p t) (path_evaluation_smooth period p hp t),path_sobolev_continuous diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathAdvection.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathAdvection.lean index 71e497a642..87eb373bf2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathAdvection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathAdvection.lean @@ -17,7 +17,7 @@ section /-! A literal product with one mixed cylinder derivative consumes exactly one shift. -/ -@[expose] public section +public section noncomputable section @@ -79,7 +79,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProduct.lean index 077a678dc7..632d58ab01 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProduct.lean @@ -21,7 +21,7 @@ mixed translation orbit is smooth because each input has a smooth H6 orbit. The output representative is the literal pointwise product at every point. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProductBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProductBounds.lean index aad0b73fb5..f07aa741ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProductBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathProductBounds.lean @@ -43,7 +43,7 @@ section /-! The finite sum of nested genuine derivative words is the corresponding longer word sum. -/ -@[expose] public section +public section noncomputable section @@ -81,7 +81,7 @@ end end -@[expose] public section +public section noncomputable section @@ -184,7 +184,7 @@ end end -@[expose] public section +public section noncomputable section @@ -320,7 +320,7 @@ section /-! Literal bounded bilinear nonlinearities preserve smooth continuous cylinder L² paths. -/ -@[expose] public section +public section noncomputable section @@ -332,7 +332,7 @@ open Set MeasureTheory ContinuousLinearMap Finset EulerSmoothLimit EulerLiftedGr open scoped ContDiff /-- Component, given by `EuclideanSpace.proj i`. -/ -def component (i : Fin 3) : Space →L[ℝ] ℝ := EuclideanSpace.proj i +@[expose] def component (i : Fin 3) : Space →L[ℝ] ℝ := EuclideanSpace.proj i theorem component_norm (i : Fin 3) : ‖component i‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -341,7 +341,7 @@ theorem component_norm (i : Fin 3) : ‖component i‖ ≤ 1 := by simpa only [one_mul] using PiLp.norm_apply_le u i /-- Basis vector, given by `EuclideanSpace.single i 1`. -/ -def basisVector (i : Fin 3) : Space := EuclideanSpace.single i 1 +@[expose] def basisVector (i : Fin 3) : Space := EuclideanSpace.single i 1 theorem sum_components (u : Space) : (∑ i : Fin 3, component i u • basisVector i) = u := by ext i @@ -369,7 +369,7 @@ theorem bilinearTerm_orbit (i : Fin 3) : (scalarProductPath_orbit P (component i) (component_norm i) p q hp hq) /-- An arbitrary fixed bilinear vector operation on the actual L² paths. -/ -def bilinearProductPath : C(K,LiftL2 P) := ∑ i : Fin 3, bilinearTerm P B p q hp hq i +@[expose] def bilinearProductPath : C(K,LiftL2 P) := ∑ i : Fin 3, bilinearTerm P B p q hp hq i theorem bilinearProductPath_orbit : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a (bilinearProductPath P B p q hp hq)) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathWords.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathWords.lean index 1509b3bbbc..c2bdbe39d4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPathWords.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPathWords.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Actual continuous L² paths for every ordered cylinder derivative. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable (P : ℝ) [Fact (0 < P)] {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- The actual uniform-time derivative word, evaluated at the untranslated path. -/ -def wordPath (p : C(K, LiftL2 P)) {n : ℕ} (w : Fin n → Fin 4) : C(K,LiftL2 P) := +@[expose] def wordPath (p : C(K, LiftL2 P)) {n : ℕ} (w : Fin n → Fin 4) : C(K,LiftL2 P) := wordDerivative standardDirection (fun a : LiftTangent => pathTranslate P a p) w 0 variable (p : C(K, LiftL2 P)) @@ -86,7 +86,7 @@ theorem wordPath_eq_sobolev (q : ℕ) {n : ℕ} (w : Fin n → Fin 4) (t : K) : ⟨⟨n,by omega⟩,w⟩ /-- A single spatial or angular derivative retains an actual continuous-time L² path. -/ -def derivativePath (i : Fin 4) : C(K,LiftL2 P) := wordPath P p (fun _ : Fin 1 => i) +@[expose] def derivativePath (i : Fin 4) : C(K,LiftL2 P) := wordPath P p (fun _ : Fin 1 => i) include hp in theorem derivativePath_translation (i : Fin 4) (a : LiftTangent) : @@ -105,8 +105,10 @@ theorem derivativePath_orbit (i : Fin 4) : theorem pointField_derivativePath (i : Fin 4) (t : K) (x : LiftDomain P) : pointField P (derivativePath P p i) (derivativePath_orbit P p hp i) t x = - fieldFDeriv P (pointField P p hp t) x (standardDirection i) := - congrFun (pointField_wordPath P p hp (fun _ : Fin 1 => i) t) x + fieldFDeriv P (pointField P p hp t) x (standardDirection i) := by + simpa only [derivativePath, iteratedFieldDerivative_succ, Fin.cons_zero, + Fin.tail_cons, iteratedFieldDerivative_zero, fieldDerivative, fieldFDeriv] using + congrFun (pointField_wordPath P p hp (fun _ : Fin 1 => i) t) x include hp in /-- Differentiation uses one external word, with no dimension-dependent radius loss. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensor.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensor.lean index d3ae12b429..022992590b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensor.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensor.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real derivative tensors are bounded by cylinder derivative words, with an explicit polynomial frequency loss. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ theorem coordinateEquiv_graphCoordinates (k : ℝ) (m x : Vector3) : coordinateEquiv.apply_symm_apply _ /-- Frequency factor, given by `‖coordinateEquiv.symm.toContinuousLinearMap‖*(1+|k| * ‖m‖)`. -/ -def frequencyFactor (k : ℝ) (m : Vector3) : ℝ := +@[expose] def frequencyFactor (k : ℝ) (m : Vector3) : ℝ := ‖coordinateEquiv.symm.toContinuousLinearMap‖*(1+|k| * ‖m‖) theorem frequencyFactor_nonneg (k : ℝ) (m : Vector3) : 0 ≤ frequencyFactor k m := by @@ -64,6 +64,7 @@ theorem graphCoordinates_norm_le (k : ℝ) (m : Vector3) : variable (P : ℝ) [Fact (0 < P)] /-- Physical field, defined pointwise by `f (cylinderGraph P k m x)`. -/ +@[expose] def physicalField (k : ℝ) (m : Vector3) (f : LiftDomain P → Vector3) : Vector3 → Vector3 := fun x => f (cylinderGraph P k m x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean index 9f86b1e311..ea3b8eb021 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Ordinary derivative tensors of the actual graph field lie in spatial L², with explicit frequency loss and the genuine graph-word norms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialPath.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialPath.lean index 8cc490180b..c63d99f2e1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialPath.lean @@ -29,7 +29,7 @@ section /-! Same-radius mixed-word and continuous-time estimates for the actual angular operator. -/ -@[expose] public section +public section noncomputable section @@ -88,7 +88,7 @@ def pathPrimitive : C(K,LiftL2 P) →L[ℝ] C(K,LiftL2 P) := omit [CompactSpace K] in @[simp] theorem pathPrimitive_apply (u : C(K, LiftL2 P)) (t : K) : - pathPrimitive P u t = primitive P (u t) := rfl + pathPrimitive P u t = primitive P (u t) := by rfl theorem pathPrimitive_norm : ‖pathPrimitive (K := K) P‖ ≤ P := by have hP : 0 ≤ P := le_of_lt (Fact.out : 0 < P) @@ -124,7 +124,7 @@ end end -@[expose] public section +public section noncomputable section @@ -156,8 +156,7 @@ theorem primitive_sobolevPath (p : C(K, LiftL2 P)) sobolevPath P q (pathPrimitive P p) (pathPrimitive_orbit_contDiff P p hp) t = sobolevPrimitive P q (sobolevPath P q p hp t) := by apply value_injective P - change value P (sobolevPath P q (pathPrimitive P p) _ t) = - primitive P (value P (sobolevPath P q p hp t)) + rw [value_sobolevPrimitive] rw [sobolevPath_value, sobolevPath_value] rfl @@ -216,7 +215,7 @@ end end -@[expose] public section +public section noncomputable section @@ -235,7 +234,7 @@ variable (P : ℝ) [Fact (0 < P)] (p : C(K, LiftL2 P)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a p)) /-- Potential path, given by `fullMultiplierMap P B (pathPrimitive P p)`. -/ -def potentialPath : C(K,LiftL2 P) := fullMultiplierMap P B (pathPrimitive P p) +@[expose] def potentialPath : C(K,LiftL2 P) := fullMultiplierMap P B (pathPrimitive P p) include hB hp in theorem potentialPath_orbit : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialTime.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialTime.lean index fe2fcb02f6..9a7945341c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialTime.lean @@ -18,7 +18,7 @@ section /-! Actual one-sided time differentiation of the packet's spatial curl corrector. -/ -@[expose] public section +public section noncomputable section @@ -81,7 +81,7 @@ end end -@[expose] public section +public section noncomputable section @@ -102,7 +102,7 @@ variable (P : ℝ) [Fact (0 < P)] (T : ℝ) (hT : 0 ≤ T) (hf : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a f)) /-- Potential derivative, given by `potentialPath P B₁ p + potentialPath P B f`. -/ -def potentialDerivative : C(Icc (0 : ℝ) T,LiftL2 P) := +@[expose] def potentialDerivative : C(Icc (0 : ℝ) T,LiftL2 P) := potentialPath P B₁ p + potentialPath P B f include hB hB₁ hp hf in diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialWeight.lean index ee10f425a4..de885d1635 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPotentialWeight.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.LpCylinderTimeWeight /-! Exact profile normalization of spatial derivative paths and the vector potential. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderRawSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderRawSupport.lean index 02e0de9d6e..34484537bc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderRawSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderRawSupport.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ClassicalPressureCurl /-! The actual smooth representative retains the proved compact spatial support of its L² class. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderReflection.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderReflection.lean index 6a7e381dc1..361a4464b3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderReflection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderReflection.lean @@ -13,7 +13,7 @@ import Mathlib.MeasureTheory.Measure.Haar.Unique /-! The actual joint spatial and angular reflection on cylinder L² fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarAverage.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarAverage.lean index f5c868bc52..1ff18b3209 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarAverage.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarAverage.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderScalarRepresentative /-! The actual scalar average-zero condition gives literal pointwise zero angular mean. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarClassical.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarClassical.lean index 6f403c0992..616716c51f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarClassical.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarClassical.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! The literal periodic scalar pressure primitive, with actual smoothness and normalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarParity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarParity.lean index 9c4fa1cd43..2ad549ff35 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarParity.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.AnglePrimitiveParity /-! The normalized scalar angular primitive converts joint odd parity to even parity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarPrimitive.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarPrimitive.lean index 2602c5a7e1..d01fe2621e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarPrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarPrimitive.lean @@ -19,7 +19,7 @@ constructed vector primitive to scalar pressure. Its mixed-translation commutation and fixed-Hq external-word bound have no radius loss. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ def unitVector : Space := EuclideanSpace.single 0 1 theorem unitVector_norm : ‖unitVector‖ = 1 := by simp [unitVector] /-- Scalar embed, given by `toSpanSingleton ℝ unitVector`. -/ -def scalarEmbed : ℝ →L[ℝ] Space := toSpanSingleton ℝ unitVector +@[expose] def scalarEmbed : ℝ →L[ℝ] Space := toSpanSingleton ℝ unitVector /-- Scalar project, given by `innerSL ℝ unitVector`. -/ def scalarProject : Space →L[ℝ] ℝ := innerSL ℝ unitVector @@ -54,9 +54,10 @@ theorem scalarProject_norm : ‖scalarProject‖ = 1 := by variable (period : ℝ) [Fact (0 < period)] /-- Embed, given by `EulerCylinderConstantMap.map period scalarEmbed`. -/ -def embed : CylinderL2 period ℝ →L[ℝ] LiftL2 period := EulerCylinderConstantMap.map period +@[expose] def embed : CylinderL2 period ℝ →L[ℝ] LiftL2 period := EulerCylinderConstantMap.map period scalarEmbed /-- Project, given by `EulerCylinderConstantMap.map period scalarProject`. -/ +@[expose] def project : LiftL2 period →L[ℝ] CylinderL2 period ℝ := EulerCylinderConstantMap.map period scalarProject @@ -68,7 +69,7 @@ theorem project_norm : ‖project period‖ ≤ 1 := /-- Primitive, given by `(project period).comp ((EulerCylinderAnglePrimitive.primitive period).comp (embed period))`. -/ -def primitive : CylinderL2 period ℝ →L[ℝ] CylinderL2 period ℝ := +@[expose] def primitive : CylinderL2 period ℝ →L[ℝ] CylinderL2 period ℝ := (project period).comp ((EulerCylinderAnglePrimitive.primitive period).comp (embed period)) theorem primitive_norm : ‖primitive period‖ ≤ period := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarRepresentative.lean index b447fc08a5..98d218c660 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarRepresentative.lean @@ -20,7 +20,7 @@ proved vector H3 evaluation theorem to this embedding identifies the actual scalar L² primitive with the literal normalized periodic integral. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarTime.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarTime.lean index 50cbc92652..8a62e87248 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderScalarTime.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ClassicalPressureCurl /-! Jointly continuous scalar representatives of actual smooth cylinder L² paths. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSliceRepresentatives.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSliceRepresentatives.lean index 535b07228b..7f62443045 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSliceRepresentatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSliceRepresentatives.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ClassicalPressureCurl /-! Equality of actual cylinder L² slices identifies their continuous representatives everywhere. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurl.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurl.lean index 7d9f3c20ef..e79485d657 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurl.lean @@ -25,7 +25,7 @@ section /-! Coordinate realization of the actual slow curl and its bounded coefficients. -/ -@[expose] public section +public section noncomputable section @@ -165,7 +165,7 @@ end end -@[expose] public section +public section noncomputable section @@ -223,7 +223,7 @@ variable (p : C(K, LiftL2 P)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a p)) /-- Term, given by `fullMultiplierMap P (curlCoefficientPath i G) (derivativePath P p i.succ)`. -/ -def term (i : Fin 3) : C(K,LiftL2 P) := +@[expose] def term (i : Fin 3) : C(K,LiftL2 P) := fullMultiplierMap P (curlCoefficientPath i G) (derivativePath P p i.succ) include hG hp in @@ -233,7 +233,7 @@ theorem term_orbit (i : Fin 3) : (derivativePath P p i.succ) (derivativePath_orbit P p hp i.succ) /-- Path, given by `∑ i : Fin 3, term P G p i`. -/ -def path : C(K,LiftL2 P) := ∑ i : Fin 3, term P G p i +@[expose] def path : C(K,LiftL2 P) := ∑ i : Fin 3, term P G p i include hG hp in theorem path_orbit : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlBounds.lean index fb884b5c4e..4ecdb4a38b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlBounds.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.LpCylinderRectangularRegularity /-! The literal slow curl as a continuous cylinder L² path with same-radius bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlTime.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlTime.lean index bb8f523ffd..08f952de0c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlTime.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.LpCylinderFullTime /-! Actual within-time differentiation and bounds for the constructed slow-curl path. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable (P : ℝ) [Fact (0 < P)] (T : ℝ) (hT : 0 ≤ T) (hf : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a f)) /-- Derivative, given by `path P G₁ p + path P G f`. -/ -def derivative : C(Icc (0 : ℝ) T,LiftL2 P) := path P G₁ p + path P G f +@[expose] def derivative : C(Icc (0 : ℝ) T,LiftL2 P) := path P G₁ p + path P G f include hG hG₁ hp hf in theorem derivative_orbit : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlWeight.lean index 02ac44903e..d15a31f8e5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSlowCurlWeight.lean @@ -18,7 +18,7 @@ section /-! Exact time-profile normalization of the actual slow curl and its time derivative. -/ -@[expose] public section +public section noncomputable section @@ -137,7 +137,7 @@ section /-! Same-radius bounds and literal profile normalization for the constructed potential time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSmoothOrbit.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSmoothOrbit.lean index f9879f1edf..b0ee3ea770 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSmoothOrbit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSmoothOrbit.lean @@ -23,7 +23,7 @@ existing Sobolev arrays and a smooth representative; no spatial regularity of the solution is assumed separately. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ theorem orbitDerivative_hasDerivAt (u : LiftL2 period) (hu : SmoothOrbit period exact hd /-- Every finite tree of genuine mixed strong derivatives is constructed. -/ -def spatialJet (q : ℕ) (u : LiftL2 period) (hu : SmoothOrbit period u) : +@[expose] def spatialJet (q : ℕ) (u : LiftL2 period) (hu : SmoothOrbit period u) : SpatialJet period standardDirection q u := match q with | 0 => .zero u @@ -108,6 +108,7 @@ theorem spatialJet_norm (q : ℕ) (u : LiftL2 period) (hu : SmoothOrbit period u exact orbitDerivative_translation period u hu (standardDirection i) a /-- Actual mixed orbit smoothness supplies an existing genuine cylinder Sobolev element. -/ +@[expose] def sobolev (q : ℕ) (u : LiftL2 period) (hu : SmoothOrbit period u) : SobolevSpace period q := ofJet period (spatialJet period q u hu) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDensity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDensity.lean index 837f105807..c86ab2367d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDensity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDensity.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.MollifierRepresent /-! Smooth mollifications are dense in every actual complete cylinder Sobolev space. -/ -@[expose] public section +public section noncomputable section @@ -25,14 +25,22 @@ open scoped Topology ContDiff variable (period : ℝ) [Fact (0 < period)] /-- Actual smooth convolution lifted to the complete Sobolev space. -/ -def sobolevMollifier (q n : ℕ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := +@[expose] def sobolevMollifier (q n : ℕ) : + SobolevSpace period q →L[ℝ] SobolevSpace period q := liftOperator period q (mollifierOperator period n) - (fun a f => (mollify_translation period n a f).symm) + (fun a f => by + simp only [mollifierOperator_apply] + exact (mollify_translation period n a f).symm) /-- Every derivative coordinate is mollified by the same actual convolution. -/ @[simp] theorem sobolevMollifier_apply {q : ℕ} (n : ℕ) (u : SobolevSpace period q) (w : SobolevWord q) : - (sobolevMollifier period q n u).val w = mollify period n (u.val w) := rfl + (sobolevMollifier period q n u).val w = mollify period n (u.val w) := by + simp only [sobolevMollifier, liftOperator_apply, mollifierOperator_apply] + +@[simp] theorem sobolevMollifier_value {q : ℕ} (n : ℕ) (u : SobolevSpace period q) : + value period (sobolevMollifier period q n u) = mollify period n (value period u) := + sobolevMollifier_apply period n u (emptyWord q) /-- The smooth convolution is contractive in every complete Sobolev norm. -/ theorem sobolevMollifier_bound {q : ℕ} (n : ℕ) (u : SobolevSpace period q) : @@ -47,7 +55,7 @@ theorem sobolevMollifier_tendsto {q : ℕ} (u : SobolevSpace period q) : rw [tendsto_subtype_rng] apply tendsto_pi_nhds.mpr intro w - exact mollify_tendsto period (u.val w) + simpa only [sobolevMollifier_apply] using mollify_tendsto period (u.val w) /-- Every Sobolev mollification has the concrete smooth convolution as an almost-everywhere representative. -/ @@ -55,7 +63,9 @@ theorem sobolevMollifier_representative {q : ℕ} (n : ℕ) (u : SobolevSpace pe (value period (sobolevMollifier period q n u) : LiftDomain period → Vector3) =ᵐ[liftMeasure period] smoothMollifier period n (value period u) := - mollify_ae_smoothMollifier period n (value period u) + by + simpa only [value, sobolevMollifier_apply] using + mollify_ae_smoothMollifier period n (value period u) /-- The smooth representative of a Sobolev mollifier has exactly the expected classical derivative coordinates. -/ @@ -66,7 +76,7 @@ theorem sobolevMollifier_word_ae {q k : ℕ} (hk : k ≤ q) (n : ℕ) (u : Sobol iteratedFieldDerivative period w (smoothMollifier period n (value period u)) := by have h := smoothMollifier_word_ae period hk (value period u) (toJet period u) n w rw [toJet_word period u hk] at h - exact h + simpa only [word, sobolevMollifier_apply] using h /-- Fields with actual smooth cylinder representatives are dense in the complete Sobolev space. -/ theorem smooth_representatives_dense (q : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDerivatives.lean index 76caff3b8a..e8d484cb25 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevDerivatives.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderSobolevOperators /-! Actual coordinate derivatives and truncations between the complete cylinder Sobolev spaces. -/ -@[expose] public section +public section noncomputable section @@ -25,13 +25,13 @@ def truncateIndex {q : ℕ} (w : SobolevWord q) : SobolevWord (q + 1) := ⟨⟨w.1.val, Nat.lt_succ_of_lt w.1.isLt⟩, w.2⟩ /-- Appending a direction indexes a derivative of the corresponding underlying derivative field. -/ -def derivativeIndex {q : ℕ} (i : Fin 4) (w : SobolevWord q) : SobolevWord (q + 1) := +@[expose] def derivativeIndex {q : ℕ} (i : Fin 4) (w : SobolevWord q) : SobolevWord (q + 1) := ⟨⟨w.1.val + 1, Nat.succ_lt_succ w.1.isLt⟩, Fin.snoc w.2 i⟩ variable (period : ℝ) [Fact (0 < period)] /-- Continuous truncation forgets the highest derivative level. -/ -def truncateOperator (q : ℕ) : SobolevSpace period (q + 1) →L[ℝ] SobolevSpace period q := +@[expose] def truncateOperator (q : ℕ) : SobolevSpace period (q + 1) →L[ℝ] SobolevSpace period q := ((ContinuousLinearMap.pi (fun w : SobolevWord q => ContinuousLinearMap.proj (truncateIndex w))).comp (arrayOperator period (q + 1))).codRestrict (sobolevSubspace period q).toSubmodule (by @@ -61,13 +61,13 @@ def derivativeOperator (q : ℕ) (i : Fin 4) : /-- Truncation acts by the literal inclusion of derivative-word coordinates. -/ @[simp] theorem truncateOperator_apply {q : ℕ} (u : SobolevSpace period (q + 1)) (w : SobolevWord q) : - (truncateOperator period q u).val w = u.val (truncateIndex w) := rfl + (truncateOperator period q u).val w = u.val (truncateIndex w) := by rfl /-- A derivative acts by appending its direction to each word. -/ @[simp] theorem derivativeOperator_apply {q : ℕ} (i : Fin 4) (u : SobolevSpace period (q + 1)) (w : SobolevWord q) : - (derivativeOperator period q i u).val w = u.val (derivativeIndex i w) := rfl + (derivativeOperator period q i u).val w = u.val (derivativeIndex i w) := by rfl /-- Truncation is contractive in the complete derivative-array norm. -/ theorem truncateOperator_bound {q : ℕ} (u : SobolevSpace period (q + 1)) : @@ -88,7 +88,7 @@ theorem derivativeOperator_bound {q : ℕ} (i : Fin 4) (u : SobolevSpace period /-- Truncation leaves the underlying L² field unchanged. -/ @[simp] theorem value_truncateOperator {q : ℕ} (u : SobolevSpace period (q + 1)) : - value period (truncateOperator period q u) = value period u := rfl + value period (truncateOperator period q u) = value period u := by rfl /-- The derivative operator really differentiates the underlying L² translation orbit. -/ theorem derivativeOperator_hasDerivAt {q : ℕ} (i : Fin 4) (u : SobolevSpace period (q + 1)) : @@ -111,6 +111,19 @@ theorem derivativeOperator_translation {q : ℕ} (i : Fin 4) (a : LiftDomain per sobolevTranslation period q a (derivativeOperator period q i u) := by apply Subtype.ext funext w - rfl + calc + (derivativeOperator period q i (sobolevTranslation period (q + 1) a u)).val w = + (sobolevTranslation period (q + 1) a u).val (derivativeIndex i w) := + derivativeOperator_apply period i _ w + _ = (translation period a).toContinuousLinearMap (u.val (derivativeIndex i w)) := by + simpa only [sobolevTranslation] using + (liftOperator_apply period (translation period a).toContinuousLinearMap + (translations_commute period a) u (derivativeIndex i w)) + _ = (translation period a).toContinuousLinearMap + ((derivativeOperator period q i u).val w) := by rw [derivativeOperator_apply] + _ = (sobolevTranslation period q a (derivativeOperator period q i u)).val w := by + simpa only [sobolevTranslation] using + (liftOperator_apply period (translation period a).toContinuousLinearMap + (translations_commute period a) (derivativeOperator period q i u) w).symm end EulerCylinderSobolevSpace diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevEmbedding.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevEmbedding.lean index 0f5adae8f3..65fa6ba855 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevEmbedding.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevEmbedding.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.VectorCylinder /-! Genuine L∞ control of finite-order cylinder Sobolev fields, obtained by smooth density. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOperators.lean index 726d7c1733..c7f9f535fd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOperators.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.CylinderMollifier /-! Continuous operators and exact norm comparisons on the actual complete cylinder Sobolev spaces. -/ -@[expose] public section +public section noncomputable section @@ -26,14 +26,15 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The continuous inclusion of the Sobolev space into its finite derivative array. -/ -def arrayOperator (q : ℕ) : SobolevSpace period q →L[ℝ] (SobolevWord q → LiftL2 period) := +@[expose] def arrayOperator (q : ℕ) : SobolevSpace period q →L[ℝ] (SobolevWord q → LiftL2 period) := (sobolevSubspace period q).toSubmodule.subtypeL /-- Continuous evaluation of the underlying L² field. -/ -def valueOperator (q : ℕ) : SobolevSpace period q →L[ℝ] LiftL2 period := +@[expose] def valueOperator (q : ℕ) : SobolevSpace period q →L[ℝ] LiftL2 period := (ContinuousLinearMap.proj (emptyWord q)).comp (arrayOperator period q) /-- Continuous evaluation of one actual derivative coordinate. -/ +@[expose] def wordOperator {q : ℕ} (w : SobolevWord q) : SobolevSpace period q →L[ℝ] LiftL2 period := (ContinuousLinearMap.proj w).comp (arrayOperator period q) @@ -46,7 +47,7 @@ theorem value_norm_le {q : ℕ} (u : SobolevSpace period q) : ‖value period u word_norm_le period u (emptyWord q) /-- The sum of actual derivative norms, in the source's Sobolev convention. -/ -def sumNorm {q : ℕ} (u : SobolevSpace period q) : ℝ := ∑ w : SobolevWord q, ‖u.val w‖ +@[expose] def sumNorm {q : ℕ} (u : SobolevSpace period q) : ℝ := ∑ w : SobolevWord q, ‖u.val w‖ /-- The complete-array norm is bounded by the source's derivative sum. -/ theorem norm_le_sumNorm {q : ℕ} (u : SobolevSpace period q) : ‖u‖ ≤ sumNorm period u := by @@ -79,7 +80,7 @@ theorem sumNorm_eq_jet {q : ℕ} (u : SobolevSpace period q) : rfl /-- A translation-commuting L² operator acts on every actual derivative coordinate. -/ -def liftOperator (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) +@[expose] def liftOperator (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) (hA : ∀ a f, A (translation period a f) = translation period a (A f)) : SobolevSpace period q →L[ℝ] SobolevSpace period q := ((ContinuousLinearMap.pi (fun w : SobolevWord q => A.comp (ContinuousLinearMap.proj w))).comp @@ -99,7 +100,7 @@ def liftOperator (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 period) theorem liftOperator_apply {q : ℕ} (A : LiftL2 period →L[ℝ] LiftL2 period) (hA : ∀ a f, A (translation period a f) = translation period a (A f)) (u : SobolevSpace period q) (w : SobolevWord q) : - (liftOperator period q A hA u).val w = A (u.val w) := rfl + (liftOperator period q A hA u).val w = A (u.val w) := by rfl /-- The lifted Sobolev operator has the same uniform bound as its L² action. -/ theorem liftOperator_bound {q : ℕ} (A : LiftL2 period →L[ℝ] LiftL2 period) @@ -121,7 +122,7 @@ theorem norm_liftOperator_le (q : ℕ) (A : LiftL2 period →L[ℝ] LiftL2 perio theorem value_liftOperator {q : ℕ} (A : LiftL2 period →L[ℝ] LiftL2 period) (hA : ∀ a f, A (translation period a f) = translation period a (A f)) (u : SobolevSpace period q) : value period (liftOperator period q A hA u) = A (value period u) - := rfl + := by rfl /-- Translations commute in the cylinder's additive group. -/ theorem translations_commute (a b : LiftDomain period) (f : LiftL2 period) : @@ -130,10 +131,15 @@ theorem translations_commute (a b : LiftDomain period) (f : LiftL2 period) : rw [translation_add, translation_add, add_comm a b] /-- Actual cylinder translation as a bounded operator on the complete Sobolev space. -/ +@[expose] def sobolevTranslation (q : ℕ) (a : LiftDomain period) : SobolevSpace period q →L[ℝ] SobolevSpace period q := liftOperator period q (translation period a).toContinuousLinearMap (translations_commute period a) +@[simp] theorem value_sobolevTranslation {q : ℕ} (a : LiftDomain period) + (u : SobolevSpace period q) : + value period (sobolevTranslation period q a u) = translation period a (value period u) := by rfl + /-- Cylinder translation preserves the complete Sobolev norm exactly. -/ theorem sobolevTranslation_norm {q : ℕ} (a : LiftDomain period) (u : SobolevSpace period q) : ‖sobolevTranslation period q a u‖ = ‖u‖ := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOrbit.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOrbit.lean index 853d59cade..059658e590 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOrbit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevOrbit.lean @@ -28,7 +28,7 @@ retraction. We use the equivalent Hilbert product norm only to construct the retraction; all stated spaces retain their original sup norms. -/ -@[expose] public section +public section noncomputable section @@ -101,7 +101,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevSpace.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevSpace.lean index ba25fcf31f..9f8fed2b82 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevSpace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSobolevSpace.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.PressureJetIdentities /-! A complete cylinder Sobolev space constructed from closed graphs of actual L² derivatives. -/ -@[expose] public section +public section noncomputable section @@ -31,31 +31,32 @@ abbrev SobolevWord (q : ℕ) := Σ n : Fin (q + 1), Fin n.val → Fin 4 abbrev SobolevEdge (q : ℕ) := Σ n : Fin q, (Fin n.val → Fin 4) × Fin 4 /-- The empty derivative word. -/ -def emptyWord (q : ℕ) : SobolevWord q := ⟨⟨0, Nat.zero_lt_succ q⟩, Fin.elim0⟩ +@[expose] def emptyWord (q : ℕ) : SobolevWord q := ⟨⟨0, Nat.zero_lt_succ q⟩, Fin.elim0⟩ /-- The lower endpoint of a derivative edge. -/ -def edgeParent {q : ℕ} (e : SobolevEdge q) : SobolevWord q := +@[expose] def edgeParent {q : ℕ} (e : SobolevEdge q) : SobolevWord q := ⟨⟨e.1.val, Nat.lt_succ_of_lt e.1.isLt⟩, e.2.1⟩ /-- The upper endpoint obtained by prepending one derivative direction. -/ -def edgeChild {q : ℕ} (e : SobolevEdge q) : SobolevWord q := +@[expose] def edgeChild {q : ℕ} (e : SobolevEdge q) : SobolevWord q := ⟨⟨e.1.val + 1, Nat.succ_lt_succ e.1.isLt⟩, Fin.cons e.2.2 e.2.1⟩ variable (period : ℝ) [Fact (0 < period)] /-- The closed graph of the actual strong translation derivative. -/ +@[expose] def closedDerivativeGraph (a : LiftTangent) : ClosedSubmodule ℝ (LiftL2 period × LiftL2 period) where toSubmodule := translationDerivativeGraph period a isClosed' := translationDerivativeGraph_closed period a /-- Evaluation of the two endpoints of a derivative edge is continuous linear. -/ -def edgeEvaluation {q : ℕ} (e : SobolevEdge q) : +@[expose] def edgeEvaluation {q : ℕ} (e : SobolevEdge q) : (SobolevWord q → LiftL2 period) →L[ℝ] (LiftL2 period × LiftL2 period) := (ContinuousLinearMap.proj (edgeParent e)).prod (ContinuousLinearMap.proj (edgeChild e)) /-- The closed linear space of finite arrays satisfying every genuine derivative compatibility. -/ -def sobolevSubspace (q : ℕ) : ClosedSubmodule ℝ (SobolevWord q → LiftL2 period) := +@[expose] def sobolevSubspace (q : ℕ) : ClosedSubmodule ℝ (SobolevWord q → LiftL2 period) := ⨅ e : SobolevEdge q, (closedDerivativeGraph period (standardDirection e.2.2)).comap (edgeEvaluation period e) @@ -75,10 +76,12 @@ instance sobolevNormedSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) theorem sobolev_complete (q : ℕ) : CompleteSpace (SobolevSpace period q) := inferInstance /-- The underlying L² field of a Sobolev derivative array. -/ -def value {q : ℕ} (u : SobolevSpace period q) : LiftL2 period := u.val (emptyWord q) +@[expose] def value {q : ℕ} (u : SobolevSpace period q) : LiftL2 period := + u.val (emptyWord q) /-- A valid derivative word in the array. -/ -def word {q n : ℕ} (u : SobolevSpace period q) (hn : n ≤ q) (w : Fin n → Fin 4) : LiftL2 period := +@[expose] def word {q n : ℕ} (u : SobolevSpace period q) (hn : n ≤ q) + (w : Fin n → Fin 4) : LiftL2 period := u.val ⟨⟨n, Nat.lt_succ_of_le hn⟩, w⟩ /-- The defining compatibility is a genuine strong derivative of an L² translation orbit. -/ @@ -90,13 +93,17 @@ theorem word_hasDerivAt {q n : ℕ} (u : SobolevSpace period q) (hn : n < q) exact h /-- Every finite strong derivative jet defines an element of the complete Sobolev space. -/ -def ofJet {q : ℕ} {f : LiftL2 period} (J : SpatialJet period standardDirection q f) : +@[expose] def ofJet {q : ℕ} {f : LiftL2 period} (J : SpatialJet period standardDirection q f) : SobolevSpace period q := by refine ⟨fun w => J.word w.2, ?_⟩ apply ClosedSubmodule.mem_iInf.mpr intro e exact J.word_hasDerivAt e.1.isLt e.2.1 e.2.2 +@[simp] theorem ofJet_apply {q : ℕ} {f : LiftL2 period} + (J : SpatialJet period standardDirection q f) (w : SobolevWord q) : + (ofJet period J).val w = J.word w.2 := by rfl + /-- The underlying field of the array constructed from a jet is unchanged. -/ @[simp] theorem value_ofJet {q : ℕ} {f : LiftL2 period} (J : SpatialJet period standardDirection q f) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialEmbedding.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialEmbedding.lean index 983624e6f3..094f1ad22f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialEmbedding.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialEmbedding.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Integral.Prod /-! The genuine constant-angle embedding of ordinary spatial L² into cylinder L². -/ -@[expose] public section +public section noncomputable section @@ -104,7 +104,7 @@ def embeddingLinear : SpatialL2 V →ₗ[ℝ] CylinderL2 P V where def embedding : SpatialL2 V →L[ℝ] CylinderL2 P V := (embeddingLinear P).mkContinuous (Real.sqrt P) (lift_norm_le P) -@[simp] theorem embedding_apply (u : SpatialL2 V) : embedding P u = lift P u := rfl +@[simp] theorem embedding_apply (u : SpatialL2 V) : embedding P u = lift P u := by rfl theorem embedding_norm : ‖embedding (V := V) P‖ ≤ Real.sqrt P := opNorm_le_bound _ (Real.sqrt_nonneg P) (lift_norm_le P) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMean.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMean.lean index 08ff115cb0..1cda7fb46f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMean.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMean.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderAngleAverage /-! A genuine bounded cylinder-to-spatial mean, defined by the adjoint of constant extension. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ theorem embedding_translate (a : LiftTangent) (u : SpatialL2 V) : def mean : CylinderL2 P V →L[ℝ] SpatialL2 V := P⁻¹ • (embedding P).adjoint @[simp] theorem mean_apply (u : CylinderL2 P V) : - mean P u = P⁻¹ • (embedding P).adjoint u := rfl + mean P u = P⁻¹ • (embedding P).adjoint u := by rfl theorem mean_norm : ‖mean (V := V) P‖ ≤ P⁻¹*Real.sqrt P := by change ‖P⁻¹ • (embedding (V := V) P).adjoint‖ ≤ _ @@ -88,7 +88,7 @@ theorem mean_translate (a : LiftTangent) (u : CylinderL2 P V) : /-- Averaging over the angular translations does not change the actual spatial mean. -/ theorem mean_average (u : CylinderL2 P V) : mean P (average P u) = mean P u := by - change mean P (P⁻¹ • (∫ s in (0 : ℝ)..P, angleCurve P u s)) = _ + rw [average_eq_integral] rw [map_smul, ← (mean (V := V) P).intervalIntegral_comp_comm ((angleCurve_continuous P u).intervalIntegrable 0 P)] have he : (fun s : ℝ => mean P (angleCurve P u s)) = fun _ : ℝ => mean P u := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMeanPath.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMeanPath.lean index 6609de05b9..47229a57e3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMeanPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderSpatialMeanPath.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevLinear /-! Continuous-time and same-radius word estimates for the actual spatial mean. -/ -@[expose] public section +public section noncomputable section @@ -58,7 +58,7 @@ omit [CompactSpace K] in /-- Spatial path translation, given by `(EulerLpTranslation.translation a).toContinuousLinearMap.compLeftContinuous ℝ K`. -/ -def spatialPathTranslation (a : Space) : C(K,SpatialL2 V) →L[ℝ] C(K,SpatialL2 V) := +@[expose] def spatialPathTranslation (a : Space) : C(K,SpatialL2 V) →L[ℝ] C(K,SpatialL2 V) := (EulerLpTranslation.translation a).toContinuousLinearMap.compLeftContinuous ℝ K omit [CompactSpace K] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderTerminalAmplitude.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderTerminalAmplitude.lean index e2c1e3fedf..9c81289705 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderTerminalAmplitude.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderTerminalAmplitude.lean @@ -18,7 +18,7 @@ genuine linear endpoint map gives the identical coefficient/radius guard for every nonnegative amplitude, including zero. -/ -@[expose] public section +public section noncomputable section @@ -39,6 +39,14 @@ theorem constantPath_block_le (directions : ι → LiftTangent) (q : ℕ) (n : ℕ) (a : LiftTangent) : block directions q (fun b : LiftTangent => pathTranslate P b (ContinuousMap.const K Y)) n a ≤ block directions q (fun b : LiftTangent => translate P b Y) n a := by + have hpath : (fun b : LiftTangent => pathTranslate P b (ContinuousMap.const K Y)) = + fun b => ContinuousMap.const K (translate P b Y) := by + funext b + apply ContinuousMap.ext + intro t + simpa only [ContinuousMap.const_apply] using + pathTranslate_apply P b (ContinuousMap.const K Y) t + rw [hpath] have hb := block_comp_clm_le directions q (ContinuousLinearMap.const ℝ K : CylinderL2 P U →L[ℝ] C(K,CylinderL2 P U)) (fun b : LiftTangent => translate P b Y) hY n a diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeGradient.lean index 1086bc8f36..991353b666 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeGradient.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod /-! Time regularity of the full genuine covering derivative, reconstructed from its four directions. -/ -@[expose] public section +public section noncomputable section @@ -71,7 +71,9 @@ theorem pointField_fderiv_joint_continuous {K : Type*} [TopologicalSpace K] [Com fun i : Fin 4 => fieldFDeriv P (pointField P p hp z.1) z.2 (standardDirection i)) := by apply continuous_pi intro i - exact pointField_word_joint_continuous P p hp 1 (fun _ => i) + simpa only [iteratedFieldDerivative_succ, Fin.cons_zero, Fin.tail_cons, + iteratedFieldDerivative_zero, fieldDerivative, fieldFDeriv] using + pointField_word_joint_continuous P p hp 1 (fun _ => i) simpa only [Function.comp_def, fromCoordinates_eq] using fromCoordinates.continuous.comp hc variable (T : ℝ) (hT : 0 ≤ T) (p f : C(Icc (0 : ℝ) T, LiftL2 P)) @@ -93,7 +95,9 @@ theorem pointField_fderiv_hasDerivWithinAt (t : Icc (0 : ℝ) T) (x : LiftDomain (Icc (0 : ℝ) T) t := by apply hasDerivWithinAt_pi.mpr intro i - exact pointField_word_hasDerivWithinAt P T hT p f hp hf hd 1 (fun _ => i) t x + simpa only [iteratedFieldDerivative_succ, Fin.cons_zero, Fin.tail_cons, + iteratedFieldDerivative_zero, fieldDerivative, fieldFDeriv] using + pointField_word_hasDerivWithinAt P T hT p f hp hf hd 1 (fun _ => i) t x have h := fromCoordinates.hasFDerivAt.comp_hasDerivWithinAt (t : ℝ) hD simpa only [Function.comp_def, fromCoordinates_eq] using h diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeRegularity.lean index 2a899d5c91..3c0e5da10b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeRegularity.lean @@ -22,7 +22,7 @@ right-hand side lifts through the injective Sobolev inclusion and yields the actual pointwise within-time derivative, including both interval endpoints. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ variable (period : ℝ) [Fact (0 < period)] {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- The genuine representative obtained by bounded H3 point evaluation. -/ -def pointField (p : C(K, LiftL2 period)) +@[expose] def pointField (p : C(K, LiftL2 period)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate period a p)) (t : K) (x : LiftDomain period) : Space := EulerSobolevPointEvaluation.pointEvaluation period x (sobolevPath period 3 p hp t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeWords.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeWords.lean index 5a9f26220c..c75d0b2320 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeWords.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderTimeWords.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevJointEvaluation /-! Every actual classical spatial/angular word differentiates in time on the closed interval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderTranslationAdjoint.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderTranslationAdjoint.lean index 54bab10957..468b1c0853 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderTranslationAdjoint.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderTranslationAdjoint.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TimeLpBoundedMap /-! The adjoint of the genuine mixed cylinder translation is its inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderViscousEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderViscousEnergy.lean index 82097a196a..b430a1d7e0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderViscousEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderViscousEnergy.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Finite-word viscous energy for the actual lifted transport and projected-pressure equation. -/ -@[expose] public section +public section noncomputable section @@ -28,10 +28,11 @@ open scoped ContDiff ENNReal NNReal Topology variable (period : ℝ) [Fact (0 < period)] /-- The exact coefficient left after absorbing half the variable-metric heat dissipation. -/ -def heatEnergyConstant (K : SmoothCoefficient period) (c : ℝ) : ℝ := +@[expose] def heatEnergyConstant (K : SmoothCoefficient period) (c : ℝ) : ℝ := 2 * (K.firstBound : ℝ) ^ 2 / c ^ 2 /-- The actual transport metric correction for a bounded lifted velocity. -/ +@[expose] def transportEnergyConstant (K : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (B : ℝ≥0) : ℝ := (1 / 2 : ℝ) * K.firstBound * ((|κ| + ‖m‖) * B) diff --git a/LeanPool/NavierStokesAndEuler/Euler/DivCurlRecovery.lean b/LeanPool/NavierStokesAndEuler/Euler/DivCurlRecovery.lean index b5c4741cbd..06dec0af68 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DivCurlRecovery.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DivCurlRecovery.lean @@ -22,7 +22,7 @@ supported scalar cutoff. In particular, they do not assume that derivatives of the velocity are globally square integrable. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/DivergenceFreeHeat.lean b/LeanPool/NavierStokesAndEuler/Euler/DivergenceFreeHeat.lean index d2942fd0dd..9ed76a96fa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DivergenceFreeHeat.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DivergenceFreeHeat.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.VolterraFixedPoint /-! The actual Gaussian heat and Volterra integrals preserve the lifted divergence constraint. -/ -@[expose] public section +public section noncomputable section @@ -54,13 +54,14 @@ theorem gradientProjection_cylinderHeat (κ : ℝ) (m : Vector3) (v : ℝ≥0) ( gradientProjection_heatList period κ m cylinderDirections v f /-- The continuous constraint map on an actual complete Sobolev space. -/ -def gradientEvaluation (q : ℕ) (κ : ℝ) (m : Vector3) : SobolevSpace period q →L[ℝ] LiftL2 period := +@[expose] def gradientEvaluation (q : ℕ) (κ : ℝ) (m : Vector3) : + SobolevSpace period q →L[ℝ] LiftL2 period := (gradientProjection period κ m).comp (valueOperator period q) /-- The Sobolev constraint is exactly the underlying lifted L² gradient projection. -/ @[simp] theorem gradientEvaluation_apply {q : ℕ} (κ : ℝ) (m : Vector3) (u : SobolevSpace period q) : - gradientEvaluation period q κ m u = gradientProjection period κ m (value period u) := rfl + gradientEvaluation period q κ m u = gradientProjection period κ m (value period u) := by rfl /-- Vanishing of the continuous constraint map is exactly membership in the genuine divergence-free subspace. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBootstrap.lean b/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBootstrap.lean index 9c460ed30d..a2e9d129c8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBootstrap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBootstrap.lean @@ -33,7 +33,7 @@ section /-! Separate the full background norm from the drift norm in the radius-loss term. -/ -@[expose] public section +public section noncomputable section @@ -101,7 +101,7 @@ section /-! Actual transport and pressure bounds retaining the small four-component drift norm. -/ -@[expose] public section +public section noncomputable section @@ -208,7 +208,7 @@ end end -@[expose] public section +public section noncomputable section @@ -338,7 +338,7 @@ section /-! Actual nonlinear correction forcing with distinct full-velocity and drift factors. -/ -@[expose] public section +public section noncomputable section @@ -534,7 +534,7 @@ section /-! Actual nonlinear forcing with separate full-background and drift envelopes. -/ -@[expose] public section +public section noncomputable section @@ -663,7 +663,7 @@ end end -@[expose] public section +public section noncomputable section @@ -769,7 +769,7 @@ section /-! Continuous energy majorants that retain the actual small transport drift. -/ -@[expose] public section +public section noncomputable section @@ -856,7 +856,7 @@ section /-! The actual time-dependent correction forcing obeys the sharp drift majorant. -/ -@[expose] public section +public section noncomputable section @@ -937,7 +937,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1025,7 +1025,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBudget.lean index ba4dc67c16..7426858dfa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DriftCorrectionBudget.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevDriftNorm /-! Genuine correction data with separate full-velocity and transport-drift bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/DriftGevreyInviscidEnergyCompactness.lean b/LeanPool/NavierStokesAndEuler/Euler/DriftGevreyInviscidEnergyCompactness.lean index 3626eb8843..7b66b08e63 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DriftGevreyInviscidEnergyCompactness.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DriftGevreyInviscidEnergyCompactness.lean @@ -25,7 +25,7 @@ section /-! The actual nonlinear Gevrey bootstrap applies uniformly to every partial correction solution. -/ -@[expose] public section +public section noncomputable section @@ -103,7 +103,7 @@ end end -@[expose] public section +public section noncomputable section @@ -200,7 +200,7 @@ section /-! Drift-aware version: A genuine uniformly bounded viscous approximation family with a uniformly vanishing PDE viscosity term. -/ -@[expose] public section +public section noncomputable section @@ -265,7 +265,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/DuhamelDifferentiation.lean b/LeanPool/NavierStokesAndEuler/Euler/DuhamelDifferentiation.lean index 39f99b5955..f3fbc6768f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DuhamelDifferentiation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DuhamelDifferentiation.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.ParametricIntegral /-! Differentiation of the actual heat Duhamel integral in L² from finite Sobolev forcing. -/ -@[expose] public section +public section noncomputable section @@ -63,12 +63,12 @@ theorem shiftedHeat_continuous {q : ℕ} (ν T : ℝ) (hT : 0 ≤ T) (f := fun s : ℝ => (t - s, extendPath T hT f s)) (heatFlow_joint_continuous period q ν) hp /-- The ordinary, actual Sobolev heat Duhamel integral. -/ -def duhamel {q : ℕ} (ν T : ℝ) (hT : 0 ≤ T) +@[expose] def duhamel {q : ℕ} (ν T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) (t : ℝ) : SobolevSpace period q := ∫ s in (0 : ℝ)..t, heatFlow period q ν (t - s) (extendPath T hT f s) /-- A fixed-interval heat integral whose L² derivative can be taken under the integral sign. -/ -def fullDuhamel {q : ℕ} (ν T : ℝ) (hT : 0 ≤ T) +@[expose] def fullDuhamel {q : ℕ} (ν T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) (t : ℝ) : SobolevSpace period q := ∫ s in (0 : ℝ)..T, heatFlow period q ν (t - s) (extendPath T hT f s) @@ -87,7 +87,7 @@ theorem fullDuhamel_value {q : ℕ} (ν T : ℝ) (hT : 0 ≤ T) /-- The actual parameter derivative of the full heat integrand away from its measure-zero diagonal. -/ -def derivativeIntegrand {q : ℕ} (hq : 2 ≤ q) (ν T : ℝ) (hT : 0 ≤ T) +@[expose] def derivativeIntegrand {q : ℕ} (hq : 2 ≤ q) (ν T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, SobolevSpace period q)) (t s : ℝ) : LiftL2 period := (Iic t).indicator (fun s => ν • laplacianEvaluation period q hq (heatFlow period q ν (t - s) (extendPath T hT f s))) s diff --git a/LeanPool/NavierStokesAndEuler/Euler/DuhamelPasting.lean b/LeanPool/NavierStokesAndEuler/Euler/DuhamelPasting.lean index d81b9c8915..52cbdfe2be 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/DuhamelPasting.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/DuhamelPasting.lean @@ -14,7 +14,7 @@ section /-! Exact restart identities for the genuine cylinder heat and Bochner Duhamel integrals. -/ -@[expose] public section +public section noncomputable section @@ -98,7 +98,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathGluing.lean b/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathGluing.lean index c289d04b49..9da4ac35f9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathGluing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathGluing.lean @@ -32,7 +32,7 @@ section /-! Genuine first-order evolution paths glue through a matching interior trace. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -248,7 +248,7 @@ section /-! Matching time paths glue without any external-word or fixed-Sobolev loss. -/ -@[expose] public section +public section noncomputable section @@ -264,7 +264,7 @@ attribute [local instance] compactInterval @[simp] theorem glueOperator_apply (S τ : ℝ) (hτ0 : 0 ≤ τ) (hτS : τ ≤ S) (u : Matching (E := E) S τ hτ0 hτS) : - glueOperator S τ hτ0 hτS u = gluePath S τ hτ0 hτS u := rfl + glueOperator S τ hτ0 hτS u = gluePath S τ hτ0 hτS u := by rfl theorem gluePath_left (S τ : ℝ) (hτ0 : 0 ≤ τ) (hτS : τ ≤ S) (u : Matching (E := E) S τ hτ0 hτS) (t : Icc (0 : ℝ) τ) : @@ -325,7 +325,7 @@ end end -@[expose] public section +public section noncomputable section @@ -440,7 +440,7 @@ section /-! The actual affine time shift used by the forward transverse solve. -/ -@[expose] public section +public section noncomputable section @@ -464,8 +464,9 @@ def shiftPath (S τ : ℝ) : C(Icc (0 : ℝ) (S-τ), E) →L[ℝ] C(Icc τ S,E) ContinuousMap.compCLM ℝ E (elapsedTime S τ) theorem shiftPath_apply (S τ : ℝ) (u : C(Icc (0 : ℝ) (S - τ), E)) (t : Icc τ S) : - shiftPath S τ u t = u ⟨(t:ℝ)-τ,sub_nonneg.mpr t.property.1,sub_le_sub_right t.property.2 τ⟩ := - rfl + shiftPath S τ u t = + u ⟨(t:ℝ)-τ,sub_nonneg.mpr t.property.1,sub_le_sub_right t.property.2 τ⟩ := by + rfl theorem shiftPath_norm_le_one (S τ : ℝ) : ‖shiftPath (E := E) S τ‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one @@ -494,7 +495,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathNaturality.lean b/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathNaturality.lean index 0b67f5d710..62a68ca5df 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathNaturality.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathNaturality.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.LpCylinderTranslation /-! Bounded spatial maps and mixed derivative words commute with the actual elapsed-time join. -/ -@[expose] public section +public section noncomputable section @@ -36,11 +36,35 @@ theorem join_map (L : E →L[ℝ] F) : (L.compLeftContinuous ℝ (Icc (0 : ℝ) (S-τ)) v) (congrArg L hm) := by apply ContinuousMap.ext intro t - change L (if (t : ℝ) ≤ τ then u (projIcc 0 τ hτ0 t) - else v (elapsedTime S τ (projIcc τ S hτS t))) = - if (t : ℝ) ≤ τ then L (u (projIcc 0 τ hτ0 t)) - else L (v (elapsedTime S τ (projIcc τ S hτS t))) - split <;> rfl + change L (join S τ hτ0 hτS u v hm t) = + join S τ hτ0 hτS + (L.compLeftContinuous ℝ (Icc (0 : ℝ) τ) u) + (L.compLeftContinuous ℝ (Icc (0 : ℝ) (S-τ)) v) (congrArg L hm) t + by_cases ht : (t : ℝ) ≤ τ + · let s : Icc (0 : ℝ) τ := ⟨t, t.property.1, ht⟩ + rw [show join S τ hτ0 hτS u v hm t = u s from + join_left S τ hτ0 hτS u v hm s, + show join S τ hτ0 hτS + (L.compLeftContinuous ℝ (Icc (0 : ℝ) τ) u) + (L.compLeftContinuous ℝ (Icc (0 : ℝ) (S-τ)) v) + (congrArg L hm) t = + (L.compLeftContinuous ℝ (Icc (0 : ℝ) τ) u) s from + join_left S τ hτ0 hτS _ _ _ s] + rfl + · let s : Icc τ S := ⟨t, le_of_lt (lt_of_not_ge ht), t.property.2⟩ + rw [show join S τ hτ0 hτS u v hm t = + v ⟨(s : ℝ)-τ, sub_nonneg.mpr s.property.1, + sub_le_sub_right s.property.2 τ⟩ from + join_right S τ hτ0 hτS u v hm s, + show join S τ hτ0 hτS + (L.compLeftContinuous ℝ (Icc (0 : ℝ) τ) u) + (L.compLeftContinuous ℝ (Icc (0 : ℝ) (S-τ)) v) + (congrArg L hm) t = + (L.compLeftContinuous ℝ (Icc (0 : ℝ) (S-τ)) v) + ⟨(s : ℝ)-τ, sub_nonneg.mpr s.property.1, + sub_le_sub_right s.property.2 τ⟩ from + join_right S τ hτ0 hτS _ _ _ s] + rfl end EulerElapsedTimePathGluing diff --git a/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathWeight.lean index f06ba557d0..bd3a8aaf96 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ElapsedTimePathWeight.lean @@ -21,7 +21,7 @@ continuous profile on the elapsed forward interval. Normalization commutes with the actual join, without estimating either extremum of the profile. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/EnergyForcingIdentity.lean b/LeanPool/NavierStokesAndEuler/Euler/EnergyForcingIdentity.lean index 5baa9c3ae5..6dba0ace24 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EnergyForcingIdentity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EnergyForcingIdentity.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.GevreyDifferentiatedEquation /-! Exact identification of the limiting actual metric forcing with the seven spatial correction terms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/EnergyMetricPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/EnergyMetricPaths.lean index 640d1cff97..319f3ef962 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EnergyMetricPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EnergyMetricPaths.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevEnergyPaths /-! Actual metric Gevrey energy and radius loss as continuous paths, with exact higher-representative compatibility. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/EnergyWordCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/EnergyWordCoordinates.lean index d4dfe1e6ce..c46e08bd18 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EnergyWordCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EnergyWordCoordinates.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevWordBlockCoordinates /-! Exact concatenated coordinates connecting energy regularization to the actual external/base Gevrey forcing. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerC1Breakdown.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerC1Breakdown.lean index cc6710808a..fd45876b79 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EulerC1Breakdown.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EulerC1Breakdown.lean @@ -22,7 +22,7 @@ section /-! The full smooth initial datum retains the common support of its finite initial base and its actual summable packet increments. -/ -@[expose] public section +public section noncomputable section @@ -80,7 +80,7 @@ section whose ordinary smooth Euler solutions have a finite maximal horizon. The separate continuation and vorticity criteria are not asserted here. -/ -@[expose] public section +public section noncomputable section @@ -134,7 +134,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerC1Limsup.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerC1Limsup.lean index e046dbf2d0..e5e988e976 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EulerC1Limsup.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EulerC1Limsup.lean @@ -13,7 +13,7 @@ import Mathlib.Topology.Order.AtTopBotIxx is the pullback of the ordinary left-neighborhood filter, so its meaning does not depend on a chosen sequence of sampling times. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionEquation.lean index 3b130a960a..8867bd5869 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionEquation.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevPressureResolvent /-! The constructed local viscous Euler correction satisfies the actual differential equation and pressure constraint. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ def CorrectionData.rawSource {q : ℕ} {T : Type*} [TopologicalSpace T] /-- The correction pressure is the actual unique coercive gradient solution with the sign of equation (17). -/ -def CorrectionData.pressure {q : ℕ} {T : Type*} [TopologicalSpace T] +@[expose] def CorrectionData.pressure {q : ℕ} {T : Type*} [TopologicalSpace T] (D : CorrectionData period q T) (hq : 6 ≤ q) (t : T) (e : SobolevSpace period (q + 1)) : SobolevSpace period q := -(pressureSobolevOperator period (D.metric.jet t) D.κ D.direction D.coercivity D.coercivity_pos diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionLocal.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionLocal.lean index 3142bbb4e9..58840fb597 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionLocal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EulerCorrectionLocal.lean @@ -29,7 +29,7 @@ section /-! Local boundedness, continuity, and differentiation derived from an exact operator resolvent identity. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ section /-! Time regularity of the actual Sobolev pressure inverse, derived from its genuine resolvent. -/ -@[expose] public section +public section noncomputable section @@ -216,7 +216,7 @@ end end -@[expose] public section +public section noncomputable section @@ -356,7 +356,7 @@ section /-! The local quadratic heat construction preserves the actual lifted divergence constraint. -/ -@[expose] public section +public section noncomputable section @@ -405,7 +405,7 @@ end end -@[expose] public section +public section noncomputable section @@ -437,7 +437,7 @@ structure CoefficientPath (q : ℕ) (T : Type*) [TopologicalSpace T] where continuous : Continuous (fun t => coefficientSobolevOperator period (jet t)) /-- The path acts by actual pointwise multiplication at each time. -/ -def CoefficientPath.operatorPath {q : ℕ} {T : Type*} [TopologicalSpace T] +@[expose] def CoefficientPath.operatorPath {q : ℕ} {T : Type*} [TopologicalSpace T] (A : CoefficientPath period q T) : C(T, SobolevSpace period q →L[ℝ] SobolevSpace period q) := ⟨fun t => coefficientSobolevOperator period (A.jet t), A.continuous⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/EulerSingularity.lean b/LeanPool/NavierStokesAndEuler/Euler/EulerSingularity.lean index 65ff884006..096d60ec6f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/EulerSingularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/EulerSingularity.lean @@ -32,7 +32,7 @@ section /-! The genuine zero Euler solution rules out zero initial data for a positive finite maximal lifespan. -/ -@[expose] public section +public section noncomputable section @@ -90,7 +90,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedGraphPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedGraphPressure.lean index ac29fd68df..8492a5611b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedGraphPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedGraphPressure.lean @@ -18,7 +18,7 @@ section /-! Genuine lifted divergence-free fields remain divergence-free on the oscillating graph. -/ -@[expose] public section +public section noncomputable section @@ -75,7 +75,7 @@ end end -@[expose] public section +public section noncomputable section @@ -89,7 +89,7 @@ variable {P T : ℝ} [Fact (0 < P)] {hT : 0 < T} {A : Data P T} {B : Budget P hT (S : ExactLiftedPacket P hT A B) /-- Graph pressure, given by `A.κ • S.pressure.pointField t (cylinderGraph P k A.direction x)`. -/ -def graphPressure (k : ℝ) (t : Icc (0 : ℝ) T) (x : Vector3) : Vector3 := +@[expose] def graphPressure (k : ℝ) (t : Icc (0 : ℝ) T) (x : Vector3) : Vector3 := A.κ • S.pressure.pointField t (cylinderGraph P k A.direction x) theorem graphPressure_joint_continuous (k : ℝ) : @@ -131,7 +131,7 @@ theorem graphPotential_gradient (k : ℝ) (hk : k * A.κ = 1) (Continuous.uncurry_left t (S.graphPressure_joint_continuous k)) q hq hgrad x /-- Raw graph potential, given by `S.graphPotential k (projIcc 0 T hT.le q.1) q.2`. -/ -def rawGraphPotential (k : ℝ) (q : ℝ × Vector3) : ℝ := +@[expose] def rawGraphPotential (k : ℝ) (q : ℝ × Vector3) : ℝ := S.graphPotential k (projIcc 0 T hT.le q.1) q.2 theorem rawGraphPotential_smooth (k : ℝ) (hk : k * A.κ = 1) (t : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedJointDifferentiability.lean b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedJointDifferentiability.lean index b396c7c95e..c520a156c0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedJointDifferentiability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedJointDifferentiability.lean @@ -21,7 +21,7 @@ section Strong continuity on the derivative vector suffices; operator-norm continuity or differentiability of the whole family of evaluation maps is unnecessary. -/ -@[expose] public section +public section noncomputable section @@ -91,7 +91,7 @@ end end -@[expose] public section +public section noncomputable section @@ -105,7 +105,7 @@ open scoped ContDiff variable {P T : ℝ} [Fact (0 < P)] (A : FieldTower P T) /-- Raw field, given by `A.pointField (projIcc 0 T hT q.1) (coveringMap P q.2)`. -/ -def rawField (hT : 0 ≤ T) (q : ℝ × LiftTangent) : Vector3 := +@[expose] def rawField (hT : 0 ≤ T) (q : ℝ × LiftTangent) : Vector3 := A.pointField (projIcc 0 T hT q.1) (coveringMap P q.2) theorem rawField_hasFDerivAt (hT : 0 ≤ T) (t : ℝ) (ht : t ∈ Icc 0 T) @@ -141,9 +141,9 @@ variable {P T : ℝ} [Fact (0 < P)] {hT : 0 < T} {A : Data P T} {B : Budget P hT (S : ExactLiftedPacket P hT A B) /-- Raw velocity, given by `S.velocity.rawField hT.le`. -/ -def rawVelocity : ℝ × LiftTangent → Vector3 := S.velocity.rawField hT.le +@[expose] def rawVelocity : ℝ × LiftTangent → Vector3 := S.velocity.rawField hT.le /-- Raw pressure, given by `S.pressure.rawField hT.le`. -/ -def rawPressure : ℝ × LiftTangent → Vector3 := S.pressure.rawField hT.le +@[expose] def rawPressure : ℝ × LiftTangent → Vector3 := S.pressure.rawField hT.le theorem rawVelocity_hasFDerivAt (t : ℝ) (ht : t ∈ Ioo 0 T) (z : LiftTangent) : HasFDerivAt S.rawVelocity diff --git a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedPointwise.lean b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedPointwise.lean index 28c8f8f8fd..d83446521e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedPointwise.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ExactLiftedPointwise.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevPointMultiplication /-! The exact Sobolev equation is the literal pointwise normalized equation for the canonical smooth representatives. No pointwise PDE is assumed. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ private theorem coefficient_value_ae (C : SmoothCoefficient P) exact hc.trans (congrArg (C.coefficient x) hf) /-- Point nonlinearity as an element of `Vector3`. -/ -def pointNonlinearity (A : Data P T) (Z : FieldTower P T) +@[expose] def pointNonlinearity (A : Data P T) (Z : FieldTower P T) (t : Icc (0 : ℝ) T) (x : LiftDomain P) : Vector3 := (A.linear.coefficient t).coefficient x (Z.pointField t x) + fieldFDeriv P (Z.pointField t) x (transportDirection A.κ A.direction (Z.pointField t x)) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean b/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean index 9c7519e755..976590e39f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean @@ -26,7 +26,7 @@ section /-! Mixed derivative product estimates with only five total derivatives, for the base transport commutator. -/ -@[expose] public section +public section noncomputable section @@ -167,7 +167,7 @@ section /-! Actual outer derivatives of mixed products, with a fixed total derivative budget. -/ -@[expose] public section +public section noncomputable section @@ -227,6 +227,7 @@ theorem mixed_outer_product_bound {n k l : ℕ} (hnkl : n + k + l ≤ 5) (fun x => F x • fieldDerivative period (standardDirection i) G x) x) := fun x => (hF x).smul (fieldDerivative_smooth period _ G hG x) rw [word_add period (Fin.init a) _ _ hleft hright] + simp only [iteratedFieldDerivative_succ, Fin.cons_zero, Fin.tail_cons] rfl change MemLp (iteratedFieldDerivative period a (fun x => F x • G x)) 2 (liftMeasure period) ∧ _ rw [he] @@ -241,7 +242,7 @@ end end -@[expose] public section +public section noncomputable section @@ -283,7 +284,8 @@ theorem derivative_memLp_five {F : Type*} [NormedAddCommGroup F] [NormedSpace MemLp (iteratedFieldDerivative period w (fieldDerivative period (standardDirection i) f)) 2 (liftMeasure period) := by intro j hj w - exact word_memLp period (by omega : 1+j ≤ 6) w (fun _ : Fin 1 => i) f hfL + simpa only [iteratedFieldDerivative_succ, iteratedFieldDerivative_zero] using + word_memLp period (by omega : 1+j ≤ 6) w (fun _ : Fin 1 => i) f hfL /-- The literal differential commutator D^w(fg)−f D^w g. -/ def scalarCommutator {n : ℕ} (w : Fin n → Fin 4) @@ -341,6 +343,8 @@ theorem mixed_scalarCommutator_bound {n l : ℕ} (hnl : n + l ≤ 6) (fieldDerivative period (standardDirection i) f) g (fieldDerivative_smooth period _ f hf) hg (derivative_memLp_five period f hfL i) hgL have h2 := ih (by omega : n+(l+1) ≤ 6) (Fin.init w) (Fin.cons i v) + simp only [iteratedFieldDerivative_zero] at h1 + simp only [iteratedFieldDerivative_succ, Fin.cons_zero, Fin.tail_cons] at h2 have h3 : (eLpNorm (iteratedFieldDerivative period (Fin.init w) (fun x => fieldDerivative period (standardDirection i) f x • iteratedFieldDerivative period v g x)) @@ -367,7 +371,8 @@ theorem scalarCommutator_bound {n : ℕ} (hn : n ≤ 6) (w : Fin n → Fin 4) (eLpNorm (scalarCommutator period w f g) 2 (liftMeasure period)).toReal ≤ ((2 : ℝ)^n-1) * mixedConstant period * gradientFiveNorm period f * liftSobolevNorm period 5 g := by - exact mixed_scalarCommutator_bound period (by omega : n+0 ≤ 6) w Fin.elim0 f g hf hg hfL hgL + simpa only [iteratedFieldDerivative_zero] using + mixed_scalarCommutator_bound period (by omega : n+0 ≤ 6) w Fin.elim0 f g hf hg hfL hgL end EulerBaseTransportCommutator @@ -381,7 +386,7 @@ section /-! Actual fixed-H⁶ external scalar multiplication commutators with positive-order binomial bounds. -/ -@[expose] public section +public section noncomputable section @@ -416,11 +421,11 @@ theorem word_sub {n : ℕ} (w : Fin n → Fin 4) (f g : LiftDomain period → F) iteratedFieldDerivative period w (f-g) = iteratedFieldDerivative period w f-iteratedFieldDerivative period w g := by induction n with - | zero => rfl + | zero => simp only [iteratedFieldDerivative_zero] | succ n ih => rw [iteratedFieldDerivative_succ, ih (Fin.tail w), fieldDerivative_sub period _ _ _ (iteratedFieldDerivative_smooth period _ f hf) (iteratedFieldDerivative_smooth period _ g hg)] - rfl + simp only [iteratedFieldDerivative_succ] end Subtraction @@ -543,7 +548,7 @@ end end -@[expose] public section +public section noncomputable section @@ -567,9 +572,9 @@ theorem word_derivative_comm {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ iteratedFieldDerivative period w (fieldDerivative period a f) = fieldDerivative period a (iteratedFieldDerivative period w f) := by induction n with - | zero => rfl + | zero => simp only [iteratedFieldDerivative_zero] | succ n ih => - rw [iteratedFieldDerivative_succ, ih (Fin.tail w)] + rw [iteratedFieldDerivative_succ, ih (Fin.tail w), iteratedFieldDerivative_succ] funext x exact fieldDerivatives_commute period _ _ _ (iteratedFieldDerivative_smooth period (Fin.tail w) f hf) x diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerAlgebra.lean index c32976a6c7..8c1d0828ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerAlgebra.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.FieldTowerRepresentative /-! Actual algebra of coherent all-order fields, including multiplication by the genuine coefficient towers of the source deformation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerCanonicalGraph.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerCanonicalGraph.lean index a35d333d55..9aab802bee 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerCanonicalGraph.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerCanonicalGraph.lean @@ -25,7 +25,7 @@ section uniform over every continuous phase graph, including arbitrarily high oscillation frequencies. -/ -@[expose] public section +public section noncomputable section @@ -104,7 +104,7 @@ section /-! Restriction to a fixed continuous phase graph preserves time continuity in actual spatial L². The proof uses the uniform trace estimate for differences. -/ -@[expose] public section +public section noncomputable section @@ -181,7 +181,7 @@ end end -@[expose] public section +public section noncomputable section @@ -290,7 +290,7 @@ section /-! The graph trace estimate applies to the actual affine remainder in a derivative quotient, with the same constants for all phase frequencies. -/ -@[expose] public section +public section noncomputable section @@ -353,7 +353,7 @@ end end -@[expose] public section +public section noncomputable section @@ -438,7 +438,7 @@ section /-! Genuine Sobolev time derivatives of coherent towers pass to actual spatial L² derivatives after restriction to any fixed phase graph. -/ -@[expose] public section +public section noncomputable section @@ -508,7 +508,7 @@ section /-! A genuine derivative at one Sobolev order gives the same derivative at all lower orders of the coherent towers. -/ -@[expose] public section +public section noncomputable section @@ -568,7 +568,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerGraphGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerGraphGevrey.lean index 574571775c..ad8b0927f7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerGraphGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerGraphGevrey.lean @@ -20,7 +20,7 @@ ordinary three-dimensional smooth L² slices and bounded coefficient paths. The zero-angle restriction costs one fixed radius enlargement, independent of the derivative order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerJetLp.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerJetLp.lean index 6c7ee4cdc5..a54a9c21a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerJetLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerJetLp.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.StrongSmoothJet their actual cylinder L² bounds. The estimate selects a summand of the weighted H6 norm and has no loss depending on the derivative order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalContinuity.lean index 57e2bc760c..b41931b37e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalContinuity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalContinuity.lean @@ -20,7 +20,7 @@ section /-! The physical tensor estimate controls differences of actual L² representatives, which supplies time continuity without a domination premise. -/ -@[expose] public section +public section noncomputable section @@ -79,7 +79,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalL2.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalL2.lean index e8dcb1e262..668ab43a08 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalL2.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPhysicalL2.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderPhysicalTensorLp /-! Canonical spatial fields and all their actual derivative tensors are in physical L². Their bounds have only explicit polynomial frequency loss. -/ -@[expose] public section +public section noncomputable section @@ -23,7 +23,7 @@ open InnerProductSpace EulerLiftedGradientSpace EulerMetricTransport EulerCylinderCoordinates /-- Physical phase, given by `(k*inner ℝ m x : ℝ)`. -/ -def physicalPhase (P k : ℝ) (m : Vector3) (x : Vector3) : AddCircle P := +@[expose] def physicalPhase (P k : ℝ) (m : Vector3) (x : Vector3) : AddCircle P := (k*inner ℝ m x : ℝ) theorem physicalPhase_continuous (P k : ℝ) (m : Vector3) : @@ -51,7 +51,7 @@ variable {P T : ℝ} [Fact (0 < P)] (A : EulerAllOrderCorrectionData.FieldTower (k : ℝ) (m : Vector3) /-- Physical point field, given by `physicalField P k m (A.pointField t)`. -/ -def physicalPointField (t : Icc (0 : ℝ) T) : Vector3 → Vector3 := +@[expose] def physicalPointField (t : Icc (0 : ℝ) T) : Vector3 → Vector3 := physicalField P k m (A.pointField t) theorem physicalPointField_smooth (t : Icc (0 : ℝ) T) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPointwiseGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPointwiseGevrey.lean index 5d7f750f4b..135048976c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPointwiseGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerPointwiseGevrey.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.FieldTowerRepresentative /-! Actual pointwise mixed derivatives from the finite weighted Sobolev norms of one coherent field tower. No pointwise estimate is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerRepresentative.lean index 0df9cb5aed..82ed75180d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerRepresentative.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevJointEvaluation /-! Canonical smooth pointwise representatives of any genuine all-order field tower. All spatial regularity follows from its actual Sobolev jets. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerSmoothTimeField.lean b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerSmoothTimeField.lean index 17f297fe39..eade427d19 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FieldTowerSmoothTimeField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FieldTowerSmoothTimeField.lean @@ -26,7 +26,7 @@ field. This is a qualitative finite-dimensional construction; subsequent norm estimates can use the actual tensor equality without a coordinate reassembly constant. -/ -@[expose] public section +public section noncomputable section @@ -150,7 +150,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteEnergyTruncation.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteEnergyTruncation.lean index 84a084c81e..700a1e3b36 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteEnergyTruncation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteEnergyTruncation.lean @@ -27,7 +27,7 @@ gives compact smooth divergence-free velocities that agree with `u` on any prescribed ball. This construction does not assume Sobolev regularity of `u`. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -41,7 +41,7 @@ open scoped ContDiff Topology namespace Euler.ComparatorBridge /-- The coordinate potential `-x × u(x)`. -/ -def negativeCrossPotential (u : Space → Space) (i : Fin 3) (x : Space) : ℝ := +@[expose] def negativeCrossPotential (u : Space → Space) (i : Fin 3) (x : Space) : ℝ := x (i + 2) * u x (i + 1) - x (i + 1) * u x (i + 2) theorem negativeCrossPotential_smooth (u : Space → Space) @@ -89,7 +89,7 @@ theorem curl_negativeCrossPotential PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, hd] <;> ring /-- The radial average whose negative cross product is a vector potential. -/ -def radialAverage (u : Space → Space) (x : Space) : Space := +@[expose] def radialAverage (u : Space → Space) (x : Space) : Space := ∫ t in (0 : ℝ)..1, t • u (t • x) /-- A smooth velocity gives a jointly smooth radial integrand. -/ @@ -195,7 +195,7 @@ theorem radialAverage_radial_identity simpa using ht /-- The concrete radial vector potential, in the development's curl convention. -/ -def radialPotential (u : Space → Space) : Fin 3 → Space → ℝ := +@[expose] def radialPotential (u : Space → Space) : Fin 3 → Space → ℝ := negativeCrossPotential (radialAverage u) theorem radialPotential_smooth (u : Space → Space) (hu : ContDiff ℝ ∞ u) @@ -212,7 +212,7 @@ theorem curl_radialPotential (u : Space → Space) (hu : ContDiff ℝ ∞ u) exact radialAverage_radial_identity u hu x /-- Cut off the constructed potential, then take its actual curl. -/ -def potentialTruncation (u : Space → Space) (χ : Space → ℝ) : Space → Space := +@[expose] def potentialTruncation (u : Space → Space) (χ : Space → ℝ) : Space → Space := curl (fun i x => χ x * radialPotential u i x) theorem potentialTruncation_smooth (u : Space → Space) (hu : ContDiff ℝ ∞ u) diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean index e72f7a2a94..3735db190c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.FieldSimp /-! Exact finite graded identities for the literal packet residual. -/ -@[expose] public section +public section noncomputable section @@ -30,15 +30,16 @@ variable {V W Q : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup W] [Module ℝ W] [AddCommGroup Q] [Module ℝ Q] /-- Evaluate, given by `∑ n ∈ range (M+1), κ^n • u n`. -/ -def evaluate (M : ℕ) (κ : ℝ) (u : ℕ → V) : V := +@[expose] def evaluate (M : ℕ) (κ : ℝ) (u : ℕ → V) : V := ∑ n ∈ range (M+1), κ^n • u n /-- Truncate, with branches according to `n ≤ M`. -/ +@[expose] def truncate (M : ℕ) (u : ℕ → V) (n : ℕ) : V := if n ≤ M then u n else 0 /-- Convolution, given by `∑ i ∈ range (M+1), ∑ j ∈ range (M+1), if i+j=n then B (u i) (v j) else 0`. -/ -def convolution (M : ℕ) (B : V →ₗ[ℝ] W →ₗ[ℝ] Q) (u : ℕ → V) (v : ℕ → W) (n : ℕ) : Q := +@[expose] def convolution (M : ℕ) (B : V →ₗ[ℝ] W →ₗ[ℝ] Q) (u : ℕ → V) (v : ℕ → W) (n : ℕ) : Q := ∑ i ∈ range (M+1), ∑ j ∈ range (M+1), if i+j=n then B (u i) (v j) else 0 theorem evaluate_add (M : ℕ) (κ : ℝ) (u v : ℕ → V) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAssembly.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAssembly.lean index 9a387cbd16..d4f1af32c4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAssembly.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.BigOperators.GroupWithZero.Action /-! Reindexing the literal primary/corrector packet into its actual power coefficients. -/ -@[expose] public section +public section noncomputable section @@ -24,12 +24,12 @@ open Finset variable {V : Type*} [AddCommGroup V] [Module ℝ V] /-- Shift up as an element of `ℕ → V | 0 => 0 | n+1 => truncate M u n`. -/ -def shiftUp (M : ℕ) (u : ℕ → V) : ℕ → V +@[expose] def shiftUp (M : ℕ) (u : ℕ → V) : ℕ → V | 0 => 0 | n+1 => truncate M u n /-- Assemble, given by `truncate M u n + shiftUp M c n`. -/ -def assemble (M : ℕ) (u c : ℕ → V) (n : ℕ) : V := +@[expose] def assemble (M : ℕ) (u c : ℕ → V) (n : ℕ) : V := truncate M u n + shiftUp M c n theorem evaluate_shiftUp (M : ℕ) (κ : ℝ) (u : ℕ → V) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeDiagonal.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeDiagonal.lean index 44c466f2fc..d951967149 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeDiagonal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeDiagonal.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset /-! The finite residual convolution is exactly the source's sum over i+j=n. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeSupport.lean index b563035a9b..78d9d40073 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeSupport.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.BigOperators.Intervals /-! Degree bounds and the exact shift caused by a fast derivative. -/ -@[expose] public section +public section noncomputable section @@ -52,7 +52,7 @@ theorem evaluate_truncate_extend (M N : ℕ) (hMN : M ≤ N) (κ : ℝ) (u : ℕ (evaluate_truncate M κ u) /-- Shift down, given by `truncate M u (n+1)`. -/ -def shiftDown (M : ℕ) (u : ℕ → V) (n : ℕ) : V := truncate M u (n+1) +@[expose] def shiftDown (M : ℕ) (u : ℕ → V) (n : ℕ) : V := truncate M u (n+1) omit [Module ℝ V] in theorem shiftDown_above (M n : ℕ) (u : ℕ → V) (hn : M ≤ n) : shiftDown M u n = 0 := diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteMetricEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteMetricEnergy.lean index 63361d2f03..50463d3087 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteMetricEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteMetricEnergy.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.SpecialFunctions.Sqrt /-! Finite sums of genuine Hilbert metric energies, with viscosity and explicit norm comparison. -/ -@[expose] public section +public section noncomputable section @@ -30,16 +30,16 @@ open scoped Topology variable {ι H : Type*} [Fintype ι] [NormedAddCommGroup H] [InnerProductSpace ℝ H] /-- The square of the Hilbert norm of a finite family. -/ -def familySquaredNorm (v : ι → H) : ℝ := ∑ i, ‖v i‖ ^ 2 +@[expose] def familySquaredNorm (v : ι → H) : ℝ := ∑ i, ‖v i‖ ^ 2 /-- The Hilbert norm of a finite family, expressed without choosing a product-space model. -/ -def familyNorm (v : ι → H) : ℝ := √(familySquaredNorm v) +@[expose] def familyNorm (v : ι → H) : ℝ := √(familySquaredNorm v) /-- The actual sum of metric quadratic energies of a finite family. -/ -def familyEnergy (K : H →L[ℝ] H) (v : ι → H) : ℝ := ∑ i, ⟪K (v i), v i⟫_ℝ +@[expose] def familyEnergy (K : H →L[ℝ] H) (v : ι → H) : ℝ := ∑ i, ⟪K (v i), v i⟫_ℝ /-- The source's square root of the sum of all base-word metric energies. -/ -def familyMetricNorm (K : H →L[ℝ] H) (v : ι → H) : ℝ := √(familyEnergy K v) +@[expose] def familyMetricNorm (K : H →L[ℝ] H) (v : ι → H) : ℝ := √(familyEnergy K v) omit [InnerProductSpace ℝ H] in theorem familySquaredNorm_nonneg (v : ι → H) : 0 ≤ familySquaredNorm v := diff --git a/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensor.lean b/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensor.lean index 59cd8a1b56..2777549d49 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensor.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensor.lean @@ -17,7 +17,7 @@ genuine continuous path of tensors. Finite spatial coordinates establish continuity; the actual operator norm is preserved without a coordinate count in the bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensorIntegral.lean b/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensorIntegral.lean index 71fe9a50d2..7e961d17f9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensorIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FinitePathTensorIntegral.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ContinuousTimeIntegral Bochner time integral. These identities permit differentiation of a path-space integral equation at every spatial order. -/ -@[expose] public section +public section noncomputable section @@ -47,6 +47,8 @@ theorem tensorPath_integral (T : ℝ) (hT : 0 ≤ T) (n : ℕ) apply ContinuousMultilinearMap.ext intro v rw [tensorPathMap_apply] + simp only [ContinuousLinearMap.compContinuousMultilinearMap_coe, + Function.comp_apply, integral_apply, realIntegral] let ev : (E [×n]→L[ℝ] V) →L[ℝ] V := (ContinuousLinearMap.id ℝ (E [×n]→L[ℝ] V)).flipMultilinear v change (∫ s in (0 : ℝ)..(t : ℝ), extendPath T hT (A v) s) = diff --git a/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointClassical.lean b/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointClassical.lean index 12cb5910a4..77f203cfed 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointClassical.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointClassical.lean @@ -27,7 +27,7 @@ section /-! The actual continuous-time integral agrees with both Bochner primitive constructions. -/ -@[expose] public section +public section noncomputable section @@ -132,7 +132,7 @@ need only be orthogonal to the displacement, as for a constrained frame equation. No inverse or uniqueness assertion is assumed. -/ -@[expose] public section +public section noncomputable section @@ -207,7 +207,7 @@ end end -@[expose] public section +public section noncomputable section @@ -342,7 +342,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointStrong.lean b/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointStrong.lean index 1f3ca06700..bd7bc83c0d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointStrong.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FixedEndpointStrong.lean @@ -16,7 +16,7 @@ from its explicit coordinate primitive. No ambient normal, nor a supplied weak equation or smooth representative, is an input to these results. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionRegularity.lean index 521997590c..c98f0e1eac 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionRegularity.lean @@ -21,7 +21,7 @@ ones used in the history solution. Smooth coefficient and forcing parameters therefore give smooth continuous-time coordinate and physical velocities. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionSobolev.lean index 1f230b5ba6..d7db2c573b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FixedEvolutionSobolev.lean @@ -28,7 +28,7 @@ continuous Gram formula gives the time-uniform acceleration as well. All input and output external radii are identical. -/ -@[expose] public section +public section noncomputable section @@ -42,7 +42,7 @@ open Set ContinuousLinearMap InnerProductSpace EulerTimeLp EulerVolterraConvolut open scoped ContDiff /-- Trace cost, given by `T⁻¹*Real.sqrt T+2*Real.sqrt T`. -/ -def traceCost (T : ℝ) : ℝ := T⁻¹*Real.sqrt T+2*Real.sqrt T +@[expose] def traceCost (T : ℝ) : ℝ := T⁻¹*Real.sqrt T+2*Real.sqrt T theorem traceCost_nonneg (T : ℝ) (hT : 0 ≤ T) : 0 ≤ traceCost T := by unfold traceCost diff --git a/LeanPool/NavierStokesAndEuler/Euler/FlowEscapeBound.lean b/LeanPool/NavierStokesAndEuler/Euler/FlowEscapeBound.lean index 69a357db8c..51ec7beaeb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FlowEscapeBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FlowEscapeBound.lean @@ -22,7 +22,7 @@ spatial infinity. In particular, no global bound on the pointwise velocity or its derivatives is used in the escape estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FlowL2Transport.lean b/LeanPool/NavierStokesAndEuler/Euler/FlowL2Transport.lean index fe5b53c400..0137462f50 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FlowL2Transport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FlowL2Transport.lean @@ -13,7 +13,7 @@ public import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreser /-! A genuine determinant-one flow transports continuous spatial L² paths through its actual inverse, preserving the norm exactly. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/BreakdownCriterion.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/BreakdownCriterion.lean index 5cc9f3abff..b4196dfa95 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/BreakdownCriterion.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/BreakdownCriterion.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Ring.Star # Breakdown Criterion -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CoerciveProjection.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CoerciveProjection.lean index 7976e23a4d..b5deddbea2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CoerciveProjection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CoerciveProjection.lean @@ -15,7 +15,7 @@ hypothesis is an explicit quadratic inequality on the given bounded operator. This does not assert the Fourier or Sobolev realization of the pressure space. -/ -@[expose] public section +public section noncomputable section @@ -41,6 +41,7 @@ section Complete variable [CompleteSpace E] /-- Lax--Milgram constructs an equivalence from the operator's coercivity. -/ +@[expose] def coerciveEquiv (T : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hT : ∀ x, c * ‖x‖ ^ 2 ≤ ⟪T x, x⟫_ℝ) : E ≃L[ℝ] E := (operatorBilinear_coercive T c hc hT).continuousLinearEquivOfBilin @@ -54,6 +55,7 @@ theorem coerciveEquiv_apply (T : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) exact (operatorBilinear_coercive T c hc hT).continuousLinearEquivOfBilin_apply x y /-- The inverse operator constructed from the coercive Lax–Milgram equivalence. -/ +@[expose] def coerciveInverse (T : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hT : ∀ x, c * ‖x‖ ^ 2 ≤ ⟪T x, x⟫_ℝ) : E →L[ℝ] E := (coerciveEquiv T c hc hT).symm.toContinuousLinearMap @@ -141,7 +143,7 @@ section Subspace variable (S : Submodule ℝ E) [CompleteSpace S] /-- Orthogonal projection of the given ambient operator, restricted to the subspace. -/ -def projectedOperator (G : E →L[ℝ] E) : S →L[ℝ] S := +@[expose] def projectedOperator (G : E →L[ℝ] E) : S →L[ℝ] S := S.orthogonalProjectionOnto.comp (G.comp S.subtypeL) theorem projectedOperator_inner (G : E →L[ℝ] E) (x y : S) : @@ -155,7 +157,7 @@ theorem projectedOperator_coercive (G : E →L[ℝ] E) (c : ℝ) exact hG x /-- The projected-pressure inverse, constructed by applying Lax--Milgram on `S`. -/ -def projectedInverse (G : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) +@[expose] def projectedInverse (G : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hG : ∀ x, c * ‖x‖ ^ 2 ≤ ⟪G x, x⟫_ℝ) : S →L[ℝ] S := coerciveInverse (projectedOperator S G) c hc (projectedOperator_coercive S G c hG) @@ -203,7 +205,7 @@ theorem projectedInverse_norm_sub_le (G H : E →L[ℝ] E) (c d : ℝ) (mul_nonneg (inv_nonneg.2 hc.le) (inv_nonneg.2 hd.le)) /-- Solves the projected equation with an ambient forcing vector. -/ -def pressureSolver (G : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) +@[expose] def pressureSolver (G : E →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hG : ∀ x, c * ‖x‖ ^ 2 ≤ ⟪G x, x⟫_ℝ) : E →L[ℝ] S := (projectedInverse S G c hc hG).comp S.orthogonalProjectionOnto diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean index 2032ad1a7b..627eda6445 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Actual H⁶ multiplication on the three-dimensional cylinder. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean index 9d3e3a6813..1f3ea70e44 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace /-! Measure-preserving Euclidean coordinates and the actual L² bridge to the cylinder. -/ -@[expose] public section +public section noncomputable section @@ -50,10 +50,10 @@ noncomputable def coordinateEquiv : Domain 4 ≃L[ℝ] LiftTangent := coordinateLinearEquiv.toContinuousLinearEquiv @[simp] theorem coordinateEquiv_apply (z : Domain 4) : - coordinateEquiv z = (WithLp.toLp 2 (fun i : Fin 3 => z i.succ), z 0) := rfl + coordinateEquiv z = (WithLp.toLp 2 (fun i : Fin 3 => z i.succ), z 0) := by rfl @[simp] theorem coordinateEquiv_symm_apply (p : LiftTangent) : - coordinateEquiv.symm p = WithLp.toLp 2 (Fin.cons p.2 (fun i => p.1 i)) := rfl + coordinateEquiv.symm p = WithLp.toLp 2 (Fin.cons p.2 (fun i => p.1 i)) := by rfl /-- The coordinate change preserves the genuine product Lebesgue measure exactly. -/ theorem coordinateEquiv_measurePreserving : @@ -81,11 +81,11 @@ theorem covering_fundamental_measurePreserving (a : ℝ) : period a) /-- Euclidean coordinates for the actual quotient covering map. -/ -noncomputable def euclideanCover : Domain 4 → LiftDomain period := +@[expose] noncomputable def euclideanCover : Domain 4 → LiftDomain period := coveringMap period ∘ coordinateEquiv /-- Euclidean measure restricted to one fundamental angular strip. -/ -noncomputable def stripMeasure (a : ℝ) : Measure (Domain 4) := +@[expose] noncomputable def stripMeasure (a : ℝ) : Measure (Domain 4) := volume.restrict {z : Domain 4 | z 0 ∈ Set.Ioc a (a + period)} omit [Fact (0 < period)] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean index 7368a26c54..9d57712936 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.VectorCylinder /-! Actual full cylinder gradients from the coordinate derivative Sobolev norms. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,9 @@ theorem tangent_coordinate_norm_le (v : LiftTangent) (i : Fin 4) : ‖coordinateEquiv.symm v i‖ ≤ ‖v‖ := by cases i using Fin.cases with | zero => simpa using norm_snd_le v - | succ i => exact (PiLp.norm_apply_le v.1 i).trans (norm_fst_le v) + | succ i => + simpa only [coordinateEquiv_symm_apply, WithLp.ofLp_toLp, Fin.cons_succ] using + (PiLp.norm_apply_le v.1 i).trans (norm_fst_le v) omit [Fact (0 < period)] in /-- The full product-tangent operator norm is bounded by its four coordinate values. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGraphTrace.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGraphTrace.lean index fd299d5921..a6a984c8fc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGraphTrace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGraphTrace.lean @@ -25,7 +25,7 @@ section # Terminal Energy -/ -@[expose] public section +public section noncomputable section @@ -171,7 +171,7 @@ section # Interval Trace -/ -@[expose] public section +public section noncomputable section @@ -248,7 +248,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderMollifier.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderMollifier.lean index e954410f83..65f529bb8c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderMollifier.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderMollifier.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving /-! Genuine approximate identities for the lifted L² translation representation. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -58,7 +58,7 @@ theorem euclideanCover_zero : euclideanCover period 0 = 0 := by ext i <;> simp [euclideanCover, coveringMap] /-- The actual L² translation orbit in Euclidean covering coordinates. -/ -def orbit (f : LiftL2 period) (x : Domain 4) : LiftL2 period := +@[expose] def orbit (f : LiftL2 period) (x : Domain 4) : LiftL2 period := translation period (euclideanCover period x) f theorem orbit_continuous (f : LiftL2 period) : Continuous (orbit period f) := @@ -79,7 +79,7 @@ def mollifierBump (n : ℕ) : ContDiffBump (0 : Domain 4) where rIn_lt_rOut := by have h := cutoffScale_pos n; linarith /-- The real smooth compact approximate-identity kernel. -/ -def mollifierKernel (n : ℕ) : Domain 4 → ℝ := (mollifierBump n).normed volume +@[expose] def mollifierKernel (n : ℕ) : Domain 4 → ℝ := (mollifierBump n).normed volume theorem mollifierKernel_smooth (n : ℕ) : ContDiff ℝ ∞ (mollifierKernel n) := (mollifierBump n).contDiff_normed @@ -162,7 +162,7 @@ def mollifierOperator (n : ℕ) : LiftL2 period →L[ℝ] LiftL2 period := simpa using mollify_norm_le period n f) theorem mollifierOperator_apply (n : ℕ) (f : LiftL2 period) : - mollifierOperator period n f = mollify period n f := rfl + mollifierOperator period n f = mollify period n f := by rfl theorem mollifierOperator_norm_le (n : ℕ) : ‖mollifierOperator period n‖ ≤ 1 := ContinuousLinearMap.opNorm_le_bound _ zero_le_one (fun f => by diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean index 3e7f2cb00f..04a9bfab9f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Actual derivative-word Sobolev norms on R³ × T and compact localizations. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -32,7 +32,7 @@ open scoped SchwartzMap ENNReal NNReal ContDiff Topology LineDeriv /-- The four coordinate directions, with angle first and the spatial coordinates following. -/ -noncomputable def standardDirection (i : Fin 4) : LiftTangent := +@[expose] noncomputable def standardDirection (i : Fin 4) : LiftTangent := coordinateEquiv (EuclideanSpace.single i 1) @[simp] theorem standardDirection_zero : standardDirection 0 = (0,1) := by @@ -62,15 +62,15 @@ noncomputable def iteratedFieldDerivative : {n : ℕ} → (Fin n → Fin 4) → (iteratedFieldDerivative (Fin.tail w) f) @[simp] theorem iteratedFieldDerivative_zero (w : Fin 0 → Fin 4) (f : LiftDomain period → F) : - iteratedFieldDerivative period w f = f := rfl + iteratedFieldDerivative period w f = f := by rfl @[simp] theorem iteratedFieldDerivative_succ {n : ℕ} (w : Fin (n + 1) → Fin 4) (f : LiftDomain period → F) : iteratedFieldDerivative period w f = fieldDerivative period (standardDirection (w 0)) - (iteratedFieldDerivative period (Fin.tail w) f) := rfl + (iteratedFieldDerivative period (Fin.tail w) f) := by rfl /-- A concrete norm: the sum of L² norms of all ordered coordinate derivatives up to order `s`. -/ -noncomputable def liftSobolevNorm (s : ℕ) (f : LiftDomain period → F) +@[expose] noncomputable def liftSobolevNorm (s : ℕ) (f : LiftDomain period → F) [Fact (0 < period)] : ℝ := Finset.sum (Finset.range (s+1)) (fun n => ∑ w : Fin n → Fin 4, (eLpNorm (iteratedFieldDerivative period w f) 2 (liftMeasure period)).toReal) @@ -84,6 +84,7 @@ theorem iteratedFieldDerivative_smooth {n : ℕ} (w : Fin n → Fin 4) exact fieldDerivative_smooth period _ _ (ih (Fin.tail w)) /-- The actual field lifted to Euclidean coordinates centered at a cylinder point. -/ +@[expose] noncomputable def euclideanLift (f : LiftDomain period → F) (x : LiftDomain period) : Domain 4 → F := localFieldLift period f x ∘ coordinateEquiv @@ -107,6 +108,7 @@ theorem euclideanLift_fieldDerivative (f : LiftDomain period → F) have hchain := ((hf x).differentiable (by simp) (coordinateEquiv z)).hasFDerivAt.comp z coordinateEquiv.hasFDerivAt rw [euclideanLift, localFieldLift_fieldDerivative] + simp only [directionalDerivative, Function.comp_apply] change fderiv ℝ (localFieldLift period f x) (coordinateEquiv z) (coordinateEquiv v) = _ rw [show fderiv ℝ (euclideanLift period f x) z = (fderiv ℝ (localFieldLift period f x) (coordinateEquiv z)).comp @@ -141,7 +143,8 @@ theorem euclideanLift_tensor_norm_le (n : ℕ) (f : LiftDomain period → F) simpa only [euclideanLift_iteratedFieldDerivative period _ f hf] using h /-- Sum of the norms of all coordinate words of one fixed order. -/ -noncomputable def wordMagnitude (n : ℕ) (f : LiftDomain period → F) (x : LiftDomain period) : ℝ := +@[expose] noncomputable def wordMagnitude (n : ℕ) (f : LiftDomain period → F) + (x : LiftDomain period) : ℝ := ∑ w : Fin n → Fin 4, ‖iteratedFieldDerivative period w f x‖ theorem wordMagnitude_nonneg (n : ℕ) (f : LiftDomain period → F) (x : LiftDomain period) : @@ -168,7 +171,7 @@ variable [Fact (0 < period)] variable {F : Type*} [NormedAddCommGroup F] /-- Translation of an actual cylinder function. -/ -noncomputable def translated (f : LiftDomain period → F) (x : LiftDomain period) : +@[expose] noncomputable def translated (f : LiftDomain period → F) (x : LiftDomain period) : LiftDomain period → F := fun y => f (y + x) theorem eLpNorm_translated (f : LiftDomain period → F) @@ -295,7 +298,7 @@ noncomputable def localized (f : LiftDomain period → ℂ) @[simp] theorem localized_apply (f : LiftDomain period → ℂ) (hf : ∀ x, ContDiff ℝ ∞ (localFieldLift period f x)) (x : LiftDomain period) (z : Domain 4) : - localized period f hf x z = localBump period z • euclideanLift period f x z := rfl + localized period f hf x z = localBump period z • euclideanLift period f x z := by rfl theorem localized_zero (f : LiftDomain period → ℂ) (hf : ∀ x, ContDiff ℝ ∞ (localFieldLift period f x)) (x : LiftDomain period) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DNSelection.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DNSelection.lean index 59b1d6c68f..87f791335c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DNSelection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DNSelection.lean @@ -10,7 +10,7 @@ public import Mathlib.Analysis.InnerProductSpace.Positive /-! Quantitative endpoint selection in the activation step, equations (26)–(27). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean index 4cc98d9ca0..1c590ed40c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean @@ -17,7 +17,7 @@ public import Mathlib.Topology.Algebra.Module.ModuleTopology # Deformation Volume -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DifferentialOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DifferentialOperators.lean index 65bd266aca..0269605bb2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DifferentialOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DifferentialOperators.lean @@ -12,7 +12,7 @@ public import Mathlib.Analysis.Calculus.FDeriv.Basic /-! Coordinate trace and divergence on the physical three-dimensional Euclidean space. -/ -@[expose] public section +public section noncomputable section @@ -22,7 +22,7 @@ namespace EulerSmoothLimit abbrev Space := EuclideanSpace ℝ (Fin 3) /-- The trace of a continuous linear map, written in the standard Euclidean coordinates. -/ -noncomputable def coordinateTrace : (Space →L[ℝ] Space) →L[ℝ] ℝ := +@[expose] noncomputable def coordinateTrace : (Space →L[ℝ] Space) →L[ℝ] ℝ := ∑ i : Fin 3, (EuclideanSpace.proj i).comp (ContinuousLinearMap.apply ℝ Space (EuclideanSpace.single i 1)) @@ -33,7 +33,7 @@ theorem coordinateTrace_eq_linearTrace (A : Space →L[ℝ] Space) : simp [coordinateTrace, Matrix.trace, LinearMap.toMatrix_apply] /-- Classical divergence, defined canonically as the trace of the Fréchet derivative. -/ -noncomputable def divergence (f : Space → Space) (x : Space) : ℝ := +@[expose] noncomputable def divergence (f : Space → Space) (x : Space) : ℝ := LinearMap.trace ℝ Space (fderiv ℝ f x).toLinearMap theorem divergence_eq_coordinate_sum (f : Space → Space) (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/EnergyBootstrap.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/EnergyBootstrap.lean index 9f0f9d3499..f1440441c3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/EnergyBootstrap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/EnergyBootstrap.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.InnerProductSpace.Basic # Energy Bootstrap -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean index f58fb78cf8..846517c10d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean @@ -19,7 +19,7 @@ Euler construction. These lemmas prove combinatorial implications; they do not assert the analytic estimates needed to apply the implications to Euler. -/ -@[expose] public section +public section noncomputable section @@ -123,7 +123,7 @@ theorem shifted_factorial_kernel_le (n k d₁ d₂ : ℕ) (hkn : k ≤ n) : _ = _ := by ring /-- The Gevrey-two factorial majorant with a nonnegative integer shift. -/ -def majorant (R : ℝ) (d n : ℕ) : ℝ := +@[expose] def majorant (R : ℝ) (d n : ℕ) : ℝ := R ^ (n + d) * ((n + d).factorial : ℝ) ^ 2 theorem majorant_nonneg (R : ℝ) (hR : 0 ≤ R) (d n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/GevreyFunctions.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/GevreyFunctions.lean index 41b4a6e979..78cd334159 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/GevreyFunctions.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/GevreyFunctions.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds # Gevrey Functions -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/GraphPullback.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/GraphPullback.lean index 9f08f94bd7..30ba8cdcd7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/GraphPullback.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/GraphPullback.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Integral.CurveIntegral.Poincare # Graph Pullback -/ -@[expose] public section +public section noncomputable section @@ -26,11 +26,11 @@ open scoped ContDiff variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The linear graph carrying the oscillating phase. -/ -def graphMap (k : ℝ) (m : E) : E →L[ℝ] (E × ℝ) := +@[expose] def graphMap (k : ℝ) (m : E) : E →L[ℝ] (E × ℝ) := (ContinuousLinearMap.id ℝ E).prod (k • toDual ℝ E m) /-- The constant lifted differential direction associated with a spatial vector. -/ -def liftedDirection (κ : ℝ) (m : E) : E →L[ℝ] (E × ℝ) := +@[expose] def liftedDirection (κ : ℝ) (m : E) : E →L[ℝ] (E × ℝ) := (κ • ContinuousLinearMap.id ℝ E).prod (toDual ℝ E m) theorem graphMap_apply (k : ℝ) (m v : E) : graphMap k m v = (v, k * ⟪m, v⟫_ℝ) := rfl diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/InverseRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/InverseRegularity.lean index 58a2b68bf1..a5017db94d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/InverseRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/InverseRegularity.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul # Inverse Regularity -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/JetProductBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/JetProductBounds.lean index aa53dc8b54..d81496a842 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/JetProductBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/JetProductBounds.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.PressureJetIdentities /-! Sharp order-by-order Leibniz bounds for actual cylinder Sobolev jets. -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The sum of the L² norms of all actual derivative words of one order. -/ -def levelNorm {directions : Fin 4 → LiftTangent} {s : ℕ} {f : LiftL2 period} +@[expose] def levelNorm {directions : Fin 4 → LiftTangent} {s : ℕ} {f : LiftL2 period} (J : SpatialJet period directions s f) (n : ℕ) : ℝ := match n, J with | 0, _ => ‖f‖ @@ -33,7 +33,7 @@ def levelNorm {directions : Fin 4 → LiftTangent} {s : ℕ} {f : LiftL2 period} termination_by s /-- The sum of the uniform bounds of all coefficient derivatives of one order. -/ -def boundLevel {directions : Fin 4 → LiftTangent} {s : ℕ} {A : SmoothCoefficient period} +@[expose] def boundLevel {directions : Fin 4 → LiftTangent} {s : ℕ} {A : SmoothCoefficient period} (K : CoefficientJet period directions s A) (n : ℕ) : ℝ := match n, K with | 0, _ => A.bound @@ -130,7 +130,7 @@ theorem levelNorm_add_le {s n : ℕ} {f g : LiftL2 period} exact Finset.sum_le_sum fun i _ => ih (lower i) (lowerG i) /-- Binomial convolution of nonnegative derivative-order bounds. -/ -def leibnizConvolution (A B : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def leibnizConvolution (A B : ℕ → ℝ) (n : ℕ) : ℝ := Finset.sum (Finset.range (n + 1)) (fun l => (n.choose l : ℝ) * A l * B (n - l)) theorem leibnizConvolution_succ (A B : ℕ → ℝ) (n : ℕ) : @@ -238,7 +238,7 @@ theorem word_add {s n : ℕ} {f g : LiftL2 period} exact ih (lower _) (lowerG _) _ /-- Binomial derivative convolution with its undifferentiated-coefficient term removed. -/ -def commutatorConvolution (A B : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def commutatorConvolution (A B : ℕ → ℝ) (n : ℕ) : ℝ := leibnizConvolution A B n - A 0 * B n theorem commutatorConvolution_eq_sum (A B : ℕ → ℝ) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Lagrangian.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Lagrangian.lean index 4a79c65ec0..b31406d287 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Lagrangian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Lagrangian.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod # Lagrangian -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedCurl.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedCurl.lean index 62277b6181..d78414607a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedCurl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedCurl.lean @@ -15,7 +15,7 @@ fields. The proof uses actual compact scalar tests and mixed derivative symmetry, then passes to the L² closure through continuous inner products. -/ -@[expose] public section +public section noncomputable section @@ -108,15 +108,13 @@ theorem fieldDerivatives_commute {W : Type*} [NormedAddCommGroup W] [NormedSpace change fderiv ℝ (localFieldLift period (fieldDerivative period b f) x) 0 a = fderiv ℝ (localFieldLift period (fieldDerivative period a f) x) 0 b rw [localFieldLift_fieldDerivative, localFieldLift_fieldDerivative] - change fderiv ℝ (directionalDerivative b (localFieldLift period f x)) 0 a = - fderiv ℝ (directionalDerivative a (localFieldLift period f x)) 0 b + - fderiv ℝ (localFieldLift period f x) 0 (fderiv ℝ (fun _ : LiftTangent => b) 0 a) at h + simp only [directionalDerivative, transport] at h ⊢ have hc : fderiv ℝ (fun _ : LiftTangent => b) 0 = 0 := by simp rw [hc, zero_apply, map_zero, add_zero] at h exact h /-- A compact antisymmetric derivative test field for one lifted curl component. -/ -def curlTest (κ : ℝ) (m : Vector3) (i j : Fin 3) (ψ : LiftDomain period → ℝ) +@[expose] def curlTest (κ : ℝ) (m : Vector3) (i j : Fin 3) (ψ : LiftDomain period → ℝ) (x : LiftDomain period) : Vector3 := fieldDerivative period (coordinateDirection κ m j) ψ x • EuclideanSpace.single i 1 - fieldDerivative period (coordinateDirection κ m i) ψ x • EuclideanSpace.single j 1 @@ -153,6 +151,7 @@ theorem liftedGradient_component (κ : ℝ) (m : Vector3) (φ : LiftDomain perio (x : LiftDomain period) (i : Fin 3) : liftedGradient period κ m φ x i = fieldDerivative period (coordinateDirection κ m i) φ x := by rw [liftedGradient_eq_vectorOfLinear] + simp [vectorOfLinear, fieldDerivative] rfl theorem scalar_derivative_product_integrable (a b : LiftTangent) @@ -234,8 +233,9 @@ theorem gradient_curl_pairing (κ : ℝ) (m : Vector3) (i j : Fin 3) rw [real_inner_comm] exact generator_curl_pairing period κ m i j ψ hψc hψ hg have hclosed : IsClosed (L.ker : Set (LiftL2 period)) := L.isClosed_ker - have hclosure : gradientSpace period κ m ≤ L.ker := - Submodule.topologicalClosure_minimal _ hspan hclosed + have hclosure : gradientSpace period κ m ≤ L.ker := by + simpa only [gradientSpace] using + (Submodule.topologicalClosure_minimal _ hspan hclosed) have h := hclosure hp change ⟪curlTestLp period κ m i j ψ hψc hψ, p⟫_ℝ = 0 at h rwa [real_inner_comm] at h diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedGradientSpace.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedGradientSpace.lean index cfef1b60a4..bb204e91d7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedGradientSpace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedGradientSpace.lean @@ -19,7 +19,7 @@ The angular measure here has total mass `period`; renormalizing it changes only fixed scalar in the L² norm and not the gradient subspace or projection. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ abbrev LiftTangent := Vector3 × ℝ variable (period : ℝ) [Fact (0 < period)] /-- Product Lebesgue and angle Haar measure on the cylinder. -/ -def liftMeasure : Measure (LiftDomain period) := +@[expose] def liftMeasure : Measure (LiftDomain period) := (volume : Measure Vector3).prod (volume : Measure (AddCircle period)) instance liftMeasure_finiteOnCompacts : IsFiniteMeasureOnCompacts (liftMeasure period) := by @@ -49,11 +49,11 @@ instance liftMeasure_finiteOnCompacts : IsFiniteMeasureOnCompacts (liftMeasure p abbrev LiftL2 := Lp Vector3 2 (liftMeasure period) /-- The scalar field pulled back to covering coordinates centered at x. -/ -def localLift (φ : LiftDomain period → ℝ) (x : LiftDomain period) : LiftTangent → ℝ := +@[expose] def localLift (φ : LiftDomain period → ℝ) (x : LiftDomain period) : LiftTangent → ℝ := fun h => φ (x.1 + h.1, x.2 + (h.2 : AddCircle period)) /-- The quotient covering map from the real tangent space to the cylinder. -/ -def coveringMap : LiftTangent → LiftDomain period := +@[expose] def coveringMap : LiftTangent → LiftDomain period := fun z => (z.1, (z.2 : AddCircle period)) omit [Fact (0 < period)] in @@ -73,7 +73,7 @@ theorem fderiv_localLift_cover (φ : LiftDomain period → ℝ) (z : LiftTangent rw [localLift_cover, fderiv_comp_add_left, add_zero] /-- The actual differential expression `κ ∇_y φ + m ∂_θ φ`. -/ -def liftedGradient (κ : ℝ) (m : Vector3) (φ : LiftDomain period → ℝ) +@[expose] def liftedGradient (κ : ℝ) (m : Vector3) (φ : LiftDomain period → ℝ) (x : LiftDomain period) : Vector3 := WithLp.toLp 2 fun i => κ * fderiv ℝ (localLift period φ x) 0 (EuclideanSpace.single i 1, 0) + @@ -169,7 +169,8 @@ theorem measurePreserving_translation (a : LiftDomain period) : (measurePreserving_add_right (volume : Measure (AddCircle period)) a.2) /-- The measure preserving translation isometry on the actual L² space. -/ -def translation (a : LiftDomain period) : LiftL2 period →ₗᵢ[ℝ] LiftL2 period := +@[expose] def translation (a : LiftDomain period) : + LiftL2 period →ₗᵢ[ℝ] LiftL2 period := Lp.compMeasurePreservingₗᵢ ℝ (fun x : LiftDomain period => x + a) (measurePreserving_translation period a) @@ -215,7 +216,7 @@ theorem testGradientLp_mem_generators (κ : ℝ) (m : Vector3) (φ : LiftDomain ⟨φ, hφ, testGradientLp_ae period κ m φ hφ⟩ /-- Closure of the span of genuine smooth test gradients in the concrete L² space. -/ -def gradientSpace (κ : ℝ) (m : Vector3) : Submodule ℝ (LiftL2 period) := +@[expose] def gradientSpace (κ : ℝ) (m : Vector3) : Submodule ℝ (LiftL2 period) := (Submodule.span ℝ (({g : EulerLiftedGradientSpace.LiftL2 period | ∃ φ : EulerLiftedGradientSpace.LiftDomain period → ℝ, (HasCompactSupport φ ∧ ∀ x, ContDiff ℝ ∞ (EulerLiftedGradientSpace.localLift period φ x)) ∧ g @@ -236,7 +237,7 @@ instance gradientSpace_complete (κ : ℝ) (m : Vector3) : (gradientSpace_closed period κ m).completeSpace_coe /-- Orthogonal projection onto the closed lifted gradient subspace. -/ -def gradientProjection (κ : ℝ) (m : Vector3) : LiftL2 period →L[ℝ] LiftL2 period := +@[expose] def gradientProjection (κ : ℝ) (m : Vector3) : LiftL2 period →L[ℝ] LiftL2 period := (gradientSpace period κ m).starProjection /-- The projection bound is independent of the frequency parameter κ. -/ @@ -321,7 +322,7 @@ theorem gradientProjection_translation (κ : ℝ) (m : Vector3) (a : LiftDomain (translation period a).map_starProjection (gradientSpace period κ m) f /-- The concrete L² weak divergence-free subspace. -/ -def divergenceFreeSpace (κ : ℝ) (m : Vector3) : Submodule ℝ (LiftL2 period) := +@[expose] def divergenceFreeSpace (κ : ℝ) (m : Vector3) : Submodule ℝ (LiftL2 period) := (gradientSpace period κ m).orthogonal /-- Pressure cancellation in the concrete lifted L² space. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedPressure.lean index 8d73e88d7c..4f8932c3e7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedPressure.lean @@ -16,7 +16,7 @@ pointwise positive quadratic bound supplies the Hilbert-space coercivity used by the lifted pressure solver. No multiplication operator is assumed. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ theorem coefficientApply_memLp (A : α → V →L[ℝ] V) (hA : AEStronglyMeasur (mul_le_mul_of_nonneg_right (hbound x) (norm_nonneg _)) /-- Pointwise bounded coefficient application represented as an L² element. -/ -def coefficientApply (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) +@[expose] def coefficientApply (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) (C : ℝ≥0) (hbound : ∀ x, ‖A x‖ ≤ C) (f : Lp V 2 μ) : Lp V 2 μ := (coefficientApply_memLp A hA C hbound f).toLp (fun x => A x (f x)) @@ -51,7 +51,7 @@ theorem coefficientApply_ae (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurabl (coefficientApply_memLp A hA C hbound f).coeFn_toLp /-- The linear map induced by pointwise coefficient multiplication. -/ -def coefficientLinearMap (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) +@[expose] def coefficientLinearMap (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) (C : ℝ≥0) (hbound : ∀ x, ‖A x‖ ≤ C) : Lp V 2 μ →ₗ[ℝ] Lp V 2 μ where toFun := coefficientApply A hA C hbound map_add' f g := by @@ -82,11 +82,18 @@ theorem coefficientApply_norm_le (A : α → V →L[ℝ] V) (hA : AEStronglyMeas (mul_le_mul_of_nonneg_right (hbound x) (norm_nonneg _)) /-- The bounded operator induced by the actual coefficient field. -/ -def coefficientOperator (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) +@[expose] def coefficientOperator (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) (C : ℝ≥0) (hbound : ∀ x, ‖A x‖ ≤ C) : Lp V 2 μ →L[ℝ] Lp V 2 μ := (coefficientLinearMap A hA C hbound).mkContinuous C (coefficientApply_norm_le A hA C hbound) +/-- The bounded multiplication operator acts by pointwise coefficient application. -/ +@[simp] theorem coefficientOperator_apply (A : α → V →L[ℝ] V) + (hA : AEStronglyMeasurable A μ) (C : ℝ≥0) + (hbound : ∀ x, ‖A x‖ ≤ C) (f : Lp V 2 μ) : + coefficientOperator A hA C hbound f = coefficientApply A hA C hbound f := by + rfl + theorem coefficientOperator_ae (A : α → V →L[ℝ] V) (hA : AEStronglyMeasurable A μ) (C : ℝ≥0) (hbound : ∀ x, ‖A x‖ ≤ C) (f : Lp V 2 μ) : coefficientOperator A hA C hbound f =ᵐ[μ] fun x => A x (f x) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedWeakDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedWeakDerivative.lean index c46ef0f3da..54d516a363 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedWeakDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/LiftedWeakDerivative.lean @@ -18,7 +18,7 @@ Smooth compact test fields are realized in L², and their translation orbits are differentiated in the strong L² topology. -/ -@[expose] public section +public section noncomputable section @@ -55,6 +55,7 @@ section FieldCalculus variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- The full derivative of a field in covering coordinates, evaluated at the center. -/ +@[expose] def fieldFDeriv (f : LiftDomain period → W) (x : LiftDomain period) : LiftTangent →L[ℝ] W := fderiv ℝ (localFieldLift period f x) 0 diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricEnergyEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricEnergyEvolution.lean index 88da22fc97..19dc5a2106 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricEnergyEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricEnergyEvolution.lean @@ -18,7 +18,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul # Metric Energy Evolution -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricTransport.lean index 0c6500e075..6d00fa27b7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MetricTransport.lean @@ -15,7 +15,7 @@ supported smooth energy fields are tested against the concrete weak-divergence condition; boundary terms are eliminated by that proved weak formulation. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open scoped ContDiff ENNReal NNReal Topology variable (period : ℝ) [Fact (0 < period)] /-- A field pulled back to real covering coordinates centered at a cylinder point. -/ -def localFieldLift {W : Type*} (f : LiftDomain period → W) (x : LiftDomain period) : +@[expose] def localFieldLift {W : Type*} (f : LiftDomain period → W) (x : LiftDomain period) : LiftTangent → W := fun h => f (x.1 + h.1, x.2 + (h.2 : AddCircle period)) section Fields @@ -72,15 +72,15 @@ theorem localFDeriv_continuous (f : LiftDomain period → W) end Fields /-- The covering-space direction corresponding to one lifted gradient component. -/ -def coordinateDirection (κ : ℝ) (m : Vector3) (i : Fin 3) : LiftTangent := +@[expose] def coordinateDirection (κ : ℝ) (m : Vector3) (i : Fin 3) : LiftTangent := (κ • EuclideanSpace.single i 1, m i) /-- The actual four dimensional transport vector associated with a lifted velocity. -/ -def transportDirection (κ : ℝ) (m v : Vector3) : LiftTangent := +@[expose] def transportDirection (κ : ℝ) (m v : Vector3) : LiftTangent := (κ • v, ⟪m, v⟫_ℝ) /-- The vector of a scalar differential evaluated on the lifted coordinate directions. -/ -def vectorOfLinear (κ : ℝ) (m : Vector3) (L : LiftTangent →L[ℝ] ℝ) : Vector3 := +@[expose] def vectorOfLinear (κ : ℝ) (m : Vector3) (L : LiftTangent →L[ℝ] ℝ) : Vector3 := WithLp.toLp 2 fun i => L (coordinateDirection κ m i) theorem coordinateDirections_sum (κ : ℝ) (m v : Vector3) : @@ -127,7 +127,7 @@ theorem liftedGradient_eq_vectorOfLinear (κ : ℝ) (m : Vector3) rfl /-- The pointwise quadratic metric energy of a vector field. -/ -def metricEnergy (K : LiftDomain period → Vector3 →L[ℝ] Vector3) +@[expose] def metricEnergy (K : LiftDomain period → Vector3 →L[ℝ] Vector3) (e : LiftDomain period → Vector3) (x : LiftDomain period) : ℝ := (1 / 2 : ℝ) * ⟪K x (e x), e x⟫_ℝ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean index 719bc03223..e05bb60271 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean @@ -26,7 +26,7 @@ section /-! Classical smooth cylinder representatives obtained by Euclidean mollification. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -127,6 +127,7 @@ theorem cylinderConvolution_smooth (φ : ContDiffBump (0 : Domain 4)) (f : LiftD fun v => coverConvolution period φ f (z + coordinateEquiv.symm v) := by funext v rw [← cylinderConvolution_cover, euclideanCover_add, hz] + simp [localFieldLift, euclideanCover, coveringMap] congr 1 rw [he] exact (coverConvolution_smooth period φ f hf).comp (contDiff_const.add @@ -168,7 +169,7 @@ section /-! The finite-set Fubini bridge identifying classical and L² cylinder mollification. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -299,7 +300,7 @@ end end -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierUniform.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierUniform.lean index 1df127c761..1f5429a0ad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierUniform.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierUniform.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.VectorCylinder /-! Uniform control of every classical derivative word by actual strong Sobolev jets. -/ -@[expose] public section +public section noncomputable section @@ -82,9 +82,9 @@ theorem word_sub {m : ℕ} (w : Fin m → Fin 4) (f g : LiftDomain period → Ve iteratedFieldDerivative period w (fun y => f y - g y) = fun x => iteratedFieldDerivative period w f x - iteratedFieldDerivative period w g x := by induction m with - | zero => rfl + | zero => simp only [iteratedFieldDerivative_zero] | succ m ih => - rw [iteratedFieldDerivative_succ, ih (Fin.tail w)] + simp only [iteratedFieldDerivative_succ, ih (Fin.tail w)] funext x exact fieldDerivative_sub period (standardDirection (w 0)) _ _ (iteratedFieldDerivative_smooth period (Fin.tail w) f hf) @@ -205,7 +205,8 @@ theorem exists_continuous_representative (U : LiftL2 period) · apply hg.continuous apply Filter.Eventually.frequently exact Filter.Eventually.of_forall fun n => - smoothField_continuous period _ (smoothMollifier_smooth period n U) + smoothField_continuous period _ + (iteratedFieldDerivative_smooth period w _ (smoothMollifier_smooth period n U)) · simpa only [SpatialJet.word_zero] using smoothMollifier_word_limit_ae period U J w g hg end EulerMollifierUniform diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean index d48b44d9fd..21d159bf16 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean @@ -13,7 +13,7 @@ import Mathlib.RingTheory.Finiteness.Prod /-! Expanding spatial cutoffs and transport cancellation for noncompact fields on the cylinder. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -28,6 +28,7 @@ open scoped ContDiff ENNReal NNReal Topology variable (period : ℝ) [Fact (0 < period)] /-- A fixed smooth spatial cutoff equal to one on the unit ball. -/ +@[expose] def spatialBump : ContDiffBump (0 : Vector3) where rIn := 1 rOut := 2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBaseScales.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBaseScales.lean index aa947d0346..c0496d68b6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBaseScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBaseScales.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics # Packet Base Scales -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBridge.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBridge.lean index 35965169ec..88c695fecb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBridge.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketBridge.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.Deriv.Pow # Packet Bridge -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ namespace EulerPacketBridge open EulerPacketPerturbation EulerPacketRay /-- The first component of the ideal normalized velocity vector field. -/ -noncomputable def idealVelocityFirst (β t U V : ℝ) : ℝ := +@[expose] noncomputable def idealVelocityFirst (β t U V : ℝ) : ℝ := -2 * V + 2 * (β * t ^ 2) * (((β * t ^ 2) + β) * V + (-2 * β * t) * U) / (1 + (β * t ^ 2) ^ 2) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketCoefficientControl.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketCoefficientControl.lean index cc7dd45645..2e910ada37 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketCoefficientControl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketCoefficientControl.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.MeanValue # Packet Coefficient Control -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketExistence.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketExistence.lean index 7439bf2125..9102f0f3ad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketExistence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketExistence.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.ODE.ExistUnique # Packet Existence -/ -@[expose] public section +public section noncomputable section @@ -54,7 +54,7 @@ variable [NormedSpace ℝ E] [CompleteSpace E] /-- The Volterra map on all continuous curves, without a spatial-radius restriction. Global Lipschitz continuity makes an iterate contractive. -/ -noncomputable def picardStep (x : E) (α : C(Icc a b, E)) : C(Icc a b, E) := +@[expose] noncomputable def picardStep (x : E) (α : C(Icc a b, E)) : C(Icc a b, E) := ⟨fun t => x + ∫ s in t₀.1..t.1, f s (extendCurve t₀ α s), (continuous_const.add (intervalIntegral.differentiable_integral_of_continuous (continuous_comp_extendCurve t₀ hf α)).continuous).comp continuous_subtype_val⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameQuantitative.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameQuantitative.lean index 39e6a93e32..c01fa5aaca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameQuantitative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameQuantitative.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real # Packet Frame Quantitative -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameRenewal.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameRenewal.lean index f4ebd163f5..feb2e30dd7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameRenewal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameRenewal.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real # Packet Frame Renewal -/ -@[expose] public section +public section noncomputable section @@ -306,7 +306,7 @@ theorem perturbed_target_compression linarith only [hnumtime, hden] /-- The coordinate quadratic form of a real three-by-three matrix. -/ -def quadraticForm3 (B : Fin 3 → Fin 3 → ℝ) (p q n : ℝ) : ℝ := +@[expose] def quadraticForm3 (B : Fin 3 → Fin 3 → ℝ) (p q n : ℝ) : ℝ := p * (B 0 0 * p + B 0 1 * q + B 0 2 * n) + q * (B 1 0 * p + B 1 1 * q + B 1 2 * n) + n * (B 2 0 * p + B 2 1 * q + B 2 2 * n) @@ -364,12 +364,12 @@ theorem parent_ray_compression exact (div_le_iff₀ hD).mpr hquad /-- The ideal pressure-to-velocity ratio at the inverse target scale. -/ -noncomputable def idealTargetPressure (ε y : ℝ) (V V₁ : ℝ → ℝ) : ℝ := +@[expose] noncomputable def idealTargetPressure (ε y : ℝ) (V V₁ : ℝ → ℝ) : ℝ := let t := y⁻¹ / ε ε ^ 2 * t ^ 2 + ε ^ 2 + (-2 * ε ^ 2 * t) * (-V₁ t / V t) /-- The ideal cross numerator at the inverse target scale. -/ -noncomputable def idealTargetCross (ε y : ℝ) (V V₁ : ℝ → ℝ) : ℝ := +@[expose] noncomputable def idealTargetCross (ε y : ℝ) (V V₁ : ℝ → ℝ) : ℝ := let t := y⁻¹ / ε idealCrossNumerator (ε ^ 2) (ε ^ 2 * t ^ 2) (-2 * ε ^ 2 * t) (-V₁ t / V t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameStability.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameStability.lean index 0d09ddbf20..fc2dacde0b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameStability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketFrameStability.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real # Packet Frame Stability -/ -@[expose] public section +public section noncomputable section @@ -323,7 +323,7 @@ theorem third_ratio_error nlinarith only [hsum, hm] /-- A normalized parent-gradient row applied to the velocity ratios. -/ -def rowAction (A : Fin 3 → Fin 3 → ℝ) (i : Fin 3) (r w : ℝ) : ℝ := +@[expose] def rowAction (A : Fin 3 → Fin 3 → ℝ) (i : Fin 3) (r w : ℝ) : ℝ := A i 0 * r + A i 1 + A i 2 * w /-- Rowwise control of the normalized parent action on the new velocity. -/ @@ -367,11 +367,11 @@ theorem normalized_action_error /-- The cross-product numerator for the next normalized coupling. The middle argument `Tq` denotes ε times the physical middle component. -/ -def frameCrossNumerator (ε P Q N r w Tp Tq Tn : ℝ) : ℝ := +@[expose] def frameCrossNumerator (ε P Q N r w Tp Tq Tn : ℝ) : ℝ := (-N + ε ^ 2 * Q * w) * Tp + (N * r - P * w) * Tq + (P - ε ^ 2 * Q * r) * Tn /-- The ideal next-frame cross numerator in original scalar coordinates. -/ -def idealCrossNumerator (β P Q r : ℝ) : ℝ := +@[expose] def idealCrossNumerator (β P Q r : ℝ) : ℝ := -1 + β * P + (1 + P ^ 2) * r ^ 2 + P * Q * r /-- Quantitative stability of the exact cross-product numerator. -/ @@ -507,7 +507,7 @@ theorem frame_cross_error_from_matrix nlinarith only [hh] /-- Squared norm of the normalized velocity direction. -/ -def velocityDirectionNormSq (ε r w : ℝ) : ℝ := 1 + ε ^ 2 * (r ^ 2 + w ^ 2) +@[expose] def velocityDirectionNormSq (ε r w : ℝ) : ℝ := 1 + ε ^ 2 * (r ^ 2 + w ^ 2) theorem velocity_direction_norm_bound {Θ ε r w : ℝ} (hΘ : 1 ≤ Θ) (hr : |r| ≤ 9) (hw : |w| ≤ 60 * Θ ^ 2) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketGrowth.lean index c525087462..5cd419a5f6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketGrowth.lean @@ -19,7 +19,7 @@ Order estimates for the scalar ODE occurring in equation (30) of the proposed Euler packet argument. These are finite-dimensional ODE results only. -/ -@[expose] public section +public section noncomputable section @@ -857,10 +857,12 @@ theorem inversion_riccati_error /-- Inversion of a solution in the original time variable, including the rescaling `x = ετ`. -/ +@[expose] noncomputable def invertedScalar (ε : ℝ) (V : ℝ → ℝ) (y : ℝ) : ℝ := V (y⁻¹ / ε) / y /-- The exact derivative of `invertedScalar`, away from `y = 0`. -/ +@[expose] noncomputable def invertedScalarDeriv (ε : ℝ) (V V₁ : ℝ → ℝ) (y : ℝ) : ℝ := -V (y⁻¹ / ε) / y ^ 2 - V₁ (y⁻¹ / ε) / (ε * y ^ 3) @@ -1827,11 +1829,11 @@ theorem equation30_inverted_riccati_range hinit.1 hinit.2.1 hinit.2.2 y ⟨le_rfl, hy1⟩ /-- The ideal next-frame numerator in inversion coordinates. -/ -def idealFrameNumerator (ε y z : ℝ) : ℝ := +@[expose] def idealFrameNumerator (ε y z : ℝ) : ℝ := -1 + (1 + y ^ 4) * z ^ 2 + ε ^ 2 * y ^ 2 - 2 * ε * z * y ^ 3 /-- The ideal next-frame denominator divided by `x²`, where `y=1/x`. -/ -def idealFrameDenominator (ε y z : ℝ) : ℝ := +@[expose] def idealFrameDenominator (ε y z : ℝ) : ℝ := 1 - ε ^ 2 * y ^ 2 + 2 * ε * z * y ^ 3 /-- The two exact algebraic identities used for the ideal frame renewal. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketPerturbation.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketPerturbation.lean index 3722ade11d..90aa44ce88 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketPerturbation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketPerturbation.lean @@ -17,7 +17,7 @@ Relative perturbation estimates for the finite-dimensional scalar ODE in the Euler packet proposal. These results do not assert the PDE packet lemma. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketRay.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketRay.lean index 36a37e2517..a533d261bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketRay.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketRay.lean @@ -20,7 +20,7 @@ The triangular ray system and its perturbation estimates. These results derive ray closeness from the differential equations and coefficient errors. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open Set Filter Real EulerPacketPerturbation open scoped Topology /-- The sum norm of three scalar coordinates. -/ -def norm3 (p q n : ℝ) : ℝ := |p| + |q| + |n| +@[expose] def norm3 (p q n : ℝ) : ℝ := |p| + |q| + |n| /-- Exact Duhamel formulas for the triangular ray system. -/ theorem triangular_ray_formula @@ -391,21 +391,21 @@ theorem ray_closeness_of_coefficient_error linarith /-- The skew matrix of the moving orthonormal frame in the source. -/ -def frameSkew (B : Fin 3 → Fin 3 → ℝ) (i j : Fin 3) : ℝ := +@[expose] def frameSkew (B : Fin 3 → Fin 3 → ℝ) (i j : Fin 3) : ℝ := if i = 0 then (if j = 1 then B 0 1 else if j = 2 then B 0 2 else 0) else if i = 1 then (if j = 0 then -B 0 1 else if j = 2 then B 2 1 else 0) else if j = 0 then -B 0 2 else if j = 1 then -B 2 1 else 0 /-- The older gradient plus rank-one parent shear and error. -/ -def parentEntry (B E : Fin 3 → Fin 3 → ℝ) (h : ℝ) (i j : Fin 3) : ℝ := +@[expose] def parentEntry (B E : Fin 3 → Fin 3 → ℝ) (h : ℝ) (i j : Fin 3) : ℝ := B i j + E i j + (if i = 1 ∧ j = 0 then h else 0) /-- Coordinate scaling for the normalized ray. -/ -def rayScale (ε : ℝ) (i : Fin 3) : ℝ := if i = 1 then ε else 1 +@[expose] def rayScale (ε : ℝ) (i : Fin 3) : ℝ := if i = 1 then ε else 1 /-- Coefficients after the moving-frame transformation and the scaling `m/s₀=(P,εQ,N)`, `dt/dτ=ε/a`. -/ -noncomputable def scaledRayEntry (a ε : ℝ) (M S : Fin 3 → Fin 3 → ℝ) (i j : Fin 3) : ℝ := +@[expose] noncomputable def scaledRayEntry (a ε : ℝ) (M S : Fin 3 → Fin 3 → ℝ) (i j : Fin 3) : ℝ := -(ε / a) * (rayScale ε j / rayScale ε i) * (M j i - S j i) /-- The scaled moving-frame ray entries in normalized coefficients. -/ @@ -515,10 +515,10 @@ theorem abs_product_difference (mul_le_mul hc hb (abs_nonneg _) hA) /-- The third velocity coordinate imposed by ray orthogonality. -/ -noncomputable def velocityThird (P Q N U V : ℝ) : ℝ := -(P * U + Q * V) / N +@[expose] noncomputable def velocityThird (P Q N U V : ℝ) : ℝ := -(P * U + Q * V) / N /-- Squared norm of the scaled ray. -/ -def rayDenominator (ε P Q N : ℝ) : ℝ := P ^ 2 + ε ^ 2 * Q ^ 2 + N ^ 2 +@[expose] def rayDenominator (ε P Q N : ℝ) : ℝ := P ^ 2 + ε ^ 2 * Q ^ 2 + N ^ 2 /-- Elimination of the third velocity component and the denominator estimate are consequences of the proved ray error. -/ @@ -614,12 +614,13 @@ def normalizedVelocityEntry (ε H α κ : ℝ) (B E : Fin 3 → Fin 3 → ℝ) else if j = 1 then κ + E 2 1 else B 2 2 + ε * E 2 2 /-- The ideal scaled parent action on velocity coordinates. -/ +@[expose] def idealVelocityEntry (β : ℝ) (i j : Fin 3) : ℝ := if (i = 0 ∧ j = 1) ∨ (i = 1 ∧ j = 0) then 1 else if i = 2 ∧ j = 1 then β else 0 /-- Parent-gradient entries after ray and velocity rescaling. -/ -noncomputable def scaledVelocityEntry (a ε : ℝ) (M : Fin 3 → Fin 3 → ℝ) +@[expose] noncomputable def scaledVelocityEntry (a ε : ℝ) (M : Fin 3 → Fin 3 → ℝ) (i j : Fin 3) : ℝ := (if i = 1 then ε else 1) * (if j = 1 then 1 else ε) * M i j / a @@ -681,7 +682,7 @@ theorem normalized_velocity_entry_error e01, e21, eε00, eε02, eε11, eε20, eε22, eε210, eε212, hHb, hαb, hκb] /-- The scalar pressure numerator in the scaled coordinates. -/ -def velocityNumerator (A : Fin 3 → Fin 3 → ℝ) (P Q N U V W : ℝ) : ℝ := +@[expose] def velocityNumerator (A : Fin 3 → Fin 3 → ℝ) (P Q N U V W : ℝ) : ℝ := P * (A 0 0 * U + A 0 1 * V + A 0 2 * W) + Q * (A 1 0 * U + A 1 1 * V + A 1 2 * W) + N * (A 2 0 * U + A 2 1 * V + A 2 2 * W) @@ -768,7 +769,7 @@ def normalizedUnprojectedEntry (ε H α : ℝ) (B E : Fin 3 → Fin 3 → ℝ) else ε * B 1 2 + ε * B 2 1 + ε ^ 2 * E 1 2 /-- Ideal entries of the unprojected two-component velocity equation. -/ -def idealUnprojectedEntry (i j : Fin 3) : ℝ := +@[expose] def idealUnprojectedEntry (i j : Fin 3) : ℝ := if i = 0 then (if j = 1 then 2 else 0) else if j = 0 then 1 else 0 /-- Exact first and second rows of the moving-frame velocity operator. -/ @@ -924,14 +925,14 @@ theorem velocity_projection_error linarith only [hU, hV] /-- The first normalized velocity equation with pressure projection. -/ -noncomputable def velocityFirstRhs +@[expose] noncomputable def velocityFirstRhs (A C : Fin 3 → Fin 3 → ℝ) (ε P Q N U V : ℝ) : ℝ := let W := velocityThird P Q N U V; -(C 0 0 * U + C 0 1 * V + C 0 2 * W) + 2 * P * velocityNumerator A P Q N U V W / rayDenominator ε P Q N /-- The second normalized velocity equation with pressure projection. -/ -noncomputable def velocitySecondRhs +@[expose] noncomputable def velocitySecondRhs (A C : Fin 3 → Fin 3 → ℝ) (ε P Q N U V : ℝ) : ℝ := let W := velocityThird P Q N U V; -(C 1 0 * U + C 1 1 * V + C 1 2 * W) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketScaleGeometry.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketScaleGeometry.lean index 973c74c5c9..fd4c1f7127 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketScaleGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketScaleGeometry.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics # Packet Scale Geometry -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketUniformScaleSums.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketUniformScaleSums.lean index 4f4e31496c..4f894bfcd0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketUniformScaleSums.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketUniformScaleSums.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Star.Real # Packet Uniform Scale Sums -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean index 36768b6cc6..990f533d49 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean @@ -17,14 +17,14 @@ Exact weight identities used in the proposed packet's Gevrey estimates (18)--(19 These lemmas do not assert the nonlinear PDE estimates or an Euler blowup theorem. -/ -@[expose] public section +public section noncomputable section namespace EulerPacketWeights /-- Factorial weight at radius `ρ` for the Gevrey-two energy series. -/ -noncomputable def weight (ρ : ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def weight (ρ : ℝ) (n : ℕ) : ℝ := ρ ^ n / (n.factorial : ℝ) ^ 2 theorem weight_pos {ρ : ℝ} (hρ : 0 < ρ) (n : ℕ) : 0 < weight ρ n := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PeriodicProfile.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PeriodicProfile.lean index afa992b8d2..2116e10201 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PeriodicProfile.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PeriodicProfile.lean @@ -27,7 +27,7 @@ section # Gevrey Inverse -/ -@[expose] public section +public section noncomputable section @@ -132,7 +132,7 @@ end end -@[expose] public section +public section noncomputable section @@ -143,7 +143,7 @@ open Real open EulerGevrey EulerGevreyInverse EulerGevreyFunctions /-- Explicit smooth periodic profile with a narrow positive derivative peak. -/ -def profile (δ t : ℝ) : ℝ := arctan (sin t / (1 + δ - cos t)) +@[expose] def profile (δ t : ℝ) : ℝ := arctan (sin t / (1 + δ - cos t)) /-- Denominator of the derivative of the periodic profile. -/ def denominator (δ t : ℝ) : ℝ := (1 + δ) ^ 2 - 2 * (1 + δ) * cos t + 1 diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean index f4b0d83dc4..4c937328c8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Slope /-! Exact differentiated projected-pressure equations for actual translation Sobolev jets. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean index 4d3b670c2d..959b9518c8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean @@ -20,7 +20,7 @@ translations are actual pointwise translations, and pressure translation covariance follows from the uniquely constructed projected equation. -/ -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ section LiftedTranslation variable (period : ℝ) [Fact (0 < period)] /-- Pointwise coefficient translation on the actual cylinder. -/ -def translatedCoefficient (a : LiftDomain period) +@[expose] def translatedCoefficient (a : LiftDomain period) (A : LiftDomain period → Vector3 →L[ℝ] Vector3) (x : LiftDomain period) := A (x + a) theorem translatedCoefficient_measurable (a : LiftDomain period) @@ -189,7 +189,7 @@ theorem translatedCoefficient_measurable (a : LiftDomain period) hA.comp_measurePreserving (measurePreserving_translation period a) /-- The one-parameter spatial/angular translation determined by a covering-space direction. -/ -def translationPath (a : LiftTangent) (t : ℝ) : LiftDomain period := +@[expose] def translationPath (a : LiftTangent) (t : ℝ) : LiftDomain period := coveringMap period (t • a) omit [Fact (0 < period)] in @@ -198,7 +198,7 @@ theorem translationPath_zero (a : LiftTangent) : translationPath period a 0 = 0 simp [translationPath, coveringMap] /-- The actual directional derivative of the translated coefficient field. -/ -def translatedCoefficientDerivative (a : LiftTangent) +@[expose] def translatedCoefficientDerivative (a : LiftTangent) (A : LiftDomain period → Vector3 →L[ℝ] Vector3) (t : ℝ) (x : LiftDomain period) := fderiv ℝ (localFieldLift period A x) (t • a) a @@ -267,7 +267,7 @@ theorem coefficientOperator_translation (a : LiftDomain period) rfl /-- The concrete coercive pressure solution, viewed in ambient L². -/ -def liftedPressure (κ : ℝ) (m : Vector3) +@[expose] def liftedPressure (κ : ℝ) (m : Vector3) (A : LiftDomain period → Vector3 →L[ℝ] Vector3) (hA : AEStronglyMeasurable A (liftMeasure period)) (C : ℝ≥0) (hAb : ∀ x, ‖A x‖ ≤ C) (c : ℝ) (hc : 0 < c) @@ -439,10 +439,25 @@ theorem pressure_translation_derivative_norm (κ : ℝ) (m : Vector3) (a : LiftT (coefficientOperator_coercive A hA C hAb c hpos) _).trans ?_ apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr hc.le) refine (norm_sub_le _ _).trans (add_le_add_right ?_ ‖f'‖) - exact coefficientApply_norm_le (translatedCoefficientDerivative period a A 0) - (translatedCoefficientDerivative_measurable period a A hAs) (D * ‖a‖₊) - (fun x => translatedCoefficientDerivative_bound period a A D hDA x) - (liftedPressure period κ m A hA C hAb c hc hpos f) + calc + ‖coefficientOperator (translatedCoefficientDerivative period a A 0) + (translatedCoefficientDerivative_measurable period a A hAs) (D * ‖a‖₊) + (fun x => translatedCoefficientDerivative_bound period a A D hDA x) + (liftedPressure period κ m A hA C hAb c hc hpos f)‖ ≤ + ‖coefficientOperator (translatedCoefficientDerivative period a A 0) + (translatedCoefficientDerivative_measurable period a A hAs) (D * ‖a‖₊) + (fun x => translatedCoefficientDerivative_bound period a A D hDA x)‖ * + ‖liftedPressure period κ m A hA C hAb c hc hpos f‖ := + (coefficientOperator (translatedCoefficientDerivative period a A 0) + (translatedCoefficientDerivative_measurable period a A hAs) (D * ‖a‖₊) + (fun x => translatedCoefficientDerivative_bound period a A D hDA x)).le_opNorm _ + _ ≤ ↑(D * ‖a‖₊) * ‖liftedPressure period κ m A hA C hAb c hc hpos f‖ := + mul_le_mul_of_nonneg_right + (coefficientOperator_norm_le (translatedCoefficientDerivative period a A 0) + (translatedCoefficientDerivative_measurable period a A hAs) (D * ‖a‖₊) + (fun x => translatedCoefficientDerivative_bound period a A D hDA x)) (norm_nonneg _) + _ = (D : ℝ) * ‖a‖ * ‖liftedPressure period κ m A hA C hAb c hc hpos f‖ := by + simp only [NNReal.coe_mul, coe_nnnorm] end LiftedTranslation diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean index 1e7234ff39..b1fb973630 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.CylinderAlgebra /-! Real-valued forms of the cylinder Sobolev and multiplication estimates. -/ -@[expose] public section +public section noncomputable section @@ -37,16 +37,16 @@ theorem iteratedFieldDerivative_postcomp {n : ℕ} (L : F →L[ℝ] G) (w : Fin (f : LiftDomain period → F) (hf : ∀ x, ContDiff ℝ ∞ (localFieldLift period f x)) : iteratedFieldDerivative period w (L ∘ f) = L ∘ iteratedFieldDerivative period w f := by induction n with - | zero => rfl + | zero => simp only [iteratedFieldDerivative_zero] | succ n ih => rw [iteratedFieldDerivative_succ, ih (Fin.tail w), fieldDerivative_postcomp period L _ _ (iteratedFieldDerivative_smooth period (Fin.tail w) f hf)] - rfl + simp only [iteratedFieldDerivative_succ] end LinearMaps /-- Isometric complexification of a real scalar cylinder field. -/ -noncomputable def complexField (f : LiftDomain period → ℝ) : LiftDomain period → ℂ := +@[expose] noncomputable def complexField (f : LiftDomain period → ℝ) : LiftDomain period → ℂ := Complex.ofRealCLM ∘ f theorem complexField_smooth (f : LiftDomain period → ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/RepresentativeMetricEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/RepresentativeMetricEvolution.lean index bb1b83029b..f6c5b77fe3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/RepresentativeMetricEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/RepresentativeMetricEvolution.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.NoncompactTransport /-! Metric-energy evolution using a separate actual smooth representative of each L² class. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Scale.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Scale.lean index 11b1c34e98..58a6cc5c24 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Scale.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Scale.lean @@ -16,7 +16,7 @@ The sequence is reindexed so that `x 0 = x_{J-1}` and `x (n+1) = (J+n)^2 x n`; hence `J+n` is the stage index in the source. -/ -@[expose] public section +public section noncomputable section @@ -323,7 +323,8 @@ noncomputable def sourceParameterExponent (J : ℕ) (Cbase Cstar : ℝ) (x : ℕ Real.log (x n)] i /-- The sum of precisely those eight positive parameter terms. -/ -noncomputable def sourceParameterAggregate (J : ℕ) (Cbase Cstar : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceParameterAggregate (J : ℕ) (Cbase Cstar : ℝ) + (x : ℕ → ℝ) (n : ℕ) : ℝ := ∑ i : Fin 8, Real.exp (sourceParameterExponent J Cbase Cstar x i n) theorem sourceParameterExponent_nonneg (J : ℕ) (hJ : 2 ≤ J) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzDerivatives.lean index 2d059f01ab..514bdf8f91 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzDerivatives.lean @@ -16,7 +16,7 @@ are explicit Fréchet derivatives, so their public formulas do not depend on int by parts or the analytic estimates used to prove rapid decay. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- The directional Fréchet derivative with its Schwartz smoothness and decay proofs. -/ -def schwartzDerivative (m : E) (f : 𝓢(E, F)) : 𝓢(E, F) where +@[expose] def schwartzDerivative (m : E) (f : 𝓢(E, F)) : 𝓢(E, F) where toFun x := fderiv ℝ f x m smooth' := by have h : ContDiff ℝ ∞ (fun x => (∂_{m} f) x) := (∂_{m} f : 𝓢(E, F)).smooth' diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzFourier.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzFourier.lean index 9ee7e0d01e..e31bbb7a14 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzFourier.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SchwartzFourier.lean @@ -16,7 +16,7 @@ explicit lets Sobolev norms expose their formula without exposing the analytic p of Fourier inversion and rapid decay. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ variable {V E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [MeasurableSpace V] [BorelSpace V] /-- The ordinary Fourier integral with its Schwartz smoothness and decay proofs. -/ -def schwartzFourier (f : 𝓢(V, E)) : 𝓢(V, E) where +@[expose] def schwartzFourier (f : 𝓢(V, E)) : 𝓢(V, E) where toFun := 𝓕 (f : V → E) smooth' := by have h : ContDiff ℝ ∞ ((𝓕 f : 𝓢(V, E)) : V → E) := (𝓕 f : 𝓢(V, E)).smooth' @@ -47,10 +47,10 @@ private theorem schwartzFourier_eq (f : 𝓢(V, E)) : /-- The bundled Schwartz transform has exactly the ordinary Fourier integral as its values. -/ theorem schwartzFourier_apply (f : 𝓢(V, E)) (x : V) : - schwartzFourier f x = 𝓕 (f : V → E) x := rfl + schwartzFourier f x = 𝓕 (f : V → E) x := by rfl /-- The ordinary Fourier integral as a continuous linear map on Schwartz functions. -/ -def schwartzFourierCLM : 𝓢(V, E) →L[ℂ] 𝓢(V, E) where +@[expose] def schwartzFourierCLM : 𝓢(V, E) →L[ℂ] 𝓢(V, E) where toFun := schwartzFourier map_add' := by intro f g diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SetIntegralL2.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SetIntegralL2.lean index cafa733d34..c8a913992f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SetIntegralL2.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SetIntegralL2.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.CylinderMollifier /-! Set integration as a bounded functional on L², and its commutation with Bochner averages. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothLimit.lean index 31fc859fbb..4eb3c6ae97 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothLimit.lean @@ -22,7 +22,7 @@ derivative of the increments. Smoothness and convergence of the limit are proved not assumed. The divergence is the usual coordinate trace of the first derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothPressureRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothPressureRepresentative.lean index 473cd583d5..2a9ad5dde8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothPressureRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothPressureRepresentative.lean @@ -24,7 +24,7 @@ section /-! Full Fréchet tensor convergence from the genuine cylinder derivative words. -/ -@[expose] public section +public section noncomputable section @@ -105,7 +105,7 @@ section # Smooth Uniform Limit -/ -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ end end -@[expose] public section +public section noncomputable section @@ -255,7 +255,7 @@ end end -@[expose] public section +public section noncomputable section @@ -276,7 +276,8 @@ theorem exists_smooth_representative (U : LiftL2 period) let w : Fin 0 → Fin 4 := Fin.elim0 obtain ⟨g, hg⟩ := exists_smoothMollifier_word_uniform_limit period U (J 3) w have hpoint : ∀ x, Filter.Tendsto (fun n => smoothMollifier period n U x) - Filter.atTop (𝓝 (g x)) := fun x => hg.tendsto_at x + Filter.atTop (𝓝 (g x)) := fun x => by + simpa only [iteratedFieldDerivative_zero] using hg.tendsto_at x have hC : ∀ m (v : Fin m → Fin 4), UniformCauchySeqOn (fun n => iteratedFieldDerivative period v (smoothMollifier period n U)) Filter.atTop Set.univ := diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean index 7317a03bd8..2e1ead5216 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier /-! Sobolev embedding for general smooth fields on R³, without Schwartz assumptions. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -29,7 +29,7 @@ open scoped SchwartzMap ENNReal NNReal ContDiff Topology LineDeriv variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] /-- Repeated directional derivatives of a vector-valued Schwartz function. -/ -noncomputable def pureDerivative (d n : ℕ) (v : Domain d) (f : 𝓢(Domain d, F)) : +@[expose] noncomputable def pureDerivative (d n : ℕ) (v : Domain d) (f : 𝓢(Domain d, F)) : 𝓢(Domain d, F) := schwartzIteratedDerivative (fun _ : Fin n => v) f omit [CompleteSpace F] in @@ -210,7 +210,8 @@ noncomputable def unitBumpCoefficient (n : ℕ) : NNReal := Finset.sum (Finset.range (n+1)) (fun j => (n.choose j : ℝ≥0) * unitBumpBound j) /-- An actual smooth compact localization of an arbitrary smooth function about `x`. -/ -noncomputable def localize (f : Domain 3 → F) (hf : ContDiff ℝ ∞ f) (x : Domain 3) : 𝓢(Domain 3, F) +@[expose] noncomputable def localize (f : Domain 3 → F) (hf : ContDiff ℝ ∞ f) (x : Domain 3) : + 𝓢(Domain 3, F) := (unitBump.hasCompactSupport.smul_right (f' := fun z => f (x+z))).toSchwartzMap (unitBump.contDiff.smul (hf.comp (contDiff_const.add contDiff_id))) @@ -421,7 +422,7 @@ theorem smooth_fderiv_le_H3 (f : Domain 3 → F) (hf : ContDiff ℝ ∞ f) exact hA.trans (hC.trans_eq (he _ _)) /-- The physical tensor Sobolev norm for real Euclidean vector fields. -/ -noncomputable def realTensorSobolevNorm (q s : ℕ) (f : Domain 3 → Domain q) : ℝ := +@[expose] noncomputable def realTensorSobolevNorm (q s : ℕ) (f : Domain 3 → Domain q) : ℝ := Finset.sum (Finset.range (s+1)) (fun j => (eLpNorm (iteratedFDeriv ℝ j f) 2 volume).toReal) theorem complexification_tensor_norm (q j : ℕ) (f : Domain 3 → Domain q) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean index fc0783066a..bf8a48a3a6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean @@ -19,7 +19,7 @@ the L² norm of `(1 + |ξ|²)^(s/2) 𝓕f(ξ)`, so its relation to the represent function is explicit. All estimates are proved from inversion and Hölder. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ theorem weightedFourier_apply (d : ℕ) (s : ℝ) (f : 𝓢(Domain d, F)) (ξ : simp [weightedFourier, SchwartzMap.smulLeftCLM_apply_apply (besselWeight_temperate d s)] /-- The inhomogeneous Fourier `Hˢ` norm of a Schwartz function. -/ -noncomputable def sobolevNorm (d : ℕ) (s : ℝ) (f : 𝓢(Domain d, F)) : ℝ := +@[expose] noncomputable def sobolevNorm (d : ℕ) (s : ℝ) (f : 𝓢(Domain d, F)) : ℝ := ‖(weightedFourier d s f).toLp 2‖ /-- Fourier inversion bounds a Schwartz function pointwise by the L¹ norm of its transform. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDefinitions.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDefinitions.lean index 71e7c88869..9ea1237823 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDefinitions.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDefinitions.lean @@ -18,7 +18,7 @@ The physical domain, embedding constant, and Schwartz derivatives used by the cylinder estimates are independent of Fourier inversion. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ open scoped SchwartzMap ENNReal ContDiff LineDeriv abbrev Domain (d : ℕ) := EuclideanSpace ℝ (Fin d) /-- The Fourier weight defining the inhomogeneous Sobolev order `s`. -/ -noncomputable def besselWeight (d : ℕ) (s : ℝ) (ξ : Domain d) : ℝ := +@[expose] noncomputable def besselWeight (d : ℕ) (s : ℝ) (ξ : Domain d) : ℝ := (1 + ‖ξ‖ ^ 2) ^ (s / 2) theorem besselWeight_temperate (d : ℕ) (s : ℝ) : @@ -85,12 +85,12 @@ theorem reciprocal_weight_memLp (d : ℕ) (s : ℝ) (hs : (d : ℝ) < 2 * s) : ring /-- The reciprocal Fourier weight represented as a genuine `L²` element. -/ -noncomputable def reciprocalWeightLp (d : ℕ) (s : ℝ) (hs : (d : ℝ) < 2 * s) : +@[expose] noncomputable def reciprocalWeightLp (d : ℕ) (s : ℝ) (hs : (d : ℝ) < 2 * s) : Lp ℝ 2 (volume : Measure (Domain d)) := (reciprocal_weight_memLp d s hs).toLp (besselWeight d (-s)) /-- A finite Sobolev embedding constant: the `L²` norm of the reciprocal weight. -/ -noncomputable def embeddingConstant (d : ℕ) (s : ℝ) (hs : (d : ℝ) < 2 * s) : ℝ := +@[expose] noncomputable def embeddingConstant (d : ℕ) (s : ℝ) (hs : (d : ℝ) < 2 * s) : ℝ := ‖reciprocalWeightLp d s hs‖ end EulerSobolev @@ -101,7 +101,7 @@ open EulerSobolev open scoped SchwartzMap LineDeriv /-- Repeated differentiation in one fixed direction, as a Schwartz function. -/ -noncomputable def directional (d n : ℕ) (v : Domain d) (f : 𝓢(Domain d, ℂ)) : +@[expose] noncomputable def directional (d n : ℕ) (v : Domain d) (f : 𝓢(Domain d, ℂ)) : 𝓢(Domain d, ℂ) := schwartzIteratedDerivative (fun _ : Fin n => v) f end EulerSobolevProducts diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean index 1cfb0532ea..f527ab77a5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier /-! The Fourier H³ norm is controlled by genuine third directional derivatives in L². -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean index 4758c7a6d0..bead370a06 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier # Sobolev Products -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ theorem directional_eq_iteratedDeriv (d n : ℕ) (v x : Domain d) iteratedFDeriv_comp_add_left] /-- Pointwise multiplication of two complex Schwartz functions. -/ -noncomputable def product (d : ℕ) (f g : 𝓢(Domain d, ℂ)) : 𝓢(Domain d, ℂ) := +@[expose] noncomputable def product (d : ℕ) (f g : 𝓢(Domain d, ℂ)) : 𝓢(Domain d, ℂ) := SchwartzMap.pairing (ContinuousLinearMap.mul ℂ ℂ) f g @[simp] theorem product_apply (d : ℕ) (f g : 𝓢(Domain d, ℂ)) (x : Domain d) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialCutoffs.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialCutoffs.lean index 605f412e38..af62f62566 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialCutoffs.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialCutoffs.lean @@ -27,7 +27,7 @@ section # Gevrey Cutoff -/ -@[expose] public section +public section noncomputable section @@ -321,7 +321,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean index dfcf92048c..fa032b560b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean @@ -18,7 +18,7 @@ The pressure jet is constructed, rather than assumed, from coercivity and pointwise smooth coefficient data. -/ -@[expose] public section +public section noncomputable section @@ -76,7 +76,7 @@ theorem measurable (A : SmoothCoefficient period) : (smoothField_continuous period A.coefficient A.smooth).aestronglyMeasurable /-- Actual multiplication by the coefficient field in L². -/ -def operator (A : SmoothCoefficient period) : LiftL2 period →L[ℝ] LiftL2 period := +@[expose] def operator (A : SmoothCoefficient period) : LiftL2 period →L[ℝ] LiftL2 period := coefficientOperator A.coefficient A.measurable A.bound A.norm_bound theorem operator_ae (A : SmoothCoefficient period) (f : LiftL2 period) : @@ -88,7 +88,7 @@ theorem operator_norm (A : SmoothCoefficient period) (f : LiftL2 period) : coefficientApply_norm_le A.coefficient A.measurable A.bound A.norm_bound f /-- The Lax–Milgram pressure associated with this actual coefficient. -/ -def pressure (A : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) +@[expose] def pressure (A : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ x v, c * ‖v‖ ^ 2 ≤ ⟪A.coefficient x v, v⟫_ℝ) (f : LiftL2 period) : LiftL2 period := liftedPressure period κ m A.coefficient A.measurable A.bound A.norm_bound c hc hpos f @@ -215,14 +215,14 @@ namespace SpatialJet variable {period} {directions : Fin 4 → LiftTangent} /-- Forget the highest derivative order of a genuine spatial jet. -/ -def truncate {n : ℕ} {f : LiftL2 period} (J : SpatialJet period directions (n + 1) f) : +@[expose] def truncate {n : ℕ} {f : LiftL2 period} (J : SpatialJet period directions (n + 1) f) : SpatialJet period directions n f := match n, J with | 0, _ => .zero f | _n + 1, .succ df lower hd => .succ df (fun i => (lower i).truncate) hd /-- The sum of all derivative-word L² norms represented by the jet. -/ -def sobolevNorm {n : ℕ} {f : LiftL2 period} (J : SpatialJet period directions n f) : ℝ := +@[expose] def sobolevNorm {n : ℕ} {f : LiftL2 period} (J : SpatialJet period directions n f) : ℝ := match J with | .zero f => ‖f‖ | .succ _ lower _ => ‖f‖ + ∑ i, (lower i).sobolevNorm @@ -260,7 +260,7 @@ theorem lower_norm_le {n : ℕ} {f : LiftL2 period} (df : Fin 4 → LiftL2 perio (le_add_of_nonneg_left (norm_nonneg f)) /-- Addition preserves the actual strong derivatives recorded in a spatial jet. -/ -def add {n : ℕ} {f g : LiftL2 period} +@[expose] def add {n : ℕ} {f g : LiftL2 period} (J : SpatialJet period directions n f) (K : SpatialJet period directions n g) : SpatialJet period directions n (f + g) := match J, K with @@ -271,7 +271,7 @@ def add {n : ℕ} {f g : LiftL2 period} first | rfl | (funext t; simp)) /-- Subtraction preserves the actual strong derivatives recorded in a spatial jet. -/ -def sub {n : ℕ} {f g : LiftL2 period} +@[expose] def sub {n : ℕ} {f g : LiftL2 period} (J : SpatialJet period directions n f) (K : SpatialJet period directions n g) : SpatialJet period directions n (f - g) := match J, K with @@ -320,14 +320,14 @@ namespace CoefficientJet variable {period} {directions : Fin 4 → LiftTangent} /-- Forget the highest derivative level while retaining the original coefficient. -/ -def truncate {n : ℕ} {A : SmoothCoefficient period} +@[expose] def truncate {n : ℕ} {A : SmoothCoefficient period} (J : CoefficientJet period directions (n + 1) A) : CoefficientJet period directions n A := match n, J with | 0, _ => .zero A | _n + 1, .succ dA lower hd => .succ dA (fun i => (lower i).truncate) hd /-- A finite polynomial bound for multiplication in the jet Sobolev norm. -/ -def productConstant {n : ℕ} {A : SmoothCoefficient period} +@[expose] def productConstant {n : ℕ} {A : SmoothCoefficient period} (J : CoefficientJet period directions n A) : ℝ := match J with | .zero A => A.bound @@ -354,7 +354,7 @@ namespace SpatialJet variable {period} {directions : Fin 4 → LiftTangent} /-- Construct every finite-order derivative of actual coefficient multiplication. -/ -def multiply {n : ℕ} {A : SmoothCoefficient period} {f : LiftL2 period} +@[expose] def multiply {n : ℕ} {A : SmoothCoefficient period} {f : LiftL2 period} (K : CoefficientJet period directions n A) (J : SpatialJet period directions n f) : SpatialJet period directions n (A.operator f) := match n, K, J with @@ -415,7 +415,7 @@ namespace CoefficientJet variable {period} {directions : Fin 4 → LiftTangent} /-- The explicit finite-order inverse constant obtained from coercivity and coefficient products. -/ -def pressureConstant {n : ℕ} {A : SmoothCoefficient period} +@[expose] def pressureConstant {n : ℕ} {A : SmoothCoefficient period} (J : CoefficientJet period directions n A) (c : ℝ) : ℝ := match J with | .zero _ => c⁻¹ @@ -528,7 +528,7 @@ namespace SpatialJet variable {period} {directions : Fin 4 → LiftTangent} /-- A derivative word, ordered with its head differentiated last; invalid orders return zero. -/ -def word {s : ℕ} {f : LiftL2 period} (J : SpatialJet period directions s f) +@[expose] def word {s : ℕ} {f : LiftL2 period} (J : SpatialJet period directions s f) {n : ℕ} (w : Fin n → Fin 4) : LiftL2 period := match n, J with | 0, _ => f @@ -572,7 +572,8 @@ theorem word_hasDerivAt {s n : ℕ} {f : LiftL2 period} rfl /-- Split a coordinate word into its last direction and its initial word. -/ -def wordSnocEquiv (n : ℕ) : (Fin (n + 1) → Fin 4) ≃ Fin 4 × (Fin n → Fin 4) where +@[expose] def wordSnocEquiv (n : ℕ) : + (Fin (n + 1) → Fin 4) ≃ Fin 4 × (Fin n → Fin 4) where toFun w := (w (Fin.last n), Fin.init w) invFun v := Fin.snoc v.2 v.1 left_inv w := Fin.snoc_init_self w diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/StrongSmoothJet.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/StrongSmoothJet.lean index 77f4437b43..e1438d029a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/StrongSmoothJet.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/StrongSmoothJet.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Strong L² derivatives of smooth representatives are their actual classical derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/TransportDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/TransportDerivatives.lean index ee6adccb18..1c8c1918cb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/TransportDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/TransportDerivatives.lean @@ -15,7 +15,7 @@ The commutator is derived by the chain rule and symmetry of second derivatives, rather than postulated as a recurrence on a norm sequence. -/ -@[expose] public section +public section noncomputable section @@ -30,10 +30,10 @@ variable {V W : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] /-- The actual Fréchet directional derivative along a constant vector. -/ -def directionalDerivative (a : V) (f : V → W) (x : V) : W := fderiv ℝ f x a +@[expose] def directionalDerivative (a : V) (f : V → W) (x : V) : W := fderiv ℝ f x a /-- Differentiation of a field in the direction of a variable transport field. -/ -def transport (b : V → V) (f : V → W) (x : V) : W := fderiv ℝ f x (b x) +@[expose] def transport (b : V → V) (f : V → W) (x : V) : W := fderiv ℝ f x (b x) theorem directionalDerivative_smooth (a : V) (f : V → W) (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (directionalDerivative a f) := by @@ -85,7 +85,7 @@ section Fields variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Directional differentiation in the cylinder covering coordinates. -/ -def fieldDerivative (a : LiftTangent) (f : LiftDomain period → W) +@[expose] def fieldDerivative (a : LiftTangent) (f : LiftDomain period → W) (x : LiftDomain period) : W := fderiv ℝ (localFieldLift period f x) 0 a /-- The actual directional transport operator on a cylinder field. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCalculus.lean index ac03405210..947f5c9fac 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCalculus.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Symmetric # Vector Calculus -/ -@[expose] public section +public section noncomputable section @@ -26,11 +26,11 @@ open EulerSmoothLimit open scoped ContDiff /-- The ordinary coordinate derivative, evaluated using the Fréchet derivative. -/ -def partialDerivative (f : Space → ℝ) (i : Fin 3) (x : Space) : ℝ := +@[expose] def partialDerivative (f : Space → ℝ) (i : Fin 3) (x : Space) : ℝ := fderiv ℝ f x (EuclideanSpace.single i 1) /-- The three-dimensional curl of a vector potential in standard coordinates. -/ -def curl (ψ : Fin 3 → Space → ℝ) (x : Space) : Space := +@[expose] def curl (ψ : Fin 3 → Space → ℝ) (x : Space) : Space := (EuclideanSpace.equiv (𝕜 := ℝ) (ι := Fin 3)).symm (fun i => partialDerivative (ψ (i + 2)) (i + 1) x - partialDerivative (ψ (i + 1)) (i + 2) x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean index 8606880aa4..0c20daefb7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.SobolevDerivativeNorm /-! Real Euclidean vector wrappers for the actual cylinder Sobolev estimates. -/ -@[expose] public section +public section noncomputable section @@ -62,7 +62,11 @@ theorem postcomp_sobolevNorm_le (s : ℕ) (L : F →L[ℝ] G) (hL : ‖L‖ ≤ end Postcomposition /-- A coordinate projection on a real Euclidean target, of operator norm at most one. -/ -noncomputable def coordinate (q : ℕ) (i : Fin q) : Domain q →L[ℝ] ℝ := EuclideanSpace.proj i +@[expose] noncomputable def coordinate (q : ℕ) (i : Fin q) : Domain q →L[ℝ] ℝ := + EuclideanSpace.proj i + +@[simp] theorem coordinate_apply (q : ℕ) (i : Fin q) (x : Domain q) : + coordinate q i x = x i := by rfl theorem coordinate_norm_le (q : ℕ) (i : Fin q) : ‖coordinate q i‖ ≤ 1 := by apply (coordinate q i).opNorm_le_bound (by norm_num) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedConvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedConvolution.lean index 553634b0ed..57a06c7cf0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedConvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedConvolution.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.NatFactorial # Weighted Convolution -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedPressure.lean index a81b9e584c..98bfb801fa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/WeightedPressure.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Star.Real # Weighted Pressure -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/FunctionalVelocity.lean b/LeanPool/NavierStokesAndEuler/Euler/FunctionalVelocity.lean index 6415c57b91..6fc3f671ac 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FunctionalVelocity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FunctionalVelocity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.H6TransportSource /-! Actual four-dimensional velocity fields assembled from bounded vector functionals. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ def velocityMap (L : Fin 4 → Vector3 →L[ℝ] ℝ) : Vector3 →L[ℝ] Domain (ContinuousLinearMap.pi L) @[simp] theorem velocityMap_apply (L : Fin 4 → Vector3 →L[ℝ] ℝ) (z : Vector3) (i : Fin 4) : - velocityMap L z i = L i z := rfl + velocityMap L z i = L i z := by rfl variable (period : ℝ) [Fact (0 < period)] diff --git a/LeanPool/NavierStokesAndEuler/Euler/GainedMildFormula.lean b/LeanPool/NavierStokesAndEuler/Euler/GainedMildFormula.lean index 38cf459fe7..683d9f4355 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GainedMildFormula.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GainedMildFormula.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MildEquationBridge /-! Equivalence between genuine gained-derivative and ordinary heat-Duhamel solution formulas. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatDerivative.lean index 052ad8548c..07a563d1eb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatDerivative.lean @@ -21,7 +21,7 @@ section /-! Gaussian heat averaging in the genuine cylinder L² translation representation. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ private theorem gaussianMeasure_eq_real (μ : ℝ) (v : ℝ≥0) : variable (period : ℝ) [Fact (0 < period)] /-- The actual one-parameter cylinder translation orbit. -/ -def lineOrbit (a : LiftTangent) (f : LiftL2 period) (x : ℝ) : LiftL2 period := +@[expose] def lineOrbit (a : LiftTangent) (f : LiftL2 period) (x : ℝ) : LiftL2 period := translation period (translationPath period a x) f theorem lineOrbit_continuous (a : LiftTangent) (f : LiftL2 period) : @@ -58,7 +58,7 @@ theorem lineOrbit_integrable (a : LiftTangent) (f : LiftL2 period) (μ : Measure (Filter.Eventually.of_forall (fun x => (lineOrbit_norm period a f x).le)) /-- Gaussian averaging with variance v along a cylinder direction. -/ -def lineHeat (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : LiftL2 period := +@[expose] def lineHeat (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : LiftL2 period := ∫ x, lineOrbit period a f x ∂gaussianMeasure 0 v @[simp] theorem lineHeat_zero (a : LiftTangent) (f : LiftL2 period) : lineHeat period a 0 f = f := @@ -92,7 +92,7 @@ def lineHeatOperator (a : LiftTangent) (v : ℝ≥0) : LiftL2 period →L[ℝ] L 1 (fun f => by simpa using lineHeat_norm_le period a v f) @[simp] theorem lineHeatOperator_apply (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : - lineHeatOperator period a v f = lineHeat period a v f := rfl + lineHeatOperator period a v f = lineHeat period a v f := by rfl theorem lineHeatOperator_norm_le (a : LiftTangent) (v : ℝ≥0) : ‖lineHeatOperator period a v‖ ≤ 1 := ContinuousLinearMap.opNorm_le_bound _ zero_le_one (fun f => by @@ -202,7 +202,7 @@ end end -@[expose] public section +public section noncomputable section @@ -290,7 +290,7 @@ theorem gaussianMomentOrbit_integrable (a : LiftTangent) (v : ℝ≥0) (f : Lift rw [norm_smul, lineOrbit_norm] /-- The bounded candidate generator after Gaussian smoothing. -/ -def lineHeatDerivative (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : LiftL2 period := +@[expose] def lineHeatDerivative (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : LiftL2 period := (v : ℝ)⁻¹ • ∫ x : ℝ, x • lineOrbit period a f x ∂gaussianMeasure 0 v theorem lineHeatDerivative_norm_le (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatSmoothing.lean b/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatSmoothing.lean index d2b4509848..a4ccad3c99 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatSmoothing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatSmoothing.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ClosedTranslationGraph /-! Gaussian averaging genuinely gains one strong derivative for every cylinder L² datum. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,7 @@ def lineHeatDerivativeOperator (a : LiftTangent) (v : ℝ≥0) : LiftL2 period ((v : ℝ)⁻¹ * gaussianAbsMoment v) (lineHeatDerivative_norm_le period a v) @[simp] theorem lineHeatDerivativeOperator_apply (a : LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : - lineHeatDerivativeOperator period a v f = lineHeatDerivative period a v f := rfl + lineHeatDerivativeOperator period a v f = lineHeatDerivative period a v f := by rfl /-- Genuine cylinder mollifications are differentiable along every one-parameter translation orbit. -/ @@ -90,10 +90,11 @@ theorem lineHeat_hasDerivAt (a : LiftTangent) {v : ℝ≥0} (hv : 0 < v) (f : Li exact h have hlim : Filter.Tendsto (fun n => (lineHeat period a v (fn n), lineHeatDerivative period a v (fn n))) - Filter.atTop (𝓝 (lineHeat period a v f, lineHeatDerivative period a v f)) := - ((lineHeatOperator period a v).continuous.continuousAt.tendsto.comp (mollify_tendsto period - f)).prodMk_nhds - ((lineHeatDerivativeOperator period a v).continuous.continuousAt.tendsto.comp + Filter.atTop (𝓝 (lineHeat period a v f, lineHeatDerivative period a v f)) := by + simpa only [Function.comp_def, lineHeatOperator_apply, lineHeatDerivativeOperator_apply] using + ((lineHeatOperator period a v).continuous.continuousAt.tendsto.comp + (mollify_tendsto period f)).prodMk_nhds + ((lineHeatDerivativeOperator period a v).continuous.continuousAt.tendsto.comp (mollify_tendsto period f)) exact (translationDerivativeGraph_closed period a).mem_of_tendsto hlim (Filter.Eventually.of_forall hmem) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatTotal.lean b/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatTotal.lean index 55bc3b30d6..b465356e33 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatTotal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GaussianHeatTotal.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.GaussianHeatSmoothing /-! The genuine four-coordinate cylinder heat semigroup and simultaneous derivative gain. -/ -@[expose] public section +public section noncomputable section @@ -27,6 +27,7 @@ open scoped ENNReal NNReal Topology variable (period : ℝ) [Fact (0 < period)] /-- A finite product of commuting directional Gaussian averages. -/ +@[expose] def heatList (directions : List LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : LiftL2 period := match directions with | [] => f @@ -62,7 +63,7 @@ def heatListOperator (directions : List LiftTangent) (v : ℝ≥0) : LiftL2 peri @[simp] theorem heatListOperator_apply (directions : List LiftTangent) (v : ℝ≥0) (f : LiftL2 period) : - heatListOperator period directions v f = heatList period directions v f := rfl + heatListOperator period directions v f = heatList period directions v f := by rfl theorem heatList_translation (directions : List LiftTangent) (v : ℝ≥0) (b : LiftDomain period) (f : LiftL2 period) : @@ -99,9 +100,9 @@ theorem heatList_semigroup (directions : List LiftTangent) (v w : ℝ≥0) (f : /-- A Lipschitz estimate for the Gaussian operator in its input field. -/ theorem lineHeat_dist_le (a : LiftTangent) (v : ℝ≥0) (f g : LiftL2 period) : dist (lineHeat period a v f) (lineHeat period a v g) ≤ dist f g := by - change dist (lineHeatOperator period a v f) (lineHeatOperator period a v g) ≤ dist f g + rw [← lineHeatOperator_apply, ← lineHeatOperator_apply] rw [dist_eq_norm, ← map_sub, dist_eq_norm] - exact lineHeat_norm_le period a v (f-g) + simpa only [lineHeatOperator_apply] using lineHeat_norm_le period a v (f-g) /-- Joint continuity follows from contraction in the field and strong continuity in variance. -/ theorem lineHeat_joint_continuous (a : LiftTangent) : @@ -152,12 +153,16 @@ theorem heatList_one_derivative (directions : List LiftTangent) (a : LiftTangent exact (lineHeat_norm_le period b v g).trans hgb /-- The four actual commuting standard coordinate directions on R³×T. -/ -def cylinderDirections : List LiftTangent := List.ofFn standardDirection +@[expose] def cylinderDirections : List LiftTangent := List.ofFn standardDirection /-- The actual cylinder heat semigroup, parameterized by Gaussian variance. -/ -def cylinderHeat (v : ℝ≥0) : LiftL2 period →L[ℝ] LiftL2 period := +@[expose] def cylinderHeat (v : ℝ≥0) : LiftL2 period →L[ℝ] LiftL2 period := heatListOperator period cylinderDirections v +@[simp] theorem cylinderHeat_apply (v : ℝ≥0) (f : LiftL2 period) : + cylinderHeat period v f = heatList period cylinderDirections v f := by + exact heatListOperator_apply period cylinderDirections v f + theorem cylinderHeat_norm_le (v : ℝ≥0) (f : LiftL2 period) : ‖cylinderHeat period v f‖ ≤ ‖f‖ := heatList_norm_le period cylinderDirections v f diff --git a/LeanPool/NavierStokesAndEuler/Euler/GaussianKernels.lean b/LeanPool/NavierStokesAndEuler/Euler/GaussianKernels.lean index 189e695b8f..8e3506bfbe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GaussianKernels.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GaussianKernels.lean @@ -14,7 +14,7 @@ import Mathlib.Probability.Distributions.Gaussian.Real /-! Explicit Gaussian kernels used by the heat operators. The probability theory needed to establish their mass stays in the proofs, while the kernel formulas remain transparent. -/ -@[expose] public section +public section noncomputable section @@ -24,11 +24,11 @@ open MeasureTheory open scoped NNReal /-- The real Gaussian density with mean `μ` and variance `v`. -/ -def gaussianDensity (μ : ℝ) (v : ℝ≥0) (x : ℝ) : ℝ := +@[expose] def gaussianDensity (μ : ℝ) (v : ℝ≥0) (x : ℝ) : ℝ := (Real.sqrt (2 * Real.pi * v))⁻¹ * Real.exp (-(x - μ) ^ 2 / (2 * v)) /-- The Gaussian measure, with a point mass when its variance is zero. -/ -def gaussianMeasure (μ : ℝ) (v : ℝ≥0) : Measure ℝ := +@[expose] def gaussianMeasure (μ : ℝ) (v : ℝ≥0) : Measure ℝ := if v = 0 then Measure.dirac μ else volume.withDensity (fun x => ENNReal.ofReal (gaussianDensity μ v x)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean index 368fec3f2f..c061267edc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Actual cylinder Sobolev multiplication at every fixed integer order q ≥ 6. -/ -@[expose] public section +public section noncomputable section @@ -97,7 +97,8 @@ theorem tensor_le_totalMagnitude {q n : ℕ} (hn : n ≤ q) (f : LiftDomain peri exact hA.trans (wordMagnitude_le_total period q n hn f x) /-- The square-integrable envelope obtained by putting one factor in L∞ and the other in L². -/ -def productEnvelope (q : ℕ) (f g : LiftDomain period → ℂ) : LiftDomain period → ℝ := +@[expose] def productEnvelope (q : ℕ) (f g : LiftDomain period → ℂ) : + LiftDomain period → ℝ := liftSobolevNorm period q f • totalMagnitude period q g + liftSobolevNorm period q g • totalMagnitude period q f @@ -266,7 +267,7 @@ theorem product_word_L2_le {q n : ℕ} (hq : 6 ≤ q) (hn : n ≤ q) (w : Fin n exact hB.trans (hC.trans_eq (by ring)) /-- A finite explicit algebra constant for each fixed Sobolev order. -/ -def algebraConstant (q : ℕ) : ℝ := +@[expose] def algebraConstant (q : ℕ) : ℝ := (∑ n ∈ Finset.range (q + 1), (4 : ℝ) ^ n) * ((2 : ℝ) ^ q * lowDerivativeConstant period q * 2) /-- The fixed-order algebra constant is nonnegative. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean index 9cba934db4..b6b5878b9d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean @@ -19,7 +19,7 @@ The Faà di Bruno partition estimate gives the fixed output radius `R * (B*S + 2)`, independently of the derivative order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean index e3a18e5bc0..ae40c88e08 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean @@ -22,7 +22,7 @@ Only the inner positive derivatives are bounded in sup norm. The outer L² norm is transported by a measure-preserving map, so it is not replaced by a pointwise bound or by a volume of the ambient domain. -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ variable {E F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Inner partition bound, given by `∏ i, B*R^(c.partSize i)*((c.partSize i).factorial : ℝ)^2`. -/ -def innerPartitionBound {n : ℕ} (B R : ℝ) (c : OrderedFinpartition n) : ℝ := +@[expose] def innerPartitionBound {n : ℕ} (B R : ℝ) (c : OrderedFinpartition n) : ℝ := ∏ i, B*R^(c.partSize i)*((c.partSize i).factorial : ℝ)^2 lemma innerPartitionBound_nonneg {n : ℕ} (B R : ℝ) (hB : 0 ≤ B) (hR : 0 ≤ R) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionPartitions.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionPartitions.lean index 5a870f9641..302f4db741 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionPartitions.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionPartitions.lean @@ -17,7 +17,7 @@ at most `(n + 1)^2 * (x + 2)`. This avoids replacing every derivative in the composition formula by the largest derivative bound. -/ -@[expose] public section +public section noncomputable section @@ -52,15 +52,15 @@ lemma sum_partSize_succ_sq_le (c : OrderedFinpartition n) : _ ≤ _ := by nlinarith /-- Factorial product, given by `∏ i, ((c.partSize i).factorial : ℝ)`. -/ -def factorialProduct (c : OrderedFinpartition n) : ℝ := +@[expose] def factorialProduct (c : OrderedFinpartition n) : ℝ := ∏ i, ((c.partSize i).factorial : ℝ) /-- Partition weight, given by `x^c.length * ((c.length.factorial : ℝ) * factorialProduct c)^2`. -/ -def partitionWeight (x : ℝ) (c : OrderedFinpartition n) : ℝ := +@[expose] def partitionWeight (x : ℝ) (c : OrderedFinpartition n) : ℝ := x^c.length * ((c.length.factorial : ℝ) * factorialProduct c)^2 /-- Partition sum, given by `∑ c : OrderedFinpartition n, partitionWeight x c`. -/ -def partitionSum (n : ℕ) (x : ℝ) : ℝ := +@[expose] def partitionSum (n : ℕ) (x : ℝ) : ℝ := ∑ c : OrderedFinpartition n, partitionWeight x c lemma partitionWeight_nonneg (x : ℝ) (hx : 0 ≤ x) (c : OrderedFinpartition n) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionBound.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionBound.lean index fe0d8f620f..7243ce685f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionBound.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! The actual nonlinear correction forcing with explicit constants independent of the derivative cutoff. -/ -@[expose] public section +public section noncomputable section @@ -32,14 +32,14 @@ open MeasureTheory InnerProductSpace EulerLiftedGradientSpace EulerCylinderSobol variable (period : ℝ) [Fact (0 < period)] /-- The coefficient multiplying the actual order-zero forcing. -/ -def sourceConstant (B M : ℝ) : ℝ := 1+2*M*(3136*B+1) +@[expose] def sourceConstant (B M : ℝ) : ℝ := 1+2*M*(3136*B+1) /-- The coefficient for actual base transport and the lower-order nonlinear pressure commutator. -/ -def transportConstant (B M : ℝ) : ℝ := +@[expose] def transportConstant (B M : ℝ) : ℝ := 5461*baseTransportConstant period + 2688*B*(8*M*(5460*lowerProductConstant period 3)) /-- The coefficient for the actual external radius loss. -/ -def lossConstant (M : ℝ) : ℝ := (4+32*M)*productConstant period 3 +@[expose] def lossConstant (M : ℝ) : ℝ := (4+32*M)*productConstant period 3 omit [Fact (0 < period)] in theorem sourceConstant_nonneg {B M : ℝ} (hB : 0 ≤ B) (hM : 0 ≤ M) : 0 ≤ sourceConstant B M := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean index ba7964a6b8..1031aa8d41 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean @@ -30,7 +30,7 @@ section /-! The fixed-base transport commutator estimate with only H⁶ velocity norms. -/ -@[expose] public section +public section noncomputable section @@ -134,7 +134,7 @@ section /-! Genuine transport as a bounded bilinear map from Sobolev velocity and an H¹ transported field into L². -/ -@[expose] public section +public section noncomputable section @@ -213,7 +213,7 @@ section /-! Transfer of continuous real inequalities from actual smooth H∞ representatives to finite Sobolev fields. -/ -@[expose] public section +public section noncomputable section @@ -265,7 +265,7 @@ end end -@[expose] public section +public section noncomputable section @@ -399,7 +399,7 @@ section /-! Summation of the actual base transport commutators with no external-cutoff constant. -/ -@[expose] public section +public section noncomputable section @@ -520,7 +520,7 @@ section /-! Literal differentiated forcing arrays and their actual finite Gevrey norms. -/ -@[expose] public section +public section noncomputable section @@ -668,7 +668,7 @@ end end -@[expose] public section +public section noncomputable section @@ -690,7 +690,7 @@ variable (period : ℝ) [Fact (0 < period)] (17). The two pressure arguments are the positive projected inverses; the PDE pressure has the opposite sign. -/ -def correctionForcing {s : ℕ} (hs : 6 ≤ s) {A : SmoothCoefficient period} +@[expose] def correctionForcing {s : ℕ} (hs : 6 ≤ s) {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection s A) (K0 : EulerSpatialSobolevInverse.CoefficientJet period standardDirection 6 A) (N : ℕ) (hN : N + 6 ≤ s) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSourceBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSourceBounds.lean index 6d1057b94e..46b6b1dc0c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSourceBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSourceBounds.lean @@ -18,7 +18,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Actual raw-source, elliptic-pressure, and time-source bounds at a smaller radius. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ open Set Finset EulerLiftedGradientSpace EulerCylinderSobolevSpace EulerCylinder variable (period : ℝ) [Fact (0 < period)] /-- The explicit polynomial controlling the literal unprojected correction source. -/ -def sourceBound (B0 B1 A0 A2 residual E DE : ℝ) : ℝ := +@[expose] def sourceBound (B0 B1 A0 A2 residual E DE : ℝ) : ℝ := productConstant period 3*(B0+E)*DE + residual + (productConstant period 3*B1+A0+2*A2*productConstant period 3*B0)*E + A2*productConstant period 3*E^2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSplit.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSplit.lean index 62af14ffdd..0e0950ba82 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSplit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionSplit.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.EulerCorrectionEquation /-! Exact transport/order-zero splitting of the constructed correction source and its actual pressure. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyDifferentiatedEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyDifferentiatedEquation.lean index 2cd197b191..0edc2c5b56 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyDifferentiatedEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyDifferentiatedEquation.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.GevreyCorrectionForcing /-! Exact spatial differentiation of the actual nonlinear correction equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyFixedShift.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyFixedShift.lean index 8ed5f1f8bc..d9378c6b83 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyFixedShift.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyFixedShift.lean @@ -18,7 +18,7 @@ bounded inverse becomes a shift-zero coefficient estimate at a larger fixed radius. The enlargement is independent of the derivative order. -/ -@[expose] public section +public section namespace EulerGevrey diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean index 2dc6eb7f63..ca4dff28e9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean @@ -33,7 +33,7 @@ The polynomials below are auxiliary nonnegative scalar polynomials. Their composition is the exact scalar Faà di Bruno sum, not an assumed majorant for a flow or for a solution of a differential equation. -/ -@[expose] public section +public section noncomputable section @@ -207,7 +207,7 @@ end end -@[expose] public section +public section noncomputable section @@ -300,11 +300,11 @@ theorem generating_sum_le_polynomial _ = _ := by simp only [Polynomial.eval_comp, p, q] /-- Normalized jet, given by `‖P n‖/(n.factorial : ℝ)^2`. -/ -def normalizedJet (P : FormalMultilinearSeries ℝ E F) (n : ℕ) : ℝ := +@[expose] def normalizedJet (P : FormalMultilinearSeries ℝ E F) (n : ℕ) : ℝ := ‖P n‖/(n.factorial : ℝ)^2 /-- Generating sum, given by `∑ n ∈ Finset.Icc 1 N, normalizedJet P n*z^n`. -/ -def generatingSum (P : FormalMultilinearSeries ℝ E F) (N : ℕ) (z : ℝ) : ℝ := +@[expose] def generatingSum (P : FormalMultilinearSeries ℝ E F) (N : ℕ) (z : ℝ) : ℝ := ∑ n ∈ Finset.Icc 1 N, normalizedJet P n*z^n theorem generatingSum_nonneg (P : FormalMultilinearSeries ℝ E F) @@ -363,7 +363,7 @@ source (21). A first-hitting argument proves the bound from an integral inequality valid only inside its radius of convergence. No global smallness of the unknown path or exponential flow bound is assumed. -/ -@[expose] public section +public section noncomputable section @@ -412,7 +412,7 @@ theorem continuous_barrier (f : ℝ → ℝ) (T B a : ℝ) exact hstep t ht (fun s hs => (hstrict s ⟨hs.1,hs.2.trans ht.2⟩).le) /-- Rational rate, given by `B*(R*(a+u))/(1-R*(a+u))`. -/ -def rationalRate (B R a u : ℝ) : ℝ := B*(R*(a+u))/(1-R*(a+u)) +@[expose] def rationalRate (B R a u : ℝ) : ℝ := B*(R*(a+u))/(1-R*(a+u)) theorem rationalRate_le (B R a u : ℝ) (hB : 0 ≤ B) (hu : R * (a + u) ≤ 1 / 2) : rationalRate B R a u ≤ B := by @@ -472,7 +472,7 @@ end end -@[expose] public section +public section noncomputable section @@ -488,7 +488,7 @@ variable {E F G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] /-- Derivative sum, given by `generatingSum (ftaylorSeries ℝ f x) N z`. -/ -def derivativeSum (f : E → F) (N : ℕ) (z : ℝ) (x : E) : ℝ := +@[expose] def derivativeSum (f : E → F) (N : ℕ) (z : ℝ) (x : E) : ℝ := generatingSum (ftaylorSeries ℝ f x) N z theorem derivativeSum_nonneg (f : E → F) (N : ℕ) (z : ℝ) (x : E) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyGrowthCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyGrowthCoefficient.lean index 38e1aec3bb..c9fca41432 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyGrowthCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyGrowthCoefficient.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Actual metric-energy growth coefficients bounded uniformly for artificial viscosities at most one. -/ -@[expose] public section +public section noncomputable section @@ -26,12 +26,13 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The viscosity-uniform constant part of the actual metric growth coefficient. -/ +@[expose] def growthBase (K : SmoothCoefficient period) (K' : LiftL2 period →L[ℝ] LiftL2 period) (c : ℝ) : ℝ := (‖K'‖+2*heatEnergyConstant period K c)/(2*c^2) /-- The exact slope of the actual metric growth coefficient with respect to the velocity bound. -/ -def growthSlope (K : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (c : ℝ) : ℝ := +@[expose] def growthSlope (K : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (c : ℝ) : ℝ := (K.firstBound : ℝ)*(|κ|+‖m‖)/(2*c^2) theorem growthBase_nonneg (K : SmoothCoefficient period) (K' : LiftL2 period →L[ℝ] LiftL2 period) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean index 8d9e4440bd..2d6b401dd4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean @@ -31,7 +31,7 @@ Faà di Bruno partition sum stays bounded at every positive order, provided its scalar argument is at most one half. -/ -@[expose] public section +public section noncomputable section @@ -192,7 +192,7 @@ end end -@[expose] public section +public section noncomputable section @@ -268,7 +268,7 @@ theorem norm_iteratedFDeriv_comp_predecessor_at (ftaylorSeries ℝ f x) n hn A B R S hA hB hR hS hBS hgjet hfjet /-- Inverse map radius, given by `1 + 2*C*R`. -/ -def inverseMapRadius (C R : ℝ) : ℝ := 1 + 2*C*R +@[expose] def inverseMapRadius (C R : ℝ) : ℝ := 1 + 2*C*R lemma inverseMapRadius_ge_one (C R : ℝ) (hC : 0 ≤ C) (hR : 0 ≤ R) : 1 ≤ inverseMapRadius C R := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyInviscidEnergyCompactness.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyInviscidEnergyCompactness.lean index ddd42d3f3b..9d8e348f3b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyInviscidEnergyCompactness.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyInviscidEnergyCompactness.lean @@ -24,7 +24,7 @@ section /-! The actual nonlinear Gevrey bootstrap applies uniformly to every partial correction solution. -/ -@[expose] public section +public section noncomputable section @@ -100,7 +100,7 @@ end end -@[expose] public section +public section noncomputable section @@ -193,7 +193,7 @@ section /-! A genuine uniformly bounded viscous approximation family with a uniformly vanishing PDE viscosity term. -/ -@[expose] public section +public section noncomputable section @@ -255,7 +255,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean index f3b045c467..d0fdc42aff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean @@ -17,7 +17,7 @@ version allows the base to be a periodic cylinder while the derivatives are tensors on its Euclidean cover. The output is the literal finite Taylor composition of the given jets. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyLowNorms.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyLowNorms.lean index abe16246ca..723b711028 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyLowNorms.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyLowNorms.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.GevreyMetricComparison /-! Fixed-base pointwise and metric-loss control by actual finite Gevrey norms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricComparison.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricComparison.lean index a47cdad3c7..1fda1418da 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricComparison.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricComparison.lean @@ -18,7 +18,7 @@ section /-! Exact identification of the source's base-Sobolev word sum and root metric energy. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ theorem card_baseWord (s : ℕ) : Fintype.card (BaseWord s) = ∑ n ∈ Finset.r exact Fin.sum_univ_eq_sum_range (fun n => 4 ^ n) (s + 1) /-- The source's root-of-sum metric energy for all base Sobolev words. -/ -def baseWordMetricNorm {s : ℕ} {f : LiftL2 period} (K : LiftL2 period →L[ℝ] LiftL2 period) +@[expose] def baseWordMetricNorm {s : ℕ} {f : LiftL2 period} (K : LiftL2 period →L[ℝ] LiftL2 period) (J : SpatialJet period standardDirection s f) : ℝ := familyMetricNorm K (baseWordValues period J) @@ -87,7 +87,7 @@ end end -@[expose] public section +public section noncomputable section @@ -106,7 +106,7 @@ variable (period : ℝ) [Fact (0 < period)] abbrev ExternalWord (N : ℕ) := Σ n : Fin (N+1), Fin n.val → Fin 4 /-- Literal base derivatives of each external word of an actual Sobolev field. -/ -def energyValues {s : ℕ} (q N : ℕ) (hN : N + q ≤ s) (u : SobolevSpace period s) : +@[expose] def energyValues {s : ℕ} (q N : ℕ) (hN : N + q ≤ s) (u : SobolevSpace period s) : ExternalWord N → BaseWord q → LiftL2 period := fun I => baseWordValues period (EulerH6Pressure.SpatialJet.derivativeJet (q := q) (toJet period u) I.2 (by have := I.1.isLt; omega)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricEstimate.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricEstimate.lean index 6eae973f04..beeea9fa67 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricEstimate.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyMetricEstimate.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.GevreyLowNorms /-! Actual metric Gevrey energies, fixed norm conversion, and nonlinear scalar growth bounds. -/ -@[expose] public section +public section noncomputable section @@ -28,17 +28,17 @@ open MeasureTheory InnerProductSpace EulerLiftedGradientSpace EulerCylinderSobol variable (period : ℝ) [Fact (0 < period)] /-- The actual fixed-base metric Gevrey energy of one complete Sobolev field. -/ -def energyNorm {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) +@[expose] def energyNorm {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) (K : LiftL2 period →L[ℝ] LiftL2 period) (u : SobolevSpace period s) : ℝ := weightedMetricSum ρ (fun I : ExternalWord N => I.1.val) K (energyValues period 6 N hN u) /-- The actual metric radius-loss quantity at the same cutoff. -/ -def energyLoss {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) +@[expose] def energyLoss {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) (K : LiftL2 period →L[ℝ] LiftL2 period) (u : SobolevSpace period s) : ℝ := weightedMetricLoss ρ (fun I : ExternalWord N => I.1.val) K (energyValues period 6 N hN u) /-- A fixed conversion factor, with no external derivative cutoff in its definition. -/ -def metricAmplification (c : ℝ) : ℝ := 1+Real.sqrt 5461/c +@[expose] def metricAmplification (c : ℝ) : ℝ := 1+Real.sqrt 5461/c theorem energyNorm_nonneg {s : ℕ} (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) (hρ : 0 < ρ) (K : LiftL2 period →L[ℝ] LiftL2 period) (u : SobolevSpace period s) : 0 ≤ energyNorm period N diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyNonlinearEstimate.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyNonlinearEstimate.lean index a5d83a6e01..1f1c116f1f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyNonlinearEstimate.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyNonlinearEstimate.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! The scalar polynomial majorant derived from the actual nonlinear Euler correction forcing. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyOrderZero.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyOrderZero.lean index 71cf924ba9..7ffe63889a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyOrderZero.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyOrderZero.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.VectorCylinder /-! Cutoff-independent bounds for the actual order-zero Euler correction source. -/ -@[expose] public section +public section noncomputable section @@ -33,13 +33,13 @@ synthesis. -/ local instance orderZeroSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual derivative-free algebraic nonlinearity at one complete Sobolev level. -/ -def algebraicAt {s : ℕ} (hs : 6 ≤ s) +@[expose] def algebraicAt {s : ℕ} (hs : 6 ≤ s) (C : Fin 3 → SobolevSpace period s →L[ℝ] SobolevSpace period s) (u v : SobolevSpace period s) : SobolevSpace period s := ∑ i : Fin 3, C i (productHq period hs (coordinate 3 i) (coordinate_norm_le 3 i) u v) /-- The part e·D z_a transports the prescribed background and has no derivative on the error. -/ -def backgroundDrift {s : ℕ} (hs : 6 ≤ s) +@[expose] def backgroundDrift {s : ℕ} (hs : 6 ≤ s) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) (background : SobolevSpace period (s + 1)) (e : SobolevSpace period s) : SobolevSpace period s := @@ -81,7 +81,7 @@ theorem backgroundDrift_bound {s : ℕ} (hs : 6 ≤ s) (N : ℕ) (hN : N + 6 ≤ _ = _ := (Finset.mul_sum ..).symm /-- The actual order-zero source Z(e)+r_a in the transformed Euler correction equation. -/ -def orderZeroSource {s : ℕ} (hs : 6 ≤ s) +@[expose] def orderZeroSource {s : ℕ} (hs : 6 ≤ s) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) (C0 : SobolevSpace period s →L[ℝ] SobolevSpace period s) (C : Fin 3 → SobolevSpace period s →L[ℝ] SobolevSpace period s) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyPathNorm.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyPathNorm.lean index dd7d437b55..a9a5fde14a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyPathNorm.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyPathNorm.lean @@ -34,7 +34,7 @@ section /-! Actual complete-Sobolev control from a positive-radius finite Gevrey bound, for parabolic continuation. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ end end -@[expose] public section +public section noncomputable section @@ -172,7 +172,7 @@ section /-! The actual finite Gevrey metric energy passes to strong Sobolev limits. -/ -@[expose] public section +public section noncomputable section @@ -240,7 +240,7 @@ section /-! Monotonicity of the actual finite Gevrey metric energy in the external cutoff. -/ -@[expose] public section +public section noncomputable section @@ -300,7 +300,7 @@ end end -@[expose] public section +public section noncomputable section @@ -348,7 +348,7 @@ section /-! Genuine finite-time continuation of actual viscous mild solutions from an a priori Sobolev bound. -/ -@[expose] public section +public section noncomputable section @@ -438,7 +438,7 @@ end end -@[expose] public section +public section noncomputable section @@ -493,7 +493,7 @@ section /-! Applying the concrete Gevrey budgets to a genuinely bounded viscous correction family. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureEnergy.lean index db25398f52..b074642ec6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureEnergy.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real /-! The actual pressure commutators occurring in the Gevrey energy estimate. -/ -@[expose] public section +public section noncomputable section @@ -32,13 +32,13 @@ open MeasureTheory InnerProductSpace EulerLiftedGradientSpace EulerCylinderSobol variable (period : ℝ) [Fact (0 < period)] /-- The actual weighted H⁶ external pressure commutator norm. -/ -def externalPressureNorm {s : ℕ} {A : SmoothCoefficient period} +@[expose] def externalPressureNorm {s : ℕ} {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection s A) (N : ℕ) (ρ : ℝ) (p : SobolevSpace period s) : ℝ := ∑ n ∈ Finset.range (N+1), weight ρ n * commutatorBlock K (toJet period p) 6 n /-- The actual weighted L² base pressure commutator norm. -/ -def basePressureNorm {s : ℕ} {A : SmoothCoefficient period} +@[expose] def basePressureNorm {s : ℕ} {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection 6 A) (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) (p : SobolevSpace period s) : ℝ := ∑ n : Fin (N+1), weight ρ n.val * basePressureBlock period K (toJet period p) n.val (by diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureShifted.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureShifted.lean index 3e28381048..ca462644ce 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureShifted.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyPressureShifted.lean @@ -28,7 +28,7 @@ section /-! The lower Sobolev pressure estimate needed for the base energy commutator. -/ -@[expose] public section +public section noncomputable section @@ -92,7 +92,7 @@ end end -@[expose] public section +public section noncomputable section @@ -129,7 +129,7 @@ theorem pressure_block_eq {s q n : ℕ} {A : SmoothCoefficient period} blockNorm_unique period _ _ (pressureSobolevOperator_value period K κ m c hc hpos u) h h /-- The actual finite-Sobolev pressure generated by the nonlinear transport source. -/ -def transportPressure {s : ℕ} (hs : 6 ≤ s) {A : SmoothCoefficient period} +@[expose] def transportPressure {s : ℕ} (hs : 6 ≤ s) {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection s A) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ x v, c * ‖v‖ ^ 2 ≤ ⟪A.coefficient x v, v⟫_ℝ) @@ -271,7 +271,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean index fa362036ca..cdce6ea7c4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean @@ -19,7 +19,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality bounded uniformly and the field tensors measured in L². It applies on any base, including cylinder tensors evaluated through a cover section. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyRadiusReduction.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyRadiusReduction.lean index ad95d0d2e1..0d47ff566e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyRadiusReduction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyRadiusReduction.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Radius reduction for actual finite weighted Sobolev norms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyRestriction.lean index 2490b302c4..f867c26e06 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyRestriction.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.GevreyDifferentiatedEquation /-! Exact restriction compatibility of actual finite Gevrey energies and derivative losses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyStabilityBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyStabilityBudget.lean index 1e5e603d80..eba057340e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyStabilityBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyStabilityBudget.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionStabilityBudget /-! The already-proved Gevrey budgets supply every actual vanishing-viscosity stability budget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyTransportCommutator.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyTransportCommutator.lean index 123ef46350..eb3a9e93ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyTransportCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyTransportCommutator.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevGevreyProduct /-! The actual finite-Sobolev external transport commutator satisfies the Gevrey radius-loss bound. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ synthesis. -/ local instance weightedCommSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The actual finite weighted derivative-loss norm. -/ -def weightedLoss {s : ℕ} (q N : ℕ) (ρ : ℝ) (u : SobolevSpace period s) : ℝ := +@[expose] def weightedLoss {s : ℕ} (q N : ℕ) (ρ : ℝ) (u : SobolevSpace period s) : ℝ := ∑ n ∈ Finset.range (N+1), (n : ℝ)*weight ρ n*blockNorm period (toJet period u) q n theorem weightedLoss_nonneg {s : ℕ} (q N : ℕ) (ρ : ℝ) (hρ : 0 < ρ) (u : SobolevSpace period s) : @@ -81,7 +81,7 @@ theorem weightedLoss_eq_classical {s : ℕ} (q N : ℕ) (hN : N + q ≤ s) (ρ : have := Finset.mem_range.mp hn; omega) f hu hf] /-- Weighted sum of the genuine H⁶ external transport commutators. -/ -def weightedCommutatorNorm {s : ℕ} (hs : 6 ≤ s) (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) +@[expose] def weightedCommutatorNorm {s : ℕ} (hs : 6 ≤ s) (N : ℕ) (hN : N + 6 ≤ s) (ρ : ℝ) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) (u v : SobolevSpace period (s + 1)) : ℝ := ∑ n : Fin (N+1), weight ρ n.val * ∑ w : Fin n.val → Fin 4, diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyUniformConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyUniformConstants.lean index 3df2614974..5391ee6560 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyUniformConstants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyUniformConstants.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PressureCommutatorWeights /-! Explicit cutoff-independent coefficient and inverse constants in the nonlinear correction estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/GraphPressurePotential.lean b/LeanPool/NavierStokesAndEuler/Euler/GraphPressurePotential.lean index cd1e67e0b4..db780ec6ee 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GraphPressurePotential.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GraphPressurePotential.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.SmoothPressureRepresentat /-! A genuine smooth scalar graph pressure obtained from the closed lifted L² gradient space. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open scoped ContDiff ENNReal NNReal Topology variable (period : ℝ) [Fact (0 < period)] /-- The oscillating physical graph in the actual periodic cylinder. -/ -def cylinderGraph (k : ℝ) (m : Vector3) (x : Vector3) : LiftDomain period := +@[expose] def cylinderGraph (k : ℝ) (m : Vector3) (x : Vector3) : LiftDomain period := (x, (k * ⟪m, x⟫_ℝ : ℝ)) omit [Fact (0 < period)] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearPressure.lean index d18fac42f0..b685835854 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearPressure.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.H6PressureInverse /-! Source18 for the actual coercively constructed pressure of the nonlinear transport source. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean index b305d5c326..0a66b6d537 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Mul /-! Fixed H⁶ algebra estimates at every external derivative order, for actual nonlinear fields. -/ -@[expose] public section +public section noncomputable section @@ -49,25 +49,27 @@ theorem word_add {n : ℕ} (w : Fin n → Fin 4) (f g : LiftDomain period → F) iteratedFieldDerivative period w (f + g) = iteratedFieldDerivative period w f + iteratedFieldDerivative period w g := by induction n with - | zero => rfl + | zero => simp only [iteratedFieldDerivative_zero] | succ n ih => rw [iteratedFieldDerivative_succ, ih (Fin.tail w), fieldDerivative_add period _ _ _ (iteratedFieldDerivative_smooth period _ f hf) (iteratedFieldDerivative_smooth period _ g hg)] - rfl + simp only [iteratedFieldDerivative_succ] omit [Fact (0 < period)] in theorem word_init_last {n : ℕ} (w : Fin (n + 1) → Fin 4) (f : LiftDomain period → F) : iteratedFieldDerivative period w f = iteratedFieldDerivative period (Fin.init w) (fieldDerivative period (standardDirection (w (Fin.last n))) f) := by induction n with - | zero => rfl + | zero => + simp only [iteratedFieldDerivative_zero, iteratedFieldDerivative_succ] + have hw : (0 : Fin 1) = Fin.last 0 := by decide + exact congrArg (fun k : Fin 1 => fieldDerivative period (standardDirection (w k)) f) + hw | succ n ih => - change fieldDerivative period (standardDirection (w 0)) - (iteratedFieldDerivative period (Fin.tail w) f) = - fieldDerivative period (standardDirection (w 0)) - (iteratedFieldDerivative period (Fin.tail (Fin.init w)) - (fieldDerivative period (standardDirection (w (Fin.last (n+1)))) f)) + conv_lhs => rw [iteratedFieldDerivative_succ] rw [ih (Fin.tail w)] + conv_rhs => rw [iteratedFieldDerivative_succ] + rw [Fin.tail_init_eq_init_tail] rfl theorem derivative_all_memLp (f : LiftDomain period → F) @@ -80,7 +82,7 @@ theorem derivative_all_memLp (f : LiftDomain period → F) let v : Fin 1 → Fin 4 := fun _ => i have h := word_memLp period (show 1+j ≤ 1+j by omega) w v f (fun r _ z => hfL2 r z) - exact h + simpa only [iteratedFieldDerivative_succ, iteratedFieldDerivative_zero] using h theorem word_all_memLp {n : ℕ} (w : Fin n → Fin 4) (f : LiftDomain period → F) (hfL2 : ∀ j, ∀ v : Fin j → Fin 4, @@ -114,7 +116,7 @@ theorem sobolev_add_le (q : ℕ) (f g : LiftDomain period → F) simpa only [ENNReal.toReal_add hfj.eLpNorm_ne_top hgj.eLpNorm_ne_top] using he /-- Sum of actual Hq norms of all external derivative words of exactly order n. -/ -def wordSobolevNorm (q n : ℕ) (f : LiftDomain period → F) : ℝ := +@[expose] def wordSobolevNorm (q n : ℕ) (f : LiftDomain period → F) : ℝ := ∑ w : Fin n → Fin 4, liftSobolevNorm period q (iteratedFieldDerivative period w f) theorem wordSobolevNorm_nonneg (q n : ℕ) (f : LiftDomain period → F) : @@ -195,7 +197,13 @@ theorem product_all_memLp (q : ℕ) (f : LiftDomain period → ℝ) (g : LiftDom hf (postcomp_smooth period _ g hg) (fun r _ v => hfL2 r v) (fun r _ v => postcomp_word_memLp period (show r ≤ r by omega) _ g hg (fun a _ z => hgL2 a z) v) - exact h + rw [← coordinate_smul] at h + have heq : (coordinate q i ∘ fun x => f x • g x) = + (fun x => (f x • g x).ofLp i) := by + funext x + exact coordinate_apply q i (f x • g x) + rw [heq] at h + simpa only [iteratedFieldDerivative_zero] using h | succ j ih => intro w rw [word_init_last period w, fieldDerivative_smul period _ f g hf hg] diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6Pressure.lean b/LeanPool/NavierStokesAndEuler/Euler/H6Pressure.lean index 9610b2e638..205fc4cf28 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6Pressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6Pressure.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.FiniteSum /-! External derivative blocks with a fixed Sobolev index. -/ -@[expose] public section +public section noncomputable section @@ -84,12 +84,12 @@ theorem sobolevSize_eq {q : ℕ} {f : LiftL2 period} exact SpatialJet.norm_unique _ J rfl /-- The external order-n block with a fixed base Sobolev index q. -/ -def blockNorm {s : ℕ} {f : LiftL2 period} +@[expose] def blockNorm {s : ℕ} {f : LiftL2 period} (J : EulerSpatialSobolevInverse.SpatialJet period directions s f) (q n : ℕ) : ℝ := Finset.sum (Finset.range (q + 1)) (fun r => levelNorm period J (n + r)) /-- Fixed-order coefficient multiplier blocks; the factor 2^q bounds the base Leibniz sums. -/ -def coefficientBlock {s : ℕ} {A : SmoothCoefficient period} +@[expose] def coefficientBlock {s : ℕ} {A : SmoothCoefficient period} (K : CoefficientJet period directions s A) (q n : ℕ) : ℝ := 2 ^ q * Finset.sum (Finset.range (q + 1)) (fun r => boundLevel period K (n + r)) @@ -98,6 +98,7 @@ variable {period} namespace CoefficientJet /-- Retain the prescribed base order of an actual coefficient derivative tree. -/ +@[expose] def restrict {s : ℕ} {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period directions s A) (q : ℕ) (hq : q ≤ s) : EulerSpatialSobolevInverse.CoefficientJet period directions q A := diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6PressureCommutator.lean b/LeanPool/NavierStokesAndEuler/Euler/H6PressureCommutator.lean index 3638e12666..1c6903c8c1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6PressureCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6PressureCommutator.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.H6Pressure /-! Positive external-order commutators in actual fixed-order Sobolev blocks. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ def commutatorJet {s q n : ℕ} {A : SmoothCoefficient period} {f : LiftL2 perio (SpatialJet.derivativeJet J w h)) /-- Sum of the actual base Sobolev norms of the external product commutators. -/ -def commutatorBlock {s : ℕ} {A : SmoothCoefficient period} {f : LiftL2 period} +@[expose] def commutatorBlock {s : ℕ} {A : SmoothCoefficient period} {f : LiftL2 period} (K : EulerSpatialSobolevInverse.CoefficientJet period directions s A) (J : EulerSpatialSobolevInverse.SpatialJet period directions s f) (q n : ℕ) : ℝ := ∑ w : Fin n → Fin 4, sobolevSize period (directions := directions) q diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6PressureConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/H6PressureConstants.lean index cbf9c62648..9bd9fb7b67 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6PressureConstants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6PressureConstants.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Explicit polynomial dependence of the fixed-order inverse on coefficient bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6PressureInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/H6PressureInverse.lean index 67f5448694..f402c0284b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6PressureInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6PressureInverse.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.WeightedPressure /-! The actual coercive pressure inverse in fixed Sobolev blocks, followed by external Gevrey weighting. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6TransportSource.lean b/LeanPool/NavierStokesAndEuler/Euler/H6TransportSource.lean index 8897b5b834..799231844e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6TransportSource.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6TransportSource.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.WeightedConvolution /-! The actual transport forcing has the shifted Gevrey H⁶ estimate without a cutoff-plus-one loss. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ omit [Fact (0 < period)] in theorem word_zero {n : ℕ} (w : Fin n → Fin 4) : iteratedFieldDerivative period w (0 : LiftDomain period → F) = 0 := by induction n with - | zero => rfl + | zero => simp only [iteratedFieldDerivative_zero] | succ n ih => rw [iteratedFieldDerivative_succ, ih] ext x @@ -124,6 +124,7 @@ theorem wordSobolevNorm_postcomp_le (q n : ℕ) (L : F →L[ℝ] G) (hL : ‖L end Postcomposition /-- Actual transport in the four cylinder coordinates; angle is the first coordinate. -/ +@[expose] def transportField (q : ℕ) (b : LiftDomain period → Domain 4) (e : LiftDomain period → Domain q) : LiftDomain period → Domain q := ∑ i : Fin 4, (fun x => b x i • fieldDerivative period (standardDirection i) e x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/HeatAllOrders.lean b/LeanPool/NavierStokesAndEuler/Euler/HeatAllOrders.lean index 2596e98ddb..735e1a5c6f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/HeatAllOrders.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/HeatAllOrders.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevSmoothApproximation /-! Positive-time Gaussian heat has every actual Sobolev derivative, enabling genuine H∞ approximations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/HeatRegularizedPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/HeatRegularizedPaths.lean index db8f4ef7a5..ef6d32febd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/HeatRegularizedPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/HeatRegularizedPaths.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MildWordEquation /-! Genuine heat regularization of continuous Sobolev paths, uniformly in time. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveGevrey.lean index 57f4587d1e..3d6db7a0d0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveGevrey.lean @@ -24,7 +24,7 @@ highest-order solution term on the right. The factorial estimate below is therefore derived from genuine derivatives of the constructed inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveParameter.lean b/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveParameter.lean index f8598a421f..7b18869140 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveParameter.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveParameter.lean @@ -20,7 +20,7 @@ be differentiable. The inverse itself is the actual operator inverse, so its regularity depends only on the operator coefficients. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveTransport.lean index 2f570e9434..9073be0abe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/HilbertCoerciveTransport.lean @@ -15,7 +15,7 @@ This elementary operator lemma applies equally to mean and transverse displacement spaces, including forms with nonlocal initial-trace terms. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ variable {V W : Type*} [NormedAddCommGroup W] [InnerProductSpace ℝ W] [CompleteSpace W] /-- Pull a genuine bounded operator back along a bounded linear coordinate map. -/ -def transportedOperator (D : V →L[ℝ] W) (A : W →L[ℝ] W) : V →L[ℝ] V := +@[expose] def transportedOperator (D : V →L[ℝ] W) (A : W →L[ℝ] W) : V →L[ℝ] V := D.adjoint.comp (A.comp D) /-- The transported bilinear form is exactly the original form on the image. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean index 4902c39067..12f7d0c07e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean @@ -16,7 +16,7 @@ These permit nonzero terminal values and hence explicit affine coordinate lifts in the fixed-space endpoint problem. -/ -@[expose] public section +public section noncomputable section @@ -62,7 +62,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (A A₁ : C(Icc (0 : ℝ) T, E →L[ℝ] F)) /-- Initial product derivative, given by `(timeMultiplier T hT A₁).comp (initialPrimitiveTimeLp T hT) + timeMultiplier T hT A`. -/ -def initialProductDerivative : TimeLp T E →L[ℝ] TimeLp T F := +@[expose] def initialProductDerivative : TimeLp T E →L[ℝ] TimeLp T F := (timeMultiplier T hT A₁).comp (initialPrimitiveTimeLp T hT) + timeMultiplier T hT A /-- Initial product primitive, given by `extendPath T hT A t (initialRealPrimitive T u t)`. -/ @@ -118,7 +118,7 @@ theorem initialProductDerivative_eq_product_of_trace_zero (u : TimeLp T E) rfl /-- Constants embedded as a genuine bounded operator into time L². -/ -def constantFieldOperator : E →L[ℝ] TimeLp T E := +@[expose] def constantFieldOperator : E →L[ℝ] TimeLp T E := (pathLpOperator T hT).comp (ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)) omit [CompleteSpace E] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/InitialTimePrimitive.lean b/LeanPool/NavierStokesAndEuler/Euler/InitialTimePrimitive.lean index bfb8533107..0bd34e1c17 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InitialTimePrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InitialTimePrimitive.lean @@ -16,7 +16,7 @@ the terminal-zero primitive, this applies to the nonzero-terminal paths used in the activation argument. The factor `T²/2` is proved from integration. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ open MeasureTheory Set EulerTimeLp EulerTerminalTimePrimitive variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The actual real-time primitive, normalized at the initial endpoint. -/ -def initialRealPrimitive (T : ℝ) (u : TimeLp T E) (t : ℝ) : E := +@[expose] def initialRealPrimitive (T : ℝ) (u : TimeLp T E) (t : ℝ) : E := realPrimitive T u t - realPrimitive T u 0 theorem initialRealPrimitive_eq_integral (T : ℝ) (u : TimeLp T E) (t : ℝ) : @@ -79,7 +79,7 @@ theorem initialRealPrimitive_norm_le (T : ℝ) (u : TimeLp T E) (t : ℝ) /-- Initial path, given by `⟨fun t => initialRealPrimitive T u t, (initialRealPrimitive_continuous T u).comp continuous_subtype_val⟩`. -/ -def initialPath (T : ℝ) (u : TimeLp T E) : C(Icc (0 : ℝ) T, E) := +@[expose] def initialPath (T : ℝ) (u : TimeLp T E) : C(Icc (0 : ℝ) T, E) := ⟨fun t => initialRealPrimitive T u t, (initialRealPrimitive_continuous T u).comp continuous_subtype_val⟩ @@ -110,7 +110,7 @@ theorem initialPath_norm_le (T : ℝ) (_hT : 0 ≤ T) (u : TimeLp T E) : (mul_le_mul_of_nonneg_right (Real.sqrt_le_sqrt t.property.2) (norm_nonneg _)) /-- Bounded initial integration of genuine L² data. -/ -def initialPrimitive (T : ℝ) (hT : 0 ≤ T) : +@[expose] def initialPrimitive (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := ({ toFun := initialPath T map_add' := initialPath_add T hT @@ -132,13 +132,13 @@ theorem initialPrimitive_eq_terminal_sub (T : ℝ) (hT : 0 ≤ T) (u : TimeLp T initialPrimitive T hT u t = terminalPrimitive T hT u t - initialTrace T hT u := rfl /-- Initial primitive time Lᵖ, given by `(pathLpOperator T hT).comp (initialPrimitive T hT)`. -/ -def initialPrimitiveTimeLp (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] TimeLp T E := +@[expose] def initialPrimitiveTimeLp (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] TimeLp T E := (pathLpOperator T hT).comp (initialPrimitive T hT) theorem initialPrimitiveTimeLp_ae (T : ℝ) (hT : 0 ≤ T) (u : TimeLp T E) : (initialPrimitiveTimeLp T hT u : ℝ → E) =ᵐ[timeMeasure T] initialRealPrimitive T u := by - change (pathLp T hT (initialPrimitive T hT u) : ℝ → E) =ᵐ[timeMeasure T] _ + simp only [initialPrimitiveTimeLp, ContinuousLinearMap.comp_apply, pathLpOperator_apply] filter_upwards [pathLp_ae T hT (initialPrimitive T hT u), ae_restrict_mem measurableSet_Icc] with t ht hmem rw [ht] diff --git a/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivative.lean index 9ecdeaa790..d02985787b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivative.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.IntegralPathLimit /-! Lifting an actual continuous evolution equation through an injective bounded linear map. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivativeWithin.lean b/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivativeWithin.lean index 2ea856ae2b..ba6b7c191b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivativeWithin.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InjectivePathDerivativeWithin.lean @@ -13,7 +13,7 @@ import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus /-! Genuine closed-interval derivatives lift through injective bounded embeddings. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/IntegralPathLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/IntegralPathLimit.lean index f59f52aa74..a95e29c18b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/IntegralPathLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/IntegralPathLimit.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Ring.Star /-! Passing genuine Banach-valued evolution equations through uniform time-path limits. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,8 @@ open scoped Topology variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Integration of the actual clamped time path is a bounded linear operator. -/ -def pathIntegralOperator (T : ℝ) (hT : 0 ≤ T) (a b : ℝ) : C(Icc (0 : ℝ) T,E) →L[ℝ] E := +@[expose] def pathIntegralOperator (T : ℝ) (hT : 0 ≤ T) (a b : ℝ) : + C(Icc (0 : ℝ) T,E) →L[ℝ] E := LinearMap.mkContinuous { toFun := fun f => ∫ t in a..b, extendPath T hT f t map_add' := by @@ -44,7 +45,7 @@ def pathIntegralOperator (T : ℝ) (hT : 0 ≤ T) (a b : ℝ) : C(Icc (0 : ℝ) /-- The time-integral operator is the literal Bochner interval integral. -/ theorem pathIntegralOperator_apply (T : ℝ) (hT : 0 ≤ T) (a b : ℝ) (f : C(Icc (0 : ℝ) T, E)) : - pathIntegralOperator T hT a b f = ∫ t in a..b, extendPath T hT f t := rfl + pathIntegralOperator T hT a b f = ∫ t in a..b, extendPath T hT f t := by rfl variable [CompleteSpace E] diff --git a/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionCompatibility.lean b/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionCompatibility.lean index 15c7d4c3fd..710a67aa6c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionCompatibility.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionCompatibility.lean @@ -16,7 +16,7 @@ section /-! Actual inviscid corrections agree across compatible Sobolev levels. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionUniqueness.lean b/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionUniqueness.lean index 55753ca873..71450088f5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionUniqueness.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InviscidCorrectionUniqueness.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Uniqueness of the actual finite-order inviscid correction equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/InviscidDifferencePDE.lean b/LeanPool/NavierStokesAndEuler/Euler/InviscidDifferencePDE.lean index 61fb883122..9bff502036 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InviscidDifferencePDE.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InviscidDifferencePDE.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add /-! The literal difference equation of two actual inviscid corrections. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/InviscidSobolevEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/InviscidSobolevEvolution.lean index 97e369416f..943cc33e25 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InviscidSobolevEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InviscidSobolevEvolution.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.QuadraticSourceLimit /-! Actual finite-order Sobolev time regularity of the inviscid cylinder correction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/IsometricActionCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/IsometricActionCalculus.lean index 05f64a224b..22dde932a7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/IsometricActionCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/IsometricActionCalculus.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.UniformLimitsDeriv /-! Closed differentiability for strongly continuous linear isometric actions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LiftedSmoothTimeField.lean b/LeanPool/NavierStokesAndEuler/Euler/LiftedSmoothTimeField.lean index 81e56983f4..87ac23afa6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LiftedSmoothTimeField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LiftedSmoothTimeField.lean @@ -22,7 +22,7 @@ section /-! The four-dimensional transport velocity associated with a lifted solenoidal field has zero ordinary trace on the real covering space. -/ -@[expose] public section +public section noncomputable section @@ -98,7 +98,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LiftedTransportComponents.lean b/LeanPool/NavierStokesAndEuler/Euler/LiftedTransportComponents.lean index 476cca8298..55ed51f093 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LiftedTransportComponents.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LiftedTransportComponents.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.VectorCylinder /-! Exact coefficient functionals for the lifted Euler transport vector (κz,m·z). -/ -@[expose] public section +public section noncomputable section @@ -22,7 +22,7 @@ open InnerProductSpace EulerLiftedGradientSpace EulerMetricTransport EulerVector /-- Coordinate functionals of the actual lifted transport vector, with the angle coordinate first. -/ -def velocityComponents (κ : ℝ) (m : Vector3) : Fin 4 → Vector3 →L[ℝ] ℝ := +@[expose] def velocityComponents (κ : ℝ) (m : Vector3) : Fin 4 → Vector3 →L[ℝ] ℝ := Fin.cons (innerSL ℝ m) (fun i : Fin 3 => κ • coordinate 3 i) /-- The scale-normalized lifted velocity coefficients have norm at most one. -/ @@ -45,7 +45,8 @@ theorem velocityComponents_direction (κ : ℝ) (m z : Vector3) : simpa only [EuclideanSpace.basisFun_repr, EuclideanSpace.basisFun_apply] using (EuclideanSpace.basisFun (Fin 3) ℝ).sum_repr z apply Prod.ext - · change (⟪m,z⟫_ℝ • standardDirection 0 + ∑ i : Fin 3, (κ * z i) • standardDirection i.succ).1 = + · simp only [coordinate_apply] + change (⟪m,z⟫_ℝ • standardDirection 0 + ∑ i : Fin 3, (κ * z i) • standardDirection i.succ).1 = κ • z simp only [standardDirection_zero, standardDirection_succ, Prod.fst_add, Prod.fst_sum] change ⟪m,z⟫_ℝ • (0 : Vector3) + (∑ i : Fin 3, (κ*z i) • EuclideanSpace.single i 1) = κ • z @@ -58,7 +59,8 @@ theorem velocityComponents_direction (κ : ℝ) (m z : Vector3) : intro i _ exact mul_smul κ (z i) _ _ = κ • z := by rw [hz] - · change (⟪m,z⟫_ℝ • standardDirection 0 + ∑ i : Fin 3, (κ * z i) • standardDirection i.succ).2 = + · simp only [coordinate_apply] + change (⟪m,z⟫_ℝ • standardDirection 0 + ∑ i : Fin 3, (κ * z i) • standardDirection i.succ).2 = ⟪m,z⟫_ℝ rw [Prod.snd_add, Prod.snd_sum] simp only [standardDirection_zero, standardDirection_succ, Prod.smul_snd, smul_eq_mul, mul_one, diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean index a6a3135597..2ae96325d2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean @@ -23,7 +23,7 @@ Bochner integral. Its differential equation, initial trace, uniqueness, and weighted bounds are proved, rather than included in the evolution data. -/ -@[expose] public section +public section noncomputable section @@ -91,7 +91,7 @@ theorem backward_derivative (t : Icc (0 : ℝ) T) : exact U.backward_eq_inverse ⟨s,hs⟩ /-- The two-time homogeneous propagator. -/ -def propagator (t s : Icc (0 : ℝ) T) : E →L[ℝ] E := +@[expose] def propagator (t s : Icc (0 : ℝ) T) : E →L[ℝ] E := (U.forward t).comp (U.backward s) omit [CompleteSpace E] in @@ -101,7 +101,7 @@ omit [CompleteSpace E] in U.forward_backward t /-- The forcing pulled back by the inverse homogeneous evolution. -/ -def transformedForcing (f : C(Icc (0 : ℝ) T, E)) : ℝ → E := +@[expose] def transformedForcing (f : C(Icc (0 : ℝ) T, E)) : ℝ → E := fun s => extendPath T hT U.backward s (extendPath T hT f s) omit [CompleteSpace E] in @@ -111,7 +111,7 @@ theorem transformedForcing_continuous (f : C(Icc (0 : ℝ) T, E)) : (extendPath_continuous T hT U.backward).clm_apply (extendPath_continuous T hT f) /-- Duhamel's formula, as an actual interval integral. -/ -def solutionReal (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : ℝ → E := +@[expose] def solutionReal (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : ℝ → E := fun t => extendPath T hT U.forward t (U.backward ⟨0,le_rfl,hT⟩ a₀ + ∫ s in (0 : ℝ)..t, U.transformedForcing f s) @@ -123,7 +123,7 @@ theorem solutionReal_continuous (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : (U.transformedForcing_continuous f)).continuous) /-- The actual continuous forced solution on the time interval. -/ -def solution (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : C(Icc (0 : ℝ) T,E) := +@[expose] def solution (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : C(Icc (0 : ℝ) T,E) := ⟨fun t => U.solutionReal f a₀ t, (U.solutionReal_continuous f a₀).comp continuous_subtype_val⟩ /-- Duhamel's formula attains the prescribed initial data. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelGevrey.lean index 3d818b3986..25436a8847 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelGevrey.lean @@ -33,7 +33,7 @@ The coefficient difference vanishes at the base point, so the resulting binomial recurrence contains only lower solution derivatives on the right. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelNaturality.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelNaturality.lean index 69b6eafcc5..4977a07b46 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelNaturality.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelNaturality.lean @@ -20,7 +20,7 @@ is assumed. In particular it applies to inclusions and support-changing spatial translations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelOperator.lean index 2e399b3b05..cebbc8621e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelOperator.lean @@ -18,7 +18,7 @@ unweighted inverse is used only for qualitative parameter regularity; source quantitative estimates use the original relative propagator bound directly. -/ -@[expose] public section +public section noncomputable section @@ -37,11 +37,11 @@ namespace Evolution variable (U : Evolution T hT B) /-- The actual zero-initial-data forcing operator. -/ -def forcingOperator : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,E) := +@[expose] def forcingOperator : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,E) := (multiplier U.forward).comp ((integral T hT).comp (multiplier U.backward)) /-- The actual homogeneous initial-data operator. -/ -def initialOperator : E →L[ℝ] C(Icc (0 : ℝ) T,E) := +@[expose] def initialOperator : E →L[ℝ] C(Icc (0 : ℝ) T,E) := (multiplier U.forward).comp ((ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)).comp (U.backward ⟨0,le_rfl,hT⟩)) @@ -62,6 +62,9 @@ theorem solution_eq_operators (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : (U.backward ⟨0,le_rfl,hT⟩ a₀ + ∫ s in (0 : ℝ)..(t : ℝ), U.transformedForcing f s) = _ rw [show extendPath T hT U.forward t = U.forward t by simp only [extendPath, projIcc_of_mem hT t.property], map_add] + simp only [ContinuousMap.add_apply, initialOperator, forcingOperator, comp_apply, + multiplier_apply, EulerContinuousTimeIntegral.integral_apply, realIntegral, + transformedForcing, extendPath] rfl /-- The original relative propagator bound controls the actual forcing map. -/ @@ -103,7 +106,7 @@ theorem solution_integral (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : end Evolution /-- The ordinary continuous-path Volterra operator. -/ -def volterraOperator (T : ℝ) (hT : 0 ≤ T) (B : C(Icc (0 : ℝ) T, E →L[ℝ] E)) : +@[expose] def volterraOperator (T : ℝ) (hT : 0 ≤ T) (B : C(Icc (0 : ℝ) T, E →L[ℝ] E)) : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,E) := ContinuousLinearMap.id ℝ _ - (integral T hT).comp (multiplier B) @@ -112,7 +115,7 @@ namespace Evolution variable (U : Evolution T hT B) /-- Duhamel's formula gives an actual inverse on every continuous input. -/ -def volterraInverse : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,E) := +@[expose] def volterraInverse : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,E) := ContinuousLinearMap.id ℝ _ + U.forcingOperator.comp (multiplier B) /-- The Volterra operator followed by the constructed inverse is the identity. -/ @@ -162,7 +165,7 @@ theorem volterra_inverse_operator (h : C(Icc (0 : ℝ) T, E)) : exact U.volterra_operator_inverse _ /-- The actual two-sided Volterra equivalence. -/ -def volterraEquiv : C(Icc (0 : ℝ) T,E) ≃L[ℝ] C(Icc (0 : ℝ) T,E) := +@[expose] def volterraEquiv : C(Icc (0 : ℝ) T,E) ≃L[ℝ] C(Icc (0 : ℝ) T,E) := ContinuousLinearEquiv.equivOfInverse (volterraOperator T hT B) U.volterraInverse U.volterra_inverse_operator U.volterra_operator_inverse diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelParameter.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelParameter.lean index c003be7f7b..82976480bf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelParameter.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelParameter.lean @@ -20,7 +20,7 @@ fixed continuous-path Banach space. Operator inversion therefore proves its parameter smoothness from coefficient and data smoothness alone. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelSobolevGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelSobolevGevrey.lean index 4addf677a4..26831c2185 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelSobolevGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelSobolevGevrey.lean @@ -51,7 +51,7 @@ can use the identity inverse; it never requires a norm for a profile-weighted raw time primitive. -/ -@[expose] public section +public section noncomputable section @@ -145,7 +145,7 @@ end end -@[expose] public section +public section noncomputable section @@ -192,7 +192,7 @@ local instance instLinearDuhamelFrozenGevrey8 : NormedSpace ℝ (C(Icc (0 : ℝ) inferInstance /-- The frozen coefficient amplitude is polynomial in the original coefficient and H3 constant. -/ -def frozenAmplitude (T C CB : ℝ) : ℝ := 1+2*C*T*CB +@[expose] def frozenAmplitude (T C CB : ℝ) : ℝ := 1+2*C*T*CB /-- Actual derivatives of the frozen coefficient have the stated polynomial bound. -/ theorem frozenOperator_bound (hB : ContDiff ℝ ∞ B) @@ -269,7 +269,7 @@ The actual equation and smoothness hold as functions; every quantitative hypothesis, including invertibility, is needed only at the evaluation point. -/ -@[expose] public section +public section noncomputable section @@ -334,7 +334,7 @@ end end -@[expose] public section +public section noncomputable section @@ -349,7 +349,7 @@ def forwardSobolevAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (T C CB Rc : ℝ sobolevCoefficientAmplitude ι q Rc (frozenAmplitude T C CB) /-- A fixed polynomial cost for the source's forward Hq external-word estimate. -/ -def forwardSobolevCost (ι : Type*) [Fintype ι] (q : ℕ) (T C A D CB Rc : ℝ) : ℝ := +@[expose] def forwardSobolevCost (ι : Type*) [Fintype ι] (q : ℕ) (T C A D CB Rc : ℝ) : ℝ := 1+sobolevInverseCost 1 (forwardSobolevAmplitude ι q T C CB Rc) q * (forwardSobolevAmplitude ι q T C CB Rc+C*A+C*T*D) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelWeighted.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelWeighted.lean index 2fd8742bc4..5281942130 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelWeighted.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamelWeighted.lean @@ -18,7 +18,7 @@ frozen-coefficient identity is exact and will be differentiated for quantitative parameter estimates; no norm of the weighted primitive is used. -/ -@[expose] public section +public section noncomputable section @@ -72,7 +72,7 @@ theorem weightedForcing_norm (hg₀ : g ⟨0, le_rfl, hT⟩ = 1) (C : ℝ) (hC : nlinarith /-- The normalized constructed path, with normalized forcing as input. -/ -def weightedSolution (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : C(Icc (0 : ℝ) T,E) := +@[expose] def weightedSolution (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) : C(Icc (0 : ℝ) T,E) := normalize g hg (U.solution (weight g f) a₀) /-- The normalized solution is still exactly the two actual data maps. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearFundamentalPath.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearFundamentalPath.lean index fc23ea4682..bc68627834 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearFundamentalPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearFundamentalPath.lean @@ -33,7 +33,7 @@ and ODE uniqueness. This result is qualitative. No exponential estimate from this construction is used in the later profile estimates. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean b/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean index d13ab0e7d8..288e8f8215 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean @@ -22,7 +22,7 @@ section /-! The additional H⁵ cylinder algebra estimate needed for the base transport commutator. -/ -@[expose] public section +public section noncomputable section @@ -197,7 +197,7 @@ section /-! Actual real and scalar-vector cylinder multiplication at every fixed Sobolev order q≥5. -/ -@[expose] public section +public section noncomputable section @@ -322,7 +322,7 @@ end end -@[expose] public section +public section noncomputable section @@ -403,8 +403,11 @@ theorem derivative_H5_le_H6 {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ apply Finset.sum_le_sum intro w _ obtain ⟨v, hv⟩ := iteratedFieldDerivative_comp_exists period w (fun _ : Fin 1 => i) f - change (eLpNorm (iteratedFieldDerivative period w (iteratedFieldDerivative period (fun _ : Fin - 1 => i) f)) 2 (liftMeasure period)).toReal ≤ _ + have hi : fieldDerivative period (standardDirection i) f = + iteratedFieldDerivative period (fun _ : Fin 1 => i) f := by + funext x + simp only [iteratedFieldDerivative_succ, iteratedFieldDerivative_zero] + rw [hi] rw [hv] exact word_L2_le_liftSobolevNorm period (by have := Finset.mem_range.mp hr; omega) v f apply h.trans_eq diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpBochnerRealization.lean b/LeanPool/NavierStokesAndEuler/Euler/LpBochnerRealization.lean index 0ce56ca3e3..2f867056a6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpBochnerRealization.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpBochnerRealization.lean @@ -17,7 +17,7 @@ to the product L² space, with exactly the same norm. This realizes nested space/angle or time/space estimates without changing any derivative constants. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficientTime.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficientTime.lean index 6bc0a1278b..b11e3174bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficientTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficientTime.lean @@ -20,7 +20,7 @@ constructed Duhamel evolution. Literal within-time derivatives of the coefficient fields induce true operator-path derivatives and product rules. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean index 7707c6f60d..37337d96a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean @@ -24,7 +24,7 @@ Banach-algebra fundamental fields. Its H3 bound is used only on spatial support; no angular regularity or global extension of H3 is assumed. -/ -@[expose] public section +public section noncomputable section @@ -153,7 +153,7 @@ def liftedOperatorPathMap : C(Icc (0 : ℝ) T,Space →ᵇ V →L[ℝ] V) →L[ omit [CompleteSpace V] in @[simp] theorem liftedOperatorPathMap_apply (A : C(Icc (0 : ℝ) T, Space →ᵇ V →L[ℝ] V)) : - liftedOperatorPathMap (V := V) period S hS T A = liftedOperatorPath period S hS T A := rfl + liftedOperatorPathMap (V := V) period S hS T A = liftedOperatorPath period S hS T A := by rfl omit [CompleteSpace V] in /-- No coefficient amplitude is lost in the actual L² lifting. -/ @@ -206,7 +206,7 @@ theorem mixedOperator_bound (B : SmoothCoefficientPath (Icc (0 : ℝ) T) (V →L variable (hT : 0 ≤ T) (B : C(Icc (0 : ℝ) T, Space →ᵇ V →L[ℝ] V)) /-- The cylinder evolution is constructed from the genuine spatial fundamental fields. -/ -def constructedEvolution : Evolution T hT (liftedOperatorPath (V := V) period S hS T B) := +@[expose] def constructedEvolution : Evolution T hT (liftedOperatorPath (V := V) period S hS T B) := liftEvolution (V := V) (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) T hT (fieldPathLift period B) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderFullTime.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderFullTime.lean index 93afe34da0..666d9a9d57 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderFullTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderFullTime.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Genuine time derivatives for the full-cylinder rectangular products. -/ -@[expose] public section +public section noncomputable section @@ -67,8 +67,11 @@ theorem fullPath_hasDerivWithinAt (t : Icc (0 : ℝ) T) : (fullOperatorMap P) (extendPath T hT A t) := (fullOperatorMap P).hasFDerivAt have hd := hlinear.comp_hasDerivWithinAt (t : ℝ) hfield - change HasDerivWithinAt (fun s => fullOperatorMap P (A (projIcc 0 T hT s))) - (fullOperatorMap P (A₁ t)) (Icc (0 : ℝ) T) t + have hpath : extendPath T hT (fullPathMap P A) = + fun s => fullOperatorMap P (A (projIcc 0 T hT s)) := by + funext s + simp only [extendPath, fullPathMap_apply] + rw [hpath, fullPathMap_apply] change HasDerivWithinAt (fun s => fullOperatorMap P (A (projIcc 0 T hT s))) (fullOperatorMap P (A₁ (projIcc 0 T hT t))) (Icc (0 : ℝ) T) t at hd rwa [projIcc_of_mem hT t.property] at hd @@ -82,10 +85,13 @@ theorem fullProduct_hasDerivWithinAt (fullMultiplierMap P A₁ u t + fullMultiplierMap P A u₁ t) (Icc (0 : ℝ) T) t := by have hd := (fullPath_hasDerivWithinAt P T hT A A₁ hA t).clm_apply (hu t) - change HasDerivWithinAt - (fun s => fullOperatorMap P (A (projIcc 0 T hT s)) (u (projIcc 0 T hT s))) - (fullOperatorMap P (A₁ t) (u t) + fullOperatorMap P (A t) (u₁ t)) - (Icc (0 : ℝ) T) t + have hproduct : extendPath T hT (fullMultiplierMap P A u) = + fun s => fullOperatorMap P (A (projIcc 0 T hT s)) (u (projIcc 0 T hT s)) := by + funext s + simp only [extendPath, fullMultiplierMap_apply] + rw [hproduct] + simp only [fullMultiplierMap_apply] + simp only [extendPath, fullPathMap_apply] at hd change HasDerivWithinAt (fun s => fullOperatorMap P (A (projIcc 0 T hT s)) (u (projIcc 0 T hT s))) (fullOperatorMap P (A₁ t) (u (projIcc 0 T hT t)) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderOrbit.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderOrbit.lean index e50d055143..e77bd20e00 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderOrbit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderOrbit.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! Actual mixed translation orbits are smooth everywhere as soon as they are smooth at zero. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ omit [CompactSpace K] in by apply ContinuousMap.ext intro t - exact translate_zero period (f t) + simpa only [pathTranslate_apply] using translate_zero period (f t) omit [CompactSpace K] in /-- The true uniform-time mixed translations obey the group law. -/ @@ -38,7 +38,7 @@ theorem pathTranslate_add (a b : LiftTangent) (f : C(K, CylinderL2 period V)) : pathTranslate period a (pathTranslate period b f) = pathTranslate period (a+b) f := by apply ContinuousMap.ext intro t - exact translate_add period a b (f t) + simpa only [pathTranslate_apply] using translate_add period a b (f t) /-- Local smoothness at zero propagates to the whole genuine mixed translation orbit. -/ theorem pathOrbit_contDiff_of_zero (f : C(K, CylinderL2 period V)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderPaths.lean index 382bacfc82..6fd8778dc0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderPaths.lean @@ -21,7 +21,7 @@ translated compact support lies in the target region, the projection is the identity, so these families are the true mixed translations there. -/ -@[expose] public section +public section noncomputable section @@ -83,12 +83,12 @@ def projectPath : C(K,CylinderL2 period V) →L[ℝ] C(K,Supported period V S hS omit [CompactSpace K] in @[simp] theorem includePath_apply (f : C(K, Supported period V S hS)) (t : K) : - includePath period S hS f t = (f t : CylinderL2 period V) := rfl + includePath period S hS f t = (f t : CylinderL2 period V) := by rfl omit [CompactSpace K] in @[simp] theorem projectPath_apply (f : C(K, CylinderL2 period V)) (t : K) : projectPath period S hS f t = projection (liftMeasure period) (spatialSet period S) - (spatialSet_measurable period S hS) (f t) := rfl + (spatialSet_measurable period S hS) (f t) := by rfl /-- Time-path inclusion is a contraction (indeed an isometry). -/ theorem includePath_norm : ‖includePath (K := K) (V := V) period S hS‖ ≤ 1 := by @@ -106,8 +106,19 @@ theorem projectPath_norm : ‖projectPath (K := K) (V := V) period S hS‖ ≤ 1 rw [one_mul] apply (ContinuousMap.norm_le _ (norm_nonneg f)).2 intro t - exact (cutoff_norm (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) - (f t)).trans (f.norm_coe_le_norm t) + rw [projectPath_apply] + calc + ‖projection (liftMeasure period) (spatialSet period S) + (spatialSet_measurable period S hS) (f t)‖ ≤ + ‖projection (V := V) (liftMeasure period) (spatialSet period S) + (spatialSet_measurable period S hS)‖ * ‖f t‖ := + (projection (V := V) (liftMeasure period) (spatialSet period S) + (spatialSet_measurable period S hS)).le_opNorm (f t) + _ ≤ 1 * ‖f t‖ := mul_le_mul_of_nonneg_right + (projection_norm (V := V) (liftMeasure period) (spatialSet period S) + (spatialSet_measurable period S hS)) (norm_nonneg (f t)) + _ = ‖f t‖ := one_mul _ + _ ≤ ‖f‖ := f.norm_coe_le_norm t omit [CompactSpace K] in /-- Projecting an already supported continuous path fixes it. -/ @@ -134,7 +145,8 @@ theorem translatedData_eq_intoLarger (S₀ : Set Space) (hS₀ : MeasurableSet S (ha : shiftedSet a.1 S₀ ⊆ S) : translatedData period S hS (u : CylinderL2 period V) a = EulerLpCylinderTranslation.intoLarger period a S₀ S hS₀ hS ha u := by - exact projection_supported (liftMeasure period) (spatialSet period S) (spatialSet_measurable + simpa only [translatedData, EulerLpCylinderTranslation.intoLarger_coe] using + projection_supported (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) (EulerLpCylinderTranslation.intoLarger period a S₀ S hS₀ hS ha u) omit [CompactSpace K] in @@ -147,6 +159,9 @@ theorem translatedForcing_eq_intoLarger (S₀ : Set Space) (hS₀ : MeasurableSe ha).toContinuousLinearMap.compLeftContinuous ℝ K f := by apply ContinuousMap.ext intro t + simp only [translatedForcing, projectPath_apply, includePath_apply, pathTranslate_apply] + change translatedData period S hS (f t : CylinderL2 period V) a = + EulerLpCylinderTranslation.intoLarger period a S₀ S hS₀ hS ha (f t) exact translatedData_eq_intoLarger period S hS S₀ hS₀ (f t) a ha /-- Smoothness is inherited from the true ordinary L² translation orbit. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangular.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangular.lean index 63615ba3a0..d06f6eb3bf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangular.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangular.lean @@ -39,7 +39,7 @@ quadratic upper bounds and pointwise composition identities pass to these actual L² operators without a support-margin constant. -/ -@[expose] public section +public section noncomputable section @@ -124,7 +124,7 @@ def supportedMap : (α →ᵇ E →L[ℝ] F) →L[ℝ] supported_norm μ S hS A ‖A‖ (norm_nonneg _) (fun x _ => A.norm_coe_le_norm x)) @[simp] theorem supportedMap_apply (A : α →ᵇ E →L[ℝ] F) : supportedMap μ S hS A = supported μ S hS - A := rfl + A := by rfl theorem supportedMap_norm : ‖supportedMap (E := E) (F := F) μ S hS‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -141,7 +141,7 @@ def supportedPathMap : C(K,α →ᵇ E →L[ℝ] F) →L[ℝ] omit [CompactSpace K] in @[simp] theorem supportedPathMap_apply (A : C(K, α →ᵇ E →L[ℝ] F)) (t : K) : - supportedPathMap μ S hS A t = supported μ S hS (A t) := rfl + supportedPathMap μ S hS A t = supported μ S hS (A t) := by rfl theorem supportedPathMap_norm : ‖supportedPathMap (K := K) (E := E) (F := F) μ S hS‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -216,7 +216,7 @@ end end -@[expose] public section +public section noncomputable section @@ -317,13 +317,14 @@ local instance instLpCylinderRectangular22 : NormedSpace ℝ (C(K,CylinderL2 per inferInstance /-- Actual multiplication on cylinder L² by an angle-independent field. -/ -def fullOperatorMap : (Space →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def fullOperatorMap : (Space →ᵇ E →L[ℝ] F) →L[ℝ] (CylinderL2 period E →L[ℝ] CylinderL2 period F) := (EulerLpOperatorField.fullMap (E := E) (F := F) (liftMeasure period)).comp (fieldLift period) @[simp] theorem fullOperatorMap_apply (A : Space →ᵇ E →L[ℝ] F) : fullOperatorMap period A = EulerLpOperatorField.full (liftMeasure period) (fieldLift period A) - := rfl + := by + exact EulerLpOperatorField.fullMap_apply (liftMeasure period) (fieldLift period A) theorem fullOperatorMap_norm : ‖fullOperatorMap (E := E) (F := F) period‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -335,13 +336,13 @@ theorem fullOperatorMap_norm : ‖fullOperatorMap (E := E) (F := F) period‖ period) (norm_nonneg A))) /-- The same contraction uniformly along a compact time set. -/ -def fullPathMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] +@[expose] def fullPathMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] C(K,CylinderL2 period E →L[ℝ] CylinderL2 period F) := (fullOperatorMap (E := E) (F := F) period).compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem fullPathMap_apply (A : C(K, Space →ᵇ E →L[ℝ] F)) (t : K) : - fullPathMap period A t = fullOperatorMap period (A t) := rfl + fullPathMap period A t = fullOperatorMap period (A t) := by rfl theorem fullPathMap_norm : ‖fullPathMap (K := K) (E := E) (F := F) period‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -362,7 +363,7 @@ def fullMultiplierMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] @[simp] theorem fullMultiplierMap_apply (A : C(K, Space →ᵇ E →L[ℝ] F)) (u : C(K, CylinderL2 period E)) (t : K) : - fullMultiplierMap period A u t = fullOperatorMap period (A t) (u t) := rfl + fullMultiplierMap period A u t = fullOperatorMap period (A t) (u t) := by rfl theorem fullMultiplierMap_norm : ‖fullMultiplierMap (K := K) (E := E) (F := F) period‖ ≤ 1 := by calc @@ -394,10 +395,9 @@ theorem fullOperator_translation (a : LiftTangent) (A : Space →ᵇ E →L[ℝ] (measurePreserving_translation period (coveringMap period a)).quasiMeasurePreserving.ae (EulerLpOperatorField.full_ae (liftMeasure period) (fieldLift period A) u)] with x hl hu hr hA - change (EulerLpOperatorField.full (liftMeasure period) (fieldLift period (translated A a.1)) - (translate period a u)) x = (translate period a (fullOperatorMap period A u)) x - rw [hl,hu,hr] - exact hA.symm + rw [fullOperatorMap_apply, hl, hu, hr] + simpa only [fullOperatorMap_apply, fieldLift_apply, translated_apply, coveringMap, + Prod.fst_add] using hA.symm /-- The exact mixed-translation identity holds in the uniform continuous-path space. -/ theorem fullMultiplier_translation (a : LiftTangent) (A : C(K, Space →ᵇ E →L[ℝ] F)) @@ -407,7 +407,8 @@ theorem fullMultiplier_translation (a : LiftTangent) (A : C(K, Space →ᵇ E pathTranslate period a (fullMultiplierMap (K := K) (E := E) (F := F) period A u) := by apply ContinuousMap.ext intro t - exact fullOperator_translation period a (A t) (u t) + simpa only [fullMultiplierMap_apply, translateCoefficientPath_apply, pathTranslate_apply] using + fullOperator_translation period a (A t) (u t) variable (S : Set Space) (hS : MeasurableSet S) @@ -483,7 +484,9 @@ def supportedOperatorMap : (Space →ᵇ E →L[ℝ] F) →L[ℝ] @[simp] theorem supportedOperatorMap_coe (A : Space →ᵇ E →L[ℝ] F) (u : Supported period E S hS) : (supportedOperatorMap period S hS A u : CylinderL2 period F) = - fullOperatorMap period A (u : CylinderL2 period E) := rfl + fullOperatorMap period A (u : CylinderL2 period E) := by + rw [fullOperatorMap_apply] + rfl theorem supportedOperatorMap_norm : ‖supportedOperatorMap (E := E) (F := F) period S hS‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -491,7 +494,7 @@ theorem supportedOperatorMap_norm : ‖supportedOperatorMap (E := E) (F := F) pe rw [one_mul] exact (EulerLpOperatorField.supported_norm (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) (fieldLift period A) ‖A‖ (norm_nonneg A) - (fun x _ => A.norm_coe_le_norm x.1)) + (fun x _ => by simpa only [fieldLift_apply] using A.norm_coe_le_norm x.1)) /-- Supported path map, given by `(supportedOperatorMap (E := E) (F := F) period S hS).compLeftContinuous ℝ K`. -/ @@ -510,13 +513,17 @@ def supportedMultiplierMap : C(K,Space →ᵇ E →L[ℝ] F) →L[ℝ] @[simp] theorem supportedMultiplierMap_apply (A : C(K, Space →ᵇ E →L[ℝ] F)) (u : C(K, Supported period E S hS)) (t : K) : supportedMultiplierMap (K := K) (E := E) (F := F) period S hS A u t = - supportedOperatorMap period S hS (A t) (u t) := rfl + supportedOperatorMap period S hS (A t) (u t) := by rfl /-- Inclusion identifies the supported product with the actual full-cylinder product. -/ theorem include_supportedMultiplier (A : C(K, Space →ᵇ E →L[ℝ] F)) (u : C(K, Supported period E S hS)) : includePath period S hS (supportedMultiplierMap (K := K) (E := E) (F := F) period S hS A u) = - fullMultiplierMap (K := K) (E := E) (F := F) period A (includePath period S hS u) := rfl + fullMultiplierMap (K := K) (E := E) (F := F) period A (includePath period S hS u) := by + apply ContinuousMap.ext + intro t + simp only [includePath_apply, supportedMultiplierMap_apply, fullMultiplierMap_apply, + supportedOperatorMap_coe] end EulerLpCylinderRectangular diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean index d5de4dd0f3..fcbfb7b83a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean @@ -26,7 +26,7 @@ section /-! The same-radius fixed-Sobolev product estimate needs bounds only at the base parameter. -/ -@[expose] public section +public section noncomputable section @@ -70,7 +70,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean index 77f13235c1..260a0f8231 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Normed.Operator.Prod /-! A genuinely smooth translated bounded-field family lifts to actual mixed cylinder coefficients. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularForward.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularForward.lean index 01a329cd33..91c89651e7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularForward.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularForward.lean @@ -37,7 +37,7 @@ section /-! Genuine scalar-profile normalization commutes with bounded linear intertwiners. -/ -@[expose] public section +public section noncomputable section @@ -82,7 +82,7 @@ end end -@[expose] public section +public section noncomputable section @@ -210,7 +210,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularSobolev.lean index 1229e9b921..7cf6c8b4af 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularSobolev.lean @@ -29,7 +29,7 @@ section /-! Actual ordered derivative sums depend only on the local function germ. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ end end -@[expose] public section +public section noncomputable section @@ -97,7 +97,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTimeWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTimeWeight.lean index cee293a07d..0f88cb7a1d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTimeWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTimeWeight.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ContinuousTimeWeight /-! Actual scalar time weighting commutes with cylinder inclusion, translations, and rectangular multiplication. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,8 @@ theorem supportedMultiplier_weight (A : C(K, Space →ᵇ E →L[ℝ] F)) weight g (supportedMultiplierMap period S hS A u) := by apply ContinuousMap.ext intro t - exact (supportedOperatorMap period S hS (A t)).map_smul (g t) (u t) + simpa only [supportedMultiplierMap_apply, weight_apply] using + (supportedOperatorMap period S hS (A t)).map_smul (g t) (u t) theorem supportedMultiplier_normalize (hg : ∀ t, 0 < g t) (A : C(K, Space →ᵇ E →L[ℝ] F)) (u : C(K, Supported period E S hS)) : @@ -44,10 +45,15 @@ theorem supportedMultiplier_normalize (hg : ∀ t, 0 < g t) supportedMultiplier_weight period S hS (reciprocal g hg) A u theorem include_weight (u : C(K, Supported period E S hS)) : - includePath period S hS (weight g u) = weight g (includePath period S hS u) := rfl + includePath period S hS (weight g u) = weight g (includePath period S hS u) := by + apply ContinuousMap.ext + intro t + simp only [includePath_apply, weight_apply] + rfl theorem include_normalize (hg : ∀ t, 0 < g t) (u : C(K, Supported period E S hS)) : - includePath period S hS (normalize g hg u) = normalize g hg (includePath period S hS u) := rfl + includePath period S hS (normalize g hg u) = normalize g hg (includePath period S hS u) := + include_weight period S hS (reciprocal g hg) u theorem translate_weight (a : LiftTangent) (u : C(K, CylinderL2 period E)) : pathTranslate period a (weight g u) = weight g (pathTranslate period a u) := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTranslation.lean index c4ae896157..a5567010d6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderTranslation.lean @@ -30,7 +30,7 @@ which the translated data lie in one fixed larger supported space. This margin is qualitative and does not occur in any operator-norm constant. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ open scoped BoundedContinuousFunction variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] /-- The exact support set of a translated field. -/ -def shiftedSet (a : Space) (S : Set Space) : Set Space := {x | x+a ∈ S} +@[expose] def shiftedSet (a : Space) (S : Set Space) : Set Space := {x | x+a ∈ S} /-- Translated supports remain measurable. -/ theorem shiftedSet_measurable (a : Space) (S : Set Space) (hS : MeasurableSet S) : @@ -75,7 +75,7 @@ def intoLarger (a : Space) (S Ω : Set Space) (hS : MeasurableSet S) (hΩ : Meas @[simp] theorem intoLarger_coe (a : Space) (S Ω : Set Space) (hS : MeasurableSet S) (hΩ : MeasurableSet Ω) (hsub : shiftedSet a S ⊆ Ω) (u : supportedSpace (V := V) volume S hS) : - (intoLarger a S Ω hS hΩ hsub u : L2Space V) = translation a (u : L2Space V) := rfl + (intoLarger a S Ω hS hΩ hsub u : L2Space V) = translation a (u : L2Space V) := by rfl /-- The translated coefficient is the literal original field at `x+a`. -/ def translatedField (A : Field (α := Space) (V := V)) (a : Space) : Field (α := Space) (V := V) := @@ -97,7 +97,7 @@ theorem operator_intertwines (a : Space) (S Ω : Set Space) (hS : MeasurableSet change (full volume (translatedField A a) (translation a (u : L2Space V))) x = (translation a (full volume A (u : L2Space V))) x rw [hl, hu, hr, ha] - rfl + simp only [translatedField, EulerMeanCoefficients.translated_apply] /-- Compactly supported data have a qualitative translation neighborhood inside any prescribed larger open support region. -/ @@ -118,7 +118,7 @@ end end -@[expose] public section +public section noncomputable section @@ -138,7 +138,7 @@ section Translation variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Actual translation by a real covering-space parameter. -/ -def translate (a : LiftTangent) : CylinderL2 period V →ₗᵢ[ℝ] CylinderL2 period V := +@[expose] def translate (a : LiftTangent) : CylinderL2 period V →ₗᵢ[ℝ] CylinderL2 period V := Lp.compMeasurePreservingₗᵢ ℝ (fun x : LiftDomain period => x+coveringMap period a) (measurePreserving_translation period (coveringMap period a)) @@ -180,12 +180,13 @@ theorem translate_continuous (u : CylinderL2 period V) : variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- The same mixed translation on actual continuous time paths. -/ -def pathTranslate (a : LiftTangent) : C(K,CylinderL2 period V) →L[ℝ] C(K,CylinderL2 period V) := +@[expose] def pathTranslate (a : LiftTangent) : + C(K,CylinderL2 period V) →L[ℝ] C(K,CylinderL2 period V) := (translate period a).toContinuousLinearMap.compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem pathTranslate_apply (a : LiftTangent) (u : C(K, CylinderL2 period V)) (t : K) : - pathTranslate period a u t = translate period a (u t) := rfl + pathTranslate period a u t = translate period a (u t) := by rfl theorem pathTranslate_norm (a : LiftTangent) : ‖pathTranslate (K := K) (V := V) period a‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -204,12 +205,12 @@ section Fields variable {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- An angle-independent coefficient on the actual cylinder. -/ -def fieldLift : (Space →ᵇ W) →L[ℝ] (LiftDomain period →ᵇ W) := +@[expose] def fieldLift : (Space →ᵇ W) →L[ℝ] (LiftDomain period →ᵇ W) := BoundedContinuousFunction.compContinuousCLM W ℝ ⟨Prod.fst,continuous_fst⟩ omit [Fact (0 < period)] in @[simp] theorem fieldLift_apply (A : Space →ᵇ W) (x : LiftDomain period) : - fieldLift period A x = A x.1 := rfl + fieldLift period A x = A x.1 := by rfl omit [Fact (0 < period)] in theorem fieldLift_norm : ‖fieldLift (W := W) period‖ ≤ 1 := by @@ -223,12 +224,12 @@ theorem fieldLift_norm : ‖fieldLift (W := W) period‖ ≤ 1 := by variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- The bounded linear lift of an entire coefficient time path. -/ -def fieldPathLift : C(K,Space →ᵇ W) →L[ℝ] C(K,LiftDomain period →ᵇ W) := +@[expose] def fieldPathLift : C(K,Space →ᵇ W) →L[ℝ] C(K,LiftDomain period →ᵇ W) := (fieldLift period).compLeftContinuous ℝ K omit [CompactSpace K] [Fact (0 < period)] in @[simp] theorem fieldPathLift_apply (A : C(K, Space →ᵇ W)) (t : K) (x : LiftDomain period) : - fieldPathLift period A t x = A t x.1 := rfl + fieldPathLift period A t x = A t x.1 := by rfl omit [Fact (0 < period)] in theorem fieldPathLift_norm : ‖fieldPathLift (K := K) (W := W) period‖ ≤ 1 := by @@ -244,7 +245,7 @@ theorem fieldPathLift_norm : ‖fieldPathLift (K := K) (W := W) period‖ ≤ 1 end Fields /-- Support in a set of spatial labels, with arbitrary angular coordinate. -/ -def spatialSet (S : Set Space) : Set (LiftDomain period) := Prod.fst ⁻¹' S +@[expose] def spatialSet (S : Set Space) : Set (LiftDomain period) := Prod.fst ⁻¹' S omit [Fact (0 < period)] in theorem spatialSet_measurable (S : Set Space) (hS : MeasurableSet S) : @@ -274,7 +275,8 @@ theorem translate_mem (a : LiftTangent) (S Ω : Set Space) (hS : MeasurableSet S exact hnot (hsub hs) /-- Actual isometric mixed translation into a fixed spatial support region. -/ -def intoLarger (a : LiftTangent) (S Ω : Set Space) (hS : MeasurableSet S) (hΩ : MeasurableSet Ω) +@[expose] def intoLarger (a : LiftTangent) (S Ω : Set Space) + (hS : MeasurableSet S) (hΩ : MeasurableSet Ω) (hsub : EulerLpSupportedTranslation.shiftedSet a.1 S ⊆ Ω) : supportedSpace (V := V) (liftMeasure period) (spatialSet period S) (spatialSet_measurable period S hS) →ₗᵢ[ℝ] @@ -288,6 +290,14 @@ def intoLarger (a : LiftTangent) (S Ω : Set Space) (hS : MeasurableSet S) (hΩ (translate_mem period a S Ω hS hΩ hsub) norm_map' := fun u => (translate period a).norm_map (u : CylinderL2 period V) +@[simp] theorem intoLarger_coe (a : LiftTangent) (S Ω : Set Space) + (hS : MeasurableSet S) (hΩ : MeasurableSet Ω) + (hsub : EulerLpSupportedTranslation.shiftedSet a.1 S ⊆ Ω) + (u : supportedSpace (V := V) (liftMeasure period) (spatialSet period S) + (spatialSet_measurable period S hS)) : + (intoLarger period a S Ω hS hΩ hsub u : CylinderL2 period V) = + translate period a (u : CylinderL2 period V) := by rfl + end Supported /-- Angular displacement costs no support margin; the spatial margin is purely qualitative. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeBundling.lean b/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeBundling.lean index be45d7f748..71bf14843c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeBundling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeBundling.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.LpDerivativeMap /-! The L² derivative-field construction is a contraction between the actual Banach spaces. -/ -@[expose] public section +public section noncomputable section @@ -31,11 +31,13 @@ def bundlingLinear : Lp (P →L[ℝ] V) 2 μ →ₗ[ℝ] (P →L[ℝ] Lp V 2 μ) map_add' D E := by apply ContinuousLinearMap.ext intro a - exact ((ContinuousLinearMap.apply ℝ V a).compLpL 2 μ).map_add D E + simpa only [derivativeMap_apply, applyDerivative, add_apply] using + ((ContinuousLinearMap.apply ℝ V a).compLpL 2 μ).map_add D E map_smul' c D := by apply ContinuousLinearMap.ext intro a - exact ((ContinuousLinearMap.apply ℝ V a).compLpL 2 μ).map_smul c D + simpa only [derivativeMap_apply, applyDerivative, smul_apply, RingHom.id_apply] using + ((ContinuousLinearMap.apply ℝ V a).compLpL 2 μ).map_smul c D /-- Derivative bundling, bundling `toLinearMap`, `cont`. -/ def derivativeBundling : Lp (P →L[ℝ] V) 2 μ →L[ℝ] (P →L[ℝ] Lp V 2 μ) where @@ -46,7 +48,8 @@ def derivativeBundling : Lp (P →L[ℝ] V) 2 μ →L[ℝ] (P →L[ℝ] Lp V 2 simpa only [one_mul] using derivativeMap_norm_le μ D) @[simp] theorem derivativeBundling_apply (D : Lp (P →L[ℝ] V) 2 μ) : - derivativeBundling μ D = derivativeMap μ D := rfl + derivativeBundling μ D = derivativeMap μ D := by + rfl theorem derivativeBundling_norm_le_one : ‖derivativeBundling (P := P) (V := V) μ‖ ≤ 1 := (derivativeBundling (P := P) (V := V) μ).opNorm_le_bound zero_le_one (fun D => by diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeMap.lean b/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeMap.lean index 30154478ce..dc39da749d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpDerivativeMap.lean @@ -11,7 +11,7 @@ public import Mathlib.MeasureTheory.Function.LpSpace.Basic /-! Currying an actual L² field of derivatives into a bounded derivative operator. -/ -@[expose] public section +public section noncomputable section @@ -26,6 +26,7 @@ variable {X P V : Type*} [MeasurableSpace X] (μ : Measure X) /-- Apply derivative, given by `(ContinuousLinearMap.apply ℝ V a).compLpL 2 μ D`. -/ +@[expose] def applyDerivative (D : Lp (P →L[ℝ] V) 2 μ) (a : P) : Lp V 2 μ := (ContinuousLinearMap.apply ℝ V a).compLpL 2 μ D @@ -65,6 +66,11 @@ def derivativeLinear (D : Lp (P →L[ℝ] V) 2 μ) : P →ₗ[ℝ] Lp V 2 μ whe def derivativeMap (D : Lp (P →L[ℝ] V) 2 μ) : P →L[ℝ] Lp V 2 μ := (derivativeLinear μ D).mkContinuous ‖D‖ (applyDerivative_norm_le μ D) +/-- Applying the bounded derivative agrees with pointwise evaluation in `Lp`. -/ +@[simp] theorem derivativeMap_apply (D : Lp (P →L[ℝ] V) 2 μ) (a : P) : + derivativeMap μ D a = applyDerivative μ D a := by + rfl + theorem derivativeMap_ae (D : Lp (P →L[ℝ] V) 2 μ) (a : P) : derivativeMap μ D a =ᵐ[μ] fun x => D x a := applyDerivative_ae μ D a diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpDominatedConvergence.lean b/LeanPool/NavierStokesAndEuler/Euler/LpDominatedConvergence.lean index 6c6105ef0f..85ab500423 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpDominatedConvergence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpDominatedConvergence.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Dominated convergence in genuine L², also for Banach-valued representatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpDominatedDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/LpDominatedDerivative.lean index 14144216e2..f6f493b3ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpDominatedDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpDominatedDerivative.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Basic /-! Differentiating an actual L²-valued family by dominated ordinary derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpFiniteTensorReconstruction.lean b/LeanPool/NavierStokesAndEuler/Euler/LpFiniteTensorReconstruction.lean index 9530f17f01..2df5858769 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpFiniteTensorReconstruction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpFiniteTensorReconstruction.lean @@ -16,7 +16,7 @@ L² derivatives. Quantitative Gevrey estimates continue to use the ordered-word norms directly, and do not pass through these coordinate norm equivalences. -/ -@[expose] public section +public section noncomputable section @@ -61,7 +61,7 @@ def direction (i : Fin 3) : Space := EuclideanSpace.single i 1 /-- Tensor coordinates, given by `ContinuousLinearMap.pi (fun w => (ContinuousLinearMap.id ℝ (Space [×n]→L[ℝ] V)).flipMultilinear (fun i => direction (w i)))`. -/ -def tensorCoordinates (n : ℕ) : +@[expose] def tensorCoordinates (n : ℕ) : (Space [×n]→L[ℝ] V) →L[ℝ] ((Fin n → Fin 3) → V) := ContinuousLinearMap.pi (fun w => (ContinuousLinearMap.id ℝ (Space [×n]→L[ℝ] V)).flipMultilinear (fun i => direction (w i))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpMultilinearBundling.lean b/LeanPool/NavierStokesAndEuler/Euler/LpMultilinearBundling.lean index 3ea0416cb6..0421412115 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpMultilinearBundling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpMultilinearBundling.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Function.LpSpace.Basic /-! Pointwise multilinear L² fields define genuine bounded multilinear maps into L². -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpOperatorField.lean b/LeanPool/NavierStokesAndEuler/Euler/LpOperatorField.lean index f61c835df4..f0b4f45192 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpOperatorField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpOperatorField.lean @@ -20,7 +20,7 @@ to the closed supported spaces, where its norm needs a bound only on the support region. This supplies the physical frame and projected forcing maps. -/ -@[expose] public section +public section noncomputable section @@ -102,7 +102,7 @@ theorem applyField_norm (A : α →ᵇ (E →L[ℝ] F)) (u : Lp E 2 μ) : (mul_le_mul_of_nonneg_right (A.norm_coe_le_norm x) (norm_nonneg _)) /-- The actual bounded rectangular multiplier on full spatial L². -/ -def full (A : α →ᵇ (E →L[ℝ] F)) : Lp E 2 μ →L[ℝ] Lp F 2 μ := +@[expose] def full (A : α →ᵇ (E →L[ℝ] F)) : Lp E 2 μ →L[ℝ] Lp F 2 μ := (fullLinear μ A).mkContinuous ‖A‖ (applyField_norm μ A) theorem full_ae (A : α →ᵇ (E →L[ℝ] F)) (u : Lp E 2 μ) : @@ -134,7 +134,7 @@ theorem full_smul (r : ℝ) (A : α →ᵇ (E →L[ℝ] F)) : full μ (r • A) rfl /-- Rectangular multiplier formation is itself a linear contraction. -/ -def fullMap : (α →ᵇ (E →L[ℝ] F)) →L[ℝ] (Lp E 2 μ →L[ℝ] Lp F 2 μ) where +@[expose] def fullMap : (α →ᵇ (E →L[ℝ] F)) →L[ℝ] (Lp E 2 μ →L[ℝ] Lp F 2 μ) where toLinearMap := { toFun := full μ, map_add' := full_add μ, map_smul' := full_smul μ } cont := AddMonoidHomClass.continuous_of_bound ({ toFun := full μ, map_add' := full_add μ, map_smul' := full_smul μ } : @@ -143,6 +143,10 @@ def fullMap : (α →ᵇ (E →L[ℝ] F)) →L[ℝ] (Lp E 2 μ →L[ℝ] Lp F 2 change ‖full μ A‖ ≤ (1 : ℝ)*‖A‖ simpa only [one_mul] using full_norm μ A) +@[simp] theorem fullMap_apply (A : α →ᵇ (E →L[ℝ] F)) : + fullMap μ A = full μ A := by + rfl + theorem fullMap_norm : ‖fullMap (E := E) (F := F) μ‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one intro A @@ -169,7 +173,7 @@ theorem full_mem (A : α →ᵇ (E →L[ℝ] F)) (u : supportedSpace (V := E) μ rw [ha,hu hx,map_zero] /-- The genuine rectangular multiplier between the supported Hilbert spaces. -/ -def supported (A : α →ᵇ (E →L[ℝ] F)) : +@[expose] def supported (A : α →ᵇ (E →L[ℝ] F)) : supportedSpace (V := E) μ S hS →L[ℝ] supportedSpace (V := F) μ S hS := ((full μ A).comp (supportedSpace μ S hS).subtypeL).codRestrict (supportedSpace μ S hS) (full_mem μ S hS A) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpOperatorFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/LpOperatorFieldAlgebra.lean index dc82d1177b..d70ea0bb1f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpOperatorFieldAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpOperatorFieldAlgebra.lean @@ -20,7 +20,7 @@ rectangular multipliers. Thus support preservation of a variational inverse can be proved by its actual uniqueness theorem. -/ -@[expose] public section +public section noncomputable section @@ -52,8 +52,8 @@ theorem full_comp (A : α →ᵇ E →L[ℝ] F) (B : α →ᵇ U →L[ℝ] E) : rw [hab,ha,hb] rfl -theorem full_neg (A : α →ᵇ E →L[ℝ] F) : full μ (-A) = -full μ A := - map_neg (fullMap μ) A +theorem full_neg (A : α →ᵇ E →L[ℝ] F) : full μ (-A) = -full μ A := by + simpa only [fullMap_apply] using map_neg (fullMap μ) A /-- A literal coefficient identity can be lifted without introducing a new operator hypothesis. -/ @@ -110,8 +110,8 @@ theorem full_cutoff (S : Set α) (hS : MeasurableSet S) apply Lp.ext filter_upwards [full_ae μ A (cutoffOperator μ S hS u),cutoff_ae μ S hS u, cutoff_ae μ S hS (full μ A u),full_ae μ A u] with x ha hi ho hu - change full μ A (cutoffOperator μ S hS u) x = cutoff μ S hS (full μ A u) x - change cutoffOperator μ S hS u x = _ at hi + simp only [cutoffOperator_apply] at ha + simp only [cutoffOperator_apply] rw [ha,hi,ho] by_cases hx : x ∈ S · simp only [indicator_of_mem hx,hu] @@ -153,7 +153,7 @@ theorem cutoffOperator_adjoint : rw [adjoint_inner_left,L2.inner_def,L2.inner_def] apply integral_congr_ae filter_upwards [cutoff_ae μ S hS v,cutoff_ae μ S hS u] with x hv hu - change ⟪u x,cutoff μ S hS v x⟫_ℝ = ⟪cutoff μ S hS u x,v x⟫_ℝ + simp only [cutoffOperator_apply] rw [hv,hu] by_cases hx : x ∈ S · simp only [indicator_of_mem hx] diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpParameterIntegral.lean b/LeanPool/NavierStokesAndEuler/Euler/LpParameterIntegral.lean index f6e565ed11..a8ebd47e9b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpParameterIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpParameterIntegral.lean @@ -15,7 +15,7 @@ import Mathlib.MeasureTheory.Integral.Prod The result is proved directly on raw jointly measurable representatives, without assuming a pre-existing Bochner path in the L² space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothApproximation.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothApproximation.lean index 18ed48673c..960413c1a5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothApproximation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothApproximation.lean @@ -22,7 +22,7 @@ section /-! The genuine L² derivative of translations of compact smooth ordinary-space fields. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ end end -@[expose] public section +public section noncomputable section @@ -206,7 +206,8 @@ theorem smooth_hasFDerivAt (f : Space → V) (hf : ContDiff ℝ ∞ f) · intro n exact compactField_hasFDerivAt _ _ _ · exact cutoffLp_tendsto f hf hLp - · exact (EulerLpDerivative.derivativeBundling volume).continuous.continuousAt.tendsto.comp - (cutoffDerivativeLp_tendsto f hf hLp hDLp) + · simpa only [Function.comp_def, EulerLpDerivative.derivativeBundling_apply] using + (EulerLpDerivative.derivativeBundling volume).continuous.continuousAt.tendsto.comp + (cutoffDerivativeLp_tendsto f hf hLp hDLp) end EulerLpTranslation diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientContinuity.lean index 4fbf8efe62..f1e41474de 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientContinuity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientContinuity.lean @@ -17,7 +17,7 @@ orders with differentiated bounded coefficients. This proves continuity of the genuine L² jets, including for operator-valued derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientProduct.lean index 598202353d..b4e1210d4d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothCoefficientProduct.lean @@ -21,7 +21,7 @@ derivatives are actual Fréchet derivatives, proved square integrable by the Leibniz estimate. The derivative identity remains a literal function equality. -/ -@[expose] public section +public section noncomputable section @@ -71,7 +71,7 @@ def product (A : SmoothCoefficientPath K (V →L[ℝ] W)) (t : K) integrable := product_memLp A t f @[simp] theorem product_field (A : SmoothCoefficientPath K (V →L[ℝ] W)) (t : K) - (f : SmoothL2Field V) (x : Space) : (product A t f).field x = A.field t x (f.field x) := rfl + (f : SmoothL2Field V) (x : Space) : (product A t f).field x = A.field t x (f.field x) := by rfl theorem product_toLp (A : SmoothCoefficientPath K (V →L[ℝ] W)) (t : K) (f : SmoothL2Field V) : @@ -108,7 +108,7 @@ theorem product_derivative_field (A : SmoothCoefficientPath K (V →L[ℝ] W)) ( (flipₗᵢ ℝ Space V W).toContinuousLinearEquiv.toContinuousLinearMap D v a = D a v := rfl simpa only [product, addField_field, SmoothL2Field.derivative, leftDerivative, rightDerivative, SmoothCoefficientPath.map_apply, - SmoothCoefficientPath.derivative, SmoothCoefficientPath.derivativeField_eq, + SmoothCoefficientPath.derivative_apply, hflip, flip_apply, compL_apply, comp_apply, add_apply] using he theorem jetLp_congr (f g : SmoothL2Field V) (h : f.field = g.field) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean index 561d5f7818..03f2a240e4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Actual all-order translation regularity from ordinary square-integrable spatial derivatives. -/ -@[expose] public section +public section noncomputable section @@ -58,16 +58,16 @@ theorem memLp (A : SmoothL2Field V) : MemLp A.field 2 volume := (Eventually.of_forall (fun _ => norm_iteratedFDeriv_zero)) /-- To Lᵖ, given by `A.memLp.toLp A.field`. -/ -def toLp (A : SmoothL2Field V) : L2Space V := A.memLp.toLp A.field +@[expose] def toLp (A : SmoothL2Field V) : L2Space V := A.memLp.toLp A.field theorem toLp_ae (A : SmoothL2Field V) : A.toLp =ᵐ[volume] A.field := A.memLp.coeFn_toLp /-- Jet Lᵖ, given by `(A.integrable n).toLp (iteratedFDeriv ℝ n A.field)`. -/ -def jetLp (A : SmoothL2Field V) (n : ℕ) : L2Space (Space [×n]→L[ℝ] V) := +@[expose] def jetLp (A : SmoothL2Field V) (n : ℕ) : L2Space (Space [×n]→L[ℝ] V) := (A.integrable n).toLp (iteratedFDeriv ℝ n A.field) /-- Derivative, bundling `field`, `smooth`, `integrable`. -/ -def derivative (A : SmoothL2Field V) : SmoothL2Field (Space →L[ℝ] V) where +@[expose] def derivative (A : SmoothL2Field V) : SmoothL2Field (Space →L[ℝ] V) where field := fderiv ℝ A.field smooth := A.smooth.fderiv_right (m := ∞) (by simp) integrable n := (A.integrable (n+1)).congr_norm @@ -85,7 +85,8 @@ theorem translation_hasFDerivAt (A : SmoothL2Field V) (a : Space) : theorem translation_fderiv (A : SmoothL2Field V) : fderiv ℝ (fun a : Space => translation a A.toLp) = fun a => derivativeBundling volume (translation a A.derivative.toLp) := - funext (fun a => (A.translation_hasFDerivAt a).fderiv) + funext (fun a => by + simpa only [derivativeBundling_apply] using (A.translation_hasFDerivAt a).fderiv) private theorem translation_contDiff_nat_aux (n : ℕ) : ∀ (V : Type u) [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothL2Field V), diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldAlgebra.lean index f02cba63c4..85711ef9bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldAlgebra.lean @@ -18,7 +18,7 @@ All jets below remain actual Fréchet derivatives. The operations preserve their genuine L² classes and continuity in an external parameter. -/ -@[expose] public section +public section noncomputable section @@ -32,12 +32,12 @@ variable {V W : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Jet postcompose, given by `compContinuousMultilinearMapL ℝ (fun _ : Fin n => Space) V W L`. -/ -def jetPostcompose (L : V →L[ℝ] W) (n : ℕ) : +@[expose] def jetPostcompose (L : V →L[ℝ] W) (n : ℕ) : (Space [×n]→L[ℝ] V) →L[ℝ] (Space [×n]→L[ℝ] W) := compContinuousMultilinearMapL ℝ (fun _ : Fin n => Space) V W L /-- Map field, bundling `field`, `smooth`, `integrable`. -/ -def mapField (L : V →L[ℝ] W) (A : SmoothL2Field V) : SmoothL2Field W where +@[expose] def mapField (L : V →L[ℝ] W) (A : SmoothL2Field V) : SmoothL2Field W where field := L ∘ A.field smooth := L.contDiff.comp A.smooth integrable n := (jetPostcompose L n).comp_memLp' (A.integrable n) |>.ae_eq @@ -45,7 +45,7 @@ def mapField (L : V →L[ℝ] W) (A : SmoothL2Field V) : SmoothL2Field W where simp)).symm)) @[simp] theorem mapField_field (L : V →L[ℝ] W) (A : SmoothL2Field V) (x : Space) : - (mapField L A).field x = L (A.field x) := rfl + (mapField L A).field x = L (A.field x) := by rfl theorem toLp_mapField (L : V →L[ℝ] W) (A : SmoothL2Field V) : (mapField L A).toLp = L.compLpL 2 volume A.toLp := by @@ -70,7 +70,7 @@ def addField (A B : SmoothL2Field V) : SmoothL2Field V where (A.smooth.contDiffAt.of_le (by simp)) (B.smooth.contDiffAt.of_le (by simp))).symm)) @[simp] theorem addField_field (A B : SmoothL2Field V) (x : Space) : - (addField A B).field x = A.field x+B.field x := rfl + (addField A B).field x = A.field x+B.field x := by rfl theorem toLp_addField (A B : SmoothL2Field V) : (addField A B).toLp = A.toLp+B.toLp := by apply Lp.ext @@ -114,11 +114,11 @@ theorem jetLp_derivative (A : SmoothL2Field V) (n : ℕ) : exact ((continuousMultilinearCurryRightEquiv' ℝ n Space V).apply_symm_apply _).symm /-- Directional field, given by `mapField (ContinuousLinearMap.apply ℝ V v) A.derivative`. -/ -def directionalField (A : SmoothL2Field V) (v : Space) : SmoothL2Field V := +@[expose] def directionalField (A : SmoothL2Field V) (v : Space) : SmoothL2Field V := mapField (ContinuousLinearMap.apply ℝ V v) A.derivative @[simp] theorem directionalField_field (A : SmoothL2Field V) (v x : Space) : - (directionalField A v).field x = fderiv ℝ A.field x v := rfl + (directionalField A v).field x = fderiv ℝ A.field x v := by rfl theorem toLp_eq_jet_zero (A : SmoothL2Field V) : A.toLp = (continuousMultilinearCurryFin0 ℝ Space diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldJets.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldJets.lean index 55a209520b..6c3f7afb94 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothFieldJets.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Exact identification of ordinary spatial derivatives with all translation jets in L². -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,8 @@ private theorem iteratedFDeriv_translation_ae_aux (n : ℕ) : fun b : Space => translation b A.derivative.toLp) a (Fin.init v)) (v (Fin.last n)) = _ rw [(derivativeBundling (P := Space) (V := V) volume).iteratedFDeriv_comp_left (A.derivative.translation_contDiff.contDiffAt (x := a)) (by simp)] - rfl + simp only [ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply, + derivativeBundling_apply] rw [he] filter_upwards [derivativeMap_ae volume (iteratedFDeriv ℝ n (fun b : Space => translation b A.derivative.toLp) a (Fin.init v)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSpatialCutoff.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSpatialCutoff.lean index 003628c980..6bffefc0eb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSpatialCutoff.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSpatialCutoff.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Mul /-! Expanding ordinary-space cutoffs and their actual first derivative controls. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -77,7 +77,7 @@ theorem cutoff_derivative_tendsto (x : Space) : variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Cutoff field, given by `cutoff n x • f x`. -/ -def cutoffField (f : Space → V) (n : ℕ) (x : Space) : V := cutoff n x • f x +@[expose] def cutoffField (f : Space → V) (n : ℕ) (x : Space) : V := cutoff n x • f x theorem cutoffField_smooth (f : Space → V) (hf : ContDiff ℝ ∞ f) (n : ℕ) : ContDiff ℝ ∞ (cutoffField f n) := (cutoff_smooth n).smul hf diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSupportedConstructedEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSupportedConstructedEvolution.lean index ded64eaacc..9e86bb6864 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSupportedConstructedEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSupportedConstructedEvolution.lean @@ -33,7 +33,7 @@ identities. Their propagator norm uses only the pointwise bound on that set, so the source's `C g(t)/g(s)` estimate is preserved exactly. -/ -@[expose] public section +public section noncomputable section @@ -88,13 +88,13 @@ local instance instLpSupportedEvolution11 : NormedSpace ℝ (supportedSpace (V : V) μ S hS) := inferInstance /-- The actual supported-space operator associated with a continuous field path. -/ -def operatorPath (T : ℝ) (A : C(Icc (0 : ℝ) T, Field (α := α) (V := V))) : +@[expose] def operatorPath (T : ℝ) (A : C(Icc (0 : ℝ) T, Field (α := α) (V := V))) : C(Icc (0 : ℝ) T,supportedSpace (V := V) μ S hS →L[ℝ] supportedSpace (V := V) μ S hS) := ⟨fun t => operator μ S hS (A t), (operatorMap μ S hS).continuous.comp A.continuous⟩ omit [CompleteSpace V] in @[simp] theorem operatorPath_apply (T : ℝ) (A : C(Icc (0 : ℝ) T, Field (α := α) (V := V))) - (t : Icc (0 : ℝ) T) : operatorPath μ S hS T A t = operator μ S hS (A t) := rfl + (t : Icc (0 : ℝ) T) : operatorPath μ S hS T A t = operator μ S hS (A t) := by rfl /-- Actual pointwise time derivatives lift to supported-L² operator derivatives. -/ theorem operatorPath_hasDerivWithinAt (T : ℝ) (hT : 0 ≤ T) @@ -132,7 +132,7 @@ variable (T : ℝ) (hT : 0 ≤ T) /-- The actual pointwise homogeneous fields give a homogeneous evolution on the genuine supported spatial L² space. -/ -def liftEvolution : Evolution T hT (operatorPath μ S hS T B) where +@[expose] def liftEvolution : Evolution T hT (operatorPath μ S hS T B) where forward := operatorPath μ S hS T Φ backward := operatorPath μ S hS T Ψ forward_backward := by @@ -211,7 +211,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSupportedMultiplier.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSupportedMultiplier.lean index d81c7381b1..fdd658c4cc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSupportedMultiplier.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSupportedMultiplier.lean @@ -20,7 +20,7 @@ coefficient values on the support set. Thus the localized (H3) propagator bound is retained without any estimate outside its stated region. -/ -@[expose] public section +public section noncomputable section @@ -59,7 +59,7 @@ theorem full_mem (A : Field (α := α) (V := V)) (u : supportedSpace (V := V) μ rw [ha, hu hs, map_zero] /-- The genuine coefficient operator on the supported Hilbert space. -/ -def operator (A : Field (α := α) (V := V)) : +@[expose] def operator (A : Field (α := α) (V := V)) : supportedSpace (V := V) μ S hS →L[ℝ] supportedSpace (V := V) μ S hS := ((full μ A).comp (supportedSpace μ S hS).subtypeL).codRestrict (supportedSpace μ S hS) (full_mem μ S hS A) @@ -156,7 +156,7 @@ theorem operator_one : operator μ S hS (1 : Field (α := α) (V := V)) = exact hx /-- Coefficient-to-operator lifting is a genuine bounded linear map. -/ -def operatorMap : Field (α := α) (V := V) →L[ℝ] +@[expose] def operatorMap : Field (α := α) (V := V) →L[ℝ] (supportedSpace (V := V) μ S hS →L[ℝ] supportedSpace (V := V) μ S hS) where toLinearMap := { toFun := operator μ S hS diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSupportedSubspace.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSupportedSubspace.lean index 8edbdc2e32..665c9a5929 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSupportedSubspace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSupportedSubspace.lean @@ -17,7 +17,7 @@ identity minus measurable-set projection. This gives a complete Hilbert space for localized propagators and keeps the support restriction explicit. -/ -@[expose] public section +public section noncomputable section @@ -80,6 +80,10 @@ def cutoffOperator : Lp V 2 μ →L[ℝ] Lp V 2 μ := change ‖cutoff μ S hS u‖ ≤ (1 : ℝ)*‖u‖ simpa only [one_mul] using cutoff_norm μ S hS u) +@[simp] theorem cutoffOperator_apply (u : Lp V 2 μ) : + cutoffOperator μ S hS u = cutoff μ S hS u := by + rfl + /-- The localized Hilbert subspace is a closed kernel. -/ def supportedSpace : Submodule ℝ (Lp V 2 μ) := (ContinuousLinearMap.id ℝ (Lp V 2 μ) - cutoffOperator μ S hS).ker diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/LpTranslation.lean index e6368d8d0b..efb016f40a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpTranslation.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Function.LpSpace.ContinuousCompMeasurePreserving /-! Genuine ordinary-space L² translations and closedness of their full derivative. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ abbrev L2Space (V : Type*) [NormedAddCommGroup V] := Lp V 2 (volume : Measure Sp /-- Translation, given by `Lp.compMeasurePreservingₗᵢ ℝ (fun x : Space => x+a) (measurePreserving_add_right volume a)`. -/ -def translation (a : Space) : L2Space V →ₗᵢ[ℝ] L2Space V := +@[expose] def translation (a : Space) : L2Space V →ₗᵢ[ℝ] L2Space V := Lp.compMeasurePreservingₗᵢ ℝ (fun x : Space => x+a) (measurePreserving_add_right volume a) theorem translation_ae (a : Space) (u : L2Space V) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanAccelerationGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanAccelerationGevrey.lean index 37d0d14b16..94cd593752 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanAccelerationGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanAccelerationGevrey.lean @@ -22,7 +22,7 @@ translation of the original field. Consequently the estimates below concern the real spatial orbit, with no assumed derivatives of the inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryDerivative.lean index 62573e05ce..45cb220a3a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryDerivative.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanCutoffTaylor /-! Genuine directional derivatives of the localized Newtonian operator family in operator norm. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryFrechet.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryFrechet.lean index 79113eab55..e46a3ea8bf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryFrechet.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryFrechet.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension /-! Full spatial-parameter smoothness of the actual localized Newtonian operators. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ def cutoffDirectionalMap (L : Cutoff → E) @[simp] theorem cutoffDirectionalMap_apply (L : Cutoff → E) (hadd : ∀ χ ψ, L (χ.add ψ) = L χ + L ψ) (hsmul : ∀ χ c, L (χ.scale c) = c • L χ) (χ : Cutoff) (a : Space) : - cutoffDirectionalMap L hadd hsmul χ a = L (χ.directional a) := rfl + cutoffDirectionalMap L hadd hsmul χ a = L (χ.directional a) := by rfl theorem cutoffOperation_differenceError (L : Cutoff → E) (hsmul : ∀ χ c, L (χ.scale c) = c • L χ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryIterated.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryIterated.lean index 05edc9e603..4da328eda3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryIterated.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryIterated.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Genuine all-order derivatives of the cutoff operators, with a fixed support-volume factor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryMixed.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryMixed.lean index 4958d62a0a..259aa33def 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryMixed.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryMixed.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanBoundaryOperator /-! Genuine mixed cutoff Newtonian operators and their quantitative dependence on both cutoffs. -/ -@[expose] public section +public section noncomputable section @@ -28,22 +28,22 @@ open scoped ContDiff rfl /-- Add, given by `⟨χ.field + ψ.field, χ.smooth.add ψ.smooth, χ.compact.add ψ.compact⟩`. -/ -def Cutoff.add (χ ψ : Cutoff) : Cutoff := +@[expose] def Cutoff.add (χ ψ : Cutoff) : Cutoff := ⟨χ.field + ψ.field, χ.smooth.add ψ.smooth, χ.compact.add ψ.compact⟩ /-- Scale, given by `⟨c • χ.field, χ.smooth.const_smul c, χ.compact.comp_left (g := fun t : ℝ => c • t) (smul_zero c)⟩`. -/ -def Cutoff.scale (χ : Cutoff) (c : ℝ) : Cutoff := +@[expose] def Cutoff.scale (χ : Cutoff) (c : ℝ) : Cutoff := ⟨c • χ.field, χ.smooth.const_smul c, χ.compact.comp_left (g := fun t : ℝ => c • t) (smul_zero c)⟩ /-- Sub, given by `⟨χ.field - ψ.field, χ.smooth.sub ψ.smooth, χ.compact.sub ψ.compact⟩`. -/ -def Cutoff.sub (χ ψ : Cutoff) : Cutoff := +@[expose] def Cutoff.sub (χ ψ : Cutoff) : Cutoff := ⟨χ.field - ψ.field, χ.smooth.sub ψ.smooth, χ.compact.sub ψ.compact⟩ /-- Translate, given by `⟨fun x => χ.field (x+a), χ.smooth.comp (contDiff_id.add contDiff_const), χ.compact.comp_homeomorph (Homeomorph.addRight a)⟩`. -/ -def Cutoff.translate (χ : Cutoff) (a : Space) : Cutoff := +@[expose] def Cutoff.translate (χ : Cutoff) (a : Space) : Cutoff := ⟨fun x => χ.field (x+a), χ.smooth.comp (contDiff_id.add contDiff_const), χ.compact.comp_homeomorph (Homeomorph.addRight a)⟩ @@ -147,7 +147,7 @@ theorem weakPotential_sub (χ ψ : Cutoff) : rw [neg_one_smul ℝ, sub_eq_add_neg] /-- The literal weak `curl χ (-Δ)⁻¹ ψ curl` operator. -/ -def mixedBoundaryOperator (χ ψ : Cutoff) : L2 →L[ℝ] L2 := +@[expose] def mixedBoundaryOperator (χ ψ : Cutoff) : L2 →L[ℝ] L2 := (cutoffCurl χ).comp (weakPotential ψ) theorem mixedBoundaryOperator_diagonal (χ : Cutoff) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean index a1ff551c7d..3f49d47302 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! Construction of the actual mean boundary operator by homogeneous-gradient completion and the Hilbert adjoint. No bounded inverse Laplacian on L² is assumed. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ structure Cutoff where compact : HasCompactSupport field /-- Coordinate antisymmetrization of a genuine derivative. -/ -def curlMatrix (A : Space →L[ℝ] Space) : Space := +@[expose] def curlMatrix (A : Space →L[ℝ] Space) : Space := WithLp.toLp 2 (fun i : Fin 3 => (A (EuclideanSpace.single (i+1) 1)) (i+2) - (A (EuclideanSpace.single (i+2) 1)) (i+1)) @@ -123,7 +123,7 @@ def testCurlLinear (χ : Cutoff) : Test →ₗ[ℝ] L2 where map_smul' := testCurl_smul χ /-- The proved cutoff-dependent bound on the homogeneous space. -/ -def cutoffBound (χ : Cutoff) : ℝ := +@[expose] def cutoffBound (χ : Cutoff) : ℝ := 3 * cutoffCurlConstant * (lpNorm χ.field ∞ volume + lpNorm (gradient χ.field) 3 volume) @@ -152,7 +152,7 @@ theorem testCurl_bound (χ : Cutoff) (f : Test) : ring /-- The bounded extension of actual cutoff-curl to the homogeneous Hilbert space. -/ -def cutoffCurl (χ : Cutoff) : homogeneousSpace →L[ℝ] L2 := +@[expose] def cutoffCurl (χ : Cutoff) : homogeneousSpace →L[ℝ] L2 := (testCurlLinear χ).extendOfNorm homogeneousGradient theorem cutoffCurl_on_test (χ : Cutoff) (f : Test) : @@ -164,7 +164,7 @@ theorem cutoffCurl_norm_le (χ : Cutoff) : ‖cutoffCurl χ‖ ≤ cutoffBound χ) /-- The Riesz/weak-Newtonian representation of the cutoff curl functional. -/ -def weakPotential (χ : Cutoff) : L2 →L[ℝ] homogeneousSpace := (cutoffCurl χ).adjoint +@[expose] def weakPotential (χ : Cutoff) : L2 →L[ℝ] homogeneousSpace := (cutoffCurl χ).adjoint /-- The represented functional agrees exactly with the source's distributional pairing. -/ theorem weakPotential_pairing (χ : Cutoff) (z : L2) (f : Test) : @@ -203,7 +203,8 @@ theorem existsUnique_weakPotential (χ : Cutoff) (z : L2) : ⟨weakPotential χ z, weakPotential_pairing χ z, fun u hu => weakPotential_unique χ z u hu⟩ /-- The actual bounded positive mean boundary operator `Tχ Tχ*`. -/ -def boundaryOperator (χ : Cutoff) : L2 →L[ℝ] L2 := (cutoffCurl χ).comp (weakPotential χ) +@[expose] def boundaryOperator (χ : Cutoff) : L2 →L[ℝ] L2 := + (cutoffCurl χ).comp (weakPotential χ) theorem boundaryOperator_pairing (χ : Cutoff) (z w : L2) : ⟪boundaryOperator χ z, w⟫_ℝ = ⟪weakPotential χ z, weakPotential χ w⟫_ℝ := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryPhysicalSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryPhysicalSupport.lean index b6ea2dda37..bfe6878d00 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryPhysicalSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryPhysicalSupport.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanScaledCutoff /-! Actual initial support in physical-label coordinates for the mean boundary operator. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryReflection.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryReflection.lean index 9e0e3bff68..ac805fecb1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryReflection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryReflection.lean @@ -17,7 +17,7 @@ is represented by the reflected vector test `-φ(-x)`, so both curl signs cancel. No covariance or parity of an inverse operator is assumed. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ def gradientReflection : GradientTensor ≃ₗᵢ[ℝ] GradientTensor := LinearIsometryEquiv.piLpCongrRight 2 (fun _ : Fin 3 => l2ReflectionEquiv) theorem gradientReflection_apply (G : GradientTensor) (i : Fin 3) : - gradientReflection G i = reflection (G i) := rfl + gradientReflection G i = reflection (G i) := by rfl theorem gradientReflection_involutive (G : GradientTensor) : gradientReflection (gradientReflection G) = G := by @@ -70,7 +70,7 @@ theorem testGradient_reflected (f : Test) : EulerMeanGradientTest.testGradient (reflectedTest f) = gradientReflection (EulerMeanGradientTest.testGradient f) := by ext i : 1 - change derivativeColumn (reflectedTest f) i = reflection (derivativeColumn f i) + simp only [testGradient_apply, gradientReflection_apply] apply Lp.ext filter_upwards [derivativeColumn_ae (reflectedTest f) i, reflection_ae (derivativeColumn f i), @@ -99,7 +99,7 @@ def homogeneousReflection : homogeneousSpace →ₗᵢ[ℝ] homogeneousSpace whe norm_map' u := gradientReflection.norm_map (u : GradientTensor) theorem homogeneousReflection_coe (u : homogeneousSpace) : - (homogeneousReflection u : GradientTensor) = gradientReflection (u : GradientTensor) := rfl + (homogeneousReflection u : GradientTensor) = gradientReflection (u : GradientTensor) := by rfl theorem homogeneousReflection_involutive (u : homogeneousSpace) : homogeneousReflection (homogeneousReflection u) = u := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryTranslation.lean index 02d30f38c0..0077e74485 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryTranslation.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanSolenoidalTranslation /-! The actual translation action on homogeneous gradients and localized Newtonian operators. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ def l2TranslationEquiv (a : Space) : L2 ≃ₗᵢ[ℝ] L2 := ⟨translation (-a) u, by rw [translation_add, add_neg_cancel, translation_zero]⟩) theorem l2TranslationEquiv_apply (a : Space) (u : L2) : l2TranslationEquiv a u = translation a u := - rfl + by rfl /-- Gradient translation, given by `LinearIsometryEquiv.piLpCongrRight 2 (fun _ : Fin 3 => l2TranslationEquiv a)`. -/ @@ -36,7 +36,7 @@ def gradientTranslation (a : Space) : GradientTensor ≃ₗᵢ[ℝ] GradientTens LinearIsometryEquiv.piLpCongrRight 2 (fun _ : Fin 3 => l2TranslationEquiv a) theorem gradientTranslation_apply (a : Space) (G : GradientTensor) (i : Fin 3) : - gradientTranslation a G i = translation a (G i) := rfl + gradientTranslation a G i = translation a (G i) := by rfl theorem gradientTranslation_add (a b : Space) (G : GradientTensor) : gradientTranslation a (gradientTranslation b G) = gradientTranslation (a+b) G := by @@ -56,7 +56,7 @@ theorem testGradient_translated (a : Space) (f : Test) : EulerMeanGradientTest.testGradient (translatedTest a f) = gradientTranslation a (EulerMeanGradientTest.testGradient f) := by ext i : 1 - change derivativeColumn (translatedTest a f) i = translation a (derivativeColumn f i) + simp only [testGradient_apply, gradientTranslation_apply] apply Lp.ext filter_upwards [derivativeColumn_ae (translatedTest a f) i, translation_ae a (derivativeColumn f i), @@ -86,7 +86,7 @@ def homogeneousTranslation (a : Space) : homogeneousSpace →ₗᵢ[ℝ] homogen theorem homogeneousTranslation_coe (a : Space) (u : homogeneousSpace) : (homogeneousTranslation a u : GradientTensor) = gradientTranslation a (u : GradientTensor) := - rfl + by rfl theorem homogeneousTranslation_add (a b : Space) (u : homogeneousSpace) : homogeneousTranslation a (homogeneousTranslation b u) = homogeneousTranslation (a+b) u := by @@ -126,6 +126,7 @@ theorem testCurl_translated (a : Space) (χ : Cutoff) (f : Test) : (measurePreserving_add_right (volume : Measure Space) a).quasiMeasurePreserving.ae (testCurl_ae χ f), testCurl_ae (χ.translate a) (translatedTest a f)] with x ha hχ ht rw [ha, hχ, ht] + simp only [Cutoff.translate, translatedTest] exact (vectorCurl_translated a (fun y => χ.field y • (f : Space → Space) y) x).symm /-- Translating the output translates both the cutoff and the homogeneous potential. -/ @@ -164,7 +165,7 @@ theorem mixedBoundaryOperator_translation (a : Space) (χ ψ : Cutoff) (z : L2) rw [cutoffCurl_translation, weakPotential_translation] /-- The genuine spatial translation commutator on ordinary L². -/ -def translationCommutator (a : Space) (A : L2 →L[ℝ] L2) : L2 →L[ℝ] L2 := +@[expose] def translationCommutator (a : Space) (A : L2 →L[ℝ] L2) : L2 →L[ℝ] L2 := (translation a).toContinuousLinearMap.comp A - A.comp (translation a).toContinuousLinearMap /-- Both cutoff positions, and only those positions, contribute to the spatial commutator. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalConstraints.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalConstraints.lean index cb1c829ac8..8196707847 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalConstraints.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalConstraints.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff /-! Classical divergence and pressure identities for the reconstructed mean fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalTime.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalTime.lean index e67650c32c..6f448bccbe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalTime.lean @@ -21,7 +21,7 @@ time derivative. The original AC paths have these derivatives at every interior time, and within the interval at both endpoints. -/ -@[expose] public section +public section noncomputable section @@ -58,7 +58,7 @@ def coordinateVelocityPath : C(Icc (0 : ℝ) T, solenoidalSpace) := exact hc.domRestrict⟩ @[simp] theorem coordinateVelocityPath_apply (t : Icc (0 : ℝ) T) : - s.coordinateVelocityPath t = s.velocity t := rfl + s.coordinateVelocityPath t = s.velocity t := by rfl /-- This is a continuous representative of the actual L² coordinate velocity. -/ theorem coordinateVelocityPath_ae : @@ -98,7 +98,7 @@ variable (c : ℝ) (hc : 0 < c) (fC : C(Icc (0 : ℝ) T, L2)) /-- Continuous coordinate acceleration constructed by the actual Gram inverse. -/ -def classicalAcceleration : C(Icc (0 : ℝ) T, solenoidalSpace) := +@[expose] def classicalAcceleration : C(Icc (0 : ℝ) T, solenoidalSpace) := accelerationPath T (solenoidalFrame T F) (solenoidalFrame T F₁) c hc hLower s.coordinateVelocityPath fC @@ -137,7 +137,7 @@ theorem velocity_hasDerivWithinAt s.velocity s.velocity_ac s.velocity_derivative t /-- The physical derivative path is the actual continuous product-rule expression. -/ -def classicalPhysicalDerivative : C(Icc (0 : ℝ) T, L2) := +@[expose] def classicalPhysicalDerivative : C(Icc (0 : ℝ) T, L2) := ⟨fun t => F₁ t (s.coordinateVelocityPath t : L2) + F t (s.classicalAcceleration c hc hLower fC t : L2), (F₁.continuous.clm_apply (solenoidalSpace.subtypeL.continuous.comp diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalWordBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalWordBounds.lean index c82e2419d4..4bb5d3221a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalWordBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanClassicalWordBounds.lean @@ -29,7 +29,7 @@ section /-! Strong ordinary L² spatial derivatives are the classical derivatives of the reconstructed field. -/ -@[expose] public section +public section noncomputable section @@ -103,7 +103,7 @@ end end -@[expose] public section +public section noncomputable section @@ -117,7 +117,7 @@ open scoped ContDiff variable {ι : Type*} /-- The actual strong L² spatial derivative for an ordered word. -/ -def ordinaryWord (directions : ι → Space) (u : L2) {n : ℕ} (w : Fin n → ι) : L2 := +@[expose] def ordinaryWord (directions : ι → Space) (u : L2) {n : ℕ} (w : Fin n → ι) : L2 := wordDerivative directions (fun a : Space => translation a u) w 0 @[simp] theorem ordinaryWord_zero (directions : ι → Space) (u : L2) (w : Fin 0 → ι) : @@ -224,6 +224,7 @@ def classicalWordLp (directions : ι → Space) (u : L2) (hu : SmoothOrbit u) variable [Fintype ι] /-- The finite sum definition of the actual classical Hq seminorms. -/ +@[expose] def classicalBaseSize (directions : ι → Space) (q : ℕ) (u : L2) (hu : SmoothOrbit u) : ℝ := ∑ k ∈ range (q+1), ∑ w : Fin k → ι, ‖classicalWordLp directions u hu w‖ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientFrame.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientFrame.lean index 90d7de219d..fb900d9995 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientFrame.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientFrame.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanCoefficientTime /-! Genuine matrix-frame identities induce the operator identities used by the mean inverse. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ local instance instMeanCoefficientFrame1 : NormedAddCommGroup Field := inferInst local instance instMeanCoefficientFrame2 : NormedSpace ℝ Field := inferInstance /-- Adjoint field as an element of `Field`. -/ -def adjointField (A : Field) : Field := +@[expose] def adjointField (A : Field) : Field := (ContinuousLinearMap.adjoint.toContinuousLinearEquiv.toContinuousLinearMap : (Space →L[ℝ] Space) →L[ℝ] (Space →L[ℝ] Space)).compLeftContinuousBounded Space A diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientMultipliers.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientMultipliers.lean index 9e1d2ea04c..bd3a4d461c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientMultipliers.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientMultipliers.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Continuous matrix fields act as genuine bounded operators on ordinary R³ L². -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ open scoped NNReal BoundedContinuousFunction abbrev Field := Space →ᵇ (Space →L[ℝ] Space) /-- Pointwise multiplication by a bounded continuous coefficient field. -/ -def multiplier (A : Field) : L2 →L[ℝ] L2 := +@[expose] def multiplier (A : Field) : L2 →L[ℝ] L2 := coefficientOperator A A.continuous.aestronglyMeasurable_of_secondCountable ‖A‖₊ A.norm_coe_le_norm theorem multiplier_ae (A : Field) (u : L2) : @@ -65,19 +65,19 @@ theorem multiplier_smul (c : ℝ) (A : Field) : multiplier (c • A) = c • mul rfl /-- Multiplier linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def multiplierLinear : Field →ₗ[ℝ] (L2 →L[ℝ] L2) where +@[expose] def multiplierLinear : Field →ₗ[ℝ] (L2 →L[ℝ] L2) where toFun := multiplier map_add' := multiplier_add map_smul' := multiplier_smul /-- Uniform coefficient convergence implies operator-norm convergence by this CLM. -/ -def multiplierMap : Field →L[ℝ] (L2 →L[ℝ] L2) where +@[expose] def multiplierMap : Field →L[ℝ] (L2 →L[ℝ] L2) where toLinearMap := multiplierLinear cont := AddMonoidHomClass.continuous_of_bound multiplierLinear 1 (fun A => by change ‖multiplier A‖ ≤ 1 * ‖A‖ simpa only [one_mul] using multiplier_norm_le A) -@[simp] theorem multiplierMap_apply (A : Field) : multiplierMap A = multiplier A := rfl +@[simp] theorem multiplierMap_apply (A : Field) : multiplierMap A = multiplier A := by rfl theorem multiplier_one : multiplier (1 : Field) = ContinuousLinearMap.id ℝ L2 := by apply ContinuousLinearMap.ext diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPath.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPath.lean index 1825eee202..27d816e3ec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPath.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Spatial translation calculus for coefficients uniformly on a compact time interval. -/ -@[expose] public section +public section noncomputable section @@ -40,23 +40,24 @@ synthesis. -/ local instance instMeanCoefficientPath4 : NormedSpace ℝ (Space →ᵇ (Space →L[ℝ] V)) := inferInstance /-- Translate coefficient path as an element of `C(K, Space →ᵇ V)`. -/ -def translateCoefficientPath (A : C(K, Space →ᵇ V)) (a : Space) : C(K, Space →ᵇ V) := +@[expose] def translateCoefficientPath (A : C(K, Space →ᵇ V)) (a : Space) : C(K, Space →ᵇ V) := (BoundedContinuousFunction.compContinuousCLM V ℝ ⟨fun x : Space => x+a, continuous_id.add continuous_const⟩).compLeftContinuous ℝ K A omit [CompactSpace K] in @[simp] theorem translateCoefficientPath_apply (A : C(K, Space →ᵇ V)) (a : Space) (t : K) : - translateCoefficientPath A a t = translated (A t) a := rfl + translateCoefficientPath A a t = translated (A t) a := by rfl /-- Path direction, given by `⟨fun t => fieldDerivativeMap (DA t) a, ((derivativeBundling (V := V)).continuous.comp DA.continuous).clm_apply continuous_const⟩`. -/ def pathDirection (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) (a : Space) : C(K, Space →ᵇ V) := ⟨fun t => fieldDerivativeMap (DA t) a, - ((derivativeBundling (V := V)).continuous.comp DA.continuous).clm_apply continuous_const⟩ + by simpa only [Function.comp_def, derivativeBundling_apply] using + ((derivativeBundling (V := V)).continuous.comp DA.continuous).clm_apply continuous_const⟩ omit [CompactSpace K] in @[simp] theorem pathDirection_apply (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) - (a : Space) (t : K) (x : Space) : pathDirection DA a t x = DA t x a := rfl + (a : Space) (t : K) (x : Space) : pathDirection DA a t x = DA t x a := by rfl theorem pathDirection_norm_le (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) (a : Space) : ‖pathDirection DA a‖ ≤ ‖DA‖ * ‖a‖ := by @@ -80,7 +81,12 @@ def pathDerivativeMap (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) : (pathDirection_norm_le DA) @[simp] theorem pathDerivativeMap_apply (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) - (a : Space) (t : K) (x : Space) : pathDerivativeMap DA a t x = DA t x a := rfl + (a : Space) (t : K) (x : Space) : pathDerivativeMap DA a t x = DA t x a := by rfl + +theorem pathDerivativeMap_apply_field (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) + (a : Space) (t : K) : pathDerivativeMap DA a t = fieldDerivativeMap (DA t) a := by + ext x + simp only [pathDerivativeMap_apply, fieldDerivativeMap_apply] theorem pathDerivativeMap_norm_le (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) : ‖pathDerivativeMap DA‖ ≤ ‖DA‖ := @@ -90,8 +96,8 @@ theorem pathDerivativeMap_norm_le (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) def pathDerivativeBundlingLinear : C(K, Space →ᵇ (Space →L[ℝ] V)) →ₗ[ℝ] (Space →L[ℝ] C(K, Space →ᵇ V)) where toFun := pathDerivativeMap - map_add' A B := by ext v t x; rfl - map_smul' c A := by ext v t x; rfl + map_add' A B := by ext v t x; simp [pathDerivativeMap_apply] + map_smul' c A := by ext v t x; simp [pathDerivativeMap_apply] /-- Path derivative bundling, bundling `toLinearMap`, `cont`. -/ def pathDerivativeBundling : C(K, Space →ᵇ (Space →L[ℝ] V)) →L[ℝ] @@ -102,6 +108,9 @@ def pathDerivativeBundling : C(K, Space →ᵇ (Space →L[ℝ] V)) →L[ℝ] change ‖pathDerivativeMap A‖ ≤ 1 * ‖A‖ simpa only [one_mul] using pathDerivativeMap_norm_le A) +@[simp] theorem pathDerivativeBundling_apply (A : C(K, Space →ᵇ (Space →L[ℝ] V))) : + pathDerivativeBundling A = pathDerivativeMap A := by rfl + theorem translateCoefficientPath_taylor (A : C(K, Space →ᵇ V)) (DA : C(K, Space →ᵇ (Space →L[ℝ] V))) (hA : ∀ t, ContDiff ℝ ∞ (A t : Space → V)) @@ -112,7 +121,9 @@ theorem translateCoefficientPath_taylor (A : C(K, Space →ᵇ V)) pathDerivativeMap (translateCoefficientPath DA a) (b-a)‖ ≤ M * ‖b-a‖^2 := by apply (ContinuousMap.norm_le _ (mul_nonneg hM (sq_nonneg _))).2 intro t - exact translated_taylor_bound (A t) (DA t) (hA t) (hDA t) M hM (h₂ t) a b + simpa only [ContinuousMap.sub_apply, translateCoefficientPath_apply, + pathDerivativeMap_apply_field] using + translated_taylor_bound (A t) (DA t) (hA t) (hDA t) M hM (h₂ t) a b /-- Actual spatial differentiation holds in the uniform time-path norm. -/ theorem translateCoefficientPath_hasFDerivAt (A : C(K, Space →ᵇ V)) @@ -150,6 +161,6 @@ abbrev translatedPath (T : ℝ) (A : C(Icc (0 : ℝ) T, Field)) (a : Space) : C(Icc (0 : ℝ) T, Field) := translateCoefficientPath A a @[simp] theorem translatedPath_apply (T : ℝ) (A : C(Icc (0 : ℝ) T, Field)) - (a : Space) (t : Icc (0 : ℝ) T) (x : Space) : translatedPath T A a t x = A t (x+a) := rfl + (a : Space) (t : Icc (0 : ℝ) T) (x : Space) : translatedPath T A a t x = A t (x+a) := by rfl end EulerMeanCoefficients diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPathJets.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPathJets.lean index bf41babf93..559eb447b7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPathJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientPathJets.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Uniform time-path bounds for actual spatial derivatives of the multiplication operators. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ def operatorPathMap (T : ℝ) : C(Icc (0 : ℝ) T, Field) →L[ℝ] multiplierMap.compLeftContinuous ℝ (Icc (0 : ℝ) T) @[simp] theorem operatorPathMap_apply (T : ℝ) (A : C(Icc (0 : ℝ) T, Field)) : - operatorPathMap T A = operatorPath T A := rfl + operatorPathMap T A = operatorPath T A := by rfl theorem operatorPathMap_norm_le_one (T : ℝ) : ‖operatorPathMap T‖ ≤ 1 := by apply (operatorPathMap T).opNorm_le_bound zero_le_one diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientSpatial.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientSpatial.lean index 25240815d1..d175c95db8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientSpatial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientSpatial.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Spatial translations and their genuine uniform-norm derivatives for matrix coefficients. -/ -@[expose] public section +public section noncomputable section @@ -29,11 +29,11 @@ section BoundedFields variable {V : Type*} [NormedAddCommGroup V] /-- Translated, given by `A.compContinuous ⟨fun x => x+a, continuous_id.add continuous_const⟩`. -/ -def translated (A : Space →ᵇ V) (a : Space) : Space →ᵇ V := +@[expose] def translated (A : Space →ᵇ V) (a : Space) : Space →ᵇ V := A.compContinuous ⟨fun x => x+a, continuous_id.add continuous_const⟩ @[simp] theorem translated_apply (A : Space →ᵇ V) (a x : Space) : - translated A a x = A (x+a) := rfl + translated A a x = A (x+a) := by rfl @[simp] theorem translated_zero (A : Space →ᵇ V) : translated A 0 = A := by ext x @@ -51,21 +51,21 @@ variable [NormedSpace ℝ V] /-- Bounded derivative, given by `BoundedContinuousFunction.ofNormedAddCommGroup (fderiv ℝ (A : Space → V)) (hA.fderiv_right (m := ∞) (by simp)).continuous C hC`. -/ -def boundedDerivative (A : Space →ᵇ V) (hA : ContDiff ℝ ∞ (A : Space → V)) +@[expose] def boundedDerivative (A : Space →ᵇ V) (hA : ContDiff ℝ ∞ (A : Space → V)) (C : ℝ) (hC : ∀ x, ‖fderiv ℝ (A : Space → V) x‖ ≤ C) : Space →ᵇ (Space →L[ℝ] V) := BoundedContinuousFunction.ofNormedAddCommGroup (fderiv ℝ (A : Space → V)) (hA.fderiv_right (m := ∞) (by simp)).continuous C hC /-- Field direction, constructed using `BoundedContinuousFunction.ofNormedAddCommGroup`. -/ -def fieldDirection (DA : Space →ᵇ (Space →L[ℝ] V)) (a : Space) : Space →ᵇ V := +@[expose] def fieldDirection (DA : Space →ᵇ (Space →L[ℝ] V)) (a : Space) : Space →ᵇ V := BoundedContinuousFunction.ofNormedAddCommGroup (fun x => DA x a) (DA.continuous.clm_apply continuous_const) (‖DA‖ * ‖a‖) (fun x => (DA x).le_opNorm a |>.trans (mul_le_mul_of_nonneg_right (DA.norm_coe_le_norm x) (norm_nonneg a))) @[simp] theorem fieldDirection_apply (DA : Space →ᵇ (Space →L[ℝ] V)) (a x : Space) : - fieldDirection DA a x = DA x a := rfl + fieldDirection DA a x = DA x a := by rfl theorem fieldDirection_norm_le (DA : Space →ᵇ (Space →L[ℝ] V)) (a : Space) : ‖fieldDirection DA a‖ ≤ ‖DA‖ * ‖a‖ := @@ -75,19 +75,21 @@ theorem fieldDirection_norm_le (DA : Space →ᵇ (Space →L[ℝ] V)) (a : Spac (mul_le_mul_of_nonneg_right (DA.norm_coe_le_norm x) (norm_nonneg a))) /-- Field derivative linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def fieldDerivativeLinear (DA : Space →ᵇ (Space →L[ℝ] V)) : Space →ₗ[ℝ] (Space →ᵇ V) where +@[expose] def fieldDerivativeLinear (DA : Space →ᵇ (Space →L[ℝ] V)) : + Space →ₗ[ℝ] (Space →ᵇ V) where toFun := fieldDirection DA map_add' a b := by ext x; exact (DA x).map_add a b map_smul' c a := by ext x; exact (DA x).map_smul c a /-- Field derivative map, bundling `toLinearMap`, `cont`. -/ -def fieldDerivativeMap (DA : Space →ᵇ (Space →L[ℝ] V)) : Space →L[ℝ] (Space →ᵇ V) where +@[expose] def fieldDerivativeMap (DA : Space →ᵇ (Space →L[ℝ] V)) : + Space →L[ℝ] (Space →ᵇ V) where toLinearMap := fieldDerivativeLinear DA cont := AddMonoidHomClass.continuous_of_bound (fieldDerivativeLinear DA) ‖DA‖ (fieldDirection_norm_le DA) @[simp] theorem fieldDerivativeMap_apply (DA : Space →ᵇ (Space →L[ℝ] V)) (a x : Space) : - fieldDerivativeMap DA a x = DA x a := rfl + fieldDerivativeMap DA a x = DA x a := by rfl theorem translated_taylor_bound (A : Space →ᵇ V) (DA : Space →ᵇ (Space →L[ℝ] V)) (hA : ContDiff ℝ ∞ (A : Space → V)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientTime.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientTime.lean index 1c7ccd4500..f5f92f71c2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoefficientTime.lean @@ -18,7 +18,7 @@ of their L² multiplication operators. The bridge is proved by evaluating the Bochner fundamental theorem of calculus, not by assuming operator derivatives. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ local instance instMeanCoefficientTime4 : NormedSpace ℝ (L2 →L[ℝ] L2) := i /-- Operator path, given by `⟨fun t => multiplierMap (A t), multiplierMap.continuous.comp A.continuous⟩`. -/ -def operatorPath (T : ℝ) (A : C(Icc (0 : ℝ) T, Field)) : +@[expose] def operatorPath (T : ℝ) (A : C(Icc (0 : ℝ) T, Field)) : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2) := ⟨fun t => multiplierMap (A t), multiplierMap.continuous.comp A.continuous⟩ @@ -118,12 +118,14 @@ theorem operatorPath_inverse (T : ℝ) (A B : C(Icc (0 : ℝ) T, Field)) (hAB : ∀ t x v, A t x (B t x v) = v) : ∀ t (u : L2), operatorPath T A t (operatorPath T B t u) = u := by intro t u - exact multiplier_inverse (A t) (B t) (hAB t) u + simpa only [operatorPath, ContinuousMap.coe_mk, multiplierMap_apply] using + multiplier_inverse (A t) (B t) (hAB t) u theorem operatorPath_quadratic_upper (T : ℝ) (A : C(Icc (0 : ℝ) T, Field)) (K : ℝ) (hA : ∀ t x v, ⟪A t x v, v⟫_ℝ ≤ K * ‖v‖ ^ 2) : ∀ t (u : L2), ⟪operatorPath T A t u, u⟫_ℝ ≤ K * ‖u‖^2 := by intro t u - exact multiplier_quadratic_upper (A t) K (hA t) u + simpa only [operatorPath, ContinuousMap.coe_mk, multiplierMap_apply] using + multiplier_quadratic_upper (A t) K (hA t) u end EulerMeanCoefficients diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanConcreteTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanConcreteTranslation.lean index 0ca7a470d7..8b93d90ebc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanConcreteTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanConcreteTranslation.lean @@ -21,7 +21,7 @@ operator. These identities connect the fixed inverse to spatial coefficient calculus. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousAcceleration.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousAcceleration.lean index 799a6760f1..9fd56684eb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousAcceleration.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousAcceleration.lean @@ -23,7 +23,7 @@ of its data. This identifies the parameterized continuous solve with the genuine spatial orbit of the acceleration, including endpoint times. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ variable (T : ℝ) (F F₁ : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) (v : C(Icc (0 : ℝ) T, solenoidalSpace)) (f : C(Icc (0 : ℝ) T, L2)) /-- The continuous mean acceleration constructed at each actual time. -/ -def meanAccelerationPath : C(Icc (0 : ℝ) T,solenoidalSpace) := +@[expose] def meanAccelerationPath : C(Icc (0 : ℝ) T,solenoidalSpace) := accelerationPath T (solenoidalFrame T F) (solenoidalFrame T F₁) c hc hLower v f /-- The genuine spatial orbit equals the actual solve with translated data. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPhysical.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPhysical.lean index 11afe2de72..ed686588d5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPhysical.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPhysical.lean @@ -27,7 +27,7 @@ products, so its smoothness and bounds follow without a new regularity assumption on the solution. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPressure.lean index 18faecfeb8..b6b2d083a3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousPressure.lean @@ -38,7 +38,7 @@ identity constructs an AC representative of `Pσ F* η_t`. This is a regularity conclusion, not an assumed momentum equation or an assumed second derivative. -/ -@[expose] public section +public section noncomputable section @@ -157,7 +157,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousVelocity.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousVelocity.lean index ef9638f551..ff5932f243 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousVelocity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanContinuousVelocity.lean @@ -17,7 +17,7 @@ L² time derivative. Terminal-primitive uniqueness identifies this path with the physical velocity already constructed by the strong mean inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCoordinatePath.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCoordinatePath.lean index 507a24b006..dbe4cd88ae 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCoordinatePath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCoordinatePath.lean @@ -19,7 +19,7 @@ acceleration. Consequently its uniform-time spatial derivatives have the same fixed H¹ trace bound as the physical velocity. -/ -@[expose] public section +public section noncomputable section @@ -31,13 +31,13 @@ open Set ContinuousLinearMap EulerSmoothLimit EulerMeanSolenoidal EulerMeanTimeT open scoped ContDiff /-- Spatial translation of continuous solenoidal coordinate paths. -/ -def coordinatePathTranslation (T : ℝ) (a : Space) : +@[expose] def coordinatePathTranslation (T : ℝ) (a : Space) : C(Icc (0 : ℝ) T,solenoidalSpace) →L[ℝ] C(Icc (0 : ℝ) T,solenoidalSpace) := (solenoidalTranslation a).toContinuousLinearMap.compLeftContinuous ℝ (Icc (0 : ℝ) T) @[simp] theorem coordinatePathTranslation_apply (T : ℝ) (a : Space) (p : C(Icc (0 : ℝ) T, solenoidalSpace)) (t : Icc (0 : ℝ) T) : - coordinatePathTranslation T a p t = solenoidalTranslation a (p t) := rfl + coordinatePathTranslation T a p t = solenoidalTranslation a (p t) := by rfl theorem reconstruction_translation (T : ℝ) (hT : 0 ≤ T) (a : Space) (p q : TimeLp T solenoidalSpace) : @@ -64,8 +64,9 @@ theorem coordinateVelocityPath_eq_reconstruction (hTpos : 0 < T) : s.coordinateVelocityPath = reconstruction T hT (s.velocityLp,s.acceleration) := by apply ContinuousMap.ext intro t - exact (reconstruction_eq_path T hTpos s.velocityLp s.acceleration s.velocity - s.velocity_ac s.velocity_ae s.velocity_derivative t).symm + simpa only [coordinateVelocityPath_apply] using + (reconstruction_eq_path T hTpos s.velocityLp s.acceleration s.velocity + s.velocity_ac s.velocity_ae s.velocity_derivative t).symm theorem coordinateVelocityPath_orbit_eq (hTpos : 0 < T) : (fun a : Space => coordinatePathTranslation T a s.coordinateVelocityPath) = diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean index 54f4abd576..cc5e818d8c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean @@ -17,7 +17,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! A genuine ordinary-space cutoff-curl dual estimate. All spatial norms and integrals in this file use Lebesgue measure on Euclidean three-space. -/ -@[expose] public section +public section noncomputable section @@ -28,10 +28,11 @@ open MeasureTheory EulerSmoothLimit EulerVectorCalculus open scoped ContDiff ENNReal NNReal /-- Curl of a vector-valued field, using the existing coordinate curl. -/ -def vectorCurl (f : Space → Space) : Space → Space := +@[expose] def vectorCurl (f : Space → Space) : Space → Space := curl (fun i x => f x i) /-- The fixed homogeneous Sobolev constant for dimension three and exponent two. -/ +@[expose] def sobolevConstant : ℝ≥0 := eLpNormLESNormFDerivOfEqInnerConst (volume : Measure Space) 2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean index 5e215dd5ef..b3edebacf5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean @@ -14,7 +14,7 @@ section /-! Exact spatial difference-quotient commutators with the actual mixed boundary operator. -/ -@[expose] public section +public section noncomputable section @@ -46,18 +46,18 @@ theorem cutoffBound_translate (χ : Cutoff) (a : Space) : lpNorm_translated (gradient χ.field) (contDiff_gradient χ.smooth).continuous] /-- The genuine directional spatial difference quotient, defined also at h = 0. -/ -def spatialDifference (a : Space) (h : ℝ) : L2 →L[ℝ] L2 := +@[expose] def spatialDifference (a : Space) (h : ℝ) : L2 →L[ℝ] L2 := h⁻¹ • ((translation (h • a)).toContinuousLinearMap - ContinuousLinearMap.id ℝ L2) theorem spatialDifference_apply (a : Space) (h : ℝ) (z : L2) : - spatialDifference a h z = h⁻¹ • (translation (h • a) z - z) := rfl + spatialDifference a h z = h⁻¹ • (translation (h • a) z - z) := by rfl /-- Difference quotient, given by `((χ.translate (h • a)).sub χ).scale h⁻¹`. -/ -def Cutoff.differenceQuotient (χ : Cutoff) (a : Space) (h : ℝ) : Cutoff := +@[expose] def Cutoff.differenceQuotient (χ : Cutoff) (a : Space) (h : ℝ) : Cutoff := ((χ.translate (h • a)).sub χ).scale h⁻¹ theorem Cutoff.differenceQuotient_field (χ : Cutoff) (a : Space) (h : ℝ) (x : Space) : - (χ.differenceQuotient a h).field x = h⁻¹ * (χ.field (x + h • a) - χ.field x) := rfl + (χ.differenceQuotient a h).field x = h⁻¹ * (χ.field (x + h • a) - χ.field x) := by rfl theorem spatialDifference_commutator (a : Space) (h : ℝ) (A : L2 →L[ℝ] L2) : (spatialDifference a h).comp A - A.comp (spatialDifference a h) = @@ -128,7 +128,7 @@ end end -@[expose] public section +public section noncomputable section @@ -223,7 +223,7 @@ theorem differenceQuotient_support (χ : Cutoff) (R : ℝ) /-- Cutoff difference constant, given by `3 * cutoffCurlConstant * (M₁ + M₂ * (volume (Metric.closedBall (0 : Space) (R+1))).toReal ^ (1/3 : ℝ))`. -/ -def cutoffDifferenceConstant (R M₁ M₂ : ℝ) : ℝ := +@[expose] def cutoffDifferenceConstant (R M₁ M₂ : ℝ) : ℝ := 3 * cutoffCurlConstant * (M₁ + M₂ * (volume (Metric.closedBall (0 : Space) (R+1))).toReal ^ (1/3 : ℝ)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffTaylor.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffTaylor.lean index 17b1f45937..1dd9eb496a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffTaylor.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffTaylor.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Symmetric /-! Uniform Taylor remainders for the actual smooth compact cutoffs. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ theorem norm_differenceQuotient_remainder_le {E : Type*} [NormedAddCommGroup E] /-- Directional, given by `⟨fun x => fderiv ℝ χ.field x a, (χ.smooth.fderiv_right (m := ∞) (by simp)).clm_apply contDiff_const, χ.compact.fderiv_apply ℝ a⟩`. -/ -def Cutoff.directional (χ : Cutoff) (a : Space) : Cutoff := +@[expose] def Cutoff.directional (χ : Cutoff) (a : Space) : Cutoff := ⟨fun x => fderiv ℝ χ.field x a, (χ.smooth.fderiv_right (m := ∞) (by simp)).clm_apply contDiff_const, χ.compact.fderiv_apply ℝ a⟩ @@ -128,7 +128,7 @@ theorem cutoffBound_le_of_support (χ : Cutoff) (R M₀ M₁ : ℝ) (mul_nonneg (by norm_num) cutoffCurlConstant_pos.le) /-- Difference error, given by `(χ.differenceQuotient a h).sub (χ.directional a)`. -/ -def Cutoff.differenceError (χ : Cutoff) (a : Space) (h : ℝ) : Cutoff := +@[expose] def Cutoff.differenceError (χ : Cutoff) (a : Space) (h : ℝ) : Cutoff := (χ.differenceQuotient a h).sub (χ.directional a) theorem Cutoff.differenceError_support (χ : Cutoff) (R : ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCylinderSolenoidal.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCylinderSolenoidal.lean index 26e43f8fad..98cf3d7184 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCylinderSolenoidal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCylinderSolenoidal.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanClassicalConstraints /-! A genuine smooth ordinary solenoidal L² field remains solenoidal on the periodic cylinder. -/ -@[expose] public section +public section noncomputable section @@ -58,7 +58,7 @@ theorem embedding_representative (u : L2) (f : Space → Space) filter_upwards [lift_ae P u, (Measure.quasiMeasurePreserving_fst (μ := (volume : Measure Space)) (ν := (volume : Measure (AddCircle P)))).ae hrep] with z hl hr - exact hl.trans hr + simpa only [embedding_apply] using hl.trans hr /-- The conclusion is membership in the actual closed lifted-gradient orthogonal complement. -/ theorem embedding_mem (κ : ℝ) (m : Space) (u : L2) (hu : u ∈ solenoidalSpace) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanDisplacementRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanDisplacementRegularity.lean index be3fb0a7b2..a2849e922c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanDisplacementRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanDisplacementRegularity.lean @@ -18,7 +18,7 @@ label path, with a constructed Bochner L² derivative. Conversely, each genuine solenoidal terminal primitive yields an admissible physical test through F. -/ -@[expose] public section +public section noncomputable section @@ -46,7 +46,8 @@ def labelPath (u : meanDerivatives T hT FInv) : ℝ → L2 := theorem labelPath_solenoidal (u : meanDerivatives T hT FInv) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) T) : labelPath T hT FInv u t ∈ solenoidalSpace := by change FInv (projIcc 0 T hT t) (realPrimitive T (u : TimeLp T L2) t) ∈ solenoidalSpace - simpa only [projIcc_of_mem hT ht, terminalPrimitive_apply] using u.property ⟨t, ht⟩ + simpa only [projIcc_of_mem hT ht, terminalPrimitive_apply] using + ((mem_meanDerivatives T hT FInv (u : TimeLp T L2)).mp u.property) ⟨t, ht⟩ variable (hFInv : ∀ t : Icc (0 : ℝ) T, HasDerivWithinAt (extendPath T hT FInv) (FInv' t) (Icc (0 : ℝ) T) t) @@ -109,7 +110,7 @@ theorem labelDerivative_norm_sq_le (u : meanDerivatives T hT FInv) : variable (F F' : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) /-- Restrict the physical deformation to actual solenoidal label fields. -/ -def solenoidalFrame : C(Icc (0 : ℝ) T, solenoidalSpace →L[ℝ] L2) := +@[expose] def solenoidalFrame : C(Icc (0 : ℝ) T, solenoidalSpace →L[ℝ] L2) := ⟨fun t => (F t).comp solenoidalSpace.subtypeL, F.continuous.clm_comp continuous_const⟩ @@ -136,6 +137,7 @@ include hF hInv in theorem productDerivative_mem_mean (v : TimeLp T solenoidalSpace) : productDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F') v ∈ meanDerivatives T hT FInv := by + rw [mem_meanDerivatives] intro t rw [terminalPrimitive_productDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F') (solenoidalFrame_hasDerivWithinAt T hT F F' hF) v t] @@ -144,14 +146,14 @@ theorem productDerivative_mem_mean (v : TimeLp T solenoidalSpace) : exact (terminalPrimitive T hT v t).property /-- A genuine bounded map from solenoidal label derivatives to admissible mean tests. -/ -def meanTestMap : TimeLp T solenoidalSpace →L[ℝ] meanDerivatives T hT FInv := +@[expose] def meanTestMap : TimeLp T solenoidalSpace →L[ℝ] meanDerivatives T hT FInv := (productDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F')).codRestrict (meanDerivatives T hT FInv) (productDerivative_mem_mean T hT FInv F F' hF hInv) /-- The test derivative is the actual product-rule L² field. -/ @[simp] theorem meanTestMap_coe (v : TimeLp T solenoidalSpace) : (meanTestMap T hT FInv F F' hF hInv v : TimeLp T L2) = - productDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F') v := rfl + productDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F') v := by rfl /-- Its displacement primitive is the actual physical test `F b`. -/ theorem meanTestMap_primitive (v : TimeLp T solenoidalSpace) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientGevrey.lean index f9f640734a..d1468943b9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientGevrey.lean @@ -36,7 +36,7 @@ primitive does. The estimates keep the coefficient amplitudes outside the factorial radius. -/ -@[expose] public section +public section noncomputable section @@ -173,7 +173,7 @@ end end -@[expose] public section +public section noncomputable section @@ -254,10 +254,11 @@ variable {P : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] theorem solenoidalFrame_bound (hF : ContDiff ℝ ∞ F) (r C : ℝ) (hr : 0 ≤ r) (hC : 0 ≤ C) (d : ℕ) (hb : ∀ n x, ‖iteratedFDeriv ℝ n F x‖ ≤ C * majorant r d n) (n : ℕ) (x : P) : - ‖iteratedFDeriv ℝ n (fun p => solenoidalFrame T (F p)) x‖ ≤ C*majorant r d n := - contraction_bound (P := P) (E := C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) - (F := C(Icc (0 : ℝ) T, solenoidalSpace →L[ℝ] L2)) - (framePathRestriction T) (framePathRestriction_norm T) F hF r C hr hC d hb n x + ‖iteratedFDeriv ℝ n (fun p => solenoidalFrame T (F p)) x‖ ≤ C*majorant r d n := by + simpa only [framePathRestriction_apply] using + contraction_bound (P := P) (E := C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) + (F := C(Icc (0 : ℝ) T, solenoidalSpace →L[ℝ] L2)) + (framePathRestriction T) (framePathRestriction_norm T) F hF r C hr hC d hb n x /-- The genuine fixed derivative map has only polynomial time cost. -/ theorem fixedMeanDerivative_bound (hF : ContDiff ℝ ∞ F) (hF₁ : ContDiff ℝ ∞ F₁) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientRegularity.lean index 40ae1851a6..b87c32b298 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedCoefficientRegularity.lean @@ -19,7 +19,7 @@ linear map. The actual time multipliers, H¹ transport, trace, and full mean form therefore inherit parameter regularity from the coefficient paths. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ def framePathRestriction (T : ℝ) : frameRestriction.compLeftContinuous ℝ (Icc (0 : ℝ) T) @[simp] theorem framePathRestriction_apply (T : ℝ) (F : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) : - framePathRestriction T F = solenoidalFrame T F := rfl + framePathRestriction T F = solenoidalFrame T F := by rfl /-- Solenoidal frame restriction is a norm contraction. -/ theorem framePathRestriction_norm (T : ℝ) : ‖framePathRestriction T‖ ≤ 1 := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedFrameTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedFrameTransport.lean index 4edd6ce7af..228808532d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedFrameTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedFrameTransport.lean @@ -19,7 +19,7 @@ These maps are proved inverse, so no parameter-dependent test space is hidden when comparing translated or differentiated coefficients. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedSpaceInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedSpaceInverse.lean index b9a433fe91..9aac0430fe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedSpaceInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedSpaceInverse.lean @@ -18,7 +18,7 @@ coercive inverse is constructed and identified with the original mean solve, so coefficient comparisons can use a common domain without assuming an inverse. -/ -@[expose] public section +public section noncomputable section @@ -80,19 +80,19 @@ variable (T : ℝ) (hT : 0 ≤ T) (F F₁ H : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) (M0 A : L2 →L[ℝ] L2) (L : ℝ) /-- Actual physical derivative on the fixed solenoidal coordinate space. -/ -def fixedMeanDerivative : TimeLp T solenoidalSpace →L[ℝ] TimeLp T L2 := +@[expose] def fixedMeanDerivative : TimeLp T solenoidalSpace →L[ℝ] TimeLp T L2 := productDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F₁) /-- Actual physical displacement on the fixed coordinate space. -/ -def fixedMeanPrimitive : TimeLp T solenoidalSpace →L[ℝ] TimeLp T L2 := +@[expose] def fixedMeanPrimitive : TimeLp T solenoidalSpace →L[ℝ] TimeLp T L2 := (primitiveTimeLp T hT).comp (fixedMeanDerivative T hT F F₁) /-- Actual physical initial trace on the fixed coordinate space. -/ -def fixedMeanTrace : TimeLp T solenoidalSpace →L[ℝ] L2 := +@[expose] def fixedMeanTrace : TimeLp T solenoidalSpace →L[ℝ] L2 := (initialTrace T hT).comp (fixedMeanDerivative T hT F F₁) /-- The full original mean form as an operator on one fixed Hilbert space. -/ -def fixedMeanOperator : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def fixedMeanOperator : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := transportedOperator (fixedMeanDerivative T hT F F₁) (meanOperator (primitiveTimeLp T hT) (initialTrace T hT) (timeMultiplier T hT H) (M0+L • A)) @@ -159,14 +159,14 @@ theorem fixedMeanOperator_coercive (v : TimeLp T solenoidalSpace) : hp.trans_eq (fixedMeanOperator_inner T hT F F₁ H M0 A L v v).symm /-- The actual fixed-space inverse operator. -/ -def fixedMeanInverse : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def fixedMeanInverse : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := coerciveInverse (fixedMeanOperator T hT F F₁ H M0 A L) (fixedMeanCoercivity T F F₁ FInv) (fixedMeanCoercivity_pos T hT F F₁ FInv) (fixedMeanOperator_coercive T hT F F₁ H M0 A L FInv hInv hF K B hK hB hFInv₀ hH hboundary hsmall) /-- The actual forcing-to-coordinate-derivative map on the fixed space. -/ -def fixedMeanSolver : TimeLp T L2 →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def fixedMeanSolver : TimeLp T L2 →L[ℝ] TimeLp T solenoidalSpace := (fixedMeanInverse T hT F F₁ H M0 A L FInv hInv hF K B hK hB hFInv₀ hH hboundary hsmall).comp (-(fixedMeanPrimitive T hT F F₁).adjoint) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedTranslation.lean index 3ebc1d2f03..c7a2a9f582 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanFixedTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanFixedTranslation.lean @@ -17,7 +17,7 @@ ordinary spatial translation. Consequently its coercivity persists with the same constant throughout the translated coefficient family. -/ -@[expose] public section +public section noncomputable section @@ -56,12 +56,12 @@ variable (T : ℝ) (hT : 0 ≤ T) (a : Space) (F F₁ H : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) (M0 A : L2 →L[ℝ] L2) (L : ℝ) /-- The fixed mean operator with genuinely translated spatial coefficients. -/ -def translatedMeanOperator : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := +@[expose] def translatedMeanOperator : TimeLp T solenoidalSpace →L[ℝ] TimeLp T solenoidalSpace := fixedMeanOperator T hT (translatePath T a F) (translatePath T a F₁) (translatePath T a H) (translateOperator a M0) (translateOperator a A) L /-- The physical primitive map with genuinely translated coefficients. -/ -def translatedMeanPrimitive : TimeLp T solenoidalSpace →L[ℝ] TimeLp T L2 := +@[expose] def translatedMeanPrimitive : TimeLp T solenoidalSpace →L[ℝ] TimeLp T L2 := fixedMeanPrimitive T hT (translatePath T a F) (translatePath T a F₁) /-- Covariance of the actual physical derivative. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanFrameCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanFrameCoefficients.lean index cba97642cd..e79d8cdcc3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanFrameCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanFrameCoefficients.lean @@ -16,7 +16,7 @@ on the ordinary infinite-dimensional solenoidal Hilbert space. The actual mean constraint supplies the range property needed to reconstruct coordinates. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (FInv F : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) /-- A concrete positive Gram lower-bound constant from the actual inverse path. -/ -def meanFrameCoercivity : ℝ := ((‖FInv‖+1)^2)⁻¹ +@[expose] def meanFrameCoercivity : ℝ := ((‖FInv‖+1)^2)⁻¹ theorem meanFrameCoercivity_pos : 0 < meanFrameCoercivity T FInv := by unfold meanFrameCoercivity @@ -64,7 +64,8 @@ theorem meanPrimitive_in_frame_range (u : meanDerivatives T hT FInv) (t : Icc (0 : ℝ) T) : ∃ z : solenoidalSpace, solenoidalFrame T F t z = realPrimitive T (u : TimeLp T L2) t := by have hz : FInv t (realPrimitive T (u : TimeLp T L2) t) ∈ solenoidalSpace := by - simpa only [terminalPrimitive_apply] using u.property t + simpa only [terminalPrimitive_apply] using + ((mem_meanDerivatives T hT FInv (u : TimeLp T L2)).mp u.property t) refine ⟨⟨FInv t (realPrimitive T (u : TimeLp T L2) t), hz⟩, ?_⟩ exact hRight t _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean index 2f613fb3fb..d4aaf9b25e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! The actual homogeneous first-order test space on ordinary Euclidean three-space. -/ -@[expose] public section +public section noncomputable section @@ -23,7 +23,7 @@ open MeasureTheory EulerSmoothLimit EulerMeanSolenoidal open scoped ContDiff ENNReal NNReal /-- Smooth compactly supported vector fields, as a genuine function submodule. -/ -def testSpace : Submodule ℝ (Space → Space) where +@[expose] def testSpace : Submodule ℝ (Space → Space) where carrier := {f | ContDiff ℝ ∞ f ∧ HasCompactSupport f} zero_mem' := ⟨contDiff_const, by change IsCompact (tsupport (0 : Space → Space)) @@ -87,7 +87,7 @@ def testGradient : Test →ₗ[ℝ] GradientTensor where map_smul' c f := by ext i : 1; exact derivativeColumn_smul c f i theorem testGradient_apply (f : Test) (i : Fin 3) : - testGradient f i = derivativeColumn f i := rfl + testGradient f i = derivativeColumn f i := by rfl /-- The operator norm is bounded by the sum of the Euclidean derivative-column norms. -/ theorem opNorm_le_sum_columns (A : Space →L[ℝ] Space) : @@ -134,13 +134,13 @@ theorem lpNorm_fderiv_le_gradient (f : Test) : _ = 3 * ‖testGradient f‖ := by simp /-- Homogeneous H¹ is the closed subspace generated by actual compact test gradients. -/ -def homogeneousSpace : Submodule ℝ GradientTensor := testGradient.range.topologicalClosure +@[expose] def homogeneousSpace : Submodule ℝ GradientTensor := testGradient.range.topologicalClosure instance : CompleteSpace homogeneousSpace := testGradient.range.isClosed_topologicalClosure.completeSpace_coe /-- The dense map from genuine tests into the homogeneous Hilbert space. -/ -def homogeneousGradient : Test →ₗ[ℝ] homogeneousSpace := +@[expose] def homogeneousGradient : Test →ₗ[ℝ] homogeneousSpace := testGradient.codRestrict homogeneousSpace (fun f => testGradient.range.le_topologicalClosure (LinearMap.mem_range_self _ f)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanGramTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanGramTranslation.lean index 082e846514..139eeda370 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanGramTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanGramTranslation.lean @@ -22,7 +22,7 @@ is the spatial orbit of the original acceleration. The final identification uses the already proved strong equation of the actual variational solution. -/ -@[expose] public section +public section noncomputable section @@ -123,7 +123,7 @@ theorem gramSolver_translate (a : Space) exact hl.trans hr.symm /-- The genuine fixed-coordinate acceleration recovered from velocity and forcing. -/ -def meanAcceleration (F F₁ : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) +@[expose] def meanAcceleration (F F₁ : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) (c : ℝ) (hc : 0 < c) (hF : ∀ t v, c * ‖v‖ ^ 2 ≤ ‖solenoidalFrame T F t v‖ ^ 2) (v : TimeLp T solenoidalSpace) (f : TimeLp T L2) : TimeLp T solenoidalSpace := gramSolver T hT (solenoidalFrame T F) c hc hF diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicComponents.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicComponents.lean index c56b57a382..dca1464efa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicComponents.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicComponents.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Scalar test functions and component energies for actual R³ vector fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicCutoffEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicCutoffEnergy.lean index d510789d2f..38cd2eee45 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicCutoffEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicCutoffEnergy.lean @@ -18,7 +18,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Quantitative cutoff energy estimates used in the three-dimensional interior bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDecomposition.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDecomposition.lean index 765c6f9c13..5e80fb2633 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDecomposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDecomposition.lean @@ -22,7 +22,7 @@ section /-! The ordinary curl as a bounded antisymmetrization of actual L² gradient tensors. -/ -@[expose] public section +public section noncomputable section @@ -109,6 +109,7 @@ theorem curlTensor_test_ae (f : Test) : ae_all_iff.mpr (fun i => derivativeColumn_ae f i)] with x hc hd rw [hc, vectorCurl_eq_matrix _ x ((f.smooth.differentiable (by simp)).differentiableAt)] ext i + simp only [testGradient_apply] change (derivativeColumn f (i+1) x) (i+2) - (derivativeColumn f (i+2) x) (i+1) = _ rw [hd, hd] rfl @@ -128,7 +129,7 @@ end end -@[expose] public section +public section noncomputable section @@ -317,7 +318,7 @@ end end -@[expose] public section +public section noncomputable section @@ -329,7 +330,7 @@ open MeasureTheory InnerProductSpace Laplacian EulerSmoothLimit EulerVectorCalcu open scoped ContDiff /-- Distributional harmonicity of an actual ordinary L² vector field on a set. -/ -def WeakHarmonicOn (U : Set Space) (u : EulerMeanSolenoidal.L2) : Prop := +@[expose] def WeakHarmonicOn (U : Set Space) (u : EulerMeanSolenoidal.L2) : Prop := ∀ φ : Space → Space, HasCompactSupport φ → ContDiff ℝ ∞ φ → tsupport φ ⊆ U → (∫ x, ⟪u x, Δ φ x⟫_ℝ) = 0 diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDerivatives.lean index 4c50905ee6..572a8aca09 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicDerivatives.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Harmonicity of actual coordinate derivatives on an open subset of R³. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ theorem partialDerivative_harmonic_on (f : Space → ℝ) (hf : ContDiff ℝ ∞ simp /-- Word derivative as an element of `word, f => partialDerivative (wordDerivative word f) i`. -/ -def wordDerivative : List (Fin 3) → (Space → ℝ) → Space → ℝ +@[expose] def wordDerivative : List (Fin 3) → (Space → ℝ) → Space → ℝ | [], f => f | i :: word, f => partialDerivative (wordDerivative word f) i diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicEnergy.lean index a0c71515c5..aae1ead46c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicEnergy.lean @@ -22,7 +22,7 @@ identity, proved by ordinary-space integration by parts. No interior estimate or mean-value formula is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicInterior.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicInterior.lean index 4a765229c1..b97f08eed2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicInterior.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicInterior.lean @@ -37,7 +37,7 @@ section /-! Actual nested smooth cutoffs, with finite derivative bounds independent of the field. -/ -@[expose] public section +public section noncomputable section @@ -160,7 +160,7 @@ section /-! Two local energy steps for smooth harmonic functions on the unit ball. -/ -@[expose] public section +public section noncomputable section @@ -247,7 +247,7 @@ end end -@[expose] public section +public section noncomputable section @@ -359,7 +359,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicLaplacian.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicLaplacian.lean index 5b1dd66812..07bd2a17de 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicLaplacian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicLaplacian.lean @@ -18,7 +18,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Canonical Laplacian and the quantitative local harmonic energy bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicScaling.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicScaling.lean index d7093547d8..30eb08f5a2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicScaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicScaling.lean @@ -13,7 +13,7 @@ import Mathlib.MeasureTheory.Measure.Haar.NormedSpace /-! Scaling the actual Laplacian and harmonic interior estimates on R³. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicSmallBall.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicSmallBall.lean index 15ae867101..3aed15b840 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicSmallBall.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanHarmonicSmallBall.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls /-! A dimensional r³ localization estimate, derived from the interior bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanL2Scaling.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanL2Scaling.lean index 94142e439a..fc501c4465 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanL2Scaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanL2Scaling.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Measure.Haar.NormedSpace /-! Actual dilation identities for L² fields and weak harmonic scalar functions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean index d71cdc4fa8..731140c86e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! Local energies of actual L² fields, including the decomposition estimate. -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ namespace EulerMeanHarmonic open MeasureTheory InnerProductSpace EulerSmoothLimit EulerMeanSolenoidal /-- Local L² energy, given by `∫ x in s, ‖u x‖ ^ 2`. -/ -def localL2Energy (s : Set Space) (u : L2) : ℝ := ∫ x in s, ‖u x‖ ^ 2 +@[expose] def localL2Energy (s : Set Space) (u : L2) : ℝ := ∫ x in s, ‖u x‖ ^ 2 theorem lpNorm_coe_L2 (u : L2) : lpNorm (u : Space → Space) 2 volume = ‖u‖ := by rw [Lp.norm_def, toReal_eLpNorm] diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanMollifierLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanMollifierLimit.lean index 44b0f9ca3a..0aea168f82 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanMollifierLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanMollifierLimit.lean @@ -23,7 +23,7 @@ section /-! Actual compact mollification on R³ is smooth and contractive on scalar L². -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ open MeasureTheory InnerProductSpace EulerSmoothLimit open scoped ContDiff Convolution /-- Scalar mollification, given by `φ.normed volume ⋆[ContinuousLinearMap.lsmul ℝ ℝ, volume] f`. -/ -def scalarMollification (φ : ContDiffBump (0 : Space)) (f : Space → ℝ) : Space → ℝ := +@[expose] def scalarMollification (φ : ContDiffBump (0 : Space)) (f : Space → ℝ) : Space → ℝ := φ.normed volume ⋆[ContinuousLinearMap.lsmul ℝ ℝ, volume] f theorem scalarMollification_smooth (φ : ContDiffBump (0 : Space)) @@ -121,7 +121,7 @@ end end -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ open MeasureTheory InnerProductSpace Laplacian EulerSmoothLimit EulerNoncompactT open scoped ContDiff Convolution Topology /-- Harmonicity tested against genuine smooth compactly supported scalar functions. -/ -def ScalarWeakHarmonicOn (U : Set Space) (f : Space → ℝ) : Prop := +@[expose] def ScalarWeakHarmonicOn (U : Set Space) (f : Space → ℝ) : Prop := ∀ φ : Space → ℝ, HasCompactSupport φ → ContDiff ℝ ∞ φ → tsupport φ ⊆ U → (∫ x, f x * Δ φ x) = 0 diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanMomentumBoundary.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanMomentumBoundary.lean index 2ad93db700..f24bcfcb16 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanMomentumBoundary.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanMomentumBoundary.lean @@ -18,7 +18,7 @@ an explicit AC momentum representative. Its initial value is the adjoint frame applied to the original `M0 + L A` boundary force. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,8 @@ variable (T : ℝ) (hT : 0 ≤ T) (FInv F F' : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) /-- The original initial boundary force, expressed in the actual solenoidal coordinate space. -/ -def meanBoundaryFlux (M0 A : L2 →L[ℝ] L2) (L : ℝ) (u : meanDerivatives T hT FInv) : +@[expose] def meanBoundaryFlux (M0 A : L2 →L[ℝ] L2) (L : ℝ) + (u : meanDerivatives T hT FInv) : solenoidalSpace := (solenoidalFrame T F ⟨0, le_rfl, hT⟩).adjoint ((M0+L • A) (meanTrace T hT FInv u)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanOperatorTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanOperatorTranslation.lean index ef45778948..68449073f1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanOperatorTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanOperatorTranslation.lean @@ -17,7 +17,7 @@ ordinary L². Its Bochner multiplier and H¹ frame derivative obey exact covariance, including the terminal primitive and initial trace. -/ -@[expose] public section +public section noncomputable section @@ -30,12 +30,12 @@ open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerTimeH1OperatorProduct /-- Literal spatial conjugation of a bounded operator on ordinary L². -/ -def translateOperator (a : Space) (A : L2 →L[ℝ] L2) : L2 →L[ℝ] L2 := +@[expose] def translateOperator (a : Space) (A : L2 →L[ℝ] L2) : L2 →L[ℝ] L2 := (translation a).toContinuousLinearMap.comp (A.comp (translation (-a)).toContinuousLinearMap) @[simp] theorem translateOperator_apply (a : Space) (A : L2 →L[ℝ] L2) (u : L2) : - translateOperator a A u = translation a (A (translation (-a) u)) := rfl + translateOperator a A u = translation a (A (translation (-a) u)) := by rfl /-- Applying the translated coefficient to the translated field is exact covariance. -/ theorem translateOperator_translation (a : Space) (A : L2 →L[ℝ] L2) (u : L2) : @@ -81,14 +81,14 @@ theorem translateOperator_norm (a : Space) (A : L2 →L[ℝ] L2) : simpa only [translateOperator_neg_cancel] using h /-- Translate the spatial operator at every time in the coefficient path. -/ -def translatePath (T : ℝ) (a : Space) (F : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) : +@[expose] def translatePath (T : ℝ) (a : Space) (F : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2) := ⟨fun t => translateOperator a (F t), continuous_const.clm_comp (F.continuous.clm_comp continuous_const)⟩ @[simp] theorem translatePath_apply (T : ℝ) (a : Space) (F : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) (t : Icc (0 : ℝ) T) : - translatePath T a F t = translateOperator a (F t) := rfl + translatePath T a F t = translateOperator a (F t) := by rfl theorem translatePath_norm_le (T : ℝ) (a : Space) (F : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) : ‖translatePath T a F‖ ≤ ‖F‖ := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSmoothL2Field.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSmoothL2Field.lean index 478207842b..889538637b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSmoothL2Field.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSmoothL2Field.lean @@ -21,7 +21,7 @@ coordinate derivatives. A smooth orbit of a continuous-time path supplies continuity of every tensor jet in time. -/ -@[expose] public section +public section noncomputable section @@ -50,13 +50,14 @@ theorem representative_iteratedFDeriv_memLp (u : L2) (hu : SmoothOrbit u) (n : (Lp.memLp (orbitTensorLp u n)).ae_eq (orbitTensorLp_ae u hu n) /-- A smooth translation orbit produces a genuine smooth spatial L² field. -/ -def smoothL2Field (u : L2) (hu : SmoothOrbit u) : EulerLpTranslation.SmoothL2Field Space where +@[expose] def smoothL2Field (u : L2) (hu : SmoothOrbit u) : + EulerLpTranslation.SmoothL2Field Space where field := representative u hu smooth := representative_smooth u hu integrable := representative_iteratedFDeriv_memLp u hu @[simp] theorem smoothL2Field_field (u : L2) (hu : SmoothOrbit u) (x : Space) : - (smoothL2Field u hu).field x = representative u hu x := rfl + (smoothL2Field u hu).field x = representative u hu x := by rfl @[simp] theorem smoothL2Field_toLp (u : L2) (hu : SmoothOrbit u) : (smoothL2Field u hu).toLp = u := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSobolev.lean index a9de188fe6..06a0f226c1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanOrbitSobolev.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Genuine Sobolev arrays and bounded spatial evaluation for ordinary L² translation orbits. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open scoped ContDiff local instance instMeanOrbitSobolev1 : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ /-- Coordinate tuple, defined pointwise by `(standardDirection (w i)).1`. -/ -def coordinateTuple {n : ℕ} (w : Fin n → Fin 4) : Fin n → Space := +@[expose] def coordinateTuple {n : ℕ} (w : Fin n → Fin 4) : Fin n → Space := fun i => (standardDirection (w i)).1 theorem coordinateTuple_norm_le {n : ℕ} (w : Fin n → Fin 4) : ‖coordinateTuple w‖ ≤ 1 := by @@ -95,8 +95,9 @@ theorem ordinarySobolev_coordinate (q : ℕ) (u : EulerMeanSolenoidal.L2) (hu : (w : SobolevWord q) : (ordinarySobolev q u hu).val w = ordinaryLift (iteratedFDeriv ℝ w.1.val (fun a : Space => EulerMeanSolenoidal.translation a u) 0 - (coordinateTuple w.2)) := - ordinarySpatialJet_word w.1.val q (Nat.le_of_lt_succ w.1.isLt) u hu w.2 + (coordinateTuple w.2)) := by + rw [ordinarySobolev, ofJet_apply] + exact ordinarySpatialJet_word w.1.val q (Nat.le_of_lt_succ w.1.isLt) u hu w.2 /-- The finite Sobolev array is bounded directly by actual L² orbit-derivative norms. -/ theorem ordinarySobolev_norm_le (q : ℕ) (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketBudget.lean index c0ff9a6e11..422743330e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketBudget.lean @@ -87,7 +87,7 @@ section /-! Factorial bounds for actual spatial derivatives of the localized Newtonian operator family. -/ -@[expose] public section +public section noncomputable section @@ -249,7 +249,7 @@ end end -@[expose] public section +public section noncomputable section @@ -404,7 +404,7 @@ iterated Fréchet derivatives are estimated. Coefficient and forcing amplitudes enter through explicit polynomials, independently of derivative order. -/ -@[expose] public section +public section noncomputable section @@ -441,7 +441,7 @@ local instance instMeanTranslatedGevrey6 (T : ℝ) : InnerProductSpace ℝ (Time := inferInstance /-- The proved polynomial amplitude for the actual fixed mean operator. -/ -def operatorAmplitude (T CF CF₁ CH CM CA L : ℝ) : ℝ := +@[expose] def operatorAmplitude (T CF CF₁ CH CM CA L : ℝ) : ℝ := 9*(T*CF₁+CF)^2*(1+(T^2/2)*CH+T*(CM+|L| * CA)) /-- The proved polynomial amplitude of the actual forcing pullback. -/ @@ -560,7 +560,7 @@ converted from tensor bounds. Their finite Sobolev cost is paid once, before applying the actual inverse recurrence. -/ -@[expose] public section +public section noncomputable section @@ -599,12 +599,12 @@ local instance instMeanFixedSobolevGevrey6 (T : ℝ) : InnerProductSpace ℝ (Ti := inferInstance /-- Coefficient-only amplitude of the full mean form in a fixed base order. -/ -def operatorBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) +@[expose] def operatorBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (T Rc CF CF₁ CH CM CA L : ℝ) : ℝ := sobolevCoefficientAmplitude ι q Rc (operatorAmplitude T CF CF₁ CH CM CA L) /-- Pulling back the right side is a multiplication in the same Sobolev block. -/ -def forcingBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) +@[expose] def forcingBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (T Rc CF CF₁ Cf : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q Rc (T*(T*CF₁+CF))*Cf @@ -762,7 +762,7 @@ The remaining quantitative inputs are literal spatial derivatives of the given matrix coefficients and the actual translation derivatives of the forcing. -/ -@[expose] public section +public section noncomputable section @@ -905,7 +905,7 @@ L² translation orbits. Taking q=6 gives the fixed-H6 endpoint without spending six additional factorial shifts. All constants are independent of the grade. -/ -@[expose] public section +public section noncomputable section @@ -1008,7 +1008,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1108,7 +1108,7 @@ The actual continuous Gram inverse then controls acceleration and the physical time derivative. All bounds concern genuine spatial derivatives. -/ -@[expose] public section +public section noncomputable section @@ -1117,7 +1117,7 @@ namespace EulerMeanStrongContinuousGevrey open EulerGevrey /-- The fixed H¹ trace cost for unit velocity and acceleration jet amplitudes. -/ -def coordinateTraceCost (T : ℝ) : ℝ := T⁻¹*Real.sqrt T+2*Real.sqrt T +@[expose] def coordinateTraceCost (T : ℝ) : ℝ := T⁻¹*Real.sqrt T+2*Real.sqrt T theorem coordinateTraceCost_nonneg (T : ℝ) (hT : 0 ≤ T) : 0 ≤ coordinateTraceCost T := by unfold coordinateTraceCost @@ -1226,7 +1226,7 @@ section /-! The genuine mean acceleration estimate in fixed-Hq external word blocks. -/ -@[expose] public section +public section noncomputable section @@ -1340,7 +1340,7 @@ of its data. This identifies the parameterized continuous solve with the genuine spatial orbit of the acceleration, including endpoint times. -/ -@[expose] public section +public section noncomputable section @@ -1463,7 +1463,7 @@ result gives the actual continuous physical field at shift d+2 and its true within-time derivative at shift d+3. All use the identical external radius. -/ -@[expose] public section +public section noncomputable section @@ -1593,7 +1593,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1726,7 +1726,7 @@ result gives the actual continuous physical field at shift d+2 and its true within-time derivative at shift d+3. All use the identical external radius. -/ -@[expose] public section +public section noncomputable section @@ -1859,7 +1859,7 @@ boundary cutoff calculus, Gram inversion, and time reconstruction are all proved constructions used by this theorem. -/ -@[expose] public section +public section noncomputable section @@ -1977,7 +1977,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2123,7 +2123,7 @@ coercive inverse. Consequently scalar forcing envelopes remain outside the velocity, time-derivative, and physical-pressure estimates. -/ -@[expose] public section +public section noncomputable section @@ -2245,7 +2245,7 @@ section /-! Zero forcing produces the actual zero velocity, derivative, and pressure force. -/ -@[expose] public section +public section noncomputable section @@ -2288,7 +2288,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2397,7 +2397,7 @@ section /-! Exact parameter restriction and injective subalphabet bounds for genuine derivative words. -/ -@[expose] public section +public section noncomputable section @@ -2461,7 +2461,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2608,7 +2608,7 @@ section /-! A single uniform-time forcing bound suffices for the normalized mean estimates. -/ -@[expose] public section +public section noncomputable section @@ -2659,7 +2659,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketConstraints.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketConstraints.lean index 70cf868348..245c77bb26 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketConstraints.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketConstraints.lean @@ -18,7 +18,7 @@ ordinary solenoidal coordinate velocity. Its divergence therefore vanishes pointwise. The actual initial boundary condition supplies compact support. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketContract.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketContract.lean index 8fa5308ded..6b974acb53 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketContract.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketContract.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanPacketJets /-! The proved raw-field contract of the concrete admissible mean solver. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketCylinderFields.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketCylinderFields.lean index 0a29e05a1e..4acf372e4d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketCylinderFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketCylinderFields.lean @@ -19,7 +19,7 @@ translation orbit, literal raw representative and true time derivative are preserved by the same bounded linear embedding. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketData.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketData.lean index abc89fdda4..2b917f36b7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketData.lean @@ -36,7 +36,7 @@ operator and harmonic localization. No solution, momentum equation, acceleration or initial velocity condition is included in the hypotheses. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ end end -@[expose] public section +public section noncomputable section @@ -146,7 +146,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean index 76391c6545..a6f7a563ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean @@ -42,7 +42,7 @@ section /-! Smooth parameter dependence in actual L² from square-integrable fiberwise jets. -/ -@[expose] public section +public section noncomputable section @@ -154,7 +154,7 @@ section /-! All-order L² parameter regularity with the original square-integrable derivative bounds. -/ -@[expose] public section +public section noncomputable section @@ -228,7 +228,7 @@ end end -@[expose] public section +public section noncomputable section @@ -324,7 +324,7 @@ automatically square integrable. The continuous and Bochner orbit theorems therefore use the same concrete forcing data. -/ -@[expose] public section +public section noncomputable section @@ -361,7 +361,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcingAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcingAlgebra.lean index f58afff5f5..4343a1ce7c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcingAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcingAlgebra.lean @@ -17,7 +17,7 @@ spatial directional derivatives. Every witness consists of literal smooth fields and their continuous L² jets; no inverse or equation is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketJets.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketJets.lean index 6cc7d72ebc..a78b427e55 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketJets.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanPacketProvider /-! The concrete mean inverse in the literal jets used by the packet recursion. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketNonlinearForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketNonlinearForcing.lean index ba81219231..100330845b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketNonlinearForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketNonlinearForcing.lean @@ -24,7 +24,7 @@ section /-! Actual multiplication closure for admissible mean forcing. -/ -@[expose] public section +public section noncomputable section @@ -52,7 +52,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketOrbitForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketOrbitForcing.lean index 8b811ba343..e0c9f0c425 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketOrbitForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketOrbitForcing.lean @@ -17,7 +17,7 @@ orbit produce the literal smooth L² slices required by the forcing interface. The same construction applies to its actual time derivative and pressure force. -/ -@[expose] public section +public section noncomputable section @@ -62,7 +62,7 @@ def vectorDerivativeForcing (G : Forcing D raw) : Forcing D G.vectorDerivative : /-- Pressure force, defined pointwise by `pathRepresentative D.T G.pressureForcePath G.pressureForcePath_orbit (D.clamp z.1) z.2.1`. -/ -def pressureForce (G : Forcing D raw) : VectorField := fun z => +@[expose] def pressureForce (G : Forcing D raw) : VectorField := fun z => pathRepresentative D.T G.pressureForcePath G.pressureForcePath_orbit (D.clamp z.1) z.2.1 /-- The physical pressure gradient, rather than the unneeded scalar pressure value, is spatially L². diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketParity.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketParity.lean index 45c2a166d2..150ff813c0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketParity.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanPacketProvider /-! Odd velocity and even normalized pressure for the actual mean provider. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketPressureForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketPressureForcing.lean index f647cf5330..5cc2068275 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketPressureForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketPressureForcing.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanPacketNonlinearForcing /-! The actual scalar pressure gradient is an admissible smooth L² field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketProvider.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketProvider.lean index 079de2e5a8..5bac8e45c1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketProvider.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketProvider.lean @@ -38,7 +38,7 @@ pointwise physical equation. No scalar potential or pressure time derivative is assumed. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit open scoped ContDiff /-- The canonical smooth spatial representative of an actual continuous L² path. -/ -def pathRepresentative (T : ℝ) (p : C(Icc (0 : ℝ) T, L2)) +@[expose] def pathRepresentative (T : ℝ) (p : C(Icc (0 : ℝ) T, L2)) (hp : ContDiff ℝ ∞ (fun a : Space => pathTranslation T a p)) (t : Icc (0 : ℝ) T) : Space → Space := representative (p t) (pathTranslation_evaluation_contDiff T p hp t) @@ -188,7 +188,7 @@ end end -@[expose] public section +public section noncomputable section @@ -205,13 +205,13 @@ namespace Data /-- A continuous closed-interval retraction, used only to define the raw field outside its domain. -/ -def clamp (D : Data) (t : ℝ) : Icc (0 : ℝ) D.T := projIcc 0 D.T D.T_pos.le t +@[expose] def clamp (D : Data) (t : ℝ) : Icc (0 : ℝ) D.T := projIcc 0 D.T D.T_pos.le t @[simp] theorem clamp_coe (D : Data) (t : Icc (0 : ℝ) D.T) : D.clamp t = t := projIcc_of_mem D.T_pos.le t.property /-- Inverse Frame, given by `D.FInv (D.clamp z.1) z.2.1`. -/ -def inverseFrame (D : Data) (z : Domain) : Space →L[ℝ] Space := +@[expose] def inverseFrame (D : Data) (z : Domain) : Space →L[ℝ] Space := D.FInv (D.clamp z.1) z.2.1 /-- Strain, given by `D.M.field (D.clamp z.1) z.2.1`. -/ @@ -225,15 +225,15 @@ namespace Forcing variable {D : Data} {raw : VectorField} (G : Forcing D raw) /-- Literal velocity returned by the genuine mean inverse. -/ -def vector : VectorField := fun z => +@[expose] def vector : VectorField := fun z => pathRepresentative D.T G.velocityPath G.velocityPath_orbit (D.clamp z.1) z.2.1 /-- Literal continuous time derivative of the velocity on the source interval. -/ -def vectorDerivative : VectorField := fun z => +@[expose] def vectorDerivative : VectorField := fun z => pathRepresentative D.T G.derivativePath G.derivativePath_orbit (D.clamp z.1) z.2.1 /-- The normalized scalar pressure returned by the actual radial construction. -/ -def scalar : ScalarField := fun z => +@[expose] def scalar : ScalarField := fun z => pressureScalar D.T D.T_pos.le D.F D.F₁ D.opInv G.solution D.frameLower D.frameLower_pos D.frame_lower G.path G.pressureForcePath_orbit (D.clamp z.1) z.2.1 diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketReflection.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketReflection.lean index 975af1a2f5..8a3e017b84 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketReflection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketReflection.lean @@ -37,7 +37,7 @@ section /-! Genuine spatial reflection on the mean time Hilbert spaces. -/ -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ end end -@[expose] public section +public section noncomputable section @@ -216,7 +216,7 @@ trace, and nonlocal boundary form. Uniqueness of the actual coercive inverse then transports reflection without an assumed symmetry of a solution. -/ -@[expose] public section +public section noncomputable section @@ -376,7 +376,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPathLpBlocks.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPathLpBlocks.lean index 090e02a24f..dad55b79c7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPathLpBlocks.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPathLpBlocks.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TimeLpMap /-! Uniform-time spatial word bounds imply the genuine Bochner word bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPathSpatialRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPathSpatialRepresentative.lean index 4f3396bc72..8b89714d4c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPathSpatialRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPathSpatialRepresentative.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Jointly continuous ordinary spatial representatives of continuous L² paths with smooth spatial orbits. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPathTimeDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPathTimeDerivative.lean index 0c390287ee..6dd181b7ef 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPathTimeDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPathTimeDerivative.lean @@ -24,7 +24,7 @@ Sobolev arrays transfer the actual time derivative to the smooth spatial representatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPhysicalTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPhysicalTranslation.lean index 6b31fb6aa2..9b6bfbbb47 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPhysicalTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPhysicalTranslation.lean @@ -23,7 +23,7 @@ bounds. These identities apply to the physical velocity, its actual time derivative, and the pressure residual constructed by the strong mean solve. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPointwiseGramTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPointwiseGramTranslation.lean index 3bbcab67bf..55933323a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPointwiseGramTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPointwiseGramTranslation.lean @@ -17,7 +17,7 @@ They identify the continuous acceleration family with translation of the original acceleration, including endpoint time values. -/ -@[expose] public section +public section noncomputable section @@ -84,7 +84,7 @@ theorem gramInverse_translation (a : Space) (F : L2 →L[ℝ] L2) (c : ℝ) (hc (solenoidalTranslation a (gramInverse (F.comp solenoidalSpace.subtypeL) c hc hF g))) /-- The actual one-time acceleration operator from the strong mean equation. -/ -def acceleration (F F₁ : L2 →L[ℝ] L2) (c : ℝ) (hc : 0 < c) +@[expose] def acceleration (F F₁ : L2 →L[ℝ] L2) (c : ℝ) (hc : 0 < c) (hF : ∀ v : solenoidalSpace, c*‖v‖^2 ≤ ‖(F.comp solenoidalSpace.subtypeL) v‖^2) (v : solenoidalSpace) (f : L2) : solenoidalSpace := gramInverse (F.comp solenoidalSpace.subtypeL) c hc hF diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPressurePotential.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPressurePotential.lean index b16867928d..879c9de81b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPressurePotential.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPressurePotential.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanWeakCurl /-! A canonically normalized actual scalar potential for ordinary mean pressure gradients. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanScalarProductDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanScalarProductDerivatives.lean index c93511b9ea..f9c5c41a0f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanScalarProductDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanScalarProductDerivatives.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Scalar coordinate product rules for the localized harmonic estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean index f4f197f5d3..3d60da40e4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! The scalar R³ H² estimate used for harmonic interior control. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanScaledCutoff.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanScaledCutoff.lean index 82f1b20015..f106c3140f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanScaledCutoff.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanScaledCutoff.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! The actual source outer cutoff in rescaled particle labels. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSmoothRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSmoothRepresentative.lean index 130d1e18b0..aee0378a06 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSmoothRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSmoothRepresentative.lean @@ -23,7 +23,7 @@ section /-! An isometric embedding of ordinary R³ L² into the angle-independent part of the unit cylinder. -/ -@[expose] public section +public section noncomputable section @@ -97,7 +97,7 @@ end end -@[expose] public section +public section noncomputable section @@ -166,7 +166,7 @@ theorem ordinaryLift_hasDerivAt (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u exact H /-- Every finite cylinder derivative tree is constructed from genuine ordinary L² derivatives. -/ -def ordinarySpatialJet (s : ℕ) (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u) : +@[expose] def ordinarySpatialJet (s : ℕ) (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u) : SpatialJet 1 standardDirection s (ordinaryLift u) := match s with | 0 => .zero (ordinaryLift u) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSobolevBoundedField.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSobolevBoundedField.lean index 87b2623ebc..6da40eb56b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSobolevBoundedField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSobolevBoundedField.lean @@ -21,7 +21,7 @@ any finite-dimensional real target. It is used only for qualitative closure; the sharp word estimates use their previously proved direct bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalReflection.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalReflection.lean index feadbe8a7c..27c759e089 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalReflection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalReflection.lean @@ -17,7 +17,7 @@ projection. The scalar test is reflected with a minus sign so its gradient has the same pullback as an ordinary vector field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalSpace.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalSpace.lean index 7361750546..15d6ad5b0f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalSpace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalSpace.lean @@ -22,7 +22,7 @@ below acts on this space, rather than on the lifted cylinder used by the oscillatory correction construction. -/ -@[expose] public section +public section noncomputable section @@ -61,11 +61,13 @@ theorem testGradient_ae (φ : Space → ℝ) (hc : HasCompactSupport φ) /-- Gradient generators, given by `{g | ∃ φ : Space → ℝ, HasCompactSupport φ ∧ ContDiff ℝ ∞ φ ∧ g =ᵐ[volume] gradient φ}`. -/ +@[expose] def gradientGenerators : Set L2 := {g | ∃ φ : Space → ℝ, HasCompactSupport φ ∧ ContDiff ℝ ∞ φ ∧ g =ᵐ[volume] gradient φ} /-- Gradient space, given by `(Submodule.span ℝ gradientGenerators).topologicalClosure`. -/ +@[expose] def gradientSpace : Submodule ℝ L2 := (Submodule.span ℝ gradientGenerators).topologicalClosure @@ -76,7 +78,7 @@ instance : CompleteSpace gradientSpace := gradientSpace_closed.completeSpace_coe /-- Solenoidal space, given by `gradientSpace.orthogonal instance : CompleteSpace solenoidalSpace := gradientSpace.isClosed_orthogonal.completeSpace_coe`. -/ -def solenoidalSpace : Submodule ℝ L2 := gradientSpace.orthogonal +@[expose] def solenoidalSpace : Submodule ℝ L2 := gradientSpace.orthogonal instance : CompleteSpace solenoidalSpace := gradientSpace.isClosed_orthogonal.completeSpace_coe @@ -123,7 +125,7 @@ theorem mem_solenoidal_iff (u : L2) : u ∈ solenoidalSpace ↔ exact hclosure hg /-- Solenoidal projection, given by `solenoidalSpace.starProjection`. -/ -def solenoidalProjection : L2 →L[ℝ] L2 := solenoidalSpace.starProjection +@[expose] def solenoidalProjection : L2 →L[ℝ] L2 := solenoidalSpace.starProjection theorem solenoidalProjection_mem (u : L2) : solenoidalProjection u ∈ solenoidalSpace := solenoidalSpace.starProjection_apply_mem u diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalTranslation.lean index 16407c521f..de706014d0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSolenoidalTranslation.lean @@ -17,7 +17,7 @@ actual R³ L² space, preserve its weak divergence constraint, and commute with the orthogonal solenoidal projection. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open scoped ContDiff /-- Translation, given by `Lp.compMeasurePreservingₗᵢ ℝ (fun x : Space => x + a) (measurePreserving_add_right (volume : Measure Space) a)`. -/ -def translation (a : Space) : L2 →ₗᵢ[ℝ] L2 := +@[expose] def translation (a : Space) : L2 →ₗᵢ[ℝ] L2 := Lp.compMeasurePreservingₗᵢ ℝ (fun x : Space => x + a) (measurePreserving_add_right (volume : Measure Space) a) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceFixedInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceFixedInverse.lean index b7fb728065..1ece5d4035 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceFixedInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceFixedInverse.lean @@ -22,7 +22,7 @@ coordinate solver is identified with the original source mean solver, and its spatial translation regularity follows from the constructed coefficient families. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceOperatorRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceOperatorRegularity.lean index ef89acc590..0ff3c56c1b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceOperatorRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceOperatorRegularity.lean @@ -24,7 +24,7 @@ fields and smooth compact cutoffs. Their operator regularity is proved by those constructions and then passed through the genuine fixed mean inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceSpatialRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceSpatialRegularity.lean index d00dc06555..96e04776c0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceSpatialRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceSpatialRegularity.lean @@ -35,7 +35,7 @@ realization with the same fixed-coordinate derivative field. Spatial estimates for the fixed inverse consequently apply to the constructed physical velocity. -/ -@[expose] public section +public section noncomputable section @@ -103,7 +103,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceVariationalInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceVariationalInverse.lean index 767268ee7b..a358488368 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSourceVariationalInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSourceVariationalInverse.lean @@ -25,7 +25,7 @@ section /-! The source localization estimate for the constructed nonlocal boundary operator. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ section /-! Integrating the source's different lower bounds inside and outside the core. -/ -@[expose] public section +public section noncomputable section @@ -171,7 +171,7 @@ end end -@[expose] public section +public section noncomputable section @@ -233,7 +233,7 @@ end end -@[expose] public section +public section noncomputable section @@ -245,7 +245,7 @@ open MeasureTheory Set InnerProductSpace EulerSmoothLimit EulerMeanSolenoidal open scoped NNReal /-- Effective negative bound, given by `Be + boundaryLocalizationC2 * Bc * r^3`. -/ -def effectiveNegativeBound (Be Bc r : ℝ) : ℝ := +@[expose] def effectiveNegativeBound (Be Bc r : ℝ) : ℝ := Be + boundaryLocalizationC2 * Bc * r^3 theorem effectiveNegativeBound_nonneg (Be Bc r : ℝ) @@ -277,7 +277,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (ℓ : ℝ) (hℓ : 0 < ℓ) (hsmall : K * (T ^ 2 / 2) + Be * T + boundaryLocalizationC2 * Bc * r ^ 3 * T ≤ 1 / 2) /-- This is the actual Lax–Milgram mean inverse, with spatial coercivity discharged. -/ -def sourceMeanSolver : TimeLp T L2 →L[ℝ] meanDerivatives T hT FInv := +@[expose] def sourceMeanSolver : TimeLp T L2 →L[ℝ] meanDerivatives T hT FInv := meanSolver T hT FInv H (coefficientOperator M hM C hC) (boundaryOperator (scaledCutoff ℓ hℓ)) L K (effectiveNegativeBound Be Bc r) hK (effectiveNegativeBound_nonneg Be Bc r hBe hBc hr) hF0 hH diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanSpatialEvaluation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanSpatialEvaluation.lean index 8d47908a9a..8209d5dc32 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanSpatialEvaluation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanSpatialEvaluation.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevJointEvaluation /-! Bounded point evaluation and joint continuity of reconstructed ordinary-space fields. -/ -@[expose] public section +public section noncomputable section @@ -47,8 +47,7 @@ theorem representative_bound (u : EulerMeanSolenoidal.L2) (hu : SmoothOrbit u) ( ∑ n ∈ Finset.range 4, ‖iteratedFDeriv ℝ n (fun a : Space => EulerMeanSolenoidal.translation a u) 0‖ := by have H := EulerSobolevPointEvaluation.representative_bound 1 (ordinarySobolev 3 u hu) (x, 0) - change ‖pointEvaluation 1 (x, 0) (ordinarySobolev 3 u hu)‖ ≤ - sobolevEmbeddingConstant 1 3 * ‖ordinarySobolev 3 u hu‖ at H + rw [← EulerSobolevPointEvaluation.pointEvaluation_apply] at H rw [pointEvaluation_ordinary] at H exact H.trans (mul_le_mul_of_nonneg_left (ordinarySobolev_norm_le 3 u hu) (sobolevEmbeddingConstant_nonneg 1 3)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEquation.lean index 307bf2ea37..a2f0124817 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEquation.lean @@ -20,7 +20,7 @@ initial momentum trace then cancels the original M0 boundary term. The final fields contain the actual projected equation (9) and `z_t(0)=L A z(0)`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEstimates.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEstimates.lean index 9b5df9088f..ef5a541252 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanStrongEstimates.lean @@ -30,7 +30,7 @@ identifies it with `F z_t`. Composing with the variational solver gives the actual linear velocity inverse with an explicit finite-time bound. -/ -@[expose] public section +public section noncomputable section @@ -162,7 +162,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanStrongGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanStrongGevrey.lean index 0fb86cdd13..75c6b5f93f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanStrongGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanStrongGevrey.lean @@ -30,7 +30,7 @@ The constants are fixed polynomials in the coefficient amplitudes and the proved inverse bound; none depends on the derivative order. -/ -@[expose] public section +public section noncomputable section @@ -180,7 +180,7 @@ with those spatial derivatives, giving genuine jointly continuous spatial representatives and their pointwise classical time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanTimeContinuousTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanTimeContinuousTranslation.lean index be5cd153a7..44b9a806d3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanTimeContinuousTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanTimeContinuousTranslation.lean @@ -21,7 +21,7 @@ spatial orbit regularity, and evaluation at each time loses no derivative or additional constant. -/ -@[expose] public section +public section noncomputable section @@ -42,7 +42,7 @@ local instance instMeanTimeContinuousTranslation2 (T : ℝ) : NormedSpace ℝ C( inferInstance /-- Ordinary spatial translation of every time value of a continuous L² path. -/ -def pathTranslation (T : ℝ) (a : Space) : +@[expose] def pathTranslation (T : ℝ) (a : Space) : C(Icc (0 : ℝ) T, L2) →L[ℝ] C(Icc (0 : ℝ) T, L2) := (translation a).toContinuousLinearMap.compLeftContinuous ℝ (Icc (0 : ℝ) T) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanTimeSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanTimeSobolev.lean index 8ece91b461..8dce12a945 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanTimeSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanTimeSobolev.lean @@ -25,7 +25,7 @@ The fixed time reconstruction and actual frame products preserve the input radius. No conversion of forcing or solution tensors is used. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanTimeTranslation.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanTimeTranslation.lean index 5659570d10..25fd44e2b6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanTimeTranslation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanTimeTranslation.lean @@ -28,7 +28,7 @@ This uses dominated convergence with the actual square-integrable time field. It does not assume operator-norm continuity of spatial translations. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ end end -@[expose] public section +public section noncomputable section @@ -106,7 +106,8 @@ open Set MeasureTheory InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerMeanSolenoidal EulerTimeLp EulerTerminalTimePrimitive EulerTimeLpBoundedMap /-- Spatial translation restricted to the actual ordinary solenoidal space. -/ -def solenoidalTranslation (a : Space) : solenoidalSpace →ₗᵢ[ℝ] solenoidalSpace where +@[expose] def solenoidalTranslation (a : Space) : + solenoidalSpace →ₗᵢ[ℝ] solenoidalSpace where toLinearMap := ((translation a).toLinearMap.comp solenoidalSpace.subtype).codRestrict solenoidalSpace (fun u => translation_solenoidal_mem a u.property) norm_map' := fun u => (translation a).norm_map (u : L2) @@ -135,11 +136,11 @@ theorem solenoidalTranslation_continuous (u : solenoidalSpace) : (translation_continuous (u : L2)).subtype_mk (fun a => translation_solenoidal_mem a u.property) /-- Actual spatial translation at every Bochner time slice. -/ -def timeTranslation (T : ℝ) (a : Space) : TimeLp T L2 →ₗᵢ[ℝ] TimeLp T L2 := +@[expose] def timeTranslation (T : ℝ) (a : Space) : TimeLp T L2 →ₗᵢ[ℝ] TimeLp T L2 := timeLiftIsometry T (translation a) /-- Actual spatial translation on the fixed solenoidal time Hilbert space. -/ -def timeSolenoidalTranslation (T : ℝ) (a : Space) : +@[expose] def timeSolenoidalTranslation (T : ℝ) (a : Space) : TimeLp T solenoidalSpace →ₗᵢ[ℝ] TimeLp T solenoidalSpace := timeLiftIsometry T (solenoidalTranslation a) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanTranslatedInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanTranslatedInverse.lean index d634ccd8b3..b4e09fd8a0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanTranslatedInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanTranslatedInverse.lean @@ -26,7 +26,7 @@ spatial translation of the original solution. Thus regularity of known coefficient families yields genuine spatial regularity of the solved field. -/ -@[expose] public section +public section noncomputable section @@ -151,7 +151,7 @@ section /-! Actual derivatives and factorial bounds for the translated multiplication operators. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalInverse.lean index 2a627e7d3c..81e19c3ce9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalInverse.lean @@ -27,7 +27,7 @@ recovered `z=FInv η` is continuous here; its H¹ regularity additionally uses t source's C¹-in-time inverse deformation. -/ -@[expose] public section +public section noncomputable section @@ -53,6 +53,12 @@ def meanDerivatives (T : ℝ) (hT : 0 ≤ T) intro a u hu t simpa only [map_smul, ContinuousMap.smul_apply] using solenoidalSpace.smul_mem a (hu t) +@[simp] theorem mem_meanDerivatives (T : ℝ) (hT : 0 ≤ T) + (FInv : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) (u : TimeLp T L2) : + u ∈ meanDerivatives T hT FInv ↔ + ∀ t, FInv t (terminalPrimitive T hT u t) ∈ solenoidalSpace := by + rfl + /-- Every genuine absolutely continuous terminal-zero path with an L² derivative and the label-solenoidal constraint is represented in this Hilbert space. -/ theorem derivative_mem_of_ac (T : ℝ) (hT : 0 ≤ T) @@ -84,13 +90,13 @@ instance meanDerivatives_complete (T : ℝ) (hT : 0 ≤ T) (meanDerivatives_closed T hT FInv).completeSpace_coe /-- The actual displacement primitive, restricted to the mean constraint space. -/ -def meanPrimitive (T : ℝ) (hT : 0 ≤ T) +@[expose] def meanPrimitive (T : ℝ) (hT : 0 ≤ T) (FInv : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) : meanDerivatives T hT FInv →L[ℝ] TimeLp T L2 := (primitiveTimeLp T hT).comp (meanDerivatives T hT FInv).subtypeL /-- The actual initial trace on that same constraint space. -/ -def meanTrace (T : ℝ) (hT : 0 ≤ T) +@[expose] def meanTrace (T : ℝ) (hT : 0 ≤ T) (FInv : C(Icc (0 : ℝ) T, L2 →L[ℝ] L2)) : meanDerivatives T hT FInv →L[ℝ] L2 := (initialTrace T hT).comp (meanDerivatives T hT FInv).subtypeL diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalOperator.lean index d84b2d8cf2..deaba56108 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanVariationalOperator.lean @@ -17,7 +17,7 @@ actual displacement primitive and `R` its initial trace. The boundary lower bound is required only on the trace image, as in the source's solenoidal space. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable {V W X : Type*} [NormedAddCommGroup X] [InnerProductSpace ℝ X] [CompleteSpace X] /-- The actual bounded operator representing kinetic, potential, and boundary terms. -/ -def meanOperator (J : V →L[ℝ] W) (R : V →L[ℝ] X) +@[expose] def meanOperator (J : V →L[ℝ] W) (R : V →L[ℝ] X) (H : W →L[ℝ] W) (C : X →L[ℝ] X) : V →L[ℝ] V := dirichletOperator J H + R.adjoint.comp (C.comp R) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean index 115681fd76..46426dcec0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Ordinary smooth vector-calculus identities with the canonical Mathlib Laplacian. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open MeasureTheory InnerProductSpace Laplacian EulerSmoothLimit EulerVectorCalcu open scoped ContDiff /-- Vector partial, given by `fderiv ℝ f x (EuclideanSpace.single i 1)`. -/ -def vectorPartial (f : Space → Space) (i : Fin 3) (x : Space) : Space := +@[expose] def vectorPartial (f : Space → Space) (i : Fin 3) (x : Space) : Space := fderiv ℝ f x (EuclideanSpace.single i 1) theorem vectorPartial_smooth (f : Space → Space) (hf : ContDiff ℝ ∞ f) (i : Fin 3) : @@ -90,12 +90,12 @@ theorem vectorCurl_compact (f : Space → Space) (hc : HasCompactSupport f) : /-- Curl test, given by `⟨vectorCurl (f : Space → Space), vectorCurl_smooth f f.smooth, vectorCurl_compact f f.compact⟩`. -/ -def curlTest (f : Test) : Test := +@[expose] def curlTest (f : Test) : Test := ⟨vectorCurl (f : Space → Space), vectorCurl_smooth f f.smooth, vectorCurl_compact f f.compact⟩ /-- Laplacian test, given by `⟨Δ (f : Space → Space), vector_laplacian_smooth f f.smooth, vector_laplacian_compact f f.smooth f.compact⟩`. -/ -def laplacianTest (f : Test) : Test := +@[expose] def laplacianTest (f : Test) : Test := ⟨Δ (f : Space → Space), vector_laplacian_smooth f f.smooth, vector_laplacian_compact f f.smooth f.compact⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanVelocityPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanVelocityPressure.lean index d1116a5ae8..c5254befea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanVelocityPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanVelocityPressure.lean @@ -17,7 +17,7 @@ actual time derivative, and the residual f-B_t-MB. Its F-adjoint transform is in the ordinary L² gradient space by the proved strong projected equation. -/ -@[expose] public section +public section noncomputable section @@ -34,14 +34,14 @@ variable {T : ℝ} {hT : 0 ≤ T} (s : StrongMeanEvolution T hT FInv F F₁ A L u f) /-- The actual physical velocity B=F z_t as a Bochner L² field. -/ -def velocityField : TimeLp T L2 := +@[expose] def velocityField : TimeLp T L2 := timeMultiplier T hT (solenoidalFrame T F) s.velocityLp /-- The actual continuous physical-velocity representative. -/ -def physicalPath : ℝ → L2 := fun t => extendPath T hT F t (s.velocity t : L2) +@[expose] def physicalPath : ℝ → L2 := fun t => extendPath T hT F t (s.velocity t : L2) /-- The product-rule candidate for B_t, constructed in actual Bochner L². -/ -def velocityDerivative : TimeLp T L2 := +@[expose] def velocityDerivative : TimeLp T L2 := fieldProductDerivative T hT (solenoidalFrame T F) (solenoidalFrame T F₁) s.velocityLp s.acceleration @@ -65,7 +65,7 @@ theorem inversePhysicalPath_solenoidal exact (s.velocity t).property /-- The pressure residual in the strong equation, before using F_t=MF. -/ -def pressureResidual : TimeLp T L2 := +@[expose] def pressureResidual : TimeLp T L2 := f - timeMultiplier T hT (solenoidalFrame T F) s.acceleration - (2 : ℝ) • timeMultiplier T hT (solenoidalFrame T F₁) s.velocityLp diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanWeakCurl.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanWeakCurl.lean index 432acde436..f239df1aac 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanWeakCurl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanWeakCurl.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Distribution.AEEqOfIntegralContDiff /-! The ordinary closed L² gradient space has zero distributional curl. For smooth representatives this gives actual pointwise symmetry of the derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicInterior.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicInterior.lean index c9107d2f8b..d2f73a28b9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicInterior.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicInterior.lean @@ -22,7 +22,7 @@ section /-! Differentiating an actual compact mollifier transfers the distributional Laplacian to the kernel. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -186,7 +186,7 @@ theorem weakHarmonic_pointwise (u : L2) (hu : WeakHarmonicOn (Metric.ball (0 : S /-- Weak harmonic small ball constant, given by `(Real.pi * 4 / 3) * harmonicQuarterBallConstant`. -/ -def weakHarmonicSmallBallConstant : ℝ := (Real.pi * 4 / 3) * harmonicQuarterBallConstant +@[expose] def weakHarmonicSmallBallConstant : ℝ := (Real.pi * 4 / 3) * harmonicQuarterBallConstant theorem weakHarmonicSmallBallConstant_nonneg : 0 ≤ weakHarmonicSmallBallConstant := by unfold weakHarmonicSmallBallConstant diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicScaling.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicScaling.lean index f1545ad533..4c611e6e75 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicScaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanWeakHarmonicScaling.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Scale-independent local L² control of weak harmonic fields on ordinary R³. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean index 3a09ad6849..2c07cddadd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Dissipation of the genuine cylinder Laplacian in a variable positive metric. -/ -@[expose] public section +public section noncomputable section @@ -148,6 +148,7 @@ theorem standardDirection_norm (i : Fin 4) : ‖standardDirection i‖ = 1 := by cases i using Fin.cases <;> simp [Prod.norm_def] /-- The actual cylinder Laplacian assembled from strong second coordinate derivatives. -/ +@[expose] def jetLaplacian {f : LiftL2 period} (J : SpatialJet period standardDirection 2 f) : LiftL2 period := ∑ i : Fin 4, J.word (fun _ : Fin 2 => i) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MetricPathConvergence.lean b/LeanPool/NavierStokesAndEuler/Euler/MetricPathConvergence.lean index 434089ba63..beece52ef1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MetricPathConvergence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MetricPathConvergence.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.InnerProductSpace.Continuous /-! Uniform convergence of actual finite metric energies along continuous Hilbert-space paths. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MetricRootLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/MetricRootLimit.lean index ccfe9a94ea..aa54493593 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MetricRootLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MetricRootLimit.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.SpecialFunctions.Sqrt /-! Removal of square-root regularization in actual finite metric-energy integral inequalities. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MildEquationBridge.lean b/LeanPool/NavierStokesAndEuler/Euler/MildEquationBridge.lean index a652f7215e..d229beb459 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MildEquationBridge.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MildEquationBridge.lean @@ -17,7 +17,7 @@ section /-! The actual heat Duhamel integral satisfies the inhomogeneous equation in L². -/ -@[expose] public section +public section noncomputable section @@ -119,7 +119,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MildTopWord.lean b/LeanPool/NavierStokesAndEuler/Euler/MildTopWord.lean index 80e10c1f5d..2cd34864a5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MildTopWord.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MildTopWord.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MildEquationBridge /-! Actual highest derivative words preserve the gained-derivative heat mild formula. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/MildWordEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/MildWordEquation.lean index 0eb90f3a2e..162da8d8e1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MildWordEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MildWordEquation.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MildEquationBridge /-! Every available finite derivative word of the actual viscous mild solution satisfies its differentiated L² equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/NonlinearEnergyConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/NonlinearEnergyConstants.lean index 4d3c99d66e..3544c1b766 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/NonlinearEnergyConstants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/NonlinearEnergyConstants.lean @@ -25,7 +25,7 @@ section /-! The actual complete Euler forcing estimate in metric-energy variables. -/ -@[expose] public section +public section noncomputable section @@ -127,7 +127,7 @@ end end -@[expose] public section +public section noncomputable section @@ -270,7 +270,7 @@ end end -@[expose] public section +public section noncomputable section @@ -282,21 +282,21 @@ open EulerCorrectionEnergyBound EulerGevreyCorrectionBound EulerGevreyMetricEsti variable (period : ℝ) [Fact (0 < period)] /-- The fixed coefficient of the metric-linear part of the actual nonlinear forcing. -/ -def linearCoefficient (B M B0 B1 A0 A2 c : ℝ) : ℝ := +@[expose] def linearCoefficient (B M B0 B1 A0 A2 c : ℝ) : ℝ := (sourceConstant B M*(productConstant period 3*B1+A0+2*A2*productConstant period 3*B0) + transportConstant period B M*B0)*metricAmplification c /-- The fixed coefficient of the metric-quadratic part of the actual nonlinear forcing. -/ -def quadraticCoefficient (B M A2 c : ℝ) : ℝ := +@[expose] def quadraticCoefficient (B M A2 c : ℝ) : ℝ := (sourceConstant B M*A2*productConstant period 3+transportConstant period B M)*(metricAmplification c)^2 /-- The fixed coefficient of the single derivative-loss factor in the actual nonlinear forcing. -/ -def lossCoefficient (M c : ℝ) : ℝ := lossConstant period M*(metricAmplification c)^2 +@[expose] def lossCoefficient (M c : ℝ) : ℝ := lossConstant period M*(metricAmplification c)^2 /-- One explicit constant independent of the external cutoff controls all actual scalar energy coefficients. -/ -def energyConstant (g0 g1 k B M B0 B1 A0 A2 c : ℝ) : ℝ := +@[expose] def energyConstant (g0 g1 k B M B0 B1 A0 A2 c : ℝ) : ℝ := 1+g0+g1+k*sourceConstant B M+k*linearCoefficient period B M B0 B1 A0 A2 c + k*quadraticCoefficient period B M A2 c+k*lossCoefficient period M c diff --git a/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean b/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean index b7566c8726..a09a52ae31 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Ring.RingNF sequence are bounded by the corresponding endpoint product. The proof also covers zero entries and uses no logarithm or division. -/ -@[expose] public section +public section namespace EulerNonnegativeLogConvex diff --git a/LeanPool/NavierStokesAndEuler/Euler/NormalPacketFrequencyGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/NormalPacketFrequencyGuards.lean index 3244f1f137..e4459746ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/NormalPacketFrequencyGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/NormalPacketFrequencyGuards.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketUniformFrequencyMargin /-! The same normal-stage frequency comparison also supplies the parent-label and physical support-scale inequalities for the child flow. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OperatorGevreyCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/OperatorGevreyCalculus.lean index 766ff13ee1..cc1a2b27bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OperatorGevreyCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OperatorGevreyCalculus.lean @@ -22,7 +22,7 @@ bilinear maps. They transfer coefficient bounds to the time multipliers, transported variational forms, and right sides of the constructed inverses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryAdvectionLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryAdvectionLimit.lean index 7a82648fcf..25b13da4c3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryAdvectionLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryAdvectionLimit.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder strong ordinary Sobolev limit. Only a uniform H³ bound is used in the product estimate; pressure convergence is a consequence. -/ -@[expose] public section +public section noncomputable section @@ -80,7 +80,7 @@ def advectionPath (A : Icc (0 : ℝ) T → SmoothL2Field Space) /-- Projected rhs path, given by `fieldPath (fun t => projectedRhs (A t)) (projectedRhs_continuous A hA)`. -/ -def projectedRhsPath (A : Icc (0 : ℝ) T → SmoothL2Field Space) +@[expose] def projectedRhsPath (A : Icc (0 : ℝ) T → SmoothL2Field Space) (hA : ∀ n, Continuous (fun t => (A t).jetLp n)) : C(Icc (0 : ℝ) T,L2) := fieldPath (fun t => projectedRhs (A t)) (projectedRhs_continuous A hA) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryCauchyInterpolation.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryCauchyInterpolation.lean index 105d0b500f..7bc72d398e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryCauchyInterpolation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryCauchyInterpolation.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevCauchyInterpolation /-! Actual ordinary L² convergence upgrades to convergence in every fixed Sobolev norm under uniform higher-order bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerBKM.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerBKM.lean index 21cb3d04a0..dd3aabf7a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerBKM.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerBKM.lean @@ -30,7 +30,7 @@ section logarithmic gradient estimate bounds the gradient integral using only the time integral of its continuous vorticity coefficient. -/ -@[expose] public section +public section noncomputable section @@ -190,7 +190,7 @@ end end -@[expose] public section +public section noncomputable section @@ -238,7 +238,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerCauchy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerCauchy.lean index 43d867e7b7..43757d4b29 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerCauchy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerCauchy.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OrdinaryEulerLimit H³ bound, uniform initial Sobolev bounds, and initial L² Cauchy data produce an actual smooth Euler limit on the same positive interval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerClassicalClass.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerClassicalClass.lean index 4205f03a90..37f17fff3a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerClassicalClass.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerClassicalClass.lean @@ -24,7 +24,7 @@ velocity alone. Pressure regularity follows from the projected equation. Every solution has one continuous strong time derivative in every spatial Sobolev order. -/ -@[expose] public section +public section noncomputable section @@ -101,7 +101,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerConcatenation.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerConcatenation.lean index f07e22c1c1..3b57161317 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerConcatenation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerConcatenation.lean @@ -21,7 +21,7 @@ section /-! Concatenation of two paths on closed time intervals. Matching endpoint values and derivatives give a genuine derivative at the seam. -/ -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerContinuation.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerContinuation.lean index 9df290d94f..c0fa8a570e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerContinuation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerContinuation.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryEulerLocalExistence /-! Genuine continuation of every closed smooth Euler evolution, and the resulting gradient blowup criterion at a finite maximal horizon. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerDifference.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerDifference.lean index 8c81947c3c..86d1c81fe9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerDifference.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerDifference.lean @@ -29,7 +29,7 @@ space, even when its scalar potential is not square-integrable. The solenoidal remainder is both curl-free and harmonic, hence zero by the actual L² integration-by-parts identity. -/ -@[expose] public section +public section noncomputable section @@ -150,7 +150,7 @@ end end -@[expose] public section +public section noncomputable section @@ -235,7 +235,7 @@ theorem derivative_continuous (U : Evolution T hT) (n : ℕ) : U.pressureForce U.pressure_continuous n /-- Difference, given by `fieldSub (V.velocity t) (U.velocity t)`. -/ -def difference (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : SmoothL2Field Space := +@[expose] def difference (U V : Evolution T hT) (t : Icc (0 : ℝ) T) : SmoothL2Field Space := fieldSub (V.velocity t) (U.velocity t) /-- Pressure difference, given by `fieldSub (V.pressureForce t) (U.pressureForce t)`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean index b5c3f40056..241a508166 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean @@ -34,7 +34,7 @@ energy. Everything is an actual smooth L² field. Cubic testing and noncompact integration by parts prove the L⁴ inequality without a support or interpolation hypothesis. -/ -@[expose] public section +public section noncomputable section @@ -124,7 +124,7 @@ end end -@[expose] public section +public section noncomputable section @@ -272,7 +272,7 @@ section velocity gradient. The pressure and undifferentiated transport cancel before the cubic-test interpolation estimate is used. -/ -@[expose] public section +public section noncomputable section @@ -392,7 +392,7 @@ end end -@[expose] public section +public section noncomputable section @@ -427,7 +427,7 @@ theorem pointwise_gradient_le (U : Evolution T hT) (t : Icc (0 : ℝ) T) (x : Sp (U.gradientNormPath_le_iff t _).mp le_rfl x /-- Gradient integral, given by `realIntegral T hT U.gradientNormPath t`. -/ -def gradientIntegral (U : Evolution T hT) (t : Icc (0 : ℝ) T) : ℝ := +@[expose] def gradientIntegral (U : Evolution T hT) (t : Icc (0 : ℝ) T) : ℝ := realIntegral T hT U.gradientNormPath t theorem gradientIntegral_nonneg (U : Evolution T hT) (t : Icc (0 : ℝ) T) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerHigherEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerHigherEnergy.lean index d903e1293d..50b13b04ff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerHigherEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerHigherEnergy.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryWordBounds the actual H³ norm is bounded. There is no order-dependent shortening of time and no postulated energy differential inequality. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ variable {T : ℝ} {hT : 0 ≤ T} /-- Integer energy path, given by `⟨fun t => wordEnergy m (U.velocity t),wordEnergy_continuous U.velocity U.velocity_continuous m⟩`. -/ -def integerEnergyPath (U : Evolution T hT) (m : ℕ) : C(Icc (0 : ℝ) T,ℝ) := +@[expose] def integerEnergyPath (U : Evolution T hT) (m : ℕ) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => wordEnergy m (U.velocity t),wordEnergy_continuous U.velocity U.velocity_continuous m⟩ /-- Integer energy derivative, given by `integerEnergyProduction m (U.velocity t) (U.derivative diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerKineticEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerKineticEnergy.lean index 2ba128e450..67b6b152a3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerKineticEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerKineticEnergy.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Exact conservation of kinetic energy for the ordinary smooth Euler class, using the genuine noncompact transport and pressure cancellations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerL2Stability.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerL2Stability.lean index 204686dc92..5b336dbc0e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerL2Stability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerL2Stability.lean @@ -17,7 +17,7 @@ and the entire transport term cancel before estimating the remaining reference-gradient term. All time derivatives are genuine one-sided derivatives at the endpoints. -/ -@[expose] public section +public section noncomputable section @@ -82,7 +82,7 @@ def velocityPath (U : Evolution T hT) : C(Icc (0 : ℝ) T,L2) := simp only [velocityPath,ordinaryWordPath_apply,wordField_zero] /-- L2 energy path as an element of `C(Icc (0 : ℝ) T,ℝ)`. -/ -def l2EnergyPath (U V : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := +@[expose] def l2EnergyPath (U V : Evolution T hT) : C(Icc (0 : ℝ) T,ℝ) := ⟨fun t => ‖(U.difference V t).toLp‖^2,by have h := (ordinaryWordPath (U.difference V) (U.difference_continuous V) (Fin.elim0 : Fin 0 → Fin 3)).continuous diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLifespan.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLifespan.lean index 878b5f9072..45c3dd0979 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLifespan.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLifespan.lean @@ -22,7 +22,7 @@ Euler solutions are rescaled to a common interval; the already proved smooth limit supplies the endpoint, and uniqueness identifies it with every original partial solution. No analytic radius is assumed. -/ -@[expose] public section +public section noncomputable section @@ -124,7 +124,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLimit.lean index f54a8fac90..3ff34ae621 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLimit.lean @@ -15,7 +15,7 @@ evolutions. The only compactness inputs are actual uniform Sobolev bounds and L² Cauchy convergence. The nonlinear term, pressure, and time equation are all recovered in the proof. -/ -@[expose] public section +public section noncomputable section @@ -132,7 +132,7 @@ namespace Evolution /-- Scalar pressure, given by `EulerCanonicalGraphPotential.radialPotential (U.pressureForce t).field`. -/ -def scalarPressure (U : Evolution T hT) (t : Icc (0 : ℝ) T) : Space → ℝ := +@[expose] def scalarPressure (U : Evolution T hT) (t : Icc (0 : ℝ) T) : Space → ℝ := EulerCanonicalGraphPotential.radialPotential (U.pressureForce t).field theorem scalarPressure_spec (U : Evolution T hT) (t : Icc (0 : ℝ) T) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalCauchy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalCauchy.lean index 84f954e2ea..187162a662 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalCauchy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalCauchy.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryWordBounds data. A fixed tail member supplies the reference solution; the actual stability theorem supplies the uniform H3 bound needed by the limit. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalExistence.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalExistence.lean index 5c36f2f8a7..1af72d670d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalExistence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerLocalExistence.lean @@ -50,7 +50,7 @@ section into every complete Sobolev space are bounded by the closed graph theorem, rather than by an assumed derivative estimate. -/ -@[expose] public section +public section noncomputable section @@ -202,7 +202,7 @@ a genuine global flow on a real Hilbert space. Radial normalization first gives a globally Lipschitz equation; its conserved norm then removes the normalization by a constant rescaling of time. -/ -@[expose] public section +public section noncomputable section @@ -339,7 +339,7 @@ section equation. The vector field is a bounded bilinear map and its actual L² energy vanishes by noncompact transport cancellation. -/ -@[expose] public section +public section noncomputable section @@ -449,7 +449,7 @@ end end -@[expose] public section +public section noncomputable section @@ -588,7 +588,7 @@ section /-! A true orbit derivative gives a global increment bound for a linear isometric action. -/ -@[expose] public section +public section noncomputable section @@ -620,7 +620,7 @@ end end -@[expose] public section +public section noncomputable section @@ -796,7 +796,7 @@ end end -@[expose] public section +public section noncomputable section @@ -916,7 +916,7 @@ section /-! The actual regularized Euler right-hand side converges to the projected Euler right-hand side, uniformly on bounded H⁴ sets. -/ -@[expose] public section +public section noncomputable section @@ -1013,7 +1013,7 @@ section /-! Actual L² stability of projected Euler with a small additive defect. The reference gradient is the only solution coefficient. -/ -@[expose] public section +public section noncomputable section @@ -1098,7 +1098,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1207,7 +1207,7 @@ section /-! A uniform short-time bound for a nonnegative genuine energy with a quadratic differential upper bound. -/ -@[expose] public section +public section noncomputable section @@ -1262,7 +1262,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1439,7 +1439,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerMaximal.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerMaximal.lean index c8908286df..3a9d34edda 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerMaximal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerMaximal.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanClassicalConstraints chosen on intermediate horizons, and genuine Euler uniqueness removes the dependence on that choice. No continuation criterion is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRescaling.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRescaling.lean index e25e5bdd35..7357119b8c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRescaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRescaling.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OrdinaryEulerDifference /-! The genuine time/amplitude symmetry of ordinary Euler, including restriction to a shorter closed time interval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRestriction.lean index 05811dfea4..17019e6ded 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerRestriction.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothCoefficientTimeRestricti closed interval. The reference size of the original solution still bounds every restricted velocity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerStability.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerStability.lean index 422f36119c..b943b9f475 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerStability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerStability.lean @@ -29,7 +29,7 @@ section /-! The scalar comparison lemma with genuine one-sided endpoint derivatives. -/ -@[expose] public section +public section noncomputable section @@ -79,7 +79,7 @@ end end -@[expose] public section +public section noncomputable section @@ -230,7 +230,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerUniqueness.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerUniqueness.lean index cbef7e8164..1abbd08c9b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerUniqueness.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerUniqueness.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryGradientStability /-! Uniqueness of actual smooth ordinary Euler evolutions, including their pressure force. No assumed energy inequality is needed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVaryingHorizon.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVaryingHorizon.lean index 02b94141fb..83d986d71e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVaryingHorizon.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVaryingHorizon.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.BreakdownCriterion /-! H³ stability on varying initial horizons. The comparison constant uses only the original reference Euler solution and its full horizon. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVorticity.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVorticity.lean index f89e9ff704..66739a16be 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVorticity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerVorticity.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketPotentialRegularity /-! Genuine ordinary vorticity fields, their continuous supremum norms, and actual time integrals. These are literal curls of the velocity. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ theorem vorticityField_continuous {K : Type*} [TopologicalSpace K] (continuous_jetLp_derivative A hA) n /-- Vorticity norm, given by `‖finiteField (vorticityField A)‖`. -/ -def vorticityNorm (A : SmoothL2Field Space) : ℝ := ‖finiteField (vorticityField A)‖ +@[expose] def vorticityNorm (A : SmoothL2Field Space) : ℝ := ‖finiteField (vorticityField A)‖ theorem vorticityNorm_nonneg (A : SmoothL2Field Space) : 0 ≤ vorticityNorm A := norm_nonneg _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldAlgebra.lean index 6ce606fba9..6d486ea87b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldAlgebra.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Genuine smooth L² sums, scalar products, and ordinary advection. -/ -@[expose] public section +public section noncomputable section @@ -71,7 +71,7 @@ def fieldNeg (A : SmoothL2Field V) : SmoothL2Field V := mapField (-(ContinuousLi (fieldNeg A).field x = -A.field x := rfl /-- Field sub, given by `addField A (fieldNeg B)`. -/ -def fieldSub (A B : SmoothL2Field V) : SmoothL2Field V := addField A (fieldNeg B) +@[expose] def fieldSub (A B : SmoothL2Field V) : SmoothL2Field V := addField A (fieldNeg B) @[simp] theorem fieldSub_field (A B : SmoothL2Field V) (x : Space) : (fieldSub A B).field x = A.field x-B.field x := by @@ -129,6 +129,7 @@ theorem scalarProduct_norm_right (A : SmoothL2Field ℝ) (B : SmoothL2Field V) exact mul_le_mul_of_nonneg_right (hM x) (norm_nonneg _) /-- Coordinate product, given by `scalarProduct (mapField (EuclideanSpace.proj i) A) B`. -/ +@[expose] def coordinateProduct (i : Fin 3) (A : SmoothL2Field Space) (B : SmoothL2Field V) : SmoothL2Field V := scalarProduct (mapField (EuclideanSpace.proj i) A) B diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldScaling.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldScaling.lean index f24319b6fd..2d99c2473c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldScaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryFieldScaling.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Literal scalar multiplication of smooth ordinary L² fields and all of their genuine spatial derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientLimit.lean index 309f4b56e4..054f3d0859 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientLimit.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryGradientStability actual time integral of the velocity gradient. The H³ bound, all higher bounds, and path Cauchy convergence are derived from the true equations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientStability.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientStability.lean index d4e135e268..ceb2a17a4d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientStability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryGradientStability.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Star.Real gradient. The spatial cancellation is exact; no energy differential inequality is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Commutator.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Commutator.lean index deafbf7534..8ff53a00f6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Commutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Commutator.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OrdinaryH3Products /-! The actual ordinary H³ transport commutator, without derivative loss. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Energy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Energy.lean index 3bac57fcd8..7c10a43ec2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Energy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Energy.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryWordConstraints The pressure term vanishes exactly. The constant uses only the reference H⁴ norm and the H³ norm of the difference. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Norms.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Norms.lean index b4db0affab..c4150617ef 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Norms.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Norms.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Explicit finite-dimensional norm comparisons for the actual H³ energy. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ open MeasureTheory EulerSmoothLimit EulerLpTranslation EulerLpTranslation.Smooth EulerSmoothSobolev Finset /-- Tensor norm, given by `∑ n ∈ range (s+1), ‖A.jetLp n‖`. -/ -def tensorNorm (s : ℕ) (A : SmoothL2Field Space) : ℝ := ∑ n ∈ range (s+1), ‖A.jetLp n‖ +@[expose] def tensorNorm (s : ℕ) (A : SmoothL2Field Space) : ℝ := ∑ n ∈ range (s+1), ‖A.jetLp n‖ theorem tensorNorm_eq (s : ℕ) (A : SmoothL2Field Space) : tensorNorm s A=realTensorSobolevNorm 3 s A.field := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Products.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Products.lean index 24c3b8b672..c2e33396e0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Products.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryH3Products.lean @@ -17,7 +17,7 @@ import Mathlib.Algebra.Order.Star.Real distributions use H² point evaluation. The constant is independent of the fields and contains no fourth derivative of either H³ argument. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryHelmholtzField.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryHelmholtzField.lean index cc5ad5a863..c84caff3b1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryHelmholtzField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryHelmholtzField.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryWordConstraints fields and continuous paths of all their jets. Euler pressure and time derivatives are recovered from velocity, not supplied as estimates. -/ -@[expose] public section +public section noncomputable section @@ -157,7 +157,7 @@ theorem derivative_toLp_projected (U : Evolution T hT) (hpos : 0 < T) (t : Icc ( /-- Projected path, given by `fieldPath (fun t => projectedRhs (U.velocity t)) (projectedRhs_continuous U.velocity U.velocity_continuous)`. -/ -def projectedPath (U : Evolution T hT) : C(Icc (0 : ℝ) T,L2) := +@[expose] def projectedPath (U : Evolution T hT) : C(Icc (0 : ℝ) T,L2) := fieldPath (fun t => projectedRhs (U.velocity t)) (projectedRhs_continuous U.velocity U.velocity_continuous) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean index b20e14140f..a2ad08ee46 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean @@ -18,7 +18,7 @@ import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts identity needs no compact-support premise because all three pairings in the Haar-measure integration theorem are integrable. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryLogarithmicGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryLogarithmicGradient.lean index e52476ec89..bb0a557d90 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryLogarithmicGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryLogarithmicGradient.lean @@ -36,7 +36,7 @@ section /-! The small-time heat remainder from genuine third spatial L² derivatives. -/ -@[expose] public section +public section noncomputable section @@ -94,7 +94,7 @@ end end -@[expose] public section +public section noncomputable section @@ -223,7 +223,7 @@ section /-! Optimization of the actual heat-scale estimate used in the whole-space logarithmic gradient bound. -/ -@[expose] public section +public section noncomputable section @@ -272,7 +272,7 @@ end end -@[expose] public section +public section noncomputable section @@ -331,7 +331,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryMaximalVorticityIntegral.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryMaximalVorticityIntegral.lean index 8cb1bef133..fb5f02358b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryMaximalVorticityIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryMaximalVorticityIntegral.lean @@ -21,7 +21,7 @@ section half-open maximal Euler interval. All quantities agree exactly with the genuine smooth solutions on every shorter closed interval. -/ -@[expose] public section +public section noncomputable section @@ -165,7 +165,7 @@ its extended integral on the half-open interval to be infinite. Local integrability is explicit, so no totalized real integral is used as a substitute for an improper integral. -/ -@[expose] public section +public section noncomputable section @@ -204,7 +204,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothLimit.lean index 030e9ffef0..85d570414d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothLimit.lean @@ -14,7 +14,7 @@ every Sobolev order has a single genuine smooth limit path. All its tensor jets are continuous in time and are the strong limits of the corresponding jets of the sequence. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean index 7a799d8a2a..10b923d053 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real The word fields retain all genuine L² derivatives; no Sobolev regularity or distributional derivative is postulated. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open MeasureTheory ContinuousLinearMap EulerSmoothLimit EulerLpTranslation open scoped ContDiff ENNReal /-- Axis, given by `EuclideanSpace.single i 1`. -/ -def axis (i : Fin 3) : Space := EuclideanSpace.single i 1 +@[expose] def axis (i : Fin 3) : Space := EuclideanSpace.single i 1 @[simp] theorem axis_norm (i : Fin 3) : ‖axis i‖ = 1 := by simp [axis] @@ -109,7 +109,7 @@ def wordSize (s : ℕ) (A : SmoothL2Field V) : ℝ := ∑ n ∈ range (s+1), ∑ w : Fin n → Fin 3, ‖(wordField A w).toLp‖ /-- Word energy, given by `∑ n ∈ range (s+1), ∑ w : Fin n → Fin 3, ‖(wordField A w).toLp‖^2`. -/ -def wordEnergy (s : ℕ) (A : SmoothL2Field V) : ℝ := +@[expose] def wordEnergy (s : ℕ) (A : SmoothL2Field V) : ℝ := ∑ n ∈ range (s+1), ∑ w : Fin n → Fin 3, ‖(wordField A w).toLp‖^2 /-- Word bound, given by `∀ n ≤ s, ∀ w : Fin n → Fin 3, ‖(wordField A w).toLp‖ ≤ M`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean index b83f3fbc0d..801d1e051f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean @@ -15,7 +15,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm L⁶ inequality is extended from compact fields by genuine cutoff limits; the L⁴ bound and product estimate therefore require no support hypothesis. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevTower.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevTower.lean index 1dfc7caead..223e523938 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevTower.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevTower.lean @@ -16,7 +16,7 @@ The unit-cylinder lift is only a realization in an already complete Sobolev space; the resulting ordinary field equals the prescribed L² path. -/ -@[expose] public section +public section noncomputable section @@ -90,7 +90,7 @@ end SobolevTower /-- Ordinary tensor operator as an element of `SobolevSpace 1 q →L[ℝ] Lp (Space [×q]→L[ℝ] Space) 2 (volume : Measure Space)`. -/ -def ordinaryTensorOperator (q : ℕ) : +@[expose] def ordinaryTensorOperator (q : ℕ) : SobolevSpace 1 q →L[ℝ] Lp (Space [×q]→L[ℝ] Space) 2 (volume : Measure Space) := (tensorLpReassembly (V := Space) (volume : Measure Space) q).comp (ContinuousLinearMap.pi (fun w : Fin q → Fin 3 => ordinaryWordOperator w)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryStrongTime.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryStrongTime.lean index 389c87292f..b5f86fafdb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryStrongTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryStrongTime.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.InjectivePathDerivativeWithin the proposed derivative has continuous actual spatial jets. Bounded Sobolev evaluation then supplies the classical pointwise time law. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameEnergy.lean index fc5c737ece..57c58556b7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameEnergy.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryWordConstraints The pressure and top transport term cancel. All remaining products are controlled by the proved L² interpolation of derivative words. -/ -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ theorem tameEnergyConstant_nonneg (m : ℕ) : 0 ≤ tameEnergyConstant m := /-- Integer energy production, given by `2*(∑ n ∈ range (m+1), ∑ w : Fin n → Fin 3, ⟪(wordField A w).toLp,(wordField Q w).toLp⟫_ℝ)`. -/ -def integerEnergyProduction (m : ℕ) (A Q : SmoothL2Field Space) : ℝ := +@[expose] def integerEnergyProduction (m : ℕ) (A Q : SmoothL2Field Space) : ℝ := 2*(∑ n ∈ range (m+1), ∑ w : Fin n → Fin 3, ⟪(wordField A w).toLp,(wordField Q w).toLp⟫_ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameProduct.lean index 81a9c288e0..2cc2e84090 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTameProduct.lean @@ -15,7 +15,7 @@ H³ and the high norm has any integer order at least three. The only interpolation input is the integration-by-parts theorem in `OrdinaryWordInterpolation`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTransportCancellation.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTransportCancellation.lean index 992f08e956..9b7503a33b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTransportCancellation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryTransportCancellation.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryL2Integration /-! The exact ordinary transport energy cancellation on noncompact smooth L² fields. Products and all required pairings are actual L²/L¹ objects. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVariableGronwall.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVariableGronwall.lean index bdfeb52cca..8eb2211132 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVariableGronwall.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVariableGronwall.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryEulerL2Stability /-! A variable-coefficient Gronwall estimate from a genuine one-sided time derivative. The integrating factor uses the actual time integral. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVorticityCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVorticityCoordinates.lean index ae88408083..ae066bcece 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVorticityCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryVorticityCoordinates.lean @@ -14,7 +14,7 @@ public import Mathlib.Analysis.InnerProductSpace.Laplacian /-! Scalar components of genuine smooth velocity and vorticity fields, their exact elliptic identity, and a fixed coordinate operator bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean index f3f4523b00..363a5eae7e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean @@ -15,7 +15,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! Fixed finite-order bounds for genuine ordinary L² derivative words. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordConstraints.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordConstraints.lean index c237027d2c..f0cadc2a2b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordConstraints.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordConstraints.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterWordCalculus /-! Every genuine derivative word preserves the ordinary Helmholtz constraint, and consequently the pressure pairing vanishes at every order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordInterpolation.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordInterpolation.lean index 542f4d9c87..797bef2c52 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordInterpolation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordInterpolation.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OrdinaryWordBounds by parts gives log-convexity of the largest norm at each order. This yields endpoint product estimates without a change of Sobolev order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordTime.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordTime.lean index 72dcd9e4a2..2def9b70b8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordTime.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add /-! Strong time differentiation of every actual ordinary L² word, derived from the pointwise evolution and continuous L² spatial jets. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PDESubintervalEnergyLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/PDESubintervalEnergyLimit.lean index 5297ad9f9f..20c6427cfb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PDESubintervalEnergyLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PDESubintervalEnergyLimit.lean @@ -24,7 +24,7 @@ section /-! Exact signed Gevrey integral energy for actual finite-Sobolev viscous solutions. -/ -@[expose] public section +public section noncomputable section @@ -148,7 +148,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationConstructed.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationConstructed.lean index 929494b882..493015bd2c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationConstructed.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationConstructed.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketActivationInitial activation time. The initial matching statements concern the actual source history and its continuation, with no normal-choice premise. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationInitial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationInitial.lean index 47c8e53814..87d77ee209 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationInitial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationInitial.lean @@ -35,7 +35,7 @@ existing zero-endpoint Hilbert space; the proved energy coercivity then identifies all constructions of the same weak solution. -/ -@[expose] public section +public section noncomputable section @@ -153,7 +153,7 @@ section /-! The stationary path selected by the actual activation argument is the same history used by the packet, after matching its physical terminal trace. -/ -@[expose] public section +public section noncomputable section @@ -256,7 +256,7 @@ end end -@[expose] public section +public section noncomputable section @@ -376,7 +376,7 @@ section strain error and compression bounds imply the compressed terminal-matrix hypotheses, so no abstract endpoint matrix or plane isometry is supplied. -/ -@[expose] public section +public section noncomputable section @@ -469,7 +469,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationLipschitz.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationLipschitz.lean index 9e4d63d37c..11d8bbb3d3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationLipschitz.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationLipschitz.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryLipschitz constants below are computed from the supplied smooth coefficient paths; no continuity or estimate for the solved history is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationRay.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationRay.lean index c55ed631f2..c03f45acd9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationRay.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationRay.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitialGeometry It has unit length and its inverse-transpose transport is exactly the prescribed old-frame cross direction, with a positive scale. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ def activationDirection (F : Space ≃L[ℝ] Space) (n : Space) : Space := unit (F.toContinuousLinearMap.adjoint n) /-- Activation ray scale, given by `‖F.toContinuousLinearMap.adjoint n‖⁻¹`. -/ -def activationRayScale (F : Space ≃L[ℝ] Space) (n : Space) : ℝ := +@[expose] def activationRayScale (F : Space ≃L[ℝ] Space) (n : Space) : ℝ := ‖F.toContinuousLinearMap.adjoint n‖⁻¹ theorem inverse_adjoint_forward_adjoint (F : Space ≃L[ℝ] Space) (n : Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationSourceData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationSourceData.lean index 2fac9087b9..36cc99b0bc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketActivationSourceData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketActivationSourceData.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketHistoryData normal. The new reference plane is the literal orthogonal complement, and the history hypotheses are inherited without any new analytic input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketActualFrameEstimates.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketActualFrameEstimates.lean index 4e3200056c..578bfb0368 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketActualFrameEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketActualFrameEstimates.lean @@ -16,7 +16,7 @@ physical vectors. The third ratio is eliminated using actual tangency, and the scalar estimate is transported through the checked exact formulas. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketAngularPotential.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketAngularPotential.lean index 2de247a042..59e5d3b397 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketAngularPotential.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketAngularPotential.lean @@ -14,7 +14,7 @@ section /-! Uniform bounds for the actual mean-zero angular primitive. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ end end -@[expose] public section +public section noncomputable section @@ -70,7 +70,7 @@ open EulerSmoothLimit EulerPacketCrossProduct EulerAngleMeanZeroPrimitive MeasureTheory Set InnerProductSpace /-- Potential, given by `primitive P (fun θ => potentialMultiplier m (A θ))`. -/ -def potential (P : ℝ) (m : Space) (A : ℝ → Space) : ℝ → Space := +@[expose] def potential (P : ℝ) (m : Space) (A : ℝ → Space) : ℝ → Space := primitive P (fun θ => potentialMultiplier m (A θ)) theorem potential_hasDerivAt (P : ℝ) (m : Space) (A : ℝ → Space) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketApproximationBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketApproximationBounds.lean index 19a183468c..806dc6d0bb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketApproximationBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketApproximationBounds.lean @@ -20,7 +20,7 @@ section /-! Inverse-frame normalized approximation bounds are independent of truncation length. -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketBaseGuardScales.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketBaseGuardScales.lean index ee5e1721df..b4700bbb5c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketBaseGuardScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketBaseGuardScales.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics /-! The literal base horizon and core radius satisfy the local-existence and localized coercivity guards after the final choice of the base scale. -/ -@[expose] public section +public section noncomputable section @@ -26,14 +26,14 @@ open Filter Real EulerPacketBaseScales EulerPacketSourceScaleSequence open scoped Topology /-- Base horizon, given by `6*(J : ℝ)^2*X^(-498 : ℝ)`. -/ -def baseHorizon (J : ℕ) (X : ℝ) : ℝ := 6*(J : ℝ)^2*X^(-498 : ℝ) +@[expose] def baseHorizon (J : ℕ) (X : ℝ) : ℝ := 6*(J : ℝ)^2*X^(-498 : ℝ) /-- Base radius, given by `X^(-1000 : ℝ)`. -/ -def baseRadius (X : ℝ) : ℝ := X^(-1000 : ℝ) +@[expose] def baseRadius (X : ℝ) : ℝ := X^(-1000 : ℝ) /-- Base guard cost, given by `K*(baseHorizon J X^2/2)+Be*baseHorizon J X + Cboundary*(CM*X^1000+2)*baseRadius X^3*baseHorizon J X`. -/ -def baseGuardCost (J : ℕ) (K Be CM Cboundary X : ℝ) : ℝ := +@[expose] def baseGuardCost (J : ℕ) (K Be CM Cboundary X : ℝ) : ℝ := K*(baseHorizon J X^2/2)+Be*baseHorizon J X + Cboundary*(CM*X^1000+2)*baseRadius X^3*baseHorizon J X diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketBeforeTargetSize.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketBeforeTargetSize.lean index 0b06f52380..29ff67a72d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketBeforeTargetSize.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketBeforeTargetSize.lean @@ -22,7 +22,7 @@ section /-! Uniform comparison between actual and ideal physical primary sizes. -/ -@[expose] public section +public section noncomputable section @@ -139,7 +139,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketBudgetTimeChange.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketBudgetTimeChange.lean index 55e44721e3..5ae8bcd20e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketBudgetTimeChange.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketBudgetTimeChange.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketTimeProfiles /-! Time-endpoint equality transports the actual path norm and its profile without changing any bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketChildFieldMatch.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketChildFieldMatch.lean index 25a586849d..3181540175 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketChildFieldMatch.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketChildFieldMatch.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketExactEulerianField physical velocity gradient and scalar-pressure Hessian retain the normalized packet's size: neither receives a negative power of ell. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerLagrangian /-- Add velocity, given by `u x+ell • w (ell⁻¹ • x)`. -/ -def addVelocity (ell : ℝ) (u w : Space → Space) (x : Space) : Space := +@[expose] def addVelocity (ell : ℝ) (u w : Space → Space) (x : Space) : Space := u x+ell • w (ell⁻¹ • x) /-- Add pressure, given by `p x+ell^2*q (ell⁻¹ • x)`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketChildLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketChildLowBounds.lean index ed885bb520..1775873e0a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketChildLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketChildLowBounds.lean @@ -16,7 +16,7 @@ fields. On good times only the negative part of f' can increase the upper pressure bound; history and early times use the exponentially small target ratio. No child low bound is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCoarseMajorant.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCoarseMajorant.lean index 74b9a400f1..43b1e594e5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCoarseMajorant.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCoarseMajorant.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Bound /-! A polynomial base controls every surviving finite packet grade after the final factorial split. -/ -@[expose] public section +public section namespace EulerPacketCoarseMajorant @@ -24,7 +24,7 @@ open EulerGevrey /-- Its N-degree is 220, leaving room in the source's exponent 300 for finite sums. -/ -def gradeBase (R : ℝ) (N : ℕ) : ℝ := (4*R*(550*(N : ℝ))^2)^110 +@[expose] def gradeBase (R : ℝ) (N : ℕ) : ℝ := (4*R*(550*(N : ℝ))^2)^110 theorem gradeBase_nonneg (R : ℝ) (N : ℕ) : 0 ≤ gradeBase R N := by unfold gradeBase diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientLipschitz.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientLipschitz.lean index 0b93ea4f8d..cc5a136f18 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientLipschitz.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientLipschitz.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransverseSourceCoefficientPat /-! Uniform label difference estimates from genuine coefficient derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientMotion.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientMotion.lean index eb6eae2f18..5de7680958 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientMotion.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientMotion.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.PacketCoefficientControl /-! Normalized coefficient motion from genuine one-sided time derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientTower.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientTower.lean index 05b8aa1fc7..b08330c9e9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientTower.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCoefficientTower.lean @@ -24,7 +24,7 @@ section /-! Operator-norm continuity into a finite Sobolev space is equivalent to continuity of all its actual derivative-coordinate operators. -/ -@[expose] public section +public section noncomputable section @@ -116,7 +116,7 @@ end end -@[expose] public section +public section noncomputable section @@ -230,7 +230,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCofactorOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCofactorOperator.lean index fad0e364e4..8f730119f1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCofactorOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCofactorOperator.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketPotentialMultiplier This realizes the cofactor as an actual bounded bilinear map; its estimates therefore require no derivatives or norm bounds for a separately given inverse. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,7 @@ def basis (i : Fin 3) : Space := EuclideanSpace.single i 1 simp [basis] /-- Row linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def rowLinear (i : Fin 3) : Space →ₗ[ℝ] EndSpace where +@[expose] def rowLinear (i : Fin 3) : Space →ₗ[ℝ] EndSpace where toFun a := (innerSL ℝ a).smulRight (basis i) map_add' a b := by apply ContinuousLinearMap.ext @@ -78,7 +78,7 @@ theorem rowLinear_norm (i : Fin 3) (a : Space) : ‖rowLinear i a‖ ≤ ‖a‖ /-- Row operator, given by `(rowLinear i).mkContinuous 1 (fun a => by simpa only [one_mul] using rowLinear_norm i a)`. -/ -def rowOperator (i : Fin 3) : Space →L[ℝ] EndSpace := +@[expose] def rowOperator (i : Fin 3) : Space →L[ℝ] EndSpace := (rowLinear i).mkContinuous 1 (fun a => by simpa only [one_mul] using rowLinear_norm i a) @[simp] theorem rowOperator_apply (i : Fin 3) (a v : Space) : @@ -88,14 +88,14 @@ theorem rowOperator_norm (i : Fin 3) (a : Space) : ‖rowOperator i a‖ ≤ ‖ rowLinear_norm i a /-- Cofactor value, constructed using `rowOperator`. -/ -def cofactorValue (A B : EndSpace) : EndSpace := +@[expose] def cofactorValue (A B : EndSpace) : EndSpace := rowOperator 0 (crossOperator (A (basis 1)) (B (basis 2))) + rowOperator 1 (crossOperator (A (basis 2)) (B (basis 0))) + rowOperator 2 (crossOperator (A (basis 0)) (B (basis 1))) /-- Cofactor linear, bundling `toFun`, `map_add`, `map_smul`, `map_add` and the required compatibility proofs. -/ -def cofactorLinear : EndSpace →ₗ[ℝ] EndSpace →ₗ[ℝ] EndSpace where +@[expose] def cofactorLinear : EndSpace →ₗ[ℝ] EndSpace →ₗ[ℝ] EndSpace where toFun A := { toFun := cofactorValue A map_add' B C := by @@ -119,7 +119,7 @@ theorem cofactorValue_norm (A B : EndSpace) : ‖cofactorValue A B‖ ≤ 3*‖A have h (i j k : Fin 3) : ‖rowOperator i (crossOperator (A (basis j)) (B (basis k)))‖ ≤ ‖A‖*‖B‖ := by apply (rowOperator_norm i _).trans - change ‖cross (A (basis j)) (B (basis k))‖ ≤ ‖A‖*‖B‖ + simp only [crossOperator_apply, crossLeft_apply] exact (cross_norm_le _ _).trans (mul_le_mul (by simpa only [basis_norm,mul_one] using A.le_opNorm (basis j)) (by simpa only [basis_norm,mul_one] using B.le_opNorm (basis k)) @@ -132,7 +132,7 @@ theorem cofactorValue_norm (A B : EndSpace) : ‖cofactorValue A B‖ ≤ 3*‖A _ ≤ 3*‖A‖*‖B‖ := by nlinarith [h 0 1 2,h 1 2 0,h 2 0 1] /-- Cofactor bilinear, given by `cofactorLinear.mkContinuous₂ 3 cofactorValue_norm`. -/ -def cofactorBilinear : EndSpace →L[ℝ] EndSpace →L[ℝ] EndSpace := +@[expose] def cofactorBilinear : EndSpace →L[ℝ] EndSpace →L[ℝ] EndSpace := cofactorLinear.mkContinuous₂ 3 cofactorValue_norm @[simp] theorem cofactorBilinear_apply (A B : EndSpace) : cofactorBilinear A B = cofactorValue A B diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCommonRadius.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCommonRadius.lean index d252d195fd..a93ac92829 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCommonRadius.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCommonRadius.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OperatorGevreyCalculus /-! Monotone enlargement of the actual source budgets and a common external radius for the mean, forced transverse and nonlinear packet estimates. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ variable {P Tc : ℝ} [Fact (0 < P)] {O : Operators} {C : CoefficientData P Tc O /-- Every summand is a fixed source quantity. There is no occurrence of the new target radius, the forcing amplitude, or the recursive grade on the right. -/ -def commonRadius : ℝ := +@[expose] def commonRadius : ℝ := Rm + L.R + CB.termCost + sobolevCoefficientRadius (Fin 4) CB.Rc + M.velocityCost + M.derivativeCost + M.pressureGradientCost + L.commonCost + L.correctorAmplitude (P := P) N + diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketContinuousInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketContinuousInverse.lean index 787cf18847..0cf4933dcf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketContinuousInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketContinuousInverse.lean @@ -28,7 +28,7 @@ the actual equation `DY = A ∘ Y`, determines joint continuity of every spatial derivative of `Y`. -/ -@[expose] public section +public section noncomputable section @@ -109,7 +109,7 @@ spatial jets. Their evaluation, together with the actual inverse identity, supplies all inverse-flow continuity hypotheses used by Sobolev transport. -/ -@[expose] public section +public section noncomputable section @@ -164,7 +164,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCoordinateResidual.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCoordinateResidual.lean index 4d4da6e486..3090c45b26 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCoordinateResidual.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCoordinateResidual.lean @@ -22,7 +22,7 @@ section derivative is derived from the prescribed deformation, including at the endpoints of the actual time interval. -/ -@[expose] public section +public section noncomputable section @@ -165,7 +165,7 @@ end end -@[expose] public section +public section noncomputable section @@ -190,12 +190,12 @@ def transport (κ : ℝ) (Z : VectorField) (z : Domain) : Space := fderiv ℝ (fun y => Z (z.1,y)) z.2 (κ • Z z,⟪D.m₀,Z z⟫_ℝ) /-- Algebraic, given by `∑ i : Fin 3, (Z z) i • rawQuadratic D κ i z (Z z)`. -/ -def algebraic (κ : ℝ) (Z : VectorField) (z : Domain) : Space := +@[expose] def algebraic (κ : ℝ) (Z : VectorField) (z : Domain) : Space := ∑ i : Fin 3, (Z z) i • rawQuadratic D κ i z (Z z) /-- Coordinate pressure, given by `k • pressureGradient p z + k^2 • ((pressureJet p z).2 angleDirection • D.m₀)`. -/ -def coordinatePressure (k : ℝ) (p : ScalarField) (z : Domain) : Space := +@[expose] def coordinatePressure (k : ℝ) (p : ScalarField) (z : Domain) : Space := k • pressureGradient p z + k^2 • ((pressureJet p z).2 angleDirection • D.m₀) /-- Lifted pressure, given by `κ • pressureGradient p z + (pressureJet p z).2 angleDirection • diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientBudget.lean index b387bf67b1..5e8a51c58c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientBudget.lean @@ -32,7 +32,7 @@ single enlargement of the coefficient radius gives fixed-base Sobolev bounds, independent of the jet truncation. -/ -@[expose] public section +public section noncomputable section @@ -156,7 +156,7 @@ The positive-order coefficient normalization is paid once by a fixed coefficient radius, independent of the solution amplitude and grade. -/ -@[expose] public section +public section noncomputable section @@ -252,7 +252,7 @@ section /-! Actual coefficient-orbit bounds control the fixed H5/H6 pressure constants uniformly over all higher jet truncations. -/ -@[expose] public section +public section noncomputable section @@ -316,7 +316,7 @@ section /-! Quantitative bounds for the actual packet coefficient towers. -/ -@[expose] public section +public section noncomputable section @@ -370,7 +370,7 @@ end end -@[expose] public section +public section noncomputable section @@ -419,28 +419,28 @@ structure CorrectionCoefficientBudget (D : EulerTransversePacketProvider.Data U) /-- Correction metric envelope, given by `sobolevCoefficientAmplitude (Fin 4) 6 (4*R) (3*CI*CI)`. -/ -def correctionMetricEnvelope (R CI : ℝ) : ℝ := +@[expose] def correctionMetricEnvelope (R CI : ℝ) : ℝ := sobolevCoefficientAmplitude (Fin 4) 6 (4*R) (3*CI*CI) /-- Correction linear envelope, given by `2*sobolevCoefficientAmplitude (Fin 4) 6 (4*R) (6*CI*C1)`. -/ -def correctionLinearEnvelope (R C1 CI : ℝ) : ℝ := +@[expose] def correctionLinearEnvelope (R C1 CI : ℝ) : ℝ := 2*sobolevCoefficientAmplitude (Fin 4) 6 (4*R) (6*CI*C1) /-- Correction quadratic envelope, given by `6*sobolevCoefficientAmplitude (Fin 4) 6 (4*R) (3*CI*(C0*R))`. -/ -def correctionQuadraticEnvelope (R C0 CI : ℝ) : ℝ := +@[expose] def correctionQuadraticEnvelope (R C0 CI : ℝ) : ℝ := 6*sobolevCoefficientAmplitude (Fin 4) 6 (4*R) (3*CI*(C0*R)) /-- Correction coefficient radius, given by `max 1 (max (normalizedCoefficientRadius 6 (4*R) (3*CI*CI)) (sobolevCoefficientRadius (Fin 4) (4*R)))`. -/ -def correctionCoefficientRadius (R CI : ℝ) : ℝ := +@[expose] def correctionCoefficientRadius (R CI : ℝ) : ℝ := max 1 (max (normalizedCoefficientRadius 6 (4*R) (3*CI*CI)) (sobolevCoefficientRadius (Fin 4) (4*R))) /-- Correction pressure envelope, given by `max 1 (max (pressureCost c (correctionMetricEnvelope R CI) 5) (pressureCost c (correctionMetricEnvelope R CI) 6))`. -/ -def correctionPressureEnvelope (c R CI : ℝ) : ℝ := +@[expose] def correctionPressureEnvelope (c R CI : ℝ) : ℝ := max 1 (max (pressureCost c (correctionMetricEnvelope R CI) 5) (pressureCost c (correctionMetricEnvelope R CI) 6)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientParity.lean index 341629554a..707bb4c606 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionCoefficientParity.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketParity /-! The source deformation symmetries imply the literal parity of the correction coefficients, including the odd differentiated quadratic term. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionConstants.lean index fe126ca7ef..04f3ce2245 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionConstants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionConstants.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketFiniteCoarseBounds /-! Fixed source costs for the normalized packet and its smaller transport drift. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ def velocity (R H C : ℝ) : ℝ := def normal (R H C : ℝ) : ℝ := C*(fixedVelocityGradeCost R H 2+2) /-- Drift, given by `2*(3*velocity R H C+normal R H C)`. -/ -def drift (R H C : ℝ) : ℝ := 2*(3*velocity R H C+normal R H C) +@[expose] def drift (R H C : ℝ) : ℝ := 2*(3*velocity R H C+normal R H C) theorem velocity_nonneg (R H C : ℝ) (hR : 0 ≤ R) (hC : 0 ≤ C) : 0 ≤ velocity R H C := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionGrowth.lean index fd2bfd34b6..69b493ed0a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionGrowth.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.NonlinearEnergyConstants /-! The exact nonlinear energy constant is a fixed source quantity, independent of the Sobolev order, truncation and oscillation frequency. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (Kc : CorrectionCoefficientBudget D P) /-- Growth coefficient as an element of `ℝ`. -/ -def growthCoefficient (B0 B1 : ℝ) : ℝ := +@[expose] def growthCoefficient (B0 B1 : ℝ) : ℝ := let c := D.inverseBound⁻¹ let first := inverseMetricFirstBound D energyConstant P diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionMetricBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionMetricBudget.lean index fae5146f09..03b7cbe1d7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionMetricBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionMetricBudget.lean @@ -20,7 +20,7 @@ section /-! The time derivative of the actual inverse pressure metric, first as a bounded matrix field and then as its cylinder L² multiplier. -/ -@[expose] public section +public section noncomputable section @@ -119,7 +119,7 @@ end end -@[expose] public section +public section noncomputable section @@ -173,7 +173,7 @@ def inverseMetricBound : ℝ := ‖(inverseMetricCoefficient D).path‖ /-- Inverse metric first bound, given by `‖iteratedFDeriv ℝ 1 (translateCoefficientPath (inverseMetricCoefficient D).path) 0‖`. -/ -def inverseMetricFirstBound : ℝ := +@[expose] def inverseMetricFirstBound : ℝ := ‖iteratedFDeriv ℝ 1 (translateCoefficientPath (inverseMetricCoefficient D).path) 0‖ /-- Inverse metric time bound, given by `‖(inverseMetricTimeCoefficient D).path‖`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionOutputPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionOutputPolynomial.lean index 65b4f19b0e..af733d198d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionOutputPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionOutputPolynomial.lean @@ -19,7 +19,7 @@ section /-! Fixed source constants in the smaller-radius estimates for the actual initialized all-order correction. They do not depend on the cutoff or frequency. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (Kc : CorrectionCoefficientBudget D P) /-- Correction base, given by `metricAmplification D.inverseBound⁻¹/2`. -/ -def correctionBase : ℝ := metricAmplification D.inverseBound⁻¹/2 +@[expose] def correctionBase : ℝ := metricAmplification D.inverseBound⁻¹/2 /-- Correction source cost, constructed using `sourceBound`. -/ def correctionSourceCost (R H C : ℝ) : ℝ := @@ -54,7 +54,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitiveBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitiveBounds.lean index c9e3a2fc74..db4e954360 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitiveBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitiveBounds.lean @@ -21,7 +21,7 @@ section /-! Quantitative bounds for the actual inverse metric and its first spatial and time derivatives, from the prescribed deformation jets. -/ -@[expose] public section +public section noncomputable section @@ -98,7 +98,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitivePolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitivePolynomial.lean index 20afff8634..c3dce3a828 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitivePolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionPrimitivePolynomial.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Fixed polynomials majorize all primitive coefficient constants of the packet correction. The pressure inverse is the genuine fixed-order recursion. -/ -@[expose] public section +public section noncomputable section @@ -31,17 +31,17 @@ def linearEnvelope (X : ℝ) : ℝ := correctionLinearEnvelope X X X /-- Quadratic envelope, given by `correctionQuadraticEnvelope X X X`. -/ def quadraticEnvelope (X : ℝ) : ℝ := correctionQuadraticEnvelope X X X /-- Radius envelope, given by `1+(1+metricEnvelope X)*(64*X)+64*X`. -/ -def radiusEnvelope (X : ℝ) : ℝ := 1+(1+metricEnvelope X)*(64*X)+64*X +@[expose] def radiusEnvelope (X : ℝ) : ℝ := 1+(1+metricEnvelope X)*(64*X)+64*X /-- Pressure envelope, given by `1+pressureCost ((1+X)^2)⁻¹ (metricEnvelope X) 5 + pressureCost ((1+X)^2)⁻¹ (metricEnvelope X) 6`. -/ -def pressureEnvelope (X : ℝ) : ℝ := +@[expose] def pressureEnvelope (X : ℝ) : ℝ := 1+pressureCost ((1+X)^2)⁻¹ (metricEnvelope X) 5 + pressureCost ((1+X)^2)⁻¹ (metricEnvelope X) 6 /-- Multiplier envelope, given by `3*sobolevCoefficientAmplitude (Fin 4) 6 X X`. -/ def multiplierEnvelope (X : ℝ) : ℝ := 3*sobolevCoefficientAmplitude (Fin 4) 6 X X /-- Term envelope, given by `2*(1+multiplierEnvelope X+9*productBlockConstant P*multiplierEnvelope X)`. -/ -def termEnvelope (P : ℝ) [Fact (0 < P)] (X : ℝ) : ℝ := +@[expose] def termEnvelope (P : ℝ) [Fact (0 < P)] (X : ℝ) : ℝ := 2*(1+multiplierEnvelope X+9*productBlockConstant P*multiplierEnvelope X) /-- Primitive envelope as an element of `ℝ`. -/ def primitiveEnvelope (P : ℝ) [Fact (0 < P)] (X : ℝ) : ℝ := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionScalar.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionScalar.lean index 3ddf7a7070..43e1224b5f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionScalar.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionScalar.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Explicit scalar choices for the actual drift-aware correction budget. The error target is exp(-sqrt X), with X=k^ϑ in the source construction. -/ -@[expose] public section +public section noncomputable section @@ -22,13 +22,13 @@ namespace EulerPacketCorrectionScalar open Set /-- Delta, given by `Real.exp (-Real.sqrt X)`. -/ -def delta (X : ℝ) : ℝ := Real.exp (-Real.sqrt X) +@[expose] def delta (X : ℝ) : ℝ := Real.exp (-Real.sqrt X) /-- Residual, given by `2*Real.exp (-(7/10)*X*Real.log k)`. -/ def residual (k X : ℝ) : ℝ := 2*Real.exp (-(7/10)*X*Real.log k) /-- Initial radius, given by `1/(1+8*R+4*M*Rc+Rc)`. -/ -def initialRadius (R M Rc : ℝ) : ℝ := 1/(1+8*R+4*M*Rc+Rc) +@[expose] def initialRadius (R M Rc : ℝ) : ℝ := 1/(1+8*R+4*M*Rc+Rc) theorem delta_pos (X : ℝ) : 0 < delta X := Real.exp_pos _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionSourceData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionSourceData.lean index e18feb39c2..bfd16d5f39 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionSourceData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCorrectionSourceData.lean @@ -16,7 +16,7 @@ section /-! Positivity and the literal inverse identity for the pressure metric. Both follow from the prescribed deformation and its two-sided inverse. -/ -@[expose] public section +public section noncomputable section @@ -133,7 +133,7 @@ end end -@[expose] public section +public section noncomputable section @@ -164,7 +164,7 @@ def correctionData (κ : ℝ) (hκ : |κ| ≤ 1) residual := residual /-- Correction data of fields, given by `correctionData D P κ hκ Z.toFieldTower G.toFieldTower`. -/ -def correctionDataOfFields (κ : ℝ) (hκ : |κ| ≤ 1) +@[expose] def correctionDataOfFields (κ : ℝ) (hκ : |κ| ≤ 1) {z r : VectorField} (Z : Field P D.T z) (G : Field P D.T r) : Data P D.T := correctionData D P κ hκ Z.toFieldTower G.toFieldTower diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCrossProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCrossProduct.lean index 410c631e2d..b9f3e655e0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCrossProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCrossProduct.lean @@ -12,7 +12,7 @@ import Mathlib.Geometry.Euclidean.Angle.Unoriented.CrossProduct /-! The ordinary Euclidean cross product as an actual bounded linear operator. -/ -@[expose] public section +public section noncomputable section @@ -22,7 +22,7 @@ namespace EulerPacketCrossProduct open EulerSmoothLimit InnerProductSpace Matrix WithLp /-- Cross, given by `toLp 2 (crossProduct (ofLp a) (ofLp b))`. -/ -def cross (a b : Space) : Space := toLp 2 (crossProduct (ofLp a) (ofLp b)) +@[expose] def cross (a b : Space) : Space := toLp 2 (crossProduct (ofLp a) (ofLp b)) theorem cross_norm_le (a b : Space) : ‖cross a b‖ ≤ ‖a‖*‖b‖ := by rw [cross, InnerProductGeometry.norm_ofLp_crossProduct] @@ -30,16 +30,16 @@ theorem cross_norm_le (a b : Space) : ‖cross a b‖ ≤ ‖a‖*‖b‖ := by (Real.sin_le_one _) /-- Cross linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def crossLinear (a : Space) : Space →ₗ[ℝ] Space where +@[expose] def crossLinear (a : Space) : Space →ₗ[ℝ] Space where toFun := cross a map_add' b c := by simp [cross, map_add] map_smul' c b := by simp [cross, map_smul] /-- Cross left, given by `(crossLinear a).mkContinuous ‖a‖ (cross_norm_le a)`. -/ -def crossLeft (a : Space) : Space →L[ℝ] Space := +@[expose] def crossLeft (a : Space) : Space →L[ℝ] Space := (crossLinear a).mkContinuous ‖a‖ (cross_norm_le a) -theorem crossLeft_apply (a b : Space) : crossLeft a b=cross a b := rfl +theorem crossLeft_apply (a b : Space) : crossLeft a b=cross a b := by rfl theorem crossLeft_norm_le (a : Space) : ‖crossLeft a‖ ≤ ‖a‖ := ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) (cross_norm_le a) @@ -62,11 +62,11 @@ theorem cross_negative_normalized (m a : Space) (hm : m ≠ 0) simp only [neg_mul, inv_mul_cancel₀ hnorm, neg_smul, one_smul, neg_neg] /-- Its normalization is exactly the linear map used inside the angular primitive for Q. -/ -def potentialMultiplier (m : Space) : Space →L[ℝ] Space := +@[expose] def potentialMultiplier (m : Space) : Space →L[ℝ] Space := (-((‖m‖^2)⁻¹)) • crossLeft m theorem potentialMultiplier_apply (m a : Space) : - potentialMultiplier m a=(-((‖m‖^2)⁻¹)) • cross m a := rfl + potentialMultiplier m a=(-((‖m‖^2)⁻¹)) • cross m a := by rfl theorem cross_potentialMultiplier (m a : Space) (hm : m ≠ 0) (ha : ⟪m, a⟫_ℝ = 0) : cross m (potentialMultiplier m a)=a := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderAngularRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderAngularRegularity.lean index 600b1f60e6..3e8746e3aa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderAngularRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderAngularRegularity.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod /-! Genuine periodicity and zero-mean identities for raw cylinder-path witnesses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderBoundTransfer.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderBoundTransfer.lean index a27f71c0e3..4d6b97f5c0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderBoundTransfer.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderBoundTransfer.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderWeightedLinear /-! Transfer quantitative bounds between genuine witnesses of the same raw field on the interval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientBounds.lean index decc792104..a14cf06542 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientBounds.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Norm-one coefficient constructions used by the actual slow and fast packet terms. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientData.lean index 6db61e05c2..25ca72e8fa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderCoefficientData.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.BoundedFieldCalculus /-! Actual bounded coefficient paths identified with the raw packet coefficients. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderConvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderConvolution.lean index 77e38d9f83..68530c060a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderConvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderConvolution.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderFieldAlgebra /-! Finite grade convolution of actual raw cylinder fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderField.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderField.lean index 726fdc8950..fb2dc37492 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderField.lean @@ -19,7 +19,7 @@ translation orbit, and equality with the raw field on the time interval. Time derivatives are an actual L² evolution identity, stated separately. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ structure Field (P T : ℝ) [Fact (0 < P)] (raw : VectorField) where variable {P T : ℝ} [Fact (0 < P)] {raw raw_t : VectorField} /-- The derivative witness is an actual within-interval derivative in the Hilbert L² space. -/ -def TimeDerivative (hT : 0 ≤ T) (G : Field P T raw) (H : Field P T raw_t) : Prop := +@[expose] def TimeDerivative (hT : 0 ≤ T) (G : Field P T raw) (H : Field P T raw_t) : Prop := ∀ t : Icc (0 : ℝ) T, HasDerivWithinAt (extendPath T hT G.path) (H.path t) (Icc (0 : ℝ) T) t diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAdvection.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAdvection.lean index 5bddc1db46..932129376c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAdvection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAdvection.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothCoefficientPath /-! Actual raw slow and normal-weighted angular advection on cylinder-path witnesses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAlgebra.lean index 9f3e49e04e..c3749fd203 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAlgebra.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ClassicalPressureCurl /-! Finite algebra on actual cylinder-path witnesses of raw packet fields. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ open scoped ContDiff variable {P T : ℝ} [Fact (0 < P)] {raw raw' : VectorField} /-- Recover a raw witness from an actual continuous representative of its L² path. -/ -def ofLifted (p : C(Icc (0 : ℝ) T, LiftL2 P)) +@[expose] def ofLifted (p : C(Icc (0 : ℝ) T, LiftL2 P)) (hp : ContDiff ℝ ∞ (fun a : LiftTangent => pathTranslate P a p)) (f : Icc (0 : ℝ) T → LiftDomain P → Space) (hc : ∀ t, Continuous (f t)) (hrep : ∀ t, (p t : LiftDomain P → Space) =ᵐ[liftMeasure P] f t) @@ -39,7 +39,7 @@ def ofLifted (p : C(Icc (0 : ℝ) T, LiftL2 P)) (hc t) (smoothField_continuous P _ (pointField_smooth P p hp t))) (x,(θ : AddCircle P))) /-- Equality is needed only on the actual closed time interval. -/ -def congr (G : Field P T raw) +@[expose] def congr (G : Field P T raw) (he : ∀ (t : Icc (0 : ℝ) T) x θ, raw' (t, (x, θ)) = raw (t, (x, θ))) : Field P T raw' where path := G.path @@ -47,14 +47,14 @@ def congr (G : Field P T raw) raw_eq t x θ := (he t x θ).trans (G.raw_eq t x θ) /-- Zero, constructed using `ofLifted`. -/ -def zero (P T : ℝ) [Fact (0 < P)] : Field P T (0 : VectorField) := +@[expose] def zero (P T : ℝ) [Fact (0 < P)] : Field P T (0 : VectorField) := ofLifted 0 (by simpa only [map_zero] using (contDiff_const : ContDiff ℝ ∞ (fun _ : LiftTangent => (0 : C(Icc (0 : ℝ) T,LiftL2 P))))) (fun _ _ => 0) (fun _ => continuous_const) (fun _ => Lp.coeFn_zero Space 2 (liftMeasure P)) (fun _ _ _ => rfl) /-- Add, constructed using `ofLifted`. -/ -def add (G : Field P T raw) (H : Field P T raw') : Field P T (raw+raw') := +@[expose] def add (G : Field P T raw) (H : Field P T raw') : Field P T (raw+raw') := ofLifted (G.path+H.path) (by simpa only [map_add] using G.orbit.add H.orbit) (fun t x => pointField P G.path G.orbit t x+pointField P H.path H.orbit t x) (fun t => (smoothField_continuous P _ (pointField_smooth P G.path G.orbit t)).add @@ -80,7 +80,7 @@ def sub (G : Field P T raw) (H : Field P T raw') : Field P T (raw-raw') := (G.add H.neg).congr (fun t x θ => by simp only [sub_eq_add_neg]) /-- Smul, constructed using `ofLifted`. -/ -def smul (G : Field P T raw) (c : ℝ) : Field P T (c • raw) := +@[expose] def smul (G : Field P T raw) (c : ℝ) : Field P T (c • raw) := ofLifted (c • G.path) (by simpa only [map_smul] using G.orbit.const_smul c) (fun t x => c • pointField P G.path G.orbit t x) (fun t => (smoothField_continuous P _ (pointField_smooth P G.path G.orbit t)).const_smul c) @@ -90,7 +90,7 @@ def smul (G : Field P T raw) (c : ℝ) : Field P T (c • raw) := (fun t x θ => by simp only [Pi.smul_apply,G.raw_eq]) /-- Literal finite raw sums have a single actual continuous L² witness. -/ -def finsetSum {ι : Type*} (s : Finset ι) (f : ι → VectorField) +@[expose] def finsetSum {ι : Type*} (s : Finset ι) (f : ι → VectorField) (G : ∀ i, Field P T (f i)) : Field P T (∑ i ∈ s, f i) := ofLifted (∑ i ∈ s, (G i).path) (by simpa only [map_sum] using ContDiff.sum (fun i _ => (G i).orbit)) @@ -111,10 +111,10 @@ def finsetSum {ι : Type*} (s : Finset ι) (f : ι → VectorField) exact sum_congr rfl (fun i _ => (G i).raw_eq t x θ)) @[simp] theorem add_path (G : Field P T raw) (H : Field P T raw') : - (G.add H).path = G.path+H.path := rfl + (G.add H).path = G.path+H.path := by rfl -@[simp] theorem neg_path (G : Field P T raw) : (G.neg).path = -G.path := rfl +@[simp] theorem neg_path (G : Field P T raw) : (G.neg).path = -G.path := by rfl -@[simp] theorem smul_path (G : Field P T raw) (c : ℝ) : (G.smul c).path = c • G.path := rfl +@[simp] theorem smul_path (G : Field P T raw) (c : ℝ) : (G.smul c).path = c • G.path := by rfl end EulerPacketCylinderField.Field diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAverage.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAverage.lean index 89958c9137..18bfecc158 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAverage.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldAverage.lean @@ -32,7 +32,7 @@ section /-! The bounded cylinder-to-space operator is the literal angular integral on smooth fields. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ section /-! The literal angular mean of a solved cylinder path is an actual smooth spatial L² path. -/ -@[expose] public section +public section noncomputable section @@ -173,7 +173,7 @@ end end -@[expose] public section +public section noncomputable section @@ -225,7 +225,7 @@ end end -@[expose] public section +public section noncomputable section @@ -264,6 +264,7 @@ def angleMean (G : Field P T raw) : Field P T (EulerPacketProfileRecursion.angle exact G.raw_eq t x s) /-- Subtracting the literal mean is an operation on the actual cylinder L² path. -/ +@[expose] def highPart (G : Field P T raw) : Field P T (raw-EulerPacketProfileRecursion.angleMean P raw) := G.sub G.angleMean diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldBounds.lean index b4a1938480..f1b78eb0b1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldBounds.lean @@ -22,7 +22,7 @@ section /-! Fixed bounded vector operations preserve the genuine nonlinear H6 word estimates. -/ -@[expose] public section +public section noncomputable section @@ -109,7 +109,7 @@ end end -@[expose] public section +public section noncomputable section @@ -125,7 +125,7 @@ variable {P T : ℝ} [Fact (0 < P)] {raw raw' : VectorField} /-- Word bound, given by `∀ n, block standardDirection q (fun a : LiftTangent => pathTranslate P a G.path) n 0 ≤ A*majorant R d n`. -/ -def WordBound (G : Field P T raw) (q : ℕ) (R A : ℝ) (d : ℕ) : Prop := +@[expose] def WordBound (G : Field P T raw) (q : ℕ) (R A : ℝ) (d : ℕ) : Prop := ∀ n, block standardDirection q (fun a : LiftTangent => pathTranslate P a G.path) n 0 ≤ A*majorant R d n diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldProducts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldProducts.lean index ee94cdec1c..9f60465fd1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldProducts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldProducts.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderCoveringDerivative /-! Actual nonlinear and coefficient operations on raw cylinder-path witnesses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldSupport.lean index 8efb277dcd..ec143ab05e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldSupport.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderLocalSupport /-! Support of a raw packet witness is exactly support of its actual L² path. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldUnique.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldUnique.lean index 2baec4d1a9..16ccc1f646 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldUnique.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldUnique.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderFieldAlgebra /-! A raw cylinder field determines its actual continuous L² path uniquely. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldWeight.lean index 7730f82251..c00c02ff65 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderFieldWeight.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevLinear /-! Actual time-profile multiplication of raw cylinder witnesses and their same-radius bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderForcingParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderForcingParity.lean index 16c455fc13..793de2db25 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderForcingParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderForcingParity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderTimeParity /-! The literal recursive force preserves joint odd parity from its actual prefix data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighForcing.lean index 0de02f343e..0da5d91d1f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighForcing.lean @@ -17,7 +17,7 @@ section /-! Genuine nonlinear cylinder products preserve support of their multiplying factor. -/ -@[expose] public section +public section noncomputable section @@ -105,7 +105,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighMean.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighMean.lean index 6e65a360a4..dcea5046c2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighMean.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighMean.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderKnownForce /-! The literal recursively constructed high forcing has zero angular mean. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighParity.lean index 30577d5a99..9491846425 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighParity.lean @@ -19,7 +19,7 @@ section /-! Literal angular averaging preserves the joint odd parity of a genuine periodic field. -/ -@[expose] public section +public section noncomputable section @@ -50,7 +50,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighPartBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighPartBounds.lean index 8e0a9ec9e4..7145d3878b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighPartBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderHighPartBounds.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderWeightedLinear /-! Bounds for literal high projection and for the zero fields in masked grade families. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetOperations.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetOperations.lean index f39fb20b42..fa96f6af3c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetOperations.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetOperations.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderCoefficientData /-! The literal linear, pressure and nonlinear jet expressions have actual cylinder-path witnesses. -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,7 @@ def fastAdvection {normal : VectorField} (N : VectorCoefficient T normal) end SpatialJetField /-- The actual spatial pressure gradient encoded by the pressure-only jet. -/ -def pressureGradient (p : ScalarField) : VectorField := fun z => +@[expose] def pressureGradient (p : ScalarField) : VectorField := fun z => (toDual ℝ Space).symm ((pressureJet p z).2.comp spatialInjection) namespace Field diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetParity.lean index ef16e77553..186c874c81 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderJetParity.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderSpatialJet /-! The actual spatial derivatives and nonlinear jet terms preserve joint odd velocity parity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownForce.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownForce.lean index c80557e306..959d619dbe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownForce.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownForce.lean @@ -19,7 +19,7 @@ previous corrector, its scalar-pressure gradient, and the actual coefficient paths enter. No equation or cancellation for the new profile is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownJets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownJets.lean index 2c166fce75..d2389279cb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderKnownJets.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderSpatialJet /-! Literal known-grade jet data are reconstructed from only the genuine prefix fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderLinearTermBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderLinearTermBudget.lean index 487f1d9360..27eb184421 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderLinearTermBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderLinearTermBudget.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderWeightedAdvection /-! The old-corrector time term and old pressure term use the same fixed coefficient budget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanSolenoidal.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanSolenoidal.lean index 2ab35fb1e0..a47883ff69 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanSolenoidal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanSolenoidal.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanPacketContract /-! The actual inverse-frame mean profiles satisfy the closed lifted divergence constraint. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanStep.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanStep.lean index d64ab9d482..51a2d532e8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanStep.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderMeanStep.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderHighMean /-! The recursive mean forcing is sent to the actual source inverse, then returned as a true cylinder field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderParity.lean index c2b543b6a8..1149387d1f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderParity.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderFieldReflection /-! Literal joint parity is equivalent to parity of an actual cylinder-path witness. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaCorrector.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaCorrector.lean index 6896e7a1b2..3367f23aad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaCorrector.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaCorrector.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderCoveringDerivative /-! The literal raw curl-corrector equals the genuine periodic Piola corrector. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaPair.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaPair.lean index 5b11cf2bb1..7205f2f11d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaPair.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPiolaPair.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderPiolaCorrector /-! Every actual compact high/corrector pair is a member of the closed lifted solenoidal space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPrefixLocality.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPrefixLocality.lean index 9b85f4f2b8..62ee631037 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPrefixLocality.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPrefixLocality.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderKnownJets /-! Compact high profiles and angle-independent means make the exterior nonlinear forcing constant in angle. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPressureLocality.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPressureLocality.lean index e6fa098b61..e5214eb95e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPressureLocality.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderPressureLocality.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderJetOperations /-! Spatial support and joint parity of the literal pressure-gradient term. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderProfileChange.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderProfileChange.lean index f180bdce3b..783f37f0cd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderProfileChange.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderProfileChange.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketGradeAbsorption /-! Comparison of the actual time profiles and absorption of a finite family at a fixed radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderRecursiveAdmissibility.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderRecursiveAdmissibility.lean index 8f0b9f6915..3ff154a19b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderRecursiveAdmissibility.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderRecursiveAdmissibility.lean @@ -22,7 +22,7 @@ actual angular mean. The remaining terms use only the already supported prefix high fields, correctors and physical pressure gradients. -/ -@[expose] public section +public section noncomputable section @@ -110,7 +110,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradient.lean index acb562dd00..21da1ca4f7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradient.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderCoveringDerivative /-! The literal spatial gradient of an actual scalar cylinder path is an actual vector path. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientBounds.lean index 4d1c9bfbcf..a0216bbec6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientBounds.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevFiniteSum /-! The actual scalar pressure gradient uses one external word and keeps the same radius. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ variable {K : Type*} [TopologicalSpace K] [CompactSpace K] /-- Scalar gradient path, given by `∑ i : Fin 3, pathMap P (gradientComponent i) (derivativePath P (pathMap P scalarEmbed p) i.succ)`. -/ -def scalarGradientPath : C(K,LiftL2 P) := ∑ i : Fin 3, +@[expose] def scalarGradientPath : C(K,LiftL2 P) := ∑ i : Fin 3, pathMap P (gradientComponent i) (derivativePath P (pathMap P scalarEmbed p) i.succ) include hp in diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientWeight.lean index ca6acd229b..d80ef337b3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderScalarGradientWeight.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.LpCylinderTimeWeight /-! Pressure-gradient bounds after literal time-profile division, with no profile extrema or time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialInvariance.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialInvariance.lean index f6a4e48cec..365ad19c15 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialInvariance.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialInvariance.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderField /-! Actual spatial jets outside a closed support and for angle-independent fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialJet.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialJet.lean index a541f5c5fa..4b48342540 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialJet.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderSpatialJet.lean @@ -15,7 +15,7 @@ The nonlinear terms use the value and spatial/angular part of each jet. These are reconstructed from actual raw-path witnesses and finite sums. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTermBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTermBudget.lean index 501ddea681..ebc3d2308e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTermBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTermBudget.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderWeightedAdvection /-! A single coefficient cost bounds every elementary nonlinear packet term. -/ -@[expose] public section +public section noncomputable section @@ -46,15 +46,15 @@ namespace CoefficientBudget variable {C : CoefficientData P T O} (B : CoefficientBudget C) /-- Multiplier cost, given by `3*sobolevCoefficientAmplitude (Fin 4) 6 B.Rc B.amplitude`. -/ -def multiplierCost : ℝ := 3*sobolevCoefficientAmplitude (Fin 4) 6 B.Rc B.amplitude +@[expose] def multiplierCost : ℝ := 3*sobolevCoefficientAmplitude (Fin 4) 6 B.Rc B.amplitude /-- Slow cost, given by `9*productBlockConstant P*B.multiplierCost`. -/ -def slowCost : ℝ := 9*productBlockConstant P*B.multiplierCost +@[expose] def slowCost : ℝ := 9*productBlockConstant P*B.multiplierCost /-- Fast cost, given by `3*productBlockConstant P*B.multiplierCost`. -/ -def fastCost : ℝ := 3*productBlockConstant P*B.multiplierCost +@[expose] def fastCost : ℝ := 3*productBlockConstant P*B.multiplierCost /-- Linear cost, given by `1+B.multiplierCost`. -/ -def linearCost : ℝ := 1+B.multiplierCost +@[expose] def linearCost : ℝ := 1+B.multiplierCost /-- Term cost, given by `2*(1+B.multiplierCost+B.slowCost)`. -/ -def termCost : ℝ := 2*(1+B.multiplierCost+B.slowCost) +@[expose] def termCost : ℝ := 2*(1+B.multiplierCost+B.slowCost) omit [Fact (0 < P)] in theorem multiplierCost_nonneg : 0 ≤ B.multiplierCost := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeParity.lean index 58e5a0aaba..61285ef128 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeParity.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Genuine within-time derivatives inherit the raw field's joint parity, including at the endpoints. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeUnique.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeUnique.lean index 7b58f56a30..6697001c90 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeUnique.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderTimeUnique.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderFieldUnique /-! Genuine time-derivative witnesses are unique, including at both endpoints. -/ -@[expose] public section +public section namespace EulerPacketCylinderField.TimeDerivative diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedAdvection.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedAdvection.lean index f7e52d8cb2..63aa46d4f5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedAdvection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedAdvection.lean @@ -17,7 +17,7 @@ section /-! Products of actual normalized fields use only the pointwise ratio of their time profiles. -/ -@[expose] public section +public section noncomputable section @@ -150,7 +150,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedLinear.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedLinear.lean index b51197d6b3..38f143ca92 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedLinear.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketCylinderWeightedLinear.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevLinear /-! Linear operations and spatial derivatives of actual profile-normalized packet fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactEulerianField.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactEulerianField.lean index a7d82b901e..c9ceff3fbf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExactEulerianField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExactEulerianField.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketContinuousInverse /-! Literal agreement between the exact physical Euler fields and their constructed smooth L² representatives, including the scalar pressure. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalEuler.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalEuler.lean index c7426f549e..f74d3b4c9c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalEuler.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalEuler.lean @@ -21,7 +21,7 @@ section /-! The actual exact packet remains incompressible after the genuine unit-Jacobian parent-flow coordinate change. -/ -@[expose] public section +public section noncomputable section @@ -92,7 +92,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalMomentum.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalMomentum.lean index 64bf11b108..06000ba188 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalMomentum.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExactPhysicalMomentum.lean @@ -21,7 +21,7 @@ section flow. Symmetry of the genuine second derivative supplies the mixed-derivative identity; no independent strain evolution is assumed. -/ -@[expose] public section +public section noncomputable section @@ -128,7 +128,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactPressureError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactPressureError.lean index a54f50f887..1c8ef05b03 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExactPressureError.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExactPressureError.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFieldGraphBounds finite pressure's Hessian plus the Hessian of its actual correction. The normalization of the scalar potential does not affect this identity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactShearError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactShearError.lean index 7b568c031a..d92b725cf3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExactShearError.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExactShearError.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFieldGraphBounds /-! The exact corrected packet has the same primary shear, with the literal finite-tail and correction derivatives as its only errors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExactSourceEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExactSourceEquation.lean index ab83b689e9..2d8d33699d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExactSourceEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExactSourceEquation.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPiolaData /-! The actual pointwise equation of the exact packet, expressed with the prescribed deformation and its genuine time and spatial derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketExponentialTail.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketExponentialTail.lean index 42c36e458c..6e97861677 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketExponentialTail.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketExponentialTail.lean @@ -11,7 +11,7 @@ public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! The source's exponential tail follows quantitatively from its polynomial grade base. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldDrift.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldDrift.lean index 1077d27ce2..eb42b970b3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldDrift.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldDrift.lean @@ -23,7 +23,7 @@ section /-! The actual four-component transport vector retains the small normal component separately from its three scaled spatial components. -/ -@[expose] public section +public section noncomputable section @@ -122,7 +122,7 @@ section /-! Exact bounded-map naturality of every genuine Sobolev coordinate of an actual packet field. -/ -@[expose] public section +public section noncomputable section @@ -163,7 +163,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldGraphBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldGraphBounds.lean index 13390135d5..46b9c6eb8c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldGraphBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldGraphBounds.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFieldSobolev /-! Pointwise physical graph bounds for the actual packet fields. The estimates use the constructed Sobolev tower and its canonical representative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldJetLp.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldJetLp.lean index 681f74846e..35fea6d0eb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldJetLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldJetLp.lean @@ -25,7 +25,7 @@ section /-! Actual cylinder L² tensor bounds from the finite packet's ordered-word budgets. The single coordinate conversion affects only the input radius. -/ -@[expose] public section +public section noncomputable section @@ -67,7 +67,7 @@ section /-! Addition and transport of the actual cylinder derivative tensors. All norm statements concern genuine L² functions on the cylinder. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldParityAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldParityAlgebra.lean index f306829fb3..c57bb18d81 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldParityAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldParityAlgebra.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFiniteParity /-! Oddness of actual cylinder paths is preserved by scalar multiplication, time identification, and multiplication by an even matrix coefficient. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean index 9161a14e9f..0af32721ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean @@ -18,7 +18,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm word bounds. The constants are finite polynomials at each fixed order; the oscillating phase costs only the indicated power of its frequency. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ namespace EulerPhysicalL2Scaling open Finset MeasureTheory EulerSmoothLimit /-- Derivative sum, given by `∑ n ∈ range (m+1), lpNorm (iteratedFDeriv ℝ n f) 2 volume`. -/ -def derivativeSum {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] +@[expose] def derivativeSum {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] (m : ℕ) (f : Space → V) : ℝ := ∑ n ∈ range (m+1), lpNorm (iteratedFDeriv ℝ n f) 2 volume @@ -46,7 +46,7 @@ theorem jetPolynomial_nonneg (R : ℝ) (hR : 0 ≤ R) (m : ℕ) : /-- Physical derivative cost, given by `∑ n ∈ range (m+1), (4*C)^n*Real.sqrt (2/P+2*P)*jetPolynomial R (n+1)`. -/ -def physicalDerivativeCost (P R C : ℝ) (m : ℕ) : ℝ := +@[expose] def physicalDerivativeCost (P R C : ℝ) (m : ℕ) : ℝ := ∑ n ∈ range (m+1), (4*C)^n*Real.sqrt (2/P+2*P)*jetPolynomial R (n+1) theorem physicalDerivativeCost_nonneg (P R C : ℝ) (hR : 0 ≤ R) (hC : 0 ≤ C) (m : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolev.lean index f0e9bd462e..775e537cfc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolev.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderFieldProducts /-! Exact identification of the packet's ordered-word blocks with the genuine Sobolev blocks used in the correction energy. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolevBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolevBudget.lean index 9a0109be2b..444a38de4b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolevBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldSobolevBudget.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Actual packet word bounds give the finite weighted Sobolev budgets used by the nonlinear correction, with no change to the spatial radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTensorBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTensorBounds.lean index e952b1fa80..95877ac7c9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTensorBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTensorBounds.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Full space-angle derivative tensors are bounded by the actual packet word budgets. This includes the scalar pressure via its norm-one embedding. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTower.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTower.lean index 8f8a87b69f..3058f439f5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTower.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldTower.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderField /-! The actual smooth cylinder paths produced by the packet construction give coherent continuous Sobolev realizations at every finite order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteApproximationBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteApproximationBounds.lean index c9049d9ba8..c7316e641d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteApproximationBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteApproximationBounds.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFiniteSumBounds /-! Quantitative bounds for the literal finite approximate velocity and its time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteAssemblyBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteAssemblyBounds.lean index c89b302153..52dde031bc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteAssemblyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteAssemblyBounds.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketShiftArithmetic /-! Uniform estimates for finite coefficient assembly, including zero and terminal grades. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteCoarseBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteCoarseBounds.lean index 03d95153b9..3ed53abc9d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteCoarseBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteCoarseBounds.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Low packet grades retain fixed polynomial costs; higher grades use one common tail base. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ open EulerPacketProfileRecursion EulerPacketShiftArithmetic EulerPacketCoarseMaj /-- Fixed velocity grade cost, given by `(3*H^(2*n))*((4*R)^(highShift n)*((highShift n).factorial : ℝ)^2)`. -/ -def fixedVelocityGradeCost (R H : ℝ) (n : ℕ) : ℝ := +@[expose] def fixedVelocityGradeCost (R H : ℝ) (n : ℕ) : ℝ := (3*H^(2*n))*((4*R)^(highShift n)*((highShift n).factorial : ℝ)^2) theorem fixedVelocityGradeCost_nonneg (R H : ℝ) (hR : 0 ≤ R) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFieldAlgebra.lean index 274fcbbe81..e3a057f25c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFieldAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFieldAlgebra.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketTimeAlgebra /-! Actual path and time-derivative witnesses for finite coefficient assembly. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFrequencyBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFrequencyBounds.lean index 93ae69739b..4562cc5c44 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFrequencyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteFrequencyBounds.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Frequency guards turn the finite geometric remainder into fixed polynomial bounds. -/ -@[expose] public section +public section namespace EulerPacketFiniteFrequency diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteLifespan.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteLifespan.lean index bb90efeff3..a7fb4daabf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteLifespan.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteLifespan.lean @@ -28,7 +28,7 @@ section positive-time Euler solution for its limiting datum. Only the already proved common packet interval and actual stability are used. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteParity.lean index 984e8f6964..98457be61d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteParity.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketResidualTailFields /-! Actual finite packet velocities and residual tails preserve the joint odd parity of the constructed profiles. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileBounds.lean index de7a0daa88..af0254c6e9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileBounds.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketProfileCoarseBounds /-! The finite approximate velocity and its genuine time derivative share the profile bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileFields.lean index 0f82b3c045..83efef2870 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteProfileFields.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketTimeAlgebra /-! The literal finite packet and its genuine time derivative are actual cylinder fields. -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ open Set EulerSmoothLimit EulerPacketPointJets EulerPacketProfileRecursion Euler /-- Raw time derivative, defined pointwise by `derivWithin (fun t => raw (t,z.2)) (Icc (0 : ℝ) T) z.1`. -/ -def rawTimeDerivative (T : ℝ) (raw : VectorField) : VectorField := fun z => +@[expose] def rawTimeDerivative (T : ℝ) (raw : VectorField) : VectorField := fun z => derivWithin (fun t => raw (t,z.2)) (Icc (0 : ℝ) T) z.1 variable {P T : ℝ} [Fact (0 < P)] diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteRemainderBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteRemainderBounds.lean index fa822599a1..05983bf262 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteRemainderBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteRemainderBounds.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFiniteSumBounds /-! Removing the literal leading coefficient before bounding the packet remainder. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteSumBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteSumBounds.lean index 39e8016d6e..3292382670 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteSumBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiniteSumBounds.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real /-! A finite packet sum keeps its first two grades separate from the geometric tail. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ theorem weighted_low_high_sum_le (N : ℕ) (hN : 1 ≤ N) (κ B C₁ C₂ : ℝ) exact add_le_add hlow hhigh /-- Low high envelope, with branches according to `n=0`. -/ -def lowHighEnvelope (B C₁ C₂ : ℝ) (n : ℕ) : ℝ := +@[expose] def lowHighEnvelope (B C₁ C₂ : ℝ) (n : ℕ) : ℝ := if n=0 then 0 else if n=1 then C₁ else if n=2 then C₂ else B^(n+1) namespace Field diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFirstLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFirstLowBounds.lean index 97ba2bb4eb..20a38d46fe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFirstLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFirstLowBounds.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ShortTimeLinearGrowth velocity have absolute size at most two. This gives the first packet's size and sign estimates without any amplification-stage hypotheses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFirstStageSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFirstStageSupport.lean index 9c687e8e05..6ea467456a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFirstStageSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFirstStageSupport.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentChoiceInitialSupport /-! The finite initial base used by the limiting construction is the actual first normal forward packet over the actual first packet state. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostGuards.lean index 078326281a..5b822150a5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostGuards.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketFiveCostPolynomial A single polynomial source bound suffices simultaneously for all five requirements. No eventual threshold is hidden in this statement. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostPolynomial.lean index 26d136ac20..1644176cc5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFiveCostPolynomial.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PolynomialCostMajorant the actual all-order packet correction. This is a uniform estimate on primitive source bounds, not a per-parent eventual-frequency assertion. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ local instance instPacketFiveCostPolynomial4 : NormedSpace ℝ (Space →ᵇ (Sp variable (P : ℝ) [Fact (0 < P)] /-- The growth constant written in inverse-coercivity variables. -/ -def rawGrowth (i m f t B M A0 A2 B0 B1 : ℝ) : ℝ := +@[expose] def rawGrowth (i m f t B M A0 A2 B0 B1 : ℝ) : ℝ := let μ := 1+Real.sqrt 5461*i let s := sourceConstant B M let tr := transportConstant P B M @@ -60,14 +60,14 @@ def rawGrowth (i m f t B M A0 A2 B0 B1 : ℝ) : ℝ := /-- Growth envelope, given by `rawGrowth P X X X X X X X X (2*velocity X X X) (48*velocity X X X*X)`. -/ -def growthEnvelope (X : ℝ) : ℝ := +@[expose] def growthEnvelope (X : ℝ) : ℝ := rawGrowth P X X X X X X X X (2*velocity X X X) (48*velocity X X X*X) /-- Inverse radius envelope, given by `1+8*X+4*X^2+X`. -/ -def inverseRadiusEnvelope (X : ℝ) : ℝ := 1+8*X+4*X^2+X +@[expose] def inverseRadiusEnvelope (X : ℝ) : ℝ := 1+8*X+4*X^2+X /-- Five envelope as an element of `ℝ`. -/ -def fiveEnvelope (X : ℝ) : ℝ := +@[expose] def fiveEnvelope (X : ℝ) : ℝ := 1+tailPolynomialConstant X X X+X+12*growthEnvelope P X*X + 8*growthEnvelope P X*X*drift X X X*inverseRadiusEnvelope X + 8*growthEnvelope P X*X*inverseRadiusEnvelope X diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForcingBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForcingBounds.lean index 52b7d878f4..cd2839bb89 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForcingBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForcingBounds.lean @@ -19,7 +19,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketKnownTermSums /-! Actual mean and high forcing estimates at one fixed radius, uniform in the packet grade. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardApproximationBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardApproximationBounds.lean index fc1b6670a2..35ada07aec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardApproximationBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardApproximationBounds.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourceRegularity /-! The actual zero-history packet has a bounded normalized velocity and a small normal drift, at a single radius inherited from the profile construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCanonicalRadius.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCanonicalRadius.lean index 24c2c45d0b..7008202b3f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCanonicalRadius.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCanonicalRadius.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketTerminalEnvelope /-! Named direct-forward budgets at the literal canonical source radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardChildLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardChildLowBounds.lean index 66d0aa7a33..722a93d7d3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardChildLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardChildLowBounds.lean @@ -18,7 +18,7 @@ physical derivative and upper pressure bounds. The early interval keeps its exponential gain, and the good interval retains the extra delta in the upper pressure estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCoefficientBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCoefficientBudgets.lean index de1f4b226a..e72ae2e8cc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCoefficientBudgets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCoefficientBudgets.lean @@ -15,7 +15,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OperatorGevreyCalculus /-! The actual forward source coefficients supply both the nonlinear-profile budget and the all-order correction coefficient budget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCommonRadius.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCommonRadius.lean index cba3de2738..bcb65aa456 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCommonRadius.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardCommonRadius.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCommonRadius forced direct-forward grade, the mean solve and the nonlinear coefficients. Neither the positive packet amplitude nor the recursive grade enters it. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ variable {P : ℝ} (N : EulerTransversePacketJoin.NormalBudget D 6 L.R) (C : ℝ) /-- Grade radius, constructed using `max`. -/ -def gradeRadius : ℝ := +@[expose] def gradeRadius : ℝ := max L.R (max (L.commonCost*C) (max (L.correctorAmplitude (P := P) N*C) (max (L.correctorTimeAmplitude (P := P) N*C) (3*L.pressureAmplitude (P := P) N*C)))) @@ -74,7 +74,7 @@ variable {P Tc : ℝ} [Fact (0 < P)] {O : Operators} {C : CoefficientData P Tc O (terminalCost extra : ℝ) /-- Common radius as an element of `ℝ`. -/ -def commonRadius : ℝ := +@[expose] def commonRadius : ℝ := Rm+L.R+CB.termCost+sobolevCoefficientRadius (Fin 4) CB.Rc + M.velocityCost+M.derivativeCost+M.pressureGradientCost + L.gradeRadius (P := P) N 1+L.gradeRadius (P := P) N terminalCost+max 0 extra diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactFields.lean index df4d4f43f2..10e0d9c7ee 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactFields.lean @@ -27,7 +27,7 @@ section /-! Source budgets and the actual zero-history initialized residual construct exact corrected lifted packets at every sufficiently large frequency. -/ -@[expose] public section +public section noncomputable section @@ -106,7 +106,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactPressureError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactPressureError.lean index d31e4fe268..964402f985 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactPressureError.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardExactPressureError.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketForwardExactFields from the literal primary normal tensor by its proved finite tail and the Hessian of the same actual correction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardFactorization.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardFactorization.lean index 1c305b010a..c3ff5cb03c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardFactorization.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardFactorization.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketInitialRepresentative the genuine homogeneous physical propagator. Its scalar pressure has the literal normal residual as its angular derivative. -/ -@[expose] public section +public section noncomputable section @@ -81,7 +81,7 @@ def uncutVelocity (ξ : U) (t : ℝ) (x : Space) : Space := physical D ⟨0,le_rfl,D.T_pos.le⟩ x ξ t /-- Canonical velocity, given by `innerCutoff x • uncutVelocity D ξ t x`. -/ -def canonicalVelocity (ξ : U) (t : ℝ) (x : Space) : Space := +@[expose] def canonicalVelocity (ξ : U) (t : ℝ) (x : Space) : Space := innerCutoff x • uncutVelocity D ξ t x theorem uncutVelocity_initial (ξ : U) (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryData.lean index a58f8b9b66..7f7df06eb1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryData.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketPrimaryDynamics the actual homogeneous forward solution with a fixed initial coordinate; no stationary-history solve is used in this stage. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] {D : Data U} /-- Forward error, given by `P.error+‖D.M.derivative.field‖*radius`. -/ -def ParentFrame.forwardError (P : ParentFrame D 0) (radius : ℝ) : ℝ := +@[expose] def ParentFrame.forwardError (P : ParentFrame D 0) (radius : ℝ) : ℝ := P.error+‖D.M.derivative.field‖*radius /-- Forward guards data, collecting `radius`, `y`, `δ`, `hchild`, `radius_nonneg`, diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryLowBounds.lean index f4219ca35f..43297ad862 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardGeometryLowBounds.lean @@ -19,7 +19,7 @@ section geometry. The source normal, primary and all ODEs are the actual forward fields, including exact initial data at time zero. -/ -@[expose] public section +public section noncomputable section @@ -166,7 +166,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardHessianError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardHessianError.lean index 180b519890..1c1f585116 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardHessianError.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardHessianError.lean @@ -39,7 +39,7 @@ section zero-history solve. Forced grades have zero initial data; the primary keeps the literal compact initial-data amplitude. All bounds retain the same radius. -/ -@[expose] public section +public section noncomputable section @@ -184,7 +184,7 @@ section the unit grade budget. This is derived from the same source solve used by the velocity recursion. -/ -@[expose] public section +public section noncomputable section @@ -414,7 +414,7 @@ section /-! The actual forward finite pressure has its actual leading angular force and a uniformly small covector remainder. -/ -@[expose] public section +public section noncomputable section @@ -578,7 +578,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitialSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitialSupport.lean index 92651f090d..ed8491706e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitialSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitialSupport.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitialSupport initial increment is supported in the small physical packet ball. The exact correction starts from zero, so it adds no initial tail. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedAllOrderBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedAllOrderBudget.lean index c389ac4f89..fe0744db82 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedAllOrderBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedAllOrderBudget.lean @@ -29,7 +29,7 @@ section /-! Cutoff-independent background, derivative, drift and residual budgets for the actual zero-history correction data. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ end end -@[expose] public section +public section noncomputable section @@ -266,7 +266,7 @@ section /-! The zero-history initialized approximation satisfies the lifted divergence constraint for an actual volume-preserving source deformation. -/ -@[expose] public section +public section noncomputable section @@ -319,7 +319,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionChoice.lean index c85eea5bf0..f5a22faa0e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionChoice.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionChoice.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketTerminalEnvelope sufficiently large frequencies. All primary, coefficient, radius and frequency guards follow from the fixed source data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionData.lean index dbb220bc5a..322508a24e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionData.lean @@ -28,7 +28,7 @@ section /-! Actual finite velocity, normal drift and residual estimates for the zero-history recursion initialized by the literal compact periodic wave. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ end end -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ def forwardInitializedNormalizedResidualField (Cagree : SourceCoefficientAgreeme /-- Forward initialized correction data, constructed using `EulerPacketCorrectionCoefficients.correctionDataOfFields`. -/ -def forwardInitializedCorrectionData (Cagree : SourceCoefficientAgreement M D) +@[expose] def forwardInitializedCorrectionData (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : EulerAllOrderCorrectionData.Data period D.T := EulerPacketCorrectionCoefficients.correctionDataOfFields D period k⁻¹ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionParity.lean index 5927def444..98394a08f3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedCorrectionParity.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketForwardInitializedFieldParity /-! The actual zero-history correction data have all the joint parities required by the drift-aware correction and pressure construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedFieldParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedFieldParity.lean index 67438e5c2b..d9ec8f5290 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedFieldParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedFieldParity.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourceParity /-! The literal zero-history initialized packet and its exact residual tail are odd as actual cylinder L² paths, before and after coordinate normalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfiles.lean index 37235c1020..520b3fd6d9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfiles.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketProfileBudgetTimeChange by the literal compact periodic wave. Every later forcing and solution is constructed, and the primary budget is discharged from its actual datum. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized profiles, given by `sourceProfiles period M D (InitialData.zero period D) (initialData D δ hδ (α • ξ) hs)`. -/ -def forwardInitializedProfiles : ℕ → Profile := +@[expose] def forwardInitializedProfiles : ℕ → Profile := sourceProfiles period M D (InitialData.zero period D) (initialData D δ hδ (α • ξ) hs) /-- Forward initialized profile witness, given by `sourceProfileWitness period M D hTime diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfilesParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfilesParity.lean index e0c7960d72..78fa63f4b4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfilesParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedProfilesParity.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourceParity /-! Reflection parity of every zero-history profile, derived from the literal terminal wave and the prescribed coefficient symmetries. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedResidualEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedResidualEquation.lean index d82a2f1eca..3cb5d2d411 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedResidualEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardInitializedResidualEquation.lean @@ -23,7 +23,7 @@ section /-! The actual direct-forward source packet has a lifted pressure gradient. Every component is constructed from its mean or oscillatory inverse. -/ -@[expose] public section +public section noncomputable section @@ -133,7 +133,7 @@ section /-! The finite zero-history pressure and its actual lifted gradient. -/ -@[expose] public section +public section noncomputable section @@ -181,7 +181,7 @@ end end -@[expose] public section +public section noncomputable section @@ -214,7 +214,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Forward initialized velocity, given by `fieldSum (N+1) κ (assembledVelocity N (forwardInitializedProfiles M D δ hδ ξ hs α))`. -/ -def forwardInitializedVelocity (N : ℕ) (κ : ℝ) : VectorField := +@[expose] def forwardInitializedVelocity (N : ℕ) (κ : ℝ) : VectorField := fieldSum (N+1) κ (assembledVelocity N (forwardInitializedProfiles M D δ hδ ξ hs α)) /-- Forward initialized velocity field as an element of `Field period D.T diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardOutputCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardOutputCosts.lean index 94ad5e4d6e..dcdcf6fbd7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardOutputCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardOutputCosts.lean @@ -29,7 +29,7 @@ section physical point. The slow primary derivative and finite tail contribute only a fixed source constant divided by the frequency. -/ -@[expose] public section +public section noncomputable section @@ -174,7 +174,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimary.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimary.lean index 1f9d0a8d8f..bec07aeb04 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimary.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimary.lean @@ -19,7 +19,7 @@ homogeneous forward evolution, has the prescribed initial field, and supplies the literal homogeneous equation and all primary regularity/parity inputs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryBounds.lean index b4e792281c..4e76387fd8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryBounds.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevScaling /-! The literal compact initial wave supplies the seven-field primary budget for the direct-forward, zero-history packet construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryShear.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryShear.lean index 0d1a68f49e..af3f9a82e7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryShear.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardPrimaryShear.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFieldTensorBounds zero. The leading tensors are derivatives of the actual constructed velocity and scalar pressure, with the slow terms retained exactly. -/ -@[expose] public section +public section noncomputable section @@ -107,7 +107,7 @@ theorem global_gradient_bound (a k : ℝ) (hk : 0 < k) /-- Pressure coefficient, given by `-(2*a*⟪D.normal.field t x,D.M.field t x (canonicalVelocity D ξ t x)⟫_ℝ)/ ‖D.normal.field t x‖^2`. -/ -def pressureCoefficient (a : ℝ) (t : Icc (0 : ℝ) D.T) (x : Space) : ℝ := +@[expose] def pressureCoefficient (a : ℝ) (t : Icc (0 : ℝ) D.T) (x : Space) : ℝ := -(2*a*⟪D.normal.field t x,D.M.field t x (canonicalVelocity D ξ t x)⟫_ℝ)/ ‖D.normal.field t x‖^2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRadiusPolynomial.lean index 7bbcda31c6..2f5444749e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRadiusPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRadiusPolynomial.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransverseForwardCoefficientGevrey enlargement obey the same fixed polynomial envelope as the joined branch. The homogeneous growth constant is arbitrary and remains an input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRemainder.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRemainder.lean index a1808a0b48..ae411c2383 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRemainder.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardRemainder.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketFieldGraphBounds /-! The literal forward finite packet is its actual primary plus a remainder with a proved physical C1 bound. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ theorem forwardInitializedProfiles_one_mean : /-- Forward initialized primary remainder, given by `forwardInitializedVelocity M D δ hδ ξ hs α N κ - κ • vector D (initialData D δ hδ (α • ξ) hs)`. -/ -def forwardInitializedPrimaryRemainder (N : ℕ) (κ : ℝ) : VectorField := +@[expose] def forwardInitializedPrimaryRemainder (N : ℕ) (κ : ℝ) : VectorField := forwardInitializedVelocity M D δ hδ ξ hs α N κ - κ • vector D (initialData D δ hδ (α • ξ) hs) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardResidualBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardResidualBounds.lean index 449a4e5bb0..8298f4e13a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardResidualBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardResidualBounds.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketProfileTailEstimates /-! Exponentially small literal residual for the actual zero-history packet. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformBudget.lean index 47b403e797..9fa5ea7533 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformBudget.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketForwardUniformCosts /-! The actual zero-history correction from the same fixed polynomial frequency comparison, together with its uniform weighted output bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformChild.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformChild.lean index 752b2e6356..b9d9ce9583 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformChild.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformChild.lean @@ -33,7 +33,7 @@ section has a source-dependent Gevrey bound uniform in the truncation frequency. The time derivative of the inverse deformation is included explicitly. -/ -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ section the physical shear and pressure errors, and the three flow fields. Only the displayed numerical frequency margins are independent extra guards. -/ -@[expose] public section +public section noncomputable section @@ -382,7 +382,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformCosts.lean index 8f2290928c..64afa0c9e8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformCosts.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourcePrimitiveBounds /-! The direct-forward branch uses the identical fixed polynomial cost envelope as the positive-history branch. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformProfiles.lean index d0f53abf25..0bafc3ade1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketForwardUniformProfiles.lean @@ -35,7 +35,7 @@ section /-! Every forced direct-forward grade starts from zero and obeys the genuine five-field grade budget at the common radius. -/ -@[expose] public section +public section noncomputable section @@ -87,7 +87,7 @@ end end -@[expose] public section +public section noncomputable section @@ -236,7 +236,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFrameCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFrameCoefficients.lean index 5254c109b1..03b10cc54f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFrameCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFrameCoefficients.lean @@ -16,7 +16,7 @@ source (23). Frame motion and primary shear motion are derived from the actual homogeneous ray and velocity equations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryAssembly.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryAssembly.lean index b0593a1bd5..e218922ac6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryAssembly.lean @@ -45,7 +45,7 @@ section /-! Tangency is preserved by the actual ray and projected velocity ODEs. -/ -@[expose] public section +public section noncomputable section @@ -100,7 +100,7 @@ section /-! Continuity of the actual rescaled moving-frame matrices. -/ -@[expose] public section +public section noncomputable section @@ -172,7 +172,7 @@ center frame. Its neighboring matrix perturbation is part of the actual parent error; all scaled coefficient and ray bounds are derived here. -/ -@[expose] public section +public section noncomputable section @@ -335,7 +335,7 @@ section /-! Uniqueness of the actual scalar comparison equation, including its state. -/ -@[expose] public section +public section noncomputable section @@ -388,7 +388,7 @@ end end -@[expose] public section +public section noncomputable section @@ -539,7 +539,7 @@ section /-! Relative propagator estimates on arbitrary subintervals for actual velocity states. -/ -@[expose] public section +public section noncomputable section @@ -641,7 +641,7 @@ section /-! Polynomial conversion between physical tangent vectors and the two-state system. -/ -@[expose] public section +public section noncomputable section @@ -726,7 +726,7 @@ section /-! Relative growth of the primary scalar reference dominates zero slope. -/ -@[expose] public section +public section noncomputable section @@ -779,7 +779,7 @@ end end -@[expose] public section +public section noncomputable section @@ -858,7 +858,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1048,7 +1048,7 @@ section # Packet Stage -/ -@[expose] public section +public section noncomputable section @@ -1275,7 +1275,7 @@ condition `1 ≤ σ * Θ` is the source horizon condition; the smallness of the matrix and ray errors is converted to smallness relative to `σ^2`. -/ -@[expose] public section +public section noncomputable section @@ -1422,7 +1422,7 @@ target amplitude. The initial scalar slope cancels, including for neighboring initial data controlled by the common reference. -/ -@[expose] public section +public section noncomputable section @@ -1541,7 +1541,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryControlledGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryControlledGrowth.lean index 3ac0c68a2a..2f46219876 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryControlledGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryControlledGrowth.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourceGeometryGrowth bound. Keeping both properties in the choice specification is necessary for a uniform source-frequency estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryData.lean index de4c527e57..1f15d2ffb5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryData.lean @@ -24,7 +24,7 @@ section /-! Bounds for the actual source choice of the packet amplitude. -/ -@[expose] public section +public section noncomputable section @@ -100,7 +100,7 @@ end end -@[expose] public section +public section noncomputable section @@ -210,57 +210,58 @@ namespace PhysicalGeometryData variable {α : Type*} /-- Error, given by `16*(D.ε*D.Θ*(4*D.G)^2+D.d)`. -/ -def error (D : PhysicalGeometryData α) : ℝ := 16*(D.ε*D.Θ*(4*D.G)^2+D.d) +@[expose] def error (D : PhysicalGeometryData α) : ℝ := 16*(D.ε*D.Θ*(4*D.G)^2+D.d) /-- Target, given by `D.y⁻¹/D.σ`. -/ -def target (D : PhysicalGeometryData α) : ℝ := D.y⁻¹/D.σ +@[expose] def target (D : PhysicalGeometryData α) : ℝ := D.y⁻¹/D.σ /-- Time, given by `physicalTime D.t₀ D.a D.ε τ`. -/ -def time (D : PhysicalGeometryData α) (τ : ℝ) : ℝ := physicalTime D.t₀ D.a D.ε τ +@[expose] def time (D : PhysicalGeometryData α) (τ : ℝ) : ℝ := + physicalTime D.t₀ D.a D.ε τ /-- Target time, given by `D.time D.target`. -/ -def targetTime (D : PhysicalGeometryData α) : ℝ := D.time D.target +@[expose] def targetTime (D : PhysicalGeometryData α) : ℝ := D.time D.target /-- Ray, given by `scaledRay D.m D.v (D.r ξ) D.s₀ D.t₀ D.a D.ε τ`. -/ -def ray (D : PhysicalGeometryData α) (ξ : α) (τ : ℝ) : Fin 3 → ℝ := +@[expose] def ray (D : PhysicalGeometryData α) (ξ : α) (τ : ℝ) : Fin 3 → ℝ := scaledRay D.m D.v (D.r ξ) D.s₀ D.t₀ D.a D.ε τ /-- Velocity, given by `scaledVelocity D.m D.v (D.w ξ) D.t₀ D.a D.ε τ`. -/ -def velocity (D : PhysicalGeometryData α) (ξ : α) (τ : ℝ) : Fin 3 → ℝ := +@[expose] def velocity (D : PhysicalGeometryData α) (ξ : α) (τ : ℝ) : Fin 3 → ℝ := scaledVelocity D.m D.v (D.w ξ) D.t₀ D.a D.ε τ /-- Size, given by `‖D.r ξ (D.time τ)‖*‖D.w ξ (D.time τ)‖`. -/ -def size (D : PhysicalGeometryData α) (ξ : α) (τ : ℝ) : ℝ := +@[expose] def size (D : PhysicalGeometryData α) (ξ : α) (τ : ℝ) : ℝ := ‖D.r ξ (D.time τ)‖*‖D.w ξ (D.time τ)‖ /-- Target size, given by `D.size D.center D.target`. -/ -def targetSize (D : PhysicalGeometryData α) : ℝ := D.size D.center D.target +@[expose] def targetSize (D : PhysicalGeometryData α) : ℝ := D.size D.center D.target /-- Amplitude, given by `primaryAmplitude D.δ D.hchild (D.r D.center) (D.w D.center) D.targetTime`. -/ -def amplitude (D : PhysicalGeometryData α) : ℝ := +@[expose] def amplitude (D : PhysicalGeometryData α) : ℝ := primaryAmplitude D.δ D.hchild (D.r D.center) (D.w D.center) D.targetTime /-- Next coupling, given by `normalizedCoupling (D.M D.center D.targetTime) (D.r D.center D.targetTime) (D.w D.center D.targetTime)`. -/ -def nextCoupling (D : PhysicalGeometryData α) : ℝ := +@[expose] def nextCoupling (D : PhysicalGeometryData α) : ℝ := normalizedCoupling (D.M D.center D.targetTime) (D.r D.center D.targetTime) (D.w D.center D.targetTime) /-- Next tilt, given by `normalizedTilt (D.M D.center D.targetTime) (D.r D.center D.targetTime) (D.w D.center D.targetTime)`. -/ -def nextTilt (D : PhysicalGeometryData α) : ℝ := +@[expose] def nextTilt (D : PhysicalGeometryData α) : ℝ := normalizedTilt (D.M D.center D.targetTime) (D.r D.center D.targetTime) (D.w D.center D.targetTime) /-- Next compression, given by `normalizedCoupling (D.M D.center D.targetTime) (D.r D.center D.targetTime) (D.r D.center D.targetTime)`. -/ -def nextCompression (D : PhysicalGeometryData α) : ℝ := +@[expose] def nextCompression (D : PhysicalGeometryData α) : ℝ := normalizedCoupling (D.M D.center D.targetTime) (D.r D.center D.targetTime) (D.r D.center D.targetTime) /-- Target shear, given by `primaryShear D.c D.m D.v D.targetTime`. -/ -def targetShear (D : PhysicalGeometryData α) : ℝ := +@[expose] def targetShear (D : PhysicalGeometryData α) : ℝ := primaryShear D.c D.m D.v D.targetTime end PhysicalGeometryData diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryGuards.lean index c172b4c63e..028f2b1f84 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryGuards.lean @@ -18,7 +18,7 @@ section /-! Actual shear motion, exposed for the compression scale guard. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryJoinedBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryJoinedBudget.lean index 4582887f98..8340dbea9c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryJoinedBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryJoinedBudget.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketSourceGeometryGrowth packet budget. Source label bounds and the original curvature hypotheses remain inputs; no propagator estimate or chosen growth profile is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryLowBounds.lean index 7826481f16..7b65ccd5e9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryLowBounds.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketTargetAmplification stationary-history portions of the packet horizon. The amplitude is the one selected by its genuine center target size. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ theorem cutoff_le (x : Space) : innerCutoff x ≤ cutoffBound := by exact he.trans (by unfold cutoffBound; linarith) /-- Good ratio, given by `cutoffBound*(64*Real.exp 6)`. -/ -def goodRatio : ℝ := cutoffBound*(64*Real.exp 6) +@[expose] def goodRatio : ℝ := cutoffBound*(64*Real.exp 6) theorem goodRatio_pos : 0 < goodRatio := by unfold goodRatio; positivity [cutoffBound_pos] @@ -217,7 +217,7 @@ theorem early_primary_size (t : Icc (0 : ℝ) D.T) /-- This cost is computed from the actual stationary endpoint operator. It is used only on the history interval; the good interval keeps its sharp universal target-size ratio. -/ -def historySizeCost : ℝ := +@[expose] def historySizeCost : ℝ := D.inverseBound*historyLabelSizeCost H*P.terminalBound A.CM A.CH theorem historySizeCost_nonneg : 0 ≤ A.historySizeCost := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryProfileEnvelope.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryProfileEnvelope.lean index a24673089b..662ed0eccd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryProfileEnvelope.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometryProfileEnvelope.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketProfileEnvelope /-! The chosen geometric growth profile carries a polynomial amplitude bound. This controls the actual grade scale, including its history part. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometrySourceGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometrySourceGrowth.lean index 843754cc78..3404d4f323 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGeometrySourceGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGeometrySourceGrowth.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketGeometryGuards input used by the source packet budgets. The only bridge hypotheses are literal interval, strain, and normal identities. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGevreyProfileChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGevreyProfileChoice.lean index 7b1589c5eb..2a795111b6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGevreyProfileChoice.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGevreyProfileChoice.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketBudgetTimeChange /-! One positive growth profile and one scalar amplitude determine all grade profiles. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGradeAbsorption.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGradeAbsorption.lean index f0867855f6..d0ec4cd422 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGradeAbsorption.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGradeAbsorption.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! One spare factorial shift pays all finite grade sums without changing the external radius. -/ -@[expose] public section +public section namespace EulerGevrey diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketGraphHessian.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketGraphHessian.lean index 6499ddd65c..88cdf55aca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketGraphHessian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketGraphHessian.lean @@ -19,7 +19,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Mul inverse flow. The principal Hessian is the angular second derivative times the square of the transported normal. -/ -@[expose] public section +public section noncomputable section @@ -31,11 +31,11 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerGraphPullba open scoped ContDiff /-- Spatial gradient, given by `(toDual ℝ Space).symm ((fderiv ℝ q z).comp (inl ℝ Space ℝ))`. -/ -def spatialGradient (q : LiftTangent → ℝ) (z : LiftTangent) : Space := +@[expose] def spatialGradient (q : LiftTangent → ℝ) (z : LiftTangent) : Space := (toDual ℝ Space).symm ((fderiv ℝ q z).comp (inl ℝ Space ℝ)) /-- Angular derivative, given by `fderiv ℝ q z (0,1)`. -/ -def angularDerivative (q : LiftTangent → ℝ) (z : LiftTangent) : ℝ := +@[expose] def angularDerivative (q : LiftTangent → ℝ) (z : LiftTangent) : ℝ := fderiv ℝ q z (0,1) theorem spatialGradient_contDiff {q : LiftTangent → ℝ} (hq : ContDiff ℝ ∞ q) : @@ -100,7 +100,7 @@ theorem gradient_physical {q : LiftTangent → ℝ} (k : ℝ) (m : Space) ring /-- Transported normal, given by `(J x).adjoint m`. -/ -def transportedNormal (m : Space) (J : Space → Space →L[ℝ] Space) (x : Space) : Space := +@[expose] def transportedNormal (m : Space) (J : Space → Space →L[ℝ] Space) (x : Space) : Space := (J x).adjoint m /-- Slow force, given by `(J x).adjoint (spatialGradient q (graphMap k m (Y x)))`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketHorizonSize.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketHorizonSize.lean index 35ec87f9d0..3213a70311 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketHorizonSize.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketHorizonSize.lean @@ -20,7 +20,7 @@ The actual scalar ODE gives the needed uniform logarithmic growth bound; there is no separate post-target growth hypothesis. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketIdealSize.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketIdealSize.lean index 4c0ed188aa..22cb7fe033 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketIdealSize.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketIdealSize.lean @@ -16,7 +16,7 @@ Uniform comparison of ideal primary sizes before target. This follows from the actual scalar equation's prefix and weighted monotonicity. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ namespace EulerPacketMovingFrame open Set EulerPacketGrowth /-- Ideal primary size, given by `Real.sqrt (1+(σ^2*t^2)^2)*Z t`. -/ -def idealPrimarySize (σ : ℝ) (Z : ℝ → ℝ) (t : ℝ) : ℝ := +@[expose] def idealPrimarySize (σ : ℝ) (Z : ℝ → ℝ) (t : ℝ) : ℝ := Real.sqrt (1+(σ^2*t^2)^2)*Z t theorem quadratic_weight_sqrt {p : ℝ} (hp : 0 ≤ p) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScaleBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScaleBounds.lean index a821291c32..3788a18d3b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScaleBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScaleBounds.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketPressureSeries /-! Pointwise and partial-sum consequences of the one global scale choice, ready for a finite-prefix packet induction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScales.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScales.lean index 6ff02c7ab3..2a46570f38 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInductionScales.lean @@ -24,7 +24,7 @@ section /-! Reconstruct the numerical source guards from a supplied common finite cost budget, without making a second choice of the starting stage. -/ -@[expose] public section +public section noncomputable section @@ -138,7 +138,7 @@ section geometric guards, pressure series, and any finite list of further packet frequency comparisons. No independently chosen index is substituted. -/ -@[expose] public section +public section noncomputable section @@ -216,7 +216,7 @@ end end -@[expose] public section +public section noncomputable section @@ -240,7 +240,7 @@ theorem geometryConstant_one : 1 ≤ geometryConstant := by /-- Activation margin, given by `1/(32*(activationConstant gradientConstant hessianConstant+1))`. -/ -def activationMargin : ℝ := +@[expose] def activationMargin : ℝ := 1/(32*(activationConstant gradientConstant hessianConstant+1)) theorem activationMargin_pos : 0 < activationMargin := by @@ -290,14 +290,14 @@ def extraCost : Sum Unit Bool → CostSpec /-- Initial increment, given by `badCost J 4 gradientConstant gradientConstant hessianConstant 80 (scaleSequence J X) n + (frequency J X n)^(-(1/4 : ℝ))`. -/ -def initialIncrement (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def initialIncrement (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := badCost J 4 gradientConstant gradientConstant hessianConstant 80 (scaleSequence J X) n + (frequency J X n)^(-(1/4 : ℝ)) /-- Pressure increment, given by `2*gradientConstant*EulerPacketGeometryLowBounds.goodRatio*goodCost J (scaleSequence J X) n + initialIncrement J X n`. -/ -def pressureIncrement (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def pressureIncrement (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := 2*gradientConstant*EulerPacketGeometryLowBounds.goodRatio*goodCost J (scaleSequence J X) n + initialIncrement J X n diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialFields.lean index a0b443ff75..606b3aa8a4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialFields.lean @@ -21,7 +21,7 @@ section word bound. Restoring a time weight uses its value at that time, retaining the source's initial alpha factor. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -157,7 +157,7 @@ open Set Finset EulerSmoothLimit EulerPacketProfileRecursion EulerPacketPointJet EulerPacketCylinderField EulerFiniteGrades /-- Time slice, defined pointwise by `f (t,z.2)`. -/ -def timeSlice (t : ℝ) (f : VectorField) : VectorField := fun z => f (t,z.2) +@[expose] def timeSlice (t : ℝ) (f : VectorField) : VectorField := fun z => f (t,z.2) /-- High grade, given by `assemble N (fun i => timeSlice t (a i).high) (fun i => timeSlice t (a i).corrector)`. -/ @@ -165,7 +165,7 @@ def highGrade (N : ℕ) (t : ℝ) (a : ℕ → Profile) : ℕ → VectorField := assemble N (fun i => timeSlice t (a i).high) (fun i => timeSlice t (a i).corrector) /-- Mean grade, given by `truncate N (fun i => timeSlice t (a i).mean)`. -/ -def meanGrade (N : ℕ) (t : ℝ) (a : ℕ → Profile) : ℕ → VectorField := +@[expose] def meanGrade (N : ℕ) (t : ℝ) (a : ℕ → Profile) : ℕ → VectorField := truncate N (fun i => timeSlice t (a i).mean) /-- High, given by `fieldSum (N+1) κ (highGrade N t a)`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialGeometry.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialGeometry.lean index 53b85570e4..4e42aefedf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialGeometry.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketScaledVelocity /-! The physical activation data give the scaled initial conditions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialInput.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialInput.lean index 1a38d4c2eb..9dd1ed1561 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialInput.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialInput.lean @@ -44,7 +44,7 @@ section /-! Initial high and mean estimates retain their distinct small factors. The only truncation-dependent quantity is the already controlled tail base. -/ -@[expose] public section +public section noncomputable section @@ -217,7 +217,7 @@ end end -@[expose] public section +public section noncomputable section @@ -326,7 +326,7 @@ section /-! Source (22) for the literal initialized packet. The constants at each fixed Sobolev order are independent of its truncation and frequency. -/ -@[expose] public section +public section noncomputable section @@ -482,7 +482,7 @@ section /-! The actual chosen primary amplitude has exponential initial decay. Its prefactor is a fixed polynomial in the same source parameters. -/ -@[expose] public section +public section noncomputable section @@ -614,7 +614,7 @@ section are fixed polynomials in the source primitives. Frequency and amplitude are kept outside these polynomials. -/ -@[expose] public section +public section noncomputable section @@ -750,7 +750,7 @@ section compactly supported initial increments are precisely the finite-packet high and mean fields whose physical Sobolev bounds were proved above. -/ -@[expose] public section +public section noncomputable section @@ -845,7 +845,7 @@ section /-! The actual initial increments for the canonical uniformly selected packet satisfy source (22), with fixed-order polynomial costs. -/ -@[expose] public section +public section noncomputable section @@ -958,7 +958,7 @@ section /-! Fixed-order source polynomial bounds for the literal initial increments. These use the same finite frequency guard as the constructed exact packet. -/ -@[expose] public section +public section noncomputable section @@ -1020,7 +1020,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1141,7 +1141,7 @@ section /-! Ordinary smooth square-integrable fields realizing both actual initial increments, with the same concrete high and mean functions. -/ -@[expose] public section +public section noncomputable section @@ -1191,7 +1191,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialScaleSummability.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialScaleSummability.lean index 1bc59e146a..117458e0d2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialScaleSummability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialScaleSummability.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Ring.Star /-! The two literal initial-increment majorants are summable on the source scale sequence. The mean retains its full inverse-frequency square. -/ -@[expose] public section +public section noncomputable section @@ -26,13 +26,13 @@ open Real EulerPacketSourceScales EulerPacketSourceScaleChoice /-- High majorant, given by `(supportScale J X n)⁻¹^m*(frequency J X n)^m * (K*(parameterEnvelope J C c p q X n)^N)*exp (-scaleSequence J X n/8)`. -/ -def highMajorant (J : ℕ) (C c K : ℝ) (p q N m : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def highMajorant (J : ℕ) (C c K : ℝ) (p q N m : ℕ) (X : ℝ) (n : ℕ) : ℝ := (supportScale J X n)⁻¹^m*(frequency J X n)^m * (K*(parameterEnvelope J C c p q X n)^N)*exp (-scaleSequence J X n/8) /-- Mean majorant, given by `(supportScale J X n)⁻¹^m/(frequency J X n)^2 * (K*(parameterEnvelope J C c p q X n)^N)`. -/ -def meanMajorant (J : ℕ) (C c K : ℝ) (p q N m : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def meanMajorant (J : ℕ) (C c K : ℝ) (p q N m : ℕ) (X : ℝ) (n : ℕ) : ℝ := (supportScale J X n)⁻¹^m/(frequency J X n)^2 * (K*(parameterEnvelope J C c p q X n)^N) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSmoothLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSmoothLimit.lean index 228773a9e7..5a6cb25921 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSmoothLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSmoothLimit.lean @@ -20,7 +20,7 @@ section Only the source parameter cap and literal scale identities are supplied; all field estimates and the geometric amplitude decay are derived. -/ -@[expose] public section +public section noncomputable section @@ -90,7 +90,7 @@ end end -@[expose] public section +public section noncomputable section @@ -143,7 +143,7 @@ theorem actual_increment_summable (s : ℕ) : /-- Initial partial, defined pointwise by `∑ n ∈ range N, ((A n).high (frequency J X n) x+(A n).mean (frequency J X n) x)`. -/ -def initialPartial (N : ℕ) : Space → Space := +@[expose] def initialPartial (N : ℕ) : Space → Space := fun x => ∑ n ∈ range N, ((A n).high (frequency J X n) x+(A n).mean (frequency J X n) x) theorem initialPartial_field (N : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSupport.lean index 4eda69f96e..21969d0177 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitialSupport.lean @@ -21,7 +21,7 @@ section /-! Common compact support for the two actual initial increments after the physical spatial dilation. -/ -@[expose] public section +public section noncomputable section @@ -116,7 +116,7 @@ section /-! The actual localized mean initial condition vanishes when the source boundary coefficient L is zero. -/ -@[expose] public section +public section noncomputable section @@ -158,7 +158,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedAllOrderBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedAllOrderBudget.lean index 41755808e9..bc08dddfbc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedAllOrderBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedAllOrderBudget.lean @@ -29,7 +29,7 @@ section /-! Cutoff-independent background, derivative, drift and residual budgets for the actual initialized correction data. -/ -@[expose] public section +public section noncomputable section @@ -128,7 +128,7 @@ end end -@[expose] public section +public section noncomputable section @@ -270,7 +270,7 @@ section /-! The initialized approximation satisfies the actual lifted divergence constraint whenever the source deformation is a volume-preserving Jacobian. -/ -@[expose] public section +public section noncomputable section @@ -329,7 +329,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionChoice.lean index ba85313f5c..ee2632527c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionChoice.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionChoice.lean @@ -23,7 +23,7 @@ section /-! One source-dependent radius accommodates the literal terminal wave, the primary endpoint solve, all later linear solves, and every recursive grade. -/ -@[expose] public section +public section noncomputable section @@ -80,7 +80,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionData.lean index 2edeccf30d..0522e2cac5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionData.lean @@ -52,7 +52,7 @@ section /-! Every joined high/corrector pair lies in the actual lifted solenoidal space. -/ -@[expose] public section +public section noncomputable section @@ -130,7 +130,7 @@ end end -@[expose] public section +public section noncomputable section @@ -231,7 +231,7 @@ the uncancelled tail. The primary field and its homogeneous equation are inputs; every nonprimary regularity and equation is discharged by construction. -/ -@[expose] public section +public section noncomputable section @@ -311,7 +311,7 @@ end end -@[expose] public section +public section noncomputable section @@ -395,7 +395,7 @@ section /-! Exponential residual bounds for the actual recursively solved joined packet. -/ -@[expose] public section +public section noncomputable section @@ -485,7 +485,7 @@ section /-! The actual joined packet has a bounded normalized velocity and a small normal drift. -/ -@[expose] public section +public section noncomputable section @@ -564,7 +564,7 @@ end end -@[expose] public section +public section noncomputable section @@ -668,7 +668,7 @@ end end -@[expose] public section +public section noncomputable section @@ -699,7 +699,7 @@ def initializedNormalizedResidualField (Cagree : SourceCoefficientAgreement M D) /-- Initialized correction data, constructed using `EulerPacketCorrectionCoefficients.correctionDataOfFields`. -/ -def initializedCorrectionData (Cagree : SourceCoefficientAgreement M D) +@[expose] def initializedCorrectionData (Cagree : SourceCoefficientAgreement M D) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : EulerAllOrderCorrectionData.Data period D.T := EulerPacketCorrectionCoefficients.correctionDataOfFields D period k⁻¹ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionParity.lean index 1126360978..5c6b878373 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedCorrectionParity.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitializedFieldParity /-! The actual initialized correction data have all the joint parities required by the drift-aware correction and pressure construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedExactLifted.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedExactLifted.lean index 1fdef2aca7..32618ec666 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedExactLifted.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedExactLifted.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitializedCorrectionParity /-! Source budgets and the actual initialized residual construct exact corrected lifted packets at every sufficiently large frequency. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedFieldParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedFieldParity.lean index dad6fc0f84..f22c3b8649 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedFieldParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedFieldParity.lean @@ -27,7 +27,7 @@ section The compact terminal wave supplies the odd input without an additional assumption on the constructed solution. -/ -@[expose] public section +public section noncomputable section @@ -101,7 +101,7 @@ section /-! Every initialized profile inherits reflection parity from the actual terminal wave and the prescribed source coefficient symmetries. -/ -@[expose] public section +public section noncomputable section @@ -141,7 +141,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedHessianError.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedHessianError.lean index bb9cd11f70..8bf1c2240f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedHessianError.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedHessianError.lean @@ -27,7 +27,7 @@ section /-! The initialized finite pressure has its actual leading angular force and a uniformly small covector remainder. -/ -@[expose] public section +public section noncomputable section @@ -200,7 +200,7 @@ section /-! The leading pressure tensor of the actual joined primary. Both angular derivatives below are derivatives of its constructed scalar pressure. -/ -@[expose] public section +public section noncomputable section @@ -220,7 +220,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS /-- Coefficient, given by `-(2*a*⟪D.normal.field t x, D.M.field t x (canonicalVelocity τ hτ hτT B ξ hs t x)⟫_ℝ)/‖D.normal.field t x‖^2`. -/ -def coefficient (a : ℝ) (t : Icc (0 : ℝ) D.T) (x : Space) : ℝ := +@[expose] def coefficient (a : ℝ) (t : Icc (0 : ℝ) D.T) (x : Space) : ℝ := -(2*a*⟪D.normal.field t x, D.M.field t x (canonicalVelocity τ hτ hτT B ξ hs t x)⟫_ℝ)/‖D.normal.field t x‖^2 @@ -321,7 +321,7 @@ end end -@[expose] public section +public section noncomputable section @@ -339,7 +339,7 @@ open scoped ContDiff variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] /-- Initialized pressure hessian cost, constructed using `fastHessianCost`. -/ -def initializedPressureHessianCost {D : Data U} {q : ℕ} {R₀ : ℝ} +@[expose] def initializedPressureHessianCost {D : Data U} {q : ℕ} {R₀ : ℝ} (NB : EulerTransversePacketJoin.NormalBudget D q R₀) (R H0 Rc C : ℝ) : ℝ := fastHessianCost (P := period) NB (4*R) (fixedVelocityGradeCost R H0 1) + 9*C*physicalFixedCost D Rc C (4*R) 1*sobolevEmbeddingConstant period 3 * diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedOutputCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedOutputCosts.lean index 23b702afab..d4e40c046e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedOutputCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedOutputCosts.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitializedParameterBounds /-! One fixed polynomial controls both correction admissibility and every source multiplier in the same-Q shear/Hessian and graph-flow estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedParameterBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedParameterBounds.lean index 5c08759781..a60522ad4e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedParameterBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedParameterBounds.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourcePrimitiveBounds /-! Reusable bounds for the actual parameters entering the canonical correction. They all use the same fixed polynomial envelope. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedPressureBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedPressureBudgets.lean index 1a78638286..51084e4807 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedPressureBudgets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedPressureBudgets.lean @@ -28,7 +28,7 @@ section the unit grade budget. This is derived from the same source solve used by the velocity recursion. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedProfiles.lean index d7a6b7b337..c46d7cee0f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedProfiles.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketTerminalPrimaryBudget /-! Uniform recursive packet bounds with the literal primary initialization discharged. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized profiles, given by `joinedSourceProfiles period M D τ hτ hτT B (joinedTerminalPrimary period M D τ hτ hτT B (initialData D δ hδ (α • ξ) hs))`. -/ -def initializedProfiles : ℕ → Profile := +@[expose] def initializedProfiles : ℕ → Profile := joinedSourceProfiles period M D τ hτ hτT B (joinedTerminalPrimary period M D τ hτ hτT B (initialData D δ hδ (α • ξ) hs)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRadiusPolynomial.lean index d60dd0ba9c..8d2b3e2bd3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRadiusPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRadiusPolynomial.lean @@ -22,7 +22,7 @@ section budgets that retain it. Quantitative bounds must concern this radius, rather than an arbitrary witness of a radius-existence theorem. -/ -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRemainder.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRemainder.lean index b3ff53bd92..2077a11d32 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRemainder.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedRemainder.lean @@ -20,7 +20,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPiolaData /-! The literal initialized finite packet is its actual primary plus a remainder with a proved physical C1 bound. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,7 @@ theorem initializedProfiles_one_mean : /-- Initialized primary remainder, given by `initializedVelocity M D τ hτ hτT B δ hδ ξ hs α N κ - κ • vector τ hτ hτT B (initialData D δ hδ (α • ξ) hs)`. -/ -def initializedPrimaryRemainder (N : ℕ) (κ : ℝ) : VectorField := +@[expose] def initializedPrimaryRemainder (N : ℕ) (κ : ℝ) : VectorField := initializedVelocity M D τ hτ hτT B δ hδ ξ hs α N κ - κ • vector τ hτ hτT B (initialData D δ hδ (α • ξ) hs) @@ -161,7 +161,7 @@ theorem initializedPrimaryRemainder_physical_fderiv (N : ℕ) (hN : 1 ≤ N) (k omit H NB W LM WM BC hRc hcost hδ1 hα hR WP hgrowth in /-- The constant contains no packet frequency or derivative of the inverse flow. -/ -def initializedRemainderDerivativeCost (R H0 : ℝ) : ℝ := +@[expose] def initializedRemainderDerivativeCost (R H0 : ℝ) : ℝ := 8*‖coordinateEquiv.symm.toContinuousLinearMap‖*sobolevEmbeddingConstant period 3 * R*(fixedVelocityGradeCost R H0 2+2) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedResidualEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedResidualEquation.lean index df544e5025..13602ef9b0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedResidualEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedResidualEquation.lean @@ -24,7 +24,7 @@ section Field in the closed lifted gradient space. Both the mean and oscillatory pieces come from the actual source inverses. -/ -@[expose] public section +public section noncomputable section @@ -210,7 +210,7 @@ end end -@[expose] public section +public section noncomputable section @@ -244,7 +244,7 @@ variable (M : EulerMeanPacketProvider.Data) /-- Initialized velocity, given by `fieldSum (N+1) κ (assembledVelocity N (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α))`. -/ -def initializedVelocity (N : ℕ) (κ : ℝ) : VectorField := +@[expose] def initializedVelocity (N : ℕ) (κ : ℝ) : VectorField := fieldSum (N+1) κ (assembledVelocity N (initializedProfiles M D τ hτ hτT B δ hδ ξ hs α)) /-- Initialized velocity field as an element of `Field period D.T (initializedVelocity M D τ hτ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformBounds.lean index 9bc3ff0d9f..4160d133d3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformBounds.lean @@ -22,7 +22,7 @@ section guard. This constructor does not appeal to an eventual threshold depending on a chosen parent or on an arbitrary radius witness. -/ -@[expose] public section +public section noncomputable section @@ -99,7 +99,7 @@ end end -@[expose] public section +public section noncomputable section @@ -108,7 +108,7 @@ namespace EulerPacketInitializedCost open EulerPacketCorrectionOutput EulerPacketProfileRecursion EulerPacketTerminalDatum /-- Weight size, given by `outputEnvelope period (envelope W)`. -/ -def weightSize (W : ℝ) : ℝ := outputEnvelope period (envelope W) +@[expose] def weightSize (W : ℝ) : ℝ := outputEnvelope period (envelope W) theorem weightSize_pos (W : ℝ) (hW : 0 ≤ W) : 0 < weightSize W := zero_lt_one.trans_le (output_components period (envelope W) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformCosts.lean index 5d169d7d31..892f88d529 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInitializedUniformCosts.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourcePrimitiveBounds /-! A fixed polynomial bounds all five costs for the literal canonical initialized packet radius. No arbitrary radius witness is used. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open EulerPacketTerminalDatum EulerPacketProfileRecursion EulerPacketCylinderFie /-- Envelope, given by `1+W+EulerPacketRadiusPolynomial.radiusEnvelope W + EulerPacketCorrectionPrimitive.primitiveEnvelope period W`. -/ -def envelope (W : ℝ) : ℝ := 1+W+EulerPacketRadiusPolynomial.radiusEnvelope W + +@[expose] def envelope (W : ℝ) : ℝ := 1+W+EulerPacketRadiusPolynomial.radiusEnvelope W + EulerPacketCorrectionPrimitive.primitiveEnvelope period W /-- Polynomial, constructed using `Polynomial.C`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketInverseFlowGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketInverseFlowGevrey.lean index b7dc5e8c50..38f4a1fbb6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketInverseFlowGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketInverseFlowGevrey.lean @@ -19,7 +19,7 @@ and its determinant-one cofactor identity. Neither inverse-flow jets nor inverse-deformation jets are independent assumptions. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ theorem inverseFlow_contDiff (t : Icc (0 : ℝ) D.T) : ContDiff ℝ ∞ (Y t) := (inverseFlow_fderiv D X Y hX hY hXY t) /-- Source inverse radius, given by `1 + 18*C^2*R`. -/ -def sourceInverseRadius (C R : ℝ) : ℝ := 1 + 18*C^2*R +@[expose] def sourceInverseRadius (C R : ℝ) : ℝ := 1 + 18*C^2*R lemma sourceInverseRadius_eq (C R : ℝ) : sourceInverseRadius C R = inverseMapRadius (9*C^2) R := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedCoefficientBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedCoefficientBudgets.lean index 979b8ef349..454eef1bdb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedCoefficientBudgets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedCoefficientBudgets.lean @@ -15,7 +15,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OperatorGevreyCalculus /-! Both nonlinear-profile and exact-correction coefficient budgets are derived from the original joined-source coefficient bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedGradeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedGradeBounds.lean index 6bc42948c3..8fe1ab5057 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedGradeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedGradeBounds.lean @@ -50,7 +50,7 @@ joined physical velocity and genuine time derivative. The input and output use the same fixed mixed-word Sobolev order and the same external radius. -/ -@[expose] public section +public section noncomputable section @@ -227,7 +227,7 @@ section /-! Same-radius estimates for the actual corrector, divided by the prescribed time profile. -/ -@[expose] public section +public section noncomputable section @@ -339,7 +339,7 @@ section /-! Restoring arbitrary forcing amplitudes by actual scalar homogeneity. -/ -@[expose] public section +public section noncomputable section @@ -440,7 +440,7 @@ The actual complete transverse inverse has one source-only radius budget. Its bounds are linear in the forcing amplitude and independent of grade. -/ -@[expose] public section +public section noncomputable section @@ -494,7 +494,7 @@ end end -@[expose] public section +public section noncomputable section @@ -516,15 +516,15 @@ variable {P : ℝ} [Fact (0 < P)] (L : Budget D τ hτ hτT B (Fin 4) q) (N : NormalBudget D q L.R) /-- Pressure amplitude, given by `P*pressureCost (Fin 4) q N.Ri N.C N.C 1 L.commonCost`. -/ -def pressureAmplitude : ℝ := P*pressureCost (Fin 4) q N.Ri N.C N.C 1 L.commonCost +@[expose] def pressureAmplitude : ℝ := P*pressureCost (Fin 4) q N.Ri N.C N.C 1 L.commonCost /-- Potential amplitude, given by `3*N.blockAmplitude*(P*L.commonCost)`. -/ def potentialAmplitude : ℝ := 3*N.blockAmplitude*(P*L.commonCost) /-- Potential time amplitude, given by `6*N.blockAmplitude*(P*L.commonCost)`. -/ def potentialTimeAmplitude : ℝ := 6*N.blockAmplitude*(P*L.commonCost) /-- Corrector amplitude, given by `27*N.blockAmplitude^2*(P*L.commonCost)`. -/ -def correctorAmplitude : ℝ := 27*N.blockAmplitude^2*(P*L.commonCost) +@[expose] def correctorAmplitude : ℝ := 27*N.blockAmplitude^2*(P*L.commonCost) /-- Corrector time amplitude, given by `108*N.blockAmplitude^2*(P*L.commonCost)`. -/ -def correctorTimeAmplitude : ℝ := 108*N.blockAmplitude^2*(P*L.commonCost) +@[expose] def correctorTimeAmplitude : ℝ := 108*N.blockAmplitude^2*(P*L.commonCost) variable {raw : VectorField} (G : Forcing P D raw) (A : ℝ) (hA : 0 ≤ A) (d : ℕ) (hforce : ∀ n, block standardDirection q (fun a => pathTranslate P a @@ -631,7 +631,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceConstraints.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceConstraints.lean index dea74d1b76..dab3868fcc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceConstraints.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceConstraints.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketJoinedSupport /-! Genuine mean and high constraints for the joined recursively constructed family. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceEquations.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceEquations.lean index 8634e341fd..5c0ac8685f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceEquations.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceEquations.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketJoinedEquation /-! Actual equations, tangency and pressure regularity at every solved joined grade. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceOperators.lean index defed57755..80abd951cf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceOperators.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketJoinedProvider /-! Literal source operators with the complete positive-history-time high inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceProfiles.lean index 9efc314882..92a6d0c0a0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceProfiles.lean @@ -27,7 +27,7 @@ section /-! The complete history/forward high inverse preserves the actual recursive symmetries. -/ -@[expose] public section +public section noncomputable section @@ -134,7 +134,7 @@ section /-! All-grade admissibility for the actual history/forward packet recursion. -/ -@[expose] public section +public section noncomputable section @@ -211,7 +211,7 @@ section /-! Every grade constructed with the joined inverse has the prescribed joint parity. -/ -@[expose] public section +public section noncomputable section @@ -262,7 +262,7 @@ end end -@[expose] public section +public section noncomputable section @@ -279,7 +279,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Joined source profiles, given by `profiles (joinedSourceOperators P M D τ hτ hτT B) primary`. -/ -def joinedSourceProfiles : ℕ → Profile := +@[expose] def joinedSourceProfiles : ℕ → Profile := profiles (joinedSourceOperators P M D τ hτ hτT B) primary /-- Joined source profile witness, given by `joinedProfileWitness M D hT τ hτ hτT B diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceRegularity.lean index 53e5290552..87635198bc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedSourceRegularity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourceRegularity /-! Classical spatial slices and true within-time derivatives of the joined recursive family. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedStepRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedStepRegularity.lean index b955f79ec0..766960de3c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedStepRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedStepRegularity.lean @@ -22,7 +22,7 @@ section /-! Support and zero angular mean of the literal joined corrector and its actual time derivative. -/ -@[expose] public section +public section noncomputable section @@ -133,7 +133,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedUniformProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedUniformProfiles.lean index 9f87b5fba2..cc76b71c8a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedUniformProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketJoinedUniformProfiles.lean @@ -27,7 +27,7 @@ section /-! One complete quantitative recursion step, using the actual mean and joined transverse solvers. -/ -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownDecomposition.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownDecomposition.lean index 3e4e6ac098..c6acbcef2b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownDecomposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownDecomposition.lean @@ -13,7 +13,7 @@ Exact finite A/B/C decomposition of the known force. The only fast products retained are BA, BC, CA and CC. This is raw algebra on the actual sliced jets. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,7 @@ theorem sum_knownTerm {E : Type*} [AddCommMonoid E] (f : KnownTerm → E) : namespace KnownTerm /-- Raw as an element of `VectorField`. -/ -def raw (k : KnownTerm) (O : Operators) (p : ℕ) (a : ℕ → Profile) +@[expose] def raw (k : KnownTerm) (O : Operators) (p : ℕ) (a : ℕ → Profile) (i j : ℕ) : VectorField := fun z => match k with | .previousLinear => if i=0 ∧ j=0 then @@ -80,13 +80,13 @@ def raw (k : KnownTerm) (O : Operators) (p : ℕ) (a : ℕ → Profile) a z j) else 0 /-- These two families have zero angular mean by periodicity. -/ -def zeroMean (k : KnownTerm) : Bool := +@[expose] def zeroMean (k : KnownTerm) : Bool := match k with | .fastMeanHigh | .fastMeanCorrector => true | _ => false /-- The pure mean slow product is constant in angle. -/ -def meanOnly (k : KnownTerm) : Bool := +@[expose] def meanOnly (k : KnownTerm) : Bool := match k with | .slow .mean .mean => true | _ => false diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceBounds.lean index 91b49e0ff1..bdb4219bb6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceBounds.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderWeightedLinear /-! Quantitative bounds on the actual masked fields used in the known forcing. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceScales.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceScales.lean index 4f51cc19d6..7d8f48228a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieceScales.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketShiftArithmetic /-! Uniform shifts and actual time profiles for the three known pieces of every grade. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieces.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieces.lean index fe5d42346a..84b5aa020e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieces.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownPieces.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSlicedAssembly /-! The three actual, strictly known pieces of a recursive velocity jet. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ instance : Fintype KnownPiece where namespace KnownPiece /-- Active as an element of `Prop`. -/ -def active (k : KnownPiece) (p i : ℕ) : Prop := +@[expose] def active (k : KnownPiece) (p i : ℕ) : Prop := match k with | .high => 1 ≤ i ∧ i < p | .mean => 2 ≤ i ∧ i < p @@ -51,7 +51,7 @@ def profileIndex (k : KnownPiece) (i : ℕ) : ℕ := | .corrector => i-1 /-- Raw, with branches according to `k.active p i`. -/ -def raw (k : KnownPiece) (p : ℕ) (a : ℕ → Profile) (i : ℕ) : VectorField := +@[expose] def raw (k : KnownPiece) (p : ℕ) (a : ℕ → Profile) (i : ℕ) : VectorField := if k.active p i then match k with | .high => (a i).high @@ -60,7 +60,7 @@ def raw (k : KnownPiece) (p : ℕ) (a : ℕ → Profile) (i : ℕ) : VectorField else 0 /-- Jet, given by `slicedJet O.interval (k.raw p a i) z`. -/ -def jet (k : KnownPiece) (O : Operators) (p : ℕ) (a : ℕ → Profile) +@[expose] def jet (k : KnownPiece) (O : Operators) (p : ℕ) (a : ℕ → Profile) (z : Domain) (i : ℕ) : VectorJet := slicedJet O.interval (k.raw p a i) z diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermBounds.lean index 9239523b66..29f517de72 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermBounds.lean @@ -22,7 +22,7 @@ section /-! Bounds on the actual masked slow and fast products, with zero terms charged no shifts. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ section /-! Every nonzero known summand fits strictly below its target forcing shift. -/ -@[expose] public section +public section namespace EulerPacketCylinderField.KnownTerm @@ -195,7 +195,7 @@ section /-! The time-profile inequalities for every surviving term of the mean and high forces. -/ -@[expose] public section +public section namespace EulerPacketCylinderField.KnownTerm @@ -272,7 +272,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermFields.lean index 4cf3e65763..ca2aff328c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermFields.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderPrefixLocality /-! Genuine cylinder-path witnesses for each of the fifteen known-force families. -/ -@[expose] public section +public section noncomputable section @@ -124,10 +124,12 @@ theorem angleMean_eq_of_angleIndependent {raw : VectorField} namespace KnownTerm /-- Mean raw, with branches according to `k.zeroMean`. -/ +@[expose] def meanRaw (k : KnownTerm) (O : Operators) (p : ℕ) (a : ℕ → Profile) (i j : ℕ) : VectorField := if k.zeroMean then 0 else angleMean O.period (k.raw O p a i j) /-- High raw, with branches according to `k.meanOnly`. -/ +@[expose] def highRaw (k : KnownTerm) (O : Operators) (p : ℕ) (a : ℕ → Profile) (i j : ℕ) : VectorField := if k.meanOnly then 0 else if k.zeroMean then k.raw O p a i j else k.raw O p a i j-angleMean O.period (k.raw O p a i j) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermSums.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermSums.lean index 543eeb5889..299629f2b3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermSums.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketKnownTermSums.lean @@ -17,7 +17,7 @@ mean force, and the angle-constant BB term is absent from the high force. Every summand is the genuine continuous cylinder L² path already constructed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficient.lean index 7a67a85863..14ffce0d6c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficient.lean @@ -37,7 +37,7 @@ actual continuous path of bounded tensor fields. Finite coordinates prove continuity; the norm estimate uses the original multilinear map directly and therefore has constant one. -/ -@[expose] public section +public section noncomputable section @@ -242,7 +242,7 @@ mixed translation orbit in cylinder L². Every spatial tensor jet is a continuous path in the uniform norm. No integrability on the real cover is asserted or used. -/ -@[expose] public section +public section noncomputable section @@ -323,7 +323,7 @@ end end -@[expose] public section +public section noncomputable section @@ -399,7 +399,7 @@ section are actual smooth bounded cover coefficients. Their quantitative bounds come from the checked weighted Sobolev estimates. -/ -@[expose] public section +public section noncomputable section @@ -472,7 +472,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficientBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficientBounds.lean index 4c01ebd539..4de8933fb4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficientBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedCoefficientBounds.lean @@ -25,7 +25,7 @@ section a small amplitude controlled by the scaled spatial field, the actual normal component, and the correction size. -/ -@[expose] public section +public section noncomputable section @@ -130,7 +130,7 @@ end end -@[expose] public section +public section noncomputable section @@ -148,7 +148,7 @@ def liftedInputConstant (P : ℝ) [Fact (0 < P)] : ℝ := 1 + sobolevEmbeddingCo /-- Lifted input radius, given by `1 + ‖coordinateEquiv.symm.toContinuousLinearMap‖ * (R + ρ⁻¹)`. -/ -def liftedInputRadius (R ρ : ℝ) : ℝ := +@[expose] def liftedInputRadius (R ρ : ℝ) : ℝ := 1 + ‖coordinateEquiv.symm.toContinuousLinearMap‖ * (R + ρ⁻¹) theorem liftedInputConstant_one_le (P : ℝ) [Fact (0 < P)] : 1 ≤ liftedInputConstant P := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedFlowData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedFlowData.lean index b1c8ba5073..07fbd472d5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedFlowData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLiftedFlowData.lean @@ -42,7 +42,7 @@ section /-! The actual lifted time coefficient has simultaneous sup and cylinder L² bounds from the genuine approximation and correction time derivatives. -/ -@[expose] public section +public section noncomputable section @@ -240,7 +240,7 @@ end end -@[expose] public section +public section noncomputable section @@ -252,11 +252,11 @@ open Set MeasureTheory EulerAllOrderCorrectionData EulerLiftedGradientSpace Eule open scoped ContDiff /-- Physical input radius, given by `max (liftedInputRadius R ρ) (liftedInputRadius Rt ρ)`. -/ -def physicalInputRadius (R Rt ρ : ℝ) : ℝ := +@[expose] def physicalInputRadius (R Rt ρ : ℝ) : ℝ := max (liftedInputRadius R ρ) (liftedInputRadius Rt ρ) /-- Physical input size, given by `liftedInputConstant P*((C0+Cn)/k+2*Ev)`. -/ -def physicalInputSize (P k C0 Cn Ev : ℝ) [Fact (0 < P)] : ℝ := +@[expose] def physicalInputSize (P k C0 Cn Ev : ℝ) [Fact (0 < P)] : ℝ := liftedInputConstant P*((C0+Cn)/k+2*Ev) theorem envelope_radius_mono {C R S : ℝ} (hC : 0 ≤ C) (hR : 0 ≤ R) @@ -346,7 +346,7 @@ section velocity gradient and the Hessian of the constructed scalar potential for that same correction. -/ -@[expose] public section +public section noncomputable section @@ -363,7 +363,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Weighted physical gradient cost, given by `((1+9*CF)*physicalFixedCost D R CF ρ⁻¹ 1)*(sobolevEmbeddingConstant P 3*Cw)`. -/ -def weightedPhysicalGradientCost (R CF ρ Cw : ℝ) : ℝ := +@[expose] def weightedPhysicalGradientCost (R CF ρ Cw : ℝ) : ℝ := ((1+9*CF)*physicalFixedCost D R CF ρ⁻¹ 1)*(sobolevEmbeddingConstant P 3*Cw) theorem weightedPhysicalGradientCost_nonneg (R CF ρ Cw : ℝ) @@ -468,7 +468,7 @@ section physical point. The slow primary derivative and finite tail contribute only a fixed source constant divided by the frequency. -/ -@[expose] public section +public section noncomputable section @@ -614,7 +614,7 @@ end end -@[expose] public section +public section noncomputable section @@ -646,7 +646,7 @@ def hessianEnvelope (X : ℝ) : ℝ := /-- Time envelope, given by `6*EulerPacketRadiusPolynomial.normalEnvelope X * (fixedVelocityGradeCost X X 1+fixedVelocityGradeCost X X 2+1)`. -/ -def timeEnvelope (X : ℝ) : ℝ := +@[expose] def timeEnvelope (X : ℝ) : ℝ := 6*EulerPacketRadiusPolynomial.normalEnvelope X * (fixedVelocityGradeCost X X 1+fixedVelocityGradeCost X X 2+1) @@ -655,11 +655,13 @@ def radiusEnvelope (X : ℝ) : ℝ := 1+coordinateCost*(4*X+4*inverseRadiusEnvel /-- Velocity input envelope, given by `liftedInputConstant period*(velocity X X X+normal X X X)`. -/ +@[expose] def velocityInputEnvelope (X : ℝ) : ℝ := liftedInputConstant period*(velocity X X X+normal X X X) /-- Error input envelope, given by `2*liftedInputConstant period*outputEnvelope period X`. -/ def errorInputEnvelope (X : ℝ) : ℝ := 2*liftedInputConstant period*outputEnvelope period X /-- Time input envelope, given by `2*liftedInputConstant period*(timeEnvelope X+outputEnvelope period X)`. -/ +@[expose] def timeInputEnvelope (X : ℝ) : ℝ := 2*liftedInputConstant period*(timeEnvelope X+outputEnvelope period X) /-- Weighted error envelope, given by `(1+9*X)*physicalEnvelope X (4*inverseRadiusEnvelope diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLinearCostAbsorption.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLinearCostAbsorption.lean index 9cb9c89926..c12cebb363 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLinearCostAbsorption.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLinearCostAbsorption.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketGradeAbsorption /-! A single spare shift absorbs every fixed linear-operator amplitude at the same radius. -/ -@[expose] public section +public section namespace EulerGevrey diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLowBoundPropagation.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLowBoundPropagation.lean index dff211cc95..7854fb7c91 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLowBoundPropagation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLowBoundPropagation.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Numerical absorption in the sharp gradient and Hessian bounds, and the common localized coercivity guard for all nested horizons. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLowConstants.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLowConstants.lean index cff032be8e..283901faf1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLowConstants.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLowConstants.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.BaseEulerState /-! Fixed low-order constants are chosen before the stage and base scale. Their slack absorbs the universal good-time and first-packet ratios. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketLowGrades.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketLowGrades.lean index c694c34304..d18bfcbf43 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketLowGrades.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketLowGrades.lean @@ -15,7 +15,7 @@ section /-! The graded expansion and tail estimate for the actual normalized momentum expression. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMajorantShift.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMajorantShift.lean index f02a665bc4..2b063bdefa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMajorantShift.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMajorantShift.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Bound /-! Exact shift gains and the final coarse factorial splitting for finite packets. -/ -@[expose] public section +public section namespace EulerGevrey diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientAlgebra.lean index 4a05a969e0..ea1619808e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientAlgebra.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CoefficientPathOrbit /-! Literal composition, scaling and spatial differentiation of the actual matrix-coefficient witnesses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientGevrey.lean index 23432e21d5..aaae072a21 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMatrixCoefficientGevrey.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds of packet matrix-coefficient witnesses. The derivative radius enlargement occurs only in this fixed coefficient budget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMeanGradeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMeanGradeBounds.lean index e7153c849f..57e7016ba0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMeanGradeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMeanGradeBounds.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketLinearCostAbsorption Only fixed source costs are absorbed into the radius; the grade amplitude cancels without any loss. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMeanPressureGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMeanPressureGradient.lean index 30c9363626..2eae95bb3d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMeanPressureGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMeanPressureGradient.lean @@ -32,7 +32,7 @@ section /-! Actual scalar pressures whose lifted gradients are smooth L² fields. The witnesses below are closed under the literal finite packet assembly. -/ -@[expose] public section +public section noncomputable section @@ -230,7 +230,7 @@ section spaces. Compact ordinary scalar tests give compact cylinder scalar tests, and the bounded embedding carries their closures into one another. -/ -@[expose] public section +public section noncomputable section @@ -317,7 +317,7 @@ end end -@[expose] public section +public section noncomputable section @@ -390,7 +390,7 @@ section This discharges the approximation equation, using the source coefficients and the genuine packet Fields rather than an assumed residual equation. -/ -@[expose] public section +public section noncomputable section @@ -497,7 +497,7 @@ variable (k : ℝ) (hk : k ≠ 0) (hκ : |k⁻¹| ≤ 1) /-- The data used for cancellation has the literal normalized packet field and residual. Its coefficients are the original deformation coefficients. -/ -def coordinateData : EulerAllOrderCorrectionData.Data P D.T := +@[expose] def coordinateData : EulerAllOrderCorrectionData.Data P D.T := correctionDataOfFields D P k⁻¹ hκ (coordinateField D G k) R include hk hW in diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMovingFrame.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMovingFrame.lean index 8859bf4cc1..10205e2e0f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMovingFrame.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMovingFrame.lean @@ -18,7 +18,7 @@ Its angular-velocity entries are derived from the physical ODEs and agree with the `frameSkew` matrix used in the source propagation estimates. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open EulerSmoothLimit EulerPacketCrossProduct EulerPacketNormalizedPrimary InnerProductSpace ContinuousLinearMap Matrix WithLp /-- Cross bilinear as an element of `Space →L[ℝ] Space →L[ℝ] Space`. -/ -def crossBilinear : Space →L[ℝ] Space →L[ℝ] Space := +@[expose] def crossBilinear : Space →L[ℝ] Space →L[ℝ] Space := ({ toFun := crossLeft map_add' a b := by apply ContinuousLinearMap.ext @@ -83,16 +83,16 @@ theorem inner_cross_exchange_last (p q r : Space) : ← cross_anticomm (ofLp q) (ofLp p), dotProduct_neg] /-- Frame, given by `![p, q, cross p q]`. -/ -def frame (p q : Space) : Fin 3 → Space := ![p, q, cross p q] +@[expose] def frame (p q : Space) : Fin 3 → Space := ![p, q, cross p q] /-- Frame rate, given by `![rayRate B p, velocityRate B p q, cross (rayRate B p) q + cross p (velocityRate B p q)]`. -/ -def frameRate (B : Space →L[ℝ] Space) (p q : Space) : Fin 3 → Space := +@[expose] def frameRate (B : Space →L[ℝ] Space) (p q : Space) : Fin 3 → Space := ![rayRate B p, velocityRate B p q, cross (rayRate B p) q + cross p (velocityRate B p q)] /-- Frame matrix, given by `⟪frame p q i, B (frame p q j)⟫_ℝ`. -/ -def frameMatrix (B : Space →L[ℝ] Space) (p q : Space) (i j : Fin 3) : ℝ := +@[expose] def frameMatrix (B : Space →L[ℝ] Space) (p q : Space) (i j : Fin 3) : ℝ := ⟪frame p q i, B (frame p q j)⟫_ℝ theorem frame_orthonormal (p q : Space) @@ -189,6 +189,7 @@ theorem frameRate_skew (B : Space →L[ℝ] Space) (p q : Space) · exact hnn /-- Normalized frame, given by `frame (unit (m t)) (unit (v t))`. -/ +@[expose] def normalizedFrame (m v : ℝ → Space) (t : ℝ) : Fin 3 → Space := frame (unit (m t)) (unit (v t)) theorem normalizedFrame_hasDerivAt (B : Space →L[ℝ] Space) {m v : ℝ → Space} {t : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketMovingRay.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketMovingRay.lean index 0c2822b403..3d9b6b6669 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketMovingRay.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketMovingRay.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.InnerProductSpace.Calculus /-! The physical ray ODE in the actual normalized moving frame. -/ -@[expose] public section +public section noncomputable section @@ -46,7 +46,7 @@ theorem movingRayRate_identity (B M : Space →L[ℝ] Space) (p q x : Space) ring /-- Moving ray, given by `⟪normalizedFrame m v t i,r t⟫_ℝ`. -/ -def movingRay (m v r : ℝ → Space) (t : ℝ) (i : Fin 3) : ℝ := +@[expose] def movingRay (m v r : ℝ → Space) (t : ℝ) (i : Fin 3) : ℝ := ⟪normalizedFrame m v t i,r t⟫_ℝ /-- The actual moving-coordinate ray obeys `-(M-S)ᵀ`, with the skew diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketNeighborControlled.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketNeighborControlled.lean index 6a2b7d547c..65779de5ff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketNeighborControlled.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketNeighborControlled.lean @@ -28,7 +28,7 @@ the neighbor-data contribution in the Duhamel estimate rather than requiring the perturbed velocity to have exactly the center initial data. -/ -@[expose] public section +public section noncomputable section @@ -151,7 +151,7 @@ end end -@[expose] public section +public section noncomputable section @@ -297,7 +297,7 @@ theorem controlled_neighbor_relative_error_within exact hb.trans (mul_le_mul_of_nonneg_right hcoef hFp) /-- Neighbor stability constant, given by `1000000000*exp 6`. -/ -def neighborStabilityConstant : ℝ := 1000000000*exp 6 +@[expose] def neighborStabilityConstant : ℝ := 1000000000*exp 6 theorem neighborStabilityConstant_ge : 1000000000 ≤ neighborStabilityConstant := by have h : 1 ≤ exp (6:ℝ) := one_le_exp_iff.mpr (by norm_num) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketNestedHorizons.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketNestedHorizons.lean index 345b572027..52e88e849d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketNestedHorizons.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketNestedHorizons.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.Scale /-! The literal activation times and nested horizons in (38). The same positive initial time interval is available to every finite packet state. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ open Finset Real EulerScale EulerPacketScaleGeometry EulerPacketSourceScales EulerPacketBaseGuardScales /-- Step length, given by `scaleSequence J X (n+1)/sqrt (β n*a n*previousShear J X n)`. -/ -def stepLength (J : ℕ) (X : ℝ) (a β : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def stepLength (J : ℕ) (X : ℝ) (a β : ℕ → ℝ) (n : ℕ) : ℝ := scaleSequence J X (n+1)/sqrt (β n*a n*previousShear J X n) /-- Activation time, given by `∑ i ∈ range n, stepLength J X a β i`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketNormalDriftBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketNormalDriftBounds.lean index ef1d69cc7f..1ce268048d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketNormalDriftBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketNormalDriftBounds.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketRemainderBounds /-! The transported primary has zero normal component, so the actual normal drift is small. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketNormalizedPrimary.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketNormalizedPrimary.lean index 9ba22dd4e5..60e2fbac99 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketNormalizedPrimary.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketNormalizedPrimary.lean @@ -16,7 +16,7 @@ Differentiating the actual normalized ray and primary velocity. The rates are derived from the physical ODEs; no normalized-frame equation is assumed. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open InnerProductSpace ContinuousLinearMap variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] /-- Unit, given by `‖x‖⁻¹ • x`. -/ -def unit (x : E) : E := ‖x‖⁻¹ • x +@[expose] def unit (x : E) : E := ‖x‖⁻¹ • x theorem unit_norm {x : E} (hx : x ≠ 0) : ‖unit x‖ = 1 := by rw [unit, norm_smul, norm_inv, Real.norm_of_nonneg (norm_nonneg _), inv_mul_cancel₀] @@ -95,10 +95,10 @@ theorem unit_hasDerivWithinAt {f : ℝ → E} {f' : E} {t : ℝ} {S : Set ℝ} variable [CompleteSpace E] /-- Ray rate, given by `-B.adjoint p + ⟪p,B p⟫_ℝ • p`. -/ -def rayRate (B : E →L[ℝ] E) (p : E) : E := -B.adjoint p + ⟪p,B p⟫_ℝ • p +@[expose] def rayRate (B : E →L[ℝ] E) (p : E) : E := -B.adjoint p + ⟪p,B p⟫_ℝ • p /-- Velocity rate, given by `-B q + (2*⟪p,B q⟫_ℝ) • p + ⟪q,B q⟫_ℝ • q`. -/ -def velocityRate (B : E →L[ℝ] E) (p q : E) : E := +@[expose] def velocityRate (B : E →L[ℝ] E) (p q : E) : E := -B q + (2*⟪p,B q⟫_ℝ) • p + ⟪q,B q⟫_ℝ • q theorem normalized_ray_hasDerivAt (B : E →L[ℝ] E) {m : ℝ → E} {t : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketOrientedCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketOrientedCoordinates.lean index c65f410c1b..3cbfb712f1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketOrientedCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketOrientedCoordinates.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketMovingFrame /-! Oriented cross products in the actual normalized primary frame. -/ -@[expose] public section +public section noncomputable section @@ -21,7 +21,7 @@ namespace EulerPacketMovingFrame open EulerSmoothLimit EulerPacketCrossProduct InnerProductSpace ContinuousLinearMap WithLp /-- Frame coordinates, given by `⟪frame p q i,x⟫_ℝ`. -/ -def frameCoordinates (p q x : Space) (i : Fin 3) : ℝ := ⟪frame p q i,x⟫_ℝ +@[expose] def frameCoordinates (p q x : Space) (i : Fin 3) : ℝ := ⟪frame p q i,x⟫_ℝ /-- Frame vector, given by `X 0 • p+X 1 • q+X 2 • cross p q`. -/ def frameVector (p q : Space) (X : Fin 3 → ℝ) : Space := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentCoefficientBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentCoefficientBounds.lean index 1e85bf8d95..2d1b8a67ba 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentCoefficientBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentCoefficientBounds.lean @@ -20,7 +20,7 @@ section /-! Polynomial Gevrey bounds for the actual inverse, strain and curvature recovered from a determinant-one deformation and its first two time jets. -/ -@[expose] public section +public section noncomputable section @@ -163,7 +163,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentForwardBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentForwardBudget.lean index 8b11b8f7c4..088334e220 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentForwardBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentForwardBudget.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketParentCoefficientBounds radius. Cofactor bounds discharge the Gram inverse cost. The sole growth estimate supplied here is the genuine weighted homogeneous propagator H3. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ open Set ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients EulerTransve open scoped ContDiff BoundedContinuousFunction /-- Radius as an element of `ℝ`. -/ -def radius (q : ℕ) (T R C C₁ Cp : ℝ) : ℝ := +@[expose] def radius (q : ℕ) (T R C C₁ Cp : ℝ) : ℝ := 1+sobolevCoefficientRadius (Fin 4) R + sobolevCoefficientRadius (Fin 4) (4*inverseRadius R C) + 2*forwardCost q T 0 R C C₁ Cp*(sobolevCoefficientRadius (Fin 4) (4*inverseRadius R C)+1) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelBudgets.lean index 5b6c1660a6..fb12c69062 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelBudgets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelBudgets.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketParentMeanBudget physical-label H⁶ word norms of the displacement, velocity and acceleration. No multiplier bound or inverse-solver estimate is an input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelCoefficients.lean index 84d33b1dd7..78115c936c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentLabelCoefficients.lean @@ -28,7 +28,7 @@ coefficient bounds. The embedding constant is independent of the external order; only the one derivative from displacement to deformation enlarges the coefficient radius. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ open Set MeasureTheory Finset ContinuousLinearMap EulerSmoothLimit open scoped ContDiff /-- Direction, given by `EuclideanSpace.single i 1`. -/ -def direction (i : Fin 3) : Space := EuclideanSpace.single i 1 +@[expose] def direction (i : Fin 3) : Space := EuclideanSpace.single i 1 /-- Embedding cost, given by `sobolevEmbeddingConstant 1 3`. -/ def embeddingCost : ℝ := sobolevEmbeddingConstant 1 3 @@ -159,7 +159,7 @@ end end -@[expose] public section +public section noncomputable section @@ -171,11 +171,11 @@ open MeasureTheory ContinuousLinearMap EulerSmoothLimit EulerMeanSolenoidal open scoped ContDiff /-- Coefficient radius, given by `max 1024 (4*K)`. -/ -def coefficientRadius (K : ℝ) : ℝ := max 1024 (4*K) +@[expose] def coefficientRadius (K : ℝ) : ℝ := max 1024 (4*K) /-- Gradient amplitude, given by `embeddingCost*K^2`. -/ -def gradientAmplitude (K : ℝ) : ℝ := embeddingCost*K^2 +@[expose] def gradientAmplitude (K : ℝ) : ℝ := embeddingCost*K^2 /-- Frame amplitude, given by `1+gradientAmplitude K`. -/ -def frameAmplitude (K : ℝ) : ℝ := 1+gradientAmplitude K +@[expose] def frameAmplitude (K : ℝ) : ℝ := 1+gradientAmplitude K theorem coefficientRadius_lower (K : ℝ) : 1024 ≤ coefficientRadius K := le_max_left _ _ theorem coefficientRadius_nonneg (K : ℝ) : 0 ≤ coefficientRadius K := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanBudget.lean index 09eebffcba..f9e42445e6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanBudget.lean @@ -15,7 +15,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevCostMonotone costs and the final radius are explicit finite polynomials in those jets, the initial boundary size, and an upper bound for the inverse time length. -/ -@[expose] public section +public section noncomputable section @@ -28,20 +28,20 @@ open Set Real EulerSmoothLimit EulerMeanCoefficients EulerPacketPiola EulerPacke EulerTimeLpGramSobolev EulerPacketParentMeanCoercivity /-- Curvature amplitude, given by `27*C^2*C₂`. -/ -def curvatureAmplitude (C C₂ : ℝ) : ℝ := 27*C^2*C₂ +@[expose] def curvatureAmplitude (C C₂ : ℝ) : ℝ := 27*C^2*C₂ /-- Operator cost, given by `operatorBlockAmplitude (Fin 4) q T R C C₁ (curvatureAmplitude C C₂) C₁ scaledBoundaryOperatorAmplitude L`. -/ -def operatorCost (q : ℕ) (T R C C₁ C₂ L : ℝ) : ℝ := +@[expose] def operatorCost (q : ℕ) (T R C C₁ C₂ L : ℝ) : ℝ := operatorBlockAmplitude (Fin 4) q T R C C₁ (curvatureAmplitude C C₂) C₁ scaledBoundaryOperatorAmplitude L /-- Forcing cost, given by `forcingBlockAmplitude (Fin 4) q T R C C₁ 1`. -/ -def forcingCost (q : ℕ) (T R C C₁ : ℝ) : ℝ := +@[expose] def forcingCost (q : ℕ) (T R C C₁ : ℝ) : ℝ := forcingBlockAmplitude (Fin 4) q T R C C₁ 1 /-- Weak cost as an element of `ℝ`. -/ -def weakCost (q : ℕ) (T R C C₁ C₂ L : ℝ) : ℝ := +@[expose] def weakCost (q : ℕ) (T R C C₁ C₂ L : ℝ) : ℝ := 1+sobolevInverseCost (inverseEnvelope C C₁) (operatorCost q T R C C₁ C₂ L) q * (operatorCost q T R C C₁ C₂ L+forcingCost q T R C C₁) @@ -53,7 +53,7 @@ def gramCost (q : ℕ) (R C C₁ V : ℝ) : ℝ := /-- Radius, given by `1+2*(weakCost q T R C C₁ C₂ L+gramCost q R C C₁ 1+gramCost q R C C₁ (Ti+2)) * (sobolevCoefficientRadius (Fin 4) R+1)`. -/ -def radius (q : ℕ) (T Ti R C C₁ C₂ L : ℝ) : ℝ := +@[expose] def radius (q : ℕ) (T Ti R C C₁ C₂ L : ℝ) : ℝ := 1+2*(weakCost q T R C C₁ C₂ L+gramCost q R C C₁ 1+gramCost q R C C₁ (Ti+2)) * (sobolevCoefficientRadius (Fin 4) R+1) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanCoercivity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanCoercivity.lean index 3f18edd97b..7290862bdf 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanCoercivity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentMeanCoercivity.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketParentCoefficientBounds /-! Explicit polynomial bounds for the actual mean Gram and time-form inverse constants, derived from a determinant-one parent deformation. -/ -@[expose] public section +public section noncomputable section @@ -44,11 +44,11 @@ local instance instPacketParentMeanCoercivity4 : NormedSpace ℝ (solenoidalSpac inferInstance /-- Gram inverse envelope, given by `(3*C^2+1)^2`. -/ -def gramInverseEnvelope (C : ℝ) : ℝ := (3*C^2+1)^2 +@[expose] def gramInverseEnvelope (C : ℝ) : ℝ := (3*C^2+1)^2 /-- Transport envelope, given by `1+(2*(gramInverseEnvelope C)^2*C^2*C₁+gramInverseEnvelope C*C₁)+gramInverseEnvelope C*C`. -/ -def transportEnvelope (C C₁ : ℝ) : ℝ := +@[expose] def transportEnvelope (C C₁ : ℝ) : ℝ := 1+(2*(gramInverseEnvelope C)^2*C^2*C₁+gramInverseEnvelope C*C₁)+gramInverseEnvelope C*C /-- Inverse envelope, given by `2*(transportEnvelope C C₁)^2`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentNormalBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentNormalBudget.lean index 1df4ca30d8..a9dff4eaf4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentNormalBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentNormalBudget.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketNormalBudget and its first time derivative. Its radius is an explicit polynomial in their Gevrey radius and amplitudes; no inverse or strain jet bound is an input. -/ -@[expose] public section +public section noncomputable section @@ -24,14 +24,14 @@ open Set EulerSmoothLimit EulerMeanCoefficients EulerPacketCofactor EulerPacketP EulerGevrey EulerTimeLpGramGevrey EulerParameterWordGevrey EulerSourceCylinderTimeBounds /-- Amplitude, given by `9*C^2+27*C^2*C₁`. -/ -def amplitude (C C₁ : ℝ) : ℝ := 9*C^2+27*C^2*C₁ +@[expose] def amplitude (C C₁ : ℝ) : ℝ := 9*C^2+27*C^2*C₁ /-- Inverse radius, given by `2*(1+(1+C)^2*(3*(amplitude C C₁)^2+2))*(R+1)`. -/ -def inverseRadius (R C C₁ : ℝ) : ℝ := +@[expose] def inverseRadius (R C C₁ : ℝ) : ℝ := 2*(1+(1+C)^2*(3*(amplitude C C₁)^2+2))*(R+1) /-- Radius, given by `16*(R+4*inverseRadius R C C₁+1)`. -/ -def radius (R C C₁ : ℝ) : ℝ := 16*(R+4*inverseRadius R C C₁+1) +@[expose] def radius (R C C₁ : ℝ) : ℝ := 16*(R+4*inverseRadius R C C₁+1) theorem amplitude_nonneg (C C₁ : ℝ) (hC₁ : 0 ≤ C₁) : 0 ≤ amplitude C C₁ := by unfold amplitude diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentPhysicalBudgets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentPhysicalBudgets.lean index 9b9cb1c49a..d8c7bc5b6f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentPhysicalBudgets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentPhysicalBudgets.lean @@ -32,7 +32,7 @@ section derivative of the deformation and the Jacobi equation. Uniqueness of within-interval derivatives includes both endpoints of the interval. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ end end -@[expose] public section +public section noncomputable section @@ -212,7 +212,7 @@ end end -@[expose] public section +public section noncomputable section @@ -229,7 +229,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS def halfBall : Set Space := {x | ‖x‖ ≤ (1/2 : ℝ)} /-- Physical cost, given by `3*(frameAmplitude K)^3*Cp`. -/ -def physicalCost (K Cp : ℝ) : ℝ := 3*(frameAmplitude K)^3*Cp +@[expose] def physicalCost (K Cp : ℝ) : ℝ := 3*(frameAmplitude K)^3*Cp theorem physicalCost_nonneg (K Cp : ℝ) (hCp : 0 ≤ Cp) : 0 ≤ physicalCost K Cp := by have h := frameAmplitude_nonneg K diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketParentTransverseCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketParentTransverseCosts.lean index 83489dc861..63863e96b7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketParentTransverseCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketParentTransverseCosts.lean @@ -17,7 +17,7 @@ The input inverse bound is derived from determinant-one deformation data; no inverse solver norm or forcing-dependent constant appears in the final radius. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ def accelerationCost (q : ℕ) (R C C₁ V : ℝ) : ℝ := (accelerationBlockAmplitude (Fin 4) q R C C₁ 1 V) /-- Inverse radius, given by `2*(1+gramInverseEnvelope C*(3*C^2+2))*(R+1)`. -/ -def inverseRadius (R C : ℝ) : ℝ := +@[expose] def inverseRadius (R C : ℝ) : ℝ := 2*(1+gramInverseEnvelope C*(3*C^2+2))*(R+1) /-- Forward cost, constructed using `forwardSobolevCost`. -/ @@ -55,7 +55,7 @@ def forwardCost (q : ℕ) (S Ti R C C₁ Cp : ℝ) : ℝ := (18*inverseRadius R C*C*C₁) (4*inverseRadius R C) /-- Radius as an element of `ℝ`. -/ -def radius (q : ℕ) (T S Ti R C C₁ C₂ Cp : ℝ) : ℝ := +@[expose] def radius (q : ℕ) (T S Ti R C C₁ C₂ Cp : ℝ) : ℝ := 1+2*(historyCost q T R C C₁ C₂+accelerationCost q R C C₁ 1 + accelerationCost q R C C₁ (Ti+2))*(sobolevCoefficientRadius (Fin 4) R+1) + sobolevCoefficientRadius (Fin 4) (4*inverseRadius R C) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPeriodicPotential.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPeriodicPotential.lean index 43db72e0a5..e614f77176 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPeriodicPotential.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPeriodicPotential.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketPotentialRegularity /-! The literal angular vector potential on the periodic cylinder. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCoefficients.lean index 12ad1c9328..ce85d83703 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCoefficients.lean @@ -19,7 +19,7 @@ small scaled matrix errors used in source propagation. The fixed numerical loss absorbs rotation of the normalized frame. -/ -@[expose] public section +public section noncomputable section @@ -32,13 +32,13 @@ open Set EulerSmoothLimit EulerPacketNormalizedPrimary EulerPacketRay /-- Rescaled frame, given by `frameMatrix (B (physicalTime t₀ a ε τ)) (unit (m (physicalTime t₀ a ε τ))) (unit (v (physicalTime t₀ a ε τ)))`. -/ -def rescaledFrame (B : ℝ → Space →L[ℝ] Space) (m v : ℝ → Space) +@[expose] def rescaledFrame (B : ℝ → Space →L[ℝ] Space) (m v : ℝ → Space) (t₀ a ε τ : ℝ) : Fin 3 → Fin 3 → ℝ := frameMatrix (B (physicalTime t₀ a ε τ)) (unit (m (physicalTime t₀ a ε τ))) (unit (v (physicalTime t₀ a ε τ))) /-- Rescaled shear, given by `primaryShear c m v (physicalTime t₀ a ε τ)`. -/ -def rescaledShear (c : ℝ) (m v : ℝ → Space) (t₀ a ε τ : ℝ) : ℝ := +@[expose] def rescaledShear (c : ℝ) (m v : ℝ → Space) (t₀ a ε τ : ℝ) : ℝ := primaryShear c m v (physicalTime t₀ a ε τ) /-- All three coefficient-error bounds follow from physical norm and time diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCompression.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCompression.lean index 19b19218d8..48a8bca3f8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCompression.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCompression.lean @@ -19,7 +19,7 @@ section # Packet Target Compression -/ -@[expose] public section +public section noncomputable section @@ -112,7 +112,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCorrectionPotential.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCorrectionPotential.lean index 16549a0868..83ed732b31 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCorrectionPotential.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalCorrectionPotential.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketContinuousInverse physical coordinates. Its gradient is exactly the inverse-transpose reconstruction used in the quantitative correction estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalEulerTransform.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalEulerTransform.lean index 9c5f12b4b6..90378004e9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalEulerTransform.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalEulerTransform.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod flow. These identities convert the normalized lifted equation into the ordinary Euler momentum residual of the physical perturbation. -/ -@[expose] public section +public section noncomputable section @@ -27,14 +27,14 @@ open Set InnerProductSpace ContinuousLinearMap EulerGraphPullback EulerLagrangia variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- Space time graph, given by `(fst ℝ ℝ E).prod ((graphMap k m).comp (snd ℝ ℝ E))`. -/ -def spaceTimeGraph (k : ℝ) (m : E) : (ℝ × E) →L[ℝ] (ℝ × (E × ℝ)) := +@[expose] def spaceTimeGraph (k : ℝ) (m : E) : (ℝ × E) →L[ℝ] (ℝ × (E × ℝ)) := (fst ℝ ℝ E).prod ((graphMap k m).comp (snd ℝ ℝ E)) theorem spaceTimeGraph_apply (k : ℝ) (m : E) (q : ℝ × E) : spaceTimeGraph k m q = (q.1,(q.2,k*⟪m,q.2⟫_ℝ)) := rfl /-- Graph velocity, given by `κ • F q (z (spaceTimeGraph k m q))`. -/ -def graphVelocity (κ k : ℝ) (m : E) (F : ℝ × E → E →L[ℝ] E) +@[expose] def graphVelocity (κ k : ℝ) (m : E) (F : ℝ × E → E →L[ℝ] E) (z : ℝ × (E × ℝ) → E) (q : ℝ × E) : E := κ • F q (z (spaceTimeGraph k m q)) @@ -129,15 +129,15 @@ theorem euler_residual_of_pullback hXtime hu hw htime hp hq hparent,hwX t x,hadv,hpress] /-- Inverse coordinates, given by `(q.1,Y q)`. -/ -def inverseCoordinates (Y : ℝ × E → E) (q : ℝ × E) : ℝ × E := (q.1,Y q) +@[expose] def inverseCoordinates (Y : ℝ × E → E) (q : ℝ × E) : ℝ × E := (q.1,Y q) /-- Physical velocity, defined pointwise by `graphVelocity κ k m F z (inverseCoordinates Y q)`. -/ -def physicalVelocity (κ k : ℝ) (m : E) (F : ℝ × E → E →L[ℝ] E) +@[expose] def physicalVelocity (κ k : ℝ) (m : E) (F : ℝ × E → E →L[ℝ] E) (z : ℝ × (E × ℝ) → E) (Y : ℝ × E → E) : ℝ × E → E := fun q => graphVelocity κ k m F z (inverseCoordinates Y q) /-- Physical pressure, defined pointwise by `Q (inverseCoordinates Y q)`. -/ -def physicalPressure (Q : ℝ × E → ℝ) (Y : ℝ × E → E) : ℝ × E → ℝ := +@[expose] def physicalPressure (Q : ℝ × E → ℝ) (Y : ℝ × E → E) : ℝ × E → ℝ := fun q => Q (inverseCoordinates Y q) /-- The physical perturbation is defined by the actual inverse flow. The diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrameRenewal.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrameRenewal.lean index af7e8ebd3a..80f29175fd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrameRenewal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrameRenewal.lean @@ -21,7 +21,7 @@ section /-! Exact scaled cross and pressure algebra used by physical frame renewal. -/ -@[expose] public section +public section noncomputable section @@ -66,7 +66,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrequencyBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrequencyBounds.lean index b61776e359..937e5eb380 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrequencyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalFrequencyBounds.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! A fixed polynomial frequency loss for every actual physical spatial derivative of a reconstructed lifted field. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Physical radius cost, given by `sourceInverseRadius C R*(9*C^2*(R + (‖coordinateEquiv.symm.toContinuousLinearMap‖*(1+‖D.m₀‖))*S)+2)`. -/ -def physicalRadiusCost (R C S : ℝ) : ℝ := +@[expose] def physicalRadiusCost (R C S : ℝ) : ℝ := sourceInverseRadius C R*(9*C^2*(R + (‖coordinateEquiv.symm.toContinuousLinearMap‖*(1+‖D.m₀‖))*S)+2) @@ -61,7 +61,7 @@ theorem physicalRadius_le_linear (k R C S : ℝ) (hk : 1 ≤ k) (hR : 0 ≤ R) ( ring) /-- Physical fixed cost, given by `3*C*(physicalRadiusCost D R C S)^n*(n.factorial : ℝ)^2`. -/ -def physicalFixedCost (R C S : ℝ) (n : ℕ) : ℝ := +@[expose] def physicalFixedCost (R C S : ℝ) (n : ℕ) : ℝ := 3*C*(physicalRadiusCost D R C S)^n*(n.factorial : ℝ)^2 theorem physicalFixedCost_nonneg (R C S : ℝ) (n : ℕ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalGevrey.lean index e0b36941f7..0bce15b6ab 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalGevrey.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder correction. All spatial derivatives are actual derivatives of κF e evaluated on the phase graph and pulled through the inverse parent flow. -/ -@[expose] public section +public section noncomputable section @@ -50,7 +50,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (he : ∀ t x, ContDiff ℝ ∞ (localFieldLift P (e t) x)) /-- Graph reconstruction, given by `κ • D.F.field t x (physicalField P k D.m₀ (e t) x)`. -/ -def graphReconstruction (t : Icc (0 : ℝ) D.T) (x : Space) : Space := +@[expose] def graphReconstruction (t : Icc (0 : ℝ) D.T) (x : Space) : Space := κ • D.F.field t x (physicalField P k D.m₀ (e t) x) include he in @@ -99,7 +99,7 @@ def physicalReconstruction (t : Icc (0 : ℝ) D.T) (x : Space) : Space := graphReconstruction D P κ k e t (Y t x) /-- Physical radius, given by `sourceInverseRadius C R*(9*C^2*(R+frequencyFactor k D.m₀*S)+2)`. -/ -def physicalRadius : ℝ := +@[expose] def physicalRadius : ℝ := sourceInverseRadius C R*(9*C^2*(R+frequencyFactor k D.m₀*S)+2) include he hR hC hA hS hF hb hX hY hXY hdet in diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalLowBounds.lean index a27d4d6487..22df7ab6df 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalLowBounds.lean @@ -15,7 +15,7 @@ bound uses only the negative part of the angular derivative. Its cost therefore retains the narrow-profile factor which is absent from the absolute Hessian bound. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ def shearTerm (amp slope : ℝ) (r w : Space) : Matrix := (amp*slope) • rankOne ℝ w r /-- Pressure term, given by `(-2*amp*⟪r,M w⟫_ℝ*slope/‖r‖^2) • rankOne ℝ r r`. -/ -def pressureTerm (amp slope : ℝ) (M : Matrix) (r w : Space) : Matrix := +@[expose] def pressureTerm (amp slope : ℝ) (M : Matrix) (r w : Space) : Matrix := (-2*amp*⟪r,M w⟫_ℝ*slope/‖r‖^2) • rankOne ℝ r r theorem profile_deriv_abs (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (θ : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalNormBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalNormBounds.lean index 54fb969e58..00082e5d48 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalNormBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalNormBounds.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketScaledVelocity /-! Actual Euclidean norm estimates for the scaled moving coordinates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalPressureGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalPressureGevrey.lean index 082b7b1b4e..b02c7db13d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalPressureGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalPressureGevrey.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Star.Real frequency losses as the velocity correction. The inverse-transpose coefficient bounds follow from the actual determinant-one deformation. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Graph pressure force, given by `κ • (D.FInv.field t x).adjoint (physicalField P k D.m₀ (e t) x)`. -/ -def graphPressureForce (t : Icc (0 : ℝ) D.T) (x : Space) : Space := +@[expose] def graphPressureForce (t : Icc (0 : ℝ) D.T) (x : Space) : Space := κ • (D.FInv.field t x).adjoint (physicalField P k D.m₀ (e t) x) include he in @@ -94,7 +94,7 @@ variable (X Y : Icc (0 : ℝ) D.T → Space → Space) (hXY : ∀ t x, X t (Y t x) = x) /-- Physical pressure force, given by `graphPressureForce D P κ k e t (Y t x)`. -/ -def physicalPressureForce (t : Icc (0 : ℝ) D.T) (x : Space) : Space := +@[expose] def physicalPressureForce (t : Icc (0 : ℝ) D.T) (x : Space) : Space := graphPressureForce D P κ k e t (Y t x) include he hR hC hA hS hF hb hX hY hXY hdet in diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalSize.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalSize.lean index 5c2cd0bccb..df338955c9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalSize.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPhysicalSize.lean @@ -15,7 +15,7 @@ coordinates of source (28). These are identities for the constructed coordinate maps, rather than assumptions on a model system. -/ -@[expose] public section +public section noncomputable section @@ -27,18 +27,18 @@ open EulerSmoothLimit EulerPacketNormalizedPrimary EulerPacketRay EulerPacketCrossProduct InnerProductSpace ContinuousLinearMap /-- Velocity denominator, given by `1+ε^2*(r^2+w₃^2)`. -/ -def velocityDenominator (ε r w₃ : ℝ) : ℝ := 1+ε^2*(r^2+w₃^2) +@[expose] def velocityDenominator (ε r w₃ : ℝ) : ℝ := 1+ε^2*(r^2+w₃^2) theorem velocityDenominator_pos (ε r w₃ : ℝ) : 0 < velocityDenominator ε r w₃ := by unfold velocityDenominator positivity /-- Normalized coupling, given by `⟪unit r,M (unit w)⟫_ℝ`. -/ -def normalizedCoupling (M : Space →L[ℝ] Space) (r w : Space) : ℝ := +@[expose] def normalizedCoupling (M : Space →L[ℝ] Space) (r w : Space) : ℝ := ⟪unit r,M (unit w)⟫_ℝ /-- Normalized tilt, given by `⟪cross (unit r) (unit w),M (unit w)⟫_ℝ/normalizedCoupling M r w`. -/ -def normalizedTilt (M : Space →L[ℝ] Space) (r w : Space) : ℝ := +@[expose] def normalizedTilt (M : Space →L[ℝ] Space) (r w : Space) : ℝ := ⟪cross (unit r) (unit w),M (unit w)⟫_ℝ/normalizedCoupling M r w theorem normalizedCoupling_eq (M : Space →L[ℝ] Space) (r w : Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaAlgebra.lean index 8b45a35d5f..3b4ecb6457 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaAlgebra.lean @@ -14,7 +14,7 @@ The finite-dimensional algebra in the curl Piola identity. Antisymmetrizing determinant-one change of variables transforms curl by `F⁻¹`. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ theorem matrixAntisym_congruence (F A : Mat3) : ring /-- Operator matrix, defined pointwise by `(A (EuclideanSpace.single j 1)) i`. -/ -def operatorMatrix (A : Space →L[ℝ] Space) : Mat3 := +@[expose] def operatorMatrix (A : Space →L[ℝ] Space) : Mat3 := fun i j => (A (EuclideanSpace.single j 1)) i theorem operatorMatrix_apply (A : Space →L[ℝ] Space) (x : Space) (i : Fin 3) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaPair.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaPair.lean index be48c2e279..1bae24074f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaPair.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPiolaPair.lean @@ -40,7 +40,7 @@ vanishes. Compact smooth potentials also produce members of the existing closed divergence-free Bochner L² space. -/ -@[expose] public section +public section noncomputable section @@ -248,7 +248,7 @@ The derivative of the Jacobian cancels by symmetry of the genuine second Fréchet derivative. No curl identity or commutation relation is assumed. -/ -@[expose] public section +public section noncomputable section @@ -342,7 +342,7 @@ end end -@[expose] public section +public section noncomputable section @@ -543,7 +543,7 @@ end end -@[expose] public section +public section noncomputable section @@ -583,12 +583,12 @@ theorem curl_lifted_split (κ : ℝ) (m : Space) (L : LiftTangent →L[ℝ] Spac /-- Covering slow curl, given by `curlMatrix ((fderiv ℝ q z).comp ((ContinuousLinearMap.inl ℝ Space ℝ).comp G))`. -/ -def coveringSlowCurl (G : Space →L[ℝ] Space) (q : LiftTangent → Space) +@[expose] def coveringSlowCurl (G : Space →L[ℝ] Space) (q : LiftTangent → Space) (z : LiftTangent) : Space := curlMatrix ((fderiv ℝ q z).comp ((ContinuousLinearMap.inl ℝ Space ℝ).comp G)) /-- The same angular primitive as in the source, at each ordinary label. -/ -def coveringPotential (P : ℝ) (m : Space → Space) (A : LiftTangent → Space) +@[expose] def coveringPotential (P : ℝ) (m : Space → Space) (A : LiftTangent → Space) (z : LiftTangent) : Space := potential P (m z.1) (fun θ => A (z.1, θ)) z.2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPointJets.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPointJets.lean index 1d31fac4c3..73bddc674e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPointJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPointJets.lean @@ -12,7 +12,7 @@ public import Mathlib.Analysis.InnerProductSpace.Adjoint /-! The linear and bilinear packet operators on actual space-time value/derivative jets. -/ -@[expose] public section +public section noncomputable section @@ -33,40 +33,40 @@ abbrev VectorJet := Jet Space abbrev ScalarJet := Jet ℝ /-- Time direction, given by `(1, (0, 0))`. -/ -def timeDirection : Domain := (1, (0, 0)) +@[expose] def timeDirection : Domain := (1, (0, 0)) /-- Angle direction, given by `(0, (0, 1))`. -/ -def angleDirection : Domain := (0, (0, 1)) +@[expose] def angleDirection : Domain := (0, (0, 1)) /-- Spatial injection, given by `(0 : Space →L[ℝ] ℝ).prod ((ContinuousLinearMap.id ℝ Space).prod (0 : Space →L[ℝ] ℝ))`. -/ -def spatialInjection : Space →L[ℝ] Domain := +@[expose] def spatialInjection : Space →L[ℝ] Domain := (0 : Space →L[ℝ] ℝ).prod ((ContinuousLinearMap.id ℝ Space).prod (0 : Space →L[ℝ] ℝ)) /-- Jet, given by `(f z, fderiv ℝ f z)`. -/ -def jet {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] def jet {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : Domain → E) (z : Domain) : Jet E := (f z, fderiv ℝ f z) /-- Linear part, bundling `toFun`, `map_add`, `map_smul`. -/ -def linearPart (M : Space →L[ℝ] Space) : VectorJet →ₗ[ℝ] Space where +@[expose] def linearPart (M : Space →L[ℝ] Space) : VectorJet →ₗ[ℝ] Space where toFun J := J.2 timeDirection + M J.1 map_add' J K := by simp [add_add_add_comm] map_smul' c J := by simp [smul_add] /-- Slow pressure, bundling `toFun`, `map_add`, `map_smul`. -/ -def slowPressure (FInv : Space →L[ℝ] Space) : ScalarJet →ₗ[ℝ] Space where +@[expose] def slowPressure (FInv : Space →L[ℝ] Space) : ScalarJet →ₗ[ℝ] Space where toFun J := FInv.adjoint ((toDual ℝ Space).symm (J.2.comp spatialInjection)) map_add' J K := by simp [ContinuousLinearMap.add_comp] map_smul' c J := by simp [ContinuousLinearMap.smul_comp] /-- Fast pressure, bundling `toFun`, `map_add`, `map_smul`. -/ -def fastPressure (m : Space) : ScalarJet →ₗ[ℝ] Space where +@[expose] def fastPressure (m : Space) : ScalarJet →ₗ[ℝ] Space where toFun J := J.2 angleDirection • m map_add' J K := by simp [add_smul] map_smul' c J := by simp [smul_smul] /-- Slow advection, bundling `toFun`, `map_add`, `map_smul`, `map_add` and the required compatibility proofs. -/ -def slowAdvection (FInv : Space →L[ℝ] Space) : VectorJet →ₗ[ℝ] VectorJet →ₗ[ℝ] Space where +@[expose] def slowAdvection (FInv : Space →L[ℝ] Space) : VectorJet →ₗ[ℝ] VectorJet →ₗ[ℝ] Space where toFun J := { toFun := fun K => K.2 (spatialInjection (FInv J.1)) map_add' K H := by simp @@ -82,7 +82,7 @@ def slowAdvection (FInv : Space →L[ℝ] Space) : VectorJet →ₗ[ℝ] VectorJ /-- Fast advection, bundling `toFun`, `map_add`, `map_smul`, `map_add` and the required compatibility proofs. -/ -def fastAdvection (m : Space) : VectorJet →ₗ[ℝ] VectorJet →ₗ[ℝ] Space where +@[expose] def fastAdvection (m : Space) : VectorJet →ₗ[ℝ] VectorJet →ₗ[ℝ] Space where toFun J := { toFun := fun K => ⟪m, J.1⟫_ℝ • K.2 angleDirection map_add' K H := by simp [smul_add] @@ -97,7 +97,7 @@ def fastAdvection (m : Space) : VectorJet →ₗ[ℝ] VectorJet →ₗ[ℝ] Spac simp [inner_smul_right, smul_smul] /-- Field sum, given by `evaluate M κ (fun n => u n z)`. -/ -def fieldSum {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] def fieldSum {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (M : ℕ) (κ : ℝ) (u : ℕ → Domain → E) (z : Domain) : E := evaluate M κ (fun n => u n z) @@ -125,7 +125,7 @@ theorem jet_fieldSum {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- This is the literal normalized momentum expression evaluated through its true first derivatives. -/ -def momentumResidual (κ : ℝ) (FInv M : Space →L[ℝ] Space) (m : Space) +@[expose] def momentumResidual (κ : ℝ) (FInv M : Space →L[ℝ] Space) (m : Space) (u : Domain → Space) (p : Domain → ℝ) (z : Domain) : Space := linearPart M (jet u z) + slowPressure FInv (jet p z) + κ⁻¹ • fastPressure m (jet p z) + slowAdvection FInv (jet u z) (jet u z) + κ⁻¹ • fastAdvection m (jet u z) (jet u z) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialMultiplier.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialMultiplier.lean index d844948af1..b13e4275d5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialMultiplier.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialMultiplier.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Inv /-! Smoothness and actual time differentiation of the normalized cross multiplier. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ local instance instPacketPotentialMultiplier5 : TopologicalSpace (Space →L[ℝ (inferInstance : PseudoMetricSpace (Space →L[ℝ] Space)).toUniformSpace.toTopologicalSpace /-- Cross operator linear, bundling `toFun`, `map_add`, `map_smul`. -/ -def crossOperatorLinear : Space →ₗ[ℝ] (Space →L[ℝ] Space) where +@[expose] def crossOperatorLinear : Space →ₗ[ℝ] (Space →L[ℝ] Space) where toFun := crossLeft map_add' a b := by apply ContinuousLinearMap.ext @@ -56,7 +56,7 @@ def crossOperatorLinear : Space →ₗ[ℝ] (Space →L[ℝ] Space) where /-- Cross operator, given by `crossOperatorLinear.mkContinuous 1 (fun a => by change ‖crossLeft a‖ ≤ 1*‖a‖ simpa only [one_mul] using crossLeft_norm_le a)`. -/ -def crossOperator : Space →L[ℝ] (Space →L[ℝ] Space) := +@[expose] def crossOperator : Space →L[ℝ] (Space →L[ℝ] Space) := crossOperatorLinear.mkContinuous 1 (fun a => by change ‖crossLeft a‖ ≤ 1*‖a‖ simpa only [one_mul] using crossLeft_norm_le a) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialRegularity.lean index 231863f040..0dfa83a6c2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPotentialRegularity.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketPotentialMultiplier /-! Spatial smoothness of the source vector potential, derived from its literal integral. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,8 @@ def curlLinear : (Space →L[ℝ] Space) →ₗ[ℝ] Space where /-- Curl operator, given by `curlLinear.toContinuousLinearMap`. -/ def curlOperator : (Space →L[ℝ] Space) →L[ℝ] Space := curlLinear.toContinuousLinearMap -@[simp] theorem curlOperator_apply (A : Space →L[ℝ] Space) : curlOperator A = curlMatrix A := rfl +@[simp] theorem curlOperator_apply (A : Space →L[ℝ] Space) : + curlOperator A = curlMatrix A := by rfl theorem coveringPotential_contDiff (P : ℝ) (hP : 0 ≤ P) (m : Space → Space) (A : LiftTangent → Space) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureCovector.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureCovector.lean index 0c0570a562..e0ef5d3cbc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureCovector.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureCovector.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketGraphHessian /-! The genuine physical pressure gradient has a finite covector expansion. The angular factor k shifts only the high-pressure series. -/ -@[expose] public section +public section noncomputable section @@ -29,11 +29,11 @@ open Set Finset InnerProductSpace ContinuousLinearMap EulerSmoothLimit open scoped ContDiff /-- Angular pressure, defined pointwise by `(pressureJet p z).2 angleDirection • m`. -/ -def angularPressure (m : Space) (p : ScalarField) : VectorField := +@[expose] def angularPressure (m : Space) (p : ScalarField) : VectorField := fun z => (pressureJet p z).2 angleDirection • m /-- Covector, given by `pressureGradient p + k • angularPressure m p`. -/ -def covector (k : ℝ) (m : Space) (p : ScalarField) : VectorField := +@[expose] def covector (k : ℝ) (m : Space) (p : ScalarField) : VectorField := pressureGradient p + k • angularPressure m p /-- Covector grades, constructed using `assemble`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastBounds.lean index c36dfa312f..106a2bf08c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastBounds.lean @@ -32,7 +32,7 @@ section /-! Quantitative Hessian errors retain one inverse-frequency factor. The coefficient bounds are those of the actual source deformation. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ variable {P : ℝ} [Fact (0 < P)] /-- Fast hessian cost, given by `sobolevEmbeddingConstant P 3*A*NB.C^2*(NB.Rc+‖coordinateEquiv.symm.toContinuousLinearMap‖*R)`. -/ -def fastHessianCost (R A : ℝ) : ℝ := +@[expose] def fastHessianCost (R A : ℝ) : ℝ := sobolevEmbeddingConstant P 3*A*NB.C^2*(NB.Rc+‖coordinateEquiv.symm.toContinuousLinearMap‖*R) theorem fastHessianRemainder_bound (a : ScalarField) @@ -146,7 +146,7 @@ section primary by an actual O(k⁻²) cylinder field, uniformly in the truncation length selected by the source frequency guard. -/ -@[expose] public section +public section noncomputable section @@ -223,7 +223,7 @@ theorem covectorGrades_one (hN : 1 ≤ N) (hm : (a 1).meanPressure = 0) : /-- Covector remainder, given by `fieldSum (N+1) κ (covectorGrades N m a)-κ • angularPressure m (a 1).highPressure`. -/ -def covectorRemainder (κ : ℝ) : VectorField := +@[expose] def covectorRemainder (κ : ℝ) : VectorField := fieldSum (N+1) κ (covectorGrades N m a)-κ • angularPressure m (a 1).highPressure /-- Covector remainder field as an element of `Field P T (covectorRemainder (N := N) (a := a) m diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastHessian.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastHessian.lean index 15fcc96f90..4df8e063b1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastHessian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureFastHessian.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Mul /-! The leading angular pressure force gives its actual rank-one Hessian. Only first slow derivatives occur in the remainder. -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerGraphPullba open scoped ContDiff /-- Fast force, given by `k⁻¹ • (a (graphMap k m (Y x)) • transportedNormal m J x)`. -/ -def fastForce (a : LiftTangent → ℝ) (k : ℝ) (m : Space) (Y : Space → Space) +@[expose] def fastForce (a : LiftTangent → ℝ) (k : ℝ) (m : Space) (Y : Space → Space) (J : Space → Space →L[ℝ] Space) (x : Space) : Space := k⁻¹ • (a (graphMap k m (Y x)) • transportedNormal m J x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureJet.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureJet.lean index 29aba7ed3c..027584d73e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureJet.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureJet.lean @@ -19,7 +19,7 @@ interval, while space and angle derivatives are ordinary Fréchet derivatives. No smooth extension across a time endpoint is assumed. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Join derivative, given by `(ContinuousLinearMap.fst ℝ ℝ SpatialDomain).smulRight v + D.comp (ContinuousLinearMap.snd ℝ ℝ SpatialDomain)`. -/ -def joinDerivative (v : E) (D : SpatialDomain →L[ℝ] E) : Domain →L[ℝ] E := +@[expose] def joinDerivative (v : E) (D : SpatialDomain →L[ℝ] E) : Domain →L[ℝ] E := (ContinuousLinearMap.fst ℝ ℝ SpatialDomain).smulRight v + D.comp (ContinuousLinearMap.snd ℝ ℝ SpatialDomain) @@ -43,15 +43,16 @@ theorem joinDerivative_apply (v : E) (D : SpatialDomain →L[ℝ] E) (h : Domain /-- Sliced jet, given by `(f z, joinDerivative (derivWithin (fun t => f (t,z.2)) s z.1) (fderiv ℝ (fun y => f (z.1,y)) z.2))`. -/ -def slicedJet (s : Set ℝ) (f : Domain → E) (z : Domain) : Jet E := +@[expose] def slicedJet (s : Set ℝ) (f : Domain → E) (z : Domain) : Jet E := (f z, joinDerivative (derivWithin (fun t => f (t,z.2)) s z.1) (fderiv ℝ (fun y => f (z.1,y)) z.2)) theorem slicedJet_time (s : Set ℝ) (f : Domain → E) (z : Domain) : (slicedJet s f z).2 timeDirection=derivWithin (fun t => f (t,z.2)) s z.1 := by - change (1 : ℝ) • derivWithin (fun t => f (t,z.2)) s z.1 + - (fderiv ℝ (fun y => f (z.1,y)) z.2) (0 : SpatialDomain)=_ - simp + have hzero : (fderiv ℝ (fun y => f (z.1, y)) z.2) (0, 0) = 0 := by + change (fderiv ℝ (fun y => f (z.1, y)) z.2) 0 = 0 + exact map_zero _ + simpa [slicedJet, joinDerivative_apply, timeDirection] using hzero theorem slicedJet_space (s : Set ℝ) (f : Domain → E) (z : Domain) (v : Space) : (slicedJet s f z).2 (spatialInjection v)=fderiv ℝ (fun y => f (z.1,y)) z.2 (v,0) := by @@ -109,7 +110,7 @@ end end -@[expose] public section +public section noncomputable section @@ -118,7 +119,7 @@ namespace EulerPacketPointJets open EulerFiniteGrades Finset /-- The unused time slot is zero: no time derivative of the scalar potential is required. -/ -def pressureJet (p : Domain → ℝ) (z : Domain) : ScalarJet := +@[expose] def pressureJet (p : Domain → ℝ) (z : Domain) : ScalarJet := (p z, joinDerivative 0 (fderiv ℝ (fun y => p (z.1,y)) z.2)) theorem pressureJet_space (p : Domain → ℝ) (z : Domain) (v : EulerSmoothLimit.Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureScaleCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureScaleCosts.lean index 12a828a29e..816e8a6f3a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureScaleCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureScaleCosts.lean @@ -22,7 +22,7 @@ section polynomial in the parent labels and reciprocal history length. The good interval keeps its absolute size constant. -/ -@[expose] public section +public section noncomputable section @@ -271,7 +271,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureSeries.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureSeries.lean index 297e406fa1..26b54d8bff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPressureSeries.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPressureSeries.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.Scale with any finite collection of the other source costs. Their finite partial sums control the actual low-bound increments. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryCommonRadius.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryCommonRadius.lean index ce38050f98..e8416879a0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryCommonRadius.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryCommonRadius.lean @@ -22,7 +22,7 @@ are changed. The extra lower bound can include the actual terminal-wave radius, before the recursive solve begins. -/ -@[expose] public section +public section noncomputable section @@ -38,32 +38,32 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteS (L : EulerTransversePacketJoin.Budget D τ hτ hτT B ι q) /-- Weak radius as an element of `ℝ`. -/ -def weakRadius : ℝ := +@[expose] def weakRadius : ℝ := 2*blockCost ι q τ L.Rc L.C₀ L.C₁ L.CH (D.initial τ hτ hτT.le).frameLower (endpointForcingCost ι q τ L.Rc L.C₁)*(sobolevCoefficientRadius ι L.Rc+1) /-- Strong radius as an element of `ℝ`. -/ -def strongRadius : ℝ := +@[expose] def strongRadius : ℝ := 2*gramBlockCost ι q (D.initial τ hτ hτT.le).frameLower L.Rc L.C₀ (accelerationBlockAmplitude ι q L.Rc L.C₀ L.C₁ (endpointForcingCost ι q τ L.Rc L.C₁) 1) * (sobolevCoefficientRadius ι L.Rc+1) /-- Uniform radius as an element of `ℝ`. -/ -def uniformRadius : ℝ := +@[expose] def uniformRadius : ℝ := 2*gramBlockCost ι q (D.initial τ hτ hτT.le).frameLower L.Rc L.C₀ (accelerationBlockAmplitude ι q L.Rc L.C₀ L.C₁ (endpointForcingCost ι q τ L.Rc L.C₁) (traceCost τ)) * (sobolevCoefficientRadius ι L.Rc+1) /-- Forward radius as an element of `ℝ`. -/ -def forwardRadius : ℝ := +@[expose] def forwardRadius : ℝ := 2*forwardSobolevCost ι q (D.T-τ) L.C (τ⁻¹+traceCost τ) (forcingCost ι q L.Ri L.C₀*0) (18*L.Ri*L.C₀*L.C₁) (4*L.Ri) * (sobolevCoefficientRadius ι (4*L.Ri)+1) /-- Required radius, given by `max extra (max L.R (max (weakRadius L) (max (strongRadius L) (max (uniformRadius L) (forwardRadius L)))))`. -/ -def requiredRadius (extra : ℝ) : ℝ := +@[expose] def requiredRadius (extra : ℝ) : ℝ := max extra (max L.R (max (weakRadius L) (max (strongRadius L) (max (uniformRadius L) (forwardRadius L))))) @@ -111,7 +111,7 @@ end end -@[expose] public section +public section noncomputable section @@ -128,7 +128,7 @@ variable {P : ℝ} (C : ℝ) /-- Grade radius, constructed using `max`. -/ -def gradeRadius : ℝ := +@[expose] def gradeRadius : ℝ := max L.R (max (H.commonCost*C) (max (H.correctorAmplitude (P := P) N*C) (max (H.correctorTimeAmplitude (P := P) N*C) (3*H.pressureAmplitude (P := P) N*C)))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryDynamics.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryDynamics.lean index 6381ee3a48..30d8a4d426 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryDynamics.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryDynamics.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketTimeData canonical primary. Nonvanishing follows from the prescribed nonzero terminal displacement, rather than from an assumption on the solved velocity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryFactorization.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryFactorization.lean index dc8ee21282..f8b0c88b29 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryFactorization.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryFactorization.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPrimaryPressure interval. This follows from uniqueness for its genuine homogeneous linear ODE, whose coefficients are independent of the angle. -/ -@[expose] public section +public section noncomputable section @@ -133,7 +133,7 @@ theorem referenceValue_pos (δ : ℝ) (hδ : 0 < δ) : 0 < referenceValue δ := /-- The envelope is retained in this actual velocity. On the core it agrees with the unmultiplied history, and its definition is valid for every time. -/ -def envelopedVelocity (δ : ℝ) (hδ : 0 < δ) (ξ : U) +@[expose] def envelopedVelocity (δ : ℝ) (hδ : 0 < δ) (ξ : U) (hs : tsupport innerCutoff ⊆ D.support) (t : ℝ) (x : Space) : Space := (referenceValue δ)⁻¹ • vector τ hτ hτT B (initialData D δ hδ ξ hs) (t,(x,Real.pi/2)) @@ -185,7 +185,7 @@ theorem envelopedVelocity_independent_profile (δ δ' : ℝ) (hδ : 0 < δ) (hδ (envelopedVelocity_history τ hτ hτT B δ' hδ' ξ hs ⟨0,le_rfl,hτ.le⟩ x).symm /-- Canonical velocity, given by `envelopedVelocity τ hτ hτT B 1 zero_lt_one ξ hs t x`. -/ -def canonicalVelocity (ξ : U) (hs : tsupport innerCutoff ⊆ D.support) +@[expose] def canonicalVelocity (ξ : U) (hs : tsupport innerCutoff ⊆ D.support) (t : ℝ) (x : Space) : Space := envelopedVelocity τ hτ hτT B 1 zero_lt_one ξ hs t x diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGlobalShear.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGlobalShear.lean index 30a0ebda6d..845d05da1b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGlobalShear.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGlobalShear.lean @@ -18,7 +18,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod fast derivative is the source shear, and the slow derivative has an explicit inverse-frequency factor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGradeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGradeBounds.lean index b05ce5c31f..7c25bcaa84 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGradeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryGradeBounds.lean @@ -44,7 +44,7 @@ Unit-terminal-data estimates for the actual joined primary. The same external radius controls its history, actual trace, and weighted future. -/ -@[expose] public section +public section noncomputable section @@ -182,7 +182,7 @@ section /-! Unit-data estimates extend to arbitrary actual terminal amplitudes at the same radius. -/ -@[expose] public section +public section noncomputable section @@ -273,7 +273,7 @@ length and the genuine propagator bound. Arbitrary terminal amplitude is restored by the proved exact homogeneity of the constructed solution. -/ -@[expose] public section +public section noncomputable section @@ -321,7 +321,7 @@ end end -@[expose] public section +public section noncomputable section @@ -476,15 +476,15 @@ theorem derivativeCost_nonneg : 0 ≤ H.derivativeCost := by /-- Common cost, given by `H.velocityCost+H.derivativeCost`. -/ def commonCost : ℝ := H.velocityCost+H.derivativeCost /-- Pressure amplitude, given by `P*pressureCost (Fin 4) q N.Ri N.C N.C 0 H.commonCost`. -/ -def pressureAmplitude : ℝ := P*pressureCost (Fin 4) q N.Ri N.C N.C 0 H.commonCost +@[expose] def pressureAmplitude : ℝ := P*pressureCost (Fin 4) q N.Ri N.C N.C 0 H.commonCost /-- Potential amplitude, given by `3*N.blockAmplitude*(P*H.commonCost)`. -/ def potentialAmplitude : ℝ := 3*N.blockAmplitude*(P*H.commonCost) /-- Potential time amplitude, given by `6*N.blockAmplitude*(P*H.commonCost)`. -/ def potentialTimeAmplitude : ℝ := 6*N.blockAmplitude*(P*H.commonCost) /-- Corrector amplitude, given by `27*N.blockAmplitude^2*(P*H.commonCost)`. -/ -def correctorAmplitude : ℝ := 27*N.blockAmplitude^2*(P*H.commonCost) +@[expose] def correctorAmplitude : ℝ := 27*N.blockAmplitude^2*(P*H.commonCost) /-- Corrector time amplitude, given by `108*N.blockAmplitude^2*(P*H.commonCost)`. -/ -def correctorTimeAmplitude : ℝ := 108*N.blockAmplitude^2*(P*H.commonCost) +@[expose] def correctorTimeAmplitude : ℝ := 108*N.blockAmplitude^2*(P*H.commonCost) theorem commonCost_nonneg : 0 ≤ H.commonCost := add_nonneg H.velocityCost_nonneg H.derivativeCost_nonneg @@ -639,7 +639,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryParity.lean index e889401587..4263f87cd5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryParity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPressureParity /-! The actual homogeneous primary solution initializes the profile parity induction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryRegularity.lean index 2d5cfbca5e..49d6f15282 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryRegularity.lean @@ -15,7 +15,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPressureGradie /-! The genuine homogeneous high-mode solution supplies the primary profile's regularity. -/ -@[expose] public section +public section noncomputable section @@ -72,7 +72,7 @@ def homogeneousForcing (D : EulerTransversePacketProvider.Data U) : /-- Homogeneous primary, given by `primaryProfile O ((homogeneousForcing (P := P) D).vector I) ((homogeneousForcing (P := P) D).scalar I)`. -/ -def homogeneousPrimary (D : EulerTransversePacketProvider.Data U) +@[expose] def homogeneousPrimary (D : EulerTransversePacketProvider.Data U) (I : EulerTransversePacketProvider.InitialData P D) (O : Operators) : Profile := primaryProfile O ((homogeneousForcing (P := P) D).vector I) ((homogeneousForcing (P := P) D).scalar I) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryScaling.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryScaling.lean index 2deb2cd451..9ca0cc0bed 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryScaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryScaling.lean @@ -22,7 +22,7 @@ section /-! Exact rank-one primary shear throughout the joined history and forward interval, obtained from the proved factorization of the actual primary. -/ -@[expose] public section +public section noncomputable section @@ -168,7 +168,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryShearIdentity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryShearIdentity.lean index c8242444c4..9abe693e73 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryShearIdentity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryShearIdentity.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPrimaryHistory zero phase throughout its history interval, including the activation time. No derivative of the finite-dimensional history is postulated. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimarySourceRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimarySourceRegularity.lean index 57eb60ed50..db6ad0b8fc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimarySourceRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimarySourceRegularity.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPrimaryPressur /-! The actual terminal-data primary supplies the grade-one profile and all regularity/locality data required by the recursive packet construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryUncut.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryUncut.lean index 2be7c0d849..fa5566c148 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryUncut.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPrimaryUncut.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketHistory the actual stationary history's initial coordinate. Its all-time relation to the compactly supported packet is proved by ODE uniqueness. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudget.lean index 5924d1ecfe..8cb9832dec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudget.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderTimeUnique /-! The actual field estimates needed to close the recursive packet construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTimeChange.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTimeChange.lean index cb95b78850..42580bb22e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTimeChange.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTimeChange.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketProfileBudget /-! Profile budgets and their actual path witnesses transport across equal time endpoints. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTransport.lean index 7fedeabd19..0c16f9c6a3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileBudgetTransport.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketProfileBudget /-! Quantitative profile estimates do not depend on the particular regularity witness. -/ -@[expose] public section +public section namespace EulerPacketCylinderField.ProfileBudget diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileCoarseBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileCoarseBounds.lean index 136e88e579..0206659ae7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileCoarseBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileCoarseBounds.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketMeanGradeBounds /-! Removing the bounded time profile and performing the one final coarse factorial split. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileEnvelope.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileEnvelope.lean index 5d56c5678d..9b353fcd0a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileEnvelope.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileEnvelope.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ElapsedTimePathWeight /-! The actual grade scale is controlled by the source bound on `alpha*g`. No reciprocal of alpha or extremum ratio of g enters this estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileParity.lean index f75f6326a9..8f0510888e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileParity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSlicedAssembly /-! Joint parity carried by the actual profile fields and their true time derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRecursion.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRecursion.lean index 42e395a2d7..5535b57657 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRecursion.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRecursion.lean @@ -28,7 +28,7 @@ section /-! Which unknown coefficients can enter the slow and fast quadratic terms. -/ -@[expose] public section +public section noncomputable section @@ -93,7 +93,7 @@ end end -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ theorem fastAdvection_angleConstant_right (m : Space) (J K : VectorJet) /-- Nonlinear grade, given by `convolution M (slowAdvection FInv) u u p + convolution M (fastAdvection m) u u (p+1)`. -/ -def nonlinearGrade (M p : ℕ) (FInv : Space →L[ℝ] Space) (m : Space) +@[expose] def nonlinearGrade (M p : ℕ) (FInv : Space →L[ℝ] Space) (m : Space) (u : ℕ → VectorJet) : Space := convolution M (slowAdvection FInv) u u p + convolution M (fastAdvection m) u u (p+1) @@ -152,7 +152,7 @@ section /-! The known forcing at a recursive grade uses only previously constructed coefficients. -/ -@[expose] public section +public section noncomputable section @@ -161,6 +161,7 @@ namespace EulerPacketPointJets open EulerSmoothLimit EulerFiniteGrades InnerProductSpace /-- History, with branches according to `i P⁻¹ • ∫ θ in 0..P, f (z.1,(z.2.1,θ)) /-- The stored coefficients determine the jets of V_i=A_i+B_i+C_{i-1}. -/ -def velocityJet (s : Set ℝ) (a : ℕ → Profile) (z : Domain) (i : ℕ) : VectorJet := +@[expose] def velocityJet (s : Set ℝ) (a : ℕ → Profile) (z : Domain) (i : ℕ) : VectorJet := if i=0 then 0 else slicedJet s (a i).high z+slicedJet s (a i).mean z + slicedJet s (a (i-1)).corrector z /-- Known jets, given by `history p (velocityJet O.interval a z) (slicedJet O.interval (a (p-1)).corrector z)`. -/ -def knownJets (O : Operators) (p : ℕ) (a : ℕ → Profile) (z : Domain) : ℕ → VectorJet := +@[expose] def knownJets (O : Operators) (p : ℕ) (a : ℕ → Profile) (z : Domain) : ℕ → VectorJet := history p (velocityJet O.interval a z) (slicedJet O.interval (a (p-1)).corrector z) /-- All terms of the grade-p forcing that are already determined. -/ -def knownForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := +@[expose] def knownForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := fun z => -(linearPart (O.strain z) (slicedJet O.interval (a (p-1)).corrector z) + slowPressure (O.inverseFrame z) (pressureJet (a (p-1)).highPressure z) + nonlinearGrade (p+1) p (O.inverseFrame z) (O.normal z) (knownJets O p a z)) /-- Mean force, given by `angleMean O.period (knownForce O p a)`. -/ -def meanForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := +@[expose] def meanForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := angleMean O.period (knownForce O p a) /-- Mean result, given by `O.meanSolve (meanForce O p a)`. -/ @@ -281,7 +282,7 @@ def meanResult (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField × O.meanSolve (meanForce O p a) /-- The sole new mean-primary interaction is added after solving the mean. -/ -def highForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := +@[expose] def highForce (O : Operators) (p : ℕ) (a : ℕ → Profile) : VectorField := fun z => knownForce O p a z-meanForce O p a z - fastAdvection (O.normal z) (slicedJet O.interval (meanResult O p a).1 z) (slicedJet O.interval (a 1).high z) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRegularity.lean index fec94e1905..8358095345 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileRegularity.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSlicedAssembly /-! Genuine regularity and locality data carried by each recursively constructed profile. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileStepRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileStepRegularity.lean index b06ef8b250..ae7c5c8656 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileStepRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileStepRegularity.lean @@ -15,7 +15,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPressureGradie /-! One literal profile-recursion step carries genuine path, time-derivative and locality witnesses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailEstimates.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailEstimates.lean index bbee89cfaf..6f098c1545 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailEstimates.lean @@ -23,7 +23,7 @@ section /-! The actual finite residual tail inherits the geometric-series word bound. -/ -@[expose] public section +public section noncomputable section @@ -81,7 +81,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailGrade.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailGrade.lean index a80f6e6536..b571251de5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailGrade.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfileTailGrade.lean @@ -29,7 +29,7 @@ section /-! Uniform bounds on the actual finite velocity jets, including the terminal corrector. -/ -@[expose] public section +public section noncomputable section @@ -99,7 +99,7 @@ section /-! The literal advection fields obey the same fixed coefficient costs before the final tail split. -/ -@[expose] public section +public section noncomputable section @@ -155,7 +155,7 @@ end end -@[expose] public section +public section noncomputable section @@ -242,7 +242,7 @@ section /-! Fixed-radius word bounds for the actual finite grade convolution. -/ -@[expose] public section +public section noncomputable section @@ -293,7 +293,7 @@ end end -@[expose] public section +public section noncomputable section @@ -348,7 +348,7 @@ section /-! The only surviving linear tail grade has the same fixed coefficient budget. -/ -@[expose] public section +public section noncomputable section @@ -432,7 +432,7 @@ section /-! Each surviving grade of the literal packet residual has a fixed-radius estimate. -/ -@[expose] public section +public section noncomputable section @@ -475,7 +475,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketProfilesRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketProfilesRegularity.lean index 6875fc227a..e5dbfccf2c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketProfilesRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketProfilesRegularity.lean @@ -18,7 +18,7 @@ Strong induction applies the constructed mean and high solvers at each grade. Only the primary profile is supplied; later forcing admissibility is proved. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketPropagationTime.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketPropagationTime.lean index 86ffbfc212..8c1cb66293 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketPropagationTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketPropagationTime.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketScaledRay /-! Exact transfer of relative propagation to physical time and its actual profile. -/ -@[expose] public section +public section noncomputable section @@ -21,10 +21,10 @@ namespace EulerPacketMovingFrame open Set /-- Scaled time, given by `(a/ε)*(t-t₀)`. -/ -def scaledTime (t₀ a ε t : ℝ) : ℝ := (a/ε)*(t-t₀) +@[expose] def scaledTime (t₀ a ε t : ℝ) : ℝ := (a/ε)*(t-t₀) /-- Physical profile, given by `Z (scaledTime t₀ a ε t)`. -/ -def physicalProfile (Z : ℝ → ℝ) (t₀ a ε t : ℝ) : ℝ := Z (scaledTime t₀ a ε t) +@[expose] def physicalProfile (Z : ℝ → ℝ) (t₀ a ε t : ℝ) : ℝ := Z (scaledTime t₀ a ε t) theorem physicalTime_scaledTime {t₀ a ε t : ℝ} (ha : a ≠ 0) (hε : ε ≠ 0) : physicalTime t₀ a ε (scaledTime t₀ a ε t) = t := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketRadiusCostPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketRadiusCostPolynomial.lean index 0a21513b9b..8eb33f306c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketRadiusCostPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketRadiusCostPolynomial.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevCostMonotone source-radius envelope. No target radius, forcing amplitude or grade occurs in the primitive envelope. -/ -@[expose] public section +public section noncomputable section @@ -80,15 +80,15 @@ abbrev coeff (R C : ℝ) : ℝ := sobolevCoefficientAmplitude (Fin 4) 6 R C abbrev coeffPoly (R C : Polynomial ℝ) : Polynomial ℝ := coefficientPolynomial 6 R C /-- Inverse envelope, given by `2*(1+2*W^5+2*W^2)^2`. -/ -def inverseEnvelope (W : ℝ) : ℝ := 2*(1+2*W^5+2*W^2)^2 +@[expose] def inverseEnvelope (W : ℝ) : ℝ := 2*(1+2*W^5+2*W^2)^2 /-- Form envelope, given by `36*W^2*(1+W)`. -/ -def formEnvelope (W : ℝ) : ℝ := 36*W^2*(1+W) +@[expose] def formEnvelope (W : ℝ) : ℝ := 36*W^2*(1+W) /-- Endpoint envelope, given by `6*coeff W W*W`. -/ -def endpointEnvelope (W : ℝ) : ℝ := 6*coeff W W*W +@[expose] def endpointEnvelope (W : ℝ) : ℝ := 6*coeff W W*W /-- Weak envelope, given by `inverseBlockCost (Fin 4) 6 (inverseEnvelope W) W (formEnvelope W) (3*coeff W (2*W)*endpointEnvelope W)`. -/ -def weakEnvelope (W : ℝ) : ℝ := +@[expose] def weakEnvelope (W : ℝ) : ℝ := inverseBlockCost (Fin 4) 6 (inverseEnvelope W) W (formEnvelope W) (3*coeff W (2*W)*endpointEnvelope W) @@ -100,55 +100,55 @@ def strongEnvelope (W : ℝ) : ℝ := /-- Forward envelope, given by `let b := coeff (4*W) (1+36*W^4) 1+sobolevInverseCost 1 b 6*(b+W*(2*W+2))`. -/ -def forwardEnvelope (W : ℝ) : ℝ := +@[expose] def forwardEnvelope (W : ℝ) : ℝ := let b := coeff (4*W) (1+36*W^4) 1+sobolevInverseCost 1 b 6*(b+W*(2*W+2)) /-- Jet envelope, given by `64+40*W^2`. -/ -def jetEnvelope (W : ℝ) : ℝ := 64+40*W^2 +@[expose] def jetEnvelope (W : ℝ) : ℝ := 64+40*W^2 /-- Required envelope, given by `W+16*jetEnvelope W+2*(weakEnvelope W+strongEnvelope W)*(16*W+1) + 2*forwardEnvelope W*(64*W+1)`. -/ -def requiredEnvelope (W : ℝ) : ℝ := +@[expose] def requiredEnvelope (W : ℝ) : ℝ := W+16*jetEnvelope W+2*(weakEnvelope W+strongEnvelope W)*(16*W+1) + 2*forwardEnvelope W*(64*W+1) /-- Physical envelope, given by `let a := coeff (4*W) W 3*a+3*a*(3*coeff (4*W) (18*W^3)+3*coeff (4*W) (3*W^2))`. -/ -def physicalEnvelope (W : ℝ) : ℝ := +@[expose] def physicalEnvelope (W : ℝ) : ℝ := let a := coeff (4*W) W 3*a+3*a*(3*coeff (4*W) (18*W^3)+3*coeff (4*W) (3*W^2)) /-- Common envelope, given by `6*coeff W W*(2*W+2)+6*coeff W W+physicalEnvelope W`. -/ -def commonEnvelope (W : ℝ) : ℝ := +@[expose] def commonEnvelope (W : ℝ) : ℝ := 6*coeff W W*(2*W+2)+6*coeff W W+physicalEnvelope W /-- Normal envelope, given by `coeff (5*W+1) (1+W+6*W^2+729*W^6)`. -/ -def normalEnvelope (W : ℝ) : ℝ := coeff (5*W+1) (1+W+6*W^2+729*W^6) +@[expose] def normalEnvelope (W : ℝ) : ℝ := coeff (5*W+1) (1+W+6*W^2+729*W^6) /-- Pressure envelope, given by `3*coeff (4*W) (3*W^2)*(1+6*coeff (4*W) W*commonEnvelope W)`. -/ -def pressureEnvelope (W : ℝ) : ℝ := +@[expose] def pressureEnvelope (W : ℝ) : ℝ := 3*coeff (4*W) (3*W^2)*(1+6*coeff (4*W) W*commonEnvelope W) /-- Grade envelope, given by `commonEnvelope W+135*(normalEnvelope W)^2*(period*commonEnvelope W) + 3*period*pressureEnvelope W`. -/ -def gradeEnvelope (W : ℝ) : ℝ := +@[expose] def gradeEnvelope (W : ℝ) : ℝ := commonEnvelope W+135*(normalEnvelope W)^2*(period*commonEnvelope W) + 3*period*pressureEnvelope W /-- Mean envelope, given by `let a := coeff W W 3*a*(W+2)+3*(a*(W+2)+a)+3*a*(W+3*a+6*a*(W+2))`. -/ -def meanEnvelope (W : ℝ) : ℝ := +@[expose] def meanEnvelope (W : ℝ) : ℝ := let a := coeff W W 3*a*(W+2)+3*(a*(W+2)+a)+3*a*(W+3*a+6*a*(W+2)) /-- Terminal envelope, given by `coeff (jetEnvelope W) (300*(9/rawBump 0)^3*W^2*terminalMass)*W`. -/ -def terminalEnvelope (W : ℝ) : ℝ := +@[expose] def terminalEnvelope (W : ℝ) : ℝ := coeff (jetEnvelope W) (300*(9/rawBump 0)^3*W^2*terminalMass)*W /-- Radius envelope, given by `18*W+2*requiredEnvelope W+meanEnvelope W+gradeEnvelope W*(1+terminalEnvelope W)`. -/ -def radiusEnvelope (W : ℝ) : ℝ := +@[expose] def radiusEnvelope (W : ℝ) : ℝ := 18*W+2*requiredEnvelope W+meanEnvelope W+gradeEnvelope W*(1+terminalEnvelope W) /-- Radius polynomial as an element of `Polynomial ℝ`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursionAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursionAlgebra.lean index 97f5940eac..c8765c86fa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursionAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursionAlgebra.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketLowGrades /-! The coefficient equations of the literal assembled packet give the force in (14). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveBase.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveBase.lean index acf60adae2..82c82be0fd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveBase.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveBase.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketRecursionAlgebra /-! The initial profile and the zero/first grades of the actual recursive packet. -/ -@[expose] public section +public section noncomputable section @@ -23,7 +23,7 @@ open EulerSmoothLimit EulerPacketPointJets EulerFiniteGrades EulerPacketResidual Finset /-- Primary profile, given by `⟨A,0,O.curlCorrector A,π,0⟩`. -/ -def primaryProfile (O : Operators) (A : VectorField) (π : ScalarField) : Profile := +@[expose] def primaryProfile (O : Operators) (A : VectorField) (π : ScalarField) : Profile := ⟨A,0,O.curlCorrector A,π,0⟩ theorem assembledJets_zero (O : Operators) (N : ℕ) (a : ℕ → Profile) (ha : a 0 = 0) (z : Domain) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveCancellation.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveCancellation.lean index e917e4c5e1..5ff5c35557 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveCancellation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveCancellation.lean @@ -18,7 +18,7 @@ section /-! The constructed recursive forcing equals the full nonlinear coefficient forcing. -/ -@[expose] public section +public section noncomputable section @@ -37,6 +37,7 @@ theorem slicedJet_zero {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] simp [slicedJet, joinDerivative] /-- Assembled jets, constructed using `assemble`. -/ +@[expose] def assembledJets (O : Operators) (N : ℕ) (a : ℕ → Profile) (z : Domain) : ℕ → VectorJet := assemble N (fun i => slicedJet O.interval (a i).high z+slicedJet O.interval (a i).mean z) (fun i => slicedJet O.interval (a i).corrector z) @@ -140,7 +141,7 @@ end end -@[expose] public section +public section noncomputable section @@ -150,20 +151,21 @@ open EulerSmoothLimit EulerPacketPointJets EulerFiniteGrades EulerPacketResidual /-- Assembled velocity, given by `assemble N (fun i => (a i).high+(a i).mean) (fun i => (a i).corrector)`. -/ -def assembledVelocity (N : ℕ) (a : ℕ → Profile) : ℕ → VectorField := +@[expose] def assembledVelocity (N : ℕ) (a : ℕ → Profile) : ℕ → VectorField := assemble N (fun i => (a i).high+(a i).mean) (fun i => (a i).corrector) /-- Assembled pressure, given by `assemble N (fun i => (a i).meanPressure) (fun i => (a i).highPressure)`. -/ -def assembledPressure (N : ℕ) (a : ℕ → Profile) : ℕ → ScalarField := +@[expose] def assembledPressure (N : ℕ) (a : ℕ → Profile) : ℕ → ScalarField := assemble N (fun i => (a i).meanPressure) (fun i => (a i).highPressure) /-- Pressure jets, given by `assemble N (fun i => pressureJet (a i).meanPressure z) (fun i => pressureJet (a i).highPressure z)`. -/ -def pressureJets (N : ℕ) (a : ℕ → Profile) (z : Domain) : ℕ → ScalarJet := +@[expose] def pressureJets (N : ℕ) (a : ℕ → Profile) (z : Domain) : ℕ → ScalarJet := assemble N (fun i => pressureJet (a i).meanPressure z) (fun i => pressureJet (a i).highPressure z) /-- Recursive grade, constructed using `coefficient`. -/ +@[expose] def recursiveGrade (O : Operators) (N : ℕ) (a : ℕ → Profile) (z : Domain) (p : ℕ) : Space := coefficient (N+1) (linearPart (O.strain z)) (slowPressure (O.inverseFrame z)) (fastPressure (O.normal z)) (slowAdvection (O.inverseFrame z)) (fastAdvection (O.normal z)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveResidual.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveResidual.lean index 7ffc0f7223..d5cfe5ee52 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveResidual.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketRecursiveResidual.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketRecursiveBase /-! The literal residual of the generated finite packet contains only the uncancelled tail. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketRemainderBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketRemainderBounds.lean index 80631bce18..6fe2205b8a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketRemainderBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketRemainderBounds.lean @@ -20,7 +20,7 @@ import Mathlib.Algebra.Order.Star.Real /-! The literal packet differs from its primary wave by a quadratic-frequency remainder. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualGrades.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualGrades.lean index a19e009b84..4265475487 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualGrades.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualGrades.lean @@ -21,7 +21,7 @@ may be instantiated by the actual value/derivative jets at each space-time point; this file proves the finite algebra and does not assume an Euler solve. -/ -@[expose] public section +public section noncomputable section @@ -34,13 +34,13 @@ variable {V Q W : Type*} [AddCommGroup V] [Module ℝ V] [AddCommGroup Q] [Module ℝ Q] [AddCommGroup W] [Module ℝ W] /-- Residual, constructed using `L`. -/ -def residual (M : ℕ) (κ : ℝ) (L : V →ₗ[ℝ] W) (G H : Q →ₗ[ℝ] W) +@[expose] def residual (M : ℕ) (κ : ℝ) (L : V →ₗ[ℝ] W) (G H : Q →ₗ[ℝ] W) (B C : V →ₗ[ℝ] V →ₗ[ℝ] W) (u : ℕ → V) (p : ℕ → Q) : W := L (evaluate M κ u) + G (evaluate M κ p) + κ⁻¹ • H (evaluate M κ p) + B (evaluate M κ u) (evaluate M κ u) + κ⁻¹ • C (evaluate M κ u) (evaluate M κ u) /-- Coefficient, constructed using `truncate`. -/ -def coefficient (M : ℕ) (L : V →ₗ[ℝ] W) (G H : Q →ₗ[ℝ] W) +@[expose] def coefficient (M : ℕ) (L : V →ₗ[ℝ] W) (G H : Q →ₗ[ℝ] W) (B C : V →ₗ[ℝ] V →ₗ[ℝ] W) (u : ℕ → V) (p : ℕ → Q) (n : ℕ) : W := truncate M (fun j => L (u j)) n + truncate M (fun j => G (p j)) n + shiftDown M (fun j => H (p j)) n + convolution M B u u n + diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailActual.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailActual.lean index e1f7ded57e..d4ff90264d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailActual.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailActual.lean @@ -15,7 +15,7 @@ only finite velocity regularity. No regularity of the lower scalar pressures is needed, because their coefficients are already outside the tail support. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailFields.lean index 7a6792b059..f7139437d2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketResidualTailFields.lean @@ -18,7 +18,7 @@ Exact residual-tail grades. Fast pressure is absent beyond degree N, and only degree N+1 retains the linear terminal corrector and slow pressure. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGrade.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGrade.lean index 1953cacb88..6ad476128d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGrade.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGrade.lean @@ -28,7 +28,7 @@ section bounds. Its norm-one embedding supplies genuine vector-valued Sobolev evaluation, without changing the radius or the time profile. -/ -@[expose] public section +public section noncomputable section @@ -264,7 +264,7 @@ section as the mean velocity. This estimate was already proved by the source solver but is not a field of the velocity-oriented ProfileBudget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGradient.lean index 19563aecfe..fe6fd22a10 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketScalarPressureGradient.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketCylinderPressureLocality /-! A genuine compact scalar cylinder path supplies the actual lifted pressure-gradient Field and belongs to the closed lifted gradient space. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ open scoped ContDiff variable (P : ℝ) [Fact (0 < P)] {T : ℝ} /-- Raw gradient, given by `κ • pressureGradient p z + (pressureJet p z).2 angleDirection • m`. -/ -def rawGradient (κ : ℝ) (m : Space) (p : ScalarField) (z : Domain) : Space := +@[expose] def rawGradient (κ : ℝ) (m : Space) (p : ScalarField) (z : Domain) : Space := κ • pressureGradient p z + (pressureJet p z).2 angleDirection • m omit [Fact (0 < P)] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledRay.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledRay.lean index e471863057..a5714777d6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledRay.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledRay.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! The actual ray in the source time and coordinate scaling. -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ namespace EulerPacketMovingFrame open Set EulerSmoothLimit EulerPacketNormalizedPrimary EulerPacketRay InnerProductSpace /-- Physical time, given by `t₀ + (ε/a)*τ`. -/ -def physicalTime (t₀ a ε τ : ℝ) : ℝ := t₀ + (ε/a)*τ +@[expose] def physicalTime (t₀ a ε τ : ℝ) : ℝ := t₀ + (ε/a)*τ theorem physicalTime_hasDerivAt (t₀ a ε τ : ℝ) : HasDerivAt (physicalTime t₀ a ε) (ε/a) τ := by @@ -48,7 +48,7 @@ theorem scaledRayRate_algebra {a ε s₀ : ℝ} (ha : a ≠ 0) (hε : ε ≠ 0) field_simp [ha, hs₀, rayScale_ne_zero hε i, rayScale_ne_zero hε j] /-- Scaled ray, given by `movingRay m v r (physicalTime t₀ a ε τ) i / (s₀*rayScale ε i)`. -/ -def scaledRay (m v r : ℝ → Space) (s₀ t₀ a ε τ : ℝ) (i : Fin 3) : ℝ := +@[expose] def scaledRay (m v r : ℝ → Space) (s₀ t₀ a ε τ : ℝ) (i : Fin 3) : ℝ := movingRay m v r (physicalTime t₀ a ε τ) i / (s₀*rayScale ε i) /-- The physical ODE supplies exactly the scaled coefficient matrix whose diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocity.lean index 325dd0c6bc..e37918cd8d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocity.lean @@ -22,7 +22,7 @@ section /-! The actual projected primary-velocity ODE in the normalized moving frame. -/ -@[expose] public section +public section noncomputable section @@ -74,7 +74,7 @@ theorem movingVelocityRate_identity (B M : Space →L[ℝ] Space) (p q w : Space sub_neg_eq_add] using h /-- Moving velocity, given by `⟪normalizedFrame m v t i,w t⟫_ℝ`. -/ -def movingVelocity (m v w : ℝ → Space) (t : ℝ) (i : Fin 3) : ℝ := +@[expose] def movingVelocity (m v w : ℝ → Space) (t : ℝ) (i : Fin 3) : ℝ := ⟪normalizedFrame m v t i,w t⟫_ℝ /-- Moving flux, given by `∑ i : Fin 3, movingRay m v r t i * (∑ j : Fin 3, frameMatrix M (unit @@ -136,7 +136,7 @@ end end -@[expose] public section +public section noncomputable section @@ -146,7 +146,7 @@ open Set EulerSmoothLimit EulerPacketNormalizedPrimary EulerPacketRay InnerProdu /-- Scaled velocity, given by `movingVelocity m v w (physicalTime t₀ a ε τ) i / velocityScale ε i`. -/ -def scaledVelocity (m v w : ℝ → Space) (t₀ a ε τ : ℝ) (i : Fin 3) : ℝ := +@[expose] def scaledVelocity (m v w : ℝ → Space) (t₀ a ε τ : ℝ) (i : Fin 3) : ℝ := movingVelocity m v w (physicalTime t₀ a ε τ) i / velocityScale ε i theorem scaledRay_restore (m v r : ℝ → Space) {s₀ t₀ a ε τ : ℝ} @@ -163,10 +163,12 @@ theorem scaledVelocity_restore (m v w : ℝ → Space) {t₀ a ε τ : ℝ} field_simp [velocityScale_ne_zero hε i] /-- Scaled action, given by `scaledVelocityEntry a ε (frameMatrix M (unit (m t)) (unit (v t)))`. -/ -def scaledAction (M : Space →L[ℝ] Space) (m v : ℝ → Space) (a ε t : ℝ) : Fin 3 → Fin 3 → ℝ := +@[expose] def scaledAction (M : Space →L[ℝ] Space) (m v : ℝ → Space) + (a ε t : ℝ) : Fin 3 → Fin 3 → ℝ := scaledVelocityEntry a ε (frameMatrix M (unit (m t)) (unit (v t))) /-- Scaled transport, constructed using `scaledVelocityEntry`. -/ +@[expose] def scaledTransport (B M : Space →L[ℝ] Space) (m v : ℝ → Space) (a ε t : ℝ) : Fin 3 → Fin 3 → ℝ := scaledVelocityEntry a ε (fun i j => frameMatrix M (unit (m t)) (unit (v t)) i j + frameSkew (frameMatrix B (unit (m t)) (unit (v t))) i j) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocityAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocityAlgebra.lean index 93f6211978..01dc20536b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocityAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocityAlgebra.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.PacketRay /-! Exact finite-dimensional algebra of the source ray/velocity scaling. -/ -@[expose] public section +public section noncomputable section @@ -21,7 +21,7 @@ namespace EulerPacketMovingFrame open EulerPacketRay /-- Velocity scale, with branches according to `i = 1`. -/ -def velocityScale (ε : ℝ) (i : Fin 3) : ℝ := if i = 1 then 1 else ε +@[expose] def velocityScale (ε : ℝ) (i : Fin 3) : ℝ := if i = 1 then 1 else ε theorem velocityScale_ne_zero {ε : ℝ} (hε : ε ≠ 0) (i : Fin 3) : velocityScale ε i ≠ 0 := by unfold velocityScale @@ -63,6 +63,7 @@ theorem scaling_velocity_rate {a ε s₀ D : ℝ} field_simp /-- Scaled velocity rhs as an element of `ℝ`. -/ +@[expose] def scaledVelocityRhs (A C : Fin 3 → Fin 3 → ℝ) (ε : ℝ) (R V : Fin 3 → ℝ) (i : Fin 3) : ℝ := -(∑ j : Fin 3, C i j*V j) + 2*(rayScale ε i)^2*R i * velocityNumerator A (R 0) (R 1) (R 2) (V 0) (V 1) (V 2) / diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocitySystem.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocitySystem.lean index 351b8895f6..fb2cfc7519 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocitySystem.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketScaledVelocitySystem.lean @@ -24,7 +24,7 @@ flux equation used in amplification. Only the first two transport rows are relevant; the auxiliary third row in the scalar estimate is filled explicitly. -/ -@[expose] public section +public section noncomputable section @@ -141,7 +141,7 @@ section /-! Ray control for the genuine within-interval packet equations. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketShiftArithmetic.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketShiftArithmetic.lean index a14c1bce2e..06df8453b2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketShiftArithmetic.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketShiftArithmetic.lean @@ -13,20 +13,20 @@ public import Mathlib.Tactic.ToDual /-! Uniform shift room for the recursive packet estimates in the manuscript. -/ -@[expose] public section +public section namespace EulerPacketShiftArithmetic /-- High shift, given by `100*p-80`. -/ -def highShift (p : ℕ) : ℕ := 100*p-80 +@[expose] def highShift (p : ℕ) : ℕ := 100*p-80 /-- Mean shift, given by `100*p-140`. -/ -def meanShift (p : ℕ) : ℕ := 100*p-140 +@[expose] def meanShift (p : ℕ) : ℕ := 100*p-140 /-- High force shift, given by `highShift p-10`. -/ -def highForceShift (p : ℕ) : ℕ := highShift p-10 +@[expose] def highForceShift (p : ℕ) : ℕ := highShift p-10 /-- Mean force shift, given by `meanShift p-10`. -/ -def meanForceShift (p : ℕ) : ℕ := meanShift p-10 +@[expose] def meanForceShift (p : ℕ) : ℕ := meanShift p-10 theorem primary_shift : highShift 1=20 := rfl diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketShortTimePhysicalGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketShortTimePhysicalGrowth.lean index 0c6a85169b..b160c0c728 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketShortTimePhysicalGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketShortTimePhysicalGrowth.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real the velocity. Its actual norm is therefore unchanged by the normal factor. A short interval controlled by the low strain norm supplies H3 with g=1. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedAssembly.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedAssembly.lean index c37e5fc3d7..dd50600a59 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedAssembly.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add /-! Finite packet assembly commutes with the genuine time-within/spatial jets. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Slice differentiable, given by `DifferentiableWithinAt ℝ (fun t => f (t,z.2)) s z.1 ∧ DifferentiableAt ℝ (fun y => f (z.1,y)) z.2`. -/ -def SliceDifferentiable (s : Set ℝ) (f : Domain → E) (z : Domain) : Prop := +@[expose] def SliceDifferentiable (s : Set ℝ) (f : Domain → E) (z : Domain) : Prop := DifferentiableWithinAt ℝ (fun t => f (t,z.2)) s z.1 ∧ DifferentiableAt ℝ (fun y => f (z.1,y)) z.2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedResidual.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedResidual.lean index 8710181cf7..ee3bfa05b3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedResidual.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSlicedResidual.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketResidualGrades /-! Exact residual expansion with genuine derivatives within the prescribed time interval. -/ -@[expose] public section +public section noncomputable section @@ -21,7 +21,7 @@ namespace EulerPacketPointJets open EulerSmoothLimit EulerFiniteGrades EulerPacketResidual Finset Set /-- Sliced momentum residual, constructed using `linearPart`. -/ -def slicedMomentumResidual (s : Set ℝ) (κ : ℝ) (FInv M : Space →L[ℝ] Space) (m : Space) +@[expose] def slicedMomentumResidual (s : Set ℝ) (κ : ℝ) (FInv M : Space →L[ℝ] Space) (m : Space) (u : Domain → Space) (p : Domain → ℝ) (z : Domain) : Space := linearPart M (slicedJet s u z)+slowPressure FInv (pressureJet p z) + κ⁻¹ • fastPressure m (pressureJet p z) + @@ -29,7 +29,7 @@ def slicedMomentumResidual (s : Set ℝ) (κ : ℝ) (FInv M : Space →L[ℝ] Sp κ⁻¹ • fastAdvection m (slicedJet s u z) (slicedJet s u z) /-- Sliced momentum grade, constructed using `coefficient`. -/ -def slicedMomentumGrade (s : Set ℝ) (N : ℕ) (FInv M : Space →L[ℝ] Space) (m : Space) +@[expose] def slicedMomentumGrade (s : Set ℝ) (N : ℕ) (FInv M : Space →L[ℝ] Space) (m : Space) (u : ℕ → Domain → Space) (p : ℕ → Domain → ℝ) (z : Domain) (n : ℕ) : Space := coefficient N (linearPart M) (slowPressure FInv) (fastPressure m) (slowAdvection FInv) (fastAdvection m) (fun i => slicedJet s (u i) z) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientBudget.lean index 6179001dd9..7636ff881b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientBudget.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanCoefficientPathJets jets of the inverse deformation and strain. The transported unit normal uses the same radius and amplitude. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientGevrey.lean index b252588975..16bee58bec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCoefficientGevrey.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketMatrixCoefficientGevrey three quadratic coefficients. Their common coefficient radius and amplitudes are independent of the correction order, cutoff and frequency. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCorrectionCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCorrectionCoefficients.lean index 1e2a1e444b..a092692d35 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCorrectionCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceCorrectionCoefficients.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketForcing The order-zero terms have the positive sign of the transformed equation; the correction source subsequently applies the negative pressure projection. -/ -@[expose] public section +public section noncomputable section @@ -29,15 +29,15 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : EulerTransversePacketProvider.Data U) /-- Raw frame, given by `D.F.field (D.clamp z.1) z.2.1`. -/ -def rawFrame (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawFrame (z : Domain) : Space →L[ℝ] Space := D.F.field (D.clamp z.1) z.2.1 /-- Raw frame time, given by `D.F₁.field (D.clamp z.1) z.2.1`. -/ -def rawFrameTime (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawFrameTime (z : Domain) : Space →L[ℝ] Space := D.F₁.field (D.clamp z.1) z.2.1 /-- Raw inverse, given by `D.FInv.field (D.clamp z.1) z.2.1`. -/ -def rawInverse (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawInverse (z : Domain) : Space →L[ℝ] Space := D.FInv.field (D.clamp z.1) z.2.1 /-- Frame coefficient, bundling `path`, `orbit`, `raw_eq`. -/ @@ -67,12 +67,12 @@ def rawInverseMetric (z : Domain) : Space →L[ℝ] Space := (rawFrame D z).adjoint.comp (rawFrame D z) /-- Raw linear, given by `(2 : ℝ) • (rawInverse D z).comp (rawFrameTime D z)`. -/ -def rawLinear (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawLinear (z : Domain) : Space →L[ℝ] Space := (2 : ℝ) • (rawInverse D z).comp (rawFrameTime D z) /-- Raw quadratic, given by `κ • (rawInverse D z).comp (fderiv ℝ (fun x => rawFrame D (z.1,(x,z.2.2))) z.2.1 (EuclideanSpace.single i 1))`. -/ -def rawQuadratic (κ : ℝ) (i : Fin 3) (z : Domain) : Space →L[ℝ] Space := +@[expose] def rawQuadratic (κ : ℝ) (i : Fin 3) (z : Domain) : Space →L[ℝ] Space := κ • (rawInverse D z).comp (fderiv ℝ (fun x => rawFrame D (z.1,(x,z.2.2))) z.2.1 (EuclideanSpace.single i 1)) @@ -88,7 +88,7 @@ def inverseMetricCoefficient : MatrixCoefficient D.T (rawInverseMetric D) := /-- Linear coefficient, given by `((inverseCoefficient D).comp (frameTimeCoefficient D)).smul 2`. -/ -def linearCoefficient : MatrixCoefficient D.T (rawLinear D) := +@[expose] def linearCoefficient : MatrixCoefficient D.T (rawLinear D) := ((inverseCoefficient D).comp (frameTimeCoefficient D)).smul 2 /-- Quadratic coefficient, given by `((inverseCoefficient D).comp ((frameCoefficient @@ -135,7 +135,7 @@ def linearTower : CoefficientTower P D.T := (linearCoefficient D).toCoefficientTower P /-- Quadratic tower, given by `(quadraticCoefficient D κ i).toCoefficientTower P`. -/ -def quadraticTower (κ : ℝ) (i : Fin 3) : CoefficientTower P D.T := +@[expose] def quadraticTower (κ : ℝ) (i : Fin 3) : CoefficientTower P D.T := (quadraticCoefficient D κ i).toCoefficientTower P @[simp] theorem metricTower_apply (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceEquations.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceEquations.lean index 068c813cf3..9feb764575 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceEquations.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceEquations.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketJets /-! Actual defining equations of the generated mean and high profiles. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceFrequency.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceFrequency.lean index 61a21a57d6..84cd8c5fd4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceFrequency.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceFrequency.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics /-! The literal source truncation floor(k^ϑ), ϑ=10⁻⁶, meets the packet and correction guards from finitely many fixed-cost bounds. -/ -@[expose] public section +public section noncomputable section @@ -25,13 +25,14 @@ namespace EulerPacketSourceFrequency open Real Filter EulerPacketCoarseMajorant EulerPacketCorrectionScalar /-- Theta, given by `1/1000000`. -/ +@[expose] def theta : ℝ := 1/1000000 /-- Expansion, given by `k^theta`. -/ -def expansion (k : ℝ) : ℝ := k^theta +@[expose] def expansion (k : ℝ) : ℝ := k^theta /-- Truncation, given by `Nat.floor (expansion k)`. -/ def truncation (k : ℝ) : ℕ := Nat.floor (expansion k) /-- Small power, given by `k^(theta/100)`. -/ -def smallPower (k : ℝ) : ℝ := k^(theta/100) +@[expose] def smallPower (k : ℝ) : ℝ := k^(theta/100) theorem expansion_pos (k : ℝ) (hk : 0 < k) : 0 < expansion k := Real.rpow_pos_of_pos hk _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryAssembly.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryAssembly.lean index 2734598fe5..cc6e1a8586 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryAssembly.lean @@ -37,7 +37,7 @@ initial velocity. The loss `ε⁻¹` comes from the specified coordinate rescaling and is independent of the oscillation frequency. -/ -@[expose] public section +public section noncomputable section @@ -175,7 +175,7 @@ end end -@[expose] public section +public section noncomputable section @@ -258,7 +258,7 @@ section The physical interval ends at the chosen scaled horizon; no extension beyond the source time interval is required. -/ -@[expose] public section +public section noncomputable section @@ -322,7 +322,7 @@ end end -@[expose] public section +public section noncomputable section @@ -337,9 +337,10 @@ open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] /-- Source matrix, given by `D.M.field (D.clamp t) x`. -/ +@[expose] def sourceMatrix (D : Data U) (x : Space) (t : ℝ) : Space →L[ℝ] Space := D.M.field (D.clamp t) x /-- Source ray, given by `D.normal.field (D.clamp t) x`. -/ -def sourceRay (D : Data U) (x : Space) (t : ℝ) : Space := D.normal.field (D.clamp t) x +@[expose] def sourceRay (D : Data U) (x : Space) (t : ℝ) : Space := D.normal.field (D.clamp t) x theorem sourceMatrix_continuous (D : Data U) (x : Space) : Continuous (sourceMatrix D x) := extendPath_continuous D.T D.T_pos.le (pathEvaluation x D.M.field) @@ -350,7 +351,7 @@ variable [CompleteSpace U] {D : Data U} {τ : ℝ} /-- Source error, given by `sourceMatrix D x t-P.B t-primaryShear P.c P.m P.v t • rankOne ℝ (unit (P.v t)) (unit (P.m t))`. -/ -def ParentFrame.sourceError (x : Space) (t : ℝ) : Space →L[ℝ] Space := +@[expose] def ParentFrame.sourceError (x : Space) (t : ℝ) : Space →L[ℝ] Space := sourceMatrix D x t-P.B t-primaryShear P.c P.m P.v t • rankOne ℝ (unit (P.v t)) (unit (P.m t)) namespace Guards diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryData.lean index 01115ad94d..ef873ad3e4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryData.lean @@ -20,7 +20,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketActivationInitial normal and stationary primary. Only the older homogeneous frame, parent center remainder, low source bounds and numerical guards are inputs. -/ -@[expose] public section +public section noncomputable section @@ -75,35 +75,35 @@ namespace ParentFrame variable (P : ParentFrame D τ) /-- A, given by `normalizedCoupling (P.B τ) (P.m τ) (P.v τ)`. -/ -def a : ℝ := normalizedCoupling (P.B τ) (P.m τ) (P.v τ) +@[expose] def a : ℝ := normalizedCoupling (P.B τ) (P.m τ) (P.v τ) /-- Sigma, given by `Real.sqrt (normalizedTilt (P.B τ) (P.m τ) (P.v τ))`. -/ -def sigma : ℝ := Real.sqrt (normalizedTilt (P.B τ) (P.m τ) (P.v τ)) +@[expose] def sigma : ℝ := Real.sqrt (normalizedTilt (P.B τ) (P.m τ) (P.v τ)) /-- Shear, given by `primaryShear P.c P.m P.v τ`. -/ def shear : ℝ := primaryShear P.c P.m P.v τ /-- Epsilon, given by `Real.sqrt (P.a/P.shear)`. -/ -def epsilon : ℝ := Real.sqrt (P.a/P.shear) +@[expose] def epsilon : ℝ := Real.sqrt (P.a/P.shear) /-- Horizon, given by `P.a*(D.T-τ)/P.epsilon`. -/ -def horizon : ℝ := P.a*(D.T-τ)/P.epsilon +@[expose] def horizon : ℝ := P.a*(D.T-τ)/P.epsilon /-- Ray scale, given by `activationRayScale (D.deformationEquiv ⟨τ,hτ.le,hτT.le⟩ 0) (cross (unit (P.m τ)) (unit (P.v τ)))`. -/ def rayScale (hτ : 0 < τ) (hτT : τ < D.T) : ℝ := activationRayScale (D.deformationEquiv ⟨τ,hτ.le,hτT.le⟩ 0) (cross (unit (P.m τ)) (unit (P.v τ))) /-- Terminal bound, given by `8*(activationConstant CM CH+1)*D.inverseBound/P.shear`. -/ -def terminalBound (CM CH : ℝ) : ℝ := +@[expose] def terminalBound (CM CH : ℝ) : ℝ := 8*(activationConstant CM CH+1)*D.inverseBound/P.shear variable [CompleteSpace U] (hτ : 0 < τ) (hτT : τ < D.T) (H : HistoryData (D.initial τ hτ hτT.le)) /-- Neighbor cost as an element of `ℝ`. -/ -def neighborCost (CM CH : ℝ) : ℝ := +@[expose] def neighborCost (CM CH : ℝ) : ℝ := ‖D.M.derivative.field‖+ 3*‖D.normal.derivative.field‖/(P.rayScale hτ hτT*P.epsilon) + 2*historyLabelDifferenceCost H*P.terminalBound CM CH/P.epsilon /-- Total error, given by `P.error+P.neighborCost hτ hτT H CM CH*ρ`. -/ -def totalError (CM CH ρ : ℝ) : ℝ := +@[expose] def totalError (CM CH ρ : ℝ) : ℝ := P.error+P.neighborCost hτ hτT H CM CH*ρ end ParentFrame diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryGrowth.lean index ac2ca1c5d0..8ce6c85b8f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceGeometryGrowth.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketGeometrySourceGrowth profile on the forward part of the source interval. The same scalar solution also retains the amplification and amplitude conclusions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceOperators.lean index b66cddafb1..0cf42010f0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceOperators.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketCorrectorOpera /-! Literal packet operators and coefficient witnesses from the given analytic source data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParameterScales.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParameterScales.lean index 26ddb595bd..c8bf542169 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParameterScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParameterScales.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Ring.Star Polynomial factors include the growing base core constant and inverse time; no parameter depending on the base scale is treated as fixed. -/ -@[expose] public section +public section noncomputable section @@ -25,11 +25,11 @@ open Real EulerScale EulerPacketSourceScales EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence EulerPacketBaseGuardScales /-- Predecessor exponent, given by `scaleSequence J X n/((J-1+n : ℕ) : ℝ)^3`. -/ -def predecessorExponent (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def predecessorExponent (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := scaleSequence J X n/((J-1+n : ℕ) : ℝ)^3 /-- Polynomial factor, given by `((J+n : ℕ) : ℝ)^20*(scaleSequence J X n)^1000`. -/ -def polynomialFactor (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def polynomialFactor (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := ((J+n : ℕ) : ℝ)^20*(scaleSequence J X n)^1000 theorem sequence_one_le (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 1 ≤ X) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParity.lean index a6253c45d9..67a2cee3a2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceParity.lean @@ -24,7 +24,7 @@ section /-! One actual mean/transverse solve preserves every joint profile symmetry. -/ -@[expose] public section +public section noncomputable section @@ -129,7 +129,7 @@ section /-! Every profile in the literal recursively generated family has the source parity. -/ -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePiola.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePiola.lean index ab4498584e..d7145a5cf9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePiola.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePiola.lean @@ -24,7 +24,7 @@ section /-! Exact angular mean and raw corrector identities for the constructed source profiles. -/ -@[expose] public section +public section noncomputable section @@ -80,7 +80,7 @@ end end -@[expose] public section +public section noncomputable section @@ -162,7 +162,7 @@ section /-! The literal packet sums and their genuine first derivatives match the graded assembly. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePrimitiveBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePrimitiveBounds.lean index b17cf5d2ea..aec18814ae 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePrimitiveBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePrimitiveBounds.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketForwardCoefficientBudget /-! The actual joined and forward source budgets retain the polynomial correction envelope. Only their original coefficient leaves enter it. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceProfiles.lean index 3f81f18029..067cf83850 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceProfiles.lean @@ -27,7 +27,7 @@ Admissibility at all later grades follows from the genuine nonlinear paths, the source mean inverse and the source transverse inverse. -/ -@[expose] public section +public section noncomputable section @@ -71,7 +71,7 @@ end end -@[expose] public section +public section noncomputable section @@ -86,7 +86,7 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) /-- Source profiles, given by `profiles (sourceOperators P M D I) (homogeneousPrimary D Iprimary (sourceOperators P M D I))`. -/ -def sourceProfiles : ℕ → Profile := +@[expose] def sourceProfiles : ℕ → Profile := profiles (sourceOperators P M D I) (homogeneousPrimary D Iprimary (sourceOperators P M D I)) /-- Source profile witness, given by `constructedProfileWitness M D hT I Iprimary diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePropagator.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePropagator.lean index ce0970f6b0..33f3927536 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePropagator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourcePropagator.lean @@ -19,7 +19,7 @@ tangent solution after multiplication by F R. Consequently a physical propagator estimate supplies H3 with only the explicit F and F⁻¹ factors, preserving exactly the time-profile ratio. -/ -@[expose] public section +public section noncomputable section @@ -79,7 +79,7 @@ def physical (s : Icc (0 : ℝ) D.T) (x : Space) (v : U) (t : ℝ) : Space := /-- Physical rhs, given by `-(D.M.field t x) w + (2*⟪D.normal.field t x,(D.M.field t x) w⟫_ℝ/‖D.normal.field t x‖^2) • D.normal.field t x`. -/ -def physicalRhs (t : Icc (0 : ℝ) D.T) (x w : Space) : Space := +@[expose] def physicalRhs (t : Icc (0 : ℝ) D.T) (x w : Space) : Space := -(D.M.field t x) w + (2*⟪D.normal.field t x,(D.M.field t x) w⟫_ℝ/‖D.normal.field t x‖^2) • D.normal.field t x diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRadiusPolynomial.lean index 82d2e29997..a7c0216596 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRadiusPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRadiusPolynomial.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitializedRadiusPolynomial canonical primary/common enlargement. The boundary coefficient L is an explicit primitive input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRegularity.lean index e870a44494..bf46e8d8ff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceRegularity.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.MeanPacketJets /-! Literal slice and scalar-pressure regularity of the actually generated source profiles. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceResidualFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceResidualFields.lean index c9cbd07958..542d853335 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceResidualFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceResidualFields.lean @@ -23,7 +23,7 @@ All profile regularity, tangency, and defining equations in the generic algebraic expansion are discharged by the actual recursive source solves. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleActual.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleActual.lean index 7f48b56276..35310edf96 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleActual.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleActual.lean @@ -18,7 +18,7 @@ polynomial shear and frequency. Comparison with the normal-form costs is proved here, rather than imposed at the two exceptional starting stages. -/ -@[expose] public section +public section noncomputable section @@ -33,18 +33,18 @@ open Real Filter EulerScale EulerPacketSourceScales EulerPacketSourceTime open scoped Topology /-- Epsilon, given by `sqrt (a/previousShear J X n)`. -/ -def epsilon (J : ℕ) (X a : ℝ) (n : ℕ) : ℝ := sqrt (a/previousShear J X n) +@[expose] def epsilon (J : ℕ) (X a : ℝ) (n : ℕ) : ℝ := sqrt (a/previousShear J X n) /-- Prior error, given by `previousFrequency J D X n ^ (-(1/4 : ℝ))`. -/ -def priorError (J D : ℕ) (X : ℝ) (n : ℕ) : ℝ := previousFrequency J D X n ^ (-(1/4 : ℝ)) +@[expose] def priorError (J D : ℕ) (X : ℝ) (n : ℕ) : ℝ := previousFrequency J D X n ^ (-(1/4 : ℝ)) /-- Neighbor error, given by `supportScale J X n * previousFrequency J D X n^c * previousShear J X n^c`. -/ -def neighborError (J D : ℕ) (X c : ℝ) (n : ℕ) : ℝ := +@[expose] def neighborError (J D : ℕ) (X c : ℝ) (n : ℕ) : ℝ := supportScale J X n * previousFrequency J D X n^c * previousShear J X n^c /-- Geometry error as an element of `ℝ`. -/ -def geometryError (J D : ℕ) (C c X : ℝ) (a : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def geometryError (J D : ℕ) (C c X : ℝ) (a : ℕ → ℝ) (n : ℕ) : ℝ := 16*(epsilon J X (a n) n*sourceTheta J C (scaleSequence J X) n*(4*(1+olderShear J X n))^2 + priorError J D X n+neighborError J D X c n) @@ -56,7 +56,7 @@ def baseErrorCost (J D : ℕ) (C X : ℝ) : ℝ := /-- Geometry error cost, given by `geometryError J D C c X a n * sourceTheta J C (scaleSequence J X) n^60`. -/ -def geometryErrorCost (J D : ℕ) (C c X : ℝ) (a : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def geometryErrorCost (J D : ℕ) (C c X : ℝ) (a : ℕ → ℝ) (n : ℕ) : ℝ := geometryError J D C c X a n * sourceTheta J C (scaleSequence J X) n^60 theorem epsilon_succ_le (J : ℕ) (hJ : 1 ≤ J) (X a : ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleGuards.lean index c0bf64ff47..6afce6432a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleGuards.lean @@ -20,7 +20,7 @@ section # Packet Scale Activation -/ -@[expose] public section +public section noncomputable section @@ -82,7 +82,7 @@ end end -@[expose] public section +public section noncomputable section @@ -196,7 +196,7 @@ theorem scaleSequence_ge_initial (J : ℕ) (hJ : 1 ≤ J) (X : ℝ) (hX : 0 ≤ exact ih.trans (le_mul_of_one_le_left (hX.trans ih) (one_le_pow₀ hj)) /-- Target time, given by `scaleSequence J X (n+1)/sqrt β`. -/ -def targetTime (J : ℕ) (X β : ℝ) (n : ℕ) : ℝ := scaleSequence J X (n+1)/sqrt β +@[expose] def targetTime (J : ℕ) (X β : ℝ) (n : ℕ) : ℝ := scaleSequence J X (n+1)/sqrt β /-- Horizon, given by `targetTime J X β n+actualExtraTime J X a n`. -/ def horizon (J : ℕ) (X a β : ℝ) (n : ℕ) : ℝ := targetTime J X β n+actualExtraTime J X a n diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleSequence.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleSequence.lean index 9b35338936..c49390eeb4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleSequence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceScaleSequence.lean @@ -33,7 +33,7 @@ section # Packet Source Scales -/ -@[expose] public section +public section noncomputable section @@ -45,29 +45,29 @@ namespace EulerPacketSourceScales open Real EulerScale EulerPacketScaleGeometry /-- A fixed polynomial majorant for the dimensionless stage horizon. -/ -noncomputable def sourceTheta (J : ℕ) (C : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceTheta (J : ℕ) (C : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := C * (1 + ((J + n : ℕ) : ℝ) ^ 2 * (x n) ^ 2) /-- The source upper bound for the square-root inverse parent shear. -/ -noncomputable def sourceEpsilon (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceEpsilon (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := 2 * exp (-x n / (2 * ((J - 1 + n : ℕ) : ℝ) ^ 7)) /-- The older gradient bound expressed using the quadratic recurrence. -/ -noncomputable def sourceOlderGradient (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceOlderGradient (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := 1 + exp (x n / (((J - 1 + n : ℕ) : ℝ) ^ 2 * ((J - 2 + n : ℕ) : ℝ) ^ 7)) /-- The inverse fourth root of the preceding packet frequency. -/ -noncomputable def sourcePriorError (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourcePriorError (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := exp (-x n / (4 * ((J - 1 + n : ℕ) : ℝ) ^ 4)) /-- The neighbor error with the support, frequency, and shear scales of (37). -/ -noncomputable def sourceNeighborError (J : ℕ) (c : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceNeighborError (J : ℕ) (c : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := exp (-x n / ((J + n : ℕ) : ℝ) ^ (7 / 2 : ℝ) + c * x n / ((J - 1 + n : ℕ) : ℝ) ^ 4 + c * x n / ((J - 1 + n : ℕ) : ℝ) ^ 7) /-- The full coefficient error entering the normalized ray and velocity equations. -/ -noncomputable def sourceCoefficientError (J : ℕ) (C c : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceCoefficientError (J : ℕ) (C c : ℝ) (x : ℕ → ℝ) (n : ℕ) : ℝ := 16 * (sourceEpsilon J x n * sourceTheta J C x n * sourceOlderGradient J x n ^ 2 + sourcePriorError J x n + sourceNeighborError J c x n) @@ -309,7 +309,7 @@ section # Packet Source Time -/ -@[expose] public section +public section noncomputable section @@ -347,12 +347,12 @@ noncomputable def sourceTimeWidth (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := exp (-x n / (2 * ((J - 1 + n : ℕ) : ℝ) ^ 7)) /-- The following time width, using `x_j=j²x_{j-1}` twice. -/ -noncomputable def sourceNextTimeWidth (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceNextTimeWidth (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := 3 * (((J + n : ℕ) : ℝ) + 1) ^ 2 * ((J + n : ℕ) : ℝ) ^ 4 * (x n) ^ 2 * exp (-x n / (2 * ((J + n : ℕ) : ℝ) ^ 5)) /-- The exact quotient of consecutive time widths. -/ -noncomputable def sourceTimeRatio (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def sourceTimeRatio (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := (((J + n : ℕ) : ℝ) + 1) ^ 2 * ((J + n : ℕ) : ℝ) ^ 2 * exp (-x n / (2 * ((J + n : ℕ) : ℝ) ^ 5) + x n / (2 * ((J - 1 + n : ℕ) : ℝ) ^ 7)) @@ -522,7 +522,7 @@ end end -@[expose] public section +public section noncomputable section @@ -532,7 +532,7 @@ open Real EulerPacketSourceScales EulerPacketSourceTime /-- Monomial cost, given by `C * ((J + n : ℕ) : ℝ)^p * (x n)^q * exp (-b * (x n / ((J + n : ℕ) : ℝ)^a) + c * (x n / ((J - d + n : ℕ) : ℝ)^B))`. -/ -def monomialCost (J d B : ℕ) (a b c C : ℝ) (p q : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def monomialCost (J d B : ℕ) (a b c C : ℝ) (p q : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := C * ((J + n : ℕ) : ℝ)^p * (x n)^q * exp (-b * (x n / ((J + n : ℕ) : ℝ)^a) + c * (x n / ((J - d + n : ℕ) : ℝ)^B)) @@ -715,7 +715,7 @@ section # Packet Uniform Log Bounds -/ -@[expose] public section +public section noncomputable section @@ -818,7 +818,7 @@ end end -@[expose] public section +public section noncomputable section @@ -955,7 +955,7 @@ section # Packet Finite Scale Choice -/ -@[expose] public section +public section noncomputable section @@ -1027,7 +1027,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1066,7 +1066,7 @@ structure CostSpec where C_pos : 0 < C /-- Cost, given by `monomialCost J s.d s.B s.a s.b s.c s.C s.p s.q x`. -/ -def CostSpec.cost (s : CostSpec) (J : ℕ) (x : ℕ → ℝ) : ℕ → ℝ := +@[expose] def CostSpec.cost (s : CostSpec) (J : ℕ) (x : ℕ → ℝ) : ℕ → ℝ := monomialCost J s.d s.B s.a s.b s.c s.C s.p s.q x /-- A finite list of literal exponential costs has summable, uniformly @@ -1174,22 +1174,22 @@ theorem SmallSeries.mono {f g : ℕ → ℝ} {δ : ℝ} (h : SmallSeries f δ) exact ⟨hg, hs, (hs.tsum_le_tsum hle h.summable).trans h.total_le⟩ /-- Coefficient cost, given by `sourceCoefficientError J C c x n * sourceTheta J C x n^A`. -/ -def coefficientCost (J : ℕ) (C c : ℝ) (A : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def coefficientCost (J : ℕ) (C c : ℝ) (A : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := sourceCoefficientError J C c x n * sourceTheta J C x n^A /-- Extra time cost, given by `2*sqrt (a n*exp (x n/((J-1+n : ℕ) : ℝ)^7))*sourceNextTimeWidth J x n * sourceTheta J C x n^A`. -/ -def extraTimeCost (J : ℕ) (C : ℝ) (A : ℕ) (x a : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def extraTimeCost (J : ℕ) (C : ℝ) (A : ℕ) (x a : ℕ → ℝ) (n : ℕ) : ℝ := 2*sqrt (a n*exp (x n/((J-1+n : ℕ) : ℝ)^7))*sourceNextTimeWidth J x n * sourceTheta J C x n^A /-- Parent square ratio, given by `exp (2*x n/((J-1+n : ℕ) : ℝ)^7)/exp (x n/((J+n : ℕ) : ℝ)^5)`. -/ -def parentSquareRatio (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def parentSquareRatio (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := exp (2*x n/((J-1+n : ℕ) : ℝ)^7)/exp (x n/((J+n : ℕ) : ℝ)^5) /-- Good cost, given by `exp (-x n/((J+n : ℕ) : ℝ)^3)*exp (x n/((J+n : ℕ) : ℝ)^5) * exp (x n/((J-1+n : ℕ) : ℝ)^7)`. -/ -def goodCost (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def goodCost (J : ℕ) (x : ℕ → ℝ) (n : ℕ) : ℝ := exp (-x n/((J+n : ℕ) : ℝ)^3)*exp (x n/((J+n : ℕ) : ℝ)^5) * exp (x n/((J-1+n : ℕ) : ℝ)^7) @@ -1271,7 +1271,7 @@ theorem source_uniform_choice (C c : ℝ) (hC : 1 ≤ C) (hc : 0 ≤ c) (A : ℕ exact sourceGoodCost_bound J hJ x n (hxp n) /-- The sequence in (37), now constructed rather than supplied. -/ -def scaleSequence (J : ℕ) (X : ℝ) : ℕ → ℝ +@[expose] def scaleSequence (J : ℕ) (X : ℝ) : ℕ → ℝ | 0 => X | n+1 => ((J+n : ℕ) : ℝ)^2*scaleSequence J X n @@ -1298,7 +1298,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1310,39 +1310,39 @@ open Real Filter EulerScale EulerPacketSourceScales EulerPacketSourceTime open scoped Topology /-- Shear, given by `exp (scaleSequence J X n/((J+n : ℕ) : ℝ)^5)`. -/ -def shear (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def shear (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := exp (scaleSequence J X n/((J+n : ℕ) : ℝ)^5) /-- Frequency, given by `exp (scaleSequence J X n/((J+n : ℕ) : ℝ)^2)`. -/ -def frequency (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def frequency (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := exp (scaleSequence J X n/((J+n : ℕ) : ℝ)^2) /-- Spike, given by `exp (-scaleSequence J X n/((J+n : ℕ) : ℝ)^3)`. -/ -def spike (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def spike (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := exp (-scaleSequence J X n/((J+n : ℕ) : ℝ)^3) /-- Support scale, given by `exp (-scaleSequence J X n/((J+n : ℕ) : ℝ)^(7/2 : ℝ))`. -/ -def supportScale (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def supportScale (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := exp (-scaleSequence J X n/((J+n : ℕ) : ℝ)^(7/2 : ℝ)) /-- Previous shear as an element of `ℕ → ℝ | 0 => X^1000 | n+1 => shear J X n`. -/ -def previousShear (J : ℕ) (X : ℝ) : ℕ → ℝ +@[expose] def previousShear (J : ℕ) (X : ℝ) : ℕ → ℝ | 0 => X^1000 | n+1 => shear J X n /-- Previous frequency as an element of `ℕ → ℝ | 0 => X^D | n+1 => frequency J X n`. -/ -def previousFrequency (J D : ℕ) (X : ℝ) : ℕ → ℝ +@[expose] def previousFrequency (J D : ℕ) (X : ℝ) : ℕ → ℝ | 0 => X^D | n+1 => frequency J X n /-- Older shear as an element of `ℕ → ℝ | 0 => 1 | n+1 => previousShear J X n`. -/ -def olderShear (J : ℕ) (X : ℝ) : ℕ → ℝ +@[expose] def olderShear (J : ℕ) (X : ℝ) : ℕ → ℝ | 0 => 1 | n+1 => previousShear J X n /-- Time width, given by `3*scaleSequence J X (n+1)*scaleSequence J X n/sqrt (previousShear J X n)`. -/ -def timeWidth (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def timeWidth (J : ℕ) (X : ℝ) (n : ℕ) : ℝ := 3*scaleSequence J X (n+1)*scaleSequence J X n/sqrt (previousShear J X n) theorem previousShear_pos (J : ℕ) {X : ℝ} (hX : 0 < X) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceSolenoidal.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceSolenoidal.lean index 2800a35891..5700b005d0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceSolenoidal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceSolenoidal.lean @@ -16,7 +16,7 @@ The terminal corrector is retained in the finite assembly. Each genuine Piola pair and every inverse-frame mean belongs to the same closed constraint space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceUniformEnvelope.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceUniformEnvelope.lean index 68cc608ff1..54a134b529 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketSourceUniformEnvelope.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketSourceUniformEnvelope.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitializedParameterBounds /-! The chosen geometric profile contributes only another fixed polynomial in the source primitives, including the target shear. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageEstimates.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageEstimates.lean index 9e48589e1b..93aeea617c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStageEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStageEstimates.lean @@ -20,7 +20,7 @@ section summable scale costs. The physical parent-strain bound is CM times the previous shear, while the activation constants remain fixed low constants. -/ -@[expose] public section +public section noncomputable section @@ -174,7 +174,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageGuards.lean index 0a2cb28c31..a1207929e8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStageGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStageGuards.lean @@ -45,7 +45,7 @@ section physical frame and its scalar parameters unchanged. The source strain and time interval are the actual fields of the same parent. -/ -@[expose] public section +public section noncomputable section @@ -128,7 +128,7 @@ end end -@[expose] public section +public section noncomputable section @@ -273,7 +273,7 @@ end end -@[expose] public section +public section noncomputable section @@ -495,7 +495,7 @@ section Only the first geometric step needs coupling and tilt bounds. All later step lengths are nonnegative independently of any future frame invariant. -/ -@[expose] public section +public section noncomputable section @@ -645,7 +645,7 @@ section amplification stage. Its new ray and velocity start exactly in the old frame, so only the actual strain's spatial variation enters the error. -/ -@[expose] public section +public section noncomputable section @@ -783,7 +783,7 @@ section majorant under fixed degree and constant guards. Thus the small support scale discharges the literal neighbor comparison in the geometry step. -/ -@[expose] public section +public section noncomputable section @@ -884,7 +884,7 @@ section The history reciprocal is derived from the initial geometric step, and the only parent size input is the already constructed parent's label bound. -/ -@[expose] public section +public section noncomputable section @@ -1027,7 +1027,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageInitialLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageInitialLimit.lean index 368b8a56a6..6ce1f95b14 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStageInitialLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStageInitialLimit.lean @@ -27,7 +27,7 @@ section excludes an ordinary Euler evolution on the base horizon. Each stage is compared only on its own genuine horizon. -/ -@[expose] public section +public section noncomputable section @@ -104,7 +104,7 @@ section /-! Exact reindexing of the prescribed scale sequence after finitely many exceptional initial stages. No new choice of asymptotic scales is made. -/ -@[expose] public section +public section noncomputable section @@ -145,7 +145,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageInputs.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageInputs.lean index 49457a0591..b3e56538e2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStageInputs.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStageInputs.lean @@ -21,7 +21,7 @@ section /-! The zero-history normal stage has the same fixed parameter envelope as every positive-history stage. Its actual initial coordinate has norm one. -/ -@[expose] public section +public section noncomputable section @@ -81,7 +81,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageLowPropagation.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageLowPropagation.lean index 988e6f129d..ade1de3f8c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStageLowPropagation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStageLowPropagation.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentRenewalPrefix /-! The summable scalar budgets propagate the genuine low source guards and absorb the absolute geometric errors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStagePhysicalBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStagePhysicalBounds.lean index ebcd39f0e1..39fb8b8d35 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStagePhysicalBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStagePhysicalBounds.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInductionScaleBounds /-! Physical estimates on the actual shortened parent state. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketStageRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketStageRestriction.lean index 5821e4ba87..4fa889dcc9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketStageRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketStageRestriction.lean @@ -22,7 +22,7 @@ section /-! Restricting the actual parent frame to the next packet horizon, and identifying its physical and scaled times with the literal scales. -/ -@[expose] public section +public section noncomputable section @@ -161,7 +161,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTailBase.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTailBase.lean index ba45d6e04e..1c87d60c1f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTailBase.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTailBase.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Bound /-! A single polynomial base absorbs the finite residual multiplicity and the fixed profile envelope, before the geometric tail is summed. -/ -@[expose] public section +public section namespace EulerPacketCoarseMajorant @@ -70,7 +70,7 @@ theorem tailBase_absorption (R H C : ℝ) (hC : 0 ≤ C) (N n : ℕ) : ring /-- Tail polynomial constant, given by `(1+163*C)*H^2*(4*R*550^2)^110`. -/ -def tailPolynomialConstant (R H C : ℝ) : ℝ := +@[expose] def tailPolynomialConstant (R H C : ℝ) : ℝ := (1+163*C)*H^2*(4*R*550^2)^110 theorem tailPolynomialConstant_nonneg (R H C : ℝ) (hC : 0 ≤ C) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTailBound.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTailBound.lean index 1c4af9b7a0..2dcddf92df 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTailBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTailBound.lean @@ -10,7 +10,7 @@ public import Mathlib.Analysis.Normed.Operator.Basic /-! Bounds for the surviving grades of the actual finite packet residual. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTailNormalization.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTailNormalization.lean index 3ca35da409..4b426dac1e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTailNormalization.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTailNormalization.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketExponentialTail /-! Actual inverse-frame normalization preserves the exponentially small residual estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTargetAmplification.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTargetAmplification.lean index d9ada58088..ee9ca3d043 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTargetAmplification.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTargetAmplification.lean @@ -16,7 +16,7 @@ Actual target amplification and the resulting exponential gain for bounded history sizes and the packet amplitude chosen at target. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatum.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatum.lean index dbea5290ab..fbf9ff4121 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatum.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatum.lean @@ -16,7 +16,7 @@ has period 2π. The constant vector is multiplied by the spatial cutoff before it is placed in the genuine cylinder L² space. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ def scalarField (δ : ℝ) (x : LiftDomain period) : ℝ := innerCutoff x.1 * (profile_periodic δ).lift x.2 /-- Field, given by `scalarField δ x • ξ`. -/ -def field {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] +@[expose] def field {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] (δ : ℝ) (ξ : U) (x : LiftDomain period) : U := scalarField δ x • ξ @[simp] theorem scalarField_coe (δ : ℝ) (y : Space) (θ : ℝ) : @@ -94,14 +94,14 @@ theorem field_compact {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] supportSet_compact.of_isClosed_subset (isClosed_tsupport _) (field_support δ ξ) /-- Compact field, bundling `field`, `compact`, `smooth`. -/ -def compactField {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] +@[expose] def compactField {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] (δ : ℝ) (hδ : 0 < δ) (ξ : U) : CompactField period U where field := field δ ξ compact := field_compact δ ξ smooth := field_smooth δ hδ ξ /-- Terminal, given by `(compactField δ hδ ξ).toLp`. -/ -def terminal {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] +@[expose] def terminal {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] (δ : ℝ) (hδ : 0 < δ) (ξ : U) : CylinderL2 period U := (compactField δ hδ ξ).toLp theorem terminal_ae {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatumBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatumBounds.lean index a6de374941..220dfee92a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatumBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalDatumBounds.lean @@ -30,7 +30,7 @@ The conversion to fixed-Hq word sums is performed once on the initial datum, before any same-radius inverse estimate is applied. -/ -@[expose] public section +public section noncomputable section @@ -151,7 +151,7 @@ end end -@[expose] public section +public section noncomputable section @@ -164,10 +164,10 @@ open Set MeasureTheory ContinuousLinearMap EulerSmoothLimit EulerLiftedGradientS open scoped ContDiff /-- Jet radius, given by `64 + 40 * (δ^2)⁻¹`. -/ -def jetRadius (δ : ℝ) : ℝ := 64 + 40 * (δ^2)⁻¹ +@[expose] def jetRadius (δ : ℝ) : ℝ := 64 + 40 * (δ^2)⁻¹ /-- Scalar jet cost, given by `3 * (9 / rawBump 0)^3 * (100 * (δ^2)⁻¹)`. -/ -def scalarJetCost (δ : ℝ) : ℝ := 3 * (9 / rawBump 0)^3 * (100 * (δ^2)⁻¹) +@[expose] def scalarJetCost (δ : ℝ) : ℝ := 3 * (9 / rawBump 0)^3 * (100 * (δ^2)⁻¹) theorem jetRadius_nonneg (δ : ℝ) : 0 ≤ jetRadius δ := by unfold jetRadius @@ -251,12 +251,12 @@ theorem terminal_jet_bound {U : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U (jetRadius δ) (scalarJetCost δ * ‖ξ‖) (fun k x => field_jet_bound δ hδ hδ1 ξ k x 0) n a /-- Word radius, given by `sobolevCoefficientRadius ι (jetRadius δ)`. -/ -def wordRadius (ι : Type*) [Fintype ι] (δ : ℝ) : ℝ := +@[expose] def wordRadius (ι : Type*) [Fintype ι] (δ : ℝ) : ℝ := sobolevCoefficientRadius ι (jetRadius δ) /-- Word cost, given by `sobolevCoefficientAmplitude ι q (jetRadius δ) (scalarJetCost δ * terminalMass)`. -/ -def wordCost (ι : Type*) [Fintype ι] (q : ℕ) (δ : ℝ) : ℝ := +@[expose] def wordCost (ι : Type*) [Fintype ι] (q : ℕ) (δ : ℝ) : ℝ := sobolevCoefficientAmplitude ι q (jetRadius δ) (scalarJetCost δ * terminalMass) theorem terminal_block_bound {ι U : Type*} [Fintype ι] diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalEnvelope.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalEnvelope.lean index 80a2056bf4..d352035199 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalEnvelope.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalEnvelope.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.OperatorGevreyCalculus /-! A common-radius envelope for the literal compact terminal wave. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalInitialData.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalInitialData.lean index f3cf594434..e19afc90cd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalInitialData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalInitialData.lean @@ -21,7 +21,7 @@ section /-! The literal terminal datum belongs to the actual supported, mean-zero cylinder space. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryBudget.lean index 2eb83abdca..a481136794 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryBudget.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketProfileBudgetTimeChange /-! The literal compact terminal wave initializes the mean-time packet budget. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryFields.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryFields.lean index c30a0a9a93..64e09cbb30 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTerminalPrimaryFields.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketPrimaryRegularity /-! The genuine endpoint primary supplies all qualitative inputs to the joined recursion. -/ -@[expose] public section +public section noncomputable section @@ -30,14 +30,14 @@ variable (P : ℝ) [Fact (0 < P)] (M : EulerMeanPacketProvider.Data) (Y : EulerTransversePacketProvider.InitialData P D) /-- Joined terminal primary, constructed using `primaryProfile`. -/ -def joinedTerminalPrimary : Profile := +@[expose] def joinedTerminalPrimary : Profile := primaryProfile (joinedSourceOperators P M D τ hτ hτT B) (EulerTransversePacketPrimary.vector τ hτ hτT B Y) (EulerTransversePacketPrimary.scalar τ hτ hτT B Y) /-- Joined terminal primary witness as an element of `ProfileRegularity P M.T M.T_pos.le D.support (joinedTerminalPrimary P M D τ hτ hτT B Y)`. -/ -def joinedTerminalPrimaryWitness : +@[expose] def joinedTerminalPrimaryWitness : ProfileRegularity P M.T M.T_pos.le D.support (joinedTerminalPrimary P M D τ hτ hτT B Y) := (EulerTransversePacketPrimary.profileRegularity τ hτ hτT B Y (joinedSourceOperators P M D τ hτ hτT B) rfl).changeTime hTime.symm M.T_pos.le diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTimeAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTimeAlgebra.lean index a143721216..4e0e17a55d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTimeAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTimeAlgebra.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Mul /-! Genuine within-interval time derivatives commute with the finite packet algebra. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean index 4df0cfab4a..11a3ceb049 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean @@ -17,14 +17,14 @@ section /-! Exact time-profile bookkeeping for the high, mean, and previous-corrector terms. -/ -@[expose] public section +public section namespace EulerPacketTimeProfile /-- Mean scale, given by `H^(2*p-2)`. -/ -def meanScale (H : ℝ) (p : ℕ) : ℝ := H^(2*p-2) +@[expose] def meanScale (H : ℝ) (p : ℕ) : ℝ := H^(2*p-2) /-- High scale, given by `γ*meanScale H p`. -/ -def highScale (γ H : ℝ) (p : ℕ) : ℝ := γ*meanScale H p +@[expose] def highScale (γ H : ℝ) (p : ℕ) : ℝ := γ*meanScale H p theorem meanScale_pos (H : ℝ) (hH : 0 < H) (p : ℕ) : 0 < meanScale H p := pow_pos hH _ theorem highScale_pos (γ H : ℝ) (hγ : 0 < γ) (hH : 0 < H) (p : ℕ) : @@ -140,7 +140,7 @@ end end -@[expose] public section +public section noncomputable section @@ -176,9 +176,9 @@ def ofGrowth [CompactSpace K] (g : C(K, ℝ)) (hg : ∀ t, 0 < g t) : Scales K w variable (S : Scales K) /-- Mean, given by `ContinuousMap.const K (meanScale S.H0 p)`. -/ -def mean (p : ℕ) : C(K,ℝ) := ContinuousMap.const K (meanScale S.H0 p) +@[expose] def mean (p : ℕ) : C(K,ℝ) := ContinuousMap.const K (meanScale S.H0 p) /-- High, given by `S.growth*S.mean p`. -/ -def high (p : ℕ) : C(K,ℝ) := S.growth*S.mean p +@[expose] def high (p : ℕ) : C(K,ℝ) := S.growth*S.mean p @[simp] theorem mean_apply (p : ℕ) (t : K) : S.mean p t = meanScale S.H0 p := rfl @[simp] theorem high_apply (p : ℕ) (t : K) : S.high p t = highScale (S.growth t) S.H0 p := rfl diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyMargin.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyMargin.lean index e1f952b638..7283bbfeb3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyMargin.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyMargin.lean @@ -16,7 +16,7 @@ section /-! The actual correction target absorbs every fixed power of the frequency. -/ -@[expose] public section +public section noncomputable section @@ -86,7 +86,7 @@ section amplitude give the small lifted velocity required by the finite flow bootstrap. All source constants remain fixed as frequency increases. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ open Real Filter EulerPacketCorrectionScalar open scoped Topology /-- Lifted amplitude, given by `C/k + E*delta (expansion k)`. -/ -def liftedAmplitude (C E k : ℝ) : ℝ := C/k + E*delta (expansion k) +@[expose] def liftedAmplitude (C E k : ℝ) : ℝ := C/k + E*delta (expansion k) theorem fixed_div_eventually_le_inverse_half (C : ℝ) : ∀ᶠ k : ℝ in atTop, C/k ≤ k^(-(1/2 : ℝ)) := by @@ -149,7 +149,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyScales.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyScales.lean index a1aa775e18..b0e127bf4e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyScales.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketUniformFrequencyScales.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real costs can be placed in the same finite list as the geometric and pressure costs, so the starting stage is chosen only once. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open scoped Topology /-- Parameter envelope, given by `C*((J+n : ℕ) : ℝ)^p*(scaleSequence J X n)^q * exp (c*(scaleSequence J X n/((J-1+n : ℕ) : ℝ)^3))`. -/ -def parameterEnvelope (J : ℕ) (C c : ℝ) (p q : ℕ) (X : ℝ) (n : ℕ) : ℝ := +@[expose] def parameterEnvelope (J : ℕ) (C c : ℝ) (p q : ℕ) (X : ℝ) (n : ℕ) : ℝ := C*((J+n : ℕ) : ℝ)^p*(scaleSequence J X n)^q * exp (c*(scaleSequence J X n/((J-1+n : ℕ) : ℝ)^3)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketUniversalFrequency.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketUniversalFrequency.lean index f9406879ad..105513fef1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketUniversalFrequency.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketUniversalFrequency.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketUniformFrequencyMargin /-! The only eventual frequency conditions left after the uniform source cost comparison form one fixed, parent-independent numerical record. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketVolumeDivergence.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketVolumeDivergence.lean index 3e5c4fa55a..cafc21e481 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketVolumeDivergence.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketVolumeDivergence.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Symmetric formula controls the derivative of the Jacobian, and symmetry of the second derivative supplies the Piola cancellation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevAcceleration.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevAcceleration.lean index e8b32cf44f..c1bccb7a43 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevAcceleration.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevAcceleration.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterSobolevOperations /-! Coefficient-only Sobolev costs for the actual acceleration right side. -/ -@[expose] public section +public section noncomputable section @@ -23,7 +23,7 @@ open scoped ContDiff /-- Acceleration block amplitude, given by `3*sobolevCoefficientAmplitude ι q Rc CA * (Cf+6*sobolevCoefficientAmplitude ι q Rc CB*Cv)`. -/ -def accelerationBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) +@[expose] def accelerationBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (Rc CA CB Cf Cv : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q Rc CA * (Cf+6*sobolevCoefficientAmplitude ι q Rc CB*Cv) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevBlocks.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevBlocks.lean index f62c443ce1..d049c1a270 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevBlocks.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevBlocks.lean @@ -21,7 +21,7 @@ bounds place its finite cost on coefficient blocks, preserving the input and output external radius and factorial shift. -/ -@[expose] public section +public section noncomputable section @@ -36,15 +36,16 @@ variable {P E F ι : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup F] [NormedSpace ℝ F] [Fintype ι] /-- The fixed-order sum of the actual spatial derivative norms. -/ -def baseSize (directions : ι → P) (q : ℕ) (f : P → E) (x : P) : ℝ := +@[expose] def baseSize (directions : ι → P) (q : ℕ) (f : P → E) (x : P) : ℝ := ∑ k ∈ range (q+1), wordSum directions f k x /-- A fixed Sobolev base norm inside the sum of actual external words. -/ -def block (directions : ι → P) (q : ℕ) (f : P → E) (n : ℕ) (x : P) : ℝ := +@[expose] def block (directions : ι → P) (q : ℕ) (f : P → E) (n : ℕ) (x : P) : ℝ := ∑ w : Fin n → ι, baseSize directions q (wordDerivative directions f w) x /-- The finite base-order Leibniz constant belongs only to the coefficient block. -/ -def coefficientBlock (directions : ι → P) (q : ℕ) (f : P → E) (n : ℕ) (x : P) : ℝ := +@[expose] def coefficientBlock (directions : ι → P) (q : ℕ) (f : P → E) + (n : ℕ) (x : P) : ℝ := (2 : ℝ)^q*block directions q f n x theorem baseSize_nonneg (directions : ι → P) (q : ℕ) (f : P → E) (x : P) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCoefficient.lean index 09efa67cb5..94e491b6ad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCoefficient.lean @@ -17,7 +17,7 @@ Their alphabet count and fixed base derivative order enlarge only the coefficient radius, once. No forcing or solution radius is changed. -/ -@[expose] public section +public section noncomputable section @@ -46,12 +46,12 @@ theorem block_eq_sum_levels (directions : ι → P) (q : ℕ) (f : P → E) (wordSum_succ directions f hf (n+k) x).symm /-- The enlarged radius is a property only of the coefficient alphabet. -/ -def sobolevCoefficientRadius (ι : Type*) [Fintype ι] (Rc : ℝ) : ℝ := +@[expose] def sobolevCoefficientRadius (ι : Type*) [Fintype ι] (Rc : ℝ) : ℝ := 4*(max 1 (Fintype.card ι : ℝ)*Rc) /-- For fixed q this is a literal polynomial in the original coefficient radius and amplitude, with numerical factorial coefficients. -/ -def sobolevCoefficientAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (Rc C : ℝ) : ℝ := +@[expose] def sobolevCoefficientAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (Rc C : ℝ) : ℝ := (2 : ℝ)^q*C*∑ k ∈ range (q+1), sobolevCoefficientRadius ι Rc^k*(k.factorial : ℝ)^2 theorem sobolevCoefficientRadius_nonneg (Rc : ℝ) (hRc : 0 ≤ Rc) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCostMonotone.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCostMonotone.lean index 7285ae551e..08be57f3d2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCostMonotone.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevCostMonotone.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Monotonicity of the explicit finite-order inverse polynomials. These lemmas replace actual operator constants by source-scale upper bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevFiniteSum.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevFiniteSum.lean index e981d5039a..b2cf9c7158 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevFiniteSum.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevFiniteSum.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! Finite sums preserve genuine fixed-Sobolev external-word estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevGevrey.lean index 530878bc7a..bac175377f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevGevrey.lean @@ -30,7 +30,7 @@ undifferentiated coefficient action. Its direct word recurrence places at least one external derivative on the coefficient in every term. -/ -@[expose] public section +public section noncomputable section @@ -160,7 +160,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevInverse.lean index d14ac19a54..97d06af448 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevInverse.lean @@ -19,7 +19,7 @@ ordinary inverse norm and the finite coefficient-jet bound. It does not depend on any external derivative order or factorial shift. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open ContinuousLinearMap Finset open scoped ContDiff /-- A fixed finite recursion of polynomial base-order inverse constants. -/ -def sobolevInverseCost (I B : ℝ) : ℕ → ℝ +@[expose] def sobolevInverseCost (I B : ℝ) : ℕ → ℝ | 0 => I | q+1 => I+sobolevInverseCost I B q+(2 : ℝ)^q*B*(sobolevInverseCost I B q)^2 diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevLinear.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevLinear.lean index e5589466d5..588c652ffe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevLinear.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevLinear.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterWordHigher /-! Fixed bounded maps preserve the actual fixed-Sobolev external word sums. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevOperations.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevOperations.lean index 7bc6840f97..8208fb0220 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevOperations.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevOperations.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! Same-radius operations on literal fixed-base ordered derivative blocks. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevProductGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevProductGevrey.lean index f59f240517..d905b2e897 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevProductGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevProductGevrey.lean @@ -17,7 +17,7 @@ Only coefficient blocks are compared with the coefficient radius. The input field's ordered word sum passes directly through the Leibniz estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevScaling.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevScaling.lean index a6e0782767..21c5437c67 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevScaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevScaling.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Basic /-! Scalar normalization preserves the external word radius and fixed Sobolev order. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevTensorInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevTensorInverse.lean index feff463656..673f40f5ec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevTensorInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterSobolevTensorInverse.lean @@ -18,7 +18,7 @@ Only the given operator coefficients use tensor bounds. Forcing and solved fields retain their literal fixed-base ordered-word blocks at the same radius. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open scoped ContDiff /-- For fixed q this is an explicit polynomial in the original inverse, coefficient, and forcing constants. It has no grade dependence. -/ -def inverseBlockCost (ι : Type*) [Fintype ι] (q : ℕ) (I Rc C D : ℝ) : ℝ := +@[expose] def inverseBlockCost (ι : Type*) [Fintype ι] (q : ℕ) (I Rc C D : ℝ) : ℝ := 1+sobolevInverseCost I (sobolevCoefficientAmplitude ι q Rc C) q * (sobolevCoefficientAmplitude ι q Rc C+D) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordCalculus.lean index fa2a98fd17..1988f221d6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordCalculus.lean @@ -19,7 +19,7 @@ the genuine iterated Fréchet derivative. Fixed bounded maps commute with every word and act boundedly on the same sum, without a dimension factor. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable {P E F ι : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] /-- A genuine derivative in one prescribed constant direction. -/ -def directional (directions : ι → P) (f : P → E) (i : ι) : P → E := +@[expose] def directional (directions : ι → P) (f : P → E) (i : ι) : P → E := fun x => fderiv ℝ f x (directions i) theorem directional_contDiff (directions : ι → P) (f : P → E) (hf : ContDiff ℝ ∞ f) (i : ι) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean index fc16196908..383a2b6946 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean @@ -18,7 +18,7 @@ word derivative. Summing all words changes the radius by one fixed alphabet factor, independent of the derivative order and factorial shift. -/ -@[expose] public section +public section noncomputable section @@ -31,11 +31,11 @@ variable {P E ι : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup E] [NormedSpace ℝ E] [Fintype ι] /-- The actual mixed differential evaluated on an ordered word of directions. -/ -def wordDerivative (directions : ι → P) (f : P → E) {n : ℕ} (w : Fin n → ι) (x : P) : E := +@[expose] def wordDerivative (directions : ι → P) (f : P → E) {n : ℕ} (w : Fin n → ι) (x : P) : E := iteratedFDeriv ℝ n f x (fun j => directions (w j)) /-- The sum of the actual norms over all ordered words. -/ -def wordSum (directions : ι → P) (f : P → E) (n : ℕ) (x : P) : ℝ := +@[expose] def wordSum (directions : ι → P) (f : P → E) (n : ℕ) (x : P) : ℝ := ∑ w : Fin n → ι, ‖wordDerivative directions f w x‖ omit [Fintype ι] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordHigher.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordHigher.lean index 248e2b5999..eee4223a18 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordHigher.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordHigher.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParameterWordCalculus /-! Smoothness and exact concatenation of genuine directional word derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordProduct.lean index db295ecbd8..4f315e4ed2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordProduct.lean @@ -18,7 +18,7 @@ directional words. The forcing and solution word sums stay unchanged; there is no dimension factor or enlargement of their radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentChoiceInitialSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentChoiceInitialSupport.lean index 8a54d3fa73..571d7d86b2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentChoiceInitialSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentChoiceInitialSupport.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketInitialSupport support. The forward mean contribution is localized even when its boundary coefficient is nonzero. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerChild.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerChild.lean index 21d1225413..304a676444 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerChild.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerChild.lean @@ -19,7 +19,7 @@ section /-! The actual scalar pressure of the corrected source packet has the constructed continuous physical pressure force, at every time. -/ -@[expose] public section +public section noncomputable section @@ -169,7 +169,7 @@ section normalized packet uses the parent's genuine determinant-one Jacobian, and the final physical rescaling preserves divergence exactly. -/ -@[expose] public section +public section noncomputable section @@ -300,7 +300,7 @@ section velocity, and its acceleration is minus the actual constructed pressure force. Both matches are derived from the existing parent law and Euler. -/ -@[expose] public section +public section noncomputable section @@ -374,7 +374,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerLowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerLowBounds.lean index 49b39245a5..a48b5aef91 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerLowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerLowBounds.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketPhysicalLowBounds Euler state to the next. The only update costs are the initial velocity gradient error and the proved upper pressure bound. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerParity.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerParity.lean index e3198bdef8..c53e13a1ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerParity.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ParentPacketParity /-! The physical velocity and pressure force inherit the genuine particle symmetry, so their values vanish at the fixed origin. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerSobolev.lean index a020af277c..4a6a33d041 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerSobolev.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothEulerEvolution order. Strong time evolution follows from their classical Euler equation and continuous L² jets, including both endpoint derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerState.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerState.lean index 62b8642239..a8b7e5e232 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentEulerState.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentEulerState.lean @@ -18,7 +18,7 @@ section /-! Spatial smoothness of the actual physical particle inverse follows from its inverse identities and the genuine determinant-one Jacobian. -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardGeometryInput.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardGeometryInput.lean index c2f8c71781..bf11691e0d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardGeometryInput.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardGeometryInput.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketParentPhysicalBudgets actual amplification geometry. The large parent shear needs no short-time assumption of the form CM*T≤1/2. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardInitialSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardInitialSupport.lean index 1e1a270c9c..eb98ec5c69 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardInitialSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardInitialSupport.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketForwardInitialSupport /-! The same forward correction used by the actual child has the literal compact initial support when the mean boundary parameter is zero. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardUniformCosts.lean index ecde3e24df..40607d49a6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentForwardUniformCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentForwardUniformCosts.lean @@ -20,7 +20,7 @@ section radius controlled by the same fixed parent polynomial. Its genuine geometric propagator constant is retained, without replacing the growth profile. -/ -@[expose] public section +public section noncomputable section @@ -156,7 +156,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceCenter.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceCenter.lean index fd47a12632..d1f47a9bab 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceCenter.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceCenter.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ParentStateGeometry /-! The center error in a geometric packet choice is the gradient of the actual increment between its two Euler states. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceInitial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceInitial.lean index f6fbc7b1c4..9235f9b5dd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceInitial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceInitial.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentForwardInitialSupport compact high and mean increments used in the initial-data convergence proof. Restriction to a shorter horizon preserves these equalities. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceLow.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceLow.lean index 25a9b0c67d..1c37f207bb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceLow.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceLow.lean @@ -21,7 +21,7 @@ section by the exponentially small early/history size plus its correction error. These are the costs needed to preserve the localized source guards. -/ -@[expose] public section +public section noncomputable section @@ -161,7 +161,7 @@ section pressure bound are consequences of the exact physical estimates. The radius stays fixed, and the boundary parameter has a canonical value. -/ -@[expose] public section +public section noncomputable section @@ -272,7 +272,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceRenewal.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceRenewal.lean index e32684580b..09e920f95a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceRenewal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryChoiceRenewal.lean @@ -21,7 +21,7 @@ activation time of the next parent frame. These factories are the checked `SmoothState` renewals with the source-selected amplitude and primary; all target matching is proved from their definitions. -/ -@[expose] public section +public section noncomputable section @@ -251,7 +251,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryForwardChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryForwardChoice.lean index 1f0bc1b6ee..9a762d9339 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryForwardChoice.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryForwardChoice.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentUniformForwardChild /-! The actual zero-history geometry constructs the forward packet and its new smooth Euler state at the uniformly chosen frequency. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryJoinedChoice.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryJoinedChoice.lean index fac6a00956..5474e8763e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryJoinedChoice.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentGeometryJoinedChoice.lean @@ -38,7 +38,7 @@ section has a source-dependent Gevrey bound uniform in the truncation frequency. The time derivative of the inverse deformation is included explicitly. -/ -@[expose] public section +public section noncomputable section @@ -151,7 +151,7 @@ section the physical shear and pressure errors, and the three flow fields. Only the displayed numerical frequency margins are independent extra guards. -/ -@[expose] public section +public section noncomputable section @@ -393,7 +393,7 @@ end end -@[expose] public section +public section noncomputable section @@ -532,7 +532,7 @@ section /-! The positive-history packet at the fixed frequency constructs the actual next parent, with the same errors and the k^80 label bound. -/ -@[expose] public section +public section noncomputable section @@ -627,7 +627,7 @@ section /-! Initial-data convergence for the very same correction witnesses used in the exact packets. No correction is chosen again for this conclusion. -/ -@[expose] public section +public section noncomputable section @@ -652,6 +652,7 @@ abbrev correctionBudget (k : ℝ) (hk : 4 ≤ k) (hn : 1 ≤ truncation k) := hk) /-- Exact initial, constructed using `scale`. -/ +@[expose] def exactInitial (k : ℝ) (hk : 4 ≤ k) (hn : 1 ≤ truncation k) (Q : A.correctionBudget k hk hn) : Space → Space := scale A.parent.ell @@ -711,7 +712,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentHistoryCostPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentHistoryCostPolynomial.lean index 72a1a2aa75..e66560aa0f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentHistoryCostPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentHistoryCostPolynomial.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryParentCost /-! One fixed polynomial controls the complete history sensitivity envelope for all parent label constants and reciprocal time bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedRadiusPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedRadiusPolynomial.lean index 5605e181df..65045af5b2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedRadiusPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedRadiusPolynomial.lean @@ -25,7 +25,7 @@ section /-! A fixed polynomial in the genuine parent label bound controls the coefficient leaves of the normal, joined and mean packet budgets. -/ -@[expose] public section +public section noncomputable section @@ -167,7 +167,7 @@ section /-! Composing the actual coefficient envelope with the parent label polynomial gives a single fixed polynomial in the parent size K. -/ -@[expose] public section +public section noncomputable section @@ -232,7 +232,7 @@ end end -@[expose] public section +public section noncomputable section @@ -314,7 +314,7 @@ theorem sourceEnvelope_power (X : ℝ) (hX : 1 ≤ X) : exact (le_abs_self _).trans (eval_bound sourcePolynomial X hX) /-- Parameter size, given by `1+K+Ti+TiTotal+Cp+B+δ⁻¹+N`. -/ -def parameterSize (K Ti TiTotal Cp B δ N : ℝ) : ℝ := 1+K+Ti+TiTotal+Cp+B+δ⁻¹+N +@[expose] def parameterSize (K Ti TiTotal Cp B δ N : ℝ) : ℝ := 1+K+Ti+TiTotal+Cp+B+δ⁻¹+N theorem parameterSize_bounds (K Ti TiTotal Cp B δ N : ℝ) (hK : 0 ≤ K) (hTi : 0 ≤ Ti) (hTiTotal : 0 ≤ TiTotal) (hCp : 0 ≤ Cp) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedState.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedState.lean index fada209564..64c192c2c2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedState.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedState.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketForwardInitializedResidu physical state. Their residual and parity proofs are supplied by their source formulas, not additional hypotheses about the new solution. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable {A : Parent} (S : SmoothState A) (H : LowBounds A) (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) /-- Forward child, constructed using `S.packetChild`. -/ -def forwardChild +@[expose] def forwardChild (Q : Budget period A.T_pos (forwardInitializedCorrectionData (A.meanData H) (A.transverseData m hm J support hSupport) rfl δ hδ ξ hs α (A.sourceAgreement m hm J support hSupport H) N hN k hk)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedUniformCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedUniformCosts.lean index 42affbe827..08352b5089 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedUniformCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentInitializedUniformCosts.lean @@ -18,7 +18,7 @@ section in the parent-to-packet constructor. All three source budgets share one radius and retain the growth profile derived from that geometry. -/ -@[expose] public section +public section noncomputable section @@ -58,7 +58,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentNormalPacketParameters.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentNormalPacketParameters.lean index 3779c0af47..8f0cbfc16c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentNormalPacketParameters.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentNormalPacketParameters.lean @@ -26,7 +26,7 @@ section one explicit polynomial-exponential envelope, including the base-sized boundary coefficient and both reciprocal time intervals. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ open Real EulerPacketSourceParameterScales EulerPacketUniformFrequencyScales EulerPacketSourceScales /-- Bound constant, given by `8+1120*(2*Cθ)^10+CB+Cξ`. -/ -def boundConstant (Cθ CB Cξ : ℝ) : ℝ := 8+1120*(2*Cθ)^10+CB+Cξ +@[expose] def boundConstant (Cθ CB Cξ : ℝ) : ℝ := 8+1120*(2*Cθ)^10+CB+Cξ theorem constant_pos (Cθ CB Cξ : ℝ) (hB : 0 ≤ CB) (hξ : 0 ≤ Cξ) : 0 < boundConstant Cθ CB Cξ := by @@ -137,7 +137,7 @@ section parameter have fixed polynomial caps. They are inputs to the uniform normal-stage source envelope. -/ -@[expose] public section +public section noncomputable section @@ -228,7 +228,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentNormalizedGeometry.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentNormalizedGeometry.lean index 36a08d61c7..1553942932 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentNormalizedGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentNormalizedGeometry.lean @@ -30,7 +30,7 @@ section of the actual graph velocity. The normalized packet formula follows from the literal lifted coefficient, with the physical scale explicit. -/ -@[expose] public section +public section noncomputable section @@ -135,7 +135,7 @@ end end -@[expose] public section +public section noncomputable section @@ -156,7 +156,7 @@ def correctedPacketVelocity (k : ℝ) (Y u : Icc (0 : ℝ) A.T → Space → Spa ((B.correctedFieldTower P).pointField t (cylinderGraph P k C.direction (A.ell⁻¹ • Y t x)))) /-- Packet inverse, given by `A.ell⁻¹ • Y (projIcc 0 A.T A.T_pos.le q.1) (A.ell • q.2)`. -/ -def packetInverse (Y : Icc (0 : ℝ) A.T → Space → Space) (q : ℝ × Space) : Space := +@[expose] def packetInverse (Y : Icc (0 : ℝ) A.T → Space → Space) (q : ℝ × Space) : Space := A.ell⁻¹ • Y (projIcc 0 A.T A.T_pos.le q.1) (A.ell • q.2) theorem correctedPacketVelocity_eq_physical (k : ℝ) @@ -227,7 +227,7 @@ section the particle acceleration. Continuity extends the identity to both endpoints; no acceleration or pressure-force match is assumed. -/ -@[expose] public section +public section noncomputable section @@ -325,7 +325,7 @@ section /-! Two actual time-derivative pairs give genuine joint C² regularity for a smooth spatial coefficient path on interior times. -/ -@[expose] public section +public section noncomputable section @@ -374,7 +374,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentOrdinaryEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentOrdinaryEvolution.lean index a121e8e2a4..377922da53 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentOrdinaryEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentOrdinaryEvolution.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.OrdinaryEulerDifference Sobolev evolution used by the H³ stability estimate. The solenoidal constraint at the endpoints follows by L² continuity from the interior. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketExactEuler.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketExactEuler.lean index c4bdc1f314..8a3c733fa6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketExactEuler.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketExactEuler.lean @@ -22,7 +22,7 @@ section /-! Euler's spatial/amplitude rescaling, proved for the actual first derivatives and scalar pressure. Time is unchanged. -/ -@[expose] public section +public section noncomputable section @@ -119,7 +119,7 @@ section /-! Normalizing the actual parent Euler velocity and pressure preserves Euler and supplies the true time law of the normalized particle map. -/ -@[expose] public section +public section noncomputable section @@ -208,7 +208,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketForwardInput.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketForwardInput.lean index a649c4d4a7..70d279905d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketForwardInput.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketForwardInput.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketCommonRadius label fields and its short-time low strain bound. The growth profile is the constant one, proved by the actual tangent equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketFrames.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketFrames.lean index a299292726..478c8b749b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketFrames.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketFrames.lean @@ -18,7 +18,7 @@ particle-map displacement and its two time derivatives. The inverse is the polynomial cofactor, and the strain and Jacobi curvature are their literal products; no separate inverse or coefficient evolution is assumed. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,7 @@ namespace Parent variable (G : Parent) /-- Zero time, given by `⟨0,le_rfl,G.T_pos.le⟩`. -/ -def zeroTime : Icc (0 : ℝ) G.T := ⟨0,le_rfl,G.T_pos.le⟩ +@[expose] def zeroTime : Icc (0 : ℝ) G.T := ⟨0,le_rfl,G.T_pos.le⟩ /-- Frame as an element of `SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace`. -/ def frame : SmoothTimeField (Icc (0 : ℝ) G.T) Space EndSpace := diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryFrame.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryFrame.lean index 0ef2f59351..ad1334911a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryFrame.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryFrame.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketPrimaryShearIdentity Its matrix derivative is derived from the parent curvature, and its ray and primary velocity are the constructed source trajectories. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryGuards.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryGuards.lean index f7da3b3039..019d4d2a6b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryGuards.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketGeometryGuards.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ParentPacketHessianSymmetry History norms and symmetry are derived from the parent fields, and the neighbor error is the computed, ell-scaled coefficient expression. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHessianSymmetry.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHessianSymmetry.lean index 58710dcda2..fedf2e2330 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHessianSymmetry.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHessianSymmetry.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Symmetric Symmetry of the source history Hessian is consequently a theorem about the constructed parent data, rather than an independent hypothesis. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryNeighbor.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryNeighbor.lean index 8f78fe8bd2..1b4d6a71be 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryNeighbor.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryNeighbor.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryLipschitz parent's label scale. The constants are computed from the prescribed coefficients and the older frame, not from an estimate on the new primary. -/ -@[expose] public section +public section noncomputable section @@ -109,7 +109,7 @@ theorem initial_history_derivative_scale : /-- The actual neighbor coefficient after extracting the one factor of ell supplied by the parent spatial derivative estimates. -/ -def neighborScaleCost +@[expose] def neighborScaleCost (P : ParentFrame (G.transverseData m hm R S hS) τ) (CM CH : ℝ) : ℝ := L.strainDifferenceCost + 3*L.normalDifferenceCost/(P.rayScale hτ hτT*P.epsilon) + diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryPolynomial.lean index cd90831ac1..fe232a5613 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketHistoryPolynomial.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryParentCost polynomial dependence on the parent label constant and reciprocal history length. The small physical scale remains a multiplicative factor. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketJoinedInput.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketJoinedInput.lean index d311bc6c4b..f565757f60 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketJoinedInput.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketJoinedInput.lean @@ -14,7 +14,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ParentPacketLabelData the complete joined-packet input at one common radius. The history Jacobi law, inverse coefficients and all coefficient matches are proved. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketLabelData.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketLabelData.lean index 2637d2e1c5..44bd6f3f8e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketLabelData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketLabelData.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PhysicalChildParent The constructed child inherits this interface from its proved three-field estimate; frame and coefficient identifications are not extra hypotheses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborBounds.lean index 75cba16203..3dee9fc7e6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborBounds.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryLipschitz The stationary history sensitivity is linear in these differences, so its computed Lipschitz constant retains that factor as well. -/ -@[expose] public section +public section noncomputable section @@ -67,13 +67,14 @@ variable {G : Parent} (L : LabelData G) (m : Space) (hm : ‖m‖ = 1) (R : U ≃ₗᵢ[ℝ] referencePlane m) (S : Set Space) (hS : IsCompact S) /-- Frame difference cost, given by `frameAmplitude L.K*coefficientRadius L.K`. -/ -def frameDifferenceCost : ℝ := frameAmplitude L.K*coefficientRadius L.K +@[expose] def frameDifferenceCost : ℝ := frameAmplitude L.K*coefficientRadius L.K /-- First difference cost, given by `gradientAmplitude L.K*coefficientRadius L.K`. -/ -def firstDifferenceCost : ℝ := gradientAmplitude L.K*coefficientRadius L.K +@[expose] def firstDifferenceCost : ℝ := gradientAmplitude L.K*coefficientRadius L.K /-- Normal difference cost, given by `9*(frameAmplitude L.K)^2*coefficientRadius L.K`. -/ -def normalDifferenceCost : ℝ := 9*(frameAmplitude L.K)^2*coefficientRadius L.K +@[expose] def normalDifferenceCost : ℝ := 9*(frameAmplitude L.K)^2*coefficientRadius L.K /-- Strain difference cost, given by `27*(frameAmplitude L.K)^2*gradientAmplitude L.K*coefficientRadius L.K`. -/ +@[expose] def strainDifferenceCost : ℝ := 27*(frameAmplitude L.K)^2*gradientAmplitude L.K*coefficientRadius L.K diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborPolynomial.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborPolynomial.lean index 7d050aebfd..1eefb326ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborPolynomial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketNeighborPolynomial.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ParentPacketHistoryPolynomial including the normal normalization and the selected terminal datum. The small label scale is kept outside this polynomial. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketParity.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketParity.lean index 6128d2fa7a..26f48f3aeb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketParity.lean @@ -19,7 +19,7 @@ section /-! Spatial derivatives and genuine within-time derivatives preserve the expected parity, including the closed interval's endpoints. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketPhysicalCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketPhysicalCoefficients.lean index 1df61d698f..0bcbd99e99 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketPhysicalCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketPhysicalCoefficients.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.ParentPacketSourceData and pressure Hessian. The only matching data are the literal Lagrangian velocity and acceleration laws, not separate coefficient identities. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ namespace Parent variable (G : Parent) /-- Position, given by `x+G.displacement.field t x`. -/ -def position (t : Icc (0 : ℝ) G.T) (x : Space) : Space := +@[expose] def position (t : Icc (0 : ℝ) G.T) (x : Space) : Space := x+G.displacement.field t x @[simp] theorem position_initial (x : Space) : G.position G.zeroTime x=x := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketRestriction.lean index 3580094fd2..0eede1f96f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketRestriction.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothTimeFieldRestriction /-! Restricting the actual parent to a nested horizon preserves its flow identities, physical-label budget and the source low-order guards. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketScaledBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketScaledBounds.lean index c51b7f3c7a..6d63c99c5b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketScaledBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketScaledBounds.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder factor ell for each normalized spatial derivative. This factor is needed in the neighboring-label estimates of the induction. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ open scoped ContDiff BoundedContinuousFunction variable {G : Parent} (L : LabelData G) /-- Scaled radius, given by `G.ell*coefficientRadius L.K`. -/ -def scaledRadius : ℝ := G.ell*coefficientRadius L.K +@[expose] def scaledRadius : ℝ := G.ell*coefficientRadius L.K theorem scaledRadius_nonneg : 0 ≤ L.scaledRadius := mul_nonneg G.ell_pos.le (coefficientRadius_nonneg L.K) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketSourceData.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketSourceData.lean index e187a1744e..c046711922 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketSourceData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketSourceData.lean @@ -19,7 +19,7 @@ section /-! The ordinary three-dimensional coefficient interface is a literal restriction of the generic smooth time-field interface. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketStrainEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketStrainEvolution.lean index 928c969f1e..00fe8c3e6d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentPacketStrainEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentPacketStrainEvolution.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SmoothTimeFieldChain inverse derivative is derived from the polynomial cofactor construction and the genuine frame identity, including the time-interval endpoints. -/ -@[expose] public section +public section noncomputable section @@ -117,11 +117,11 @@ theorem strainDerivative_norm_bound (CM CH : ℝ) (hCM : 0 ≤ CM) simpa only [pow_two] using add_le_add (mul_le_mul hM hM (norm_nonneg _) hCM) hH /-- Center strain, given by `extendPath G.T G.T_pos.le G.strain.field t 0`. -/ -def centerStrain (t : ℝ) : EndSpace := +@[expose] def centerStrain (t : ℝ) : EndSpace := extendPath G.T G.T_pos.le G.strain.field t 0 /-- Center curvature, given by `extendPath G.T G.T_pos.le G.curvature.field t 0`. -/ -def centerCurvature (t : ℝ) : EndSpace := +@[expose] def centerCurvature (t : ℝ) : EndSpace := extendPath G.T G.T_pos.le G.curvature.field t 0 /-- Center strain derivative, given by `extendPath G.T G.T_pos.le G.strainDerivative.field t 0`. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentParticleInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentParticleInverse.lean index 66522dbf21..a9967bace2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentParticleInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentParticleInverse.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.DeformationVolume volume follows from the actual determinant, and both time restriction and the packet child propagate the two inverse laws. -/ -@[expose] public section +public section noncomputable section @@ -79,7 +79,7 @@ theorem field_measurePreserving (t : Icc (0 : ℝ) A.T) : (Continuous.uncurry_left t I.continuous) (A.displacement_det_one t) /-- Normalized, given by `A.packetInverse I.field (t,x)`. -/ -def normalized (t : Icc (0 : ℝ) A.T) (x : Space) : Space := +@[expose] def normalized (t : Icc (0 : ℝ) A.T) (x : Space) : Space := A.packetInverse I.field (t,x) theorem normalized_left (t : Icc (0 : ℝ) A.T) (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalParameters.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalParameters.lean index e3f05d230c..f3df87f67d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalParameters.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalParameters.lean @@ -17,7 +17,7 @@ certificate below is proved for the actual state renewal constructors in `ParentTargetRenewal`; it records equality of the physical matrix and the two physical vectors, rather than postulating their scalar estimates. -/ -@[expose] public section +public section noncomputable section @@ -30,11 +30,11 @@ variable {ι : Type*} (G : PhysicalGeometryData ι) /-- Coupling error, given by `G.y^4+G.σ^2*G.y^2+8*G.σ*G.y^3 + 30000000*neighborStabilityConstant*G.error*G.Θ^40`. -/ -def couplingError : ℝ := G.y^4+G.σ^2*G.y^2+8*G.σ*G.y^3 + +@[expose] def couplingError : ℝ := G.y^4+G.σ^2*G.y^2+8*G.σ*G.y^3 + 30000000*neighborStabilityConstant*G.error*G.Θ^40 /-- Tilt error, given by `1500*G.σ+30000000*neighborStabilityConstant*G.error*G.Θ^40`. -/ -def tiltError : ℝ := 1500*G.σ+30000000*neighborStabilityConstant*G.error*G.Θ^40 +@[expose] def tiltError : ℝ := 1500*G.σ+30000000*neighborStabilityConstant*G.error*G.Θ^40 /-- A lower bound for the magnitude of the leading compressive term. -/ def compressionScale : ℝ := G.a/(20*G.ε*G.target) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalPrefix.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalPrefix.lean index ae0b8a9e04..1890d30282 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalPrefix.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalPrefix.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.EuclideanDomain.Field /-! Finite-prefix control of the actual coupling recurrence. Each step may use only the bounds already proved on its preceding prefix. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleApplication.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleApplication.lean index befb79e4a4..d0dda9751f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleApplication.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleApplication.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.PacketForwardGeometryLowBounds source branches. Its inputs are the existing frame and neighbor costs, with no assumed estimate for the new coupling or tilt. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleCosts.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleCosts.lean index 6d615c209c..cb4e052d48 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleCosts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentRenewalScaleCosts.lean @@ -16,7 +16,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketSourceScaleGuards envelope uses the constant sequence a=2, so its summability does not assume bounds for the future, not-yet-constructed geometric couplings. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean index 537d6daf78..377f9690a3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean @@ -57,7 +57,7 @@ section continuity of the coefficients, with a uniform bound, gives strong continuity even when uniform convergence of coefficients is unavailable. -/ -@[expose] public section +public section noncomputable section @@ -188,7 +188,7 @@ end end -@[expose] public section +public section noncomputable section @@ -355,7 +355,7 @@ section /-! Actual Sobolev integrability under a smooth volume-preserving change of variables, with an explicit finite-order composition constant. -/ -@[expose] public section +public section noncomputable section @@ -460,7 +460,7 @@ end end -@[expose] public section +public section noncomputable section @@ -564,7 +564,7 @@ section /-! A finite-order Sobolev composition constant obtained from the actual parent deformation. No inverse-flow derivative budget is assumed. -/ -@[expose] public section +public section noncomputable section @@ -629,7 +629,7 @@ end end -@[expose] public section +public section noncomputable section @@ -714,7 +714,7 @@ section restriction and its actual inverse-flow pullback are continuous spatial L² paths, with no independent integrability assumption on the perturbation. -/ -@[expose] public section +public section noncomputable section @@ -805,7 +805,7 @@ section every time. Its tensor paths also give a bounded smooth coefficient path, with continuity in the uniform norm at every spatial order. -/ -@[expose] public section +public section noncomputable section @@ -870,7 +870,7 @@ end end -@[expose] public section +public section noncomputable section @@ -988,7 +988,7 @@ section correction data have the checked parity. Passing from L² symmetry to the canonical point field supplies symmetry of the real flow coefficient. -/ -@[expose] public section +public section noncomputable section @@ -1040,7 +1040,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1106,7 +1106,7 @@ section inverse and the proved parent label bound supply all reconstruction regularity, and the physical spatial scale is retained exactly. -/ -@[expose] public section +public section noncomputable section @@ -1201,7 +1201,7 @@ section all-order spatial Sobolev class. Its fields are the parent fields plus the very same exact packet used in the particle-map construction. -/ -@[expose] public section +public section noncomputable section @@ -1261,7 +1261,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1309,7 +1309,7 @@ variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) /-- Packet child, bundling `evolution`, `regularity`, `labels`, `odd`. -/ -def packetChild (labels : LabelData (A.child G k m hgraph nextEll hnext hnext1)) : +@[expose] def packetChild (labels : LabelData (A.child G k m hgraph nextEll hnext hnext1)) : SmoothState (A.child G k m hgraph nextEll hnext hnext1) where evolution := S.evolution.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1 diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentStateGeometry.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentStateGeometry.lean index e1a54ac8f3..489550668c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentStateGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentStateGeometry.lean @@ -25,7 +25,7 @@ section velocity update. Odd particle displacements fix the origin, and the two literal velocity laws identify the source matrices there. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ end end -@[expose] public section +public section noncomputable section @@ -230,7 +230,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentUniformForwardChild.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentUniformForwardChild.lean index bdb5c19c05..9df3897e8a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentUniformForwardChild.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentUniformForwardChild.lean @@ -19,7 +19,7 @@ import LeanPool.NavierStokesAndEuler.Euler.PacketForwardUniformChild /-! The uniform direct-forward source comparison constructs the actual next parent and its k^80 labels, with the same global physical errors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PeriodicDerivativeMean.lean b/LeanPool/NavierStokesAndEuler/Euler/PeriodicDerivativeMean.lean index 658ac85776..dea2ed5d62 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PeriodicDerivativeMean.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PeriodicDerivativeMean.lean @@ -12,7 +12,7 @@ public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic /-! The mean of a genuine derivative of a periodic field is zero. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildParent.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildParent.lean index 8dbb0b5195..815df5b895 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildParent.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildParent.lean @@ -33,7 +33,7 @@ section as smooth bounded coefficient paths. Every spatial jet is continuous in the sup norm; no third time derivative is used for the acceleration. -/ -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ end end -@[expose] public section +public section noncomputable section @@ -309,7 +309,7 @@ section /-! The literal child map X(t,Y(t,a)), its actual velocity, and its actual acceleration, as continuous smooth coefficient paths. -/ -@[expose] public section +public section noncomputable section @@ -426,7 +426,7 @@ section /-! Exact Jacobian composition for the child displacement. -/ -@[expose] public section +public section noncomputable section @@ -471,7 +471,7 @@ end end -@[expose] public section +public section noncomputable section @@ -545,7 +545,7 @@ section /-! The L² child fields used in the estimates are exactly the actual first and second time derivatives of the composed particle map. -/ -@[expose] public section +public section noncomputable section @@ -655,7 +655,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildSourceBound.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildSourceBound.lean index 8a574915fa..4bc386d006 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildSourceBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalChildSourceBound.lean @@ -33,7 +33,7 @@ section graph flow. The input fields are the concrete displacement, velocity and acceleration constructed from the periodic corrected packet. -/ -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ section manuscript's C*=10(s+2). This includes the sum of the three actual physical-label Hs word norms, not just a separate bound for each field. -/ -@[expose] public section +public section noncomputable section @@ -226,7 +226,7 @@ end end -@[expose] public section +public section noncomputable section @@ -325,7 +325,7 @@ section source constants affect only the frequency threshold. The power losses can be made arbitrarily small, independently of any truncation order. -/ -@[expose] public section +public section noncomputable section @@ -502,7 +502,7 @@ section The small lifted displacement controls positive derivatives of the physical coordinate change without a physical-frequency Grönwall bound. -/ -@[expose] public section +public section noncomputable section @@ -571,7 +571,7 @@ end end -@[expose] public section +public section noncomputable section @@ -711,7 +711,7 @@ section inverse-frequency normalization with an explicit, frequency-independent cost. This also applies to the actual inverse-frame time derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean index eaaa847142..ed9399967e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean @@ -60,7 +60,7 @@ section three-dimensional flow, with inverse and the projected differential equation. Graph invariance follows from a conserved linear functional. -/ -@[expose] public section +public section noncomputable section @@ -161,7 +161,7 @@ section as its three-dimensional graph restriction. This identifies the volume-preservation hypothesis for the actual physical-label flow. -/ -@[expose] public section +public section noncomputable section @@ -213,7 +213,7 @@ end end -@[expose] public section +public section noncomputable section @@ -325,7 +325,7 @@ section actual flow. Displacement, material velocity and material acceleration are the literal dilations of the corresponding original fields. -/ -@[expose] public section +public section noncomputable section @@ -436,7 +436,7 @@ end end -@[expose] public section +public section noncomputable section @@ -579,7 +579,7 @@ section /-! Periodicity of the prescribed velocity gives exact translation equivariance of the constructed global flow, by ODE uniqueness. -/ -@[expose] public section +public section noncomputable section @@ -602,7 +602,7 @@ end end -@[expose] public section +public section noncomputable section @@ -691,7 +691,7 @@ end end -@[expose] public section +public section noncomputable section @@ -782,7 +782,7 @@ section /-! Actual L² composition of any smooth periodic field with the constructed cylinder flow. The outer amplitude is retained. -/ -@[expose] public section +public section noncomputable section @@ -876,7 +876,7 @@ section small source amplitudes retained. The product term uses one bounded derivative coefficient and one L² velocity factor. -/ -@[expose] public section +public section noncomputable section @@ -1038,7 +1038,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1125,7 +1125,7 @@ section equation. The real covering displacement is periodic, so its descent is a vector-valued field, including its angular displacement component. -/ -@[expose] public section +public section noncomputable section @@ -1285,7 +1285,7 @@ may be a periodic cylinder. The output is the actual time integral of the finite Taylor composition; identifying it with the displacement jet uses the already constructed flow's differentiated integral equation. -/ -@[expose] public section +public section noncomputable section @@ -1338,7 +1338,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1467,7 +1467,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1541,11 +1541,11 @@ namespace Data variable {P T : ℝ} [Fact (0 < P)] (G : Data P T) /-- Velocity radius, given by `flowRadius G.B G.R T G.S`. -/ -def velocityRadius : ℝ := flowRadius G.B G.R T G.S +@[expose] def velocityRadius : ℝ := flowRadius G.B G.R T G.S /-- Acceleration radius, given by `flowRadius G.B G.R T (4*G.R+G.S+G.S₁)`. -/ -def accelerationRadius : ℝ := flowRadius G.B G.R T (4*G.R+G.S+G.S₁) +@[expose] def accelerationRadius : ℝ := flowRadius G.B G.R T (4*G.R+G.S+G.S₁) /-- Acceleration amplitude, given by `G.C₁+3*G.B*G.R*G.C`. -/ -def accelerationAmplitude : ℝ := G.C₁+3*G.B*G.R*G.C +@[expose] def accelerationAmplitude : ℝ := G.C₁+3*G.B*G.R*G.C theorem velocityRadius_nonneg : 0 ≤ G.velocityRadius := by have := G.B_nonneg diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean index b6392c16de..95b2303639 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean @@ -18,7 +18,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm oscillating graph, a linear projection and the physical label dilation. The resulting bounds apply to the literal derivatives of those fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean index ec4a7ae25f..02498c1c3b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean @@ -19,7 +19,7 @@ import Mathlib.MeasureTheory.Measure.Haar.NormedSpace /-! The physical dilation f(x) ↦ ell*f(x/ell), including actual spatial derivatives and their genuine Banach-valued L² norms. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ theorem lpNorm_inv_dilation (f : Space → V) (hf : MemLp f 2 volume) variable [NormedSpace ℝ V] /-- Scale, defined pointwise by `ell • f (ell⁻¹ • x)`. -/ -def scale (ell : ℝ) (f : Space → V) : Space → V := fun x => ell • f (ell⁻¹ • x) +@[expose] def scale (ell : ℝ) (f : Space → V) : Space → V := fun x => ell • f (ell⁻¹ • x) theorem scale_contDiff (ell : ℝ) (f : Space → V) (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (scale ell f) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean b/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean index f5d7022597..cf63d65679 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.NatFactorial /-! A fixed polynomial has one uniform power bound on the whole range x ≥ 1. This extracts an actual degree and constant for scalar cost formulas. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/PressureCommutatorWeights.lean b/LeanPool/NavierStokesAndEuler/Euler/PressureCommutatorWeights.lean index 018d36d989..5803a79305 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PressureCommutatorWeights.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PressureCommutatorWeights.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.WeightedConvolution /-! Actual external pressure commutators controlled by the shifted pressure sum below the velocity cutoff. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ open Finset EulerPacketWeights EulerWeightedConvolution EulerGevrey EulerJetProductBounds /-- Remove the coefficient's zeroth order, which is absent from every commutator. -/ -def positivePart (A : ℕ → ℝ) (n : ℕ) : ℝ := if n = 0 then 0 else A n +@[expose] def positivePart (A : ℕ → ℝ) (n : ℕ) : ℝ := if n = 0 then 0 else A n /-- Delay a pressure sequence by one order so the external radius-loss convolution has the source's exact index. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/QuadraticCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/QuadraticCoefficients.lean index 77b5a27990..b0d77b6a17 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/QuadraticCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/QuadraticCoefficients.lean @@ -17,7 +17,7 @@ section /-! Quantitative bounds for the actual projected linear-plus-quadratic source of the correction equation. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,8 @@ variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedAddCommGroup Y] [NormedSpace ℝ Y] /-- A pressure-projected source with actual forcing, linear terms, and quadratic terms. -/ -def source (P : Y →L[ℝ] Y) (r : Y) (A : X →L[ℝ] Y) (B : X →L[ℝ] X →L[ℝ] Y) (u : X) : Y := +@[expose] def source (P : Y →L[ℝ] Y) (r : Y) (A : X →L[ℝ] Y) + (B : X →L[ℝ] X →L[ℝ] Y) (u : X) : Y := -(P (r + A u + B u u)) /-- The actual quadratic source is jointly continuous in every coefficient and its unknown. -/ @@ -118,7 +119,7 @@ end end -@[expose] public section +public section noncomputable section @@ -143,7 +144,7 @@ structure Coefficients (T : Type*) [TopologicalSpace T] (X Y : Type*) quadratic : C(T, X →L[ℝ] X →L[ℝ] Y) /-- Evaluate the genuine projected source. -/ -def Coefficients.apply (C : Coefficients T X Y) (t : T) (u : X) : Y := +@[expose] def Coefficients.apply (C : Coefficients T X Y) (t : T) (u : X) : Y := source (C.projection t) (C.forcing t) (C.linear t) (C.quadratic t) u /-- The source is jointly continuous in time and the Sobolev unknown. -/ @@ -153,6 +154,7 @@ theorem Coefficients.continuous (C : Coefficients T X Y) : C.quadratic.continuous /-- Restrict coefficient data along any continuous parameter map. -/ +@[expose] def Coefficients.comp {U : Type*} [TopologicalSpace U] (C : Coefficients T X Y) (f : C(U, T)) : Coefficients U X Y where projection := C.projection.comp f diff --git a/LeanPool/NavierStokesAndEuler/Euler/QuadraticHeatLocal.lean b/LeanPool/NavierStokesAndEuler/Euler/QuadraticHeatLocal.lean index b240266ac8..99ba3ffbcb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/QuadraticHeatLocal.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/QuadraticHeatLocal.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.VolterraUniqueness /-! Positive-time existence for the actual projected quadratic cylinder correction equation. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ synthesis. -/ local instance sobolevRealSpace (q : ℕ) : NormedSpace ℝ (SobolevSpace period q) := inferInstance /-- The genuine heat Duhamel expression for continuous projected quadratic coefficients. -/ -def quadraticDuhamel {q : ℕ} (ν : ℝ) (hν : 0 < ν) {S T : ℝ} (hT : 0 ≤ T) (hTS : T ≤ S) +@[expose] def quadraticDuhamel {q : ℕ} (ν : ℝ) (hν : 0 < ν) {S T : ℝ} (hT : 0 ≤ T) (hTS : T ≤ S) (C : Coefficients (Icc (0 : ℝ) S) (SobolevSpace period (q + 1)) (SobolevSpace period q)) (u₀ : SobolevSpace period (q + 1)) (u : C(Icc (0 : ℝ) T, SobolevSpace period (q + 1))) (t : Icc (0 : ℝ) T) : SobolevSpace period (q+1) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/QuadraticMildPasting.lean b/LeanPool/NavierStokesAndEuler/Euler/QuadraticMildPasting.lean index 0d993f4564..7ee2fc8448 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/QuadraticMildPasting.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/QuadraticMildPasting.lean @@ -26,7 +26,7 @@ section /-! A uniform positive restart time for bounded data in the actual viscous Sobolev equation. -/ -@[expose] public section +public section noncomputable section @@ -97,7 +97,7 @@ end end -@[expose] public section +public section noncomputable section @@ -179,7 +179,7 @@ section /-! Pasting actual high-order viscous mild solutions preserves the derivative-gaining Duhamel formula. -/ -@[expose] public section +public section noncomputable section @@ -244,7 +244,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/QuadraticSourceLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/QuadraticSourceLimit.lean index 1a6ae5367a..97ffe6857c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/QuadraticSourceLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/QuadraticSourceLimit.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.VolterraFixedPoint /-! The actual pressure-projected quadratic source passes to uniform Sobolev path limits. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/RadialPotentialL2.lean b/LeanPool/NavierStokesAndEuler/Euler/RadialPotentialL2.lean index 380709ea5d..98b81ea04d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/RadialPotentialL2.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/RadialPotentialL2.lean @@ -24,7 +24,7 @@ Cauchy--Schwarz and exactly cancels the Jacobian of dilation. Only continuity and finite energy are needed; no derivative integrability is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedEnergyFamily.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedEnergyFamily.lean index af1608dd38..7e34b091e4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/RegularizedEnergyFamily.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/RegularizedEnergyFamily.lean @@ -25,7 +25,7 @@ section /-! The actual lifted gradient and divergence constraints persist under every available strong derivative word. -/ -@[expose] public section +public section noncomputable section @@ -103,7 +103,7 @@ section /-! Every energy-order word of the actual heat-regularized mild solution obeys its genuine L² differential equation. -/ -@[expose] public section +public section noncomputable section @@ -216,7 +216,7 @@ section /-! Exact bounded observations of genuine higher-order Bochner representatives. -/ -@[expose] public section +public section noncomputable section @@ -255,7 +255,7 @@ end end -@[expose] public section +public section noncomputable section @@ -367,7 +367,7 @@ section /-! Continuous time-path application and its exact Bochner compatibility. -/ -@[expose] public section +public section noncomputable section @@ -407,7 +407,7 @@ end end -@[expose] public section +public section noncomputable section @@ -525,7 +525,7 @@ section /-! The actual energy-order regularized words converge uniformly in time and preserve pressure closedness. -/ -@[expose] public section +public section noncomputable section @@ -611,7 +611,7 @@ section /-! Actual finite families of continuous and Bochner time fields, with exact norm-topology compatibility. -/ -@[expose] public section +public section noncomputable section @@ -688,7 +688,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedMetricPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedMetricPaths.lean index 0a8a7f151e..20872baebe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/RegularizedMetricPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/RegularizedMetricPaths.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.WeightedCylinderEnergy /-! Literal metric, loss, and forcing paths for the actual full-order word regularization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedMildEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedMildEquation.lean index 20d46ddf6e..fca6d2a61f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/RegularizedMildEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/RegularizedMildEquation.lean @@ -15,7 +15,7 @@ section /-! Exact heat commutation with the genuine Sobolev derivatives and Laplacian. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/RegularizedTopBlocks.lean b/LeanPool/NavierStokesAndEuler/Euler/RegularizedTopBlocks.lean index 08351f6c07..5685c7bfad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/RegularizedTopBlocks.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/RegularizedTopBlocks.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.RegularizedMildEquation /-! Exact compatibility of the actual heat regularizations with highest derivative blocks. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean b/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean index a277b2987e..c28f7f026b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean @@ -37,7 +37,7 @@ section /-! The ordinary curl identity for the Euler convection term on ℝ³. -/ -@[expose] public section +public section noncomputable section @@ -173,7 +173,7 @@ its derivatives. The transport theorem below uses an ordinary differential equation for vorticity, not a prescribed support condition. -/ -@[expose] public section +public section noncomputable section @@ -289,7 +289,7 @@ end end -@[expose] public section +public section noncomputable section @@ -459,7 +459,7 @@ section forms a smooth bounded coefficient family with uniformly bounded energy. No integrability of spatial derivatives of the original solution is needed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SeparatingTimeDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/SeparatingTimeDerivative.lean index 5603a7dd40..b87f0862f5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SeparatingTimeDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SeparatingTimeDerivative.lean @@ -14,7 +14,7 @@ that derivative is continuous and is verified through a separating family of bounded linear observations. The proof reconstructs the actual Bochner primitive and does not infer strong convergence from pointwise convergence. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ShortTimeLinearGrowth.lean b/LeanPool/NavierStokesAndEuler/Euler/ShortTimeLinearGrowth.lean index bba99a04fe..afd3f994d5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ShortTimeLinearGrowth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ShortTimeLinearGrowth.lean @@ -15,7 +15,7 @@ import Mathlib.Algebra.Order.Star.Real The proof uses the supremum norm and the mean value inequality, so the constant is two under the stated smallness condition. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothBanachFlow.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothBanachFlow.lean index d29bcde5f2..b119ba21fc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothBanachFlow.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothBanachFlow.lean @@ -30,7 +30,7 @@ bounded continuous velocity on the prescribed finite time interval. Endpoint extension only defines the auxiliary velocity outside that interval; all stated ODE identities use the original velocity. -/ -@[expose] public section +public section noncomputable section @@ -92,7 +92,7 @@ end end -@[expose] public section +public section noncomputable section @@ -119,11 +119,11 @@ theorem velocity_lipschitz (t : Icc (0 : ℝ) T) : /-- Flow data, given by `ofTimeInterval T hT A.field ‖A.derivative.field‖₊ (velocity_lipschitz T A)`. -/ -def flowData : EulerBoundedLipschitzFlow.Data E := +@[expose] def flowData : EulerBoundedLipschitzFlow.Data E := ofTimeInterval T hT A.field ‖A.derivative.field‖₊ (velocity_lipschitz T A) /-- Path family as an element of `C(E, C(Icc (0 : ℝ) T, E))`. -/ -def pathFamily : C(E, C(Icc (0 : ℝ) T, E)) := +@[expose] def pathFamily : C(E, C(Icc (0 : ℝ) T, E)) := (⟨fun p : E × Icc (0 : ℝ) T => (flowData T hT A).forward p.2 p.1, (flowData T hT A).forward_joint_continuous.comp ((continuous_subtype_val.comp continuous_snd).prodMk continuous_fst)⟩ : diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPath.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPath.lean index 25db6f0a50..41945edbfa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPath.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.MeanCoefficientPath /-! All-order spatial translation regularity uniformly over a compact parameter interval. -/ -@[expose] public section +public section noncomputable section @@ -40,12 +40,12 @@ local instance instSmoothCoefficientPath3 : NormedAddCommGroup (Space →ᵇ W) local instance instSmoothCoefficientPath4 : NormedSpace ℝ (Space →ᵇ W) := inferInstance /-- Map coefficient path, given by `(L.compLeftContinuousBounded Space).compLeftContinuous ℝ K`. -/ -def mapCoefficientPath (L : V →L[ℝ] W) : C(K, Space →ᵇ V) →L[ℝ] C(K, Space →ᵇ W) := +@[expose] def mapCoefficientPath (L : V →L[ℝ] W) : C(K, Space →ᵇ V) →L[ℝ] C(K, Space →ᵇ W) := (L.compLeftContinuousBounded Space).compLeftContinuous ℝ K omit [CompactSpace K] in @[simp] theorem mapCoefficientPath_apply (L : V →L[ℝ] W) - (A : C(K, Space →ᵇ V)) (t : K) (x : Space) : mapCoefficientPath L A t x = L (A t x) := rfl + (A : C(K, Space →ᵇ V)) (t : K) (x : Space) : mapCoefficientPath L A t x = L (A t x) := by rfl end Mapping @@ -89,7 +89,7 @@ local instance instSmoothCoefficientPath10 (n : ℕ) : NormedSpace ℝ (Space /-- Derivative field, given by `mapCoefficientPath (continuousMultilinearCurryFin1 ℝ Space V).toContinuousLinearEquiv.toContinuousLinearMap (A.jet 1)`. -/ -def derivativeField (A : SmoothCoefficientPath K V) : C(K, Space →ᵇ (Space →L[ℝ] V)) := +@[expose] def derivativeField (A : SmoothCoefficientPath K V) : C(K, Space →ᵇ (Space →L[ℝ] V)) := mapCoefficientPath (continuousMultilinearCurryFin1 ℝ Space V).toContinuousLinearEquiv.toContinuousLinearMap (A.jet 1) @@ -120,7 +120,8 @@ theorem derivativeJet_eq (A : SmoothCoefficientPath K V) (n : ℕ) (t : K) (x : /-- Derivative, bundling `field`, `smooth`, `fderiv`, `exact` and the required compatibility proofs. -/ -def derivative (A : SmoothCoefficientPath K V) : SmoothCoefficientPath K (Space →L[ℝ] V) where +@[expose] def derivative (A : SmoothCoefficientPath K V) : + SmoothCoefficientPath K (Space →L[ℝ] V) where field := A.derivativeField smooth t := by have he : (A.derivativeField t : Space → Space →L[ℝ] V) = @@ -134,6 +135,10 @@ def derivative (A : SmoothCoefficientPath K V) : SmoothCoefficientPath K (Space rw [he] exact A.derivativeJet_eq n t x +@[simp] theorem derivative_apply (A : SmoothCoefficientPath K V) (t : K) (x : Space) : + A.derivative.field t x = fderiv ℝ (A.field t : Space → V) x := + A.derivativeField_eq t x + theorem translation_hasFDerivAt (A : SmoothCoefficientPath K V) (a : Space) : HasFDerivAt (translateCoefficientPath A.field) (pathDerivativeMap (translateCoefficientPath A.derivative.field a)) a := by @@ -145,8 +150,9 @@ theorem translation_hasFDerivAt (A : SmoothCoefficientPath K V) (a : Space) : theorem translation_fderiv (A : SmoothCoefficientPath K V) : fderiv ℝ (translateCoefficientPath A.field) = - fun a => pathDerivativeBundling (translateCoefficientPath A.derivative.field a) := - funext (fun a => (A.translation_hasFDerivAt a).fderiv) + fun a => pathDerivativeBundling (translateCoefficientPath A.derivative.field a) := by + funext a + simpa only [pathDerivativeBundling_apply] using (A.translation_hasFDerivAt a).fderiv private theorem translation_contDiff_nat_aux (n : ℕ) : ∀ (V : Type v) [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothCoefficientPath K V), diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPathMap.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPathMap.lean index 43bf478e0b..11a2f8abc5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPathMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientPathMap.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Bounds /-! Bounded linear images of genuine uniformly smooth coefficient paths. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ variable {K V W : Type*} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Apply a fixed bounded linear map to the actual field and all its literal derivative jets. -/ -def map (L : V →L[ℝ] W) (A : SmoothCoefficientPath K V) : SmoothCoefficientPath K W where +@[expose] def map (L : V →L[ℝ] W) (A : SmoothCoefficientPath K V) : SmoothCoefficientPath K W where field := mapCoefficientPath L A.field smooth t := L.contDiff.comp (A.smooth t) jet n := mapCoefficientPath (ContinuousLinearMap.compContinuousMultilinearMapL ℝ @@ -39,7 +39,7 @@ def map (L : V →L[ℝ] W) (A : SmoothCoefficientPath K V) : SmoothCoefficientP exact (L.iteratedFDeriv_comp_left ((A.smooth t).contDiffAt (x := x)) (i := n) (by simp)).symm @[simp] theorem map_apply (L : V →L[ℝ] W) (A : SmoothCoefficientPath K V) (t : K) (x : Space) : - (map L A).field t x = L (A.field t x) := rfl + (map L A).field t x = L (A.field t x) := by rfl /-- Contraction of coefficient values preserves every actual spatial derivative bound. -/ theorem map_derivative_bound (L : V →L[ℝ] W) (hL : ‖L‖ ≤ 1) (A : SmoothCoefficientPath K V) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientTimeRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientTimeRestriction.lean index e2c6c6685e..cab83d3a92 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientTimeRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothCoefficientTimeRestriction.lean @@ -21,7 +21,7 @@ when a source field is restricted to a history interval or shifted to a forward interval. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ def comp (A : SmoothCoefficientPath K V) (φ : C(L, K)) : SmoothCoefficientPath jet_eq n t x := A.jet_eq n (φ t) x @[simp] theorem comp_apply (A : SmoothCoefficientPath K V) (φ : C(L, K)) (t : L) (x : Space) : - (A.comp φ).field t x = A.field (φ t) x := rfl + (A.comp φ).field t x = A.field (φ t) x := by rfl theorem comp_norm_le (A : SmoothCoefficientPath K V) (φ : C(L, K)) : ‖(A.comp φ).field‖ ≤ ‖A.field‖ := by @@ -76,7 +76,7 @@ theorem comp_jet_norm_le (A : SmoothCoefficientPath K V) (φ : C(L, K)) (n : ℕ theorem comp_translation (A : SmoothCoefficientPath K V) (φ : C(L, K)) (a : Space) : translateCoefficientPath (A.comp φ).field a = - (translateCoefficientPath A.field a).comp φ := rfl + (translateCoefficientPath A.field a).comp φ := by rfl /-- A continuous change of time parameter preserves each literal spatial derivative bound with exactly the same constant. -/ @@ -107,13 +107,13 @@ variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Initial inclusion, given by `⟨fun t => ⟨t,t.property.1,t.property.2.trans hτS⟩, continuous_subtype_val.subtype_mk _⟩`. -/ -def initialInclusion (S τ : ℝ) (hτS : τ ≤ S) : C(Icc (0 : ℝ) τ,Icc (0 : ℝ) S) := +@[expose] def initialInclusion (S τ : ℝ) (hτS : τ ≤ S) : C(Icc (0 : ℝ) τ,Icc (0 : ℝ) S) := ⟨fun t => ⟨t,t.property.1,t.property.2.trans hτS⟩, continuous_subtype_val.subtype_mk _⟩ /-- Tail inclusion, given by `⟨fun t => ⟨τ+t,add_nonneg hτ t.property.1,by linarith [t.property.2]⟩, (continuous_const.add continuous_subtype_val).subtype_mk _⟩`. -/ -def tailInclusion (S τ : ℝ) (hτ : 0 ≤ τ) : C(Icc (0 : ℝ) (S-τ),Icc (0 : ℝ) S) := +@[expose] def tailInclusion (S τ : ℝ) (hτ : 0 ≤ τ) : C(Icc (0 : ℝ) (S-τ),Icc (0 : ℝ) S) := ⟨fun t => ⟨τ+t,add_nonneg hτ t.property.1,by linarith [t.property.2]⟩, (continuous_const.add continuous_subtype_val).subtype_mk _⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothEulerEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothEulerEvolution.lean index 0bb2a0451e..0f11f12217 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothEulerEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothEulerEvolution.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod Sobolev norm once the actual velocity and pressure-gradient L² jets are continuous. The advection field and its regularity are constructed here. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFieldSobolevTime.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFieldSobolevTime.lean index 57dad038e8..25d4fffd79 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFieldSobolevTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFieldSobolevTime.lean @@ -19,7 +19,7 @@ Sobolev evolution when all spatial L² jets of the field and its prescribed time derivative are continuous. The ordinary field is represented by its isometric, angle-independent lift to the unit cylinder. -/ -@[expose] public section +public section noncomputable section @@ -68,7 +68,8 @@ theorem restrict_sobolev {p q : ℕ} (h : q ≤ p) (A : SmoothL2Field Space) : (ordinarySobolev_value q A.toLp A.translation_contDiff).symm) /-- Observation, given by `(pointEvaluation 1 x).comp (restrictOperator 1 hq)`. -/ -def observation (q : ℕ) (hq : 3 ≤ q) (x : LiftDomain 1) : SobolevSpace 1 q →L[ℝ] Space := +@[expose] def observation (q : ℕ) (hq : 3 ≤ q) (x : LiftDomain 1) : + SobolevSpace 1 q →L[ℝ] Space := (pointEvaluation 1 x).comp (restrictOperator 1 hq) theorem observation_apply (q : ℕ) (hq : 3 ≤ q) (x : LiftDomain 1) (A : SmoothL2Field Space) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowCoefficientPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowCoefficientPaths.lean index f47e708a7b..0064ca2f88 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowCoefficientPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowCoefficientPaths.lean @@ -39,7 +39,7 @@ section /-! Joint time-space differentiability of a genuine smooth family of continuous paths, and the actual mixed derivative of its spatial Jacobian. -/ -@[expose] public section +public section noncomputable section @@ -167,7 +167,7 @@ section material derivative of its velocity, including the one-sided endpoint identities. All coefficient time derivatives are literal hypotheses. -/ -@[expose] public section +public section noncomputable section @@ -255,7 +255,7 @@ end end -@[expose] public section +public section noncomputable section @@ -424,7 +424,7 @@ section /-! Uniform bounds on a genuine time derivative turn a continuous family of paths into a continuous path of bounded fields. -/ -@[expose] public section +public section noncomputable section @@ -488,7 +488,7 @@ end end -@[expose] public section +public section noncomputable section @@ -586,7 +586,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowGevrey.lean index a8504970fc..08a6813a3f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowGevrey.lean @@ -22,7 +22,7 @@ literal integral (or, in the final theorem, differential) equation for the actual spatial derivatives. The nonlinear majorant is derived here from Faà di Bruno; no bound on the flow derivatives is assumed. -/ -@[expose] public section +public section noncomputable section @@ -221,7 +221,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJacobian.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJacobian.lean index 32903b8824..f1ff305b03 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJacobian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJacobian.lean @@ -20,7 +20,7 @@ flow is therefore differentiable and smooth; its derivative is the actual inverse fundamental operator, without an independent inverse assumption. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJets.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJets.lean index 2f334b5990..97ea1880af 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowJets.lean @@ -21,7 +21,7 @@ the tensor paths therefore gives genuine within-time derivatives of all jets, without assuming differentiability of an ODE solution family. -/ -@[expose] public section +public section noncomputable section @@ -101,7 +101,7 @@ theorem displacementJetPath_hasDerivWithinAt (n : ℕ) (x : E) (t : Icc (0 : ℝ /-- The clamped extension is used only to state derivatives on the closed time interval; there it is exactly the constructed flow minus its label. -/ -def displacement (t : ℝ) (x : E) : E := +@[expose] def displacement (t : ℝ) (x : E) : E := extendPath T hT (displacementFamily T hT A x) t theorem displacement_eq (t : Icc (0 : ℝ) T) (x : E) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowParity.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowParity.lean index 11c09ac8b5..9dddb27079 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowParity.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add /-! Odd prescribed velocity gives an odd actual Picard flow and inverse. The symmetry is proved by uniqueness of the genuine ODE solution. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowTimeGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowTimeGevrey.lean index 911877ac5c..32b9211eea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowTimeGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowTimeGevrey.lean @@ -21,7 +21,7 @@ of the constructed flow. The second expression is literally `(A₁ + D A · A) ∘ Φ`; identifying A₁ as the time derivative is a separate qualitative chain rule, not an assumption about its size. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ local instance instSmoothFlowTimeGevrey4 (n : ℕ) : NormedSpace ℝ (E →ᵇ ( inferInstance /-- Flow radius, given by `(4*R+1)*((1+B*T)*S+2)`. -/ -def flowRadius (B R T S : ℝ) : ℝ := (4*R+1)*((1+B*T)*S+2) +@[expose] def flowRadius (B R T S : ℝ) : ℝ := (4*R+1)*((1+B*T)*S+2) omit [FiniteDimensional ℝ E] in theorem field_jet_bound (B R : ℝ) @@ -103,7 +103,7 @@ theorem forward_positive_bound (B R : ℝ) _ = _ := by dsimp [W]; ring /-- Material velocity, given by `A.field t ((flowData T hT A).forward t x)`. -/ -def materialVelocity (t : Icc (0 : ℝ) T) (x : E) : E := +@[expose] def materialVelocity (t : Icc (0 : ℝ) T) (x : E) : E := A.field t ((flowData T hT A).forward t x) theorem materialVelocity_bound (B R : ℝ) @@ -122,7 +122,7 @@ theorem materialVelocity_bound (B R : ℝ) exact forward_positive_bound T hT A B R hB hR hsmall hb j hj t y /-- Acceleration field, given by `A₁.field t x + fderiv ℝ (A.field t : E → E) x (A.field t x)`. -/ -def accelerationField (A₁ : SmoothTimeField (Icc (0 : ℝ) T) E E) +@[expose] def accelerationField (A₁ : SmoothTimeField (Icc (0 : ℝ) T) E E) (t : Icc (0 : ℝ) T) (x : E) : E := A₁.field t x + fderiv ℝ (A.field t : E → E) x (A.field t x) @@ -179,7 +179,7 @@ theorem accelerationField_bound (A₁ : SmoothTimeField (Icc (0 : ℝ) T) E E) /-- Material acceleration, given by `accelerationField T A A₁ t ((flowData T hT A).forward t x)`. -/ -def materialAcceleration (A₁ : SmoothTimeField (Icc (0 : ℝ) T) E E) +@[expose] def materialAcceleration (A₁ : SmoothTimeField (Icc (0 : ℝ) T) E E) (t : Icc (0 : ℝ) T) (x : E) : E := accelerationField T A A₁ t ((flowData T hT A).forward t x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowVolume.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowVolume.lean index b4fdb963ad..7d1382cb87 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowVolume.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothFlowVolume.lean @@ -21,7 +21,7 @@ section /-! Jacobi's formula in every finite dimension, and determinant preservation for the actual linear evolution with trace-free coefficient. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothImplicitLift.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothImplicitLift.lean index 8bcffa5dfc..a82166cd92 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothImplicitLift.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothImplicitLift.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff smooth when the derivative in its value variable is invertible. The local inverse theorem proves regularity; no new solution is postulated. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2CoefficientPath.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2CoefficientPath.lean index 37106427ca..c35a6f83c2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2CoefficientPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2CoefficientPath.lean @@ -23,7 +23,7 @@ section /-! Every actual spatial derivative tensor remains a smooth L² field. -/ -@[expose] public section +public section noncomputable section @@ -145,7 +145,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Gevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Gevrey.lean index f3ed2d544a..266348c5fe 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Gevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Gevrey.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real Sobolev word bounds. The finite Sobolev order contributes only a fixed polynomial amplitude and one fixed enlargement of the radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2GevreyCalculus.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2GevreyCalculus.lean index ec9e40e530..e61628fe51 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2GevreyCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2GevreyCalculus.lean @@ -19,7 +19,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Quantitative calculus for concrete smooth L² fields, with the outer factor in L² and the inner coordinate change preserving volume. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2ScalingContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2ScalingContinuity.lean index abe3031f66..09ab35ac2e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2ScalingContinuity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2ScalingContinuity.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Physical spatial dilation preserves continuity of every actual L² jet. The proof uses its explicit bounded action on differences. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean index e7ef2e3c39..be124f0dbc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm /-! A series of genuine smooth spatial L² fields that is absolutely summable at every finite Sobolev order has one smooth L² sum. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothPathTimeJets.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothPathTimeJets.lean index 6c346cdf55..b81fc2a4e5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothPathTimeJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothPathTimeJets.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add equation at every spatial order. This is proved by the bounded Bochner integral identity, rather than assumed commutation of derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeField.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeField.lean index d390e0b35c..256d4ec8e5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeField.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothCoefficientPath spatial jets continuous in the uniform time-path norm. This extends the ordinary-space coefficient interface to the lifted four-dimensional flow. -/ -@[expose] public section +public section noncomputable section @@ -62,12 +62,12 @@ synthesis. -/ local instance instSmoothTimeField8 (n : ℕ) : NormedSpace ℝ (E →ᵇ (E [×n]→L[ℝ] V)) := inferInstance /-- Map path, given by `(L.compLeftContinuousBounded E).compLeftContinuous ℝ K`. -/ -def mapPath (L : V →L[ℝ] W) : C(K,E →ᵇ V) →L[ℝ] C(K,E →ᵇ W) := +@[expose] def mapPath (L : V →L[ℝ] W) : C(K,E →ᵇ V) →L[ℝ] C(K,E →ᵇ W) := (L.compLeftContinuousBounded E).compLeftContinuous ℝ K /-- Derivative field, given by `mapPath (continuousMultilinearCurryFin1 ℝ E V).toContinuousLinearEquiv.toContinuousLinearMap (A.jet 1)`. -/ -def derivativeField (A : SmoothTimeField K E V) : C(K,E →ᵇ (E →L[ℝ] V)) := +@[expose] def derivativeField (A : SmoothTimeField K E V) : C(K,E →ᵇ (E →L[ℝ] V)) := mapPath (continuousMultilinearCurryFin1 ℝ E V).toContinuousLinearEquiv.toContinuousLinearMap (A.jet 1) @@ -95,7 +95,7 @@ theorem derivativeJet_eq (A : SmoothTimeField K E V) (n : ℕ) (t : K) (x : E) : /-- Derivative, bundling `field`, `smooth`, `have`, `exact` and the required compatibility proofs. -/ -def derivative (A : SmoothTimeField K E V) : SmoothTimeField K E (E →L[ℝ] V) where +@[expose] def derivative (A : SmoothTimeField K E V) : SmoothTimeField K E (E →L[ℝ] V) where field := A.derivativeField smooth t := by have he : (A.derivativeField t : E → E →L[ℝ] V) = fderiv ℝ (A.field t : E → V) := @@ -109,6 +109,10 @@ def derivative (A : SmoothTimeField K E V) : SmoothTimeField K E (E →L[ℝ] V) rw [he] exact A.derivativeJet_eq n t x +@[simp] theorem derivative_apply (A : SmoothTimeField K E V) (t : K) (x : E) : + A.derivative.field t x = fderiv ℝ (A.field t : E → V) x := + A.derivativeField_eq t x + end SmoothTimeField namespace EulerMeanCoefficients.SmoothCoefficientPath @@ -123,6 +127,6 @@ def toSmoothTimeField {K V : Type} [TopologicalSpace K] [CompactSpace K] @[simp] theorem toSmoothTimeField_field {K V : Type} [TopologicalSpace K] [CompactSpace K] [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothCoefficientPath K V) : - A.toSmoothTimeField.field = A.field := rfl + A.toSmoothTimeField.field = A.field := by rfl end EulerMeanCoefficients.SmoothCoefficientPath diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldAlgebra.lean index f6d214e904..9b43953eab 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldAlgebra.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Add /-! Addition of actual smooth bounded fields and their genuine time jets. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ local instance instSmoothTimeFieldAlgebra4 (n : ℕ) : NormedSpace ℝ (E →ᵇ inferInstance /-- Add, bundling `field`, `smooth`, `jet`, `jet_eq`. -/ -def add (A B : SmoothTimeField K E V) : SmoothTimeField K E V where +@[expose] def add (A B : SmoothTimeField K E V) : SmoothTimeField K E V where field := A.field + B.field smooth t := (A.smooth t).add (B.smooth t) jet n := A.jet n + B.jet n diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldBilinear.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldBilinear.lean index 5921673180..3fd9d1d774 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldBilinear.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldBilinear.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Calculus.ContDiff.Operations /-! Constants and bounded bilinear operations on actual smooth bounded coefficient paths, with the spatial product rule at every order. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ omit [CompactSpace K] [NormedSpace ℝ E] in @[simp] theorem mapPath_apply {V W : Type u} [NormedAddCommGroup V] [NormedSpace ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] (L : V →L[ℝ] W) (A : C(K, E →ᵇ V)) (t : K) (x : E) : - mapPath L A t x = L (A t x) := rfl + mapPath L A t x = L (A t x) := by rfl section Constant @@ -55,7 +55,7 @@ def boundConstant (v : V) : SmoothTimeField K E V where | succ n => simp only [iteratedFDeriv_succ_const, Pi.zero_apply] @[simp] theorem constant_apply (v : V) (t : K) (x : E) : - (boundConstant (K := K) (E := E) v).field t x = v := rfl + (boundConstant (K := K) (E := E) v).field t x = v := by rfl end Constant @@ -108,7 +108,7 @@ def bilinearPath (B : V →L[ℝ] W →L[ℝ] Z) @[simp] theorem bilinearPath_apply (B : V →L[ℝ] W →L[ℝ] Z) (A : SmoothTimeField K E V) (C : SmoothTimeField K E W) (t : K) (x : E) : - bilinearPath B A C t x = B (A.field t x) (C.field t x) := rfl + bilinearPath B A C t x = B (A.field t x) (C.field t x) := by rfl /-- Uncurry right path, given by `mapPath (continuousMultilinearCurryRightEquiv' ℝ n E Z).symm.toContinuousLinearEquiv.toContinuousLinearMap J`. -/ @@ -120,7 +120,8 @@ def uncurryRightPath (n : ℕ) (J : C(K, E →ᵇ (E [×n]→L[ℝ] (E →L[ℝ] omit [CompactSpace K] in @[simp] theorem uncurryRightPath_apply (n : ℕ) (J : C(K, E →ᵇ (E [×n]→L[ℝ] (E →L[ℝ] Z)))) (t : K) (x : E) : - uncurryRightPath n J t x = (continuousMultilinearCurryRightEquiv' ℝ n E Z).symm (J t x) := rfl + uncurryRightPath n J t x = + (continuousMultilinearCurryRightEquiv' ℝ n E Z).symm (J t x) := by rfl theorem exists_bilinear_jet (B : V →L[ℝ] W →L[ℝ] Z) (A : SmoothTimeField K E V) (C : SmoothTimeField K E W) (n : ℕ) : @@ -149,7 +150,7 @@ theorem exists_bilinear_jet (B : V →L[ℝ] W →L[ℝ] Z) funext y rw [B.fderiv_of_bilinear ((A.smooth t).differentiable (by simp) y) ((C.smooth t).differentiable (by simp) y)] - simp only [derivative, derivativeField_eq] + simp only [derivative_apply] rw [hd] exact (fun_iteratedFDeriv_add_apply ((((B.precompR E).contDiff.comp (A.smooth t)).clm_apply (C.derivative.smooth @@ -169,6 +170,6 @@ def bilinear (B : V →L[ℝ] W →L[ℝ] Z) @[simp] theorem bilinear_apply (B : V →L[ℝ] W →L[ℝ] Z) (A : SmoothTimeField K E V) (C : SmoothTimeField K E W) (t : K) (x : E) : - (bilinear B A C).field t x = B (A.field t x) (C.field t x) := rfl + (bilinear B A C).field t x = B (A.field t x) (C.field t x) := by rfl end SmoothTimeField diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldChain.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldChain.lean index b378833baa..c084b73511 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldChain.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldChain.lean @@ -19,7 +19,7 @@ import Mathlib.Analysis.Calculus.Deriv.Prod bounded coefficient paths. The closed-interval statements include both one-sided endpoints, obtained from the actual Bochner integral identity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean index f26d647bfa..9d6e719145 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean @@ -22,7 +22,7 @@ section /-! Pullback of a bounded field by identity plus a bounded displacement. Uniform spatial Lipschitz control proves continuity in the genuine sup norm. -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ def pullback (A : E →ᵇ V) (d : E →ᵇ E) : E →ᵇ V := (fun x => A.norm_coe_le_norm (x+d x)) @[simp] theorem pullback_apply (A : E →ᵇ V) (d : E →ᵇ E) (x : E) : - pullback A d x = A (x+d x) := rfl + pullback A d x = A (x+d x) := by rfl theorem pullback_norm (A : E →ᵇ V) (d : E →ᵇ E) : ‖pullback A d‖ ≤ ‖A‖ := @@ -87,7 +87,7 @@ def pathPullback (A : C(K, E →ᵇ V)) (d : C(K, E →ᵇ E)) @[simp] theorem pathPullback_apply (A : C(K, E →ᵇ V)) (d : C(K, E →ᵇ E)) (L : ℝ≥0) (hL : ∀ t, LipschitzWith L (A t)) (t : K) (x : E) : - pathPullback A d L hL t x = A t (x+d t x) := rfl + pathPullback A d L hL t x = A t (x+d t x) := by rfl end EulerBoundedFieldPullback @@ -138,7 +138,7 @@ section /-! A continuous multilinear operation acts on genuine bounded fields in the uniform norm. This includes the finite Faà di Bruno operations. -/ -@[expose] public section +public section noncomputable section @@ -171,7 +171,7 @@ def multilinearValue (L : ContinuousMultilinearMap ℝ V W) @[simp] theorem multilinearValue_apply (L : ContinuousMultilinearMap ℝ V W) (f : ∀ i, α →ᵇ V i) (x : α) : - multilinearValue L f x = L (fun i => f i x) := rfl + multilinearValue L f x = L (fun i => f i x) := by rfl theorem multilinearValue_norm (L : ContinuousMultilinearMap ℝ V W) (f : ∀ i, α →ᵇ V i) : @@ -221,7 +221,7 @@ def multilinearMap (L : ContinuousMultilinearMap ℝ V W) : @[simp] theorem multilinearMap_apply (L : ContinuousMultilinearMap ℝ V W) (f : ∀ i, α →ᵇ V i) (x : α) : - multilinearMap L f x = L (fun i => f i x) := rfl + multilinearMap L f x = L (fun i => f i x) := by rfl theorem multilinearMap_norm (L : ContinuousMultilinearMap ℝ V W) : ‖multilinearMap (α := α) L‖ ≤ ‖L‖ := @@ -234,7 +234,7 @@ end end -@[expose] public section +public section noncomputable section @@ -359,6 +359,6 @@ def compDisplacement (A : SmoothTimeField K E V) (D : SmoothTimeField K E E) : @[simp] theorem compDisplacement_apply (A : SmoothTimeField K E V) (D : SmoothTimeField K E E) (t : K) (x : E) : - (A.compDisplacement D).field t x = A.field t (x+D.field t x) := rfl + (A.compDisplacement D).field t x = A.field t (x+D.field t x) := by rfl end SmoothTimeField diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldJoint.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldJoint.lean index 5bb8c01235..6d378e1428 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldJoint.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldJoint.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.FDeriv.Partial /-! Actual time derivatives and the genuine spatial jets give joint C¹ regularity on the interior of the time interval. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ variable {E V : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] (T : ℝ) (hT : 0 ≤ T) (A A₁ : SmoothTimeField (Icc (0 : ℝ) T) E V) /-- Real field, given by `extendPath T hT A.field t x`. -/ -def realField (t : ℝ) (x : E) : V := extendPath T hT A.field t x +@[expose] def realField (t : ℝ) (x : E) : V := extendPath T hT A.field t x @[simp] theorem realField_apply (t : Icc (0 : ℝ) T) (x : E) : A.realField T hT t x = A.field t x := by @@ -43,12 +43,12 @@ theorem realField_joint_continuous : Continuous (Function.uncurry (A.realField T /-- Time derivative, given by `∀ t : Icc (0 : ℝ) T, ∀ x : E, HasDerivWithinAt (fun s => A.realField T hT s x) (A₁.field t x) (Icc (0 : ℝ) T) t`. -/ -def TimeDerivative : Prop := ∀ t : Icc (0 : ℝ) T, ∀ x : E, +@[expose] def TimeDerivative : Prop := ∀ t : Icc (0 : ℝ) T, ∀ x : E, HasDerivWithinAt (fun s => A.realField T hT s x) (A₁.field t x) (Icc (0 : ℝ) T) t /-- Joint derivative, given by `(ContinuousLinearMap.toSpanSingleton ℝ (A₁.realField T hT t x)).coprod (A.derivative.realField T hT t x)`. -/ -def jointDerivative (t : ℝ) (x : E) : (ℝ × E) →L[ℝ] V := +@[expose] def jointDerivative (t : ℝ) (x : E) : (ℝ × E) →L[ℝ] V := (ContinuousLinearMap.toSpanSingleton ℝ (A₁.realField T hT t x)).coprod (A.derivative.realField T hT t x) @@ -79,8 +79,8 @@ theorem realField_hasFDerivAt (htime : TimeDerivative T hT A A₁) · apply Eventually.of_forall intro p change HasFDerivAt (A.field (projIcc 0 T hT p.1) : E → V) - (A.derivativeField (projIcc 0 T hT p.1) p.2) p.2 - rw [A.derivativeField_eq] + (A.derivative.field (projIcc 0 T hT p.1) p.2) p.2 + rw [A.derivative_apply] have hd := ((A.smooth (projIcc 0 T hT p.1)).differentiable (by simp) p.2).hasFDerivAt exact hd · exact ((ContinuousLinearMap.toSpanSingletonLIE ℝ V).continuous.comp diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldLinear.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldLinear.lean index 338cb89af0..cc92aefff9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldLinear.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldLinear.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Calculus.Deriv.Comp /-! Fixed bounded linear maps preserve the actual spatial and time jets of smooth bounded coefficient paths. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ local instance instSmoothTimeFieldLinear8 (n : ℕ) : NormedSpace ℝ (E →ᵇ inferInstance /-- Map, bundling `field`, `smooth`, `jet`, `jet_eq`. -/ -def map (L : V →L[ℝ] W) (A : SmoothTimeField K E V) : SmoothTimeField K E W where +@[expose] def map (L : V →L[ℝ] W) (A : SmoothTimeField K E V) : SmoothTimeField K E W where field := mapPath L A.field smooth t := L.contDiff.comp (A.smooth t) jet n := mapPath diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldPrecomp.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldPrecomp.lean index fbc138585c..ca614fa756 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldPrecomp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldPrecomp.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.ForMathlib.SmoothnessOrder /-! Genuine linear restriction of smooth coefficient fields, including the exact spatial tensors and preservation of actual time derivatives. -/ -@[expose] public section +public section noncomputable section @@ -60,7 +60,7 @@ local instance instSmoothTimeFieldPrecomp8 (n : ℕ) : NormedSpace ℝ (F →ᵇ /-- Precomp linear, bundling `field`, `smooth`, `jet`, `jet_eq` and the required compatibility proofs. -/ -def precompLinear (A : SmoothTimeField K E V) (L : F →L[ℝ] E) : +@[expose] def precompLinear (A : SmoothTimeField K E V) (L : F →L[ℝ] E) : SmoothTimeField K F V where field := (BoundedContinuousFunction.compContinuousCLM V ℝ ⟨L,L.continuous⟩).compLeftContinuous ℝ K A.field diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldRestriction.lean index 701560b9eb..2b1122cee5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldRestriction.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothCoefficientTimeRestricti /-! Restriction of a genuine smooth time field preserves the spatial jets and the actual one-sided time derivative on a shorter interval. -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,7 @@ local instance instSmoothTimeFieldRestriction4 (n : ℕ) : NormedSpace ℝ (E inferInstance /-- Comp time, bundling `field`, `smooth`, `jet`, `jet_eq`. -/ -def compTime (A : SmoothTimeField K E V) (f : C(J, K)) : SmoothTimeField J E V where +@[expose] def compTime (A : SmoothTimeField K E V) (f : C(J, K)) : SmoothTimeField J E V where field := A.field.comp f smooth t := A.smooth (f t) jet n := (A.jet n).comp f diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldTimeJets.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldTimeJets.lean index 0899abd39e..aba0444323 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldTimeJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldTimeJets.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Calculus.Deriv.Comp /-! A literal time derivative of smooth bounded fields differentiates every actual spatial jet, both pointwise and in the uniform field norm. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ local instance instSmoothTimeFieldTimeJets4 (n : ℕ) : NormedSpace ℝ (E → inferInstance /-- Slice family, given by `A.superposition ((ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)) x)`. -/ -def sliceFamily (x : E) : C(Icc (0 : ℝ) T,V) := +@[expose] def sliceFamily (x : E) : C(Icc (0 : ℝ) T,V) := A.superposition ((ContinuousLinearMap.const ℝ (Icc (0 : ℝ) T)) x) omit [FiniteDimensional ℝ E] [FiniteDimensional ℝ V] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeSuperposition.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeSuperposition.lean index 80cc42df3b..36e99eed0d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeSuperposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeSuperposition.lean @@ -19,7 +19,7 @@ second-derivative remainder proves Fréchet differentiability in the path sup norm, and iteration gives smoothness at every order. -/ -@[expose] public section +public section noncomputable section @@ -83,24 +83,24 @@ private theorem quadratic_taylor_bound simpa only [add_sub_cancel_left, pow_two, mul_assoc] using H /-- Superposition, bundling `toFun`, `continuous_toFun`. -/ -def superposition (A : SmoothTimeField K E V) (u : C(K, E)) : C(K,V) where +@[expose] def superposition (A : SmoothTimeField K E V) (u : C(K, E)) : C(K,V) where toFun t := A.field t (u t) continuous_toFun := by fun_prop @[simp] theorem superposition_apply (A : SmoothTimeField K E V) - (u : C(K, E)) (t : K) : A.superposition u t = A.field t (u t) := rfl + (u : C(K, E)) (t : K) : A.superposition u t = A.field t (u t) := by rfl /-- Superposition derivative, given by `EulerContinuousTimeIntegral.multiplier (A.derivative.superposition u)`. -/ -def superpositionDerivative (A : SmoothTimeField K E V) (u : C(K, E)) : +@[expose] def superpositionDerivative (A : SmoothTimeField K E V) (u : C(K, E)) : C(K,E) →L[ℝ] C(K,V) := EulerContinuousTimeIntegral.multiplier (A.derivative.superposition u) theorem superpositionDerivative_apply (A : SmoothTimeField K E V) (u h : C(K, E)) (t : K) : A.superpositionDerivative u h t = fderiv ℝ (A.field t : E → V) (u t) (h t) := by - change A.derivativeField t (u t) (h t) = _ - rw [A.derivativeField_eq] + change A.derivative.field t (u t) (h t) = _ + rw [A.derivative_apply] theorem superposition_taylor_bound (A : SmoothTimeField K E V) (u v : C(K, E)) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevCauchyInterpolation.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevCauchyInterpolation.lean index 435fad8677..cfec968392 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevCauchyInterpolation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevCauchyInterpolation.lean @@ -22,7 +22,7 @@ section /-! Strong-derivative interpolation on the actual cylinder Sobolev spaces. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ end end -@[expose] public section +public section noncomputable section @@ -123,7 +123,7 @@ def wordPathOperator {s n : ℕ} (h : n ≤ s) (w : Fin n → Fin 4) (T : ℝ) : /-- The derivative path is its literal derivative coordinate at each time. -/ theorem wordPathOperator_apply {s n : ℕ} (h : n ≤ s) (w : Fin n → Fin 4) (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period s)) (t : Icc (0 : ℝ) T) : - wordPathOperator period h w T u t = word period (u t) h w := rfl + wordPathOperator period h w T u t = word period (u t) h w := by rfl /-- The exact strong-derivative interpolation inequality also controls the uniform time-path norm. -/ @@ -149,9 +149,8 @@ theorem wordPath_square_bound {s n : ℕ} (h : n + 2 ≤ s) (w : Fin n → Fin 4 theorem wordPath_sub {s n : ℕ} (h : n ≤ s) (w : Fin n → Fin 4) (T : ℝ) (u v : C(Icc (0 : ℝ) T, SobolevSpace period s)) : wordPathOperator period h w T (u-v) = wordPathOperator period h w T u-wordPathOperator period h - w T v := by - ext t - rfl + w T v := + (wordPathOperator period h w T).map_sub u v /-- The actual difference interpolation estimate depends only on the two given uniform state bounds. -/ @@ -185,7 +184,7 @@ end end -@[expose] public section +public section noncomputable section @@ -273,8 +272,21 @@ theorem cauchy_restrict_of_value {s q : ℕ} (hq : q < s) (T M : ℝ) (hM : 0 := by apply path_cauchy_of_coordinates period q T intro w - exact wordPath_cauchy_of_value period T M hM u hu h0 w.1.val - ((Nat.le_of_lt_succ w.1.isLt).trans_lt hq) w.2 + have hcoordinate (k : ℕ) : + pathCoordinates period q T + ((restrictOperator period hq.le).compLeftContinuous ℝ (Icc (0 : ℝ) T) (u k)) w = + wordPathOperator period ((Nat.le_of_lt_succ w.1.isLt).trans hq.le) w.2 T + (u k) := by + apply ContinuousMap.ext + intro t + change word period (restrictOperator period hq.le (u k t)) + (Nat.le_of_lt_succ w.1.isLt) w.2 = + word period (u k t) ((Nat.le_of_lt_succ w.1.isLt).trans hq.le) w.2 + exact word_restrictOperator period hq.le (Nat.le_of_lt_succ w.1.isLt) + (u k t) w.2 + simpa only [hcoordinate] using + (wordPath_cauchy_of_value period T M hM u hu h0 w.1.val + ((Nat.le_of_lt_succ w.1.isLt).trans_lt hq) w.2) /-- Completeness produces the actual strong lower-order Sobolev limit from those concrete bounds. -/ theorem exists_limit_restrict_of_value {s q : ℕ} (hq : q < s) (T M : ℝ) (hM : 0 ≤ M) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevCoefficientPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevCoefficientPressure.lean index 1b46222d03..8525fcffe4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevCoefficientPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevCoefficientPressure.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.H6Pressure /-! Actual coefficient multiplication and the coercive projected pressure inverse as Sobolev CLMs. -/ -@[expose] public section +public section noncomputable section @@ -120,7 +120,7 @@ def pressureL2Operator (A : SmoothCoefficient period) (κ : ℝ) (m : Vector3) ( theorem pressureL2Operator_apply (A : SmoothCoefficient period) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ x v, c * ‖v‖ ^ 2 ≤ ⟪A.coefficient x v, v⟫_ℝ) (f : LiftL2 period) : - pressureL2Operator period A κ m c hc hpos f = A.pressure κ m c hc hpos f := rfl + pressureL2Operator period A κ m c hc hpos f = A.pressure κ m c hc hpos f := by rfl /-- The genuine coercive projected pressure inverse is a bounded map on every finite Sobolev space. -/ @@ -153,7 +153,7 @@ theorem pressureSobolevOperator_bound {q : ℕ} {A : SmoothCoefficient period} (fun J => J.solvePressure_norm_le K κ m c hc hpos) u /-- Subtracting the actual coefficient-weighted pressure defines the projected Euler forcing. -/ -def projectedSourceOperator {q : ℕ} {A : SmoothCoefficient period} +@[expose] def projectedSourceOperator {q : ℕ} {A : SmoothCoefficient period} (K : CoefficientJet period standardDirection q A) (κ : ℝ) (m : Vector3) (c : ℝ) (hc : 0 < c) (hpos : ∀ x v, c * ‖v‖ ^ 2 ≤ ⟪A.coefficient x v, v⟫_ℝ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevDifferenceEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevDifferenceEnergy.lean index 0d6dd1979f..6c8959b482 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevDifferenceEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevDifferenceEnergy.lean @@ -17,7 +17,7 @@ section /-! Exact identification of the nonlinear Sobolev transport with the operator used in metric energy. -/ -@[expose] public section +public section noncomputable section @@ -48,7 +48,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevDriftNorm.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevDriftNorm.lean index fe4b8c179e..03bae19dae 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevDriftNorm.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevDriftNorm.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.StrongSmoothJet /-! Genuine finite-Sobolev norms of the small four-component transport drift. -/ -@[expose] public section +public section noncomputable section @@ -41,12 +41,12 @@ def driftLevelNorm {s : ℕ} (n : ℕ) (L : Vector3 →L[ℝ] Domain 4) /-- The drift norm at one external order, including all derivatives in the fixed base Sobolev block. -/ -def driftBlockNorm {s : ℕ} (q n : ℕ) (L : Vector3 →L[ℝ] Domain 4) +@[expose] def driftBlockNorm {s : ℕ} (q n : ℕ) (L : Vector3 →L[ℝ] Domain 4) (u : SobolevSpace period s) : ℝ := ∑ r ∈ Finset.range (q+1), driftLevelNorm period (n+r) L u /-- The weighted genuine drift norm, retaining cancellations in the fixed velocity map. -/ -def weightedDriftNorm {s : ℕ} (q N : ℕ) (ρ : ℝ) (L : Vector3 →L[ℝ] Domain 4) +@[expose] def weightedDriftNorm {s : ℕ} (q N : ℕ) (ρ : ℝ) (L : Vector3 →L[ℝ] Domain 4) (u : SobolevSpace period s) : ℝ := ∑ n ∈ Finset.range (N+1), EulerPacketWeights.weight ρ n * driftBlockNorm period q n L u diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevEnergyPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevEnergyPaths.lean index 81bdac29c1..36c4d45cd5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevEnergyPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevEnergyPaths.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TimeLpPairing /-! Genuine continuous energy paths and their weighted strong limits. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ def familyValuePath (q : ℕ) {I : Type*} (T : ℝ) /-- Family-path values are the literal underlying L² values of the Sobolev fields. -/ theorem familyValuePath_apply (q : ℕ) {I : Type*} (T : ℝ) (u : C(Icc (0 : ℝ) T, I → SobolevSpace period q)) (t : Icc (0 : ℝ) T) (i : I) : - familyValuePath period q T u t i = value period (u t i) := rfl + familyValuePath period q T u t i = value period (u t i) := by rfl omit [Fact (0 < period)] in /-- The actual factorial Gevrey weight along a continuous radius path. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyOperators.lean index 5d220292ae..0b4cd16aea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyOperators.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.UnshiftedProducts /-! Actual coefficient and pressure operators on finite weighted Sobolev sums. -/ -@[expose] public section +public section noncomputable section @@ -35,11 +35,11 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The truncated Gevrey sum of genuine fixed-order Sobolev blocks. -/ -def weightedNorm {s : ℕ} (q N : ℕ) (ρ : ℝ) (u : SobolevSpace period s) : ℝ := +@[expose] def weightedNorm {s : ℕ} (q N : ℕ) (ρ : ℝ) (u : SobolevSpace period s) : ℝ := ∑ n ∈ Finset.range (N+1), weight ρ n * blockNorm period (toJet period u) q n /-- Weighted coefficient derivative bounds in the same fixed base norm. -/ -def weightedCoefficient {s : ℕ} {A : SmoothCoefficient period} +@[expose] def weightedCoefficient {s : ℕ} {A : SmoothCoefficient period} (K : EulerSpatialSobolevInverse.CoefficientJet period standardDirection s A) (q N : ℕ) (ρ : ℝ) : ℝ := ∑ n ∈ Finset.range (N+1), weight ρ n * coefficientBlock period K q n diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyProduct.lean index 37c4d8d142..01a6aae413 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevGevreyProduct.lean @@ -18,7 +18,7 @@ import LeanPool.NavierStokesAndEuler.Euler.UnshiftedProducts /-! The actual complete Sobolev product obeys the finite Gevrey H⁶ algebra bound, including nonsmooth inputs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeat.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeat.lean index c4660cae26..45bfed6b34 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeat.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeat.lean @@ -21,7 +21,7 @@ section /-! Genuine one-derivative L² smoothing lifts to the complete cylinder Sobolev scale. -/ -@[expose] public section +public section noncomputable section @@ -142,13 +142,13 @@ theorem gain_bound {q : ℕ} (hC : 0 ≤ C) rintro ⟨⟨n, hn⟩, w⟩ cases n with | zero => - change ‖(gainJet period A C hD hA (toJet period u)).word w‖ ≤ _ + rw [gain, ofJet_apply] rw [SpatialJet.word_zero] exact (A.le_opNorm _).trans ((mul_le_mul_of_nonneg_left (value_norm_le period u) (norm_nonneg A)).trans (mul_le_mul_of_nonneg_right (le_max_left _ _) (norm_nonneg u))) | succ n => - change ‖(gainJet period A C hD hA (toJet period u)).word w‖ ≤ _ + rw [gain, ofJet_apply] rw [gainJet, SpatialJet.word_succ, EulerPressureJetIdentities.SpatialJet.map_word] have h := smoothingDerivativeOperator_bound period A C hD (w (Fin.last n)) ((toJet period u).word (Fin.init w)) @@ -190,7 +190,7 @@ end end -@[expose] public section +public section noncomputable section @@ -203,13 +203,14 @@ open scoped Topology NNReal variable (period : ℝ) [Fact (0 < period)] /-- The genuine cylinder heat semigroup lifted to the complete Sobolev space. -/ -def heatOperator (q : ℕ) (v : ℝ≥0) : SobolevSpace period q →L[ℝ] SobolevSpace period q := +@[expose] def heatOperator (q : ℕ) (v : ℝ≥0) : SobolevSpace period q →L[ℝ] SobolevSpace period q := liftOperator period q (cylinderHeat period v) (cylinderHeat_translation period v) /-- Every Sobolev derivative coordinate evolves by the actual L² heat semigroup. -/ @[simp] theorem heatOperator_apply {q : ℕ} (v : ℝ≥0) (u : SobolevSpace period q) (w : SobolevWord q) : - (heatOperator period q v u).val w = cylinderHeat period v (u.val w) := rfl + (heatOperator period q v u).val w = cylinderHeat period v (u.val w) := by + exact liftOperator_apply period (cylinderHeat period v) (cylinderHeat_translation period v) u w /-- The heat semigroup is contractive in every complete Sobolev norm. -/ theorem heatOperator_bound {q : ℕ} (v : ℝ≥0) (u : SobolevSpace period q) : @@ -217,12 +218,14 @@ theorem heatOperator_bound {q : ℕ} (v : ℝ≥0) (u : SobolevSpace period q) : change ‖(heatOperator period q v u).val‖ ≤ _ apply (pi_norm_le_iff_of_nonneg (norm_nonneg u)).mpr intro w + rw [heatOperator_apply] exact (cylinderHeat_norm_le period v _).trans (word_norm_le period u w) /-- The underlying L² field evolves by exactly the original heat operator. -/ @[simp] theorem heatOperator_value {q : ℕ} (v : ℝ≥0) (u : SobolevSpace period q) : - value period (heatOperator period q v u) = cylinderHeat period v (value period u) := rfl + value period (heatOperator period q v u) = cylinderHeat period v (value period u) := by + exact heatOperator_apply period v u (emptyWord q) /-- Zero variance is the identity on the complete Sobolev space. -/ @[simp] @@ -242,10 +245,11 @@ theorem heatOperator_continuous {q : ℕ} (u : SobolevSpace period q) : apply Continuous.subtype_mk apply continuous_pi intro w - exact cylinderHeat_continuous period (u.val w) + change Continuous (fun v : ℝ≥0 => (heatOperator period q v u).val w) + simpa only [heatOperator_apply] using cylinderHeat_continuous period (u.val w) /-- The explicit parabolic derivative constant of the Gaussian heat operator. -/ -def heatDerivativeConstant (v : ℝ≥0) : ℝ := gaussianAbsMoment 1 / Real.sqrt (v : ℝ) +@[expose] def heatDerivativeConstant (v : ℝ≥0) : ℝ := gaussianAbsMoment 1 / Real.sqrt (v : ℝ) /-- The Gaussian derivative constant is nonnegative. -/ theorem heatDerivativeConstant_nonneg (v : ℝ≥0) : 0 ≤ heatDerivativeConstant v := diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatGenerator.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatGenerator.lean index e6a37ed7e0..e8f455e3db 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatGenerator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatGenerator.lean @@ -31,7 +31,7 @@ section /-! The Gaussian variance generator is one half of the genuine squared translation derivative. -/ -@[expose] public section +public section noncomputable section @@ -204,7 +204,7 @@ section /-! Differentiation of jointly continuous operator families without operator-norm differentiability. -/ -@[expose] public section +public section noncomputable section @@ -271,8 +271,9 @@ def realLineHeatOperator (a : LiftTangent) (t : ℝ) : LiftL2 period →L[ℝ] L lineHeatOperator period a t.toNNReal @[simp] theorem realLineHeatOperator_apply (a : LiftTangent) (t : ℝ) (f : LiftL2 period) : - realLineHeatOperator period a t f = realLineHeat period a t f := - (realLineHeat_eq_toNNReal period a t f).symm + realLineHeatOperator period a t f = realLineHeat period a t f := by + simpa only [realLineHeatOperator, lineHeatOperator_apply] using + (realLineHeat_eq_toNNReal period a t f).symm theorem realLineHeat_joint_continuous (a : LiftTangent) : Continuous (fun p : ℝ × LiftL2 period => realLineHeat period a p.1 p.2) := by @@ -304,7 +305,7 @@ end end -@[expose] public section +public section noncomputable section @@ -458,7 +459,7 @@ section /-! Exact identification of the Gaussian cylinder generator with the actual strong-jet Laplacian. -/ -@[expose] public section +public section noncomputable section @@ -495,8 +496,9 @@ theorem cylinderHeatJet_laplacian {f : LiftL2 period} (J : SpatialJet period sta def realCylinderHeat (t : ℝ) : LiftL2 period →L[ℝ] LiftL2 period := cylinderHeat period t.toNNReal theorem realCylinderHeat_apply (t : ℝ) (f : LiftL2 period) : - realCylinderHeat period t f = realHeatList period cylinderDirections t f := - (realHeatList_eq_toNNReal period cylinderDirections t f).symm + realCylinderHeat period t f = realHeatList period cylinderDirections t f := by + simpa only [realCylinderHeat, cylinderHeat_apply] using + (realHeatList_eq_toNNReal period cylinderDirections t f).symm /-- The actual cylinder heat generator at positive variance is one half of the Laplacian. -/ theorem realCylinderHeat_generator_pos {f : LiftL2 period} (J : SpatialJet period standardDirection @@ -577,7 +579,7 @@ end end -@[expose] public section +public section noncomputable section @@ -630,17 +632,18 @@ theorem laplacianEvaluation_heat {q : ℕ} (hq : 2 ≤ q) (v : ℝ≥0) (u : Sob rw [laplacianEvaluation_apply, laplacianEvaluation_apply, map_sum] apply Finset.sum_congr rfl intro i _ - rfl + simp only [word, heatOperator_apply] /-- Actual viscous heat on the complete Sobolev space, extended constantly to negative physical time. -/ -def heatFlow (q : ℕ) (ν t : ℝ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := +@[expose] def heatFlow (q : ℕ) (ν t : ℝ) : SobolevSpace period q →L[ℝ] SobolevSpace period q := heatOperator period q (2 * ν * t).toNNReal /-- The Sobolev flow has exactly the original genuine L² viscous heat value. -/ @[simp] theorem heatFlow_value {q : ℕ} (ν t : ℝ) (u : SobolevSpace period q) : - value period (heatFlow period q ν t u) = viscousCylinderHeat period ν t (value period u) := rfl + value period (heatFlow period q ν t u) = viscousCylinderHeat period ν t (value period u) := by + exact heatOperator_value period (2 * ν * t).toNNReal u /-- Positive-time heat is differentiable in L² with the actual bounded Laplacian evaluation. -/ theorem heatFlow_value_hasDerivAt {q : ℕ} (hq : 2 ≤ q) (ν : ℝ) (hν : 0 < ν) @@ -650,6 +653,7 @@ theorem heatFlow_value_hasDerivAt {q : ℕ} (hq : 2 ≤ q) (ν : ℝ) (hν : 0 < have h := viscousCylinderHeat_equation period (EulerH6Pressure.SpatialJet.restrict (toJet period u) 2 hq) hν ht rw [cylinderHeatJet_laplacian, ← laplacianEvaluation_eq_jet period hq u] at h + simp only [heatFlow_value] change HasDerivAt (fun s => viscousCylinderHeat period ν s (value period u)) (ν • laplacianEvaluation period q hq (heatOperator period q (2 * ν * t).toNNReal u)) t rw [laplacianEvaluation_heat] @@ -710,6 +714,7 @@ theorem heatFlow_value_norm_sub_le {q : ℕ} (hq : 2 ≤ q) (ν : ℝ) (hν : 0 have h := (realHeat_value_lipschitz period hq u).dist_le_mul (2 * ν * s) (2 * ν * t) simp only [dist_eq_norm, Real.coe_nnabs, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (norm_nonneg u))] at h + rw [heatFlow_value, heatFlow_value] change ‖realCylinderHeat period (2 * ν * s) (value period u) - realCylinderHeat period (2 * ν * t) (value period u)‖ ≤ _ have he : |2 * ν * s - 2 * ν * t| = (2 * ν) * |s - t| := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatKernel.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatKernel.lean index 6b43f382fd..b15108a73f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatKernel.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatKernel.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.SpecialFunctions.Integrals.Basic /-! Jointly continuous positive-time heat kernels with an explicit integrable parabolic bound. -/ -@[expose] public section +public section noncomputable section @@ -106,14 +106,15 @@ theorem heatGain_joint_continuous (q : ℕ) : exact (heatGain_tsub period ε z.1.val hε hz.le z.2).symm /-- The positive real-time heat kernel, with zero chosen at nonpositive time. -/ -def heatKernel (q : ℕ) (ν : ℝ) (hν : 0 < ν) (t : ℝ) : +@[expose] def heatKernel (q : ℕ) (ν : ℝ) (hν : 0 < ν) (t : ℝ) : SobolevSpace period q →L[ℝ] SobolevSpace period (q + 1) := if ht : 0 < t then heatGain period q ⟨2 * ν * t, by positivity⟩ (by change (0 : ℝ) < 2 * ν * t; positivity) else 0 /-- The scalar coefficient multiplying the inverse square root in the heat-kernel bound. -/ -def parabolicConstant (ν : ℝ) : ℝ := gaussianAbsMoment 1 / Real.sqrt (2 * ν) +@[expose] def parabolicConstant (ν : ℝ) : ℝ := + gaussianAbsMoment 1 / Real.sqrt (2 * ν) /-- The explicit integrable majorant for one-derivative heat smoothing. -/ def parabolicKernelBound (ν t : ℝ) : ℝ := 1 + parabolicConstant ν * t ^ (-(1 / 2 : ℝ)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatVolterra.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatVolterra.lean index 62c5072508..6b2fc70015 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatVolterra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevHeatVolterra.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.VolterraFixedPoint /-! The actual cylinder heat kernel in the singular Volterra existence theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevJointEvaluation.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevJointEvaluation.lean index f8a04b1751..3a76d0cb43 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevJointEvaluation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevJointEvaluation.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevPointEvaluation /-! Joint continuity of evaluation of genuine cylinder Sobolev fields. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,8 @@ variable (period : ℝ) [Fact (0 < period)] theorem pointEvaluation_norm_le (x : LiftDomain period) : ‖pointEvaluation period x‖ ≤ sobolevEmbeddingConstant period 3 := (pointEvaluation period x).opNorm_le_bound - (sobolevEmbeddingConstant_nonneg period 3) (fun u => representative_bound period u x) + (sobolevEmbeddingConstant_nonneg period 3) (fun u => by + simpa only [pointEvaluation_apply] using representative_bound period u x) /-- Evaluation is jointly continuous in a genuine H3 field and a cylinder point. -/ theorem pointEvaluation_joint_continuous : @@ -33,7 +34,8 @@ theorem pointEvaluation_joint_continuous : pointEvaluation period p.2 p.1) := by apply continuous_prod_of_continuous_lipschitzWith _ ⟨sobolevEmbeddingConstant period 3, sobolevEmbeddingConstant_nonneg period 3⟩ - · exact fun u => representative_continuous period u + · intro u + simpa only [pointEvaluation_apply] using representative_continuous period u · intro x exact ContinuousLinearMap.lipschitzWith_of_opNorm_le (f := pointEvaluation period x) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevL2Product.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevL2Product.lean index 760feeffde..9d5b88f168 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevL2Product.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevL2Product.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderSobolevOperators /-! Actual pointwise multiplication as a bounded bilinear map Hq × L² → L². -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ theorem scalarProduct_memLp {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ] ℝ) exact (mul_le_mul_of_nonneg_right hL (norm_nonneg (v x))).trans_eq (by ring) /-- The actual almost-everywhere scalar-vector product represented in cylinder L². -/ -def scalarProduct {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ] ℝ) +@[expose] def scalarProduct {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ] ℝ) (u : SobolevSpace period q) (v : LiftL2 period) : LiftL2 period := (scalarProduct_memLp period hq L u v).toLp (fun x => L (value period u x) • v x) @@ -141,7 +141,7 @@ def scalarProductBilinear {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ] ℝ) : @[simp] theorem scalarProductBilinear_apply {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ] ℝ) (u : SobolevSpace period q) (v : LiftL2 period) : - scalarProductBilinear period hq L u v = scalarProduct period hq L u v := rfl + scalarProductBilinear period hq L u v = scalarProduct period hq L u v := by rfl /-- The actual product is equivariant under simultaneous cylinder translation. -/ theorem scalarProduct_translation {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ] ℝ) @@ -155,7 +155,7 @@ theorem scalarProduct_translation {q : ℕ} (hq : 3 ≤ q) (L : Vector3 →L[ℝ period a v), translation_ae period a (value period u), translation_ae period a v, translation_ae period a (scalarProduct period hq L u v), hp] with x h1 h2 h3 h4 h5 - change value period (sobolevTranslation period q a u) x = value period u (x+a) at h2 + rw [value_sobolevTranslation] at h1 rw [h1, h2, h3, h4, h5] end EulerSobolevL2Product diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevLaplacian.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevLaplacian.lean index ca424d8272..ee7c37bb6b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevLaplacian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevLaplacian.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.StrongSmoothJet /-! The genuine commuting coordinate derivatives and bounded Laplacian on the complete Sobolev scale. -/ -@[expose] public section +public section noncomputable section @@ -101,6 +101,9 @@ theorem laplacianOperator_value {q : ℕ} (u : SobolevSpace period (q + 2)) : rw [map_sum] apply Finset.sum_congr rfl intro i _ + change (derivativeOperator period q i (derivativeOperator period (q+1) i u)).val + (emptyWord q) = u.val ⟨⟨2, by omega⟩, fun _ => i⟩ + rw [derivativeOperator_apply, derivativeOperator_apply] change u.val ⟨⟨2, _⟩, Fin.snoc (Fin.snoc Fin.elim0 i) i⟩ = u.val ⟨⟨2, _⟩, fun _ => i⟩ have hw : Fin.snoc (Fin.snoc (Fin.elim0 : Fin 0 → Fin 4) i) i = (fun _ : Fin 2 => i) := by funext j diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevMaximalRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevMaximalRegularity.lean index 0f70e6115d..8282e022d8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevMaximalRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevMaximalRegularity.lean @@ -40,7 +40,7 @@ section /-! Genuine gradient energy and maximal-regularity estimates for smooth Sobolev heat solutions. -/ -@[expose] public section +public section noncomputable section @@ -173,7 +173,7 @@ section /-! Exact L² Hessian coercivity from actual commuting strong derivatives. -/ -@[expose] public section +public section noncomputable section @@ -243,7 +243,7 @@ end end -@[expose] public section +public section noncomputable section @@ -312,7 +312,7 @@ section /-! Integrated genuine heat gradient energy, with the source measured only in L². -/ -@[expose] public section +public section noncomputable section @@ -373,7 +373,7 @@ end end -@[expose] public section +public section noncomputable section @@ -496,7 +496,7 @@ section /-! Strong Cauchy convergence from a quadratic norm estimate in complete-space arguments. -/ -@[expose] public section +public section namespace EulerQuadraticCauchy @@ -550,7 +550,7 @@ section /-! Strong L²-time H² Cauchy convergence from genuine heat energy, avoiding weak compactness. -/ -@[expose] public section +public section noncomputable section @@ -718,7 +718,7 @@ section /-! Actual higher Sobolev norms controlled by lower norms and finitely many top derivative blocks. -/ -@[expose] public section +public section noncomputable section @@ -780,7 +780,7 @@ section /-! Strong time-space completion controlled by genuine finite spatial derivative blocks. -/ -@[expose] public section +public section noncomputable section @@ -844,7 +844,7 @@ section /-! Strong Cauchy convergence controlled by finitely many genuine norm observations. -/ -@[expose] public section +public section namespace EulerQuadraticCauchy @@ -878,7 +878,7 @@ end end -@[expose] public section +public section noncomputable section @@ -938,7 +938,7 @@ section /-! Genuine maximal spatial regularity of the actual viscous mild solution, proved by strong Cauchy limits. -/ -@[expose] public section +public section noncomputable section @@ -1074,7 +1074,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1138,7 +1138,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevMetricTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevMetricTransport.lean index 0489efc937..a351865c79 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevMetricTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevMetricTransport.lean @@ -17,7 +17,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.StrongSmoothJet /-! Genuine metric transport energy on finite Sobolev fields, obtained by smooth convolution limits. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ open scoped Topology ContDiff ENNReal NNReal variable (period : ℝ) [Fact (0 < period)] /-- Actual lifted transport is a bounded map H¹→L² for each fixed Hq velocity, q≥3. -/ -def transportOperator {q : ℕ} (hq : 3 ≤ q) (κ : ℝ) (m : Vector3) +@[expose] def transportOperator {q : ℕ} (hq : 3 ≤ q) (κ : ℝ) (m : Vector3) (z : SobolevSpace period q) : SobolevSpace period 1 →L[ℝ] LiftL2 period := ∑ i : Fin 4, (scalarProductBilinear period hq (velocityComponents κ m i) z).comp ((valueOperator period 0).comp (derivativeOperator period 0 i)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevNonlinearCompatibility.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevNonlinearCompatibility.lean index d6991ef950..8e36126308 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevNonlinearCompatibility.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevNonlinearCompatibility.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CorrectionOperators /-! Exact consistency of actual products, transport, and pressure across the Sobolev scale. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevPathLimits.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevPathLimits.lean index e67b883527..3ad53a019a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevPathLimits.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevPathLimits.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevRestriction /-! Genuine norm, trace, and divergence constraints persist under actual uniform Sobolev limits. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevPointEvaluation.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevPointEvaluation.lean index 66adfa3f23..f5a15f1c9d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevPointEvaluation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevPointEvaluation.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.Foundations.MollifierUniform /-! Actual continuous representatives and point evaluation as bounded linear maps on cylinder H3. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ open scoped Topology variable (period : ℝ) [Fact (0 < period)] /-- The actual continuous representative of a genuine cylinder H3 field. -/ -def representative (u : SobolevSpace period 3) : LiftDomain period → Vector3 := +@[expose] def representative (u : SobolevSpace period 3) : LiftDomain period → Vector3 := Classical.choose (exists_continuous_representative period (value period u) (toJet period u)) /-- The chosen representative is actually continuous. -/ @@ -81,13 +81,16 @@ theorem representative_smul (c : ℝ) (u : SobolevSpace period 3) : simpa only [Pi.smul_apply,hu] using hs /-- Evaluation of the actual continuous representative is a bounded linear map on cylinder H3. -/ -def pointEvaluation (x : LiftDomain period) : SobolevSpace period 3 →L[ℝ] Vector3 := +@[expose] def pointEvaluation (x : LiftDomain period) : SobolevSpace period 3 →L[ℝ] Vector3 := ({ toFun := fun u => representative period u x map_add' := fun u v => congrFun (representative_add period u v) x map_smul' := fun c u => congrFun (representative_smul period c u) x } : SobolevSpace period 3 →ₗ[ℝ] Vector3).mkContinuous (sobolevEmbeddingConstant period 3) (fun u => representative_bound period u x) +@[simp] theorem pointEvaluation_apply (x : LiftDomain period) (u : SobolevSpace period 3) : + pointEvaluation period x u = representative period u x := by rfl + /-- The bounded evaluation operator returns the value of every actual continuous representative. -/ theorem pointEvaluation_eq (x : LiftDomain period) (u : SobolevSpace period 3) (g : LiftDomain period → Vector3) (hg : Continuous g) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevPointMultiplication.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevPointMultiplication.lean index b352a540d9..4157ddf714 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevPointMultiplication.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevPointMultiplication.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevRestriction /-! Pointwise evaluation of actual smooth coefficient multiplication in finite cylinder Sobolev spaces. -/ -@[expose] public section +public section noncomputable section @@ -35,11 +35,13 @@ theorem pointEvaluation_coefficient {q : ℕ} (hq : 3 ≤ q) (G : SmoothCoeffici G.coefficient x (pointEvaluation period x (restrictOperator period hq u)) := by apply pointEvaluation_eq period x _ (fun y => G.coefficient y (pointEvaluation period y (restrictOperator period hq u))) - · exact (smoothField_continuous period G.coefficient G.smooth).clm_apply - (representative_continuous period (restrictOperator period hq u)) + · simpa only [pointEvaluation_apply] using + (smoothField_continuous period G.coefficient G.smooth).clm_apply + (representative_continuous period (restrictOperator period hq u)) · simp only [value_restrictOperator, coefficientSobolevOperator_value] filter_upwards [G.operator_ae (value period u), representative_ae period (restrictOperator period hq u)] with y hG hu - exact hG.trans (congrArg (G.coefficient y) hu) + simp only [value_restrictOperator] at hu + simpa only [pointEvaluation_apply] using hG.trans (congrArg (G.coefficient y) hu) end EulerSobolevPointMultiplication diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevPressureResolvent.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevPressureResolvent.lean index 294a7db1cf..2d5bedc9a6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevPressureResolvent.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevPressureResolvent.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevCoefficientPressure /-! Exact resolvent identities for the actual coercive pressure operators on complete Sobolev spaces. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevProduct.lean index 5127106bba..0a2a3b496b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevProduct.lean @@ -35,7 +35,7 @@ section /-! Translation is strongly differentiable in the actual Sobolev topology with one more derivative. -/ -@[expose] public section +public section noncomputable section @@ -87,7 +87,7 @@ end end -@[expose] public section +public section noncomputable section @@ -115,9 +115,7 @@ theorem scalarProduct_hasDerivAt (L : Vector3 →L[ℝ] ℝ) (i : Fin 4) have hzero : sobolevTranslation period 3 (translationPath period (standardDirection i) 0) (truncateOperator period 3 u) = truncateOperator period 3 u := by apply value_injective period - change translation period (translationPath period (standardDirection i) 0) (value period u) = - value period u - rw [translationPath_zero, translation_zero] + rw [value_sobolevTranslation, translationPath_zero, translation_zero] have he : (fun t => B (sobolevTranslation period 3 (translationPath period (standardDirection i) t) (truncateOperator period 3 u)) (translation period (translationPath period (standardDirection @@ -125,7 +123,8 @@ theorem scalarProduct_hasDerivAt (L : Vector3 →L[ℝ] ℝ) (i : Fin 4) fun t => translation period (translationPath period (standardDirection i) t) (scalarProduct period (le_refl 3) L (truncateOperator period 3 u) v) := by funext t - exact scalarProduct_translation period (le_refl 3) L _ _ _ + simpa only [B, scalarProductBilinear_apply] using + scalarProduct_translation period (le_refl 3) L _ _ _ change HasDerivAt (fun t => B (sobolevTranslation period 3 (translationPath period (standardDirection i) t) (truncateOperator period 3 u)) (translation period (translationPath period (standardDirection @@ -135,7 +134,7 @@ theorem scalarProduct_hasDerivAt (L : Vector3 →L[ℝ] ℝ) (i : Fin 4) B (derivativeOperator period 3 i u) (translation period (translationPath period (standardDirection i) 0) v)) 0 at h rw [he, hzero, translationPath_zero, translation_zero] at h - exact h + simpa only [B, scalarProductBilinear_apply] using h /-- Pointwise multiplication with q+3 coefficient derivatives produces a genuine q-jet. -/ def productJet (L : Vector3 →L[ℝ] ℝ) {q : ℕ} (u : SobolevSpace period (q + 3)) @@ -155,20 +154,17 @@ def productJet (L : Vector3 →L[ℝ] ℝ) {q : ℕ} (u : SobolevSpace period (q omega : 3 ≤ q+3) u0) (dv i) + scalarProduct period (le_refl 3) L (restrictOperator period (by omega : 3 ≤ q+3) (du i)) v have hbase : restrictOperator period (by omega : 3 ≤ q+3) u0 = u3 := by - apply value_injective period - rfl + exact restrictOperator_truncate period (by omega : 3 ≤ q+3) u have hlower (i : Fin 4) : SpatialJet period standardDirection q (d i) := (ih u0 (lower i)).add (ih (du i) (SpatialJet.succ dv lower hd).truncate) refine .succ d hlower ?_ intro i let u4 : SobolevSpace period 4 := restrictOperator period (by omega : 4 ≤ q+1+3) u have h0 : truncateOperator period 3 u4 = u3 := by - apply value_injective period - rfl + exact truncate_restrictOperator period (by omega : 4 ≤ q+1+3) u have h1 : derivativeOperator period 3 i u4 = restrictOperator period (by omega : 3 ≤ q+3) (du i) := by - apply value_injective period - rfl + exact (restrictOperator_derivative period (by omega : 3 ≤ q+3) i u).symm have h := scalarProduct_hasDerivAt period L i u4 v (dv i) (hd i) rw [h0, h1, ← hbase] at h exact h @@ -196,7 +192,7 @@ section /-! Actual real and scalar-vector cylinder multiplication at every fixed Sobolev order q≥6. -/ -@[expose] public section +public section noncomputable section @@ -321,7 +317,7 @@ end end -@[expose] public section +public section noncomputable section @@ -385,7 +381,8 @@ theorem productHighLow_bound_smooth {q : ℕ} (hq : 6 ≤ q) ‖productHighLow period L u v‖ ≤ sobolevProductConstant period q * ‖restrictOperator period (by omega : q ≤ q+3) u‖ * ‖v‖ := by let U : SobolevSpace period q := restrictOperator period (by omega : q ≤ q+3) u - have hU : (value period U : LiftDomain period → Vector3) =ᵐ[liftMeasure period] f := hu + have hU : (value period U : LiftDomain period → Vector3) =ᵐ[liftMeasure period] f := by + simpa only [U, value_restrictOperator] using hu have hfL : ∀ j ≤ q, ∀ w : Fin j → Fin 4, MemLp (iteratedFieldDerivative period w f) 2 (liftMeasure period) := fun j hj w => jet_classical_memLp period hj (value period U) (toJet period U) w f hU hf @@ -454,10 +451,7 @@ theorem productHighLow_sub {q : ℕ} (L : Vector3 →L[ℝ] ℝ) simp only [productHighLow_value, map_sub] rw [show value period (v-z) = value period v - value period z from map_sub (valueOperator period q) v z] - change scalarProductBilinear period (le_refl 3) L _ _ - scalarProductBilinear period (le_refl 3) - L _ _ = - scalarProductBilinear period (le_refl 3) L _ _ + scalarProductBilinear period (le_refl 3) L _ _ - simp only [map_sub, sub_apply] + simp only [← scalarProductBilinear_apply, map_sub, sub_apply] abel end EulerSobolevL2Product @@ -471,7 +465,7 @@ section /-! Cauchy convergence of actual smooth cylinder products in the complete Sobolev space. -/ -@[expose] public section +public section noncomputable section @@ -614,7 +608,7 @@ end end -@[expose] public section +public section noncomputable section @@ -638,12 +632,11 @@ theorem productApprox_value_tendsto {q : ℕ} (hq : 6 ≤ q) (valueOperator period q).continuous.tendsto v |>.comp (sobolevMollifier_tendsto period v) have h := (scalarProductBilinear period (by omega : 3 ≤ q) L).continuous₂.tendsto (u, value period v) |>.comp (hU.prodMk_nhds hV) + rw [← scalarProductBilinear_apply] apply h.congr' apply Filter.Eventually.of_forall intro n - change scalarProduct period (by - omega : 3 ≤ q) L (U n) (value period (sobolevMollifier period q n v)) = - value period (productApprox period q n L u v) + rw [scalarProductBilinear_apply] rw [productApprox, productHighLow_value] exact scalarProduct_of_value_eq period (by omega : 3 ≤ q) (le_refl 3) L _ _ rfl _ @@ -757,6 +750,6 @@ def productHqBilinear {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : @[simp] theorem productHqBilinear_apply {q : ℕ} (hq : 6 ≤ q) (L : Vector3 →L[ℝ] ℝ) (hL : ‖L‖ ≤ 1) (u v : SobolevSpace period q) : - productHqBilinear period hq L hL u v = productHq period hq L hL u v := rfl + productHqBilinear period hq L hL u v = productHq period hq L hL u v := by rfl end EulerSobolevL2Product diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevRestriction.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevRestriction.lean index 7313859a36..667a255612 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevRestriction.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.CylinderSobolevDerivatives /-! Genuine restrictions between any two finite cylinder Sobolev orders. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,8 @@ def restrictIndex {p q : ℕ} (h : q ≤ p) (w : SobolevWord q) : SobolevWord p variable (period : ℝ) [Fact (0 < period)] /-- Restriction is a bounded linear map between the actual complete Sobolev spaces. -/ -def restrictOperator {p q : ℕ} (h : q ≤ p) : SobolevSpace period p →L[ℝ] SobolevSpace period q := +@[expose] def restrictOperator {p q : ℕ} (h : q ≤ p) : + SobolevSpace period p →L[ℝ] SobolevSpace period q := ((ContinuousLinearMap.pi (fun w : SobolevWord q => ContinuousLinearMap.proj (restrictIndex h w))).comp (arrayOperator period p)).codRestrict (sobolevSubspace period q).toSubmodule (by @@ -38,10 +39,15 @@ def restrictOperator {p q : ℕ} (h : q ≤ p) : SobolevSpace period p →L[ℝ] @[simp] theorem restrictOperator_apply {p q : ℕ} (h : q ≤ p) (u : SobolevSpace period p) (w : SobolevWord q) : - (restrictOperator period h u).val w = u.val (restrictIndex h w) := rfl + (restrictOperator period h u).val w = u.val (restrictIndex h w) := by rfl @[simp] theorem value_restrictOperator {p q : ℕ} (h : q ≤ p) (u : SobolevSpace period p) : - value period (restrictOperator period h u) = value period u := rfl + value period (restrictOperator period h u) = value period u := by rfl + +@[simp] theorem word_restrictOperator {p q n : ℕ} (h : q ≤ p) (hn : n ≤ q) + (u : SobolevSpace period p) (w : Fin n → Fin 4) : + word period (restrictOperator period h u) hn w = + word period u (hn.trans h) w := by rfl theorem restrictOperator_bound {p q : ℕ} (h : q ≤ p) (u : SobolevSpace period p) : ‖restrictOperator period h u‖ ≤ ‖u‖ := by @@ -66,13 +72,13 @@ theorem restrictOperator_bound {p q : ℕ} (h : q ≤ p) (u : SobolevSpace perio restrictOperator period h (truncateOperator period p u) = restrictOperator period (by omega : q ≤ p+1) u := by apply value_injective period - rfl + simp only [value_restrictOperator, value_truncateOperator] @[simp] theorem truncate_restrictOperator {p q : ℕ} (h : q + 1 ≤ p) (u : SobolevSpace period p) : truncateOperator period q (restrictOperator period h u) = restrictOperator period (by omega : q ≤ p) u := by apply value_injective period - rfl + simp only [value_restrictOperator, value_truncateOperator] /-- Actual restriction and spatial differentiation commute. -/ theorem restrictOperator_derivative {p q : ℕ} (h : q ≤ p) (i : Fin 4) (u : SobolevSpace period @@ -80,6 +86,7 @@ theorem restrictOperator_derivative {p q : ℕ} (h : q ≤ p) (i : Fin 4) (u : S restrictOperator period h (derivativeOperator period p i u) = derivativeOperator period q i (restrictOperator period (Nat.succ_le_succ h) u) := by apply value_injective period + simp only [value, restrictOperator_apply, derivativeOperator_apply] rfl /-- Restriction commutes with every genuine cylinder translation. -/ @@ -88,6 +95,6 @@ theorem restrictOperator_translation {p q : ℕ} (h : q ≤ p) (a : LiftDomain p restrictOperator period h (sobolevTranslation period p a u) = sobolevTranslation period q a (restrictOperator period h u) := by apply value_injective period - rfl + simp only [value_restrictOperator, value_sobolevTranslation] end EulerCylinderSobolevSpace diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevSmoothApproximation.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevSmoothApproximation.lean index 40bc1c0e82..f8206acf06 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevSmoothApproximation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevSmoothApproximation.lean @@ -12,7 +12,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevRestriction /-! Smooth high-regularity approximations converging contractively in the original Sobolev order. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,8 @@ theorem smoothingVariance_tendsto : Filter.Tendsto smoothingVariance Filter.atTo simpa only [Real.toNNReal_zero, Function.comp_def, smoothingVariance] using h /-- An approximation having three extra strong derivatives and an actual C∞ representative. -/ -def smoothApprox (q n : ℕ) : SobolevSpace period q →L[ℝ] SobolevSpace period (q+3) := +@[expose] def smoothApprox (q n : ℕ) : + SobolevSpace period q →L[ℝ] SobolevSpace period (q+3) := (sobolevMollifier period (q+3) n).comp (heatGainThree period q (smoothingVariance n) (smoothingVariance_pos n)) @@ -66,10 +67,8 @@ theorem restrict_smoothApprox {q : ℕ} (n : ℕ) (u : SobolevSpace period q) : sobolevMollifier period q n (heatOperator period q (smoothingVariance n+(smoothingVariance n+smoothingVariance n)) u) := by apply value_injective period - change mollify period n (value period (heatGainThree period q (smoothingVariance n) - (smoothingVariance_pos n) u)) = _ - rw [heatGainThree_value] - rfl + simp only [value_restrictOperator, smoothApprox, ContinuousLinearMap.comp_apply, + sobolevMollifier_value, heatGainThree_value, heatOperator_value] /-- The approximations are contractive at the original Sobolev order. -/ theorem smoothApprox_bound {q : ℕ} (n : ℕ) (u : SobolevSpace period q) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevSourceExponent.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevSourceExponent.lean index 903a00c78c..863a246d6e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevSourceExponent.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevSourceExponent.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real radius. Explicit coarse powers leave room for the source exponent C*=10(s+2), including the sum of all three particle-map fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevTransport.lean index 5a52827e46..6b96a9f5de 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevTransport.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.StrongSmoothJet /-! Actual one-derivative-losing nonlinear transport on the complete cylinder Sobolev spaces. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevTransportCommutator.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevTransportCommutator.lean index a700ba5796..0299b3a476 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevTransportCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevTransportCommutator.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevTransport /-! The genuine external transport commutator as a bounded bilinear Sobolev operator. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevViscousEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevViscousEnergy.lean index 03dfc29f8d..83fddb4f59 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevViscousEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevViscousEnergy.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Finite-family viscous metric energy for actual finite Sobolev solutions. -/ -@[expose] public section +public section noncomputable section @@ -70,10 +70,11 @@ theorem finite_sobolev_viscous_energy {ι : Type*} [Fintype ι] {q : ℕ} (hq : have htL (i : ι) : |⟪(K t).operator (value period (e i t)), transportOperator period hq κ m z (restrictOperator period (by norm_num : 1 ≤ 2) (e i t))⟫_ℝ| ≤ - β * ‖value period (e i t)‖ ^ 2 := - metric_transport_bound period hq κ m (K t) z (restrictOperator period (by - norm_num : 1 ≤ 2) (e i t)) - hsym hz B hzB + β * ‖value period (e i t)‖ ^ 2 := by + have hbound := metric_transport_bound period hq κ m (K t) z + (restrictOperator period (by norm_num : 1 ≤ 2) (e i t)) hsym hz B hzB + rw [value_restrictOperator] at hbound + exact hbound have hheat (i : ι) : ⟪(K t).operator (value period (e i t)), jetLaplacian period (toJet period (e i t))⟫_ℝ ≤ C * ‖value period (e i t)‖ ^ 2 := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlockCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlockCoordinates.lean index a446d8a731..962f14cf95 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlockCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlockCoordinates.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevWordBlocks /-! Exact derivative coordinates of genuine Sobolev word blocks. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlocks.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlocks.lean index afebec28bb..f790de73a8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlocks.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordBlocks.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevHeat /-! Bounded actual derivative-word blocks on the complete Sobolev scale. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ variable (period : ℝ) [Fact (0 < period)] /-- A derivative word as an actual bounded map H^(q+n)→Hq, with its literal differentiation order. -/ -def wordBlock (q : ℕ) : (n : ℕ) → (Fin n → Fin 4) → +@[expose] def wordBlock (q : ℕ) : (n : ℕ) → (Fin n → Fin 4) → SobolevSpace period (q + n) →L[ℝ] SobolevSpace period q | 0, _ => ContinuousLinearMap.id ℝ (SobolevSpace period q) | n + 1, w => @@ -53,9 +53,9 @@ theorem wordBlock_value (q n : ℕ) (w : Fin n → Fin 4) (u : SobolevSpace peri change value period (wordBlock period q n (Fin.init w) (derivativeOperator period (q+n) (w (Fin.last n)) u)) = _ rw [ih] + simp only [word, derivativeOperator_apply] change u.val ⟨⟨n+1, _⟩, Fin.snoc (Fin.init w) (w (Fin.last n))⟩ = _ rw [Fin.snoc_init_self] - rfl /-- Every derivative block commutes with actual cylinder translation. -/ theorem wordBlock_translation (q n : ℕ) (w : Fin n → Fin 4) @@ -77,7 +77,7 @@ theorem wordBlock_heat (q n : ℕ) (w : Fin n → Fin 4) heatOperator period q v (wordBlock period q n w u) := by apply value_injective period rw [wordBlock_value, heatOperator_value, wordBlock_value] - rfl + simp only [word, heatOperator_apply] /-- Truncating a derivative block agrees with taking the same word after truncating its input. -/ theorem truncate_wordBlock (q n : ℕ) (w : Fin n → Fin 4) @@ -86,6 +86,6 @@ theorem truncate_wordBlock (q n : ℕ) (w : Fin n → Fin 4) wordBlock period q n w (restrictOperator period (by omega : q+n ≤ q+1+n) u) := by apply value_injective period rw [value_truncateOperator, wordBlock_value, wordBlock_value] - rfl + rw [word_restrictOperator] end EulerSobolevWordBlocks diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordLevel.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordLevel.lean index eabc612c10..d43311d9e8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordLevel.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordLevel.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.Foundations.StrongSmoothJet /-! Actual derivative words at any lower Sobolev level, with exact representative and norm identities. -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ theorem wordAtLevel_value {s : ℕ} (q n : ℕ) (w : Fin n → Fin 4) (h : n + q value period (wordAtLevel period q n w h u) = (toJet period u).word w := by change value period (wordBlock period q n w (restrictOperator period (by omega : q+n ≤ s) u)) = _ rw [wordBlock_value, toJet_word period u (by omega)] - rfl + rw [word_restrictOperator] /-- Every actual smooth representative has the expected classical word after this operation. -/ theorem wordAtLevel_ae {s : ℕ} (q n : ℕ) (w : Fin n → Fin 4) (h : n + q ≤ s) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordValueIdentity.lean b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordValueIdentity.lean index 8e7a41888c..cb3f402b2d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SobolevWordValueIdentity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SobolevWordValueIdentity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevMaximalRegularity /-! Genuine Sobolev derivative words and time fields are independent of harmless order reindexing. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/Solution.lean b/LeanPool/NavierStokesAndEuler/Euler/Solution.lean index 6e84559c59..411090f112 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Solution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Solution.lean @@ -23,7 +23,7 @@ section /-! Compact smooth data satisfy the independent challenge's rapid-decay condition. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SolutionDefinitions.lean b/LeanPool/NavierStokesAndEuler/Euler/SolutionDefinitions.lean index 7ef88419f9..fb3013337c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SolutionDefinitions.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SolutionDefinitions.lean @@ -48,7 +48,7 @@ These definitions reproduce the independent reference exactly. This module contains no challenge theorem or proof placeholder and does not import `Euler`. -/ -@[expose] public section +public section @@ -100,7 +100,7 @@ open scoped ENNReal Topology /-- The L² equivalence class of a square-integrable function. The fallback makes this a total function; the solution conditions require square integrability wherever it is used. -/ -noncomputable def toL2 {V : Type*} [NormedAddCommGroup V] (f : ℝ³ → V) : +@[expose] noncomputable def toL2 {V : Type*} [NormedAddCommGroup V] (f : ℝ³ → V) : Lp V 2 (volume : Measure ℝ³) := by classical exact if h : MemLp f 2 volume then h.toLp f else 0 @@ -143,11 +143,11 @@ noncomputable def vorticity (v : ℝ³ → ℝ³) (x : ℝ³) : ℝ³ := (fderiv ℝ v x (EuclideanSpace.single (i + 2) 1)) (i + 1)) /-- The sum of the spatial suprema of the velocity norm and derivative operator norm. -/ -noncomputable def velocityC1Norm (v : ℝ³ → ℝ³) : ℝ≥0∞ := +@[expose] noncomputable def velocityC1Norm (v : ℝ³ → ℝ³) : ℝ≥0∞ := (⨆ x, ENNReal.ofReal ‖v x‖) + (⨆ x, ENNReal.ofReal ‖fderiv ℝ v x‖) /-- The spatial supremum of the Euclidean norm of the actual vorticity. -/ -noncomputable def vorticityNorm (v : ℝ³ → ℝ³) : ℝ≥0∞ := +@[expose] noncomputable def vorticityNorm (v : ℝ³ → ℝ³) : ℝ≥0∞ := ⨆ x, ENNReal.ofReal ‖vorticity v x‖ diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderEquation.lean index 9f3808a9b6..5275b33be3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderEquation.lean @@ -20,7 +20,7 @@ derivative. The projected equation and normal pressure balance are derived on the actual L² representatives, not assumed as properties of a solver. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForcing.lean index 1a865254d9..bcd1035349 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForcing.lean @@ -21,7 +21,7 @@ velocity uses the actual frame. Both preserve the closed spatial support, actual mixed-orbit smoothness, and the external-word radius at fixed Hq. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ variable (period : ℝ) [Fact (0 < period)] (c : ℝ) (hc : 0 < c) (hQ : ∀ t x v, c * ‖v‖ ^ 2 ≤ ‖Q.field t x v‖ ^ 2) /-- The actual projected forcing on the supported cylinder. -/ -def projectedForcing (f : C(K, Supported period E S hS)) : C(K,Supported period U S hS) := +@[expose] def projectedForcing (f : C(K, Supported period E S hS)) : C(K,Supported period U S hS) := supportedMultiplierMap period S hS (sourceForcing Q c hc hQ) f /-- The actual physical velocity associated with the coordinate field. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForward.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForward.lean index 8c1ee26d89..cb49510e50 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForward.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForward.lean @@ -22,7 +22,7 @@ has the localized H3 bound and the true fixed-Hq mixed external-word estimate at the same input/output radius. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForwardSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForwardSobolev.lean index af1f00110b..c0f60e8ebc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForwardSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderForwardSobolev.lean @@ -20,7 +20,7 @@ is multiplied by the physical frame. All three operations use the same external radius R. Only the solve spends one shift. -/ -@[expose] public section +public section noncomputable section @@ -59,7 +59,7 @@ def normalizedVelocity : C(Icc (0 : ℝ) T,Supported period E S hS) := physicalVelocity period S hS Q (normalizedCoordinates period T hT S hS Q Q₁ c hc hQ g hg f a₀) /-- Explicit coefficient cost of projecting a physical forcing at the fixed base order. -/ -def forcingCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri C₀ : ℝ) : ℝ := +@[expose] def forcingCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri C₀ : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q (4*Ri) (3*Ri*C₀) /-- The physical solution has the source's genuine fixed-Hq mixed-word bound, diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderMeanZero.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderMeanZero.lean index e02af5f394..dee1f98f59 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderMeanZero.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderMeanZero.lean @@ -18,7 +18,7 @@ section /-! The actual supported Duhamel solution preserves zero angular mean. -/ -@[expose] public section +public section noncomputable section @@ -151,7 +151,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean index 407d11218a..8a68832b5b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean @@ -47,7 +47,7 @@ section /-! Actual unnormalized forward solutions have smooth mixed translation orbits. -/ -@[expose] public section +public section noncomputable section @@ -100,7 +100,7 @@ end end -@[expose] public section +public section noncomputable section @@ -185,7 +185,7 @@ L² solution. It is jointly continuous, spatially and angularly smooth, compactly supported, and has the true pointwise within-time derivative. -/ -@[expose] public section +public section noncomputable section @@ -206,7 +206,7 @@ variable (period : ℝ) [Fact (0 < period)] (ha₀ : ContDiff ℝ ∞ (fun a : LiftTangent => translate period a (a₀ : CylinderL2 period U))) /-- The actual physical field, reconstructed from the solved L² class. -/ -def field (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Space := +@[expose] def field (t : Icc (0 : ℝ) T) (x : LiftDomain period) : Space := pointField period (includePath period S hS (velocity period S hS T hT Q Q₁ c hc hQ f a₀)) (velocity_contDiff period S hS hSc T hT Q Q₁ c hc hQ f a₀ hf ha₀) t x @@ -297,7 +297,7 @@ end end -@[expose] public section +public section noncomputable section @@ -321,7 +321,7 @@ variable (period : ℝ) [Fact (0 < period)] (m : SmoothCoefficientPath (Icc (0 : ℝ) T) Space) /-- The source's literal scalar normal pressure residual. -/ -def normalResidual (t : Icc (0 : ℝ) T) (x : LiftDomain period) : ℝ := +@[expose] def normalResidual (t : Icc (0 : ℝ) T) (x : LiftDomain period) : ℝ := (⟪m.field t x.1,pointField period (includePath period S hS f) hf t x⟫_ℝ - 2*⟪m.field t x.1,M.field t x.1 (field period S hS hSc T hT Q Q₁ c hc hQ f a₀ hf ha₀ t x)⟫_ℝ) / ‖m.field t x.1‖^2 @@ -442,7 +442,7 @@ matrix. Applying it to f−2MA gives a genuine scalar L² path, with the literal normal residual as representative and genuine smooth mixed translation orbit. -/ -@[expose] public section +public section noncomputable section @@ -533,7 +533,7 @@ end end -@[expose] public section +public section noncomputable section @@ -643,7 +643,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureWeight.lean index 6c40b8f256..b50fc6f33c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureWeight.lean @@ -19,7 +19,7 @@ All identities are algebraic identities of genuine continuous L² paths. They use no derivative, extremum, or reciprocal bound for the time profile. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderTimeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderTimeBounds.lean index 58180694fb..6b4738d4ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderTimeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderTimeBounds.lean @@ -24,7 +24,7 @@ external radius and shift. Scalar time weights commute with these expressions; in particular no derivative of the positive profile is used. -/ -@[expose] public section +public section noncomputable section @@ -81,13 +81,13 @@ theorem physicalRhs_contDiff /-- Coordinate cost, given by `3*sobolevCoefficientAmplitude ι q (4*Ri) (18*Ri*C₀*C₁)*Da + 3*sobolevCoefficientAmplitude ι q (4*Ri) (3*Ri*C₀)*Df`. -/ -def coordinateCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri C₀ C₁ Df Da : ℝ) : ℝ := +@[expose] def coordinateCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri C₀ C₁ Df Da : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q (4*Ri) (18*Ri*C₀*C₁)*Da + 3*sobolevCoefficientAmplitude ι q (4*Ri) (3*Ri*C₀)*Df /-- Physical cost, given by `3*sobolevCoefficientAmplitude ι q (4*Ri) C₁*Da + 3*sobolevCoefficientAmplitude ι q (4*Ri) C₀*coordinateCost ι q Ri C₀ C₁ Df Da`. -/ -def physicalCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri C₀ C₁ Df Da : ℝ) : ℝ := +@[expose] def physicalCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri C₀ C₁ Df Da : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q (4*Ri) C₁*Da + 3*sobolevCoefficientAmplitude ι q (4*Ri) C₀*coordinateCost ι q Ri C₀ C₁ Df Da diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderWeight.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderWeight.lean index 9faee1b682..24d1654ed0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderWeight.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderWeight.lean @@ -18,7 +18,7 @@ physical forcing g f by g. This is an algebraic identity of continuous paths; it does not differentiate g or introduce its extrema into any estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceForwardCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceForwardCoefficient.lean index 0928eeb311..a73ff13fe7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceForwardCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceForwardCoefficient.lean @@ -40,7 +40,7 @@ The resulting time path and its parameter regularity are therefore proved in the uniform spatial norm, not merely at each fixed spatial label. -/ -@[expose] public section +public section noncomputable section @@ -88,7 +88,7 @@ def gramField (Q : α →ᵇ U →L[ℝ] E) : α →ᵇ U →L[ℝ] U := compositionMap (α := α) (U := U) (E := E) (F := U) (adjointMap (α := α) (U := U) (E := E) Q) Q -@[simp] theorem gramField_apply (Q : α →ᵇ U →L[ℝ] E) (x : α) : gramField Q x = gram (Q x) := rfl +@[simp] theorem gramField_apply (Q : α →ᵇ U →L[ℝ] E) (x : α) : gramField Q x = gram (Q x) := by rfl variable (Q : α →ᵇ U →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hQ : ∀ x v, c * ‖v‖ ^ 2 ≤ ‖Q x v‖ ^ 2) @@ -114,7 +114,7 @@ def inverseField : α →ᵇ U →L[ℝ] U := (inverseField_continuous Q c hc hQ) c⁻¹ (fun x => gramInverse_norm (Q x) c hc (hQ x)) @[simp] theorem inverseField_apply (x : α) : inverseField Q c hc hQ x = gramInverse (Q x) c hc (hQ - x) := rfl + x) := by rfl theorem inverseField_norm : ‖inverseField Q c hc hQ‖ ≤ c⁻¹ := BoundedContinuousFunction.norm_ofNormedAddCommGroup_le _ (inv_nonneg.mpr hc.le) _ @@ -165,7 +165,7 @@ def gramPath (Qp : C(K, α →ᵇ U →L[ℝ] E)) : C(K,α →ᵇ U →L[ℝ] U) (pathAdjointMap (α := α) (K := K) (U := U) (E := E) Qp) Qp @[simp] theorem gramPath_apply (Qp : C(K, α →ᵇ U →L[ℝ] E)) (t : K) : gramPath Qp t = gramField (Qp - t) := rfl + t) := by rfl /-- The constructed inverse is continuous in the spatial uniform norm as time varies. -/ def inversePath (Qp : C(K, α →ᵇ U →L[ℝ] E)) @@ -183,7 +183,7 @@ def inversePath (Qp : C(K, α →ᵇ U →L[ℝ] E)) @[simp] theorem inversePath_apply (Qp : C(K, α →ᵇ U →L[ℝ] E)) (hLower : ∀ t x v, c * ‖v‖ ^ 2 ≤ ‖Qp t x v‖ ^ 2) (t : K) (x : α) : - inversePath c hc Qp hLower t x = gramInverse (Qp t x) c hc (hLower t x) := rfl + inversePath c hc Qp hLower t x = gramInverse (Qp t x) c hc (hLower t x) := by rfl /-- The uniform time-space inverse bound is the same coercive bound. -/ theorem inversePath_norm (Qp : C(K, α →ᵇ U →L[ℝ] E)) @@ -246,7 +246,7 @@ section /-! Actual factorial estimates for the uniformly bounded space-time Gram inverse. -/ -@[expose] public section +public section noncomputable section @@ -438,7 +438,7 @@ coefficient (Q*Q)⁻¹Q*. Spatial translation covariance and coefficient estimat are proved for these actual fields. -/ -@[expose] public section +public section noncomputable section @@ -526,12 +526,13 @@ def generatorPath (c : ℝ) (hc : 0 < c) (Q Q₁ : C(K, α →ᵇ U →L[ℝ] E) @[simp] theorem leftInversePath_apply (c : ℝ) (hc : 0 < c) (Q : C(K, α →ᵇ U →L[ℝ] E)) (hQ : ∀ t x v, c * ‖v‖ ^ 2 ≤ ‖Q t x v‖ ^ 2) (t : K) (x : α) : - leftInversePath c hc Q hQ t x = (gramInverse (Q t x) c hc (hQ t x)).comp (Q t x).adjoint := rfl + leftInversePath c hc Q hQ t x = + (gramInverse (Q t x) c hc (hQ t x)).comp (Q t x).adjoint := by rfl @[simp] theorem generatorPath_apply (c : ℝ) (hc : 0 < c) (Q Q₁ : C(K, α →ᵇ U →L[ℝ] E)) (hQ : ∀ t x v, c * ‖v‖ ^ 2 ≤ ‖Q t x v‖ ^ 2) (t : K) (x : α) : generatorPath c hc Q Q₁ hQ t x = - (-2 : ℝ) • (gramInverse (Q t x) c hc (hQ t x)).comp ((Q t x).adjoint.comp (Q₁ t x)) := rfl + (-2 : ℝ) • (gramInverse (Q t x) c hc (hQ t x)).comp ((Q t x).adjoint.comp (Q₁ t x)) := by rfl variable {P : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] @@ -606,7 +607,7 @@ end end -@[expose] public section +public section noncomputable section @@ -682,10 +683,10 @@ local instance instSourceForwardCoefficient18 : NormedSpace ℝ (C(K,Space → inferInstance /-- The actual bounded continuous source generator. -/ -def sourceGenerator : C(K,Space →ᵇ U →L[ℝ] U) := generatorPath c hc Q.field Q₁.field hQ +@[expose] def sourceGenerator : C(K,Space →ᵇ U →L[ℝ] U) := generatorPath c hc Q.field Q₁.field hQ /-- The actual bounded continuous projected-forcing coefficient. -/ -def sourceForcing : C(K,Space →ᵇ E →L[ℝ] U) := leftInversePath c hc Q.field hQ +@[expose] def sourceForcing : C(K,Space →ᵇ E →L[ℝ] U) := leftInversePath c hc Q.field hQ include hQ in omit [CompleteSpace U] [CompleteSpace E] in diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceNormalCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceNormalCoefficient.lean index f429f6311b..c4eb5972e6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceNormalCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceNormalCoefficient.lean @@ -19,7 +19,7 @@ regularity and factorial multiplier bounds from the normal field and its positive lower bound, without assuming regularity of a reciprocal field. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ def normalColumn : SmoothCoefficientPath K (ℝ →L[ℝ] E) := omit [CompleteSpace E] in @[simp] theorem normalColumn_apply (t : K) (x : Space) (r : ℝ) : - (normalColumn m).field t x r = r • m.field t x := rfl + (normalColumn m).field t x r = r • m.field t x := by rfl omit [CompleteSpace E] in theorem normalColumn_lower (c : ℝ) (hm : ∀ t x, c ≤ ‖m.field t x‖ ^ 2) @@ -62,9 +62,12 @@ theorem normalFunctional_apply (t : K) (x : Space) (v : E) : have hn : ‖m.field t x‖^2 ≠ 0 := ne_of_gt (hc.trans_le (hm t x)) have he := gram_inverse_apply ((normalColumn m).field t x) c hc (normalColumn_lower m c hm t x) (((normalColumn m).field t x).adjoint v) - change ((normalColumn m).field t x).adjoint - ((normalColumn m).field t x (normalFunctional m c hc hm t x v)) = - ((normalColumn m).field t x).adjoint v at he + have hfunctional : + normalFunctional m c hc hm t x v = + gramInverse ((normalColumn m).field t x) c hc + (normalColumn_lower m c hm t x) (((normalColumn m).field t x).adjoint v) := by + simp only [normalFunctional, sourceForcing, leftInversePath_apply, comp_apply] + rw [gram, comp_apply, ← hfunctional] at he have hadj : ((normalColumn m).field t x).adjoint = innerSL ℝ (m.field t x) := adjoint_toSpanSingleton (m.field t x) rw [hadj] at he diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceNormalResidualBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceNormalResidualBounds.lean index 6a41264f7e..7e603cdc92 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceNormalResidualBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceNormalResidualBounds.lean @@ -29,7 +29,7 @@ section /-! Actual normal pressure residuals preserve the fixed-Sobolev mixed-word radius. -/ -@[expose] public section +public section noncomputable section @@ -116,7 +116,7 @@ end end -@[expose] public section +public section noncomputable section @@ -139,7 +139,7 @@ def sourceResidual : C(K,CylinderL2 P ℝ) := normalResidualPath P (normalFunctional m cm hcm hm) M.field f v /-- Source pressure, given by `pathPrimitive P (sourceResidual P M m cm hcm hm f v)`. -/ -def sourcePressure : C(K,CylinderL2 P ℝ) := +@[expose] def sourcePressure : C(K,CylinderL2 P ℝ) := pathPrimitive P (sourceResidual P M m cm hcm hm f v) theorem sourceResidual_contDiff @@ -156,7 +156,7 @@ theorem sourcePressure_contDiff pathPrimitive_orbit_contDiff P _ (sourceResidual_contDiff P M m cm hcm hm f v hf hv) /-- An explicit fixed-order coefficient polynomial for the pressure source. -/ -def pressureCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri Cm CM Df Dv : ℝ) : ℝ := +@[expose] def pressureCost (ι : Type*) [Fintype ι] (q : ℕ) (Ri Cm CM Df Dv : ℝ) : ℝ := 3*sobolevCoefficientAmplitude ι q (4*Ri) (3*Ri*Cm) * (Df+6*sobolevCoefficientAmplitude ι q (4*Ri) CM*Dv) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SquaredMetricStability.lean b/LeanPool/NavierStokesAndEuler/Euler/SquaredMetricStability.lean index dc05140d86..290812d0ed 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SquaredMetricStability.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SquaredMetricStability.lean @@ -18,7 +18,7 @@ import Mathlib.Analysis.SpecialFunctions.ExpDeriv /-! Squared metric stability with a viscosity-sized source, including zero energy. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TerminalTimePrimitive.lean b/LeanPool/NavierStokesAndEuler/Euler/TerminalTimePrimitive.lean index 7fbbb2c22f..f1549d8b59 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TerminalTimePrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TerminalTimePrimitive.lean @@ -20,7 +20,7 @@ constructs the continuous representative, its zero terminal trace, and its almost-everywhere derivative. No primitive or evolution solution is assumed. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ open scoped Topology variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The canonical time representative extended by zero outside the time interval. -/ -def zeroExtension (T : ℝ) (u : TimeLp T E) : ℝ → E := +@[expose] def zeroExtension (T : ℝ) (u : TimeLp T E) : ℝ → E := (Icc (0 : ℝ) T).indicator u omit [NormedSpace ℝ E] in @@ -56,7 +56,7 @@ theorem zeroExtension_ae (T : ℝ) (u : TimeLp T E) : indicator_ae_eq_restrict measurableSet_Icc /-- The actual real-valued-time representative, with terminal value zero. -/ -def realPrimitive (T : ℝ) (u : TimeLp T E) (t : ℝ) : E := +@[expose] def realPrimitive (T : ℝ) (u : TimeLp T E) (t : ℝ) : E := ∫ s in T..t, zeroExtension T u s /-- The constructed primitive is continuous on all of real time. -/ @@ -102,7 +102,7 @@ theorem realPrimitive_hasDerivAt_ae [CompleteSpace E] (T : ℝ) (u : TimeLp T E) simpa only [he] using ht /-- The genuine continuous path on the prescribed time interval. -/ -def primitivePath (T : ℝ) (u : TimeLp T E) : C(Icc (0 : ℝ) T, E) := +@[expose] def primitivePath (T : ℝ) (u : TimeLp T E) : C(Icc (0 : ℝ) T, E) := ⟨fun t => realPrimitive T u t, (realPrimitive_continuous T u).comp continuous_subtype_val⟩ /-- Cauchy--Schwarz for a square-integrable scalar function on an interval. -/ @@ -246,7 +246,7 @@ theorem primitivePath_norm_le (T : ℝ) (_hT : 0 ≤ T) (u : TimeLp T E) : (mul_le_mul_of_nonneg_right (Real.sqrt_le_sqrt (sub_le_self T t.property.1)) (norm_nonneg _)) /-- Bounded terminal integration from actual Bochner L² fields to continuous paths. -/ -def terminalPrimitive (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := +@[expose] def terminalPrimitive (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T, E) := ({ toFun := primitivePath T map_add' := primitivePath_add T map_smul' := fun a u => by simpa only [RingHom.id_apply] using primitivePath_smul T a u } : @@ -266,21 +266,25 @@ theorem terminalPrimitive_apply_norm_sq_le (T : ℝ) (hT : 0 ≤ T) (u : TimeLp realPrimitive_norm_sq_le T u t t.property /-- Evaluation at any interval point is a continuous linear map of the derivative. -/ -def evaluation (T : ℝ) (hT : 0 ≤ T) (t : Icc (0 : ℝ) T) : TimeLp T E →L[ℝ] E := +@[expose] def evaluation (T : ℝ) (hT : 0 ≤ T) (t : Icc (0 : ℝ) T) : TimeLp T E →L[ℝ] E := (ContinuousMap.evalCLM ℝ t).comp (terminalPrimitive T hT) /-- The initial trace, with its zero-terminal normalization. -/ -def initialTrace (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] E := +@[expose] def initialTrace (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] E := evaluation T hT ⟨0, le_rfl, hT⟩ +@[simp] theorem initialTrace_apply (T : ℝ) (hT : 0 ≤ T) (u : TimeLp T E) : + initialTrace T hT u = terminalPrimitive T hT u ⟨0, le_rfl, hT⟩ := by + rfl + /-- The bounded primitive regarded as an actual Bochner L² time field. -/ -def primitiveTimeLp (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] TimeLp T E := +@[expose] def primitiveTimeLp (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] TimeLp T E := (pathLpOperator T hT).comp (terminalPrimitive T hT) /-- The Bochner primitive is represented by the same continuous real-time function. -/ theorem primitiveTimeLp_ae (T : ℝ) (hT : 0 ≤ T) (u : TimeLp T E) : (primitiveTimeLp T hT u : ℝ → E) =ᵐ[timeMeasure T] realPrimitive T u := by - change (pathLp T hT (terminalPrimitive T hT u) : ℝ → E) =ᵐ[timeMeasure T] realPrimitive T u + simp only [primitiveTimeLp, ContinuousLinearMap.comp_apply, pathLpOperator_apply] filter_upwards [pathLp_ae T hT (terminalPrimitive T hT u), ae_restrict_mem measurableSet_Icc] with t ht hmem rw [ht] diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeCorrectionSource.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeCorrectionSource.lean index 8cfe532570..942fa70a93 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeCorrectionSource.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeCorrectionSource.lean @@ -19,7 +19,7 @@ section /-! Exact restriction and time continuity of the actual order-zero correction source. -/ -@[expose] public section +public section noncomputable section @@ -126,7 +126,7 @@ section /-! Strong actual heat approximation and time-dependent operator commutators in Bochner Sobolev spaces. -/ -@[expose] public section +public section noncomputable section @@ -191,7 +191,7 @@ section /-! Actual derivative-losing transport on continuous coefficients and square-integrable higher Sobolev states. -/ -@[expose] public section +public section noncomputable section @@ -256,7 +256,7 @@ end end -@[expose] public section +public section noncomputable section @@ -285,7 +285,7 @@ local instance timeCorrectionPathAdd (T : ℝ) (q : ℕ) : Add C(Icc (0 : ℝ) T, SobolevSpace period q) := inferInstance /-- The actual order-zero source is a continuous path on the energy Sobolev level. -/ -def orderZeroPath {s : ℕ} (hs : 6 ≤ s) (T : ℝ) +@[expose] def orderZeroPath {s : ℕ} (hs : 6 ≤ s) (T : ℝ) (L : Fin 4 → Vector3 →L[ℝ] ℝ) (hL : ∀ i, ‖L i‖ ≤ 1) (C0 : C(Icc (0 : ℝ) T, SobolevSpace period s →L[ℝ] SobolevSpace period s)) (C : Fin 3 → C(Icc (0 : ℝ) T, SobolevSpace period s →L[ℝ] SobolevSpace period s)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1ContinuousDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1ContinuousDerivative.lean index a5db9c5583..801826384c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1ContinuousDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1ContinuousDerivative.lean @@ -20,7 +20,7 @@ Thus the time derivative holds at every interior time and within the closed interval at both endpoints. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1FieldProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1FieldProduct.lean index df7a9bdcff..9b70f09899 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1FieldProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1FieldProduct.lean @@ -18,7 +18,7 @@ This file constructs the derivative of a C¹ coefficient times any actual AC representative with Bochner L² value and derivative classes. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (A A' : C(Icc (0 : ℝ) T, E →L[ℝ] F)) /-- The product derivative is constructed in the actual L² space. -/ -def fieldProductDerivative (p q : TimeLp T E) : TimeLp T F := +@[expose] def fieldProductDerivative (p q : TimeLp T E) : TimeLp T F := timeMultiplier T hT A' p + timeMultiplier T hT A q /-- The constructed derivative is the pointwise Leibniz expression a.e. -/ @@ -113,6 +113,7 @@ theorem fieldProduct_h1 (p q : TimeLp T E) (η : ℝ → E) /-- The constructed derivative has the expected operator-norm bound. -/ theorem fieldProductDerivative_norm_le (p q : TimeLp T E) : ‖fieldProductDerivative T hT A A' p q‖ ≤ ‖A'‖*‖p‖+‖A‖*‖q‖ := - (norm_add_le _ _).trans (add_le_add (timeApply_bound T hT A' p) (timeApply_bound T hT A q)) + (norm_add_le _ _).trans + (add_le_add (timeMultiplier_bound T hT A' p) (timeMultiplier_bound T hT A q)) end EulerTimeH1FieldProduct diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1FrameTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1FrameTransport.lean index 0e2893b210..3bdceb458b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1FrameTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1FrameTransport.lean @@ -19,7 +19,7 @@ places parameter-dependent transverse variational problems on one fixed Hilbert space before coefficient differentiation or all-order estimates. -/ -@[expose] public section +public section noncomputable section @@ -61,7 +61,7 @@ theorem coordinateDerivative_productDerivative (v : TimeLp T U) : exact frameLeftInverse_apply (Q t) c hc (hQ t) _ /-- A strictly positive polynomial transport cost from the inverse-frame bounds. -/ -def transportCost : ℝ := +@[expose] def transportCost : ℝ := 1 + ((2 * (c⁻¹)^2 * ‖Q‖^2 * ‖Q₁‖ + c⁻¹ * ‖Q₁‖) * T + c⁻¹ * ‖Q‖) omit [CompleteSpace U] [CompleteSpace E] in @@ -101,6 +101,10 @@ Terminal zero is already supplied by the primitive. -/ def zeroTraceDerivatives (T : ℝ) (hT : 0 ≤ T) : Submodule ℝ (TimeLp T U) := LinearMap.ker (initialTrace T hT).toLinearMap +omit [CompleteSpace U] in +@[simp] theorem mem_zeroTraceDerivatives (T : ℝ) (hT : 0 ≤ T) (v : TimeLp T U) : + v ∈ zeroTraceDerivatives T hT ↔ initialTrace T hT v = 0 := by rfl + /-- The fixed zero-trace coordinate space is complete. -/ instance zeroTraceDerivatives_complete (T : ℝ) (hT : 0 ≤ T) : CompleteSpace (zeroTraceDerivatives (U := U) T hT) := @@ -118,6 +122,10 @@ def transverseForward : zeroTraceDerivatives (U := U) T hT →L[ℝ] transverseD EulerTransverseMomentumRegularity.productDerivative_mem_transverse T hT Q Q₁ hd m hTangent (v : TimeLp T U) v.property) +@[simp] theorem transverseForward_coe (v : zeroTraceDerivatives (U := U) T hT) : + (transverseForward T hT Q Q₁ hd m hTangent v : TimeLp T E) = + productDerivative T hT Q Q₁ (v : TimeLp T U) := by rfl + /-- Applying the constructed inverse-frame derivative transports back to the same fixed coordinate space. -/ def transverseBackward : transverseDerivatives T hT m →L[ℝ] zeroTraceDerivatives (U := U) T hT := @@ -129,7 +137,12 @@ def transverseBackward : transverseDerivatives T hT m →L[ℝ] zeroTraceDerivat (frameLeftInverseDerivativePath T Q Q₁ c hc hQ) (u : TimeLp T E)) = 0 rw [initialTrace_productDerivative T hT (frameLeftInversePath T Q c hc hQ) (frameLeftInverseDerivativePath T Q Q₁ c hc hQ) - (frameLeftInversePath_hasDerivWithinAt T Q Q₁ c hc hQ hT hd), u.property.1, map_zero]) + (frameLeftInversePath_hasDerivWithinAt T Q Q₁ c hc hQ hT hd), + ((mem_transverseDerivatives T hT m (u : TimeLp T E)).mp u.property).1, map_zero]) + +@[simp] theorem transverseBackward_coe (u : transverseDerivatives T hT m) : + (transverseBackward T hT Q Q₁ c hc hQ hd m u : TimeLp T U) = + coordinateDerivative T hT Q Q₁ c hc hQ (u : TimeLp T E) := by rfl /-- The backward transport is the actual inverse on every fixed coordinate derivative. -/ theorem transverseBackward_forward (v : zeroTraceDerivatives (U := U) T hT) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1OperatorProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1OperatorProduct.lean index 0098da560a..25fad48629 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1OperatorProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1OperatorProduct.lean @@ -18,7 +18,7 @@ coefficient multiplier and terminal primitive. Its integral is identified with the literal pointwise product by absolute continuity and uniqueness of primitives. -/ -@[expose] public section +public section noncomputable section @@ -98,7 +98,7 @@ theorem operatorPath_absolutelyContinuous exact hl'.absolutelyContinuousOnInterval /-- The derivative of `A(t) Ju(t)`, constructed as an actual bounded L² operator. -/ -def productDerivative : TimeLp T E →L[ℝ] TimeLp T F := +@[expose] def productDerivative : TimeLp T E →L[ℝ] TimeLp T F := (timeMultiplier T hT A').comp (primitiveTimeLp T hT) + timeMultiplier T hT A /-- The product derivative has its literal Leibniz-rule representative. -/ @@ -115,7 +115,7 @@ theorem productDerivative_ae (u : TimeLp T E) : rw [hadd, ha', ha, hu] /-- The actual pointwise coefficient-times-primitive path. -/ -def productPrimitive (u : TimeLp T E) : ℝ → F := +@[expose] def productPrimitive (u : TimeLp T E) : ℝ → F := fun t => extendPath T hT A t (realPrimitive T u t) /-- Every such product has zero terminal trace. -/ @@ -200,8 +200,22 @@ theorem initialTrace_productDerivative [CompleteSpace E] [CompleteSpace F] HasDerivWithinAt (extendPath T hT A) (A' t) (Icc (0 : ℝ) T) t) (u : TimeLp T E) : initialTrace T hT (productDerivative T hT A A' u) = - A ⟨0, le_rfl, hT⟩ (initialTrace T hT u) := - terminalPrimitive_productDerivative T hT A A' hA u ⟨0, le_rfl, hT⟩ + A ⟨0, le_rfl, hT⟩ (initialTrace T hT u) := by + rw [initialTrace_apply, initialTrace_apply] + exact terminalPrimitive_productDerivative T hT A A' hA u ⟨0, le_rfl, hT⟩ + +private theorem productDerivative_norm_basic (u : TimeLp T E) : + ‖productDerivative T hT A A' u‖ ≤ + ‖A'‖ * ‖primitiveTimeLp T hT u‖ + ‖A‖ * ‖u‖ := by + simp only [productDerivative, add_apply, ContinuousLinearMap.comp_apply] + have hm (B : C(Icc (0 : ℝ) T, E →L[ℝ] F)) (v : TimeLp T E) : + ‖timeMultiplier T hT B v‖ ≤ ‖B‖ * ‖v‖ := by + calc + _ ≤ ‖timeMultiplier T hT B‖ * ‖v‖ := (timeMultiplier T hT B).le_opNorm v + _ ≤ _ := mul_le_mul_of_nonneg_right + (timeMultiplier_norm_le T hT B) (norm_nonneg v) + exact (norm_add_le _ _).trans + (add_le_add (hm A' _) (hm A u)) /-- A uniform bound on the actual derivative in terms of the coefficient and its derivative; the time primitive retains its sharp square-root bound. -/ @@ -209,15 +223,14 @@ theorem productDerivative_norm_le (u : TimeLp T E) : ‖productDerivative T hT A A' u‖ ≤ (‖A'‖ * Real.sqrt (T^2/2) + ‖A‖) * ‖u‖ := by have hp : ‖primitiveTimeLp T hT u‖ ≤ Real.sqrt (T^2/2) * ‖u‖ := by - apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).1 - rw [mul_pow, Real.sq_sqrt (by positivity)] - exact primitiveTimeLp_norm_sq_le T hT u - change ‖timeMultiplier T hT A' (primitiveTimeLp T hT u) + timeMultiplier T hT A u‖ ≤ _ + calc + _ ≤ ‖primitiveTimeLp (E := E) T hT‖ * ‖u‖ := + (primitiveTimeLp (E := E) T hT).le_opNorm u + _ ≤ _ := mul_le_mul_of_nonneg_right + (primitiveTimeLp_norm_le (E := E) T hT) (norm_nonneg u) calc - _ ≤ ‖timeMultiplier T hT A' (primitiveTimeLp T hT u)‖ + ‖timeMultiplier T hT A u‖ := - norm_add_le _ _ _ ≤ ‖A'‖ * ‖primitiveTimeLp T hT u‖ + ‖A‖ * ‖u‖ := - add_le_add (timeApply_bound T hT A' _) (timeApply_bound T hT A u) + productDerivative_norm_basic T hT A A' u _ ≤ ‖A'‖ * (Real.sqrt (T^2/2) * ‖u‖) + ‖A‖ * ‖u‖ := by apply add_le_add _ le_rfl apply mul_le_mul_of_nonneg_left _ (norm_nonneg A') diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1PointwiseBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1PointwiseBounds.lean index ce86404135..6b6fb59712 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1PointwiseBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1PointwiseBounds.lean @@ -16,7 +16,7 @@ Absolute continuity and the actual Bochner L² derivative give exact integral increments, square-root continuity, and initial/terminal trace bounds. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1Reconstruction.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1Reconstruction.lean index f546c6568f..df0a5f0011 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1Reconstruction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1Reconstruction.lean @@ -22,7 +22,7 @@ of `p` with derivative `q`, this is that representative. Thus parameter derivatives and all-order bounds pass through one fixed bounded linear map. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ open Set MeasureTheory ContinuousLinearMap EulerTimeLp EulerTerminalTimePrimitiv variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The actual time average, expressed using the terminal primitive's initial trace. -/ -def mean (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] E := +@[expose] def mean (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] E := (-T)⁻¹ • initialTrace T hT /-- The constant part of the reconstruction. -/ @@ -50,7 +50,7 @@ def derivativePart (T : ℝ) (hT : 0 ≤ T) : TimeLp T E →L[ℝ] C(Icc (0 : terminalPrimitive T hT - (valuePart T hT).comp (primitiveTimeLp T hT) /-- One fixed bounded linear map from the value/derivative pair to its continuous representative. -/ -def reconstruction (T : ℝ) (hT : 0 ≤ T) : +@[expose] def reconstruction (T : ℝ) (hT : 0 ≤ T) : (TimeLp T E × TimeLp T E) →L[ℝ] C(Icc (0 : ℝ) T, E) := (valuePart T hT).comp (fst ℝ (TimeLp T E) (TimeLp T E)) + (derivativePart T hT).comp (snd ℝ (TimeLp T E) (TimeLp T E)) @@ -60,7 +60,7 @@ omit [CompleteSpace E] in theorem reconstruction_apply (T : ℝ) (hT : 0 ≤ T) (p q : TimeLp T E) (t : Icc (0 : ℝ) T) : reconstruction T hT (p,q) t = - mean T hT p + (terminalPrimitive T hT q t - mean T hT (primitiveTimeLp T hT q)) := rfl + mean T hT p + (terminalPrimitive T hT q t - mean T hT (primitiveTimeLp T hT q)) := by rfl /-- Constant fields have their actual value as time average. -/ theorem mean_constantField (T : ℝ) (hT : 0 < T) (v : E) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1ReconstructionNaturality.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1ReconstructionNaturality.lean index a6d69d9ce7..154dca03df 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1ReconstructionNaturality.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1ReconstructionNaturality.lean @@ -18,7 +18,7 @@ It is an equality of the constructed operators, independent of any smoothness assumption on their inputs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1SobolevReconstruction.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1SobolevReconstruction.lean index 0c9c5b59d8..e95881cb4c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1SobolevReconstruction.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1SobolevReconstruction.lean @@ -21,7 +21,7 @@ section /-! Direct two-input linear bounds for genuine fixed Sobolev word blocks. -/ -@[expose] public section +public section noncomputable section @@ -103,7 +103,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeH1WeakPairing.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeH1WeakPairing.lean index 9a71fd9901..e673a9e3b0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeH1WeakPairing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeH1WeakPairing.lean @@ -18,7 +18,7 @@ tests. The identity follows from the proved primitive representation and does not posit a weak derivative as an additional assumption. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLp.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLp.lean index a5c3c100d8..9ed0d20977 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLp.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Actual Bochner L² time spaces and continuous-path embeddings used by maximal regularity. -/ -@[expose] public section +public section noncomputable section @@ -22,7 +22,7 @@ open MeasureTheory Set EulerVolterraConvolution open scoped Topology ENNReal /-- Lebesgue time measure restricted to the prescribed compact evolution interval. -/ -def timeMeasure (T : ℝ) : Measure ℝ := volume.restrict (Icc 0 T) +@[expose] def timeMeasure (T : ℝ) : Measure ℝ := volume.restrict (Icc 0 T) /-- The actual compact time measure is finite. -/ instance timeMeasureFinite (T : ℝ) : IsFiniteMeasure (timeMeasure T) := by @@ -41,7 +41,8 @@ theorem path_memLp (T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, E)) : (Filter.Eventually.of_forall (extendPath_norm_le T hT f)) /-- A continuous time path represented in the actual Bochner L² space. -/ -def pathLp (T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, E)) : TimeLp T E := +@[expose] def pathLp (T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, E)) : + TimeLp T E := (path_memLp T hT f).toLp (extendPath T hT f) /-- The Bochner path representative is the genuine clamped continuous path almost everywhere. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationForcing.lean index 6e73af5baf..edf3476bf9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationForcing.lean @@ -25,7 +25,7 @@ This module gives its genuine parameter regularity and factorial estimate, with the explicit amplitude needed by the actual Gram inverse. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ variable {P U E : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The literal right side of the projected strong acceleration equation. -/ -def forcing (T : ℝ) (hT : 0 ≤ T) +@[expose] def forcing (T : ℝ) (hT : 0 ≤ T) (Q Q₁ : P → C(Icc (0 : ℝ) T, U →L[ℝ] E)) (f : P → TimeLp T E) (v : P → TimeLp T U) (x : P) : TimeLp T U := (timeMultiplier T hT (Q x)).adjoint diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationSobolev.lean index 437943edf6..20daf4ccd0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpAccelerationSobolev.lean @@ -24,7 +24,7 @@ section /-! Actual projected acceleration in the same fixed Sobolev word blocks. -/ -@[expose] public section +public section noncomputable section @@ -109,7 +109,7 @@ The genuine continuous Gram solve incurs one factorial shift at the original radius. Time endpoint values are included in the continuous-path norm. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpBoundedMap.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpBoundedMap.lean index 035ac77384..aba2579db1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpBoundedMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpBoundedMap.lean @@ -18,7 +18,7 @@ terminal integration and initial trace. These identities let spatial translations and their difference quotients act on a fixed time Hilbert space. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ variable {E F G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] /-- The actual pointwise lift of a bounded spatial map to Bochner L² time. -/ -def timeLift (T : ℝ) (A : E →L[ℝ] F) : TimeLp T E →L[ℝ] TimeLp T F := +@[expose] def timeLift (T : ℝ) (A : E →L[ℝ] F) : TimeLp T E →L[ℝ] TimeLp T F := A.compLpL 2 (timeMeasure T) theorem timeLift_ae (T : ℝ) (A : E →L[ℝ] F) (u : TimeLp T E) : @@ -85,7 +85,8 @@ theorem timeLift_norm_map (T : ℝ) (A : E →L[ℝ] F) (Lp.norm_le_norm_of_ae_le (he.mono (fun _ h => h.ge))) /-- The actual pointwise lift of a linear spatial isometry. -/ -def timeLiftIsometry (T : ℝ) (A : E →ₗᵢ[ℝ] F) : TimeLp T E →ₗᵢ[ℝ] TimeLp T F where +@[expose] def timeLiftIsometry (T : ℝ) (A : E →ₗᵢ[ℝ] F) : + TimeLp T E →ₗᵢ[ℝ] TimeLp T F where toLinearMap := (timeLift T A.toContinuousLinearMap).toLinearMap norm_map' := timeLift_norm_map T A.toContinuousLinearMap A.norm_map diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientGevrey.lean index a197741342..80d1f059ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientGevrey.lean @@ -20,7 +20,7 @@ path. These are bounds on genuine parameter derivatives of that operator, including the H¹ moving-frame transport used in the variational inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientMap.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientMap.lean index 11fb1c6649..6679d09bf6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpCoefficientMap.lean @@ -17,7 +17,7 @@ parameter derivatives of time-dependent coefficients give actual operator-norm derivatives, rather than an assumed regular family of solution operators. -/ -@[expose] public section +public section noncomputable section @@ -65,16 +65,18 @@ theorem timeMultiplier_smul (r : ℝ) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : /-- The operator norm is bounded by the actual uniform coefficient norm. -/ theorem timeMultiplier_norm (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : ‖timeMultiplier T hT A‖ ≤ ‖A‖ := - ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg A) (timeApply_bound T hT A) + timeMultiplier_norm_le T hT A /-- The actual bounded linear coefficient-to-Bochner-multiplier map. -/ -def coefficientLinear : C(Icc (0 : ℝ) T, E →L[ℝ] F) →ₗ[ℝ] (TimeLp T E →L[ℝ] TimeLp T F) where +@[expose] def coefficientLinear : + C(Icc (0 : ℝ) T, E →L[ℝ] F) →ₗ[ℝ] (TimeLp T E →L[ℝ] TimeLp T F) where toFun := timeMultiplier T hT map_add' := timeMultiplier_add T hT map_smul' := timeMultiplier_smul T hT /-- The coefficient map is bounded for the actual uniform and operator norms. -/ -def coefficientMap : C(Icc (0 : ℝ) T, E →L[ℝ] F) →L[ℝ] (TimeLp T E →L[ℝ] TimeLp T F) where +@[expose] def coefficientMap : C(Icc (0 : ℝ) T, E →L[ℝ] F) →L[ℝ] + (TimeLp T E →L[ℝ] TimeLp T F) where toLinearMap := coefficientLinear T hT cont := AddMonoidHomClass.continuous_of_bound (coefficientLinear T hT) 1 (fun A => by change ‖timeMultiplier T hT A‖ ≤ (1 : ℝ) * ‖A‖ diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramGevrey.lean index 0795a17dfb..42192c95ed 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramGevrey.lean @@ -19,7 +19,7 @@ for the inverse appearing in the strong acceleration equation. No derivative bounds on a pre-existing inverse are assumed. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerTimeLp EulerVolterraConvolut EulerTransverseGramPath EulerGevrey /-- A polynomial top constant for coefficient amplitude `3 C²` and forcing amplitude `D`. -/ -def gramCost (c C D : ℝ) : ℝ := 1 + c⁻¹ * (3*C^2+D+1) +@[expose] def gramCost (c C D : ℝ) : ℝ := 1 + c⁻¹ * (3*C^2+D+1) variable {P U E : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramInverse.lean index b378b38b7f..50b79cab80 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramInverse.lean @@ -23,7 +23,7 @@ matrix/Hilbert Gram inverse. This identifies the strong-equation inverse with the same operator to which the genuine parameter estimates apply. -/ -@[expose] public section +public section noncomputable section @@ -42,7 +42,7 @@ variable {U E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The genuine Bochner Gram operator, formed from the actual frame multiplier. -/ -def gramOperator (T : ℝ) (hT : 0 ≤ T) (Q : C(Icc (0 : ℝ) T, U →L[ℝ] E)) : +@[expose] def gramOperator (T : ℝ) (hT : 0 ≤ T) (Q : C(Icc (0 : ℝ) T, U →L[ℝ] E)) : TimeLp T U →L[ℝ] TimeLp T U := (timeMultiplier T hT Q).adjoint.comp (timeMultiplier T hT Q) @@ -64,7 +64,7 @@ theorem gramOperator_coercive (T : ℝ) (hT : 0 ≤ T) simp only [gramOperator, comp_apply, adjoint_inner_left] /-- The actual coercive inverse of the time Gram operator. -/ -def gramSolver (T : ℝ) (hT : 0 ≤ T) +@[expose] def gramSolver (T : ℝ) (hT : 0 ≤ T) (Q : C(Icc (0 : ℝ) T, U →L[ℝ] E)) (c : ℝ) (hc : 0 < c) (hQ : ∀ t v, c * ‖v‖ ^ 2 ≤ ‖Q t v‖ ^ 2) : TimeLp T U →L[ℝ] TimeLp T U := coerciveInverse (gramOperator T hT Q) c hc (gramOperator_coercive T hT Q c hQ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramSobolev.lean index 9b95855f1f..969b7fc657 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpGramSobolev.lean @@ -17,7 +17,7 @@ The coefficient family alone pays a fixed Sobolev cost. The actual right side and solution are measured in the identical ordered-word blocks. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open Set InnerProductSpace ContinuousLinearMap EulerTimeLp EulerCoerciveProjecti open scoped ContDiff /-- Polynomial cost of the actual Gram inverse at one fixed Sobolev order. -/ -def gramBlockCost (ι : Type*) [Fintype ι] (q : ℕ) (c Rc C D : ℝ) : ℝ := +@[expose] def gramBlockCost (ι : Type*) [Fintype ι] (q : ℕ) (c Rc C D : ℝ) : ℝ := inverseBlockCost ι q c⁻¹ Rc (3*C^2) D variable {P U E ι : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpLinearity.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpLinearity.lean index 5ab96301ba..26ae0a60f2 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpLinearity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpLinearity.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TimeLp /-! The actual continuous-path embedding as a bounded linear time-space map. -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,8 @@ theorem pathLp_smul (T : ℝ) (hT : 0 ≤ T) (r : ℝ) (f : C(Icc (0 : ℝ) T, E rfl /-- The genuine continuous-path to Bochner L² embedding is a bounded linear map. -/ -def pathLpOperator (T : ℝ) (hT : 0 ≤ T) : C(Icc (0 : ℝ) T, E) →L[ℝ] TimeLp T E := +@[expose] def pathLpOperator (T : ℝ) (hT : 0 ≤ T) : + C(Icc (0 : ℝ) T, E) →L[ℝ] TimeLp T E := ({ toFun := pathLp T hT map_add' := pathLp_add T hT map_smul' := fun r f => by simpa only [RingHom.id_apply] using pathLp_smul T hT r f } : @@ -53,6 +54,6 @@ def pathLpOperator (T : ℝ) (hT : 0 ≤ T) : C(Icc (0 : ℝ) T, E) →L[ℝ] Ti /-- The bounded embedding is exactly the actual L² equivalence class of the path. -/ theorem pathLpOperator_apply (T : ℝ) (hT : 0 ≤ T) (f : C(Icc (0 : ℝ) T, E)) : - pathLpOperator T hT f = pathLp T hT f := rfl + pathLpOperator T hT f = pathLp T hT f := by rfl end EulerTimeLp diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpMap.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpMap.lean index a2ef4de10f..c368db2830 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpMap.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Ring.Star /-! Exact bounded-map compatibility for the actual continuous-path to Bochner L² inclusion. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpMultiplier.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpMultiplier.lean index 630e762b66..fd289a507b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpMultiplier.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpMultiplier.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TimeLp /-! Actual bounded time-dependent linear operators on Bochner L² time fields. -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ theorem timeApply_memLp (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ (mul_le_mul_of_nonneg_right (extendPath_norm_le T hT A t) (norm_nonneg (u t))) /-- The genuine pointwise time-dependent operator action, represented in Bochner L². -/ -def timeApply (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) +@[expose] def timeApply (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) (u : TimeLp T E) : TimeLp T F := (timeApply_memLp T hT A u).toLp (fun t => extendPath T hT A t (u t)) @@ -45,7 +45,7 @@ theorem timeApply_ae (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ (timeApply_memLp T hT A u).coeFn_toLp /-- Actual time-dependent bounded operator application is linear in the time field. -/ -def timeApplyLinear (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : +@[expose] def timeApplyLinear (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : TimeLp T E →ₗ[ℝ] TimeLp T F where toFun := timeApply T hT A map_add' u v := by @@ -73,10 +73,22 @@ theorem timeApply_bound (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ (mul_le_mul_of_nonneg_right (extendPath_norm_le T hT A t) (norm_nonneg (u t))) /-- The bounded actual time multiplier on Bochner L² spaces. -/ -def timeMultiplier (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : +@[expose] def timeMultiplier (T : ℝ) (hT : 0 ≤ T) + (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : TimeLp T E →L[ℝ] TimeLp T F := (timeApplyLinear T hT A).mkContinuous ‖A‖ (timeApply_bound T hT A) +/-- The operator norm of time multiplication is bounded by the coefficient path. -/ +theorem timeMultiplier_norm_le (T : ℝ) (hT : 0 ≤ T) + (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) : ‖timeMultiplier T hT A‖ ≤ ‖A‖ := + (timeApplyLinear T hT A).mkContinuous_norm_le (norm_nonneg A) (timeApply_bound T hT A) + +theorem timeMultiplier_bound (T : ℝ) (hT : 0 ≤ T) + (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) (u : TimeLp T E) : + ‖timeMultiplier T hT A u‖ ≤ ‖A‖ * ‖u‖ := + ((timeMultiplier T hT A).le_opNorm u).trans + (mul_le_mul_of_nonneg_right (timeMultiplier_norm_le T hT A) (norm_nonneg u)) + /-- The continuous linear time multiplier agrees with literal pointwise application. -/ theorem timeMultiplier_ae (T : ℝ) (hT : 0 ≤ T) (A : C(Icc (0 : ℝ) T, E →L[ℝ] F)) (u : TimeLp T E) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpPairing.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpPairing.lean index 6ebcd2c58d..6ddb32fff1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpPairing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpPairing.lean @@ -11,7 +11,7 @@ public import Mathlib.MeasureTheory.Function.L2Space /-! Actual integral pairings and their strong limits for metric energy passage. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpStrongOperators.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpStrongOperators.lean index 04947dc960..76dcf39e20 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpStrongOperators.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpStrongOperators.lean @@ -13,7 +13,7 @@ import Mathlib.MeasureTheory.Function.L2Space /-! Genuine strong operator approximation on Bochner L² time spaces. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubinterval.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubinterval.lean index aea088f5da..9c217e3c91 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubinterval.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubinterval.lean @@ -12,7 +12,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TimeLpPairing /-! Strong Bochner energy passage on every genuine subinterval of the original time interval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubintervalBound.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubintervalBound.lean index d086c7ae30..0b1c1052ae 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubintervalBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeLpSubintervalBound.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Actual L² forcing bounds imply continuous scalar integral majorants on every time subinterval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimePathGluing.lean b/LeanPool/NavierStokesAndEuler/Euler/TimePathGluing.lean index 76a00039c3..7afec5ce9a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimePathGluing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimePathGluing.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.VolterraConvolution /-! Exact pasting of actual continuous solution paths on adjacent compact time intervals. -/ -@[expose] public section +public section noncomputable section @@ -49,7 +49,7 @@ theorem glueFunction_continuous (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) exact endpoint_match a b ha hb u v hmatch /-- The actual continuous path on the union of the two adjacent time intervals. -/ -def gluePath (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) +@[expose] def gluePath (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (u : C(Icc (0 : ℝ) a, E)) (v : C(Icc (0 : ℝ) b, E)) (hmatch : u ⟨a, ha, le_rfl⟩ = v ⟨0, le_rfl, hb⟩) : C(Icc (0 : ℝ) (a+b), E) := ⟨fun t => glueFunction a b ha hb u v t.val, (glueFunction_continuous a b ha hb u v hmatch).comp diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeWeakBoundary.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeWeakBoundary.lean index 0b2e4697be..eed9dfb825 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeWeakBoundary.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeWeakBoundary.lean @@ -16,7 +16,7 @@ both an absolutely continuous representative and its initial trace. The boundary value is a conclusion of testing against all terminal-zero H¹ paths. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TimeWeakDerivative.lean b/LeanPool/NavierStokesAndEuler/Euler/TimeWeakDerivative.lean index c0ebc94fbb..c86d7ebe2c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TimeWeakDerivative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TimeWeakDerivative.lean @@ -19,7 +19,7 @@ Integration by parts and the kernel of its initial trace identify the strong momentum representative used by the mean and transverse variational inverses. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransportL2Time.lean b/LeanPool/NavierStokesAndEuler/Euler/TransportL2Time.lean index f50b92167e..d50572fe6a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransportL2Time.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransportL2Time.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevMetricTransport /-! Genuine time-continuous transport operators at the H¹→L² metric-energy level. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseActivationSelection.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseActivationSelection.lean index acb30a38a3..9bfd2131ec 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseActivationSelection.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseActivationSelection.lean @@ -45,7 +45,7 @@ and `2*L` when `L*T ≥ 1`. These are the same energy bounds needed for the piecewise linear terminal ramp in the activation argument. -/ -@[expose] public section +public section noncomputable section @@ -197,7 +197,7 @@ end end -@[expose] public section +public section noncomputable section @@ -247,7 +247,7 @@ def operatorEvaluation (A : C(Icc (0 : ℝ) T, U →L[ℝ] E)) : omit [CompleteSpace E] in @[simp] theorem operatorEvaluation_apply (A : C(Icc (0 : ℝ) T, U →L[ℝ] E)) (Y : U) (t : Icc (0 : ℝ) T) : - operatorEvaluation T A Y t = A t Y := rfl + operatorEvaluation T A Y t = A t Y := by rfl /-- Trial frame, given by `⟨fun t => ramp T L t • P t, ((ramp_continuous T L).comp continuous_subtype_val).smul P.continuous⟩`. -/ @@ -458,7 +458,7 @@ The derivative bound depends on the ray equation through `‖m'‖/‖m‖`, and therefore costs only the parent matrix norm, with no deformation-gradient loss. -/ -@[expose] public section +public section noncomputable section @@ -633,7 +633,7 @@ end end -@[expose] public section +public section noncomputable section @@ -817,7 +817,7 @@ end end -@[expose] public section +public section noncomputable section @@ -834,10 +834,10 @@ variable {U E V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [CompleteSpace V] /-- Activation constant, given by `4 + 64 * CM ^ 2 + 2 * CH`. -/ -def activationConstant (CM CH : ℝ) : ℝ := 4 + 64 * CM ^ 2 + 2 * CH +@[expose] def activationConstant (CM CH : ℝ) : ℝ := 4 + 64 * CM ^ 2 + 2 * CH /-- The actual terminal matrix after subtracting the prescribed shear. -/ -def terminalPerturbation (T : ℝ) (hT : 0 ≤ T) (R : V →ₗᵢ[ℝ] E) +@[expose] def terminalPerturbation (T : ℝ) (hT : 0 ≤ T) (R : V →ₗᵢ[ℝ] E) (M : C(Icc (0 : ℝ) T, E →L[ℝ] E)) (p q : V) (h : ℝ) : V →L[ℝ] V := R.toContinuousLinearMap.adjoint.comp ((M ⟨T, hT, le_rfl⟩).comp R.toContinuousLinearMap) - h • rankOne ℝ q p diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseCoordinateRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseCoordinateRegularity.lean index 910e5f4ecd..1d92921e61 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseCoordinateRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseCoordinateRegularity.lean @@ -19,7 +19,7 @@ and differentiating the reconstructed displacement gives the exact kinetic coordinate identity used in the strong transverse equation. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ def coordinatePrimitive (u : TimeLp T E) : ℝ → U := productPrimitive T hT (frameLeftInversePath T Q c hc hQ) u /-- The actual L² derivative of the canonical coordinates. -/ -def coordinateDerivative (u : TimeLp T E) : TimeLp T U := +@[expose] def coordinateDerivative (u : TimeLp T E) : TimeLp T U := productDerivative T hT (frameLeftInversePath T Q c hc hQ) (frameLeftInverseDerivativePath T Q Q₁ c hc hQ) u @@ -83,7 +83,9 @@ theorem terminalPrimitive_coordinateDerivative (u : TimeLp T E) (t : Icc (0 : theorem coordinatePrimitive_initial (m : Icc (0 : ℝ) T → E) (u : transverseDerivatives T hT m) : coordinatePrimitive T hT Q c hc hQ (u : TimeLp T E) 0 = 0 := by - have hu : realPrimitive T (u : TimeLp T E) 0 = 0 := u.property.1 + have hu : realPrimitive T (u : TimeLp T E) 0 = 0 := by + simpa only [initialTrace_apply, terminalPrimitive_apply] using + ((mem_transverseDerivatives T hT m (u : TimeLp T E)).mp u.property).1 simp only [coordinatePrimitive, productPrimitive, hu, map_zero] /-- The terminal coordinate trace vanishes identically. -/ @@ -151,7 +153,7 @@ theorem transverse_range (m : Icc (0 : ℝ) T → E) (hRange : ∀ t η, ⟪m t, η⟫_ℝ = 0 → ∃ x : U, Q t x = η) (u : transverseDerivatives T hT m) (t : Icc (0 : ℝ) T) : ∃ x : U, Q t x = realPrimitive T (u : TimeLp T E) t := - hRange t _ (u.property.2 t) + hRange t _ (((mem_transverseDerivatives T hT m (u : TimeLp T E)).mp u.property).2 t) /-- Canonical coordinates reconstruct every admissible transverse displacement. -/ theorem coordinatePrimitive_reconstruct (m : Icc (0 : ℝ) T → E) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointBounds.lean index bf5b70f950..4cddb445a3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointBounds.lean @@ -15,7 +15,7 @@ Both primitives, the actual affine trial, and the fixed-coordinate form are estimated in their genuine Bochner and operator norms. -/ -@[expose] public section +public section noncomputable section @@ -157,7 +157,7 @@ theorem energyOperator_sub_norm_le (H H' : C(Icc (0 : ℝ) T, E →L[ℝ] E)) : dirichlet_sub_norm_le T hT _ (initialPrimitive_norm_le_time T hT) H H' /-- The affine coordinate trial costs a fixed polynomial in time and its reciprocal. -/ -def affineCost (T : ℝ) : ℝ := (1+T) * |T⁻¹| +@[expose] def affineCost (T : ℝ) : ℝ := (1+T) * |T⁻¹| omit [CompleteSpace U] [CompleteSpace E] in theorem affineTrial_norm_le (A A₁ : C(Icc (0 : ℝ) T, U →L[ℝ] E)) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointCoordinates.lean index 8ed7c5a40c..515de901ff 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointCoordinates.lean @@ -21,7 +21,7 @@ Equation (10), already proved for that solution, provides its genuine time derivative; the bounded H¹ reconstruction recovers the actual history path. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEnergy.lean index 0fbc790ee4..6a5d96cc29 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEnergy.lean @@ -26,7 +26,7 @@ extension is constructed by the inverse of the form on the closed zero-trace space. No stationary extension or Dirichlet-to-Neumann map is an input. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ def stationaryPart : E →L[ℝ] E := ContinuousLinearMap.id ℝ E - S.subtypeL.comp (correction S A c hc hA) theorem stationaryPart_eq (x : E) : - stationaryPart S A c hc hA x = x - (correction S A c hc hA x : E) := rfl + stationaryPart S A c hc hA x = x - (correction S A c hc hA x : E) := by rfl theorem correction_equation (x : E) (v : S) : ⟪A (correction S A c hc hA x : E), (v : E)⟫_ℝ = ⟪A x, (v : E)⟫_ℝ := by @@ -174,7 +174,7 @@ end end -@[expose] public section +public section noncomputable section @@ -193,7 +193,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (m : Icc (0 : ℝ) T → E) (H : C(Icc (0 : ℝ) T, E →L[ℝ] E)) /-- The physical kinetic-minus-potential form on all initial-zero H¹ paths. -/ -def energyOperator : TimeLp T E →L[ℝ] TimeLp T E := +@[expose] def energyOperator : TimeLp T E →L[ℝ] TimeLp T E := dirichletOperator (initialPrimitiveTimeLp T hT) (timeMultiplier T hT H) theorem energyOperator_inner (u v : TimeLp T E) : @@ -244,11 +244,13 @@ theorem initialPrimitive_transverse (u : transverseDerivatives T hT m) (t : Icc (0 : ℝ) T) : initialPrimitive T hT (u : TimeLp T E) t = terminalPrimitive T hT (u : TimeLp T E) t := by - rw [initialPrimitive_eq_terminal_sub, u.property.1, sub_zero] + rw [initialPrimitive_eq_terminal_sub, + ((mem_transverseDerivatives T hT m (u : TimeLp T E)).mp u.property).1, sub_zero] omit [CompleteSpace E] in theorem initialPrimitiveTimeLp_transverse (u : transverseDerivatives T hT m) : initialPrimitiveTimeLp T hT (u : TimeLp T E) = transversePrimitive T hT m u := by + rw [transversePrimitive_apply] change pathLpOperator T hT (initialPrimitive T hT (u : TimeLp T E)) = pathLpOperator T hT (terminalPrimitive T hT (u : TimeLp T E)) congr 1 @@ -265,7 +267,8 @@ def endpointDerivative (L : U →L[ℝ] TimeLp T E) : U →L[ℝ] TimeLp T E := (1 / 2) (by norm_num) (energyOperator_coercive T hT H K hK hH hsmall) L /-- The constructed physical stationary path. -/ -def endpointDisplacement (L : U →L[ℝ] TimeLp T E) : U →L[ℝ] C(Icc (0 : ℝ) T, E) := +@[expose] def endpointDisplacement (L : U →L[ℝ] TimeLp T E) : + U →L[ℝ] C(Icc (0 : ℝ) T, E) := (initialPrimitive T hT).comp (endpointDerivative T hT m H K hK hH hsmall L) /-- The genuine endpoint quadratic form represented by a bounded operator. -/ @@ -309,7 +312,7 @@ theorem endpointDisplacement_tangent (L : U →L[ℝ] TimeLp T E) endpointDerivative_sub_mem T hT m H K hK hH hsmall L Y⟩ have hv : ⟪m t, initialPrimitive T hT (v : TimeLp T E) t⟫_ℝ = 0 := by rw [initialPrimitive_transverse] - exact v.property.2 t + exact ((mem_transverseDerivatives T hT m (v : TimeLp T E)).mp v.property).2 t change ⟪m t, initialPrimitive T hT (endpointDerivative T hT m H K hK hH hsmall L Y - L Y) t⟫_ℝ = 0 at hv rw [map_sub, ContinuousMap.sub_apply, inner_sub_right, hL, sub_zero] at hv diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEquation.lean index f0de61ee8d..9b6dcee2be 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointEquation.lean @@ -24,7 +24,7 @@ an every-time derivative; the actual Gram inverse then differentiates the coordinate velocity. These are properties of the constructed weak solution. -/ -@[expose] public section +public section noncomputable section @@ -187,7 +187,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointParameter.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointParameter.lean index d92ad92687..ab570f7687 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointParameter.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointParameter.lean @@ -28,7 +28,7 @@ coercive solve. Full-range frame transport proves exact equality with the physical endpoint solution, rather than introducing a second unrelated solve. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,8 @@ variable (T : ℝ) (hT : 0 ≤ T) include hd in theorem fixedFrameDerivative_trace_zero (v : zeroTraceDerivatives (U := U) T hT) : initialTrace T hT (fixedFrameDerivative T hT Q Q₁ v) = 0 := by - have hv : initialTrace T hT (v : TimeLp T U) = 0 := v.property + have hv : initialTrace T hT (v : TimeLp T U) = 0 := + (mem_zeroTraceDerivatives T hT _).1 v.property change initialTrace T hT (productDerivative T hT Q Q₁ (v : TimeLp T U)) = 0 rw [initialTrace_productDerivative T hT Q Q₁ hd, hv, map_zero] @@ -118,8 +119,9 @@ theorem fixedEndpointDerivative_sub_mem (L : V →L[ℝ] TimeLp T E) (Y : V) : fixedEndpointDerivative T hT Q Q₁ H c hc hQ hd K hK hH hsmall L Y - L Y ∈ transverseDerivatives T hT m := by let r := fixedEndpointCorrection T hT Q Q₁ H c hc hQ hd K hK hH hsmall L Y - have hr : fixedFrameDerivative T hT Q Q₁ r ∈ transverseDerivatives T hT m := - (transverseForward T hT Q Q₁ hd m hm r).property + have hr : fixedFrameDerivative T hT Q Q₁ r ∈ transverseDerivatives T hT m := by + rw [fixedFrameDerivative_apply] + simpa only [transverseForward_coe] using (transverseForward T hT Q Q₁ hd m hm r).property have he : fixedEndpointDerivative T hT Q Q₁ H c hc hQ hd K hK hH hsmall L Y - L Y = -(fixedFrameDerivative T hT Q Q₁ r) := by change (L Y - fixedFrameDerivative T hT Q Q₁ r) - L Y = _ @@ -134,6 +136,7 @@ theorem fixedEndpointDerivative_physical_orthogonal (L : V →L[ℝ] TimeLp T E) (v : TimeLp T E)⟫_ℝ = 0 := by have hv := congrArg (fun z : transverseDerivatives T hT m => (z : TimeLp T E)) (transverseForward_backward T hT Q Q₁ c hc hQ hd m hm hRange v) + simp only [transverseForward_coe] at hv change fixedFrameDerivative T hT Q Q₁ (transverseBackward T hT Q Q₁ c hc hQ hd m v) = (v : TimeLp T E) at hv rw [← hv] @@ -176,7 +179,7 @@ end end -@[expose] public section +public section noncomputable section @@ -269,7 +272,7 @@ section AffineTrial variable (A A₁ : C(Icc (0 : ℝ) T, U →L[ℝ] E)) /-- The exact derivative of `(t/T) Q(t) ξT`. -/ -def affineTrial : U →L[ℝ] TimeLp T E := +@[expose] def affineTrial : U →L[ℝ] TimeLp T E := (initialProductDerivative T hT A A₁).comp ((constantFieldOperator T hT).comp (T⁻¹ • ContinuousLinearMap.id ℝ U)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointVelocity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointVelocity.lean index 45147f328f..8b3579bb73 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointVelocity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseEndpointVelocity.lean @@ -30,7 +30,7 @@ map is obtained from the weak equation and the true time primitive. Its continuous representative and derivative are conclusions, not extra data. -/ -@[expose] public section +public section noncomputable section @@ -51,7 +51,7 @@ variable (T : ℝ) (hT : 0 ≤ T) (H : C(Icc (0 : ℝ) T, E →L[ℝ] E)) /-- The literal derivative of Q*η_t for the homogeneous stationary equation. -/ -def initialMomentumForcing : TimeLp T E →L[ℝ] TimeLp T U := +@[expose] def initialMomentumForcing : TimeLp T E →L[ℝ] TimeLp T U := (timeMultiplier T hT Q₁).adjoint - (timeMultiplier T hT Q).adjoint.comp ((timeMultiplier T hT H).comp (initialPrimitiveTimeLp T hT)) @@ -87,9 +87,7 @@ theorem initialMomentum_weak -⟪initialMomentumForcing T hT Q Q₁ H u, primitiveTimeLp T hT v⟫_ℝ := by have ht := hu ⟨productDerivative T hT Q Q₁ v, productDerivative_mem_transverse T hT Q Q₁ hd m hm v hv⟩ - change ⟪u, productDerivative T hT Q Q₁ v⟫_ℝ - - ⟪timeMultiplier T hT H (initialPrimitiveTimeLp T hT u), - primitiveTimeLp T hT (productDerivative T hT Q Q₁ v)⟫_ℝ = 0 at ht + simp only [transversePrimitive_apply] at ht rw [primitiveTimeLp_productDerivative T hT Q Q₁ hd] at ht simp only [productDerivative, add_apply, comp_apply, inner_add_right] at ht simp only [momentum, initialMomentumForcing, sub_apply, comp_apply, @@ -103,7 +101,7 @@ def terminalMomentum : TimeLp T E →L[ℝ] U := (primitiveTimeLp T hT).comp (initialMomentumForcing T hT Q Q₁ H)) /-- The canonical momentum representative, including both time endpoints. -/ -def momentumPath (u : TimeLp T E) (t : ℝ) : U := +@[expose] def momentumPath (u : TimeLp T E) (t : ℝ) : U := realPrimitive T (initialMomentumForcing T hT Q Q₁ H u) t + terminalMomentum T hT Q Q₁ H u @@ -192,7 +190,7 @@ All time boundary terms are obtained from absolute continuity and the genuine H¹ coordinate reconstruction. -/ -@[expose] public section +public section noncomputable section @@ -322,7 +320,7 @@ end end -@[expose] public section +public section noncomputable section @@ -350,13 +348,13 @@ theorem initialCoordinates_continuous (u : TimeLp T E) : (initialRealPrimitive_continuous T u) /-- Coordinate velocity path, constructed using `extendPath`. -/ -def coordinateVelocityPath (u : TimeLp T E) (t : ℝ) : U := +@[expose] def coordinateVelocityPath (u : TimeLp T E) (t : ℝ) : U := extendPath T hT (gramInversePath T Q c hc hQ) t (momentumPath T hT Q Q₁ H u t - extendPath T hT (mixedPath T Q Q₁) t (initialCoordinates T hT Q c hc hQ u t)) /-- Physical velocity path, constructed using `extendPath`. -/ -def physicalVelocityPath (u : TimeLp T E) (t : ℝ) : E := +@[expose] def physicalVelocityPath (u : TimeLp T E) (t : ℝ) : E := extendPath T hT Q₁ t (initialCoordinates T hT Q c hc hQ u t) + extendPath T hT Q t (coordinateVelocityPath T hT Q Q₁ c hc hQ H u t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedClassical.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedClassical.lean index a217b87b29..600b272658 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedClassical.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedClassical.lean @@ -19,7 +19,7 @@ velocity therefore has its actual derivative throughout the closed interval. The displacement keeps both zero endpoint conditions. -/ -@[expose] public section +public section noncomputable section @@ -44,7 +44,7 @@ variable {U E : Type*} /-- Classical acceleration, constructed using `EulerContinuousGramAcceleration.accelerationPath`. -/ -def classicalAcceleration (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T,U) := +@[expose] def classicalAcceleration (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T,U) := EulerContinuousGramAcceleration.accelerationPath T Q Q₁ c hc hQ (velocityPath T hT Q Q₁ H c hc hQ hd K hK hH hsmall (pathLp T hT f)) f @@ -55,11 +55,11 @@ def displacementPath (f : TimeLp T E) : C(Icc (0 : ℝ) T,U) := /-- Physical velocity path, given by `multiplier Q (velocityPath T hT Q Q₁ H c hc hQ hd K hK hH hsmall (pathLp T hT f))`. -/ -def physicalVelocityPath (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T,E) := +@[expose] def physicalVelocityPath (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T,E) := multiplier Q (velocityPath T hT Q Q₁ H c hc hQ hd K hK hH hsmall (pathLp T hT f)) /-- Physical derivative path, constructed using `multiplier`. -/ -def physicalDerivativePath (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T,E) := +@[expose] def physicalDerivativePath (f : C(Icc (0 : ℝ) T, E)) : C(Icc (0 : ℝ) T,E) := multiplier Q₁ (velocityPath T hT Q Q₁ H c hc hQ hd K hK hH hsmall (pathLp T hT f)) + multiplier Q (classicalAcceleration T hT Q Q₁ H c hc hQ hd K hK hH hsmall f) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedEvolution.lean index 8b2de4cd34..3b2c1a3a01 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedEvolution.lean @@ -19,7 +19,7 @@ proves it is the derivative of the solved coordinate velocity; bounded H¹ reconstruction then supplies the actual continuous history path. -/ -@[expose] public section +public section noncomputable section @@ -46,24 +46,25 @@ variable {U E : Type*} /-- Velocity Lᵖ, given by `(zeroTraceDerivatives (U := U) T hT).subtypeL.comp (fixedFrameSolver T hT Q Q₁ H c hc hQ hd K hK hH hsmall)`. -/ -def velocityLp : TimeLp T E →L[ℝ] TimeLp T U := +@[expose] def velocityLp : TimeLp T E →L[ℝ] TimeLp T U := (zeroTraceDerivatives (U := U) T hT).subtypeL.comp (fixedFrameSolver T hT Q Q₁ H c hc hQ hd K hK hH hsmall) /-- Acceleration Lᵖ as an element of `TimeLp T E →L[ℝ] TimeLp T U`. -/ -def accelerationLp : TimeLp T E →L[ℝ] TimeLp T U := +@[expose] def accelerationLp : TimeLp T E →L[ℝ] TimeLp T U := (gramSolver T hT Q c hc hQ).comp ((timeMultiplier T hT Q).adjoint.comp (ContinuousLinearMap.id ℝ (TimeLp T E)-(2 : ℝ) • (timeMultiplier T hT Q₁).comp (velocityLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall))) /-- Velocity path as an element of `TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T,U)`. -/ -def velocityPath : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T,U) := +@[expose] def velocityPath : TimeLp T E →L[ℝ] C(Icc (0 : ℝ) T,U) := (valuePart T hT).comp (velocityLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall) + (derivativePart T hT).comp (accelerationLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall) theorem velocityLp_zero_trace (f : TimeLp T E) : initialTrace T hT (velocityLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall f) = 0 := - (fixedFrameSolver T hT Q Q₁ H c hc hQ hd K hK hH hsmall f).property + (mem_zeroTraceDerivatives T hT _).1 + (fixedFrameSolver T hT Q Q₁ H c hc hQ hd K hK hH hsmall f).property theorem accelerationLp_ae (f : TimeLp T E) : (accelerationLp T hT Q Q₁ H c hc hQ hd K hK hH hsmall f : ℝ → U) =ᵐ[timeMeasure T] diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSobolev.lean index ebed64f57c..91840a21b1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSobolev.lean @@ -48,7 +48,7 @@ interval length. They control genuine Fréchet derivatives of the concrete fixed-space operator and forcing, without a packaged jet or recurrence input. -/ -@[expose] public section +public section noncomputable section @@ -68,10 +68,10 @@ variable {P U E : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The polynomial coefficient cost of taking a physical derivative. -/ -def derivativeCost (T C₀ C₁ : ℝ) : ℝ := T*C₁+C₀ +@[expose] def derivativeCost (T C₀ C₁ : ℝ) : ℝ := T*C₁+C₀ /-- The polynomial coefficient cost of the transported variational form. -/ -def formCost (T C₀ C₁ CH : ℝ) : ℝ := +@[expose] def formCost (T C₀ C₁ CH : ℝ) : ℝ := 9 * (derivativeCost T C₀ C₁)^2 * (1 + T^2*CH) /-- The polynomial cost of the actual weak forcing term. -/ @@ -222,7 +222,7 @@ end end -@[expose] public section +public section noncomputable section @@ -239,11 +239,11 @@ open Set InnerProductSpace ContinuousLinearMap EulerTimeLp EulerTerminalTimePrim EulerTimeLpCoefficientGevrey /-- Uniform polynomial bound for the inverse frame transport. -/ -def transportCeiling (T C₀ C₁ c : ℝ) : ℝ := +@[expose] def transportCeiling (T C₀ C₁ c : ℝ) : ℝ := 1 + ((2*(c⁻¹)^2*C₀^2*C₁ + c⁻¹*C₁)*T + c⁻¹*C₀) /-- Uniform polynomial bound for the inverse of the transported form. -/ -def inverseCost (T C₀ C₁ c : ℝ) : ℝ := 2 * (transportCeiling T C₀ C₁ c)^2 +@[expose] def inverseCost (T C₀ C₁ c : ℝ) : ℝ := 2 * (transportCeiling T C₀ C₁ c)^2 /-- One polynomial top constant handles both coefficient and forcing amplitudes. -/ def solveCost (T C₀ C₁ CH c : ℝ) : ℝ := @@ -378,7 +378,8 @@ theorem transverseCoordinates_gevrey funext y have he := fixedFrameSolver_eq_transverse T hT (Q y) (Q₁ y) (H y) c hc (hLower y) (hd y) K hK (hPotential y) hsmall (m y) (hTangent y) (hRange y) (f y) - exact (congrArg (fun z : zeroTraceDerivatives (U := U) T hT => (z : TimeLp T U)) he).symm + simpa only [transverseBackward_coe] using + (congrArg (fun z : zeroTraceDerivatives (U := U) T hT => (z : TimeLp T U)) he).symm rw [heq] have hM := solveCost_one_le T C₀ C₁ CH c hT hC₀ hC₁ hCH have hR0 : 0 ≤ R := by nlinarith @@ -428,7 +429,7 @@ end end -@[expose] public section +public section noncomputable section @@ -447,7 +448,7 @@ def forcingBlockAmplitude (ι : Type*) [Fintype ι] (q : ℕ) (T Rc C₀ C₁ Cf /-- Block cost, given by `inverseBlockCost ι q (inverseCost T C₀ C₁ c) Rc (formCost T C₀ C₁ CH) (forcingBlockAmplitude ι q T Rc C₀ C₁ Cf)`. -/ -def blockCost (ι : Type*) [Fintype ι] (q : ℕ) (T Rc C₀ C₁ CH c Cf : ℝ) : ℝ := +@[expose] def blockCost (ι : Type*) [Fintype ι] (q : ℕ) (T Rc C₀ C₁ CH c Cf : ℝ) : ℝ := inverseBlockCost ι q (inverseCost T C₀ C₁ c) Rc (formCost T C₀ C₁ CH) (forcingBlockAmplitude ι q T Rc C₀ C₁ Cf) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSpaceInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSpaceInverse.lean index 640bfd275c..cfd9d180cb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSpaceInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedSpaceInverse.lean @@ -17,7 +17,7 @@ coercive inverse are constructed here and identified with the original physical transverse solve. This is the fixed-space starting point for parameter estimates. -/ -@[expose] public section +public section noncomputable section @@ -38,15 +38,20 @@ variable (T : ℝ) (hT : 0 ≤ T) (H : C(Icc (0 : ℝ) T, E →L[ℝ] E)) /-- The actual physical derivative associated to a fixed zero-trace coordinate derivative. -/ -def fixedFrameDerivative : zeroTraceDerivatives (U := U) T hT →L[ℝ] TimeLp T E := +@[expose] def fixedFrameDerivative : zeroTraceDerivatives (U := U) T hT →L[ℝ] TimeLp T E := (productDerivative T hT Q Q₁).comp (zeroTraceDerivatives (U := U) T hT).subtypeL +omit [CompleteSpace U] [CompleteSpace E] in +@[simp] theorem fixedFrameDerivative_apply (v : zeroTraceDerivatives (U := U) T hT) : + fixedFrameDerivative T hT Q Q₁ v = productDerivative T hT Q Q₁ (v : TimeLp T U) := by + rfl + /-- The actual physical displacement associated to a fixed coordinate derivative. -/ -def fixedFramePrimitive : zeroTraceDerivatives (U := U) T hT →L[ℝ] TimeLp T E := +@[expose] def fixedFramePrimitive : zeroTraceDerivatives (U := U) T hT →L[ℝ] TimeLp T E := (primitiveTimeLp T hT).comp (fixedFrameDerivative T hT Q Q₁) /-- The transported Dirichlet operator on the fixed coordinate Hilbert space. -/ -def fixedFrameOperator : +@[expose] def fixedFrameOperator : zeroTraceDerivatives (U := U) T hT →L[ℝ] zeroTraceDerivatives (U := U) T hT := (fixedFrameDerivative T hT Q Q₁).adjoint.comp ((dirichletOperator (primitiveTimeLp T hT) (timeMultiplier T hT H)).comp @@ -71,7 +76,7 @@ variable (c : ℝ) (hc : 0 < c) (hQ : ∀ t x, c * ‖x‖ ^ 2 ≤ ‖Q t x‖ ^ (hsmall : K * (T ^ 2 / 2) ≤ 1 / 2) /-- A polynomial quantitative coercivity constant on the fixed coordinate space. -/ -def fixedCoercivity : ℝ := (transportCost T Q Q₁ c)⁻¹ ^ 2 / 2 +@[expose] def fixedCoercivity : ℝ := (transportCost T Q Q₁ c)⁻¹ ^ 2 / 2 omit [CompleteSpace U] [CompleteSpace E] in include hT hc in @@ -103,7 +108,7 @@ theorem fixedFrameOperator_coercive (v : zeroTraceDerivatives (U := U) T hT) : exact hphys /-- The genuine fixed-space inverse, constructed from the transported coercive form. -/ -def fixedFrameSolver : TimeLp T E →L[ℝ] zeroTraceDerivatives (U := U) T hT := +@[expose] def fixedFrameSolver : TimeLp T E →L[ℝ] zeroTraceDerivatives (U := U) T hT := (coerciveInverse (fixedFrameOperator T hT Q Q₁ H) (fixedCoercivity T Q Q₁ c) (fixedCoercivity_pos T hT Q Q₁ c hc) (fixedFrameOperator_coercive T hT Q Q₁ H c hc hQ hd K hK hH hsmall)).comp @@ -156,6 +161,7 @@ theorem fixedFrameSolver_eq_transverse (m : Icc (0 : ℝ) T → E) (transverseForward T hT Q Q₁ hd m hTangent v) have hu := congrArg (fun z : transverseDerivatives T hT m => (z : TimeLp T E)) (transverseForward_backward T hT Q Q₁ c hc hQ hd m hTangent hRange u) + simp only [transversePrimitive_apply, transverseForward_coe] at hu h change fixedFrameDerivative T hT Q Q₁ (transverseBackward T hT Q Q₁ c hc hQ hd m u) = (u : TimeLp T E) at hu change ⟪fixedFrameDerivative T hT Q Q₁ (transverseBackward T hT Q Q₁ c hc hQ hd m u), diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedStrong.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedStrong.lean index 345e662502..9cfda8b80a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedStrong.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseFixedStrong.lean @@ -17,7 +17,7 @@ spatial or cylinder L² spaces, where a pointwise transverse constraint must not be replaced by orthogonality to a single Hilbert-space vector. -/ -@[expose] public section +public section noncomputable section @@ -69,7 +69,8 @@ theorem momentum_weak (f : TimeLp T E) (v : TimeLp T U) primitiveTimeLp T hT v⟫_ℝ := by apply momentum_weak_of_product_tests T hT Q Q₁ hd H (physicalDerivative T hT Q Q₁ H c hc hQ hd K hK hH hsmall f) f v - exact fixedFrameSolver_weak T hT Q Q₁ H c hc hQ hd K hK hH hsmall f ⟨v,hv⟩ + exact fixedFrameSolver_weak T hT Q Q₁ H c hc hQ hd K hK hH hsmall f + ⟨v, (mem_zeroTraceDerivatives T hT v).2 hv⟩ variable (Q₂ : C(Icc (0 : ℝ) T, U →L[ℝ] E)) (hd₁ : ∀ t : Icc (0 : ℝ) T, diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean index 27b0d170ee..889accd110 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean @@ -38,7 +38,7 @@ in the uniform time norm, without assuming parameter regularity of the homogeneous evolution supplied by (H3). -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardInverse.lean index f2ff77406b..ab1af4e16f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardInverse.lean @@ -21,7 +21,7 @@ The coordinate equation, tangency, initial trace and physical pressure balance are proved at every time, including within-interval endpoint derivatives. -/ -@[expose] public section +public section noncomputable section @@ -41,32 +41,32 @@ variable (T : ℝ) (hT : 0 ≤ T) (c : ℝ) (hc : 0 < c) (hQ : ∀ t v, c * ‖v‖ ^ 2 ≤ ‖Q t v‖ ^ 2) /-- The actual ordinary coefficient `-2 K⁻¹ Q* Q₁` in equation (12). -/ -def generator : C(Icc (0 : ℝ) T,V →L[ℝ] V) := +@[expose] def generator : C(Icc (0 : ℝ) T,V →L[ℝ] V) := ⟨fun t => (-2 : ℝ) • (gramInversePath T Q c hc hQ t).comp ((Q t).adjoint.comp (Q₁ t)), ((gramInversePath T Q c hc hQ).continuous.clm_comp ((adjointPath T Q).continuous.clm_comp Q₁.continuous)).const_smul (-2 : ℝ)⟩ /-- The actual projected forcing `K⁻¹ Q* f`, as a bounded continuous-path map. -/ -def forcingOperator : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,V) := +@[expose] def forcingOperator : C(Icc (0 : ℝ) T,E) →L[ℝ] C(Icc (0 : ℝ) T,V) := multiplier (frameLeftInversePath T Q c hc hQ) variable (U : Evolution T hT (generator T Q Q₁ c hc hQ)) /-- The forward coordinate is the actual forced Duhamel path. -/ -def coordinates (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,V) := +@[expose] def coordinates (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,V) := U.solution (forcingOperator T Q c hc hQ f) a₀ /-- Its derivative is the literal ordinary right hand side. -/ -def coordinateDerivative (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,V) := +@[expose] def coordinateDerivative (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,V) := multiplier (generator T Q Q₁ c hc hQ) (coordinates T hT Q Q₁ c hc hQ U f a₀) + forcingOperator T Q c hc hQ f /-- The physical velocity `A=Qa` is an actual continuous path. -/ -def velocity (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,E) := +@[expose] def velocity (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,E) := multiplier Q (coordinates T hT Q Q₁ c hc hQ U f a₀) /-- The physical time derivative, with the literal product-rule expression. -/ -def velocityDerivative (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,E) := +@[expose] def velocityDerivative (f : C(Icc (0 : ℝ) T, E)) (a₀ : V) : C(Icc (0 : ℝ) T,E) := multiplier Q₁ (coordinates T hT Q Q₁ c hc hQ U f a₀) + multiplier Q (coordinateDerivative T hT Q Q₁ c hc hQ U f a₀) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseGramInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseGramInverse.lean index 643b74854c..2e208a5652 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseGramInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseGramInverse.lean @@ -23,7 +23,7 @@ bound. Its inverse identities and derivative follow from the already proved coercive operator inverse, not from an assumed matrix inverse. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ variable {U E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- Taking an adjoint is an actual bounded real-linear map. -/ -def realAdjoint : (U →L[ℝ] E) →L[ℝ] (E →L[ℝ] U) := +@[expose] def realAdjoint : (U →L[ℝ] E) →L[ℝ] (E →L[ℝ] U) := ({ toFun := fun Q => Q.adjoint map_add' := fun A B => map_add ContinuousLinearMap.adjoint A B map_smul' := fun a A => by simp } : @@ -47,7 +47,7 @@ def realAdjoint : (U →L[ℝ] E) →L[ℝ] (E →L[ℝ] U) := rw [LinearIsometryEquiv.norm_map, one_mul]) /-- The transverse Gram matrix as a genuine bounded operator. -/ -def gram (Q : U →L[ℝ] E) : U →L[ℝ] U := Q.adjoint.comp Q +@[expose] def gram (Q : U →L[ℝ] E) : U →L[ℝ] U := Q.adjoint.comp Q /-- The Gram quadratic form is precisely the squared physical-frame norm. -/ theorem gram_inner (Q : U →L[ℝ] E) (x : U) : @@ -62,7 +62,7 @@ theorem gram_coercive (Q : U →L[ℝ] E) (c : ℝ) exact hQ x /-- The Gram inverse is constructed by the actual coercive solver. -/ -def gramInverse (Q : U →L[ℝ] E) (c : ℝ) (hc : 0 < c) +@[expose] def gramInverse (Q : U →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hQ : ∀ x, c * ‖x‖ ^ 2 ≤ ‖Q x‖ ^ 2) : U →L[ℝ] U := coerciveInverse (gram Q) c hc (gram_coercive Q c hQ) @@ -85,7 +85,7 @@ theorem gramInverse_norm (Q : U →L[ℝ] E) (c : ℝ) (hc : 0 < c) coerciveInverse_norm_le (gram Q) c hc (gram_coercive Q c hQ) /-- A canonical bounded left inverse for the physical transverse frame. -/ -def frameLeftInverse (Q : U →L[ℝ] E) (c : ℝ) (hc : 0 < c) +@[expose] def frameLeftInverse (Q : U →L[ℝ] E) (c : ℝ) (hc : 0 < c) (hQ : ∀ x, c * ‖x‖ ^ 2 ≤ ‖Q x‖ ^ 2) : E →L[ℝ] U := (gramInverse Q c hc hQ).comp Q.adjoint @@ -122,7 +122,7 @@ theorem hasDerivAt_gramInverse (Q : ℝ → U →L[ℝ] E) (c : ℝ) (hc : 0 < c open MeasureTheory Set EulerTimeLp EulerVolterraConvolution /-- The adjoint of a continuous coefficient path is a continuous coefficient path. -/ -def adjointPath (T : ℝ) (Q : C(Icc (0 : ℝ) T, U →L[ℝ] E)) : +@[expose] def adjointPath (T : ℝ) (Q : C(Icc (0 : ℝ) T, U →L[ℝ] E)) : C(Icc (0 : ℝ) T, E →L[ℝ] U) := ⟨fun t => (Q t).adjoint, (realAdjoint (U := U) (E := E)).continuous.comp Q.continuous⟩ diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseGramPath.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseGramPath.lean index c2c4234bc3..d34de2975e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseGramPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseGramPath.lean @@ -19,7 +19,7 @@ its quantitative lower bound. These are coefficient theorems, independent of any chosen variational solution. -/ -@[expose] public section +public section noncomputable section @@ -79,12 +79,12 @@ variable (T : ℝ) (hQ : ∀ t x, c * ‖x‖ ^ 2 ≤ ‖Q t x‖ ^ 2) /-- Continuous Gram coefficient, constructed by the actual adjoint and composition. -/ -def gramPath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := +@[expose] def gramPath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := ⟨fun t => gram (Q t), ((realAdjoint (U := U) (E := E)).continuous.comp Q.continuous).clm_comp Q.continuous⟩ /-- Continuous derivative coefficient of the Gram matrix. -/ -def gramDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := +@[expose] def gramDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := ⟨fun t => (Q₁ t).adjoint.comp (Q t) + (Q t).adjoint.comp (Q₁ t), (((realAdjoint (U := U) (E := E)).continuous.comp Q₁.continuous).clm_comp Q.continuous).add @@ -92,7 +92,7 @@ def gramDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := Q₁.continuous)⟩ /-- The genuinely constructed Gram inverse varies continuously on the interval. -/ -def gramInversePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) where +@[expose] def gramInversePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) where toFun t := gramInverse (Q t) c hc (hQ t) continuous_toFun := by have heq : (fun t => gramInverse (Q t) c hc (hQ t)) = @@ -110,7 +110,7 @@ def gramInversePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) where exact hcont.comp (x := t) (gramPath T Q).continuous.continuousAt /-- Explicit continuous coefficient of the inverse derivative `-K⁻¹ K' K⁻¹`. -/ -def gramInverseDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := +@[expose] def gramInverseDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := ⟨fun t => -(gramInversePath T Q c hc hQ t).comp ((gramDerivativePath T Q Q₁ t).comp (gramInversePath T Q c hc hQ t)), ((gramInversePath T Q c hc hQ).continuous.clm_comp @@ -118,13 +118,13 @@ def gramInverseDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := (gramInversePath T Q c hc hQ).continuous)).neg⟩ /-- The canonical left-inverse coefficient is continuous. -/ -def frameLeftInversePath : C(Icc (0 : ℝ) T, E →L[ℝ] U) := +@[expose] def frameLeftInversePath : C(Icc (0 : ℝ) T, E →L[ℝ] U) := ⟨fun t => (gramInversePath T Q c hc hQ t).comp (Q t).adjoint, (gramInversePath T Q c hc hQ).continuous.clm_comp ((realAdjoint (U := U) (E := E)).continuous.comp Q.continuous)⟩ /-- The continuous coefficient of the derivative of the frame left inverse. -/ -def frameLeftInverseDerivativePath : C(Icc (0 : ℝ) T, E →L[ℝ] U) := +@[expose] def frameLeftInverseDerivativePath : C(Icc (0 : ℝ) T, E →L[ℝ] U) := ⟨fun t => (gramInverseDerivativePath T Q Q₁ c hc hQ t).comp (Q t).adjoint + (gramInversePath T Q c hc hQ t).comp (Q₁ t).adjoint, ((gramInverseDerivativePath T Q Q₁ c hc hQ).continuous.clm_comp diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryBounds.lean index 1e1a3e7c01..b0ab2be04e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryBounds.lean @@ -32,7 +32,7 @@ The input called `R` below is an inverse operator; the transverse specialization constructs it by coercivity and discharges all of its norm bounds. -/ -@[expose] public section +public section noncomputable section @@ -192,7 +192,7 @@ constants below bound coefficients or their explicit frame-transport cost; no bound on an unknown inverse or on a supplied solution is assumed. -/ -@[expose] public section +public section noncomputable section @@ -292,7 +292,7 @@ theorem fixedInverse_sub_norm_le (d a r : ℝ) ring /-- The polynomial sensitivity of an affine terminal-coordinate solve. -/ -def endpointDifferenceCost (d i a δd δa : ℝ) : ℝ := +@[expose] def endpointDifferenceCost (d i a δd δa : ℝ) : ℝ := (1 + 3 * d ^ 2 * i * a + 2 * d ^ 4 * i ^ 2 * a ^ 2) * δd + (d ^ 3 * i + d ^ 5 * i ^ 2 * a) * δa @@ -378,7 +378,7 @@ section /-! Polynomial size and coefficient sensitivity of the actual source (10) generator. -/ -@[expose] public section +public section noncomputable section @@ -438,7 +438,7 @@ theorem generator_norm_le (q r : ℝ) (hQn : ‖Q‖ ≤ q) (hQ₁n : ‖Q₁‖ ring /-- Only frame differences occur in the genuine generator difference. -/ -def generatorDifferenceCost (c q r δq δr : ℝ) : ℝ := +@[expose] def generatorDifferenceCost (c q r δq δr : ℝ) : ℝ := (4*(c⁻¹)^2*q^2*r + 2*c⁻¹*r)*δq + 2*c⁻¹*q*δr theorem generator_sub_norm_le (q r : ℝ) @@ -496,7 +496,7 @@ section /-! Uniform-time polynomial bounds from an actual L² value and generator derivative. -/ -@[expose] public section +public section noncomputable section @@ -519,7 +519,7 @@ def generatorTrace (B : C(Icc (0 : ℝ) T, U →L[ℝ] U)) : valuePart T hT + (derivativePart T hT).comp (timeMultiplier T hT B) /-- Trace cost, given by `(1+T) * (T⁻¹ + 2*b)`. -/ -def traceCost (T b : ℝ) : ℝ := (1+T) * (T⁻¹ + 2*b) +@[expose] def traceCost (T b : ℝ) : ℝ := (1+T) * (T⁻¹ + 2*b) theorem sqrt_le_one_add (hT : 0 ≤ T) : Real.sqrt T ≤ 1+T := by nlinarith only [Real.sq_sqrt hT, Real.sqrt_nonneg T, sq_nonneg (Real.sqrt T-1)] @@ -611,7 +611,7 @@ end end -@[expose] public section +public section noncomputable section @@ -639,11 +639,11 @@ variable (T : ℝ) (hT : 0 ≤ T) (hsmall : K * (T ^ 2 / 2) ≤ 1 / 2) /-- Slope cost, given by `r * (1+d^2*(2*r^2)*a) * (affineCost T*d)`. -/ -def slopeCost (T d a r : ℝ) : ℝ := r * (1+d^2*(2*r^2)*a) * (affineCost T*d) +@[expose] def slopeCost (T d a r : ℝ) : ℝ := r * (1+d^2*(2*r^2)*a) * (affineCost T*d) /-- Slope difference cost, given by `r * (affineCost T * endpointDifferenceCost d (2*r^2) a δd δa + δd * slopeCost T d a r)`. -/ -def slopeDifferenceCost (T d a r δd δa : ℝ) : ℝ := +@[expose] def slopeDifferenceCost (T d a r δd δa : ℝ) : ℝ := r * (affineCost T * endpointDifferenceCost d (2*r^2) a δd δa + δd * slopeCost T d a r) theorem coordinateSlope_norm_le (d a r : ℝ) @@ -711,7 +711,7 @@ def historyCost (T c q q₁ d a r : ℝ) : ℝ := q * traceCost T (2*c⁻¹*q*q₁) * slopeCost T d a r /-- History difference cost, constructed using `δq`. -/ -def historyDifferenceCost (T c q q₁ d a r δq δq₁ δH : ℝ) : ℝ := +@[expose] def historyDifferenceCost (T c q q₁ d a r δq δq₁ δH : ℝ) : ℝ := δq * traceCost T (2*c⁻¹*q*q₁) * slopeCost T d a r + q * (2*(1+T)*generatorDifferenceCost c q q₁ δq δq₁*slopeCost T d a r + traceCost T (2*c⁻¹*q*q₁)*slopeDifferenceCost T d a r (T*δq₁+δq) (T^2*δH)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryLipschitz.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryLipschitz.lean index 170c0656d4..8f45b46ed1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryLipschitz.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryLipschitz.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryBounds /-! The explicit history perturbation estimate yields actual coefficient Lipschitz control. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryParentCost.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryParentCost.lean index 9ef778cbfa..d9f4abfddd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryParentCost.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryParentCost.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryPolynomialCos /-! The actual zeroth-order history costs are bounded by fixed scalar polynomials in the parent coefficient bounds and reciprocal horizon. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryPolynomialCost.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryPolynomialCost.lean index 6a94ce7dda..a8af818f2a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryPolynomialCost.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseHistoryPolynomialCost.lean @@ -13,7 +13,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransverseHistoryBounds The time reciprocal and inverse Gram bound are independent scalar inputs; no operator or solution norm occurs in the resulting envelope. -/ -@[expose] public section +public section noncomputable section @@ -25,20 +25,20 @@ open EulerTimeH1GeneratorBounds EulerTransverseEndpointBounds EulerPacketParentMeanCoercivity /-- Slope envelope, given by `r*(1+d^2*(2*r^2)*a)*(2*Ti*d)`. -/ -def slopeEnvelope (Ti d a r : ℝ) : ℝ := +@[expose] def slopeEnvelope (Ti d a r : ℝ) : ℝ := r*(1+d^2*(2*r^2)*a)*(2*Ti*d) /-- Slope difference envelope, given by `r*(2*Ti*endpointDifferenceCost d (2*r^2) a x y+x*slopeEnvelope Ti d a r)`. -/ -def slopeDifferenceEnvelope (Ti d a r x y : ℝ) : ℝ := +@[expose] def slopeDifferenceEnvelope (Ti d a r x y : ℝ) : ℝ := r*(2*Ti*endpointDifferenceCost d (2*r^2) a x y+x*slopeEnvelope Ti d a r) /-- Generator difference envelope, given by `(4*ci^2*q^2*q1+2*ci*q1)*x+2*ci*q*y`. -/ -def generatorDifferenceEnvelope (ci q q1 x y : ℝ) : ℝ := +@[expose] def generatorDifferenceEnvelope (ci q q1 x y : ℝ) : ℝ := (4*ci^2*q^2*q1+2*ci*q1)*x+2*ci*q*y /-- Difference envelope as an element of `ℝ`. -/ -def differenceEnvelope (Ti ci q q1 d a r x y z : ℝ) : ℝ := +@[expose] def differenceEnvelope (Ti ci q q1 d a r x y z : ℝ) : ℝ := x*(2*(Ti+4*ci*q*q1))*slopeEnvelope Ti d a r + q*(4*generatorDifferenceEnvelope ci q q1 x y*slopeEnvelope Ti d a r + (2*(Ti+4*ci*q*q1))*slopeDifferenceEnvelope Ti d a r (y+x) z) @@ -133,7 +133,7 @@ theorem differenceEnvelope_mono /-- Parent difference envelope, given by `differenceEnvelope Ti (gramInverseEnvelope C) C C1 (C1+C) (1+CH) (transportEnvelope C C1) (C*R) (C1*R) (CH*R)`. -/ -def parentDifferenceEnvelope (Ti C C1 CH R : ℝ) : ℝ := +@[expose] def parentDifferenceEnvelope (Ti C C1 CH R : ℝ) : ℝ := differenceEnvelope Ti (gramInverseEnvelope C) C C1 (C1+C) (1+CH) (transportEnvelope C C1) (C*R) (C1*R) (CH*R) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialCoordinates.lean index e7f70958f7..b54bce91ae 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialCoordinates.lean @@ -17,7 +17,7 @@ The physical reconstruction and its differentiated identity follow from the coefficient left inverse, the H¹ product rule and uniqueness of derivatives. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ variable (T : ℝ) (hT : 0 ≤ T) /-- Initial coordinates, given by `extendPath T hT (frameLeftInversePath T Q c hc hQ) t (initialRealPrimitive T u t)`. -/ -def initialCoordinates (u : TimeLp T E) (t : ℝ) : U := +@[expose] def initialCoordinates (u : TimeLp T E) (t : ℝ) : U := extendPath T hT (frameLeftInversePath T Q c hc hQ) t (initialRealPrimitive T u t) /-- Initial coordinate field, given by `timeMultiplier T hT (frameLeftInversePath T Q c hc hQ) @@ -50,7 +50,7 @@ def initialCoordinateField (u : TimeLp T E) : TimeLp T U := timeMultiplier T hT (frameLeftInversePath T Q c hc hQ) (initialPrimitiveTimeLp T hT u) /-- Initial coordinate derivative, constructed using `fieldProductDerivative`. -/ -def initialCoordinateDerivative (u : TimeLp T E) : TimeLp T U := +@[expose] def initialCoordinateDerivative (u : TimeLp T E) : TimeLp T U := fieldProductDerivative T hT (frameLeftInversePath T Q c hc hQ) (frameLeftInverseDerivativePath T Q Q₁ c hc hQ) (initialPrimitiveTimeLp T hT u) u diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialInverse.lean index 730c399db6..8e4e0af1cc 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseInitialInverse.lean @@ -18,7 +18,7 @@ gives polynomial coordinate estimates for nonzero-terminal paths, including differences between frames, without estimating a forward evolution. -/ -@[expose] public section +public section noncomputable section @@ -46,13 +46,13 @@ variable (T : ℝ) (hT : 0 ≤ T) /-- Initial coordinate operator, given by `initialProductDerivative T hT (frameLeftInversePath T Q c hc hQ) (frameLeftInverseDerivativePath T Q Q₁ c hc hQ)`. -/ -def initialCoordinateOperator : TimeLp T E →L[ℝ] TimeLp T U := +@[expose] def initialCoordinateOperator : TimeLp T E →L[ℝ] TimeLp T U := initialProductDerivative T hT (frameLeftInversePath T Q c hc hQ) (frameLeftInverseDerivativePath T Q Q₁ c hc hQ) theorem initialCoordinateOperator_apply (u : TimeLp T E) : initialCoordinateOperator T hT Q Q₁ c hc hQ u = - initialCoordinateDerivative T hT Q Q₁ c hc hQ u := rfl + initialCoordinateDerivative T hT Q Q₁ c hc hQ u := by rfl include hd in theorem initialCoordinates_product (u : TimeLp T U) (t : Icc (0 : ℝ) T) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseMomentumRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseMomentumRegularity.lean index 9ae42dd1a8..3f017b9ce7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseMomentumRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseMomentumRegularity.lean @@ -20,7 +20,7 @@ absolutely continuous representative. No momentum equation or second derivative of the solved displacement is included in the assumptions. -/ -@[expose] public section +public section noncomputable section @@ -40,10 +40,10 @@ variable (T : ℝ) (hT : 0 ≤ T) (Q Q₁ : C(Icc (0 : ℝ) T, U →L[ℝ] E)) /-- The literal transverse momentum as an actual L² field. -/ -def momentum (u : TimeLp T E) : TimeLp T U := (timeMultiplier T hT Q).adjoint u +@[expose] def momentum (u : TimeLp T E) : TimeLp T U := (timeMultiplier T hT Q).adjoint u /-- The forcing for the momentum derivative, before using the frame ODE. -/ -def momentumForcing (H : C(Icc (0 : ℝ) T, E →L[ℝ] E)) +@[expose] def momentumForcing (H : C(Icc (0 : ℝ) T, E →L[ℝ] E)) (u f : TimeLp T E) : TimeLp T U := (timeMultiplier T hT Q₁).adjoint u - (timeMultiplier T hT Q).adjoint @@ -91,6 +91,7 @@ theorem productDerivative_mem_transverse (hm : ∀ t x, ⟪m t, Q t x⟫_ℝ = 0) (v : TimeLp T U) (hv : initialTrace T hT v = 0) : productDerivative T hT Q Q₁ v ∈ transverseDerivatives T hT m := by + rw [mem_transverseDerivatives] constructor · rw [initialTrace_productDerivative T hT Q Q₁ hQ, hv, map_zero] · intro t @@ -135,10 +136,7 @@ theorem momentum_weak primitiveTimeLp T hT v⟫_ℝ := by have htest := hu ⟨productDerivative T hT Q Q₁ v, productDerivative_mem_transverse T hT Q Q₁ hQ m hm v hv⟩ - change ⟪(u : TimeLp T E), productDerivative T hT Q Q₁ v⟫_ℝ - - ⟪timeMultiplier T hT H (primitiveTimeLp T hT (u : TimeLp T E)), - primitiveTimeLp T hT (productDerivative T hT Q Q₁ v)⟫_ℝ = - -⟪f, primitiveTimeLp T hT (productDerivative T hT Q Q₁ v)⟫_ℝ at htest + simp only [transversePrimitive_apply] at htest exact momentum_weak_of_product_tests T hT Q Q₁ hQ H (u : TimeLp T E) f v htest diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseNormalResidual.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseNormalResidual.lean index 4c7bd7927c..a36130fbad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseNormalResidual.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseNormalResidual.lean @@ -16,7 +16,7 @@ normal component. Applying this elementary Hilbert-space fact to the proved projected coordinate equation gives the pressure coefficient in equation (11). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketBudget.lean index 309f75f99f..9708b8627c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketBudget.lean @@ -21,7 +21,7 @@ the forcing, its amplitude, its derivative shift, or the recursive grade. Coercivity is required only on the actual history interval [0,τ]. -/ -@[expose] public section +public section noncomputable section @@ -130,12 +130,12 @@ theorem radius_bounds : 1 ≤ L.R ∧ sobolevCoefficientRadius ι L.Rc ≤ L.R : /-- Velocity cost, given by `3*sobolevCoefficientAmplitude ι q L.Rc L.C₀*traceCost τ + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀`. -/ -def velocityCost : ℝ := +@[expose] def velocityCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀*traceCost τ + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀ /-- Derivative cost as an element of `ℝ`. -/ -def derivativeCost : ℝ := +@[expose] def derivativeCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₁*traceCost τ + 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀ + physicalCost ι q L.Ri L.C₀ L.C₁ 1 1 diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrector.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrector.lean index bb9aa99029..9fd2a841b9 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrector.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrector.lean @@ -15,7 +15,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketProvider /-! The potential and slow curl of the actual transverse solution, with their genuine time derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorOperator.lean index 9b755aca69..b9176dc63a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorOperator.lean @@ -18,7 +18,7 @@ section /-! Zero angular mean of the actual transverse potential, corrector, and time derivatives. -/ -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ end end -@[expose] public section +public section noncomputable section @@ -98,12 +98,12 @@ namespace Data variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : Data U) /-- The specified mean-zero angular primitive, applied directly to a raw field. -/ -def rawPotential (P : ℝ) (A : VectorField) : VectorField := fun z => +@[expose] def rawPotential (P : ℝ) (A : VectorField) : VectorField := fun z => EulerPacketAngularPotential.potential P (D.normal.field (D.clamp z.1) z.2.1) (fun θ => A (z.1,(z.2.1,θ))) z.2.2 /-- The actual slow curl in deformation coordinates; this defines a total raw-field operator. -/ -def curlCorrector (P : ℝ) (A : VectorField) : VectorField := fun z => +@[expose] def curlCorrector (P : ℝ) (A : VectorField) : VectorField := fun z => EulerMeanBoundary.curlMatrix ((fderiv ℝ (fun y : LiftTangent => D.rawPotential P A (z.1,y)) z.2).comp ((ContinuousLinearMap.inl ℝ Space ℝ).comp (D.FInv.field (D.clamp z.1) z.2.1))) @@ -136,7 +136,7 @@ theorem curlCorrector_eq (t : Icc (0 : ℝ) D.T) (x : Space) (θ : ℝ) : rw [Data.curlCorrector, Data.clamp_coe, he, coverField_fderiv, G.corrector_formula I t x θ] /-- The literal recursion operator has the already-constructed continuous L² witness. -/ -def curlCorrectorField : Field P D.T (D.curlCorrector P (G.vector I)) where +@[expose] def curlCorrectorField : Field P D.T (D.curlCorrector P (G.vector I)) where path := G.correctorPath I orbit := G.correctorPath_orbit I raw_eq t x θ := (G.curlCorrector_eq I t x θ).trans ((G.correctorField I).raw_eq t x θ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorParity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorParity.lean index 7f9bbedbe7..f15cc28f9b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorParity.lean @@ -16,7 +16,7 @@ section /-! Jointly odd transverse profiles give the actual jointly even vector potential. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorSupport.lean index 2edec7bc9e..a0cbba650b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCorrectorSupport.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.CylinderLocalSupport /-! Compact support of the actual transverse potential, corrector, and their time derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCylinderFields.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCylinderFields.lean index de4503e4f0..f9bd44c194 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCylinderFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketCylinderFields.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketCorrectorSupport /-! Actual cylinder-path witnesses for the constructed transverse solution and corrector. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketData.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketData.lean index 302b2a128d..4ca8ae1a98 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketData.lean @@ -37,7 +37,7 @@ with their genuine jets and time derivative. A pointwise bound on F⁻¹ proves the uniform frame coercivity used by the constructed Gram inverse. -/ -@[expose] public section +public section noncomputable section @@ -69,7 +69,7 @@ def coefficient (F : SmoothCoefficientPath K (Space →L[ℝ] Space)) : @[simp] theorem coefficient_apply (F : SmoothCoefficientPath K (Space →L[ℝ] Space)) (t : K) (x : Space) (v : U) : (coefficient m₀ R F).field t x v = F.field t x (R v : Space) := - rfl + by rfl /-- The original pointwise source coefficient derivative bound survives without loss. -/ theorem coefficient_derivative_bound (F : SmoothCoefficientPath K (Space →L[ℝ] Space)) @@ -123,7 +123,7 @@ end end -@[expose] public section +public section noncomputable section @@ -141,7 +141,8 @@ def normalMap : (Space →L[ℝ] Space) →L[ℝ] Space := (ContinuousLinearMap.adjoint.toContinuousLinearEquiv.toContinuousLinearMap : (Space →L[ℝ] Space) →L[ℝ] (Space →L[ℝ] Space)) -@[simp] theorem normalMap_apply (A : Space →L[ℝ] Space) : normalMap m₀ A = A.adjoint m₀ := rfl +@[simp] theorem normalMap_apply (A : Space →L[ℝ] Space) : + normalMap m₀ A = A.adjoint m₀ := by rfl theorem normalMap_norm (hm₀ : ‖m₀‖ = 1) : ‖normalMap m₀‖ ≤ 1 := by apply opNorm_le_bound _ zero_le_one @@ -158,7 +159,8 @@ def normalCoefficient (FInv : SmoothCoefficientPath K (Space →L[ℝ] Space)) : SmoothCoefficientPath K Space := SmoothCoefficientPath.map (normalMap m₀) FInv @[simp] theorem normalCoefficient_apply (FInv : SmoothCoefficientPath K (Space →L[ℝ] Space)) - (t : K) (x : Space) : (normalCoefficient m₀ FInv).field t x = (FInv.field t x).adjoint m₀ := rfl + (t : K) (x : Space) : + (normalCoefficient m₀ FInv).field t x = (FInv.field t x).adjoint m₀ := by rfl theorem normalCoefficient_derivative_bound (FInv : SmoothCoefficientPath K (Space →L[ℝ] Space)) (hm₀ : ‖m₀‖ = 1) (n : ℕ) (C : ℝ) @@ -228,7 +230,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketEndpoint.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketEndpoint.lean index bbf2de675c..1bfc272ea8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketEndpoint.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketEndpoint.lean @@ -20,7 +20,7 @@ The actual source history with prescribed compact terminal displacement. the constructed affine-endpoint inverse, not imposed as a solution law. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForcing.lean index ca910d6eaf..3826e37e28 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForcing.lean @@ -18,7 +18,7 @@ continuous cylinder L² path whose mixed translation orbit is smooth. No regularity or equation for an output field is assumed. -/ -@[expose] public section +public section noncomputable section @@ -63,18 +63,18 @@ def InitialData.zero (D : Data U) : InitialData P D where namespace Data /-- Clamp, given by `projIcc 0 D.T D.T_pos.le t`. -/ -def clamp (D : Data U) (t : ℝ) : Icc (0 : ℝ) D.T := projIcc 0 D.T D.T_pos.le t +@[expose] def clamp (D : Data U) (t : ℝ) : Icc (0 : ℝ) D.T := projIcc 0 D.T D.T_pos.le t omit [CompleteSpace U] in @[simp] theorem clamp_coe (D : Data U) (t : Icc (0 : ℝ) D.T) : D.clamp t = t := projIcc_of_mem D.T_pos.le t.property /-- Strain, given by `D.M.field (D.clamp z.1) z.2.1`. -/ -def strain (D : Data U) (z : EulerPacketPointJets.Domain) : Space →L[ℝ] Space := +@[expose] def strain (D : Data U) (z : EulerPacketPointJets.Domain) : Space →L[ℝ] Space := D.M.field (D.clamp z.1) z.2.1 /-- Normal field, given by `D.normal.field (D.clamp z.1) z.2.1`. -/ -def normalField (D : Data U) (z : EulerPacketPointJets.Domain) : Space := +@[expose] def normalField (D : Data U) (z : EulerPacketPointJets.Domain) : Space := D.normal.field (D.clamp z.1) z.2.1 end Data diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBounds.lean index b01ce7f76b..68e2908987 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBounds.lean @@ -40,7 +40,7 @@ section /-! The bounded time-right-side estimate applies to the actual PDE time derivative divided by g. -/ -@[expose] public section +public section noncomputable section @@ -89,7 +89,7 @@ end end -@[expose] public section +public section noncomputable section @@ -197,7 +197,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBudget.lean index e95d08125a..18143e75f8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardBudget.lean @@ -18,7 +18,7 @@ time zero. The same fixed radius controls unit forcing and unit initial coordinates; there is no history interval or terminal variational problem. -/ -@[expose] public section +public section noncomputable section @@ -95,11 +95,11 @@ namespace Budget variable {D : Data U} {ι : Type*} [Fintype ι] {q : ℕ} (L : Budget D ι q) /-- Velocity cost, given by `3*sobolevCoefficientAmplitude ι q L.Rc L.C₀`. -/ -def velocityCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀ +@[expose] def velocityCost : ℝ := 3*sobolevCoefficientAmplitude ι q L.Rc L.C₀ /-- Derivative cost, given by `physicalCost ι q L.Ri L.C₀ L.C₁ 1 1`. -/ -def derivativeCost : ℝ := physicalCost ι q L.Ri L.C₀ L.C₁ 1 1 +@[expose] def derivativeCost : ℝ := physicalCost ι q L.Ri L.C₀ L.C₁ 1 1 /-- Common cost, given by `L.velocityCost+L.derivativeCost`. -/ -def commonCost : ℝ := L.velocityCost+L.derivativeCost +@[expose] def commonCost : ℝ := L.velocityCost+L.derivativeCost /-- Enlarge radius as an element of `Budget D ι q`. -/ def enlargeRadius (R' : ℝ) (hR : L.R ≤ R') : Budget D ι q := diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardGradeBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardGradeBounds.lean index c326670750..2eaa253441 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardGradeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketForwardGradeBounds.lean @@ -37,7 +37,7 @@ section /-! Homogeneity restores a common arbitrary envelope for genuine forcing and initial data, without adding either envelope to the radius guards. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -235,7 +235,7 @@ section /-! Same-radius estimates for the actual corrector, divided by the prescribed time profile. -/ -@[expose] public section +public section noncomputable section @@ -342,7 +342,7 @@ section /-! Bounds for the actual high-pressure gradient from the normalized forcing and solved velocity. -/ -@[expose] public section +public section noncomputable section @@ -415,7 +415,7 @@ end end -@[expose] public section +public section noncomputable section @@ -436,15 +436,15 @@ variable {P : ℝ} [Fact (0 < P)] (N : EulerTransversePacketJoin.NormalBudget D q L.R) /-- Pressure amplitude, given by `P*pressureCost (Fin 4) q N.Ri N.C N.C 1 L.commonCost`. -/ -def pressureAmplitude : ℝ := P*pressureCost (Fin 4) q N.Ri N.C N.C 1 L.commonCost +@[expose] def pressureAmplitude : ℝ := P*pressureCost (Fin 4) q N.Ri N.C N.C 1 L.commonCost /-- Potential amplitude, given by `3*N.blockAmplitude*(P*L.commonCost)`. -/ def potentialAmplitude : ℝ := 3*N.blockAmplitude*(P*L.commonCost) /-- Potential time amplitude, given by `6*N.blockAmplitude*(P*L.commonCost)`. -/ def potentialTimeAmplitude : ℝ := 6*N.blockAmplitude*(P*L.commonCost) /-- Corrector amplitude, given by `27*N.blockAmplitude^2*(P*L.commonCost)`. -/ -def correctorAmplitude : ℝ := 27*N.blockAmplitude^2*(P*L.commonCost) +@[expose] def correctorAmplitude : ℝ := 27*N.blockAmplitude^2*(P*L.commonCost) /-- Corrector time amplitude, given by `108*N.blockAmplitude^2*(P*L.commonCost)`. -/ -def correctorTimeAmplitude : ℝ := 108*N.blockAmplitude^2*(P*L.commonCost) +@[expose] def correctorTimeAmplitude : ℝ := 108*N.blockAmplitude^2*(P*L.commonCost) variable {raw : VectorField} (G : Forcing P D raw) (I : InitialData P D) (A : ℝ) (hA : 0 ≤ A) (d : ℕ) @@ -546,7 +546,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistory.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistory.lean index 332c2ea0cd..8a9826418d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistory.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistory.lean @@ -35,7 +35,7 @@ The adjoint multiplier identity turns it into the pointwise matrix equation almost everywhere. Its normal residual is exactly the scalar source in (11). -/ -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryBounds.lean index 3cbeffc89d..573b678a4a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryBounds.lean @@ -33,7 +33,7 @@ They retain the fixed spatial/angular Sobolev block and use the true continuous time derivative, including both endpoints. -/ -@[expose] public section +public section noncomputable section @@ -198,7 +198,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryData.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryData.lean index a83a514e83..f5904392e7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryData.lean @@ -19,7 +19,7 @@ its true time derivatives, and all endpoint conditions are constructed by the previously proved coercive solve. No solution is an input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean index 5222d4a4af..5f2cc49fea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean @@ -23,7 +23,7 @@ residual of the constructed history. Its L² realization, zero mean, spatial smoothness, support, and pointwise equation (11) are proved here. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHomogeneity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHomogeneity.lean index 4a25ff609d..72283b1042 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHomogeneity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHomogeneity.lean @@ -20,7 +20,7 @@ section /-! Exact scalar homogeneity of the constructed history and forward paths. -/ -@[expose] public section +public section noncomputable section @@ -120,7 +120,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitial.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitial.lean index 55d2d9c3a1..9560798c08 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitial.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitial.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.ClassicalPressureCurl /-! The constructed raw forward field has the prescribed actual initial data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitialRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitialRepresentative.lean index 4dd8a38ec0..f9b07def2c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitialRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketInitialRepresentative.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketInitial /-! The raw forward field attains the actual continuous representative of its prescribed supported initial coordinates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalData.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalData.lean index b108fc4d9d..2ddd1c9e9b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalData.lean @@ -17,7 +17,7 @@ time derivative follows by restriction or by the affine change t = τ+s; spatial derivatives are retained literally by continuous precomposition. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalForcing.lean index 72af2e595f..444b21249b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketIntervalForcing.lean @@ -18,7 +18,7 @@ section /-! Time restriction and changes of time variable commute with actual smooth cylinder representatives. -/ -@[expose] public section +public section noncomputable section @@ -89,7 +89,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJets.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJets.lean index 8cb10c8286..836e246746 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJets.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJets.lean @@ -10,7 +10,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.TransversePacketProvider /-! The constructed forward transverse provider in the literal packet jet equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedCorrector.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedCorrector.lean index cd04ec738b..14f3e2bc2f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedCorrector.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedCorrector.lean @@ -19,7 +19,7 @@ C and C_t. The returned Field is for the literal raw curlCorrector used by the recursion, including at the history/forward junction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedEquation.lean index 74a8cd69ee..ed65111361 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedEquation.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketJets /-! The complete constructed transverse path satisfies the literal packet equation on the whole closed interval. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedField.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedField.lean index 956638be4c..e5660f5352 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedField.lean @@ -21,7 +21,7 @@ All raw fields are canonical continuous representatives of the constructed L² paths. Restriction recovers the actual history and forward solutions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedParity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedParity.lean index a4f7d8cf69..c190289efb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedParity.lean @@ -23,7 +23,7 @@ section /-! Joint parity of the actual source history inverse and its normalized pressure. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPaths.lean index e100a5f571..29cb49bed7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPaths.lean @@ -20,7 +20,7 @@ the junction, and its mixed translation orbit is smooth in the uniform time-path topology. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPressure.lean index d9058641bf..45891d6fa8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedPressure.lean @@ -20,7 +20,7 @@ pressure equals one global bounded cylinder operator applied to the actual forcing and velocity. This gives its estimates without any further solve. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedProvider.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedProvider.lean index 2822926c6b..d1caa0ecf1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedProvider.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedProvider.lean @@ -23,7 +23,7 @@ Its raw PDE, tangent constraint, parity, actual Field witnesses, true time derivative, pressure gradient and literal curl corrector are all exported. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedSupport.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedSupport.lean index 22506cac72..694356e52d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedSupport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketJoinedSupport.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SourceCylinderMeanZero /-! Actual support and angular normalization of the joined transverse provider. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketNormalBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketNormalBudget.lean index 41ecbf9af6..8ba067c13e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketNormalBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketNormalBudget.lean @@ -18,7 +18,7 @@ section /-! Explicit polynomial coefficient budgets for the actual transverse potential and slow curl. -/ -@[expose] public section +public section noncomputable section @@ -30,10 +30,10 @@ open Set EulerSmoothLimit EulerMeanCoefficients EulerGevrey EulerOperatorGevreyC open scoped ContDiff BoundedContinuousFunction /-- Corrector coefficient radius, given by `R+4*Ri+1`. -/ -def correctorCoefficientRadius (R Ri : ℝ) : ℝ := R+4*Ri+1 +@[expose] def correctorCoefficientRadius (R Ri : ℝ) : ℝ := R+4*Ri+1 /-- Corrector coefficient amplitude, given by `1+C+3*C^2+3*Ri*C+27*(3*Ri*C)^2*(3*C^2)`. -/ -def correctorCoefficientAmplitude (C Ri : ℝ) : ℝ := +@[expose] def correctorCoefficientAmplitude (C Ri : ℝ) : ℝ := 1+C+3*C^2+3*Ri*C+27*(3*Ri*C)^2*(3*C^2) variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : Data U) @@ -183,7 +183,7 @@ end end -@[expose] public section +public section noncomputable section @@ -222,12 +222,12 @@ theorem Ri_nonneg : 0 ≤ N.Ri := N.inverse_radius).1 /-- Coefficient radius, given by `correctorCoefficientRadius N.Rc N.Ri`. -/ -def coefficientRadius : ℝ := correctorCoefficientRadius N.Rc N.Ri +@[expose] def coefficientRadius : ℝ := correctorCoefficientRadius N.Rc N.Ri /-- Coefficient amplitude, given by `correctorCoefficientAmplitude N.C N.Ri`. -/ -def coefficientAmplitude : ℝ := correctorCoefficientAmplitude N.C N.Ri +@[expose] def coefficientAmplitude : ℝ := correctorCoefficientAmplitude N.C N.Ri /-- Block amplitude, given by `sobolevCoefficientAmplitude (Fin 4) q N.coefficientRadius N.coefficientAmplitude`. -/ -def blockAmplitude : ℝ := sobolevCoefficientAmplitude (Fin 4) q N.coefficientRadius +@[expose] def blockAmplitude : ℝ := sobolevCoefficientAmplitude (Fin 4) q N.coefficientRadius N.coefficientAmplitude theorem coefficient_bounds : @@ -293,7 +293,7 @@ theorem derivativeCost_nonneg : 0 ≤ L.derivativeCost := by positivity /-- Common cost, given by `L.velocityCost+L.derivativeCost`. -/ -def commonCost : ℝ := L.velocityCost+L.derivativeCost +@[expose] def commonCost : ℝ := L.velocityCost+L.derivativeCost theorem commonCost_nonneg : 0 ≤ L.commonCost := add_nonneg L.velocityCost_nonneg L.derivativeCost_nonneg diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketParity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketParity.lean index a7d139d3d3..9ec39b9f1a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketParity.lean @@ -34,7 +34,7 @@ representation. Consequently coefficient symmetries pass to the solution without assuming any corresponding symmetry of that representation. -/ -@[expose] public section +public section noncomputable section @@ -111,7 +111,7 @@ section /-! Actual supported forward evolution preserves joint odd parity for even coefficients. -/ -@[expose] public section +public section noncomputable section @@ -170,7 +170,7 @@ end end -@[expose] public section +public section noncomputable section @@ -281,7 +281,7 @@ end end -@[expose] public section +public section noncomputable section @@ -331,7 +331,7 @@ variable {P : ℝ} [Fact (0 < P)] {D : Data U} {raw : VectorField} (G : Forcing P D raw) (I : InitialData P D) /-- Forcing field, bundling `path`, `orbit`, `raw_eq`. -/ -def forcingField : Field P D.T raw where +@[expose] def forcingField : Field P D.T raw where path := includePath P D.support D.support_measurable G.path orbit := G.path_orbit raw_eq := G.raw_eq diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPiolaData.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPiolaData.lean index 4502867072..d310d1274b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPiolaData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPiolaData.lean @@ -15,7 +15,7 @@ section /-! The actual high/corrector pair, with all potential regularity derived from the high field. -/ -@[expose] public section +public section noncomputable section @@ -85,7 +85,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradient.lean index a2610688c8..c5585d9f24 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradient.lean @@ -16,7 +16,7 @@ section /-! The literal pressure integral is the genuine jointly continuous scalar path representative. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradientProperties.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradientProperties.lean index b79156595c..11042d465f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradientProperties.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureGradientProperties.lean @@ -14,7 +14,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPressureParity /-! Support and joint odd parity of the actual high-pressure gradient used in the recursion. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureParity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureParity.lean index 4e4f499ef4..a60ae9294f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureParity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPressureParity.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketParity /-! Even parity of the actual normalized transverse pressure from the odd solved velocity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryBudget.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryBudget.lean index aafb513d6a..4d0b031f20 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryBudget.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryBudget.lean @@ -18,7 +18,7 @@ bounds. These extra guards use only the unit terminal-data cost, never the terminal amplitude or a recursive derivative shift. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryCorrector.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryCorrector.lean index eab2259ee7..8ad6456cbb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryCorrector.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryCorrector.lean @@ -24,7 +24,7 @@ C and C_t. The returned Field is for the literal raw curlCorrector used by the recursion, including at the history/forward junction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryEquation.lean index 9c01d12264..b6ef302366 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryEquation.lean @@ -14,7 +14,7 @@ The physical normal field is pointwise; it is never treated as one L² vector. All equations below are for genuine cylinder representatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryField.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryField.lean index ef8631beaa..632ab2d993 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryField.lean @@ -24,7 +24,7 @@ section /-! Odd compact terminal data propagate through the genuine history and forward primary solve. -/ -@[expose] public section +public section noncomputable section @@ -112,7 +112,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHistory.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHistory.lean index 74cdada649..cc0d02568e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHistory.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHistory.lean @@ -25,7 +25,7 @@ The actual compact-terminal source history is the manuscript's pointwise stationary history multiplied by the literal cutoff and periodic wave. -/ -@[expose] public section +public section noncomputable section @@ -99,7 +99,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHomogeneity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHomogeneity.lean index b8981a4d9e..bc99b0dd9d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHomogeneity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryHomogeneity.lean @@ -11,7 +11,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketHomogeneity /-! Exact scalar homogeneity of the actual compact terminal-data primary. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPaths.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPaths.lean index 256886b1d6..cc8d297dab 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPaths.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPaths.lean @@ -31,7 +31,7 @@ coordinate velocity at τ is the initial value of the homogeneous forward solve. Both the physical velocity and its true derivative match at τ. -/ -@[expose] public section +public section noncomputable section @@ -192,7 +192,7 @@ end end -@[expose] public section +public section noncomputable section @@ -223,7 +223,7 @@ def derivativePath : C(Icc (0 : ℝ) D.T,LiftL2 P) := /-- Pressure path, given by `sourcePressure P D.M D.normal D.normalLower D.normalLower_pos D.normal_lower 0 (velocityPath τ hτ hτT B Y)`. -/ -def pressurePath : C(Icc (0 : ℝ) D.T,CylinderL2 P ℝ) := +@[expose] def pressurePath : C(Icc (0 : ℝ) D.T,CylinderL2 P ℝ) := sourcePressure P D.M D.normal D.normalLower D.normalLower_pos D.normal_lower 0 (velocityPath τ hτ hτT B Y) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPressure.lean index 5e7630491a..115e4a48c3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketPrimaryPressure.lean @@ -19,7 +19,7 @@ import LeanPool.NavierStokesAndEuler.Euler.TransversePacketPrimaryEquation /-! The primary pressure is the actual mean-zero angular primitive of the normal residual. Its field satisfies the homogeneous packet equation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketProvider.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketProvider.lean index 1cc8002b8e..f5c0366fe7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketProvider.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketProvider.lean @@ -20,7 +20,7 @@ prescribed initial coordinates; the zero initial datum gives the forced operator used when t₀ = 0. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ namespace Forcing variable {D : Data U} {raw : VectorField} (G : Forcing P D raw) (I : InitialData P D) /-- Vector as an element of `VectorField`. -/ -def vector : VectorField := fun z => +@[expose] def vector : VectorField := fun z => field P D.support D.support_measurable D.support_compact D.T D.T_pos.le D.frame D.frameDerivative D.frameLower D.frameLower_pos D.frame_lower G.path I.value G.path_orbit I.orbit (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) @@ -53,7 +53,7 @@ def vectorDerivative : VectorField := fun z => G.path_orbit I.orbit (D.clamp z.1) (z.2.1,(z.2.2 : AddCircle P)) /-- Scalar as an element of `ScalarField`. -/ -def scalar : ScalarField := fun z => +@[expose] def scalar : ScalarField := fun z => pressureField P D.support D.support_measurable D.support_compact D.T D.T_pos.le D.frame D.frameDerivative D.frameLower D.frameLower_pos D.frame_lower G.path I.value G.path_orbit I.orbit D.M D.normal D.normalLower D.normalLower_pos D.normal_lower diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTimeData.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTimeData.lean index 70e33ac394..760481b1b4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTimeData.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTimeData.lean @@ -30,7 +30,7 @@ section /-! The vector-potential multiplier is a fixed linear contraction of the normal functional. -/ -@[expose] public section +public section noncomputable section @@ -88,7 +88,7 @@ section /-! The literal vector-potential multiplier inherits the source normal coefficient bounds. -/ -@[expose] public section +public section noncomputable section @@ -208,7 +208,7 @@ section /-! An inverse-free polynomial formula for the actual normal multiplier's time derivative. -/ -@[expose] public section +public section noncomputable section @@ -263,7 +263,7 @@ end end -@[expose] public section +public section noncomputable section @@ -523,7 +523,7 @@ section /-! The potential time coefficient from an actual continuous, translation-smooth normal derivative path. -/ -@[expose] public section +public section noncomputable section @@ -662,7 +662,7 @@ section /-! Genuine time derivatives of the inverse deformation and its transported normal. -/ -@[expose] public section +public section noncomputable section @@ -735,7 +735,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTraceMatching.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTraceMatching.lean index 6fa93dffab..de3636a6c8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTraceMatching.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketTraceMatching.lean @@ -28,7 +28,7 @@ Its source Hessian need not satisfy a smallness condition on the full history-plus-forward time interval. -/ -@[expose] public section +public section noncomputable section @@ -59,7 +59,7 @@ end end -@[expose] public section +public section noncomputable section @@ -83,7 +83,7 @@ def pastVelocity : C(Icc (0 : ℝ) τ,LiftL2 P) := /-- Future velocity, given by `includePath P D.support D.support_measurable ((G.tail τ hτ.le hτT).velocityPath (forwardInitial τ hτ hτT B G))`. -/ -def futureVelocity : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := +@[expose] def futureVelocity : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := includePath P D.support D.support_measurable ((G.tail τ hτ.le hτT).velocityPath (forwardInitial τ hτ hτT B G)) @@ -93,7 +93,7 @@ def pastDerivative : C(Icc (0 : ℝ) τ,LiftL2 P) := /-- Future derivative, given by `includePath P D.support D.support_measurable ((G.tail τ hτ.le hτT).derivativePath (forwardInitial τ hτ hτT B G))`. -/ -def futureDerivative : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := +@[expose] def futureDerivative : C(Icc (0 : ℝ) (D.T-τ),LiftL2 P) := includePath P D.support D.support_measurable ((G.tail τ hτ.le hτT).derivativePath (forwardInitial τ hτ hτT B G)) @@ -162,7 +162,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseParameterRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseParameterRegularity.lean index dea22e6b34..ae66cab43a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseParameterRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseParameterRegularity.lean @@ -20,7 +20,7 @@ constructed transverse solution. Smoothness of every finite order follows from coefficient smoothness; no regularity of a pre-existing inverse is assumed. -/ -@[expose] public section +public section noncomputable section @@ -129,7 +129,8 @@ theorem contDiff_transverse_coordinates funext x have heq := fixedFrameSolver_eq_transverse T hT (Q x) (Q₁ x) (H x) c hc (hLower x) (hd x) K hK (hPotential x) hsmall (m x) (hTangent x) (hRange x) (f x) - exact congrArg (fun v : zeroTraceDerivatives (U := U) T hT => (v : TimeLp T U)) heq.symm + simpa only [transverseBackward_coe, Function.comp_apply, Submodule.subtypeL_apply] using + congrArg (fun v : zeroTraceDerivatives (U := U) T hT => (v : TimeLp T U)) heq.symm include hd in /-- The physical velocity of the original constructed inverse has the actual diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseSourceCoefficientPath.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseSourceCoefficientPath.lean index 1adb117a29..95d92c1485 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseSourceCoefficientPath.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseSourceCoefficientPath.lean @@ -35,7 +35,7 @@ hypotheses using the prescribed invertible deformation and orthonormal reference plane. No inverse solution or acceleration is supplied as input. -/ -@[expose] public section +public section noncomputable section @@ -66,7 +66,7 @@ omit [CompleteSpace U] [CompleteSpace E] in /-- The frame is literally the source expression `F R⊥`. -/ theorem framePath_apply (T : ℝ) (F : C(Icc (0 : ℝ) T, E →L[ℝ] E)) (t : Icc (0 : ℝ) T) (x : U) : - framePath m₀ R T F t x = F t (R x : E) := rfl + framePath m₀ R T F t x = F t (R x : E) := by rfl omit [CompleteSpace U] in /-- The source frame maps into the moving tangent plane. -/ @@ -201,7 +201,7 @@ end end -@[expose] public section +public section noncomputable section @@ -226,7 +226,7 @@ local instance instTransverseSourceCoefficientPath1 : NormedAddCommGroup (Space local instance instTransverseSourceCoefficientPath2 : NormedSpace ℝ (Space →ᵇ V) := inferInstance /-- Actual spatial evaluation, performed uniformly along the time path. -/ -def pathEvaluation (x : Space) : C(K,Space →ᵇ V) →L[ℝ] C(K,V) := +@[expose] def pathEvaluation (x : Space) : C(K,Space →ᵇ V) →L[ℝ] C(K,V) := (BoundedContinuousFunction.evalCLM ℝ x).compLeftContinuous ℝ K /-- Evaluation is a contraction in the genuine uniform path norm. -/ @@ -341,7 +341,7 @@ theorem referenceEmbedding_norm : ‖referenceEmbedding m₀ Rperp‖ ≤ 1 := b rw [one_mul, Rperp.norm_map] /-- Restrict an actual coefficient operator to the reference plane. -/ -def referenceRestriction : (Space →L[ℝ] Space) →L[ℝ] (U →L[ℝ] Space) := +@[expose] def referenceRestriction : (Space →L[ℝ] Space) →L[ℝ] (U →L[ℝ] Space) := (compL ℝ U Space Space).flip (referenceEmbedding m₀ Rperp) /-- The time-path reference restriction is a genuine bounded linear map. -/ @@ -351,7 +351,7 @@ def framePathMap (T : ℝ) : C(Icc (0 : ℝ) T,Space →L[ℝ] Space) →L[ℝ] /-- This restriction is exactly the source frame path `F Rperp`. -/ theorem framePathMap_apply (T : ℝ) (A : C(Icc (0 : ℝ) T, Space →L[ℝ] Space)) : - framePathMap m₀ Rperp T A = framePath m₀ Rperp T A := rfl + framePathMap m₀ Rperp T A = framePath m₀ Rperp T A := by rfl /-- Orthogonal reference restriction does not enlarge the coefficient path norm. -/ theorem framePathMap_norm (T : ℝ) : ‖framePathMap m₀ Rperp T‖ ≤ 1 := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongAlgebra.lean index 54d772cfcb..7b4543393d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongAlgebra.lean @@ -17,7 +17,7 @@ The time derivatives of the Gram and mixed coefficients are genuine derivatives of the prescribed coefficient paths. -/ -@[expose] public section +public section noncomputable section @@ -34,12 +34,12 @@ variable {U E : Type*} variable (T : ℝ) (Q Q₁ Q₂ : C(Icc (0 : ℝ) T, U →L[ℝ] E)) /-- The mixed coefficient `Q* Q_t` in the transverse momentum. -/ -def mixedPath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := +@[expose] def mixedPath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := ⟨fun t => (Q t).adjoint.comp (Q₁ t), ((realAdjoint (U := U) (E := E)).continuous.comp Q.continuous).clm_comp Q₁.continuous⟩ /-- The actual product-rule derivative `Q_t* Q_t + Q* Q_tt`. -/ -def mixedDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := +@[expose] def mixedDerivativePath : C(Icc (0 : ℝ) T, U →L[ℝ] U) := ⟨fun t => (Q₁ t).adjoint.comp (Q₁ t) + (Q t).adjoint.comp (Q₂ t), (((realAdjoint (U := U) (E := E)).continuous.comp Q₁.continuous).clm_comp Q₁.continuous).add diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEquation.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEquation.lean index a785b7f68b..e9fd87c910 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEquation.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEquation.lean @@ -21,7 +21,7 @@ Differentiating the momentum identity and using `Q_tt = -H Q` gives the literal projected equation (10), with no assumed acceleration or differential inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEstimates.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEstimates.lean index c31ab340b0..f794f63757 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseStrongEstimates.lean @@ -16,7 +16,7 @@ These bounds use the lower frame constant and coefficient norms. In particular no exponential dependence on the undifferentiated coefficient norm is introduced. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalInverse.lean index a8e4e6c951..f0609406ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalInverse.lean @@ -35,7 +35,7 @@ and on the moving plane its reconstruction is the identity. These are coefficient identities, not assumptions about a differential inverse. -/ -@[expose] public section +public section noncomputable section @@ -162,7 +162,7 @@ end end -@[expose] public section +public section noncomputable section @@ -198,6 +198,13 @@ def transverseDerivatives (T : ℝ) (hT : 0 ≤ T) (m : Icc (0 : ℝ) T → E) : simp only [map_smul, ContinuousMap.smul_apply, inner_smul_right, hu.2 t, mul_zero] +@[simp] theorem mem_transverseDerivatives (T : ℝ) (hT : 0 ≤ T) + (m : Icc (0 : ℝ) T → E) (u : TimeLp T E) : + u ∈ transverseDerivatives T hT m ↔ + initialTrace T hT u = 0 ∧ + ∀ t, ⟪m t, terminalPrimitive T hT u t⟫_ℝ = 0 := by + rfl + /-- The two endpoint and moving tangency conditions are closed constraints. -/ theorem transverseDerivatives_closed (T : ℝ) (hT : 0 ≤ T) (m : Icc (0 : ℝ) T → E) : IsClosed (transverseDerivatives T hT m : Set (TimeLp T E)) := by @@ -248,6 +255,11 @@ def transversePrimitive (T : ℝ) (hT : 0 ≤ T) (m : Icc (0 : ℝ) T → E) : transverseDerivatives T hT m →L[ℝ] TimeLp T E := (primitiveTimeLp T hT).comp (transverseDerivatives T hT m).subtypeL +@[simp] theorem transversePrimitive_apply (T : ℝ) (hT : 0 ≤ T) + (m : Icc (0 : ℝ) T → E) (u : transverseDerivatives T hT m) : + transversePrimitive T hT m u = primitiveTimeLp T hT (u : TimeLp T E) := by + rfl + /-- The sharp time Poincaré bound holds on the actual transverse space. -/ theorem transversePrimitive_norm_sq (T : ℝ) (hT : 0 ≤ T) (m : Icc (0 : ℝ) T → E) (u : transverseDerivatives T hT m) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalOperator.lean index f3372965e2..eac2ec2755 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseVariationalOperator.lean @@ -21,7 +21,7 @@ This file constructs, rather than assumes, the inverse of the actual operator primitive estimate. No inverse, solution, or weak equation is an input. -/ -@[expose] public section +public section noncomputable section @@ -35,7 +35,7 @@ variable {V W : Type*} [NormedAddCommGroup W] [InnerProductSpace ℝ W] [CompleteSpace W] /-- The operator representing the kinetic form minus the actual potential form. -/ -def dirichletOperator (J : V →L[ℝ] W) (H : W →L[ℝ] W) : V →L[ℝ] V := +@[expose] def dirichletOperator (J : V →L[ℝ] W) (H : W →L[ℝ] W) : V →L[ℝ] V := ContinuousLinearMap.id ℝ V - J.adjoint.comp (H.comp J) /-- This is precisely the displacement variational form. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/TruncationFamily.lean b/LeanPool/NavierStokesAndEuler/Euler/TruncationFamily.lean index 0d518c9edc..f2497a28e3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TruncationFamily.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TruncationFamily.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SmoothTimeField /-! Concrete data required of compact solenoidal velocity truncations. The actual radial-potential construction supplies this record separately. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/TruncationFamilySmooth.lean b/LeanPool/NavierStokesAndEuler/Euler/TruncationFamilySmooth.lean index 4d219cdb18..4edf36a01d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TruncationFamilySmooth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TruncationFamilySmooth.lean @@ -21,7 +21,7 @@ root recovers the original truncation, which is sufficient for the continuous-in-time spatial-jet interface of `SmoothTimeField`. -/ -@[expose] public section +public section noncomputable section @@ -106,7 +106,7 @@ theorem potentialTruncation_square_family_smooth (v : Space × ℝ → Space) potentialTruncation_family_smooth _ (nonnegative_time_square_smooth v hv) χ hχ /-- The continuous time map used to recover the original compact time interval. -/ -def sqrtTimeMap (T : ℝ) : C(Icc (0 : ℝ) T, Icc (0 : ℝ) (Real.sqrt T)) where +@[expose] def sqrtTimeMap (T : ℝ) : C(Icc (0 : ℝ) T, Icc (0 : ℝ) (Real.sqrt T)) where toFun t := ⟨Real.sqrt t, Real.sqrt_nonneg _, Real.sqrt_le_sqrt t.property.2⟩ continuous_toFun := (Real.continuous_sqrt.comp continuous_subtype_val).subtype_mk _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/UnshiftedPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/UnshiftedPressure.lean index 838e38ab47..2c1ccded70 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/UnshiftedPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/UnshiftedPressure.lean @@ -15,7 +15,7 @@ import Mathlib.Data.Nat.Choose.Cast /-! The actual pressure inverse in unshifted Gevrey-weighted fixed Sobolev blocks. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/UnshiftedProducts.lean b/LeanPool/NavierStokesAndEuler/Euler/UnshiftedProducts.lean index 627e5ffdf7..92dea679a4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/UnshiftedProducts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/UnshiftedProducts.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.Choose.Cast /-! Actual unshifted Gevrey product and lower-pressure estimates with constants independent of truncation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ViscosityCauchy.lean b/LeanPool/NavierStokesAndEuler/Euler/ViscosityCauchy.lean index 257ca5bcf9..e903125f6c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ViscosityCauchy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ViscosityCauchy.lean @@ -19,7 +19,7 @@ section /-! Genuine finite-interval Lipschitz comparison of actual correction solutions at different viscosities. -/ -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ end end -@[expose] public section +public section noncomputable section @@ -165,7 +165,7 @@ theorem cauchySeq_of_norm_le {X : Type*} [NormedAddCommGroup X] variable (period : ℝ) [Fact (0 < period)] /-- The genuine continuous L² path underlying a finite-Sobolev correction path. -/ -def valuePath {q : ℕ} (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period q)) : +@[expose] def valuePath {q : ℕ} (T : ℝ) (u : C(Icc (0 : ℝ) T, SobolevSpace period q)) : C(Icc (0 : ℝ) T,LiftL2 period) := (valueOperator period q).compLeftContinuous ℝ (Icc (0 : ℝ) T) u diff --git a/LeanPool/NavierStokesAndEuler/Euler/ViscosityDefect.lean b/LeanPool/NavierStokesAndEuler/Euler/ViscosityDefect.lean index 44f13bdef1..af852db747 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ViscosityDefect.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ViscosityDefect.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.Euler.SobolevHeatGenerator /-! The actual viscous term vanishes uniformly for a uniformly Sobolev-bounded approximation family. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/ViscousSourcePathLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/ViscousSourcePathLimit.lean index 9662e88550..cba3c4b618 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ViscousSourcePathLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ViscousSourcePathLimit.lean @@ -13,7 +13,7 @@ import LeanPool.NavierStokesAndEuler.Euler.SobolevPathLimits /-! Strong convergence of the actual nonlinear and viscous right-hand sides. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/VolterraConvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/VolterraConvolution.lean index 5e4a1d5cfb..e1d9667309 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/VolterraConvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/VolterraConvolution.lean @@ -11,7 +11,7 @@ import Mathlib.Algebra.Order.Star.Real /-! A genuine singular-kernel Volterra convolution on continuous Banach-valued paths. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] variable (T : ℝ) (hT : 0 ≤ T) /-- Continuous extension of a compact-interval path by clamping its time argument. -/ -def extendPath (f : C(Icc (0 : ℝ) T, Y)) (t : ℝ) : Y := f (projIcc 0 T hT t) +@[expose] def extendPath (f : C(Icc (0 : ℝ) T, Y)) (t : ℝ) : Y := f (projIcc 0 T hT t) omit [NormedSpace ℝ Y] in /-- The clamped extension of a continuous path is continuous. -/ @@ -39,7 +39,7 @@ theorem extendPath_norm_le (f : C(Icc (0 : ℝ) T, Y)) (t : ℝ) : ‖extendPath f.norm_coe_le_norm _ /-- The fixed-domain integrand for a causal, possibly singular, time convolution. -/ -def causalIntegrand (K : ℝ → Y →L[ℝ] X) (f : C(Icc (0 : ℝ) T, Y)) +@[expose] def causalIntegrand (K : ℝ → Y →L[ℝ] X) (f : C(Icc (0 : ℝ) T, Y)) (t : Icc (0 : ℝ) T) (r : ℝ) : X := (Iic t.val).indicator (fun r => K r (extendPath T hT f (t.val - r))) r @@ -114,12 +114,19 @@ theorem causalIntegral_continuous (f : C(Icc (0 : ℝ) T, Y)) : exact causalIntegrand_bound T hT K k hk0 hbound f s r hr /-- The actual causal convolution as a continuous path. -/ -def convolution (f : C(Icc (0 : ℝ) T, Y)) : C(Icc (0 : ℝ) T, X) where +@[expose] def convolution (f : C(Icc (0 : ℝ) T, Y)) : C(Icc (0 : ℝ) T, X) where toFun t := ∫ r in Ioc 0 T, causalIntegrand T hT K f t r continuous_toFun := causalIntegral_continuous T hT K k hK hk hk0 hbound f +/-- Evaluating the continuous convolution path gives its causal integral. -/ +@[simp] theorem convolution_apply (f : C(Icc (0 : ℝ) T, Y)) + (t : Icc (0 : ℝ) T) : + convolution T hT K k hK hk hk0 hbound f t = + ∫ r in Ioc 0 T, causalIntegrand T hT K f t r := by + rfl + /-- The scalar mass of an integrable time-kernel bound on the chosen time interval. -/ -def kernelMass : ℝ := ∫ r in Ioc 0 T, k r +@[expose] def kernelMass : ℝ := ∫ r in Ioc 0 T, k r include hk0 in /-- A nonnegative kernel has nonnegative mass. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/VolterraFixedPoint.lean b/LeanPool/NavierStokesAndEuler/Euler/VolterraFixedPoint.lean index aa8baabd3d..b36a6e850b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/VolterraFixedPoint.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/VolterraFixedPoint.lean @@ -11,7 +11,7 @@ import Mathlib.Topology.MetricSpace.Contracting /-! Banach's theorem applied to the actual singular Volterra integral on continuous paths. -/ -@[expose] public section +public section noncomputable section @@ -34,9 +34,7 @@ theorem convolution_sub (f g : C(Icc (0 : ℝ) T, Y)) : convolution T hT K k hK hk hk0 hbound (f - g) = convolution T hT K k hK hk hk0 hbound f - convolution T hT K k hK hk hk0 hbound g := by ext t - change (∫ r in Ioc 0 T, causalIntegrand T hT K (f - g) t r) = - (∫ r in Ioc 0 T, causalIntegrand T hT K f t r) - - ∫ r in Ioc 0 T, causalIntegrand T hT K g t r + simp only [ContinuousMap.sub_apply, convolution_apply] rw [← integral_sub (causalIntegrand_integrable T hT K k hK hk hk0 hbound f t) (causalIntegrand_integrable T hT K k hK hk hk0 hbound g t)] apply integral_congr_ae @@ -52,7 +50,7 @@ theorem convolution_sub_bound (f g : C(Icc (0 : ℝ) T, Y)) : exact convolution_bound T hT K k hK hk hk0 hbound (f - g) /-- Pointwise application of an actual continuous time-dependent nonlinearity to a path. -/ -def pathNonlinearity (F : Icc (0 : ℝ) T → X → Y) +@[expose] def pathNonlinearity (F : Icc (0 : ℝ) T → X → Y) (hF : Continuous (fun p : Icc (0 : ℝ) T × X => F p.1 p.2)) (u : C(Icc (0 : ℝ) T, X)) : C(Icc (0 : ℝ) T, Y) where toFun t := F t (u t) @@ -83,7 +81,7 @@ theorem pathNonlinearity_sub_bound (F : Icc (0 : ℝ) T → X → Y) (mul_le_mul_of_nonneg_left ((u - v).norm_coe_le_norm t) hL) /-- The actual nonlinear Volterra map, including the prescribed free evolution. -/ -def picard (a : C(Icc (0 : ℝ) T, X)) (F : Icc (0 : ℝ) T → X → Y) +@[expose] def picard (a : C(Icc (0 : ℝ) T, X)) (F : Icc (0 : ℝ) T → X → Y) (hF : Continuous (fun p : Icc (0 : ℝ) T × X => F p.1 p.2)) (u : C(Icc (0 : ℝ) T, X)) : C(Icc (0 : ℝ) T, X) := a + convolution T hT K k hK hk hk0 hbound (pathNonlinearity T F hF u) diff --git a/LeanPool/NavierStokesAndEuler/Euler/VolterraUniqueness.lean b/LeanPool/NavierStokesAndEuler/Euler/VolterraUniqueness.lean index 4e09719a93..c3649dc7a3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/VolterraUniqueness.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/VolterraUniqueness.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Order.Star.Real /-! Uniqueness, initial traces, and genuine positive time budgets for the Volterra construction. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WeakTimeContinuity.lean b/LeanPool/NavierStokesAndEuler/Euler/WeakTimeContinuity.lean index fc7aa4d3dd..9d0e0e54e4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WeakTimeContinuity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WeakTimeContinuity.lean @@ -21,7 +21,7 @@ to all `L²` test fields. No spatial derivative integrability or energy conservation assumption is used here. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WeightedCylinderEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/WeightedCylinderEnergy.lean index 9412456691..0e70b04f2d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WeightedCylinderEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WeightedCylinderEnergy.lean @@ -18,7 +18,7 @@ import Mathlib.Analysis.SpecialFunctions.Sqrt /-! Actual Gevrey-weighted cylinder energy with signed radius derivative and no zero-norm differentiation. -/ -@[expose] public section +public section noncomputable section @@ -37,15 +37,15 @@ variable {α β H : Type*} [Fintype α] [Fintype β] [NormedAddCommGroup H] [InnerProductSpace ℝ H] /-- The finite external-word Gevrey sum of the source's base-word metric roots. -/ -def weightedMetricSum (ρ : ℝ) (order : α → ℕ) (K : H →L[ℝ] H) (e : α → β → H) : ℝ := +@[expose] def weightedMetricSum (ρ : ℝ) (order : α → ℕ) (K : H →L[ℝ] H) (e : α → β → H) : ℝ := ∑ i, weight ρ (order i) * familyMetricNorm K (e i) /-- The same metric sum with the external derivative count, giving the radius-loss term. -/ -def weightedMetricLoss (ρ : ℝ) (order : α → ℕ) (K : H →L[ℝ] H) (e : α → β → H) : ℝ := +@[expose] def weightedMetricLoss (ρ : ℝ) (order : α → ℕ) (K : H →L[ℝ] H) (e : α → β → H) : ℝ := ∑ i, (order i : ℝ) * weight ρ (order i) * familyMetricNorm K (e i) /-- The actual finite weighted sum of base-word Hilbert forcing norms. -/ -def weightedForcingSum (ρ : ℝ) (order : α → ℕ) (f : α → β → H) : ℝ := +@[expose] def weightedForcingSum (ρ : ℝ) (order : α → ℕ) (f : α → β → H) : ℝ := ∑ i, weight ρ (order i) * familyNorm (f i) end WeightedNorms @@ -53,7 +53,7 @@ end WeightedNorms variable (period : ℝ) [Fact (0 < period)] /-- The explicit common coefficient in the actual viscous metric-root estimate. -/ -def viscousGrowthCoefficient (K : SmoothCoefficient period) +@[expose] def viscousGrowthCoefficient (K : SmoothCoefficient period) (K' : LiftL2 period →L[ℝ] LiftL2 period) (κ : ℝ) (m : Vector3) (c ν : ℝ) (B : ℝ≥0) : ℝ := (‖K'‖ + 2 * transportEnergyConstant period K κ m B + 2 * ν * heatEnergyConstant period K c) / (2 * c ^ 2) diff --git a/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingAlgebra.lean index eaede1828a..27cc2783e3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingAlgebra.lean @@ -15,7 +15,7 @@ section /-! Exact triangle inequalities for the actual finite Hilbert forcing families. -/ -@[expose] public section +public section noncomputable section @@ -86,7 +86,7 @@ section /-! Complete finite-cutoff pressure commutator bounds for both actual source components. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean b/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean index 77a46a370a..0ff3b95ae5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean @@ -16,7 +16,7 @@ section /-! Actual L²-time convergence of finite Hilbert forcing norms. -/ -@[expose] public section +public section noncomputable section @@ -85,7 +85,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WeightedRootLimit.lean b/LeanPool/NavierStokesAndEuler/Euler/WeightedRootLimit.lean index bd0c91b602..3752e10465 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WeightedRootLimit.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WeightedRootLimit.lean @@ -23,7 +23,7 @@ section /-! Weighted removal of root regularization, preserving the signed derivative of the radius. -/ -@[expose] public section +public section noncomputable section @@ -132,7 +132,7 @@ section # Weighted Energy -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussian.lean b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussian.lean index 6367c0eb48..d072d22529 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussian.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussian.lean @@ -20,7 +20,7 @@ below concern the literal Bochner integral, including its L²-to-uniform bound. The parameterization exp(-|x|²/t) has heat generator one quarter of the Laplacian. -/ -@[expose] public section +public section noncomputable section @@ -31,10 +31,10 @@ open MeasureTheory InnerProductSpace EulerSmoothLimit EulerLpTranslation Filter open scoped ContDiff ENNReal RealInnerProductSpace /-- Normalization, given by `(Real.pi*t)^(-(3:ℝ)/2)`. -/ -def normalization (t : ℝ) : ℝ := (Real.pi*t)^(-(3:ℝ)/2) +@[expose] def normalization (t : ℝ) : ℝ := (Real.pi*t)^(-(3:ℝ)/2) /-- Kernel, given by `normalization t * Real.exp (-t⁻¹*‖x‖^2)`. -/ -def kernel (t : ℝ) (x : Space) : ℝ := +@[expose] def kernel (t : ℝ) (x : Space) : ℝ := normalization t * Real.exp (-t⁻¹*‖x‖^2) theorem normalization_pos {t : ℝ} (ht : 0 < t) : 0 < normalization t := @@ -122,7 +122,7 @@ section Averaging variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- The actual whole-space Gaussian average, with no periodic identification. -/ -def average (t : ℝ) (f : Space → V) (x : Space) : V := +@[expose] def average (t : ℝ) (f : Space → V) (x : Space) : V := ∫ y : Space, kernel t y • f (x+y) theorem average_integrable_of_bound {t : ℝ} (ht : 0 < t) diff --git a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianEvolution.lean b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianEvolution.lean index deb7c6355a..881fd0b4b7 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianEvolution.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianEvolution.lean @@ -24,7 +24,7 @@ section /-! The literal time derivative of the Gaussian density and local domination. -/ -@[expose] public section +public section noncomputable section @@ -131,7 +131,7 @@ end end -@[expose] public section +public section noncomputable section @@ -178,7 +178,7 @@ theorem average_hasDerivAt_kernel {t : ℝ} (ht : 0 < t) /-- Second average, given by `∑ i : Fin 3, average t (fun z => fderiv ℝ (fun y => fderiv ℝ f y (EuclideanSpace.single i 1)) z (EuclideanSpace.single i 1)) x`. -/ -def secondAverage (t : ℝ) (f : Space → V) (x : Space) : V := +@[expose] def secondAverage (t : ℝ) (f : Space → V) (x : Space) : V := ∑ i : Fin 3, average t (fun z => fderiv ℝ (fun y => fderiv ℝ f y (EuclideanSpace.single i 1)) z (EuclideanSpace.single i 1)) x @@ -221,7 +221,7 @@ section /-! The low-frequency derivative of the true Gaussian average is controlled by the ordinary L² norm of the original field. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean index 00128a7aad..4fd46e01b3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean @@ -23,7 +23,7 @@ section /-! The same Gaussian average as a continuous dilation of a fixed kernel. -/ -@[expose] public section +public section noncomputable section @@ -119,7 +119,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianIntegration.lean b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianIntegration.lean index 8b0cb39fe5..3472a8643d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianIntegration.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianIntegration.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts /-! Integration by parts for the literal whole-space Gaussian average. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianKernel.lean b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianKernel.lean index 65e3464118..5a3d3b71e5 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianKernel.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianKernel.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform /-! Actual first and second Gaussian kernels and their integrable bounds. -/ -@[expose] public section +public section noncomputable section @@ -24,15 +24,15 @@ open MeasureTheory InnerProductSpace EulerSmoothLimit Filter open scoped ContDiff ENNReal RealInnerProductSpace /-- Wide kernel, given by `normalization t * Real.exp (-(2*t)⁻¹*‖x‖^2)`. -/ -def wideKernel (t : ℝ) (x : Space) : ℝ := +@[expose] def wideKernel (t : ℝ) (x : Space) : ℝ := normalization t * Real.exp (-(2*t)⁻¹*‖x‖^2) /-- First kernel, given by `(-2*t⁻¹*⟪x,a⟫_ℝ) * kernel t x`. -/ -def firstKernel (t : ℝ) (a x : Space) : ℝ := +@[expose] def firstKernel (t : ℝ) (a x : Space) : ℝ := (-2*t⁻¹*⟪x,a⟫_ℝ) * kernel t x /-- Second kernel, given by `(4*t⁻¹^2*⟪x,a⟫_ℝ*⟪x,b⟫_ℝ - 2*t⁻¹*⟪a,b⟫_ℝ) * kernel t x`. -/ -def secondKernel (t : ℝ) (a b x : Space) : ℝ := +@[expose] def secondKernel (t : ℝ) (a b x : Space) : ℝ := (4*t⁻¹^2*⟪x,a⟫_ℝ*⟪x,b⟫_ℝ - 2*t⁻¹*⟪a,b⟫_ℝ) * kernel t x theorem firstKernel_smooth (t : ℝ) (a : Space) : ContDiff ℝ ∞ (firstKernel t a) := by diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/FiniteDimensionalBumps.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/FiniteDimensionalBumps.lean index dc378c367a..dc413ba111 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/FiniteDimensionalBumps.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/FiniteDimensionalBumps.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension /-! The existence of smooth bumps, separated from their construction. -/ -@[expose] public section +public section /-- A finite-dimensional real normed space admits smooth bump functions. This proof can be activated as an instance locally when defining cutoff data. -/ diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/StronglyMeasurable.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/StronglyMeasurable.lean index 4d9891a0fa..bc7c3e5f1a 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/StronglyMeasurable.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/StronglyMeasurable.lean @@ -10,7 +10,7 @@ public import Mathlib.MeasureTheory.Function.StronglyMeasurable.AEStronglyMeasur /-! Strong measurability using second countability of the source. -/ -@[expose] public section +public section open MeasureTheory TopologicalSpace diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationCone.lean index d704210191..9430f02b9b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationCone.lean @@ -20,7 +20,7 @@ In particular, none of their constants involves the inverse of the retained damping parameter. The later results use the constructed activation fields. -/ -@[expose] public section +public section noncomputable section @@ -485,7 +485,7 @@ noncomputable def activatedCross (h X0 : ℝ) (initial : HistoryRow → ℝ → (activatedStockTwo h X0 initial L U T κ p) (shearSlope T κ X0 L U p) /-- Activated stress as an element of `ℝ × ℝ`. -/ -noncomputable def activatedStress (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) +@[expose] noncomputable def activatedStress (h X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) (L U : Field) (T κ : ℝ) (p : Point) : ℝ × ℝ := (activatedAngular T κ L p * (activatedStockOne h X0 initial L U T κ p - actualP1 T κ L p), activatedAngular T κ L p * (activatedStockTwo h X0 initial L U T κ p - actualP2 T κ X0 L U p)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationContinuation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationContinuation.lean index c696886fb5..ec69bb9020 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationContinuation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationContinuation.lean @@ -30,7 +30,7 @@ The history estimates below use the primitive-defined lags and pressure of choices are derived from the constructed natural and reference profiles. -/ -@[expose] public section +public section noncomputable section @@ -46,25 +46,25 @@ section Histories variable {D : RadialDomain} (P : Profiles D) /-- Log slope, given by `1 + p.1 * radialPartial P.f p / P.f p`. -/ -noncomputable def logSlope (p : Point) : ℝ := +@[expose] noncomputable def logSlope (p : Point) : ℝ := 1 + p.1 * radialPartial P.f p / P.f p /-- Source Q as an element of `ℝ`. -/ -noncomputable def sourceQ (h : ℝ) (p : Point) : ℝ := +@[expose] noncomputable def sourceQ (h : ℝ) (p : Point) : ℝ := -P.W h p * logSlope P p - h * (1 - 2 * p.2 * P.U p) - (StressAlgebra.axialExponent h * p.2 + StressAlgebra.coordinateFactor p.2 * P.U p) * (parameterPartial P.f p / P.f p) /-- P1, given by `p.1 * P.angularLag h p / NaturalAxisData.L h p.2`. -/ -noncomputable def p1 (h : ℝ) (p : Point) : ℝ := +@[expose] noncomputable def p1 (h : ℝ) (p : Point) : ℝ := p.1 * P.angularLag h p / NaturalAxisData.L h p.2 /-- Ns, given by `P.axialLag h p / NaturalAxisData.L h p.2`. -/ -noncomputable def ns (h : ℝ) (p : Point) : ℝ := +@[expose] noncomputable def ns (h : ℝ) (p : Point) : ℝ := P.axialLag h p / NaturalAxisData.L h p.2 /-- P2, given by `p.1 * ns P h p / P.E p`. -/ -noncomputable def p2 (h : ℝ) (p : Point) : ℝ := p.1 * ns P h p / P.E p +@[expose] noncomputable def p2 (h : ℝ) (p : Point) : ℝ := p.1 * ns P h p / P.E p /-- Cone size, given by `p1 P h p + p2 P h p ^ 2 / p1 P h p`. -/ noncomputable def coneSize (h : ℝ) (p : Point) : ℝ := @@ -1334,7 +1334,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1346,11 +1346,11 @@ namespace NavierStokes.ActivationContinuation open ProfileHistories /-- Shear size, given by `a * (1 + (b / a) ^ 2)`. -/ -noncomputable def shearSize (a b : ℝ) : ℝ := a * (1 + (b / a) ^ 2) +@[expose] noncomputable def shearSize (a b : ℝ) : ℝ := a * (1 + (b / a) ^ 2) /-- Projection, given by `p + q * (b / a)`. -/ -noncomputable def projection (p q a b : ℝ) : ℝ := p + q * (b / a) +@[expose] noncomputable def projection (p q a b : ℝ) : ℝ := p + q * (b / a) /-- Transverse, given by `q - p * (b / a)`. -/ -noncomputable def transverse (p q a b : ℝ) : ℝ := q - p * (b / a) +@[expose] noncomputable def transverse (p q a b : ℝ) : ℝ := q - p * (b / a) /-- Relaxed data, collecting `first_positive`, `projection_positive`, `cone`. -/ structure Relaxed (a b p q : ℝ) : Prop where @@ -1474,13 +1474,13 @@ section Physical variable {D : RadialDomain} (P : Profiles D) /-- Shear A, given by `-2 * p.1 * radialPartial P.f p / P.f p`. -/ -noncomputable def shearA (p : Point) : ℝ := -2 * p.1 * radialPartial P.f p / P.f p +@[expose] noncomputable def shearA (p : Point) : ℝ := -2 * p.1 * radialPartial P.f p / P.f p /-- Shear B, given by `-2 * p.1 * radialPartial P.U p / P.E p`. -/ -noncomputable def shearB (p : Point) : ℝ := -2 * p.1 * radialPartial P.U p / P.E p +@[expose] noncomputable def shearB (p : Point) : ℝ := -2 * p.1 * radialPartial P.U p / P.E p /-- Is relaxed, given by `Relaxed (shearA P p) (shearB P p) (ReferenceBounds.p1 P h p) (ReferenceBounds.p2 P h p)`. -/ -noncomputable def IsRelaxed (h : ℝ) (p : Point) : Prop := +@[expose] noncomputable def IsRelaxed (h : ℝ) (p : Point) : Prop := Relaxed (shearA P p) (shearB P p) (ReferenceBounds.p1 P h p) (ReferenceBounds.p2 P h p) theorem logSlope_eq_shear (p : Point) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationStocks.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationStocks.lean index 9dfc7760a7..31439f9595 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationStocks.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActivationStocks.lean @@ -28,7 +28,7 @@ All error factors below are actual transformed integrals and are smooth at `T = 0`. Compactness therefore gives width-uniform parameter-jet estimates. -/ -@[expose] public section +public section noncomputable section @@ -122,7 +122,7 @@ theorem scaledDomain_open {J : Set ℝ} (hJ : IsOpen J) : IsOpen (scaledDomain J isOpen_univ.prod (isOpen_univ.prod hJ) /-- The auxiliary parameters are `(κ,T)` and the point is `(u,η)`. -/ -noncomputable def rescale (F : Field) (q : ScaledPoint) : ℝ := +@[expose] noncomputable def rescale (F : Field) (q : ScaledPoint) : ℝ := F (q.1.2 * q.2.1, q.2.2) theorem rescale_smooth {J : Set ℝ} (hJ : IsOpen J) {F : Field} @@ -132,7 +132,7 @@ theorem rescale_smooth {J : Set ℝ} (hJ : IsOpen J) {F : Field} (fun _ hp => ⟨mem_univ _, hp.2.2⟩) /-- Scaled distance, given by `q.1.2 * q.2.1 * activation 1 q.1.1 q.2.1`. -/ -noncomputable def scaledDistance (q : ScaledPoint) : ℝ := +@[expose] noncomputable def scaledDistance (q : ScaledPoint) : ℝ := q.1.2 * q.2.1 * activation 1 q.1.1 q.2.1 theorem scaledDistance_smooth : ContDiff ℝ ∞ scaledDistance := by @@ -207,7 +207,7 @@ theorem controlled_scaled_factor {T : ℝ} (hT : T ≠ 0) (κ : ℝ) ring /-- Controlled value, given by `rescale F q + scaledDistance q * controlledErrorFactor F q`. -/ -noncomputable def controlledValue (F : Field) (q : ScaledPoint) : ℝ := +@[expose] noncomputable def controlledValue (F : Field) (q : ScaledPoint) : ℝ := rescale F q + scaledDistance q * controlledErrorFactor F q theorem controlledValue_smooth {J : Set ℝ} (hJ : IsOpen J) {F : Field} @@ -225,7 +225,7 @@ theorem controlledValue_eq {T : ℝ} (hT : T ≠ 0) (κ : ℝ) linarith /-- Angular value, defined pointwise by `Real.exp (controlledValue L q)`. -/ -noncomputable def angularValue (L : Field) : ScaledPoint → ℝ := +@[expose] noncomputable def angularValue (L : Field) : ScaledPoint → ℝ := fun q => Real.exp (controlledValue L q) /-- Relative error factor, given by `controlledErrorFactor L q * meanExp (scaledDistance q * @@ -771,7 +771,7 @@ end end -@[expose] public section +public section noncomputable section @@ -781,34 +781,34 @@ open Set Filter ProfileHistories StressActivation open scoped Topology ContDiff /-- Mass flux, given by `X - 2 * NaturalAxisData.D h * η * M - NaturalAxisData.d η * Mη`. -/ -noncomputable def massFlux (h X η M Mη : ℝ) : ℝ := +@[expose] noncomputable def massFlux (h X η M Mη : ℝ) : ℝ := X - 2 * NaturalAxisData.D h * η * M - NaturalAxisData.d η * Mη /-- Angular remainder, given by `(1 - h) * I - NaturalAxisData.D h * η * Iη - NaturalAxisData.d η * Jη + 2 * (h - NaturalAxisData.D h) * η * J`. -/ -noncomputable def angularRemainder (h η I Iη J Jη : ℝ) : ℝ := +@[expose] noncomputable def angularRemainder (h η I Iη J Jη : ℝ) : ℝ := (1 - h) * I - NaturalAxisData.D h * η * Iη - NaturalAxisData.d η * Jη + 2 * (h - NaturalAxisData.D h) * η * J /-- Stock one, given by `(-massFlux h X η M Mη + angularRemainder h η I Iη J Jη / (2 * X * f)) / NaturalAxisData.L h η`. -/ -noncomputable def stockOne (h X η f M Mη I Iη J Jη : ℝ) : ℝ := +@[expose] noncomputable def stockOne (h X η f M Mη I Iη J Jη : ℝ) : ℝ := (-massFlux h X η M Mη + angularRemainder h η I Iη J Jη / (2 * X * f)) / NaturalAxisData.L h η /-- Stock two as an element of `ℝ`. -/ -noncomputable def stockTwo (h X η f U M Mη S Sη P Pη : ℝ) : ℝ := +@[expose] noncomputable def stockTwo (h X η f U M Mη S Sη P Pη : ℝ) : ℝ := (-massFlux h X η M Mη * U + NaturalAxisData.D h * (M - η * Mη) + 4 * h * η * S - NaturalAxisData.d η * Sη + X * (4 * NaturalAxisData.A h * η * P - NaturalAxisData.d η * Pη)) / (NaturalAxisData.L h η * Real.sqrt (2 * X) * f) /-- Profile stock one, given by `p.1 * P.angularLag h p / NaturalAxisData.L h p.2`. -/ -noncomputable def profileStockOne {D : RadialDomain} (P : Profiles D) (h : ℝ) +@[expose] noncomputable def profileStockOne {D : RadialDomain} (P : Profiles D) (h : ℝ) (p : Point) : ℝ := p.1 * P.angularLag h p / NaturalAxisData.L h p.2 /-- Profile stock two, given by `p.1 * P.axialLag h p / (NaturalAxisData.L h p.2 * P.E p)`. -/ -noncomputable def profileStockTwo {D : RadialDomain} (P : Profiles D) (h : ℝ) +@[expose] noncomputable def profileStockTwo {D : RadialDomain} (P : Profiles D) (h : ℝ) (p : Point) : ℝ := p.1 * P.axialLag h p / (NaturalAxisData.L h p.2 * P.E p) theorem profile_massFlux {D : RadialDomain} (P : Profiles D) (h : ℝ) @@ -1435,7 +1435,7 @@ theorem historyEtaPair_actual {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) theorem historyEtaPair_reference (q : ScaledPoint) (r : HistoryRow) : (etaPair hJ (historyPair X0 initial hJ hL hU hi r)).reference q = - etaD (logHistory X0 initial (referenceAngular L) U r) (q.1.2 * q.2.1, q.2.2) := rfl + etaD (logHistory X0 initial (referenceAngular L) U r) (q.1.2 * q.2.1, q.2.2) := by rfl theorem activationOnePair_actual {T : ℝ} (hT : T ≠ 0) (κ u : ℝ) {η : ℝ} (hη : η ∈ J) : @@ -1690,7 +1690,7 @@ theorem profiles_stocks_congr {D E : RadialDomain} (P : Profiles D) (Q : Profile rfl /-- Natural domain, bundling `carrier`, `isOpen`, `scale_mem`. -/ -noncomputable def naturalDomain {Λ : ℝ} (hΛ : 0 < Λ) : RadialDomain where +@[expose] noncomputable def naturalDomain {Λ : ℝ} (hΛ : 0 < Λ) : RadialDomain where carrier := NaturalProfile.domain Λ isOpen := NaturalProfile.domain_isOpen Λ scale_mem := by @@ -1713,7 +1713,7 @@ variable {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : NaturalAxisCoefficients.Ana /-- Natural histories, bundling `f`, `U`, `f_smooth`, `U_smooth` and the required compatibility proofs. -/ -noncomputable def naturalHistories : Profiles (naturalDomain hΛ) where +@[expose] noncomputable def naturalHistories : Profiles (naturalDomain hΛ) where f := F.f U := F.U f_smooth := F.natural.f_smooth diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActiveAnnulusWeight.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActiveAnnulusWeight.lean index 24560d4831..555814ff64 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActiveAnnulusWeight.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActiveAnnulusWeight.lean @@ -19,7 +19,7 @@ The logarithmic edge distances carry their actual exponential coefficients. The global estimates are obtained from smooth edge factors and compactness. -/ -@[expose] public section +public section noncomputable section @@ -30,12 +30,14 @@ open Set Filter Metric open scoped Topology ContDiff /-- Weight, given by `FlatCutoff.edge c (y-a) * FlatCutoff.edge 4 (b-y)`. -/ +@[expose] noncomputable def weight (c a b y : ℝ) : ℝ := FlatCutoff.edge c (y-a) * FlatCutoff.edge 4 (b-y) /-- Edge distance, given by `min 1 (min (y-a) (b-y))`. -/ -noncomputable def edgeDistance (a b y : ℝ) : ℝ := min 1 (min (y-a) (b-y)) +@[expose] noncomputable def edgeDistance (a b y : ℝ) : ℝ := min 1 (min (y-a) (b-y)) /-- Radial weight, with branches according to `0 < X`. -/ +@[expose] noncomputable def radialWeight (c a b X : ℝ) : ℝ := if 0 < X then weight c a b (Real.log X) else 0 theorem edge_le_one {c : ℝ} (hc : 0 ≤ c) (x : ℝ) : FlatCutoff.edge c x ≤ 1 := by @@ -358,9 +360,9 @@ theorem EdgeFactor.collar {K : Set E} (hK : IsCompact K) {c : ℝ} {T : E × ℝ _ = _ := mul_comm _ _ /-- Left chart, given by `T (q.1,a+q.2)`. -/ -noncomputable def leftChart (a : ℝ) (T : E × ℝ → V) (q : E × ℝ) : V := T (q.1,a+q.2) +@[expose] noncomputable def leftChart (a : ℝ) (T : E × ℝ → V) (q : E × ℝ) : V := T (q.1,a+q.2) /-- Right chart, given by `T (q.1,b-q.2)`. -/ -noncomputable def rightChart (b : ℝ) (T : E × ℝ → V) (q : E × ℝ) : V := T (q.1,b-q.2) +@[expose] noncomputable def rightChart (b : ℝ) (T : E × ℝ → V) (q : E × ℝ) : V := T (q.1,b-q.2) /-- Radial reflection, given by `{ (LinearEquiv.refl ℝ E).prodCongr (LinearEquiv.neg ℝ) with norm_map' := by intro q; simp [Prod.norm_def] }`. -/ @@ -584,9 +586,9 @@ variable {E V : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Log chart, given by `(q.1,Real.log q.2)`. -/ -noncomputable def logChart (q : E × ℝ) : E × ℝ := (q.1,Real.log q.2) +@[expose] noncomputable def logChart (q : E × ℝ) : E × ℝ := (q.1,Real.log q.2) /-- Radial pullback, given by `T (logChart q)`. -/ -noncomputable def radialPullback (T : E × ℝ → V) (q : E × ℝ) : V := T (logChart q) +@[expose] noncomputable def radialPullback (T : E × ℝ → V) (q : E × ℝ) : V := T (logChart q) theorem logChart_smooth : ContDiffOn ℝ ∞ (logChart (E := E)) ((univ : Set E) ×ˢ Ioi (0 : ℝ)) := by @@ -695,7 +697,7 @@ section Directions variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Tilt, given by `v.2 / v.1`. -/ -noncomputable def tilt (v : ℝ × ℝ) : ℝ := v.2 / v.1 +@[expose] noncomputable def tilt (v : ℝ × ℝ) : ℝ := v.2 / v.1 /-- Unit of tilt, given by `((Real.sqrt (1+t^2))⁻¹,t / Real.sqrt (1+t^2))`. -/ noncomputable def unitOfTilt (t : ℝ) : ℝ × ℝ := @@ -790,8 +792,9 @@ theorem EdgeFactor.direction_collar {K : Set E} (hK : IsCompact K) {c : ℝ} exact mul_pos (div_pos (FlatCutoff.edge_pos _ hx) (pow_pos hx _)) (hpos p hp x ⟨hx.le,hxd⟩) /-- Direction projection, given by `1+s*t`. -/ -noncomputable def directionProjection (s t : ℝ) : ℝ := 1+s*t +@[expose] noncomputable def directionProjection (s t : ℝ) : ℝ := 1+s*t /-- Direction gap, given by `2*(directionProjection s t)^2 - (v-2)*(t-s)^2`. -/ +@[expose] noncomputable def directionGap (v s t : ℝ) : ℝ := 2*(directionProjection s t)^2 - (v-2)*(t-s)^2 theorem aligned_direction_margin (v s : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualBaseResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualBaseResidual.lean index 0f39335c1b..372ecaf973 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualBaseResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualBaseResidual.lean @@ -17,7 +17,7 @@ The equation is derived from its proved residual identity on the entire free auxiliary lift, rather than only on a physical graph. -/ -@[expose] public section +public section noncomputable section @@ -167,7 +167,7 @@ noncomputable def cylinderLinear (h Q : ℝ) : Full →L[ℝ] SpaceTime where /-- Cylinder point, given by `(1 - Q * x.1.2.1.1, AxisymmetricResidual.pack (Real.sqrt Q * x.1.1) x.2 (Q ^ CoordinateAlgebra.D h * x.1.2.1.2))`. -/ -noncomputable def cylinderPoint (h Q : ℝ) (x : Full) : SpaceTime := +@[expose] noncomputable def cylinderPoint (h Q : ℝ) (x : Full) : SpaceTime := (1 - Q * x.1.2.1.1, AxisymmetricResidual.pack (Real.sqrt Q * x.1.1) x.2 (Q ^ CoordinateAlgebra.D h * x.1.2.1.2)) @@ -194,7 +194,7 @@ theorem cylinderPoint_hasFDerivAt (h Q : ℝ) (x : Full) : /-- Physical point, given by `((cylinderPoint h Q x).1, CylindricalResidual.chart (cylinderPoint h Q x).2)`. -/ -noncomputable def physicalPoint (h Q : ℝ) (x : Full) : SpaceTime := +@[expose] noncomputable def physicalPoint (h Q : ℝ) (x : Full) : SpaceTime := ((cylinderPoint h Q x).1, CylindricalResidual.chart (cylinderPoint h Q x).2) theorem physicalPoint_smooth (h Q : ℝ) : ContDiff ℝ ∞ (physicalPoint h Q) := @@ -514,7 +514,7 @@ noncomputable def pressureAtScale (Q : ℝ) (x : Full) : ℝ := FinalSlowBase.pressure H v upper B (physicalPoint F.data.h Q x) /-- The normalized Cartesian error, expressed in the cylindrical frame. -/ -noncomputable def errorAtScale (Q : ℝ) (x : Full) : Fin 3 → ℝ := fun i => +@[expose] noncomputable def errorAtScale (Q : ℝ) (x : Full) : Fin 3 → ℝ := fun i => Q ^ (2 * CoordinateAlgebra.A F.data.h + 1 / 2) * CylindricalResidual.frame (-x.2) (FinalSlowBase.error H v upper B (physicalPoint F.data.h Q x)) i @@ -536,7 +536,7 @@ noncomputable def basePressure (n : ℕ) : Full → ℝ := pressureAtScale H v upper B (ChartScales.Q n) /-- Base error, given by `errorAtScale H v upper B (ChartScales.Q n)`. -/ -noncomputable def baseError (n : ℕ) : Full → Fin 3 → ℝ := +@[expose] noncomputable def baseError (n : ℕ) : Full → Fin 3 → ℝ := errorAtScale H v upper B (ChartScales.Q n) theorem pressureAtScale_smooth {Q : ℝ} (hQ : 0 < Q) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean index 15d98b761a..b9a153d27f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean @@ -39,7 +39,7 @@ fixed actual cycle parameters. The finite labels, phase carriers, base error, and current pressure alias are retained through the literal recurrence. -/ -@[expose] public section +public section noncomputable section @@ -1104,7 +1104,7 @@ the actual initial mean families and the existing extensions of the same base potential and pressure. No output extension is an input below. -/ -@[expose] public section +public section noncomputable section @@ -1396,7 +1396,7 @@ argument; a representation by a fixed-reference copy family is unnecessary. The zeroth potential and pressure retain the separately extended slow base. -/ -@[expose] public section +public section noncomputable section @@ -1877,7 +1877,7 @@ the curl is therefore the actual particular velocity increment, with its physica scale and moving frame. No output representation is an input to these identities. -/ -@[expose] public section +public section noncomputable section @@ -2172,7 +2172,7 @@ nominal active annulus, without enlarging either edge. This applies to the literal initialized fields and to every mean stage of the same coherent cycle. -/ -@[expose] public section +public section noncomputable section @@ -2381,7 +2381,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierGeometry.lean index 4a27510e30..daeb9e603f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierGeometry.lean @@ -16,7 +16,7 @@ but does not keep a separate dyadic mask. A single geometric threshold, chosen before the actual primary family, controls this larger carrier. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierTransport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierTransport.lean index 0e6ab1b86a..b20e08190b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierTransport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCarrierTransport.lean @@ -16,7 +16,7 @@ The geometry and support proofs live below the stage controls in canonical parameter record without adding a solved-field assumption. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCoreSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCoreSupport.lean index bfb42de808..8d65aca37a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCoreSupport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCoreSupport.lean @@ -19,7 +19,7 @@ part. No continuity of the totalized similarity coordinate at time zero is used. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularBounds.lean index 8be4b1b9e3..1be3ae105d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularBounds.lean @@ -32,7 +32,7 @@ Positive jets have a fixed `Q^(-2h)` loss, uniformly before the label and band are selected. No bound on the unbounded phase value is asserted. -/ -@[expose] public section +public section noncomputable section @@ -240,7 +240,7 @@ end end -@[expose] public section +public section noncomputable section @@ -623,7 +623,7 @@ end Carrier /-! ## The current physical graph, with no copy-family premise -/ /-- Current loss, given by `degree + ρ * m + PhysicalGraphBounds.graphLoss m + 1`. -/ -noncomputable def currentLoss (degree ρ : ℝ) (m : ℕ) : ℝ := +@[expose] noncomputable def currentLoss (degree ρ : ℝ) (m : ℕ) : ℝ := degree + ρ * m + PhysicalGraphBounds.graphLoss m + 1 private theorem mode_majorant_factorization {Q : ℝ} (hQ : 0 < Q) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularPhysical.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularPhysical.lean index c56e360f82..2d6e6dcc45 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularPhysical.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentParticularPhysical.lean @@ -20,7 +20,7 @@ of a polar angle depends only on the Cartesian point and is independent of the band. No regularity of a fixed-reference continuation is used. -/ -@[expose] public section +public section noncomputable section @@ -56,7 +56,7 @@ theorem copyData_eq_actual (x : CycleState (Label B N0)) (l : Label B N0) (j : rw [ActualParticularStageControls.parameters_eq_canonical x l hf] /-- The current common coefficient includes every localized copy cutoff. -/ -noncomputable def nativePotential (x : CycleState (Label B N0)) (l : Label B N0) +@[expose] noncomputable def nativePotential (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) : Native → ComplexVector := (copyData x l j).common.curlPotential (ParticularParameters.nativeStrip ActualParticularStageControls.associatedStrip) @@ -64,7 +64,7 @@ noncomputable def nativePotential (x : CycleState (Label B N0)) (l : Label B N0) /-- Native pressure, given by `mode ((copyData x l j).background.frequency n) ((copyData x l j).background.phase n) ((copyData x l j).common.pressure n)`. -/ -noncomputable def nativePressure (x : CycleState (Label B N0)) (l : Label B N0) +@[expose] noncomputable def nativePressure (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) : Native → ℂ := mode ((copyData x l j).background.frequency n) ((copyData x l j).background.phase n) ((copyData x l j).common.pressure n) @@ -79,18 +79,18 @@ noncomputable def angle (w : SpaceTime) : ℝ := /-- Cylinder point, given by `(w.1, AxisymmetricResidual.pack (PolarCharts.radius (PhysicalGraphBounds.radialProjection w)) (angle w) (w.2 2))`. -/ -noncomputable def cylinderPoint (w : SpaceTime) : SpaceTime := +@[expose] noncomputable def cylinderPoint (w : SpaceTime) : SpaceTime := (w.1, AxisymmetricResidual.pack (PolarCharts.radius (PhysicalGraphBounds.radialProjection w)) (angle w) (w.2 2)) /-- This is a current-band map; it does not use the reference band of a label. -/ -noncomputable def nativePoint (n : ℕ) (w : SpaceTime) : Native := +@[expose] noncomputable def nativePoint (n : ℕ) (w : SpaceTime) : Native := PhysicalParticularWave.nativeMap CorrectionInitialization.ActualPrimary.h (ChartScales.Q n) (CommonWindow.index CorrectionInitialization.ActualPrimary.h n) (cylinderPoint w) /-- Cylindrical potential as an element of `ComplexVector`. -/ -noncomputable def cylindricalPotential (x : CycleState (Label B N0)) (l : Label B N0) +@[expose] noncomputable def cylindricalPotential (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) (z : SpaceTime) : ComplexVector := (ChartScales.Q n) ^ (-CorrectionInitialization.ActualPrimary.h) • nativePotential x l j n @@ -98,7 +98,7 @@ noncomputable def cylindricalPotential (x : CycleState (Label B N0)) (l : Label (ChartScales.Q n) (CommonWindow.index CorrectionInitialization.ActualPrimary.h n) z) /-- Cylindrical pressure as an element of `ℝ`. -/ -noncomputable def cylindricalPressure (x : CycleState (Label B N0)) (l : Label B N0) +@[expose] noncomputable def cylindricalPressure (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) (z : SpaceTime) : ℝ := (ChartScales.Q n) ^ (-2 * CoordinateAlgebra.A CorrectionInitialization.ActualPrimary.h) * (nativePressure x l j n @@ -106,7 +106,7 @@ noncomputable def cylindricalPressure (x : CycleState (Label B N0)) (l : Label B (ChartScales.Q n) (CommonWindow.index CorrectionInitialization.ActualPrimary.h n) z)).re /-- A single actual harmonic, in Cartesian coordinates. -/ -noncomputable def localPotentialMode (x : CycleState (Label B N0)) (l : Label B N0) +@[expose] noncomputable def localPotentialMode (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) (n : ℕ) (w : SpaceTime) : Space := PhysicalCurlCovariance.realVector (CartesianCopySource.rotationMap (PhysicalGraphBounds.radialProjection w) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentWaveSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentWaveSupport.lean index b565080230..ec8b32f2f7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentWaveSupport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCurrentWaveSupport.lean @@ -24,7 +24,7 @@ does not differentiate a polar chart at the axis or use an excluded dyadic face of a fixed reference formula. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleAssembly.lean index d76c827af2..856ac3f446 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleAssembly.lean @@ -21,7 +21,7 @@ Support comes from the canonical source carrier and the actual native mask/cutoff product. Quantitative wave bounds are separate inputs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleCoherence.lean index 7b7d148510..455b6cefc1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleCoherence.lean @@ -33,7 +33,7 @@ used throughout. The final field is the actual conjugate-pair Gaussian block, with its full angular variable. -/ -@[expose] public section +public section noncomputable section @@ -299,7 +299,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleExcluded.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleExcluded.lean index 9a5386d8cb..414770a0fe 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleExcluded.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleExcluded.lean @@ -18,7 +18,7 @@ covering index, and fast operator. Their bounds are derived from primitive state regularity and ordinary cumulative/covariance estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleParameters.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleParameters.lean index 4a349f03e0..1a50eea9ff 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleParameters.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleParameters.lean @@ -34,7 +34,7 @@ The numerical data, strip, gauge, and operators below are the ones used by estimates is proved independently of the particular and signed wave choices. -/ -@[expose] public section +public section noncomputable section @@ -148,7 +148,7 @@ end end -@[expose] public section +public section noncomputable section @@ -161,7 +161,7 @@ open scoped BigOperators /-- Reindex coefficients, bundling `labels`, `blocks`, `gaussian`, `aliasCoefficients` and the required compatibility proofs. -/ -noncomputable def reindexCoefficients {ι κ : Type} (e : κ ≃ ι) +@[expose] noncomputable def reindexCoefficients {ι κ : Type} (e : κ ≃ ι) (v : CycleCoefficients ι) : CycleCoefficients κ where labels n := (v.labels n).map e.symm.toEmbedding blocks l := v.blocks (e l) @@ -170,7 +170,7 @@ noncomputable def reindexCoefficients {ι κ : Type} (e : κ ≃ ι) residualBand := v.residualBand /-- Reindex state, bundling `state`, `coefficients`, `axisymmetricAlias`. -/ -noncomputable def reindexState {ι κ : Type} (e : κ ≃ ι) +@[expose] noncomputable def reindexState {ι κ : Type} (e : κ ≃ ι) (x : CycleState ι) : CycleState κ where state := x.state coefficients := reindexCoefficients e x.coefficients @@ -274,7 +274,7 @@ noncomputable def swap (B N0 : ℕ) : Index B N0 ≃ ParticularIndex B N0 := (swap B N0).symm l = (l.2, l.1) := rfl /-- Particular state, given by `reindexState (swap B N0).symm x`. -/ -noncomputable def particularState {B N0 : ℕ} (x : CycleState (Index B N0)) : +@[expose] noncomputable def particularState {B N0 : ℕ} (x : CycleState (Index B N0)) : CycleState (ParticularIndex B N0) := reindexState (swap B N0).symm x @[simp] theorem particularState_state {B N0 : ℕ} (x : CycleState (Index B N0)) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePeriodicity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePeriodicity.lean index 7545be6d86..9014507342 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePeriodicity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePeriodicity.lean @@ -28,7 +28,7 @@ finite harmonic sum, conjugate pairing, and coordinate reindexing. The particular source assumption is made on full native parameter fibers. -/ -@[expose] public section +public section noncomputable section @@ -270,7 +270,7 @@ cover. Under this ordering, the actual exact-curl velocity, pressure, and retained Gaussian coefficients are invariant under every torus deck shift. -/ -@[expose] public section +public section noncomputable section @@ -386,7 +386,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePreservation.lean index 0513fe9ce6..96d0c0c168 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePreservation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCyclePreservation.lean @@ -40,7 +40,7 @@ The physical partition scale is `Q n * q_normalized`; finite low bands retain their partition factor. -/ -@[expose] public section +public section noncomputable section @@ -788,7 +788,7 @@ the actual error vanishes on the central Gaussian plateau and retains the exact square-root edge weight at every decay exponent. -/ -@[expose] public section +public section noncomputable section @@ -1086,7 +1086,7 @@ change are evaluated on the literal intermediate states. No estimate of the post-temporal debt is supplied as a premise. -/ -@[expose] public section +public section noncomputable section @@ -1284,7 +1284,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleResidualBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleResidualBounds.lean index 2e1e0bb66a..337b8abbdf 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleResidualBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCycleResidualBounds.lean @@ -37,7 +37,7 @@ The field estimated here is `FinalSlowBase.error`, which is the actual Navier--Stokes residual minus its virtual stress force. -/ -@[expose] public section +public section noncomputable section @@ -274,7 +274,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualGaussianCoverage.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualGaussianCoverage.lean index 128c073301..17e6395139 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualGaussianCoverage.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualGaussianCoverage.lean @@ -31,7 +31,7 @@ germs imply a zero germ of the two-term cutoff error. The global source complement is retained once, exactly as in `CopyData.globalGaussian`. -/ -@[expose] public section +public section noncomputable section @@ -595,7 +595,7 @@ end end -@[expose] public section +public section noncomputable section @@ -660,7 +660,7 @@ variable {Label P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] (F : PhaseConstruction D) (clock : ActualSignedControl.PositiveScale Label) /-- Theta, given by `clock.value l n * v / F.L (l, n)`. -/ -noncomputable def theta (l : Label) (n : ℕ) (v : ℝ) : ℝ := +@[expose] noncomputable def theta (l : Label) (n : ℕ) (v : ℝ) : ℝ := clock.value l n * v / F.L (l, n) theorem theta_eq (l : Label) (n : ℕ) (v : ℝ) : @@ -753,7 +753,7 @@ theorem referenceWindow_core (r L : ℝ) (hr : 0 < r) (hL : 0 < L) : /-- This cutoff is separate from every dyadic, radial and slow source mask. The outer padding is transported together with the Gaussian. -/ -noncomputable def nativeCutoff (r L : ℝ) (hr : 0 < r) (hL : 0 < L) (c : ℝ) : Plane → ℝ := +@[expose] noncomputable def nativeCutoff (r L : ℝ) (hr : 0 < r) (hL : 0 < L) (c : ℝ) : Plane → ℝ := fun z => (referenceWindow r L hr hL).cutoff (CopySolveCompatibility.nativeTimeMap 0 c z) * GaussianTailFlat.slotCutoff L (c * z.2) @@ -888,6 +888,7 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Source region, given by `Prod.fst ⁻¹' S ∩ HarmonicSourceSupport.nativeUnion g (sourceCell r L rate)`. -/ +@[expose] noncomputable def sourceRegion (S : Set P) (g : Geometry) (r L rate : ℝ) : Set (P × Plane) := Prod.fst ⁻¹' S ∩ HarmonicSourceSupport.nativeUnion g (sourceCell r L rate) @@ -1669,7 +1670,7 @@ theorem actualSlowCore_inside (L : PrimaryGeometryAssembly.Index W a.N) {p : Pha /-- Actual source core, given by `actualSlowCore H v a L ×ˢ sourceCell r0 (ChartScales.slotLength r0 profile.data.h (BaseChartJets.cellBand L)) 1`. -/ -noncomputable def actualSourceCore (L : PrimaryGeometryAssembly.Index W a.N) : Set +@[expose] noncomputable def actualSourceCore (L : PrimaryGeometryAssembly.Index W a.N) : Set ActualSignedGeometry.Native := actualSlowCore H v a L ×ˢ sourceCell r0 (ChartScales.slotLength r0 profile.data.h (BaseChartJets.cellBand L)) 1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialCoherence.lean index dee61ee835..ad62aab5f1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialCoherence.lean @@ -21,7 +21,7 @@ The state here uses the same active primary labels, physical base error, common gauge, and actual temporal/rank constructors as initialization. -/ -@[expose] public section +public section namespace NavierStokes.ActualInitialCoherence @@ -53,12 +53,12 @@ noncomputable def baseError (B : ℕ) : Oscillation Point := CorrectionInitialization.ActualPrimary.upper B /-- Seed, constructed using `CorrectionInitialization.bandSeed`. -/ -noncomputable def seed (B N0 : ℕ) : State Point := +@[expose] noncomputable def seed (B N0 : ℕ) : State Point := CorrectionInitialization.bandSeed (CorrectionInitialization.ActualPrimary.activeLabels CorrectionInitialization.ActualPrimary.standardRegion B N0) (pieces B N0) (baseError B) /-- Primary, constructed using `CorrectionInitialization.GaugeInitialization.primaryBands`. -/ -noncomputable def primary (B N0 : ℕ) : State Point := +@[expose] noncomputable def primary (B N0 : ℕ) : State Point := CorrectionInitialization.GaugeInitialization.primaryBands CorrectionInitialization.ActualPrimary.commonGauge (CorrectionInitialization.ActualPrimary.commonContext B) @@ -653,7 +653,7 @@ noncomputable def angularMode (l : Label B N0 × Fin 2) (_n : ℕ) : ℤ := PrimaryGeometryAssembly.angularMode certificate modulation (choice B N0).prepared l.2 l.1 /-- Primary block, given by `(pieces B N0 l).harmonicBlock (phase l) (angularMode l)`. -/ -noncomputable def primaryBlock (l : Label B N0 × Fin 2) : HarmonicBlock Point := +@[expose] noncomputable def primaryBlock (l : Label B N0 × Fin 2) : HarmonicBlock Point := (pieces B N0 l).harmonicBlock (phase l) (angularMode l) /-- Gaussian block, given by `(pieces B N0 l).excludedBlock (phase l) (angularMode l)`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialExcluded.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialExcluded.lean index fb97b0f333..989fb7c240 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialExcluded.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialExcluded.lean @@ -36,7 +36,7 @@ stored base error is the actual base residual, whose angular continuity is used only on the positive-time domain. -/ -@[expose] public section +public section noncomputable section @@ -754,7 +754,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialMeanEquation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialMeanEquation.lean index 8aaee8d056..9f339a191b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialMeanEquation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialMeanEquation.lean @@ -18,7 +18,7 @@ initialization consumer. No `MeanHypotheses` or divergence statement is an input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialization.lean index 297b261df3..442acad163 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualInitialization.lean @@ -20,7 +20,7 @@ This consumer uses the single primary family selected by Gaussian errors and common-cover chart representations. -/ -@[expose] public section +public section noncomputable section @@ -38,11 +38,11 @@ abbrev Index (B N0 : ℕ) := ActualPrimary.Label B N0 × Fin 2 variable {B N0 : ℕ} /-- Primary piece, given by `ActualPrimary.piece ActualPrimary.standardRegion l.2 l.1`. -/ -noncomputable def primaryPiece (l : Index B N0) : PrimaryPiece (Point × ℝ) := +@[expose] noncomputable def primaryPiece (l : Index B N0) : PrimaryPiece (Point × ℝ) := ActualPrimary.piece ActualPrimary.standardRegion l.2 l.1 /-- Phase, given by `(primaryPiece l).coefficients.phase n (x, 0)`. -/ -noncomputable def phase (l : Index B N0) (n : ℕ) (x : Point) : ℝ := +@[expose] noncomputable def phase (l : Index B N0) (n : ℕ) (x : Point) : ℝ := (primaryPiece l).coefficients.phase n (x, 0) /-- Angular mode, constructed using `PrimaryGeometryAssembly.angularMode`. -/ @@ -184,12 +184,12 @@ noncomputable def baseError (B : ℕ) : Oscillation Point := ActualPrimary.upper B /-- Source state, given by `bandSeed (coefficients B N0).labels primaryPiece (baseError B)`. -/ -noncomputable def sourceState (B N0 : ℕ) : State Point := +@[expose] noncomputable def sourceState (B N0 : ℕ) : State Point := bandSeed (coefficients B N0).labels primaryPiece (baseError B) /-- Primary state, given by `VariableGaugeMean.reconstructState ActualPrimary.commonGauge (ActualPrimary.commonContext B) (sourceState B N0)`. -/ -noncomputable def primaryState (B N0 : ℕ) : State Point := +@[expose] noncomputable def primaryState (B N0 : ℕ) : State Point := VariableGaugeMean.reconstructState ActualPrimary.commonGauge (ActualPrimary.commonContext B) (sourceState B N0) @@ -197,18 +197,18 @@ noncomputable def primaryState (B N0 : ℕ) : State Point := noncomputable def axial : TorusInverse.Plane × TorusInverse.Plane := ((0, 1), 0) /-- Temporal state, constructed using `VariableGaugeMean.temporalStageState`. -/ -noncomputable def temporalState (B N0 : ℕ) : State Point := +@[expose] noncomputable def temporalState (B N0 : ℕ) : State Point := VariableGaugeMean.temporalStageState ActualPrimary.commonGauge ActualPrimary.h (CommonWindow.index ActualPrimary.h) axial (ActualPrimary.commonContext B) (primaryState B N0) /-- Rank state, constructed using `VariableGaugeMean.rankStageState`. -/ -noncomputable def rankState (B N0 : ℕ) : State Point := +@[expose] noncomputable def rankState (B N0 : ℕ) : State Point := VariableGaugeMean.rankStageState ActualPrimary.commonGauge ActualPrimary.rankData axial (ActualPrimary.commonContext B) (temporalState B N0) /-- Initial state, given by `GaugeInitialization.retainPressureAlias ActualPrimary.commonGauge (ActualPrimary.commonContext B) (rankState B N0)`. -/ -noncomputable def initialState (B N0 : ℕ) : State Point := +@[expose] noncomputable def initialState (B N0 : ℕ) : State Point := GaugeInitialization.retainPressureAlias ActualPrimary.commonGauge (ActualPrimary.commonContext B) (rankState B N0) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualIterationLedger.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualIterationLedger.lean index 1669ea1a8d..762b0e1314 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualIterationLedger.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualIterationLedger.lean @@ -19,7 +19,7 @@ This module does not assert the existence of correction cycles or their native class estimates. -/ -@[expose] public section +public section noncomputable section @@ -143,14 +143,14 @@ theorem all_cycle_margins (n : ℕ) {κ : ℝ} (hκ : κ ≤ 1 / 100000) : /-- Conservative class for the actual wave potential. The local inverse frequency can give an additional half power, which is not needed here. -/ -noncomputable def waveNative (κ : ℝ) (j : ℕ) : ℝ := +@[expose] noncomputable def waveNative (κ : ℝ) (j : ℕ) : ℝ := ExponentLedger.waveExponent (inputSigma j) - κ /-- Wave pressure native, given by `waveNative κ j + 1 / 2`. -/ -noncomputable def wavePressureNative (κ : ℝ) (j : ℕ) : ℝ := waveNative κ j + 1 / 2 +@[expose] noncomputable def wavePressureNative (κ : ℝ) (j : ℕ) : ℝ := waveNative κ j + 1 / 2 /-- Mean native, given by `ExponentLedger.meanUpdateExponent (inputSigma j) κ`. -/ -noncomputable def meanNative (κ : ℝ) (j : ℕ) : ℝ := +@[expose] noncomputable def meanNative (κ : ℝ) (j : ℕ) : ℝ := ExponentLedger.meanUpdateExponent (inputSigma j) κ /-- Radial native, given by `meanNative κ j + 1`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPhysicalData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPhysicalData.lean index 2644a6d39a..ced6ae07e6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPhysicalData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPhysicalData.lean @@ -30,7 +30,7 @@ variable. Pressure reconstruction, the temporal inverse and the rank repair are the literal operations in `CorrectionStep.CycleState.step`. -/ -@[expose] public section +public section noncomputable section @@ -775,7 +775,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPotentialRealization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPotentialRealization.lean index be352546b3..e390014013 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPotentialRealization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanPotentialRealization.lean @@ -17,7 +17,7 @@ The azimuthal potential carries the scale velocity/radialScale. Its genuine Cartesian curl is the meridional stream pair in the same physical graph. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ abbrev ScaledGraph := PhysicalResidualBridge.ScaledGraph noncomputable def axial : (ℝ × ℝ) × (ℝ × ℝ) := ((0, 1), 0) /-- Chart point, given by `(PhysicalResidualTZ.graphMapTZ G z).1`. -/ -noncomputable def chartPoint (G : ScaledGraph) (z : SpaceTime) : Point := +@[expose] noncomputable def chartPoint (G : ScaledGraph) (z : SpaceTime) : Point := (PhysicalResidualTZ.graphMapTZ G z).1 /-- Meridional as an element of `Fin 3 → ℝ`. -/ @@ -220,7 +220,7 @@ theorem cartesianPotential_curl_forward {a : ℝ} (ha : 0 < a) (j : PolarCharts. /-- Cartesian domain, given by `PhysicalGraphBounds.radialProjection ⁻¹' PolarCharts.chartDomain a j`. -/ -noncomputable def cartesianDomain (a : ℝ) (j : PolarCharts.Index) : Set SpaceTime := +@[expose] noncomputable def cartesianDomain (a : ℝ) (j : PolarCharts.Index) : Set SpaceTime := PhysicalGraphBounds.radialProjection ⁻¹' PolarCharts.chartDomain a j theorem cartesianDomain_open (a : ℝ) (j : PolarCharts.Index) : IsOpen (cartesianDomain a j) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanStageData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanStageData.lean index 5b031b5864..fb1c4ba335 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanStageData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualMeanStageData.lean @@ -19,7 +19,7 @@ Cartesian angular representation. Native annulus support gives a positive inner radius and the common shrinking outer support. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCoherence.lean index 10abf14413..b7cb9793f6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCoherence.lean @@ -32,7 +32,7 @@ exactly those paths, including their endpoints. No continuation of the raw tangent data or source outside the interval is assumed. -/ -@[expose] public section +public section noncomputable section @@ -582,7 +582,7 @@ source. Both terms are transported from their primitive data before the copy sum is taken. -/ -@[expose] public section +public section noncomputable section @@ -1105,7 +1105,7 @@ motion, base action, and damping. Only the native slow point and finite clock interval enter its regularity; the transverse coordinate is free. -/ -@[expose] public section +public section noncomputable section @@ -1354,7 +1354,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1371,7 +1371,7 @@ variable {B N0 : ℕ} abbrev Label := ActualParticularStageControls.Label /-- The unchanged current-state copy construction. -/ -noncomputable def copyData (x : CorrectionStep.CycleState (Label B N0)) +@[expose] noncomputable def copyData (x : CorrectionStep.CycleState (Label B N0)) (l : Label B N0) (j : ℤ) : PeriodizedWaveBounds.CopyData WaveSpace Frequency := (ActualParticularStageControls.parameters x l).copyData (ActualParticularStageControls.assembly x l).context diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCycleData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCycleData.lean index 4613ea76a0..f6bc70a969 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCycleData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularCycleData.lean @@ -48,7 +48,7 @@ transported radial and axial directions. No new divergence premise is needed for the associated particular-solver coordinates. -/ -@[expose] public section +public section noncomputable section @@ -147,7 +147,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1894,7 +1894,7 @@ is applied at that original band. The square-root moving-edge weight is kept through the entire estimate, including the uncovered source term. -/ -@[expose] public section +public section noncomputable section @@ -2161,7 +2161,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularMeanGain.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularMeanGain.lean index 1615300215..bb12edfc5b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularMeanGain.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularMeanGain.lean @@ -16,7 +16,7 @@ common assembly below is independent of a signed family or any signed output estimate. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularRealization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularRealization.lean index 2f2dd3db74..7e88a89da1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularRealization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularRealization.lean @@ -16,7 +16,7 @@ solve, its transported cutoff, its curl correction, and its finite harmonic assembly are retained in the realization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularStageControls.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularStageControls.lean index 3f61bdaf9b..f2c50b8ea2 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularStageControls.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualParticularStageControls.lean @@ -43,7 +43,7 @@ phase, including the free angular variable. All primitive bounds are pulled from the actual primary inputs on the same closed support cells. -/ -@[expose] public section +public section noncomputable section @@ -385,7 +385,7 @@ end end -@[expose] public section +public section noncomputable section @@ -759,7 +759,7 @@ follow from the selected phase construction and the polynomial coordinate cost, without estimates on a solved velocity or pressure as hypotheses. -/ -@[expose] public section +public section noncomputable section @@ -1065,7 +1065,7 @@ Only the selected geometry and its closed source support occur here. No property of a solved particular or signed field is assumed. -/ -@[expose] public section +public section noncomputable section @@ -1133,7 +1133,7 @@ theorem slowCore_closed (l : Index B N0) (n : ℕ) : IsClosed (slowCore l n) := (choice B N0).prepared l.1).preimage (slowMap_continuous l n) /-- Reference length, given by `(phases B N0 l.2).L l.1`. -/ -noncomputable def referenceLength (l : Index B N0) : ℝ := +@[expose] noncomputable def referenceLength (l : Index B N0) : ℝ := (phases B N0 l.2).L l.1 theorem referenceLength_pos (l : Index B N0) : 0 < referenceLength l := @@ -1160,7 +1160,7 @@ noncomputable def referenceGeometry (l : Index B N0) : Geometry := /-- Gap, given by `ChartScales.nativeIndex h (BaseChartJets.cellBand l.1) - CommonWindow.index h n`. -/ -noncomputable def gap (l : Index B N0) (n : ℕ) : ℕ := +@[expose] noncomputable def gap (l : Index B N0) (n : ℕ) : ℕ := ChartScales.nativeIndex h (BaseChartJets.cellBand l.1) - CommonWindow.index h n /-- Geometry, given by `CopySolveCompatibility.transportGeometry (referenceGeometry l) (gap l n) @@ -1376,7 +1376,7 @@ Gaussian-times-padding cutoff. Clock factors only need to be positive at each band; no uniform range for the complete clock family is assumed. -/ -@[expose] public section +public section noncomputable section @@ -1398,7 +1398,7 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- The literal complex Volterra solve and its separately transported Gaussian/outer cutoff, without uniform bounds on the clock scalars. -/ -noncomputable def scalarData : CopyData ((P × ℝ) × Plane) Frequency := +@[expose] noncomputable def scalarData : CopyData ((P × ℝ) × Plane) Frequency := complexCopyData base t f g (fun _ => 0) (fun n => L n / rate n) (fun n => (div_pos (hL n) (hc n)).le) (fun n => ActualGaussianCoverage.nativeCutoff (r n) (L n) (hr n) (hL n) (rate n)) @@ -1519,7 +1519,7 @@ therefore transfers the Gaussian clock estimates without assumptions about a source, correction state, or modal-control output. -/ -@[expose] public section +public section noncomputable section @@ -1621,7 +1621,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1648,6 +1648,7 @@ abbrev Label (B N0 : ℕ) := Fin 2 × CorrectionInitialization.ActualPrimary.Lab /-! Reindexing retains the selected phase, its frame, and all uniform constants. -/ /-- Reindex domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ +@[expose] noncomputable def reindexDomain {ι κ : Type} (D : Domain ι Slow) (e : κ → ι) : Domain κ Slow where scale i := D.scale (e i) carrier i := D.carrier (e i) @@ -1738,7 +1739,7 @@ noncomputable def referenceGeometry (l : Label B N0) : Geometry := /-- Gap, given by `ChartScales.nativeIndex h (BaseChartJets.cellBand l.2) - CommonWindow.index h n`. -/ -noncomputable def gap (l : Label B N0) (n : ℕ) : ℕ := +@[expose] noncomputable def gap (l : Label B N0) (n : ℕ) : ℕ := ChartScales.nativeIndex h (BaseChartJets.cellBand l.2) - CommonWindow.index h n theorem reference_refine (l : Label B N0) (n : ℕ) : @@ -1778,22 +1779,23 @@ noncomputable def nativeToFull : Native ≃ₗᵢ[ℝ] AP := /-- Background, given by `ParticularWaveBounds.reindexCoefficients nativeToFull (chartCoefficients l.1 l.2)`. -/ +@[expose] noncomputable def background (l : Label B N0) : LinearWaveBounds.WaveCoefficients Native := ParticularWaveBounds.reindexCoefficients nativeToFull (chartCoefficients l.1 l.2) /-- Directions, given by `ParticularWaveBounds.reindexDirections nativeToFull (PrimaryResidualClass.directions (commonContext B))`. -/ -noncomputable def directions : LinearWaveBounds.GraphDirections Native := +@[expose] noncomputable def directions : LinearWaveBounds.GraphDirections Native := ParticularWaveBounds.reindexDirections nativeToFull (PrimaryResidualClass.directions (commonContext B)) /-- Associated context, given by `StateReindex.context cycleAssoc.symm (commonContext B)`. -/ -noncomputable def associatedContext : Context (Parameter × Plane) := +@[expose] noncomputable def associatedContext : Context (Parameter × Plane) := StateReindex.context cycleAssoc.symm (commonContext B) /-- Associated strip, given by `ParticularWaveBounds.reindexStrip cycleAssoc.symm (BaseContextAssembly.nativeStrip nominal standardRegion)`. -/ -noncomputable def associatedStrip : StripData (Parameter × Plane) := +@[expose] noncomputable def associatedStrip : StripData (Parameter × Plane) := ParticularWaveBounds.reindexStrip cycleAssoc.symm (BaseContextAssembly.nativeStrip nominal standardRegion) @@ -1835,6 +1837,7 @@ theorem parameters_length (x : CycleState (Label B N0)) (l : Label B N0) (n : (ChartScales.Q (BaseChartJets.cellBand l.2)) := rfl /-- Fixed primitive data for all iterations of the same labeled construction. -/ +@[expose] noncomputable def canonicalParameters (l : Label B N0) : ParticularParameters Parameter where tangent j n := ScaledTangentTransport.transportTangent ((reference l).tangent j) (PhysicalParticularWave.parameterChange h (ChartScales.Q n) (ChartScales.Q (reference l).band)) @@ -2482,7 +2485,7 @@ theorem uniform_to_local {ι I X E : Type} [NormedAddCommGroup X] [NormedSpace exact ⟨K,hK,p,fun l n _ z hz _ => hp l n z hz⟩ /-- The actual computed copy data, with the current residual as source. -/ -noncomputable def data (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) := +@[expose] noncomputable def data (x : CycleState (Label B N0)) (l : Label B N0) (j : ℤ) := (parameters x l).copyData (assembly x l).context (assembly x l).state (assembly x l).carrierBlock (assembly x l).gaussianInput (assembly x l).aliasInput j @@ -2696,7 +2699,7 @@ theorem raw_jets (x : CycleState (Label B N0)) /-! The support geometry is the same canonical scalar-clock geometry. -/ /-- Support label, given by `(l.2,l.1)`. -/ -noncomputable def supportLabel (l : Label B N0) : ActualCarrierTransportBase.Index B N0 := +@[expose] noncomputable def supportLabel (l : Label B N0) : ActualCarrierTransportBase.Index B N0 := (l.2,l.1) theorem support_geometry_eq (x : CycleState (Label B N0)) (l : Label B N0) (n : ℕ) : @@ -3128,6 +3131,7 @@ abbrev ResidualBounds (x : CycleState (Label B N0)) (α : ℝ) : Prop := (x.coefficients.blocks l) (x.coefficients.gaussian l) (x.coefficients.aliasCoefficients l)) /-- Associated update as an element of `HarmonicBlock (Parameter × Plane)`. -/ +@[expose] noncomputable def associatedUpdate (x : CycleState (Label B N0)) (N : ℕ) (l : Label B N0) : HarmonicBlock (Parameter × Plane) := (parameters x l).updateBlock associatedStrip (assembly x l).context (assembly x l).state @@ -3162,7 +3166,7 @@ theorem associated_assembled_bounds (x : CycleState (Label B N0)) (fun j hj => (hm j hj).2.2.2.2) /-- Output block, given by `StateReindex.block cycleAssoc (associatedUpdate x N l)`. -/ -noncomputable def outputBlock (x : CycleState (Label B N0)) (N : ℕ) (l : Label B N0) : +@[expose] noncomputable def outputBlock (x : CycleState (Label B N0)) (N : ℕ) (l : Label B N0) : HarmonicBlock CyclePoint := StateReindex.block cycleAssoc (associatedUpdate x N l) /-- Output good, given by `StateReindex.block cycleAssoc (associatedGood x N l)`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPeriodizedSignedRealization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPeriodizedSignedRealization.lean index cb2fe95d87..2e489fb134 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPeriodizedSignedRealization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPeriodizedSignedRealization.lean @@ -17,7 +17,7 @@ copies are summed before curl, and equality with the same reference output is proved from the periodic-clock identity on their compact supports. -/ -@[expose] public section +public section noncomputable section @@ -177,7 +177,7 @@ end Layout /-- Homogeneous pressure, given by `Complex.I * (TangentProjection.pressureCoefficient N Ndot u (A u) 0 : ℂ) / (K : ℂ)`. -/ -noncomputable def homogeneousPressure (K : ℝ) (N Ndot : Space) (A : Space →L[ℝ] Space) +@[expose] noncomputable def homogeneousPressure (K : ℝ) (N Ndot : Space) (A : Space →L[ℝ] Space) (u : Space) : ℂ := Complex.I * (TangentProjection.pressureCoefficient N Ndot u (A u) 0 : ℂ) / (K : ℂ) @@ -240,7 +240,7 @@ noncomputable def periodizedPrimary : PhysicalSignedWave.PrimaryData U := @[simp] theorem periodizedPrimary_matrix : (periodizedPrimary B l).matrix = B.matrix := rfl /-- All view scales, integer covers, backgrounds, and operators are retained. -/ -noncomputable def views {reference : ℕ} (V : B.Views reference) : +@[expose] noncomputable def views {reference : ℕ} (V : B.Views reference) : (periodizedPrimary B l).Views reference where exponent := V.exponent referenceScale := V.referenceScale @@ -294,7 +294,7 @@ noncomputable def stateData {reference : ℕ} {V : B.Views reference} (D : V.Sta variable {reference : ℕ} (V : B.Views reference) /-- Shared mask, given by `B.mask reference (V.map n x)`. -/ -noncomputable def sharedMask (n : ℕ) (x : Cylinder) : ℝ := B.mask reference (V.map n x) +@[expose] noncomputable def sharedMask (n : ℕ) (x : Cylinder) : ℝ := B.mask reference (V.map n x) /-- Total mask, given by `sharedMask B V n x * l.mask reference (V.map n x).1.2.2`. -/ noncomputable def totalMask (n : ℕ) (x : Cylinder) : ℝ := @@ -309,7 +309,7 @@ noncomputable def commonUnit (j : Fin 2) (n : ℕ) (x : Cylinder) : Space := (periodizedPrimary B l).fundamental j reference (V.map n x) /-- Native unit, constructed using `PrimaryPulseBounds.normalizedPulse`. -/ -noncomputable def nativeUnit (j : Fin 2) (k : Frequency) (n : ℕ) (x : Cylinder) : Space := +@[expose] noncomputable def nativeUnit (j : Fin 2) (k : Frequency) (n : ℕ) (x : Cylinder) : Space := PrimaryPulseBounds.normalizedPulse ((B.pulse j).frame reference) ((B.pulse j).lam reference) ((B.pulse j).u reference) ((B.pulse j).L reference) ((B.coordinate reference (V.map n x)).1, l.nativeClock reference k (V.map n x).1.2.2) @@ -322,7 +322,7 @@ theorem commonUnit_eq_native (j : Fin 2) (k : Frequency) (n : ℕ) (x : Cylinder rfl /-- One call to the original homogeneous signed quotient constructor. -/ -noncomputable def coefficientsWith (request : ℕ → Cylinder → Vec2) (j : Fin 2) +@[expose] noncomputable def coefficientsWith (request : ℕ → Cylinder → Vec2) (j : Fin 2) (mask : ℕ → Cylinder → ℝ) (unit : ℕ → Cylinder → Space) : WaveCoefficients Cylinder := SignedWaveUpdate.coefficients ((periodizedPrimary B l).viewBase V.background V.frequency (fun n => V.map n) reference) @@ -340,6 +340,7 @@ noncomputable def commonCoefficients (request : ℕ → Cylinder → Vec2) (j : /-- Native coefficients, given by `coefficientsWith B l V request j (copyMask B l V k) (nativeUnit B l V j k)`. -/ +@[expose] noncomputable def nativeCoefficients (request : ℕ → Cylinder → Vec2) (j : Fin 2) (k : Frequency) : WaveCoefficients Cylinder := coefficientsWith B l V request j (copyMask B l V k) (nativeUnit B l V j k) @@ -619,6 +620,7 @@ variable {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} (B : PhysicalSignedWave.PrimaryData U) (l : Layout) /-- Reference native unit, constructed using `PrimaryPulseBounds.normalizedPulse`. -/ +@[expose] noncomputable def referenceNativeUnit (j : Fin 2) (n : ℕ) (k : Frequency) (x : Cylinder) : Space := PrimaryPulseBounds.normalizedPulse ((B.pulse j).frame n) ((B.pulse j).lam n) ((B.pulse j).u n) ((B.pulse j).L n) @@ -633,7 +635,7 @@ theorem referenceUnit_eq_native (j : Fin 2) (n : ℕ) (k : Frequency) (x : Cylin /-- Reference scalar, given by `SignedWaveUpdate.signedScalar B.strip B.matrix B.target request B.mask j n x`. -/ -noncomputable def referenceScalar (request : ℕ → Cylinder → Vec2) (j : Fin 2) +@[expose] noncomputable def referenceScalar (request : ℕ → Cylinder → Vec2) (j : Fin 2) (n : ℕ) (x : Cylinder) : ℝ := SignedWaveUpdate.signedScalar B.strip B.matrix B.target request B.mask j n x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseDefect.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseDefect.lean index a89c9e664c..a91b2e9d4d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseDefect.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseDefect.lean @@ -17,7 +17,7 @@ The base coefficients are identified through their common physical field before the native material cancellation is used. -/ -@[expose] public section +public section noncomputable section @@ -446,7 +446,7 @@ theorem chart_phase_germ (j : Fin 2) (L : Label B N0) (n : ℕ) rw [view_slot] /-- Defect as an element of `FullPoint → ℝ`. -/ -noncomputable def defect (j : Fin 2) (L : Label B N0) (n : ℕ) : FullPoint → ℝ := +@[expose] noncomputable def defect (j : Fin 2) (L : Label B N0) (n : ℕ) : FullPoint → ℝ := (chartCoefficients j L).defect (HarmonicWaveInteraction.productStrip (BaseContextAssembly.nativeStrip nominal standardRegion)) (PrimaryResidualClass.directions (commonContext B)) n @@ -679,7 +679,7 @@ theorem materialWeight_normal (L : Label B N0) (n : ℕ) : /-- Material weight bound, given by `2*ActualSignedGeometry.powerBound (h/2+1/2) * ActualSignedGeometry.powerBound (CoordinateAlgebra.A h-h)`. -/ -noncomputable def materialWeightBound : ℝ := +@[expose] noncomputable def materialWeightBound : ℝ := 2*ActualSignedGeometry.powerBound (h/2+1/2) * ActualSignedGeometry.powerBound (CoordinateAlgebra.A h-h) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseJetBounds.lean index 3c015e8d81..5594734b9f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseJetBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhaseJetBounds.lean @@ -19,7 +19,7 @@ bound. The remaining expression has polynomial slow jets on the same native phase cells used to construct the primary waves. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalPrefixFields.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalPrefixFields.lean index 7907d01f18..740e14d24e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalPrefixFields.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalPrefixFields.lean @@ -30,7 +30,7 @@ pointwise identities into the germs needed by the spatial curl. No global support condition or final velocity identity is assumed. -/ -@[expose] public section +public section noncomputable section @@ -195,7 +195,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalStageBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalStageBounds.lean index 07fbbbeca0..36c96c6ca8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalStageBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPhysicalStageBounds.lean @@ -34,7 +34,7 @@ velocity is its actual leading angular field. In the far exterior it is the physical heat field. The final rate is on the full open-past endpoint filter. -/ -@[expose] public section +public section noncomputable section @@ -631,7 +631,7 @@ increment bounds it controls every finite prefix with one derivative-loss function, independent of the number of correction stages. -/ -@[expose] public section +public section noncomputable section @@ -772,7 +772,7 @@ theorem uncutVelocity_eq_stagePrefix {U : Set SpaceTime} (hU : IsOpen U) /-- This version only needs a bound for the initialized physical velocity. It imposes no growth assumption on the gauge of the initial potential. -/ -noncomputable def initialBackgroundLoss (Lzero LA LB : ℕ → ℝ) (m : ℕ) : ℝ := +@[expose] noncomputable def initialBackgroundLoss (Lzero LA LB : ℕ → ℝ) (m : ℕ) : ℝ := max (Lzero m) (max (LA (m + 1)) (LB m)) theorem mixed_background_from_initial {l : Filter SpaceTime} {q : SpaceTime → ℝ} @@ -822,7 +822,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1142,7 +1142,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1186,7 +1186,7 @@ structure MeanInput (h degree : ℝ) where /-- Package the existing moving-field and native-class theorems without changing the supplied coherent physical field. -/ -noncomputable def MeanInput.ofMoving {h degree a b α : ℝ} {N Δ : ℕ} +@[expose] noncomputable def MeanInput.ofMoving {h degree a b α : ℝ} {N Δ : ℕ} (R : LocalSignedRequest.SlowRegion (2 * h)) (hR : R.carrier = region h) (M : PhysicalMeanJetBounds.CoherentFamily h degree N Δ (region h) ℝ) (hN : 4 ≤ N) (ha : 0 < a) (hab : a < b) @@ -2040,21 +2040,21 @@ open CorrectionStep CorrectionState /-- The constructed initialization families, with their proved native classes and common band choice. No native estimate is left as an input. -/ -noncomputable def actualInitialTemporalInput (B N0 N : ℕ) (hN : 4 ≤ N) : +@[expose] noncomputable def actualInitialTemporalInput (B N0 N : ℕ) (hN : 4 ≤ N) : MeanInput h (CoordinateAlgebra.A h - 1 / 2) := MeanInput.ofMoving standardRegion rfl (initialTemporalFamily B N0 N) hN (PrimaryTargetBounds.leftRadius_pos nominal) (PrimaryTargetBounds.radii_ordered nominal) (initialTemporal_moving B N0) (initialTemporal_nativeJets B N0 N (by omega)) /-- Actual initial rank input, constructed using `MeanInput.ofMoving`. -/ -noncomputable def actualInitialRankInput (B N0 N : ℕ) (hN : 4 ≤ N) : +@[expose] noncomputable def actualInitialRankInput (B N0 N : ℕ) (hN : 4 ≤ N) : MeanInput h (CoordinateAlgebra.A h - 1 / 2) := MeanInput.ofMoving standardRegion rfl (initialRankFamily B N0 N) hN (PrimaryTargetBounds.leftRadius_pos nominal) (PrimaryTargetBounds.radii_ordered nominal) (initialRank_moving B N0) (initialRank_nativeJets B N0 N (by omega)) /-- Actual initial angular input, constructed using `MeanInput.ofMoving`. -/ -noncomputable def actualInitialAngularInput (B N0 N : ℕ) (hN : 4 ≤ N) : +@[expose] noncomputable def actualInitialAngularInput (B N0 N : ℕ) (hN : 4 ≤ N) : MeanInput h (CoordinateAlgebra.A h) := MeanInput.ofMoving standardRegion rfl (initialAngularFamily B N0 N) hN (PrimaryTargetBounds.leftRadius_pos nominal) (PrimaryTargetBounds.radii_ordered nominal) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPolarCoverage.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPolarCoverage.lean index 50f406a852..16ce74b058 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPolarCoverage.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPolarCoverage.lean @@ -32,7 +32,7 @@ mean residuals and excluded errors are combined before the physical graph restriction. Phase regularity is needed only on coefficient support. -/ -@[expose] public section +public section noncomputable section @@ -914,7 +914,7 @@ theorem ResidualChartData.residual_jetRate {a b h gain β : ℝ} {N Δ : ℕ} {U /-- Band graph, given by `PhysicalResidualBridge.commonGraph (ChartScales.Q n) h (ChartScales.nativeIndex h n - d)`. -/ -noncomputable def bandGraph (h : ℝ) (n d : ℕ) : PhysicalResidualBridge.ScaledGraph := +@[expose] noncomputable def bandGraph (h : ℝ) (n d : ℕ) : PhysicalResidualBridge.ScaledGraph := PhysicalResidualBridge.commonGraph (ChartScales.Q n) h (ChartScales.nativeIndex h n - d) theorem polarGraph_eq_meanGraph {a : ℝ} (ha : 0 < a) (h : ℝ) (j : PolarCharts.Index) @@ -1121,7 +1121,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1137,7 +1137,7 @@ abbrev Point := PhysicalMeanJetBounds.Point abbrev Cylinder := PhysicalResidualJetBounds.Cylinder /-- Active as an element of `Set SpaceTime`. -/ -noncomputable def active : Set SpaceTime := +@[expose] noncomputable def active : Set SpaceTime := {w | (SlowBorelBase.cartesianChart ActualPrimary.h w).2.1 ∈ Icc (NominalConeAssembly.activeLeft ActualPrimary.nominal) (NominalConeAssembly.activeRight ActualPrimary.nominal)} @@ -1147,7 +1147,7 @@ noncomputable def inner : ℝ := PrimaryTargetBounds.leftRadius ActualPrimary.nominal / 4 /-- Outer, given by `2 * PrimaryTargetBounds.rightRadius ActualPrimary.nominal`. -/ -noncomputable def outer : ℝ := +@[expose] noncomputable def outer : ℝ := 2 * PrimaryTargetBounds.rightRadius ActualPrimary.nominal /-- Native domain, given by `HarmonicResidual.liftDomain (ActualInitialization.geometry.domain ∩ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryBounds.lean index d1c4357dab..4e1444e638 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryBounds.lean @@ -17,7 +17,7 @@ The estimates retain the moving edge weight and the actual pulse envelope. Constants precede the orientation, spatial label, band, and lattice copy. -/ -@[expose] public section +public section noncomputable section @@ -174,6 +174,7 @@ theorem clock_eq (l : SignedLabel B N0) : (BaseChartJets.cellBand l.2) := rfl /-- Copy point, constructed using `ActualSignedGeometry.copyPoint`. -/ +@[expose] noncomputable def copyPoint (l : SignedLabel B N0) (n : ℕ) (k : TorusInverse.Frequency) : Native → Native := ActualSignedGeometry.copyPoint ActualPrimary.slots ActualPrimary.vectors_det (spatialLabel l) @@ -547,7 +548,7 @@ theorem pressure_native_jets : exact attached_pressure_signed_jets B N0 /-- Periodized, given by `PeriodizedWaveBounds.copySum (copied a f l n)`. -/ -noncomputable def periodized {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] noncomputable def periodized {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (a : ℝ) (f : SignedLabel B N0 → Native → E) (l : SignedLabel B N0) (n : ℕ) : Native → E := PeriodizedWaveBounds.copySum (copied a f l n) @@ -841,14 +842,14 @@ theorem gaussian_polynomial : /-- Cut native velocity, given by `ActualPrimary.gaussian l.2 x • CurlClassBounds.complexify (ActualPrimary.attachedRawVelocity l.1 l.2 x)`. -/ -noncomputable def cutNativeVelocity (l : SignedLabel B N0) (x : Native) : +@[expose] noncomputable def cutNativeVelocity (l : SignedLabel B N0) (x : Native) : HarmonicCalculus.ComplexVector := ActualPrimary.gaussian l.2 x • CurlClassBounds.complexify (ActualPrimary.attachedRawVelocity l.1 l.2 x) /-- Cut native pressure, given by `ActualPrimary.gaussian l.2 x • ActualPrimary.attachedRawPressure l.1 l.2 x`. -/ -noncomputable def cutNativePressure (l : SignedLabel B N0) (x : Native) : ℂ := +@[expose] noncomputable def cutNativePressure (l : SignedLabel B N0) (x : Native) : ℂ := ActualPrimary.gaussian l.2 x • ActualPrimary.attachedRawPressure l.1 l.2 x theorem cut_native_velocity_jets : @@ -1018,12 +1019,12 @@ noncomputable def meanEnvelope (l : SignedLabel B N0) (n : ℕ) (x : Point) : fullEnvelope l n (x, 0) /-- Angular frequency, constructed using `PrimaryGeometryAssembly.angularMode`. -/ -noncomputable def angularFrequency (l : SignedLabel B N0) (_n : ℕ) : ℤ := +@[expose] noncomputable def angularFrequency (l : SignedLabel B N0) (_n : ℕ) : ℤ := PrimaryGeometryAssembly.angularMode ActualPrimary.certificate ActualPrimary.modulation (ActualPrimary.choice B N0).prepared l.1 l.2 /-- Phase, given by `(ActualPrimary.chartCoefficients l.1 l.2).phase n (x, 0)`. -/ -noncomputable def phase (l : SignedLabel B N0) (n : ℕ) (x : Point) : ℝ := +@[expose] noncomputable def phase (l : SignedLabel B N0) (n : ℕ) (x : Point) : ℝ := (ActualPrimary.chartCoefficients l.1 l.2).phase n (x, 0) theorem tangent_block_uniform : @@ -1050,7 +1051,7 @@ variable {B N0 : ℕ} abbrev CopyIndex (B N0 : ℕ) := SignedLabel B N0 × TorusInverse.Frequency /-- Full copy, given by `copyPoint l n k (ActualSignedGeometry.meanEquiv.symm x.1)`. -/ -noncomputable def fullCopy (l : SignedLabel B N0) (n : ℕ) (k : TorusInverse.Frequency) +@[expose] noncomputable def fullCopy (l : SignedLabel B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : ActualPrimary.FullPoint) : Native := copyPoint l n k (ActualSignedGeometry.meanEquiv.symm x.1) @@ -1503,12 +1504,13 @@ variable {B N0 : ℕ} /-- Cut coefficients, given by `(ActualPrimary.chartCoefficients l.1 l.2).withCutoff (ActualPrimary.chartCutoff l.1 l.2)`. -/ -noncomputable def cutCoefficients (l : SignedLabel B N0) : +@[expose] noncomputable def cutCoefficients (l : SignedLabel B N0) : LinearWaveBounds.WaveCoefficients ActualPrimary.FullPoint := (ActualPrimary.chartCoefficients l.1 l.2).withCutoff (ActualPrimary.chartCutoff l.1 l.2) /-- Actual family, given by `LocalizedWaveBounds.WaveFamily.ofCoefficients (fun i => cutCoefficients i.1)`. -/ +@[expose] noncomputable def actualFamily : LocalizedWaveBounds.WaveFamily ActualPrimary.FullPoint (CopyIndex B N0) := LocalizedWaveBounds.WaveFamily.ofCoefficients (fun i => cutCoefficients i.1) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCoherence.lean index e1ad6ddb5b..44f9db8a26 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCoherence.lean @@ -18,7 +18,7 @@ The phase, coefficient, cutoff, and chart in this file are the actual curl correction and Gaussian term are transported on the whole free lift. -/ -@[expose] public section +public section noncomputable section @@ -145,9 +145,9 @@ noncomputable def absoluteRadial (x : Absolute) : Absolute := radialVector), 0) /-- Absolute axial, given by `(((0,(1,0)),0),0)`. -/ -noncomputable def absoluteAxial (_ : Absolute) : Absolute := (((0,(1,0)),0),0) +@[expose] noncomputable def absoluteAxial (_ : Absolute) : Absolute := (((0,(1,0)),0),0) /-- Absolute angular, given by `(0,1)`. -/ -noncomputable def absoluteAngular (_ : Absolute) : Absolute := (0,1) +@[expose] noncomputable def absoluteAngular (_ : Absolute) : Absolute := (0,1) /-- Absolute fast, given by `(((0,(0,0)),temporalVector),0)`. -/ noncomputable def absoluteFast (_ : Absolute) : Absolute := (((0,(0,0)),temporalVector),0) @@ -256,11 +256,13 @@ theorem absoluteChart_fast (B n : ℕ) (x : ChartPoint) : variable {B N0 : ℕ} /-- Absolute cut amplitude, given by `periodicGaussian j L x.1.2 • absoluteAmplitude j L x.1`. -/ +@[expose] noncomputable def absoluteCutAmplitude (j : Fin 2) (L : Label B N0) (x : Absolute) : ComplexVector := periodicGaussian j L x.1.2 • absoluteAmplitude j L x.1 /-- Absolute exact amplitude, constructed using `CurlClassBounds.realizedCoefficient`. -/ +@[expose] noncomputable def absoluteExactAmplitude (j : Fin 2) (L : Label B N0) : Absolute → ComplexVector := CurlClassBounds.realizedCoefficient 1 absoluteRadius absoluteRadial absoluteAngular absoluteAxial (absolutePhase j L) (absoluteCutAmplitude j L) @@ -951,7 +953,7 @@ theorem realizedCoefficient_translate (w : E) (K : ℝ) {R Φ : E → ℝ} end PeriodicCalculus /-- Chart deck, given by `((0, ((0,0), TorusAverages.latticePoint k)),0)`. -/ -noncomputable def chartDeck (k : TorusInverse.Frequency) : ChartPoint := +@[expose] noncomputable def chartDeck (k : TorusInverse.Frequency) : ChartPoint := ((0, ((0,0), TorusAverages.latticePoint k)),0) theorem native_copy_sum_periodic {E : Type} [NormedAddCommGroup E] @@ -1733,7 +1735,7 @@ theorem physicalAmplitude_eq (j : Fin 2) (L : Label B N0) (n : ℕ) rfl /-- Physical angular, given by `(0,ProblemStatement.coordinateVector 1)`. -/ -noncomputable def physicalAngular : ProblemStatement.SpaceTime := +@[expose] noncomputable def physicalAngular : ProblemStatement.SpaceTime := (0,ProblemStatement.coordinateVector 1) theorem physicalLift_angular (z : ProblemStatement.SpaceTime) (s : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCovariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCovariance.lean index 3082091e83..275691fce2 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCovariance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryCovariance.lean @@ -17,7 +17,7 @@ those of `CorrectionInitialization.ActualPrimary`. The finite family is assembled before averaging. The fixed starting threshold is retained. -/ -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ theorem physicalTangentMode_eq_slot (j : Fin 2) (L : Label B N0) (p : Slow) /-! ## The same physical point in each fixed label's native coordinates -/ /-- Native point, given by `nativeSlow L (toAbsolute n x)`. -/ -noncomputable def nativePoint (n : ℕ) (x : Point) (L : Label B N0) : Slow := +@[expose] noncomputable def nativePoint (n : ℕ) (x : Point) (L : Label B N0) : Slow := nativeSlow L (toAbsolute n x) theorem nativePoint_auxiliary (n : ℕ) (x : Point) (L : Label B N0) (Y : Plane) : @@ -279,7 +279,7 @@ theorem signedLabelOf_injective : Function.Injective (signedLabelOf (B := B) (N0 rfl /-- View tangent, constructed using `physicalTangentMode`. -/ -noncomputable def viewTangent (n : ℕ) (x : Point) (l : Label B N0 × Fin 2) +@[expose] noncomputable def viewTangent (n : ℕ) (x : Point) (l : Label B N0 × Fin 2) (Y : Plane) (theta : ℝ) : Fin 3 → ℝ := physicalTangentMode l.2 l.1 (nativePoint n x l.1) ((CommonCoverSolve.coverPower (CorrectionInitialization.CommonWindow.index h n)).symm Y) theta @@ -579,13 +579,13 @@ theorem physicalScale_tail (B N0 : ℕ) {n : ℕ} (hn : (choice B N0).prepared.N /-- Tangent sum, defined pointwise by `∑ l ∈ activeLabels standardRegion B N0 n, (piece standardRegion l.2 l.1).tangentVelocity n z i`. -/ -noncomputable def tangentSum (B N0 : ℕ) : CorrectionState.Oscillation Point := +@[expose] noncomputable def tangentSum (B N0 : ℕ) : CorrectionState.Oscillation Point := fun n z i => ∑ l ∈ activeLabels standardRegion B N0 n, (piece standardRegion l.2 l.1).tangentVelocity n z i /-- Tangent covariance, given by `CorrectionState.bilinearCovariance (tangentSum B N0) (tangentSum B N0) i j`. -/ -noncomputable def tangentCovariance (B N0 : ℕ) (i j : Fin 3) : +@[expose] noncomputable def tangentCovariance (B N0 : ℕ) (i j : Fin 3) : CorrectionState.ScalarField Point := CorrectionState.bilinearCovariance (tangentSum B N0) (tangentSum B N0) i j @@ -1105,7 +1105,7 @@ theorem physicalWindow_continuousOn (n : ℕ) : /-- Cut amplitude, given by `((chartCoefficients j L).withCutoff (chartCutoff j L)).amplitude n`. -/ -noncomputable def cutAmplitude (j : Fin 2) (L : Label B N0) (n : ℕ) : +@[expose] noncomputable def cutAmplitude (j : Fin 2) (L : Label B N0) (n : ℕ) : FullPoint → HarmonicCalculus.ComplexVector := ((chartCoefficients j L).withCutoff (chartCutoff j L)).amplitude n diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryDynamics.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryDynamics.lean index e2d0ead503..27df1ce121 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryDynamics.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualPrimaryDynamics.lean @@ -19,7 +19,7 @@ equation is localized to the Gaussian support: the outer attachment cutoff is deliberately differentiated outside that support. -/ -@[expose] public section +public section noncomputable section @@ -263,7 +263,7 @@ noncomputable def copyLinear (j : Fin 2) (L : Label B N0) (n : ℕ) : FullPoint /-- Copy point, given by `(nativeSlow L (toAbsolute n x.1), (geometry j L).coordinates k (toAbsolute n x.1).2)`. -/ -noncomputable def copyPoint (j : Fin 2) (L : Label B N0) (n : ℕ) +@[expose] noncomputable def copyPoint (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : Native := (nativeSlow L (toAbsolute n x.1), (geometry j L).coordinates k (toAbsolute n x.1).2) @@ -290,17 +290,17 @@ theorem copyPoint_smooth (j : Fin 2) (L : Label B N0) (n : ℕ) /-- Clock scale, given by `ChartScales.Q n ^ (1+h) / ChartScales.Q (BaseChartJets.cellBand L) ^ (1+h)`. -/ -noncomputable def clockScale (L : Label B N0) (n : ℕ) : ℝ := +@[expose] noncomputable def clockScale (L : Label B N0) (n : ℕ) : ℝ := ChartScales.Q n ^ (1+h) / ChartScales.Q (BaseChartJets.cellBand L) ^ (1+h) /-- Radial scale, given by `Real.sqrt (ChartScales.Q n) / Real.sqrt (ChartScales.Q (BaseChartJets.cellBand L))`. -/ -noncomputable def radialScale (L : Label B N0) (n : ℕ) : ℝ := +@[expose] noncomputable def radialScale (L : Label B N0) (n : ℕ) : ℝ := Real.sqrt (ChartScales.Q n) / Real.sqrt (ChartScales.Q (BaseChartJets.cellBand L)) /-- Velocity scale, given by `ChartScales.Q n ^ CoordinateAlgebra.A h / ChartScales.Q (BaseChartJets.cellBand L) ^ CoordinateAlgebra.A h`. -/ -noncomputable def velocityScale (L : Label B N0) (n : ℕ) : ℝ := +@[expose] noncomputable def velocityScale (L : Label B N0) (n : ℕ) : ℝ := ChartScales.Q n ^ CoordinateAlgebra.A h / ChartScales.Q (BaseChartJets.cellBand L) ^ CoordinateAlgebra.A h @@ -335,7 +335,7 @@ noncomputable def slotLinear (j : Fin 2) (L : Label B N0) (n : ℕ) : n)))) /-- Slot point, given by `((copyPoint j L n k x).1,(x.2,(copyPoint j L n k x).2.2))`. -/ -noncomputable def slotPoint (j : Fin 2) (L : Label B N0) (n : ℕ) +@[expose] noncomputable def slotPoint (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : PhaseCalculus.Slot := ((copyPoint j L n k x).1,(x.2,(copyPoint j L n k x).2.2)) @@ -459,7 +459,7 @@ section CopyGerms variable {B N0 : ℕ} /-- Coefficient point, given by `(nativeSlow L (toAbsolute n x.1), (toAbsolute n x.1).2)`. -/ -noncomputable def coefficientPoint (L : Label B N0) (n : ℕ) (x : FullPoint) : Native := +@[expose] noncomputable def coefficientPoint (L : Label B N0) (n : ℕ) (x : FullPoint) : Native := (nativeSlow L (toAbsolute n x.1), (toAbsolute n x.1).2) theorem coefficientPoint_smooth (L : Label B N0) (n : ℕ) : @@ -519,13 +519,13 @@ theorem pressureScale_eq (L : Label B N0) (n : ℕ) : /-- Copy amplitude, given by `velocityScale L n • CurlClassBounds.complexify (attachedRawVelocity j L (copyPoint j L n k x))`. -/ -noncomputable def copyAmplitude (j : Fin 2) (L : Label B N0) (n : ℕ) +@[expose] noncomputable def copyAmplitude (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : ComplexVector := velocityScale L n • CurlClassBounds.complexify (attachedRawVelocity j L (copyPoint j L n k x)) /-- Copy pressure, given by `velocityScale L n ^ 2 • attachedRawPressure j L (copyPoint j L n k x)`. -/ -noncomputable def copyPressure (j : Fin 2) (L : Label B N0) (n : ℕ) +@[expose] noncomputable def copyPressure (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : ℂ := velocityScale L n ^ 2 • attachedRawPressure j L (copyPoint j L n k x) @@ -643,7 +643,7 @@ theorem native_base_differentiable (j : Fin 2) (L : Label B N0) (n : ℕ) /-- Normal scale, given by `((ChartScales.carrier h (BaseChartJets.cellBand L) : ℝ) / (ChartScales.carrier h n : ℝ)) * radialScale L n`. -/ -noncomputable def normalScale (L : Label B N0) (n : ℕ) : ℝ := +@[expose] noncomputable def normalScale (L : Label B N0) (n : ℕ) : ℝ := ((ChartScales.carrier h (BaseChartJets.cellBand L) : ℝ) / (ChartScales.carrier h n : ℝ)) * radialScale L n diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualReferenceRebase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualReferenceRebase.lean index ff3d816a49..422f4c4334 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualReferenceRebase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualReferenceRebase.lean @@ -30,7 +30,7 @@ Volterra solves, and a bijective copy reindexing gives the same symmetry of the periodized velocity and pressure. -/ -@[expose] public section +public section noncomputable section @@ -356,7 +356,7 @@ end end -@[expose] public section +public section noncomputable section @@ -570,6 +570,7 @@ noncomputable def pullWave (e : D ≃L[ℝ] E) (a : LinearWaveBounds.WaveCoeffic /-- Pull directions, bundling `radial`, `auxiliary`, `axial`, `angular` and the required compatibility proofs. -/ +@[expose] noncomputable def pullDirections (e : D ≃L[ℝ] E) (d : LinearWaveBounds.GraphDirections E) : LinearWaveBounds.GraphDirections D where radial := e.symm d.radial @@ -599,7 +600,7 @@ end Pullback variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Inverse cover, given by `(ContinuousLinearEquiv.refl ℝ P).prodCongr (coverPower k).symm`. -/ -noncomputable def inverseCover (k : ℕ) : (P × Plane) ≃L[ℝ] (P × Plane) := +@[expose] noncomputable def inverseCover (k : ℕ) : (P × Plane) ≃L[ℝ] (P × Plane) := (ContinuousLinearEquiv.refl ℝ P).prodCongr (coverPower k).symm @[simp] theorem inverseCover_apply (k : ℕ) (x : P × Plane) : @@ -1289,7 +1290,7 @@ theorem residualBandPressure_rebase_at (D : ParticularWaveAssembly.AssemblyData exact hf /-- The literal current-source common coefficient in the actual stage. -/ -noncomputable def actualCoefficients +@[expose] noncomputable def actualCoefficients (x : CorrectionStep.CycleState (ActualParticularStageControls.Label B N0)) (l : ActualParticularStageControls.Label B N0) (j : ℤ) : LinearWaveBounds.WaveCoefficients WaveSpace := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCoherence.lean index 9ed44d9056..bb164173e1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCoherence.lean @@ -19,7 +19,7 @@ the periodized amplitude and the curl correction are then compared in the actual charts. No coherence of a signed output is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCommonDynamics.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCommonDynamics.lean index 568e866767..1eb98dd21d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCommonDynamics.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCommonDynamics.lean @@ -18,7 +18,7 @@ The native closed-cell equations are joined through the literal common copy construction. The complement is handled by actual input zero germs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCurrentSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCurrentSupport.lean index 0cdf4509e9..eb815f2c15 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCurrentSupport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedCurrentSupport.lean @@ -18,7 +18,7 @@ copy sum as the correction cycle. Their support implies membership in the actual active-label set, before any physical pullback or finite sum. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedDynamics.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedDynamics.lean index 5e8415141f..ba5168ffce 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedDynamics.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedDynamics.lean @@ -18,7 +18,7 @@ base action, and tangency germ therefore apply to either signed column before the separate scalar multiplication and compact cutoff. -/ -@[expose] public section +public section noncomputable section @@ -51,13 +51,13 @@ noncomputable def unitPulse (j : Fin 2) (L : Label B N0) (n : ℕ) /-- Unit motion, given by `(normalScale L n * clockScale L n) • (phases B N0 j).phase.velocity L (phasePoint L (copyPoint j L n k x))`. -/ -noncomputable def unitMotion (j : Fin 2) (L : Label B N0) (n : ℕ) +@[expose] noncomputable def unitMotion (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : Space := (normalScale L n * clockScale L n) • (phases B N0 j).phase.velocity L (phasePoint L (copyPoint j L n k x)) /-- Unit action, constructed using `clockScale`. -/ -noncomputable def unitAction (j : Fin 2) (L : Label B N0) (n : ℕ) +@[expose] noncomputable def unitAction (j : Fin 2) (L : Label B N0) (n : ℕ) (k : TorusInverse.Frequency) (x : FullPoint) : Space →L[ℝ] Space := clockScale L n • PrimaryCopyBridge.baseOperator ((phases B N0 j).phase.F L (copyPoint j L n k x).1) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedExterior.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedExterior.lean index 776e12666b..bf49fdbeb0 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedExterior.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedExterior.lean @@ -28,7 +28,7 @@ constructors. Physical copies are then assembled before the locally finite sum is estimated; no maximum over infinitely many per-label constants occurs. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ namespace Family variable (f : Family) /-- Singleton label, given by `⟨L.val, L.property, Set.mem_singleton _⟩`. -/ -noncomputable def singletonLabel (L : NativeLabel f.active) : +@[expose] noncomputable def singletonLabel (L : NativeLabel f.active) : NativeLabel ({(L : BandLabel)} : Set BandLabel) := ⟨L.val, L.property, Set.mem_singleton _⟩ @@ -81,7 +81,7 @@ noncomputable def singletonPayload (L : NativeLabel f.active) /-- Reuse the old homogeneous interface for exactly one actual label. There is no choice of data for an omitted label. -/ -noncomputable def singleton (L : NativeLabel f.active) : +@[expose] noncomputable def singleton (L : NativeLabel f.active) : ActualSignedPhysicalData.SignedFamily (f.domain L) where active := {(L : BandLabel)} primary _ := f.primary L @@ -118,7 +118,7 @@ theorem singleton_request (L : NativeLabel f.active) : rfl /-- Extend actual values by zero without extending their primary data. -/ -noncomputable def valueAt {V : Type*} [Zero V] +@[expose] noncomputable def valueAt {V : Type*} [Zero V] (value : NativeLabel f.active → V) (L : BandLabel) : V := by classical exact if hL : L ∈ f.active then value ⟨L.val, L.property, hL⟩ else 0 @@ -142,7 +142,7 @@ end Family variable {H : ℕ} {K : Type*} /-- Zero copies, bundling `gap`, `carrier`, `amplitude`. -/ -noncomputable def zeroCopies : CopyFamily H K where +@[expose] noncomputable def zeroCopies : CopyFamily H K where gap _ := 0 carrier _ _ := ⟨0, 0, 0, 0, 0, fun _ => 0, fun _ => 0⟩ amplitude _ _ _ := 0 @@ -178,7 +178,7 @@ theorem zeroSmooth {a h r0 : ℝ} : ⟨univ, isOpen_univ, mem_univ _, contDiffOn_const⟩⟩ /-- Diagonal, bundling `gap`, `carrier`, `amplitude`. -/ -noncomputable def diagonal (f : BandLabel → CopyFamily H K) : CopyFamily H K where +@[expose] noncomputable def diagonal (f : BandLabel → CopyFamily H K) : CopyFamily H K where gap L := (f L).gap L carrier k L := (f L).carrier k L amplitude k I := (f I.1).amplitude k I @@ -254,7 +254,7 @@ namespace Family variable (f : Family) /-- The missing labels receive zero copies, never invented primary data. -/ -noncomputable def copyAt (copies : NativeLabel f.active → CopyFamily H K) +@[expose] noncomputable def copyAt (copies : NativeLabel f.active → CopyFamily H K) (L : BandLabel) : CopyFamily H K := by classical exact if hL : L ∈ f.active then copies ⟨L.val, L.property, hL⟩ else zeroCopies @@ -271,7 +271,7 @@ theorem copyAt_inactive (copies : NativeLabel f.active → CopyFamily H K) simp only [copyAt, dite_eq_right hL] /-- Assembled, given by `diagonal (f.copyAt copies)`. -/ -noncomputable def assembled (copies : NativeLabel f.active → CopyFamily H K) : +@[expose] noncomputable def assembled (copies : NativeLabel f.active → CopyFamily H K) : CopyFamily H K := diagonal (f.copyAt copies) theorem assembled_term_active (copies : NativeLabel f.active → CopyFamily H K) @@ -286,7 +286,7 @@ theorem assembled_term_inactive (copies : NativeLabel f.active → CopyFamily H rw [assembled, diagonal_term, copyAt_inactive f copies hI, zeroCopies_term] /-- Branch cells as an element of `SupportCells (f.copyAt copies L)`. -/ -noncomputable def branchCells (copies : NativeLabel f.active → CopyFamily H K) +@[expose] noncomputable def branchCells (copies : NativeLabel f.active → CopyFamily H K) (c : ∀ L, SupportCells (copies L)) (L : BandLabel) : SupportCells (f.copyAt copies L) := by classical @@ -352,13 +352,13 @@ noncomputable def pressureSource (L : BandLabel) : /-- Potential copies, given by `f.assembled (fun L => ActualSignedPhysicalData.potentialFamily sys hh (f.singleton L) i)`. -/ -noncomputable def potentialCopies (i : Fin 3) : +@[expose] noncomputable def potentialCopies (i : Fin 3) : CopyFamily 1 TorusInverse.Frequency := f.assembled (fun L => ActualSignedPhysicalData.potentialFamily sys hh (f.singleton L) i) /-- Pressure copies, given by `f.assembled (fun L => ActualSignedPhysicalData.pressureFamily sys hh (f.singleton L))`. -/ -noncomputable def pressureCopies : CopyFamily 1 TorusInverse.Frequency := +@[expose] noncomputable def pressureCopies : CopyFamily 1 TorusInverse.Frequency := f.assembled (fun L => ActualSignedPhysicalData.pressureFamily sys hh (f.singleton L)) /-- Native Cartesian rotation and the physical factor are retained @@ -626,7 +626,7 @@ end end -@[expose] public section +public section noncomputable section @@ -795,7 +795,7 @@ noncomputable def payload (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding. /-- Both signs and every actual primary label are retained. Only proof transport of the reference index is used in the view/state fields. -/ -noncomputable def family (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding.nativeViews +@[expose] noncomputable def family (s : ∀ l : Label B N0, (ActualSignedPhysicalBinding.nativeViews l).StateData) : DependentSignedPhysicalFamily.Family where active := labels B N0 @@ -920,13 +920,13 @@ theorem pressure_sum_zero (a r0 : ℝ) {w : SpaceTime} simp only [CopyFamily.sum, CopyFamily.periodized, hz, tsum_zero, finsum_zero] /-- The literal dependent-family potential, at the fixed physical chart radius. -/ -noncomputable def potential : VelocityField := +@[expose] noncomputable def potential : VelocityField := PhysicalCopyBounds.vectorSum ((family s).potentialCopies slots outgoing.data.h_pos.le) ActualPolarCoverage.inner h slots.radius /-- Pressure, defined pointwise by `(((family s).pressureCopies slots outgoing.data.h_pos.le).sum ActualPolarCoverage.inner h slots.radius w).re`. -/ -noncomputable def pressure : PressureField := +@[expose] noncomputable def pressure : PressureField := fun w => (((family s).pressureCopies slots outgoing.data.h_pos.le).sum ActualPolarCoverage.inner h slots.radius w).re diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedGeometry.lean index a0c2866d87..4d1e669bd9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedGeometry.lean @@ -29,7 +29,7 @@ are computed from the same prepared primary family. Their native-copy estimates have constants before all labels, bands and copies. -/ -@[expose] public section +public section noncomputable section @@ -848,7 +848,7 @@ end end -@[expose] public section +public section noncomputable section @@ -929,7 +929,7 @@ noncomputable def nativeDomain : PrimaryCopyBounds.JetDomain (Label H v a) Nativ /-- Pulse coordinates, given by `(x.1, x.2.2 / ChartScales.slotLength r0 F.data.h (BaseChartJets.cellBand L))`. -/ -noncomputable def pulseCoordinates (L : Label H v a) (x : Native) : Slow × ℝ := +@[expose] noncomputable def pulseCoordinates (L : Label H v a) (x : Native) : Slow × ℝ := (x.1, x.2.2 / ChartScales.slotLength r0 F.data.h (BaseChartJets.cellBand L)) theorem nativeSlow_positive (L : Label H v a) {p : Slow} @@ -1231,6 +1231,7 @@ variable {D h : ℝ} {vr vt : Plane} (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) /-- Slot geometry, constructed using `CommonCoverClass.bandGeometry`. -/ +@[expose] noncomputable def slotGeometry (l : SlotColoring.Label) (gap : ℕ) : CommonCoverSolve.Geometry := CommonCoverClass.bandGeometry (TorusAverages.slotChart vr vt hdet) h l.1 gap (PartitionedCovariance.slotCenter h l - sys.radius • vt) @@ -1467,7 +1468,7 @@ variable {D h : ℝ} {vr vt : Plane} (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) /-- Copy point as an element of `Native`. -/ -noncomputable def copyPoint (l : SlotColoring.Label) (chart common : ℕ) +@[expose] noncomputable def copyPoint (l : SlotColoring.Label) (chart common : ℕ) (k : TorusInverse.Frequency) (x : Native) : Native := (slowChange h (ChartScales.Q chart) (ChartScales.Q l.1) x.1, (slotGeometry sys hdet l (ChartScales.nativeIndex h l.1 - common)).coordinates k x.2) @@ -1857,7 +1858,7 @@ theorem slot_coordinates_axial (g : CommonCoverSolve.Geometry) (Q h : ℝ) (i : simp [PhaseCalculus.eZ] /-- Periodic phase, constructed using `PhaseCalculus.phase`. -/ -noncomputable def periodicPhase (l : SlotColoring.Label) (gap : ℕ) +@[expose] noncomputable def periodicPhase (l : SlotColoring.Label) (gap : ℕ) (epsilon p pz x0 : ℝ) (F G : Slow → ℝ) (x : Cylinder) : ℝ := PhaseCalculus.phase epsilon p pz x0 F G ((x.1.1, x.1.2.1), (x.2, @@ -2065,13 +2066,14 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (a : PrimaryGeometryAssembly.Prepared H v upper B sys.radius N0) /-- Prepared phase as an element of `Cylinder → ℝ`. -/ -noncomputable def preparedPhase (j : Fin 2) (L : Label H v a) : Cylinder → ℝ := +@[expose] noncomputable def preparedPhase (j : Fin 2) (L : Label H v a) : Cylinder → ℝ := let P := PrimaryGeometryAssembly.construction H v a sys.radius_pos j periodicPhase sys (PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label W L) j) 0 (ChartScales.epsilon F.data.h (BaseChartJets.cellBand L)) (P.phase.p L) (P.phase.pz L) (P.phase.x0 L) (P.phase.F L) (P.phase.G L) /-- Prepared view phase as an element of `Cylinder → ℝ`. -/ +@[expose] noncomputable def preparedViewPhase (j : Fin 2) (L : Label H v a) (n common : ℕ) : Cylinder → ℝ := fun x => ((ChartScales.carrier F.data.h (BaseChartJets.cellBand L) : ℝ) / (ChartScales.carrier F.data.h n : ℝ)) * preparedPhase H v sys a j L @@ -2325,7 +2327,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (a : PrimaryGeometryAssembly.Prepared H v upper B r0 N0) /-- Native cutoff, constructed using `SquaredPartition.dyadicProfile`. -/ -noncomputable def nativeCutoff (L : Label H v a) (x : Native) : ℝ := +@[expose] noncomputable def nativeCutoff (L : Label H v a) (x : Native) : ℝ := SquaredPartition.dyadicProfile (SimilarityHomogeneity.chartQ F.data.h x.1) * PrimaryRepresentatives.nativeMask (BaseChartJets.cellBand L) (PrimaryGeometryAssembly.label W L).2 x.1 * @@ -2416,7 +2418,7 @@ end CutoffSupport /-- Swap parameter, bundling `toFun`, `invFun`, `left_inv`, `right_inv` and the required compatibility proofs. -/ -noncomputable def swapParameter : Slow ≃ₗᵢ[ℝ] Slow where +@[expose] noncomputable def swapParameter : Slow ≃ₗᵢ[ℝ] Slow where toFun x := (x.1, (x.2.2, x.2.1)) invFun x := (x.1, (x.2.2, x.2.1)) left_inv _ := rfl diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedOutputBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedOutputBounds.lean index 7fcb0137b0..195c70b601 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedOutputBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedOutputBounds.lean @@ -17,7 +17,7 @@ are restricted to the signed phase cells before applying the native-copy localization and periodization estimates. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open scoped ContDiff Topology BigOperators variable {B N0 : ℕ} /-- Copies, given by `(parameters l).copyData ActualPrimaryBounds.strip request`. -/ -noncomputable def copies (request : ℕ → FullPoint → SignedWaveUpdate.Vec2) +@[expose] noncomputable def copies (request : ℕ → FullPoint → SignedWaveUpdate.Vec2) (l : SignedLabel B N0) : PeriodizedWaveBounds.CopyData FullPoint Frequency := (parameters l).copyData ActualPrimaryBounds.strip request @@ -302,7 +302,7 @@ theorem actual_block_bounds (G : SignedMeanGain.Geometry) /-- The cut native vector-potential coefficient before restoring the carrier or applying the physical coordinate prefactor. -/ -noncomputable def localPotential (request : ℕ → FullPoint → SignedWaveUpdate.Vec2) +@[expose] noncomputable def localPotential (request : ℕ → FullPoint → SignedWaveUpdate.Vec2) (l : SignedLabel B N0) (n : ℕ) (k : Frequency) (x : FullPoint) : HarmonicCalculus.ComplexVector := CurlClassBounds.inverseCarrier ((copies request l).background.frequency n) • diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalBinding.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalBinding.lean index 887ab7039c..4f44fe81e3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalBinding.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalBinding.lean @@ -35,7 +35,7 @@ its original torus while the primary wave uses native fast coordinates. Freezing the band index preserves every actual derivative and average. -/ -@[expose] public section +public section noncomputable section @@ -344,7 +344,7 @@ end end -@[expose] public section +public section noncomputable section @@ -376,7 +376,7 @@ noncomputable def reference (l : Label B N0) : ℕ := BaseChartJets.cellBand l.1 /-- Domain, given by `ActualParticularStageControls.reindexDomain (PrimaryGeometryAssembly.domain nominal (choice B N0).prepared.N) (fun _ => l.1)`. -/ -noncomputable def domain (l : Label B N0) : PhaseJetBounds.Domain ℕ Slow := +@[expose] noncomputable def domain (l : Label B N0) : PhaseJetBounds.Domain ℕ Slow := ActualParticularStageControls.reindexDomain (PrimaryGeometryAssembly.domain nominal (choice B N0).prepared.N) (fun _ => l.1) @@ -391,7 +391,7 @@ noncomputable def pulse (l : Label B N0) (j : Fin 2) : /-- Spatial label, given by `PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label nominal l.1) l.2`. -/ -noncomputable def spatialLabel (l : Label B N0) : SlotColoring.Label := +@[expose] noncomputable def spatialLabel (l : Label B N0) : SlotColoring.Label := PartitionedCovariance.signedLabel (PrimaryGeometryAssembly.label nominal l.1) l.2 /-- Geometry, given by `ActualSignedGeometry.slotGeometry slots vectors_det (spatialLabel l) 0`. -/ @@ -688,7 +688,7 @@ theorem label_large (l : Label B N0) : 4 ≤ (spatialLabel l).1 := /-- Layout, given by `ActualSignedPhysicalData.layout slots outgoing.data.h_pos.le (spatialLabel l) (label_large l) 0`. -/ -noncomputable def layout (l : Label B N0) : ActualPeriodizedSignedRealization.Layout := +@[expose] noncomputable def layout (l : Label B N0) : ActualPeriodizedSignedRealization.Layout := ActualSignedPhysicalData.layout slots outgoing.data.h_pos.le (spatialLabel l) (label_large l) 0 @[simp] theorem layout_geometry (l : Label B N0) (n : ℕ) : @@ -915,7 +915,7 @@ theorem nativeView_target (l : Label B N0) : rfl /-- Native coefficients, constructed using `SignedWaveUpdate.coefficients`. -/ -noncomputable def nativeCoefficients (l : Label B N0) +@[expose] noncomputable def nativeCoefficients (l : Label B N0) (R : ℕ → Cylinder → SignedWaveUpdate.Vec2) (k : TorusInverse.Frequency) : LinearWaveBounds.WaveCoefficients Cylinder := SignedWaveUpdate.coefficients (primary l).base (primary l).strip (primary l).directions @@ -973,6 +973,7 @@ variable (l : Label B N0) (P : SignedStressPrimitive.Patch) (u : State Point) (hp : GaugeMomentBalances.MovingField standardRegion P.a P.b u.pressure) /-- Reference copies, constructed using `ActualSignedPhysicalData.dynamicCopyData`. -/ +@[expose] noncomputable def referenceCopies : PeriodizedWaveBounds.CopyData Cylinder TorusInverse.Frequency := ActualSignedPhysicalData.dynamicCopyData slots outgoing.data.h_pos.le (spatialLabel l) (label_large l) 0 (primary l) (nativeViews l) (nativeStateData l P u H hp).referenceRequest l.2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalCoherence.lean index 8fd0581e18..d33fb9f92f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalCoherence.lean @@ -33,7 +33,7 @@ ratio lies in `(1/2,2)`. An explicit change of the chart radius identifies the scaled Cartesian lift with the full native cylindrical graph. -/ -@[expose] public section +public section noncomputable section @@ -233,7 +233,7 @@ copy family and to every current-band representation of the same label. The current state and the native reference requests are arbitrary. -/ -@[expose] public section +public section noncomputable section @@ -562,7 +562,7 @@ They let a physical wave assembly retain an unrestricted label `finsum` while identifying its value with the finite active-label sum. -/ -@[expose] public section +public section noncomputable section @@ -626,7 +626,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalData.lean index 09154f44d2..c8a18ce26c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPhysicalData.lean @@ -20,7 +20,7 @@ is repartitioned exactly, and the physical carrier uses the midpoint of each actual lattice-translated slot. -/ -@[expose] public section +public section noncomputable section @@ -269,7 +269,7 @@ noncomputable def layout (hh : 0 ≤ h) (label : SlotColoring.Label) (hl : 4 ≤ hl gap /-- The actual native carrier, retaining the individual lattice midpoint. -/ -noncomputable def carrier (label : SlotColoring.Label) (k : Frequency) +@[expose] noncomputable def carrier (label : SlotColoring.Label) (k : Frequency) (p pz x0 : ℝ) (F G : PhysicalGraphBounds.Slow → ℝ) : PhysicalWaveSum.CarrierData where chart := 0 center := center (h := h) label k @@ -281,6 +281,7 @@ noncomputable def carrier (label : SlotColoring.Label) (k : Frequency) /-- Polar coordinates are used only as a chart for the actual Cartesian lift; the free torus coordinate remains unchanged. -/ +@[expose] noncomputable def cylinderAt (a : ℝ) (chart : PolarCharts.Index) (x : LiftPoint) : Cylinder := (((PolarCharts.chart a chart (PhysicalGraphBounds.liftXY x)).1, (PhysicalGraphBounds.liftZT x, x.2)), @@ -337,7 +338,7 @@ noncomputable def dynamicCoefficients (request : ℕ → Cylinder → Vec2) (j : /-- The raw mask carries only the slow cutoff. The transverse mask and Gaussian together form the final compact native cutoff. -/ -noncomputable def dynamicCopyData (request : ℕ → Cylinder → Vec2) (j : Fin 2) : +@[expose] noncomputable def dynamicCopyData (request : ℕ → Cylinder → Vec2) (j : Fin 2) : PeriodizedWaveBounds.CopyData Cylinder Frequency where background := (ActualPeriodizedSignedRealization.periodizedPrimary B (layout sys hh label hl gap)).viewBase @@ -425,6 +426,7 @@ structure SignedFamily (U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow) where column : NativeLabel active → Fin 2 /-- Positive index, given by `(L, ⟨1, by decide⟩)`. -/ +@[expose] noncomputable def positiveIndex (L : PhysicalWaveSum.BandLabel) : PhysicalWaveSum.WaveIndex 1 := (L, ⟨1, by decide⟩) @@ -628,7 +630,7 @@ noncomputable def selectedCarrier (L : NativeLabel f.active) (k : Frequency) : (((f.primary L).pulse (f.column L)).phase.G L.val.1) /-- Extended carrier, with branches according to `hL : L ∈ f.active`. -/ -noncomputable def extendedCarrier (L : PhysicalWaveSum.BandLabel) (k : Frequency) : +@[expose] noncomputable def extendedCarrier (L : PhysicalWaveSum.BandLabel) (k : Frequency) : PhysicalWaveSum.CarrierData := if hL : L ∈ f.active then selectedCarrier (h := h) f ⟨L.val, L.property, hL⟩ k @@ -644,6 +646,7 @@ theorem extendedCarrier_center (L : PhysicalWaveSum.BandLabel) (k : Frequency) : split_ifs <;> rfl /-- Raw signed amplitude, constructed using `ActualPeriodizedSignedRealization.referenceScalar`. -/ +@[expose] noncomputable def rawSignedAmplitude (L : NativeLabel f.active) (k : Frequency) (x : Cylinder) : ComplexVector := ActualPeriodizedSignedRealization.referenceScalar (f.primary L) (f.state L).referenceRequest @@ -652,7 +655,7 @@ noncomputable def rawSignedAmplitude (L : NativeLabel f.active) (k : Frequency) (layout sys hh L.val L.property 0) (f.column L) L.val.1 k x) /-- Raw potential, constructed using `CurlClassBounds.inverseCarrier`. -/ -noncomputable def rawPotential (L : NativeLabel f.active) (k : Frequency) (x : Cylinder) : +@[expose] noncomputable def rawPotential (L : NativeLabel f.active) (k : Frequency) (x : Cylinder) : ComplexVector := CurlClassBounds.inverseCarrier ((f.primary L).base.frequency L.val.1) • CurlClassBounds.normalCoefficient @@ -660,6 +663,7 @@ noncomputable def rawPotential (L : NativeLabel f.active) (k : Frequency) (x : C (rawSignedAmplitude sys hh f L k x) /-- Raw pressure, constructed using `ActualPeriodizedSignedRealization.referenceScalar`. -/ +@[expose] noncomputable def rawPressure (L : NativeLabel f.active) (k : Frequency) (x : Cylinder) : ℂ := ActualPeriodizedSignedRealization.referenceScalar (f.primary L) (f.state L).referenceRequest (f.column L) L.val.1 x • @@ -671,6 +675,7 @@ noncomputable def rawPressure (L : NativeLabel f.active) (k : Frequency) (x : Cy /-- One positive harmonic suffices because the physical field takes the real part. Its native copies retain their individual centers and phases. -/ +@[expose] noncomputable def potentialFamily (i : Fin 3) : PhysicalCopyBounds.CopyFamily 1 Frequency where gap _ := 0 carrier k L := extendedCarrier (h := h) f L k @@ -684,7 +689,7 @@ noncomputable def potentialFamily (i : Fin 3) : PhysicalCopyBounds.CopyFamily 1 else 0 /-- Pressure family, bundling `gap`, `carrier`, `amplitude`. -/ -noncomputable def pressureFamily : PhysicalCopyBounds.CopyFamily 1 Frequency where +@[expose] noncomputable def pressureFamily : PhysicalCopyBounds.CopyFamily 1 Frequency where gap _ := 0 carrier k L := extendedCarrier (h := h) f L k amplitude k I x := if hL : I.1 ∈ f.active then @@ -1044,6 +1049,7 @@ theorem potential_commonWave (L : NativeLabel f.active) (k : Frequency) (i : Fin omit G in /-- Reference potential coefficient, constructed using `CurlClassBounds.inverseCarrier`. -/ +@[expose] noncomputable def referencePotentialCoefficient (L : NativeLabel f.active) (x : Cylinder) : ComplexVector := CurlClassBounds.inverseCarrier ((f.primary L).base.frequency L.val.1) • @@ -1332,6 +1338,7 @@ variable {D h : ℝ} (hh : 0 ≤ h) {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} (f : SignedFamily U) /-- Native potential source, with branches according to `hL : I.1.1 ∈ f.active`. -/ +@[expose] noncomputable def nativePotentialSource (I : SourceIndex) (n : ℕ) (y : Native) : ComplexVector := if hL : I.1.1 ∈ f.active then if I.1.2.val = 1 ∧ n = I.1.1.val.1 then @@ -1341,7 +1348,7 @@ noncomputable def nativePotentialSource (I : SourceIndex) (n : ℕ) (y : Native) else 0 /-- Native pressure source, with branches according to `hL : I.1.1 ∈ f.active`. -/ -noncomputable def nativePressureSource (I : SourceIndex) (n : ℕ) (y : Native) : ℂ := +@[expose] noncomputable def nativePressureSource (I : SourceIndex) (n : ℕ) (y : Native) : ℂ := if hL : I.1.1 ∈ f.active then if I.1.2.val = 1 ∧ n = I.1.1.val.1 then waveMask sys I.1.1.val ((geometry sys I.1.1.val 0).coordinates I.2 y.2.2) • @@ -1701,6 +1708,7 @@ theorem term_tsupport_labelRegion {H : ℕ} {K : Type*} /-- Native slow, given by `(y.1, (y.2.1.2, y.2.1.1))`. -/ +@[expose] noncomputable def nativeSlow (y : Native) : PhysicalGraphBounds.Slow := (y.1, (y.2.1.2, y.2.1.1)) theorem slotSlow_eq_nativeSlow {a : ℝ} (ha : 0 < a) (c : PhysicalWaveSum.CarrierData) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPotentialCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPotentialCoherence.lean index bfc6860366..cf0cf05598 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPotentialCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedPotentialCoherence.lean @@ -16,7 +16,7 @@ after its native cutoffs and copy sum. Its scale follows from the actual normal, amplitude and carrier identities, before any physical curl is taken. -/ -@[expose] public section +public section noncomputable section @@ -36,6 +36,7 @@ abbrev FullPoint := ActualSignedCoherence.FullPoint variable {B N0 : ℕ} /-- The coefficient of the literal current-band vector potential. -/ +@[expose] noncomputable def potentialCoefficient (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (x : FullPoint) : ComplexVector := CurlClassBounds.inverseCarrier ((copies l u).common.frequency n) • @@ -49,7 +50,7 @@ noncomputable def potential (l : SignedLabel B N0) (u : CorrectionState.State Po (copies l u).common.curlPotential fullStrip (ActualSignedStageControls.directions B) n /-- The actual current common pressure, with its carrier retained. -/ -noncomputable def pressureMode (l : SignedLabel B N0) (u : CorrectionState.State Point) +@[expose] noncomputable def pressureMode (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) : FullPoint → ℂ := mode ((copies l u).common.frequency n) ((copies l u).common.phase n) ((copies l u).common.pressure n) @@ -146,12 +147,14 @@ theorem pressureMode_of_request (l : SignedLabel B N0) (u : CorrectionState.Stat simp only [pressureMode, mode, ha, hc, Complex.real_smul, mul_assoc] /-- The physical power of the potential, before choosing any physical graph. -/ +@[expose] noncomputable def rescaledPotential (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (x : FullPoint) : ComplexVector := ChartScales.Q n ^ (-h) • potential l u n x /-- Rescaled pressure mode, given by `ChartScales.Q n ^ (-(2 * CoordinateAlgebra.A h)) • pressureMode l u n x`. -/ +@[expose] noncomputable def rescaledPressureMode (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (x : FullPoint) : ℂ := ChartScales.Q n ^ (-(2 * CoordinateAlgebra.A h)) • pressureMode l u n x @@ -312,7 +315,7 @@ theorem rescaled_eq_of_absolute (l : SignedLabel B N0) (u : CorrectionState.Stat /-! ## The actual cylindrical graph, with the slow-coordinate swap explicit -/ /-- `commonGraph` uses `(Z,T)`; the correction state uses `(T,Z)`. -/ -noncomputable def nativePoint (n : ℕ) (z : ProblemStatement.SpaceTime) : FullPoint := +@[expose] noncomputable def nativePoint (n : ℕ) (z : ProblemStatement.SpaceTime) : FullPoint := PhysicalResidualTZ.swapCylinder ((PhysicalResidualBridge.commonGraph (ChartScales.Q n) h (CommonWindow.index h n)).map z) @@ -335,11 +338,13 @@ theorem nativePoint_smoothAt (n : ℕ) (z : ProblemStatement.SpaceTime) (hr : 0 (mul_pos (Real.rpow_pos_of_pos (ChartScales.Q_pos n) _) hr).ne') /-- Cylindrical potential, given by `rescaledPotential l u n (nativePoint n z)`. -/ +@[expose] noncomputable def cylindricalPotential (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (z : ProblemStatement.SpaceTime) : ComplexVector := rescaledPotential l u n (nativePoint n z) /-- Cylindrical pressure mode, given by `rescaledPressureMode l u n (nativePoint n z)`. -/ +@[expose] noncomputable def cylindricalPressureMode (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (z : ProblemStatement.SpaceTime) : ℂ := rescaledPressureMode l u n (nativePoint n z) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedReferenceGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedReferenceGeometry.lean index 7f5e24a939..a49d4b0816 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedReferenceGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedReferenceGeometry.lean @@ -26,7 +26,7 @@ fields below come from these primitive identities; no equality of output physical fields or native regularity is assumed. -/ -@[expose] public section +public section noncomputable section @@ -219,7 +219,7 @@ They hold on the whole native coordinate space, before any smoothness claim or own-band/harmonic gate is applied. -/ -@[expose] public section +public section noncomputable section @@ -518,7 +518,7 @@ then proves smoothness and vanishing of all jets of the literal product, without assigning new values to the unmasked factor outside the band. -/ -@[expose] public section +public section noncomputable section @@ -781,7 +781,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedStageControls.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedStageControls.lean index ed48461c4c..93c31087ad 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedStageControls.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedStageControls.lean @@ -19,7 +19,7 @@ native factors belong to the cutoff, so no time cutoff is declared frozen along the fast field. -/ -@[expose] public section +public section noncomputable section @@ -50,24 +50,24 @@ abbrev SignedLabel (B N0 : ℕ) := ActualPrimary.Label B N0 × Fin 2 variable {B N0 : ℕ} /-- Directions, given by `PrimaryResidualClass.directions (ActualPrimary.commonContext B)`. -/ -noncomputable def directions (B : ℕ) := PrimaryResidualClass.directions +@[expose] noncomputable def directions (B : ℕ) := PrimaryResidualClass.directions (ActualPrimary.commonContext B) /-- Native point as an element of `Native`. -/ -noncomputable def nativePoint (l : SignedLabel B N0) (n : ℕ) (k : Frequency) +@[expose] noncomputable def nativePoint (l : SignedLabel B N0) (n : ℕ) (k : Frequency) (x : FullPoint) : Native := (ActualPrimary.nativeSlow l.1 (ActualPrimary.toAbsolute n x.1), (ActualPrimary.geometry l.2 l.1).coordinates k (ActualPrimary.toAbsolute n x.1).2) /-- Coefficient scale, constructed using `PhysicalSignedWave.coefficientScale`. -/ -noncomputable def coefficientScale (l : SignedLabel B N0) (n : ℕ) : ℝ := +@[expose] noncomputable def coefficientScale (l : SignedLabel B N0) (n : ℕ) : ℝ := PhysicalSignedWave.coefficientScale (ChartScales.epsilon ActualPrimary.h n) (ChartScales.epsilon ActualPrimary.h (BaseChartJets.cellBand l.1)) (PhysicalParticularWave.velocityWeight ActualPrimary.h (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.1))) /-- Normal scale, constructed using `PhysicalParticularWave.normalWeight`. -/ -noncomputable def normalScale (l : SignedLabel B N0) (n : ℕ) : ℝ := +@[expose] noncomputable def normalScale (l : SignedLabel B N0) (n : ℕ) : ℝ := PhysicalParticularWave.normalWeight (ChartScales.Q n) (ChartScales.Q (BaseChartJets.cellBand l.1)) (ChartScales.carrier ActualPrimary.h n) (ChartScales.carrier ActualPrimary.h (BaseChartJets.cellBand l.1)) @@ -79,23 +79,23 @@ noncomputable def clockScale (l : SignedLabel B N0) (n : ℕ) : ℝ := (ChartScales.Q (BaseChartJets.cellBand l.1)) /-- Matrix, given by `ActualPrimary.covariance B N0 l.1 (nativePoint l n k x).1`. -/ -noncomputable def matrix (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def matrix (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : SignedWaveUpdate.Mat2 := ActualPrimary.covariance B N0 l.1 (nativePoint l n k x).1 /-- Target, given by `coefficientScale l n ^ 2 • (fun q => PrimaryTargetBounds.actualTarget ActualPrimary.modulation (nativePoint l n k x).1 q)`. -/ -noncomputable def target (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def target (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : SignedWaveUpdate.Vec2 := coefficientScale l n ^ 2 • (fun q => PrimaryTargetBounds.actualTarget ActualPrimary.modulation (nativePoint l n k x).1 q) /-- Mask, given by `ActualPrimary.spatialMask l.1 (nativePoint l n k x).1`. -/ -noncomputable def mask (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def mask (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : ℝ := ActualPrimary.spatialMask l.1 (nativePoint l n k x).1 /-- Fundamental, constructed using `PrimaryPulseBounds.normalizedPulse`. -/ -noncomputable def fundamental (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def fundamental (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : Space := PrimaryPulseBounds.normalizedPulse ((ActualPrimary.phases B N0 l.2).frame l.1) ((ActualPrimary.phases B N0 l.2).lam l.1) ((ActualPrimary.phases B N0 l.2).u l.1) @@ -103,13 +103,13 @@ noncomputable def fundamental (l : SignedLabel B N0) (k : Frequency) (n : ℕ) x)) /-- Normal motion as an element of `Space`. -/ -noncomputable def normalMotion (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def normalMotion (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : Space := (normalScale l n * clockScale l n) • (ActualPrimary.phases B N0 l.2).phase.velocity l.1 (ActualPrimary.phasePoint l.1 (nativePoint l n k x)) /-- Action, constructed using `clockScale`. -/ -noncomputable def action (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def action (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : Space →L[ℝ] Space := clockScale l n • PrimaryCopyBridge.baseOperator ((ActualPrimary.phases B N0 l.2).phase.F l.1 (nativePoint l n k x).1) @@ -117,13 +117,14 @@ noncomputable def action (l : SignedLabel B N0) (k : Frequency) (n : ℕ) k x))) /-- Cutoff, constructed using `PartitionedCovariance.cutoff`. -/ -noncomputable def cutoff (l : SignedLabel B N0) (k : Frequency) (n : ℕ) +@[expose] noncomputable def cutoff (l : SignedLabel B N0) (k : Frequency) (n : ℕ) (x : FullPoint) : ℝ := PartitionedCovariance.cutoff ActualPrimary.slots.radius (nativePoint l n k x).2.1 * ActualPrimary.gaussian l.1 (nativePoint l n k x) /-- The literal raw data accepted by the correction stage. The same selected primary frame is used for the matrix, unit pulse, and pressure. -/ +@[expose] noncomputable def parameters (l : SignedLabel B N0) : CorrectionStep.PeriodizedSignedParameters Point Frequency where base := ActualPrimary.chartCoefficients l.2 l.1 @@ -554,6 +555,7 @@ theorem nativePoint_smooth (l : SignedLabel B N0) (n : ℕ) (k : Frequency) : ContDiff ℝ ∞ (nativePoint l n k) := ActualPrimaryDynamics.copyPoint_smooth l.2 l.1 n k /-- Native time, given by `(ActualPrimary.pulseCoordinates l.1 (nativePoint l n k x)).2`. -/ +@[expose] noncomputable def nativeTime (l : SignedLabel B N0) (n : ℕ) (k : Frequency) (x : FullPoint) : ℝ := (ActualPrimary.pulseCoordinates l.1 (nativePoint l n k x)).2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedUnmaskedBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedUnmaskedBounds.lean index 55090a7711..bc04e14499 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedUnmaskedBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedUnmaskedBounds.lean @@ -18,7 +18,7 @@ are unchanged. The spatial mask is replaced by its actual native grid factor. All estimates are on the original native control cells. -/ -@[expose] public section +public section noncomputable section @@ -331,7 +331,7 @@ theorem own_phaseCell_or_zero (request : ℕ → Full → SignedWaveUpdate.Vec2) /-- The band index is frozen only discretely, at the original label's own reference. This is not an extension of a fixed reference to all bands. -/ -noncomputable def ownField {E : Type} [Zero E] +@[expose] noncomputable def ownField {E : Type} [Zero E] (f : Label B N0 → Copy → ℕ → Full → E) (i : Label B N0 × Copy) (n : ℕ) (x : Full) : E := if n = reference i.1 then f i.1 i.2 n x else 0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedWaveData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedWaveData.lean index 3cdd87ae9a..397eaf198c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedWaveData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSignedWaveData.lean @@ -33,7 +33,7 @@ family. Bounds are uniform before selecting an outer label, a harmonic, a band, or a lattice copy. No physical derivative estimate is assumed. -/ -@[expose] public section +public section noncomputable section @@ -810,7 +810,7 @@ common lift has positive time exactly before terminal time, so all physical copy fields and their ambient jets agree there with the original fields. -/ -@[expose] public section +public section noncomputable section @@ -1038,7 +1038,7 @@ native time is an explicit premise; no support assertion is made for the totalized formulas outside that domain. -/ -@[expose] public section +public section noncomputable section @@ -1144,7 +1144,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1742,7 +1742,7 @@ positive time. This proves the physical closure-coverage condition without extending the profile functions across a native domain boundary. -/ -@[expose] public section +public section noncomputable section @@ -2030,7 +2030,7 @@ assembly. The source-domain statements concern the original, ungated amplitudes on positive lift time. -/ -@[expose] public section +public section noncomputable section @@ -2236,7 +2236,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSlowAxis.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSlowAxis.lean index e46f4b2e2c..67596c9c93 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSlowAxis.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualSlowAxis.lean @@ -35,7 +35,7 @@ The extension is the convergent vertical Taylor series of the genuine compatible parameter jets. Its Cauchy--Riemann identity follows by termwise differentiation. -/ -@[expose] public section +public section noncomputable section @@ -620,7 +620,7 @@ argument and using the fixed-contour holomorphic-family theorem proves joint real smoothness of the constructed extension. -/ -@[expose] public section +public section noncomputable section @@ -865,7 +865,7 @@ All continuations below are explicit integrals of the actual natural slopes. The complex neighborhood is obtained from compactness and real positivity. -/ -@[expose] public section +public section noncomputable section @@ -2207,7 +2207,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualStageEstimates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualStageEstimates.lean index e0c7d60195..f934496941 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualStageEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualStageEstimates.lean @@ -18,7 +18,7 @@ assembled into the finite-stage obligations of the mixed diagonal theorem. No estimate of the output physical residual is an input. -/ -@[expose] public section +public section noncomputable section @@ -291,7 +291,7 @@ end CycleInputs /-- The initialized background loss is fixed before the number of correction stages is chosen. -/ -noncomputable def backgroundLoss (waveAlpha waveShift : ℝ) : ℕ → ℝ := +@[expose] noncomputable def backgroundLoss (waveAlpha waveShift : ℝ) : ℕ → ℝ := MixedFiniteBackground.initialBackgroundLoss (InitializedPhysicalBackground.initialLoss h waveAlpha waveShift (1 - ChartScales.kappa) (9 / 10)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualWaveRegularityData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualWaveRegularityData.lean index e821b80f1a..33234f9138 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualWaveRegularityData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualWaveRegularityData.lean @@ -31,7 +31,7 @@ Native smoothness and genuine zero germs, rather than estimates on a smaller strip, supply the continuation away from the active phase patches. -/ -@[expose] public section +public section noncomputable section @@ -947,7 +947,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AlignedProfileSpectralCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AlignedProfileSpectralCone.lean index edac0c3815..b10cc4fd36 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AlignedProfileSpectralCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AlignedProfileSpectralCone.lean @@ -16,7 +16,7 @@ This module binds the generic profile and physical-shear identities to the same finite modulation, aligned coefficient family, and covariance target. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AllBandBaseJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AllBandBaseJets.lean index 497acdbe3c..e12e99cd2e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AllBandBaseJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AllBandBaseJets.lean @@ -17,7 +17,7 @@ extends the normalized bounds to every positive physical scale and removes the auxiliary restriction `Q * qhi ≤ 1` from the chart estimates. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AnnularEndpoint.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AnnularEndpoint.lean index c0e9f3f2ff..1777e7930b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AnnularEndpoint.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AnnularEndpoint.lean @@ -22,7 +22,7 @@ the spatial curl, and requires neither a lower support radius nor estimates on the individual summands. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ abbrev Space := ProblemStatement.Space abbrev SpaceTime := ProblemStatement.SpaceTime /-- The actual Cartesian distance to the symmetry axis. -/ -noncomputable def radius (w : SpaceTime) : ℝ := +@[expose] noncomputable def radius (w : SpaceTime) : ℝ := PolarCharts.radius (PhysicalGraphBounds.radialProjection w) theorem radius_continuous : Continuous radius := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AssembledSlowBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AssembledSlowBase.lean index 8680a9317c..f568b2a457 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AssembledSlowBase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AssembledSlowBase.lean @@ -22,7 +22,7 @@ All coefficient extensions in this module are constructed from the coherent coefficient or derivative order is selected. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean index 399c11d873..0a6fa41e48 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean @@ -35,7 +35,7 @@ the mixed derivative estimate is proved after the radial inverse; no boundedness of either differentiation operator on its own is assumed. -/ -@[expose] public section +public section namespace NavierStokes.AxisWeightEstimates @@ -45,12 +45,12 @@ open Finset Finset.Nat noncomputable section /-- The exact coefficient weight printed in the candidate manuscript. -/ -def weight (ε : ℝ) (n m : ℕ) : ℝ := +@[expose] def weight (ε : ℝ) (n m : ℕ) : ℝ := (1 / 20 : ℝ) ^ n * (ε⁻¹) ^ m * (m.factorial : ℝ) * ((n + m).choose m : ℝ) / (((n : ℝ) + 1) ^ 2 * ((m : ℝ) + 1) ^ 2) /-- The analytic part of the weight, before the two square-decay factors. -/ -def coreWeight (ε : ℝ) (n m : ℕ) : ℝ := +@[expose] def coreWeight (ε : ℝ) (n m : ℕ) : ℝ := (1 / 20 : ℝ) ^ n * (ε⁻¹) ^ m * (m.factorial : ℝ) * ((n + m).choose m : ℝ) /-- Square decay, given by `1 / ((n : ℝ) + 1) ^ 2`. -/ @@ -355,7 +355,7 @@ theorem productWeightSum_le {ε : ℝ} (hε : 0 < ε) (n m : ℕ) : _ = _ := by rw [weight_eq_core_decay]; ring /-- Actual radial convolution with the parameter Leibniz coefficients. -/ -def jetProduct (f g : ℕ → ℕ → ℝ) (n m : ℕ) : ℝ := +@[expose] def jetProduct (f g : ℕ → ℕ → ℝ) (n m : ℕ) : ℝ := ∑ ij ∈ antidiagonal n, ∑ kl ∈ antidiagonal m, (m.choose kl.1 : ℝ) * f ij.1 kl.1 * g ij.2 kl.2 @@ -407,7 +407,7 @@ theorem jetProduct_bound {ε F G : ℝ} (hε : 0 < ε) (hF : 0 ≤ F) (hG : 0 _ = _ := by ring /-- Radial divisor, given by `((n : ℝ) + 1) * ((n : ℝ) + r)`. -/ -def radialDivisor (r n : ℕ) : ℝ := ((n : ℝ) + 1) * ((n : ℝ) + r) +@[expose] def radialDivisor (r n : ℕ) : ℝ := ((n : ℝ) + 1) * ((n : ℝ) + r) theorem radialDivisor_pos {r : ℕ} (hr : 1 ≤ r) (n : ℕ) : 0 < radialDivisor r n := by have hr' : (1 : ℝ) ≤ r := by exact_mod_cast hr @@ -424,7 +424,7 @@ theorem mixed_factors_le_divisor {r n i j : ℕ} (hr : 1 ≤ r) (hij : i + j = n /-- Shifted product weight sum, given by `∑ ij ∈ antidiagonal n, ∑ kl ∈ antidiagonal m, (m.choose kl.1 : ℝ) * weight ε (ij.1 + 1) kl.1 * weight ε ij.2 kl.2`. -/ -def shiftedProductWeightSum (ε : ℝ) (n m : ℕ) : ℝ := +@[expose] def shiftedProductWeightSum (ε : ℝ) (n m : ℕ) : ℝ := ∑ ij ∈ antidiagonal n, ∑ kl ∈ antidiagonal m, (m.choose kl.1 : ℝ) * weight ε (ij.1 + 1) kl.1 * weight ε ij.2 kl.2 @@ -540,7 +540,7 @@ def primitiveJet (f : ℕ → ℕ → ℝ) : ℕ → ℕ → ℝ | n + 1, m => f n m / ((n : ℝ) + 1) /-- Coefficients of the regular zero-datum inverse of `Y f'' + r f'`. -/ -def regularInverseJet (r : ℕ) (f : ℕ → ℕ → ℝ) : ℕ → ℕ → ℝ +@[expose] def regularInverseJet (r : ℕ) (f : ℕ → ℕ → ℝ) : ℕ → ℕ → ℝ | 0, _ => 0 | n + 1, m => f n m / radialDivisor r n @@ -641,7 +641,7 @@ end end -@[expose] public section +public section noncomputable section @@ -659,7 +659,7 @@ structure Window where nondegenerate : left < right /-- Interval, given by `Icc I.left I.right`. -/ -def Window.interval (I : Window) : Set ℝ := Icc I.left I.right +@[expose] def Window.interval (I : Window) : Set ℝ := Icc I.left I.right /-- The continuous clamping map is only an extension device. Smoothness is proved on the original closed interval, including its one-sided endpoint jets. -/ @@ -763,7 +763,7 @@ instance coefficientSpace_complete (I : Window) (w : ℕ → ℕ → ℝ) : (isClosed_compatible I w).completeSpace_coe /-- A coefficient is the zeroth actual jet. -/ -def coefficient (I : Window) (w : ℕ → ℕ → ℝ) (A : CoefficientSpace I w) (n : ℕ) : ℝ → ℝ := +@[expose] def coefficient (I : Window) (w : ℕ → ℕ → ℝ) (A : CoefficientSpace I w) (n : ℕ) : ℝ → ℝ := jet I w A.1 n 0 /-- FTC compatibility identifies the derivative within the closed interval; diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisEvaluation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisEvaluation.lean index ea874524c0..9f0ad5e28d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisEvaluation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisEvaluation.lean @@ -20,7 +20,7 @@ Its mixed derivative series are proved convergent before their derivatives and smoothness are established. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ open NavierStokes.AxisCoefficientSpace NavierStokes.AxisWeightEstimates namespace NavierStokes.AxisEvaluation /-- Polynomial jet, given by `(n.descFactorial k : ℝ) * Y ^ (n - k)`. -/ -def polynomialJet (n k : ℕ) (Y : ℝ) : ℝ := +@[expose] def polynomialJet (n k : ℕ) (Y : ℝ) : ℝ := (n.descFactorial k : ℝ) * Y ^ (n - k) theorem polynomialJet_hasDerivAt (n k : ℕ) (Y : ℝ) : @@ -46,15 +46,15 @@ theorem polynomialJet_hasDerivAt (n k : ℕ) (Y : ℝ) : ring /-- Term, given by `polynomialJet n k p.1 * jet I (weight ε) A.1 n m p.2`. -/ -def term (I : Window) (ε : ℝ) (A : AxisSpace I ε) (k m n : ℕ) (p : ℝ × ℝ) : ℝ := +@[expose] def term (I : Window) (ε : ℝ) (A : AxisSpace I ε) (k m n : ℕ) (p : ℝ × ℝ) : ℝ := polynomialJet n k p.1 * jet I (weight ε) A.1 n m p.2 /-- Mixed series, given by `∑' n : ℕ, term I ε A k m n p`. -/ -def mixedSeries (I : Window) (ε : ℝ) (A : AxisSpace I ε) (k m : ℕ) (p : ℝ × ℝ) : ℝ := +@[expose] def mixedSeries (I : Window) (ε : ℝ) (A : AxisSpace I ε) (k m : ℕ) (p : ℝ × ℝ) : ℝ := ∑' n : ℕ, term I ε A k m n p /-- Profile, given by `∑' n : ℕ, p.1 ^ n * coefficient I (weight ε) A n p.2`. -/ -def profile (I : Window) (ε : ℝ) (A : AxisSpace I ε) (p : ℝ × ℝ) : ℝ := +@[expose] def profile (I : Window) (ε : ℝ) (A : AxisSpace I ε) (p : ℝ × ℝ) : ℝ := ∑' n : ℕ, p.1 ^ n * coefficient I (weight ε) A n p.2 theorem mixedSeries_zero (I : Window) (ε : ℝ) (A : AxisSpace I ε) : @@ -163,7 +163,7 @@ theorem mixedSeries_uniform (I : Window) {ε R : ℝ} (hε : 0 < ε) (hR20 : R < (hp.trans (le_max_right 1 R))) /-- Strip, given by `Ioo (-R) R ×ˢ Ioo I.left I.right`. -/ -def strip (I : Window) (R : ℝ) : Set (ℝ × ℝ) := +@[expose] def strip (I : Window) (R : ℝ) : Set (ℝ × ℝ) := Ioo (-R) R ×ˢ Ioo I.left I.right theorem strip_isOpen (I : Window) (R : ℝ) : IsOpen (strip I R) := @@ -435,7 +435,7 @@ def evaluationCLM (I : Window) {ε R : ℝ} (hε : 0 < ε) @[simp] theorem evaluationCLM_apply (I : Window) {ε R : ℝ} (hε : 0 < ε) (hR : 1 ≤ R) (hR20 : R < 20) (k m : ℕ) (p : ℝ × ℝ) (hp : |p.1| ≤ R) (A : AxisSpace I ε) : - evaluationCLM I hε hR hR20 k m p hp A = mixedSeries I ε A k m p := rfl + evaluationCLM I hε hR hR20 k m p hp A = mixedSeries I ε A k m p := by rfl /-- Norm convergence in the coefficient space controls every evaluated jet uniformly throughout a smaller radial interval. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisPreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisPreservation.lean index 868d4b4f93..a6e8d186c3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisPreservation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisPreservation.lean @@ -18,7 +18,7 @@ therefore preserves the zeroth potential's curl. No uniform radius in the stage number and no estimate on the final velocity are assumed. -/ -@[expose] public section +public section namespace NavierStokes.AxisPreservation diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisReference.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisReference.lean index 3c9e75c3c4..db0717ecba 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisReference.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisReference.lean @@ -40,7 +40,7 @@ establish convergence of a formal power series, the nonlinear remainder estimates, the contraction argument, or the full profile's cone margin. -/ -@[expose] public section +public section namespace NavierStokes.AxisProfile @@ -57,7 +57,7 @@ def radialInverseCoeff (m : ℕ) (f : ℕ → ℝ) : ℕ → ℝ | n + 1 => f n / (((n : ℝ) + 1) * ((n : ℝ) + m)) @[simp] theorem radialInverseCoeff_zero (m : ℕ) (f : ℕ → ℝ) : - radialInverseCoeff m f 0 = 0 := rfl + radialInverseCoeff m f 0 = 0 := by rfl /-- For positive `m`, the stated shift really inverts the formal radial operator. No assertion about convergence is implicit in this theorem. -/ @@ -206,7 +206,7 @@ end end -@[expose] public section +public section noncomputable section @@ -597,7 +597,7 @@ end end -@[expose] public section +public section noncomputable section @@ -715,8 +715,9 @@ theorem referenceCoefficients_profile_eq_series (I : Window) {ε : ℝ} (hε : 0 (hd : CompatibleData I ε χ d) {η : ℝ} (hη : η ∈ I.interval) (Y : ℝ) : AxisEvaluation.profile I ε (referenceCoefficients I hε χ d).1 (Y, η) = AxisSeries.profile (inputValue I ε χ η) Y := by - exact reference_profile_eq_series I hε χ d.one hd.chi_radial hd.one_radial - hη (hd.one_value η hη) Y + simpa only [referenceCoefficients_fst, inputValue] using + reference_profile_eq_series I hε χ d.one hd.chi_radial hd.one_radial + hη (hd.one_value η hη) Y theorem referenceCoefficients_deriv_Y_eq (I : Window) {ε : ℝ} (hε : 0 < ε) (χ : AxisSpace I ε) (d : AxisContraction.AxisData (AxisSpace I ε)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricFields.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricFields.lean index a93448abb4..d8fdb6087f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricFields.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricFields.lean @@ -17,7 +17,7 @@ Profiles use coordinates `(t,s,z)`, where `s=(x₀²+x₁²)/2`. The velocity is actual Euclidean curl. No division by the radius is used, including at the axis. -/ -@[expose] public section +public section noncomputable section @@ -33,29 +33,30 @@ abbrev ProfilePoint := ℝ × (ℝ × ℝ) abbrev Profile := ProfilePoint → ℝ /-- Projection, given by `EuclideanSpace.proj i`. -/ -def projection (i : Fin 3) : Space →L[ℝ] ℝ := EuclideanSpace.proj i +@[expose] def projection (i : Fin 3) : Space →L[ℝ] ℝ := EuclideanSpace.proj i @[simp] theorem projection_apply (i : Fin 3) (x : Space) : projection i x = x i := rfl /-- Radial energy, given by `(x 0 ^ 2 + x 1 ^ 2) / 2`. -/ -def radialEnergy (x : Space) : ℝ := (x 0 ^ 2 + x 1 ^ 2) / 2 +@[expose] def radialEnergy (x : Space) : ℝ := (x 0 ^ 2 + x 1 ^ 2) / 2 /-- Profile point, given by `(t, (radialEnergy x, x 2))`. -/ -def profilePoint (t : ℝ) (x : Space) : ProfilePoint := (t, (radialEnergy x, x 2)) +@[expose] def profilePoint (t : ℝ) (x : Space) : ProfilePoint := (t, (radialEnergy x, x 2)) /-- Partial S, given by `fderiv ℝ F p (0, (1, 0))`. -/ -def partialS (F : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ F p (0, (1, 0)) +@[expose] def partialS (F : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ F p (0, (1, 0)) /-- Partial Z, given by `fderiv ℝ F p (0, (0, 1))`. -/ -def partialZ (F : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ F p (0, (0, 1)) +@[expose] def partialZ (F : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ F p (0, (0, 1)) /-- Potential as an element of `VelocityField`. -/ -def potential (H K : Profile) : VelocityField := fun w => +@[expose] def potential (H K : Profile) : VelocityField := fun w => ((-(1 / 2) : ℝ) * (w.2 1 * H (profilePoint w.1 w.2))) • coordinateVector 0 + ((1 / 2 : ℝ) * (w.2 0 * H (profilePoint w.1 w.2))) • coordinateVector 1 + K (profilePoint w.1 w.2) • coordinateVector 2 /-- Velocity, given by `SpatialCurl.spatialCurl (potential H K)`. -/ -def velocity (H K : Profile) : VelocityField := SpatialCurl.spatialCurl (potential H K) +@[expose] def velocity (H K : Profile) : VelocityField := + SpatialCurl.spatialCurl (potential H K) theorem radialEnergy_nonneg (x : Space) : 0 ≤ radialEnergy x := by exact div_nonneg (add_nonneg (sq_nonneg _) (sq_nonneg _)) (by norm_num) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricResidual.lean index 85c09e03bc..e5e2a69050 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisymmetricResidual.lean @@ -17,7 +17,7 @@ Every derivative below is an ordinary Fréchet derivative. The coordinate is `s=(x₀²+x₁²)/2`, so none of the formulas divide by the cylindrical radius. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ open ProblemStatement AxisymmetricFields open scoped BigOperators ContDiff /-- Pack, given by `a • coordinateVector 0 + b • coordinateVector 1 + c • coordinateVector 2`. -/ -def pack (a b c : ℝ) : Space := +@[expose] def pack (a b c : ℝ) : Space := a • coordinateVector 0 + b • coordinateVector 1 + c • coordinateVector 2 @[simp] theorem pack_zero (a b c : ℝ) : pack a b c 0 = a := by @@ -50,7 +50,7 @@ def pack (a b c : ℝ) : Space := /-- Pack derivative, given by `a.smulRight (coordinateVector 0) + b.smulRight (coordinateVector 1) + c.smulRight (coordinateVector 2)`. -/ -def packDerivative {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] def packDerivative {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (a b c : E →L[ℝ] ℝ) : E →L[ℝ] Space := a.smulRight (coordinateVector 0) + b.smulRight (coordinateVector 1) + c.smulRight (coordinateVector 2) @@ -73,16 +73,16 @@ theorem fderiv_pack_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] rfl /-- Direction, given by `fderiv ℝ g x (coordinateVector i)`. -/ -def direction (g : Space → ℝ) (i : Fin 3) (x : Space) : ℝ := +@[expose] def direction (g : Space → ℝ) (i : Fin 3) (x : Space) : ℝ := fderiv ℝ g x (coordinateVector i) /-- Scalar laplacian, given by `∑ i : Fin 3, direction (fun y => direction g i y) i x`. -/ -def scalarLaplacian (g : Space → ℝ) (x : Space) : ℝ := +@[expose] def scalarLaplacian (g : Space → ℝ) (x : Space) : ℝ := ∑ i : Fin 3, direction (fun y => direction g i y) i x /-- Vector laplacian, given by `∑ i : Fin 3, fderiv ℝ (fun y => fderiv ℝ g y (coordinateVector i)) x (coordinateVector i)`. -/ -def vectorLaplacian (g : Space → Space) (x : Space) : Space := +@[expose] def vectorLaplacian (g : Space → Space) (x : Space) : Space := ∑ i : Fin 3, fderiv ℝ (fun y => fderiv ℝ g y (coordinateVector i)) x (coordinateVector i) theorem contDiff_direction {g : Space → ℝ} {m n : WithTop ℕ∞} @@ -185,7 +185,7 @@ theorem vectorLaplacian_pack {a b c : Space → ℝ} simp only [pack, direction, Finset.sum_add_distrib, ← Finset.sum_smul, scalarLaplacian] /-- Lift, given by `G (profilePoint t x)`. -/ -def lift (G : Profile) (t : ℝ) (x : Space) : ℝ := G (profilePoint t x) +@[expose] def lift (G : Profile) (t : ℝ) (x : Space) : ℝ := G (profilePoint t x) /-- Joint differentiability is needed only along the spatial slice being evaluated. -/ def SliceDifferentiable (G : Profile) (t : ℝ) : Prop := @@ -211,14 +211,15 @@ theorem contDiff_lift_slice {G : Profile} {t : ℝ} (hG : SliceC2 G t) : exact (hG x).comp x (contDiff_profilePoint_slice t).contDiffAt /-- Partial T, given by `fderiv ℝ G p (1, (0, 0))`. -/ -def partialT (G : Profile) (p : ProfilePoint) : ℝ := fderiv ℝ G p (1, (0, 0)) +@[expose] def partialT (G : Profile) (p : ProfilePoint) : ℝ := + fderiv ℝ G p (1, (0, 0)) /-- Laplace scalar, given by `2 * p.2.1 * partialS (partialS G) p + 2 * partialS G p + partialZ (partialZ G) p`. -/ -def laplaceScalar (G : Profile) (p : ProfilePoint) : ℝ := +@[expose] def laplaceScalar (G : Profile) (p : ProfilePoint) : ℝ := 2 * p.2.1 * partialS (partialS G) p + 2 * partialS G p + partialZ (partialZ G) p /-- Laplace weighted, given by `2 * p.2.1 * partialS (partialS G) p + 4 * partialS G p + partialZ (partialZ G) p`. -/ -def laplaceWeighted (G : Profile) (p : ProfilePoint) : ℝ := +@[expose] def laplaceWeighted (G : Profile) (p : ProfilePoint) : ℝ := 2 * p.2.1 * partialS (partialS G) p + 4 * partialS G p + partialZ (partialZ G) p theorem contDiff_lift {G : Profile} {n : WithTop ℕ∞} (hG : ContDiff ℝ n G) (t : ℝ) : @@ -302,20 +303,20 @@ theorem scalarLaplacian_weighted_one {G : Profile} {t : ℝ} (hG : SliceC2 G t) ring /-- Component X, given by `-(x 0 * lift B t x + x 1 * lift F t x)`. -/ -def componentX (B F : Profile) (t : ℝ) (x : Space) : ℝ := +@[expose] def componentX (B F : Profile) (t : ℝ) (x : Space) : ℝ := -(x 0 * lift B t x + x 1 * lift F t x) /-- Component Y, given by `x 0 * lift F t x - x 1 * lift B t x`. -/ -def componentY (B F : Profile) (t : ℝ) (x : Space) : ℝ := +@[expose] def componentY (B F : Profile) (t : ℝ) (x : Space) : ℝ := x 0 * lift F t x - x 1 * lift B t x /-- Convention: radial velocity `-r B`, angular velocity `r F`, axial velocity `U`. -/ -def velocity (B F U : Profile) : VelocityField := +@[expose] def velocity (B F U : Profile) : VelocityField := fun w => pack (componentX B F w.1 w.2) (componentY B F w.1 w.2) (lift U w.1 w.2) /-- Pressure, defined pointwise by `lift P w.1 w.2`. -/ -def pressure (P : Profile) : PressureField := fun w => lift P w.1 w.2 +@[expose] def pressure (P : Profile) : PressureField := fun w => lift P w.1 w.2 /-- Velocity jacobian, constructed using `packDerivative`. -/ -def velocityJacobian (B F U : Profile) (t : ℝ) (x : Space) : Space →L[ℝ] Space := +@[expose] def velocityJacobian (B F U : Profile) (t : ℝ) (x : Space) : Space →L[ℝ] Space := packDerivative (-(x 0 • profileDerivative B t x + lift B t x • projection 0 + (x 1 • profileDerivative F t x + lift F t x • projection 1))) @@ -336,14 +337,14 @@ theorem hasFDerivAt_velocity {B F U : Profile} {t : ℝ} /-- Advection radial, given by `(B p) ^ 2 - (F p) ^ 2 + 2 * p.2.1 * B p * partialS B p - U p * partialZ B p`. -/ -def advectionRadial (B F U : Profile) (p : ProfilePoint) : ℝ := +@[expose] def advectionRadial (B F U : Profile) (p : ProfilePoint) : ℝ := (B p) ^ 2 - (F p) ^ 2 + 2 * p.2.1 * B p * partialS B p - U p * partialZ B p /-- Advection angular, given by `2 * B p * F p + 2 * p.2.1 * B p * partialS F p - U p * partialZ F p`. -/ -def advectionAngular (B F U : Profile) (p : ProfilePoint) : ℝ := +@[expose] def advectionAngular (B F U : Profile) (p : ProfilePoint) : ℝ := 2 * B p * F p + 2 * p.2.1 * B p * partialS F p - U p * partialZ F p /-- Advection axial, given by `-2 * p.2.1 * B p * partialS U p + U p * partialZ U p`. -/ -def advectionAxial (B U : Profile) (p : ProfilePoint) : ℝ := +@[expose] def advectionAxial (B U : Profile) (p : ProfilePoint) : ℝ := -2 * p.2.1 * B p * partialS U p + U p * partialZ U p theorem advection_velocity {B F U : Profile} {t : ℝ} @@ -432,14 +433,14 @@ theorem pressureGradient_pressure {P : Profile} {t : ℝ} one_mul, pack] /-- Time profile jacobian, given by `(ContinuousLinearMap.id ℝ ℝ).prod (0 : ℝ →L[ℝ] ℝ × ℝ)`. -/ -def timeProfileJacobian : ℝ →L[ℝ] ProfilePoint := +@[expose] def timeProfileJacobian : ℝ →L[ℝ] ProfilePoint := (ContinuousLinearMap.id ℝ ℝ).prod (0 : ℝ →L[ℝ] ℝ × ℝ) /-- Time profile derivative, given by `(fderiv ℝ G p).comp timeProfileJacobian`. -/ -def timeProfileDerivative (G : Profile) (p : ProfilePoint) : ℝ →L[ℝ] ℝ := +@[expose] def timeProfileDerivative (G : Profile) (p : ProfilePoint) : ℝ →L[ℝ] ℝ := (fderiv ℝ G p).comp timeProfileJacobian @[simp] theorem timeProfileDerivative_one (G : Profile) (p : ProfilePoint) : - timeProfileDerivative G p 1 = partialT G p := rfl + timeProfileDerivative G p 1 = partialT G p := by rfl theorem hasFDerivAt_time_lift {G : Profile} {t : ℝ} (hG : SliceDifferentiable G t) (x : Space) : HasFDerivAt (fun s => lift G s x) (timeProfileDerivative G (profilePoint t x)) t := by @@ -472,14 +473,14 @@ theorem temporalDerivative_velocity {B F U : Profile} {t : ℝ} /-- Residual radial, given by `-partialT B p + advectionRadial B F U p + laplaceWeighted B p + partialS P p`. -/ -def residualRadial (B F U P : Profile) (p : ProfilePoint) : ℝ := +@[expose] def residualRadial (B F U P : Profile) (p : ProfilePoint) : ℝ := -partialT B p + advectionRadial B F U p + laplaceWeighted B p + partialS P p /-- Residual angular, given by `-partialT F p + advectionAngular B F U p + laplaceWeighted F p`. -/ -def residualAngular (B F U : Profile) (p : ProfilePoint) : ℝ := +@[expose] def residualAngular (B F U : Profile) (p : ProfilePoint) : ℝ := -partialT F p + advectionAngular B F U p + laplaceWeighted F p /-- Residual axial, given by `partialT U p + advectionAxial B U p - laplaceScalar U p + partialZ P p`. -/ -def residualAxial (B U P : Profile) (p : ProfilePoint) : ℝ := +@[expose] def residualAxial (B U P : Profile) (p : ProfilePoint) : ℝ := partialT U p + advectionAxial B U p - laplaceScalar U p + partialZ P p /-- Exact physical Navier--Stokes residual, at viscosity one, including radial, diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BandReindexedSignedMeanGain.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BandReindexedSignedMeanGain.lean index 9fb8abdf2e..61e3a10752 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BandReindexedSignedMeanGain.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BandReindexedSignedMeanGain.lean @@ -18,7 +18,7 @@ reindexing then gives the actual native cross identity. The mean-gain theorem is applied to the original family, with its original uniform constants. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseContextAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseContextAssembly.lean index f65088f895..61113d451f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseContextAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseContextAssembly.lean @@ -34,7 +34,7 @@ construction. The improved nonlinear bound uses the exact divergence of that curl, before projecting the literal residual into its finite harmonics. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ open scoped Topology ContDiff BigOperators ComplexConjugate variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- The context's literal graph directions lifted to the explicit angle. -/ -noncomputable def directions (c : CorrectionState.Context D) : +@[expose] noncomputable def directions (c : CorrectionState.Context D) : LinearWaveBounds.GraphDirections (D × ℝ) where radial := (c.operators.eR, 0) auxiliary := (c.operators.vR, 0) @@ -804,7 +804,7 @@ slot coordinate require polynomial bounds; the angular coordinate and the unstripped phase itself need no such bound. -/ -@[expose] public section +public section noncomputable section @@ -931,7 +931,7 @@ theorem differentiableAt_phase (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot (hi.snd.snd.mul ((hFl.const_mul p).add (hGl.const_mul pz))) /-- The algebraic expression after exact material cancellation. -/ -noncomputable def expression (ε p pz x0 v b G FR GR FT GT FZ GZ : ℝ) : ℝ := +@[expose] noncomputable def expression (ε p pz x0 v b G FR GR FT GT FZ GZ : ℝ) : ℝ := b * x0 - v * (b * (p * FR + pz * GR) - ε * (p * FT + pz * GT) + ε * G * (p * FZ + pz * GZ)) @@ -1109,7 +1109,7 @@ variable {U : PhaseJetBounds.Domain ℕ Slow} /-- Pulled phase, given by `PhaseCalculus.phase (P.phase.epsilon n) (P.phase.p n) (P.phase.pz n) (P.phase.x0 n) (P.phase.F n) (P.phase.G n) (χ n x)`. -/ -noncomputable def pulledPhase (P : PrimaryPulseBounds.PhaseConstruction U) +@[expose] noncomputable def pulledPhase (P : PrimaryPulseBounds.PhaseConstruction U) (χ : ℕ → E → Slot) (n : ℕ) (x : E) : ℝ := PhaseCalculus.phase (P.phase.epsilon n) (P.phase.p n) (P.phase.pz n) (P.phase.x0 n) (P.phase.F n) (P.phase.G n) (χ n x) @@ -1117,7 +1117,7 @@ noncomputable def pulledPhase (P : PrimaryPulseBounds.PhaseConstruction U) /-- Canonical raw geometry with arbitrary amplitude/pressure. Those two fields do not enter the material defect. The angular base field here is the frequency `F`, as required by `LinearWaveResidual`, not `R*F`. -/ -noncomputable def coefficients (P : PrimaryPulseBounds.PhaseConstruction U) +@[expose] noncomputable def coefficients (P : PrimaryPulseBounds.PhaseConstruction U) (b : ℕ → Slow → ℝ) (χ : ℕ → E → Slot) (amplitude : ℕ → E → HarmonicCalculus.ComplexVector) (pressure : ℕ → E → ℂ) (frequency : ℕ → ℝ) : WaveCoefficients E where @@ -1271,7 +1271,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1291,7 +1291,7 @@ abbrev Slow := PhaseCalculus.Slow noncomputable def commonIndex (h : ℝ) (n : ℕ) : ℕ := ChartScales.nativeIndex h n /-- Slow scale, given by `max 1 (ChartScales.S n)`. -/ -noncomputable def slowScale (n : ℕ) : ℝ := max 1 (ChartScales.S n) +@[expose] noncomputable def slowScale (n : ℕ) : ℝ := max 1 (ChartScales.S n) theorem one_le_slowScale (n : ℕ) : 1 ≤ slowScale n := le_max_left _ _ @@ -1326,7 +1326,7 @@ noncomputable def operators (h a b : ℝ) (hab : a < b) : MeanIncrementBounds.Op (operators h a b hab).radius = Prod.fst := rfl /-- The actual fixed `TZ -> ZT` permutation, discarding auxiliary variables. -/ -noncomputable def slowCoordinates : Point →L[ℝ] Slow where +@[expose] noncomputable def slowCoordinates : Point →L[ℝ] Slow where toFun x := (x.1, (x.2.1.2, x.2.1.1)) map_add' _ _ := rfl map_smul' _ _ := rfl @@ -1342,6 +1342,7 @@ theorem slowCoordinates_norm_le : ‖slowCoordinates‖ ≤ 1 := by exact max_le_max le_rfl ((max_comm _ _).le.trans (le_max_left _ _)) /-- Physical point, given by `BaseChartJets.bandPoint h (ChartScales.Q n) (slowCoordinates x)`. -/ +@[expose] noncomputable def physicalPoint (h : ℝ) (n : ℕ) (x : Point) : ProblemStatement.SpaceTime := BaseChartJets.bandPoint h (ChartScales.Q n) (slowCoordinates x) @@ -1561,7 +1562,7 @@ theorem nativeStrip_weight (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) exact PrimaryTargetBounds.movingWeight_eq W (nativeStrip_time W U hx) (nativeStrip_radius W U hx) /-- Insert zero auxiliary variables, retaining the explicit coordinate order. -/ -noncomputable def insertSlow : Slow →L[ℝ] Point where +@[expose] noncomputable def insertSlow : Slow →L[ℝ] Point where toFun p := (p.1, ((p.2.2, p.2.1), 0)) map_add' _ _ := by ext <;> simp map_smul' _ _ := by ext <;> simp @@ -1715,28 +1716,28 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} /-- Radial base, given by `ChartScales.Q n ^ CoordinateAlgebra.A F.data.h * FinalSlowBase.velocity H v upper B (physicalPoint F.data.h n x) 0`. -/ -noncomputable def radialBase (n : ℕ) (x : Point) : ℝ := +@[expose] noncomputable def radialBase (n : ℕ) (x : Point) : ℝ := ChartScales.Q n ^ CoordinateAlgebra.A F.data.h * FinalSlowBase.velocity H v upper B (physicalPoint F.data.h n x) 0 /-- Frequency base, constructed using `BaseChartJets.frequency`. -/ -noncomputable def frequencyBase (n : ℕ) (x : Point) : ℝ := +@[expose] noncomputable def frequencyBase (n : ℕ) (x : Point) : ℝ := BaseChartJets.frequency (FinalSlowBase.scales H v upper B) F.data.h W.axis.normalization (FinalSlowBase.coefficients H v) (ChartScales.Q n) (slowCoordinates x) /-- Axial base, constructed using `BaseChartJets.axial`. -/ -noncomputable def axialBase (n : ℕ) (x : Point) : ℝ := +@[expose] noncomputable def axialBase (n : ℕ) (x : Point) : ℝ := BaseChartJets.axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) (ChartScales.Q n) (slowCoordinates x) /-- Base, bundling `radial`, `angular`, `axial`. -/ -noncomputable def base : MeanIncrementBounds.Triple Point where +@[expose] noncomputable def base : MeanIncrementBounds.Triple Point where radial := radialBase H v upper B angular n x := x.1 * frequencyBase H v upper B n x axial := axialBase H v upper B /-- Raw stress as an element of `ℝ × ℝ`. -/ -noncomputable def rawStress (n : ℕ) (x : Point) : ℝ × ℝ := +@[expose] noncomputable def rawStress (n : ℕ) (x : Point) : ℝ × ℝ := let p := AxisymmetricFields.profilePoint (physicalPoint F.data.h n x).1 (physicalPoint F.data.h n x).2 ChartScales.Q n ^ (2 * CoordinateAlgebra.A F.data.h) • @@ -1759,7 +1760,7 @@ noncomputable def virtualStress (n : ℕ) (x : Point) : ℝ × ℝ := simp only [virtualStress, ite_eq_right (not_lt.mpr hR)] /-- Context, bundling `operators`, `base`, `virtualTheta`, `virtualAxial`. -/ -noncomputable def context (a b : ℝ) (hab : a < b) : CorrectionState.Context Point where +@[expose] noncomputable def context (a b : ℝ) (hab : a < b) : CorrectionState.Context Point where operators := operators F.data.h a b hab base := base H v upper B virtualTheta n x := (virtualStress H v upper B n x).1 @@ -2059,18 +2060,18 @@ theorem waveCoefficients_match (U : LocalSignedRequest.SlowRegion (2 * F.data.h) fin_cases i <;> rfl /-- Radial slow, constructed using `BaseRadialJets.radial`. -/ -noncomputable def radialSlow (n : ℕ) (p : Slow) : ℝ := +@[expose] noncomputable def radialSlow (n : ℕ) (p : Slow) : ℝ := BaseRadialJets.radial (FinalSlowBase.scales H v upper B) F.data.h W.axis.normalization (FinalSlowBase.coefficients H v) (ChartScales.Q n) p /-- Frequency slow, constructed using `BaseChartJets.frequency`. -/ -noncomputable def frequencySlow (n : ℕ) : Slow → ℝ := +@[expose] noncomputable def frequencySlow (n : ℕ) : Slow → ℝ := BaseChartJets.frequency (FinalSlowBase.scales H v upper B) F.data.h W.axis.normalization (FinalSlowBase.coefficients H v) (ChartScales.Q n) /-- Axial slow, given by `BaseChartJets.axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) (ChartScales.Q n)`. -/ -noncomputable def axialSlow (n : ℕ) : Slow → ℝ := +@[expose] noncomputable def axialSlow (n : ℕ) : Slow → ℝ := BaseChartJets.axial (FinalSlowBase.scales H v upper B) F.data.h (FinalSlowBase.coefficients H v) (ChartScales.Q n) @@ -2150,7 +2151,7 @@ theorem radialSlow_productClass (U : LocalSignedRequest.SlowRegion (2 * F.data.h /-- Native context, given by `context H v upper B (PrimaryTargetBounds.leftRadius W) (PrimaryTargetBounds.rightRadius W) (PrimaryTargetBounds.radii_ordered W)`. -/ -noncomputable def nativeContext : CorrectionState.Context Point := +@[expose] noncomputable def nativeContext : CorrectionState.Context Point := context H v upper B (PrimaryTargetBounds.leftRadius W) (PrimaryTargetBounds.rightRadius W) (PrimaryTargetBounds.radii_ordered W) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BasePhaseGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BasePhaseGeometry.lean index 7a44319bbb..eb50380c4a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BasePhaseGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BasePhaseGeometry.lean @@ -27,7 +27,7 @@ integrals, and the native chart scales produce the determinant and inverse weight bounds. Flat target weights are retained as factors. -/ -@[expose] public section +public section noncomputable section @@ -657,7 +657,7 @@ structure CoefficientControl (d : PrimaryODE.FrameData Q) (lam u L S C D : ℝ) /-- The literal `primaryCovariance` with the native chart prefactor and slot length; the integrands still use the actual constructed ODE solution. -/ -noncomputable def nativePrimaryCovariance +@[expose] noncomputable def nativePrimaryCovariance (vr vt : TorusInverse.Plane) (r0 h : ℝ) (d : Fin 2 → ℕ → PrimaryODE.FrameData Q) (lam u : Fin 2 → ℕ → ℝ) (n : ℕ) (p : Q) : Mat2 := @@ -784,7 +784,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1231,7 +1231,7 @@ noncomputable def coordinateConstant (M u : ℝ) : ℝ := (16 * M ^ 2 + 8 * (1 + 3 * M) * phaseConstant M / normalLower M u) /-- Eigen bound, given by `M * (2 + 3 * M)`. -/ -noncomputable def eigenBound (M : ℝ) : ℝ := M * (2 + 3 * M) +@[expose] noncomputable def eigenBound (M : ℝ) : ℝ := M * (2 + 3 * M) /-- Modal constant, given by `(1 + 2 * eigenBound M) * coordinateConstant M u + 3 * M ^ 3`. -/ noncomputable def modalConstant (M u : ℝ) : ℝ := @@ -1367,7 +1367,7 @@ variable {ι : Type*} {D : PhaseJetBounds.Domain ι Slow} {h r0 u M : ℝ} variable (a : FamilyData D h r0 u M) /-- Length, given by `ChartScales.slotLength r0 h (a.band i)`. -/ -noncomputable def length (i : ι) : ℝ := ChartScales.slotLength r0 h (a.band i) +@[expose] noncomputable def length (i : ι) : ℝ := ChartScales.slotLength r0 h (a.band i) /-- Viscosity, given by `ChartScales.epsilon h (a.band i) * (ChartScales.carrier h (a.band i) : ℝ) ^ 2`. -/ noncomputable def viscosity (i : ι) : ℝ := @@ -1390,12 +1390,12 @@ noncomputable def phase : PhaseJetBounds.PhaseFamily ι where F := a.F G := a.G /-- Frame, given by `a.phase.frameData a.lam a.c0 (fun _ => u) a.length a.viscosity i`. -/ -noncomputable def frame (i : ι) : PrimaryODE.FrameData Slow := +@[expose] noncomputable def frame (i : ι) : PrimaryODE.FrameData Slow := a.phase.frameData a.lam a.c0 (fun _ => u) a.length a.viscosity i /-- Slot, given by `Ioo (-(a.length i)) (2 * a.length i)`. -/ -noncomputable def slot (i : ι) : Set ℝ := Ioo (-(a.length i)) (2 * a.length i) +@[expose] noncomputable def slot (i : ι) : Set ℝ := Ioo (-(a.length i)) (2 * a.length i) /-- Slope, given by `PhaseEstimates.signedSlot (a.sigma i) u (a.length i) z.2`. -/ -noncomputable def slope (i : ι) (z : Slow × ℝ) : ℝ := +@[expose] noncomputable def slope (i : ι) (z : Slow × ℝ) : ℝ := PhaseEstimates.signedSlot (a.sigma i) u (a.length i) z.2 /-- The actual angular carrier is a nonzero integer, including the @@ -1884,7 +1884,7 @@ noncomputable def construction (hh : 0 ≤ h) (hr : 0 < r0) (hM : 1 ≤ M) theorem construction_frame (hh : 0 ≤ h) (hr : 0 < r0) (hM : 1 ≤ M) (hu : 0 < u) (huM : u ≤ M) (hL : 1 / (2 * r0) ≤ M) (hslot : 4 * r0 * ChartScales.Tg ≤ M) (hlarge : ∀ i, LargeBand h M u (a.band i)) : - (a.construction hh hr hM hu huM hL hslot hlarge).frame = a.frame := rfl + (a.construction hh hr hM hu huM hL hslot hlarge).frame = a.frame := by rfl /-- Every fixed derivative of the actual coefficient is controlled after the derived zeroth-order geometry is inserted. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRadialJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRadialJets.lean index e0d051f0a5..98d1ca0cd0 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRadialJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRadialJets.lean @@ -18,7 +18,7 @@ factor is `Q^h`. The exact stream formula includes the factor `1/2` in `AxisymmetricFields.velocity_zero`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRankPatch.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRankPatch.lean index 8785f0b082..7a82ec1ac1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRankPatch.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseRankPatch.lean @@ -18,7 +18,7 @@ have already been cut off there. The full summed tangential base therefore has the exact shaped power required by the five-row mean inverse. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseResidual.lean index 79c286ecb7..9f304ea6a3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseResidual.lean @@ -34,7 +34,7 @@ actual finite tails. The resulting coefficient functions contain no division by `X`; their finite indices and powers of `q` are unchanged. -/ -@[expose] public section +public section noncomputable section @@ -490,7 +490,7 @@ end end -@[expose] public section +public section noncomputable section @@ -691,7 +691,7 @@ open ProblemStatement /-- Cartesian monomial, given by `SimilarityProfile.pullback h b f (AxisymmetricFields.profilePoint z.1 z.2)`. -/ -noncomputable def cartesianMonomial (h b : ℝ) (f : Inner → ℝ) (z : SpaceTime) : ℝ := +@[expose] noncomputable def cartesianMonomial (h b : ℝ) (f : Inner → ℝ) (z : SpaceTime) : ℝ := SimilarityProfile.pullback h b f (AxisymmetricFields.profilePoint z.1 z.2) theorem cartesianMonomial_smoothAt {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) @@ -1095,12 +1095,12 @@ theorem potentialFromScalars_rate {l : Filter SpaceTime} {q : SpaceTime → ℝ} /-- Prefix stream, given by `physicalUncutPrefix h (-CoordinateAlgebra.A h) (bundleComponent C d 0) J`. -/ -noncomputable def prefixStream (J : ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := +@[expose] noncomputable def prefixStream (J : ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalUncutPrefix h (-CoordinateAlgebra.A h) (bundleComponent C d 0) J /-- Prefix swirl, given by `physicalUncutPrefix h (1 / 2 - CoordinateAlgebra.A h) (bundleComponent C d 1) J`. -/ -noncomputable def prefixSwirl (J : ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := +@[expose] noncomputable def prefixSwirl (J : ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalUncutPrefix h (1 / 2 - CoordinateAlgebra.A h) (bundleComponent C d 1) J /-- Prefix potential, given by `AxisymmetricFields.potential (prefixStream J h C d) (prefixSwirl @@ -1110,6 +1110,7 @@ noncomputable def prefixPotential (J : ℕ) (h C : ℝ) (d : Coefficients) : Vel /-- Summed potential, given by `AxisymmetricFields.potential (streamFactor a h C d) (swirlPotential a h C d)`. -/ +@[expose] noncomputable def summedPotential (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : VelocityField := AxisymmetricFields.potential (streamFactor a h C d) (swirlPotential a h C d) @@ -1526,7 +1527,7 @@ section StressOperator open ProblemStatement DiagonalResidual /-- The manuscript's tangential radial stress operator. -/ -noncomputable def stressForce (theta axial : Chart → ℝ) (z : SpaceTime) : Space := +@[expose] noncomputable def stressForce (theta axial : Chart → ℝ) (z : SpaceTime) : Space := SlowResidualMatching.tangentialStressForce theta axial z.1 z.2 /-- Lift profile, given by `F (AxisymmetricFields.profilePoint z.1 z.2)`. -/ @@ -1698,6 +1699,7 @@ noncomputable def baseStressForce (a : ℕ → ℕ) (h C : ℝ) (d : Coefficient /-- Prefix stress force, given by `stressForce (prefixStressTheta J h C d) (prefixStressAxial J h C d)`. -/ +@[expose] noncomputable def prefixStressForce (J : ℕ) (h C : ℝ) (d : Coefficients) : VelocityField := stressForce (prefixStressTheta J h C d) (prefixStressAxial J h C d) @@ -1825,7 +1827,7 @@ noncomputable def radialVector (z : SpaceTime) : Space := z.2 0 • coordinateVector 0 + z.2 1 • coordinateVector 1 /-- Angular vector, given by `-z.2 1 • coordinateVector 0 + z.2 0 • coordinateVector 1`. -/ -noncomputable def angularVector (z : SpaceTime) : Space := +@[expose] noncomputable def angularVector (z : SpaceTime) : Space := -z.2 1 • coordinateVector 0 + z.2 0 • coordinateVector 1 theorem radialVector_smooth : ContDiff ℝ ∞ radialVector := @@ -2593,14 +2595,14 @@ noncomputable def swapInner : Inner ≃ₗᵢ[ℝ] Inner where norm_map' := by intro w; exact max_comm _ _ /-- Active window, given by `Ioo (Real.exp a) (Real.exp b) ×ˢ Icc (-1) 1`. -/ -noncomputable def activeWindow (a b : ℝ) : Set Inner := +@[expose] noncomputable def activeWindow (a b : ℝ) : Set Inner := Ioo (Real.exp a) (Real.exp b) ×ˢ Icc (-1) 1 /-- Active zeta, given by `radialWeight c a b w.1`. -/ -noncomputable def activeZeta (c a b : ℝ) (w : Inner) : ℝ := radialWeight c a b w.1 +@[expose] noncomputable def activeZeta (c a b : ℝ) (w : Inner) : ℝ := radialWeight c a b w.1 /-- Active delta, given by `edgeDistance a b (Real.log w.1)`. -/ -noncomputable def activeDelta (a b : ℝ) (w : Inner) : ℝ := edgeDistance a b (Real.log w.1) +@[expose] noncomputable def activeDelta (a b : ℝ) (w : Inner) : ℝ := edgeDistance a b (Real.log w.1) theorem activeZeta_smooth {c : ℝ} (hc : 0 < c) (a b : ℝ) : ContDiff ℝ ∞ (activeZeta c a b) := (radialWeight_smooth hc a b).comp contDiff_fst diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseStressClasses.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseStressClasses.lean index 6895b0dae4..195597a927 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BaseStressClasses.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BaseStressClasses.lean @@ -18,7 +18,7 @@ of the reciprocal edge distance are enlarged. All derivatives are actual Fréchet derivatives, and every estimate is uniform over the dyadic bands. -/ -@[expose] public section +public section noncomputable section @@ -165,7 +165,7 @@ section NativeGeometry variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- The exact normalized coordinates in the mean-variable order. -/ -noncomputable def coordinates (x : Point) : Chart := +@[expose] noncomputable def coordinates (x : Point) : Chart := BaseChartJets.normalizedCoordinates F.data.h (BaseContextAssembly.slowCoordinates x) theorem coordinates_unweighted (U : LocalSignedRequest.SlowRegion (2 * F.data.h)) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BlowupImplication.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BlowupImplication.lean index b415a8a2cc..d4358ec8ad 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BlowupImplication.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BlowupImplication.lean @@ -19,7 +19,7 @@ The resulting field cannot be bounded near, or continuously extended to, the endpoint. No existence theorem for the manuscript's profiles is assumed here. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BorelExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BorelExtension.lean index 689f682e43..56e317d4fb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BorelExtension.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BorelExtension.lean @@ -20,7 +20,7 @@ integer cutoff scales and sum actual cutoff monomials. All derivative bounds, convergence, smoothness, support, and prescribed derivatives at zero are proved. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := by exact_mod_cast (le_top : (n : ℕ∞) ≤ ⊤) /-- Monomial, given by `(s ^ j / (j.factorial : ℝ)) • v`. -/ -def monomial (j : ℕ) (v : E) (s : ℝ) : E := (s ^ j / (j.factorial : ℝ)) • v +@[expose] def monomial (j : ℕ) (v : E) (s : ℝ) : E := (s ^ j / (j.factorial : ℝ)) • v theorem monomial_contDiff (j : ℕ) (v : E) : ContDiff ℝ ∞ (monomial j v) := by exact ((contDiff_id.pow j).div_const _).smul contDiff_const @@ -88,7 +88,7 @@ theorem iteratedDeriv_monomial_zero (n j : ℕ) (v : E) : simp /-- The actual summand, with no smooth extension supplied as an input. -/ -def term (b : ℝ) (j : ℕ) (v : E) (s : ℝ) : E := +@[expose] def term (b : ℝ) (j : ℕ) (v : E) (s : ℝ) : E := SmoothCutoffs.cutoff (b * s) • monomial j v s /-- Template, given by `SmoothCutoffs.cutoff s • monomial j v s`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/BoundaryAxisJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/BoundaryAxisJets.lean index 32cb426b71..ce995c3bd9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/BoundaryAxisJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/BoundaryAxisJets.lean @@ -21,7 +21,7 @@ on the signed radial variable. They are genuine right derivatives at the axis and genuine ordinary derivatives at positive squared radius. -/ -@[expose] public section +public section noncomputable section @@ -34,11 +34,11 @@ namespace NavierStokes.BoundaryAxisJets variable {E P : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- Radial jet, given by `EvenSmoothDescent.radialIterate (fun s => F (s, z)) k r`. -/ -noncomputable def radialJet (F : ℝ × P → E) (k : ℕ) (r : ℝ) (z : P) : E := +@[expose] noncomputable def radialJet (F : ℝ × P → E) (k : ℕ) (r : ℝ) (z : P) : E := EvenSmoothDescent.radialIterate (fun s => F (s, z)) k r /-- Axis jet, given by `radialJet F k (Real.sqrt p.1) p.2`. -/ -noncomputable def axisJet (F : ℝ × P → E) (k : ℕ) (p : ℝ × P) : E := +@[expose] noncomputable def axisJet (F : ℝ × P → E) (k : ℕ) (p : ℝ × P) : E := radialJet F k (Real.sqrt p.1) p.2 omit [CompleteSpace E] in @@ -531,7 +531,7 @@ theorem axisJet_pullback_holomorphic_local {R : ℝ} (hR : 0 < R) {U : Set ℂ} /-! ## Actual mixed parameter jets -/ /-- Complex partial, given by `deriv (fun z => F (p.1, z)) p.2`. -/ -noncomputable def complexPartial (F : ℝ × ℂ → B) (p : ℝ × ℂ) : B := +@[expose] noncomputable def complexPartial (F : ℝ × ℂ → B) (p : ℝ × ℂ) : B := deriv (fun z => F (p.1, z)) p.2 /-- Complex jet, given by `iteratedDeriv m (fun z => F (p.1, z)) p.2`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CandidateFromLimits.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CandidateFromLimits.lean index 314a8d1b21..4e20c04ae9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CandidateFromLimits.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CandidateFromLimits.lean @@ -35,7 +35,7 @@ The actual residual is smooth and periodic on the whole open past and retains the original residual's terminal germ and all of its terminal derivative data. -/ -@[expose] public section +public section noncomputable section @@ -367,7 +367,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CartesianCopySource.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CartesianCopySource.lean index 729386eb56..d54fa639b4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CartesianCopySource.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CartesianCopySource.lean @@ -16,7 +16,7 @@ the lift. Their derivatives are bounded on a fixed annulus, and the original flat weight is pulled back exactly. -/ -@[expose] public section +public section noncomputable section @@ -134,7 +134,7 @@ noncomputable def vertical : ComplexVector →L[ℝ] ComplexVector := /-- Rotation map, given by `(y.1 / cartesianRadius y) • horizontal + (y.2 / cartesianRadius y) • connection + vertical`. -/ -noncomputable def rotationMap (y : Plane) : ComplexVector →L[ℝ] ComplexVector := +@[expose] noncomputable def rotationMap (y : Plane) : ComplexVector →L[ℝ] ComplexVector := (y.1 / cartesianRadius y) • horizontal + (y.2 / cartesianRadius y) • connection + vertical theorem rotationMap_apply (y : Plane) (v : ComplexVector) : @@ -185,7 +185,7 @@ theorem rotation_uniform {ι : Type*} (s : StripData Native) {a b : ℝ} (ha : 0 /-- Rotated source, given by `rotationMap (PhysicalGraphBounds.liftXY x) (f l n (cylindricalMap x))`. -/ -noncomputable def rotatedSource {ι : Type*} (f : ι → ℕ → Native → ComplexVector) +@[expose] noncomputable def rotatedSource {ι : Type*} (f : ι → ℕ → Native → ComplexVector) (l : ι) (n : ℕ) (x : LiftPoint) : ComplexVector := rotationMap (PhysicalGraphBounds.liftXY x) (f l n (cylindricalMap x)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CauchyRestriction.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CauchyRestriction.lean index d9c96841e3..85746f7751 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CauchyRestriction.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CauchyRestriction.lean @@ -20,7 +20,7 @@ of the smaller disk. It is defined on all continuous outer-disk functions; on holomorphic inputs it agrees with the actual complex derivative. -/ -@[expose] public section +public section noncomputable section @@ -66,7 +66,7 @@ def restrictionCLM (c : ℂ) {ρ σ : ℝ} (h : ρ ≤ σ) : @[simp] theorem restrictionCLM_apply (c : ℂ) {ρ σ : ℝ} (h : ρ ≤ σ) (f : C(Disk c σ, E)) (z : Disk c ρ) : - restrictionCLM c h f z = f ⟨z.1, closedBall_subset_closedBall h z.2⟩ := rfl + restrictionCLM c h f z = f ⟨z.1, closedBall_subset_closedBall h z.2⟩ := by rfl theorem restrictionCLM_comp (c : ℂ) {r ρ σ : ℝ} (h₁ : r ≤ ρ) (h₂ : ρ ≤ σ) : (restrictionCLM (E := E) c h₁).comp (restrictionCLM c h₂) = @@ -264,7 +264,7 @@ noncomputable def ofContinuousOn (c : ℂ) (r : ℝ) (F : ℂ → E) omit [NormedSpace ℂ E] [CompleteSpace E] in @[simp] theorem ofContinuousOn_apply (c : ℂ) (r : ℝ) (F : ℂ → E) (hF : ContinuousOn F (closedBall c r)) (z : Disk c r) : - ofContinuousOn c r F hF z = F z := rfl + ofContinuousOn c r F hF z = F z := by rfl /-- Agreement with the actual derivative under holomorphy in the open disk and continuity on its closure. No smoothness of the derivative is assumed. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ChartScales.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ChartScales.lean index dfbd0feacf..193467345b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ChartScales.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ChartScales.lean @@ -31,7 +31,7 @@ Closed boxes of two mesh widths include the fixed small enlargement of the one-mesh supports in the manuscript. -/ -@[expose] public section +public section noncomputable section @@ -48,7 +48,7 @@ abbrev Position := Fin 3 → ℝ abbrev Label := ℕ × (Grid × Bool) /-- Dyadic Q, given by `(2 : ℝ) ^ (-(n : ℝ))`. -/ -def dyadicQ (n : ℕ) : ℝ := (2 : ℝ) ^ (-(n : ℝ)) +@[expose] def dyadicQ (n : ℕ) : ℝ := (2 : ℝ) ^ (-(n : ℝ)) /-- Spacing, given by `(2 : ℝ) ^ (-(n : ℝ) * a) / (n : ℝ) ^ 6`. -/ def spacing (a : ℝ) (n : ℕ) : ℝ := (2 : ℝ) ^ (-(n : ℝ) * a) / (n : ℝ) ^ 6 @@ -108,11 +108,11 @@ theorem spacing_ratio_le (a A : ℝ) {n m : ℕ} (Real.rpow_nonneg (by norm_num) _) (by positivity) /-- Axis exponent, given by `![1 / 2, D, 1]`. -/ -def axisExponent (D : ℝ) : Fin 3 → ℝ := ![1 / 2, D, 1] +@[expose] def axisExponent (D : ℝ) : Fin 3 → ℝ := ![1 / 2, D, 1] /-- Width, given by `spacing (axisExponent D j) n`. -/ -def width (D : ℝ) (j : Fin 3) (n : ℕ) : ℝ := spacing (axisExponent D j) n +@[expose] def width (D : ℝ) (j : Fin 3) (n : ℕ) : ℝ := spacing (axisExponent D j) n /-- Ratio bound, given by `(5 : ℝ) ^ 6 * (2 : ℝ) ^ (4 * (1 + |D|))`. -/ -def ratioBound (D : ℝ) : ℝ := (5 : ℝ) ^ 6 * (2 : ℝ) ^ (4 * (1 + |D|)) +@[expose] def ratioBound (D : ℝ) : ℝ := (5 : ℝ) ^ 6 * (2 : ℝ) ^ (4 * (1 + |D|)) theorem width_pos (D : ℝ) (j : Fin 3) {n : ℕ} (hn : 1 ≤ n) : 0 < width D j n := spacing_pos _ hn @@ -133,7 +133,7 @@ theorem width_ratio_le (D : ℝ) (j : Fin 3) {n m : ℕ} /-- Physical box, given by `{x | ∀ j, |x j - width D j L.1 * (L.2.1 j : ℝ)| ≤ 2 * width D j L.1}`. -/ -def physicalBox (D : ℝ) (L : Label) : Set Position := +@[expose] def physicalBox (D : ℝ) (L : Label) : Set Position := {x | ∀ j, |x j - width D j L.1 * (L.2.1 j : ℝ)| ≤ 2 * width D j L.1} /-- The exact enlarged-box interaction relation used for coloring. -/ @@ -345,7 +345,7 @@ theorem neighbors_card_le (D : ℝ) (L : Label) : (neighbors D L).card ≤ degre theorem label_type_countable : Countable Label := by infer_instance /-- The expanding eigenvalue of the actual covering matrix. -/ -def coverGrowth : ℝ := 4 + Real.sqrt 2 +@[expose] def coverGrowth : ℝ := 4 + Real.sqrt 2 theorem log_coverGrowth_pos : 0 < Real.log coverGrowth := by apply Real.log_pos @@ -509,7 +509,7 @@ end end -@[expose] public section +public section noncomputable section @@ -521,27 +521,27 @@ open scoped Topology /-- Tg: an abbreviation for `SlotColoring.coverGrowth`. -/ abbrev Tg : ℝ := SlotColoring.coverGrowth /-- Lambda, given by `4 - Real.sqrt 2`. -/ -def Lambda : ℝ := 4 - Real.sqrt 2 +@[expose] def Lambda : ℝ := 4 - Real.sqrt 2 /-- Rho, given by `Real.log Lambda / Real.log Tg`. -/ def rho : ℝ := Real.log Lambda / Real.log Tg /-- Kappa, given by `1 / 100000`. -/ -def kappa : ℝ := 1 / 100000 +@[expose] def kappa : ℝ := 1 / 100000 /-- Radial exponent, given by `2 * ((1 + h) * rho - h * kappa)`. -/ def radialExponent (h : ℝ) : ℝ := 2 * ((1 + h) * rho - h * kappa) /-- Q: an abbreviation for `SlotColoring.dyadicQ n`. -/ abbrev Q (n : ℕ) : ℝ := SlotColoring.dyadicQ n /-- S, given by `(n : ℝ) ^ 2`. -/ -def S (n : ℕ) : ℝ := (n : ℝ) ^ 2 +@[expose] def S (n : ℕ) : ℝ := (n : ℝ) ^ 2 /-- Epsilon, given by `Q n ^ h`. -/ -def epsilon (h : ℝ) (n : ℕ) : ℝ := Q n ^ h +@[expose] def epsilon (h : ℝ) (n : ℕ) : ℝ := Q n ^ h /-- Native index: an abbreviation for `SlotColoring.nativeIndex h n`. -/ abbrev nativeIndex (h : ℝ) (n : ℕ) : ℕ := SlotColoring.nativeIndex h n /-- Time coefficient, given by `Tg ^ nativeIndex h n * Q n ^ (1 + h)`. -/ -def timeCoefficient (h : ℝ) (n : ℕ) : ℝ := Tg ^ nativeIndex h n * Q n ^ (1 + h) +@[expose] def timeCoefficient (h : ℝ) (n : ℕ) : ℝ := Tg ^ nativeIndex h n * Q n ^ (1 + h) /-- Radial coefficient, given by `Lambda ^ nativeIndex h n * Q n ^ (radialExponent h / 2)`. -/ -def radialCoefficient (h : ℝ) (n : ℕ) : ℝ := +@[expose] def radialCoefficient (h : ℝ) (n : ℕ) : ℝ := Lambda ^ nativeIndex h n * Q n ^ (radialExponent h / 2) theorem sqrt_two_lt_two : Real.sqrt (2 : ℝ) < 2 := by @@ -741,7 +741,7 @@ theorem timeCoefficient_inv_lower (h : ℝ) (hh : 0 ≤ h) {n : ℕ} (hn : 4 ≤ simpa only [one_div, inv_inv] using hi /-- Slot length, given by `2 * r0 / timeCoefficient h n`. -/ -def slotLength (r0 h : ℝ) (n : ℕ) : ℝ := 2 * r0 / timeCoefficient h n +@[expose] def slotLength (r0 h : ℝ) (n : ℕ) : ℝ := 2 * r0 / timeCoefficient h n /-- The native slot has length comparable to the actual slow scale `n²`. -/ theorem slotLength_bounds (r0 h : ℝ) (hr : 0 ≤ r0) (hh : 0 ≤ h) {n : ℕ} (hn : 4 ≤ n) : @@ -753,7 +753,8 @@ theorem slotLength_bounds (r0 h : ℝ) (hr : 0 ≤ r0) (hh : 0 ≤ h) {n : ℕ} by simpa only [slotLength, div_eq_mul_inv, mul_assoc] using hu⟩ /-- The carrier is the genuine rounded integer frequency used in the manuscript. -/ -def carrier (h : ℝ) (n : ℕ) : ℕ := Scaling.carrierFrequency (epsilon h n) +@[expose] def carrier (h : ℝ) (n : ℕ) : ℕ := + Scaling.carrierFrequency (epsilon h n) theorem carrier_viscosity_bounds (h : ℝ) (hh : 0 ≤ h) (n : ℕ) : 1 ≤ epsilon h n * (carrier h n : ℝ) ^ 2 ∧ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ClosedNativeWaveIdentities.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ClosedNativeWaveIdentities.lean index 313119e279..8bfe6f8f67 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ClosedNativeWaveIdentities.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ClosedNativeWaveIdentities.lean @@ -17,7 +17,7 @@ openness of a quantitative control cell, nor a zero germ at its flat boundary, is required. -/ -@[expose] public section +public section namespace NavierStokes.ClosedNativeWaveIdentities diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CommonBaseContext.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CommonBaseContext.lean index 5cbad6b40a..646e220225 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CommonBaseContext.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CommonBaseContext.lean @@ -18,7 +18,7 @@ Only the integer cover used in the graph operators changes. The forward real-lift map is the genuine integer covering matrix, with its actual norm. -/ -@[expose] public section +public section noncomputable section @@ -60,11 +60,11 @@ theorem IndexBounds.commonRatio {h : ℝ} {index : ℕ → ℕ} {K : ℕ} /-- Radial frequency, given by `ChartScales.Lambda ^ index n * ChartScales.Q n ^ (ChartScales.radialExponent h / 2)`. -/ -noncomputable def radialFrequency (h : ℝ) (index : ℕ → ℕ) (n : ℕ) : ℝ := +@[expose] noncomputable def radialFrequency (h : ℝ) (index : ℕ → ℕ) (n : ℕ) : ℝ := ChartScales.Lambda ^ index n * ChartScales.Q n ^ (ChartScales.radialExponent h / 2) /-- Fast coefficient, given by `ChartScales.Tg ^ index n * ChartScales.Q n ^ (1 + h)`. -/ -noncomputable def fastCoefficient (h : ℝ) (index : ℕ → ℕ) (n : ℕ) : ℝ := +@[expose] noncomputable def fastCoefficient (h : ℝ) (index : ℕ → ℕ) (n : ℕ) : ℝ := ChartScales.Tg ^ index n * ChartScales.Q n ^ (1 + h) theorem radialFrequency_pos (h : ℝ) (index : ℕ → ℕ) (n : ℕ) : 0 < radialFrequency h index n := @@ -135,7 +135,7 @@ theorem fastCoefficient_inverse_bound {h : ℝ} {index : ℕ → ℕ} {K : ℕ} /-- Reconstruction, bundling `exponent`, `inner`, `outer`, `inner_lt_outer` and the required compatibility proofs. -/ -noncomputable def reconstruction (h : ℝ) (index : ℕ → ℕ) (a b : ℝ) (hab : a < b) : +@[expose] noncomputable def reconstruction (h : ℝ) (index : ℕ → ℕ) (a b : ℝ) (hab : a < b) : CorrectionState.ReconstructionData where exponent := ChartScales.radialExponent h inner := a @@ -145,7 +145,7 @@ noncomputable def reconstruction (h : ℝ) (index : ℕ → ℕ) (a b : ℝ) (ha radialDirection := TorusInverse.vector .radial /-- Operators, constructed using `CorrectionState.graphOperators`. -/ -noncomputable def operators (h : ℝ) (index : ℕ → ℕ) (a b : ℝ) (hab : a < b) : +@[expose] noncomputable def operators (h : ℝ) (index : ℕ → ℕ) (a b : ℝ) (hab : a < b) : MeanIncrementBounds.Operators Point := CorrectionState.graphOperators (reconstruction h index a b hab) (ChartScales.epsilon h) (fastCoefficient h index) ((0,1),0) ((1,0),0) (TorusInverse.vector .temporal) @@ -501,7 +501,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (v : ModulatedProfileAssembly.Witness ld) (upper : ℝ) (B : ℕ) /-- Same actual base and stress; only the graph's integer index changes. -/ -noncomputable def context (index : ℕ → ℕ) : CorrectionState.Context Point := +@[expose] noncomputable def context (index : ℕ → ℕ) : CorrectionState.Context Point := { BaseContextAssembly.nativeContext H v upper B with operators := operators F.data.h index (PrimaryTargetBounds.leftRadius W) (PrimaryTargetBounds.rightRadius W) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverClass.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverClass.lean index f748938412..303424c454 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverClass.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverClass.lean @@ -21,7 +21,7 @@ whose constants precede the band, copy, and source. No native periodicity of the source is used. -/ -@[expose] public section +public section namespace NavierStokes.CommonCoverClass @@ -121,11 +121,11 @@ variable {P V : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] abbrev Joint (P : Type) := (P × Plane) × ℝ /-- Native argument, given by `(w.1.1, ((g.coordinates k w.1.2).1, w.2))`. -/ -noncomputable def nativeArgument (g : CCS) (k : Frequency) (w : Joint P) : P × Plane := +@[expose] noncomputable def nativeArgument (g : CCS) (k : Frequency) (w : Joint P) : P × Plane := (w.1.1, ((g.coordinates k w.1.2).1, w.2)) /-- Source argument, given by `(w.1.1, g.path k w.1.2 w.2)`. -/ -noncomputable def sourceArgument (g : CCS) (k : Frequency) (w : Joint P) : P × Plane := +@[expose] noncomputable def sourceArgument (g : CCS) (k : Frequency) (w : Joint P) : P × Plane := (w.1.1, g.path k w.1.2 w.2) /-- Native linear as an element of `Joint P →L[ℝ] P × Plane`. -/ @@ -144,11 +144,11 @@ noncomputable def sourceLinear (P : Type) [NormedAddCommGroup P] [NormedSpace (g.pointLinear.comp ((ContinuousLinearMap.snd ℝ P Plane).comp (nativeLinear P g))) @[simp] theorem nativeLinear_apply (g : CCS) (w : Joint P) : - nativeLinear P g w = (w.1.1, ((g.coordinateLinear w.1.2).1, w.2)) := rfl + nativeLinear P g w = (w.1.1, ((g.coordinateLinear w.1.2).1, w.2)) := by rfl @[simp] theorem sourceLinear_apply (g : CCS) (w : Joint P) : sourceLinear P g w = - (w.1.1, g.pointLinear ((g.coordinateLinear w.1.2).1, w.2)) := rfl + (w.1.1, g.pointLinear ((g.coordinateLinear w.1.2).1, w.2)) := by rfl theorem nativeArgument_affine (g : CCS) (k : Frequency) (w : Joint P) : nativeArgument g k w = nativeArgument g k 0 + nativeLinear P g w := by @@ -184,7 +184,7 @@ theorem sourceArgument_smooth (g : CCS) (k : Frequency) : /-- One common affine cost for both maps. Its value is independent of the copy index and of the slow parameter space. -/ -noncomputable def argumentCost (g : CCS) : ℝ := +@[expose] noncomputable def argumentCost (g : CCS) : ℝ := 1 + ‖g.coordinateLinear‖ + ‖g.pointLinear‖ * (1 + ‖g.coordinateLinear‖) theorem one_le_argumentCost (g : CCS) : 1 ≤ argumentCost g := by @@ -263,11 +263,11 @@ theorem sourceArgument_jet_bound (g : CCS) (k : Frequency) {f : P × Plane → V omit [NormedAddCommGroup P] [NormedSpace ℝ P] in @[simp] theorem sourceArgument_slow (g : CCS) (k : Frequency) (w : Joint P) : - (sourceArgument g k w).1 = w.1.1 := rfl + (sourceArgument g k w).1 = w.1.1 := by rfl omit [NormedAddCommGroup P] [NormedSpace ℝ P] in @[simp] theorem nativeArgument_slow (g : CCS) (k : Frequency) (w : Joint P) : - (nativeArgument g k w).1 = w.1.1 := rfl + (nativeArgument g k w).1 = w.1.1 := by rfl end Arguments @@ -328,7 +328,7 @@ theorem norm_inverse_scaledBasis_le (B : Plane ≃L[ℝ] Plane) (ci : ℝ) (hci (mul_le_mul_of_nonneg_right (norm_inverse_transverseChart_le ci hci) (norm_nonneg _)) /-- Band geometry, bundling `gap`, `basis`, `center`. -/ -noncomputable def bandGeometry (B : Plane ≃L[ℝ] Plane) (h : ℝ) (n gap : ℕ) +@[expose] noncomputable def bandGeometry (B : Plane ≃L[ℝ] Plane) (h : ℝ) (n gap : ℕ) (center : Plane) : CCS where gap := gap basis := scaledBasis B (ChartScales.timeCoefficient h n) (ChartScales.timeCoefficient_pos h n).ne' @@ -431,7 +431,7 @@ variable {P V : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Reinsert the actual current slot time after solving the joint equation. -/ -noncomputable def currentArgument (g : CCS) (k : Frequency) (p : P × Plane) : Joint P := +@[expose] noncomputable def currentArgument (g : CCS) (k : Frequency) (p : P × Plane) : Joint P := (p, (g.coordinates k p.2).2) /-- Current linear as an element of `P × Plane →L[ℝ] Joint P`. -/ @@ -442,7 +442,7 @@ noncomputable def currentLinear (P : Type) [NormedAddCommGroup P] [NormedSpace (g.coordinateLinear.comp (ContinuousLinearMap.snd ℝ P Plane))) @[simp] theorem currentLinear_apply (g : CCS) (p : P × Plane) : - currentLinear P g p = (p, (g.coordinateLinear p.2).2) := rfl + currentLinear P g p = (p, (g.coordinateLinear p.2).2) := by rfl theorem currentArgument_affine (g : CCS) (k : Frequency) (p : P × Plane) : currentArgument g k p = currentArgument g k 0 + currentLinear P g p := by @@ -690,7 +690,7 @@ noncomputable def bandChart (D : ℝ) (n m : ℕ) : SlowPoint →L[ℝ] SlowPoin @[simp] theorem bandChart_apply (D : ℝ) (n m : ℕ) (x : SlowPoint) : bandChart D n m x = (bandRatio (1 / 2) n m * x.1, - (bandRatio D n m * x.2.1, bandRatio 1 n m * x.2.2)) := rfl + (bandRatio D n m * x.2.1, bandRatio 1 n m * x.2.2)) := by rfl theorem bandChart_formula (D : ℝ) (n m : ℕ) (x : SlowPoint) : bandChart D n m x = ((ChartScales.Q n / ChartScales.Q m) ^ (1 / 2 : ℝ) * x.1, @@ -855,7 +855,7 @@ theorem memClass_affine_transport /-- A strip over a linear parameter projection. Its weights are the actual base weights, so retaining the parameter preserves them exactly. -/ -noncomputable def parameterStrip (s : WeightedClasses.StripData Y) (L : X →L[ℝ] Y) : +@[expose] noncomputable def parameterStrip (s : WeightedClasses.StripData Y) (L : X →L[ℝ] Y) : WeightedClasses.StripData X where domain := L ⁻¹' s.domain isOpen_domain := s.isOpen_domain.preimage L.continuous @@ -881,6 +881,7 @@ variable {P V : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Source strip, given by `parameterStrip s (ContinuousLinearMap.fst ℝ P Plane)`. -/ +@[expose] noncomputable def sourceStrip (s : WeightedClasses.StripData P) : WeightedClasses.StripData (P × Plane) := parameterStrip s (ContinuousLinearMap.fst ℝ P Plane) @@ -944,7 +945,7 @@ section CommonBandChanges /-- Either direction of a bounded covering change. The inverse is a map on the universal cover; no extra periodicity is imposed on its input. -/ -noncomputable def coverChange (forward : Bool) (d : ℕ) : Plane →L[ℝ] Plane := +@[expose] noncomputable def coverChange (forward : Bool) (d : ℕ) : Plane →L[ℝ] Plane := if forward then (CommonCoverSolve.coverPower d : Plane →L[ℝ] Plane) else ((CommonCoverSolve.coverPower d).symm : Plane →L[ℝ] Plane) @@ -961,7 +962,8 @@ noncomputable def bandCommonChart (D : ℝ) (n m : ℕ) (forward : Bool) (gap : @[simp] theorem bandCommonChart_apply (D : ℝ) (n m : ℕ) (forward : Bool) (gap : ℕ) (x : SlowPoint × Plane) : - bandCommonChart D n m forward gap x = (bandChart D n m x.1, coverChange forward gap x.2) := rfl + bandCommonChart D n m forward gap x = (bandChart D n m x.1, coverChange forward gap x.2) := by + rfl /-- Common chart cost, given by `chartCost D + CommonCoverSolve.coveringBound gapBound`. -/ noncomputable def commonChartCost (D : ℝ) (gapBound : ℕ) : ℝ := @@ -1241,7 +1243,7 @@ noncomputable def meshTransition (D : ℝ) (L M : SlotColoring.Label) @[simp] theorem meshLinear_apply (D : ℝ) (L M : SlotColoring.Label) (x : SlotColoring.Position) (j : Fin 3) : - meshLinear D L M x j = (SlotColoring.width D j L.1 / SlotColoring.width D j M.1) * x j := rfl + meshLinear D L M x j = (SlotColoring.width D j L.1 / SlotColoring.width D j M.1) * x j := by rfl theorem meshTransition_eq_coordinate (D : ℝ) (L M : SlotColoring.Label) (x : SlotColoring.Position) : meshTransition D L M x = meshCoordinate D M (meshPoint D L x) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverSolve.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverSolve.lean index 3c3109d8f2..7784bb89ce 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverSolve.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CommonCoverSolve.lean @@ -19,7 +19,7 @@ The source is evaluated on the lifted copy path. Only periodicity on the coarsest torus is used; finer native periodicity is not an input. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ theorem coverEquiv_apply (Y : Plane) : coverEquiv Y = SlotGeometry.cover Y := by /-- Cover power as an element of `ℕ → Plane ≃L[ℝ] Plane | 0 => ContinuousLinearEquiv.refl ℝ Plane | d + 1 => (coverPower d).trans coverEquiv`. -/ -noncomputable def coverPower : ℕ → Plane ≃L[ℝ] Plane +@[expose] noncomputable def coverPower : ℕ → Plane ≃L[ℝ] Plane | 0 => ContinuousLinearEquiv.refl ℝ Plane | d + 1 => (coverPower d).trans coverEquiv @@ -57,7 +57,7 @@ noncomputable def indexMap (k : Frequency) : Frequency := (3 * k.1 + k.2, k.1 + 5 * k.2) /-- Cover index, given by `indexMap^[d] k`. -/ -noncomputable def coverIndex (d : ℕ) (k : Frequency) : Frequency := indexMap^[d] k +@[expose] noncomputable def coverIndex (d : ℕ) (k : Frequency) : Frequency := indexMap^[d] k theorem coverEquiv_lattice (k : Frequency) : coverEquiv (TorusAverages.latticePoint k) = TorusAverages.latticePoint (indexMap k) := by @@ -100,12 +100,12 @@ variable (g : Geometry) /-- Coordinates, given by `g.basis.symm (coverPower g.gap Y - g.center - TorusAverages.latticePoint k)`. -/ -noncomputable def coordinates (k : Frequency) (Y : Plane) : Plane := +@[expose] noncomputable def coordinates (k : Frequency) (Y : Plane) : Plane := g.basis.symm (coverPower g.gap Y - g.center - TorusAverages.latticePoint k) /-- Point, given by `(coverPower g.gap).symm (g.center + TorusAverages.latticePoint k + g.basis z)`. -/ -noncomputable def point (k : Frequency) (z : Plane) : Plane := +@[expose] noncomputable def point (k : Frequency) (z : Plane) : Plane := (coverPower g.gap).symm (g.center + TorusAverages.latticePoint k + g.basis z) theorem coordinates_point (k : Frequency) (z : Plane) : @@ -129,7 +129,7 @@ theorem point_add (k : Frequency) (z h : Plane) : simp only [point, map_add, add_assoc] /-- Path, given by `g.point k ((g.coordinates k Y).1, eta)`. -/ -noncomputable def path (k : Frequency) (Y : Plane) (eta : ℝ) : Plane := +@[expose] noncomputable def path (k : Frequency) (Y : Plane) (eta : ℝ) : Plane := g.point k ((g.coordinates k Y).1, eta) theorem coordinates_path (k : Frequency) (Y : Plane) (eta : ℝ) : @@ -211,7 +211,7 @@ structure LinearData (P V E : Type) [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Periodic at, given by `∀ Y : Plane, ∀ n : Frequency, f (p, Y + TorusAverages.latticePoint n) = f (p, Y)`. -/ -def PeriodicAt {P V : Type} (f : P × Plane → V) (p : P) : Prop := +@[expose] def PeriodicAt {P V : Type} (f : P × Plane → V) (p : P) : Prop := ∀ Y : Plane, ∀ n : Frequency, f (p, Y + TorusAverages.latticePoint n) = f (p, Y) @@ -226,12 +226,12 @@ namespace LinearData variable (d : LinearData P V E) (g : Geometry) /-- Coefficient along, given by `d.coefficient (w.1.1, ((g.coordinates k w.1.2).1, w.2))`. -/ -noncomputable def coefficientAlong (k : Frequency) (w : (P × Plane) × ℝ) : E →L[ℝ] E := +@[expose] noncomputable def coefficientAlong (k : Frequency) (w : (P × Plane) × ℝ) : E →L[ℝ] E := d.coefficient (w.1.1, ((g.coordinates k w.1.2).1, w.2)) /-- Forcing along, given by `d.forcingMap (w.1.1, ((g.coordinates k w.1.2).1, w.2)) (d.source (w.1.1, g.path k w.1.2 w.2))`. -/ -noncomputable def forcingAlong (k : Frequency) (w : (P × Plane) × ℝ) : E := +@[expose] noncomputable def forcingAlong (k : Frequency) (w : (P × Plane) × ℝ) : E := d.forcingMap (w.1.1, ((g.coordinates k w.1.2).1, w.2)) (d.source (w.1.1, g.path k w.1.2 w.2)) @@ -285,20 +285,20 @@ variable [CompleteSpace E] {a b : ℝ} variable (d : LinearData P V E) (g : Geometry) (hab : a ≤ b) /-- Coefficient path, given by `SmoothPathFamily.pathFamily (d.coefficientAlong g k) p`. -/ -noncomputable def coefficientPath (k : Frequency) (p : P × Plane) : +@[expose] noncomputable def coefficientPath (k : Frequency) (p : P × Plane) : ParametricODE.Coefficient a b E := SmoothPathFamily.pathFamily (d.coefficientAlong g k) p /-- Forcing path, given by `SmoothPathFamily.pathFamily (d.forcingAlong g k) p`. -/ -noncomputable def forcingPath (k : Frequency) (p : P × Plane) : +@[expose] noncomputable def forcingPath (k : Frequency) (p : P × Plane) : ParametricODE.Curve a b E := SmoothPathFamily.pathFamily (d.forcingAlong g k) p /-- The genuine Volterra solution, with zero entry data, evaluated along the copy path anchored at the current common coordinate. -/ -noncomputable def anchoredSolve (k : Frequency) (p : P × Plane) (s : ℝ) : E := +@[expose] noncomputable def anchoredSolve (k : Frequency) (p : P × Plane) (s : ℝ) : E := ParametricODE.solutionExtension hab (d.coefficientPath g k p) 0 (d.forcingPath g k p) s /-- Value of the constructed solution at the current native slot coordinate. -/ -noncomputable def copySolve (k : Frequency) (p : P × Plane) : E := +@[expose] noncomputable def copySolve (k : Frequency) (p : P × Plane) : E := d.anchoredSolve g hab k p (g.coordinates k p.2).2 omit [CompleteSpace E] in @@ -582,12 +582,12 @@ variable [CompleteSpace E] {a b : ℝ} variable (d : LinearData P V E) (g : Geometry) (hab : a ≤ b) /-- Localized copy, given by `κ (g.coordinates k p.2) • d.copySolve g hab k p`. -/ -noncomputable def localizedCopy (κ : Plane → ℝ) (k : Frequency) (p : P × Plane) : E := +@[expose] noncomputable def localizedCopy (κ : Plane → ℝ) (k : Frequency) (p : P × Plane) : E := κ (g.coordinates k p.2) • d.copySolve g hab k p /-- The actual sum of localized copy solves. Sources in different native copies are evaluated at their own absolute-lift points. -/ -noncomputable def commonSolve (κ : Plane → ℝ) (p : P × Plane) : E := +@[expose] noncomputable def commonSolve (κ : Plane → ℝ) (p : P × Plane) : E := ∑' k : Frequency, d.localizedCopy g hab κ k p omit [NormedSpace ℝ P] in @@ -702,7 +702,7 @@ noncomputable def torusDescent {W : Type} (f : Plane → W) (hf : LatticePeriodi (z : Torus) : W := (firstDescent_periodic f hf z.1).lift z.2 theorem torusDescent_coe {W : Type} (f : Plane → W) (hf : LatticePeriodic f) (Y : Plane) : - torusDescent f hf (TorusAverages.quotientPoint Y) = f Y := rfl + torusDescent f hf (TorusAverages.quotientPoint Y) = f Y := by rfl theorem torusDescent_continuous {W : Type} [TopologicalSpace W] {f : Plane → W} (hf : LatticePeriodic f) (hc : Continuous f) : Continuous (torusDescent f hf) := by @@ -727,7 +727,7 @@ omit [NormedSpace ℝ P] in omit [NormedAddCommGroup P] in theorem commonOnTorus_coe (κ : Plane → ℝ) (p : P) (hp : PeriodicAt d.source p) (Y : Plane) : d.commonOnTorus g hab κ p hp (TorusAverages.quotientPoint Y) = - d.commonSolve g hab κ (p, Y) := rfl + d.commonSolve g hab κ (p, Y) := by rfl /-! Joint regularity is derived from the actual ODE construction. -/ @@ -851,7 +851,7 @@ noncomputable def coordinateLinear : Plane →L[ℝ] Plane := /-- Point linear, given by `((coverPower g.gap).symm : Plane →L[ℝ] Plane).comp (g.basis : Plane →L[ℝ] Plane)`. -/ -noncomputable def pointLinear : Plane →L[ℝ] Plane := +@[expose] noncomputable def pointLinear : Plane →L[ℝ] Plane := ((coverPower g.gap).symm : Plane →L[ℝ] Plane).comp (g.basis : Plane →L[ℝ] Plane) /-- Horizontal, given by `(ContinuousLinearMap.fst ℝ ℝ ℝ).prod 0`. -/ @@ -1049,7 +1049,7 @@ variable {P H : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] (t : TangentData P H) (g : Geometry) {a b : ℝ} (hab : a ≤ b) /-- Linear data, bundling `coefficient`, `forcingMap`, `source`. -/ -noncomputable def linearData : LinearData P H H where +@[expose] noncomputable def linearData : LinearData P H H where coefficient z := TangentODE.projectedOperator (t.normal z) (t.normalDot z) (t.action z) (t.damping z) forcingMap z := negativeTangentProjection (t.normal z) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CompactForceDecay.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CompactForceDecay.lean index d2a2f9d389..c8cdee9875 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CompactForceDecay.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CompactForceDecay.lean @@ -17,7 +17,7 @@ bounded on a compact time interval after reduction to a fundamental cube. Beyond the time support it is zero by locality of differentiation. -/ -@[expose] public section +public section namespace NavierStokes.CompactForceDecay diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CompactSmoothFamily.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CompactSmoothFamily.lean index 6cdeacd1c5..f2a947f2b9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CompactSmoothFamily.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CompactSmoothFamily.lean @@ -19,7 +19,7 @@ compact subset of a real normed space. The Fréchet derivative in the supremum norm is proved by a uniform mean-value remainder estimate. -/ -@[expose] public section +public section namespace NavierStokes.CompactSmoothFamily @@ -37,7 +37,7 @@ variable {P Z E : Type u} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- The actual slice when continuous, with a zero fallback outside the domain where the hypotheses guarantee continuity. -/ -noncomputable def family (K : Set Z) (F : P × Z → E) (p : P) : C(K, E) := by +@[expose] noncomputable def family (K : Set Z) (F : P × Z → E) (p : P) : C(K, E) := by classical exact if h : Continuous (fun z : K => F (p, z)) then ⟨_, h⟩ else 0 @@ -99,7 +99,7 @@ noncomputable def flipCLM (K : Set Z) [CompactSpace K] : omit [NormedSpace ℝ Z] in theorem flipCLM_apply (K : Set Z) [CompactSpace K] (g : C(K, P →L[ℝ] E)) (v : P) (z : K) : - flipCLM (P := P) (E := E) K g v z = g z v := rfl + flipCLM (P := P) (E := E) K g v z = g z v := by rfl omit [NormedSpace ℝ Z] in /-- Actual slice derivatives and their joint continuity give the Fréchet diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorDefinitions.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorDefinitions.lean index 3e0fa918e3..f62aaa9d59 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorDefinitions.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorDefinitions.lean @@ -43,7 +43,7 @@ Source: https://github.com/google-deepmind/formal-conjectures/blob/8bf45ed70d48b2b2a501de9c00b26bfa38c573ee/FormalConjectures/Millenium/NavierStokes.lean -/ -@[expose] public section +public section open ContDiff Set InnerProductSpace MeasureTheory @@ -66,8 +66,8 @@ In coordinates, $\nabla \cdot v = \sum_i \partial v_i / \partial x_i$. This is available as the notation `∇⬝ v`. If `v` is not differentiable at `x`, then `fderiv` is the zero map, so this definition has the corresponding junk value $0$. -/ -noncomputable -def divergence (v : ℝ^n → ℝ^n) (x : ℝ^n) : ℝ := (fderiv ℝ v x).trace ℝ (ℝ^n) +@[expose] noncomputable def divergence (v : ℝ^n → ℝ^n) (x : ℝ^n) : ℝ := + (fderiv ℝ v x).trace ℝ (ℝ^n) @[inherit_doc] local notation "∇⬝" => divergence @@ -107,7 +107,7 @@ A function $f : \mathbb{R}^n \to \alpha$ is 1-periodic if it is periodic in each coordinate with period $1$, i.e. $f(x + e_i) = f(x)$ for each unit vector $e_i$. This captures functions on the $n$-torus $\mathbb{R}^n/\mathbb{Z}^n$. -/ -def IsOnePeriodic {α : Sort*} (f : ℝ^n → α) : Prop := +@[expose] def IsOnePeriodic {α : Sort*} (f : ℝ^n → α) : Prop := ∀ x i, f (x + EuclideanSpace.single i 1) = f x /-- diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorR3Theorem.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorR3Theorem.lean index 86dac27e6b..bd297de3c7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorR3Theorem.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorR3Theorem.lean @@ -27,7 +27,7 @@ potential, direct field, and pressure sums. It does not invoke whole-space uniqueness or claim the comparator's nonexistence conclusion. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorSolution.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorSolution.lean index 01e4af20da..9f928a495d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorSolution.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorSolution.lean @@ -17,7 +17,7 @@ Expose the project's proof adapters under the reference theorem names. The adapters import `ComparatorDefinitions`, never the challenge module. -/ -@[expose] public section +public section namespace NavierStokes.Comparator diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorTheorem.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorTheorem.lean index 51ab1a24b5..c77e10ef90 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorTheorem.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ComparatorTheorem.lean @@ -23,7 +23,7 @@ global viscosity-one solution, contradicting the existing maximal-lifespan theor No result here uses any of the comparator's unproved statements. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ConeAlgebra.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ConeAlgebra.lean index 171dcac1a6..586804fec7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ConeAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ConeAlgebra.lean @@ -16,13 +16,13 @@ of the candidate manuscript, together with the normalized factorization used in equation (11). It does not construct any stress profile. -/ -@[expose] public section +public section namespace NavierStokes.ConeAlgebra /-- The lower root appearing in equation (10). -/ -noncomputable def coneBound (P J : ℝ) : ℝ := +@[expose] noncomputable def coneBound (P J : ℝ) : ℝ := P + J ^ 2 / 4 - |J| * Real.sqrt ((P - 2) / 2 + J ^ 2 / 16) /-- The discriminant term in the displayed root formula. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean index 220ebc5d96..dacdc4144a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean @@ -31,7 +31,7 @@ canonical improper-integral pressure. All stream cutoffs are retained until their coefficients are shown to vanish in an exterior neighborhood. -/ -@[expose] public section +public section noncomputable section @@ -251,12 +251,12 @@ theorem exterior_stream_germ {a : ℕ → ℕ} {h C R : ℝ} {d : Coefficients} /-- Leading angular, defined pointwise by `C⁻¹ * SimilarityProfile.pullback h (-CoordinateAlgebra.A h - 1 / 2) (d.phi 0) p`. -/ -noncomputable def leadingAngular (h C : ℝ) (d : Coefficients) : PhysicalProfile := +@[expose] noncomputable def leadingAngular (h C : ℝ) (d : Coefficients) : PhysicalProfile := fun p => C⁻¹ * SimilarityProfile.pullback h (-CoordinateAlgebra.A h - 1 / 2) (d.phi 0) p /-- Leading pressure, given by `SimilarityProfile.pullback h (-2 * CoordinateAlgebra.A h) (d.pressure 0)`. -/ -noncomputable def leadingPressure (h : ℝ) (d : Coefficients) : PhysicalProfile := +@[expose] noncomputable def leadingPressure (h : ℝ) (d : Coefficients) : PhysicalProfile := SimilarityProfile.pullback h (-2 * CoordinateAlgebra.A h) (d.pressure 0) theorem exterior_swirl_derivative {a : ℕ → ℕ} (ha : StrictMono a) {h C R : ℝ} @@ -807,7 +807,7 @@ primitive of the angular coefficient. Their curl is identified here with the finite slow field, using the actual radial flux formula and FTC. -/ -@[expose] public section +public section noncomputable section @@ -1211,7 +1211,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1723,16 +1723,16 @@ variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) noncomputable def activeLeft : ℝ := Real.log (nominalInner W / 16) /-- Terminal shift, given by `TerminalHistoryBridge.shift F W.controls.radius`. -/ -noncomputable def terminalShift : ℝ := TerminalHistoryBridge.shift F W.controls.radius +@[expose] noncomputable def terminalShift : ℝ := TerminalHistoryBridge.shift F W.controls.radius /-- Active right, given by `terminalShift W + 3`. -/ -noncomputable def activeRight : ℝ := terminalShift W + 3 +@[expose] noncomputable def activeRight : ℝ := terminalShift W + 3 /-- Active upper, given by `Real.exp (activeRight W)`. -/ -noncomputable def activeUpper : ℝ := Real.exp (activeRight W) +@[expose] noncomputable def activeUpper : ℝ := Real.exp (activeRight W) /-- Scale upper, given by `max upper (activeUpper W)`. -/ -noncomputable def scaleUpper (upper : ℝ) : ℝ := max upper (activeUpper W) +@[expose] noncomputable def scaleUpper (upper : ℝ) : ℝ := max upper (activeUpper W) theorem exp_activeLeft : Real.exp (activeLeft W) = nominalInner W / 16 := Real.exp_log (div_pos (nominalInner_pos W) (by norm_num)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CoordinateAlgebra.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CoordinateAlgebra.lean index c3de282bcb..bcd452ffa6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CoordinateAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CoordinateAlgebra.lean @@ -16,7 +16,7 @@ smooth inverse coordinate chart, a Navier--Stokes solution, or a singularity. `q ^ b` below denotes the real power, while `η ^ 2` is a natural power. -/ -@[expose] public section +public section namespace NavierStokes.CoordinateAlgebra @@ -24,12 +24,13 @@ namespace NavierStokes.CoordinateAlgebra noncomputable section /-- A, given by `1 / 2 + h`. -/ -def A (h : ℝ) : ℝ := 1 / 2 + h +@[expose] def A (h : ℝ) : ℝ := 1 / 2 + h /-- D, given by `1 / 2 - h`. -/ -def D (h : ℝ) : ℝ := 1 / 2 - h +@[expose] def D (h : ℝ) : ℝ := 1 / 2 - h /-- D, given by `1 - η ^ 2`. -/ -def d (η : ℝ) : ℝ := 1 - η ^ 2 +@[expose] def d (η : ℝ) : ℝ := 1 - η ^ 2 /-- L, given by `1 - 2 * h * η ^ 2`. -/ +@[expose] def L (h η : ℝ) : ℝ := 1 - 2 * h * η ^ 2 theorem A_add_D (h : ℝ) : A h + D h = 1 := by @@ -148,17 +149,17 @@ theorem rates_unique {q h η q' η' τ' z' : ℝ} (hq : 0 < q) exact (inverseEta_recover hq hL q' η').symm /-- Q time, given by `-1 / L h η`. -/ -def qTime (h η : ℝ) : ℝ := -1 / L h η +@[expose] def qTime (h η : ℝ) : ℝ := -1 / L h η /-- Eta time, given by `D h * η / (q * L h η)`. -/ -def etaTime (q h η : ℝ) : ℝ := D h * η / (q * L h η) +@[expose] def etaTime (q h η : ℝ) : ℝ := D h * η / (q * L h η) /-- X time, given by `X / (q * L h η)`. -/ -def xTime (q h η X : ℝ) : ℝ := X / (q * L h η) +@[expose] def xTime (q h η X : ℝ) : ℝ := X / (q * L h η) /-- Q axial, given by `2 * η * q / (q ^ D h * L h η)`. -/ -def qAxial (q h η : ℝ) : ℝ := 2 * η * q / (q ^ D h * L h η) +@[expose] def qAxial (q h η : ℝ) : ℝ := 2 * η * q / (q ^ D h * L h η) /-- Eta axial, given by `d η / (q ^ D h * L h η)`. -/ -def etaAxial (q h η : ℝ) : ℝ := d η / (q ^ D h * L h η) +@[expose] def etaAxial (q h η : ℝ) : ℝ := d η / (q ^ D h * L h η) /-- X axial, given by `-2 * η * X / (q ^ D h * L h η)`. -/ -def xAxial (q h η X : ℝ) : ℝ := -2 * η * X / (q ^ D h * L h η) +@[expose] def xAxial (q h η X : ℝ) : ℝ := -2 * η * X / (q ^ D h * L h η) theorem time_rates (q h η : ℝ) : inverseQ q h η (-1) 0 = qTime h η ∧ @@ -195,11 +196,11 @@ theorem xAxial_from_qAxial {q : ℝ} (hq : q ≠ 0) (h η X : ℝ) : field_simp [hq, hL, hp] /-- The `T_b` coefficient in equation (4), at a profile jet `(F,FX,Fη)`. -/ -def timeCoeff (b h η X F FX Fη : ℝ) : ℝ := +@[expose] def timeCoeff (b h η X F FX Fη : ℝ) : ℝ := (-b * F + D h * η * Fη + X * FX) / L h η /-- The `Z_b` coefficient in equation (4), at a profile jet `(F,FX,Fη)`. -/ -def axialCoeff (b h η X F FX Fη : ℝ) : ℝ := +@[expose] def axialCoeff (b h η X F FX Fη : ℝ) : ℝ := (2 * η * b * F + d η * Fη - 2 * η * X * FX) / L h η /-- Product/chain-rule expression for the time derivative of `q^b F(X,η)`. diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CopyAngularInvariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CopyAngularInvariance.lean index b5b0d79c6f..54c2a4faed 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CopyAngularInvariance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CopyAngularInvariance.lean @@ -19,7 +19,7 @@ its pressure, and the stripped cylindrical curl inherit those identities. The oscillatory carrier retains its separate angular character. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ open CommonCoverSolve TorusInverse variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Invariant, given by `∀ (x : D) (t : ℝ), f (x + t • θ) = f x`. -/ -noncomputable def Invariant (θ : D) {E : Type} (f : D → E) : Prop := +@[expose] noncomputable def Invariant (θ : D) {E : Type} (f : D → E) : Prop := ∀ (x : D) (t : ℝ), f (x + t • θ) = f x /-- Affine phase, given by `∀ (x : D) (t : ℝ), Φ (x + t • θ) = Φ x + m * t`. -/ @@ -240,6 +240,7 @@ theorem TangentInvariant.copySolve_invariant {θ : P} {d : TangentData P H} (h : h.coefficient h.forcingMap h.source j /-- Copy native point, given by `(x.1, g.coordinates j x.2)`. -/ +@[expose] noncomputable def copyNativePoint (g : Geometry) (j : Frequency) (x : P × Plane) : P × Plane := (x.1, g.coordinates j x.2) @@ -254,14 +255,14 @@ theorem native_invariant {F : Type} {θ : P} {f : P × Plane → F} /-- Same scalar formula as the particular-wave pressure, evaluated on the constructed copy solve and the actual source at the current common point. -/ -noncomputable def copyPressureReal (d : TangentData P H) (g : Geometry) (hab : a ≤ b) +@[expose] noncomputable def copyPressureReal (d : TangentData P H) (g : Geometry) (hab : a ≤ b) (j : Frequency) (x : P × Plane) : ℝ := TangentProjection.pressureCoefficient (d.normal (copyNativePoint g j x)) (d.normalDot (copyNativePoint g j x)) (d.linearData.copySolve g hab j x) (d.action (copyNativePoint g j x) (d.linearData.copySolve g hab j x)) (d.source x) /-- Copy pressure, given by `Complex.I * (copyPressureReal d g hab j x : ℂ) / (K : ℂ)`. -/ -noncomputable def copyPressure (d : TangentData P H) (g : Geometry) (hab : a ≤ b) +@[expose] noncomputable def copyPressure (d : TangentData P H) (g : Geometry) (hab : a ≤ b) (j : Frequency) (K : ℝ) (x : P × Plane) : ℂ := Complex.I * (copyPressureReal d g hab j x : ℂ) / (K : ℂ) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CopySolveCompatibility.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CopySolveCompatibility.lean index 76a5138664..842d03b7f3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CopySolveCompatibility.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CopySolveCompatibility.lean @@ -17,7 +17,7 @@ actual coefficient/forcing paths and then for the constructed Volterra inverse; no native periodicity of an inhomogeneous solution is assumed. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ theorem coverPower_add (d k : ℕ) (Y : Plane) : simp only [coverPower_apply, pow_add, _root_.mul_apply_eq_comp] /-- Refine geometry, given by `{ g with gap := g.gap + k }`. -/ -noncomputable def refineGeometry (g : Geometry) (k : ℕ) : Geometry := +@[expose] noncomputable def refineGeometry (g : Geometry) (k : ℕ) : Geometry := { g with gap := g.gap + k } theorem coordinates_refine (g : Geometry) (k : ℕ) (j : Frequency) (Y : Plane) : @@ -75,14 +75,14 @@ variable {P Q V E : Type} /-- Input data transported through a slow-parameter map and a refinement of the common cover. All native coefficients retain their native arguments. -/ -noncomputable def transformData (d : LinearData P V E) (φ : Q → P) (k : ℕ) : +@[expose] noncomputable def transformData (d : LinearData P V E) (φ : Q → P) (k : ℕ) : LinearData Q V E where coefficient z := d.coefficient (φ z.1, z.2) forcingMap z := d.forcingMap (φ z.1, z.2) source z := d.source (φ z.1, coverPower k z.2) /-- Pullback data, given by `transformData d id k`. -/ -noncomputable def pullbackData (d : LinearData P V E) (k : ℕ) : LinearData P V E := +@[expose] noncomputable def pullbackData (d : LinearData P V E) (k : ℕ) : LinearData P V E := transformData d id k theorem coefficientAlong_transform (d : LinearData P V E) (φ : Q → P) @@ -184,8 +184,13 @@ theorem commonOnTorus_refine (pullbackData d k).commonOnTorus (refineGeometry g k) hab κ p (source_periodic_transform d id k p hp) (TorusAverages.quotientPoint Y) = d.commonOnTorus g hab κ p hp (TorusAverages.quotientPoint (coverPower k Y)) := by - simp only [LinearData.commonOnTorus_coe] - exact commonSolve_refine d g hab k κ p Y + calc + _ = (pullbackData d k).commonSolve (refineGeometry g k) hab κ (p, Y) := + LinearData.commonOnTorus_coe (pullbackData d k) (refineGeometry g k) hab κ p + (source_periodic_transform d id k p hp) Y + _ = d.commonSolve g hab κ (p, coverPower k Y) := + commonSolve_refine d g hab k κ p Y + _ = _ := (LinearData.commonOnTorus_coe d g hab κ p hp (coverPower k Y)).symm end Paths @@ -266,7 +271,7 @@ variable {P V E : Type} {a b : ℝ} /-- Scale source, given by `{ d with source := fun x => c • d.source x }`. -/ -noncomputable def scaleSource (d : LinearData P V E) (c : ℝ) : LinearData P V E := +@[expose] noncomputable def scaleSource (d : LinearData P V E) (c : ℝ) : LinearData P V E := { d with source := fun x => c • d.source x } omit [CompleteSpace E] in @@ -346,13 +351,14 @@ end SourceScale /-! ## Transporting the native clock, its anchor, and its cutoff together -/ /-- Native time map, given by `(z.1, τ + rate * z.2)`. -/ -noncomputable def nativeTimeMap (τ rate : ℝ) (z : Plane) : Plane := +@[expose] noncomputable def nativeTimeMap (τ rate : ℝ) (z : Plane) : Plane := (z.1, τ + rate * z.2) theorem nativeTimeMap_continuous (τ rate : ℝ) : Continuous (nativeTimeMap τ rate) := continuous_fst.prodMk (continuous_const.add (continuous_const.mul continuous_snd)) /-- Time geometry, bundling `gap`, `basis`, `center`. -/ +@[expose] noncomputable def timeGeometry (g : Geometry) (τ rate : ℝ) (hrate : rate ≠ 0) : Geometry where gap := g.gap basis := CommonCoverClass.scaledBasis g.basis rate hrate @@ -523,11 +529,12 @@ variable {P Q V E X I : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- Transport data, given by `scaleSource (transformData (timeData d τ rate) φ k) amplitude`. -/ -noncomputable def transportData (d : LinearData P V E) (φ : Q → P) (k : ℕ) +@[expose] noncomputable def transportData (d : LinearData P V E) (φ : Q → P) (k : ℕ) (τ rate amplitude : ℝ) : LinearData Q V E := scaleSource (transformData (timeData d τ rate) φ k) amplitude /-- Transport geometry, given by `refineGeometry (timeGeometry g τ rate hrate) k`. -/ +@[expose] noncomputable def transportGeometry (g : Geometry) (k : ℕ) (τ rate : ℝ) (hrate : rate ≠ 0) : Geometry := refineGeometry (timeGeometry g τ rate hrate) k diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectedPulseAmplitude.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectedPulseAmplitude.lean index 6e7061a842..46aee155fd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectedPulseAmplitude.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectedPulseAmplitude.lean @@ -31,7 +31,7 @@ the actual energy difference, proves its parameter regularity, and uses the constructed reset's small coefficients to bound that difference. -/ -@[expose] public section +public section noncomputable section @@ -505,7 +505,7 @@ end end -@[expose] public section +public section noncomputable section @@ -518,11 +518,11 @@ namespace NavierStokes.CorrectedPulseAmplitude /-- Energy integrand, given by `Real.exp y * (axial d.core (fun _ => A) (y, eta) ^ 2 - correctedAngular d c (y, eta) ^ 2 / 2)`. -/ -def energyIntegrand (d : TailData) (c : ℝ → Coeff) (A eta y : ℝ) : ℝ := +@[expose] def energyIntegrand (d : TailData) (c : ℝ → Coeff) (A eta y : ℝ) : ℝ := Real.exp y * (axial d.core (fun _ => A) (y, eta) ^ 2 - correctedAngular d c (y, eta) ^ 2 / 2) /-- Total energy, given by `∫ y, energyIntegrand d c A eta y`. -/ -def totalEnergy (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : ℝ := +@[expose] def totalEnergy (d : TailData) (c : ℝ → Coeff) (A eta : ℝ) : ℝ := ∫ y, energyIntegrand d c A eta y theorem energyIntegrand_eq (d : TailData) (c : ℝ → Coeff) (A eta y : ℝ) : @@ -647,7 +647,7 @@ theorem amplitude_totalEnergy_zero (d : TailData) (c : ℝ → Coeff) (eta : ℝ def combinedConstant (P m K : ℝ) : ℝ := PulseAmplitude.errorConstant P m + 36 * K + 1 /-- Combined scale, given by `combinedConstant d.core.P d.core.m K * PulseAmplitude.logarithmicRate d.core.lam`. -/ -def combinedScale (d : TailData) (K : ℝ) : ℝ := +@[expose] def combinedScale (d : TailData) (K : ℝ) : ℝ := combinedConstant d.core.P d.core.m K * PulseAmplitude.logarithmicRate d.core.lam theorem combinedConstant_pos {P : ℝ} (hP : 0 < P) (m K : ℝ) (hK : 0 < K) : @@ -867,6 +867,7 @@ theorem realized_energy_eq (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : /-- Radial energy integrand, given by `axial d.core amp (Real.log (X / XR), eta) ^ 2 - correctedAngular d c (Real.log (X / XR), eta) ^ 2 / 2`. -/ +@[expose] def radialEnergyIntegrand (d : TailData) (c : ℝ → Coeff) (amp : ℝ → ℝ) (eta XR X : ℝ) : ℝ := axial d.core amp (Real.log (X / XR), eta) ^ 2 - correctedAngular d c (Real.log (X / XR), eta) ^ 2 / 2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionAnalyticStep.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionAnalyticStep.lean index 41993e2e69..54a30a86e4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionAnalyticStep.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionAnalyticStep.lean @@ -31,7 +31,7 @@ its literal difference and its radial divergence. The composition below has no `SignedMeanGain.NativeData` input. -/ -@[expose] public section +public section noncomputable section @@ -795,7 +795,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionInitialization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionInitialization.lean index 19da18b491..54fe72d7dd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionInitialization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionInitialization.lean @@ -22,7 +22,7 @@ the squared partition. Quantitative initialization is assembled below from the estimates on these same operations. -/ -@[expose] public section +public section noncomputable section @@ -108,7 +108,7 @@ structure PrimaryPiece (X : Type) [NormedAddCommGroup X] [NormedSpace ℝ X] whe namespace PrimaryPiece /-- Exact coefficients, given by `p.coefficients.corrected p.strip p.directions p.cutoff`. -/ -noncomputable def exactCoefficients (p : PrimaryPiece X) : WaveCoefficients X := +@[expose] noncomputable def exactCoefficients (p : PrimaryPiece X) : WaveCoefficients X := p.coefficients.corrected p.strip p.directions p.cutoff /-- Velocity, defined pointwise by `(vectorMode (p.coefficients.frequency n) @@ -125,17 +125,17 @@ noncomputable def tangentVelocity (p : PrimaryPiece X) : ℕ → X → Fin 3 → /-- Pressure, defined pointwise by `(mode (p.coefficients.frequency n) (p.coefficients.phase n) (p.exactCoefficients.pressure n) x).re`. -/ -noncomputable def pressure (p : PrimaryPiece X) : ℕ → X → ℝ := +@[expose] noncomputable def pressure (p : PrimaryPiece X) : ℕ → X → ℝ := fun n x => (mode (p.coefficients.frequency n) (p.coefficients.phase n) (p.exactCoefficients.pressure n) x).re /-- Excluded as an element of `ℕ → X → Fin 3 → ℝ`. -/ -noncomputable def excluded (p : PrimaryPiece X) : ℕ → X → Fin 3 → ℝ := +@[expose] noncomputable def excluded (p : PrimaryPiece X) : ℕ → X → Fin 3 → ℝ := fun n x i => (vectorMode (p.coefficients.frequency n) (p.coefficients.phase n) (excludedSlotError p.directions p.cutoff p.coefficients.amplitude 0 n) x i).re /-- Linear good, given by `p.coefficients.constructedGood p.strip p.directions p.cutoff`. -/ -noncomputable def linearGood (p : PrimaryPiece X) : ℕ → X → ComplexVector := +@[expose] noncomputable def linearGood (p : PrimaryPiece X) : ℕ → X → ComplexVector := p.coefficients.constructedGood p.strip p.directions p.cutoff /-- Linear good field, defined pointwise by `(vectorMode (p.coefficients.frequency n) @@ -1132,7 +1132,7 @@ noncomputable def seed (labels : Finset ι) (pieces : ι → PrimaryPiece (D × /-- The active labels may depend on the chart band. No bound on their total cardinality is inserted into the construction or its class estimates. -/ -noncomputable def bandSeed (labels : ℕ → Finset ι) (pieces : ι → PrimaryPiece (D × ℝ)) +@[expose] noncomputable def bandSeed (labels : ℕ → Finset ι) (pieces : ι → PrimaryPiece (D × ℝ)) (baseError : Oscillation D) : State D where mean := ⟨0, 0, 0⟩ pressure := 0 @@ -1321,6 +1321,7 @@ noncomputable def afterRank (g : GaugeData S) (r : RankData S) (h : ℝ) (index /-- Retain pressure alias, given by `{ u with errors := ⟨u.errors.base, u.errors.gaussian, u.errors.aliasError + pressureAliasState g c u⟩ }`. -/ +@[expose] noncomputable def retainPressureAlias (g : GaugeData S) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : State (PressureStream.Lift S) := { u with errors := ⟨u.errors.base, u.errors.gaussian, @@ -1386,7 +1387,7 @@ open VariableGaugeMean variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] {ι : Type} /-- Primary bands, given by `reconstructState g c (bandSeed labels pieces baseError)`. -/ -noncomputable def primaryBands (g : GaugeData S) (c : Context (PressureStream.Lift S)) +@[expose] noncomputable def primaryBands (g : GaugeData S) (c : Context (PressureStream.Lift S)) (labels : ℕ → Finset ι) (pieces : ι → PrimaryPiece (PressureStream.Lift S × ℝ)) (baseError : Oscillation (PressureStream.Lift S)) : State (PressureStream.Lift S) := reconstructState g c (bandSeed labels pieces baseError) @@ -1409,6 +1410,7 @@ noncomputable def rankBands (g : GaugeData S) (r : RankData S) (h : ℝ) (index /-- Initialized bands, given by `retainPressureAlias g c (rankBands g r h index axial c labels pieces baseError)`. -/ +@[expose] noncomputable def initializedBands (g : GaugeData S) (r : RankData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : Context (PressureStream.Lift S)) (labels : ℕ → Finset ι) (pieces : ι → PrimaryPiece (PressureStream.Lift S × ℝ)) @@ -1693,7 +1695,7 @@ open WeightedClasses HarmonicFields variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- A primary mode and its pressure, with the actual conjugate negative mode. -/ -noncomputable def block (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) +@[expose] noncomputable def block (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D where velocity n i := ErrorHarmonics.conjugatePair 1 (fun x => a.amplitude n (x, 0) i) pressure n := ErrorHarmonics.conjugatePair 1 (fun x => a.pressure n (x, 0)) @@ -1785,7 +1787,7 @@ variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] namespace PrimaryPiece /-- Harmonic block, given by `PrimaryHarmonics.block p.exactCoefficients Φ kp`. -/ -noncomputable def harmonicBlock (p : PrimaryPiece (D × ℝ)) +@[expose] noncomputable def harmonicBlock (p : PrimaryPiece (D × ℝ)) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := PrimaryHarmonics.block p.exactCoefficients Φ kp @@ -3931,7 +3933,7 @@ namespace CommonWindow open Set Function /-- Levels, given by `insert n (Finset.Icc (max 1 (n - 2)) (n + 2))`. -/ -@[irreducible] noncomputable def levels (n : ℕ) : Finset ℕ := +@[expose, irreducible] noncomputable def levels (n : ℕ) : Finset ℕ := insert n (Finset.Icc (max 1 (n - 2)) (n + 2)) theorem self_mem (n : ℕ) : n ∈ levels n := by @@ -4216,23 +4218,24 @@ noncomputable def position (L : Label B N0) (p : PhaseCalculus.Slow) : SlotColor /-- Similarity scale, given by `ChartScales.Q (BaseChartJets.cellBand L) * SimilarityCoordinates.coordinateQ (2 * h) (p.2.2, p.2.1)`. -/ -noncomputable def similarityScale (L : Label B N0) (p : PhaseCalculus.Slow) : ℝ := +@[expose] noncomputable def similarityScale (L : Label B N0) (p : PhaseCalculus.Slow) : ℝ := ChartScales.Q (BaseChartJets.cellBand L) * SimilarityCoordinates.coordinateQ (2 * h) (p.2.2, p.2.1) /-- Spatial mask, given by `PartitionedCovariance.mask (CoordinateAlgebra.D h) (PrimaryGeometryAssembly.label nominal L) (similarityScale L p) (position L p)`. -/ -noncomputable def spatialMask (L : Label B N0) (p : PhaseCalculus.Slow) : ℝ := +@[expose] noncomputable def spatialMask (L : Label B N0) (p : PhaseCalculus.Slow) : ℝ := PartitionedCovariance.mask (CoordinateAlgebra.D h) (PrimaryGeometryAssembly.label nominal L) (similarityScale L p) (position L p) /-- Pulse coordinates, given by `(x.1, x.2.2 / (phases B N0 0).L L)`. -/ +@[expose] noncomputable def pulseCoordinates (L : Label B N0) (x : PhaseCalculus.Slow × TorusInverse.Plane) : PhaseCalculus.Slow × ℝ := (x.1, x.2.2 / (phases B N0 0).L L) /-- Raw velocity, constructed using `PartitionedCovariance.amplitude`. -/ -noncomputable def rawVelocity (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def rawVelocity (j : Fin 2) (L : Label B N0) (x : PhaseCalculus.Slow × TorusInverse.Plane) : ProblemStatement.Space := PartitionedCovariance.amplitude (ChartScales.epsilon h (BaseChartJets.cellBand L)) (spatialMask L x.1 * PartitionedCovariance.cutoff slots.radius x.2.1) @@ -4241,15 +4244,17 @@ noncomputable def rawVelocity (j : Fin 2) (L : Label B N0) ((phases B N0 j).u L) ((phases B N0 j).L L) (pulseCoordinates L x) /-- Gaussian, given by `GaussianTailFlat.profile (pulseCoordinates L x).2`. -/ +@[expose] noncomputable def gaussian (L : Label B N0) (x : PhaseCalculus.Slow × TorusInverse.Plane) : ℝ := GaussianTailFlat.profile (pulseCoordinates L x).2 /-- Cut velocity, given by `gaussian L x • rawVelocity j L x`. -/ -noncomputable def cutVelocity (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def cutVelocity (j : Fin 2) (L : Label B N0) (x : PhaseCalculus.Slow × TorusInverse.Plane) : ProblemStatement.Space := gaussian L x • rawVelocity j L x /-- Phase point, given by `(x.1, x.2.2)`. -/ +@[expose] noncomputable def phasePoint (_L : Label B N0) (x : PhaseCalculus.Slow × TorusInverse.Plane) : PhaseCalculus.Slow × ℝ := (x.1, x.2.2) @@ -4270,7 +4275,7 @@ noncomputable def cutPressure (j : Fin 2) (L : Label B N0) gaussian L x • rawPressure j L x /-- Geometry, bundling `gap`, `basis`, `center`. -/ -noncomputable def geometry (j : Fin 2) (L : Label B N0) : CommonCoverSolve.Geometry where +@[expose] noncomputable def geometry (j : Fin 2) (L : Label B N0) : CommonCoverSolve.Geometry where gap := ChartScales.nativeIndex h (BaseChartJets.cellBand L) basis := (TorusAverages.transverseChart (ChartScales.timeCoefficient h (BaseChartJets.cellBand L)) (ChartScales.timeCoefficient_pos h (BaseChartJets.cellBand L)).ne').trans @@ -4287,7 +4292,7 @@ noncomputable def clockWindow (L : Label B N0) : PeriodicPhaseAssembly.ClockWind padding_pos := div_pos (lt_min slots.radius_pos ((phases B N0 0).L_pos L)) (by norm_num) /-- Periodic phase as an element of `ℝ`. -/ -noncomputable def periodicPhase (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def periodicPhase (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) (Y : TorusInverse.Plane) : ℝ := (phases B N0 j).phase.pz L / (phases B N0 j).phase.epsilon L * p.2.1 + (phases B N0 j).phase.x0 L * p.1 - @@ -4449,7 +4454,7 @@ variable {B N0 : ℕ} /-- Common amplitude, given by `∑' k : TorusInverse.Frequency, CurlClassBounds.complexify (cutVelocity j L (p, (geometry j L).coordinates k Y))`. -/ -noncomputable def commonAmplitude (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def commonAmplitude (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) (Y : TorusInverse.Plane) : HarmonicCalculus.ComplexVector := ∑' k : TorusInverse.Frequency, CurlClassBounds.complexify (cutVelocity j L (p, (geometry j L).coordinates k Y)) @@ -4522,11 +4527,12 @@ end AmplitudeIdentity /-- Common context, given by `CommonBaseContext.context certificate modulation upper B (CommonWindow.index h)`. -/ +@[expose] noncomputable def commonContext (B : ℕ) : CorrectionState.Context LocalSignedRequest.Point := CommonBaseContext.context certificate modulation upper B (CommonWindow.index h) /-- Common gauge, bundling `radial`, `length`. -/ -noncomputable def commonGauge : VariableGaugeMean.GaugeData TorusInverse.Plane where +@[expose] noncomputable def commonGauge : VariableGaugeMean.GaugeData TorusInverse.Plane where radial := CommonBaseContext.reconstruction h (CommonWindow.index h) (PrimaryTargetBounds.leftRadius nominal) (PrimaryTargetBounds.rightRadius nominal) (PrimaryTargetBounds.radii_ordered nominal) @@ -4915,7 +4921,7 @@ open PartitionedCovariance PrimaryFieldAssembly variable {B N0 : ℕ} /-- Tangent mode as an element of `Fin 3 → ℝ`. -/ -noncomputable def tangentMode (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) +@[expose] noncomputable def tangentMode (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) (Y : TorusInverse.Plane) (theta : ℝ) : Fin 3 → ℝ := fun i => (HarmonicCalculus.vectorMode 1 (fun z : TorusInverse.Plane × ℝ => @@ -5066,13 +5072,13 @@ open scoped ContDiff Topology abbrev AbsolutePoint := PhaseCalculus.Slow × TorusInverse.Plane /-- To absolute as an element of `AbsolutePoint`. -/ -noncomputable def toAbsolute (n : ℕ) (x : LocalSignedRequest.Point) : AbsolutePoint := +@[expose] noncomputable def toAbsolute (n : ℕ) (x : LocalSignedRequest.Point) : AbsolutePoint := ((Real.sqrt (ChartScales.Q n) * x.1, (ChartScales.Q n ^ CoordinateAlgebra.D h * x.2.1.2, ChartScales.Q n * x.2.1.1)), (CommonCoverSolve.coverPower (CommonWindow.index h n)).symm x.2.2) /-- From absolute as an element of `LocalSignedRequest.Point`. -/ -noncomputable def fromAbsolute (n : ℕ) (x : AbsolutePoint) : LocalSignedRequest.Point := +@[expose] noncomputable def fromAbsolute (n : ℕ) (x : AbsolutePoint) : LocalSignedRequest.Point := (x.1.1 / Real.sqrt (ChartScales.Q n), ((x.1.2.2 / ChartScales.Q n, x.1.2.1 / ChartScales.Q n ^ CoordinateAlgebra.D h), CommonCoverSolve.coverPower (CommonWindow.index h n) x.2)) @@ -5110,6 +5116,7 @@ variable {B N0 : ℕ} /-- Chart geometry, given by `{ geometry j L with gap := ChartScales.nativeIndex h (BaseChartJets.cellBand L) - CommonWindow.index h n }`. -/ +@[expose] noncomputable def chartGeometry (n : ℕ) (j : Fin 2) (L : Label B N0) : CommonCoverSolve.Geometry := { geometry j L with gap := ChartScales.nativeIndex h (BaseChartJets.cellBand L) - CommonWindow.index h n } @@ -5144,25 +5151,26 @@ variable {B N0 : ℕ} /-- Outer raw velocity, given by `PrimaryCopyBounds.outerCutoff (pulseCoordinates L x).2 • rawVelocity j L x`. -/ -noncomputable def outerRawVelocity (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def outerRawVelocity (j : Fin 2) (L : Label B N0) (x : ActualSignedGeometry.Native) : ProblemStatement.Space := PrimaryCopyBounds.outerCutoff (pulseCoordinates L x).2 • rawVelocity j L x /-- Attached raw velocity, given by `WaveEdgeExtension.nativeExtension nominal (outerRawVelocity j L)`. -/ -noncomputable def attachedRawVelocity (j : Fin 2) (L : Label B N0) : +@[expose] noncomputable def attachedRawVelocity (j : Fin 2) (L : Label B N0) : ActualSignedGeometry.Native → ProblemStatement.Space := WaveEdgeExtension.nativeExtension nominal (outerRawVelocity j L) /-- Uncut amplitude, given by `∑' k : TorusInverse.Frequency, CurlClassBounds.complexify (attachedRawVelocity j L (p, (geometry j L).coordinates k Y))`. -/ -noncomputable def uncutAmplitude (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def uncutAmplitude (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) (Y : TorusInverse.Plane) : HarmonicCalculus.ComplexVector := ∑' k : TorusInverse.Frequency, CurlClassBounds.complexify (attachedRawVelocity j L (p, (geometry j L).coordinates k Y)) /-- Periodic gaussian, given by `GaussianTailFlat.profile (PeriodicPhaseAssembly.periodicClock (geometry j L) (clockWindow L).cutoff Y / (phases B N0 0).L L)`. -/ +@[expose] noncomputable def periodicGaussian (j : Fin 2) (L : Label B N0) (Y : TorusInverse.Plane) : ℝ := GaussianTailFlat.profile (PeriodicPhaseAssembly.periodicClock (geometry j L) (clockWindow L).cutoff Y / (phases B N0 @@ -5271,19 +5279,19 @@ theorem periodic_cutoff_amplitude (j : Fin 2) (L : Label B N0) (p : PhaseCalculu /-- Outer raw pressure, given by `PrimaryCopyBounds.outerCutoff (pulseCoordinates L x).2 • rawPressure j L x`. -/ -noncomputable def outerRawPressure (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def outerRawPressure (j : Fin 2) (L : Label B N0) (x : ActualSignedGeometry.Native) : ℂ := PrimaryCopyBounds.outerCutoff (pulseCoordinates L x).2 • rawPressure j L x /-- Attached raw pressure, given by `WaveEdgeExtension.nativeExtension nominal (outerRawPressure j L)`. -/ -noncomputable def attachedRawPressure (j : Fin 2) (L : Label B N0) : +@[expose] noncomputable def attachedRawPressure (j : Fin 2) (L : Label B N0) : ActualSignedGeometry.Native → ℂ := WaveEdgeExtension.nativeExtension nominal (outerRawPressure j L) /-- Uncut pressure, given by `∑' k : TorusInverse.Frequency, attachedRawPressure j L (p, (geometry j L).coordinates k Y)`. -/ -noncomputable def uncutPressure (j : Fin 2) (L : Label B N0) +@[expose] noncomputable def uncutPressure (j : Fin 2) (L : Label B N0) (p : PhaseCalculus.Slow) (Y : TorusInverse.Plane) : ℂ := ∑' k : TorusInverse.Frequency, attachedRawPressure j L (p, (geometry j L).coordinates k Y) @@ -5525,7 +5533,7 @@ variable {B N0 : ℕ} /-- Standard region, given by `ActualSignedGeometry.standardSlowRegion outgoing.data.h_pos outgoing.data.h_lt_half`. -/ -noncomputable def standardRegion : LocalSignedRequest.SlowRegion (2 * h) := +@[expose] noncomputable def standardRegion : LocalSignedRequest.SlowRegion (2 * h) := ActualSignedGeometry.standardSlowRegion outgoing.data.h_pos outgoing.data.h_lt_half /-- Physical position, given by `![Real.sqrt (ChartScales.Q n) * x.1, ChartScales.Q n ^ @@ -5623,7 +5631,7 @@ variable {B N0 : ℕ} abbrev FullPoint := LocalSignedRequest.Point × ℝ /-- Native slow as an element of `PhaseCalculus.Slow`. -/ -noncomputable def nativeSlow (L : Label B N0) (x : AbsolutePoint) : PhaseCalculus.Slow := +@[expose] noncomputable def nativeSlow (L : Label B N0) (x : AbsolutePoint) : PhaseCalculus.Slow := (x.1.1 / Real.sqrt (ChartScales.Q (BaseChartJets.cellBand L)), (x.1.2.1 / ChartScales.Q (BaseChartJets.cellBand L) ^ CoordinateAlgebra.D h, x.1.2.2 / ChartScales.Q (BaseChartJets.cellBand L))) @@ -5643,18 +5651,19 @@ theorem nativeSlow_toAbsolute (L : Label B N0) (x : LocalSignedRequest.Point) : /-- Absolute amplitude, given by `ChartScales.Q (BaseChartJets.cellBand L) ^ (-CoordinateAlgebra.A h) • uncutAmplitude j L (nativeSlow L x) x.2`. -/ -noncomputable def absoluteAmplitude (j : Fin 2) (L : Label B N0) (x : AbsolutePoint) : +@[expose] noncomputable def absoluteAmplitude (j : Fin 2) (L : Label B N0) (x : AbsolutePoint) : HarmonicCalculus.ComplexVector := ChartScales.Q (BaseChartJets.cellBand L) ^ (-CoordinateAlgebra.A h) • uncutAmplitude j L (nativeSlow L x) x.2 /-- Absolute pressure, given by `ChartScales.Q (BaseChartJets.cellBand L) ^ (-(2 * CoordinateAlgebra.A h)) • uncutPressure j L (nativeSlow L x) x.2`. -/ -noncomputable def absolutePressure (j : Fin 2) (L : Label B N0) (x : AbsolutePoint) : ℂ := +@[expose] noncomputable def absolutePressure (j : Fin 2) (L : Label B N0) (x : AbsolutePoint) : ℂ := ChartScales.Q (BaseChartJets.cellBand L) ^ (-(2 * CoordinateAlgebra.A h)) • uncutPressure j L (nativeSlow L x) x.2 /-- Absolute phase as an element of `ℝ`. -/ +@[expose] noncomputable def absolutePhase (j : Fin 2) (L : Label B N0) (x : AbsolutePoint × ℝ) : ℝ := (PrimaryGeometryAssembly.angularMode certificate modulation (choice B N0).prepared j L : ℝ) * x.2 + @@ -5662,7 +5671,7 @@ noncomputable def absolutePhase (j : Fin 2) (L : Label B N0) (x : AbsolutePoint /-- Chart coefficients, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ -noncomputable def chartCoefficients (j : Fin 2) (L : Label B N0) : +@[expose] noncomputable def chartCoefficients (j : Fin 2) (L : Label B N0) : LinearWaveBounds.WaveCoefficients FullPoint where radius _ x := x.1.1 radialBase n x := BaseContextAssembly.radialBase certificate modulation upper B n x.1 @@ -5676,10 +5685,11 @@ noncomputable def chartCoefficients (j : Fin 2) (L : Label B N0) : frequency n := (ChartScales.carrier h n : ℝ) /-- Chart cutoff, given by `periodicGaussian j L (toAbsolute n x.1).2`. -/ -noncomputable def chartCutoff (j : Fin 2) (L : Label B N0) (n : ℕ) (x : FullPoint) : ℝ := +@[expose] noncomputable def chartCutoff (j : Fin 2) (L : Label B N0) (n : ℕ) (x : FullPoint) : ℝ := periodicGaussian j L (toAbsolute n x.1).2 /-- Piece, bundling `strip`, `directions`, `coefficients`, `cutoff`. -/ +@[expose] noncomputable def piece (U : LocalSignedRequest.SlowRegion (2 * h)) (j : Fin 2) (L : Label B N0) : PrimaryPiece FullPoint where strip := HarmonicWaveInteraction.productStrip (BaseContextAssembly.nativeStrip nominal U) @@ -5752,6 +5762,7 @@ theorem chartCoefficients_carrier (j : Fin 2) (L : Label B N0) (n : ℕ) (x : Fu /-- Absolute tangent, defined pointwise by `(HarmonicCalculus.vectorMode 1 (absolutePhase j L) (fun z => periodicGaussian j L z.1.2 • absoluteAmplitude j L z.1) x i).re`. -/ +@[expose] noncomputable def absoluteTangent (j : Fin 2) (L : Label B N0) (x : AbsolutePoint × ℝ) : Fin 3 → ℝ := fun i => (HarmonicCalculus.vectorMode 1 (absolutePhase j L) @@ -5759,6 +5770,7 @@ noncomputable def absoluteTangent (j : Fin 2) (L : Label B N0) (x : AbsolutePoin /-- Absolute pressure mode, given by `(HarmonicCalculus.mode 1 (absolutePhase j L) (fun z => periodicGaussian j L z.1.2 • absolutePressure j L z.1) x).re`. -/ +@[expose] noncomputable def absolutePressureMode (j : Fin 2) (L : Label B N0) (x : AbsolutePoint × ℝ) : ℝ := (HarmonicCalculus.mode 1 (absolutePhase j L) (fun z => periodicGaussian j L z.1.2 • absolutePressure j L z.1) x).re diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionState.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionState.lean index a385b916dc..e4b623e989 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionState.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionState.lean @@ -20,7 +20,7 @@ expressions in `MeanIncrementBounds`. The three sorts of excluded additive errors are retained as fields on the same space as the oscillations. -/ -@[expose] public section +public section noncomputable section @@ -65,14 +65,14 @@ structure ExcludedErrors (D : Type) where namespace ExcludedErrors /-- Zero, given by `⟨0, 0, 0⟩`. -/ -noncomputable def zero : ExcludedErrors D := ⟨0, 0, 0⟩ +@[expose] noncomputable def zero : ExcludedErrors D := ⟨0, 0, 0⟩ /-- Total, given by `e.base + e.gaussian + e.aliasError`. -/ -noncomputable def total (e : ExcludedErrors D) : Oscillation D := +@[expose] noncomputable def total (e : ExcludedErrors D) : Oscillation D := e.base + e.gaussian + e.aliasError /-- Add, given by `⟨e.base + f.base, e.gaussian + f.gaussian, e.aliasError + f.aliasError⟩`. -/ -noncomputable def add (e f : ExcludedErrors D) : ExcludedErrors D := +@[expose] noncomputable def add (e f : ExcludedErrors D) : ExcludedErrors D := ⟨e.base + f.base, e.gaussian + f.gaussian, e.aliasError + f.aliasError⟩ omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -100,10 +100,11 @@ structure State (D : Type) where errors : ExcludedErrors D /-- The angular normalization agrees with the physical mean over one period. -/ -noncomputable def angularAverage (f : OscillatoryScalar D) : ScalarField D := +@[expose] noncomputable def angularAverage (f : OscillatoryScalar D) : ScalarField D := fun n x => (∫ θ in (0 : ℝ)..2 * Real.pi, f n (x, θ)) / (2 * Real.pi) /-- Bilinear covariance, given by `angularAverage (fun n p => u n p i * v n p j)`. -/ +@[expose] noncomputable def bilinearCovariance (u v : Oscillation D) (i j : Fin 3) : ScalarField D := angularAverage (fun n p => u n p i * v n p j) @@ -127,41 +128,41 @@ theorem bilinearCovariance_comm (u v : Oscillation D) (i j : Fin 3) : namespace State /-- Covariance, given by `bilinearCovariance s.oscillation s.oscillation i j`. -/ -noncomputable def covariance (s : State D) (i j : Fin 3) : ScalarField D := +@[expose] noncomputable def covariance (s : State D) (i j : Fin 3) : ScalarField D := bilinearCovariance s.oscillation s.oscillation i j /-- Total velocity as an element of `Oscillation D`. -/ -noncomputable def totalVelocity (s : State D) (c : Context D) : Oscillation D := +@[expose] noncomputable def totalVelocity (s : State D) (c : Context D) : Oscillation D := fun n p => ![c.base.radial n p.1 + s.mean.radial n p.1 + s.oscillation n p 0, c.base.angular n p.1 + s.mean.angular n p.1 + s.oscillation n p 1, c.base.axial n p.1 + s.mean.axial n p.1 + s.oscillation n p 2] /-- This is the pressure increment; the fixed base pressure is not part of a stage. -/ -noncomputable def totalPressureIncrement (s : State D) : OscillatoryScalar D := +@[expose] noncomputable def totalPressureIncrement (s : State D) : OscillatoryScalar D := fun n p => s.pressure n p.1 + s.oscillatoryPressure n p /-- Theta residual, given by `MeanIncrementBounds.thetaResidual c.operators c.base s.mean s.covariance c.virtualTheta`. -/ -noncomputable def thetaResidual (s : State D) (c : Context D) : ScalarField D := +@[expose] noncomputable def thetaResidual (s : State D) (c : Context D) : ScalarField D := MeanIncrementBounds.thetaResidual c.operators c.base s.mean s.covariance c.virtualTheta /-- Axial residual, given by `MeanIncrementBounds.axialResidual c.operators c.base s.mean s.covariance s.pressure c.virtualAxial`. -/ -noncomputable def axialResidual (s : State D) (c : Context D) : ScalarField D := +@[expose] noncomputable def axialResidual (s : State D) (c : Context D) : ScalarField D := MeanIncrementBounds.axialResidual c.operators c.base s.mean s.covariance s.pressure c.virtualAxial /-- Gr, given by `MeanIncrementBounds.gr c.operators c.base s.mean s.covariance`. -/ -noncomputable def gr (s : State D) (c : Context D) : ScalarField D := +@[expose] noncomputable def gr (s : State D) (c : Context D) : ScalarField D := MeanIncrementBounds.gr c.operators c.base s.mean s.covariance /-- Radial residual, given by `c.operators.dr s.pressure - s.gr c`. -/ -noncomputable def radialResidual (s : State D) (c : Context D) : ScalarField D := +@[expose] noncomputable def radialResidual (s : State D) (c : Context D) : ScalarField D := c.operators.dr s.pressure - s.gr c /-- Reduced mean residual, defined pointwise by `![s.radialResidual c n x, s.thetaResidual c n x, s.axialResidual c n x]`. -/ -noncomputable def reducedMeanResidual (s : State D) (c : Context D) : MeanVector D := +@[expose] noncomputable def reducedMeanResidual (s : State D) (c : Context D) : MeanVector D := fun n x => ![s.radialResidual c n x, s.thetaResidual c n x, s.axialResidual c n x] /-- Mean base error, defined pointwise by `angularAverage (fun k p => s.errors.base k p i) n x`. -/ @@ -190,7 +191,7 @@ theorem covariance_symm (s : State D) (i j : Fin 3) : bilinearCovariance_comm _ _ _ _ /-- Addition of actual fields. No estimate or cancellation is part of this definition. -/ -noncomputable def addIncrement (s : State D) (m : Triple D) (p : ScalarField D) +@[expose] noncomputable def addIncrement (s : State D) (m : Triple D) (p : ScalarField D) (u : Oscillation D) (q : OscillatoryScalar D) (e : ExcludedErrors D) : State D where mean := updated s.mean m pressure := s.pressure + p @@ -226,13 +227,13 @@ namespace HarmonicBlock /-- Oscillation, defined pointwise by `(HarmonicFields.field (b.velocity n i) (b.frequency n) (b.phase n) (b.angularFrequency n) p).re`. -/ -noncomputable def oscillation (b : HarmonicBlock D) : Oscillation D := +@[expose] noncomputable def oscillation (b : HarmonicBlock D) : Oscillation D := fun n p i => (HarmonicFields.field (b.velocity n i) (b.frequency n) (b.phase n) (b.angularFrequency n) p).re /-- Oscillatory pressure, defined pointwise by `(HarmonicFields.field (b.pressure n) (b.frequency n) (b.phase n) (b.angularFrequency n) p).re`. -/ -noncomputable def oscillatoryPressure (b : HarmonicBlock D) : OscillatoryScalar D := +@[expose] noncomputable def oscillatoryPressure (b : HarmonicBlock D) : OscillatoryScalar D := fun n p => (HarmonicFields.field (b.pressure n) (b.frequency n) (b.phase n) (b.angularFrequency n) p).re @@ -278,33 +279,34 @@ section Moments variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Actual radial moment of the full auxiliary torus mean. -/ +@[expose] noncomputable def radialMoment (k : ℕ) (f : ScalarField (PressureStream.Lift S)) : ScalarField S := fun n p => PressureStream.pressureMass (fun x => x.1 ^ k * f n x) p /-- Pressure defect, given by `radialMoment 0 (u.gr c)`. -/ -noncomputable def pressureDefect (c : Context (PressureStream.Lift S)) +@[expose] noncomputable def pressureDefect (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : ScalarField S := radialMoment 0 (u.gr c) /-- Theta defect, given by `radialMoment 2 (thetaAxial c.base u.mean + u.covariance 2 1)`. -/ -noncomputable def thetaDefect (c : Context (PressureStream.Lift S)) +@[expose] noncomputable def thetaDefect (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : ScalarField S := radialMoment 2 (thetaAxial c.base u.mean + u.covariance 2 1) /-- Axial defect, given by `radialMoment 1 (axialAxial c.base u.mean + u.covariance 2 2) - (1 / 2 : ℝ) • radialMoment 2 (u.gr c)`. -/ -noncomputable def axialDefect (c : Context (PressureStream.Lift S)) +@[expose] noncomputable def axialDefect (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : ScalarField S := radialMoment 1 (axialAxial c.base u.mean + u.covariance 2 2) - (1 / 2 : ℝ) • radialMoment 2 (u.gr c) /-- The row order is exactly `(P, Jθ, Jz)`, as in `MeanRankUpdate`. -/ -noncomputable def debt (c : Context (PressureStream.Lift S)) +@[expose] noncomputable def debt (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : ℕ → S → Fin 3 → ℝ := fun n x => ![pressureDefect c u n x, thetaDefect c u n x, axialDefect c u n x] /-- Defect bounds, given by `∀ i : Fin 3, UnweightedClass s (1 + σ) (fun n x => debt c u n x i)`. -/ -def DefectBounds (s : StripData S) (σ : ℝ) (c : Context (PressureStream.Lift S)) +@[expose] def DefectBounds (s : StripData S) (σ : ℝ) (c : Context (PressureStream.Lift S)) (u : State (PressureStream.Lift S)) : Prop := ∀ i : Fin 3, UnweightedClass s (1 + σ) (fun n x => debt c u n x i) @@ -336,13 +338,13 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] abbrev Lift (S : Type) := PressureStream.Lift S /-- Recompute (33) from the current actual radial source. -/ -noncomputable def reconstructPressure (r : ReconstructionData) (c : Context (Lift S)) +@[expose] noncomputable def reconstructPressure (r : ReconstructionData) (c : Context (Lift S)) (u : State (Lift S)) : State (Lift S) := { u with pressure := (fun n => PressureStream.meanPressure r.exponent r.inner r.outer (r.frequency n) r.inner_lt_outer r.radialDirection (u.gr c n)) } /-- The pressure alias has the sign with which it occurs in the radial residual. -/ -noncomputable def pressureAlias (r : ReconstructionData) (c : Context (Lift S)) +@[expose] noncomputable def pressureAlias (r : ReconstructionData) (c : Context (Lift S)) (u : State (Lift S)) : Oscillation (Lift S) := fun n p => ![-PressureStream.pressureAlias r.exponent r.inner r.outer (r.frequency n) r.inner_lt_outer r.radialDirection (u.gr c n) p.1, 0, 0] @@ -355,7 +357,7 @@ noncomputable def pressureAlias (r : ReconstructionData) (c : Context (Lift S)) (reconstructPressure r c u).covariance = u.covariance := rfl /-- Explicit graph operators with the pressure primitive's radial direction. -/ -noncomputable def graphOperators (r : ReconstructionData) (epsilon fast : ℕ → ℝ) +@[expose] noncomputable def graphOperators (r : ReconstructionData) (epsilon fast : ℕ → ℝ) (axial slowTime : S × PressureStream.Plane) (temporal : PressureStream.Plane) : MeanIncrementBounds.Operators (Lift S) where epsilon := epsilon @@ -439,7 +441,7 @@ noncomputable def temporalIncrement (r : ReconstructionData) (h : ℝ) (r.frequency n) r.radialDirection h n (u.axialResidual c n) /-- The exact remaining axial fast-time error, not its asymptotic estimate. -/ -noncomputable def temporalAlias (r : ReconstructionData) (h : ℝ) +@[expose] noncomputable def temporalAlias (r : ReconstructionData) (h : ℝ) (c : Context (Lift S)) (u : State (Lift S)) : Oscillation (Lift S) := fun n p => ![0, 0, -TemporalMeanUpdate.fastDerivative h n (TemporalMeanUpdate.axialAlias r.exponent r.inner r.outer (r.frequency n) @@ -447,7 +449,7 @@ noncomputable def temporalAlias (r : ReconstructionData) (h : ℝ) /-- Temporal stage, given by `reconstructPressure r c (u.addIncrement (temporalIncrement r h axial c u) 0 0 0 ⟨0, 0, temporalAlias r h c u⟩)`. -/ -noncomputable def temporalStage (r : ReconstructionData) (h : ℝ) +@[expose] noncomputable def temporalStage (r : ReconstructionData) (h : ℝ) (axial : S × PressureStream.Plane) (c : Context (Lift S)) (u : State (Lift S)) : State (Lift S) := reconstructPressure r c (u.addIncrement (temporalIncrement r h axial c u) 0 0 0 @@ -526,7 +528,7 @@ noncomputable def rankIncrement (p : ReconstructionData) (r : RankData S) /-- Rank stage, given by `reconstructPressure p c (u.addIncrement (rankIncrement p r axial c u) 0 0 0 ExcludedErrors.zero)`. -/ -noncomputable def rankStage (p : ReconstructionData) (r : RankData S) +@[expose] noncomputable def rankStage (p : ReconstructionData) (r : RankData S) (axial : S × PressureStream.Plane) (c : Context (Lift S)) (u : State (Lift S)) : State (Lift S) := reconstructPressure p c (u.addIncrement (rankIncrement p r axial c u) 0 0 0 ExcludedErrors.zero) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionStep.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionStep.lean index 451e6ca72d..5eb4acefb5 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionStep.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CorrectionStep.lean @@ -36,7 +36,7 @@ not treated as independent black-box state transitions. Every old/new cross term is retained in the displayed residual differences. -/ -@[expose] public section +public section noncomputable section @@ -406,7 +406,7 @@ noncomputable def fullGoodResidual (c : Context D) (u : State D) : Oscillation D fullResidual c u - u.errors.total /-- Angular mean vector, defined pointwise by `angularAverage (fun k p => f k p i) n x`. -/ -noncomputable def angularMeanVector (f : Oscillation D) : MeanVector D := +@[expose] noncomputable def angularMeanVector (f : Oscillation D) : MeanVector D := fun n x i => angularAverage (fun k p => f k p i) n x /-- Angular nonconstant, defined pointwise by `f n x i - angularMeanVector f n x.1 i`. -/ @@ -1581,7 +1581,7 @@ noncomputable def meanDivergence (c : Context D) (m : Triple D) : ScalarField D c.operators.dz m.axial n x /-- Full divergence as an element of `OscillatoryScalar D`. -/ -noncomputable def fullDivergence (c : Context D) (u : State D) : OscillatoryScalar D := +@[expose] noncomputable def fullDivergence (c : Context D) (u : State D) : OscillatoryScalar D := fun n => LiftedMeanResidual.realDivergence (fun x => c.operators.radius x.1) (radialDirection c n) angularDirection (axialDirection c n) (u.totalVelocity c n) @@ -3584,7 +3584,7 @@ structure SignedParameters (D : Type) [NormedAddCommGroup D] [NormedSpace ℝ D] column : Fin 2 /-- Coefficients, constructed using `SignedWaveUpdate.coefficients`. -/ -noncomputable def SignedParameters.coefficients (p : SignedParameters D) (s : StripData D) +@[expose] noncomputable def SignedParameters.coefficients (p : SignedParameters D) (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : LinearWaveBounds.WaveCoefficients (D × ℝ) := SignedWaveUpdate.coefficients p.base (HarmonicWaveInteraction.productStrip s) p.directions p.matrix p.target request p.mask p.fundamental p.normalMotion p.action p.column @@ -3826,6 +3826,7 @@ open CorrectionState /-- The actual real linearized cylindrical residual of a block, evaluated with the carrier of the old spatial label. -/ +@[expose] noncomputable def linearBlockField (c : Context D) (a b : HarmonicBlock D) : Oscillation D := fun n x i => (LinearWaveResidual.linearResidual (c.operators.epsilon n) (fun y : D × ℝ => c.operators.radius y.1) (radialDirection c n) angularDirection @@ -5035,7 +5036,7 @@ variable (p : PeriodizedSignedParameters D I) /-- Native, bundling `base`, `directions`, `matrix`, `target` and the required compatibility proofs. -/ -noncomputable def native (i : I) : SignedParameters D where +@[expose] noncomputable def native (i : I) : SignedParameters D where base := p.base directions := p.directions matrix := p.matrix i @@ -5050,6 +5051,7 @@ noncomputable def native (i : I) : SignedParameters D where /-- The native fields are evaluated from the signed quotient and projected homogeneous pressure before the one native cutoff is applied. -/ +@[expose] noncomputable def copyData (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : PeriodizedWaveBounds.CopyData (D × ℝ) I where background := p.base @@ -5062,6 +5064,7 @@ theorem copyData_raw (s : StripData D) (request : ℕ → D × ℝ → SignedWav (p.copyData s request).raw i = (p.native i).coefficients s request := rfl /-- Exact block, constructed using `SignedWaveUpdate.blockOfCoefficients`. -/ +@[expose] noncomputable def exactBlock (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := SignedWaveUpdate.blockOfCoefficients @@ -5070,6 +5073,7 @@ noncomputable def exactBlock (s : StripData D) (request : ℕ → D × ℝ → S /-- Tangent block, given by `SignedWaveUpdate.blockOfCoefficients (p.copyData s request).common p.angularFrequency`. -/ +@[expose] noncomputable def tangentBlock (s : StripData D) (request : ℕ → D × ℝ → SignedWaveUpdate.Vec2) : HarmonicBlock D := SignedWaveUpdate.blockOfCoefficients (p.copyData s request).common p.angularFrequency @@ -5151,7 +5155,7 @@ variable (p : ParticularParameters P) /-- Copy data, bundling `background`, `amplitude`, `pressure`, `cutoff` and the required compatibility proofs. -/ -noncomputable def copyData (c : Context (P × TorusInverse.Plane)) (u : State (P × +@[expose] noncomputable def copyData (c : Context (P × TorusInverse.Plane)) (u : State (P × TorusInverse.Plane)) (b : HarmonicBlock (P × TorusInverse.Plane)) (G A : HarmonicResidual.BlockCoefficients (P × TorusInverse.Plane)) (j : ℤ) : @@ -5186,7 +5190,7 @@ noncomputable def wave (s : StripData (P × TorusInverse.Plane)) (p.copyData c u b G A j).commonCorrected (nativeStrip s) p.directions /-- Update block, constructed using `ParticularWaveAssembly.assembledBlock`. -/ -noncomputable def updateBlock (s : StripData (P × TorusInverse.Plane)) +@[expose] noncomputable def updateBlock (s : StripData (P × TorusInverse.Plane)) (c : Context (P × TorusInverse.Plane)) (u : State (P × TorusInverse.Plane)) (b : HarmonicBlock (P × TorusInverse.Plane)) (G A : HarmonicResidual.BlockCoefficients (P × TorusInverse.Plane)) (N : ℕ) : HarmonicBlock (P @@ -5206,7 +5210,7 @@ noncomputable def goodBlock (s : StripData (P × TorusInverse.Plane)) (ParticularWaveAssembly.angleShuffle (x,0))) (fun _ _ _ => 0) /-- Gaussian block, constructed using `ParticularWaveAssembly.assembledBlock`. -/ -noncomputable def gaussianBlock +@[expose] noncomputable def gaussianBlock (c : Context (P × TorusInverse.Plane)) (u : State (P × TorusInverse.Plane)) (b : HarmonicBlock (P × TorusInverse.Plane)) (G A : HarmonicResidual.BlockCoefficients (P × TorusInverse.Plane)) (N : ℕ) : HarmonicBlock (P @@ -5250,7 +5254,7 @@ abbrev CyclePoint := LocalSignedRequest.Point abbrev CycleSlow := ℝ × PressureStream.Plane /-- Cycle assoc, given by `ParticularWaveBounds.liftAssoc PressureStream.Plane`. -/ -noncomputable def cycleAssoc : CyclePoint ≃ₗᵢ[ℝ] (CycleSlow × TorusInverse.Plane) := +@[expose] noncomputable def cycleAssoc : CyclePoint ≃ₗᵢ[ℝ] (CycleSlow × TorusInverse.Plane) := ParticularWaveBounds.liftAssoc PressureStream.Plane /-- Finite labeled coefficient data of the current fields. Correct @@ -5298,7 +5302,7 @@ variable {ι : Type} (p : CycleParameters ι) (v : CycleCoefficients ι) (c : Context CyclePoint) (u : State CyclePoint) /-- Particular block, constructed using `StateReindex.block`. -/ -noncomputable def particularBlock (l : ι) : HarmonicBlock CyclePoint := +@[expose] noncomputable def particularBlock (l : ι) : HarmonicBlock CyclePoint := StateReindex.block cycleAssoc ((p.particular l).updateBlock (ParticularWaveBounds.reindexStrip cycleAssoc.symm p.strip) (StateReindex.context cycleAssoc.symm c) (StateReindex.state cycleAssoc.symm u) @@ -5307,7 +5311,7 @@ noncomputable def particularBlock (l : ι) : HarmonicBlock CyclePoint := (StateReindex.blockCoefficients cycleAssoc.symm (v.aliasCoefficients l)) v.residualBand) /-- Particular gaussian block, constructed using `StateReindex.block`. -/ -noncomputable def particularGaussianBlock (l : ι) : HarmonicBlock CyclePoint := +@[expose] noncomputable def particularGaussianBlock (l : ι) : HarmonicBlock CyclePoint := StateReindex.block cycleAssoc ((p.particular l).gaussianBlock (StateReindex.context cycleAssoc.symm c) (StateReindex.state cycleAssoc.symm u) (StateReindex.block cycleAssoc.symm (v.blocks l)) @@ -5316,7 +5320,7 @@ noncomputable def particularGaussianBlock (l : ι) : HarmonicBlock CyclePoint := /-- Particular velocity, given by `LabelSumBounds.fieldSum v.labels (fun l => (p.particularBlock v c u l).oscillation)`. -/ -noncomputable def particularVelocity : Oscillation CyclePoint := +@[expose] noncomputable def particularVelocity : Oscillation CyclePoint := LabelSumBounds.fieldSum v.labels (fun l => (p.particularBlock v c u l).oscillation) /-- Particular pressure, defined pointwise by `∑ l ∈ v.labels n, (p.particularBlock v c u @@ -5341,7 +5345,7 @@ noncomputable def signedRequest : ℕ → CyclePoint × ℝ → SignedWaveUpdate LocalSignedRequest.fullRequest p.strip p.patch p.coordinate c (p.afterParticular v c u) /-- Signed block, given by `(p.signed l).exactBlock p.strip (p.signedRequest v c u)`. -/ -noncomputable def signedBlock (l : ι) : HarmonicBlock CyclePoint := +@[expose] noncomputable def signedBlock (l : ι) : HarmonicBlock CyclePoint := (p.signed l).exactBlock p.strip (p.signedRequest v c u) /-- Signed gaussian block, given by `(p.signed l).gaussianBlock p.strip (p.signedRequest v c @@ -5351,12 +5355,12 @@ noncomputable def signedGaussianBlock (l : ι) : HarmonicBlock CyclePoint := /-- Signed velocity, given by `LabelSumBounds.fieldSum v.labels (fun l => (p.signedBlock v c u l).oscillation)`. -/ -noncomputable def signedVelocity : Oscillation CyclePoint := +@[expose] noncomputable def signedVelocity : Oscillation CyclePoint := LabelSumBounds.fieldSum v.labels (fun l => (p.signedBlock v c u l).oscillation) /-- Signed pressure, defined pointwise by `∑ l ∈ v.labels n, (p.signedBlock v c u l).oscillatoryPressure n x`. -/ -noncomputable def signedPressure : OscillatoryScalar CyclePoint := +@[expose] noncomputable def signedPressure : OscillatoryScalar CyclePoint := fun n x => ∑ l ∈ v.labels n, (p.signedBlock v c u l).oscillatoryPressure n x /-- Signed gaussian, given by `LabelSumBounds.fieldSum v.labels (fun l => (p.signedGaussianBlock @@ -5371,17 +5375,17 @@ noncomputable def afterSigned : State CyclePoint := /-- Temporal increment, given by `temporalIncrementState p.gauge p.timeExponent p.commonIndex p.axial c (p.afterSigned v c u)`. -/ -noncomputable def temporalIncrement : Triple CyclePoint := +@[expose] noncomputable def temporalIncrement : Triple CyclePoint := temporalIncrementState p.gauge p.timeExponent p.commonIndex p.axial c (p.afterSigned v c u) /-- After temporal, given by `temporalStageState p.gauge p.timeExponent p.commonIndex p.axial c (p.afterSigned v c u)`. -/ -noncomputable def afterTemporal : State CyclePoint := +@[expose] noncomputable def afterTemporal : State CyclePoint := temporalStageState p.gauge p.timeExponent p.commonIndex p.axial c (p.afterSigned v c u) /-- Rank increment, given by `rankIncrementState p.gauge p.rank p.axial c (p.afterTemporal v c u)`. -/ -noncomputable def rankIncrement : Triple CyclePoint := +@[expose] noncomputable def rankIncrement : Triple CyclePoint := rankIncrementState p.gauge p.rank p.axial c (p.afterTemporal v c u) /-- After rank, given by `rankStageState p.gauge p.rank p.axial c (p.afterTemporal v c u)`. -/ @@ -6055,7 +6059,7 @@ variable {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] (G A : HarmonicResidual.BlockCoefficients (Q × Plane)) (j : ℤ) /-- Native tangent, defined pointwise by `ParticularWaveAssembly.angleTangent (p.tangent j n)`. -/ -noncomputable def nativeTangent : ℕ → TangentData (Q × ℝ) ProblemStatement.Space := +@[expose] noncomputable def nativeTangent : ℕ → TangentData (Q × ℝ) ProblemStatement.Space := fun n => ParticularWaveAssembly.angleTangent (p.tangent j n) /-- Input bounds for the actual complex Volterra solve on all of its @@ -7235,7 +7239,7 @@ abbrev AxisymmetricAlias := ℕ → CyclePoint → Fin 3 → ℝ /-- Coefficient field, defined pointwise by `(HarmonicFields.field (a n i) (b.frequency n) (b.phase n) (b.angularFrequency n) x).re`. -/ -noncomputable def coefficientField (b : HarmonicBlock CyclePoint) +@[expose] noncomputable def coefficientField (b : HarmonicBlock CyclePoint) (a : HarmonicResidual.BlockCoefficients CyclePoint) : Oscillation CyclePoint := fun n x i => (HarmonicFields.field (a n i) (b.frequency n) (b.phase n) (b.angularFrequency n) x).re @@ -7417,7 +7421,7 @@ noncomputable def step (p : CycleParameters ι) (c : Context CyclePoint) (u : Cy /-- Iterate as an element of `ℕ → CycleState ι | 0 => seed | n + 1 => (iterate p c seed n).step (p n) c`. -/ -noncomputable def iterate (p : ℕ → CycleParameters ι) (c : Context CyclePoint) +@[expose] noncomputable def iterate (p : ℕ → CycleParameters ι) (c : Context CyclePoint) (seed : CycleState ι) : ℕ → CycleState ι | 0 => seed | n + 1 => (iterate p c seed n).step (p n) c @@ -8464,7 +8468,7 @@ theorem common_pressure (p : ParticularParameters P) /-- Every target band uses the same chosen reference tangent, geometry, clock interval and cutoff. Only the current HR source is supplied at solve time. -/ -noncomputable def fromReference +@[expose] noncomputable def fromReference (D : AssemblyData PhysicalParticularWave.Parameter) (h : ℝ) (gap : ℕ → ℕ) : ParticularParameters PhysicalParticularWave.Parameter where tangent j n := ScaledTangentTransport.transportTangent (D.reference.tangent j) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean index b1164d97ab..7c970c595f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean @@ -54,7 +54,7 @@ symbol and the algebraic divergence cancellation. They do not establish regularity, bounds for the differentiated amplitude, or descent from the lift. -/ -@[expose] public section +public section namespace NavierStokes.CurlGeometry @@ -218,7 +218,7 @@ end end -@[expose] public section +public section noncomputable section @@ -245,7 +245,7 @@ theorem cross_apply (u v : Space) : cross u v = u 1 • (v 2 • coordinateVector 0) - u 2 • (v 1 • coordinateVector 0) + u 2 • (v 0 • coordinateVector 1) - u 0 • (v 2 • coordinateVector 1) + - u 0 • (v 1 • coordinateVector 2) - u 1 • (v 0 • coordinateVector 2) := rfl + u 0 • (v 1 • coordinateVector 2) - u 1 • (v 0 • coordinateVector 2) := by rfl @[simp] theorem cross_zero (u v : Space) : (cross u v) 0 = u 1 * v 2 - u 2 * v 1 := by rw [cross_apply] @@ -538,7 +538,7 @@ It is not a differentiation variable. All derivatives are actual Fréchet derivatives in the slow variables (and, when present, the slot variable). -/ -@[expose] public section +public section noncomputable section @@ -1019,6 +1019,7 @@ theorem polynomialJets_of_uniform {E F : Type*} exact ⟨C, hC, 0, by simpa only [pow_zero, mul_one] using hc⟩ /-- Slot, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ +@[expose] noncomputable def Domain.slot (D : Domain ι Slow) (V : ι → Set ℝ) (hV : ∀ i, IsOpen (V i)) : Domain ι (Slow × ℝ) where scale := D.scale @@ -1091,17 +1092,18 @@ structure PhaseFamily (ι : Type*) where /-- Normal, given by `PhaseCalculus.phaseNormal (a.epsilon i) (a.p i) (a.pz i) (a.x0 i) (a.F i) (a.G i) (z.1, (a.theta i, z.2))`. -/ -noncomputable def PhaseFamily.normal (a : PhaseFamily ι) (i : ι) (z : Slow × ℝ) : Space := +@[expose] noncomputable def PhaseFamily.normal (a : PhaseFamily ι) (i : ι) (z : Slow × ℝ) : Space := PhaseCalculus.phaseNormal (a.epsilon i) (a.p i) (a.pz i) (a.x0 i) (a.F i) (a.G i) (z.1, (a.theta i, z.2)) /-- Velocity, given by `PhaseCalculus.normalSlotDerivative (a.epsilon i) (a.p i) (a.pz i) (a.F i) (a.G i) z.1`. -/ +@[expose] noncomputable def PhaseFamily.velocity (a : PhaseFamily ι) (i : ι) (z : Slow × ℝ) : Space := PhaseCalculus.normalSlotDerivative (a.epsilon i) (a.p i) (a.pz i) (a.F i) (a.G i) z.1 /-- Shear, given by `PhaseEstimates.shearVector (a.F i) (a.G i) z.1`. -/ -noncomputable def PhaseFamily.shear (a : PhaseFamily ι) (i : ι) (z : Slow × ℝ) : Plane := +@[expose] noncomputable def PhaseFamily.shear (a : PhaseFamily ι) (i : ι) (z : Slow × ℝ) : Plane := PhaseEstimates.shearVector (a.F i) (a.G i) z.1 /-- Actual phase-normal and shear jets derived from the base fields. The @@ -1468,7 +1470,7 @@ variable {ι : Type*} /-- The actual phase-derived frame with the explicit reference eigenbasis. Only the band/representative labels enter the frozen scalar choices. -/ -noncomputable def PhaseFamily.frameData (a : PhaseFamily ι) +@[expose] noncomputable def PhaseFamily.frameData (a : PhaseFamily ι) (lam c0 u ell ν : ι → ℝ) (i : ι) : PrimaryODE.FrameData Slow := PrimaryODE.FrameData.ofNormalLocal (a.normal i) (a.velocity i) (fun z => a.F i z.1) (a.shear i) @@ -1606,7 +1608,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1682,7 +1684,7 @@ theorem class_const_complex {f : ℕ → D → ComplexVector} (hf : MemClass s w simpa using hf.map (c • ContinuousLinearMap.id ℝ ComplexVector) /-- The phase-jet domain corresponding to the actual strip data. -/ -noncomputable def phaseDomain (s : StripData D) : PhaseJetBounds.Domain ℕ D where +@[expose] noncomputable def phaseDomain (s : StripData D) : PhaseJetBounds.Domain ℕ D where scale := s.slow carrier := fun _ => s.domain isOpen := fun _ => s.isOpen_domain @@ -1704,7 +1706,7 @@ theorem polynomialJets_unweighted {f : ℕ → D → E} end Classes /-- Real vectors embedded coordinatewise in the complex coefficient space. -/ -noncomputable def complexify : RealVector →L[ℝ] ComplexVector := +@[expose] noncomputable def complexify : RealVector →L[ℝ] ComplexVector := ContinuousLinearMap.pi (fun i => Complex.ofRealCLM.comp (EuclideanSpace.proj i)) @[simp] theorem complexify_apply (a : RealVector) (i : Fin 3) : complexify a i = (a i : ℂ) := rfl @@ -1726,7 +1728,7 @@ noncomputable def complexCrossLinear : ComplexVector →L[ℝ] ComplexVector → ((ContinuousLinearMap.proj 0).smulRight (Pi.single 2 (1 : ℂ))) /-- Normal cross, given by `complexCrossLinear (complexify n) a`. -/ -noncomputable def normalCross (n : RealVector) (a : ComplexVector) : ComplexVector := +@[expose] noncomputable def normalCross (n : RealVector) (a : ComplexVector) : ComplexVector := complexCrossLinear (complexify n) a theorem normalCross_apply (n : RealVector) (a : ComplexVector) : @@ -1736,7 +1738,7 @@ theorem normalCross_apply (n : RealVector) (a : ComplexVector) : (n 2 : ℂ) • (a 0 • Pi.single 1 (1 : ℂ)) - (n 0 : ℂ) • (a 2 • Pi.single 1 (1 : ℂ)) + (n 0 : ℂ) • (a 1 • Pi.single 2 (1 : ℂ)) - - (n 1 : ℂ) • (a 0 • Pi.single 2 (1 : ℂ)) := rfl + (n 1 : ℂ) • (a 0 • Pi.single 2 (1 : ℂ)) := by rfl @[simp] theorem normalCross_zero (n : RealVector) (a : ComplexVector) : normalCross n a 0 = (n 1 : ℂ) * a 2 - (n 2 : ℂ) * a 1 := by @@ -1773,6 +1775,7 @@ theorem normalCross_triple (n : RealVector) (a : ComplexVector) : Complex.ofReal_mul] <;> ring /-- The actual coefficient in the vector potential (30). -/ +@[expose] noncomputable def normalCoefficient (n : RealVector) (a : ComplexVector) : ComplexVector := (‖n‖ ^ 2)⁻¹ • normalCross n a @@ -1820,7 +1823,7 @@ theorem normalCoefficient_class {N : ℕ → D → RealVector} {a : ℕ → D end Coefficients /-- Actual cylindrical curl, including the frame connection in its axial component. -/ -noncomputable def cylindricalCurl {D : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] +@[expose] noncomputable def cylindricalCurl {D : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] (R : D → ℝ) (Vr Vθ Vz : D → D) (a : D → ComplexVector) (x : D) : ComplexVector := ![(R x)⁻¹ • HarmonicCalculus.along Vθ (fun y => a y 2) x - HarmonicCalculus.along Vz (fun y => a y 1) x, @@ -1876,7 +1879,7 @@ theorem strippedDivergence_class (ha : MemClass s w α a) (hκ : 0 ≤ κ) end CurlClass /-- The inverse frequency is the only band factor in the stripped curl error. -/ -noncomputable def curlRemainder {D : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] +@[expose] noncomputable def curlRemainder {D : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) (B : D → ComplexVector) (x : D) : ComplexVector := (1 / K) • (Complex.I • cylindricalCurl R Vr Vθ Vz B x) @@ -2190,12 +2193,12 @@ theorem normalCoefficient_contDiffOn {U : Set D} {N : D → RealVector} {a : D /-- Coefficient, given by `normalCoefficient (HarmonicCalculus.phaseNormal R Vr Vθ Vz Φ x) (a x)`. -/ -noncomputable def coefficient (R : D → ℝ) (Vr Vθ Vz : D → D) +@[expose] noncomputable def coefficient (R : D → ℝ) (Vr Vθ Vz : D → D) (Φ : D → ℝ) (a : D → ComplexVector) (x : D) : ComplexVector := normalCoefficient (HarmonicCalculus.phaseNormal R Vr Vθ Vz Φ x) (a x) /-- Inverse carrier, given by `Complex.I / (K : ℂ)`. -/ -noncomputable def inverseCarrier (K : ℝ) : ℂ := Complex.I / (K : ℂ) +@[expose] noncomputable def inverseCarrier (K : ℝ) : ℂ := Complex.I / (K : ℂ) theorem inverseCarrier_phaseFactor {K : ℝ} (hK : K ≠ 0) : inverseCarrier K * HarmonicCalculus.phaseFactor K = -1 := by @@ -2215,13 +2218,13 @@ theorem curlRemainder_eq (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) /-- Vector potential, given by `HarmonicCalculus.vectorMode K Φ (fun x => inverseCarrier K • coefficient R Vr Vθ Vz Φ a x)`. -/ -noncomputable def vectorPotential (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) +@[expose] noncomputable def vectorPotential (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) (Φ : D → ℝ) (a : D → ComplexVector) : D → ComplexVector := HarmonicCalculus.vectorMode K Φ (fun x => inverseCarrier K • coefficient R Vr Vθ Vz Φ a x) /-- Realized coefficient, given by `a x + curlRemainder K R Vr Vθ Vz (coefficient R Vr Vθ Vz Φ a) x`. -/ -noncomputable def realizedCoefficient (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) +@[expose] noncomputable def realizedCoefficient (K : ℝ) (R : D → ℝ) (Vr Vθ Vz : D → D) (Φ : D → ℝ) (a : D → ComplexVector) (x : D) : ComplexVector := a x + curlRemainder K R Vr Vθ Vz (coefficient R Vr Vθ Vz Φ a) x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentModeGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentModeGeometry.lean index 2ab0a105a8..18022312ad 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentModeGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentModeGeometry.lean @@ -29,7 +29,7 @@ The native point below uses the actual common-cover index. The ambient germs retain the current solve, its chosen phase, and its Cartesian rotation. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ open scoped Topology ContDiff abbrev Label (B N0 : ℕ) := ActualCurrentParticularPhysical.Label B N0 /-- The cover gap of the actual current-band graph. -/ -noncomputable def commonGap (n : ℕ) : ℕ := +@[expose] noncomputable def commonGap (n : ℕ) : ℕ := ChartScales.nativeIndex CorrectionInitialization.ActualPrimary.h n - CommonWindow.index CorrectionInitialization.ActualPrimary.h n @@ -248,7 +248,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentPhysicalChartJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentPhysicalChartJets.lean index 15db1178bc..5c6e6ef542 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentPhysicalChartJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentPhysicalChartJets.lean @@ -17,7 +17,7 @@ positive jets of the chart map. Native coefficients need smoothness only on a neighborhood of the evaluation point. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentSignedCurl.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentSignedCurl.lean index e2bdc8cc83..cf4e982109 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentSignedCurl.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CurrentSignedCurl.lean @@ -19,7 +19,7 @@ construction. The weighted amplitude bound supplies its smooth extension across the radial edges. All physical statements use the current band. -/ -@[expose] public section +public section noncomputable section @@ -132,6 +132,7 @@ theorem native_curl (l : SignedLabel B N0) (u : CorrectionState.State Point) (fun _ hy => common_tangent l u n hy) hx /-- The actual current potential expressed in the selected Cartesian polar chart. -/ +@[expose] noncomputable def currentPotential (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (a : ℝ) (i : PolarCharts.Index) : VelocityField := PhysicalCurlCovariance.cartesianPotential a i (cylindricalPotential l u n) @@ -412,7 +413,7 @@ theorem pressureMode_eq_exact (l : SignedLabel B N0) (u : CorrectionState.State /-- Current pressure, defined pointwise by `(cylindricalPressureMode l u n (PhysicalCurlCovariance.polarCoordinates a i z)).re`. -/ -noncomputable def currentPressure (l : SignedLabel B N0) (u : CorrectionState.State Point) +@[expose] noncomputable def currentPressure (l : SignedLabel B N0) (u : CorrectionState.State Point) (n : ℕ) (a : ℝ) (i : PolarCharts.Index) : PressureField := fun z => (cylindricalPressureMode l u n (PhysicalCurlCovariance.polarCoordinates a i z)).re diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CutStageEstimates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CutStageEstimates.lean index ae32f0f67f..2aa2f4a34d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CutStageEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CutStageEstimates.lean @@ -20,7 +20,7 @@ ordinary Fréchet derivatives on an open smooth domain; the estimate carrier itself need not be open. -/ -@[expose] public section +public section noncomputable section @@ -536,11 +536,11 @@ noncomputable def physicalProjection : SpaceTime →L[ℝ] PhysicalCoordinateBou (ContinuousLinearMap.snd ℝ ℝ Space))) @[simp] theorem physicalProjection_apply (w : SpaceTime) : - physicalProjection w = (w.1, (0, w.2 2)) := rfl + physicalProjection w = (w.1, (0, w.2 2)) := by rfl theorem physicalQ_linear_composition (h : ℝ) : PhysicalWaveSum.physicalQ h = - PhysicalCoordinateBounds.physicalQ (2 * h) ∘ physicalProjection := rfl + PhysicalCoordinateBounds.physicalQ (2 * h) ∘ physicalProjection := by rfl /-- The actual Cartesian implicit similarity coordinate has one power of loss per derivative. No bound on the physical radius is required. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CycleMeanEquation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CycleMeanEquation.lean index 9efc044ce0..423f12596c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CycleMeanEquation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CycleMeanEquation.lean @@ -17,7 +17,7 @@ actual stream reconstructions. Incompressibility and the angular mean identity are conclusions for the literal stored states. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CyclePhysicalPrefixes.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CyclePhysicalPrefixes.lean index 8b42711793..be6dcbd333 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CyclePhysicalPrefixes.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CyclePhysicalPrefixes.lean @@ -22,7 +22,7 @@ only on their valid domains. A final adapter accepts individual potential-curl realizations, not an assumed equality of finite prefixes. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ abbrev Components := Cylinder → Fin 3 → ℝ abbrev ScaledGraph := PhysicalResidualBridge.ScaledGraph /-- The actual cylindrical realization is linear in the three components. -/ -noncomputable def velocityMap (G : ScaledGraph) : Components →ₗ[ℝ] VelocityField where +@[expose] noncomputable def velocityMap (G : ScaledGraph) : Components →ₗ[ℝ] VelocityField where toFun := PhysicalResidualTZ.velocityTZ G map_add' a b := by funext z @@ -101,7 +101,7 @@ noncomputable def stepComponents (n : ℕ) : Components := meanComponents (p.temporalIncrement v c u) n + meanComponents (p.rankIncrement v c u) n /-- The four actual mean-pressure changes, and the two oscillatory pressures. -/ -noncomputable def stepPressureComponents (n : ℕ) : Cylinder → ℝ := +@[expose] noncomputable def stepPressureComponents (n : ℕ) : Cylinder → ℝ := fun x => ((p.afterParticular v c u).pressure n x.1 - u.pressure n x.1) + ((p.afterSigned v c u).pressure n x.1 - (p.afterParticular v c u).pressure n x.1) + @@ -162,7 +162,7 @@ theorem cylindricalPressure_difference (G : ScaledGraph) (n : ℕ) (p₀ : Cylin end OneStep /-- A genuine local Cartesian realization using the frozen inverse polar chart. -/ -noncomputable def polarVelocityMap (a : ℝ) (j : PolarCharts.Index) : +@[expose] noncomputable def polarVelocityMap (a : ℝ) (j : PolarCharts.Index) : VelocityField →ₗ[ℝ] VelocityField where toFun v z := CylindricalResidual.frame (PhysicalCurlCovariance.polarInput a j z).2 (v (PhysicalCurlCovariance.polarCoordinates a j z)) @@ -334,11 +334,11 @@ end Prefixes /-! ## The actual split into potential and direct angular contributions -/ /-- Meridional components, defined pointwise by `![m.radial n x.1, 0, m.axial n x.1]`. -/ -noncomputable def meridionalComponents (m : Triple CyclePoint) (n : ℕ) : Components := +@[expose] noncomputable def meridionalComponents (m : Triple CyclePoint) (n : ℕ) : Components := fun x => ![m.radial n x.1, 0, m.axial n x.1] /-- Angular components, defined pointwise by `![0, m.angular n x.1, 0]`. -/ -noncomputable def angularComponents (m : Triple CyclePoint) (n : ℕ) : Components := +@[expose] noncomputable def angularComponents (m : Triple CyclePoint) (n : ℕ) : Components := fun x => ![0, m.angular n x.1, 0] theorem meanComponents_split (m : Triple CyclePoint) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CylindricalResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CylindricalResidual.lean index c4d6c7659f..676524fc67 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CylindricalResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CylindricalResidual.lean @@ -17,7 +17,7 @@ derivatives are actual Fréchet derivatives. Pulling Cartesian fields back through this chart avoids choosing a global inverse angular coordinate. -/ -@[expose] public section +public section namespace NavierStokes.CylindricalResidual @@ -34,7 +34,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] /-- The three arguments are `r`, `theta`, and `z`, respectively. -/ -noncomputable def chart (q : Space) : Space := +@[expose] noncomputable def chart (q : Space) : Space := pack (q 0 * Real.cos (q 1)) (q 0 * Real.sin (q 1)) (q 2) /-- Horizontal, given by `packDerivative (projection 0) (projection 1) 0`. -/ @@ -50,7 +50,7 @@ noncomputable def vertical : Space →L[ℝ] Space := packDerivative 0 0 (projection 2) /-- Frame, given by `Real.cos θ • horizontal + Real.sin θ • connection + vertical`. -/ -noncomputable def frame (θ : ℝ) : Space →L[ℝ] Space := +@[expose] noncomputable def frame (θ : ℝ) : Space →L[ℝ] Space := Real.cos θ • horizontal + Real.sin θ • connection + vertical theorem frame_apply (θ : ℝ) (v : Space) : @@ -105,16 +105,16 @@ theorem contDiff_chart {n : WithTop ℕ∞} : ContDiff ℝ n chart := by ((projection 2).contDiff.smul contDiff_const) /-- D coord, given by `fderiv ℝ f q (coordinateVector i)`. -/ -noncomputable def dCoord (i : Fin 3) (f : Space → E) (q : Space) : E := +@[expose] noncomputable def dCoord (i : Fin 3) (f : Space → E) (q : Space) : E := fderiv ℝ f q (coordinateVector i) /-- Euclidean laplacian, given by `∑ i : Fin 3, dCoord i (dCoord i f) x`. -/ -noncomputable def euclideanLaplacian (f : Space → E) (x : Space) : E := +@[expose] noncomputable def euclideanLaplacian (f : Space → E) (x : Space) : E := ∑ i : Fin 3, dCoord i (dCoord i f) x /-- Scalar laplacian, given by `dCoord 0 (dCoord 0 f) q + (q 0)⁻¹ • dCoord 0 f q + ((q 0) ^ 2)⁻¹ • dCoord 1 (dCoord 1 f) q + dCoord 2 (dCoord 2 f) q`. -/ -noncomputable def scalarLaplacian (f : Space → E) (q : Space) : E := +@[expose] noncomputable def scalarLaplacian (f : Space → E) (q : Space) : E := dCoord 0 (dCoord 0 f) q + (q 0)⁻¹ • dCoord 0 f q + ((q 0) ^ 2)⁻¹ • dCoord 1 (dCoord 1 f) q + dCoord 2 (dCoord 2 f) q @@ -345,7 +345,7 @@ theorem dCoord_dCoord_encode {w : Space → Space} {q : Space} module /-- Vector Laplacian of physical components in the moving cylindrical basis. -/ -noncomputable def vectorLaplacian (w : Space → Space) (q : Space) : Space := +@[expose] noncomputable def vectorLaplacian (w : Space → Space) (q : Space) : Space := scalarLaplacian w q + (2 / (q 0) ^ 2) • connection (dCoord 1 w q) + ((q 0) ^ 2)⁻¹ • connection (connection (w q)) @@ -363,7 +363,7 @@ theorem scalarLaplacian_encode {w : Space → Space} {q : Space} module /-- Cylindrical components of an arbitrary Cartesian vector field. -/ -noncomputable def components (f : Space → Space) (q : Space) : Space := +@[expose] noncomputable def components (f : Space → Space) (q : Space) : Space := frame (-(q 1)) (f (chart q)) theorem encode_components (f : Space → Space) : @@ -407,7 +407,7 @@ theorem cartesianDerivative_components {f : Space → Space} {q : Space} /-- Vector advection, given by `w q 0 • dCoord 0 w q + (w q 1 / q 0) • (dCoord 1 w q + connection (w q)) + w q 2 • dCoord 2 w q`. -/ -noncomputable def vectorAdvection (w : Space → Space) (q : Space) : Space := +@[expose] noncomputable def vectorAdvection (w : Space → Space) (q : Space) : Space := w q 0 • dCoord 0 w q + (w q 1 / q 0) • (dCoord 1 w q + connection (w q)) + w q 2 • dCoord 2 w q @@ -427,7 +427,7 @@ noncomputable def euclideanDivergence (f : Space → Space) (x : Space) : ℝ := /-- Vector divergence, given by `(dCoord 0 w q) 0 + w q 0 / q 0 + (dCoord 1 w q) 1 / q 0 + (dCoord 2 w q) 2`. -/ -noncomputable def vectorDivergence (w : Space → Space) (q : Space) : ℝ := +@[expose] noncomputable def vectorDivergence (w : Space → Space) (q : Space) : ℝ := (dCoord 0 w q) 0 + w q 0 / q 0 + (dCoord 1 w q) 1 / q 0 + (dCoord 2 w q) 2 theorem trace_rotation (A : Space →L[ℝ] Space) (θ : ℝ) : @@ -447,11 +447,11 @@ theorem cartesianDivergence_components {f : Space → Space} {q : Space} ring /-- Euclidean gradient, given by `∑ i : Fin 3, dCoord i f x • coordinateVector i`. -/ -noncomputable def euclideanGradient (f : Space → ℝ) (x : Space) : Space := +@[expose] noncomputable def euclideanGradient (f : Space → ℝ) (x : Space) : Space := ∑ i : Fin 3, dCoord i f x • coordinateVector i /-- Scalar gradient, given by `pack (dCoord 0 f q) (dCoord 1 f q / q 0) (dCoord 2 f q)`. -/ -noncomputable def scalarGradient (f : Space → ℝ) (q : Space) : Space := +@[expose] noncomputable def scalarGradient (f : Space → ℝ) (q : Space) : Space := pack (dCoord 0 f q) (dCoord 1 f q / q 0) (dCoord 2 f q) theorem cartesianGradient_pullback {f : Space → ℝ} {q : Space} @@ -474,15 +474,15 @@ theorem cartesianGradient_pullback {f : Space → ℝ} {q : Space} pack, dCoord, coordinateVector] /-- Pullback of a time-dependent velocity into the moving cylindrical frame. -/ -noncomputable def velocityComponents (u : VelocityField) : VelocityField := +@[expose] noncomputable def velocityComponents (u : VelocityField) : VelocityField := fun tq => components (fun x => u (tq.1, x)) tq.2 /-- Pressure pullback, defined pointwise by `p (tq.1, chart tq.2)`. -/ -noncomputable def pressurePullback (p : PressureField) : PressureField := +@[expose] noncomputable def pressurePullback (p : PressureField) : PressureField := fun tq => p (tq.1, chart tq.2) /-- Cylindrical residual, constructed using `temporalDerivative`. -/ -noncomputable def cylindricalResidual (w : VelocityField) (p : PressureField) +@[expose] noncomputable def cylindricalResidual (w : VelocityField) (p : PressureField) (t : ℝ) (q : Space) : Space := temporalDerivative w t q + vectorAdvection (fun y => w (t, y)) q - vectorLaplacian (fun y => w (t, y)) q + scalarGradient (fun y => p (t, y)) q diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/DefectIncrementBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/DefectIncrementBounds.lean index c0e80206b9..ee59a59287 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/DefectIncrementBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/DefectIncrementBounds.lean @@ -17,7 +17,7 @@ moments. Their linear changes are precisely the last three rows of (35). The remaining terms include the complete radial-source remainder of (32). -/ -@[expose] public section +public section namespace NavierStokes.DefectIncrementBounds @@ -225,7 +225,7 @@ end FluxSupport /-! ## The actual three moments and their linearity -/ /-- Bar moment, given by `CorrectionState.radialMoment k f`. -/ -noncomputable def barMoment (k : ℕ) (f : ScalarField (Point P)) : ScalarField P := +@[expose] noncomputable def barMoment (k : ℕ) (f : ScalarField (Point P)) : ScalarField P := CorrectionState.radialMoment k f omit [NormedAddCommGroup P] [NormedSpace ℝ P] in @@ -318,7 +318,7 @@ noncomputable def thetaLeading (base h : Triple (Point P)) : ScalarField (Point base.axial * h.angular + base.angular * h.axial /-- Axial leading, given by `(2 : ℝ) • (base.axial * h.axial)`. -/ -noncomputable def axialLeading (base h : Triple (Point P)) : ScalarField (Point P) := +@[expose] noncomputable def axialLeading (base h : Triple (Point P)) : ScalarField (Point P) := (2 : ℝ) • (base.axial * h.axial) /-- Theta quadratic, given by `m.axial * h.angular + h.axial * m.angular + h.axial * h.angular`. -/ @@ -352,20 +352,20 @@ noncomputable def axialDefect (o : Operators (Point P)) (base m : Triple (Point /-- Defects, defined pointwise by `![pressureDefect o base m W n p, thetaDefect base m W n p, axialDefect o base m W n p]`. -/ -noncomputable def defects (o : Operators (Point P)) (base m : Triple (Point P)) +@[expose] noncomputable def defects (o : Operators (Point P)) (base m : Triple (Point P)) (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ℕ → P → Fin 3 → ℝ := fun n p => ![pressureDefect o base m W n p, thetaDefect base m W n p, axialDefect o base m W n p] /-- Linear rows as an element of `ℕ → P → Fin 3 → ℝ`. -/ -noncomputable def linearRows (o : Operators (Point P)) (base h : Triple (Point P)) : +@[expose] noncomputable def linearRows (o : Operators (Point P)) (base h : Triple (Point P)) : ℕ → P → Fin 3 → ℝ := fun n p => ![barMoment 0 (leadingRadial o base h) n p, barMoment 2 (thetaLeading base h) n p, barMoment 1 (axialLeading base h) n p - (1 / 2) * barMoment 2 (leadingRadial o base h) n p] /-- Remainders as an element of `ℕ → P → Fin 3 → ℝ`. -/ -noncomputable def remainders (o : Operators (Point P)) (base m h : Triple (Point P)) +@[expose] noncomputable def remainders (o : Operators (Point P)) (base m h : Triple (Point P)) (W : Fin 3 → Fin 3 → ScalarField (Point P)) : ℕ → P → Fin 3 → ℝ := fun n p => ![barMoment 0 (actualRadialError o base m h W) n p, barMoment 2 (thetaQuadratic m h) n p, @@ -603,7 +603,7 @@ end IntegratedBounds /-! ## Identification with the five solved rows and both exact masses -/ /-- Slow slice, given by `f n (r, (p, 0))`. -/ -noncomputable def slowSlice (f : ScalarField (Point P)) (n : ℕ) (p : P) (r : ℝ) : ℝ := +@[expose] noncomputable def slowSlice (f : ScalarField (Point P)) (n : ℕ) (p : P) (r : ℝ) : ℝ := f n (r, (p, 0)) /-- Is slow, given by `∀ n r p Y, f n (r, (p, Y)) = slowSlice f n p r`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalJetBounds.lean index d0b88deafc..48f4eb209f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalJetBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalJetBounds.lean @@ -18,7 +18,7 @@ conclusions of the numerical cutoff selection. The prefix must depend on the requested derivative order and decay power; no fixed tail is declared flat. -/ -@[expose] public section +public section noncomputable section @@ -203,7 +203,7 @@ theorem norm_tsum_sub_prefix_jet_le_of_locallyFinite {F : ℕ → E → V} {x : /-- The stage estimates needed by the diagonal argument, stated on actual cut potentials and their actual derivatives. Stage zero is exempt; stage `j` controls the finite list of derivatives through `j+2`. -/ -def CutStageBounds (a : ℕ → ℝ) (q : E → ℝ) (A : ℕ → E → V) +@[expose] def CutStageBounds (a : ℕ → ℝ) (q : E → ℝ) (A : ℕ → E → V) (g L : ℕ → ℝ) (U : Set E) : Prop := ∀ j, 1 ≤ j → ∀ m, m ≤ j + 2 → ∀ x ∈ U, ‖iteratedFDeriv ℝ m (SolenoidalDiagonal.cutStage a q A j) x‖ ≤ @@ -258,7 +258,7 @@ variable {E V : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- The original finite stage, before multiplying its potentials by cutoffs. -/ -def uncutPrefix (A : ℕ → E → V) (N : ℕ) (x : E) : V := +@[expose] def uncutPrefix (A : ℕ → E → V) (N : ℕ) (x : E) : V := ∑ j ∈ Finset.range N, A j x omit [NormedSpace ℝ E] in diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalResidual.lean index 278079bbec..20d5be217d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalResidual.lean @@ -19,7 +19,7 @@ the loss of powers in the background estimates must not. All jet estimates refer to actual iterated Fréchet derivatives of the displayed fields. -/ -@[expose] public section +public section noncomputable section @@ -48,7 +48,7 @@ variable {D V : Type*} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- A single quantitative order for one actual derivative. -/ -def JetRate (l : Filter D) (q : D → ℝ) (f : D → V) (m : ℕ) (r : ℝ) : Prop := +@[expose] def JetRate (l : Filter D) (q : D → ℝ) (f : D → V) (m : ℕ) (r : ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ x in l, ‖iteratedFDeriv ℝ m f x‖ ≤ C * (q x) ^ r /-- A common constant and neighborhood for a finite list of actual jets. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalScale.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalScale.lean index 46d961d4af..b9ffbfab1a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalScale.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/DiagonalScale.lean @@ -19,7 +19,7 @@ The resulting schedule enforces every requested finite collection of jet bounds. It does not construct the analytic increments or prove their PDE estimates. -/ -@[expose] public section +public section namespace NavierStokes.DiagonalScale @@ -30,7 +30,7 @@ open scoped Topology BigOperators noncomputable section /-- The scalar expression whose smallness is needed at each correction stage. -/ -def logPowerWeight (C p r q : ℝ) : ℝ := +@[expose] def logPowerWeight (C p r q : ℝ) : ℝ := C * (1 + |Real.log q|) ^ p * q ^ r /-- Any positive real power beats any fixed real logarithmic power at zero. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/DirectAngularDiagonal.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/DirectAngularDiagonal.lean index 5ce350a647..62e924a0ce 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/DirectAngularDiagonal.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/DirectAngularDiagonal.lean @@ -19,7 +19,7 @@ an axial primitive. Axisymmetry proves its divergence equation, and an annular zero germ removes the coordinate singularity on the axis. -/ -@[expose] public section +public section noncomputable section @@ -37,17 +37,17 @@ abbrev CylPoint := ℝ × (ℝ × ℝ) abbrev Coefficient := CylPoint → ℝ /-- Radius, given by `PolarCharts.radius (PhysicalGraphBounds.radialProjection w)`. -/ -noncomputable def radius (w : SpaceTime) : ℝ := +@[expose] noncomputable def radius (w : SpaceTime) : ℝ := PolarCharts.radius (PhysicalGraphBounds.radialProjection w) /-- Slow point, given by `(w.1, w.2 2)`. -/ -noncomputable def slowPoint (w : SpaceTime) : Slow := (w.1, w.2 2) +@[expose] noncomputable def slowPoint (w : SpaceTime) : Slow := (w.1, w.2 2) /-- Cyl point, given by `(w.1, (radius w, w.2 2))`. -/ -noncomputable def cylPoint (w : SpaceTime) : CylPoint := (w.1, (radius w, w.2 2)) +@[expose] noncomputable def cylPoint (w : SpaceTime) : CylPoint := (w.1, (radius w, w.2 2)) /-- Slow of cyl, given by `(p.1, p.2.2)`. -/ -noncomputable def slowOfCyl (p : CylPoint) : Slow := (p.1, p.2.2) +@[expose] noncomputable def slowOfCyl (p : CylPoint) : Slow := (p.1, p.2.2) /-- Physical domain, given by `slowPoint ⁻¹' U`. -/ noncomputable def physicalDomain (U : Set Slow) : Set SpaceTime := slowPoint ⁻¹' U @@ -80,7 +80,7 @@ noncomputable def rate (b : Coefficient) (p : AxisymmetricFields.ProfilePoint) : b (profileToCyl p) / Real.sqrt (2 * p.2.1) /-- Literal angular velocity with physical tangential magnitude `b`. -/ -noncomputable def angularField (b : Coefficient) (w : SpaceTime) : Space := +@[expose] noncomputable def angularField (b : Coefficient) (w : SpaceTime) : Space := (-w.2 1 / radius w * b (cylPoint w)) • coordinateVector 0 + (w.2 0 / radius w * b (cylPoint w)) • coordinateVector 1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean index 825c6a7932..a2b9a5f5a5 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean @@ -22,7 +22,7 @@ Compactness bounds the derivatives of the smooth coefficient; the full Fréchet product rule then gives estimates for all joint derivative tensors. -/ -@[expose] public section +public section noncomputable section @@ -175,7 +175,7 @@ theorem compact_coefficient_jets {F : Type*} [NormedAddCommGroup F] [NormedSpace exact (hbound i (p, x) ⟨hp, hx⟩).trans (by linarith) /-- Weighted, given by `(FlatCutoff.edge c y.2 / y.2 ^ j) * B y`. -/ -noncomputable def weighted (c : ℝ) (j : ℕ) (B : E × ℝ → ℝ) (y : E × ℝ) : ℝ := +@[expose] noncomputable def weighted (c : ℝ) (j : ℕ) (B : E × ℝ → ℝ) (y : E × ℝ) : ℝ := (FlatCutoff.edge c y.2 / y.2 ^ j) * B y theorem weighted_contDiff {c : ℝ} (hc : 0 < c) (j : ℕ) {B : E × ℝ → ℝ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/EndpointCoordinates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/EndpointCoordinates.lean index ff2ee36681..0e4f74858e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/EndpointCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/EndpointCoordinates.lean @@ -18,7 +18,7 @@ branch. The extension below is built from that branch and agrees with all actual physical coordinate jets at every point with `t<1`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/EntranceAlignedBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/EntranceAlignedBase.lean index 36a11fcd4f..13f9187c6f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/EntranceAlignedBase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/EntranceAlignedBase.lean @@ -28,7 +28,7 @@ before the finite modulation begins. The same finite base, local hierarchy, and five-row exterior repair are used throughout. -/ -@[expose] public section +public section noncomputable section @@ -172,7 +172,7 @@ variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- A new actual global recursion, retaining the same local hierarchy through the entrance and changing only its common seed cutoff. -/ -noncomputable def scheme : Scheme S F.data.h W.axis.normalization := +@[expose] noncomputable def scheme : Scheme S F.data.h W.axis.normalization := schemeFromHierarchy (nominalHierarchy W) (ActualSlowAxis.axisRadius_pos _ _) (nominalComplexDomain_open W) (modifiedDomain W Q M) (fun _ he => (M.subset he).2) W.axis.normalization_pos.ne' F.data.core.lam_pos (window_order W H hlo).2.2.1 @@ -868,6 +868,7 @@ theorem modulation_after_entrance : NominalConeAssembly.activeLeft W < d.modulat /-- Modulated scheme, given by `scheme W H v.profiles v.finiteModification (modulation_after_entrance (d := d))`. -/ +@[expose] noncomputable def modulatedScheme : Scheme v.slowParameters F.data.h W.axis.normalization := scheme W H v.profiles v.finiteModification (modulation_after_entrance (d := d)) @@ -1172,7 +1173,7 @@ The constants remain uniform as that time approaches zero while the normalized positive branch stays in a fixed annulus. -/ -@[expose] public section +public section noncomputable section @@ -1189,7 +1190,7 @@ abbrev Chart := SlowBorelBase.Chart abbrev Inner := SlowBorelBase.Inner /-- One domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ -noncomputable def oneDomain (ι : Type*) {E : Type*} [NormedAddCommGroup E] +@[expose] noncomputable def oneDomain (ι : Type*) {E : Type*} [NormedAddCommGroup E] (U : ι → Set E) (hU : ∀ i, IsOpen (U i)) : Domain ι E where scale _ := 1 carrier := U @@ -1329,11 +1330,13 @@ theorem normalized_error_envelope {ι : Type*} {h qlo qhi lo hi : ℝ} /-- Swirl error, given by `SlowBorelBase.normalizedSwirl a h C d y - SlowBorelBase.leadingSwirl C d y.2`. -/ +@[expose] noncomputable def swirlError (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coefficients) (y : Chart) : ℝ := SlowBorelBase.normalizedSwirl a h C d y - SlowBorelBase.leadingSwirl C d y.2 /-- Axial error, given by `SlowBorelBase.slowSum a h d.axial y - d.axial 0 y.2`. -/ +@[expose] noncomputable def axialError (a : ℕ → ℕ) (h : ℝ) (d : SlowBorelBase.Coefficients) (y : Chart) : ℝ := SlowBorelBase.slowSum a h d.axial y - d.axial 0 y.2 @@ -1535,22 +1538,22 @@ theorem normalizedCoordinates_polynomial {ι : Type*} {D : Domain ι Slow} exact (hBj j hj p hpnorm).trans (by simpa only [pow_one] using pow_le_pow_right₀ hB hj1) /-- Axial factor, given by `(normalizedCoordinates h p).1 ^ (-CoordinateAlgebra.A h)`. -/ -noncomputable def axialFactor (h : ℝ) (p : Slow) : ℝ := +@[expose] noncomputable def axialFactor (h : ℝ) (p : Slow) : ℝ := (normalizedCoordinates h p).1 ^ (-CoordinateAlgebra.A h) /-- Frequency factor, given by `axialFactor h p / p.1`. -/ -noncomputable def frequencyFactor (h : ℝ) (p : Slow) : ℝ := axialFactor h p / p.1 +@[expose] noncomputable def frequencyFactor (h : ℝ) (p : Slow) : ℝ := axialFactor h p / p.1 /-- The actual `Q^A`-normalized angular velocity divided by the normalized radius. The factor `1/R` is retained in the definition. -/ -noncomputable def frequency (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coefficients) +@[expose] noncomputable def frequency (a : ℕ → ℕ) (h C : ℝ) (d : SlowBorelBase.Coefficients) (Q : ℝ) (p : Slow) : ℝ := frequencyFactor h p * SlowBorelBase.normalizedSwirl a h C d (SlowBorelBase.scaleMap Q (normalizedCoordinates h p)) /-- Axial, given by `axialFactor h p * SlowBorelBase.slowSum a h d.axial (SlowBorelBase.scaleMap Q (normalizedCoordinates h p))`. -/ -noncomputable def axial (a : ℕ → ℕ) (h : ℝ) (d : SlowBorelBase.Coefficients) +@[expose] noncomputable def axial (a : ℕ → ℕ) (h : ℝ) (d : SlowBorelBase.Coefficients) (Q : ℝ) (p : Slow) : ℝ := axialFactor h p * SlowBorelBase.slowSum a h d.axial (SlowBorelBase.scaleMap Q (normalizedCoordinates h p)) @@ -1856,7 +1859,7 @@ theorem leadingFrequency_eq {h C : ℝ} {d : SlowBorelBase.Coefficients} /-- Band point, given by `(1 - Q * p.2.2, !₂[Real.sqrt Q * p.1, 0, Q ^ CoordinateAlgebra.D h * p.2.1])`. -/ -noncomputable def bandPoint (h Q : ℝ) (p : Slow) : ProblemStatement.SpaceTime := +@[expose] noncomputable def bandPoint (h Q : ℝ) (p : Slow) : ProblemStatement.SpaceTime := (1 - Q * p.2.2, !₂[Real.sqrt Q * p.1, 0, Q ^ CoordinateAlgebra.D h * p.2.1]) theorem bandPoint_time {h Q : ℝ} (hQ : 0 < Q) {p : Slow} (hT : 0 < p.2.2) : @@ -2022,11 +2025,12 @@ theorem Estimates.uniform_errors {ι : Type*} {D : Domain ι Slow} {Q : ι → (hG i x hx j hj).trans (mul_le_mul_of_nonneg_right (le_max_right _ _) hw)⟩ /-- Every actual positive active label above a single fixed band. -/ -noncomputable def CellIndex (h lo hi : ℝ) (N : ℕ) := +@[expose] noncomputable def CellIndex (h lo hi : ℝ) (N : ℕ) := {L : PositiveRepresentatives.ActiveLabel (PrimaryRepresentatives.referenceCompact h lo hi) // N ≤ L.val.1} /-- Cell band, given by `L.val.val.1`. -/ +@[expose] noncomputable def cellBand {h lo hi : ℝ} {N : ℕ} (L : CellIndex h lo hi N) : ℕ := L.val.val.1 /-- The actual convex positive-time three-mesh cells. The slow scale is @@ -2140,7 +2144,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2328,7 +2332,7 @@ open ProfileHistories /-- The two actual leading stress coefficients, in the Euclidean plane used by the primary ODE. -/ -noncomputable def stressVector {D : RadialDomain} (P : Profiles D) (h : ℝ) +@[expose] noncomputable def stressVector {D : RadialDomain} (P : Profiles D) (h : ℝ) (p : Point) : Plane := !₂[LeadingStress.theta P h p, LeadingStress.axial P h p] /-- Both entries use the actual integral-history stocks; the axial sign diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/EvenSmoothDescent.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/EvenSmoothDescent.lean index f6877bca37..46a5c3d361 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/EvenSmoothDescent.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/EvenSmoothDescent.lean @@ -18,7 +18,7 @@ formula, not from a convergent power series. Its iterates are the genuine one-sided derivatives of `X ↦ f (sqrt X)`. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ theorem iteratedDeriv_iteratedDeriv (f : ℝ → E) (m n : ℕ) : simp only [iteratedDeriv_eq_iterate, Function.iterate_add_apply] /-- Average, given by `∫ t in (0 : ℝ)..1, f (t * x)`. -/ -noncomputable def average (f : ℝ → E) (x : ℝ) : E := +@[expose] noncomputable def average (f : ℝ → E) (x : ℝ) : E := ∫ t in (0 : ℝ)..1, f (t * x) omit [CompleteSpace E] in @@ -124,7 +124,7 @@ theorem average_deriv_identity {f : ℝ → E} (hf : ContDiff ℝ ∞ f) (x : ((contDiff_infty_iff_deriv.mp hf).2.continuous.intervalIntegrable 0 x) /-- Radial derivative, given by `(1 / 2 : ℝ) • average (iteratedDeriv 2 f) x`. -/ -noncomputable def radialDerivative (f : ℝ → E) (x : ℝ) : E := +@[expose] noncomputable def radialDerivative (f : ℝ → E) (x : ℝ) : E := (1 / 2 : ℝ) • average (iteratedDeriv 2 f) x omit [CompleteSpace E] in @@ -198,7 +198,7 @@ theorem iteratedDeriv_radialDerivative_zero {f : ℝ → E} (hf : ContDiff ℝ field_simp /-- Descent, given by `f (Real.sqrt X)`. -/ -noncomputable def descent (f : ℝ → E) (X : ℝ) : E := f (Real.sqrt X) +@[expose] noncomputable def descent (f : ℝ → E) (X : ℝ) : E := f (Real.sqrt X) omit [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] in theorem descent_square {f : ℝ → E} (he : Function.Even f) (x : ℝ) : @@ -248,7 +248,7 @@ theorem hasDerivWithinAt_descent {f : ℝ → E} (hf : ContDiff ℝ ∞ f) · exact (hasDerivAt_descent_pos hf he h).hasDerivWithinAt /-- Radial iterate, given by `(radialDerivative^[n]) f`. -/ -noncomputable def radialIterate (f : ℝ → E) (n : ℕ) : ℝ → E := +@[expose] noncomputable def radialIterate (f : ℝ → E) (n : ℕ) : ℝ → E := (radialDerivative^[n]) f omit [CompleteSpace E] in @@ -328,11 +328,11 @@ constructed here; the input is not assumed to have a global even extension. -/ /-- Even cutoff, given by `SmoothCutoffs.scaledCutoff (2 / r) x * SmoothCutoffs.scaledCutoff (2 / r) (-x)`. -/ -noncomputable def evenCutoff (r x : ℝ) : ℝ := +@[expose] noncomputable def evenCutoff (r x : ℝ) : ℝ := SmoothCutoffs.scaledCutoff (2 / r) x * SmoothCutoffs.scaledCutoff (2 / r) (-x) /-- Localized, given by `evenCutoff r x • f x`. -/ -noncomputable def localized (r : ℝ) (f : ℝ → E) (x : ℝ) : E := +@[expose] noncomputable def localized (r : ℝ) (f : ℝ → E) (x : ℝ) : E := evenCutoff r x • f x theorem contDiff_evenCutoff (r : ℝ) : ContDiff ℝ ∞ (evenCutoff r) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean index 343fce24db..34870aee59 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean @@ -26,7 +26,7 @@ hold uniformly for `0 ≤ κ ≤ 10⁻⁵` and `σ ≥ 1/5`. Fractions are exact in the real numbers; no floating-point calculation is used. -/ -@[expose] public section +public section namespace NavierStokes.ExponentLedger @@ -34,13 +34,13 @@ namespace NavierStokes.ExponentLedger noncomputable section /-- The good-wave residual exponent `B = 1/2 + σ`. -/ -def waveExponent (σ : ℝ) : ℝ := 1 / 2 + σ +@[expose] def waveExponent (σ : ℝ) : ℝ := 1 / 2 + σ /-- The mean and defect target exponent `C = 1 + σ`. -/ -def meanExponent (σ : ℝ) : ℝ := 1 + σ +@[expose] def meanExponent (σ : ℝ) : ℝ := 1 + σ /-- The intermediate exponent `H₁ = C - 2κ`. -/ -def meanUpdateExponent (σ κ : ℝ) : ℝ := meanExponent σ - 2 * κ +@[expose] def meanUpdateExponent (σ κ : ℝ) : ℝ := meanExponent σ - 2 * κ /-- Minimum of the four listed gains for the particular wave correction. -/ def particularGain (σ κ : ℝ) : ℝ := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatDebts.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatDebts.lean index d9af0f554c..28aaafacae 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatDebts.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatDebts.lean @@ -20,7 +20,7 @@ profile. All differentiated kernels and their integrable majorants are derived from that extension. -/ -@[expose] public section +public section noncomputable section @@ -95,20 +95,20 @@ end IntegralChain /-! ## The actual extended edit and all its diffusion derivatives -/ /-- Correction, given by `switch K X * (HeatProfileExtension.scaledProfile (1 + h) X ν - 1)`. -/ -noncomputable def correction (h K ν X : ℝ) : ℝ := +@[expose] noncomputable def correction (h K ν X : ℝ) : ℝ := switch K X * (HeatProfileExtension.scaledProfile (1 + h) X ν - 1) /-- Multiplier, given by `1 + correction h K ν X`. -/ -noncomputable def multiplier (h ν K X : ℝ) : ℝ := 1 + correction h K ν X +@[expose] noncomputable def multiplier (h ν K X : ℝ) : ℝ := 1 + correction h K ν X /-- Edit, given by `E X * multiplier h ν K X`. -/ -noncomputable def edit (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := E X * multiplier h ν K X +@[expose] noncomputable def edit (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := E X * multiplier h ν K X /-- Change, given by `edit E h ν K X - E X`. -/ -noncomputable def change (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := edit E h ν K X - E X +@[expose] noncomputable def change (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := edit E h ν K X - E X /-- Square change, given by `edit E h ν K X ^ 2 - E X ^ 2`. -/ -noncomputable def squareChange (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := +@[expose] noncomputable def squareChange (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := edit E h ν K X ^ 2 - E X ^ 2 /-- Correction jet, given by `iteratedDeriv n (fun u => correction h K u X) ν`. -/ @@ -140,7 +140,7 @@ theorem correctionJet_hasDerivAt {h : ℝ} (hh : 0 < h) (K X : ℝ) (n : ℕ) ( (ENat.natCast_lt_of_coe_top_le_withTop le_rfl n) ν simpa only [correctionJet, iteratedDeriv_succ] using hd.hasDerivAt -theorem correctionJet_zero (h K ν X : ℝ) : correctionJet h K 0 ν X = correction h K ν X := rfl +theorem correctionJet_zero (h K ν X : ℝ) : correctionJet h K 0 ν X = correction h K ν X := by rfl theorem correctionJet_succ {h : ℝ} (hh : 0 < h) (K X ν : ℝ) (n : ℕ) : correctionJet h K (n + 1) ν X = switch K X * (2 / X) ^ (n + 1) * @@ -274,7 +274,7 @@ theorem squareCorrectionJet_bound {h K L ν X : ℝ} (hh : 0 < h) (hX : 1 ≤ X) _ = _ := by unfold squareCorrectionBound; ring /-- Edit jet, with branches according to `square`. -/ -noncomputable def editJet (square : Bool) (h K : ℝ) (n : ℕ) (ν X : ℝ) : ℝ := +@[expose] noncomputable def editJet (square : Bool) (h K : ℝ) (n : ℕ) (ν X : ℝ) : ℝ := if square then squareCorrectionJet h K n ν X else correctionJet h K n ν X /-- Edit bound, with branches according to `square`. -/ @@ -463,22 +463,22 @@ theorem nuDebtJet_bound (d : TailData) {K : ℝ} (hK : 1 ≤ K) (square : Bool) ring /-- The literal extended outgoing edit. -/ -noncomputable def physicalEdit (d : TailData) (K η X : ℝ) : ℝ := +@[expose] noncomputable def physicalEdit (d : TailData) (K η X : ℝ) : ℝ := edit (outgoingProfile d K η) d.h (diffusion η) K X /-- Physical pressure, given by `∫ X in Ioi K, squareChange (outgoingProfile d K η) d.h (diffusion η) K X / X`. -/ -noncomputable def physicalPressure (d : TailData) (K η : ℝ) : ℝ := +@[expose] noncomputable def physicalPressure (d : TailData) (K η : ℝ) : ℝ := ∫ X in Ioi K, squareChange (outgoingProfile d K η) d.h (diffusion η) K X / X /-- Physical energy, given by `∫ X in Ioi K, squareChange (outgoingProfile d K η) d.h (diffusion η) K X`. -/ -noncomputable def physicalEnergy (d : TailData) (K η : ℝ) : ℝ := +@[expose] noncomputable def physicalEnergy (d : TailData) (K η : ℝ) : ℝ := ∫ X in Ioi K, squareChange (outgoingProfile d K η) d.h (diffusion η) K X /-- Physical angular, given by `∫ X in Ioi K, Real.sqrt (2 * X) * change (outgoingProfile d K η) d.h (diffusion η) K X`. -/ -noncomputable def physicalAngular (d : TailData) (K η : ℝ) : ℝ := +@[expose] noncomputable def physicalAngular (d : TailData) (K η : ℝ) : ℝ := ∫ X in Ioi K, Real.sqrt (2 * X) * change (outgoingProfile d K η) d.h (diffusion η) K X theorem physicalPressure_eq (d : TailData) {K : ℝ} (hK : 0 < K) (η : ℝ) : @@ -664,7 +664,7 @@ theorem physicalAngular_joint_contDiffOn (d : TailData) : /-! ## Uniform estimates on a fixed enlarged physical band -/ /-- Enlarged band, given by `Icc (-(3 / 2 : ℝ)) (3 / 2)`. -/ -noncomputable def enlargedBand : Set ℝ := Icc (-(3 / 2 : ℝ)) (3 / 2) +@[expose] noncomputable def enlargedBand : Set ℝ := Icc (-(3 / 2 : ℝ)) (3 / 2) theorem physicalBand_subset_enlargedBand : Icc (-1 : ℝ) 1 ⊆ enlargedBand := by intro η hη @@ -826,11 +826,11 @@ theorem exists_physical_debt_C1_bounds (d : TailData) : /-- Physical debt, given by `![physicalPressure d K η, physicalEnergy d K η, physicalAngular d K η]`. -/ -noncomputable def physicalDebt (d : TailData) (K η : ℝ) : TerminalCompensation.Coeff := +@[expose] noncomputable def physicalDebt (d : TailData) (K η : ℝ) : TerminalCompensation.Coeff := ![physicalPressure d K η, physicalEnergy d K η, physicalAngular d K η] /-- Normalized debt, given by `TerminalCompensation.scaledDebt K (physicalDebt d K η)`. -/ -noncomputable def normalizedDebt (d : TailData) (K η : ℝ) : TerminalCompensation.Coeff := +@[expose] noncomputable def normalizedDebt (d : TailData) (K η : ℝ) : TerminalCompensation.Coeff := TerminalCompensation.scaledDebt K (physicalDebt d K η) theorem normalizedDebt_contDiff (d : TailData) {K : ℝ} (hK : 1 ≤ K) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatedOutgoing.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatedOutgoing.lean index 4f3119cef2..4805e75c98 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatedOutgoing.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ExtendedHeatedOutgoing.lean @@ -17,7 +17,7 @@ restriction supplies the physical-band witness; no comparison of unrelated existential choices is used. -/ -@[expose] public section +public section noncomputable section @@ -205,7 +205,7 @@ noncomputable def physical : HeatedOutgoing.CompensationWitness F XR C where patch_positive := fun eta heta => w.patch_positive eta (parameterDomain_subset (physicalBand_subset heta)) -@[simp] theorem physical_coefficients : w.physical.coefficients = w.coefficients := rfl +@[simp] theorem physical_coefficients : w.physical.coefficients = w.coefficients := by rfl end Witness @@ -251,7 +251,7 @@ theorem Pi_eq_physical (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ theorem heatE_eq_edit (F : Profile) (XR eta X : ℝ) : heatE F XR (X, eta) = ExtendedHeatDebts.edit (fun u => OutgoingDilation.E F XR (u, eta)) - F.data.h (ParametricHeatTail.diffusion eta) (switchRadius F XR) X := rfl + F.data.h (ParametricHeatTail.diffusion eta) (switchRadius F XR) X := by rfl theorem edit_before (f : ℝ → ℝ) (h nu : ℝ) {K X : ℝ} (hK : 0 < K) (hX : 0 < X) (hle : X ≤ K) : ExtendedHeatDebts.edit f h nu K X = f X := by @@ -472,7 +472,7 @@ theorem J_integrand_eq (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ congrArg (fun z => Real.sqrt (2 * X) * z) (E_times_U F XR c eta X hXR hX) theorem M_unchanged (F : Profile) (XR eta X : ℝ) : M F XR eta X = OutgoingDilation.M F XR eta X := - rfl + by exact HeatedOutgoing.M_unchanged F XR eta X theorem J_unchanged (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) (hXR : 0 < XR) : J F XR c eta X = OutgoingDilation.J F XR eta X := @@ -491,7 +491,7 @@ theorem Pi_exp (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta y : ℝ) : simp_rw [canonicalKernel_comp_exp] theorem freeLogE_eq (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta y : ℝ) : - HeatedOutgoing.freeLogE F XR ((c eta, eta), y) = E F XR c (Real.exp y, eta) := rfl + HeatedOutgoing.freeLogE F XR ((c eta, eta), y) = E F XR c (Real.exp y, eta) := by rfl namespace Witness diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FinalSlowBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FinalSlowBase.lean index 40002a5983..26fa6410eb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FinalSlowBase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FinalSlowBase.lean @@ -34,7 +34,7 @@ allows any seed cutoff with the same order-zero profile and outer radius, including the entrance-aligned scheme. -/ -@[expose] public section +public section namespace NavierStokes.ModulatedExterior @@ -570,7 +570,7 @@ end end -@[expose] public section +public section noncomputable section @@ -591,10 +591,10 @@ noncomputable def edgeExponent : ℝ := W.controls.activationTime ^ 2 theorem edgeExponent_pos : 0 < edgeExponent W := sq_pos_of_pos W.controls.activationTime_pos /-- Log left, given by `Real.log (NominalConeAssembly.activeLeft W)`. -/ -noncomputable def logLeft : ℝ := Real.log (NominalConeAssembly.activeLeft W) +@[expose] noncomputable def logLeft : ℝ := Real.log (NominalConeAssembly.activeLeft W) /-- Log right, given by `Real.log (NominalConeAssembly.activeRight W)`. -/ -noncomputable def logRight : ℝ := Real.log (NominalConeAssembly.activeRight W) +@[expose] noncomputable def logRight : ℝ := Real.log (NominalConeAssembly.activeRight W) /-- Annulus, given by `Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) ×ˢ Icc (-1 : ℝ) 1`. -/ @@ -602,10 +602,11 @@ noncomputable def annulus : Set Inner := Ioo (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) ×ˢ Icc (-1 : ℝ) 1 /-- Weight, given by `BaseResidual.activeZeta (edgeExponent W) (logLeft W) (logRight W)`. -/ -noncomputable def weight : Inner → ℝ := +@[expose] noncomputable def weight : Inner → ℝ := BaseResidual.activeZeta (edgeExponent W) (logLeft W) (logRight W) /-- Edge distance, given by `BaseResidual.activeDelta (logLeft W) (logRight W)`. -/ +@[expose] noncomputable def edgeDistance : Inner → ℝ := BaseResidual.activeDelta (logLeft W) (logRight W) /-- Box radius, given by `max upper (NominalConeAssembly.activeRight W)`. -/ @@ -667,6 +668,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (v : ModulatedProfileAssembly.Witness ld) /-- Coefficients, given by `EntranceAlignedBase.modulatedCoefficients H v`. -/ +@[expose] noncomputable def coefficients : Coefficients := EntranceAlignedBase.modulatedCoefficients H v /-- Profile sequence, given by `asSlowProfiles (EntranceAlignedBase.modulatedScheme H v)`. -/ @@ -686,6 +688,7 @@ theorem stressZeroCore : BaseResidual.StressZeroCore (coefficients H v) EntranceAlignedBase.modulated_stressZeroCore H v /-- The literal stress of the same finite modulated profile. -/ +@[expose] noncomputable def leadingStress : Inner → Inner := LeadingStressWeights.stress v.profiles F.data.h theorem leadingStress_smoothAt {p : Inner} (hX : 0 < p.1) (heta : p.2 ∈ Icc (-1 : ℝ) 1) : @@ -798,6 +801,7 @@ theorem spectral_cones (hcone : LeadingStressWeights.FullTrueCone v) AlignedProfileSpectralCone.modulated_spectral_cones H v hcone hT hR hw.1.1 hw.1.2 /-- The actual covariance target, including its positive chart factor. -/ +@[expose] noncomputable def covarianceTarget (q : ℝ) (N : ℕ) (U : PartitionedCovariance.UnsignedLabel) (p : PhaseCalculus.Slow) : MovingFrameODE.Plane := let w := (BaseChartJets.normalizedCoordinates F.data.h p).2 @@ -851,12 +855,12 @@ theorem weighted_bound (upper : ℝ) (B : ℕ) : /-- Velocity, given by `baseVelocity (scales H v upper B) F.data.h W.axis.normalization (coefficients H v)`. -/ -noncomputable def velocity (upper : ℝ) (B : ℕ) : ProblemStatement.VelocityField := +@[expose] noncomputable def velocity (upper : ℝ) (B : ℕ) : ProblemStatement.VelocityField := baseVelocity (scales H v upper B) F.data.h W.axis.normalization (coefficients H v) /-- Pressure, given by `basePressure (scales H v upper B) F.data.h W.axis.normalization (coefficients H v)`. -/ -noncomputable def pressure (upper : ℝ) (B : ℕ) : ProblemStatement.PressureField := +@[expose] noncomputable def pressure (upper : ℝ) (B : ℕ) : ProblemStatement.PressureField := basePressure (scales H v upper B) F.data.h W.axis.normalization (coefficients H v) /-- Vector potential, given by `ConstructedSlowBase.potential (scales H v upper B) F.data.h diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FiniteHeadClass.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FiniteHeadClass.lean index 26f6f95604..036c9a9b31 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FiniteHeadClass.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FiniteHeadClass.lean @@ -16,7 +16,7 @@ Only the band exponent changes. The weight, domain, polynomial degree, and finite band cutoff are preserved, including at the spatial edges. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FirstOrderBaseEdge.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FirstOrderBaseEdge.lean index 4c512e871f..1c7b78acae 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FirstOrderBaseEdge.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FirstOrderBaseEdge.lean @@ -30,7 +30,7 @@ therefore vanish past the same outer radius, uniformly over positive orders moment; no renormalized order-zero moment is used in this module. -/ -@[expose] public section +public section noncomputable section @@ -533,7 +533,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FiveProfileMoments.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FiveProfileMoments.lean index 9e584ce4f8..5f01f6a611 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FiveProfileMoments.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FiveProfileMoments.lean @@ -20,7 +20,7 @@ the patch. Positive amplitude factoring removes the background parameters from the normalized quadratic system. -/ -@[expose] public section +public section noncomputable section @@ -103,6 +103,7 @@ theorem bumps_disjoint (P : Patch) (i j : Fin n) (hij : i ≠ j) (x : ℝ) : · linarith [intervals_separated P j i h, hjx.2, hix.1] /-- Correction, given by `∑ j, c j * bump P j x`. -/ +@[expose] noncomputable def correction (P : Patch) (c : Fin n → ℝ) (x : ℝ) : ℝ := ∑ j, c j * bump P j x theorem correction_contDiff (P : Patch) (c : Fin n → ℝ) : ContDiff ℝ ∞ (correction P c) := @@ -325,9 +326,9 @@ theorem angularPowers_injective (b : ℝ) (hb : GoodExponent b) : Injective (ang all_goals first | exact hb.2.1 (by linarith) | exact hb.2.2 (by linarith) /-- U, given by `correction P.leftHalf c.1`. -/ -noncomputable def u (P : Patch) (c : Coeff) : ℝ → ℝ := correction P.leftHalf c.1 +@[expose] noncomputable def u (P : Patch) (c : Coeff) : ℝ → ℝ := correction P.leftHalf c.1 /-- E, given by `correction P.rightHalf c.2`. -/ -noncomputable def e (P : Patch) (c : Coeff) : ℝ → ℝ := correction P.rightHalf c.2 +@[expose] noncomputable def e (P : Patch) (c : Coeff) : ℝ → ℝ := correction P.rightHalf c.2 theorem u_mul_e (P : Patch) (c d : Coeff) (x : ℝ) : u P c x * e P d x = 0 := by by_cases hu : u P c x = 0 @@ -522,6 +523,7 @@ theorem exists_normalized_repair (P : Patch) (b : ℝ) (hb : GoodExponent b) : /-- Physical U, given by `G + A * u P c x`. -/ noncomputable def physicalU (P : Patch) (A G : ℝ) (c : Coeff) (x : ℝ) : ℝ := G + A * u P c x /-- Physical E, given by `A * (x ^ b + e P c x)`. -/ +@[expose] noncomputable def physicalE (P : Patch) (b A : ℝ) (c : Coeff) (x : ℝ) : ℝ := A * (x ^ b + e P c x) /-- Physical density as an element of `Debt`. -/ @@ -534,7 +536,7 @@ noncomputable def physicalDensity (P : Patch) (b A G : ℝ) (c : Coeff) (x : ℝ (physicalE P b A c x ^ 2 - (A * x ^ b) ^ 2) / (2 * x)] /-- Physical moments, defined pointwise by `∫ x, physicalDensity P b A G c x i`. -/ -noncomputable def physicalMoments (P : Patch) (b A G : ℝ) (c : Coeff) : Debt := +@[expose] noncomputable def physicalMoments (P : Patch) (b A G : ℝ) (c : Coeff) : Debt := fun i => ∫ x, physicalDensity P b A G c x i /-- Physical debt as an element of `Debt`. -/ @@ -1191,7 +1193,7 @@ theorem physical_edits_tsupport (P : Patch) (A : ℝ) (c : Coeff) : exact hx (by simp [he]) /-- Profile change density as an element of `Debt`. -/ -noncomputable def profileChangeDensity (U E dU dE : ℝ → ℝ) (x : ℝ) : Debt := +@[expose] noncomputable def profileChangeDensity (U E dU dE : ℝ → ℝ) (x : ℝ) : Debt := ![(U x + dU x) - U x, Real.sqrt (2 * x) * ((E x + dE x) - E x), (U x + dU x) * Real.sqrt (2 * x) * (E x + dE x) - U x * Real.sqrt (2 * x) * E x, diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FiveRowRank.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FiveRowRank.lean index 46a37a0aa8..0a76279178 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FiveRowRank.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FiveRowRank.lean @@ -19,7 +19,7 @@ No nonsingularity or preimage is assumed: the profiles use the constructed localized moment inverse. -/ -@[expose] public section +public section noncomputable section @@ -92,9 +92,9 @@ theorem cell_union_subset {n : ℕ} (a b : ℝ) (hab : a < b) : exact ⟨(cellLower_gt a b hab j).trans hj.1, hj.2.trans (cellUpper_lt a b hab j)⟩ /-- Angular powers, given by `![2, -2 - 2 * lam, -2 * lam]`. -/ -def angularPowers (lam : ℝ) : Fin 3 → ℝ := ![2, -2 - 2 * lam, -2 * lam] +@[expose] def angularPowers (lam : ℝ) : Fin 3 → ℝ := ![2, -2 - 2 * lam, -2 * lam] /-- Axial powers, given by `![1, 1 - 2 * lam]`. -/ -def axialPowers (lam : ℝ) : Fin 2 → ℝ := ![1, 1 - 2 * lam] +@[expose] def axialPowers (lam : ℝ) : Fin 2 → ℝ := ![1, 1 - 2 * lam] theorem angularPowers_injective (lam : ℝ) (hlam : 0 < lam) : Injective (angularPowers lam) := by intro i j hij @@ -122,7 +122,7 @@ def gamma (lam C a b : ℝ) (d : Debt) : ℝ → ℝ := (axialDebt C d) /-- The unaltered power-law angular mean on the repair patch. -/ -def background (lam C R : ℝ) : ℝ := C * R ^ (-1 - 2 * lam) +@[expose] def background (lam C R : ℝ) : ℝ := C * R ^ (-1 - 2 * lam) theorem deltaV_contDiff (lam C a b : ℝ) (d : Debt) : ContDiff ℝ ∞ (deltaV lam C a b d) := LocalizedMomentRepair.repair_contDiff _ _ _ _ @@ -374,10 +374,10 @@ def gammaLinearMap (lam C a b : ℝ) : Debt →ₗ[ℝ] (ℝ → ℝ) := (axialDebtLinearMap C) @[simp] theorem deltaVLinearMap_apply (lam C a b : ℝ) (d : Debt) : - deltaVLinearMap lam C a b d = deltaV lam C a b d := rfl + deltaVLinearMap lam C a b d = deltaV lam C a b d := by rfl @[simp] theorem gammaLinearMap_apply (lam C a b : ℝ) (d : Debt) : - gammaLinearMap lam C a b d = gamma lam C a b d := rfl + gammaLinearMap lam C a b d = gamma lam C a b d := by rfl theorem deltaV_add (lam C a b : ℝ) (d e : Debt) : deltaV lam C a b (d + e) = deltaV lam C a b d + deltaV lam C a b e := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatCutoff.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatCutoff.lean index 318dba1e68..102c9a9003 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatCutoff.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatCutoff.lean @@ -20,7 +20,7 @@ These facts concern this scalar edge function, not the manuscript's stress factorization, PDE estimates, or asserted smooth force extension. -/ -@[expose] public section +public section noncomputable section @@ -70,7 +70,7 @@ theorem edge_le_glue {c x : ℝ} (hxc : x ≤ c) : simpa only [neg_div] using neg_le_neg hi /-- A family containing the edge and every inverse-power weighted edge. -/ -def polynomialEdge (c : ℝ) (p : ℝ[X]) (x : ℝ) : ℝ := +@[expose] def polynomialEdge (c : ℝ) (p : ℝ[X]) (x : ℝ) : ℝ := p.eval x⁻¹ * edge c x @[simp] theorem polynomialEdge_zero (c : ℝ) (p : ℝ[X]) : @@ -90,7 +90,7 @@ theorem polynomialEdge_tendsto_zero {c : ℝ} (hc : 0 < c) (p : ℝ[X]) : /-- The polynomial transformation induced by differentiating an inverse polynomial times the edge: `2 c X³ p - X² p'`. -/ -def derivativePolynomial (c : ℝ) (p : ℝ[X]) : ℝ[X] := +@[expose] def derivativePolynomial (c : ℝ) (p : ℝ[X]) : ℝ[X] := C (2 * c) * X ^ 3 * p - X ^ 2 * p.derivative theorem polynomialEdge_hasDerivAt {c : ℝ} (hc : 0 < c) (p : ℝ[X]) (x : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatKernelBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatKernelBounds.lean index 47c94c24e4..ffd93dad03 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatKernelBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatKernelBounds.lean @@ -22,7 +22,7 @@ many derivatives of its smooth profile and proves continuity in the integral parameter. Exponential-majorant integrability is supplied separately. -/ -@[expose] public section +public section noncomputable section @@ -33,10 +33,10 @@ open scoped ContDiff namespace NavierStokes.FlatKernelBounds /-- Denominator, given by `Real.sqrt (1 + x ^ 2 * t)`. -/ -def denominator (x t : ℝ) : ℝ := Real.sqrt (1 + x ^ 2 * t) +@[expose] def denominator (x t : ℝ) : ℝ := Real.sqrt (1 + x ^ 2 * t) /-- Coordinate, given by `x / denominator x t`. -/ -def coordinate (x t : ℝ) : ℝ := x / denominator x t +@[expose] def coordinate (x t : ℝ) : ℝ := x / denominator x t theorem base_pos {x t : ℝ} (ht : 0 ≤ t) : 0 < 1 + x ^ 2 * t := by positivity @@ -93,7 +93,7 @@ inductive Expr where | mul (e f : Expr) /-- Eval used in flat kernel bounds. -/ -def Expr.eval : Expr → (ℝ → ℝ) → ℝ → ℝ → ℝ +@[expose] def Expr.eval : Expr → (ℝ → ℝ) → ℝ → ℝ → ℝ | .const c, _, _, _ => c | .x, _, xv, _ => xv | .t, _, _, tv => tv @@ -190,7 +190,7 @@ theorem abs_inv_denominator_le_one {x t : ℝ} (ht : 0 ≤ t) : (one_le_denominator (x := x) ht) /-- A bound uniform in a closed `x` interval and polynomial in nonnegative `t`. -/ -def PolynomialBound (R : ℝ) (F : ℝ → ℝ → ℝ) : Prop := +@[expose] def PolynomialBound (R : ℝ) (F : ℝ → ℝ → ℝ) : Prop := ∃ C : ℝ, ∃ N : ℕ, 0 ≤ C ∧ ∀ x t : ℝ, |x| ≤ R → 0 ≤ t → |F x t| ≤ C * (1 + t) ^ N @@ -343,7 +343,7 @@ theorem Expr.jetOrder_iterate_diff_le (e : Expr) (n : ℕ) : (by simpa only [Nat.add_assoc] using Nat.add_le_add_right ih 1) /-- Kernel expr, given by `.mul (.mul (Expr.root.pow j) (Expr.invRoot.pow 3)) (.jet 0)`. -/ -def kernelExpr (j : ℕ) : Expr := +@[expose] def kernelExpr (j : ℕ) : Expr := .mul (.mul (Expr.root.pow j) (Expr.invRoot.pow 3)) (.jet 0) theorem kernelExpr_jetOrder (j : ℕ) : (kernelExpr j).jetOrder = 0 := by @@ -355,7 +355,7 @@ theorem kernelExpr_jetOrder (j : ℕ) : (kernelExpr j).jetOrder = 0 := by /-- Kernel, given by `(1 / 2 : ℝ) * Real.exp (-c * t) * (denominator x t ^ j / denominator x t ^ 3) * b (coordinate x t)`. -/ -def kernel (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x t : ℝ) : ℝ := +@[expose] def kernel (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x t : ℝ) : ℝ := (1 / 2 : ℝ) * Real.exp (-c * t) * (denominator x t ^ j / denominator x t ^ 3) * b (coordinate x t) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitive.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitive.lean index 382917ed04..10c94b8636 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitive.lean @@ -22,7 +22,7 @@ quotient by an exponentially small factor. The statements below keep those obligations separate. -/ -@[expose] public section +public section noncomputable section @@ -34,16 +34,16 @@ open NavierStokes.FlatCutoff namespace NavierStokes.FlatPrimitive /-- Integrand, given by `(edge c x / x ^ j) * b x`. -/ -def integrand (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x : ℝ) : ℝ := +@[expose] def integrand (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x : ℝ) : ℝ := (edge c x / x ^ j) * b x /-- Primitive, given by `∫ u in (0 : ℝ)..x, integrand c j b u`. -/ -def primitive (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x : ℝ) : ℝ := +@[expose] def primitive (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x : ℝ) : ℝ := ∫ u in (0 : ℝ)..x, integrand c j b u /-- The expected factor `exp(-c/x²) x^(3-j)`, written without truncated natural subtraction and defined smoothly at zero. -/ -def scale (c : ℝ) (j : ℕ) (x : ℝ) : ℝ := +@[expose] def scale (c : ℝ) (j : ℕ) (x : ℝ) : ℝ := (edge c x / x ^ j) * x ^ 3 theorem integrand_contDiff {c : ℝ} (hc : 0 < c) (j : ℕ) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitiveFactor.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitiveFactor.lean index 752ec1d61c..cdcb77abba 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitiveFactor.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FlatPrimitiveFactor.lean @@ -20,7 +20,7 @@ Natural powers of the square root encode the real power `(j - 3) / 2` without truncating subtraction in the natural numbers. -/ -@[expose] public section +public section noncomputable section @@ -32,19 +32,19 @@ open NavierStokes.FlatCutoff NavierStokes.FlatPrimitive namespace NavierStokes.FlatPrimitiveFactor /-- Denominator, given by `Real.sqrt (1 + x ^ 2 * t)`. -/ -def denominator (x t : ℝ) : ℝ := Real.sqrt (1 + x ^ 2 * t) +@[expose] def denominator (x t : ℝ) : ℝ := Real.sqrt (1 + x ^ 2 * t) /-- Coordinate, given by `x / denominator x t`. -/ -def coordinate (x t : ℝ) : ℝ := x / denominator x t +@[expose] def coordinate (x t : ℝ) : ℝ := x / denominator x t /-- Kernel, given by `(1 / 2 : ℝ) * Real.exp (-c * t) * (denominator x t ^ j / denominator x t ^ 3) * b (coordinate x t)`. -/ -def kernel (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x t : ℝ) : ℝ := +@[expose] def kernel (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x t : ℝ) : ℝ := (1 / 2 : ℝ) * Real.exp (-c * t) * (denominator x t ^ j / denominator x t ^ 3) * b (coordinate x t) /-- Factor, given by `∫ t in Ioi (0 : ℝ), kernel c j b x t`. -/ -def factor (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x : ℝ) : ℝ := +@[expose] def factor (c : ℝ) (j : ℕ) (b : ℝ → ℝ) (x : ℝ) : ℝ := ∫ t in Ioi (0 : ℝ), kernel c j b x t theorem denominator_inner_pos (x : ℝ) {t : ℝ} (ht : 0 ≤ t) : 0 < 1 + x ^ 2 * t := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FourierAlias.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FourierAlias.lean index 3e67d0fa1f..e3c8a51f0a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FourierAlias.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FourierAlias.lean @@ -18,7 +18,7 @@ The compactification defect is retained as an actual function. Its averaging and integration-by-parts identities concern genuine Bochner integrals. -/ -@[expose] public section +public section noncomputable section @@ -38,15 +38,16 @@ section Averages variable {F : Type} [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Integer translation invariance of an actual function on the universal cover. -/ -noncomputable def TorusPeriodic (f : Plane → F) : Prop := +@[expose] noncomputable def TorusPeriodic (f : Plane → F) : Prop := ∀ Y : Plane, ∀ k : Frequency, f (Y + ((k.1 : ℝ), (k.2 : ℝ))) = f Y /-- The actual normalized unit-square average. -/ -noncomputable def torusMean (f : Plane → F) : F := +@[expose] noncomputable def torusMean (f : Plane → F) : F := ∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (x, y) /-- Slice mean, given by `torusMean (fun Y => f (U, Y))`. -/ -noncomputable def sliceMean (f : State → F) (U : ℝ) : F := torusMean (fun Y => f (U, Y)) +@[expose] noncomputable def sliceMean (f : State → F) (U : ℝ) : F := + torusMean (fun Y => f (U, Y)) /-- The exact defect in `D Ic = f - cutoffAlias`. -/ noncomputable def cutoffAlias (χ : ℝ → ℝ) (M : ℝ) (v : Plane) (f : State → F) (z : State) : F := @@ -503,7 +504,7 @@ theorem cutoffAlias_eq_nonbarPart {a b M : ℝ} {v : Plane} {f : State → ℂ} rw [totalIntegral_nonbarPart hf hs hm] /-- The successive slow derivatives of actual directional Fourier inverses. -/ -noncomputable def fourierSourceJet (d : Direction) (f : State → ℂ) (p : ℕ) : State → ℂ := +@[expose] noncomputable def fourierSourceJet (d : Direction) (f : State → ℂ) (p : ℕ) : State → ℂ := RadialAlias.sourceJet (inverse d) f p /-- The interleaved construction is exactly the manuscript's slow derivative @@ -512,7 +513,8 @@ theorem fourierSourceJet_eq_parameterJet (d : Direction) {f : State → ℂ} (hf : ContDiff ℝ ∞ f) (hp : ParametricTorusInverse.Periodic f) (p : ℕ) : fourierSourceJet d f p = parameterJet p (iterateInverse d p f) := by induction p with - | zero => rfl + | zero => simp only [fourierSourceJet, RadialAlias.sourceJet_zero, parameterJet_zero, + iterateInverse_zero] | succ p ih => have heq : fourierSourceJet d f (p + 1) = parameterPartial (inverse d (fourierSourceJet d f p)) := @@ -616,7 +618,9 @@ theorem cutoffAlias_arbitrary_order_of_integratedMean_zero (d : Direction) /-- The square average is the normalized Haar average of the actual descent. -/ theorem torusMean_eq_haar {f : Plane → ℂ} (hf : Continuous f) (hp : TorusPeriodic f) : torusMean f = ∫ z, SmoothFourierData.descendContinuous f hf hp z ∂torusMeasure := by - rw [← SmoothFourierData.coefficient_zero_eq_mean] + change SmoothFourierData.UnitPeriodic f at hp + rw [← SmoothFourierData.coefficient_zero_eq_mean, + SmoothFourierData.torusLift_descendContinuous] exact (SmoothFourierData.coefficient_zero_eq_integral f).symm theorem cutoffAlias_haar_zero (d : Direction) {a b M : ℝ} {f : State → ℂ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/FuturePressureBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/FuturePressureBounds.lean index f4e02b20d0..9a3fced1bf 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/FuturePressureBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/FuturePressureBounds.lean @@ -19,7 +19,7 @@ slopes, including the first unit ramp. Angular derivatives are derivatives of the actual improper integral. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeAliasDecay.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeAliasDecay.lean index 6326966428..a8c364451f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeAliasDecay.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeAliasDecay.lean @@ -15,7 +15,7 @@ The finite-jet estimates are local in the slow variables. The radial frequency is finally specialized to the actual manuscript exponent. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeDebtIncrement.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeDebtIncrement.lean index 0a548b9949..7993959cef 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeDebtIncrement.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeDebtIncrement.lean @@ -17,7 +17,7 @@ The change estimates use the actual velocity and covariance increments; no improved bound on the whole updated covariance or debt is assumed. -/ -@[expose] public section +public section namespace NavierStokes.GaugeDebtIncrement diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeExcludedBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeExcludedBounds.lean index e9acb4c901..d30e8dbffb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeExcludedBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeExcludedBounds.lean @@ -19,7 +19,7 @@ regularity is supplied by the incoming primitive fields and the genuine pressure reconstruction, not by a hypothesis on an alias output. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMassPreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMassPreservation.lean index 23a2e9490b..3e56139ef2 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMassPreservation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMassPreservation.lean @@ -16,7 +16,7 @@ All conclusions are restricted to the valid open slow region. The common torus index and the moving radial support are retained throughout. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMomentBalances.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMomentBalances.lean index e661959cf3..f743b6dd93 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMomentBalances.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeMomentBalances.lean @@ -26,7 +26,7 @@ Auxiliary torus averaging, radial integration, and the pressure constructor connect the literal state residual to its actual slow debt derivatives. -/ -@[expose] public section +public section noncomputable section @@ -38,7 +38,7 @@ open scoped BigOperators ContDiff Topology variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Mean bar, defined pointwise by `MeanMomentBounds.liftedTorusAverage (f n)`. -/ -noncomputable def meanBar (f : ScalarField (Lift S)) : ScalarField (Lift S) := +@[expose] noncomputable def meanBar (f : ScalarField (Lift S)) : ScalarField (Lift S) := fun n => MeanMomentBounds.liftedTorusAverage (f n) namespace AuxiliaryAverage @@ -376,11 +376,11 @@ noncomputable def averaged (f : ScalarField (Lift S)) : ℕ → ℝ × S → ℝ fun n => PressureStream.torusAverage (f n) /-- Lift slow, defined pointwise by `f n (x.1, x.2.1)`. -/ -noncomputable def liftSlow (f : ℕ → ℝ × S → ℝ) : ScalarField (Lift S) := +@[expose] noncomputable def liftSlow (f : ℕ → ℝ × S → ℝ) : ScalarField (Lift S) := fun n x => f n (x.1, x.2.1) /-- Native operators, given by `graphOperators r ε fast (z, 0) (t, 0) v`. -/ -noncomputable def nativeOperators (r : ReconstructionData) (ε fast : ℕ → ℝ) +@[expose] noncomputable def nativeOperators (r : ReconstructionData) (ε fast : ℕ → ℝ) (z t : S) (v : PressureStream.Plane) : MeanIncrementBounds.Operators (Lift S) := graphOperators r ε fast (z, 0) (t, 0) v @@ -1211,7 +1211,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1412,7 +1412,7 @@ theorem LocalField.add {a b : ℝ} {U : Set S} {f g : ScalarField (PressureStrea exact congrArg₂ (· + ·) (hf.periodic n R s hs Y k) (hg.periodic n R s hs Y k) /-- Localize family, defined pointwise by `PhysicalMeanDomain.localize χ (f n)`. -/ -noncomputable def localizeFamily (χ : S → ℝ) (f : ScalarField (PressureStream.Lift S)) : +@[expose] noncomputable def localizeFamily (χ : S → ℝ) (f : ScalarField (PressureStream.Lift S)) : ScalarField (PressureStream.Lift S) := fun n => PhysicalMeanDomain.localize χ (f n) theorem LocalField.localize {a b : ℝ} {U : Set S} (hU : IsOpen U) @@ -1717,7 +1717,7 @@ abbrev MovingAxialInputs {coord : ℝ} (U : SlowRegion coord) (a b : ℝ) MovingFluxInputs U a b u.mean.axial (axialRadialFlux c u) (axialAxialFlux c u) c.virtualAxial /-- Pressure recipe, given by `(VariableGaugeMean.reconstructState g c u).pressure`. -/ -noncomputable def pressureRecipe (g : VariableGaugeMean.GaugeData Plane) +@[expose] noncomputable def pressureRecipe (g : VariableGaugeMean.GaugeData Plane) (c : Context Point) (u : State Point) : ScalarField Point := (VariableGaugeMean.reconstructState g c u).pressure diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeRadialResidualBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeRadialResidualBounds.lean index ab541007e7..e550c2b427 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeRadialResidualBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeRadialResidualBounds.lean @@ -18,7 +18,7 @@ mean class follows on the same moving strip, retaining the vanishing edge weight and all ordinary slow derivatives. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeStateCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeStateCoherence.lean index c5179cfb37..c3408e6ba4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeStateCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaugeStateCoherence.lean @@ -17,7 +17,7 @@ whole radial/torus fibers. The recomputed pressure and retained cutoff alias are obtained from their genuine integral definitions. -/ -@[expose] public section +public section namespace NavierStokes.GaugeStateCoherence @@ -354,14 +354,14 @@ theorem pressureAliasState_on {l c : ℝ} (hl : 0 < l) (P : S ≃L[ℝ] T) (k : /-! ## The actual similarity gauge in two bands -/ /-- Band scale, given by `(ChartScales.Q n / ChartScales.Q m) ^ (1 / 2 : ℝ)`. -/ -noncomputable def bandScale (n m : ℕ) : ℝ := +@[expose] noncomputable def bandScale (n m : ℕ) : ℝ := (ChartScales.Q n / ChartScales.Q m) ^ (1 / 2 : ℝ) theorem bandScale_pos (n m : ℕ) : 0 < bandScale n m := Real.rpow_pos_of_pos (div_pos (ChartScales.Q_pos n) (ChartScales.Q_pos m)) _ /-- Band velocity scale, given by `(ChartScales.Q n / ChartScales.Q m) ^ CoordinateAlgebra.A h`. -/ -noncomputable def bandVelocityScale (h : ℝ) (n m : ℕ) : ℝ := +@[expose] noncomputable def bandVelocityScale (h : ℝ) (n m : ℕ) : ℝ := (ChartScales.Q n / ChartScales.Q m) ^ CoordinateAlgebra.A h /-- The slow coordinates are ordered `(T,Z)`, as in the moving mean gauge. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianEnvelope.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianEnvelope.lean index 212bec7b32..5d65f18a46 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianEnvelope.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianEnvelope.lean @@ -30,12 +30,12 @@ These results do not assert bounds on the actual variable-coefficient ODE or on its parameter derivatives. -/ -@[expose] public section +public section namespace NavierStokes.PulseGrowth /-- Scalar growth of the positive reference mode after the chosen viscous damping. -/ -noncomputable def netGrowth (lam u s : ℝ) : ℝ := +@[expose] noncomputable def netGrowth (lam u s : ℝ) : ℝ := lam / Real.sqrt (1 + s ^ 2) - lam * (1 + s ^ 2) / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) @@ -160,7 +160,7 @@ theorem netGrowth_strictAntiOn_nonneg {lam u : ℝ} (hlam : 0 < lam) : simpa only [abs_of_nonneg hs0, abs_of_nonneg ht0] using hst /-- Magnitude of either signed schedule, in the slot-time variable. -/ -noncomputable def slotMagnitude (u ell v : ℝ) : ℝ := u / 2 + u * v / ell +@[expose] noncomputable def slotMagnitude (u ell v : ℝ) : ℝ := u / 2 + u * v / ell theorem slotMagnitude_midpoint (u ell : ℝ) (hell : ell ≠ 0) : slotMagnitude u ell (ell / 2) = u := by @@ -212,14 +212,14 @@ end end -@[expose] public section +public section namespace NavierStokes.GaussianEnvelope open Set MeasureTheory /-- Envelope normalized to one at the midpoint. -/ -noncomputable def envelope (rate : ℝ → ℝ) (midpoint time : ℝ) : ℝ := +@[expose] noncomputable def envelope (rate : ℝ → ℝ) (midpoint time : ℝ) : ℝ := Real.exp (∫ x in midpoint..time, rate x) /-- Exact integral of a centered affine rate, for either order of the endpoints. -/ @@ -359,11 +359,11 @@ theorem hasDerivAt_netGrowth (lam u s : ℝ) : ring /-- A positive lower bound on the magnitude of the rate derivative in the slot. -/ -noncomputable def referenceMinSlope (lam u : ℝ) : ℝ := +@[expose] noncomputable def referenceMinSlope (lam u : ℝ) : ℝ := lam * u / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) /-- An upper bound on the magnitude of the rate derivative in the slot. -/ -noncomputable def referenceMaxSlope (lam u : ℝ) : ℝ := +@[expose] noncomputable def referenceMaxSlope (lam u : ℝ) : ℝ := 3 * lam * u / 2 + 3 * lam * u / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) theorem referenceMinSlope_pos {lam u : ℝ} (hlam : 0 < lam) (hu : 0 < u) : @@ -410,7 +410,7 @@ theorem referenceSlope_bounds {lam u s : ℝ} (hlam : 0 < lam) (hu : 0 < u) constructor <;> linarith /-- The reference rate expressed in slot time. -/ -noncomputable def referenceRate (lam u ell time : ℝ) : ℝ := +@[expose] noncomputable def referenceRate (lam u ell time : ℝ) : ℝ := PulseGrowth.netGrowth lam u (PulseGrowth.slotMagnitude u ell time) theorem hasDerivAt_referenceRate (lam u ell time : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianTailFlat.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianTailFlat.lean index 9729c25bda..c79f6b2c8c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianTailFlat.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GaussianTailFlat.lean @@ -19,7 +19,7 @@ from Section 8.2. No error field is set to zero: local vanishing on the plateau the Gaussian bound off that plateau, and higher Leibniz estimates are used. -/ -@[expose] public section +public section noncomputable section @@ -97,7 +97,7 @@ theorem profile_jet_bounded (m : ℕ) : exact (hC v).trans (le_max_left _ _) /-- Slot cutoff, given by `profile (v / L)`. -/ -noncomputable def slotCutoff (L : ℝ) (v : ℝ) : ℝ := profile (v / L) +@[expose] noncomputable def slotCutoff (L : ℝ) (v : ℝ) : ℝ := profile (v / L) theorem slotCutoff_contDiff (L : ℝ) : ContDiff ℝ ∞ (slotCutoff L) := profile_contDiff.comp (contDiff_id.div_const L) @@ -397,7 +397,7 @@ theorem affine_profile_memClass (s : StripData D) {g : ℝ → ℝ} /-- The two excluded errors, retained as actual functions. `θ` is the normalized slot coordinate `v/L`. -/ -noncomputable def cutoffError (L : ℝ) (θ : D → ℝ) (u f : D → E) (x : D) : E := +@[expose] noncomputable def cutoffError (L : ℝ) (θ : D → ℝ) (u f : D → E) (x : D) : E := (L⁻¹ * deriv profile (θ x)) • u x + (1 - profile (θ x)) • f x omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -515,15 +515,15 @@ structure SlotFamily (s : StripData D) where namespace SlotFamily /-- Coordinate, given by `g.offset n + g.linear n x`. -/ -noncomputable def coordinate {s : StripData D} (g : SlotFamily s) (n : ℕ) (x : D) : ℝ := +@[expose] noncomputable def coordinate {s : StripData D} (g : SlotFamily s) (n : ℕ) (x : D) : ℝ := g.offset n + g.linear n x /-- Cutoff, given by `profile (g.coordinate n x)`. -/ -noncomputable def cutoff {s : StripData D} (g : SlotFamily s) (n : ℕ) (x : D) : ℝ := +@[expose] noncomputable def cutoff {s : StripData D} (g : SlotFamily s) (n : ℕ) (x : D) : ℝ := profile (g.coordinate n x) /-- Error, given by `cutoffError (g.length n) (g.coordinate n) (u n) (f n)`. -/ -noncomputable def error {s : StripData D} (g : SlotFamily s) (u f : ℕ → D → E) +@[expose] noncomputable def error {s : StripData D} (g : SlotFamily s) (u f : ℕ → D → E) (n : ℕ) : D → E := cutoffError (g.length n) (g.coordinate n) (u n) (f n) theorem coordinate_contDiff {s : StripData D} (g : SlotFamily s) (n : ℕ) : @@ -740,7 +740,7 @@ noncomputable def actualSlotFamily (s : StripData D) (r0 h : ℝ) @[simp] theorem actualSlotFamily_length (s : StripData D) (r0 h : ℝ) (hr0 : 0 < r0) (hh : 0 ≤ h) (η : D →L[ℝ] ℝ) (center : ℕ → ℝ) (n : ℕ) : - (actualSlotFamily s r0 h hr0 hh η center).length n = ChartScales.slotLength r0 h n := rfl + (actualSlotFamily s r0 h hr0 hh η center).length n = ChartScales.slotLength r0 h n := by rfl theorem actualSlotFamily_coordinate (s : StripData D) (r0 h : ℝ) (hr0 : 0 < r0) (hh : 0 ≤ h) (η : D →L[ℝ] ℝ) (center : ℕ → ℝ) (n : ℕ) (x : D) : @@ -762,7 +762,7 @@ theorem actualSlotFamily_cutoff (s : StripData D) (r0 h : ℝ) /-- The reference Gaussian envelope, extended by zero away from its slot. This is a weight, not a redefinition of either retained error. -/ -noncomputable def referenceSlotEnvelope (lam u L θ : ℝ) : ℝ := +@[expose] noncomputable def referenceSlotEnvelope (lam u L θ : ℝ) : ℝ := if θ ∈ Icc (0 : ℝ) 1 then GaussianEnvelope.envelope (GaussianEnvelope.referenceRate lam u L) (L / 2) (L * θ) else 0 @@ -969,7 +969,7 @@ noncomputable def omittedSource {s : StripData D} (g : SlotFamily s) theorem error_eq_sum {s : StripData D} (g : SlotFamily s) (u f : ℕ → D → E) (n : ℕ) (x : D) : - g.error u f n x = g.derivativeError u n x + g.omittedSource f n x := rfl + g.error u f n x = g.derivativeError u n x + g.omittedSource f n x := by rfl private theorem jet_eq_zero_of_eventually {u : D → E} {x : D} (he : u =ᶠ[𝓝 x] fun _ => 0) (j : ℕ) : iteratedFDeriv ℝ j u x = 0 := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GermCandidateAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GermCandidateAssembly.lean index fe13362c73..465673d31f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GermCandidateAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GermCandidateAssembly.lean @@ -50,7 +50,7 @@ unit cube. All derivatives below are the ordinary Frechet coordinate derivatives on `ProblemStatement.Space`. -/ -@[expose] public section +public section noncomputable section @@ -419,7 +419,7 @@ for a continuous periodic field across time one. It assumes no general Navier--Stokes existence theorem and never identifies pressure gauges. -/ -@[expose] public section +public section noncomputable section @@ -726,7 +726,7 @@ end end -@[expose] public section +public section noncomputable section @@ -946,7 +946,7 @@ schedule supplies the actual velocity and pressure sums, their endpoint extensions, and the force with all proved consequences. -/ -@[expose] public section +public section noncomputable section @@ -1100,7 +1100,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GlobalSlowProfiles.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GlobalSlowProfiles.lean index cbb26b2494..cff997881e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GlobalSlowProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GlobalSlowProfiles.lean @@ -22,7 +22,7 @@ All integrals and differential operators below are the actual ones. In particular the preceding radial source is retained when pressure is recomputed. -/ -@[expose] public section +public section noncomputable section @@ -1880,7 +1880,7 @@ theorem betaFromU_x_divergence {S : Set ℝ} {h : ℝ} (d : Domain S h) (lam : linear_combination he /-- As slow profiles, constructed using `SlowResidualMatching.ofBeta`. -/ -noncomputable def asSlowProfiles {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : +@[expose] noncomputable def asSlowProfiles {S : Set ℝ} {h C : ℝ} (s : Scheme S h C) : SlowExpansionResidual.SlowProfiles := SlowResidualMatching.ofBeta (fun j => xProfile (profiles s j).phi) (fun j => xProfile (profiles s j).axial) (fun j => xProfile (profiles s j).beta) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/GluedStageEstimates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/GluedStageEstimates.lean index b6f01b0551..8a2f32642a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/GluedStageEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/GluedStageEstimates.lean @@ -47,7 +47,7 @@ identity uses an invertible linear chart and does not require an additional smoothness assumption on the phase. -/ -@[expose] public section +public section noncomputable section @@ -337,7 +337,7 @@ their actual physical modes. The angle and Cartesian rotation are the same at both bands, so the native scale cancels before applying either map. -/ -@[expose] public section +public section noncomputable section @@ -404,7 +404,7 @@ end end -@[expose] public section +public section noncomputable section @@ -785,7 +785,7 @@ The two column choices are retained by the signed-label map and are already included in the 2250-color palette. The finite harmonic sum remains explicit. -/ -@[expose] public section +public section noncomputable section @@ -1215,7 +1215,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCalculus.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCalculus.lean index db8dc0bb30..3d9488a59b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCalculus.lean @@ -33,7 +33,7 @@ candidate manuscript. The radial formulas below are stated away from `r = 0`. All differential operators use Mathlib's actual Fréchet derivatives. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ abbrev Plane := ℝ × ℝ abbrev Lift := Plane × Plane /-- The radial coefficient in the exact graph derivative. -/ -def radialSpeed (d r : ℝ) : ℝ := d * r ^ (d - 1) +@[expose] def radialSpeed (d r : ℝ) : ℝ := d * r ^ (d - 1) /-- Embed physical radial/time coordinates in the auxiliary lift. -/ def graph (d : ℝ) (vr vt : Plane) (q : Plane) : Lift := @@ -279,7 +279,7 @@ end end -@[expose] public section +public section noncomputable section @@ -292,7 +292,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] /-- The actual derivative in a prescribed, possibly varying direction field. -/ -noncomputable def along (V : E → E) (f : E → F) (x : E) : F := +@[expose] noncomputable def along (V : E → E) (f : E → F) (x : E) : F := fderiv ℝ f x (V x) theorem contDiffOn_along {U : Set E} {V : E → E} {f : E → F} @@ -333,7 +333,7 @@ theorem along_ofReal (V : E → E) {f : E → ℝ} {x : E} rfl /-- The imaginary frequency `i κ`. -/ -noncomputable def phaseFactor (κ : ℝ) : ℂ := (κ : ℂ) * Complex.I +@[expose] noncomputable def phaseFactor (κ : ℝ) : ℂ := (κ : ℂ) * Complex.I theorem phaseFactor_sq (κ : ℝ) : phaseFactor κ ^ 2 = -(κ : ℂ) ^ 2 := by simp [phaseFactor, mul_pow, Complex.I_sq] @@ -342,7 +342,7 @@ theorem phaseFactor_sq (κ : ℝ) : phaseFactor κ ^ 2 = -(κ : ℂ) ^ 2 := by simp [phaseFactor, Real.norm_eq_abs] /-- `κ = k*j` gives the carrier in the manuscript. -/ -noncomputable def carrier (κ : ℝ) (Φ : E → ℝ) (x : E) : ℂ := +@[expose] noncomputable def carrier (κ : ℝ) (Φ : E → ℝ) (x : E) : ℂ := Complex.exp (phaseFactor κ * (Φ x : ℂ)) omit [NormedAddCommGroup E] [NormedSpace ℝ E] in @@ -381,7 +381,7 @@ theorem along_carrier (V : E → E) (κ : ℝ) {Φ : E → ℝ} {x : E} ring /-- A coefficient multiplied by one actual complex harmonic. -/ -noncomputable def mode (κ : ℝ) (Φ : E → ℝ) (a : E → ℂ) (x : E) : ℂ := +@[expose] noncomputable def mode (κ : ℝ) (Φ : E → ℝ) (a : E → ℂ) (x : E) : ℂ := a x * carrier κ Φ x theorem contDiffOn_mode {U : Set E} (κ : ℝ) {Φ : E → ℝ} {a : E → ℂ} @@ -448,18 +448,18 @@ theorem along_along_mode {U : Set E} {V : E → E} (κ : ℝ) /-- The scalar cylindrical Laplacian, also valid on prescribed graph directions. `Vθ` is the unscaled angular direction. -/ -noncomputable def cylindricalLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def cylindricalLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) (f : E → F) (x : E) : F := along Vr (along Vr f) x + (R x)⁻¹ • along Vr f x + ((R x) ^ 2)⁻¹ • along Vθ (along Vθ f) x + along Vz (along Vz f) x /-- The actual phase gradient in the orthonormal cylindrical frame. -/ -noncomputable def phaseNormal (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def phaseNormal (R : E → ℝ) (Vr Vθ Vz : E → E) (Φ : E → ℝ) (x : E) : EuclideanSpace ℝ (Fin 3) := !₂[along Vr Φ x, along Vθ Φ x / R x, along Vz Φ x] /-- The phase-square coefficient before rewriting it as a normal norm. -/ -noncomputable def phaseSquare (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def phaseSquare (R : E → ℝ) (Vr Vθ Vz : E → E) (Φ : E → ℝ) (x : E) : ℝ := (along Vr Φ x) ^ 2 + ((R x) ^ 2)⁻¹ * (along Vθ Φ x) ^ 2 + (along Vz Φ x) ^ 2 @@ -472,7 +472,7 @@ theorem phaseSquare_eq_norm_sq (R : E → ℝ) (Vr Vθ Vz : E → E) ring /-- The phase/coefficient cross term in the scalar Laplacian. -/ -noncomputable def phaseCross (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def phaseCross (R : E → ℝ) (Vr Vθ Vz : E → E) (Φ : E → ℝ) (a : E → ℂ) (x : E) : ℂ := Complex.ofReal (along Vr Φ x) * along Vr a x + Complex.ofReal (((R x) ^ 2)⁻¹) * Complex.ofReal (along Vθ Φ x) * along Vθ a x + @@ -578,15 +578,15 @@ theorem cylindricalLaplacian_mode_angular_independent {U : Set E} (R : E → ℝ abbrev ComplexVector := Fin 3 → ℂ /-- Complex-bilinear contraction with a real normal. -/ -noncomputable def normalDot (n : EuclideanSpace ℝ (Fin 3)) (a : ComplexVector) : ℂ := +@[expose] noncomputable def normalDot (n : EuclideanSpace ℝ (Fin 3)) (a : ComplexVector) : ℂ := (n 0 : ℂ) * a 0 + (n 1 : ℂ) * a 1 + (n 2 : ℂ) * a 2 /-- Vector mode, defined pointwise by `mode κ Φ (fun y => a y i) x`. -/ -noncomputable def vectorMode (κ : ℝ) (Φ : E → ℝ) (a : E → ComplexVector) +@[expose] noncomputable def vectorMode (κ : ℝ) (Φ : E → ℝ) (a : E → ComplexVector) (x : E) : ComplexVector := fun i => mode κ Φ (fun y => a y i) x /-- The derivative of the cylindrical frame with respect to angle. -/ -noncomputable def angularGenerator (a : ComplexVector) : ComplexVector := +@[expose] noncomputable def angularGenerator (a : ComplexVector) : ComplexVector := ![-a 1, a 0, 0] theorem angularGenerator_sq (a : ComplexVector) : @@ -597,7 +597,7 @@ theorem angularGenerator_sq (a : ComplexVector) : /-- The scalar component Laplacians plus the two cylindrical frame connections. Its identification with Cartesian vector Laplacian belongs to the cylindrical coordinate calculus. -/ -noncomputable def cylindricalVectorLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def cylindricalVectorLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) (a : E → ComplexVector) (x : E) : ComplexVector := fun i => cylindricalLaplacian R Vr Vθ Vz (fun y => a y i) x + ((R x) ^ 2)⁻¹ • (2 * angularGenerator (fun j => along Vθ (fun y => a y j) x) i + @@ -656,13 +656,13 @@ theorem cylindricalVectorLaplacian_angular_independent {U : Set E} (R : E → simp only [hzero, Pi.zero_apply, mul_zero, zero_add] /-- Divergence of physical cylindrical components in prescribed directions. -/ -noncomputable def cylindricalDivergence (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def cylindricalDivergence (R : E → ℝ) (Vr Vθ Vz : E → E) (a : E → ComplexVector) (x : E) : ℂ := along Vr (fun y => a y 0) x + (R x)⁻¹ • a x 0 + (R x)⁻¹ • along Vθ (fun y => a y 1) x + along Vz (fun y => a y 2) x /-- The divergence of a coefficient with no angular dependence. -/ -noncomputable def strippedDivergence (R : E → ℝ) (Vr Vz : E → E) +@[expose] noncomputable def strippedDivergence (R : E → ℝ) (Vr Vz : E → E) (a : E → ComplexVector) (x : E) : ℂ := along Vr (fun y => a y 0) x + (R x)⁻¹ • a x 0 + along Vz (fun y => a y 2) x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCovariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCovariance.lean index 3ce587ded2..06c1e477dc 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCovariance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicCovariance.lean @@ -17,7 +17,7 @@ estimates. Real projection includes both conjugate harmonics. The constants are uniform over a fixed bound on the harmonic index. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicFields.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicFields.lean index bef62712ee..47a51ca5b9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicFields.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicFields.lean @@ -18,7 +18,7 @@ literal exponential sum, multiplication is convolution, and angular means are actual interval integrals over a period of length `2*pi`. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ abbrev Coefficients.sum {α M : Type*} [AddCommMonoid M] (c : Coefficients α) (f : ℤ → (α → ℂ) → M) : M := c.coeff.sum f /-- Character, given by `Complex.exp ((j : ℂ) * (φ : ℂ) * Complex.I)`. -/ -noncomputable def character (j : ℤ) (φ : ℝ) : ℂ := +@[expose] noncomputable def character (j : ℤ) (φ : ℝ) : ℂ := Complex.exp ((j : ℂ) * (φ : ℂ) * Complex.I) @[simp] theorem character_zero (φ : ℝ) : character 0 φ = 1 := by @@ -91,11 +91,11 @@ noncomputable def evaluateHom {α : Type*} (x : α) (φ : ℝ) : Coefficients α (fun _ _ => Commute.all _ _) /-- Evaluate, given by `c.sum (fun j a => a x * character j φ)`. -/ -noncomputable def evaluate {α : Type*} (c : Coefficients α) (x : α) (φ : ℝ) : ℂ := +@[expose] noncomputable def evaluate {α : Type*} (c : Coefficients α) (x : α) (φ : ℝ) : ℂ := c.sum (fun j a => a x * character j φ) theorem evaluate_eq_hom {α : Type*} (c : Coefficients α) (x : α) (φ : ℝ) : - evaluate c x φ = evaluateHom x φ c := rfl + evaluate c x φ = evaluateHom x φ c := by rfl @[simp] theorem evaluate_zero {α : Type*} (x : α) (φ : ℝ) : evaluate (0 : Coefficients α) x φ = 0 := (evaluateHom x φ).map_zero @@ -122,7 +122,7 @@ theorem evaluate_over {α : Type*} (c : Coefficients α) (s : Finset ℤ) /-- The slow/auxiliary parameter is `x`. Its coefficient functions have no angular input. The angular frequency is the literal integer `j*kp`. -/ -noncomputable def field {α : Type*} (c : Coefficients α) (k : ℝ) (Φ : α → ℝ) +@[expose] noncomputable def field {α : Type*} (c : Coefficients α) (k : ℝ) (Φ : α → ℝ) (kp : ℤ) (p : α × ℝ) : ℂ := evaluate c p.1 (k * Φ p.1 + (kp : ℝ) * p.2) theorem field_expansion {α : Type*} (c : Coefficients α) (k : ℝ) (Φ : α → ℝ) @@ -142,14 +142,14 @@ theorem field_angular_continuous {α : Type*} (c : Coefficients α) (k : ℝ) exact continuous_finsetSum _ (fun j _ => continuous_const.fun_mul (character_continuous _)) /-- Period, given by `2 * Real.pi`. -/ -noncomputable def period : ℝ := 2 * Real.pi +@[expose] noncomputable def period : ℝ := 2 * Real.pi theorem period_pos : 0 < period := mul_pos (by norm_num) Real.pi_pos theorem period_ne_zero : period ≠ 0 := period_pos.ne' /-- This is a genuine normalized angular integral. -/ -noncomputable def angularMean (f : ℝ → ℂ) : ℂ := +@[expose] noncomputable def angularMean (f : ℝ → ℂ) : ℂ := (period : ℂ)⁻¹ * ∫ θ in (0 : ℝ)..period, f θ theorem character_period (j : ℤ) : character j period = 1 := by @@ -220,7 +220,7 @@ theorem angularMean_field {α : Type*} (c : Coefficients α) (k : ℝ) (Φ : α simp [h0, hc] /-- Coefficient mass, given by `∑ j ∈ c.support, ‖c j x‖`. -/ -noncomputable def coefficientMass {α : Type*} (c : Coefficients α) (x : α) : ℝ := +@[expose] noncomputable def coefficientMass {α : Type*} (c : Coefficients α) (x : α) : ℝ := ∑ j ∈ c.support, ‖c j x‖ theorem coefficientMass_nonneg {α : Type*} (c : Coefficients α) (x : α) : @@ -275,7 +275,7 @@ noncomputable def conjugateReverse {α : Type*} (c : Coefficients α) : Coeffici (Finsupp.mapRange (fun a : α → ℂ => fun x => conj (a x)) (by ext x; simp) c.coeff) @[simp] theorem conjugateReverse_apply {α : Type*} (c : Coefficients α) (j : ℤ) (x : α) : - conjugateReverse c j x = conj (c (-j) x) := rfl + conjugateReverse c j x = conj (c (-j) x) := by rfl theorem evaluate_conjugateReverse {α : Type*} (c : Coefficients α) (x : α) (φ : ℝ) : evaluate (conjugateReverse c) x φ = conj (evaluate c x φ) := by @@ -353,7 +353,7 @@ theorem meanResidual_product_covariance rw [he, angularMean_coefficient_covariance c hconj 1 Ψ hkp q] /-- Band limited, given by `∀ j ∈ c.support, j.natAbs ≤ N`. -/ -def BandLimited {α : Type*} (c : Coefficients α) (N : ℕ) : Prop := +@[expose] def BandLimited {α : Type*} (c : Coefficients α) (N : ℕ) : Prop := ∀ j ∈ c.support, j.natAbs ≤ N theorem BandLimited.mono {α : Type*} {c : Coefficients α} {M N : ℕ} @@ -382,7 +382,7 @@ theorem band_single_zero {α : Type*} (a : α → ℂ) : simp [hj0] /-- Constant coefficient, given by `AddMonoidAlgebra.single 0 a`. -/ -noncomputable def constantCoefficient {α : Type*} (a : α → ℂ) : Coefficients α := +@[expose] noncomputable def constantCoefficient {α : Type*} (a : α → ℂ) : Coefficients α := AddMonoidAlgebra.single 0 a theorem band_constantCoefficient {α : Type*} (a : α → ℂ) : @@ -490,7 +490,7 @@ theorem wave_eq_evaluate (c : Coefficients E) (k : ℝ) (Φ : E → ℝ) (x : E) /-- Derivative coefficient, given by `HarmonicCalculus.along V a x + HarmonicCalculus.phaseFactor (k * (j : ℝ)) * Complex.ofReal (HarmonicCalculus.along V Φ x) * a x`. -/ -noncomputable def derivativeCoefficient (V : E → E) (k : ℝ) (Φ : E → ℝ) +@[expose] noncomputable def derivativeCoefficient (V : E → E) (k : ℝ) (Φ : E → ℝ) (j : ℤ) (a : E → ℂ) (x : E) : ℂ := HarmonicCalculus.along V a x + HarmonicCalculus.phaseFactor (k * (j : ℝ)) * Complex.ofReal (HarmonicCalculus.along V Φ x) * a x @@ -513,7 +513,7 @@ noncomputable def differentiate (V : E → E) (k : ℝ) (Φ : E → ℝ) @[simp] theorem differentiate_apply (V : E → E) (k : ℝ) (Φ : E → ℝ) (c : Coefficients E) (j : ℤ) : - differentiate V k Φ c j = derivativeCoefficient V k Φ j (c j) := rfl + differentiate V k Φ c j = derivativeCoefficient V k Φ j (c j) := by rfl theorem support_differentiate (V : E → E) (k : ℝ) (Φ : E → ℝ) (c : Coefficients E) : (differentiate V k Φ c).support ⊆ c.support := by @@ -676,7 +676,7 @@ noncomputable def angularDifferentiate {α : Type*} (kp : ℤ) (c : Coefficients @[simp] theorem angularDifferentiate_apply {α : Type*} (kp : ℤ) (c : Coefficients α) (j : ℤ) (x : α) : - angularDifferentiate kp c j x = (((j * kp : ℤ) : ℂ) * Complex.I) * c j x := rfl + angularDifferentiate kp c j x = (((j * kp : ℤ) : ℂ) * Complex.I) * c j x := by rfl theorem support_angularDifferentiate {α : Type*} (kp : ℤ) (c : Coefficients α) : (angularDifferentiate kp c).support ⊆ c.support := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicResidual.lean index 318322008c..c0875d8fc4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicResidual.lean @@ -16,7 +16,7 @@ The coefficient operations below reconstruct genuine differential fields. Excluded errors remain explicit inputs with field-evaluation witnesses. -/ -@[expose] public section +public section noncomputable section @@ -36,14 +36,14 @@ abbrev Coefficients (D : Type) := HarmonicFields.Coefficients D abbrev VectorCoefficients (D : Type) := Fin 3 → Coefficients D /-- Lift domain, given by `U ×ˢ univ`. -/ -noncomputable def liftDomain (U : Set D) : Set (D × ℝ) := U ×ˢ univ +@[expose] noncomputable def liftDomain (U : Set D) : Set (D × ℝ) := U ×ˢ univ omit [NormedSpace ℝ D] in theorem liftDomain_open {U : Set D} (hU : IsOpen U) : IsOpen (liftDomain U) := hU.prod isOpen_univ /-- Lift direction, given by `(V p.1, 0)`. -/ -noncomputable def liftDirection (V : D → D) (p : D × ℝ) : D × ℝ := (V p.1, 0) +@[expose] noncomputable def liftDirection (V : D → D) (p : D × ℝ) : D × ℝ := (V p.1, 0) /-- Angular direction, given by `(0, 1)`. -/ noncomputable def angularDirection (_p : D × ℝ) : D × ℝ := (0, 1) @@ -188,10 +188,11 @@ structure Frame (D : Type) where viscosity : ℝ /-- Vector field, defined pointwise by `field (a i) k Φ kp p`. -/ -noncomputable def vectorField (a : VectorCoefficients D) (k : ℝ) (Φ : D → ℝ) +@[expose] noncomputable def vectorField (a : VectorCoefficients D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (p : D × ℝ) : ComplexVector := fun i => field (a i) k Φ kp p /-- Rotate, given by `![-a 1, a 0, 0]`. -/ +@[expose] noncomputable def rotate (a : VectorCoefficients D) : VectorCoefficients D := ![-a 1, a 0, 0] omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -202,7 +203,7 @@ omit [NormedAddCommGroup D] [NormedSpace ℝ D] in fin_cases i <;> simp [vectorField, rotate, angularGenerator] /-- Scalar laplacian, constructed using `differentiate`. -/ -noncomputable def scalarLaplacian (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) +@[expose] noncomputable def scalarLaplacian (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (c : Coefficients D) : Coefficients D := differentiate g.radial k Φ (differentiate g.radial k Φ c) + constantCoefficient (fun x => ((g.radius x)⁻¹ : ℝ) : D → ℂ) * differentiate g.radial k Φ c + @@ -211,7 +212,7 @@ noncomputable def scalarLaplacian (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : differentiate g.axial k Φ (differentiate g.axial k Φ c) /-- Vector laplacian as an element of `VectorCoefficients D`. -/ -noncomputable def vectorLaplacian (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) +@[expose] noncomputable def vectorLaplacian (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (a : VectorCoefficients D) : VectorCoefficients D := fun i => scalarLaplacian g k Φ kp (a i) + constantCoefficient (fun x => (((g.radius x) ^ 2)⁻¹ : ℝ) : D → ℂ) * @@ -220,7 +221,7 @@ noncomputable def vectorLaplacian (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : rotate (rotate a) i) /-- Transport as an element of `VectorCoefficients D`. -/ -noncomputable def transport (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) +@[expose] noncomputable def transport (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (a b : VectorCoefficients D) : VectorCoefficients D := fun i => a 0 * differentiate g.radial k Φ (b i) + (a 1 * constantCoefficient (fun x => ((g.radius x : ℂ)⁻¹))) * @@ -228,14 +229,14 @@ noncomputable def transport (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) a 2 * differentiate g.axial k Φ (b i) /-- Gradient as an element of `VectorCoefficients D`. -/ -noncomputable def gradient (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) +@[expose] noncomputable def gradient (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (p : Coefficients D) : VectorCoefficients D := ![differentiate g.radial k Φ p, constantCoefficient (fun x => ((g.radius x)⁻¹ : ℝ) : D → ℂ) * angularDifferentiate kp p, differentiate g.axial k Φ p] /-- Literal coefficient formula for the differentiated linearized PDE. -/ -noncomputable def linearResidual (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) +@[expose] noncomputable def linearResidual (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (B a : VectorCoefficients D) (p : Coefficients D) : VectorCoefficients D := fun i => differentiate g.time k Φ (a i) + transport g k Φ kp B a i + transport g k Φ kp a B i + gradient g k Φ kp p i - @@ -243,7 +244,7 @@ noncomputable def linearResidual (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : /-- Nonlinear residual, defined pointwise by `linearResidual g k Φ kp B a p i + transport g k Φ kp a a i`. -/ -noncomputable def nonlinearResidual (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) +@[expose] noncomputable def nonlinearResidual (g : Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (B a : VectorCoefficients D) (p : Coefficients D) : VectorCoefficients D := fun i => linearResidual g k Φ kp B a p i + transport g k Φ kp a a i @@ -534,7 +535,7 @@ theorem SmoothCoefficients.realCoefficients {U : Set D} {c : Coefficients D} (smoothCoefficients_constant contDiffOn_const).mul (hc.add hc.conjugateReverse) /-- Extraction is integration against the conjugate carrier, including its slow phase. -/ -noncomputable def extract (f : D × ℝ → ℂ) (k : ℝ) (Φ : D → ℝ) (kp j : ℤ) +@[expose] noncomputable def extract (f : D × ℝ → ℂ) (k : ℝ) (Φ : D → ℝ) (kp j : ℤ) (x : D) : ℂ := angularMean (fun θ => f (x, θ) * field (AddMonoidAlgebra.single (-j) (fun _ : D => (1 : ℂ))) k Φ kp (x, θ)) @@ -558,7 +559,7 @@ theorem coefficients_unique {c d : Coefficients D} (k : ℝ) (Φ : D → ℝ) rw [← extract_field c k Φ hkp j x, he, extract_field d k Φ hkp j x] /-- Nonconstant, given by `c.erase 0`. -/ -noncomputable def nonconstant (c : Coefficients D) : Coefficients D := c.erase 0 +@[expose] noncomputable def nonconstant (c : Coefficients D) : Coefficients D := c.erase 0 omit [NormedAddCommGroup D] [NormedSpace ℝ D] in theorem nonconstant_eq_sub (c : Coefficients D) : @@ -725,7 +726,7 @@ theorem linearResidual_add {U : Set D} (hU : IsOpen U) (ε : ℝ) (R : D → ℝ /-- Exact residual of a perturbation of a fixed base, before the virtual stress and the separately retained base residual are added. -/ -noncomputable def nonlinearResidual (ε : ℝ) (R : D → ℝ) (Vr Vθ Vz Vt : D → D) +@[expose] noncomputable def nonlinearResidual (ε : ℝ) (R : D → ℝ) (Vr Vθ Vz Vt : D → D) (B a : D → ComplexVector) (p : D → ℂ) (x : D) : ComplexVector := LinearWaveResidual.linearResidual ε R Vr Vθ Vz Vt B a p x + LinearWaveResidual.transport R Vr Vθ Vz a a x @@ -990,7 +991,7 @@ theorem smooth_nonlinearResidual {U : Set D} (hU : IsOpen U) {g : Frame D} (hg : (smooth_transport hU hg hΦ k kp ha ha i) /-- Constant vector, defined pointwise by `constantCoefficient (fun x => a x i)`. -/ -noncomputable def constantVector (a : D → ComplexVector) : VectorCoefficients D := +@[expose] noncomputable def constantVector (a : D → ComplexVector) : VectorCoefficients D := fun i => constantCoefficient (fun x => a x i) omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -1066,19 +1067,19 @@ noncomputable def meanCoefficients (g : Frame D) (B M : D → ComplexVector) (p nonlinearResidual g 0 (fun _ => 0) 1 (constantVector B) (constantVector M) (constantCoefficient p) /-- Gaussian and alias fields are subtracted after the actual nonlinear differential residual. -/ -noncomputable def LabelData.residualCoefficients (d : LabelData D) (g : Frame D) +@[expose] noncomputable def LabelData.residualCoefficients (d : LabelData D) (g : Frame D) (B M : D → ComplexVector) : VectorCoefficients D := fun i => realCoefficients (nonlinearResidual g d.frequency d.phase d.angularFrequency (constantVector (B + M)) d.velocity d.pressure i - d.gaussian i - d.aliasError i) /-- Wave residual coefficients, defined pointwise by `nonconstant (d.residualCoefficients g B M i)`. -/ -noncomputable def LabelData.waveResidualCoefficients (d : LabelData D) (g : Frame D) +@[expose] noncomputable def LabelData.waveResidualCoefficients (d : LabelData D) (g : Frame D) (B M : D → ComplexVector) : VectorCoefficients D := fun i => nonconstant (d.residualCoefficients g B M i) /-- Good residual as an element of `ℝ`. -/ -noncomputable def goodResidual {ι : Type*} (labels : Finset ι) (data : ι → LabelData D) +@[expose] noncomputable def goodResidual {ι : Type*} (labels : Finset ι) (data : ι → LabelData D) (g : Frame D) (B M : D → ComplexVector) (p : D → ℂ) (virtual : D → Fin 3 → ℝ) (x : D × ℝ) (i : Fin 3) : ℝ := (Actual.nonlinearResidual g.viscosity (fun y => g.radius y.1) @@ -1265,7 +1266,7 @@ theorem LabelData.extract_residual (d : LabelData D) (g : Frame D) extract_field _ _ _ hkp _ _ /-- Real angular mean, given by `(∫ θ in (0 : ℝ)..period, f θ) / period`. -/ -noncomputable def realAngularMean (f : ℝ → ℝ) : ℝ := +@[expose] noncomputable def realAngularMean (f : ℝ → ℝ) : ℝ := (∫ θ in (0 : ℝ)..period, f θ) / period theorem realAngularMean_const (a : ℝ) : realAngularMean (fun _ => a) = a := by @@ -1300,6 +1301,7 @@ theorem realAngularMean_field (c : Coefficients D) (k : ℝ) (Φ : D → ℝ) /-- Mean residual value, given by `(meanCoefficients g B M p i 0 x).re + virtual x i + ∑ l ∈ labels, (data l |>.residualCoefficients g B M i 0 x).re`. -/ +@[expose] noncomputable def meanResidualValue {ι : Type*} (labels : Finset ι) (data : ι → LabelData D) (g : Frame D) (B M : D → ComplexVector) (p : D → ℂ) (virtual : D → Fin 3 → ℝ) (x : D) (i : Fin 3) : ℝ := @@ -1372,7 +1374,7 @@ theorem goodWaveResidual_grouped {ι : Type*} (labels : Finset ι) (data : ι /-- Context frame, bundling `radius`, `radial`, `axial`, `time` and the required compatibility proofs. -/ -noncomputable def contextFrame (c : CorrectionState.Context D) (n : ℕ) : Frame D where +@[expose] noncomputable def contextFrame (c : CorrectionState.Context D) (n : ℕ) : Frame D where radius := c.operators.radius radial := fun x => c.operators.eR + (c.operators.radialFrequency n * c.operators.radialProfile x) • c.operators.vR @@ -1383,11 +1385,13 @@ noncomputable def contextFrame (c : CorrectionState.Context D) (n : ℕ) : Frame /-- Context base, given by `![(c.base.radial n x : ℂ), (c.base.angular n x : ℂ), (c.base.axial n x : ℂ)]`. -/ +@[expose] noncomputable def contextBase (c : CorrectionState.Context D) (n : ℕ) (x : D) : ComplexVector := ![(c.base.radial n x : ℂ), (c.base.angular n x : ℂ), (c.base.axial n x : ℂ)] /-- State mean, given by `![(s.mean.radial n x : ℂ), (s.mean.angular n x : ℂ), (s.mean.axial n x : ℂ)]`. -/ +@[expose] noncomputable def stateMean (s : CorrectionState.State D) (n : ℕ) (x : D) : ComplexVector := ![(s.mean.radial n x : ℂ), (s.mean.angular n x : ℂ), (s.mean.axial n x : ℂ)] @@ -1417,11 +1421,13 @@ noncomputable def stateFullResidual (c : CorrectionState.Context D) (s : Correct contextVirtual c n x.1 i + s.errors.base n x i /-- State good residual, given by `stateFullResidual c s - s.errors.total`. -/ +@[expose] noncomputable def stateGoodResidual (c : CorrectionState.Context D) (s : CorrectionState.State D) : CorrectionState.Oscillation D := stateFullResidual c s - s.errors.total /-- State good wave residual, given by `stateGoodResidual c s n x i - CorrectionState.angularAverage (fun m y => stateGoodResidual c s m y i) n x.1`. -/ +@[expose] noncomputable def stateGoodWaveResidual (c : CorrectionState.Context D) (s : CorrectionState.State D) (n : ℕ) (x : D × ℝ) (i : Fin 3) : ℝ := @@ -1433,7 +1439,7 @@ abbrev BlockCoefficients (D : Type) := ℕ → VectorCoefficients D /-- Input blocks are interpreted as their actual real fields. The real projection does not enlarge the largest harmonic value and is the identity for conjugate data. -/ -noncomputable def ofBlock (b : CorrectionState.HarmonicBlock D) +@[expose] noncomputable def ofBlock (b : CorrectionState.HarmonicBlock D) (gaussian aliasError : BlockCoefficients D) (n : ℕ) : LabelData D where frequency := b.frequency n phase := b.phase n @@ -1534,6 +1540,7 @@ theorem BlockRepresentation.goodResidual_eq {ι : Type*} {labels : ℕ → Finse /-- Residual block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ +@[expose] noncomputable def residualBlock (c : CorrectionState.Context D) (s : CorrectionState.State D) (b : CorrectionState.HarmonicBlock D) (gaussian aliasError : BlockCoefficients D) : CorrectionState.HarmonicBlock D where diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicSourceSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicSourceSupport.lean index a4423c14f2..8be49b6061 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicSourceSupport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicSourceSupport.lean @@ -17,7 +17,7 @@ Only nonzero input harmonics need be localized: a spatially global zero mode, such as an axisymmetric pressure alias, does not create a new slot. -/ -@[expose] public section +public section noncomputable section @@ -447,7 +447,7 @@ open CommonCoverSolve TorusInverse TorusAverages variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Native union, given by `⋃ k : Frequency, PeriodizedWaveBounds.nativeCell g K k`. -/ -noncomputable def nativeUnion (g : Geometry) (K : Set Plane) : Set (P × Plane) := +@[expose] noncomputable def nativeUnion (g : Geometry) (K : Set Plane) : Set (P × Plane) := ⋃ k : Frequency, PeriodizedWaveBounds.nativeCell g K k omit [NormedSpace ℝ P] in diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicStructurePreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicStructurePreservation.lean index 34fb0fac0c..0f32a5b9ae 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicStructurePreservation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicStructurePreservation.lean @@ -17,7 +17,7 @@ Fréchet derivatives in the cylindrical divergence. No output divergence condition, nonzero frequency, or nonzero angular frequency is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicWaveInteraction.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicWaveInteraction.lean index 531c4013a9..484a186001 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicWaveInteraction.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HarmonicWaveInteraction.lean @@ -26,7 +26,7 @@ the actual differential residual in `HarmonicResidual`; excluded errors are kept as separate additive differences. -/ -@[expose] public section +public section noncomputable section @@ -139,6 +139,7 @@ theorem transport_constant_right (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : angularDifferentiate_constant, zero_add, rotate_constant, div_eq_mul_inv] /-- The two actual cross-advections at coefficient level, before any zero-mode deletion. -/ +@[expose] noncomputable def crossCoefficients (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (m : D → ComplexVector) (a : HarmonicResidual.VectorCoefficients D) : HarmonicResidual.VectorCoefficients D := fun i => @@ -194,7 +195,7 @@ theorem stateMean_updated (s₀ s₁ : CorrectionState.State D) (h : MeanIncreme fin_cases i <;> simp [HarmonicResidual.stateMean, tripleField, he, MeanIncrementBounds.updated] /-- Block amplitude, defined pointwise by `HarmonicResidual.realCoefficients (b.velocity n i)`. -/ -noncomputable def blockAmplitude (b : CorrectionState.HarmonicBlock D) (n : ℕ) : +@[expose] noncomputable def blockAmplitude (b : CorrectionState.HarmonicBlock D) (n : ℕ) : HarmonicResidual.VectorCoefficients D := fun i => HarmonicResidual.realCoefficients (b.velocity n i) @@ -276,7 +277,7 @@ noncomputable def slowGeometry {s : StripData D} {κ : ℝ} (c : CorrectionState inverse_radius_class := ho.invRadius /-- Slow normal, constructed using `phaseNormal`. -/ -noncomputable def slowNormal {s : StripData D} {κ : ℝ} (c : CorrectionState.Context D) +@[expose] noncomputable def slowNormal {s : StripData D} {κ : ℝ} (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) (Φ : ℕ → D → ℝ) (n : ℕ) (x : D) : EuclideanSpace ℝ (Fin 3) := @@ -702,7 +703,7 @@ end end -@[expose] public section +public section noncomputable section @@ -718,7 +719,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Pullback strip, bundling `domain`, `isOpen_domain`, `epsilon`, `epsilon_pos` and the required compatibility proofs. -/ -noncomputable def pullbackStrip (s : StripData D) (L : E →L[ℝ] D) : StripData E where +@[expose] noncomputable def pullbackStrip (s : StripData D) (L : E →L[ℝ] D) : StripData E where domain := L ⁻¹' s.domain isOpen_domain := s.isOpen_domain.preimage L.continuous epsilon := s.epsilon @@ -756,7 +757,7 @@ theorem class_pullback {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {f : exact (hc.trans (mul_le_of_le_one_right (norm_nonneg _) hpow)).trans (hb n (L x) hx j hj) /-- Projection, given by `ContinuousLinearMap.fst ℝ D ℝ`. -/ -noncomputable def projection : D × ℝ →L[ℝ] D := ContinuousLinearMap.fst ℝ D ℝ +@[expose] noncomputable def projection : D × ℝ →L[ℝ] D := ContinuousLinearMap.fst ℝ D ℝ /-- Inclusion, given by `(ContinuousLinearMap.id ℝ D).prod (0 : D →L[ℝ] ℝ)`. -/ noncomputable def inclusion : D →L[ℝ] D × ℝ := (ContinuousLinearMap.id ℝ D).prod (0 : D →L[ℝ] ℝ) @@ -773,6 +774,7 @@ theorem inclusion_norm : ‖inclusion (D := D)‖ ≤ 1 := by simp [inclusion, Prod.norm_def] /-- Product strip, given by `pullbackStrip s projection`. -/ +@[expose] noncomputable def productStrip (s : StripData D) : StripData (D × ℝ) := pullbackStrip s projection theorem class_lift {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {f : ℕ → D → F} @@ -813,11 +815,11 @@ theorem fullPhase_smooth {s : StripData D} (b : CorrectionState.HarmonicBlock D) ((hΦ n).comp contDiffOn_fst (fun _ hx => hx)).add (contDiffOn_const.mul contDiffOn_snd) /-- Amplitude, defined pointwise by `blockAmplitude b n i j x`. -/ -noncomputable def amplitude (b : CorrectionState.HarmonicBlock D) (j : ℤ) +@[expose] noncomputable def amplitude (b : CorrectionState.HarmonicBlock D) (j : ℤ) (n : ℕ) (x : D) : ComplexVector := fun i => blockAmplitude b n i j x /-- Single mode, constructed using `HarmonicResidual.vectorField`. -/ -noncomputable def singleMode (b : CorrectionState.HarmonicBlock D) (j : ℤ) +@[expose] noncomputable def singleMode (b : CorrectionState.HarmonicBlock D) (j : ℤ) (n : ℕ) (p : D × ℝ) : ComplexVector := HarmonicResidual.vectorField (fun i => AddMonoidAlgebra.single j (fun x => amplitude b j n x i)) (b.frequency n) (b.phase n) (b.angularFrequency n) p @@ -1128,7 +1130,7 @@ theorem transport_mean_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D (transport_raw_class c ho hR ha hb ha0 hb0 hN hΦ hk hdiv m i) hP0 hP1 /-- Coefficients evaluated using the original label's carrier. -/ -noncomputable def withCarrier (carrierData b : CorrectionState.HarmonicBlock D) : +@[expose] noncomputable def withCarrier (carrierData b : CorrectionState.HarmonicBlock D) : CorrectionState.HarmonicBlock D where velocity := b.velocity pressure := b.pressure @@ -1137,7 +1139,7 @@ noncomputable def withCarrier (carrierData b : CorrectionState.HarmonicBlock D) angularFrequency := carrierData.angularFrequency /-- The updated label retains its carrier, including its angular frequency. -/ -noncomputable def addBlock (a b : CorrectionState.HarmonicBlock D) : +@[expose] noncomputable def addBlock (a b : CorrectionState.HarmonicBlock D) : CorrectionState.HarmonicBlock D where velocity := fun n i => a.velocity n i + b.velocity n i pressure := fun n => a.pressure n + b.pressure n @@ -1167,7 +1169,7 @@ theorem blockAmplitude_addBlock (a b : CorrectionState.HarmonicBlock D) (n : ℕ exact realCoefficients_add _ _ /-- Block transport as an element of `HarmonicResidual.BlockCoefficients D`. -/ -noncomputable def blockTransport (c : CorrectionState.Context D) +@[expose] noncomputable def blockTransport (c : CorrectionState.Context D) (carrierData a b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := fun n => HarmonicResidual.transport (HarmonicResidual.contextFrame c n) (carrierData.frequency n) (carrierData.phase n) (carrierData.angularFrequency n) @@ -1531,7 +1533,7 @@ noncomputable def interactionBlock (c : CorrectionState.Context D) (u : Correcti /-- Linear good block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ -noncomputable def linearGoodBlock (c : CorrectionState.Context D) +@[expose] noncomputable def linearGoodBlock (c : CorrectionState.Context D) (a b : CorrectionState.HarmonicBlock D) (g : HarmonicResidual.BlockCoefficients D) : CorrectionState.HarmonicBlock D where velocity := fun n i => HarmonicResidual.nonconstant diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatProfileExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatProfileExtension.lean index 2afd0f87d5..f34d67c9d7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatProfileExtension.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatProfileExtension.lean @@ -34,7 +34,7 @@ right Taylor--Borel construction in Lemmas 11.5--11.6. It does not construct a right branch with arbitrary prescribed jets. -/ -@[expose] public section +public section noncomputable section @@ -199,7 +199,7 @@ end end -@[expose] public section +public section noncomputable section @@ -377,7 +377,7 @@ theorem extension_positive_on_collar {a : ℝ} (ha : 1 < a) : /-- Diffusion-parametrized profile; negative diffusion uses only the Borel extension, never the original gamma-integral expression. -/ -noncomputable def scaledProfile (a X ν : ℝ) : ℝ := extension a (2 * ν / X) +@[expose] noncomputable def scaledProfile (a X ν : ℝ) : ℝ := extension a (2 * ν / X) theorem scaledProfile_contDiffOn {a : ℝ} (ha : 1 < a) : ContDiffOn ℝ ∞ (fun p : ℝ × ℝ => scaledProfile a p.1 p.2) @@ -425,7 +425,7 @@ theorem scaledProfile_sub_one_bound {a : ℝ} (ha : 1 < a) {X : ℝ} (hX : 0 < X ring /-- Physical profile, given by `scaledProfile a X (1 - η ^ 2)`. -/ -noncomputable def physicalProfile (a X η : ℝ) : ℝ := scaledProfile a X (1 - η ^ 2) +@[expose] noncomputable def physicalProfile (a X η : ℝ) : ℝ := scaledProfile a X (1 - η ^ 2) /-- The physical profile now has an ordinary smooth neighborhood beyond both endpoints `eta = ±1`, for every positive radius coordinate. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatSwitchCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatSwitchCone.lean index 58f5038a68..927b2abedb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatSwitchCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatSwitchCone.lean @@ -19,7 +19,7 @@ terminal edge. Constants are chosen after the outgoing profile and before the entrance radius. -/ -@[expose] public section +public section noncomputable section @@ -525,23 +525,23 @@ theorem realize_parameter_derivative {f : Raw → ℝ} (hf : ContDiff ℝ ∞ f) (uniqueDiffOn_Icc (by norm_num) p.2 hp) /-- The actual angular velocity in the fixed logarithmic coordinate. -/ -noncomputable def logE (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def logE (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := HeatedOutgoing.E F XR c (XR * Real.exp p.1, p.2) /-- Incoming histories are retained. Only the integrals of the actual changes beginning at the reserved patch are added. -/ -noncomputable def logI (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def logI (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := OutgoingHistories.I F.reset p + ∫ t in OutgoingDilation.patchClock F..p.1, Real.exp (3 * t / 2) * (logE F XR c (t, p.2) - F.logE (t, p.2)) /-- Log S, constructed using `OutgoingHistories.S`. -/ -noncomputable def logS (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def logS (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := OutgoingHistories.S F.reset F.amp p - (1 / 2 : ℝ) * ∫ t in OutgoingDilation.patchClock F..p.1, Real.exp t * (logE F XR c (t, p.2) ^ 2 - F.logE (t, p.2) ^ 2) /-- Log pi, constructed using `OutgoingHistories.Pi`. -/ -noncomputable def logPi (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def logPi (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := OutgoingHistories.Pi F.reset p + (1 / 2 : ℝ) * ∫ t in OutgoingDilation.patchClock F..p.1, logE F XR c (t, p.2) ^ 2 - F.logE (t, p.2) ^ 2 @@ -812,7 +812,7 @@ theorem logPi_eq_canonical (F : Profile) {XR C : ℝ} linarith /-- Qs as an element of `ℝ`. -/ -noncomputable def Qs (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def Qs (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := -OutgoingHistories.W F.data F.amp p + ((1 - F.data.h) * logI F XR c p - axialExponent F.data.h * p.2 * derivWithin (fun eta => logI F XR c (p.1, eta)) HeatedOutgoing.parameterDomain p.2 - @@ -821,7 +821,7 @@ noncomputable def Qs (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : (Real.exp (3 * p.1 / 2) * logE F XR c p) /-- Ns as an element of `ℝ`. -/ -noncomputable def Ns (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def Ns (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := -OutgoingHistories.W F.data F.amp p * F.logU p + axialExponent F.data.h * (OutgoingHistories.M F.data F.amp p - p.2 * OutgoingHistories.dEta (OutgoingHistories.M F.data F.amp) p) / Real.exp p.1 + @@ -832,22 +832,22 @@ noncomputable def Ns (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : HeatedOutgoing.parameterDomain p.2 /-- Radial A, given by `1 - 2 * deriv (fun y => logE F XR c (y, p.2)) p.1 / logE F XR c p`. -/ -noncomputable def radialA (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def radialA (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := 1 - 2 * deriv (fun y => logE F XR c (y, p.2)) p.1 / logE F XR c p /-- Radial B, given by `2 * OutgoingHistories.dY F.logU p / logE F XR c p`. -/ -noncomputable def radialB (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def radialB (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := 2 * OutgoingHistories.dY F.logU p / logE F XR c p /-- Ratio, given by `Ns F XR c p / (logE F XR c p * Qs F XR c p)`. -/ -noncomputable def ratio (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def ratio (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := Ns F XR c p / (logE F XR c p * Qs F XR c p) /-- Source C, given by `1 - radialB F XR c p * ratio F XR c p / radialA F XR c p`. -/ -noncomputable def sourceC (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def sourceC (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := 1 - radialB F XR c p * ratio F XR c p / radialA F XR c p /-- Source J, given by `ratio F XR c p + radialB F XR c p / radialA F XR c p`. -/ -noncomputable def sourceJ (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def sourceJ (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := ratio F XR c p + radialB F XR c p / radialA F XR c p /-- Normal V, given by `radialA F XR c p * (1 + (radialB F XR c p / radialA F XR c p) ^ 2)`. -/ -noncomputable def normalV (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def normalV (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := radialA F XR c p * (1 + (radialB F XR c p / radialA F XR c p) ^ 2) /-- Leading gap, given by `2 * sourceC F XR c p ^ 2 - (normalV F XR c p - 2) * sourceJ F XR c p ^ 2`. -/ @@ -1052,18 +1052,18 @@ theorem compensated_source_margins (F : Profile) {anchor left : ℝ} _ ≤ T := by dsimp [T]; linarith [le_max_right (1 : ℝ) (M + 1)] /-- Stress scale, given by `XR * Real.exp p.1 * Qs F XR c p / CoordinateAlgebra.L F.data.h p.2`. -/ -noncomputable def stressScale (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def stressScale (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := XR * Real.exp p.1 * Qs F XR c p / CoordinateAlgebra.L F.data.h p.2 /-- Normal P, given by `stressScale F XR c p * sourceC F XR c p`. -/ -noncomputable def normalP (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def normalP (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := stressScale F XR c p * sourceC F XR c p /-- Normal J, given by `stressScale F XR c p * sourceJ F XR c p`. -/ -noncomputable def normalJ (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := +@[expose] noncomputable def normalJ (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := stressScale F XR c p * sourceJ F XR c p /-- The strict true cone, expressed in the same normalized stress coordinates as the clean outgoing theorem. -/ -def TrueAt (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : Prop := +@[expose] def TrueAt (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : Point) : Prop := 0 < Qs F XR c p ∧ 0 < radialA F XR c p ∧ 2 < normalV F XR c p ∧ 2 < normalP F XR c p ∧ normalV F XR c p < ConeAlgebra.coneBound (normalP F XR c p) (normalJ F XR c p) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailEdit.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailEdit.lean index bea5895cae..1fe0326273 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailEdit.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailEdit.lean @@ -18,7 +18,7 @@ the actual improper integrals, then applied to the constructed outgoing tail. No debt bound is an input to the final outgoing-tail theorems. -/ -@[expose] public section +public section noncomputable section @@ -29,29 +29,29 @@ open scoped Topology ContDiff namespace NavierStokes.HeatTailEdit /-- Exponent, given by `1 / 2 + h`. -/ -noncomputable def exponent (h : ℝ) : ℝ := 1 / 2 + h +@[expose] noncomputable def exponent (h : ℝ) : ℝ := 1 / 2 + h /-- Heat constant, given by `2 * ν * h * (1 + h)`. -/ -noncomputable def heatConstant (h ν : ℝ) : ℝ := 2 * ν * h * (1 + h) +@[expose] noncomputable def heatConstant (h ν : ℝ) : ℝ := 2 * ν * h * (1 + h) /-- Switch, given by `OutgoingSchedule.sigma (Real.log (X / K) / (3 / 10))`. -/ -noncomputable def switch (K X : ℝ) : ℝ := +@[expose] noncomputable def switch (K X : ℝ) : ℝ := OutgoingSchedule.sigma (Real.log (X / K) / (3 / 10)) /-- Multiplier, given by `1 + switch K X * (RadialHeatProfile.profile (1 + h) (2 * ν / X) - 1)`. -/ -noncomputable def multiplier (h ν K X : ℝ) : ℝ := +@[expose] noncomputable def multiplier (h ν K X : ℝ) : ℝ := 1 + switch K X * (RadialHeatProfile.profile (1 + h) (2 * ν / X) - 1) /-- Edit, given by `E X * multiplier h ν K X`. -/ -noncomputable def edit (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := +@[expose] noncomputable def edit (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := E X * multiplier h ν K X /-- Change, given by `edit E h ν K X - E X`. -/ -noncomputable def change (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := +@[expose] noncomputable def change (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := edit E h ν K X - E X /-- Square change, given by `edit E h ν K X ^ 2 - E X ^ 2`. -/ -noncomputable def squareChange (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := +@[expose] noncomputable def squareChange (E : ℝ → ℝ) (h ν K X : ℝ) : ℝ := edit E h ν K X ^ 2 - E X ^ 2 theorem switch_bounds (K X : ℝ) : 0 ≤ switch K X ∧ switch K X ≤ 1 := @@ -165,7 +165,7 @@ theorem squareChange_bound {E : ℝ → ℝ} {h ν K X : ℝ} (hh : 0 < h) (hν /-! ## One exact weighted power integral -/ /-- Weighted kernel, given by `X ^ q * (X / K) ^ p / X`. -/ -noncomputable def weightedKernel (K p q X : ℝ) : ℝ := +@[expose] noncomputable def weightedKernel (K p q X : ℝ) : ℝ := X ^ q * (X / K) ^ p / X theorem weightedKernel_eq {K X : ℝ} (hK : 0 < K) (hX : 0 < X) (p q : ℝ) : @@ -224,7 +224,7 @@ theorem weighted_integral_bound {K p q B : ℝ} {g : ℝ → ℝ} (hK : 0 < K) /-! ## Quantitative debts for a prescribed bounded terminal shape -/ /-- Power tail, given by `e * (X / K) ^ (-exponent h) * f (Real.log (X / K))`. -/ -noncomputable def powerTail (h e K : ℝ) (f : ℝ → ℝ) (X : ℝ) : ℝ := +@[expose] noncomputable def powerTail (h e K : ℝ) (f : ℝ → ℝ) (X : ℝ) : ℝ := e * (X / K) ^ (-exponent h) * f (Real.log (X / K)) theorem powerTail_contDiffOn {K : ℝ} (hK : 0 < K) (h e : ℝ) {f : ℝ → ℝ} @@ -313,15 +313,15 @@ theorem powerTail_weighted_squareChange {h ν K e M q : ℝ} (hh : 0 < h) (hν : _ = _ := by ring /-- Pressure debt, given by `∫ X in Ioi K, squareChange E h ν K X / X`. -/ -noncomputable def pressureDebt (E : ℝ → ℝ) (h ν K : ℝ) : ℝ := +@[expose] noncomputable def pressureDebt (E : ℝ → ℝ) (h ν K : ℝ) : ℝ := ∫ X in Ioi K, squareChange E h ν K X / X /-- Energy debt, given by `∫ X in Ioi K, squareChange E h ν K X`. -/ -noncomputable def energyDebt (E : ℝ → ℝ) (h ν K : ℝ) : ℝ := +@[expose] noncomputable def energyDebt (E : ℝ → ℝ) (h ν K : ℝ) : ℝ := ∫ X in Ioi K, squareChange E h ν K X /-- Angular debt, given by `∫ X in Ioi K, Real.sqrt (2 * X) * change E h ν K X`. -/ -noncomputable def angularDebt (E : ℝ → ℝ) (h ν K : ℝ) : ℝ := +@[expose] noncomputable def angularDebt (E : ℝ → ℝ) (h ν K : ℝ) : ℝ := ∫ X in Ioi K, Real.sqrt (2 * X) * change E h ν K X theorem pressureDebt_eq (E : ℝ → ℝ) (h ν K : ℝ) : @@ -392,21 +392,22 @@ theorem powerTail_angular {h ν K e M : ℝ} (hh : 0 < h) (hν : 0 < ν) open OutgoingTail /-- Switch start, given by `tailStart d + 1 / 5`. -/ -noncomputable def switchStart (d : TailData) : ℝ := tailStart d + 1 / 5 +@[expose] noncomputable def switchStart (d : TailData) : ℝ := tailStart d + 1 / 5 /-- This carrier amplitude is fixed by the schedule, independently of `K`. -/ -noncomputable def outgoingAmplitude (d : TailData) : ℝ := +@[expose] noncomputable def outgoingAmplitude (d : TailData) : ℝ := powerConstant d * Real.exp (-exponent d.h * switchStart d) /-- Outgoing shape, given by `tailShape d (t + 1 / 5)`. -/ +@[expose] noncomputable def outgoingShape (d : TailData) (t : ℝ) : ℝ := tailShape d (t + 1 / 5) /-- Outgoing profile, given by `finalAngular d (switchStart d + Real.log (X / K), eta)`. -/ -noncomputable def outgoingProfile (d : TailData) (K eta X : ℝ) : ℝ := +@[expose] noncomputable def outgoingProfile (d : TailData) (K eta X : ℝ) : ℝ := finalAngular d (switchStart d + Real.log (X / K), eta) /-- Outgoing edit, given by `edit (outgoingProfile d K eta) d.h ν K X`. -/ -noncomputable def outgoingEdit (d : TailData) (ν K eta X : ℝ) : ℝ := +@[expose] noncomputable def outgoingEdit (d : TailData) (ν K eta X : ℝ) : ℝ := edit (outgoingProfile d K eta) d.h ν K X theorem outgoingAmplitude_pos (d : TailData) : 0 < outgoingAmplitude d := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailHistoryLimits.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailHistoryLimits.lean index 2281999955..8214aa1acc 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailHistoryLimits.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatTailHistoryLimits.lean @@ -17,7 +17,7 @@ kernels have explicit integrable power majorants. The physical histories use the same outgoing profile and the same compensation witness throughout. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatedOutgoing.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatedOutgoing.lean index 6519849a04..88f878c8b9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HeatedOutgoing.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HeatedOutgoing.lean @@ -31,7 +31,7 @@ locates the clean terminal switch and the second reserved compensation patch. No heat edit is applied in this module. -/ -@[expose] public section +public section noncomputable section @@ -83,37 +83,41 @@ theorem integrable_dilate_Ioi_iff (f : ℝ → ℝ) (R X : ℝ) (hR : 0 < R) : simpa only [div_eq_mul_inv] using integrableOn_Ioi_comp_mul_right_iff f X (inv_pos.mpr hR) /-- E, given by `F.E (p.1 / XR, p.2)`. -/ -def E (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := F.E (p.1 / XR, p.2) +@[expose] def E (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := F.E (p.1 / XR, p.2) /-- U, given by `F.U (p.1 / XR, p.2)`. -/ -def U (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := F.U (p.1 / XR, p.2) +@[expose] def U (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := F.U (p.1 / XR, p.2) /-- H, given by `Real.sqrt (2 * p.1) * E F XR p`. -/ -def H (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * p.1) * E F XR p +@[expose] def H (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * p.1) * E F XR p /-- Pi, given by `F.Pi (p.1 / XR, p.2)`. -/ -def Pi (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := F.Pi (p.1 / XR, p.2) +@[expose] def Pi (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := F.Pi (p.1 / XR, p.2) /-- Power E, given by `F.powerE (X / XR)`. -/ def powerE (F : Profile) (XR X : ℝ) : ℝ := F.powerE (X / XR) /-- Power H, given by `Real.sqrt (2 * X) * powerE F XR X`. -/ -def powerH (F : Profile) (XR X : ℝ) : ℝ := Real.sqrt (2 * X) * powerE F XR X +@[expose] def powerH (F : Profile) (XR X : ℝ) : ℝ := Real.sqrt (2 * X) * powerE F XR X /-- Energy density, given by `U F XR (X, eta) ^ 2 - E F XR (X, eta) ^ 2 / 2`. -/ +@[expose] def energyDensity (F : Profile) (XR eta X : ℝ) : ℝ := U F XR (X, eta) ^ 2 - E F XR (X, eta) ^ 2 / 2 /-- Canonical kernel, given by `E F XR (X, eta) ^ 2 / X`. -/ -def canonicalKernel (F : Profile) (XR eta X : ℝ) : ℝ := E F XR (X, eta) ^ 2 / X +@[expose] def canonicalKernel (F : Profile) (XR eta X : ℝ) : ℝ := E F XR (X, eta) ^ 2 / X /-- M, given by `∫ u in Ioc 0 X, U F XR (u, eta)`. -/ -def M (F : Profile) (XR eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, U F XR (u, eta) +@[expose] def M (F : Profile) (XR eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, U F XR (u, eta) /-- I, given by `∫ u in Ioc 0 X, H F XR (u, eta)`. -/ def I (F : Profile) (XR eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, H F XR (u, eta) /-- J, given by `∫ u in Ioc 0 X, H F XR (u, eta) * U F XR (u, eta)`. -/ +@[expose] def J (F : Profile) (XR eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, H F XR (u, eta) * U F XR (u, eta) /-- S, given by `∫ u in Ioc 0 X, energyDensity F XR eta u`. -/ def S (F : Profile) (XR eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, energyDensity F XR eta u /-- Total S, given by `∫ u in Ioi 0, energyDensity F XR eta u`. -/ -def totalS (F : Profile) (XR eta : ℝ) : ℝ := ∫ u in Ioi 0, energyDensity F XR eta u +@[expose] def totalS (F : Profile) (XR eta : ℝ) : ℝ := ∫ u in Ioi 0, energyDensity F XR eta u /-- Renormalized I, given by `∫ u in Ioi 0, H F XR (u, eta) - powerH F XR u`. -/ +@[expose] def renormalizedI (F : Profile) (XR eta : ℝ) : ℝ := ∫ u in Ioi 0, H F XR (u, eta) - powerH F XR u /-- Axis datum, given by `-(1 / 2 : ℝ) * ∫ u in Ioi 0, canonicalKernel F XR eta u`. -/ +@[expose] def axisDatum (F : Profile) (XR eta : ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ u in Ioi 0, canonicalKernel F XR eta u @@ -132,7 +136,7 @@ theorem powerH_scaling (F : Profile) (XR X : ℝ) (hXR : 0 < XR) : field_simp theorem energyDensity_scaling (F : Profile) (XR eta X : ℝ) : - energyDensity F XR eta X = F.energyDensity eta (X / XR) := rfl + energyDensity F XR eta X = F.energyDensity eta (X / XR) := by rfl theorem canonicalKernel_scaling (F : Profile) (XR eta X : ℝ) (hXR : 0 < XR) : canonicalKernel F XR eta X = XR⁻¹ * F.canonicalKernel eta (X / XR) := by @@ -338,9 +342,9 @@ theorem Pi_tendsto_axis (F : Profile) (XR eta : ℝ) (hXR : 0 < XR) : exact div_pos hX hXR /-- Clock, given by `Real.log (X / XR)`. -/ -def clock (XR X : ℝ) : ℝ := Real.log (X / XR) +@[expose] def clock (XR X : ℝ) : ℝ := Real.log (X / XR) /-- Radius, given by `XR * Real.exp y`. -/ -def radius (XR y : ℝ) : ℝ := XR * Real.exp y +@[expose] def radius (XR y : ℝ) : ℝ := XR * Real.exp y theorem radius_pos (XR y : ℝ) (hXR : 0 < XR) : 0 < radius XR y := mul_pos hXR (Real.exp_pos y) @@ -370,13 +374,13 @@ theorem radius_lt_iff (XR X y : ℝ) (hXR : 0 < XR) (hX : 0 < X) : simp only [radius, mul_comm] /-- Pulse end radius, given by `radius XR F.data.core.endpoint`. -/ -def pulseEndRadius (F : Profile) (XR : ℝ) : ℝ := radius XR F.data.core.endpoint +@[expose] def pulseEndRadius (F : Profile) (XR : ℝ) : ℝ := radius XR F.data.core.endpoint /-- Tail radius, given by `radius XR (tailEnd F.data)`. -/ def tailRadius (F : Profile) (XR : ℝ) : ℝ := radius XR (tailEnd F.data) /-- Switch radius, given by `radius XR (HeatTailEdit.switchStart F.data)`. -/ -def switchRadius (F : Profile) (XR : ℝ) : ℝ := radius XR (HeatTailEdit.switchStart F.data) +@[expose] def switchRadius (F : Profile) (XR : ℝ) : ℝ := radius XR (HeatTailEdit.switchStart F.data) /-- Carrier amplitude, given by `HeatTailEdit.outgoingAmplitude F.data`. -/ -def carrierAmplitude (F : Profile) : ℝ := HeatTailEdit.outgoingAmplitude F.data +@[expose] def carrierAmplitude (F : Profile) : ℝ := HeatTailEdit.outgoingAmplitude F.data theorem switchRadius_eq (F : Profile) (XR : ℝ) : switchRadius F XR = XR * Real.exp (tailStart F.data + 1 / 5) := rfl @@ -459,9 +463,9 @@ theorem switchRadius_tendsto (F : Profile) : Tendsto (switchRadius F) atTop atTo /-! ## The actual second reserved shaped-wait patch -/ /-- Patch clock, given by `F.data.core.pulseStart - 20`. -/ -def patchClock (F : Profile) : ℝ := F.data.core.pulseStart - 20 +@[expose] def patchClock (F : Profile) : ℝ := F.data.core.pulseStart - 20 /-- Patch radius, given by `radius XR (patchClock F)`. -/ -def patchRadius (F : Profile) (XR : ℝ) : ℝ := radius XR (patchClock F) +@[expose] def patchRadius (F : Profile) (XR : ℝ) : ℝ := radius XR (patchClock F) /-- Patch ratio, given by `Real.exp (patchClock F - HeatTailEdit.switchStart F.data)`. -/ def patchRatio (F : Profile) : ℝ := Real.exp (patchClock F - HeatTailEdit.switchStart F.data) /-- Patch amplitude, given by `OutgoingSchedule.radialAmplitude F.data.core.P @@ -475,7 +479,7 @@ def shapedPatchAmplitude (F : Profile) (eta : ℝ) : ℝ := patchAmplitude F * O /-- In the coordinate `x = X / patchRadius`, the second reserved patch is the fixed interval `(1, exp 5)`. -/ -def compensationPatch : TerminalCompensation.Patch where +@[expose] def compensationPatch : TerminalCompensation.Patch where left := 1 right := Real.exp 5 left_pos := by norm_num @@ -728,7 +732,7 @@ end end -@[expose] public section +public section noncomputable section @@ -744,7 +748,7 @@ namespace NavierStokes.HeatedOutgoing abbrev Coeff := TerminalCompensation.Coeff /-- Parameter domain, given by `Icc (-1) 1`. -/ -def parameterDomain : Set ℝ := Icc (-1) 1 +@[expose] def parameterDomain : Set ℝ := Icc (-1) 1 /-- Domain, given by `Ioi 0 ×ˢ parameterDomain`. -/ def domain : Set (ℝ × ℝ) := Ioi 0 ×ˢ parameterDomain @@ -756,34 +760,35 @@ noncomputable def heatE (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := /-- Patch increment, given by `shapedPatchAmplitude F p.2 * TerminalCompensation.correction compensationPatch (c p.2) (p.1 / patchRadius F XR)`. -/ -noncomputable def patchIncrement (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def patchIncrement (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := shapedPatchAmplitude F p.2 * TerminalCompensation.correction compensationPatch (c p.2) (p.1 / patchRadius F XR) /-- E, given by `heatE F XR p + patchIncrement F XR c p`. -/ -noncomputable def E (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def E (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := heatE F XR p + patchIncrement F XR c p /-- U, given by `OutgoingDilation.U F XR`. -/ -noncomputable def U (F : Profile) (XR : ℝ) : ℝ × ℝ → ℝ := OutgoingDilation.U F XR +@[expose] noncomputable def U (F : Profile) (XR : ℝ) : ℝ × ℝ → ℝ := OutgoingDilation.U F XR /-- H, given by `Real.sqrt (2 * p.1) * E F XR c p`. -/ -noncomputable def H (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def H (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * p.1) * E F XR c p /-- Canonical kernel, given by `E F XR c (X, eta) ^ 2 / X`. -/ +@[expose] noncomputable def canonicalKernel (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) : ℝ := E F XR c (X, eta) ^ 2 / X /-- Pi, given by `-(1 / 2 : ℝ) * ∫ X in Ioi p.1, canonicalKernel F XR c p.2 X`. -/ -noncomputable def Pi (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def Pi (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ X in Ioi p.1, canonicalKernel F XR c p.2 X /-- Axis datum, given by `-(1 / 2 : ℝ) * ∫ X in Ioi 0, canonicalKernel F XR c eta X`. -/ -noncomputable def axisDatum (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ℝ) : ℝ := +@[expose] noncomputable def axisDatum (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ X in Ioi 0, canonicalKernel F XR c eta X /-- Energy density, given by `U F XR (X, eta) ^ 2 - E F XR c (X, eta) ^ 2 / 2`. -/ -noncomputable def energyDensity (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) : ℝ := +@[expose] noncomputable def energyDensity (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) : ℝ := U F XR (X, eta) ^ 2 - E F XR c (X, eta) ^ 2 / 2 /-- Total S, given by `∫ X in Ioi 0, energyDensity F XR c eta X`. -/ -noncomputable def totalS (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ℝ) : ℝ := +@[expose] noncomputable def totalS (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ℝ) : ℝ := ∫ X in Ioi 0, energyDensity F XR c eta X /-- M, given by `∫ u in Ioc 0 X, U F XR (u, eta)`. -/ noncomputable def M (F : Profile) (XR eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, U F XR (u, eta) @@ -792,7 +797,7 @@ noncomputable def J (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) : ∫ u in Ioc 0 X, H F XR c (u, eta) * U F XR (u, eta) /-- Only the already proved smooth extension is used off the physical band. -/ -noncomputable def extendedHeatE (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def extendedHeatE (F : Profile) (XR : ℝ) (p : ℝ × ℝ) : ℝ := OutgoingDilation.E F XR p * (1 + HeatTailEdit.switch (switchRadius F XR) p.1 * (HeatProfileExtension.physicalProfile (1 + F.data.h) p.1 p.2 - 1)) @@ -918,6 +923,7 @@ noncomputable def heatRow (F : Profile) (XR eta : ℝ) (i : Fin 3) (X : ℝ) : F.data.h (ParametricHeatTail.diffusion eta) (switchRadius F XR) X] i /-- Patch row as an element of `ℝ`. -/ +@[expose] noncomputable def patchRow (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta : ℝ) (i : Fin 3) (X : ℝ) : ℝ := let A := TerminalCompensation.physicalProfile compensationPatch F.data.core.lam @@ -1212,8 +1218,9 @@ theorem J_integrand_eq (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ simpa only [H, OutgoingDilation.H, U, mul_assoc] using congrArg (fun z => Real.sqrt (2 * X) * z) (E_times_U F XR c eta X hXR hX) -theorem M_unchanged (F : Profile) (XR eta X : ℝ) : M F XR eta X = OutgoingDilation.M F XR eta X := - rfl +theorem M_unchanged (F : Profile) (XR eta X : ℝ) : + M F XR eta X = OutgoingDilation.M F XR eta X := by + rfl theorem J_unchanged (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (eta X : ℝ) (hXR : 0 < XR) : J F XR c eta X = OutgoingDilation.J F XR eta X := @@ -1343,7 +1350,7 @@ end CompensationWitness coefficients, then composing with the constructed relative smooth branch. -/ /-- Free log E, constructed using `extendedHeatE`. -/ -noncomputable def freeLogE (F : Profile) (XR : ℝ) (z : (Coeff × ℝ) × ℝ) : ℝ := +@[expose] noncomputable def freeLogE (F : Profile) (XR : ℝ) (z : (Coeff × ℝ) × ℝ) : ℝ := extendedHeatE F XR (Real.exp z.2, z.1.2) + shapedPatchAmplitude F z.1.2 * TerminalCompensation.correction compensationPatch z.1.1 (Real.exp z.2 / patchRadius F XR) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/HolomorphicFamily.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/HolomorphicFamily.lean index b218af64b7..88c9de1495 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/HolomorphicFamily.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/HolomorphicFamily.lean @@ -19,7 +19,7 @@ supremum-norm kernel paired with the supplied Banach-valued curve. This proves joint smoothness, rather than inferring it from separate smoothness. -/ -@[expose] public section +public section namespace NavierStokes.HolomorphicFamily @@ -250,7 +250,7 @@ noncomputable def jointDerivative (a b : E) : ℝ × ℂ →L[ℝ] E := omit [CompleteSpace E] in @[simp] theorem jointDerivative_apply (a b : E) (v : ℝ × ℂ) : - jointDerivative a b v = v.1 • a + v.2 • b := rfl + jointDerivative a b v = v.1 • a + v.2 • b := by rfl omit [CompleteSpace E] in /-- The radial partial derivative is obtained by evaluating the genuine diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/InitialPhysicalData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/InitialPhysicalData.lean index 2f5661ad53..89cd801be1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/InitialPhysicalData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/InitialPhysicalData.lean @@ -33,7 +33,7 @@ holds across its boundary, rather than only inside the native estimate domain. The stripped coefficients are independent of the angular variable. -/ -@[expose] public section +public section noncomputable section @@ -216,7 +216,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2007,7 +2007,7 @@ variable {B N0 : ℕ} /-- Physical X, given by `PhysicalWaveSum.physicalPosition w 0 ^ 2 / (2 * PhysicalWaveSum.physicalQ ActualPrimary.h w)`. -/ -noncomputable def physicalX (w : ProblemStatement.SpaceTime) : ℝ := +@[expose] noncomputable def physicalX (w : ProblemStatement.SpaceTime) : ℝ := PhysicalWaveSum.physicalPosition w 0 ^ 2 / (2 * PhysicalWaveSum.physicalQ ActualPrimary.h w) theorem cut_pair_physicalX (l : SignedLabel B N0) (L : PhysicalWaveSum.BandLabel) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/IntegratedMeanBalances.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/IntegratedMeanBalances.lean index 2bcdd425ec..2a20092bad 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/IntegratedMeanBalances.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/IntegratedMeanBalances.lean @@ -17,7 +17,7 @@ the boundary cancellations, and parameter derivatives pass under integrals by the dominated differentiation theorem in `TransportPrimitive`. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ open Set Function MeasureTheory Filter open scoped ContDiff Topology Interval /-- Moment, given by `∫ r, r ^ n * f r`. -/ -noncomputable def moment (n : ℕ) (f : ℝ → ℝ) : ℝ := ∫ r, r ^ n * f r +@[expose] noncomputable def moment (n : ℕ) (f : ℝ → ℝ) : ℝ := ∫ r, r ^ n * f r theorem weighted_integrable {f : ℝ → ℝ} (hf : Continuous f) (hs : HasCompactSupport f) (n : ℕ) : Integrable (fun r => r ^ n * f r) := @@ -90,15 +90,15 @@ theorem moment_deriv_succ {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) simpa only [moment, Pi.mul_apply, mul_assoc, integral_const_mul, neg_mul] using hi /-- Radial divergence, given by `deriv f r + c / r * f r`. -/ -noncomputable def radialDivergence (c : ℝ) (f : ℝ → ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def radialDivergence (c : ℝ) (f : ℝ → ℝ) (r : ℝ) : ℝ := deriv f r + c / r * f r /-- Angular radial viscosity, given by `deriv (deriv f) r + deriv f r / r - f r / r ^ 2`. -/ -noncomputable def angularRadialViscosity (f : ℝ → ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def angularRadialViscosity (f : ℝ → ℝ) (r : ℝ) : ℝ := deriv (deriv f) r + deriv f r / r - f r / r ^ 2 /-- Axial radial viscosity, given by `deriv (deriv f) r + deriv f r / r`. -/ -noncomputable def axialRadialViscosity (f : ℝ → ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def axialRadialViscosity (f : ℝ → ℝ) (r : ℝ) : ℝ := deriv (deriv f) r + deriv f r / r theorem weighted_angular_divergence_ae (f : ℝ → ℝ) : @@ -247,11 +247,11 @@ section Families variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Radial moment, given by `moment n (fun r => F (r, p))`. -/ -noncomputable def radialMoment (n : ℕ) (F : ℝ × P → ℝ) (p : P) : ℝ := +@[expose] noncomputable def radialMoment (n : ℕ) (F : ℝ × P → ℝ) (p : P) : ℝ := moment n (fun r => F (r, p)) /-- Parameter partial, given by `fderiv ℝ F x (0, v)`. -/ -noncomputable def parameterPartial (v : P) (F : ℝ × P → ℝ) (x : ℝ × P) : ℝ := +@[expose] noncomputable def parameterPartial (v : P) (F : ℝ × P → ℝ) (x : ℝ × P) : ℝ := fderiv ℝ F x (0, v) theorem parameterPartial_smooth (v : P) {F : ℝ × P → ℝ} @@ -738,14 +738,15 @@ theorem integrated_axial_balance {a b : ℝ} (ε : ℝ) ring /-- Pressure total, given by `radialMoment 0 gr`. -/ -noncomputable def pressureTotal (gr : MeanField) : MeanParameter → ℝ := radialMoment 0 gr +@[expose] noncomputable def pressureTotal (gr : MeanField) : MeanParameter → ℝ := + radialMoment 0 gr /-- Pressure coefficient, given by `radialMoment 2 ρ p / 2`. -/ -noncomputable def pressureCoefficient (ρ : MeanField) (p : MeanParameter) : ℝ := +@[expose] noncomputable def pressureCoefficient (ρ : MeanField) (p : MeanParameter) : ℝ := radialMoment 2 ρ p / 2 /-- Axial defect, given by `radialMoment 1 axialFlux p - (1 / 2 : ℝ) * radialMoment 2 gr p`. -/ -noncomputable def axialDefect (axialFlux gr : MeanField) (p : MeanParameter) : ℝ := +@[expose] noncomputable def axialDefect (axialFlux gr : MeanField) (p : MeanParameter) : ℝ := radialMoment 1 axialFlux p - (1 / 2 : ℝ) * radialMoment 2 gr p theorem flux_pressure_moment {a b : ℝ} {axialFlux pressure gr ρ : MeanField} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/JetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/JetBounds.lean index 391d0a3b01..27d5181dab 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/JetBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/JetBounds.lean @@ -18,7 +18,7 @@ estimates follow from Mathlib's higher-order Leibniz inequality. No PDE, construction, or prescribed derivative values are assumed here. -/ -@[expose] public section +public section namespace NavierStokes.JetBounds @@ -35,7 +35,7 @@ variable {D E F G : Type*} /-- A common bound for the actual derivatives of orders `0, ..., m` on `s`. Smoothness is a separate hypothesis of the closure theorems. -/ -def FiniteJetBound (m : ℕ) (f : D → E) (s : Set D) (C : ℝ) : Prop := +@[expose] def FiniteJetBound (m : ℕ) (f : D → E) (s : Set D) (C : ℝ) : Prop := ∀ n : ℕ, n ≤ m → ∀ x ∈ s, ‖iteratedFDeriv ℝ n f x‖ ≤ C /-- An order-dependent bound for all actual derivatives on `s`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/JointODE.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/JointODE.lean index 337b8e03ef..28ebf56b08 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/JointODE.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/JointODE.lean @@ -24,7 +24,7 @@ solution on the prescribed closed interval. We do not assert smoothness of the original clamped extension outside that interval. -/ -@[expose] public section +public section namespace NavierStokes.JointODE @@ -41,13 +41,13 @@ variable {P E : Type u} [NormedAddCommGroup P] [NormedSpace ℝ P] variable {a b : ℝ} /-- The actual extension constructed by the Volterra inverse, jointly indexed. -/ -noncomputable def actualSolution (hab : a ≤ b) (A : P × ℝ → E →L[ℝ] E) +@[expose] noncomputable def actualSolution (hab : a ≤ b) (A : P × ℝ → E →L[ℝ] E) (x₀ : P → E) (f : P × ℝ → E) (z : P × ℝ) : E := ParametricODE.solutionExtension hab (SmoothPathFamily.pathFamily A z.1) (x₀ z.1) (SmoothPathFamily.pathFamily f z.1) z.2 /-- The affine time change from the unit interval to `[a,t]`. -/ -noncomputable def affineTime (a t s : ℝ) : ℝ := a + s * (t - a) +@[expose] noncomputable def affineTime (a t s : ℝ) : ℝ := a + s * (t - a) @[simp] theorem affineTime_zero (a t : ℝ) : affineTime a t 0 = a := by simp [affineTime] @@ -69,7 +69,7 @@ theorem hasDerivAt_affineTime (a t s : ℝ) : simpa using ((hasDerivAt_id s).mul_const (t - a)).const_add a /-- `(p,t,s)` is sent to the original coefficient argument `(p,a+s(t-a))`. -/ -noncomputable def timeMap (a : ℝ) (w : (P × ℝ) × ℝ) : P × ℝ := +@[expose] noncomputable def timeMap (a : ℝ) (w : (P × ℝ) × ℝ) : P × ℝ := (w.1.1, affineTime a w.1.2 w.2) theorem contDiff_timeMap (a : ℝ) : ContDiff ℝ ∞ (timeMap (P := P) a) := @@ -79,7 +79,7 @@ theorem contDiff_timeMap (a : ℝ) : ContDiff ℝ ∞ (timeMap (P := P) a) := variable {W : Type u} [NormedAddCommGroup W] [NormedSpace ℝ W] /-- Both the linear coefficient and the source acquire the time-change factor. -/ -noncomputable def rescale (a : ℝ) (F : P × ℝ → W) (w : (P × ℝ) × ℝ) : W := +@[expose] noncomputable def rescale (a : ℝ) (F : P × ℝ → W) (w : (P × ℝ) × ℝ) : W := (w.1.2 - a) • F (timeMap a w) theorem rescale_contDiffOn {U : Set P} {V : Set ℝ} @@ -102,7 +102,7 @@ theorem rescale_slice_continuousOn {U : Set P} (F : P × ℝ → W) exact (continuousOn_const (c := z.2 - a)).smul hc /-- A new solution on the fixed unit interval, evaluated at its fixed right endpoint. -/ -noncomputable def reparamSolution (a : ℝ) (A : P × ℝ → E →L[ℝ] E) +@[expose] noncomputable def reparamSolution (a : ℝ) (A : P × ℝ → E →L[ℝ] E) (x₀ : P → E) (f : P × ℝ → E) (z : P × ℝ) : E := SmoothPathFamily.odeFamily (a := 0) (b := 1) zero_le_one (rescale a A) (fun q => x₀ q.1) (rescale a f) z ⟨1, zero_le_one, le_rfl⟩ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/JointResidualLimits.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/JointResidualLimits.lean index 478a00872f..d7721517cd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/JointResidualLimits.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/JointResidualLimits.lean @@ -18,7 +18,7 @@ each other point of the terminal slice. The boundary tensor family and its local uniform convergence are constructed below. -/ -@[expose] public section +public section noncomputable section @@ -94,12 +94,12 @@ structure OneSidedExtension (f : SpaceTime → V) (x : Space) where agrees : EqOn value f (domain ∩ SpacetimeEndpoint.openPast 1) /-- Away extensions, given by `∀ x : Space, x ≠ 0 → Nonempty (OneSidedExtension f x)`. -/ -def AwayExtensions (f : SpaceTime → V) : Prop := +@[expose] def AwayExtensions (f : SpaceTime → V) : Prop := ∀ x : Space, x ≠ 0 → Nonempty (OneSidedExtension f x) /-- Vanishing joint jets, given by `∀ n : ℕ, Tendsto (iteratedFDeriv ℝ n f) (𝓝[SpacetimeEndpoint.openPast 1] ((1 : ℝ), (0 : Space))) (𝓝 0)`. -/ -def VanishingJointJets (f : SpaceTime → V) : Prop := +@[expose] def VanishingJointJets (f : SpaceTime → V) : Prop := ∀ n : ℕ, Tendsto (iteratedFDeriv ℝ n f) (𝓝[SpacetimeEndpoint.openPast 1] ((1 : ℝ), (0 : Space))) (𝓝 0) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSumBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSumBounds.lean index 5e29a72d93..2da78bdbf9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSumBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSumBounds.lean @@ -20,7 +20,7 @@ sum estimates use the actual closed label windows and the existing finite coloring, rather than the total number of labels in an active finite set. -/ -@[expose] public section +public section noncomputable section @@ -515,6 +515,7 @@ theorem uniform_blockCovariance {s : StripData D} {P : ι → ℕ → D → ℝ} /-! ## Actual finite sums and support-induced covariance diagonality -/ /-- Field sum, defined pointwise by `∑ l ∈ labels n, u l n p i`. -/ +@[expose] noncomputable def fieldSum (labels : ℕ → Finset ι) (u : ι → Oscillation D) : Oscillation D := fun n p i => ∑ l ∈ labels n, u l n p i @@ -769,7 +770,7 @@ noncomputable def symmetricCovariance (u v : Oscillation D) : Tensor D := bilinearCovariance u v + bilinearCovariance v u /-- Definitionally the same five terms used by CorrectionStep. -/ -noncomputable def signedRemainder (primary old tangent curl : Oscillation D) : Tensor D := +@[expose] noncomputable def signedRemainder (primary old tangent curl : Oscillation D) : Tensor D := (bilinearCovariance old (tangent + curl) + bilinearCovariance (tangent + curl) old + bilinearCovariance (tangent + curl) (tangent + curl)) - symmetricCovariance primary tangent diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSupportPreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSupportPreservation.lean index 969e7f3e4f..91a7fa3566 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSupportPreservation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LabelSupportPreservation.lean @@ -17,7 +17,7 @@ The Gaussian clock cutoff supplies the temporal boundary of the carrier; the source supplies its slow and transverse boundaries. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStress.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStress.lean index 6b281c5801..e3ef1086c3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStress.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStress.lean @@ -22,7 +22,7 @@ The lag variables in this file are the regular primitives constructed in derivative. The physical identities keep the axial-viscosity remainder. -/ -@[expose] public section +public section noncomputable section @@ -37,24 +37,24 @@ open scoped Topology ContDiff variable {Ω : RadialDomain} (P : Profiles Ω) /-- The angular source `S_q`; `Profiles.angularSource` is `H S_q`. -/ -noncomputable def sourceTheta (h : ℝ) (w : Point) : ℝ := +@[expose] noncomputable def sourceTheta (h : ℝ) (w : Point) : ℝ := P.angularSource h w / P.H w /-- The axial source `S_n`. -/ -noncomputable def sourceAxial (h : ℝ) (w : Point) : ℝ := P.axialSource h w +@[expose] noncomputable def sourceAxial (h : ℝ) (w : Point) : ℝ := P.axialSource h w /-- The coefficient of the angular radial stress in Proposition 3.2. -/ -noncomputable def theta (h : ℝ) (w : Point) : ℝ := +@[expose] noncomputable def theta (h : ℝ) (w : Point) : ℝ := P.f w * w.1 * P.angularLag h w / L h w.2 + 2 * w.1 * partialX P.f w /-- The coefficient of the axial radial stress in Proposition 3.2. -/ -noncomputable def axial (h : ℝ) (w : Point) : ℝ := +@[expose] noncomputable def axial (h : ℝ) (w : Point) : ℝ := Real.sqrt (2 * w.1) * (partialX P.U w + P.axialLag h w / (2 * L h w.2)) /-- Slope A, given by `-2 * w.1 * partialX P.f w / P.f w`. -/ noncomputable def slopeA (w : Point) : ℝ := -2 * w.1 * partialX P.f w / P.f w /-- Slope B, given by `2 * w.1 * partialX P.U w / P.E w`. -/ -noncomputable def slopeB (w : Point) : ℝ := 2 * w.1 * partialX P.U w / P.E w +@[expose] noncomputable def slopeB (w : Point) : ℝ := 2 * w.1 * partialX P.U w / P.E w theorem theta_eq_lag_minus_slope (h : ℝ) {w : Point} (hf : P.f w ≠ 0) : theta P h w = P.f w * (w.1 * P.angularLag h w / L h w.2 - slopeA P w) := by @@ -271,7 +271,7 @@ theorem transport_pullback_add_axialViscosity {h e : ℝ} (hh : 0 < h) (hh1 : h ring /-- Cylindrical radial divergence `(∂r + k/r)S`, in the regular coordinate `s=r²/2`. -/ -noncomputable def radialDivergence (k : ℝ) (S : SimilarityProfile.PhysicalProfile) +@[expose] noncomputable def radialDivergence (k : ℝ) (S : SimilarityProfile.PhysicalProfile) (p : SimilarityProfile.PhysicalPoint) : ℝ := Real.sqrt (2 * p.2.1) * SimilarityProfile.partialS S p + k * S p / Real.sqrt (2 * p.2.1) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStressWeights.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStressWeights.lean index 45b755fd8f..51b2e30a44 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStressWeights.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LeadingStressWeights.lean @@ -18,7 +18,7 @@ Its edge factors are transported through the literal finite modulation and the five restored profile histories. -/ -@[expose] public section +public section noncomputable section @@ -32,6 +32,7 @@ open ProfileHistories /-- Stress, given by `(LeadingStress.theta P h p, LeadingStress.axial P h p)`. -/ +@[expose] noncomputable def stress {D : RadialDomain} (P : Profiles D) (h : ℝ) (p : Point) : ℝ × ℝ := (LeadingStress.theta P h p, LeadingStress.axial P h p) @@ -79,11 +80,12 @@ theorem stress_smooth {D : RadialDomain} (P : Profiles D) (h : ℝ) : fun _ hp => (stress_contDiffAt P h hp.1 hp.2.1 hp.2.2.1 hp.2.2.2).contDiffWithinAt /-- Log point, given by `(Real.exp p.2, p.1)`. -/ -noncomputable def logPoint (p : ℝ × ℝ) : Point := (Real.exp p.2, p.1) +@[expose] noncomputable def logPoint (p : ℝ × ℝ) : Point := (Real.exp p.2, p.1) theorem logPoint_smooth : ContDiff ℝ ∞ logPoint := contDiff_snd.exp.prodMk contDiff_fst /-- Log stress, given by `stress P h ∘ logPoint`. -/ +@[expose] noncomputable def logStress {D : RadialDomain} (P : Profiles D) (h : ℝ) : (ℝ × ℝ) → ℝ × ℝ := stress P h ∘ logPoint @@ -321,9 +323,9 @@ section OuterCollar variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- Left edge, given by `Real.log (NominalConeAssembly.activeLeft W)`. -/ -noncomputable def leftEdge : ℝ := Real.log (NominalConeAssembly.activeLeft W) +@[expose] noncomputable def leftEdge : ℝ := Real.log (NominalConeAssembly.activeLeft W) /-- Right edge, given by `Real.log (NominalConeAssembly.activeRight W)`. -/ -noncomputable def rightEdge : ℝ := Real.log (NominalConeAssembly.activeRight W) +@[expose] noncomputable def rightEdge : ℝ := Real.log (NominalConeAssembly.activeRight W) theorem rightEdge_eq : rightEdge W = Real.log W.controls.radius + OutgoingTail.tailEnd F.data := by unfold rightEdge NominalConeAssembly.activeRight @@ -581,19 +583,19 @@ end WholeAnnulus section ShearIdentities /-- Log shear A, given by `ActivationContinuation.shearA P (logPoint p)`. -/ -noncomputable def logShearA {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def logShearA {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := ActivationContinuation.shearA P (logPoint p) /-- Log shear B, given by `ActivationContinuation.shearB P (logPoint p)`. -/ -noncomputable def logShearB {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def logShearB {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := ActivationContinuation.shearB P (logPoint p) /-- Log speed, given by `ActivationContinuation.shearSize (logShearA P p) (logShearB P p)`. -/ -noncomputable def logSpeed {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def logSpeed {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := ActivationContinuation.shearSize (logShearA P p) (logShearB P p) /-- Log slope, given by `logShearB P p / logShearA P p`. -/ -noncomputable def logSlope {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def logSlope {D : RadialDomain} (P : Profiles D) (p : ℝ × ℝ) : ℝ := logShearB P p / logShearA P p theorem shearSize_eq (a b : ℝ) : ActivationContinuation.shearSize a b = a + b ^ 2 / a := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LiftedMeanResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LiftedMeanResidual.lean index 9545b76fef..59453780cd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LiftedMeanResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LiftedMeanResidual.lean @@ -19,7 +19,7 @@ uses Fréchet derivatives on an open lifted strip; the graph operators are instantiated from `CorrectionState.Context.operators`. -/ -@[expose] public section +public section namespace NavierStokes.LiftedMeanResidual @@ -137,7 +137,7 @@ noncomputable def avg (f : D × ℝ → ℝ) (x : D) : ℝ := (∫ θ in (0 : ℝ)..period, f (x, θ)) / period /-- Lift direction, given by `(V p.1, 0)`. -/ -noncomputable def liftDirection (V : D → D) (p : D × ℝ) : D × ℝ := (V p.1, 0) +@[expose] noncomputable def liftDirection (V : D → D) (p : D × ℝ) : D × ℝ := (V p.1, 0) /-- Angular direction, given by `(0, 1)`. -/ noncomputable def angularDirection (_p : D × ℝ) : D × ℝ := (0, 1) @@ -297,27 +297,32 @@ theorem theta_lift_zero {f : D → ℝ} {x : D} (hf : DifferentiableAt ℝ f x) exact map_zero _ /-- Radial vector, given by `o.eR + (o.radialFrequency n * o.radialProfile x) • o.vR`. -/ +@[expose] noncomputable def radialVector (o : MeanIncrementBounds.Operators D) (n : ℕ) (x : D) : D := o.eR + (o.radialFrequency n * o.radialProfile x) • o.vR /-- Axial vector, given by `o.epsilon n • o.eZ`. -/ +@[expose] noncomputable def axialVector (o : MeanIncrementBounds.Operators D) (n : ℕ) (_x : D) : D := o.epsilon n • o.eZ /-- Temporal vector, given by `o.fastCoefficient n • o.vT - o.epsilon n • o.eT`. -/ +@[expose] noncomputable def temporalVector (o : MeanIncrementBounds.Operators D) (n : ℕ) (_x : D) : D := o.fastCoefficient n • o.vT - o.epsilon n • o.eT /-- Radial direction, given by `liftDirection (radialVector c.operators n)`. -/ +@[expose] noncomputable def radialDirection (c : CorrectionState.Context D) (n : ℕ) : D × ℝ → D × ℝ := liftDirection (radialVector c.operators n) /-- Axial direction, given by `liftDirection (axialVector c.operators n)`. -/ +@[expose] noncomputable def axialDirection (c : CorrectionState.Context D) (n : ℕ) : D × ℝ → D × ℝ := liftDirection (axialVector c.operators n) /-- Time direction, given by `liftDirection (temporalVector c.operators n)`. -/ -noncomputable def timeDirection (c : CorrectionState.Context D) (n : ℕ) : D × ℝ → D × ℝ := +@[expose] noncomputable def timeDirection (c : CorrectionState.Context D) (n : ℕ) : D × ℝ → D × ℝ := liftDirection (temporalVector c.operators n) /-- Complex base, given by `![(c.base.radial n x.1 : ℂ), (c.base.angular n x.1 : ℂ), @@ -338,6 +343,7 @@ noncomputable def complexPressure (u : CorrectionState.State D) (n : ℕ) (x : D /-- Virtual divergence, given by `![0, -(c.operators.radialDiv 2 c.virtualTheta n x.1), -(c.operators.radialDiv 1 c.virtualAxial n x.1)]`. -/ +@[expose] noncomputable def virtualDivergence (c : CorrectionState.Context D) (n : ℕ) (x : D × ℝ) : Fin 3 → ℝ := ![0, -(c.operators.radialDiv 2 c.virtualTheta n x.1), @@ -345,13 +351,14 @@ noncomputable def virtualDivergence (c : CorrectionState.Context D) (n : ℕ) (x /-- Nonlinear residual, given by `LinearWaveResidual.linearResidual ε R Vr Vθ Vz Vt B a p x + LinearWaveResidual.transport R Vr Vθ Vz a a x`. -/ -noncomputable def nonlinearResidual (ε : ℝ) (R : (D × ℝ) → ℝ) +@[expose] noncomputable def nonlinearResidual (ε : ℝ) (R : (D × ℝ) → ℝ) (Vr Vθ Vz Vt : D × ℝ → D × ℝ) (B a : D × ℝ → ComplexVector) (p : D × ℝ → ℂ) (x : D × ℝ) : ComplexVector := LinearWaveResidual.linearResidual ε R Vr Vθ Vz Vt B a p x + LinearWaveResidual.transport R Vr Vθ Vz a a x /-- Full residual as an element of `CorrectionState.Oscillation D`. -/ +@[expose] noncomputable def fullResidual (c : CorrectionState.Context D) (u : CorrectionState.State D) : CorrectionState.Oscillation D := fun n x i => (nonlinearResidual (c.operators.epsilon n) (fun y : D × ℝ => c.operators.radius y.1) @@ -371,7 +378,7 @@ noncomputable def angularMeanVector (f : CorrectionState.Oscillation D) : /-- Real divergence, given by `along Vr (fun y => a y 0) p + a p 0 / R p + along Vθ (fun y => a y 1) p / R p + along Vz (fun y => a y 2) p`. -/ -noncomputable def realDivergence (R : D × ℝ → ℝ) (Vr Vθ Vz : D × ℝ → D × ℝ) +@[expose] noncomputable def realDivergence (R : D × ℝ → ℝ) (Vr Vθ Vz : D × ℝ → D × ℝ) (a : D × ℝ → Fin 3 → ℝ) (p : D × ℝ) : ℝ := along Vr (fun y => a y 0) p + a p 0 / R p + along Vθ (fun y => a y 1) p / R p + along Vz (fun y => a y 2) p @@ -851,10 +858,12 @@ theorem viscosity_eq (o : MeanIncrementBounds.Operators D) (c : ℝ) ring /-- Triple vector, given by `![m.radial n x, m.angular n x, m.axial n x]`. -/ +@[expose] noncomputable def tripleVector (m : MeanIncrementBounds.Triple D) (n : ℕ) (x : D) : Fin 3 → ℝ := ![m.radial n x, m.angular n x, m.axial n x] /-- Base lift, given by `tripleVector c.base n p.1`. -/ +@[expose] noncomputable def baseLift (c : CorrectionState.Context D) (n : ℕ) (p : D × ℝ) : Fin 3 → ℝ := tripleVector c.base n p.1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveBounds.lean index 293570b3a3..c9cf94fdc1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveBounds.lean @@ -18,7 +18,7 @@ coefficients uniformly in the band. Radial graph differentiation, axial rescaling, and the fast direction are kept explicit. -/ -@[expose] public section +public section noncomputable section @@ -123,15 +123,16 @@ structure GraphDirections (D : Type*) [NormedAddCommGroup D] [NormedSpace ℝ D] namespace GraphDirections /-- Radial field, given by `d.radial + d.radialScale n • (d.radialProfile x • d.auxiliary)`. -/ -noncomputable def radialField (d : GraphDirections D) (n : ℕ) (x : D) : D := +@[expose] noncomputable def radialField (d : GraphDirections D) (n : ℕ) (x : D) : D := d.radial + d.radialScale n • (d.radialProfile x • d.auxiliary) /-- Axial field, given by `s.epsilon n • d.axial`. -/ +@[expose] noncomputable def axialField (d : GraphDirections D) (s : StripData D) (n : ℕ) (_ : D) : D := s.epsilon n • d.axial /-- Fast field, given by `d.fastScale n • d.fast`. -/ -noncomputable def fastField (d : GraphDirections D) (n : ℕ) (_ : D) : D := +@[expose] noncomputable def fastField (d : GraphDirections D) (n : ℕ) (_ : D) : D := d.fastScale n • d.fast /-- Dr, defined pointwise by `along (d.radialField n) (f n)`. -/ @@ -147,7 +148,7 @@ noncomputable def Dt (d : GraphDirections D) (f : ℕ → D → E) : ℕ → D fun n => along (fun _ => d.slow) (f n) /-- Dfast, defined pointwise by `along (d.fastField n) (f n)`. -/ -noncomputable def Dfast (d : GraphDirections D) (f : ℕ → D → E) : ℕ → D → E := +@[expose] noncomputable def Dfast (d : GraphDirections D) (f : ℕ → D → E) : ℕ → D → E := fun n => along (d.fastField n) (f n) theorem Dr_eq (d : GraphDirections D) (f : ℕ → D → E) : @@ -222,11 +223,13 @@ namespace WaveCoefficients /-- Normal, given by `phaseNormal (a.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.phase n)`. -/ +@[expose] noncomputable def normal (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → EuclideanSpace ℝ (Fin 3) := phaseNormal (a.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.phase n) /-- Defect, constructed using `LinearWaveResidual.materialPhaseDefect`. -/ +@[expose] noncomputable def defect (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ℝ := LinearWaveResidual.materialPhaseDefect (a.radius n) (a.radialBase n) (a.frequencyBase n) @@ -234,6 +237,7 @@ noncomputable def defect (a : WaveCoefficients D) (s : StripData D) (d : GraphDi (LinearWaveResidual.timeDirection (s.epsilon n) (d.fastField n) (fun _ => d.slow)) (a.phase n) /-- Remainder, constructed using `LinearWaveResidual.remainder`. -/ +@[expose] noncomputable def remainder (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := LinearWaveResidual.remainder (s.epsilon n) (a.frequency n) (a.radius n) (a.radialBase n) @@ -241,6 +245,7 @@ noncomputable def remainder (a : WaveCoefficients D) (s : StripData D) (d : Grap (d.axialField s n) (d.fastField n) (fun _ => d.slow) (a.phase n) (a.amplitude n) (a.pressure n) /-- Principal, constructed using `LinearWaveResidual.principal`. -/ +@[expose] noncomputable def principal (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := LinearWaveResidual.principal (s.epsilon n) (a.frequency n) (a.radius n) (a.frequencyBase n) @@ -248,6 +253,7 @@ noncomputable def principal (a : WaveCoefficients D) (s : StripData D) (d : Grap (a.phase n) (a.amplitude n) (a.pressure n) /-- Principal velocity, constructed using `LinearWaveResidual.principal`. -/ +@[expose] noncomputable def principalVelocity (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (f : ℕ → D → ComplexVector) (n : ℕ) : D → ComplexVector := @@ -256,11 +262,12 @@ noncomputable def principalVelocity (a : WaveCoefficients D) (s : StripData D) ( (a.phase n) (f n) (fun _ => 0) /-- Add amplitude, given by `{a with amplitude := fun n x => a.amplitude n x + f n x}`. -/ -noncomputable def addAmplitude (a : WaveCoefficients D) (f : ℕ → D → ComplexVector) : +@[expose] noncomputable def addAmplitude (a : WaveCoefficients D) (f : ℕ → D → ComplexVector) : WaveCoefficients D := {a with amplitude := fun n x => a.amplitude n x + f n x} /-- With cutoff, given by `{ a with amplitude := fun n x => ψ n x • a.amplitude n x pressure := fun n x => (ψ n x : ℂ) * a.pressure n x }`. -/ +@[expose] noncomputable def withCutoff (a : WaveCoefficients D) (ψ : ℕ → D → ℝ) : WaveCoefficients D := { a with amplitude := fun n x => ψ n x • a.amplitude n x @@ -268,12 +275,13 @@ noncomputable def withCutoff (a : WaveCoefficients D) (ψ : ℕ → D → ℝ) : /-- The retained coefficient after cutoff and exact-curl correction. The two slot tails are not included in this definition. -/ -noncomputable def goodCoefficient (a : WaveCoefficients D) (s : StripData D) +@[expose] noncomputable def goodCoefficient (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (ψ : ℕ → D → ℝ) (f : ℕ → D → ComplexVector) (n : ℕ) (x : D) : ComplexVector := a.principalVelocity s d f n x + ((a.withCutoff ψ).addAmplitude f).remainder s d n x /-- Harmonic residual, constructed using `LinearWaveResidual.linearResidual`. -/ +@[expose] noncomputable def harmonicResidual (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := @@ -292,7 +300,7 @@ namespace WaveCoefficients /-- The actual coefficient error from taking the curl of the normalized harmonic vector potential. -/ -noncomputable def curlCorrection (a : WaveCoefficients D) (s : StripData D) +@[expose] noncomputable def curlCorrection (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := CurlClassBounds.curlRemainder (a.frequency n) (a.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) @@ -300,18 +308,18 @@ noncomputable def curlCorrection (a : WaveCoefficients D) (s : StripData D) (d.axialField s n) (a.phase n) (a.amplitude n)) /-- Curl potential, constructed using `CurlClassBounds.vectorPotential`. -/ -noncomputable def curlPotential (a : WaveCoefficients D) (s : StripData D) +@[expose] noncomputable def curlPotential (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (n : ℕ) : D → ComplexVector := CurlClassBounds.vectorPotential (a.frequency n) (a.radius n) (d.radialField n) (fun _ => d.angular) (d.axialField s n) (a.phase n) (a.amplitude n) /-- Corrected, given by `(a.withCutoff ψ).addAmplitude ((a.withCutoff ψ).curlCorrection s d)`. -/ -noncomputable def corrected (a : WaveCoefficients D) (s : StripData D) +@[expose] noncomputable def corrected (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (ψ : ℕ → D → ℝ) : WaveCoefficients D := (a.withCutoff ψ).addAmplitude ((a.withCutoff ψ).curlCorrection s d) /-- Constructed good, given by `a.goodCoefficient s d ψ ((a.withCutoff ψ).curlCorrection s d)`. -/ -noncomputable def constructedGood (a : WaveCoefficients D) (s : StripData D) +@[expose] noncomputable def constructedGood (a : WaveCoefficients D) (s : StripData D) (d : GraphDirections D) (ψ : ℕ → D → ℝ) : ℕ → D → ComplexVector := a.goodCoefficient s d ψ ((a.withCutoff ψ).curlCorrection s d) @@ -342,7 +350,7 @@ structure InputBounds (s : StripData D) (P : ℕ → D → ℝ) (α κ : ℝ) /-- Insert component, given by `ContinuousLinearMap.pi fun j => if j = i then ContinuousLinearMap.id ℝ ℂ else 0`. -/ -noncomputable def insertComponent (i : Fin 3) : ℂ →L[ℝ] ComplexVector := +@[expose] noncomputable def insertComponent (i : Fin 3) : ℂ →L[ℝ] ComplexVector := ContinuousLinearMap.pi fun j => if j = i then ContinuousLinearMap.id ℝ ℂ else 0 theorem component_classes {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} @@ -809,7 +817,7 @@ theorem corrected_divergence {s : StripData D} {P : ℕ → D → ℝ} {α κ : /-- The two excluded slot terms remain explicit fields. Their Gaussian flatness is a separate analytic theorem, never an instruction to set them to zero. -/ -noncomputable def excludedSlotError (d : GraphDirections D) (ψ : ℕ → D → ℝ) +@[expose] noncomputable def excludedSlotError (d : GraphDirections D) (ψ : ℕ → D → ℝ) (a source : ℕ → D → ComplexVector) : ℕ → D → ComplexVector := fun n x => d.Dfast ψ n x • a n x + (1 - ψ n x) • source n x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveResidual.lean index c799a42d81..4e65096216 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LinearWaveResidual.lean @@ -19,7 +19,7 @@ to a curl-corrected coefficient without replacing it by its tangent principal part. The angular direction is unscaled. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ open scoped Topology ContDiff BigOperators variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Time direction, given by `Vf x - ε • Vs x`. -/ -noncomputable def timeDirection (ε : ℝ) (Vf Vs : E → E) (x : E) : E := +@[expose] noncomputable def timeDirection (ε : ℝ) (Vf Vs : E → E) (x : E) : E := Vf x - ε • Vs x theorem along_timeDirection (ε : ℝ) (Vf Vs : E → E) (f : E → ℂ) (x : E) : @@ -48,65 +48,65 @@ theorem along_mul_real (V : E → E) {f g : E → ℝ} {x : E} ring /-- The real base components, with angular velocity `V=R F`. -/ -noncomputable def base (R b F G : E → ℝ) (x : E) : Fin 3 → ℝ := +@[expose] noncomputable def base (R b F G : E → ℝ) (x : E) : Fin 3 → ℝ := ![b x, R x * F x, G x] /-- Complex base, defined pointwise by `(base R b F G x i : ℂ)`. -/ -noncomputable def complexBase (R b F G : E → ℝ) (x : E) : ComplexVector := +@[expose] noncomputable def complexBase (R b F G : E → ℝ) (x : E) : ComplexVector := fun i => (base R b F G x i : ℂ) /-- Cylindrical bilinear advection, including the derivative of the frame. -/ -noncomputable def transport (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def transport (R : E → ℝ) (Vr Vθ Vz : E → E) (u v : E → ComplexVector) (x : E) : ComplexVector := fun i => u x 0 * along Vr (fun y => v y i) x + (u x 1 / (R x : ℂ)) * (along Vθ (fun y => v y i) x + angularGenerator (v x) i) + u x 2 * along Vz (fun y => v y i) x /-- Gradient, given by `![along Vr p x, (R x)⁻¹ • along Vθ p x, along Vz p x]`. -/ -noncomputable def gradient (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def gradient (R : E → ℝ) (Vr Vθ Vz : E → E) (p : E → ℂ) (x : E) : ComplexVector := ![along Vr p x, (R x)⁻¹ • along Vθ p x, along Vz p x] /-- The genuine differential linearization with viscosity `ε`. -/ -noncomputable def linearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) +@[expose] noncomputable def linearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) (B a : E → ComplexVector) (p : E → ℂ) (x : E) : ComplexVector := fun i => along Vt (fun y => a y i) x + transport R Vr Vθ Vz B a x i + transport R Vr Vθ Vz a B x i + gradient R Vr Vθ Vz p x i - (ε : ℂ) * cylindricalVectorLaplacian R Vr Vθ Vz a x i /-- Matrix `K` from (27), with its radial coefficients actually differentiated. -/ -noncomputable def shear (R F G : E → ℝ) (Vr : E → E) +@[expose] noncomputable def shear (R F G : E → ℝ) (Vr : E → E) (a : E → ComplexVector) (x : E) : ComplexVector := ![-2 * (F x : ℂ) * a x 1, Complex.ofReal (2 * F x + R x * along Vr F x) * a x 0, Complex.ofReal (along Vr G x) * a x 0] /-- The base derivative and radial-flow connection terms outside `K`. -/ -noncomputable def baseDerivativeRemainder (R b F G : E → ℝ) (Vr Vz : E → E) +@[expose] noncomputable def baseDerivativeRemainder (R b F G : E → ℝ) (Vr Vz : E → E) (a : E → ComplexVector) (x : E) : ComplexVector := fun i => (![a x 0 * Complex.ofReal (along Vr b x), (b x : ℂ) / (R x : ℂ) * a x 1, 0] i) + a x 2 * Complex.ofReal (along Vz (fun y => base R b F G y i) x) /-- Material phase defect, given by `along Vt Φ x + b x * along Vr Φ x + F x * along Vθ Φ x + G x * along Vz Φ x`. -/ -noncomputable def materialPhaseDefect (_R b F G : E → ℝ) (Vr Vθ Vz Vt : E → E) +@[expose] noncomputable def materialPhaseDefect (_R b F G : E → ℝ) (Vr Vθ Vz Vt : E → E) (Φ : E → ℝ) (x : E) : ℝ := along Vt Φ x + b x * along Vr Φ x + F x * along Vθ Φ x + G x * along Vz Φ x /-- Slow transport, defined pointwise by `-(ε : ℂ) * along Vs (fun y => a y i) x + (b x : ℂ) * along Vr (fun y => a y i) x + (G x : ℂ) * along Vz (fun y => a y i) x`. -/ -noncomputable def slowTransport (ε : ℝ) (b G : E → ℝ) (Vs Vr Vz : E → E) +@[expose] noncomputable def slowTransport (ε : ℝ) (b G : E → ℝ) (Vs Vr Vz : E → E) (a : E → ComplexVector) (x : E) : ComplexVector := fun i => -(ε : ℂ) * along Vs (fun y => a y i) x + (b x : ℂ) * along Vr (fun y => a y i) x + (G x : ℂ) * along Vz (fun y => a y i) x /-- Stripped pressure gradient, given by `![along Vr p x, 0, along Vz p x]`. -/ -noncomputable def strippedPressureGradient (Vr Vz : E → E) (p : E → ℂ) +@[expose] noncomputable def strippedPressureGradient (Vr Vz : E → E) (p : E → ℂ) (x : E) : ComplexVector := ![along Vr p x, 0, along Vz p x] /-- The complete viscous braces in (31), after removal of phase-square damping. -/ -noncomputable def viscousRemainder (R : E → ℝ) (Vr Vθ Vz : E → E) (κ : ℝ) +@[expose] noncomputable def viscousRemainder (R : E → ℝ) (Vr Vθ Vz : E → E) (κ : ℝ) (Φ : E → ℝ) (a : E → ComplexVector) (x : E) : ComplexVector := fun i => along Vr (along Vr (fun y => a y i)) x + (R x)⁻¹ • along Vr (fun y => a y i) x + along Vz (along Vz (fun y => a y i)) x + @@ -122,14 +122,14 @@ noncomputable def viscousRemainder (R : E → ℝ) (Vr Vθ Vz : E → E) (κ : angularGenerator (a x) i /-- Principal as an element of `ComplexVector`. -/ -noncomputable def principal (ε κ : ℝ) (R F G : E → ℝ) (Vr Vθ Vz Vf : E → E) +@[expose] noncomputable def principal (ε κ : ℝ) (R F G : E → ℝ) (Vr Vθ Vz Vf : E → E) (Φ : E → ℝ) (a : E → ComplexVector) (p : E → ℂ) (x : E) : ComplexVector := fun i => along Vf (fun y => a y i) x + shear R F G Vr a x i + Complex.ofReal (ε * κ ^ 2 * ‖phaseNormal R Vr Vθ Vz Φ x‖ ^ 2) * a x i + phaseFactor κ * Complex.ofReal (phaseNormal R Vr Vθ Vz Φ x i) * p x /-- Remainder as an element of `ComplexVector`. -/ -noncomputable def remainder (ε κ : ℝ) (R b F G : E → ℝ) (Vr Vθ Vz Vf Vs : E → E) +@[expose] noncomputable def remainder (ε κ : ℝ) (R b F G : E → ℝ) (Vr Vθ Vz Vf Vs : E → E) (Φ : E → ℝ) (a : E → ComplexVector) (p : E → ℂ) (x : E) : ComplexVector := fun i => slowTransport ε b G Vs Vr Vz a x i + phaseFactor κ * Complex.ofReal @@ -446,27 +446,28 @@ theorem cylindricalLaplacian_map (L : F₁ →L[ℝ] F₂) {U : Set E} (R : E end LinearMaps /-- Real lift, defined pointwise by `(a x i : ℂ)`. -/ +@[expose] noncomputable def realLift (a : E → Fin 3 → ℝ) (x : E) : ComplexVector := fun i => (a x i : ℂ) /-- Real angular generator, given by `![-a 1, a 0, 0]`. -/ -noncomputable def realAngularGenerator (a : Fin 3 → ℝ) : Fin 3 → ℝ := ![-a 1, a 0, 0] +@[expose] noncomputable def realAngularGenerator (a : Fin 3 → ℝ) : Fin 3 → ℝ := ![-a 1, a 0, 0] /-- Real transport as an element of `Fin 3 → ℝ`. -/ -noncomputable def realTransport (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def realTransport (R : E → ℝ) (Vr Vθ Vz : E → E) (u v : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := fun i => u x 0 * along Vr (fun y => v y i) x + (u x 1 / R x) * (along Vθ (fun y => v y i) x + realAngularGenerator (v x) i) + u x 2 * along Vz (fun y => v y i) x /-- Real frame laplacian as an element of `Fin 3 → ℝ`. -/ -noncomputable def realFrameLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def realFrameLaplacian (R : E → ℝ) (Vr Vθ Vz : E → E) (a : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := fun i => cylindricalLaplacian R Vr Vθ Vz (fun y => a y i) x + ((R x) ^ 2)⁻¹ * (2 * realAngularGenerator (fun j => along Vθ (fun y => a y j) x) i + realAngularGenerator (realAngularGenerator (a x)) i) /-- Real component form of the same differential linearization. -/ -noncomputable def realComponentLinearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) +@[expose] noncomputable def realComponentLinearResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) (B a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) : Fin 3 → ℝ := fun i => along Vt (fun y => a y i) x + realTransport R Vr Vθ Vz B a x i + realTransport R Vr Vθ Vz a B x i + @@ -523,7 +524,7 @@ theorem realMap_linearResidual {U : Set E} (L : ℂ →L[ℝ] ℝ) (ε : ℝ) (R open ProblemStatement /-- Bilinear advection, constructed using `u`. -/ -noncomputable def bilinearAdvection (u v : Space → Space) (q : Space) : Space := +@[expose] noncomputable def bilinearAdvection (u v : Space → Space) (q : Space) : Space := u q 0 • CylindricalResidual.dCoord 0 v q + (u q 1 / q 0) • (CylindricalResidual.dCoord 1 v q + CylindricalResidual.connection (v q)) + u q 2 • CylindricalResidual.dCoord 2 v q @@ -602,14 +603,14 @@ theorem cartesianLinearResidual_cylindrical (ε : ℝ) {B a : VelocityField} {p rfl /-- Space direction, given by `(0, coordinateVector i)`. -/ -noncomputable def spaceDirection (i : Fin 3) (_ : SpaceTime) : SpaceTime := +@[expose] noncomputable def spaceDirection (i : Fin 3) (_ : SpaceTime) : SpaceTime := (0, coordinateVector i) /-- Physical time direction, given by `(1, 0)`. -/ -noncomputable def physicalTimeDirection (_ : SpaceTime) : SpaceTime := (1, 0) +@[expose] noncomputable def physicalTimeDirection (_ : SpaceTime) : SpaceTime := (1, 0) /-- Coordinate radius, given by `x.2 0`. -/ -noncomputable def coordinateRadius (x : SpaceTime) : ℝ := x.2 0 +@[expose] noncomputable def coordinateRadius (x : SpaceTime) : ℝ := x.2 0 section Slices diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAngularDiagonal.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAngularDiagonal.lean index 3da6f95f55..1212a74244 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAngularDiagonal.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAngularDiagonal.lean @@ -20,7 +20,7 @@ sum itself is smooth and divergence-free on the whole preterminal region. No global smooth replacement of the raw scalar is chosen. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAxisymmetricResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAxisymmetricResidual.lean index 265609669c..d65f44c5f6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAxisymmetricResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalAxisymmetricResidual.lean @@ -18,7 +18,7 @@ derivative formulas use equality of germs of first derivatives, so they do not impose any condition on an unrelated profile point such as the axis. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalMeanPhysicalBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalMeanPhysicalBounds.lean index 3826377500..31913fa3df 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalMeanPhysicalBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalMeanPhysicalBounds.lean @@ -19,7 +19,7 @@ open region and a genuine local equality with the selected band field. The field itself is the existing coherent physical field, not a band sum. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalPhysicalCopyBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalPhysicalCopyBounds.lean index 54d659661b..fa340aeba1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalPhysicalCopyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalPhysicalCopyBounds.lean @@ -20,7 +20,7 @@ germ at one evaluation point. The physical carrier bound measures only jets at that point, so no bound on the extension away from it is needed. -/ -@[expose] public section +public section noncomputable section @@ -113,7 +113,7 @@ noncomputable def replaceProfiles (c : CarrierData) (F G : PhysicalGraphBounds.Slow → ℝ) : CarrierData := { c with F := F, G := G } /-- Slot slow as an element of `PhysicalGraphBounds.Slow`. -/ -noncomputable def slotSlow (c : CarrierData) (a h : ℝ) (n : ℕ) (r0 : ℝ) +@[expose] noncomputable def slotSlow (c : CarrierData) (a h : ℝ) (n : ℕ) (r0 : ℝ) (w : SpaceTime) : PhysicalGraphBounds.Slow := (PhysicalGraphBounds.slotMap (PolarCharts.chart a c.chart) (ChartScales.timeCoefficient h n) c.center r0 (PhysicalGraphBounds.physicalLift h n w)).1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalRankDefect.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalRankDefect.lean index 143c30ec57..d9acfb63fa 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalRankDefect.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalRankDefect.lean @@ -17,7 +17,7 @@ it equal to the same zero-axis primitive in every containing gauge. All moment estimates below use the local physical domain, not global slow data. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalResidualGrouping.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalResidualGrouping.lean index bd11e9f519..2af1b1072a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalResidualGrouping.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalResidualGrouping.lean @@ -29,7 +29,7 @@ is derived from the represented finite harmonic fields, with no regularity or support assumption on the independent alias. -/ -@[expose] public section +public section noncomputable section @@ -307,7 +307,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalSignedRequest.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalSignedRequest.lean index 265fc04d3d..9f375d1453 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalSignedRequest.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalSignedRequest.lean @@ -39,7 +39,7 @@ to prove local smoothness and equality of germs; none of their derivatives enters the uniform estimates. -/ -@[expose] public section +public section noncomputable section @@ -53,7 +53,7 @@ variable {S V : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- All radii and torus variables, with only the slow parameter restricted. -/ -noncomputable def slowDomain (U : Set S) : Set (PressureStream.Lift S) := +@[expose] noncomputable def slowDomain (U : Set S) : Set (PressureStream.Lift S) := {p | p.2.1 ∈ U} omit [NormedSpace ℝ S] in @@ -122,6 +122,7 @@ theorem FiberGerm.jet_eq {s : S} {f g : PressureStream.Lift S → V} simpa only [iteratedFDerivWithin_univ] using hw.iteratedFDerivWithin_eq he.self_of_nhds j /-- An auxiliary localization, used only for germs. -/ +@[expose] noncomputable def localize (c : S → ℝ) (f : PressureStream.Lift S → V) (p : PressureStream.Lift S) : V := c p.2.1 • f p @@ -180,6 +181,7 @@ theorem exists_fiber_localization [FiniteDimensional ℝ S] /-- Freezing the slow parameter never changes a radial transport integral on that fiber. It does not freeze any jet appearing in the integrand. -/ +@[expose] noncomputable def freezeSlow (s : S) (f : PressureStream.Lift S → V) (p : PressureStream.Lift S) : V := f (p.1, (s, p.2.2)) @@ -1090,7 +1092,7 @@ section MomentsAndChanges variable [FiniteDimensional ℝ S] /-- Local slow strip data as an element of `StripData S`. -/ -noncomputable def localSlowStripData (U : Set S) (hU : IsOpen U) +@[expose] noncomputable def localSlowStripData (U : Set S) (hU : IsOpen U) (ε L : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hL : ∀ n, 1 ≤ L n) : StripData S := { MeanMomentBounds.slowStripData ε L hε hεone hL with @@ -1842,7 +1844,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2433,7 +2435,7 @@ theorem meanClass_physicalBarSigma {coord : ℝ} (U : SlowRegion coord) exact hmul /-- Both components are computed from the same actual state. -/ -noncomputable def requestedStress (P : SignedStressPrimitive.Patch) (coord : ℝ) +@[expose] noncomputable def requestedStress (P : SignedStressPrimitive.Patch) (coord : ℝ) (c : CorrectionState.Context Point) (u : CorrectionState.State Point) : ℕ → Point → SignedWaveUpdate.Vec2 := fun n x => ![SignedStressPrimitive.physicalBarSigma P 2 (SimilarityCoordinates.coordinateQ coord) @@ -2443,6 +2445,7 @@ noncomputable def requestedStress (P : SignedStressPrimitive.Patch) (coord : ℝ /-- Normalized request, defined pointwise by `(s.epsilon n)⁻¹ • requestedStress P coord c u n x`. -/ +@[expose] noncomputable def normalizedRequest (s : StripData Point) (P : SignedStressPrimitive.Patch) (coord : ℝ) (c : CorrectionState.Context Point) (u : CorrectionState.State Point) : ℕ → Point → SignedWaveUpdate.Vec2 := @@ -2485,7 +2488,7 @@ theorem normalizedRequest_frozen (s : StripData Point) (P : SignedStressPrimitiv simp only [normalizedRequest, requestedStress, Prod.smul_mk, smul_zero, Prod.mk_add_mk, add_zero] /-- Genuine pullback to the full coefficient domain, including the angle. -/ -noncomputable def fullRequest (s : StripData Point) (P : SignedStressPrimitive.Patch) +@[expose] noncomputable def fullRequest (s : StripData Point) (P : SignedStressPrimitive.Patch) (coord : ℝ) (c : CorrectionState.Context Point) (u : CorrectionState.State Point) : ℕ → Point × ℝ → SignedWaveUpdate.Vec2 := fun n x => normalizedRequest s P coord c u n x.1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedCurlRealization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedCurlRealization.lean index 41d07533b8..3389e9a32b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedCurlRealization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedCurlRealization.lean @@ -18,7 +18,7 @@ copy cell. The actual common potential and corrected wave inherit the local curl and divergence identities through those germs. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMeanInteraction.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMeanInteraction.lean index d5eda11d8b..fbe0535277 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMeanInteraction.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMeanInteraction.lean @@ -17,7 +17,7 @@ Outside that patch the wave coefficients have zero germs, which force the actual mean interaction to have a zero germ as well. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMomentRepair.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMomentRepair.lean index 2c17c26e2d..ec942e4ed8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMomentRepair.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedMomentRepair.lean @@ -34,7 +34,7 @@ nodes as there are distinct real exponents. Taking logarithms gives the generalized-power evaluation-matrix part of manuscript Lemma 3.6. -/ -@[expose] public section +public section noncomputable section @@ -267,7 +267,7 @@ theorem intervalMomentMatrix_det_ne_zero {n : ℕ} (a l u : Fin n → ℝ) exact sub_eq_zero.mp hcoeff /-- The manuscript's matrix of ordinary Lebesgue integrals against bump profiles. -/ -def bumpMomentMatrix {n : ℕ} (a : Fin n → ℝ) (β : Fin n → ℝ → ℝ) : +@[expose] def bumpMomentMatrix {n : ℕ} (a : Fin n → ℝ) (β : Fin n → ℝ → ℝ) : Matrix (Fin n) (Fin n) ℝ := fun i j => ∫ t, t ^ a i * β j t /-- @@ -333,7 +333,7 @@ end end -@[expose] public section +public section noncomputable section @@ -343,12 +343,12 @@ open Set Function MeasureTheory namespace NavierStokes.LocalizedMomentRepair /-- Inner lower, given by `(3 * l + u) / 4`. -/ -def innerLower (l u : ℝ) : ℝ := (3 * l + u) / 4 +@[expose] def innerLower (l u : ℝ) : ℝ := (3 * l + u) / 4 /-- Inner upper, given by `(l + 3 * u) / 4`. -/ -def innerUpper (l u : ℝ) : ℝ := (l + 3 * u) / 4 +@[expose] def innerUpper (l u : ℝ) : ℝ := (l + 3 * u) / 4 /-- A concrete smooth bump in the middle half of `(l,u)`. -/ -def bump (l u : ℝ) (t : ℝ) : ℝ := +@[expose] def bump (l u : ℝ) (t : ℝ) : ℝ := SmoothCutoffs.cutoff ((t - (l + u) / 2) / ((u - l) / 4)) theorem bump_contDiff (l u : ℝ) : ContDiff ℝ ∞ (bump l u) := @@ -398,7 +398,7 @@ section Family variable {n : ℕ} /-- A fixed compact set, independent of the moment debt. -/ -def repairRegion (l u : Fin n → ℝ) : Set ℝ := +@[expose] def repairRegion (l u : Fin n → ℝ) : Set ℝ := ⋃ j, Icc (innerLower (l j) (u j)) (innerUpper (l j) (u j)) theorem repairRegion_isCompact (l u : Fin n → ℝ) : IsCompact (repairRegion l u) := @@ -411,7 +411,7 @@ theorem repairRegion_subset_open (l u : Fin n → ℝ) (hlu : ∀ j, l j < u j) exact mem_iUnion.mpr ⟨j, innerInterval_subset_open _ _ (hlu j) hj⟩ /-- The actual generalized-power moment matrix of the constructed profiles. -/ -def matrix (a l u : Fin n → ℝ) : Matrix (Fin n) (Fin n) ℝ := +@[expose] def matrix (a l u : Fin n → ℝ) : Matrix (Fin n) (Fin n) ℝ := PowerMomentMatrix.bumpMomentMatrix a (fun j => bump (l j) (u j)) theorem matrix_det_ne_zero (a l u : Fin n → ℝ) (ha : Injective a) @@ -434,10 +434,10 @@ theorem matrix_det_ne_zero (a l u : Fin n → ℝ) (ha : Injective a) · exact fun j => bump_support_subset _ _ (hlu j) /-- Coefficients are computed from the proved nonsingular moment matrix. -/ -def coefficients (a l u d : Fin n → ℝ) : Fin n → ℝ := (matrix a l u)⁻¹.mulVec d +@[expose] def coefficients (a l u d : Fin n → ℝ) : Fin n → ℝ := (matrix a l u)⁻¹.mulVec d /-- The constructed smooth correction for the prescribed finite vector of debts. -/ -def repair (a l u d : Fin n → ℝ) (t : ℝ) : ℝ := +@[expose] def repair (a l u d : Fin n → ℝ) (t : ℝ) : ℝ := ∑ j, coefficients a l u d j * bump (l j) (u j) t theorem repair_contDiff (a l u d : Fin n → ℝ) : ContDiff ℝ ∞ (repair a l u d) := by @@ -535,6 +535,7 @@ theorem repair_sub (a l u d e : Fin n → ℝ) : simp only [repair, coefficients, Matrix.mulVec_sub, Pi.sub_apply, sub_mul, Finset.sum_sub_distrib] /-- The fixed-interval, fixed-exponent repair depends linearly on the moment debt. -/ +@[expose] def repairLinearMap (a l u : Fin n → ℝ) : (Fin n → ℝ) →ₗ[ℝ] (ℝ → ℝ) where toFun := repair a l u map_add' := repair_add a l u diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedWaveBounds.lean index 52ec55cece..844f8b6d6e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedWaveBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/LocalizedWaveBounds.lean @@ -17,7 +17,7 @@ the native coefficient can be nonzero. No extension of these controls to the whole fast lift is required. -/ -@[expose] public section +public section noncomputable section @@ -503,7 +503,7 @@ namespace WaveFamily /-- Coefficients, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ -noncomputable def coefficients (a : WaveFamily D I) (i : I) : WaveCoefficients D where +@[expose] noncomputable def coefficients (a : WaveFamily D I) (i : I) : WaveCoefficients D where radius n := a.radius n i radialBase n := a.radialBase n i frequencyBase n := a.frequencyBase n i @@ -515,7 +515,7 @@ noncomputable def coefficients (a : WaveFamily D I) (i : I) : WaveCoefficients D /-- Of coefficients, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ -noncomputable def ofCoefficients (a : I → WaveCoefficients D) : WaveFamily D I where +@[expose] noncomputable def ofCoefficients (a : I → WaveCoefficients D) : WaveFamily D I where radius n i := (a i).radius n radialBase n i := (a i).radialBase n frequencyBase n i := (a i).frequencyBase n @@ -526,28 +526,32 @@ noncomputable def ofCoefficients (a : I → WaveCoefficients D) : WaveFamily D I frequency n i := (a i).frequency n /-- Normal, defined pointwise by `(a.coefficients i).normal s d n`. -/ -noncomputable def normal (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : +@[expose] noncomputable def normal (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : ℕ → I → D → ProblemStatement.Space := fun n i => (a.coefficients i).normal s d n /-- Defect, defined pointwise by `(a.coefficients i).defect s d n`. -/ -noncomputable def defect (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : +@[expose] noncomputable def defect (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : ℕ → I → D → ℝ := fun n i => (a.coefficients i).defect s d n /-- Remainder, defined pointwise by `(a.coefficients i).remainder s d n`. -/ +@[expose] noncomputable def remainder (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : ℕ → I → D → ComplexVector := fun n i => (a.coefficients i).remainder s d n /-- Principal velocity, defined pointwise by `(a.coefficients i).principalVelocity s d (fun n => f n i) n`. -/ +@[expose] noncomputable def principalVelocity (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) (f : ℕ → I → D → ComplexVector) : ℕ → I → D → ComplexVector := fun n i => (a.coefficients i).principalVelocity s d (fun n => f n i) n /-- Curl correction, defined pointwise by `(a.coefficients i).curlCorrection s d n`. -/ +@[expose] noncomputable def curlCorrection (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : ℕ → I → D → ComplexVector := fun n i => (a.coefficients i).curlCorrection s d n /-- Add amplitude, given by `{ a with amplitude := fun n i x => a.amplitude n i x + f n i x }`. -/ +@[expose] noncomputable def addAmplitude (a : WaveFamily D I) (f : ℕ → I → D → ComplexVector) : WaveFamily D I := { a with amplitude := fun n i x => a.amplitude n i x + f n i x } @@ -561,6 +565,7 @@ noncomputable def withCutoff (a : WaveFamily D I) (ψ : ℕ → I → D → ℝ) /-- Retained good, defined pointwise by `a.principalVelocity s d (a.curlCorrection s d) n i x + (a.addAmplitude (a.curlCorrection s d)).remainder s d n i x`. -/ +@[expose] noncomputable def retainedGood (a : WaveFamily D I) (s : StripData D) (d : GraphDirections D) : ℕ → I → D → ComplexVector := fun n i x => a.principalVelocity s d (a.curlCorrection s d) n i x + diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MatchingDebtBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MatchingDebtBounds.lean index 1346d10efc..b776686da4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MatchingDebtBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MatchingDebtBounds.lean @@ -16,7 +16,7 @@ estimated separately. All parameter derivatives below are actual derivatives of the constructed fields and their moment integrals. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanBoundsReindex.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanBoundsReindex.lean index dd381fc107..fe21f6f872 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanBoundsReindex.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanBoundsReindex.lean @@ -19,7 +19,7 @@ unchanged. In particular, uniform constants are chosen before the label both before and after reassociation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanChartCompatibility.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanChartCompatibility.lean index 27efc87cb6..1e91113bdc 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanChartCompatibility.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanChartCompatibility.lean @@ -20,7 +20,7 @@ are identities of the defined integral/Fourier/rank operators, not an assumption that separately chosen chart outputs coincide. -/ -@[expose] public section +public section namespace NavierStokes.MeanChartCompatibility @@ -516,7 +516,7 @@ theorem temporal_physical_pull (h : ℝ) (n : ℕ) (l : ℝ) (P : S →L[ℝ] T) /-- The common-index form of the actual temporal update. A common index is independent of the dyadic band; the native recipe is its specialization. -/ -noncomputable def temporalAtIndex (h : ℝ) (n i : ℕ) +@[expose] noncomputable def temporalAtIndex (h : ℝ) (n i : ℕ) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := -((ChartScales.Tg ^ i * ChartScales.Q n ^ (1 + h))⁻¹) * TemporalMeanUpdate.temporalInverse (TemporalMeanUpdate.centered f) z @@ -664,7 +664,7 @@ theorem meanClass_temporalAtIndex_of_native (s : WeightedClasses.StripData (Pres /-- Fast at index, given by `(ChartScales.Tg ^ i * ChartScales.Q n ^ (1 + h)) * PressureStream.graphDz ((0 : S), vector .temporal) f z`. -/ -noncomputable def fastAtIndex (h : ℝ) (n i : ℕ) (f : PressureStream.Lift S → ℝ) +@[expose] noncomputable def fastAtIndex (h : ℝ) (n i : ℕ) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := (ChartScales.Tg ^ i * ChartScales.Q n ^ (1 + h)) * PressureStream.graphDz ((0 : S), vector .temporal) f z @@ -717,13 +717,13 @@ theorem coverMap_radial (i : ℕ) : exact PhysicalGraphBounds.cover_pow_radialDirection i /-- Chart scale, given by `ChartScales.Q n ^ (-(1 / 2 : ℝ))`. -/ -noncomputable def chartScale (n : ℕ) : ℝ := ChartScales.Q n ^ (-(1 / 2 : ℝ)) +@[expose] noncomputable def chartScale (n : ℕ) : ℝ := ChartScales.Q n ^ (-(1 / 2 : ℝ)) theorem chartScale_pos (n : ℕ) : 0 < chartScale n := Real.rpow_pos_of_pos (ChartScales.Q_pos n) _ /-- Radial frequency, given by `M * ChartScales.Lambda ^ i * ChartScales.Q n ^ (d / 2)`. -/ -noncomputable def radialFrequency (_h : ℝ) (n i : ℕ) (d M : ℝ) : ℝ := +@[expose] noncomputable def radialFrequency (_h : ℝ) (n i : ℕ) (d M : ℝ) : ℝ := M * ChartScales.Lambda ^ i * ChartScales.Q n ^ (d / 2) theorem radialFrequency_scale (h : ℝ) (n i : ℕ) (d M : ℝ) : @@ -980,14 +980,14 @@ open TorusInverse variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- The potential uses the explicitly chosen common torus index. -/ -noncomputable def commonTemporalPotential (r : ℕ → CorrectionState.ReconstructionData) +@[expose] noncomputable def commonTemporalPotential (r : ℕ → CorrectionState.ReconstructionData) (h : ℝ) (index : ℕ → ℕ) (f : ℕ → PressureStream.Lift S → ℝ) (n : ℕ) : PressureStream.Lift S → ℝ := PressureStream.streamPotential (r n).exponent (r n).inner (r n).outer ((r n).frequency n) ((0 : S), (r n).radialDirection) (temporalAtIndex h n (index n) (f n)) /-- Common temporal fields, bundling `radial`, `angular`, `axial`. -/ -noncomputable def commonTemporalFields (r : ℕ → CorrectionState.ReconstructionData) +@[expose] noncomputable def commonTemporalFields (r : ℕ → CorrectionState.ReconstructionData) (h : ℝ) (index : ℕ → ℕ) (epsilon : ℕ → ℝ) (axial : S × Plane) (fθ fz : ℕ → PressureStream.Lift S → ℝ) : MeanIncrementBounds.Triple (PressureStream.Lift S) where @@ -1008,7 +1008,7 @@ noncomputable def commonTemporalAlias (r : ℕ → CorrectionState.Reconstructio /-- Common temporal increment, given by `commonTemporalFields r h index c.operators.epsilon axial (u.thetaResidual c) (u.axialResidual c)`. -/ -noncomputable def commonTemporalIncrement (r : ℕ → CorrectionState.ReconstructionData) +@[expose] noncomputable def commonTemporalIncrement (r : ℕ → CorrectionState.ReconstructionData) (h : ℝ) (index : ℕ → ℕ) (axial : S × Plane) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : @@ -1258,6 +1258,7 @@ noncomputable def sourceMoment (m : ℕ) (f : PressureStream.Lift S → ℝ) (s /-- Source debt, given by `![sourceMoment 0 g s, sourceMoment 2 qθ s, sourceMoment 1 qz s - (1 / 2 : ℝ) * sourceMoment 2 g s]`. -/ +@[expose] noncomputable def sourceDebt (g qθ qz : PressureStream.Lift S → ℝ) (s : S) : MeanRankUpdate.Debt := ![sourceMoment 0 g s, sourceMoment 2 qθ s, sourceMoment 1 qz s - (1 / 2 : ℝ) * sourceMoment 2 g s] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanIncrementBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanIncrementBounds.lean index f30b28c478..6d25b9dbc3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanIncrementBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanIncrementBounds.lean @@ -20,7 +20,7 @@ mean cross term. The unchanged wave covariance and virtual flux cancel only after an exact residual-difference identity. -/ -@[expose] public section +public section noncomputable section @@ -45,7 +45,7 @@ structure Triple (D : Type) where axial : Field D /-- Updated, given by `⟨m.radial + h.radial, m.angular + h.angular, m.axial + h.axial⟩`. -/ -noncomputable def updated (m h : Triple D) : Triple D := +@[expose] noncomputable def updated (m h : Triple D) : Triple D := ⟨m.radial + h.radial, m.angular + h.angular, m.axial + h.axial⟩ /-- Operators data, collecting `epsilon`, `radialFrequency`, `fastCoefficient`, `radius`, @@ -75,34 +75,34 @@ structure Operators (D : Type) where namespace Operators /-- Inv radius, defined pointwise by `(o.radius x)⁻¹`. -/ -noncomputable def invRadius (o : Operators D) : Field D := fun _ x => (o.radius x)⁻¹ +@[expose] noncomputable def invRadius (o : Operators D) : Field D := fun _ x => (o.radius x)⁻¹ /-- Dr, given by `graphDerivative o.radialFrequency o.radialProfile o.eR o.vR f`. -/ -noncomputable def dr (o : Operators D) (f : Field D) : Field D := +@[expose] noncomputable def dr (o : Operators D) (f : Field D) : Field D := graphDerivative o.radialFrequency o.radialProfile o.eR o.vR f /-- Dz, defined pointwise by `o.epsilon n * fderiv ℝ (f n) x o.eZ`. -/ -noncomputable def dz (o : Operators D) (f : Field D) : Field D := +@[expose] noncomputable def dz (o : Operators D) (f : Field D) : Field D := fun n x => o.epsilon n * fderiv ℝ (f n) x o.eZ /-- Slow time, defined pointwise by `-(o.epsilon n * fderiv ℝ (f n) x o.eT)`. -/ -noncomputable def slowTime (o : Operators D) (f : Field D) : Field D := +@[expose] noncomputable def slowTime (o : Operators D) (f : Field D) : Field D := fun n x => -(o.epsilon n * fderiv ℝ (f n) x o.eT) /-- Fast time, defined pointwise by `o.fastCoefficient n * fderiv ℝ (f n) x o.vT`. -/ -noncomputable def fastTime (o : Operators D) (f : Field D) : Field D := +@[expose] noncomputable def fastTime (o : Operators D) (f : Field D) : Field D := fun n x => o.fastCoefficient n * fderiv ℝ (f n) x o.vT /-- Time, given by `o.slowTime f + o.fastTime f`. -/ -noncomputable def time (o : Operators D) (f : Field D) : Field D := +@[expose] noncomputable def time (o : Operators D) (f : Field D) : Field D := o.slowTime f + o.fastTime f /-- Radial div, given by `o.dr f + c • (o.invRadius * f)`. -/ -noncomputable def radialDiv (o : Operators D) (c : ℝ) (f : Field D) : Field D := +@[expose] noncomputable def radialDiv (o : Operators D) (c : ℝ) (f : Field D) : Field D := o.dr f + c • (o.invRadius * f) /-- The connection parameter is one for radial/angular velocity, zero axially. -/ -noncomputable def viscosity (o : Operators D) (c : ℝ) (f : Field D) : Field D := +@[expose] noncomputable def viscosity (o : Operators D) (c : ℝ) (f : Field D) : Field D := fun n x => o.epsilon n * (o.dr (o.dr f) n x + o.invRadius n x * o.dr f n x + o.dz (o.dz f) n x - c * (o.invRadius n x * (o.invRadius n x * f n x))) @@ -348,43 +348,43 @@ theorem viscosity (ho : OperatorBounds s o κ) {f : Field D} (hf : MeanClass s end OperatorBounds /-- Theta radial, given by `b.radial * m.angular + m.radial * b.angular + m.radial * m.angular`. -/ -noncomputable def thetaRadial (b m : Triple D) : Field D := +@[expose] noncomputable def thetaRadial (b m : Triple D) : Field D := b.radial * m.angular + m.radial * b.angular + m.radial * m.angular /-- Theta axial, given by `b.axial * m.angular + b.angular * m.axial + m.axial * m.angular`. -/ -noncomputable def thetaAxial (b m : Triple D) : Field D := +@[expose] noncomputable def thetaAxial (b m : Triple D) : Field D := b.axial * m.angular + b.angular * m.axial + m.axial * m.angular /-- Axial radial, given by `b.radial * m.axial + m.radial * b.axial + m.radial * m.axial`. -/ -noncomputable def axialRadial (b m : Triple D) : Field D := +@[expose] noncomputable def axialRadial (b m : Triple D) : Field D := b.radial * m.axial + m.radial * b.axial + m.radial * m.axial /-- Axial axial, given by `(2 : ℝ) • (b.axial * m.axial) + m.axial * m.axial`. -/ -noncomputable def axialAxial (b m : Triple D) : Field D := +@[expose] noncomputable def axialAxial (b m : Triple D) : Field D := (2 : ℝ) • (b.axial * m.axial) + m.axial * m.axial /-- Radial radial, given by `(2 : ℝ) • (b.radial * m.radial) + m.radial * m.radial`. -/ -noncomputable def radialRadial (b m : Triple D) : Field D := +@[expose] noncomputable def radialRadial (b m : Triple D) : Field D := (2 : ℝ) • (b.radial * m.radial) + m.radial * m.radial /-- Radial angular, given by `(2 : ℝ) • (b.angular * m.angular) + m.angular * m.angular`. -/ -noncomputable def radialAngular (b m : Triple D) : Field D := +@[expose] noncomputable def radialAngular (b m : Triple D) : Field D := (2 : ℝ) • (b.angular * m.angular) + m.angular * m.angular /-- Theta residual, constructed using `o.time`. -/ -noncomputable def thetaResidual (o : Operators D) (b m : Triple D) +@[expose] noncomputable def thetaResidual (o : Operators D) (b m : Triple D) (W : Fin 3 → Fin 3 → Field D) (T : Field D) : Field D := o.time m.angular + o.radialDiv 2 (thetaRadial b m + W 0 1) + o.dz (thetaAxial b m + W 2 1) - o.viscosity 1 m.angular - o.radialDiv 2 T /-- Axial residual, constructed using `o.time`. -/ -noncomputable def axialResidual (o : Operators D) (b m : Triple D) +@[expose] noncomputable def axialResidual (o : Operators D) (b m : Triple D) (W : Fin 3 → Fin 3 → Field D) (p T : Field D) : Field D := o.time m.axial + o.radialDiv 1 (axialRadial b m + W 0 2) + o.dz (axialAxial b m + W 2 2 + p) - o.viscosity 0 m.axial - o.radialDiv 1 T /-- Gr as an element of `Field D`. -/ -noncomputable def gr (o : Operators D) (b m : Triple D) +@[expose] noncomputable def gr (o : Operators D) (b m : Triple D) (W : Fin 3 → Fin 3 → Field D) : Field D := -(o.time m.radial + o.radialDiv 1 (radialRadial b m + W 0 0) + o.dz (axialRadial b m + W 2 0) - @@ -424,7 +424,7 @@ noncomputable def radialAngularRemainder (m h : Triple D) : Field D := (2 : ℝ) • (m.angular * h.angular) + h.angular * h.angular /-- Leading radial, given by `o.invRadius * ((2 : ℝ) • (b.angular * h.angular))`. -/ -noncomputable def leadingRadial (o : Operators D) (b h : Triple D) : Field D := +@[expose] noncomputable def leadingRadial (o : Operators D) (b h : Triple D) : Field D := o.invRadius * ((2 : ℝ) • (b.angular * h.angular)) /-- Radial remainder as an element of `Field D`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanMomentBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanMomentBounds.lean index 752996330f..27ed18c12e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanMomentBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanMomentBounds.lean @@ -18,7 +18,7 @@ Finite torus averaging and radial integration preserve these bounds. All derivatives in this file are `iteratedFDeriv` of the actual integral. -/ -@[expose] public section +public section namespace NavierStokes.MeanMomentBounds @@ -104,7 +104,7 @@ theorem norm_iteratedFDeriv_affine_le (L : D →L[ℝ] E) (hL : ‖L‖ ≤ 1) exact mul_le_of_le_one_right (norm_nonneg _) (pow_le_one₀ (norm_nonneg L) hL) /-- The unweighted slow strip keeps precisely the same band scales. -/ -noncomputable def slowStripData (ε S : ℕ → ℝ) +@[expose] noncomputable def slowStripData (ε S : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hS : ∀ n, 1 ≤ S n) : StripData D where domain := univ @@ -294,7 +294,7 @@ noncomputable def auxY : PressureStream.Lift P := (0, (0, (0, 1))) ext <;> simp [eraseAuxY, auxY] /-- Lifted torus average, given by `PressureStream.torusAverage f (x.1, x.2.1)`. -/ -noncomputable def liftedTorusAverage (f : PressureStream.Lift P → ℝ) +@[expose] noncomputable def liftedTorusAverage (f : PressureStream.Lift P → ℝ) (x : PressureStream.Lift P) : ℝ := PressureStream.torusAverage f (x.1, x.2.1) theorem liftedTorusAverage_eq_affine (f : PressureStream.Lift P → ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanRankUpdate.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanRankUpdate.lean index 652802765b..36067e2268 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanRankUpdate.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanRankUpdate.lean @@ -19,7 +19,7 @@ The update is the constructed power-moment inverse, transported with the physical length and velocity scales. Each moment carries its own scale. -/ -@[expose] public section +public section noncomputable section @@ -33,15 +33,15 @@ open scoped BigOperators ContDiff Topology abbrev Debt := FiveRowRank.Debt /-- Scale field, defined pointwise by `U * f (r / ell)`. -/ -noncomputable def scaleField (ell U : ℝ) (f : ℝ → ℝ) : ℝ → ℝ := +@[expose] noncomputable def scaleField (ell U : ℝ) (f : ℝ → ℝ) : ℝ → ℝ := fun r => U * f (r / ell) /-- Pressure, angular moment, and axial moment have distinct length powers. -/ -noncomputable def scaleDebt (ell U : ℝ) (d : Debt) : Debt := +@[expose] noncomputable def scaleDebt (ell U : ℝ) (d : Debt) : Debt := ![U ^ 2 * d 0, ell ^ 3 * U ^ 2 * d 1, ell ^ 2 * U ^ 2 * d 2] /-- Normalize debt, given by `![d 0 / U ^ 2, d 1 / (ell ^ 3 * U ^ 2), d 2 / (ell ^ 2 * U ^ 2)]`. -/ -noncomputable def normalizeDebt (ell U : ℝ) (d : Debt) : Debt := +@[expose] noncomputable def normalizeDebt (ell U : ℝ) (d : Debt) : Debt := ![d 0 / U ^ 2, d 1 / (ell ^ 3 * U ^ 2), d 2 / (ell ^ 2 * U ^ 2)] theorem scale_normalizeDebt {ell U : ℝ} (hell : ell ≠ 0) (hU : U ≠ 0) (d : Debt) : @@ -163,16 +163,16 @@ theorem fiveRows_scaled {ell : ℝ} (hell : 0 < ell) (U : ℝ) {V G f g : ℝ /-- Angular increment, given by `scaleField ell U (FiveRowRank.deltaV lam C a b (normalizeDebt ell U d))`. -/ -noncomputable def angularIncrement (lam C a b ell U : ℝ) (d : Debt) : ℝ → ℝ := +@[expose] noncomputable def angularIncrement (lam C a b ell U : ℝ) (d : Debt) : ℝ → ℝ := scaleField ell U (FiveRowRank.deltaV lam C a b (normalizeDebt ell U d)) /-- Desired axial increment, given by `scaleField ell U (FiveRowRank.gamma lam C a b (normalizeDebt ell U d))`. -/ -noncomputable def desiredAxialIncrement (lam C a b ell U : ℝ) (d : Debt) : ℝ → ℝ := +@[expose] noncomputable def desiredAxialIncrement (lam C a b ell U : ℝ) (d : Debt) : ℝ → ℝ := scaleField ell U (FiveRowRank.gamma lam C a b (normalizeDebt ell U d)) /-- Background, given by `scaleField ell U (FiveRowRank.background lam C)`. -/ -noncomputable def background (lam C ell U : ℝ) : ℝ → ℝ := +@[expose] noncomputable def background (lam C ell U : ℝ) : ℝ → ℝ := scaleField ell U (FiveRowRank.background lam C) /-- Equation (35) in physical units, with no assumed rank or inverse. -/ @@ -816,7 +816,7 @@ theorem chartInput_norm_le_one : ‖chartInput‖ ≤ 1 := by _ _))) /-- Chart Q, given by `PhysicalCoordinateBounds.qCoord coord (chartInput p)`. -/ -noncomputable def chartQ (coord : ℝ) (p : ChartPoint) : ℝ := +@[expose] noncomputable def chartQ (coord : ℝ) (p : ChartPoint) : ℝ := PhysicalCoordinateBounds.qCoord coord (chartInput p) /-- Chart eta, given by `PhysicalCoordinateBounds.etaCoord coord (chartInput p)`. -/ @@ -999,7 +999,7 @@ section ConcreteStrip /-- Normalized domain, given by `{p | chartInput p ∈ PhysicalCoordinateBounds.positiveTime ∧ chartQ coord p ∈ Ioo qlo qhi ∧ p.1 ∈ Ioo rlo rhi}`. -/ -noncomputable def normalizedDomain (coord qlo qhi rlo rhi : ℝ) : Set ChartPoint := +@[expose] noncomputable def normalizedDomain (coord qlo qhi rlo rhi : ℝ) : Set ChartPoint := {p | chartInput p ∈ PhysicalCoordinateBounds.positiveTime ∧ chartQ coord p ∈ Ioo qlo qhi ∧ p.1 ∈ Ioo rlo rhi} @@ -1020,7 +1020,7 @@ theorem normalizedDomain_isOpen {coord : ℝ} (hc : 0 < coord) (hc1 : coord < 1) /-- The concrete logarithmic radial weights, restricted to one normalized physical `q/Q` strip. The torus variables remain unrestricted. -/ -noncomputable def normalizedStripData (coord qlo qhi rlo rhi cL cR : ℝ) +@[expose] noncomputable def normalizedStripData (coord qlo qhi rlo rhi cL cR : ℝ) (hc : 0 < coord) (hc1 : coord < 1) (hrlo : 0 < rlo) (hcL : 0 < cL) (hcR : 0 < cR) (ε S : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hS : ∀ n, 1 ≤ S n) : WeightedClasses.StripData ChartPoint := @@ -1906,7 +1906,7 @@ noncomputable def actualChartPotential (coord A B lam a b power lo hi M : ℝ) /-- Actual chart radial, given by `PressureStream.streamBeta w (actualChartPotential coord A B lam a b power lo hi M v d)`. -/ -noncomputable def actualChartRadial (coord A B lam a b power lo hi M : ℝ) +@[expose] noncomputable def actualChartRadial (coord A B lam a b power lo hi M : ℝ) (v : PressureStream.Plane) (w : PressureStream.Plane × PressureStream.Plane) (d : PressureStream.Plane → Debt) : ChartPoint → ℝ := PressureStream.streamBeta w (actualChartPotential coord A B lam a b power lo hi M v d) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanResidual.lean index 60cfd4796b..d495be4fc1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanResidual.lean @@ -19,7 +19,7 @@ are Fréchet derivatives on spacetime, and the Reynolds products include the entire oscillatory velocity. -/ -@[expose] public section +public section namespace NavierStokes.MeanResidual @@ -37,7 +37,7 @@ abbrev Scalar := SpaceTime → ℝ abbrev Components := Fin 3 → Scalar /-- Period, given by `2 * Real.pi`. -/ -noncomputable def period : ℝ := 2 * Real.pi +@[expose] noncomputable def period : ℝ := 2 * Real.pi /-- Angular vector, given by `(0, coordinateVector 1)`. -/ noncomputable def angularVector : SpaceTime := (0, coordinateVector 1) /-- Angular shift, given by `q + a • angularVector`. -/ @@ -59,20 +59,20 @@ variable {E F : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Direction, given by `fderiv ℝ f q v`. -/ -noncomputable def direction (v : SpaceTime) (f : SpaceTime → E) (q : SpaceTime) : E := +@[expose] noncomputable def direction (v : SpaceTime) (f : SpaceTime → E) (q : SpaceTime) : E := fderiv ℝ f q v /-- Dt, given by `direction (1, 0) f`. -/ -noncomputable def dt (f : SpaceTime → E) := direction (1, 0) f +@[expose] noncomputable def dt (f : SpaceTime → E) := direction (1, 0) f /-- Dr, given by `direction (0, coordinateVector 0) f`. -/ -noncomputable def dr (f : SpaceTime → E) := direction (0, coordinateVector 0) f +@[expose] noncomputable def dr (f : SpaceTime → E) := direction (0, coordinateVector 0) f /-- Dtheta, given by `direction angularVector f`. -/ noncomputable def dtheta (f : SpaceTime → E) := direction angularVector f /-- Dz, given by `direction (0, coordinateVector 2) f`. -/ -noncomputable def dz (f : SpaceTime → E) := direction (0, coordinateVector 2) f +@[expose] noncomputable def dz (f : SpaceTime → E) := direction (0, coordinateVector 2) f /-- Average, given by `period⁻¹ • ∫ a in (0 : ℝ)..period, f (angularShift q a)`. -/ -noncomputable def average (f : SpaceTime → E) (q : SpaceTime) : E := +@[expose] noncomputable def average (f : SpaceTime → E) (q : SpaceTime) : E := period⁻¹ • ∫ a in (0 : ℝ)..period, f (angularShift q a) /-- Angular continuous, given by `∀ q, Continuous (fun a => f (angularShift q a))`. -/ @@ -84,7 +84,7 @@ def AngularPeriodic (f : SpaceTime → E) : Prop := ∀ q, f (angularShift q period) = f q /-- Angular invariant, given by `∀ q a, f (angularShift q a) = f q`. -/ -def AngularInvariant (f : SpaceTime → E) : Prop := +@[expose] def AngularInvariant (f : SpaceTime → E) : Prop := ∀ q a, f (angularShift q a) = f q theorem contDiff_angularShift : @@ -351,11 +351,11 @@ noncomputable def laplacian (f : Scalar) (q : SpaceTime) : ℝ := dr (dr f) q + dr f q / radius q + dtheta (dtheta f) q / radius q ^ 2 + dz (dz f) q /-- Mean laplacian, given by `dr (dr f) q + dr f q / radius q + dz (dz f) q`. -/ -noncomputable def meanLaplacian (f : Scalar) (q : SpaceTime) : ℝ := +@[expose] noncomputable def meanLaplacian (f : Scalar) (q : SpaceTime) : ℝ := dr (dr f) q + dr f q / radius q + dz (dz f) q /-- Radial divergence, given by `dr f q + c / radius q * f q`. -/ -noncomputable def radialDivergence (c : ℝ) (f : Scalar) (q : SpaceTime) : ℝ := +@[expose] noncomputable def radialDivergence (c : ℝ) (f : Scalar) (q : SpaceTime) : ℝ := dr f q + c / radius q * f q /-- Divergence, given by `dr (w 0) q + w 0 q / radius q + dtheta (w 1) q / radius q + dz (w 2) @@ -736,7 +736,7 @@ noncomputable def covariance (osc : Components) (i j : Fin 3) : Scalar := /-- Flux difference, defined pointwise by `base i q * mean j q + mean i q * base j q + mean i q * mean j q + covariance osc i j q`. -/ -noncomputable def fluxDifference (base mean osc : Components) (i j : Fin 3) : Scalar := +@[expose] noncomputable def fluxDifference (base mean osc : Components) (i j : Fin 3) : Scalar := fun q => base i q * mean j q + mean i q * base j q + mean i q * mean j q + covariance osc i j q @@ -854,19 +854,19 @@ noncomputable def baseAxial (b : Components) (p : Scalar) (q : SpaceTime) : ℝ dz (fun y => b 2 y * b 2 y) q - meanLaplacian (b 2) q + dz p q /-- Physical version of `E_theta` in (32), with viscosity one. -/ -noncomputable def Etheta (b m o : Components) (Ttheta : Scalar) (q : SpaceTime) : ℝ := +@[expose] noncomputable def Etheta (b m o : Components) (Ttheta : Scalar) (q : SpaceTime) : ℝ := dt (m 1) q + radialDivergence 2 (fluxDifference b m o 0 1) q + dz (fluxDifference b m o 2 1) q - meanLaplacian (m 1) q + m 1 q / radius q ^ 2 - radialDivergence 2 Ttheta q /-- Physical version of `E_z` in (32), with viscosity one. -/ -noncomputable def Ez (b m o : Components) (pm Tz : Scalar) (q : SpaceTime) : ℝ := +@[expose] noncomputable def Ez (b m o : Components) (pm Tz : Scalar) (q : SpaceTime) : ℝ := dt (m 2) q + radialDivergence 1 (fluxDifference b m o 0 2) q + dz (fun y => fluxDifference b m o 2 2 y + pm y) q - meanLaplacian (m 2) q - radialDivergence 1 Tz q /-- Required physical radial pressure derivative in (32). -/ -noncomputable def gr (b m o : Components) (q : SpaceTime) : ℝ := +@[expose] noncomputable def gr (b m o : Components) (q : SpaceTime) : ℝ := -(dt (m 0) q + radialDivergence 1 (fluxDifference b m o 0 0) q + dz (fluxDifference b m o 2 0) q - fluxDifference b m o 1 1 q / radius q - meanLaplacian (m 0) q + m 0 q / radius q ^ 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStageRegularity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStageRegularity.lean index 95eb269901..36a177ff89 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStageRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStageRegularity.lean @@ -17,7 +17,7 @@ are derived before updating the state. No new residual regularity or quantitative estimate is an input to preservation. -/ -@[expose] public section +public section namespace NavierStokes.MeanStageRegularity diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStateRegularity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStateRegularity.lean index 7a3d8cbc49..ba5912631e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStateRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MeanStateRegularity.lean @@ -17,7 +17,7 @@ actual nonlinear fluxes and differential residuals are consequences. Base coefficients need smoothness and periodicity only at positive radii. -/ -@[expose] public section +public section namespace NavierStokes.MeanStateRegularity diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedAxisPreservation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedAxisPreservation.lean index eb03055215..2050498162 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedAxisPreservation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedAxisPreservation.lean @@ -24,7 +24,7 @@ common annular radius for all stages, or blow-up of the resulting diagonal is postulated. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedCandidateAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedCandidateAssembly.lean index d597840b82..5c1b7f625b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedCandidateAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedCandidateAssembly.lean @@ -21,7 +21,7 @@ This is a conditional consumer. It does not construct the complete correction iteration or supply the finite-stage estimates it requires. -/ -@[expose] public section +public section noncomputable section @@ -121,7 +121,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (v : ModulatedProfileAssembly.Witness ld) /-- The actual anchored base and finite initialization share stage zero. -/ -noncomputable def potentialStages (upper : ℝ) (bandFloor : ℕ) {qbig : ℝ} +@[expose] noncomputable def potentialStages (upper : ℝ) (bandFloor : ℕ) {qbig : ℝ} (initial : MixedAxisPreservation.PotentialStage.{u} F.data.h (MixedAxisPreservation.localDomain F.data.h qbig)) (stages : ℕ → MixedAxisPreservation.PotentialStage.{u} F.data.h diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalExtensions.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalExtensions.lean index 319667e4fe..39ee4a4b89 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalExtensions.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalExtensions.lean @@ -22,7 +22,7 @@ These results concern the full actual sum, including stage zero. They do not assume that its away-from-origin extensions have already been built. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalResidual.lean index 8d92fd06ae..9edf9327f9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedDiagonalResidual.lean @@ -32,7 +32,7 @@ logarithmic factors are combined before applying the proved cutoff estimates. The initial stage is retained explicitly in every resulting full sum. -/ -@[expose] public section +public section noncomputable section @@ -398,7 +398,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedPeriodicAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedPeriodicAssembly.lean index af38c4dd6c..416e5736e4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MixedPeriodicAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MixedPeriodicAssembly.lean @@ -26,7 +26,7 @@ the periodic fields and their residual limits. They do not establish the correction iteration or the existence of singular incoming fields. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedCone.lean index bd14e06714..25e6d72353 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedCone.lean @@ -30,7 +30,7 @@ Lipschitz constants are derived from smoothness and compactness on sets with positive angular field and radius. No stock error estimate is assumed. -/ -@[expose] public section +public section noncomputable section @@ -374,7 +374,7 @@ end end -@[expose] public section +public section noncomputable section @@ -385,10 +385,11 @@ open scoped Topology ContDiff open ParametricModulation /-- The actual angular shear of an angular profile `E`. -/ -noncomputable def angularShear (E : RadialParameter → ℝ) (p : RadialParameter) : ℝ := +@[expose] noncomputable def angularShear (E : RadialParameter → ℝ) (p : RadialParameter) : ℝ := 1 - 2 * p.1 * deriv (fun X => E (X, p.2)) p.1 / E p /-- The signed axial shear, in the `C = -b` convention of `TrueConeLoop`. -/ +@[expose] noncomputable def signedAxialShear (E U : RadialParameter → ℝ) (p : RadialParameter) : ℝ := -(2 * p.1 * deriv (fun X => U (X, p.2)) p.1 / E p) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedHistories.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedHistories.lean index ec57369fb1..46548c4d92 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedHistories.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedHistories.lean @@ -21,7 +21,7 @@ The normalized angular field is modulated multiplicatively, so the unchanged axis germ is retained. All history differences below are actual integrals. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ noncomputable def densityAt (X f U : ℝ) : Debt := ![U, 2 * X * f, U * (2 * X * f), U ^ 2 - X * f ^ 2, f ^ 2] /-- Density, given by `densityAt p.1 (f p) (U p)`. -/ -noncomputable def density (f U : Field) (p : Point) : Debt := densityAt p.1 (f p) (U p) +@[expose] noncomputable def density (f U : Field) (p : Point) : Debt := densityAt p.1 (f p) (U p) theorem density_contDiff (f U : Field) (hf : ContDiff ℝ ∞ f) (hU : ContDiff ℝ ∞ U) (i : Fin 5) : ContDiff ℝ ∞ (fun p => density f U p i) := by @@ -103,12 +103,12 @@ theorem density_eq_physical (X f U : ℝ) (hX : 0 < X) : variable {a m p₁ p₂ : Point → ℝ} {K B : Set Point} /-- Raw F, given by `ParametricModulation.realizedE r f N p.1 p.2`. -/ -noncomputable def rawF (r : ParametricModulation.TrueConeRealization a m p₁ p₂ K B) +@[expose] noncomputable def rawF (r : ParametricModulation.TrueConeRealization a m p₁ p₂ K B) (f : Field) (N : ℝ) (p : Point) : ℝ := ParametricModulation.realizedE r f N p.1 p.2 /-- Raw U, given by `ParametricModulation.realizedU r E U N p.1 p.2`. -/ -noncomputable def rawU (r : ParametricModulation.TrueConeRealization a m p₁ p₂ K B) +@[expose] noncomputable def rawU (r : ParametricModulation.TrueConeRealization a m p₁ p₂ K B) (E U : Field) (N : ℝ) (p : Point) : ℝ := ParametricModulation.realizedU r E U N p.1 p.2 @@ -326,7 +326,7 @@ theorem historyDifference_jets (W : Window) /-! ## Localization and genuine axis histories -/ /-- Splice, with branches according to `p.1 ∈ Ioc W.left W.right`. -/ -noncomputable def splice (W : Window) (base actual : Field) (p : Point) : ℝ := +@[expose] noncomputable def splice (W : Window) (base actual : Field) (p : Point) : ℝ := if p.1 ∈ Ioc W.left W.right then actual p else base p theorem splice_eq_before (W : Window) (base actual : Field) {p : Point} @@ -385,12 +385,12 @@ theorem splice_contDiffOn (W : Window) {base actual : Field} {Ω : Set ℝ} exact splice_eq_after W base actual hq /-- Localized F, given by `splice W f (rawF r f N)`. -/ -noncomputable def localizedF (W : Window) +@[expose] noncomputable def localizedF (W : Window) (r : ParametricModulation.TrueConeRealization a m p₁ p₂ K B) (f : Field) (N : ℝ) : Field := splice W f (rawF r f N) /-- Localized U, given by `splice W U (rawU r E U N)`. -/ -noncomputable def localizedU (W : Window) +@[expose] noncomputable def localizedU (W : Window) (r : ParametricModulation.TrueConeRealization a m p₁ p₂ K B) (E U : Field) (N : ℝ) : Field := splice W U (rawU r E U N) @@ -450,7 +450,7 @@ theorem densityDifference_continuousOn (W : Window) exact hc.continuousAt.continuousWithinAt /-- Axis history, defined pointwise by `∫ s in (0 : ℝ)..p.1, density f U (s, p.2) i`. -/ -noncomputable def axisHistory (f U : Field) (p : Point) : Debt := +@[expose] noncomputable def axisHistory (f U : Field) (p : Point) : Debt := fun i => ∫ s in (0 : ℝ)..p.1, density f U (s, p.2) i theorem axisHistory_localized_sub (W : Window) @@ -656,13 +656,14 @@ theorem exists_smooth_localization (W : Window) exact ⟨splice_eq_of_eq W (heq N p hp).1, splice_eq_of_eq W (heq N p hp).2⟩ /-- Strip domain, bundling `carrier`, `isOpen`, `scale_mem`. -/ +@[expose] noncomputable def stripDomain (Ω : Set ℝ) (hΩ : IsOpen Ω) : ProfileHistories.RadialDomain where carrier := univ ×ˢ Ω isOpen := isOpen_univ.prod hΩ scale_mem := fun _ hp _ _ => ⟨mem_univ _, hp.2⟩ /-- Profiles, bundling `f`, `U`, `f_smooth`, `U_smooth` and the required compatibility proofs. -/ -noncomputable def profiles (Ω : Set ℝ) (hΩ : IsOpen Ω) (f U : Field) (P0 : ℝ → ℝ) +@[expose] noncomputable def profiles (Ω : Set ℝ) (hΩ : IsOpen Ω) (f U : Field) (P0 : ℝ → ℝ) (hf : ContDiffOn ℝ ∞ f (univ ×ˢ Ω)) (hU : ContDiffOn ℝ ∞ U (univ ×ˢ Ω)) (hP0 : ContDiffOn ℝ ∞ P0 Ω) : ProfileHistories.Profiles (stripDomain Ω hΩ) where f := f @@ -673,7 +674,7 @@ noncomputable def profiles (Ω : Set ℝ) (hΩ : IsOpen Ω) (f U : Field) (P0 : pressure0_smooth := fun _ hp => hP0.contDiffAt (hΩ.mem_nhds hp.2) /-- Profile rows, given by `![P.M p, P.I p, P.J p, P.S p, P.pressure p]`. -/ -noncomputable def profileRows {D : ProfileHistories.RadialDomain} +@[expose] noncomputable def profileRows {D : ProfileHistories.RadialDomain} (P : ProfileHistories.Profiles D) (p : Point) : Debt := ![P.M p, P.I p, P.J p, P.S p, P.pressure p] @@ -843,15 +844,15 @@ noncomputable def editE (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := A p.2 * FiveProfileMoments.e P (c p.2) p.1 /-- Edit F, given by `editE P A c p / Real.sqrt (2 * p.1)`. -/ -noncomputable def editF (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) +@[expose] noncomputable def editF (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) (c : ℝ → Coeff) (p : Point) : ℝ := editE P A c p / Real.sqrt (2 * p.1) /-- Apply repair F, given by `f p + editF P A c p`. -/ -noncomputable def applyRepairF (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) +@[expose] noncomputable def applyRepairF (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) (c : ℝ → Coeff) (f : Field) (p : Point) : ℝ := f p + editF P A c p /-- Apply repair U, given by `U p + editU P A c p`. -/ -noncomputable def applyRepairU (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) +@[expose] noncomputable def applyRepairU (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) (c : ℝ → Coeff) (U : Field) (p : Point) : ℝ := U p + editU P A c p theorem editU_contDiff (P : FiveProfileMoments.Patch) (A : ℝ → ℝ) (c : ℝ → Coeff) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedProfileAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedProfileAssembly.lean index 9c79d7f8e7..6ce71e84a4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedProfileAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ModulatedProfileAssembly.lean @@ -32,7 +32,7 @@ supported edit differences, including their nonlinear density integrals, are unchanged when transplanted back to the original field. -/ -@[expose] public section +public section noncomputable section @@ -155,7 +155,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MomentRepair.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MomentRepair.lean index b16dc4dded..a06a495e74 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MomentRepair.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MomentRepair.lean @@ -21,7 +21,7 @@ two-row weighted point-evaluation matrix. No assertion about the existence of smooth bumps or the conditioning of their moment matrices is implicit here. -/ -@[expose] public section +public section noncomputable section @@ -52,7 +52,7 @@ theorem moments_synthesize (L : ι → V →ₗ[ℝ] ℝ) (b : ι → V) (c : ι simp [moments, synthesize, momentMatrix, Matrix.mulVec, dotProduct, mul_comm] /-- Coefficients obtained using the actual matrix inverse. -/ -def coefficients (B : Matrix ι ι ℝ) (d : ι → ℝ) : ι → ℝ := B⁻¹.mulVec d +@[expose] def coefficients (B : Matrix ι ι ℝ) (d : ι → ℝ) : ι → ℝ := B⁻¹.mulVec d theorem matrix_mul_coefficients (B : Matrix ι ι ℝ) (hB : B.det ≠ 0) (d : ι → ℝ) : B.mulVec (coefficients B d) = d := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/MovingMomentBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/MovingMomentBounds.lean index 63197a9ae9..9598174c90 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/MovingMomentBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/MovingMomentBounds.lean @@ -16,7 +16,7 @@ exponent using the same moving edge weight. The containing annulus is used only to justify the actual integrals and local smoothness. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NativeBandExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NativeBandExtension.lean index 831d7e63a4..6fe8913b47 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NativeBandExtension.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NativeBandExtension.lean @@ -19,7 +19,7 @@ have a zero germ there. Local smoothness of the actual raw primary is proved from the fixed prepared family before using that flatness. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NativePrincipalEquations.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NativePrincipalEquations.lean index b65c9779d6..f63071e6fe 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NativePrincipalEquations.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NativePrincipalEquations.lean @@ -18,7 +18,7 @@ regularity needed in these equations is obtained on the selected native cell. No global covariance-control or solved-output class is required. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalAxisBridge.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalAxisBridge.lean index 810d5c380f..1ba68bcb47 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalAxisBridge.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalAxisBridge.lean @@ -30,7 +30,7 @@ proves compatibility of the output jets, so its operators act on actual smooth coefficient functions in the complete space, not just unrelated arrays. -/ -@[expose] public section +public section noncomputable section @@ -117,7 +117,7 @@ theorem productFamily_eq (I : Window) (ε : ℝ) (A B : AxisSpace I ε) productFamily I ε A B n m x = ∑ ij ∈ antidiagonal n, leibnizSum (fun k => inputJet I ε A ij.1 k x) - (fun l => inputJet I ε B ij.2 l x) m := rfl + (fun l => inputJet I ε B ij.2 l x) m := by rfl theorem productFamily_continuous (I : Window) (ε : ℝ) (A B : AxisSpace I ε) (n m : ℕ) : ContinuousOn (productFamily I ε A B n m) I.interval := by @@ -850,7 +850,7 @@ small-operator-norm hypothesis is used. The generic Banach-ring lemmas isolate the analytic implication of the factorial estimate from its radial proof. -/ -@[expose] public section +public section noncomputable section @@ -1239,7 +1239,7 @@ theorem axisLinearOperator_resolvent_equation (I : Window) {ε : ℝ} (hε : 0 < (axisLinearOperator_pow_bound I hε χ Q hQ) A /-- The exact bounded operator in the natural angular equation. -/ -def naturalOperator (I : Window) {ε : ℝ} (hε : 0 < ε) (χ : AxisSpace I ε) : +@[expose] def naturalOperator (I : Window) {ε : ℝ} (hε : 0 < ε) (χ : AxisSpace I ε) : AxisSpace I ε →L[ℝ] AxisSpace I ε := (1 / 2 : ℝ) • ((AxisOperators.regularInverse I hε 2 (by norm_num)).comp (AxisOperators.product I hε χ)) @@ -1330,7 +1330,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1973,12 +1973,12 @@ theorem uniform_natural_fixedPoint [CompleteSpace V] theorem naturalRemainder_fst_resolvent (O : NaturalOperators V) (d : AxisData V) (S : V →L[ℝ] V) (t : ℝ) (a : V) (x : V × V) : (naturalRemainder O d S t a x).1 = - S ((naturalRemainder O d (ContinuousLinearMap.id ℝ V) t a x).1) := rfl + S ((naturalRemainder O d (ContinuousLinearMap.id ℝ V) t a x).1) := by rfl theorem naturalRemainder_snd_resolvent (O : NaturalOperators V) (d : AxisData V) (S : V →L[ℝ] V) (t : ℝ) (a : V) (x : V × V) : (naturalRemainder O d S t a x).2 = - (naturalRemainder O d (ContinuousLinearMap.id ℝ V) t a x).2 := rfl + (naturalRemainder O d (ContinuousLinearMap.id ℝ V) t a x).2 := by rfl /-- Undoing the actual angular resolvent turns the fixed point into the two integrated natural equations. The only extra hypothesis is the @@ -2077,7 +2077,7 @@ theorem evaluated_mixed_error (I : AxisCoefficientSpace.Window) /-- Concrete instantiation by the genuine coefficient product, radial averages/inverses, and derivative composites constructed in AxisOperators. -/ -def coefficientOperators (I : AxisCoefficientSpace.Window) {ε : ℝ} (hε : 0 < ε) : +@[expose] def coefficientOperators (I : AxisCoefficientSpace.Window) {ε : ℝ} (hε : 0 < ε) : NaturalOperators (AxisCoefficientSpace.AxisSpace I ε) where product := AxisOperators.product I hε average := AxisOperators.average I hε @@ -2166,7 +2166,7 @@ The identities here combine the convergent, smooth evaluation of `AxisSpace` with the exact compatible coefficient operators of `AxisOperators`. -/ -@[expose] public section +public section noncomputable section @@ -2684,7 +2684,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2704,19 +2704,19 @@ open scoped Topology ContDiff open AxisCoefficientSpace AxisWeightEstimates /-- Ordinary radial partial derivative of an actual function. -/ -def partialY (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def partialY (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := deriv (fun Y => F (Y, p.2)) p.1 /-- Ordinary parameter partial derivative of an actual function. -/ -def partialEta (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def partialEta (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := deriv (fun η => F (p.1, η)) p.2 /-- Actual mixed derivative, with the order used by the manuscript's jet bounds. -/ -def mixedDerivative (k m : ℕ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def mixedDerivative (k m : ℕ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := iteratedDeriv m (fun η => iteratedDeriv k (fun Y => F (Y, η)) p.1) p.2 /-- The singular radial differential expression, evaluated without division by `Y`. -/ -def radialDifferential (r : ℕ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def radialDifferential (r : ℕ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := p.1 * iteratedDeriv 2 (fun Y => F (Y, p.2)) p.1 + (r : ℝ) * partialY F p /-- The same expression in terms of the rigorously differentiated sums. -/ @@ -2795,7 +2795,7 @@ theorem radialEvaluation_smul (I : Window) (ε c : ℝ) ring /-- Fixed axis data have radial degree zero; parameter dependence remains unrestricted. -/ -def RadiallyConstant (I : Window) (ε : ℝ) (A : AxisSpace I ε) : Prop := +@[expose] def RadiallyConstant (I : Window) (ε : ℝ) (A : AxisSpace I ε) : Prop := ∀ n : ℕ, n ≠ 0 → ∀ η : ℝ, η ∈ I.interval → coefficient I (weight ε) A n η = 0 theorem profile_radiallyConstant (I : Window) (ε : ℝ) (A : AxisSpace I ε) @@ -2924,11 +2924,11 @@ structure ParameterData where zStar : ℝ → ℝ /-- The actual parameter function represented by the zeroth radial coefficient. -/ -def inputValue (I : Window) (ε : ℝ) (A : AxisSpace I ε) : ℝ → ℝ := +@[expose] def inputValue (I : Window) (ε : ℝ) (A : AxisSpace I ε) : ℝ → ℝ := coefficient I (weight ε) A 0 /-- The fixed fields of the integrated system, interpreted as actual functions. -/ -def parameters (I : Window) (ε : ℝ) (χ : AxisSpace I ε) +@[expose] def parameters (I : Window) (ε : ℝ) (χ : AxisSpace I ε) (d : AxisContraction.AxisData (AxisSpace I ε)) : ParameterData where A := d.A D := d.D @@ -2975,20 +2975,20 @@ def pressureCoefficient (I : Window) {ε : ℝ} (hε : 0 < ε) AxisOperators.primitive I hε (pressureSource I hε a Φ) /-- The reconstructed axial profile `U=U*+Λ⁻¹u`. -/ -def reconstructedU (d : ParameterData) (t : ℝ) (u : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def reconstructedU (d : ParameterData) (t : ℝ) (u : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := d.uStar p.2 + t * u p /-- The actual transport coefficient using the regular radial average. -/ -def reconstructedW (d : ParameterData) (t : ℝ) (B : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def reconstructedW (d : ParameterData) (t : ℝ) (B : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := d.wStar p.2 - t * ((2 * d.D * p.2) * B p + d.d p.2 * partialEta B p) /-- Reconstructed H, given by `d.hStar p.2 + t * d.d p.2 * u p`. -/ -def reconstructedH (d : ParameterData) (t : ℝ) (u : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def reconstructedH (d : ParameterData) (t : ℝ) (u : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := d.hStar p.2 + t * d.d p.2 * u p /-- The first remainder in equation (17), using ordinary derivatives of actual functions and `κ=ξ₀/Λ`. -/ -def angularRemainder (d : ParameterData) (t : ℝ) +@[expose] def angularRemainder (d : ParameterData) (t : ℝ) (Φ u B : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := d.inverseL p.2 * ((reconstructedW d t B p + d.h * (1 - 2 * p.2 * reconstructedU d t u p) + @@ -2998,7 +2998,7 @@ def angularRemainder (d : ParameterData) (t : ℝ) /-- The expanded second remainder in equation (17), including all pressure terms and the actual parameter derivative of the pressure correction. -/ -def axialRemainder (d : ParameterData) (t : ℝ) +@[expose] def axialRemainder (d : ParameterData) (t : ℝ) (u B P : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := d.inverseL p.2 * (d.A * (1 - 4 * p.2 * d.uStar p.2) * u p - @@ -3311,12 +3311,23 @@ theorem integrated_solution (I : Window) {ε : ℝ} (hε : 0 < ε) _ = _ := by rw [hst] /-- The leading pair defined using the proved angular resolvent. -/ -def referenceCoefficients (I : Window) {ε : ℝ} (hε : 0 < ε) +@[expose] def referenceCoefficients (I : Window) {ε : ℝ} (hε : 0 < ε) (χ : AxisSpace I ε) (d : AxisContraction.AxisData (AxisSpace I ε)) : AxisSpace I ε × AxisSpace I ε := AxisContraction.referencePair (AxisContraction.coefficientOperators I hε) d (AxisResolvent.naturalResolvent I hε χ) +@[simp] theorem referenceCoefficients_fst (I : Window) {ε : ℝ} (hε : 0 < ε) + (χ : AxisSpace I ε) (d : AxisContraction.AxisData (AxisSpace I ε)) : + (referenceCoefficients I hε χ d).1 = AxisResolvent.naturalResolvent I hε χ d.one := by + rfl + +theorem referenceCoefficients_snd (I : Window) {ε : ℝ} (hε : 0 < ε) + (χ : AxisSpace I ε) (d : AxisContraction.AxisData (AxisSpace I ε)) : + (referenceCoefficients I hε χ d).2 = + -(1 / 2 : ℝ) • AxisOperators.regularInverse I hε 1 (by norm_num) + (AxisOperators.product I hε d.inverseL d.zStar) := by rfl + /-- The limiting system is stated directly for actual functions. -/ structure IsLeadingSolution (I : Window) (d : ParameterData) (Φ u : ℝ × ℝ → ℝ) : Prop where @@ -3365,7 +3376,7 @@ theorem reference_isLeadingSolution (I : Window) {ε : ℝ} (hε : 0 < ε) /-- A fixed finite constant computed from the input norms and the genuine bounded operators. It is independent of `Λ` and of the amplitude in its norm ball. -/ -def errorConstant (I : Window) {ε : ℝ} (hε : 0 < ε) +@[expose] def errorConstant (I : Window) {ε : ℝ} (hε : 0 < ε) (χ : AxisSpace I ε) (d : AxisContraction.AxisData (AxisSpace I ε)) (M : ℝ) (hM : 0 ≤ M) : ℝ := AxisContraction.remainderBound (AxisContraction.coefficientOperators I hε) d @@ -3379,7 +3390,7 @@ theorem errorConstant_nonneg (I : Window) {ε : ℝ} (hε : 0 < ε) /-- Simultaneous estimates for every ordinary mixed derivative, uniform on each smaller radial interval and on the whole open parameter interval. -/ -def UniformMixedError (I : Window) (ε K : ℝ) +@[expose] def UniformMixedError (I : Window) (ε K : ℝ) (Φ u Φ₀ u₀ : ℝ × ℝ → ℝ) : Prop := ∀ R : ℝ, 1 ≤ R → R < 20 → ∀ k m : ℕ, ∀ p : ℝ × ℝ, |p.1| ≤ R → p.2 ∈ Ioo I.left I.right → diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCoefficientBridge.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCoefficientBridge.lean index 0e89e6caa4..1b31517bc0 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCoefficientBridge.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCoefficientBridge.lean @@ -19,7 +19,7 @@ its radial flux is `X*beta`. The two residual equations below are derived from the constructed natural equations, not assumed as slow-order hypotheses. -/ -@[expose] public section +public section noncomputable section @@ -96,7 +96,7 @@ noncomputable def naturalFlux (h : ℝ) (U V : InnerProfile) (w : InnerPoint) : CoordinateAlgebra.d w.2 * NaturalAxisBridge.partialEta V w) /-- Zero sequence, with branches according to `n = 0`. -/ -noncomputable def zeroSequence (f : InnerProfile) (n : ℕ) : InnerProfile := +@[expose] noncomputable def zeroSequence (f : InnerProfile) (n : ℕ) : InnerProfile := if n = 0 then f else fun _ => 0 /-- Natural profiles, bundling `phi`, `axial`, `flux`, `pressure`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCore.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCore.lean index 21df41a34e..6e3ad037d1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCore.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalCore.lean @@ -22,7 +22,7 @@ explicit open physical domain where those profiles have been constructed. No assertion about the regularity of the final Navier--Stokes force is made. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalEntrance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalEntrance.lean index fd087313ad..6388bbd038 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalEntrance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalEntrance.lean @@ -17,7 +17,7 @@ profiles. Uniform estimates and the regular radial integral are used to check the entrance test before any outgoing controlled continuation. -/ -@[expose] public section +public section noncomputable section @@ -38,27 +38,27 @@ local instance instNaturalEntrance2 (I : AxisCoefficientSpace.Window) (ε : ℝ) /-- Sq, given by `-transportW h V p * (1 + p.1 * partialY f p / f p) - h * (1 - 2 * p.2 * U p) - transportH h U p * (partialEta f p / f p)`. -/ -def Sq (h : ℝ) (f U V : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def Sq (h : ℝ) (f U V : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := -transportW h V p * (1 + p.1 * partialY f p / f p) - h * (1 - 2 * p.2 * U p) - transportH h U p * (partialEta f p / f p) /-- P1, given by `-2 * p.1 * partialY f p / f p`. -/ -def p1 (f : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def p1 (f : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := -2 * p.1 * partialY f p / f p /-- Ns, given by `-2 * partialY U p`. -/ -def ns (U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := -2 * partialY U p +@[expose] def ns (U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := -2 * partialY U p /-- Angular velocity, given by `Real.sqrt (2 * p.1) * f p`. -/ -def angularVelocity (f : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def angularVelocity (f : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * p.1) * f p /-- P2, given by `p.1 * ns U p / angularVelocity f p`. -/ -def p2 (f U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def p2 (f U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := p.1 * ns U p / angularVelocity f p /-- Cone size, given by `p1 f p + (p2 f U p) ^ 2 / p1 f p`. -/ -def coneSize (f U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def coneSize (f U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := p1 f p + (p2 f U p) ^ 2 / p1 f p theorem Sq_eq_radial {h j Λ : ℝ} {P0 a₀ : ℝ → ℝ} {f U V Pr : ℝ × ℝ → ℝ} @@ -216,7 +216,7 @@ theorem derivative_neg_of_regular_source {f : ℝ → ℝ} {R L : ℝ} linarith /-- Entrance set, constructed using `Icc`. -/ -def entranceSet : Set (ℝ × ℝ) := Icc (0 : ℝ) (41 / 10) ×ˢ Icc (-1 : ℝ) 1 +@[expose] def entranceSet : Set (ℝ × ℝ) := Icc (0 : ℝ) (41 / 10) ×ˢ Icc (-1 : ℝ) 1 instance : CompactSpace entranceSet := isCompact_iff_compactSpace.mp (isCompact_Icc.prod isCompact_Icc) @@ -237,7 +237,7 @@ abbrev CoefficientPair (ε : ℝ) := /-- The finite jets needed by the angular source, including the genuine bounded average operator. -/ -def sourceJets {ε : ℝ} (hε : 0 < ε) (x : CoefficientPair ε) (p : ℝ × ℝ) : Fin 6 → ℝ := +@[expose] def sourceJets {ε : ℝ} (hε : 0 < ε) (x : CoefficientPair ε) (p : ℝ × ℝ) : Fin 6 → ℝ := ![AxisEvaluation.mixedSeries window ε x.1 0 0 p, AxisEvaluation.mixedSeries window ε x.1 1 0 p, AxisEvaluation.mixedSeries window ε x.1 0 1 p, @@ -374,7 +374,8 @@ theorem reference_phi_value {h j σ : ℝ} {P0 : ℝ → ℝ} (v : CoefficientFa rw [AxisReference.referenceCoefficients_profile_eq_series window v.epsilon_pos (v.elements .chi) v.axisData v.compatible hη] rw [v.value .chi hη] - rfl + exact congrArg (fun x => AxisSeries.profile x p.val.1) + (realField_chi h j σ P0 p.val.2) theorem reference_phi_lower {h j σ : ℝ} {P0 : ℝ → ℝ} (v : CoefficientFamily h j σ P0) (hσ : 0 < σ) (p : entranceSet) : @@ -395,7 +396,7 @@ theorem reference_phiY_zero {h j σ : ℝ} {P0 : ℝ → ℝ} (v : CoefficientFa rw [AxisReference.referenceCoefficients_deriv_Y_eq window v.epsilon_pos (v.elements .chi) v.axisData v.compatible hη] rw [v.value .chi hη] - change deriv (AxisSeries.profile (NaturalAxisData.chi h j σ p.val.2)) p.val.1 = 0 + rw [realField_chi] rw [hchi, AxisSeries.deriv_profile] simp @@ -600,13 +601,13 @@ theorem sourceJets_eq {ε : ℝ} (hε : 0 < ε) (x : CoefficientPair ε) /-- Angular field, given by `angularProfile (realAmplitude h j σ Λ C) Λ (AxisEvaluation.profile window ε x.1)`. -/ -noncomputable def angularField (h j σ Λ C : ℝ) {ε : ℝ} (x : CoefficientPair ε) : +@[expose] noncomputable def angularField (h j σ Λ C : ℝ) {ε : ℝ} (x : CoefficientPair ε) : ℝ × ℝ → ℝ := angularProfile (realAmplitude h j σ Λ C) Λ (AxisEvaluation.profile window ε x.1) /-- Axial field, given by `affineProfile (NaturalAxisData.U j) (1 / Λ) Λ (AxisEvaluation.profile window ε x.2)`. -/ -noncomputable def axialField (j Λ : ℝ) {ε : ℝ} (x : CoefficientPair ε) : +@[expose] noncomputable def axialField (j Λ : ℝ) {ε : ℝ} (x : CoefficientPair ε) : ℝ × ℝ → ℝ := affineProfile (NaturalAxisData.U j) (1 / Λ) Λ (AxisEvaluation.profile window ε x.2) @@ -709,8 +710,10 @@ theorem reference_u_value {h j σ : ℝ} {P0 : ℝ → ℝ} rw [coefficient_product_constant window v.epsilon_pos _ _ (v.radiallyConstant .inverseL) n ht, v.radiallyConstant .zStar n hn t ht, mul_zero] change AxisEvaluation.profile window v.epsilon - (-(1 / 2 : ℝ) • AxisOperators.regularInverse window v.epsilon_pos 1 (by norm_num) A) + (referenceCoefficients window v.epsilon_pos (v.elements .chi) v.axisData).2 (Y, η) = _ + rw [referenceCoefficients_snd] + rw [v.axisData_inverseL, v.axisData_zStar] rw [profile_smul, regularInverse_one_constant v.epsilon_pos A hA Y hη] have hvalue : inputValue window v.epsilon A η = (NaturalAxisData.L h η)⁻¹ * NaturalAxisData.Z h j P0 η := by @@ -720,7 +723,7 @@ theorem reference_u_value {h j σ : ℝ} {P0 : ℝ → ℝ} change inputValue window v.epsilon (v.elements .inverseL) η * inputValue window v.epsilon (v.elements .zStar) η = _ rw [v.value .inverseL hη, v.value .zStar hη] - rfl + simp only [realField_inverseL, realField_zStar] rw [hvalue] simp only [div_eq_mul_inv, mul_inv_rev] ring @@ -752,8 +755,10 @@ theorem coefficient_phi_lower {h j σ Λ K : ℝ} {P0 : ℝ → ℝ} apply AxisReference.positive_of_uniformMixedError window v.epsilon_pos (v.elements .chi) v.axisData v.compatible hK hscale herr hY0 hY1 hη · rw [v.value .chi ⟨hη.1.le, hη.2.le⟩] + rw [realField_chi] exact (NaturalAxisData.chi_bounds h j hσ η).1 · rw [v.value .chi ⟨hη.1.le, hη.2.le⟩] + rw [realField_chi] exact (NaturalAxisData.chi_bounds h j hσ η).2.le /-- The quantitative source inequality is proved for every actual @@ -1074,8 +1079,10 @@ theorem exists_coefficientProfile {h j σ : ℝ} {P0 : ℝ → ℝ} apply AxisReference.log_slope_of_uniformMixedError window v.epsilon_pos (v.elements .chi) v.axisData v.compatible hK hscale he hη · rw [v.value .chi ⟨hη.1.le, hη.2.le⟩] + rw [realField_chi] exact hchi · rw [v.value .chi ⟨hη.1.le, hη.2.le⟩] + rw [realField_chi] exact (NaturalAxisData.chi_bounds h j hσ η).2.le } exact ⟨{ family := F @@ -1287,7 +1294,7 @@ theorem axial_flux_integral {g : ℝ → ℝ} (L R : ℝ) /-- The regular angular primitive of the actual source. This is the manuscript's `Q_s`, before multiplication by `X/L`. -/ -noncomputable def regularAngularLag (h : ℝ) (f U V : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def regularAngularLag (h : ℝ) (f U V : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := (∫ x in (0 : ℝ)..p.1, (2 * x * f (x, p.2)) * Sq h f U V (x, p.2)) / (p.1 * (2 * p.1 * f p)) @@ -1340,14 +1347,14 @@ theorem p1_eq_scaled_regularAngularLag {h j Λ : ℝ} {P0 a : ℝ → ℝ} ring /-- Sn as an element of `ℝ`. -/ -noncomputable def Sn (h : ℝ) (U V Pr : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def Sn (h : ℝ) (U V Pr : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := -transportW h V p * (p.1 * partialY U p) - NaturalAxisData.A h * (1 - 2 * p.2 * U p) * U p - transportH h U p * partialEta U p - NaturalAxisData.d p.2 * partialEta Pr p + 4 * NaturalAxisData.A h * p.2 * Pr p + 2 * p.2 * p.1 * partialY Pr p /-- Regular axial lag, given by `(∫ x in (0 : ℝ)..p.1, Sn h U V Pr (x, p.2)) / p.1`. -/ -noncomputable def regularAxialLag (h : ℝ) (U V Pr : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def regularAxialLag (h : ℝ) (U V Pr : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := (∫ x in (0 : ℝ)..p.1, Sn h U V Pr (x, p.2)) / p.1 theorem Sn_eq_radial {h j Λ : ℝ} {P0 a : ℝ → ℝ} {f U V Pr : ℝ × ℝ → ℝ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalProfile.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalProfile.lean index a5b7e89db0..66730f3df2 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalProfile.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NaturalProfile.lean @@ -62,7 +62,7 @@ The clock weights and bounded exponents are fixed input functions. Regularity of the pressure is deduced from the integral, not assumed as an input. -/ -@[expose] public section +public section noncomputable section @@ -72,10 +72,10 @@ open MeasureTheory Set Filter Metric open scoped Topology ContDiff /-- Real form of `(1 + η²)^(-2a)`. -/ -def kernel (a η : ℝ) : ℝ := Real.exp (-2 * a * Real.log (1 + η ^ 2)) +@[expose] def kernel (a η : ℝ) : ℝ := Real.exp (-2 * a * Real.log (1 + η ^ 2)) /-- Pressure, given by `-(1 / 2 : ℝ) * ∫ y, g y * kernel (a y) η`. -/ -def pressure (g a : ℝ → ℝ) (η : ℝ) : ℝ := +@[expose] def pressure (g a : ℝ → ℝ) (η : ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ y, g y * kernel (a y) η /-- Sufficient hypotheses on the fixed clock data. No pressure derivatives occur here. -/ @@ -511,7 +511,7 @@ end end -@[expose] public section +public section noncomputable section @@ -521,27 +521,27 @@ open Set open scoped ContDiff Topology /-- D, given by `1 / 2 - h`. -/ -def D (h : ℝ) : ℝ := 1 / 2 - h +@[expose] def D (h : ℝ) : ℝ := 1 / 2 - h /-- A, given by `1 / 2 + h`. -/ -def A (h : ℝ) : ℝ := 1 / 2 + h +@[expose] def A (h : ℝ) : ℝ := 1 / 2 + h /-- D, given by `1 - η ^ 2`. -/ -def d (η : ℝ) : ℝ := 1 - η ^ 2 +@[expose] def d (η : ℝ) : ℝ := 1 - η ^ 2 /-- L, given by `1 - 2 * h * η ^ 2`. -/ -def L (h η : ℝ) : ℝ := 1 - 2 * h * η ^ 2 +@[expose] def L (h η : ℝ) : ℝ := 1 - 2 * h * η ^ 2 /-- U, given by `4 * η + j`. -/ -def U (j η : ℝ) : ℝ := 4 * η + j +@[expose] def U (j η : ℝ) : ℝ := 4 * η + j /-- H, given by `D h * η + d η * U j η`. -/ -def H (h j η : ℝ) : ℝ := D h * η + d η * U j η +@[expose] def H (h j η : ℝ) : ℝ := D h * η + d η * U j η /-- W, given by `1 - 4 * d η - 2 * D h * η * U j η`. -/ -def W (h j η : ℝ) : ℝ := 1 - 4 * d η - 2 * D h * η * U j η +@[expose] def W (h j η : ℝ) : ℝ := 1 - 4 * d η - 2 * D h * η * U j η /-- Z, given by `-A h * (1 - 2 * η * U j η) * U j η - H h j η * 4 - d η * deriv P η + 4 * A h * η * P η`. -/ -def Z (h j : ℝ) (P : ℝ → ℝ) (η : ℝ) : ℝ := +@[expose] def Z (h j : ℝ) (P : ℝ → ℝ) (η : ℝ) : ℝ := -A h * (1 - 2 * η * U j η) * U j η - H h j η * 4 - d η * deriv P η + 4 * A h * η * P η /-- Chi, given by `(H h j η) ^ 2 / ((H h j η) ^ 2 + σ ^ 2)`. -/ -def chi (h j σ η : ℝ) : ℝ := (H h j η) ^ 2 / ((H h j η) ^ 2 + σ ^ 2) +@[expose] def chi (h j σ η : ℝ) : ℝ := (H h j η) ^ 2 / ((H h j η) ^ 2 + σ ^ 2) /-- A concrete range of choices permitted by the manuscript's smallness order. -/ structure SmallParameters (h j : ℝ) : Prop where @@ -900,7 +900,7 @@ parameter interval. Cauchy's integral formula supplies bounds on actual derivatives; the derivative bounds are not hypotheses of the construction. -/ -@[expose] public section +public section noncomputable section @@ -1264,7 +1264,7 @@ then applying the real fundamental theorem of calculus along the segment. No disk containing the entire domain and no assumed primitive are required. -/ -@[expose] public section +public section noncomputable section @@ -1522,7 +1522,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1533,7 +1533,7 @@ open scoped Topology ContDiff BigOperators open AxisCoefficientSpace AnalyticCoefficientBounds /-- A fixed, slightly enlarged real parameter interval. -/ -def window : Window := ⟨-11 / 10, 11 / 10, by norm_num⟩ +@[expose] def window : Window := ⟨-11 / 10, 11 / 10, by norm_num⟩ theorem original_interval_interior : Icc (-1 : ℝ) 1 ⊆ Ioo window.left window.right := by @@ -1546,7 +1546,7 @@ def complexD (z : ℂ) : ℂ := 1 - z ^ 2 /-- Complex L, given by `1 - 2 * (h : ℂ) * z ^ 2`. -/ def complexL (h : ℝ) (z : ℂ) : ℂ := 1 - 2 * (h : ℂ) * z ^ 2 /-- Complex U, given by `4 * z + (j : ℂ)`. -/ -def complexU (j : ℝ) (z : ℂ) : ℂ := 4 * z + (j : ℂ) +@[expose] def complexU (j : ℝ) (z : ℂ) : ℂ := 4 * z + (j : ℂ) /-- Complex H, given by `(NaturalAxisData.D h : ℂ) * z + complexD z * complexU j z`. -/ def complexH (h j : ℝ) (z : ℂ) : ℂ := (NaturalAxisData.D h : ℂ) * z + complexD z * complexU j z @@ -1568,7 +1568,7 @@ def complexGradient (h j σ : ℝ) (z : ℂ) : ℂ := -complexL h z * complexH h j z / denominator h j σ z /-- Real gradient, given by `-NaturalAxisData.L h x * NaturalAxisData.H h j x / (NaturalAxisData.H h j x ^ 2 + σ ^ 2)`. -/ -def realGradient (h j σ x : ℝ) : ℝ := +@[expose] def realGradient (h j σ x : ℝ) : ℝ := -NaturalAxisData.L h x * NaturalAxisData.H h j x / (NaturalAxisData.H h j x ^ 2 + σ ^ 2) @@ -1670,6 +1670,15 @@ def realField (h j σ : ℝ) (P : ℝ → ℝ) : Field → ℝ → ℝ | .chi => NaturalAxisData.chi h j σ | .gradient => realGradient h j σ +theorem realField_chi (h j σ : ℝ) (P : ℝ → ℝ) (η : ℝ) : + realField h j σ P .chi η = NaturalAxisData.chi h j σ η := by rfl + +theorem realField_inverseL (h j σ : ℝ) (P : ℝ → ℝ) (η : ℝ) : + realField h j σ P .inverseL η = (NaturalAxisData.L h η)⁻¹ := by rfl + +theorem realField_zStar (h j σ : ℝ) (P : ℝ → ℝ) (η : ℝ) : + realField h j σ P .zStar η = NaturalAxisData.Z h j P η := by rfl + theorem deriv_complexPressure_ofReal {g a : ℝ → ℝ} {cap : ℝ} (hp : PressureDatum.Admissible g a cap) (x : ℝ) : deriv (PressureDatum.complexPressure g a) (x : ℂ) = @@ -1909,6 +1918,12 @@ def CoefficientFamily.axisData {h j σ : ℝ} {P : ℝ → ℝ} normalizedGradient := v.elements .gradient zStar := v.elements .zStar +theorem CoefficientFamily.axisData_inverseL {h j σ : ℝ} {P : ℝ → ℝ} + (v : CoefficientFamily h j σ P) : v.axisData.inverseL = v.elements .inverseL := by rfl + +theorem CoefficientFamily.axisData_zStar {h j σ : ℝ} {P : ℝ → ℝ} + (v : CoefficientFamily h j σ P) : v.axisData.zStar = v.elements .zStar := by rfl + theorem CoefficientFamily.radiallyConstant {h j σ : ℝ} {P : ℝ → ℝ} (v : CoefficientFamily h j σ P) (k : Field) : NaturalAxisBridge.RadiallyConstant window v.epsilon (v.elements k) := by @@ -2038,7 +2053,7 @@ theorem AnalyticInputs.realPhase_hasDerivAt {h j σ : ℝ} {P : ℝ → ℝ} (d.phase_derivative (x : ℂ) (d.real_mem_compact hx)).real_of_complex /-- Real amplitude, given by `Real.exp (Λ * realPhase h j σ x) / C`. -/ -def realAmplitude (h j σ Λ C x : ℝ) : ℝ := Real.exp (Λ * realPhase h j σ x) / C +@[expose] def realAmplitude (h j σ Λ C x : ℝ) : ℝ := Real.exp (Λ * realPhase h j σ x) / C theorem AnalyticInputs.realAmplitude_hasDerivAt {h j σ : ℝ} {P : ℝ → ℝ} (d : AnalyticInputs h j σ P) (Λ C : ℝ) {x : ℝ} (hx : x ∈ window.interval) : @@ -2064,7 +2079,7 @@ theorem AnalyticInputs.realAmplitude_logDerivative {h j σ : ℝ} {P : ℝ → /-- Normalization threshold, given by `Real.exp (Λ * realPartSup (axisPhase h j σ) d.compactSet)`. -/ -def AnalyticInputs.normalizationThreshold {h j σ : ℝ} {P : ℝ → ℝ} +@[expose] def AnalyticInputs.normalizationThreshold {h j σ : ℝ} {P : ℝ → ℝ} (d : AnalyticInputs h j σ P) (Λ : ℝ) : ℝ := Real.exp (Λ * realPartSup (axisPhase h j σ) d.compactSet) @@ -2122,7 +2137,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2132,21 +2147,21 @@ open Set Filter NaturalAxisBridge NaturalAxisCoefficients open scoped Topology ContDiff /-- Rescale point, given by `(Λ * p.1, p.2)`. -/ -def rescalePoint (Λ : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := (Λ * p.1, p.2) +@[expose] def rescalePoint (Λ : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := (Λ * p.1, p.2) /-- Domain, given by `rescalePoint Λ ⁻¹' AxisEvaluation.strip window 20`. -/ -def domain (Λ : ℝ) : Set (ℝ × ℝ) := +@[expose] def domain (Λ : ℝ) : Set (ℝ × ℝ) := rescalePoint Λ ⁻¹' AxisEvaluation.strip window 20 /-- Pullback, given by `F (rescalePoint Λ p)`. -/ -def pullback (Λ : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := F (rescalePoint Λ p) +@[expose] def pullback (Λ : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := F (rescalePoint Λ p) /-- Affine profile, given by `b p.2 + c * pullback Λ F p`. -/ -def affineProfile (b : ℝ → ℝ) (c Λ : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def affineProfile (b : ℝ → ℝ) (c Λ : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := b p.2 + c * pullback Λ F p /-- Angular profile, given by `a p.2 * pullback Λ Φ p`. -/ -def angularProfile (a : ℝ → ℝ) (Λ : ℝ) (Φ : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def angularProfile (a : ℝ → ℝ) (Λ : ℝ) (Φ : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := a p.2 * pullback Λ Φ p theorem contDiff_rescalePoint (Λ : ℝ) : ContDiff ℝ ∞ (rescalePoint Λ) := by @@ -2204,7 +2219,7 @@ theorem pullback_partialY {F : ℝ × ℝ → ℝ} (pullback_hasDerivAt_Y hF Λ hp).deriv theorem pullback_partialEta (Λ : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : - partialEta (pullback Λ F) p = partialEta F (rescalePoint Λ p) := rfl + partialEta (pullback Λ F) p = partialEta F (rescalePoint Λ p) := by rfl theorem pullback_second_Y {F : ℝ × ℝ → ℝ} (hF : ContDiffOn ℝ ∞ F (AxisEvaluation.strip window 20)) @@ -2301,7 +2316,7 @@ theorem angularProfile_radialDifferential {Φ : ℝ × ℝ → ℝ} ring /-- The fixed polynomial and pressure fields, interpreted as real functions. -/ -def actualData (h j σ : ℝ) (P0 : ℝ → ℝ) : ParameterData where +@[expose] def actualData (h j σ : ℝ) (P0 : ℝ → ℝ) : ParameterData where A := NaturalAxisData.A h D := NaturalAxisData.D h h := h @@ -2374,11 +2389,11 @@ theorem uStar_smooth (j : ℝ) : ContDiff ℝ ∞ (NaturalAxisData.U j) := by exact (contDiff_const.mul contDiff_id).add contDiff_const /-- The natural transport coefficient recovered from the true radial average. -/ -def transportW (h : ℝ) (V : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def transportW (h : ℝ) (V : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := 1 - 2 * NaturalAxisData.D h * p.2 * V p - NaturalAxisData.d p.2 * partialEta V p /-- Transport H, given by `NaturalAxisData.D h * p.2 + NaturalAxisData.d p.2 * U p`. -/ -def transportH (h : ℝ) (U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def transportH (h : ℝ) (U : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := NaturalAxisData.D h * p.2 + NaturalAxisData.d p.2 * U p theorem transportW_reconstruct {h j σ Λ : ℝ} (P0 : ℝ → ℝ) {B : ℝ × ℝ → ℝ} @@ -2671,7 +2686,7 @@ theorem angularProfile_log_slope_at_four {Λ : ℝ} (hΛ : 0 < Λ) field_simp; ring /-- Profile error constant, constructed using `errorConstant`. -/ -def profileErrorConstant {h j σ : ℝ} {P0 : ℝ → ℝ} +@[expose] def profileErrorConstant {h j σ : ℝ} {P0 : ℝ → ℝ} (d : AnalyticInputs h j σ P0) : ℝ := errorConstant window d.coefficients.epsilon_pos (d.coefficients.elements .chi) d.coefficients.axisData d.amplitudeBound d.amplitudeBound_nonneg @@ -2709,22 +2724,22 @@ structure ProfileFamily {h j σ : ℝ} {P0 : ℝ → ℝ} angularProfile (realAmplitude h j σ Λ C) Λ phi (4 / Λ, η) /-- F, given by `angularProfile (realAmplitude h j σ Λ C) Λ F.phi`. -/ -def ProfileFamily.f {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} +@[expose] def ProfileFamily.f {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} (F : ProfileFamily d Λ C) : ℝ × ℝ → ℝ := angularProfile (realAmplitude h j σ Λ C) Λ F.phi /-- U, given by `affineProfile (NaturalAxisData.U j) (1 / Λ) Λ F.u`. -/ -def ProfileFamily.U {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} +@[expose] def ProfileFamily.U {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} (F : ProfileFamily d Λ C) : ℝ × ℝ → ℝ := affineProfile (NaturalAxisData.U j) (1 / Λ) Λ F.u /-- Ubar, given by `affineProfile (NaturalAxisData.U j) (1 / Λ) Λ F.average`. -/ -def ProfileFamily.Ubar {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} +@[expose] def ProfileFamily.Ubar {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} (F : ProfileFamily d Λ C) : ℝ × ℝ → ℝ := affineProfile (NaturalAxisData.U j) (1 / Λ) Λ F.average /-- Pi, given by `affineProfile P0 (1 / Λ) Λ F.pressure`. -/ -def ProfileFamily.Pi {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} +@[expose] def ProfileFamily.Pi {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : AnalyticInputs h j σ P0} (F : ProfileFamily d Λ C) : ℝ × ℝ → ℝ := affineProfile P0 (1 / Λ) Λ F.pressure diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NominalConeAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NominalConeAssembly.lean index a19d708725..e5b58de218 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NominalConeAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NominalConeAssembly.lean @@ -34,7 +34,7 @@ large natural logarithmic gradient is retained in the growing term rather than estimated by an absolute constant. -/ -@[expose] public section +public section noncomputable section @@ -1074,7 +1074,7 @@ cap is intersected with the existing reset and energy thresholds before any profile is constructed. The actual core is then fixed before choosing h. -/ -@[expose] public section +public section noncomputable section @@ -1214,7 +1214,7 @@ The clean cone below belongs to the unedited outgoing profile. Identification with the complete edited nominal stress is a separate construction. -/ -@[expose] public section +public section noncomputable section @@ -1339,7 +1339,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1379,7 +1379,7 @@ theorem p2_eq_stock {D : RadialDomain} (P : Profiles D) (h : ℝ) (p : Point) : /-! ## Local smooth coordinates for the modulation annulus -/ /-- Tilt, given by `ActivationContinuation.shearB P p / ActivationContinuation.shearA P p`. -/ -noncomputable def tilt {D : RadialDomain} (P : Profiles D) (p : Point) : ℝ := +@[expose] noncomputable def tilt {D : RadialDomain} (P : Profiles D) (p : Point) : ℝ := ActivationContinuation.shearB P p / ActivationContinuation.shearA P p theorem physicalE_smoothAt {D : RadialDomain} (P : Profiles D) {p : Point} @@ -1664,7 +1664,7 @@ end Witness /-! ## Literal physical moments in the logarithmic chart -/ /-- Chart, given by `(XR * Real.exp p.1, p.2)`. -/ -noncomputable def chart (XR : ℝ) (p : Point) : Point := (XR * Real.exp p.1, p.2) +@[expose] noncomputable def chart (XR : ℝ) (p : Point) : Point := (XR * Real.exp p.1, p.2) theorem chart_positive {XR : ℝ} (hXR : 0 < XR) (p : Point) : 0 < (chart XR p).1 := mul_pos hXR (Real.exp_pos _) @@ -2697,10 +2697,11 @@ end Initial /-! ## The active annulus and one common ordered choice -/ /-- Active left, given by `4 / W.axis.scale`. -/ +@[expose] noncomputable def activeLeft {F : Profile} (W : NominalProfile.Witness F) : ℝ := 4 / W.axis.scale /-- Active right, given by `W.controls.radius * Real.exp (OutgoingTail.tailEnd F.data)`. -/ -noncomputable def activeRight {F : Profile} (W : NominalProfile.Witness F) : ℝ := +@[expose] noncomputable def activeRight {F : Profile} (W : NominalProfile.Witness F) : ℝ := W.controls.radius * Real.exp (OutgoingTail.tailEnd F.data) theorem activeLeft_pos {F : Profile} (W : NominalProfile.Witness F) : 0 < activeLeft W := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NominalProfile.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NominalProfile.lean index 5d084c0a4b..b426f48761 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NominalProfile.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NominalProfile.lean @@ -20,7 +20,7 @@ and that value of `h`. The five-row correction is a fixed, constructed local inverse applied to the actual debt of the assembled prefix. -/ -@[expose] public section +public section noncomputable section @@ -208,7 +208,7 @@ noncomputable def idealAmplitude (F : Profile) (eta : ℝ) : ℝ := /-- Ideal U, given by `4 * eta`. -/ noncomputable def idealU (eta : ℝ) : ℝ := 4 * eta /-- Ideal E, given by `idealAmplitude F p.2 * p.1 ^ (1 / 10 : ℝ)`. -/ -noncomputable def idealE (F : Profile) (p : Point) : ℝ := +@[expose] noncomputable def idealE (F : Profile) (p : Point) : ℝ := idealAmplitude F p.2 * p.1 ^ (1 / 10 : ℝ) theorem idealAmplitude_pos (F : Profile) (eta : ℝ) : 0 < idealAmplitude F eta := @@ -246,7 +246,7 @@ noncomputable def resetSolver : ResetSolver := Classical.choice resetSolver_exis /-- Normalized debt, given by `FiveProfileMoments.normalizedDebt (idealAmplitude F eta) (idealU eta) (debt eta)`. -/ -noncomputable def normalizedDebt (F : Profile) (debt : ℝ → Debt) (eta : ℝ) : Coeff := +@[expose] noncomputable def normalizedDebt (F : Profile) (debt : ℝ → Debt) (eta : ℝ) : Coeff := FiveProfileMoments.normalizedDebt (idealAmplitude F eta) (idealU eta) (debt eta) /-- Reset coefficients, given by `resetSolver.solve (normalizedDebt F debt eta)`. -/ @@ -282,13 +282,13 @@ theorem resetCoefficients_smooth (F : Profile) {debt : ℝ → Debt} {V : Set /-- Density, given by `![U x, Real.sqrt (2 * x) * E x, U x * Real.sqrt (2 * x) * E x, U x ^ 2 - E x ^ 2 / 2, E x ^ 2 / (2 * x)]`. -/ -noncomputable def density (U E : ℝ → ℝ) (x : ℝ) : Debt := +@[expose] noncomputable def density (U E : ℝ → ℝ) (x : ℝ) : Debt := ![U x, Real.sqrt (2 * x) * E x, U x * Real.sqrt (2 * x) * E x, U x ^ 2 - E x ^ 2 / 2, E x ^ 2 / (2 * x)] /-- Moments, defined pointwise by `∫ x in Ioc 0 r, density (fun x => U (x, eta)) (fun x => E (x, eta)) x i`. -/ -noncomputable def moments (U E : Field) (r eta : ℝ) : Debt := +@[expose] noncomputable def moments (U E : Field) (r eta : ℝ) : Debt := fun i => ∫ x in Ioc 0 r, density (fun x => U (x, eta)) (fun x => E (x, eta)) x i /-- Corrected U, given by `U p + idealAmplitude F p.2 * FiveProfileMoments.u resetPatch @@ -729,7 +729,7 @@ theorem initialShape_value {eta : ℝ} (hη : eta ∈ ReferencePath.parameterInt c.finish c.radius_before_Xi A.normalization_pos hη /-- The nominal fields are functions of the actual stock-controlled seed. -/ -noncomputable def debt : ℝ → Debt := +@[expose] noncomputable def debt : ℝ → Debt := actualDebt F A.normalization c.shapeTime c.initialShape c.seedF c.seedU /-- Normalized E, given by `joinedE F A.normalization c.shapeTime c.initialShape c.seedF c.seedU`. -/ @@ -814,7 +814,7 @@ theorem physical_before_Xi ShapeTransition.shapeField_before Xi_pos c.shapeTime_pos hp] /-- F, with branches according to `p.1 ≤ Xi`. -/ -noncomputable def f (p : Point) : ℝ := +@[expose] noncomputable def f (p : Point) : ℝ := if p.1 ≤ Xi then c.seedF p else c.E p / Real.sqrt (2 * p.1) theorem f_before_Xi {p : Point} (hp : p.1 ≤ Xi) : c.f p = c.seedF p := ite_eq_left hp @@ -943,7 +943,7 @@ namespace Controls variable {F : Profile} {A : AxisStage F} (c : Controls A) /-- Shaped F, given by `ShapeTransition.shapeField Xi c.shapeTime c.initialShape c.seedF`. -/ -noncomputable def shapedF : Field := +@[expose] noncomputable def shapedF : Field := ShapeTransition.shapeField Xi c.shapeTime c.initialShape c.seedF theorem shapedF_smooth : ContDiffOn ℝ ∞ c.shapedF A.referenceInput.radialDomain.carrier := by @@ -1544,12 +1544,12 @@ namespace Controls variable {F : Profile} {A : AxisStage F} (c : Controls A) /-- Separation, given by `ShapeTransition.separation c.shapeTime A.normalization F.data.core.P`. -/ -noncomputable def separation : ℝ := ShapeTransition.separation c.shapeTime A.normalization +@[expose] noncomputable def separation : ℝ := ShapeTransition.separation c.shapeTime A.normalization F.data.core.P /-- Raw U, given by `ShapeTransition.scaledFamily c.radius c.seedU`. -/ -noncomputable def rawU : Field := ShapeTransition.scaledFamily c.radius c.seedU +@[expose] noncomputable def rawU : Field := ShapeTransition.scaledFamily c.radius c.seedU /-- Raw F, given by `ShapeTransition.scaledFamily c.radius c.shapedF`. -/ -noncomputable def rawF : Field := ShapeTransition.scaledFamily c.radius c.shapedF +@[expose] noncomputable def rawF : Field := ShapeTransition.scaledFamily c.radius c.shapedF /-- Raw rows as an element of `Debt`. -/ noncomputable def rawRows (r eta : ℝ) : Debt := ![ShapeTransition.rowM c.rawU r eta, ShapeTransition.rowI c.radius c.rawF r eta, @@ -2460,7 +2460,7 @@ variable {F : Profile} {A : AxisStage F} (c : Controls A) noncomputable def extendedE (coef : ℝ → ExtendedHeatedOutgoing.Coeff) (p : Point) : ℝ := c.E p + c.heatBlend p.1 * (ExtendedHeatedOutgoing.E F c.radius coef p - c.E p) /-- Extendedf, with branches according to `p.1 ≤ Xi`. -/ -noncomputable def extendedf (coef : ℝ → ExtendedHeatedOutgoing.Coeff) (p : Point) : ℝ := +@[expose] noncomputable def extendedf (coef : ℝ → ExtendedHeatedOutgoing.Coeff) (p : Point) : ℝ := if p.1 ≤ Xi then c.f p else c.extendedE coef p / Real.sqrt (2 * p.1) /-- Extended pi, given by `F.axisDatum p.2 + ProfileHistories.primitive (fun q => c.extendedf coef q ^ 2) p`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/NormalScaling.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/NormalScaling.lean index ddbb335d6f..858452224d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/NormalScaling.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/NormalScaling.lean @@ -18,7 +18,7 @@ velocity amplitude by `amp`. The projected equation then scales by the totalized zero-normal case. -/ -@[expose] public section +public section namespace NavierStokes.NormalScaling diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneCorrectionExtensions.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneCorrectionExtensions.lean index f8fb6f82cc..d4bab1e02a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneCorrectionExtensions.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneCorrectionExtensions.lean @@ -19,7 +19,7 @@ mean operations. Agreement of primitive data is on whole slow fibers, because radial and torus integrals are nonlocal on each such fiber. -/ -@[expose] public section +public section noncomputable section @@ -792,7 +792,7 @@ abbrev Space := ProblemStatement.Space abbrev SpaceTime := ProblemStatement.SpaceTime /-- Physical slow, given by `(1 - w.1, w.2 2)`. -/ -noncomputable def physicalSlow (w : SpaceTime) : Slow := (1 - w.1, w.2 2) +@[expose] noncomputable def physicalSlow (w : SpaceTime) : Slow := (1 - w.1, w.2 2) theorem physicalSlow_contDiff : ContDiff ℝ ∞ physicalSlow := (contDiff_const.sub contDiff_fst).prodMk @@ -800,11 +800,11 @@ theorem physicalSlow_contDiff : ContDiff ℝ ∞ physicalSlow := /-- The actual radial/slow/native-graph restriction of a full-fiber mean field. The common covering level remains the supplied `n`. -/ -noncomputable def physicalLift (h : ℝ) (n : ℕ) (w : SpaceTime) : Lift := +@[expose] noncomputable def physicalLift (h : ℝ) (n : ℕ) (w : SpaceTime) : Lift := (AnnularEndpoint.radius w, (physicalSlow w, PhysicalGraphBounds.nativeGraph h n w)) /-- Physical domain, given by `physicalSlow ⁻¹' U`. -/ -noncomputable def physicalDomain (U : Set Slow) : Set SpaceTime := physicalSlow ⁻¹' U +@[expose] noncomputable def physicalDomain (U : Set Slow) : Set SpaceTime := physicalSlow ⁻¹' U theorem physicalDomain_open {U : Set Slow} (hU : IsOpen U) : IsOpen (physicalDomain U) := hU.preimage physicalSlow_contDiff.continuous @@ -833,7 +833,7 @@ theorem physicalLift_contDiffAt (h : ℝ) (n : ℕ) {w : SpaceTime} (PhysicalGraphBounds.contDiffAt_nativeGraph h n hw)) /-- Physical scalar, given by `f ∘ physicalLift h n`. -/ -noncomputable def physicalScalar (h : ℝ) (n : ℕ) (f : Lift → ℝ) : SpaceTime → ℝ := +@[expose] noncomputable def physicalScalar (h : ℝ) (n : ℕ) (f : Lift → ℝ) : SpaceTime → ℝ := f ∘ physicalLift h n theorem physicalScalar_zero_germ (h : ℝ) (n : ℕ) {U : Set Slow} (hU : IsOpen U) @@ -864,6 +864,7 @@ theorem physicalScalar_smooth (h : ℝ) (n : ℕ) {U : Set Slow} (hU : IsOpen U) /-- `streamPotential` is already the azimuthal component of the vector potential, including its division by the radial variable. -/ +@[expose] noncomputable def azimuthalPotential (h : ℝ) (n : ℕ) (f : Lift → ℝ) (w : SpaceTime) : Space := (-w.2 1 / AnnularEndpoint.radius w * physicalScalar h n f w) • ProblemStatement.coordinateVector 0 + @@ -872,7 +873,7 @@ noncomputable def azimuthalPotential (h : ℝ) (n : ℕ) (f : Lift → ℝ) (w : /-- A direct angular velocity uses the same Cartesian multiplication by `e_theta`. This definition does not apply a curl or a radial primitive. -/ -noncomputable def angularField (h : ℝ) (n : ℕ) (f : Lift → ℝ) : SpaceTime → Space := +@[expose] noncomputable def angularField (h : ℝ) (n : ℕ) (f : Lift → ℝ) : SpaceTime → Space := azimuthalPotential h n f theorem azimuthalPotential_smooth (h : ℝ) (n : ℕ) {U : Set Slow} (hU : IsOpen U) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneJetExtensions.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneJetExtensions.lean index eb13ef1585..1f0fffa24e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneJetExtensions.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OffplaneJetExtensions.lean @@ -34,7 +34,7 @@ normal-jet gluing argument is generalized from `SpacetimeGluing`; no existing project source is altered and no extension or closed-side regularity is assumed. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -916,7 +916,7 @@ end end -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingCone.lean index bfcb932d22..6fdc322d71 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingCone.lean @@ -19,7 +19,7 @@ through every interval. The true additional inequality starts at the shaped hold; the early outgoing region only requires the relaxed cone. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingEntranceCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingEntranceCone.lean index b7506f933c..fc316a25dc 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingEntranceCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingEntranceCone.lean @@ -18,7 +18,7 @@ All lags below include the ideal incoming history. The scalar averages are integrals of the constructed schedule, and no cone estimate is assumed. -/ -@[expose] public section +public section noncomputable section @@ -41,7 +41,7 @@ theorem integral_exp_mul_real {a : ℝ} (ha : a ≠ 0) (y : ℝ) : simpa only [mul_zero, Real.exp_zero, sub_div] using hi /-- Exponential averaging with the actual incoming history at clock zero. -/ -noncomputable def historyAverage (b : ℝ → ℝ) (b₀ y : ℝ) : ℝ := +@[expose] noncomputable def historyAverage (b : ℝ → ℝ) (b₀ y : ℝ) : ℝ := linearLag (fun _ => 1) b b₀ y theorem historyAverage_formula (b : ℝ → ℝ) (b₀ y : ℝ) : @@ -116,7 +116,7 @@ theorem historyAverage_late {b : ℝ → ℝ} (hbc : Continuous b) {b₀ a y : rw [← mul_assoc, he] /-- The actual average axial coefficient; the incoming value integrates `k=4`. -/ -noncomputable def averagedDrop (c : Parameters) : ℝ → ℝ := +@[expose] noncomputable def averagedDrop (c : Parameters) : ℝ → ℝ := historyAverage (dropCoefficient c.m) 4 /-- The squared axial history; the incoming value integrates `k²=16`. -/ @@ -182,7 +182,7 @@ theorem averagedDrop_small_on_second_ramp (c : Parameters) {y : ℝ} nlinarith [Real.exp_pos (-(y - Real.exp c.m))] /-- Shape gradient, given by `2 * η / (1 + η ^ 2)`. -/ -noncomputable def shapeGradient (η : ℝ) : ℝ := 2 * η / (1 + η ^ 2) +@[expose] noncomputable def shapeGradient (η : ℝ) : ℝ := 2 * η / (1 + η ^ 2) theorem shapeGradient_contDiff : ContDiff ℝ ∞ shapeGradient := (contDiff_const.mul contDiff_id).div (contDiff_const.add (contDiff_id.pow 2)) @@ -252,15 +252,15 @@ theorem exists_small_dropSpeed {e : ℝ} (he : 0 < e) : /-! ## The actual angular source and its ideal incoming lag -/ /-- Transport W, given by `1 - L h η * averagedDrop c y`. -/ -noncomputable def transportW (c : Parameters) (h y η : ℝ) : ℝ := +@[expose] noncomputable def transportW (c : Parameters) (h y η : ℝ) : ℝ := 1 - L h η * averagedDrop c y /-- Angular rate, given by `1 + slope c.dropLength c.lam y`. -/ -noncomputable def angularRate (c : Parameters) (y : ℝ) : ℝ := +@[expose] noncomputable def angularRate (c : Parameters) (y : ℝ) : ℝ := 1 + slope c.dropLength c.lam y /-- Angular source as an element of `ℝ`. -/ -noncomputable def angularSource (c : Parameters) (h η y : ℝ) : ℝ := +@[expose] noncomputable def angularSource (c : Parameters) (h η y : ℝ) : ℝ := -slope c.dropLength c.lam y * transportW c h y η - h * (1 - 2 * dropCoefficient c.m y * η ^ 2) + (D h + d η * dropCoefficient c.m y) * η * shapeGradient η @@ -272,11 +272,11 @@ noncomputable def idealAngularSource (h η : ℝ) : ℝ := (D h + 4 * d η) * η * shapeGradient η /-- Ideal angular lag, given by `idealAngularSource h η / (8 / 5)`. -/ -noncomputable def idealAngularLag (h η : ℝ) : ℝ := idealAngularSource h η / (8 / 5) +@[expose] noncomputable def idealAngularLag (h η : ℝ) : ℝ := idealAngularSource h η / (8 / 5) /-- Angular lag, given by `linearLag (angularRate c) (angularSource c h η) (idealAngularLag h η)`. -/ -noncomputable def angularLag (c : Parameters) (h η : ℝ) : ℝ → ℝ := +@[expose] noncomputable def angularLag (c : Parameters) (h η : ℝ) : ℝ → ℝ := linearLag (angularRate c) (angularSource c h η) (idealAngularLag h η) theorem angularRate_contDiff (c : Parameters) : ContDiff ℝ ∞ (angularRate c) := @@ -577,7 +577,7 @@ noncomputable def averagedClockEnergy (c : Parameters) : ℝ → ℝ := historyAverage (clockEnergy c) ((5 / 6) * c.P ^ 2) /-- Averaged energy, given by `shape η ^ 2 * averagedClockEnergy c y`. -/ -noncomputable def averagedEnergy (c : Parameters) (y η : ℝ) : ℝ := +@[expose] noncomputable def averagedEnergy (c : Parameters) (y η : ℝ) : ℝ := shape η ^ 2 * averagedClockEnergy c y theorem clockEnergy_contDiff (c : Parameters) : ContDiff ℝ ∞ (clockEnergy c) := @@ -702,17 +702,17 @@ theorem averagedClockEnergy_ideal (c : Parameters) {y : ℝ} (hy : y ≤ 0) : /-- Pressure clock, given by `(5 / 2) * c.P ^ 2 + (1 / 2) * OutgoingSchedule.primitive (clockEnergy c) y`. -/ -noncomputable def pressureClock (c : Parameters) (y : ℝ) : ℝ := +@[expose] noncomputable def pressureClock (c : Parameters) (y : ℝ) : ℝ := (5 / 2) * c.P ^ 2 + (1 / 2) * OutgoingSchedule.primitive (clockEnergy c) y /-- Entrance pressure, given by `SchedulePressure.axisPressure v η + shape η ^ 2 * pressureClock v.core y`. -/ -noncomputable def entrancePressure (v : TailData) (y η : ℝ) : ℝ := +@[expose] noncomputable def entrancePressure (v : TailData) (y η : ℝ) : ℝ := SchedulePressure.axisPressure v η + shape η ^ 2 * pressureClock v.core y /-- Pressure gradient, given by `deriv (SchedulePressure.axisPressure v) η - 2 * shapeGradient η * shape η ^ 2 * pressureClock v.core y`. -/ -noncomputable def pressureGradient (v : TailData) (y η : ℝ) : ℝ := +@[expose] noncomputable def pressureGradient (v : TailData) (y η : ℝ) : ℝ := deriv (SchedulePressure.axisPressure v) η - 2 * shapeGradient η * shape η ^ 2 * pressureClock v.core y @@ -805,32 +805,32 @@ theorem transportW_hasDerivAt (c : Parameters) (h y η : ℝ) : ring /-- The part of the axial lag arising from the actual mass and squared-axial histories. -/ -noncomputable def geometricAxialLag (c : Parameters) (h y η : ℝ) : ℝ := +@[expose] noncomputable def geometricAxialLag (c : Parameters) (h y η : ℝ) : ℝ := -transportW c h y η * dropCoefficient c.m y * η + (4 * h * η ^ 3 - 2 * d η * η) * averagedDropSquare c y /-- The pressure and angular-energy part of the integrated axial lag. -/ -noncomputable def pressureAxialLag (v : TailData) (y η : ℝ) : ℝ := +@[expose] noncomputable def pressureAxialLag (v : TailData) (y η : ℝ) : ℝ := -(2 * v.h * η + d η * shapeGradient η) * averagedEnergy v.core y η + 4 * A v.h * η * entrancePressure v y η - d η * pressureGradient v y η /-- Axial lag, given by `geometricAxialLag v.core v.h y η + pressureAxialLag v y η`. -/ -noncomputable def axialLag (v : TailData) (y η : ℝ) : ℝ := +@[expose] noncomputable def axialLag (v : TailData) (y η : ℝ) : ℝ := geometricAxialLag v.core v.h y η + pressureAxialLag v y η /-- Geometric axial source as an element of `ℝ`. -/ -noncomputable def geometricAxialSource (c : Parameters) (h y η : ℝ) : ℝ := +@[expose] noncomputable def geometricAxialSource (c : Parameters) (h y η : ℝ) : ℝ := -transportW c h y η * deriv (dropCoefficient c.m) y * η - A h * (1 - 2 * dropCoefficient c.m y * η ^ 2) * (dropCoefficient c.m y * η) - (D h + d η * dropCoefficient c.m y) * η * dropCoefficient c.m y /-- Pressure axial source as an element of `ℝ`. -/ -noncomputable def pressureAxialSource (v : TailData) (y η : ℝ) : ℝ := +@[expose] noncomputable def pressureAxialSource (v : TailData) (y η : ℝ) : ℝ := -d η * pressureGradient v y η + 4 * A v.h * η * entrancePressure v y η + η * angular v.core.P v.core.dropLength v.core.lam (y, η) ^ 2 /-- Axial source, given by `geometricAxialSource v.core v.h y η + pressureAxialSource v y η`. -/ -noncomputable def axialSource (v : TailData) (y η : ℝ) : ℝ := +@[expose] noncomputable def axialSource (v : TailData) (y η : ℝ) : ℝ := geometricAxialSource v.core v.h y η + pressureAxialSource v y η theorem geometricAxialLag_hasDerivAt (c : Parameters) (h y η : ℝ) : @@ -1078,7 +1078,7 @@ noncomputable def directionRatio (v : TailData) (y η : ℝ) : ℝ := (angular v.core.P v.core.dropLength v.core.lam (y, η) * angularLag v.core v.h η y) /-- Radial A, given by `2 - 2 * slope c.dropLength c.lam y`. -/ -noncomputable def radialA (c : Parameters) (y : ℝ) : ℝ := +@[expose] noncomputable def radialA (c : Parameters) (y : ℝ) : ℝ := 2 - 2 * slope c.dropLength c.lam y theorem shear_is_actual (c : Parameters) (amp : ℝ → ℝ) {y : ℝ} @@ -1286,14 +1286,14 @@ theorem shape_interval {η : ℝ} (hη : |η| ≤ 1) : (1 / 2 : ℝ) ≤ shape · exact div_le_self (by norm_num) (by linarith [sq_nonneg η]) /-- Entrance time, given by `Real.exp m + 12`. -/ -noncomputable def entranceTime (m : ℝ) : ℝ := Real.exp m + 12 +@[expose] noncomputable def entranceTime (m : ℝ) : ℝ := Real.exp m + 12 theorem holdStart_eq_entranceTime (c : Parameters) : c.holdStart = entranceTime c.m := by unfold Parameters.holdStart Parameters.dropLength entranceTime ring /-- Energy envelope, given by `P ^ 2 * Real.exp (2 * T)`. -/ -noncomputable def energyEnvelope (P T : ℝ) : ℝ := P ^ 2 * Real.exp (2 * T) +@[expose] noncomputable def energyEnvelope (P T : ℝ) : ℝ := P ^ 2 * Real.exp (2 * T) theorem clockEnergy_le_envelope (c : Parameters) {y T : ℝ} (hy : 0 ≤ y) (hyT : y ≤ T) : clockEnergy c y ≤ energyEnvelope c.P T := by @@ -1479,6 +1479,7 @@ theorem linearLag_eq_of_solution {r b f : ℝ → ℝ} (hr : Continuous r) theorem canonical_Ubar_before (v : TailData) (Amp : ℝ → ℝ) {y : ℝ} (hy : y ≤ v.core.pulseStart) (η : ℝ) : OutgoingHistories.Ubar v Amp (y, η) = averagedDrop v.core y * η := by + rw [OutgoingHistories.Ubar, OutgoingHistories.M_eq_massMoment, OutgoingHistories.X] exact averagedDrop_is_mass_history v.core Amp η hy theorem canonical_Ubar_parameter_before (v : TailData) {Amp : ℝ → ℝ} @@ -1978,13 +1979,13 @@ noncomputable def coneA {v : TailData} {K : ℝ} /-- Cone B, given by `2 * OutgoingHistories.dY (OutgoingHistories.U v Amp) p / OutgoingHistories.E w p`. -/ -noncomputable def coneB {v : TailData} {K : ℝ} +@[expose] noncomputable def coneB {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := 2 * OutgoingHistories.dY (OutgoingHistories.U v Amp) p / OutgoingHistories.E w p /-- Cone ratio, given by `OutgoingHistories.Ns w Amp p / (OutgoingHistories.E w p * OutgoingHistories.Qs w Amp p)`. -/ -noncomputable def coneRatio {v : TailData} {K : ℝ} +@[expose] noncomputable def coneRatio {v : TailData} {K : ℝ} (w : UniformAngularReset.ResetWitness v K) (Amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := OutgoingHistories.Ns w Amp p / (OutgoingHistories.E w p * OutgoingHistories.Qs w Amp p) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingHistories.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingHistories.lean index f15050c78e..66a6fe4168 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingHistories.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingHistories.lean @@ -25,7 +25,7 @@ radius `XR`, the physical factors are `XR` for `M,S` and `XR * sqrt (2*XR)` for `I,J`. These factors cancel from both normalized lags. -/ -@[expose] public section +public section noncomputable section @@ -48,7 +48,7 @@ noncomputable abbrev dY := ProfileHistories.radialPartial noncomputable abbrev dEta := ProfileHistories.parameterPartial /-- The whole log-coordinate plane; this is not a radial domain at `X=0`. -/ -noncomputable def logDomain : ProfileHistories.RadialDomain where +@[expose] noncomputable def logDomain : ProfileHistories.RadialDomain where carrier := univ isOpen := isOpen_univ scale_mem := by intros; trivial @@ -74,7 +74,7 @@ theorem dEta_smooth {f : Field} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (dE contDiffOn_univ.mp (ProfileHistories.parameterPartial_smooth logDomain hf.contDiffOn) /-- A fixed incoming integral plus a finite log-coordinate integral. -/ -noncomputable def history (initial : ℝ → ℝ) (f : Field) (p : Point) : ℝ := +@[expose] noncomputable def history (initial : ℝ → ℝ) (f : Field) (p : Point) : ℝ := initial p.2 + ProfileHistories.primitive f p theorem prefix_smooth {initial : ℝ → ℝ} {f : Field} @@ -115,7 +115,7 @@ theorem dEta_mul {f g : Field} (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ (dEta_hasDerivAt (hf.mul hg) p).unique ((dEta_hasDerivAt hf p).mul (dEta_hasDerivAt hg p)) /-- X, given by `Real.exp p.1`. -/ -noncomputable def X (p : Point) : ℝ := Real.exp p.1 +@[expose] noncomputable def X (p : Point) : ℝ := Real.exp p.1 theorem X_pos (p : Point) : 0 < X p := Real.exp_pos _ theorem X_smooth : ContDiff ℝ ∞ X := contDiff_fst.exp @@ -127,11 +127,11 @@ theorem dEta_X (p : Point) : dEta X p = 0 := variable {d : TailData} {K : ℝ} /-- E, given by `correctedAngular d w.coefficients`. -/ -noncomputable def E (w : ResetWitness d K) : Field := correctedAngular d w.coefficients +@[expose] noncomputable def E (w : ResetWitness d K) : Field := correctedAngular d w.coefficients /-- U, given by `axial d.core Amp`. -/ -noncomputable def U (d : TailData) (Amp : ℝ → ℝ) : Field := axial d.core Amp +@[expose] noncomputable def U (d : TailData) (Amp : ℝ → ℝ) : Field := axial d.core Amp /-- H, given by `Real.exp (p.1 / 2) * E w p`. -/ -noncomputable def H (w : ResetWitness d K) (p : Point) : ℝ := Real.exp (p.1 / 2) * E w p +@[expose] noncomputable def H (w : ResetWitness d K) (p : Point) : ℝ := Real.exp (p.1 / 2) * E w p /-- Mass weight, given by `X p * U d Amp p`. -/ noncomputable def massWeight (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := X p * U d Amp p @@ -141,13 +141,13 @@ noncomputable def angularWeight (w : ResetWitness d K) (p : Point) : ℝ := X p noncomputable def transportWeight (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := X p * (U d Amp p * H w p) /-- Energy density, given by `U d Amp p ^ 2 - E w p ^ 2 / 2`. -/ -noncomputable def energyDensity (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := +@[expose] noncomputable def energyDensity (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := U d Amp p ^ 2 - E w p ^ 2 / 2 /-- Energy weight, given by `X p * energyDensity w Amp p`. -/ -noncomputable def energyWeight (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := +@[expose] noncomputable def energyWeight (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := X p * energyDensity w Amp p /-- Pressure weight, given by `E w p ^ 2 / 2`. -/ -noncomputable def pressureWeight (w : ResetWitness d K) (p : Point) : ℝ := E w p ^ 2 / 2 +@[expose] noncomputable def pressureWeight (w : ResetWitness d K) (p : Point) : ℝ := E w p ^ 2 / 2 /-- Initial M, given by `4 * eta`. -/ noncomputable def initialM (eta : ℝ) : ℝ := 4 * eta @@ -156,11 +156,11 @@ noncomputable def initialI (d : TailData) (eta : ℝ) : ℝ := (5 / 8) * d.core. /-- Initial J, given by `(5 / 2) * d.core.P * eta * shape eta`. -/ noncomputable def initialJ (d : TailData) (eta : ℝ) : ℝ := (5 / 2) * d.core.P * eta * shape eta /-- Initial S, given by `16 * eta ^ 2 - (5 / 12) * d.core.P ^ 2 * shape eta ^ 2`. -/ -noncomputable def initialS (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def initialS (d : TailData) (eta : ℝ) : ℝ := 16 * eta ^ 2 - (5 / 12) * d.core.P ^ 2 * shape eta ^ 2 /-- Initial pi, given by `SchedulePressure.axisPressure d eta + (5 / 2) * d.core.P ^ 2 * shape eta ^ 2`. -/ -noncomputable def initialPi (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def initialPi (d : TailData) (eta : ℝ) : ℝ := SchedulePressure.axisPressure d eta + (5 / 2) * d.core.P ^ 2 * shape eta ^ 2 /-- M, given by `history initialM (massWeight d Amp)`. -/ @@ -171,9 +171,10 @@ noncomputable def I (w : ResetWitness d K) : Field := history (initialI d) (angu noncomputable def J (w : ResetWitness d K) (Amp : ℝ → ℝ) : Field := history (initialJ d) (transportWeight w Amp) /-- S, given by `history (initialS d) (energyWeight w Amp)`. -/ -noncomputable def S (w : ResetWitness d K) (Amp : ℝ → ℝ) : Field := history (initialS d) +@[expose] noncomputable def S (w : ResetWitness d K) (Amp : ℝ → ℝ) : Field := history (initialS d) (energyWeight w Amp) /-- Pi, given by `history (initialPi d) (pressureWeight w)`. -/ +@[expose] noncomputable def Pi (w : ResetWitness d K) : Field := history (initialPi d) (pressureWeight w) theorem E_smooth (w : ResetWitness d K) : ContDiff ℝ ∞ (E w) := @@ -324,19 +325,20 @@ theorem dEta_Pi_hasDerivAt (w : ResetWitness d K) (p : Point) : /-- XW, given by `X p - 2 * axialExponent d.h * p.2 * M d Amp p - coordinateFactor p.2 * dEta (M d Amp) p`. -/ -noncomputable def XW (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := +@[expose] noncomputable def XW (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := X p - 2 * axialExponent d.h * p.2 * M d Amp p - coordinateFactor p.2 * dEta (M d Amp) p /-- W, given by `XW d Amp p / X p`. -/ -noncomputable def W (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := XW d Amp p / X p +@[expose] noncomputable def W (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := XW d Amp p / X p /-- Ubar, given by `M d Amp p / X p`. -/ -noncomputable def Ubar (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := M d Amp p / X p +@[expose] noncomputable def Ubar (d : TailData) (Amp : ℝ → ℝ) (p : Point) : ℝ := M d Amp p / X p /-- Angular source as an element of `ℝ`. -/ -noncomputable def angularSource (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := +@[expose] noncomputable def angularSource (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := -W d Amp p * dY (H w) p - d.h * (1 - 2 * p.2 * U d Amp p) * H w p - (axialExponent d.h * p.2 + coordinateFactor p.2 * U d Amp p) * dEta (H w) p /-- Sq, given by `angularSource w Amp p / H w p`. -/ +@[expose] noncomputable def Sq (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := angularSource w Amp p / H w p @@ -552,7 +554,7 @@ theorem U_before_pulse (d : TailData) (Amp : ℝ → ℝ) (eta : ℝ) {y : ℝ} U d Amp (y, eta) = dropCoefficient d.core.m y * eta := axial_before_pulse d.core Amp eta hy theorem M_eq_massMoment (d : TailData) (Amp : ℝ → ℝ) (y eta : ℝ) : - M d Amp (y, eta) = massMoment d.core Amp eta y := rfl + M d Amp (y, eta) = massMoment d.core Amp eta y := by rfl theorem M_div_E_before (w : ResetWitness d K) (Amp : ℝ → ℝ) (eta : ℝ) {y : ℝ} (hy : y ≤ d.core.endpoint) : @@ -1029,7 +1031,7 @@ theorem Pi_ideal (w : ResetWitness d K) (eta : ℝ) {y : ℝ} (hy : y ≤ 0) : ring /-- Shape rate, given by `2 * eta / (1 + eta ^ 2)`. -/ -noncomputable def shapeRate (eta : ℝ) : ℝ := 2 * eta / (1 + eta ^ 2) +@[expose] noncomputable def shapeRate (eta : ℝ) : ℝ := 2 * eta / (1 + eta ^ 2) theorem dEta_E_ideal (w : ResetWitness d K) (eta : ℝ) {y : ℝ} (hy : y ≤ 0) : dEta (E w) (y, eta) = -(E w (y, eta) * shapeRate eta) := by @@ -1251,7 +1253,7 @@ theorem Ns_eq_source_integral (w : ResetWitness d K) {Amp : ℝ → ℝ} /-! ## Entrance-radius factors -/ /-- Physical X, given by `XR * X p`. -/ -noncomputable def physicalX (XR : ℝ) (p : Point) : ℝ := XR * X p +@[expose] noncomputable def physicalX (XR : ℝ) (p : Point) : ℝ := XR * X p /-- Physical H, given by `Real.sqrt (2 * XR) * H w p`. -/ noncomputable def physicalH (XR : ℝ) (w : ResetWitness d K) (p : Point) : ℝ := Real.sqrt (2 * XR) * H w p @@ -1340,10 +1342,10 @@ theorem Ns_dilation (XR : ℝ) (hXR : 0 < XR) (w : ResetWitness d K) field_simp [hXR.ne', (X_pos p).ne'] /-- P1, given by `physicalX XR p * Qs w Amp p / (1 - 2 * d.h * p.2 ^ 2)`. -/ -noncomputable def p1 (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := +@[expose] noncomputable def p1 (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := physicalX XR p * Qs w Amp p / (1 - 2 * d.h * p.2 ^ 2) /-- P2, given by `physicalX XR p * Ns w Amp p / ((1 - 2 * d.h * p.2 ^ 2) * E w p)`. -/ -noncomputable def p2 (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := +@[expose] noncomputable def p2 (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : ℝ := physicalX XR p * Ns w Amp p / ((1 - 2 * d.h * p.2 ^ 2) * E w p) theorem p1_dilation (XR : ℝ) (w : ResetWitness d K) (Amp : ℝ → ℝ) (p : Point) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingProfile.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingProfile.lean index d96039918f..682c1f5122 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingProfile.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingProfile.lean @@ -20,7 +20,7 @@ amplitude is the corrected energy root associated with that same witness. All histories and pressures below are integrals of these fields. -/ -@[expose] public section +public section noncomputable section @@ -44,31 +44,31 @@ structure Profile where namespace Profile /-- Amp, given by `CorrectedPulseAmplitude.amplitude F.data F.reset.coefficients`. -/ -def amp (F : Profile) : ℝ → ℝ := +@[expose] def amp (F : Profile) : ℝ → ℝ := CorrectedPulseAmplitude.amplitude F.data F.reset.coefficients /-- Log E, given by `correctedAngular F.data F.reset.coefficients`. -/ -def logE (F : Profile) : ℝ × ℝ → ℝ := +@[expose] def logE (F : Profile) : ℝ × ℝ → ℝ := correctedAngular F.data F.reset.coefficients /-- Log U, given by `axial F.data.core F.amp`. -/ -def logU (F : Profile) : ℝ × ℝ → ℝ := axial F.data.core F.amp +@[expose] def logU (F : Profile) : ℝ × ℝ → ℝ := axial F.data.core F.amp /-- E, given by `F.logE (Real.log p.1, p.2)`. -/ -def E (F : Profile) (p : ℝ × ℝ) : ℝ := F.logE (Real.log p.1, p.2) +@[expose] def E (F : Profile) (p : ℝ × ℝ) : ℝ := F.logE (Real.log p.1, p.2) /-- U, given by `F.logU (Real.log p.1, p.2)`. -/ -def U (F : Profile) (p : ℝ × ℝ) : ℝ := F.logU (Real.log p.1, p.2) +@[expose] def U (F : Profile) (p : ℝ × ℝ) : ℝ := F.logU (Real.log p.1, p.2) /-- H, given by `Real.sqrt (2 * p.1) * F.E p`. -/ -def H (F : Profile) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * p.1) * F.E p +@[expose] def H (F : Profile) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * p.1) * F.E p /-- Power E, given by `powerConstant F.data * X ^ (-(1 / 2 + F.data.h))`. -/ -def powerE (F : Profile) (X : ℝ) : ℝ := +@[expose] def powerE (F : Profile) (X : ℝ) : ℝ := powerConstant F.data * X ^ (-(1 / 2 + F.data.h)) /-- Power H, given by `Real.sqrt (2 * X) * F.powerE X`. -/ -def powerH (F : Profile) (X : ℝ) : ℝ := Real.sqrt (2 * X) * F.powerE X +@[expose] def powerH (F : Profile) (X : ℝ) : ℝ := Real.sqrt (2 * X) * F.powerE X /-- Mass weight, given by `Real.exp y * F.logU (y, eta)`. -/ def massWeight (F : Profile) (eta y : ℝ) : ℝ := Real.exp y * F.logU (y, eta) @@ -79,17 +79,17 @@ def angularWeight (F : Profile) (eta y : ℝ) : ℝ := Real.sqrt 2 * Real.exp (3 * y / 2) * F.logE (y, eta) * F.logU (y, eta) /-- M, given by `∫ u in Ioc 0 X, F.U (u, eta)`. -/ -def M (F : Profile) (eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, F.U (u, eta) +@[expose] def M (F : Profile) (eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, F.U (u, eta) /-- J, given by `∫ u in Ioc 0 X, F.H (u, eta) * F.U (u, eta)`. -/ -def J (F : Profile) (eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, F.H (u, eta) * F.U (u, eta) +@[expose] def J (F : Profile) (eta X : ℝ) : ℝ := ∫ u in Ioc 0 X, F.H (u, eta) * F.U (u, eta) /-- Energy density, given by `F.U (X, eta) ^ 2 - F.E (X, eta) ^ 2 / 2`. -/ -def energyDensity (F : Profile) (eta X : ℝ) : ℝ := +@[expose] def energyDensity (F : Profile) (eta X : ℝ) : ℝ := F.U (X, eta) ^ 2 - F.E (X, eta) ^ 2 / 2 /-- Total S, given by `∫ X in Ioi 0, F.energyDensity eta X`. -/ -def totalS (F : Profile) (eta : ℝ) : ℝ := ∫ X in Ioi 0, F.energyDensity eta X +@[expose] def totalS (F : Profile) (eta : ℝ) : ℝ := ∫ X in Ioi 0, F.energyDensity eta X /-- Pressure weight, given by `F.logE (y, eta) ^ 2`. -/ def pressureWeight (F : Profile) (eta y : ℝ) : ℝ := F.logE (y, eta) ^ 2 @@ -99,10 +99,10 @@ def logPi (F : Profile) (p : ℝ × ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ y in Ioi p.1, F.pressureWeight p.2 y /-- Pi, given by `F.logPi (Real.log p.1, p.2)`. -/ -def Pi (F : Profile) (p : ℝ × ℝ) : ℝ := F.logPi (Real.log p.1, p.2) +@[expose] def Pi (F : Profile) (p : ℝ × ℝ) : ℝ := F.logPi (Real.log p.1, p.2) /-- Axis datum, given by `-(1 / 2 : ℝ) * ∫ y, F.pressureWeight eta y`. -/ -def axisDatum (F : Profile) (eta : ℝ) : ℝ := +@[expose] def axisDatum (F : Profile) (eta : ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ y, F.pressureWeight eta y /-- Pressure change, given by `F.pressureWeight eta y - finalAngular F.data (y, eta) ^ 2`. -/ @@ -178,7 +178,7 @@ theorem U_after (F : Profile) (eta : ℝ) {X : ℝ} end Profile /-- Domain, given by `Ioi 0 ×ˢ univ`. -/ -def domain : Set (ℝ × ℝ) := Ioi 0 ×ˢ univ +@[expose] def domain : Set (ℝ × ℝ) := Ioi 0 ×ˢ univ theorem logarithmic_coordinates_contDiffOn : ContDiffOn ℝ ∞ (fun p : ℝ × ℝ => (Real.log p.1, p.2)) domain := by @@ -567,7 +567,7 @@ theorem image_exp_Ioi (y : ℝ) : Real.exp '' Ioi y = Ioi (Real.exp y) := by namespace Profile /-- Canonical kernel, given by `F.E (X, eta) ^ 2 / X`. -/ -def canonicalKernel (F : Profile) (eta X : ℝ) : ℝ := F.E (X, eta) ^ 2 / X +@[expose] def canonicalKernel (F : Profile) (eta X : ℝ) : ℝ := F.E (X, eta) ^ 2 / X theorem canonicalKernel_comp_exp (F : Profile) (eta y : ℝ) : |Real.exp y| • F.canonicalKernel eta (Real.exp y) = F.pressureWeight eta y := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingSchedule.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingSchedule.lean index 9667e4eaee..d3f7895a4b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingSchedule.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/OutgoingSchedule.lean @@ -20,7 +20,7 @@ All functions below are actual formulas. Stage inequalities are hypotheses on real parameters, not assumptions that suitable profiles or corrections exist. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ namespace NavierStokes.OutgoingSchedule /-! ## The manuscript's smooth step -/ /-- Sigma, given by `FlatCutoff.edge 1 x / (FlatCutoff.edge 1 x + FlatCutoff.edge 1 (1 - x))`. -/ -def sigma (x : ℝ) : ℝ := +@[expose] def sigma (x : ℝ) : ℝ := FlatCutoff.edge 1 x / (FlatCutoff.edge 1 x + FlatCutoff.edge 1 (1 - x)) theorem sigma_denom_pos (x : ℝ) : @@ -88,7 +88,7 @@ theorem sigma_monotone : Monotone sigma := by /-! ## Smooth primitives and the single global slope -/ /-- Primitive, given by `∫ t in (0 : ℝ)..y, g t`. -/ -def primitive (g : ℝ → ℝ) (y : ℝ) : ℝ := ∫ t in (0 : ℝ)..y, g t +@[expose] def primitive (g : ℝ → ℝ) (y : ℝ) : ℝ := ∫ t in (0 : ℝ)..y, g t theorem primitive_hasDerivAt {g : ℝ → ℝ} (hg : Continuous g) (y : ℝ) : HasDerivAt (primitive g) (g y) y := @@ -117,7 +117,7 @@ theorem primitive_increment {g : ℝ → ℝ} (hg : Continuous g) (a b c : ℝ) simpa only [primitive, hi] using h.symm /-- Slope, given by `(3 / 5) * (1 - sigma y) - lam * sigma (y - (dropLength + 1))`. -/ -def slope (dropLength lam y : ℝ) : ℝ := +@[expose] def slope (dropLength lam y : ℝ) : ℝ := (3 / 5) * (1 - sigma y) - lam * sigma (y - (dropLength + 1)) theorem slope_contDiff (dropLength lam : ℝ) : ContDiff ℝ ∞ (slope dropLength lam) := @@ -138,18 +138,18 @@ theorem slope_hold {dropLength lam y : ℝ} (hd : 0 ≤ dropLength) sigma_one (by linarith : 1 ≤ y - (dropLength + 1))] /-- Log amplitude, given by `primitive (fun y => slope dropLength lam y - 1 / 2)`. -/ -def logAmplitude (dropLength lam : ℝ) : ℝ → ℝ := +@[expose] def logAmplitude (dropLength lam : ℝ) : ℝ → ℝ := primitive (fun y => slope dropLength lam y - 1 / 2) /-- Radial amplitude, given by `P * Real.exp (logAmplitude dropLength lam y)`. -/ -def radialAmplitude (P dropLength lam y : ℝ) : ℝ := +@[expose] def radialAmplitude (P dropLength lam y : ℝ) : ℝ := P * Real.exp (logAmplitude dropLength lam y) /-- Shape, given by `(1 + eta ^ 2)⁻¹`. -/ -def shape (eta : ℝ) : ℝ := (1 + eta ^ 2)⁻¹ +@[expose] def shape (eta : ℝ) : ℝ := (1 + eta ^ 2)⁻¹ /-- Angular, given by `radialAmplitude P dropLength lam p.1 * shape p.2`. -/ -def angular (P dropLength lam : ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def angular (P dropLength lam : ℝ) (p : ℝ × ℝ) : ℝ := radialAmplitude P dropLength lam p.1 * shape p.2 theorem logAmplitude_contDiff (dropLength lam : ℝ) : @@ -276,10 +276,10 @@ theorem initialAxial_contDiff {m : ℝ} (hm : 0 < m) : /-! ## The main pulse and fixed, separated repair intervals -/ /-- Pulse ramp, given by `primitive (fun z => sigma (50 * z))`. -/ -def pulseRamp : ℝ → ℝ := primitive (fun z => sigma (50 * z)) +@[expose] def pulseRamp : ℝ → ℝ := primitive (fun z => sigma (50 * z)) /-- Main pulse, given by `pulseRamp z * (1 - sigma (z - 10))`. -/ -def mainPulse (z : ℝ) : ℝ := pulseRamp z * (1 - sigma (z - 10)) +@[expose] def mainPulse (z : ℝ) : ℝ := pulseRamp z * (1 - sigma (z - 10)) theorem pulseRamp_contDiff : ContDiff ℝ ∞ pulseRamp := primitive_contDiff (sigma_contDiff.comp (contDiff_const.mul contDiff_id)) @@ -324,15 +324,15 @@ structure Parameters where namespace Parameters /-- Drop length, given by `Real.exp c.m + 10`. -/ -def dropLength (c : Parameters) : ℝ := Real.exp c.m + 10 +@[expose] def dropLength (c : Parameters) : ℝ := Real.exp c.m + 10 /-- Hold start, given by `c.dropLength + 2`. -/ -def holdStart (c : Parameters) : ℝ := c.dropLength + 2 +@[expose] def holdStart (c : Parameters) : ℝ := c.dropLength + 2 /-- Pulse start, given by `c.holdStart + c.wait`. -/ -def pulseStart (c : Parameters) : ℝ := c.holdStart + c.wait +@[expose] def pulseStart (c : Parameters) : ℝ := c.holdStart + c.wait /-- Pulse length, given by `13 / c.lam`. -/ -def pulseLength (c : Parameters) : ℝ := 13 / c.lam +@[expose] def pulseLength (c : Parameters) : ℝ := 13 / c.lam /-- Endpoint, given by `c.pulseStart + c.pulseLength`. -/ -def endpoint (c : Parameters) : ℝ := c.pulseStart + c.pulseLength +@[expose] def endpoint (c : Parameters) : ℝ := c.pulseStart + c.pulseLength theorem dropLength_pos (c : Parameters) : 0 < c.dropLength := by dsimp [dropLength] @@ -353,15 +353,15 @@ theorem pulseLength_pos (c : Parameters) : 0 < c.pulseLength := div_pos (by norm_num) c.lam_pos /-- Exponents, with branches according to `i = 0`. -/ -def exponents (c : Parameters) (i : Fin 2) : ℝ := +@[expose] def exponents (c : Parameters) (i : Fin 2) : ℝ := if i = 0 then -(1 / 2 + c.lam) else -(1 / 2 + 2 * c.lam) /-- The log supports lie inside `(L-3.15,L-2.85)` and `(L-1.15,L-.85)`. -/ -def lower (c : Parameters) (i : Fin 2) : ℝ := +@[expose] def lower (c : Parameters) (i : Fin 2) : ℝ := Real.exp (c.pulseLength - if i = 0 then 63 / 20 else 23 / 20) /-- Upper, given by `Real.exp (c.pulseLength - if i = 0 then 57 / 20 else 17 / 20)`. -/ -def upper (c : Parameters) (i : Fin 2) : ℝ := +@[expose] def upper (c : Parameters) (i : Fin 2) : ℝ := Real.exp (c.pulseLength - if i = 0 then 57 / 20 else 17 / 20) theorem exponents_injective (c : Parameters) : Injective c.exponents := by @@ -410,22 +410,22 @@ end Parameters /-! ## Explicit smooth debts and constructed corrections -/ /-- Prefix M, given by `4 + ∫ y in (0 : ℝ)..c.pulseStart, Real.exp y * dropCoefficient c.m y`. -/ -def prefixM (c : Parameters) : ℝ := +@[expose] def prefixM (c : Parameters) : ℝ := 4 + ∫ y in (0 : ℝ)..c.pulseStart, Real.exp y * dropCoefficient c.m y /-- Prefix J as an element of `ℝ`. -/ -def prefixJ (c : Parameters) : ℝ := +@[expose] def prefixJ (c : Parameters) : ℝ := (5 / 2) * Real.sqrt 2 * c.P + ∫ y in (0 : ℝ)..c.pulseStart, Real.sqrt 2 * Real.exp (3 * y / 2) * radialAmplitude c.P c.dropLength c.lam y * dropCoefficient c.m y /-- Pulse amplitude, given by `radialAmplitude c.P c.dropLength c.lam c.pulseStart`. -/ -def pulseAmplitude (c : Parameters) : ℝ := +@[expose] def pulseAmplitude (c : Parameters) : ℝ := radialAmplitude c.P c.dropLength c.lam c.pulseStart /-- Moment scale, with branches according to `i = 0`. -/ -def momentScale (c : Parameters) (i : Fin 2) : ℝ := +@[expose] def momentScale (c : Parameters) (i : Fin 2) : ℝ := if i = 0 then Real.exp c.pulseStart * pulseAmplitude c else Real.sqrt 2 * Real.exp (3 * c.pulseStart / 2) * pulseAmplitude c ^ 2 @@ -440,17 +440,17 @@ theorem momentScale_pos (c : Parameters) (i : Fin 2) : 0 < momentScale c i := by (sq_pos_of_pos (pulseAmplitude_pos c)) /-- Prefix coefficient, given by `(if i = 0 then prefixM c else prefixJ c) / momentScale c i`. -/ -def prefixCoefficient (c : Parameters) (i : Fin 2) : ℝ := +@[expose] def prefixCoefficient (c : Parameters) (i : Fin 2) : ℝ := (if i = 0 then prefixM c else prefixJ c) / momentScale c i /-- Main moment, given by `∫ x in (1 : ℝ)..Real.exp c.pulseLength, x ^ c.exponents i * mainPulse (c.lam * Real.log x)`. -/ -def mainMoment (c : Parameters) (i : Fin 2) : ℝ := +@[expose] def mainMoment (c : Parameters) (i : Fin 2) : ℝ := ∫ x in (1 : ℝ)..Real.exp c.pulseLength, x ^ c.exponents i * mainPulse (c.lam * Real.log x) /-- Debt, given by `-(prefixCoefficient c i * eta * (1 + eta ^ 2) + amp eta * mainMoment c i)`. -/ -def debt (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) (i : Fin 2) : ℝ := +@[expose] def debt (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) (i : Fin 2) : ℝ := -(prefixCoefficient c i * eta * (1 + eta ^ 2) + amp eta * mainMoment c i) theorem debt_contDiff (c : Parameters) {amp : ℝ → ℝ} (ha : ContDiff ℝ ∞ amp) @@ -460,7 +460,7 @@ theorem debt_contDiff (c : Parameters) {amp : ℝ → ℝ} (ha : ContDiff ℝ /-- Correction, given by `LocalizedMomentRepair.repair c.exponents c.lower c.upper (debt c amp eta) x`. -/ -def correction (c : Parameters) (amp : ℝ → ℝ) (eta x : ℝ) : ℝ := +@[expose] def correction (c : Parameters) (amp : ℝ → ℝ) (eta x : ℝ) : ℝ := LocalizedMomentRepair.repair c.exponents c.lower c.upper (debt c amp eta) x theorem correction_exact (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) (i : Fin 2) : @@ -511,7 +511,7 @@ theorem correction_zero_late (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) {y /-- Pulse ratio, given by `amp p.2 * mainPulse (c.lam * p.1) + correction c amp p.2 (Real.exp p.1)`. -/ -def pulseRatio (c : Parameters) (amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def pulseRatio (c : Parameters) (amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := amp p.2 * mainPulse (c.lam * p.1) + correction c amp p.2 (Real.exp p.1) theorem pulseRatio_contDiff (c : Parameters) {amp : ℝ → ℝ} @@ -539,7 +539,7 @@ theorem pulseRatio_zero_late (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) {y /-- Axial, given by `initialAxial c.m p + angular c.P c.dropLength c.lam p * pulseRatio c amp (p.1 - c.pulseStart, p.2)`. -/ -def axial (c : Parameters) (amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def axial (c : Parameters) (amp : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := initialAxial c.m p + angular c.P c.dropLength c.lam p * pulseRatio c amp (p.1 - c.pulseStart, p.2) @@ -783,11 +783,11 @@ theorem angular_integrand_pulse (c : Parameters) (amp : ℝ → ℝ) (eta : ℝ) _ = _ := by rw [he]; ring /-- `X=e^y`; the first term is the exact mass of the ideal prefix `0 linarith /-- Release rate, given by `1 + releaseSlope d t`. -/ -def releaseRate (d : TailData) (t : ℝ) : ℝ := 1 + releaseSlope d t +@[expose] def releaseRate (d : TailData) (t : ℝ) : ℝ := 1 + releaseSlope d t /-- Release source, given by `-releaseSlope d t - d.h`. -/ -def releaseSource (d : TailData) (t : ℝ) : ℝ := -releaseSlope d t - d.h +@[expose] def releaseSource (d : TailData) (t : ℝ) : ℝ := -releaseSlope d t - d.h /-- Initial lag, given by `(d.core.lam - d.h) / (1 - d.core.lam)`. -/ -def initialLag (d : TailData) : ℝ := (d.core.lam - d.h) / (1 - d.core.lam) +@[expose] def initialLag (d : TailData) : ℝ := (d.core.lam - d.h) / (1 - d.core.lam) theorem initialLag_gt_h (d : TailData) : d.h < initialLag d := by apply (lt_div_iff₀ (show 0 < 1 - d.core.lam by linarith [d.core.lam_lt])).mpr @@ -385,7 +385,7 @@ theorem releaseSource_contDiff (d : TailData) : ContDiff ℝ ∞ (releaseSource /-- Linear lag, given by `Real.exp (-primitive a t) * (q + primitive (fun v => Real.exp (primitive a v) * b v) t)`. -/ -def linearLag (a b : ℝ → ℝ) (q : ℝ) (t : ℝ) : ℝ := +@[expose] def linearLag (a b : ℝ → ℝ) (q : ℝ) (t : ℝ) : ℝ := Real.exp (-primitive a t) * (q + primitive (fun v => Real.exp (primitive a v) * b v) t) @@ -412,7 +412,7 @@ theorem linearLag_hasDerivAt {a b : ℝ → ℝ} (ha : Continuous a) (hb : Conti linarith [congrArg (fun v : ℝ => v * b t) he] /-- Release lag, given by `linearLag (releaseRate d) (releaseSource d) (initialLag d)`. -/ -def releaseLag (d : TailData) : ℝ → ℝ := +@[expose] def releaseLag (d : TailData) : ℝ → ℝ := linearLag (releaseRate d) (releaseSource d) (initialLag d) theorem releaseLag_contDiff (d : TailData) : ContDiff ℝ ∞ (releaseLag d) := @@ -510,18 +510,18 @@ theorem decayHold_hits_target (d : TailData) : /-! ## One globally smooth positive angular profile -/ /-- Log shape, given by `Real.log (1 + eta ^ 2)`. -/ -def logShape (eta : ℝ) : ℝ := Real.log (1 + eta ^ 2) +@[expose] def logShape (eta : ℝ) : ℝ := Real.log (1 + eta ^ 2) theorem logShape_contDiff : ContDiff ℝ ∞ logShape := (contDiff_const.add (contDiff_id.pow 2)).log (fun eta => by positivity) /-- Flatten factor, given by `Real.exp (sigma ((p.1 - d.core.endpoint) / flattenLength) * (logShape p.2 - Real.log 2))`. -/ -def flattenFactor (d : TailData) (p : ℝ × ℝ) : ℝ := +@[expose] def flattenFactor (d : TailData) (p : ℝ × ℝ) : ℝ := Real.exp (sigma ((p.1 - d.core.endpoint) / flattenLength) * (logShape p.2 - Real.log 2)) /-- Flattened, given by `angular d.core.P d.core.dropLength d.core.lam p * flattenFactor d p`. -/ -def flattened (d : TailData) (p : ℝ × ℝ) : ℝ := +@[expose] def flattened (d : TailData) (p : ℝ × ℝ) : ℝ := angular d.core.P d.core.dropLength d.core.lam p * flattenFactor d p theorem flattenFactor_contDiff (d : TailData) : ContDiff ℝ ∞ (flattenFactor d) := @@ -558,7 +558,7 @@ theorem flattened_uniform (d : TailData) (eta : ℝ) {y : ℝ} field_simp /-- Release adjustment, given by `primitive (fun t => releaseSlope d t + d.core.lam)`. -/ -def releaseAdjustment (d : TailData) : ℝ → ℝ := +@[expose] def releaseAdjustment (d : TailData) : ℝ → ℝ := primitive (fun t => releaseSlope d t + d.core.lam) theorem releaseAdjustment_contDiff (d : TailData) : ContDiff ℝ ∞ (releaseAdjustment d) := @@ -587,9 +587,9 @@ theorem releaseAdjustment_late (d : TailData) {a t : ℝ} ring /-- Tail start, given by `d.releaseStart + d.rampEnd + decayHold d`. -/ -def tailStart (d : TailData) : ℝ := d.releaseStart + d.rampEnd + decayHold d +@[expose] def tailStart (d : TailData) : ℝ := d.releaseStart + d.rampEnd + decayHold d /-- Tail end, given by `tailStart d + 3`. -/ -def tailEnd (d : TailData) : ℝ := tailStart d + 3 +@[expose] def tailEnd (d : TailData) : ℝ := tailStart d + 3 theorem releaseStart_gt_flattenEnd (d : TailData) : d.flattenEnd < d.releaseStart := by dsimp [TailData.releaseStart] @@ -605,7 +605,7 @@ theorem tailStart_gt_release (d : TailData) : d.releaseStart < tailStart d := by /-- Final angular, given by `flattened d p * Real.exp (releaseAdjustment d (p.1 - d.releaseStart)) * (tailShape d (p.1 - tailStart d) / (1 - d.rho))`. -/ -def finalAngular (d : TailData) (p : ℝ × ℝ) : ℝ := +@[expose] def finalAngular (d : TailData) (p : ℝ × ℝ) : ℝ := flattened d p * Real.exp (releaseAdjustment d (p.1 - d.releaseStart)) * (tailShape d (p.1 - tailStart d) / (1 - d.rho)) @@ -630,7 +630,7 @@ theorem finalAngular_before (d : TailData) (eta : ℝ) {y : ℝ} /-- Carrier, given by `(radialAmplitude d.core.P d.core.dropLength d.core.lam y / 2) * Real.exp (releaseAdjustment d (y - d.releaseStart))`. -/ -def carrier (d : TailData) (y : ℝ) : ℝ := +@[expose] def carrier (d : TailData) (y : ℝ) : ℝ := (radialAmplitude d.core.P d.core.dropLength d.core.lam y / 2) * Real.exp (releaseAdjustment d (y - d.releaseStart)) @@ -739,14 +739,14 @@ theorem axial_product_unchanged (d : TailData) (amp : ℝ → ℝ) (eta y : ℝ) /-! ## The prescribed taper is an actual backward lag solution -/ /-- Tail rate, given by `1 + tailLogSlope d t`. -/ -def tailRate (d : TailData) (t : ℝ) : ℝ := 1 + tailLogSlope d t +@[expose] def tailRate (d : TailData) (t : ℝ) : ℝ := 1 + tailLogSlope d t theorem tailRate_contDiff (d : TailData) : ContDiff ℝ ∞ (tailRate d) := contDiff_const.add (contDiff_const.add ((tailShapeDeriv_contDiff d).div (tailShape_contDiff d) (fun t => (tailShape_pos d t).ne'))) /-- Weighted tail derivative, given by `Real.exp ((1 - d.h) * t) * tailShapeDeriv d t`. -/ -def weightedTailDerivative (d : TailData) (t : ℝ) : ℝ := +@[expose] def weightedTailDerivative (d : TailData) (t : ℝ) : ℝ := Real.exp ((1 - d.h) * t) * tailShapeDeriv d t theorem weightedTailDerivative_contDiff (d : TailData) : @@ -790,12 +790,12 @@ theorem tailDebt_source_formula (d : TailData) : /-- Tail numerator, given by `Real.exp (-(1 - d.h) * t) * (primitive (weightedTailDerivative d) 3 - primitive (weightedTailDerivative d) t)`. -/ -def tailNumerator (d : TailData) (t : ℝ) : ℝ := +@[expose] def tailNumerator (d : TailData) (t : ℝ) : ℝ := Real.exp (-(1 - d.h) * t) * (primitive (weightedTailDerivative d) 3 - primitive (weightedTailDerivative d) t) /-- Tail lag, given by `tailNumerator d t / tailShape d t`. -/ -def tailLag (d : TailData) (t : ℝ) : ℝ := tailNumerator d t / tailShape d t +@[expose] def tailLag (d : TailData) (t : ℝ) : ℝ := tailNumerator d t / tailShape d t theorem tailNumerator_contDiff (d : TailData) : ContDiff ℝ ∞ (tailNumerator d) := (contDiff_const.mul contDiff_id).exp.mul @@ -1008,7 +1008,7 @@ theorem carrier_hasDerivAt (d : TailData) {y : ℝ} (hy : d.releaseStart ≤ y) /-- Profile slope, given by `releaseSlope d (y - d.releaseStart) + tailShapeDeriv d (y - tailStart d) / tailShape d (y - tailStart d)`. -/ -def profileSlope (d : TailData) (y : ℝ) : ℝ := +@[expose] def profileSlope (d : TailData) (y : ℝ) : ℝ := releaseSlope d (y - d.releaseStart) + tailShapeDeriv d (y - tailStart d) / tailShape d (y - tailStart d) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricEvenDescent.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricEvenDescent.lean index c641f8add6..ea912cc248 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricEvenDescent.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricEvenDescent.lean @@ -22,7 +22,7 @@ regularity is inferred. Separate smoothness is not used as a substitute for joint smoothness. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ abbrev Plane := ℝ × ℝ variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] /-- Even radial, given by `∀ p, Function.Even (fun r => F (p, r))`. -/ -noncomputable def EvenRadial (F : Plane → E) : Prop := +@[expose] noncomputable def EvenRadial (F : Plane → E) : Prop := ∀ p, Function.Even (fun r => F (p, r)) /-- Parameter partial, given by `deriv (fun p => F (p, q.2)) q.1`. -/ @@ -56,7 +56,7 @@ noncomputable def radialReduce (F : Plane → E) (q : Plane) : E := EvenSmoothDescent.radialDerivative (fun r => F (q.1, r)) q.2 /-- Descend, given by `F (q.1, Real.sqrt q.2)`. -/ -noncomputable def descend (F : Plane → E) (q : Plane) : E := +@[expose] noncomputable def descend (F : Plane → E) (q : Plane) : E := F (q.1, Real.sqrt q.2) /-- Plane derivative, given by `(ContinuousLinearMap.fst ℝ ℝ ℝ).smulRight (parameterPartial F q) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricFlatFactor.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricFlatFactor.lean index 77e0a8cd96..11bef3f6c4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricFlatFactor.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricFlatFactor.lean @@ -17,7 +17,7 @@ The coefficient depends on a finite-dimensional auxiliary parameter and the edge coordinate. The factor is the actual transformed improper integral. -/ -@[expose] public section +public section noncomputable section @@ -62,18 +62,18 @@ end PartialJets variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Kernel as an element of `ℝ`. -/ -def kernel (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) (t : ℝ) : ℝ := +@[expose] def kernel (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) (t : ℝ) : ℝ := (1 / 2 : ℝ) * Real.exp (-c * t) * (FlatPrimitiveFactor.denominator y.2 t ^ j / FlatPrimitiveFactor.denominator y.2 t ^ 3) * b (y.1, FlatPrimitiveFactor.coordinate y.2 t) /-- Factor, given by `∫ t in Ioi (0 : ℝ), kernel c j b y t`. -/ -def factor (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) : ℝ := +@[expose] def factor (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) : ℝ := ∫ t in Ioi (0 : ℝ), kernel c j b y t /-- Primitive, given by `FlatPrimitive.primitive c j (fun u => b (y.1, u)) y.2`. -/ -def primitive (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) : ℝ := +@[expose] def primitive (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) : ℝ := FlatPrimitive.primitive c j (fun u => b (y.1, u)) y.2 omit [NormedAddCommGroup E] [NormedSpace ℝ E] in diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricHeatTail.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricHeatTail.lean index a3c1bf49aa..acf4c8d641 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricHeatTail.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricHeatTail.lean @@ -18,7 +18,7 @@ below are derivatives within the closed parameter domain; no extension to negative diffusion is assumed. -/ -@[expose] public section +public section noncomputable section @@ -132,7 +132,7 @@ end IntegralChain /-! ## Explicit algebra of genuine derivative chains -/ /-- Recursive Leibniz product. Its derivative identity is proved below. -/ -noncomputable def jetProduct (a b : ℕ → ℝ) : ℕ → ℝ +@[expose] noncomputable def jetProduct (a b : ℕ → ℝ) : ℕ → ℝ | 0 => a 0 * b 0 | n + 1 => jetProduct (fun i => a (i + 1)) b n + jetProduct a (fun i => b (i + 1)) n @@ -508,7 +508,7 @@ end Weighted open OutgoingTail /-- Tail weight, with branches according to `square`. -/ -noncomputable def tailWeight (d : TailData) (K : ℝ) (square : Bool) (X : ℝ) : ℝ := +@[expose] noncomputable def tailWeight (d : TailData) (K : ℝ) (square : Bool) (X : ℝ) : ℝ := if square then (powerTail d.h (outgoingAmplitude d) K (outgoingShape d) X) ^ 2 else powerTail d.h (outgoingAmplitude d) K (outgoingShape d) X @@ -597,18 +597,18 @@ theorem nuDebtJet_bound (d : TailData) {K : ℝ} (hK : 1 ≤ K) (square : Bool) convert! hb' using 1; unfold nuConstant; ring /-- Diffusion, given by `1 - eta ^ 2`. -/ -noncomputable def diffusion (eta : ℝ) : ℝ := 1 - eta ^ 2 +@[expose] noncomputable def diffusion (eta : ℝ) : ℝ := 1 - eta ^ 2 /-- Physical pressure, given by `pressureDebt (outgoingProfile d K eta) d.h (diffusion eta) K`. -/ -noncomputable def physicalPressure (d : TailData) (K eta : ℝ) : ℝ := +@[expose] noncomputable def physicalPressure (d : TailData) (K eta : ℝ) : ℝ := pressureDebt (outgoingProfile d K eta) d.h (diffusion eta) K /-- Physical energy, given by `energyDebt (outgoingProfile d K eta) d.h (diffusion eta) K`. -/ -noncomputable def physicalEnergy (d : TailData) (K eta : ℝ) : ℝ := +@[expose] noncomputable def physicalEnergy (d : TailData) (K eta : ℝ) : ℝ := energyDebt (outgoingProfile d K eta) d.h (diffusion eta) K /-- Physical angular, given by `angularDebt (outgoingProfile d K eta) d.h (diffusion eta) K`. -/ -noncomputable def physicalAngular (d : TailData) (K eta : ℝ) : ℝ := +@[expose] noncomputable def physicalAngular (d : TailData) (K eta : ℝ) : ℝ := angularDebt (outgoingProfile d K eta) d.h (diffusion eta) K theorem physicalPressure_eq (d : TailData) {K : ℝ} (hK : 0 < K) (eta : ℝ) : @@ -966,7 +966,7 @@ theorem physical_debts_zero (d : TailData) (K : ℝ) {eta : ℝ} (hη : diffusio hη, squareChange, change, edit, multiplier_zero d.h_pos] /-- Physical edit, given by `outgoingEdit d (diffusion eta) K eta X`. -/ -noncomputable def physicalEdit (d : TailData) (K eta X : ℝ) : ℝ := +@[expose] noncomputable def physicalEdit (d : TailData) (K eta X : ℝ) : ℝ := outgoingEdit d (diffusion eta) K eta X theorem physicalEdit_pos (d : TailData) (K : ℝ) {eta X : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricKernelBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricKernelBounds.lean index 57ab6b479b..5088fa7dac 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricKernelBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricKernelBounds.lean @@ -18,7 +18,7 @@ The estimates use actual total Fréchet derivatives and finite profile-jet bounds. The parameter space need not be finite-dimensional for these bounds. -/ -@[expose] public section +public section noncomputable section @@ -253,7 +253,8 @@ def rawKernel (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) (t : ℝ) : ℝ := /-- Kernel, given by `(1 / 2 : ℝ) * Real.exp (-c * t) * (denominator y.2 t ^ j / denominator y.2 t ^ 3) * b (y.1, coordinate y.2 t)`. -/ -def kernel (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) (y : E × ℝ) (t : ℝ) : ℝ := +@[expose] def kernel (c : ℝ) (j : ℕ) (b : E × ℝ → ℝ) + (y : E × ℝ) (t : ℝ) : ℝ := (1 / 2 : ℝ) * Real.exp (-c * t) * (denominator y.2 t ^ j / denominator y.2 t ^ 3) * b (y.1, coordinate y.2 t) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricModulation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricModulation.lean index b1e601ccb4..040ad44385 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricModulation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricModulation.lean @@ -49,7 +49,7 @@ All moments below are Lebesgue integrals of the actual cosine exponential family, not postulated properties of an abstract variance map. -/ -@[expose] public section +public section namespace NavierStokes.LoopVariance @@ -979,7 +979,7 @@ end end -@[expose] public section +public section namespace NavierStokes.TrueConeLoop @@ -1262,7 +1262,7 @@ def constructedC (a m d p δ : ℝ) (ha : 0 < a) (hd : d ≠ 0) (hδ : 0 < δ) : rephase (seedDensity a m d p δ ha hd hδ) (fun θ => loopC (seedSpeed a m δ) (seedTilt a m d p δ θ)) /-- In true cone, constructed using `0`. -/ -def InTrueCone (p₁ p₂ A C : ℝ) : Prop := +@[expose] def InTrueCone (p₁ p₂ A C : ℝ) : Prop := 0 < A ∧ 2 < A * (1 + (C / A) ^ 2) ∧ 2 < p₁ + p₂ * (C / A) ∧ A * (1 + (C / A) ^ 2) < coneBound (p₁ + p₂ * (C / A)) (p₂ - p₁ * (C / A)) @@ -1832,7 +1832,7 @@ in particular to positive integer frequencies. All derivatives are genuine `deriv`/`fderiv` derivatives, rather than formal differential symbols. -/ -@[expose] public section +public section noncomputable section @@ -1849,20 +1849,20 @@ abbrev BaseProfile := ℝ → ℝ → ℝ abbrev PrimitiveProfile := PhasePoint → ℝ /-- Phase point, given by `(X, η, n * Real.log X)`. -/ -def phasePoint (n X η : ℝ) : PhasePoint := (X, η, n * Real.log X) +@[expose] def phasePoint (n X η : ℝ) : PhasePoint := (X, η, n * Real.log X) /-- Partial X, given by `fderiv ℝ A z (1, 0, 0)`. -/ -def partialX (A : PrimitiveProfile) (z : PhasePoint) : ℝ := fderiv ℝ A z (1, 0, 0) +@[expose] def partialX (A : PrimitiveProfile) (z : PhasePoint) : ℝ := fderiv ℝ A z (1, 0, 0) /-- Partial eta, given by `fderiv ℝ A z (0, 1, 0)`. -/ def partialEta (A : PrimitiveProfile) (z : PhasePoint) : ℝ := fderiv ℝ A z (0, 1, 0) /-- Partial theta, given by `fderiv ℝ A z (0, 0, 1)`. -/ def partialTheta (A : PrimitiveProfile) (z : PhasePoint) : ℝ := fderiv ℝ A z (0, 0, 1) /-- Modulated E, given by `E X η * Real.exp (A (phasePoint n X η) / n)`. -/ -def modulatedE (n : ℝ) (E : BaseProfile) (A : PrimitiveProfile) (X η : ℝ) : ℝ := +@[expose] def modulatedE (n : ℝ) (E : BaseProfile) (A : PrimitiveProfile) (X η : ℝ) : ℝ := E X η * Real.exp (A (phasePoint n X η) / n) /-- Modulated U, given by `U X η + B (phasePoint n X η) / n`. -/ -def modulatedU (n : ℝ) (U : BaseProfile) (B : PrimitiveProfile) (X η : ℝ) : ℝ := +@[expose] def modulatedU (n : ℝ) (U : BaseProfile) (B : PrimitiveProfile) (X η : ℝ) : ℝ := U X η + B (phasePoint n X η) / n /-- The logarithmic graph and modulated angular profile are genuinely smooth @@ -2187,11 +2187,11 @@ theorem uniform_periodic_family_eta_jets simpa only [mul_one_div] using h /-- Angular family, given by `E z.2.1 z.2.2.1 * Real.exp (z.1 * A z.2)`. -/ -def angularFamily (E : BaseProfile) (A : PrimitiveProfile) (z : FamilyPoint) : ℝ := +@[expose] def angularFamily (E : BaseProfile) (A : PrimitiveProfile) (z : FamilyPoint) : ℝ := E z.2.1 z.2.2.1 * Real.exp (z.1 * A z.2) /-- Axial family, given by `U z.2.1 z.2.2.1 + z.1 * B z.2`. -/ -def axialFamily (U : BaseProfile) (B : PrimitiveProfile) (z : FamilyPoint) : ℝ := +@[expose] def axialFamily (U : BaseProfile) (B : PrimitiveProfile) (z : FamilyPoint) : ℝ := U z.2.1 z.2.2.1 + z.1 * B z.2 /-- Uniform `O(1/n)` closeness in every fixed actual η derivative of E. @@ -2254,7 +2254,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2702,7 +2702,7 @@ abbrev RadialParameter := ℝ × ℝ /-- Reassociation between slow-parameter/angle coordinates and the radial modulation module's `(X,η,θ)` coordinates. -/ -def asRadialPrimitive (Q : RadialParameter × ℝ → ℝ) : RadialModulation.PrimitiveProfile := +@[expose] def asRadialPrimitive (Q : RadialParameter × ℝ → ℝ) : RadialModulation.PrimitiveProfile := fun z => Q ((z.1, z.2.1), z.2.2) theorem asRadialPrimitive_contDiff @@ -2714,14 +2714,14 @@ variable {a m p₁ p₂ : RadialParameter → ℝ} {K B : Set RadialParameter} /-- Realized E, given by `RadialModulation.modulatedE n (fun X η => E (X, η)) (asRadialPrimitive r.angularPrimitive) X η`. -/ -def realizedE (r : TrueConeRealization a m p₁ p₂ K B) (E : RadialParameter → ℝ) +@[expose] def realizedE (r : TrueConeRealization a m p₁ p₂ K B) (E : RadialParameter → ℝ) (n X η : ℝ) : ℝ := RadialModulation.modulatedE n (fun X η => E (X, η)) (asRadialPrimitive r.angularPrimitive) X η /-- Realized U, given by `RadialModulation.modulatedU n (fun X η => U (X, η)) (asRadialPrimitive (r.axialPrimitive E)) X η`. -/ -def realizedU (r : TrueConeRealization a m p₁ p₂ K B) (E U : RadialParameter → ℝ) +@[expose] def realizedU (r : TrueConeRealization a m p₁ p₂ K B) (E U : RadialParameter → ℝ) (n X η : ℝ) : ℝ := RadialModulation.modulatedU n (fun X η => U (X, η)) (asRadialPrimitive (r.axialPrimitive E)) X η diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean index 8788adf3af..ee5df2333f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean @@ -20,7 +20,7 @@ Volterra operator. Smooth inversion then gives parameter dependence without assuming smoothness of a pre-existing family of solutions. -/ -@[expose] public section +public section namespace NavierStokes.ParametricODE @@ -42,7 +42,7 @@ abbrev Coefficient (a b : ℝ) (E : Type*) [NormedAddCommGroup E] [NormedSpace variable {a b : ℝ} (hab : a ≤ b) /-- Extend, given by `f (projIcc a b hab t)`. -/ -def extend (f : Curve a b E) (t : ℝ) : E := f (projIcc a b hab t) +@[expose] def extend (f : Curve a b E) (t : ℝ) : E := f (projIcc a b hab t) omit [NormedSpace ℝ E] [CompleteSpace E] in theorem continuous_extend (f : Curve a b E) : Continuous (extend hab f) := @@ -93,9 +93,10 @@ def integrator : Curve a b E →L[ℝ] Curve a b E := } (b - a) (norm_integralPath_le hab) theorem integrator_apply (f : Curve a b E) (t : Icc a b) : - integrator hab f t = ∫ s in a..(t : ℝ), extend hab f s := rfl + integrator hab f t = ∫ s in a..(t : ℝ), extend hab f s := by rfl /-- Apply coefficient, given by `⟨fun t => A t (u t), A.continuous.clm_apply u.continuous⟩`. -/ +@[expose] noncomputable def applyCoefficient (A : Coefficient a b E) (u : Curve a b E) : Curve a b E := ⟨fun t => A t (u t), A.continuous.clm_apply u.continuous⟩ @@ -129,7 +130,13 @@ def coefficientAction : Coefficient a b E →L[ℝ] Curve a b E →L[ℝ] Curve omit [CompleteSpace E] in theorem coefficientAction_apply (A : Coefficient a b E) (u : Curve a b E) (t : Icc a b) : - coefficientAction (E := E) A u t = A t (u t) := rfl + coefficientAction (E := E) A u t = A t (u t) := by rfl + +omit [CompleteSpace E] in +theorem coefficientAction_apply_curve (A : Coefficient a b E) (u : Curve a b E) : + coefficientAction (E := E) A u = applyCoefficient A u := by + ext t + exact coefficientAction_apply A u t /-- Volterra, given by `((ContinuousLinearMap.compL ℝ (Curve a b E) (Curve a b E) (Curve a b E)) (integrator hab)).comp (coefficientAction (E := E))`. -/ @@ -139,7 +146,7 @@ def volterra : Coefficient a b E →L[ℝ] Curve a b E →L[ℝ] Curve a b E := theorem volterra_apply (A : Coefficient a b E) (u : Curve a b E) (t : Icc a b) : volterra (E := E) hab A u t = - ∫ s in a..(t : ℝ), extend hab A s (extend hab u s) := rfl + ∫ s in a..(t : ℝ), extend hab A s (extend hab u s) := by rfl theorem norm_volterra_apply_le (A : Coefficient a b E) (u : Curve a b E) : ‖volterra (E := E) hab A u‖ ≤ (b - a) * ‖A‖ * ‖u‖ := by @@ -149,7 +156,7 @@ theorem norm_volterra_apply_le (A : Coefficient a b E) (u : Curve a b E) : (sub_nonneg.mpr hab)).trans_eq (mul_assoc _ _ _).symm) /-- Homogeneous system as an element of `TangentODE.IntervalSystem E`. -/ -def homogeneousSystem (A : Coefficient a b E) : TangentODE.IntervalSystem E := { +@[expose] def homogeneousSystem (A : Coefficient a b E) : TangentODE.IntervalSystem E := { left := a right := b ordered := hab @@ -166,6 +173,8 @@ theorem volterra_eq_next (A : Coefficient a b E) : (volterra (E := E) hab A : Curve a b E → Curve a b E) = (homogeneousSystem hab A).next := by funext u ext t + dsimp only [homogeneousSystem] + rw [TangentODE.IntervalSystem.next_apply, volterra_apply] change (∫ s in a..(t : ℝ), extend hab A s (extend hab u s)) = 0 + ∫ s in a..(t : ℝ), extend hab A (projIcc a b hab s) (u (projIcc a b hab s)) simp only [zero_add, extend, projIcc_val] @@ -230,15 +239,20 @@ theorem contDiff_inverse_family {X Q : Type*} /-- Equation operator, given by `ContinuousLinearMap.id ℝ (Curve a b E) - volterra (E := E) hab A`. -/ -def equationOperator (A : Coefficient a b E) : Curve a b E →L[ℝ] Curve a b E := +@[expose] def equationOperator (A : Coefficient a b E) : Curve a b E →L[ℝ] Curve a b E := ContinuousLinearMap.id ℝ (Curve a b E) - volterra (E := E) hab A +theorem equationOperator_apply_curve (A : Coefficient a b E) (u : Curve a b E) : + equationOperator hab A u = u - integrator hab (applyCoefficient A u) := by + change u - integrator hab (coefficientAction A u) = _ + rw [coefficientAction_apply_curve] + theorem equationOperator_isInvertible (A : Coefficient a b E) : (equationOperator hab A).IsInvertible := id_sub_isInvertible _ (volterra_contracting_iterate hab A) /-- Resolvent of the actual Volterra integral equation on the full finite interval. -/ -def resolvent (A : Coefficient a b E) : Curve a b E →L[ℝ] Curve a b E := +@[expose] def resolvent (A : Coefficient a b E) : Curve a b E →L[ℝ] Curve a b E := (equationOperator hab A).inverse theorem contDiff_resolvent : ContDiff ℝ ∞ (resolvent (E := E) hab) := by @@ -264,11 +278,11 @@ def constantCurve : E →L[ℝ] Curve a b E := (fun _ => le_rfl)) /-- Source, given by `constantCurve x₀ + integrator hab f`. -/ -def source (x₀ : E) (f : Curve a b E) : Curve a b E := +@[expose] def source (x₀ : E) (f : Curve a b E) : Curve a b E := constantCurve x₀ + integrator hab f /-- The constructed solution as a continuous path, not an assumed solution family. -/ -def solution (A : Coefficient a b E) (x₀ : E) (f : Curve a b E) : Curve a b E := +@[expose] def solution (A : Coefficient a b E) (x₀ : E) (f : Curve a b E) : Curve a b E := resolvent hab A (source hab x₀ f) theorem resolvent_equation (A : Coefficient a b E) (g : Curve a b E) : @@ -299,7 +313,7 @@ theorem solution_initial (A : Coefficient a b E) (x₀ : E) (f : Curve a b E) : /-- Solution extension, given by `x₀ + ∫ s in a..t, extend hab (applyCoefficient A (solution hab A x₀ f) + f) s`. -/ -def solutionExtension (A : Coefficient a b E) (x₀ : E) (f : Curve a b E) (t : ℝ) : E := +@[expose] def solutionExtension (A : Coefficient a b E) (x₀ : E) (f : Curve a b E) (t : ℝ) : E := x₀ + ∫ s in a..t, extend hab (applyCoefficient A (solution hab A x₀ f) + f) s theorem solutionExtension_coe (A : Coefficient a b E) (x₀ : E) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRadialExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRadialExtension.lean index edcfb831d4..8e2daa7ab4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRadialExtension.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRadialExtension.lean @@ -25,7 +25,7 @@ global smooth function of `(X, eta)` with exactly the original physical values. No constant continuation at negative `X` is differentiated. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -217,7 +217,7 @@ theorem halfPlaneExtension_zero {g : Plane → E} /-- The global smooth extension. The outer parameter cutoff and the negative radial support bound are independent of the input profile. -/ -noncomputable def extension {S : Set ℝ} (w : ParameterWindow S) (F : Plane → E) +@[expose] noncomputable def extension {S : Set ℝ} (w : ParameterWindow S) (F : Plane → E) (hF : ContDiffOn ℝ ∞ F (univ ×ˢ S)) (he : ∀ eta ∈ S, ∀ r, F (-r, eta) = F (r, eta)) (p : Plane) : E := w.bump p.2 • halfPlaneExtension (descent (regularize w F)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRephase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRephase.lean index 2d902db983..667d235bc1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRephase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricRephase.lean @@ -19,7 +19,7 @@ smoothness is proved with the inverse function theorem applied to the triangular map `(p, θ) ↦ (p, Φ(p, θ))`; no smooth inverse is postulated. -/ -@[expose] public section +public section noncomputable section @@ -34,21 +34,22 @@ open SmoothLoop variable {E : Type*} /-- Family rate, given by `(d z.1).rate z.2`. -/ -def familyRate (d : E → CircleDensity) (z : E × ℝ) : ℝ := (d z.1).rate z.2 +@[expose] def familyRate (d : E → CircleDensity) (z : E × ℝ) : ℝ := (d z.1).rate z.2 /-- Family phase, given by `phaseMap (d z.1) z.2`. -/ -def familyPhase (d : E → CircleDensity) (z : E × ℝ) : ℝ := phaseMap (d z.1) z.2 +@[expose] def familyPhase (d : E → CircleDensity) (z : E × ℝ) : ℝ := + phaseMap (d z.1) z.2 /-- Inverse phase, given by `(phaseHomeomorph (d z.1)).symm z.2`. -/ -def inversePhase (d : E → CircleDensity) (z : E × ℝ) : ℝ := +@[expose] def inversePhase (d : E → CircleDensity) (z : E × ℝ) : ℝ := (phaseHomeomorph (d z.1)).symm z.2 /-- Forward map, given by `(z.1, familyPhase d z)`. -/ -def forwardMap (d : E → CircleDensity) (z : E × ℝ) : E × ℝ := +@[expose] def forwardMap (d : E → CircleDensity) (z : E × ℝ) : E × ℝ := (z.1, familyPhase d z) /-- Inverse map, given by `(z.1, inversePhase d z)`. -/ -def inverseMap (d : E → CircleDensity) (z : E × ℝ) : E × ℝ := +@[expose] def inverseMap (d : E → CircleDensity) (z : E × ℝ) : E × ℝ := (z.1, inversePhase d z) theorem inverseMap_forwardMap (d : E → CircleDensity) (z : E × ℝ) : @@ -165,7 +166,7 @@ end InverseSmoothness variable {V : Type*} /-- Rephase family, given by `f (inverseMap d z)`. -/ -def rephaseFamily (d : E → CircleDensity) (f : E × ℝ → V) (z : E × ℝ) : V := +@[expose] def rephaseFamily (d : E → CircleDensity) (f : E × ℝ → V) (z : E × ℝ) : V := f (inverseMap d z) omit [NormedAddCommGroup E] [NormedSpace ℝ E] in @@ -202,7 +203,7 @@ theorem rephaseFamily_contDiffOn_of_phase [CompleteSpace E] /-- Genuine iterated derivatives in the parameter while the last variable is held fixed. This is not a separately postulated family of jets. -/ -def parameterJet (F : E × ℝ → V) (k : ℕ) (z : E × ℝ) : E [×k]→L[ℝ] V := +@[expose] def parameterJet (F : E × ℝ → V) (k : ℕ) (z : E × ℝ) : E [×k]→L[ℝ] V := iteratedFDeriv ℝ k (fun p : E => F (p, z.2)) z.1 /-- Joint smoothness implies joint smoothness of every genuine parameter jet. diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTerminalCompensation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTerminalCompensation.lean index dce2c8d97b..d9a19e9e88 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTerminalCompensation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTerminalCompensation.lean @@ -17,7 +17,7 @@ to the debt derivative. Smoothness at the ends of a compact parameter range is relative smoothness; all endpoint derivatives are actual `derivWithin`. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open NavierStokes.TerminalCompensation namespace NavierStokes.ParametricTerminalCompensation /-- First jet within bound as an element of `Prop`. -/ -noncomputable def FirstJetWithinBound (P : Patch) (a : ℝ → ℝ) (c : ℝ → Coeff) +@[expose] noncomputable def FirstJetWithinBound (P : Patch) (a : ℝ → ℝ) (c : ℝ → Coeff) (S : Set ℝ) (η L : ℝ) : Prop := ∀ x : ℝ, |a η * correction P (c η) x| ≤ L ∧ |a η * deriv (correction P (c η)) x| ≤ L ∧ @@ -132,8 +132,9 @@ theorem composed_solver_derivWithin_bound {g : Coeff → Coeff} {ε C : ℝ} theorem correction_parameter_derivWithin (P : Patch) {S : Set ℝ} {c : ℝ → Coeff} {η : ℝ} (huniq : UniqueDiffWithinAt ℝ S η) (hc : DifferentiableWithinAt ℝ c S η) (x : ℝ) : - derivWithin (fun θ => correction P (c θ) x) S η = correction P (derivWithin c S η) x := - ((correctionCLM P x).hasFDerivAt.comp_hasDerivWithinAt η hc.hasDerivWithinAt).derivWithin huniq + derivWithin (fun θ => correction P (c θ) x) S η = correction P (derivWithin c S η) x := by + simpa only [Function.comp_def, correctionCLM_apply] using + ((correctionCLM P x).hasFDerivAt.comp_hasDerivWithinAt η hc.hasDerivWithinAt).derivWithin huniq /-- The constructed three-row inverse applies to a genuinely varying debt. The derivative estimate includes its actual first parameter derivative. -/ @@ -221,8 +222,9 @@ theorem exists_variable_compensation (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) refine ⟨hmul₀.trans hsize, hmul₁.trans hsize, ?_⟩ have hadif : DifferentiableWithinAt ℝ a S η := (ha η hη).differentiableWithinAt (by simp) have hfd : HasDerivWithinAt (fun θ => correction P (c θ) x) - (correction P (derivWithin c S η) x) S η := - (correctionCLM P x).hasFDerivAt.comp_hasDerivWithinAt η hcdif.hasDerivWithinAt + (correction P (derivWithin c S η) x) S η := by + simpa only [Function.comp_def, correctionCLM_apply] using + (correctionCLM P x).hasFDerivAt.comp_hasDerivWithinAt η hcdif.hasDerivWithinAt rw [(hadif.hasDerivWithinAt.fun_mul hfd).derivWithin (huniq η hη)] calc _ ≤ |derivWithin a S η * correction P (c η) x| + @@ -449,7 +451,7 @@ theorem scaled_triple_first_jet_bound {S : Set ℝ} {K B : ℝ} {p e i : ℝ → exact scaled_triple_norm_bound hK hB hpb.2 heb.2 hib.2 /-- The actual three physical debts use the diffusion parameter `1-η²`. -/ -noncomputable def physicalDebt (T : OutgoingTail.TailData) (K η : ℝ) : Coeff := +@[expose] noncomputable def physicalDebt (T : OutgoingTail.TailData) (K η : ℝ) : Coeff := ![ParametricHeatTail.physicalPressure T K η, ParametricHeatTail.physicalEnergy T K η, ParametricHeatTail.physicalAngular T K η] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTorusInverse.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTorusInverse.lean index a5c1da2484..46e54b57fd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTorusInverse.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricTorusInverse.lean @@ -18,7 +18,7 @@ The coefficients are the integrals of the given function. Local uniform decay is obtained from genuine derivatives on compact parameter intervals. -/ -@[expose] public section +public section noncomputable section @@ -35,13 +35,13 @@ abbrev Point := ℝ × Plane abbrev Source := Point → ℂ /-- Slice, defined pointwise by `f (p, Y)`. -/ -noncomputable def slice (f : Source) (p : ℝ) : Plane → ℂ := fun Y => f (p, Y) +@[expose] noncomputable def slice (f : Source) (p : ℝ) : Plane → ℂ := fun Y => f (p, Y) /-- Periodic, given by `∀ p, SmoothFourierData.UnitPeriodic (slice f p)`. -/ -def Periodic (f : Source) : Prop := ∀ p, SmoothFourierData.UnitPeriodic (slice f p) +@[expose] def Periodic (f : Source) : Prop := ∀ p, SmoothFourierData.UnitPeriodic (slice f p) /-- Parameter partial, given by `fderiv ℝ f z (1, 0)`. -/ -noncomputable def parameterPartial (f : Source) (z : Point) : ℂ := +@[expose] noncomputable def parameterPartial (f : Source) (z : Point) : ℂ := fderiv ℝ f z (1, 0) /-- Torus X partial, given by `fderiv ℝ f z (0, (1, 0))`. -/ @@ -58,20 +58,21 @@ noncomputable def torusXJet : ℕ → Source → Source | n + 1, f => torusXPartial (torusXJet n f) /-- Swap torus, defined pointwise by `f (z.1, (z.2.2, z.2.1))`. -/ -noncomputable def swapTorus (f : Source) : Source := fun z => f (z.1, (z.2.2, z.2.1)) +@[expose] noncomputable def swapTorus (f : Source) : Source := + fun z => f (z.1, (z.2.2, z.2.1)) /-- Coefficient, given by `SmoothFourierData.coefficient (slice f p) k`. -/ -noncomputable def coefficient (f : Source) (p : ℝ) (k : Frequency) : ℂ := +@[expose] noncomputable def coefficient (f : Source) (p : ℝ) (k : Frequency) : ℂ := SmoothFourierData.coefficient (slice f p) k /-- Mean, given by `coefficient f p 0`. -/ -noncomputable def mean (f : Source) (p : ℝ) : ℂ := coefficient f p 0 +@[expose] noncomputable def mean (f : Source) (p : ℝ) : ℂ := coefficient f p 0 /-- Zero mean, given by `∀ p, mean f p = 0`. -/ -def ZeroMean (f : Source) : Prop := ∀ p, mean f p = 0 +@[expose] def ZeroMean (f : Source) : Prop := ∀ p, mean f p = 0 /-- Inverse, given by `directionalInverse d (coefficient f z.1) z.2`. -/ -noncomputable def inverse (d : Direction) (f : Source) (z : Point) : ℂ := +@[expose] noncomputable def inverse (d : Direction) (f : Source) (z : Point) : ℂ := directionalInverse d (coefficient f z.1) z.2 /-- Iterate inverse, given by `(inverse d)^[n] f`. -/ @@ -274,13 +275,15 @@ theorem exists_uniform_coefficient_bound {f : Source} (hf : ContDiff ℝ ∞ f) exact (h₂ (p, (x, y)) ⟨hparam, hx, hy⟩).trans hC₂ /-- Polynomial growth, given by `∃ s : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ k, ‖m k‖ ≤ C * weight k ^ s`. -/ -def PolynomialGrowth (m : Frequency → ℂ) : Prop := +@[expose] def PolynomialGrowth (m : Frequency → ℂ) : Prop := ∃ s : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ k, ‖m k‖ ≤ C * weight k ^ s /-- Multiplier X, given by `freqX k * m k`. -/ -noncomputable def multiplierX (m : Frequency → ℂ) (k : Frequency) : ℂ := freqX k * m k +@[expose] noncomputable def multiplierX (m : Frequency → ℂ) (k : Frequency) : ℂ := + freqX k * m k /-- Multiplier Y, given by `freqY k * m k`. -/ -noncomputable def multiplierY (m : Frequency → ℂ) (k : Frequency) : ℂ := freqY k * m k +@[expose] noncomputable def multiplierY (m : Frequency → ℂ) (k : Frequency) : ℂ := + freqY k * m k theorem PolynomialGrowth.mulX {m : Frequency → ℂ} (hm : PolynomialGrowth m) : PolynomialGrowth (multiplierX m) := by @@ -349,11 +352,11 @@ theorem uniform_multiplied_coeff_bound {m : Frequency → ℂ} (hm : PolynomialG exact ⟨M * B, mul_nonneg hM hB, fun p hp k => multiplied_coeff_bound hM hm (hbound p hp) k⟩ /-- Apply multiplier, given by `series (fun k => m k * coefficient f z.1 k) z.2`. -/ -noncomputable def applyMultiplier (m : Frequency → ℂ) (f : Source) (z : Point) : ℂ := +@[expose] noncomputable def applyMultiplier (m : Frequency → ℂ) (f : Source) (z : Point) : ℂ := series (fun k => m k * coefficient f z.1 k) z.2 theorem inverse_eq_applyMultiplier (d : Direction) (f : Source) : - inverse d f = applyMultiplier (multiplier d) f := rfl + inverse d f = applyMultiplier (multiplier d) f := by rfl theorem multiplied_coeff_rapid {m : Frequency → ℂ} (hm : PolynomialGrowth m) {f : Source} (hf : ContDiff ℝ ∞ f) (hp : Periodic f) (p : ℝ) : @@ -361,30 +364,31 @@ theorem multiplied_coeff_rapid {m : Frequency → ℂ} (hm : PolynomialGrowth m) hm.rapid_mul (SmoothFourierData.rapid_coefficient (slice_smooth hf p) (hp p)) /-- Joint DP, given by `ContinuousLinearMap.fst ℝ ℝ Plane`. -/ -noncomputable def jointDP : Point →L[ℝ] ℝ := ContinuousLinearMap.fst ℝ ℝ Plane +@[expose] noncomputable def jointDP : Point →L[ℝ] ℝ := + ContinuousLinearMap.fst ℝ ℝ Plane /-- Joint DX, given by `TorusInverse.dx.comp (ContinuousLinearMap.snd ℝ ℝ Plane)`. -/ -noncomputable def jointDX : Point →L[ℝ] ℝ := +@[expose] noncomputable def jointDX : Point →L[ℝ] ℝ := TorusInverse.dx.comp (ContinuousLinearMap.snd ℝ ℝ Plane) /-- Joint DY, given by `TorusInverse.dy.comp (ContinuousLinearMap.snd ℝ ℝ Plane)`. -/ -noncomputable def jointDY : Point →L[ℝ] ℝ := +@[expose] noncomputable def jointDY : Point →L[ℝ] ℝ := TorusInverse.dy.comp (ContinuousLinearMap.snd ℝ ℝ Plane) /-- Joint lift P, given by `ContinuousLinearMap.smulRightL ℝ Point ℂ jointDP`. -/ -noncomputable def jointLiftP : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := +@[expose] noncomputable def jointLiftP : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Point ℂ jointDP /-- Joint lift X, given by `ContinuousLinearMap.smulRightL ℝ Point ℂ jointDX`. -/ -noncomputable def jointLiftX : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := +@[expose] noncomputable def jointLiftX : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Point ℂ jointDX /-- Joint lift Y, given by `ContinuousLinearMap.smulRightL ℝ Point ℂ jointDY`. -/ -noncomputable def jointLiftY : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := +@[expose] noncomputable def jointLiftY : ℂ →L[ℝ] (Point →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Point ℂ jointDY -@[simp] theorem jointLiftP_apply (c : ℂ) (v : Point) : jointLiftP c v = v.1 • c := rfl -@[simp] theorem jointLiftX_apply (c : ℂ) (v : Point) : jointLiftX c v = v.2.1 • c := rfl -@[simp] theorem jointLiftY_apply (c : ℂ) (v : Point) : jointLiftY c v = v.2.2 • c := rfl +@[simp] theorem jointLiftP_apply (c : ℂ) (v : Point) : jointLiftP c v = v.1 • c := by rfl +@[simp] theorem jointLiftX_apply (c : ℂ) (v : Point) : jointLiftX c v = v.2.1 • c := by rfl +@[simp] theorem jointLiftY_apply (c : ℂ) (v : Point) : jointLiftY c v = v.2.2 • c := by rfl /-- Multiplier term derivative, constructed using `jointLiftP`. -/ -noncomputable def multiplierTermDerivative (m : Frequency → ℂ) (f : Source) +@[expose] noncomputable def multiplierTermDerivative (m : Frequency → ℂ) (f : Source) (k : Frequency) (z : Point) : Point →L[ℝ] ℂ := jointLiftP (m k * coefficient (parameterPartial f) z.1 k * mode k z.2) + jointLiftX (multiplierX m k * coefficient f z.1 k * mode k z.2) + @@ -561,7 +565,7 @@ theorem inverse_zeroMean (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ f) exact TorusInverse.inverse_zero_mean d ha /-- Directional partial, given by `fderiv ℝ f z (0, vector d)`. -/ -noncomputable def directionalPartial (d : Direction) (f : Source) (z : Point) : ℂ := +@[expose] noncomputable def directionalPartial (d : Direction) (f : Source) (z : Point) : ℂ := fderiv ℝ f z (0, vector d) /-- Exact inversion for the given function, with the derivative taken in the @@ -586,7 +590,7 @@ theorem inverse_preserves_parameter_support (d : Direction) (f : Source) (S : Se simp only [coefficient, SmoothFourierData.coefficient_eq_doubleIntegral, slice, hs p hp, mul_zero, intervalIntegral.integral_zero] -@[simp] theorem parameterJet_zero (f : Source) : parameterJet 0 f = f := rfl +@[simp] theorem parameterJet_zero (f : Source) : parameterJet 0 f = f := by rfl theorem parameterJet_succ (n : ℕ) (f : Source) : parameterJet (n + 1) f = parameterPartial (parameterJet n f) := @@ -611,7 +615,7 @@ theorem parameterJet_inverse (d : Direction) {f : Source} (hf : ContDiff ℝ ∞ (parameterJet_periodic hp n), parameterJet_succ] @[simp] theorem iterateInverse_zero (d : Direction) (f : Source) : - iterateInverse d 0 f = f := rfl + iterateInverse d 0 f = f := by rfl theorem iterateInverse_succ (d : Direction) (n : ℕ) (f : Source) : iterateInverse d (n + 1) f = inverse d (iterateInverse d n f) := @@ -683,7 +687,7 @@ noncomputable def mixedJet (q : ℕ) (w : List Bool) (f : Source) (z : Point) : /-- Mixed loss constant, given by `((6 * ‖omega⁻¹‖) * ‖omega‖ ^ r) * 3 ^ (r + 5) * ∑' k : Frequency, (weight k ^ 4)⁻¹`. -/ -noncomputable def mixedLossConstant (r : ℕ) : ℝ := +@[expose] noncomputable def mixedLossConstant (r : ℕ) : ℝ := ((6 * ‖omega⁻¹‖) * ‖omega‖ ^ r) * 3 ^ (r + 5) * ∑' k : Frequency, (weight k ^ 4)⁻¹ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularCopyBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularCopyBounds.lean index 08c5019289..677da6083c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularCopyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularCopyBounds.lean @@ -20,7 +20,7 @@ assumed, and no assertion that separate copy classes have uniform constants is used. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveAssembly.lean index 8c7e3a6178..53bd90ab90 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveAssembly.lean @@ -18,7 +18,7 @@ All signed nonzero harmonics are retained inside their original spatial label. A fixed reference solve supplies the compatible band views. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open HarmonicCalculus WeightedClasses open scoped BigOperators Topology ContDiff ComplexConjugate /-- One finite signed harmonic range, without the mean coefficient. -/ -noncomputable def modes (N : ℕ) : Finset ℤ := (Finset.Icc (-(N : ℤ)) N).erase 0 +@[expose] noncomputable def modes (N : ℕ) : Finset ℤ := (Finset.Icc (-(N : ℤ)) N).erase 0 @[simp] theorem mem_modes (N : ℕ) (j : ℤ) : j ∈ modes N ↔ j ≠ 0 ∧ j.natAbs ≤ N := by @@ -86,7 +86,7 @@ theorem signed_pairs_reconstruct {D : Type} (c : Coefficients D) (N : ℕ) simp only [ite_eq_right hm, hz, Pi.zero_apply, map_zero, add_zero] /-- The actual source coefficient, with no convention-dependent scaling. -/ -noncomputable def residualSource {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] +@[expose] noncomputable def residualSource {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] (c : Context D) (u : State D) (b : HarmonicBlock D) (G A : HarmonicResidual.BlockCoefficients D) (j : ℤ) (n : ℕ) (x : D) : ComplexVector := fun i => (HarmonicResidual.residualBlock c u b G A).velocity n i j x @@ -105,7 +105,7 @@ theorem residualSource_conjugate {D : Type} [NormedAddCommGroup D] [NormedSpace HarmonicResidual.residualBlock_conjugate c u b G A n i j x /-- A pair at the original label's carrier, for both velocity and pressure. -/ -noncomputable def modeBlock {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) +@[expose] noncomputable def modeBlock {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (v : ℕ → D → ComplexVector) (p : ℕ → D → ℂ) : HarmonicBlock D where velocity n i := conjugatePair j (fun x => v n x i) pressure n := conjugatePair j (p n) @@ -170,7 +170,7 @@ theorem modeBlock_classes {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] /-- Assembled block, given by `sumBlock (modes N) k Φ kp (fun j => modeBlock j k Φ kp (v j) (p j))`. -/ -noncomputable def assembledBlock {D : Type} (N : ℕ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) +@[expose] noncomputable def assembledBlock {D : Type} (N : ℕ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (v : ℤ → ℕ → D → ComplexVector) (p : ℤ → ℕ → D → ℂ) : HarmonicBlock D := sumBlock (modes N) k Φ kp (fun j => modeBlock j k Φ kp (v j) (p j)) @@ -558,7 +558,7 @@ structure BandCharts (P : Type) where /-- Reference velocity, given by `commonVelocity (r.tangent j) (residualSource c u b G A j r.band) r.geometry r.length_pos.le r.cutoff`. -/ -noncomputable def referenceVelocity (r : Reference P) +@[expose] noncomputable def referenceVelocity (r : Reference P) (c : Context (P × Plane)) (u : State (P × Plane)) (b : HarmonicBlock (P × Plane)) (G A : HarmonicResidual.BlockCoefficients (P × Plane)) (j : ℤ) : P × Plane → ComplexVector := commonVelocity (r.tangent j) (residualSource c u b G A j r.band) r.geometry @@ -961,7 +961,7 @@ theorem complexCopyPressure_angle (t : TangentData P ProblemStatement.Space) /-- Frequency and phase are constructed from the original residual block. Only the background fields of `base` are retained. -/ -noncomputable def actualCarrier (base : WaveCoefficients ((P × ℝ) × Plane)) +@[expose] noncomputable def actualCarrier (base : WaveCoefficients ((P × ℝ) × Plane)) (b : HarmonicBlock (P × Plane)) (j : ℤ) : WaveCoefficients ((P × ℝ) × Plane) := { base with phase := fun n z => b.phase n (z.1.1,z.2) + (b.angularFrequency n : ℝ) / b.frequency n * z.1.2 @@ -1163,7 +1163,7 @@ noncomputable def nativeCutoff (r : Reference P) (charts : BandCharts P) (copy : /-- The common coefficient already contains its single native cutoff. Its correction is the actual cylindrical curl correction of that coefficient. -/ -noncomputable def actualCorrectedCommon (r : Reference P) (charts : BandCharts P) +@[expose] noncomputable def actualCorrectedCommon (r : Reference P) (charts : BandCharts P) (c : Context (P × Plane)) (u : State (P × Plane)) (b : HarmonicBlock (P × Plane)) (G A : HarmonicResidual.BlockCoefficients (P × Plane)) (j : ℤ) (base : WaveCoefficients ((P × ℝ) × Plane)) (s : StripData ((P × ℝ) × Plane)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveBounds.lean index 0027d6b7b1..a28d022564 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParticularWaveBounds.lean @@ -35,7 +35,7 @@ identifies the two constructed solutions from their common zero entry value. No energy inequality for the ambient projected operator is assumed. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,7 @@ abbrev Space := PrimaryODE.Space /-! ## Exact reindexing of primitive frame data -/ /-- Reindex, bundling `beta`, `betaDot`, `rho`, `rhoDot` and the required compatibility proofs. -/ -noncomputable def reindex {P Q : Type} (d : PrimaryODE.FrameData P) (φ : Q → P) : +@[expose] noncomputable def reindex {P Q : Type} (d : PrimaryODE.FrameData P) (φ : Q → P) : PrimaryODE.FrameData Q where beta z := d.beta (φ z.1, z.2) betaDot z := d.betaDot (φ z.1, z.2) @@ -93,15 +93,15 @@ noncomputable def copySource {P : Type} (f : P × Plane → Space) @[simp] theorem copyFrame_normal {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) (g : CommonCoverSolve.Geometry) (k : Frequency) (z : (P × Plane) × ℝ) : - (copyFrame d g k).normal z = d.normal (copyParameter g k z.1, z.2) := rfl + (copyFrame d g k).normal z = d.normal (copyParameter g k z.1, z.2) := by rfl @[simp] theorem copyFrame_normalMotion {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) (g : CommonCoverSolve.Geometry) (k : Frequency) (z : (P × Plane) × ℝ) : - (copyFrame d g k).normalMotion z = d.normalMotion (copyParameter g k z.1, z.2) := rfl + (copyFrame d g k).normalMotion z = d.normalMotion (copyParameter g k z.1, z.2) := by rfl @[simp] theorem copyFrame_ambient {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) (g : CommonCoverSolve.Geometry) (k : Frequency) (z : (P × Plane) × ℝ) (w : State) : - (copyFrame d g k).ambient z w = d.ambient (copyParameter g k z.1, z.2) w := rfl + (copyFrame d g k).ambient z w = d.ambient (copyParameter g k z.1, z.2) w := by rfl theorem ambient_zero {P : Type} (d : PrimaryODE.FrameData P) (z : P × ℝ) : d.ambient z 0 = 0 := by @@ -118,15 +118,15 @@ noncomputable def baseOperator (F : ℝ) (g : State) : Space →L[ℝ] Space := ((2 * F) • MovingFrameODE.unitTheta + g))) @[simp] theorem baseOperator_apply (F : ℝ) (g : State) (x : Space) : - baseOperator F g x = MovingFrameODE.baseAction F g x := rfl + baseOperator F g x = MovingFrameODE.baseAction F g x := by rfl /-- Native point, given by `((z.1, z.2.1), z.2.2)`. -/ -noncomputable def nativePoint {P : Type} (z : P × Plane) : (P × ℝ) × ℝ := +@[expose] noncomputable def nativePoint {P : Type} (z : P × Plane) : (P × ℝ) × ℝ := ((z.1, z.2.1), z.2.2) /-- Frame tangent data, bundling `normal`, `normalDot`, `action`, `damping` and the required compatibility proofs. -/ -noncomputable def frameTangentData {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) +@[expose] noncomputable def frameTangentData {P : Type} (d : PrimaryODE.FrameData (P × ℝ)) (j : ℤ) (f : P × Plane → Space) : CommonCoverSolve.TangentData P Space where normal z := d.normal (nativePoint z) normalDot z := d.normalMotion (nativePoint z) @@ -391,7 +391,7 @@ noncomputable def baseOperatorFamily : (ℝ × State) →L[ℝ] (Space →L[ℝ] ring } @[simp] theorem baseOperatorFamily_apply (z : ℝ × State) : - baseOperatorFamily z = baseOperator z.1 z.2 := rfl + baseOperatorFamily z = baseOperator z.1 z.2 := by rfl theorem projectedOperator_continuousOn {X H : Type*} [TopologicalSpace X] [NormedAddCommGroup H] [InnerProductSpace ℝ H] @@ -599,7 +599,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1210,7 +1210,7 @@ variable [NormedAddCommGroup V] [NormedSpace ℝ V] variable [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] /-- Direction of increasing native slot time in common coordinates. -/ -noncomputable def slotDirection (g : Geometry) : Plane := +@[expose] noncomputable def slotDirection (g : Geometry) : Plane := (coverPower g.gap).symm (g.basis (0, 1)) theorem path_hasDerivAt (g : Geometry) (k : Frequency) (Y : Plane) (s : ℝ) : @@ -1254,19 +1254,20 @@ theorem along_copySolve (d : LinearData P V H) (g : Geometry) {a b : ℝ} (hab : t, g.path_current, Prod.mk.eta] using he /-- Native point, given by `(p.1, g.coordinates k p.2)`. -/ +@[expose] noncomputable def nativePoint (g : Geometry) (k : Frequency) (p : P × Plane) : P × Plane := (p.1, g.coordinates k p.2) /-- The pressure coefficient is constructed from the solved tangent field, the actual normal motion, and the source at the current common point. -/ -noncomputable def copyPressureReal (t : TangentData P H) (g : Geometry) +@[expose] noncomputable def copyPressureReal (t : TangentData P H) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (k : Frequency) (p : P × Plane) : ℝ := TangentProjection.pressureCoefficient (t.normal (nativePoint g k p)) (t.normalDot (nativePoint g k p)) (t.linearData.copySolve g hab k p) (t.action (nativePoint g k p) (t.linearData.copySolve g hab k p)) (t.source p) /-- Copy pressure, given by `Complex.I * (copyPressureReal t g hab k p : ℂ) / (frequency : ℂ)`. -/ -noncomputable def copyPressure (t : TangentData P H) (g : Geometry) +@[expose] noncomputable def copyPressure (t : TangentData P H) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (k : Frequency) (frequency : ℝ) (p : P × Plane) : ℂ := Complex.I * (copyPressureReal t g hab k p : ℂ) / (frequency : ℂ) @@ -1384,7 +1385,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Projected pressure, given by `Complex.I * (TangentProjection.pressureCoefficient (N x) (Ndot x) (u x) (action x) (source x) : ℂ) / (frequency : ℂ)`. -/ -noncomputable def projectedPressure (frequency : ℝ) +@[expose] noncomputable def projectedPressure (frequency : ℝ) (N Ndot u action source : E → ProblemStatement.Space) (x : E) : ℂ := Complex.I * (TangentProjection.pressureCoefficient (N x) (Ndot x) (u x) (action x) (source x) : ℂ) / (frequency : ℂ) @@ -1448,7 +1449,7 @@ open CommonCoverSolve TorusInverse HarmonicCalculus WeightedClasses variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Copy velocity, given by `CurlClassBounds.complexify (t.linearData.copySolve g hab k p)`. -/ -noncomputable def copyVelocity (t : TangentData P ProblemStatement.Space) (g : Geometry) +@[expose] noncomputable def copyVelocity (t : TangentData P ProblemStatement.Space) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (k : Frequency) (p : P × Plane) : ComplexVector := CurlClassBounds.complexify (t.linearData.copySolve g hab k p) @@ -1586,7 +1587,7 @@ noncomputable def frameForcingLinear (d : FrameData Q) (z : Q × ℝ) : PrimaryO omit [NormedAddCommGroup Q] [NormedSpace ℝ Q] in @[simp] theorem frameForcingLinear_apply (d : FrameData Q) (f : Q × ℝ → PrimaryODE.Space) (z : Q × ℝ) : - frameForcingLinear d z (f z) = d.forcing f z := rfl + frameForcingLinear d z (f z) = d.forcing f z := by rfl omit [NormedAddCommGroup Q] [NormedSpace ℝ Q] in theorem forcing_eq_columns (d : FrameData Q) (f : Q × ℝ → PrimaryODE.Space) (z : Q × ℝ) : @@ -1725,7 +1726,7 @@ private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := ENat.natCast_le_of_coe_top_le_withTop le_rfl n /-- Ambient jet constant, constructed using `2`. -/ -noncomputable def ambientJetConstant (N : ℕ) : ℝ := +@[expose] noncomputable def ambientJetConstant (N : ℕ) : ℝ := 2 ^ N * (‖(EuclideanSpace.proj (0 : Fin 2) : PrimaryODE.State →L[ℝ] ℝ)‖ + ‖(EuclideanSpace.proj (1 : Fin 2) : PrimaryODE.State →L[ℝ] ℝ)‖) @@ -2193,7 +2194,7 @@ noncomputable def complexScale (c : ℂ) : ComplexVector →L[ℝ] ComplexVector ContinuousLinearMap.pi fun i => ((ContinuousLinearMap.mul ℝ ℂ) c).comp (ContinuousLinearMap.proj i) -@[simp] theorem complexScale_apply (c : ℂ) (a : ComplexVector) : complexScale c a = c • a := rfl +@[simp] theorem complexScale_apply (c : ℂ) (a : ComplexVector) : complexScale c a = c • a := by rfl theorem complex_parts (a : ComplexVector) : CurlClassBounds.complexify (realPart a) + Complex.I • CurlClassBounds.complexify (imagPart a) = @@ -2206,18 +2207,18 @@ theorem complex_parts (a : ComplexVector) : variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Real data, given by `{ t with source := fun p => realPart (source p) }`. -/ -noncomputable def realData (t : TangentData P ProblemStatement.Space) +@[expose] noncomputable def realData (t : TangentData P ProblemStatement.Space) (source : P × Plane → ComplexVector) : TangentData P ProblemStatement.Space := { t with source := fun p => realPart (source p) } /-- Imag data, given by `{ t with source := fun p => imagPart (source p) }`. -/ -noncomputable def imagData (t : TangentData P ProblemStatement.Space) +@[expose] noncomputable def imagData (t : TangentData P ProblemStatement.Space) (source : P × Plane → ComplexVector) : TangentData P ProblemStatement.Space := { t with source := fun p => imagPart (source p) } /-- The actual particular coefficient for an arbitrary complex harmonic source, obtained from two real Volterra solves with the same geometry. -/ -noncomputable def complexCopyVelocity (t : TangentData P ProblemStatement.Space) +@[expose] noncomputable def complexCopyVelocity (t : TangentData P ProblemStatement.Space) (source : P × Plane → ComplexVector) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (copy : Frequency) (p : P × Plane) : ComplexVector := copyVelocity (realData t source) g hab copy p + @@ -2225,7 +2226,7 @@ noncomputable def complexCopyVelocity (t : TangentData P ProblemStatement.Space) /-- Complex copy pressure, given by `copyPressure (realData t source) g hab copy frequency p + Complex.I * copyPressure (imagData t source) g hab copy frequency p`. -/ -noncomputable def complexCopyPressure (t : TangentData P ProblemStatement.Space) +@[expose] noncomputable def complexCopyPressure (t : TangentData P ProblemStatement.Space) (source : P × Plane → ComplexVector) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (copy : Frequency) (frequency : ℝ) (p : P × Plane) : ℂ := copyPressure (realData t source) g hab copy frequency p + @@ -2258,6 +2259,7 @@ theorem copyVelocity_component_differentiable (t : TangentData P ProblemStatemen (x := t.linearData.copySolve g hab copy p)).comp p hu /-- Complex copy coefficients as an element of `LinearWaveBounds.WaveCoefficients (P × Plane)`. -/ +@[expose] noncomputable def complexCopyCoefficients (base : LinearWaveBounds.WaveCoefficients (P × Plane)) (t : ℕ → TangentData P ProblemStatement.Space) (source : ℕ → P × Plane → ComplexVector) (g : ℕ → Geometry) (copy : ℕ → Frequency) (L : ℕ → ℝ) (hL : ∀ n, 0 < L n) : @@ -3130,7 +3132,7 @@ theorem complexCopyPressure_deck (t : TangentData P ProblemStatement.Space) variable {H : Type} [NormedAddCommGroup H] [NormedSpace ℝ H] [CompleteSpace H] /-- Periodized copies, given by `∑' k : Frequency, κ (g.coordinates k p.2) • F k p`. -/ -noncomputable def periodizedCopies (g : Geometry) (κ : Plane → ℝ) +@[expose] noncomputable def periodizedCopies (g : Geometry) (κ : Plane → ℝ) (F : Frequency → P × Plane → H) (p : P × Plane) : H := ∑' k : Frequency, κ (g.coordinates k p.2) • F k p @@ -3195,7 +3197,7 @@ theorem periodizedCopies_periodic (g : Geometry) (κ : Plane → ℝ) rw [g.coordinates_deck, hF k m Y] /-- Common velocity, given by `periodizedCopies g κ (fun k => complexCopyVelocity t f g hab k)`. -/ -noncomputable def commonVelocity (t : TangentData P ProblemStatement.Space) +@[expose] noncomputable def commonVelocity (t : TangentData P ProblemStatement.Space) (f : P × Plane → ComplexVector) (g : Geometry) {a b : ℝ} (hab : a ≤ b) (κ : Plane → ℝ) : P × Plane → ComplexVector := periodizedCopies g κ (fun k => complexCopyVelocity t f g hab k) @@ -3234,7 +3236,7 @@ variable [NormedAddCommGroup H] [NormedSpace ℝ H] /-- Reindex strip, bundling `domain`, `isOpen_domain`, `epsilon`, `epsilon_pos` and the required compatibility proofs. -/ -noncomputable def reindexStrip (e : E ≃ₗᵢ[ℝ] F) (s : StripData F) : StripData E where +@[expose] noncomputable def reindexStrip (e : E ≃ₗᵢ[ℝ] F) (s : StripData F) : StripData E where domain := e ⁻¹' s.domain isOpen_domain := s.isOpen_domain.preimage e.continuous epsilon := s.epsilon @@ -3268,6 +3270,7 @@ theorem waveClass_reindex (e : E ≃ₗᵢ[ℝ] F) {s : StripData F} {W : ℕ memClass_reindex e hf /-- Reindex vector, defined pointwise by `e.symm (V (e x))`. -/ +@[expose] noncomputable def reindexVector (e : E ≃ₗᵢ[ℝ] F) (V : F → F) : E → E := fun x => e.symm (V (e x)) theorem along_reindex (e : E ≃ₗᵢ[ℝ] F) (V : F → F) {f : F → H} {x : E} @@ -3304,6 +3307,7 @@ theorem principal_reindex (e : E ≃ₗᵢ[ℝ] F) (ε frequency : ℝ) /-- Reindex coefficients, bundling `radius`, `radialBase`, `frequencyBase`, `axialBase` and the required compatibility proofs. -/ +@[expose] noncomputable def reindexCoefficients (e : E ≃ₗᵢ[ℝ] F) (a : WaveCoefficients F) : WaveCoefficients E where radius n x := a.radius n (e x) @@ -3317,6 +3321,7 @@ noncomputable def reindexCoefficients (e : E ≃ₗᵢ[ℝ] F) (a : WaveCoeffici /-- Reindex directions, bundling `radial`, `auxiliary`, `axial`, `angular` and the required compatibility proofs. -/ +@[expose] noncomputable def reindexDirections (e : E ≃ₗᵢ[ℝ] F) (d : GraphDirections F) : GraphDirections E where radial := e.symm d.radial @@ -3347,7 +3352,7 @@ theorem reindex_fastField (e : E ≃ₗᵢ[ℝ] F) (d : GraphDirections F) (n : /-- Explicit associator from `PressureStream.Lift S` to the common-copy domain with slow parameter `P = ℝ × S`. -/ -noncomputable def liftAssoc (S : Type*) [NormedAddCommGroup S] [NormedSpace ℝ S] : +@[expose] noncomputable def liftAssoc (S : Type*) [NormedAddCommGroup S] [NormedSpace ℝ S] : (ℝ × (S × TorusInverse.Plane)) ≃ₗᵢ[ℝ] ((ℝ × S) × TorusInverse.Plane) := (LinearIsometryEquiv.prodAssoc ℝ ℝ S TorusInverse.Plane).symm diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PartitionedCovariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PartitionedCovariance.lean index 3be119b250..2edbfff37e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PartitionedCovariance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PartitionedCovariance.lean @@ -19,7 +19,7 @@ The off-diagonal label products vanish by the constructed rational slots, not by an independence assumption about their angular frequencies. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ abbrev Vec2 := SmoothCovariance.Vec2 abbrev Mat2 := SmoothCovariance.Mat2 /-- Cutoff, given by `SquaredPartition.gridMask r 0`. -/ -noncomputable def cutoff (r : ℝ) : ℝ → ℝ := SquaredPartition.gridMask r 0 +@[expose] noncomputable def cutoff (r : ℝ) : ℝ → ℝ := SquaredPartition.gridMask r 0 theorem cutoff_continuous (r : ℝ) : Continuous (cutoff r) := (SquaredPartition.gridMask_smooth r 0).continuous @@ -87,36 +87,37 @@ structure Pulse where ψ_compact : HasCompactSupport ψ /-- Column, given by `PulseCovariance.actualColumn ci P.ψ P.x P.t`. -/ -noncomputable def Pulse.column (P : Pulse) (ci : ℝ) : Vec2 := +@[expose] noncomputable def Pulse.column (P : Pulse) (ci : ℝ) : Vec2 := PulseCovariance.actualColumn ci P.ψ P.x P.t /-- Radial profile, given by `cutoff r z.1 * P.ψ z.2 * P.x z.2`. -/ -noncomputable def Pulse.radialProfile (P : Pulse) (r : ℝ) (z : Plane) : ℝ := +@[expose] noncomputable def Pulse.radialProfile (P : Pulse) (r : ℝ) (z : Plane) : ℝ := cutoff r z.1 * P.ψ z.2 * P.x z.2 /-- Tangent profile, given by `cutoff r z.1 * P.ψ z.2 * P.t z.2 i`. -/ -noncomputable def Pulse.tangentProfile (P : Pulse) (r : ℝ) (i : Fin 2) (z : Plane) : ℝ := +@[expose] noncomputable def Pulse.tangentProfile (P : Pulse) (r : ℝ) (i : Fin 2) (z : Plane) : ℝ := cutoff r z.1 * P.ψ z.2 * P.t z.2 i /-- Native pulse, given by `TorusAverages.nativeField (TorusAverages.slotChart vr vt hdet) center (TorusAverages.transverseStretch ci r f)`. -/ +@[expose] noncomputable def nativePulse (vr vt center : Plane) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (ci r : ℝ) (f : Plane → ℝ) : Plane → ℝ := TorusAverages.nativeField (TorusAverages.slotChart vr vt hdet) center (TorusAverages.transverseStretch ci r f) /-- Covered, given by `TorusAverages.periodize f (TorusAverages.covering^[n] Y)`. -/ -noncomputable def covered (n : ℕ) (f : Plane → ℝ) (Y : Plane) : ℝ := +@[expose] noncomputable def covered (n : ℕ) (f : Plane → ℝ) (Y : Plane) : ℝ := TorusAverages.periodize f (TorusAverages.covering^[n] Y) /-- Wave, given by `amplitude * covered n f Y * Real.cos ((mode : ℝ) * θ + phase Y)`. -/ -noncomputable def wave (amplitude : ℝ) (n : ℕ) (f : Plane → ℝ) (mode : ℤ) +@[expose] noncomputable def wave (amplitude : ℝ) (n : ℕ) (f : Plane → ℝ) (mode : ℤ) (phase : Plane → ℝ) (Y : Plane) (θ : ℝ) : ℝ := amplitude * covered n f Y * Real.cos ((mode : ℝ) * θ + phase Y) /-- Double average, given by `TorusAverages.squareAverage (fun Y => SmoothLoop.angularMean (f Y))`. -/ -noncomputable def doubleAverage (f : Plane → ℝ → ℝ) : ℝ := +@[expose] noncomputable def doubleAverage (f : Plane → ℝ → ℝ) : ℝ := TorusAverages.squareAverage (fun Y => SmoothLoop.angularMean (f Y)) theorem doubleAverage_const_mul (a : ℝ) (f : Plane → ℝ → ℝ) : @@ -127,7 +128,7 @@ theorem doubleAverage_const_mul (a : ℝ) (f : Plane → ℝ → ℝ) : theorem nativePulse_mul (vr vt center : Plane) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (ci r : ℝ) (f g : Plane → ℝ) : (fun Y => nativePulse vr vt center hdet ci r f Y * nativePulse vr vt center hdet ci r g Y) = - nativePulse vr vt center hdet ci r (fun z => f z * g z) := rfl + nativePulse vr vt center hdet ci r (fun z => f z * g z) := by rfl theorem Pulse.profile_product (P : Pulse) (r : ℝ) (i : Fin 2) : (fun z => P.radialProfile r z * P.tangentProfile r i z) = @@ -324,6 +325,7 @@ theorem native_cutoff_support (vr vt center : Plane) /-- Physical mask, given by `SquaredPartition.dyadicMask (L.1 : ℤ) q * SquaredPartition.physicalSlowMask D L.1 L.2.1 x`. -/ +@[expose] noncomputable def physicalMask (D : ℝ) (L : SlotColoring.Label) (q : ℝ) (x : SlotColoring.Position) : ℝ := SquaredPartition.dyadicMask (L.1 : ℤ) q * SquaredPartition.physicalSlowMask D L.1 L.2.1 x @@ -439,6 +441,7 @@ theorem ofTangentPulse_fits {r a A b B c₀ s₀ slope E ci r0 : ℝ} rwa [he] /-- Pair matrix, defined pointwise by `nativePrefactor vr vt r * (P j).column (ci j) i`. -/ +@[expose] noncomputable def pairMatrix (vr vt : Plane) (r : ℝ) (ci : Vec2) (P : Fin 2 → Pulse) : Mat2 := fun i j => nativePrefactor vr vt r * (P j).column (ci j) i @@ -466,7 +469,7 @@ theorem pairMatrix_strictCone_of_actual {r a A b B c₀ u E r0 : ℝ} hcone.det_ne_zero hcone.weights_pos).2.1 /-- Amplitude, given by `Real.sqrt ε * SmoothCovariance.amplitudes H T j * mask`. -/ -noncomputable def amplitude (ε mask : ℝ) (H : Mat2) (T : Vec2) (j : Fin 2) : ℝ := +@[expose] noncomputable def amplitude (ε mask : ℝ) (H : Mat2) (T : Vec2) (j : Fin 2) : ℝ := Real.sqrt ε * SmoothCovariance.amplitudes H T j * mask theorem amplitude_sq (ε mask : ℝ) (hε : 0 ≤ ε) (H : Mat2) (T : Vec2) (j : Fin 2) : @@ -624,7 +627,7 @@ theorem SlotSystem.wave_cross_zero {D h : ℝ} {vr vt : Plane} (sys : SlotSystem abbrev UnsignedLabel := ℕ × SlotColoring.Grid /-- Signed label, given by `(U.1, U.2, if j = 0 then false else true)`. -/ -noncomputable def signedLabel (U : UnsignedLabel) (j : Fin 2) : SlotColoring.Label := +@[expose] noncomputable def signedLabel (U : UnsignedLabel) (j : Fin 2) : SlotColoring.Label := (U.1, U.2, if j = 0 then false else true) theorem signedLabel_injective (U : UnsignedLabel) : Function.Injective (signedLabel U) := by @@ -632,6 +635,7 @@ theorem signedLabel_injective (U : UnsignedLabel) : Function.Injective (signedLa fin_cases i <;> fin_cases j <;> simp_all [signedLabel] /-- Mask, given by `physicalMask D (signedLabel U 0) q x`. -/ +@[expose] noncomputable def mask (D : ℝ) (U : UnsignedLabel) (q : ℝ) (x : SlotColoring.Position) : ℝ := physicalMask D (signedLabel U 0) q x @@ -654,12 +658,14 @@ structure PairData {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h vr vt) (U : phases : Fin 2 → Plane → ℝ /-- Matrix, given by `pairMatrix vr vt sys.radius P.ci P.pulses`. -/ +@[expose] noncomputable def PairData.matrix {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) : Mat2 := pairMatrix vr vt sys.radius P.ci P.pulses /-- Raw radial, given by `nativePulse vr vt (slotCenter h (signedLabel U j)) hdet (P.ci j) sys.radius ((P.pulses j).radialProfile sys.radius)`. -/ +@[expose] noncomputable def PairData.rawRadial {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : Plane → ℝ := @@ -668,6 +674,7 @@ noncomputable def PairData.rawRadial {D h : ℝ} {vr vt : Plane} {sys : SlotSyst /-- Raw tangent, given by `nativePulse vr vt (slotCenter h (signedLabel U j)) hdet (P.ci j) sys.radius ((P.pulses j).tangentProfile sys.radius i)`. -/ +@[expose] noncomputable def PairData.rawTangent {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j i : Fin 2) : Plane → ℝ := @@ -755,6 +762,7 @@ theorem SlotSystem.finite_wave_covariance {ι : Type*} {D h : ℝ} {vr vt : Plan (mode a) (hmode a ha) (phase a) /-- Radial wave, constructed using `wave`. -/ +@[expose] noncomputable def PairData.radialWave {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) @@ -763,6 +771,7 @@ noncomputable def PairData.radialWave {D h : ℝ} {vr vt : Plane} {sys : SlotSys (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j) /-- Tangent wave, constructed using `wave`. -/ +@[expose] noncomputable def PairData.tangentWave {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) @@ -819,7 +828,7 @@ theorem mask_locallyFinite (D : ℝ) : mem_preimage] /-- Tail label, given by `(U.1 + N, U.2)`. -/ -noncomputable def tailLabel (N : ℕ) (U : UnsignedLabel) : UnsignedLabel := (U.1 + N, U.2) +@[expose] noncomputable def tailLabel (N : ℕ) (U : UnsignedLabel) : UnsignedLabel := (U.1 + N, U.2) theorem tailLabel_injective (N : ℕ) : Function.Injective (tailLabel N) := by intro U V h @@ -853,7 +862,7 @@ theorem physical_mask_tail_sum_sq (D : ℝ) (N : ℕ) {q : ℝ} (hq : 0 < q) exact SquaredPartition.dyadicMask_tail_sum_sq N hq hqN /-- Velocity exponent, given by `1 / 2 + h`. -/ -noncomputable def velocityExponent (h : ℝ) : ℝ := 1 / 2 + h +@[expose] noncomputable def velocityExponent (h : ℝ) : ℝ := 1 / 2 + h /-- The exact scalar change from chart covariance to physical covariance. The chart target contains `(Q/q)^(A+1/2)` and `A=1/2+h`. -/ @@ -883,6 +892,7 @@ noncomputable def constructedSlotSystem (D h : ℝ) (hh : 0 ≤ h) (vr vt : Plan Classical.choice (exists_slotSystem D h hh vr vt) /-- Signed tail label, given by `signedLabel (tailLabel N a.1) a.2`. -/ +@[expose] noncomputable def signedTailLabel (N : ℕ) (a : UnsignedLabel × Fin 2) : SlotColoring.Label := signedLabel (tailLabel N a.1) a.2 @@ -947,6 +957,7 @@ theorem finite_pair_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h /-- Assembled radial, given by `∑ᶠ a : UnsignedLabel × Fin 2, (P a.1).radialWave hdet (outer a.1) (ε a.1) (T a.1) q x a.2 Y θ`. -/ +@[expose] noncomputable def assembledRadial {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) @@ -955,6 +966,7 @@ noncomputable def assembledRadial {D h : ℝ} {vr vt : Plane} {sys : SlotSystem /-- Assembled tangent, given by `∑ᶠ a : UnsignedLabel × Fin 2, (P a.1).tangentWave hdet (outer a.1) (ε a.1) (T a.1) q x a.2 i Y θ`. -/ +@[expose] noncomputable def assembledTangent {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) @@ -1010,15 +1022,15 @@ theorem assembled_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem D h v exact hU (by simp [hzero U hn]) /-- Physical outer, given by `ChartScales.Q (U.1 + N) ^ (-velocityExponent h)`. -/ -noncomputable def physicalOuter (h : ℝ) (N : ℕ) (U : UnsignedLabel) : ℝ := +@[expose] noncomputable def physicalOuter (h : ℝ) (N : ℕ) (U : UnsignedLabel) : ℝ := ChartScales.Q (U.1 + N) ^ (-velocityExponent h) /-- Physical viscosity, given by `ChartScales.epsilon h (U.1 + N)`. -/ -noncomputable def physicalViscosity (h : ℝ) (N : ℕ) (U : UnsignedLabel) : ℝ := +@[expose] noncomputable def physicalViscosity (h : ℝ) (N : ℕ) (U : UnsignedLabel) : ℝ := ChartScales.epsilon h (U.1 + N) /-- Chart target, given by `(ChartScales.Q (U.1 + N) / q) ^ (velocityExponent h + 1 / 2) • T0`. -/ -noncomputable def chartTarget (h q : ℝ) (N : ℕ) (T0 : Vec2) (U : UnsignedLabel) : Vec2 := +@[expose] noncomputable def chartTarget (h q : ℝ) (N : ℕ) (T0 : Vec2) (U : UnsignedLabel) : Vec2 := (ChartScales.Q (U.1 + N) / q) ^ (velocityExponent h + 1 / 2) • T0 /-- Exact leading radial/tangential physical covariance of the assembled @@ -1103,6 +1115,7 @@ theorem compact_actual_pair_strictCone /-- Rounded phase remainder, given by `k * ((pz / ε) * s.2.1 + x0 * s.1 - v Y * (PhaseEstimates.roundedFrequency k target * F s + pz * G s))`. -/ +@[expose] noncomputable def roundedPhaseRemainder (k ε target pz x0 : ℝ) (F G : PhaseCalculus.Slow → ℝ) (s : PhaseCalculus.Slow) (v : Plane → ℝ) (Y : Plane) : ℝ := k * ((pz / ε) * s.2.1 + x0 * s.1 - diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicIntegration.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicIntegration.lean index a4cddb7b22..6cf79818c4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicIntegration.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicIntegration.lean @@ -23,7 +23,7 @@ back along the standard continuous linear equivalence to Euclidean space. Integration by parts is derived from Mathlib's proved box divergence theorem. -/ -@[expose] public section +public section noncomputable section @@ -39,10 +39,10 @@ open ProblemStatement abbrev Coords := Fin 3 → ℝ /-- To space, given by `(EuclideanSpace.equiv (Fin 3) ℝ).symm`. -/ -def toSpace : Coords ≃L[ℝ] Space := (EuclideanSpace.equiv (Fin 3) ℝ).symm +@[expose] def toSpace : Coords ≃L[ℝ] Space := (EuclideanSpace.equiv (Fin 3) ℝ).symm /-- Cube, given by `Icc 0 1`. -/ -def cube : Set Coords := Icc 0 1 +@[expose] def cube : Set Coords := Icc 0 1 /-- Cube measure, constructed using `volume.restrict`. -/ def cubeMeasure : Measure Coords := volume.restrict cube @@ -52,15 +52,15 @@ instance : IsFiniteMeasure cubeMeasure := by exact isFiniteMeasure_restrict.mpr isCompact_Icc.measure_lt_top.ne /-- Cube integral, given by `∫ y, f (toSpace y) ∂cubeMeasure`. -/ -def cubeIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] def cubeIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : Space → E) : E := ∫ y, f (toSpace y) ∂cubeMeasure /-- Unit periods, given by `∀ x i, f (x + coordinateVector i) = f x`. -/ -def UnitPeriods {E : Type*} (f : Space → E) : Prop := +@[expose] def UnitPeriods {E : Type*} (f : Space → E) : Prop := ∀ x i, f (x + coordinateVector i) = f x /-- Spatial partial, given by `fderiv ℝ f x (coordinateVector i)`. -/ -def spatialPartial {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] def spatialPartial {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (i : Fin 3) (f : Space → E) (x : Space) : E := fderiv ℝ f x (coordinateVector i) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicPhaseAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicPhaseAssembly.lean index 32b9e567fc..1c02c3923b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicPhaseAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicPhaseAssembly.lean @@ -18,7 +18,7 @@ is therefore periodic on the full auxiliary lift and retains the original clock, with every derivative, on each padded wave core. -/ -@[expose] public section +public section noncomputable section @@ -76,7 +76,7 @@ namespace ClockWindow variable (w : ClockWindow) /-- Core, given by `Icc w.lower.1 w.upper.1 ×ˢ Icc w.lower.2 w.upper.2`. -/ -noncomputable def core : Set Plane := +@[expose] noncomputable def core : Set Plane := Icc w.lower.1 w.upper.1 ×ˢ Icc w.lower.2 w.upper.2 /-- Plateau, given by `Ioo (w.lower.1 - w.padding) (w.upper.1 + w.padding) ×ˢ Ioo (w.lower.2 - @@ -331,7 +331,7 @@ theorem phase_path (g : Geometry) (w : ClockWindow) simp only [phase, periodicClock_path g w hinj k Y t htransverse ht] /-- The angular coordinate is distinct from the auxiliary torus. -/ -noncomputable def angularLift (Φ : P × Plane → ℝ) (angular : ℝ) +@[expose] noncomputable def angularLift (Φ : P × Plane → ℝ) (angular : ℝ) (x : (P × ℝ) × Plane) : ℝ := Φ (x.1.1, x.2) + angular * x.1.2 theorem angularLift_contDiff {Φ : P × Plane → ℝ} (hΦ : ContDiff ℝ ∞ Φ) (angular : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicResidualLimits.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicResidualLimits.lean index 7a49ac3356..55cbde4745 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicResidualLimits.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicResidualLimits.lean @@ -24,7 +24,7 @@ lattice copy of the origin. No residual identity or residual limit after periodization is assumed. -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,7 @@ theorem cutResidual_smoothOn {A : VelocityField} {p : PressureField} {U : Set Sp (SpatialLocalization.spatialCutoff_contDiff.comp contDiff_snd).contDiffOn.smul hA have huc : ContDiffOn ℝ ∞ (SpatialLocalization.cutVelocity A) U := by intro z hz - exact (SpatialCurl.contDiffAt_spatialCurl + exact (SpatialCurl.contDiffAt_spatialCurl (m := ∞) (n := ∞) (hAc.contDiffAt (hU.mem_nhds hz)) (by simp)).contDiffWithinAt exact ResidualRegularity.contDiffOn_residual hU huc ((SpatialLocalization.spatialCutoff_contDiff.comp contDiff_snd).contDiffOn.mul hp) @@ -160,7 +160,7 @@ be assumed to preserve continuity of the constructed boundary tensors. -/ noncomputable def nearestIndex (x : Space) : Fin 3 → ℤ := fun i => round (x i) /-- Representative, given by `x - CompactForceDecay.integerShift (nearestIndex x)`. -/ -noncomputable def representative (x : Space) : Space := +@[expose] noncomputable def representative (x : Space) : Space := x - CompactForceDecay.integerShift (nearestIndex x) theorem representative_mem_innerCube (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicUniqueness.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicUniqueness.lean index e4697c2c59..410ce321da 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicUniqueness.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodicUniqueness.lean @@ -19,7 +19,7 @@ The differential operators are those of `ProblemStatement`. The energy estimate is derived from the equations and periodic integration by parts. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodizedWaveBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodizedWaveBounds.lean index f93d9aac20..3639bd259d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodizedWaveBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PeriodizedWaveBounds.lean @@ -22,7 +22,7 @@ one uncovered-source term. In particular, the source is never summed once for every inactive copy. -/ -@[expose] public section +public section noncomputable section @@ -88,7 +88,7 @@ theorem memClass_of_local_germs {s : StripData D} {w : ℕ → D → ℝ} {α : /-- The actual locally finite copy sum. Local finiteness is proved from support cells below; it is not encoded by replacing the sum with a selector. -/ -noncomputable def copySum (f : I → D → E) (x : D) : E := ∑' i, f i x +@[expose] noncomputable def copySum (f : I → D → E) (x : D) : E := ∑' i, f i x omit [NormedSpace ℝ D] [NormedSpace ℝ E] in theorem zero_germ_of_support {K : Set D} (hK : IsClosed K) {f : D → E} @@ -312,6 +312,7 @@ variable {P E : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Native cell, given by `{z | g.coordinates k z.2 ∈ K}`. -/ +@[expose] noncomputable def nativeCell (g : Geometry) (K : Set Plane) (k : Frequency) : Set (P × Plane) := {z | g.coordinates k z.2 ∈ K} @@ -342,7 +343,7 @@ theorem nativeCell_locallyFinite (g : Geometry) {K : Set Plane} (hK : IsCompact simp [κ, hy] at hh /-- Native cells, bundling `carrier`, `closed`, `locallyFinite`, `unique`. -/ -noncomputable def nativeCells (g : ℕ → Geometry) (K : ℕ → Set Plane) +@[expose] noncomputable def nativeCells (g : ℕ → Geometry) (K : ℕ → Set Plane) (hK : ∀ n, IsCompact (K n)) (hinj : ∀ n, InjOn quotientPoint ((fun z => (g n).center + (g n).basis z) '' K n)) : Cells (P × Plane) Frequency where @@ -808,6 +809,7 @@ noncomputable def localGood (s : StripData D) (d : GraphDirections D) (n : ℕ) D → ComplexVector := (a.raw i).constructedGood s d (fun n => a.cutoff n i) n /-- Local tail, given by `d.Dfast (fun n => a.cutoff n i) n x • a.amplitude n i x`. -/ +@[expose] noncomputable def localTail (d : GraphDirections D) (n : ℕ) (i : I) (x : D) : ComplexVector := d.Dfast (fun n => a.cutoff n i) n x • a.amplitude n i x @@ -817,13 +819,13 @@ noncomputable def localGaussian (d : GraphDirections D) (n : ℕ) (i : I) : D excludedSlotError d (fun n => a.cutoff n i) (fun n => a.amplitude n i) a.source n /-- The single native cutoff is applied before periodization and curl. -/ -noncomputable def common : WaveCoefficients D := +@[expose] noncomputable def common : WaveCoefficients D := { a.background with amplitude := fun n => copySum (fun i => (a.localized i).amplitude n) pressure := fun n => copySum (fun i => (a.localized i).pressure n) } /-- Common corrected, given by `a.common.addAmplitude (a.common.curlCorrection s d)`. -/ -noncomputable def commonCorrected (s : StripData D) (d : GraphDirections D) : +@[expose] noncomputable def commonCorrected (s : StripData D) (d : GraphDirections D) : WaveCoefficients D := a.common.addAmplitude (a.common.curlCorrection s d) /-- An actual global good coefficient, assembled from the cutoff-and-curl @@ -835,11 +837,12 @@ noncomputable def globalGood (s : StripData D) (d : GraphDirections D) (n : ℕ) noncomputable def cutoffSum (n : ℕ) : D → ℝ := copySum (a.cutoff n) /-- Global tail, given by `copySum (a.localTail d n)`. -/ -noncomputable def globalTail (d : GraphDirections D) (n : ℕ) : D → ComplexVector := +@[expose] noncomputable def globalTail (d : GraphDirections D) (n : ℕ) : D → ComplexVector := copySum (a.localTail d n) /-- The shared source occurs once. This definition also makes sense off every native patch and preserves the uncovered-source term there. -/ +@[expose] noncomputable def globalGaussian (d : GraphDirections D) (n : ℕ) (x : D) : ComplexVector := a.globalTail d n x + (1 - a.cutoffSum n x) • a.source n x @@ -1583,7 +1586,7 @@ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] times. In particular, a transported clock may use `exit = length / clock`. The tangent coefficients, source, geometry, and frequency are the actual inputs of `complexCopyVelocity` and its projected pressure. -/ -noncomputable def complexCopyData (base : WaveCoefficients (P × Plane)) +@[expose] noncomputable def complexCopyData (base : WaveCoefficients (P × Plane)) (t : ℕ → TangentData P ProblemStatement.Space) (source : ℕ → P × Plane → ComplexVector) (g : ℕ → Geometry) (entry exit : ℕ → ℝ) (hab : ∀ n, entry n ≤ exit n) (κ : ℕ → Plane → ℝ) : CopyData (P × Plane) Frequency where diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseCalculus.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseCalculus.lean index 19426c5ac7..d0db38310d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseCalculus.lean @@ -20,7 +20,7 @@ The primary material operator uses the manuscript's backward-time convention `∂v - ε ∂T` from equation (25). -/ -@[expose] public section +public section noncomputable section @@ -37,25 +37,25 @@ abbrev Slot := Slow × (ℝ × ℝ) abbrev Vec3 := EuclideanSpace ℝ (Fin 3) /-- E R, given by `((1, (0, 0)), (0, 0))`. -/ -def eR : Slot := ((1, (0, 0)), (0, 0)) +@[expose] def eR : Slot := ((1, (0, 0)), (0, 0)) /-- E Z, given by `((0, (1, 0)), (0, 0))`. -/ -def eZ : Slot := ((0, (1, 0)), (0, 0)) +@[expose] def eZ : Slot := ((0, (1, 0)), (0, 0)) /-- E T, given by `((0, (0, 1)), (0, 0))`. -/ -def eT : Slot := ((0, (0, 1)), (0, 0)) +@[expose] def eT : Slot := ((0, (0, 1)), (0, 0)) /-- E theta, given by `((0, (0, 0)), (1, 0))`. -/ -def eTheta : Slot := ((0, (0, 0)), (1, 0)) +@[expose] def eTheta : Slot := ((0, (0, 0)), (1, 0)) /-- E V, given by `((0, (0, 0)), (0, 1))`. -/ -def eV : Slot := ((0, (0, 0)), (0, 1)) +@[expose] def eV : Slot := ((0, (0, 0)), (0, 1)) /-- Slow R, given by `fderiv ℝ F s (1, (0, 0))`. -/ -def slowR (F : Slow → ℝ) (s : Slow) : ℝ := fderiv ℝ F s (1, (0, 0)) +@[expose] def slowR (F : Slow → ℝ) (s : Slow) : ℝ := fderiv ℝ F s (1, (0, 0)) /-- Slow Z, given by `fderiv ℝ F s (0, (1, 0))`. -/ -def slowZ (F : Slow → ℝ) (s : Slow) : ℝ := fderiv ℝ F s (0, (1, 0)) +@[expose] def slowZ (F : Slow → ℝ) (s : Slow) : ℝ := fderiv ℝ F s (0, (1, 0)) /-- Slow T, given by `fderiv ℝ F s (0, (0, 1))`. -/ -def slowT (F : Slow → ℝ) (s : Slow) : ℝ := fderiv ℝ F s (0, (0, 1)) +@[expose] def slowT (F : Slow → ℝ) (s : Slow) : ℝ := fderiv ℝ F s (0, (0, 1)) /-- Equation (26). The axial term `(pz/ε)*Z` equals `pz*Z/ε`. -/ -def phase (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) : ℝ := +@[expose] def phase (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) : ℝ := p * q.2.1 + (pz / ε) * q.1.2.1 + x0 * q.1.1 - q.2.2 * (p * F q.1 + pz * G q.1) @@ -114,7 +114,7 @@ theorem phase_dV (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) simpa [eV, hzeroF, hzeroG] using fderiv_phase_apply ε p pz x0 F G q eV hF hG /-- The cylindrical chart gradient `(∂R Φ, R⁻¹∂θ Φ, ε∂Z Φ)`. -/ -def phaseNormal (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) : Vec3 := +@[expose] def phaseNormal (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) : Vec3 := !₂[fderiv ℝ (phase ε p pz x0 F G) q eR, fderiv ℝ (phase ε p pz x0 F G) q eTheta / q.1.1, ε * fderiv ℝ (phase ε p pz x0 F G) q eZ] @@ -146,17 +146,17 @@ theorem contDiff_phase {n : WithTop ℕ∞} (ε p pz x0 : ℝ) (F G : Slow → (contDiff_const.mul (hG.comp contDiff_fst)))) /-- The chart angular velocity is `V = R F`. -/ -def baseV (F : Slow → ℝ) (s : Slow) : ℝ := s.1 * F s +@[expose] def baseV (F : Slow → ℝ) (s : Slow) : ℝ := s.1 * F s /-- `σ=-1` is the backward slow-time convention of (25); `σ=1` describes the forward slow-time convention. The differential operators are real ones. -/ -def signedMaterialOp (σ ε : ℝ) (b F G : Slow → ℝ) (f : Slot → ℝ) (q : Slot) : ℝ := +@[expose] def signedMaterialOp (σ ε : ℝ) (b F G : Slow → ℝ) (f : Slot → ℝ) (q : Slot) : ℝ := fderiv ℝ f q eV + σ * ε * fderiv ℝ f q eT + b q.1 * fderiv ℝ f q eR + (baseV F q.1 / q.1.1) * fderiv ℝ f q eTheta + ε * G q.1 * fderiv ℝ f q eZ /-- Backward material op, given by `signedMaterialOp (-1) ε b F G f q`. -/ -def backwardMaterialOp (ε : ℝ) (b F G : Slow → ℝ) (f : Slot → ℝ) (q : Slot) : ℝ := +@[expose] def backwardMaterialOp (ε : ℝ) (b F G : Slow → ℝ) (f : Slot → ℝ) (q : Slot) : ℝ := signedMaterialOp (-1) ε b F G f q /-- Exact cancellation of the fast-time and leading angular/axial terms. -/ @@ -200,7 +200,7 @@ theorem phase_angularShift (ε p pz x0 h : ℝ) (F G : Slow → ℝ) (q : Slot) ring /-- The actual complex carrier `exp(i k j Φ)`, with integer harmonic `j`. -/ -def harmonic (k : ℝ) (j : ℤ) (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) : ℂ := +@[expose] def harmonic (k : ℝ) (j : ℤ) (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot) : ℂ := Complex.exp ((↑(k * (j : ℝ) * phase ε p pz x0 F G q) : ℂ) * Complex.I) /-- Rounding `k*p` to an integer makes every integer harmonic single-valued @@ -259,7 +259,7 @@ theorem contDiffAt_phaseNormal (ε p pz x0 : ℝ) (F G : Slow → ℝ) (q : Slot exact contDiffAt_const.mul (hp eZ).contDiffAt /-- The exact fast-slot derivative of `nΦ` used by the tangent ODE. -/ -def normalSlotDerivative (ε p pz : ℝ) (F G : Slow → ℝ) (s : Slow) : Vec3 := +@[expose] def normalSlotDerivative (ε p pz : ℝ) (F G : Slow → ℝ) (s : Slow) : Vec3 := !₂[-(p * slowR F s + pz * slowR G s), 0, -ε * (p * slowZ F s + pz * slowZ G s)] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseEstimates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseEstimates.lean index b91e98b4dc..d5106f1bb6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseEstimates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhaseEstimates.lean @@ -47,7 +47,7 @@ The invariant region is proved using a quadratic boundary function, without dividing by the growing coordinate or assuming its positivity along the solution. -/ -@[expose] public section +public section namespace NavierStokes.GrowingMode @@ -58,7 +58,7 @@ open scoped Topology abbrev State := EuclideanSpace ℝ (Fin 2) /-- The actual two-mode coefficient, including four independent error entries. -/ -noncomputable def modalOperator (lam damping e11 e12 e21 e22 : ℝ) : State →L[ℝ] State := +@[expose] noncomputable def modalOperator (lam damping e11 e12 e21 e22 : ℝ) : State →L[ℝ] State := LinearMap.toContinuousLinearMap { toFun := fun z => !₂[(lam - damping + e11) * z 0 + e12 * z 1, e21 * z 0 + (-lam - damping + e22) * z 1] @@ -73,11 +73,11 @@ noncomputable def modalOperator (lam damping e11 e12 e21 e22 : ℝ) : State →L @[simp] theorem modalOperator_zero (lam damping e11 e12 e21 e22 : ℝ) (z : State) : modalOperator lam damping e11 e12 e21 e22 z 0 = - (lam - damping + e11) * z 0 + e12 * z 1 := rfl + (lam - damping + e11) * z 0 + e12 * z 1 := by rfl @[simp] theorem modalOperator_one (lam damping e11 e12 e21 e22 : ℝ) (z : State) : modalOperator lam damping e11 e12 e21 e22 z 1 = - e21 * z 0 + (-lam - damping + e22) * z 1 := rfl + e21 * z 0 + (-lam - damping + e22) * z 1 := by rfl /-- A nonzero solution of a continuous homogeneous linear equation cannot hit zero. This uses backwards uniqueness, not a positivity assumption on any coordinate. -/ @@ -244,7 +244,7 @@ theorem positive_invariant_cone /-- A fixed constant for the manuscript's `O(1/S)` cone width. The added one allows the same statement when the perturbation bound is zero. -/ -noncomputable def coneConstant (lamMin C : ℝ) : ℝ := 4 * (C + 1) / lamMin +@[expose] noncomputable def coneConstant (lamMin C : ℝ) : ℝ := 4 * (C + 1) / lamMin /-- An explicit sufficient meaning of "sufficiently large S". -/ theorem scaled_cone_conditions {lamMin C S : ℝ} @@ -494,7 +494,7 @@ end end -@[expose] public section +public section namespace NavierStokes.MovingFrameODE @@ -508,11 +508,11 @@ abbrev Space := EuclideanSpace ℝ (Fin 3) abbrev Frame := OrthonormalBasis (Fin 2) ℝ Plane /-- Pack, given by `!₂[r, w 0, w 1]`. -/ -noncomputable def pack (r : ℝ) (w : Plane) : Space := !₂[r, w 0, w 1] +@[expose] noncomputable def pack (r : ℝ) (w : Plane) : Space := !₂[r, w 0, w 1] /-- Tail, given by `!₂[w 1, w 2]`. -/ -noncomputable def tail (w : Space) : Plane := !₂[w 1, w 2] +@[expose] noncomputable def tail (w : Space) : Plane := !₂[w 1, w 2] /-- Unit theta, given by `!₂[1, 0]`. -/ -noncomputable def unitTheta : Plane := !₂[1, 0] +@[expose] noncomputable def unitTheta : Plane := !₂[1, 0] @[simp] theorem pack_zero (r : ℝ) (w : Plane) : pack r w 0 = r := rfl @[simp] theorem pack_one (r : ℝ) (w : Plane) : pack r w 1 = w 0 := rfl @@ -574,15 +574,15 @@ theorem frame_ext (B : Frame) {u v : Space} (hr : u 0 = v 0) · exact congrArg (fun w : Plane => w 1) ht /-- Normal, given by `pack (β * ρ) (β • B 0)`. -/ -noncomputable def normal (β ρ : ℝ) (B : Frame) : Space := +@[expose] noncomputable def normal (β ρ : ℝ) (B : Frame) : Space := pack (β * ρ) (β • B 0) /-- Tangent, given by `pack x ((-ρ * x) • B 0 + y • B 1)`. -/ -noncomputable def tangent (ρ : ℝ) (B : Frame) (x y : ℝ) : Space := +@[expose] noncomputable def tangent (ρ : ℝ) (B : Frame) (x y : ℝ) : Space := pack x ((-ρ * x) • B 0 + y • B 1) /-- Normal motion, given by `pack (β' * ρ + β * ρ') (β' • B 0 + (β * rot) • B 1)`. -/ -noncomputable def normalMotion (β β' ρ ρ' rot : ℝ) (B : Frame) : Space := +@[expose] noncomputable def normalMotion (β β' ρ ρ' rot : ℝ) (B : Frame) : Space := pack (β' * ρ + β * ρ') (β' • B 0 + (β * rot) • B 1) /-- Tangent motion, given by `pack x' (-(ρ' * x + ρ * x' + rot * y) • B 0 + (y' - ρ * rot * x) • @@ -593,7 +593,7 @@ noncomputable def tangentMotion (ρ ρ' rot : ℝ) (B : Frame) (y' - ρ * rot * x) • B 1) /-- The exact zeroth-order ambient matrix from the pulse equation. -/ -noncomputable def baseAction (F : ℝ) (g : Plane) (t : Space) : Space := +@[expose] noncomputable def baseAction (F : ℝ) (g : Plane) (t : Space) : Space := pack (-2 * F * (tail t) 0) ((t 0) • ((2 * F) • unitTheta + g)) theorem normal_ne_zero {β ρ : ℝ} (B : Frame) (hβ : β ≠ 0) : normal β ρ B ≠ 0 := by @@ -646,21 +646,21 @@ theorem normal_baseAction (β ρ F : ℝ) (B : Frame) (g : Plane) (x y : ℝ) : ring /-- Coefficients before subtracting the scalar viscous damping. -/ -noncomputable def coeff11 (ρ ρ' gK : ℝ) : ℝ := ρ * (gK - ρ') / (1 + ρ ^ 2) +@[expose] noncomputable def coeff11 (ρ ρ' gK : ℝ) : ℝ := ρ * (gK - ρ') / (1 + ρ ^ 2) /-- Coeff12, given by `(2 * F * Nθ - ρ * rot) / (1 + ρ ^ 2)`. -/ -noncomputable def coeff12 (F Nθ ρ rot : ℝ) : ℝ := (2 * F * Nθ - ρ * rot) / (1 + ρ ^ 2) +@[expose] noncomputable def coeff12 (F Nθ ρ rot : ℝ) : ℝ := (2 * F * Nθ - ρ * rot) / (1 + ρ ^ 2) /-- Coeff21, given by `-(2 * F * Nθ + gN) + ρ * rot`. -/ -noncomputable def coeff21 (F Nθ gN ρ rot : ℝ) : ℝ := -(2 * F * Nθ + gN) + ρ * rot +@[expose] noncomputable def coeff21 (F Nθ gN ρ rot : ℝ) : ℝ := -(2 * F * Nθ + gN) + ρ * rot /-- Rhs X, given by `(coeff11 ρ ρ' ⟪B 0, g⟫_ℝ - d) * x + coeff12 F ((B 1) 0) ρ rot * y - (f 0 - ρ * ⟪B 0, tail f⟫_ℝ) / (1 + ρ ^ 2)`. -/ -noncomputable def rhsX (F d ρ ρ' rot : ℝ) (B : Frame) (g : Plane) +@[expose] noncomputable def rhsX (F d ρ ρ' rot : ℝ) (B : Frame) (g : Plane) (f : Space) (x y : ℝ) : ℝ := (coeff11 ρ ρ' ⟪B 0, g⟫_ℝ - d) * x + coeff12 F ((B 1) 0) ρ rot * y - (f 0 - ρ * ⟪B 0, tail f⟫_ℝ) / (1 + ρ ^ 2) /-- Rhs Y, given by `coeff21 F ((B 1) 0) ⟪B 1, g⟫_ℝ ρ rot * x - d * y - ⟪B 1, tail f⟫_ℝ`. -/ -noncomputable def rhsY (F d ρ rot : ℝ) (B : Frame) (g : Plane) +@[expose] noncomputable def rhsY (F d ρ rot : ℝ) (B : Frame) (g : Plane) (f : Space) (x y : ℝ) : ℝ := coeff21 F ((B 1) 0) ⟪B 1, g⟫_ℝ ρ rot * x - d * y - ⟪B 1, tail f⟫_ℝ @@ -739,7 +739,7 @@ theorem tangentMotion_eq_projectedRhs_iff {β : ℝ} (hβ : β ≠ 0) rfl /-- Pack continuous linear map, constructed using `LinearMap.toContinuousLinearMap`. -/ -noncomputable def packCLM : (ℝ × Plane) →L[ℝ] Space := +@[expose] noncomputable def packCLM : (ℝ × Plane) →L[ℝ] Space := LinearMap.toContinuousLinearMap { toFun := fun p => pack p.1 p.2 map_add' := by @@ -753,7 +753,7 @@ noncomputable def packCLM : (ℝ × Plane) →L[ℝ] Space := /-- Tail continuous linear map, given by `LinearMap.toContinuousLinearMap { toFun := tail map_add' := tail_add map_smul' := tail_smul }`. -/ -noncomputable def tailCLM : Space →L[ℝ] Plane := +@[expose] noncomputable def tailCLM : Space →L[ℝ] Plane := LinearMap.toContinuousLinearMap { toFun := tail map_add' := tail_add @@ -811,7 +811,7 @@ theorem hasDerivAt_projected_iff {β ρ x y : ℝ → ℝ} {B : ℝ → Frame} exact h ▸ ht /-- Counterclockwise quarter-turn in the angular-axial plane. -/ -noncomputable def quarterTurn : Plane →L[ℝ] Plane := +@[expose] noncomputable def quarterTurn : Plane →L[ℝ] Plane := LinearMap.toContinuousLinearMap { toFun := fun w => !₂[-w 1, w 0] map_add' := by @@ -867,7 +867,7 @@ noncomputable def frameOfUnit (K : Plane) (hK : ‖K‖ = 1) : Frame := simp [frameOfUnit] /-- Normal scale, given by `‖tail n‖`. -/ -noncomputable def normalScale (n : Space) : ℝ := ‖tail n‖ +@[expose] noncomputable def normalScale (n : Space) : ℝ := ‖tail n‖ /-- Radial slope, given by `n 0 / normalScale n`. -/ noncomputable def radialSlope (n : Space) : ℝ := n 0 / normalScale n /-- Normal direction, given by `(normalScale n)⁻¹ • tail n`. -/ @@ -1184,13 +1184,13 @@ theorem frame_coefficients_close {B B0 : Frame} {g g0 : Plane} /-! ## The moving eigenbasis, including its derivative -/ /-- Modal11, given by `(a + h * b + c / h - rate) / 2`. -/ -noncomputable def modal11 (a b c h rate : ℝ) : ℝ := (a + h * b + c / h - rate) / 2 +@[expose] noncomputable def modal11 (a b c h rate : ℝ) : ℝ := (a + h * b + c / h - rate) / 2 /-- Modal12, given by `(a - h * b + c / h + rate) / 2`. -/ -noncomputable def modal12 (a b c h rate : ℝ) : ℝ := (a - h * b + c / h + rate) / 2 +@[expose] noncomputable def modal12 (a b c h rate : ℝ) : ℝ := (a - h * b + c / h + rate) / 2 /-- Modal21, given by `(a + h * b - c / h + rate) / 2`. -/ -noncomputable def modal21 (a b c h rate : ℝ) : ℝ := (a + h * b - c / h + rate) / 2 +@[expose] noncomputable def modal21 (a b c h rate : ℝ) : ℝ := (a + h * b - c / h + rate) / 2 /-- Modal22, given by `(a - h * b - c / h - rate) / 2`. -/ -noncomputable def modal22 (a b c h rate : ℝ) : ℝ := (a - h * b - c / h - rate) / 2 +@[expose] noncomputable def modal22 (a b c h rate : ℝ) : ℝ := (a - h * b - c / h - rate) / 2 /-- Exact change to `x = p + q`, `y = h (p - q)`, with `h' = rate * h`. Here the reference off-diagonal entries are `λ/h` and `λ*h`, and `a,b,c` @@ -1229,7 +1229,7 @@ theorem modal_equations_iff {h : ℝ} (hh : h ≠ 0) field_simp; ring /-- Pair continuous linear map, constructed using `LinearMap.toContinuousLinearMap`. -/ -noncomputable def pairCLM : (ℝ × ℝ) →L[ℝ] Plane := +@[expose] noncomputable def pairCLM : (ℝ × ℝ) →L[ℝ] Plane := LinearMap.toContinuousLinearMap { toFun := fun z => !₂[z.1, z.2] map_add' := by intro u v; ext i; fin_cases i <;> simp @@ -1318,7 +1318,8 @@ theorem modalOperator_eq_coefficient (lam damping e11 e12 e21 e22 : ℝ) : (GrowingMode.modalOperator 0 0 e11 e12 e21 e22) := by ext z i fin_cases i <;> simp [GrowingMode.modalOperator, ViscousPropagator.coefficient, - ViscousPropagator.diagonal, ViscousPropagator.reflection] <;> ring + ViscousPropagator.diagonal, ViscousPropagator.reflection_zero, + ViscousPropagator.reflection_one] <;> ring theorem plane_norm_le_coordinate_sum (z : Plane) : ‖z‖ ≤ |z 0| + |z 1| := by have h := ViscousPropagator.plane_norm_sq z @@ -1369,7 +1370,7 @@ end end -@[expose] public section +public section namespace NavierStokes.PhaseEstimates @@ -1404,6 +1405,7 @@ theorem nonzeroRound_error (x : ℝ) : |(nonzeroRound x : ℝ) - x| ≤ 1 := by · exact abs_le.mpr ⟨by linarith, by linarith⟩ /-- Rounded frequency, given by `(nonzeroRound (k * target) : ℝ) / k`. -/ +@[expose] noncomputable def roundedFrequency (k target : ℝ) : ℝ := (nonzeroRound (k * target) : ℝ) / k theorem roundedFrequency_integer {k : ℝ} (hk : k ≠ 0) (target : ℝ) : @@ -1430,7 +1432,7 @@ theorem roundedFrequency_error {k : ℝ} (hk : 0 < k) (target : ℝ) : exact div_le_div_of_nonneg_right (nonzeroRound_error _) hk.le /-- The fixed representative frequency in its two tangential components. -/ -noncomputable def representativeFrequency (B sigma u L : ℝ) (K g : Plane) : Plane := +@[expose] noncomputable def representativeFrequency (B sigma u L : ℝ) (K g : Plane) : Plane := B • (K - (sigma * u / (L * ‖g‖ ^ 2)) • g) theorem representative_slope (B sigma u L : ℝ) (K g : Plane) @@ -1472,7 +1474,7 @@ theorem representative_frequency_bound (B sigma u L : ℝ) (K g : Plane) linarith only [h] /-- Signed slot, given by `sigma * (u / 2 + u * v / L)`. -/ -noncomputable def signedSlot (sigma u L v : ℝ) : ℝ := sigma * (u / 2 + u * v / L) +@[expose] noncomputable def signedSlot (sigma u L v : ℝ) : ℝ := sigma * (u / 2 + u * v / L) /-- The cancellation producing the intended radial slope is exact for the unrounded representative data. -/ @@ -1593,11 +1595,11 @@ theorem axial_frequency_bound {p target pz a b M rounding : ℝ} /-- Explicit normal, given by `!₂[x0 - v * (p * FR + pz * GR), p / R, pz - ε * v * (p * FZ + pz * GZ)]`. -/ -noncomputable def explicitNormal (ε p pz x0 R v FR GR FZ GZ : ℝ) : Space := +@[expose] noncomputable def explicitNormal (ε p pz x0 R v FR GR FZ GZ : ℝ) : Space := !₂[x0 - v * (p * FR + pz * GR), p / R, pz - ε * v * (p * FZ + pz * GZ)] /-- Reference normal, given by `MovingFrameODE.pack (B * signedSlot sigma u L v) (B • K)`. -/ -noncomputable def referenceNormal (B sigma u L v : ℝ) (K : Plane) : Space := +@[expose] noncomputable def referenceNormal (B sigma u L v : ℝ) (K : Plane) : Space := MovingFrameODE.pack (B * signedSlot sigma u L v) (B • K) theorem vec3_norm_le_sum (w : Space) : ‖w‖ ≤ |w 0| + |w 1| + |w 2| := by @@ -1710,7 +1712,7 @@ theorem phaseNormal_eq_explicit (ε p pz x0 : ℝ) (F G : Slow → ℝ) /-- Phase error, given by `1 / S + S * ε ^ 2 + S / k + ε * S`. -/ noncomputable def phaseError (S ε k : ℝ) : ℝ := 1 / S + S * ε ^ 2 + S / k + ε * S /-- Phase constant, given by `8 * M ^ 3 + 2 * M ^ 4`. -/ -noncomputable def phaseConstant (M : ℝ) : ℝ := 8 * M ^ 3 + 2 * M ^ 4 +@[expose] noncomputable def phaseConstant (M : ℝ) : ℝ := 8 * M ^ 3 + 2 * M ^ 4 theorem inverse_cube_bounds {S : ℝ} (hS : 1 ≤ S) : 1 / S ^ 3 ≤ 1 / S ∧ S * (1 / S ^ 3) ≤ 1 / S := by @@ -1809,7 +1811,7 @@ theorem phaseError_le_four_div {S ε k : ℝ} (hS : 0 < S) linarith only [h1, h2, h3] /-- Normal velocity, given by `!₂[-(p * FR + pz * GR), 0, -ε * (p * FZ + pz * GZ)]`. -/ -noncomputable def normalVelocity (ε p pz FR GR FZ GZ : ℝ) : Space := +@[expose] noncomputable def normalVelocity (ε p pz FR GR FZ GZ : ℝ) : Space := !₂[-(p * FR + pz * GR), 0, -ε * (p * FZ + pz * GZ)] /-- The slot derivative is estimated from its exact formula, independently of @@ -2033,23 +2035,23 @@ theorem transverseDirection_close {n : Space} {K : Plane} {B s δ : ℝ} /-- Scale derivative, given by `⟪MovingFrameODE.tail n, MovingFrameODE.tail n'⟫_ℝ / MovingFrameODE.normalScale n`. -/ -noncomputable def scaleDerivative (n n' : Space) : ℝ := +@[expose] noncomputable def scaleDerivative (n n' : Space) : ℝ := ⟪MovingFrameODE.tail n, MovingFrameODE.tail n'⟫_ℝ / MovingFrameODE.normalScale n /-- Slope derivative, given by `(n' 0 - MovingFrameODE.radialSlope n * scaleDerivative n n') / MovingFrameODE.normalScale n`. -/ -noncomputable def slopeDerivative (n n' : Space) : ℝ := +@[expose] noncomputable def slopeDerivative (n n' : Space) : ℝ := (n' 0 - MovingFrameODE.radialSlope n * scaleDerivative n n') / MovingFrameODE.normalScale n /-- Direction derivative, given by `(MovingFrameODE.normalScale n)⁻¹ • (MovingFrameODE.tail n' - scaleDerivative n n' • MovingFrameODE.normalDirection n)`. -/ -noncomputable def directionDerivative (n n' : Space) : Plane := +@[expose] noncomputable def directionDerivative (n n' : Space) : Plane := (MovingFrameODE.normalScale n)⁻¹ • (MovingFrameODE.tail n' - scaleDerivative n n' • MovingFrameODE.normalDirection n) /-- Angular velocity, given by `⟪MovingFrameODE.quarterTurn (MovingFrameODE.normalDirection n), directionDerivative n n'⟫_ℝ`. -/ -noncomputable def angularVelocity (n n' : Space) : ℝ := +@[expose] noncomputable def angularVelocity (n n' : Space) : ℝ := ⟪MovingFrameODE.quarterTurn (MovingFrameODE.normalDirection n), directionDerivative n n'⟫_ℝ theorem hasDerivAt_normalScale {n : ℝ → Space} {n' : Space} {v : ℝ} @@ -2232,7 +2234,7 @@ theorem radius_difference_le {q q0 : Slow} {diameter : ℝ} (hd : ‖q - q0‖ simpa only [Prod.fst_sub, Real.norm_eq_abs] using (norm_fst_le (q - q0)).trans hd /-- Shear vector, given by `!₂[q.1 * PhaseCalculus.slowR F q, PhaseCalculus.slowR G q]`. -/ -noncomputable def shearVector (F G : Slow → ℝ) (q : Slow) : Plane := +@[expose] noncomputable def shearVector (F G : Slow → ℝ) (q : Slow) : Plane := !₂[q.1 * PhaseCalculus.slowR F q, PhaseCalculus.slowR G q] theorem localBase_shear_error {F G F0 G0 : Slow → ℝ} {U : Set Slow} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalClassBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalClassBounds.lean index 7f6430395b..ea54978cdb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalClassBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalClassBounds.lean @@ -20,7 +20,7 @@ The final passage uses genuine common-coordinate compositions and the physical carrier estimates of `PhysicalWaveSum`. -/ -@[expose] public section +public section noncomputable section @@ -469,7 +469,7 @@ theorem strippedClass {s : StripData D} {h α σ a b r0 P : ℝ} /-- The derivative loss includes the displayed physical field rescaling. It depends on the derivative order and fixed scaling parameters only. -/ -noncomputable def physicalLoss (h σ : ℝ) (m : ℕ) : ℝ := +@[expose] noncomputable def physicalLoss (h σ : ℝ) (m : ℕ) : ℝ := PhysicalGraphBounds.waveLoss h m - σ /-- Full physical jets of the actual locally finite wave sum. The @@ -631,7 +631,7 @@ theorem physical_vector_curl_jet_bound {s : StripData D} {h α σ a b r0 Z P : abbrev CylindricalPoint := ℝ × ((ℝ × ℝ) × PhysicalGraphBounds.Plane) /-- Cartesian radius, given by `Real.sqrt (y.1 ^ 2 + y.2 ^ 2)`. -/ -noncomputable def cartesianRadius (y : PhysicalGraphBounds.Plane) : ℝ := +@[expose] noncomputable def cartesianRadius (y : PhysicalGraphBounds.Plane) : ℝ := Real.sqrt (y.1 ^ 2 + y.2 ^ 2) theorem cartesianRadius_smooth : @@ -663,7 +663,7 @@ theorem norm_slowFast_le : ‖slowFast‖ ≤ 1 := by (le_max_right _ _) /-- Cylindrical map, given by `(cartesianRadius (PhysicalGraphBounds.liftXY x), slowFast x)`. -/ -noncomputable def cylindricalMap (x : PhysicalWaveSum.LiftPoint) : CylindricalPoint := +@[expose] noncomputable def cylindricalMap (x : PhysicalWaveSum.LiftPoint) : CylindricalPoint := (cartesianRadius (PhysicalGraphBounds.liftXY x), slowFast x) /-- Cylindrical domain, given by `(fun x => ‖PhysicalGraphBounds.liftXY x‖) ⁻¹' Ioo (a / 2) (b + diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCoordinateBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCoordinateBounds.lean index 8caef74e0e..deeef203ef 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCoordinateBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCoordinateBounds.lean @@ -18,7 +18,7 @@ Jacobian. Their normalized values extend smoothly to the compact set one power of `q` per physical derivative. -/ -@[expose] public section +public section noncomputable section @@ -40,16 +40,16 @@ private theorem infty_add_one_le : (∞ : WithTop ℕ∞) + 1 ≤ ∞ := by simpa only [ENat.coe_top_add_one] using (le_rfl : (∞ : WithTop ℕ∞) ≤ ∞) /-- D, given by `(1 - a) / 2`. -/ -noncomputable def D (a : ℝ) : ℝ := (1 - a) / 2 +@[expose] noncomputable def D (a : ℝ) : ℝ := (1 - a) / 2 /-- Positive time, given by `{p | 0 < p.1}`. -/ -noncomputable def positiveTime : Set Point := {p | 0 < p.1} +@[expose] noncomputable def positiveTime : Set Point := {p | 0 < p.1} /-- Q coord, given by `coordinateQ a (p.1, p.2.2)`. -/ -noncomputable def qCoord (a : ℝ) (p : Point) : ℝ := coordinateQ a (p.1, p.2.2) +@[expose] noncomputable def qCoord (a : ℝ) (p : Point) : ℝ := coordinateQ a (p.1, p.2.2) /-- Inverse coordinates, given by `(qCoord a p, p.2)`. -/ -noncomputable def inverseCoordinates (a : ℝ) (p : Point) : Point := (qCoord a p, p.2) +@[expose] noncomputable def inverseCoordinates (a : ℝ) (p : Point) : Point := (qCoord a p, p.2) /-- Inverse differential as an element of `Point →L[ℝ] Point`. -/ noncomputable def inverseDifferential (a : ℝ) (y : Point) : Point →L[ℝ] Point := @@ -205,7 +205,7 @@ theorem exists_normalized_jet_bound {a : ℝ} (ha : 0 < a) (ha1 : a < 1) /-- The physical dilation: time and squared radius have weight one, while the axial variable has weight `D = (1-a)/2`. -/ -noncomputable def dilation (a r : ℝ) : Point →L[ℝ] Point := +@[expose] noncomputable def dilation (a r : ℝ) : Point →L[ℝ] Point := (r • ContinuousLinearMap.fst ℝ ℝ (ℝ × ℝ)).prod (((r • ContinuousLinearMap.fst ℝ ℝ ℝ).comp (ContinuousLinearMap.snd ℝ ℝ (ℝ × ℝ))).prod (((r ^ D a) • ContinuousLinearMap.snd ℝ ℝ ℝ).comp @@ -247,10 +247,10 @@ theorem inverseCoordinates_dilation {a r : ℝ} (ha : 0 < a) (ha1 : a < 1) (hr : · rfl /-- Eta coord, given by `p.2.2 / qCoord a p ^ D a`. -/ -noncomputable def etaCoord (a : ℝ) (p : Point) : ℝ := p.2.2 / qCoord a p ^ D a +@[expose] noncomputable def etaCoord (a : ℝ) (p : Point) : ℝ := p.2.2 / qCoord a p ^ D a /-- X coord, given by `p.2.1 / qCoord a p`. -/ -noncomputable def xCoord (a : ℝ) (p : Point) : ℝ := p.2.1 / qCoord a p +@[expose] noncomputable def xCoord (a : ℝ) (p : Point) : ℝ := p.2.1 / qCoord a p theorem normalized_inverseCoordinates {a : ℝ} (ha : 0 < a) (ha1 : a < 1) {p : Point} (hp : p ∈ positiveTime) : @@ -465,7 +465,7 @@ noncomputable def timeReflection : Point ≃ₗᵢ[ℝ] Point where rw [norm_neg] /-- Time shift, given by `(1 - p.1, p.2)`. -/ -noncomputable def timeShift (p : Point) : Point := (1 - p.1, p.2) +@[expose] noncomputable def timeShift (p : Point) : Point := (1 - p.1, p.2) theorem timeShift_eq (p : Point) : timeShift p = ((1 : ℝ), ((0 : ℝ), (0 : ℝ))) + timeReflection p := by @@ -486,13 +486,13 @@ theorem norm_iteratedFDeriv_timeShift (F : Point → ℝ) (n : ℕ) (p : Point) /-- Physical coordinates use `(t,s,z)`. The exponent parameter here is `a = 2h`, so these definitions agree with the coordinates used by NaturalCore. -/ -noncomputable def physicalQ (a : ℝ) : Point → ℝ := qCoord a ∘ timeShift +@[expose] noncomputable def physicalQ (a : ℝ) : Point → ℝ := qCoord a ∘ timeShift /-- Physical eta, given by `etaCoord a ∘ timeShift`. -/ -noncomputable def physicalEta (a : ℝ) : Point → ℝ := etaCoord a ∘ timeShift +@[expose] noncomputable def physicalEta (a : ℝ) : Point → ℝ := etaCoord a ∘ timeShift /-- Physical X, given by `xCoord a ∘ timeShift`. -/ -noncomputable def physicalX (a : ℝ) : Point → ℝ := xCoord a ∘ timeShift +@[expose] noncomputable def physicalX (a : ℝ) : Point → ℝ := xCoord a ∘ timeShift theorem physicalQ_pos {a : ℝ} (ha : 0 < a) (ha1 : a < 1) {p : Point} (hp : p.1 < 1) : 0 < physicalQ a p := qCoord_pos ha ha1 (sub_pos.mpr hp) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCopyBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCopyBounds.lean index df8dddd711..3aba69750e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCopyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCopyBounds.lean @@ -19,7 +19,7 @@ physical estimate is then the center-independent single-carrier estimate, followed by the existing bounded overlap estimate for the outer labels. -/ -@[expose] public section +public section noncomputable section @@ -88,21 +88,21 @@ structure CopyFamily (H : ℕ) (K : Type*) where amplitude : K → WaveIndex H → LiftPoint → ℂ /-- Copy, given by `⟨f.gap, f.carrier k, f.amplitude k⟩`. -/ -noncomputable def CopyFamily.copy {H : ℕ} {K : Type*} (f : CopyFamily H K) (k : K) : +@[expose] noncomputable def CopyFamily.copy {H : ℕ} {K : Type*} (f : CopyFamily H K) (k : K) : WaveFamily H := ⟨f.gap, f.carrier k, f.amplitude k⟩ /-- Term, given by `(f.copy k).term a h r0 I`. -/ -noncomputable def CopyFamily.term {H : ℕ} {K : Type*} (f : CopyFamily H K) +@[expose] noncomputable def CopyFamily.term {H : ℕ} {K : Type*} (f : CopyFamily H K) (a h r0 : ℝ) (I : WaveIndex H) (k : K) : SpaceTime → ℂ := (f.copy k).term a h r0 I /-- Sum full local carriers, including their individual phases. -/ -noncomputable def CopyFamily.periodized {H : ℕ} {K : Type*} (f : CopyFamily H K) +@[expose] noncomputable def CopyFamily.periodized {H : ℕ} {K : Type*} (f : CopyFamily H K) (a h r0 : ℝ) (I : WaveIndex H) (w : SpaceTime) : ℂ := ∑' k, f.term a h r0 I k w /-- Sum, given by `∑ᶠ I, f.periodized a h r0 I w`. -/ -noncomputable def CopyFamily.sum {H : ℕ} {K : Type*} (f : CopyFamily H K) +@[expose] noncomputable def CopyFamily.sum {H : ℕ} {K : Type*} (f : CopyFamily H K) (a h r0 : ℝ) (w : SpaceTime) : ℂ := ∑ᶠ I, f.periodized a h r0 I w @@ -417,7 +417,7 @@ theorem CommonChart.amplitude_bound {s : StripData D} {α σ : ℝ} _ = _ := by rw [Real.rpow_add hQ, pow_add, mul_pow, ← pow_mul]; ring /-- Copy band domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ -noncomputable def copyBandDomain {V : Type*} [NormedAddCommGroup V] +@[expose] noncomputable def copyBandDomain {V : Type*} [NormedAddCommGroup V] (U : K → BandLabel → Set V) (hU : ∀ k L, IsOpen (U k L)) : PhaseJetBounds.Domain (K × BandLabel) V where scale i := ChartScales.S i.2.val.1 @@ -648,7 +648,7 @@ theorem RegularFamily.sum_support (hr : RegularFamily f a b h r0 Z Δ) (hr.copy k).term_support I w hw hk⟩ /-- Vector sum, given by `∑ i : Fin 3, realCoordinate i ((f i).sum a h r0 w)`. -/ -noncomputable def vectorSum (f : Fin 3 → CopyFamily H K) (a h r0 : ℝ) +@[expose] noncomputable def vectorSum (f : Fin 3 → CopyFamily H K) (a h r0 : ℝ) (w : SpaceTime) : Space := ∑ i : Fin 3, realCoordinate i ((f i).sum a h r0 w) theorem vectorSum_smooth {f : Fin 3 → CopyFamily H K} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCurlCovariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCurlCovariance.lean index 22c1c0a433..e8ca2f9b14 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCurlCovariance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalCurlCovariance.lean @@ -16,7 +16,7 @@ The potential is differentiated before any cutoff or carrier is removed. All operators below are actual Frechet derivatives. -/ -@[expose] public section +public section namespace NavierStokes.PhysicalCurlCovariance @@ -37,7 +37,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Real vector, given by `AxisymmetricResidual.pack (a 0).re (a 1).re (a 2).re`. -/ -noncomputable def realVector (a : ComplexVector) : Space := +@[expose] noncomputable def realVector (a : ComplexVector) : Space := AxisymmetricResidual.pack (a 0).re (a 1).re (a 2).re @[simp] theorem realVector_apply (a : ComplexVector) (i : Fin 3) : @@ -45,7 +45,7 @@ noncomputable def realVector (a : ComplexVector) : Space := fin_cases i <;> simp [realVector] /-- Real curl as an element of `Fin 3 → ℝ`. -/ -noncomputable def realCurl (R : E → ℝ) (Vr Vθ Vz : E → E) +@[expose] noncomputable def realCurl (R : E → ℝ) (Vr Vθ Vz : E → E) (a : E → Fin 3 → ℝ) (x : E) : Fin 3 → ℝ := ![(R x)⁻¹ * along Vθ (fun y => a y 2) x - along Vz (fun y => a y 1) x, along Vz (fun y => a y 0) x - along Vr (fun y => a y 2) x, @@ -288,11 +288,12 @@ theorem realVector_differentiableAt {a : E → ComplexVector} {x : E} namespace ScaledGraph /-- Complex potential, given by `(c : ℂ) • B (G.map z)`. -/ +@[expose] noncomputable def complexPotential (G : ScaledGraph) (c : ℝ) (B : Cylinder → ComplexVector) (z : SpaceTime) : ComplexVector := (c : ℂ) • B (G.map z) /-- Real potential, defined pointwise by `realVector (complexPotential G c B z)`. -/ -noncomputable def realPotential (G : ScaledGraph) (c : ℝ) (B : Cylinder → ComplexVector) : +@[expose] noncomputable def realPotential (G : ScaledGraph) (c : ℝ) (B : Cylinder → ComplexVector) : VelocityField := fun z => realVector (complexPotential G c B z) theorem complexPotential_differentiableAt (G : ScaledGraph) {z : SpaceTime} @@ -541,7 +542,7 @@ theorem vectorPotential_congr (K : ℝ) (R : E → ℝ) (Vr Vθ Vz : E → E) /-- The single reference potential expressed in physical cylindrical coordinates, before taking its real part and rotating to Cartesian axes. -/ -noncomputable def referencePotential (K : ℝ) (Ψ : SpaceTime → ℝ) +@[expose] noncomputable def referencePotential (K : ℝ) (Ψ : SpaceTime → ℝ) (a : SpaceTime → ComplexVector) : SpaceTime → ComplexVector := CurlClassBounds.vectorPotential K LinearWaveResidual.coordinateRadius (LinearWaveResidual.spaceDirection 0) (LinearWaveResidual.spaceDirection 1) @@ -691,18 +692,19 @@ theorem realVector_smooth : ContDiff ℝ ∞ realVector := by exact Complex.reCLM.contDiff.comp (ContinuousLinearMap.proj i : ComplexVector →L[ℝ] ℂ).contDiff /-- Polar input, given by `PolarCharts.chart a j (PhysicalGraphBounds.radialProjection z)`. -/ -noncomputable def polarInput (a : ℝ) (j : PolarCharts.Index) (z : SpaceTime) : +@[expose] noncomputable def polarInput (a : ℝ) (j : PolarCharts.Index) (z : SpaceTime) : PhysicalResidualBridge.Plane := PolarCharts.chart a j (PhysicalGraphBounds.radialProjection z) /-- Polar coordinates, given by `(z.1, AxisymmetricResidual.pack (polarInput a j z).1 (polarInput a j z).2 (z.2 2))`. -/ +@[expose] noncomputable def polarCoordinates (a : ℝ) (j : PolarCharts.Index) (z : SpaceTime) : SpaceTime := (z.1, AxisymmetricResidual.pack (polarInput a j z).1 (polarInput a j z).2 (z.2 2)) /-- The actual Cartesian field, not a prescribed derivative or a matching predicate. Its inverse polar chart has a smooth global extension. -/ -noncomputable def cartesianPotential (a : ℝ) (j : PolarCharts.Index) +@[expose] noncomputable def cartesianPotential (a : ℝ) (j : PolarCharts.Index) (B : SpaceTime → ComplexVector) (z : SpaceTime) : Space := CylindricalResidual.frame (polarInput a j z).2 (realVector (B (polarCoordinates a j z))) @@ -850,7 +852,7 @@ theorem cartesianPotential_curl_overlap {a : ℝ} (ha : 0 < a) (i j : PolarChart /-- A single actual Cartesian potential is selected from the compatible local inverse charts. Outside their union it is defined to be zero. -/ -noncomputable def globalCartesianPotential (a : ℝ) (B : SpaceTime → ComplexVector) +@[expose] noncomputable def globalCartesianPotential (a : ℝ) (B : SpaceTime → ComplexVector) (x : SpaceTime) : Space := by classical exact if h : ∃ j : PolarCharts.Index, diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalGraphBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalGraphBounds.lean index c070c5f3dd..2c41585dfa 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalGraphBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalGraphBounds.lean @@ -33,7 +33,7 @@ inverse on neighborhoods of four compact sectors. Their global extensions are not asserted to be a global choice of angle. -/ -@[expose] public section +public section noncomputable section @@ -87,7 +87,7 @@ theorem rotate_sum_sq (j : Index) (p : Plane) : fin_cases j <;> simp [rotate] <;> ring /-- Radius, given by `Real.sqrt (p.1 ^ 2 + p.2 ^ 2)`. -/ -noncomputable def radius (p : Plane) : ℝ := Real.sqrt (p.1 ^ 2 + p.2 ^ 2) +@[expose] noncomputable def radius (p : Plane) : ℝ := Real.sqrt (p.1 ^ 2 + p.2 ^ 2) theorem radius_nonneg (p : Plane) : 0 ≤ radius p := Real.sqrt_nonneg _ @@ -130,7 +130,7 @@ theorem radius_rotate (j : Index) (p : Plane) : radius (rotate j p) = radius p : simp only [radius, rotate_sum_sq] /-- The genuine Cartesian map, with radius in the first coordinate. -/ -noncomputable def polar (q : Plane) : Plane := +@[expose] noncomputable def polar (q : Plane) : Plane := (q.1 * Real.cos q.2, q.1 * Real.sin q.2) theorem polar_contDiff : ContDiff ℝ ∞ polar := @@ -200,7 +200,7 @@ theorem localChart_contDiffAt (j : Index) {p : Plane} (hp : 0 < (rotate j p).1) ((hc.snd.div hc.fst hp.ne').arctan.add contDiffAt_const) /-- The original normalized compact annulus uses the product norm. -/ -noncomputable def annulus (a b : ℝ) : Set Plane := +@[expose] noncomputable def annulus (a b : ℝ) : Set Plane := Metric.closedBall 0 b ∩ {p | a ≤ ‖p‖} /-- Compact sectors are strictly inside their chart domains. -/ @@ -378,7 +378,7 @@ noncomputable def scalePlane (Q : ℝ) : Plane →L[ℝ] Plane := Q ^ (-(1 / 2 : ℝ)) • ContinuousLinearMap.id ℝ Plane @[simp] theorem scalePlane_apply (Q : ℝ) (p : Plane) : - scalePlane Q p = Q ^ (-(1 / 2 : ℝ)) • p := rfl + scalePlane Q p = Q ^ (-(1 / 2 : ℝ)) • p := by rfl theorem norm_scalePlane_le {Q : ℝ} (hQ : 0 < Q) : ‖scalePlane Q‖ ≤ Q ^ (-(1 / 2 : ℝ)) := by @@ -514,7 +514,7 @@ end end -@[expose] public section +public section noncomputable section @@ -531,9 +531,9 @@ private theorem nat_le_infty (k : ℕ) : (k : WithTop ℕ∞) ≤ ∞ := abbrev Plane := ℝ × ℝ /-- Radial direction, given by `(1, 1 - Real.sqrt 2)`. -/ -noncomputable def radialDirection : Plane := (1, 1 - Real.sqrt 2) +@[expose] noncomputable def radialDirection : Plane := (1, 1 - Real.sqrt 2) /-- Time direction, given by `(Real.sqrt 2 - 1, 1)`. -/ -noncomputable def timeDirection : Plane := (Real.sqrt 2 - 1, 1) +@[expose] noncomputable def timeDirection : Plane := (Real.sqrt 2 - 1, 1) theorem cover_radialDirection : SlotGeometry.cover radialDirection = ChartScales.Lambda • radialDirection := by @@ -568,7 +568,7 @@ noncomputable def radialProjection : SpaceTime →L[ℝ] Plane := ((AxisymmetricFields.projection 1).comp (ContinuousLinearMap.snd ℝ ℝ Space)) @[simp] theorem radialProjection_apply (p : SpaceTime) : - radialProjection p = (p.2 0, p.2 1) := rfl + radialProjection p = (p.2 0, p.2 1) := by rfl theorem norm_radialProjection_le : ‖radialProjection‖ ≤ 1 := by refine ContinuousLinearMap.opNorm_le_bound _ zero_le_one ?_ @@ -579,11 +579,11 @@ theorem norm_radialProjection_le : ‖radialProjection‖ ≤ 1 := by ((PiLp.norm_apply_le p.2 1).trans (le_max_right _ _)) /-- Radius power, given by `(y.1 ^ 2 + y.2 ^ 2) ^ (d / 2)`. -/ -noncomputable def radiusPower (d : ℝ) (y : Plane) : ℝ := +@[expose] noncomputable def radiusPower (d : ℝ) (y : Plane) : ℝ := (y.1 ^ 2 + y.2 ^ 2) ^ (d / 2) /-- Radial profile, given by `radiusPower d y • radialDirection`. -/ -noncomputable def radialProfile (d : ℝ) (y : Plane) : Plane := +@[expose] noncomputable def radialProfile (d : ℝ) (y : Plane) : Plane := radiusPower d y • radialDirection theorem radiusPower_eq (d : ℝ) (y : Plane) : @@ -615,7 +615,7 @@ theorem radiusPower_smul (d : ℝ) {a : ℝ} (ha : 0 < a) (y : Plane) : rw [show ((2 : ℕ) : ℝ) * (d / 2) = d by norm_num; ring] /-- The universal-cover representative of `Y_i=J_g^i(v_r r^d+v_t t)`. -/ -noncomputable def nativeGraph (h : ℝ) (n : ℕ) (p : SpaceTime) : Plane := +@[expose] noncomputable def nativeGraph (h : ℝ) (n : ℕ) (p : SpaceTime) : Plane := (SlotGeometry.cover ^ ChartScales.nativeIndex h n) (radialProfile (ChartScales.radialExponent h) (radialProjection p) + p.1 • timeDirection) @@ -630,7 +630,7 @@ theorem nativeGraph_eq (h : ℝ) (n : ℕ) (p : SpaceTime) : congr 1 <;> congr 1 <;> ring /-- Scaled radial, given by `ChartScales.Q n ^ (-(1 / 2 : ℝ)) • radialProjection`. -/ -noncomputable def scaledRadial (n : ℕ) : SpaceTime →L[ℝ] Plane := +@[expose] noncomputable def scaledRadial (n : ℕ) : SpaceTime →L[ℝ] Plane := ChartScales.Q n ^ (-(1 / 2 : ℝ)) • radialProjection theorem norm_scaledRadial_le (n : ℕ) : @@ -665,7 +665,7 @@ theorem nativeGraph_normalized (h : ℝ) (n : ℕ) (p : SpaceTime) : simp only [nativeGraph_eq, radialProfile, hr, ChartScales.radialCoefficient, smul_smul, mul_assoc] /-- A fixed compact transverse annulus in normalized Cartesian coordinates. -/ -noncomputable def annulus (a b : ℝ) : Set Plane := +@[expose] noncomputable def annulus (a b : ℝ) : Set Plane := Metric.closedBall 0 b ∩ {y | a ≤ ‖y‖} theorem isCompact_annulus (a b : ℝ) : IsCompact (annulus a b) := @@ -788,7 +788,7 @@ theorem norm_positive_jet_linear_le {E F : Type*} noncomputable def timeProfile : SpaceTime →L[ℝ] Plane := (ContinuousLinearMap.fst ℝ ℝ Space).smulRight timeDirection -@[simp] theorem timeProfile_apply (p : SpaceTime) : timeProfile p = p.1 • timeDirection := rfl +@[simp] theorem timeProfile_apply (p : SpaceTime) : timeProfile p = p.1 • timeDirection := by rfl theorem norm_timeProfile_le : ‖timeProfile‖ ≤ ‖timeDirection‖ := by refine ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) ?_ @@ -905,7 +905,7 @@ noncomputable def coordinateProjection (j : Fin 3) : SpaceTime →L[ℝ] ℝ := (AxisymmetricFields.projection j).comp (ContinuousLinearMap.snd ℝ ℝ Space) @[simp] theorem coordinateProjection_apply (j : Fin 3) (p : SpaceTime) : - coordinateProjection j p = p.2 j := rfl + coordinateProjection j p = p.2 j := by rfl /-- Cartesian form of the exact chart `(T, R cos θ, R sin θ, Z)`. -/ noncomputable def chartLinear (h : ℝ) (n : ℕ) : SpaceTime →L[ℝ] ChartPoint := @@ -922,7 +922,7 @@ noncomputable def chartLinear (h : ℝ) (n : ℕ) : SpaceTime →L[ℝ] ChartPoi simp [chartLinear, smul_eq_mul] /-- Physical chart, given by `chartLinear h n p + (ChartScales.Q n ^ (-1 : ℝ), 0)`. -/ -noncomputable def physicalChart (h : ℝ) (n : ℕ) (p : SpaceTime) : ChartPoint := +@[expose] noncomputable def physicalChart (h : ℝ) (n : ℕ) (p : SpaceTime) : ChartPoint := chartLinear h n p + (ChartScales.Q n ^ (-1 : ℝ), 0) theorem physicalChart_time (h : ℝ) (n : ℕ) (p : SpaceTime) : @@ -988,7 +988,7 @@ theorem iteratedFDeriv_pair {E F G : Type*} [NormedAddCommGroup E] [NormedSpace · exact (congrArg (fun M => M v) h2).symm /-- Actual graph restriction together with the exact physical chart scaling. -/ -noncomputable def physicalLift (h : ℝ) (n : ℕ) (p : SpaceTime) : LiftPoint := +@[expose] noncomputable def physicalLift (h : ℝ) (n : ℕ) (p : SpaceTime) : LiftPoint := (physicalChart h n p, nativeGraph h n p) theorem physicalLift_smooth (h : ℝ) (n : ℕ) : @@ -1091,6 +1091,11 @@ noncomputable def slotTime (h : ℝ) (n : ℕ) (center : Plane) (r0 : ℝ) (p : SpaceTime) : ℝ := (etaCoordinate (nativeGraph h n p - center) + r0) / ChartScales.timeCoefficient h n +theorem slotTime_eq_nativeGraph (h : ℝ) (n : ℕ) (center : Plane) (r0 : ℝ) + (p : SpaceTime) : + slotTime h n center r0 p = + (etaCoordinate (nativeGraph h n p - center) + r0) / ChartScales.timeCoefficient h n := by rfl + theorem slotTime_affine (h : ℝ) (n : ℕ) (center : Plane) (r0 : ℝ) (p : SpaceTime) : slotTime h n center r0 p = ChartScales.Q n ^ (-1 - h) * p.1 + @@ -1147,10 +1152,10 @@ theorem carrier_upper {h : ℝ} (hh : 0 ≤ h) (n : ℕ) : ring /-- Phase factor, given by `(c : ℂ) * Complex.I`. -/ -noncomputable def phaseFactor (c : ℝ) : ℂ := (c : ℂ) * Complex.I +@[expose] noncomputable def phaseFactor (c : ℝ) : ℂ := (c : ℂ) * Complex.I /-- Character, given by `Complex.exp (phaseFactor c * (t : ℂ))`. -/ -noncomputable def character (c : ℝ) (t : ℝ) : ℂ := +@[expose] noncomputable def character (c : ℝ) (t : ℝ) : ℂ := Complex.exp (phaseFactor c * (t : ℂ)) @[simp] theorem norm_character (c t : ℝ) : ‖character c t‖ = 1 := by @@ -1555,14 +1560,14 @@ noncomputable def liftXY : LiftPoint →L[ℝ] Plane := (ContinuousLinearMap.fst ℝ ChartPoint Plane) /-- Lift ZT as an element of `LiftPoint →L[ℝ] Plane`. -/ -noncomputable def liftZT : LiftPoint →L[ℝ] Plane := +@[expose] noncomputable def liftZT : LiftPoint →L[ℝ] Plane := (((ContinuousLinearMap.snd ℝ ℝ ℝ).comp ((ContinuousLinearMap.snd ℝ ℝ (ℝ × ℝ)).comp (ContinuousLinearMap.snd ℝ ℝ (ℝ × (ℝ × ℝ))))).prod (ContinuousLinearMap.fst ℝ ℝ (ℝ × (ℝ × ℝ)))).comp (ContinuousLinearMap.fst ℝ ChartPoint Plane) -@[simp] theorem liftXY_apply (y : LiftPoint) : liftXY y = (y.1.2.1, y.1.2.2.1) := rfl +@[simp] theorem liftXY_apply (y : LiftPoint) : liftXY y = (y.1.2.1, y.1.2.2.1) := by rfl @[simp] theorem liftZT_apply (y : LiftPoint) : liftZT y = (y.1.2.2.2, y.1.1) := rfl theorem norm_liftXY_le : ‖liftXY‖ ≤ 1 := by @@ -1698,7 +1703,7 @@ theorem slotMap_physical (κ : Plane → Plane) (h : ℝ) (n : ℕ) /-- Composition of (26) with the actual native slot map. This is the phase whose exponential is used in the physical carrier estimate. -/ -noncomputable def liftedPhase (κ : Plane → Plane) (h : ℝ) (n : ℕ) +@[expose] noncomputable def liftedPhase (κ : Plane → Plane) (h : ℝ) (n : ℕ) (center : Plane) (r0 p pz x0 : ℝ) (F G : Slow → ℝ) : LiftPoint → ℝ := PhaseCalculus.phase (ChartScales.epsilon h n) p pz x0 F G ∘ slotMap κ (ChartScales.timeCoefficient h n) center r0 @@ -1872,7 +1877,7 @@ theorem liftedPhase_power_bound {h K Z r0 P B d : ℝ} _ ≤ _ := by gcongr; exact le_max_right 1 C0 /-- Wave loss, given by `graphLoss m + (m : ℝ) + h * (m : ℝ) / 2 + 1`. -/ -noncomputable def waveLoss (h : ℝ) (m : ℕ) : ℝ := +@[expose] noncomputable def waveLoss (h : ℝ) (m : ℕ) : ℝ := graphLoss m + (m : ℝ) + h * (m : ℝ) / 2 + 1 theorem carrier_weight_identity {q S : ℝ} (hq : 0 < q) (hS : 0 < S) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalHeatCoordinates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalHeatCoordinates.lean index a9be5745d9..dfa1950b91 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalHeatCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalHeatCoordinates.lean @@ -18,7 +18,7 @@ satisfies `1-t = q - z^2*q^(2*h)`. The quadratic-coordinate helper with edit to the terminal angular velocity, including its normalization. -/ -@[expose] public section +public section noncomputable section @@ -63,7 +63,7 @@ noncomputable def editedAngular (d : OutgoingTail.TailData) (K : ℝ) ParametricHeatTail.physicalEdit d K (eta d.h p) (X d.h p) /-- Shape, given by `OutgoingTail.tailShape d (y - Real.log K + 1 / 5)`. -/ -noncomputable def shape (d : OutgoingTail.TailData) (K y : ℝ) : ℝ := +@[expose] noncomputable def shape (d : OutgoingTail.TailData) (K y : ℝ) : ℝ := OutgoingTail.tailShape d (y - Real.log K + 1 / 5) theorem editedAngular_eq_heat (d : OutgoingTail.TailData) {K : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalMeanJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalMeanJetBounds.lean index e31cfbc306..37ba7ce422 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalMeanJetBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalMeanJetBounds.lean @@ -19,7 +19,7 @@ derivative estimates are derived from the actual physical graph and radius map. The final restriction is a single coherent physical field, not a sum over bands. -/ -@[expose] public section +public section noncomputable section @@ -33,13 +33,13 @@ open scoped Topology ContDiff BigOperators abbrev Point := PressureStream.Lift PhysicalGraphBounds.Plane /-- The unscaled physical cylindrical point with the actual auxiliary graph. -/ -noncomputable def physicalPoint (h : ℝ) (w : SpaceTime) : Point := +@[expose] noncomputable def physicalPoint (h : ℝ) (w : SpaceTime) : Point := (PhysicalClassBounds.cartesianRadius (PhysicalGraphBounds.radialProjection w), ((1 - w.1, w.2 2), PhysicalGraphBounds.radialProfile (ChartScales.radialExponent h) (PhysicalGraphBounds.radialProjection w) + w.1 • PhysicalGraphBounds.timeDirection)) /-- A bounded-gap common-cover graph, in the mean-field coordinate order. -/ -noncomputable def graph (h : ℝ) (n d : ℕ) : SpaceTime → Point := +@[expose] noncomputable def graph (h : ℝ) (n d : ℕ) : SpaceTime → Point := PhysicalClassBounds.cylindricalMap ∘ commonLift h n d theorem cartesianRadius_smul {c : ℝ} (hc : 0 ≤ c) (y : PhysicalGraphBounds.Plane) : @@ -141,11 +141,12 @@ theorem common_stripped_physical_bound_local {h a b : ℝ} exact hjet i hi /-- Band field, defined pointwise by `(ChartScales.Q n ^ (-degree)) • f (graph h n d w)`. -/ +@[expose] noncomputable def bandField (h : ℝ) (n d : ℕ) (degree : ℝ) (f : Point → E) : SpaceTime → E := fun w => (ChartScales.Q n ^ (-degree)) • f (graph h n d w) /-- Loss, given by `PhysicalGraphBounds.graphLoss m + 1 + degree`. -/ -noncomputable def loss (degree : ℝ) (m : ℕ) : ℝ := +@[expose] noncomputable def loss (degree : ℝ) (m : ℕ) : ℝ := PhysicalGraphBounds.graphLoss m + 1 + degree /-- Actual cylindrical mean-field restriction. Both graph stages are @@ -540,7 +541,7 @@ theorem loss_stream (h : ℝ) (m : ℕ) : /-- The Cartesian unit angular direction, with the usual totalized value at the axis. Axis regularity below comes from the supported coefficient. -/ -noncomputable def angularVector (y : PhysicalGraphBounds.Plane) : Space := +@[expose] noncomputable def angularVector (y : PhysicalGraphBounds.Plane) : Space := (-y.2 / PhysicalClassBounds.cartesianRadius y) • coordinateVector 0 + (y.1 / PhysicalClassBounds.cartesianRadius y) • coordinateVector 1 @@ -629,7 +630,7 @@ theorem angularVector_scaledRadial (n : ℕ) (w : SpaceTime) : /-- This is the direct angular vector when `degree = A h`, and the azimuthal stream potential when `degree = A h - 1/2`. -/ -noncomputable def bandAngularField (h : ℝ) (n d : ℕ) (degree : ℝ) +@[expose] noncomputable def bandAngularField (h : ℝ) (n d : ℕ) (degree : ℝ) (f : Point → ℝ) : VelocityField := fun w => bandField h n d degree f w • angularVector (PhysicalGraphBounds.radialProjection w) @@ -717,6 +718,7 @@ theorem bandAngularField_jet_bound {h a b : ℝ} /-- The actual Cartesian vector associated with the coherent scalar field. The formula applies both to angular velocity and stream potential. -/ +@[expose] noncomputable def CoherentFamily.angularField (D : CoherentFamily h degree N Δ U ℝ) : VelocityField := fun w => D.field w • angularVector (PhysicalGraphBounds.radialProjection w) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalParticularWave.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalParticularWave.lean index de4618f332..9a4a910b2b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalParticularWave.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalParticularWave.lean @@ -19,7 +19,7 @@ The input is the constructed reference Volterra solve. Curl identities are conclusions, not compatibility assumptions on solved velocities. -/ -@[expose] public section +public section namespace NavierStokes.PhysicalParticularWave @@ -193,11 +193,11 @@ noncomputable def waveEquiv : Cylinder ≃ₗᵢ[ℝ] WaveSpace := waveEquiv x = (((x.1.1, (x.1.2.1.2, x.1.2.1.1)), x.2), x.1.2.2) := rfl /-- Native map, given by `waveEquiv ((PhysicalResidualBridge.commonGraph Q h i).map z)`. -/ -noncomputable def nativeMap (h Q : ℝ) (i : ℕ) (z : SpaceTime) : WaveSpace := +@[expose] noncomputable def nativeMap (h Q : ℝ) (i : ℕ) (z : SpaceTime) : WaveSpace := waveEquiv ((PhysicalResidualBridge.commonGraph Q h i).map z) /-- Ratio power, given by `Q ^ a / Qr ^ a`. -/ -noncomputable def ratioPower (Q Qr a : ℝ) : ℝ := Q ^ a / Qr ^ a +@[expose] noncomputable def ratioPower (Q Qr a : ℝ) : ℝ := Q ^ a / Qr ^ a theorem ratioPower_pos {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (a : ℝ) : 0 < ratioPower Q Qr a := div_pos (Real.rpow_pos_of_pos hQ _) (Real.rpow_pos_of_pos hQr _) @@ -243,7 +243,7 @@ noncomputable def chartChange (h Q Qr : ℝ) (gap : ℕ) : Lift →L[ℝ] Lift : /-- Cylinder change, given by `((chartChange h Q Qr gap).comp (ContinuousLinearMap.fst ℝ Lift ℝ)).prod (ContinuousLinearMap.snd ℝ Lift ℝ)`. -/ -noncomputable def cylinderChange (h Q Qr : ℝ) (gap : ℕ) : Cylinder →L[ℝ] Cylinder := +@[expose] noncomputable def cylinderChange (h Q Qr : ℝ) (gap : ℕ) : Cylinder →L[ℝ] Cylinder := ((chartChange h Q Qr gap).comp (ContinuousLinearMap.fst ℝ Lift ℝ)).prod (ContinuousLinearMap.snd ℝ Lift ℝ) @@ -270,16 +270,20 @@ theorem cylinderChange_graph {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) · rfl /-- Velocity weight, given by `ratioPower Q Qr (CoordinateAlgebra.A h)`. -/ +@[expose] noncomputable def velocityWeight (h Q Qr : ℝ) : ℝ := ratioPower Q Qr (CoordinateAlgebra.A h) /-- Clock weight, given by `ratioPower Q Qr (CoordinateAlgebra.A h + 1 / 2)`. -/ +@[expose] noncomputable def clockWeight (h Q Qr : ℝ) : ℝ := ratioPower Q Qr (CoordinateAlgebra.A h + 1 / 2) /-- Source weight, given by `ratioPower Q Qr (2 * CoordinateAlgebra.A h + 1 / 2)`. -/ +@[expose] noncomputable def sourceWeight (h Q Qr : ℝ) : ℝ := ratioPower Q Qr (2 * CoordinateAlgebra.A h + 1 / 2) /-- Pressure weight, given by `ratioPower Q Qr (2 * CoordinateAlgebra.A h)`. -/ +@[expose] noncomputable def pressureWeight (h Q Qr : ℝ) : ℝ := ratioPower Q Qr (2 * CoordinateAlgebra.A h) /-- Normal weight, given by `(Kr / K) * ratioPower Q Qr (1 / 2)`. -/ -noncomputable def normalWeight (Q Qr K Kr : ℝ) : ℝ := (Kr / K) * ratioPower Q Qr (1 / 2) +@[expose] noncomputable def normalWeight (Q Qr K Kr : ℝ) : ℝ := (Kr / K) * ratioPower Q Qr (1 / 2) theorem clock_mul_velocity {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (h : ℝ) : clockWeight h Q Qr * velocityWeight h Q Qr = sourceWeight h Q Qr := by @@ -518,7 +522,7 @@ noncomputable def referenceRawPressure (D : AssemblyData Parameter) (j : ℤ) : D.gaussianInput D.aliasInput j) /-- Reference frequency, given by `(j : ℝ) * D.carrierBlock.frequency D.reference.band`. -/ -noncomputable def referenceFrequency (D : AssemblyData Parameter) (j : ℤ) : ℝ := +@[expose] noncomputable def referenceFrequency (D : AssemblyData Parameter) (j : ℤ) : ℝ := (j : ℝ) * D.carrierBlock.frequency D.reference.band /-- Reference phase, given by `(actualCarrier D.background D.carrierBlock j).phase @@ -556,12 +560,12 @@ noncomputable def physicalVelocity (D : AssemblyData Parameter) (h Qr : ℝ) (I /-- The finite harmonic sum for a single original spatial label is one actual Cartesian potential, rather than a collection of bandwise fields. -/ -noncomputable def labelPotential (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) +@[expose] noncomputable def labelPotential (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) (delta : ℝ) (N : ℕ) : VelocityField := fun z => ∑ j ∈ modes N, physicalPotential D h Qr I delta j z /-- Label velocity, given by `SpatialCurl.spatialCurl (labelPotential D h Qr I delta N)`. -/ -noncomputable def labelVelocity (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) +@[expose] noncomputable def labelVelocity (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) (delta : ℝ) (N : ℕ) : VelocityField := SpatialCurl.spatialCurl (labelPotential D h Qr I delta N) @@ -674,6 +678,7 @@ noncomputable def liftPhase (D : AssemblyData Parameter) (j : ℤ) : Cylinder fun x => referencePhase D j (waveEquiv x) /-- Lift raw, defined pointwise by `referenceRaw D j (waveEquiv x)`. -/ +@[expose] noncomputable def liftRaw (D : AssemblyData Parameter) (j : ℤ) : Cylinder → ComplexVector := fun x => referenceRaw D j (waveEquiv x) @@ -837,7 +842,7 @@ end ReferenceRealization /-- Parameter change, given by `(ratioPower Q Qr (1 / 2) * p.1, (ratioPower Q Qr 1 * p.2.1, ratioPower Q Qr (CoordinateAlgebra.D h) * p.2.2))`. -/ -noncomputable def parameterChange (h Q Qr : ℝ) (p : Parameter) : Parameter := +@[expose] noncomputable def parameterChange (h Q Qr : ℝ) (p : Parameter) : Parameter := (ratioPower Q Qr (1 / 2) * p.1, (ratioPower Q Qr 1 * p.2.1, ratioPower Q Qr (CoordinateAlgebra.D h) * p.2.2)) @@ -857,7 +862,7 @@ noncomputable def referenceSource (D : AssemblyData Parameter) (j : ℤ) : Param residualSource D.context D.state D.carrierBlock D.gaussianInput D.aliasInput j D.reference.band /-- Band amplitude, constructed using `ParticularWaveBounds.commonVelocity`. -/ -noncomputable def bandAmplitude (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def bandAmplitude (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) : Parameter × Plane → ComplexVector := ParticularWaveBounds.commonVelocity (ScaledTangentTransport.transportTangent (D.reference.tangent j) (parameterChange h Q Qr) gap 0 @@ -870,7 +875,7 @@ noncomputable def bandAmplitude (D : AssemblyData Parameter) (h : ℝ) {Q Qr : (D.reference.cutoff ∘ CopySolveCompatibility.nativeTimeMap 0 (clockWeight h Q Qr)) /-- Band pressure, constructed using `ParticularWaveBounds.commonPressure`. -/ -noncomputable def bandPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def bandPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) : Parameter × Plane → ℂ := ParticularWaveBounds.commonPressure (ScaledTangentTransport.transportTangent (D.reference.tangent j) (parameterChange h Q Qr) gap 0 @@ -940,6 +945,7 @@ noncomputable def bandRawPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : /-- Band phase, defined pointwise by `(referenceFrequency D j / K) * liftPhase D j (cylinderChange h Q Qr gap x)`. -/ +@[expose] noncomputable def bandPhase (D : AssemblyData Parameter) (h Q Qr : ℝ) (gap : ℕ) (K : ℝ) (j : ℤ) : Cylinder → ℝ := fun x => (referenceFrequency D j / K) * liftPhase D j (cylinderChange h Q Qr gap x) @@ -1095,6 +1101,7 @@ noncomputable def complexPhysicalPressure (D : AssemblyData Parameter) (h Qr : mode (referenceFrequency D j) (physicalPhase D h Qr I j) (physicalPressureCoefficient D h Qr I j) /-- Pressure vector, given by `![0, 0, p z]`. -/ +@[expose] noncomputable def pressureVector (p : SpaceTime → ℂ) (z : SpaceTime) : ComplexVector := ![0, 0, p z] /-- A scalar is the axial component of its Cartesian coordinate lift; @@ -1106,7 +1113,7 @@ noncomputable def physicalPressure (D : AssemblyData Parameter) (h Qr : ℝ) (I /-- Band pressure mode, given by `mode K (bandPhase D h Q Qr gap K j) (bandRawPressure D h hQ hQr gap K j)`. -/ -noncomputable def bandPressureMode (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def bandPressureMode (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) : Cylinder → ℂ := mode K (bandPhase D h Q Qr gap K j) (bandRawPressure D h hQ hQr gap K j) @@ -1226,19 +1233,19 @@ theorem band_physical_pressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : /-- Label band velocity, given by `∑ j ∈ modes N, (bandVelocity D h hQ hQr i gap (frequency j) j x component).re`. -/ -noncomputable def labelBandVelocity (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def labelBandVelocity (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (i gap : ℕ) (frequency : ℤ → ℝ) (N : ℕ) (x : Cylinder) (component : Fin 3) : ℝ := ∑ j ∈ modes N, (bandVelocity D h hQ hQr i gap (frequency j) j x component).re /-- Label band pressure, given by `∑ j ∈ modes N, (bandPressureMode D h hQ hQr gap (frequency j) j x).re`. -/ -noncomputable def labelBandPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def labelBandPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (frequency : ℤ → ℝ) (N : ℕ) (x : Cylinder) : ℝ := ∑ j ∈ modes N, (bandPressureMode D h hQ hQr gap (frequency j) j x).re /-- Label pressure, defined pointwise by `∑ j ∈ modes N, physicalPressure D h Qr I delta j z`. -/ -noncomputable def labelPressure (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) +@[expose] noncomputable def labelPressure (D : AssemblyData Parameter) (h Qr : ℝ) (I : ℕ) (delta : ℝ) (N : ℕ) : PressureField := fun z => ∑ j ∈ modes N, physicalPressure D h Qr I delta j z @@ -1527,7 +1534,7 @@ noncomputable def transportedResidualSource (D : AssemblyData Parameter) (h Q Qr (clockWeight h Q Qr) (velocityWeight h Q Qr) /-- Residual band amplitude, constructed using `ParticularWaveBounds.commonVelocity`. -/ -noncomputable def residualBandAmplitude (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def residualBandAmplitude (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) (n : ℕ) : Parameter × Plane → ComplexVector := ParticularWaveBounds.commonVelocity @@ -1540,7 +1547,7 @@ noncomputable def residualBandAmplitude (D : AssemblyData Parameter) (h : ℝ) { (D.reference.cutoff ∘ CopySolveCompatibility.nativeTimeMap 0 (clockWeight h Q Qr)) /-- Residual band pressure, constructed using `ParticularWaveBounds.commonPressure`. -/ -noncomputable def residualBandPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} +@[expose] noncomputable def residualBandPressure (D : AssemblyData Parameter) (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (K : ℝ) (j : ℤ) (n : ℕ) : Parameter × Plane → ℂ := ParticularWaveBounds.commonPressure diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualBridge.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualBridge.lean index 13322a85bf..314624d403 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualBridge.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualBridge.lean @@ -17,7 +17,7 @@ This file keeps the cylindrical angle separate from the lifted slow and fast variables. Every differential operator is an actual Frechet derivative. -/ -@[expose] public section +public section namespace NavierStokes.PhysicalResidualBridge @@ -34,7 +34,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The complete real graph-coordinate residual, including the quadratic transport term and the cylindrical connection terms. -/ -noncomputable def graphResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) +@[expose] noncomputable def graphResidual (ε : ℝ) (R : E → ℝ) (Vr Vθ Vz Vt : E → E) (a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) : Fin 3 → ℝ := fun i => along Vt (fun y => a y i) x + LinearWaveResidual.realTransport R Vr Vθ Vz a a x i - @@ -209,7 +209,7 @@ structure ScaledGraph where namespace ScaledGraph /-- Map as an element of `Cylinder`. -/ -noncomputable def map (G : ScaledGraph) (p : SpaceTime) : Cylinder := +@[expose] noncomputable def map (G : ScaledGraph) (p : SpaceTime) : Cylinder := ((G.radialScale * p.2 0, ((G.radialScale * G.epsilon * p.2 2, G.velocityScale * G.radialScale * G.epsilon * (1 - p.1)), @@ -218,23 +218,23 @@ noncomputable def map (G : ScaledGraph) (p : SpaceTime) : Cylinder := p.2 1) /-- Radius, given by `x.1.1`. -/ -noncomputable def radius (x : Cylinder) : ℝ := x.1.1 +@[expose] noncomputable def radius (x : Cylinder) : ℝ := x.1.1 /-- Radial, given by `((1, ((0, 0), (G.frequency * GraphCalculus.radialSpeed G.exponent x.1.1) • G.radialVector)), 0)`. -/ -noncomputable def radial (G : ScaledGraph) (x : Cylinder) : Cylinder := +@[expose] noncomputable def radial (G : ScaledGraph) (x : Cylinder) : Cylinder := ((1, ((0, 0), (G.frequency * GraphCalculus.radialSpeed G.exponent x.1.1) • G.radialVector)), 0) /-- Angular, given by `(0, 1)`. -/ -noncomputable def angular (_x : Cylinder) : Cylinder := (0, 1) +@[expose] noncomputable def angular (_x : Cylinder) : Cylinder := (0, 1) /-- Axial, given by `((0, ((G.epsilon, 0), 0)), 0)`. -/ -noncomputable def axial (G : ScaledGraph) (_x : Cylinder) : Cylinder := +@[expose] noncomputable def axial (G : ScaledGraph) (_x : Cylinder) : Cylinder := ((0, ((G.epsilon, 0), 0)), 0) /-- Temporal, given by `((0, ((0, -G.epsilon), G.fastCoefficient • G.temporalVector)), 0)`. -/ -noncomputable def temporal (G : ScaledGraph) (_x : Cylinder) : Cylinder := +@[expose] noncomputable def temporal (G : ScaledGraph) (_x : Cylinder) : Cylinder := ((0, ((0, -G.epsilon), G.fastCoefficient • G.temporalVector)), 0) theorem map_smoothAt (G : ScaledGraph) {p : SpaceTime} @@ -361,7 +361,7 @@ theorem pullbackData (G : ScaledGraph) (hl : 0 < G.radialScale) radius := fun _ _ => rfl /-- Physical cylindrical velocity obtained from the actual graph. -/ -noncomputable def velocity (G : ScaledGraph) (a : Cylinder → Fin 3 → ℝ) : VelocityField := +@[expose] noncomputable def velocity (G : ScaledGraph) (a : Cylinder → Fin 3 → ℝ) : VelocityField := fun p => AxisymmetricResidual.pack (G.velocityScale * a (G.map p) 0) (G.velocityScale * a (G.map p) 1) (G.velocityScale * a (G.map p) 2) @@ -370,7 +370,7 @@ noncomputable def velocity (G : ScaledGraph) (a : Cylinder → Fin 3 → ℝ) : fin_cases i <;> simp [velocity] /-- Pressure, defined pointwise by `G.velocityScale ^ 2 * p (G.map z)`. -/ -noncomputable def pressure (G : ScaledGraph) (p : Cylinder → ℝ) : PressureField := +@[expose] noncomputable def pressure (G : ScaledGraph) (p : Cylinder → ℝ) : PressureField := fun z => G.velocityScale ^ 2 * p (G.map z) theorem velocity_smooth (G : ScaledGraph) (hl : 0 < G.radialScale) @@ -434,7 +434,7 @@ end ScaledGraph /-- One arbitrary integer-cover chart; the index is not constrained to the native band index. -/ -noncomputable def commonGraph (Q h : ℝ) (i : ℕ) : ScaledGraph where +@[expose] noncomputable def commonGraph (Q h : ℝ) (i : ℕ) : ScaledGraph where radialScale := Q ^ (-(1 / 2 : ℝ)) velocityScale := Q ^ (-CoordinateAlgebra.A h) epsilon := Q ^ h @@ -675,7 +675,7 @@ theorem fullResidual_eq_graph {U : Set E} (hU : IsOpen U) (ε : ℝ) (R : E → ring /-- The absolute graph before choosing a band or an integer covering. -/ -noncomputable def absoluteLift (h : ℝ) (p : SpaceTime) : Lift := +@[expose] noncomputable def absoluteLift (h : ℝ) (p : SpaceTime) : Lift := (p.2 0, ((p.2 2, 1 - p.1), (p.2 0) ^ ChartScales.radialExponent h • PhysicalGraphBounds.radialDirection + p.1 • PhysicalGraphBounds.timeDirection)) @@ -746,13 +746,13 @@ theorem MatchesAt.timeDirection {c : CorrectionState.Context Lift} {G : ScaledGr /-- Base components, given by `![c.base.radial n x.1, c.base.angular n x.1, c.base.axial n x.1]`. -/ -noncomputable def baseComponents (c : CorrectionState.Context Lift) (n : ℕ) +@[expose] noncomputable def baseComponents (c : CorrectionState.Context Lift) (n : ℕ) (x : Cylinder) : Fin 3 → ℝ := ![c.base.radial n x.1, c.base.angular n x.1, c.base.axial n x.1] /-- Increment components, given by `![s.mean.radial n x.1 + s.oscillation n x 0, s.mean.angular n x.1 + s.oscillation n x 1, s.mean.axial n x.1 + s.oscillation n x 2]`. -/ -noncomputable def incrementComponents (s : CorrectionState.State Lift) (n : ℕ) +@[expose] noncomputable def incrementComponents (s : CorrectionState.State Lift) (n : ℕ) (x : Cylinder) : Fin 3 → ℝ := ![s.mean.radial n x.1 + s.oscillation n x 0, s.mean.angular n x.1 + s.oscillation n x 1, diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualNaturality.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualNaturality.lean index a7cbe611e0..50f6bf0969 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualNaturality.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualNaturality.lean @@ -18,7 +18,7 @@ is always the literal `HarmonicResidual.residualBlock`, including its real projection and its Gaussian and alias subtractions. -/ -@[expose] public section +public section noncomputable section @@ -582,7 +582,7 @@ noncomputable def chartEquiv (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) (gap : ℕ) (x : Lift) : chartEquiv h hQ hQr gap x = chartChange h Q Qr gap x := rfl /-- Actual graph directions on the free lift, before adjoining the angle. -/ -noncomputable def commonFrame (h Q : ℝ) (i : ℕ) : HarmonicResidual.Frame Lift where +@[expose] noncomputable def commonFrame (h Q : ℝ) (i : ℕ) : HarmonicResidual.Frame Lift where radius := Prod.fst radial x := ((PhysicalResidualBridge.commonGraph Q h i).radial (x,0)).1 axial x := ((PhysicalResidualBridge.commonGraph Q h i).axial (x,0)).1 @@ -656,7 +656,7 @@ noncomputable def associatedChart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < associatedChart h hQ hQr gap x = (parameterChange h Q Qr x.1, coverPower gap x.2) := rfl /-- Associated frame, given by `StateReindex.frame associatedToLift (commonFrame h Q i)`. -/ -noncomputable def associatedFrame (h Q : ℝ) (i : ℕ) : HarmonicResidual.Frame Associated := +@[expose] noncomputable def associatedFrame (h Q : ℝ) (i : ℕ) : HarmonicResidual.Frame Associated := StateReindex.frame associatedToLift (commonFrame h Q i) theorem associatedFrame_chart (h : ℝ) {Q Qr : ℝ} (hQ : 0 < Q) (hQr : 0 < Qr) @@ -802,7 +802,7 @@ theorem BandCoherence.residualBandPressure_eq /-! ## A lift-coherence invariant preserved by actual state addition -/ /-- Scalar on, given by `∀ x ∈ U, f x = a * g (e x)`. -/ -def ScalarOn (U : Set D) (e : D ≃L[ℝ] E) (a : ℝ) (f : D → ℝ) (g : E → ℝ) : Prop := +@[expose] def ScalarOn (U : Set D) (e : D ≃L[ℝ] E) (a : ℝ) (f : D → ℝ) (g : E → ℝ) : Prop := ∀ x ∈ U, f x = a * g (e x) namespace ScalarOn diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualTZ.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualTZ.lean index d39f645fed..f3146232bc 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualTZ.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalResidualTZ.lean @@ -16,7 +16,7 @@ pipeline uses `(T,Z)`. The map below swaps those two input coordinates and leaves radius, fast variables, angle, and vector components unchanged. -/ -@[expose] public section +public section noncomputable section @@ -407,7 +407,7 @@ theorem matchesAtTZ_graphOperators (r : CorrectionState.ReconstructionData) · rfl /-- The actual scaled physical graph, with the slow coordinates in `(T,Z)` order. -/ -noncomputable def graphMapTZ (G : PhysicalResidualBridge.ScaledGraph) +@[expose] noncomputable def graphMapTZ (G : PhysicalResidualBridge.ScaledGraph) (p : ProblemStatement.SpaceTime) : Cylinder := swapCylinder (G.map p) /-- Graph source TZ, given by `{p | 0 < p.2 0 ∧ graphMapTZ G p ∈ U}`. -/ @@ -443,12 +443,12 @@ theorem graphRadialTZ_eq (G : PhysicalResidualBridge.ScaledGraph) : graphRadialT theorem graphAngularTZ_eq : graphAngularTZ = PhysicalResidualBridge.ScaledGraph.angular := rfl /-- Velocity TZ, given by `G.velocity (fun x => a (swapCylinder x))`. -/ -noncomputable def velocityTZ (G : PhysicalResidualBridge.ScaledGraph) +@[expose] noncomputable def velocityTZ (G : PhysicalResidualBridge.ScaledGraph) (a : Cylinder → Fin 3 → ℝ) : ProblemStatement.VelocityField := G.velocity (fun x => a (swapCylinder x)) /-- Pressure TZ, given by `G.pressure (fun x => p (swapCylinder x))`. -/ -noncomputable def pressureTZ (G : PhysicalResidualBridge.ScaledGraph) +@[expose] noncomputable def pressureTZ (G : PhysicalResidualBridge.ScaledGraph) (p : Cylinder → ℝ) : ProblemStatement.PressureField := G.pressure (fun x => p (swapCylinder x)) @@ -484,7 +484,7 @@ theorem physicalToChartTZ_eq_formula (h : ℝ) (n k : ℕ) : (TemporalMeanUpdate.coverMap k)) := rfl /-- Absolute lift TZ, given by `swapSlow (PhysicalResidualBridge.absoluteLift h p)`. -/ -noncomputable def absoluteLiftTZ (h : ℝ) (p : ProblemStatement.SpaceTime) : Lift := +@[expose] noncomputable def absoluteLiftTZ (h : ℝ) (p : ProblemStatement.SpaceTime) : Lift := swapSlow (PhysicalResidualBridge.absoluteLift h p) theorem commonGraph_eq_physicalToChartTZ (h : ℝ) (n k : ℕ) {p : ProblemStatement.SpaceTime} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalSignedWave.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalSignedWave.lean index 12e8289152..8c92b8d527 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalSignedWave.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalSignedWave.lean @@ -19,7 +19,7 @@ band views use the same absolute-lift primary pulse and covariance matrix. Compatibility is proved before restriction to a physical graph. -/ -@[expose] public section +public section noncomputable section @@ -78,7 +78,7 @@ theorem increment_square_scale (H : Mat2) (T R : Vec2) {a : ℝ} (ha : 0 < a) (j /-- Coefficient scale, given by `velocityScale * Real.sqrt referenceEpsilon / Real.sqrt epsilon`. -/ -noncomputable def coefficientScale (epsilon referenceEpsilon velocityScale : ℝ) : ℝ := +@[expose] noncomputable def coefficientScale (epsilon referenceEpsilon velocityScale : ℝ) : ℝ := velocityScale * Real.sqrt referenceEpsilon / Real.sqrt epsilon theorem coefficientScale_pos {epsilon referenceEpsilon velocityScale : ℝ} @@ -309,6 +309,7 @@ end ActualRequest /-! ## The actual current-state request on the full free lift -/ /-- Slow change as an element of `LocalSignedRequest.Plane →L[ℝ] LocalSignedRequest.Plane`. -/ +@[expose] noncomputable def slowChange (h Q Qr : ℝ) : LocalSignedRequest.Plane →L[ℝ] LocalSignedRequest.Plane := ((PhysicalParticularWave.ratioPower Q Qr 1) • ContinuousLinearMap.id ℝ ℝ).prodMap @@ -515,7 +516,7 @@ noncomputable def withReferencePhase (C : ReferencePhase) : PrimaryData U := { B with base := C.base B.base } /-- Matrix, given by `SignedWaveUpdate.phaseMatrix B.pulse B.prefactor B.coordinate`. -/ -noncomputable def matrix : ℕ → Cylinder → Mat2 := +@[expose] noncomputable def matrix : ℕ → Cylinder → Mat2 := SignedWaveUpdate.phaseMatrix B.pulse B.prefactor B.coordinate /-- Fundamental, given by `SignedWaveUpdate.phaseFundamental B.pulse B.coordinate j`. -/ @@ -527,7 +528,7 @@ noncomputable def cutoff (n : ℕ) (x : Cylinder) : ℝ := GaussianTailFlat.profile (B.coordinate n x).2 /-- Coefficients, constructed using `SignedWaveUpdate.coefficients`. -/ -noncomputable def coefficients (request : ℕ → Cylinder → Vec2) (j : Fin 2) : +@[expose] noncomputable def coefficients (request : ℕ → Cylinder → Vec2) (j : Fin 2) : LinearWaveBounds.WaveCoefficients Cylinder := SignedWaveUpdate.coefficients B.base B.strip B.directions B.matrix B.target request B.mask (B.fundamental j) B.normalMotion B.action j @@ -584,7 +585,7 @@ noncomputable def viewBase (background : LinearWaveBounds.WaveCoefficients Cylin /-- View target, defined pointwise by `coefficientScale (s.epsilon n) (B.strip.epsilon reference) (velocity n) ^ 2 • B.target reference (view n x)`. -/ -noncomputable def viewTarget (s : StripData Cylinder) (velocity : ℕ → ℝ) +@[expose] noncomputable def viewTarget (s : StripData Cylinder) (velocity : ℕ → ℝ) (view : ℕ → Cylinder → Cylinder) (reference : ℕ) : ℕ → Cylinder → Vec2 := fun n x => coefficientScale (s.epsilon n) (B.strip.epsilon reference) (velocity n) ^ 2 • B.target reference (view n x) @@ -1027,7 +1028,7 @@ variable {B reference} (V : B.Views reference) /-- Map, given by `PhysicalParticularWave.cylinderChange V.exponent (V.scale n) V.referenceScale (V.referenceCover - V.cover n)`. -/ -noncomputable def map (n : ℕ) : Cylinder →L[ℝ] Cylinder := +@[expose] noncomputable def map (n : ℕ) : Cylinder →L[ℝ] Cylinder := PhysicalParticularWave.cylinderChange V.exponent (V.scale n) V.referenceScale (V.referenceCover - V.cover n) @@ -1401,7 +1402,7 @@ theorem physicalVelocity_divergence (referenceRequest : ℕ → Cylinder → Vec /-! ## Pressure is transported from the same reference coefficient -/ /-- Physical pressure coefficient as an element of `SpaceTime → ℂ`. -/ -noncomputable def physicalPressureCoefficient (referenceRequest : ℕ → Cylinder → Vec2) +@[expose] noncomputable def physicalPressureCoefficient (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) : SpaceTime → ℂ := fun z => V.referenceScale ^ (-(2 * CoordinateAlgebra.A V.exponent)) • B.rawPressure referenceRequest j reference @@ -1409,7 +1410,7 @@ noncomputable def physicalPressureCoefficient (referenceRequest : ℕ → Cylind /-- Complex physical pressure, given by `mode (B.base.frequency reference) V.physicalPhase (V.physicalPressureCoefficient referenceRequest j)`. -/ -noncomputable def complexPhysicalPressure (referenceRequest : ℕ → Cylinder → Vec2) +@[expose] noncomputable def complexPhysicalPressure (referenceRequest : ℕ → Cylinder → Vec2) (j : Fin 2) : SpaceTime → ℂ := mode (B.base.frequency reference) V.physicalPhase (V.physicalPressureCoefficient referenceRequest j) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageBounds.lean index 773e1d254f..2032a04369 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageBounds.lean @@ -18,7 +18,7 @@ fields. Physical derivative estimates are consequences of their native classes, support and chart identities. No `RawStageBounds` is an input. -/ -@[expose] public section +public section noncomputable section @@ -327,12 +327,12 @@ section Assembly variable {h : ℝ} {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] {I K : Type*} /-- Potential increment, defined pointwise by `W.vector w + M.family.angularField w`. -/ -noncomputable def potentialIncrement (W : WaveData h D I K (Fin 3)) +@[expose] noncomputable def potentialIncrement (W : WaveData h D I K (Fin 3)) (M : MeanData h (CoordinateAlgebra.A h - 1 / 2)) : VelocityField := fun w => W.vector w + M.family.angularField w /-- Pressure increment, defined pointwise by `W.pressure w + M.family.field w`. -/ -noncomputable def pressureIncrement (W : WaveData h D I K Unit) +@[expose] noncomputable def pressureIncrement (W : WaveData h D I K Unit) (M : MeanData h (2 * CoordinateAlgebra.A h)) : PressureField := fun w => W.pressure w + M.family.field w @@ -343,7 +343,7 @@ noncomputable def potentialLoss (h waveOffset meanOffset : ℝ) (m : ℕ) : ℝ (PhysicalMeanJetBounds.loss (CoordinateAlgebra.A h - 1 / 2) m + meanOffset) /-- Direct loss, given by `PhysicalMeanJetBounds.loss (CoordinateAlgebra.A h) m + meanOffset`. -/ -noncomputable def directLoss (h meanOffset : ℝ) (m : ℕ) : ℝ := +@[expose] noncomputable def directLoss (h meanOffset : ℝ) (m : ℕ) : ℝ := PhysicalMeanJetBounds.loss (CoordinateAlgebra.A h) m + meanOffset /-- Pressure loss, given by `max (PhysicalGraphBounds.waveLoss h m + waveOffset) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageSupport.lean index 031fdde071..6c96210938 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageSupport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalStageSupport.lean @@ -20,7 +20,7 @@ a comparable native band; no physical support property is an input. The zeroth support assertion concerns the finite initialization increment. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalWaveSum.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalWaveSum.lean index ef9b97565b..842a200e82 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalWaveSum.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PhysicalWaveSum.lean @@ -18,7 +18,7 @@ Cover changes are the actual powers of `J_g`. Bounds use actual Fréchet derivatives and the constructed dyadic and spatial masks. -/ -@[expose] public section +public section noncomputable section @@ -54,10 +54,10 @@ noncomputable def upLift (d : ℕ) : LiftPoint →L[ℝ] LiftPoint := (CommonCoverSolve.coverPower d : Plane →L[ℝ] Plane) @[simp] theorem downLift_apply (d : ℕ) (y : LiftPoint) : - downLift d y = (y.1, (CommonCoverSolve.coverPower d).symm y.2) := rfl + downLift d y = (y.1, (CommonCoverSolve.coverPower d).symm y.2) := by rfl @[simp] theorem upLift_apply (d : ℕ) (y : LiftPoint) : - upLift d y = (y.1, CommonCoverSolve.coverPower d y.2) := rfl + upLift d y = (y.1, CommonCoverSolve.coverPower d y.2) := by rfl theorem up_down (d : ℕ) (y : LiftPoint) : upLift d (downLift d y) = y := by simp theorem down_up (d : ℕ) (y : LiftPoint) : downLift d (upLift d y) = y := by simp @@ -100,7 +100,7 @@ theorem norm_upLift_le {d Δ : ℕ} (hd : d ≤ Δ) : ‖upLift d‖ ≤ coverBo _ ≤ _ := by unfold coverBound; nlinarith [norm_nonneg y] /-- Common lift, given by `downLift d ∘ PhysicalGraphBounds.physicalLift h n`. -/ -noncomputable def commonLift (h : ℝ) (n d : ℕ) : SpaceTime → LiftPoint := +@[expose] noncomputable def commonLift (h : ℝ) (n d : ℕ) : SpaceTime → LiftPoint := downLift d ∘ PhysicalGraphBounds.physicalLift h n /-- The changed coordinate is exactly `J_g^(i(n)-d) Y`, when the gap does @@ -189,13 +189,13 @@ structure CarrierData where /-- Phase, given by `PhysicalGraphBounds.liftedPhase (PolarCharts.chart a c.chart) h n c.center r0 c.angular c.axial c.radial c.F c.G`. -/ -noncomputable def CarrierData.phase (c : CarrierData) (a h : ℝ) (n : ℕ) (r0 : ℝ) : +@[expose] noncomputable def CarrierData.phase (c : CarrierData) (a h : ℝ) (n : ℕ) (r0 : ℝ) : LiftPoint → ℝ := PhysicalGraphBounds.liftedPhase (PolarCharts.chart a c.chart) h n c.center r0 c.angular c.axial c.radial c.F c.G /-- Common wave, constructed using `amp`. -/ -noncomputable def commonWave (a h : ℝ) (n d : ℕ) (r0 : ℝ) (c : CarrierData) +@[expose] noncomputable def commonWave (a h : ℝ) (n d : ℕ) (r0 : ℝ) (c : CarrierData) (amp : LiftPoint → ℂ) (j : ℤ) (w : SpaceTime) : ℂ := amp (commonLift h n d w) * PhysicalGraphBounds.character ((ChartScales.carrier h n : ℝ) * (j : ℝ)) @@ -426,12 +426,12 @@ theorem waveRegion_locallyFinite (D : ℝ) (H : ℕ) : (fun _ => locallyFinite_of_finite (fun _ : Harmonic H => (univ : Set PositiveParam))) /-- Preterminal, given by `{w | w.1 < 1}`. -/ -noncomputable def preterminal : Set SpaceTime := {w | w.1 < 1} +@[expose] noncomputable def preterminal : Set SpaceTime := {w | w.1 < 1} theorem preterminal_open : IsOpen preterminal := isOpen_lt continuous_fst continuous_const /-- The actual similarity coordinate at a Cartesian spacetime point. -/ -noncomputable def physicalQ (h : ℝ) (w : SpaceTime) : ℝ := +@[expose] noncomputable def physicalQ (h : ℝ) (w : SpaceTime) : ℝ := SimilarityProfile.q h (AxisymmetricFields.profilePoint w.1 w.2) theorem physicalQ_pos {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) @@ -626,14 +626,14 @@ noncomputable def polarCarrier (c : CarrierData) (k : ℝ) (j : ℤ) (ε : ℝ) PhaseCalculus.harmonic k j ε c.angular c.axial c.radial c.F c.G ((rθ.1, zt), (rθ.2, v)) @[simp] theorem withChart_chart (c : CarrierData) (i : PolarCharts.Index) : - (c.withChart i).chart = i := rfl + (c.withChart i).chart = i := by rfl @[simp] theorem withChart_center (c : CarrierData) (i : PolarCharts.Index) : - (c.withChart i).center = c.center := rfl + (c.withChart i).center = c.center := by rfl @[simp] theorem polarCarrier_withChart (c : CarrierData) (i : PolarCharts.Index) (k : ℝ) (j : ℤ) (ε : ℝ) (zt : ℝ × ℝ) (v : ℝ) : - polarCarrier (c.withChart i) k j ε zt v = polarCarrier c k j ε zt v := rfl + polarCarrier (c.withChart i) k j ε zt v = polarCarrier c k j ε zt v := by rfl theorem polarCarrier_periodic (c : CarrierData) (k : ℝ) (j : ℤ) (ε : ℝ) (zt : ℝ × ℝ) (v : ℝ) (m : ℤ) (hkp : k * c.angular = (m : ℝ)) : @@ -651,7 +651,8 @@ theorem commonWave_polar (a h : ℝ) (n d : ℕ) (r0 : ℝ) (c : CarrierData) (PolarCharts.chart a c.chart (PhysicalGraphBounds.scaledRadial n w)) := by unfold commonWave CarrierData.phase PhysicalGraphBounds.liftedPhase rw [Function.comp_apply, PhysicalGraphBounds.character_phase_eq_harmonic, - PhysicalGraphBounds.slotMap_formula, PhysicalGraphBounds.liftXY_physicalLift] + PhysicalGraphBounds.slotMap_formula, PhysicalGraphBounds.liftXY_physicalLift, + PhysicalGraphBounds.slotTime_eq_nativeGraph] rfl theorem commonWave_charts_agree {a : ℝ} (ha : 0 < a) (h : ℝ) (n d : ℕ) (r0 : ℝ) @@ -675,7 +676,7 @@ theorem commonWave_charts_agree {a : ℝ} (ha : 0 < a) (h : ℝ) (n d : ℕ) (r0 /-- A genuine angular carrier: valid polar charts are selected pointwise; the integer angular mode will prove that the selection is smooth. -/ -noncomputable def globalWave (a h : ℝ) (n d : ℕ) (r0 : ℝ) (c : CarrierData) +@[expose] noncomputable def globalWave (a h : ℝ) (n d : ℕ) (r0 : ℝ) (c : CarrierData) (amp : LiftPoint → ℂ) (j : ℤ) (w : SpaceTime) : ℂ := commonWave a h n d r0 (c.withChart (chooseChart a (PhysicalGraphBounds.scaledRadial n w))) amp j w @@ -799,7 +800,7 @@ structure WaveFamily (H : ℕ) where /-- Term, given by `globalWave a h I.1.val.1 (f.gap I.1) r0 (f.carrier I.1) (f.amplitude I) I.2.val`. -/ -noncomputable def WaveFamily.term {H : ℕ} (f : WaveFamily H) (a h r0 : ℝ) +@[expose] noncomputable def WaveFamily.term {H : ℕ} (f : WaveFamily H) (a h r0 : ℝ) (I : WaveIndex H) : SpaceTime → ℂ := globalWave a h I.1.val.1 (f.gap I.1) r0 (f.carrier I.1) (f.amplitude I) I.2.val @@ -991,7 +992,7 @@ noncomputable def realCoordinate (i : Fin 3) : ℂ →L[ℝ] Space := Complex.reCLM.smulRight (coordinateVector i) @[simp] theorem realCoordinate_apply (i : Fin 3) (z : ℂ) : - realCoordinate i z = z.re • coordinateVector i := rfl + realCoordinate i z = z.re • coordinateVector i := by rfl theorem norm_realCoordinate_le (i : Fin 3) : ‖realCoordinate i‖ ≤ 1 := by refine ContinuousLinearMap.opNorm_le_bound _ zero_le_one ?_ @@ -1001,7 +1002,7 @@ theorem norm_realCoordinate_le (i : Fin 3) : ‖realCoordinate i‖ ≤ 1 := by exact Complex.abs_re_le_norm z /-- Real Euclidean vector assembled from the three scalar carrier sums. -/ -noncomputable def vectorSum {H : ℕ} (f : Fin 3 → WaveFamily H) (a h r0 : ℝ) +@[expose] noncomputable def vectorSum {H : ℕ} (f : Fin 3 → WaveFamily H) (a h r0 : ℝ) (w : SpaceTime) : Space := ∑ i : Fin 3, realCoordinate i ((f i).sum a h r0 w) theorem vectorSum_smooth {H : ℕ} {f : Fin 3 → WaveFamily H} {a b h r0 Z : ℝ} {Δ : ℕ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveAxisSystem.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveAxisSystem.lean index 02824b2397..33a57ac1ee 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveAxisSystem.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveAxisSystem.lean @@ -22,7 +22,7 @@ their two endpoint terms and their strictly lower-order source. No matrix identity or existence of a transformed system is assumed. -/ -@[expose] public section +public section noncomputable section @@ -70,13 +70,13 @@ section Algebra variable {K : Type*} [Field K] [CharZero K] /-- A, given by `1 / 2 + h`. -/ -noncomputable def a (h : K) : K := 1 / 2 + h +@[expose] noncomputable def a (h : K) : K := 1 / 2 + h /-- D scale, given by `1 / 2 - h`. -/ -noncomputable def dScale (h : K) : K := 1 / 2 - h +@[expose] noncomputable def dScale (h : K) : K := 1 / 2 - h /-- Edge, given by `1 - eta ^ 2`. -/ -noncomputable def edge (eta : K) : K := 1 - eta ^ 2 +@[expose] noncomputable def edge (eta : K) : K := 1 - eta ^ 2 /-- Ell, given by `1 - 2 * h * eta ^ 2`. -/ -noncomputable def ell (h eta : K) : K := 1 - 2 * h * eta ^ 2 +@[expose] noncomputable def ell (h eta : K) : K := 1 - 2 * h * eta ^ 2 /-- Angular power, given by `-a h - 1 / 2`. -/ noncomputable def angularPower (h : K) : K := -a h - 1 / 2 /-- Axial power, given by `-a h`. -/ @@ -91,25 +91,26 @@ noncomputable def timeValue (h power eta X : K) (j : Jet K) : K := /-- Axial value, given by `(2 * eta * power * j.value + edge eta * j.parameter - 2 * eta * X * j.radial) / ell h eta`. -/ -noncomputable def axialValue (h power eta X : K) (j : Jet K) : K := +@[expose] noncomputable def axialValue (h power eta X : K) (j : Jet K) : K := (2 * eta * power * j.value + edge eta * j.parameter - 2 * eta * X * j.radial) / ell h eta /-- The quotient `V_n/X` obtained from (21) with `Ubar_n=U_n+K_n`. -/ -noncomputable def betaValue (h lam eta : K) (u k : Jet K) : K := +@[expose] noncomputable def betaValue (h lam eta : K) (u k : Jet K) : K := (2 * eta * (a h - lam) * u.value - 2 * eta * (dScale h + lam) * k.value - edge eta * (u.parameter + k.parameter)) / ell h eta /-- Pressure source, given by `inverseSquare C * s.pressureProduct - s.omegaQuotient / 2`. -/ -noncomputable def pressureSource (C : K) (s : SourceJet K) : K := +@[expose] noncomputable def pressureSource (C : K) (s : SourceJet K) : K := inverseSquare C * s.pressureProduct - s.omegaQuotient / 2 /-- Pressure value, given by `2 * inverseSquare C * b.phi.value * phi.value + pressureSource C s`. -/ -noncomputable def pressureValue (C : K) (b : BaseJet K) (s : SourceJet K) (phi : Jet K) : K := +@[expose] noncomputable def pressureValue (C : K) (b : BaseJet K) (s : SourceJet K) + (phi : Jet K) : K := 2 * inverseSquare C * b.phi.value * phi.value + pressureSource C s /-- Angular RHS, constructed using `timeValue`. -/ -noncomputable def angularRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) +@[expose] noncomputable def angularRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) (phi u k : Jet K) : K := timeValue h (angularPower h + lam) eta X phi + b.beta * (X * phi.radial + phi.value) + @@ -118,7 +119,7 @@ noncomputable def angularRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) u.value * axialValue h (angularPower h) eta X b.phi + s.angular /-- Axial RHS, constructed using `timeValue`. -/ -noncomputable def axialRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) +@[expose] noncomputable def axialRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) (_phi u k p : Jet K) : K := timeValue h (axialPower h + lam) eta X u + b.beta * X * u.radial + betaValue h lam eta u k * X * b.axial.radial + @@ -128,7 +129,7 @@ noncomputable def axialRHS (h lam eta X : K) (b : BaseJet K) (s : SourceJet K) /-- The four equations remaining after the first two components of W have been defined as radial derivatives. These are the expanded (21)--(22). -/ -def ExpandedEquations (h lam C eta X : K) (b : BaseJet K) (s : SourceJet K) +@[expose] def ExpandedEquations (h lam C eta X : K) (b : BaseJet K) (s : SourceJet K) (phi u k p : Jet K) : Prop := X * (u.radial + k.radial) + k.value = 0 ∧ p.radial = pressureValue C b s phi ∧ @@ -136,11 +137,11 @@ def ExpandedEquations (h lam C eta X : K) (b : BaseJet K) (s : SourceJet K) 2 * (X * u.radial2 + u.radial) = axialRHS h lam eta X b s phi u k p /-- Diagonal, given by `![0, 0, 2, 0, 3, 1]`. -/ -noncomputable def diagonal : Fin 6 → K := ![0, 0, 2, 0, 3, 1] +@[expose] noncomputable def diagonal : Fin 6 → K := ![0, 0, 2, 0, 3, 1] /-- Jet vector, given by `![phi.value, u.value, k.value, p.value, 2 * r * phi.radial, 2 * r * u.radial]`. -/ -noncomputable def jetVector (r : K) (phi u k p : Jet K) : Fin 6 → K := +@[expose] noncomputable def jetVector (r : K) (phi u k p : Jet K) : Fin 6 → K := ![phi.value, u.value, k.value, p.value, 2 * r * phi.radial, 2 * r * u.radial] /-- Radial jet vector as an element of `Fin 6 → K`. -/ @@ -154,7 +155,7 @@ noncomputable def parameterJetVector (phi u k p : Jet K) (q₄ q₅ : K) : Fin 6 ![phi.parameter, u.parameter, k.parameter, p.parameter, q₄, q₅] /-- A0 as an element of `Matrix (Fin 6) (Fin 6) K`. -/ -noncomputable def A0 (h lam C r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6) K := +@[expose] noncomputable def A0 (h lam C r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6) K := let M := 1 - 2 * eta * b.axial.value let R := M / ell h eta + b.beta let Gphi := r ^ 2 * b.phi.radial + b.phi.value @@ -175,7 +176,7 @@ noncomputable def A0 (h lam C r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6 4 * eta * (-2 * a h + lam) / ell h eta, 0, r * R] /-- A1 as an element of `Matrix (Fin 6) (Fin 6) K`. -/ -noncomputable def A1 (h r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6) K := +@[expose] noncomputable def A1 (h r eta : K) (b : BaseJet K) : Matrix (Fin 6) (Fin 6) K := let H := dScale h * eta + edge eta * b.axial.value let Gphi := r ^ 2 * b.phi.radial + b.phi.value let Gu := r ^ 2 * b.axial.radial @@ -196,10 +197,24 @@ noncomputable def forcing (h C r eta : K) (s : SourceJet K) : Fin 6 → K := /-- Matrix RHS, given by `(A0 h lam C r eta b).mulVec w + (A1 h r eta b).mulVec v + forcing h C r eta s`. -/ -noncomputable def matrixRHS (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) +@[expose] noncomputable def matrixRHS (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) (w v : Fin 6 → K) : Fin 6 → K := (A0 h lam C r eta b).mulVec w + (A1 h r eta b).mulVec v + forcing h C r eta s +omit [CharZero K] in +theorem matrixRHS_zero (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) + (w v : Fin 6 → K) : matrixRHS h lam C r eta b s w v 0 = w 4 := by + change dotProduct (![0, 0, 0, 0, 1, 0] : Fin 6 → K) w + + dotProduct (![0, 0, 0, 0, 0, 0] : Fin 6 → K) v + 0 = w 4 + simp [dotProduct, Fin.sum_univ_succ] + +omit [CharZero K] in +theorem matrixRHS_one (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) + (w v : Fin 6 → K) : matrixRHS h lam C r eta b s w v 1 = w 5 := by + change dotProduct (![0, 0, 0, 0, 0, 1] : Fin 6 → K) w + + dotProduct (![0, 0, 0, 0, 0, 0] : Fin 6 → K) v + 0 = w 5 + simp [dotProduct, Fin.sum_univ_succ] + /-- Jet system as an element of `Prop`. -/ def JetSystem (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) (phi u k p : Jet K) (q₄ q₅ : K) : Prop := @@ -319,14 +334,14 @@ theorem jetSystem_iff_expanded {h lam C r eta : K} (hr : r ≠ 0) /-- Slow exponent at order `n`. -/ -noncomputable def slowPower (h : K) (n : ℕ) : K := 2 * (n : K) * h +@[expose] noncomputable def slowPower (h : K) (n : ℕ) : K := 2 * (n : K) * h /-- The coefficient of a Cauchy product at the indicated order. -/ -noncomputable def convolution (n : ℕ) (F : ℕ → ℕ → K) : K := +@[expose] noncomputable def convolution (n : ℕ) (F : ℕ → ℕ → K) : K := ∑ i ∈ Finset.range (n + 1), F i (n - i) /-- Both indices in this sum are strictly below a positive order `n`. -/ -noncomputable def lowerConvolution (n : ℕ) (F : ℕ → ℕ → K) : K := +@[expose] noncomputable def lowerConvolution (n : ℕ) (F : ℕ → ℕ → K) : K := ∑ i ∈ Finset.range (n - 1), F (i + 1) (n - (i + 1)) omit [CharZero K] in @@ -356,14 +371,14 @@ theorem lowerConvolution_congr {n : ℕ} {F G : ℕ → ℕ → K} /-- Angular convection, given by `beta i * (X * (phi j).radial + (phi j).value) + (u i).value * axialValue h (angularPower h + slowPower h j) eta X (phi j)`. -/ -noncomputable def angularConvection (h eta X : K) (phi u : ℕ → Jet K) +@[expose] noncomputable def angularConvection (h eta X : K) (phi u : ℕ → Jet K) (beta : ℕ → K) (i j : ℕ) : K := beta i * (X * (phi j).radial + (phi j).value) + (u i).value * axialValue h (angularPower h + slowPower h j) eta X (phi j) /-- Axial convection, given by `beta i * X * (u j).radial + (u i).value * axialValue h (axialPower h + slowPower h j) eta X (u j)`. -/ -noncomputable def axialConvection (h eta X : K) (u : ℕ → Jet K) +@[expose] noncomputable def axialConvection (h eta X : K) (u : ℕ → Jet K) (beta : ℕ → K) (i j : ℕ) : K := beta i * X * (u j).radial + (u i).value * axialValue h (axialPower h + slowPower h j) eta X (u j) @@ -371,7 +386,7 @@ noncomputable def axialConvection (h eta X : K) (u : ℕ → Jet K) /-- The known functions supplied here are exactly the previous-order axial viscosities and the smooth extension of the previous radial residual divided by `X`; no current-order unknown occurs in this source. -/ -noncomputable def lowerSource (h eta X : K) (n : ℕ) (phi u : ℕ → Jet K) +@[expose] noncomputable def lowerSource (h eta X : K) (n : ℕ) (phi u : ℕ → Jet K) (beta : ℕ → K) (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) : SourceJet K where angular := lowerConvolution n (angularConvection h eta X phi u beta) - previousAngularDiffusion @@ -380,7 +395,7 @@ noncomputable def lowerSource (h eta X : K) (n : ℕ) (phi u : ℕ → Jet K) omegaQuotient := omegaQuotient /-- Base at order zero, given by `⟨phi 0, u 0, beta 0⟩`. -/ -noncomputable def baseAtOrderZero (phi u : ℕ → Jet K) (beta : ℕ → K) : BaseJet K := +@[expose] noncomputable def baseAtOrderZero (phi u : ℕ → Jet K) (beta : ℕ → K) : BaseJet K := ⟨phi 0, u 0, beta 0⟩ /-- The beta formula is precisely (21), with `Ubar=U+K`. -/ @@ -449,7 +464,7 @@ theorem pressureValue_eq_convolution (h C eta X : K) {n : ℕ} (hn : 0 < n) /-- Positive-order equations (22) before extraction of the endpoint terms. The average relation is the derivative of `X Ubar = ∫₀ˣ U`, with `K=Ubar-U`. The beta hypothesis in the equivalence below is the second identity of (21). -/ -def PositiveOrderEquations (h C eta X : K) (n : ℕ) (phi u : ℕ → Jet K) +@[expose] def PositiveOrderEquations (h C eta X : K) (n : ℕ) (phi u : ℕ → Jet K) (beta : ℕ → K) (k p : Jet K) (previousAngularDiffusion previousAxialDiffusion omegaQuotient : K) : Prop := X * ((u n).radial + k.radial) + k.value = 0 ∧ @@ -499,14 +514,14 @@ section ActualProfiles open SimilarityProfile /-- Jets here are actual Fréchet partial derivatives of real profiles. -/ -noncomputable def actualJet (f : InnerProfile) (w : InnerPoint) : Jet ℝ := +@[expose] noncomputable def actualJet (f : InnerProfile) (w : InnerPoint) : Jet ℝ := ⟨f w, partialX f w, partialX (partialX f) w, partialEta f w⟩ theorem timeValue_actualJet (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : - timeValue h b w.2 w.1 (actualJet f w) = T h b f w := rfl + timeValue h b w.2 w.1 (actualJet f w) = T h b f w := by rfl theorem axialValue_actualJet (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : - axialValue h b w.2 w.1 (actualJet f w) = Z h b f w := rfl + axialValue h b w.2 w.1 (actualJet f w) = Z h b f w := by rfl theorem partialX_contDiffAt {f : InnerProfile} {w : InnerPoint} (hf : ContDiffAt ℝ 2 f w) : ContDiffAt ℝ 1 (partialX f) w := by @@ -540,7 +555,7 @@ theorem hasDerivAt_squareProfile_radial {f : InnerProfile} {r eta : ℝ} /-- Profile vector, given by `jetVector r (actualJet phi (r ^ 2, eta)) (actualJet u (r ^ 2, eta)) (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta))`. -/ -noncomputable def profileVector (phi u k p : InnerProfile) (r eta : ℝ) : Fin 6 → ℝ := +@[expose] noncomputable def profileVector (phi u k p : InnerProfile) (r eta : ℝ) : Fin 6 → ℝ := jetVector r (actualJet phi (r ^ 2, eta)) (actualJet u (r ^ 2, eta)) (actualJet k (r ^ 2, eta)) (actualJet p (r ^ 2, eta)) @@ -580,7 +595,7 @@ theorem profileVector_parameter {phi u k p : InnerProfile} {r eta : ℝ} /-- The displayed first-order system uses actual derivatives of the actual profiles, not independent formal jet variables. -/ -def ProfileSystem (h lam C r eta : ℝ) (b : BaseJet ℝ) (s : SourceJet ℝ) +@[expose] def ProfileSystem (h lam C r eta : ℝ) (b : BaseJet ℝ) (s : SourceJet ℝ) (phi u k p : InnerProfile) : Prop := (fun i => deriv (fun q => profileVector phi u k p q eta i) r + diagonal i / r * profileVector phi u k p r eta i) = @@ -608,6 +623,7 @@ theorem profileSystem_iff_expanded {h lam C r eta : ℝ} (hr : r ≠ 0) /-- The preceding axial viscosity uses the actual similarity operator twice. The negative-order term at order zero is zero. -/ +@[expose] noncomputable def precedingDiffusion (h power : ℝ) (F : ℕ → InnerProfile) (n : ℕ) : InnerProfile := if n = 0 then fun _ => 0 else Z h (power + slowPower h (n - 1) - dScale h) @@ -622,7 +638,7 @@ theorem precedingDiffusion_congr (h power : ℝ) {F G : ℕ → InnerProfile} {n /-- Fully specified source from lower-order profile jets and a supplied regular representative of the preceding `Ω/X`. -/ -noncomputable def actualLowerSource (h : ℝ) (n : ℕ) (phi u beta : ℕ → InnerProfile) +@[expose] noncomputable def actualLowerSource (h : ℝ) (n : ℕ) (phi u beta : ℕ → InnerProfile) (omegaQuotient : InnerProfile) (w : InnerPoint) : SourceJet ℝ := lowerSource h w.2 w.1 n (fun j => actualJet (phi j) w) (fun j => actualJet (u j) w) (fun j => beta j w) (precedingDiffusion h (angularPower h) phi n w) @@ -812,24 +828,24 @@ abbrev CoefficientData := Fin 11 → ℝ × ℂ → ℂ /-- Coefficient base, given by `⟨⟨F 0 (X, z), F 1 (X, z), 0, F 2 (X, z)⟩, ⟨F 3 (X, z), F 4 (X, z), 0, F 5 (X, z)⟩, F 6 (X, z)⟩`. -/ -noncomputable def coefficientBase (F : CoefficientData) (X : ℝ) (z : ℂ) : BaseJet ℂ := +@[expose] noncomputable def coefficientBase (F : CoefficientData) (X : ℝ) (z : ℂ) : BaseJet ℂ := ⟨⟨F 0 (X, z), F 1 (X, z), 0, F 2 (X, z)⟩, ⟨F 3 (X, z), F 4 (X, z), 0, F 5 (X, z)⟩, F 6 (X, z)⟩ /-- Coefficient source, given by `⟨F 7 (X, z), F 8 (X, z), F 9 (X, z), F 10 (X, z)⟩`. -/ -noncomputable def coefficientSource (F : CoefficientData) (X : ℝ) (z : ℂ) : SourceJet ℂ := +@[expose] noncomputable def coefficientSource (F : CoefficientData) (X : ℝ) (z : ℂ) : SourceJet ℂ := ⟨F 7 (X, z), F 8 (X, z), F 9 (X, z), F 10 (X, z)⟩ /-- Coefficient0, defined pointwise by `A0 h lam C (r : ℂ) z (coefficientBase F (r ^ 2) z)`. -/ -noncomputable def coefficient0 (h lam C : ℂ) (F : CoefficientData) : Coeff := +@[expose] noncomputable def coefficient0 (h lam C : ℂ) (F : CoefficientData) : Coeff := fun r z => A0 h lam C (r : ℂ) z (coefficientBase F (r ^ 2) z) /-- Coefficient1, defined pointwise by `A1 h (r : ℂ) z (coefficientBase F (r ^ 2) z)`. -/ -noncomputable def coefficient1 (h : ℂ) (F : CoefficientData) : Coeff := +@[expose] noncomputable def coefficient1 (h : ℂ) (F : CoefficientData) : Coeff := fun r z => A1 h (r : ℂ) z (coefficientBase F (r ^ 2) z) /-- Source field, defined pointwise by `forcing h C (r : ℂ) z (coefficientSource F (r ^ 2) z)`. -/ -noncomputable def sourceField (h C : ℂ) (F : CoefficientData) : Field := +@[expose] noncomputable def sourceField (h C : ℂ) (F : CoefficientData) : Field := fun r z => forcing h C (r : ℂ) z (coefficientSource F (r ^ 2) z) theorem coefficient1_shape (h : ℂ) (F : CoefficientData) : @@ -1120,15 +1136,15 @@ section RealOutput open VolterraAnalyticBounds /-- Complex jet, given by `⟨j.value, j.radial, j.radial2, j.parameter⟩`. -/ -noncomputable def complexJet (j : Jet ℝ) : Jet ℂ := +@[expose] noncomputable def complexJet (j : Jet ℝ) : Jet ℂ := ⟨j.value, j.radial, j.radial2, j.parameter⟩ /-- Complex base, given by `⟨complexJet b.phi, complexJet b.axial, b.beta⟩`. -/ -noncomputable def complexBase (b : BaseJet ℝ) : BaseJet ℂ := +@[expose] noncomputable def complexBase (b : BaseJet ℝ) : BaseJet ℂ := ⟨complexJet b.phi, complexJet b.axial, b.beta⟩ /-- Complex source, given by `⟨s.angular, s.axial, s.pressureProduct, s.omegaQuotient⟩`. -/ -noncomputable def complexSource (s : SourceJet ℝ) : SourceJet ℂ := +@[expose] noncomputable def complexSource (s : SourceJet ℝ) : SourceJet ℂ := ⟨s.angular, s.axial, s.pressureProduct, s.omegaQuotient⟩ theorem A0_ofReal (h lam C r eta : ℝ) (b : BaseJet ℝ) : @@ -1177,7 +1193,7 @@ theorem matrixRHS_realPart (h lam C r eta : ℝ) (b : BaseJet ℝ) (s : SourceJe simp [Matrix.mulVec, dotProduct, Matrix.map, Complex.mul_re] /-- Real trace, given by `(W r (eta : ℂ) i).re`. -/ -noncomputable def realTrace (W : Field) (r eta : ℝ) (i : Fin 6) : ℝ := +@[expose] noncomputable def realTrace (W : Field) (r eta : ℝ) (i : Fin 6) : ℝ := (W r (eta : ℂ) i).re /-- A complex solution with real coefficients yields a real solution by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveRepresentatives.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveRepresentatives.lean index 8a34aaba60..5b43bb8a84 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveRepresentatives.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PositiveRepresentatives.lean @@ -19,7 +19,7 @@ constructed inverse extends the stable branch across its regular zero-time face. The actual mask representatives stay at positive time. -/ -@[expose] public section +public section noncomputable section @@ -40,6 +40,7 @@ noncomputable def positiveTime : Set Slow := {p | 0 < p.2.2} /-- Positive part, given by `K ∩ positiveTime`. -/ noncomputable def positivePart (K : Set Slow) : Set Slow := K ∩ positiveTime /-- Active label, given by `PrimaryRepresentatives.ActiveLabel (positivePart K)`. -/ +@[expose] noncomputable def ActiveLabel (K : Set Slow) := PrimaryRepresentatives.ActiveLabel (positivePart K) /-- Representative, given by `PrimaryRepresentatives.representative (positivePart K) L`. -/ noncomputable def representative (K : Set Slow) (L : ActiveLabel K) : Slow := @@ -93,11 +94,11 @@ theorem physicalMask_has_positive_representative {h a b : ℝ} (L : Label) (hL : /-! ## A smooth inverse on the stable branch, including its zero-time face -/ /-- Stable source, given by `{p | 0 < p.1 ∧ 0 < scalarSlope a p.2 p.1}`. -/ -noncomputable def stableSource (a : ℝ) : Set (ℝ × ℝ) := +@[expose] noncomputable def stableSource (a : ℝ) : Set (ℝ × ℝ) := {p | 0 < p.1 ∧ 0 < scalarSlope a p.2 p.1} /-- Stable target, given by `forwardMap a '' stableSource a`. -/ -noncomputable def stableTarget (a : ℝ) : Set (ℝ × ℝ) := forwardMap a '' stableSource a +@[expose] noncomputable def stableTarget (a : ℝ) : Set (ℝ × ℝ) := forwardMap a '' stableSource a theorem scalarSlope_smoothAt {a : ℝ} {p : ℝ × ℝ} (hp : p.1 ≠ 0) : ContDiffAt ℝ ∞ (fun x : ℝ × ℝ => scalarSlope a x.2 x.1) p := @@ -618,7 +619,7 @@ theorem compact_jet_bound {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] exact ⟨C, hC, fun p hp => hb _ ⟨p, hp, rfl⟩⟩ /-- Stable pullback, given by `stableQ h p ^ exponent * f (stableInner h p)`. -/ -noncomputable def stablePullback (h exponent : ℝ) (f : (ℝ × ℝ) → ℝ) (p : Slow) : ℝ := +@[expose] noncomputable def stablePullback (h exponent : ℝ) (f : (ℝ × ℝ) → ℝ) (p : Slow) : ℝ := stableQ h p ^ exponent * f (stableInner h p) /-- Physical pullback, given by `SimilarityHomogeneity.chartQ h p ^ exponent * f @@ -683,7 +684,7 @@ noncomputable def ActiveLabel.toClosed {K : Set Slow} (L : ActiveLabel K) : ⟨L.val, L.property.1, representative K L, representative_mem K L, representative_mem_tsupport K L⟩ @[simp] theorem ActiveLabel.toClosed_val {K : Set Slow} (L : ActiveLabel K) : - L.toClosed.val = L.val := rfl + L.toClosed.val = L.val := by rfl /-- The reference functions on the compact closure are explicit extensions. Only their values at the positive representatives are identified with the diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PressureStream.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PressureStream.lean index 40f4f3b976..ae9dfb61fd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PressureStream.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PressureStream.lean @@ -21,7 +21,7 @@ retained separately from the two auxiliary torus coordinates. The pressure correction uses a constructed smooth bump of integral one. -/ -@[expose] public section +public section noncomputable section @@ -39,14 +39,14 @@ abbrev Plane := ℝ × ℝ abbrev Lift (S : Type) := ℝ × (S × Plane) /-- A concrete bump strictly inside the radial interval. -/ -noncomputable def meanBump (a b : ℝ) (hab : a < b) : ContDiffBump ((a + b) / 2) where +@[expose] noncomputable def meanBump (a b : ℝ) (hab : a < b) : ContDiffBump ((a + b) / 2) where rIn := (b - a) / 8 rOut := (b - a) / 4 rIn_pos := by linarith rIn_lt_rOut := by linarith /-- The actual radial density has integral one, with no normalization premise. -/ -noncomputable def rho (a b : ℝ) (hab : a < b) : ℝ → ℝ := +@[expose] noncomputable def rho (a b : ℝ) (hab : a < b) : ℝ → ℝ := (meanBump a b hab).normed volume theorem rho_contDiff (a b : ℝ) (hab : a < b) : ContDiff ℝ ∞ (rho a b hab) := @@ -77,11 +77,11 @@ section Average variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Torus inner, given by `∫ x in (0 : ℝ)..1, f (p.1.1, (p.1.2, (x, p.2)))`. -/ -noncomputable def torusInner (f : Lift S → ℝ) (p : (ℝ × S) × ℝ) : ℝ := +@[expose] noncomputable def torusInner (f : Lift S → ℝ) (p : (ℝ × S) × ℝ) : ℝ := ∫ x in (0 : ℝ)..1, f (p.1.1, (p.1.2, (x, p.2))) /-- The bar averages only the auxiliary torus, preserving every slow parameter. -/ -noncomputable def torusAverage (f : Lift S → ℝ) (p : ℝ × S) : ℝ := +@[expose] noncomputable def torusAverage (f : Lift S → ℝ) (p : ℝ × S) : ℝ := ∫ y in (0 : ℝ)..1, torusInner f (p, y) theorem torusInner_contDiff {f : Lift S → ℝ} (hf : ContDiff ℝ ∞ f) : @@ -133,7 +133,7 @@ theorem torusAverage_sub_slow {f : Lift S → ℝ} (hf : ContDiff ℝ ∞ f) simp /-- Pressure mass, given by `∫ r, torusAverage f (r, s)`. -/ -noncomputable def pressureMass (f : Lift S → ℝ) (s : S) : ℝ := +@[expose] noncomputable def pressureMass (f : Lift S → ℝ) (s : S) : ℝ := ∫ r, torusAverage f (r, s) theorem torusAverage_slice_integrable {a b : ℝ} {f : Lift S → ℝ} @@ -167,7 +167,7 @@ theorem pressureMass_contDiff {a b : ℝ} {f : Lift S → ℝ} ((torusAverage_contDiff hf).comp (contDiff_snd.prodMk contDiff_fst)) a b /-- Pressure source, given by `f p - rho a b hab p.1 * pressureMass f p.2.1`. -/ -noncomputable def pressureSource (a b : ℝ) (hab : a < b) (f : Lift S → ℝ) +@[expose] noncomputable def pressureSource (a b : ℝ) (hab : a < b) (f : Lift S → ℝ) (p : Lift S) : ℝ := f p - rho a b hab p.1 * pressureMass f p.2.1 theorem pressureSource_contDiff {a b : ℝ} (hab : a < b) {f : Lift S → ℝ} @@ -210,16 +210,16 @@ section Graph variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Radial vector, given by `(1, k p.1 • v)`. -/ -noncomputable def radialVector (k : ℝ → ℝ) (v : E) (p : ℝ × E) : ℝ × E := +@[expose] noncomputable def radialVector (k : ℝ → ℝ) (v : E) (p : ℝ × E) : ℝ × E := (1, k p.1 • v) /-- The exact radial graph derivative. The directions are fixed; only its radial speed is allowed to vary with the slow radius. -/ -noncomputable def graphDr (k : ℝ → ℝ) (v : E) (f : ℝ × E → ℝ) (p : ℝ × E) : ℝ := +@[expose] noncomputable def graphDr (k : ℝ → ℝ) (v : E) (f : ℝ × E → ℝ) (p : ℝ × E) : ℝ := fderiv ℝ f p (radialVector k v p) /-- A fixed axial graph direction may include both slow and torus directions. -/ -noncomputable def graphDz (w : E) (f : ℝ × E → ℝ) (p : ℝ × E) : ℝ := +@[expose] noncomputable def graphDz (w : E) (f : ℝ × E → ℝ) (p : ℝ × E) : ℝ := fderiv ℝ f p (0, w) theorem graphDz_contDiff {f : ℝ × E → ℝ} (hf : ContDiff ℝ ∞ f) (w : E) : @@ -261,7 +261,7 @@ theorem graphDr_graphDz_comm {f : ℝ × E → ℝ} {k : ℝ → ℝ} (v w : E) simpa using (hf.isSymmSndFDerivAt (by norm_num)).eq (radialVector k v p) (0, w) /-- Divide radius, given by `f p / p.1`. -/ -noncomputable def divideRadius (f : ℝ × E → ℝ) (p : ℝ × E) : ℝ := f p / p.1 +@[expose] noncomputable def divideRadius (f : ℝ × E → ℝ) (p : ℝ × E) : ℝ := f p / p.1 omit [NormedAddCommGroup E] [NormedSpace ℝ E] in theorem divideRadius_supported {a b : ℝ} {f : ℝ × E → ℝ} @@ -326,11 +326,11 @@ theorem graphDr_divideRadius {f : ℝ × E → ℝ} (k : ℝ → ℝ) (v : E) {p field_simp; ring /-- Stream beta, defined pointwise by `-graphDz w Ψ p`. -/ -noncomputable def streamBeta (w : E) (Ψ : ℝ × E → ℝ) : ℝ × E → ℝ := +@[expose] noncomputable def streamBeta (w : E) (Ψ : ℝ × E → ℝ) : ℝ × E → ℝ := fun p => -graphDz w Ψ p /-- Stream gamma, defined pointwise by `graphDr k v Ψ p + divideRadius Ψ p`. -/ -noncomputable def streamGamma (k : ℝ → ℝ) (v : E) (Ψ : ℝ × E → ℝ) : ℝ × E → ℝ := +@[expose] noncomputable def streamGamma (k : ℝ → ℝ) (v : E) (Ψ : ℝ × E → ℝ) : ℝ × E → ℝ := fun p => graphDr k v Ψ p + divideRadius Ψ p /-- Graph divergence, given by `graphDr k v β p + β p / p.1 + graphDz w γ p`. -/ @@ -386,14 +386,14 @@ theorem graphDr_contDiff_of_support {a b : ℝ} (ha : 0 < a) (contDiffAt_const.prodMk (((hk p.1 hp).comp p contDiffAt_fst).smul contDiffAt_const)) /-- Physical speed, given by `RadialPullback.radialJacobian d r * M`. -/ -noncomputable def physicalSpeed (d M r : ℝ) : ℝ := RadialPullback.radialJacobian d r * M +@[expose] noncomputable def physicalSpeed (d M r : ℝ) : ℝ := RadialPullback.radialJacobian d r * M theorem physicalSpeed_smooth (d M : ℝ) {r : ℝ} (hr : r ≠ 0) : ContDiffAt ℝ ∞ (physicalSpeed d M) r := (contDiffAt_const.mul (contDiffAt_id.rpow_const_of_ne hr)).mul contDiffAt_const theorem graphDr_eq_physical (d M : ℝ) (v : E) (f : ℝ × E → ℝ) (p : ℝ × E) : - graphDr (physicalSpeed d M) v f p = RadialPullback.physicalGraphDeriv d M v f p := rfl + graphDr (physicalSpeed d M) v f p = RadialPullback.physicalGraphDeriv d M v f p := by rfl end Graph @@ -402,7 +402,7 @@ section Pressure variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Formula (33), with the exact physical shifted primitive. -/ -noncomputable def meanPressure (d a b M : ℝ) (hab : a < b) (v : Plane) +@[expose] noncomputable def meanPressure (d a b M : ℝ) (hab : a < b) (v : Plane) (f : Lift S → ℝ) : Lift S → ℝ := RadialPullback.physicalCompact d a b M (0, v) (pressureSource a b hab f) @@ -445,7 +445,7 @@ section Stream variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Weighted source, given by `p.1 * γd p`. -/ -noncomputable def weightedSource (γd : ℝ × E → ℝ) (p : ℝ × E) : ℝ := p.1 * γd p +@[expose] noncomputable def weightedSource (γd : ℝ × E → ℝ) (p : ℝ × E) : ℝ := p.1 * γd p theorem weightedSource_contDiff {γd : ℝ × E → ℝ} (hγ : ContDiff ℝ ∞ γd) : ContDiff ℝ ∞ (weightedSource γd) := contDiff_fst.mul hγ @@ -460,7 +460,7 @@ theorem weightedSource_supported {a b : ℝ} {γd : ℝ × E → ℝ} exact hp (by simp [weightedSource, hγ]) /-- The actual physical stream `r⁻¹ Ic(r γd)`. -/ -noncomputable def streamPotential (d a b M : ℝ) (v : E) (γd : ℝ × E → ℝ) : ℝ × E → ℝ := +@[expose] noncomputable def streamPotential (d a b M : ℝ) (v : E) (γd : ℝ × E → ℝ) : ℝ × E → ℝ := divideRadius (RadialPullback.physicalCompact d a b M v (weightedSource γd)) theorem streamPotential_contDiff {d a b M : ℝ} (ha : 0 < a) (hab : a < b) (hd : 0 < d) @@ -535,7 +535,7 @@ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Torus periodic lift, given by `∀ r : ℝ, ∀ s : S, FourierAlias.TorusPeriodic (fun Y => f (r, (s, Y)))`. -/ -noncomputable def TorusPeriodicLift (f : Lift S → ℝ) : Prop := +@[expose] noncomputable def TorusPeriodicLift (f : Lift S → ℝ) : Prop := ∀ r : ℝ, ∀ s : S, FourierAlias.TorusPeriodic (fun Y => f (r, (s, Y))) omit [NormedAddCommGroup S] [NormedSpace ℝ S] in @@ -803,7 +803,7 @@ theorem streamGamma_eq_desired_sub_alias_global {d a b M : ℝ} simp /-- The total physical radial integral, written in normalized transport coordinates. -/ -noncomputable def physicalTotal (d a M : ℝ) (v : E) (g : ℝ × E → ℝ) (p : ℝ × E) : ℝ := +@[expose] noncomputable def physicalTotal (d a M : ℝ) (v : E) (g : ℝ × E → ℝ) (p : ℝ × E) : ℝ := totalIntegral M v (RadialPullback.normalizeSource d a g) (RadialPullback.liftChart (RadialPullback.powerChart d a) p) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryCopyBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryCopyBounds.lean index 510e9d1214..674eb9c452 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryCopyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryCopyBounds.lean @@ -18,7 +18,7 @@ constant is chosen before that label, its band, and the lattice copy. The square-root estimates retain the vanishing flat weight. -/ -@[expose] public section +public section noncomputable section @@ -369,7 +369,7 @@ variable {V : JetDomain ι D} {U : Domain ι PhaseCalculus.Slow} /-- Pulse matrix, defined pointwise by `primaryCovariance pref (fun j => (F j).frame) (fun j => (F j).lam) (fun j => (F j).u) (fun j => (F j).L) i (χ i x).1`. -/ -noncomputable def pulseMatrix (F : Fin 2 → PhaseConstruction U) +@[expose] noncomputable def pulseMatrix (F : Fin 2 → PhaseConstruction U) (pref : Fin 2 → ι → ℝ) (χ : ι → D → PhaseCalculus.Slow × ℝ) : ι → D → SmoothCovariance.Mat2 := fun i x => primaryCovariance pref (fun j => (F j).frame) (fun j => (F j).lam) @@ -389,7 +389,7 @@ noncomputable def pulseEnvelope (F : Fin 2 → PhaseConstruction U) /-- Primary velocity, defined pointwise by `PartitionedCovariance.amplitude (ε i) (mask i x) (pulseMatrix F pref χ i x) (T i x) j • pulseVector F χ j i x`. -/ -noncomputable def primaryVelocity (F : Fin 2 → PhaseConstruction U) +@[expose] noncomputable def primaryVelocity (F : Fin 2 → PhaseConstruction U) (pref : Fin 2 → ι → ℝ) (χ : ι → D → PhaseCalculus.Slow × ℝ) (ε : ι → ℝ) (T : ι → D → SmoothCovariance.Vec2) (mask : ι → D → ℝ) (j : Fin 2) : ι → D → ProblemStatement.Space := fun i x => @@ -584,12 +584,12 @@ section NativePressure variable {V : JetDomain ι D} {U : Domain ι PhaseCalculus.Slow} /-- The actual phase is evaluated at the physical native time `L*tau`. -/ -noncomputable def phasePoint (p : PhaseConstruction U) +@[expose] noncomputable def phasePoint (p : PhaseConstruction U) (χ : ι → D → PhaseCalculus.Slow × ℝ) : ι → D → PhaseCalculus.Slow × ℝ := fun i x => ((χ i x).1, p.L i * (χ i x).2) /-- Phase pressure as an element of `ι → D → ℂ`. -/ -noncomputable def phasePressure (p : PhaseConstruction U) +@[expose] noncomputable def phasePressure (p : PhaseConstruction U) (χ : ι → D → PhaseCalculus.Slow × ℝ) (frequency : ι → ℝ) (u : ι → D → ProblemStatement.Space) : ι → D → ℂ := fun i => ParticularWaveBounds.projectedPressure (frequency i) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryFieldAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryFieldAssembly.lean index 458af8b2cb..ec15683884 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryFieldAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryFieldAssembly.lean @@ -17,7 +17,7 @@ complex harmonic use the same `PairData` as the covariance calculation. The exact curl correction remains a separate field. -/ -@[expose] public section +public section noncomputable section @@ -37,10 +37,10 @@ noncomputable def pulseVector (P : Pulse) (r : ℝ) (z : Plane) : Vector := Fin.cases (P.radialProfile r z) (fun i => P.tangentProfile r i z) @[simp] theorem pulseVector_zero (P : Pulse) (r : ℝ) (z : Plane) : - pulseVector P r z 0 = P.radialProfile r z := rfl + pulseVector P r z 0 = P.radialProfile r z := by rfl @[simp] theorem pulseVector_succ (P : Pulse) (r : ℝ) (z : Plane) (i : Fin 2) : - pulseVector P r z i.succ = P.tangentProfile r i z := rfl + pulseVector P r z i.succ = P.tangentProfile r i z := by rfl private theorem compact_vector {f : Plane → Vector} (hf : ∀ i, HasCompactSupport (fun z => f z i)) : HasCompactSupport f := by @@ -64,11 +64,11 @@ noncomputable def nativeVector {U : UnsignedLabel} (P : PairData sys U) @[simp] theorem nativeVector_zero {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) : - nativeVector P hdet j Y 0 = P.rawRadial hdet j Y := rfl + nativeVector P hdet j Y 0 = P.rawRadial hdet j Y := by rfl @[simp] theorem nativeVector_succ {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) (Y : Plane) (i : Fin 2) : - nativeVector P hdet j Y i.succ = P.rawTangent hdet j i Y := rfl + nativeVector P hdet j Y i.succ = P.rawTangent hdet j i Y := by rfl theorem nativeVector_compact {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : @@ -123,7 +123,7 @@ noncomputable def coveredVector {U : UnsignedLabel} (P : PairData sys U) /-- The square roots, signed-label mask, and physical outer factor are literal; no fresh choice of amplitudes is made when assembling the field. -/ -noncomputable def slotAmplitude {U : UnsignedLabel} (P : PairData sys U) +@[expose] noncomputable def slotAmplitude {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) : ComplexVector := fun i => ((outer * amplitude ε (mask D U q x) P.matrix T j * @@ -575,7 +575,7 @@ theorem pulseVector_eq (j : Fin 2) (z : Plane) : /-- The source vector is evaluated from `cutoffPulse`, rather than from arbitrarily supplied radial and tangent component functions. -/ -noncomputable def nativeSource (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) +@[expose] noncomputable def nativeSource (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : Plane → Vector := TorusAverages.nativeField (TorusAverages.slotChart vr vt hdet) (slotCenter h (signedLabel U j)) @@ -591,7 +591,7 @@ theorem nativeSource_eq (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (j : Fin 2) : /-- The native complex coefficient has the literal inverse-square-root amplitude and a single local Gaussian cutoff. -/ -noncomputable def nativeCoefficient (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) +@[expose] noncomputable def nativeCoefficient (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) : ComplexVector := fun i => ((outer * amplitude ε (mask D U q x) A.sourceMatrix T j * @@ -599,7 +599,7 @@ noncomputable def nativeCoefficient (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) /-- Actual amplitude, given by `TorusAverages.periodize (A.nativeCoefficient hdet outer ε T q x j) ((SlotGeometry.cover ^ SlotColoring.nativeIndex h U.1) Y)`. -/ -noncomputable def actualAmplitude (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) +@[expose] noncomputable def actualAmplitude (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) : ComplexVector := TorusAverages.periodize (A.nativeCoefficient hdet outer ε T q x j) @@ -640,7 +640,7 @@ theorem actualAmplitude_eq (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) /-- Actual velocity, defined pointwise by `(vectorMode 1 (slotPhase A.pairData j) (fun z => A.actualAmplitude hdet outer ε T q x j z.1) (Y, θ) i).re`. -/ -noncomputable def actualVelocity (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) +@[expose] noncomputable def actualVelocity (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (T : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) (Y : Plane) (θ : ℝ) : Vector := fun i => (vectorMode 1 (slotPhase A.pairData j) @@ -909,8 +909,10 @@ theorem principal_torus_average {N : ℕ} (hN : 1 ≤ N) intro Y k exact congrArg Complex.ofReal (hp Y k) let g := SmoothFourierData.descendContinuous (fun Y => (f Y : ℂ)) hcc hpc - refine ⟨g, fun _ => rfl, ?_⟩ - rw [← TorusAverages.squareAverage_torusLift g] + have hg : SmoothFourierData.torusLift g = fun Y => (f Y : ℂ) := + SmoothFourierData.torusLift_descendContinuous _ hcc hpc + refine ⟨g, fun Y => congrFun hg Y, ?_⟩ + rw [← TorusAverages.squareAverage_torusLift g, hg] change TorusAverages.squareAverage (fun Y => (f Y : ℂ)) = ((TorusAverages.squareAverage f : ℝ) : ℂ) simp only [TorusAverages.squareAverage, ← intervalIntegral.integral_ofReal] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryODE.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryODE.lean index 9f2fbce536..62c34fdb72 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryODE.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryODE.lean @@ -22,7 +22,7 @@ extension. Reconstruction into ambient coordinates satisfies the projected equation exactly. Estimates are derived for this constructed solution. -/ -@[expose] public section +public section noncomputable section @@ -74,82 +74,82 @@ variable {Q : Type} (d : FrameData Q) /-- Error A, given by `MovingFrameODE.coeff11 (d.rho z) (d.rhoDot z) ⟪d.frame z 0, d.shear z⟫_ℝ`. -/ -noncomputable def errorA (z : Q × ℝ) : ℝ := +@[expose] noncomputable def errorA (z : Q × ℝ) : ℝ := MovingFrameODE.coeff11 (d.rho z) (d.rhoDot z) ⟪d.frame z 0, d.shear z⟫_ℝ /-- Error B, given by `MovingFrameODE.coeff12 (d.F z) (d.frame z 1 0) (d.rho z) (d.rotation z) - d.eigenvalue z / d.eigenvector z`. -/ -noncomputable def errorB (z : Q × ℝ) : ℝ := +@[expose] noncomputable def errorB (z : Q × ℝ) : ℝ := MovingFrameODE.coeff12 (d.F z) (d.frame z 1 0) (d.rho z) (d.rotation z) - d.eigenvalue z / d.eigenvector z /-- Error C, constructed using `MovingFrameODE.coeff21`. -/ -noncomputable def errorC (z : Q × ℝ) : ℝ := +@[expose] noncomputable def errorC (z : Q × ℝ) : ℝ := MovingFrameODE.coeff21 (d.F z) (d.frame z 1 0) ⟪d.frame z 1, d.shear z⟫_ℝ (d.rho z) (d.rotation z) - d.eigenvalue z * d.eigenvector z /-- Error11, given by `MovingFrameODE.modal11 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z)`. -/ -noncomputable def error11 (z : Q × ℝ) : ℝ := +@[expose] noncomputable def error11 (z : Q × ℝ) : ℝ := MovingFrameODE.modal11 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z) /-- Error12, given by `MovingFrameODE.modal12 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z)`. -/ -noncomputable def error12 (z : Q × ℝ) : ℝ := +@[expose] noncomputable def error12 (z : Q × ℝ) : ℝ := MovingFrameODE.modal12 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z) /-- Error21, given by `MovingFrameODE.modal21 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z)`. -/ -noncomputable def error21 (z : Q × ℝ) : ℝ := +@[expose] noncomputable def error21 (z : Q × ℝ) : ℝ := MovingFrameODE.modal21 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z) /-- Error22, given by `MovingFrameODE.modal22 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z)`. -/ -noncomputable def error22 (z : Q × ℝ) : ℝ := +@[expose] noncomputable def error22 (z : Q × ℝ) : ℝ := MovingFrameODE.modal22 (d.errorA z) (d.errorB z) (d.errorC z) (d.eigenvector z) (d.eigenRate z) /-- Damping, given by `(j : ℝ) ^ 2 * d.viscosity z`. -/ -noncomputable def damping (j : ℤ) (z : Q × ℝ) : ℝ := (j : ℝ) ^ 2 * d.viscosity z +@[expose] noncomputable def damping (j : ℤ) (z : Q × ℝ) : ℝ := (j : ℝ) ^ 2 * d.viscosity z /-- Coefficient, given by `GrowingMode.modalOperator (d.eigenvalue z) (d.damping j z) (d.error11 z) (d.error12 z) (d.error21 z) (d.error22 z)`. -/ -noncomputable def coefficient (j : ℤ) (z : Q × ℝ) : State →L[ℝ] State := +@[expose] noncomputable def coefficient (j : ℤ) (z : Q × ℝ) : State →L[ℝ] State := GrowingMode.modalOperator (d.eigenvalue z) (d.damping j z) (d.error11 z) (d.error12 z) (d.error21 z) (d.error22 z) /-- Force X, given by `-(f z 0 - d.rho z * ⟪d.frame z 0, MovingFrameODE.tail (f z)⟫_ℝ) / (1 + d.rho z ^ 2)`. -/ -noncomputable def forceX (f : Q × ℝ → Space) (z : Q × ℝ) : ℝ := +@[expose] noncomputable def forceX (f : Q × ℝ → Space) (z : Q × ℝ) : ℝ := -(f z 0 - d.rho z * ⟪d.frame z 0, MovingFrameODE.tail (f z)⟫_ℝ) / (1 + d.rho z ^ 2) /-- Force Y, given by `-⟪d.frame z 1, MovingFrameODE.tail (f z)⟫_ℝ`. -/ -noncomputable def forceY (f : Q × ℝ → Space) (z : Q × ℝ) : ℝ := +@[expose] noncomputable def forceY (f : Q × ℝ → Space) (z : Q × ℝ) : ℝ := -⟪d.frame z 1, MovingFrameODE.tail (f z)⟫_ℝ /-- Forcing, given by `!₂[(d.forceX f z + d.forceY f z / d.eigenvector z) / 2, (d.forceX f z - d.forceY f z / d.eigenvector z) / 2]`. -/ -noncomputable def forcing (f : Q × ℝ → Space) (z : Q × ℝ) : State := +@[expose] noncomputable def forcing (f : Q × ℝ → Space) (z : Q × ℝ) : State := !₂[(d.forceX f z + d.forceY f z / d.eigenvector z) / 2, (d.forceX f z - d.forceY f z / d.eigenvector z) / 2] /-- Ambient, given by `MovingFrameODE.tangent (d.rho z) (d.frame z) (w 0 + w 1) (d.eigenvector z * (w 0 - w 1))`. -/ -noncomputable def ambient (z : Q × ℝ) (w : State) : Space := +@[expose] noncomputable def ambient (z : Q × ℝ) (w : State) : Space := MovingFrameODE.tangent (d.rho z) (d.frame z) (w 0 + w 1) (d.eigenvector z * (w 0 - w 1)) /-- Normal, given by `MovingFrameODE.normal (d.beta z) (d.rho z) (d.frame z)`. -/ -noncomputable def normal (z : Q × ℝ) : Space := +@[expose] noncomputable def normal (z : Q × ℝ) : Space := MovingFrameODE.normal (d.beta z) (d.rho z) (d.frame z) /-- Normal motion, given by `MovingFrameODE.normalMotion (d.beta z) (d.betaDot z) (d.rho z) (d.rhoDot z) (d.rotation z) (d.frame z)`. -/ -noncomputable def normalMotion (z : Q × ℝ) : Space := +@[expose] noncomputable def normalMotion (z : Q × ℝ) : Space := MovingFrameODE.normalMotion (d.beta z) (d.betaDot z) (d.rho z) (d.rhoDot z) (d.rotation z) (d.frame z) @@ -195,7 +195,7 @@ variable {Q : Type} [NormedAddCommGroup Q] variable {a b : ℝ} /-- The differentiable extension of the actual Volterra solution. -/ -noncomputable def extendedFamily (hab : a ≤ b) +@[expose] noncomputable def extendedFamily (hab : a ≤ b) (A : Q × ℝ → State →L[ℝ] State) (x₀ : Q → State) (f : Q × ℝ → State) (p : Q) : ℝ → State := ParametricODE.solutionExtension hab (SmoothPathFamily.pathFamily A p) (x₀ p) @@ -230,12 +230,12 @@ theorem extendedFamily_hasDerivAt (hab : a ≤ b) {U : Set Q} SmoothPathFamily.pathFamily_apply f p hfc] using hh /-- Solution, given by `extendedFamily hab (d.coefficient j) x₀ (d.forcing f) p`. -/ -noncomputable def solution (hab : a ≤ b) (d : FrameData Q) (j : ℤ) +@[expose] noncomputable def solution (hab : a ≤ b) (d : FrameData Q) (j : ℤ) (x₀ : Q → State) (f : Q × ℝ → Space) (p : Q) : ℝ → State := extendedFamily hab (d.coefficient j) x₀ (d.forcing f) p /-- Ambient solution, given by `d.ambient (p, v) (solution hab d j x₀ f p v)`. -/ -noncomputable def ambientSolution (hab : a ≤ b) (d : FrameData Q) (j : ℤ) +@[expose] noncomputable def ambientSolution (hab : a ≤ b) (d : FrameData Q) (j : ℤ) (x₀ : Q → State) (f : Q × ℝ → Space) (p : Q) (v : ℝ) : Space := d.ambient (p, v) (solution hab d j x₀ f p v) @@ -454,19 +454,20 @@ variable {Q : Type} [NormedAddCommGroup Q] variable {a b : ℝ} /-- Primary seed, given by `!₂[P (p, a), 0]`. -/ -noncomputable def primarySeed (a : ℝ) (P : Q × ℝ → ℝ) (p : Q) : State := !₂[P (p, a), 0] +@[expose] noncomputable def primarySeed (a : ℝ) (P : Q × ℝ → ℝ) (p : Q) : State := !₂[P (p, a), 0] /-- Primary, given by `solution hab d 1 (primarySeed a P) (fun _ => 0) p`. -/ +@[expose] noncomputable def primary (hab : a ≤ b) (d : FrameData Q) (P : Q × ℝ → ℝ) (p : Q) : ℝ → State := solution hab d 1 (primarySeed a P) (fun _ => 0) p /-- Radial primary, given by `primary hab d P p v 0 + primary hab d P p v 1`. -/ -noncomputable def radialPrimary (hab : a ≤ b) (d : FrameData Q) (P : Q × ℝ → ℝ) +@[expose] noncomputable def radialPrimary (hab : a ≤ b) (d : FrameData Q) (P : Q × ℝ → ℝ) (p : Q) (v : ℝ) : ℝ := primary hab d P p v 0 + primary hab d P p v 1 /-- Transverse primary, given by `d.eigenvector (p, v) * (primary hab d P p v 0 - primary hab d P p v 1)`. -/ -noncomputable def transversePrimary (hab : a ≤ b) (d : FrameData Q) (P : Q × ℝ → ℝ) +@[expose] noncomputable def transversePrimary (hab : a ≤ b) (d : FrameData Q) (P : Q × ℝ → ℝ) (p : Q) (v : ℝ) : ℝ := d.eigenvector (p, v) * (primary hab d P p v 0 - primary hab d P p v 1) @@ -789,12 +790,12 @@ theorem norm_iteratedFDeriv_solution_le_polynomial {a b : ℝ} (hab : a ≤ b) ( end ParameterJets /-- Reference profile, given by `c₀ * Real.sqrt (1 + PulseGrowth.slotMagnitude u ell v ^ 2)`. -/ -noncomputable def referenceProfile (c₀ u ell v : ℝ) : ℝ := +@[expose] noncomputable def referenceProfile (c₀ u ell v : ℝ) : ℝ := c₀ * Real.sqrt (1 + PulseGrowth.slotMagnitude u ell v ^ 2) /-- Reference profile rate, given by `PulseGrowth.slotMagnitude u ell v * (u / ell) / (1 + PulseGrowth.slotMagnitude u ell v ^ 2)`. -/ -noncomputable def referenceProfileRate (u ell v : ℝ) : ℝ := +@[expose] noncomputable def referenceProfileRate (u ell v : ℝ) : ℝ := PulseGrowth.slotMagnitude u ell v * (u / ell) / (1 + PulseGrowth.slotMagnitude u ell v ^ 2) @@ -925,9 +926,8 @@ theorem initialEnvelope_contDiffOn {a b : ℝ} (hab : a ≤ b) rw [ParametricODE.extend, projIcc_of_mem hab hs'] exact SmoothPathFamily.pathFamily_apply rate p hslice ⟨s, hs'⟩ change Real.exp (∫ s in (midpoint : ℝ)..a, rate (p, s)) = - Real.exp (-(∫ s in a..(midpoint : ℝ), - ParametricODE.extend hab (SmoothPathFamily.pathFamily rate p) s)) - rw [hint, intervalIntegral.integral_symm] + Real.exp (-(ParametricODE.integrator hab (SmoothPathFamily.pathFamily rate p) midpoint)) + rw [ParametricODE.integrator_apply, hint, intervalIntegral.integral_symm] theorem referenceRate_contDiffOn {U : Set Q} (V : Set ℝ) (lam u : Q → ℝ) (ell : ℝ) (hlam : ContDiffOn ℝ ∞ lam U) (hu : ContDiffOn ℝ ∞ u U) : @@ -1236,7 +1236,7 @@ theorem localFrame_eq {n : Space} (hn : MovingFrameODE.tail n ≠ 0) : /-- The actual phase-derived coefficients require nonvanishing only on the chart where they are used. -/ -noncomputable def FrameData.ofNormalLocal (n nDot : Q × ℝ → Space) +@[expose] noncomputable def FrameData.ofNormalLocal (n nDot : Q × ℝ → Space) (F : Q × ℝ → ℝ) (g : Q × ℝ → State) (lam h hRate viscosityScale : Q × ℝ → ℝ) : FrameData Q where beta z := MovingFrameODE.normalScale (n z) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean index 59feba310e..e3b1204179 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean @@ -23,7 +23,7 @@ current endpoint becomes an additional parameter, so the weighted ODE jet estimate controls actual joint parameter and slot derivatives. -/ -@[expose] public section +public section noncomputable section @@ -44,10 +44,10 @@ variable [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Time linear, given by `(ContinuousLinearMap.fst ℝ Q ℝ).prod (σ • ContinuousLinearMap.snd ℝ Q ℝ)`. -/ -noncomputable def timeLinear (σ : ℝ) : (Q × ℝ) →L[ℝ] (Q × ℝ) := +@[expose] noncomputable def timeLinear (σ : ℝ) : (Q × ℝ) →L[ℝ] (Q × ℝ) := (ContinuousLinearMap.fst ℝ Q ℝ).prod (σ • ContinuousLinearMap.snd ℝ Q ℝ) -@[simp] theorem timeLinear_apply (σ : ℝ) (z : Q × ℝ) : timeLinear σ z = (z.1, σ * z.2) := rfl +@[simp] theorem timeLinear_apply (σ : ℝ) (z : Q × ℝ) : timeLinear σ z = (z.1, σ * z.2) := by rfl theorem timeLinear_norm_le {σ : ℝ} (hσ : |σ| ≤ 1) : ‖timeLinear (Q := Q) σ‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one @@ -154,7 +154,7 @@ theorem rescale_jet_bound {A : Q × ℝ → E} {U : Set (Q × ℝ)} end TimeRescaling /-- Rescale constant, given by `2 ^ N * K ^ 2 + K + 1`. -/ -noncomputable def rescaleConstant (N : ℕ) (K : ℝ) : ℝ := 2 ^ N * K ^ 2 + K + 1 +@[expose] noncomputable def rescaleConstant (N : ℕ) (K : ℝ) : ℝ := 2 ^ N * K ^ 2 + K + 1 theorem le_rescaleConstant (N : ℕ) (K : ℝ) : K ≤ rescaleConstant N K := by unfold rescaleConstant @@ -292,7 +292,7 @@ structure EnvelopeJets {ι E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ ∀ j ≤ N, ‖iteratedFDeriv ℝ j (f i) x‖ ≤ C * D.scale i ^ m * w i x /-- Product domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ -noncomputable def productDomain {ι E : Type*} [NormedAddCommGroup E] +@[expose] noncomputable def productDomain {ι E : Type*} [NormedAddCommGroup E] (D : PhaseJetBounds.Domain ι E) (V : ι → Set ℝ) (hV : ∀ i, IsOpen (V i)) : PhaseJetBounds.Domain ι (E × ℝ) where scale := D.scale @@ -415,7 +415,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] variable [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Phase domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ -noncomputable def phaseDomain (s : StripData E) : PhaseJetBounds.Domain ℕ E where +@[expose] noncomputable def phaseDomain (s : StripData E) : PhaseJetBounds.Domain ℕ E where scale := s.slow carrier _ := s.domain isOpen _ := s.isOpen_domain @@ -552,8 +552,9 @@ theorem intervalIntegral_polynomial (D : PhaseJetBounds.Domain ι Q) PhaseJetBounds.PolynomialJets D (fun i p => ∫ t in a..b, F i (p, t)) := by apply ((pathFamily_polynomial D V hV hI hF).clm (intervalIntegralCLM (H := H) hab)).congr intro i p hp - change (∫ t in a..b, ParametricODE.extend hab - (SmoothPathFamily.pathFamily (F i) p) t) = ∫ t in a..b, F i (p, t) + change ParametricODE.integrator hab (SmoothPathFamily.pathFamily (F i) p) + (⟨b, hab, le_rfl⟩ : Icc a b) = ∫ t in a..b, F i (p, t) + rw [ParametricODE.integrator_apply] apply intervalIntegral.integral_congr intro t ht have ht' : t ∈ Icc a b := by simpa only [uIcc_of_le hab] using ht @@ -582,7 +583,7 @@ theorem positiveSeed_norm : ‖positiveSeed‖ = 1 := by /-- Reference P, given by `GaussianEnvelope.envelope (GaussianEnvelope.referenceRate lam u L) (L / 2) t`. -/ -noncomputable def referenceP (lam u L t : ℝ) : ℝ := +@[expose] noncomputable def referenceP (lam u L t : ℝ) : ℝ := GaussianEnvelope.envelope (GaussianEnvelope.referenceRate lam u L) (L / 2) t theorem referenceP_pos (lam u L t : ℝ) : 0 < referenceP lam u L t := @@ -859,7 +860,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] variable {s : StripData E} /-- Normalized matrix, defined pointwise by `r * H i j`. -/ -noncomputable def normalizedMatrix (r : ℝ) (H : SmoothCovariance.Mat2) : +@[expose] noncomputable def normalizedMatrix (r : ℝ) (H : SmoothCovariance.Mat2) : SmoothCovariance.Mat2 := fun i j => r * H i j theorem normalizedMatrix_det (r : ℝ) (H : SmoothCovariance.Mat2) : @@ -976,7 +977,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The stripped coefficient uses exactly the positive inverse-weight amplitude of the physical covariance construction. -/ -noncomputable def primaryCoefficient (s : StripData E) +@[expose] noncomputable def primaryCoefficient (s : StripData E) (H : ℕ → E → SmoothCovariance.Mat2) (T : ℕ → E → SmoothCovariance.Vec2) (mask : ℕ → E → ℝ) (v : ℕ → E → Space) (j : Fin 2) : ℕ → E → HarmonicCalculus.ComplexVector := fun n x => @@ -1167,7 +1168,7 @@ theorem ambient_envelope_jets {D : PhaseJetBounds.Domain ι (Q × ℝ)} /-- Normalized pulse, given by `d.ambient (z.1, L * z.2) (fundamental d lam u L (z.1, L * z.2))`. -/ -noncomputable def normalizedPulse (d : PrimaryODE.FrameData Q) (lam u L : ℝ) +@[expose] noncomputable def normalizedPulse (d : PrimaryODE.FrameData Q) (lam u L : ℝ) (z : Q × ℝ) : Space := d.ambient (z.1, L * z.2) (fundamental d lam u L (z.1, L * z.2)) @@ -1220,7 +1221,7 @@ variable {ι : Type*} {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- The covariance matrix is made from the two constructed ambient pulses, with the fixed smooth middle cutoff. -/ -noncomputable def primaryCovariance (pref : Fin 2 → ι → ℝ) +@[expose] noncomputable def primaryCovariance (pref : Fin 2 → ι → ℝ) (d : Fin 2 → ι → PrimaryODE.FrameData Q) (lam u L : Fin 2 → ι → ℝ) : ι → Q → SmoothCovariance.Mat2 := covarianceMatrix (1 / 10) (9 / 10) pref @@ -1419,7 +1420,7 @@ section CutoffPulse variable {ι : Type*} {Q : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] /-- Cutoff pulse, given by `GaussianTailFlat.profile z.2 • normalizedPulse d lam u L z`. -/ -noncomputable def cutoffPulse (d : PrimaryODE.FrameData Q) (lam u L : ℝ) +@[expose] noncomputable def cutoffPulse (d : PrimaryODE.FrameData Q) (lam u L : ℝ) (z : Q × ℝ) : Space := GaussianTailFlat.profile z.2 • normalizedPulse d lam u L z @@ -1534,7 +1535,7 @@ variable {Q E : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Chart covariance, defined pointwise by `primaryCovariance pref d lam u L n (χ n x).1`. -/ -noncomputable def chartCovariance +@[expose] noncomputable def chartCovariance (pref : Fin 2 → ℕ → ℝ) (d : Fin 2 → ℕ → PrimaryODE.FrameData Q) (lam u L : Fin 2 → ℕ → ℝ) (χ : ℕ → E → Q × ℝ) : ℕ → E → SmoothCovariance.Mat2 := fun n x => primaryCovariance pref d lam u L n (χ n x).1 @@ -1674,7 +1675,7 @@ structure PhaseConstruction (D : Domain ι Slow) where |(phase.frameData lam c0 u L viscosity i).error22 (p, v)| ≤ C / D.scale i /-- Frame, given by `p.phase.frameData p.lam p.c0 p.u p.L p.viscosity`. -/ -noncomputable def PhaseConstruction.frame {D : Domain ι Slow} (p : PhaseConstruction D) : +@[expose] noncomputable def PhaseConstruction.frame {D : Domain ι Slow} (p : PhaseConstruction D) : ι → PrimaryODE.FrameData Slow := p.phase.frameData p.lam p.c0 p.u p.L p.viscosity theorem PhaseConstruction.pulse_jets {D : Domain ι Slow} (p : PhaseConstruction D) : @@ -1772,7 +1773,7 @@ theorem cutoffPulse_eq_ambient_primary /-- Local primary profile, given by `PartitionedCovariance.cutoff radius z.1 • cutoffPulse d lam u L (p, z.2 / L)`. -/ -noncomputable def localPrimaryProfile (d : PrimaryODE.FrameData Q) (lam u L radius : ℝ) +@[expose] noncomputable def localPrimaryProfile (d : PrimaryODE.FrameData Q) (lam u L radius : ℝ) (p : Q) (z : TorusInverse.Plane) : Space := PartitionedCovariance.cutoff radius z.1 • cutoffPulse d lam u L (p, z.2 / L) @@ -1910,7 +1911,7 @@ noncomputable def canonicalPrimaryPath /-- A literal `PartitionedCovariance.Pulse` made from this same primary solution. Only its uncut components are continuously clamped; the cutoff has compact support strictly inside the interval. -/ -noncomputable def canonicalPrimaryPulse +@[expose] noncomputable def canonicalPrimaryPulse (d : PrimaryODE.FrameData Q) (lam u : ℝ) {L : ℝ} (hL : 0 < L) (U : Set Q) (hA : ContinuousOn (d.coefficient 1) (U ×ˢ Icc 0 L)) (p : Q) (hp : p ∈ U) (hk : d.Kinematics p (Icc 0 L)) : PartitionedCovariance.Pulse where @@ -2069,7 +2070,7 @@ variable {Q E : Type} [NormedAddCommGroup Q] [NormedSpace ℝ Q] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Uncut primary wave, constructed using `primaryCoefficient`. -/ -noncomputable def uncutPrimaryWave (s : StripData E) +@[expose] noncomputable def uncutPrimaryWave (s : StripData E) (pref : Fin 2 → ℕ → ℝ) (d : Fin 2 → ℕ → PrimaryODE.FrameData Q) (lam u L : Fin 2 → ℕ → ℝ) (χ : ℕ → E → Q × ℝ) (T : ℕ → E → SmoothCovariance.Vec2) (mask : ℕ → E → ℝ) (c : Fin 2) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryRepresentatives.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryRepresentatives.lean index 5d62ba4684..add4646efa 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryRepresentatives.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryRepresentatives.lean @@ -20,7 +20,7 @@ support and the fixed closed active set. The enlarged-box distance is then a consequence of the mesh, rather than a hypothesis on the selected point. -/ -@[expose] public section +public section noncomputable section @@ -42,9 +42,9 @@ abbrev Label := PartitionedCovariance.UnsignedLabel abbrev Position := SlotColoring.Position /-- Position, given by `![q.1, q.2.1, q.2.2]`. -/ -noncomputable def position (q : Slow) : Position := ![q.1, q.2.1, q.2.2] +@[expose] noncomputable def position (q : Slow) : Position := ![q.1, q.2.1, q.2.2] /-- Slow, given by `(x 0, (x 1, x 2))`. -/ -noncomputable def slow (x : Position) : Slow := (x 0, (x 1, x 2)) +@[expose] noncomputable def slow (x : Position) : Slow := (x 0, (x 1, x 2)) @[simp] theorem position_slow (x : Position) : position (slow x) = x := by ext j @@ -75,7 +75,7 @@ noncomputable def nativeMask (n : ℕ) (k : Grid) (q : Slow) : ℝ := /-- Grid box, given by `{q | ∀ j, |position q j - SquaredPartition.nativeSpacing n * (k j : ℝ)| ≤ a * SquaredPartition.nativeSpacing n}`. -/ -noncomputable def gridBox (n : ℕ) (k : Grid) (a : ℝ) : Set Slow := +@[expose] noncomputable def gridBox (n : ℕ) (k : Grid) (a : ℝ) : Set Slow := {q | ∀ j, |position q j - SquaredPartition.nativeSpacing n * (k j : ℝ)| ≤ a * SquaredPartition.nativeSpacing n} @@ -111,7 +111,7 @@ theorem gridBox_distance {n : ℕ} {k : Grid} {a b : ℝ} {q q₀ : Slow} linarith [hq j, h₀ j] /-- Exactly the labels whose closed mask support meets the closed active set. -/ -noncomputable def ActiveLabel (K : Set Slow) := +@[expose] noncomputable def ActiveLabel (K : Set Slow) := {L : Label // 1 ≤ L.1 ∧ (K ∩ tsupport (nativeMask L.1 L.2)).Nonempty} /-- Representative, given by `Classical.choose L.property.2`. -/ @@ -142,7 +142,7 @@ theorem representative_support_distance (K : Set Slow) (L : ActiveLabel K) div_eq_mul_inv] using gridBox_distance hq' h₀ /-- Normalized slow, given by `slow (SquaredPartition.slowCoordinates D n x)`. -/ -noncomputable def normalizedSlow (D : ℝ) (n : ℕ) (x : Position) : Slow := +@[expose] noncomputable def normalizedSlow (D : ℝ) (n : ℕ) (x : Position) : Slow := slow (SquaredPartition.slowCoordinates D n x) theorem width_eq_scaled_spacing (D : ℝ) (n : ℕ) (j : Fin 3) : @@ -213,9 +213,9 @@ theorem enlarged_eventually_in_chart {K U : Set Slow} (hK : IsCompact K) /-! ## Reference frame and exact unstable-mode parameters -/ /-- Normal direction, given by `‖g‖⁻¹ • g`. -/ -noncomputable def normalDirection (g : Plane) : Plane := ‖g‖⁻¹ • g +@[expose] noncomputable def normalDirection (g : Plane) : Plane := ‖g‖⁻¹ • g /-- Transverse direction, given by `-MovingFrameODE.quarterTurn (normalDirection g)`. -/ -noncomputable def transverseDirection (g : Plane) : Plane := +@[expose] noncomputable def transverseDirection (g : Plane) : Plane := -MovingFrameODE.quarterTurn (normalDirection g) /-- Coupling, given by `2 * F * normalDirection g 0`. -/ noncomputable def coupling (F : ℝ) (g : Plane) : ℝ := 2 * F * normalDirection g 0 @@ -223,7 +223,7 @@ noncomputable def coupling (F : ℝ) (g : Plane) : ℝ := 2 * F * normalDirectio noncomputable def lambda0 (F : ℝ) (g : Plane) : ℝ := Real.sqrt (-(coupling F g) * (coupling F g + ‖g‖)) /-- C0, given by `lambda0 F g / coupling F g`. -/ -noncomputable def c0 (F : ℝ) (g : Plane) : ℝ := lambda0 F g / coupling F g +@[expose] noncomputable def c0 (F : ℝ) (g : Plane) : ℝ := lambda0 F g / coupling F g /-- Primitive strict shear conditions. The last inequality is the positive opening of the unstable two-dimensional reference system. -/ @@ -442,17 +442,18 @@ theorem representative_parameter_bounds {K : Set Slow} (hK : IsCompact K) /-! ## A fixed compact set from the actual normalized similarity range -/ /-- Normalized active points, including the limiting time face `T = 0`. -/ -noncomputable def activeReference (h a b : ℝ) : Set Slow := +@[expose] noncomputable def activeReference (h a b : ℝ) : Set Slow := {p | 0 ≤ p.1 ∧ 0 ≤ p.2.2 ∧ ∃ q ∈ Icc (1 / 2 : ℝ) 2, SimilarityCoordinates.forwardScalar (2 * h) p.2.1 q = p.2.2 ∧ p.1 ^ 2 / (2 * q) ∈ Icc a b} /-- Reference box, given by `Icc (Real.sqrt a) (2 * Real.sqrt b) ×ˢ (Icc (-2 : ℝ) 2 ×ˢ Icc (0 : ℝ) 2)`. -/ -noncomputable def referenceBox (a b : ℝ) : Set Slow := +@[expose] noncomputable def referenceBox (a b : ℝ) : Set Slow := Icc (Real.sqrt a) (2 * Real.sqrt b) ×ˢ (Icc (-2 : ℝ) 2 ×ˢ Icc (0 : ℝ) 2) /-- Reference compact, given by `closure (activeReference h a b)`. -/ +@[expose] noncomputable def referenceCompact (h a b : ℝ) : Set Slow := closure (activeReference h a b) theorem activeReference_subset_box {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / 2) @@ -502,7 +503,7 @@ theorem referenceCompact_radius_pos {h a b : ℝ} (hh : 0 ≤ h) (hh1 : h < 1 / (Real.sqrt_pos.mpr ha).trans_le (referenceCompact_subset_box hh hh1 ha hab hq).1.1 /-- One explicit convex chart containing the whole normalized compact set. -/ -noncomputable def baseChart (a b : ℝ) : Set Slow := +@[expose] noncomputable def baseChart (a b : ℝ) : Set Slow := Ioo (Real.sqrt a / 2) (2 * Real.sqrt b + 1) ×ˢ (Ioo (-3 : ℝ) 3 ×ˢ Ioo (-1 : ℝ) 3) @@ -588,7 +589,7 @@ theorem physicalMask_has_representative {h a b : ℝ} (L : Label) (hL : 1 ≤ L. /-! ## One target-direction parameter, with uniform mixed-point slack -/ /-- Target ratio, given by `|c0 F g * ⟪T, transverseDirection g⟫_ℝ / ⟪T, normalDirection g⟫_ℝ|`. -/ -noncomputable def targetRatio (F : ℝ) (g T : Plane) : ℝ := +@[expose] noncomputable def targetRatio (F : ℝ) (g T : Plane) : ℝ := |c0 F g * ⟪T, transverseDirection g⟫_ℝ / ⟪T, normalDirection g⟫_ℝ| /-- `T` is a continuous target direction, including at zero-amplitude edges. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryTargetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryTargetBounds.lean index 1de9beacf8..c6de50e04e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryTargetBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryTargetBounds.lean @@ -29,7 +29,7 @@ used for the local base estimates. Compact constants use the genuine stable inverse branch, including its regular zero-time boundary. -/ -@[expose] public section +public section noncomputable section @@ -107,7 +107,7 @@ theorem openCell_representative_distance (K : Set Slow) (L : PositiveRepresentat PositiveRepresentatives.representative_enlarged_distance K L (openCell_subset_box _ _ hp) /-- Cell domain, bundling `scale`, `carrier`, `isOpen`, `one_le_scale`. -/ -noncomputable def cellDomain (h lo hi : ℝ) (N : ℕ) : +@[expose] noncomputable def cellDomain (h lo hi : ℝ) (N : ℕ) : PhaseJetBounds.Domain (BaseChartJets.CellIndex h lo hi N) Slow where scale L := ChartScales.S (BaseChartJets.cellBand L) carrier L := openCell L.val.val.1 L.val.val.2 @@ -176,6 +176,7 @@ instance indexCountable (N : ℕ) : Countable (Index W N) := by infer_instance /-- Label, given by `L.val.val`. -/ +@[expose] noncomputable def label {N : ℕ} (L : Index W N) : PartitionedCovariance.UnsignedLabel := L.val.val theorem label_injective {N : ℕ} : Injective (label W (N := N)) := @@ -183,7 +184,7 @@ theorem label_injective {N : ℕ} : Injective (label W (N := N)) := /-- Domain, given by `cellDomain F.data.h (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) N`. -/ -noncomputable def domain (N : ℕ) : PhaseJetBounds.Domain (Index W N) Slow := +@[expose] noncomputable def domain (N : ℕ) : PhaseJetBounds.Domain (Index W N) Slow := cellDomain F.data.h (NominalConeAssembly.activeLeft W) (NominalConeAssembly.activeRight W) N /-- Representative, given by `PositiveRepresentatives.representative (referenceSet W) L.val`. -/ @@ -730,7 +731,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1411,9 +1412,9 @@ section MovingWeight variable {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) /-- Left radius, given by `Real.sqrt (2 * NominalConeAssembly.activeLeft W)`. -/ -noncomputable def leftRadius : ℝ := Real.sqrt (2 * NominalConeAssembly.activeLeft W) +@[expose] noncomputable def leftRadius : ℝ := Real.sqrt (2 * NominalConeAssembly.activeLeft W) /-- Right radius, given by `Real.sqrt (2 * NominalConeAssembly.activeRight W)`. -/ -noncomputable def rightRadius : ℝ := Real.sqrt (2 * NominalConeAssembly.activeRight W) +@[expose] noncomputable def rightRadius : ℝ := Real.sqrt (2 * NominalConeAssembly.activeRight W) theorem leftRadius_pos : 0 < leftRadius W := Real.sqrt_pos.mpr (mul_pos (by norm_num) (NominalConeAssembly.activeLeft_pos W)) @@ -1482,11 +1483,11 @@ theorem stripWeight_eq (r eta : ℝ) (hr : 0 < r) : norm_num [stripWeight, WeightedRadialPrimitive.zeta] /-- Profile radius, given by `p.1 / Real.sqrt (BaseChartJets.normalizedCoordinates h p).1`. -/ -noncomputable def profileRadius (h : ℝ) (p : Slow) : ℝ := +@[expose] noncomputable def profileRadius (h : ℝ) (p : Slow) : ℝ := p.1 / Real.sqrt (BaseChartJets.normalizedCoordinates h p).1 /-- Moving weight, given by `stripWeight W (profileRadius F.data.h p)`. -/ -noncomputable def movingWeight (p : Slow) : ℝ := stripWeight W (profileRadius F.data.h p) +@[expose] noncomputable def movingWeight (p : Slow) : ℝ := stripWeight W (profileRadius F.data.h p) theorem movingWeight_nonneg (p : Slow) : 0 ≤ movingWeight W p := stripWeight_nonneg W _ @@ -1557,7 +1558,7 @@ variable {F : OutgoingProfile.Profile} {W : NominalProfile.Witness F} (v : ModulatedProfileAssembly.Witness ld) /-- The literal leading covariance target in its own normalized band. -/ -noncomputable def actualTarget (p : Slow) : Plane := +@[expose] noncomputable def actualTarget (p : Slow) : Plane := (BaseChartJets.normalizedCoordinates F.data.h p).1 ^ (-CoordinateAlgebra.A F.data.h - 1/2) • ProfileSpectralCone.stressVector v.profiles F.data.h (BaseChartJets.normalizedCoordinates F.data.h p).2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ProblemStatement.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ProblemStatement.lean index a45e553c96..94f8fc9728 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ProblemStatement.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ProblemStatement.lean @@ -27,7 +27,7 @@ The `ContDiff` scope's `∞` means all finite differentiability orders. In this Mathlib version `⊤` would instead impose the stronger analytic order. -/ -@[expose] public section +public section noncomputable section @@ -49,62 +49,65 @@ abbrev VelocityField := SpaceTime → Space abbrev PressureField := SpaceTime → ℝ /-- The standard unit coordinate vectors, fixing both the metric and periods. -/ -def coordinateVector (i : Fin 3) : Space := EuclideanSpace.single i 1 +@[expose] def coordinateVector (i : Fin 3) : Space := EuclideanSpace.single i 1 /-- Physical spacetime before the proposed singular time, including initial time. -/ +@[expose] def preSingularDomain : Set SpaceTime := Ico 0 1 ×ˢ univ /-- The physical domain on which the prescribed force must be smooth. -/ -def futureDomain : Set SpaceTime := Ici 0 ×ˢ univ +@[expose] def futureDomain : Set SpaceTime := Ici 0 ×ˢ univ /-- Invariance under each of the three unit coordinate shifts. Quantifying over every spatial point also gives the corresponding negative shifts. -/ +@[expose] def UnitSpatialPeriodsOn {V : Type*} (times : Set ℝ) (g : SpaceTime → V) : Prop := ∀ t ∈ times, ∀ x : Space, ∀ i : Fin 3, g (t, x + coordinateVector i) = g (t, x) /-- Ordinary time derivative, evaluated on the positive unit time direction. It is used in the PDE only for `0 < t < 1`. -/ -def temporalDerivative (u : VelocityField) (t : ℝ) (x : Space) : Space := +@[expose] def temporalDerivative (u : VelocityField) (t : ℝ) (x : Space) : Space := fderiv ℝ (fun s : ℝ => u (s, x)) t 1 /-- Spatial Frechet derivative with time held fixed. -/ -def spatialDerivative (u : VelocityField) (t : ℝ) (x : Space) : Space →L[ℝ] Space := +@[expose] def spatialDerivative (u : VelocityField) (t : ℝ) (x : Space) : Space →L[ℝ] Space := fderiv ℝ (fun y : Space => u (t, y)) x /-- `(u · ∇)u`, the spatial derivative applied to the velocity vector. -/ -def advection (u : VelocityField) (t : ℝ) (x : Space) : Space := +@[expose] def advection (u : VelocityField) (t : ℝ) (x : Space) : Space := spatialDerivative u t x (u (t, x)) /-- Euclidean divergence `∑ᵢ ∂ᵢuᵢ`. -/ -def spatialDivergence (u : VelocityField) (t : ℝ) (x : Space) : ℝ := +@[expose] def spatialDivergence (u : VelocityField) (t : ℝ) (x : Space) : ℝ := ∑ i : Fin 3, (spatialDerivative u t x (coordinateVector i)) i /-- Euclidean gradient `∑ᵢ (∂ᵢp)eᵢ`. -/ -def pressureGradient (p : PressureField) (t : ℝ) (x : Space) : Space := +@[expose] def pressureGradient (p : PressureField) (t : ℝ) (x : Space) : Space := ∑ i : Fin 3, (fderiv ℝ (fun y : Space => p (t, y)) x (coordinateVector i)) • coordinateVector i /-- Componentwise Euclidean Laplacian `∑ᵢ ∂ᵢ∂ᵢu`. -/ -def spatialLaplacian (u : VelocityField) (t : ℝ) (x : Space) : Space := +@[expose] def spatialLaplacian (u : VelocityField) (t : ℝ) (x : Space) : Space := ∑ i : Fin 3, fderiv ℝ (fun y : Space => spatialDerivative u t y (coordinateVector i)) x (coordinateVector i) /-- The physical Navier--Stokes residual at viscosity exactly one. -/ -def navierStokesResidual (u : VelocityField) (p : PressureField) +@[expose] def navierStokesResidual (u : VelocityField) (p : PressureField) (t : ℝ) (x : Space) : Space := temporalDerivative u t x + advection u t x - spatialLaplacian u t x + pressureGradient p t x /-- A common finite upper endpoint for the force's future time support, uniformly over space. Spatial support is not required to be compact in the lift. -/ +@[expose] def CompactFutureTimeSupport (f : VelocityField) : Prop := ∃ T : ℝ, 0 ≤ T ∧ ∀ t : ℝ, T ≤ t → ∀ x : Space, f (t, x) = 0 /-- Pointwise expression of unbounded speed arbitrarily near time one from below. Both the threshold and the time-neighborhood radius are arbitrary. -/ -def SpeedUnboundedAtOne (u : VelocityField) : Prop := +@[expose] def SpeedUnboundedAtOne (u : VelocityField) : Prop := ∀ M : ℝ, 0 < M → ∀ δ : ℝ, 0 < δ → ∃ t : ℝ, ∃ x : Space, t ∈ Ioo 0 1 ∧ 1 - δ < t ∧ M < ‖u (t, x)‖ @@ -129,7 +132,7 @@ structure CandidateProperties (u : VelocityField) (p : PressureField) /-- The primary existential content of Candidate Theorem 1.1. Maximal lifespan, Sobolev blow-up, and force derivative decay are derived from these candidate conditions in separate theorems. -/ -def candidateStatement : Prop := +@[expose] def candidateStatement : Prop := ∃ u : VelocityField, ∃ p : PressureField, ∃ f : VelocityField, CandidateProperties u p f diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ProfileHistories.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ProfileHistories.lean index 097518ef07..91f38f0d0e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ProfileHistories.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ProfileHistories.lean @@ -35,7 +35,7 @@ functions, with their requisite radial derivative identities stated explicitly. No existence of the candidate profiles or estimates for them is asserted. -/ -@[expose] public section +public section noncomputable section @@ -44,21 +44,21 @@ namespace NavierStokes.StressAlgebra open MeasureTheory Set /-- The axial scaling exponent from the manuscript. -/ -def axialExponent (h : ℝ) : ℝ := 1 / 2 - h +@[expose] def axialExponent (h : ℝ) : ℝ := 1 / 2 - h /-- The velocity scaling exponent from the manuscript. -/ -def velocityExponent (h : ℝ) : ℝ := 1 / 2 + h +@[expose] def velocityExponent (h : ℝ) : ℝ := 1 / 2 + h /-- The coordinate factor `d = 1 - η²`. -/ -def coordinateFactor (η : ℝ) : ℝ := 1 - η ^ 2 +@[expose] def coordinateFactor (η : ℝ) : ℝ := 1 - η ^ 2 /-- `H S_q`, with radial derivatives written explicitly instead of logarithms. -/ -def angularSource (h η x W U H Hx Hη : ℝ) : ℝ := +@[expose] def angularSource (h η x W U H Hx Hη : ℝ) : ℝ := -W * x * Hx - h * (1 - 2 * η * U) * H - (axialExponent h * η + coordinateFactor η * U) * Hη /-- `S_n`, with `dot U = x U_x` and `dot P = x P_x`. -/ -def axialSource (h η x W U Ux Uη P Px Pη : ℝ) : ℝ := +@[expose] def axialSource (h η x W U Ux Uη P Px Pη : ℝ) : ℝ := -W * x * Ux - velocityExponent h * (1 - 2 * η * U) * U - (axialExponent h * η + coordinateFactor η * U) * Uη - coordinateFactor η * Pη + 4 * velocityExponent h * η * P + 2 * η * x * Px @@ -398,7 +398,7 @@ end end -@[expose] public section +public section noncomputable section @@ -435,9 +435,9 @@ def RadialDomain.rectangle (R a b : ℝ) : RadialDomain where exact abs_lt.mp (hmul.trans_lt hX) /-- Radial partial, given by `fderiv ℝ F p (1, 0)`. -/ -def radialPartial (F : Field) (p : Point) : ℝ := fderiv ℝ F p (1, 0) +@[expose] def radialPartial (F : Field) (p : Point) : ℝ := fderiv ℝ F p (1, 0) /-- Parameter partial, given by `fderiv ℝ F p (0, 1)`. -/ -def parameterPartial (F : Field) (p : Point) : ℝ := fderiv ℝ F p (0, 1) +@[expose] def parameterPartial (F : Field) (p : Point) : ℝ := fderiv ℝ F p (0, 1) theorem radialPartial_hasDerivAt (D : RadialDomain) {F : Field} (hF : ContDiffOn ℝ ∞ F D.carrier) {p : Point} (hp : p ∈ D.carrier) : @@ -544,10 +544,10 @@ theorem compact_parameter_integral_hasFDerivAt (hs : IsOpen s) end CompactParameterIntegral /-- Regular radial average, including its value at the axis. -/ -def average (F : Field) (p : Point) : ℝ := ∫ t in (0 : ℝ)..1, F (t * p.1, p.2) +@[expose] def average (F : Field) (p : Point) : ℝ := ∫ t in (0 : ℝ)..1, F (t * p.1, p.2) /-- Actual radial history from the axis. -/ -def primitive (F : Field) (p : Point) : ℝ := ∫ x in (0 : ℝ)..p.1, F (x, p.2) +@[expose] def primitive (F : Field) (p : Point) : ℝ := ∫ x in (0 : ℝ)..p.1, F (x, p.2) theorem primitive_eq_mul_average (F : Field) (p : Point) : primitive F p = p.1 * average F p := by @@ -708,30 +708,30 @@ open StressAlgebra variable {D : RadialDomain} (P : Profiles D) /-- H, defined pointwise by `2 * p.1 * P.f p`. -/ -def H : Field := fun p => 2 * p.1 * P.f p +@[expose] def H : Field := fun p => 2 * p.1 * P.f p /-- E, defined pointwise by `Real.sqrt (2 * p.1) * P.f p`. -/ -def E : Field := fun p => Real.sqrt (2 * p.1) * P.f p +@[expose] def E : Field := fun p => Real.sqrt (2 * p.1) * P.f p /-- Eη, defined pointwise by `Real.sqrt (2 * p.1) * parameterPartial P.f p`. -/ def Eη : Field := fun p => Real.sqrt (2 * p.1) * parameterPartial P.f p /-- Transport density, defined pointwise by `P.U p * P.H p`. -/ -def transportDensity : Field := fun p => P.U p * P.H p +@[expose] def transportDensity : Field := fun p => P.U p * P.H p /-- Energy density, defined pointwise by `P.U p ^ 2 - p.1 * P.f p ^ 2`. -/ -def energyDensity : Field := fun p => P.U p ^ 2 - p.1 * P.f p ^ 2 +@[expose] def energyDensity : Field := fun p => P.U p ^ 2 - p.1 * P.f p ^ 2 /-- M, given by `primitive P.U`. -/ -def M : Field := primitive P.U +@[expose] def M : Field := primitive P.U /-- I, given by `primitive P.H`. -/ -def I : Field := primitive P.H +@[expose] def I : Field := primitive P.H /-- J, given by `primitive P.transportDensity`. -/ -def J : Field := primitive P.transportDensity +@[expose] def J : Field := primitive P.transportDensity /-- S, given by `primitive P.energyDensity`. -/ -def S : Field := primitive P.energyDensity +@[expose] def S : Field := primitive P.energyDensity /-- Ubar, given by `average P.U`. -/ -def Ubar : Field := average P.U +@[expose] def Ubar : Field := average P.U /-- Pressure, defined pointwise by `P.pressure0 p.2 + primitive (fun q => P.f q ^ 2) p`. -/ -def pressure : Field := fun p => P.pressure0 p.2 + primitive (fun q => P.f q ^ 2) p +@[expose] def pressure : Field := fun p => P.pressure0 p.2 + primitive (fun q => P.f q ^ 2) p /-- W, defined pointwise by `1 - 2 * axialExponent h * p.2 * P.Ubar p - coordinateFactor p.2 * average (parameterPartial P.U) p`. -/ -def W (h : ℝ) : Field := fun p => +@[expose] def W (h : ℝ) : Field := fun p => 1 - 2 * axialExponent h * p.2 * P.Ubar p - coordinateFactor p.2 * average (parameterPartial P.U) p @@ -959,12 +959,12 @@ noncomputable def axialData (h : ℝ) (p : Point) (hp : p ∈ D.carrier) (hX : 0 /-- Angular source, defined pointwise by `StressAlgebra.angularSource h p.2 p.1 (P.W h p) (P.U p) (P.H p) (radialPartial P.H p) (parameterPartial P.H p)`. -/ -def angularSource (h : ℝ) : Field := fun p => +@[expose] def angularSource (h : ℝ) : Field := fun p => StressAlgebra.angularSource h p.2 p.1 (P.W h p) (P.U p) (P.H p) (radialPartial P.H p) (parameterPartial P.H p) /-- Axial source as an element of `Field`. -/ -def axialSource (h : ℝ) : Field := fun p => +@[expose] def axialSource (h : ℝ) : Field := fun p => StressAlgebra.axialSource h p.2 p.1 (P.W h p) (P.U p) (radialPartial P.U p) (parameterPartial P.U p) (P.pressure p) (P.f p ^ 2) (parameterPartial P.pressure p) @@ -991,10 +991,10 @@ theorem axialSource_smooth (h : ℝ) : ContDiffOn ℝ ∞ (P.axialSource h) D.ca (((contDiffOn_const.mul contDiffOn_snd).mul contDiffOn_fst).mul (P.f_smooth.pow 2)) /-- The printed Q_s is the regular primitive divided by its integrating factor. -/ -def angularLag (h : ℝ) : Field := fun p => primitive (P.angularSource h) p / (p.1 * P.H p) +@[expose] def angularLag (h : ℝ) : Field := fun p => primitive (P.angularSource h) p / (p.1 * P.H p) /-- The printed N_s is the regular primitive divided by X. -/ -def axialLag (h : ℝ) : Field := fun p => primitive (P.axialSource h) p / p.1 +@[expose] def axialLag (h : ℝ) : Field := fun p => primitive (P.axialSource h) p / p.1 /-- Equation (9), angular row, for actual smooth profile histories. -/ theorem angularLag_integrated (h : ℝ) {p : Point} (hp : p ∈ D.carrier) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean index 5d4e9e83ed..b19a9619f8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean @@ -32,7 +32,7 @@ All profiles and moments in this file are those of `OutgoingSchedule` and additional choice. Their log-coordinate translates are identified below. -/ -@[expose] public section +public section noncomputable section @@ -389,7 +389,7 @@ theorem prefixCoefficient_small (c : Parameters) parameter shape. These bounds therefore include the shape's first derivative. -/ /-- Parameter polynomial, given by `eta * (1 + eta ^ 2)`. -/ -noncomputable def parameterPolynomial (eta : ℝ) : ℝ := eta * (1 + eta ^ 2) +@[expose] noncomputable def parameterPolynomial (eta : ℝ) : ℝ := eta * (1 + eta ^ 2) theorem parameterPolynomial_bound {eta : ℝ} (heta : |eta| ≤ 1) : |parameterPolynomial eta| ≤ 2 := by @@ -440,9 +440,9 @@ theorem normalized_mass_prefix_small (c : Parameters) /-! ## The actual bump is one fixed template in log coordinates -/ /-- Template lower, given by `Real.exp (-(3 / 20 : ℝ))`. -/ -noncomputable def templateLower : ℝ := Real.exp (-(3 / 20 : ℝ)) +@[expose] noncomputable def templateLower : ℝ := Real.exp (-(3 / 20 : ℝ)) /-- Template upper, given by `Real.exp (3 / 20 : ℝ)`. -/ -noncomputable def templateUpper : ℝ := Real.exp (3 / 20 : ℝ) +@[expose] noncomputable def templateUpper : ℝ := Real.exp (3 / 20 : ℝ) /-- Radial template, given by `LocalizedMomentRepair.bump templateLower templateUpper`. -/ noncomputable def radialTemplate : ℝ → ℝ := LocalizedMomentRepair.bump templateLower templateUpper @@ -1424,7 +1424,7 @@ These finite-dimensional calculations do not establish existence of the full smooth schedule, estimates on the correction bumps, or the stress-cone bounds. -/ -@[expose] public section +public section noncomputable section @@ -1676,7 +1676,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1887,7 +1887,7 @@ theorem mainPulse_mul_prefixRepair (c : Parameters) (y : ℝ) : linarith /-- Pulse weight, given by `Real.exp (-2 * c.lam * y)`. -/ -def pulseWeight (c : Parameters) (y : ℝ) : ℝ := Real.exp (-2 * c.lam * y) +@[expose] def pulseWeight (c : Parameters) (y : ℝ) : ℝ := Real.exp (-2 * c.lam * y) theorem pulseWeight_continuous (c : Parameters) : Continuous (pulseWeight c) := Real.continuous_exp.comp (continuous_const.mul continuous_id) @@ -2006,7 +2006,7 @@ def coreEnergyWeight (c : Parameters) (y : ℝ) : ℝ := Real.exp y * radialAmplitude c.P c.dropLength c.lam y ^ 2 /-- Normalization, given by `Real.exp c.pulseStart * pulseAmplitude c ^ 2`. -/ -def normalization (c : Parameters) : ℝ := Real.exp c.pulseStart * pulseAmplitude c ^ 2 +@[expose] def normalization (c : Parameters) : ℝ := Real.exp c.pulseStart * pulseAmplitude c ^ 2 theorem normalization_pos (c : Parameters) : 0 < normalization c := mul_pos (Real.exp_pos _) (sq_pos_of_pos (pulseAmplitude_pos c)) @@ -2125,12 +2125,12 @@ theorem prefixAxialEnergy_bound (c : Parameters) : /-- Energy integrand, given by `Real.exp y * (axial d.core (fun _ => A) (y, eta) ^ 2 - OutgoingTail.finalAngular d (y, eta) ^ 2 / 2)`. -/ -def energyIntegrand (d : OutgoingTail.TailData) (A eta y : ℝ) : ℝ := +@[expose] def energyIntegrand (d : OutgoingTail.TailData) (A eta y : ℝ) : ℝ := Real.exp y * (axial d.core (fun _ => A) (y, eta) ^ 2 - OutgoingTail.finalAngular d (y, eta) ^ 2 / 2) /-- Total energy, given by `∫ y, energyIntegrand d A eta y`. -/ -def totalEnergy (d : OutgoingTail.TailData) (A eta : ℝ) : ℝ := +@[expose] def totalEnergy (d : OutgoingTail.TailData) (A eta : ℝ) : ℝ := ∫ y, energyIntegrand d A eta y /-- Tail energy, given by `∫ y in Ioi d.core.endpoint, Real.exp y * OutgoingTail.finalAngular d @@ -2313,7 +2313,7 @@ theorem totalEnergy_eq_of_integrable (d : OutgoingTail.TailData) (A eta : ℝ) linarith theorem tailEnergy_eq (d : OutgoingTail.TailData) (eta : ℝ) : - tailEnergy d eta = TailEnergyBounds.postPulseEnergy d eta := rfl + tailEnergy d eta = TailEnergyBounds.postPulseEnergy d eta := by rfl theorem tailEnergy_contDiff (d : OutgoingTail.TailData) : ContDiff ℝ ∞ (tailEnergy d) := TailEnergyBounds.postPulseEnergy_contDiff d @@ -2325,8 +2325,10 @@ theorem totalEnergy_eq (d : OutgoingTail.TailData) (A eta : ℝ) : totalEnergy_eq_of_integrable d A eta (TailEnergyBounds.energyDensity_integrable_postPulse d eta) /-- Normalized prefix axial, given by `c.lam * prefixAxialEnergy c / normalization c`. -/ +@[expose] def normalizedPrefixAxial (c : Parameters) : ℝ := c.lam * prefixAxialEnergy c / normalization c /-- Normalized prefix angular, given by `c.lam * prefixAngularEnergy c / normalization c`. -/ +@[expose] def normalizedPrefixAngular (c : Parameters) : ℝ := c.lam * prefixAngularEnergy c / normalization c /-- Normalized tail, given by `d.core.lam * tailEnergy d eta / (2 * normalization d.core * shape eta ^ 2)`. -/ @@ -2336,13 +2338,13 @@ def normalizedTail (d : OutgoingTail.TailData) (eta : ℝ) : ℝ := /-- Linear term, given by `linearCoefficient c * etaPolynomial eta`. -/ def linearTerm (c : Parameters) (eta : ℝ) : ℝ := linearCoefficient c * etaPolynomial eta /-- Constant term as an element of `ℝ`. -/ -def constantTerm (d : OutgoingTail.TailData) (eta : ℝ) : ℝ := +@[expose] def constantTerm (d : OutgoingTail.TailData) (eta : ℝ) : ℝ := (constantCorrection d.core + normalizedPrefixAxial d.core) * etaPolynomial eta ^ 2 - RadialSchedule.pulseEnergyDebt - normalizedPrefixAngular d.core - normalizedTail d eta /-- Energy polynomial, given by `quadraticCoefficient d.core * A ^ 2 + linearTerm d.core eta * A + constantTerm d eta`. -/ -def energyPolynomial (d : OutgoingTail.TailData) (A eta : ℝ) : ℝ := +@[expose] def energyPolynomial (d : OutgoingTail.TailData) (A eta : ℝ) : ℝ := quadraticCoefficient d.core * A ^ 2 + linearTerm d.core eta * A + constantTerm d eta theorem totalEnergy_normalized (d : OutgoingTail.TailData) (A eta : ℝ) : @@ -2481,7 +2483,7 @@ theorem amplitude_totalEnergy_zero (d : OutgoingTail.TailData) (eta : ℝ) /-! ## Actual coefficient estimates for the paper's wait duration -/ /-- Logarithmic rate, given by `lam * (1 + Real.log (1 / lam))`. -/ -def logarithmicRate (lam : ℝ) : ℝ := lam * (1 + Real.log (1 / lam)) +@[expose] def logarithmicRate (lam : ℝ) : ℝ := lam * (1 + Real.log (1 / lam)) theorem log_inverse_nonneg (c : Parameters) : 0 ≤ Real.log (1 / c.lam) := by apply Real.log_nonneg @@ -2837,7 +2839,7 @@ theorem errorConstant_ge {P : ℝ} (hP : 0 < P) (m : ℝ) : constructor <;> linarith /-- Error scale, given by `errorConstant c.P c.m * logarithmicRate c.lam`. -/ -def errorScale (c : Parameters) : ℝ := errorConstant c.P c.m * logarithmicRate c.lam +@[expose] def errorScale (c : Parameters) : ℝ := errorConstant c.P c.m * logarithmicRate c.lam theorem errorScale_pos (c : Parameters) : 0 < errorScale c := mul_pos (errorConstant_pos c.P_pos c.m) (logarithmicRate_pos c) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PulseCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PulseCone.lean index 686101d0ad..8723121d80 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PulseCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PulseCone.lean @@ -28,7 +28,7 @@ The resulting remainder is controlled by the actual second derivative of the forcing, with constants uniform in the pulse duration. -/ -@[expose] public section +public section noncomputable section @@ -853,7 +853,7 @@ The history and its parameter derivative retain the actual incoming prefix. Bounds come from their source integrals and the explicit pulse energy weight. -/ -@[expose] public section +public section namespace NavierStokes.PulseEnergyHistory @@ -1343,7 +1343,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactEnergy.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactEnergy.lean index 5ca41aded2..34cb2f8acd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactEnergy.lean @@ -37,7 +37,7 @@ the energy plus a constant. Only derivatives in the interior of the time interval are required. -/ -@[expose] public section +public section noncomputable section @@ -108,7 +108,7 @@ Continuity of the parameterized integral then supplies a finite bound on the closed time interval `[0, 1]`. -/ -@[expose] public section +public section noncomputable section @@ -161,7 +161,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactSchwartz.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactSchwartz.lean index e68835c9f2..06e7ce674e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactSchwartz.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactSchwartz.lean @@ -17,7 +17,7 @@ polynomially weighted derivative norm is continuous with compact support and is bounded, giving a Schwartz map with the original function as its coercion. -/ -@[expose] public section +public section @@ -45,7 +45,7 @@ theorem weighted_derivative_bound (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) exact ⟨C, fun x => (le_abs_self _).trans (hC x)⟩ /-- A compactly supported smooth function defines a Schwartz function. -/ -def ofCompactSupport (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) +@[expose] def ofCompactSupport (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) : SchwartzMap Space ℂ where toFun := f smooth' := hf @@ -53,16 +53,16 @@ def ofCompactSupport (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) @[simp] theorem coe_ofCompactSupport (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) : - (ofCompactSupport f hf hc : Space → ℂ) = f := rfl + (ofCompactSupport f hf hc : Space → ℂ) = f := by rfl @[simp] theorem ofCompactSupport_apply (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) (x : Space) : - ofCompactSupport f hf hc x = f x := rfl + ofCompactSupport f hf hc x = f x := by rfl /-- Passing to the Schwartz wrapper preserves topological support exactly. -/ @[simp] theorem tsupport_ofCompactSupport (f : Space → ℂ) (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) : - tsupport (ofCompactSupport f hf hc) = tsupport f := rfl + tsupport (ofCompactSupport f hf hc) = tsupport f := by rfl /-- Each iterated derivative remains supported inside the original support. -/ theorem tsupport_iteratedFDeriv_subset (f : Space → ℂ) (n : ℕ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactTimeIntegral.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactTimeIntegral.lean index a76fe53521..7edca26b07 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactTimeIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/CompactTimeIntegral.lean @@ -17,7 +17,7 @@ The public statements use the ordinary volume integral over all of R³. Uniform compact support supplies integrability and a local dominating function. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonCutoffs.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonCutoffs.lean index 509a40a054..4de6586192 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonCutoffs.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonCutoffs.lean @@ -18,7 +18,7 @@ All scaled cutoffs are obtained from this same bump by dilation. In particular, the constants in their derivative estimates do not depend on the radius. -/ -@[expose] public section +public section @@ -37,18 +37,19 @@ noncomputable def baseBump : ContDiffBump (0 : Space) := NavierStokesAndEuler.SmoothCutoff.baseBump Space /-- The unscaled cutoff. -/ -def baseCutoff (x : Space) : ℝ := +@[expose] def baseCutoff (x : Space) : ℝ := NavierStokesAndEuler.SmoothCutoff.baseCutoff Space x /-- The cutoff at spatial radius `R`; its estimates are stated for `0 < R`. -/ +@[expose] def cutoff (R : ℝ) (x : Space) : ℝ := NavierStokesAndEuler.SmoothCutoff.cutoff Space R x /-- The weight in the localized energy. -/ -def weight (R : ℝ) (x : Space) : ℝ := cutoff R x ^ 8 +@[expose] def weight (R : ℝ) (x : Space) : ℝ := cutoff R x ^ 8 /-- The multiplier used to commute the pressure operator. -/ -def multiplier (R : ℝ) (x : Space) : ℝ := cutoff R x ^ 2 +@[expose] def multiplier (R : ℝ) (x : Space) : ℝ := cutoff R x ^ 2 theorem baseCutoff_smooth : ContDiff ℝ ∞ baseCutoff := NavierStokesAndEuler.SmoothCutoff.baseCutoff_smooth @@ -153,7 +154,7 @@ theorem exists_derivative_bound (n : ℕ) : NavierStokesAndEuler.SmoothCutoff.baseCutoff_iteratedFDeriv_le n⟩ /-- A fixed positive bound for the `n`th derivative of the unscaled bump. -/ -def derivativeConstant (n : ℕ) : ℝ := +@[expose] def derivativeConstant (n : ℕ) : ℝ := NavierStokesAndEuler.SmoothCutoff.derivativeConstant Space n theorem derivativeConstant_pos (n : ℕ) : 0 < derivativeConstant n := @@ -177,7 +178,7 @@ theorem cutoff_second_fderiv_le {R : ℝ} (hR : 0 < R) (x : Space) : NavierStokesAndEuler.SmoothCutoff.cutoff_second_fderiv_le hR x /-- The scalar spatial Laplacian, using the fixed standard coordinate vectors. -/ -def laplacian (f : Space → ℝ) (x : Space) : ℝ := +@[expose] def laplacian (f : Space → ℝ) (x : Space) : ℝ := ∑ i : Fin 3, NavierStokes.SolutionDifference.spatialPartial i (NavierStokes.SolutionDifference.spatialPartial i f) x diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonFourierSetup.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonFourierSetup.lean index ed54ef66e2..07c160c53c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonFourierSetup.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonFourierSetup.lean @@ -11,7 +11,7 @@ public import LeanPool.NavierStokesAndEuler.NavierStokes.R3.ProblemStatement /-! # Fourier test expressions used in pressure recovery -/ -@[expose] public section +public section @@ -27,22 +27,22 @@ open ProblemStatement abbrev ComplexTest := SchwartzMap Space ℂ /-- Riesz symbol, given by `-(ξ i * ξ j) / ‖ξ‖ ^ 2`. -/ -def rieszSymbol (i j : Fin 3) (ξ : Space) : ℝ := +@[expose] def rieszSymbol (i j : Fin 3) (ξ : Space) : ℝ := -(ξ i * ξ j) / ‖ξ‖ ^ 2 /-- Riesz test, given by `FourierTransform.fourierInv (fun ξ : Space => (rieszSymbol i j ξ : ℂ) * (EulerSobolev.schwartzFourier ψ) ξ)`. -/ -def rieszTest (i j : Fin 3) (ψ : ComplexTest) : Space → ℂ := +@[expose] def rieszTest (i j : Fin 3) (ψ : ComplexTest) : Space → ℂ := FourierTransform.fourierInv (fun ξ : Space => (rieszSymbol i j ξ : ℂ) * (EulerSobolev.schwartzFourier ψ) ξ) /-- Pressure pair, given by `∫ x : Space, (g x : ℂ) * rieszTest i j ψ x`. -/ -def pressurePair (i j : Fin 3) (g : Space → ℝ) (ψ : ComplexTest) : ℂ := +@[expose] def pressurePair (i j : Fin 3) (g : Space → ℝ) (ψ : ComplexTest) : ℂ := ∫ x : Space, (g x : ℂ) * rieszTest i j ψ x /-- Fourier H norm sq, given by `∫ ξ : Space, (1 + ‖ξ‖ ^ 2) ^ s * ‖(FourierTransform.fourierCLE ℂ ComplexTest ψ) ξ‖ ^ 2`. -/ -def fourierHNormSq (s : ℕ) (ψ : ComplexTest) : ℝ := +@[expose] def fourierHNormSq (s : ℕ) (ψ : ComplexTest) : ℝ := ∫ ξ : Space, (1 + ‖ξ‖ ^ 2) ^ s * ‖(EulerSobolev.schwartzFourier ψ) ξ‖ ^ 2 end NavierStokesR3.Comparison diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonSetup.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonSetup.lean index a9d1387079..0df60e5e4d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonSetup.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ComparisonSetup.lean @@ -16,7 +16,7 @@ These are the ordinary volume energies and differential expressions. No comparison estimate or pressure representation is assumed in this module. -/ -@[expose] public section +public section @@ -38,41 +38,42 @@ abbrev partialD {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] NavierStokes.SolutionDifference.spatialPartial i f x /-- Comparison Lᵖ norm, given by `(eLpNorm f p (volume : Measure Space)).toReal`. -/ -def comparisonLpNorm {E : Type*} [NormedAddCommGroup E] (p : ℝ≥0∞) (f : Space → E) : ℝ := +@[expose] def comparisonLpNorm {E : Type*} [NormedAddCommGroup E] (p : ℝ≥0∞) (f : Space → E) : ℝ := (eLpNorm f p (volume : Measure Space)).toReal /-- L2 sq, given by `∫ x : Space, ‖f x‖ ^ 2`. -/ -def l2Sq {E : Type*} [NormedAddCommGroup E] (f : Space → E) : ℝ := +@[expose] def l2Sq {E : Type*} [NormedAddCommGroup E] (f : Space → E) : ℝ := ∫ x : Space, ‖f x‖ ^ 2 /-- Gradient sq, given by `∑ i : Fin 3, ‖partialD i f x‖ ^ 2`. -/ -def gradientSq (f : Space → Space) (x : Space) : ℝ := +@[expose] def gradientSq (f : Space → Space) (x : Space) : ℝ := ∑ i : Fin 3, ‖partialD i f x‖ ^ 2 /-- Weighted energy, given by `∫ x : Space, χ x * ‖w (t, x)‖ ^ 2`. -/ -def weightedEnergy (χ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := +@[expose] def weightedEnergy (χ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := ∫ x : Space, χ x * ‖w (t, x)‖ ^ 2 /-- Weighted energy rate, given by `∫ x : Space, χ x * (2 * ⟪w (t, x), NavierStokes.ProblemStatement.temporalDerivative w t x⟫_ℝ)`. -/ -def weightedEnergyRate (χ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := +@[expose] def weightedEnergyRate (χ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := ∫ x : Space, χ x * (2 * ⟪w (t, x), NavierStokes.ProblemStatement.temporalDerivative w t x⟫_ℝ) /-- Weighted dissipation, given by `∫ x : Space, χ x * gradientSq (fun y => w (t, y)) x`. -/ -def weightedDissipation (χ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := +@[expose] def weightedDissipation (χ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := ∫ x : Space, χ x * gradientSq (fun y => w (t, y)) x /-- Dissipation root, given by `Real.sqrt (weightedDissipation (fun x => φ x ^ 8) w t)`. -/ +@[expose] def dissipationRoot (φ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := Real.sqrt (weightedDissipation (fun x => φ x ^ 8) w t) /-- Cutoff L6, given by `comparisonLpNorm 6 (fun x => (φ x ^ 4) • w (t, x))`. -/ -def cutoffL6 (φ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := +@[expose] def cutoffL6 (φ : Space → ℝ) (w : VelocityField) (t : ℝ) : ℝ := comparisonLpNorm 6 (fun x => (φ x ^ 4) • w (t, x)) /-- Tensor diff, given by `u (t, x) i * u (t, x) j - v (t, x) i * v (t, x) j`. -/ -def tensorDiff (u v : VelocityField) (t : ℝ) (i j : Fin 3) (x : Space) : ℝ := +@[expose] def tensorDiff (u v : VelocityField) (t : ℝ) (i j : Fin 3) (x : Space) : ℝ := u (t, x) i * u (t, x) j - v (t, x) i * v (t, x) j end NavierStokesR3.Comparison diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ConservativeDifference.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ConservativeDifference.lean index 77a1b97b00..294d005793 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ConservativeDifference.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ConservativeDifference.lean @@ -22,7 +22,7 @@ of the test function; the velocities and pressures need no support or decay assumptions for the identities in this module. -/ -@[expose] public section +public section @@ -46,7 +46,7 @@ private theorem infty_add_one_le : (∞ : WithTop ℕ∞) + 1 ≤ ∞ := by /-- The ordinary scalar Laplacian, with the same coordinate directions as the vector Laplacian in the Navier--Stokes residual. -/ -def scalarLaplacian (f : Space → ℝ) (x : Space) : ℝ := +@[expose] def scalarLaplacian (f : Space → ℝ) (x : Space) : ℝ := ∑ i : Fin 3, spatialPartial i (spatialPartial i f) x theorem scalarLaplacian_contDiff {f : Space → ℝ} (hf : ContDiff ℝ ∞ f) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierSobolevWeights.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierSobolevWeights.lean index 1cd23127cc..b79811b8ba 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierSobolevWeights.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierSobolevWeights.lean @@ -17,7 +17,7 @@ The weight is constructed by coordinate multiplication on Schwartz space. Consequently the resulting Fourier expressions belong to ordinary `L²`. -/ -@[expose] public section +public section @@ -77,12 +77,12 @@ theorem weightedSchwartz_injective : Function.Injective weightedSchwartz := by exact_mod_cast (sq_pos_of_pos (show (0 : ℝ) < 1 + ‖ξ‖ ^ 2 by positivity)).ne') hξ /-- Weighted Fourier embedding of tests into ordinary complex `L²`. -/ -def BCLM : ComplexTest →L[ℂ] Lp ℂ 2 (volume : Measure Space) := +@[expose] def BCLM : ComplexTest →L[ℂ] Lp ℂ 2 (volume : Measure Space) := (SchwartzMap.toLpCLM ℂ ℂ 2 volume).comp (weightedSchwartz.comp EulerSobolev.schwartzFourierCLM) /-- The linear map underlying the continuous weighted Fourier embedding. -/ -def B : ComplexTest →ₗ[ℂ] Lp ℂ 2 (volume : Measure Space) := +@[expose] def B : ComplexTest →ₗ[ℂ] Lp ℂ 2 (volume : Measure Space) := BCLM.toLinearMap theorem continuous_B : Continuous B := BCLM.continuous diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierTestDerivatives.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierTestDerivatives.lean index 4746fa3236..f6f568b2df 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierTestDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/FourierTestDerivatives.lean @@ -21,7 +21,7 @@ as the equation. Their Fourier identities include the `2π` normalization of Mathlib's Fourier transform. -/ -@[expose] public section +public section @@ -35,11 +35,11 @@ namespace NavierStokesR3.HarmonicTestFunctionals open ProblemStatement Comparison /-- Coordinate differentiation on Schwartz tests. -/ -def partialCLM (i : Fin 3) : ComplexTest →L[ℂ] ComplexTest := +@[expose] def partialCLM (i : Fin 3) : ComplexTest →L[ℂ] ComplexTest := LineDeriv.lineDerivOpCLM ℂ ComplexTest (NavierStokes.ProblemStatement.coordinateVector i) /-- The ordinary spatial Laplacian acting on Schwartz tests. -/ -def laplacianCLM : ComplexTest →L[ℂ] ComplexTest := +@[expose] def laplacianCLM : ComplexTest →L[ℂ] ComplexTest := ∑ i : Fin 3, (partialCLM i).comp (partialCLM i) @[simp] theorem partialCLM_apply (i : Fin 3) (ψ : ComplexTest) (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/GradientOperator.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/GradientOperator.lean index d2a530ab37..4f28d331c8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/GradientOperator.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/GradientOperator.lean @@ -17,7 +17,7 @@ derivative. These pointwise estimates do not require differentiability: Lean's totalized `fderiv` is a continuous linear map for every function. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HarmonicTestFunctionals.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HarmonicTestFunctionals.lean index 6159390816..8216e07bf8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HarmonicTestFunctionals.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HarmonicTestFunctionals.lean @@ -38,7 +38,7 @@ to the weighted conjugate of an `L²` function, this removes the Fourier Laplacian multiplier away from its single zero at the origin. -/ -@[expose] public section +public section noncomputable section @@ -144,7 +144,7 @@ injective linear map into a Hilbert space is represented by an inner product in that Hilbert space. No topology on the source vector space is needed. -/ -@[expose] public section +public section namespace NavierStokesR3.HilbertFunctionalExtension @@ -186,7 +186,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCancellation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCancellation.lean index 23f74f61b1..09e5125923 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCancellation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCancellation.lean @@ -26,7 +26,7 @@ The resulting minimum is the cancellation factor used before interchanging the heat-time and spatial integrals. -/ -@[expose] public section +public section noncomputable section @@ -120,12 +120,12 @@ theorem cutoffSquareDifference_swap (φ : Space → ℝ) (x y : Space) : ring /-- The time-integrated kernel with cancellation already inserted. -/ -def cancelledTimeKernel (K : ℝ → Space → ℝ) (φ : Space → ℝ) +@[expose] def cancelledTimeKernel (K : ℝ → Space → ℝ) (φ : Space → ℝ) (x y : Space) : ℝ := ∫ s in Ioi (0 : ℝ), K s (x - y) * cutoffSquareDifference φ x y /-- The absolute time integral is used to justify the subsequent Fubini step. -/ -def absoluteCancelledTimeKernel (K : ℝ → Space → ℝ) (φ : Space → ℝ) +@[expose] def absoluteCancelledTimeKernel (K : ℝ → Space → ℝ) (φ : Space → ℝ) (x y : Space) : ℝ := ∫ s in Ioi (0 : ℝ), |K s (x - y) * cutoffSquareDifference φ x y| @@ -236,7 +236,7 @@ coordinate Hessian. The latter is proved to agree with the spatial derivatives used in the comparison argument. -/ -@[expose] public section +public section noncomputable section @@ -247,11 +247,11 @@ namespace NavierStokesR3.Comparison open ProblemStatement /-- The Euclidean heat kernel in three spatial dimensions. -/ -def heatKernel (s : ℝ) (z : Space) : ℝ := +@[expose] def heatKernel (s : ℝ) (z : Space) : ℝ := (4 * Real.pi * s) ^ (-(3 / 2 : ℝ)) * Real.exp (-(‖z‖ ^ 2) / (4 * s)) /-- The explicit coordinate Hessian of the Euclidean heat kernel. -/ -def heatKernelSecond (s : ℝ) (i j : Fin 3) (z : Space) : ℝ := +@[expose] def heatKernelSecond (s : ℝ) (i j : Fin 3) (z : Space) : ℝ := (z i * z j / (4 * s ^ 2) - (if i = j then 1 else 0) / (2 * s)) * heatKernel s z diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCommutator.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCommutator.lean index 8e48565be8..167883bd8c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelCommutator.lean @@ -38,7 +38,7 @@ heat semigroup has multiplier `exp (-4 * π² * s * ‖ξ‖²)`. Integrating i spatial derivative over positive time recovers the double Riesz multiplier. -/ -@[expose] public section +public section noncomputable section @@ -201,7 +201,7 @@ The only polynomial estimate used here absorbs the square of the norm into a Gaussian with half the decay rate. -/ -@[expose] public section +public section noncomputable section @@ -279,7 +279,7 @@ end end -@[expose] public section +public section noncomputable section @@ -490,7 +490,7 @@ absolute integral. The resulting radial majorant belongs to `L^(4/3)`, so Hölder with the `L^4` test function proves integrability on space times time. -/ -@[expose] public section +public section noncomputable section @@ -605,7 +605,7 @@ integrability also proves that the spatial convolution exists at every point; no global integrability of `inverseFourier A` is required. -/ -@[expose] public section +public section noncomputable section @@ -697,7 +697,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelPairedBound.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelPairedBound.lean index 09c9709a8a..dc712bfbfe 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelPairedBound.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/HeatKernelPairedBound.lean @@ -29,7 +29,7 @@ the ordinary Gamma integral. These estimates are uniform in the spatial indices and give the inverse-cube kernel bound in three dimensions. -/ -@[expose] public section +public section noncomputable section @@ -240,7 +240,7 @@ end end -@[expose] public section +public section noncomputable section @@ -253,7 +253,7 @@ open ProblemStatement /-- The actual time-integrated heat Hessian with cutoff cancellation already inserted into the time integrand. -/ -def heatCommutatorKernel (i j : Fin 3) (φ : Space → ℝ) (x y : Space) : ℝ := +@[expose] def heatCommutatorKernel (i j : Fin 3) (φ : Space → ℝ) (x y : Space) : ℝ := cancelledTimeKernel (fun s z => heatKernelSecond s i j z) φ x y /-- A universal positive constant for the paired commutator estimate. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean index dcc1e7748e..9692001d5a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean @@ -17,7 +17,7 @@ the comparison argument. Bounds that require a finite right-hand norm retain an explicit `MemLp` hypothesis. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean index 8caffa4651..599c82770a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean @@ -19,7 +19,7 @@ proves integrability on the product space, so Fubini is applicable. These results do not assume or construct a singular integral operator. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean index f6fced127e..d1ba8097ed 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean @@ -55,7 +55,7 @@ spatial test is smooth and compactly supported. Consequently all pairings are ordinary Lebesgue integrals even when the pressure grows at spatial infinity. -/ -@[expose] public section +public section noncomputable section @@ -271,7 +271,7 @@ The differential operators commute with this embedding. The pressure identities below continue to pair the physical pressure only with compact spatial tests. -/ -@[expose] public section +public section noncomputable section @@ -297,7 +297,7 @@ def realTest (ψ : Space → ℝ) (hψ : ContDiff ℝ ∞ ψ) (hcψ : HasCompact (hcψ.comp_left (g := fun r : ℝ => (r : ℂ)) (by simp)) @[simp] theorem realTest_apply (ψ : Space → ℝ) (hψ : ContDiff ℝ ∞ ψ) - (hcψ : HasCompactSupport ψ) (x : Space) : realTest ψ hψ hcψ x = (ψ x : ℂ) := rfl + (hcψ : HasCompactSupport ψ) (x : Space) : realTest ψ hψ hcψ x = (ψ x : ℂ) := by rfl theorem realTest_compact (ψ : Space → ℝ) (hψ : ContDiff ℝ ∞ ψ) (hcψ : HasCompactSupport ψ) : HasCompactSupport (realTest ψ hψ hcψ : Space → ℂ) := @@ -465,7 +465,7 @@ Only the test is approximated by compactly supported functions; no support or derivative bound is imposed on the field. -/ -@[expose] public section +public section noncomputable section @@ -654,7 +654,7 @@ uniform spatial integral bounds; no time derivative or global spatial derivative bound is used. -/ -@[expose] public section +public section noncomputable section @@ -1188,7 +1188,7 @@ section /-! # Pointwise recovery from compact temporal tests -/ -@[expose] public section +public section noncomputable section @@ -1227,7 +1227,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1672,7 +1672,7 @@ commutator form. Its estimates use only the unweighted velocity energy and the weighted velocity and gradient norms. -/ -@[expose] public section +public section noncomputable section @@ -2046,7 +2046,7 @@ identification of every compact scalar pressure-gradient pairing. It does not assume a pressure-flux formula or any bound on the pressure at infinity. -/ -@[expose] public section +public section noncomputable section @@ -2217,7 +2217,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2284,7 +2284,7 @@ cross terms use `L³` of that velocity and `L²` of the difference; the quadrati term uses the cutoff interpolation estimate. All norms remain finite explicitly. -/ -@[expose] public section +public section noncomputable section @@ -2506,7 +2506,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2666,11 +2666,11 @@ def fluxTest (R : ℝ) (hR : 0 < R) (w : Space → Space) (hw : ContDiff ℝ ∞ @[simp] theorem rTest_apply (R : ℝ) (hR : 0 < R) (w : Space → Space) (hw : ContDiff ℝ ∞ w) (x : Space) : - rTest R hR w hw x = (PressureFluxTest.cutoffTest R w x : ℂ) := rfl + rTest R hR w hw x = (PressureFluxTest.cutoffTest R w x : ℂ) := by rfl @[simp] theorem fluxTest_apply (R : ℝ) (hR : 0 < R) (w : Space → Space) (hw : ContDiff ℝ ∞ w) (x : Space) : - fluxTest R hR w hw x = (fderiv ℝ (ComparisonCutoffs.weight R) x (w x) : ℂ) := rfl + fluxTest R hR w hw x = (fderiv ℝ (ComparisonCutoffs.weight R) x (w x) : ℂ) := by rfl theorem fluxTest_eq_multiplier_rTest (R : ℝ) (hR : 0 < R) (w : Space → Space) (hw : ContDiff ℝ ∞ w) (x : Space) : @@ -2702,7 +2702,7 @@ theorem canonicalCutoffFlux_eq_sum (R : ℝ) (hR : 0 < R) (u v : VelocityField) (hu : ContDiff ℝ ∞ (fun x => u (t, x))) (hv : ContDiff ℝ ∞ (fun x => v (t, x))) : canonicalCutoffFlux R hR u v t hu hv = ∑ i : Fin 3, ∑ j : Fin 3, pressurePair i j (tensorDiff u v t i j) - (fluxTest R hR (fun x => (u - v) (t, x)) (hu.sub hv)) := rfl + (fluxTest R hR (fun x => (u - v) (t, x)) (hu.sub hv)) := by rfl theorem norm_canonicalCutoffFlux_le (R : ℝ) (hR : 0 < R) (u v : VelocityField) (t : ℝ) (hu : ContDiff ℝ ∞ (fun x => u (t, x))) (hv : ContDiff ℝ ∞ (fun x => v (t, x))) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean index a80c9f4422..1d2cc59f22 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean @@ -28,7 +28,7 @@ section /-! # Fourier bounds for pressure test functionals -/ -@[expose] public section +public section noncomputable section @@ -311,7 +311,7 @@ end end -@[expose] public section +public section noncomputable section @@ -413,14 +413,14 @@ def l1PairLinear (g : Space → ℝ) (hg : Integrable g) : ComplexTest →ₗ[ integralPairLinear g testValueLinear (integrable_l1_pair hg) @[simp] theorem l2PairLinear_apply (W : Space → ℝ) (hW : MemLp W 2) (ψ : ComplexTest) : - l2PairLinear W hW ψ = ∫ x : Space, (W x : ℂ) * ψ x := rfl + l2PairLinear W hW ψ = ∫ x : Space, (W x : ℂ) * ψ x := by rfl @[simp] theorem l1PairLinear_apply (g : Space → ℝ) (hg : Integrable g) (ψ : ComplexTest) : - l1PairLinear g hg ψ = ∫ x : Space, (g x : ℂ) * ψ x := rfl + l1PairLinear g hg ψ = ∫ x : Space, (g x : ℂ) * ψ x := by rfl /-- The coefficients are the two time averages of velocity and the time average of the quadratic tensor in the conservative pressure equation. -/ -def averagedPressureDifferenceValue (W0 W1 : Space → ℝ) +@[expose] def averagedPressureDifferenceValue (W0 W1 : Space → ℝ) (G : Fin 3 → Fin 3 → Space → ℝ) (k : Fin 3) (ψ : ComplexTest) : ℂ := (∫ x : Space, (W0 x : ℂ) * laplacianCLM ψ x) + (∫ x : Space, (W1 x : ℂ) * ψ x) + @@ -550,7 +550,7 @@ def pressurePairLinear (i j : Fin 3) (g : Space → ℝ) (hg : Integrable g) : @[simp] theorem pressurePairLinear_apply (i j : Fin 3) (g : Space → ℝ) (hg : Integrable g) (ψ : ComplexTest) : - pressurePairLinear i j g hg ψ = pressurePair i j g ψ := rfl + pressurePairLinear i j g hg ψ = pressurePair i j g ψ := by rfl /-- The averaged pressure-gradient difference determined by the stated velocity and quadratic-tensor coefficients. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ProblemStatement.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ProblemStatement.lean index 973ccad1b0..140fb5c2a6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ProblemStatement.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/ProblemStatement.lean @@ -35,7 +35,7 @@ every finite differentiability order. assert that it has a proof or supply a witness. -/ -@[expose] public section +public section @@ -68,7 +68,7 @@ def positiveTimeDomain : Set SpaceTime := Ioi 0 ×ˢ univ /-- The exact incompressible Navier--Stokes residual at viscosity `ν`. The viscosity multiplies only the spatial Laplacian. -/ -def navierStokesResidual (ν : ℝ) (u : VelocityField) (p : PressureField) +@[expose] def navierStokesResidual (ν : ℝ) (u : VelocityField) (p : PressureField) (t : ℝ) (x : Space) : Space := NavierStokes.ProblemStatement.temporalDerivative u t x + NavierStokes.ProblemStatement.advection u t x - @@ -82,17 +82,17 @@ def CompactPositiveTimeSupport (f : VelocityField) : Prop := /-- Square integrability with respect to ordinary Lebesgue volume on R³. This condition is explicit because the real Bochner integral is totalized. -/ -def SquareIntegrableAtTime (u : VelocityField) (t : ℝ) : Prop := +@[expose] def SquareIntegrableAtTime (u : VelocityField) (t : ℝ) : Prop := Integrable (fun x : Space => ‖u (t, x)‖ ^ 2) (volume : Measure Space) /-- Kinetic energy at a time. It is used below only together with the explicit integrability condition `SquareIntegrableAtTime`. -/ -def kineticEnergy (u : VelocityField) (t : ℝ) : ℝ := +@[expose] def kineticEnergy (u : VelocityField) (t : ℝ) : ℝ := (1 / 2 : ℝ) * ∫ x : Space, ‖u (t, x)‖ ^ 2 ∂(volume : Measure Space) /-- One finite bound for the kinetic energy at every time in `times`, with square integrability required at every such time. -/ -def UniformFiniteEnergy (times : Set ℝ) (u : VelocityField) : Prop := +@[expose] def UniformFiniteEnergy (times : Set ℝ) (u : VelocityField) : Prop := ∃ E : ℝ, 0 ≤ E ∧ ∀ t ∈ times, SquareIntegrableAtTime u t ∧ kineticEnergy u t ≤ E diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RadialKernelBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RadialKernelBounds.lean index 791fee256c..39eee4e279 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RadialKernelBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RadialKernelBounds.lean @@ -18,7 +18,7 @@ The cancellation factor `min (‖z‖ / R) 1` makes the singular kernel belong t volume of balls, so no principal-value integral occurs in this module. -/ -@[expose] public section +public section @@ -32,7 +32,7 @@ namespace NavierStokesR3.Comparison open ProblemStatement /-- The positive radial majorant after inserting the cutoff difference. -/ -def radialCommutatorKernel (R : ℝ) (z : Space) : ℝ := +@[expose] def radialCommutatorKernel (R : ℝ) (z : Space) : ℝ := ‖z‖ ^ (-3 : ℝ) * min (‖z‖ / R) 1 theorem radialCommutatorKernel_nonneg {R : ℝ} (hR : 0 < R) (z : Space) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszLinearityDecay.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszLinearityDecay.lean index d7dd026fde..3b1c80f356 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszLinearityDecay.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszLinearityDecay.lean @@ -19,7 +19,7 @@ The integrable Fourier multipliers defining the test operators respect complex linear combinations. Their inverse Fourier integrals vanish at spatial infinity. -/ -@[expose] public section +public section @@ -43,7 +43,7 @@ theorem rieszTest_add (i j : Fin 3) (ψ φ : ComplexTest) : (EulerSobolev.schwartzFourier φ) ξ) := by have hadd : EulerSobolev.schwartzFourier (ψ + φ) = EulerSobolev.schwartzFourier ψ + EulerSobolev.schwartzFourier φ := - (EulerSobolev.schwartzFourierCLM (V := Space) (E := ℂ)).map_add ψ φ + (FourierTransform.fourierCLM (F := ComplexTest) ℂ ComplexTest).map_add ψ φ funext ξ simp only [hadd, add_apply, Pi.add_apply, mul_add] have hcont : Continuous (fun p : Space × Space => (-innerₗ Space) p.1 p.2) := by @@ -63,7 +63,7 @@ theorem rieszTest_smul (i j : Fin 3) (c : ℂ) (ψ : ComplexTest) : (EulerSobolev.schwartzFourier ψ) ξ) := by have hsmul : EulerSobolev.schwartzFourier (c • ψ) = c • EulerSobolev.schwartzFourier ψ := - (EulerSobolev.schwartzFourierCLM (V := Space) (E := ℂ)).map_smul c ψ + (FourierTransform.fourierCLM (F := ComplexTest) ℂ ComplexTest).map_smul c ψ funext ξ simp only [hsmul, smul_apply, Pi.smul_apply, smul_eq_mul, mul_left_comm] unfold rieszTest @@ -71,13 +71,13 @@ theorem rieszTest_smul (i j : Fin 3) (c : ℂ) (ψ : ComplexTest) : exact VectorFourier.fourierIntegral_const_smul _ _ _ _ c /-- The Riesz test operator as a complex linear map into ordinary functions. -/ -def rieszTestLinear (i j : Fin 3) : ComplexTest →ₗ[ℂ] (Space → ℂ) where +@[expose] def rieszTestLinear (i j : Fin 3) : ComplexTest →ₗ[ℂ] (Space → ℂ) where toFun := rieszTest i j map_add' := rieszTest_add i j map_smul' := rieszTest_smul i j @[simp] theorem rieszTestLinear_apply (i j : Fin 3) (ψ : ComplexTest) : - rieszTestLinear i j ψ = rieszTest i j ψ := rfl + rieszTestLinear i j ψ = rieszTest i j ψ := by rfl @[simp] theorem rieszTest_zero (i j : Fin 3) : rieszTest i j 0 = 0 := map_zero (rieszTestLinear i j) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszPairing.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszPairing.lean index cec0dca7f9..b8d71665aa 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszPairing.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszPairing.lean @@ -21,7 +21,7 @@ transpose identity and the Hermitian Fourier pairing. No extension to an operator on all of `L²` is used. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszSymbolRegularity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszSymbolRegularity.lean index 9543e38282..ecd968c6c0 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszSymbolRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszSymbolRegularity.lean @@ -18,7 +18,7 @@ Its bound by one gives integrability of every polynomial moment of a multiplied Schwartz transform, hence smoothness and boundedness of its inverse Fourier integral. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean index 23ec7b4764..53c7f25539 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean @@ -39,7 +39,7 @@ energy. Fatou's lemma then proves both square integrability and the global bound, without extending the Fourier transform to arbitrary `L²` functions. -/ -@[expose] public section +public section noncomputable section @@ -211,7 +211,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzCompactApproximation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzCompactApproximation.lean index 736a469db5..1111cd49f3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzCompactApproximation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzCompactApproximation.lean @@ -19,7 +19,7 @@ by a fixed constant divided by R. Consequently compactly supported Schwartz functions are dense, and continuous identities extend from compact tests. -/ -@[expose] public section +public section @@ -34,13 +34,15 @@ namespace NavierStokesR3.SchwartzCompactApproximation open ProblemStatement ComparisonCutoffs /-- Multiplication by a compactly supported smooth cutoff. -/ -def truncate (ψ : SchwartzMap Space ℂ) (R : ℝ) (hR : 0 < R) : SchwartzMap Space ℂ := +@[expose] def truncate (ψ : SchwartzMap Space ℂ) (R : ℝ) (hR : 0 < R) : + SchwartzMap Space ℂ := CompactSchwartz.ofCompactSupport (fun x => cutoff R x • ψ x) ((cutoff_smooth R).smul (ψ.smooth ⊤)) (cutoff_hasCompactSupport hR).smul_right @[simp] theorem truncate_apply (ψ : SchwartzMap Space ℂ) (R : ℝ) (hR : 0 < R) - (x : Space) : truncate ψ R hR x = cutoff R x • ψ x := rfl + (x : Space) : truncate ψ R hR x = cutoff R x • ψ x := by + exact CompactSchwartz.ofCompactSupport_apply _ _ _ x theorem truncate_hasCompactSupport (ψ : SchwartzMap Space ℂ) (R : ℝ) (hR : 0 < R) : HasCompactSupport (truncate ψ R hR : Space → ℂ) := by @@ -189,11 +191,12 @@ theorem seminorm_truncate_sub_le (ψ : SchwartzMap Space ℂ) {R : ℝ} exact truncate_error_weighted_le ψ hR hRone k m /-- A sequence of compactly supported smooth approximations. -/ -def approximate (ψ : SchwartzMap Space ℂ) (n : ℕ) : SchwartzMap Space ℂ := +@[expose] def approximate (ψ : SchwartzMap Space ℂ) (n : ℕ) : SchwartzMap Space ℂ := truncate ψ ((n : ℝ) + 1) (by positivity) @[simp] theorem approximate_apply (ψ : SchwartzMap Space ℂ) (n : ℕ) (x : Space) : - approximate ψ n x = cutoff ((n : ℝ) + 1) x • ψ x := rfl + approximate ψ n x = cutoff ((n : ℝ) + 1) x • ψ x := by + exact truncate_apply ψ _ _ x theorem approximate_hasCompactSupport (ψ : SchwartzMap Space ℂ) (n : ℕ) : HasCompactSupport (approximate ψ n : Space → ℂ) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzParseval.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzParseval.lean index 37dacc81e8..597d491c65 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzParseval.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SchwartzParseval.lean @@ -18,7 +18,7 @@ They use Fourier inversion on Schwartz functions, without introducing an extension of the Fourier transform to all of `L²`. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SmoothSobolevL6.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SmoothSobolevL6.lean index feca374ed4..0f373105cd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SmoothSobolevL6.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/SmoothSobolevL6.lean @@ -18,7 +18,7 @@ function whose value and derivative belong to `L²`. The derivative of the cutoff contributes an error tending to zero; Fatou's lemma passes to the limit. -/ -@[expose] public section +public section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean index a8a3724018..8dfd04fdd3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean @@ -28,7 +28,7 @@ measurability and finite endpoint norms. In fact, the interpolation identities only require a nonnegative weight; an upper bound of one is unnecessary. -/ -@[expose] public section +public section noncomputable section @@ -265,7 +265,7 @@ Only the scalar weight has compact support. The velocity, transported field, and pressure may be arbitrary smooth functions on Euclidean three-space. -/ -@[expose] public section +public section noncomputable section @@ -365,7 +365,7 @@ measurability. In particular, the comparison field need not have compact support or any globally bounded derivative. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean index 29d10b0493..18e0143a43 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean @@ -18,7 +18,7 @@ The derivative estimate is local: the unweighted velocity only needs to be in `L²`. No integrability assumption is made on its unweighted derivative. -/ -@[expose] public section +public section @@ -32,7 +32,7 @@ namespace NavierStokesR3.WeightedSobolev open ProblemStatement Comparison /-- The fixed whole-space `H¹ → L⁶` Sobolev constant in dimension three. -/ -def sobolevConstant : ℝ := +@[expose] def sobolevConstant : ℝ := (eLpNormLESNormFDerivOfEqInnerConst (volume : Measure Space) 2 : ℝ) theorem sobolevConstant_nonneg : 0 ≤ sobolevConstant := NNReal.coe_nonneg _ @@ -102,7 +102,7 @@ theorem norm_fderiv_cutoff_four_le {φ : Space → ℝ} {w : Space → Space} _ = _ := by simp [Real.norm_eq_abs, abs_of_nonneg hφ0] /-- The pointwise magnitude of the weighted coordinate gradient. -/ -def cutoffGradientAmplitude (φ : Space → ℝ) (w : Space → Space) (x : Space) : ℝ := +@[expose] def cutoffGradientAmplitude (φ : Space → ℝ) (w : Space → Space) (x : Space) : ℝ := φ x ^ 4 * Real.sqrt (gradientSq w x) theorem cutoffGradientAmplitude_nonneg (φ : Space → ℝ) (w : Space → Space) (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean index ec38080101..1e981f4c88 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean @@ -67,7 +67,7 @@ weight is smooth and compactly supported; the vector field is smooth but is not required to have compact support or globally integrable derivatives. -/ -@[expose] public section +public section noncomputable section @@ -222,7 +222,7 @@ end end -@[expose] public section +public section noncomputable section @@ -458,7 +458,7 @@ nonnegative quantity that will represent a weighted gradient norm. All fractional powers have real exponents. -/ -@[expose] public section +public section noncomputable section @@ -613,7 +613,7 @@ end end -@[expose] public section +public section noncomputable section @@ -769,7 +769,7 @@ derivatives. The compact cutoff supplies local integrability; the estimates use its weighted `L⁶` norm and the unweighted `L²` norm of the difference. -/ -@[expose] public section +public section noncomputable section @@ -1043,7 +1043,7 @@ the closed interval and derivatives on its interior. In particular, no energy inequality at a time endpoint is assumed. -/ -@[expose] public section +public section noncomputable section @@ -1162,7 +1162,7 @@ At a fixed time, square integrability gives an integrable dominating function. This module removes the cutoff only after that hypothesis has been supplied. -/ -@[expose] public section +public section noncomputable section @@ -1248,7 +1248,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1413,7 +1413,7 @@ These bounds are consequences of joint smoothness and one fixed compact spatial support. They impose no condition on the competing solution. -/ -@[expose] public section +public section noncomputable section @@ -1566,7 +1566,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3CompactCandidate.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3CompactCandidate.lean index 769fff9164..18515e989c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3CompactCandidate.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3CompactCandidate.lean @@ -35,7 +35,7 @@ Euclidean space. They bound the full one-sided space-time derivative tensors, including time zero, and allow every real decay exponent. -/ -@[expose] public section +public section noncomputable section @@ -130,7 +130,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RadialHeatProfile.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RadialHeatProfile.lean index 927d59d50b..cec89eec72 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RadialHeatProfile.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RadialHeatProfile.lean @@ -17,7 +17,7 @@ Lemma 4.4. Its derivative kernels have gamma-integrable bounds on the whole closed half-line of nonnegative profile arguments. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ def moment (a : ℝ) (n : ℕ) (z : ℝ) : ℝ := ∫ v in Ioi (0 : ℝ), kernel a n z v /-- The manuscript's normalized radial heat profile, with `a = 1 + h`. -/ -def profile (a z : ℝ) : ℝ := (Real.Gamma a)⁻¹ * moment a 0 z +@[expose] def profile (a z : ℝ) : ℝ := (Real.Gamma a)⁻¹ * moment a 0 z theorem base_one_le {z v : ℝ} (hz : 0 ≤ z) (hv : 0 ≤ v) : 1 ≤ 1 + z * v := le_add_of_nonneg_right (mul_nonneg hz hv) @@ -209,12 +209,12 @@ theorem moment_hasDerivWithinAt {a z : ℝ} (ha : 1 < a) (n : ℕ) (hz : 0 ≤ z · exact (moment_hasDerivAt ha n hzpos).hasDerivWithinAt /-- Falling coefficients of the genuine derivative kernels. -/ -noncomputable def derivativeCoeff (a : ℝ) : ℕ → ℝ +@[expose] noncomputable def derivativeCoeff (a : ℝ) : ℕ → ℝ | 0 => 1 | n + 1 => derivativeCoeff a n * (1 - a - (n : ℝ)) /-- Profile jet, given by `(Real.Gamma a)⁻¹ * derivativeCoeff a n * moment a n z`. -/ -def profileJet (a : ℝ) (n : ℕ) (z : ℝ) : ℝ := +@[expose] def profileJet (a : ℝ) (n : ℕ) (z : ℝ) : ℝ := (Real.Gamma a)⁻¹ * derivativeCoeff a n * moment a n z theorem profileJet_hasDerivWithinAt {a z : ℝ} (ha : 1 < a) (n : ℕ) (hz : 0 ≤ z) : @@ -485,15 +485,15 @@ theorem profile_sub_one_bound {a z : ℝ} (ha : 1 < a) (hz : 0 ≤ z) : /-! ## The radial heat equation with the source exponent -/ /-- This is `-A`, since `A = 1/2 + h` and `a = 1 + h`. -/ -def spatialExponent (a : ℝ) : ℝ := 1 / 2 - a +@[expose] def spatialExponent (a : ℝ) : ℝ := 1 / 2 - a /-- The physical profile in the coordinate `s = r²/2`, at backward time `τ`. -/ -def spatialProfile (a τ s : ℝ) : ℝ := +@[expose] def spatialProfile (a τ s : ℝ) : ℝ := s ^ spatialExponent a * profile a (2 * τ / s) /-- Spatial first, given by `s ^ (spatialExponent a - 1) * (spatialExponent a * profile a (2 * τ / s) - (2 * τ / s) * profileJet a 1 (2 * τ / s))`. -/ -def spatialFirst (a τ s : ℝ) : ℝ := +@[expose] def spatialFirst (a τ s : ℝ) : ℝ := s ^ (spatialExponent a - 1) * (spatialExponent a * profile a (2 * τ / s) - (2 * τ / s) * profileJet a 1 (2 * τ / s)) @@ -590,10 +590,10 @@ theorem spatial_heat_identity {a τ s : ℝ} (ha : 1 < a) (hτ : 0 < τ) (hs : 0 ring /-- The radial velocity profile in physical radius and backward time. -/ -def radialProfile (a τ r : ℝ) : ℝ := spatialProfile a τ (r ^ 2 / 2) +@[expose] def radialProfile (a τ r : ℝ) : ℝ := spatialProfile a τ (r ^ 2 / 2) /-- Radial first, given by `spatialFirst a τ (r ^ 2 / 2) * r`. -/ -def radialFirst (a τ r : ℝ) : ℝ := spatialFirst a τ (r ^ 2 / 2) * r +@[expose] def radialFirst (a τ r : ℝ) : ℝ := spatialFirst a τ (r ^ 2 / 2) * r /-- Radial second, given by `spatialSecond a τ (r ^ 2 / 2) * r ^ 2 + spatialFirst a τ (r ^ 2 / 2)`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean index a7b293a587..2981bd03ac 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean @@ -35,7 +35,7 @@ interval `(0,L)`. The constants in the estimates are independent of the point approaching either endpoint and of any auxiliary shifts in the source. -/ -@[expose] public section +public section noncomputable section @@ -49,11 +49,11 @@ private theorem nat_le_smooth (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := le_of_lt (WithTop.coe_lt_coe.mpr (ENat.natCast_lt_top n)) /-- Delta, given by `min 1 (min x (L - x))`. -/ -def delta (L x : ℝ) : ℝ := min 1 (min x (L - x)) +@[expose] def delta (L x : ℝ) : ℝ := min 1 (min x (L - x)) /-- Zeta, given by `edge cL x * edge cR (L - x)`. -/ -def zeta (cL cR L x : ℝ) : ℝ := edge cL x * edge cR (L - x) +@[expose] def zeta (cL cR L x : ℝ) : ℝ := edge cL x * edge cR (L - x) /-- Weight, given by `zeta cL cR L x / delta L x ^ m`. -/ -def weight (cL cR L : ℝ) (m : ℕ) (x : ℝ) : ℝ := zeta cL cR L x / delta L x ^ m +@[expose] def weight (cL cR L : ℝ) (m : ℕ) (x : ℝ) : ℝ := zeta cL cR L x / delta L x ^ m /-- Single weight, given by `edge c x / x ^ m`. -/ def singleWeight (c : ℝ) (m : ℕ) (x : ℝ) : ℝ := edge c x / x ^ m @@ -407,11 +407,11 @@ end Integrals /-! ### Pullback to logarithmic edge distances on a fixed positive annulus -/ /-- Log length, given by `Real.log (b / a)`. -/ -def logLength (a b : ℝ) : ℝ := Real.log (b / a) +@[expose] def logLength (a b : ℝ) : ℝ := Real.log (b / a) /-- Log position, given by `Real.log (X / a)`. -/ -def logPosition (a X : ℝ) : ℝ := Real.log (X / a) +@[expose] def logPosition (a X : ℝ) : ℝ := Real.log (X / a) /-- Log weight, given by `weight cL cR (logLength a b) m (logPosition a X)`. -/ -def logWeight (cL cR a b : ℝ) (m : ℕ) (X : ℝ) : ℝ := +@[expose] def logWeight (cL cR a b : ℝ) (m : ℕ) (X : ℝ) : ℝ := weight cL cR (logLength a b) m (logPosition a X) theorem logLength_pos {a b : ℝ} (ha : 0 < a) (hab : a < b) : 0 < logLength a b := @@ -1046,7 +1046,7 @@ variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- A concrete `StripData`: the radial domain and both weights are explicit; the only inputs beyond the annulus are the positive band scales. -/ -noncomputable def logStripData (a b cL cR : ℝ) (ha : 0 < a) +@[expose] noncomputable def logStripData (a b cL cR : ℝ) (ha : 0 < a) (hcL : 0 < cL) (hcR : 0 < cR) (ε S : ℕ → ℝ) (hε : ∀ n, 0 < ε n) (hεone : ∀ n, ε n ≤ 1) (hS : ∀ n, 1 ≤ S n) : WeightedClasses.StripData (ℝ × E) where @@ -1153,7 +1153,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1167,7 +1167,7 @@ private theorem nat_le_smooth (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := le_of_lt (WithTop.coe_lt_coe.mpr (ENat.natCast_lt_top n)) /-- A globally smooth positive radius, identical to the radius above `2ℓ`. -/ -noncomputable def positiveRadius (ℓ x : ℝ) : ℝ := +@[expose] noncomputable def positiveRadius (ℓ x : ℝ) : ℝ := ℓ + (x - ℓ) * Real.smoothTransition ((x - ℓ) / ℓ) theorem positiveRadius_contDiff (ℓ : ℝ) : ContDiff ℝ ∞ (positiveRadius ℓ) := by @@ -1211,11 +1211,11 @@ theorem positiveRadius_lt {ℓ x t : ℝ} (hℓ : 0 < ℓ) (hℓt : ℓ < t) (hx (positiveRadius_le_max hℓ x).trans_lt (max_lt hℓt hxt) /-- Power chart, given by `(positiveRadius (a / 4) R) ^ d`. -/ -noncomputable def powerChart (d a R : ℝ) : ℝ := (positiveRadius (a / 4) R) ^ d +@[expose] noncomputable def powerChart (d a R : ℝ) : ℝ := (positiveRadius (a / 4) R) ^ d /-- Inverse chart, given by `(positiveRadius (a ^ d / 4) U) ^ d⁻¹`. -/ noncomputable def inverseChart (d a U : ℝ) : ℝ := (positiveRadius (a ^ d / 4) U) ^ d⁻¹ /-- Radial jacobian, given by `d * R ^ (d - 1)`. -/ -noncomputable def radialJacobian (d R : ℝ) : ℝ := d * R ^ (d - 1) +@[expose] noncomputable def radialJacobian (d R : ℝ) : ℝ := d * R ^ (d - 1) theorem powerChart_contDiff {a : ℝ} (ha : 0 < a) (d : ℝ) : ContDiff ℝ ∞ (powerChart d a) := @@ -1321,7 +1321,7 @@ variable {E V : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Lift chart, given by `(φ z.1, z.2)`. -/ -noncomputable def liftChart (φ : ℝ → ℝ) (z : ℝ × E) : ℝ × E := (φ z.1, z.2) +@[expose] noncomputable def liftChart (φ : ℝ → ℝ) (z : ℝ × E) : ℝ × E := (φ z.1, z.2) theorem liftChart_contDiff {φ : ℝ → ℝ} (hφ : ContDiff ℝ ∞ φ) : ContDiff ℝ ∞ (liftChart (E := E) φ) := (hφ.comp contDiff_fst).prodMk contDiff_snd @@ -1335,7 +1335,7 @@ theorem liftChart_hasFDerivAt {φ : ℝ → ℝ} {c : ℝ} (z : ℝ × E) (hφ : /-- Source multiplier, given by `(radialJacobian d (inverseChart d a U))⁻¹`. -/ noncomputable def sourceMultiplier (d a U : ℝ) : ℝ := (radialJacobian d (inverseChart d a U))⁻¹ /-- Normalize source, given by `sourceMultiplier d a z.1 • g (liftChart (inverseChart d a) z)`. -/ -noncomputable def normalizeSource (d a : ℝ) (g : ℝ × E → V) (z : ℝ × E) : V := +@[expose] noncomputable def normalizeSource (d a : ℝ) (g : ℝ × E → V) (z : ℝ × E) : V := sourceMultiplier d a z.1 • g (liftChart (inverseChart d a) z) theorem sourceMultiplier_contDiff {a d : ℝ} (ha : 0 < a) (hd : 0 < d) : @@ -1388,7 +1388,7 @@ theorem normalizeSource_eq_formula {a b d U : ℝ} (ha : 0 < a) (hab : a < b) TransportPrimitive.radial_zero_of_lt hs hR, smul_zero] /-- Pullback, given by `F ∘ liftChart (powerChart d a)`. -/ -noncomputable def pullback (d a : ℝ) (F : ℝ × E → V) : ℝ × E → V := +@[expose] noncomputable def pullback (d a : ℝ) (F : ℝ × E → V) : ℝ × E → V := F ∘ liftChart (powerChart d a) theorem pullback_contDiff {a : ℝ} (ha : 0 < a) (d : ℝ) @@ -1408,7 +1408,8 @@ theorem pullback_supported {a b d : ℝ} (ha : 0 < a) (hab : a < b) (hd : 0 < d) exact (not_lt_of_ge hr.2) (powerChart_gt_right ha hab hd (lt_of_not_ge h)) /-- Physical graph derivative, given by `fderiv ℝ F z (1, (radialJacobian d z.1 * M) • v)`. -/ -noncomputable def physicalGraphDeriv (d M : ℝ) (v : E) (F : ℝ × E → V) (z : ℝ × E) : V := +@[expose] noncomputable def physicalGraphDeriv (d M : ℝ) (v : E) + (F : ℝ × E → V) (z : ℝ × E) : V := fderiv ℝ F z (1, (radialJacobian d z.1 * M) • v) /-- The physical radial graph derivative is the transformed transport @@ -1489,7 +1490,7 @@ theorem total_normalized_eq_radialIntegral {a b d : ℝ} /-- Physical compact, given by `pullback d a (TransportPrimitive.compactIntegral (TransportPrimitive.interiorCutoff (a ^ d) (b ^ d)) M v (normalizeSource d a g))`. -/ -noncomputable def physicalCompact (d a b M : ℝ) (v : E) (g : ℝ × E → V) : ℝ × E → V := +@[expose] noncomputable def physicalCompact (d a b M : ℝ) (v : E) (g : ℝ × E → V) : ℝ × E → V := pullback d a (TransportPrimitive.compactIntegral (TransportPrimitive.interiorCutoff (a ^ d) (b ^ d)) M v (normalizeSource d a g)) @@ -1528,14 +1529,14 @@ theorem physicalCompact_eq_radialIntegral {a b d : ℝ} simp only [normalized_radial_integral ha hd hz hg, normalized_radial_integral ha hd hab.le hg] /-- Physical alias as an element of `V`. -/ -noncomputable def physicalAlias (d a b M : ℝ) (v : E) (g : ℝ × E → V) (z : ℝ × E) : V := +@[expose] noncomputable def physicalAlias (d a b M : ℝ) (v : E) (g : ℝ × E → V) (z : ℝ × E) : V := (radialJacobian d z.1 * deriv (TransportPrimitive.interiorCutoff (a ^ d) (b ^ d)) (powerChart d a z.1)) • TransportPrimitive.totalIntegral M v (normalizeSource d a g) (liftChart (powerChart d a) z) /-- Physical cutoff, given by `TransportPrimitive.interiorCutoff (a ^ d) (b ^ d) (powerChart d a R)`. -/ -noncomputable def physicalCutoff (d a b R : ℝ) : ℝ := +@[expose] noncomputable def physicalCutoff (d a b R : ℝ) : ℝ := TransportPrimitive.interiorCutoff (a ^ d) (b ^ d) (powerChart d a R) theorem physicalCutoff_contDiff {a : ℝ} (ha : 0 < a) (d b : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateBounds.lean index 5906204ac2..ebfd241f63 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateBounds.lean @@ -18,7 +18,7 @@ State increment. A fixed containing shell is used only to estimate the integral; the final class retains the original moving profile weight. -/ -@[expose] public section +public section namespace NavierStokes.RankStateBounds diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateCoherence.lean index 4fb11cfa30..16dc89db9e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RankStateCoherence.lean @@ -18,7 +18,7 @@ data and the shared normalized inverse are transported before applying the actual variable-gauge stream and pressure constructors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReferenceJetBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReferenceJetBounds.lean index e6f93277f3..0bae624d78 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ReferenceJetBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ReferenceJetBounds.lean @@ -17,7 +17,7 @@ Coefficient-space norm bounds first give constants independent of the normalization C. Only afterwards is the short REF transition chosen. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReferencePath.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReferencePath.lean index cee65967cd..43686efb59 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ReferencePath.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ReferencePath.lean @@ -20,7 +20,7 @@ radius. A smooth cutoff damps those slopes to zero; no radial reparametrization is substituted for the prescribed differential equation. -/ -@[expose] public section +public section noncomputable section @@ -32,13 +32,13 @@ open scoped Topology ContDiff open ProfileHistories /-- Full strip, bundling `carrier`, `isOpen`, `scale_mem`. -/ -def fullStrip (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where +@[expose] def fullStrip (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where carrier := univ ×ˢ J isOpen := isOpen_univ.prod hJ scale_mem := fun _ hp _ _ => ⟨mem_univ _, hp.2⟩ /-- Early strip, bundling `carrier`, `isOpen`, `scale_mem`. -/ -def earlyStrip (T : ℝ) (hT : 0 < T) (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where +@[expose] def earlyStrip (T : ℝ) (hT : 0 < T) (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where carrier := Iio T ×ˢ J isOpen := isOpen_Iio.prod hJ scale_mem := by @@ -69,12 +69,12 @@ theorem slopeCutoff_zero {δ t : ℝ} (hδ : 0 < δ) (ht : 2 * δ ≤ t) : slope ((le_div_iff₀ hδ).2 (by linarith)), sub_self] /-- Damped slope, defined pointwise by `slopeCutoff δ p.1 * radialPartial G p`. -/ -def dampedSlope (δ : ℝ) (G : Field) : Field := +@[expose] def dampedSlope (δ : ℝ) (G : Field) : Field := fun p => slopeCutoff δ p.1 * radialPartial G p /-- The prescribed continuation, defined by an actual integral of the same-time natural derivative. -/ -def continuation (δ : ℝ) (G : Field) : Field := +@[expose] def continuation (δ : ℝ) (G : Field) : Field := fun p => G (0, p.2) + primitive (dampedSlope δ G) p theorem dampedSlope_smooth {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < T) @@ -347,13 +347,13 @@ theorem continuation_parameter_jet_close {T : ℝ} (hT : 0 < T) {J : Set ℝ} (h /-- Parameter interval, given by `Ioo NaturalAxisCoefficients.window.left NaturalAxisCoefficients.window.right`. -/ -def parameterInterval : Set ℝ := +@[expose] def parameterInterval : Set ℝ := Ioo NaturalAxisCoefficients.window.left NaturalAxisCoefficients.window.right theorem parameterInterval_open : IsOpen parameterInterval := isOpen_Ioo /-- Ramp limit, given by `Real.log (41 / 40 : ℝ)`. -/ -def rampLimit : ℝ := Real.log (41 / 40 : ℝ) +@[expose] def rampLimit : ℝ := Real.log (41 / 40 : ℝ) theorem rampLimit_pos : 0 < rampLimit := Real.log_pos (by norm_num) @@ -383,7 +383,7 @@ structure Input where scale * p.1 ≤ 41 / 10 → 0 < f p /-- Of natural, bundling `scale`, `scale_pos`, `f`, `U` and the required compatibility proofs. -/ -def Input.ofNatural {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} +@[expose] def Input.ofNatural {h j σ Λ C : ℝ} {P0 : ℝ → ℝ} {d : NaturalAxisCoefficients.AnalyticInputs h j σ P0} (hΛ : 0 < Λ) (F : NaturalProfile.ProfileFamily d Λ C) : Input where scale := Λ @@ -399,7 +399,7 @@ namespace Input variable (N : Input) /-- Endpoint, given by `4 / N.scale`. -/ -def endpoint : ℝ := 4 / N.scale +@[expose] def endpoint : ℝ := 4 / N.scale theorem endpoint_pos : 0 < N.endpoint := div_pos (by norm_num) N.scale_pos @@ -408,11 +408,11 @@ theorem scale_endpoint : N.scale * N.endpoint = 4 := by field_simp [N.scale_pos.ne'] /-- From log, given by `(N.endpoint * Real.exp p.1, p.2)`. -/ -def fromLog (p : Point) : Point := (N.endpoint * Real.exp p.1, p.2) +@[expose] def fromLog (p : Point) : Point := (N.endpoint * Real.exp p.1, p.2) /-- Log time, given by `Real.log (X / N.endpoint)`. -/ -def logTime (X : ℝ) : ℝ := Real.log (X / N.endpoint) +@[expose] def logTime (X : ℝ) : ℝ := Real.log (X / N.endpoint) /-- Log F, defined pointwise by `Real.log (N.f (N.fromLog p))`. -/ -def logF : Field := fun p => Real.log (N.f (N.fromLog p)) +@[expose] def logF : Field := fun p => Real.log (N.f (N.fromLog p)) /-- Log U, defined pointwise by `N.U (N.fromLog p)`. -/ def logU : Field := fun p => N.U (N.fromLog p) @@ -481,7 +481,7 @@ theorem le_logTime_iff {X t : ℝ} (hX : 0 < X) : rw [mul_comm] /-- The radial domain of the extended profiles has no upper radial endpoint. -/ -def radialDomain : RadialDomain where +@[expose] def radialDomain : RadialDomain where carrier := {p | -20 < N.scale * p.1 ∧ p.2 ∈ parameterInterval} isOpen := (isOpen_lt continuous_const (continuous_const.mul continuous_fst)).inter (parameterInterval_open.preimage continuous_snd) @@ -504,12 +504,12 @@ theorem natural_mem_of_le_endpoint {p : Point} (hp : p ∈ N.radialDomain.carrie /-- Ref F, defined pointwise by `if p.1 ≤ N.endpoint then N.f p else Real.exp (continuation δ N.logF (N.logTime p.1, p.2))`. -/ -def refF (δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.f p else +@[expose] def refF (δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.f p else Real.exp (continuation δ N.logF (N.logTime p.1, p.2)) /-- Ref U, defined pointwise by `if p.1 ≤ N.endpoint then N.U p else continuation δ N.logU (N.logTime p.1, p.2)`. -/ -def refU (δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.U p else +@[expose] def refU (δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.U p else continuation δ N.logU (N.logTime p.1, p.2) theorem refF_eq_natural_initial (δ : ℝ) {p : Point} (hp : p.1 ≤ N.endpoint) : @@ -650,7 +650,7 @@ theorem refU_frozen {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) (p := (N.logTime p.1, p.2)) hη ((N.le_logTime_iff hp).2 hX)] /-- Actual pressure, moments, and lag variables are recomputed from REF. -/ -def histories {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) +@[expose] def histories {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) : ProfileHistories.Profiles N.radialDomain where f := N.refF δ U := N.refU δ @@ -867,7 +867,7 @@ theorem ref_field_error_jet_close {K : Set ℝ} (hK : IsCompact K) exact hb /-- Xbig, given by `100`. -/ -def Xbig : ℝ := 100 +@[expose] def Xbig : ℝ := 100 /-- Xi, given by `110`. -/ def Xi : ℝ := 110 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReleaseMoments.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReleaseMoments.lean index 2b4e88f62f..3c3a0c5b74 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ReleaseMoments.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ReleaseMoments.lean @@ -18,7 +18,7 @@ actual integral with each constructed lag solution. The terminal identity then gives the vanishing renormalized angular moment. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ open NavierStokes.AngularMomentReset NavierStokes.UniformAngularReset namespace NavierStokes.ReleaseMoments /-- Corrected weight, given by `Real.exp (3 * y / 2) * correctedAngular d c (y, eta)`. -/ -noncomputable def correctedWeight (d : TailData) (c : ℝ → Coeff) (eta y : ℝ) : ℝ := +@[expose] noncomputable def correctedWeight (d : TailData) (c : ℝ → Coeff) (eta y : ℝ) : ℝ := Real.exp (3 * y / 2) * correctedAngular d c (y, eta) /-- History, given by `(5 / 8) * d.core.P * shape eta + primitive (correctedWeight d c eta) y`. -/ @@ -39,7 +39,7 @@ noncomputable def history (d : TailData) (c : ℝ → Coeff) (eta y : ℝ) : ℝ (5 / 8) * d.core.P * shape eta + primitive (correctedWeight d c eta) y /-- Release weight, given by `Real.exp (3 * y / 2) * finalAngular d (y, 0)`. -/ -noncomputable def releaseWeight (d : TailData) (y : ℝ) : ℝ := +@[expose] noncomputable def releaseWeight (d : TailData) (y : ℝ) : ℝ := Real.exp (3 * y / 2) * finalAngular d (y, 0) theorem releaseWeight_contDiff (d : TailData) : ContDiff ℝ ∞ (releaseWeight d) := @@ -304,7 +304,7 @@ theorem history_eventual_power (eta : ℝ) {y : ℝ} (hy : tailEnd d ≤ y) : end ResetWitness /-- Normalized lag, given by `(1 - d.h) * history d c eta y / releaseWeight d y - 1`. -/ -noncomputable def normalizedLag (d : TailData) (c : ℝ → Coeff) (eta y : ℝ) : ℝ := +@[expose] noncomputable def normalizedLag (d : TailData) (c : ℝ → Coeff) (eta y : ℝ) : ℝ := (1 - d.h) * history d c eta y / releaseWeight d y - 1 namespace ResetWitness @@ -428,11 +428,11 @@ theorem renormalized_log_integral (eta : ℝ) : end ResetWitness /-- Radial H, given by `Real.sqrt (2 * X) * correctedAngular d c (Real.log X, eta)`. -/ -noncomputable def radialH (d : TailData) (c : ℝ → Coeff) (eta X : ℝ) : ℝ := +@[expose] noncomputable def radialH (d : TailData) (c : ℝ → Coeff) (eta X : ℝ) : ℝ := Real.sqrt (2 * X) * correctedAngular d c (Real.log X, eta) /-- Radial power H, given by `Real.sqrt (2 * X) * (powerConstant d * X ^ (-(1 / 2 + d.h)))`. -/ -noncomputable def radialPowerH (d : TailData) (X : ℝ) : ℝ := +@[expose] noncomputable def radialPowerH (d : TailData) (X : ℝ) : ℝ := Real.sqrt (2 * X) * (powerConstant d * X ^ (-(1 / 2 + d.h))) theorem exponential_radial_weight (y : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RenormalizedHeatMoment.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RenormalizedHeatMoment.lean index d9d0c65c64..ce26b4a312 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RenormalizedHeatMoment.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RenormalizedHeatMoment.lean @@ -19,7 +19,7 @@ It is subtracted before integration. Local constancy of the exterior heat carrier supplies compact support for every axial derivative of the difference. -/ -@[expose] public section +public section noncomputable section @@ -197,7 +197,7 @@ theorem axial_viscosity_moment_zero {u : ℝ × ℝ → ℝ} {reference tail : /-! ## The actual implicit physical coordinates -/ /-- A, given by `1 / 2 + h`. -/ -noncomputable def A (h : ℝ) : ℝ := 1 / 2 + h +@[expose] noncomputable def A (h : ℝ) : ℝ := 1 / 2 + h /-- Q, given by `SimilarityCoordinates.coordinateQ (2 * h) (τ, z)`. -/ noncomputable def Q (h τ z : ℝ) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) (τ, z) /-- Eta, given by `SimilarityCoordinates.coordinateEta (2 * h) (τ, z)`. -/ @@ -751,7 +751,7 @@ theorem xMoment_eq_outgoing_reference (P : OutgoingProfile.Profile) {XR : ℝ} ( ring /-- Heat threshold, given by `OutgoingDilation.switchRadius P XR * Real.exp 3`. -/ -noncomputable def heatThreshold (P : OutgoingProfile.Profile) (XR : ℝ) : ℝ := +@[expose] noncomputable def heatThreshold (P : OutgoingProfile.Profile) (XR : ℝ) : ℝ := OutgoingDilation.switchRadius P XR * Real.exp 3 theorem heatThreshold_pos (P : OutgoingProfile.Profile) {XR : ℝ} (hXR : 0 < XR) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RepairConeBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RepairConeBounds.lean index 2606c8862b..3af5add4d7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RepairConeBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RepairConeBounds.lean @@ -18,7 +18,7 @@ and the actual repair coefficients are the only perturbation parameters. All histories are recovered from the exact five-row match at the right end. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ReservedPatches.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ReservedPatches.lean index da0272ec09..4ae4bc4119 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ReservedPatches.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ReservedPatches.lean @@ -19,7 +19,7 @@ existing heat-compensation patch. The last two remain pure powers after that heat correction. All fields below use the same outgoing profile. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ inductive Slot where /-- Left offset as an element of `Slot → ℝ | .modulation => -25 | .heat => -20 | .positive => -14 | .mean => -8`. -/ -noncomputable def leftOffset : Slot → ℝ +@[expose] noncomputable def leftOffset : Slot → ℝ | .modulation => -25 | .heat => -20 | .positive => -14 @@ -48,7 +48,7 @@ noncomputable def leftOffset : Slot → ℝ /-- Right offset as an element of `Slot → ℝ | .modulation => -20 | .heat => -15 | .positive => -9 | .mean => -3`. -/ -noncomputable def rightOffset : Slot → ℝ +@[expose] noncomputable def rightOffset : Slot → ℝ | .modulation => -20 | .heat => -15 | .positive => -9 @@ -66,19 +66,19 @@ theorem offsets_separated {s t : Slot} (hst : s ≠ t) : cases s <;> cases t <;> simp_all [leftOffset, rightOffset] <;> norm_num /-- Left clock, given by `F.data.core.pulseStart + leftOffset s`. -/ -noncomputable def leftClock (F : Profile) (s : Slot) : ℝ := +@[expose] noncomputable def leftClock (F : Profile) (s : Slot) : ℝ := F.data.core.pulseStart + leftOffset s /-- Right clock, given by `F.data.core.pulseStart + rightOffset s`. -/ -noncomputable def rightClock (F : Profile) (s : Slot) : ℝ := +@[expose] noncomputable def rightClock (F : Profile) (s : Slot) : ℝ := F.data.core.pulseStart + rightOffset s /-- Left, given by `OutgoingDilation.radius XR (leftClock F s)`. -/ -noncomputable def left (F : Profile) (XR : ℝ) (s : Slot) : ℝ := +@[expose] noncomputable def left (F : Profile) (XR : ℝ) (s : Slot) : ℝ := OutgoingDilation.radius XR (leftClock F s) /-- Right, given by `OutgoingDilation.radius XR (rightClock F s)`. -/ -noncomputable def right (F : Profile) (XR : ℝ) (s : Slot) : ℝ := +@[expose] noncomputable def right (F : Profile) (XR : ℝ) (s : Slot) : ℝ := OutgoingDilation.radius XR (rightClock F s) /-- Window, given by `Ioo (left F XR s) (right F XR s)`. -/ @@ -448,7 +448,7 @@ theorem heat_increment_tsupport (F : Profile) (XR : ℝ) (hXR : 0 < XR) /-! ## Conversion to the similarity radius R, where X = R squared / 2 -/ /-- Radial left, given by `Real.sqrt (2 * left F XR s)`. -/ -noncomputable def radialLeft (F : Profile) (XR : ℝ) (s : Slot) : ℝ := +@[expose] noncomputable def radialLeft (F : Profile) (XR : ℝ) (s : Slot) : ℝ := Real.sqrt (2 * left F XR s) /-- Radial right, given by `Real.sqrt (2 * right F XR s)`. -/ @@ -552,7 +552,7 @@ theorem radial_closedPatches_disjoint (F : Profile) (XR : ℝ) (hXR : 0 < XR) (radial_closedPatch_subset F XR hXR s) (radial_closedPatch_subset F XR hXR t) /-- Radial amplitude, given by `xAmplitude F XR eta * (2 : ℝ) ^ (1 / 2 + F.data.core.lam)`. -/ -noncomputable def radialAmplitude (F : Profile) (XR eta : ℝ) : ℝ := +@[expose] noncomputable def radialAmplitude (F : Profile) (XR eta : ℝ) : ℝ := xAmplitude F XR eta * (2 : ℝ) ^ (1 / 2 + F.data.core.lam) theorem radialAmplitude_pos (F : Profile) (XR eta : ℝ) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualCalculus.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualCalculus.lean index aab0bbd3e5..95dcd3f4c9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualCalculus.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualCalculus.lean @@ -19,7 +19,7 @@ spatial derivatives on the time slice and a differentiable time slice at the point in question. No abstract differential operators are assumed linear. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualPolarGraph.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualPolarGraph.lean index 0a7c81b3a4..0797271170 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualPolarGraph.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualPolarGraph.lean @@ -18,7 +18,7 @@ point maps back to the original Cartesian point and to the exact common graph used by the physical mean estimates. -/ -@[expose] public section +public section noncomputable section @@ -30,12 +30,12 @@ open AxisymmetricResidual (pack pack_zero pack_one pack_two) open scoped Topology /-- The local angle of the scaled physical radial projection. -/ -noncomputable def angle (a : ℝ) (j : PolarCharts.Index) (n : ℕ) (w : SpaceTime) : ℝ := +@[expose] noncomputable def angle (a : ℝ) (j : PolarCharts.Index) (n : ℕ) (w : SpaceTime) : ℝ := (PolarCharts.chart a j (PhysicalGraphBounds.scaledRadial n w)).2 /-- The actual unscaled cylindrical point associated with a local polar chart. Its spatial coordinates are physical radius, angle, and axial position. -/ -noncomputable def cylindricalPoint (a : ℝ) (j : PolarCharts.Index) (n : ℕ) +@[expose] noncomputable def cylindricalPoint (a : ℝ) (j : PolarCharts.Index) (n : ℕ) (w : SpaceTime) : SpaceTime := (w.1, pack (PolarCharts.radius (PhysicalGraphBounds.radialProjection w)) (angle a j n w) (w.2 2)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualRegularity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualRegularity.lean index a58bf6703a..62b841250f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualRegularity.lean @@ -17,7 +17,7 @@ The main regularity theorem is on an open spacetime domain; it does not differentiate an unspecified extension through a time boundary. -/ -@[expose] public section +public section namespace NavierStokes.ResidualRegularity diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualStability.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualStability.lean index f8c4d608d4..d96b579636 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualStability.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ResidualStability.lean @@ -35,7 +35,7 @@ All powers here have natural exponents. Constants and neighborhoods may depend on the requested power, as they do in a flatness statement. -/ -@[expose] public section +public section open Filter Topology @@ -45,7 +45,7 @@ variable {α : Type*} {l : Filter α} {q f g : α → ℝ} /-- Along `l`, `f` is eventually bounded by a constant times every natural power of the absolute value of the scale `q`. -/ -def PowerFlat (l : Filter α) (q f : α → ℝ) : Prop := +@[expose] def PowerFlat (l : Filter α) (q f : α → ℝ) : Prop := ∀ n : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ x in l, |f x| ≤ C * |q x| ^ n /-- An exact scalar estimate: `n + loss` powers of smallness absorb `loss` @@ -158,7 +158,7 @@ end end -@[expose] public section +public section noncomputable section @@ -211,7 +211,7 @@ variable {D E F G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] /-- Every actual derivative decays faster than each fixed natural power. -/ -def AllJetsFlat (l : Filter D) (q : D → ℝ) (f : D → E) : Prop := +@[expose] def AllJetsFlat (l : Filter D) (q : D → ℝ) (f : D → E) : Prop := ∀ m : ℕ, Flatness.PowerFlat l q (fun x => ‖iteratedFDeriv ℝ m f x‖) /-- Each actual derivative has a fixed inverse-power bound. The power and @@ -520,7 +520,7 @@ theorem residual_add_sub_on {u w : VelocityField} {p r : PressureField} abel /-- The difference of the two actual viscosity-one Navier--Stokes residuals. -/ -def residualDifference (u w : VelocityField) (p r : PressureField) : VelocityField := +@[expose] def residualDifference (u w : VelocityField) (p r : PressureField) : VelocityField := fun z => navierStokesResidual (fun y => u y + w y) (fun y => p y + r y) z.1 z.2 - navierStokesResidual u p z.1 z.2 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledActualParticularControl.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledActualParticularControl.lean index 8752df396c..6f5fdfabba 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledActualParticularControl.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledActualParticularControl.lean @@ -30,7 +30,7 @@ geometric separation identifies its grouped Gaussian at every integration time. All finite-jet constants precede the external label and lattice copy. -/ -@[expose] public section +public section noncomputable section @@ -1160,7 +1160,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1197,6 +1197,7 @@ theorem interval_open (F : PhaseConstruction D) (clock : ActualSignedControl.Pos (F.openV i).preimage (continuous_const.mul continuous_id) /-- Length, given by `F.L (l,n)/clock.value l n`. -/ +@[expose] noncomputable def length (F : PhaseConstruction D) (clock : ActualSignedControl.PositiveScale Label) (l : Label) (n : ℕ) : ℝ := F.L (l,n)/clock.value l n diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledTangentTransport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledTangentTransport.lean index 925019852e..2bdd9d6f8b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledTangentTransport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ScaledTangentTransport.lean @@ -18,7 +18,7 @@ transported together. Velocity and pressure below are outputs of the actual copy-path Volterra inverse, with no output compatibility hypothesis. -/ -@[expose] public section +public section noncomputable section @@ -100,7 +100,7 @@ variable {P Q H : Type} [NormedAddCommGroup H] [InnerProductSpace ℝ H] /-- The velocity scale is `amplitude`. The actual source scale is `rate * amplitude`, and the moving normal acquires both normal and clock scales in its slot derivative. -/ -noncomputable def transportTangent (t : TangentData P H) (parameter : Q → P) +@[expose] noncomputable def transportTangent (t : TangentData P H) (parameter : Q → P) (gap : ℕ) (shift rate amplitude normalScale : ℝ) : TangentData Q H where normal z := normalScale • t.normal (parameter z.1, CopySolveCompatibility.nativeTimeMap shift rate z.2) @@ -112,7 +112,7 @@ noncomputable def transportTangent (t : TangentData P H) (parameter : Q → P) /-- The ambient complex source undergoes the same rate and velocity scalings as the real tangent source. -/ -noncomputable def transportSource (f : P × Plane → ComplexVector) (parameter : Q → P) +@[expose] noncomputable def transportSource (f : P × Plane → ComplexVector) (parameter : Q → P) (gap : ℕ) (rate amplitude : ℝ) : Q × Plane → ComplexVector := fun z => (rate * amplitude) • f (parameter z.1, coverPower gap z.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/Scaling.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/Scaling.lean index 467428633f..4d81832f43 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/Scaling.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/Scaling.lean @@ -17,7 +17,7 @@ scaling facts; they do not supply a Navier--Stokes solution or analytic estimate for its profiles. The arbitrary envelope is kept in the carrier Reynolds product. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,7 @@ namespace NavierStokes.Scaling def coreVelocity (q h : ℝ) : ℝ := q ^ (-(1 / 2 + h)) /-- The radial length scale. -/ -def radialLength (q : ℝ) : ℝ := q ^ (1 / 2 : ℝ) +@[expose] def radialLength (q : ℝ) : ℝ := q ^ (1 / 2 : ℝ) /-- The axial length scale. -/ def axialLength (q h : ℝ) : ℝ := q ^ (1 / 2 - h) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SchedulePressure.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SchedulePressure.lean index 61a05d2b45..309534c524 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SchedulePressure.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SchedulePressure.lean @@ -18,7 +18,7 @@ This module instantiates the abstract pressure integral with `finalAngular`. The pressure-neutral angular-moment correction remains a separate operation. -/ -@[expose] public section +public section noncomputable section @@ -30,14 +30,14 @@ open OutgoingSchedule OutgoingTail open scoped Topology ContDiff /-- Squared clock amplitude, taken from the actual angular schedule at `η=0`. -/ -noncomputable def clockWeight (d : TailData) (y : ℝ) : ℝ := finalAngular d (y, 0) ^ 2 +@[expose] noncomputable def clockWeight (d : TailData) (y : ℝ) : ℝ := finalAngular d (y, 0) ^ 2 /-- The shape exponent decreases from one to zero during flattening. -/ noncomputable def shapeExponent (d : TailData) (y : ℝ) : ℝ := 1 - sigma ((y - d.core.endpoint) / flattenLength) /-- The datum computed directly from the complete constructed angular field. -/ -noncomputable def axisPressure (d : TailData) (η : ℝ) : ℝ := +@[expose] noncomputable def axisPressure (d : TailData) (η : ℝ) : ℝ := -(1 / 2 : ℝ) * ∫ y, finalAngular d (y, η) ^ 2 theorem endpoint_pos (d : TailData) : 0 < d.core.endpoint := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ShapeTransition.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ShapeTransition.lean index 0be91f72c5..90ff587b34 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ShapeTransition.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ShapeTransition.lean @@ -19,7 +19,7 @@ Input field bounds are pointwise bounds, not assumptions on the five row debts. All constants in the estimates may be chosen before the final large `C`. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open scoped Topology ContDiff BigOperators namespace NavierStokes.ShapeTransition /-- Log shape, given by `Real.log (OutgoingSchedule.shape eta)`. -/ -noncomputable def logShape (eta : ℝ) : ℝ := Real.log (OutgoingSchedule.shape eta) +@[expose] noncomputable def logShape (eta : ℝ) : ℝ := Real.log (OutgoingSchedule.shape eta) theorem logShape_contDiff : ContDiff ℝ ∞ logShape := OutgoingSchedule.shape_contDiff.log (fun eta => (OutgoingSchedule.shape_pos eta).ne') @@ -40,12 +40,12 @@ theorem exp_logShape (eta : ℝ) : Real.exp (logShape eta) = OutgoingSchedule.sh /-- Blend, given by `(1 - OutgoingSchedule.sigma (p.1 / T)) * li p.2 + OutgoingSchedule.sigma (p.1 / T) * logShape p.2`. -/ -noncomputable def blend (T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def blend (T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := (1 - OutgoingSchedule.sigma (p.1 / T)) * li p.2 + OutgoingSchedule.sigma (p.1 / T) * logShape p.2 /-- Log profile, given by `-Real.log C + p.1 / 10 + blend T li p`. -/ -noncomputable def logProfile (C T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def logProfile (C T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := -Real.log C + p.1 / 10 + blend T li p /-- Amplitude, given by `Real.exp (p.1 / 10 + blend T li p)`. -/ @@ -53,7 +53,7 @@ noncomputable def amplitude (T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ Real.exp (p.1 / 10 + blend T li p) /-- Angular, given by `Real.exp (logProfile C T li p)`. -/ -noncomputable def angular (C T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def angular (C T : ℝ) (li : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := Real.exp (logProfile C T li p) /-- Axial, given by `Gi p.2`. -/ @@ -342,16 +342,16 @@ theorem angular_jet_bound {C T y B : ℝ} (hC : 0 < C) /-! ## The reset clock and exact ideal matching -/ /-- Reset radius, given by `Xi * (C * P) ^ 10`. -/ -noncomputable def resetRadius (Xi C P : ℝ) : ℝ := Xi * (C * P) ^ 10 +@[expose] noncomputable def resetRadius (Xi C P : ℝ) : ℝ := Xi * (C * P) ^ 10 /-- Separation, given by `Real.exp T / (C * P) ^ 10`. -/ noncomputable def separation (T C P : ℝ) : ℝ := Real.exp T / (C * P) ^ 10 /-- Reset clock, given by `y - 10 * Real.log (C * P)`. -/ -noncomputable def resetClock (C P y : ℝ) : ℝ := y - 10 * Real.log (C * P) +@[expose] noncomputable def resetClock (C P y : ℝ) : ℝ := y - 10 * Real.log (C * P) /-- Ideal angular, given by `P * OutgoingSchedule.shape p.2 * Real.exp (p.1 / 10)`. -/ -noncomputable def idealAngular (P : ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def idealAngular (P : ℝ) (p : ℝ × ℝ) : ℝ := P * OutgoingSchedule.shape p.2 * Real.exp (p.1 / 10) theorem idealAngular_contDiff (P : ℝ) : ContDiff ℝ ∞ (idealAngular P) := @@ -392,7 +392,7 @@ theorem separation_eventually_before (T : ℝ) {P : ℝ} (hP : 0 < P) (clock : /-- Restore, given by `(1 - OutgoingSchedule.sigma (p.1 + 8)) * Gi p.2 + OutgoingSchedule.sigma (p.1 + 8) * (4 * p.2)`. -/ -noncomputable def restore (Gi : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def restore (Gi : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := (1 - OutgoingSchedule.sigma (p.1 + 8)) * Gi p.2 + OutgoingSchedule.sigma (p.1 + 8) * (4 * p.2) @@ -488,7 +488,7 @@ theorem radialSwitch_contDiff {Xi T : ℝ} (hXi : 0 < Xi) (hT : 0 < T) : /-- The supplied old normalized field is continued by its held power law past `Xi`. Multiplication by this explicit smooth factor performs the transition. -/ -noncomputable def shapeField (Xi T : ℝ) (li : ℝ → ℝ) (old : ℝ × ℝ → ℝ) +@[expose] noncomputable def shapeField (Xi T : ℝ) (li : ℝ → ℝ) (old : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := old p * Real.exp (radialSwitch Xi T p.1 * (logShape p.2 - li p.2)) @@ -639,27 +639,27 @@ theorem product_jet_bound {f g : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) (hg : Co /-! ## The five actual scaled history rows -/ /-- Scaled E, given by `Real.sqrt (2 * R * p.1) * f p`. -/ -noncomputable def scaledE (R : ℝ) (f : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def scaledE (R : ℝ) (f : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := Real.sqrt (2 * R * p.1) * f p /-- Row M, given by `∫ x in (0 : ℝ)..r, u (x, eta)`. -/ -noncomputable def rowM (u : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def rowM (u : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := ∫ x in (0 : ℝ)..r, u (x, eta) /-- Row I, given by `∫ x in (0 : ℝ)..r, Real.sqrt (2 * x) * scaledE R f (x, eta)`. -/ -noncomputable def rowI (R : ℝ) (f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def rowI (R : ℝ) (f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := ∫ x in (0 : ℝ)..r, Real.sqrt (2 * x) * scaledE R f (x, eta) /-- Row J, given by `∫ x in (0 : ℝ)..r, u (x, eta) * Real.sqrt (2 * x) * scaledE R f (x, eta)`. -/ -noncomputable def rowJ (R : ℝ) (u f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def rowJ (R : ℝ) (u f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := ∫ x in (0 : ℝ)..r, u (x, eta) * Real.sqrt (2 * x) * scaledE R f (x, eta) /-- Row S, given by `∫ x in (0 : ℝ)..r, u (x, eta) ^ 2 - scaledE R f (x, eta) ^ 2 / 2`. -/ -noncomputable def rowS (R : ℝ) (u f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def rowS (R : ℝ) (u f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := ∫ x in (0 : ℝ)..r, u (x, eta) ^ 2 - scaledE R f (x, eta) ^ 2 / 2 /-- Row P, given by `∫ x in (0 : ℝ)..r, scaledE R f (x, eta) ^ 2 / (2 * x)`. -/ -noncomputable def rowP (R : ℝ) (f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def rowP (R : ℝ) (f : ℝ × ℝ → ℝ) (r eta : ℝ) : ℝ := ∫ x in (0 : ℝ)..r, scaledE R f (x, eta) ^ 2 / (2 * x) theorem sqrt_scaled_product {R x : ℝ} (hR : 0 ≤ R) (hx : 0 ≤ x) : @@ -1135,17 +1135,17 @@ theorem integral_jet_bound_on {a b B : ℝ} (hab : a ≤ b) {F : ℝ × ℝ → (fun x hx => hB x ((uIoc_of_le hab) ▸ hx)) /-- Restore defect, given by `restore Gi (Real.log p.1, p.2) - 4 * p.2`. -/ -noncomputable def restoreDefect (Gi : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def restoreDefect (Gi : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := restore Gi (Real.log p.1, p.2) - 4 * p.2 /-- Restore density J, given by `(Real.sqrt (2 * p.1) * p.1 ^ (1 / 10 : ℝ)) * (restoreDefect Gi p * A p.2)`. -/ -noncomputable def restoreDensityJ (Gi A : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def restoreDensityJ (Gi A : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := (Real.sqrt (2 * p.1) * p.1 ^ (1 / 10 : ℝ)) * (restoreDefect Gi p * A p.2) /-- Restore density S, given by `restoreDefect Gi p * (restore Gi (Real.log p.1, p.2) + 4 * p.2)`. -/ -noncomputable def restoreDensityS (Gi : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def restoreDensityS (Gi : ℝ → ℝ) (p : ℝ × ℝ) : ℝ := restoreDefect Gi p * (restore Gi (Real.log p.1, p.2) + 4 * p.2) theorem restoreDensityJ_eq (Gi A : ℝ → ℝ) (p : ℝ × ℝ) : @@ -1177,15 +1177,15 @@ theorem restore_local_smooth {Gi A : ℝ → ℝ} (hGi : ContDiff ℝ ∞ Gi) (h contDiffAt_snd)) /-- Restore debt M, given by `∫ x in a..b, restoreDefect Gi (x, eta)`. -/ -noncomputable def restoreDebtM (Gi : ℝ → ℝ) (a b eta : ℝ) : ℝ := +@[expose] noncomputable def restoreDebtM (Gi : ℝ → ℝ) (a b eta : ℝ) : ℝ := ∫ x in a..b, restoreDefect Gi (x, eta) /-- Restore debt J, given by `∫ x in a..b, restoreDensityJ Gi A (x, eta)`. -/ -noncomputable def restoreDebtJ (Gi A : ℝ → ℝ) (a b eta : ℝ) : ℝ := +@[expose] noncomputable def restoreDebtJ (Gi A : ℝ → ℝ) (a b eta : ℝ) : ℝ := ∫ x in a..b, restoreDensityJ Gi A (x, eta) /-- Restore debt S, given by `∫ x in a..b, restoreDensityS Gi (x, eta)`. -/ -noncomputable def restoreDebtS (Gi : ℝ → ℝ) (a b eta : ℝ) : ℝ := +@[expose] noncomputable def restoreDebtS (Gi : ℝ → ℝ) (a b eta : ℝ) : ℝ := ∫ x in a..b, restoreDensityS Gi (x, eta) /-- Restore jet size as an element of `ℝ`. -/ @@ -1322,29 +1322,29 @@ theorem abs_jet_sub_le {F G : ℝ → ℝ} (hF : ContDiff ℝ ∞ F) (hG : ContD /-- Reset debt M, given by `rowM u r eta - idealM (fun e => 4 * e) r eta + restoreDebtM Gi r b eta`. -/ -noncomputable def resetDebtM (u : ℝ × ℝ → ℝ) (Gi : ℝ → ℝ) (r b eta : ℝ) : ℝ := +@[expose] noncomputable def resetDebtM (u : ℝ × ℝ → ℝ) (Gi : ℝ → ℝ) (r b eta : ℝ) : ℝ := rowM u r eta - idealM (fun e => 4 * e) r eta + restoreDebtM Gi r b eta /-- Reset debt I, given by `rowI R f r eta - idealI A r eta`. -/ -noncomputable def resetDebtI (R : ℝ) (f : ℝ × ℝ → ℝ) (A : ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def resetDebtI (R : ℝ) (f : ℝ × ℝ → ℝ) (A : ℝ → ℝ) (r eta : ℝ) : ℝ := rowI R f r eta - idealI A r eta /-- Reset debt J, given by `rowJ R u f r eta - idealJ (fun e => 4 * e) A r eta + restoreDebtJ Gi A r b eta`. -/ -noncomputable def resetDebtJ (R : ℝ) (u f : ℝ × ℝ → ℝ) (Gi A : ℝ → ℝ) (r b eta : ℝ) : ℝ := +@[expose] noncomputable def resetDebtJ (R : ℝ) (u f : ℝ × ℝ → ℝ) (Gi A : ℝ → ℝ) (r b eta : ℝ) : ℝ := rowJ R u f r eta - idealJ (fun e => 4 * e) A r eta + restoreDebtJ Gi A r b eta /-- Reset debt S, given by `rowS R u f r eta - idealS (fun e => 4 * e) A r eta + restoreDebtS Gi r b eta`. -/ -noncomputable def resetDebtS (R : ℝ) (u f : ℝ × ℝ → ℝ) (Gi A : ℝ → ℝ) (r b eta : ℝ) : ℝ := +@[expose] noncomputable def resetDebtS (R : ℝ) (u f : ℝ × ℝ → ℝ) (Gi A : ℝ → ℝ) (r b eta : ℝ) : ℝ := rowS R u f r eta - idealS (fun e => 4 * e) A r eta + restoreDebtS Gi r b eta /-- Reset debt P, given by `rowP R f r eta - idealP A r eta`. -/ -noncomputable def resetDebtP (R : ℝ) (f : ℝ × ℝ → ℝ) (A : ℝ → ℝ) (r eta : ℝ) : ℝ := +@[expose] noncomputable def resetDebtP (R : ℝ) (f : ℝ × ℝ → ℝ) (A : ℝ → ℝ) (r eta : ℝ) : ℝ := rowP R f r eta - idealP A r eta /-- Reset debt jet size as an element of `ℝ`. -/ -noncomputable def resetDebtJetSize (n : ℕ) (R r b : ℝ) (u f : ℝ × ℝ → ℝ) +@[expose] noncomputable def resetDebtJetSize (n : ℕ) (R r b : ℝ) (u f : ℝ × ℝ → ℝ) (Gi A : ℝ → ℝ) (eta : ℝ) : ℝ := |iteratedDeriv n (resetDebtM u Gi r b) eta| + |iteratedDeriv n (resetDebtI R f A r) eta| + @@ -1388,7 +1388,7 @@ noncomputable def vanishingDebtBound (n : ℕ) (B K L BG KA r C : ℝ) : ℝ := (2 ^ n * L * K ^ 2) / C ^ 2 + (5 / 2) * (2 ^ n * KA ^ 2) * r ^ (1 / 5 : ℝ) /-- Restoration bound, given by `delta * (1 + 2 * (2 ^ n * KA) + 2 ^ n * (delta + 2 * BG))`. -/ -noncomputable def restorationBound (n : ℕ) (BG KA delta : ℝ) : ℝ := +@[expose] noncomputable def restorationBound (n : ℕ) (BG KA delta : ℝ) : ℝ := delta * (1 + 2 * (2 ^ n * KA) + 2 ^ n * (delta + 2 * BG)) theorem resetDebtJetSize_bound {R r b L B K C BG KA delta : ℝ} @@ -1470,7 +1470,7 @@ theorem shapeField_jets_uniform {Xi C T X B K : ℝ} (hXi : 0 < Xi) (hC : 0 < C) (mul_nonneg (Nat.cast_nonneg _) (Real.exp_pos _).le) /-- Scaled family, given by `F (R * p.1, p.2)`. -/ -noncomputable def scaledFamily (R : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := F (R * p.1, p.2) +@[expose] noncomputable def scaledFamily (R : ℝ) (F : ℝ × ℝ → ℝ) (p : ℝ × ℝ) : ℝ := F (R * p.1, p.2) theorem scaledFamily_contDiff (R : ℝ) {F : ℝ × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (scaledFamily R F) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ShapedWaitBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ShapedWaitBounds.lean index 6977ba4a5f..5ab950a61e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ShapedWaitBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ShapedWaitBounds.lean @@ -16,7 +16,7 @@ The two decaying modes are kept separate, so no inverse small-slope constant appears in the error estimate. -/ -@[expose] public section +public section noncomputable section @@ -283,7 +283,7 @@ theorem canonical_Qs_pulseStart_error {v : TailData} {K : ℝ} exact angularLag_hold_error v hh1 hη (by linarith [v.core.wait_gt]) /-- Wait for power, given by `-(n : ℝ) * Real.log c.lam / (1 - c.lam)`. -/ -noncomputable def waitForPower (c : Parameters) (n : ℕ) : ℝ := +@[expose] noncomputable def waitForPower (c : Parameters) (n : ℕ) : ℝ := -(n : ℝ) * Real.log c.lam / (1 - c.lam) theorem decay_le_power (c : Parameters) (n : ℕ) (ht : waitForPower c n ≤ c.wait) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCopyBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCopyBounds.lean index f0a074dd27..9f4cfb55ad 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCopyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCopyBounds.lean @@ -19,7 +19,7 @@ The matrix inverse, signed square-root quotient and projected pressure are computed from the primitive input functions. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCovariance.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCovariance.lean index 2e208fb5e2..13789e3d56 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCovariance.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCovariance.lean @@ -20,7 +20,7 @@ separated by the constructed padded slots. A signed square is retained as a separate term; it is not included in the linear covariance identity. -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ abbrev Mat2 := Matrix (Fin 2) (Fin 2) ℝ abbrev Plane := TorusInverse.Plane /-- The numerator is the actual inverse-matrix solve. -/ -noncomputable def increment (H : Mat2) (T R : Vec2) (j : Fin 2) : ℝ := +@[expose] noncomputable def increment (H : Mat2) (T R : Vec2) (j : Fin 2) : ℝ := (H⁻¹.mulVec R) j / (2 * SmoothCovariance.amplitudes H T j) theorem increment_eq_inverse (H : Mat2) (T R : Vec2) @@ -150,14 +150,14 @@ theorem PairData.bilinear_diagonal {D h : ℝ} {vr vt : Plane} {sys : SlotSystem /-- Radial with, given by `wave (outer * (Real.sqrt ε * a j * mask D U q x)) (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j)`. -/ -noncomputable def radialWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} +@[expose] noncomputable def radialWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (a : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) : Plane → ℝ → ℝ := wave (outer * (Real.sqrt ε * a j * mask D U q x)) (SlotColoring.nativeIndex h U.1) (P.rawRadial hdet j) (P.modes j) (P.phases j) /-- Tangent with, constructed using `wave`. -/ -noncomputable def tangentWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} +@[expose] noncomputable def tangentWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (a : Vec2) (q : ℝ) (x : SlotColoring.Position) (j i : Fin 2) : Plane → ℝ → ℝ := wave (outer * (Real.sqrt ε * a j * mask D U q x)) @@ -236,6 +236,7 @@ theorem finite_bilinear_covariance {D h : ℝ} {vr vt : Plane} (sys : SlotSystem /-- Assembled radial with, given by `∑ᶠ v : UnsignedLabel × Fin 2, radialWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 Y θ`. -/ +@[expose] noncomputable def assembledRadialWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) @@ -244,6 +245,7 @@ noncomputable def assembledRadialWith {D h : ℝ} {vr vt : Plane} {sys : SlotSys /-- Assembled tangent with, given by `∑ᶠ v : UnsignedLabel × Fin 2, tangentWith (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2 i Y θ`. -/ +@[expose] noncomputable def assembledTangentWith {D h : ℝ} {vr vt : Plane} {sys : SlotSystem D h vr vt} {N : ℕ} (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) @@ -549,7 +551,7 @@ theorem class_input_envelope {s : StripData E} {w g r : ℕ → E → ℝ} /-- Signed jet cost, given by `WeightedQuotients.chooseSum j * WeightedQuotients.orderBound (-(1 / 2 : ℝ)) j / 2`. -/ -noncomputable def signedJetCost (j : ℕ) : ℝ := +@[expose] noncomputable def signedJetCost (j : ℕ) : ℝ := WeightedQuotients.chooseSum j * WeightedQuotients.orderBound (-(1 / 2 : ℝ)) j / 2 /-- Prefix jet cost, given by `1 + ∑ j ∈ Finset.range (m + 1), |signedJetCost j|`. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCrossDefectClass.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCrossDefectClass.lean index e3f6c88e34..19ce3b8b37 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCrossDefectClass.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedCrossDefectClass.lean @@ -17,7 +17,7 @@ The requested moving stress preserves the residual class. Their difference is retained on every band; only the supplied tail identity makes it vanish. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedMeanGain.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedMeanGain.lean index d6d76fe459..0fd702b5b5 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedMeanGain.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedMeanGain.lean @@ -19,7 +19,7 @@ bumps are controlled by actual moment identities; the complete covariance remainder retains the signed square and the curl terms. -/ -@[expose] public section +public section noncomputable section @@ -166,7 +166,7 @@ theorem updated_zeroTriple (m : Triple D) : updated m zeroTriple = m := by /-- Covariance increment, given by `bilinearCovariance (u + w) (u + w) - bilinearCovariance u u`. -/ -noncomputable def covarianceIncrement (u w : Oscillation D) : Tensor D := +@[expose] noncomputable def covarianceIncrement (u w : Oscillation D) : Tensor D := bilinearCovariance (u + w) (u + w) - bilinearCovariance u u omit [NormedAddCommGroup D] [NormedSpace ℝ D] in @@ -437,15 +437,19 @@ structure Assembly (f : SignedFamily s P α δ β η) where (fun l => (f.curl l).oscillation) /-- Primary field, given by `fieldSum a.labels (fun l => (f.primary l).oscillation)`. -/ +@[expose] noncomputable def primaryField (f : SignedFamily s P α δ β η) (a : Assembly f) : Oscillation D := fieldSum a.labels (fun l => (f.primary l).oscillation) /-- Old field, given by `fieldSum a.labels (fun l => (f.old l).oscillation)`. -/ +@[expose] noncomputable def oldField (f : SignedFamily s P α δ β η) (a : Assembly f) : Oscillation D := fieldSum a.labels (fun l => (f.old l).oscillation) /-- Tangent field, given by `fieldSum a.labels (fun l => (f.tangent l).oscillation)`. -/ +@[expose] noncomputable def tangentField (f : SignedFamily s P α δ β η) (a : Assembly f) : Oscillation D := fieldSum a.labels (fun l => (f.tangent l).oscillation) /-- Curl field, given by `fieldSum a.labels (fun l => (f.curl l).oscillation)`. -/ +@[expose] noncomputable def curlField (f : SignedFamily s P α δ β η) (a : Assembly f) : Oscillation D := fieldSum a.labels (fun l => (f.curl l).oscillation) /-- Remainder tensor, given by `signedRemainder (primaryField f a) (oldField f a) (tangentField @@ -453,10 +457,12 @@ f a) (curlField f a)`. -/ noncomputable def remainderTensor (f : SignedFamily s P α δ β η) (a : Assembly f) : Tensor D := signedRemainder (primaryField f a) (oldField f a) (tangentField f a) (curlField f a) /-- Cross tensor, given by `symmetricCovariance (primaryField f a) (tangentField f a)`. -/ +@[expose] noncomputable def crossTensor (f : SignedFamily s P α δ β η) (a : Assembly f) : Tensor D := symmetricCovariance (primaryField f a) (tangentField f a) /-- Increment tensor, given by `covarianceIncrement (oldField f a) (tangentField f a + curlField f a)`. -/ +@[expose] noncomputable def incrementTensor (f : SignedFamily s P α δ β η) (a : Assembly f) : Tensor D := covarianceIncrement (oldField f a) (tangentField f a + curlField f a) @@ -618,13 +624,13 @@ structure Geometry where namespace Geometry /-- Strip, constructed using `LocalSignedRequest.movingStripData`. -/ -noncomputable def strip (G : Geometry) : StripData Point := +@[expose] noncomputable def strip (G : Geometry) : StripData Point := LocalSignedRequest.movingStripData G.region G.patch.a G.patch.b G.leftWeight G.rightWeight G.patch.a_pos G.left_pos G.right_pos G.epsilon G.slow G.epsilon_pos G.epsilon_le_one G.slow_ge_one /-- Slow strip, constructed using `PhysicalMeanDomain.localSlowStripData`. -/ -noncomputable def slowStrip (G : Geometry) : StripData Plane := +@[expose] noncomputable def slowStrip (G : Geometry) : StripData Plane := PhysicalMeanDomain.localSlowStripData G.region.carrier G.region.isOpen G.epsilon G.slow G.epsilon_pos G.epsilon_le_one G.slow_ge_one diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedStressPrimitive.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedStressPrimitive.lean index 1f9c833dbb..c09b567af6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedStressPrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedStressPrimitive.lean @@ -21,7 +21,7 @@ Subtracting its exact weighted moment makes the negative radial primitive compact. The physical construction is normalized by the physical scale. -/ -@[expose] public section +public section noncomputable section @@ -181,7 +181,7 @@ section Primitive variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Weighted source, given by `z.1 ^ e * F z`. -/ -noncomputable def weightedSource (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := z.1 ^ e * F z +@[expose] noncomputable def weightedSource (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := z.1 ^ e * F z /-- Mass, given by `IntegratedMeanBalances.radialMoment e F`. -/ noncomputable def mass (e : ℕ) (F : ℝ × E → ℝ) : E → ℝ := IntegratedMeanBalances.radialMoment e F /-- Bump correction, given by `momentDensity P e z.1 * mass e F z.2`. -/ @@ -192,10 +192,10 @@ noncomputable def adjusted (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ F z - bumpCorrection P e F z /-- Primitive, given by `TransportPrimitive.compactIntegral (cutoff P) 0 0 (weightedSource e F)`. -/ -noncomputable def primitive (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) : ℝ × E → ℝ := +@[expose] noncomputable def primitive (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) : ℝ × E → ℝ := TransportPrimitive.compactIntegral (cutoff P) 0 0 (weightedSource e F) /-- Sigma, given by `-inversePower P e z.1 * primitive P e F z`. -/ -noncomputable def sigma (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := +@[expose] noncomputable def sigma (P : Patch) (e : ℕ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := -inversePower P e z.1 * primitive P e F z theorem weightedSource_contDiff (e : ℕ) {F : ℝ × E → ℝ} (hF : ContDiff ℝ ∞ F) : @@ -578,6 +578,7 @@ theorem bump_improvedClass_of_moment_identity (P : Patch) (e : ℕ) {cL cR : ℝ rwa [heq] at hh /-- Bar sigma, given by `sigma P e (PressureStream.torusAverage F)`. -/ +@[expose] noncomputable def barSigma (P : Patch) (e : ℕ) (F : PressureStream.Lift E → ℝ) : ℝ × E → ℝ := sigma P e (PressureStream.torusAverage F) @@ -637,23 +638,26 @@ section Physical variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The physical radial length is sqrt q, as in the chart R = r / sqrt Q. -/ -noncomputable def lengthScale (q : E → ℝ) (p : E) : ℝ := Real.sqrt (q p) +@[expose] noncomputable def lengthScale (q : E → ℝ) (p : E) : ℝ := Real.sqrt (q p) /-- Native source, given by `F (lengthScale q z.2 * z.1, z.2)`. -/ -noncomputable def nativeSource (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := +@[expose] noncomputable def nativeSource (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := F (lengthScale q z.2 * z.1, z.2) /-- Physical density, given by `momentDensity P e (z.1 / lengthScale q z.2) / lengthScale q z.2 ^ (e + 1)`. -/ -noncomputable def physicalDensity (P : Patch) (e : ℕ) (q : E → ℝ) (z : ℝ × E) : ℝ := +@[expose] noncomputable def physicalDensity (P : Patch) (e : ℕ) (q : E → ℝ) (z : ℝ × E) : ℝ := momentDensity P e (z.1 / lengthScale q z.2) / lengthScale q z.2 ^ (e + 1) /-- Physical bump, given by `physicalDensity P e q z * mass e F z.2`. -/ +@[expose] noncomputable def physicalBump (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := physicalDensity P e q z * mass e F z.2 /-- Physical adjusted, given by `F z - physicalBump P e q F z`. -/ +@[expose] noncomputable def physicalAdjusted (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := F z - physicalBump P e q F z /-- Physical sigma, given by `lengthScale q z.2 * sigma P e (nativeSource q F) (z.1 / lengthScale q z.2, z.2)`. -/ +@[expose] noncomputable def physicalSigma (P : Patch) (e : ℕ) (q : E → ℝ) (F : ℝ × E → ℝ) (z : ℝ × E) : ℝ := lengthScale q z.2 * sigma P e (nativeSource q F) (z.1 / lengthScale q z.2, z.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedWaveUpdate.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedWaveUpdate.lean index a6e3a18638..92f59957f9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SignedWaveUpdate.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SignedWaveUpdate.lean @@ -31,7 +31,7 @@ Gaussian errors retain the original carrier and its conjugate, while actual mean aliases occupy the zero mode. No full-residual identity is assumed. -/ -@[expose] public section +public section noncomputable section @@ -129,7 +129,7 @@ theorem pairedBlock_evaluation {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ /-- Zero block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ -noncomputable def zeroBlock {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) +@[expose] noncomputable def zeroBlock {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (a : MeanVector D) : HarmonicBlock D where velocity n i := constantCoefficient (fun x => (a n x i : ℂ)) pressure _ := 0 @@ -203,7 +203,7 @@ theorem slot_cutoff_angleIndependent {s : WeightedClasses.StripData (D × ℝ)} exact congrArg GaussianTailFlat.profile (slot_coordinate_angleIndependent g hangle n x θ) /-- The retained Gaussian term as a literal real carrier field. -/ -noncomputable def gaussianField (d : LinearWaveBounds.GraphDirections (D × ℝ)) +@[expose] noncomputable def gaussianField (d : LinearWaveBounds.GraphDirections (D × ℝ)) (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) (j : ℤ) (k : ℕ → ℝ) (Ψ : ℕ → D × ℝ → ℝ) : Oscillation D := fun n p i => (HarmonicCalculus.vectorMode (k n * (j : ℝ)) (Ψ n) @@ -426,7 +426,7 @@ theorem symmetric_sum {D ι : Type} (s : Finset ι) (a : ι → Coefficients D) /-- Accumulation is coefficient addition within one fixed label. Distinct labels are left distinct even if their numerical carriers coincide. -/ -noncomputable def sumBlock {D ι : Type} (s : Finset ι) +@[expose] noncomputable def sumBlock {D ι : Type} (s : Finset ι) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (b : ι → HarmonicBlock D) : HarmonicBlock D where velocity n i := ∑ l ∈ s, (b l).velocity n i @@ -809,7 +809,7 @@ end end -@[expose] public section +public section noncomputable section @@ -972,13 +972,13 @@ end CovarianceControl /-- Signed scalar, defined pointwise by `Real.sqrt (s.epsilon n) * SignedCovariance.increment (H n x) (T n x) (R n x) j * mask n x`. -/ -noncomputable def signedScalar (s : StripData D) (H : ℕ → D → Mat2) +@[expose] noncomputable def signedScalar (s : StripData D) (H : ℕ → D → Mat2) (T R : ℕ → D → Vec2) (mask : ℕ → D → ℝ) (j : Fin 2) : ℕ → D → ℝ := fun n x => Real.sqrt (s.epsilon n) * SignedCovariance.increment (H n x) (T n x) (R n x) j * mask n x /-- Signed vector, defined pointwise by `signedScalar s H T R mask j n x • v n x`. -/ -noncomputable def signedVector (s : StripData D) (H : ℕ → D → Mat2) +@[expose] noncomputable def signedVector (s : StripData D) (H : ℕ → D → Mat2) (T R : ℕ → D → Vec2) (mask : ℕ → D → ℝ) (v : ℕ → D → Space) (j : Fin 2) : ℕ → D → Space := fun n x => signedScalar s H T R mask j n x • v n x @@ -1011,7 +1011,7 @@ theorem signedVector_class {s : StripData D} {H : ℕ → D → Mat2} {T R : ℕ /-! ## The same homogeneous fundamental and its constructed pressure -/ /-- Homogeneous coefficients as an element of `LinearWaveBounds.WaveCoefficients D`. -/ -noncomputable def homogeneousCoefficients (a : LinearWaveBounds.WaveCoefficients D) +@[expose] noncomputable def homogeneousCoefficients (a : LinearWaveBounds.WaveCoefficients D) (s : StripData D) (d : LinearWaveBounds.GraphDirections D) (v Ndot : ℕ → D → Space) (A : ℕ → D → Space →L[ℝ] Space) : LinearWaveBounds.WaveCoefficients D := @@ -1022,7 +1022,7 @@ noncomputable def homogeneousCoefficients (a : LinearWaveBounds.WaveCoefficients /-- Coefficients, given by `homogeneousCoefficients a s d (signedVector s H T R mask v j) Ndot A`. -/ -noncomputable def coefficients (a : LinearWaveBounds.WaveCoefficients D) +@[expose] noncomputable def coefficients (a : LinearWaveBounds.WaveCoefficients D) (s : StripData D) (d : LinearWaveBounds.GraphDirections D) (H : ℕ → D → Mat2) (T R : ℕ → D → Vec2) (mask : ℕ → D → ℝ) (v Ndot : ℕ → D → Space) (A : ℕ → D → Space →L[ℝ] Space) (j : Fin 2) : @@ -1158,7 +1158,7 @@ theorem coefficients_principal_zero /-- Phase matrix, given by `PrimaryPulseBounds.chartCovariance pref (fun j => (F j).frame) (fun j => (F j).lam) (fun j => (F j).u) (fun j => (F j).L) χ`. -/ -noncomputable def phaseMatrix {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} +@[expose] noncomputable def phaseMatrix {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} (F : Fin 2 → PrimaryPulseBounds.PhaseConstruction U) (pref : Fin 2 → ℕ → ℝ) (χ : ℕ → D → PhaseCalculus.Slow × ℝ) : ℕ → D → Mat2 := PrimaryPulseBounds.chartCovariance pref (fun j => (F j).frame) @@ -1166,7 +1166,7 @@ noncomputable def phaseMatrix {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} /-- Phase fundamental, defined pointwise by `PrimaryPulseBounds.normalizedPulse ((F j).frame n) ((F j).lam n) ((F j).u n) ((F j).L n) (χ n x)`. -/ -noncomputable def phaseFundamental {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} +@[expose] noncomputable def phaseFundamental {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} (F : Fin 2 → PrimaryPulseBounds.PhaseConstruction U) (χ : ℕ → D → PhaseCalculus.Slow × ℝ) (j : Fin 2) : ℕ → D → Space := fun n x => PrimaryPulseBounds.normalizedPulse ((F j).frame n) @@ -1174,7 +1174,7 @@ noncomputable def phaseFundamental {U : PhaseJetBounds.Domain ℕ PhaseCalculus. /-- Phase envelope, defined pointwise by `PrimaryPulseBounds.referenceP ((F j).lam n) ((F j).u n) ((F j).L n) ((F j).L n * (χ n x).2)`. -/ -noncomputable def phaseEnvelope {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} +@[expose] noncomputable def phaseEnvelope {U : PhaseJetBounds.Domain ℕ PhaseCalculus.Slow} (F : Fin 2 → PrimaryPulseBounds.PhaseConstruction U) (χ : ℕ → D → PhaseCalculus.Slow × ℝ) (j : Fin 2) : ℕ → D → ℝ := fun n x => PrimaryPulseBounds.referenceP ((F j).lam n) ((F j).u n) @@ -1369,7 +1369,7 @@ theorem coefficientBlock_classes {s : StripData D} {P : ℕ → D → ℝ} {α /-- The full cylindrical construction is evaluated at angle zero to obtain the coefficient algebra. Its physical angle is reintroduced by the unchanged integer carrier, as proved in `blockOfCoefficients_represents`. -/ -noncomputable def blockOfCoefficients (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) +@[expose] noncomputable def blockOfCoefficients (a : LinearWaveBounds.WaveCoefficients (D × ℝ)) (kp : ℕ → ℤ) : CorrectionState.HarmonicBlock D := coefficientBlock a.frequency (fun n x => a.phase n (x,0)) kp (fun n x => a.amplitude n (x,0)) (fun n x => a.pressure n (x,0)) @@ -2005,7 +2005,7 @@ noncomputable def nativeUnit {D h : ℝ} {vr vt : TorusInverse.Plane} covered (SlotColoring.nativeIndex h U.1) (P.rawTangent hdet j 1) Y] /-- Native tangent block, constructed using `coefficientBlock`. -/ -noncomputable def nativeTangentBlock {D h : ℝ} {vr vt : TorusInverse.Plane} +@[expose] noncomputable def nativeTangentBlock {D h : ℝ} {vr vt : TorusInverse.Plane} {sys : SlotSystem D h vr vt} {U : UnsignedLabel} (P : PairData sys U) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : ℝ) (a : Vec2) (q : ℝ) (x : SlotColoring.Position) (j : Fin 2) : @@ -2047,7 +2047,7 @@ theorem nativeTangentBlock_tangent {D h : ℝ} {vr vt : TorusInverse.Plane} /-- Native assembly, defined pointwise by `∑ᶠ v : UnsignedLabel × Fin 2, (nativeTangentBlock (P v.1) hdet (outer v.1) (ε v.1) (a v.1) q x v.2).oscillation 0 (Y,θ) i`. -/ -noncomputable def nativeAssembly {D h : ℝ} {vr vt : TorusInverse.Plane} +@[expose] noncomputable def nativeAssembly {D h : ℝ} {vr vt : TorusInverse.Plane} {sys : SlotSystem D h vr vt} {N : ℕ} (P : (U : UnsignedLabel) → PairData sys (tailLabel N U)) (hdet : vr.1 * vt.2 - vr.2 * vt.1 ≠ 0) (outer ε : UnsignedLabel → ℝ) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityApproach.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityApproach.lean index e8fb357ed6..4488b9a990 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityApproach.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityApproach.lean @@ -18,7 +18,7 @@ when `tau` and `z` tend to zero together. The value assigned outside the positive-time domain is never used in this assertion. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityCoordinates.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityCoordinates.lean index d685f860e7..17cfe626bf 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityCoordinates.lean @@ -18,7 +18,7 @@ Here `a = 2h`. We construct the unique positive solution of `τ = q - z² q^a` for `0 < a < 1` and `τ > 0`. -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ open scoped Topology ContDiff namespace NavierStokes.SimilarityCoordinates /-- Forward scalar, given by `q - z ^ 2 * q ^ a`. -/ -def forwardScalar (a z q : ℝ) : ℝ := q - z ^ 2 * q ^ a +@[expose] def forwardScalar (a z q : ℝ) : ℝ := q - z ^ 2 * q ^ a theorem forwardScalar_factor {q : ℝ} (hq : 0 < q) (a z : ℝ) : forwardScalar a z q = q ^ a * (q ^ (1 - a) - z ^ 2) := by @@ -131,6 +131,7 @@ theorem existsUnique_positive_solution {a τ : ℝ} (ha : 0 < a) (ha1 : a < 1) /-- The unique positive coordinate, with value `1` outside the intended parameter domain. Only its restriction to that open domain is used. -/ +@[expose] def coordinateQ (a : ℝ) (p : ℝ × ℝ) : ℝ := if hp : 0 < a ∧ a < 1 ∧ 0 < p.1 then Classical.choose (exists_positive_solution hp.1 hp.2.1 hp.2.2 p.2) @@ -149,7 +150,7 @@ theorem eq_coordinateQ {a : ℝ} (ha : 0 < a) (ha1 : a < 1) exact positive_solution_unique ha ha1 hp hq hs.1 he hs.2 /-- Scalar slope, given by `1 - z ^ 2 * a * q ^ (a - 1)`. -/ -def scalarSlope (a z q : ℝ) : ℝ := 1 - z ^ 2 * a * q ^ (a - 1) +@[expose] def scalarSlope (a z q : ℝ) : ℝ := 1 - z ^ 2 * a * q ^ (a - 1) theorem scalarSlope_pos {a z q : ℝ} (ha : 0 < a) (ha1 : a < 1) (hq : 0 < q) (hf : 0 < forwardScalar a z q) : 0 < scalarSlope a z q := by @@ -165,7 +166,7 @@ theorem scalarSlope_pos {a z q : ℝ} (ha : 0 < a) (ha1 : a < 1) ring /-- The forward map whose inverse supplies smooth dependence on `(τ,z)`. -/ -def forwardMap (a : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := +@[expose] def forwardMap (a : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := (forwardScalar a p.2 p.1, p.2) /-- Explicit invertible triangular linear map used by the inverse theorem. -/ @@ -241,7 +242,7 @@ theorem forwardMap_hasFDerivAt {a : ℝ} {p : ℝ × ℝ} (hp : p.1 ≠ 0) simpa only [Pi.mul_apply, Pi.sub_apply, pow_two] using hder /-- Inverse map, given by `(coordinateQ a p, p.2)`. -/ -def inverseMap (a : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := (coordinateQ a p, p.2) +@[expose] def inverseMap (a : ℝ) (p : ℝ × ℝ) : ℝ × ℝ := (coordinateQ a p, p.2) theorem inverseMap_forwardMap {a : ℝ} (ha : 0 < a) (ha1 : a < 1) {p : ℝ × ℝ} (hq : 0 < p.1) (hF : 0 < forwardScalar a p.2 p.1) : @@ -350,7 +351,7 @@ theorem coordinateQ_hasDerivAt_time {a t z : ℝ} ring /-- Coordinate eta, given by `p.2 / coordinateQ a p ^ ((1 - a) / 2)`. -/ -def coordinateEta (a : ℝ) (p : ℝ × ℝ) : ℝ := +@[expose] def coordinateEta (a : ℝ) (p : ℝ × ℝ) : ℝ := p.2 / coordinateQ a p ^ ((1 - a) / 2) theorem coordinateEta_smooth {a : ℝ} (ha : 0 < a) (ha1 : a < 1) @@ -511,7 +512,7 @@ theorem coordinateQ_hasDerivAt_z_L {a τ z : ℝ} exact hc /-- Coordinate X, given by `s / coordinateQ a p`. -/ -def coordinateX (a s : ℝ) (p : ℝ × ℝ) : ℝ := s / coordinateQ a p +@[expose] def coordinateX (a s : ℝ) (p : ℝ × ℝ) : ℝ := s / coordinateQ a p theorem coordinateX_smooth {a s : ℝ} (ha : 0 < a) (ha1 : a < 1) {p : ℝ × ℝ} (hp : 0 < p.1) : ContDiffAt ℝ ∞ (coordinateX a s) p := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityHomogeneity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityHomogeneity.lean index 385edf3b2c..bc02a47fad 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityHomogeneity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityHomogeneity.lean @@ -21,7 +21,7 @@ function of `R` alone. Profile weights are transported exactly by a change of band scale. -/ -@[expose] public section +public section noncomputable section @@ -157,23 +157,23 @@ theorem pullback_physicalScale {h Q b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) abbrev ChartPoint := ℝ × (ℝ × ℝ) /-- A band chart is ordered `(R,(Z,T))`. -/ -noncomputable def chartQ (h : ℝ) (p : ChartPoint) : ℝ := +@[expose] noncomputable def chartQ (h : ℝ) (p : ChartPoint) : ℝ := coordinateQ (2 * h) (p.2.2, p.2.1) /-- Chart eta, given by `coordinateEta (2 * h) (p.2.2, p.2.1)`. -/ -noncomputable def chartEta (h : ℝ) (p : ChartPoint) : ℝ := +@[expose] noncomputable def chartEta (h : ℝ) (p : ChartPoint) : ℝ := coordinateEta (2 * h) (p.2.2, p.2.1) /-- Chart X, given by `coordinateX (2 * h) (p.1 ^ 2 / 2) (p.2.2, p.2.1)`. -/ -noncomputable def chartX (h : ℝ) (p : ChartPoint) : ℝ := +@[expose] noncomputable def chartX (h : ℝ) (p : ChartPoint) : ℝ := coordinateX (2 * h) (p.1 ^ 2 / 2) (p.2.2, p.2.1) /-- Chart inner, given by `(chartX h p, chartEta h p)`. -/ -noncomputable def chartInner (h : ℝ) (p : ChartPoint) : ℝ × ℝ := +@[expose] noncomputable def chartInner (h : ℝ) (p : ChartPoint) : ℝ × ℝ := (chartX h p, chartEta h p) /-- Transition from the band of scale `Q` to the band of scale `Q'`. -/ -noncomputable def chartTransition (h Q Q' : ℝ) (p : ChartPoint) : ChartPoint := +@[expose] noncomputable def chartTransition (h Q Q' : ℝ) (p : ChartPoint) : ChartPoint := ((Q / Q') ^ (1 / 2 : ℝ) * p.1, ((Q / Q') ^ D h * p.2.1, (Q / Q') * p.2.2)) @@ -316,7 +316,7 @@ theorem chartTransition_inverse {h Q Q' : ℝ} (hQ : 0 < Q) (hQ' : 0 < Q') /-- The usual open annular-chart domain; profile annulus restrictions can be added using `chartX_mem_transition`. -/ -noncomputable def chartDomain : Set ChartPoint := {p | 0 < p.1 ∧ 0 < p.2.2} +@[expose] noncomputable def chartDomain : Set ChartPoint := {p | 0 < p.1 ∧ 0 < p.2.2} theorem isOpen_chartDomain : IsOpen chartDomain := (isOpen_lt continuous_const continuous_fst).inter @@ -375,7 +375,7 @@ theorem profileLogDistance_pos {left right X : ℝ} (hl : 0 < left) (sub_pos.mpr (Real.log_lt_log (hl.trans hLX) hXR))) /-- Chart log distance, given by `profileLogDistance left right (chartX h p)`. -/ -noncomputable def chartLogDistance (h left right : ℝ) (p : ChartPoint) : ℝ := +@[expose] noncomputable def chartLogDistance (h left right : ℝ) (p : ChartPoint) : ℝ := profileLogDistance left right (chartX h p) theorem chartLogDistance_transition {h Q Q' : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityProfile.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityProfile.lean index a5fe1fb12e..fe6cf8fd31 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityProfile.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SimilarityProfile.lean @@ -17,7 +17,7 @@ The physical variables are `(t,s,z)`, with `s = r²/2`. Inner profiles use `(X,η)`. All partial derivatives below are genuine Fréchet derivatives. -/ -@[expose] public section +public section noncomputable section @@ -44,42 +44,42 @@ abbrev d := CoordinateAlgebra.d abbrev L := CoordinateAlgebra.L /-- Q, given by `SimilarityCoordinates.coordinateQ (2 * h) (1 - p.1, p.2.2)`. -/ -def q (h : ℝ) (p : PhysicalPoint) : ℝ := +@[expose] def q (h : ℝ) (p : PhysicalPoint) : ℝ := SimilarityCoordinates.coordinateQ (2 * h) (1 - p.1, p.2.2) /-- Eta, given by `SimilarityCoordinates.coordinateEta (2 * h) (1 - p.1, p.2.2)`. -/ -def eta (h : ℝ) (p : PhysicalPoint) : ℝ := +@[expose] def eta (h : ℝ) (p : PhysicalPoint) : ℝ := SimilarityCoordinates.coordinateEta (2 * h) (1 - p.1, p.2.2) /-- X, given by `p.2.1 / q h p`. -/ -def X (h : ℝ) (p : PhysicalPoint) : ℝ := p.2.1 / q h p +@[expose] def X (h : ℝ) (p : PhysicalPoint) : ℝ := p.2.1 / q h p /-- Inner, given by `(X h p, eta h p)`. -/ -def inner (h : ℝ) (p : PhysicalPoint) : InnerPoint := (X h p, eta h p) +@[expose] def inner (h : ℝ) (p : PhysicalPoint) : InnerPoint := (X h p, eta h p) /-- Partial X, given by `fderiv ℝ f w (1, 0)`. -/ -def partialX (f : InnerProfile) (w : InnerPoint) : ℝ := fderiv ℝ f w (1, 0) +@[expose] def partialX (f : InnerProfile) (w : InnerPoint) : ℝ := fderiv ℝ f w (1, 0) /-- Partial eta, given by `fderiv ℝ f w (0, 1)`. -/ -def partialEta (f : InnerProfile) (w : InnerPoint) : ℝ := fderiv ℝ f w (0, 1) +@[expose] def partialEta (f : InnerProfile) (w : InnerPoint) : ℝ := fderiv ℝ f w (0, 1) /-- T, given by `CoordinateAlgebra.timeCoeff b h w.2 w.1 (f w) (partialX f w) (partialEta f w)`. -/ -def T (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : ℝ := +@[expose] def T (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : ℝ := CoordinateAlgebra.timeCoeff b h w.2 w.1 (f w) (partialX f w) (partialEta f w) /-- Z, given by `CoordinateAlgebra.axialCoeff b h w.2 w.1 (f w) (partialX f w) (partialEta f w)`. -/ -def Z (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : ℝ := +@[expose] def Z (h b : ℝ) (f : InnerProfile) (w : InnerPoint) : ℝ := CoordinateAlgebra.axialCoeff b h w.2 w.1 (f w) (partialX f w) (partialEta f w) /-- Pullback, given by `q h p ^ b * f (inner h p)`. -/ -def pullback (h b : ℝ) (f : InnerProfile) (p : PhysicalPoint) : ℝ := +@[expose] def pullback (h b : ℝ) (f : InnerProfile) (p : PhysicalPoint) : ℝ := q h p ^ b * f (inner h p) /-- Partial T, given by `fderiv ℝ F p (1, (0, 0))`. -/ -def partialT (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := fderiv ℝ F p (1, (0, 0)) +@[expose] def partialT (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := fderiv ℝ F p (1, (0, 0)) /-- Partial S, given by `fderiv ℝ F p (0, (1, 0))`. -/ -def partialS (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := fderiv ℝ F p (0, (1, 0)) +@[expose] def partialS (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := fderiv ℝ F p (0, (1, 0)) /-- Partial Z, given by `fderiv ℝ F p (0, (0, 1))`. -/ -def partialZ (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := fderiv ℝ F p (0, (0, 1)) +@[expose] def partialZ (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := fderiv ℝ F p (0, (0, 1)) theorem D_eq (h : ℝ) : (1 - 2 * h) / 2 = D h := by unfold D CoordinateAlgebra.D; ring @@ -342,7 +342,7 @@ theorem partialZ_partialZ_pullback {h b : ℝ} {f : InnerProfile} rw [show b - D h - D h = b - 2 * D h by ring] /-- The natural open physical domain associated to an open inner-profile domain. -/ -def physicalDomain (h : ℝ) (U : Set InnerPoint) : Set PhysicalPoint := +@[expose] def physicalDomain (h : ℝ) (U : Set InnerPoint) : Set PhysicalPoint := {p | p.1 < 1 ∧ inner h p ∈ U} theorem isOpen_physicalDomain {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlotGeometry.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlotGeometry.lean index 976c0fe47a..a1f114104d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlotGeometry.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlotGeometry.lean @@ -23,7 +23,7 @@ Finite-dimensional continuity then gives a single positive rectangle radius, including padding and injectivity modulo the integer lattice. -/ -@[expose] public section +public section noncomputable section @@ -146,10 +146,11 @@ theorem center_injective (m D : ℕ) : Function.Injective (center m D) := by exact_mod_cast (add_right_cancel hnum) /-- Lattice, given by `(Set.range (Int.cast : ℤ → ℝ)) ×ˢ (Set.range (Int.cast : ℤ → ℝ))`. -/ -def lattice : Set Plane := (Set.range (Int.cast : ℤ → ℝ)) ×ˢ (Set.range (Int.cast : ℤ → ℝ)) +@[expose] def lattice : Set Plane := + (Set.range (Int.cast : ℤ → ℝ)) ×ˢ (Set.range (Int.cast : ℤ → ℝ)) /-- Equality on the torus, stated on its universal cover. -/ -def torusEq (x y : Plane) : Prop := x - y ∈ lattice +@[expose] def torusEq (x y : Plane) : Prop := x - y ∈ lattice theorem isClosed_lattice : IsClosed lattice := Int.isClosedEmbedding_coe_real.isClosed_range.prod Int.isClosedEmbedding_coe_real.isClosed_range @@ -366,7 +367,7 @@ theorem cover_pow_torusEq (n : ℕ) {x y : Plane} (h : torusEq x y) : exact cover_torusEq ih /-- All periodically reindexed copies of a native slot, on the absolute lift. -/ -def liftedSupport (level : ℕ) (slot : Set Plane) : Set Plane := +@[expose] def liftedSupport (level : ℕ) (slot : Set Plane) : Set Plane := {Y | ∃ x ∈ slot, torusEq ((cover ^ level) Y) x} theorem liftedSupport_disjoint_of_separation (level n : ℕ) (S T : Set Plane) @@ -395,7 +396,7 @@ theorem exists_disjoint_lifted_slots (m D : ℕ) : exact liftedSupport_disjoint_of_separation level n _ _ (hsep n hn i j hij) /-- A rectangle in any two prescribed auxiliary directions. -/ -def orientedRectangle (c a b : Plane) (r : ℝ) : Set Plane := +@[expose] def orientedRectangle (c a b : Plane) (r : ℝ) : Set Plane := {x | ∃ ξ η : ℝ, |ξ| ≤ r ∧ |η| ≤ r ∧ x = c + ξ • a + η • b} theorem orientedRectangle_subset (c a b : Plane) (r : ℝ) (hr : 0 ≤ r) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBaseEndpoint.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBaseEndpoint.lean index a31c5f7dbd..49f9a006c9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBaseEndpoint.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBaseEndpoint.lean @@ -23,7 +23,7 @@ is only extended at nonzero axial coordinate here; a central-plane gauge correction is a separate construction. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBorelBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBorelBase.lean index d1bc574618..eabd308e2a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBorelBase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowBorelBase.lean @@ -24,7 +24,7 @@ The cutoff-stage bounds are derived from compactness of actual derivatives on a normalized coordinate set. They are not assumptions on the output series. -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ abbrev Chart := ℝ × Inner noncomputable def scaleMap (q : ℝ) : Chart →L[ℝ] Chart := SpatialBorelExtension.timeScale q -@[simp] theorem scaleMap_apply (q : ℝ) (y : Chart) : scaleMap q y = (q * y.1, y.2) := rfl +@[simp] theorem scaleMap_apply (q : ℝ) (y : Chart) : scaleMap q y = (q * y.1, y.2) := by rfl /-- Local power, given by `SmoothCutoffs.cutoff (4 * (q - 1)) * q ^ b`. -/ noncomputable def localPower (b q : ℝ) : ℝ := SmoothCutoffs.cutoff (4 * (q - 1)) * q ^ b @@ -77,10 +77,11 @@ theorem localPower_eventually_eq (b : ℝ) : localPower b =ᶠ[𝓝 1] (fun q : variable {V : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Power coefficient, given by `y.1 ^ b • f y.2`. -/ +@[expose] noncomputable def powerCoefficient (b : ℝ) (f : Inner → V) (y : Chart) : V := y.1 ^ b • f y.2 /-- Power stage, given by `SmoothCutoffs.scaledCutoff c y.1 • powerCoefficient b f y`. -/ -noncomputable def powerStage (c b : ℝ) (f : Inner → V) (y : Chart) : V := +@[expose] noncomputable def powerStage (c b : ℝ) (f : Inner → V) (y : Chart) : V := SmoothCutoffs.scaledCutoff c y.1 • powerCoefficient b f y /-- Template, given by `SmoothCutoffs.cutoff (c * y.1) • (localPower b y.1 • f y.2)`. -/ @@ -158,7 +159,7 @@ theorem exists_template_jet_bound {f : Inner → V} (hf : ContDiff ℝ ∞ f) /-- Jets in the chart obtained by freezing the scale at the evaluation point and replacing q by q·s. The inner variables are left unscaled. -/ -noncomputable def blownJet (m : ℕ) (F : Chart → V) (y : Chart) := +@[expose] noncomputable def blownJet (m : ℕ) (F : Chart → V) (y : Chart) := iteratedFDeriv ℝ m (F ∘ scaleMap y.1) (1, y.2) theorem powerStage_scale_germ (c b : ℝ) (f : Inner → V) {q : ℝ} @@ -265,12 +266,12 @@ theorem powerStage_blown_zero (c b : ℝ) (f : Inner → V) {q : ℝ} /-- The order-zero coefficient is kept uncut. This sequence contains only the positive corrections, with a zero placeholder at index zero. -/ -noncomputable def positiveCoefficient (h : ℝ) (f : ℕ → Inner → V) (j : ℕ) : Chart → V := +@[expose] noncomputable def positiveCoefficient (h : ℝ) (f : ℕ → Inner → V) (j : ℕ) : Chart → V := if j = 0 then (fun _ => 0) else powerCoefficient (2 * h * j) (f j) /-- Slow stage, given by `SolenoidalDiagonal.cutStage (fun j => (a j : ℝ)) Prod.fst (positiveCoefficient h f)`. -/ -noncomputable def slowStage (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → V) : ℕ → Chart → V := +@[expose] noncomputable def slowStage (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → V) : ℕ → Chart → V := SolenoidalDiagonal.cutStage (fun j => (a j : ℝ)) Prod.fst (positiveCoefficient h f) /-- Positive sum, given by `SolenoidalDiagonal.potentialSum (fun j => (a j : ℝ)) Prod.fst @@ -279,7 +280,7 @@ noncomputable def positiveSum (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → SolenoidalDiagonal.potentialSum (fun j => (a j : ℝ)) Prod.fst (positiveCoefficient h f) /-- Slow sum, given by `f 0 y.2 + positiveSum a h f y`. -/ -noncomputable def slowSum (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → V) (y : Chart) : V := +@[expose] noncomputable def slowSum (a : ℕ → ℕ) (h : ℝ) (f : ℕ → Inner → V) (y : Chart) : V := f 0 y.2 + positiveSum a h f y /-- Cut prefix, given by `f 0 y.2 + ∑ j ∈ Finset.range (J + 1), slowStage a h f j y`. -/ @@ -650,7 +651,7 @@ theorem innerBox_isCompact (lo hi : ℝ) : IsCompact (innerBox lo hi) := isCompact_Icc.prod isCompact_Icc /-- Physical chart as an element of `Chart`. -/ -noncomputable def physicalChart (h : ℝ) (p : Chart) : Chart := +@[expose] noncomputable def physicalChart (h : ℝ) (p : Chart) : Chart := (PhysicalCoordinateBounds.physicalQ (2 * h) p, (PhysicalCoordinateBounds.physicalX (2 * h) p, PhysicalCoordinateBounds.physicalEta (2 * h) p)) @@ -817,7 +818,7 @@ section PhysicalProfiles physicalChart h p = (SimilarityProfile.q h p, SimilarityProfile.inner h p) := rfl /-- Restoring a fixed leading q-power after summing the normalized data. -/ -noncomputable def physicalProfile (a : ℕ → ℕ) (h b : ℝ) (f : ℕ → Inner → V) +@[expose] noncomputable def physicalProfile (a : ℕ → ℕ) (h b : ℝ) (f : ℕ → Inner → V) (p : Chart) : V := (physicalChart h p).1 ^ b • slowSum a h f (physicalChart h p) theorem physicalProfile_smoothAt {a : ℕ → ℕ} (ha : StrictMono a) {h : ℝ} @@ -917,7 +918,7 @@ section PoweredTails /-- Physical uncut prefix, given by `(physicalChart h p).1 ^ b • uncutPrefix h f J (physicalChart h p)`. -/ -noncomputable def physicalUncutPrefix (h b : ℝ) (f : ℕ → Inner → V) (J : ℕ) +@[expose] noncomputable def physicalUncutPrefix (h b : ℝ) (f : ℕ → Inner → V) (J : ℕ) (p : Chart) : V := (physicalChart h p).1 ^ b • uncutPrefix h f J (physicalChart h p) theorem uncutPrefix_smoothOn {f : ℕ → Inner → V} (hf : ∀ j, ContDiff ℝ ∞ (f j)) @@ -1212,7 +1213,7 @@ theorem admissible_component {a : ℕ → ℕ} {h C : ℝ} {d : Coefficients} simpa only [ContinuousLinearMap.proj_apply, one_mul] using norm_le_pi_norm v i /-- H=S/s, with its smooth value at the axis provided by the radial average. -/ -noncomputable def streamFactor (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := +@[expose] noncomputable def streamFactor (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : Chart → ℝ := physicalProfile a h (-CoordinateAlgebra.A h) (bundleComponent C d 0) /-- Swirl potential, given by `physicalProfile a h (1 / 2 - CoordinateAlgebra.A h) @@ -1232,7 +1233,7 @@ noncomputable def baseVelocity (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) /-- Base pressure, defined pointwise by `physicalProfile a h (-2 * CoordinateAlgebra.A h) (bundleComponent C d 2) (AxisymmetricFields.profilePoint z.1 z.2)`. -/ -noncomputable def basePressure (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : +@[expose] noncomputable def basePressure (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) : ProblemStatement.PressureField := fun z => physicalProfile a h (-2 * CoordinateAlgebra.A h) (bundleComponent C d 2) (AxisymmetricFields.profilePoint z.1 z.2) @@ -1468,18 +1469,18 @@ theorem compact_map_finite_bound {E : Type} [NormedAddCommGroup E] [NormedSpace simpa only [pow_one] using pow_le_pow_right₀ hD hi /-- Cartesian chart, given by `physicalChart h (AxisymmetricFields.profilePoint z.1 z.2)`. -/ -noncomputable def cartesianChart (h : ℝ) (z : ProblemStatement.SpaceTime) : Chart := +@[expose] noncomputable def cartesianChart (h : ℝ) (z : ProblemStatement.SpaceTime) : Chart := physicalChart h (AxisymmetricFields.profilePoint z.1 z.2) /-- Cartesian profile, given by `physicalProfile a h b f (AxisymmetricFields.profilePoint z.1 z.2)`. -/ -noncomputable def cartesianProfile (a : ℕ → ℕ) (h b : ℝ) (f : ℕ → Inner → V) +@[expose] noncomputable def cartesianProfile (a : ℕ → ℕ) (h b : ℝ) (f : ℕ → Inner → V) (z : ProblemStatement.SpaceTime) : V := physicalProfile a h b f (AxisymmetricFields.profilePoint z.1 z.2) /-- Cartesian uncut prefix, given by `physicalUncutPrefix h b f J (AxisymmetricFields.profilePoint z.1 z.2)`. -/ -noncomputable def cartesianUncutPrefix (h b : ℝ) (f : ℕ → Inner → V) (J : ℕ) +@[expose] noncomputable def cartesianUncutPrefix (h b : ℝ) (f : ℕ → Inner → V) (J : ℕ) (z : ProblemStatement.SpaceTime) : V := physicalUncutPrefix h b f J (AxisymmetricFields.profilePoint z.1 z.2) @@ -1586,11 +1587,11 @@ theorem normalized_correction_smul_inner {a : ℕ → ℕ} {h : ℝ} (hh : 0 < h (Real.rpow_nonneg hq.le _) /-- Normalized swirl, given by `Real.sqrt (2 * y.2.1) / C * slowSum a h d.phi y`. -/ -noncomputable def normalizedSwirl (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) +@[expose] noncomputable def normalizedSwirl (a : ℕ → ℕ) (h C : ℝ) (d : Coefficients) (y : Chart) : ℝ := Real.sqrt (2 * y.2.1) / C * slowSum a h d.phi y /-- Leading swirl, given by `Real.sqrt (2 * w.1) / C * d.phi 0 w`. -/ -noncomputable def leadingSwirl (C : ℝ) (d : Coefficients) (w : Inner) : ℝ := +@[expose] noncomputable def leadingSwirl (C : ℝ) (d : Coefficients) (w : Inner) : ℝ := Real.sqrt (2 * w.1) / C * d.phi 0 w /-- Both normalized tangential components have the claimed O(q^(2h)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowDivergence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowDivergence.lean index 707b224131..f33a409cd5 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowDivergence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowDivergence.lean @@ -21,7 +21,7 @@ axial profile. Its radial derivative is the actual similarity axial operator, and its physical reconstruction satisfies the flux form of incompressibility. -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ open scoped Topology ContDiff open ProfileHistories /-- The positive-order radial flux, with an arbitrary exponent increment lam. -/ -def radialFlux (h lam : ℝ) (U : Field) (p : Point) : ℝ := +@[expose] def radialFlux (h lam : ℝ) (U : Field) (p : Point) : ℝ := p.1 / CoordinateAlgebra.L h p.2 * (2 * p.2 * U p - 2 * p.2 * (CoordinateAlgebra.D h + lam) * average U p - CoordinateAlgebra.d p.2 * SimilarityProfile.partialEta (average U) p) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowExpansionResidual.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowExpansionResidual.lean index f4bc67920f..4cff1506ee 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowExpansionResidual.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowExpansionResidual.lean @@ -30,7 +30,7 @@ All quotient derivatives in this file are genuine Fréchet derivatives, and their hypotheses are local at a point with positive `s`. -/ -@[expose] public section +public section namespace NavierStokes.RadialFluxResidual @@ -275,7 +275,7 @@ end end -@[expose] public section +public section noncomputable section @@ -286,7 +286,7 @@ open SimilarityProfile (InnerProfile InnerPoint pullback partialX T Z) open scoped BigOperators Topology ContDiff /-- The manuscript's slow order `λ_n=2nh`. -/ -def slowOrder (h : ℝ) (n : ℕ) : ℝ := 2 * (n : ℝ) * h +@[expose] def slowOrder (h : ℝ) (n : ℕ) : ℝ := 2 * (n : ℝ) * h @[simp] theorem slowOrder_zero (h : ℝ) : slowOrder h 0 = 0 := by simp [slowOrder] theorem slowOrder_add (h : ℝ) (i j : ℕ) : @@ -299,7 +299,7 @@ theorem slowOrder_succ (h : ℝ) (n : ℕ) : ring /-- Finite series, given by `∑ n ∈ Finset.range (N + 1), q ^ (b + slowOrder h n) * a n`. -/ -def finiteSeries (N : ℕ) (q h b : ℝ) (a : ℕ → ℝ) : ℝ := +@[expose] def finiteSeries (N : ℕ) (q h b : ℝ) (a : ℕ → ℝ) : ℝ := ∑ n ∈ Finset.range (N + 1), q ^ (b + slowOrder h n) * a n /-- Pairs, given by `Finset.range (N + 1) ×ˢ Finset.range (N + 1)`. -/ @@ -307,7 +307,7 @@ noncomputable def pairs (N : ℕ) : Finset (ℕ × ℕ) := Finset.range (N + 1) ×ˢ Finset.range (N + 1) /-- Convolution, given by `∑ ij ∈ Finset.antidiagonal n, K ij.1 ij.2`. -/ -def convolution (K : ℕ → ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def convolution (K : ℕ → ℕ → ℝ) (n : ℕ) : ℝ := ∑ ij ∈ Finset.antidiagonal n, K ij.1 ij.2 /-- Finite convolution, given by `∑ ij ∈ (pairs N).filter (fun ij => ij.1 + ij.2 = n), K ij.1 @@ -317,11 +317,11 @@ def finiteConvolution (N : ℕ) (K : ℕ → ℕ → ℝ) (n : ℕ) : ℝ := /-- Pair tail, given by `∑ ij ∈ (pairs N).filter (fun ij => N < ij.1 + ij.2), w (ij.1 + ij.2) * K ij.1 ij.2`. -/ -def pairTail (N : ℕ) (w : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : ℝ := +@[expose] def pairTail (N : ℕ) (w : ℕ → ℝ) (K : ℕ → ℕ → ℝ) : ℝ := ∑ ij ∈ (pairs N).filter (fun ij => N < ij.1 + ij.2), w (ij.1 + ij.2) * K ij.1 ij.2 /-- Previous as an element of `ℕ → ℝ | 0 => 0 | n + 1 => a n`. -/ -noncomputable def previous (a : ℕ → ℝ) : ℕ → ℝ +@[expose] noncomputable def previous (a : ℕ → ℝ) : ℕ → ℝ | 0 => 0 | n + 1 => a n @@ -479,7 +479,7 @@ theorem shifted_sum (N : ℕ) (w a : ℕ → ℝ) : linarith /-- Recurrence, given by `L n + convolution K n - previous A n`. -/ -def recurrence (L : ℕ → ℝ) (K : ℕ → ℕ → ℝ) (A : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def recurrence (L : ℕ → ℝ) (K : ℕ → ℕ → ℝ) (A : ℕ → ℝ) (n : ℕ) : ℝ := L n + convolution K n - previous A n /-- Universal finite-order recurrence identity used by the angular, axial, @@ -510,11 +510,11 @@ theorem recurrence_truncation_of_zero (N : ℕ) (w L A : ℕ → ℝ) (K : ℕ rw [hs, zero_add] /-- Transport linear, given by `gt n - 2 * (X * gxx n + m * gx n) + source n`. -/ -def transportLinear (X m : ℝ) (gt gx gxx source : ℕ → ℝ) (n : ℕ) : ℝ := +@[expose] def transportLinear (X m : ℝ) (gt gx gxx source : ℕ → ℝ) (n : ℕ) : ℝ := gt n - 2 * (X * gxx n + m * gx n) + source n /-- Transport pair, given by `v i * (gx j + α * g j / X) + u i * gz j`. -/ -def transportPair (X α : ℝ) (v u g gx gz : ℕ → ℝ) (i j : ℕ) : ℝ := +@[expose] def transportPair (X α : ℝ) (v u g gx gz : ℕ → ℝ) (i j : ℕ) : ℝ := v i * (gx j + α * g j / X) + u i * gz j /-- Scalar transport/diffusion for arbitrary finite jets, with all product @@ -590,7 +590,7 @@ theorem secondAlong_sum {ι : Type*} (s : Finset ι) (f : ι → Profile) /-- Finite profile, defined pointwise by `∑ n ∈ Finset.range (N + 1), pullback h (b + slowOrder h n) (f n) p`. -/ -def finiteProfile (N : ℕ) (h b : ℝ) (f : ℕ → InnerProfile) : Profile := +@[expose] def finiteProfile (N : ℕ) (h b : ℝ) (f : ℕ → InnerProfile) : Profile := fun p => ∑ n ∈ Finset.range (N + 1), pullback h (b + slowOrder h n) (f n) p @[simp] theorem finiteProfile_order_zero (h b : ℝ) (f : ℕ → InnerProfile) : @@ -653,7 +653,7 @@ theorem partialZ_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) b - CoordinateAlgebra.D h + slowOrder h n by ring] /-- Z2, given by `Z h (b - CoordinateAlgebra.D h) (Z h b f)`. -/ -def Z2 (h b : ℝ) (f : InnerProfile) : InnerProfile := +@[expose] def Z2 (h b : ℝ) (f : InnerProfile) : InnerProfile := Z h (b - CoordinateAlgebra.D h) (Z h b f) theorem partialSS_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) @@ -692,14 +692,14 @@ theorem partialZZ_finiteProfile {h b : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) rfl /-- Transport residual, constructed using `AxisymmetricResidual.partialT`. -/ -def transportResidual (α m : ℝ) (V U G source : Profile) (p : ProfilePoint) : ℝ := +@[expose] def transportResidual (α m : ℝ) (V U G source : Profile) (p : ProfilePoint) : ℝ := AxisymmetricResidual.partialT G p + V p * (partialS G p + α * (G p / p.2.1)) + U p * partialZ G p - (2 * p.2.1 * partialS (partialS G) p + 2 * m * partialS G p + partialZ (partialZ G) p) + source p /-- Transport coefficient, constructed using `recurrence`. -/ -def transportCoefficient (h e α m : ℝ) (v u f source : ℕ → InnerProfile) +@[expose] def transportCoefficient (h e α m : ℝ) (v u f source : ℕ → InnerProfile) (n : ℕ) (w : InnerPoint) : ℝ := recurrence (transportLinear w.1 m (fun j => T h (e + slowOrder h j) (f j) w) @@ -709,7 +709,7 @@ def transportCoefficient (h e α m : ℝ) (v u f source : ℕ → InnerProfile) (fun j => Z2 h (e + slowOrder h j) (f j) w) n /-- Transport tail, constructed using `pairTail`. -/ -def transportTail (N : ℕ) (q h e α : ℝ) (v u f : ℕ → InnerProfile) (w : InnerPoint) : ℝ := +@[expose] def transportTail (N : ℕ) (q h e α : ℝ) (v u f : ℕ → InnerProfile) (w : InnerPoint) : ℝ := pairTail N (fun n => q ^ (e - 1 + slowOrder h n)) (transportPair w.1 α (fun j => v j w) (fun j => u j w) (fun j => f j w) (fun j => partialX (f j) w) (fun j => Z h (e + slowOrder h j) (f j) w)) - @@ -824,9 +824,9 @@ theorem transportResidual_scale (c α m : ℝ) (V U : Profile) {G : Profile} {p ring /-- Angular exponent, given by `-CoordinateAlgebra.A h - 1 / 2`. -/ -def angularExponent (h : ℝ) : ℝ := -CoordinateAlgebra.A h - 1 / 2 +@[expose] def angularExponent (h : ℝ) : ℝ := -CoordinateAlgebra.A h - 1 / 2 /-- Axial exponent, given by `-CoordinateAlgebra.A h`. -/ -def axialExponent (h : ℝ) : ℝ := -CoordinateAlgebra.A h +@[expose] def axialExponent (h : ℝ) : ℝ := -CoordinateAlgebra.A h /-- Pressure exponent, given by `-2 * CoordinateAlgebra.A h`. -/ def pressureExponent (h : ℝ) : ℝ := -2 * CoordinateAlgebra.A h @@ -842,28 +842,28 @@ structure SlowProfiles where pressure : ℕ → InnerProfile /-- Slow flux, given by `finiteProfile N h 0 f.flux`. -/ -def slowFlux (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := finiteProfile N h 0 f.flux +@[expose] def slowFlux (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := finiteProfile N h 0 f.flux /-- Slow swirl, defined pointwise by `C⁻¹ * finiteProfile N h (angularExponent h) f.phi p`. -/ -def slowSwirl (N : ℕ) (h C : ℝ) (f : SlowProfiles) : Profile := +@[expose] def slowSwirl (N : ℕ) (h C : ℝ) (f : SlowProfiles) : Profile := fun p => C⁻¹ * finiteProfile N h (angularExponent h) f.phi p /-- Slow axial, given by `finiteProfile N h (axialExponent h) f.axial`. -/ -def slowAxial (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := +@[expose] def slowAxial (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := finiteProfile N h (axialExponent h) f.axial /-- Slow pressure, given by `finiteProfile N h (pressureExponent h) f.pressure`. -/ def slowPressure (N : ℕ) (h : ℝ) (f : SlowProfiles) : Profile := finiteProfile N h (pressureExponent h) f.pressure /-- Axial pressure source, given by `Z h (pressureExponent h + slowOrder h n) (f.pressure n)`. -/ -def axialPressureSource (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := +@[expose] def axialPressureSource (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := Z h (pressureExponent h + slowOrder h n) (f.pressure n) /-- Angular coefficient, given by `transportCoefficient h (angularExponent h) 1 2 f.flux f.axial f.phi (fun _ _ => 0) n`. -/ -def angularCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := +@[expose] def angularCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := transportCoefficient h (angularExponent h) 1 2 f.flux f.axial f.phi (fun _ _ => 0) n /-- Axial coefficient, given by `transportCoefficient h (axialExponent h) 0 1 f.flux f.axial f.axial (axialPressureSource h f) n`. -/ -def axialCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := +@[expose] def axialCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := transportCoefficient h (axialExponent h) 0 1 f.flux f.axial f.axial (axialPressureSource h f) n /-- Omega coefficient, given by `transportCoefficient h 0 (-(1 / 2)) 0 f.flux f.axial f.flux (fun _ _ => 0) n`. -/ @@ -874,7 +874,7 @@ n) (f.axial n) w`. -/ def divergenceCoefficient (h : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := partialX (f.flux n) w + Z h (axialExponent h + slowOrder h n) (f.axial n) w /-- Pressure coefficient, constructed using `partialX`. -/ -def pressureCoefficient (h C : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := +@[expose] def pressureCoefficient (h C : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := partialX (f.pressure n) w - C⁻¹ ^ 2 * convolution (fun i j => f.phi i w * f.phi j w) n + previous (fun j => omegaCoefficient h f j w) n / (2 * w.1) @@ -1029,7 +1029,7 @@ theorem pressure_series_identity {q X : ℝ} (hq : 0 < q) (hX : X ≠ 0) ring /-- Pressure tail, constructed using `transportTail`. -/ -def pressureTail (N : ℕ) (q h C : ℝ) (f : SlowProfiles) (w : InnerPoint) : ℝ := +@[expose] def pressureTail (N : ℕ) (q h C : ℝ) (f : SlowProfiles) (w : InnerPoint) : ℝ := transportTail N q h 0 (-(1 / 2)) f.flux f.axial f.flux w + q ^ (pressureExponent h + slowOrder h (N + 1)) * omegaCoefficient h f N w - 2 * w.1 * C⁻¹ ^ 2 * pairTail N (fun n => q ^ (pressureExponent h + slowOrder h n)) @@ -1239,20 +1239,20 @@ theorem divergence_slowVelocity_eq_zero {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) exact finiteSeries_eq_zero _ _ _ _ _ hdiv /-- Angular expansion as an element of `ℝ`. -/ -noncomputable def angularExpansion (N : ℕ) (q h C : ℝ) (f : SlowProfiles) +@[expose] noncomputable def angularExpansion (N : ℕ) (q h C : ℝ) (f : SlowProfiles) (w : InnerPoint) : ℝ := C⁻¹ * (finiteSeries N q h (angularExponent h - 1) (fun n => angularCoefficient h f n w) + transportTail N q h (angularExponent h) 1 f.flux f.axial f.phi w) /-- Axial expansion, constructed using `finiteSeries`. -/ -noncomputable def axialExpansion (N : ℕ) (q h : ℝ) (f : SlowProfiles) +@[expose] noncomputable def axialExpansion (N : ℕ) (q h : ℝ) (f : SlowProfiles) (w : InnerPoint) : ℝ := finiteSeries N q h (axialExponent h - 1) (fun n => axialCoefficient h f n w) + transportTail N q h (axialExponent h) 0 f.flux f.axial f.axial w /-- Radial flux expansion, given by `2 * w.1 * finiteSeries N q h (pressureExponent h) (fun n => pressureCoefficient h C f n w) + pressureTail N q h C f w`. -/ -noncomputable def radialFluxExpansion (N : ℕ) (q h C : ℝ) (f : SlowProfiles) +@[expose] noncomputable def radialFluxExpansion (N : ℕ) (q h C : ℝ) (f : SlowProfiles) (w : InnerPoint) : ℝ := 2 * w.1 * finiteSeries N q h (pressureExponent h) (fun n => pressureCoefficient h C f n w) + pressureTail N q h C f w @@ -1317,7 +1317,7 @@ theorem navierStokesResidual_slowVelocity {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / /-- The explicit forcing left by truncation once all retained coefficient equations hold. This includes omitted quadratic interactions and the final axial-viscosity and radial-acceleration terms. -/ -noncomputable def truncationResidual (N : ℕ) (h C : ℝ) (f : SlowProfiles) +@[expose] noncomputable def truncationResidual (N : ℕ) (h C : ℝ) (f : SlowProfiles) (t : ℝ) (x : ProblemStatement.Space) : ProblemStatement.Space := let q := SimilarityProfile.q h (profilePoint t x) let w := SimilarityProfile.inner h (profilePoint t x) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowFirstOrderEdge.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowFirstOrderEdge.lean index ed7b424af6..a8c6fcea4a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowFirstOrderEdge.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowFirstOrderEdge.lean @@ -20,7 +20,7 @@ backward integral with weight `R²`. The coefficient chart is `(η,δ)`, includ both endpoints `η=±1`; its heat carrier uses the genuine smooth heat extension. -/ -@[expose] public section +public section noncomputable section @@ -151,7 +151,7 @@ noncomputable def radialSource (C : ℝ) (d : TailData) (y0 η R : ℝ) : ℝ := profileSource C d y0 (η, edgeCoordinate (profileRadius y0 0) R) /-- The genuine backward weighted radial primitive, with the stress sign convention. -/ -noncomputable def radialStress (C : ℝ) (d : TailData) (y0 η R : ℝ) : ℝ := +@[expose] noncomputable def radialStress (C : ℝ) (d : TailData) (y0 η R : ℝ) : ℝ := backwardStress (radialSource C d y0 η) R /-- Profile stress, given by `radialStress C d y0 y.1 (profileRadius y0 y.2)`. -/ @@ -356,11 +356,11 @@ theorem stressX_jets (C : ℝ) (d : TailData) (y0 : ℝ) (n : ℕ) ring /-- The two logarithmic Gaussian factors specified in (20). -/ -noncomputable def zeta (cL a y0 X : ℝ) : ℝ := +@[expose] noncomputable def zeta (cL a y0 X : ℝ) : ℝ := FlatCutoff.edge cL (Real.log (X / a)) * FlatCutoff.edge 4 (y0 + 3 - Real.log X) /-- Edge distance, given by `min 1 (min (Real.log (X / a)) (y0 + 3 - Real.log X))`. -/ -noncomputable def edgeDistance (a y0 X : ℝ) : ℝ := +@[expose] noncomputable def edgeDistance (a y0 X : ℝ) : ℝ := min 1 (min (Real.log (X / a)) (y0 + 3 - Real.log X)) theorem stressX_zero_outside (C : ℝ) (d : TailData) (y0 : ℝ) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowRecursion.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowRecursion.lean index b426ec8309..c7e0cb9f79 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowRecursion.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowRecursion.lean @@ -35,7 +35,7 @@ explicit positive-order system, and to smooth profiles in the squared radius. All existence assertions are obtained from the actual convergent series. -/ -@[expose] public section +public section noncomputable section @@ -128,7 +128,7 @@ noncomputable def matrixOperator : Matrix (Fin 6) (Fin 6) ℂ →L[ℂ] (Vec → LinearMap.toContinuousLinearMap).toContinuousLinearEquiv.toContinuousLinearMap @[simp] theorem matrixOperator_apply (A : Matrix (Fin 6) (Fin 6) ℂ) (v : Vec) : - matrixOperator A v = A.mulVec v := rfl + matrixOperator A v = A.mulVec v := by rfl @[simp] theorem matrixOperator_toMatrix (A : Matrix (Fin 6) (Fin 6) ℂ) : LinearMap.toMatrix' (matrixOperator A).toLinearMap = A := @@ -470,7 +470,7 @@ noncomputable def xProfile (W : Field) (i : Fin 6) (p : ℝ × ℝ) : ℝ := ParametricEvenDescent.descend (realRadialComponent W i) (p.2, p.1) @[simp] theorem xProfile_apply (W : Field) (i : Fin 6) (X eta : ℝ) : - xProfile W i (X, eta) = (W (Real.sqrt X) (eta : ℂ) i).re := rfl + xProfile W i (X, eta) = (W (Real.sqrt X) (eta : ℂ) i).re := by rfl theorem realRadialComponent_smooth {R : ℝ} {U : Set ℂ} {W : Field} (hW : ContDiffOn ℝ ∞ (fun p : ℝ × ℂ => W p.1 p.2) (radialDomain R ×ˢ U)) @@ -609,13 +609,8 @@ theorem matrixRHS_first_rows {K : Type*} [Field K] (h lam C r eta : K) (b : BaseJet K) (s : SourceJet K) (w v : Fin 6 → K) : matrixRHS h lam C r eta b s w v 0 = w 4 ∧ matrixRHS h lam C r eta b s w v 1 = w 5 := by - constructor - · change dotProduct (![0, 0, 0, 0, 1, 0] : Fin 6 → K) w + - dotProduct (![0, 0, 0, 0, 0, 0] : Fin 6 → K) v + 0 = w 4 - simp [dotProduct, Fin.sum_univ_succ] - · change dotProduct (![0, 0, 0, 0, 0, 1] : Fin 6 → K) w + - dotProduct (![0, 0, 0, 0, 0, 0] : Fin 6 → K) v + 0 = w 5 - simp [dotProduct, Fin.sum_univ_succ] + exact ⟨PositiveAxisSystem.matrixRHS_zero h lam C r eta b s w v, + PositiveAxisSystem.matrixRHS_one h lam C r eta b s w v⟩ theorem RealSixSystem.first_derivative {R : ℝ} {J : Set ℝ} {h lam C : ℝ} {G : RealCoefficientData} {w : RealField} (hw : RealSixSystem R J h lam C G w) @@ -745,7 +740,7 @@ noncomputable def lowerHistoryData (h : ℝ) (n : ℕ) (phi u beta : ℕ → Inn /-- New beta, defined pointwise by `betaValue h (slowPower h n) w.2 (actualJet u w) (actualJet k w)`. -/ -noncomputable def newBeta (h : ℝ) (n : ℕ) (u k : InnerProfile) : InnerProfile := +@[expose] noncomputable def newBeta (h : ℝ) (n : ℕ) (u k : InnerProfile) : InnerProfile := fun w => betaValue h (slowPower h n) w.2 (actualJet u w) (actualJet k w) /-- The original positive-order convolution equations evaluated on the @@ -976,7 +971,7 @@ This module removes the apparent `1/X` singularities in the radial source of equation (22), using the actual differential operators from SimilarityProfile. -/ -@[expose] public section +public section noncomputable section @@ -986,7 +981,7 @@ open SimilarityProfile Set Filter open scoped BigOperators Topology ContDiff /-- Axis factor, given by `w.1 * v w`. -/ -noncomputable def axisFactor (v : InnerProfile) (w : InnerPoint) : ℝ := w.1 * v w +@[expose] noncomputable def axisFactor (v : InnerProfile) (w : InnerPoint) : ℝ := w.1 * v w theorem partialX_axisFactor {v : InnerProfile} {w : InnerPoint} (hv : DifferentiableAt ℝ v w) : @@ -1067,7 +1062,7 @@ theorem radial_advection_axisFactor {vi vj : InnerProfile} {w : InnerPoint} ring /-- Slow order, given by `2 * (k : ℝ) * h`. -/ -noncomputable def slowOrder (h : ℝ) (k : ℕ) : ℝ := 2 * (k : ℝ) * h +@[expose] noncomputable def slowOrder (h : ℝ) (k : ℕ) : ℝ := 2 * (k : ℝ) * h /-- Shifted axial as an element of `ℕ → InnerProfile | 0 => fun _ => 0 | k + 1 => Z2 h (slowOrder h k) (V k)`. -/ @@ -1090,6 +1085,7 @@ noncomputable def omega (h : ℝ) (U V : ℕ → InnerProfile) (k : ℕ) (w : In 2 * w.1 * partialX (partialX (V k)) w - shiftedAxial h V k w /-- An explicit expression for Ω_k/X with no division by X. -/ +@[expose] noncomputable def omegaDivX (h : ℝ) (U v : ℕ → InnerProfile) (k : ℕ) (w : InnerPoint) : ℝ := T h (slowOrder h k - 1) (v k) w + (∑ ij ∈ Finset.antidiagonal k, @@ -1317,10 +1313,10 @@ noncomputable def jetZ2 {K : Type*} [Field K] (h b X e : K) (j : Jet2 K) : K := (1 - e ^ 2) * jetZE h b X e j - 2 * e * X * jetZX h b X e j) / jetL h e theorem T_eq_jet (h b : ℝ) (v : InnerProfile) (w : InnerPoint) : - T h b v w = jetT h b w.1 w.2 (profileJet v w) := rfl + T h b v w = jetT h b w.1 w.2 (profileJet v w) := by rfl theorem Z_eq_jet (h b : ℝ) (v : InnerProfile) (w : InnerPoint) : - Z h b v w = jetZ h b w.1 w.2 (profileJet v w) := rfl + Z h b v w = jetZ h b w.1 w.2 (profileJet v w) := by rfl theorem Z_partials_eq_jet (h b : ℝ) {v : InnerProfile} {w : InnerPoint} (hv : ContDiffAt ℝ 2 v w) (hL : L h w.2 ≠ 0) : @@ -1541,7 +1537,7 @@ noncomputable def lowerConvolution (a b : ℕ → InnerProfile) (n : ℕ) (w : I /-- Previous omega div X as an element of `ℕ → InnerProfile | 0 => fun _ => 0 | k + 1 => omegaDivX h U v k`. -/ -noncomputable def previousOmegaDivX (h : ℝ) (U v : ℕ → InnerProfile) : ℕ → InnerProfile +@[expose] noncomputable def previousOmegaDivX (h : ℝ) (U v : ℕ → InnerProfile) : ℕ → InnerProfile | 0 => fun _ => 0 | k + 1 => omegaDivX h U v k @@ -1831,7 +1827,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1913,7 +1909,7 @@ noncomputable def realConstant (R : ℝ) (U : Set ℂ) (c : ℝ) : AxisFunction algebraMap ℝ (AxisFunction R U) c @[simp] theorem realConstant_apply (R : ℝ) (U : Set ℂ) (c : ℝ) (p : ℝ × ℂ) : - realConstant R U c p = (c : ℂ) := rfl + realConstant R U c p = (c : ℂ) := by rfl @[simp] theorem add_apply {R : ℝ} {U : Set ℂ} (F G : AxisFunction R U) (p : ℝ × ℂ) : (F + G) p = F p + G p := rfl @@ -1958,7 +1954,7 @@ noncomputable def restrict {R S : ℝ} {U : Set ℂ} (hSR : S ≤ R) real := fun r hr eta heta => F.2.real r (interval_mono hSR hr) eta heta }⟩ @[simp] theorem restrict_apply {R S : ℝ} {U : Set ℂ} (hSR : S ≤ R) - (F : AxisFunction R U) (p : ℝ × ℂ) : restrict hSR F p = F p := rfl + (F : AxisFunction R U) (p : ℝ × ℂ) : restrict hSR F p = F p := by rfl /-- Inverse as an element of `AxisFunction R U`. -/ noncomputable def inverse {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) @@ -2115,7 +2111,7 @@ noncomputable def symmetrize {R : ℝ} {U : Set ℂ} (hU : IsOpen U) rfl }⟩ /-- Profile, given by `(F (Real.sqrt p.1, (p.2 : ℂ))).re`. -/ -noncomputable def profile {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) +@[expose] noncomputable def profile {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) (p : ℝ × ℝ) : ℝ := (F (Real.sqrt p.1, (p.2 : ℂ))).re /-- Complex profile, given by `F (Real.sqrt p.1, p.2)`. -/ @@ -2284,23 +2280,23 @@ noncomputable def axialOperator {R : ℝ} {U : Set ℂ} {h : ℝ} (c : Domain R radialDerivative c.positive c.open_set F) * inverseDenominator c @[simp] theorem complexProfile_add {R : ℝ} {U : Set ℂ} (F G : AxisFunction R U) (p : ℝ × ℂ) : - complexProfile (F + G) p = complexProfile F p + complexProfile G p := rfl + complexProfile (F + G) p = complexProfile F p + complexProfile G p := by rfl @[simp] theorem complexProfile_sub {R : ℝ} {U : Set ℂ} (F G : AxisFunction R U) (p : ℝ × ℂ) : - complexProfile (F - G) p = complexProfile F p - complexProfile G p := rfl + complexProfile (F - G) p = complexProfile F p - complexProfile G p := by rfl @[simp] theorem complexProfile_mul {R : ℝ} {U : Set ℂ} (F G : AxisFunction R U) (p : ℝ × ℂ) : - complexProfile (F * G) p = complexProfile F p * complexProfile G p := rfl + complexProfile (F * G) p = complexProfile F p * complexProfile G p := by rfl @[simp] theorem complexProfile_neg {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) (p : ℝ × ℂ) : - complexProfile (-F) p = -complexProfile F p := rfl + complexProfile (-F) p = -complexProfile F p := by rfl @[simp] theorem complexProfile_pow {R : ℝ} {U : Set ℂ} (F : AxisFunction R U) (k : ℕ) (p : ℝ × ℂ) : - complexProfile (F ^ k) p = complexProfile F p ^ k := rfl + complexProfile (F ^ k) p = complexProfile F p ^ k := by rfl @[simp] theorem complexProfile_zero {R : ℝ} {U : Set ℂ} (p : ℝ × ℂ) : - complexProfile (0 : AxisFunction R U) p = 0 := rfl + complexProfile (0 : AxisFunction R U) p = 0 := by rfl @[simp] theorem complexProfile_one {R : ℝ} {U : Set ℂ} (p : ℝ × ℂ) : - complexProfile (1 : AxisFunction R U) p = 1 := rfl + complexProfile (1 : AxisFunction R U) p = 1 := by rfl @[simp] theorem complexProfile_realConstant (R : ℝ) (U : Set ℂ) (b : ℝ) (p : ℝ × ℂ) : - complexProfile (realConstant R U b) p = (b : ℂ) := rfl + complexProfile (realConstant R U b) p = (b : ℂ) := by rfl @[simp] theorem complexProfile_parameter (R : ℝ) (U : Set ℂ) (p : ℝ × ℂ) : - complexProfile (parameter R U) p = p.2 := rfl + complexProfile (parameter R U) p = p.2 := by rfl @[simp] theorem complexProfile_squaredRadius (R : ℝ) (U : Set ℂ) {X : ℝ} (hX : 0 ≤ X) (z : ℂ) : complexProfile (squaredRadius R U) (X, z) = (X : ℂ) := by change ((Real.sqrt X ^ 2 : ℝ) : ℂ) = _ @@ -2866,7 +2862,7 @@ theorem sequence_profile {core buffer : ℝ} {U : Set ℂ} {h : ℝ} (c : Domain (radius core buffer 0) U h) (hcore : 0 < core) (hbuffer : 0 < buffer) (C : ℝ) (base : Coefficient (radius core buffer 0) U) (n : ℕ) (i : Fin 5) : profile (sequence c hcore hbuffer C base n i) = profile (hierarchy c hcore hbuffer C base n i) - := rfl + := by rfl theorem sequence_zero {core buffer : ℝ} {U : Set ℂ} {h : ℝ} (c : Domain (radius core buffer 0) U h) (hcore : 0 < core) (hbuffer : 0 < buffer) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowResidualMatching.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowResidualMatching.lean index 325b508c72..c4b72b486a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowResidualMatching.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowResidualMatching.lean @@ -23,7 +23,7 @@ The stress operator is the two tangential radial operators in (24). It is not identified with the divergence of an unspecified symmetric tensor. -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ open SlowExpansionResidual open AxisymmetricFields (radialEnergy profilePoint) /-- Convert a regular radial quotient to the actual radial flux. -/ -noncomputable def ofBeta (phi axial beta pressure : ℕ → InnerProfile) : SlowProfiles where +@[expose] noncomputable def ofBeta (phi axial beta pressure : ℕ → InnerProfile) : SlowProfiles where phi := phi axial := axial flux := fun n => AxisSourceRegularity.axisFactor (beta n) @@ -299,7 +299,7 @@ theorem pairTail_bound {q h : ℝ} (hq : 0 < q) (hq1 : q ≤ 1) (hh : 0 ≤ h) _ = _ := (Finset.sum_mul _ _ _).symm /-- Transport kernel, constructed using `transportPair`. -/ -noncomputable def transportKernel (h e α : ℝ) (v u f : ℕ → InnerProfile) +@[expose] noncomputable def transportKernel (h e α : ℝ) (v u f : ℕ → InnerProfile) (w : InnerPoint) : ℕ → ℕ → ℝ := transportPair w.1 α (fun j => v j w) (fun j => u j w) (fun j => f j w) (fun j => partialX (f j) w) (fun j => Z h (e + slowOrder h j) (f j) w) @@ -368,14 +368,14 @@ theorem pressureTail_bound {q h : ℝ} (hq : 0 < q) (hq1 : q ≤ 1) (hh : 0 ≤ nlinarith /-- The change from cylindrical radius R to the regular variable X. -/ -noncomputable def radiusPoint (w : InnerPoint) : InnerPoint := (w.1 ^ 2 / 2, w.2) +@[expose] noncomputable def radiusPoint (w : InnerPoint) : InnerPoint := (w.1 ^ 2 / 2, w.2) /-- From radius, given by `F (Real.sqrt (2 * w.1), w.2)`. -/ -noncomputable def fromRadius (F : InnerProfile) (w : InnerPoint) : ℝ := +@[expose] noncomputable def fromRadius (F : InnerProfile) (w : InnerPoint) : ℝ := F (Real.sqrt (2 * w.1), w.2) /-- To radius, given by `f (radiusPoint w)`. -/ -noncomputable def toRadius (f : InnerProfile) (w : InnerPoint) : ℝ := f (radiusPoint w) +@[expose] noncomputable def toRadius (f : InnerProfile) (w : InnerPoint) : ℝ := f (radiusPoint w) /-- Swirl radius, given by `w.1 / C * toRadius f w`. -/ noncomputable def swirlRadius (C : ℝ) (f : InnerProfile) (w : InnerPoint) : ℝ := @@ -433,19 +433,20 @@ theorem primitive_stress_radial_identity {S : Set ℝ} (hS : IsOpen S) simpa only [id_eq, mul_one, Prod.eta] using he /-- Literal R²-weighted angular residual. -/ +@[expose] noncomputable def thetaDensity (h C : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := w.1 ^ 3 / C * angularCoefficient h f n (radiusPoint w) /-- Literal R-weighted axial residual. -/ -noncomputable def zDensity (h : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := +@[expose] noncomputable def zDensity (h : ℝ) (f : SlowProfiles) (n : ℕ) (w : InnerPoint) : ℝ := w.1 * axialCoefficient h f n (radiusPoint w) /-- Theta stress, given by `fromRadius (SlowStressSupport.stress 2 (thetaDensity h C f n))`. -/ -noncomputable def thetaStress (h C : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := +@[expose] noncomputable def thetaStress (h C : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := fromRadius (SlowStressSupport.stress 2 (thetaDensity h C f n)) /-- Z stress, given by `fromRadius (SlowStressSupport.stress 1 (zDensity h f n))`. -/ -noncomputable def zStress (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := +@[expose] noncomputable def zStress (h : ℝ) (f : SlowProfiles) (n : ℕ) : InnerProfile := fromRadius (SlowStressSupport.stress 1 (zDensity h f n)) theorem thetaStress_smoothAt {S : Set ℝ} (hS : IsOpen S) (h C : ℝ) @@ -588,7 +589,7 @@ theorem physicalZStress_divergence {S : Set ℝ} (hS : IsOpen S) /-- The two radial tangential operators appearing in the manuscript. They are written as an actual Cartesian vector; no unspecified tensor is used. -/ -noncomputable def tangentialStressForce (theta axial : PhysicalProfile) +@[expose] noncomputable def tangentialStressForce (theta axial : PhysicalProfile) (t : ℝ) (x : ProblemStatement.Space) : ProblemStatement.Space := let r := Real.sqrt (2 * radialEnergy x) let a := LeadingStress.radialDivergence 2 theta (profilePoint t x) @@ -979,7 +980,7 @@ abbrev PressureIndex := Sum TailIndex TailIndex /-- Pressure indices, given by `((transportIndices N).image Sum.inl) ∪ ((transportIndices N).image Sum.inr)`. -/ -noncomputable def pressureIndices (N : ℕ) : Finset PressureIndex := +@[expose] noncomputable def pressureIndices (N : ℕ) : Finset PressureIndex := ((transportIndices N).image Sum.inl) ∪ ((transportIndices N).image Sum.inr) /-- Pressure power used in slow residual matching. -/ @@ -989,6 +990,7 @@ noncomputable def pressurePower (N : ℕ) (h : ℝ) : PressureIndex → ℝ | Sum.inr (some ij) => pressureExponent h + slowOrder h (ij.1 + ij.2) /-- Pressure term used in slow residual matching. -/ +@[expose] noncomputable def pressureTerm (N : ℕ) (h C : ℝ) (f : SlowProfiles) : PressureIndex → InnerProfile | Sum.inl i => transportTerm N h 0 (-(1 / 2)) f.flux f.axial f.flux i | Sum.inr none => omegaCoefficient h f N diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowStressSupport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowStressSupport.lean index a99a239190..5a40444af8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SlowStressSupport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SlowStressSupport.lean @@ -30,7 +30,7 @@ proves that all five actual moment increments are linear, including pressure with the known previous-order radial residual retained. -/ -@[expose] public section +public section noncomputable section @@ -47,11 +47,11 @@ abbrev History := ℕ → Profile abbrev Debt := Fin 5 → ℝ /-- Cauchy, given by `PositiveAxisSystem.convolution n (fun i j => u i R * v j R)`. -/ -noncomputable def cauchy (n : ℕ) (u v : History) (R : ℝ) : ℝ := +@[expose] noncomputable def cauchy (n : ℕ) (u v : History) (R : ℝ) : ℝ := PositiveAxisSystem.convolution n (fun i j => u i R * v j R) /-- Increment, given by `Function.update u n (fun R => u n R + du R)`. -/ -noncomputable def increment (u : History) (n : ℕ) (du : Profile) : History := +@[expose] noncomputable def increment (u : History) (n : ℕ) (du : Profile) : History := Function.update u n (fun R => u n R + du R) theorem increment_lower (u : History) {n j : ℕ} (du : Profile) (hj : j < n) : @@ -73,7 +73,7 @@ theorem cauchy_increment {n : ℕ} (hn : 0 < n) (u v : History) (du dv : Profile ring /-- The actual R-pressure equation: Ω is the fixed order-(n-1) source. -/ -noncomputable def pressureGradient (n : ℕ) (e : History) (omega : Profile) (R : ℝ) : ℝ := +@[expose] noncomputable def pressureGradient (n : ℕ) (e : History) (omega : Profile) (R : ℝ) : ℝ := (cauchy n e e R - omega R) / R /-- The angular similarity coefficient in (22), reconstructed from E. -/ @@ -99,7 +99,7 @@ theorem pressureGradient_eq_X_equation (n : ℕ) (C : ℝ) (e : History) (omega field_simp /-- The five densities in (23), in the order printed there. -/ -noncomputable def rowDensity (n : ℕ) (u e : History) (omega : Profile) (R : ℝ) : Debt := +@[expose] noncomputable def rowDensity (n : ℕ) (u e : History) (omega : Profile) (R : ℝ) : Debt := ![R * u n R, R ^ 2 * e n R, pressureGradient n e omega R, R ^ 2 * cauchy n u e R, R * cauchy n u u R - R ^ 2 / 2 * pressureGradient n e omega R] @@ -108,7 +108,7 @@ noncomputable def rowDensity (n : ℕ) (u e : History) (omega : Profile) (R : noncomputable def positiveIntegral (f : Profile) : ℝ := ∫ R in Ioi (0 : ℝ), f R /-- Moments, defined pointwise by `positiveIntegral (fun R => rowDensity n u e omega R i)`. -/ -noncomputable def moments (n : ℕ) (u e : History) (omega : Profile) : Debt := +@[expose] noncomputable def moments (n : ℕ) (u e : History) (omega : Profile) : Debt := fun i => positiveIntegral (fun R => rowDensity n u e omega R i) /-- Linear density, given by `![R * du R, R ^ 2 * de R, 2 * e₀ R * de R / R, R ^ 2 * (u₀ R * de @@ -471,7 +471,7 @@ abbrev JointProfile := ℝ × ℝ → ℝ abbrev JointHistory := ℕ → JointProfile /-- Slice, defined pointwise by `f j (R, eta)`. -/ -noncomputable def slice (f : JointHistory) (eta : ℝ) : History := fun j R => f j (R, eta) +@[expose] noncomputable def slice (f : JointHistory) (eta : ℝ) : History := fun j R => f j (R, eta) /-- Joint increment, given by `Function.update u n (fun w => u n w + du w)`. -/ noncomputable def jointIncrement (u : JointHistory) (n : ℕ) (du : JointProfile) : JointHistory := @@ -527,10 +527,11 @@ theorem positiveIntegral_eq_primitive {f : Profile} {B R : ℝ} (hB : 0 ≤ B) ( /-- Joint pressure gradient, given by `pressureGradient n (slice e w.2) (fun R => omega (R, w.2)) w.1`. -/ -noncomputable def jointPressureGradient (n : ℕ) (e : JointHistory) (omega : JointProfile) +@[expose] noncomputable def jointPressureGradient (n : ℕ) (e : JointHistory) (omega : JointProfile) (w : ℝ × ℝ) : ℝ := pressureGradient n (slice e w.2) (fun R => omega (R, w.2)) w.1 /-- Pressure is recomputed from its actual radial gradient, with zero axis datum. -/ +@[expose] noncomputable def pressureHistory (n : ℕ) (e : JointHistory) (omega : JointProfile) : JointProfile := ProfileHistories.primitive (jointPressureGradient n e omega) @@ -566,7 +567,7 @@ theorem pressureHistory_exterior_of_moments {n : ℕ} {u e : JointHistory} {omeg exact congrFun (hm eta) 2 /-- Weighted axial, given by `w.1 * u w`. -/ -noncomputable def weightedAxial (u : JointProfile) (w : ℝ × ℝ) : ℝ := w.1 * u w +@[expose] noncomputable def weightedAxial (u : JointProfile) (w : ℝ × ℝ) : ℝ := w.1 * u w /-- Mass history, given by `ProfileHistories.primitive (weightedAxial u)`. -/ noncomputable def massHistory (u : JointProfile) : JointProfile := @@ -578,12 +579,12 @@ noncomputable def parameterMassHistory (u : JointProfile) : JointProfile := ProfileHistories.primitive (ProfileHistories.parameterPartial (weightedAxial u)) /-- The R-coordinate version of (21), with both histories given by actual integrals. -/ -noncomputable def fluxHistory (h lam : ℝ) (u : JointProfile) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def fluxHistory (h lam : ℝ) (u : JointProfile) (w : ℝ × ℝ) : ℝ := (w.2 * w.1 ^ 2 * u w - 2 * w.2 * (PositiveAxisSystem.dScale h + lam) * massHistory u w - PositiveAxisSystem.edge w.2 * parameterMassHistory u w) / PositiveAxisSystem.ell h w.2 /-- Radial Z as an element of `ℝ`. -/ -noncomputable def radialZ (h power : ℝ) (u : JointProfile) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def radialZ (h power : ℝ) (u : JointProfile) (w : ℝ × ℝ) : ℝ := (2 * w.2 * power * u w + PositiveAxisSystem.edge w.2 * ProfileHistories.parameterPartial u w - w.2 * w.1 * ProfileHistories.radialPartial u w) / PositiveAxisSystem.ell h w.2 @@ -1024,7 +1025,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1038,9 +1039,9 @@ abbrev Field := ℝ × ℝ → ℝ /-- History: an abbreviation for `ℕ → Field`. -/ abbrev History := ℕ → Field /-- Dr, given by `ProfileHistories.radialPartial`. -/ -noncomputable def dr := ProfileHistories.radialPartial +@[expose] noncomputable def dr := ProfileHistories.radialPartial /-- De, given by `ProfileHistories.parameterPartial`. -/ -noncomputable def de := ProfileHistories.parameterPartial +@[expose] noncomputable def de := ProfileHistories.parameterPartial /-- Region: an abbreviation for `(univ : Set ℝ) ×ˢ S`. -/ abbrev region (S : Set ℝ) := (univ : Set ℝ) ×ˢ S /-- Smooth: an abbreviation for `ContDiffOn ℝ ∞ f (region S)`. -/ @@ -1054,23 +1055,23 @@ noncomputable def exterior (B : ℝ) (S : Set ℝ) (f : Field) : Prop := noncomputable def weighted (m : ℕ) (f : Field) (w : ℝ × ℝ) : ℝ := w.1 ^ m * f w /-- Moment, given by `∫ R in (0 : ℝ)..B, R ^ m * f (R, eta)`. -/ -noncomputable def moment (B : ℝ) (m : ℕ) (f : Field) (eta : ℝ) : ℝ := +@[expose] noncomputable def moment (B : ℝ) (m : ℕ) (f : Field) (eta : ℝ) : ℝ := ∫ R in (0 : ℝ)..B, R ^ m * f (R, eta) /-- Time op, given by `(-b * f w + PositiveAxisSystem.dScale h * w.2 * de f w + w.1 / 2 * dr f w) / PositiveAxisSystem.ell h w.2`. -/ -noncomputable def timeOp (h b : ℝ) (f : Field) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def timeOp (h b : ℝ) (f : Field) (w : ℝ × ℝ) : ℝ := (-b * f w + PositiveAxisSystem.dScale h * w.2 * de f w + w.1 / 2 * dr f w) / PositiveAxisSystem.ell h w.2 /-- Axial op, given by `(2 * w.2 * b * f w + PositiveAxisSystem.edge w.2 * de f w - w.2 * w.1 * dr f w) / PositiveAxisSystem.ell h w.2`. -/ -noncomputable def axialOp (h b : ℝ) (f : Field) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def axialOp (h b : ℝ) (f : Field) (w : ℝ × ℝ) : ℝ := (2 * w.2 * b * f w + PositiveAxisSystem.edge w.2 * de f w - w.2 * w.1 * dr f w) / PositiveAxisSystem.ell h w.2 /-- Axial Op2, given by `axialOp h (b - PositiveAxisSystem.dScale h) (axialOp h b f)`. -/ -noncomputable def axialOp2 (h b : ℝ) (f : Field) : Field := +@[expose] noncomputable def axialOp2 (h b : ℝ) (f : Field) : Field := axialOp h (b - PositiveAxisSystem.dScale h) (axialOp h b f) theorem smooth_dr {S : Set ℝ} (hS : IsOpen S) {f : Field} (hf : Smooth S f) : @@ -1329,12 +1330,12 @@ theorem moment_axialOp2_zero {S : Set ℝ} (hS : IsOpen S) {f : Field} (hf : Smo (fun z hz => hs z hz B le_rfl) hm hz) heta /-- Order exponent, given by `-PositiveAxisSystem.a h + SlowExpansionResidual.slowOrder h n`. -/ -noncomputable def orderExponent (h : ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def orderExponent (h : ℝ) (n : ℕ) : ℝ := -PositiveAxisSystem.a h + SlowExpansionResidual.slowOrder h n /-- Pressure exponent, given by `-2 * PositiveAxisSystem.a h + SlowExpansionResidual.slowOrder h n`. -/ -noncomputable def pressureExponent (h : ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def pressureExponent (h : ℝ) (n : ℕ) : ℝ := -2 * PositiveAxisSystem.a h + SlowExpansionResidual.slowOrder h n theorem orderExponent_pair (h : ℝ) {i j n : ℕ} (hij : i + j = n) : @@ -1351,7 +1352,7 @@ theorem physical_product_power {q : ℝ} (hq : 0 < q) (h b c : ℝ) rw [SlowExpansionResidual.rpow_product_order hq, hij] /-- Conv, given by `∑ i ∈ Finset.range (n + 1), u i w * v (n - i) w`. -/ -noncomputable def conv (n : ℕ) (u v : History) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def conv (n : ℕ) (u v : History) (w : ℝ × ℝ) : ℝ := ∑ i ∈ Finset.range (n + 1), u i w * v (n - i) w theorem conv_eq_actual (n : ℕ) (u v : History) (w : ℝ × ℝ) : @@ -1466,7 +1467,7 @@ theorem dr_axialViscousFlux {S : Set ℝ} (hS : IsOpen S) {u : Field} (hu : Smoo ring /-- Angular weighted, constructed using `w.1`. -/ -noncomputable def angularWeighted (h : ℝ) (n : ℕ) (v u e : History) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def angularWeighted (h : ℝ) (n : ℕ) (v u e : History) (w : ℝ × ℝ) : ℝ := w.1 ^ 2 * timeOp h (orderExponent h n) (e n) w + (∑ j ∈ Finset.range (n + 1), (w.1 * v j w * dr (e (n - j)) w + v j w * e (n - j) w + @@ -1475,6 +1476,7 @@ noncomputable def angularWeighted (h : ℝ) (n : ℕ) (v u e : History) (w : ℝ w.1 ^ 2 * axialOp2 h (orderExponent h (n - 1)) (e (n - 1)) w /-- Axial weighted, constructed using `w.1`. -/ +@[expose] noncomputable def axialWeighted (h : ℝ) (n : ℕ) (v u : History) (p : Field) (w : ℝ × ℝ) : ℝ := w.1 * timeOp h (orderExponent h n) (u n) w + (∑ j ∈ Finset.range (n + 1), @@ -1775,7 +1777,7 @@ theorem axial_integral_zero {S : Set ℝ} (hS : IsOpen S) {n : ℕ} /-- The negative weighted radial primitive. The definition is zero on nonpositive radii; vanishing of the source near the axis makes this smooth. -/ -noncomputable def stress (m : ℕ) (F : Field) (w : ℝ × ℝ) : ℝ := +@[expose] noncomputable def stress (m : ℕ) (F : Field) (w : ℝ × ℝ) : ℝ := if 0 < w.1 then -ProfileHistories.primitive F w / w.1 ^ m else 0 theorem stress_of_pos (m : ℕ) (F : Field) {w : ℝ × ℝ} (hw : 0 < w.1) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothCutoffs.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothCutoffs.lean index da294bd64c..9231e925e3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothCutoffs.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothCutoffs.lean @@ -19,7 +19,7 @@ no analyticity assertion is made. The scaled cutoff and time switch are explicit functions obtained from that bump. No convergence or PDE claim is encoded here. -/ -@[expose] public section +public section noncomputable section @@ -141,7 +141,7 @@ theorem cutoff_iteratedDeriv_bounded (n : ℕ) : exact hx.trans (le_max_left _ _) /-- Scaled cutoff, defined pointwise by `cutoff (a * q)`. -/ -def scaledCutoff (a : ℝ) : ℝ → ℝ := fun q => cutoff (a * q) +@[expose] def scaledCutoff (a : ℝ) : ℝ → ℝ := fun q => cutoff (a * q) theorem scaledCutoff_contDiff (a : ℝ) : ContDiff ℝ ∞ (scaledCutoff a) := cutoff_contDiff.comp (contDiff_const.mul contDiff_id) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothFourierData.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothFourierData.lean index bd4ebfb637..9f6abe8d57 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothFourierData.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothFourierData.lean @@ -42,7 +42,7 @@ integer by its conjugate, proves that the resulting integer is nonzero using irrationality of `sqrt 2`, and bounds the conjugate explicitly. -/ -@[expose] public section +public section noncomputable section @@ -315,7 +315,7 @@ theorem graph_directions_diophantine (k : ℤ × ℤ) (hk : k ≠ 0) : · simpa only [timeSymbol_formula] using time_diophantine k.1 k.2 hmn /-- The integer matrix `[[3,1],[1,5]]` acting on a frequency. -/ -def coveringFrequency (k : ℤ × ℤ) : ℤ × ℤ := +@[expose] def coveringFrequency (k : ℤ × ℤ) : ℤ × ℤ := (3 * k.1 + k.2, k.1 + 5 * k.2) theorem coveringFrequency_injective : Function.Injective coveringFrequency := by @@ -359,7 +359,7 @@ end end -@[expose] public section +public section noncomputable section @@ -380,7 +380,7 @@ theorem weight_pos (k : Frequency) : 0 < weight k := by positivity /-- Polynomially weighted absolute summability of every order. -/ -def Rapid (a : Frequency → ℂ) : Prop := +@[expose] def Rapid (a : Frequency → ℂ) : Prop := ∀ p : ℕ, Summable (fun k => weight k ^ p * ‖a k‖) theorem Rapid.summable_norm {a : Frequency → ℂ} (ha : Rapid a) : @@ -405,28 +405,28 @@ theorem Rapid.mul_linear {a b : Frequency → ℂ} (ha : Rapid a) (C : ℝ) def omega : ℂ := 2 * Real.pi * Complex.I /-- Freq X, given by `omega * (k.1 : ℂ)`. -/ -def freqX (k : Frequency) : ℂ := omega * (k.1 : ℂ) +@[expose] def freqX (k : Frequency) : ℂ := omega * (k.1 : ℂ) /-- Freq Y, given by `omega * (k.2 : ℂ)`. -/ -def freqY (k : Frequency) : ℂ := omega * (k.2 : ℂ) +@[expose] def freqY (k : Frequency) : ℂ := omega * (k.2 : ℂ) /-- Dx, given by `ContinuousLinearMap.fst ℝ ℝ ℝ`. -/ -def dx : Plane →L[ℝ] ℝ := ContinuousLinearMap.fst ℝ ℝ ℝ +@[expose] def dx : Plane →L[ℝ] ℝ := ContinuousLinearMap.fst ℝ ℝ ℝ /-- Dy, given by `ContinuousLinearMap.snd ℝ ℝ ℝ`. -/ -def dy : Plane →L[ℝ] ℝ := ContinuousLinearMap.snd ℝ ℝ ℝ +@[expose] def dy : Plane →L[ℝ] ℝ := ContinuousLinearMap.snd ℝ ℝ ℝ /-- Lift X, given by `ContinuousLinearMap.smulRightL ℝ Plane ℂ dx`. -/ -def liftX : ℂ →L[ℝ] (Plane →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Plane ℂ dx +@[expose] def liftX : ℂ →L[ℝ] (Plane →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Plane ℂ dx /-- Lift Y, given by `ContinuousLinearMap.smulRightL ℝ Plane ℂ dy`. -/ -def liftY : ℂ →L[ℝ] (Plane →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Plane ℂ dy +@[expose] def liftY : ℂ →L[ℝ] (Plane →L[ℝ] ℂ) := ContinuousLinearMap.smulRightL ℝ Plane ℂ dy -@[simp] theorem liftX_apply (c : ℂ) (x : Plane) : liftX c x = x.1 • c := rfl -@[simp] theorem liftY_apply (c : ℂ) (x : Plane) : liftY c x = x.2 • c := rfl +@[simp] theorem liftX_apply (c : ℂ) (x : Plane) : liftX c x = x.1 • c := by rfl +@[simp] theorem liftY_apply (c : ℂ) (x : Plane) : liftY c x = x.2 • c := by rfl /-- Phase, given by `liftX (freqX k) + liftY (freqY k)`. -/ -def phase (k : Frequency) : Plane →L[ℝ] ℂ := liftX (freqX k) + liftY (freqY k) +@[expose] def phase (k : Frequency) : Plane →L[ℝ] ℂ := liftX (freqX k) + liftY (freqY k) /-- Mode, given by `Complex.exp (phase k x)`. -/ -def mode (k : Frequency) (x : Plane) : ℂ := Complex.exp (phase k x) +@[expose] def mode (k : Frequency) (x : Plane) : ℂ := Complex.exp (phase k x) theorem phase_formula (k : Frequency) (x : Plane) : phase k x = omega * ((k.1 : ℂ) * (x.1 : ℂ) + (k.2 : ℂ) * (x.2 : ℂ)) := by @@ -467,7 +467,7 @@ theorem Rapid.derivY {a : Frequency → ℂ} (ha : Rapid a) : Rapid (derivY a) : ha.mul_linear ‖omega‖ norm_freqY_le /-- Series, given by `∑' k, a k * mode k x`. -/ -def series (a : Frequency → ℂ) (x : Plane) : ℂ := ∑' k, a k * mode k x +@[expose] def series (a : Frequency → ℂ) (x : Plane) : ℂ := ∑' k, a k * mode k x theorem summable_terms {a : Frequency → ℂ} (ha : Rapid a) (x : Plane) : Summable (fun k => a k * mode k x) := by @@ -561,7 +561,7 @@ inductive Direction /-- Vector as an element of `Direction → Plane | .radial => (1, 1 - Real.sqrt 2) | .temporal => (Real.sqrt 2 - 1, 1)`. -/ -def vector : Direction → Plane +@[expose] def vector : Direction → Plane | .radial => (1, 1 - Real.sqrt 2) | .temporal => (Real.sqrt 2 - 1, 1) @@ -618,9 +618,9 @@ theorem omega_ne_zero : omega ≠ 0 := by (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) Complex.I_ne_zero /-- Multiplier, given by `(omega * (symbol d k : ℂ))⁻¹`. -/ -def multiplier (d : Direction) (k : Frequency) : ℂ := (omega * (symbol d k : ℂ))⁻¹ +@[expose] def multiplier (d : Direction) (k : Frequency) : ℂ := (omega * (symbol d k : ℂ))⁻¹ /-- Inverse coefficient, given by `multiplier d k * a k`. -/ -def inverseCoeff (d : Direction) (a : Frequency → ℂ) (k : Frequency) : ℂ := +@[expose] def inverseCoeff (d : Direction) (a : Frequency → ℂ) (k : Frequency) : ℂ := multiplier d k * a k @[simp] theorem symbol_zero (d : Direction) : symbol d 0 = 0 := by @@ -673,7 +673,7 @@ theorem coefficient_cancel (d : Direction) {a : Frequency → ℂ} (hzero : a 0 rw [← mul_assoc, mul_inv_cancel₀ hd, one_mul] /-- Directional inverse, given by `series (inverseCoeff d a)`. -/ -def directionalInverse (d : Direction) (a : Frequency → ℂ) : Plane → ℂ := +@[expose] def directionalInverse (d : Direction) (a : Frequency → ℂ) : Plane → ℂ := series (inverseCoeff d a) theorem contDiff_directionalInverse (d : Direction) {a : Frequency → ℂ} (ha : Rapid a) : @@ -716,7 +716,7 @@ local instance instTorusInverse1 : Fact ((0 : ℝ) < 1) := ⟨by norm_num⟩ abbrev Torus := UnitAddCircle × UnitAddCircle /-- Torus measure as an element of `Measure Torus`. -/ -def torusMeasure : Measure Torus := +@[expose] def torusMeasure : Measure Torus := (AddCircle.haarAddCircle : Measure UnitAddCircle).prod AddCircle.haarAddCircle instance : IsProbabilityMeasure torusMeasure := by @@ -724,7 +724,7 @@ instance : IsProbabilityMeasure torusMeasure := by infer_instance /-- Torus mode, bundling `toFun`, `continuous_toFun`. -/ -def torusMode (k : Frequency) : C(Torus, ℂ) where +@[expose] def torusMode (k : Frequency) : C(Torus, ℂ) where toFun z := fourier k.1 z.1 * fourier k.2 z.2 continuous_toFun := ((fourier k.1).continuous.comp continuous_fst).mul ((fourier k.2).continuous.comp continuous_snd) @@ -733,7 +733,8 @@ theorem norm_torusMode (k : Frequency) (z : Torus) : ‖torusMode k z‖ = 1 := simp [torusMode, fourier_apply, Circle.norm_coe] /-- Torus series, given by `∑' k, a k * torusMode k z`. -/ -def torusSeries (a : Frequency → ℂ) (z : Torus) : ℂ := ∑' k, a k * torusMode k z +@[expose] def torusSeries (a : Frequency → ℂ) (z : Torus) : ℂ := + ∑' k, a k * torusMode k z theorem mode_eq_torusMode (k : Frequency) (x : Plane) : mode k x = torusMode k ((x.1 : UnitAddCircle), (x.2 : UnitAddCircle)) := by @@ -801,7 +802,7 @@ theorem integral_torusSeries {a : Frequency → ℂ} (ha : Rapid a) : simp /-- Weighted absolute Fourier coefficient seminorm. -/ -def coeffSeminorm (p : ℕ) (a : Frequency → ℂ) : ℝ := +@[expose] def coeffSeminorm (p : ℕ) (a : Frequency → ℂ) : ℝ := ∑' k, weight k ^ p * ‖a k‖ theorem inverseCoeff_seminorm_le (d : Direction) {a : Frequency → ℂ} @@ -826,7 +827,7 @@ def coordinateCoeff (j : Bool) (a : Frequency → ℂ) : Frequency → ℂ := if j then derivY a else derivX a /-- Coordinate partial, given by `fderiv ℝ f x (if j then (0, 1) else (1, 0))`. -/ -def coordinatePartial (j : Bool) (f : Plane → ℂ) (x : Plane) : ℂ := +@[expose] def coordinatePartial (j : Bool) (f : Plane → ℂ) (x : Plane) : ℂ := fderiv ℝ f x (if j then (0, 1) else (1, 0)) /-- Coefficient word as an element of `js, a => coordinateCoeff j (coefficientWord js a)`. -/ @@ -835,7 +836,7 @@ def coefficientWord : List Bool → (Frequency → ℂ) → Frequency → ℂ | j :: js, a => coordinateCoeff j (coefficientWord js a) /-- Derivative word as an element of `js, f => coordinatePartial j (derivativeWord js f)`. -/ -def derivativeWord : List Bool → (Plane → ℂ) → Plane → ℂ +@[expose] def derivativeWord : List Bool → (Plane → ℂ) → Plane → ℂ | [], f => f | j :: js, f => coordinatePartial j (derivativeWord js f) @@ -994,7 +995,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1042,14 +1043,14 @@ theorem unitCoeff_of_hasDerivAt {f f' : ℝ → ℂ} {n : ℤ} (hn : n ≠ 0) Complex.ofReal_zero, one_mul, zero_sub, hden, one_div, inv_neg, neg_mul_neg] using h /-- Unit-periodicity in both coordinates, expressed on the universal cover. -/ -def UnitPeriodic (f : Plane → ℂ) : Prop := +@[expose] def UnitPeriodic (f : Plane → ℂ) : Prop := ∀ z : Plane, ∀ k : Frequency, f (z + ((k.1 : ℝ), (k.2 : ℝ))) = f z /-- The genuine first coordinate derivative. -/ -noncomputable def partialX (f : Plane → ℂ) (z : Plane) : ℂ := fderiv ℝ f z (1, 0) +@[expose] noncomputable def partialX (f : Plane → ℂ) (z : Plane) : ℂ := fderiv ℝ f z (1, 0) /-- X jet, given by `partialX^[p] f`. -/ -noncomputable def xJet (p : ℕ) (f : Plane → ℂ) : Plane → ℂ := partialX^[p] f +@[expose] noncomputable def xJet (p : ℕ) (f : Plane → ℂ) : Plane → ℂ := partialX^[p] f @[simp] theorem xJet_zero (f : Plane → ℂ) : xJet 0 f = f := rfl @@ -1088,7 +1089,7 @@ theorem hasDerivAt_slice {f : Plane → ℂ} {x y : ℝ} ((hasDerivAt_id x).prodMk (hasDerivAt_const x y)) /-- The actual two-dimensional Fourier coefficient, with the first coordinate integrated first. -/ -def coefficient (f : Plane → ℂ) (k : Frequency) : ℂ := +@[expose] def coefficient (f : Plane → ℂ) (k : Frequency) : ℂ := unitCoeff (fun y => unitCoeff (fun x => f (x, y)) k.1) k.2 theorem coefficient_norm_le {f : Plane → ℂ} {C : ℝ} (k : Frequency) @@ -1131,7 +1132,7 @@ theorem coefficient_decay_first {f : Plane → ℂ} (hf : ContDiff ℝ ∞ f) exact mul_le_mul_of_nonneg_left (coefficient_norm_le k hb) (pow_nonneg (norm_nonneg _) p) /-- The negative Fourier character on the unit square. -/ -def kernel (k : Frequency) (z : Plane) : ℂ := +@[expose] def kernel (k : Frequency) (z : Plane) : ℂ := fourier (-k.1) (z.1 : UnitAddCircle) * fourier (-k.2) (z.2 : UnitAddCircle) theorem kernel_continuous (k : Frequency) : Continuous (kernel k) := @@ -1164,7 +1165,8 @@ theorem integral_square_swap {f : Plane → ℂ} (hf : Continuous f) : (Set.prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) /-- Swap function, defined pointwise by `f (z.2, z.1)`. -/ -noncomputable def swapFunction (f : Plane → ℂ) : Plane → ℂ := fun z => f (z.2, z.1) +@[expose] noncomputable def swapFunction (f : Plane → ℂ) : Plane → ℂ := + fun z => f (z.2, z.1) theorem swapFunction_smooth {f : Plane → ℂ} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (swapFunction f) := hf.comp (contDiff_snd.prodMk contDiff_fst) @@ -1374,7 +1376,7 @@ theorem coefficient_seminorm_bound {f : Plane → ℂ} (hf : ContDiff ℝ ∞ f) /-! ## Identification with the actual torus Fourier coefficients -/ /-- Torus lift, given by `f ((x.1 : UnitAddCircle), (x.2 : UnitAddCircle))`. -/ -noncomputable def torusLift (f : Torus → ℂ) (x : Plane) : ℂ := +@[expose] noncomputable def torusLift (f : Torus → ℂ) (x : Plane) : ℂ := f ((x.1 : UnitAddCircle), (x.2 : UnitAddCircle)) theorem torusLift_periodic (f : Torus → ℂ) : UnitPeriodic (torusLift f) := by @@ -1516,7 +1518,7 @@ noncomputable def descend (f : Plane → ℂ) (hp : UnitPeriodic f) (z : Torus) (firstLift_periodic f hp z.1).lift z.2 @[simp] theorem descend_coe (f : Plane → ℂ) (hp : UnitPeriodic f) (x y : ℝ) : - descend f hp ((x : UnitAddCircle), (y : UnitAddCircle)) = f (x, y) := rfl + descend f hp ((x : UnitAddCircle), (y : UnitAddCircle)) = f (x, y) := by rfl theorem descend_continuous {f : Plane → ℂ} (hf : Continuous f) (hp : UnitPeriodic f) : Continuous (descend f hp) := by @@ -1532,7 +1534,7 @@ noncomputable def descendContinuous (f : Plane → ℂ) (hf : Continuous f) continuous_toFun := descend_continuous hf hp @[simp] theorem torusLift_descendContinuous (f : Plane → ℂ) (hf : Continuous f) - (hp : UnitPeriodic f) : torusLift (descendContinuous f hf hp) = f := rfl + (hp : UnitPeriodic f) : torusLift (descendContinuous f hf hp) = f := by rfl /-- Pointwise reconstruction for an arbitrary actual smooth unit-periodic function on the plane; neither rapid decay nor reconstruction is a premise. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothLoop.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothLoop.lean index 1c3119b8a2..152ba3e5fa 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothLoop.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothLoop.lean @@ -41,7 +41,7 @@ The final lemmas give explicit two-point distributions with prescribed variance. They establish finite moment feasibility, including a one-sided support bound. -/ -@[expose] public section +public section namespace NavierStokes.LoopMoments @@ -123,13 +123,13 @@ theorem required_variance_nonneg (s : Finset ι) (w t : ι → ℝ) (a m ρ : simpa only [div_mul_cancel₀ _ (ne_of_gt ha)] using hmul /-- The rephasing density relative to the old averaging parameter. -/ -def phaseDensity (a v t : ℝ) : ℝ := a * (1 + t ^ 2) / v +@[expose] def phaseDensity (a v t : ℝ) : ℝ := a * (1 + t ^ 2) / v /-- The positive first component of the loop shear. -/ -def loopA (v t : ℝ) : ℝ := v / (1 + t ^ 2) +@[expose] def loopA (v t : ℝ) : ℝ := v / (1 + t ^ 2) /-- The signed second component; this corresponds to `-b_L`. -/ -def loopC (v t : ℝ) : ℝ := v * t / (1 + t ^ 2) +@[expose] def loopC (v t : ℝ) : ℝ := v * t / (1 + t ^ 2) theorem one_add_sq_pos (t : ℝ) : 0 < 1 + t ^ 2 := by nlinarith [sq_nonneg t] @@ -353,7 +353,7 @@ end end -@[expose] public section +public section namespace NavierStokes.SmoothLoop @@ -363,7 +363,7 @@ open MeasureTheory open scoped Interval ContDiff /-- Angular average over one full turn. -/ -def angularMean (f : ℝ → ℝ) : ℝ := (∫ θ in (0 : ℝ)..(2 * Real.pi), f θ) / (2 * Real.pi) +@[expose] def angularMean (f : ℝ → ℝ) : ℝ := (∫ θ in (0 : ℝ)..(2 * Real.pi), f θ) / (2 * Real.pi) theorem period_pos : (0 : ℝ) < 2 * Real.pi := mul_pos (by norm_num) Real.pi_pos @@ -415,7 +415,7 @@ theorem angularMean_cos_sq : angularMean (fun θ => Real.cos θ ^ 2) = 1 / 2 := field_simp [Real.pi_ne_zero] /-- A smooth tilt parametrized by its mean and its (signed) amplitude. -/ -def cosineTilt (m amplitude θ : ℝ) : ℝ := m + amplitude * Real.cos θ +@[expose] def cosineTilt (m amplitude θ : ℝ) : ℝ := m + amplitude * Real.cos θ theorem cosineTilt_periodic (m amplitude : ℝ) : Function.Periodic (cosineTilt m amplitude) (2 * Real.pi) := by @@ -563,7 +563,7 @@ theorem periodic_loop_shears (t : ℝ → ℝ) (v : ℝ) /-- The normalizing angular mean in the manuscript's exponential family, using cosine instead of sine (a translation of the angular origin). -/ -def expNormalizer (s : ℝ) : ℝ := angularMean (fun θ => Real.exp (s * Real.cos θ)) +@[expose] def expNormalizer (s : ℝ) : ℝ := angularMean (fun θ => Real.exp (s * Real.cos θ)) theorem expNormalizer_pos (s : ℝ) : 0 < expNormalizer s := by apply angularMean_pos @@ -575,7 +575,7 @@ theorem expNormalizer_zero : expNormalizer 0 = 1 := by simp only [expNormalizer, zero_mul, Real.exp_zero, angularMean_const] /-- Normalized exp, given by `Real.exp (s * Real.cos θ) / expNormalizer s`. -/ -def normalizedExp (s θ : ℝ) : ℝ := Real.exp (s * Real.cos θ) / expNormalizer s +@[expose] def normalizedExp (s θ : ℝ) : ℝ := Real.exp (s * Real.cos θ) / expNormalizer s theorem normalizedExp_pos (s θ : ℝ) : 0 < normalizedExp s θ := div_pos (Real.exp_pos _) (expNormalizer_pos s) @@ -615,7 +615,7 @@ theorem normalizedExp_variance (s : ℝ) : /-- The divided exponential tilt. Its smooth extension at `p=0` is handled separately below; this expression by itself is not that extension. -/ -def expTilt (m d μ p θ : ℝ) : ℝ := m + (d / p) * (normalizedExp (μ * p) θ - 1) +@[expose] def expTilt (m d μ p θ : ℝ) : ℝ := m + (d / p) * (normalizedExp (μ * p) θ - 1) theorem expTilt_contDiff (m d μ p : ℝ) : ContDiff ℝ (∞ : WithTop ℕ∞) (expTilt m d μ p) := by @@ -659,7 +659,7 @@ theorem expTilt_projection_lower (p₁ p₂ m d μ : ℝ) (hp : p₂ ≠ 0) (hd /-- Correct value at vanishing transverse stress. Smooth dependence across `p=0` is a separate analytic obligation; only angular smoothness is proved. -/ -def extendedExpTilt (m d μ p : ℝ) : ℝ → ℝ := +@[expose] def extendedExpTilt (m d μ p : ℝ) : ℝ → ℝ := if p = 0 then cosineTilt m (d * μ) else expTilt m d μ p theorem extendedExpTilt_contDiff (m d μ p : ℝ) : @@ -707,7 +707,7 @@ structure CircleDensity where integral_one : (∫ θ in (0 : ℝ)..(2 * Real.pi), rate θ) = 1 /-- Phase map, given by `∫ x in (0 : ℝ)..θ, d.rate x`. -/ -def phaseMap (d : CircleDensity) (θ : ℝ) : ℝ := ∫ x in (0 : ℝ)..θ, d.rate x +@[expose] def phaseMap (d : CircleDensity) (θ : ℝ) : ℝ := ∫ x in (0 : ℝ)..θ, d.rate x theorem phaseMap_hasDerivAt (d : CircleDensity) (θ : ℝ) : HasDerivAt (phaseMap d) (d.rate θ) θ := by @@ -764,12 +764,12 @@ theorem phaseMap_surjective (d : CircleDensity) : Function.Surjective (phaseMap exact ⟨θ, heq⟩ /-- The phase map is an actual global homeomorphism, not an assumed inverse. -/ -def phaseHomeomorph (d : CircleDensity) : ℝ ≃ₜ ℝ := +@[expose] def phaseHomeomorph (d : CircleDensity) : ℝ ≃ₜ ℝ := (StrictMono.orderIsoOfSurjective (phaseMap d) (phaseMap_strictMono d) (phaseMap_surjective d)).toHomeomorph theorem phaseHomeomorph_apply (d : CircleDensity) (θ : ℝ) : - phaseHomeomorph d θ = phaseMap d θ := rfl + phaseHomeomorph d θ = phaseMap d θ := by rfl theorem phaseInverse_contDiff (d : CircleDensity) : ContDiff ℝ (∞ : WithTop ℕ∞) (phaseHomeomorph d).symm := by @@ -786,7 +786,7 @@ theorem phaseInverse_add_one (d : CircleDensity) (φ : ℝ) : rw [(phaseHomeomorph d).apply_symm_apply] /-- Rephase, given by `f ((phaseHomeomorph d).symm φ)`. -/ -def rephase (d : CircleDensity) (f : ℝ → ℝ) (φ : ℝ) : ℝ := +@[expose] def rephase (d : CircleDensity) (f : ℝ → ℝ) (φ : ℝ) : ℝ := f ((phaseHomeomorph d).symm φ) theorem rephase_contDiff (d : CircleDensity) (f : ℝ → ℝ) @@ -819,7 +819,7 @@ theorem integral_rephase (d : CircleDensity) (f : ℝ → ℝ) (hf : Continuous open LoopMoments in /-- Density of tilt, bundling `rate`, `smooth`, `positive`, `periodic` and the required compatibility proofs. -/ -def densityOfTilt (t : ℝ → ℝ) (a m ρ v : ℝ) +@[expose] def densityOfTilt (t : ℝ → ℝ) (a m ρ v : ℝ) (ha : 0 < a) (hv : 0 < v) (ht : ContDiff ℝ (∞ : WithTop ℕ∞) t) (hperiodic : Function.Periodic t (2 * Real.pi)) (hmean : angularMean t = m) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothMomentRepair.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothMomentRepair.lean index 79639bee5e..f4b2c6c2bb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothMomentRepair.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothMomentRepair.lean @@ -18,7 +18,7 @@ product equivalence. The smooth inverse-function theorem constructs a local solver; no solution branch or its regularity is assumed. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothParameterIntegral.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothParameterIntegral.lean index 5ebc0831b1..459467f28e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothParameterIntegral.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothParameterIntegral.lean @@ -19,7 +19,7 @@ differentiation and the currying identity for `iteratedFDeriv`; it is not an assumption on a separately supplied family of jets. -/ -@[expose] public section +public section noncomputable section @@ -34,13 +34,13 @@ variable {α H E : Type*} [MeasurableSpace α] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The genuine derivative in the parameter, with the integration variable last. -/ -def jet (F : H → α → E) (k : ℕ) (x : H) (t : α) : H [×k]→L[ℝ] E := +@[expose] def jet (F : H → α → E) (k : ℕ) (x : H) (t : α) : H [×k]→L[ℝ] E := iteratedFDeriv ℝ k (fun y => F y t) x /-- Each order has an integrable majorant on a neighborhood of each parameter. The neighborhood is uniform in the integration variable; it may depend on the order and the center. -/ -def LocallyDominated (F : H → α → E) (μ : Measure α) : Prop := +@[expose] def LocallyDominated (F : H → α → E) (μ : Measure α) : Prop := ∀ (k : ℕ) (x : H), ∃ ε : ℝ, 0 < ε ∧ ∃ bound : α → ℝ, Integrable bound μ ∧ ∀ᵐ t ∂μ, ∀ y ∈ ball x ε, ‖jet F k y t‖ ≤ bound t @@ -274,7 +274,7 @@ variable {F : ℝ → α → E} /-- One-dimensional form of the same local domination condition, using actual scalar iterated derivatives rather than multilinear maps. -/ -def LocallyDominatedDeriv (F : ℝ → α → E) (μ : Measure α) : Prop := +@[expose] def LocallyDominatedDeriv (F : ℝ → α → E) (μ : Measure α) : Prop := ∀ (k : ℕ) (x : ℝ), ∃ ε : ℝ, 0 < ε ∧ ∃ bound : α → ℝ, Integrable bound μ ∧ ∀ᵐ t ∂μ, ∀ y ∈ ball x ε, ‖iteratedDeriv k (fun z => F z t) y‖ ≤ bound t diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothPathFamily.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothPathFamily.lean index 5032d4aa6d..5225d75381 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothPathFamily.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SmoothPathFamily.lean @@ -18,7 +18,7 @@ Continuity into the supremum-norm path space follows from compact-open currying. All path derivatives are constructed from genuine parameter derivatives. -/ -@[expose] public section +public section namespace NavierStokes.SmoothPathFamily @@ -36,7 +36,7 @@ variable {a b : ℝ} /-- Canonical continuous path where the slice is continuous, zero elsewhere. Only values in the stated open parameter domain enter any theorem. -/ -noncomputable def pathFamily (F : P × ℝ → E) (p : P) : C(Icc a b, E) := by +@[expose] noncomputable def pathFamily (F : P × ℝ → E) (p : P) : C(Icc a b, E) := by classical exact if h : Continuous (fun t : Icc a b => F (p, t)) then ⟨_, h⟩ else 0 @@ -97,7 +97,7 @@ noncomputable def flipPath : C(Icc a b, P →L[ℝ] E) →L[ℝ] P →L[ℝ] C(I simpa only [one_mul] using norm_flipLinear_le g v) theorem flipPath_apply (g : C(Icc a b, P →L[ℝ] E)) (v : P) (t : Icc a b) : - flipPath (P := P) (E := E) g v t = g t v := rfl + flipPath (P := P) (E := E) g v t = g t v := by rfl /-- The key uniform differentiability theorem. Joint continuity of the actual slice derivative supplies a common remainder estimate for every time point. -/ @@ -249,7 +249,7 @@ variable [CompleteSpace E] (hab : a ≤ b) /-- The actual finite-interval ODE solution for the supplied joint coefficient and forcing families. -/ -noncomputable def odeFamily (A : P × ℝ → E →L[ℝ] E) (x₀ : P → E) +@[expose] noncomputable def odeFamily (A : P × ℝ → E →L[ℝ] E) (x₀ : P → E) (f : P × ℝ → E) (p : P) : C(Icc a b, E) := ParametricODE.solution hab (pathFamily A p) (x₀ p) (pathFamily f p) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SolenoidalDiagonal.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SolenoidalDiagonal.lean index 37b6bd4408..a14f24ac30 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SolenoidalDiagonal.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SolenoidalDiagonal.lean @@ -22,7 +22,7 @@ and divergence-free. No residual estimate or singular endpoint regularity is assumed or proved here. -/ -@[expose] public section +public section noncomputable section @@ -38,16 +38,16 @@ variable {X V : Type*} [TopologicalSpace X] [NormedAddCommGroup V] [NormedSpace ℝ V] /-- Cut the potential before applying any velocity derivative. -/ -def cutStage (a : ℕ → ℝ) (q : X → ℝ) (A : ℕ → X → V) (j : ℕ) (x : X) : V := +@[expose] def cutStage (a : ℕ → ℝ) (q : X → ℝ) (A : ℕ → X → V) (j : ℕ) (x : X) : V := SmoothCutoffs.scaledCutoff (a j) (q x) • A j x /-- The actual infinite sum; local finiteness below proves it is well behaved on the positive-scale domain. -/ -def potentialSum (a : ℕ → ℝ) (q : X → ℝ) (A : ℕ → X → V) (x : X) : V := +@[expose] def potentialSum (a : ℕ → ℝ) (q : X → ℝ) (A : ℕ → X → V) (x : X) : V := ∑' j : ℕ, cutStage a q A j x /-- Partial potential, given by `∑ j ∈ Finset.range N, cutStage a q A j x`. -/ -def partialPotential (a : ℕ → ℝ) (q : X → ℝ) (A : ℕ → X → V) +@[expose] def partialPotential (a : ℕ → ℝ) (q : X → ℝ) (A : ℕ → X → V) (N : ℕ) (x : X) : V := ∑ j ∈ Finset.range N, cutStage a q A j x @@ -195,7 +195,7 @@ open ProblemStatement /-- The constructed velocity is the actual spatial curl of the summed potential, with time held fixed by `SpatialCurl.spatialCurl`. -/ -def velocitySum (a : ℕ → ℝ) (q : SpaceTime → ℝ) (A : ℕ → VelocityField) : +@[expose] def velocitySum (a : ℕ → ℝ) (q : SpaceTime → ℝ) (A : ℕ → VelocityField) : VelocityField := SpatialCurl.spatialCurl (potentialSum a q A) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeEndpoint.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeEndpoint.lean index 3a239957d0..62f9b74b31 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeEndpoint.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeEndpoint.lean @@ -20,7 +20,7 @@ uniform in the spatial variable in the tensor norm. Closed-side smoothness is proved from these data, rather than included as a hypothesis. -/ -@[expose] public section +public section noncomputable section @@ -36,9 +36,9 @@ abbrev Space := ProblemStatement.Space abbrev SpaceTime := ProblemStatement.SpaceTime /-- Open past, given by `Iio T ×ˢ univ`. -/ -def openPast (T : ℝ) : Set SpaceTime := Iio T ×ˢ univ +@[expose] def openPast (T : ℝ) : Set SpaceTime := Iio T ×ˢ univ /-- Closed past, given by `Iic T ×ˢ univ`. -/ -def closedPast (T : ℝ) : Set SpaceTime := Iic T ×ˢ univ +@[expose] def closedPast (T : ℝ) : Set SpaceTime := Iic T ×ˢ univ theorem openPast_isOpen (T : ℝ) : IsOpen (openPast T) := isOpen_Iio.prod isOpen_univ @@ -187,7 +187,7 @@ theorem hasFDerivWithinAt_extendTrace {T : ℝ} (openPast_isOpen T) hc hdf /-- Extend every actual mixed derivative tensor by its spatial boundary trace. -/ -def extendJets (T : ℝ) (J : SpaceTime → FormalMultilinearSeries ℝ SpaceTime V) +@[expose] def extendJets (T : ℝ) (J : SpaceTime → FormalMultilinearSeries ℝ SpaceTime V) (L : Space → FormalMultilinearSeries ℝ SpaceTime V) (z : SpaceTime) : FormalMultilinearSeries ℝ SpaceTime V := fun n => extendTrace T (fun y => J y n) (fun x => L x n) z diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeGluing.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeGluing.lean index d29c889007..ca51e9876d 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeGluing.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SpacetimeGluing.lean @@ -22,7 +22,7 @@ The final interface uses the actual one-sided `iteratedDerivWithin` of time slices. Equality of full mixed derivative tensors is not an input assumption. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialBorelExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialBorelExtension.lean index 7572ea5203..924344908b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialBorelExtension.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialBorelExtension.lean @@ -18,7 +18,7 @@ includes all joint derivatives and all spatial localizations up to that degree. This gives joint smoothness without imposing global bounds on the input jets. -/ -@[expose] public section +public section attribute [local instance] FiniteDimensional.hasContDiffBump @@ -119,11 +119,12 @@ theorem template_hasCompactSupport (m j : ℕ) (a : X → V) : /-- Time scale, given by `(b • ContinuousLinearMap.fst ℝ ℝ X).prod (ContinuousLinearMap.snd ℝ ℝ X)`. -/ -def timeScale (b : ℝ) : (ℝ × X) →L[ℝ] (ℝ × X) := +@[expose] def timeScale (b : ℝ) : (ℝ × X) →L[ℝ] (ℝ × X) := (b • ContinuousLinearMap.fst ℝ ℝ X).prod (ContinuousLinearMap.snd ℝ ℝ X) omit [FiniteDimensional ℝ X] in -@[simp] theorem timeScale_apply (b : ℝ) (z : ℝ × X) : timeScale b z = (b * z.1, z.2) := rfl +@[simp] theorem timeScale_apply (b : ℝ) (z : ℝ × X) : + timeScale b z = (b * z.1, z.2) := by rfl omit [FiniteDimensional ℝ X] in theorem norm_timeScale_le {b : ℝ} (hb : 1 ≤ b) : ‖timeScale (X := X) b‖ ≤ b := by @@ -495,7 +496,7 @@ theorem extension_zero_of_coefficients_zero {x : X} (hx : ∀ j, a j x = 0) (t : smul_zero, tsum_zero] /-- Right extension, given by `extension a ha (z.1 - T, z.2)`. -/ -def rightExtension (T : ℝ) (z : ℝ × X) : V := extension a ha (z.1 - T, z.2) +@[expose] def rightExtension (T : ℝ) (z : ℝ × X) : V := extension a ha (z.1 - T, z.2) theorem rightExtension_contDiff (T : ℝ) : ContDiff ℝ ∞ (rightExtension a ha T) := (extension_contDiff a ha).comp ((contDiff_fst.sub contDiff_const).prodMk contDiff_snd) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialCurl.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialCurl.lean index ed06e6f10c..e59a0598b3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialCurl.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialCurl.lean @@ -17,7 +17,7 @@ space used in `ProblemStatement`. In particular, mixed-partial symmetry is proved from C² regularity, rather than assumed for formal derivative symbols. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ def derivativeEntry (i j : Fin 3) : (Space →L[ℝ] Space) →L[ℝ] ℝ := (EuclideanSpace.proj j).comp (ContinuousLinearMap.apply ℝ Space (coordinateVector i)) @[simp] theorem derivativeEntry_apply (i j : Fin 3) (L : Space →L[ℝ] Space) : - derivativeEntry i j L = (L (coordinateVector i)) j := rfl + derivativeEntry i j L = (L (coordinateVector i)) j := by rfl /-- The usual antisymmetric part of a Jacobian, identified with a vector. -/ def curlLinear : (Space →L[ℝ] Space) →L[ℝ] Space := @@ -53,10 +53,10 @@ def curlLinear : (Space →L[ℝ] Space) →L[ℝ] Space := simp [curlLinear, coordinateVector] /-- Curl of a potential on physical Euclidean three-space. -/ -def curl (A : Space → Space) (x : Space) : Space := curlLinear (fderiv ℝ A x) +@[expose] def curl (A : Space → Space) (x : Space) : Space := curlLinear (fderiv ℝ A x) /-- Curl taken only in space, with the physical time held fixed. -/ -def spatialCurl (A : VelocityField) : VelocityField := +@[expose] def spatialCurl (A : VelocityField) : VelocityField := fun z => curl (fun y => A (z.1, y)) z.2 /-- Actual mixed-partial symmetry, obtained from Schwarz's theorem. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialLocalization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialLocalization.lean index ad88c5df3a..3840d5bd8a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialLocalization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SpatialLocalization.lean @@ -37,7 +37,7 @@ Consequently every smoothness order is preserved. The construction agrees with the original field on an explicit cube whenever the other translates vanish. -/ -@[expose] public section +public section noncomputable section @@ -54,7 +54,7 @@ def lattice (n : Lattice) : Space := (WithLp.equiv 2 (Fin 3 → ℝ)).symm (fun i => (n i : ℝ)) @[simp] theorem lattice_apply (n : Lattice) (i : Fin 3) : - lattice n i = (n i : ℝ) := rfl + lattice n i = (n i : ℝ) := by rfl @[simp] theorem lattice_zero : lattice 0 = 0 := by ext i @@ -233,7 +233,7 @@ theorem unitSpatialPeriodsOn_periodize (f : SpaceTime → V) (times : Set ℝ) : simpa only [lattice_single] using periodize_add_lattice f t x (Pi.single i 1) /-- The open spatial cube on which other copies are excluded. -/ -def innerCube (r : ℝ) : Set Space := {x | ∀ i : Fin 3, |x i| < 1 - r} +@[expose] def innerCube (r : ℝ) : Set Space := {x | ∀ i : Fin 3, |x i| < 1 - r} /-- In this cube, a nonzero translate must be the zero lattice translate. -/ theorem translate_eq_zero_on_innerCube {r : ℝ} {f : SpaceTime → V} @@ -319,7 +319,7 @@ end end -@[expose] public section +public section namespace NavierStokes.SpatialLocalization @@ -333,7 +333,7 @@ private theorem nat_le_infty (n : ℕ) : (n : WithTop ℕ∞) ≤ ∞ := (ENat.natCast_lt_of_coe_top_le_withTop le_rfl n).le /-- Squared distance to the symmetry axis, with no square-root singularity. -/ -noncomputable def radialSquare (x : Space) : ℝ := (x 0) ^ 2 + (x 1) ^ 2 +@[expose] noncomputable def radialSquare (x : Space) : ℝ := (x 0) ^ 2 + (x 1) ^ 2 theorem radialSquare_nonneg (x : Space) : 0 ≤ radialSquare x := add_nonneg (sq_nonneg _) (sq_nonneg _) @@ -342,7 +342,7 @@ theorem radialSquare_contDiff : ContDiff ℝ ∞ radialSquare := ((projection 0).contDiff.pow 2).add ((projection 1).contDiff.pow 2) /-- A globally smooth profile in squared radius and axial position. -/ -noncomputable def cutoffProfile (p : ℝ × ℝ) : ℝ := +@[expose] noncomputable def cutoffProfile (p : ℝ × ℝ) : ℝ := SmoothCutoffs.cutoff (16 * p.1) * SmoothCutoffs.cutoff (4 * p.2) theorem cutoffProfile_contDiff : ContDiff ℝ ∞ cutoffProfile := @@ -350,7 +350,7 @@ theorem cutoffProfile_contDiff : ContDiff ℝ ∞ cutoffProfile := (SmoothCutoffs.cutoff_contDiff.comp (contDiff_const.mul contDiff_snd)) /-- The explicit spatial cutoff used in both the potential and the pressure. -/ -noncomputable def spatialCutoff (x : Space) : ℝ := +@[expose] noncomputable def spatialCutoff (x : Space) : ℝ := cutoffProfile (radialSquare x, x 2) theorem spatialCutoff_contDiff : ContDiff ℝ ∞ spatialCutoff := @@ -373,7 +373,7 @@ theorem spatialCutoff_rotation (θ : ℝ) (x : Space) : simp only [CylindricalResidual.frame_apply, AxisymmetricResidual.pack_two] /-- The closed support cylinder has radius `1/4` and height `1/2`. -/ -noncomputable def supportCylinder : Set Space := +@[expose] noncomputable def supportCylinder : Set Space := {x | radialSquare x ≤ 1 / 16 ∧ |x 2| ≤ 1 / 4} theorem isClosed_supportCylinder : IsClosed supportCylinder := @@ -466,15 +466,15 @@ theorem plateau_subset_innerCube : plateau ⊆ PeriodicLocalization.innerCube (1 linarith /-- Multiplication of the actual Cartesian potential, before any curl. -/ -noncomputable def cutPotential (A : VelocityField) : VelocityField := +@[expose] noncomputable def cutPotential (A : VelocityField) : VelocityField := fun z => spatialCutoff z.2 • A z /-- Cut pressure, defined pointwise by `spatialCutoff z.2 * p z`. -/ -noncomputable def cutPressure (p : PressureField) : PressureField := +@[expose] noncomputable def cutPressure (p : PressureField) : PressureField := fun z => spatialCutoff z.2 * p z /-- Cut velocity, given by `SpatialCurl.spatialCurl (cutPotential A)`. -/ -noncomputable def cutVelocity (A : VelocityField) : VelocityField := +@[expose] noncomputable def cutVelocity (A : VelocityField) : VelocityField := SpatialCurl.spatialCurl (cutPotential A) theorem cutPotential_supported (A : VelocityField) : @@ -688,11 +688,11 @@ theorem periodicVelocity_origin_blowup (A : VelocityField) /-- The previously constructed time switch is applied to the spatially localized fields. It is independent of the spatial variables. -/ -noncomputable def localizedVelocity (A : VelocityField) : VelocityField := +@[expose] noncomputable def localizedVelocity (A : VelocityField) : VelocityField := TimeLocalization.activatedVelocity (periodicVelocity A) /-- Localized pressure, given by `TimeLocalization.activatedPressure (periodicPressure p)`. -/ -noncomputable def localizedPressure (p : PressureField) : PressureField := +@[expose] noncomputable def localizedPressure (p : PressureField) : PressureField := TimeLocalization.activatedPressure (periodicPressure p) /-- The same time activation can be performed on the actual potential. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/SquaredPartition.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/SquaredPartition.lean index 94ef699694..17d61e3987 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/SquaredPartition.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/SquaredPartition.lean @@ -20,7 +20,7 @@ the square root of their locally finite sum of squares. Every object below is constructed; no partition-of-unity or derivative-bound hypothesis is assumed. -/ -@[expose] public section +public section noncomputable section @@ -377,7 +377,7 @@ theorem productMask_all_jet_bounds (d m : ℕ) : rescale_jet_bound (productMask_smooth 1 0) hbound δ⁻¹ (fun j => (k j : ℝ)) x /-- Log coordinate, given by `-Real.log q / Real.log 2`. -/ -def logCoordinate (q : ℝ) : ℝ := -Real.log q / Real.log 2 +@[expose] def logCoordinate (q : ℝ) : ℝ := -Real.log q / Real.log 2 theorem logCoordinate_window {q : ℝ} (hq : 0 < q) : logCoordinate q ∈ Ioo (-1 : ℝ) 1 ↔ q ∈ Ioo (1 / 2 : ℝ) 2 := by @@ -458,7 +458,7 @@ theorem integerQ_nat (n : ℕ) : integerQ (n : ℤ) = ChartScales.Q n := by simp [integerQ, ChartScales.Q, SlotColoring.dyadicQ] /-- Dyadic mask, given by `dyadicProfile (q / integerQ n)`. -/ -def dyadicMask (n : ℤ) (q : ℝ) : ℝ := dyadicProfile (q / integerQ n) +@[expose] def dyadicMask (n : ℤ) (q : ℝ) : ℝ := dyadicProfile (q / integerQ n) theorem dyadicMask_nonneg (n : ℤ) (q : ℝ) : 0 ≤ dyadicMask n q := dyadicProfile_nonneg _ @@ -581,7 +581,7 @@ theorem dyadicMask_tail_sum_sq (N : ℕ) {q : ℝ} (hq : 0 < q) (hqN : q ≤ Cha exact dyadicMask_nat_sum_sq hq' hq1' /-- Native spacing, given by `(ChartScales.S n ^ 3)⁻¹`. -/ -def nativeSpacing (n : ℕ) : ℝ := (ChartScales.S n ^ 3)⁻¹ +@[expose] def nativeSpacing (n : ℕ) : ℝ := (ChartScales.S n ^ 3)⁻¹ theorem nativeSpacing_pos {n : ℕ} (hn : 1 ≤ n) : 0 < nativeSpacing n := inv_pos.mpr (pow_pos (ChartScales.S_pos hn) _) @@ -627,7 +627,7 @@ theorem slowMask_all_jet_bounds (m : ℕ) : simpa [nativeSpacing, div_eq_mul_inv, ← pow_mul] using h /-- The manuscript's three physical-to-slow coordinate rescalings. -/ -def slowCoordinates (D : ℝ) (n : ℕ) (x : SlotColoring.Position) : SlotColoring.Position := +@[expose] def slowCoordinates (D : ℝ) (n : ℕ) (x : SlotColoring.Position) : SlotColoring.Position := fun j => x j / ChartScales.Q n ^ SlotColoring.axisExponent D j theorem slowCoordinates_smooth (D : ℝ) (n : ℕ) : ContDiff ℝ ∞ (slowCoordinates D n) := by @@ -636,6 +636,7 @@ theorem slowCoordinates_smooth (D : ℝ) (n : ℕ) : ContDiff ℝ ∞ (slowCoord exact (contDiff_apply ℝ ℝ j).div_const _ /-- Physical slow mask, given by `slowMask n k (slowCoordinates D n x)`. -/ +@[expose] def physicalSlowMask (D : ℝ) (n : ℕ) (k : SlotColoring.Grid) (x : SlotColoring.Position) : ℝ := slowMask n k (slowCoordinates D n x) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/StateReindex.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/StateReindex.lean index 6b41c29546..7430c0d3c7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/StateReindex.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/StateReindex.lean @@ -18,7 +18,7 @@ Vector directions are transported by `e.symm`. The final specialization is the existing associator from `PressureStream.Lift S` to `((ℝ × S) × Plane)`. -/ -@[expose] public section +public section noncomputable section @@ -32,7 +32,7 @@ variable {D E F : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Cylinder, bundling `toLinearEquiv`, `norm_map`. -/ -noncomputable def cylinder (e : D ≃ₗᵢ[ℝ] E) : (D × ℝ) ≃ₗᵢ[ℝ] (E × ℝ) where +@[expose] noncomputable def cylinder (e : D ≃ₗᵢ[ℝ] E) : (D × ℝ) ≃ₗᵢ[ℝ] (E × ℝ) where toLinearEquiv := e.toLinearEquiv.prodCongr (LinearEquiv.refl ℝ ℝ) norm_map' x := by change max ‖e x.1‖ ‖x.2‖ = max ‖x.1‖ ‖x.2‖ @@ -45,7 +45,7 @@ noncomputable def cylinder (e : D ≃ₗᵢ[ℝ] E) : (D × ℝ) ≃ₗᵢ[ℝ] (cylinder e).symm x = (e.symm x.1, x.2) := rfl /-- Vector, given by `ParticularWaveBounds.reindexVector e V`. -/ -noncomputable def vector (e : D ≃ₗᵢ[ℝ] E) (V : E → E) : D → D := +@[expose] noncomputable def vector (e : D ≃ₗᵢ[ℝ] E) (V : E → E) : D → D := ParticularWaveBounds.reindexVector e V theorem fderiv_pull (e : D ≃ₗᵢ[ℝ] E) (f : E → F) (x v : D) : @@ -110,7 +110,7 @@ noncomputable def context (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context virtualAxial := field e c.virtualAxial /-- Oscillation, defined pointwise by `u n (cylinder e x)`. -/ -noncomputable def oscillation (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.Oscillation E) : +@[expose] noncomputable def oscillation (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.Oscillation E) : CorrectionState.Oscillation D := fun n x => u n (cylinder e x) /-- Errors, given by `⟨oscillation e a.base, oscillation e a.gaussian, oscillation e @@ -297,7 +297,7 @@ theorem nonconstant_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficien /-- Block, bundling `velocity`, `pressure`, `frequency`, `phase` and the required compatibility proofs. -/ -noncomputable def block (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock E) : +@[expose] noncomputable def block (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock E) : CorrectionState.HarmonicBlock D where velocity n i := coefficients e (b.velocity n i) pressure n := coefficients e (b.pressure n) @@ -324,6 +324,7 @@ theorem block_pressure (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlo /-! ## The actual coefficient residual -/ /-- Frame, bundling `radius`, `radial`, `axial`, `time` and the required compatibility proofs. -/ +@[expose] noncomputable def frame (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) : HarmonicResidual.Frame D where radius := fun x => g.radius (e x) @@ -647,7 +648,7 @@ theorem context_roundtrip (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context /-! ## The same weighted classes, without loss of exponents -/ /-- Strip, given by `ParticularWaveBounds.reindexStrip e s`. -/ -noncomputable def strip (e : D ≃ₗᵢ[ℝ] E) (s : WeightedClasses.StripData E) : +@[expose] noncomputable def strip (e : D ≃ₗᵢ[ℝ] E) (s : WeightedClasses.StripData E) : WeightedClasses.StripData D := ParticularWaveBounds.reindexStrip e s theorem memClass_pull (e : D ≃ₗᵢ[ℝ] E) {s : WeightedClasses.StripData E} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/StressActivation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/StressActivation.lean index b29837fbc2..cc56f71bce 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/StressActivation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/StressActivation.lean @@ -18,7 +18,7 @@ The activation integrates damped genuine reference derivatives. Error factors are constructed from the flat primitive integral, never supplied as input. -/ -@[expose] public section +public section noncomputable section @@ -30,17 +30,17 @@ open ProfileHistories open scoped Topology ContDiff /-- Log domain, bundling `carrier`, `isOpen`, `scale_mem`. -/ -noncomputable def logDomain (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where +@[expose] noncomputable def logDomain (J : Set ℝ) (hJ : IsOpen J) : RadialDomain where carrier := univ ×ˢ J isOpen := isOpen_univ.prod hJ scale_mem := fun _ hp _ _ => ⟨mem_univ _, hp.2⟩ /-- Activation, given by `(1 - κ) * OutgoingSchedule.sigma (y / T)`. -/ -noncomputable def activation (T κ y : ℝ) : ℝ := +@[expose] noncomputable def activation (T κ y : ℝ) : ℝ := (1 - κ) * OutgoingSchedule.sigma (y / T) /-- Damping, given by `1 - activation T κ y`. -/ -noncomputable def damping (T κ y : ℝ) : ℝ := 1 - activation T κ y +@[expose] noncomputable def damping (T κ y : ℝ) : ℝ := 1 - activation T κ y theorem activation_smooth (T κ : ℝ) : ContDiff ℝ ∞ (activation T κ) := contDiff_const.mul (OutgoingSchedule.sigma_contDiff.comp (contDiff_id.div_const T)) @@ -71,11 +71,11 @@ theorem activation_zero {T : ℝ} (hT : 0 < T) (κ : ℝ) {y : ℝ} (hy : y ≤ (div_nonpos_of_nonpos_of_nonneg hy hT.le)] /-- Weighted field, defined pointwise by `activation T κ p.1 * B p`. -/ -noncomputable def weightedField (T κ : ℝ) (B : Field) : Field := +@[expose] noncomputable def weightedField (T κ : ℝ) (B : Field) : Field := fun p => activation T κ p.1 * B p /-- Weighted primitive, given by `primitive (weightedField T κ B)`. -/ -noncomputable def weightedPrimitive (T κ : ℝ) (B : Field) : Field := +@[expose] noncomputable def weightedPrimitive (T κ : ℝ) (B : Field) : Field := primitive (weightedField T κ B) theorem weightedField_smooth (T κ : ℝ) {J : Set ℝ} (hJ : IsOpen J) {B : Field} @@ -107,7 +107,7 @@ theorem weightedPrimitive_zero {T : ℝ} (hT : 0 < T) (κ : ℝ) (B : Field) _ = 0 := by simp /-- Direct integration of the reference derivative times the prescribed damping. -/ -noncomputable def controlled (T κ : ℝ) (F : Field) : Field := fun p => +@[expose] noncomputable def controlled (T κ : ℝ) (F : Field) : Field := fun p => F (0, p.2) + primitive (fun q => damping T κ q.1 * radialPartial F q) p theorem controlled_smooth (T κ : ℝ) {J : Set ℝ} (hJ : IsOpen J) {F : Field} @@ -230,11 +230,11 @@ theorem activation_flat_form {T : ℝ} (hT : 0 < T) (κ y : ℝ) : ring /-- Flat coefficient, given by `B (q.2, q.1) / stepDenominator T q.2`. -/ -noncomputable def flatCoefficient (T : ℝ) (B : Field) (q : ℝ × ℝ) : ℝ := +@[expose] noncomputable def flatCoefficient (T : ℝ) (B : Field) (q : ℝ × ℝ) : ℝ := B (q.2, q.1) / stepDenominator T q.2 /-- Division by `y e_a` is implemented by a smooth transformed integral. -/ -noncomputable def primitiveFactor (T : ℝ) (B : Field) (p : Point) : ℝ := +@[expose] noncomputable def primitiveFactor (T : ℝ) (B : Field) (p : Point) : ℝ := p.1 ^ 2 * stepDenominator T p.1 * ParametricFlatFactor.factor (T ^ 2) 0 (flatCoefficient T B) (p.2, p.1) @@ -331,14 +331,14 @@ theorem exp_sub_one (x : ℝ) : Real.exp x - 1 = x * meanExp x := by _ = _ := primitive_eq_mul_average _ _ /-- Reference angular, defined pointwise by `Real.exp (L p)`. -/ -noncomputable def referenceAngular (L : Field) : Field := fun p => Real.exp (L p) +@[expose] noncomputable def referenceAngular (L : Field) : Field := fun p => Real.exp (L p) /-- Activated angular, defined pointwise by `Real.exp (controlled T κ L p)`. -/ -noncomputable def activatedAngular (T κ : ℝ) (L : Field) : Field := +@[expose] noncomputable def activatedAngular (T κ : ℝ) (L : Field) : Field := fun p => Real.exp (controlled T κ L p) /-- Reference P1, defined pointwise by `-2 * radialPartial L p`. -/ -noncomputable def referenceP1 (L : Field) : Field := fun p => -2 * radialPartial L p +@[expose] noncomputable def referenceP1 (L : Field) : Field := fun p => -2 * radialPartial L p /-- Radius, given by `X0 * Real.exp y`. -/ -noncomputable def radius (X0 y : ℝ) : ℝ := X0 * Real.exp y +@[expose] noncomputable def radius (X0 y : ℝ) : ℝ := X0 * Real.exp y /-- Reference ns, defined pointwise by `-2 * radialPartial U p / radius X0 p.1`. -/ noncomputable def referenceNs (X0 : ℝ) (U : Field) : Field := fun p => -2 * radialPartial U p / radius X0 p.1 @@ -535,7 +535,7 @@ noncomputable def familyPrimitiveFactor (T : ℝ) (B : FamilyPoint → ℝ) theorem familyPrimitiveFactor_eq (T : ℝ) (B : FamilyPoint → ℝ) (κ y η : ℝ) : familyPrimitiveFactor T B ((κ, y), η) = - primitiveFactor T (fun p => B ((κ, p.1), p.2)) (y, η) := rfl + primitiveFactor T (fun p => B ((κ, p.1), p.2)) (y, η) := by rfl theorem familyPrimitiveFactor_smooth {T : ℝ} (hT : 0 < T) {J : Set ℝ} (hJ : IsOpen J) {B : FamilyPoint → ℝ} @@ -571,7 +571,7 @@ inductive HistoryRow | mass | angular | transport | energy | pressure /-- These are the integrands used by `ProfileHistories.Profiles`. -/ -noncomputable def radialDensity : HistoryRow → ℝ → ℝ → ℝ → ℝ +@[expose] noncomputable def radialDensity : HistoryRow → ℝ → ℝ → ℝ → ℝ | .mass, _, _, u => u | .angular, x, f, _ => 2 * x * f | .transport, x, f, u => u * (2 * x * f) @@ -579,11 +579,11 @@ noncomputable def radialDensity : HistoryRow → ℝ → ℝ → ℝ → ℝ | .pressure, _, f, _ => f ^ 2 /-- The Jacobian `X` converts the physical radial histories to log time. -/ -noncomputable def logDensity (X0 : ℝ) (f U : Field) (r : HistoryRow) : Field := +@[expose] noncomputable def logDensity (X0 : ℝ) (f U : Field) (r : HistoryRow) : Field := fun p => radius X0 p.1 * radialDensity r (radius X0 p.1) (f p) (U p) /-- The initial row values are shared; every subsequent value is recomputed. -/ -noncomputable def logHistory (X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) +@[expose] noncomputable def logHistory (X0 : ℝ) (initial : HistoryRow → ℝ → ℝ) (f U : Field) (r : HistoryRow) : Field := fun p => initial r p.2 + primitive (logDensity X0 f U r) p @@ -836,12 +836,12 @@ theorem history_parameter_jet_bounds {T : ℝ} (hT : 0 < T) (X0 : ℝ) /-! ## Identification with the physical `ProfileHistories` integrals -/ /-- Profile density, defined pointwise by `radialDensity r p.1 (P.f p) (P.U p)`. -/ -noncomputable def profileDensity {D : RadialDomain} (P : Profiles D) +@[expose] noncomputable def profileDensity {D : RadialDomain} (P : Profiles D) (r : HistoryRow) : Field := fun p => radialDensity r p.1 (P.f p) (P.U p) /-- Profile history as an element of `HistoryRow → Field | .mass => P.M | .angular => P.I | .transport => P.J | .energy => P.S | .pressure => P.pressure`. -/ -noncomputable def profileHistory {D : RadialDomain} (P : Profiles D) : HistoryRow → Field +@[expose] noncomputable def profileHistory {D : RadialDomain} (P : Profiles D) : HistoryRow → Field | .mass => P.M | .angular => P.I | .transport => P.J @@ -850,7 +850,7 @@ noncomputable def profileHistory {D : RadialDomain} (P : Profiles D) : HistoryRo /-- Profile initial as an element of `HistoryRow → ℝ → ℝ | .pressure => P.pressure0 | _ => fun _ => 0`. -/ -noncomputable def profileInitial {D : RadialDomain} (P : Profiles D) : HistoryRow → ℝ → ℝ +@[expose] noncomputable def profileInitial {D : RadialDomain} (P : Profiles D) : HistoryRow → ℝ → ℝ | .pressure => P.pressure0 | _ => fun _ => 0 @@ -888,7 +888,7 @@ theorem profileHistory_hasDerivAt {D : RadialDomain} (P : Profiles D) (r : Histo exact profileHistory_eq_initial_add_primitive P r (x, p.2) /-- Log pullback, defined pointwise by `F (radius X0 p.1, p.2)`. -/ -noncomputable def logPullback (X0 : ℝ) (F : Field) : Field := +@[expose] noncomputable def logPullback (X0 : ℝ) (F : Field) : Field := fun p => F (radius X0 p.1, p.2) theorem radius_hasDerivAt (X0 y : ℝ) : HasDerivAt (radius X0) (radius X0 y) y := @@ -962,9 +962,9 @@ open ReferencePath variable (N : ReferencePath.Input) /-- Ref log, given by `ReferencePath.continuation δ N.logF`. -/ -noncomputable def refLog (δ : ℝ) : Field := ReferencePath.continuation δ N.logF +@[expose] noncomputable def refLog (δ : ℝ) : Field := ReferencePath.continuation δ N.logF /-- Ref axial, given by `ReferencePath.continuation δ N.logU`. -/ -noncomputable def refAxial (δ : ℝ) : Field := ReferencePath.continuation δ N.logU +@[expose] noncomputable def refAxial (δ : ℝ) : Field := ReferencePath.continuation δ N.logU theorem refLog_smooth {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) : ContDiffOn ℝ ∞ (refLog N δ) (logDomain parameterInterval parameterInterval_open).carrier := @@ -976,13 +976,13 @@ theorem refAxial_smooth {δ : ℝ} (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) : /-- F, defined pointwise by `if p.1 ≤ N.endpoint then N.refF δ p else activatedAngular T κ (refLog N δ) (N.logTime p.1, p.2)`. -/ -noncomputable def f (T κ δ : ℝ) : Field := fun p => +@[expose] noncomputable def f (T κ δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.refF δ p else activatedAngular T κ (refLog N δ) (N.logTime p.1, p.2) /-- U, defined pointwise by `if p.1 ≤ N.endpoint then N.refU δ p else controlled T κ (refAxial N δ) (N.logTime p.1, p.2)`. -/ -noncomputable def U (T κ δ : ℝ) : Field := fun p => +@[expose] noncomputable def U (T κ δ : ℝ) : Field := fun p => if p.1 ≤ N.endpoint then N.refU δ p else controlled T κ (refAxial N δ) (N.logTime p.1, p.2) @@ -1072,7 +1072,7 @@ theorem f_pos (T κ δ : ℝ) {p : Point} (hp : p ∈ N.radialDomain.carrier) (h exact activatedAngular_pos T κ _ _ /-- These are the actual radial pressure and lag inputs, recomputed from ACT. -/ -noncomputable def histories {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) +@[expose] noncomputable def histories {T δ : ℝ} (hT : 0 < T) (hδ : 0 < δ) (hδT : 2 * δ < rampLimit) (κ : ℝ) (P0 : ℝ → ℝ) (hP0 : ContDiff ℝ ∞ P0) : Profiles N.radialDomain where f := f N T κ δ @@ -1216,20 +1216,20 @@ end FromReference /-! ## Exact shear identities and cancellation of the common damping -/ /-- Actual P1, given by `-2 * deriv (fun y => Real.log (activatedAngular T κ L (y, p.2))) p.1`. -/ -noncomputable def actualP1 (T κ : ℝ) (L : Field) (p : Point) : ℝ := +@[expose] noncomputable def actualP1 (T κ : ℝ) (L : Field) (p : Point) : ℝ := -2 * deriv (fun y => Real.log (activatedAngular T κ L (y, p.2))) p.1 /-- Velocity, given by `Real.sqrt (2 * radius X0 p.1) * f p`. -/ -noncomputable def velocity (X0 : ℝ) (f : Field) (p : Point) : ℝ := +@[expose] noncomputable def velocity (X0 : ℝ) (f : Field) (p : Point) : ℝ := Real.sqrt (2 * radius X0 p.1) * f p /-- Reference P2, given by `-2 * radialPartial U p / velocity X0 (referenceAngular L) p`. -/ -noncomputable def referenceP2 (X0 : ℝ) (L U : Field) (p : Point) : ℝ := +@[expose] noncomputable def referenceP2 (X0 : ℝ) (L U : Field) (p : Point) : ℝ := -2 * radialPartial U p / velocity X0 (referenceAngular L) p /-- Actual P2, given by `-2 * deriv (fun y => controlled T κ U (y, p.2)) p.1 / velocity X0 (activatedAngular T κ L) p`. -/ -noncomputable def actualP2 (T κ X0 : ℝ) (L U : Field) (p : Point) : ℝ := +@[expose] noncomputable def actualP2 (T κ X0 : ℝ) (L U : Field) (p : Point) : ℝ := -2 * deriv (fun y => controlled T κ U (y, p.2)) p.1 / velocity X0 (activatedAngular T κ L) p @@ -1238,11 +1238,11 @@ noncomputable def shearSlope (T κ X0 : ℝ) (L U : Field) (p : Point) : ℝ := actualP2 T κ X0 L U p / actualP1 T κ L p /-- Shear size, given by `actualP1 T κ L p + actualP2 T κ X0 L U p ^ 2 / actualP1 T κ L p`. -/ -noncomputable def shearSize (T κ X0 : ℝ) (L U : Field) (p : Point) : ℝ := +@[expose] noncomputable def shearSize (T κ X0 : ℝ) (L U : Field) (p : Point) : ℝ := actualP1 T κ L p + actualP2 T κ X0 L U p ^ 2 / actualP1 T κ L p /-- Reference size, given by `referenceP1 L p + referenceP2 X0 L U p ^ 2 / referenceP1 L p`. -/ -noncomputable def referenceSize (X0 : ℝ) (L U : Field) (p : Point) : ℝ := +@[expose] noncomputable def referenceSize (X0 : ℝ) (L U : Field) (p : Point) : ℝ := referenceP1 L p + referenceP2 X0 L U p ^ 2 / referenceP1 L p theorem damping_ge (T κ y : ℝ) (hκ : κ ≤ 1) : κ ≤ damping T κ y := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TailCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TailCone.lean index 2f87b9f21b..8779e3e91f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TailCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TailCone.lean @@ -32,7 +32,7 @@ integral. Bounds use the first angular coefficient jet supplied by the proved reset witness; no parity or second-jet estimate is assumed. -/ -@[expose] public section +public section noncomputable section @@ -730,7 +730,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2251,7 +2251,7 @@ theorem actual_finite_ratio_bound {d : TailData} {K : ℝ} (w : ResetWitness d K /-! ## Cone quantities of the actual corrected profile -/ /-- Actual A, given by `1 - 2 * deriv (fun t => Real.log (OutgoingHistories.E w (t, eta))) y`. -/ -noncomputable def actualA {d : TailData} {K : ℝ} (w : ResetWitness d K) (y eta : ℝ) : ℝ := +@[expose] noncomputable def actualA {d : TailData} {K : ℝ} (w : ResetWitness d K) (y eta : ℝ) : ℝ := 1 - 2 * deriv (fun t => Real.log (OutgoingHistories.E w (t, eta))) y /-- Actual bs, given by `2 * deriv (fun t => OutgoingHistories.U d Amp (t, eta)) y / diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TailEnergyBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TailEnergyBounds.lean index bd7411b029..57482ddd85 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TailEnergyBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TailEnergyBounds.lean @@ -19,7 +19,7 @@ The long release plateau is retained in the estimates; bounding the release only by its terminal slope would give an incorrect uniformity claim in `h`. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail namespace NavierStokes.TailEnergyBounds /-- Energy density, given by `Real.exp y * finalAngular d (y, eta) ^ 2`. -/ -noncomputable def energyDensity (d : TailData) (eta y : ℝ) : ℝ := +@[expose] noncomputable def energyDensity (d : TailData) (eta y : ℝ) : ℝ := Real.exp y * finalAngular d (y, eta) ^ 2 theorem energyDensity_pos (d : TailData) (eta y : ℝ) : @@ -351,7 +351,7 @@ theorem energyDensity_integrable_postPulse (d : TailData) (eta : ℝ) : ⟨(energyDensity_continuous d eta).integrableOn_Ioc, energyDensity_integrable_release d eta⟩ /-- Post pulse energy, given by `∫ y in Ioi d.core.endpoint, energyDensity d eta y`. -/ -noncomputable def postPulseEnergy (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def postPulseEnergy (d : TailData) (eta : ℝ) : ℝ := ∫ y in Ioi d.core.endpoint, energyDensity d eta y theorem postPulseEnergy_nonneg (d : TailData) (eta : ℝ) : 0 ≤ postPulseEnergy d eta := @@ -624,7 +624,7 @@ theorem normalized_deriv_postPulseEnergy_le (d : TailData) (eta : ℝ) (heta : e /-- Normalized post pulse energy, given by `d.core.lam * postPulseEnergy d eta / (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2)`. -/ -noncomputable def normalizedPostPulseEnergy (d : TailData) (eta : ℝ) : ℝ := +@[expose] noncomputable def normalizedPostPulseEnergy (d : TailData) (eta : ℝ) : ℝ := d.core.lam * postPulseEnergy d eta / (Real.exp d.core.pulseStart * pulseAmplitude d.core ^ 2 * shape eta ^ 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TailGaugePotential.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TailGaugePotential.lean index 5105f17b9b..0d3af5cba2 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TailGaugePotential.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TailGaugePotential.lean @@ -18,7 +18,7 @@ heat exterior the resulting potential is a finite, anchored heat primitive, which has a smooth extension through the terminal central plane. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean index 70dd4583bd..f0af4ba90f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean @@ -20,7 +20,7 @@ has a solution on the whole prescribed interval, without a small-time assumption. Continuous linear coefficients provide the required bound. -/ -@[expose] public section +public section namespace NavierStokes.TangentODE @@ -54,7 +54,8 @@ namespace IntervalSystem variable (v : IntervalSystem E) /-- Proj, given by `projIcc v.left v.right v.ordered`. -/ -def proj : ℝ → Icc v.left v.right := projIcc v.left v.right v.ordered +@[expose] def proj : ℝ → Icc v.left v.right := + projIcc v.left v.right v.ordered theorem proj_of_mem {t : ℝ} (ht : t ∈ Icc v.left v.right) : (v.proj t : ℝ) = t := by simp only [proj, projIcc_of_mem v.ordered ht] @@ -64,7 +65,7 @@ theorem proj_coe (t : Icc v.left v.right) : v.proj t = t := projIcc_val _ _ theorem continuous_proj : Continuous v.proj := continuous_projIcc /-- Compose field, given by `v.field (v.proj t) (f (v.proj t))`. -/ -def composeField (f : C(Icc v.left v.right, E)) (t : ℝ) : E := +@[expose] def composeField (f : C(Icc v.left v.right, E)) (t : ℝ) : E := v.field (v.proj t) (f (v.proj t)) theorem continuous_composeField (f : C(Icc v.left v.right, E)) : @@ -94,7 +95,7 @@ def next (f : C(Icc v.left v.right, E)) : C(Icc v.left v.right, E) := (v.hasDerivAt_integralCurve f t).continuousAt)).comp continuous_subtype_val⟩ theorem next_apply (f : C(Icc v.left v.right, E)) (t : Icc v.left v.right) : - v.next f t = v.initial + ∫ s in v.left..t, v.composeField f s := rfl + v.next f t = v.initial + ∫ s in v.left..t, v.composeField f s := by rfl theorem dist_next_apply_le_of_le {f g : C(Icc v.left v.right, E)} {n : ℕ} {d : ℝ} (h : ∀ t, dist (f t) (g t) ≤ (v.lip * |t.1 - v.left|) ^ n / n ! * d) @@ -234,7 +235,7 @@ theorem linear_solution_unique {a b : ℝ} (hab : a ≤ b) variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] /-- Continuous linear part of equation (27), including the moving-normal term. -/ -def projectedOperator (n n' : H) (K : H →L[ℝ] H) (δ : ℝ) : H →L[ℝ] H := +@[expose] def projectedOperator (n n' : H) (K : H →L[ℝ] H) (δ : ℝ) : H →L[ℝ] H := -K + (((innerSL ℝ n).comp K - innerSL ℝ n').smulRight ((⟪n, n⟫_ℝ)⁻¹ • n)) - δ • ContinuousLinearMap.id ℝ H diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TangentProjection.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TangentProjection.lean index 973e2d6e96..41ba59b5f7 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TangentProjection.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TangentProjection.lean @@ -21,7 +21,7 @@ Appendix A.3. The vectors are in an arbitrary real inner-product space; existence, size, or differentiated estimates of a pulse is made here. -/ -@[expose] public section +public section namespace NavierStokes.TangentProjection @@ -33,14 +33,14 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] open scoped InnerProductSpace /-- Orthogonal projection onto the hyperplane perpendicular to `n`, for `n ≠ 0`. -/ -def tangentProj (n f : E) : E := f - (⟪n, f⟫_ℝ / ⟪n, n⟫_ℝ) • n +@[expose] def tangentProj (n f : E) : E := f - (⟪n, f⟫_ℝ / ⟪n, n⟫_ℝ) • n /-- The right-hand side of equation (27), with the viscous coefficient `δ`. -/ -def projectedRhs (n n' t Kt f : E) (δ : ℝ) : E := +@[expose] def projectedRhs (n n' t Kt f : E) (δ : ℝ) : E := -Kt + ((⟪n, Kt⟫_ℝ - ⟪n', t⟫_ℝ) / ⟪n, n⟫_ℝ) • n - δ • t - tangentProj n f /-- The real coefficient of the normal vector canceled by pressure. -/ -def pressureCoefficient (n n' t Kt f : E) : ℝ := +@[expose] def pressureCoefficient (n n' t Kt f : E) : ℝ := (⟪n, Kt⟫_ℝ - ⟪n', t⟫_ℝ + ⟪n, f⟫_ℝ) / ⟪n, n⟫_ℝ theorem tangentProj_normal {n : E} (hn : n ≠ 0) (f : E) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalMeanUpdate.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalMeanUpdate.lean index c37e3375fc..dd99526d8c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalMeanUpdate.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalMeanUpdate.lean @@ -20,7 +20,7 @@ map, Fourier coefficients, and uniqueness for the zero-mean periodic directional equation. Band factors remain explicit. -/ -@[expose] public section +public section noncomputable section @@ -166,7 +166,7 @@ theorem coverLinear_apply (z : Plane) : coverLinear z = TorusAverages.covering z /-- Cover map as an element of `ℕ → Plane →L[ℝ] Plane | 0 => ContinuousLinearMap.id ℝ Plane | n + 1 => coverLinear.comp (coverMap n)`. -/ -noncomputable def coverMap : ℕ → Plane →L[ℝ] Plane +@[expose] noncomputable def coverMap : ℕ → Plane →L[ℝ] Plane | 0 => ContinuousLinearMap.id ℝ Plane | n + 1 => coverLinear.comp (coverMap n) @@ -229,7 +229,7 @@ theorem timeDerivative_coverMap {f : Plane → ℂ} (hf : ContDiff ℝ ∞ f) (n rfl /-- Absolute inverse, given by `directionalInverse .temporal (SmoothFourierData.coefficient f)`. -/ -noncomputable def absoluteInverse (f : Plane → ℂ) : Plane → ℂ := +@[expose] noncomputable def absoluteInverse (f : Plane → ℂ) : Plane → ℂ := directionalInverse .temporal (SmoothFourierData.coefficient f) theorem absoluteInverse_smooth {f : Plane → ℂ} (hf : ContDiff ℝ ∞ f) @@ -297,7 +297,7 @@ theorem absoluteInverse_coverMap {f : Plane → ℂ} (hf : ContDiff ℝ ∞ f) absoluteInverse_zeroMean hf hp, smul_zero] /-- The native chart prefactor, including the physical velocity rescaling. -/ -noncomputable def chartPrefactor (h : ℝ) (n : ℕ) : ℝ := +@[expose] noncomputable def chartPrefactor (h : ℝ) (n : ℕ) : ℝ := (ChartScales.timeCoefficient h n)⁻¹ theorem chartPrefactor_pos (h : ℝ) (n : ℕ) : 0 < chartPrefactor h n := @@ -374,6 +374,7 @@ section CenteredSource variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Remove exactly the auxiliary torus average, retaining every slow parameter. -/ +@[expose] noncomputable def centered (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := f z - PressureStream.torusAverage f (z.1, z.2.1) @@ -459,7 +460,7 @@ theorem sourceToFamily_mean (f : PressureStream.Lift S → ℝ) (p : ℝ × S) : ← intervalIntegral.integral_ofReal] /-- The actual normalized temporal Fourier inverse on a real joint family. -/ -noncomputable def temporalInverse (f : PressureStream.Lift S → ℝ) +@[expose] noncomputable def temporalInverse (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := (SmoothFamilyTorusInverse.inverse .temporal (sourceToFamily f) ((z.1, z.2.1), z.2.2)).re @@ -564,12 +565,12 @@ theorem temporalInverse_coverMap {f : PressureStream.Lift S → ℝ} zero_mul, sub_zero] /-- The desired angular or axial mean increment in its native chart. -/ -noncomputable def desiredIncrement (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) +@[expose] noncomputable def desiredIncrement (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := -chartPrefactor h n * temporalInverse (centered f) z /-- The actual fast-time derivative, including its chart coefficient. -/ -noncomputable def fastDerivative (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) +@[expose] noncomputable def fastDerivative (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := ChartScales.timeCoefficient h n * PressureStream.graphDz ((0 : S), vector .temporal) f z @@ -705,13 +706,13 @@ noncomputable def axialPotential (d a b M : ℝ) (v : Plane) (h : ℝ) (n : ℕ) /-- Axial update, given by `PressureStream.streamGamma (PressureStream.physicalSpeed d M) ((0 : S), v) (axialPotential d a b M v h n f)`. -/ -noncomputable def axialUpdate (d a b M : ℝ) (v : Plane) (h : ℝ) (n : ℕ) +@[expose] noncomputable def axialUpdate (d a b M : ℝ) (v : Plane) (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) : PressureStream.Lift S → ℝ := PressureStream.streamGamma (PressureStream.physicalSpeed d M) ((0 : S), v) (axialPotential d a b M v h n f) /-- Radial update, given by `PressureStream.streamBeta w (axialPotential d a b M v h n f)`. -/ -noncomputable def radialUpdate (d a b M : ℝ) (v : Plane) (w : S × Plane) (h : ℝ) (n : ℕ) +@[expose] noncomputable def radialUpdate (d a b M : ℝ) (v : Plane) (w : S × Plane) (h : ℝ) (n : ℕ) (f : PressureStream.Lift S → ℝ) : PressureStream.Lift S → ℝ := PressureStream.streamBeta w (axialPotential d a b M v h n f) @@ -1075,8 +1076,12 @@ theorem meanClass_centered {a b cL cR : ℝ} (hfc : ∀ n, ContDiff ℝ ∞ (f n)) (hp : ∀ n, PressureStream.TorusPeriodicLift (f n)) : WeightedClasses.MeanClass (WeightedRadialPrimitive.logStripData a b cL cR ha hcL hcR ε R hε hεone hR) α - (fun n => centered (f n)) := - UniformFourierAlias.meanClass_realCenterSource ha hcL hcR ε R hε hεone hR hf hfc hp + (fun n => centered (f n)) := by + have heq (n : ℕ) : UniformFourierAlias.realCenterSource (f n) = centered (f n) := by + funext z + exact UniformFourierAlias.realCenterSource_apply (f n) z + simpa only [heq] using + UniformFourierAlias.meanClass_realCenterSource ha hcL hcR ε R hε hεone hR hf hfc hp /-- The complete desired temporal update preserves the original exponent in every band, including the initial bands. No inverse estimate is assumed. -/ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalStateCoherence.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalStateCoherence.lean index af6e355dfe..fbb76e655b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalStateCoherence.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TemporalStateCoherence.lean @@ -17,7 +17,7 @@ stream construction, retained alias and recomputed pressure are the literal operators used by `VariableGaugeMean.temporalStageState`. -/ -@[expose] public section +public section namespace NavierStokes.TemporalStateCoherence diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCompensation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCompensation.lean index 34cc886754..254158d5a3 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCompensation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCompensation.lean @@ -18,7 +18,7 @@ amplitude leaves one fixed quadratic map, so its smooth inverse and estimates are uniform in the transverse parameter. -/ -@[expose] public section +public section noncomputable section @@ -41,11 +41,11 @@ structure Patch where ordered : left < right /-- Lower, given by `P.left + (2 * (j.val : ℝ) + 1) * (P.right - P.left) / 7`. -/ -noncomputable def lower (P : Patch) (j : Fin 3) : ℝ := +@[expose] noncomputable def lower (P : Patch) (j : Fin 3) : ℝ := P.left + (2 * (j.val : ℝ) + 1) * (P.right - P.left) / 7 /-- Upper, given by `P.left + (2 * (j.val : ℝ) + 2) * (P.right - P.left) / 7`. -/ -noncomputable def upper (P : Patch) (j : Fin 3) : ℝ := +@[expose] noncomputable def upper (P : Patch) (j : Fin 3) : ℝ := P.left + (2 * (j.val : ℝ) + 2) * (P.right - P.left) / 7 theorem lower_gt_left (P : Patch) (j : Fin 3) : P.left < lower P j := by @@ -104,7 +104,7 @@ theorem bumps_disjoint (P : Patch) (i j : Fin 3) (hij : i ≠ j) (x : ℝ) : linarith [hjx.2, hix.1] /-- Correction, given by `∑ j, c j * bump P j x`. -/ -noncomputable def correction (P : Patch) (c : Coeff) (x : ℝ) : ℝ := +@[expose] noncomputable def correction (P : Patch) (c : Coeff) (x : ℝ) : ℝ := ∑ j, c j * bump P j x theorem correction_contDiff (P : Patch) (c : Coeff) : @@ -226,7 +226,7 @@ theorem correction_square_moment (P : Patch) (s : ℝ) (c : Coeff) : exact (weighted_bump_sq_integrable P s j).const_mul _ /-- Slope, given by `-1 / 2 - lam`. -/ -noncomputable def slope (lam : ℝ) : ℝ := -1 / 2 - lam +@[expose] noncomputable def slope (lam : ℝ) : ℝ := -1 / 2 - lam /-- Powers, given by `![-1 + slope lam, slope lam, 1 / 2]`. -/ noncomputable def powers (lam : ℝ) : Coeff := ![-1 + slope lam, slope lam, 1 / 2] @@ -240,7 +240,7 @@ noncomputable def linearMatrix (P : Patch) (lam : ℝ) : Matrix (Fin 3) (Fin 3) LocalizedMomentRepair.matrix (powers lam) (lower P) (upper P) theorem linearMatrix_entry (P : Patch) (lam : ℝ) (i j : Fin 3) : - linearMatrix P lam i j = bumpMoment P (powers lam i) j := rfl + linearMatrix P lam i j = bumpMoment P (powers lam i) j := by rfl /-- The three powers are those of pressure, energy, and angular momentum. -/ theorem linearMatrix_det_ne_zero (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) : @@ -265,7 +265,7 @@ noncomputable def linearEquiv (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) : (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero P lam hlam)), Matrix.one_mulVec] } theorem linearEquiv_apply (P : Patch) (lam : ℝ) (hlam : 0 ≤ lam) (c : Coeff) : - linearEquiv P lam hlam c = (linearMatrix P lam).mulVec c := rfl + linearEquiv P lam hlam c = (linearMatrix P lam).mulVec c := by rfl /-- Quadratic bilin, bundling `toFun`, `map_add`, `map_smul`, `map_add` and the required compatibility proofs. -/ @@ -296,10 +296,10 @@ noncomputable def quadraticCLM (P : Patch) : Coeff →L[ℝ] Coeff →L[ℝ] Coe theorem quadraticCLM_apply (P : Patch) (c d : Coeff) : quadraticCLM P c d = ![(1 / 2) * ∑ j, squareMoment P (-1) j * c j * d j, - (1 / 2) * ∑ j, squareMoment P 0 j * c j * d j, 0] := rfl + (1 / 2) * ∑ j, squareMoment P 0 j * c j * d j, 0] := by rfl /-- Base profile, given by `x ^ slope lam`. -/ -noncomputable def baseProfile (lam x : ℝ) : ℝ := x ^ slope lam +@[expose] noncomputable def baseProfile (lam x : ℝ) : ℝ := x ^ slope lam /-- One half of a squared-profile change, against a power weight. -/ noncomputable def weightedChange (P : Patch) (lam : ℝ) (c : Coeff) (w x : ℝ) : ℝ := @@ -492,7 +492,7 @@ noncomputable def correctionCLM (P : Patch) (x : ℝ) : Coeff →L[ℝ] ℝ := RingHom.id_apply] } theorem correctionCLM_apply (P : Patch) (x : ℝ) (c : Coeff) : - correctionCLM P x c = correction P c x := rfl + correctionCLM P x c = correction P c x := by rfl theorem correction_parameter_deriv (P : Patch) {c : ℝ → Coeff} {η : ℝ} (hc : DifferentiableAt ℝ c η) (x : ℝ) : @@ -522,11 +522,11 @@ theorem composed_solver_deriv_bound {g : Coeff → Coeff} {ε C : ℝ} (mul_le_mul_of_nonneg_right (hbound (d η) hmem) (norm_nonneg _)) /-- The physical profile uses the actual additive bumps at scale `R`. -/ -noncomputable def physicalProfile (P : Patch) (lam R a : ℝ) (c : Coeff) (X : ℝ) : ℝ := +@[expose] noncomputable def physicalProfile (P : Patch) (lam R a : ℝ) (c : Coeff) (X : ℝ) : ℝ := a * (baseProfile lam (X / R) + correction P c (X / R)) /-- Clean profile, given by `a * baseProfile lam (X / R)`. -/ -noncomputable def cleanProfile (lam R a X : ℝ) : ℝ := a * baseProfile lam (X / R) +@[expose] noncomputable def cleanProfile (lam R a X : ℝ) : ℝ := a * baseProfile lam (X / R) /-- Physical moments as an element of `Coeff`. -/ noncomputable def physicalMoments (P : Patch) (lam R a : ℝ) (c : Coeff) : Coeff := @@ -613,7 +613,7 @@ theorem physicalMoments_cancel (P : Patch) (lam R a : ℝ) (hR : 0 < R) (ha : 0 · exact cancel (R * Real.sqrt (2 * R) * a) (d 2) (by positivity) /-- Radial normalization, independent of the shaped-wait amplitude. -/ -noncomputable def scaledDebt (R : ℝ) (d : Coeff) : Coeff := +@[expose] noncomputable def scaledDebt (R : ℝ) (d : Coeff) : Coeff := ![d 0, d 1 / R, d 2 / (R * Real.sqrt (2 * R))] /-- Amplitude factors, given by `![(2 * a ^ 2)⁻¹, (2 * a ^ 2)⁻¹, a⁻¹]`. -/ @@ -621,7 +621,7 @@ noncomputable def amplitudeFactors (a : ℝ) : Coeff := ![(2 * a ^ 2)⁻¹, (2 * a ^ 2)⁻¹, a⁻¹] /-- Amplitude debt, given by `-(amplitudeFactors a * v)`. -/ -noncomputable def amplitudeDebt (a : ℝ) (v : Coeff) : Coeff := -(amplitudeFactors a * v) +@[expose] noncomputable def amplitudeDebt (a : ℝ) (v : Coeff) : Coeff := -(amplitudeFactors a * v) theorem normalizedDebt_eq (R a : ℝ) (d : Coeff) : normalizedDebt R a d = amplitudeDebt a (scaledDebt R d) := by @@ -694,7 +694,7 @@ theorem amplitudeDebt_bounds {U S : Set ℝ} (hU : IsOpen U) (hSU : S ⊆ U) /-- The value, normalized radial derivative, and parameter derivative of the actual additive profile perturbation are all small. -/ -noncomputable def FirstJetBound (P : Patch) (a : ℝ → ℝ) (c : ℝ → Coeff) +@[expose] noncomputable def FirstJetBound (P : Patch) (a : ℝ → ℝ) (c : ℝ → Coeff) (η L : ℝ) : Prop := ∀ x : ℝ, |a η * correction P (c η) x| ≤ L ∧ |a η * deriv (correction P (c η)) x| ≤ L ∧ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCone.lean index 4c4f93b975..7fd4da21e6 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalCone.lean @@ -20,7 +20,7 @@ not with a compact subset of a physical chart. The compensation witness is arbitrary throughout. -/ -@[expose] public section +public section noncomputable section @@ -31,6 +31,7 @@ open scoped Topology ContDiff namespace NavierStokes.TerminalCone /-- The clock at which the heat switch is complete. -/ +@[expose] noncomputable def terminalStart (d : OutgoingTail.TailData) : ℝ := OutgoingTail.tailStart d + 1 / 2 /-- Normalization, given by `TerminalPressure.releasedNormalization F.data @@ -43,11 +44,11 @@ noncomputable def shift (F : OutgoingProfile.Profile) (XR : ℝ) : ℝ := Real.log (OutgoingDilation.switchRadius F XR) - 1 / 5 /-- Edge distance, given by `OutgoingTail.tailEnd F.data - y`. -/ -noncomputable def edgeDistance (F : OutgoingProfile.Profile) (y : ℝ) : ℝ := +@[expose] noncomputable def edgeDistance (F : OutgoingProfile.Profile) (y : ℝ) : ℝ := OutgoingTail.tailEnd F.data - y /-- Profile point, given by `(eta, edgeDistance F y)`. -/ -noncomputable def profilePoint (F : OutgoingProfile.Profile) (y eta : ℝ) : ℝ × ℝ := +@[expose] noncomputable def profilePoint (F : OutgoingProfile.Profile) (y eta : ℝ) : ℝ × ℝ := (eta, edgeDistance F y) /-- The release time and release amplitude depend on the core schedule before @@ -69,7 +70,7 @@ noncomputable def releaseBudget (c : OutgoingSchedule.Parameters) : ℝ := /-- The order is explicit: these bounds use only the already fixed core schedule, then constrain `h`; the entrance radius is chosen afterwards. -/ -def SmallTail (d : OutgoingTail.TailData) : Prop := +@[expose] def SmallTail (d : OutgoingTail.TailData) : Prop := d.h ≤ 1 / 4 ∧ d.h ≤ 1 / (1 + releaseBudget d.core) theorem releaseAmplitude_eq (d : OutgoingTail.TailData) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalEdgeFactor.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalEdgeFactor.lean index d0f71f4950..ab42456242 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalEdgeFactor.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalEdgeFactor.lean @@ -22,7 +22,7 @@ and to `OutgoingTail.tailShape`. A positive global physical chart keeps the parameter coefficients smooth without assuming a normalized stress factor. -/ -@[expose] public section +public section noncomputable section @@ -178,7 +178,7 @@ theorem denominator_contDiff (d : TailData) : ContDiff ℝ ∞ (denominator d) : (contDiff_const.sub (contDiff_const.mul ((chartEta_contDiff d).pow 2))) /-- A radial logarithmic distance, with its outer radius kept explicit. -/ -noncomputable def edgeCoordinate (R r : ℝ) : ℝ := -2 * Real.log (r / R) +@[expose] noncomputable def edgeCoordinate (R r : ℝ) : ℝ := -2 * Real.log (r / R) theorem edgeCoordinate_hasDerivAt {R r : ℝ} (hR : 0 < R) (hr : 0 < r) : HasDerivAt (edgeCoordinate R) (-2 / r) r := by @@ -228,7 +228,7 @@ theorem integrableOn_Ioi_of_eventually_zero {f : ℝ → ℝ} {r : ℝ} (hr : 0 /-- Radial flat density, given by `(2 / u) * FlatPrimitive.integrand c j a (edgeCoordinate R u)`. -/ -noncomputable def radialFlatDensity (c : ℝ) (j : ℕ) (a : ℝ → ℝ) (R u : ℝ) : ℝ := +@[expose] noncomputable def radialFlatDensity (c : ℝ) (j : ℕ) (a : ℝ → ℝ) (R u : ℝ) : ℝ := (2 / u) * FlatPrimitive.integrand c j a (edgeCoordinate R u) theorem radialFlatDensity_integrable {c R r : ℝ} (hc : 0 < c) (hR : 0 < R) (hr : 0 < r) @@ -794,12 +794,12 @@ theorem eta_sq_le_one {η : ℝ} (hη : η ∈ Icc (-1 : ℝ) 1) : η ^ 2 ≤ 1 (show 0 ≤ 1 - η by linarith [hη.2])] /-- Profile S, given by `Real.exp (y0 + 3 - x)`. -/ -noncomputable def profileS (y0 x : ℝ) : ℝ := Real.exp (y0 + 3 - x) +@[expose] noncomputable def profileS (y0 x : ℝ) : ℝ := Real.exp (y0 + 3 - x) /-- Profile radius, given by `Real.sqrt (2 * Real.exp (y0 + 3)) * Real.exp (-x / 2)`. -/ -noncomputable def profileRadius (y0 x : ℝ) : ℝ := +@[expose] noncomputable def profileRadius (y0 x : ℝ) : ℝ := Real.sqrt (2 * Real.exp (y0 + 3)) * Real.exp (-x / 2) /-- Profile Z, given by `2 * (1 - y.1 ^ 2) / profileS y0 y.2`. -/ -noncomputable def profileZ (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileZ (y0 : ℝ) (y : ℝ × ℝ) : ℝ := 2 * (1 - y.1 ^ 2) / profileS y0 y.2 theorem profileS_pos (y0 x : ℝ) : 0 < profileS y0 x := Real.exp_pos _ @@ -829,12 +829,12 @@ theorem profileZ_nonneg (y0 : ℝ) {y : ℝ × ℝ} (hη : y.1 ^ 2 ≤ 1) : /-- Profile carrier, given by `C * (profileS y0 y.2) ^ RadialHeatProfile.spatialExponent (1 + d.h) * HeatProfileExtension.extension (1 + d.h) (profileZ y0 y)`. -/ -noncomputable def profileCarrier (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileCarrier (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := C * (profileS y0 y.2) ^ RadialHeatProfile.spatialExponent (1 + d.h) * HeatProfileExtension.extension (1 + d.h) (profileZ y0 y) /-- Profile carrier radial, constructed using `C`. -/ -noncomputable def profileCarrierRadial (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileCarrierRadial (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := C * (profileS y0 y.2) ^ (RadialHeatProfile.spatialExponent (1 + d.h) - 1) * (RadialHeatProfile.spatialExponent (1 + d.h) * HeatProfileExtension.extension (1 + d.h) (profileZ y0 y) - @@ -867,7 +867,7 @@ theorem profileCarrier_pos {C : ℝ} (hC : 0 < C) (d : TailData) (y0 : ℝ) (HeatProfileExtension.extension_pos (by linarith [d.h_pos]) (profileZ_nonneg y0 hη)) /-- Profile chi, given by `2 * η / profileL d η`. -/ -noncomputable def profileChi (d : TailData) (η : ℝ) : ℝ := 2 * η / profileL d η +@[expose] noncomputable def profileChi (d : TailData) (η : ℝ) : ℝ := 2 * η / profileL d η theorem profileChi_contDiff (d : TailData) : ContDiff ℝ ∞ (profileChi d) := (contDiff_const.mul contDiff_id).div (profileL_contDiff d) (fun η => (profileL_pos d η).ne') @@ -1428,7 +1428,7 @@ theorem profileTilt_tendsto_zero {C : ℝ} (hC : 0 < C) (d : TailData) (y0 : ℝ simpa only [profileTilt_zero] using he /-- The actual velocity shear ratio for the terminal product `K f_o`. -/ -noncomputable def profileSpeed (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileSpeed (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := 1 - profileRadius y0 y.2 * profileCarrierRadial C d y0 y / profileCarrier C d y0 y - 2 * tailShapeDeriv d (3 - y.2) / tailShape d (3 - y.2) @@ -1516,7 +1516,7 @@ theorem profileSpeed_zero_gt_two {C : ℝ} (hC : 0 < C) (d : TailData) (y0 : ℝ linarith /-- Profile cone gap, given by `2 - (profileSpeed C d y0 y - 2) * profileTilt C d y0 y ^ 2`. -/ -noncomputable def profileConeGap (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileConeGap (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := 2 - (profileSpeed C d y0 y - 2) * profileTilt C d y0 y ^ 2 theorem profileConeGap_zero (C : ℝ) (d : TailData) (y0 η : ℝ) : @@ -1573,6 +1573,7 @@ theorem profile_uniform_cone {C : ℝ} (hC : 0 < C) (d : TailData) (y0 : ℝ) : /-! ## The shear formula is the derivative of the actual profile velocity -/ /-- Profile angular velocity, given by `profileCarrier C d y0 y * tailShape d (3 - y.2)`. -/ +@[expose] noncomputable def profileAngularVelocity (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := profileCarrier C d y0 y * tailShape d (3 - y.2) @@ -1738,11 +1739,11 @@ theorem profileSwirlCoefficient_pos {C : ℝ} (hC : 0 < C) (d : TailData) (y0 : /-- Profile P, given by `profileSpeed C d y0 y + profileAngularStress C d y0 y / profileSwirlCoefficient C d y0 y`. -/ -noncomputable def profileP (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileP (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := profileSpeed C d y0 y + profileAngularStress C d y0 y / profileSwirlCoefficient C d y0 y /-- Profile J, given by `profileAxialStress C d y0 y / profileSwirlCoefficient C d y0 y`. -/ -noncomputable def profileJ (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := +@[expose] noncomputable def profileJ (C : ℝ) (d : TailData) (y0 : ℝ) (y : ℝ × ℝ) : ℝ := profileAxialStress C d y0 y / profileSwirlCoefficient C d y0 y /-- Applying the exact true-cone equivalence to the actual terminal stress, diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalHistoryBridge.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalHistoryBridge.lean index 2489ef1fcf..ef71e58698 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalHistoryBridge.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalHistoryBridge.lean @@ -29,7 +29,7 @@ smoothness and parameter differentiation of those integrals then give the mixed identities on the open physical parameter band. -/ -@[expose] public section +public section noncomputable section @@ -327,7 +327,7 @@ end end -@[expose] public section +public section noncomputable section @@ -451,7 +451,7 @@ noncomputable def normalization (F : Profile) (XR : ℝ) : ℝ := TerminalPressure.releasedNormalization F.data (OutgoingDilation.switchRadius F XR) /-- Shift, given by `Real.log (OutgoingDilation.switchRadius F XR) - 1/5`. -/ -noncomputable def shift (F : Profile) (XR : ℝ) : ℝ := +@[expose] noncomputable def shift (F : Profile) (XR : ℝ) : ℝ := Real.log (OutgoingDilation.switchRadius F XR) - 1/5 /-- Physical angular, given by `SimilarityProfile.pullback F.data.h @@ -551,7 +551,7 @@ noncomputable def forwardTheta (F : Profile) (XR : ℝ) (c : ℝ → Coeff) /-- Forward axial, given by `XR * Real.exp p.1 * HeatSwitchCone.Ns F XR c p / (CoordinateAlgebra.L F.data.h p.2 * Real.sqrt (2 * XR * Real.exp p.1))`. -/ -noncomputable def forwardAxial (F : Profile) (XR : ℝ) (c : ℝ → Coeff) +@[expose] noncomputable def forwardAxial (F : Profile) (XR : ℝ) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := XR * Real.exp p.1 * HeatSwitchCone.Ns F XR c p / (CoordinateAlgebra.L F.data.h p.2 * Real.sqrt (2 * XR * Real.exp p.1)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalPressure.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalPressure.lean index 04239f0233..235a507469 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalPressure.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalPressure.lean @@ -19,7 +19,7 @@ improper radial integral. Its regularity is obtained by separating the pure heat tail from a compact taper correction. -/ -@[expose] public section +public section noncomputable section @@ -31,7 +31,7 @@ namespace NavierStokes.TerminalPressure /-- The exponent of the physical angular heat amplitude. -/ -noncomputable def amplitudeExponent (h : ℝ) : ℝ := 1 / 2 + h +@[expose] noncomputable def amplitudeExponent (h : ℝ) : ℝ := 1 / 2 + h /-- Derivatives with respect to the actual scaled heat parameter. -/ noncomputable def heatJet (h : ℝ) (n : ℕ) (ν v : ℝ) : ℝ := @@ -42,7 +42,7 @@ noncomputable def heatJetBound (h : ℝ) (n : ℕ) : ℝ := 2 ^ n * ParametricHeatTail.heatJetBound h n /-- Pressure weight, given by `v ^ (-2 * amplitudeExponent h - 1)`. -/ -noncomputable def pressureWeight (h v : ℝ) : ℝ := +@[expose] noncomputable def pressureWeight (h v : ℝ) : ℝ := v ^ (-2 * amplitudeExponent h - 1) /-- Heat pressure jet, given by `pressureWeight h v * ParametricHeatTail.jetProduct (fun i => @@ -52,7 +52,7 @@ noncomputable def heatPressureJet (h : ℝ) (n : ℕ) (ν v : ℝ) : ℝ := (fun i => heatJet h i ν v) n /-- Dimensionless pure-heat pressure integral, including the zero-diffusion endpoint. -/ -noncomputable def heatPressureFactor (h ν : ℝ) : ℝ := +@[expose] noncomputable def heatPressureFactor (h ν : ℝ) : ℝ := ∫ v in Ioi (1 : ℝ), pressureWeight h v * RadialHeatProfile.profile (1 + h) (2 * ν / v) ^ 2 theorem heatJet_zero (h ν v : ℝ) : heatJet h 0 ν v = RadialHeatProfile.profile (1 + h) (2 * ν / v) @@ -170,7 +170,7 @@ theorem heatPressureFactor_contDiffOn {h : ℝ} (hh : 0 < h) : /-- Heat density, given by `pressureWeight h v * RadialHeatProfile.profile (1 + h) (2 * ν / v) ^ 2`. -/ -noncomputable def heatDensity (h ν v : ℝ) : ℝ := +@[expose] noncomputable def heatDensity (h ν v : ℝ) : ℝ := pressureWeight h v * RadialHeatProfile.profile (1 + h) (2 * ν / v) ^ 2 /-- Tapered density, given by `heatDensity h p.1 v * f (p.2 + Real.log v) ^ 2`. -/ @@ -864,7 +864,7 @@ theorem logScaleDerivative_bound {h : ℝ} {p : SimilarityProfile.PhysicalPoint} /-! ## The actual outgoing taper and its terminal edge estimate -/ /-- Outgoing taper, given by `OutgoingTail.tailShape d (y - y0)`. -/ -noncomputable def outgoingTaper (d : OutgoingTail.TailData) (y0 y : ℝ) : ℝ := +@[expose] noncomputable def outgoingTaper (d : OutgoingTail.TailData) (y0 y : ℝ) : ℝ := OutgoingTail.tailShape d (y - y0) theorem outgoingTaper_contDiff (d : OutgoingTail.TailData) (y0 : ℝ) : @@ -892,7 +892,7 @@ theorem outgoingTaper_plateau (d : OutgoingTail.TailData) (y0 y : ℝ) (hy : y0 /-- Outgoing pressure, given by `TerminalStress.canonicalPressure (TerminalStress.swirlCoefficient C d.h (outgoingTaper d y0))`. -/ -noncomputable def outgoingPressure (C : ℝ) (d : OutgoingTail.TailData) (y0 : ℝ) : +@[expose] noncomputable def outgoingPressure (C : ℝ) (d : OutgoingTail.TailData) (y0 : ℝ) : SimilarityProfile.PhysicalProfile := TerminalStress.canonicalPressure (TerminalStress.swirlCoefficient C d.h (outgoingTaper d y0)) @@ -1103,7 +1103,7 @@ theorem canonicalPressure_partialZ_contDiffAt (C : ℝ) {h Y : ℝ} {f : ℝ → /-- Since `ds = r dr`, this is the cylindrical backward primitive with weight `r`. It uses the actual axial derivative of the canonical pressure. -/ -noncomputable def axialBackwardStress (C h : ℝ) (f : ℝ → ℝ) (t z r : ℝ) : ℝ := +@[expose] noncomputable def axialBackwardStress (C h : ℝ) (f : ℝ → ℝ) (t z r : ℝ) : ℝ := (∫ s in Ioi (r ^ 2 / 2), SimilarityProfile.partialZ (TerminalStress.canonicalPressure (TerminalStress.swirlCoefficient C h f)) (t, (s, z))) / r @@ -1343,7 +1343,7 @@ theorem outgoingAmplitude_suppressed (d : OutgoingTail.TailData) : /-- The normalization is exactly the physical carrier normalization in `ParametricHeatTail.physicalEdit_heat_carrier`. -/ -noncomputable def releasedNormalization (d : OutgoingTail.TailData) (K : ℝ) : ℝ := +@[expose] noncomputable def releasedNormalization (d : OutgoingTail.TailData) (K : ℝ) : ℝ := HeatTailEdit.outgoingAmplitude d * K ^ amplitudeExponent d.h theorem releasedNormalization_pos (d : OutgoingTail.TailData) {K : ℝ} (hK : 0 < K) : diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalStress.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalStress.lean index ed6ae2a6f7..7c68409f99 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalStress.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TerminalStress.lean @@ -21,7 +21,7 @@ stress is defined independently of the separate global moment condition that identifies it with an axis-based stress primitive. -/ -@[expose] public section +public section noncomputable section @@ -37,18 +37,18 @@ theorem contDiffAt_deriv {f : ℝ → ℝ} {r : ℝ} {m n : WithTop ℕ∞} (hf.fderiv_right hmn).clm_apply contDiffAt_const /-- Radial-viscosity terms left after cancelling the heat equation for `K`. -/ -noncomputable def viscousResidual (K f : ℝ → ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def viscousResidual (K f : ℝ → ℝ) (r : ℝ) : ℝ := -K r * (deriv (deriv f) r + deriv f r / r) - 2 * deriv K r * deriv f r /-- Boundary, given by `r ^ 2 * K r * deriv f r`. -/ noncomputable def boundary (K f : ℝ → ℝ) (r : ℝ) : ℝ := r ^ 2 * K r * deriv f r /-- Correction, given by `(r * K r - r ^ 2 * deriv K r) * deriv f r`. -/ -noncomputable def correction (K f : ℝ → ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def correction (K f : ℝ → ℝ) (r : ℝ) : ℝ := (r * K r - r ^ 2 * deriv K r) * deriv f r /-- Backward stress, given by `(∫ u in Ioi r, u ^ 2 * R u) / r ^ 2`. -/ -noncomputable def backwardStress (R : ℝ → ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def backwardStress (R : ℝ → ℝ) (r : ℝ) : ℝ := (∫ u in Ioi r, u ^ 2 * R u) / r ^ 2 theorem boundary_hasDerivAt {K f : ℝ → ℝ} {r : ℝ} (hr : r ≠ 0) @@ -159,7 +159,7 @@ theorem backwardStress_ge_mass {K f T : ℝ → ℝ} {r c : ℝ} (hr : 0 < r) _ ≤ _ := le_add_of_nonneg_left hb0 /-- The heat carrier with the manuscript's arbitrary fixed normalization. -/ -noncomputable def heatAmplitude (C a t r : ℝ) : ℝ := +@[expose] noncomputable def heatAmplitude (C a t r : ℝ) : ℝ := C * RadialHeatProfile.radialProfile a (1 - t) r theorem heatAmplitude_pos {C a t r : ℝ} (hC : 0 < C) (ha : 1 < a) @@ -241,10 +241,10 @@ abbrev PhysicalPoint := SimilarityProfile.PhysicalPoint abbrev PhysicalProfile := SimilarityProfile.PhysicalProfile /-- Radius point, given by `(t, (r ^ 2 / 2, z))`. -/ -noncomputable def radiusPoint (t r z : ℝ) : PhysicalPoint := (t, (r ^ 2 / 2, z)) +@[expose] noncomputable def radiusPoint (t r z : ℝ) : PhysicalPoint := (t, (r ^ 2 / 2, z)) /-- Radial slice, given by `G (radiusPoint t r z)`. -/ -noncomputable def radialSlice (G : PhysicalProfile) (t z : ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def radialSlice (G : PhysicalProfile) (t z : ℝ) (r : ℝ) : ℝ := G (radiusPoint t r z) theorem radiusPoint_contDiff (t z : ℝ) : ContDiff ℝ ∞ (fun r => radiusPoint t r z) := @@ -307,7 +307,7 @@ theorem angular_radial_operator {F : PhysicalProfile} {t r z : ℝ} (hr : r ≠ field_simp [hr]; ring /-- The terminal flattening factor is an actual function of logarithmic `X`. -/ -noncomputable def flattening (h : ℝ) (f : ℝ → ℝ) (p : PhysicalPoint) : ℝ := +@[expose] noncomputable def flattening (h : ℝ) (f : ℝ → ℝ) (p : PhysicalPoint) : ℝ := f (Real.log (SimilarityProfile.X h p)) theorem flattening_contDiffAt {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) @@ -385,11 +385,11 @@ theorem terminal_radial_residual (C : ℝ) {h t r z : ℝ} (hh : 0 < h) (hh1 : h exact he /-- The angular heat carrier expressed in the regular coordinate `s`. -/ -noncomputable def physicalHeat (C a : ℝ) (p : PhysicalPoint) : ℝ := +@[expose] noncomputable def physicalHeat (C a : ℝ) (p : PhysicalPoint) : ℝ := C * RadialHeatProfile.spatialProfile a (1 - p.1) p.2.1 /-- The regular Cartesian swirl coefficient: the physical angular velocity is `r F`. -/ -noncomputable def swirlCoefficient (C h : ℝ) (f : ℝ → ℝ) (p : PhysicalPoint) : ℝ := +@[expose] noncomputable def swirlCoefficient (C h : ℝ) (f : ℝ → ℝ) (p : PhysicalPoint) : ℝ := physicalHeat C (1 + h) p * flattening h f p / Real.sqrt (2 * p.2.1) theorem physicalHeat_contDiffAt (C : ℝ) {a : ℝ} (ha : 1 < a) {p : PhysicalPoint} @@ -445,7 +445,7 @@ theorem regular_leading_residual {F : PhysicalProfile} {t r z : ℝ} (hr : r ≠ ring /-- Leading residual, constructed using `heatAmplitude`. -/ -noncomputable def leadingResidual (C h : ℝ) (f : ℝ → ℝ) (t r z : ℝ) : ℝ := +@[expose] noncomputable def leadingResidual (C h : ℝ) (f : ℝ → ℝ) (t r z : ℝ) : ℝ := heatAmplitude C (1 + h) t r * (deriv f (Real.log (SimilarityProfile.X h (radiusPoint t r z))) / (SimilarityProfile.q h (radiusPoint t r z) * @@ -477,7 +477,7 @@ theorem swirlCoefficient_leading_residual (C : ℝ) {h t r z : ℝ} exact terminal_radial_residual C hh hh1 ht hr hf /-- Canonical pressure, normalized at infinity, in the regular coordinate. -/ -noncomputable def canonicalPressure (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := +@[expose] noncomputable def canonicalPressure (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := -∫ s in Ioi p.2.1, F (p.1, (s, p.2.2)) ^ 2 theorem neg_tailIntegral_hasDerivAt {g : ℝ → ℝ} {a b : ℝ} (hab : a < b) @@ -512,7 +512,7 @@ theorem canonicalPressure_partialS {F : PhysicalProfile} {p : PhysicalPoint} {a /-- Residual coefficient, given by `partialT F p - 2 * p.2.1 * partialS (partialS F) p - 4 * partialS F p - partialZ (partialZ F) p`. -/ -noncomputable def residualCoefficient (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := +@[expose] noncomputable def residualCoefficient (F : PhysicalProfile) (p : PhysicalPoint) : ℝ := partialT F p - 2 * p.2.1 * partialS (partialS F) p - 4 * partialS F p - partialZ (partialZ F) p /-- The actual Cartesian residual of a purely angular velocity. -/ @@ -680,7 +680,7 @@ noncomputable def timeDenominator (h t z : ℝ) : ℝ := /-- Time residual, given by `heatAmplitude C (1 + h) t r * deriv f (Real.log (SimilarityProfile.X h (radiusPoint t r z))) / timeDenominator h t z`. -/ -noncomputable def timeResidual (C h : ℝ) (f : ℝ → ℝ) (t z r : ℝ) : ℝ := +@[expose] noncomputable def timeResidual (C h : ℝ) (f : ℝ → ℝ) (t z r : ℝ) : ℝ := heatAmplitude C (1 + h) t r * deriv f (Real.log (SimilarityProfile.X h (radiusPoint t r z))) / timeDenominator h t z @@ -757,7 +757,7 @@ theorem timeResidual_lower_comparison {C h t r u R z : ℝ} exact div_nonneg (mul_nonneg (by norm_num) hfpos) hu.le /-- Terminal stress, given by `backwardStress (fun u => leadingResidual C h f t u z) r`. -/ -noncomputable def terminalStress (C h : ℝ) (f : ℝ → ℝ) (t z r : ℝ) : ℝ := +@[expose] noncomputable def terminalStress (C h : ℝ) (f : ℝ → ℝ) (t z r : ℝ) : ℝ := backwardStress (fun u => leadingResidual C h f t u z) r theorem flattening_radial_contDiffAt {h t r z : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TimeLocalization.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TimeLocalization.lean index 2964103043..63bfe9afd8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TimeLocalization.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TimeLocalization.lean @@ -23,7 +23,7 @@ This transformation does not construct the incoming singular fields or a smooth global force extension. It supplies the time-switch portion of Proposition 11.4. -/ -@[expose] public section +public section noncomputable section @@ -36,11 +36,11 @@ namespace NavierStokes.TimeLocalization open ProblemStatement SmoothCutoffs ResidualCalculus /-- Activated velocity, defined pointwise by `timeSwitch z.1 • u z`. -/ -def activatedVelocity (u : VelocityField) : VelocityField := +@[expose] def activatedVelocity (u : VelocityField) : VelocityField := fun z => timeSwitch z.1 • u z /-- Activated pressure, defined pointwise by `timeSwitch z.1 * p z`. -/ -def activatedPressure (p : PressureField) : PressureField := +@[expose] def activatedPressure (p : PressureField) : PressureField := fun z => timeSwitch z.1 * p z theorem activatedVelocity_smooth (u : VelocityField) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TorusAverages.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TorusAverages.lean index 38e1fe7b7b..633779771f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TorusAverages.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TorusAverages.lean @@ -66,7 +66,7 @@ This file does not identify those columns with the exact model, or prove the Gaussian, parameter-derivative, or flat-edge estimates. -/ -@[expose] public section +public section noncomputable section @@ -80,7 +80,7 @@ def signedMatrix (a b scaleMinus scalePlus : ℝ) : Matrix (Fin 2) (Fin 2) ℝ : -b * scaleMinus, b * scalePlus] /-- The stress target in normal and transverse coordinates. -/ -def target (m t : ℝ) : Fin 2 → ℝ := ![-m, t] +@[expose] def target (m t : ℝ) : Fin 2 → ℝ := ![-m, t] /-- Explicit squared amplitudes for the two signed slots. -/ def coefficients (a b scaleMinus scalePlus m t : ℝ) : Fin 2 → ℝ := @@ -274,7 +274,7 @@ end end -@[expose] public section +public section noncomputable section @@ -302,11 +302,11 @@ local instance instSmoothCovariance2 : NormedSpace ℝ Mat2 := abbrev Datum := Mat2 × Vec2 /-- Oriented areas obtained by replacing each column by the target. -/ -def cramerNumerator (H : Mat2) (T : Vec2) : Vec2 := +@[expose] def cramerNumerator (H : Mat2) (T : Vec2) : Vec2 := ![T 0 * H 1 1 - H 0 1 * T 1, H 0 0 * T 1 - T 0 * H 1 0] /-- Cramer's explicit formula, including Lean's total division convention. -/ -def weights (H : Mat2) (T : Vec2) : Vec2 := +@[expose] def weights (H : Mat2) (T : Vec2) : Vec2 := fun i => cramerNumerator H T i / H.det /-- Both target-column oriented areas have the same nonzero orientation as @@ -316,7 +316,7 @@ def StrictCone (H : Mat2) (T : Vec2) : Prop := 0 < cramerNumerator H T 1 * H.det /-- Amplitudes, defined pointwise by `Real.sqrt (weights H T i)`. -/ -def amplitudes (H : Mat2) (T : Vec2) : Vec2 := +@[expose] def amplitudes (H : Mat2) (T : Vec2) : Vec2 := fun i => Real.sqrt (weights H T i) theorem StrictCone.det_ne_zero {H : Mat2} {T : Vec2} (h : StrictCone H T) : @@ -559,7 +559,7 @@ theorem compact_uniform_amplitudes (hK : IsCompact K) end Compact /-- The strict area inequalities define an open set of matrix-target pairs. -/ -def strictConeRegion : Set Datum := {z | StrictCone z.1 z.2} +@[expose] def strictConeRegion : Set Datum := {z | StrictCone z.1 z.2} theorem isOpen_strictConeRegion : IsOpen strictConeRegion := by have hH : ∀ i j, Continuous (fun z : Datum => z.1 i j) := fun i j => @@ -659,7 +659,7 @@ The coefficient quotients are proved smooth from these formulas. Their smoothness across the singular matrix at the edge is not assumed. -/ -@[expose] public section +public section noncomputable section @@ -671,31 +671,31 @@ open FlatCutoff (edge) open scoped ContDiff Topology /-- Multiplication of column `j` by its scalar factor `c j`. -/ -def columns (G : Mat2) (c : Vec2) : Mat2 := fun i j => c j * G i j +@[expose] def columns (G : Mat2) (c : Vec2) : Mat2 := fun i j => c j * G i j /-- Scaled target, defined pointwise by `r * T i`. -/ -def scaledTarget (r : ℝ) (T : Vec2) : Vec2 := fun i => r * T i +@[expose] def scaledTarget (r : ℝ) (T : Vec2) : Vec2 := fun i => r * T i /-- The actual edge-degenerate covariance matrix. -/ -def edgeMatrix (κ : Vec2) (G : ℝ → Mat2) (x : ℝ) : Mat2 := +@[expose] def edgeMatrix (κ : Vec2) (G : ℝ → Mat2) (x : ℝ) : Mat2 := columns (G x) (fun j => edge (κ j) x) /-- Edge target, given by `scaledTarget (edge σ x) (T x)`. -/ -def edgeTarget (σ : ℝ) (T : ℝ → Vec2) (x : ℝ) : Vec2 := +@[expose] def edgeTarget (σ : ℝ) (T : ℝ → Vec2) (x : ℝ) : Vec2 := scaledTarget (edge σ x) (T x) /-- The actual matrix-inverse solve, also defined at the zero edge. -/ -def inverseCoefficients (σ : ℝ) (κ : Vec2) (G : ℝ → Mat2) (T : ℝ → Vec2) +@[expose] def inverseCoefficients (σ : ℝ) (κ : Vec2) (G : ℝ → Mat2) (T : ℝ → Vec2) (x : ℝ) : Vec2 := (edgeMatrix κ G x)⁻¹.mulVec (edgeTarget σ T x) /-- Primary amplitude, defined pointwise by `Real.sqrt (inverseCoefficients σ κ G T x i)`. -/ -def primaryAmplitude (σ : ℝ) (κ : Vec2) (G : ℝ → Mat2) (T : ℝ → Vec2) +@[expose] def primaryAmplitude (σ : ℝ) (κ : Vec2) (G : ℝ → Mat2) (T : ℝ → Vec2) (x : ℝ) : Vec2 := fun i => Real.sqrt (inverseCoefficients σ κ G T x i) /-- The signed covariance update divides by the fixed positive primary. -/ -def signedAmplitude (σ τ : ℝ) (κ : Vec2) (G : ℝ → Mat2) +@[expose] def signedAmplitude (σ τ : ℝ) (κ : Vec2) (G : ℝ → Mat2) (T R : ℝ → Vec2) (x : ℝ) : Vec2 := fun i => inverseCoefficients τ κ G R x i / (2 * primaryAmplitude σ κ G T x i) @@ -1234,7 +1234,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1512,7 +1512,7 @@ theorem core_weight_lower {v : ℝ} (mul_pos h.lower_pos (gaussian_pos _ _ _ _)).le hx 2 /-- Lower mass constant, given by `a ^ 2 * Real.exp (-B / 18) / 3`. -/ -noncomputable def lowerMassConstant (a B : ℝ) : ℝ := a ^ 2 * Real.exp (-B / 18) / 3 +@[expose] noncomputable def lowerMassConstant (a B : ℝ) : ℝ := a ^ 2 * Real.exp (-B / 18) / 3 theorem lowerMassConstant_pos : 0 < lowerMassConstant a B := by unfold lowerMassConstant @@ -1697,7 +1697,7 @@ abbrev Vec2 := SmoothCovariance.Vec2 abbrev Mat2 := SmoothCovariance.Mat2 /-- Radius profile, given by `Real.sqrt (1 + s ^ 2)`. -/ -noncomputable def radiusProfile (s : ℝ) : ℝ := Real.sqrt (1 + s ^ 2) +@[expose] noncomputable def radiusProfile (s : ℝ) : ℝ := Real.sqrt (1 + s ^ 2) theorem radiusProfile_pos (s : ℝ) : 0 < radiusProfile s := by apply Real.sqrt_pos.mpr @@ -1729,7 +1729,7 @@ theorem radiusProfile_lipschitz (s t : ℝ) : /-- Coordinates in the fixed tangent frame `(N,K)` of `h N - s K`, where `h = c₀ sqrt(1+s²)`. -/ -noncomputable def modelDirection (c₀ s : ℝ) : Vec2 := ![c₀ * radiusProfile s, -s] +@[expose] noncomputable def modelDirection (c₀ s : ℝ) : Vec2 := ![c₀ * radiusProfile s, -s] theorem modelDirection_lipschitz (c₀ s t : ℝ) (i : Fin 2) : |modelDirection c₀ s i - modelDirection c₀ t i| ≤ (|c₀| + 1) * |s - t| := by @@ -1779,11 +1779,11 @@ theorem modelDirection_affine_drift (c₀ s₀ slope r v : ℝ) (i : Fin 2) : exact hi.trans_eq (by ring) /-- Actual column, defined pointwise by `ci * ∫ v : ℝ, ψ v ^ 2 * x v * t v i`. -/ -noncomputable def actualColumn (ci : ℝ) (ψ x : ℝ → ℝ) (t : ℝ → Vec2) : Vec2 := +@[expose] noncomputable def actualColumn (ci : ℝ) (ψ x : ℝ → ℝ) (t : ℝ → Vec2) : Vec2 := fun i => ci * ∫ v : ℝ, ψ v ^ 2 * x v * t v i /-- Normalized column, defined pointwise by `averagedDirection ψ x (fun v => t v i / x v)`. -/ -noncomputable def normalizedColumn (ψ x : ℝ → ℝ) (t : ℝ → Vec2) : Vec2 := +@[expose] noncomputable def normalizedColumn (ψ x : ℝ → ℝ) (t : ℝ → Vec2) : Vec2 := fun i => averagedDirection ψ x (fun v => t v i / x v) namespace PulseBounds @@ -1887,10 +1887,10 @@ structure TangentPulse (r a A b B c₀ s₀ slope E : ℝ) where E / r ^ 2 /-- Signed slopes, given by `![u, -u]`. -/ -noncomputable def signedSlopes (u : ℝ) : Vec2 := ![u, -u] +@[expose] noncomputable def signedSlopes (u : ℝ) : Vec2 := ![u, -u] /-- Signed model, defined pointwise by `modelDirection c₀ (signedSlopes u j) i`. -/ -noncomputable def signedModel (c₀ u : ℝ) : Mat2 := +@[expose] noncomputable def signedModel (c₀ u : ℝ) : Mat2 := fun i j => modelDirection c₀ (signedSlopes u j) i theorem signedModel_eq_covariance (c₀ u : ℝ) : @@ -1925,7 +1925,7 @@ abbrev SignedPulsePair (r a A b B c₀ u E : ℝ) := /-- Actual matrix, defined pointwise by `actualColumn (ci j) (pulses j).cutoff (pulses j).component (pulses j).tangent i`. -/ -noncomputable def actualMatrix {r a A b B c₀ u E : ℝ} +@[expose] noncomputable def actualMatrix {r a A b B c₀ u E : ℝ} (pulses : SignedPulsePair r a A b B c₀ u E) (ci : Vec2) : Mat2 := fun i j => actualColumn (ci j) (pulses j).cutoff (pulses j).component (pulses j).tangent i @@ -2089,7 +2089,7 @@ end end -@[expose] public section +public section noncomputable section @@ -2111,11 +2111,12 @@ local instance planeVolumeHaar : Measure.IsAddHaarMeasure (volume : Measure Plan infer_instance /-- Quotient point, given by `((z.1 : UnitAddCircle), (z.2 : UnitAddCircle))`. -/ -noncomputable def quotientPoint (z : Plane) : Torus := ((z.1 : UnitAddCircle), (z.2 : +@[expose] noncomputable def quotientPoint (z : Plane) : Torus := + ((z.1 : UnitAddCircle), (z.2 : UnitAddCircle)) /-- The manuscript's real covering matrix `[[3,1],[1,5]]`. -/ -noncomputable def covering (z : Plane) : Plane := (3 * z.1 + z.2, z.1 + 5 * z.2) +@[expose] noncomputable def covering (z : Plane) : Plane := (3 * z.1 + z.2, z.1 + 5 * z.2) /-- Torus covering, bundling `toFun`, `map_zero`, `map_add`. -/ noncomputable def torusCovering : Torus →+ Torus where @@ -2178,7 +2179,7 @@ theorem integral_torusCovering_iterate {V : Type*} [NormedAddCommGroup V] rw [← integral_map hp.measurable.aemeasurable hf.aestronglyMeasurable, hp.map_eq] /-- Square average, given by `∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (x, y)`. -/ -noncomputable def squareAverage {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] +@[expose] noncomputable def squareAverage {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] (f : Plane → V) : V := ∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (x, y) theorem squareAverage_torusLift (f : C(Torus, ℂ)) : @@ -2196,8 +2197,9 @@ theorem squareAverage_covering_iterate {f : Plane → ℂ} funext z change g (torusCovering^[n] (quotientPoint z)) = f (covering^[n] z) rw [← quotient_covering_iterate] - rfl - have hg : squareAverage f = ∫ z, g z ∂torusMeasure := squareAverage_torusLift g + exact congrFun (torusLift_descendContinuous f hf hp) (covering^[n] z) + have hg : squareAverage f = ∫ z, g z ∂torusMeasure := by + simpa only [g, torusLift_descendContinuous] using squareAverage_torusLift g rw [← heq, squareAverage_torusLift] exact (integral_torusCovering_iterate g g.continuous n).trans hg.symm @@ -2219,7 +2221,7 @@ theorem squareAverage_covering_iterate_real {f : Plane → ℝ} /-! ## Lattice periodization and its actual integral -/ /-- Lattice point, given by `((k.1 : ℝ), (k.2 : ℝ))`. -/ -noncomputable def latticePoint (k : Frequency) : Plane := ((k.1 : ℝ), (k.2 : ℝ)) +@[expose] noncomputable def latticePoint (k : Frequency) : Plane := ((k.1 : ℝ), (k.2 : ℝ)) theorem latticePoint_add (k l : Frequency) : latticePoint (k + l) = latticePoint k + latticePoint l := by @@ -2310,7 +2312,7 @@ local instance instTorusAverages4 : VAddInvariantMeasure Frequency Plane (volume measure_preimage_add (volume : Measure Plane) (latticePoint k) s /-- Fundamental square, given by `Ico (0 : ℝ) 1 ×ˢ Ico (0 : ℝ) 1`. -/ -noncomputable def fundamentalSquare : Set Plane := Ico (0 : ℝ) 1 ×ˢ Ico (0 : ℝ) 1 +@[expose] noncomputable def fundamentalSquare : Set Plane := Ico (0 : ℝ) 1 ×ˢ Ico (0 : ℝ) 1 /-- The half-open unit square is proved to tile the plane, using integer floors. -/ theorem fundamentalSquare_isAddFundamentalDomain : @@ -2333,7 +2335,7 @@ theorem fundamentalSquare_isAddFundamentalDomain : · omega /-- The periodization is the actual sum over integer translates. -/ -noncomputable def periodize {V : Type*} [NormedAddCommGroup V] (f : Plane → V) +@[expose] noncomputable def periodize {V : Type*} [NormedAddCommGroup V] (f : Plane → V) (z : Plane) : V := ∑' k : Frequency, f (latticePoint k + z) /-- A compactly supported field has only finitely many active translates on @@ -2502,7 +2504,7 @@ theorem squareAverage_periodize_covering_real {f : Plane → ℝ} /-! ## Native coordinates and the determinant prefactor -/ /-- A native field placed at `center` in the linear coordinate chart `L`. -/ -noncomputable def nativeField {V : Type*} (L : Plane ≃L[ℝ] Plane) (center : Plane) +@[expose] noncomputable def nativeField {V : Type*} (L : Plane ≃L[ℝ] Plane) (center : Plane) (f : Plane → V) (z : Plane) : V := f (L.symm (z - center)) theorem nativeField_continuous {V : Type*} [TopologicalSpace V] @@ -2606,6 +2608,7 @@ theorem det_transverseChart (ci : ℝ) (hci : ci ≠ 0) : simp /-- `η = ci * v - r0`, written as the field in the native `(ξ,η)` coordinates. -/ +@[expose] noncomputable def transverseStretch {V : Type*} (ci r0 : ℝ) (f : Plane → V) (z : Plane) : V := f (z.1, (z.2 + r0) / ci) @@ -2681,7 +2684,7 @@ theorem squareAverage_covered_product (vr vt center : Plane) ring /-- The native covariance coefficient before angular averaging. -/ -noncomputable def pulseProfile (χ ψ x : ℝ → ℝ) (t : ℝ → PulseCovariance.Vec2) +@[expose] noncomputable def pulseProfile (χ ψ x : ℝ → ℝ) (t : ℝ → PulseCovariance.Vec2) (i : Fin 2) (z : Plane) : ℝ := χ z.1 ^ 2 * (ψ z.2 ^ 2 * x z.2 * t z.2 i) theorem squareAverage_covered_pulseColumn (vr vt center : Plane) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TransitionRamp.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TransitionRamp.lean index 1de55da5e2..599115e4e5 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TransitionRamp.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TransitionRamp.lean @@ -19,7 +19,7 @@ control is turned off first; the angular control is then interpolated to joins. No cone inequality is assumed here. -/ -@[expose] public section +public section noncomputable section @@ -85,17 +85,17 @@ theorem integrate_congr (initial : ℝ → ℝ) (slope₁ slope₂ : Field) (p : /-- The ordinary ACT control continues to multiply the REF lag stock, even when the REF derivative has already become zero. -/ -noncomputable def baseSlope (T κ : ℝ) (stock : Field) : Field := +@[expose] noncomputable def baseSlope (T κ : ℝ) (stock : Field) : Field := fun p => -(damping T κ p.1 * stock p) / 2 /-- Angular slope, defined pointwise by `(1 - step (b + w₁) w₂ p.1) * baseSlope T κ stock p - (2 / 5 : ℝ) * step (b + w₁) w₂ p.1`. -/ -noncomputable def angularSlope (T κ b w₁ w₂ : ℝ) (stock : Field) : Field := +@[expose] noncomputable def angularSlope (T κ b w₁ w₂ : ℝ) (stock : Field) : Field := fun p => (1 - step (b + w₁) w₂ p.1) * baseSlope T κ stock p - (2 / 5 : ℝ) * step (b + w₁) w₂ p.1 /-- Axial slope, defined pointwise by `(1 - step b w₁ p.1) * baseSlope T κ stock p`. -/ -noncomputable def axialSlope (T κ b w₁ : ℝ) (stock : Field) : Field := +@[expose] noncomputable def axialSlope (T κ b w₁ : ℝ) (stock : Field) : Field := fun p => (1 - step b w₁ p.1) * baseSlope T κ stock p theorem baseSlope_smooth (T κ : ℝ) {J : Set ℝ} (hJ : IsOpen J) {stock : Field} @@ -290,9 +290,9 @@ theorem initialU_smooth (_hJ : IsOpen J) : ContDiffOn ℝ ∞ R.initialU J := by (contDiffAt_const.prodMk contDiffAt_id)).contDiffWithinAt /-- Big time, given by `Real.log (100 / R.radius0)`. -/ -noncomputable def bigTime : ℝ := Real.log (100 / R.radius0) +@[expose] noncomputable def bigTime : ℝ := Real.log (100 / R.radius0) /-- Final time, given by `Real.log (110 / R.radius0)`. -/ -noncomputable def finalTime : ℝ := Real.log (110 / R.radius0) +@[expose] noncomputable def finalTime : ℝ := Real.log (110 / R.radius0) /-- Log amplitude, given by `logField T κ R.bigTime w₁ w₂ R.initialLog R.angularStock`. -/ noncomputable def logAmplitude (T κ w₁ w₂ : ℝ) : Field := @@ -715,7 +715,7 @@ variable {J : Set ℝ} (R : StockReference J) /-- Log time, given by `Real.log (X / R.radius0)`. -/ noncomputable def logTime (X : ℝ) : ℝ := Real.log (X / R.radius0) /-- Log point, given by `(R.logTime p.1, p.2)`. -/ -noncomputable def logPoint (p : Point) : Point := (R.logTime p.1, p.2) +@[expose] noncomputable def logPoint (p : Point) : Point := (R.logTime p.1, p.2) theorem logPoint_smoothAt {p : Point} (hX : 0 < p.1) : ContDiffAt ℝ ∞ R.logPoint p := ((contDiffAt_fst.div_const R.radius0).log (div_ne_zero hX.ne' R.radius0_pos.ne')).prodMk @@ -788,7 +788,7 @@ theorem L_pos_parameterInterval {h j η : ℝ} (hs : NaturalAxisData.SmallParame /-- No stock or differential equation is postulated in this constructor: the underlying profiles and all five histories are the completed REF path. -/ -noncomputable def ofNatural : StockReference parameterInterval where +@[expose] noncomputable def ofNatural : StockReference parameterInterval where exponent := h radius0 := (Input.ofNatural hΛ F).endpoint radius0_pos := (Input.ofNatural hΛ F).endpoint_pos @@ -820,7 +820,7 @@ theorem natural_stock_identity (y : ℝ) (hy : y ≤ δ) {η : ℝ} (hη : η have hX : 0 < p.1 := mul_pos N.endpoint_pos (Real.exp_pos _) have hupper : p.1 ≤ N.endpoint * Real.exp δ := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hy) N.endpoint_pos.le - have hfp : 0 < Q.f p := N.fromLog_f_pos ⟨hyT, hη⟩ + have hfp : 0 < Q.f p := N.fromLog_f_pos (p := (y, η)) ⟨hyT, hη⟩ have hfields : P.f p = Q.f p := N.refF_eq_natural hδ hδT hη hupper have hUfields : P.U p = Q.U p := N.refU_eq_natural hδ hδT hη hupper have hrows : ∀ r ξ, ξ ∈ parameterInterval → diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TransportPrimitive.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TransportPrimitive.lean index 82c245b39c..8071c64886 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TransportPrimitive.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TransportPrimitive.lean @@ -34,7 +34,7 @@ torus. A separately constructed directional primitive supplies the inverse identity; no decay estimate for the integral is assumed. -/ -@[expose] public section +public section noncomputable section @@ -58,15 +58,15 @@ def wholeAlias (M : ℝ) (v Y : E) (f : ℝ × E → F) : F := ∫ u : ℝ, f (shift M v Y u) /-- Support in a fixed radial interval, uniformly in the auxiliary variable. -/ -def RadiallySupported (a b : ℝ) (f : ℝ × E → F) : Prop := +@[expose] def RadiallySupported (a b : ℝ) (f : ℝ × E → F) : Prop := support f ⊆ Prod.fst ⁻¹' Icc a b /-- The derivative in the slow radial coordinate, holding the auxiliary variable fixed. -/ -def slowDeriv (f : ℝ × E → F) (z : ℝ × E) : F := +@[expose] def slowDeriv (f : ℝ × E → F) (z : ℝ × E) : F := fderiv ℝ f z (1, 0) /-- The actual auxiliary directional derivative. -/ -def directionalDeriv (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := +@[expose] def directionalDeriv (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := fderiv ℝ f z (0, v) theorem shift_hasDerivAt (M : ℝ) (v Y : E) (u : ℝ) : @@ -191,7 +191,7 @@ theorem wholeAlias_directionalDeriv [CompleteSpace F] exact aliasIntegral_directionalDeriv hM hg hs /-- Successive actual slow derivatives of directional primitives. -/ -def sourceJet (J : (ℝ × E → F) → (ℝ × E → F)) (f : ℝ × E → F) (p : ℕ) : +@[expose] def sourceJet (J : (ℝ × E → F) → (ℝ × E → F)) (f : ℝ × E → F) (p : ℕ) : ℝ × E → F := (slowDeriv ∘ J)^[p] f @[simp] theorem sourceJet_zero (J : (ℝ × E → F) → (ℝ × E → F)) (f : ℝ × E → F) : @@ -301,7 +301,7 @@ end end -@[expose] public section +public section noncomputable section @@ -337,7 +337,7 @@ theorem uniform_local_bound {g : H × ℝ → G} (hg : Continuous g) (x : H) (a exact ⟨ε, hε, C + 1, fun y hy u hu => (hVW ⟨hball hy, hW hu⟩).le⟩ /-- The parameter derivative of a jointly smooth integrand. -/ -noncomputable def parameterDerivative (g : H × ℝ → G) (z : H × ℝ) : H →L[ℝ] G := +@[expose] noncomputable def parameterDerivative (g : H × ℝ → G) (z : H × ℝ) : H →L[ℝ] G := (fderiv ℝ g z).comp (ContinuousLinearMap.inl ℝ H ℝ) theorem parameterDerivative_contDiff {g : H × ℝ → G} (hg : ContDiff ℝ ∞ g) : @@ -400,19 +400,19 @@ variable {E F : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- A fixed translation along the transport direction. -/ -noncomputable def shift (M : ℝ) (v : E) (z : ℝ × E) (u : ℝ) : ℝ × E := +@[expose] noncomputable def shift (M : ℝ) (v : E) (z : ℝ × E) (u : ℝ) : ℝ × E := z + (u, (M * u) • v) /-- The past half-line primitive, in fixed integration coordinates. -/ -noncomputable def pastIntegral (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := +@[expose] noncomputable def pastIntegral (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := ∫ u in Iic (0 : ℝ), f (shift M v z u) /-- The complete translated radial integral. -/ -noncomputable def totalIntegral (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := +@[expose] noncomputable def totalIntegral (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := ∫ u : ℝ, f (shift M v z u) /-- Compactification with a fixed radial cutoff. -/ -noncomputable def compactIntegral (χ : ℝ → ℝ) (M : ℝ) (v : E) +@[expose] noncomputable def compactIntegral (χ : ℝ → ℝ) (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := pastIntegral M v f z - χ z.1 • totalIntegral M v f z @@ -577,7 +577,7 @@ theorem totalIntegral_hasFDerivAt {a b M : ℝ} {v : E} exact h.congr_of_eventuallyEq (totalIntegral_eventually_eq_interval hs z) /-- An ordinary derivative in any fixed direction, including a slow parameter. -/ -noncomputable def fixedDeriv (w : ℝ × E) (f : ℝ × E → F) (z : ℝ × E) : F := +@[expose] noncomputable def fixedDeriv (w : ℝ × E) (f : ℝ × E → F) (z : ℝ × E) : F := fderiv ℝ f z w theorem fixedDeriv_contDiff {f : ℝ × E → F} (hf : ContDiff ℝ ∞ f) (w : ℝ × E) : @@ -743,7 +743,7 @@ theorem compactIntegral_supported {a b M : ℝ} {v : E} {f : ℝ × E → F} {χ exact hz (by simp [compactIntegral, pastIntegral_eq_total_of_ge hs z hzb, hright _ hzb]) /-- An explicit smooth transition with specified plateau thresholds. -/ -noncomputable def cutoff (c d : ℝ) (u : ℝ) : ℝ := +@[expose] noncomputable def cutoff (c d : ℝ) (u : ℝ) : ℝ := Real.smoothTransition ((u - c) / (d - c)) theorem cutoff_contDiff (c d : ℝ) : ContDiff ℝ ∞ (cutoff c d) := @@ -760,7 +760,7 @@ theorem cutoff_mem_Icc (c d u : ℝ) : cutoff c d u ∈ Icc (0 : ℝ) 1 := ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ /-- The canonical cutoff has both plateaus strictly inside the support interval. -/ -noncomputable def interiorCutoff (a b : ℝ) : ℝ → ℝ := +@[expose] noncomputable def interiorCutoff (a b : ℝ) : ℝ → ℝ := cutoff ((2 * a + b) / 3) ((a + 2 * b) / 3) theorem interiorCutoff_contDiff (a b : ℝ) : ContDiff ℝ ∞ (interiorCutoff a b) := @@ -780,7 +780,7 @@ theorem canonicalCompact_supported {a b M : ℝ} {v : E} {f : ℝ × E → F} (fun u hu => interiorCutoff_one hab (by linarith)) /-- The complementary future integral used at the right support edge. -/ -noncomputable def futureIntegral (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := +@[expose] noncomputable def futureIntegral (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := ∫ u in Ioi (0 : ℝ), f (shift M v z u) theorem past_add_future {a b M : ℝ} {v : E} {f : ℝ × E → F} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformAngularReset.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformAngularReset.lean index 261f32cf29..60f6a0acc8 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformAngularReset.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformAngularReset.lean @@ -33,7 +33,7 @@ preserving the pressure integral exactly. The actual two-row derivative matrix is proved nonsingular, and the small smooth nonlinear branch is constructed. -/ -@[expose] public section +public section noncomputable section @@ -178,7 +178,7 @@ def linearEquiv (lam : ℝ) (hlam : 0 < lam) : Coeff ≃L[ℝ] Coeff := (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero lam hlam)), Matrix.one_mulVec] } /-- Relative, given by `c 0 * bump 0 y + c 1 * bump 1 y`. -/ -def relative (c : Coeff) (y : ℝ) : ℝ := c 0 * bump 0 y + c 1 * bump 1 y +@[expose] def relative (c : Coeff) (y : ℝ) : ℝ := c 0 * bump 0 y + c 1 * bump 1 y theorem relative_contDiff (c : Coeff) : ContDiff ℝ ∞ (relative c) := (contDiff_const.mul (bump_contDiff 0)).add (contDiff_const.mul (bump_contDiff 1)) @@ -230,11 +230,11 @@ def quadraticCLM (lam : ℝ) : Coeff →L[ℝ] Coeff →L[ℝ] Coeff := (quadraticBilin lam)) theorem linearEquiv_apply (lam : ℝ) (hlam : 0 < lam) (c : Coeff) : - linearEquiv lam hlam c = (linearMatrix lam).mulVec c := rfl + linearEquiv lam hlam c = (linearMatrix lam).mulVec c := by rfl theorem quadraticCLM_apply (lam : ℝ) (c d : Coeff) : quadraticCLM lam c d = - ![0, quadraticMoment lam 0 * c 0 * d 0 + quadraticMoment lam 1 * c 1 * d 1] := rfl + ![0, quadraticMoment lam 0 * c 0 * d 0 + quadraticMoment lam 1 * c 1 * d 1] := by rfl theorem weighted_relative_integrable (s : ℝ) (c : Coeff) : Integrable (fun y => Real.exp (s * y) * relative c y) := @@ -496,10 +496,10 @@ def resetBranch (lam : ℝ) (hlam : 0 < lam) : ResetBranch lam := /-! ## Actual modified angular fields -/ /-- Base E, given by `e0 * Real.exp ((-1 / 2 - lam) * y)`. -/ -def baseE (lam e0 y : ℝ) : ℝ := e0 * Real.exp ((-1 / 2 - lam) * y) +@[expose] def baseE (lam e0 y : ℝ) : ℝ := e0 * Real.exp ((-1 / 2 - lam) * y) /-- The first bump is centered at `y0`, and the second at `y0 + 2`. -/ -def modifiedE (lam e0 y0 : ℝ) (c : Coeff) (y : ℝ) : ℝ := +@[expose] def modifiedE (lam e0 y0 : ℝ) (c : Coeff) (y : ℝ) : ℝ := baseE lam e0 y * (1 + relative c (y - y0)) /-- Radius X, given by `X0 * Real.exp y`. -/ @@ -868,7 +868,7 @@ end end -@[expose] public section +public section noncomputable section @@ -935,7 +935,7 @@ def linearEquivNonneg (lam : ℝ) (hlam : 0 ≤ lam) : Coeff ≃L[ℝ] Coeff := (isUnit_iff_ne_zero.mpr (linearMatrix_det_ne_zero_nonneg lam hlam)), Matrix.one_mulVec] } theorem linearEquivNonneg_coe (lam : ℝ) (hlam : 0 ≤ lam) : - (linearEquivNonneg lam hlam).toContinuousLinearMap = linearCLM lam := rfl + (linearEquivNonneg lam hlam).toContinuousLinearMap = linearCLM lam := by rfl theorem continuous_linearCLM : Continuous linearCLM := by let L : (Matrix (Fin 2) (Fin 2) ℝ) →ₗ[ℝ] (Coeff →L[ℝ] Coeff) := @@ -1037,11 +1037,11 @@ section SmoothUniformInverse variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Quadratic map, given by `B c + A c c`. -/ -def quadraticMap (B : E ≃L[ℝ] E) (A : E →L[ℝ] E →L[ℝ] E) (c : E) : E := +@[expose] def quadraticMap (B : E ≃L[ℝ] E) (A : E →L[ℝ] E →L[ℝ] E) (c : E) : E := B c + A c c /-- Tangent, given by `B.toContinuousLinearMap + A c + A.flip c`. -/ -def tangent (B : E ≃L[ℝ] E) (A : E →L[ℝ] E →L[ℝ] E) (c : E) : E →L[ℝ] E := +@[expose] def tangent (B : E ≃L[ℝ] E) (A : E →L[ℝ] E →L[ℝ] E) (c : E) : E →L[ℝ] E := B.toContinuousLinearMap + A c + A.flip c theorem quadraticMap_contDiff (B : E ≃L[ℝ] E) (A : E →L[ℝ] E →L[ℝ] E) : @@ -1303,7 +1303,7 @@ section ActualHistory open NavierStokes.OutgoingSchedule NavierStokes.OutgoingTail /-- The factor `sqrt 2` cancels in every angular-history ratio. -/ -def baseWeight (d : TailData) (y : ℝ) : ℝ := +@[expose] def baseWeight (d : TailData) (y : ℝ) : ℝ := Real.exp (3 * y / 2) * radialAmplitude d.core.P d.core.dropLength d.core.lam y /-- Base history, given by `(5 / 8) * d.core.P + OutgoingSchedule.primitive (baseWeight d) y`. -/ @@ -1467,7 +1467,7 @@ theorem flatHistory_contDiff (d : TailData) {y : ℝ} (hy : 0 ≤ y) : /-- Eta rate, given by `(sigma ((y - d.core.endpoint) / flattenLength) - 1) * (2 * eta / (1 + eta ^ 2))`. -/ -def etaRate (d : TailData) (eta y : ℝ) : ℝ := +@[expose] def etaRate (d : TailData) (eta y : ℝ) : ℝ := (sigma ((y - d.core.endpoint) / flattenLength) - 1) * (2 * eta / (1 + eta ^ 2)) theorem logShape_hasDerivAt (eta : ℝ) : @@ -1896,7 +1896,7 @@ theorem exists_scheduled_reset : · exact hv.2.trans (hb.trans hδsmall) /-- Correction center, given by `d.releaseStart - 3`. -/ -def correctionCenter (d : TailData) : ℝ := d.releaseStart - 3 +@[expose] def correctionCenter (d : TailData) : ℝ := d.releaseStart - 3 /-- Reference amplitude, given by `(radialAmplitude d.core.P d.core.dropLength d.core.lam d.flattenEnd / 2) * Real.exp ((1 / 2 + d.core.lam) * d.flattenEnd)`. -/ @@ -1961,7 +1961,7 @@ theorem relative_zero_outside (d : TailData) (c : Coeff) {y : ℝ} constructor <;> linarith [hs.1, hs.2] /-- The actual complete outgoing angular field after the two relative bumps. -/ -def correctedAngular (d : TailData) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := +@[expose] def correctedAngular (d : TailData) (c : ℝ → Coeff) (p : ℝ × ℝ) : ℝ := finalAngular d p * (1 + relative (c p.2) (p.1 - correctionCenter d)) theorem correctedAngular_contDiff (d : TailData) (c : ℝ → Coeff) (hc : ContDiff ℝ ∞ c) : @@ -2069,7 +2069,7 @@ theorem integral_edit_window (d : TailData) (f : ℝ → ℝ) /-- Corrected history, given by `(5 / 8) * d.core.P * shape eta + ∫ t in (0 : ℝ)..d.releaseStart, Real.exp (3 * t / 2) * correctedAngular d c (t, eta)`. -/ -def correctedHistory (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : ℝ := +@[expose] def correctedHistory (d : TailData) (c : ℝ → Coeff) (eta : ℝ) : ℝ := (5 / 8) * d.core.P * shape eta + ∫ t in (0 : ℝ)..d.releaseStart, Real.exp (3 * t / 2) * correctedAngular d c (t, eta) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformBlockBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformBlockBounds.lean index 2a26ad488c..df956e4c36 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformBlockBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformBlockBounds.lean @@ -18,7 +18,7 @@ and finite signed harmonic sums preserve constants chosen before labels. The endpoints use the actual signed and particular block constructors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformCone.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformCone.lean index 0377545118..0615a847ae 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformCone.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformCone.lean @@ -17,7 +17,7 @@ set. Uniform margins, a single amplitude threshold, and a common perturbation radius are conclusions of the theorems, not assumptions. -/ -@[expose] public section +public section noncomputable section @@ -209,7 +209,7 @@ theorem compact_equation_eleven_gap {K : Set X} (hK : IsCompact K) abbrev ConeDatum := ℝ × ℝ × ℝ /-- The exact open true cone, retaining the square-root inequality. -/ -def trueCone : Set ConeDatum := +@[expose] def trueCone : Set ConeDatum := {z | 2 < z.2.2 ∧ 2 < z.1 ∧ z.2.2 < coneBound z.1 z.2.1} theorem continuous_coneBound : Continuous (fun z : ConeDatum => coneBound z.1 z.2.1) := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformFourierAlias.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformFourierAlias.lean index 12267e39e7..b7d9aa3f54 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformFourierAlias.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformFourierAlias.lean @@ -30,7 +30,7 @@ the unit-square integrals of that source. No output regularity or decay assumptions are part of the construction. -/ -@[expose] public section +public section noncomputable section @@ -47,23 +47,23 @@ abbrev Source (P : Type) := Point P → ℂ variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] /-- Slice, defined pointwise by `f (p, Y)`. -/ -noncomputable def slice (f : Source P) (p : P) : Plane → ℂ := fun Y => f (p, Y) +@[expose] noncomputable def slice (f : Source P) (p : P) : Plane → ℂ := fun Y => f (p, Y) /-- Periodic, given by `∀ p, SmoothFourierData.UnitPeriodic (slice f p)`. -/ -def Periodic (f : Source P) : Prop := +@[expose] def Periodic (f : Source P) : Prop := ∀ p, SmoothFourierData.UnitPeriodic (slice f p) /-- Coefficient, given by `SmoothFourierData.coefficient (slice f p) k`. -/ -noncomputable def coefficient (f : Source P) (p : P) (k : Frequency) : ℂ := +@[expose] noncomputable def coefficient (f : Source P) (p : P) (k : Frequency) : ℂ := SmoothFourierData.coefficient (slice f p) k /-- Mean, given by `coefficient f p 0`. -/ noncomputable def mean (f : Source P) (p : P) : ℂ := coefficient f p 0 /-- Zero mean, given by `∀ p, mean f p = 0`. -/ -def ZeroMean (f : Source P) : Prop := ∀ p, mean f p = 0 +@[expose] def ZeroMean (f : Source P) : Prop := ∀ p, mean f p = 0 /-- Inverse, given by `directionalInverse d (coefficient f z.1) z.2`. -/ -noncomputable def inverse (d : Direction) (f : Source P) (z : Point P) : ℂ := +@[expose] noncomputable def inverse (d : Direction) (f : Source P) (z : Point P) : ℂ := directionalInverse d (coefficient f z.1) z.2 /-- Fixed partial, given by `fderiv ℝ f z v`. -/ @@ -415,15 +415,15 @@ noncomputable def torusLiftY : ℂ →L[ℝ] (Point P →L[ℝ] ℂ) := (dy.comp (ContinuousLinearMap.snd ℝ P Plane)) @[simp] theorem parameterLift_apply (i : BasisIndex P) (c : ℂ) (v : Point P) : - parameterLift i c v = parameterCoord i v.1 • c := rfl + parameterLift i c v = parameterCoord i v.1 • c := by rfl omit [FiniteDimensional ℝ P] in @[simp] theorem torusLiftX_apply (c : ℂ) (v : Point P) : - torusLiftX c v = v.2.1 • c := rfl + torusLiftX c v = v.2.1 • c := by rfl omit [FiniteDimensional ℝ P] in @[simp] theorem torusLiftY_apply (c : ℂ) (v : Point P) : - torusLiftY c v = v.2.2 • c := rfl + torusLiftY c v = v.2.2 • c := by rfl theorem clm_parameter_expansion (L : P →L[ℝ] ℂ) (v : P) : L v = ∑ i : BasisIndex P, parameterCoord i v • L (parameterBasis i) := by @@ -650,7 +650,7 @@ theorem inverse_zeroMean (d : Direction) {f : Source P} (hf : ContDiff ℝ ∞ f simp only [multiplier, symbol_zero, Complex.ofReal_zero, mul_zero, inv_zero, zero_mul] /-- Directional partial, given by `fderiv ℝ f z (0, vector d)`. -/ -noncomputable def directionalPartial (d : Direction) (f : Source P) (z : Point P) : ℂ := +@[expose] noncomputable def directionalPartial (d : Direction) (f : Source P) (z : Point P) : ℂ := fderiv ℝ f z (0, vector d) theorem inverse_solves (d : Direction) {f : Source P} (hf : ContDiff ℝ ∞ f) @@ -1200,7 +1200,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1307,7 +1307,7 @@ variable {E F : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The exact defect in the compact transport primitive, with all auxiliary slow variables retained in `E`. -/ -noncomputable def exactAlias (χ : ℝ → ℝ) (M : ℝ) (v : E) +@[expose] noncomputable def exactAlias (χ : ℝ → ℝ) (M : ℝ) (v : E) (f : ℝ × E → F) (z : ℝ × E) : F := deriv χ z.1 • TransportPrimitive.totalIntegral M v f z @@ -1483,7 +1483,7 @@ variable {D E : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedAddCommGroup E] [NormedSpace ℝ E] /-- Complexify, given by `f z`. -/ -noncomputable def complexify (f : D → ℝ) (z : D) : ℂ := f z +@[expose] noncomputable def complexify (f : D → ℝ) (z : D) : ℂ := f z theorem complexify_smooth {f : D → ℝ} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (complexify f) := Complex.ofRealCLM.contDiff.comp hf @@ -1539,20 +1539,20 @@ variable {S F : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup F] [NormedSpace ℝ F] /-- Reassociate radial, slow, and torus variables without changing the norm. -/ -noncomputable def toProduct (f : ℝ × (S × Plane) → F) (z : (ℝ × S) × Plane) : F := +@[expose] noncomputable def toProduct (f : ℝ × (S × Plane) → F) (z : (ℝ × S) × Plane) : F := f (z.1.1, (z.1.2, z.2)) /-- From product, given by `f ((z.1, z.2.1), z.2.2)`. -/ -noncomputable def fromProduct (f : (ℝ × S) × Plane → F) (z : ℝ × (S × Plane)) : F := +@[expose] noncomputable def fromProduct (f : (ℝ × S) × Plane → F) (z : ℝ × (S × Plane)) : F := f ((z.1, z.2.1), z.2.2) omit [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup F] [NormedSpace ℝ F] in @[simp] theorem fromProduct_toProduct (f : ℝ × (S × Plane) → F) : - fromProduct (toProduct f) = f := rfl + fromProduct (toProduct f) = f := by rfl omit [NormedAddCommGroup S] [NormedSpace ℝ S] [NormedAddCommGroup F] [NormedSpace ℝ F] in @[simp] theorem toProduct_fromProduct (f : (ℝ × S) × Plane → F) : - toProduct (fromProduct f) = f := rfl + toProduct (fromProduct f) = f := by rfl theorem toProduct_smooth {f : ℝ × (S × Plane) → F} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (toProduct f) := @@ -1575,11 +1575,11 @@ theorem norm_iteratedFDeriv_fromProduct (f : (ℝ × S) × Plane → F) (LinearIsometryEquiv.prodAssoc ℝ ℝ S Plane).symm.norm_iteratedFDeriv_comp_right f z m /-- Source mean, given by `FourierAlias.torusMean (fun Y => f (p.1, (p.2, Y)))`. -/ -noncomputable def sourceMean (f : ℝ × (S × Plane) → F) (p : ℝ × S) : F := +@[expose] noncomputable def sourceMean (f : ℝ × (S × Plane) → F) (p : ℝ × S) : F := FourierAlias.torusMean (fun Y => f (p.1, (p.2, Y))) /-- Source periodic, given by `∀ U s, FourierAlias.TorusPeriodic (fun Y => f (U, (s, Y)))`. -/ -noncomputable def SourcePeriodic (f : ℝ × (S × Plane) → F) : Prop := +@[expose] noncomputable def SourcePeriodic (f : ℝ × (S × Plane) → F) : Prop := ∀ U s, FourierAlias.TorusPeriodic (fun Y => f (U, (s, Y))) /-- Radial slice, given by `f (z.1, (s, z.2))`. -/ @@ -1680,7 +1680,7 @@ theorem torusMean_map {F H : Type} [NormedAddCommGroup F] [NormedSpace ℝ F] /-- A genuine real directional inverse, obtained from the actual complex Fourier inverse by real part. -/ -noncomputable def realInverse (d : Direction) (f : P × Plane → ℝ) (z : P × Plane) : ℝ := +@[expose] noncomputable def realInverse (d : Direction) (f : P × Plane → ℝ) (z : P × Plane) : ℝ := Complex.re (SmoothFamilyTorusInverse.inverse d (complexify f) z) /-- Real centered, given by `f z - parameterMean f z.1`. -/ @@ -1862,7 +1862,7 @@ noncomputable def realCenterSource (f : ℝ × (S × Plane) → ℝ) : ℝ × (S omit [NormedAddCommGroup S] [NormedSpace ℝ S] [FiniteDimensional ℝ S] in theorem realCenterSource_apply (f : ℝ × (S × Plane) → ℝ) (z : ℝ × (S × Plane)) : - realCenterSource f z = f z - sourceMean f (z.1, z.2.1) := rfl + realCenterSource f z = f z - sourceMean f (z.1, z.2.1) := by rfl theorem realCenterSource_smooth {f : ℝ × (S × Plane) → ℝ} (hf : ContDiff ℝ ∞ f) (hp : SourcePeriodic f) : ContDiff ℝ ∞ (realCenterSource f) := @@ -2262,7 +2262,7 @@ end FiberClass section BandScales /-- The actual slow scale, clipped only at the finitely many initial bands. -/ -noncomputable def bandSlow (n : ℕ) : ℝ := max 1 (ChartScales.S n) +@[expose] noncomputable def bandSlow (n : ℕ) : ℝ := max 1 (ChartScales.S n) theorem one_le_bandSlow (n : ℕ) : 1 ≤ bandSlow n := le_max_left _ _ @@ -2329,7 +2329,7 @@ open WeightedClasses WeightedRadialPrimitive variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The concrete radial strip with the manuscript's actual band scales. -/ -noncomputable def chartStrip (a b cL cR : ℝ) (ha : 0 < a) (hcL : 0 < cL) (hcR : 0 < cR) +@[expose] noncomputable def chartStrip (a b cL cR : ℝ) (ha : 0 < a) (hcL : 0 < cL) (hcR : 0 < cR) (h : ℝ) (hh : 0 < h) : StripData (ℝ × E) := logStripData a b cL cR ha hcL hcR (ChartScales.epsilon h) bandSlow (ChartScales.epsilon_pos h) (ChartScales.epsilon_le_one h hh.le) one_le_bandSlow diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformHarmonicInteraction.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformHarmonicInteraction.lean index 7684764663..d89fc94d2f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformHarmonicInteraction.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformHarmonicInteraction.lean @@ -19,7 +19,7 @@ The nonlinear estimate uses exact mode solenoidality to remove the phase normal. Only the fixed signed harmonic ratio remains in that cancellation. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformPrimaryWeights.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformPrimaryWeights.lean index ea8d85b554..d347993319 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/UniformPrimaryWeights.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/UniformPrimaryWeights.lean @@ -19,7 +19,7 @@ strip retains the same domain, edge distance, and vanishing weight. Every constant is chosen before both the original band and the label. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ variable {ι E F G : Type*} {D : Type} /-- Only the discrete scales are reindexed. The spatial edge geometry and its possibly vanishing weight are exactly the original ones. -/ -noncomputable def reindexedStrip (s : StripData D) (e : ℕ → ℕ × ι) : StripData D where +@[expose] noncomputable def reindexedStrip (s : StripData D) (e : ℕ → ℕ × ι) : StripData D where domain := s.domain isOpen_domain := s.isOpen_domain epsilon k := s.epsilon (e k).1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ValidDyadicBandCover.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ValidDyadicBandCover.lean index 3e89529598..785308b71e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ValidDyadicBandCover.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ValidDyadicBandCover.lean @@ -35,7 +35,7 @@ chosen representative agrees with every valid chart on an ambient neighborhood. No regularity at the boundary of the union is asserted. -/ -@[expose] public section +public section noncomputable section @@ -214,7 +214,7 @@ end end -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/VariableGaugeMean.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/VariableGaugeMean.lean index da520f7454..caade466f1 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/VariableGaugeMean.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/VariableGaugeMean.lean @@ -26,7 +26,7 @@ The common torus index and its bounded gap from the native index remain explicit. This module does not assert arbitrary-power alias decay. -/ -@[expose] public section +public section namespace NavierStokes.VariableGaugeMean @@ -66,6 +66,7 @@ section Gauge variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Radial ratio, given by `z.1 / ell z.2.1`. -/ +@[expose] noncomputable def radialRatio (ell : S → ℝ) (z : PressureStream.Lift S) : ℝ := z.1 / ell z.2.1 /-- Cutoff, given by `RadialPullback.physicalCutoff d a b (radialRatio ell z)`. -/ @@ -73,7 +74,7 @@ noncomputable def cutoff (d a b : ℝ) (ell : S → ℝ) (z : PressureStream.Lif RadialPullback.physicalCutoff d a b (radialRatio ell z) /-- Density, given by `(ell z.2.1)⁻¹ * PressureStream.rho a b hab (radialRatio ell z)`. -/ -noncomputable def density (a b : ℝ) (hab : a < b) (ell : S → ℝ) +@[expose] noncomputable def density (a b : ℝ) (hab : a < b) (ell : S → ℝ) (z : PressureStream.Lift S) : ℝ := (ell z.2.1)⁻¹ * PressureStream.rho a b hab (radialRatio ell z) @@ -84,13 +85,13 @@ noncomputable def SupportedGauge (a b : ℝ) (ell : S → ℝ) (U : Set S) ∀ z, z.2.1 ∈ U → f z ≠ 0 → z.1 ∈ Icc (ell z.2.1 * a) (ell z.2.1 * b) /-- Genuine integral with the actual endpoints on this slow fiber. -/ -noncomputable def compactPrimitive (d a b M : ℝ) (ell : S → ℝ) (v : PressureStream.Plane) +@[expose] noncomputable def compactPrimitive (d a b M : ℝ) (ell : S → ℝ) (v : PressureStream.Plane) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := RadialPullback.physicalCompact d (ell z.2.1 * a) (ell z.2.1 * b) M ((0 : S), v) f z /-- Pressure source, given by `f z - density a b hab ell z * PressureStream.pressureMass f z.2.1`. -/ -noncomputable def pressureSource (a b : ℝ) (hab : a < b) (ell : S → ℝ) +@[expose] noncomputable def pressureSource (a b : ℝ) (hab : a < b) (ell : S → ℝ) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := f z - density a b hab ell z * PressureStream.pressureMass f z.2.1 @@ -101,13 +102,13 @@ noncomputable def meanPressure (d a b M : ℝ) (hab : a < b) (ell : S → ℝ) /-- Stream potential, given by `PressureStream.divideRadius (compactPrimitive d a b M ell v (PressureStream.weightedSource f))`. -/ -noncomputable def streamPotential (d a b M : ℝ) (ell : S → ℝ) (v : PressureStream.Plane) +@[expose] noncomputable def streamPotential (d a b M : ℝ) (ell : S → ℝ) (v : PressureStream.Plane) (f : PressureStream.Lift S → ℝ) : PressureStream.Lift S → ℝ := PressureStream.divideRadius (compactPrimitive d a b M ell v (PressureStream.weightedSource f)) /-- Compact alias, given by `RadialPullback.physicalAlias d (ell z.2.1 * a) (ell z.2.1 * b) M ((0 : S), v) f z`. -/ -noncomputable def compactAlias (d a b M : ℝ) (ell : S → ℝ) (v : PressureStream.Plane) +@[expose] noncomputable def compactAlias (d a b M : ℝ) (ell : S → ℝ) (v : PressureStream.Plane) (f : PressureStream.Lift S → ℝ) (z : PressureStream.Lift S) : ℝ := RadialPullback.physicalAlias d (ell z.2.1 * a) (ell z.2.1 * b) M ((0 : S), v) f z @@ -192,7 +193,7 @@ section ActualQ open TorusInverse /-- Slow variables in this module follow the rank/domain convention `(T,Z)`. -/ -noncomputable def qLength (coord : ℝ) (s : Plane) : ℝ := +@[expose] noncomputable def qLength (coord : ℝ) (s : Plane) : ℝ := Real.sqrt (SimilarityCoordinates.coordinateQ coord s) theorem qLength_pos {coord : ℝ} (hc : 0 < coord) (hc1 : coord < 1) @@ -542,7 +543,7 @@ structure GaugeData (S : Type) where length : ℕ → S → ℝ /-- The actual similarity gauge in every normalized chart. -/ -noncomputable def similarityGauge (h d a b M : ℝ) (hab : a < b) (index : ℕ → ℕ) : +@[expose] noncomputable def similarityGauge (h d a b M : ℝ) (hab : a < b) (index : ℕ → ℕ) : GaugeData PressureStream.Plane where radial := { exponent := d, inner := a, outer := b, inner_lt_outer := hab, @@ -553,7 +554,7 @@ noncomputable def similarityGauge (h d a b M : ℝ) (hab : a < b) (index : ℕ variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] /-- Reconstruct state as an element of `CorrectionState.State (PressureStream.Lift S)`. -/ -noncomputable def reconstructState (g : GaugeData S) +@[expose] noncomputable def reconstructState (g : GaugeData S) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : CorrectionState.State (PressureStream.Lift S) := @@ -563,7 +564,7 @@ noncomputable def reconstructState (g : GaugeData S) g.radial.inner_lt_outer (g.length n) g.radial.radialDirection (u.gr c n) } /-- Pressure alias state as an element of `CorrectionState.Oscillation (PressureStream.Lift S)`. -/ -noncomputable def pressureAliasState (g : GaugeData S) +@[expose] noncomputable def pressureAliasState (g : GaugeData S) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : CorrectionState.Oscillation (PressureStream.Lift S) := @@ -573,7 +574,7 @@ noncomputable def pressureAliasState (g : GaugeData S) p.1, 0, 0] /-- Temporal potential, constructed using `streamPotential`. -/ -noncomputable def temporalPotential (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) +@[expose] noncomputable def temporalPotential (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) (n : ℕ) : PressureStream.Lift S → ℝ := streamPotential g.radial.exponent g.radial.inner g.radial.outer (g.radial.frequency n) @@ -581,7 +582,7 @@ noncomputable def temporalPotential (g : GaugeData S) (h : ℝ) (index : ℕ → (u.axialResidual c n)) /-- Temporal increment state, bundling `radial`, `angular`, `axial`. -/ -noncomputable def temporalIncrementState (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) +@[expose] noncomputable def temporalIncrementState (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : MeanIncrementBounds.Triple (PressureStream.Lift S) where @@ -604,7 +605,7 @@ noncomputable def temporalAxialDifference (g : GaugeData S) (h : ℝ) (index : /-- Temporal alias state, defined pointwise by `![0, 0, -c.operators.fastTime (temporalAxialDifference g h index c u) n p.1]`. -/ -noncomputable def temporalAliasState (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) +@[expose] noncomputable def temporalAliasState (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : CorrectionState.Oscillation (PressureStream.Lift S) := @@ -612,7 +613,7 @@ noncomputable def temporalAliasState (g : GaugeData S) (h : ℝ) (index : ℕ /-- Temporal stage state, given by `reconstructState g c (u.addIncrement (temporalIncrementState g h index axial c u) 0 0 0 ⟨0, 0, temporalAliasState g h index c u⟩)`. -/ -noncomputable def temporalStageState (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) +@[expose] noncomputable def temporalStageState (g : GaugeData S) (h : ℝ) (index : ℕ → ℕ) (axial : S × PressureStream.Plane) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : CorrectionState.State (PressureStream.Lift S) := @@ -620,7 +621,7 @@ noncomputable def temporalStageState (g : GaugeData S) (h : ℝ) (index : ℕ ⟨0, 0, temporalAliasState g h index c u⟩) /-- Rank potential, constructed using `streamPotential`. -/ -noncomputable def rankPotential (g : GaugeData S) (r : CorrectionState.RankData S) +@[expose] noncomputable def rankPotential (g : GaugeData S) (r : CorrectionState.RankData S) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) (n : ℕ) : PressureStream.Lift S → ℝ := streamPotential g.radial.exponent g.radial.inner g.radial.outer (g.radial.frequency n) @@ -628,7 +629,7 @@ noncomputable def rankPotential (g : GaugeData S) (r : CorrectionState.RankData (CorrectionState.rankDesiredAxial r c u n)) /-- Rank increment state, bundling `radial`, `angular`, `axial`. -/ -noncomputable def rankIncrementState (g : GaugeData S) (r : CorrectionState.RankData S) +@[expose] noncomputable def rankIncrementState (g : GaugeData S) (r : CorrectionState.RankData S) (axial : S × PressureStream.Plane) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : MeanIncrementBounds.Triple (PressureStream.Lift S) where @@ -642,7 +643,7 @@ noncomputable def rankIncrementState (g : GaugeData S) (r : CorrectionState.Rank /-- Rank stage state, given by `reconstructState g c (u.addIncrement (rankIncrementState g r axial c u) 0 0 0 CorrectionState.ExcludedErrors.zero)`. -/ -noncomputable def rankStageState (g : GaugeData S) (r : CorrectionState.RankData S) +@[expose] noncomputable def rankStageState (g : GaugeData S) (r : CorrectionState.RankData S) (axial : S × PressureStream.Plane) (c : CorrectionState.Context (PressureStream.Lift S)) (u : CorrectionState.State (PressureStream.Lift S)) : CorrectionState.State (PressureStream.Lift S) := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ViscousPropagator.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ViscousPropagator.lean index ef1daa18c1..74faf7250b 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ViscousPropagator.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ViscousPropagator.lean @@ -21,7 +21,7 @@ The auxiliary Hilbert-space lemmas derive an estimate from a differential equation and an energy inequality; no propagator bound is assumed. -/ -@[expose] public section +public section namespace NavierStokes.ViscousPropagator @@ -276,11 +276,15 @@ noncomputable def reflection : Plane →L[ℝ] Plane := ext i fin_cases i <;> simp } +theorem reflection_zero (x : Plane) : reflection x 0 = x 0 := by rfl + +theorem reflection_one (x : Plane) : reflection x 1 = -x 1 := by rfl + /-- `diag(lam,-lam)` as a genuine continuous linear operator. -/ -noncomputable def diagonal (lam : ℝ) : Plane →L[ℝ] Plane := lam • reflection +@[expose] noncomputable def diagonal (lam : ℝ) : Plane →L[ℝ] Plane := lam • reflection /-- The actual diagonalized coefficient, including scalar damping and error. -/ -noncomputable def coefficient (lam damping : ℝ) (E : Plane →L[ℝ] Plane) : +@[expose] noncomputable def coefficient (lam damping : ℝ) (E : Plane →L[ℝ] Plane) : Plane →L[ℝ] Plane := diagonal lam - damping • ContinuousLinearMap.id ℝ Plane + E @@ -426,17 +430,17 @@ theorem homogeneous_viscous_propagator_estimate ring /-- The positive reference eigenvalue appearing in the Gaussian construction. -/ -noncomputable def referenceEigenvalue (lam u ell t : ℝ) : ℝ := +@[expose] noncomputable def referenceEigenvalue (lam u ell t : ℝ) : ℝ := lam / Real.sqrt (1 + (PulseGrowth.slotMagnitude u ell t) ^ 2) /-- The fundamental damping fixed by the manuscript's choice of `B_s`. -/ -noncomputable def referenceViscosity (lam u ell t : ℝ) : ℝ := +@[expose] noncomputable def referenceViscosity (lam u ell t : ℝ) : ℝ := lam * (1 + (PulseGrowth.slotMagnitude u ell t) ^ 2) / ((1 + u ^ 2) * Real.sqrt (1 + u ^ 2)) theorem reference_rate_split (lam u ell t : ℝ) : GaussianEnvelope.referenceRate lam u ell t = - referenceEigenvalue lam u ell t - referenceViscosity lam u ell t := rfl + referenceEigenvalue lam u ell t - referenceViscosity lam u ell t := by rfl theorem referenceEigenvalue_nonneg {lam : ℝ} (hlam : 0 ≤ lam) (u ell t : ℝ) : 0 ≤ referenceEigenvalue lam u ell t := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraParity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraParity.lean index 05ca43ce13..87308b2efa 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraParity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraParity.lean @@ -42,7 +42,7 @@ The functions and radial integrals here are genuine functions and Bochner integrals. The parameter derivative is the actual complex derivative. -/ -@[expose] public section +public section noncomputable section @@ -60,20 +60,20 @@ abbrev Coeff := ℝ → ℂ → Matrix (Fin 6) (Fin 6) ℂ /-- The singular diagonal in the transformed axis equations is (0, 0, 2, 0, 3, 1), with zero-based component indices. -/ -noncomputable def exponent (i : Fin 6) : ℕ := +@[expose] noncomputable def exponent (i : Fin 6) : ℕ := if i.val = 2 then 2 else if i.val = 4 then 3 else if i.val = 5 then 1 else 0 /-- Parameter derivative, defined pointwise by `deriv (fun w : ℂ => F r w i) z`. -/ -noncomputable def parameterDeriv (F : Field) : Field := +@[expose] noncomputable def parameterDeriv (F : Field) : Field := fun r z i => deriv (fun w : ℂ => F r w i) z /-- Normalized form of the regular inverse. It includes r = 0 without division by the radial coordinate. -/ -noncomputable def radialInverse (F : Field) : Field := +@[expose] noncomputable def radialInverse (F : Field) : Field := fun r z i => r • ∫ t : ℝ in (0)..(1), (t ^ exponent i) • F (t * r) z i /-- Matrix action, defined pointwise by `(A r z).mulVec (F r z)`. -/ -noncomputable def matrixAction (A : Coeff) (F : Field) : Field := +@[expose] noncomputable def matrixAction (A : Coeff) (F : Field) : Field := fun r z => (A r z).mulVec (F r z) /-- False is the multiplication letter; true is the parameter-derivative letter. -/ @@ -86,7 +86,7 @@ noncomputable def word (A₀ A₁ : Coeff) : List Bool → Field → Field | b :: w, F => letter A₀ A₁ b (word A₀ A₁ w F) /-- Only the last two rows and first four columns may be nonzero. -/ -def DerivativeShape (A : Coeff) : Prop := +@[expose] def DerivativeShape (A : Coeff) : Prop := ∀ r z (i j : Fin 6), (i.val < 4 ∨ 4 ≤ j.val) → A r z i j = 0 /-- Vanishing of the first four components as actual functions. -/ @@ -639,7 +639,7 @@ end end -@[expose] public section +public section noncomputable section @@ -653,11 +653,11 @@ section RadialInverse variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The normalized integral in the regular inverse of `d/dξ+c/ξ`. -/ -def weightedMean (c : ℕ) (f : ℝ → E) (ξ : ℝ) : E := +@[expose] def weightedMean (c : ℕ) (f : ℝ → E) (ξ : ℝ) : E := ∫ t in (0 : ℝ)..1, (t ^ c) • f (t * ξ) /-- The genuine zero-axis Volterra inverse. -/ -def regularPrimitive (c : ℕ) (f : ℝ → E) (ξ : ℝ) : E := +@[expose] def regularPrimitive (c : ℕ) (f : ℝ → E) (ξ : ℝ) : E := ξ • weightedMean c f ξ theorem weightedMean_continuous (c : ℕ) {f : ℝ → E} (hf : Continuous f) : @@ -860,7 +860,7 @@ def pathInverse {R : ℝ} (hR : 0 ≤ R) (c : Fin 6 → ℕ) : Path R →L[ℂ] theorem pathInverse_apply {R : ℝ} (hR : 0 ≤ R) (c : Fin 6 → ℕ) (f : Path R) (ξ : Icc (0 : ℝ) R) (i : Fin 6) : pathInverse hR c f ξ i = - (ξ : ℝ) • ∫ t in (0 : ℝ)..1, (t ^ c i) • extendPath hR f (t * ξ) i := rfl + (ξ : ℝ) • ∫ t in (0 : ℝ)..1, (t ^ c i) • extendPath hR f (t * ξ) i := by rfl /-- Coefficient action value, given by `⟨fun ξ => A ξ (f ξ), A.continuous.clm_apply f.continuous⟩`. -/ @@ -895,7 +895,7 @@ def coefficientAction {R : ℝ} : CoefficientPath R →L[ℂ] Path R →L[ℂ] P simpa only [one_mul] using norm_coefficientActionValue_le A f) theorem coefficientAction_apply {R : ℝ} (A : CoefficientPath R) (f : Path R) - (ξ : Icc (0 : ℝ) R) : coefficientAction A f ξ = A ξ (f ξ) := rfl + (ξ : Icc (0 : ℝ) R) : coefficientAction A f ξ = A ξ (f ξ) := by rfl /-- Path letter, defined pointwise by `pathInverse hR c (if b then coefficientAction (A₁ z) (deriv F z) else coefficientAction (A₀ z) (F z))`. -/ @@ -939,7 +939,7 @@ def pathEvaluation {R : ℝ} (ξ : Icc (0 : ℝ) R) (i : Fin 6) : Path R →L[ (ContinuousLinearMap.proj i).comp (ContinuousMap.evalCLM ℂ ξ) theorem pathEvaluation_apply {R : ℝ} (ξ : Icc (0 : ℝ) R) (i : Fin 6) (f : Path R) : - pathEvaluation ξ i f = f ξ i := rfl + pathEvaluation ξ i f = f ξ i := by rfl /-- Coordinate evaluation commutes with the genuine complex derivative. -/ theorem pathEvaluation_deriv {R : ℝ} {F : ℂ → Path R} {z : ℂ} @@ -1427,7 +1427,7 @@ theorem liftedField_eq_trace {R : ℝ} (hR : 0 ≤ R) rfl /-- Equation RHS as an element of `VolterraAnalyticBounds.Field`. -/ -def equationRHS (A₀ A₁ : VolterraAnalyticBounds.Coeff) +@[expose] def equationRHS (A₀ A₁ : VolterraAnalyticBounds.Coeff) (f W : VolterraAnalyticBounds.Field) : VolterraAnalyticBounds.Field := fun r z => f r z + (VolterraAnalyticBounds.matrixAction A₀ W r z + VolterraAnalyticBounds.matrixAction A₁ (VolterraAnalyticBounds.parameterDeriv W) r z) @@ -1722,7 +1722,7 @@ end end -@[expose] public section +public section noncomputable section @@ -1734,7 +1734,7 @@ open VolterraAnalyticBounds open NilpotentVolterra (equationRHS) /-- Parity sign, with branches according to `i.val < 4`. -/ -noncomputable def paritySign (i : Fin 6) : ℂ := if i.val < 4 then 1 else -1 +@[expose] noncomputable def paritySign (i : Fin 6) : ℂ := if i.val < 4 then 1 else -1 /-- Parity vector, given by `ContinuousLinearMap.pi (fun i => paritySign i • ContinuousLinearMap.proj i)`. -/ @@ -1742,7 +1742,7 @@ noncomputable def parityVec : Vec →L[ℂ] Vec := ContinuousLinearMap.pi (fun i => paritySign i • ContinuousLinearMap.proj i) @[simp] theorem parityVec_apply (v : Vec) (i : Fin 6) : - parityVec v i = paritySign i * v i := rfl + parityVec v i = paritySign i * v i := by rfl @[simp] theorem paritySign_mul_self (i : Fin 6) : paritySign i * paritySign i = 1 := by by_cases hi : i.val < 4 <;> simp [paritySign, hi] @@ -1753,21 +1753,21 @@ noncomputable def parityVec : Vec →L[ℂ] Vec := /-- Coefficient parity on, given by `∀ r ∈ S, ∀ z ∈ U, ∀ i j, A (-r) z i j = -(paritySign i * paritySign j) * A r z i j`. -/ -def CoefficientParityOn (S : Set ℝ) (U : Set ℂ) (A : Coeff) : Prop := +@[expose] def CoefficientParityOn (S : Set ℝ) (U : Set ℂ) (A : Coeff) : Prop := ∀ r ∈ S, ∀ z ∈ U, ∀ i j, A (-r) z i j = -(paritySign i * paritySign j) * A r z i j /-- Forcing parity on, given by `∀ r ∈ S, ∀ z ∈ U, ∀ i, f (-r) z i = -(paritySign i) * f r z i`. -/ -def ForcingParityOn (S : Set ℝ) (U : Set ℂ) (f : Field) : Prop := +@[expose] def ForcingParityOn (S : Set ℝ) (U : Set ℂ) (f : Field) : Prop := ∀ r ∈ S, ∀ z ∈ U, ∀ i, f (-r) z i = -(paritySign i) * f r z i /-- Coefficient parity, given by `∀ r z i j, A (-r) z i j = -(paritySign i * paritySign j) * A r z i j`. -/ -def CoefficientParity (A : Coeff) : Prop := +@[expose] def CoefficientParity (A : Coeff) : Prop := ∀ r z i j, A (-r) z i j = -(paritySign i * paritySign j) * A r z i j /-- Forcing parity, given by `∀ r z i, f (-r) z i = -(paritySign i) * f r z i`. -/ -def ForcingParity (f : Field) : Prop := +@[expose] def ForcingParity (f : Field) : Prop := ∀ r z i, f (-r) z i = -(paritySign i) * f r z i /-- Reflect field, defined pointwise by `W (-r) z`. -/ @@ -1793,7 +1793,7 @@ noncomputable def reflectedForcing (f : Field) : Field := fun r z => -f (-r) z simp [reflectedForcing] @[simp] theorem parameterDeriv_reflect (W : Field) : - parameterDeriv (reflectField W) = reflectField (parameterDeriv W) := rfl + parameterDeriv (reflectField W) = reflectField (parameterDeriv W) := by rfl theorem equationRHS_reflect (A₀ A₁ : Coeff) (f W : Field) : equationRHS (reflectCoeff A₀) (reflectCoeff A₁) (reflectedForcing f) (reflectField W) = @@ -1818,7 +1818,8 @@ theorem radialInverse_equationRHS_reflect (A₀ A₁ : Coeff) (f W : Field) : rw [equationRHS_reflect, radialInverse_reflect] /-- The actual regular integral equation on a specified radial set. -/ -def IntegralEquationOn (S : Set ℝ) (U : Set ℂ) (A₀ A₁ : Coeff) (f W : Field) : Prop := +@[expose] def IntegralEquationOn (S : Set ℝ) (U : Set ℂ) (A₀ A₁ : Coeff) + (f W : Field) : Prop := ∀ r ∈ S, ∀ z ∈ U, W r z = radialInverse (equationRHS A₀ A₁ f W) r z theorem IntegralEquationOn.reflect {S : Set ℝ} {U : Set ℂ} @@ -2009,13 +2010,13 @@ theorem sideData_holomorphic {R : ℝ} {E : Type*} exact (signedRestriction (E := E) hR b).differentiable.comp_differentiableOn hF /-- Symmetric raw field, defined pointwise by `F z (projIcc (-R) R (by linarith) r)`. -/ -noncomputable def symmetricRawField {R : ℝ} (hR : 0 ≤ R) +@[expose] noncomputable def symmetricRawField {R : ℝ} (hR : 0 ≤ R) (F : ℂ → SymmetricPath R Vec) : Field := fun r z => F z (projIcc (-R) R (by linarith) r) /-- Symmetric raw coefficient, defined pointwise by `LinearMap.toMatrix' (A z (projIcc (-R) R (by linarith) r)).toLinearMap`. -/ -noncomputable def symmetricRawCoefficient {R : ℝ} (hR : 0 ≤ R) +@[expose] noncomputable def symmetricRawCoefficient {R : ℝ} (hR : 0 ≤ R) (A : ℂ → SymmetricCoefficientPath R) : Coeff := fun r z => LinearMap.toMatrix' (A z (projIcc (-R) R (by linarith) r)).toLinearMap @@ -2110,7 +2111,7 @@ theorem positive_equation_change_data {R : ℝ} {U : Set ℂ} simp only [equationRHS, matrixAction, h₀ _ htr _ hz, h₁ _ htr _ hz, hf _ htr _ hz] /-- Side solution, constructed using `NilpotentVolterra.liftedField`. -/ -noncomputable def sideSolution {R : ℝ} (hR : 0 ≤ R) (b : Bool) +@[expose] noncomputable def sideSolution {R : ℝ} (hR : 0 ≤ R) (b : Bool) (A₀ A₁ : ℂ → SymmetricCoefficientPath R) (f : ℂ → SymmetricPath R Vec) : Field := NilpotentVolterra.liftedField hR (sideData hR b A₀) (sideData hR b A₁) (sideData hR b f) (NilpotentVolterra.integralSolution hR @@ -2118,7 +2119,7 @@ noncomputable def sideSolution {R : ℝ} (hR : 0 ≤ R) (b : Bool) /-- Two independently solved half-intervals are glued at their common zero axis trace. No parity of the output occurs in this definition. -/ -noncomputable def symmetricSolution {R : ℝ} (hR : 0 ≤ R) +@[expose] noncomputable def symmetricSolution {R : ℝ} (hR : 0 ≤ R) (A₀ A₁ : ℂ → SymmetricCoefficientPath R) (f : ℂ → SymmetricPath R Vec) : Field := glue (sideSolution hR false A₀ A₁ f) (sideSolution hR true A₀ A₁ f) @@ -2221,7 +2222,7 @@ noncomputable def parityPath (R : ℝ) : ContinuousLinearMap.compLeftContinuous ℂ (Icc (0 : ℝ) R) parityVec @[simp] theorem parityPath_apply {R : ℝ} (W : NilpotentVolterra.Path R) - (r : Icc (0 : ℝ) R) : parityPath R W r = parityVec (W r) := rfl + (r : Icc (0 : ℝ) R) : parityPath R W r = parityVec (W r) := by rfl @[simp] theorem parityPath_involutive {R : ℝ} (W : NilpotentVolterra.Path R) : parityPath R (parityPath R W) = W := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraRegularity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraRegularity.lean index e00d7c2d81..e0096818d4 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/VolterraRegularity.lean @@ -25,7 +25,7 @@ do not identify the clamped extension of a positive path with a smooth extension across zero. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEdgeExtension.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEdgeExtension.lean index 5881d088e5..0af2d1c3c9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEdgeExtension.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEdgeExtension.lean @@ -18,7 +18,7 @@ its actual full derivative tensors prove that its literal zero extension has all derivatives zero on both moving boundary hypersurfaces. -/ -@[expose] public section +public section noncomputable section @@ -40,7 +40,7 @@ noncomputable def windowDomain (Ω : Set D) (ρ : D → ℝ) (a b : ℝ) : Set D Ω ∩ window ρ a b /-- Extension as an element of `E`. -/ -noncomputable def extension (ρ : D → ℝ) (a b : ℝ) (f : D → E) (x : D) : E := +@[expose] noncomputable def extension (ρ : D → ℝ) (a b : ℝ) (f : D → E) (x : D) : E := by classical exact if x ∈ window ρ a b then f x else 0 omit [NormedAddCommGroup D] [NormedSpace ℝ D] [NormedSpace ℝ E] in @@ -126,7 +126,7 @@ theorem hasFDerivAt_extension_boundary {ρ d : D → ℝ} {a b c : ℝ} exact mul_nonneg hε.le (norm_nonneg _) /-- Log coordinate, given by `WeightedRadialPrimitive.logPosition a (ρ x)`. -/ -noncomputable def logCoordinate (ρ : D → ℝ) (a : ℝ) (x : D) : ℝ := +@[expose] noncomputable def logCoordinate (ρ : D → ℝ) (a : ℝ) (x : D) : ℝ := WeightedRadialPrimitive.logPosition a (ρ x) theorem logCoordinate_differentiableAt {ρ : D → ℝ} {a : ℝ} (ha : 0 < a) {x : D} @@ -298,7 +298,7 @@ noncomputable def flatWeight (ρ : D → ℝ) (a b cL cR : ℝ) (x : D) : ℝ := /-- Edge growth, given by `max 1 (WeightedRadialPrimitive.delta (WeightedRadialPrimitive.logLength a b) (logCoordinate ρ a x))⁻¹`. -/ -noncomputable def edgeGrowth (ρ : D → ℝ) (a b : ℝ) (x : D) : ℝ := +@[expose] noncomputable def edgeGrowth (ρ : D → ℝ) (a b : ℝ) (x : D) : ℝ := max 1 (WeightedRadialPrimitive.delta (WeightedRadialPrimitive.logLength a b) (logCoordinate ρ a x))⁻¹ @@ -468,7 +468,7 @@ abbrev NativePoint := PhaseCalculus.Slow × TorusInverse.Plane noncomputable def nativeSlowDomain : Set NativePoint := {x | 0 < x.1.2.2} /-- Native radius, given by `PrimaryTargetBounds.profileRadius h x.1`. -/ -noncomputable def nativeRadius (h : ℝ) (x : NativePoint) : ℝ := +@[expose] noncomputable def nativeRadius (h : ℝ) (x : NativePoint) : ℝ := PrimaryTargetBounds.profileRadius h x.1 theorem nativeSlowDomain_open : IsOpen nativeSlowDomain := @@ -489,6 +489,7 @@ theorem nativeRadius_smooth {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) : /-- Native extension, given by `extension (nativeRadius F.data.h) (PrimaryTargetBounds.leftRadius W) (PrimaryTargetBounds.rightRadius W) f`. -/ +@[expose] noncomputable def nativeExtension {F : OutgoingProfile.Profile} (W : NominalProfile.Witness F) (f : NativePoint → E) : NativePoint → E := extension (nativeRadius F.data.h) (PrimaryTargetBounds.leftRadius W) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEnvelopeTransport.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEnvelopeTransport.lean index b361501ff1..1258fafd81 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEnvelopeTransport.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveEnvelopeTransport.lean @@ -18,7 +18,7 @@ of the padded native rectangle identifies the one copy met by a slot path. The source itself is not assumed periodic on the native torus. -/ -@[expose] public section +public section noncomputable section @@ -64,7 +64,7 @@ theorem copy_unique {g : Geometry} {r L : ℝ} (hsep : Separated g r L) /-- The envelope of the grouped label on the common cover. The summands are nonzero only on their own native integration rectangles. -/ -noncomputable def copyEnvelope (g : Geometry) (r L : ℝ) (W : ℝ → ℝ) (Y : Plane) : ℝ := by +@[expose] noncomputable def copyEnvelope (g : Geometry) (r L : ℝ) (W : ℝ → ℝ) (Y : Plane) : ℝ := by classical exact ∑' k : Frequency, if g.coordinates k Y ∈ rectangle r L then W (g.coordinates k Y).2 else 0 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveInteractionBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveInteractionBounds.lean index 7197e8f5ae..ea9baa5c25 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveInteractionBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveInteractionBounds.lean @@ -17,7 +17,7 @@ Only stripped coefficients are placed in the weighted classes. The carrier is retained in the exact differential identities and is removed before estimating. -/ -@[expose] public section +public section namespace NavierStokes.WaveInteractionBounds @@ -185,7 +185,7 @@ def AngularIndependent {s : StripData D} {κ : ℝ} (G : Geometry s κ) (a : Fam ∀ n i x, x ∈ s.domain → along (G.angular n) (fun y => a n y i) x = 0 /-- Stripped transport as an element of `Family D`. -/ -noncomputable def strippedTransport {s : StripData D} {κ : ℝ} +@[expose] noncomputable def strippedTransport {s : StripData D} {κ : ℝ} (G : Geometry s κ) (a b : Family D) : Family D := fun n x i => a n x 0 * along (G.radial n) (fun y => b n y i) x + (a n x 1 / (G.radius n x : ℂ)) * angularGenerator (b n x) i + @@ -387,7 +387,7 @@ theorem phaseFactor_class {s : StripData D} {w : ℕ → D → ℝ} {α β : ℝ ring /-- Wave mean coefficient as an element of `Family D`. -/ -noncomputable def waveMeanCoefficient {s : StripData D} {κ : ℝ} (G : Geometry s κ) +@[expose] noncomputable def waveMeanCoefficient {s : StripData D} {κ : ℝ} (G : Geometry s κ) (Φ : ℕ → D → ℝ) (ν : ℕ → ℝ) (m a : Family D) : Family D := fun n x i => strippedTransport G m a n x i + strippedTransport G a m n x i + phaseFactor (ν n) * normalDot @@ -454,7 +454,7 @@ theorem switched_longitudinal (R : D → ℝ) (Vr Vθ Vz : D → D) (ν ξ : ℝ rfl /-- Same coefficient as an element of `Family D`. -/ -noncomputable def sameCoefficient {s : StripData D} {κ : ℝ} (G : Geometry s κ) +@[expose] noncomputable def sameCoefficient {s : StripData D} {κ : ℝ} (G : Geometry s κ) (Φ : ℕ → D → ℝ) (ξ : ℕ → ℝ) (a b : Family D) : Family D := fun n x i => strippedTransport G a b n x i + phaseFactor (ξ n) * normalDot (phaseNormal (G.radius n) (G.radial n) (G.angular n) (G.axial n) (Φ n) x) (a n x) * b n x i diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveStateRegularity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveStateRegularity.lean index 15cdff8a9e..7f2b5bf9c9 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WaveStateRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WaveStateRegularity.lean @@ -18,7 +18,7 @@ domination of its genuine parameter derivatives. No covariance regularity or covariance formula is an input. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedClasses.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedClasses.lean index fff3be2694..01c71db65f 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedClasses.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedClasses.lean @@ -22,7 +22,7 @@ strips used by the construction. Radiality of the prescribed smooth weight is not needed for these closure results. -/ -@[expose] public section +public section namespace NavierStokes.WeightedClasses @@ -64,7 +64,7 @@ abbrev EuclideanStripData (d : ℕ) := StripData (EuclideanSpace ℝ (Fin d)) /-- A common polynomial degree in `S` and the inverse edge distance is enough: separate finite degrees can always be increased to their sum. The maximum permits arbitrary positive `delta`, agreeing with `delta⁻¹` when `delta ≤ 1`. -/ -def StripData.growth (s : StripData D) (n : ℕ) (x : D) : ℝ := +@[expose] def StripData.growth (s : StripData D) (n : ℕ) (x : D) : ℝ := s.slow n * max 1 (s.delta x)⁻¹ theorem StripData.one_le_growth (s : StripData D) (n : ℕ) (x : D) : @@ -93,7 +93,7 @@ theorem StripData.separate_powers_le_growth (s : StripData D) (p q n : ℕ) (x : (pow_le_pow_left₀ he0 he q) (pow_nonneg he0 q) (pow_nonneg (s.growth_nonneg n x) p) /-- Majorant, given by `C * s.epsilon n ^ α * s.growth n x ^ p * w n x`. -/ -def majorant (s : StripData D) (w : ℕ → D → ℝ) (α C : ℝ) (p n : ℕ) (x : D) : ℝ := +@[expose] def majorant (s : StripData D) (w : ℕ → D → ℝ) (α C : ℝ) (p n : ℕ) (x : D) : ℝ := C * s.epsilon n ^ α * s.growth n x ^ p * w n x theorem majorant_nonneg (s : StripData D) (w : ℕ → D → ℝ) (α : ℝ) @@ -149,7 +149,7 @@ def StageClasses (s : StripData D) (w : ℕ → D → ℝ) (α : ℕ → ℝ) /-- A bound on a band-dependent scalar. There is no spatial derivative of the discrete band index. -/ -def BandBound (s : StripData D) (β : ℝ) (a : ℕ → ℝ) : Prop := +@[expose] def BandBound (s : StripData D) (β : ℝ) (a : ℕ → ℝ) : Prop := ∃ C : ℝ, 0 ≤ C ∧ ∃ p : ℕ, ∀ n, ‖a n‖ ≤ C * s.epsilon n ^ β * s.slow n ^ p @@ -480,7 +480,7 @@ theorem MeanClass.bilinear_wave {s : StripData D} {P : ℕ → D → ℝ} /-- An explicit radial graph operator with a band coefficient `M` and a spatial coefficient `a`. The two directions can be radial and auxiliary. -/ -noncomputable def graphDerivative (M : ℕ → ℝ) (a : D → ℝ) (e v : D) +@[expose] noncomputable def graphDerivative (M : ℕ → ℝ) (a : D → ℝ) (e v : D) (f : ℕ → D → E) : ℕ → D → E := fun n x => fderiv ℝ (f n) x e + M n • (a x • fderiv ℝ (f n) x v) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedODEJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedODEJets.lean index 6d00b59717..3ff33acc23 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedODEJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedODEJets.lean @@ -19,7 +19,7 @@ directions. The differentiated Volterra equation gives a triangular system; the energy estimate, rather than an uncontrolled inverse norm, estimates it. -/ -@[expose] public section +public section namespace NavierStokes.WeightedODEJets @@ -42,10 +42,10 @@ from the head of the word to its tail; the empty word means order zero. -/ noncomputable def jet (f : P → E) (l : List P) : P → E := l.foldl (fun g v => directional g v) f -@[simp] theorem jet_nil (f : P → E) : jet f [] = f := rfl +@[simp] theorem jet_nil (f : P → E) : jet f [] = f := by rfl @[simp] theorem jet_cons (f : P → E) (v : P) (l : List P) : - jet f (v :: l) = jet (directional f v) l := rfl + jet f (v :: l) = jet (directional f v) l := by rfl /-- Restricting all directions to the unit ball converts the estimates to uniform bounds for all mixed parameter derivatives of a given order. -/ @@ -238,6 +238,7 @@ theorem directional_product {U : Set P} (hU : IsOpen U) (hlin.clm_apply hdu.hasFDerivAt).fderiv simp only [_root_.add_apply, ContinuousLinearMap.comp_apply, ContinuousLinearMap.flip_apply, add_comm] at h + simp only [coefficientAction_apply_curve] at h convert! h using 1; apply add_comm theorem jet_product {U : Set P} (hU : IsOpen U) @@ -254,9 +255,11 @@ theorem jet_product {U : Set P} (hU : IsOpen U) (E := Coefficient a b E) (F := Curve a b E →L[ℝ] Curve a b E) (coefficientAction (E := E)) have hleft : ContDiffOn ℝ ∞ (fun p => applyCoefficient (directional A v p) (u p)) U := - (hcoeff.comp_contDiffOn hdA).clm_apply hu + by simpa only [Function.comp_def, coefficientAction_apply_curve] using + (hcoeff.comp_contDiffOn hdA).clm_apply hu have hright : ContDiffOn ℝ ∞ (fun p => applyCoefficient (A p) (directional u v p)) U := - (hcoeff.comp_contDiffOn hA).clm_apply hdu + by simpa only [Function.comp_def, coefficientAction_apply_curve] using + (hcoeff.comp_contDiffOn hA).clm_apply hdu intro p hp calc jet (fun p => applyCoefficient (A p) (u p)) (v :: l) p = @@ -360,7 +363,8 @@ theorem jet_solution_eq_solution (hab : a ≤ b) {U : Set P} (hU : IsOpen U) (E := Coefficient a b E) (F := Curve a b E →L[ℝ] Curve a b E) (coefficientAction (E := E)) have hAu : ContDiffOn ℝ ∞ (fun q => applyCoefficient (A q) (u q)) U := - (hcoeff.comp_contDiffOn hA).clm_apply hu + by simpa only [Function.comp_def, coefficientAction_apply_curve] using + (hcoeff.comp_contDiffOn hA).clm_apply hu have hright : EqOn u (fun q => constantCurve (x₀ q) + integrator hab (applyCoefficient (A q) (u q) + f q)) U := fun q _ => solution_integralEquation hab (A q) (x₀ q) (f q) @@ -395,8 +399,7 @@ theorem jet_solution_eq_solution (hab : a ≤ b) {U : Set P} (hU : IsOpen U) (constantCurve (jet x₀ l p) + integrator hab (jetSource A f u l p)) symm apply (equationOperator_isInvertible hab (A p)).inverse_apply_eq.mpr - change constantCurve (jet x₀ l p) + integrator hab (jetSource A f u l p) = - jet u l p - integrator hab (applyCoefficient (A p) (jet u l p)) + rw [equationOperator_apply_curve] rw [(integrator hab).map_add] at hj exact (eq_sub_iff_add_eq.mpr (by simpa only [add_assoc, add_comm, add_left_comm] using hj.symm)) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedQuotients.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedQuotients.lean index 2b7588713d..ed158cee23 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedQuotients.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/WeightedQuotients.lean @@ -31,7 +31,7 @@ bound proves that its derivative at the edge is zero, using `δ ≤ ‖(p,δ) - (p₀,0)‖`. No pointwise-to-joint limit inference is used. -/ -@[expose] public section +public section noncomputable section @@ -269,7 +269,7 @@ end end -@[expose] public section +public section noncomputable section @@ -830,7 +830,7 @@ abbrev edgeStrip (U : Set E) : Set (E × ℝ) := U ×ˢ Ioo 0 1 /-- All full derivative tensors satisfy an exponential weight times fixed powers of the allowed scale and inverse edge distance. -/ -def WeightedJets (c : ℝ) (U : Set E) (S : E × ℝ → ℝ) (f : E × ℝ → ℝ) : Prop := +@[expose] def WeightedJets (c : ℝ) (U : Set E) (S : E × ℝ → ℝ) (f : E × ℝ → ℝ) : Prop := ∀ n : ℕ, PolyBound (edgeStrip U) S (fun p => p.2⁻¹) (fun p => ‖iteratedFDeriv ℝ n f p‖ / FlatCutoff.edge c p.2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ZerothStressIdentity.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ZerothStressIdentity.lean index 82a82a4f9e..b527aaa6bb 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ZerothStressIdentity.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ZerothStressIdentity.lean @@ -17,7 +17,7 @@ derivatives are the negative weighted residuals, so the lower integration endpoint fixes the constant and identifies the constructed stress. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Neukirch.lean b/LeanPool/Neukirch.lean index 234a6a98df..813c361480 100644 --- a/LeanPool/Neukirch.lean +++ b/LeanPool/Neukirch.lean @@ -20,7 +20,7 @@ Tags: number-theory, algebraic-number-theory, ramification, galois-theory MSC: 11R32, 11S15, 13B25 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean b/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean index 93d710c916..42ce925caf 100644 --- a/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean +++ b/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Neukirch.ExtensionOfDedekindDomains`. -/ -@[expose] public section +public section open IsDedekindDomain Algebra UniqueFactorizationMonoid Ideal.IsDedekindDomain Multiset Module diff --git a/LeanPool/Neukirch/HilbertRamificationTheory.lean b/LeanPool/Neukirch/HilbertRamificationTheory.lean index 03e3b892c5..f5eb7b8113 100644 --- a/LeanPool/Neukirch/HilbertRamificationTheory.lean +++ b/LeanPool/Neukirch/HilbertRamificationTheory.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.Neukirch.HilbertRamificationTheory`. -/ -@[expose] public section +public section open Algebra @@ -528,7 +528,7 @@ def GalRingHom (σ : L ≃ₐ[K] L) : RingHom (𝓞 L) (𝓞 L) := (GalAlgEquiv σ).toAlgHom.toRingHom theorem GalAlgEquiv_toAlgHom_toRingHom_eq_GalRingHom (σ : L ≃ₐ[K] L) : - (GalAlgEquiv σ).toAlgHom.toRingHom = GalRingHom σ := rfl + (GalAlgEquiv σ).toAlgHom.toRingHom = GalRingHom σ := by rfl theorem GalRingHom_mul (σ τ : L ≃ₐ[K] L) : (GalRingHom σ).comp (GalRingHom τ) = GalRingHom (σ * τ) := by @@ -799,7 +799,7 @@ theorem DecompositionGroup_mem (σ : L ≃ₐ[K] L) : open IntermediateField Module FiniteDimensional /-- The decomposition field of `P` over `K` is the fixed field of `DecompositionGroup p P`. -/ -def DecompositionField : IntermediateField K L := fixedField (DecompositionGroup p P) +@[expose] def DecompositionField : IntermediateField K L := fixedField (DecompositionGroup p P) /-- DecompositionField is a Number Field. -/ instance DecompositionField_NumberField : NumberField (DecompositionField p P) := diff --git a/LeanPool/Nivat/Algebra/Action.lean b/LeanPool/Nivat/Algebra/Action.lean index c1dc156286..c5df616d53 100644 --- a/LeanPool/Nivat/Algebra/Action.lean +++ b/LeanPool/Nivat/Algebra/Action.lean @@ -51,7 +51,7 @@ The principal identities are `act_apply`, `act_mul`, `act_difference`, and class of finite-range rational configurations is closed under every operator. -/ -@[expose] public section +public section namespace Nivat @@ -61,7 +61,7 @@ abbrev Laurent := AddMonoidAlgebra ℚ Lattice namespace Algebra /-- Section 1.1 (Notation): a forward lattice translation as a rational linear endomorphism. -/ -def shiftLinear (h : Lattice) : Module.End ℚ (Configuration ℚ) where +@[expose] def shiftLinear (h : Lattice) : Module.End ℚ (Configuration ℚ) where toFun := shift h map_add' _ _ := rfl map_smul' _ _ := rfl @@ -72,7 +72,7 @@ def shiftLinear (h : Lattice) : Module.End ℚ (Configuration ℚ) where /-- Section 1.1 (Notation): the additive lattice acts on configurations by commuting forward shifts. -/ -def shiftRepresentation : Multiplicative Lattice →* Module.End ℚ (Configuration ℚ) where +@[expose] def shiftRepresentation : Multiplicative Lattice →* Module.End ℚ (Configuration ℚ) where toFun h := shiftLinear h.toAdd map_one' := by ext c z; simp [shiftLinear, shift] map_mul' h t := by @@ -82,12 +82,12 @@ def shiftRepresentation : Multiplicative Lattice →* Module.End ℚ (Configurat /-- Section 1.1 (Notation): the algebra homomorphism extending lattice translations to Laurent filters. -/ -noncomputable def actionHom : Laurent →ₐ[ℚ] Module.End ℚ (Configuration ℚ) := +@[expose] noncomputable def actionHom : Laurent →ₐ[ℚ] Module.End ℚ (Configuration ℚ) := AddMonoidAlgebra.lift ℚ (Module.End ℚ (Configuration ℚ)) Lattice shiftRepresentation /-- Section 1.1 (Notation): the finite Laurent polynomial operator applied to a rational configuration. -/ -noncomputable def act (f : Laurent) (c : Configuration ℚ) : Configuration ℚ := +@[expose] noncomputable def act (f : Laurent) (c : Configuration ℚ) : Configuration ℚ := actionHom f c /-- Section 1.1 (Notation): the operator is the finite sum of coefficients times forward-shifted @@ -156,7 +156,7 @@ theorem act_smul (a : ℚ) (f : Laurent) (c : Configuration ℚ) : simp [act, actionHom, shiftRepresentation, shiftLinear] /-- Section 1.1 (Notation): the lattice monomial with exponent `h` and coefficient one. -/ -noncomputable def monomial (h : Lattice) : Laurent := AddMonoidAlgebra.single h 1 +@[expose] noncomputable def monomial (h : Lattice) : Laurent := AddMonoidAlgebra.single h 1 /-- Section 1.1 (Notation): the zero-exponent monomial is the multiplicative identity. -/ @[simp] theorem monomial_zero : monomial 0 = 1 := rfl diff --git a/LeanPool/Nivat/Algebra/ExactLine.lean b/LeanPool/Nivat/Algebra/ExactLine.lean index 68d97ec31b..19bcb963a8 100644 --- a/LeanPool/Nivat/Algebra/ExactLine.lean +++ b/LeanPool/Nivat/Algebra/ExactLine.lean @@ -63,7 +63,7 @@ monomial unit extends coefficient divisibility to all Laurent filters. Finally, exponent reindexing transports the equality through the lattice basis. -/ -@[expose] public section +public section namespace Nivat.Algebra diff --git a/LeanPool/Nivat/Algebra/LineErosion.lean b/LeanPool/Nivat/Algebra/LineErosion.lean index 11620a7796..cc2e585512 100644 --- a/LeanPool/Nivat/Algebra/LineErosion.lean +++ b/LeanPool/Nivat/Algebra/LineErosion.lean @@ -54,7 +54,7 @@ and the filtered complexity inequality in Corollary 2.3 come from combines them with the geometry proved here. -/ -@[expose] public section +public section namespace Nivat.Algebra diff --git a/LeanPool/Nivat/Algebra/LowComplexity.lean b/LeanPool/Nivat/Algebra/LowComplexity.lean index 68e2b85051..506c08e32b 100644 --- a/LeanPool/Nivat/Algebra/LowComplexity.lean +++ b/LeanPool/Nivat/Algebra/LowComplexity.lean @@ -52,13 +52,13 @@ and reconstruction lemmas also supply the finite-dimensional pairing used in Theorem 2.2 (`thm:descent`). -/ -@[expose] public section +public section namespace Nivat.Algebra /-- Auxiliary construction for Lemma 3.2 (`lem:ann-exists`): identify a coefficient vector on a finite window with its supported Laurent polynomial. -/ -noncomputable def windowPolynomial (D : Finset Lattice) (a : D → ℚ) : Laurent := +@[expose] noncomputable def windowPolynomial (D : Finset Lattice) (a : D → ℚ) : Laurent := ∑ z : D, AddMonoidAlgebra.single z.1 (a z) /-- Auxiliary construction for Lemma 3.2 (`lem:ann-exists`): the supported polynomial recovers each @@ -109,7 +109,8 @@ theorem windowPolynomial_reconstruct (D : Finset Lattice) (f : Laurent) /-- Auxiliary construction for Lemma 3.2 (`lem:ann-exists`): the supported-polynomial identification as a rational linear map. -/ -noncomputable def windowPolynomialLinear (D : Finset Lattice) : (D → ℚ) →ₗ[ℚ] Laurent where +@[expose] noncomputable def windowPolynomialLinear (D : Finset Lattice) : + (D → ℚ) →ₗ[ℚ] Laurent where toFun := windowPolynomial D map_add' a b := by classical diff --git a/LeanPool/Nivat/Algebra/ProductDifferences.lean b/LeanPool/Nivat/Algebra/ProductDifferences.lean index c983587112..01db06d0b7 100644 --- a/LeanPool/Nivat/Algebra/ProductDifferences.lean +++ b/LeanPool/Nivat/Algebra/ProductDifferences.lean @@ -62,7 +62,7 @@ gives a product of `M - 1`. Casting back to rationals and cancelling the nonzero scaling factors concludes the proof. -/ -@[expose] public section +public section namespace Nivat.Algebra diff --git a/LeanPool/Nivat/Algebra/RationalScaling.lean b/LeanPool/Nivat/Algebra/RationalScaling.lean index c8e142edca..720311a725 100644 --- a/LeanPool/Nivat/Algebra/RationalScaling.lean +++ b/LeanPool/Nivat/Algebra/RationalScaling.lean @@ -48,7 +48,7 @@ two nonzero multipliers. The map `intLaurentCast` changes only the coefficient ring, so the resulting equations still concern the full integer lattice. -/ -@[expose] public section +public section namespace Nivat.Algebra @@ -58,7 +58,7 @@ abbrev IntegerLaurent := AddMonoidAlgebra ℤ Lattice /-- The coefficient embedding from integer to rational Laurent polynomials in Appendix A (`app:product`), preserving every lattice exponent. -/ -noncomputable def intLaurentCast : IntegerLaurent →+* Laurent := +@[expose] noncomputable def intLaurentCast : IntegerLaurent →+* Laurent := AddMonoidAlgebra.mapRingHom Lattice (Int.castRingHom ℚ) /-- Auxiliary to the scaling step of Appendix A (`app:product`): coefficient embedding acts diff --git a/LeanPool/Nivat/Algebra/RectangleSupport.lean b/LeanPool/Nivat/Algebra/RectangleSupport.lean index 7f0cd0b1ac..764b8dea90 100644 --- a/LeanPool/Nivat/Algebra/RectangleSupport.lean +++ b/LeanPool/Nivat/Algebra/RectangleSupport.lean @@ -53,7 +53,7 @@ associated dimension calculation from Lemma 2.1 are constructed in `Nivat.Descent.ExactDescent`, where they enter Theorem 2.2 (`thm:descent`). -/ -@[expose] public section +public section namespace Nivat.Algebra diff --git a/LeanPool/Nivat/Core/Alphabet.lean b/LeanPool/Nivat/Core/Alphabet.lean index e467fe293b..25a15bc84e 100644 --- a/LeanPool/Nivat/Core/Alphabet.lean +++ b/LeanPool/Nivat/Core/Alphabet.lean @@ -45,7 +45,7 @@ The reduction in Section 1.1, used in Section 6 to prove Theorem 1.1 (`thm:main` `exists_rational_model` preserves all pattern counts and all individual periods. -/ -@[expose] public section +public section namespace Nivat diff --git a/LeanPool/Nivat/Core/Basic.lean b/LeanPool/Nivat/Core/Basic.lean index 3787d8965a..6228784507 100644 --- a/LeanPool/Nivat/Core/Basic.lean +++ b/LeanPool/Nivat/Core/Basic.lean @@ -48,7 +48,7 @@ The configuration, period and operator notation of Section 1.1 of The forward-shift convention is shared by the Laurent action and pattern pairing. -/ -@[expose] public section +public section namespace Nivat @@ -59,23 +59,23 @@ abbrev Lattice := ℤ × ℤ abbrev Configuration (A : Type*) := Lattice → A /-- The forward translation `Tʰc`, with `(Tʰc)(z) = c(z + h)` (Section 1.1). -/ -def shift {A : Type*} (h : Lattice) (c : Configuration A) : Configuration A := +@[expose] def shift {A : Type*} (h : Lattice) (c : Configuration A) : Configuration A := fun z => c (z + h) /-- A configuration takes values in a finite set (Section 1.1). -/ -def FiniteRange {A : Type*} (c : Configuration A) : Prop := (Set.range c).Finite +@[expose] def FiniteRange {A : Type*} (c : Configuration A) : Prop := (Set.range c).Finite /-- A vector fixes the configuration at every lattice site (Section 1). This predicate allows zero; `Periodic` requires a nonzero witness. -/ -def IsPeriod {A : Type*} (c : Configuration A) (h : Lattice) : Prop := +@[expose] def IsPeriod {A : Type*} (c : Configuration A) (h : Lattice) : Prop := ∀ z, c (z + h) = c z /-- Existence of one nonzero global period, the conclusion of Theorem 1.1 (`thm:main`). -/ -def Periodic {A : Type*} (c : Configuration A) : Prop := +@[expose] def Periodic {A : Type*} (c : Configuration A) : Prop := ∃ h : Lattice, h ≠ 0 ∧ IsPeriod c h /-- The difference operator `Δₕ = Tʰ - I` from Section 1.1. -/ -def difference {A : Type*} [AddCommGroup A] (h : Lattice) +@[expose] def difference {A : Type*} [AddCommGroup A] (h : Lattice) (c : Configuration A) : Configuration A := shift h c - c /-- Evaluation of the forward shift from Section 1.1. -/ diff --git a/LeanPool/Nivat/Core/BoundedDifferences.lean b/LeanPool/Nivat/Core/BoundedDifferences.lean index de927ba10e..4ac7f57fcd 100644 --- a/LeanPool/Nivat/Core/BoundedDifferences.lean +++ b/LeanPool/Nivat/Core/BoundedDifferences.lean @@ -56,7 +56,7 @@ specialization `difference_eq_zero_of_iterate`, and the orbit-closure difference in Corollary 3.6 (`cor:periodic-difference`). -/ -@[expose] public section +public section namespace Nivat diff --git a/LeanPool/Nivat/Core/Lattice.lean b/LeanPool/Nivat/Core/Lattice.lean index e425a8f442..f9e8149fbc 100644 --- a/LeanPool/Nivat/Core/Lattice.lean +++ b/LeanPool/Nivat/Core/Lattice.lean @@ -53,7 +53,7 @@ rational extension permits convex windows to be transported through the same coordinate change as the lattice configurations. -/ -@[expose] public section +public section namespace Nivat @@ -114,7 +114,7 @@ theorem exists_lattice_basis_for_nonzero (h : Lattice) (hh : h ≠ 0) : /-- The coordinate embedding of the integer lattice into the rational plane, used to express convexity in the coordinate normalization of Theorem 5.1. -/ -def latticeRatCast (z : Lattice) : ℚ × ℚ := (z.1, z.2) +@[expose] def latticeRatCast (z : Lattice) : ℚ × ℚ := (z.1, z.2) /-- The rational linear extension of a lattice equivalence, used to transport convex windows in the proof of Theorem 5.1. -/ diff --git a/LeanPool/Nivat/Core/Patterns.lean b/LeanPool/Nivat/Core/Patterns.lean index 08293a7979..622deac568 100644 --- a/LeanPool/Nivat/Core/Patterns.lean +++ b/LeanPool/Nivat/Core/Patterns.lean @@ -50,12 +50,12 @@ invariance under translations and injective relabeling. Unique extension is the counting step used in Lemma 5.5 (`lem:boundary-window`). -/ -@[expose] public section +public section namespace Nivat /-- The window `Rₘ,ₙ = {0, …, m-1} × {0, …, n-1}` from Section 1. -/ -def rectangle (m n : ℕ) : Finset Lattice := +@[expose] def rectangle (m n : ℕ) : Finset Lattice := (Finset.Ico (0 : ℤ) (m : ℤ)).product (Finset.Ico (0 : ℤ) (n : ℤ)) /-- Coordinate inequalities describing the rectangle of Section 1. -/ @@ -68,17 +68,17 @@ def rectangle (m n : ℕ) : Finset Lattice := simp [rectangle, Int.card_Ico] /-- The restriction of `Tᵘc` to `D`, indexed by the sites of `D` (Section 1). -/ -def patternAt {A : Type*} (c : Configuration A) (D : Finset Lattice) (u : Lattice) : +@[expose] def patternAt {A : Type*} (c : Configuration A) (D : Finset Lattice) (u : Lattice) : D → A := fun z => c (z.1 + u) /-- The set `Pat_c(D)` of distinct restrictions over all lattice translations (Section 1). -/ -def patterns {A : Type*} (c : Configuration A) (D : Finset Lattice) : Set (D → A) := +@[expose] def patterns {A : Type*} (c : Configuration A) (D : Finset Lattice) : Set (D → A) := Set.range (patternAt c D) /-- The pattern count `P_c(D)` from Section 1. For finite-range configurations, `patterns_finite` ensures that natural set cardinality counts this finite set; repeated occurrences contribute only one pattern. -/ -noncomputable def complexity {A : Type*} (c : Configuration A) (D : Finset Lattice) : ℕ := +@[expose] noncomputable def complexity {A : Type*} (c : Configuration A) (D : Finset Lattice) : ℕ := (patterns c D).ncard /-- The signed discrepancy `δ_c(D) = P_c(D) - |D|` from Section 1.1. -/ @@ -129,7 +129,7 @@ theorem patterns_shift {A : Type*} (c : Configuration A) (D : Finset Lattice) simp only [complexity, patterns_shift] /-- Restriction of a pattern to a smaller window (Section 1.1). -/ -def restrictPattern {A : Type*} {C D : Finset Lattice} (hCD : C ⊆ D) +@[expose] def restrictPattern {A : Type*} {C D : Finset Lattice} (hCD : C ⊆ D) (p : D → A) : C → A := fun z => p ⟨z.1, hCD z.2⟩ /-- Restriction maps onto all occurring patterns on the smaller window (Section 1.1). -/ diff --git a/LeanPool/Nivat/Core/Reindex.lean b/LeanPool/Nivat/Core/Reindex.lean index cd288cb602..385c2326c0 100644 --- a/LeanPool/Nivat/Core/Reindex.lean +++ b/LeanPool/Nivat/Core/Reindex.lean @@ -46,7 +46,7 @@ A configuration and its window are transported together. The affine map `s` acts on sites, while its additive part `t` acts on translation and period vectors. -/ -@[expose] public section +public section namespace Nivat diff --git a/LeanPool/Nivat/Descent/ExactDescent.lean b/LeanPool/Nivat/Descent/ExactDescent.lean index 66b3e0c6b8..d55c6cc8c9 100644 --- a/LeanPool/Nivat/Descent/ExactDescent.lean +++ b/LeanPool/Nivat/Descent/ExactDescent.lean @@ -55,7 +55,7 @@ The geometry of supported multiples is in `Nivat.Algebra.RectangleSupport`; the finite fiber-counting argument is in `Nivat.Descent.FiberBudget`. -/ -@[expose] public section +public section namespace Nivat.Descent @@ -107,20 +107,23 @@ theorem dotProduct_mem_dualAnnihilator_iff (d : Configuration ℚ) (R : Finset L /-- Restrict Laurent coefficients to a finite window. This implements the identification with `ℚ^R` at the start of Section 2. -/ -def coefficientRestriction (R : Finset Lattice) : Laurent →ₗ[ℚ] (R → ℚ) where +@[expose] def coefficientRestriction (R : Finset Lattice) : Laurent →ₗ[ℚ] (R → ℚ) where toFun f z := f.coeff z.1 map_add' _ _ := rfl map_smul' _ _ := rfl /-- Multiplication by `Φ` on polynomials supported in `S`, with coefficients read on `R`. This is the map `Φ : ℚ^S → ℚ^R` in Lemma 2.1 (`lem:supported`). -/ -noncomputable def multiplierMap (Φ : Laurent) (R S : Finset Lattice) : +@[expose] noncomputable def multiplierMap (Φ : Laurent) (R S : Finset Lattice) : (S → ℚ) →ₗ[ℚ] (R → ℚ) := (coefficientRestriction R).comp ((LinearMap.mulLeft ℚ Φ).comp (windowPolynomialLinear S)) /-- The coefficient formula for multiplication in Lemma 2.1 (`lem:supported`). -/ theorem multiplierMap_apply (Φ : Laurent) (R S : Finset Lattice) (b : S → ℚ) (z : R) : - multiplierMap Φ R S b z = (Φ * windowPolynomial S b).coeff z.1 := rfl + multiplierMap Φ R S b z = (Φ * windowPolynomial S b).coeff z.1 := by + simp only [multiplierMap, LinearMap.comp_apply, LinearMap.mulLeft_apply, + coefficientRestriction, windowPolynomialLinear, LinearMap.coe_mk, AddHom.coe_mk] + rfl /-- Support containment makes coefficient restriction lossless. This is the identification of supported multiples in Lemma 2.1 (`lem:supported`). -/ diff --git a/LeanPool/Nivat/Descent/FiberBudget.lean b/LeanPool/Nivat/Descent/FiberBudget.lean index 1452b82164..f5f53cb94a 100644 --- a/LeanPool/Nivat/Descent/FiberBudget.lean +++ b/LeanPool/Nivat/Descent/FiberBudget.lean @@ -49,7 +49,7 @@ The argument uses an arbitrary function between sets of vectors. The application to a Laurent filter is in `Nivat.Descent.ExactDescent`. -/ -@[expose] public section +public section namespace Nivat.Descent @@ -57,7 +57,7 @@ variable {K V W : Type*} [Field K] [AddCommGroup V] [Module K V] /-- Differences between members of one fiber. This is the generating set in the counting step of Theorem 2.2 (`thm:descent`). -/ -def fiberDifferences (F : V → W) (P : Set V) : Set V := +@[expose] def fiberDifferences (F : V → W) (P : Set V) : Set V := {d | ∃ x ∈ P, ∃ y ∈ P, F x = F y ∧ d = x - y} /-- One chosen input for each occurring output, in the proof of Theorem 2.2 (`thm:descent`). -/ diff --git a/LeanPool/Nivat/Dynamics/HalfPlanePair.lean b/LeanPool/Nivat/Dynamics/HalfPlanePair.lean index af6b845f20..ecf94dd541 100644 --- a/LeanPool/Nivat/Dynamics/HalfPlanePair.lean +++ b/LeanPool/Nivat/Dynamics/HalfPlanePair.lean @@ -53,7 +53,7 @@ and `exists_halfPlane_pair_coordinates` with the normal written as a coordinate pair. -/ -@[expose] public section +public section namespace Nivat.Dynamics diff --git a/LeanPool/Nivat/Dynamics/OrbitClosure.lean b/LeanPool/Nivat/Dynamics/OrbitClosure.lean index 64461d3d12..d5a4f2a5da 100644 --- a/LeanPool/Nivat/Dynamics/OrbitClosure.lean +++ b/LeanPool/Nivat/Dynamics/OrbitClosure.lean @@ -51,7 +51,7 @@ The main results are `finite_pattern_occurs`, pattern-language inclusion needed for Laurent annihilator inheritance. -/ -@[expose] public section +public section namespace Nivat.Dynamics diff --git a/LeanPool/Nivat/Dynamics/PeriodicDifference.lean b/LeanPool/Nivat/Dynamics/PeriodicDifference.lean index c45c485319..989f4a766e 100644 --- a/LeanPool/Nivat/Dynamics/PeriodicDifference.lean +++ b/LeanPool/Nivat/Dynamics/PeriodicDifference.lean @@ -55,7 +55,7 @@ The main results are `exists_tangent_period_of_nonzero_annihilator` and period with Lemma 3.1 and the pattern inheritance of Section 1.1. -/ -@[expose] public section +public section namespace Nivat.Dynamics @@ -152,7 +152,7 @@ theorem act_eq_zero_of_origin_language (c x : Configuration ℚ) /-- The Laurent product of directional difference factors appearing in Proposition 3.5 (`prop:tangent-period`), including any repeated directions. -/ -noncomputable def differenceProduct (hs : List Lattice) : Laurent := +@[expose] noncomputable def differenceProduct (hs : List Lattice) : Laurent := (hs.map (fun h => monomial h - 1)).prod /-- The empty product of difference factors is the identity, so cancelling every factor forces the diff --git a/LeanPool/Nivat/Main.lean b/LeanPool/Nivat/Main.lean index 986c701d7a..01d21dcc80 100644 --- a/LeanPool/Nivat/Main.lean +++ b/LeanPool/Nivat/Main.lean @@ -51,7 +51,7 @@ line ideal gives the smaller low-complexity rectangle of Corollary 2.3, and Theorem 5.1. `nivat` then transfers periods through a rational alphabet labeling. -/ -@[expose] public section +public section namespace Nivat diff --git a/LeanPool/Nivat/Statement.lean b/LeanPool/Nivat/Statement.lean index d313b3b00f..5f0a7fcccb 100644 --- a/LeanPool/Nivat/Statement.lean +++ b/LeanPool/Nivat/Statement.lean @@ -44,7 +44,7 @@ fully expanded statement and is proved by the public finite-alphabet theorem. It does not import the Challenge or its deliberate proof hole. -/ -@[expose] public section +public section namespace NivatSubmission diff --git a/LeanPool/Nivat/TwoFactors/BoundaryCounting.lean b/LeanPool/Nivat/TwoFactors/BoundaryCounting.lean index 18eb7bf3d5..f7f178c47d 100644 --- a/LeanPool/Nivat/TwoFactors/BoundaryCounting.lean +++ b/LeanPool/Nivat/TwoFactors/BoundaryCounting.lean @@ -47,7 +47,7 @@ at one boundary site, and the total excess of fiber sizes bounds the number of interior patterns with more than one boundary extension. -/ -@[expose] public section +public section namespace Nivat.TwoFactors @@ -74,7 +74,7 @@ theorem rowPrefix_mono : Monotone rowPrefix := by /-- The interior together with the first `k` boundary sites, the finite window denoted `D_k` in the paper. Lemma 5.5 (`lem:boundary-window`), equation `eq:boundary-rule-domain`. -/ -def prefixWindow (C : Finset Lattice) (k : ℕ) : Finset Lattice := C ∪ rowPrefix k +@[expose] def prefixWindow (C : Finset Lattice) (k : ℕ) : Finset Lattice := C ∪ rowPrefix k /-- Before any boundary sites are adjoined, the prefix window is exactly the interior. Lemma 5.5 (`lem:boundary-window`). -/ diff --git a/LeanPool/Nivat/TwoFactors/BoundaryPeriod.lean b/LeanPool/Nivat/TwoFactors/BoundaryPeriod.lean index 7d861e97dd..b44ecab440 100644 --- a/LeanPool/Nivat/TwoFactors/BoundaryPeriod.lean +++ b/LeanPool/Nivat/TwoFactors/BoundaryPeriod.lean @@ -46,7 +46,7 @@ ambiguous extensions bounds the complexity of a word whose letters collect all the interior rows; Morse–Hedlund gives one period for those rows. -/ -@[expose] public section +public section namespace Nivat.TwoFactors @@ -142,7 +142,7 @@ theorem every_edge_differs (c : Configuration ℚ) (C : Finset Lattice) (k e q : /-- The interior patterns encountered by translating one configuration in the horizontal basis direction. Lemma 5.7 (`lem:periodic-interior`). -/ -def innerOrbit {A : Type*} (x : Configuration A) (C : Finset Lattice) : Set (C → A) := +@[expose] def innerOrbit {A : Type*} (x : Configuration A) (C : Finset Lattice) : Set (C → A) := Set.range (fun i : ℤ => patternAt x C (i, 0)) /-- The horizontal interior orbit is finite because it is a subset of the patterns of a diff --git a/LeanPool/Nivat/TwoFactors/FiniteState.lean b/LeanPool/Nivat/TwoFactors/FiniteState.lean index b781232922..e0b352f006 100644 --- a/LeanPool/Nivat/TwoFactors/FiniteState.lean +++ b/LeanPool/Nivat/TwoFactors/FiniteState.lean @@ -52,7 +52,7 @@ A complexity plateau supplies a finite-state presentation of a word; a periodic parameter is handled by recording its phase together with the finite memory. -/ -@[expose] public section +public section namespace Nivat.TwoFactors @@ -199,12 +199,12 @@ theorem periodic_of_periodic_forcing {A F : Type*} (a : ℤ → A) (f : ℤ → /-- The length-`k` word beginning at an arbitrary integer index of a bilateral sequence. Corollary 5.3 (`cor:morse`). -/ -def word {A : Type*} (a : ℤ → A) (k : ℕ) (i : ℤ) : Fin k → A := +@[expose] def word {A : Type*} (a : ℤ → A) (k : ℕ) (i : ℤ) : Fin k → A := fun r => a (i + (r : ℕ)) /-- The number of distinct length-`k` words over all integer starting indices; finite range ensures that the counted set is finite. Corollary 5.3 (`cor:morse`). -/ -noncomputable def wordComplexity {A : Type*} (a : ℤ → A) (k : ℕ) : ℕ := +@[expose] noncomputable def wordComplexity {A : Type*} (a : ℤ → A) (k : ℕ) : ℕ := (Set.range (word a k)).ncard /-- A finite alphabet gives only finitely many occurring words of any fixed finite length. diff --git a/LeanPool/Nivat/TwoFactors/Main.lean b/LeanPool/Nivat/TwoFactors/Main.lean index ff1a06390b..8902629882 100644 --- a/LeanPool/Nivat/TwoFactors/Main.lean +++ b/LeanPool/Nivat/TwoFactors/Main.lean @@ -51,7 +51,7 @@ back through both coordinate changes. The parallel case uses bounded finite differences. The final corollary treats sums of two periodic configurations. -/ -@[expose] public section +public section namespace Nivat.TwoFactors diff --git a/LeanPool/Nivat/TwoFactors/PeriodicRows.lean b/LeanPool/Nivat/TwoFactors/PeriodicRows.lean index 73a686f3f4..06b6cab8e6 100644 --- a/LeanPool/Nivat/TwoFactors/PeriodicRows.lean +++ b/LeanPool/Nivat/TwoFactors/PeriodicRows.lean @@ -49,18 +49,18 @@ mixed-difference direction gives a difference vanishing on a full transverse fundamental strip; its transverse period then makes it vanish everywhere. -/ -@[expose] public section +public section namespace Nivat.TwoFactors /-- A row has a positive integer period in the horizontal basis direction. Lemma 5.8 (`lem:row-lifting`). -/ -def RowPeriodic {A : Type*} (x : ℤ × ℤ → A) (j : ℤ) : Prop := +@[expose] def RowPeriodic {A : Type*} (x : ℤ × ℤ → A) (j : ℤ) : Prop := ∃ p : ℕ, 0 < p ∧ Function.Periodic (fun i : ℤ => x (i, j)) (p : ℤ) /-- Equal occurring interior patterns and equal first `k` boundary values determine the next boundary value, the rule in equation `eq:boundary-rule`. Lemma 5.5 (`lem:boundary-window`). -/ -def BoundaryRule {A : Type*} (x : ℤ × ℤ → A) (C : Finset (ℤ × ℤ)) (k : ℕ) : Prop := +@[expose] def BoundaryRule {A : Type*} (x : ℤ × ℤ → A) (C : Finset (ℤ × ℤ)) (k : ℕ) : Prop := ∀ z z' : ℤ × ℤ, (∀ u ∈ C, x (u + z) = x (u + z')) → (∀ r : Fin k, x (z + (((r : ℕ) : ℤ), 0)) = x (z' + (((r : ℕ) : ℤ), 0))) → diff --git a/LeanPool/Nivat/TwoFactors/StripStates.lean b/LeanPool/Nivat/TwoFactors/StripStates.lean index 4804060285..493cd42660 100644 --- a/LeanPool/Nivat/TwoFactors/StripStates.lean +++ b/LeanPool/Nivat/TwoFactors/StripStates.lean @@ -49,7 +49,7 @@ gives a transverse period. Otherwise the greatest disagreeing row positions an agreeing strip immediately above a disagreement. -/ -@[expose] public section +public section namespace Nivat.TwoFactors diff --git a/LeanPool/Nivat/TwoFactors/Window.lean b/LeanPool/Nivat/TwoFactors/Window.lean index edd5aa174f..9d211f035d 100644 --- a/LeanPool/Nivat/TwoFactors/Window.lean +++ b/LeanPool/Nivat/TwoFactors/Window.lean @@ -53,7 +53,7 @@ the boundary cost inequality. This finite minimization implements the lemma's discrepancy-crossing selection. -/ -@[expose] public section +public section namespace Nivat.TwoFactors diff --git a/LeanPool/Nivat/TwoFactors/WindowCriterion.lean b/LeanPool/Nivat/TwoFactors/WindowCriterion.lean index 77ce4729e8..729a5718dc 100644 --- a/LeanPool/Nivat/TwoFactors/WindowCriterion.lean +++ b/LeanPool/Nivat/TwoFactors/WindowCriterion.lean @@ -47,7 +47,7 @@ the latter case, and Lemma 5.8 extends a multiple of the horizontal direction to a global period. The conclusion retains which input direction supplies it. -/ -@[expose] public section +public section namespace Nivat.TwoFactors diff --git a/LeanPool/Nivat/TwoFactors/WindowNormalization.lean b/LeanPool/Nivat/TwoFactors/WindowNormalization.lean index 56aec1ec4a..ba860b6b26 100644 --- a/LeanPool/Nivat/TwoFactors/WindowNormalization.lean +++ b/LeanPool/Nivat/TwoFactors/WindowNormalization.lean @@ -47,13 +47,13 @@ The window and configuration are transported by the same affine bijection; the pattern inequality and row-block witnesses are preserved explicitly. -/ -@[expose] public section +public section namespace Nivat.TwoFactors /-- The additive lattice equivalence that preserves horizontal coordinates and either preserves or reverses the normal coordinate. Lemma 5.5 (`lem:boundary-window`). -/ -def normalSignEquiv (ε : ℤ) (hε : ε = 1 ∨ ε = -1) : Lattice ≃+ Lattice where +@[expose] def normalSignEquiv (ε : ℤ) (hε : ε = 1 ∨ ε = -1) : Lattice ≃+ Lattice where toFun z := (z.1, ε * z.2) invFun z := (z.1, ε * z.2) left_inv z := by rcases hε with rfl | rfl <;> simp @@ -62,7 +62,7 @@ def normalSignEquiv (ε : ℤ) (hε : ε = 1 ∨ ε = -1) : Lattice ≃+ Lattice /-- The affine lattice bijection sending the normalized edge origin to its selected site and choosing the normal orientation. Lemma 5.5 (`lem:boundary-window`). -/ -def normalAffineEquiv (ε : ℤ) (hε : ε = 1 ∨ ε = -1) (start edge : ℤ) : +@[expose] def normalAffineEquiv (ε : ℤ) (hε : ε = 1 ∨ ε = -1) (start edge : ℤ) : Lattice ≃ Lattice := (normalSignEquiv ε hε).toEquiv.trans (Equiv.addRight (start, edge)) diff --git a/LeanPool/OSforGFF.lean b/LeanPool/OSforGFF.lean index 82816c46d1..7358a95b12 100644 --- a/LeanPool/OSforGFF.lean +++ b/LeanPool/OSforGFF.lean @@ -29,4 +29,4 @@ Tags: analysis, measure-theory, probability, mathematical-physics MSC: 81T08, 60G15, 46G12 -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Bochner.lean b/LeanPool/OSforGFF/Bochner.lean index 386a99793c..d4228676be 100644 --- a/LeanPool/OSforGFF/Bochner.lean +++ b/LeanPool/OSforGFF/Bochner.lean @@ -18,4 +18,4 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Import aggregator for the `Bochner` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Bochner/FejerPD.lean b/LeanPool/OSforGFF/Bochner/FejerPD.lean index df68dd312c..a98bac7c37 100644 --- a/LeanPool/OSforGFF/Bochner/FejerPD.lean +++ b/LeanPool/OSforGFF/Bochner/FejerPD.lean @@ -41,7 +41,7 @@ The kernel → 1 pointwise and is bounded by 1, so DCT gives J_R → ∫ ψ. - Folland, *A Course in Abstract Harmonic Analysis*, §4.2, Lemma 4.8 -/ -@[expose] public section +public section open MeasureTheory Complex Filter Topology BigOperators open scoped Real FourierTransform InnerProductSpace diff --git a/LeanPool/OSforGFF/Bochner/Main.lean b/LeanPool/OSforGFF/Bochner/Main.lean index 5a3b9f002f..60ab660faf 100644 --- a/LeanPool/OSforGFF/Bochner/Main.lean +++ b/LeanPool/OSforGFF/Bochner/Main.lean @@ -69,7 +69,7 @@ avoiding the Riesz-Markov-Kakutani theorem entirely: - G.B. Folland, *A Course in Abstract Harmonic Analysis*, CRC Press (2016), §4.2 -/ -@[expose] public section +public section open MeasureTheory Complex Filter Topology open scoped Real InnerProductSpace FourierTransform diff --git a/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean b/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean index e9cc928d23..a5ff9dfb48 100644 --- a/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean +++ b/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean @@ -38,7 +38,7 @@ but that weaker condition does not imply Hermitian symmetry. - `isPositiveDefinite_precomp_linear`: composition with linear maps preserves PD -/ -@[expose] public section +public section open Complex BigOperators open scoped Kronecker diff --git a/LeanPool/OSforGFF/Bochner/Sazonov.lean b/LeanPool/OSforGFF/Bochner/Sazonov.lean index 930499ed6b..2431007839 100644 --- a/LeanPool/OSforGFF/Bochner/Sazonov.lean +++ b/LeanPool/OSforGFF/Bochner/Sazonov.lean @@ -38,7 +38,7 @@ whenever √⟪x-y, S(x-y)⟫ < 1. * Da Prato-Zabczyk, "Stochastic Equations in Infinite Dimensions", §1.2 -/ -@[expose] public section +public section open MeasureTheory Complex Filter Topology Set InnerProductSpace open scoped Real @@ -57,10 +57,17 @@ def IsPositiveTraceClass (S : H →L[ℝ] H) : Prop := ∃ (ι : Type) (b : HilbertBasis ι ℝ H), Summable (fun i => @inner ℝ H _ (b i) (S (b i))) +omit [CompleteSpace H] in +theorem isPositiveTraceClass_iff (S : H →L[ℝ] H) : + IsPositiveTraceClass S ↔ + S.IsPositive ∧ + ∃ (ι : Type) (b : HilbertBasis ι ℝ H), + Summable (fun i => @inner ℝ H _ (b i) (S (b i))) := by rfl + /-! ## Quadratic Form and Seminorm -/ /-- The quadratic form associated to an operator: x ↦ ⟪x, Sx⟫. -/ -def quadForm (S : H →L[ℝ] H) (x : H) : ℝ := @inner ℝ H _ x (S x) +@[expose] def quadForm (S : H →L[ℝ] H) (x : H) : ℝ := @inner ℝ H _ x (S x) section QuadFormLemmas diff --git a/LeanPool/OSforGFF/Covariance.lean b/LeanPool/OSforGFF/Covariance.lean index 4639cdc521..fd7a8978c3 100644 --- a/LeanPool/OSforGFF/Covariance.lean +++ b/LeanPool/OSforGFF/Covariance.lean @@ -17,4 +17,4 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp Import aggregator for the `Covariance` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Covariance/Momentum.lean b/LeanPool/OSforGFF/Covariance/Momentum.lean index 0fd659f4c6..3603c6d75f 100644 --- a/LeanPool/OSforGFF/Covariance/Momentum.lean +++ b/LeanPool/OSforGFF/Covariance/Momentum.lean @@ -38,7 +38,7 @@ via Fourier transform. - `freePropagator_pos`, `freePropagator_bounded`: Propagator is positive and bounded -/ -@[expose] public section +public section open MeasureTheory Complex Real Filter open TopologicalSpace @@ -112,7 +112,7 @@ variable {m : ℝ} [Fact (0 < m)] /-- The free propagator in momentum space: 1/(k² + m²) This is the Fourier transform of the free covariance -/ -def freePropagatorMomentum (m : ℝ) (k : SpaceTime) : ℝ := +@[expose] def freePropagatorMomentum (m : ℝ) (k : SpaceTime) : ℝ := 1 / (‖k‖^2 + m^2) /-- The free propagator is an even function: it depends only on ‖k‖. -/ @@ -124,7 +124,7 @@ lemma freePropagator_even (m : ℝ) (k : SpaceTime) : When using Mathlib's Fourier transform convention, the propagator acquires (2π)² factors. This is `P_mathlib(k) = 1/((2π)²‖k‖² + m²)` which equals `P_phys(2πk)`. -/ -noncomputable def freePropagatorMomentumMathlib (m : ℝ) (k : SpaceTime) : ℝ := +@[expose] noncomputable def freePropagatorMomentumMathlib (m : ℝ) (k : SpaceTime) : ℝ := 1 / ((2 * Real.pi)^2 * ‖k‖^2 + m^2) /-- The Mathlib propagator is positive for m > 0. -/ @@ -151,7 +151,7 @@ lemma freePropagatorMomentum_mathlib_nonneg (m : ℝ) (hm : 0 < m) (k : SpaceTim We realise this as the real part of a complex Fourier integral with the standard 2π-normalisation. -/ -noncomputable def freeCovarianceRegulated (α : ℝ) (m : ℝ) (x y : SpaceTime) : ℝ := +@[expose] noncomputable def freeCovarianceRegulated (α : ℝ) (m : ℝ) (x y : SpaceTime) : ℝ := let normalisation : ℝ := (2 * Real.pi) ^ STDimension let regulator : SpaceTime → ℝ := fun k => Real.exp (-α * ‖k‖^2) let phase : SpaceTime → ℂ := fun k => @@ -219,7 +219,7 @@ noncomputable def schwingerGaussian (α t : ℝ) (m : ℝ) (k : SpaceTime) : ℝ This is the Fourier transform of the Gaussian exp(-t·k²). Named with PositionSpace suffix to distinguish from momentum-space version. -/ -noncomputable def heatKernelPositionSpace (t : ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def heatKernelPositionSpace (t : ℝ) (r : ℝ) : ℝ := (4 * Real.pi * t) ^ (-(STDimension : ℝ) / 2) * Real.exp (-r^2 / (4 * t)) /-- For d = 4, the heat kernel simplifies to 1/(16π²t²) · exp(-r²/(4t)). -/ @@ -389,7 +389,7 @@ theorem heatKernelPositionSpace_integral_eq_one (t : ℝ) (ht : 0 < t) : /-- The Schwinger representation of the position-space covariance. This expresses C(r) as a 1D integral over proper time. -/ -noncomputable def covarianceSchwingerRep (m : ℝ) (r : ℝ) : ℝ := +@[expose] noncomputable def covarianceSchwingerRep (m : ℝ) (r : ℝ) : ℝ := ∫ t in Set.Ioi 0, Real.exp (-t * m^2) * heatKernelPositionSpace t r /-- In 4D, the Schwinger representation of the covariance equals: @@ -440,7 +440,7 @@ theorem covarianceSchwingerRep_eq_besselFormula (m r : ℝ) (hm : 0 < m) (hr : 0 This is the explicit formula for the massive scalar field propagator in 4D. The formula is valid for x ≠ y and m > 0. -/ -noncomputable def freeCovarianceBessel (m : ℝ) (x y : SpaceTime) : ℝ := +@[expose] noncomputable def freeCovarianceBessel (m : ℝ) (x y : SpaceTime) : ℝ := let r := ‖x - y‖ if r = 0 then 0 -- Undefined at coincident points; regularize to 0 else (m / (4 * Real.pi^2 * r)) * besselK1 (m * r) @@ -1610,7 +1610,7 @@ theorem freeCovariance_regulated_bilinear_integrable (α : ℝ) (hα : 0 < α) ( exact Integrable.mono' hbound_int hmeas hnorm /-- The free covariance kernel (alternative name for compatibility) -/ -noncomputable def freeCovarianceKernel (m : ℝ) (z : SpaceTime) : ℝ := +@[expose] noncomputable def freeCovarianceKernel (m : ℝ) (z : SpaceTime) : ℝ := freeCovariance m 0 z /-- The Bessel covariance kernel is L¹ (integrable on SpaceTime). @@ -1969,7 +1969,7 @@ noncomputable def momentumWeight (m : ℝ) (k : SpaceTime) : ℝ := /-- The weight function in momentum space (Mathlib convention): 1 / ((2π)²‖k‖² + m²) This is the correct weight to use with Mathlib's Fourier transform. -/ -noncomputable def momentumWeightMathlib (m : ℝ) (k : SpaceTime) : ℝ := +@[expose] noncomputable def momentumWeightMathlib (m : ℝ) (k : SpaceTime) : ℝ := freePropagatorMomentumMathlib m k /-- The square root of the weight function (physics convention). -/ diff --git a/LeanPool/OSforGFF/Covariance/Parseval.lean b/LeanPool/OSforGFF/Covariance/Parseval.lean index d9ed1c1d33..8a95f39cca 100644 --- a/LeanPool/OSforGFF/Covariance/Parseval.lean +++ b/LeanPool/OSforGFF/Covariance/Parseval.lean @@ -53,7 +53,7 @@ where: - Fubini requires showing the triple integral is absolutely convergent -/ -@[expose] public section +public section section ParsevalCovariance @@ -376,7 +376,7 @@ lemma phase_factorization (k x y : SpaceTime) : ring /-- The physics Fourier transform at k. -/ -noncomputable def physicsFT (f : TestFunctionℂ) (k : SpaceTime) : ℂ := +@[expose] noncomputable def physicsFT (f : TestFunctionℂ) (k : SpaceTime) : ℂ := ∫ x, f x * Complex.exp (-Complex.I * Complex.ofReal ⟪k, x⟫_ℝ) ∂volume /-- Norm squared rescaling: ‖c • x‖² = c² ‖x‖² for c ≥ 0. -/ @@ -972,7 +972,7 @@ open scoped InnerProductSpace This is the distributional formulation: the double integral is well-defined for Schwartz test functions due to the L¹ integrability of the Bessel kernel. -/ -noncomputable def freeCovarianceℂBilinear (m : ℝ) (f g : TestFunctionℂ) : ℂ := +@[expose] noncomputable def freeCovarianceℂBilinear (m : ℝ) (f g : TestFunctionℂ) : ℂ := ∫ x, ∫ y, (f x) * (freeCovariance m x y) * (g y) end GlobalBilinearDefs diff --git a/LeanPool/OSforGFF/Covariance/Position.lean b/LeanPool/OSforGFF/Covariance/Position.lean index 76b8b2d403..5b995f7961 100644 --- a/LeanPool/OSforGFF/Covariance/Position.lean +++ b/LeanPool/OSforGFF/Covariance/Position.lean @@ -30,7 +30,7 @@ C(x,y) = ∫₀^∞ e^{−sm²} H(s,|x−y|) ds via the heat kernel. - `covariance_timeReflection_invariant`: Time reflection invariance -/ -@[expose] public section +public section open MeasureTheory Complex Real Filter open TopologicalSpace @@ -496,7 +496,7 @@ theorem freeCovarianceℂ_regulated_positive (α : ℝ) (hα : 0 < α) (m : ℝ) (freePropagatorMomentum_mathlib_nonneg m (Fact.out) k) /-- Complex extension of the covariance for complex test functions (limit form via Bessel). -/ -def freeCovarianceℂ (m : ℝ) (f g : TestFunctionℂ) : ℂ := +@[expose] def freeCovarianceℂ (m : ℝ) (f g : TestFunctionℂ) : ℂ := ∫ x, ∫ y, (f x) * (freeCovariance m x y) * (starRingEnd ℂ (g y)) ∂volume ∂volume /-- The complex covariance (Bessel form) is positive definite. -/ diff --git a/LeanPool/OSforGFF/Covariance/RealForm.lean b/LeanPool/OSforGFF/Covariance/RealForm.lean index 59e5f50ef6..3333554ebb 100644 --- a/LeanPool/OSforGFF/Covariance/RealForm.lean +++ b/LeanPool/OSforGFF/Covariance/RealForm.lean @@ -24,7 +24,7 @@ square root propagator embedding theorem. - `freeCovarianceFormR_pos`: Positivity of the quadratic form -/ -@[expose] public section +public section open MeasureTheory Complex Matrix open scoped Real InnerProductSpace BigOperators ComplexConjugate @@ -36,7 +36,7 @@ namespace QFT /-! ## Real Covariance Form -/ /-- Real covariance bilinear form induced by the free covariance kernel. -/ -noncomputable def freeCovarianceFormR (m : ℝ) (f g : OSforGFF.TestFunction) : ℝ := +@[expose] noncomputable def freeCovarianceFormR (m : ℝ) (f g : OSforGFF.TestFunction) : ℝ := ∫ x, ∫ y, (f x) * (freeCovariance m x y) * (g y) ∂volume ∂volume theorem freeCovarianceℂ_bilinear_agrees_on_reals @@ -104,7 +104,7 @@ noncomputable def schwartzToL2CLMReal (_m : ℝ) : /-- The embedding T maps a test function to a weighted function in momentum space. Conceptually: T f = FourierTransform(f) * (‖k‖² + m²)^(-1/2). -/ -noncomputable def sqrtPropagatorMap (m : ℝ) (f : OSforGFF.TestFunction) : SpaceTime → ℂ := +@[expose] noncomputable def sqrtPropagatorMap (m : ℝ) (f : OSforGFF.TestFunction) : SpaceTime → ℂ := fun k => (SchwartzMap.fourierTransformCLM ℂ (toComplex f)) k * momentumWeightSqrtMathlib m k @@ -383,7 +383,11 @@ lemma embeddingMapCLM_apply (m : ℝ) [Fact (0 < m)] (f : OSforGFF.TestFunction) classical set g := SchwartzMap.fourierTransformCLM ℂ (toComplex f) with hg set A := (SchwartzMap.toLpCLM ℂ ℂ 2 (volume : Measure SpaceTime)) g with hA - have h_eval : embeddingMapCLM m f = (momentumWeightSqrtMathlibMulCLM m) A := rfl + have h_eval : embeddingMapCLM m f = (momentumWeightSqrtMathlibMulCLM m) A := by + change momentumWeightSqrtMathlibMulCLM m + (SchwartzMap.toLpCLM ℂ ℂ 2 (volume : Measure SpaceTime) + (SchwartzMap.fourierTransformCLM ℂ (toComplexCLM f))) = _ + rw [toComplexCLM_apply] have h_mul := momentumWeightSqrt_mathlib_mul_CLM_spec (m := m) A have h_mul' : embeddingMapCLM m f =ᵐ[volume] fun k => (momentumWeightSqrtMathlib m k : ℂ) * A k := by diff --git a/LeanPool/OSforGFF/GaussianField.lean b/LeanPool/OSforGFF/GaussianField.lean index c4b7ffc7ae..1e1ec73fa2 100644 --- a/LeanPool/OSforGFF/GaussianField.lean +++ b/LeanPool/OSforGFF/GaussianField.lean @@ -17,4 +17,4 @@ import Mathlib.Data.Nat.Choose.Multinomial Import aggregator for the `GaussianField` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear.lean b/LeanPool/OSforGFF/GaussianField/Nuclear.lean index b70316d02f..179b5251eb 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear.lean @@ -16,4 +16,4 @@ import Mathlib.Analysis.SpecialFunctions.Pow.NNReal Import aggregator for the `GaussianField/Nuclear` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear/DyninMityagin.lean b/LeanPool/OSforGFF/GaussianField/Nuclear/DyninMityagin.lean index 682da046ca..a3e286ecf5 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear/DyninMityagin.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear/DyninMityagin.lean @@ -30,7 +30,7 @@ not just Schwartz spaces. - Gel'fand-Vilenkin, "Generalized Functions" Vol. 4, Ch. 3-4 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean index c47bc01d34..7498022659 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearSpace.lean @@ -40,7 +40,7 @@ DM structure directly from the Hermite basis. - Gel'fand-Vilenkin, "Generalized Functions" Vol. 4 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean index 21674ac98a..4a593f3af2 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean @@ -36,7 +36,7 @@ The tensor product s(ℕ) ⊗̂ s(ℕ) ≅ s(ℕ²) ≅ s(ℕ) via Cantor pairin - Gel'fand-Vilenkin, "Generalized Functions" Vol. 4 -/ -@[expose] public section +public section noncomputable section @@ -145,6 +145,9 @@ def rapidDecaySeminorm (k : ℕ) : Seminorm ℝ RapidDecaySeq where simp_rw [abs_mul, Real.norm_eq_abs, mul_assoc] exact tsum_mul_left +@[simp] theorem rapidDecaySeminorm_apply (k : ℕ) (a : RapidDecaySeq) : + rapidDecaySeminorm k a = ∑' m, |a.val m| * (1 + (m : ℝ)) ^ k := by rfl + /-! ### Topology from seminorms -/ instance instTopologicalSpace : TopologicalSpace RapidDecaySeq := @@ -392,6 +395,9 @@ def coeffCLM (m : ℕ) : RapidDecaySeq →L[ℝ] ℝ where (a.rapid_decay 0).le_tsum m (fun j _ => mul_nonneg (abs_nonneg _) (weight_nonneg j 0)) +@[simp] theorem coeffCLM_apply (m : ℕ) (a : RapidDecaySeq) : + coeffCLM m a = a.val m := by rfl + /-! ### DyninMityaginSpace instance -/ /-- The partial sums `∑_{m∈s} a.val(m) • basisVec(m)` converge to `a`. @@ -494,7 +500,9 @@ instance rapidDecayDyninMityaginSpace : DyninMityaginSpace RapidDecaySeq where h_completeSpace := instCompleteSpace basis := basisVec coeff := coeffCLM - expansion := rapidDecay_expansion + expansion := by + intro φ a + simpa only [coeffCLM_apply] using rapidDecay_expansion φ a basis_growth k := ⟨1, one_pos, k, fun m => by rw [rapidDecaySeminorm_basisVec]; linarith⟩ coeff_decay k := ⟨1, one_pos, {k}, fun a m => by @@ -661,7 +669,7 @@ sequence space of rapidly decreasing sequences. The product basis indices Mathematically, if `E₁ ≅ s(ℕ)` and `E₂ ≅ s(ℕ)` as nuclear Fréchet spaces, then `E₁ ⊗̂ E₂ ≅ s(ℕ × ℕ) ≅ s(ℕ)` via the Cantor pairing. -/ -def NuclearTensorProduct (_E₁ _E₂ : Type*) := +@[expose] def NuclearTensorProduct (_E₁ _E₂ : Type*) := let _ := _E₁ let _ := _E₂ RapidDecaySeq @@ -878,7 +886,7 @@ variable [AddCommGroup E₁] [Module ℝ E₁] [TopologicalSpace E₁] @[simp] theorem pure_val (e₁ : E₁) (e₂ : E₂) (m : ℕ) : (pure e₁ e₂).val m = DyninMityaginSpace.coeff (Nat.unpair m).1 e₁ * - DyninMityaginSpace.coeff (Nat.unpair m).2 e₂ := rfl + DyninMityaginSpace.coeff (Nat.unpair m).2 e₂ := by rfl /-- Seminorm bound for the pure tensor: for each target seminorm index `k`, there exist constants `C`, source seminorm index sets `s₁, s₂` such that diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear.lean index 643afb66d4..df5e5f5808 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear.lean @@ -22,4 +22,4 @@ import Mathlib.Data.Nat.Choose.Multinomial Import aggregator for the `GaussianField/SchwartzNuclear` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean index d6bf1ffbe6..0b969be8a6 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/Basis1D.lean @@ -22,7 +22,7 @@ All three are proved from theorems in `HermiteFunctions.lean` and `SchwartzHermiteExpansion.lean`. No axioms. -/ -@[expose] public section +public section open MeasureTheory Real SchwartzMap @@ -64,7 +64,7 @@ def hermiteCoeff1DCLM (n : ℕ) : SchwartzMap ℝ ℝ →L[ℝ] ℝ where exact fun f => key f @[simp] theorem hermiteCoeff1DCLM_apply (n : ℕ) (f : SchwartzMap ℝ ℝ) : - hermiteCoeff1DCLM n f = hermiteCoeff1D n f := rfl + hermiteCoeff1DCLM n f = hermiteCoeff1D n f := by rfl /-! ## Expansion Identity for Scalar CLFs @@ -126,7 +126,10 @@ theorem schwartzHermiteBasis1D_growth (k l : ℕ) : refine ⟨C, hC, ⌈max s 0⌉₊, fun m => ?_⟩ calc SchwartzMap.seminorm ℝ k l (schwartzHermiteBasis1D m) = SchwartzMap.seminorm ℝ k l (Classical.choose (hermiteFunction_schwartz m)) := by - congr 1 -- schwartzHermiteBasis1D m = Classical.choose ... + congr 1 + ext x + exact (schwartzHermiteBasis1D_apply m x).trans + (Classical.choose_spec (hermiteFunction_schwartz m) x).symm _ ≤ C * (1 + ↑m) ^ s := hbound m _ ≤ C * (1 + ↑m) ^ (↑⌈max s 0⌉₊ : ℝ) := by gcongr diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean index 9d34a3a7b6..d007c0faf3 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteFunctions.lean @@ -38,7 +38,7 @@ The polynomial infrastructure is available in - DLMF Chapter 18 (Orthogonal Polynomials) -/ -@[expose] public section +public section open MeasureTheory Polynomial Real open scoped ContDiff diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteNuclear.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteNuclear.lean index 9a827d58a4..1198236a32 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteNuclear.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteNuclear.lean @@ -23,7 +23,7 @@ isomorphism `SchwartzMap D ℝ ≃L[ℝ] RapidDecaySeq` constructed in on any nontrivial finite-dimensional real normed space. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean index eb2edf8750..3d4dc5adf6 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean @@ -44,7 +44,7 @@ the continuous linear equivalence. - Thangavelu, "Lectures on Hermite and Laguerre Expansions", Ch. 1 -/ -@[expose] public section +public section noncomputable section @@ -198,7 +198,7 @@ noncomputable def toRapidDecay1DCLM : SchwartzMap ℝ ℝ →L[ℝ] RapidDecaySe -- Total bound: C * L refine ⟨Finset.Iic q, ⟨C * L, by positivity⟩, fun f => ?_⟩ -- Show: rapidDecaySeminorm k (toRapidDecay1DLM f) ≤ (C * L) • (sup seminorms) f - simp only [Seminorm.comp_apply] + simp only [Seminorm.comp_apply, RapidDecaySeq.rapidDecaySeminorm_apply] set S := (Finset.Iic q).sup (schwartzSeminormFamily ℝ ℝ ℝ) f -- Each term bounded by C * S * (1+n)^{-2} have h_le : ∀ n : ℕ, |hermiteCoeff1D n f| * (1 + (n : ℝ)) ^ k ≤ @@ -515,6 +515,7 @@ private lemma fromRapidDecay1DLM_bound (k l : ℕ) : C * RapidDecaySeq.rapidDecaySeminorm s a := by obtain ⟨C, hC, s, hbasis⟩ := schwartzHermiteBasis1D_growth k l exact ⟨C, hC, s, fun a => by + simp only [RapidDecaySeq.rapidDecaySeminorm_apply] calc (SchwartzMap.seminorm ℝ k l) (fromRapidDecay1DLM a) ≤ ∑' n, |a.val n| * SchwartzMap.seminorm ℝ k l (schwartzHermiteBasis1D n) := fromRapidDecay1DLM_seminorm_le a k l @@ -564,7 +565,8 @@ noncomputable def schwartzRapidDecayEquiv1D : change hermiteCoeff1D n (∑' m, a.val m • schwartzHermiteBasis1D m) = a.val n -- Interchange hermiteCoeff1DCLM (continuous) with tsum rw [show hermiteCoeff1D n (∑' m, a.val m • schwartzHermiteBasis1D m) = - hermiteCoeff1DCLM n (∑' m, a.val m • schwartzHermiteBasis1D m) from rfl, + hermiteCoeff1DCLM n (∑' m, a.val m • schwartzHermiteBasis1D m) from + (hermiteCoeff1DCLM_apply n _).symm, (hermiteCoeff1DCLM n).map_tsum (rapidDecay_hermite_summable a)] -- Now: ∑' m, hermiteCoeff1DCLM n (aₘ • ψₘ) = ∑' m, aₘ * δₙₘ = aₙ simp only [hermiteCoeff1DCLM_apply, map_smul, smul_eq_mul, @@ -1161,6 +1163,7 @@ private lemma hermiteCoeffNd_fubini (d : ℕ) simp only [smul_eq_mul] at h_pull rw [h_pull] congr 1 + simp only [schwartzSlice_apply] -- Seminorm control of partial Hermite coefficients with 1D decay (was axiom A4). -- Each Schwartz seminorm of schwartzPartialHermiteCoeff d f n (as a function of d+1 @@ -2071,6 +2074,7 @@ private lemma toRapidDecayNdLM_isBounded (d' : ℕ) : refine ⟨q, ⟨D * C₁ ^ (k + 2) * L, by positivity⟩, fun f => ?_⟩ simp only [Seminorm.comp_apply] set S := q.sup (schwartzSeminormFamily ℝ (EuclideanSpace ℝ (Fin (d' + 1))) ℝ) f + simp only [RapidDecaySeq.rapidDecaySeminorm_apply] change ∑' n, |hermiteCoeffNd (d' + 1) ((multiIndexEquiv d').symm n) f| * (1 + ↑n) ^ k ≤ D * C₁ ^ (k + 2) * L * S have h_le := hermiteCoeffNd_flat_term_le f k k₁ C₁ D S hC₁ hgrowth (hdecay f) @@ -2273,6 +2277,7 @@ private lemma fromRapidDecayNdLM_bound (d : ℕ) (k l : ℕ) : obtain ⟨C₁, hC₁, s₁, hbasis⟩ := schwartzHermiteBasisNd_growth (d + 1) k l obtain ⟨C₂, hC₂, k₂, hsymm⟩ := multiIndexEquiv_symm_growth d refine ⟨C₁ * C₂ ^ s₁, by positivity, k₂ * s₁, fun a => ?_⟩ + simp only [RapidDecaySeq.rapidDecaySeminorm_apply] calc SchwartzMap.seminorm ℝ k l (fromRapidDecayNdLM d a) ≤ ∑' n, |a.val n| * SchwartzMap.seminorm ℝ k l (flatBasisNd d n) := fromRapidDecayNdLM_seminorm_le d a k l diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/ParametricCalculus.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/ParametricCalculus.lean index 022ba503d8..c8b25f9134 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/ParametricCalculus.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/ParametricCalculus.lean @@ -26,7 +26,7 @@ not yet available in Mathlib. Used as building blocks in the SchwartzNuclear pro the result is C^∞ and derivatives commute with the integral. -/ -@[expose] public section +public section open MeasureTheory SchwartzMap open scoped ContDiff diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean index 8756d92f73..8eee300c94 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean @@ -43,7 +43,7 @@ to be exported: - `hermiteFunction_contDiff` (smoothness) -/ -@[expose] public section +public section open MeasureTheory Real SchwartzMap open scoped BigOperators @@ -72,7 +72,7 @@ theorem schwartzHermiteBasis1D_coe (n : ℕ) : /-- The n-th Hermite coefficient of a Schwartz function f: cₙ(f) = ∫ f(x) ψₙ(x) dx. -/ -def hermiteCoeff1D (n : ℕ) (f : SchwartzMap ℝ ℝ) : ℝ := +@[expose] def hermiteCoeff1D (n : ℕ) (f : SchwartzMap ℝ ℝ) : ℝ := ∫ x, f x * hermiteFunction n x /-- The Hermite coefficient is the L² inner product with ψₙ. -/ diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean index 209976f99c..03135171f2 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean @@ -40,7 +40,7 @@ constructions used in the multi-dimensional Hermite expansion proof. - `schwartz_slice_partial_seminorm_bound` — seminorm bound for scalarized slices -/ -@[expose] public section +public section open MeasureTheory Real SchwartzMap Measure open scoped ContDiff @@ -61,7 +61,7 @@ namespace GaussianField /-- Embed `EuclideanSpace ℝ (Fin d) × ℝ` into `EuclideanSpace ℝ (Fin (d + 1))` by appending the real value as the last coordinate. -/ -def euclideanSnoc (d : ℕ) (y : EuclideanSpace ℝ (Fin d)) (t : ℝ) : +@[expose] def euclideanSnoc (d : ℕ) (y : EuclideanSpace ℝ (Fin d)) (t : ℝ) : EuclideanSpace ℝ (Fin (d + 1)) := (WithLp.equiv 2 _).symm (Fin.snoc (fun i => y i) t) @@ -196,6 +196,11 @@ noncomputable def schwartzSlice (d : ℕ) exact (compCLMOfAntilipschitz ℝ (euclideanSnoc_hasTemperateGrowth d y) (euclideanSnoc_antilipschitz d y) f).decay' +@[simp] theorem schwartzSlice_apply (d : ℕ) + (f : SchwartzMap (EuclideanSpace ℝ (Fin (d + 2))) ℝ) + (y : EuclideanSpace ℝ (Fin (d + 1))) (t : ℝ) : + schwartzSlice d f y t = f (euclideanSnoc (d + 1) y t) := by rfl + /-! ## A2: Partial Hermite coefficient is Schwartz The function `g(y) = ∫ f(euclideanSnoc y t) · ψ_n(t) dt` is Schwartz in y. @@ -561,13 +566,13 @@ lemma schwartz_partial_hermiteCoeff_eq_1D (d : ℕ) (f : SchwartzMap (EuclideanSpace ℝ (Fin (d + 2))) ℝ) (n : ℕ) (y : EuclideanSpace ℝ (Fin (d + 1))) : schwartzPartialHermiteCoeff d f n y = - hermiteCoeff1D n (schwartzSlice d f y) := rfl + hermiteCoeff1D n (schwartzSlice d f y) := by rfl -- A3c: Slice evaluation (definitionally true) lemma schwartz_slice_eq (d : ℕ) (f : SchwartzMap (EuclideanSpace ℝ (Fin (d + 2))) ℝ) (y : EuclideanSpace ℝ (Fin (d + 1))) (t : ℝ) : - schwartzSlice d f y t = f (euclideanSnoc (d + 1) y t) := rfl + schwartzSlice d f y t = f (euclideanSnoc (d + 1) y t) := by rfl /-- Fubini theorem for EuclideanSpace slicing. Isolates the measure equivalence between ℝ^{d+2} and ℝ^{d+1} × ℝ. diff --git a/LeanPool/OSforGFF/General.lean b/LeanPool/OSforGFF/General.lean index d343ce73aa..fc1fbebd87 100644 --- a/LeanPool/OSforGFF/General.lean +++ b/LeanPool/OSforGFF/General.lean @@ -28,4 +28,4 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Import aggregator for the `General` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/General/BesselFunction.lean b/LeanPool/OSforGFF/General/BesselFunction.lean index a006463b6e..24c7d4b00f 100644 --- a/LeanPool/OSforGFF/General/BesselFunction.lean +++ b/LeanPool/OSforGFF/General/BesselFunction.lean @@ -43,7 +43,7 @@ For the massive scalar field in 4D Euclidean space, the exact formula is: C(x,y) = (m / (4π² |x-y|)) · K₁(m |x-y|) -/ -@[expose] public section +public section open MeasureTheory Set Filter Asymptotics Real @@ -51,7 +51,7 @@ open MeasureTheory Set Filter Asymptotics Real K₁(z) = ∫₀^∞ exp(-z cosh(t)) cosh(t) dt This is well-defined and positive for z > 0. -/ -noncomputable def besselK1 (z : ℝ) : ℝ := +@[expose] noncomputable def besselK1 (z : ℝ) : ℝ := ∫ t : ℝ in Ici 0, exp (-z * cosh t) * cosh t /-- The integrand `t ↦ exp(-z cosh t) cosh t` is continuous. -/ diff --git a/LeanPool/OSforGFF/General/FourierTransforms.lean b/LeanPool/OSforGFF/General/FourierTransforms.lean index 63ae86267e..b22b262c23 100644 --- a/LeanPool/OSforGFF/General/FourierTransforms.lean +++ b/LeanPool/OSforGFF/General/FourierTransforms.lean @@ -50,7 +50,7 @@ The 1D result follows from Fourier inversion: 3. Apply Fourier inversion to derive the Lorentzian result -/ -@[expose] public section +public section open MeasureTheory Complex Real open scoped BigOperators FourierTransform diff --git a/LeanPool/OSforGFF/General/FrobeniusPositivity.lean b/LeanPool/OSforGFF/General/FrobeniusPositivity.lean index e1cdf51532..ced9d83af2 100644 --- a/LeanPool/OSforGFF/General/FrobeniusPositivity.lean +++ b/LeanPool/OSforGFF/General/FrobeniusPositivity.lean @@ -17,7 +17,7 @@ inner product `⟪G, B⟫ = ∑ j l, G j l * B j l` is strictly positive. The pr nonzero), and reduces to `⟪G, B⟫ = tr(H D) = ∑ i, λᵢ Hᵢᵢ > 0`. -/ -@[expose] public section +public section open Matrix diff --git a/LeanPool/OSforGFF/General/FunctionalAnalysis.lean b/LeanPool/OSforGFF/General/FunctionalAnalysis.lean index a34839f8bb..10d8ec6031 100644 --- a/LeanPool/OSforGFF/General/FunctionalAnalysis.lean +++ b/LeanPool/OSforGFF/General/FunctionalAnalysis.lean @@ -67,7 +67,7 @@ focusing on integrability, Schwartz function properties, and L² embeddings. - `sub_const_hasTemperateGrowth`: Translation has temperate growth -/ -@[expose] public section +public section open MeasureTheory NNReal ENNReal Complex open TopologicalSpace Measure @@ -748,7 +748,7 @@ theorem SchwartzMap.translate_apply {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] (f : SchwartzMap E F) (a x : E) : - f.translate a x = f (x - a) := rfl + f.translate a x = f (x - a) := by rfl /-! ### Schwartz Integrable Decay diff --git a/LeanPool/OSforGFF/General/GaussianRBF.lean b/LeanPool/OSforGFF/General/GaussianRBF.lean index a006bbd394..1a26652d74 100644 --- a/LeanPool/OSforGFF/General/GaussianRBF.lean +++ b/LeanPool/OSforGFF/General/GaussianRBF.lean @@ -25,7 +25,7 @@ definiteness via the Hadamard series in `HadamardExp.lean`; (3) the Gaussian ker the RBF to the inner product kernel. -/ -@[expose] public section +public section open Complex BigOperators Real InnerProductSpace Matrix diff --git a/LeanPool/OSforGFF/General/HadamardExp.lean b/LeanPool/OSforGFF/General/HadamardExp.lean index 067f322c4b..9eda5a8a50 100644 --- a/LeanPool/OSforGFF/General/HadamardExp.lean +++ b/LeanPool/OSforGFF/General/HadamardExp.lean @@ -24,7 +24,7 @@ coefficients `1/n!` yields a PD matrix. The PSD case follows by a continuity arg exponential. -/ -@[expose] public section +public section open Complex @@ -41,7 +41,7 @@ variable {ι : Type u} /-- Entrywise real exponential of a matrix: `(entrywiseExp R) i j = exp (R i j)`. Used for the OS3 proof (Glimm–Jaffe): if `R` is PSD, then `exp(R)` (entrywise) should be PSD. -/ -noncomputable def entrywiseExp (R : Matrix ι ι ℝ) : Matrix ι ι ℝ := +@[expose] noncomputable def entrywiseExp (R : Matrix ι ι ℝ) : Matrix ι ι ℝ := fun i j => Real.exp (R i j) @[simp] lemma entrywiseExp_apply (R : Matrix ι ι ℝ) (i j : ι) : @@ -74,7 +74,7 @@ private lemma isHermitian_entrywiseExp_real (R : Matrix ι ι ℝ) /-- n-fold Hadamard power of a matrix: `hadamardPow R n = R ∘ₕ ⋯ ∘ₕ R` (n times), with `hadamardPow R 0 = hadamardOne`. -/ -@[simp] def hadamardPow (R : Matrix ι ι ℝ) : ℕ → Matrix ι ι ℝ +@[expose, simp] def hadamardPow (R : Matrix ι ι ℝ) : ℕ → Matrix ι ι ℝ | 0 => hadamardOne (ι := ι) | n+1 => hadamardPow R n ∘ₕ R diff --git a/LeanPool/OSforGFF/General/L2TimeIntegral.lean b/LeanPool/OSforGFF/General/L2TimeIntegral.lean index be4b9889c9..e7999e517c 100644 --- a/LeanPool/OSforGFF/General/L2TimeIntegral.lean +++ b/LeanPool/OSforGFF/General/L2TimeIntegral.lean @@ -41,7 +41,7 @@ The key tools are: - Folland "Real Analysis", Thm. 2.37 (Fubini-Tonelli) -/ -@[expose] public section +public section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology diff --git a/LeanPool/OSforGFF/General/LaplaceIntegral.lean b/LeanPool/OSforGFF/General/LaplaceIntegral.lean index be31f3d62b..9a9b4109d6 100644 --- a/LeanPool/OSforGFF/General/LaplaceIntegral.lean +++ b/LeanPool/OSforGFF/General/LaplaceIntegral.lean @@ -35,7 +35,7 @@ This is a special case of the modified Bessel function K_{1/2} identity. - Glasser, M.L. "A remarkable property of definite integrals" (1983) -/ -@[expose] public section +public section open Real Set MeasureTheory Filter Topology open scoped ENNReal NNReal diff --git a/LeanPool/OSforGFF/General/PositiveDefinite.lean b/LeanPool/OSforGFF/General/PositiveDefinite.lean index 08277d97e4..0d802b050f 100644 --- a/LeanPool/OSforGFF/General/PositiveDefinite.lean +++ b/LeanPool/OSforGFF/General/PositiveDefinite.lean @@ -25,7 +25,7 @@ Key lemmas: - `isPositiveDefinite_precomp_linear`: Composition with linear map preserves PD -/ -@[expose] public section +public section open Complex open BigOperators @@ -44,7 +44,7 @@ namespace GFF4D This is the standard definition in harmonic analysis and probability theory. -/ -def IsPositiveDefinite {α : Type*} [AddGroup α] (φ : α → ℂ) : Prop := +@[expose] def IsPositiveDefinite {α : Type*} [AddGroup α] (φ : α → ℂ) : Prop := ∀ (m : ℕ) (x : Fin m → α) (c : Fin m → ℂ), 0 ≤ (∑ i, ∑ j, (starRingEnd ℂ) (c i) * c j * φ (x i - x j)).re diff --git a/LeanPool/OSforGFF/General/QuantitativeDecay.lean b/LeanPool/OSforGFF/General/QuantitativeDecay.lean index ab1fa59fd0..d5970c5e8b 100644 --- a/LeanPool/OSforGFF/General/QuantitativeDecay.lean +++ b/LeanPool/OSforGFF/General/QuantitativeDecay.lean @@ -41,7 +41,7 @@ for any α > 0. - Glimm-Jaffe "Quantum Physics" Sec. 6.2 (clustering bounds) -/ -@[expose] public section +public section open MeasureTheory Complex SchwartzMap Filter Set Function Metric open scoped Real Topology diff --git a/LeanPool/OSforGFF/General/SchurProduct.lean b/LeanPool/OSforGFF/General/SchurProduct.lean index 687486c551..6906ecc5ec 100644 --- a/LeanPool/OSforGFF/General/SchurProduct.lean +++ b/LeanPool/OSforGFF/General/SchurProduct.lean @@ -19,7 +19,7 @@ the diagonal embedding of `x` into `ι × ι`. Used in the OS3 reflection positi to transfer PSD properties through the matrix exponential via `HadamardExp.lean`. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean b/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean index 8639b8de8b..8ea185a65a 100644 --- a/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean +++ b/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean @@ -43,7 +43,7 @@ Apply this pattern three times: - Reed-Simon Vol. II, Ch. X (decay of correlations) -/ -@[expose] public section +public section open MeasureTheory Complex SchwartzMap Filter Set Function Metric open scoped Real Topology Pointwise @@ -70,11 +70,11 @@ lemma schwartz_tendsto_zero (f : SchwartzMap E ℂ) : /-! ## Kernel decomposition -/ /-- The singular (compactly supported) part of the kernel. -/ -def kernelSingular (K : E → ℝ) (R₀ : ℝ) : E → ℝ := +@[expose] def kernelSingular (K : E → ℝ) (R₀ : ℝ) : E → ℝ := fun x => K x * (closedBall (0 : E) R₀).indicator (fun _ => (1 : ℝ)) x /-- The tail (decaying) part of the kernel. -/ -def kernelTail (K : E → ℝ) (R₀ : ℝ) : E → ℝ := +@[expose] def kernelTail (K : E → ℝ) (R₀ : ℝ) : E → ℝ := fun x => K x * (closedBall (0 : E) R₀)ᶜ.indicator (fun _ => (1 : ℝ)) x omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in @@ -518,7 +518,7 @@ theorem schwartz_bilinear_prod_integrable /-! ## Main theorem -/ /-- The bilinear integral of Schwartz functions against a decaying kernel -/ -def schwartzBilinearIntegral (f g : SchwartzMap E ℂ) (K : E → ℝ) (a : E) : ℂ := +@[expose] def schwartzBilinearIntegral (f g : SchwartzMap E ℂ) (K : E → ℝ) (a : E) : ℂ := ∫ x : E, ∫ y : E, f x * (K (x - y) : ℂ) * g (y - a) private lemma schwartz_bilinear_kernelSingular_vanish diff --git a/LeanPool/OSforGFF/KolmogorovExtension4.lean b/LeanPool/OSforGFF/KolmogorovExtension4.lean index 8f46809c0e..584e2c5e47 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4.lean @@ -17,4 +17,4 @@ public import LeanPool.OSforGFF.KolmogorovExtension4.Semiring Import aggregator for the `KolmogorovExtension4` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/AuxLemmas.lean b/LeanPool/OSforGFF/KolmogorovExtension4/AuxLemmas.lean index 3fa5dd2bd7..f3c0abef1e 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/AuxLemmas.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/AuxLemmas.lean @@ -17,7 +17,7 @@ import Mathlib.Topology.MetricSpace.Bounded THIS FILE IS NOT USED FOR THE MAIN RESULT -/ -@[expose] public section +public section open Finset Set Filter diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean b/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean index a41fd929d4..22ca778bd0 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/CompactSystem.lean @@ -15,7 +15,7 @@ import Mathlib.Topology.IsClosedRestrict Auxiliary compact-system lemmas for the Kolmogorov extension construction. -/ -@[expose] public section +public section open Set MeasureTheory diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean b/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean index 126bf35ff7..f0d82f2a97 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean @@ -19,7 +19,7 @@ public import Mathlib.MeasureTheory.Measure.RegularityCompacts Auxiliary statements for constructing measures from projective finite-dimensional marginals. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/RegularContent.lean b/LeanPool/OSforGFF/KolmogorovExtension4/RegularContent.lean index 7724e59617..2fc8773c3a 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/RegularContent.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/RegularContent.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Measure.AddContent Regularity lemmas for additive contents used in the Kolmogorov extension construction. -/ -@[expose] public section +public section open scoped ENNReal diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/Semiring.lean b/LeanPool/OSforGFF/KolmogorovExtension4/Semiring.lean index cd8cbbc891..79dbdc8b44 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/Semiring.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/Semiring.lean @@ -15,7 +15,7 @@ for all `s, t ∈ C`, `t \ s` is equal to a disjoint union of finitely many sets THIS FILE IS NOT USED FOR THE MAIN RESULT -/ -@[expose] public section +public section variable {α : Type*} {C : Set (Set α)} {s t : Set α} {J : Finset (Set α)} diff --git a/LeanPool/OSforGFF/Measure.lean b/LeanPool/OSforGFF/Measure.lean index e78d3bea9e..9fb76c8ac8 100644 --- a/LeanPool/OSforGFF/Measure.lean +++ b/LeanPool/OSforGFF/Measure.lean @@ -20,4 +20,4 @@ import Mathlib.Data.Nat.Choose.Multinomial Import aggregator for the `Measure` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Measure/Construct.lean b/LeanPool/OSforGFF/Measure/Construct.lean index e5693001d7..88252ee344 100644 --- a/LeanPool/OSforGFF/Measure/Construct.lean +++ b/LeanPool/OSforGFF/Measure/Construct.lean @@ -37,7 +37,7 @@ then using Mathlib's `memLp_id_gaussianReal`. - `constructGaussianMeasureMinlosFree`: the GFF measure for mass m > 0 -/ -@[expose] public section +public section open MeasureTheory Complex QFT ProbabilityTheory open TopologicalSpace SchwartzMap @@ -51,8 +51,9 @@ No axioms declared here. Transitively uses `schwartzIsHilbertNuclear, schwartzSe noncomputable section private lemma distributionPairingCLM_measurable (φ : OSforGFF.TestFunction) : - Measurable (distributionPairingCLM φ) := - WeakDual.eval_measurable φ + Measurable (distributionPairingCLM φ) := by + rw [distributionPairingCLM_eq_fun] + simpa only [distributionPairing] using (WeakDual.eval_measurable φ) private lemma freeCovarianceFormR_neg_neg (m : ℝ) [Fact (0 < m)] (f : OSforGFF.TestFunction) : freeCovarianceFormR m (-f) (-f) = freeCovarianceFormR m f f := by @@ -83,7 +84,7 @@ def isCenteredGJ (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := /-- A measure is Gaussian if its generating functional has the Gaussian form. For a centered Gaussian measure, Z[J] = exp(-½⟨J, CJ⟩) where C is the covariance. -/ -def isGaussianGJ (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def isGaussianGJ (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := isCenteredGJ dμ_config ∧ ∀ (J : TestFunctionℂ), GJGeneratingFunctionalℂ dμ_config J = @@ -211,8 +212,7 @@ private lemma charFun_eq_GJGeneratingFunctional rw [GJGeneratingFunctional] congr 1 ext ω - simp only [distributionPairingCLM, ContinuousLinearMap.coe_mk', LinearMap.coe_mk, AddHom.coe_mk, - distributionPairing, map_smul, smul_eq_mul] + simp only [distributionPairingCLM_apply, distributionPairing, map_smul, smul_eq_mul] rw [show (inner ℝ (ω φ) t : ℝ) = ω φ * t by rw [real_inner_comm] exact Real.ext_cauchy rfl] @@ -390,7 +390,9 @@ theorem gaussianFreeField_free_centered (m : ℝ) [Fact (0 < m)] : have h_int_real : Integrable (distributionPairingCLM φ) (gaussianFreeFieldFree m).toMeasure := h_memLp.integrable (by norm_num : (1 : ENNReal) ≤ 1) -- The complex version follows since ofReal is continuous - exact h_int_real.ofReal + have h_int_complex : Integrable (fun ω => ((distributionPairingCLM φ) ω : ℂ)) + (gaussianFreeFieldFree m).toMeasure := h_int_real.ofReal + simpa only [distributionPairingCLM_apply, distributionPairing] using h_int_complex -- Step 3: Apply moment_zero_from_realCF to get ∫ (ω φ : ℂ) = 0 have h_complex_zero : ∫ ω, (ω φ : ℂ) ∂(gaussianFreeFieldFree m).toMeasure = 0 := MinlosAnalytic.moment_zero_from_realCF @@ -447,6 +449,6 @@ lemma gaussian_pairing_square_integrable_real -- L² membership directly implies integrability of the square have h_integrable_CLM := h_memLp.integrable_sq -- Translate the statement from the continuous linear map to the scalar pairing - exact h_integrable_CLM + simpa only [distributionPairingCLM_apply, distributionPairing] using h_integrable_CLM end diff --git a/LeanPool/OSforGFF/Measure/GaussianFreeField.lean b/LeanPool/OSforGFF/Measure/GaussianFreeField.lean index 679c89eefb..c4bc25a235 100644 --- a/LeanPool/OSforGFF/Measure/GaussianFreeField.lean +++ b/LeanPool/OSforGFF/Measure/GaussianFreeField.lean @@ -21,7 +21,7 @@ Defines muGFF m as a ProbabilityMeasure and proves two OS axioms for general Gau - OS2 (Euclidean invariance): Z[gf] = Z[f] when covariance is E(4)-invariant -/ -@[expose] public section +public section open MeasureTheory Complex open TopologicalSpace SchwartzMap @@ -159,6 +159,7 @@ def CovarianceEuclideanInvariant (dμ_config : ProbabilityMeasure FieldConfigura SchwingerFunction₂ dμ_config f h /-- Assumption: The complex covariance is invariant under Euclidean transformations -/ +@[expose] def CovarianceEuclideanInvariantℂ (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (g : QFT.E) (f h : TestFunctionℂ), SchwingerFunctionℂ₂ dμ_config (QFT.euclideanAction g f) (QFT.euclideanAction g h) = diff --git a/LeanPool/OSforGFF/Measure/IsGaussian.lean b/LeanPool/OSforGFF/Measure/IsGaussian.lean index 51d2080e89..2258cfcd90 100644 --- a/LeanPool/OSforGFF/Measure/IsGaussian.lean +++ b/LeanPool/OSforGFF/Measure/IsGaussian.lean @@ -30,7 +30,7 @@ interchange, not because of OS0-specific infrastructure. - `isGaussianGJ_gaussianFreeField_free`: the free GFF is Gaussian -/ -@[expose] public section +public section open MeasureTheory Complex QFT @@ -407,9 +407,11 @@ lemma schwinger_eq_covarianceℂ_on_reals (f g : OSforGFF.TestFunction) : (gaussianFreeFieldFree m).toMeasure := by -- Use Hölder: L² × L² → L¹ have hf : MemLp (fun ω => distributionPairing ω f) 2 (gaussianFreeFieldFree m).toMeasure := - gaussianFreeField_pairing_memLp m f 2 (by simp) + by simpa only [← distributionPairingCLM_apply] using + gaussianFreeField_pairing_memLp m f 2 (by simp) have hg : MemLp (fun ω => distributionPairing ω g) 2 (gaussianFreeFieldFree m).toMeasure := - gaussianFreeField_pairing_memLp m g 2 (by simp) + by simpa only [← distributionPairingCLM_apply] using + gaussianFreeField_pairing_memLp m g 2 (by simp) exact hf.integrable_mul hg -- Step 3: Pull cast outside integral: ∫ ↑(f ω) dμ = ↑(∫ f ω dμ) rw [integral_ofReal_eq _ _ h_int] diff --git a/LeanPool/OSforGFF/Measure/Minlos.lean b/LeanPool/OSforGFF/Measure/Minlos.lean index 957cafdd78..8a4c8a26fe 100644 --- a/LeanPool/OSforGFF/Measure/Minlos.lean +++ b/LeanPool/OSforGFF/Measure/Minlos.lean @@ -37,7 +37,7 @@ the proven Minlos theorem. - `gaussian_measure_symmetry`: covariance-preserving maps induce measure symmetries -/ -@[expose] public section +public section open Complex MeasureTheory Matrix TopologicalSpace open BigOperators @@ -145,7 +145,7 @@ variable {E : Type*} [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] /-- For Gaussian measures, the characteristic functional has the special form Φ(f) = exp(-½⟨f, Cf⟩) where C is a nuclear covariance operator. -/ -def gaussianCharacteristicFunctional +@[expose] def gaussianCharacteristicFunctional (covariance_form : E → E → ℝ) (f : E) : ℂ := Complex.exp (-(1/2 : ℂ) * (covariance_form f f)) diff --git a/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean b/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean index 0f4b76eaa3..8c175349c7 100644 --- a/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean +++ b/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean @@ -24,7 +24,7 @@ This file provides infrastructure for Gaussian measures constructed via Minlos' - `moment_zero_from_realCF`: Zero mean from characteristic functional symmetry -/ -@[expose] public section +public section open TopologicalSpace MeasureTheory Complex Filter diff --git a/LeanPool/OSforGFF/Measure/NuclearSpace.lean b/LeanPool/OSforGFF/Measure/NuclearSpace.lean index 820ef3d6c1..bf382b9952 100644 --- a/LeanPool/OSforGFF/Measure/NuclearSpace.lean +++ b/LeanPool/OSforGFF/Measure/NuclearSpace.lean @@ -33,7 +33,7 @@ the bochner library (Minlos theorem). - Gel'fand-Vilenkin, "Generalized Functions" Vol. 4, Ch. 3-4 -/ -@[expose] public section +public section /-! ### WithSeminorms reindexing diff --git a/LeanPool/OSforGFF/Minlos.lean b/LeanPool/OSforGFF/Minlos.lean index 152149897b..73af7541d4 100644 --- a/LeanPool/OSforGFF/Minlos.lean +++ b/LeanPool/OSforGFF/Minlos.lean @@ -23,4 +23,4 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Import aggregator for the `Minlos` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Minlos/FinDimMarginals.lean b/LeanPool/OSforGFF/Minlos/FinDimMarginals.lean index e076d29abf..39ccc36db9 100644 --- a/LeanPool/OSforGFF/Minlos/FinDimMarginals.lean +++ b/LeanPool/OSforGFF/Minlos/FinDimMarginals.lean @@ -32,7 +32,7 @@ measure μ_F on ℝⁿ. - `marginal_measure_exists` — Bochner gives a probability measure with matching CF -/ -@[expose] public section +public section open BigOperators MeasureTheory Complex @@ -45,7 +45,7 @@ noncomputable section Defined on `EuclideanSpace ℝ (Fin n)` (which is `PiLp 2 (fun _ => ℝ)`) so that we can apply Bochner's theorem (which requires inner product spaces). -/ -def marginalCF {E : Type*} [AddCommGroup E] [Module ℝ E] +@[expose] def marginalCF {E : Type*} [AddCommGroup E] [Module ℝ E] (Φ : E → ℂ) {n : ℕ} (f : Fin n → E) : EuclideanSpace ℝ (Fin n) → ℂ := fun t => Φ (∑ i, (t i) • f i) diff --git a/LeanPool/OSforGFF/Minlos/Main.lean b/LeanPool/OSforGFF/Minlos/Main.lean index ee3de9111e..76228ac46b 100644 --- a/LeanPool/OSforGFF/Minlos/Main.lean +++ b/LeanPool/OSforGFF/Minlos/Main.lean @@ -42,7 +42,7 @@ probability measure on the topological dual E' = WeakDual ℝ E. - Degenne-Pfaffelhuber, KolmogorovExtension4 (formalized Kolmogorov extension) -/ -@[expose] public section +public section open BigOperators MeasureTheory Complex TopologicalSpace diff --git a/LeanPool/OSforGFF/Minlos/MeasurableModification.lean b/LeanPool/OSforGFF/Minlos/MeasurableModification.lean index 0279028bf6..023231e990 100644 --- a/LeanPool/OSforGFF/Minlos/MeasurableModification.lean +++ b/LeanPool/OSforGFF/Minlos/MeasurableModification.lean @@ -49,7 +49,7 @@ P : (E → ℝ) → WeakDual ℝ E that agrees with the identity on "good paths" - Minlos, "Generalized random processes and their extension to measures" (1959) -/ -@[expose] public section +public section open BigOperators MeasureTheory Complex TopologicalSpace Finsupp @@ -74,7 +74,7 @@ private lemma continuous_finset_sup_seminorm (p : ℕ → Seminorm ℝ E) underlying function. This is measurable (but NOT a MeasurableEmbedding when E is uncountable-dimensional). -/ -def weakDualEmbed (E : Type*) [AddCommGroup E] [Module ℝ E] +@[expose] def weakDualEmbed (E : Type*) [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] [hAdd : IsTopologicalAddGroup E] [hSmul : ContinuousSMul ℝ E] : WeakDual ℝ E → (E → ℝ) := let _ := hAdd diff --git a/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean b/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean index 1d0b7ce193..0919349507 100644 --- a/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean +++ b/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean @@ -47,7 +47,7 @@ nuclear cylindrical measures. `minlos_concentration` is a convenience wrapper. - Trèves, "Topological Vector Spaces", Ch. 50-51 -/ -@[expose] public section +public section open BigOperators MeasureTheory Complex TopologicalSpace Finsupp diff --git a/LeanPool/OSforGFF/Minlos/NuclearSpace.lean b/LeanPool/OSforGFF/Minlos/NuclearSpace.lean index be8771d75a..993e4828e1 100644 --- a/LeanPool/OSforGFF/Minlos/NuclearSpace.lean +++ b/LeanPool/OSforGFF/Minlos/NuclearSpace.lean @@ -25,7 +25,7 @@ via Hilbert-Schmidt embeddings. Adapted from OSforGFF/IsHilbertNuclear.lean. - Reed-Simon, "Methods of Modern Mathematical Physics" Vol. 1, §V.3 -/ -@[expose] public section +public section open scoped BigOperators @@ -50,17 +50,17 @@ def IsNuclearMap {E F : Type*} /-- A seminorm is **Hilbertian** (comes from an inner product) iff it satisfies the parallelogram law. -/ -def Seminorm.IsHilbertian {E : Type*} [AddCommGroup E] [Module ℝ E] +@[expose] def Seminorm.IsHilbertian {E : Type*} [AddCommGroup E] [Module ℝ E] (p : Seminorm ℝ E) : Prop := ∀ x y : E, p (x + y) ^ 2 + p (x - y) ^ 2 = 2 * (p x ^ 2 + p y ^ 2) /-- The inner product induced by a Hilbertian seminorm via polarization. -/ -noncomputable def Seminorm.innerProd {E : Type*} [AddCommGroup E] [Module ℝ E] +@[expose] noncomputable def Seminorm.innerProd {E : Type*} [AddCommGroup E] [Module ℝ E] (p : Seminorm ℝ E) (x y : E) : ℝ := (p (x + y) ^ 2 - p (x - y) ^ 2) / 4 /-- A finite sequence is **p-orthonormal**: ⟨eᵢ, eⱼ⟩_p = δᵢⱼ. -/ -def Seminorm.IsOrthonormalSeq {E : Type*} [AddCommGroup E] [Module ℝ E] +@[expose] def Seminorm.IsOrthonormalSeq {E : Type*} [AddCommGroup E] [Module ℝ E] (p : Seminorm ℝ E) {n : ℕ} (e : Fin n → E) : Prop := ∀ i j, p.innerProd (e i) (e j) = if i = j then 1 else 0 @@ -69,7 +69,7 @@ def Seminorm.IsOrthonormalSeq {E : Type*} [AddCommGroup E] [Module ℝ E] /-- The canonical inclusion Ê_p → Ê_q is **Hilbert-Schmidt**: the sum ∑ q(eₖ)² is uniformly bounded over all finite p-orthonormal sequences. -/ -def Seminorm.IsHilbertSchmidtEmbedding {E : Type*} [AddCommGroup E] [Module ℝ E] +@[expose] def Seminorm.IsHilbertSchmidtEmbedding {E : Type*} [AddCommGroup E] [Module ℝ E] (p q : Seminorm ℝ E) : Prop := q ≤ p ∧ ∃ (C : ℝ), ∀ (n : ℕ) (e : Fin n → E), diff --git a/LeanPool/OSforGFF/Minlos/PietschBridge.lean b/LeanPool/OSforGFF/Minlos/PietschBridge.lean index 436e5b30fd..a49dceab46 100644 --- a/LeanPool/OSforGFF/Minlos/PietschBridge.lean +++ b/LeanPool/OSforGFF/Minlos/PietschBridge.lean @@ -35,7 +35,7 @@ expansion `p(x) ≤ Σₖ |fₖ(x)| · cₖ` with `|fₖ| ≤ q`), we: - Trèves, "Topological Vector Spaces", Ch. 50-51 -/ -@[expose] public section +public section open scoped BigOperators @@ -50,7 +50,7 @@ there exist CLFs `fₙ` and non-negative reals `cₙ` with `Σ cₙ < ∞`, and continuous seminorm `q ≥ p`, such that `|fₙ(x)| ≤ q(x)` and `p(x) ≤ Σₙ |fₙ(x)| · cₙ`. -/ -def IsNuclear (E : Type*) [AddCommGroup E] [Module ℝ E] +@[expose] def IsNuclear (E : Type*) [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] : Prop := ∀ (p : Seminorm ℝ E), Continuous p → ∃ (q : Seminorm ℝ E), Continuous q ∧ (∀ x, p x ≤ q x) ∧ @@ -175,7 +175,7 @@ def hilbertianLift (f : ℕ → (E →L[ℝ] ℝ)) (c : ℕ → ℝ) theorem hilbertianLift_apply (f : ℕ → (E →L[ℝ] ℝ)) (c : ℕ → ℝ) (hc_nn : ∀ n, 0 ≤ c n) (hc_sum : Summable c) (q : Seminorm ℝ E) (hfq : ∀ n x, |f n x| ≤ q x) (x : E) : - hilbertianLift f c hc_nn hc_sum q hfq x = Real.sqrt (∑' n, (f n x) ^ 2 * c n) := rfl + hilbertianLift f c hc_nn hc_sum q hfq x = Real.sqrt (∑' n, (f n x) ^ 2 * c n) := by rfl /-- The Hilbertian lift satisfies the parallelogram law. diff --git a/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean b/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean index 7a31f5868f..e72dfca153 100644 --- a/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean +++ b/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean @@ -23,7 +23,7 @@ by `Finset E`), enabling application of the Kolmogorov extension theorem. - `marginalFamily_isProjective` — the family is projective (consistent under restriction) -/ -@[expose] public section +public section open BigOperators MeasureTheory Complex @@ -35,7 +35,7 @@ variable {E : Type*} [AddCommGroup E] [Module ℝ E] /-! ## Transport equivalence -/ /-- Measurable equivalence between `∀ j : J, ℝ` and `Fin |J| → ℝ` via `J.equivFin`. -/ -def finsetReindexEquiv (J : Finset E) : +@[expose] def finsetReindexEquiv (J : Finset E) : (↥J → ℝ) ≃ᵐ (Fin J.card → ℝ) where toEquiv := { toFun := fun x i => x (J.equivFin.symm i) @@ -48,14 +48,14 @@ def finsetReindexEquiv (J : Finset E) : /-- Measurable equivalence between `∀ j : J, ℝ` and `EuclideanSpace ℝ (Fin |J|)`. Composition of reindexing by `J.equivFin` and `MeasurableEquiv.toLp`. -/ -def finsetPiMeasEquiv (J : Finset E) : +@[expose] def finsetPiMeasEquiv (J : Finset E) : (↥J → ℝ) ≃ᵐ EuclideanSpace ℝ (Fin J.card) := (finsetReindexEquiv J).trans (MeasurableEquiv.toLp 2 (Fin J.card → ℝ)) /-! ## Marginal family -/ /-- The test vectors for a finset `J`, as a function `Fin |J| → E`. -/ -def finsetTestVectors (J : Finset E) : Fin J.card → E := +@[expose] def finsetTestVectors (J : Finset E) : Fin J.card → E := fun i => (J.equivFin.symm i : E) /-- Choose the unique Bochner marginal measure for test vectors from a finset. -/ @@ -74,7 +74,7 @@ theorem marginalMeasure_charFun (Φ : E → ℂ) (hΦ_cont : Continuous Φ) Bochner marginal on `EuclideanSpace ℝ (Fin |J|)` and transport it to `∀ j : J, ℝ` via the `finsetPiMeasEquiv`. -/ -def marginalFamily (Φ : E → ℂ) (hΦ_cont : Continuous Φ) +@[expose] def marginalFamily (Φ : E → ℂ) (hΦ_cont : Continuous Φ) (hΦ_pd : IsPositiveDefinite Φ) (hΦ_norm : Φ 0 = 1) : ∀ J : Finset E, Measure (∀ j : ↥J, (fun (_ : E) => ℝ) ↑j) := fun J => (marginalMeasure Φ hΦ_cont hΦ_pd hΦ_norm J).toMeasure.map diff --git a/LeanPool/OSforGFF/Minlos/SazonovTightness.lean b/LeanPool/OSforGFF/Minlos/SazonovTightness.lean index 3dd40018a3..4aefd5d0a6 100644 --- a/LeanPool/OSforGFF/Minlos/SazonovTightness.lean +++ b/LeanPool/OSforGFF/Minlos/SazonovTightness.lean @@ -32,7 +32,7 @@ spectral decomposition, and Chebyshev inequalities. - `sazonov_tight_marginals_apply`: Explicit tightness bound via Gaussian averaging -/ -@[expose] public section +public section open MeasureTheory Complex Filter Topology Set InnerProductSpace Function open scoped Real FourierTransform @@ -1050,7 +1050,7 @@ theorem sazonov_tightness (φ : H → ℂ) (_hpd : IsPositiveDefinite φ) set ε := η / 3 with hε_def have hε : 0 < ε := by linarith obtain ⟨S, hS_bound⟩ := hsaz ε hε - obtain ⟨hpos, ι, b, hsum⟩ := S.traceClass + obtain ⟨hpos, ι, b, hsum⟩ := (isPositiveTraceClass_iff S.op).mp S.traceClass set T := ∑' i, @inner ℝ H _ (b i) (S.op (b i)) with hT_def have hT_nn : 0 ≤ T := by apply tsum_nonneg; intro i diff --git a/LeanPool/OSforGFF/OS.lean b/LeanPool/OSforGFF/OS.lean index 3e7b5883d0..f2b4d65174 100644 --- a/LeanPool/OSforGFF/OS.lean +++ b/LeanPool/OSforGFF/OS.lean @@ -27,4 +27,4 @@ import Mathlib.Data.Nat.Choose.Multinomial Import aggregator for the `OS` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/OS/Axioms.lean b/LeanPool/OSforGFF/OS/Axioms.lean index 4df0d2e6ed..7928b00f0b 100644 --- a/LeanPool/OSforGFF/OS/Axioms.lean +++ b/LeanPool/OSforGFF/OS/Axioms.lean @@ -35,7 +35,7 @@ Following Glimm-Jaffe formulation using probability measures on field configurat Glimm and Jaffe, Quantum Physics, pp. 89-90 -/ -@[expose] public section +public section open MeasureTheory NNReal ENNReal open TopologicalSpace Measure QFT @@ -45,17 +45,17 @@ noncomputable section open scoped MeasureTheory Complex BigOperators SchwartzMap /-- OS0 (Analyticity): The generating functional is analytic in the test functions. -/ -def os0Analyticity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def os0Analyticity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (n : ℕ) (J : Fin n → TestFunctionℂ), AnalyticOn ℂ (fun z : Fin n → ℂ => GJGeneratingFunctionalℂ dμ_config (∑ i, z i • J i)) Set.univ /-- Two-point function local integrability condition for p = 2 -/ -def TwoPointIntegrable (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def TwoPointIntegrable (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := LocallyIntegrable (fun x => SchwingerTwoPointFunction dμ_config x) volume /-- OS1 (Regularity): The complex generating functional satisfies exponential bounds. -/ -def os1Regularity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def os1Regularity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∃ (p : ℝ) (c : ℝ), 1 ≤ p ∧ p ≤ 2 ∧ c > 0 ∧ (∀ (f : TestFunctionℂ), ‖GJGeneratingFunctionalℂ dμ_config f‖ ≤ @@ -63,7 +63,7 @@ def os1Regularity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := (p = 2 → TwoPointIntegrable dμ_config) /-- OS2 (Euclidean Invariance): The measure is invariant under Euclidean transformations. -/ -def os2EuclideanInvariance (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def os2EuclideanInvariance (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (g : QFT.E) (f : TestFunctionℂ), GJGeneratingFunctionalℂ dμ_config f = GJGeneratingFunctionalℂ dμ_config (QFT.euclideanAction g f) @@ -82,7 +82,7 @@ def os2EuclideanInvariance (dμ_config : ProbabilityMeasure FieldConfiguration) (see `star_toComplex_eq_compTimeReflection`), so this reduces to `os3ReflectionPositivityReal`. -/ -def os3ReflectionPositivity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def os3ReflectionPositivity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (n : ℕ) (f : Fin n → PositiveTimeTestFunctionℂ) (c : Fin n → ℂ), 0 ≤ (∑ i, ∑ j, starRingEnd ℂ (c i) * c j * GJGeneratingFunctionalℂ dμ_config @@ -93,6 +93,7 @@ def os3ReflectionPositivity (dμ_config : ProbabilityMeasure FieldConfiguration) for measures where the generating functional is real on real test functions (in particular for Gaussian measures). -/ +@[expose] def os3ReflectionPositivityReal (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (n : ℕ) (f : Fin n → PositiveTimeTestFunction) (c : Fin n → ℝ), let reflection_matrix := fun i j : Fin n => @@ -116,7 +117,7 @@ def os3ReflectionPositivityReal (dμ_config : ProbabilityMeasure FieldConfigurat positive definiteness of the covariance. The complex extension follows from analyticity (OS0) and regularity (OS1). -/ -def os4Clustering (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def os4Clustering (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (f g : OSforGFF.TestFunction) (ε : ℝ), ε > 0 → ∃ (R : ℝ), R > 0 ∧ ∀ (a : SpaceTime), ‖a‖ > R → ‖GJGeneratingFunctional dμ_config (f + g.translate a) - @@ -129,7 +130,7 @@ def os4Clustering (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := This is the standard ergodicity formulation from Glimm-Jaffe. -/ -def OS4Ergodicity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def OS4Ergodicity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (n : ℕ) (z : Fin n → ℂ) (f : Fin n → TestFunctionℂ), let μ := dμ_config.toMeasure let A : FieldConfiguration → ℂ := fun ω => @@ -151,7 +152,7 @@ def OS4Ergodicity (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := polynomial decay rate. For the GFF in 4D spacetime (d=3 spatial dimensions), the natural rate is α = 2d = 6 from the mass gap. -/ -def os4PolynomialClustering (dμ_config : ProbabilityMeasure FieldConfiguration) +@[expose] def os4PolynomialClustering (dμ_config : ProbabilityMeasure FieldConfiguration) (α : ℝ) (_hα : α > 0) : Prop := let _ := _hα ∀ (f g : TestFunctionℂ), ∃ (c : ℝ), c ≥ 0 ∧ diff --git a/LeanPool/OSforGFF/OS/Master.lean b/LeanPool/OSforGFF/OS/Master.lean index 1fa854da08..74fc31d436 100644 --- a/LeanPool/OSforGFF/OS/Master.lean +++ b/LeanPool/OSforGFF/OS/Master.lean @@ -33,7 +33,7 @@ Assembles OS0–OS4 into `gaussianFreeField_satisfies_all_OS_axioms`: Unconditional theorem: only requires m > 0. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/OSforGFF/OS/NonTrivial.lean b/LeanPool/OSforGFF/OS/NonTrivial.lean index 1b170096d2..00e9cec7e3 100644 --- a/LeanPool/OSforGFF/OS/NonTrivial.lean +++ b/LeanPool/OSforGFF/OS/NonTrivial.lean @@ -50,7 +50,7 @@ Injectivity of T follows from: - Reed–Simon, *Methods of Modern Mathematical Physics* II, §IX.8 -/ -@[expose] public section +public section open MeasureTheory Complex QFT open scoped Real BigOperators SchwartzMap diff --git a/LeanPool/OSforGFF/OS/OS0Analyticity.lean b/LeanPool/OSforGFF/OS/OS0Analyticity.lean index 8ba12a155b..b62821fd33 100644 --- a/LeanPool/OSforGFF/OS/OS0Analyticity.lean +++ b/LeanPool/OSforGFF/OS/OS0Analyticity.lean @@ -44,7 +44,7 @@ L(t) = Z[f_re + t·f_im] and R(t) = exp(-½ Q(t)), show L = R on ℝ (from - `gaussianFreeField_satisfies_OS0` -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/OSforGFF/OS/OS1Regularity.lean b/LeanPool/OSforGFF/OS/OS1Regularity.lean index 277b149c4e..984f907656 100644 --- a/LeanPool/OSforGFF/OS/OS1Regularity.lean +++ b/LeanPool/OSforGFF/OS/OS1Regularity.lean @@ -32,7 +32,7 @@ the Bessel K₁ asymptotics: (m/4π²|x|)K₁(m|x|) is locally integrable in 4D. - `gaussianFreeField_satisfies_OS1_revised` -/ -@[expose] public section +public section open MeasureTheory Complex BigOperators SchwartzMap Real QFT open scoped MeasureTheory ENNReal @@ -68,6 +68,7 @@ theorem fourier_plancherel_schwartz (g : TestFunctionℂ) : a limit (using `limUnder`), properly avoiding DiracDelta. For the GFF specifically, we use this direct definition for computational convenience. -/ +@[expose] noncomputable def schwingerTwoPointFunctionGFF (m : ℝ) [hm : Fact (0 < m)] (x : SpaceTime) : ℝ := let _ := hm freeCovarianceKernel m x diff --git a/LeanPool/OSforGFF/OS/OS2Invariance.lean b/LeanPool/OSforGFF/OS/OS2Invariance.lean index 39bc5a10d2..13559b77e8 100644 --- a/LeanPool/OSforGFF/OS/OS2Invariance.lean +++ b/LeanPool/OSforGFF/OS/OS2Invariance.lean @@ -26,7 +26,7 @@ Hence S(Ef) = ∫∫ f*(x) C(x,y) f(y) dx dy = S(f). - `CovarianceEuclideanInvariantℂ_μ_GFF` -/ -@[expose] public section +public section open MeasureTheory Complex Real Filter open scoped Real BigOperators diff --git a/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean b/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean index 0eb722a96e..db700741fd 100644 --- a/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean +++ b/LeanPool/OSforGFF/OS/OS3CovarianceRP.lean @@ -30,7 +30,7 @@ perfect square ∫ (1/ω)|F_ω(kbar)|² dkbar with F_ω(kbar) = ∫ ftilde(t,kba - `freeCovariance_reflection_positive_real`: real-valued version -/ -@[expose] public section +public section namespace QFT @@ -54,7 +54,7 @@ avoids non-convergent pointwise integrals. This is the distributional formulation that is mathematically well-defined for Schwartz test functions. -/ -noncomputable def rpInnerProduct (m : ℝ) (f : TestFunctionℂ) : ℂ := +@[expose] noncomputable def rpInnerProduct (m : ℝ) (f : TestFunctionℂ) : ℂ := freeCovarianceℂBilinear m (star f) f /-! ## Direct Proof of Reflection Positivity @@ -71,14 +71,14 @@ open scoped ComplexConjugate /-! ## Part 1: Core Definitions -/ /-- The `timeReflection` declaration. -/ -noncomputable def timeReflection (x : SpaceTime) : SpaceTime := +@[expose] noncomputable def timeReflection (x : SpaceTime) : SpaceTime := (WithLp.equiv 2 _).symm (Function.update x.ofLp 0 (-x.ofLp 0)) lemma timeReflection_involutive : Function.Involutive timeReflection := _root_.timeReflection_involutive /-- The `spatialDot` declaration. -/ -noncomputable def spatialDot (k_spatial x_spatial : SpatialCoords) : ℝ := +@[expose] noncomputable def spatialDot (k_spatial x_spatial : SpatialCoords) : ℝ := ∑ i, k_spatial i * x_spatial i /-- The `freeCovarianceℂBilinear` declaration. -/ @@ -100,7 +100,11 @@ noncomputable def rpInnerProduct (m : ℝ) (f : TestFunctionℂ) : ℂ := variable (m : ℝ) [Fact (0 < m)] lemma star_apply (f : TestFunctionℂ) (x : SpaceTime) : - (star f) x = starRingEnd ℂ (f (timeReflection x)) := rfl + (star f) x = starRingEnd ℂ (f (timeReflection x)) := by + change (starTestFunction f) x = _ + rw [starTestFunction_apply] + simp only [QFT.compTimeReflection, SchwartzMap.compCLM_apply, Function.comp_apply] + rfl omit [Fact (0 < m)] in theorem rpInnerProduct_eq_bessel_reflected (f : TestFunctionℂ) : @@ -425,7 +429,7 @@ lemma star_toComplex_eq_compTimeReflection (f : OSforGFF.TestFunction) : ext x -- star f is defined as starTestFunction f -- starTestFunction f x = starRingEnd ℂ ((compTimeReflection f) x) - simp only [star, starTestFunction] + simp only [star, starTestFunction_apply] -- Now goal: starRingEnd ℂ ((compTimeReflection (toComplex f)) x) = (compTimeReflection (toComplex -- f)) x exact compTimeReflection_toComplex_star_eq f x diff --git a/LeanPool/OSforGFF/OS/OS3MixedRep.lean b/LeanPool/OSforGFF/OS/OS3MixedRep.lean index 630dd6948b..ecd37a684a 100644 --- a/LeanPool/OSforGFF/OS/OS3MixedRep.lean +++ b/LeanPool/OSforGFF/OS/OS3MixedRep.lean @@ -48,7 +48,7 @@ The mixed representation exhibits: - Haag, "Local Quantum Physics" (1996), §V.3 -/ -@[expose] public section +public section open MeasureTheory Complex Real Filter QFT LaplaceIntegral open TopologicalSpace diff --git a/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean b/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean index b809718f43..53d5f04f73 100644 --- a/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean +++ b/LeanPool/OSforGFF/OS/OS3MixedRepInfra.lean @@ -35,7 +35,7 @@ bounds use |f(x)||f(y)| ≤ C · x₀y₀ / (1+|xbar|²)^N(1+|ybar|²)^N for pos test functions, combined with Gaussian moment formulas for the time integrals. -/ -@[expose] public section +public section open MeasureTheory Complex Real Filter QFT open TopologicalSpace @@ -47,7 +47,7 @@ variable {m : ℝ} [Fact (0 < m)] /-! ## Core Definitions -/ /-- Inner product on spatial coordinates: k_spatial · x_spatial = Σᵢ kᵢ xᵢ -/ -noncomputable def spatialDot (k_spatial x_spatial : SpatialCoords) : ℝ := +@[expose] noncomputable def spatialDot (k_spatial x_spatial : SpatialCoords) : ℝ := ∑ i, k_spatial i * x_spatial i /-- Inner product on ℝ equals multiplication. -/ diff --git a/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean b/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean index 7abed9eeb1..7080441454 100644 --- a/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean +++ b/LeanPool/OSforGFF/OS/OS3ReflectionPositivity.lean @@ -43,7 +43,7 @@ exponential PSD theorem. - `gaussianFreeField_OS3`: `os3ReflectionPositivity (muGFF m)` (complex) -/ -@[expose] public section +public section open MeasureTheory Complex Matrix open scoped Real InnerProductSpace BigOperators @@ -499,8 +499,10 @@ private lemma freeCovarianceℂ_bilinear_star_star_conj -- = ∫∫ conj(f(Θx)) · ↑K(x,y) · conj(g(Θy)) (definitionally, by star_apply = rfl) -- RHS = conj(∫∫ f(x) · ↑K(x,y) · g(y)) -- Step 1: Rewrite (star h)(z) = conj(h(Θz)) explicitly so simp_rw can work with it. - have hstarf : ∀ x, (star f) x = starRingEnd ℂ (f (QFT.timeReflection x)) := fun _ => rfl - have hstarg : ∀ y, (star g) y = starRingEnd ℂ (g (QFT.timeReflection y)) := fun _ => rfl + have hstarf : ∀ x, (star f) x = starRingEnd ℂ (f (QFT.timeReflection x)) := + fun x => QFT.RPProof.star_apply f x + have hstarg : ∀ y, (star g) y = starRingEnd ℂ (g (QFT.timeReflection y)) := + fun y => QFT.RPProof.star_apply g y simp_rw [hstarf, hstarg] -- Now LHS = ∫∫ conj(f(Θx)) · ↑K(x,y) · conj(g(Θy)) -- Step 2: Pull conj inside the RHS integrals. @@ -583,6 +585,7 @@ private def IsHermitianMatrix {n : ℕ} (M : Fin n → Fin n → ℂ) : Prop := /-- Star is involutive on `TestFunctionℂ`: `star (star f) = f`. -/ private lemma star_star_testFunctionℂ (f : TestFunctionℂ) : star (star f) = f := by ext x + rw [QFT.RPProof.star_apply, QFT.RPProof.star_apply] change starRingEnd ℂ (starRingEnd ℂ (f (QFT.timeReflection (QFT.timeReflection x)))) = f x rw [QFT.timeReflection_involutive, RCLike.conj_conj] @@ -822,7 +825,7 @@ private lemma gff_complexZ_entry_factor (fi fj : TestFunctionℂ) : and `compTimeReflection` is a continuous linear map. -/ private lemma star_apply (f : TestFunctionℂ) (x : SpaceTime) : - (star f) x = starRingEnd ℂ (f (QFT.timeReflection x)) := rfl + (star f) x = starRingEnd ℂ (f (QFT.timeReflection x)) := QFT.RPProof.star_apply f x private lemma star_sum_antilinear {n : ℕ} (v : Fin n → ℂ) (g : Fin n → TestFunctionℂ) : star (∑ j, starRingEnd ℂ (v j) • g j) = ∑ j, v j • star (g j) := by diff --git a/LeanPool/OSforGFF/OS/OS4Clustering.lean b/LeanPool/OSforGFF/OS/OS4Clustering.lean index 7cae5bd57e..9953ec595e 100644 --- a/LeanPool/OSforGFF/OS/OS4Clustering.lean +++ b/LeanPool/OSforGFF/OS/OS4Clustering.lean @@ -37,7 +37,7 @@ The proof follows Steps 1–6 of §4.4.5: - `gaussianFreeField_satisfies_OS4` -/ -@[expose] public section +public section open MeasureTheory Complex open scoped Real BigOperators SchwartzMap @@ -218,7 +218,8 @@ lemma GFF_OS4_from_small_decay_real (m : ℝ) [Fact (0 < m)] simp only [euclideanAction, SchwartzMap.compCLM_apply, Function.comp_apply, euclideanPullback, act] simp only [QFT.inv_R, QFT.inv_t, LinearIsometry_inv_one, LinearIsometry.one_apply] - rfl + simp only [T_a_gC, gC, toComplex_apply, SchwartzMap.translate_apply, + sub_eq_add_neg] have h_transl : GJGeneratingFunctionalℂ (gaussianFreeFieldFree m) T_a_gC = GJGeneratingFunctionalℂ (gaussianFreeFieldFree m) gC := by rw [h_transl_eq] @@ -525,7 +526,7 @@ lemma timeShiftConst_norm (s : ℝ) : ‖TimeTranslation.timeShiftConst s‖ = | /-- Time translation of Schwartz function at a point equals function evaluated at shifted point. -/ lemma timeTranslationSchwartzℂ_at_point (s : ℝ) (g : TestFunctionℂ) (y : SpaceTime) : TimeTranslation.timeTranslationSchwartzℂ s g y = g (TimeTranslation.timeShift s y) := by - rfl + exact TimeTranslation.timeTranslationSchwartzℂ_apply s g y /-- Time shift by s equals adding the time shift constant. -/ lemma timeShift_eq_add (s : ℝ) (y : SpaceTime) : diff --git a/LeanPool/OSforGFF/OS/OS4Ergodicity.lean b/LeanPool/OSforGFF/OS/OS4Ergodicity.lean index 13a98be08a..0927c9d5fe 100644 --- a/LeanPool/OSforGFF/OS/OS4Ergodicity.lean +++ b/LeanPool/OSforGFF/OS/OS4Ergodicity.lean @@ -36,7 +36,7 @@ Uses α = 6 from the spatial dimension d = 3 (mass gap). - `OS4_PolynomialClustering_implies_OS4_Ergodicity` -/ -@[expose] public section +public section open MeasureTheory Real open TopologicalSpace @@ -76,7 +76,7 @@ def os4PrimeErgodicityGenerating (m : ℝ) [Fact (0 < m)] : Prop := /-- OS4'' (Polynomial Clustering): This is exactly os4PolynomialClustering specialized to the GFF with decay exponent α = 6. -/ -def os4DoublePrimeClustering (m : ℝ) [Fact (0 < m)] : Prop := +@[expose] def os4DoublePrimeClustering (m : ℝ) [Fact (0 < m)] : Prop := os4PolynomialClustering (gaussianFreeFieldFree m) 6 (by norm_num) /-! ## GFF Integrability Lemmas -/ @@ -257,6 +257,8 @@ lemma gff_exp_L2_norm_constant (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) (s f)‖^2 ∂μ = ∫ ω, ‖Complex.exp (distributionPairingℂReal ω (timeTranslationSchwartzℂ (-s) f))‖^2 ∂μ := by congr 1 + funext ω + rw [timeTranslationDistribution_pairingℂ] rw [h_lhs_eq] -- Convert: ∫ ‖exp(⟨ω, g⟩)‖² = (∫ exp * conj(exp)).re have h_int_re_eq : ∀ g : TestFunctionℂ, @@ -496,8 +498,11 @@ lemma gff_covariance_timeTranslation_continuous (m : ℝ) [Fact (0 < m)] · intro s; exact Filter.Eventually.of_forall (h_bdd' s) · exact h_bound_int · filter_upwards with ⟨x, y⟩ - exact ((f.continuous.comp (TimeTranslation.continuous_timeShift_param x)).mul - continuous_const).mul continuous_const + have h_cont : Continuous (fun s : ℝ => + f (timeShift s x) * (freeCovariance m x y : ℂ) * g y) := + ((f.continuous.comp (TimeTranslation.continuous_timeShift_param x)).mul + continuous_const).mul continuous_const + simpa only [timeTranslationSchwartzℂ_apply] using h_cont /-- The GFF covariance function (s, u) ↦ E[A_s · conj(A_u)] - E[A]·conj(E[A]) is continuous. diff --git a/LeanPool/OSforGFF/OS/OS4MGF.lean b/LeanPool/OSforGFF/OS/OS4MGF.lean index f8eea75959..f03e233502 100644 --- a/LeanPool/OSforGFF/OS/OS4MGF.lean +++ b/LeanPool/OSforGFF/OS/OS4MGF.lean @@ -24,7 +24,7 @@ Shared lemmas for os4Clustering and OS4Ergodicity: - Exponential bound: |e^z − 1| ≤ |z| · e^{|z|} -/ -@[expose] public section +public section open MeasureTheory Real open TopologicalSpace diff --git a/LeanPool/OSforGFF/Schwinger.lean b/LeanPool/OSforGFF/Schwinger.lean index 0a2ad4a2d3..5ad68a2152 100644 --- a/LeanPool/OSforGFF/Schwinger.lean +++ b/LeanPool/OSforGFF/Schwinger.lean @@ -17,4 +17,4 @@ import Mathlib.Data.Nat.Choose.Multinomial Import aggregator for the `Schwinger` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Schwinger/Defs.lean b/LeanPool/OSforGFF/Schwinger/Defs.lean index 81972ce6e6..7a3f7b6672 100644 --- a/LeanPool/OSforGFF/Schwinger/Defs.lean +++ b/LeanPool/OSforGFF/Schwinger/Defs.lean @@ -20,7 +20,7 @@ For centered Gaussian measures: Z[J] = exp(−½⟨J,CJ⟩) and all Sₙ are determined by Wick's theorem from the two-point function S₂ = C. -/ -@[expose] public section +public section open MeasureTheory Complex open TopologicalSpace @@ -49,7 +49,7 @@ S_n(f₁,...,fₙ) = (-i)ⁿ (coefficient of (iJ)ⁿ/n! in Z[J]) This is the fundamental object in constructive QFT - all physics is contained in the infinite sequence of Schwinger functions {S_n}_{n=1}^∞. -/ -def SchwingerFunction (dμ_config : ProbabilityMeasure FieldConfiguration) (n : ℕ) +@[expose] def SchwingerFunction (dμ_config : ProbabilityMeasure FieldConfiguration) (n : ℕ) (f : Fin n → OSforGFF.TestFunction) : ℝ := ∫ ω, (∏ i, distributionPairing ω (f i)) ∂dμ_config.toMeasure @@ -59,7 +59,7 @@ def SchwingerFunction₁ (dμ_config : ProbabilityMeasure FieldConfiguration) SchwingerFunction dμ_config 1 ![f] /-- The 2-point Schwinger function: the covariance -/ -def SchwingerFunction₂ (dμ_config : ProbabilityMeasure FieldConfiguration) +@[expose] def SchwingerFunction₂ (dμ_config : ProbabilityMeasure FieldConfiguration) (f g : OSforGFF.TestFunction) : ℝ := SchwingerFunction dμ_config 2 ![f, g] @@ -89,21 +89,21 @@ lemma schwinger_vanishes_centered (dμ_config : ProbabilityMeasure FieldConfigur exact h_centered f /-- Complex version of Schwinger functions for complex test functions -/ -def SchwingerFunctionℂ (dμ_config : ProbabilityMeasure FieldConfiguration) (n : ℕ) +@[expose] def SchwingerFunctionℂ (dμ_config : ProbabilityMeasure FieldConfiguration) (n : ℕ) (f : Fin n → TestFunctionℂ) : ℂ := ∫ ω, (∏ i, distributionPairingℂReal ω (f i)) ∂dμ_config.toMeasure /-- The complex 2-point Schwinger function for complex test functions. This is the natural extension of SchwingerFunction₂ to complex test functions. -/ -def SchwingerFunctionℂ₂ (dμ_config : ProbabilityMeasure FieldConfiguration) +@[expose] def SchwingerFunctionℂ₂ (dμ_config : ProbabilityMeasure FieldConfiguration) (φ ψ : TestFunctionℂ) : ℂ := SchwingerFunctionℂ dμ_config 2 ![φ, ψ] /-- Property that SchwingerFunctionℂ₂ is ℂ-bilinear in both arguments. This is a key property for Gaussian measures and essential for OS0 analyticity. -/ -def CovarianceBilinear (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := +@[expose] def CovarianceBilinear (dμ_config : ProbabilityMeasure FieldConfiguration) : Prop := ∀ (c : ℂ) (φ₁ φ₂ ψ : TestFunctionℂ), SchwingerFunctionℂ₂ dμ_config (c • φ₁) ψ = c * SchwingerFunctionℂ₂ dμ_config φ₁ ψ ∧ SchwingerFunctionℂ₂ dμ_config (φ₁ + φ₂) ψ = SchwingerFunctionℂ₂ dμ_config φ₁ ψ + diff --git a/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean b/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean index 0ea18088a0..dbca943beb 100644 --- a/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean +++ b/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean @@ -32,7 +32,7 @@ This generalizes `gaussian_pairing_product_integrable_free_core` to arbitrary n, providing a unified foundation for all Schwinger function computations. -/ -@[expose] public section +public section open MeasureTheory Complex Finset open TopologicalSpace SchwartzMap @@ -66,6 +66,7 @@ lemma gaussian_complex_pairing_abs_sq_integrable MemLp (distributionPairingCLM φIm) (2 : ENNReal) (gaussianFreeFieldFree m).toMeasure := gaussianFreeField_pairing_memLp (m := m) (φ := φIm) (p := (2 : ENNReal)) (hp := by simp) + simp only [distributionPairingCLM_eq_fun] at hRe_mem hIm_mem -- Convert the MemLp statements to integrability of the square magnitudes have hRe_sq : Integrable (fun ω => (distributionPairing ω φRe) ^ 2) (gaussianFreeFieldFree m).toMeasure := by @@ -127,6 +128,7 @@ theorem gaussian_pairing_product_integrable_free_2point have hψIm_mem : MemLp (distributionPairingCLM ψIm) (2 : ENNReal) (gaussianFreeFieldFree m).toMeasure := gaussianFreeField_pairing_memLp m ψIm (2 : ENNReal) (by simp) + simp only [distributionPairingCLM_eq_fun] at hφRe_mem hφIm_mem hψRe_mem hψIm_mem -- Convert to integrability of individual real pairings have hφRe_int : Integrable (fun ω => distributionPairing ω φRe) (gaussianFreeFieldFree m).toMeasure := by diff --git a/LeanPool/OSforGFF/Schwinger/TwoPoint.lean b/LeanPool/OSforGFF/Schwinger/TwoPoint.lean index 6132419abb..c5b21db2c4 100644 --- a/LeanPool/OSforGFF/Schwinger/TwoPoint.lean +++ b/LeanPool/OSforGFF/Schwinger/TwoPoint.lean @@ -23,7 +23,7 @@ For mollifiers φ_ε (smooth, nonnegative, integral 1, support shrinking to 0): For the GFF with covariance kernel C, this equals C(x) by `double_mollifier_convergence`. -/ -@[expose] public section +public section open MeasureTheory open scoped MeasureTheory @@ -48,7 +48,7 @@ noncomputable def bumpToSchwartz (φ : ContDiffBump (0 : SpaceTime)) : OSforGFF. /-- bumpToSchwartz produces the L¹-normalized bump function. -/ @[simp] theorem bumpToSchwartz_apply (φ : ContDiffBump (0 : SpaceTime)) (x : SpaceTime) : - bumpToSchwartz φ x = φ.normed volume x := rfl + bumpToSchwartz φ x = φ.normed volume x := by rfl /-- Translate a Schwartz function by a vector. This is an alias for `SchwartzMap.translate` specialized to SpaceTime. diff --git a/LeanPool/OSforGFF/Spacetime.lean b/LeanPool/OSforGFF/Spacetime.lean index cd1040e1f1..4aa50f5103 100644 --- a/LeanPool/OSforGFF/Spacetime.lean +++ b/LeanPool/OSforGFF/Spacetime.lean @@ -24,4 +24,4 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Import aggregator for the `Spacetime` directory. -/ -@[expose] public section +public section diff --git a/LeanPool/OSforGFF/Spacetime/Basic.lean b/LeanPool/OSforGFF/Spacetime/Basic.lean index df25618cd1..2b5ef78ee4 100644 --- a/LeanPool/OSforGFF/Spacetime/Basic.lean +++ b/LeanPool/OSforGFF/Spacetime/Basic.lean @@ -30,7 +30,7 @@ Core type definitions for the formalization: - `GJGeneratingFunctional` = Z[J] = ∫ exp(i⟨ω, J⟩) dμ(ω) -/ -@[expose] public section +public section /-- Spacetime dimension. Currently set to 4 (Euclidean ℝ⁴). Changing this value requires corresponding changes throughout the project; @@ -111,7 +111,7 @@ abbrev FieldConfiguration := WeakDual ℝ (SchwartzMap SpaceTime ℝ) Note: FieldConfiguration = WeakDual ℝ (SchwartzMap SpaceTime ℝ) has the correct weak-* topology, making evaluation maps x ↦ ω(x) continuous for each test function x. -/ -def distributionPairing (ω : FieldConfiguration) (f : OSforGFF.TestFunction) : ℝ := ω f +@[expose] def distributionPairing (ω : FieldConfiguration) (f : OSforGFF.TestFunction) : ℝ := ω f @[simp] lemma distributionPairing_add (ω₁ ω₂ : FieldConfiguration) (a : OSforGFF.TestFunction) : distributionPairing (ω₁ + ω₂) a = distributionPairing ω₁ a + distributionPairing ω₂ a := rfl @@ -141,7 +141,12 @@ lemma pairing_smul_real (ω : FieldConfiguration) (s : ℝ) (a : OSforGFF.TestFu exact WeakDual.eval_continuous a lemma distributionPairingCLM_apply (a : OSforGFF.TestFunction) (ω : FieldConfiguration) : - distributionPairingCLM a ω = distributionPairing ω a := rfl + distributionPairingCLM a ω = distributionPairing ω a := by rfl + +lemma distributionPairingCLM_eq_fun (a : OSforGFF.TestFunction) : + (distributionPairingCLM a : FieldConfiguration → ℝ) = fun ω => distributionPairing ω a := by + funext ω + exact distributionPairingCLM_apply a ω variable [SigmaFinite μ] @@ -155,7 +160,7 @@ where the integral is over field configurations ω (distributions). /-- The Glimm-Jaffe generating functional: Z[J] = ∫ exp(i⟨ω, J⟩) dμ(ω) This is the fundamental object in constructive QFT. -/ -def GJGeneratingFunctional (dμ_config : ProbabilityMeasure FieldConfiguration) +@[expose] def GJGeneratingFunctional (dμ_config : ProbabilityMeasure FieldConfiguration) (J : OSforGFF.TestFunction) : ℂ := ∫ ω, Complex.exp (Complex.I * (distributionPairing ω J : ℂ)) ∂dμ_config.toMeasure @@ -193,12 +198,12 @@ omit [SigmaFinite μ] /-- Evaluate `schwartzCompCLM` pointwise. -/ @[simp] lemma schwartz_comp_clm_apply (f : TestFunctionℂ) (L : ℂ →L[ℝ] ℝ) (x : SpaceTime) : - (schwartzCompCLM f L) x = L (f x) := rfl + (schwartzCompCLM f L) x = L (f x) := by rfl /-- Decompose a complex test function into its real and imaginary parts as real test functions. This is more efficient than separate extraction functions. -/ -def complexTestFunctionDecompose (f : TestFunctionℂ) : +@[expose] def complexTestFunctionDecompose (f : TestFunctionℂ) : OSforGFF.TestFunction × OSforGFF.TestFunction := (schwartzCompCLM f Complex.reCLM, schwartzCompCLM f Complex.imCLM) @@ -238,19 +243,19 @@ lemma complex_testfunction_decompose_recompose We extend the pairing by treating the complex test function as f(x) = f_re(x) + i*f_im(x) and defining ⟨ω, f⟩ = ⟨ω, f_re⟩ + i*⟨ω, f_im⟩ -/ -def distributionPairingℂReal (ω : FieldConfiguration) (f : TestFunctionℂ) : ℂ := +@[expose] def distributionPairingℂReal (ω : FieldConfiguration) (f : TestFunctionℂ) : ℂ := -- Extract real and imaginary parts using our efficient decomposition let ⟨f_re, f_im⟩ := complexTestFunctionDecompose f -- Pair with the real field configuration and combine (ω f_re : ℂ) + Complex.I * (ω f_im : ℂ) /-- Complex version of the generating functional -/ -def GJGeneratingFunctionalℂ (dμ_config : ProbabilityMeasure FieldConfiguration) +@[expose] def GJGeneratingFunctionalℂ (dμ_config : ProbabilityMeasure FieldConfiguration) (J : TestFunctionℂ) : ℂ := ∫ ω, Complex.exp (Complex.I * (distributionPairingℂReal ω J)) ∂dμ_config.toMeasure /-- The mean field in the Glimm-Jaffe framework -/ -def GJMean (dμ_config : ProbabilityMeasure FieldConfiguration) +@[expose] def GJMean (dμ_config : ProbabilityMeasure FieldConfiguration) (φ : OSforGFF.TestFunction) : ℝ := ∫ ω, distributionPairing ω φ ∂dμ_config.toMeasure @@ -263,7 +268,7 @@ abbrev SpatialCoords := EuclideanSpace ℝ (Fin (STDimension - 1)) abbrev SpatialL2 := Lp ℝ 2 (volume : Measure SpatialCoords) /-- Extract spatial part of spacetime coordinate -/ -def spatialPart (x : SpaceTime) : SpatialCoords := +@[expose] def spatialPart (x : SpaceTime) : SpatialCoords := (EuclideanSpace.equiv (Fin (STDimension - 1)) ℝ).symm (fun i => x ⟨i.val + 1, by simp [STDimension]; omega⟩) diff --git a/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean b/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean index a44f2a8ed3..6a4fd663d6 100644 --- a/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean +++ b/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean @@ -35,7 +35,7 @@ These results are essential for proving bilinearity of Schwinger functions and other quantum field theory constructions. -/ -@[expose] public section +public section open Complex MeasureTheory @@ -81,13 +81,9 @@ lemma ω_re_decompose_linear - s.im • (complexTestFunctionDecompose g).2 := by ext x -- Rewrite to Complex.re/Complex.im and use algebra on ℂ - change Complex.reCLM ((t • f + s • g) x) - = t.re * Complex.reCLM (f x) - t.im * Complex.imCLM (f x) - + s.re * Complex.reCLM (g x) - s.im * Complex.imCLM (g x) - -- Evaluate pointwise scalar multiplication and addition - simp only [add_apply, smul_apply, smul_eq_mul, reCLM_apply, - add_re, mul_re, imCLM_apply] - ring + simp only [complexTestFunctionDecompose, add_apply, sub_apply, smul_apply, + smul_eq_mul, schwartz_comp_clm_apply, reCLM_apply, imCLM_apply, + add_re, mul_re]; ring -- Apply ω (a real-linear functional) to both sides simp_all @@ -110,13 +106,9 @@ lemma ω_im_decompose_linear + s.im • (complexTestFunctionDecompose g).1 := by ext x -- Rewrite to Complex.im/Complex.re and use algebra on ℂ - change Complex.imCLM ((t • f + s • g) x) - = t.re * Complex.imCLM (f x) + t.im * Complex.reCLM (f x) - + s.re * Complex.imCLM (g x) + s.im * Complex.reCLM (g x) - -- Evaluate pointwise scalar multiplication and addition - simp only [add_apply, smul_apply, smul_eq_mul, imCLM_apply, - add_im, mul_im, reCLM_apply] - ring + simp only [complexTestFunctionDecompose, add_apply, smul_apply, + smul_eq_mul, schwartz_comp_clm_apply, reCLM_apply, imCLM_apply, + add_im, mul_im]; ring -- Apply ω (a real-linear functional) to both sides simp_all @@ -335,7 +327,7 @@ noncomputable def conjSchwartz {E : Type*} [NormedAddCommGroup E] [NormedSpace @[simp] lemma conjSchwartz_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : SchwartzMap E ℂ) (x : E) : - conjSchwartz f x = starRingEnd ℂ (f x) := rfl + conjSchwartz f x = starRingEnd ℂ (f x) := by rfl /-- Conjugation is involutive: conj(conj(f)) = f -/ @[simp] lemma conjSchwartz_conjSchwartz {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] diff --git a/LeanPool/OSforGFF/Spacetime/Decomposition.lean b/LeanPool/OSforGFF/Spacetime/Decomposition.lean index 27af09de58..6f37c39341 100644 --- a/LeanPool/OSforGFF/Spacetime/Decomposition.lean +++ b/LeanPool/OSforGFF/Spacetime/Decomposition.lean @@ -27,7 +27,7 @@ time and spatial components: SpaceTime ≃ᵐ ℝ × SpatialCoords. * `spacetime_norm_sq_decompose` - Norm decomposition: ‖k‖² = k₀² + ‖k_sp‖² -/ -@[expose] public section +public section open MeasureTheory MeasureSpace FiniteDimensional Real @@ -50,7 +50,7 @@ def piLpMeasurableEquiv (n : ℕ) : PiLp 2 (fun _ : Fin n => ℝ) ≃ᵐ (Fin n 2. piFinSuccAbove 0 : (Fin 4 → ℝ) → ℝ × (Fin 3 → ℝ) 3. id × piLpMeasurableEquiv.symm : ℝ × (Fin 3 → ℝ) → ℝ × SpatialCoords -/ -def spacetimeDecomp : SpaceTime ≃ᵐ ℝ × SpatialCoords := +@[expose] def spacetimeDecomp : SpaceTime ≃ᵐ ℝ × SpatialCoords := (piLpMeasurableEquiv STDimension).trans ((MeasurableEquiv.piFinSuccAbove (fun _ => ℝ) 0).trans (MeasurableEquiv.prodCongr (MeasurableEquiv.refl ℝ) @@ -88,7 +88,7 @@ theorem spacetimeDecomp_measurePreserving : /-- Spacetime decomposition maps k to (k 0, spatialPart k). -/ theorem spacetimeDecomp_apply (k : SpaceTime) : - spacetimeDecomp k = (k 0, spatialPart k) := rfl + spacetimeDecomp k = (k 0, spatialPart k) := by rfl /-- `spacetimeDecomp.symm` equals `spacetimeOfTimeSpace` (from SchwartzProdIntegrable.lean). Both construct a SpaceTime point from time t and spatial coordinates v. diff --git a/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean b/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean index f7b8da37e7..46c2a8d055 100644 --- a/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean +++ b/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean @@ -27,7 +27,7 @@ Induced actions on test functions: (Θf)(x) = f(Θx) = f(−t, xbar). Foundation for the OS3 reflection positivity axiom. -/ -@[expose] public section +public section open MeasureTheory @@ -54,7 +54,7 @@ def timeReflectionIsometry : Matrix.orthogonalGroup (Fin STDimension) ℝ := ⟨timeReflectionMatrix, timeReflectionMatrix_is_orthogonal⟩ /-- The `timeReflectionLinear` declaration. -/ -def timeReflectionLinear : SpaceTime →ₗ[ℝ] SpaceTime := +@[expose] def timeReflectionLinear : SpaceTime →ₗ[ℝ] SpaceTime := { toFun := timeReflection map_add' x y := by refine PiLp.ext fun i => ?_ @@ -70,7 +70,7 @@ def timeReflectionLinear : SpaceTime →ₗ[ℝ] SpaceTime := · simp [Function.update_of_ne h] } /-- The `timeReflectionCLM` declaration. -/ -noncomputable def timeReflectionCLM : SpaceTime →L[ℝ] SpaceTime := +@[expose] noncomputable def timeReflectionCLM : SpaceTime →L[ℝ] SpaceTime := timeReflectionLinear.toContinuousLinearMap (E := SpaceTime) (F' := SpaceTime) open InnerProductSpace @@ -92,7 +92,7 @@ lemma timeReflection_inner_map (x y : SpaceTime) : simp_all /-- The `timeReflectionLE` declaration. -/ -def timeReflectionLE : SpaceTime ≃ₗᵢ[ℝ] SpaceTime := +@[expose] def timeReflectionLE : SpaceTime ≃ₗᵢ[ℝ] SpaceTime := { toFun := timeReflection invFun := timeReflection -- Time reflection is self-inverse left_inv := timeReflection_involutive @@ -129,7 +129,7 @@ private lemma timeReflection_hg_upper : simp_all /-- The `compTimeReflection` declaration. -/ -noncomputable def compTimeReflection : TestFunctionℂ →L[ℝ] TestFunctionℂ := +@[expose] noncomputable def compTimeReflection : TestFunctionℂ →L[ℝ] TestFunctionℂ := SchwartzMap.compCLM (𝕜 := ℝ) (hg := timeReflectionCLM.hasTemperateGrowth) (hg_upper := by exact timeReflection_hg_upper) @@ -139,7 +139,8 @@ noncomputable def compTimeReflection : TestFunctionℂ →L[ℝ] TestFunctionℂ subspaces defined over ℝ, so that reflection positivity can be formulated without passing through complex scalars. -/ -noncomputable def compTimeReflectionReal : OSforGFF.TestFunction →L[ℝ] OSforGFF.TestFunction := +@[expose] noncomputable def compTimeReflectionReal : + OSforGFF.TestFunction →L[ℝ] OSforGFF.TestFunction := SchwartzMap.compCLM (𝕜 := ℝ) (hg := timeReflectionCLM.hasTemperateGrowth) (hg_upper := by exact timeReflection_hg_upper) diff --git a/LeanPool/OSforGFF/Spacetime/Euclidean.lean b/LeanPool/OSforGFF/Spacetime/Euclidean.lean index 86aeaadea0..a4e763de21 100644 --- a/LeanPool/OSforGFF/Spacetime/Euclidean.lean +++ b/LeanPool/OSforGFF/Spacetime/Euclidean.lean @@ -20,7 +20,7 @@ pullbacks (needed for Schwartz space), and continuity of all actions. Foundation for the OS2 axiom. -/ -@[expose] public section +public section open MeasureTheory NNReal ENNReal open TopologicalSpace Measure @@ -51,7 +51,7 @@ structure E where /-- Action of g : E on a spacetime point x. Impliments the pullback map x to Rx+ t -/ -def act (g : E) (x : SpaceTime) : SpaceTime := g.R x + g.t +@[expose] def act (g : E) (x : SpaceTime) : SpaceTime := g.R x + g.t /-act_one, act_mul and act_inv lemmas prove identity, composition and inverse. They are needed to say Euclidean sym @@ -75,7 +75,7 @@ namespace LinearIsometry /-- Inverse of a linear isometry : we turn the canonical equivalence (available in finite dimension) back into a `LinearIsometry`. -/ -noncomputable def inv (g : O4) : O4 := +@[expose] noncomputable def inv (g : O4) : O4 := ((g.toLinearIsometryEquiv rfl).symm).toLinearIsometry @[simp] lemma comp_apply (g h : O4) (x : SpaceTime) : @@ -264,7 +264,7 @@ private theorem act_inv_poly_bound (g : E) : This is the geometric transformation x ↦ g⁻¹ • x that underlies all Euclidean actions on function spaces. -/ -noncomputable def euclideanPullback (g : E) : SpaceTime → SpaceTime := act g⁻¹ +@[expose] noncomputable def euclideanPullback (g : E) : SpaceTime → SpaceTime := act g⁻¹ /-- The Euclidean pullback map has temperate growth (needed for Schwartz space actions). -/ lemma euclidean_pullback_temperate_growth (g : E) : @@ -294,7 +294,7 @@ lemma euclidean_pullback_polynomial_bounds (g : E) : This is the standard pullback action: to evaluate the transformed function at x, we evaluate the original function at the inverse-transformed point. -/ -noncomputable def euclideanAction (g : E) (f : TestFunctionℂ) : TestFunctionℂ := +@[expose] noncomputable def euclideanAction (g : E) (f : TestFunctionℂ) : TestFunctionℂ := SchwartzMap.compCLM (𝕜 := ℂ) (hg := euclidean_pullback_temperate_growth g) (hg_upper := euclidean_pullback_polynomial_bounds g) f diff --git a/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean b/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean index a2ef2339e2..5aed0a3b42 100644 --- a/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean +++ b/LeanPool/OSforGFF/Spacetime/PositiveTimeTestFunction.lean @@ -31,7 +31,7 @@ the star operation (complex conjugation composed with time reflection) for test * `Star TestFunctionℂ`: Star instance for complex test functions -/ -@[expose] public section +public section noncomputable section @@ -132,6 +132,9 @@ noncomputable def starTestFunction (f : TestFunctionℂ) : TestFunctionℂ := rw [starRingEnd_iteratedFDeriv_norm_eq f_reflected n x] exact hC x⟩ +lemma starTestFunction_apply (f : TestFunctionℂ) (x : SpaceTime) : + (starTestFunction f) x = starRingEnd ℂ ((compTimeReflection f) x) := by rfl + /-- Star instance for complex test functions -/ noncomputable instance : Star TestFunctionℂ where star f := starTestFunction f diff --git a/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean b/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean index 14a7305ca4..140e569999 100644 --- a/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean +++ b/LeanPool/OSforGFF/Spacetime/ProdIntegrable.lean @@ -17,7 +17,7 @@ For SpaceTime = EuclideanSpace ℝ (Fin 4), the time coordinate is accessed via This specialized version matches the signature needed in OS3_MixedRepInfra.lean. -/ -@[expose] public section +public section open MeasureTheory SchwartzMap Real Set Metric open scoped ENNReal @@ -121,7 +121,7 @@ On the bounded time domain {0 < t₁, 0 < t₂, t₁+t₂ < 1}, this gives integ abbrev SpatialCoords3 : Type := EuclideanSpace ℝ (Fin 3) /-- Decomposition of SpaceTime as time × space. -/ -noncomputable def spacetimeOfTimeSpace (t : ℝ) (x : SpatialCoords3) : SpaceTime := +@[expose] noncomputable def spacetimeOfTimeSpace (t : ℝ) (x : SpatialCoords3) : SpaceTime := EuclideanSpace.equiv (Fin 4) ℝ |>.symm (Fin.cons t (fun i => x i)) /-- The time coordinate of spacetimeOfTimeSpace is t. -/ @@ -270,7 +270,7 @@ lemma schwartz_time_slice_integrable (f : TestFunctionℂ) (t : ℝ) : exact h_bound x /-- The spatial integral G(t) = ∫_{ℝ³} ‖f(t, x)‖ dx. -/ -noncomputable def spatialNormIntegral (f : TestFunctionℂ) (t : ℝ) : ℝ := +@[expose] noncomputable def spatialNormIntegral (f : TestFunctionℂ) (t : ℝ) : ℝ := ∫ x : SpatialCoords3, ‖f (spacetimeOfTimeSpace t x)‖ /-- G(t) = 0 for t ≤ 0 when f vanishes on {t ≤ 0}. -/ diff --git a/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean b/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean index bd6ff3c6d0..cd6afb2290 100644 --- a/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean +++ b/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean @@ -43,7 +43,7 @@ that time translation acts continuously on Schwartz space (a standard textbook f from Reed-Simon V.3 and Hörmander Ch. 7). -/ -@[expose] public section +public section open MeasureTheory Real open TopologicalSpace @@ -140,7 +140,7 @@ lemma timeShift_antilipschitz (s : ℝ) : AntilipschitzWith 1 (timeShift s) := (timeShift_isometry s).antilipschitzWith /-- The constant vector used to express timeShift as id + const. -/ -def timeShiftConst (s : ℝ) : SpaceTime := +@[expose] def timeShiftConst (s : ℝ) : SpaceTime := WithLp.toLp 2 (fun i => if i.val = 0 then s else 0) /-- timeShift s equals addition of a constant. -/ @@ -218,7 +218,7 @@ def timeTranslationSchwartzℂCLM (s : ℝ) : TestFunctionℂ →L[ℂ] TestFunc SchwartzMap.compCLMOfAntilipschitz ℂ (timeShift_hasTemperateGrowth s) (timeShift_antilipschitz s) /-- Time translation on complex-valued Schwartz functions. -/ -def timeTranslationSchwartzℂ (s : ℝ) (f : TestFunctionℂ) : TestFunctionℂ := +@[expose] def timeTranslationSchwartzℂ (s : ℝ) (f : TestFunctionℂ) : TestFunctionℂ := timeTranslationSchwartzℂCLM s f /-- Time translation evaluated at a point. -/ @@ -807,14 +807,14 @@ for all f ∈ S(ℝ × ℝ³). Continuity is automatic since composition of continuous linear maps is continuous. -/ -def timeTranslationDistribution (s : ℝ) (ω : FieldConfiguration) : FieldConfiguration := +@[expose] def timeTranslationDistribution (s : ℝ) (ω : FieldConfiguration) : FieldConfiguration := ω.comp (timeTranslationSchwartzCLM (-s)) /-- The defining property of time translation on distributions. -/ @[simp] lemma timeTranslationDistribution_apply (s : ℝ) (ω : FieldConfiguration) (f : OSforGFF.TestFunction) : - (timeTranslationDistribution s ω) f = ω (timeTranslationSchwartz (-s) f) := rfl + (timeTranslationDistribution s ω) f = ω (timeTranslationSchwartz (-s) f) := by rfl /-- Time translation on distributions is a group homomorphism: T_{s+t} = T_s ∘ T_t -/ lemma timeTranslationDistribution_add (s t : ℝ) (ω : FieldConfiguration) : diff --git a/LeanPool/OSforGFF/Spacetime/Tonelli.lean b/LeanPool/OSforGFF/Spacetime/Tonelli.lean index 27d5767d78..790fa97d95 100644 --- a/LeanPool/OSforGFF/Spacetime/Tonelli.lean +++ b/LeanPool/OSforGFF/Spacetime/Tonelli.lean @@ -27,7 +27,7 @@ depends only on the time coordinates. * Folland, "Real Analysis", Chapter 2 (Fubini-Tonelli theorem) -/ -@[expose] public section +public section open MeasureTheory MeasureSpace FiniteDimensional Real @@ -38,10 +38,12 @@ open MeasureTheory MeasureSpace FiniteDimensional Real -/ lemma spacetimeDecomp_symm_norm_ge (t : ℝ) (v : SpatialCoords) : ‖spacetimeDecomp.symm (t, v)‖ ≥ ‖v‖ := by - have h_spatial : spatialPart (spacetimeDecomp.symm (t, v)) = v := - congr_arg Prod.snd (spacetimeDecomp.apply_symm_apply (t, v)) - have h_time : (spacetimeDecomp.symm (t, v)) 0 = t := - congr_arg Prod.fst (spacetimeDecomp.apply_symm_apply (t, v)) + have h_spatial : spatialPart (spacetimeDecomp.symm (t, v)) = v := by + simpa only [spacetimeDecomp_apply] using + congr_arg Prod.snd (spacetimeDecomp.apply_symm_apply (t, v)) + have h_time : (spacetimeDecomp.symm (t, v)) 0 = t := by + simpa only [spacetimeDecomp_apply] using + congr_arg Prod.fst (spacetimeDecomp.apply_symm_apply (t, v)) have h_decomp := spacetime_norm_sq_decompose (spacetimeDecomp.symm (t, v)) rw [h_time, h_spatial] at h_decomp have h_sq_ge : ‖spacetimeDecomp.symm (t, v)‖^2 ≥ ‖v‖^2 := by @@ -139,7 +141,8 @@ theorem schwartz_tonelli_spacetime have : G = (G ∘ spacetimeDecomp.symm) ∘ spacetimeDecomp := by ext x; simp [Function.comp, MeasurableEquiv.symm_apply_apply] rw [this] - exact h_comp (G ∘ spacetimeDecomp.symm) + simpa only [Function.comp, MeasurableEquiv.apply_symm_apply] using + h_comp (G ∘ spacetimeDecomp.symm) rw [h_comp_symm] conv_lhs => arg 2; ext p₁; rw [h_comp_symm] simp only [MeasurableEquiv.apply_symm_apply] diff --git a/LeanPool/OddPrimeValuationDistribution.lean b/LeanPool/OddPrimeValuationDistribution.lean index cd283a687a..63ca96e2b0 100644 --- a/LeanPool/OddPrimeValuationDistribution.lean +++ b/LeanPool/OddPrimeValuationDistribution.lean @@ -21,4 +21,4 @@ Tags: central-binomial-coefficients, p-adic-valuations, digit-carries, generatin MSC: 11A63, 11B65 -/ -@[expose] public section +public section diff --git a/LeanPool/OddPrimeValuationDistribution/CarryArithmetic.lean b/LeanPool/OddPrimeValuationDistribution/CarryArithmetic.lean index 8304baf899..e912e43044 100644 --- a/LeanPool/OddPrimeValuationDistribution/CarryArithmetic.lean +++ b/LeanPool/OddPrimeValuationDistribution/CarryArithmetic.lean @@ -22,14 +22,14 @@ the base is prime, the carry count is exactly the prime-adic valuation of the central binomial coefficient. -/ -@[expose] public section +public section namespace OddPrimeValuationDistribution open Nat /-- The odd base represented by its lower half-size. -/ -def oddBase (half : ℕ) : ℕ := 2 * half + 1 +@[expose] def oddBase (half : ℕ) : ℕ := 2 * half + 1 /-- Outgoing carry while doubling one digit in the odd base `2 * half + 1`. -/ @@ -38,7 +38,7 @@ def oddDoubleCarryStep (half carry digit : ℕ) : ℕ := /-- Number of outgoing carries while doubling a little-endian word in an odd base. -/ -def oddDoubleCarryCountAux (half : ℕ) : List ℕ → ℕ → ℕ +@[expose] def oddDoubleCarryCountAux (half : ℕ) : List ℕ → ℕ → ℕ | [], _carry => 0 | digit :: digits, carry => let nextCarry := oddDoubleCarryStep half carry digit diff --git a/LeanPool/OddPrimeValuationDistribution/CarryPolynomial.lean b/LeanPool/OddPrimeValuationDistribution/CarryPolynomial.lean index 654b742628..27cf1f328b 100644 --- a/LeanPool/OddPrimeValuationDistribution/CarryPolynomial.lean +++ b/LeanPool/OddPrimeValuationDistribution/CarryPolynomial.lean @@ -19,7 +19,7 @@ the carry threshold gives a two-state transfer matrix and its scalar second-order recurrence. -/ -@[expose] public section +public section namespace OddPrimeValuationDistribution @@ -27,18 +27,18 @@ open Polynomial open scoped BigOperators /-- Convert an odd-base word to natural digits. -/ -def oddCarryWordDigits {half length : ℕ} +@[expose] def oddCarryWordDigits {half length : ℕ} (word : List.Vector (Fin (oddBase half)) length) : List ℕ := word.toList.map Fin.val /-- Odd-base carry-count enumerator from an arbitrary incoming carry. -/ -noncomputable def oddCarryPolynomialFrom +@[expose] noncomputable def oddCarryPolynomialFrom (half carry length : ℕ) : Polynomial ℕ := ∑ word : List.Vector (Fin (oddBase half)) length, X ^ oddDoubleCarryCountAux half (oddCarryWordDigits word) carry /-- Odd-base carry-count enumerator from incoming carry zero. -/ -noncomputable def oddCarryPolynomial (half length : ℕ) : Polynomial ℕ := +@[expose] noncomputable def oddCarryPolynomial (half length : ℕ) : Polynomial ℕ := oddCarryPolynomialFrom half 0 length /-- Peeling the least significant digit from an odd-base word. -/ diff --git a/LeanPool/OddPrimeValuationDistribution/GeneratingFunction.lean b/LeanPool/OddPrimeValuationDistribution/GeneratingFunction.lean index 8c1e7816fd..06ee16bec0 100644 --- a/LeanPool/OddPrimeValuationDistribution/GeneratingFunction.lean +++ b/LeanPool/OddPrimeValuationDistribution/GeneratingFunction.lean @@ -18,7 +18,7 @@ denominator-cleared, subtraction-free form of `(1 - X * T) / (1 - (half + 1) * (1 + X) * T + p * X * T ^ 2)`. -/ -@[expose] public section +public section namespace OddPrimeValuationDistribution diff --git a/LeanPool/OddPrimeValuationDistribution/Kummer.lean b/LeanPool/OddPrimeValuationDistribution/Kummer.lean index 8a8ba60d49..8f131cd56e 100644 --- a/LeanPool/OddPrimeValuationDistribution/Kummer.lean +++ b/LeanPool/OddPrimeValuationDistribution/Kummer.lean @@ -19,7 +19,7 @@ This module specializes Kummer's theorem to `Nat.centralBinom`, providing the arithmetic bridge used by the odd-prime carry enumerator. -/ -@[expose] public section +public section namespace OddPrimeValuationDistribution diff --git a/LeanPool/OddPrimeValuationDistribution/LowValuations.lean b/LeanPool/OddPrimeValuationDistribution/LowValuations.lean index 2cdd1b831e..737a33f0fe 100644 --- a/LeanPool/OddPrimeValuationDistribution/LowValuations.lean +++ b/LeanPool/OddPrimeValuationDistribution/LowValuations.lean @@ -17,7 +17,7 @@ one. These are arithmetic counts on the complete block below `p ^ k`, not asymptotic estimates. -/ -@[expose] public section +public section namespace OddPrimeValuationDistribution diff --git a/LeanPool/OddPrimeValuationDistribution/ValuationBlocks.lean b/LeanPool/OddPrimeValuationDistribution/ValuationBlocks.lean index 9b3a829982..d949de3757 100644 --- a/LeanPool/OddPrimeValuationDistribution/ValuationBlocks.lean +++ b/LeanPool/OddPrimeValuationDistribution/ValuationBlocks.lean @@ -17,7 +17,7 @@ the word carry count into the exact value of `ν_p (centralBinom n)`, so the transfer recurrence becomes an arithmetic distribution theorem. -/ -@[expose] public section +public section namespace OddPrimeValuationDistribution diff --git a/LeanPool/Odlyzko.lean b/LeanPool/Odlyzko.lean index 1f7f50f588..a42c121388 100644 --- a/LeanPool/Odlyzko.lean +++ b/LeanPool/Odlyzko.lean @@ -20,7 +20,7 @@ Tags: number-theory, discriminants, number-fields, explicit-formula MSC: 11R29, 11R42 -/ -@[expose] public section +public section /-! # Odlyzko's bound for totally complex number fields diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassRepresentatives.lean b/LeanPool/Odlyzko/CompletedZeta/ClassRepresentatives.lean index fab1995566..6e5e8442bf 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassRepresentatives.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassRepresentatives.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenter.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenter.lean index 9f648282e9..de9e0bb13e 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenter.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenter.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -66,7 +66,7 @@ theorem fractionalShapeCovolumeConstant_pos open Classical in /-- A fractional shape covolume center used in the Odlyzko-bound argument. -/ -noncomputable def fractionalShapeCovolumeCenter +@[expose] noncomputable def fractionalShapeCovolumeCenter (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : ℝ := -Real.log (fractionalShapeCovolumeConstant K I) / (Module.finrank ℚ K : ℝ) @@ -84,7 +84,7 @@ theorem fractionalShapeCovolumeCenter_traceDual open Classical in /-- A centered fractional shape coordinates used in the Odlyzko-bound argument. -/ -noncomputable def centeredFractionalShapeCoordinates +@[expose] noncomputable def centeredFractionalShapeCoordinates (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (y : mixedEmbedding.realSpace K) : mixedEmbedding.realSpace K := diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredContinuation.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredContinuation.lean index 0d8df41c6e..203922f5ad 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredContinuation.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredContinuation.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -287,20 +287,20 @@ variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] open Classical in /-- A centered positive class theta integral used in the Odlyzko-bound argument. -/ -noncomputable def centeredPositiveClassThetaIntegral +@[expose] noncomputable def centeredPositiveClassThetaIntegral (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (s : ℂ) : ℂ := ∫ y in positiveUnitFundamentalParamSet (K := K), centeredNonzeroFractionalShapeThetaMellinKernel K I s y open Classical in /-- A centered class theta pole term used in the Odlyzko-bound argument. -/ -noncomputable def centeredClassThetaPoleTerm (s : ℂ) : ℂ := +@[expose] noncomputable def centeredClassThetaPoleTerm (s : ℂ) : ℂ := -1 / ((Module.finrank ℚ K : ℂ) * (1 - s)) - 1 / ((Module.finrank ℚ K : ℂ) * s) open Classical in /-- A centered radially continued class theta integral used in the Odlyzko-bound argument. -/ -noncomputable def centeredRadiallyContinuedClassThetaIntegral +@[expose] noncomputable def centeredRadiallyContinuedClassThetaIntegral (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (s : ℂ) : ℂ := centeredPositiveClassThetaIntegral K I s + centeredPositiveClassThetaIntegral K @@ -398,7 +398,7 @@ theorem setIntegral_centered_eq_radiallyContinued_mk0 open Classical in /-- A centered continued class theta integral used in the Odlyzko-bound argument. -/ -noncomputable def centeredContinuedClassThetaIntegral +@[expose] noncomputable def centeredContinuedClassThetaIntegral (C : ClassGroup (𝓞 K)) (s : ℂ) : ℂ := (torsionOrder K : ℂ)⁻¹ * (2 : ℂ) ^ nrComplexPlaces K * diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredHolomorphy.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredHolomorphy.lean index ac0fc2e24e..b3f2961a45 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredHolomorphy.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredHolomorphy.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -254,7 +254,7 @@ theorem differentiable_centeredPositiveClassThetaIntegral open Classical in /-- A pole cleared centered class theta integral used in the Odlyzko-bound argument. -/ -noncomputable def poleClearedCenteredClassThetaIntegral +@[expose] noncomputable def poleClearedCenteredClassThetaIntegral (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (s : ℂ) : ℂ := (Module.finrank ℚ K : ℂ) * s * (1 - s) * (centeredPositiveClassThetaIntegral K I s + diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredReflection.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredReflection.lean index f754944a09..1a87d14bf2 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredReflection.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredReflection.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] open Classical in /-- A centered nonzero fractional shape theta mellin kernel used in the Odlyzko-bound argument. -/ -noncomputable def centeredNonzeroFractionalShapeThetaMellinKernel +@[expose] noncomputable def centeredNonzeroFractionalShapeThetaMellinKernel (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (s : ℂ) (y : mixedEmbedding.realSpace K) : ℂ := logarithmicMellinWeight K s y * diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredRepresentative.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredRepresentative.lean index a712b87de1..d13d24928f 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredRepresentative.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaCenteredRepresentative.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaIntegral.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaIntegral.lean index 2b5e7b7098..7497e95858 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaIntegral.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaIntegral.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -28,13 +28,13 @@ variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] open Classical in /-- A shape theta integral constant used in the Odlyzko-bound argument. -/ -noncomputable def shapeThetaIntegralConstant : ℝ := +@[expose] noncomputable def shapeThetaIntegralConstant : ℝ := 2⁻¹ ^ nrComplexPlaces K * Module.finrank ℚ K * NumberField.Units.regulator K open Classical in /-- A class completed theta integral used in the Odlyzko-bound argument. -/ -noncomputable def classCompletedThetaIntegral +@[expose] noncomputable def classCompletedThetaIntegral (C : ClassGroup (𝓞 K)) (s : ℂ) : ℂ := CompletedZeta.discriminantFactor K s * (torsionOrder K : ℂ)⁻¹ * diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaPoisson.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaPoisson.lean index 3f38c99ef3..7896def95f 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaPoisson.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaPoisson.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] open Classical in /-- A fractional shape covolume constant used in the Odlyzko-bound argument. -/ -noncomputable def fractionalShapeCovolumeConstant +@[expose] noncomputable def fractionalShapeCovolumeConstant (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : ℝ := FractionalIdeal.absNorm (I : FractionalIdeal (𝓞 K)⁰ K) * diff --git a/LeanPool/Odlyzko/CompletedZeta/ClassThetaRadial.lean b/LeanPool/Odlyzko/CompletedZeta/ClassThetaRadial.lean index 49db7182d5..daaa258136 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ClassThetaRadial.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ClassThetaRadial.lean @@ -10,7 +10,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -26,14 +26,14 @@ variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] open Classical in /-- A nonzero shape theta mellin kernel used in the Odlyzko-bound argument. -/ -noncomputable def nonzeroShapeThetaMellinKernel +@[expose] noncomputable def nonzeroShapeThetaMellinKernel (J : (Ideal (𝓞 K))⁰) (s : ℂ) (y : mixedEmbedding.realSpace K) : ℂ := logarithmicMellinWeight K s y * nonzeroIdealShapeTheta K J y open Classical in /-- A nonzero fractional shape theta mellin kernel used in the Odlyzko-bound argument. -/ -noncomputable def nonzeroFractionalShapeThetaMellinKernel +@[expose] noncomputable def nonzeroFractionalShapeThetaMellinKernel (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (s : ℂ) (y : mixedEmbedding.realSpace K) : ℂ := logarithmicMellinWeight K s y * diff --git a/LeanPool/Odlyzko/CompletedZeta/ConeGaussianIntegral.lean b/LeanPool/Odlyzko/CompletedZeta/ConeGaussianIntegral.lean index f0a1557fda..499480bdf1 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ConeGaussianIntegral.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ConeGaussianIntegral.lean @@ -10,7 +10,7 @@ public import LeanPool.Odlyzko.CompletedZeta.UnitAveragedGaussian /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -25,7 +25,7 @@ open mixedEmbedding fundamentalCone variable (K : Type*) [Field K] [NumberField K] /-- An ideal set element used in the Odlyzko-bound argument. -/ -noncomputable def idealSetElement +@[expose] noncomputable def idealSetElement (J : (Ideal (𝓞 K))⁰) (a : idealSet K J) : K := (preimageOfMemIntegerSet (idealSetEquiv K J a).val : 𝓞 K) diff --git a/LeanPool/Odlyzko/CompletedZeta/ConeGaussianInterchange.lean b/LeanPool/Odlyzko/CompletedZeta/ConeGaussianInterchange.lean index c7f6f4485b..5c6be4adbe 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ConeGaussianInterchange.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ConeGaussianInterchange.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.CompletedZeta.ConeGaussianIntegral /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/ConeGaussianRadial.lean b/LeanPool/Odlyzko/CompletedZeta/ConeGaussianRadial.lean index bb8c0158d8..a476d4c124 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ConeGaussianRadial.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ConeGaussianRadial.lean @@ -11,7 +11,7 @@ import Mathlib.RingTheory.Flat.TorsionFree /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -57,7 +57,7 @@ theorem pi_restrict_Ioi_eq_volume_restrict_positiveOrthant : open Classical in /-- A complex place radial jacobian used in the Odlyzko-bound argument. -/ -noncomputable def complexPlaceRadialJacobian +@[expose] noncomputable def complexPlaceRadialJacobian (q : InfinitePlace K → ℝ) : ℝ := mixedEmbedding.norm (mixedSpaceOfRealSpace q) * (∏ w : {w : InfinitePlace K // IsComplex w}, q w.1)⁻¹ * @@ -131,7 +131,7 @@ theorem complexPlaceRadialJacobian_expMapBasis_pos open Classical in /-- A radial mellin gaussian used in the Odlyzko-bound argument. -/ -noncomputable def radialMellinGaussian +@[expose] noncomputable def radialMellinGaussian (x : K) (s : ℂ) (y : realSpace K) : ℂ := complexPlaceRadialJacobian K (expMapBasis y) • complexPlaceMellinGaussian K x s (expMapBasis y) diff --git a/LeanPool/Odlyzko/CompletedZeta/Defs.lean b/LeanPool/Odlyzko/CompletedZeta/Defs.lean index 7b925989b0..2d736264f8 100644 --- a/LeanPool/Odlyzko/CompletedZeta/Defs.lean +++ b/LeanPool/Odlyzko/CompletedZeta/Defs.lean @@ -10,7 +10,7 @@ public import Mathlib.NumberTheory.NumberField.DedekindZeta /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -21,15 +21,15 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] /-- A discriminant factor used in the Odlyzko-bound argument. -/ -def CompletedZeta.discriminantFactor (s : ℂ) : ℂ := +@[expose] def CompletedZeta.discriminantFactor (s : ℂ) : ℂ := ((|(discr K : ℝ)| : ℝ) : ℂ) ^ (s / 2) /-- An archimedean factor used in the Odlyzko-bound argument. -/ -def CompletedZeta.archimedeanFactor (s : ℂ) : ℂ := +@[expose] def CompletedZeta.archimedeanFactor (s : ℂ) : ℂ := Complex.Gammaℝ s ^ nrRealPlaces K * (Complex.Gammaℂ s / 2) ^ nrComplexPlaces K /-- A completed used in the Odlyzko-bound argument. -/ -def CompletedZeta.completed (s : ℂ) : ℂ := +@[expose] def CompletedZeta.completed (s : ℂ) : ℂ := CompletedZeta.discriminantFactor K s * CompletedZeta.archimedeanFactor K s * dedekindZeta K s theorem discr_abs_pos : 0 < |(discr K : ℝ)| := by diff --git a/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean b/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean index 8fc340fe7a..ba098de81c 100644 --- a/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean +++ b/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean @@ -10,7 +10,7 @@ public import LeanPool.Odlyzko.Theta.TraceDualLattice /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -175,7 +175,7 @@ variable (K : Type*) [Field K] [NumberField K] open Classical in /-- A radial mixed space unit used in the Odlyzko-bound argument. -/ -noncomputable def radialMixedSpaceUnit +@[expose] noncomputable def radialMixedSpaceUnit (q : InfinitePlace K → ℝ) (hq : ∀ w, q w ≠ 0) : (mixedSpace K)ˣ where val := mixedSpaceOfRealSpace q @@ -206,7 +206,7 @@ theorem radialMixedSpaceUnit_val open Classical in /-- A trace radial scale used in the Odlyzko-bound argument. -/ -noncomputable def traceRadialScale +@[expose] noncomputable def traceRadialScale (q : InfinitePlace K → ℝ) (hq : ∀ w, q w ≠ 0) : mixedEmbedding.euclidean.mixedSpace K ≃L[ℝ] mixedEmbedding.euclidean.mixedSpace K := @@ -604,7 +604,7 @@ variable [IsTotallyComplex K] open Classical in /-- A shape ideal theta used in the Odlyzko-bound argument. -/ -noncomputable def shapeIdealTheta +@[expose] noncomputable def shapeIdealTheta (J : (Ideal (𝓞 K))⁰) (q : InfinitePlace K → ℝ) (hq : ∀ w, q w ≠ 0) : ℂ := latticeTheta @@ -863,7 +863,7 @@ variable (K : Type*) [Field K] [NumberField K] open Classical in /-- A fractional ideal element shape map used in the Odlyzko-bound argument. -/ -noncomputable def fractionalIdealElementShapeMap +@[expose] noncomputable def fractionalIdealElementShapeMap (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (q : InfinitePlace K → ℝ) (hq : ∀ w, q w ≠ 0) (x : ↥((I : FractionalIdeal (𝓞 K)⁰ K) : @@ -900,7 +900,7 @@ theorem fractionalIdealElementShapeMap_bijective open Classical in /-- A fractional ideal element shape equiv used in the Odlyzko-bound argument. -/ -noncomputable def fractionalIdealElementShapeEquiv +@[expose] noncomputable def fractionalIdealElementShapeEquiv (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (q : InfinitePlace K → ℝ) (hq : ∀ w, q w ≠ 0) : ↥((I : FractionalIdeal (𝓞 K)⁰ K) : @@ -925,7 +925,7 @@ variable [IsTotallyComplex K] open Classical in /-- A fractional shape ideal theta used in the Odlyzko-bound argument. -/ -noncomputable def fractionalShapeIdealTheta +@[expose] noncomputable def fractionalShapeIdealTheta (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (q : InfinitePlace K → ℝ) (hq : ∀ w, q w ≠ 0) : ℂ := latticeTheta (shapeIdealLattice K I q hq) Real.pi @@ -966,7 +966,7 @@ theorem fractionalShapeIdealTheta_poissonSummation open Classical in /-- A fractional ideal numerator used in the Odlyzko-bound argument. -/ -noncomputable def fractionalIdealNumerator +@[expose] noncomputable def fractionalIdealNumerator (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : (Ideal (𝓞 K))⁰ := ⟨(I : FractionalIdeal (𝓞 K)⁰ K).num, mem_nonZeroDivisors_iff_ne_zero.mpr fun hnum ↦ diff --git a/LeanPool/Odlyzko/CompletedZeta/FunctionalEquation.lean b/LeanPool/Odlyzko/CompletedZeta/FunctionalEquation.lean index a78ec7af30..521eb88cbf 100644 --- a/LeanPool/Odlyzko/CompletedZeta/FunctionalEquation.lean +++ b/LeanPool/Odlyzko/CompletedZeta/FunctionalEquation.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -206,7 +206,7 @@ theorem centeredFractionalClassContribution_eq_partialDedekindZeta open Classical in /-- A pole cleared centered fractional class contribution used in the Odlyzko-bound argument. -/ -noncomputable def poleClearedCenteredFractionalClassContribution +@[expose] noncomputable def poleClearedCenteredFractionalClassContribution (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) (s : ℂ) : ℂ := (torsionOrder K : ℂ)⁻¹ * (2 : ℂ) ^ nrComplexPlaces K * @@ -316,7 +316,7 @@ theorem poleClearedCenteredFractionalClassContribution_functionalEquation open Classical in /-- A pole cleared completed dedekind zeta continuation used in the Odlyzko-bound argument. -/ -noncomputable def poleClearedCompletedDedekindZetaContinuation (s : ℂ) : ℂ := +@[expose] noncomputable def poleClearedCompletedDedekindZetaContinuation (s : ℂ) : ℂ := ∑ C : ClassGroup (𝓞 K), poleClearedCenteredFractionalClassContribution K (FractionalIdeal.mk0 K (inverseClassIdealRepresentative K C)) s diff --git a/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean b/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean index 3f179fa827..8627b09cfb 100644 --- a/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean +++ b/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/FundamentalConeSeries.lean b/LeanPool/Odlyzko/CompletedZeta/FundamentalConeSeries.lean index 00a80c58fc..e24abdf9d1 100644 --- a/LeanPool/Odlyzko/CompletedZeta/FundamentalConeSeries.lean +++ b/LeanPool/Odlyzko/CompletedZeta/FundamentalConeSeries.lean @@ -12,7 +12,7 @@ import Mathlib.NumberTheory.LSeries.Linearity /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ variable (K : Type*) [Field K] [NumberField K] open mixedEmbedding fundamentalCone /-- A principal ideal norm count used in the Odlyzko-bound argument. -/ -noncomputable def principalIdealNormCount (J : (Ideal (𝓞 K))⁰) (n : ℕ) : ℕ := +@[expose] noncomputable def principalIdealNormCount (J : (Ideal (𝓞 K))⁰) (n : ℕ) : ℕ := Nat.card {I : (Ideal (𝓞 K))⁰ // (J : Ideal (𝓞 K)) ∣ I ∧ IsPrincipal (I : Ideal (𝓞 K)) ∧ absNorm (I : Ideal (𝓞 K)) = n} @@ -37,7 +37,7 @@ noncomputable def fundamentalConeNormCount (J : (Ideal (𝓞 K))⁰) (n : ℕ) : mixedEmbedding.norm (a : mixedSpace K) = n} /-- An ideal set int norm used in the Odlyzko-bound argument. -/ -noncomputable def idealSetIntNorm (J : (Ideal (𝓞 K))⁰) (a : idealSet K J) : ℕ := +@[expose] noncomputable def idealSetIntNorm (J : (Ideal (𝓞 K))⁰) (a : idealSet K J) : ℕ := intNorm (idealSetEquiv K J a).val /-- An ideal set int norm fiber equiv used in the Odlyzko-bound argument. -/ @@ -112,7 +112,7 @@ theorem principalIdealNormCount_le_idealNormCount grind /-- A principal ideal zeta used in the Odlyzko-bound argument. -/ -noncomputable def principalIdealZeta (J : (Ideal (𝓞 K))⁰) (s : ℂ) : ℂ := +@[expose] noncomputable def principalIdealZeta (J : (Ideal (𝓞 K))⁰) (s : ℂ) : ℂ := LSeries (fun n ↦ (principalIdealNormCount K J n : ℂ)) s /-- A fundamental cone zeta used in the Odlyzko-bound argument. -/ diff --git a/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean b/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean index 2d12cb6396..c9bd61a42e 100644 --- a/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean +++ b/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean @@ -11,7 +11,7 @@ import Mathlib.Combinatorics.Matroid.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -20,7 +20,7 @@ open Complex namespace NumberField.Odlyzko /-- A complex place gamma factor used in the Odlyzko-bound argument. -/ -def CompletedZeta.complexPlaceGammaFactor (s : ℂ) : ℂ := +@[expose] def CompletedZeta.complexPlaceGammaFactor (s : ℂ) : ℂ := Complex.Gammaℂ s / 2 theorem complexPlaceGammaFactor_eq (s : ℂ) : diff --git a/LeanPool/Odlyzko/CompletedZeta/IdealElementDecomposition.lean b/LeanPool/Odlyzko/CompletedZeta/IdealElementDecomposition.lean index 41792c9cf0..8fce3fda66 100644 --- a/LeanPool/Odlyzko/CompletedZeta/IdealElementDecomposition.lean +++ b/LeanPool/Odlyzko/CompletedZeta/IdealElementDecomposition.lean @@ -11,7 +11,7 @@ import LeanPool.Odlyzko.CompletedZeta.UnitDecomposition /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -265,7 +265,7 @@ theorem surjective_idealElementDecompositionMap open Classical in /-- An ideal element decomposition equiv used in the Odlyzko-bound argument. -/ -noncomputable def idealElementDecompositionEquiv +@[expose] noncomputable def idealElementDecompositionEquiv (J : (Ideal (𝓞 K))⁰) : idealSet K J × unitShiftIndex K ≃ nonzeroIdealElement K J := Equiv.ofBijective (idealElementDecompositionMap K J) diff --git a/LeanPool/Odlyzko/CompletedZeta/IdealThetaUnfolding.lean b/LeanPool/Odlyzko/CompletedZeta/IdealThetaUnfolding.lean index 77615c3746..f239e959a8 100644 --- a/LeanPool/Odlyzko/CompletedZeta/IdealThetaUnfolding.lean +++ b/LeanPool/Odlyzko/CompletedZeta/IdealThetaUnfolding.lean @@ -11,7 +11,7 @@ import LeanPool.Odlyzko.CompletedZeta.ConeGaussianInterchange /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/LogarithmicMellinHalfIntegral.lean b/LeanPool/Odlyzko/CompletedZeta/LogarithmicMellinHalfIntegral.lean index 07717153e7..f5ba85ee16 100644 --- a/LeanPool/Odlyzko/CompletedZeta/LogarithmicMellinHalfIntegral.lean +++ b/LeanPool/Odlyzko/CompletedZeta/LogarithmicMellinHalfIntegral.lean @@ -11,7 +11,7 @@ import LeanPool.Odlyzko.CompletedZeta.UnitSlabRadialIntegral /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/RadialKernelFormula.lean b/LeanPool/Odlyzko/CompletedZeta/RadialKernelFormula.lean index 6b1cb7da93..fbdf4ce15e 100644 --- a/LeanPool/Odlyzko/CompletedZeta/RadialKernelFormula.lean +++ b/LeanPool/Odlyzko/CompletedZeta/RadialKernelFormula.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Function.LpSpace.InfiniteSum /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,7 @@ variable (K : Type*) [Field K] [NumberField K] open Classical in /-- A complex place gaussian used in the Odlyzko-bound argument. -/ -noncomputable def complexPlaceGaussian +@[expose] noncomputable def complexPlaceGaussian (x : K) (q : InfinitePlace K → ℝ) : ℂ := Complex.exp (-((2 * Real.pi * @@ -261,7 +261,7 @@ theorem fundamentalConeZeta_eq_integral_tsum_nonzeroIdealElement_radial open Classical in /-- A nonzero ideal shape theta used in the Odlyzko-bound argument. -/ -noncomputable def nonzeroIdealShapeTheta +@[expose] noncomputable def nonzeroIdealShapeTheta (J : (Ideal (𝓞 K))⁰) (y : realSpace K) : ℂ := ∑' x : nonzeroIdealElement K J, complexPlaceGaussian K (((x : 𝓞 K) : K)) (expMapBasis y) diff --git a/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean b/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean index 19a2ee2524..081fb0189f 100644 --- a/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean +++ b/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/ShapeMellinTranslation.lean b/LeanPool/Odlyzko/CompletedZeta/ShapeMellinTranslation.lean index 5c8be50fb5..44eb5d5ecd 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ShapeMellinTranslation.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ShapeMellinTranslation.lean @@ -10,7 +10,7 @@ public import LeanPool.Odlyzko.CompletedZeta.UnitSlabTranslation /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] open Classical in /-- A logarithmic mellin weight used in the Odlyzko-bound argument. -/ -noncomputable def logarithmicMellinWeight +@[expose] noncomputable def logarithmicMellinWeight (s : ℂ) (y : mixedEmbedding.realSpace K) : ℂ := Complex.exp (((y w₀ * (Module.finrank ℚ K : ℝ) : ℝ) : ℂ) * s) diff --git a/LeanPool/Odlyzko/CompletedZeta/ShapeThetaPeriodicity.lean b/LeanPool/Odlyzko/CompletedZeta/ShapeThetaPeriodicity.lean index 9d526f2e62..38e7f3b5c1 100644 --- a/LeanPool/Odlyzko/CompletedZeta/ShapeThetaPeriodicity.lean +++ b/LeanPool/Odlyzko/CompletedZeta/ShapeThetaPeriodicity.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.CompletedZeta.FractionalShapeTheta /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/TotallyComplex.lean b/LeanPool/Odlyzko/CompletedZeta/TotallyComplex.lean index d9304a2908..b438f2f127 100644 --- a/LeanPool/Odlyzko/CompletedZeta/TotallyComplex.lean +++ b/LeanPool/Odlyzko/CompletedZeta/TotallyComplex.lean @@ -11,7 +11,7 @@ import LeanPool.Odlyzko.CompletedZeta.GammaFactor /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/TraceDualClass.lean b/LeanPool/Odlyzko/CompletedZeta/TraceDualClass.lean index 4eacd42b47..d99e425c6b 100644 --- a/LeanPool/Odlyzko/CompletedZeta/TraceDualClass.lean +++ b/LeanPool/Odlyzko/CompletedZeta/TraceDualClass.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -49,7 +49,7 @@ theorem mk_traceDualIdealUnit open Classical in /-- A trace dual class equiv used in the Odlyzko-bound argument. -/ -noncomputable def traceDualClassEquiv : +@[expose] noncomputable def traceDualClassEquiv : ClassGroup (𝓞 K) ≃ ClassGroup (𝓞 K) where toFun C := codifferentClass K * C⁻¹ invFun C := codifferentClass K * C⁻¹ @@ -60,7 +60,7 @@ noncomputable def traceDualClassEquiv : open Classical in /-- A class group inv equiv used in the Odlyzko-bound argument. -/ -noncomputable def classGroupInvEquiv : +@[expose] noncomputable def classGroupInvEquiv : ClassGroup (𝓞 K) ≃ ClassGroup (𝓞 K) where toFun C := C⁻¹ invFun C := C⁻¹ @@ -69,7 +69,7 @@ noncomputable def classGroupInvEquiv : open Classical in /-- A trace dual inverse class equiv used in the Odlyzko-bound argument. -/ -noncomputable def traceDualInverseClassEquiv : +@[expose] noncomputable def traceDualInverseClassEquiv : ClassGroup (𝓞 K) ≃ ClassGroup (𝓞 K) := (classGroupInvEquiv K).trans ((traceDualClassEquiv K).trans (classGroupInvEquiv K)) diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitAveragedGaussian.lean b/LeanPool/Odlyzko/CompletedZeta/UnitAveragedGaussian.lean index fe8ce84821..24eca54c7a 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitAveragedGaussian.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitAveragedGaussian.lean @@ -11,7 +11,7 @@ public import Mathlib.NumberTheory.NumberField.InfinitePlace.TotallyRealComplex /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -220,7 +220,7 @@ variable (K : Type*) [Field K] [NumberField K] open scoped Classical in /-- A complex place mellin gaussian used in the Odlyzko-bound argument. -/ -noncomputable def complexPlaceMellinGaussian +@[expose] noncomputable def complexPlaceMellinGaussian (x : K) (s : ℂ) (q : InfinitePlace K → ℝ) : ℂ := ∏ w, (q w : ℂ) ^ (2 * s - 1) * diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitDecomposition.lean b/LeanPool/Odlyzko/CompletedZeta/UnitDecomposition.lean index 21d14dae64..db666adb14 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitDecomposition.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitDecomposition.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.CompletedZeta.UnitFundamentalDomain /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -47,7 +47,7 @@ theorem fundamentalUnitForShift_unitExponentReindex (fun _ ↦ by simp [unitExponentReindex])).symm /-- An unit decomposition map used in the Odlyzko-bound argument. -/ -noncomputable def unitDecompositionMap : +@[expose] noncomputable def unitDecompositionMap : torsion K × ({w : InfinitePlace K // w ≠ w₀} → ℤ) → (𝓞 K)ˣ := fun p ↦ p.1 * fundamentalUnitForShift p.2 @@ -92,7 +92,7 @@ theorem bijective_unitDecompositionMap : open scoped Classical in /-- An unit decomposition equiv used in the Odlyzko-bound argument. -/ -def unitDecompositionEquiv : +@[expose] def unitDecompositionEquiv : torsion K × ({w : InfinitePlace K // w ≠ w₀} → ℤ) ≃ (𝓞 K)ˣ := Equiv.ofBijective (unitDecompositionMap K) diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitFundamentalDomain.lean b/LeanPool/Odlyzko/CompletedZeta/UnitFundamentalDomain.lean index 786b539d51..eed9bf33c8 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitFundamentalDomain.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitFundamentalDomain.lean @@ -9,7 +9,7 @@ public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -45,18 +45,18 @@ open scoped Classical in open scoped Classical in open scoped Classical in /-- An unit floor used in the Odlyzko-bound argument. -/ -def unitFloor (x : realSpace K) : InfinitePlace K → ℤ := +@[expose] def unitFloor (x : realSpace K) : InfinitePlace K → ℤ := fun w ↦ if w = w₀ then 0 else ⌊x w⌋ open scoped Classical in /-- An unit coordinate shift used in the Odlyzko-bound argument. -/ -def unitCoordinateShift +@[expose] def unitCoordinateShift (z : {w : InfinitePlace K // w ≠ w₀} → ℤ) : realSpace K := fun w ↦ if hw : w = w₀ then 0 else z ⟨w, hw⟩ open scoped Classical in /-- A fundamental unit for shift used in the Odlyzko-bound argument. -/ -def fundamentalUnitForShift +@[expose] def fundamentalUnitForShift (z : {w : InfinitePlace K // w ≠ w₀} → ℤ) : (𝓞 K)ˣ := ∏ i, fundSystem K (equivFinRank.symm i) ^ z i diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean b/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean index 51312115dc..d9b0651f07 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.CompletedZeta.UnitSlabTranslation /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -36,7 +36,7 @@ def negativeRadialHalfSpace : open Classical in /-- A positive radial half space used in the Odlyzko-bound argument. -/ -def positiveRadialHalfSpace : +@[expose] def positiveRadialHalfSpace : Set (mixedEmbedding.realSpace K) := {y | 0 < y w₀} @@ -48,13 +48,13 @@ def nonnegativeUnitFundamentalParamSet : open Classical in /-- A negative unit fundamental param set used in the Odlyzko-bound argument. -/ -def negativeUnitFundamentalParamSet : +@[expose] def negativeUnitFundamentalParamSet : Set (mixedEmbedding.realSpace K) := unitFundamentalParamSet K ∩ negativeRadialHalfSpace (K := K) open Classical in /-- A positive unit fundamental param set used in the Odlyzko-bound argument. -/ -def positiveUnitFundamentalParamSet : +@[expose] def positiveUnitFundamentalParamSet : Set (mixedEmbedding.realSpace K) := unitFundamentalParamSet K ∩ positiveRadialHalfSpace (K := K) diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadialIntegral.lean b/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadialIntegral.lean index 90bd8e1035..9318f90059 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadialIntegral.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadialIntegral.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.CompletedZeta.UnitSlabRadial /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitSlabTranslation.lean b/LeanPool/Odlyzko/CompletedZeta/UnitSlabTranslation.lean index 000e735ab8..d6e082566f 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitSlabTranslation.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitSlabTranslation.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.CompletedZeta.UnitFundamentalDomain /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -24,7 +24,7 @@ variable {K : Type*} [Field K] [NumberField K] open Classical in /-- An unit coordinate shift hom used in the Odlyzko-bound argument. -/ -noncomputable def unitCoordinateShiftHom : +@[expose] noncomputable def unitCoordinateShiftHom : ({w : InfinitePlace K // w ≠ w₀} → ℤ) →+ mixedEmbedding.realSpace K where toFun := unitCoordinateShift @@ -44,7 +44,7 @@ theorem unitCoordinateShiftHom_apply open Classical in /-- An unit coordinate lattice used in the Odlyzko-bound argument. -/ -noncomputable def unitCoordinateLattice : +@[expose] noncomputable def unitCoordinateLattice : AddSubgroup (mixedEmbedding.realSpace K) := (unitCoordinateShiftHom (K := K)).range diff --git a/LeanPool/Odlyzko/CompletedZeta/VerticalGrowth.lean b/LeanPool/Odlyzko/CompletedZeta/VerticalGrowth.lean index 49fc0ff649..9f4a71e0c3 100644 --- a/LeanPool/Odlyzko/CompletedZeta/VerticalGrowth.lean +++ b/LeanPool/Odlyzko/CompletedZeta/VerticalGrowth.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean b/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean index b123713a9e..79ce54f4c6 100644 --- a/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean +++ b/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/DedekindZeta/Coefficients.lean b/LeanPool/Odlyzko/DedekindZeta/Coefficients.lean index 4819ee4c49..02773541b5 100644 --- a/LeanPool/Odlyzko/DedekindZeta/Coefficients.lean +++ b/LeanPool/Odlyzko/DedekindZeta/Coefficients.lean @@ -13,7 +13,7 @@ public import Mathlib.NumberTheory.NumberField.DedekindZeta Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section open Ideal @@ -22,7 +22,7 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] /-- An ideal norm count used in the Odlyzko-bound argument. -/ -noncomputable def idealNormCount (n : ℕ) : ℕ := +@[expose] noncomputable def idealNormCount (n : ℕ) : ℕ := Nat.card {I : Ideal (𝓞 K) // absNorm I = n} lemma dedekindZeta_eq_LSeries_idealNormCount (s : ℂ) : diff --git a/LeanPool/Odlyzko/DedekindZeta/Convergence.lean b/LeanPool/Odlyzko/DedekindZeta/Convergence.lean index a6ae62c5f7..f7d40169d4 100644 --- a/LeanPool/Odlyzko/DedekindZeta/Convergence.lean +++ b/LeanPool/Odlyzko/DedekindZeta/Convergence.lean @@ -9,7 +9,7 @@ public import LeanPool.Odlyzko.DedekindZeta.Coefficients /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/DedekindZeta/FiniteFiberSeries.lean b/LeanPool/Odlyzko/DedekindZeta/FiniteFiberSeries.lean index 7d766b7951..56c64dabd4 100644 --- a/LeanPool/Odlyzko/DedekindZeta/FiniteFiberSeries.lean +++ b/LeanPool/Odlyzko/DedekindZeta/FiniteFiberSeries.lean @@ -9,7 +9,7 @@ public import Mathlib.NumberTheory.LSeries.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section namespace NumberField.Odlyzko diff --git a/LeanPool/Odlyzko/DedekindZeta/IdealPrimeFactorization.lean b/LeanPool/Odlyzko/DedekindZeta/IdealPrimeFactorization.lean index 1e5501c0f7..b2a9869321 100644 --- a/LeanPool/Odlyzko/DedekindZeta/IdealPrimeFactorization.lean +++ b/LeanPool/Odlyzko/DedekindZeta/IdealPrimeFactorization.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Continuity.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -37,7 +37,7 @@ noncomputable def idealPrimeFactors (I : NonzeroIdeal K) : prime_of_normalized_factor /-- An ideal of prime factors used in the Odlyzko-bound argument. -/ -noncomputable def idealOfPrimeFactors +@[expose] noncomputable def idealOfPrimeFactors (m : Multiset (HeightOneSpectrum (𝓞 K))) : NonzeroIdeal K := ⟨(m.map HeightOneSpectrum.asIdeal).prod, by exact Multiset.prod_ne_zero fun h ↦ @@ -92,7 +92,7 @@ theorem idealPrimeFactors_idealOfPrimeFactors simp_all /-- A nonzero ideal equiv prime factors used in the Odlyzko-bound argument. -/ -noncomputable def nonzeroIdealEquivPrimeFactors : +@[expose] noncomputable def nonzeroIdealEquivPrimeFactors : NonzeroIdeal K ≃ Multiset (HeightOneSpectrum (𝓞 K)) where toFun := idealPrimeFactors K invFun := idealOfPrimeFactors K diff --git a/LeanPool/Odlyzko/DedekindZeta/IdealSeries.lean b/LeanPool/Odlyzko/DedekindZeta/IdealSeries.lean index b089844f10..2d8cf3ac86 100644 --- a/LeanPool/Odlyzko/DedekindZeta/IdealSeries.lean +++ b/LeanPool/Odlyzko/DedekindZeta/IdealSeries.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/DedekindZeta/LocalFactor.lean b/LeanPool/Odlyzko/DedekindZeta/LocalFactor.lean index 8705f72030..26d64dc1f1 100644 --- a/LeanPool/Odlyzko/DedekindZeta/LocalFactor.lean +++ b/LeanPool/Odlyzko/DedekindZeta/LocalFactor.lean @@ -19,16 +19,16 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section namespace NumberField.Odlyzko /-- An inverse norm power used in the Odlyzko-bound argument. -/ -noncomputable def inverseNormPower (q : ℕ) (s : ℂ) : ℂ := +@[expose] noncomputable def inverseNormPower (q : ℕ) (s : ℂ) : ℂ := (q : ℂ) ^ (-s) /-- A local factor used in the Odlyzko-bound argument. -/ -noncomputable def localFactor (q : ℕ) (s : ℂ) : ℂ := +@[expose] noncomputable def localFactor (q : ℕ) (s : ℂ) : ℂ := (1 - inverseNormPower q s)⁻¹ lemma norm_inverseNormPower (q : ℕ) (hq : 0 < q) (s : ℂ) : diff --git a/LeanPool/Odlyzko/DedekindZeta/PrimeIdealEulerProduct.lean b/LeanPool/Odlyzko/DedekindZeta/PrimeIdealEulerProduct.lean index e699877588..4b218a4b9f 100644 --- a/LeanPool/Odlyzko/DedekindZeta/PrimeIdealEulerProduct.lean +++ b/LeanPool/Odlyzko/DedekindZeta/PrimeIdealEulerProduct.lean @@ -16,7 +16,7 @@ import Mathlib.NumberTheory.EulerProduct.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/DedekindZeta/PrimeIdealFactor.lean b/LeanPool/Odlyzko/DedekindZeta/PrimeIdealFactor.lean index 2c19344dd4..7aee1b48fc 100644 --- a/LeanPool/Odlyzko/DedekindZeta/PrimeIdealFactor.lean +++ b/LeanPool/Odlyzko/DedekindZeta/PrimeIdealFactor.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! TODO: Add doc-string. -/ -@[expose] public section +public section open Ideal IsDedekindDomain @@ -23,7 +23,7 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] /-- A prime ideal norm used in the Odlyzko-bound argument. -/ -noncomputable def primeIdealNorm (P : HeightOneSpectrum (𝓞 K)) : ℕ := +@[expose] noncomputable def primeIdealNorm (P : HeightOneSpectrum (𝓞 K)) : ℕ := absNorm P.asIdeal lemma one_lt_primeIdealNorm (P : HeightOneSpectrum (𝓞 K)) : @@ -34,7 +34,7 @@ lemma one_lt_primeIdealNorm (P : HeightOneSpectrum (𝓞 K)) : · simpa [primeIdealNorm, Ideal.absNorm_eq_one_iff] using P.isPrime.ne_top /-- A prime ideal factor used in the Odlyzko-bound argument. -/ -noncomputable def primeIdealFactor (P : HeightOneSpectrum (𝓞 K)) (s : ℂ) : ℂ := +@[expose] noncomputable def primeIdealFactor (P : HeightOneSpectrum (𝓞 K)) (s : ℂ) : ℂ := localFactor (primeIdealNorm K P) s lemma primeIdealFactor_ne_zero (P : HeightOneSpectrum (𝓞 K)) {s : ℂ} (hs : 0 < s.re) : diff --git a/LeanPool/Odlyzko/DedekindZeta/PrimeIdealSummability.lean b/LeanPool/Odlyzko/DedekindZeta/PrimeIdealSummability.lean index f827ee4fee..43054dd6d8 100644 --- a/LeanPool/Odlyzko/DedekindZeta/PrimeIdealSummability.lean +++ b/LeanPool/Odlyzko/DedekindZeta/PrimeIdealSummability.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.SpecialFunctions.Log.Summable /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/DedekindZeta/PrimePowerExpansion.lean b/LeanPool/Odlyzko/DedekindZeta/PrimePowerExpansion.lean index 32b93215c7..e56bdedb5d 100644 --- a/LeanPool/Odlyzko/DedekindZeta/PrimePowerExpansion.lean +++ b/LeanPool/Odlyzko/DedekindZeta/PrimePowerExpansion.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.ArithMult.Init /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean b/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean index f3c8471b11..f9350f4f88 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -936,7 +936,7 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] /-- A completed zeta moving circle bound used in the Odlyzko-bound argument. -/ -noncomputable def completedZetaMovingCircleBound (R t : ℝ) : ℝ := +@[expose] noncomputable def completedZetaMovingCircleBound (R t : ℝ) : ℝ := max 1 <| poleClearedCompletedDedekindZetaVerticalBound K (2 - |R|) (2 + |R|) * (1 + |t| + |R|) ^ 2 @@ -1607,11 +1607,11 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] /-- A completed zeta radius six vertical coefficient used in the Odlyzko-bound argument. -/ -noncomputable def completedZetaRadiusSixVerticalCoefficient : ℝ := +@[expose] noncomputable def completedZetaRadiusSixVerticalCoefficient : ℝ := max 1 (poleClearedCompletedDedekindZetaVerticalBound K (-4) 8) /-- A completed zeta center log linear expression used in the Odlyzko-bound argument. -/ -noncomputable def completedZetaCenterLogLinearExpression (t : ℝ) : ℝ := +@[expose] noncomputable def completedZetaCenterLogLinearExpression (t : ℝ) : ℝ := completedZetaRadiusSixVerticalCoefficient K + 2 * (7 + |t|) + Real.log (dedekindZetaInverseVerticalMajorant K) - (nrComplexPlaces K : ℝ) / 2 * @@ -1619,7 +1619,7 @@ noncomputable def completedZetaCenterLogLinearExpression (t : ℝ) : ℝ := (nrComplexPlaces K : ℝ) / 2 * Real.pi * |t| /-- A completed zeta center log linear bound used in the Odlyzko-bound argument. -/ -noncomputable def completedZetaCenterLogLinearBound (t : ℝ) : ℝ := +@[expose] noncomputable def completedZetaCenterLogLinearBound (t : ℝ) : ℝ := max 1 (completedZetaCenterLogLinearExpression K t) omit [IsTotallyComplex K] in diff --git a/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaRectangle.lean b/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaRectangle.lean index 12141a39d7..0b3b31fe01 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaRectangle.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaRectangle.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -69,7 +69,7 @@ theorem meromorphicOrderAt_poleClearedCompletedDedekindZetaContinuation_nonneg open Classical in /-- A completed dedekind zeta zero divisor used in the Odlyzko-bound argument. -/ -noncomputable def completedDedekindZetaZeroDivisor : +@[expose] noncomputable def completedDedekindZetaZeroDivisor : Function.locallyFinsuppWithin (Set.univ : Set ℂ) ℤ := MeromorphicOn.divisor (poleClearedCompletedDedekindZetaContinuation K) Set.univ diff --git a/LeanPool/Odlyzko/ExplicitFormula/FiniteSetAvoidance.lean b/LeanPool/Odlyzko/ExplicitFormula/FiniteSetAvoidance.lean index 3b91045771..b072ff8cc7 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/FiniteSetAvoidance.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/FiniteSetAvoidance.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Measure.Real Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ open scoped ENNReal namespace NumberField.Odlyzko /-- A finite set avoidance radius on length used in the Odlyzko-bound argument. -/ -def finiteSetAvoidanceRadiusOnLength (L : ℝ) (S : Finset ℝ) : ℝ := +@[expose] def finiteSetAvoidanceRadiusOnLength (L : ℝ) (S : Finset ℝ) : ℝ := L / (4 * (S.card + 1)) theorem finiteSetAvoidanceRadiusOnLength_pos {L : ℝ} (hL : 0 < L) diff --git a/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean b/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean index 5ece9d5580..5663ca0872 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.PSeries Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -26,7 +26,7 @@ open Complex MeasureTheory Real Set namespace NumberField.Odlyzko /-- A gauss digamma integrand used in the Odlyzko-bound argument. -/ -noncomputable def gaussDigammaIntegrand (s : ℂ) (x : ℝ) : ℂ := +@[expose] noncomputable def gaussDigammaIntegrand (s : ℂ) (x : ℝ) : ℂ := (Complex.exp (-x) - Complex.exp (-s * x)) / (1 - Complex.exp (-x)) @@ -298,7 +298,7 @@ open Complex MeasureTheory Real Set namespace NumberField.Odlyzko /-- A gauss digamma used in the Odlyzko-bound argument. -/ -noncomputable def gaussDigamma (s : ℂ) : ℂ := +@[expose] noncomputable def gaussDigamma (s : ℂ) : ℂ := -Real.eulerMascheroniConstant + ∫ x : ℝ in Ioi 0, gaussDigammaIntegrand s x diff --git a/LeanPool/Odlyzko/ExplicitFormula/PoitouEstimate.lean b/LeanPool/Odlyzko/ExplicitFormula/PoitouEstimate.lean index 7af45453ba..a1e91a73e4 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/PoitouEstimate.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/PoitouEstimate.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/ExplicitFormula/PoitouTransform.lean b/LeanPool/Odlyzko/ExplicitFormula/PoitouTransform.lean index 199adf85df..412da91a9c 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/PoitouTransform.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/PoitouTransform.lean @@ -16,7 +16,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -25,16 +25,16 @@ open Complex MeasureTheory namespace NumberField.Odlyzko /-- A poitou kernel used in the Odlyzko-bound argument. -/ -noncomputable def poitouKernel (f : ℝ → ℝ) (x : ℝ) : ℝ := +@[expose] noncomputable def poitouKernel (f : ℝ → ℝ) (x : ℝ) : ℝ := f x / Real.cosh (x / 2) /-- A poitou transform integrand used in the Odlyzko-bound argument. -/ -noncomputable def poitouTransformIntegrand +@[expose] noncomputable def poitouTransformIntegrand (f : ℝ → ℝ) (s : ℂ) (x : ℝ) : ℂ := (poitouKernel f x : ℂ) * Complex.exp ((s - 1 / 2) * x) /-- A poitou transform used in the Odlyzko-bound argument. -/ -noncomputable def poitouTransform (f : ℝ → ℝ) (s : ℂ) : ℂ := +@[expose] noncomputable def poitouTransform (f : ℝ → ℝ) (s : ℂ) : ℂ := ∫ x : ℝ, poitouTransformIntegrand f s x theorem poitouKernel_neg {f : ℝ → ℝ} diff --git a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean index 85d13076ad..ea41a87c29 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean @@ -32,7 +32,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -459,7 +459,7 @@ noncomputable def completedZetaPoleFactor (s : ℂ) : ℂ := s * (s - 1) /-- A completed zeta pole log deriv used in the Odlyzko-bound argument. -/ -noncomputable def completedZetaPoleLogDeriv (s : ℂ) : ℂ := +@[expose] noncomputable def completedZetaPoleLogDeriv (s : ℂ) : ℂ := 1 / s + 1 / (s - 1) theorem completedZetaPoleLogDeriv_one_sub (s : ℂ) : @@ -2986,7 +2986,7 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] [IsTotallyComplex K] /-- A regularized subtracted horizontal vanishing used in the Odlyzko-bound argument. -/ -def RegularizedSubtractedHorizontalVanishing +@[expose] def RegularizedSubtractedHorizontalVanishing (y δ b : ℝ) : Prop := ∃ T : ℕ → ℝ, Tendsto T atTop atTop ∧ diff --git a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouQuadraticDecay.lean b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouQuadraticDecay.lean index e5c1fe8ad5..c28764db90 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouQuadraticDecay.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouQuadraticDecay.lean @@ -19,7 +19,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -491,7 +491,7 @@ open scoped FourierTransform Real Topology namespace NumberField.Odlyzko /-- A regularized poitou vertical profile used in the Odlyzko-bound argument. -/ -noncomputable def regularizedPoitouVerticalProfile +@[expose] noncomputable def regularizedPoitouVerticalProfile (y δ σ x : ℝ) : ℂ := (poitouKernel (regularizedScaledTartar y δ) x : ℂ) * Complex.exp ((σ - 1 / 2) * x) diff --git a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPrimePowerSeriesIntegral.lean b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPrimePowerSeriesIntegral.lean index 061ebf6abe..a43ccc59e5 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPrimePowerSeriesIntegral.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPrimePowerSeriesIntegral.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartar.lean b/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartar.lean index be2496a267..9c6a654241 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartar.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartar.lean @@ -17,7 +17,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open scoped Topology namespace NumberField.Odlyzko /-- A regularized scaled tartar used in the Odlyzko-bound argument. -/ -noncomputable def regularizedScaledTartar +@[expose] noncomputable def regularizedScaledTartar (y δ x : ℝ) : ℝ := scaledTartarTestFunction y x * Real.exp (-δ * x ^ 2) diff --git a/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartarTransform.lean b/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartarTransform.lean index 268956c446..5ce4287a46 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartarTransform.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/RegularizedTartarTransform.lean @@ -20,7 +20,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/ExplicitFormula/TartarPoitouTransform.lean b/LeanPool/Odlyzko/ExplicitFormula/TartarPoitouTransform.lean index de1ca7da51..db6fe38a15 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/TartarPoitouTransform.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/TartarPoitouTransform.lean @@ -18,7 +18,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open Complex MeasureTheory Set namespace NumberField.Odlyzko /-- A scaled tartar test function used in the Odlyzko-bound argument. -/ -noncomputable def scaledTartarTestFunction (y : ℝ) (x : ℝ) : ℝ := +@[expose] noncomputable def scaledTartarTestFunction (y : ℝ) (x : ℝ) : ℝ := Tartar.testFunction (y * x) theorem scaledTartarTestFunction_nonneg (y x : ℝ) : @@ -136,7 +136,7 @@ theorem poitouTransform_scaledTartar_one integral_scaledTartarTestFunction hy] /-- A poitou transform derivative integrand used in the Odlyzko-bound argument. -/ -noncomputable def poitouTransformDerivativeIntegrand +@[expose] noncomputable def poitouTransformDerivativeIntegrand (f : ℝ → ℝ) (s : ℂ) (x : ℝ) : ℂ := x * poitouTransformIntegrand f s x diff --git a/LeanPool/Odlyzko/ExplicitFormula/WeightedDiskArgumentPrinciple.lean b/LeanPool/Odlyzko/ExplicitFormula/WeightedDiskArgumentPrinciple.lean index c06511482b..e5af73cdd6 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/WeightedDiskArgumentPrinciple.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/WeightedDiskArgumentPrinciple.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -86,7 +86,7 @@ open Complex Filter Function Metric Topology Set namespace NumberField.Odlyzko /-- A weighted log deriv finite remainder used in the Odlyzko-bound argument. -/ -noncomputable def weightedLogDerivFiniteRemainder +@[expose] noncomputable def weightedLogDerivFiniteRemainder (f h : ℂ → ℂ) (S : Finset ℂ) (order : ℂ → ℤ) : ℂ → ℂ := fun z ↦ h z * logDeriv f z - ∑ p ∈ S, (h p * (order p : ℂ)) / (z - p) diff --git a/LeanPool/Odlyzko/ExplicitFormula/WeightedRectangleArgumentPrinciple.lean b/LeanPool/Odlyzko/ExplicitFormula/WeightedRectangleArgumentPrinciple.lean index 1688b9aeff..827af21c7a 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/WeightedRectangleArgumentPrinciple.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/WeightedRectangleArgumentPrinciple.lean @@ -17,7 +17,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/ExplicitFormula/ZeroFreeRectangles.lean b/LeanPool/Odlyzko/ExplicitFormula/ZeroFreeRectangles.lean index 8639274a2f..356e71f190 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/ZeroFreeRectangles.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/ZeroFreeRectangles.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.ArithMult.Init Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/LogDerivativeResidue.lean b/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/LogDerivativeResidue.lean index bee3b808a8..23c4d60937 100644 --- a/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/LogDerivativeResidue.lean +++ b/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/LogDerivativeResidue.lean @@ -14,7 +14,7 @@ by Alex Kontorovich and Terence Tao: `ResidueCalcOnRectangles.lean` and `RectangleArgumentPrinciple.lean`, commit `be5e07e04cde20c5ceabf63759bd097a9c88173f` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/RectangleIntegral.lean b/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/RectangleIntegral.lean index 064c61fc8f..61a1555d9c 100644 --- a/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/RectangleIntegral.lean +++ b/LeanPool/Odlyzko/FromPrimeNumberTheoremAnd/RectangleIntegral.lean @@ -13,7 +13,7 @@ by Alex Kontorovich and Terence Tao: `ResidueCalcOnRectangles.lean`, commit `be5e07e04cde20c5ceabf63759bd097a9c88173f` (Apache-2.0). -/ -@[expose] public section +public section noncomputable section @@ -23,17 +23,18 @@ open scoped Interval namespace NumberField.Odlyzko /-- A horizontal integral used in the Odlyzko-bound argument. -/ -noncomputable def horizontalIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] +@[expose] noncomputable def horizontalIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] (f : ℂ → E) (x₁ x₂ y : ℝ) : E := ∫ x in x₁..x₂, f (x + y * I) /-- A vertical segment integral used in the Odlyzko-bound argument. -/ +@[expose] noncomputable def verticalSegmentIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] (f : ℂ → E) (x y₁ y₂ : ℝ) : E := I • ∫ y in y₁..y₂, f (x + y * I) /-- A rectangle integral used in the Odlyzko-bound argument. -/ -noncomputable def rectangleIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] +@[expose] noncomputable def rectangleIntegral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] (f : ℂ → E) (z w : ℂ) : E := horizontalIntegral f z.re w.re z.im - horizontalIntegral f z.re w.re w.im + @@ -63,7 +64,7 @@ noncomputable def normalizedRectangleIntegral {E : Type*} [NormedAddCommGroup E] (1 / (2 * Real.pi * I)) • rectangleIntegral f z w /-- A rectangle border integrable used in the Odlyzko-bound argument. -/ -def RectangleBorderIntegrable {E : Type*} [NormedAddCommGroup E] +@[expose] def RectangleBorderIntegrable {E : Type*} [NormedAddCommGroup E] (f : ℂ → E) (z w : ℂ) : Prop := IntervalIntegrable (fun x ↦ f (x + z.im * I)) volume z.re w.re ∧ IntervalIntegrable (fun x ↦ f (x + w.im * I)) volume z.re w.re ∧ diff --git a/LeanPool/Odlyzko/Numerics/Degree.lean b/LeanPool/Odlyzko/Numerics/Degree.lean index 80425dfec6..062a662d2e 100644 --- a/LeanPool/Odlyzko/Numerics/Degree.lean +++ b/LeanPool/Odlyzko/Numerics/Degree.lean @@ -12,12 +12,12 @@ import Mathlib.Tactic.Positivity.Finset /-! TODO: Add doc-string. -/ -@[expose] public section +public section namespace NumberField.Odlyzko /-- An odlyzko scale used in the Odlyzko-bound argument. -/ -noncomputable def odlyzkoScale : ℝ := +@[expose] noncomputable def odlyzkoScale : ℝ := 41 / 50 theorem odlyzkoScale_pos : 0 < odlyzkoScale := by diff --git a/LeanPool/Odlyzko/Numerics/Integrability.lean b/LeanPool/Odlyzko/Numerics/Integrability.lean index 4b34944e89..2abcbbfb7a 100644 --- a/LeanPool/Odlyzko/Numerics/Integrability.lean +++ b/LeanPool/Odlyzko/Numerics/Integrability.lean @@ -19,16 +19,16 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp /-! TODO: Add doc-string. -/ -@[expose] public section +public section namespace NumberField.Odlyzko /-- An archimedean integrand used in the Odlyzko-bound argument. -/ -noncomputable def archimedeanIntegrand (y x : ℝ) : ℝ := +@[expose] noncomputable def archimedeanIntegrand (y x : ℝ) : ℝ := (1 - Tartar.testFunction (y * x)) / Real.sinh x /-- An archimedean integral used in the Odlyzko-bound argument. -/ -noncomputable def archimedeanIntegral (y : ℝ) : ℝ := +@[expose] noncomputable def archimedeanIntegral (y : ℝ) : ℝ := ∫ x in Set.Ioi (0 : ℝ), archimedeanIntegrand y x theorem archimedeanIntegrand_le_one_div_sinh {y x : ℝ} (hx : 0 < x) : diff --git a/LeanPool/Odlyzko/Numerics/IntegralTail.lean b/LeanPool/Odlyzko/Numerics/IntegralTail.lean index b47e29b8d3..fb631a403f 100644 --- a/LeanPool/Odlyzko/Numerics/IntegralTail.lean +++ b/LeanPool/Odlyzko/Numerics/IntegralTail.lean @@ -19,7 +19,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp /-! TODO: Add doc-string. -/ -@[expose] public section +public section section diff --git a/LeanPool/Odlyzko/Numerics/Tail.lean b/LeanPool/Odlyzko/Numerics/Tail.lean index 03ea2a7d06..6b7afeaa24 100644 --- a/LeanPool/Odlyzko/Numerics/Tail.lean +++ b/LeanPool/Odlyzko/Numerics/Tail.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp /-! TODO: Add doc-string. -/ -@[expose] public section +public section namespace NumberField.Odlyzko diff --git a/LeanPool/Odlyzko/Reduction.lean b/LeanPool/Odlyzko/Reduction.lean index db8055e3d8..da21c78e68 100644 --- a/LeanPool/Odlyzko/Reduction.lean +++ b/LeanPool/Odlyzko/Reduction.lean @@ -9,7 +9,7 @@ public import Mathlib.NumberTheory.NumberField.Discriminant.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section open NumberField Module diff --git a/LeanPool/Odlyzko/TestFunction/Amplitude.lean b/LeanPool/Odlyzko/TestFunction/Amplitude.lean index 8bb81a9de0..6291dcd685 100644 --- a/LeanPool/Odlyzko/TestFunction/Amplitude.lean +++ b/LeanPool/Odlyzko/TestFunction/Amplitude.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section open Set Filter diff --git a/LeanPool/Odlyzko/TestFunction/Basic.lean b/LeanPool/Odlyzko/TestFunction/Basic.lean index b37e5d119b..0141430527 100644 --- a/LeanPool/Odlyzko/TestFunction/Basic.lean +++ b/LeanPool/Odlyzko/TestFunction/Basic.lean @@ -10,7 +10,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section namespace NumberField.Odlyzko @@ -19,11 +19,11 @@ noncomputable def Tartar.weight (x : ℝ) : ℝ := max (1 - x ^ 2) 0 /-- An amplitude used in the Odlyzko-bound argument. -/ -noncomputable def Tartar.amplitude (x : ℝ) : ℝ := +@[expose] noncomputable def Tartar.amplitude (x : ℝ) : ℝ := if x = 0 then 1 else 3 * (Real.sin x - x * Real.cos x) / x ^ 3 /-- A test function used in the Odlyzko-bound argument. -/ -noncomputable def Tartar.testFunction (x : ℝ) : ℝ := +@[expose] noncomputable def Tartar.testFunction (x : ℝ) : ℝ := Tartar.amplitude x ^ 2 @[simp] diff --git a/LeanPool/Odlyzko/TestFunction/Bounds.lean b/LeanPool/Odlyzko/TestFunction/Bounds.lean index 72912f55e0..9b883ca916 100644 --- a/LeanPool/Odlyzko/TestFunction/Bounds.lean +++ b/LeanPool/Odlyzko/TestFunction/Bounds.lean @@ -18,7 +18,7 @@ import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section namespace NumberField.Odlyzko diff --git a/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean b/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean index 3670e68969..cd72660608 100644 --- a/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean +++ b/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Fourier.Convolution /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ open MeasureTheory namespace NumberField.Odlyzko /-- A cosine transform used in the Odlyzko-bound argument. -/ -def Poitou.cosineTransform (f : ℝ → ℝ) (t : ℝ) : ℝ := +@[expose] def Poitou.cosineTransform (f : ℝ → ℝ) (t : ℝ) : ℝ := ∫ x : ℝ, f x * Real.cos (t * x) /-- Conditions on a test function used in Poitou's explicit formula. -/ diff --git a/LeanPool/Odlyzko/TestFunction/Fourier.lean b/LeanPool/Odlyzko/TestFunction/Fourier.lean index 29c1126fd1..b5f518547e 100644 --- a/LeanPool/Odlyzko/TestFunction/Fourier.lean +++ b/LeanPool/Odlyzko/TestFunction/Fourier.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.SpecialFunctions.Integrals.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section section diff --git a/LeanPool/Odlyzko/TestFunction/Quadratic.lean b/LeanPool/Odlyzko/TestFunction/Quadratic.lean index a27ed92390..6c4dd3c545 100644 --- a/LeanPool/Odlyzko/TestFunction/Quadratic.lean +++ b/LeanPool/Odlyzko/TestFunction/Quadratic.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Integrals.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section open MeasureTheory Set diff --git a/LeanPool/Odlyzko/TestFunction/TartarDerivativeBounds.lean b/LeanPool/Odlyzko/TestFunction/TartarDerivativeBounds.lean index f201ee5b29..9deb74a02a 100644 --- a/LeanPool/Odlyzko/TestFunction/TartarDerivativeBounds.lean +++ b/LeanPool/Odlyzko/TestFunction/TartarDerivativeBounds.lean @@ -18,7 +18,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial Supporting definitions and lemmas for the Odlyzko-bound formalization. -/ -@[expose] public section +public section noncomputable section @@ -30,7 +30,7 @@ open scoped Topology namespace NumberField.Odlyzko /-- A tartar amplitude derivative integrand used in the Odlyzko-bound argument. -/ -noncomputable def tartarAmplitudeDerivativeIntegrand (x t : ℝ) : ℝ := +@[expose] noncomputable def tartarAmplitudeDerivativeIntegrand (x t : ℝ) : ℝ := -t * Tartar.weight t * Real.sin (x * t) theorem hasDerivAt_tartarWeight_mul_cos (x t : ℝ) : @@ -229,7 +229,7 @@ theorem hasDerivAt_scaledTartarTestFunction (y x : ℝ) : ring /-- A regularized scaled tartar derivative used in the Odlyzko-bound argument. -/ -noncomputable def regularizedScaledTartarDerivative +@[expose] noncomputable def regularizedScaledTartarDerivative (y δ x : ℝ) : ℝ := (y * deriv Tartar.testFunction (y * x) - 2 * δ * x * scaledTartarTestFunction y x) * diff --git a/LeanPool/Odlyzko/TestFunction/TaylorBound.lean b/LeanPool/Odlyzko/TestFunction/TaylorBound.lean index 69c688b8aa..73ab631aaf 100644 --- a/LeanPool/Odlyzko/TestFunction/TaylorBound.lean +++ b/LeanPool/Odlyzko/TestFunction/TaylorBound.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Integrals.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section namespace NumberField.Odlyzko @@ -79,7 +79,7 @@ open MeasureTheory Set namespace NumberField.Odlyzko /-- A tartar amplitude lower six used in the Odlyzko-bound argument. -/ -noncomputable def tartarAmplitudeLowerSix (x : ℝ) : ℝ := +@[expose] noncomputable def tartarAmplitudeLowerSix (x : ℝ) : ℝ := 1 - x ^ 2 / 10 + x ^ 4 / 280 - x ^ 6 / 15120 private theorem tartarWeight_mul_pow_integrable (n : ℕ) : diff --git a/LeanPool/Odlyzko/Theta/PoissonSummation.lean b/LeanPool/Odlyzko/Theta/PoissonSummation.lean index f3052083f3..bd5300343c 100644 --- a/LeanPool/Odlyzko/Theta/PoissonSummation.lean +++ b/LeanPool/Odlyzko/Theta/PoissonSummation.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -217,7 +217,7 @@ theorem inner_dualRealBasis_apply [InnerProductSpace ℝ E] [FiniteDimensional Basis.coe_dualBasis] /-- A dual lattice used in the Odlyzko-bound argument. -/ -noncomputable def dualLattice [InnerProductSpace ℝ E] +@[expose] noncomputable def dualLattice [InnerProductSpace ℝ E] (L : Submodule ℤ E) : Submodule ℤ E := LinearMap.BilinForm.dualSubmodule (innerₗ E) L @@ -286,7 +286,7 @@ namespace NumberField.Odlyzko variable {E : Type*} [NormedAddCommGroup E] /-- A lattice gaussian used in the Odlyzko-bound argument. -/ -noncomputable def latticeGaussian (a : ℝ) (x : E) : ℂ := +@[expose] noncomputable def latticeGaussian (a : ℝ) (x : E) : ℂ := Complex.exp (-(a : ℂ) * (‖x‖ : ℂ) ^ 2) theorem norm_latticeGaussian (a : ℝ) (x : E) : @@ -355,7 +355,7 @@ namespace NumberField.Odlyzko variable {E : Type*} [NormedAddCommGroup E] /-- A lattice theta used in the Odlyzko-bound argument. -/ -noncomputable def latticeTheta +@[expose] noncomputable def latticeTheta (L : Submodule ℤ E) (a : ℝ) : ℂ := ∑' x : L, latticeGaussian a (x : E) @@ -381,7 +381,7 @@ theorem summable_latticeTheta [NormedSpace ℝ E] [FiniteDimensional ℝ E] summable_latticeGaussian L ha /-- A dual lattice theta used in the Odlyzko-bound argument. -/ -noncomputable def dualLatticeTheta [InnerProductSpace ℝ E] +@[expose] noncomputable def dualLatticeTheta [InnerProductSpace ℝ E] (L : Submodule ℤ E) (a : ℝ) : ℂ := latticeTheta (dualLattice L) a diff --git a/LeanPool/Odlyzko/Theta/TraceDualIdeal.lean b/LeanPool/Odlyzko/Theta/TraceDualIdeal.lean index f64607a425..453694ed52 100644 --- a/LeanPool/Odlyzko/Theta/TraceDualIdeal.lean +++ b/LeanPool/Odlyzko/Theta/TraceDualIdeal.lean @@ -12,7 +12,7 @@ import Mathlib.NumberTheory.NumberField.Discriminant.Different /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -23,7 +23,7 @@ namespace NumberField.Odlyzko variable (K : Type*) [Field K] [NumberField K] /-- A trace dual ideal unit used in the Odlyzko-bound argument. -/ -noncomputable def traceDualIdealUnit +@[expose] noncomputable def traceDualIdealUnit (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : (FractionalIdeal (𝓞 K)⁰ K)ˣ := Units.mk0 diff --git a/LeanPool/Odlyzko/Theta/TraceDualLattice.lean b/LeanPool/Odlyzko/Theta/TraceDualLattice.lean index 030b6c4e6b..68673d5bde 100644 --- a/LeanPool/Odlyzko/Theta/TraceDualLattice.lean +++ b/LeanPool/Odlyzko/Theta/TraceDualLattice.lean @@ -12,7 +12,7 @@ import Mathlib.NumberTheory.NumberField.Discriminant.Basic /-! TODO: Add doc-string. -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ variable (K : Type*) [Field K] [NumberField K] open Classical in /-- An euclidean ideal lattice used in the Odlyzko-bound argument. -/ -noncomputable def euclideanIdealLattice +@[expose] noncomputable def euclideanIdealLattice (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : Submodule ℤ (mixedEmbedding.euclidean.mixedSpace K) := ZLattice.comap ℝ (mixedEmbedding.idealLattice K I) @@ -210,7 +210,7 @@ variable (K : Type*) [Field K] [NumberField K] open Classical in /-- A divide by sqrt two used in the Odlyzko-bound argument. -/ -noncomputable def divideBySqrtTwo : ℂ ≃L[ℝ] ℂ := +@[expose] noncomputable def divideBySqrtTwo : ℂ ≃L[ℝ] ℂ := ContinuousLinearEquiv.smulLeft (R₁ := ℝ) (M₁ := ℂ) (Units.mk0 (Real.sqrt 2)⁻¹ (inv_ne_zero (ne_of_gt (Real.sqrt_pos.2 (by norm_num))))) @@ -226,14 +226,14 @@ theorem divideBySqrtTwo_symm_apply (z : ℂ) : open Classical in /-- An unscale complex coordinates used in the Odlyzko-bound argument. -/ -noncomputable def unscaleComplexCoordinates : +@[expose] noncomputable def unscaleComplexCoordinates : ({w : InfinitePlace K // IsComplex w} → ℂ) ≃L[ℝ] ({w : InfinitePlace K // IsComplex w} → ℂ) := ContinuousLinearEquiv.piCongrRight fun _ ↦ divideBySqrtTwo open Classical in /-- A trace to mixed used in the Odlyzko-bound argument. -/ -noncomputable def traceToMixed : +@[expose] noncomputable def traceToMixed : mixedEmbedding.euclidean.mixedSpace K ≃L[ℝ] mixedEmbedding.mixedSpace K := (mixedEmbedding.euclidean.toMixed K).trans @@ -243,13 +243,13 @@ noncomputable def traceToMixed : open Classical in /-- A trace embedding used in the Odlyzko-bound argument. -/ -noncomputable def traceEmbedding (x : K) : +@[expose] noncomputable def traceEmbedding (x : K) : mixedEmbedding.euclidean.mixedSpace K := (traceToMixed K).symm (mixedEmbedding K x) open Classical in /-- A trace ideal lattice used in the Odlyzko-bound argument. -/ -noncomputable def traceIdealLattice +@[expose] noncomputable def traceIdealLattice (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : Submodule ℤ (mixedEmbedding.euclidean.mixedSpace K) := ZLattice.comap ℝ (mixedEmbedding.idealLattice K I) @@ -300,7 +300,7 @@ theorem exists_traceEmbedding_eq_of_mem_traceIdealLattice open Classical in /-- A trace conjugation used in the Odlyzko-bound argument. -/ -noncomputable def traceConjugation : +@[expose] noncomputable def traceConjugation : mixedEmbedding.euclidean.mixedSpace K ≃ₗᵢ[ℝ] mixedEmbedding.euclidean.mixedSpace K := LinearIsometryEquiv.withLpProdCongr 2 @@ -468,7 +468,7 @@ theorem span_traceDual_basisOfFractionalIdeal open Classical in /-- A trace embedding int linear map used in the Odlyzko-bound argument. -/ -noncomputable def traceEmbeddingIntLinearMap : +@[expose] noncomputable def traceEmbeddingIntLinearMap : K →ₗ[ℤ] mixedEmbedding.euclidean.mixedSpace K := ((traceToMixed K).symm.toLinearEquiv.toLinearMap.restrictScalars ℤ).comp (mixedEmbedding K).toIntAlgHom.toLinearMap @@ -481,7 +481,7 @@ theorem traceEmbeddingIntLinearMap_apply (x : K) : open Classical in /-- A conjugate trace ideal lattice used in the Odlyzko-bound argument. -/ -noncomputable def conjugateTraceIdealLattice +@[expose] noncomputable def conjugateTraceIdealLattice (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : Submodule ℤ (mixedEmbedding.euclidean.mixedSpace K) := (traceIdealLattice K I).map diff --git a/LeanPool/OrderPQ.lean b/LeanPool/OrderPQ.lean index d689211886..685ee059eb 100644 --- a/LeanPool/OrderPQ.lean +++ b/LeanPool/OrderPQ.lean @@ -31,7 +31,7 @@ Tags: group-theory, finite-groups, semidirect-products MSC: 20D20, 20E22, 20D60 -/ -@[expose] public section +public section /-! ## Provenance and scope diff --git a/LeanPool/OrderPQ/Basic.lean b/LeanPool/OrderPQ/Basic.lean index 9edcda8ee5..7a579ccc95 100644 --- a/LeanPool/OrderPQ/Basic.lean +++ b/LeanPool/OrderPQ/Basic.lean @@ -23,7 +23,7 @@ import Mathlib.Topology.MetricSpace.Bounded # LeanPool.OrderPQ.Basic -/ -@[expose] public section +public section attribute [local implicit_reducible] MulZMod instMulMulZMod instMulOneClassMulZMod instGroupMulZMod diff --git a/LeanPool/OrderPQ/IsCyclic.lean b/LeanPool/OrderPQ/IsCyclic.lean index 3eec13eec5..bda8c2232f 100644 --- a/LeanPool/OrderPQ/IsCyclic.lean +++ b/LeanPool/OrderPQ/IsCyclic.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.OrderPQ.IsCyclic -/ -@[expose] public section +public section section MulEquiv namespace IsCyclic diff --git a/LeanPool/OrderPQ/Main.lean b/LeanPool/OrderPQ/Main.lean index 4a5df5fd43..2deec079fe 100644 --- a/LeanPool/OrderPQ/Main.lean +++ b/LeanPool/OrderPQ/Main.lean @@ -19,7 +19,7 @@ import Mathlib.Topology.MetricSpace.Bounded # LeanPool.OrderPQ.Main -/ -@[expose] public section +public section attribute [local implicit_reducible] MulZMod instMulMulZMod instMulOneClassMulZMod instGroupMulZMod diff --git a/LeanPool/OrderPQ/MonoidHom.lean b/LeanPool/OrderPQ/MonoidHom.lean index 605eb3fc06..3fbcfe8c81 100644 --- a/LeanPool/OrderPQ/MonoidHom.lean +++ b/LeanPool/OrderPQ/MonoidHom.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.OrderPQ.MonoidHom -/ -@[expose] public section +public section lemma Set.nat_card_range_of_injective {α β : Type*} (f : α → β) (hf : Function.Injective f) : Nat.card (range f) = Nat.card α := diff --git a/LeanPool/OrderPQ/MulZMod.lean b/LeanPool/OrderPQ/MulZMod.lean index d23a2e9555..8afcf57625 100644 --- a/LeanPool/OrderPQ/MulZMod.lean +++ b/LeanPool/OrderPQ/MulZMod.lean @@ -23,12 +23,12 @@ import Mathlib.Topology.MetricSpace.Bounded # LeanPool.OrderPQ.MulZMod -/ -@[expose] public section +public section section MulZMod /-- `ZMod n` viewed as a multiplicative group. -/ -def MulZMod (n : ℕ) : Type := Multiplicative (ZMod n) +@[expose] def MulZMod (n : ℕ) : Type := Multiplicative (ZMod n) attribute [local implicit_reducible] MulZMod @@ -72,7 +72,7 @@ lemma unitOfNeZero_val (x : (ZMod p)ˣ) : unitOfNeZero x (Units.ne_zero _) = x : exact val_unitOfNeZero _ (Units.ne_zero _) /-- Multiplication by a unit in `ZMod p` as an additive automorphism. -/ -@[simps -isSimp] +@[expose, simps -isSimp] def addAutOfUnit (x : (ZMod p)ˣ) : AddAut (ZMod p) where toFun a := x.val * a invFun a := x.inv * a diff --git a/LeanPool/OrderPQ/PrimeOrder.lean b/LeanPool/OrderPQ/PrimeOrder.lean index 3eb4ff0000..c5a5a5ef93 100644 --- a/LeanPool/OrderPQ/PrimeOrder.lean +++ b/LeanPool/OrderPQ/PrimeOrder.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.OrderPQ.PrimeOrder -/ -@[expose] public section +public section lemma ne_iff_eq_of_or_and_ne {α : Type*} {a b c : α} (h1 : a = b ∨ a = c) (h2 : b ≠ c) : a ≠ b ↔ a = c := diff --git a/LeanPool/OrderPQ/SemidirectProduct.lean b/LeanPool/OrderPQ/SemidirectProduct.lean index 37f199e941..ffd6df8d3d 100644 --- a/LeanPool/OrderPQ/SemidirectProduct.lean +++ b/LeanPool/OrderPQ/SemidirectProduct.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic.Group # LeanPool.OrderPQ.SemidirectProduct -/ -@[expose] public section +public section variable {N₁ N₂ H₁ H₂ : Type*} [Group N₁] [Group N₂] [Group H₁] [Group H₂] @@ -61,7 +61,7 @@ noncomputable def mulEquivSemidirectProduct group /-- If `H ≤ K` are subgroups of `G`, then `H.subgroupOf K` is canonically isomorphic to `H`. -/ -@[simps] +@[expose, simps] def Subgroup.subgroupOfMulEquiv {G : Type*} [Group G] (H K : Subgroup G) (h : H ≤ K) : H.subgroupOf K ≃* H where toFun x := ⟨x.1.1, mem_subgroupOf.mp x.2⟩ diff --git a/LeanPool/OrderPQ/TorsionBy.lean b/LeanPool/OrderPQ/TorsionBy.lean index 538ac57a46..f040a32948 100644 --- a/LeanPool/OrderPQ/TorsionBy.lean +++ b/LeanPool/OrderPQ/TorsionBy.lean @@ -17,14 +17,14 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.OrderPQ.TorsionBy -/ -@[expose] public section +public section variable {α : Type*} [CommGroup α] variable (α) in /-- The subgroup of elements `a` of a commutative group `α` satisfying `a ^ d = 1`. -/ -@[to_additive (attr := simps) -/-- The subgroup of elements `a` of an additive commutative group `α` satisfying `d • a = 0`. -/] +@[expose, to_additive (attr := simps) + /-- The subgroup of elements `a` of `α` satisfying `d • a = 0`. -/] def Subgroup.torsionBy' (d : ℕ) : Subgroup α where carrier := {a | a ^ d = 1} mul_mem' {x y} hx hy := by diff --git a/LeanPool/PCFTheory.lean b/LeanPool/PCFTheory.lean index d24c4353c3..cf53a8b410 100644 --- a/LeanPool/PCFTheory.lean +++ b/LeanPool/PCFTheory.lean @@ -19,7 +19,7 @@ Tags: set-theory, cardinal-arithmetic, club-guessing MSC: 03E04, 03E10, 03E55 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PCFTheory/Background.lean b/LeanPool/PCFTheory/Background.lean index 0ac8ac86b2..71e1e77125 100644 --- a/LeanPool/PCFTheory/Background.lean +++ b/LeanPool/PCFTheory/Background.lean @@ -16,4 +16,4 @@ public import LeanPool.PCFTheory.Background.Topology Import-only index for the `Background` directory of the PCF-theory import. -/ -@[expose] public section +public section diff --git a/LeanPool/PCFTheory/Background/Club.lean b/LeanPool/PCFTheory/Background/Club.lean index 4d5cae7f78..d4030e146c 100644 --- a/LeanPool/PCFTheory/Background/Club.lean +++ b/LeanPool/PCFTheory/Background/Club.lean @@ -27,7 +27,7 @@ This file sets up the basic theory of clubs (closed and unbounded sets) and stat * `isClub_sInter`: The intersection of fewer than `o.cof` clubs in `o` is a club in `o`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PCFTheory/Background/Cofinality.lean b/LeanPool/PCFTheory/Background/Cofinality.lean index 80ad876d5b..c440aab84a 100644 --- a/LeanPool/PCFTheory/Background/Cofinality.lean +++ b/LeanPool/PCFTheory/Background/Cofinality.lean @@ -14,7 +14,7 @@ A more general universe version of `iSup_lt_ord_lift` and a related corollary phrased in terms of `Iio`. -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/PCFTheory/Background/Ordinal.lean b/LeanPool/PCFTheory/Background/Ordinal.lean index 2128a5cc4a..c6db7913f7 100644 --- a/LeanPool/PCFTheory/Background/Ordinal.lean +++ b/LeanPool/PCFTheory/Background/Ordinal.lean @@ -15,7 +15,7 @@ Auxiliary results about ordinals and recursion on bounded ordinals used in the PCF-theory formalization. -/ -@[expose] public section +public section noncomputable section @@ -39,7 +39,7 @@ theorem succ_Iio {α : Type*} [PartialOrder α] [SuccOrder α] {a : α} (h : IsS Subtype.val_inj.mp <| coe_succ_Iio h /-- The order isomorphism between ℕ and the first ω ordinals. -/ -@[simps! apply] +@[expose, simps! apply] def relIsoNatOmega0 : ℕ ≃o Iio ω where toFun n := ⟨n, natCast_lt_omega0 n⟩ invFun n := Classical.choose (lt_omega0.1 n.2) diff --git a/LeanPool/PCFTheory/Background/Topology.lean b/LeanPool/PCFTheory/Background/Topology.lean index 942b6d4e1c..6c40f1cd07 100644 --- a/LeanPool/PCFTheory/Background/Topology.lean +++ b/LeanPool/PCFTheory/Background/Topology.lean @@ -14,7 +14,7 @@ public import Mathlib.Topology.DerivedSet A handful of order-topological facts used to set up the theory of clubs. -/ -@[expose] public section +public section open Set Order Cardinal Filter Set.Notation @@ -33,6 +33,7 @@ API the rest of the development relies on. /-- An ordinal is an accumulation point of a set of ordinals if it is positive and there are elements in the set arbitrarily close to the ordinal from below. -/ +@[expose] def IsAccPt (o : Ordinal) (S : Set Ordinal) : Prop := AccPt o (𝓟 S) diff --git a/LeanPool/PCFTheory/ClubGuessing.lean b/LeanPool/PCFTheory/ClubGuessing.lean index 42b73f68d6..ac046426fd 100644 --- a/LeanPool/PCFTheory/ClubGuessing.lean +++ b/LeanPool/PCFTheory/ClubGuessing.lean @@ -38,7 +38,7 @@ There are many existence results on club guessing sequences. The one we need is below `Ϟ`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PDL/AllPdlRule.lean b/LeanPool/PDL/AllPdlRule.lean index 5ea169d54b..ba3e205907 100644 --- a/LeanPool/PDL/AllPdlRule.lean +++ b/LeanPool/PDL/AllPdlRule.lean @@ -13,7 +13,7 @@ public import LeanPool.PDL.Tableau Similar to `LocalTableau.all`, this is needed to define `BuildTree` as a finite tree. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Beth.lean b/LeanPool/PDL/Beth.lean index 5b903d6723..0d83fd9509 100644 --- a/LeanPool/PDL/Beth.lean +++ b/LeanPool/PDL/Beth.lean @@ -10,7 +10,7 @@ public import LeanPool.PDL.Interpolation.Theorem /-! # Beth Definability (Corollary 7.5) -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Completeness/BuildTree.lean b/LeanPool/PDL/Completeness/BuildTree.lean index a69e7fd00d..1b2549c06e 100644 --- a/LeanPool/PDL/Completeness/BuildTree.lean +++ b/LeanPool/PDL/Completeness/BuildTree.lean @@ -12,7 +12,7 @@ public import LeanPool.PDL.PdlSteps /-! # From winning strategies to model graphs, part 1: BuildTree and PreState (Section 6.3) -/ -@[expose] public section +public section namespace PDL @@ -22,7 +22,7 @@ open Lean4GlCoalgebras /-- Open local tableaux for `X` that are *the* uniform one, i.e. `uniLocalTab X`. This type has at most one element, and it is inhabited iff `uniLocalTab X` has an end node. -/ -def UniOpenLT (X : Sequent) : Type := +@[expose] def UniOpenLT (X : Sequent) : Type := {lt : LocalTableau X // endNodesOf lt ≠ {} ∧ lt = uniLocalTab X} instance UniOpenLT.instDecidableEq {X} : DecidableEq (UniOpenLT X) := @@ -91,14 +91,14 @@ open Lean4GlCoalgebras mutual /-- Manual replacement for `sizeOf (bt : BuildTree)` so we also count the `next` parts. -/ -def BuildTree.size : BuildTree H X → Nat +@[expose] def BuildTree.size : BuildTree H X → Nat | .loc _ _ next => 1 + ((UniOpenLT.all X).map (fun lt => (next lt).size)).sum | .pdl _ _ next => 1 + ((PdlRule.all X).map (fun ⟨Y,r⟩ => (next Y r).size)).sum | .freeRepeat _ => 1 | .openLeaf _ _ => 1 /-- The size of the continuation selected by Builder. -/ -def BuildChoice.size {YS} : BuildChoice H X YS → Nat +@[expose] def BuildChoice.size {YS} : BuildChoice H X YS → Nat | .pick _ bt_Y => bt_Y.size end @@ -147,7 +147,7 @@ lemma BuildChoice.frth_mem {H X YS} {bc : BuildChoice H X YS} : bc.4 ∈ YS := b cases bc; assumption /-- Whether this strategy tree is a leaf justified by a free repeat. -/ -def BuildTree.isFreeRepeat {H X} : BuildTree H X → Prop +@[expose] def BuildTree.isFreeRepeat {H X} : BuildTree H X → Prop | BuildTree.freeRepeat _ => True | _ => False @@ -344,14 +344,14 @@ def Match.length {H : History} {X : Sequent} {bt : BuildTree H X} : Match bt → | .pdl tail => tail.length + 1 /-- The subtree reached by a match, together with its history and root sequent. -/ -@[implicit_reducible] +@[implicit_reducible, expose] def Match.btAt {H X} {bt : BuildTree H X} : Match bt → Σ H' Y, BuildTree H' Y | .nil => ⟨_, _, bt⟩ | .loc tail => btAt tail | .pdl tail => btAt tail /-- The sequent reached at the end of a match. -/ -def Match.endSeq {bt : BuildTree H X} (m : Match bt) : Sequent := m.btAt.2.1 +@[expose] def Match.endSeq {bt : BuildTree H X} (m : Match bt) : Sequent := m.btAt.2.1 /- All possible Matches in a given BuildTree. -/ /-- Enumerate every finite match in a strategy tree. -/ @@ -391,7 +391,7 @@ theorem Match.all_spec {H X} {bt : BuildTree H X} {m} : simp /-- Whether the subtree reached by a match is an open leaf. -/ -def Match.isOpenLeaf {H X} {bt : BuildTree H X} {m : Match bt} : Prop := +@[expose] def Match.isOpenLeaf {H X} {bt : BuildTree H X} {m : Match bt} : Prop := match (btAt m) with | ⟨_, _, .openLeaf _ _⟩ => True | _ => False instance instDecidableIsOpenLeaf {H X} {bt : BuildTree H X} {m : Match bt} : Decidable @@ -404,7 +404,7 @@ instance instDecidableIsOpenLeaf {H X} {bt : BuildTree H X} {m : Match bt} : Dec try exact instDecidableFalse /-- Whether the subtree reached by a match is a free-repeat leaf. -/ -def Match.isFreeRepeat {H X} {bt : BuildTree H X} (m : Match bt) : Prop := +@[expose] def Match.isFreeRepeat {H X} {bt : BuildTree H X} (m : Match bt) : Prop := match (btAt m) with | ⟨_, _, .freeRepeat _⟩ => True | _ => False instance instMatchDecidableIsFreeRepeat {H X} {bt : BuildTree H X} {m : Match bt} : @@ -660,7 +660,7 @@ We collect the sequents along such paths directly by induction on the `BuildTree /-- Collect pre-states in the whole BuildTree. The local pre-states come from paths in a local tableau, and PDL pre-states each consist of just a single node. -/ -def BuildTree.collect {H X} : (bt : BuildTree H X) → Finset (List Sequent) +@[expose] def BuildTree.collect {H X} : (bt : BuildTree H X) → Finset (List Sequent) | .loc _ _ next => (UniOpenLT.all X).toFinset.sup fun lt => lt.1.pathsTo (next lt).4 ∪ (next lt).6.collect | .pdl _ _ next => { [X] } ∪ (PdlRule.all X).toFinset.sup fun ⟨Y,r⟩ => (next Y r).collect @@ -741,7 +741,7 @@ lemma BuildTree.collect_nonempty (bt : BuildTree [] X) : /-! ## Pre-states (Def 6.13) -/ /-- A pre-state is a list of sequents collected from a `BuildTree`. -/ -def PreState {H X} (bt : BuildTree H X) : Type := Subtype (· ∈ bt.collect) +@[expose] def PreState {H X} (bt : BuildTree H X) : Type := Subtype (· ∈ bt.collect) lemma PreState.nonempty {H X} {bt : BuildTree H X} {π : PreState bt} : π.val ≠ [] := by rcases π with ⟨L, L_in⟩ @@ -773,11 +773,12 @@ decreasing_by -- almost same termination proof as for Match.all etc above :-) /-- Λ(π) gets all formulas for a pre-state but keep the information what is loaded. Returns the `WhateverFormula` type so that lemmas like 6.15 and 6.18 are sayable. -/ +@[expose] def PreState.wForms {H X} {bt : BuildTree H X} (π : PreState bt) : Finset WhateverFormula := pathWForms π.val /-- Λ⁻(π) gets all formulas from a pre-state π, via unloading if needed. -/ -def PreState.forms {H X} {bt : BuildTree H X} (π : PreState bt) : Finset Formula := +@[expose] def PreState.forms {H X} {bt : BuildTree H X} (π : PreState bt) : Finset Formula := pathForms π.val @[simp] diff --git a/LeanPool/PDL/Completeness/BuildTreeExistence.lean b/LeanPool/PDL/Completeness/BuildTreeExistence.lean index 1ece72a2cd..b43dcff52f 100644 --- a/LeanPool/PDL/Completeness/BuildTreeExistence.lean +++ b/LeanPool/PDL/Completeness/BuildTreeExistence.lean @@ -14,7 +14,7 @@ This continues `Pdl/BuildTreeModel.lean`. Here we prove the existence lemmas 6.18, 6.19 and 6.20 that are needed for Theorem 6.21 (`strmg`). -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Completeness/BuildTreeModel.lean b/LeanPool/PDL/Completeness/BuildTreeModel.lean index 67e5964c78..108e83c275 100644 --- a/LeanPool/PDL/Completeness/BuildTreeModel.lean +++ b/LeanPool/PDL/Completeness/BuildTreeModel.lean @@ -15,15 +15,14 @@ obtained from a `BuildTree` (Definition 6.17) and provide the infrastructure tha in `Pdl/BuildTreeExistence.lean` to prove the existence lemmas. -/ -@[expose] public section +public section namespace PDL /-! ## Defining The Model Graph -/ /-- Definition 6.17 to get model graph from strategy tree. -/ -@[simp] -def BuildTree.toModel {X} (bt : BuildTree [] X) : +@[expose, simp] def BuildTree.toModel {X} (bt : BuildTree [] X) : (Σ W : Finset (Finset Formula), KripkeModel W) := ⟨ bt.collect.attach.image PreState.forms -- W -- NOTE .forms here, not .wforms , { val := fun X p => Formula.atom_prop p ∈ X.1 -- valuation V(p) @@ -49,7 +48,7 @@ pre-state collected at the node we arrive at. The lemmas in this section provide for these steps. -/ /-- The world of the model graph given by a pre-state. -/ -def PreState.toW {X} {bt : BuildTree [] X} (π : PreState bt) : +@[expose] def PreState.toW {X} {bt : BuildTree [] X} (π : PreState bt) : { w : Finset Formula // w ∈ bt.toModel.1 } := ⟨π.forms, π.mem_toModel⟩ @[simp] diff --git a/LeanPool/PDL/Completeness/Modelgraphs.lean b/LeanPool/PDL/Completeness/Modelgraphs.lean index 2728eb0d92..aaa7ff3599 100644 --- a/LeanPool/PDL/Completeness/Modelgraphs.lean +++ b/LeanPool/PDL/Completeness/Modelgraphs.lean @@ -13,7 +13,7 @@ public import LeanPool.PDL.Local.Rules /-! # Model Graphs (Section 7.1) -/ -@[expose] public section +public section namespace PDL @@ -44,7 +44,7 @@ open Modelgraphs the conditions (a) to (b). See also [MB1988] Def 19 on page 31 where (a)-(b) are named (i)-(iv). Note: In MB item (b) aka (ii) only has `→`. We use `↔` similar to [BRV2001] Def 4.18 and 4.84. Note: In item (c) `a` is atomic, but in item (d) `α` is any program. -/ -def ModelGraph (W : Finset (Finset Formula)) := +@[expose] def ModelGraph (W : Finset (Finset Formula)) := let a := ∀ X : W, saturated X.val ∧ locallyConsistent X let b M := ∀ X p, (·p : Formula) ∈ X.val ↔ M.val X p let c M := ∀ X Y a P, M.Rel a X Y → (⌈·a⌉P) ∈ X.val → P ∈ Y.val @@ -447,6 +447,7 @@ def Qtests {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) (F : Lis | v, w => v == w ∧ ∀ τ ∈ F, Q R (?' τ) v w /-- Q_δ for a list `δ` of programs. -/ +@[expose] def Qsteps {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) : List Program → W → W → Prop | [], v, w => v == w | (α :: δ), v, w => Relation.Comp (Q R α) (Qsteps R δ) v w @@ -467,7 +468,7 @@ theorem Qsteps_append : Qsteps R (δ1 ++ δ2) v w ↔ ∃ u, Qsteps R δ1 v u · aesop /-- Q_Fδ for a list of tests F and a list or programs δ. -/ -def Qcombo {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) +@[expose] def Qcombo {W : Finset (Finset Formula)} (R : Nat → W → W → Prop) (F : List Formula) (δ : List Program) : W → W → Prop := Relation.Comp (Qtests R F) (Qsteps R δ) diff --git a/LeanPool/PDL/Completeness/TableauGame.lean b/LeanPool/PDL/Completeness/TableauGame.lean index 6e42f027f9..f633e999d6 100644 --- a/LeanPool/PDL/Completeness/TableauGame.lean +++ b/LeanPool/PDL/Completeness/TableauGame.lean @@ -17,7 +17,7 @@ public import LeanPool.PDL.StayingInFL /-! # The Tableau Game (Section 6.2) -/ -@[expose] public section +public section namespace PDL @@ -55,7 +55,7 @@ inductive BuilderPos (H : History) (X : Sequent) : Type where deriving DecidableEq /-- Game position where either Prover (`isLeft`) or Builder (`isRight`) should make a move. -/ -@[implicit_reducible] +@[implicit_reducible, expose] def GamePos := Σ H X, (ProverPos H X ⊕ BuilderPos H X) deriving DecidableEq @@ -104,7 +104,7 @@ def Move.isModal {pos newPos : GamePos} : Move pos newPos → Prop | .buEnd _ => False /-- Existence of a legal move between two game positions. -/ -def move (old : GamePos) (new : GamePos) : Prop := Nonempty (Move old new) +@[expose] def move (old : GamePos) (new : GamePos) : Prop := Nonempty (Move old new) lemma move_then_no_frep {H X next} {p : (ProverPos H X ⊕ BuilderPos H X)} : move ⟨H, X, p⟩ next → ¬ (rep H X ∧ X.isFree) := by @@ -114,8 +114,7 @@ lemma move_then_no_frep {H X next} {p : (ProverPos H X ⊕ BuilderPos H X)} : /-- The finite set of moves, given as a function instead of a relation. With `move_of_mem_theMoves` and `mem_theMoves_of_move` this agrees with `move`. -/ -@[simp] -def theMoves : GamePos → Finset GamePos +@[expose, simp] def theMoves : GamePos → Finset GamePos -- ProverPos: | ⟨H, X, .inl (.frep _)⟩ => ∅ -- no moves ⇒ Builder wins | ⟨H, X, .inl (.bas _ Xbasic)⟩ => @@ -1172,7 +1171,7 @@ lemma matchesFinite : WellFounded (Function.swap move) := by /-! ## Actual Game Definition -/ /-- The game defined in Section 6.2. -/ -@[instance_reducible] +@[instance_reducible, expose] def tableauGame : Game where Pos := GamePos turn | ⟨_, _, .inl _⟩ => Prover @@ -1435,7 +1434,7 @@ decreasing_by /-- The starting position for the given sequent. With an empty history and using `posOf` to determine the first `GamePos`. -/ -def startPos (X : Sequent) : GamePos := ⟨[], X, posOf [] X⟩ +@[expose] def startPos (X : Sequent) : GamePos := ⟨[], X, posOf [] X⟩ /-- We start with a prover position, because when the history is empty we can't have any repeat. -/ lemma posOf_for_startPos (X : Sequent) : ∃ proPos, posOf [] X = Sum.inl proPos := by diff --git a/LeanPool/PDL/Completeness/Theorem.lean b/LeanPool/PDL/Completeness/Theorem.lean index cb3592676b..77a79b54ac 100644 --- a/LeanPool/PDL/Completeness/Theorem.lean +++ b/LeanPool/PDL/Completeness/Theorem.lean @@ -11,7 +11,7 @@ public import LeanPool.PDL.Completeness.BuildTreeExistence /-! # Completeness Proof (Section 6.4) -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Discon.lean b/LeanPool/PDL/Discon.lean index ba253eb074..8276ac5cb9 100644 --- a/LeanPool/PDL/Discon.lean +++ b/LeanPool/PDL/Discon.lean @@ -15,15 +15,14 @@ public import Mathlib.Data.Finset.Sort Here we define ⋀ and ⋁ on formulas and seveal helper lemmas. -/ -@[expose] public section +public section namespace PDL /-! ## Conjunction -/ /-- Conjunction of a list of formulas, with the empty conjunction equal to truth. -/ -@[simp] -def con : List Formula → Formula +@[expose, simp] def con : List Formula → Formula | [] => ⊤ | [f] => f | f :: rest => f⋀con rest @@ -93,8 +92,7 @@ theorem Finset.in_voc_con n (X : Finset Formula) : /-! ## Disjunction -/ /-- Disjunction of a list of formulas, with the empty disjunction equal to falsity. -/ -@[simp] -def dis : List Formula → Formula +@[expose, simp] def dis : List Formula → Formula | [] => ⊥ | [f] => f | f :: rest => f ⋁ dis rest diff --git a/LeanPool/PDL/Distance.lean b/LeanPool/PDL/Distance.lean index 07366b8ccf..d93226f639 100644 --- a/LeanPool/PDL/Distance.lean +++ b/LeanPool/PDL/Distance.lean @@ -17,7 +17,7 @@ Here we also use them to state and prove `localLoadedDiamondList`, a local versi of the `loadedDiamondPaths` lemma that is part of the Soundness proof in Section 6. -/ -@[expose] public section +public section namespace PDL @@ -103,7 +103,7 @@ theorem star_relate_of_Chain : List.IsChain (relate M α) (w :: l ++ [v]) → re open Classical in /-- The recursively weighted distance of a program between two worlds. -/ -noncomputable def distance {W} (M : KripkeModel W) (α : Program) (w v : W) : ℕ∞ := +@[expose] noncomputable def distance {W} (M : KripkeModel W) (α : Program) (w v : W) : ℕ∞ := match α with | ·_ => ite (relate M α w v) 1 ⊤ | ?'_ => ite (relate M α w v) 0 ⊤ diff --git a/LeanPool/PDL/FischerLadner.lean b/LeanPool/PDL/FischerLadner.lean index 6de9aca854..15e1ba4481 100644 --- a/LeanPool/PDL/FischerLadner.lean +++ b/LeanPool/PDL/FischerLadner.lean @@ -26,7 +26,7 @@ but unfinished is in `Unused/FischerLadnerViaPreForms.lean`. -/ -@[expose] public section +public section namespace PDL @@ -47,7 +47,7 @@ def FL : Formula → List Formula /-- The Fischer-Ladner closure of a box formula, not recursing into the formula after the box. -/ -def FLb : Program → Formula → List Formula +@[expose] def FLb : Program → Formula → List Formula | ·a, φ => [ ⌈·a⌉φ, ~⌈·a⌉φ ] | α⋓β, φ => [ ⌈α⋓β⌉φ, ~⌈α⋓β⌉φ ] ++ FLb α φ ++ FLb β φ | α;'β, φ => [ ⌈α;'β⌉φ, ~⌈α;'β⌉φ ] ++ FLb α (⌈β⌉φ) ++ FLb β φ @@ -63,7 +63,7 @@ namespace PDL /-! ## Lemmas -/ /-- Whether a formula has an outer negation constructor. -/ -def isNeg : Formula → Prop +@[expose] def isNeg : Formula → Prop | ~_ => True | _ => False @@ -232,7 +232,7 @@ lemma FL_box_star {φ α ψ} : /-! ## Closure of a list -/ /-- Concatenate the Fischer-Ladner closures of every formula in a list. -/ -def FLL (L : List Formula) : List Formula := L.flatMap FL +@[expose] def FLL (L : List Formula) : List Formula := L.flatMap FL @[simp] lemma FLL_refl_sub {L} : L ⊆ FLL L := by induction L <;> simp_all [FLL] @@ -291,7 +291,7 @@ namespace Finset open PDL /-- The union of the Fischer-Ladner closures of every formula in a finset. -/ -def FL (X : Finset Formula) : Finset Formula := +@[expose] def FL (X : Finset Formula) : Finset Formula := X.sup (fun φ => (_root_.PDL.FL φ).toFinset) @[simp] diff --git a/LeanPool/PDL/Flip.lean b/LeanPool/PDL/Flip.lean index 71c6cd5cf9..05db27b82a 100644 --- a/LeanPool/PDL/Flip.lean +++ b/LeanPool/PDL/Flip.lean @@ -18,12 +18,12 @@ For the case where the loaded formula is on the left, we flip the tableau left-t The lemmas here then allow us to prove `clusterInterpolation` from `clusterInterpolationRight`. -/ -@[expose] public section +public section namespace PDL /-- Exchange the side of an optional loaded formula. -/ -def Olf.flip : Olf → Olf := Option.map Sum.swap +@[expose] def Olf.flip : Olf → Olf := Option.map Sum.swap @[simp] lemma Olf.flip_inj {O1 O2 : Olf} : O1.flip = O2.flip ↔ O1 = O2 := by @@ -37,7 +37,7 @@ lemma Olf.flip_flip {O : Olf} : O.flip.flip = O := by lemma Olf.flip_none : Olf.flip none = none := by simp [Olf.flip] /-- Exchange both sequent components and the side of its loaded formula. -/ -def Sequent.flip : Sequent → Sequent := fun ⟨L, R, O⟩ => ⟨R, L, O.flip⟩ +@[expose] def Sequent.flip : Sequent → Sequent := fun ⟨L, R, O⟩ => ⟨R, L, O.flip⟩ @[simp] lemma Sequent.flip_right {X : Sequent} : X.flip.right = X.left := by @@ -134,7 +134,7 @@ lemma basic_flip {X : Sequent} : X.flip.basic ↔ X.basic := by · aesop /-- Reflect a local rule by exchanging its left and right components. -/ -def LocalRule.flip {Lcond Ocond Rcond ress} (lr : LocalRule (Lcond, Rcond, Ocond) ress) : +@[expose] def LocalRule.flip {Lcond Ocond Rcond ress} (lr : LocalRule (Lcond, Rcond, Ocond) ress) : LocalRule (Rcond, Lcond, Ocond.flip) (ress.image Sequent.flip) := by cases lr case oneSidedL YS orule YS_def => @@ -165,7 +165,7 @@ lemma LocalRule.flip_flip {Lcond Ocond Rcond ress} (lr : LocalRule (Lcond, Rcond cases lr <;> simp_all [LocalRule.flip] <;> grind /-- Note: is it possible and useful to rewrite this in more term and less tactic mode? -/ -def LocalRuleApp.flip : LocalRuleApp → LocalRuleApp := by +@[expose] def LocalRuleApp.flip : LocalRuleApp → LocalRuleApp := by rintro ⟨L, R, O, Lcond, Rcond, Ocond, ress, rule, C, hC, preconditionProof⟩ refine @LocalRuleApp.mk R L O.flip Rcond Lcond Ocond.flip _ rule.flip (C.image Sequent.flip) ?_ ?_ @@ -197,7 +197,7 @@ lemma Sequent.flip_mem_of_mem_image_flip {B : Finset Sequent} {Y : Sequent} : Y ∈ B.image Sequent.flip → Y.flip ∈ B := by aesop /-- Reflect every rule and branch of a local tableau. -/ -def LocalTableau.flip {X} : LocalTableau X → LocalTableau X.flip +@[expose] def LocalTableau.flip {X} : LocalTableau X → LocalTableau X.flip | (@byLocalRule X lra X_def next) => .byLocalRule lra.flip (by subst X_def; simp [LocalRuleApp.flip, Sequent.flip]) (fun Y Y_in => @@ -349,7 +349,7 @@ lemma flprep_flip {Hist} : exact ⟨this⟩ /-- Exchange the left and right sides throughout a tableau. -/ -def Tableau.flip {Hist X} : Tableau Hist X → Tableau (Hist.map Sequent.flip) X.flip +@[expose] def Tableau.flip {Hist X} : Tableau Hist X → Tableau (Hist.map Sequent.flip) X.flip | .loc nflprep nbas lt next => .loc (by simp only [flprep_flip]; exact nflprep) (by simp only [basic_flip]; exact nbas) lt.flip @@ -396,7 +396,7 @@ lemma Tableau.flip_flip {Hist X} {tab : Tableau Hist X} : grind [Tableau.flip, LoadedPathRepeat.flip_flip] /-- Map a tableau path to the corresponding path in the reflected tableau. -/ -def PathIn.flip {Hist X} {tab : Tableau Hist X} : PathIn tab → PathIn tab.flip +@[expose] def PathIn.flip {Hist X} {tab : Tableau Hist X} : PathIn tab → PathIn tab.flip | .nil => .nil | @PathIn.loc _ _ nflprep Xnbas ltX next Y Y_in tail => @PathIn.loc _ _ _ _ _ _ Y.flip diff --git a/LeanPool/PDL/General/FinReach.lean b/LeanPool/PDL/General/FinReach.lean index 36729481b2..0d017324c1 100644 --- a/LeanPool/PDL/General/FinReach.lean +++ b/LeanPool/PDL/General/FinReach.lean @@ -16,7 +16,7 @@ elements reachable in at least one step. Because `reachStep` only grows sets, af `Fintype.card α` iterations we must have reached a fixed point, which then is exactly the set of `Relation.TransGen`-successors. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/General/ListFinset.lean b/LeanPool/PDL/General/ListFinset.lean index 9940005b64..f4bedebc9d 100644 --- a/LeanPool/PDL/General/ListFinset.lean +++ b/LeanPool/PDL/General/ListFinset.lean @@ -17,15 +17,14 @@ Nothing in this file is about PDL. These are helper definitions and lemmas that used in several places and might also be in (newer versions of) Mathlib. -/ -@[expose] public section +public section namespace PDL /-! ## Helpers about `List`s and `Finset`s -/ /-- Convert a list of formula-like lists into a finset of finsets. -/ -@[simp] -def _root_.List.pdlToFinFin [DecidableEq α] : List (List α) → Finset (Finset α ) +@[expose, simp] def _root_.List.pdlToFinFin [DecidableEq α] : List (List α) → Finset (Finset α ) | LS => (LS.map (fun L => L.toFinset)).toFinset /-- Turning a mapped list into a `Finset` is the image of the `Finset`. -/ diff --git a/LeanPool/PDL/Interpolation/Cluster.lean b/LeanPool/PDL/Interpolation/Cluster.lean index 87d0fd9dc7..d0dfc21511 100644 --- a/LeanPool/PDL/Interpolation/Cluster.lean +++ b/LeanPool/PDL/Interpolation/Cluster.lean @@ -20,7 +20,7 @@ i.e. the interpolant for the root of a proper cluster. Counterexamples to Lemma and (d) as stated in the paper are in `Pdl.ClusterCorrection`. -/ -@[expose] public section +public section namespace PDL @@ -108,7 +108,7 @@ cluster along the branch leading to `s`. Note that this is *vacuously true* for `.nil`, the root of the whole tableau, which has no parent at all. This is why we quantify over all parents instead of demanding that a parent exists: the root of a tableau may already be loaded. -/ -def PathIn.isClusterRoot (s : PathIn tab) : Prop := +@[expose] def PathIn.isClusterRoot (s : PathIn tab) : Prop := ∀ p : PathIn tab, p ⋖_ s → ¬ s ◃* p lemma PathIn.isClusterRoot_flip {p : PathIn tab} @@ -149,7 +149,7 @@ lemma PathIn.isClusterRoot_of_edge_from_free {s t : PathIn tab} /-- Def 8.14: `e` is an *exit* of the cluster of `s`, i.e. `e ∈ C⁺ \ C` where `C` is the cluster of `s`: it is not in the cluster of `s`, but it is a child of a node in it. -/ -def isExitOf (s e : PathIn tab) : Prop := +@[expose] def isExitOf (s e : PathIn tab) : Prop := ¬ (e ≡ᶜ s) ∧ ∃ t : PathIn tab, (t ≡ᶜ s) ∧ t ⋖_ e lemma isExitOf_flip {s e : PathIn tab} : @@ -264,7 +264,7 @@ namespace LoadedCluster /-- Make the `LoadedCluster` of a right-loaded node that is the first node of its cluster. This is the way `tabToIntAt` now gets hold of a `LoadedCluster`. -/ -def ofClusterRoot (s : PathIn tab) +@[expose] def ofClusterRoot (s : PathIn tab) (s_cr : s.isClusterRoot) (s_proper : s ◃⁺ s) (s_loaded_right : (nodeAt s).2.2.isRight) : LoadedCluster tab where root := s @@ -289,7 +289,7 @@ def ofClusterRoot (s : PathIn tab) exact u_in.1 /-- The exits of the cluster, i.e. `C⁺ \ C` from Def 8.14. -/ -def exits (C : LoadedCluster tab) : Finset (PathIn tab) := +@[expose] def exits (C : LoadedCluster tab) : Finset (PathIn tab) := (C.CL.biUnion (fun t => t.children.image Subtype.val)).filter (fun e => e ∉ C.CL) /-- C⁺, the cluster plus its exits. -/ @@ -414,7 +414,7 @@ for the end nodes `Y` of the local tableau at `p`, and they are labelled with `Y /-- A fine node belongs to the cluster `C` iff its base node is in `C` and either it *is* that base node, or one of the children of the base node below it is in `C`. -/ -def memFine (C : LoadedCluster tab) (f : FinePathIn tab) : Prop := +@[expose] def memFine (C : LoadedCluster tab) (f : FinePathIn tab) : Prop := f.base ∈ C.CL ∧ ( f.atBigRoot ∨ ∃ q ∈ f.coarseChildrenBelow, q ∈ C.CL ) instance instDecidableMemFine (C : LoadedCluster tab) (f : FinePathIn tab) : @@ -426,7 +426,7 @@ lemma memFine_toFine (C : LoadedCluster tab) {p : PathIn tab} (p_in : p ∈ C.CL C.memFine p.toFine := ⟨by simpa using p_in, Or.inl (by simp)⟩ /-- All fine nodes in the cluster `C`. -/ -def fineCL (C : LoadedCluster tab) : List (FinePathIn tab) := +@[expose] def fineCL (C : LoadedCluster tab) : List (FinePathIn tab) := (allFinePaths tab).filter (fun f => decide (C.memFine f)) lemma mem_fineCL (C : LoadedCluster tab) (f : FinePathIn tab) : @@ -471,15 +471,15 @@ lemma exists_child_memFine_of_not_isLrep (C : LoadedCluster tab) · exact C.exists_child_memFine hf hbr /-- All fine nodes just outside the cluster `C`, i.e. `C⁺ \ C` at the fine level. -/ -def fineExits (C : LoadedCluster tab) : Finset (FinePathIn tab) := +@[expose] def fineExits (C : LoadedCluster tab) : Finset (FinePathIn tab) := (C.fineCL.toFinset.sup FinePathIn.children).filter (fun f => decide (¬ C.memFine f)) /-- The fine version of `C⁺`. -/ -def fineCLplus (C : LoadedCluster tab) : Finset (FinePathIn tab) := +@[expose] def fineCLplus (C : LoadedCluster tab) : Finset (FinePathIn tab) := C.fineCL.toFinset ∪ C.fineExits /-- `Λ₂[C]`, the right components of the fine nodes of the cluster. -/ -def lambdaTwo (C : LoadedCluster tab) : Finset Sequent := +@[expose] def lambdaTwo (C : LoadedCluster tab) : Finset Sequent := (C.fineCL.toFinset.image (fun f => f.label.rightOnly)) /-- `Λ₂[C⁺]`, the right components of the fine nodes of the cluster and of its exits. -/ @@ -487,16 +487,16 @@ def lambdaTwoPlus (C : LoadedCluster tab) : Finset Sequent := (C.fineCLplus.image (fun f => f.label.rightOnly)) /-- `C_Δ` from Def 9.6, at the fine level. -/ -def nodesWithFine (C : LoadedCluster tab) (Δ : Sequent) : List (FinePathIn tab) := +@[expose] def nodesWithFine (C : LoadedCluster tab) (Δ : Sequent) : List (FinePathIn tab) := C.fineCL.filter (fun f => decide (f.label.rightOnly = Δ)) /-- `C⁺_Δ` from Def 9.6, at the fine level. -/ -def plusNodesWithFine (C : LoadedCluster tab) (Δ : Sequent) : +@[expose] def plusNodesWithFine (C : LoadedCluster tab) (Δ : Sequent) : Finset (FinePathIn tab) := C.fineCLplus.filter (fun f => decide (f.label.rightOnly = Δ)) /-- `C^R_Δ` from Def 9.6: nodes with right component `Δ` where a right rule is applied. -/ -def nodesWithFineRight (C : LoadedCluster tab) (Δ : Sequent) : +@[expose] def nodesWithFineRight (C : LoadedCluster tab) (Δ : Sequent) : List (FinePathIn tab) := (C.nodesWithFine Δ).filter (fun f => f.usesRightRule) @@ -550,7 +550,7 @@ components of its children. By uniformity (which we do not prove here) this does depend on the chosen node. When `C^R_Δ` is empty — which by Lemma 9.7 (d) only happens when `C_Δ` is empty, i.e. when `Δ ∉ Λ₂[C]` — we return the empty list, but note that the construction of `Q` below never uses `stepOf` in that case. -/ -def stepOf (C : LoadedCluster tab) (Δ : Sequent) : Finset Sequent := +@[expose] def stepOf (C : LoadedCluster tab) (Δ : Sequent) : Finset Sequent := match (C.nodesWithFineRight Δ).head? with | some f => f.children.image (fun g => g.label.rightOnly) | none => {} @@ -575,7 +575,7 @@ lemma stepOf_ne_nil (C : LoadedCluster tab) {Δ : Sequent} simp at g_in /-- The sorted list of sequents produced by a cluster's step operation. -/ -def stepOfL (C : LoadedCluster tab) : (Δ : Sequent) → List Sequent := +@[expose] def stepOfL (C : LoadedCluster tab) : (Δ : Sequent) → List Sequent := Finset.pdlSeqSort ∘ C.stepOf lemma stepOfL_ne_nil (C : LoadedCluster tab) {Δ : Sequent} @@ -610,7 +610,7 @@ use of `head?`. -/ /-- The consequence of uniformity that the quasi-tableau construction needs: any two nodes of the cluster with the same right component `Δ` at which a right rule is applied have the same right components below them, in the same order. Compare Lemma 9.7 (f). -/ -def HasUniformSteps (C : LoadedCluster tab) : Prop := +@[expose] def HasUniformSteps (C : LoadedCluster tab) : Prop := ∀ Δ : Sequent, ∀ f ∈ C.nodesWithFineRight Δ, ∀ g ∈ C.nodesWithFineRight Δ, f.children.image (fun h => h.label.rightOnly) = g.children.image (fun h => h.label.rightOnly) diff --git a/LeanPool/PDL/Interpolation/ClusterInterpolation.lean b/LeanPool/PDL/Interpolation/ClusterInterpolation.lean index 829bd493cc..67c73c5f9f 100644 --- a/LeanPool/PDL/Interpolation/ClusterInterpolation.lean +++ b/LeanPool/PDL/Interpolation/ClusterInterpolation.lean @@ -34,7 +34,7 @@ interpolants of the coarse exits upwards through the local tableaux with `LocalTableau.interpolant`. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Interpolation/ClusterItp.lean b/LeanPool/PDL/Interpolation/ClusterItp.lean index 8709f8f23c..b2fb3636f7 100644 --- a/LeanPool/PDL/Interpolation/ClusterItp.lean +++ b/LeanPool/PDL/Interpolation/ClusterItp.lean @@ -18,7 +18,7 @@ This file continues the development of `Pdl.PreInterpolant` with Definition 10.2 and Lemma 10.3 are in `Pdl.ClusterRho`. -/ -@[expose] public section +public section namespace PDL @@ -38,7 +38,7 @@ lemma Program.voc_steps : ∀ as : List Program, (Program.steps as).voc = as.pdl /-! ## Entailment from the left component of a node -/ /-- `Λ₁(t) ⊨ φ`: the formula `φ` follows from the left component of the fine node `t`. -/ -def FinePathIn.leftEntails {Hist} {Y : Sequent} {tab : Tableau Hist Y} +@[expose] def FinePathIn.leftEntails {Hist} {Y : Sequent} {tab : Tableau Hist Y} (t : FinePathIn tab) (φ : Formula) : Prop := ∀ (W : Type) (M : KripkeModel W) (w : W), (∀ ψ ∈ t.label.left, evaluate M w ψ) → evaluate M w φ @@ -60,7 +60,7 @@ variable {Var : Type} /-- The ordinary vocabulary of a Q-formula, i.e. the proposition letters and atomic programs occurring in it. The internal variables are *not* included; they are given by `QFormula.vars`. -/ -def voc : QFormula Var → Vocab +@[expose] def voc : QFormula Var → Vocab | .fma ψ => ψ.voc | .var _ => ∅ | .and ι1 ι2 => ι1.voc ∪ ι2.voc @@ -364,7 +364,7 @@ and otherwise `θ_r` is the pre-interpolant `ι_{r_Q}` of the root of the quasi- The latter is a `QFormula`, i.e. it may still contain internal variables; by Lemma 10.1 (`iitp_vars`) it does not, so it does not matter which substitution we use to read it as a `Formula`, and we simply substitute `⊤`. -/ -noncomputable def itp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) : Formula := +@[expose] noncomputable def itp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) : Formula := if (nodeAt C.root).left = {} then ⊤ else (C.rootIitp θ).subst (fun _ => ⊤) /-! ## Cluster facts used to construct interpolants -/ diff --git a/LeanPool/PDL/Interpolation/ClusterRho.lean b/LeanPool/PDL/Interpolation/ClusterRho.lean index 171d47099f..686d3f853f 100644 --- a/LeanPool/PDL/Interpolation/ClusterRho.lean +++ b/LeanPool/PDL/Interpolation/ClusterRho.lean @@ -16,7 +16,7 @@ This file continues the development of `Pdl.ClusterItp` with * Lemma 10.3: `Γ₁ ⊨ θ_r`. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Interpolation/ClusterSatDown.lean b/LeanPool/PDL/Interpolation/ClusterSatDown.lean index 1860855a51..7feed1c204 100644 --- a/LeanPool/PDL/Interpolation/ClusterSatDown.lean +++ b/LeanPool/PDL/Interpolation/ClusterSatDown.lean @@ -23,7 +23,7 @@ Q-formulas with an assignment, the witness distance `witDist`, and `BasicBetween `Pdl.EvalQ`. -/ -@[expose] public section +public section namespace PDL /-! ## Lemma 10.6 diff --git a/LeanPool/PDL/Interpolation/ClusterSatDownFacts.lean b/LeanPool/PDL/Interpolation/ClusterSatDownFacts.lean index fff7bfb528..a1797549a4 100644 --- a/LeanPool/PDL/Interpolation/ClusterSatDownFacts.lean +++ b/LeanPool/PDL/Interpolation/ClusterSatDownFacts.lean @@ -30,7 +30,7 @@ We import `Pdl.Uniformity` and not `Pdl.ClusterInterpolation`, because the latte are the copies in the `Uniformity` namespace. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Interpolation/Def.lean b/LeanPool/PDL/Interpolation/Def.lean index 89b141a964..2326355142 100644 --- a/LeanPool/PDL/Interpolation/Def.lean +++ b/LeanPool/PDL/Interpolation/Def.lean @@ -14,7 +14,7 @@ public import LeanPool.PDL.Interpolation.SingletonCluster Here we put together the interpolants for singleton clusters and for proper clusters. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Interpolation/EvalQ.lean b/LeanPool/PDL/Interpolation/EvalQ.lean index 7bff9ee88e..273b3ea5ec 100644 --- a/LeanPool/PDL/Interpolation/EvalQ.lean +++ b/LeanPool/PDL/Interpolation/EvalQ.lean @@ -33,7 +33,7 @@ and hence all distances, untouched, which is exactly the "`M` and `M'` have the relational structure" of the paper. -/ -@[expose] public section +public section namespace PDL @@ -228,19 +228,19 @@ namespace Sequent /-- The loaded formula of a sequent, split into its list of programs and its final, unloaded formula. For a free sequent we return `([], ⊥)`, which is never used. -/ -def loadedSplit : Sequent → List Program × Formula +@[expose] def loadedSplit : Sequent → List Program × Formula | ⟨_, _, none⟩ => ([], ⊥) | ⟨_, _, some (Sum.inl (~'χ))⟩ => χ.split | ⟨_, _, some (Sum.inr (~'χ))⟩ => χ.split /-- The programs `δ_x` of the loaded formula `¬⌊δ_x⌋ψ_x`. -/ -def loadedProgs (X : Sequent) : List Program := X.loadedSplit.1 +@[expose] def loadedProgs (X : Sequent) : List Program := X.loadedSplit.1 /-- The unloaded formula `ψ_x` of the loaded formula `¬⌊δ_x⌋ψ_x`. -/ -def loadedFma (X : Sequent) : Formula := X.loadedSplit.2 +@[expose] def loadedFma (X : Sequent) : Formula := X.loadedSplit.2 /-- The sequent has its loaded formula on the right, as all `Δ ∈ Λ₂[C]` do. -/ -def isRightLoaded (X : Sequent) : Prop := ∃ nlf, X.O = some (Sum.inr nlf) +@[expose] def isRightLoaded (X : Sequent) : Prop := ∃ nlf, X.O = some (Sum.inr nlf) end Sequent @@ -279,7 +279,7 @@ Note that `witDist` does not depend on the valuation of the internal variables the paper's observation that `M` and `M'` have the same relational structure. -/ /-- The witness distance `wd_M(v,x)` of Lemma 10.7, as a function of the label `Δ_x`. -/ -noncomputable def witDist {W : Type} (M : KripkeModel W) (v : W) (Δ : Sequent) : ℕ∞ := +@[expose] noncomputable def witDist {W : Type} (M : KripkeModel W) (v : W) (Δ : Sequent) : ℕ∞ := ⨅ w : {w : W // evaluate M w (~ Δ.loadedFma)}, distanceList M v w Δ.loadedProgs lemma witDist_congr {W : Type} {M : KripkeModel W} {v : W} {Δ Y : Sequent} @@ -295,7 +295,7 @@ of type 1 or 2 is the label of the node of type 3 below it) and it makes the pro invariant under passing from a node of type 1 or 2 to its unique child. -/ /-- There is a node of type 3 with a basic label on the path from `x` to `z`. -/ -def QuasiTab.BasicBetween (q : QuasiTab) (x z : List Nat) : Prop := +@[expose] def QuasiTab.BasicBetween (q : QuasiTab) (x z : List Nat) : Prop := ∃ y Δ, x <+: y ∧ y <+: z ∧ q.typAt y = some Typ.three ∧ q.labelAt y = some Δ ∧ Δ.basic /-- `BasicBetween` only grows when we move the left end towards the root. -/ diff --git a/LeanPool/PDL/Interpolation/FinePath.lean b/LeanPool/PDL/Interpolation/FinePath.lean index c91c20aca6..3e964e3388 100644 --- a/LeanPool/PDL/Interpolation/FinePath.lean +++ b/LeanPool/PDL/Interpolation/FinePath.lean @@ -19,7 +19,7 @@ of a `LocalTableau`, and `FinePathIn`, for the nodes of a whole `Tableau` in the i.e. including those nodes inside a local tableau that a `loc` step jumps over. -/ -@[expose] public section +public section namespace PDL @@ -45,12 +45,13 @@ inductive LocalPathIn : {X : Sequent} → LocalTableau X → Type deriving DecidableEq /-- The sequent at the node a local path is pointing at. -/ -def LocalPathIn.last {X} {lt : LocalTableau X} : LocalPathIn lt → Sequent +@[expose] def LocalPathIn.last {X} {lt : LocalTableau X} : LocalPathIn lt → Sequent | .nil => X | .cons _ tail => tail.last /-- The local tableau rooted at the node a local path is pointing at. -/ -def LocalPathIn.ltAt {X} {lt : LocalTableau X} : (lp : LocalPathIn lt) → LocalTableau lp.last +@[expose] def LocalPathIn.ltAt {X} {lt : LocalTableau X} : + (lp : LocalPathIn lt) → LocalTableau lp.last | .nil => lt | .cons _ tail => tail.ltAt @@ -60,7 +61,7 @@ def LocalPathIn.isNilB {X} {lt : LocalTableau X} : LocalPathIn lt → Bool | .cons _ _ => false /-- Is a local rule applied at the root of this local tableau? -/ -def LocalTableau.hasRule {X} : LocalTableau X → Prop +@[expose] def LocalTableau.hasRule {X} : LocalTableau X → Prop | .byLocalRule .. => True | .sim _ => False @@ -69,7 +70,7 @@ instance LocalTableau.instDecidableHasRule {X} (lt : LocalTableau X) : Decidable /-- A local path is *internal* iff a local rule is applied at the node it points at, i.e. iff that node is not a leaf of the local tableau. -/ -def LocalPathIn.isInternal {X} {lt : LocalTableau X} (lp : LocalPathIn lt) : Prop := +@[expose] def LocalPathIn.isInternal {X} {lt : LocalTableau X} (lp : LocalPathIn lt) : Prop := lp.ltAt.hasRule instance LocalPathIn.instDecidableIsInternal {X} {lt : LocalTableau X} (lp : LocalPathIn lt) : @@ -118,7 +119,7 @@ def LocalPathIn.children {X} {lt : LocalTableau X} : | .cons Y_in tail => tail.children.image (.cons Y_in) /-- The sequents labelling the children of the root of a local tableau. -/ -def LocalTableau.childLabels {X} : LocalTableau X → Finset Sequent +@[expose] def LocalTableau.childLabels {X} : LocalTableau X → Finset Sequent | .byLocalRule lra _ _ => lra.C | .sim _ => {} @@ -137,7 +138,7 @@ lemma LocalPathIn.map_last_children {X} {lt : LocalTableau X} (lp : LocalPathIn exact IH /-- The end nodes of the whole local tableau that are below a given local path. -/ -def LocalPathIn.endNodesBelow {X} {lt : LocalTableau X} : +@[expose] def LocalPathIn.endNodesBelow {X} {lt : LocalTableau X} : (lp : LocalPathIn lt) → List {Y : Sequent // Y ∈ endNodesOf lt} | .nil => (endNodesOf lt).pdlSeqSort.attach.map (fun ⟨Z, hZ⟩ => ⟨Z, (Finset.mem_seqSort _).mp hZ⟩) @@ -264,7 +265,7 @@ def rootFine : {H : History} → {X : Sequent} → (tab : Tableau H X) → FineP | _, _, .lrep _ => .lrepHere /-- The sequent at the node a fine path points at, i.e. `Λ(t)` for fine nodes `t`. -/ -def FinePathIn.label : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → Sequent +@[expose] def FinePathIn.label : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → Sequent | _, _, _, .inLoc lp _ => lp.last | _, X, _, .pdlHere => X | _, X, _, .lrepHere => X @@ -272,7 +273,7 @@ def FinePathIn.label : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → S | _, _, _, .pdl tail => tail.label /-- The `PathIn` node in whose local tableau the given fine node lies. -/ -def FinePathIn.base : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → PathIn tab +@[expose] def FinePathIn.base : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → PathIn tab | _, _, _, .inLoc _ _ => .nil | _, _, _, .pdlHere => .nil | _, _, _, .lrepHere => .nil @@ -282,7 +283,7 @@ def FinePathIn.base : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → Pa /-- The children of a fine node. Note that a child of an internal node of a local tableau may be a node of the tableau in the coarse `PathIn` sense, namely when it is an end node of that local tableau. -/ -def FinePathIn.children : ∀ {Hist X} {tab : Tableau Hist X}, +@[expose] def FinePathIn.children : ∀ {Hist X} {tab : Tableau Hist X}, FinePathIn tab → Finset (FinePathIn tab) | _, _, _, .inLoc lp _ => lp.children.image (fun lp' => match h : lp'.endNodeAtOpt with @@ -406,7 +407,7 @@ lemma FinePathIn.map_label_children_inLoc {Hist X nrep nbas} {lt : LocalTableau · simp [FinePathIn.label] /-- The local rule applied at a fine node, if any. -/ -def FinePathIn.lraOpt : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Option LocalRuleApp +@[expose] def FinePathIn.lraOpt : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Option LocalRuleApp | _, _, _, .inLoc lp _ => match lp.ltAt with | .byLocalRule lra _ _ => some lra | .sim _ => none @@ -473,22 +474,22 @@ This is what Lemma 9.7 (a) is about, and it is the reason why we needed the fine on the `Tableau` level a `loc` step is in general a mix of left and right rules. -/ /-- Is this a local rule applied to the right component? -/ -def LocalRule.isRightRule {X YS} : LocalRule X YS → Bool +@[expose] def LocalRule.isRightRule {X YS} : LocalRule X YS → Bool | .oneSidedR _ _ => true | .loadedR _ _ _ => true | _ => false /-- Is this a local rule applied to the left component? -/ -def LocalRule.isLeftRule {X YS} : LocalRule X YS → Bool +@[expose] def LocalRule.isLeftRule {X YS} : LocalRule X YS → Bool | .oneSidedL _ _ => true | .loadedL _ _ _ => true | _ => false /-- Whether this local rule application acts on the right component. -/ -def LocalRuleApp.isRightRule (lra : LocalRuleApp) : Bool := lra.lr.isRightRule +@[expose] def LocalRuleApp.isRightRule (lra : LocalRuleApp) : Bool := lra.lr.isRightRule /-- Whether this local rule application acts on the left component. -/ -def LocalRuleApp.isLeftRule (lra : LocalRuleApp) : Bool := lra.lr.isLeftRule +@[expose] def LocalRuleApp.isLeftRule (lra : LocalRuleApp) : Bool := lra.lr.isLeftRule lemma LocalRuleApp.not_left_and_right (lra : LocalRuleApp) : ¬ (lra.isLeftRule ∧ lra.isRightRule) := by @@ -498,21 +499,21 @@ lemma LocalRuleApp.not_left_and_right (lra : LocalRuleApp) : LocalRule.isRightRule] /-- The `(M)`, `(L+)` and `(L-)` rules acting on the right component. -/ -def PdlRule.isRightRule {X Y} : PdlRule X Y → Bool +@[expose] def PdlRule.isRightRule {X Y} : PdlRule X Y → Bool | .loadR _ _ _ => true | .freeR _ _ => true | .modR _ _ => true | _ => false /-- The `(M)`, `(L+)` and `(L-)` rules acting on the left component. -/ -def PdlRule.isLeftRule {X Y} : PdlRule X Y → Bool +@[expose] def PdlRule.isLeftRule {X Y} : PdlRule X Y → Bool | .loadL _ _ _ => true | .freeL _ _ => true | .modL _ _ => true | _ => false /-- Is a right rule applied at this fine node? -/ -def FinePathIn.usesRightRule : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Bool +@[expose] def FinePathIn.usesRightRule : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Bool | _, _, _, .inLoc lp _ => match lp.ltAt with | .byLocalRule lra _ _ => lra.isRightRule | .sim _ => false @@ -522,7 +523,7 @@ def FinePathIn.usesRightRule : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → | _, _, _, .pdl tail => tail.usesRightRule /-- Is a left rule applied at this fine node? -/ -def FinePathIn.usesLeftRule : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Bool +@[expose] def FinePathIn.usesLeftRule : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Bool | _, _, _, .inLoc lp _ => match lp.ltAt with | .byLocalRule lra _ _ => lra.isLeftRule | .sim _ => false @@ -569,7 +570,7 @@ lemma FinePathIn.not_isLrep_base_of_usesRightRule {H X} {tab : Tableau H X} (f : /-- Is this fine node also a node in the coarse sense, i.e. the root of the local tableau at its base? -/ -def FinePathIn.atBigRoot : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Bool +@[expose] def FinePathIn.atBigRoot : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → Bool | _, _, _, .inLoc lp _ => lp.isNilB | _, _, _, .pdlHere => true | _, _, _, .lrepHere => true @@ -603,7 +604,7 @@ def FinePathIn.endLabelsBelow : ∀ {H X} {tab : Tableau H X}, FinePathIn tab Note that when `f` is a coarse node itself, i.e. `f.atBigRoot`, then these are *all* children of `f.base`, and that they get further restricted the deeper `f` sits inside the local tableau at `f.base`. -/ -def FinePathIn.coarseChildrenBelow : ∀ {H X} {tab : Tableau H X}, +@[expose] def FinePathIn.coarseChildrenBelow : ∀ {H X} {tab : Tableau H X}, FinePathIn tab → List (PathIn tab) | _, _, _, .inLoc lp _ => lp.endNodesBelow.map (fun ⟨_, Y_in⟩ => PathIn.loc Y_in .nil) | _, _, _, .pdlHere => [PathIn.pdl .nil] @@ -742,7 +743,7 @@ lemma PathIn.mem_coarseChildrenBelow_toFine {H X} {tab : Tableau H X} : /-- The right component of a sequent, again as a sequent but with empty left component. This is `Λ₂` from the paper; we use it to label the nodes of the quasi-tableau. -/ -def Sequent.rightOnly (X : Sequent) : Sequent := ⟨{}, X.2.1, X.2.2⟩ +@[expose] def Sequent.rightOnly (X : Sequent) : Sequent := ⟨{}, X.2.1, X.2.2⟩ /-! ## Well-founded descent for fine paths diff --git a/LeanPool/PDL/Interpolation/Local.lean b/LeanPool/PDL/Interpolation/Local.lean index 699a3d2219..366adf383a 100644 --- a/LeanPool/PDL/Interpolation/Local.lean +++ b/LeanPool/PDL/Interpolation/Local.lean @@ -10,7 +10,7 @@ public import LeanPool.PDL.Local.Tableau /-! # Interpolants preserved by local tableau rules -/ -@[expose] public section +public section namespace PDL @@ -19,11 +19,11 @@ open HasSat /-! ## Partition Interpolants -/ /-- The vocabulary and two inconsistency conditions defining a partial interpolant. -/ -def isPartInterpolant (X : Sequent) (θ : Formula) := +@[expose] def isPartInterpolant (X : Sequent) (θ : Formula) := θ.voc ⊆ jvoc X ∧ (¬ satisfiable ({~θ} ∪ X.left) ∧ ¬ satisfiable ({θ} ∪ X.right)) /-- A formula equipped with the partial-interpolant conditions for a sequent. -/ -def PartInterpolant (N : Sequent) := Subtype <| isPartInterpolant N +@[expose] def PartInterpolant (N : Sequent) := Subtype <| isPartInterpolant N /-! ## Interpolants for local rules -/ diff --git a/LeanPool/PDL/Interpolation/PreInterpolant.lean b/LeanPool/PDL/Interpolation/PreInterpolant.lean index 4596456003..21571d6a50 100644 --- a/LeanPool/PDL/Interpolation/PreInterpolant.lean +++ b/LeanPool/PDL/Interpolation/PreInterpolant.lean @@ -27,7 +27,7 @@ have a unique child. For nodes without children where the paper assumes one we r placeholder `⊤`; by Remark 9.9 (`QuasiTab.build_leaf_typ`) this does not happen in `C.Q`. -/ -@[expose] public section +public section namespace PDL @@ -36,7 +36,7 @@ namespace PDL /-- The leading program `α` of the loaded formula `~⌊α⌋ξ` of a sequent, if there is one. For a basic sequent this program is atomic, see `Sequent.isAtomic_of_basic_of_negLoad_mem_wForms`. -/ -def Sequent.loadedProgOpt : Sequent → Option Program +@[expose] def Sequent.loadedProgOpt : Sequent → Option Program | ⟨_, _, none⟩ => none | ⟨_, _, some (Sum.inl (~'(⌊α⌋_)))⟩ => some α | ⟨_, _, some (Sum.inr (~'(⌊α⌋_)))⟩ => some α @@ -44,7 +44,7 @@ def Sequent.loadedProgOpt : Sequent → Option Program /-- The leading program of the loaded formula, or `?'⊥` if the sequent is free. Only used in the case `k(x) = 3` with `Δₓ` basic of Definition 9.18, where the sequent is loaded. -/ -def Sequent.loadedProg (X : Sequent) : Program := X.loadedProgOpt.getD (?'⊥) +@[expose] def Sequent.loadedProg (X : Sequent) : Program := X.loadedProgOpt.getD (?'⊥) /-! ## Definition 9.18 -/ @@ -67,7 +67,7 @@ The first argument `q` is the whole quasi-tableau (used to find companions), the * `k(x) = 3` with `Δ_x` basic: `ι_x := [a] ι_y` where `a` is the leading atomic program of the loaded formula of `Δ_x`. * `k(x) = 3` with `Δ_x` not basic: `ι_x := ⋀ { ι_y | x ⋖Q y }`. -/ -def iitpAt (q : QuasiTab) (θ : Sequent → Formula) : +@[expose] def iitpAt (q : QuasiTab) (θ : Sequent → Formula) : (n : QuasiTab) → (x : List Nat) → QFormula (List Nat) | .QNode .one Δ [], x => match q.companionOpt x with @@ -113,7 +113,8 @@ variable {X : Sequent} {tab : Tableau .nil X} /-- Def 9.18: the pre-interpolant `ι_x` of the node with address `x` of the quasi-tableau `Q` of the cluster `C`, where `θ` gives the interpolants of the exit nodes of `C`. When there is no node at address `x` we return the placeholder `⊤`. -/ -noncomputable def iitp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) (x : List Nat) : +@[expose] noncomputable def iitp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) + (x : List Nat) : QFormula (List Nat) := match C.Q.atOpt x with | none => .fma ⊤ @@ -121,7 +122,7 @@ noncomputable def iitp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) /-- The pre-interpolant of the root of the quasi-tableau. This is the formula `ι_{c_Q}` that Def 9.20 turns into the interpolant of the root of the cluster. -/ -noncomputable def rootIitp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) : +@[expose] noncomputable def rootIitp (C : LoadedCluster tab) (θ : FinePathIn tab → Formula) : QFormula (List Nat) := C.iitp θ QuasiTab.rootAddress diff --git a/LeanPool/PDL/Interpolation/QFormula.lean b/LeanPool/PDL/Interpolation/QFormula.lean index 0e4527ecd0..46723bb630 100644 --- a/LeanPool/PDL/Interpolation/QFormula.lean +++ b/LeanPool/PDL/Interpolation/QFormula.lean @@ -27,7 +27,7 @@ the paper, but the extra generality is exactly what is needed later: in the corr proof the internal variables get replaced by other formulas. -/ -@[expose] public section +public section namespace PDL @@ -56,7 +56,7 @@ variable {Var : Type} /-- Replace the internal variables in a Q-formula according to `σ`, yielding a `Formula`. For `σ x = ·(n x)` with `n` injective into unused proposition letters this is the formula that the paper denotes by `ι` itself. -/ -def subst (σ : Var → Formula) : QFormula Var → Formula +@[expose] def subst (σ : Var → Formula) : QFormula Var → Formula | .fma ψ => ψ | .var q => σ q | .and ι1 ι2 => ι1.subst σ ⋀ ι2.subst σ @@ -70,7 +70,7 @@ def subst (σ : Var → Formula) : QFormula Var → Formula (ι.boxes as).subst σ = ⌈⌈as⌉⌉(ι.subst σ) := rfl /-- The internal variables occurring in a Q-formula. -/ -def vars : QFormula Var → List Var +@[expose] def vars : QFormula Var → List Var | .fma _ => [] | .var q => [q] | .and ι1 ι2 => ι1.vars ++ ι2.vars @@ -86,7 +86,7 @@ def substVar [DecidableEq Var] (x : Var) (ρ : QFormula Var) (ι : QFormula Var) termination_by sizeOf ι /-- Big conjunction of a list of Q-formulas, mirroring `con` on formulas. -/ -def conj : List (QFormula Var) → QFormula Var +@[expose] def conj : List (QFormula Var) → QFormula Var | [] => .fma ⊤ | [ι] => ι | ι :: rest => .and ι (conj rest) @@ -119,12 +119,12 @@ namespace QSimple variable {Var : Type} /-- A simple Q-formula is a Q-formula. -/ -def toQ : QSimple Var → QFormula Var +@[expose] def toQ : QSimple Var → QFormula Var | .fma ψ => .fma ψ | .boxVar as q => .boxes as (.var q) /-- Prefix a simple Q-formula with a sequence of boxes; the result is again simple. -/ -def prefixBoxes (as : List Program) : QSimple Var → QSimple Var +@[expose] def prefixBoxes (as : List Program) : QSimple Var → QSimple Var | .fma ψ => .fma (⌈⌈as⌉⌉ψ) | .boxVar bs q => .boxVar (as ++ bs) q @@ -139,12 +139,12 @@ def prefixBoxes (as : List Program) : QSimple Var → QSimple Var | cons a as IH => simp only [List.cons_append, Formula.boxes_cons, IH] /-- Does the simple Q-formula mention the internal variable `x`? -/ -def mentions [DecidableEq Var] (x : Var) : QSimple Var → Bool +@[expose] def mentions [DecidableEq Var] (x : Var) : QSimple Var → Bool | .fma _ => false | .boxVar _ q => q = x /-- If the simple Q-formula is `□(αs, q_x)` then return the program `αs` as one program. -/ -def progToOpt [DecidableEq Var] (x : Var) : QSimple Var → Option Program +@[expose] def progToOpt [DecidableEq Var] (x : Var) : QSimple Var → Option Program | .fma _ => none | .boxVar as q => if q = x then some (Program.steps as) else none @@ -156,7 +156,7 @@ variable {Var : Type} /-- Def 9.16: the finite set `Spl(ι)` of simple Q-formulas of a Q-formula `ι`. Note that `Spl(q_x) = { [⊤?]q_x }`, i.e. we make the variable into a box formula. -/ -def Spl : QFormula Var → List (QSimple Var) +@[expose] def Spl : QFormula Var → List (QSimple Var) | .fma ψ => [.fma ψ] | .var q => [.boxVar [?'⊤] q] | .and ι1 ι2 => ι1.Spl ++ ι2.Spl @@ -171,7 +171,7 @@ lemma Spl_ne_nil (ι : QFormula Var) : ι.Spl ≠ [] := by | boxes as ι IH => simpa [Spl] using IH /-- Def 9.16: the normal form `ι^nf` of a Q-formula, the conjunction of `Spl(ι)`. -/ -def nf (ι : QFormula Var) : QFormula Var := conj (ι.Spl.map QSimple.toQ) +@[expose] def nf (ι : QFormula Var) : QFormula Var := conj (ι.Spl.map QSimple.toQ) /-- Being *in normal form*: a conjunction of simple Q-formulas. -/ def IsNormalForm (ι : QFormula Var) : Prop := ∃ L : List (QSimple Var), ι = conj (L.map QSimple.toQ) @@ -273,17 +273,17 @@ companion `x` is `[(⋃ᵢ αᵢ)*](⋀ⱼ [βⱼ]q_{zⱼ} ∧ ψ)`. We implemen `QFormula.gfp x ι`, using `Spl` to read off the `αᵢ` and the remaining conjuncts. -/ /-- The programs `αᵢ` such that `[αᵢ]q_x` is a conjunct of the normal form of `ι`. -/ -def loopProgs [DecidableEq Var] (x : Var) (ι : QFormula Var) : List Program := +@[expose] def loopProgs [DecidableEq Var] (x : Var) (ι : QFormula Var) : List Program := ι.Spl.filterMap (QSimple.progToOpt x) /-- The conjunction of those conjuncts of the normal form of `ι` that do not mention the internal variable `x`. -/ -def dropVar [DecidableEq Var] (x : Var) (ι : QFormula Var) : QFormula Var := +@[expose] def dropVar [DecidableEq Var] (x : Var) (ι : QFormula Var) : QFormula Var := conj ((ι.Spl.filter (fun s => !s.mentions x)).map QSimple.toQ) /-- The greatest fixpoint of `ι` with respect to the internal variable `x`, i.e. the formula `[(⋃ᵢ αᵢ)*](⋀ⱼ [βⱼ]q_{zⱼ} ∧ ψ)` of the companion case of Definition 9.18. -/ -def gfp [DecidableEq Var] (x : Var) (ι : QFormula Var) : QFormula Var := +@[expose] def gfp [DecidableEq Var] (x : Var) (ι : QFormula Var) : QFormula Var := .boxes [∗ (Program.unions (ι.loopProgs x))] (ι.dropVar x) /-- The internal variable `x` no longer occurs in `gfp x ι`. -/ diff --git a/LeanPool/PDL/Interpolation/QuasiTableau.lean b/LeanPool/PDL/Interpolation/QuasiTableau.lean index 12ee147335..d7da006046 100644 --- a/LeanPool/PDL/Interpolation/QuasiTableau.lean +++ b/LeanPool/PDL/Interpolation/QuasiTableau.lean @@ -11,7 +11,7 @@ public import LeanPool.PDL.Interpolation.Cluster /-! ## Quasi-Tableaux (Def 9.8) -/ -@[expose] public section +public section namespace PDL @@ -29,13 +29,13 @@ inductive QuasiTab : Type | QNode : (k : Typ) → (Δ : Sequent) → (next : Lis open QuasiTab /-- The type `k(x)` of the root of a quasi-tableau. -/ -def QuasiTab.typ : QuasiTab → Typ | .QNode k _ _ => k +@[expose] def QuasiTab.typ : QuasiTab → Typ | .QNode k _ _ => k /-- The label `Δₓ` of the root of a quasi-tableau. -/ -def QuasiTab.label : QuasiTab → Sequent | .QNode _ Δ _ => Δ +@[expose] def QuasiTab.label : QuasiTab → Sequent | .QNode _ Δ _ => Δ /-- The children `⋖Q` of the root of a quasi-tableau. -/ -def QuasiTab.children : QuasiTab → List QuasiTab | .QNode _ _ next => next +@[expose] def QuasiTab.children : QuasiTab → List QuasiTab | .QNode _ _ next => next /-- All nodes of a quasi-tableau, each given by the subtree rooted at it. -/ def QuasiTab.subtrees : QuasiTab → List QuasiTab @@ -89,7 +89,7 @@ by the invariant. Otherwise it has a unique child of type 2, which has a unique type 3, whose children are given by `step` and are again of type 1. Note that only nodes of type 1 add their label to the history — this is the "identify repeats at the first opportunity" from Definition 9.11. -/ -def QuasiTab.build (inC : Finset Sequent) (step : Sequent → List Sequent) +@[expose] def QuasiTab.build (inC : Finset Sequent) (step : Sequent → List Sequent) (Hist : List Sequent) (Δ : Sequent) : QuasiTab := -- The hypothesis `_h` is only used in the termination proof below. if _h : Δ ∈ inC ∧ Δ ∉ Hist then @@ -214,7 +214,8 @@ lemma LoadedCluster.root_rightOnly_mem_lambdaTwo {X} {tab : Tableau [] X} (C : L /-- Def 9.8: the quasi-tableau associated with the cluster `C`. Its root has type 1 and is labelled with the right component `Λ₂(r)` of the root `r` of the cluster. -/ -noncomputable def LoadedCluster.Q {X} {tab : Tableau [] X} (C : LoadedCluster tab) : QuasiTab := +@[expose] noncomputable def LoadedCluster.Q {X} {tab : Tableau [] X} + (C : LoadedCluster tab) : QuasiTab := QuasiTab.build C.lambdaTwo (Finset.pdlSeqSort ∘ C.stepOf) [] (nodeAt C.root).rightOnly @[simp] @@ -256,15 +257,16 @@ lemma LoadedCluster.Q_leaf_typ {X} {tab : Tableau [] X} (C : LoadedCluster tab) /-- Def 9.10: the region `Rₓ ⊆ C⁺` represented by a node `x` of the quasi-tableau. For type 1 and 2 these are all nodes of `C⁺` with right component `Δₓ`, and for type 3 those nodes of `C` with right component `Δₓ` where a right rule is applied. -/ -noncomputable def LoadedCluster.region {X} {tab : Tableau [] X} (C : LoadedCluster tab) : +@[expose] noncomputable def LoadedCluster.region {X} {tab : Tableau [] X} + (C : LoadedCluster tab) : Typ → Sequent → Finset (FinePathIn tab) | .one, Δ => C.plusNodesWithFine Δ | .two, Δ => C.plusNodesWithFine Δ | .three, Δ => (C.nodesWithFineRight Δ).toFinset -- FIXME make Finset already in Cluster.lean? /-- Def 9.10, applied to a node of the quasi-tableau. -/ -noncomputable def LoadedCluster.regionOf {X} {tab : Tableau [] X} (C : LoadedCluster tab) (q : - QuasiTab) : +@[expose] noncomputable def LoadedCluster.regionOf {X} {tab : Tableau [] X} + (C : LoadedCluster tab) (q : QuasiTab) : Finset (FinePathIn tab) := C.region q.typ q.label /-! ### Addresses: the nodes of a quasi-tableau (Def 9.11) @@ -279,7 +281,7 @@ and `x <_Q y` becomes "`x` is a proper prefix of `y`". -/ namespace QuasiTab /-- The subtree of `q` rooted at the node with address `x`, if there is such a node. -/ -def atOpt : QuasiTab → List Nat → Option QuasiTab +@[expose] def atOpt : QuasiTab → List Nat → Option QuasiTab | q, [] => some q | q, (i :: rest) => match q.children[i]? with @@ -290,58 +292,58 @@ def atOpt : QuasiTab → List Nat → Option QuasiTab def isNodeAt (q : QuasiTab) (x : List Nat) : Bool := (q.atOpt x).isSome /-- The set `Q` of all nodes, given by their addresses. -/ -def addresses : QuasiTab → List (List Nat) +@[expose] def addresses : QuasiTab → List (List Nat) | .QNode _ _ next => [] :: (next.map addresses).zipIdx.flatMap (fun p => p.1.map (fun a => p.2 :: a)) /-- The label `Δₓ` of the node at address `x`. -/ -def labelAt (q : QuasiTab) (x : List Nat) : Option Sequent := (q.atOpt x).map label +@[expose] def labelAt (q : QuasiTab) (x : List Nat) : Option Sequent := (q.atOpt x).map label /-- The type `k(x)` of the node at address `x`. -/ -def typAt (q : QuasiTab) (x : List Nat) : Option Typ := (q.atOpt x).map typ +@[expose] def typAt (q : QuasiTab) (x : List Nat) : Option Typ := (q.atOpt x).map typ /-- The addresses of the children of the node at address `x`. -/ -def childrenAt (q : QuasiTab) (x : List Nat) : List (List Nat) := +@[expose] def childrenAt (q : QuasiTab) (x : List Nat) : List (List Nat) := match q.atOpt x with | none => [] | some n => (List.range n.children.length).map (fun i => x ++ [i]) /-- Is the node at address `x` a leaf? (Also `false` when there is no node at `x`.) -/ -def isLeafAt (q : QuasiTab) (x : List Nat) : Bool := +@[expose] def isLeafAt (q : QuasiTab) (x : List Nat) : Bool := match q.atOpt x with | none => false | some n => n.children.isEmpty /-- `L_Q`, the set of leaves. -/ -def leaves (q : QuasiTab) : List (List Nat) := q.addresses.filter q.isLeafAt +@[expose] def leaves (q : QuasiTab) : List (List Nat) := q.addresses.filter q.isLeafAt /-- `r_Q`, the root. -/ -def rootAddress : List Nat := [] +@[expose] def rootAddress : List Nat := [] /-- `x ≤_Q y`, the reflexive-transitive closure of `⋖Q`, which on addresses is the prefix order. -/ -def qle (x y : List Nat) : Prop := x <+: y +@[expose] def qle (x y : List Nat) : Prop := x <+: y /-- `x <_Q y`, the transitive closure of `⋖Q`, which on addresses is the *proper* prefix order. -/ -def qlt (x y : List Nat) : Prop := x <+: y ∧ x ≠ y +@[expose] def qlt (x y : List Nat) : Prop := x <+: y ∧ x ≠ y /-- `x ⋖Q y`, i.e. `y` is a child of `x`. -/ -def qedge (q : QuasiTab) (x y : List Nat) : Prop := y ∈ q.childrenAt x +@[expose] def qedge (q : QuasiTab) (x y : List Nat) : Prop := y ∈ q.childrenAt x /-- Def 9.11: the companion `c(x)` of a repeat leaf `x`, that is, the node `z <_Q x` of type 1 with the same label as `x`. Because repeats are identified at the first opportunity there is at most one such node in a quasi-tableau; here we simply take the one closest to the root. -/ -def companionOpt (q : QuasiTab) (x : List Nat) : Option (List Nat) := +@[expose] def companionOpt (q : QuasiTab) (x : List Nat) : Option (List Nat) := x.inits.dropLast.find? (fun z => decide (q.labelAt z = q.labelAt x ∧ q.typAt z = some .one)) /-- Def 9.8: `x` is a *repeat* leaf of `q`, i.e. a leaf of type 1 that has a companion. -/ -def isRepeatLeaf (q : QuasiTab) (x : List Nat) : Bool := +@[expose] def isRepeatLeaf (q : QuasiTab) (x : List Nat) : Bool := q.isLeafAt x && decide (q.typAt x = some .one) && (q.companionOpt x).isSome /-- All repeat leaves of `q`. -/ -def repeatLeaves (q : QuasiTab) : List (List Nat) := q.leaves.filter q.isRepeatLeaf +@[expose] def repeatLeaves (q : QuasiTab) : List (List Nat) := q.leaves.filter q.isRepeatLeaf /-- Def 9.11: `K_Q`, the set of companions. -/ def companions (q : QuasiTab) : List (List Nat) := diff --git a/LeanPool/PDL/Interpolation/SingletonCluster.lean b/LeanPool/PDL/Interpolation/SingletonCluster.lean index 1efebe3540..a0cb4b4bbc 100644 --- a/LeanPool/PDL/Interpolation/SingletonCluster.lean +++ b/LeanPool/PDL/Interpolation/SingletonCluster.lean @@ -11,7 +11,7 @@ public import LeanPool.PDL.Interpolation.Local /-! ## Helper lemmas about vocabularies and interpolants -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Interpolation/Theorem.lean b/LeanPool/PDL/Interpolation/Theorem.lean index ad9bdb7bd5..358207620c 100644 --- a/LeanPool/PDL/Interpolation/Theorem.lean +++ b/LeanPool/PDL/Interpolation/Theorem.lean @@ -13,7 +13,7 @@ public import LeanPool.PDL.Completeness.Theorem /-! # Interpolation (Section 7) -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Interpolation/Uniformity.lean b/LeanPool/PDL/Interpolation/Uniformity.lean index efdb7fdf6b..c1df847cac 100644 --- a/LeanPool/PDL/Interpolation/Uniformity.lean +++ b/LeanPool/PDL/Interpolation/Uniformity.lean @@ -53,7 +53,7 @@ proved there. The section `Uniformity` below therefore repeats those that are ne under different names. -/ -@[expose] public section +public section namespace PDL @@ -67,11 +67,11 @@ def Sequent.leftOnly (X : Sequent) : Sequent := ⟨X.1, ∅, X.2.2⟩ is on the right, i.e. in the situation of a `LoadedCluster`, this is the *unloaded* component `Λ₁` of the node, and `Sequent.leftFree X |>.basic` says that no local rule is applicable to it. -/ -def Sequent.leftFree (X : Sequent) : Sequent := ⟨X.1, ∅, none⟩ +@[expose] def Sequent.leftFree (X : Sequent) : Sequent := ⟨X.1, ∅, none⟩ /-- The right component of a sequent, without any loaded formula. When the loaded formula is on the left this is the *unloaded* component `Λ₂` of the node. -/ -def Sequent.rightFree (X : Sequent) : Sequent := ⟨∅, X.2.1, none⟩ +@[expose] def Sequent.rightFree (X : Sequent) : Sequent := ⟨∅, X.2.1, none⟩ /-- Two local rule applications use the same rule with the same principal formulas. The fields `Lcond`, `Rcond` and `Ocond` are the principal formulas and `ress` is the list @@ -347,7 +347,7 @@ def LocalTableau.IsUni : {X : Sequent} → LocalTableau X → Prop lra.IsUniChoice ∧ ∀ Y, ∀ h : Y ∈ lra.C, (next Y h).IsUni /-- All local rule applications inside a tableau are uniform choices. -/ -def Tableau.IsUni : {H : History} → {X : Sequent} → Tableau H X → Prop +@[expose] def Tableau.IsUni : {H : History} → {X : Sequent} → Tableau H X → Prop | _, _, .loc _ _ lt next => lt.IsUni ∧ ∀ Y, ∀ h : Y ∈ endNodesOf lt, (next Y h).IsUni | _, _, .pdl _ _ _ next => next.IsUni | _, _, .lrep _ => True @@ -1561,7 +1561,7 @@ lemma lra_or_basic_of_usesRightRule : ∀ {H : History} {Z : Sequent} /-- The right component of the child obtained by applying the modal rule `(M)` to a sequent whose loaded formula `~⌊·A⌋ξ` is on the right. Same as `modRChildRightOnly` in `Pdl.ClusterInterpolation`. -/ -def modRChildRight (A : Nat) (ξ : AnyFormula) (R : Finset Formula) : Sequent := +@[expose] def modRChildRight (A : Nat) (ξ : AnyFormula) (R : Finset Formula) : Sequent := match ξ with | .normal φ => ⟨∅, {~φ} ∪ R.pdlProjection A, none⟩ | .loaded χ => ⟨∅, R.pdlProjection A, some (Sum.inr (~'χ))⟩ diff --git a/LeanPool/PDL/KeepRight.lean b/LeanPool/PDL/KeepRight.lean index 341395495f..bf25af40eb 100644 --- a/LeanPool/PDL/KeepRight.lean +++ b/LeanPool/PDL/KeepRight.lean @@ -15,7 +15,7 @@ on the right, can only lead to a node that is loaded on the right or free, and t rule adds formulas to an empty left component. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Local/AllLocalTab.lean b/LeanPool/PDL/Local/AllLocalTab.lean index 598614c889..013db0f557 100644 --- a/LeanPool/PDL/Local/AllLocalTab.lean +++ b/LeanPool/PDL/Local/AllLocalTab.lean @@ -17,7 +17,7 @@ We show that for any `X` the type `LocalTableau` is finite. This is needed to define `BuildTree` as a finite tree. -/ -@[expose] public section +public section namespace PDL @@ -85,6 +85,7 @@ lemma pair_neg_cases {φ a b : Formula} (h : ({φ, ~φ} : Finset Formula) = {a, /-! ## All one-sided local rules -/ /-- Transport a `OneSidedLocalRule` along an equality of preconditions. -/ +@[expose] def osrCast {L L' B} (h : L = L') (r : OneSidedLocalRule L' B) : OneSidedLocalRule L B := by rw [h]; exact r @@ -93,6 +94,7 @@ lemma osrCast_self {L B} (h : L = L) (r : OneSidedLocalRule L B) : osrCast h r = /-- Given the sorted list of the formulas in `L`, is there a `OneSidedLocalRule` for `L`? The pair case comes first so that the equations below hold by `rfl`. -/ +@[expose] def OneSidedLocalRule.ofSorted : (L : Finset Formula) → (l : List Formula) → L.pdlSort = l → Option (Σ B, OneSidedLocalRule L B) | _, [a, b], h => if hb : b = ~a @@ -143,6 +145,7 @@ lemma ofSorted_dia {L α φ} (h : L.pdlSort = [~⌈α⌉φ]) : then some ⟨_, osrCast (pdlSort_eq_singleton h) (.dia α φ notAtm)⟩ else none := rfl /-- Is there a `OneSidedLocalRule` applicable to `L`? -/ +@[expose] def all (L : Finset Formula) : Option (Σ B, OneSidedLocalRule L B) := ofSorted L L.pdlSort rfl lemma all_eq_ofSorted {L l} (h : L.pdlSort = l) : all L = ofSorted L l h := by cases h; rfl @@ -205,14 +208,14 @@ instance LoadRule.fintype {nχ ress} : Fintype (LoadRule nχ ress) := /-! ## All local rules -/ /-- Transport a `LocalRule` along an equality of the conditions. -/ -def lrCast {c c' ress} (h : c = c') (r : LocalRule c' ress) : LocalRule c ress := by +@[expose] def lrCast {c c' ress} (h : c = c') (r : LocalRule c' ress) : LocalRule c ress := by rw [h]; exact r @[simp] lemma lrCast_self {c ress} (h : c = c) (r : LocalRule c ress) : lrCast h r = r := rfl /-- Helper for `LocalRule.all`, dealing with the two closing rules `LRnegL` and `LRnegR`. -/ -def LocalRule.negPairOf : (L R : Finset Formula) → (lL lR : List Formula) → +@[expose] def LocalRule.negPairOf : (L R : Finset Formula) → (lL lR : List Formula) → L.pdlSort = lL → R.pdlSort = lR → Option (Σ ress, LocalRule (L, R, none) ress) | _, _, [φ1], [φ2], hL, hR => if h : φ2 = ~φ1 then @@ -234,7 +237,7 @@ lemma LocalRule.negPairOf_singletons {L R φ1 φ2} (hL : L.pdlSort = [φ1]) (hR /-- Given a subsequent `cond` to be replaced, is there an applicable local rule? Note that `cond` are only the principal formulas, not the whole sequent. -/ -def LocalRule.all : (cond : Sequent) → Option (Σ ress, LocalRule cond ress) +@[expose] def LocalRule.all : (cond : Sequent) → Option (Σ ress, LocalRule cond ress) | (L, R, none) => if hR : R = ∅ then (OneSidedLocalRule.all L).map diff --git a/LeanPool/PDL/Local/Path.lean b/LeanPool/PDL/Local/Path.lean index 90007bc28b..907cd72df2 100644 --- a/LeanPool/PDL/Local/Path.lean +++ b/LeanPool/PDL/Local/Path.lean @@ -15,7 +15,7 @@ from the root to an end node, and show that they are saturated and locally consi This is used for the pre-states in the completeness proof, see `BuildTree.lean`. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Local/Rules.lean b/LeanPool/PDL/Local/Rules.lean index bbaba80f81..f08f59b4d8 100644 --- a/LeanPool/PDL/Local/Rules.lean +++ b/LeanPool/PDL/Local/Rules.lean @@ -14,7 +14,7 @@ public import Mathlib.Data.Finset.Sort /-! ## Local rules and local rule applications -/ -@[expose] public section +public section namespace PDL @@ -100,7 +100,7 @@ lemma OneSidedLocalRule.precond_ne_nil {precond ress} (orule : OneSidedLocalRule /-! ## Loaded Rules -/ /-- Convert list-valued formula components to finsets while preserving optional loadings. -/ -@[simp] +@[expose, simp] def _root_.List.pdlToFinFinOpt [DecidableEq α] [DecidableEq β] : List (List α × Option β) → Finset (Finset α × Option β) | LS => (LS.map (fun ⟨L,O⟩ => ⟨L.toFinset, O⟩)).toFinset @@ -322,8 +322,7 @@ instance localRuleSubsingleton (X YS) : Subsingleton (LocalRule X YS) := instance {YS} : DecidableEq (LocalRule X YS) := fun a b => isTrue (Subsingleton.elim a b) /-- Replace a rule's preconditions by each of its possible result sequents. -/ -@[simp] -def applyLocalRule {Lcond Rcond Ocond ress} : +@[expose, simp] def applyLocalRule {Lcond Rcond Ocond ress} : LocalRule (Lcond, Rcond, Ocond) ress → Sequent → Finset Sequent | _, ⟨L, R, O⟩ => ress.image <| fun (Lnew, Rnew, Onew) => ( L \ Lcond ∪ Lnew @@ -1613,7 +1612,7 @@ lemma LocalRuleApp.formula_preserved_or_expanded (lra : LocalRuleApp) {Y : Seque removing double negations, splitting (negated) conjunctions, unfolding boxes using any test profile, and unfolding diamonds using `H`. Part of Def 6.2 -/ -def saturated : Finset Formula → Prop +@[expose] def saturated : Finset Formula → Prop | X => ∀ (φ ψ : Formula) (α : Program), -- propositional closure: ((~~φ) ∈ X → φ ∈ X) @@ -1671,7 +1670,7 @@ lemma Sequent.basic_then_saturated {X : Sequent} : X.basic → saturated X.toFin /-- A set of formulas is *lcoally consistent* iff it does not contain `⊥` and for all atoms `p ∈ X` we do not have `~p ∈ X`. Part of Def 6.2 -/ -def locallyConsistent (X : Finset Formula) : Prop := +@[expose] def locallyConsistent (X : Finset Formula) : Prop := ⊥ ∉ X.val ∧ ∀ pp, (·pp : Formula) ∈ X.val → (~(·pp)) ∉ X.val lemma Sequent.basic_to_locallyConsistent {X : Sequent} (bas : X.basic) : diff --git a/LeanPool/PDL/Local/Soundness.lean b/LeanPool/PDL/Local/Soundness.lean index 5a545bba67..d4c4a8ccf6 100644 --- a/LeanPool/PDL/Local/Soundness.lean +++ b/LeanPool/PDL/Local/Soundness.lean @@ -11,7 +11,7 @@ public import LeanPool.PDL.Local.Tableau /-! # Local Lemmas for Soundness (part of Section 6) -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Local/Tableau.lean b/LeanPool/PDL/Local/Tableau.lean index f0f02c77ce..683b6c1a1b 100644 --- a/LeanPool/PDL/Local/Tableau.lean +++ b/LeanPool/PDL/Local/Tableau.lean @@ -15,7 +15,7 @@ public import LeanPool.PDL.Local.Rules /-! # Local Tableaux (Section 3) -/ -@[expose] public section +public section namespace PDL @@ -79,8 +79,7 @@ open LocalTableau /-- The local measure which together with D-M can be used to show that LocalTableau are finite. Note that different from the paper here we also add `lmOfFormula (~φ)` in the `~⌈α⌉φ` case. This is needed to get `lmOfFormula_lt_dia_of_nonAtom`. -/ -@[simp] -def lmOfFormula : (f : Formula) → Nat +@[expose, simp] def lmOfFormula : (f : Formula) → Nat | ⊥ => 0 | ~⊥ => 0 | ·_ => 0 @@ -417,8 +416,7 @@ lemma measureProp {α : Program} {φ φ₁ φ₂ : Formula} : linarith /-- The end sequents of a local tableau. -/ -@[simp] -def endNodesOf : {X : _} → LocalTableau X → Finset Sequent +@[expose, simp] def endNodesOf : {X : _} → LocalTableau X → Finset Sequent | .(_), (@byLocalRule X lra _ next) => (lra.C.attach.image (fun ⟨Y, h⟩ => endNodesOf (next Y h))).sup id | .(_), (@sim X _) => {X} @@ -429,7 +427,7 @@ def endNodesOf : {X : _} → LocalTableau X → Finset Sequent -- apply localRuleApp.decreases_DM lra Y h /-- An open local tableau has at least one end node. -/ -def OpenLocalTableau (X : Sequent) : Type := {lt : LocalTableau X // endNodesOf lt ≠ {}} +@[expose] def OpenLocalTableau (X : Sequent) : Type := {lt : LocalTableau X // endNodesOf lt ≠ {}} deriving DecidableEq /-! ## The Dershowitz-Manna ordering on sequents -/ diff --git a/LeanPool/PDL/Local/UnfoldBox.lean b/LeanPool/PDL/Local/UnfoldBox.lean index 80e4a7418d..5ccad39829 100644 --- a/LeanPool/PDL/Local/UnfoldBox.lean +++ b/LeanPool/PDL/Local/UnfoldBox.lean @@ -15,7 +15,7 @@ public import LeanPool.PDL.Star /-! # Local Box Unfolding (Section 3.1) -/ -@[expose] public section +public section namespace PDL @@ -52,7 +52,7 @@ instance : CoeOut (TP (∗α)) (TP α) := /-- List of all test profiles for a given program. Note that in contrast to `Fintype.elems : Finset (TP α)` here we get a computable List (TP α). -/ -def allTP α : List (TP α) := (testsOfProgram α).sublists.map (fun l ⟨τ, _⟩ => τ ∈ l) +@[expose] def allTP α : List (TP α) := (testsOfProgram α).sublists.map (fun l ⟨τ, _⟩ => τ ∈ l) /-- All test profiles are in the list of all test profiles. Thanks to Floris van Doorn @@ -137,7 +137,7 @@ Note: In `F`, `P` and `Bset` we use lists not sets, to eventually make formulas. -/ /-- The test constraints produced by box unfolding under a test profile. -/ -def F : (α : Program) → (ℓ : TP α) → List Formula +@[expose] def F : (α : Program) → (ℓ : TP α) → List Formula | ·_ , _ => ∅ | ?'τ, ℓ => if ℓ ⟨τ, by simp [testsOfProgram]⟩ then ∅ else [~ τ] | α⋓β, ℓ => F α ℓ ∪ F β ℓ @@ -163,7 +163,7 @@ lemma F_sub_testsOfProgram_map_neg (α : Program) (ℓ : TP α) : split <;> grind /-- The residual program sequences produced by box unfolding under a test profile. -/ -def P : (α : Program) → (ℓ : TP α) → List (List Program) +@[expose] def P : (α : Program) → (ℓ : TP α) → List (List Program) | ·a, _ => [ [(·a : Program)] ] | ?' τ, ℓ => if ℓ ⟨τ, by simp [testsOfProgram]⟩ then [ [] ] else ∅ | α ⋓ β, ℓ => P α ℓ ∪ P β ℓ @@ -172,11 +172,11 @@ def P : (α : Program) → (ℓ : TP α) → List (List Program) | ∗α, ℓ => [ [] ] ∪ ((P α ℓ).filter (· != [])).map (fun as => as ++ [∗α]) /-- The test constraints and residual boxes in one branch of box unfolding. -/ -def Bset (α : Program) (ℓ : TP α) (ψ : Formula) : List Formula := +@[expose] def Bset (α : Program) (ℓ : TP α) (ψ : Formula) : List Formula := F α ℓ ++ (P α ℓ).map (fun as => Formula.boxes as ψ) /-- unfold_□(α,ψ) -/ -def unfoldBox (α : Program) (φ : Formula) : List (List Formula) := +@[expose] def unfoldBox (α : Program) (φ : Formula) : List (List Formula) := (allTP α).map (fun ℓ => Bset α ℓ φ) theorem F_mem_iff_neg α (ℓ : TP α) φ : diff --git a/LeanPool/PDL/Local/UnfoldDia.lean b/LeanPool/PDL/Local/UnfoldDia.lean index c82be42425..e3ce55ed1f 100644 --- a/LeanPool/PDL/Local/UnfoldDia.lean +++ b/LeanPool/PDL/Local/UnfoldDia.lean @@ -13,7 +13,7 @@ public import LeanPool.PDL.Star /-! # Local Diamond Unfolding (Section 3.2 and 3.3) -/ -@[expose] public section +public section namespace PDL @@ -21,7 +21,7 @@ namespace PDL /-- Unfold a given program into combinations of test formulas and lists of programs, assuming the program is used inside a diamond. -/ -def Dset : Program → List (List Formula × List Program) +@[expose] def Dset : Program → List (List Formula × List Program) | ·a => [ ([], [·a]) ] | ?'τ => [ ([τ], []) ] | α ⋓ β => Dset α ∪ Dset β @@ -33,7 +33,7 @@ def Dset : Program → List (List Formula × List Program) /-- Like `Dset`, but applied to a whole list of programs. This is used to deal with loaded diamonds. -/ -def Dl : List Program → List (List Formula × List Program) +@[expose] def Dl : List Program → List (List Formula × List Program) | [] => [([],[])] | [α] => Dset α | α :: rest => (Dset α).flatMap (fun ⟨F,δ⟩ => -- inspired by `;` case of `H` @@ -306,11 +306,11 @@ theorem Dset_goes_down_prog (α : Program) {Fs δ} (in_D : (Fs, δ) ∈ Dset α) simp_all [Dset] /-- An intermediate step to define `unfoldDiamond`. This is not used in the paper. -/ -def Yset : (List Formula × List Program) → Formula → List Formula +@[expose] def Yset : (List Formula × List Program) → Formula → List Formula | ⟨F, δ⟩, φ => F ∪ [ ~ Formula.boxes δ φ ] /-- Φ_◇(α,ψ) -/ -def unfoldDiamond (α : Program) (φ : Formula) : List (List Formula) := +@[expose] def unfoldDiamond (α : Program) (φ : Formula) : List (List Formula) := (Dset α).map (fun Fδ => Yset Fδ φ) /-- Where formulas in the diamond unfolding can come from. Inspired by unfoldBoxContent. -/ @@ -777,7 +777,7 @@ theorem localDiamondTruth γ ψ : (~⌈γ⌉ψ) ≡ dis ( (Dset γ).map (fun Fδ exact localDiamondTruth_star β ψ (localDiamondTruth β) W M w /-- Helper function to trick "List.Chain r" to use a different r at each step. -/ -def pairRel (M : KripkeModel W) : (Program × W) → (Program × W) → Prop +@[expose] def pairRel (M : KripkeModel W) : (Program × W) → (Program × W) → Prop | (_, v), (α, w) => relate M α v w -- use later for Modelgraphs @@ -900,32 +900,34 @@ The `Option` is used here because unfolding of tests can lead to free nodes. -/ /-- Attach a residual program sequence to an already loaded continuation. -/ +@[expose] def YsetLoad : (List Formula × List Program) → LoadFormula → (List Formula × Option NegLoadFormula) | ⟨F, δ⟩, χ => ⟨F , ~' (LoadFormula.boxes δ χ)⟩ /-- Load a residual sequence over an ordinary formula, or unload it when the sequence is empty. -/ +@[expose] def YsetLoad' : (List Formula × List Program) → Formula → (List Formula × Option NegLoadFormula) | ⟨F, δ⟩, φ => match splitLast δ with | none => ⟨F ∪ [~φ], none⟩ | some (δ, β) => ⟨F , ~' (loadMulti δ β φ)⟩ /-- Loaded unfolding for ~'⌊α⌋(χ : LoadFormula) -/ -def unfoldDiamondLoaded (α : Program) (χ : LoadFormula) : +@[expose] def unfoldDiamondLoaded (α : Program) (χ : LoadFormula) : List (List Formula × Option NegLoadFormula) := (Dset α).map (fun Fδ => YsetLoad Fδ χ) /-- Loaded unfolding for ~'⌊α⌋(φ : Formula) -/ -def unfoldDiamondLoaded' (α : Program) (φ : Formula) : +@[expose] def unfoldDiamondLoaded' (α : Program) (φ : Formula) : List (List Formula × Option NegLoadFormula) := (Dset α).map (fun Fδ => YsetLoad' Fδ φ) /-- Merge an optional loaded formula into a list of ordinary formulas by unloading it. -/ -def pairUnload : List Formula × Option NegLoadFormula → List Formula +@[expose] def pairUnload : List Formula × Option NegLoadFormula → List Formula | (xs, none) => xs | (xs, some nlf) => xs ∪ [negUnload nlf] /-- Merge an optional loaded formula into a finset of ordinary formulas by unloading it. -/ -def pairUnloadSet : Finset Formula × Option NegLoadFormula → Finset Formula +@[expose] def pairUnloadSet : Finset Formula × Option NegLoadFormula → Finset Formula | (xs, none) => xs | (xs, some nlf) => xs ∪ {negUnload nlf} diff --git a/LeanPool/PDL/PdlSteps.lean b/LeanPool/PDL/PdlSteps.lean index 1d70537baf..a45b2234d1 100644 --- a/LeanPool/PDL/PdlSteps.lean +++ b/LeanPool/PDL/PdlSteps.lean @@ -25,7 +25,7 @@ The main results are: `a`-successor of a free basic sequent. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/Semantics.lean b/LeanPool/PDL/Semantics.lean index d99ae9840f..a4ffcfcdf3 100644 --- a/LeanPool/PDL/Semantics.lean +++ b/LeanPool/PDL/Semantics.lean @@ -21,7 +21,7 @@ public import LeanPool.PDL.General.ListFinset /-! # Semantics (Section 2.2) -/ -@[expose] public section +public section namespace PDL @@ -44,16 +44,14 @@ def complexityOfQuery {W : Type} : mutual /-- Truth of a PDL formula at a world in a Kripke model. -/ - @[simp] - def evaluate {W : Type} : KripkeModel W → W → Formula → Prop + @[expose, simp] def evaluate {W : Type} : KripkeModel W → W → Formula → Prop | _, _, ⊥ => False | M, w, ·c => M.val w c | M, w, ~φ => Not (evaluate M w φ) | M, w, φ⋀ψ => evaluate M w φ ∧ evaluate M w ψ | M, w, ⌈α⌉ φ => ∀ v : W, relate M α w v → evaluate M v φ /-- The binary relation denoted by a PDL program in a Kripke model. -/ - @[simp] - def relate {W : Type} : KripkeModel W → Program → W → W → Prop + @[expose, simp] def relate {W : Type} : KripkeModel W → Program → W → W → Prop | M, ·c, w, v => M.Rel c w v | M, α;'β, w, v => ∃ y, relate M α w y ∧ relate M β y v | M, α⋓β, w, v => relate M α w v ∨ relate M β w v @@ -72,16 +70,15 @@ theorem evalDis {W M f g} {w : W} : evaluate M w (f⋁g) ↔ evaluate M w f ∨ tauto /-- Evaluate a formula at a pointed Kripke model. -/ -@[simp] -def evaluatePoint {W : Type} : KripkeModel W × W → Formula → Prop +@[expose, simp] def evaluatePoint {W : Type} : KripkeModel W × W → Formula → Prop | (M, w), ϕ => evaluate M w ϕ /-- Validity of a formula at every world of every Kripke model. -/ -def tautology (φ : Formula) := +@[expose] def tautology (φ : Formula) := ∀ (W : Type) (M : KripkeModel W) w, evaluate M w φ /-- Falsity of a formula at every world of every Kripke model. -/ -def contradiction (φ : Formula) := +@[expose] def contradiction (φ : Formula) := ∀ (W : Type) (M : KripkeModel W) w, ¬evaluate M w φ /-! ## Satisfiability -/ @@ -115,16 +112,16 @@ def semImpliesSets (X : Finset Formula) (Y : Finset Formula) := (∀ φ ∈ X, evaluate M w φ) → ∀ ψ ∈ Y, evaluate M w ψ /-- Semantic consequence between lists of formulas. -/ -def semImpliesLists (X : List Formula) (Y : List Formula) := +@[expose] def semImpliesLists (X : List Formula) (Y : List Formula) := ∀ (W : Type) (M : KripkeModel W) (w), (∀ φ ∈ X, evaluate M w φ) → ∀ ψ ∈ Y, evaluate M w ψ /-- Agreement of two formulas at every pointed Kripke model. -/ -def semEquiv (φ ψ : Formula) := +@[expose] def semEquiv (φ ψ : Formula) := ∀ (W : Type) (M : KripkeModel W) w, evaluate M w φ ↔ evaluate M w ψ /-- Agreement of two program relations in every Kripke model. -/ -def relEquiv (α β : Program) := +@[expose] def relEquiv (α β : Program) := ∀ (W : Type) (M : KripkeModel W) v w, relate M α v w ↔ relate M β v w theorem notsatisfnotThenTaut : ∀ φ, ¬ satisfiable (~φ) → tautology φ := @@ -339,7 +336,7 @@ theorem rel_steps_last {as} : ∀ v w, tauto /-- Relational composition of a list of programs, with equality for the empty list. -/ -def relateSeq {W} (M : KripkeModel W) (δ : List Program) (w v : W) : Prop := +@[expose] def relateSeq {W} (M : KripkeModel W) (δ : List Program) (w v : W) : Prop := match δ with | [] => w = v | (α::as) => ∃ u, relate M α w u ∧ relateSeq M as u v diff --git a/LeanPool/PDL/Sequent.lean b/LeanPool/PDL/Sequent.lean index 0bd237934c..dd018cb4c5 100644 --- a/LeanPool/PDL/Sequent.lean +++ b/LeanPool/PDL/Sequent.lean @@ -14,7 +14,7 @@ public import LeanPool.PDL.Discon /-! # Sequents -/ -@[expose] public section +public section namespace PDL @@ -86,7 +86,7 @@ lemma Option.insHasSdiff_remove_sem_eq_none [DecidableEq α] : grind /-- The unloaded left formula contributed by an optional loading. -/ -def Olf.L : Olf → Finset Formula +@[expose] def Olf.L : Olf → Finset Formula | none => {} | some (Sum.inl ⟨lf⟩) => {~ lf.unload} | some (Sum.inr _) =>{} @@ -111,7 +111,7 @@ lemma Olf.L_sdiff_subset {O Ocond : Olf} : (O \ Ocond).L ⊆ O.L := by by_cases h : χ = χ' <;> simp_all [SDiff.sdiff, Olf.L] /-- The unloaded right formula contributed by an optional loading. -/ -def Olf.R : Olf → Finset Formula +@[expose] def Olf.R : Olf → Finset Formula | none => {} | some (Sum.inl _) => {} | some (Sum.inr ⟨lf⟩) => {~ lf.unload} @@ -136,12 +136,12 @@ lemma Olf.R_sdiff_subset {O Ocond : Olf} : (O \ Ocond).R ⊆ O.R := by by_cases h : χ = χ' <;> simp_all [SDiff.sdiff, Olf.R] /-- Use the new optional value when present, otherwise retain the old value. -/ -@[simp] -def _root_.Option.pdlOverwrite : Option α → Option α → Option α +@[expose, simp] def _root_.Option.pdlOverwrite : Option α → Option α → Option α | old, none => old | _ , some x => some x /-- Remove the rule's required loading and install its new loading when present. -/ +@[expose] def Olf.change (oldO : Olf) (Ocond : Olf) (newO : Olf) : Olf := (oldO \ Ocond).pdlOverwrite newO @[simp] @@ -162,22 +162,20 @@ theorem Olf.change_some_some_eq {Onew nχ} : Olf.change (some nχ) (some nχ) On cases Onew <;> simp [Olf.change, Option.pdlOverwrite] /-- Whether the optional loading is absent. -/ -@[simp] +@[expose, simp] def Olf.isNone : Olf → Prop | .none => True | .some (Sum.inl _) => False | .some (Sum.inr _) => False /-- Whether the optional loading belongs to the left component. -/ -@[simp] -def Olf.isLeft : Olf → Prop +@[expose, simp] def Olf.isLeft : Olf → Prop | .none => False | .some (Sum.inl _) => True | .some (Sum.inr _) => False /-- Whether the optional loading belongs to the right component. -/ -@[simp] -def Olf.isRight : Olf → Prop +@[expose, simp] def Olf.isRight : Olf → Prop | .none => False | .some (Sum.inl _) => False | .some (Sum.inr _) => True @@ -204,25 +202,22 @@ instance instDecidableOlfisRight (o : Olf) : Decidable o.isRight := by /-- A tableau node is labelled with two finite sets of formulas and an `Olf`. Each formula is placed on the left or right and up to one formula may be loaded. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def Sequent := Finset Formula × Finset Formula × Olf -- ⟨L, R, o⟩ deriving DecidableEq, Repr /-- All ordinary formulas of a sequent, including its loading after unloading. -/ -def Sequent.toFinset : Sequent → Finset Formula +@[expose] def Sequent.toFinset : Sequent → Finset Formula | (L,R,O) => (L ∪ R) ∪ (O.map (Sum.elim negUnload negUnload)).toFinset /-! ## Components and sides of sequents -/ /-- The ordinary formulas in the left component. -/ -@[grind .] -def Sequent.L : Sequent → Finset Formula | ⟨L,_,_⟩ => L +@[expose, grind .] def Sequent.L : Sequent → Finset Formula | ⟨L,_,_⟩ => L /-- The ordinary formulas in the right component. -/ -@[grind .] -def Sequent.R : Sequent → Finset Formula | ⟨_,R,_⟩ => R +@[expose, grind .] def Sequent.R : Sequent → Finset Formula | ⟨_,R,_⟩ => R /-- The optional loaded formula and its side. -/ -@[grind .] -def Sequent.O : Sequent → Olf | ⟨_,_,O⟩ => O +@[expose, grind .] def Sequent.O : Sequent → Olf | ⟨_,_,O⟩ => O @[simp] lemma Sequent.L_eq {L R O} : Sequent.L ⟨L,R,O⟩ = L := by simp [Sequent.L] @@ -232,9 +227,9 @@ lemma Sequent.R_eq {L R O} : Sequent.R ⟨L,R,O⟩ = R := by simp [Sequent.R] lemma Sequent.O_eq {L R O} : Sequent.O ⟨L,R,O⟩ = O := by simp [Sequent.O] /-- The left component including any left loading after unloading. -/ -def Sequent.left (X : Sequent) : Finset Formula := X.L ∪ X.O.L +@[expose] def Sequent.left (X : Sequent) : Finset Formula := X.L ∪ X.O.L /-- The right component including any right loading after unloading. -/ -def Sequent.right (X : Sequent) : Finset Formula := X.R ∪ X.O.R +@[expose] def Sequent.right (X : Sequent) : Finset Formula := X.R ∪ X.O.R @[simp] lemma Sequent.left_eq {L R O} : Sequent.left ⟨L,R,O⟩ = L ∪ O.L := by simp [Sequent.left] @@ -245,7 +240,7 @@ lemma Sequent.right_eq {L R O} : Sequent.right ⟨L,R,O⟩ = R ∪ O.R := by sim /-! ## (Joint) vocabulary of sequents -/ /-- Like `Olf.voc` but without the ⊕ inside. -/ -def onlfvoc : Option NegLoadFormula → Vocab +@[expose] def onlfvoc : Option NegLoadFormula → Vocab | none => ∅ | some nlf => nlf.voc @@ -254,12 +249,11 @@ def lfovoc (L : List (List Formula × Option NegLoadFormula)) : Vocab := L.toFinset.sup (fun ⟨fs,o⟩ => fs.pdlFvoc ∪ (onlfvoc o)) /-- `Finset` version of `lfovoc`. -/ -def lfovocFin (L : Finset (Finset Formula × Option NegLoadFormula)) : Vocab := +@[expose] def lfovocFin (L : Finset (Finset Formula × Option NegLoadFormula)) : Vocab := L.sup (fun ⟨fs,o⟩ => fs.pdlFvoc ∪ (onlfvoc o)) /-- The joint vocabulary occurring on both the left and the right side. -/ -@[simp] -def jvoc (X : Sequent) : Vocab := (X.left).pdlFvoc ∩ (X.right).pdlFvoc +@[expose, simp] def jvoc (X : Sequent) : Vocab := (X.left).pdlFvoc ∩ (X.right).pdlFvoc lemma jvoc_sub_of_voc_sub {Y X : Sequent} (hl : Y.left.pdlFvoc ⊆ X.left.pdlFvoc) @@ -294,8 +288,7 @@ instance instFintypeSubtypeMemSequent {X : Sequent} : Fintype (Subtype (fun x => aesop /-- Whether the specified loaded formula is the loading on either side of a sequent. -/ -@[simp] -def NegLoadFormula.memSequent (X : Sequent) (nlf : NegLoadFormula) : Prop := +@[expose, simp] def NegLoadFormula.memSequent (X : Sequent) (nlf : NegLoadFormula) : Prop := X.O = some (Sum.inl nlf) ∨ X.O = some (Sum.inr nlf) instance {nlf} : Decidable (NegLoadFormula.memSequent ⟨L,R,O⟩ nlf) := by @@ -309,7 +302,7 @@ instance instMembershipNegLoadFormulaSequent : Membership NegLoadFormula Sequent := ⟨NegLoadFormula.memSequent⟩ /-- Membership of a negated ordinary or loaded formula in a sequent. -/ -def AnyNegFormula.memSequent : (X : Sequent) → (anf : AnyNegFormula) → Prop +@[expose] def AnyNegFormula.memSequent : (X : Sequent) → (anf : AnyNegFormula) → Prop | X, ⟨.normal φ⟩ => (~φ) ∈ X | X, ⟨.loaded χ⟩ => instMembershipNegLoadFormulaSequent.mem X (~'χ) -- Note: writing `∈` does not work because the first argument of `Membership` is `outParam`. @@ -320,11 +313,11 @@ instance : Membership AnyNegFormula Sequent := ⟨AnyNegFormula.memSequent⟩ /-! ## Closed, basic, loaded and free sequents -/ /-- A sequent is *closed* iff it contains `⊥` or contains a formula and its negation. -/ -def Sequent.closed (X : Sequent) : Prop := +@[expose] def Sequent.closed (X : Sequent) : Prop := ⊥ ∈ X ∨ ∃ f ∈ X, (~f) ∈ X /-- A sequent is *basic* iff it only contains basic formulas and is not closed. -/ -def Sequent.basic : Sequent → Prop +@[expose] def Sequent.basic : Sequent → Prop | X => (∀ f ∈ X.toFinset, f.basic) ∧ ¬ X.closed /-- A variant of `Fintype.decidableExistsFintype`, used by `instDecidableClosed`. -/ @@ -361,7 +354,7 @@ instance instDecidableBasic {X : Sequent} : Decidable (X.basic) := by assumption /-- Whether a sequent carries a loaded formula. -/ -def Sequent.isLoaded : Sequent → Prop +@[expose] def Sequent.isLoaded : Sequent → Prop | ⟨_, _, none ⟩ => False | ⟨_, _, some _⟩ => True @@ -376,7 +369,7 @@ instance instDecidableSequentisLoaded (X : Sequent) : Decidable (X.isLoaded) := · apply isTrue; simp_all [Sequent.isLoaded] /-- Whether a sequent has no loaded formula. -/ -def Sequent.isFree (Γ : Sequent) : Prop := ¬ Γ.isLoaded +@[expose] def Sequent.isFree (Γ : Sequent) : Prop := ¬ Γ.isLoaded instance instDecidableSequentisFree (X : Sequent) : Decidable (X.isFree) := by rcases X with ⟨_, _, _|_⟩ @@ -438,7 +431,7 @@ lemma Sequent.satisfiable_top_cons_right {X : Sequent} (h_left_nil : X.left = {} /-! ## Removing loaded formulas from sequents -/ /-- Remove a negated formula from the ordinary components or from the optional loading. -/ -def Sequent.without : (LRO : Sequent) → (naf : AnyNegFormula) → Sequent +@[expose] def Sequent.without : (LRO : Sequent) → (naf : AnyNegFormula) → Sequent | ⟨L,R,O⟩, ⟨.normal f⟩ => ⟨L \ {~f}, R \ {~f}, O⟩ | ⟨L,R,O⟩, ⟨.loaded lf⟩ => if ((~'lf).memSequent ⟨L,R,O⟩) then ⟨L, R, none⟩ else ⟨L,R,O⟩ @@ -500,13 +493,13 @@ inductive Side | RR : Side /-- The component indicated by a sum constructor. -/ -@[simp] +@[expose, simp] def sideOf : Sum α α → Side | Sum.inl _ => .LL | Sum.inr _ => .RR /-- Membership of a negated formula in the specified sequent component. -/ -def AnyNegFormula.inSide : (anf : AnyNegFormula) → Side → (X : Sequent) → Prop +@[expose] def AnyNegFormula.inSide : (anf : AnyNegFormula) → Side → (X : Sequent) → Prop | ⟨.normal φ⟩, .LL, ⟨L, _, _⟩ => (~φ) ∈ L | ⟨.normal φ⟩, .RR, ⟨_, R, _⟩ => (~φ) ∈ R | ⟨.loaded χ⟩, .LL, ⟨_, _, O⟩ => O = some (Sum.inl (~'χ)) @@ -622,7 +615,7 @@ These could be moved to a separate file (or even might be in newer versions of M /-- Lexicographic extension of a relation `le` to lists: shorter lists come first, and lists of the same shape are compared element-wise from left to right. -/ -def listLex {α : Type} (le : α → α → Prop) : List α → List α → Prop +@[expose] def listLex {α : Type} (le : α → α → Prop) : List α → List α → Prop | [], _ => True | _ :: _, [] => False | a :: as, b :: bs => le a b ∧ (a = b → listLex le as bs) @@ -680,7 +673,7 @@ lemma listLex_total {α : Type} {le : α → α → Prop} (hrefl : ∀ a, le a a · exact Or.inr ⟨h, fun he => absurd he.symm hab⟩ /-- Lexicographic combination of two relations on a product type. -/ -def prodLex {α β : Type} (le1 : α → α → Prop) (le2 : β → β → Prop) : α × β → α × β → Prop +@[expose] def prodLex {α β : Type} (le1 : α → α → Prop) (le2 : β → β → Prop) : α × β → α × β → Prop | (a, b), (a', b') => le1 a a' ∧ (a = a' → le2 b b') instance prodLex.instDecidableRel {α β : Type} [DecidableEq α] (le1 : α → α → Prop) @@ -794,7 +787,7 @@ lemma Sequent.key_injective {X Y : Sequent} (h : X.key = Y.key) : X = Y := by (Prod.ext (Finset.pdlSort_injective h.2.1) (Olf.key_injective h.2.2)) /-- Order used to compare the keys of `Olf`s. -/ -def olfKeyLe : (ℕ × (List Program × Formula)) → (ℕ × (List Program × Formula)) → Prop := +@[expose] def olfKeyLe : (ℕ × (List Program × Formula)) → (ℕ × (List Program × Formula)) → Prop := prodLex (fun (n m : ℕ) => n ≤ m) (prodLex (listLex Program.le) Formula.le) instance : DecidableRel olfKeyLe := by unfold olfKeyLe; infer_instance @@ -818,14 +811,14 @@ lemma olfKeyLe_total (x y) : olfKeyLe x y ∨ olfKeyLe y x := (listLex_total Program.le_rfl Program.le_total) Formula.le_total) x y /-- Order used to compare the keys of sequents. -/ -def seqKeyLe : (List Formula × (List Formula × (ℕ × (List Program × Formula)))) → +@[expose] def seqKeyLe : (List Formula × (List Formula × (ℕ × (List Program × Formula)))) → (List Formula × (List Formula × (ℕ × (List Program × Formula)))) → Prop := prodLex (listLex Formula.le) (prodLex (listLex Formula.le) olfKeyLe) instance : DecidableRel seqKeyLe := by unfold seqKeyLe; infer_instance /-- A linear order on sequents, used to define `Finset.pdlSeqSort`. -/ -def Sequent.le (X Y : Sequent) : Prop := seqKeyLe X.key Y.key +@[expose] def Sequent.le (X Y : Sequent) : Prop := seqKeyLe X.key Y.key instance Sequent.instDecidableRelLe : DecidableRel Sequent.le := fun X Y => by unfold Sequent.le; infer_instance @@ -852,7 +845,7 @@ instance Sequent.instTotalLe : Std.Total Sequent.le := X.key Y.key⟩ /-- Sort a finite set of sequents into a list, using `Sequent.le`. -/ -def _root_.Finset.pdlSeqSort : Finset Sequent → List Sequent := +@[expose] def _root_.Finset.pdlSeqSort : Finset Sequent → List Sequent := fun A => A.sort Sequent.le @[simp] diff --git a/LeanPool/PDL/Soundness.lean b/LeanPool/PDL/Soundness.lean index d72a225427..f300359a1d 100644 --- a/LeanPool/PDL/Soundness.lean +++ b/LeanPool/PDL/Soundness.lean @@ -12,7 +12,7 @@ public import LeanPool.PDL.TableauPath /-! # Soundness (Section 6) -/ -@[expose] public section +public section namespace PDL @@ -117,14 +117,14 @@ theorem pdlRuleSat (r : PdlRule X Y) (satX : satisfiable X) : satisfiable Y := b /-- To get the companion of a `LoadedPathRepeat` we rewind the path with the lpr value. The `succ` is there because the lpr values are indices of the history starting with 0, but `PathIn.rewind 0` would do nothing. -/ -def companionOf {X} {tab : Tableau .nil X} (s : PathIn tab) lpr +@[expose] def companionOf {X} {tab : Tableau .nil X} (s : PathIn tab) lpr (_ : (tabAt s).2.2 = .lrep lpr) : PathIn tab := s.rewind ((Fin.cast (tabAt_fst_length_eq_toHistory_length s) lpr.val).succ) -- maybe use Fin.cast? /-- `s ♥ t` means `s` is a `LoadedPathRepeat` and the `companionOf s` is `t`. -/ -def companion {X} {tab : Tableau .nil X} (s t : PathIn tab) : Prop := +@[expose] def companion {X} {tab : Tableau .nil X} (s t : PathIn tab) : Prop := ∃ (lpr : _) (h : (tabAt s).2.2 = .lrep lpr), t = companionOf s lpr h /-- The companion relation connecting a loaded repeat to its earlier node. -/ @@ -348,7 +348,7 @@ lemma not_edge_and_heart {X} {tab : Tableau .nil X} {a b : PathIn tab} : ¬ (a exact node_ne node_eq /-- An ordinary tableau edge or an edge to a repeat's companion. -/ -def cEdge {X} {ctX : Tableau .nil X} (s t : PathIn ctX) : Prop := +@[expose] def cEdge {X} {ctX : Tableau .nil X} (s t : PathIn ctX) : Prop := (s ⋖_ t) ∨ s ♥ t /-- One ordinary or companion edge. -/ @@ -381,7 +381,7 @@ instance instDecidablecEdgeTransGen {X} {tab : Tableau .nil X} (p q : PathIn tab /-- Nodes are c-equivalent iff there are `◃` paths both ways. Note that this is not a closure, so we do not want `Relation.EqvGen` here. -/ -def cEquiv {X} {tab : Tableau .nil X} (s t : PathIn tab) : Prop := +@[expose] def cEquiv {X} {tab : Tableau .nil X} (s t : PathIn tab) : Prop := s ◃* t ∧ t ◃* s /-- Membership in the same cluster. -/ @@ -400,7 +400,7 @@ def clusterOf {X} {tab : Tableau .nil X} (p : PathIn tab) := /-- We have `before s t` iff there is a path from s to t but not from t to s. This means the cluster of `s` comes before the cluster of `t` in `tab`. NB: The notes use ◃* here but we use ◃⁺. The definitions are equivalent. -/ -def before {X} {tab : Tableau .nil X} (s t : PathIn tab) : Prop := +@[expose] def before {X} {tab : Tableau .nil X} (s t : PathIn tab) : Prop := s ◃⁺ t ∧ ¬ t ◃⁺ s /-- `s <ᶜ t` means there is a ◃-path from `s` to `t` but not from `t` to `s`. diff --git a/LeanPool/PDL/Star.lean b/LeanPool/PDL/Star.lean index 5b0ad07c97..5be6863af9 100644 --- a/LeanPool/PDL/Star.lean +++ b/LeanPool/PDL/Star.lean @@ -16,7 +16,7 @@ Nothing here is specific about PDL, but we prove some useful results about the r closure `ReflTransGen` and the transitive closure `TransGen`. -/ -@[expose] public section +public section namespace PDL diff --git a/LeanPool/PDL/StayingInFL.lean b/LeanPool/PDL/StayingInFL.lean index 6f87a8c1d3..05523135ce 100644 --- a/LeanPool/PDL/StayingInFL.lean +++ b/LeanPool/PDL/StayingInFL.lean @@ -22,7 +22,7 @@ However, this does *not* mean that `L'` must be in the FL of `L`, because the `O contribute to the left part. This makes `Sequent.subseteqFL` tricky to define. -/ -@[expose] public section +public section namespace PDL @@ -32,7 +32,7 @@ Note that by component we mean left and right (and not L, R, O). WORRY: Is using Sequent.O.L here a problem because it might not be injective? (Because it calls `unload` where both ⌊a⌋⌊b⌋p and ⌊a⌋⌈b⌉p become ⌈a⌉⌈b⌉p.) -/ -def Sequent.subseteqFL (X : Sequent) (Y : Sequent) : Prop := +@[expose] def Sequent.subseteqFL (X : Sequent) (Y : Sequent) : Prop := X.L ⊆ (Y.L ∪ Y.O.L).FL ∧ X.O.L ⊆ (Y.L ∪ Y.O.L).FL ∧ X.R ⊆ (Y.R ∪ Y.O.R).FL diff --git a/LeanPool/PDL/Substitution.lean b/LeanPool/PDL/Substitution.lean index 826bbbf648..089dcb8307 100644 --- a/LeanPool/PDL/Substitution.lean +++ b/LeanPool/PDL/Substitution.lean @@ -14,7 +14,7 @@ public import LeanPool.PDL.Discon The lemmas here are mostly from Sections 2.1 and 2.2. -/ -@[expose] public section +public section namespace PDL @@ -22,8 +22,7 @@ namespace PDL mutual /-- Replace atomic proposition `x` by `ψ` in a formula. -/ - @[simp] - def replInF (x : Nat) (ψ : Formula) : Formula → Formula + @[expose, simp] def replInF (x : Nat) (ψ : Formula) : Formula → Formula | ⊥ => ⊥ | ·c => if c == x then ψ else ·c | ~φ => ~ replInF x ψ φ diff --git a/LeanPool/PDL/Syntax.lean b/LeanPool/PDL/Syntax.lean index 5dc71f86a1..a2c08b36f3 100644 --- a/LeanPool/PDL/Syntax.lean +++ b/LeanPool/PDL/Syntax.lean @@ -11,7 +11,7 @@ public import Mathlib.Data.Finset.Sort /-! # Syntax (Section 2.1) -/ -@[expose] public section +public section namespace PDL @@ -42,17 +42,15 @@ namespace PDL /-! ## Abbreviations and Notation -/ /-- Disjunction encoded using conjunction and negation. -/ -@[simp] -def Formula.or : Formula → Formula → Formula +@[expose, simp] def Formula.or : Formula → Formula → Formula | f, g => Formula.neg (Formula.and (Formula.neg f) (Formula.neg g)) /-- □(αs,φ) -/ -def Formula.boxes : List Program → Formula → Formula +@[expose] def Formula.boxes : List Program → Formula → Formula | δ, χ => List.foldr (fun β φ => Formula.box β φ) χ δ /-- Sequential composition of a list of programs, with a true test as the empty sequence. -/ -@[simp] -def Program.steps : List Program → Program +@[expose, simp] def Program.steps : List Program → Program | [] => Program.test (Formula.neg Formula.bottom) | (p :: ps) => Program.sequence p (Program.steps ps) @@ -92,7 +90,7 @@ scoped prefix:33 "?'" => Program.test -- avoiding plain "?" which has a meaning /-- Union of a list of programs. The empty union is `?'⊥`, a program that cannot be executed, so that `[(⋃ ∅)*]φ` is equivalent to `φ`. -/ -def _root_.PDL.Program.unions : List Program → Program +@[expose] def _root_.PDL.Program.unions : List Program → Program | [] => ?'⊥ | [α] => α | α :: rest => α ⋓ Program.unions rest @@ -100,8 +98,7 @@ def _root_.PDL.Program.unions : List Program → Program /-- A basic formula is of the form `¬⊥`, `p`, `¬p`, `[a]_` or `¬[a]_`. Note: in the article also `⊥` is basic, but not here because we want to apply `OneSidedLocalRule.bot` to it. -/ -@[simp] -def Formula.basic : Formula → Bool +@[expose, simp] def Formula.basic : Formula → Bool | ⊥ => False | ~⊥ => True | ·_ => True @@ -111,7 +108,7 @@ def Formula.basic : Formula → Bool | _ => False /-- Whether a program is an atomic action. -/ -def Program.isAtomic : Program → Prop +@[expose] def Program.isAtomic : Program → Prop | ·_ => true | _ => false @@ -132,7 +129,7 @@ theorem Program.isAtomic_iff {α : Program} : α.isAtomic ↔ ∃ a, α = (·a : cases α <;> simp_all [isAtomic] /-- Whether a program has an outer Kleene-star constructor. -/ -def Program.isStar : Program → Prop +@[expose] def Program.isStar : Program → Prop | ∗_ => true | _ => false @@ -169,7 +166,7 @@ theorem boxes_append {as bs P} : induction as <;> simp [Formula.boxes] /-- Separate a formula's leading boxes from its remaining formula. -/ -def boxesOf : Formula → List Program × Formula +@[expose] def boxesOf : Formula → List Program × Formula | (Formula.box prog nextf) => let (rest,endf) := boxesOf nextf; ⟨prog::rest, endf⟩ | f => ([], f) @@ -274,7 +271,7 @@ inductive AnyNegFormula | neg : AnyFormula → AnyNegFormula /-- Load a nonempty modal sequence given its prefix and final program. -/ -def loadMulti : List Program → Program → Formula → LoadFormula +@[expose] def loadMulti : List Program → Program → Formula → LoadFormula | bs, α, φ => List.foldr (fun β lf => LoadFormula.box β lf) (LoadFormula.box α φ) bs @[simp] @@ -285,7 +282,7 @@ theorem loadMulti_cons {β δ α φ} : loadMulti (β :: δ) α φ = LoadFormula.box β (loadMulti δ α φ) := by simp [loadMulti] /-- Prepend a list of loaded boxes to a loaded continuation. -/ -def LoadFormula.boxes : List Program → LoadFormula → LoadFormula +@[expose] def LoadFormula.boxes : List Program → LoadFormula → LoadFormula | δ, χ => List.foldr (fun β lf => LoadFormula.box β lf) χ δ @[simp] @@ -297,8 +294,7 @@ lemma LoadFormula.boxes_cons {b bs φ} : induction bs <;> simp [LoadFormula.boxes] /-- Erase loading annotations to obtain an ordinary formula. -/ -@[simp] -def LoadFormula.unload : LoadFormula → Formula +@[expose, simp] def LoadFormula.unload : LoadFormula → Formula | LoadFormula.box α (.normal φ) => ⌈α⌉φ | LoadFormula.box α (.loaded χ) => ⌈α⌉(unload χ) @@ -323,8 +319,7 @@ scoped notation "~'" χ => NegLoadFormula.neg χ scoped notation "~''" φ:arg => AnyNegFormula.neg φ /-- Erase loading annotations from a negated loaded formula. -/ -@[simp] -def negUnload : NegLoadFormula → Formula +@[expose, simp] def negUnload : NegLoadFormula → Formula | NegLoadFormula.neg χ => ~ χ.unload example : NegLoadFormula := ~'(⌊((·1);' (·2))⌋(⊤ : Formula)) @@ -356,7 +351,7 @@ theorem unload_neg_normal {α φ} : (~'⌊α⌋(.normal φ)).1.unload = ⌈α⌉ /-- Load a possibly already loaded formula χ with a sequence δ of boxes. The result is loaded iff δ≠[] or χ was loaded. -/ -def AnyFormula.loadBoxes : List Program → AnyFormula → AnyFormula +@[expose] def AnyFormula.loadBoxes : List Program → AnyFormula → AnyFormula | δ, χ => List.foldr (fun β lf => LoadFormula.box β lf) χ δ @[simp] @@ -383,7 +378,7 @@ lemma AnyFormula.loadBoxes_loaded_eq_loaded_boxes {δ χ} : rfl /-- Erase loading annotations, leaving ordinary formulas unchanged. -/ -def AnyFormula.unload : AnyFormula → Formula +@[expose] def AnyFormula.unload : AnyFormula → Formula | .normal φ => φ | .loaded χ => χ.unload @@ -437,14 +432,12 @@ lemma loaded_eq_to_unload_eq χ αs φ mutual /-- Split any formula into the list of loaded boxes and the free formula. -/ -@[simp] -def AnyFormula.split : (af : AnyFormula) → List Program × Formula +@[expose, simp] def AnyFormula.split : (af : AnyFormula) → List Program × Formula | .loaded lf => lf.split | .normal f => ([], f) /-- Split a loaded formula into the list of loaded boxes and the free formula. -/ -@[simp] -def LoadFormula.split : (lf : LoadFormula) → List Program × Formula +@[expose, simp] def LoadFormula.split : (lf : LoadFormula) → List Program × Formula | .box α af => (fun (δ,f) => (α :: δ, f)) af.split end @@ -507,7 +500,7 @@ theorem LoadFormula.split_list_not_empty (lf : LoadFormula) : lf.split.1 ≠ [] simp [LoadFormula.split] /-- Construct a loaded modal sequence from a list known to be nonempty. -/ -@[simp] +@[expose, simp] def loadMultiNonEmpty : (δ : List Program) → (h : δ ≠ []) → Formula → LoadFormula | [ ], h, _ => by exfalso; simp at * | (α :: []), _, φ => LoadFormula.box α φ @@ -618,7 +611,7 @@ lemma loadMulti_eq_loadBoxes : /-! ## splitLast -/ /-- Helper function for `YsetLoad'` to get last list element. -/ -def splitLast : List α → Option (List α × α) +@[expose] def splitLast : List α → Option (List α × α) | [] => none | (x :: xs) => some <| match splitLast xs with | none => ([], x) @@ -707,7 +700,7 @@ lemma loadMulti_of_splitLast_cons {α αs βs β φ} (h : splitLast (α :: αs) mutual /-- The syntactic length of a program, mutually defined with formula length. -/ - @[simp, implicit_reducible] + @[expose, simp, implicit_reducible] def lengthOfProgram : Program → Nat | ·_ => 1 | α;'β => 1 + lengthOfProgram α + lengthOfProgram β @@ -1178,7 +1171,7 @@ instance : Std.Antisymm (fun (a b : Formula) ↦ a ≤ b) := ⟨Formula.le_antis instance : Std.Total (fun (a b : Formula) ↦ a ≤ b) := ⟨Formula.le_total⟩ /-- List the elements of a formula finset in the fixed formula order. -/ -def _root_.Finset.pdlSort : Finset Formula → List Formula | FS => FS.sort +@[expose] def _root_.Finset.pdlSort : Finset Formula → List Formula | FS => FS.sort @[simp] lemma Formula.mem_pdlSort {X : Finset Formula} : φ ∈ X.pdlSort ↔ φ ∈ X := by simp [Finset.pdlSort] diff --git a/LeanPool/PDL/Tableau.lean b/LeanPool/PDL/Tableau.lean index 1e1ebca087..bff57e4248 100644 --- a/LeanPool/PDL/Tableau.lean +++ b/LeanPool/PDL/Tableau.lean @@ -12,7 +12,7 @@ public import LeanPool.PDL.Local.Tableau /-! # PDL-Tableaux (Section 4) -/ -@[expose] public section +public section namespace PDL @@ -43,7 +43,7 @@ theorem proj : g ∈ projection A X ↔ (⌈·A⌉g) ∈ X := aesop /-- Collect the continuations of matching atomic boxes in a formula finset. -/ -def _root_.Finset.pdlProjection : Nat → Finset Formula → Finset Formula +@[expose] def _root_.Finset.pdlProjection : Nat → Finset Formula → Finset Formula | A, X => (X.image fun x => (formProjection A x).toFinset).sup id /-- Membership in the projection of a `Finset` of formulas. @@ -71,7 +71,7 @@ abbrev History : Type := List Sequent /-- We have a repeat iff the history contains a node that is `setEqTo` the current node. Note that this is a `Prop`, it does not carry a specific number of steps to go back. -/ -def rep (Hist : History) (X : Sequent) : Prop := ∃ Y ∈ Hist, Y = X +@[expose] def rep (Hist : History) (X : Sequent) : Prop := ∃ Y ∈ Hist, Y = X instance {H X} : Decidable (rep H X) := by unfold rep @@ -124,7 +124,7 @@ lemma rep.toFin_agrees (rp : rep H X) : /-- A lpr means we can go `k` steps back in the history to reach an equal node, and all nodes on the way are loaded. Note: `k=0` means the first element of `Hist` is the companion. -/ -def LoadedPathRepeat (Hist : History) (X : Sequent) : Type := +@[expose] def LoadedPathRepeat (Hist : History) (X : Sequent) : Type := Subtype (fun k => (Hist.get k) = X ∧ ∀ m ≤ k, (Hist.get m).isLoaded) lemma LoadedPathRepeat.to_rep {H X} (lpr : LoadedPathRepeat H X) : rep H X := by @@ -208,7 +208,7 @@ For this we introduce `FreeRepeat` and the `flprep` abbreviation. /-- A free repeat is a non-loaded sequent that occured before. Values of this type are pairs: the number of steps to go back in the history and a proof that we then find the same set. -/ -def FreeRepeat (Hist : History) (X : Sequent) : Type := +@[expose] def FreeRepeat (Hist : History) (X : Sequent) : Type := Subtype (fun k => (Hist.get k) = X ∧ ¬ X.isLoaded) lemma FreeRepeat_nil_impossible {X} : FreeRepeat [] X → False := by @@ -232,7 +232,7 @@ lemma FreeRepeat_iff_rep_and_isFree {H X} : Note that the negation of this is not the same as `¬ rep` because it will still allow loaded repeats that are not loaded-path repeats, at which `Tableau` may continue. See also `posOf` that is used to define `tableauGame` later. -/ -@[grind .] +@[expose, grind .] def flprep (H : History) (X : Sequent) : Prop := (rep H X ∧ X.isFree) ∨ Nonempty (LoadedPathRepeat H X) @@ -278,7 +278,7 @@ inductive PdlRule : (X : Sequent) → (Y : Sequent) → Type deriving DecidableEq /-- Whether a PDL rule is one of the two modal rules. -/ -def PdlRule.isModal {X Y} : PdlRule X Y → Prop +@[expose] def PdlRule.isModal {X Y} : PdlRule X Y → Prop | .loadL _ _ _ => False | .loadR _ _ _ => False | .freeL _ _ => False @@ -306,7 +306,7 @@ inductive Tableau : History → Sequent → Type | lrep {Hist X} (lpr : LoadedPathRepeat Hist X) : Tableau Hist X /-- The number of nodes in a tableau, including every local-rule continuation. -/ -def Tableau.size {Hist X} : Tableau Hist X → Nat +@[expose] def Tableau.size {Hist X} : Tableau Hist X → Nat | .loc _ _ lt next => 1 + ((endNodesOf lt).attach.sum (fun ⟨Y, Y_in⟩ => (next Y Y_in).size)) | .pdl _ _ _ next => 1 + next.size | .lrep _ => 1 @@ -384,7 +384,7 @@ decreasing_by · exact Tableau.size_next_lt_of_pdl tab1_def /-- Whether a tableau is a loaded-path-repeat leaf. -/ -def Tableau.isLrep {Hist X} : (Tableau Hist X) → Prop +@[expose] def Tableau.isLrep {Hist X} : (Tableau Hist X) → Prop | .loc .. => False | .pdl .. => False | .lrep .. => True @@ -395,11 +395,11 @@ inductive provable : Formula → Prop | byTableauR {φ : Formula} : Tableau .nil ⟨{}, {~φ}, none⟩ → provable φ /-- A Sequent is inconsistent if there exists a closed tableau for it. -/ -def inconsistent : Sequent → Prop +@[expose] def inconsistent : Sequent → Prop | LR => Nonempty (Tableau .nil LR) /-- A `Sequent` is consistent iff it is not inconsistent. -/ -def consistent : Sequent → Prop +@[expose] def consistent : Sequent → Prop | LR => ¬inconsistent LR end PDL diff --git a/LeanPool/PDL/TableauPath.lean b/LeanPool/PDL/TableauPath.lean index dd96774fe2..774c74fc6b 100644 --- a/LeanPool/PDL/TableauPath.lean +++ b/LeanPool/PDL/TableauPath.lean @@ -19,7 +19,7 @@ tableau and point to a specific node inside it. This is the `PathIn` type. Its values say "go to this child, then to this child, ... stop here." -/ -@[expose] public section +public section namespace PDL @@ -35,7 +35,7 @@ inductive PathIn : ∀ {Hist X}, Tableau Hist X → Type deriving DecidableEq /-- The tableau reached by a path, together with its history and root sequent. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def tabAt {Hist X} {tab : Tableau Hist X} : PathIn tab → Σ H X, Tableau H X | .nil => ⟨_,_,tab⟩ | .loc _ tail => tabAt tail @@ -48,13 +48,15 @@ lemma tabAt_cast_gen {Hist X} {tab : Tableau Hist X} (s : PathIn tab) (w : Σ H cases h; rfl /-- Append a path in the reached tableau to an initial path. -/ -def PathIn.append {Hist X} {tab : Tableau Hist X} (p : PathIn tab) (q : PathIn (tabAt p).2.2) : +@[expose] def PathIn.append {Hist X} {tab : Tableau Hist X} (p : PathIn tab) + (q : PathIn (tabAt p).2.2) : PathIn tab := match p with | .nil => q | .loc Y_in tail => .loc Y_in (PathIn.append tail q) | .pdl tail => .pdl (PathIn.append tail q) /-- Whether the tableau reached by a path is a loaded-path-repeat leaf. -/ +@[expose] def PathIn.isLrep {Hist X} {tab : Tableau Hist X} (p : PathIn tab) : Prop := (tabAt p).2.2.isLrep instance instDecdidablePathInisLrep {Hist X} {tab : Tableau Hist X} (p : PathIn tab) : Decidable @@ -122,7 +124,7 @@ theorem tabAt_pdl {Hist X Y} {nrep : ¬ flprep Hist X} {bas : X.basic} {r : PdlR tabAt (.pdl tail : PathIn (.pdl nrep bas r next)) = tabAt tail := by simp [tabAt] /-- Given a path to node `t`, this is its label Λ(t). -/ -def nodeAt {H X} {tab : (Tableau H X)} (p : PathIn tab) : Sequent := (tabAt p).2.1 +@[expose] def nodeAt {H X} {tab : (Tableau H X)} (p : PathIn tab) : Sequent := (tabAt p).2.1 @[simp] theorem nodeAt_nil {Hist} {tab : Tableau Hist X} : nodeAt (.nil : PathIn tab) = X := by @@ -154,7 +156,7 @@ def PathIn.head {Hist} {tab : Tableau Hist X} (_ : PathIn tab) : Sequent := X def PathIn.last {Hist X} {tab : Tableau Hist X} (t : PathIn tab) : Sequent := (tabAt t).2.1 /-- The length of a path is the number of actual steps. -/ -@[simp, implicit_reducible] +@[expose, simp, implicit_reducible] def PathIn.length {Hist X} {tab : Tableau Hist X} : (t : PathIn tab) → ℕ | .nil => 0 | .pdl tail => tail.length + 1 @@ -174,7 +176,7 @@ theorem append_length {Hist X} {tab : Tableau Hist X} {p : PathIn tab} q : (p.ap /-! ## Edge Relation -/ /-- Relation `s ⋖_ t` says `t` is a child of `s`. Two cases, both defined via `append`. -/ -def edge {Hist X} {tab : Tableau Hist X} (s t : PathIn tab) : Prop := +@[expose] def edge {Hist X} {tab : Tableau Hist X} (s t : PathIn tab) : Prop := ( ∃ Hist X nrep nbas lt next Y, ∃ (Y_in : Y ∈ endNodesOf lt) (h : tabAt s = ⟨Hist, X, (Tableau.loc nrep nbas lt next : Tableau _ X)⟩), @@ -685,7 +687,7 @@ decreasing_by /-- Convert a path to a History. Does not include the last node. The history of `.nil` is `[]` because this will not go into `Hist`. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def PathIn.toHistory {Hist} {tab : Tableau Hist X} : (t : PathIn tab) → History | .nil => [] | .pdl tail => tail.toHistory ++ [X] @@ -769,6 +771,7 @@ Defined using Fin.lastCases. Hint: when proving stuff about `rewind k`, avoid induction on k, because rewind does not decrease k. -/ +@[expose] def PathIn.rewind {Hist : History} {X : Sequent} {tab : Tableau Hist X} : (t : PathIn tab) → (k : Fin (t.toHistory.length + 1)) → PathIn tab | .nil, _ => .nil diff --git a/LeanPool/PDL/Vocab.lean b/LeanPool/PDL/Vocab.lean index b40597a029..1e99b0a153 100644 --- a/LeanPool/PDL/Vocab.lean +++ b/LeanPool/PDL/Vocab.lean @@ -15,7 +15,7 @@ public import LeanPool.PDL.Syntax /-! # Vocabulary and other Syntax functions (part of Section 2.1) -/ -@[expose] public section +public section namespace PDL @@ -34,16 +34,14 @@ def Vocab.atomProgs : Vocab → Finset Nat := mutual /-- The proposition and program vocabulary occurring in a program. -/ - @[simp] - def Program.voc : Program → Vocab + @[expose, simp] def Program.voc : Program → Vocab | ·n => {.inr n} | α;'β => α.voc ∪ β.voc | α ⋓ β => α.voc ∪ β.voc | ∗α => α.voc | ?' φ => φ.voc /-- The proposition and program vocabulary occurring in a formula. -/ - @[simp] - def Formula.voc : Formula → Vocab + @[expose, simp] def Formula.voc : Formula → Vocab | ⊥ => ∅ | ·n => {.inl n} | ~φ => φ.voc @@ -57,12 +55,10 @@ end PDL namespace PDL /-- The union of the vocabularies in a list. -/ -@[simp] -def Vocab.fromList (L : List Vocab) : Vocab := L.toFinset.sup id +@[expose, simp] def Vocab.fromList (L : List Vocab) : Vocab := L.toFinset.sup id /-- The union of the vocabularies in a finset. -/ -@[simp] -def Vocab.fromFinset (L : Finset Vocab) : Vocab := L.sup id +@[expose, simp] def Vocab.fromFinset (L : Finset Vocab) : Vocab := L.sup id /-- The combined vocabulary of a list of formulas. -/ @[simp] @@ -123,18 +119,15 @@ theorem Formula.voc_boxes : (⌈⌈δ⌉⌉φ).voc = δ.pdlPvoc ∪ φ.voc := by induction δ <;> simp_all /-- The vocabulary of a loaded formula after erasing its loading annotations. -/ -@[simp] -def LoadFormula.voc (lf : LoadFormula) : Vocab := (unload lf).voc +@[expose, simp] def LoadFormula.voc (lf : LoadFormula) : Vocab := (unload lf).voc /-- The vocabulary of a negated loaded formula after erasing its loading annotations. -/ -@[simp] -def NegLoadFormula.voc (nlf : NegLoadFormula) : Vocab := (negUnload nlf).voc +@[expose, simp] def NegLoadFormula.voc (nlf : NegLoadFormula) : Vocab := (negUnload nlf).voc /-! ## Tests in a program -/ /-- Test(α) -/ -@[implicit_reducible] -def testsOfProgram : Program → List Formula +@[expose, implicit_reducible] def testsOfProgram : Program → List Formula | ·_ => [] | ?' τ => [τ] -- no sub-tests etc. needed? | α;'β => testsOfProgram α ++ testsOfProgram β @@ -168,7 +161,7 @@ theorem testsOfProgram.voc α {τ} (τ_in : τ ∈ testsOfProgram α) : τ.voc /-! ## Subprograms -/ /-- Prog(α) -/ -def subprograms : Program → List Program +@[expose] def subprograms : Program → List Program | ·a => [(·a : Program)] | ?' φ => [?' φ] | α;'β => [α;'β ] ++ subprograms α ++ subprograms β diff --git a/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean b/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean index 6d3429bb7a..06aeaa93f8 100644 --- a/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean +++ b/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean @@ -61,12 +61,15 @@ lemma continuous_measureEntropy_probabilityMeasure {Ω : Type*} [Finite Ω] [TopologicalSpace Ω] [DiscreteTopology Ω] [MeasurableSpace Ω] [OpensMeasurableSpace Ω] : Continuous (fun (μ : ProbabilityMeasure Ω) ↦ measureEntropy (S := Ω) μ) := by cases nonempty_fintype Ω - unfold measureEntropy + have entropy_eq (μ : ProbabilityMeasure Ω) : + measureEntropy (S := Ω) μ = + ∑' ω, Real.negMulLog ((μ : Measure Ω).real {ω}) := + measureEntropy_of_isProbabilityMeasure (μ : Measure Ω) + simp_rw [entropy_eq] simp_rw [tsum_fintype] apply continuous_finsetSum intro ω _ apply Real.continuous_negMulLog.comp - simp only [measure_univ, inv_one, one_smul] exact continuous_probabilityMeasure_apply_of_isClopen (s := {ω}) <| isClopen_discrete _ public @@ -102,7 +105,8 @@ lemma rdist_def (X : Ω → G) (Y : Ω' → G) (μ : Measure Ω) (μ' : Measure /-- Ruzsa distance of random variables equals Ruzsa distance of the kernels. -/ public -lemma rdist_eq_rdistm : d[X; μ # Y; μ'] = Kernel.rdistm (μ.map X) (μ'.map Y) := rfl +lemma rdist_eq_rdistm : d[X; μ # Y; μ'] = Kernel.rdistm (μ.map X) (μ'.map Y) := by + simp only [rdist_def, Kernel.rdistm, entropy_def] /-- Ruzsa distance depends continuously on the measure. -/ public @@ -213,7 +217,11 @@ lemma ProbabilityTheory.IndepFun.rdist_eq [IsFiniteMeasure μ] have h_prod : (μ.map X).prod (μ.map Y) = μ.map (⟨X, Y⟩) := ((indepFun_iff_map_prod_eq_prod_map_map hX.aemeasurable hY.aemeasurable).mp h).symm rw [h_prod, entropy_def, map_map (by fun_prop) (by fun_prop)] - rfl + simp only [entropy_def] + have hfun : (fun p : G × G => p.1 - p.2) ∘ ⟨X, Y⟩ = X - Y := by + funext ω + rfl + rw [hfun] /-- `d[X; Y] ≤ H[X]/2 + H[Y]/2`. -/ public @@ -277,7 +285,7 @@ lemma rdist_symm [IsFiniteMeasure μ] [IsFiniteMeasure μ'] : rw [← entropy_neg (by fun_prop)] have : (-fun x : G × G ↦ x.1 - x.2) = (fun x ↦ x.1 - x.2) ∘ Prod.swap := by ext; simp rw [this, entropy_def, ← map_map (by fun_prop) measurable_swap, prod_swap] - rfl + simp only [entropy_def] omit [Countable G] in /-- Ruzsa distance depends continuously on the first measure. -/ @@ -448,7 +456,8 @@ lemma ent_of_diff_le (X : Ω → G) (Y : Ω → G) (Z : Ω → G) apply entropy_comp_le μ (by fun_prop) _ ≤ H[X - Z; μ] + H[Y - Z; μ] := by have h : 0 ≤ H[X - Z; μ] + H[Y - Z; μ] - H[⟨X - Z, Y - Z⟩; μ] := by - apply mutualInfo_nonneg (by fun_prop) (by fun_prop) μ + simpa only [mutualInfo_def] using + (mutualInfo_nonneg (hX.sub hZ) (hY.sub hZ) μ) linarith have h3 : H[⟨Y, X - Y⟩; μ] ≤ H[⟨X, Y⟩; μ] := by have : ⟨Y, X - Y⟩ = (fun p ↦ (p.2, p.1 - p.2)) ∘ ⟨X, Y⟩ := by ext1; simp @@ -1270,12 +1279,12 @@ lemma ent_bsg [IsProbabilityMeasure μ] {A B : Ω → G} (hA : Measurable A) (hB _ = (ν.map Z')[fun z ↦ H[A₁ - B₂; ν[|Z' ← z]] - H[A₁; ν[|Z' ← z]]/2 - H[B₂; ν[|Z' ← z]]/2] := by apply integral_congr_ae - apply hABZ.mono + apply (condIndepFun_iff.mp hABZ).mono intro z hz exact (hz.comp measurable_fst measurable_snd).rdist_eq hA₁ hB₂ _ = H[A₁ - B₂ | Z'; ν] - H[A₁ | Z'; ν] / 2 - H[B₂ | Z'; ν] / 2 := by rw [integral_sub, integral_sub, integral_div, integral_div] - · rfl + · simp only [condEntropy_def] all_goals exact .of_finite _ ≤ 2 * I[A : B; μ] + H[Z; μ] - H[A₁ | Z'; ν] / 2 - H[B₂ | Z'; ν] / 2 := sub_le_sub_right (sub_le_sub_right ‹_› _) _ diff --git a/LeanPool/PLAcceleratedNesterovLean.lean b/LeanPool/PLAcceleratedNesterovLean.lean index 7edaa53c85..e4f42044e4 100644 --- a/LeanPool/PLAcceleratedNesterovLean.lean +++ b/LeanPool/PLAcceleratedNesterovLean.lean @@ -21,7 +21,7 @@ Tags: optimization, numerical-analysis, gradient-methods, polyak-lojasiewicz, di MSC: 49M37, 65K05, 58C15 -/ -@[expose] public section +public section /-! This project formalizes accelerated Nesterov convergence under a local diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence.lean index 6ed1ab8dc3..3022a2654b 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence.lean @@ -24,4 +24,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.StateContraction # Convergence proof for PL-accelerated Nesterov convergence -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap.lean index 43652c1062..68ca42ab59 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap.lean @@ -13,4 +13,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.Bootstrap.Step2 # Bootstrap estimates for PL-accelerated Nesterov convergence -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Main.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Main.lean index 5fe156d784..1a6260d21f 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Main.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Main.lean @@ -18,7 +18,7 @@ all iterates remain in the controlled region Ω and the Lyapunov function decays geometrically. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step1.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step1.lean index 03a1c8abb7..cd0e1354e5 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step1.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step1.lean @@ -20,7 +20,7 @@ S_a = Σ_{k=0}^∞ (1-a/2)^{k/2} = 1/(1-√(1-a/2)) is finite for a > 0. Σ_{k=1}^n ‖h_k‖ ≤ C_h √η Σ_{k=1}^n √L_k ≤ C_h √η · R · S_a -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step2.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step2.lean index a9d89dcf36..020599a1be 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step2.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Bootstrap/Step2.lean @@ -23,7 +23,7 @@ Assuming all iterates up to n stay in Ω with Lyapunov ≤ R²: So x_{n+1} ∈ Ω -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity.lean index 7bea6c65c1..24140fb117 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity.lean @@ -14,4 +14,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.Coercivity.Step2 # Lyapunov coercivity estimates -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Core.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Core.lean index fcf022fcde..60f5f6dac4 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Core.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Core.lean @@ -20,7 +20,7 @@ Proves that `(1 - a)² * (V² + μ' * E²) ≤ 60 * Ln` by resolving coupled norm inequalities from the Nesterov accelerated gradient descent analysis. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Main.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Main.lean index 6a8ca61c07..06bcd7b779 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Main.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Main.lean @@ -16,7 +16,7 @@ The Lyapunov function L_n controls the physical quantities ‖v_n‖² + μ'‖e and the potential Ψ(x_n). The constants depend only on a = √(μ'·η). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step1.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step1.lean index 57dcc0a6b1..af37d9dd79 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step1.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step1.lean @@ -21,7 +21,7 @@ Then from u_n = P⊥v_n + √μ' e_n (triangle inequality): And T_n := ‖P v_n‖ ≤ √(L_n/λ). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step2.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step2.lean index 0c53e30276..60a9d186e9 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step2.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/Coercivity/Step2.lean @@ -33,7 +33,7 @@ Finally: Also: Ψ(x_n) ≤ C_Ψ · L_n follows from dist(x_n, M) ≤ √η‖v_n‖ + ‖e_n‖. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/ConvergenceHelpers.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/ConvergenceHelpers.lean index e6f83f3f08..5188d3306b 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/ConvergenceHelpers.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/ConvergenceHelpers.lean @@ -22,7 +22,7 @@ bounds and phase transitions. 2. `gen_at_every_phase` — gen theorem at any m ∈ S for any phase k ≥ 1 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb.lean index 85313a2572..0041841995 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb.lean @@ -12,4 +12,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.CurvAbsorb.Assembly # Curvature absorption estimates -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean index 4a724f5ad4..72deedf69e 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean @@ -19,7 +19,7 @@ These establish the key perturbation bounds: 3. Kills-normal bound: ‖P en‖ ≤ ε₁·‖en‖ -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Assembly.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Assembly.lean index 18c2a70b76..cb558e8b5e 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Assembly.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Assembly.lean @@ -24,7 +24,7 @@ The key idea: Dπ is continuous at m⋆, so for small enough R, all perturbation terms are O(ε₁ · Ln) with ε₁ = sup ‖Dπ-P‖ → 0. -/ -@[expose] public section +public section open scoped NNReal noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/GenLocalArgument.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/GenLocalArgument.lean index 458b011afa..7af8b97fe5 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/GenLocalArgument.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/GenLocalArgument.lean @@ -36,7 +36,7 @@ State-based version of `LocalArgument.lean`. The conclusion provides gen bootstr iterates stay in Ω ∧ Lyapunov decays geometrically with `nesterovSeqGen`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalArgument.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalArgument.lean index af16634c74..55c9543383 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalArgument.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalArgument.lean @@ -20,7 +20,7 @@ initial-energy neighborhood and converts the generalized state sequence back to `nesterovSeq`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry.lean index 47431c0da0..2120d33fc4 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry.lean @@ -15,4 +15,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.LocalGeometry.Step2 # Local geometry estimates -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/HessianBound.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/HessianBound.lean index f0af832f86..65085fad26 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/HessianBound.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/HessianBound.lean @@ -23,7 +23,7 @@ bounds proved in `MorseBott.HessianPL`. The unique content here: 4. `PL_gradient_hessian_bound`: gradient-form export -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Main.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Main.lean index 90ed3b4a9b..9ab6e8dd2b 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Main.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Main.lean @@ -29,7 +29,7 @@ neighborhood U₊ of m⋆ with U₊ ⊂⊂ U, and ε > 0 with ε ≤ √(μ'/η) (d) Hessian lower bound: D²f(x) ≽ -εI -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean index 58fb0270ef..8f3c09cc4e 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean @@ -18,7 +18,7 @@ Provides a generalized strong aiming lemma (no φ'(0) = 0 requirement) and the fiber-path Hessian-to-second-derivative connection. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step1.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step1.lean index 0a80010724..9ffb7d628a 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step1.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step1.lean @@ -24,7 +24,7 @@ Both arguments use: continuous function ≥ threshold on compact set ⟹ ≥ (threshold - δ) on a neighborhood. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step2.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step2.lean index 7cb8314e6e..d04dd7fa04 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step2.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/Step2.lean @@ -25,7 +25,7 @@ Since U₊ is fiber-saturated, m + te ∈ U₊ for t ∈ [0,1]. So ⟨∇f(x), e⟩ ≥ f(x) - f⋆ + (μ'/2)‖e‖² -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction.lean index f96520a227..5b1e2f6405 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction.lean @@ -18,4 +18,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.LyapunovContraction # Lyapunov contraction estimates -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/AuxVar.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/AuxVar.lean index 537840722b..1915a9585e 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/AuxVar.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/AuxVar.lean @@ -15,7 +15,7 @@ The sequence-indexed recursion is the zero-velocity sequence specialization of the state-based one-step identity `auxVarOfState_step`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean index 5bd312f6f7..d778158122 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean @@ -38,7 +38,7 @@ After cancellations the remaining coefficients are all ≤ 0: • PperpVsq: (1-a)·(εη − a)/2 ≤ 0 (since εη ≤ a) -/ -@[expose] public section +public section namespace PLAcceleratedNesterovLean diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseHelper.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseHelper.lean index a6ed2ced3d..ab559de802 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseHelper.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseHelper.lean @@ -14,7 +14,7 @@ Provides norm expansions, Pythagorean decompositions, inner product decompositions, and cross-term vanishing for orthogonal projectors. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/GenMain.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/GenMain.lean index 7574f52e19..94b7139a64 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/GenMain.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/GenMain.lean @@ -21,7 +21,7 @@ Generalization of `lyapunov_contraction` (Main.lean) to arbitrary `NesterovState supporting nonzero initial velocity. Used by `GenLocalArgument.lean`. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Main.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Main.lean index bccc4aab65..e80f428f3b 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Main.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Main.lean @@ -22,7 +22,7 @@ modified Nesterov scheme contracts the Lyapunov function by a factor 1 - a/2, where a = √(μ'·η). -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean index 1da4d1a6ba..e93c9ee8d4 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean @@ -28,7 +28,7 @@ If ε·η ≤ a and 0 ≤ a < 1: (1-a)(1+a) ≤ (1+a)² = 2(1-a)λ -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step2.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step2.lean index 6d116f91da..a09493582f 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step2.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step2.lean @@ -24,7 +24,7 @@ Since u_{n+1} = w_n + √μ' ξ_n: ½‖u_{n+1}‖² = ½‖w_n‖² + √μ'⟨w_n, ξ_n⟩ + (μ'/2)‖ξ_n‖² -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step3.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step3.lean index 93106b8b9f..d2f5bf65eb 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step3.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step3.lean @@ -42,7 +42,7 @@ is bounded by (1-a) times the corresponding component of L_n. L_{n+1} ≤ (1-a) L_n + perturbation ≤ (1-a/2) L_n. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/MainTheoremInternal.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/MainTheoremInternal.lean index aa90b87b73..0fbf06d124 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/MainTheoremInternal.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/MainTheoremInternal.lean @@ -21,7 +21,7 @@ This file contains helper statements used by `PLAcceleratedNesterovLean.MainTheo file intentionally exposes only the clean top-level theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError.lean index 6d8da358e9..bbf800ded6 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError.lean @@ -11,4 +11,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.MotionError.Main # Motion error estimates -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError/Main.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError/Main.lean index bc7b0b741a..4f8ee4f1cf 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError/Main.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/MotionError/Main.lean @@ -17,7 +17,7 @@ Combined with ‖e_n‖² ≤ C_coer/μ' · L_n from coercivity: ‖g_n‖ ≤ L · √(C_coer/μ') · √L_n =: C_g · √L_n -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/NesterovConvergence.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/NesterovConvergence.lean index 98fd214243..81b634083b 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/NesterovConvergence.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/NesterovConvergence.lean @@ -36,7 +36,7 @@ The main specialization sets μ' = μ·(1−θ), η = 1/L, and chooses local specialized theorem. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/PhaseSchedule.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/PhaseSchedule.lean index 246d543ebc..677ed349ca 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/PhaseSchedule.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/PhaseSchedule.lean @@ -21,7 +21,7 @@ Key arithmetic facts: - θₖ ↓ 0 as k → ∞ -/ -@[expose] public section +public section noncomputable section @@ -43,10 +43,10 @@ def rhoOfPhase (L : ℝ) (μ : ℝ) (k : ℕ) : ℝ := (1 - a) / (1 + a) /-- Directly retuned PL parameter: μθ = μ · (1 - θ). -/ -def muOfTheta (μ θ : ℝ) : ℝ := μ * (1 - θ) +@[expose] def muOfTheta (μ θ : ℝ) : ℝ := μ * (1 - θ) /-- Directly retuned momentum parameter. -/ -def rhoOfTheta (L μ θ : ℝ) : ℝ := +@[expose] def rhoOfTheta (L μ θ : ℝ) : ℝ := let a := Real.sqrt (muOfTheta μ θ * (1 / L)) (1 - a) / (1 + a) diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean index 13c3e4df2b..b8b4b1edac 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean @@ -20,7 +20,7 @@ These establish that: All lemmas are independent of the Lean formalization of the algorithm. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction.lean index 18eee6c7cc..2d16e6a293 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction.lean @@ -11,4 +11,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Convergence.StateContraction.Au # State contraction estimates -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction/AuxVarRecursion.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction/AuxVarRecursion.lean index 69d7d89732..1f257a63a5 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction/AuxVarRecursion.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/StateContraction/AuxVarRecursion.lean @@ -19,7 +19,7 @@ Key identity: u' = ((1-a)·P⊥v + √μ'·e - √η·P⊥g) + √μ'·ξ where u' = auxVarOfState at step(s), and all quantities are computed from s. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Core.lean b/LeanPool/PLAcceleratedNesterovLean/Core.lean index 666a083a91..4ffe628766 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Core.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Core.lean @@ -14,4 +14,4 @@ public import LeanPool.PLAcceleratedNesterovLean.Core.NesterovSeqGen # Core definitions for PL-accelerated Nesterov convergence -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/Core/Defs.lean b/LeanPool/PLAcceleratedNesterovLean/Core/Defs.lean index 1bbc5a0727..4e68664a88 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Core/Defs.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Core/Defs.lean @@ -15,7 +15,7 @@ Core definitions: ambient space, optimization concepts (argmin, PL condition, L- tubular neighborhoods, first-order algorithm model, convergence rate, and manifold setup. -/ -@[expose] public section +public section noncomputable section @@ -32,15 +32,15 @@ abbrev E (d : ℕ) := EuclideanSpace ℝ (Fin d) /-! ## Definitions for the optimization problem -/ /-- The set of global minimizers of f. -/ -def argminSet (f : E d → ℝ) : Set (E d) := +@[expose] def argminSet (f : E d → ℝ) : Set (E d) := {x | ∀ y, f x ≤ f y} /-- The infimal value f⋆ = inf_x f(x). -/ -def fStar (f : E d → ℝ) : ℝ := iInf f +@[expose] def fStar (f : E d → ℝ) : ℝ := iInf f /-- A function f satisfies the μ-Polyak-Łojasiewicz (PL) condition on a set U if f is differentiable on U and ‖∇f(x)‖² ≥ 2μ(f(x) - f⋆) for all x ∈ U. -/ -def PolyakLojasiewicz (f : E d → ℝ) (μ : ℝ) (U : Set (E d)) : Prop := +@[expose] def PolyakLojasiewicz (f : E d → ℝ) (μ : ℝ) (U : Set (E d)) : Prop := 0 < μ ∧ DifferentiableOn ℝ f U ∧ ∀ x ∈ U, ‖gradient f x‖ ^ 2 ≥ 2 * μ * (f x - fStar f) /-- L-smoothness: the gradient of f is L-Lipschitz. -/ @@ -97,13 +97,13 @@ def FirstOrderAlgorithm.iterate (alg : FirstOrderAlgorithm d) (f : E d → ℝ) /-! ## Convergence rate -/ /-- Accelerated convergence rate: f(xₖ) - f⋆ ≤ C · exp(-k / √(L/μ)). -/ -def HasAcceleratedRate (f : E d → ℝ) (iterates : ℕ → E d) (L μ : ℝ) : Prop := +@[expose] def HasAcceleratedRate (f : E d → ℝ) (iterates : ℕ → E d) (L μ : ℝ) : Prop := ∃ C : ℝ, 0 < C ∧ ∀ k : ℕ, f (iterates k) - fStar f ≤ C * Real.exp (-(↑k / Real.sqrt (L / μ))) /-- Accelerated convergence with explicit prefactor `2`: f(xₖ) - f⋆ ≤ 2 · exp(-k / √(L/μ)) · (f(x₀) - f⋆). -/ -def HasAcceleratedRateWithPrefactorTwo (f : E d → ℝ) (iterates : ℕ → E d) +@[expose] def HasAcceleratedRateWithPrefactorTwo (f : E d → ℝ) (iterates : ℕ → E d) (L μ : ℝ) (x₀ : E d) : Prop := ∀ k : ℕ, f (iterates k) - fStar f ≤ @@ -115,7 +115,7 @@ def HasAcceleratedRateWithPrefactorTwo (f : E d → ℝ) (iterates : ℕ → E d abbrev ManifoldModel (n : ℕ) := EuclideanSpace ℝ (Fin n) /-- Model with corners for the n-dimensional Euclidean model (no boundary). -/ -def modelI (n : ℕ) : ModelWithCorners ℝ (ManifoldModel n) (ManifoldModel n) := +@[expose] def modelI (n : ℕ) : ModelWithCorners ℝ (ManifoldModel n) (ManifoldModel n) := modelWithCornersSelf ℝ (ManifoldModel n) end PLAcceleratedNesterovLean diff --git a/LeanPool/PLAcceleratedNesterovLean/Core/EmbeddedManifold.lean b/LeanPool/PLAcceleratedNesterovLean/Core/EmbeddedManifold.lean index 02f503edcb..71f7b14c5f 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Core/EmbeddedManifold.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Core/EmbeddedManifold.lean @@ -33,7 +33,7 @@ structure. sub-neighborhood. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/Core/NesterovScheme.lean b/LeanPool/PLAcceleratedNesterovLean/Core/NesterovScheme.lean index 829e746636..3da99ee429 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Core/NesterovScheme.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Core/NesterovScheme.lean @@ -19,7 +19,7 @@ Shared definitions for the proof of local accelerated convergence: - Tangent/normal space of an embedded manifold -/ -@[expose] public section +public section noncomputable section @@ -33,7 +33,7 @@ variable {d : ℕ} /-! ## Hessian quadratic form -/ /-- The Hessian quadratic form: ξᵀ D²f(x) ξ = ⟨(D(∇f)(x)) ξ, ξ⟩. -/ -def hessianQuadForm (f : E d → ℝ) (x ξ : E d) : ℝ := +@[expose] def hessianQuadForm (f : E d → ℝ) (x ξ : E d) : ℝ := @inner ℝ _ _ (fderiv ℝ (gradient f) x ξ) ξ /-! ## Modified Nesterov scheme -/ @@ -46,7 +46,7 @@ structure NesterovState (d : ℕ) where v : E d /-- The look-ahead point x' = x + √η · v. -/ -def NesterovState.lookahead (s : NesterovState d) (η : ℝ) : E d := +@[expose] def NesterovState.lookahead (s : NesterovState d) (η : ℝ) : E d := s.x + Real.sqrt η • s.v /-- One step of the modified Nesterov scheme: @@ -55,7 +55,7 @@ def NesterovState.lookahead (s : NesterovState d) (η : ℝ) : E d := x₊ = x' - η · g (gradient step) v₊ = ρ(v - √η · g) (momentum update) -/ -def nesterovStep (f : E d → ℝ) (η ρ : ℝ) (s : NesterovState d) : NesterovState d := +@[expose] def nesterovStep (f : E d → ℝ) (η ρ : ℝ) (s : NesterovState d) : NesterovState d := let x' := s.lookahead η let g := gradient f x' { x := x' - η • g @@ -63,29 +63,29 @@ def nesterovStep (f : E d → ℝ) (η ρ : ℝ) (s : NesterovState d) : Nestero /-- The Nesterov sequence starting from x₁ with v₁ = 0. Index 0 corresponds to iteration 1 in the paper. -/ -def nesterovSeq (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) : ℕ → NesterovState d +@[expose] def nesterovSeq (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) : ℕ → NesterovState d | 0 => { x := x₁, v := 0 } | n + 1 => nesterovStep f η ρ (nesterovSeq f η ρ x₁ n) /-- The gradient computed at the look-ahead point at step n. -/ -def nesterovGrad (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := +@[expose] def nesterovGrad (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := gradient f ((nesterovSeq f η ρ x₁ n).lookahead η) /-- Step between consecutive look-ahead points: h_n = x'_{n+1} - x'_n. -/ -def nesterovH (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := +@[expose] def nesterovH (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := (nesterovSeq f η ρ x₁ (n + 1)).lookahead η - (nesterovSeq f η ρ x₁ n).lookahead η /-! ## Geometric quantities -/ /-- Normal displacement: e_n = x'_n - π(x'_n), the error from the manifold. Here π is the nearest-point projection. -/ -def normalDisp (π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := +@[expose] def normalDisp (π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := let x' := (nesterovSeq f η ρ x₁ n).lookahead η x' - π x' /-- Auxiliary variable: u_n = P⊥ v_n + √μ' · e_n, where P⊥ = Id - P is the normal projector (P projects onto tangent space). -/ -def auxVar (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) +@[expose] def auxVar (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := let s := nesterovSeq f η ρ x₁ n let perpV := s.v - P s.v @@ -94,7 +94,8 @@ def auxVar (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) /-- Curvature error: ξ_n = e_{n+1} - e_n - P⊥ h_n. Measures the deviation from the affine-case recursion. -/ -def curvatureError (P π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := +@[expose] def curvatureError (P π : E d → E d) (f : E d → ℝ) + (η ρ : ℝ) (x₁ : E d) (n : ℕ) : E d := let e_next := normalDisp π f η ρ x₁ (n + 1) let e_curr := normalDisp π f η ρ x₁ n let h := nesterovH f η ρ x₁ n @@ -104,13 +105,13 @@ def curvatureError (P π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (x₁ : /-- The potential Ψ(x) = f(x) - f⋆ + (μ'/2) · dist(x, S)². Combines the optimality gap with a quadratic distance penalty. -/ -def psi (f : E d → ℝ) (μ' : ℝ) (S : Set (E d)) (x : E d) : ℝ := +@[expose] def psi (f : E d → ℝ) (μ' : ℝ) (S : Set (E d)) (x : E d) : ℝ := (f x - fStar f) + μ' / 2 * (Metric.infDist x S) ^ 2 /-- The Lyapunov function: L_n = (f(x_n) - f⋆) + ½‖u_n‖² + lam‖P v_n‖² where lam = (1+a)²/(2(1-a)) and a = √(μ'·η). -/ -def lyapunov (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) +@[expose] def lyapunov (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (x₁ : E d) (n : ℕ) : ℝ := let s := nesterovSeq f η ρ x₁ n let u := auxVar P μ' π f η ρ x₁ n diff --git a/LeanPool/PLAcceleratedNesterovLean/Core/NesterovSeqGen.lean b/LeanPool/PLAcceleratedNesterovLean/Core/NesterovSeqGen.lean index ee3ee7b76a..2d73edd011 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Core/NesterovSeqGen.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Core/NesterovSeqGen.lean @@ -19,7 +19,7 @@ These are needed for the Nesterov algorithm with arbitrary initial state (nonzero velocity). -/ -@[expose] public section +public section noncomputable section @@ -34,7 +34,7 @@ variable {d : ℕ} /-- Generalized Nesterov sequence starting from an arbitrary initial state s₀. Generalization of `nesterovSeq` supporting nonzero initial velocity. -/ -def nesterovSeqGen (f : E d → ℝ) (η ρ : ℝ) (s₀ : NesterovState d) : +@[expose] def nesterovSeqGen (f : E d → ℝ) (η ρ : ℝ) (s₀ : NesterovState d) : ℕ → NesterovState d | 0 => s₀ | n + 1 => nesterovStep f η ρ (nesterovSeqGen f η ρ s₀ n) @@ -53,18 +53,18 @@ theorem nesterovSeqGen_succ (f : E d → ℝ) (η ρ : ℝ) (s₀ : NesterovStat /-! ## State-based auxiliary definitions -/ /-- Normal displacement for a given state: e = x' − π(x'). -/ -def normalDispOfState (π : E d → E d) (η : ℝ) (s : NesterovState d) : E d := +@[expose] def normalDispOfState (π : E d → E d) (η : ℝ) (s : NesterovState d) : E d := let x' := s.lookahead η x' - π x' /-- Auxiliary variable for a given state: u = P⊥v + √μ'·e. -/ -def auxVarOfState (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) (η : ℝ) +@[expose] def auxVarOfState (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) (η : ℝ) (s : NesterovState d) : E d := let e := normalDispOfState π η s (s.v - P s.v) + Real.sqrt μ' • e /-- Curvature error for a step: ξ = e' − e − P⊥h. -/ -def curvatureErrorOfState (P : E d → E d) (π : E d → E d) (f : E d → ℝ) +@[expose] def curvatureErrorOfState (P : E d → E d) (π : E d → E d) (f : E d → ℝ) (η ρ : ℝ) (s : NesterovState d) : E d := let s' := nesterovStep f η ρ s let e := normalDispOfState π η s @@ -73,18 +73,18 @@ def curvatureErrorOfState (P : E d → E d) (π : E d → E d) (f : E d → ℝ) e' - e - (h - P h) /-- Step displacement h = x'_{n+1} − x'_n for a given state. -/ -def stepDispOfState (f : E d → ℝ) (η ρ : ℝ) (s : NesterovState d) : E d := +@[expose] def stepDispOfState (f : E d → ℝ) (η ρ : ℝ) (s : NesterovState d) : E d := let s' := nesterovStep f η ρ s s'.lookahead η - s.lookahead η /-- Gradient at the lookahead point for a given state. -/ -def gradOfState (f : E d → ℝ) (η : ℝ) (s : NesterovState d) : E d := +@[expose] def gradOfState (f : E d → ℝ) (η : ℝ) (s : NesterovState d) : E d := gradient f (s.lookahead η) /-- State-based Lyapunov function: L(s) = (f(x) − f⋆) + ½‖u‖² + λ‖Pv‖² where u = P⊥v + √μ'·e, λ = (1+a)²/(2(1−a)), a = √(μ'·η). -/ -def lyapunovOfState (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) +@[expose] def lyapunovOfState (P : E d →L[ℝ] E d) (μ' : ℝ) (π : E d → E d) (f : E d → ℝ) (η : ℝ) (s : NesterovState d) : ℝ := let u := auxVarOfState P μ' π η s let a := Real.sqrt (μ' * η) diff --git a/LeanPool/PLAcceleratedNesterovLean/MainTheorem.lean b/LeanPool/PLAcceleratedNesterovLean/MainTheorem.lean index 4f9482608d..02621cfad0 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MainTheorem.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MainTheorem.lean @@ -13,7 +13,7 @@ import LeanPool.PLAcceleratedNesterovLean.Convergence.MainTheoremInternal # Public main theorem wrappers -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott.lean index db6a6f3a51..7594420962 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott.lean @@ -20,4 +20,4 @@ public import LeanPool.PLAcceleratedNesterovLean.MorseBott.TubularProjection # Morse-Bott infrastructure for PL-accelerated Nesterov convergence -/ -@[expose] public section +public section diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/Bridge.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/Bridge.lean index 751d8a9d17..c871cb1ac8 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/Bridge.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/Bridge.lean @@ -50,7 +50,7 @@ setting used by PLAcceleratedNesterovLeans (where `E d := EuclideanSpace ℝ (Fi `PLAcceleratedNesterovLean/Convergence/LocalGeometry/Main.lean` -/ -@[expose] public section +public section open Filter Topology Metric Submodule InnerProductSpace Set diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/BridgeDefs.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/BridgeDefs.lean index a897a3b881..639066c9f5 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/BridgeDefs.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/BridgeDefs.lean @@ -16,7 +16,7 @@ These mirror definitions from the source project so external theorems can be stated and proved using the same types. -/ -@[expose] public section +public section open Filter Topology Metric InnerProductSpace @@ -44,21 +44,21 @@ structure IsTubularNeighborhood {E : Type*} [PseudoMetricSpace E] variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /-- The set of global minimizers of f. -/ -def Ext.argminSet (f : E → ℝ) : Set E := {x | ∀ y, f x ≤ f y} +@[expose] def Ext.argminSet (f : E → ℝ) : Set E := {x | ∀ y, f x ≤ f y} /-- The infimal value f⋆ = inf_x f(x). -/ -def Ext.fStar (f : E → ℝ) : ℝ := ⨅ x, f x +@[expose] def Ext.fStar (f : E → ℝ) : ℝ := ⨅ x, f x /-- μ-PŁ condition using ‖fderiv‖ (PLMB compatibility layer). -/ def Ext.PolyakLojasiewicz (f : E → ℝ) (μ : ℝ) (U : Set E) : Prop := 0 < μ ∧ ∀ x ∈ U, ‖fderiv ℝ f x‖ ^ 2 ≥ 2 * μ * (f x - Ext.fStar f) /-- The gradient of f at x (Riesz representative of fderiv ℝ f x). -/ -def Ext.gradient (f : E → ℝ) (x : E) : E := +@[expose] def Ext.gradient (f : E → ℝ) (x : E) : E := (toDual ℝ E).symm (fderiv ℝ f x) /-- The Hessian quadratic form ξᵀ D²f(x) ξ = ⟨D(∇f)(x)·ξ, ξ⟩. -/ -def Ext.hessianQuadForm (f : E → ℝ) (x ξ : E) : ℝ := +@[expose] def Ext.hessianQuadForm (f : E → ℝ) (x ξ : E) : ℝ := @inner ℝ E _ (fderiv ℝ (Ext.gradient f) x ξ) ξ end PLAcceleratedNesterovLean diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/Defs.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/Defs.lean index af097db948..eb49037c99 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/Defs.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/Defs.lean @@ -30,7 +30,7 @@ Formalization of definitions from: - `IsMuMB` : μ-Morse–Bott property -/ -@[expose] public section +public section open Filter Topology Metric Submodule @@ -48,7 +48,7 @@ variable {E : Type*} /-- The set of local minimizers of `f` at the same function value as `x₀`. This is S from equation (4) in the paper: S = {x ∈ M : x is a local minimum of f and f(x) = f_S} -/ -def localMinSet (f : E → ℝ) (x₀ : E) : Set E := +@[expose] def localMinSet (f : E → ℝ) (x₀ : E) : Set E := {x | IsLocalMin f x ∧ f x = f x₀} omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in @@ -68,7 +68,7 @@ theorem self_mem_localMinSet {f : E → ℝ} {x₀ : E} (hmin : IsLocalMin f x /-- The μ-Polyak–Łojasiewicz condition (Definition 1.2 in the paper): ∀ x near x₀, f(x) − f(x₀) ≤ (2μ)⁻¹ ‖Df(x)‖² where ‖Df(x)‖ = ‖fderiv ℝ f x‖ equals the gradient norm by Riesz. -/ -def MuPL (f : E → ℝ) (μ : ℝ) (x₀ : E) : Prop := +@[expose] def MuPL (f : E → ℝ) (μ : ℝ) (x₀ : E) : Prop := ∀ᶠ x in 𝓝 x₀, f x - f x₀ ≤ (2 * μ)⁻¹ * ‖fderiv ℝ f x‖ ^ 2 -- ════════════════════════════════════════════════════════════════════════════ @@ -103,7 +103,7 @@ def MuQG (f : E → ℝ) (μ : ℝ) (x₀ : E) (S : Set E) : Prop := - `φ(0) = 0` ensures the graph passes through `x₀`, i.e., `x₀ ∈ S`. - `Dφ(0) = 0` ensures the tangent space to the graph at `x₀` is exactly `T`. - `ContDiffAt ℝ 1 φ 0` gives C¹ regularity of the chart near the origin. -/ -def IsLocalSubmanifoldAt (S : Set E) (x₀ : E) (T : Submodule ℝ E) : Prop := +@[expose] def IsLocalSubmanifoldAt (S : Set E) (x₀ : E) (T : Submodule ℝ E) : Prop := x₀ ∈ S ∧ ∃ (U : Set E) (_ : U ∈ 𝓝 x₀) (φ : T → T.orthogonal), @@ -126,7 +126,7 @@ abbrev hessian (f : E → ℝ) (x : E) : E →L[ℝ] (E →L[ℝ] ℝ) := fderiv ℝ (fderiv ℝ f) x /-- The kernel of the Hessian at `x`, as a submodule of E. -/ -def hessianKer (f : E → ℝ) (x : E) : Submodule ℝ E := +@[expose] def hessianKer (f : E → ℝ) (x : E) : Submodule ℝ E := LinearMap.ker (hessian f x).toLinearMap -- ════════════════════════════════════════════════════════════════════════════ @@ -140,7 +140,7 @@ def hessianKer (f : E → ℝ) (x : E) : Submodule ℝ E := space T = ker(Hess f(x₀)), 2. The Hessian is μ-coercive on the normal space T⊥: D²f(x₀)(v,v) ≥ μ ‖v‖² for all v ∈ T⊥. -/ -def IsMuMB (f : E → ℝ) (μ : ℝ) (x₀ : E) : Prop := +@[expose] def IsMuMB (f : E → ℝ) (μ : ℝ) (x₀ : E) : Prop := let H := hessian f x₀ let T := hessianKer f x₀ 0 < μ ∧ diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean index 1bee90b07e..3628cc8543 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean @@ -18,7 +18,7 @@ Under μ-PŁ at a local min x₀, proves `fderiv(x) = 0 ↔ fderiv(x)|_{T⊥} = for x near x₀. Uses Taylor remainder bounds and a Hessian perturbation argument. -/ -@[expose] public section +public section open Filter Topology InnerProductSpace Submodule Set diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Basics.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Basics.lean index 093baee635..8cf53d622f 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Basics.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Basics.lean @@ -18,7 +18,7 @@ approach: the minimum of H(w,w) on the unit sphere of ker(H)⊥ is attained at an eigenvector, and PŁ forces this minimum to be ≥ μ. -/ -@[expose] public section +public section open Filter Topology Metric Submodule Asymptotics diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Main.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Main.lean index 60d5a69c07..73dd042fc6 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Main.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/HessianPL/Main.lean @@ -17,7 +17,7 @@ Proves `muPL_norm_sq_bound` and `hessian_coercive_on_orthogonal_of_MuPL_impl`, establishing that the Hessian is μ-coercive on ker(Hess)⊥ under the PŁ condition. -/ -@[expose] public section +public section open Filter Topology Metric Submodule Asymptotics diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/IFTProof.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/IFTProof.lean index 8657071369..e654d376d0 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/IFTProof.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/IFTProof.lean @@ -16,7 +16,7 @@ Proves `ift_gives_graph`: under Hessian coercivity on the normal space, the critical set near x₀ is locally a C¹ graph over ker(Hess f(x₀)). -/ -@[expose] public section +public section open Filter Topology Metric Submodule Asymptotics diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/NormalHessianBound.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/NormalHessianBound.lean index b8040cfdec..f96c2f5659 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/NormalHessianBound.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/NormalHessianBound.lean @@ -41,7 +41,7 @@ These are equal for C² functions because: - PLMB/HessianPL.lean: `hessian_coercive_on_orthogonal_of_MuPL_impl` -/ -@[expose] public section +public section open Filter Topology Metric Submodule InnerProductSpace @@ -58,25 +58,25 @@ variable {E : Type*} -- ════════════════════════════════════════════════════════════════════════════ /-- The set of global minimizers of `f`. (PLAcceleratedNesterovLean: `argminSet`) -/ -def ExternalThm3.argminSet (f : E → ℝ) : Set E := {x | ∀ y, f x ≤ f y} +@[expose] def ExternalThm3.argminSet (f : E → ℝ) : Set E := {x | ∀ y, f x ≤ f y} /-- The global infimum of `f`. (PLAcceleratedNesterovLean: `fStar`) -/ -def ExternalThm3.fStar (f : E → ℝ) : ℝ := ⨅ x, f x +@[expose] def ExternalThm3.fStar (f : E → ℝ) : ℝ := ⨅ x, f x /-- The Polyak–Łojasiewicz condition on a set `U`. Uses `‖fderiv ℝ f x‖` which equals `‖gradient f x‖` by Riesz representation. (PLAcceleratedNesterovLean: `PolyakLojasiewicz`) -/ -def ExternalThm3.PolyakLojasiewicz (f : E → ℝ) (μ : ℝ) (U : Set E) : Prop := +@[expose] def ExternalThm3.PolyakLojasiewicz (f : E → ℝ) (μ : ℝ) (U : Set E) : Prop := 0 < μ ∧ ∀ x ∈ U, ‖fderiv ℝ f x‖ ^ 2 ≥ 2 * μ * (f x - ExternalThm3.fStar f) /-- The gradient of `f` at `x`, as the Riesz representative of `fderiv ℝ f x`. Matches Mathlib's `gradient` from `Analysis.Calculus.Gradient.Basic`. -/ -def ExternalThm3.gradient (f : E → ℝ) (x : E) : E := +@[expose] def ExternalThm3.gradient (f : E → ℝ) (x : E) : E := (toDual ℝ E).symm (fderiv ℝ f x) /-- PLAcceleratedNesterovLean's Hessian quadratic form: `⟨D(∇f)(x)·ξ, ξ⟩`. Here `gradient f` is the Riesz representative of `fderiv ℝ f`. -/ -def ExternalThm3.hessianQuadForm (f : E → ℝ) (x ξ : E) : ℝ := +@[expose] def ExternalThm3.hessianQuadForm (f : E → ℝ) (x ξ : E) : ℝ := @inner ℝ E _ (fderiv ℝ (ExternalThm3.gradient f) x ξ) ξ -- ════════════════════════════════════════════════════════════════════════════ diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/PLImpliesMB.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/PLImpliesMB.lean index 9502153eea..0d7c26ec18 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/PLImpliesMB.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/PLImpliesMB.lean @@ -41,7 +41,7 @@ Combining these two gives μ-MB. conditions for C² functions", Corollary 2.17. -/ -@[expose] public section +public section open Filter Topology Metric diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/Submanifold.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/Submanifold.lean index e42eb3f60f..5c81f0784e 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/Submanifold.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/Submanifold.lean @@ -66,7 +66,7 @@ where ∇f(x) ∈ E is the Riesz representative of Df(x) ∈ E*. `ImplicitFunctionData`. -/ -@[expose] public section +public section open Filter Topology Metric Submodule Asymptotics diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Defs.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Defs.lean index 14286575c6..613a80f1a6 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Defs.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Defs.lean @@ -18,7 +18,7 @@ Core definitions (`optimalityEqn`, `IsTubularNeighborhoodOfSubmanifold`, `tubularProj`) and basic helper lemmas for the nearest-point projection. -/ -@[expose] public section +public section open Filter Topology Metric NNReal @@ -42,7 +42,7 @@ on `S` to a query point `y = m + r` is `p = m + v + φ(v)` where `F(r, v) = V.orthogonalProjectionOnto(r − v − φ(v)) + (fderiv ℝ φ v).adjoint (V⊥.orthogonalProjectionOnto(r − v − φ(v)))` -/ -noncomputable def optimalityEqn +@[expose] noncomputable def optimalityEqn {V : Submodule ℝ E} (φ : V → V.orthogonal) (_m : E) : E × V → V := let _anchor := _m @@ -90,7 +90,7 @@ structure IsTubularNeighborhoodOfSubmanifold (S U : Set E) : Prop where /-- The nearest-point projection: for `x ∈ U` pick the unique closest point in `S`; for `x ∉ U` pick an arbitrary element of `S`. -/ -def tubularProj {S U : Set E} (hTN : IsTubularNeighborhoodOfSubmanifold S U) +@[expose] def tubularProj {S U : Set E} (hTN : IsTubularNeighborhoodOfSubmanifold S U) (hne : S.Nonempty) (x : E) : E := if hx : x ∈ U then (hTN.uniqueProj x hx).choose diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Derivative.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Derivative.lean index 8bd658ed16..4890ad0f5f 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Derivative.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/Derivative.lean @@ -18,7 +18,7 @@ Proof that `fderiv ℝ π m = V.starProjection` at each `m ∈ S`, and the main theorem assembling all 10 properties of the projection. -/ -@[expose] public section +public section open Filter Topology Metric NNReal diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean index 790a6ac0f2..1871b35243 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean @@ -17,7 +17,7 @@ IFT-based proof that the nearest-point projection is C¹ at every point of the submanifold S. -/ -@[expose] public section +public section open Filter Topology Metric NNReal diff --git a/LeanPool/PartialCombinatoryAlgebras.lean b/LeanPool/PartialCombinatoryAlgebras.lean index 7095b21cc9..2abac57445 100644 --- a/LeanPool/PartialCombinatoryAlgebras.lean +++ b/LeanPool/PartialCombinatoryAlgebras.lean @@ -25,7 +25,7 @@ Tags: combinatory-algebra, lambda-calculus, computability MSC: 03B40, 03D75 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PartialCombinatoryAlgebras/Basic.lean b/LeanPool/PartialCombinatoryAlgebras/Basic.lean index 05606d6f52..d750473a73 100644 --- a/LeanPool/PartialCombinatoryAlgebras/Basic.lean +++ b/LeanPool/PartialCombinatoryAlgebras/Basic.lean @@ -15,7 +15,7 @@ left-associative binary application operator, and the class for a partial binary operation on a type. -/ -@[expose] public section +public section namespace LeanPool.PartialCombinatoryAlgebras diff --git a/LeanPool/PartialCombinatoryAlgebras/CombinatoryAlgebra.lean b/LeanPool/PartialCombinatoryAlgebras/CombinatoryAlgebra.lean index e148103c21..c44a5a0f31 100644 --- a/LeanPool/PartialCombinatoryAlgebras/CombinatoryAlgebra.lean +++ b/LeanPool/PartialCombinatoryAlgebras/CombinatoryAlgebra.lean @@ -17,7 +17,7 @@ A total combinatory structure on a type `A`, and the fact that any total combinatory algebra induces a partial combinatory algebra on the same type. -/ -@[expose] public section +public section namespace LeanPool.PartialCombinatoryAlgebras @@ -35,7 +35,7 @@ class CA (A : Type*) extends HasDot A where namespace Part /-- Missing from `Part`. -/ -@[simps] +@[expose, simps] def map₂ {α β γ : Type*} (f : α → β → γ) (u : _root_.Part α) (v : _root_.Part β) : _root_.Part γ := ⟨u.Dom ∧ v.Dom, fun p => f (u.get (And.left p)) (v.get (And.right p))⟩ diff --git a/LeanPool/PartialCombinatoryAlgebras/FreeCombinatoryAlgebra.lean b/LeanPool/PartialCombinatoryAlgebras/FreeCombinatoryAlgebra.lean index 8771d5d735..612a9830fe 100644 --- a/LeanPool/PartialCombinatoryAlgebras/FreeCombinatoryAlgebra.lean +++ b/LeanPool/PartialCombinatoryAlgebras/FreeCombinatoryAlgebra.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.SetLike /-! # Free (total) combinatory algebra -/ -@[expose] public section +public section namespace LeanPool.PartialCombinatoryAlgebras @@ -38,8 +38,7 @@ inductive eq : Expr → Expr → Prop where infix:40 " ≈ " => eq /-- The carrier of the free total combinatory algebra -/ -@[reducible] -def carrier := Quot eq +@[expose, reducible] def carrier := Quot eq /-- Convert an expression to a (defined) partial element of the carrier. -/ @[reducible] @@ -51,7 +50,7 @@ instance hasDot : HasDot carrier where (by intros a b c e'; exact Quot.sound (.app ‹_› .refl)) @[simp] -theorem eq_mk_app (a b : Expr) : mk a ⬝ mk b = mk (a ⬝ b) := rfl +theorem eq_mk_app (a b : Expr) : mk a ⬝ mk b = mk (a ⬝ b) := by rfl end FreeCA diff --git a/LeanPool/PartialCombinatoryAlgebras/GraphModel.lean b/LeanPool/PartialCombinatoryAlgebras/GraphModel.lean index 430692e62f..ae88185c0d 100644 --- a/LeanPool/PartialCombinatoryAlgebras/GraphModel.lean +++ b/LeanPool/PartialCombinatoryAlgebras/GraphModel.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.SetLike combinatory algebra structure on `Set α`. -/ -@[expose] public section +public section namespace LeanPool.PartialCombinatoryAlgebras diff --git a/LeanPool/PartialCombinatoryAlgebras/PartialCombinatoryAlgebra.lean b/LeanPool/PartialCombinatoryAlgebras/PartialCombinatoryAlgebra.lean index 4edf578977..4b218ac64b 100644 --- a/LeanPool/PartialCombinatoryAlgebras/PartialCombinatoryAlgebra.lean +++ b/LeanPool/PartialCombinatoryAlgebras/PartialCombinatoryAlgebra.lean @@ -35,7 +35,7 @@ with a separate claim that they are total. -/ -@[expose] public section +public section namespace LeanPool.PartialCombinatoryAlgebras @@ -116,12 +116,11 @@ variable {A : Type v} [PCA A] /-- A valuation `η : Γ → A` assigning elements to variables, with the value of `x` overridden to be `a`. -/ -@[reducible] -def override (x : Γ) (a : A) (η : Γ → A) (y : Γ) : A := +@[expose, reducible] def override (x : Γ) (a : A) (η : Γ → A) (y : Γ) : A := if y = x then a else η y /-- Evaluate an expression with respect to a given valuation `η`. -/ -def eval (η : Γ → A) : Expr Γ A → Part A +@[expose] def eval (η : Γ → A) : Expr Γ A → Part A | .K => PCA.K | .S => PCA.S | .elm a => .some a @@ -129,10 +128,10 @@ def eval (η : Γ → A) : Expr Γ A → Part A | .app e₁ e₂ => (eval η e₁) ⬝ (eval η e₂) /-- An expression is said to be defined when it is defined at every valuation. -/ -def defined (e : Expr Γ A) := ∀ (η : Γ → A), (eval η e) ⇓ +@[expose] def defined (e : Expr Γ A) := ∀ (η : Γ → A), (eval η e) ⇓ /-- The substitution of an element for the extra variable. -/ -def subst (x : Γ) (a : A) : Expr Γ A → Expr Γ A +@[expose] def subst (x : Γ) (a : A) : Expr Γ A → Expr Γ A | .K => .K | .S => .S | .elm b => .elm b @@ -242,7 +241,7 @@ lemma eval_override (η : Γ → A) (x : Γ) (a : A) (e : Expr Γ A) : /-- Compile an expression to a partial element, substituting the default value for any variables occurring in e. -/ -@[simp] +@[expose, simp] def compile (e : Expr Γ A) : Part A := eval (fun _ => default) e diff --git a/LeanPool/PartialCombinatoryAlgebras/Programming.lean b/LeanPool/PartialCombinatoryAlgebras/Programming.lean index 05cc29d5a9..c8fe9e6b94 100644 --- a/LeanPool/PartialCombinatoryAlgebras/Programming.lean +++ b/LeanPool/PartialCombinatoryAlgebras/Programming.lean @@ -33,7 +33,7 @@ import Mathlib.Tactic.Widget.Calc combinators themselves. -/ -@[expose] public section +public section namespace LeanPool.PartialCombinatoryAlgebras diff --git a/LeanPool/PartialRegularity.lean b/LeanPool/PartialRegularity.lean index 01bc9312f0..0173afeb2d 100644 --- a/LeanPool/PartialRegularity.lean +++ b/LeanPool/PartialRegularity.lean @@ -23,7 +23,7 @@ Tags: number-theory, asymptotics MSC: 11B68, 11N05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PartialRegularity/Extension.lean b/LeanPool/PartialRegularity/Extension.lean index daa8e0f047..298000364a 100644 --- a/LeanPool/PartialRegularity/Extension.lean +++ b/LeanPool/PartialRegularity/Extension.lean @@ -20,7 +20,7 @@ import Mathlib.NumberTheory.LSeries.HurwitzZetaValues This file proves a variant of the main result with an explicit constant: the count of odd primes `p ≤ X` that are not `M_α(p)`-regular is bounded by `10 · X / (log X)^(2α)`. -/ -@[expose] public section +public section namespace LeanPool.PartialRegularity.Extension diff --git a/LeanPool/PebblingLean.lean b/LeanPool/PebblingLean.lean index c113825822..df9aeb4f9a 100644 --- a/LeanPool/PebblingLean.lean +++ b/LeanPool/PebblingLean.lean @@ -39,4 +39,4 @@ Tags: combinatorics, pebbling, hypercube MSC: 05C57 -/ -@[expose] public section +public section diff --git a/LeanPool/PebblingLean/Basic.lean b/LeanPool/PebblingLean/Basic.lean index 6ca3d1156e..26bdac1b0f 100644 --- a/LeanPool/PebblingLean/Basic.lean +++ b/LeanPool/PebblingLean/Basic.lean @@ -17,7 +17,7 @@ formalization: simple undirected graphs, pebbling distributions, legal pebbling moves, reachability, solvability, and optimality. -/ -@[expose] public section +public section namespace PebblingLean @@ -51,11 +51,11 @@ namespace Pebbling variable {V : Type u} /-- The total number of pebbles in a finite distribution. -/ -def size [Fintype V] (D : Pebbling V) : ℕ := +@[expose] def size [Fintype V] (D : Pebbling V) : ℕ := ∑ v, D v /-- Pointwise domination of pebbling distributions. -/ -def Dominates (D E : Pebbling V) : Prop := +@[expose] def Dominates (D E : Pebbling V) : Prop := ∀ v : V, E v ≤ D v @[simp] @@ -72,7 +72,7 @@ theorem le_size [Fintype V] (D : Pebbling V) (v : V) : /-- The distribution obtained by moving two pebbles from `u` to one pebble at `v`. Legality of this operation is recorded separately in `Move`. -/ -def moveDistribution [DecidableEq V] (D : Pebbling V) (u v : V) : Pebbling V := +@[expose] def moveDistribution [DecidableEq V] (D : Pebbling V) (u v : V) : Pebbling V := fun x => if x = u then D x - 2 else if x = v then D x + 1 @@ -110,33 +110,33 @@ theorem moveDistribution_mono [DecidableEq V] {D D' : Pebbling V} {u v : V} /-- One legal pebbling move: remove two pebbles from `u` and add one pebble to an adjacent vertex `v`. -/ -def Move [DecidableEq V] (G : Graph V) (D E : Pebbling V) : Prop := +@[expose] def Move [DecidableEq V] (G : Graph V) (D E : Pebbling V) : Prop := ∃ u v : V, G.Adj u v ∧ 2 ≤ D u ∧ E = moveDistribution D u v /-- `E` is reachable from `D` by zero or more pebbling moves. -/ -def Reaches [DecidableEq V] (G : Graph V) (D E : Pebbling V) : Prop := +@[expose] def Reaches [DecidableEq V] (G : Graph V) (D E : Pebbling V) : Prop := Relation.ReflTransGen (Move G) D E /-- Reach a target with at least `T` pebbles. -/ -def CanReachAtLeast [DecidableEq V] (G : Graph V) (D : Pebbling V) (target : V) (T : ℕ) : +@[expose] def CanReachAtLeast [DecidableEq V] (G : Graph V) (D : Pebbling V) (target : V) (T : ℕ) : Prop := ∃ E : Pebbling V, Reaches G D E ∧ T ≤ E target /-- A distribution can reach a target if some reachable distribution has at least one pebble on that target. -/ -def CanReach [DecidableEq V] (G : Graph V) (D : Pebbling V) (target : V) : Prop := +@[expose] def CanReach [DecidableEq V] (G : Graph V) (D : Pebbling V) (target : V) : Prop := CanReachAtLeast G D target 1 /-- A distribution is `T`-solvable if it can move at least `T` pebbles to every target. -/ -def SolvableAtLeast [DecidableEq V] (G : Graph V) (D : Pebbling V) (T : ℕ) : Prop := +@[expose] def SolvableAtLeast [DecidableEq V] (G : Graph V) (D : Pebbling V) (T : ℕ) : Prop := ∀ target : V, CanReachAtLeast G D target T /-- A distribution is solvable if it can reach every target vertex. -/ -def Solvable [DecidableEq V] (G : Graph V) (D : Pebbling V) : Prop := +@[expose] def Solvable [DecidableEq V] (G : Graph V) (D : Pebbling V) : Prop := SolvableAtLeast G D 1 /-- Reaching demand zero is automatic. -/ @@ -151,7 +151,7 @@ theorem solvableAtLeast_zero [DecidableEq V] (G : Graph V) (D : Pebbling V) : exact canReachAtLeast_zero G D target /-- There is a solvable distribution of total size `k`. -/ -def HasSolvableSize [Fintype V] [DecidableEq V] (G : Graph V) (k : ℕ) : Prop := +@[expose] def HasSolvableSize [Fintype V] [DecidableEq V] (G : Graph V) (k : ℕ) : Prop := ∃ D : Pebbling V, size D = k ∧ Solvable G D /-- There is a `T`-solvable distribution of total size `k`. -/ @@ -160,11 +160,11 @@ def HasSolvableAtLeastSize [Fintype V] [DecidableEq V] (G : Graph V) (T k : ℕ) /-- There is a `T`-solvable distribution of total size at most `k`. This is the natural form for upper-bound constructions. -/ -def HasSolvableAtMostSize [Fintype V] [DecidableEq V] (G : Graph V) (T k : ℕ) : Prop := +@[expose] def HasSolvableAtMostSize [Fintype V] [DecidableEq V] (G : Graph V) (T k : ℕ) : Prop := ∃ D : Pebbling V, size D ≤ k ∧ SolvableAtLeast G D T /-- Every occupied pile in `D` has size at least `S`. -/ -def MinOccupiedPileSize (D : Pebbling V) (S : ℕ) : Prop := +@[expose] def MinOccupiedPileSize (D : Pebbling V) (S : ℕ) : Prop := ∀ v : V, D v ≠ 0 → S ≤ D v /-- Number of occupied vertices in a finite pebbling distribution. -/ @@ -175,7 +175,7 @@ def supportSize [Fintype V] (D : Pebbling V) : ℕ := a solvable distribution with `k` pebbles, and none with fewer. This avoids choosing a numerical value before proving existence for the graph family under study. -/ -def IsOptimalNumber [Fintype V] [DecidableEq V] (G : Graph V) (k : ℕ) : Prop := +@[expose] def IsOptimalNumber [Fintype V] [DecidableEq V] (G : Graph V) (k : ℕ) : Prop := HasSolvableSize G k ∧ ∀ l : ℕ, l < k → ¬ HasSolvableSize G l /-- A relational form of the optimal `T`-pebbling number. -/ diff --git a/LeanPool/PebblingLean/Concentration.lean b/LeanPool/PebblingLean/Concentration.lean index 7b3ffa4e76..b2f9eb07ab 100644 --- a/LeanPool/PebblingLean/Concentration.lean +++ b/LeanPool/PebblingLean/Concentration.lean @@ -21,7 +21,7 @@ real-valued expectations so that exponential moment bounds can be stated directly. -/ -@[expose] public section +public section namespace PebblingLean @@ -36,7 +36,7 @@ noncomputable def uniformProbabilityReal [Fintype Ω] /-- Uniform expectation of a real-valued random variable on a finite sample space. -/ -noncomputable def uniformExpectationReal [Fintype Ω] (X : Ω → ℝ) : ℝ := +@[expose] noncomputable def uniformExpectationReal [Fintype Ω] (X : Ω → ℝ) : ℝ := (∑ ω : Ω, X ω) / (Fintype.card Ω : ℝ) theorem uniformProbabilityReal_eq_coe_uniformProbability [Fintype Ω] diff --git a/LeanPool/PebblingLean/Delivery.lean b/LeanPool/PebblingLean/Delivery.lean index b7f7928cbf..dc2e1a4bd7 100644 --- a/LeanPool/PebblingLean/Delivery.lean +++ b/LeanPool/PebblingLean/Delivery.lean @@ -21,7 +21,7 @@ bound: a pile of size `T * 2^d` at one end of a length-`d` path can deliver `T` pebbles to the other end. -/ -@[expose] public section +public section namespace PebblingLean @@ -39,7 +39,7 @@ inductive Walk : V → V → Type u where namespace Walk /-- Length of a walk. -/ -def length {u v : V} : G.Walk u v → ℕ +@[expose] def length {u v : V} : G.Walk u v → ℕ | nil _ => 0 | cons _ tail => tail.length + 1 @@ -80,7 +80,7 @@ namespace Pebbling variable {V : Type u} /-- A distribution with `k` pebbles at one vertex and none elsewhere. -/ -def single [DecidableEq V] (v : V) (k : ℕ) : Pebbling V := +@[expose] def single [DecidableEq V] (v : V) (k : ℕ) : Pebbling V := fun x => if x = v then k else 0 @[simp] diff --git a/LeanPool/PebblingLean/Examples.lean b/LeanPool/PebblingLean/Examples.lean index d38ef237d2..12ba5d8ba3 100644 --- a/LeanPool/PebblingLean/Examples.lean +++ b/LeanPool/PebblingLean/Examples.lean @@ -15,7 +15,7 @@ These definitions give named vertices and distributions for testing the basic API on low-dimensional cubes. -/ -@[expose] public section +public section namespace PebblingLean diff --git a/LeanPool/PebblingLean/FiniteProbability.lean b/LeanPool/PebblingLean/FiniteProbability.lean index 1b0a591df4..1f89cbca5f 100644 --- a/LeanPool/PebblingLean/FiniteProbability.lean +++ b/LeanPool/PebblingLean/FiniteProbability.lean @@ -25,7 +25,7 @@ objects used there are uniform on finite types, so probability and expectation are just normalized finite sums. -/ -@[expose] public section +public section namespace PebblingLean @@ -35,12 +35,12 @@ variable {Ω ι : Type*} /-- Uniform probability of an event on a finite sample space, as a rational number. -/ -noncomputable def uniformProbability [Fintype Ω] (P : Ω → Prop) [DecidablePred P] : ℚ := +@[expose] noncomputable def uniformProbability [Fintype Ω] (P : Ω → Prop) [DecidablePred P] : ℚ := ((Finset.univ.filter P).card : ℚ) / (Fintype.card Ω : ℚ) /-- Uniform expectation of a natural-valued random variable on a finite sample space, as a rational number. -/ -noncomputable def uniformExpectation [Fintype Ω] (X : Ω → ℕ) : ℚ := +@[expose] noncomputable def uniformExpectation [Fintype Ω] (X : Ω → ℕ) : ℚ := (∑ ω : Ω, (X ω : ℚ)) / (Fintype.card Ω : ℚ) theorem exists_not_of_uniformProbability_lt_one [Fintype Ω] [Nonempty Ω] diff --git a/LeanPool/PebblingLean/GraphIso.lean b/LeanPool/PebblingLean/GraphIso.lean index 2c11d9a14b..aff4c1252f 100644 --- a/LeanPool/PebblingLean/GraphIso.lean +++ b/LeanPool/PebblingLean/GraphIso.lean @@ -16,7 +16,7 @@ those product constructions to hypercubes, we need a lightweight way to move pebbling distributions and solvability statements across graph isomorphisms. -/ -@[expose] public section +public section namespace PebblingLean diff --git a/LeanPool/PebblingLean/Hypercube.lean b/LeanPool/PebblingLean/Hypercube.lean index 1e043d48f0..24b51b0061 100644 --- a/LeanPool/PebblingLean/Hypercube.lean +++ b/LeanPool/PebblingLean/Hypercube.lean @@ -20,7 +20,7 @@ The `n`-dimensional hypercube is represented as Boolean coordinate functions coordinate. -/ -@[expose] public section +public section namespace PebblingLean @@ -33,11 +33,11 @@ theorem card_vertex (n : ℕ) : Fintype.card (HypercubeVertex n) = 2 ^ n := by simp [HypercubeVertex] /-- Hamming distance on Boolean coordinate functions. -/ -def dist {n : ℕ} (x y : HypercubeVertex n) : ℕ := +@[expose] def dist {n : ℕ} (x y : HypercubeVertex n) : ℕ := (Finset.univ.filter (fun i : Fin n => x i ≠ y i)).card /-- Coordinates on which two hypercube vertices differ. -/ -def diffSet {n : ℕ} (x y : HypercubeVertex n) : Finset (Fin n) := +@[expose] def diffSet {n : ℕ} (x y : HypercubeVertex n) : Finset (Fin n) := Finset.univ.filter (fun i : Fin n => x i ≠ y i) theorem dist_eq_card_diffSet {n : ℕ} (x y : HypercubeVertex n) : @@ -56,7 +56,7 @@ theorem dist_le {n : ℕ} (x y : HypercubeVertex n) : dist x y ≤ n := by /-- The vertex obtained from `base` by flipping exactly the coordinates in `s`. -/ -def fromDiffSet {n : ℕ} (base : HypercubeVertex n) (s : Finset (Fin n)) : +@[expose] def fromDiffSet {n : ℕ} (base : HypercubeVertex n) (s : Finset (Fin n)) : HypercubeVertex n := fun i => if i ∈ s then Bool.not (base i) else base i @@ -82,7 +82,7 @@ theorem fromDiffSet_diffSet {n : ℕ} (base v : HypercubeVertex n) : /-- Vertices of `Q_n` are equivalent to subsets of coordinates, by recording where they differ from a fixed base vertex. -/ -def diffSetEquiv {n : ℕ} (base : HypercubeVertex n) : +@[expose] def diffSetEquiv {n : ℕ} (base : HypercubeVertex n) : HypercubeVertex n ≃ Finset (Fin n) where toFun := diffSet base invFun := fromDiffSet base @@ -141,7 +141,7 @@ theorem dist_triangle {n : ℕ} (x y z : HypercubeVertex n) : · simp_all /-- The `n`-dimensional hypercube graph. -/ -def graph (n : ℕ) : Graph (HypercubeVertex n) where +@[expose] def graph (n : ℕ) : Graph (HypercubeVertex n) where Adj x y := dist x y = 1 symm := by intro x y h diff --git a/LeanPool/PebblingLean/HypercubePath.lean b/LeanPool/PebblingLean/HypercubePath.lean index 6b36504e62..d7ea4011f0 100644 --- a/LeanPool/PebblingLean/HypercubePath.lean +++ b/LeanPool/PebblingLean/HypercubePath.lean @@ -21,7 +21,7 @@ distance `d` are joined by a walk of length `d`. This is the geometric input needed for direct delivery in the upper-bound proof. -/ -@[expose] public section +public section namespace PebblingLean diff --git a/LeanPool/PebblingLean/HypercubeProduct.lean b/LeanPool/PebblingLean/HypercubeProduct.lean index 941fef8903..abdda89304 100644 --- a/LeanPool/PebblingLean/HypercubeProduct.lean +++ b/LeanPool/PebblingLean/HypercubeProduct.lean @@ -20,7 +20,7 @@ to hypercubes. The first ingredient is the coordinate split `Q_{a+m} ≃ Q_a × Q_m`. -/ -@[expose] public section +public section namespace PebblingLean @@ -37,7 +37,7 @@ def appendVertex {a m : ℕ} Fin.append p.1 p.2 /-- Coordinate splitting gives a vertex equivalence `Q_{a+m} ≃ Q_a × Q_m`. -/ -def splitVertexEquiv (a m : ℕ) : +@[expose] def splitVertexEquiv (a m : ℕ) : HypercubeVertex (a + m) ≃ HypercubeVertex a × HypercubeVertex m where toFun := splitVertex a m invFun := appendVertex diff --git a/LeanPool/PebblingLean/LowerBound.lean b/LeanPool/PebblingLean/LowerBound.lean index fb8b8c9914..2ef69ae3c9 100644 --- a/LeanPool/PebblingLean/LowerBound.lean +++ b/LeanPool/PebblingLean/LowerBound.lean @@ -28,7 +28,7 @@ for a solvable distribution on `Q_n`, every target has initial weight at least one, and hence the sum of all target weights is at least `|Q_n|`. -/ -@[expose] public section +public section namespace PebblingLean diff --git a/LeanPool/PebblingLean/Paper.lean b/LeanPool/PebblingLean/Paper.lean index d2fc9e79a0..ce0fd6331e 100644 --- a/LeanPool/PebblingLean/Paper.lean +++ b/LeanPool/PebblingLean/Paper.lean @@ -21,7 +21,7 @@ noncomputable optimal pebbling number `optimalPebblingNumber n` and the explicit constant `CLean`. -/ -@[expose] public section +public section namespace PebblingLean diff --git a/LeanPool/PebblingLean/Product.lean b/LeanPool/PebblingLean/Product.lean index bb64098ca2..6f7488be25 100644 --- a/LeanPool/PebblingLean/Product.lean +++ b/LeanPool/PebblingLean/Product.lean @@ -18,7 +18,7 @@ result here is the slice simulation lemma: a pebbling sequence in one factor of a Cartesian product can be executed inside a fixed slice of the product. -/ -@[expose] public section +public section namespace PebblingLean @@ -29,7 +29,7 @@ namespace Graph variable {V : Type u} {W : Type v} /-- Cartesian product of simple graphs. -/ -def cartesianProduct (G : Graph V) (H : Graph W) : Graph (V × W) where +@[expose] def cartesianProduct (G : Graph V) (H : Graph W) : Graph (V × W) where Adj p q := (G.Adj p.1 q.1 ∧ p.2 = q.2) ∨ (p.1 = q.1 ∧ H.Adj p.2 q.2) symm := by @@ -52,7 +52,7 @@ variable {V : Type u} {W : Type v} /-- A product distribution assembled from first-factor fibers indexed by the second factor. The value at `(x, z)` is the value of the `z`-fiber at `x`. -/ -def fibersDistribution (F : W → Pebbling V) : Pebbling (V × W) := +@[expose] def fibersDistribution (F : W → Pebbling V) : Pebbling (V × W) := fun p => F p.2 p.1 @[simp] diff --git a/LeanPool/PebblingLean/UpperBound.lean b/LeanPool/PebblingLean/UpperBound.lean index f283e42dc8..62cfb6cd9f 100644 --- a/LeanPool/PebblingLean/UpperBound.lean +++ b/LeanPool/PebblingLean/UpperBound.lean @@ -18,7 +18,7 @@ probabilistic high-demand part of the upper bound. The probabilistic estimates themselves are not asserted here; they will be formalized as separate lemmas. -/ -@[expose] public section +public section namespace PebblingLean @@ -39,7 +39,7 @@ theorem mem_annulus {n rIn rOut : ℕ} {target center : HypercubeVertex n} : /-- Contribution of one stack of size `2^rOut` at `center` toward `target`, counting only centers in the annulus. -/ -def annulusContribution {n : ℕ} (rIn rOut : ℕ) (target center : HypercubeVertex n) : ℕ := +@[expose] def annulusContribution {n : ℕ} (rIn rOut : ℕ) (target center : HypercubeVertex n) : ℕ := if rIn ≤ dist center target ∧ dist center target ≤ rOut then 2 ^ (rOut - dist center target) else @@ -100,14 +100,14 @@ theorem annulusContribution_sq_le_width_mul {n rIn rOut : ℕ} /-- The total annulus contribution of a finite list of centers to a fixed target. This is the Lean version of `X_t` in the proof. -/ -def annulusTotalContribution {n : ℕ} (rIn rOut : ℕ) (target : HypercubeVertex n) +@[expose] def annulusTotalContribution {n : ℕ} (rIn rOut : ℕ) (target : HypercubeVertex n) (centers : List (HypercubeVertex n)) : ℕ := (centers.map (annulusContribution rIn rOut target)).sum /-- The high-demand conclusion used as a target for the probabilistic lemma: a `T`-solvable distribution whose size is bounded and whose occupied piles are large. -/ -def HasHighDemandDistribution (n T : ℕ) (costBound minPile : ℕ) : Prop := +@[expose] def HasHighDemandDistribution (n T : ℕ) (costBound minPile : ℕ) : Prop := ∃ D : Pebbling (HypercubeVertex n), size D ≤ costBound ∧ SolvableAtLeast (graph n) D T ∧ diff --git a/LeanPool/PebblingLean/UpperBoundDelivery.lean b/LeanPool/PebblingLean/UpperBoundDelivery.lean index 43adc8242a..cfcaf065ae 100644 --- a/LeanPool/PebblingLean/UpperBoundDelivery.lean +++ b/LeanPool/PebblingLean/UpperBoundDelivery.lean @@ -23,7 +23,7 @@ annulus center. This file proves that the counted quantity is not just bookkeeping: it is actually deliverable by pebbling moves. -/ -@[expose] public section +public section namespace PebblingLean @@ -42,7 +42,7 @@ def stackListDistribution {n : ℕ} (rOut : ℕ) : /-- A center list is good for demand `T` if every target receives annulus contribution at least `T`. The probabilistic estimates will prove existence of such lists. -/ -def IsGoodCenterList (n rIn rOut T : ℕ) (centers : List (HypercubeVertex n)) : Prop := +@[expose] def IsGoodCenterList (n rIn rOut T : ℕ) (centers : List (HypercubeVertex n)) : Prop := ∀ target : HypercubeVertex n, T ≤ annulusTotalContribution rIn rOut target centers theorem size_stackListDistribution {n rOut : ℕ} diff --git a/LeanPool/PebblingLean/UpperBoundLoss.lean b/LeanPool/PebblingLean/UpperBoundLoss.lean index 1529dae3a9..9c1b31a371 100644 --- a/LeanPool/PebblingLean/UpperBoundLoss.lean +++ b/LeanPool/PebblingLean/UpperBoundLoss.lean @@ -22,7 +22,7 @@ parameters yet; instead, it proves the deterministic theorem that a bounded finite loss sum gives a uniform normalized-cost bound. -/ -@[expose] public section +public section namespace PebblingLean @@ -376,7 +376,7 @@ theorem cost_uniform_bound_of_decreasing_lossBound end LossRecurrence /-- Normalized integer cost bound, divided by `(4/3)^n`. -/ -noncomputable def normalizedCost (costBound : ℕ → ℕ) (n : ℕ) : ℝ := +@[expose] noncomputable def normalizedCost (costBound : ℕ → ℕ) (n : ℕ) : ℝ := (costBound n : ℝ) / (((4 : ℝ) / 3) ^ n) theorem normalizedCost_nonneg (costBound : ℕ → ℕ) (n : ℕ) : @@ -386,7 +386,7 @@ theorem normalizedCost_nonneg (costBound : ℕ → ℕ) (n : ℕ) : /-- A concrete finite bound for the normalized costs below a cutoff. This is not optimized; it is just a convenient way to discharge finite base cases. -/ -noncomputable def finiteBaseNormalizedBound (costBound : ℕ → ℕ) (n0 : ℕ) : ℝ := +@[expose] noncomputable def finiteBaseNormalizedBound (costBound : ℕ → ℕ) (n0 : ℕ) : ℝ := ∑ n ∈ Finset.range n0, normalizedCost costBound n theorem finiteBaseNormalizedBound_nonneg (costBound : ℕ → ℕ) (n0 : ℕ) : @@ -405,7 +405,7 @@ theorem normalizedCost_le_finiteBaseNormalizedBound_of_lt /-- Real-valued asymptotic upper-bound statement: for every dimension `n`, there is an ordinary solvable distribution whose size is at most `C * (4/3)^n`. -/ -def HasRealHypercubePebblingUpperBound (C : ℝ) : Prop := +@[expose] def HasRealHypercubePebblingUpperBound (C : ℝ) : Prop := ∀ n : ℕ, ∃ k : ℕ, Pebbling.HasSolvableAtMostSize (graph n) 1 k ∧ (k : ℝ) ≤ C * (((4 : ℝ) / 3) ^ n) diff --git a/LeanPool/PebblingLean/UpperBoundParameters.lean b/LeanPool/PebblingLean/UpperBoundParameters.lean index 1edeee255a..1f92dbda11 100644 --- a/LeanPool/PebblingLean/UpperBoundParameters.lean +++ b/LeanPool/PebblingLean/UpperBoundParameters.lean @@ -30,7 +30,7 @@ at the bottom proves that these hypotheses imply the real asymptotic upper bound. -/ -@[expose] public section +public section namespace PebblingLean @@ -48,13 +48,13 @@ noncomputable def splitA (K : ℝ) (n : ℕ) : ℕ := n - splitM K n /-- The technical occupied-pile invariant used in the recursion. -/ -def minPile (n : ℕ) : ℕ := +@[expose] def minPile (n : ℕ) : ℕ := 2 ^ (n / 5) /-- The recursive loss used in the paper, `n^{-2}`. At `n = 0` this is `0` under Lean's totalized inverse convention, but all recurrence uses are above a positive base cutoff. -/ -noncomputable def loss (n : ℕ) : ℝ := +@[expose] noncomputable def loss (n : ℕ) : ℝ := ((n : ℝ) ^ 2)⁻¹ /-- Integer multiplier for the fiber cost. This is the ceiling of the @@ -5732,7 +5732,7 @@ theorem hasRealUpperBound_of_explicitConstants_splitCutoff_finiteBase /-- A concrete cutoff large enough for the explicit constants `A=4`, `K=217`. It is exactly `(128 * 217^2)^2`. -/ -def explicitCutoff : ℕ := +@[expose] def explicitCutoff : ℕ := 36329454321664 theorem explicitCutoff_pos : 0 < explicitCutoff := by diff --git a/LeanPool/PebblingLean/UpperBoundProbability.lean b/LeanPool/PebblingLean/UpperBoundProbability.lean index ac72ad7fd5..55c9872428 100644 --- a/LeanPool/PebblingLean/UpperBoundProbability.lean +++ b/LeanPool/PebblingLean/UpperBoundProbability.lean @@ -21,7 +21,7 @@ Bernstein inputs. These are propositions, not axioms: later work must prove them or replace them with imported theorems. -/ -@[expose] public section +public section namespace PebblingLean @@ -41,7 +41,7 @@ def CenterSample.toList {n N : ℕ} (sample : CenterSample n N) : List.ofFn sample /-- Total annulus contribution of a sampled `N`-tuple to a fixed target. -/ -def sampleTotalContribution {n N : ℕ} (rIn rOut : ℕ) +@[expose] def sampleTotalContribution {n N : ℕ} (rIn rOut : ℕ) (target : HypercubeVertex n) (sample : CenterSample n N) : ℕ := ∑ j : Fin N, annulusContribution rIn rOut target (sample j) @@ -896,14 +896,14 @@ theorem sampleContributionSecondMomentProxy_le_two_width_mul_T ring /-- The event that a particular target receives less than demand `T`. -/ -def sampleTargetFails {n N : ℕ} (rIn rOut T : ℕ) +@[expose] def sampleTargetFails {n N : ℕ} (rIn rOut T : ℕ) (target : HypercubeVertex n) (sample : CenterSample n N) : Prop := sampleTotalContribution rIn rOut target sample < T instance instDecidableSampleTargetFails {n N rIn rOut T : ℕ} (target : HypercubeVertex n) (sample : CenterSample n N) : Decidable (sampleTargetFails rIn rOut T target sample) := by - unfold sampleTargetFails + change Decidable (sampleTotalContribution rIn rOut target sample < T) infer_instance instance instDecidablePredSampleTargetFails {n N rIn rOut T : ℕ} @@ -912,15 +912,15 @@ instance instDecidablePredSampleTargetFails {n N rIn rOut T : ℕ} fun sample => instDecidableSampleTargetFails target sample /-- The event that some target receives less than demand `T`. -/ -def sampleFailsSomeTarget {n N : ℕ} (rIn rOut T : ℕ) +@[expose] def sampleFailsSomeTarget {n N : ℕ} (rIn rOut T : ℕ) (sample : CenterSample n N) : Prop := ∃ target : HypercubeVertex n, sampleTargetFails rIn rOut T target sample instance instDecidableSampleFailsSomeTarget {n N rIn rOut T : ℕ} (sample : CenterSample n N) : Decidable (sampleFailsSomeTarget rIn rOut T sample) := by - classical - unfold sampleFailsSomeTarget + change Decidable (∃ target : HypercubeVertex n, + sampleTargetFails rIn rOut T target sample) infer_instance instance instDecidablePredSampleFailsSomeTarget {n N rIn rOut T : ℕ} : @@ -929,7 +929,7 @@ instance instDecidablePredSampleFailsSomeTarget {n N rIn rOut T : ℕ} : /-- Failure probability for one fixed target. This is the quantity controlled by Bernstein in the proof. -/ -noncomputable def targetFailureProbability {n N : ℕ} (rIn rOut T : ℕ) +@[expose] noncomputable def targetFailureProbability {n N : ℕ} (rIn rOut T : ℕ) (target : HypercubeVertex n) : ℚ := uniformProbability fun sample : CenterSample n N => sampleTargetFails rIn rOut T target sample @@ -1560,7 +1560,7 @@ theorem targetFailureProbability_le_exp_optimized_chord target hlam_pos (hmoment'.trans hexp) /-- Probability that some target fails. -/ -noncomputable def globalFailureProbability {n N : ℕ} (rIn rOut T : ℕ) : ℚ := +@[expose] noncomputable def globalFailureProbability {n N : ℕ} (rIn rOut T : ℕ) : ℚ := uniformProbability fun sample : CenterSample n N => sampleFailsSomeTarget rIn rOut T sample @@ -1570,19 +1570,11 @@ theorem globalFailureProbability_le_sum_targetFailureProbability {n N rIn rOut T ∑ target : HypercubeVertex n, targetFailureProbability (N := N) rIn rOut T target := by classical - change - uniformProbability - (fun sample : CenterSample n N => - ∃ target : HypercubeVertex n, - sampleTotalContribution rIn rOut target sample < T) ≤ - ∑ target : HypercubeVertex n, - uniformProbability - (fun sample : CenterSample n N => - sampleTotalContribution rIn rOut target sample < T) - exact - (uniformProbability_exists_le_sum - (Ω := CenterSample n N) (ι := HypercubeVertex n) - (fun target sample => sampleTotalContribution rIn rOut target sample < T)) + simpa only [globalFailureProbability, targetFailureProbability, + sampleFailsSomeTarget] using + (uniformProbability_exists_le_sum + (Ω := CenterSample n N) (ι := HypercubeVertex n) + (fun target sample => sampleTargetFails rIn rOut T target sample)) /-- Probabilistic-method extraction: if the probability that some target fails is less than one, then a good center sample exists. -/ @@ -1598,6 +1590,8 @@ theorem exists_goodCenterSample_of_globalFailureProbability_lt_one {n N rIn rOut (by simpa [globalFailureProbability] using hprob) with ⟨sample, hnot_fail⟩ refine ⟨sample, ?_⟩ + change ∀ target : HypercubeVertex n, + T ≤ annulusTotalContribution rIn rOut target sample.toList intro target have hnot_lt : ¬ sampleTotalContribution rIn rOut target sample < T := by diff --git a/LeanPool/PebblingLean/UpperBoundRecurrence.lean b/LeanPool/PebblingLean/UpperBoundRecurrence.lean index 74054acd72..164a0bfea0 100644 --- a/LeanPool/PebblingLean/UpperBoundRecurrence.lean +++ b/LeanPool/PebblingLean/UpperBoundRecurrence.lean @@ -20,7 +20,7 @@ annulus estimates; once those are instantiated, this theorem is the formal recursion step used in the upper bound. -/ -@[expose] public section +public section namespace PebblingLean @@ -29,6 +29,7 @@ namespace Hypercube /-- Ordinary upper-bound target for optimal pebbling of hypercubes: for each dimension `n`, there is a solvable distribution on `Q_n` of size at most `costBound n`. -/ +@[expose] def HasHypercubePebblingUpperBound (costBound : ℕ → ℕ) : Prop := ∀ n : ℕ, Pebbling.HasSolvableAtMostSize (graph n) 1 (costBound n) diff --git a/LeanPool/PebblingLean/Weight.lean b/LeanPool/PebblingLean/Weight.lean index 4b71dd2299..7d41567ddf 100644 --- a/LeanPool/PebblingLean/Weight.lean +++ b/LeanPool/PebblingLean/Weight.lean @@ -25,7 +25,7 @@ The lower-bound argument is organized around the standard pebbling weight function: a pebble at distance `d` from a target contributes `2^{-d}`. -/ -@[expose] public section +public section namespace PebblingLean @@ -36,12 +36,13 @@ namespace Pebbling variable {V : Type u} /-- Contribution of a single pebble at `u` to the weight with target `target`. -/ -noncomputable def unitWeight (dist : V → V → ℕ) (target u : V) : ℚ := +@[expose] noncomputable def unitWeight (dist : V → V → ℕ) (target u : V) : ℚ := (1 : ℚ) / (2 : ℚ) ^ dist u target /-- Weight of a pebbling distribution with respect to a target, using a supplied distance function. -/ -noncomputable def weight [Fintype V] (dist : V → V → ℕ) (D : Pebbling V) (target : V) : ℚ := +@[expose] noncomputable def weight [Fintype V] (dist : V → V → ℕ) + (D : Pebbling V) (target : V) : ℚ := ∑ u, (D u : ℚ) * unitWeight dist target u @[simp] diff --git a/LeanPool/PentagonalNumberTheorem.lean b/LeanPool/PentagonalNumberTheorem.lean index 2a36b6ba5a..01fc8e5f8e 100644 --- a/LeanPool/PentagonalNumberTheorem.lean +++ b/LeanPool/PentagonalNumberTheorem.lean @@ -25,4 +25,4 @@ Tags: number-theory, combinatorics, partitions, power-series, pentagonal-number- MSC: 11P81, 05A17 -/ -@[expose] public section +public section diff --git a/LeanPool/PentagonalNumberTheorem/Complex.lean b/LeanPool/PentagonalNumberTheorem/Complex.lean index cfeed53fd6..bc92bc722c 100644 --- a/LeanPool/PentagonalNumberTheorem/Complex.lean +++ b/LeanPool/PentagonalNumberTheorem/Complex.lean @@ -19,7 +19,7 @@ for real/complex numbers. -/ -@[expose] public section +public section open Filter variable {K : Type*} [RCLike K] diff --git a/LeanPool/PentagonalNumberTheorem/Generic.lean b/LeanPool/PentagonalNumberTheorem/Generic.lean index 569875cc4d..268e6ea38e 100644 --- a/LeanPool/PentagonalNumberTheorem/Generic.lean +++ b/LeanPool/PentagonalNumberTheorem/Generic.lean @@ -24,7 +24,7 @@ Reference: https://math.stackexchange.com/questions/55738/how-to-prove-eulers-pentagonal-theorem-some-hints-will-help -/ -@[expose] public section +public section open Filter @@ -67,7 +67,7 @@ We define an auxiliary sequence $$Γ_N = \sum_{n=0}^{\infty} gamma_{k, n} = \sum_{n=0}^{\infty} \left( x^{(k+1)n} \prod_{i=0}^{n} 1 - x^{k + i + 1} \right)$$ -/ -def gamma (k n : ℕ) (x : R) : R := +@[expose] def gamma (k n : ℕ) (x : R) : R := x ^ ((k + 1) * n) * ∏ i ∈ Finset.range (n + 1), (1 - x ^ (k + i + 1)) /-- And a second auxiliary sequence diff --git a/LeanPool/PentagonalNumberTheorem/Old.lean b/LeanPool/PentagonalNumberTheorem/Old.lean index ad0cc86da8..caa4d93ebc 100644 --- a/LeanPool/PentagonalNumberTheorem/Old.lean +++ b/LeanPool/PentagonalNumberTheorem/Old.lean @@ -27,7 +27,7 @@ is obsolete by the shorter ones in `PowerSeries.lean` and `Complex.lean`, but I it here to show case how a combinatorial proof can be done. -/ -@[expose] public section +public section open scoped PowerSeries.WithPiTopology @@ -227,7 +227,7 @@ theorem zipIdx_drop {l : List α} {n k : Nat} : simp [zipIdx_drop, h] /-- Returns the number of leading elements satisfying a condition. -/ -def lengthWhile (p : α → Prop) [DecidablePred p] : List α → ℕ +@[expose] def lengthWhile (p : α → Prop) [DecidablePred p] : List α → ℕ | [] => 0 | x :: xs => if p x then xs.lengthWhile p + 1 else 0 @@ -325,7 +325,7 @@ theorem lengthWhile_set · simp /-- Replace the last element `a` with `f a`. -/ -def updateLast (l : List α) (f : α → α) : List α := +@[expose] def updateLast (l : List α) (f : α → α) : List α := match l with | [] => [] | x :: xs => (x :: xs).set ((x :: xs).length - 1) (f ((x :: xs).getLast (by simp))) @@ -653,7 +653,7 @@ theorem diagSize_putLast (hn : 0 < n) (x : FerrersDiagram n) (i : ℕ) exact hlast.ne.symm /-- The criteria to legally move the diagonal down -/ -def IsToDown (hn : 0 < n) (x : FerrersDiagram n) := +@[expose] def IsToDown (hn : 0 < n) (x : FerrersDiagram n) := x.diagSize + 1 < x.delta.getLast (x.delta_ne_nil hn) instance (hn : 0 < n) (x : FerrersDiagram n) : Decidable (x.IsToDown hn) := by diff --git a/LeanPool/PentagonalNumberTheorem/Partition.lean b/LeanPool/PentagonalNumberTheorem/Partition.lean index 3e7c413a62..66f95b870a 100644 --- a/LeanPool/PentagonalNumberTheorem/Partition.lean +++ b/LeanPool/PentagonalNumberTheorem/Partition.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.PentagonalNumberTheorem.Partition`. -/ -@[expose] public section +public section theorem two_pentagonal (k : ℤ) : 2 * (k * (3 * k - 1) / 2) = k * (3 * k - 1) := by refine Int.two_mul_ediv_two_of_even ?_ diff --git a/LeanPool/PentagonalNumberTheorem/PowerSeries.lean b/LeanPool/PentagonalNumberTheorem/PowerSeries.lean index 66d829968f..b95e13451f 100644 --- a/LeanPool/PentagonalNumberTheorem/PowerSeries.lean +++ b/LeanPool/PentagonalNumberTheorem/PowerSeries.lean @@ -21,7 +21,7 @@ for power series. -/ -@[expose] public section +public section open PowerSeries Filter open scoped PowerSeries.WithPiTopology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Defs.lean b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Defs.lean index 87068ba510..4904b2ed18 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Defs.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Defs.lean @@ -39,46 +39,46 @@ via Franklin's involution. * `alphaOp`, `betaOp`: Franklin's involution maps on `distinctPartitionsAlpha` and `distinctPartitionsBeta` -/ -@[expose] public section +public section open Finset namespace PentagonalNumberTheorem.Franklin /-- The length of the maximal consecutive run of elements of `S` ending at `m`, counted downward. -/ -def consecutiveTopRun (S : Finset ℕ) : ℕ → ℕ +@[expose] def consecutiveTopRun (S : Finset ℕ) : ℕ → ℕ | 0 => if (0 : ℕ) ∈ S then 1 else 0 | m + 1 => if m + 1 ∈ S then 1 + consecutiveTopRun S m else 0 /-- The set of subsets `S ⊆ {1, …, n}` with `∑_{s ∈ S} s = n`, i.e., partitions of `n` into distinct positive parts. -/ -def distinctPartitions (n : ℕ) : Finset (Finset ℕ) := +@[expose] def distinctPartitions (n : ℕ) : Finset (Finset ℕ) := (Icc 1 n).powerset.filter (fun S ↦ S.sum id = n) /-- Partitions of `n` into distinct positive parts with an even number of parts. -/ -def distinctPartitionsEven (n : ℕ) : Finset (Finset ℕ) := +@[expose] def distinctPartitionsEven (n : ℕ) : Finset (Finset ℕ) := (distinctPartitions n).filter (fun S ↦ S.card % 2 = 0) /-- Partitions of `n` into distinct positive parts with an odd number of parts. -/ -def distinctPartitionsOdd (n : ℕ) : Finset (Finset ℕ) := +@[expose] def distinctPartitionsOdd (n : ℕ) : Finset (Finset ℕ) := (distinctPartitions n).filter (fun S ↦ S.card % 2 = 1) /-- Number of partitions of `n` into an even number of distinct positive parts. -/ -def pe (n : ℕ) : ℕ := (distinctPartitionsEven n).card +@[expose] def pe (n : ℕ) : ℕ := (distinctPartitionsEven n).card /-- Number of partitions of `n` into an odd number of distinct positive parts. -/ -def po (n : ℕ) : ℕ := (distinctPartitionsOdd n).card +@[expose] def po (n : ℕ) : ℕ := (distinctPartitionsOdd n).card /-- The smallest element of a partition, returning 0 for the empty set. -/ -def partBase (S : Finset ℕ) : ℕ := +@[expose] def partBase (S : Finset ℕ) : ℕ := if h : S.Nonempty then S.min' h else 0 /-- The largest element of a partition, returning 0 for the empty set. -/ -def partMax (S : Finset ℕ) : ℕ := +@[expose] def partMax (S : Finset ℕ) : ℕ := if h : S.Nonempty then S.max' h else 0 /-- The length of the maximal consecutive run from `max(S)` downward in `S`. -/ -def partSlope (S : Finset ℕ) : ℕ := consecutiveTopRun S (partMax S) +@[expose] def partSlope (S : Finset ℕ) : ℕ := consecutiveTopRun S (partMax S) /-- The interval `{max(S) − slope(S) + 1, …, max(S)}` (the "slope set" of `S`). -/ def partSlopeSet (S : Finset ℕ) : Finset ℕ := @@ -86,7 +86,7 @@ def partSlopeSet (S : Finset ℕ) : Finset ℕ := /-- Partitions `S ∈ distinctPartitions n` that are nonempty and satisfy `(b ≤ s ∧ b ∉ D) ∨ b + 1 ≤ s`, with `b = partBase S`, `s = partSlope S`. -/ -def distinctPartitionsAlpha (n : ℕ) : Finset (Finset ℕ) := +@[expose] def distinctPartitionsAlpha (n : ℕ) : Finset (Finset ℕ) := (distinctPartitions n).filter (fun S ↦ 0 < S.card ∧ ((partBase S ≤ partSlope S ∧ ¬(partMax S - partSlope S + 1 ≤ partBase S)) ∨ @@ -94,7 +94,7 @@ def distinctPartitionsAlpha (n : ℕ) : Finset (Finset ℕ) := /-- Partitions `S ∈ distinctPartitions n` that are nonempty and satisfy `(s < b ∧ b ∉ D) ∨ s + 2 ≤ b`, with `b = partBase S`, `s = partSlope S`. -/ -def distinctPartitionsBeta (n : ℕ) : Finset (Finset ℕ) := +@[expose] def distinctPartitionsBeta (n : ℕ) : Finset (Finset ℕ) := (distinctPartitions n).filter (fun S ↦ 0 < S.card ∧ ((partSlope S < partBase S ∧ ¬(partMax S - partSlope S + 1 ≤ partBase S)) ∨ @@ -102,7 +102,7 @@ def distinctPartitionsBeta (n : ℕ) : Finset (Finset ℕ) := /-- Partitions of `n` into distinct parts that are either empty or satisfy `base(S) ∈ slopeSet(S)` with `base(S) = slope(S)` or `base(S) = slope(S) + 1`. -/ -def distinctPartitionsSpecial (n : ℕ) : Finset (Finset ℕ) := +@[expose] def distinctPartitionsSpecial (n : ℕ) : Finset (Finset ℕ) := (distinctPartitions n).filter (fun S ↦ S.card = 0 ∨ (0 < S.card ∧ @@ -110,19 +110,19 @@ def distinctPartitionsSpecial (n : ℕ) : Finset (Finset ℕ) := (partBase S = partSlope S ∨ partBase S = partSlope S + 1))) /-- The pentagonal partition `S_{−k} = {k, k+1, …, 2k−1}` of `(3k²−k)/2`. -/ -def smkSet (k : ℕ) : Finset ℕ := Icc k (2 * k - 1) +@[expose] def smkSet (k : ℕ) : Finset ℕ := Icc k (2 * k - 1) /-- The pentagonal partition `S_k = {k+1, k+2, …, 2k}` of `(3k²+k)/2`. -/ -def spkSet (k : ℕ) : Finset ℕ := Icc (k + 1) (2 * k) +@[expose] def spkSet (k : ℕ) : Finset ℕ := Icc (k + 1) (2 * k) /-- For `S ∈ 𝒫_α(n)` with base `b` and max `m`, `α(S) = (S \ {b, m−b+1}) ∪ {m+1}`. -/ -def alphaOp (S : Finset ℕ) : Finset ℕ := +@[expose] def alphaOp (S : Finset ℕ) : Finset ℕ := let b := partBase S let m := partMax S insert (m + 1) ((S.erase b).erase (m - b + 1)) /-- For `S ∈ 𝒫_β(n)` with slope `s` and max `m`, `β(S) = (S ∪ {s, m−s}) \ {m}`. -/ -def betaOp (S : Finset ℕ) : Finset ℕ := +@[expose] def betaOp (S : Finset ℕ) : Finset ℕ := let s := partSlope S let m := partMax S (insert s (insert (m - s) S)).erase m diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/FormalPowerSeries.lean b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/FormalPowerSeries.lean index 1692edb172..8d647c01b8 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/FormalPowerSeries.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/FormalPowerSeries.lean @@ -31,7 +31,7 @@ These results connect the combinatorial content (proved in `Lemmas.lean`) to the algebraic identities involving generating functions. -/ -@[expose] public section +public section open Finset PowerSeries open scoped PowerSeries.WithPiTopology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Helpers.lean b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Helpers.lean index bbb3a01fbc..a3743a8872 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Helpers.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Helpers.lean @@ -37,7 +37,7 @@ and properties of `αOp`/`βOp`. invariants of an interval, which is the shape both pentagonal families `smkSet`/`spkSet` take -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Lemmas.lean b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Lemmas.lean index 486ee0dc6b..9b69063d07 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Lemmas.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/Franklin/Lemmas.lean @@ -36,7 +36,7 @@ following Franklin's involution argument. * `signed_partition_main`: pe(n) - po(n) = (-1)^k for pentagonal n, 0 otherwise -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/CauchyIdentity.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/CauchyIdentity.lean index 1807397daa..af26f6008d 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/CauchyIdentity.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/CauchyIdentity.lean @@ -22,7 +22,7 @@ The proof follows Heine's classical functional-equation argument. * `QSeries.hasSum_qPochhammer_div_mul_pow` — the Cauchy identity. -/ -@[expose] public section +public section open Finset Filter open scoped Topology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/Defs.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/Defs.lean index 950e6be9bd..3879a17fb7 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/Defs.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/Defs.lean @@ -35,7 +35,7 @@ binomial coefficient $\binom{n}{k}_q$, together with their basic properties. $\binom{n}{k}_q (q;q)_k (q;q)_{n-k} = (q;q)_n$. -/ -@[expose] public section +public section open Finset Filter open scoped Topology @@ -81,7 +81,7 @@ variable {R : Type*} /-- **Finite q-Pochhammer symbol.** $(a;q)_n = \prod_{k=0}^{n-1} (1 - a q^k)$. -/ -def qPochhammer [CommRing R] (a q : R) (n : ℕ) : R := +@[expose] def qPochhammer [CommRing R] (a q : R) (n : ℕ) : R := ∏ k ∈ range n, (1 - a * q ^ k) /-- The empty q-Pochhammer product $(a;q)_0 = 1$. -/ @@ -99,7 +99,7 @@ theorem qPochhammer_succ [CommRing R] (a q : R) (n : ℕ) : Defined by the q-Pascal recurrence so that the result is always a polynomial in $q$ (no division). The boundary cases are $\binom{0}{0}_q = 1$, $\binom{0}{k+1}_q = 0$, $\binom{n+1}{0}_q = 1$. -/ -def qBinom [CommRing R] : ℕ → ℕ → R → R +@[expose] def qBinom [CommRing R] : ℕ → ℕ → R → R | 0, 0, _ => 1 | 0, _ + 1, _ => 0 | _ + 1, 0, _ => 1 diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/EulerIdentities.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/EulerIdentities.lean index ae55aad1ca..b94b7f307a 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/EulerIdentities.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/EulerIdentities.lean @@ -26,7 +26,7 @@ Two classical specializations of the Cauchy identity: * `QSeries.euler_second_identity` — the second Euler identity. -/ -@[expose] public section +public section open Finset Filter open scoped Topology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPS.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPS.lean index 1f0c7bb85f..a452e366fe 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPS.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPS.lean @@ -40,7 +40,7 @@ convergence hypotheses are needed. (proved in `QSeries.FPSAlgebra`). -/ -@[expose] public section +public section noncomputable section @@ -55,7 +55,7 @@ variable {R : Type*} [CommRing R] /-- **Finite q-Pochhammer symbol** in `R⟦X⟧`. `(a; X)_n = ∏_{k=0}^{n-1} (1 - a · X^k)` where `a ∈ R⟦X⟧`. -/ -def qPochhammer (a : R⟦X⟧) (n : ℕ) : R⟦X⟧ := +@[expose] def qPochhammer (a : R⟦X⟧) (n : ℕ) : R⟦X⟧ := ∏ k ∈ range n, (1 - a * X ^ k) /-- The empty finite q-Pochhammer product `(a; X)_0 = 1`. -/ @@ -118,7 +118,7 @@ theorem multipliable_one_sub_mul_pow (a : R⟦X⟧) : /-- **Infinite q-Pochhammer symbol** `(a; X)_∞ = ∏_{k ≥ 0} (1 - a · X^k)`. Well-defined in `R⟦X⟧` with the pi topology. -/ -def qPochhammerInf (a : R⟦X⟧) : R⟦X⟧ := +@[expose] def qPochhammerInf (a : R⟦X⟧) : R⟦X⟧ := ∏' k : ℕ, (1 - a * X ^ k) /-- The `d`-th coefficient of `(a; X)_∞` equals the `d`-th coefficient of `(a; X)_{d+1}`. -/ @@ -195,19 +195,19 @@ abbrev laurentZ : A⟦X⟧ := PS (LaurentPolynomial.T 1) abbrev laurentZInv : A⟦X⟧ := PS (LaurentPolynomial.T (-1)) /-- `(q; q)_∞` in `A⟦X⟧`. -/ -def qPochhammerInfX : A⟦X⟧ := qPochhammerInf X +@[expose] def qPochhammerInfX : A⟦X⟧ := qPochhammerInf X /-- `(-z; q)_∞` in `A⟦X⟧`. -/ -def qPochhammerInfNegZ : A⟦X⟧ := qPochhammerInf (-laurentZ) +@[expose] def qPochhammerInfNegZ : A⟦X⟧ := qPochhammerInf (-laurentZ) /-- `(-q/z; q)_∞` in `A⟦X⟧`. -/ -def qPochhammerInfNegXMulZInv : A⟦X⟧ := qPochhammerInf (-X * laurentZInv) +@[expose] def qPochhammerInfNegXMulZInv : A⟦X⟧ := qPochhammerInf (-X * laurentZInv) /-- The **Jacobi triple product** (LHS) as an element of `A⟦X⟧`. -/ -def jacobiProd : A⟦X⟧ := qPochhammerInfX * qPochhammerInfNegZ * qPochhammerInfNegXMulZInv +@[expose] def jacobiProd : A⟦X⟧ := qPochhammerInfX * qPochhammerInfNegZ * qPochhammerInfNegXMulZInv /-- The **bilateral theta series** (RHS). -/ -def jacobiBilateral : A⟦X⟧ := +@[expose] def jacobiBilateral : A⟦X⟧ := (∑' n : ℕ, PS (LaurentPolynomial.T (n : ℤ)) * X ^ n.choose 2) + (∑' m : ℕ, PS (LaurentPolynomial.T (-(↑m + 1))) * X ^ (m + 2).choose 2) diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSAlgebra.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSAlgebra.lean index 921d0627ab..d85f7a91a5 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSAlgebra.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSAlgebra.lean @@ -27,7 +27,7 @@ and Cauchy product, these identities yield the Jacobi triple product. * `QSeries.FormalPowerSeries.jacobiTripleProduct` — FPS Jacobi Triple Product Identity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSEuler.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSEuler.lean index 23a98f7e2f..e3b8f560fe 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSEuler.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FPSEuler.lean @@ -19,7 +19,7 @@ Gaussian binomial coefficient `qBinom(N, k, X)` converges to `(qPochhammer(X, k) as N → ∞. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FiniteBinomial.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FiniteBinomial.lean index c555efe2c4..8f37b302b9 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FiniteBinomial.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/FiniteBinomial.lean @@ -19,7 +19,7 @@ $$\prod_{k=0}^{n-1}(1 + z q^k) = \sum_{k=0}^{n} q^{\binom{k}{2}} \binom{n}{k}_q * `QSeries.prod_one_add_mul_pow_eq_sum_qBinom` — the finite q-binomial theorem. -/ -@[expose] public section +public section open Finset Filter open scoped Topology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/InfPochhammer.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/InfPochhammer.lean index 7d6373396a..1d1eea48c2 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/InfPochhammer.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/InfPochhammer.lean @@ -27,7 +27,7 @@ partial-product convergence. * `QSeries.qPochhammerInf_eq_one_sub_mul` — telescoping $(z;q)_\infty = (1-z)(zq;q)_\infty$. -/ -@[expose] public section +public section open Finset Filter open scoped Topology @@ -38,7 +38,7 @@ namespace QSeries Defined unconditionally as a `tprod`; convergence (under $\|q\| < 1$) is provided by `multipliable_one_sub_mul_pow`. -/ -noncomputable def qPochhammerInf (a q : ℂ) : ℂ := ∏' k : ℕ, (1 - a * q ^ k) +@[expose] noncomputable def qPochhammerInf (a q : ℂ) : ℂ := ∏' k : ℕ, (1 - a * q ^ k) /-- For $\|q\| < 1$ the sequence $n \mapsto \|{-}(a q^n)\|$ is summable: it is the geometric series $\|a\| \cdot \|q\|^n$. -/ diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPAnalytic.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPAnalytic.lean index 6762a32be7..68f214beaa 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPAnalytic.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPAnalytic.lean @@ -28,7 +28,7 @@ restriction $\|z\| < 1$). $\|q\| < 1$ and $z \neq 0$. -/ -@[expose] public section +public section open Finset Filter open scoped Topology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPCore.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPCore.lean index 5c1998d06e..e71e45d783 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPCore.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPCore.lean @@ -18,7 +18,7 @@ The proof strategy: Show $(q;q)_∞ (-z;q)_∞ (-q/z;q)_∞ = g(z)$ by: Key identity: $(q;q)_∞ / (q;q)_n = (q^{n+1};q)_∞$ (telescoping) -/ -@[expose] public section +public section open Finset Filter open scoped Topology diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPKeyIdentity.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPKeyIdentity.lean index 9ee1b7b001..1c055c3f68 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPKeyIdentity.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JTPKeyIdentity.lean @@ -22,7 +22,7 @@ This forces all differences to be zero (since S_k → 1/(q;q)_∞), so all S_k are equal to 1/(q;q)_∞. -/ -@[expose] public section +public section open Finset Filter open scoped Topology @@ -32,11 +32,11 @@ namespace QSeries noncomputable section /-- The key sum S_k(q) = Σ_{m≥0} q^{m(m+k)} / ((q;q)_m (q;q)_{m+k}). -/ -def keySum (q : ℂ) (k : ℕ) : ℂ := +@[expose] def keySum (q : ℂ) (k : ℕ) : ℂ := ∑' m : ℕ, q ^ (m * (m + k)) / (qPochhammer q q m * qPochhammer q q (m + k)) /-- The summand of S_k. -/ -def keySummand (q : ℂ) (k : ℕ) (m : ℕ) : ℂ := +@[expose] def keySummand (q : ℂ) (k : ℕ) (m : ℕ) : ℂ := q ^ (m * (m + k)) / (qPochhammer q q m * qPochhammer q q (m + k)) /-- Unfolds `keySum` as the tsum of `keySummand`. -/ diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JacobiTripleProduct.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JacobiTripleProduct.lean index eb07f1756c..d1ad2840b9 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JacobiTripleProduct.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/JacobiTripleProduct.lean @@ -27,7 +27,7 @@ The proof uses: * `QSeries.jacobiTripleProduct` — the Jacobi triple product identity. -/ -@[expose] public section +public section open Finset Filter open scoped Topology @@ -78,20 +78,20 @@ theorem summable_inv_pow_mul_pow_choose_two {q z : ℂ} (hq : ‖q‖ < 1) : /-- The Jacobi triple product function $f(z) = (q;q)_\infty \cdot (-z;q)_\infty \cdot (-q/z;q)_\infty$. -/ -def jacobiProd (q z : ℂ) : ℂ := +@[expose] def jacobiProd (q z : ℂ) : ℂ := qPochhammerInf q q * qPochhammerInf (-z) q * qPochhammerInf (-q / z) q /-- The bilateral Jacobi series (non-negative part). -/ -def jacobiBilateralPos (q z : ℂ) : ℂ := +@[expose] def jacobiBilateralPos (q z : ℂ) : ℂ := ∑' k : ℕ, z ^ k * q ^ k.choose 2 /-- The bilateral Jacobi series (negative part). For $k = -(m+1)$ with $m \geq 0$, the exponent is $\binom{m+2}{2} = (m+1)(m+2)/2$. -/ -def jacobiBilateralNeg (q z : ℂ) : ℂ := +@[expose] def jacobiBilateralNeg (q z : ℂ) : ℂ := ∑' m : ℕ, (z⁻¹) ^ (m + 1) * q ^ (m + 2).choose 2 /-- The full bilateral Jacobi series. -/ -def jacobiBilateral (q z : ℂ) : ℂ := +@[expose] def jacobiBilateral (q z : ℂ) : ℂ := jacobiBilateralPos q z + jacobiBilateralNeg q z /-- **Telescoping for $(-z;q)_\infty$**: $(-z;q)_\infty = (1+z)(-zq;q)_\infty$. -/ diff --git a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/PentagonalNumber.lean b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/PentagonalNumber.lean index e42a6be59e..2e91092c5a 100644 --- a/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/PentagonalNumber.lean +++ b/LeanPool/PentagonalNumberTheoremAnalytic/QSeries/PentagonalNumber.lean @@ -26,7 +26,7 @@ $\{3n\} \cup \{3n-2\} \cup \{3n-1\} = \mathbb{Z}_{\geq 1}$. * `QSeries.euler_pentagonal_number` — the pentagonal number theorem. -/ -@[expose] public section +public section open Finset Filter open scoped Topology diff --git a/LeanPool/PhaseRetrieval.lean b/LeanPool/PhaseRetrieval.lean index f7ae90ebbc..af5fdc875c 100644 --- a/LeanPool/PhaseRetrieval.lean +++ b/LeanPool/PhaseRetrieval.lean @@ -25,7 +25,7 @@ Tags: phase-retrieval, hermite-fock, gaussian-measure, complex-analysis MSC: 42C05, 46E22, 94A12 -/ -@[expose] public section +public section /-! ## References diff --git a/LeanPool/PhaseRetrieval/Constant.lean b/LeanPool/PhaseRetrieval/Constant.lean index ef0c30ab23..d0c79fcde9 100644 --- a/LeanPool/PhaseRetrieval/Constant.lean +++ b/LeanPool/PhaseRetrieval/Constant.lean @@ -26,7 +26,7 @@ apply to the centered polynomial. The phase-aligned conclusion is then obtained by the wrapper in `LocalHelpers.lean`. -/ -@[expose] public section +public section open FockSPR MeasureTheory Complex Real Polynomial diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean index dd8eabe95b..340518ae22 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # AnnulusLocalEstimate -/ -@[expose] public section +public section open MeasureTheory Complex Real Finset diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean b/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean index 1feed38cde..1c63059743 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean @@ -30,7 +30,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # BlockDecomposition -/ -@[expose] public section +public section open Finset Nat Real MeasureTheory @@ -46,7 +46,7 @@ Note: `|I_ℓ| = 2ℓ + 1`. -/ /-- The frequency block `I_ℓ = [ℓ², (ℓ+1)² − 1]`. -/ -def freqBlock (ℓ : ℕ) : Finset ℕ := +@[expose] def freqBlock (ℓ : ℕ) : Finset ℕ := Finset.Icc (ℓ ^ 2) ((ℓ + 1) ^ 2 - 1) /-! ## Def 5.2: Block polynomials @@ -55,7 +55,7 @@ def freqBlock (ℓ : ℕ) : Finset ℕ := -/ /-- The block polynomial: restriction of `U` to frequencies in `I_ℓ`. -/ -def blockPoly {D : ℕ} (a : Fin D → ℂ) (ℓ : ℕ) (z : ℂ) : ℂ := +@[expose] def blockPoly {D : ℕ} (a : Fin D → ℂ) (ℓ : ℕ) (z : ℂ) : ℂ := ∑ k : Fin D, if (k.val + 1) ∈ freqBlock ℓ then a k * z ^ (k.val + 1) else 0 /-! ## Def 5.3: Maximum block index @@ -64,7 +64,7 @@ def blockPoly {D : ℕ} (a : Fin D → ℂ) (ℓ : ℕ) (z : ℂ) : ℂ := -/ /-- `Λ = Nat.sqrt D` — the index of the last complete block. -/ -def maxBlockIndex (D : ℕ) : ℕ := Nat.sqrt D +@[expose] def maxBlockIndex (D : ℕ) : ℕ := Nat.sqrt D /-! ## Def 5.4: Local and remainder pieces @@ -74,12 +74,12 @@ For fixed `M ≥ 1` and `j : ℕ`: -/ /-- The local polynomial around annulus `j`, collecting blocks within distance `M`. -/ -def localPoly {D : ℕ} (a : Fin D → ℂ) (M j : ℕ) (z : ℂ) : ℂ := +@[expose] def localPoly {D : ℕ} (a : Fin D → ℂ) (M j : ℕ) (z : ℂ) : ℂ := ∑ ℓ ∈ Finset.Icc (max 1 (j - M)) (min (maxBlockIndex D) (j + M)), blockPoly a ℓ z /-- The remainder polynomial: `R_j = U − V_j`. -/ -def remainderPoly {D : ℕ} (a : Fin D → ℂ) (M j : ℕ) (z : ℂ) : ℂ := +@[expose] def remainderPoly {D : ℕ} (a : Fin D → ℂ) (M j : ℕ) (z : ℂ) : ℂ := polyEval a z - localPoly a M j z /-! ### Helper lemmas -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/Definitions.lean b/LeanPool/PhaseRetrieval/Constant/Internal/Definitions.lean index aa1917700c..4591ee829a 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/Definitions.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/Definitions.lean @@ -26,7 +26,7 @@ import Mathlib.MeasureTheory.Integral.Gamma /-! # Definitions -/ -@[expose] public section +public section open MeasureTheory Complex Real Finset @@ -45,7 +45,7 @@ We adopt Mathlib's conventions throughout: - **Complex plane**: `ℂ ≃ ℝ²`. Lebesgue measure on `ℂ` is `volume`. -/ /-- The two-pi period, as a convenient abbreviation. -/ -def T : ℝ := 2 * Real.pi +@[expose] def T : ℝ := 2 * Real.pi lemma T_pos : 0 < T := mul_pos two_pos Real.pi_pos @@ -54,39 +54,39 @@ instance : Fact (0 < T) := ⟨T_pos⟩ /-! ## Def 1.1: The function `rho` -/ /-- `rho(w) = | ‖1 + w‖ - 1 |` where `‖·‖` is the complex modulus. -/ -def rho (w : ℂ) : ℝ := |‖(1 : ℂ) + w‖ - 1| +@[expose] def rho (w : ℂ) : ℝ := |‖(1 : ℂ) + w‖ - 1| /-! ## Def 1.2: Polynomial evaluation -/ /-- For `a : Fin D → ℂ` representing coefficients `a₁, …, a_D`, the polynomial `U(z) = ∑_{n=1}^D aₙ zⁿ` with `U(0) = 0`. -/ -def polyEval {D : ℕ} (a : Fin D → ℂ) (z : ℂ) : ℂ := +@[expose] def polyEval {D : ℕ} (a : Fin D → ℂ) (z : ℂ) : ℂ := ∑ k : Fin D, a k * z ^ (k.val + 1) /-! ## Def 1.3: Polynomial evaluation on a circle (via AddCircle) -/ /-- Restriction of the polynomial to `|z| = r`, viewed as a function on `AddCircle T`. `polyEvalCircle a r t = ∑_k a(k) * r^{k+1} * fourier(k+1)(t)`. -/ -def polyEvalCircle {D : ℕ} (a : Fin D → ℂ) (r : ℝ) : AddCircle T → ℂ := +@[expose] def polyEvalCircle {D : ℕ} (a : Fin D → ℂ) (r : ℝ) : AddCircle T → ℂ := fun t => ∑ k : Fin D, a k * (r : ℂ) ^ (k.val + 1) * fourier ((k.val + 1 : ℕ) : ℤ) t /-! ## Def 1.4: Fock norm squared (finite) -/ /-- `‖U‖_F² = ∑_{n=1}^D |aₙ|² n!` — the Fock-space norm squared as a finite sum. -/ -def fockNormSq {D : ℕ} (a : Fin D → ℂ) : ℝ := +@[expose] def fockNormSq {D : ℕ} (a : Fin D → ℂ) : ℝ := ∑ k : Fin D, ‖a k‖ ^ 2 * (Nat.factorial (k.val + 1) : ℝ) /-! ## Def 1.5: Rho-Fock norm squared (finite) -/ /-- The RHS of the main inequality: `(1/π) ∫_ℂ ρ(U(z))² exp(−|z|²) dm(z)`. -/ -def rhoFockNormSq {D : ℕ} (a : Fin D → ℂ) : ℝ := +@[expose] def rhoFockNormSq {D : ℕ} (a : Fin D → ℂ) : ℝ := (1 / Real.pi) * ∫ z : ℂ, (rho (polyEval a z)) ^ 2 * Real.exp (-‖z‖ ^ 2) /-! ## Def 1.6: Circle L² norm squared -/ /-- `‖f‖²_{L²(S¹)} = ∫ |f(t)|² d(haar)` w.r.t. normalized Haar measure on `AddCircle T`. -/ -def circleNormSq (f : AddCircle T → ℂ) : ℝ := +@[expose] def circleNormSq (f : AddCircle T → ℂ) : ℝ := ∫ t, ‖f t‖ ^ 2 ∂AddCircle.haarAddCircle /-! ## Helper lemmas -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean index b5d8330471..6aa991f67d 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean @@ -28,7 +28,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # HighFreqBandEstimate -/ -@[expose] public section +public section open MeasureTheory Complex Real Finset diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean index 5c498bcb33..572b09c48a 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # LaplaceFactorial -/ -@[expose] public section +public section open Real MeasureTheory Set @@ -39,11 +39,11 @@ namespace FockSPR /-! ## Definitions -/ /-- `r_n = √(n + 1/2)`, the saddle point of `φ_n`. -/ -def rStar (n : ℕ) : ℝ := Real.sqrt (n + 1 / 2) +@[expose] def rStar (n : ℕ) : ℝ := Real.sqrt (n + 1 / 2) /-- `φ_n(r) = (2n + 1) log(r) − r²` for `r > 0`. Note: `r^{2n+1} exp(−r²) = exp(φ_n(r))`. -/ -def phiFunc (n : ℕ) (r : ℝ) : ℝ := (2 * n + 1) * Real.log r - r ^ 2 +@[expose] def phiFunc (n : ℕ) (r : ℝ) : ℝ := (2 * n + 1) * Real.log r - r ^ 2 /-! ## Private lemmas -/ @@ -250,7 +250,7 @@ Integrating over an interval of length 1 and applying Theorem 2.9. -/ /-- Distance from a point to a closed interval `[j, j+1]`. -/ -def distToInterval (x : ℝ) (j : ℕ) : ℝ := +@[expose] def distToInterval (x : ℝ) (j : ℕ) : ℝ := max (max ((j : ℝ) - x) (x - (j + 1 : ℝ))) 0 private lemma distToInterval_nonneg (x : ℝ) (j : ℕ) : 0 ≤ distToInterval x j := diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean index 61ca58e4a1..38b248abbe 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # LeakageEstimate -/ -@[expose] public section +public section open MeasureTheory Real Finset Complex @@ -400,7 +400,7 @@ where `η_M := 2 exp(1/4) ∑_{m ≥ M} exp(−m²)`. -/ /-- The leakage coefficient `η_M = 2 exp(1/4) ∑_{m ≥ M}^∞ exp(−m²)`. -/ -def etaCoeff (M : ℕ) (bound : ℕ) : ℝ := +@[expose] def etaCoeff (M : ℕ) (bound : ℕ) : ℝ := 2 * Real.exp (1 / 4) * ∑ m ∈ Finset.Icc M bound, Real.exp (-(m : ℝ) ^ 2) /-! ### Helper: symmetric block_annulus_leakage -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean index 1ca1c03cf5..40694c480f 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean @@ -24,7 +24,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # LipschitzRho -/ -@[expose] public section +public section open Complex Real diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean b/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean index ebe57c57fb..1424b8788c 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean @@ -34,7 +34,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # Local -/ -@[expose] public section +public section open FockSPR MeasureTheory Complex Real Polynomial diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean index fd0a42442f..ad8393f01b 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # LocalCircleEstimate -/ -@[expose] public section +public section open MeasureTheory Complex Real Finset diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean index 9d875052aa..34a50ed046 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # LocalCore -/ -@[expose] public section +public section open FockSPR MeasureTheory Complex Real Polynomial Finset diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean index 0e5d2a4b8d..50476f3725 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # LocalHelpers -/ -@[expose] public section +public section open FockSPR MeasureTheory Complex Real Polynomial Finset diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/MainTheorem.lean b/LeanPool/PhaseRetrieval/Constant/Internal/MainTheorem.lean index eece804a7a..44f7a9f052 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/MainTheorem.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/MainTheorem.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # MainTheorem -/ -@[expose] public section +public section open MeasureTheory Complex Real Finset Polynomial diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/MissingMathlib/Poincare.lean b/LeanPool/PhaseRetrieval/Constant/Internal/MissingMathlib/Poincare.lean index 0b9ea8ba09..af0e602e64 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/MissingMathlib/Poincare.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/MissingMathlib/Poincare.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Positivity.Finset /-! # Poincare -/ -@[expose] public section +public section open MeasureTheory Real Set intervalIntegral Filter diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean b/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean index 2ab1ea7e8e..0288325fcb 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean @@ -21,7 +21,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # RotationalAveraging -/ -@[expose] public section +public section open MeasureTheory Real Complex Finset diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean b/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean index d8ed0d7bd9..15df9c389a 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Positivity.Finset /-! # SafeSquare -/ -@[expose] public section +public section open Real diff --git a/LeanPool/PhaseRetrieval/DimdPoly.lean b/LeanPool/PhaseRetrieval/DimdPoly.lean index 0e2d844eca..e15e0cdead 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # DimdPoly -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean index 308ab163aa..f9fa856b60 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # Auxiliary -/ -@[expose] public section +public section open scoped BigOperators @@ -37,27 +37,27 @@ only paper-facing definitions. -/ /-- `explicitGaussianDensity`: explicit Gaussian Density. -/ -def explicitGaussianDensity (d : Nat) (z : Fin d -> ℂ) : ℝ := +@[expose] def explicitGaussianDensity (d : Nat) (z : Fin d -> ℂ) : ℝ := (1 / Real.pi ^ d) * Real.exp (-Finset.sum Finset.univ (fun q : Fin d => ‖z q‖ ^ 2)) /-- `explicitGamma`: explicit Gamma. -/ -def explicitGamma (d : Nat) : MeasureTheory.Measure (Fin d -> ℂ) := +@[expose] def explicitGamma (d : Nat) : MeasureTheory.Measure (Fin d -> ℂ) := MeasureTheory.volume.withDensity fun z => ENNReal.ofReal (explicitGaussianDensity d z) /-- `explicitComplexHermite`: explicit Complex Hermite. -/ -def explicitComplexHermite (m n : Nat) (z : ℂ) : ℂ := +@[expose] def explicitComplexHermite (m n : Nat) (z : ℂ) : ℂ := Finset.sum (Finset.range (min m n + 1)) fun j => ((-1 : ℂ) ^ j) * (Nat.factorial j : ℂ) * (Nat.choose m j : ℂ) * (Nat.choose n j : ℂ) * z ^ (m - j) * (star z) ^ (n - j) /-- `explicitPhi1D`: explicit Phi1 D. -/ -def explicitPhi1D (k n : Nat) (z : ℂ) : ℂ := +@[expose] def explicitPhi1D (k n : Nat) (z : ℂ) : ℂ := (((Real.sqrt ((Nat.factorial n : ℝ) * (Nat.factorial k : ℝ))) : ℂ)⁻¹) * explicitComplexHermite n k z /-- `explicitPhi`: explicit Phi. -/ -def explicitPhi {d : Nat} (kappa alpha : Fin d -> Nat) (z : Fin d -> ℂ) : ℂ := +@[expose] def explicitPhi {d : Nat} (kappa alpha : Fin d -> Nat) (z : Fin d -> ℂ) : ℂ := Finset.prod Finset.univ fun q : Fin d => explicitPhi1D (kappa q) (alpha q) (z q) /-- `explicitPkappaNorm`: explicit Pkappa Norm. -/ @@ -65,7 +65,7 @@ def explicitPkappaNorm {d : Nat} (F : Finsupp (Fin d -> Nat) ℂ) : ℝ := Real.sqrt (Finset.sum F.support fun alpha => ‖F alpha‖ ^ 2) /-- `explicitEvalPkappa`: explicit Eval Pkappa. -/ -def explicitEvalPkappa {d : Nat} (kappa : Fin d -> Nat) (F : Finsupp (Fin d -> Nat) ℂ) : +@[expose] def explicitEvalPkappa {d : Nat} (kappa : Fin d -> Nat) (F : Finsupp (Fin d -> Nat) ℂ) : (Fin d -> ℂ) -> ℂ := fun z => F.sum fun alpha c => c * explicitPhi kappa alpha z @@ -303,12 +303,12 @@ theorem stablePhaseRetrievalExplicitRange /-! ## Closure upgrade -/ /-- `explicitGaussianL2DistanceSq`: explicit Gaussian L2 Distance Sq. -/ -def explicitGaussianL2DistanceSq +@[expose] def explicitGaussianL2DistanceSq {d : ℕ} (P Q : (Fin d -> ℂ) -> ℂ) : ℝ := ∫ z, ‖P z - Q z‖ ^ 2 ∂ explicitGamma d /-- `explicitModulusDistanceSq`: explicit Modulus Distance Sq. -/ -def explicitModulusDistanceSq +@[expose] def explicitModulusDistanceSq {d : ℕ} (P Q : (Fin d -> ℂ) -> ℂ) : ℝ := ∫ z, (‖P z‖ - ‖Q z‖) ^ 2 ∂ explicitGamma d @@ -372,7 +372,7 @@ private theorem memLp_of_explicitHermitePoly exact memLp_two_evalPkappa hd κ F /-- `UnitPhase`: Unit Phase. -/ -def UnitPhase : Type := +@[expose] def UnitPhase : Type := { θ : ℂ // ‖θ‖ = 1 } instance : TopologicalSpace UnitPhase := diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean index ed801140b0..81368e38e4 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean @@ -19,7 +19,7 @@ import Mathlib.Topology.MetricSpace.Sequences /-! # CoefficientLimitRigidity -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean index 2395c4c26b..c3de7af5d9 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # Definitions -/ -@[expose] public section +public section open scoped BigOperators @@ -60,34 +60,34 @@ structure Skappa (d : Nat) (kappa : MultiIndex d) where instance : Fact (0 < (2 * Real.pi : ℝ)) := ⟨by positivity⟩ /-- `gaussianDensity`: gaussian Density. -/ -def gaussianDensity (d : Nat) (z : Cd d) : ℝ := +@[expose] def gaussianDensity (d : Nat) (z : Cd d) : ℝ := (1 / Real.pi ^ d) * Real.exp (-Finset.sum Finset.univ (fun q : Fin d => ‖z q‖ ^ 2)) /-- `gammaD`: gamma d. -/ -def gammaD (d : Nat) : MeasureTheory.Measure (Cd d) := +@[expose] def gammaD (d : Nat) : MeasureTheory.Measure (Cd d) := MeasureTheory.volume.withDensity fun z => ENNReal.ofReal (gaussianDensity d z) /-- `L2Tensor`: L2 Tensor. -/ abbrev L2Tensor (d : Nat) := MeasureTheory.Lp ℂ 2 (gammaD d) /-- `complexHermite`: complex Hermite. -/ -def complexHermite (m n : Nat) (z : ℂ) : ℂ := +@[expose] def complexHermite (m n : Nat) (z : ℂ) : ℂ := Finset.sum (Finset.range (min m n + 1)) fun j => ((-1 : ℂ) ^ j) * (Nat.factorial j : ℂ) * (Nat.choose m j : ℂ) * (Nat.choose n j : ℂ) * z ^ (m - j) * (star z) ^ (n - j) /-- `phi1D`: phi1 D. -/ -def phi1D (k n : Nat) (z : ℂ) : ℂ := +@[expose] def phi1D (k n : Nat) (z : ℂ) : ℂ := (((Real.sqrt ((Nat.factorial n : ℝ) * (Nat.factorial k : ℝ))) : ℂ)⁻¹) * complexHermite n k z /-- `Phi`: Phi. -/ -def Phi {d : Nat} (kappa : MultiIndex d) (alpha : Idx d) (z : Cd d) : ℂ := +@[expose] def Phi {d : Nat} (kappa : MultiIndex d) (alpha : Idx d) (z : Cd d) : ℂ := Finset.prod Finset.univ fun q : Fin d => phi1D (kappa q) (alpha q) (z q) /-- `box`: box. -/ -def box {d : Nat} (J : MultiIndex d) : Finset (Idx d) := +@[expose] def box {d : Nat} (J : MultiIndex d) : Finset (Idx d) := Fintype.piFinset fun q : Fin d => Finset.range (J q + 1) noncomputable instance instNormCircleTrigPoly : Norm CircleTrigPoly := @@ -113,27 +113,30 @@ instance {d : Nat} {kappa : MultiIndex d} : SMul ℂ (Skappa d kappa) where exact u.summable_norm_sq.mul_left (‖c‖ ^ 2) } /-- `coeffPkappa`: coeff Pkappa. -/ +@[expose] def coeffPkappa {d : Nat} {kappa : MultiIndex d} (F : Pkappa d kappa) (alpha : Idx d) : ℂ := F alpha /-- `coeffSkappa`: coeff Skappa. -/ +@[expose] def coeffSkappa {d : Nat} {kappa : MultiIndex d} (F : Skappa d kappa) (alpha : Idx d) : ℂ := F.coeff alpha /-- `evalPkappa`: eval Pkappa. -/ -def evalPkappa {d : Nat} (kappa : MultiIndex d) (F : Pkappa d kappa) : Cd d -> ℂ := +@[expose] def evalPkappa {d : Nat} (kappa : MultiIndex d) (F : Pkappa d kappa) : Cd d -> ℂ := fun z => F.sum fun alpha c => c * Phi kappa alpha z /-- `toFun`: to Fun. -/ -def toFun {d : Nat} (kappa : MultiIndex d) (F : Skappa d kappa) : Cd d -> ℂ := +@[expose] def toFun {d : Nat} (kappa : MultiIndex d) (F : Skappa d kappa) : Cd d -> ℂ := fun z => ∑' alpha : Idx d, coeffSkappa F alpha * Phi kappa alpha z /-- `toL2`: to L2. -/ +@[expose] noncomputable def toL2 {d : Nat} (kappa : MultiIndex d) (F : Skappa d kappa) : L2Tensor d := by classical exact if h : MeasureTheory.MemLp (toFun kappa F) 2 (gammaD d) then h.toLp (toFun kappa F) else 0 /-- `ofPkappa`: of Pkappa. -/ -def ofPkappa {d : Nat} (kappa : MultiIndex d) (F : Pkappa d kappa) : Skappa d kappa := +@[expose] def ofPkappa {d : Nat} (kappa : MultiIndex d) (F : Pkappa d kappa) : Skappa d kappa := { coeff := fun alpha => F alpha summable_norm_sq := by classical @@ -142,11 +145,13 @@ def ofPkappa {d : Nat} (kappa : MultiIndex d) (F : Pkappa d kappa) : Skappa d ka simp_all } /-- `projFinset`: proj Finset. -/ +@[expose] def projFinset {d : Nat} {kappa : MultiIndex d} (E : Finset (Idx d)) (F : Pkappa d kappa) : Pkappa d kappa := F.filter fun alpha => alpha ∈ E /-- `truncateFinset`: truncate Finset. -/ +@[expose] def truncateFinset {d : Nat} {kappa : MultiIndex d} (E : Finset (Idx d)) (F : Skappa d kappa) : Pkappa d kappa := Finset.sum E fun alpha => Finsupp.single alpha (coeffSkappa F alpha) @@ -156,15 +161,15 @@ def rotateCoord {d : Nat} (q : Fin d) (t : ℝ) (z : Cd d) : Cd d := Function.update z q (Complex.exp (t * Complex.I) * z q) /-- `pkappaInner`: pkappa Inner. -/ -def pkappaInner {d : Nat} {kappa : MultiIndex d} (F G : Pkappa d kappa) : ℂ := +@[expose] def pkappaInner {d : Nat} {kappa : MultiIndex d} (F G : Pkappa d kappa) : ℂ := F.sum fun alpha c => c * star (G alpha) /-- `basePointNormalized`: base Point Normalized. -/ -def basePointNormalized {d : Nat} {kappa : MultiIndex d} (F : Pkappa d kappa) : Prop := +@[expose] def basePointNormalized {d : Nat} {kappa : MultiIndex d} (F : Pkappa d kappa) : Prop := F ≠ 0 ∧ ‖F‖ = 1 /-- `orthogonalToPk`: orthogonal To Pk. -/ -def orthogonalToPk {d : Nat} {kappa : MultiIndex d} (F G : Pkappa d kappa) : Prop := +@[expose] def orthogonalToPk {d : Nat} {kappa : MultiIndex d} (F G : Pkappa d kappa) : Prop := pkappaInner G F = 0 /-- @@ -174,32 +179,32 @@ The coefficient of `Q` in the `F` direction is required to be a nonnegative real number. This is the global gauge needed for a no-`δ`, `lambda = 1` stability statement: the weaker local real gauge would still allow `Q = -F`. -/ -def positivePhaseGauge {d : Nat} {kappa : MultiIndex d} +@[expose] def positivePhaseGauge {d : Nat} {kappa : MultiIndex d} (F Q : Pkappa d kappa) : Prop := (pkappaInner Q F).im = 0 ∧ 0 ≤ (pkappaInner Q F).re /-- `defect`: defect. -/ -def defect {d : Nat} {kappa : MultiIndex d} (F G : Pkappa d kappa) : ℝ := +@[expose] def defect {d : Nat} {kappa : MultiIndex d} (F G : Pkappa d kappa) : ℝ := Real.sqrt <| ∫ z, (‖evalPkappa kappa (F + G) z‖ - ‖evalPkappa kappa F z‖) ^ 2 ∂ gammaD d /-- `productAnnulus`: product Annulus. -/ -def productAnnulus {d : Nat} (j : Idx d) : Set (Cd d) := +@[expose] def productAnnulus {d : Nat} (j : Idx d) : Set (Cd d) := { z | ∀ q : Fin d, (j q : ℝ) ≤ ‖z q‖ ∧ ‖z q‖ < (j q : ℝ) + 1 } /-- `annulusMass`: annulus Mass. -/ -def annulusMass {d : Nat} {kappa : MultiIndex d} (j : Idx d) (F : Skappa d kappa) : ℝ := +@[expose] def annulusMass {d : Nat} {kappa : MultiIndex d} (j : Idx d) (F : Skappa d kappa) : ℝ := ∫ z, Set.indicator (productAnnulus j) (fun w => ‖toFun kappa F w‖ ^ 2) z ∂ gammaD d /-- `lowAnnuli`: low Annuli. -/ -def lowAnnuli (d J : Nat) : Finset (Idx d) := +@[expose] def lowAnnuli (d J : Nat) : Finset (Idx d) := Fintype.piFinset fun _ : Fin d => Finset.range J /-- `lowAnnulusMass`: low Annulus Mass. -/ -def lowAnnulusMass {d : Nat} {kappa : MultiIndex d} (J : Nat) (F : Skappa d kappa) : ℝ := +@[expose] def lowAnnulusMass {d : Nat} {kappa : MultiIndex d} (J : Nat) (F : Skappa d kappa) : ℝ := Finset.sum (lowAnnuli d J) fun j => annulusMass j F /-- `highAnnulusMass`: high Annulus Mass. -/ -def highAnnulusMass {d : Nat} {kappa : MultiIndex d} (J : Nat) (F : Skappa d kappa) : ℝ := +@[expose] def highAnnulusMass {d : Nat} {kappa : MultiIndex d} (J : Nat) (F : Skappa d kappa) : ℝ := (∫ z, ‖toFun kappa F z‖ ^ 2 ∂ gammaD d) - lowAnnulusMass J F /-- `coefficientRadius`: coefficient Radius. -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean index 337d259575..21257cd8a8 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean @@ -21,7 +21,7 @@ import Mathlib.Topology.Algebra.Module.Cardinality /-! # ExactModulusRecovery -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean index cc92fdd1cf..df0c247db3 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # FiniteBaseAnnulusEstimate -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean index 16abceaf32..a0e276aed7 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # FiniteBaseCircleEstimate -/ -@[expose] public section +public section noncomputable section @@ -36,12 +36,12 @@ explicit support and gap parameters. -/ /-- `lowPoly`: low Poly. -/ -noncomputable def lowPoly {D : Nat} (q : Fin (D + 1) -> ℂ) : +@[expose] noncomputable def lowPoly {D : Nat} (q : Fin (D + 1) -> ℂ) : AddCircle (2 * Real.pi) -> ℂ := fun t => ∑ n : Fin (D + 1), q n * circleChar n.1 t /-- `bandPoly`: band Poly. -/ -noncomputable def bandPoly (N : Nat) {L : Nat} (p : Fin L -> ℂ) : +@[expose] noncomputable def bandPoly (N : Nat) {L : Nat} (p : Fin L -> ℂ) : AddCircle (2 * Real.pi) -> ℂ := fun t => ∑ m : Fin L, p m * circleChar (N + m.1) t @@ -245,11 +245,11 @@ private theorem continuous_bandPoly (N : Nat) {L : Nat} (p : Fin L -> ℂ) : continuous_const.mul (continuous_circleChar (N + m.1)) /-- `circleL2Sq`: circle L2 Sq. -/ -noncomputable def circleL2Sq (f : AddCircle (2 * Real.pi) -> ℂ) : ℝ := +@[expose] noncomputable def circleL2Sq (f : AddCircle (2 * Real.pi) -> ℂ) : ℝ := ∫ t, ‖f t‖ ^ 2 ∂ AddCircle.haarAddCircle /-- `defectSq`: defect Sq. -/ -noncomputable def defectSq +@[expose] noncomputable def defectSq (Q P : AddCircle (2 * Real.pi) -> ℂ) : ℝ := ∫ t, (‖Q t + P t‖ - ‖Q t‖) ^ 2 ∂ AddCircle.haarAddCircle diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean index e6e11dd217..e360b30b88 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean @@ -25,7 +25,7 @@ import Mathlib.Combinatorics.Matroid.Init /-! # Definitions -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset @@ -36,7 +36,7 @@ noncomputable section namespace HermiteLEAN /-- The circle period used throughout the Hermite development. -/ -def T : ℝ := 2 * Real.pi +@[expose] def T : ℝ := 2 * Real.pi lemma T_pos : 0 < T := by dsimp [T] @@ -48,10 +48,10 @@ instance : Fact (0 < T) := ⟨T_pos⟩ abbrev Circle := AddCircle T /-- Positive part. -/ -def posPart (x : ℝ) : ℝ := max x 0 +@[expose] def posPart (x : ℝ) : ℝ := max x 0 /-- The signed modulus defect imported from the Fock-space argument. -/ -def rho (w : ℂ) : ℝ := |‖(1 : ℂ) + w‖ - 1| +@[expose] def rho (w : ℂ) : ℝ := |‖(1 : ℂ) + w‖ - 1| /-- The distinguished basis vector `Φ₀(z) = \bar z`. -/ def phi0 (z : ℂ) : ℂ := conj z @@ -71,27 +71,27 @@ def phi : ℕ → ℂ → ℂ Real.sqrt ((Nat.factorial (Nat.succ n) : ℕ) : ℝ)) : ℂ) /-- The weighted inner product on `L²_γ(ℂ)`. -/ -def weightedInner (F G : ℂ → ℂ) : ℂ := +@[expose] def weightedInner (F G : ℂ → ℂ) : ℂ := (1 / Real.pi : ℂ) * ∫ z, F z * conj (G z) * (Real.exp (-‖z‖ ^ 2) : ℂ) ∂(volume : Measure ℂ) /-- The weighted squared norm on `L²_γ(ℂ)`. -/ -def weightedNormSq (F : ℂ → ℂ) : ℝ := +@[expose] def weightedNormSq (F : ℂ → ℂ) : ℝ := (1 / Real.pi) * ∫ z, ‖F z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) ∂(volume : Measure ℂ) /-- The weighted norm on `L²_γ(ℂ)`. -/ -def weightedNorm (F : ℂ → ℂ) : ℝ := Real.sqrt (weightedNormSq F) +@[expose] def weightedNorm (F : ℂ → ℂ) : ℝ := Real.sqrt (weightedNormSq F) /-- The pointwise modulus defect relative to a background function `F₀`. -/ -def modulusDefect (F0 G : ℂ → ℂ) (z : ℂ) : ℝ := |‖F0 z + G z‖ - ‖F0 z‖| +@[expose] def modulusDefect (F0 G : ℂ → ℂ) (z : ℂ) : ℝ := |‖F0 z + G z‖ - ‖F0 z‖| /-- The weighted squared defect norm relative to a background function `F₀`. -/ -def weightedDefectNormSq (F0 G : ℂ → ℂ) : ℝ := +@[expose] def weightedDefectNormSq (F0 G : ℂ → ℂ) : ℝ := (1 / Real.pi) * ∫ z, (modulusDefect F0 G z) ^ 2 * Real.exp (-‖z‖ ^ 2) ∂(volume : Measure ℂ) /-- The weighted defect norm relative to a background function `F₀`. -/ -def weightedDefectNorm (F0 G : ℂ → ℂ) : ℝ := Real.sqrt (weightedDefectNormSq F0 G) +@[expose] def weightedDefectNorm (F0 G : ℂ → ℂ) : ℝ := Real.sqrt (weightedDefectNormSq F0 G) /-- The orthogonal complement to `Φ₀`, expressed via the weighted inner product. -/ def Phi0Perp : Set (ℂ → ℂ) := {F | weightedInner F phi0 = 0} @@ -105,7 +105,7 @@ def hermiteCoeffNormSq {D : ℕ} (a : Fin D → ℂ) : ℝ := ∑ n : Fin D, ‖a n‖ ^ 2 /-- The unit circle point of radius `r` and argument `t`. -/ -def circlePoint (r : ℝ) (t : Circle) : ℂ := (r : ℂ) * (fourier (1 : ℤ) t : ℂ) +@[expose] def circlePoint (r : ℝ) (t : Circle) : ℂ := (r : ℂ) * (fourier (1 : ℤ) t : ℂ) /-- The coefficient appearing in the circle reduction for `Φ_{n+1}`. @@ -122,18 +122,18 @@ def circlePolynomial {D : ℕ} (a : Fin D → ℂ) (r : ℝ) : Circle → ℂ := fun t => ∑ n : Fin D, circleCoeff a r n * fourier ((n.1 + 1 : ℕ) : ℤ) t /-- A generic positive-frequency trigonometric polynomial. -/ -def positiveTrigonometricPolynomial (E : Finset ℕ) (c : ℕ → ℂ) : Circle → ℂ := +@[expose] def positiveTrigonometricPolynomial (E : Finset ℕ) (c : ℕ → ℂ) : Circle → ℂ := fun t => Finset.sum E (fun n => c n * fourier (n : ℤ) t) /-- Consecutive positive frequencies `[N, N + L - 1]`. -/ -def frequencyBand (N L : ℕ) : Finset ℕ := Finset.Icc N (N + L - 1) +@[expose] def frequencyBand (N L : ℕ) : Finset ℕ := Finset.Icc N (N + L - 1) /-- The circle `L²` norm squared with respect to normalized Haar measure. -/ -def circleL2Sq (f : Circle → ℂ) : ℝ := +@[expose] def circleL2Sq (f : Circle → ℂ) : ℝ := ∫ t, ‖f t‖ ^ 2 ∂AddCircle.haarAddCircle /-- The circle defect against the constant `1`. -/ -def circleRhoNormSq (f : Circle → ℂ) : ℝ := +@[expose] def circleRhoNormSq (f : Circle → ℂ) : ℝ := ∫ t, (rho (f t)) ^ 2 ∂AddCircle.haarAddCircle /-- The pointwise circle modulus defect relative to a background function `F₀`. -/ @@ -145,18 +145,18 @@ def circleDefectNormSq (F0 G : Circle → ℂ) : ℝ := ∫ t, (circleModulusDefect F0 G t) ^ 2 ∂AddCircle.haarAddCircle /-- The annulus `A_j = { z : j ≤ |z| < j + 1 }`. -/ -def annulus (j : ℕ) : Set ℂ := {z | (j : ℝ) ≤ ‖z‖ ∧ ‖z‖ < ((j + 1 : ℕ) : ℝ)} +@[expose] def annulus (j : ℕ) : Set ℂ := {z | (j : ℝ) ≤ ‖z‖ ∧ ‖z‖ < ((j + 1 : ℕ) : ℝ)} /-- The weighted squared mass of a function on annulus `A_j`. -/ -def annulusIntegralSq (F : ℂ → ℂ) (j : ℕ) : ℝ := +@[expose] def annulusIntegralSq (F : ℂ → ℂ) (j : ℕ) : ℝ := (1 / Real.pi) * ∫ z in annulus j, ‖F z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) ∂(volume : Measure ℂ) /-- The square block `I_ℓ = { n : ℓ² ≤ n < (ℓ + 1)² }`. -/ -def squareBlock (ℓ : ℕ) : Finset ℕ := Finset.Ico (ℓ ^ 2) ((ℓ + 1) ^ 2) +@[expose] def squareBlock (ℓ : ℕ) : Finset ℕ := Finset.Ico (ℓ ^ 2) ((ℓ + 1) ^ 2) /-- The block index of a positive Hermite mode. -/ -def blockIndex (n : ℕ) : ℕ := Nat.sqrt n +@[expose] def blockIndex (n : ℕ) : ℕ := Nat.sqrt n /-- The `ℓ`-th block of a finite Hermite perturbation. -/ def blockPiece {D : ℕ} (a : Fin D → ℂ) (ℓ : ℕ) : ℂ → ℂ := diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean index dd0267cdcd..0ee4b994e6 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # ImportedAnalyticInputs -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean index 8d14a9211f..1ecbbbfa82 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean @@ -18,7 +18,7 @@ import Mathlib.Combinatorics.Matroid.Init /-! # MissingMathlib -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset Filter diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean index ad7ddb3fb8..47dc0396cb 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # BlockLocalization -/ -@[expose] public section +public section diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean index 6499237c23..78046350ee 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean @@ -11,7 +11,7 @@ import Mathlib.Combinatorics.Matroid.Init /-! # Definitions -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset @@ -36,15 +36,15 @@ instance : Fact (0 < T) := ⟨T_pos⟩ abbrev Circle := AddCircle T /-- `gaussianDensity`: gaussian Density. -/ -def gaussianDensity (d : ℕ) (z : CSpace d) : ℝ := +@[expose] def gaussianDensity (d : ℕ) (z : CSpace d) : ℝ := (1 / Real.pi ^ d) * Real.exp (-(∑ q : Fin d, ‖z q‖ ^ 2)) /-- `gaussianMeasure`: gaussian Measure. -/ -def gaussianMeasure (d : ℕ) : Measure (CSpace d) := +@[expose] def gaussianMeasure (d : ℕ) : Measure (CSpace d) := volume.withDensity fun z => ENNReal.ofReal (gaussianDensity d z) /-- `oneDimPhi`: one Dim Phi. -/ -noncomputable def oneDimPhi (k n : ℕ) : ℂ → ℂ := fun z => +@[expose] noncomputable def oneDimPhi (k n : ℕ) : ℂ → ℂ := fun z => ((1 / Real.sqrt ((Nat.factorial k : ℝ) * (Nat.factorial n : ℝ))) : ℂ) * Finset.sum (Finset.range (min k n + 1)) (fun j => ((-1 : ℂ) ^ j) * (Nat.choose k j : ℂ) * @@ -52,30 +52,30 @@ noncomputable def oneDimPhi (k n : ℕ) : ℂ → ℂ := fun z => z ^ (n - j) * (star z) ^ (k - j)) /-- `PhiKappaAlpha`: Phi Kappa Alpha. -/ -def PhiKappaAlpha {d : ℕ} (κ α : MultiIndex d) : CSpace d → ℂ := +@[expose] def PhiKappaAlpha {d : ℕ} (κ α : MultiIndex d) : CSpace d → ℂ := fun z => ∏ q : Fin d, oneDimPhi (κ q) (α q) (z q) /-- `nuKappa`: nu Kappa. -/ -def nuKappa {d : ℕ} (κ : MultiIndex d) : CSpace d → ℂ := +@[expose] def nuKappa {d : ℕ} (κ : MultiIndex d) : CSpace d → ℂ := PhiKappaAlpha κ 0 /-- `rho`: rho. -/ -def rho (a u : ℂ) : ℝ := |‖a + u‖ - ‖a‖| +@[expose] def rho (a u : ℂ) : ℝ := |‖a + u‖ - ‖a‖| /-- `gaussianL2NormSq`: gaussian L2 Norm Sq. -/ -def gaussianL2NormSq {d : ℕ} {α : Type*} [Norm α] (F : CSpace d → α) : ℝ := +@[expose] def gaussianL2NormSq {d : ℕ} {α : Type*} [Norm α] (F : CSpace d → α) : ℝ := ∫ z, ‖F z‖ ^ 2 ∂ gaussianMeasure d /-- `gaussianL2Norm`: gaussian L2 Norm. -/ -def gaussianL2Norm {d : ℕ} {α : Type*} [Norm α] (F : CSpace d → α) : ℝ := +@[expose] def gaussianL2Norm {d : ℕ} {α : Type*} [Norm α] (F : CSpace d → α) : ℝ := Real.sqrt (gaussianL2NormSq F) /-- `gaussianInner`: gaussian Inner. -/ -def gaussianInner {d : ℕ} (F G : CSpace d → ℂ) : ℂ := +@[expose] def gaussianInner {d : ℕ} (F G : CSpace d → ℂ) : ℂ := ∫ z, F z * conj (G z) ∂ gaussianMeasure d /-- `circleL2NormSq`: circle L2 Norm Sq. -/ -def circleL2NormSq {α : Type*} [Norm α] (F : Circle → α) : ℝ := +@[expose] def circleL2NormSq {α : Type*} [Norm α] (F : Circle → α) : ℝ := ∫ t, ‖F t‖ ^ 2 ∂ AddCircle.haarAddCircle /-- `circleL2Norm`: circle L2 Norm. -/ @@ -90,13 +90,13 @@ structure FiniteHermiteSum (d : ℕ) where namespace FiniteHermiteSum /-- `support`: support. -/ -def support {d : ℕ} (G : FiniteHermiteSum d) : Finset (MultiIndex d) := +@[expose] def support {d : ℕ} (G : FiniteHermiteSum d) : Finset (MultiIndex d) := G.coeff.support end FiniteHermiteSum /-- `evalHermiteSum`: eval Hermite Sum. -/ -def evalHermiteSum {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : CSpace d → ℂ := +@[expose] def evalHermiteSum {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : CSpace d → ℂ := fun z => Finset.sum G.support fun α => G.coeff α * PhiKappaAlpha κ α z /-- `hermiteInner`: hermite Inner. -/ @@ -104,11 +104,11 @@ def hermiteInner {d : ℕ} (κ : MultiIndex d) (G H : FiniteHermiteSum d) : ℂ gaussianInner (evalHermiteSum κ G) (evalHermiteSum κ H) /-- `hermiteInnerNu`: hermite Inner Nu. -/ -def hermiteInnerNu {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : ℂ := +@[expose] def hermiteInnerNu {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : ℂ := gaussianInner (evalHermiteSum κ G) (nuKappa κ) /-- `hermiteNormSq`: hermite Norm Sq. -/ -def hermiteNormSq {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : ℝ := +@[expose] def hermiteNormSq {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : ℝ := gaussianL2NormSq (evalHermiteSum κ G) /-- `hermiteNorm`: hermite Norm. -/ @@ -128,15 +128,15 @@ def defectNorm {d : ℕ} (κ : MultiIndex d) (G : FiniteHermiteSum d) : ℝ := gaussianL2Norm (defectFunction κ G) /-- `totalDegree`: total Degree. -/ -def totalDegree {d : ℕ} (α : MultiIndex d) : ℕ := +@[expose] def totalDegree {d : ℕ} (α : MultiIndex d) : ℕ := ∑ q : Fin d, α q /-- `blockIndexMulti`: block Index Multi. -/ -def blockIndexMulti {d : ℕ} (α : MultiIndex d) : MultiIndex d := +@[expose] def blockIndexMulti {d : ℕ} (α : MultiIndex d) : MultiIndex d := fun q => HermiteLEAN.blockIndex (α q) /-- `totalDegreePiece`: total Degree Piece. -/ -def totalDegreePiece {d : ℕ} (n : ℕ) (G : FiniteHermiteSum d) : FiniteHermiteSum d := by +@[expose] def totalDegreePiece {d : ℕ} (n : ℕ) (G : FiniteHermiteSum d) : FiniteHermiteSum d := by classical refine ⟨Finsupp.onFinset (G.support.filter fun α => totalDegree α = n) (fun α => if totalDegree α = n then G.coeff α else 0) ?_⟩ @@ -147,29 +147,29 @@ def totalDegreePiece {d : ℕ} (n : ℕ) (G : FiniteHermiteSum d) : FiniteHermit exact Finset.mem_filter.mpr ⟨hsupp, hdeg⟩ /-- `productAnnulus`: product Annulus. -/ -def productAnnulus {d : ℕ} (j : MultiIndex d) : Set (CSpace d) := +@[expose] def productAnnulus {d : ℕ} (j : MultiIndex d) : Set (CSpace d) := { z | ∀ q, (j q : ℝ) ≤ ‖z q‖ ∧ ‖z q‖ < (j q : ℝ) + 1 } /-- `indicatorMul`: the indicator of `s` times `f`, valued in `ℂ`. -/ -def indicatorMul {α : Type*} (s : Set α) (f : α → ℂ) : α → ℂ := +@[expose] def indicatorMul {α : Type*} (s : Set α) (f : α → ℂ) : α → ℂ := by classical exact fun x => if x ∈ s then f x else 0 /-- `annulusInner`: annulus Inner. -/ -def annulusInner {d : ℕ} (j : MultiIndex d) (F G : CSpace d → ℂ) : ℂ := +@[expose] def annulusInner {d : ℕ} (j : MultiIndex d) (F G : CSpace d → ℂ) : ℂ := by classical exact ∫ z, if z ∈ productAnnulus j then F z * conj (G z) else 0 ∂ gaussianMeasure d /-- `annulusMass`: annulus Mass. -/ -def annulusMass {d : ℕ} (j : MultiIndex d) (F : CSpace d → ℂ) : ℝ := +@[expose] def annulusMass {d : ℕ} (j : MultiIndex d) (F : CSpace d → ℂ) : ℝ := by classical exact ∫ z, if z ∈ productAnnulus j then ‖F z‖ ^ 2 else 0 ∂ gaussianMeasure d /-- `defectAnnulusMass`: defect Annulus Mass. -/ -def defectAnnulusMass {d : ℕ} (κ : MultiIndex d) (j : MultiIndex d) +@[expose] def defectAnnulusMass {d : ℕ} (κ : MultiIndex d) (j : MultiIndex d) (F : CSpace d → ℂ) : ℝ := by classical @@ -178,14 +178,15 @@ def defectAnnulusMass {d : ℕ} (κ : MultiIndex d) (j : MultiIndex d) ∂ gaussianMeasure d /-- `squareBlock`: square Block. -/ -def squareBlock {d : ℕ} (ℓ : MultiIndex d) : Set (MultiIndex d) := +@[expose] def squareBlock {d : ℕ} (ℓ : MultiIndex d) : Set (MultiIndex d) := { α | ∀ q, α q ∈ HermiteLEAN.squareBlock (ℓ q) } /-- `blockDistance`: block Distance. -/ -def blockDistance {d : ℕ} (j ℓ : MultiIndex d) : ℕ := +@[expose] def blockDistance {d : ℕ} (j ℓ : MultiIndex d) : ℕ := (Finset.univ : Finset (Fin d)).sup fun q => Nat.dist (j q) (ℓ q) /-- `blockPart`: block Part. -/ +@[expose] def blockPart {d : ℕ} (ℓ : MultiIndex d) (G : FiniteHermiteSum d) : FiniteHermiteSum d := by classical refine ⟨Finsupp.onFinset (G.support.filter fun α => α ∈ squareBlock ℓ) @@ -197,17 +198,17 @@ def blockPart {d : ℕ} (ℓ : MultiIndex d) (G : FiniteHermiteSum d) : FiniteHe exact Finset.mem_filter.mpr ⟨hsupp, hblock⟩ /-- `localCoeffSet`: local Coeff Set. -/ -def localCoeffSet {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : +@[expose] def localCoeffSet {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : Finset (MultiIndex d) := G.support.filter fun α => blockDistance j (blockIndexMulti α) ≤ M /-- `farCoeffSet`: far Coeff Set. -/ -def farCoeffSet {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : +@[expose] def farCoeffSet {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : Finset (MultiIndex d) := G.support.filter fun α => M < blockDistance j (blockIndexMulti α) /-- `localPart`: local Part. -/ -def localPart {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : +@[expose] def localPart {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : FiniteHermiteSum d := by classical refine ⟨Finsupp.onFinset (localCoeffSet j M G) @@ -219,7 +220,7 @@ def localPart {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : exact Finset.mem_filter.mpr ⟨hsupp, hlocal⟩ /-- `remainderPart`: remainder Part. -/ -def remainderPart {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : +@[expose] def remainderPart {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : FiniteHermiteSum d := by classical refine ⟨Finsupp.onFinset (farCoeffSet j M G) @@ -231,6 +232,7 @@ def remainderPart {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d exact Finset.mem_filter.mpr ⟨hsupp, hfar⟩ /-- `localDegreeSet`: local Degree Set. -/ +@[expose] def localDegreeSet {d : ℕ} (j : MultiIndex d) (M : ℕ) (G : FiniteHermiteSum d) : Finset ℕ := (localCoeffSet j M G).image totalDegree @@ -240,30 +242,30 @@ def localDegreePiece {d : ℕ} (j : MultiIndex d) (M n : ℕ) (G : FiniteHermite totalDegreePiece n (localPart j M G) /-- `degreeIntervalLower`: degree Interval Lower. -/ -def degreeIntervalLower {d : ℕ} (j : MultiIndex d) (M : ℕ) : ℕ := +@[expose] def degreeIntervalLower {d : ℕ} (j : MultiIndex d) (M : ℕ) : ℕ := ∑ q, (max (j q) M - M) ^ 2 /-- `degreeIntervalUpper`: degree Interval Upper. -/ -def degreeIntervalUpper {d : ℕ} (j : MultiIndex d) (M : ℕ) : ℕ := +@[expose] def degreeIntervalUpper {d : ℕ} (j : MultiIndex d) (M : ℕ) : ℕ := ∑ q, ((j q + M + 1) ^ 2 - 1) /-- `degreeWidth`: degree Width. -/ -def degreeWidth {d : ℕ} (j : MultiIndex d) (M : ℕ) : ℕ := +@[expose] def degreeWidth {d : ℕ} (j : MultiIndex d) (M : ℕ) : ℕ := degreeIntervalUpper j M - degreeIntervalLower j M + 1 /-- `annulusRadius`: annulus Radius. -/ -def annulusRadius {d : ℕ} (j : MultiIndex d) : ℕ := +@[expose] def annulusRadius {d : ℕ} (j : MultiIndex d) : ℕ := (Finset.univ : Finset (Fin d)).sup fun q => j q /-- `degreeThreshold`: degree Threshold. -/ -def degreeThreshold (d M : ℕ) : ℕ := M + 120 * d * (2 * M + 1) +@[expose] def degreeThreshold (d M : ℕ) : ℕ := M + 120 * d * (2 * M + 1) /-- `productAnnulusConstant`: product Annulus Constant. -/ def productAnnulusConstant (d M : ℕ) : ℝ := 12 * Real.sqrt d * ((degreeThreshold d M + M : ℕ) : ℝ) /-- `productAnnulusConstantSq`: product Annulus Constant Sq. -/ -def productAnnulusConstantSq (d M : ℕ) : ℝ := +@[expose] def productAnnulusConstantSq (d M : ℕ) : ℝ := 144 * d * ((degreeThreshold d M + M : ℕ) : ℝ) ^ 2 /-- `prodLocalizationConstant`: prod Localization Constant. -/ @@ -279,11 +281,11 @@ def prodLocalizationShift {d : ℕ} (κ : MultiIndex d) : ℝ := ∑ q : Fin d, ((κ q + 4 : ℕ) : ℝ) /-- `shellCardinality`: shell Cardinality. -/ -def shellCardinality (d r : ℕ) : ℕ := +@[expose] def shellCardinality (d r : ℕ) : ℕ := (2 * r + 1) ^ d - (2 * r - 1) ^ d /-- `localizationLeakageCoefficient`: localization Leakage Coefficient. -/ -def localizationLeakageCoefficient (C c B : ℝ) (d M : ℕ) : ℝ := +@[expose] def localizationLeakageCoefficient (C c B : ℝ) (d M : ℕ) : ℝ := C * ∑' r : ℕ, if M + 1 ≤ r then @@ -332,19 +334,19 @@ def phaseAdjustedNorm {d : ℕ} (κ : MultiIndex d) (w : ℂ) (G : FiniteHermite gaussianL2Norm (phaseAdjustedDifference κ w G) /-- `positiveFrequencyPolynomial`: positive Frequency Polynomial. -/ -def positiveFrequencyPolynomial (E : Finset ℕ) (b : ℕ → ℂ) : Circle → ℂ := +@[expose] def positiveFrequencyPolynomial (E : Finset ℕ) (b : ℕ → ℂ) : Circle → ℂ := fun t => Finset.sum E fun n => b n * fourier (n : ℤ) t /-- `bandLimitedPolynomial`: band Limited Polynomial. -/ -def bandLimitedPolynomial (N L : ℕ) (c : Fin L → ℂ) : Circle → ℂ := +@[expose] def bandLimitedPolynomial (N L : ℕ) (c : Fin L → ℂ) : Circle → ℂ := fun t => ∑ m : Fin L, c m * fourier ((N + m.1 : ℕ) : ℤ) t /-- `HasPositiveFrequencySupport`: Has Positive Frequency Support. -/ -def HasPositiveFrequencySupport (P : Circle → ℂ) (E : Finset ℕ) : Prop := +@[expose] def HasPositiveFrequencySupport (P : Circle → ℂ) (E : Finset ℕ) : Prop := ∃ b : ℕ → ℂ, P = positiveFrequencyPolynomial E b /-- `HasBandlimitedSupport`: Has Bandlimited Support. -/ -def HasBandlimitedSupport (P : Circle → ℂ) (N L : ℕ) : Prop := +@[expose] def HasBandlimitedSupport (P : Circle → ℂ) (N L : ℕ) : Prop := ∃ c : Fin L → ℂ, P = bandLimitedPolynomial N L c end Hermite1DimdLEAN diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean index 6bfb8630d3..c219ca3611 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # DegreeBookkeeping -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean index e1943cbeb9..795873e9dc 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # ImportedAnalyticInputs -/ -@[expose] public section +public section @@ -29,7 +29,7 @@ noncomputable section namespace Hermite1DimdLEAN /-- `oneDimLift`: one Dim Lift. -/ -def oneDimLift (f : ℂ → ℂ) : CSpace 1 → ℂ := fun z => f (z 0) +@[expose] def oneDimLift (f : ℂ → ℂ) : CSpace 1 → ℂ := fun z => f (z 0) private lemma measurable_ofReal_gaussianDensity (d : ℕ) : Measurable (fun z : CSpace d => ENNReal.ofReal (gaussianDensity d z)) := by diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean index 3a30f2200d..26015947c0 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # ProductAnnulusCircle -/ -@[expose] public section +public section diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean index 1b035ebe6e..85b13dcc45 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # ProductBasisAndAnnuli -/ -@[expose] public section +public section diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean index 6f142908f2..d5f08e6dc1 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # BasisLocalization -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean index dcc9dccd2b..8a0c78e49e 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # ImportedAnalyticInputs -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean index aafd7f7fbe..e671977f1b 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean @@ -19,7 +19,7 @@ import Mathlib.Combinatorics.Matroid.Init /-! # ModulusRigidity -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean index 49aa5d5837..d54655a90b 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean @@ -23,7 +23,7 @@ import Mathlib.MeasureTheory.Integral.Gamma /-! # TrueLevelBasis -/ -@[expose] public section +public section open Complex MeasureTheory Real Finset @@ -92,7 +92,7 @@ finite `z`/`conj z` expansion used downstream. The raising/lowering-operator derivation is only bookkeeping motivation; the public API stays explicit and finitary. -/ -noncomputable def Phi : ℕ → ℕ → ℂ → ℂ := fun k n z => +@[expose] noncomputable def Phi : ℕ → ℕ → ℂ → ℂ := fun k n z => ((1 / Real.sqrt ((Nat.factorial k : ℝ) * (Nat.factorial n : ℝ))) : ℂ) * Finset.sum (Finset.range (min k n + 1)) (fun j => ((-1 : ℂ) ^ j) * (Nat.choose k j : ℂ) * @@ -100,7 +100,7 @@ noncomputable def Phi : ℕ → ℕ → ℂ → ℂ := fun k n z => z ^ (n - j) * (star z) ^ (k - j)) /-- The distinguished lowest vector in level `k`. -/ -def phi0 (k : ℕ) : ℂ → ℂ := Phi k 0 +@[expose] def phi0 (k : ℕ) : ℂ → ℂ := Phi k 0 /-- The closed span of the true Hermite level-`k` basis. @@ -113,11 +113,11 @@ def Hk (k : ℕ) : Set (ℂ → ℂ) := ∀ z, HasSum (fun n => weightedInner G (Phi k n) * Phi k n z) (G z)} /-- A finite Hermite sum `sum_{n < D} a_n Phi_{k,n}`. -/ -def finiteHermiteSum (k : ℕ) {D : ℕ} (a : Fin D → ℂ) : ℂ → ℂ := +@[expose] def finiteHermiteSum (k : ℕ) {D : ℕ} (a : Fin D → ℂ) : ℂ → ℂ := fun z => ∑ n : Fin D, a n * Phi k n.1 z /-- The top coefficient of a degree-`d` finite Hermite sum. -/ -def topCoeff {d : ℕ} (a : Fin (d + 1) → ℂ) : ℂ := +@[expose] def topCoeff {d : ℕ} (a : Fin (d + 1) → ℂ) : ℂ := a ⟨d, Nat.lt_succ_self d⟩ /-- The canonical coefficient extractor for the true level basis. -/ @@ -137,15 +137,15 @@ noncomputable def qkn : ℕ → ℕ → ℝ → ℝ := fun k n r => r ^ ((n : ℤ) - 2 * (j : ℤ))) /-- The scalar front factor in the polar representation. -/ -def circleLeadingFactor (k : ℕ) (r : ℝ) : ℂ := +@[expose] def circleLeadingFactor (k : ℕ) (r : ℝ) : ℂ := ((((r ^ k) / Real.sqrt ((Nat.factorial k : ℕ) : ℝ)) : ℝ) : ℂ) /-- The finitely supported circle coefficient map attached to finite Hermite data. -/ -def finiteCircleCoeff (k : ℕ) (r : ℝ) {D : ℕ} (a : Fin D → ℂ) : ℕ → ℂ := +@[expose] def finiteCircleCoeff (k : ℕ) (r : ℝ) {D : ℕ} (a : Fin D → ℂ) : ℕ → ℂ := fun n => if h : n < D then a ⟨n, h⟩ * (qkn k n r : ℂ) else 0 /-- The finite Fourier polynomial on the circle attached to a finite Hermite sum. -/ -def finiteCirclePoly (k : ℕ) (r : ℝ) {D : ℕ} (a : Fin D → ℂ) : Circle → ℂ := +@[expose] def finiteCirclePoly (k : ℕ) (r : ℝ) {D : ℕ} (a : Fin D → ℂ) : Circle → ℂ := positiveTrigonometricPolynomial (frequencyBand 0 D) (finiteCircleCoeff k r a) /-- The finite circle polynomial built from the truncated coefficient vector of `G`. -/ @@ -2336,7 +2336,7 @@ private lemma phi_norm_le_majorant {k n : ℕ} {R : ℝ} (hR : 1 ≤ R) {z : ℂ /-! ## Basis Bridge -/ /-- The formal Hermite expansion attached to a coefficient sequence. -/ -def hermiteSeries (k : ℕ) (g : ℕ → ℂ) : ℂ → ℂ := +@[expose] def hermiteSeries (k : ℕ) (g : ℕ → ℂ) : ℂ → ℂ := fun z => ∑' n : ℕ, g n * Phi k n z /-- The circle series associated to Hermite coefficients at radius `r`. -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean index 427916a5dd..fdeabd2fef 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean @@ -22,7 +22,7 @@ import Mathlib.MeasureTheory.Measure.RegularityCompacts /-! # ImportedAnalyticInputs -/ -@[expose] public section +public section noncomputable section @@ -43,7 +43,7 @@ allowed to cite through a stable local API. abbrev Circle := AddCircle (2 * Real.pi) /-- `μCircle`: the normalized Haar measure on the circle `AddCircle (2π)`. -/ -noncomputable def μCircle : MeasureTheory.Measure Circle := +@[expose] noncomputable def μCircle : MeasureTheory.Measure Circle := AddCircle.haarAddCircle /-- `muCircle`: mu Circle. -/ @@ -55,21 +55,21 @@ def Cavg : ℝ := 1 theorem Cavg_pos : 0 < Cavg := by norm_num [Cavg] /-- `Crot`: Crot. -/ -def Crot : ℝ := 64 * Real.pi +@[expose] def Crot : ℝ := 64 * Real.pi theorem Crot_pos : 0 < Crot := by unfold Crot nlinarith [Real.pi_pos] /-- `zeta`: zeta. -/ -noncomputable def zeta (x : Circle) : ℂ := +@[expose] noncomputable def zeta (x : Circle) : ℂ := AddCircle.toCircle x theorem norm_zeta (x : Circle) : ‖zeta x‖ = 1 := by simp [zeta, Circle.norm_coe] /-- `circleChar`: circle Char. -/ -noncomputable def circleChar (n : Nat) : Circle -> ℂ := +@[expose] noncomputable def circleChar (n : Nat) : Circle -> ℂ := fun x => zeta x ^ n theorem circleChar_eq_zeta_pow (n : Nat) (x : Circle) : @@ -85,18 +85,18 @@ structure CircleArc where width_le_period : right - left ≤ 2 * Real.pi /-- `arcLength`: arc Length. -/ -def arcLength (I : CircleArc) : ℝ := I.right - I.left +@[expose] def arcLength (I : CircleArc) : ℝ := I.right - I.left /-- `arcParam`: arc Param. -/ -def arcParam (I : CircleArc) (t : ℝ) : Circle := +@[expose] def arcParam (I : CircleArc) (t : ℝ) : Circle := QuotientAddGroup.mk (I.left + t * arcLength I) /-- `arcSet`: arc Set. -/ -def arcSet (I : CircleArc) : Set Circle := +@[expose] def arcSet (I : CircleArc) : Set Circle := {x | ∃ t ∈ Set.Icc (0 : ℝ) 1, arcParam I t = x} /-- `carrierArc`: carrier Arc. -/ -noncomputable def carrierArc (N : Nat) (k : Fin N) : CircleArc where +@[expose] noncomputable def carrierArc (N : Nat) (k : Fin N) : CircleArc where left := (2 * Real.pi) * (k.1 : ℝ) / (N : ℝ) right := (2 * Real.pi) * ((k.1 + 1 : Nat) : ℝ) / (N : ℝ) left_le_right := by @@ -305,7 +305,7 @@ theorem carrierArc_arcSet_ae_eq_mk_image_Ioc_volume {N : Nat} (k : Fin N) : carrierArc_arcSet_ae_eq_mk_image_Ioc_of_singleton_null k _ volume_singleton_circle /-- `carrierAverage`: carrier Average. -/ -noncomputable def carrierAverage {N : Nat} (k : Fin N) +@[expose] noncomputable def carrierAverage {N : Nat} (k : Fin N) (f : Circle -> ℂ) : ℂ := (N : ℂ) * ∫ x in arcSet (carrierArc N k), f x ∂ μCircle @@ -382,7 +382,7 @@ theorem period_smul_μCircle_carrierArc {N : Nat} (k : Fin N) : exact period_smul_μCircle_mk_image_carrierArc_Ioc k /-- `arcIntegral`: arc Integral. -/ -noncomputable def arcIntegral (I : CircleArc) (f : Circle -> ℝ) : ℝ := +@[expose] noncomputable def arcIntegral (I : CircleArc) (f : Circle -> ℝ) : ℝ := ∫ x in arcSet I, f x ∂ μCircle theorem carrierArc_arcIntegral_eq_mk_image_Ioc @@ -469,7 +469,7 @@ theorem carrierArc_mk_image_Ioc_integral_eq_scaled f (QuotientAddGroup.mk t : Circle) := by rfl /-- `arcAverage`: arc Average. -/ -noncomputable def arcAverage (I : CircleArc) (f : Circle -> ℂ) : ℂ := +@[expose] noncomputable def arcAverage (I : CircleArc) (f : Circle -> ℂ) : ℂ := (arcLength I)⁻¹ • ∫ x in arcSet I, f x ∂ μCircle theorem intervalParam_mem_arc (I : CircleArc) : @@ -885,7 +885,7 @@ abbrev L2Real (d : Nat) := MeasureTheory.Lp ℂ 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) /-- `stftRep`: stft Rep. -/ -noncomputable def stftRep {d : Nat} : +@[expose] noncomputable def stftRep {d : Nat} : L2Real d -> L2Real d -> PhaseSpace d -> ℂ := fun h f ξ => ∫ t : RealVec d, @@ -894,7 +894,7 @@ noncomputable def stftRep {d : Nat} : Complex.exp (-(2 * Real.pi : ℂ) * Complex.I * ((inner ℝ ξ.2 t : ℝ) : ℂ)) /-- `ambiguityRep`: ambiguity Rep. -/ -noncomputable def ambiguityRep {d : Nat} : +@[expose] noncomputable def ambiguityRep {d : Nat} : L2Real d -> L2Real d -> PhaseSpace d -> ℂ := fun f g ξ => ∫ t : RealVec d, @@ -1222,7 +1222,7 @@ private theorem schwartzApproxRealVec_toLp_tendsto {d : Nat} (f : L2Real d) : simpa [hdist, hf, μ] using hraw /-- `IsL2Rep`: Is L2 Rep. -/ -def IsL2Rep {d : Nat} (f : L2Real d) (fRep : RealVec d -> ℂ) : Prop := +@[expose] def IsL2Rep {d : Nat} (f : L2Real d) (fRep : RealVec d -> ℂ) : Prop := ∃ hf_mem : MeasureTheory.MemLp fRep 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)), hf_mem.toLp fRep = f diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean index dc562c923f..ed34d2bc7c 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # OrthogonalCoercivity -/ -@[expose] public section +public section open MeasureTheory Complex @@ -48,10 +48,10 @@ local notation "Pk" => Pkappa d kappa def coeffPk (H : Pk) (alpha : Idx d) : ℂ := coeffPkappa H alpha /-- `OrthogonalToPk`: Orthogonal To Pk. -/ -def OrthogonalToPk (F G : Pk) : Prop := orthogonalToPk F G +@[expose] def OrthogonalToPk (F G : Pk) : Prop := orthogonalToPk F G /-- `defectPk`: defect Pk. -/ -def defectPk (F G : Pk) : ℝ := defect F G +@[expose] def defectPk (F G : Pk) : ℝ := defect F G /-- `lowAnnulusMassPk`: low Annulus Mass Pk. -/ def lowAnnulusMassPk (J : Nat) (H : Pk) : ℝ := lowAnnulusMass J (ofPkappa kappa H) diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean index d69abe230e..6a6088b18b 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # OrthogonalReduction -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean index 4db466c599..b74ffffa05 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # PhaseStability -/ -@[expose] public section +public section open MeasureTheory @@ -38,12 +38,12 @@ arrays. -/ /-- The Gaussian `L²` modulus defect between two finite Hermite-Fock polynomials. -/ -def modulusDefect {d : Nat} (kappa : MultiIndex d) +@[expose] def modulusDefect {d : Nat} (kappa : MultiIndex d) (F Q : Pkappa d kappa) : ℝ := Real.sqrt <| ∫ z, (‖evalPkappa kappa Q z‖ - ‖evalPkappa kappa F z‖) ^ 2 ∂ gammaD d /-- The coefficient distance after applying a chosen global phase to `Q`. -/ -def phasedCoeffDistance {d : Nat} {kappa : MultiIndex d} (F Q : Pkappa d kappa) +@[expose] def phasedCoeffDistance {d : Nat} {kappa : MultiIndex d} (F Q : Pkappa d kappa) (phase : ℂ) : ℝ := ‖phase • Q - F‖ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean index 7d6cd6d93f..a079e4fe1e 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # ProductAnnulusLocalization -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean index b55ebf8015..145b1e6327 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Parity /-! # TensorBasis -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/PoincareThreeBody.lean b/LeanPool/PoincareThreeBody.lean index fec5d2a995..f7bd3d691d 100644 --- a/LeanPool/PoincareThreeBody.lean +++ b/LeanPool/PoincareThreeBody.lean @@ -64,7 +64,7 @@ Tags: dynamical-systems, celestial-mechanics, hamiltonian-systems, nonintegrabil MSC: 70F07, 37J30, 37J40 -/ -@[expose] public section +public section /-! # Poincaré's theorem for the planar restricted three-body problem diff --git a/LeanPool/PoincareThreeBody/ActionFactorization.lean b/LeanPool/PoincareThreeBody/ActionFactorization.lean index 803ac36b54..46fc1ff5fb 100644 --- a/LeanPool/PoincareThreeBody/ActionFactorization.lean +++ b/LeanPool/PoincareThreeBody/ActionFactorization.lean @@ -18,7 +18,7 @@ that value-level statement to a differential identity: at every noncircular elli phase differential is the pullback of the differential of the action-space representative. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/ActionPoisson.lean b/LeanPool/PoincareThreeBody/ActionPoisson.lean index 6d92ff359c..f3435dbb34 100644 --- a/LeanPool/PoincareThreeBody/ActionPoisson.lean +++ b/LeanPool/PoincareThreeBody/ActionPoisson.lean @@ -17,13 +17,13 @@ This file rewrites the physical Poisson bracket with the zero-mass Hamiltonian a the Kepler frequency with the two Poisson brackets against the Cartesian actions `(L,G)`. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Canonical symplectic pairing of two phase covectors. -/ -def phasePoissonPairing +@[expose] def phasePoissonPairing (first second : PhaseSpace →L[ℝ] ℝ) : ℝ := first (coordinateVector 0) * second (coordinateVector 2) - first (coordinateVector 2) * second (coordinateVector 0) + @@ -31,7 +31,7 @@ def phasePoissonPairing first (coordinateVector 3) * second (coordinateVector 1)) /-- The canonical Hamiltonian vector associated with a phase covector. -/ -def phaseHamiltonianVector (covector : PhaseSpace →L[ℝ] ℝ) : PhaseSpace := +@[expose] def phaseHamiltonianVector (covector : PhaseSpace →L[ℝ] ℝ) : PhaseSpace := ![covector (coordinateVector 2), covector (coordinateVector 3), -covector (coordinateVector 0), -covector (coordinateVector 1)] @@ -98,7 +98,7 @@ lemma phasePoissonPairing_self (covector : PhaseSpace →L[ℝ] ℝ) : ring /-- A coordinate row of a phase-to-action linear map. -/ -def actionDerivativeCovector +@[expose] def actionDerivativeCovector (actionDerivative : PhaseSpace →L[ℝ] ActionSpace) (coordinate : Fin 2) : PhaseSpace →L[ℝ] ℝ := (ContinuousLinearMap.proj coordinate).comp actionDerivative @@ -111,7 +111,7 @@ lemma actionDerivativeCovector_apply rfl /-- The two Hamiltonian tangent vectors associated with the rows of an action derivative. -/ -def actionHamiltonianTangentMap +@[expose] def actionHamiltonianTangentMap (actionDerivative : PhaseSpace →L[ℝ] ActionSpace) : ActionSpace →ₗ[ℝ] PhaseSpace where toFun vector := vector 0 • phaseHamiltonianVector (actionDerivativeCovector actionDerivative 0) + @@ -302,13 +302,13 @@ lemma poissonBracket_eq_phasePoissonPairing rfl /-- The two Poisson brackets of an observable with the reconstructed actions. -/ -noncomputable def actionPoissonVector +@[expose] noncomputable def actionPoissonVector (f : PhaseSpace → ℝ) (state : PhaseSpace) : ActionSpace := ![poissonBracket f cartesianFirstAction state, poissonBracket f cartesianAngularAction state] /-- Hamiltonian vector field of the angular action. -/ -def angularActionVectorField (state : PhaseSpace) : PhaseSpace := +@[expose] def angularActionVectorField (state : PhaseSpace) : PhaseSpace := ![-state 1, state 0, -state 3, state 2] /-- Varying the negated rotation angle generates the angular-action Hamiltonian flow. -/ diff --git a/LeanPool/PoincareThreeBody/AlignedAverageBlowup.lean b/LeanPool/PoincareThreeBody/AlignedAverageBlowup.lean index 452267a19b..f666461971 100644 --- a/LeanPool/PoincareThreeBody/AlignedAverageBlowup.lean +++ b/LeanPool/PoincareThreeBody/AlignedAverageBlowup.lean @@ -17,7 +17,7 @@ Combining the logarithmic singular estimate with the uniform regular bound gives upper bound on the aligned disturbing average. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/Analytic.lean b/LeanPool/PoincareThreeBody/Analytic.lean index adf31689a8..c1397420ba 100644 --- a/LeanPool/PoincareThreeBody/Analytic.lean +++ b/LeanPool/PoincareThreeBody/Analytic.lean @@ -18,7 +18,7 @@ analyticity of arbitrary real powers on the positive half-line. We establish tha it to the inverse square roots in the restricted three-body potential. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/AnalyticCompactParameterIntegral.lean b/LeanPool/PoincareThreeBody/AnalyticCompactParameterIntegral.lean index 32acddcb79..edb4b821d0 100644 --- a/LeanPool/PoincareThreeBody/AnalyticCompactParameterIntegral.lean +++ b/LeanPool/PoincareThreeBody/AnalyticCompactParameterIntegral.lean @@ -21,7 +21,7 @@ inclusion-exclusion for the finite cover, so no explicit partition or ordering o needed. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/AnalyticDensity.lean b/LeanPool/PoincareThreeBody/AnalyticDensity.lean index 7321aa2597..57b69e77a8 100644 --- a/LeanPool/PoincareThreeBody/AnalyticDensity.lean +++ b/LeanPool/PoincareThreeBody/AnalyticDensity.lean @@ -16,7 +16,7 @@ calculation. A real-analytic function on a connected open set that is nonzero a nonzero on a dense subset of that set. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/AnalyticMinors.lean b/LeanPool/PoincareThreeBody/AnalyticMinors.lean index 983d82265b..f8ed79bb9e 100644 --- a/LeanPool/PoincareThreeBody/AnalyticMinors.lean +++ b/LeanPool/PoincareThreeBody/AnalyticMinors.lean @@ -25,14 +25,14 @@ analytic mass germs, infinite-order vanishing makes them locally zero, and the i propagates that equality along any connected collision-free mass fiber. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- A coordinate minor of the Hamiltonian and candidate phase differentials at fixed mass and phase. -/ -noncomputable def massDifferentialMinor +@[expose] noncomputable def massDifferentialMinor (F : ℝ → PhaseSpace → ℝ) (i j : Fin 4) (mass : ℝ) (state : PhaseSpace) : ℝ := phaseCovectorMinor (fderiv ℝ (hamiltonian mass) state) diff --git a/LeanPool/PoincareThreeBody/AnalyticNormalization.lean b/LeanPool/PoincareThreeBody/AnalyticNormalization.lean index ffaa988b27..4a913c34c1 100644 --- a/LeanPool/PoincareThreeBody/AnalyticNormalization.lean +++ b/LeanPool/PoincareThreeBody/AnalyticNormalization.lean @@ -23,7 +23,7 @@ mass zero. This file establishes the analytic one-variable division theorem and each phase-space slice of the normalized residual. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -44,7 +44,7 @@ theorem sub_mul_dslope_eq_of_eq_zero simpa only [smul_eq_mul] using sub_smul_dslope_of_zero hzero argument /-- The residual obtained after subtracting a one-variable function of the Hamiltonian. -/ -noncomputable def normalizationResidual +@[expose] noncomputable def normalizationResidual (F : ℝ → PhaseSpace → ℝ) (energyFunction : ℝ → ℝ) (mass : ℝ) (state : PhaseSpace) : ℝ := F mass state - energyFunction (hamiltonian mass state) diff --git a/LeanPool/PoincareThreeBody/AnalyticParameterIntegral.lean b/LeanPool/PoincareThreeBody/AnalyticParameterIntegral.lean index 005bfc4d08..083ea3023f 100644 --- a/LeanPool/PoincareThreeBody/AnalyticParameterIntegral.lean +++ b/LeanPool/PoincareThreeBody/AnalyticParameterIntegral.lean @@ -18,7 +18,7 @@ compactness argument used later supplies a common radius and the summable integr coefficients. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/Averaging.lean b/LeanPool/PoincareThreeBody/Averaging.lean index 826545c34f..b364337d36 100644 --- a/LeanPool/PoincareThreeBody/Averaging.lean +++ b/LeanPool/PoincareThreeBody/Averaging.lean @@ -18,7 +18,7 @@ Integrating its derivative over one period removes that term. A nonzero averaged forces the leading differential of the integral to annihilate the resonance vector. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/CertifiedPoincareSet.lean b/LeanPool/PoincareThreeBody/CertifiedPoincareSet.lean index 61c883a00f..c4ae7b7ffb 100644 --- a/LeanPool/PoincareThreeBody/CertifiedPoincareSet.lean +++ b/LeanPool/PoincareThreeBody/CertifiedPoincareSet.lean @@ -18,7 +18,7 @@ finite data into membership in the exact Poincaré set. Consequently, it is eno the set of actions carrying such certificates is dense. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -81,7 +81,7 @@ theorem ClassicalPoincareCertificate.mem_classicalPoincareSet /-- The subset of interior actions whose Poincaré-set membership has been reduced to finite validated numerical data. -/ -def certifiedClassicalPoincareSet : Set InteriorProgradeEllipticAction := +@[expose] def certifiedClassicalPoincareSet : Set InteriorProgradeEllipticAction := {action | Nonempty (ClassicalPoincareCertificate action)} theorem certifiedClassicalPoincareSet_subset_classicalPoincareSet : diff --git a/LeanPool/PoincareThreeBody/CoefficientNormalization.lean b/LeanPool/PoincareThreeBody/CoefficientNormalization.lean index acba1a6e14..c09fb89c71 100644 --- a/LeanPool/PoincareThreeBody/CoefficientNormalization.lean +++ b/LeanPool/PoincareThreeBody/CoefficientNormalization.lean @@ -20,7 +20,7 @@ ellipse and instantiates the removable mass quotient. It is the complete local iteration of Poincaré's subtract-and-divide argument. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/CollisionBandAnalyticContinuation.lean b/LeanPool/PoincareThreeBody/CollisionBandAnalyticContinuation.lean index 751a45b7e3..52d0b00622 100644 --- a/LeanPool/PoincareThreeBody/CollisionBandAnalyticContinuation.lean +++ b/LeanPool/PoincareThreeBody/CollisionBandAnalyticContinuation.lean @@ -19,7 +19,7 @@ the nonempty collision band therefore extends to the entire connected interior f interval. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/CollisionBandObstruction.lean b/LeanPool/PoincareThreeBody/CollisionBandObstruction.lean index 58c7338e62..0da4654f0d 100644 --- a/LeanPool/PoincareThreeBody/CollisionBandObstruction.lean +++ b/LeanPool/PoincareThreeBody/CollisionBandObstruction.lean @@ -19,7 +19,7 @@ Fiberwise density in eccentricity propagates each collision-band resonant obstru nondegenerate eccentricities to every admissible eccentricity at that resonance. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/CollisionIntegralBlowup.lean b/LeanPool/PoincareThreeBody/CollisionIntegralBlowup.lean index b9ef4c34cb..34dc61816f 100644 --- a/LeanPool/PoincareThreeBody/CollisionIntegralBlowup.lean +++ b/LeanPool/PoincareThreeBody/CollisionIntegralBlowup.lean @@ -16,14 +16,14 @@ This file develops the real-variable estimate showing that the averaged Newtonia becomes unbounded when an aligned apoapsis approaches the unit primary. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody open Filter MeasureTheory Set Topology /-- Reciprocal distance from the resonant position to the unit primary. -/ -noncomputable def resonantPrimaryInverse +@[expose] noncomputable def resonantPrimaryInverse (p q : ℕ) (eccentricity orientation time : ℝ) : ℝ := let position := orientedResonantEllipsePosition p q eccentricity orientation time 1 / Real.sqrt ((position 0 - 1) ^ 2 + position 1 ^ 2) diff --git a/LeanPool/PoincareThreeBody/Core.lean b/LeanPool/PoincareThreeBody/Core.lean index f0de13fcaa..12ecbc211b 100644 --- a/LeanPool/PoincareThreeBody/Core.lean +++ b/LeanPool/PoincareThreeBody/Core.lean @@ -18,7 +18,7 @@ establishes their elementary structural properties. It deliberately does not imp module: the solution and challenge environments must remain separately exportable for comparator. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -28,36 +28,36 @@ open Set abbrev PhaseSpace := Fin 4 → ℝ /-- Squared distance from the primary of mass `μ` at `(1 - μ, 0)`. -/ -def firstPrimaryDistanceSq (μ : ℝ) (s : PhaseSpace) : ℝ := +@[expose] def firstPrimaryDistanceSq (μ : ℝ) (s : PhaseSpace) : ℝ := (s 0 - 1 + μ) ^ 2 + (s 1) ^ 2 /-- Squared distance from the primary of mass `1 - μ` at `(-μ, 0)`. -/ -def secondPrimaryDistanceSq (μ : ℝ) (s : PhaseSpace) : ℝ := +@[expose] def secondPrimaryDistanceSq (μ : ℝ) (s : PhaseSpace) : ℝ := (s 0 + μ) ^ 2 + (s 1) ^ 2 /-- The collision-free joint mass-parameter/phase-space domain. -/ -def collisionFree : Set (ℝ × PhaseSpace) := +@[expose] def collisionFree : Set (ℝ × PhaseSpace) := {z | firstPrimaryDistanceSq z.1 z.2 ≠ 0 ∧ secondPrimaryDistanceSq z.1 z.2 ≠ 0} /-- The collision-free domain with the mass parameter restricted to `|μ| < δ`. -/ -def parameterDomain (δ : ℝ) : Set (ℝ × PhaseSpace) := +@[expose] def parameterDomain (δ : ℝ) : Set (ℝ × PhaseSpace) := {z | |z.1| < δ ∧ z ∈ collisionFree} /-- The Newtonian potential in the rotating frame. -/ -noncomputable def potential (μ : ℝ) (s : PhaseSpace) : ℝ := +@[expose] noncomputable def potential (μ : ℝ) (s : PhaseSpace) : ℝ := μ / Real.sqrt (firstPrimaryDistanceSq μ s) + (1 - μ) / Real.sqrt (secondPrimaryDistanceSq μ s) /-- The planar circular restricted three-body Hamiltonian in rotating canonical coordinates. -/ -noncomputable def hamiltonian (μ : ℝ) (s : PhaseSpace) : ℝ := +@[expose] noncomputable def hamiltonian (μ : ℝ) (s : PhaseSpace) : ℝ := ((s 2) ^ 2 + (s 3) ^ 2) / 2 + s 2 * s 1 - s 3 * s 0 - potential μ s /-- The coordinate basis vector in the concrete phase space. -/ -def coordinateVector (i : Fin 4) : PhaseSpace := +@[expose] def coordinateVector (i : Fin 4) : PhaseSpace := fun j ↦ if j = i then 1 else 0 /-- The canonical Poisson bracket in coordinates `(x, y, pₓ, pᵧ)`. -/ -noncomputable def poissonBracket (F G : PhaseSpace → ℝ) (s : PhaseSpace) : ℝ := +@[expose] noncomputable def poissonBracket (F G : PhaseSpace → ℝ) (s : PhaseSpace) : ℝ := let dF := fderiv ℝ F s let dG := fderiv ℝ G s dF (coordinateVector 0) * dG (coordinateVector 2) - @@ -66,15 +66,16 @@ noncomputable def poissonBracket (F G : PhaseSpace → ℝ) (s : PhaseSpace) : dF (coordinateVector 3) * dG (coordinateVector 1)) /-- Joint real analyticity in the mass parameter and phase variables. -/ -def IsJointlyAnalytic (δ : ℝ) (F : ℝ → PhaseSpace → ℝ) : Prop := +@[expose] def IsJointlyAnalytic (δ : ℝ) (F : ℝ → PhaseSpace → ℝ) : Prop := AnalyticOnNhd ℝ (Function.uncurry F) (parameterDomain δ) /-- A first-integral family Poisson-commutes with the Hamiltonian throughout the domain. -/ -noncomputable def IsFirstIntegralFamily (δ : ℝ) (F : ℝ → PhaseSpace → ℝ) : Prop := +@[expose] noncomputable def IsFirstIntegralFamily (δ : ℝ) + (F : ℝ → PhaseSpace → ℝ) : Prop := ∀ z ∈ parameterDomain δ, poissonBracket (F z.1) (hamiltonian z.1) z.2 = 0 /-- Functional independence of the phase differentials at some point. -/ -noncomputable def IsIndependentSomewhere (δ : ℝ) (F : ℝ → PhaseSpace → ℝ) : Prop := +@[expose] noncomputable def IsIndependentSomewhere (δ : ℝ) (F : ℝ → PhaseSpace → ℝ) : Prop := ∃ z ∈ parameterDomain δ, LinearIndependent ℝ ![fderiv ℝ (hamiltonian z.1) z.2, fderiv ℝ (F z.1) z.2] diff --git a/LeanPool/PoincareThreeBody/Delaunay.lean b/LeanPool/PoincareThreeBody/Delaunay.lean index 407d3bd888..41597981ab 100644 --- a/LeanPool/PoincareThreeBody/Delaunay.lean +++ b/LeanPool/PoincareThreeBody/Delaunay.lean @@ -23,16 +23,16 @@ At zero mass the planar rotating Kepler Hamiltonian in Delaunay actions is explicit family of resonant actions. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- The rotating Kepler Hamiltonian in planar Delaunay actions. -/ -noncomputable def delaunayHamiltonian (action : ActionSpace) : ℝ := +@[expose] noncomputable def delaunayHamiltonian (action : ActionSpace) : ℝ := -1 / (2 * (action 0) ^ 2) - action 1 /-- The frequency of the rotating Kepler Hamiltonian. -/ -noncomputable def delaunayFrequency (firstAction : ℝ) : ActionSpace := +@[expose] noncomputable def delaunayFrequency (firstAction : ℝ) : ActionSpace := ![1 / firstAction ^ 3, -1] /-- A positive Delaunay action whose Kepler frequency ratio is the positive rational `q / p`. -/ @@ -40,7 +40,7 @@ noncomputable def resonantFirstAction (p q : ℕ) : ℝ := ((p : ℝ) / (q : ℝ)) ^ ((3 : ℝ)⁻¹) /-- The integer resonance vector, regarded as a real vector. -/ -def resonanceVector (p q : ℕ) : ActionSpace := +@[expose] def resonanceVector (p q : ℕ) : ActionSpace := ![(p : ℝ), (q : ℝ)] theorem hasDerivAt_delaunayHamiltonian_firstAction {firstAction : ℝ} @@ -149,7 +149,7 @@ theorem exists_resonantFirstAction_between {a b : ℝ} (ha : 0 < a) (hab : a < b abbrev PositiveAction := Set.Ioi (0 : ℝ) /-- The positive actions whose Kepler frequency is irrational. -/ -def irrationalFrequencyPositiveActions : Set PositiveAction := +@[expose] def irrationalFrequencyPositiveActions : Set PositiveAction := {action | Irrational (1 / action.1 ^ 3)} /-- Actions with irrational Kepler frequency occur in every positive open interval. -/ @@ -200,7 +200,7 @@ theorem irrationalFrequencyPositiveActions_dense : exact ⟨positiveAction, hirrational, ha, hb⟩ /-- The positive actions with a rational Kepler frequency ratio. -/ -def resonantPositiveActions : Set PositiveAction := +@[expose] def resonantPositiveActions : Set PositiveAction := {x | ∃ p q : ℕ, 0 < p ∧ 0 < q ∧ x.1 = resonantFirstAction p q} theorem resonantPositiveActions_dense : Dense resonantPositiveActions := by diff --git a/LeanPool/PoincareThreeBody/DelaunayActions.lean b/LeanPool/PoincareThreeBody/DelaunayActions.lean index 7880855e07..1c55b3c9e7 100644 --- a/LeanPool/PoincareThreeBody/DelaunayActions.lean +++ b/LeanPool/PoincareThreeBody/DelaunayActions.lean @@ -20,13 +20,13 @@ energy. Consequently the physical mass-zero Hamiltonian pulls back to the displ Hamiltonian. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- A frequency vector regarded as the corresponding Euclidean action covector. -/ -noncomputable def actionCovector (vector : ActionSpace) : ActionSpace →L[ℝ] ℝ := +@[expose] noncomputable def actionCovector (vector : ActionSpace) : ActionSpace →L[ℝ] ℝ := ((ContinuousLinearMap.proj 0 : ActionSpace →L[ℝ] ℝ).smulRight (vector 0)) + ((ContinuousLinearMap.proj 1 : ActionSpace →L[ℝ] ℝ).smulRight (vector 1)) @@ -36,24 +36,24 @@ lemma actionCovector_apply (vector direction : ActionSpace) : simp [actionCovector, mul_comm] /-- Coordinate tangent vectors in the two-dimensional action space. -/ -def actionCoordinateVector (coordinate : Fin 2) : ActionSpace := +@[expose] def actionCoordinateVector (coordinate : Fin 2) : ActionSpace := fun index ↦ if index = coordinate then 1 else 0 /-- Inertial Kepler energy written in rotating Cartesian canonical variables. -/ -noncomputable def cartesianKeplerEnergy (state : PhaseSpace) : ℝ := +@[expose] noncomputable def cartesianKeplerEnergy (state : PhaseSpace) : ℝ := ((state 2) ^ 2 + (state 3) ^ 2) / 2 - 1 / Real.sqrt ((state 0) ^ 2 + (state 1) ^ 2) /-- The first Delaunay action reconstructed from negative inertial Kepler energy. -/ -noncomputable def cartesianFirstAction (state : PhaseSpace) : ℝ := +@[expose] noncomputable def cartesianFirstAction (state : PhaseSpace) : ℝ := 1 / Real.sqrt (-2 * cartesianKeplerEnergy state) /-- The planar angular action `G = x pᵧ - y pₓ`. -/ -def cartesianAngularAction (state : PhaseSpace) : ℝ := +@[expose] def cartesianAngularAction (state : PhaseSpace) : ℝ := state 0 * state 3 - state 1 * state 2 /-- Both Cartesian Delaunay actions, ordered as `(L, G)`. -/ -noncomputable def cartesianDelaunayActions (state : PhaseSpace) : ActionSpace := +@[expose] noncomputable def cartesianDelaunayActions (state : PhaseSpace) : ActionSpace := ![cartesianFirstAction state, cartesianAngularAction state] /-- The inertial Kepler energy is analytic away from the central collision. -/ diff --git a/LeanPool/PoincareThreeBody/DelaunayAnchorChart.lean b/LeanPool/PoincareThreeBody/DelaunayAnchorChart.lean index 8fb26f1806..75a05d9349 100644 --- a/LeanPool/PoincareThreeBody/DelaunayAnchorChart.lean +++ b/LeanPool/PoincareThreeBody/DelaunayAnchorChart.lean @@ -24,7 +24,7 @@ four-dimensional chart. Its derivative at the rational anchor is nonsingular, s contains a phase-space neighborhood of the anchor. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -33,15 +33,15 @@ namespace LeanPool.PoincareThreeBody abbrev DelaunayAnchorParameters := ActionSpace × (ℝ × ℝ) /-- The action pair at the rational energy `-2` anchor. -/ -noncomputable def delaunayAnchorAction : ActionSpace := +@[expose] noncomputable def delaunayAnchorAction : ActionSpace := ![1 / Real.sqrt 3, (1 / 2 : ℝ)] /-- Parameters corresponding to the rational phase point `(0, 1/6, -3, 0)`. -/ -noncomputable def delaunayAnchorParameters : DelaunayAnchorParameters := +@[expose] noncomputable def delaunayAnchorParameters : DelaunayAnchorParameters := (delaunayAnchorAction, 0, Real.pi / 2) /-- Full local Delaunay chart using eccentric anomaly as its first angle. -/ -noncomputable def delaunayAnchorChart +@[expose] noncomputable def delaunayAnchorChart (parameters : DelaunayAnchorParameters) : PhaseSpace := delaunayActionSectionAtAnomaly parameters.2.1 parameters.2.2 parameters.1 diff --git a/LeanPool/PoincareThreeBody/DelaunayChart.lean b/LeanPool/PoincareThreeBody/DelaunayChart.lean index 5fc91010ae..d49a2aee5f 100644 --- a/LeanPool/PoincareThreeBody/DelaunayChart.lean +++ b/LeanPool/PoincareThreeBody/DelaunayChart.lean @@ -16,32 +16,32 @@ action, eccentricity, mean anomaly, and rotating periapsis angle. The angles ar to real numbers; periodicity will allow the chart to descend to the angle torus. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Eccentric anomaly in the lifted Delaunay chart. -/ -noncomputable def liftedDelaunayEccentricAnomaly +@[expose] noncomputable def liftedDelaunayEccentricAnomaly (eccentricity meanAnomaly : ℝ) : ℝ := eccentricAnomaly eccentricity meanAnomaly /-- Position in rotating Cartesian coordinates in the lifted Delaunay chart. -/ -noncomputable def liftedDelaunayPosition +@[expose] noncomputable def liftedDelaunayPosition (firstAction eccentricity meanAnomaly periapsisAngle : ℝ) : ActionSpace := positionInRotatingFrame (-periapsisAngle) (inertialEllipsePosition firstAction eccentricity (liftedDelaunayEccentricAnomaly eccentricity meanAnomaly)) /-- Canonical rotating-frame momentum in the lifted Delaunay chart. -/ -noncomputable def liftedDelaunayMomentum +@[expose] noncomputable def liftedDelaunayMomentum (firstAction eccentricity meanAnomaly periapsisAngle : ℝ) : ActionSpace := positionInRotatingFrame (-periapsisAngle) (inertialEllipseVelocity firstAction eccentricity (1 / firstAction ^ 3) (liftedDelaunayEccentricAnomaly eccentricity meanAnomaly)) /-- Full phase-space point in lifted Delaunay variables. -/ -noncomputable def liftedDelaunayPhasePoint +@[expose] noncomputable def liftedDelaunayPhasePoint (firstAction eccentricity meanAnomaly periapsisAngle : ℝ) : PhaseSpace := positionMomentumPhasePoint (liftedDelaunayPosition firstAction eccentricity meanAnomaly periapsisAngle) @@ -117,7 +117,7 @@ lemma liftedDelaunayPhasePoint_add_periapsis_period /-- Along the unperturbed flow, the first Delaunay angle advances with frequency `I₁⁻³` and the rotating periapsis angle decreases with unit speed. -/ -noncomputable def liftedDelaunayFlowLine +@[expose] noncomputable def liftedDelaunayFlowLine (firstAction eccentricity meanAnomaly periapsisAngle time : ℝ) : PhaseSpace := liftedDelaunayPhasePoint firstAction eccentricity (meanAnomaly + time / firstAction ^ 3) (periapsisAngle - time) diff --git a/LeanPool/PoincareThreeBody/DelaunayFlow.lean b/LeanPool/PoincareThreeBody/DelaunayFlow.lean index 346f0ad8dd..2b81305cd9 100644 --- a/LeanPool/PoincareThreeBody/DelaunayFlow.lean +++ b/LeanPool/PoincareThreeBody/DelaunayFlow.lean @@ -20,18 +20,18 @@ rotating periapsis angle at unit speed. Here we verify directly that this curve Hamilton equations for the mass-zero rotating Kepler Hamiltonian. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Mean anomaly along a general lifted Delaunay flow line. -/ -noncomputable def liftedDelaunayMeanAnomalyAlongFlow +@[expose] noncomputable def liftedDelaunayMeanAnomalyAlongFlow (firstAction meanAnomaly time : ℝ) : ℝ := meanAnomaly + time / firstAction ^ 3 /-- Eccentric anomaly along a general lifted Delaunay flow line. -/ -noncomputable def liftedDelaunayEccentricAnomalyAlongFlow +@[expose] noncomputable def liftedDelaunayEccentricAnomalyAlongFlow (firstAction eccentricity meanAnomaly time : ℝ) : ℝ := eccentricAnomaly eccentricity (liftedDelaunayMeanAnomalyAlongFlow firstAction meanAnomaly time) @@ -498,7 +498,7 @@ abbrev InteriorPositiveAction (eccentricity : ℝ) := {action : PositiveAction // action.1 ^ 2 * (1 + eccentricity) < 1} /-- The interior actions with irrational Kepler frequency. -/ -def irrationalFrequencyInteriorPositiveActions (eccentricity : ℝ) : +@[expose] def irrationalFrequencyInteriorPositiveActions (eccentricity : ℝ) : Set (InteriorPositiveAction eccentricity) := {action | Irrational (1 / action.1.1 ^ 3)} diff --git a/LeanPool/PoincareThreeBody/DelaunaySection.lean b/LeanPool/PoincareThreeBody/DelaunaySection.lean index f5c939f85a..4061259438 100644 --- a/LeanPool/PoincareThreeBody/DelaunaySection.lean +++ b/LeanPool/PoincareThreeBody/DelaunaySection.lean @@ -20,17 +20,17 @@ physical action map and supplies the action-space representative of the leading integral. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Eccentricity reconstructed from prograde planar actions `(L,G)`. -/ -noncomputable def eccentricityFromActions (action : ActionSpace) : ℝ := +@[expose] noncomputable def eccentricityFromActions (action : ActionSpace) : ℝ := Real.sqrt (1 - (action 1 / action 0) ^ 2) /-- The open prograde elliptic action region. -/ -def ProgradeEllipticActions : Set ActionSpace := +@[expose] def ProgradeEllipticActions : Set ActionSpace := {action | 0 < action 1 ∧ action 1 < action 0} lemma isOpen_progradeEllipticActions : IsOpen ProgradeEllipticActions := by @@ -261,7 +261,7 @@ theorem analyticAt_delaunayActionSection /-- An action section through a prescribed eccentric anomaly and periapsis angle. Fixing the eccentric anomaly, rather than the mean anomaly, makes the dependence on the two actions explicitly analytic. -/ -noncomputable def delaunayActionSectionAtAnomaly +@[expose] noncomputable def delaunayActionSectionAtAnomaly (anomaly periapsisAngle : ℝ) (action : ActionSpace) : PhaseSpace := let eccentricity := eccentricityFromActions action positionMomentumPhasePoint @@ -596,12 +596,12 @@ theorem IsJointlyAnalytic.analyticAt_leadingActionDifferential hderivative /-- The action pair `(L, L sqrt(1-e²))` along a fixed-eccentricity family. -/ -noncomputable def fixedEccentricityAction +@[expose] noncomputable def fixedEccentricityAction (eccentricity firstAction : ℝ) : ActionSpace := ![firstAction, angularActionFromEccentricity firstAction eccentricity] /-- The leading action differential restricted to a fixed-eccentricity interior family. -/ -noncomputable def leadingActionDifferentialAtEccentricity +@[expose] noncomputable def leadingActionDifferentialAtEccentricity (F : ℝ → PhaseSpace → ℝ) (eccentricity : ℝ) (firstAction : InteriorPositiveAction eccentricity) : ActionSpace := leadingActionDifferential F diff --git a/LeanPool/PoincareThreeBody/DenseResonantObstruction.lean b/LeanPool/PoincareThreeBody/DenseResonantObstruction.lean index 7d3317c8bb..b5482b6688 100644 --- a/LeanPool/PoincareThreeBody/DenseResonantObstruction.lean +++ b/LeanPool/PoincareThreeBody/DenseResonantObstruction.lean @@ -16,12 +16,12 @@ forces the leading integral differential to be dependent on the Kepler frequency the corresponding fixed-eccentricity action interval. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Interior first actions carrying a positive rational Kepler resonance. -/ -def resonantInteriorPositiveActions (eccentricity : ℝ) : +@[expose] def resonantInteriorPositiveActions (eccentricity : ℝ) : Set (InteriorPositiveAction eccentricity) := {action | ∃ p q : ℕ, 0 < p ∧ 0 < q ∧ action.1.1 = resonantFirstAction p q} diff --git a/LeanPool/PoincareThreeBody/DifferentialDependence.lean b/LeanPool/PoincareThreeBody/DifferentialDependence.lean index 00d392f431..dc20ac9f1f 100644 --- a/LeanPool/PoincareThreeBody/DifferentialDependence.lean +++ b/LeanPool/PoincareThreeBody/DifferentialDependence.lean @@ -22,13 +22,13 @@ identities naturally produced by coefficient induction into failure of the chall `LinearIndependent` predicate. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- A two-by-two coordinate minor of a pair of phase covectors. -/ -def phaseCovectorMinor +@[expose] def phaseCovectorMinor (first second : PhaseSpace →L[ℝ] ℝ) (i j : Fin 4) : ℝ := first (coordinateVector i) * second (coordinateVector j) - first (coordinateVector j) * second (coordinateVector i) diff --git a/LeanPool/PoincareThreeBody/DisturbingAverageAnalytic.lean b/LeanPool/PoincareThreeBody/DisturbingAverageAnalytic.lean index 050439ce54..86f3d655fa 100644 --- a/LeanPool/PoincareThreeBody/DisturbingAverageAnalytic.lean +++ b/LeanPool/PoincareThreeBody/DisturbingAverageAnalytic.lean @@ -17,7 +17,7 @@ The joint analyticity of the disturbing function and compact parameter-integral that averaging over one resonant period preserves real analyticity in eccentricity. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/DisturbingCertificate.lean b/LeanPool/PoincareThreeBody/DisturbingCertificate.lean index b208b8799e..fb1cf9c521 100644 --- a/LeanPool/PoincareThreeBody/DisturbingCertificate.lean +++ b/LeanPool/PoincareThreeBody/DisturbingCertificate.lean @@ -18,7 +18,7 @@ two phases. This file reduces that comparison to a finite trapezoidal sum plus a bound on the second time derivative of the integrand difference. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/DisturbingFunction.lean b/LeanPool/PoincareThreeBody/DisturbingFunction.lean index c09235c768..fe9cb870d5 100644 --- a/LeanPool/PoincareThreeBody/DisturbingFunction.lean +++ b/LeanPool/PoincareThreeBody/DisturbingFunction.lean @@ -19,33 +19,33 @@ torus. We define the first-order disturbing function on this family and its aver period. Nonconstancy of this average is the concrete perturbative input in Poincaré's argument. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody open MeasureTheory /-- A resonant Kepler ellipse with an arbitrary inertial orientation phase. -/ -noncomputable def orientedResonantEllipsePosition +@[expose] noncomputable def orientedResonantEllipsePosition (p q : ℕ) (eccentricity orientation time : ℝ) : ActionSpace := positionInRotatingFrame (time - orientation) (inertialEllipsePosition (resonantFirstAction p q) eccentricity (resonantEccentricAnomaly p q eccentricity time)) /-- The oriented resonant position embedded in phase space. -/ -noncomputable def orientedResonantEllipsePhasePoint +@[expose] noncomputable def orientedResonantEllipsePhasePoint (p q : ℕ) (eccentricity orientation time : ℝ) : PhaseSpace := positionPhasePoint (orientedResonantEllipsePosition p q eccentricity orientation time) /-- The first-order disturbing function along an oriented resonant ellipse. -/ -noncomputable def resonantDisturbingFunction +@[expose] noncomputable def resonantDisturbingFunction (p q : ℕ) (eccentricity orientation time : ℝ) : ℝ := firstMassPerturbation (orientedResonantEllipsePhasePoint p q eccentricity orientation time) /-- The disturbing function averaged over one common resonant period. -/ -noncomputable def resonantDisturbingAverage +@[expose] noncomputable def resonantDisturbingAverage (p q : ℕ) (eccentricity orientation : ℝ) : ℝ := ∫ time in 0..resonantOrbitPeriod p, resonantDisturbingFunction p q eccentricity orientation time diff --git a/LeanPool/PoincareThreeBody/DisturbingParameterAnalytic.lean b/LeanPool/PoincareThreeBody/DisturbingParameterAnalytic.lean index ec474bfea8..6ddcfae31d 100644 --- a/LeanPool/PoincareThreeBody/DisturbingParameterAnalytic.lean +++ b/LeanPool/PoincareThreeBody/DisturbingParameterAnalytic.lean @@ -18,7 +18,7 @@ is real analytic in eccentricity. This is the pointwise analytic input for the parameter-integral argument. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/DisturbingRegularBound.lean b/LeanPool/PoincareThreeBody/DisturbingRegularBound.lean index e7533fce69..727cb62226 100644 --- a/LeanPool/PoincareThreeBody/DisturbingRegularBound.lean +++ b/LeanPool/PoincareThreeBody/DisturbingRegularBound.lean @@ -17,7 +17,7 @@ The two nonsingular terms in the first mass perturbation stay uniformly bounded resonant ellipse approaches its apoapsis collision boundary. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/EnergyLeafObstruction.lean b/LeanPool/PoincareThreeBody/EnergyLeafObstruction.lean index 14a3da1e48..9698025d5f 100644 --- a/LeanPool/PoincareThreeBody/EnergyLeafObstruction.lean +++ b/LeanPool/PoincareThreeBody/EnergyLeafObstruction.lean @@ -22,13 +22,13 @@ makes that coefficient constant on every connected energy-leaf segment contained interior elliptic region. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- The Delaunay action on the Kepler energy leaf `E` with first action `L`. -/ -noncomputable def energyLeafAction (energy firstAction : ℝ) : ActionSpace := +@[expose] noncomputable def energyLeafAction (energy firstAction : ℝ) : ActionSpace := ![firstAction, -1 / (2 * firstAction ^ 2) - energy] @[simp] theorem energyLeafAction_zero (energy firstAction : ℝ) : diff --git a/LeanPool/PoincareThreeBody/GeneratingFunction.lean b/LeanPool/PoincareThreeBody/GeneratingFunction.lean index be06a6efd6..8510038bfc 100644 --- a/LeanPool/PoincareThreeBody/GeneratingFunction.lean +++ b/LeanPool/PoincareThreeBody/GeneratingFunction.lean @@ -18,7 +18,7 @@ factorization of the squared radial momentum. These identities underlie the squa in the Delaunay generating function. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -31,7 +31,7 @@ noncomputable def apoapsisRadius (firstAction secondAction : ℝ) : ℝ := firstAction * (firstAction + Real.sqrt (firstAction ^ 2 - secondAction ^ 2)) /-- Angular action of an elliptic Kepler orbit with first action `I₁` and eccentricity `e`. -/ -noncomputable def angularActionFromEccentricity (firstAction eccentricity : ℝ) : ℝ := +@[expose] noncomputable def angularActionFromEccentricity (firstAction eccentricity : ℝ) : ℝ := firstAction * Real.sqrt (1 - eccentricity ^ 2) lemma periapsis_add_apoapsis (firstAction secondAction : ℝ) : diff --git a/LeanPool/PoincareThreeBody/GlobalEnergySection.lean b/LeanPool/PoincareThreeBody/GlobalEnergySection.lean index 0207d5a2cb..c29824f251 100644 --- a/LeanPool/PoincareThreeBody/GlobalEnergySection.lean +++ b/LeanPool/PoincareThreeBody/GlobalEnergySection.lean @@ -20,7 +20,7 @@ real energy. This supplies a canonical globally analytic one-variable represent mass-zero coefficient of any jointly analytic family. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -252,7 +252,7 @@ theorem analyticAt_globalEnergySection (energy : ℝ) : · exact analyticAt_const /-- Evaluate the mass-zero coefficient along the global energy section. -/ -noncomputable def globalEnergyCoefficient +@[expose] noncomputable def globalEnergyCoefficient (F : ℝ → PhaseSpace → ℝ) (energy : ℝ) : ℝ := F 0 (globalEnergySection energy) @@ -376,7 +376,7 @@ theorem IsJointlyAnalytic.analyticOnNhd_globalEnergyDefect exact hcandidate.sub (hcoefficient.comp (f := hamiltonian 0) hhamiltonian) /-- Local version of the classical factorization obligation at the rational elliptic anchor. -/ -def LocalZerothCoefficientFactorizationAtAnchor : Prop := +@[expose] def LocalZerothCoefficientFactorizationAtAnchor : Prop := ∀ {δ : ℝ} {F : ℝ → PhaseSpace → ℝ}, 0 < δ → IsJointlyAnalytic δ F → IsFirstIntegralFamily δ F → ∀ᶠ state in nhds (globalEnergySection (-2)), diff --git a/LeanPool/PoincareThreeBody/HamiltonianMixedPartials.lean b/LeanPool/PoincareThreeBody/HamiltonianMixedPartials.lean index c60b173350..44a242ca37 100644 --- a/LeanPool/PoincareThreeBody/HamiltonianMixedPartials.lean +++ b/LeanPool/PoincareThreeBody/HamiltonianMixedPartials.lean @@ -20,7 +20,7 @@ Combining this fact with the explicit mass derivative identifies the Hamiltonian Poincaré's first homological equation. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/HomologicalEquation.lean b/LeanPool/PoincareThreeBody/HomologicalEquation.lean index f4b9a3613c..0acb4c2d91 100644 --- a/LeanPool/PoincareThreeBody/HomologicalEquation.lean +++ b/LeanPool/PoincareThreeBody/HomologicalEquation.lean @@ -20,7 +20,7 @@ of the two cross brackets. The hypotheses expose precisely the mixed derivative be obtained from joint analyticity. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/IrrationalTorusFlow.lean b/LeanPool/PoincareThreeBody/IrrationalTorusFlow.lean index 19027831a0..a33738d84a 100644 --- a/LeanPool/PoincareThreeBody/IrrationalTorusFlow.lean +++ b/LeanPool/PoincareThreeBody/IrrationalTorusFlow.lean @@ -18,7 +18,7 @@ on the angle torus. This file proves directly that a continuous invariant of th constant, using irrational rotations on a circle. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/JointBallFiberSeries.lean b/LeanPool/PoincareThreeBody/JointBallFiberSeries.lean index f6c55cb4f3..b188d73ff7 100644 --- a/LeanPool/PoincareThreeBody/JointBallFiberSeries.lean +++ b/LeanPool/PoincareThreeBody/JointBallFiberSeries.lean @@ -18,14 +18,14 @@ radius on any smaller time slab. These are the local pieces used in the compact parameter-integral theorem. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody open Filter Set Topology /-- The isometric inclusion of the analytic parameter as the first product coordinate. -/ -def parameterInclusion : ℝ →L[ℝ] ℝ × ℝ := +@[expose] def parameterInclusion : ℝ →L[ℝ] ℝ × ℝ := ContinuousLinearMap.inl ℝ ℝ ℝ @[simp] @@ -37,7 +37,7 @@ theorem norm_parameterInclusion : ‖parameterInclusion‖ = 1 := by exact ContinuousLinearMap.norm_inl ℝ ℝ ℝ /-- Restrict a changed-origin joint series to displacement in the first coordinate. -/ -noncomputable def jointBallFiberSeries +@[expose] noncomputable def jointBallFiberSeries (jointSeries : FormalMultilinearSeries ℝ (ℝ × ℝ) ℝ) (centerTime time : ℝ) : FormalMultilinearSeries ℝ ℝ ℝ := (jointSeries.changeOrigin (0, time - centerTime)).compContinuousLinearMap diff --git a/LeanPool/PoincareThreeBody/JointEccentricAnomaly.lean b/LeanPool/PoincareThreeBody/JointEccentricAnomaly.lean index 5dfa7dbd98..2f2e0a273e 100644 --- a/LeanPool/PoincareThreeBody/JointEccentricAnomaly.lean +++ b/LeanPool/PoincareThreeBody/JointEccentricAnomaly.lean @@ -20,7 +20,7 @@ on eccentricity. We obtain it by applying the analytic inverse-function theorem map `(e, E) ↦ (e, E - e sin E)`. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/JointSlabIntegral.lean b/LeanPool/PoincareThreeBody/JointSlabIntegral.lean index 53f5933061..75ee632c69 100644 --- a/LeanPool/PoincareThreeBody/JointSlabIntegral.lean +++ b/LeanPool/PoincareThreeBody/JointSlabIntegral.lean @@ -18,7 +18,7 @@ This file turns the uniform fiber series supplied by a joint analytic ball into for its parameter integral over any closed time interval contained in a smaller slab. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/KeplerFlow.lean b/LeanPool/PoincareThreeBody/KeplerFlow.lean index 924fe943ec..3ec4558c54 100644 --- a/LeanPool/PoincareThreeBody/KeplerFlow.lean +++ b/LeanPool/PoincareThreeBody/KeplerFlow.lean @@ -18,13 +18,13 @@ curve and provides the chain-rule interface used to differentiate a candidate fi that curve. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Explicit rotating Kepler vector field away from the origin. -/ -noncomputable def rotatingKeplerVectorField (s : PhaseSpace) : PhaseSpace := +@[expose] noncomputable def rotatingKeplerVectorField (s : PhaseSpace) : PhaseSpace := ![s 2 + s 1, s 3 - s 0, s 3 - s 0 / (Real.sqrt (s 0 ^ 2 + s 1 ^ 2)) ^ 3, diff --git a/LeanPool/PoincareThreeBody/KeplerHamiltonian.lean b/LeanPool/PoincareThreeBody/KeplerHamiltonian.lean index 4d1a14ad3b..b92844abcc 100644 --- a/LeanPool/PoincareThreeBody/KeplerHamiltonian.lean +++ b/LeanPool/PoincareThreeBody/KeplerHamiltonian.lean @@ -16,13 +16,13 @@ field with `rotatingKeplerVectorField`. Consequently, a Poisson bracket with th Hamiltonian is exactly differentiation along a Kepler flow line. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Explicit differential of the rotating Kepler Hamiltonian. -/ -noncomputable def rotatingKeplerDifferential (s : PhaseSpace) : PhaseSpace →L[ℝ] ℝ := +@[expose] noncomputable def rotatingKeplerDifferential (s : PhaseSpace) : PhaseSpace →L[ℝ] ℝ := let radius := Real.sqrt (s 0 ^ 2 + s 1 ^ 2) let projection : Fin 4 → PhaseSpace →L[ℝ] ℝ := fun i ↦ ContinuousLinearMap.proj i (s 0 / radius ^ 3 - s 3) • projection 0 + diff --git a/LeanPool/PoincareThreeBody/KeplerOrbit.lean b/LeanPool/PoincareThreeBody/KeplerOrbit.lean index d666ee7f05..2c3ac3409c 100644 --- a/LeanPool/PoincareThreeBody/KeplerOrbit.lean +++ b/LeanPool/PoincareThreeBody/KeplerOrbit.lean @@ -21,12 +21,12 @@ This file gives the real elliptic Kepler orbit attached to Delaunay action `I₁ first Delaunay angle along the unperturbed flow. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Radius of an elliptic Kepler orbit as a function of eccentric anomaly. -/ -noncomputable def eccentricRadius (firstAction eccentricity anomaly : ℝ) : ℝ := +@[expose] noncomputable def eccentricRadius (firstAction eccentricity anomaly : ℝ) : ℝ := firstAction ^ 2 * (1 - eccentricity * Real.cos anomaly) /-- Radial momentum of an elliptic Kepler orbit as a function of eccentric anomaly. -/ @@ -36,7 +36,7 @@ noncomputable def eccentricRadialMomentum (firstAction * (1 - eccentricity * Real.cos anomaly)) /-- Mean anomaly as a function of eccentric anomaly (Kepler's equation). -/ -noncomputable def eccentricMeanAnomaly (eccentricity anomaly : ℝ) : ℝ := +@[expose] noncomputable def eccentricMeanAnomaly (eccentricity anomaly : ℝ) : ℝ := anomaly - eccentricity * Real.sin anomaly /-- Physical Kepler time, normalized to vanish with the mean anomaly. -/ diff --git a/LeanPool/PoincareThreeBody/KeplerPhaseOrbit.lean b/LeanPool/PoincareThreeBody/KeplerPhaseOrbit.lean index 6eff0007bf..04f17b261f 100644 --- a/LeanPool/PoincareThreeBody/KeplerPhaseOrbit.lean +++ b/LeanPool/PoincareThreeBody/KeplerPhaseOrbit.lean @@ -17,14 +17,14 @@ file supplies the canonical rotating-frame momentum and embeds the resonant elli four-dimensional phase space. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Inertial Cartesian velocity of the eccentric-anomaly ellipse when the mean anomaly advances at rate `meanMotion`. -/ -noncomputable def inertialEllipseVelocity +@[expose] noncomputable def inertialEllipseVelocity (firstAction eccentricity meanMotion anomaly : ℝ) : ActionSpace := ![-firstAction ^ 2 * meanMotion * Real.sin anomaly / (1 - eccentricity * Real.cos anomaly), @@ -32,7 +32,7 @@ noncomputable def inertialEllipseVelocity (1 - eccentricity * Real.cos anomaly)] /-- Canonical momentum of an oriented resonant ellipse in rotating coordinates. -/ -noncomputable def orientedResonantEllipseMomentum +@[expose] noncomputable def orientedResonantEllipseMomentum (p q : ℕ) (eccentricity orientation time : ℝ) : ActionSpace := positionInRotatingFrame (time - orientation) (inertialEllipseVelocity (resonantFirstAction p q) eccentricity @@ -40,11 +40,11 @@ noncomputable def orientedResonantEllipseMomentum (resonantEccentricAnomaly p q eccentricity time)) /-- Embed planar position and canonical momentum into `(x,y,pₓ,pᵧ)` phase space. -/ -def positionMomentumPhasePoint (position momentum : ActionSpace) : PhaseSpace := +@[expose] def positionMomentumPhasePoint (position momentum : ActionSpace) : PhaseSpace := ![position 0, position 1, momentum 0, momentum 1] /-- The genuine full phase-space orbit underlying the oriented resonant disturbing function. -/ -noncomputable def orientedResonantKeplerPhasePoint +@[expose] noncomputable def orientedResonantKeplerPhasePoint (p q : ℕ) (eccentricity orientation time : ℝ) : PhaseSpace := positionMomentumPhasePoint (orientedResonantEllipsePosition p q eccentricity orientation time) diff --git a/LeanPool/PoincareThreeBody/LeadingObstruction.lean b/LeanPool/PoincareThreeBody/LeadingObstruction.lean index 8ec7ed94fd..2d7dec46e3 100644 --- a/LeanPool/PoincareThreeBody/LeadingObstruction.lean +++ b/LeanPool/PoincareThreeBody/LeadingObstruction.lean @@ -18,7 +18,7 @@ is isolated as `ClassicalDisturbingNondegeneracy`: the resonant disturbing avera nonconstant at every rational resonance under consideration. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/LocalEnergyLeaf.lean b/LeanPool/PoincareThreeBody/LocalEnergyLeaf.lean index 1a356073ff..cdb890bea5 100644 --- a/LeanPool/PoincareThreeBody/LocalEnergyLeaf.lean +++ b/LeanPool/PoincareThreeBody/LocalEnergyLeaf.lean @@ -18,7 +18,7 @@ energy/first-action coordinates. Shrinking the first-action side to an interval the whole straight energy-leaf segment back to the anchor remains in the region. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/MixedPartials.lean b/LeanPool/PoincareThreeBody/MixedPartials.lean index fbd2912919..ef55bdf198 100644 --- a/LeanPool/PoincareThreeBody/MixedPartials.lean +++ b/LeanPool/PoincareThreeBody/MixedPartials.lean @@ -15,12 +15,12 @@ The first homological equation differentiates phase derivatives with respect to parameter. This file packages the needed Schwarz theorem for a jointly `C²` scalar function. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- The derivative in the distinguished real parameter direction at parameter zero. -/ -noncomputable def parameterCoefficient +@[expose] noncomputable def parameterCoefficient {B : Type*} [NormedAddCommGroup B] [NormedSpace ℝ B] (G : ℝ × B → ℝ) (b : B) : ℝ := fderiv ℝ G (0, b) (1, 0) diff --git a/LeanPool/PoincareThreeBody/NormalizationClosure.lean b/LeanPool/PoincareThreeBody/NormalizationClosure.lean index 77c05b3388..062ebb28c8 100644 --- a/LeanPool/PoincareThreeBody/NormalizationClosure.lean +++ b/LeanPool/PoincareThreeBody/NormalizationClosure.lean @@ -19,7 +19,7 @@ analyticity and the first-integral equation—classical choice and primitive rec orders automatically. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -38,7 +38,7 @@ def ClassicalNormalizationStep : Prop := /-- Celestial-mechanics half of one normalization step: the mass-zero coefficient of every analytic first integral is a globally analytic function of the Kepler Hamiltonian. -/ -def ClassicalZerothCoefficientPrinciple : Prop := +@[expose] def ClassicalZerothCoefficientPrinciple : Prop := ∀ {δ : ℝ} {F : ℝ → PhaseSpace → ℝ}, 0 < δ → IsJointlyAnalytic δ F → IsFirstIntegralFamily δ F → ∃ energyFunction : ℝ → ℝ, @@ -59,7 +59,7 @@ def JointAnalyticMassDivisionPrinciple : Prop := /-- Pointwise form of analytic Hadamard division on the only nontrivial slice. Ordinary division already handles every point with nonzero mass, so this is equivalent to the global joint-analytic division principle above. -/ -def MassZeroAnalyticDivisionPrinciple : Prop := +@[expose] def MassZeroAnalyticDivisionPrinciple : Prop := ∀ {δ : ℝ} {F : ℝ → PhaseSpace → ℝ} {energyFunction : ℝ → ℝ}, 0 < δ → IsJointlyAnalytic δ F → (∀ energy, AnalyticAt ℝ energyFunction energy) → diff --git a/LeanPool/PoincareThreeBody/NormalizationInduction.lean b/LeanPool/PoincareThreeBody/NormalizationInduction.lean index d98657a31c..678bc908af 100644 --- a/LeanPool/PoincareThreeBody/NormalizationInduction.lean +++ b/LeanPool/PoincareThreeBody/NormalizationInduction.lean @@ -21,14 +21,14 @@ expansions then express the original candidate as a function of the Hamiltonian arbitrarily high power of the mass parameter. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- The sequence obtained by repeatedly subtracting a chosen energy function and dividing by the mass parameter. -/ -noncomputable def iteratedMassNormalization +@[expose] noncomputable def iteratedMassNormalization (F : ℝ → PhaseSpace → ℝ) (energyFunction : ℕ → ℝ → ℝ) : ℕ → ℝ → PhaseSpace → ℝ | 0 => F @@ -442,7 +442,7 @@ theorem not_isIndependentSomewhere_of_iterated_normalizations /-- The remaining classical input, isolated as an induction principle: every analytic first integral admits energy functions which cancel all successive Kepler-limit coefficients while the normalized remainders remain jointly analytic. -/ -def ClassicalNormalizationPrinciple : Prop := +@[expose] def ClassicalNormalizationPrinciple : Prop := ∀ {δ : ℝ} {F : ℝ → PhaseSpace → ℝ}, 0 < δ → IsJointlyAnalytic δ F → IsFirstIntegralFamily δ F → ∃ energyFunction : ℕ → ℝ → ℝ, diff --git a/LeanPool/PoincareThreeBody/OneTwoResonance.lean b/LeanPool/PoincareThreeBody/OneTwoResonance.lean index 3352a47097..6673065257 100644 --- a/LeanPool/PoincareThreeBody/OneTwoResonance.lean +++ b/LeanPool/PoincareThreeBody/OneTwoResonance.lean @@ -16,7 +16,7 @@ validated-numerics proof therefore only has to bound a second derivative and che trapezoidal inequality. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean b/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean index 25298e8149..72241ff204 100644 --- a/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean +++ b/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean @@ -21,7 +21,7 @@ periodic Kepler flow. Its first term becomes a time derivative, so its integral period vanishes. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -35,7 +35,7 @@ noncomputable def resonantCandidateCorrection (orientedResonantKeplerPhasePoint p q eccentricity orientation time) /-- The remaining forcing term in the first homological equation, restricted to the same orbit. -/ -noncomputable def resonantCandidateForcing +@[expose] noncomputable def resonantCandidateForcing (F : ℝ → PhaseSpace → ℝ) (p q : ℕ) (eccentricity orientation time : ℝ) : ℝ := poissonBracket (F 0) firstMassPerturbation (orientedResonantKeplerPhasePoint p q eccentricity orientation time) diff --git a/LeanPool/PoincareThreeBody/ParameterDomainTopology.lean b/LeanPool/PoincareThreeBody/ParameterDomainTopology.lean index 925fd97fbe..0b114a75ac 100644 --- a/LeanPool/PoincareThreeBody/ParameterDomainTopology.lean +++ b/LeanPool/PoincareThreeBody/ParameterDomainTopology.lean @@ -19,7 +19,7 @@ twice-punctured plane, and the unrestricted momentum plane. This proves that th path-connected whenever the mass interval is nonempty. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -163,7 +163,7 @@ noncomputable def phaseCoordinateHomeomorph : PhaseSpace ≃ₜ (Plane × Plane) Homeomorph.mk phaseCoordinateEquiv (by fun_prop) (by fun_prop) /-- The mass-zero phase domain, excluding both fixed primary positions. -/ -def massZeroCollisionFree : Set PhaseSpace := +@[expose] def massZeroCollisionFree : Set PhaseSpace := {state | (0, state) ∈ collisionFree} /-- The mass-zero collision-free phase domain is a twice-punctured position plane times the diff --git a/LeanPool/PoincareThreeBody/ParameterizedAnalyticDivision.lean b/LeanPool/PoincareThreeBody/ParameterizedAnalyticDivision.lean index 4b93e39c29..c1c74d06d1 100644 --- a/LeanPool/PoincareThreeBody/ParameterizedAnalyticDivision.lean +++ b/LeanPool/PoincareThreeBody/ParameterizedAnalyticDivision.lean @@ -20,7 +20,7 @@ normalization. The homotopy `(mass, phase) ↦ (t * mass, phase)` reduces divis coordinate to integration of the mass partial derivative along `0 ≤ t ≤ 1`. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -48,7 +48,7 @@ theorem continuous_massScale : Continuous massScale := by ((continuous_id.smul continuous_const).prodMk continuous_const) /-- The distinguished unit direction in the mass coordinate. -/ -def massDirection : ParameterPhase := (1, 0) +@[expose] def massDirection : ParameterPhase := (1, 0) @[simp] theorem massDirection_fst : massDirection.1 = 1 := rfl @@ -76,7 +76,7 @@ theorem norm_massScale_le_one {t : ℝ} (ht : t ∈ Set.Icc (0 : ℝ) 1) : /-- The power series of the mass partial derivative after applying the mass-scaling homotopy to its input variables. -/ -noncomputable def massPartialSeries +@[expose] noncomputable def massPartialSeries (p : FormalMultilinearSeries ℝ ParameterPhase ℝ) (t : ℝ) : FormalMultilinearSeries ℝ ParameterPhase ℝ := (ContinuousLinearMap.apply ℝ ℝ massDirection).compFormalMultilinearSeries @@ -114,7 +114,7 @@ theorem continuous_massPartialSeries_coeff (ContinuousLinearMap.apply ℝ ℝ massDirection)).continuous.comp hcomp /-- One evaluated coefficient, bundled as a continuous function of the homotopy parameter. -/ -noncomputable def massPartialTerm +@[expose] noncomputable def massPartialTerm (p : FormalMultilinearSeries ℝ ParameterPhase ℝ) (x : ParameterPhase) (n : ℕ) : C(ℝ, ℝ) where toFun t := massPartialSeries p t n (fun _ ↦ x) diff --git a/LeanPool/PoincareThreeBody/Perturbation.lean b/LeanPool/PoincareThreeBody/Perturbation.lean index ae526bd9dd..e9c2f8b90a 100644 --- a/LeanPool/PoincareThreeBody/Perturbation.lean +++ b/LeanPool/PoincareThreeBody/Perturbation.lean @@ -22,7 +22,7 @@ Kepler limit. The resulting disturbing function is the explicit input to Poincar homological equation. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -50,7 +50,7 @@ lemma hasDerivAt_inverseSqrt_comp {f : ℝ → ℝ} {f' x : ℝ} simp [one_div] /-- The coefficient of `μ` in the planar Hamiltonian at the Kepler limit. -/ -noncomputable def firstMassPerturbation (s : PhaseSpace) : ℝ := +@[expose] noncomputable def firstMassPerturbation (s : PhaseSpace) : ℝ := 1 / Real.sqrt ((s 0) ^ 2 + (s 1) ^ 2) + s 0 / (Real.sqrt ((s 0) ^ 2 + (s 1) ^ 2)) ^ 3 - 1 / Real.sqrt ((s 0 - 1) ^ 2 + (s 1) ^ 2) diff --git a/LeanPool/PoincareThreeBody/PoincareSet.lean b/LeanPool/PoincareThreeBody/PoincareSet.lean index c4b7060166..d8a0d6648b 100644 --- a/LeanPool/PoincareThreeBody/PoincareSet.lean +++ b/LeanPool/PoincareThreeBody/PoincareSet.lean @@ -20,14 +20,14 @@ defines that set intrinsically in the full two-dimensional action region and pro leading-coefficient obstruction. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Prograde, noncircular elliptic actions whose entire ellipse stays inside the unit primary orbit. -/ -def InteriorProgradeEllipticActions : Set ActionSpace := +@[expose] def InteriorProgradeEllipticActions : Set ActionSpace := {action | action ∈ ProgradeEllipticActions ∧ action 0 ^ 2 * (1 + eccentricityFromActions action) < 1} @@ -37,7 +37,7 @@ abbrev InteriorProgradeEllipticAction := /-- The classical Poincaré set: rational Kepler resonances at which the disturbing average has a nonzero orientation derivative. -/ -def classicalPoincareSet : Set InteriorProgradeEllipticAction := +@[expose] def classicalPoincareSet : Set InteriorProgradeEllipticAction := {action | ∃ p q : ℕ, 0 < p ∧ 0 < q ∧ action.1 0 = resonantFirstAction p q ∧ ∃ orientation, @@ -46,12 +46,12 @@ def classicalPoincareSet : Set InteriorProgradeEllipticAction := (eccentricityFromActions action.1)) orientation ≠ 0} /-- The exact classical celestial-mechanics input used by the density argument. -/ -def HasDenseClassicalPoincareSet : Prop := +@[expose] def HasDenseClassicalPoincareSet : Prop := Dense classicalPoincareSet /-- A stronger sufficient condition: every interior positive rational resonance has a nonconstant disturbing average as the relative apsidal orientation varies. -/ -def ClassicalDisturbingNondegeneracy : Prop := +@[expose] def ClassicalDisturbingNondegeneracy : Prop := ∀ {eccentricity : ℝ}, 0 < eccentricity → eccentricity < 1 → ∀ {p q : ℕ}, 0 < p → 0 < q → resonantFirstAction p q ^ 2 * (1 + eccentricity) < 1 → @@ -60,7 +60,7 @@ def ClassicalDisturbingNondegeneracy : Prop := /-- The open interval of admissible noncircular eccentricities for one fixed positive rational resonance. -/ -def admissibleResonantEccentricitySet (p q : ℕ) : Set ℝ := +@[expose] def admissibleResonantEccentricitySet (p q : ℕ) : Set ℝ := {eccentricity | 0 < eccentricity ∧ eccentricity < 1 ∧ resonantFirstAction p q ^ 2 * (1 + eccentricity) < 1} @@ -69,7 +69,7 @@ abbrev AdmissibleResonantEccentricity (p q : ℕ) := {eccentricity : ℝ // eccentricity ∈ admissibleResonantEccentricitySet p q} /-- Eccentricities at a fixed resonance where the resonant disturbing average is nonconstant. -/ -def nondegenerateResonantEccentricities (p q : ℕ) : +@[expose] def nondegenerateResonantEccentricities (p q : ℕ) : Set (AdmissibleResonantEccentricity p q) := {eccentricity | ∃ orientation, deriv (resonantDisturbingAverage p q eccentricity.1) orientation ≠ 0} diff --git a/LeanPool/PoincareThreeBody/PoissonNormalization.lean b/LeanPool/PoincareThreeBody/PoissonNormalization.lean index 6b8bf8c7b3..01d09a63a0 100644 --- a/LeanPool/PoincareThreeBody/PoissonNormalization.lean +++ b/LeanPool/PoincareThreeBody/PoissonNormalization.lean @@ -21,7 +21,7 @@ shows that the mass-normalized candidate remains a first integral for nonzero ma zeroth coefficient cancellation holds locally in phase space. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/Polar.lean b/LeanPool/PoincareThreeBody/Polar.lean index df224138ff..64d598fa2e 100644 --- a/LeanPool/PoincareThreeBody/Polar.lean +++ b/LeanPool/PoincareThreeBody/Polar.lean @@ -18,7 +18,7 @@ the zero-mass Cartesian Hamiltonian to the rotating Kepler Hamiltonian. This is change on the route to Delaunay action-angle variables. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -38,12 +38,12 @@ noncomputable def polarKeplerHamiltonian (state : PolarState) : ℝ := ((state 2) ^ 2 + (state 3) ^ 2 / (state 0) ^ 2) / 2 - 1 / state 0 - state 3 /-- The inertial Kepler energy in canonical polar coordinates. -/ -noncomputable def polarKeplerEnergy (state : PolarState) : ℝ := +@[expose] noncomputable def polarKeplerEnergy (state : PolarState) : ℝ := ((state 2) ^ 2 + (state 3) ^ 2 / (state 0) ^ 2) / 2 - 1 / state 0 /-- The squared radial momentum prescribed by a Kepler energy `-1 / (2 * firstAction²)` and angular momentum `secondAction`. -/ -noncomputable def delaunayRadialMomentumSq +@[expose] noncomputable def delaunayRadialMomentumSq (radius firstAction secondAction : ℝ) : ℝ := 2 / radius - 1 / firstAction ^ 2 - secondAction ^ 2 / radius ^ 2 diff --git a/LeanPool/PoincareThreeBody/Resonance.lean b/LeanPool/PoincareThreeBody/Resonance.lean index 6e10997647..4fb27acb61 100644 --- a/LeanPool/PoincareThreeBody/Resonance.lean +++ b/LeanPool/PoincareThreeBody/Resonance.lean @@ -19,7 +19,7 @@ of a putative first integral annihilate the same nonzero resonance vector. In tw two covectors must therefore be linearly dependent. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -31,7 +31,7 @@ def dot (u v : ActionSpace) : ℝ := ∑ i, u i * v i /-- The oriented area spanned by two vectors in the action space. -/ -def wedge (u v : ActionSpace) : ℝ := +@[expose] def wedge (u v : ActionSpace) : ℝ := u 0 * v 1 - u 1 * v 0 lemma dot_eq (u v : ActionSpace) : dot u v = u 0 * v 0 + u 1 * v 1 := by diff --git a/LeanPool/PoincareThreeBody/ResonantActionObstruction.lean b/LeanPool/PoincareThreeBody/ResonantActionObstruction.lean index ccd2e6434a..242472cdee 100644 --- a/LeanPool/PoincareThreeBody/ResonantActionObstruction.lean +++ b/LeanPool/PoincareThreeBody/ResonantActionObstruction.lean @@ -26,7 +26,7 @@ disturbing average. The bridge is the pointwise factorization of the leading di the physical Delaunay action map. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody @@ -248,7 +248,7 @@ theorem IsFirstIntegralFamily.resonantCandidateForcing_eq_neg_dot_actionPoisson hposition henergy hfactor /-- The leading action differential at the actions carried by a resonant eccentric ellipse. -/ -noncomputable def resonantLeadingActionDifferential +@[expose] noncomputable def resonantLeadingActionDifferential (F : ℝ → PhaseSpace → ℝ) (p q : ℕ) (eccentricity : ℝ) : ActionSpace := leadingActionDifferential F ![resonantFirstAction p q, diff --git a/LeanPool/PoincareThreeBody/ResonantAverageSeparation.lean b/LeanPool/PoincareThreeBody/ResonantAverageSeparation.lean index 2a4f2909a8..e8b42f2a57 100644 --- a/LeanPool/PoincareThreeBody/ResonantAverageSeparation.lean +++ b/LeanPool/PoincareThreeBody/ResonantAverageSeparation.lean @@ -23,7 +23,7 @@ The safe average stays finite at the boundary, while the aligned average tends t infinity. Hence the two orientation phases separate at an admissible eccentricity. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/ResonantCollisionBoundary.lean b/LeanPool/PoincareThreeBody/ResonantCollisionBoundary.lean index f958de2d82..c67af6980b 100644 --- a/LeanPool/PoincareThreeBody/ResonantCollisionBoundary.lean +++ b/LeanPool/PoincareThreeBody/ResonantCollisionBoundary.lean @@ -17,26 +17,26 @@ primary before the parabolic limit. This file identifies the boundary eccentric time, and orientation at which the limiting ellipse meets the primary exactly. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody open Filter Topology /-- Semimajor axis of the normalized Kepler ellipse at the `(p,q)` resonance. -/ -noncomputable def resonantSemimajorAxis (p q : ℕ) : ℝ := +@[expose] noncomputable def resonantSemimajorAxis (p q : ℕ) : ℝ := resonantFirstAction p q ^ 2 /-- Eccentricity at which the resonant apoapsis reaches radius one. -/ -noncomputable def resonantCollisionEccentricity (p q : ℕ) : ℝ := +@[expose] noncomputable def resonantCollisionEccentricity (p q : ℕ) : ℝ := 1 / resonantSemimajorAxis p q - 1 /-- The first time at which the resonant orbit reaches apoapsis. -/ -noncomputable def resonantApoapsisTime (p q : ℕ) : ℝ := +@[expose] noncomputable def resonantApoapsisTime (p q : ℕ) : ℝ := Real.pi * p / q /-- Orientation which places that apoapsis at the unit primary. -/ -noncomputable def resonantCollisionOrientation (p q : ℕ) : ℝ := +@[expose] noncomputable def resonantCollisionOrientation (p q : ℕ) : ℝ := resonantApoapsisTime p q - Real.pi theorem resonantSemimajorAxis_pos {p q : ℕ} (hp : 0 < p) (hq : 0 < q) : diff --git a/LeanPool/PoincareThreeBody/ResonantOrbit.lean b/LeanPool/PoincareThreeBody/ResonantOrbit.lean index 6e652fc771..2a9c3d5612 100644 --- a/LeanPool/PoincareThreeBody/ResonantOrbit.lean +++ b/LeanPool/PoincareThreeBody/ResonantOrbit.lean @@ -18,29 +18,29 @@ frame makes `p` revolutions during the common period `2πp`. This file construct proves its periodicity exactly. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Mean motion on the `(p,q)` Kepler resonance. -/ -noncomputable def resonantMeanMotion (p q : ℕ) : ℝ := +@[expose] noncomputable def resonantMeanMotion (p q : ℕ) : ℝ := (q : ℝ) / (p : ℝ) /-- Common period of the inertial ellipse and rotating frame. -/ -noncomputable def resonantOrbitPeriod (p : ℕ) : ℝ := +@[expose] noncomputable def resonantOrbitPeriod (p : ℕ) : ℝ := 2 * Real.pi * p /-- Mean anomaly along a resonant unperturbed orbit. -/ -noncomputable def resonantMeanAnomaly (p q : ℕ) (time : ℝ) : ℝ := +@[expose] noncomputable def resonantMeanAnomaly (p q : ℕ) (time : ℝ) : ℝ := resonantMeanMotion p q * time /-- Eccentric anomaly along a resonant unperturbed orbit. -/ -noncomputable def resonantEccentricAnomaly +@[expose] noncomputable def resonantEccentricAnomaly (p q : ℕ) (eccentricity time : ℝ) : ℝ := eccentricAnomaly eccentricity (resonantMeanAnomaly p q time) /-- Position of the resonant Kepler ellipse in the rotating frame. -/ -noncomputable def resonantRotatingEllipsePosition +@[expose] noncomputable def resonantRotatingEllipsePosition (p q : ℕ) (eccentricity time : ℝ) : ActionSpace := rotatingEllipsePosition (resonantFirstAction p q) eccentricity (resonantEccentricAnomaly p q eccentricity time) time diff --git a/LeanPool/PoincareThreeBody/RotatingEllipse.lean b/LeanPool/PoincareThreeBody/RotatingEllipse.lean index 8f33dc25e6..f467ee4c57 100644 --- a/LeanPool/PoincareThreeBody/RotatingEllipse.lean +++ b/LeanPool/PoincareThreeBody/RotatingEllipse.lean @@ -19,30 +19,31 @@ three-body Hamiltonian. This file verifies the radius and distance identities ne the first mass perturbation to a resonant Kepler orbit. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- Cartesian position on an inertial Kepler ellipse, with periapsis on the positive x-axis. -/ -noncomputable def inertialEllipsePosition +@[expose] noncomputable def inertialEllipsePosition (firstAction eccentricity anomaly : ℝ) : ActionSpace := ![firstAction ^ 2 * (Real.cos anomaly - eccentricity), firstAction ^ 2 * Real.sqrt (1 - eccentricity ^ 2) * Real.sin anomaly] /-- A planar position expressed in coordinates rotating counterclockwise through angle `time`. -/ +@[expose] noncomputable def positionInRotatingFrame (time : ℝ) (position : ActionSpace) : ActionSpace := ![Real.cos time * position 0 + Real.sin time * position 1, -Real.sin time * position 0 + Real.cos time * position 1] /-- Position of the Kepler ellipse in the rotating frame. -/ -noncomputable def rotatingEllipsePosition +@[expose] noncomputable def rotatingEllipsePosition (firstAction eccentricity anomaly time : ℝ) : ActionSpace := positionInRotatingFrame time (inertialEllipsePosition firstAction eccentricity anomaly) /-- Embed a planar position into phase space with zero placeholder momenta. The first mass perturbation depends only on position, so these momentum entries are immaterial. -/ -def positionPhasePoint (position : ActionSpace) : PhaseSpace := +@[expose] def positionPhasePoint (position : ActionSpace) : PhaseSpace := ![position 0, position 1, 0, 0] /-- A rotating elliptic position embedded in the restricted three-body phase space. -/ diff --git a/LeanPool/PoincareThreeBody/SafeAverageAnalytic.lean b/LeanPool/PoincareThreeBody/SafeAverageAnalytic.lean index da178a2a0f..a3559799c6 100644 --- a/LeanPool/PoincareThreeBody/SafeAverageAnalytic.lean +++ b/LeanPool/PoincareThreeBody/SafeAverageAnalytic.lean @@ -21,7 +21,7 @@ neighborhood. The compact parameter-integral theorem then gives analyticity of through the collision eccentricity. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PoincareThreeBody/SafeCollisionPhase.lean b/LeanPool/PoincareThreeBody/SafeCollisionPhase.lean index 770841c878..06afd99a0f 100644 --- a/LeanPool/PoincareThreeBody/SafeCollisionPhase.lean +++ b/LeanPool/PoincareThreeBody/SafeCollisionPhase.lean @@ -17,12 +17,12 @@ Shifting the aligned orientation by `π/q` puts it halfway between the possible The exclusion is ultimately the parity contradiction `1 + 2ql = 2pk`. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody /-- An orientation halfway between resonant collision phases. -/ -noncomputable def resonantSafeOrientation (p q : ℕ) : ℝ := +@[expose] noncomputable def resonantSafeOrientation (p q : ℕ) : ℝ := resonantCollisionOrientation p q + Real.pi / q theorem resonantCollisionEccentricity_apoapsis_identity diff --git a/LeanPool/PoincareThreeBody/ValidatedQuadrature.lean b/LeanPool/PoincareThreeBody/ValidatedQuadrature.lean index 81ebb0a6c6..58f3335d39 100644 --- a/LeanPool/PoincareThreeBody/ValidatedQuadrature.lean +++ b/LeanPool/PoincareThreeBody/ValidatedQuadrature.lean @@ -15,7 +15,7 @@ about the exact interval integral. They form the narrow interface through which computation can discharge a nonvanishing obligation in the Poincaré argument. -/ -@[expose] public section +public section namespace LeanPool.PoincareThreeBody diff --git a/LeanPool/PointwiseBirkhoff.lean b/LeanPool/PointwiseBirkhoff.lean index 5c990cf4f0..e8e925a69a 100644 --- a/LeanPool/PointwiseBirkhoff.lean +++ b/LeanPool/PointwiseBirkhoff.lean @@ -19,7 +19,7 @@ Tags: ergodic-theory, measure-theory, probability MSC: 37A30, 28D05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PointwiseBirkhoff/Main.lean b/LeanPool/PointwiseBirkhoff/Main.lean index 5e3b9e8025..2c2bbc0152 100644 --- a/LeanPool/PointwiseBirkhoff/Main.lean +++ b/LeanPool/PointwiseBirkhoff/Main.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.PointwiseBirkhoff.Main -/ -@[expose] public section +public section open scoped MeasureTheory @@ -315,7 +315,7 @@ lemma limsup_birkhoffAverage_nonpos_of_condexp_neg (hf : MeasurePreserving f μ exact divergentSet_zero_meas_of_condexp_neg μ h hf hφ hφ' /-- Conditional expectation of an observable onto the invariant measurable space of `f`. -/ -noncomputable def invCondexp +@[expose] noncomputable def invCondexp (μ : Measure α) (f : α → α) (φ : α → ℝ) : α → ℝ := μ[φ | invariants f] diff --git a/LeanPool/PolyaEnumerationTheorem.lean b/LeanPool/PolyaEnumerationTheorem.lean index 65ad2a32d5..fd5d0d527f 100644 --- a/LeanPool/PolyaEnumerationTheorem.lean +++ b/LeanPool/PolyaEnumerationTheorem.lean @@ -26,7 +26,7 @@ Tags: combinatorics, group-theory, enumeration MSC: 05A15, 20B30 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PolyaEnumerationTheorem/Basic.lean b/LeanPool/PolyaEnumerationTheorem/Basic.lean index 9ee992ce7e..9455ab267a 100644 --- a/LeanPool/PolyaEnumerationTheorem/Basic.lean +++ b/LeanPool/PolyaEnumerationTheorem/Basic.lean @@ -43,7 +43,7 @@ For additional information, refer to . -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/PolyaEnumerationTheorem/Concrete.lean b/LeanPool/PolyaEnumerationTheorem/Concrete.lean index 27bee031c9..5c0131240c 100644 --- a/LeanPool/PolyaEnumerationTheorem/Concrete.lean +++ b/LeanPool/PolyaEnumerationTheorem/Concrete.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # Numbers of distinct colorings for some concrete examples -/ -@[expose] public section +public section universe u v diff --git a/LeanPool/PolyaEnumerationTheorem/PermutationAuxiliary.lean b/LeanPool/PolyaEnumerationTheorem/PermutationAuxiliary.lean index e131e92161..0d1cce6af6 100644 --- a/LeanPool/PolyaEnumerationTheorem/PermutationAuxiliary.lean +++ b/LeanPool/PolyaEnumerationTheorem/PermutationAuxiliary.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # Auxiliary results on permutations -/ -@[expose] public section +public section universe u diff --git a/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean b/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean index 7a661d1850..9d7243285c 100644 --- a/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean +++ b/LeanPool/PolyaEnumerationTheorem/ReductionToFin.lean @@ -21,7 +21,7 @@ colors in `Y` under the induced group action of `G` on `Fin n`. This allows us t instead of more complex types when working with numbers of distinct colorings. -/ -@[expose] public section +public section universe u v w diff --git a/LeanPool/PolyaEnumerationTheorem/StirlingFirstKindSum.lean b/LeanPool/PolyaEnumerationTheorem/StirlingFirstKindSum.lean index 76f3374e15..421f774c13 100644 --- a/LeanPool/PolyaEnumerationTheorem/StirlingFirstKindSum.lean +++ b/LeanPool/PolyaEnumerationTheorem/StirlingFirstKindSum.lean @@ -22,7 +22,7 @@ For additional information, refer to . -/ -@[expose] public section +public section namespace LeanPool.PolyaEnumerationTheorem diff --git a/LeanPool/Polylean.lean b/LeanPool/Polylean.lean index caff107a0b..3a3892057f 100644 --- a/LeanPool/Polylean.lean +++ b/LeanPool/Polylean.lean @@ -43,4 +43,4 @@ Tags: algebra, group-theory, ring-theory, unit-conjecture MSC: 16S34, 20F65 -/ -@[expose] public section +public section diff --git a/LeanPool/Polylean/Complexes.lean b/LeanPool/Polylean/Complexes.lean index e46d72d9e5..dcd1590220 100644 --- a/LeanPool/Polylean/Complexes.lean +++ b/LeanPool/Polylean/Complexes.lean @@ -21,4 +21,4 @@ Import index for the Polylean complex and groupoid structures that are available without upstream `sorry`s. -/ -@[expose] public section +public section diff --git a/LeanPool/Polylean/Complexes/Constructions/UniversalCover.lean b/LeanPool/Polylean/Complexes/Constructions/UniversalCover.lean index a7b733b1af..aec855689f 100644 --- a/LeanPool/Polylean/Complexes/Constructions/UniversalCover.lean +++ b/LeanPool/Polylean/Complexes/Constructions/UniversalCover.lean @@ -8,7 +8,7 @@ module public import LeanPool.Polylean.Complexes.Structures.FreeGroupoid -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/Complexes/GraphPaths.lean b/LeanPool/Polylean/Complexes/GraphPaths.lean index d0d19038a8..ef90fb5360 100644 --- a/LeanPool/Polylean/Complexes/GraphPaths.lean +++ b/LeanPool/Polylean/Complexes/GraphPaths.lean @@ -12,7 +12,7 @@ public import Aesop.BuiltinRules # LeanPool.Polylean.Complexes.GraphPaths -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -31,7 +31,7 @@ variable {V : Type} {E : Type} {x₁ x₂ : V} /-- The terminal vertex of an edge, defined as the initial vertex of its reverse. -/ -@[inline] def term (graph : Graph V E) : E → V := +@[expose, inline] def term (graph : Graph V E) : E → V := fun e => graph.init (graph.bar e) /-- Edge paths in a graph, indexed by their initial and terminal vertices. -/ diff --git a/LeanPool/Polylean/Complexes/Structures/Category.lean b/LeanPool/Polylean/Complexes/Structures/Category.lean index 7149c4e29d..6c01f7af85 100644 --- a/LeanPool/Polylean/Complexes/Structures/Category.lean +++ b/LeanPool/Polylean/Complexes/Structures/Category.lean @@ -13,7 +13,7 @@ public import LeanPool.Polylean.Complexes.Structures.Quiver Imported Lean Pool material for `LeanPool.Polylean.Complexes.Structures.Category`. -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -68,7 +68,7 @@ attribute [simp] map_comp { obj := id, map := id, map_id := λ _ => rfl, map_comp := λ _ _ => rfl } /-- Composition of functors. -/ -def comp {C D E : Sort _} {𝓒 : Category C} {𝓓 : Category D} {𝓔 : Category E} +@[expose] def comp {C D E : Sort _} {𝓒 : Category C} {𝓓 : Category D} {𝓔 : Category E} (F : 𝓒 ⥤ 𝓓) (G : 𝓓 ⥤ 𝓔) : 𝓒 ⥤ 𝓔 := -- TODO Use `..` notation { obj := G.obj ∘ F.obj, map := G.map ∘ F.map, map_id := by intro; simp, map_comp := by intros; simp } @@ -93,7 +93,7 @@ namespace Path variable {C : Sort _} [𝓒 : Category C] /-- Compose the arrows appearing in a category path. -/ -def compose {X Y : C} : @Path C 𝓒.toQuiver X Y → (X ⟶ Y) +@[expose] def compose {X Y : C} : @Path C 𝓒.toQuiver X Y → (X ⟶ Y) | .nil => 𝟙 _ | .cons e p => e ≫ p.compose diff --git a/LeanPool/Polylean/Complexes/Structures/FreeGroupoid.lean b/LeanPool/Polylean/Complexes/Structures/FreeGroupoid.lean index 8ea84d68e2..80ecc4d7eb 100644 --- a/LeanPool/Polylean/Complexes/Structures/FreeGroupoid.lean +++ b/LeanPool/Polylean/Complexes/Structures/FreeGroupoid.lean @@ -7,7 +7,7 @@ module public import LeanPool.Polylean.Complexes.Structures.Groupoid -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/Complexes/Structures/Groupoid.lean b/LeanPool/Polylean/Complexes/Structures/Groupoid.lean index 870e4e2128..0cce485182 100644 --- a/LeanPool/Polylean/Complexes/Structures/Groupoid.lean +++ b/LeanPool/Polylean/Complexes/Structures/Groupoid.lean @@ -13,7 +13,7 @@ public import LeanPool.Polylean.Complexes.Structures.Category Imported Lean Pool material for `LeanPool.Polylean.Complexes.Structures.Groupoid`. -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/Complexes/Structures/Invertegory.lean b/LeanPool/Polylean/Complexes/Structures/Invertegory.lean index 583d36bd59..1a5b82fe83 100644 --- a/LeanPool/Polylean/Complexes/Structures/Invertegory.lean +++ b/LeanPool/Polylean/Complexes/Structures/Invertegory.lean @@ -7,7 +7,7 @@ module public import LeanPool.Polylean.Complexes.Structures.Category -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/Complexes/Structures/Quiver.lean b/LeanPool/Polylean/Complexes/Structures/Quiver.lean index 1755c55b98..17b8ff7706 100644 --- a/LeanPool/Polylean/Complexes/Structures/Quiver.lean +++ b/LeanPool/Polylean/Complexes/Structures/Quiver.lean @@ -5,7 +5,7 @@ Authors: Siddhartha Gadgil, Anand Rao -/ module -@[expose] public section +public section namespace LeanPool.Polylean @@ -85,7 +85,7 @@ abbrev snoc : {A B C : V} → Path A B → (B ⟶ C) → Path A C abbrev snoc' (A B C : V) : Path A B → (B ⟶ C) → Path A C := Path.snoc /-- Concatenation of paths. -/ -def append : {A B C : V} → Path A B → Path B C → Path A C +@[expose] def append : {A B C : V} → Path A B → Path B C → Path A C | _, _, _, .nil, p => p | _, _, _, .cons e p', p => cons e (append p' p) @@ -138,7 +138,7 @@ theorem length_append {A B C : V} : (p : Path A B) → (q : Path B C) → (appen simpa [Nat.succ_add] using congrArg Nat.succ (length_append p' q) /-- The end-point of the first edge in the path. -/ -def first : Path A B → V +@[expose] def first : Path A B → V | .nil' v => v | .cons' _ v _ _ _ => v diff --git a/LeanPool/Polylean/Complexes/Structures/TwoComplex.lean b/LeanPool/Polylean/Complexes/Structures/TwoComplex.lean index 6b9f440695..7b4a2f532e 100644 --- a/LeanPool/Polylean/Complexes/Structures/TwoComplex.lean +++ b/LeanPool/Polylean/Complexes/Structures/TwoComplex.lean @@ -7,7 +7,7 @@ module public import LeanPool.Polylean.Complexes.Structures.Groupoid -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/ConjInvLength.lean b/LeanPool/Polylean/ConjInvLength.lean index 9df02c8220..72569d235a 100644 --- a/LeanPool/Polylean/ConjInvLength.lean +++ b/LeanPool/Polylean/ConjInvLength.lean @@ -18,4 +18,4 @@ public import LeanPool.Polylean.ConjInvLength.WordTree Import index for the Polylean conjugacy-invariant length computations. -/ -@[expose] public section +public section diff --git a/LeanPool/Polylean/ConjInvLength/Length.lean b/LeanPool/Polylean/ConjInvLength/Length.lean index b60a16bb58..ef72a24b60 100644 --- a/LeanPool/Polylean/ConjInvLength/Length.lean +++ b/LeanPool/Polylean/ConjInvLength/Length.lean @@ -11,7 +11,7 @@ public import LeanPool.Polylean.ConjInvLength.LengthBound # LeanPool.Polylean.ConjInvLength.Length -/ -@[expose] public section +public section namespace LeanPool.Polylean open Letter diff --git a/LeanPool/Polylean/ConjInvLength/LengthBound.lean b/LeanPool/Polylean/ConjInvLength/LengthBound.lean index 35bcfde753..7afe42bc89 100644 --- a/LeanPool/Polylean/ConjInvLength/LengthBound.lean +++ b/LeanPool/Polylean/ConjInvLength/LengthBound.lean @@ -12,7 +12,7 @@ public import Mathlib.Tactic.ToAdditive # LeanPool.Polylean.ConjInvLength.LengthBound -/ -@[expose] public section +public section namespace LeanPool.Polylean /-- The four generators used for words in the conjugation-invariant length example. -/ @@ -96,7 +96,7 @@ termination_by l => l.length namespace Word /-- Conjugate a word by a letter. -/ -def conj : Word → Letter → Word := fun w l => [l] ++ w ++ [l⁻¹] +@[expose] def conj : Word → Letter → Word := fun w l => [l] ++ w ++ [l⁻¹] end Word diff --git a/LeanPool/Polylean/ConjInvLength/LengthNode.lean b/LeanPool/Polylean/ConjInvLength/LengthNode.lean index 29d671a6cc..5c9327cd22 100644 --- a/LeanPool/Polylean/ConjInvLength/LengthNode.lean +++ b/LeanPool/Polylean/ConjInvLength/LengthNode.lean @@ -11,7 +11,7 @@ public import LeanPool.Polylean.ConjInvLength.Length # Cached proof nodes for conjugacy-invariant length bounds -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/ConjInvLength/MemoLength.lean b/LeanPool/Polylean/ConjInvLength/MemoLength.lean index ef49b8af99..6b841993ff 100644 --- a/LeanPool/Polylean/ConjInvLength/MemoLength.lean +++ b/LeanPool/Polylean/ConjInvLength/MemoLength.lean @@ -11,7 +11,7 @@ public import LeanPool.Polylean.ConjInvLength.LengthBound # LeanPool.Polylean.ConjInvLength.MemoLength -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/ConjInvLength/ProvedBound.lean b/LeanPool/Polylean/ConjInvLength/ProvedBound.lean index 5b20372b03..295e50f497 100644 --- a/LeanPool/Polylean/ConjInvLength/ProvedBound.lean +++ b/LeanPool/Polylean/ConjInvLength/ProvedBound.lean @@ -12,7 +12,7 @@ import Batteries.Logic # LeanPool.Polylean.ConjInvLength.ProvedBound -/ -@[expose] public section +public section namespace LeanPool.Polylean open Letter @@ -63,13 +63,13 @@ def provedSplits (z : Letter) : (w : Word) → List (ProvedSplit z w) abbrev Length := Word → Nat /-- A length function invariant under conjugation by letters. -/ -def conjInv (l : Length) : Prop := (x : Letter) → (g : Word) → l (g^x) = l (g) +@[expose] def conjInv (l : Length) : Prop := (x : Letter) → (g : Word) → l (g^x) = l (g) /-- The triangle inequality for a length function. -/ -def triangIneq (l : Length) : Prop := (g h : Word) → l (g ++ h) ≤ l g + l h +@[expose] def triangIneq (l : Length) : Prop := (g h : Word) → l (g ++ h) ≤ l g + l h /-- A length function normalized on single letters. -/ -def normalized (l : Length) : Prop := (x : Letter) → l [x] = 1 +@[expose] def normalized (l : Length) : Prop := (x : Letter) → l [x] = 1 /-- A length function that sends the empty word to zero. -/ def emptyWord (l : Length) : Prop := l [] = 0 diff --git a/LeanPool/Polylean/ConjInvLength/WordTree.lean b/LeanPool/Polylean/ConjInvLength/WordTree.lean index b7e2e43ccd..0f4bd15a4f 100644 --- a/LeanPool/Polylean/ConjInvLength/WordTree.lean +++ b/LeanPool/Polylean/ConjInvLength/WordTree.lean @@ -11,7 +11,7 @@ public import LeanPool.Polylean.ConjInvLength.ProvedBound # LeanPool.Polylean.ConjInvLength.WordTree -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/Polymath.lean b/LeanPool/Polylean/Polymath.lean index ecceb79f45..605bf3d340 100644 --- a/LeanPool/Polylean/Polymath.lean +++ b/LeanPool/Polylean/Polymath.lean @@ -12,7 +12,7 @@ public import Mathlib.Algebra.Group.Defs # Demonstration executable for Polylean length computations -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/UnitConjecture.lean b/LeanPool/Polylean/UnitConjecture.lean index d0b8ff44fa..918c4f7be3 100644 --- a/LeanPool/Polylean/UnitConjecture.lean +++ b/LeanPool/Polylean/UnitConjecture.lean @@ -72,4 +72,4 @@ checking equality on a basis for finitely generated abelian groups. homomorphisms on finitely generated free abelian groups. -/ -@[expose] public section +public section diff --git a/LeanPool/Polylean/UnitConjecture/AddFreeGroup.lean b/LeanPool/Polylean/UnitConjecture/AddFreeGroup.lean index 6229578664..d5f7d8ca97 100644 --- a/LeanPool/Polylean/UnitConjecture/AddFreeGroup.lean +++ b/LeanPool/Polylean/UnitConjecture/AddFreeGroup.lean @@ -26,7 +26,7 @@ homomorphisms on finitely generated free groups. - `prodFree` - a proof that the product of free groups is free. -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -63,7 +63,7 @@ instance ℤFree : AddFreeGroup ℤ Unit where open EnumDecide in /-- Equality of homomorphisms from a free group on an exhaustively searchable basis is decidable. -/ -def decideHomsEqual {F : Type _} [AddCommGroup F] {X : Type _} [DecideForall X] +@[expose] def decideHomsEqual {F : Type _} [AddCommGroup F] {X : Type _} [DecideForall X] [fgp : AddFreeGroup F X] {A : Type _} [AddCommGroup A] [DecidableEq A] : DecidableEq (F →+ A) := fun f g => if c : ∀ x : X, f (fgp.ι x) = g (fgp.ι x) then diff --git a/LeanPool/Polylean/UnitConjecture/Cocycle.lean b/LeanPool/Polylean/UnitConjecture/Cocycle.lean index 39bcfad017..6609dc24fa 100644 --- a/LeanPool/Polylean/UnitConjecture/Cocycle.lean +++ b/LeanPool/Polylean/UnitConjecture/Cocycle.lean @@ -30,7 +30,7 @@ Metabelian construction. argument and the action as a field of the structure. -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/UnitConjecture/EnumDecide.lean b/LeanPool/Polylean/UnitConjecture/EnumDecide.lean index b140a89e25..266a02fe57 100644 --- a/LeanPool/Polylean/UnitConjecture/EnumDecide.lean +++ b/LeanPool/Polylean/UnitConjecture/EnumDecide.lean @@ -5,7 +5,7 @@ Authors: Siddhartha Gadgil, Anand Rao -/ module -@[expose] public section +public section namespace LeanPool.Polylean @@ -59,7 +59,7 @@ def decideBelow (p : Nat → Prop) [DecidablePred p] (bound : Nat) : It is possible to check whether a decidable predicate on `Fin m` holds below a given natural-number bound. -/ -def decideBelowFin {m : Nat} (p : Fin m → Prop) [DecidablePred p] (bound : Nat) : +@[expose] def decideBelowFin {m : Nat} (p : Fin m → Prop) [DecidablePred p] (bound : Nat) : Decidable (∀ n : Fin m, n < bound → p n) := match bound with | 0 => .isTrue (fun _ bd => absurd bd (Nat.not_lt_zero _)) @@ -82,7 +82,7 @@ def decideBelowFin {m : Nat} (p : Fin m → Prop) [DecidablePred p] (bound : Nat .isFalse (fun contra => hyp (fun n bd => contra n (Nat.le_succ_of_le bd))) /-- It is possible to decide whether a predicate holds for all elements of `Fin n`. -/ -def decideFin {m : Nat} (p : Fin m → Prop) [DecidablePred p] : +@[expose] def decideFin {m : Nat} (p : Fin m → Prop) [DecidablePred p] : Decidable (∀ n : Fin m, p n) := match decideBelowFin p m with | .isTrue hyp => .isTrue (fun ⟨n, ineq⟩ => hyp ⟨n, ineq⟩ ineq) @@ -111,7 +111,7 @@ example : ∀ x y : Fin 3, x + y = y + x := by decide example : ∀ x y z : Fin 3, (x + y) + z = x + (y + z) := by decide -@[reducible, instance] +@[reducible, instance, expose] def decideProd {α β : Type _} [dfa : DecideForall α] [dfb : DecideForall β] (p : α × β → Prop) [DecidablePred p] : Decidable (∀ xy : α × β, p xy) := if c: (∀ x: α, ∀ y : β, p (x, y)) then diff --git a/LeanPool/Polylean/UnitConjecture/FreeModule.lean b/LeanPool/Polylean/UnitConjecture/FreeModule.lean index ef1f37e0c3..7c3be33e0f 100644 --- a/LeanPool/Polylean/UnitConjecture/FreeModule.lean +++ b/LeanPool/Polylean/UnitConjecture/FreeModule.lean @@ -29,7 +29,7 @@ We also give an alternative description via moves, which is more convenient for properties. -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -70,7 +70,7 @@ The definition of coordinate functions is in two steps. We first define the coor -/ /-- Coordinates for a formal sum with one term. -/ -def monomCoeff (R X : Type _) [Ring R] [DecidableEq X] (x₀ : X) (nx : R × X) : R := +@[expose] def monomCoeff (R X : Type _) [Ring R] [DecidableEq X] (x₀ : X) (nx : R × X) : R := match (nx.2 == x₀) with | true => nx.1 | false => 0 @@ -98,7 +98,7 @@ theorem monom_coords_at_zero (x₀ x : X) : monomCoeff R X x₀ (0, x) = 0 := by cases x == x₀ <;> rfl /-- The coordinates for a formal sum. -/ -def _root_.LeanPool.Polylean.FormalSum.coords : FormalSum R X → X → R +@[expose] def _root_.LeanPool.Polylean.FormalSum.coords : FormalSum R X → X → R | [], _ => 0 | h :: t, x₀ => monomCoeff R X x₀ h + coords t x₀ @@ -261,7 +261,7 @@ end FormalSum * We show this is an equivalence relation and define the quotient -/ /-- Relation by equal coordinates. -/ -def eqlCoords (R X : Type) [Ring R] [DecidableEq X] (s₁ s₂ : FormalSum R X) : Prop := +@[expose] def eqlCoords (R X : Type) [Ring R] [DecidableEq X] (s₁ s₂ : FormalSum R X) : Prop := s₁.coords = s₂.coords namespace eqlCoords @@ -453,6 +453,7 @@ theorem equal_coords_of_approx (s₁ s₂ : FormalSum R X) : fun hyp => funext fun x₀ => congrFun hyp x₀ /-- coordinates for the quotient -/ +@[expose] def coordinates (x₀ : X) : R[X] → R := by apply Quotient.lift (fun s : FormalSum R X => s.coords x₀) intro a b hyp @@ -540,7 +541,7 @@ theorem append_equiv (s₁ s₂ t₁ t₂ : FormalSum R X) : end FormalSum /-- Addition of elements in the free module. -/ -def _root_.LeanPool.Polylean.FreeModule.add : R[X] → R[X] → R[X] := by +@[expose] def _root_.LeanPool.Polylean.FreeModule.add : R[X] → R[X] → R[X] := by let f : FormalSum R X → FormalSum R X → R[X] := fun s₁ s₂ => ⟦s₁ ++ s₂⟧ apply Quotient.lift₂ f intro a₁ b₁ a₂ b₂ @@ -644,7 +645,7 @@ theorem addn_assoc (x₁ x₂ x₃ : R[X]) : (x₁ + x₂) + x₃ = x₁ + (x₂ apply add_assoc_aux /-- The zero element of the free module. -/ -def zero : R[X] := ⟦[]⟧ +@[expose] def zero : R[X] := ⟦[]⟧ /-- adding zero -/ theorem addn_zero (x : R[X]) : x + zero = x := by @@ -1132,7 +1133,7 @@ theorem monom_coeff_eq_of_coord_eq (x : X) (a₀ a₁ : R) : /-- For `x: X`, the functions `a : R ↦ ⟦[(a, x)]⟧` -/ -def coeffInclusion (x₀ : X) : R → R[X] := +@[expose] def coeffInclusion (x₀ : X) : R → R[X] := fun a₀ => ⟦[(a₀, x₀)]⟧ /-- Injectivity of `coeffInclusion` -/ @@ -1145,7 +1146,7 @@ theorem coeffInclusion_injective (x₀ : X) exact monom_coeff_eq_of_coord_eq x₀ a₀ a₁ hyp /-- For `a: A`, the function `x: X ↦ ⟦[(a, x)]⟧` -/ -def baseInclusion (a₀ : R) : X → R[X] := +@[expose] def baseInclusion (a₀ : R) : X → R[X] := fun x₀ => ⟦[(a₀, x₀)]⟧ /-- Injectivity of `baseInclusion a` give `a ≠0` -/ diff --git a/LeanPool/Polylean/UnitConjecture/GardamGroup.lean b/LeanPool/Polylean/UnitConjecture/GardamGroup.lean index 50b9ac2ab6..865f6415fd 100644 --- a/LeanPool/Polylean/UnitConjecture/GardamGroup.lean +++ b/LeanPool/Polylean/UnitConjecture/GardamGroup.lean @@ -26,7 +26,7 @@ This is done via the cocycle construction, using the explicit action and cocycle Section 3.1 of Giles Gardam's paper (https: //arxiv.org/abs/2102.11818). -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -83,17 +83,13 @@ namespace Q /-! The elements of the Klein Four group `Q`. -/ /-- The identity element of `Q`. -/ -@[match_pattern] -def e : Q := (⟨0, by decide⟩, ⟨0, by decide⟩) +@[expose, match_pattern] def e : Q := (⟨0, by decide⟩, ⟨0, by decide⟩) /-- The first generator of `Q`. -/ -@[match_pattern] -def a : Q := (⟨1, by decide⟩, ⟨0, by decide⟩) +@[expose, match_pattern] def a : Q := (⟨1, by decide⟩, ⟨0, by decide⟩) /-- The second generator of `Q`. -/ -@[match_pattern] -def b : Q := (⟨0, by decide⟩, ⟨1, by decide⟩) +@[expose, match_pattern] def b : Q := (⟨0, by decide⟩, ⟨1, by decide⟩) /-- The product of the first two generators of `Q`. -/ -@[match_pattern] -def c : Q := (⟨1, by decide⟩, ⟨1, by decide⟩) +@[expose, match_pattern] def c : Q := (⟨1, by decide⟩, ⟨1, by decide⟩) end Q @@ -115,8 +111,7 @@ local infixr: 100 " × " => AddMonoidHom.prodMap /-- The action of `Q` on `K` by automorphisms. The action can be given a component-wise description in terms of `id` and `neg`, the identity and negation homomorphisms. -/ -@[aesop norm unfold (rule_sets := [P]), reducible] -def action : Q → (K →+ K) +@[expose, aesop norm unfold (rule_sets := [P]), reducible] def action : Q → (K →+ K) | .e => .id ℤ × .id ℤ × .id ℤ | .a => .id ℤ × neg ℤ × neg ℤ | .b => neg ℤ × .id ℤ × neg ℤ @@ -133,8 +128,7 @@ instance : AutAction action := open K Q in /-- The cocycle in the construction of `P`. -/ -@[aesop norm unfold (rule_sets := [P]), reducible] -def cocycle : Q → Q → K +@[expose, aesop norm unfold (rule_sets := [P]), reducible] def cocycle : Q → Q → K | a , a => x | a , c => x | b , b => y @@ -159,7 +153,7 @@ The construction of the group `P` as a Metabelian group from the given action an -/ /-- the group `P` constructed via the cocycle construction -/ -@[aesop norm unfold (rule_sets := [P])] +@[expose, aesop norm unfold (rule_sets := [P])] def P := K × Q namespace P diff --git a/LeanPool/Polylean/UnitConjecture/GardamTheorem.lean b/LeanPool/Polylean/UnitConjecture/GardamTheorem.lean index d81aba7835..f5a2b386cd 100644 --- a/LeanPool/Polylean/UnitConjecture/GardamTheorem.lean +++ b/LeanPool/Polylean/UnitConjecture/GardamTheorem.lean @@ -26,7 +26,7 @@ result of `TorsionFree` -- that `P` is torsion-free, this completes the formal proof of Gardam's theorem that Kaplansky's Unit Conjecture is false. -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/UnitConjecture/GroupRing.lean b/LeanPool/Polylean/UnitConjecture/GroupRing.lean index 4ce33baeb1..0c87ed2411 100644 --- a/LeanPool/Polylean/UnitConjecture/GroupRing.lean +++ b/LeanPool/Polylean/UnitConjecture/GroupRing.lean @@ -23,7 +23,7 @@ to show invariance under elementary moves and to prove that `R[G]` is a ring. -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -451,7 +451,7 @@ theorem groupRingMul_apply {R G : Type _} [Ring R] [DecidableEq G] [DecidableEq (r : R) (g : G) : r * g = (⟦[(r, g)]⟧ : FreeModule R G) := rfl /-- Monoid homomorphism from `G` to `R[G]` given by `g ↦ 1 ⬝ g` -/ -def groupInclusionHom (G : Type) [Group G] [DecidableEq G] : G →* R[G] := +@[expose] def groupInclusionHom (G : Type) [Group G] [DecidableEq G] : G →* R[G] := { toFun := baseInclusion 1, map_one' := rfl, map_mul' := @@ -484,7 +484,7 @@ theorem groupInclusionHom_injective {F : Type} [Field F] [DecidableEq F] simp_all /-- The ring homomorphism `R → R[G]` given by `a ↦ a ⬝ 1` -/ -def ringInclusionHom (G : Type) [Group G] [DecidableEq G] : R →+* R[G] := +@[expose] def ringInclusionHom (G : Type) [Group G] [DecidableEq G] : R →+* R[G] := { toFun := coeffInclusion 1, map_one' := rfl, map_mul' := diff --git a/LeanPool/Polylean/UnitConjecture/MetabelianGroup.lean b/LeanPool/Polylean/UnitConjecture/MetabelianGroup.lean index 6260836d40..7f04bb964d 100644 --- a/LeanPool/Polylean/UnitConjecture/MetabelianGroup.lean +++ b/LeanPool/Polylean/UnitConjecture/MetabelianGroup.lean @@ -30,7 +30,7 @@ We define the cocycle condition and construct a group structure on a structure e The main step is to show that the cocyle condition implies associativity. -/ -@[expose] public section +public section namespace LeanPool.Polylean @@ -42,17 +42,17 @@ variable (c : Q → Q → K) [ccl : Cocycle c] /-- The multiplication operation defined using the cocycle. The cocycle condition is crucially used in showing associativity and other properties. -/ -@[reducible, aesop norm unfold (rule_sets := [Metabelian])] +@[expose, reducible, aesop norm unfold (rule_sets := [Metabelian])] def mul : (K × Q) → (K × Q) → (K × Q) | (k, q), (k', q') => (k + ccl.α q k' + c q q', q + q') /-- The identity element of the Metabelian group, which is the ordered pair of the identities of the individual groups. -/ -@[reducible, aesop norm unfold (rule_sets := [Metabelian])] +@[expose, reducible, aesop norm unfold (rule_sets := [Metabelian])] def e : K × Q := (0, 0) /-- The inverse operation of the Metabelian group. -/ -@[reducible, aesop norm unfold (rule_sets := [Metabelian])] +@[expose, reducible, aesop norm unfold (rule_sets := [Metabelian])] def inv : K × Q → K × Q | (k, q) => (- (ccl.α (-q) (k + c q (-q))), -q) @@ -94,7 +94,7 @@ theorem mul_assoc : ∀ (g g' g'' : K × Q), mul c (mul c g g') g'' = mul c g (m · apply add_assoc /-- A group structure on `K × Q` using the above multiplication operation. -/ -@[reducible] +@[reducible, expose] def metabelianGroup : Group (K × Q) := { mul := mul c, diff --git a/LeanPool/Polylean/UnitConjecture/Tactics.lean b/LeanPool/Polylean/UnitConjecture/Tactics.lean index a17e2488b3..6955fada96 100644 --- a/LeanPool/Polylean/UnitConjecture/Tactics.lean +++ b/LeanPool/Polylean/UnitConjecture/Tactics.lean @@ -16,4 +16,4 @@ public import LeanPool.Polylean.UnitConjecture.Tactics.ReduceGoal Import-only index for the local Aesop rule sets used by the Unit Conjecture formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/Polylean/UnitConjecture/Tactics/AesopRuleSets.lean b/LeanPool/Polylean/UnitConjecture/Tactics/AesopRuleSets.lean index 8873cb968c..2eebe9b54a 100644 --- a/LeanPool/Polylean/UnitConjecture/Tactics/AesopRuleSets.lean +++ b/LeanPool/Polylean/UnitConjecture/Tactics/AesopRuleSets.lean @@ -13,7 +13,7 @@ import Aesop.Frontend.Command Imported Lean Pool material for `LeanPool.Polylean.UnitConjecture.Tactics.AesopRuleSets`. -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/Polylean/UnitConjecture/TorsionFree.lean b/LeanPool/Polylean/UnitConjecture/TorsionFree.lean index 465f574751..a5cab48858 100644 --- a/LeanPool/Polylean/UnitConjecture/TorsionFree.lean +++ b/LeanPool/Polylean/UnitConjecture/TorsionFree.lean @@ -34,7 +34,7 @@ Roughly, the steps are as follows (further details can be found in the correspon 5. Together, these statements show that `P` is torsion-free. -/ -@[expose] public section +public section namespace LeanPool.Polylean diff --git a/LeanPool/PolynomialMethodRestrictedSums.lean b/LeanPool/PolynomialMethodRestrictedSums.lean index dd3f5f35e6..495a44f97c 100644 --- a/LeanPool/PolynomialMethodRestrictedSums.lean +++ b/LeanPool/PolynomialMethodRestrictedSums.lean @@ -29,7 +29,7 @@ Tags: combinatorics, polynomial-method, alon-tarsi, restricted-sums, congruence- MSC: 11B30, 11B75, 11P70 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean index fc61729765..a5a7cf3969 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean @@ -20,7 +20,7 @@ theorem `ANR_polynomial_method` giving a non-vanishing-coefficient criterion for lower-bounding restricted sumsets. -/ -@[expose] public section +public section open scoped Finset diff --git a/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean b/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean index 8e8ff9c42c..9fed96c950 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean @@ -27,7 +27,7 @@ Derives the Cauchy-Davenport theorem `cauchy_davenport` on sumsets in `ZMod p` from the Alon-Nathanson-Ruzsa polynomial method. -/ -@[expose] public section +public section open Finsupp open scoped Finset diff --git a/LeanPool/PolynomialMethodRestrictedSums/CompressedSizesRestrictedSum.lean b/LeanPool/PolynomialMethodRestrictedSums/CompressedSizesRestrictedSum.lean index b32ddae6c4..4cd47337b7 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/CompressedSizesRestrictedSum.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/CompressedSizesRestrictedSum.lean @@ -21,7 +21,7 @@ The main theorem of this file was originally proved by Aristotle (Lean v4.24.0, project request uuid 08cb15be-5c46-4619-9dbf-e523d453b544). -/ -@[expose] public section +public section open MvPolynomial diff --git a/LeanPool/PolynomialMethodRestrictedSums/DiasDaSilvaHamidoune.lean b/LeanPool/PolynomialMethodRestrictedSums/DiasDaSilvaHamidoune.lean index c41836cdf7..2466b2ad72 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/DiasDaSilvaHamidoune.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/DiasDaSilvaHamidoune.lean @@ -22,7 +22,7 @@ The main theorem of this file was originally proved by Aristotle (Lean v4.24.0, project request uuid 7257b62c-6371-4fa8-a5b5-ea19029f0f1f). -/ -@[expose] public section +public section open MvPolynomial diff --git a/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean b/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean index d192b68729..0449b48f05 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean @@ -24,7 +24,7 @@ set of sums `a 0 + ... + a k` with `a i ∈ A i` pairwise distinct, when the sets `A i` have distinct sizes. -/ -@[expose] public section +public section open MvPolynomial open AddMonoidAlgebra (coeff) @@ -40,7 +40,7 @@ variable {R : Type*} [CommRing R] variable {p : ℕ} [Fact (Nat.Prime p)] {k : ℕ} /-- S = {a + ... + a | a ∈ A, a ≠ a for all i ≠ j} -/ -def restrictedSumSet (k : ℕ) (A : Fin (k + 1) → Finset (ZMod p)) : Finset (ZMod p) := +@[expose] def restrictedSumSet (k : ℕ) (A : Fin (k + 1) → Finset (ZMod p)) : Finset (ZMod p) := ((Fintype.piFinset A).filter fun f => ∀ (i j : Fin (k + 1)), i < j → f i ≠ f j) |>.image (fun f => ∑ i, f i) @@ -54,7 +54,7 @@ noncomputable def vandermondePolynomial (k : ℕ) : MvPolynomial (Fin (k + 1)) ( /-- (Used in CompressedSizesRestrictedSum and DiasDaSilvaHamidoune) The compressed sizes b'_i defined recursively: b'_0 = b_0, b'_i = min{b'_{i-1} - 1, b_i} for i ≥ 1 -/ -def compressedSizes (b : Fin (k + 1) → ℕ) : Fin (k + 1) → ℕ := +@[expose] def compressedSizes (b : Fin (k + 1) → ℕ) : Fin (k + 1) → ℕ := fun i => match i with | 0 => b 0 diff --git a/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean b/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean index 40fb1286b7..8444264f69 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean @@ -22,7 +22,7 @@ Lemma 3.1 of Alon-Nathanson-Ruzsa: a closed form for the coefficient of culminating in `Vandermonde_coefficient_formula`. -/ -@[expose] public section +public section open MvPolynomial open AddMonoidAlgebra (coeff) @@ -46,13 +46,13 @@ def fallingFactorialMatrix (c : Fin (k + 1) → ℕ) : Matrix (Fin (k + 1)) (Fin Matrix.of (fun i j : Fin (k + 1) => (fallingFactorial (c i) j : ℚ)) /-- Expected value: m! / (∏ c!) * ∏_{i>j} (c - c) -/ -def expectedValue (c : Fin (k + 1) → ℕ) (m : ℕ) : ℚ := +@[expose] def expectedValue (c : Fin (k + 1) → ℕ) (m : ℕ) : ℚ := (m.factorial : ℚ) * (∏ i : Fin (k + 1), ∏ j : Fin (k + 1), if j.val < i.val then ((c i : ℚ) - (c j : ℚ)) else 1) / (∏ i : Fin (k + 1), ((c i).factorial : ℚ)) /-- Convert a function c : Fin (k + 1) → ℕ to Finsupp -/ -def toFinsupp (c : Fin (k + 1) → ℕ) : (Fin (k + 1)) →₀ ℕ := +@[expose] def toFinsupp (c : Fin (k + 1) → ℕ) : (Fin (k + 1)) →₀ ℕ := ⟨Finset.univ.filter (fun i => c i ≠ 0), c, fun i => by simp⟩ /- Vandermonde Coefficient Formula (Lemma 3.1): diff --git a/LeanPool/Polytopes.lean b/LeanPool/Polytopes.lean index 6a94a56a0d..34c649a3e0 100644 --- a/LeanPool/Polytopes.lean +++ b/LeanPool/Polytopes.lean @@ -18,7 +18,7 @@ Tags: convex-geometry, discrete-geometry, polytopes MSC: 52B11, 52A20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Polytopes/Cutspace.lean b/LeanPool/Polytopes/Cutspace.lean index 30ad86653b..489d0e73c0 100644 --- a/LeanPool/Polytopes/Cutspace.lean +++ b/LeanPool/Polytopes/Cutspace.lean @@ -12,14 +12,14 @@ import LeanPool.Polytopes.Pre Cut spaces obtained by intersecting collections of halfspaces. -/ -@[expose] public section +public section open Module variable {E : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The cut space of a set of halfspaces: the intersection of all of them. -/ -def cutSpace (H_ : Set (Halfspace E)) : Set E := ⋂₀ (SetLike.coe '' H_) +@[expose] def cutSpace (H_ : Set (Halfspace E)) : Set E := ⋂₀ (SetLike.coe '' H_) lemma Convex_cutSpace (H_ : Set (Halfspace E)) : Convex ℝ (cutSpace H_) := by apply convex_sInter diff --git a/LeanPool/Polytopes/Halfspace.lean b/LeanPool/Polytopes/Halfspace.lean index 00270cd29a..a27d8fcbba 100644 --- a/LeanPool/Polytopes/Halfspace.lean +++ b/LeanPool/Polytopes/Halfspace.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Normed.Module.HahnBanach Halfspaces in inner product spaces and their basic geometric operations. -/ -@[expose] public section +public section open Pointwise @@ -139,7 +139,7 @@ instance Halfspace.SetLike : SetLike (Halfspace E) E where exact ⟨ le_refl _, not_le_of_gt <| lt_of_le_of_ne hmax2 h ⟩ /-- The coercion of a halfspace to a set equals the sublevel preimage of its functional. -/ -lemma Halfspace.h (H_ : Halfspace E) : ↑H_ = H_.f.1 ⁻¹' {x | x ≤ H_.α} := rfl +lemma Halfspace.h (H_ : Halfspace E) : ↑H_ = H_.f.1 ⁻¹' {x | x ≤ H_.α} := by rfl lemma Halfspace_mem (H_ : Halfspace E) : ∀ x, x ∈ (SetLike.coe H_) ↔ H_.f.1 x ≤ H_.α := by intro x diff --git a/LeanPool/Polytopes/MainTheorem.lean b/LeanPool/Polytopes/MainTheorem.lean index 4ae0d830a8..4e36d99bd1 100644 --- a/LeanPool/Polytopes/MainTheorem.lean +++ b/LeanPool/Polytopes/MainTheorem.lean @@ -20,7 +20,7 @@ Let 𝑋 be a closed convex subset of ℝ^𝑑. Then: Theorem : Every 𝑉-polytope is an 𝐻-polytope, and every compact 𝐻-polytope is a 𝑉-polytope. -/ -@[expose] public section +public section variable {E : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] open Pointwise @@ -421,7 +421,7 @@ def translationHomeo (x : E) : E ≃ₜ E where omit [InnerProductSpace ℝ E] [CompleteSpace E] in lemma translationHomeo.toFun.def (x : E) : - ↑(translationHomeo x) = (· + x) := rfl + ↑(translationHomeo x) = (· + x) := by rfl lemma Hpolytope_of_Vpolytope_interior [FiniteDimensional ℝ E] {S : Set E} (hS : S.Finite) (hVinteriorNonempty : (interior (Vpolytope hS)).Nonempty) : diff --git a/LeanPool/Polytopes/Polar.lean b/LeanPool/Polytopes/Polar.lean index d320a1e057..d47d235d7f 100644 --- a/LeanPool/Polytopes/Polar.lean +++ b/LeanPool/Polytopes/Polar.lean @@ -13,12 +13,12 @@ import Mathlib.Analysis.LocallyConvex.Separation Polar duals and their compactness properties. -/ -@[expose] public section +public section variable {E : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /-- The unit dual functional in the direction of a nonzero vector `p`. -/ -noncomputable def pointDualLin (p : {p : E // p ≠ 0}) : +@[expose] noncomputable def pointDualLin (p : {p : E // p ≠ 0}) : {f : (StrongDual ℝ E) // norm f = 1} := ⟨ (InnerProductSpace.toDual ℝ _ ((norm p.1)⁻¹ • p.1)), (by simp only [ne_eq, map_smulₛₗ, map_inv₀, RCLike.conj_to_real] @@ -37,7 +37,9 @@ lemma pointDual.α (p : {p : E // p ≠ 0}) : lemma pointDual.h (p : {p : E // p ≠ 0}) : (pointDual p) = - (InnerProductSpace.toDual ℝ _ ((norm p.1)⁻¹ • p.1)) ⁻¹' {x | x ≤ (norm p.1)⁻¹} := by rfl + (InnerProductSpace.toDual ℝ _ ((norm p.1)⁻¹ • p.1)) ⁻¹' {x | x ≤ (norm p.1)⁻¹} := by + rw [Halfspace.h] + rfl lemma pointDual_origin (p : {p : E // p ≠ 0}) : (0 : E) ∈ (SetLike.coe <| pointDual p) := by @@ -58,7 +60,7 @@ lemma pointDual_comm (p q : {p : E // p ≠ 0}) : /-- The polar dual of a set `X`: `{v | ∀ x ∈ X, inner x v ≤ 1}`. -/ -noncomputable def polarDual (X : Set E) : Set E := +@[expose] noncomputable def polarDual (X : Set E) : Set E := ⋂₀ (SetLike.coe '' (pointDual '' (Subtype.val ⁻¹' X))) lemma polarDual_closed (X : Set E) : IsClosed (polarDual X) := by diff --git a/LeanPool/Polytopes/Polytope.lean b/LeanPool/Polytopes/Polytope.lean index cf7489e141..cb70cf9c55 100644 --- a/LeanPool/Polytopes/Polytope.lean +++ b/LeanPool/Polytopes/Polytope.lean @@ -13,7 +13,7 @@ import LeanPool.Polytopes.Cutspace Definitions and basic properties of V-polytopes and H-polytopes. -/ -@[expose] public section +public section variable {E : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] open Pointwise Module @@ -23,7 +23,7 @@ open Pointwise Module The finiteness witness is recorded as it characterises the polytope and is used by the surrounding API, even though the convex hull itself does not depend on it. -/ -def Vpolytope {S : Set E} (hS : S.Finite) : Set E := +@[expose] def Vpolytope {S : Set E} (hS : S.Finite) : Set E := (fun _ : S.Finite => convexHull ℝ S) hS omit [CompleteSpace E] in @@ -47,7 +47,7 @@ lemma Compact_Vpolytope {S : Set E} (hS : S.Finite) : The finiteness witness is recorded as it characterises the polytope and is used by the surrounding API, even though the intersection itself does not depend on it. -/ -def Hpolytope {H_ : Set (Halfspace E)} (hH_ : H_.Finite) : Set E := +@[expose] def Hpolytope {H_ : Set (Halfspace E)} (hH_ : H_.Finite) : Set E := (fun _ : H_.Finite => ⋂₀ (SetLike.coe '' H_)) hH_ @[simp] diff --git a/LeanPool/Polytopes/Pre.lean b/LeanPool/Polytopes/Pre.lean index 1bba341e6e..aeaff9892f 100644 --- a/LeanPool/Polytopes/Pre.lean +++ b/LeanPool/Polytopes/Pre.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.GCD Preliminary lemmas and definitions used by the Polytopes formalization. -/ -@[expose] public section +public section open Pointwise Module @@ -103,7 +103,7 @@ def Equiv.VSubconst {E P : Type} [AddCommGroup E] [AddTorsor E P] (x : P) : P right_inv := fun y => by simp lemma Equiv.coe_VSubconst {E P : Type} [AddCommGroup E] [AddTorsor E P] - (x : P) : ↑(Equiv.VSubconst x) = (· -ᵥ x) := rfl + (x : P) : ↑(Equiv.VSubconst x) = (· -ᵥ x) := by rfl /-- The affine equivalence `P ≃ᵃ[𝕜] E` sending a point `p` to the vector `p -ᵥ x`. -/ def AffineEquiv.VSubconst (𝕜 : Type) {E P : Type} [Field 𝕜] [AddCommGroup E] [Module 𝕜 E] @@ -114,13 +114,14 @@ def AffineEquiv.VSubconst (𝕜 : Type) {E P : Type} [Field 𝕜] [AddCommGroup lemma AffineEquiv.Vsubconst_toEquiv (𝕜 : Type) {E P : Type} [Field 𝕜] [AddCommGroup E] [Module 𝕜 E] [AddTorsor E P] (x : P) : - (AffineEquiv.VSubconst 𝕜 x).toEquiv = Equiv.VSubconst x := rfl + (AffineEquiv.VSubconst 𝕜 x).toEquiv = Equiv.VSubconst x := by rfl lemma AffineEquiv.Vsubconst_linear_apply (𝕜 : Type) {E P : Type} [Field 𝕜] [AddCommGroup E] - [Module 𝕜 E] [AddTorsor E P] (x : P) (v : E) : (AffineEquiv.VSubconst 𝕜 x).linear v = v := rfl + [Module 𝕜 E] [AddTorsor E P] (x : P) (v : E) : + (AffineEquiv.VSubconst 𝕜 x).linear v = v := by rfl lemma AffineEquiv.coe_VSubconst (𝕜 : Type) {E P : Type} [Field 𝕜] [AddCommGroup E] [Module 𝕜 E] - [AddTorsor E P] (x : P) : ↑(AffineEquiv.VSubconst 𝕜 x) = (· -ᵥ x) := rfl + [AddTorsor E P] (x : P) : ↑(AffineEquiv.VSubconst 𝕜 x) = (· -ᵥ x) := by rfl /-- The affine isometry equivalence `P ≃ᵃⁱ[𝕜] E` sending a point `p` to the vector `p -ᵥ x`. -/ def AffineIsometryEquiv.VSubconst (𝕜 : Type) {E P : Type} [NormedField 𝕜] [NormedAddCommGroup E] @@ -131,7 +132,7 @@ def AffineIsometryEquiv.VSubconst (𝕜 : Type) {E P : Type} [NormedField 𝕜] @[simp] lemma AffineIsometryEquiv.coe_VSubconst (𝕜 : Type) {E P : Type} [NormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] [PseudoMetricSpace P] [NormedAddTorsor E P] (x : P) : - ↑(AffineIsometryEquiv.VSubconst 𝕜 x) = (· -ᵥ x) := rfl + ↑(AffineIsometryEquiv.VSubconst 𝕜 x) = (· -ᵥ x) := by rfl lemma Submodule.mem_orthogonal_Basis {𝕜 : Type u_1} {E : Type u_2} {ι : Type u_3} [RCLike 𝕜] diff --git a/LeanPool/Puiseux/AlgClosed.lean b/LeanPool/Puiseux/AlgClosed.lean index 2af803ec8f..40e28c50f7 100644 --- a/LeanPool/Puiseux/AlgClosed.lean +++ b/LeanPool/Puiseux/AlgClosed.lean @@ -51,7 +51,7 @@ puiseux series, newton polygon, algebraically closed, algebraic closure /- Ported to Lean Pool and its pinned Mathlib toolchain in September 2026. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Puiseux/Algebraic.lean b/LeanPool/Puiseux/Algebraic.lean index ef9b2b7918..1f28562ddb 100644 --- a/LeanPool/Puiseux/Algebraic.lean +++ b/LeanPool/Puiseux/Algebraic.lean @@ -31,7 +31,7 @@ puiseux series, laurent series, algebraic /- Ported to Lean Pool and its pinned Mathlib toolchain in September 2026. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/Puiseux/Basic.lean b/LeanPool/Puiseux/Basic.lean index ee190db1db..ed76bed6b0 100644 --- a/LeanPool/Puiseux/Basic.lean +++ b/LeanPool/Puiseux/Basic.lean @@ -40,7 +40,7 @@ puiseux series, laurent series, hahn series /- Ported to Lean Pool and its pinned Mathlib toolchain in September 2026. -/ -@[expose] public section +public section noncomputable section @@ -72,6 +72,7 @@ variable (K : Type*) [Field K] /-- The expansion ring embedding `K((t)) →+* K((t))`, `t ↦ t ^ m`: `embDomainRingHom` along the exponent map `k ↦ m * k` on `ℤ`. -/ +@[expose] def expand (m : ℕ+) : LaurentSeries K →+* LaurentSeries K := HahnSeries.embDomainRingHom (AddMonoidHom.mk' ((m : ℤ) * ·) (mul_add _)) (fun _ _ => mul_left_cancel₀ (by exact_mod_cast m.ne_zero)) @@ -174,7 +175,7 @@ end PuiseuxSeries /-- The type of Puiseux series over `K`: the carrier of the Puiseux subfield of `HahnSeries ℚ K`. A field, by the generic subfield instances. -/ -def PuiseuxSeries (K : Type*) [Field K] : Type _ := +@[expose] def PuiseuxSeries (K : Type*) [Field K] : Type _ := ↥(PuiseuxSeries.subfield K) namespace PuiseuxSeries diff --git a/LeanPool/Puiseux/HenselSplitting.lean b/LeanPool/Puiseux/HenselSplitting.lean index d6c26cbe72..3892aabe20 100644 --- a/LeanPool/Puiseux/HenselSplitting.lean +++ b/LeanPool/Puiseux/HenselSplitting.lean @@ -32,7 +32,7 @@ maximal ideal of `K⟦X⟧` (that is, of the coefficientwise application of /- Ported to Lean Pool and its pinned Mathlib toolchain in September 2026. -/ -@[expose] public section +public section namespace Polynomial diff --git a/LeanPool/PumpingCfg.lean b/LeanPool/PumpingCfg.lean index 4293de80bc..f8858325d9 100644 --- a/LeanPool/PumpingCfg.lean +++ b/LeanPool/PumpingCfg.lean @@ -19,7 +19,7 @@ Tags: formal-languages, context-free-grammars, computability, pumping-lemma MSC: 68Q45 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/Basic.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/Basic.lean index c44191f2d4..7462ebc800 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/Basic.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/Basic.lean @@ -22,7 +22,7 @@ pair of nonterminals. * `Language.toCFG_correct`: `g.toCFG` generates the same language a a context-free grammar `g`. -/ -@[expose] public section +public section universe uT uN @@ -49,15 +49,13 @@ namespace ChomskyNormalFormRule variable {N : Type uN} {r : ChomskyNormalFormRule T N} {u v : List (Symbol T N)} /-- The input of a CNF rule, similar to `ContextFreeRule.input` -/ -@[simp] -def input (r : ChomskyNormalFormRule T N) := +@[expose, simp] def input (r : ChomskyNormalFormRule T N) := match r with | leaf n _ => n | node n _ _ => n /-- The output of a CNF rule, similar to `ContextFreeRule.output` -/ -@[simp] -def output (r : ChomskyNormalFormRule T N) := +@[expose, simp] def output (r : ChomskyNormalFormRule T N) := match r with | leaf _ t => [Symbol.terminal t] | node _ n₁ n₂ => [Symbol.nonterminal n₁, Symbol.nonterminal n₂] @@ -146,7 +144,7 @@ namespace ChomskyNormalFormGrammar /-- Given a cnf grammar `g` and strings `u` and `v` `g.Produces u v` means that one step of a cnf transformation by a rule from `g` sends `u` to `v`. -/ -def Produces (g : ChomskyNormalFormGrammar T) (u v : List (Symbol T g.NT)) : Prop := +@[expose] def Produces (g : ChomskyNormalFormGrammar T) (u v : List (Symbol T g.NT)) : Prop := ∃ r ∈ g.rules, r.Rewrites u v /-- Given a cnf grammar `g` and strings `u` and `v` @@ -158,11 +156,12 @@ abbrev Derives (g : ChomskyNormalFormGrammar T) : /-- Given a cnf grammar `g` and a string `s` `g.Generates s` means that `g` can transform its initial nonterminal c `s` in some number of rewriting steps. -/ -def Generates (g : ChomskyNormalFormGrammar T) (u : List (Symbol T g.NT)) : Prop := +@[expose] def Generates (g : ChomskyNormalFormGrammar T) + (u : List (Symbol T g.NT)) : Prop := g.Derives [Symbol.nonterminal g.initial] u /-- The language (set of words) that can be generated by a given cnf grammar `g`. -/ -def language (g : ChomskyNormalFormGrammar T) : Language T := +@[expose] def language (g : ChomskyNormalFormGrammar T) : Language T := { w | g.Generates (w.map Symbol.terminal) } /-- A given word `w` belongs to the language generated by a given cnf grammar `g` iff @@ -242,7 +241,7 @@ section toCFG variable [DecidableEq T] /-- Translation of `ChomskyNormalFormGrammar` to `ContextFreeGrammar` -/ -noncomputable def toCFG (g : ChomskyNormalFormGrammar T) [DecidableEq g.NT] : +@[expose] noncomputable def toCFG (g : ChomskyNormalFormGrammar T) [DecidableEq g.NT] : ContextFreeGrammar T where NT := g.NT initial := g.initial diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/ContextFreeGrammarExtras.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/ContextFreeGrammarExtras.lean index 190e4f6a85..046c7b4350 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/ContextFreeGrammarExtras.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/ContextFreeGrammarExtras.lean @@ -17,7 +17,7 @@ Mathlib release pinned here: the step-counting derivation relation lemmas, plus a few facts about `ContextFreeGrammar.Produces`. -/ -@[expose] public section +public section universe uT diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/EmptyElimination.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/EmptyElimination.lean index f673d423eb..4dc71f4c19 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/EmptyElimination.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/EmptyElimination.lean @@ -29,7 +29,7 @@ original up to omission of the empty word. [Hopcroft et al. 2006] -/ -@[expose] public section +public section namespace ContextFreeRule universe uT uN @@ -402,6 +402,7 @@ lemma subset_addIfNullable (r : ContextFreeRule T N) (p : Finset N) : variable {g : ContextFreeGrammar T} [DecidableEq g.NT] /-- `generators g` is the set of nonterminals that appear in the left hand side of rules of `g` -/ +@[expose] noncomputable def generators (g : ContextFreeGrammar T) [DecidableEq g.NT] : Finset g.NT := (g.rules.toList.map ContextFreeRule.input).toFinset @@ -670,7 +671,7 @@ noncomputable def removeNullables [DecidableEq T] [DecidableEq g.NT] (p : Finset in `g` have a set of corresponding rules in g' in which some nullable symbols do not appear in the output. For example if `r: V -> ABC` is in `g` and `A` and `B` are nullable, the rules `r₁ : V -> ABC`, `r₂ : V -> BC`, `r₃ : V -> AC`, `r₄ : V -> C` will be in `g.eliminate_empty` -/ -noncomputable def eliminateEmpty [DecidableEq T] (g : ContextFreeGrammar T) +@[expose] noncomputable def eliminateEmpty [DecidableEq T] (g : ContextFreeGrammar T) [DecidableEq g.NT] : ContextFreeGrammar T := ⟨g.NT, g.initial, removeNullables g.computeNullables⟩ diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/LengthRestriction.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/LengthRestriction.lean index 19059f27a8..6e1a0c8d22 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/LengthRestriction.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/LengthRestriction.lean @@ -30,7 +30,7 @@ the original [Hopcroft et al. 2006] -/ -@[expose] public section +public section universe uN uT variable {T : Type uT} @@ -144,12 +144,12 @@ def restrictLengthRules [DecidableEq T] [DecidableEq g.NT] (l : List (ContextFre end RestrictLength /-- Construct a `ChomskyNormalGrammar` corresponding to the original `ContextFreeGrammar` -/ -noncomputable def restrictLength [DecidableEq T] (g : ContextFreeGrammar T) +@[expose] noncomputable def restrictLength [DecidableEq T] (g : ContextFreeGrammar T) [e : DecidableEq g.NT] := ChomskyNormalFormGrammar.mk g.NT' (Sum.inl g.initial) (restrictLengthRules g.rules.toList) /-- A grammar is `Wellformed` if all rules are `ContextFreeRule.Wellformed` -/ -def Wellformed (g : ContextFreeGrammar T) : Prop := ∀ r ∈ g.rules, r.Wellformed +@[expose] def Wellformed (g : ContextFreeGrammar T) : Prop := ∀ r ∈ g.rules, r.Wellformed /-! Definitions of embeding into and projecting to the type of symbols of the new grammar -/ section EmbedProject @@ -157,7 +157,7 @@ section EmbedProject variable {g : ContextFreeGrammar T} /-- Intuitive embedding of symbols of the original grammar into symbols of the new grammar's type -/ -def embedSymbol (s : Symbol T g.NT) : Symbol T g.NT' := +@[expose] def embedSymbol (s : Symbol T g.NT) : Symbol T g.NT' := match s with | Symbol.terminal t => Symbol.terminal t | Symbol.nonterminal n => Symbol.nonterminal (Sum.inl n) @@ -428,7 +428,7 @@ lemma computeRulesRec_derives [DecidableEq T] [DecidableEq g.NT] {r : ContextFre | succ n ih => unfold computeRulesRec at hrix split at hrix - · rename_i _ hrn + · rename_i n₁ hrn simp only [List.cons_subset, List.get_eq_getElem] at hrix hrn obtain ⟨hx₁, hx₂⟩ := hrix rw [← List.getElem_cons_drop, hrn] @@ -438,10 +438,13 @@ lemma computeRulesRec_derives [DecidableEq T] [DecidableEq g.NT] {r : ContextFre · simp only [List.mem_toFinset] exact hx₁ · exact ChomskyNormalFormRule.Rewrites.input_output - · simp only [ChomskyNormalFormRule.output, List.map_cons, List.map_drop] + · simp only [List.map_cons, List.map_drop] rw [← List.singleton_append, ← List.singleton_append, embedSymbol_nonterminal, ← List.map_drop] - apply ChomskyNormalFormGrammar.Derives.append_left + simp only [ChomskyNormalFormRule.output] + refine ChomskyNormalFormGrammar.Derives.append_left + (g := ChomskyNormalFormGrammar.mk g.NT' _ x.toFinset) + (p := ([Symbol.nonterminal (Sum.inl n₁)] : List (Symbol T g.NT'))) ?_ have hrₒ : r.output.length - 2 - (n + 1) + 1 = r.output.length - 2 - n := by omega simp_all · omega diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/TerminalRestriction.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/TerminalRestriction.lean index bc8f5f1045..debdf3c6ea 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/TerminalRestriction.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/TerminalRestriction.lean @@ -27,7 +27,7 @@ the original [Hopcroft et al. 2006] -/ -@[expose] public section +public section universe uN variable {T : Type} @@ -38,7 +38,7 @@ section EmbedProject variable {N : Type uN} /-- Intuitive embedding of symbols of the original grammar into symbols of the new grammar's type -/ -def embedSymbol (s : Symbol T N) : Symbol T (N ⊕ T) := +@[expose] def embedSymbol (s : Symbol T N) : Symbol T (N ⊕ T) := match s with | Symbol.terminal t => Symbol.terminal t | Symbol.nonterminal n => Symbol.nonterminal (Sum.inl n) @@ -47,7 +47,7 @@ def embedSymbol (s : Symbol T N) : Symbol T (N ⊕ T) := abbrev embedString (u : List (Symbol T N)) : List (Symbol T (N ⊕ T)) := u.map embedSymbol /-- Embedding of symbols of the original grammar into nonterminals of the new grammar -/ -def rightEmbedSymbol (s : Symbol T N) : Symbol T (N ⊕ T) := +@[expose] def rightEmbedSymbol (s : Symbol T N) : Symbol T (N ⊕ T) := match s with | Symbol.terminal t => Symbol.nonterminal (Sum.inr t) | Symbol.nonterminal n => Symbol.nonterminal (Sum.inl n) @@ -57,7 +57,7 @@ grammar -/ abbrev rightEmbedString (w : List (Symbol T N)) := w.map rightEmbedSymbol /-- Projection from symbols of the new grammars type into symbols of the original grammar -/ -def projectSymbol (s : Symbol T (N ⊕ T)) : Symbol T N := +@[expose] def projectSymbol (s : Symbol T (N ⊕ T)) : Symbol T N := match s with | Symbol.terminal t => Symbol.terminal t | Symbol.nonterminal (Sum.inl nt) => Symbol.nonterminal nt @@ -122,6 +122,7 @@ terminals occur only as the single symbol at the right-hand side of a rule. -/ section RestrictTerminals /-- Computes rules r' : T -> t, for all terminals t occuring in `r.output` -/ +@[expose] def newTerminalRules {N : Type*} (r : ContextFreeRule T N) : List (ContextFreeRule T (N ⊕ T)) := let terminal_rule (s : Symbol T N) : Option (ContextFreeRule T (N ⊕ T)) := match s with @@ -132,6 +133,7 @@ def newTerminalRules {N : Type*} (r : ContextFreeRule T N) : List (ContextFreeRu /-- If `r.output` is a single terminal, we lift the rule to the new grammar, otherwise add new rules for each terminal symbol in `r.output` and right-lift the rule, i.e., replace all terminals with nonterminals -/ +@[expose] def restrictTerminalRule {N : Type*} (r : ContextFreeRule T N) : List (ContextFreeRule T (N ⊕ T)) := (match r.output with | [Symbol.terminal t] => ⟨Sum.inl r.input, [Symbol.terminal t]⟩ @@ -139,13 +141,13 @@ def restrictTerminalRule {N : Type*} (r : ContextFreeRule T N) : List (ContextFr ) :: newTerminalRules r /-- Compute all lifted rules -/ -noncomputable def restrictTerminalRules {N : Type*} [DecidableEq T] [DecidableEq N] +@[expose] noncomputable def restrictTerminalRules {N : Type*} [DecidableEq T] [DecidableEq N] (l : List (ContextFreeRule T N)) : Finset (ContextFreeRule T (N ⊕ T)) := (l.map restrictTerminalRule).flatten.toFinset /-- Construct new grammar, using the lifted rules. Each rule's output is either a single terminal or only nonterminals -/ -noncomputable def restrictTerminals [DecidableEq T] (g : ContextFreeGrammar T) +@[expose] noncomputable def restrictTerminals [DecidableEq T] (g : ContextFreeGrammar T) [DecidableEq g.NT] := ContextFreeGrammar.mk (g.NT ⊕ T) (Sum.inl g.initial) (restrictTerminalRules g.rules.toList) @@ -244,7 +246,8 @@ lemma restrictTerminals_derives_rightEmbedString_embedString {u : List (Symbol T induction u with | nil => rfl | cons a _ ih => - simp only [List.mem_cons, List.map_cons] at hu ⊢ + simp only [List.mem_cons] at hu + simp only [rightEmbedString, embedString, List.map_cons] rw [← List.singleton_append, ← @List.singleton_append _ (embedSymbol a)] apply Derives.append_left_trans · simp_all diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/Translation.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/Translation.lean index e0f0f32345..713761ddbd 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/Translation.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/Translation.lean @@ -33,7 +33,7 @@ original language (except for the empty string) [Hopcroft et al. 2006] -/ -@[expose] public section +public section universe uN diff --git a/LeanPool/PumpingCfg/ChomskyNormalForm/UnitElimination.lean b/LeanPool/PumpingCfg/ChomskyNormalForm/UnitElimination.lean index 1dd8db5f6a..2bcc99fa62 100644 --- a/LeanPool/PumpingCfg/ChomskyNormalForm/UnitElimination.lean +++ b/LeanPool/PumpingCfg/ChomskyNormalForm/UnitElimination.lean @@ -31,7 +31,7 @@ the original. [Hopcroft et al. 2006] -/ -@[expose] public section +public section universe uN uT namespace ContextFreeGrammar @@ -422,6 +422,7 @@ variable {g : ContextFreeGrammar T} [DecidableEq g.NT] /-- For a given unit pair `(n₁, n₂)`, computes rules `r : n₁ → o`, s.t. there is a rule `r' : n₂ → o` in `g` (and `o` is non-unit) -/ +@[expose] noncomputable def computeUnitPairRules (p : g.NT × g.NT) : List (ContextFreeRule T g.NT) := let f (r : ContextFreeRule T g.NT) : Option (ContextFreeRule T g.NT) := if r.input = p.2 then @@ -432,14 +433,14 @@ noncomputable def computeUnitPairRules (p : g.NT × g.NT) : List (ContextFreeRul g.rules.toList.filterMap f /-- Computes non-unit rules for all unit pairs -/ -noncomputable def removeUnitRules [DecidableEq T] (l : Finset (g.NT × g.NT)) := +@[expose] noncomputable def removeUnitRules [DecidableEq T] (l : Finset (g.NT × g.NT)) := ((l.toList).map computeUnitPairRules).flatten.toFinset /-- Given `g`, computes a new grammar `g'` in which all unit rules are removed and, for each unit pair `(n₁, n₂)`, we add rules `r : n₁ → o` if the rule `r' : n₂ → o` is in the grammar (and non-unit) -/ -noncomputable def eliminateUnitRules [DecidableEq T] (g : ContextFreeGrammar T) +@[expose] noncomputable def eliminateUnitRules [DecidableEq T] (g : ContextFreeGrammar T) [DecidableEq g.NT] := ContextFreeGrammar.mk g.NT g.initial (removeUnitRules computeUnitPairs) diff --git a/LeanPool/PumpingCfg/ParseTree.lean b/LeanPool/PumpingCfg/ParseTree.lean index 101fb5ff12..c251ea3e2a 100644 --- a/LeanPool/PumpingCfg/ParseTree.lean +++ b/LeanPool/PumpingCfg/ParseTree.lean @@ -15,7 +15,7 @@ Defines `ChomskyNormalFormGrammar.parseTree`, binary parse trees for grammars in normal form, together with their yield and the subtree relation used by the pumping argument. -/ -@[expose] public section +public section universe uN uT @@ -48,7 +48,7 @@ def yield {n : g.NT} (p : parseTree n) : List T := | node t₁ t₂ _ => yield t₁ ++ yield t₂ /-- The `height` of a tree -/ -def height {n : g.NT} (p : parseTree n) : ℕ := +@[expose] def height {n : g.NT} (p : parseTree n) : ℕ := match p with | leaf _ _ => 1 | node t₁ t₂ _ => max (height t₁) (height t₂) + 1 diff --git a/LeanPool/PumpingCfg/Pumping.lean b/LeanPool/PumpingCfg/Pumping.lean index 0ada62813a..ca5f6c3305 100644 --- a/LeanPool/PumpingCfg/Pumping.lean +++ b/LeanPool/PumpingCfg/Pumping.lean @@ -25,7 +25,7 @@ This file contains the proof of the pumping lemma for context-free grammars [Hopcroft et al. 2006] -/ -@[expose] public section +public section theorem pidgeonhole {α β : Type*} {A : Finset α} {B : Finset β} {f : A → B} (hf : f.Injective) : A.card ≤ B.card := by diff --git a/LeanPool/PumpingCfg/ToMathlib.lean b/LeanPool/PumpingCfg/ToMathlib.lean index e7115e3816..6ad946bc7f 100644 --- a/LeanPool/PumpingCfg/ToMathlib.lean +++ b/LeanPool/PumpingCfg/ToMathlib.lean @@ -14,7 +14,7 @@ Small facts about `ChomskyNormalFormRule.Rewrites` and `ChomskyNormalFormGrammar intended for upstreaming into Mathlib alongside the Chomsky-normal-form development. -/ -@[expose] public section +public section universe uT uN variable {T : Type uT} diff --git a/LeanPool/PumpingCfg/Utils.lean b/LeanPool/PumpingCfg/Utils.lean index e89f1c1f91..db10b151d7 100644 --- a/LeanPool/PumpingCfg/Utils.lean +++ b/LeanPool/PumpingCfg/Utils.lean @@ -15,12 +15,12 @@ Defines `nTimes` (notation `l ^+^ n`), the `n`-fold repetition of a list, together with basic rewriting lemmas about it. -/ -@[expose] public section +public section variable {α : Type _} /-- `nTimes l n` (notation `l ^+^ n`) is the concatenation of `n` copies of the list `l`. -/ -def nTimes (l : List α) (n : ℕ) : List α := +@[expose] def nTimes (l : List α) (n : ℕ) : List α := (List.replicate n l).flatten @[inherit_doc] diff --git a/LeanPool/PythagoreanPolynomialParametrization.lean b/LeanPool/PythagoreanPolynomialParametrization.lean index 96ab9beadc..9cc9955c78 100644 --- a/LeanPool/PythagoreanPolynomialParametrization.lean +++ b/LeanPool/PythagoreanPolynomialParametrization.lean @@ -27,4 +27,4 @@ Tags: number-theory, pythagorean-triples, integer-valued-polynomials MSC: 11D09, 11D85, 13F20 -/ -@[expose] public section +public section diff --git a/LeanPool/PythagoreanPolynomialParametrization/Basic.lean b/LeanPool/PythagoreanPolynomialParametrization/Basic.lean index 17031601f4..938034ec39 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/Basic.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/Basic.lean @@ -20,7 +20,7 @@ This file contains the shared definitions used by the Frisch--Vaserstein formalization setup. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization @@ -29,13 +29,13 @@ open MvPolynomial /-- A triple of integers (x,y,z) is a Pythagorean triple if x² + y² = z². -/ -def IsPythagoreanTriple (x y z : ℤ) : Prop := x^2 + y^2 = z^2 +@[expose] def IsPythagoreanTriple (x y z : ℤ) : Prop := x^2 + y^2 = z^2 /-- The set of all Pythagorean triples. -/ -def pythagoreanTriples : Set (ℤ × ℤ × ℤ) := {(x, y, z) | IsPythagoreanTriple x y z} +@[expose] def pythagoreanTriples : Set (ℤ × ℤ × ℤ) := {(x, y, z) | IsPythagoreanTriple x y z} /-- The set of all positive Pythagorean triples (x,y,z > 0). -/ -def positivePythagoreanTriples : Set (ℤ × ℤ × ℤ) := +@[expose] def positivePythagoreanTriples : Set (ℤ × ℤ × ℤ) := {(x, y, z) | 0 < x ∧ 0 < y ∧ 0 < z ∧ IsPythagoreanTriple x y z} /-- Multivariate polynomials with integer coefficients in n variables. -/ @@ -46,11 +46,13 @@ abbrev RatPoly (n : ℕ) := MvPolynomial (Fin n) ℚ /-- A rational-coefficient polynomial is integer-valued if it evaluates to an integer at every integer tuple. -/ +@[expose] def IsIntValued {n : ℕ} (p : RatPoly n) : Prop := ∀ a : Fin n → ℤ, ∃ k : ℤ, eval (fun i => (a i : ℚ)) p = (k : ℚ) /-- The paper's ring `Int(ℤⁿ)` of integer-valued rational polynomials, represented as a subring of `ℚ[x₁, ..., xₙ]`. -/ +@[expose] def IntValuedSubring (n : ℕ) : Subring (RatPoly n) where carrier := {p | IsIntValued p} zero_mem' := by @@ -83,11 +85,11 @@ def IntValuedSubring (n : ℕ) : Subring (RatPoly n) where abbrev IntegerValuedPoly (n : ℕ) : Type := IntValuedSubring n /-- Evaluate an integer-coefficient polynomial at an integer tuple. -/ -noncomputable def intPolyEval {n : ℕ} (p : IntPoly n) (a : Fin n → ℤ) : ℤ := +@[expose] noncomputable def intPolyEval {n : ℕ} (p : IntPoly n) (a : Fin n → ℤ) : ℤ := eval a p /-- Evaluate a rational-coefficient polynomial at an integer tuple. -/ -noncomputable def ratPolyEval {n : ℕ} (p : RatPoly n) (a : Fin n → ℤ) : ℚ := +@[expose] noncomputable def ratPolyEval {n : ℕ} (p : RatPoly n) (a : Fin n → ℤ) : ℚ := eval (fun i => (a i : ℚ)) p /-- General `k`-tuple version of parametrization by one tuple of integer-coefficient @@ -98,6 +100,7 @@ def IntPolyTupleParametrizes {n k : ℕ} (F : Fin k → IntPoly n) /-- General `k`-tuple version of parametrization by one tuple of integer-valued polynomials, matching `pyth.tex` lines 104--116. -/ +@[expose] def IntValuedTupleParametrizes {n k : ℕ} (F : Fin k → RatPoly n) (S : Set (Fin k → ℤ)) : Prop := (∀ i : Fin k, IsIntValued (F i)) ∧ @@ -105,6 +108,7 @@ def IntValuedTupleParametrizes {n k : ℕ} (F : Fin k → RatPoly n) /-- Parametrization by a finite number of `k`-tuples of integer-coefficient polynomials, matching `pyth.tex` lines 118--125. -/ +@[expose] def FiniteIntPolyTupleParametrizes {m n k : ℕ} (F : Fin m → Fin k → IntPoly n) (S : Set (Fin k → ℤ)) : Prop := S = {v | ∃ j : Fin m, ∃ a : Fin n → ℤ, ∀ i : Fin k, @@ -120,12 +124,14 @@ def FiniteIntValuedTupleParametrizes {m n k : ℕ} (F : Fin m → Fin k → RatP /-- A triple of integer-coefficient polynomials parametrizes a set S ⊆ ℤ³ if S equals the image of the polynomial map ℤⁿ → ℤ³. -/ +@[expose] def IntPolyParametrizes {n : ℕ} (f g h : IntPoly n) (S : Set (ℤ × ℤ × ℤ)) : Prop := S = {(x, y, z) | ∃ a : Fin n → ℤ, intPolyEval f a = x ∧ intPolyEval g a = y ∧ intPolyEval h a = z} /-- A triple of rational-coefficient polynomials parametrizes a set S ⊆ ℤ³ if each is integer-valued and S equals the image of the polynomial map. -/ +@[expose] def IntValuedParametrizes {n : ℕ} (f g h : RatPoly n) (S : Set (ℤ × ℤ × ℤ)) : Prop := IsIntValued f ∧ IsIntValued g ∧ IsIntValued h ∧ S = {(x, y, z) | ∃ a : Fin n → ℤ, diff --git a/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean b/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean index e590cee141..3a38142d12 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean @@ -26,7 +26,7 @@ This file records source-level material from Frisch--Vaserstein that is not used the main parametrization proof. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization diff --git a/LeanPool/PythagoreanPolynomialParametrization/IntegerValued.lean b/LeanPool/PythagoreanPolynomialParametrization/IntegerValued.lean index e8ed9b9250..88e1ed0139 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/IntegerValued.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/IntegerValued.lean @@ -21,7 +21,7 @@ This file contains the explicit four-variable integer-valued polynomial triple f Frisch and Vaserstein's main theorem. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization @@ -30,16 +30,16 @@ open MvPolynomial /-- Variable x (index 0) in the 4-variable rational polynomial ring. -/ -noncomputable def xVar : RatPoly 4 := X 0 +@[expose] noncomputable def xVar : RatPoly 4 := X 0 /-- Variable y (index 1) in the 4-variable rational polynomial ring. -/ -noncomputable def yVar : RatPoly 4 := X 1 +@[expose] noncomputable def yVar : RatPoly 4 := X 1 /-- Variable z (index 2) in the 4-variable rational polynomial ring. -/ -noncomputable def zVar : RatPoly 4 := X 2 +@[expose] noncomputable def zVar : RatPoly 4 := X 2 /-- Variable w (index 3) in the 4-variable rational polynomial ring. -/ -noncomputable def wVar : RatPoly 4 := X 3 +@[expose] noncomputable def wVar : RatPoly 4 := X 3 /-- a = y + z·w -/ noncomputable def aParam : RatPoly 4 := yVar + zVar * wVar diff --git a/LeanPool/PythagoreanPolynomialParametrization/Main.lean b/LeanPool/PythagoreanPolynomialParametrization/Main.lean index 822141bc84..54eb892b4f 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/Main.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/Main.lean @@ -43,7 +43,7 @@ from the main parametrization proofs. finite-cover theorem, and the integer-valued factorization discussion. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization diff --git a/LeanPool/PythagoreanPolynomialParametrization/Obstructions.lean b/LeanPool/PythagoreanPolynomialParametrization/Obstructions.lean index 3c06b20731..873a1eda98 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/Obstructions.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/Obstructions.lean @@ -24,7 +24,7 @@ This file contains the paper's impossibility result for a single triple of integer-coefficient polynomials. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization diff --git a/LeanPool/PythagoreanPolynomialParametrization/Positive.lean b/LeanPool/PythagoreanPolynomialParametrization/Positive.lean index 903b193599..b343360be3 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/Positive.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/Positive.lean @@ -22,7 +22,7 @@ This file contains the positive-triple remark and the unrestricted 16-parameter substitution obtained from the four-square theorem. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization diff --git a/LeanPool/PythagoreanPolynomialParametrization/SourceLemmas.lean b/LeanPool/PythagoreanPolynomialParametrization/SourceLemmas.lean index 072e4d0b4e..1a5285ea2b 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/SourceLemmas.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/SourceLemmas.lean @@ -17,7 +17,7 @@ kept separate from the explicit polynomial witnesses so each proof obligation ha small, source-located target. -/ -@[expose] public section +public section namespace LeanPool.PythagoreanPolynomialParametrization @@ -26,22 +26,23 @@ namespace LeanPool.PythagoreanPolynomialParametrization /-- The rational map T(a,b,c) = (c(a²-b²)/2, cab, c(a²+b²)/2) used in the proof of the main parametrization theorem. -/ -def TMap (a b c : ℤ) : ℚ × ℚ × ℚ := +@[expose] def TMap (a b c : ℤ) : ℚ × ℚ × ℚ := ((c : ℚ) * ((a : ℚ) ^ 2 - (b : ℚ) ^ 2) / 2, (c : ℚ) * (a : ℚ) * (b : ℚ), (c : ℚ) * ((a : ℚ) ^ 2 + (b : ℚ) ^ 2) / 2) /-- A value of `TMap` is integral when all three rational coordinates are integers. -/ +@[expose] def IsIntegralTValue (a b c : ℤ) : Prop := ∃ x y z : ℤ, TMap a b c = ((x : ℚ), (y : ℚ), (z : ℚ)) /-- The paper's parity condition for `T(a,b,c)` to have integer coordinates: `c` is even or `a` and `b` have the same parity. -/ -def PaperParityCondition (a b c : ℤ) : Prop := +@[expose] def PaperParityCondition (a b c : ℤ) : Prop := Even c ∨ Even (a - b) /-- Positive parameters for the paper's positive-triple variant of `T(a,b,c)`. -/ -def PositiveTParameters (a b c : ℤ) : Prop := +@[expose] def PositiveTParameters (a b c : ℤ) : Prop := 0 < a ∧ 0 < b ∧ 0 < c ∧ b < a ∧ PaperParityCondition a b c /-- The introductory source claim: every Pythagorean triple is covered by one of two diff --git a/LeanPool/QuadraticIterates.lean b/LeanPool/QuadraticIterates.lean index ef3a044455..b415ee5941 100644 --- a/LeanPool/QuadraticIterates.lean +++ b/LeanPool/QuadraticIterates.lean @@ -42,4 +42,4 @@ Tags: arithmetic-dynamics, galois-theory, iterated-polynomials MSC: 11R32, 12F10, 37P05 -/ -@[expose] public section +public section diff --git a/LeanPool/QuadraticIterates/ArchMath1992.lean b/LeanPool/QuadraticIterates/ArchMath1992.lean index 2de22895ea..0dda26108f 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992.lean @@ -74,4 +74,4 @@ over `ℤ`), `Iterates` (the polynomials `f_n`, the fields `K_n`, the groups `Ω `c` and `b`), `Irreducibility`, `DegreeCriterion` and `Main`. -/ -@[expose] public section +public section diff --git a/LeanPool/QuadraticIterates/ArchMath1992/DegreeCriterion.lean b/LeanPool/QuadraticIterates/ArchMath1992/DegreeCriterion.lean index 6de138b37d..d3ed89c3df 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992/DegreeCriterion.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992/DegreeCriterion.lean @@ -28,7 +28,7 @@ Part of the formalization of M. Stoll, *Galois groups over ℚ of some iterated Arch. Math. **59** (1992), 239-244; see `QuadraticIterates.ArchMath1992`. -/ -@[expose] public section +public section open Polynomial @@ -42,6 +42,7 @@ variable (a : ℤ) /-- The shifted root `β - a` of `f_n`, as an element of `K_n`: these are the radicands whose square roots generate `K_{n+1}` over `K_n`. -/ +@[expose] noncomputable def rootShift (a : ℤ) (n : ℕ) (β : (fℚ[a, n]).rootSet (AlgebraicClosure ℚ)) : ↥(splittingField a n) := ⟨(β : AlgebraicClosure ℚ) - (a : AlgebraicClosure ℚ), diff --git a/LeanPool/QuadraticIterates/ArchMath1992/Irreducibility.lean b/LeanPool/QuadraticIterates/ArchMath1992/Irreducibility.lean index dedf88617b..8833adfd35 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992/Irreducibility.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992/Irreducibility.lean @@ -29,7 +29,7 @@ Part of the formalization of M. Stoll, *Galois groups over ℚ of some iterated Arch. Math. **59** (1992), 239-244; see `QuadraticIterates.ArchMath1992`. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/QuadraticIterates/ArchMath1992/Iterates.lean b/LeanPool/QuadraticIterates/ArchMath1992/Iterates.lean index 5002b611b5..8fd4adf959 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992/Iterates.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992/Iterates.lean @@ -40,7 +40,7 @@ Arch. Math. **59** (1992), 239-244; see `QuadraticIterates.ArchMath1992`. `fℚ[a, n]` is scoped notation for the iterate `f_n` viewed in `ℚ[X]`. -/ -@[expose] public section +public section open Polynomial @@ -52,10 +52,11 @@ noncomputable def iteratedPoly {R : Type*} [CommSemiring R] (a : R) : ℕ → R[ | 0 => X | n + 1 => (iteratedPoly a n) ^ 2 + C a -@[simp] lemma iteratedPoly_zero {R : Type*} [CommSemiring R] (a : R) : iteratedPoly a 0 = X := rfl +@[simp] lemma iteratedPoly_zero {R : Type*} [CommSemiring R] (a : R) : + iteratedPoly a 0 = X := by rfl lemma iteratedPoly_succ {R : Type*} [CommSemiring R] (a : R) (n : ℕ) : - iteratedPoly a (n + 1) = iteratedPoly a n ^ 2 + C a := rfl + iteratedPoly a (n + 1) = iteratedPoly a n ^ 2 + C a := by rfl /-- Iterating commutes with any ring homomorphism: the image of `f_n` under `φ` is the `n`-th iterate over the codomain with parameter `φ a`. -/ @@ -124,12 +125,12 @@ lemma evenPoly_C_mul_X_sq_add_C {R : Type*} [CommSemiring R] (b c : R) : /-- The integer sequence `c_n` (indexed from 1): `c_1 = -a`, `c_{n+1} = c_n² + a`; the value at index `0` is `0`. It is the `γ`-sequence of `X² + a` with `ε = -1`. -/ -noncomputable def cSeq (a : ℤ) : ℕ → ℤ := gammaSeq (X ^ 2 + C a) (-1) +@[expose] noncomputable def cSeq (a : ℤ) : ℕ → ℤ := gammaSeq (X ^ 2 + C a) (-1) /-- `c_n = γ_n(X² + a, ε = -1)` (definitional). -/ -lemma cSeq_eq_gammaSeq (a : ℤ) (n : ℕ) : cSeq a n = gammaSeq (X ^ 2 + C a) (-1) n := rfl +lemma cSeq_eq_gammaSeq (a : ℤ) (n : ℕ) : cSeq a n = gammaSeq (X ^ 2 + C a) (-1) n := by rfl -@[simp] lemma cSeq_zero (a : ℤ) : cSeq a 0 = 0 := rfl +@[simp] lemma cSeq_zero (a : ℤ) : cSeq a 0 = 0 := by rfl @[simp] lemma cSeq_one (a : ℤ) : cSeq a 1 = -a := by simp [cSeq_eq_gammaSeq] @@ -166,7 +167,8 @@ of the general `β`-sequence to `X² + a`, `ε = -1` (an integer by strong divis `intCast_bSeq`). -/ noncomputable def bSeq (a : ℤ) (n : ℕ) : ℤ := betaSeq (X ^ 2 + C a) (-1) n -lemma bSeq_eq_moebiusFactorR (a : ℤ) (n : ℕ) : bSeq a n = moebiusFactorR (cSeq a) n := rfl +lemma bSeq_eq_moebiusFactorR (a : ℤ) (n : ℕ) : + bSeq a n = moebiusFactorR (cSeq a) n := by rfl @[simp] lemma bSeq_one (a : ℤ) : bSeq a 1 = -a := by rw [bSeq_eq_moebiusFactorR, moebiusFactorR_one, cSeq_one] @@ -186,7 +188,7 @@ lemma evenPoly_normPoly (a : ℤ) : EvenPoly (normPoly a) := evenPoly_C_mul_X_sq /-- Nonzero rationals `a_1, …, a_n` are *2-independent* if their classes in `ℚ*/(ℚ*)²` are `𝔽₂`-linearly independent: no nonempty subfamily has product a square in `ℚ`. -/ -def TwoIndependent {n : ℕ} (v : Fin n → ℚ) : Prop := +@[expose] def TwoIndependent {n : ℕ} (v : Fin n → ℚ) : Prop := (∀ i, v i ≠ 0) ∧ ∀ S : Finset (Fin n), S.Nonempty → ¬IsSquare (∏ i ∈ S, v i) diff --git a/LeanPool/QuadraticIterates/ArchMath1992/Main.lean b/LeanPool/QuadraticIterates/ArchMath1992/Main.lean index 748b4d779c..3f65aa981b 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992/Main.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992/Main.lean @@ -34,7 +34,7 @@ Part of the formalization of M. Stoll, *Galois groups over ℚ of some iterated Arch. Math. **59** (1992), 239-244; see `QuadraticIterates.ArchMath1992`. -/ -@[expose] public section +public section open Polynomial open scoped ArithmeticFunction.Moebius diff --git a/LeanPool/QuadraticIterates/ArchMath1992/Sequences.lean b/LeanPool/QuadraticIterates/ArchMath1992/Sequences.lean index f602fbd4a3..c057b95cdf 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992/Sequences.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992/Sequences.lean @@ -38,7 +38,7 @@ Part of the formalization of M. Stoll, *Galois groups over ℚ of some iterated Arch. Math. **59** (1992), 239-244; see `QuadraticIterates.ArchMath1992`. -/ -@[expose] public section +public section open Polynomial open scoped ArithmeticFunction.Moebius @@ -51,7 +51,7 @@ namespace QuadraticIterates /-- The iteration sequence `γ_n` of `g ∈ R[X]` with sign choice `ε`: `γ_1 = ε · g(0)`, `γ_{n+1} = g(γ_n)`; the value at index `0` is `0` (chosen so that over `ℤ`, `γ` is a strong divisibility sequence). -/ -def gammaSeq {R : Type*} [CommSemiring R] (g : R[X]) (ε : R) : ℕ → R +@[expose] def gammaSeq {R : Type*} [CommSemiring R] (g : R[X]) (ε : R) : ℕ → R | 0 => 0 | 1 => ε * g.eval 0 | n + 2 => g.eval (gammaSeq g ε (n + 1)) @@ -59,6 +59,7 @@ def gammaSeq {R : Type*} [CommSemiring R] (g : R[X]) (ε : R) : ℕ → R /-- The Möbius factors `β_n = ∏_{d ∣ n} γ_d^{μ(n/d)}` of the `γ`-sequence, as elements of the coefficient ring: the unique preimage of the fraction-field Möbius product under `R → FractionRing R` (junk when that product is not integral). -/ +@[expose] noncomputable def betaSeq {R : Type*} [CommRing R] [IsDomain R] (g : R[X]) (ε : R) (n : ℕ) : R := moebiusFactorR (gammaSeq g ε) n @@ -66,7 +67,8 @@ lemma betaSeq_eq_moebiusFactorR {R : Type*} [CommRing R] [IsDomain R] (g : R[X]) betaSeq g ε n = moebiusFactorR (gammaSeq g ε) n := rfl /-- `g` is an even polynomial (`g ∈ R[X²]`): `g = Polynomial.expand R 2 h` for some `h`. -/ -def EvenPoly {R : Type*} [CommSemiring R] (g : R[X]) : Prop := ∃ h : R[X], g = expand R 2 h +@[expose] def EvenPoly {R : Type*} [CommSemiring R] (g : R[X]) : Prop := + ∃ h : R[X], g = expand R 2 h /-- An even polynomial takes equal values at points with equal squares. -/ theorem EvenPoly.eval_congr {R : Type*} [CommSemiring R] {g : R[X]} (hg : EvenPoly g) @@ -450,7 +452,7 @@ variable (g : ℤ[X]) /-- The Möbius factor `∏_{d ∣ n} c_d^{μ(n/d)}` of an integer sequence `c`, as a product over the divisor antidiagonal of `n`: pairs `(e, d)` with `e * d = n` contribute `c_d ^ μ(e)`. Rational, as `μ` can be negative; it is an integer when `c` is a strong divisibility sequence. -/ -noncomputable def moebiusFactor (c : ℕ → ℤ) (n : ℕ) : ℚ := +@[expose] noncomputable def moebiusFactor (c : ℕ → ℤ) (n : ℕ) : ℚ := ∏ x ∈ n.divisorsAntidiagonal, (c x.2 : ℚ) ^ (μ x.1) lemma moebiusFactor_eq_prod (c : ℕ → ℤ) (n : ℕ) : diff --git a/LeanPool/QuadraticIterates/Mathlib/Algebra/BigOperators.lean b/LeanPool/QuadraticIterates/Mathlib/Algebra/BigOperators.lean index 879adac85d..978b5c0c02 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Algebra/BigOperators.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Algebra/BigOperators.lean @@ -15,7 +15,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- Factor a constant out of an indicator-weighted sum: `∑ g x · [p x]·c = c · ∑_{p x} g x`. -/ theorem Finset.sum_mul_ite_const {ι R : Type*} [CommSemiring R] (s : Finset ι) (p : ι → Prop) diff --git a/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Eval.lean b/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Eval.lean index acbdba474b..14c719bd0b 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Eval.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Eval.lean @@ -14,7 +14,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- A ring homomorphism intertwines iterated evaluation of `p` with iterated evaluation of the mapped polynomial. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/EvenComp.lean b/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/EvenComp.lean index 30414ccf99..0134799875 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/EvenComp.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/EvenComp.lean @@ -20,7 +20,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Roots.lean b/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Roots.lean index a1d589b2df..4541ab74ea 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Roots.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Algebra/Polynomial/Roots.lean @@ -14,7 +14,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- For a polynomial without repeated roots in `E`, a product over the (coerced) `rootSet` equals the corresponding multiset product over `aroots`. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/Algebra/Squares.lean b/LeanPool/QuadraticIterates/Mathlib/Algebra/Squares.lean index 5651b04db4..717606ac11 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Algebra/Squares.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Algebra/Squares.lean @@ -23,7 +23,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- If `P ≡ -Q mod m` with `Q` a unit mod `m` and `P/Q` a rational square, then `-1` is a square mod `m`. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/Data/Int/DvdSequence.lean b/LeanPool/QuadraticIterates/Mathlib/Data/Int/DvdSequence.lean index f4f843b577..c15f215ea1 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Data/Int/DvdSequence.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Data/Int/DvdSequence.lean @@ -23,7 +23,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section variable {R : Type*} [CommRing R] [IsDomain R] [NormalizedGCDMonoid R] diff --git a/LeanPool/QuadraticIterates/Mathlib/Data/Multiset.lean b/LeanPool/QuadraticIterates/Mathlib/Data/Multiset.lean index 2f826933ec..c05b62aaa9 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Data/Multiset.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Data/Multiset.lean @@ -17,7 +17,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- A multiset `M` invariant under an involution `τ` that is fixed-point-free on its support splits as `N + N.map τ`. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/Data/Nat.lean b/LeanPool/QuadraticIterates/Mathlib/Data/Nat.lean index 4503914313..6ec8a6de8d 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Data/Nat.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Data/Nat.lean @@ -22,7 +22,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- If `a ≤ c`, `b ≤ d` and `a * b = c * d` with `c, d` positive, then `a = c` and `b = d`. The positivity hypotheses are needed since `ℕ`-multiplication is not strictly monotone at `0` diff --git a/LeanPool/QuadraticIterates/Mathlib/Data/ZMod.lean b/LeanPool/QuadraticIterates/Mathlib/Data/ZMod.lean index 535063b56c..a9335f88a8 100644 --- a/LeanPool/QuadraticIterates/Mathlib/Data/ZMod.lean +++ b/LeanPool/QuadraticIterates/Mathlib/Data/ZMod.lean @@ -17,7 +17,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- If `m ∣ a + b`, then `b ≡ -a mod m`. -/ lemma ZMod.intCast_eq_neg_intCast_of_dvd_add {a b : ℤ} {m : ℕ} (h : (m : ℤ) ∣ a + b) : diff --git a/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean b/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean index f568bb3db4..b4ad89be89 100644 --- a/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean +++ b/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean @@ -24,7 +24,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- Adjoining a single square root `x` (with `x² ∈ L`) to a field `L` gives degree at most `2`. -/ theorem finrank_adjoin_sq_le {L : Type*} [Field L] {E : Type*} [Field E] [Algebra L E] diff --git a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/Card.lean b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/Card.lean index a7c87caa7e..64e3a7a995 100644 --- a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/Card.lean +++ b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/Card.lean @@ -14,7 +14,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- Between finite groups, an injective homomorphism extends to an isomorphism iff the two groups have the same cardinality. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean index 129e4085cf..69472a922b 100644 --- a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean +++ b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean @@ -28,7 +28,7 @@ not obvious (they sit between `GroupTheory.PGroup`, `RepresentationTheory`, and `Module` files); they are grouped here for now and will be placed during upstreaming. -/ -@[expose] public section +public section /-- A `2`-group acting `ZMod 2`-linearly on a nontrivial finite `𝔽₂`-module fixes some nonzero vector. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/RegularWreathProduct.lean b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/RegularWreathProduct.lean index 577909ef16..79a83e1b3a 100644 --- a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/RegularWreathProduct.lean +++ b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/RegularWreathProduct.lean @@ -21,7 +21,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section /-- For a finite commutative group `H` of exponent `2`, `#H = #(H →* C₂)` where `C₂ = Multiplicative (ZMod 2)`. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/NumberTheory/Moebius.lean b/LeanPool/QuadraticIterates/Mathlib/NumberTheory/Moebius.lean index d105243d89..60ac03bfb9 100644 --- a/LeanPool/QuadraticIterates/Mathlib/NumberTheory/Moebius.lean +++ b/LeanPool/QuadraticIterates/Mathlib/NumberTheory/Moebius.lean @@ -22,7 +22,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section open ArithmeticFunction open scoped ArithmeticFunction.Moebius ArithmeticFunction.zeta diff --git a/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean b/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean index 5d005f971e..49423d508f 100644 --- a/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean +++ b/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean @@ -29,7 +29,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section open scoped ArithmeticFunction.Moebius open UniqueFactorizationMonoid ArithmeticFunction @@ -38,7 +38,7 @@ variable {R : Type*} [CommRing R] [IsDomain R] variable {K : Type*} [Field K] [Algebra R K] [IsFractionRing R K] /-- The Möbius factor of `c` in the fraction field. -/ -noncomputable def moebiusFactorK (c : ℕ → R) (n : ℕ) : K := +@[expose] noncomputable def moebiusFactorK (c : ℕ → R) (n : ℕ) : K := ∏ x ∈ n.divisorsAntidiagonal, (algebraMap R K (c x.2)) ^ (μ x.1) /-- numerator product (μ = 1 part) and denominator product (μ = -1 part), in `R`. -/ diff --git a/LeanPool/QuadraticIterates/Mathlib/RingTheory/UniqueFactorizationDomain.lean b/LeanPool/QuadraticIterates/Mathlib/RingTheory/UniqueFactorizationDomain.lean index 1798fa0823..17daf257ae 100644 --- a/LeanPool/QuadraticIterates/Mathlib/RingTheory/UniqueFactorizationDomain.lean +++ b/LeanPool/QuadraticIterates/Mathlib/RingTheory/UniqueFactorizationDomain.lean @@ -19,7 +19,7 @@ Auxiliary material for the formalization of M. Stoll, *Galois groups over ℚ of polynomials*, Arch. Math. 59 (1992), 239-244; upstreaming candidates for Mathlib. -/ -@[expose] public section +public section open UniqueFactorizationMonoid in /-- If `σ` is a multiplicative automorphism of a normalization UFD and `σ p` is associated to diff --git a/LeanPool/QuantumParallelRepetition.lean b/LeanPool/QuantumParallelRepetition.lean index fd0112ec0f..1c7a1da687 100644 --- a/LeanPool/QuantumParallelRepetition.lean +++ b/LeanPool/QuantumParallelRepetition.lean @@ -18,4 +18,4 @@ Tags: quantum-information, nonlocal-games, parallel-repetition, theoretical-comp MSC: 81P68, 68Q12 -/ -@[expose] public section +public section diff --git a/LeanPool/QuantumParallelRepetition/Part01.lean b/LeanPool/QuantumParallelRepetition/Part01.lean index f6e1a3f111..a393848bad 100644 --- a/LeanPool/QuantumParallelRepetition/Part01.lean +++ b/LeanPool/QuantumParallelRepetition/Part01.lean @@ -17,7 +17,7 @@ public import Mathlib.Tactic.NormNum.RealSqrt /-! # Quantum parallel repetition, part 01 -/ -@[expose] public section +public section noncomputable section @@ -63,11 +63,11 @@ namespace Game variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The first-question marginal of a game. -/ -def marginalX (G : Game X Y A B) (x : X) : ℝ := +@[expose] def marginalX (G : Game X Y A B) (x : X) : ℝ := ∑ y : Y, G.questionWeight x y /-- The second-question marginal of a game. -/ -def marginalY (G : Game X Y A B) (y : Y) : ℝ := +@[expose] def marginalY (G : Game X Y A B) (y : Y) : ℝ := ∑ x : X, G.questionWeight x y theorem marginalX_nonneg (G : Game X Y A B) (x : X) : @@ -119,7 +119,7 @@ def «repeat» (G : Game X Y A B) (n : ℕ) : @[simp] theorem repeat_questionWeight (G : Game X Y A B) (n : ℕ) (xs : Fin n → X) (ys : Fin n → Y) : (G.repeat n).questionWeight xs ys = - ∏ i : Fin n, G.questionWeight (xs i) (ys i) := rfl + ∏ i : Fin n, G.questionWeight (xs i) (ys i) := by rfl @[simp] theorem repeat_predicate_eq_true (G : Game X Y A B) (n : ℕ) (xs : Fin n → X) (ys : Fin n → Y) @@ -183,7 +183,7 @@ variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] variable {G : Game X Y A B} /-- The tensor product of Alice's and Bob's effects for a joint outcome. -/ -def jointEffect (S : Strategy G) (x : X) (y : Y) (a : A) (b : B) : +@[expose] def jointEffect (S : Strategy G) (x : X) (y : Y) (a : A) (b : B) : Matrix (S.Alice × S.Bob) (S.Alice × S.Bob) ℂ := (S.aliceMeasurement x).effect a ⊗ₖ (S.bobMeasurement y).effect b @@ -193,7 +193,7 @@ private theorem jointEffect_positive (S : Strategy G) (x : X) (y : Y) (a : A) (b ((S.bobMeasurement y).positive b) /-- The Born probability of a question-and-answer outcome. -/ -def outcomeProbability (S : Strategy G) (x : X) (y : Y) (a : A) (b : B) : ℝ := +@[expose] def outcomeProbability (S : Strategy G) (x : X) (y : Y) (a : A) (b : B) : ℝ := (Matrix.trace (S.state.matrix * S.jointEffect x y a b)).re theorem outcomeProbability_nonneg (S : Strategy G) @@ -231,7 +231,7 @@ theorem outcomeProbability_normalized (S : Strategy G) (x : X) (y : Y) : _ = 1 := by rw [S.state.trace_one]; rfl /-- The winning probability of the strategy. -/ -def winProbability (S : Strategy G) : ℝ := +@[expose] def winProbability (S : Strategy G) : ℝ := ∑ x : X, ∑ y : Y, G.questionWeight x y * ∑ a : A, ∑ b : B, if G.predicate x y a b = true then S.outcomeProbability x y a b else 0 @@ -276,7 +276,7 @@ theorem winProbability_le_one (S : Strategy G) : S.winProbability ≤ 1 := by end Strategy /-- The supremal winning probability over finite-dimensional entangled strategies. -/ -def entangledValue [Fintype X] [Fintype Y] [Fintype A] [Fintype B] +@[expose] def entangledValue [Fintype X] [Fintype Y] [Fintype A] [Fintype B] (G : Game X Y A B) : ℝ := sSup (Set.range (Strategy.winProbability (G := G))) @@ -309,7 +309,7 @@ theorem entangledValue_nonneg [Fintype X] [Fintype Y] · rw [Set.not_nonempty_iff_eq_empty.mp h, Real.sSup_empty] /-- The entangled value of a coordinatewise repeated game. -/ -def repeatedEntangledValue [Fintype X] [Fintype Y] [Fintype A] [Fintype B] +@[expose] def repeatedEntangledValue [Fintype X] [Fintype Y] [Fintype A] [Fintype B] (G : Game X Y A B) (n : ℕ) : ℝ := entangledValue (G.repeat n) @@ -322,7 +322,7 @@ open scoped BigOperators ComplexConjugate InnerProductSpace variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] /-- The quadratic expectation construction used in the quantum parallel-repetition argument. -/ -def quadraticExpectation (W : H →L[ℂ] H) (z : H) : ℝ := +@[expose] def quadraticExpectation (W : H →L[ℂ] H) (z : H) : ℝ := (⟪z, W z⟫_ℂ).re theorem positive_quadraticExpectation_nonneg @@ -852,7 +852,7 @@ theorem pureDensityMatrix_trace_mul rfl /-- The strategy implementing pure vector. -/ -def pureVectorStrategy +@[expose] def pureVectorStrategy {X Y A B : Type*} {dA dB : Type} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] [Fintype dA] [Fintype dB] [DecidableEq dA] [DecidableEq dB] @@ -940,7 +940,7 @@ namespace FiniteEventLaw variable {Ω ι : Type*} [Fintype Ω] /-- The probability mass of a finite event. -/ -def eventMass (law : FiniteEventLaw Ω) (event : Finset Ω) : ℝ := +@[expose] def eventMass (law : FiniteEventLaw Ω) (event : Finset Ω) : ℝ := ∑ ω ∈ event, law.weight ω theorem eventMass_univ (law : FiniteEventLaw Ω) : @@ -955,7 +955,7 @@ theorem eventMass_mono (fun ω _ _ => law.weight_nonneg ω) /-- The event on which every selected coordinate wins. -/ -def winEvent +@[expose] def winEvent (wins : ι → Ω → Bool) (D : Finset ι) : Finset Ω := Finset.univ.filter (fun ω => ∀ i ∈ D, wins i ω = true) @@ -990,7 +990,7 @@ theorem allWinMass_le_partial [Fintype ι] exact winEvent_antitone wins (Finset.subset_univ D) /-- The conditional mass of failure at a selected coordinate. -/ -def failureMass [DecidableEq ι] +@[expose] def failureMass [DecidableEq ι] (law : FiniteEventLaw Ω) (wins : ι → Ω → Bool) (D : Finset ι) (i : ι) : ℝ := law.eventMass (winEvent wins D) - @@ -1114,7 +1114,7 @@ abbrev StrategyOutcome (X Y A B : Type*) := X × Y × A × B /-- The finite probability law for strategy event. -/ -def strategyEventLaw (G : Game X Y A B) (S : Strategy G) : +@[expose] def strategyEventLaw (G : Game X Y A B) (S : Strategy G) : FiniteEventLaw (StrategyOutcome X Y A B) where weight ω := G.questionWeight ω.1 ω.2.1 * @@ -1189,7 +1189,7 @@ private theorem strategyEventLaw_winEvent split <;> simp /-- The repeated coordinate win construction used in the quantum parallel-repetition argument. -/ -def repeatedCoordinateWin (G : Game X Y A B) (n : ℕ) +@[expose] def repeatedCoordinateWin (G : Game X Y A B) (n : ℕ) (i : Fin n) (ω : StrategyOutcome (Fin n → X) (Fin n → Y) (Fin n → A) (Fin n → B)) : Bool := @@ -1748,7 +1748,7 @@ open scoped BigOperators Topology ComplexOrder MatrixOrder Kronecker Matrix.Norm attribute [local instance] Matrix.normedAddCommGroup Matrix.normedSpace /-- The spectral filter for spectral purification. -/ -def spectralPurificationFilter +@[expose] def spectralPurificationFilter {d : Type*} [Fintype d] [DecidableEq d] (F : Matrix d d ℂ) (hF : F.PosSemidef) (s : ℝ) : Matrix d d ℂ := spectralConjugationCLM hF.isHermitian.eigenvectorUnitary @@ -1812,7 +1812,7 @@ theorem spectralPurificationFilter_gram_integrable spectralPurificationGram_integrable F hF /-- The born trace pairing construction used in the quantum parallel-repetition argument. -/ -def bornTracePairing +@[expose] def bornTracePairing {dA dB : Type*} [Fintype dA] [Fintype dB] (ρ : Matrix (dA × dB) (dA × dB) ℂ) : Matrix dA dA ℂ →ₗ[ℝ] Matrix dB dB ℂ →ₗ[ℝ] ℝ where @@ -1866,11 +1866,11 @@ theorem questionWeight_le_marginalY (Finset.mem_univ x) /-- The conditional y given x construction used in the quantum parallel-repetition argument. -/ -def conditionalYGivenX (G : Game X Y A B) (x : X) (y : Y) : ℝ := +@[expose] def conditionalYGivenX (G : Game X Y A B) (x : X) (y : Y) : ℝ := G.questionWeight x y / G.marginalX x /-- The conditional x given y construction used in the quantum parallel-repetition argument. -/ -def conditionalXGivenY (G : Game X Y A B) (y : Y) (x : X) : ℝ := +@[expose] def conditionalXGivenY (G : Game X Y A B) (y : Y) (x : X) : ℝ := G.questionWeight x y / G.marginalY y theorem conditionalYGivenX_nonneg @@ -1941,12 +1941,12 @@ variable [AddCommGroup U] [Module ℝ U] variable [AddCommGroup V] [Module ℝ V] /-- The finite average of conditional bob. -/ -def conditionalBobAverage +@[expose] def conditionalBobAverage (G : Game X Y A B) (K : Y → V) (x : X) : V := ∑ y : Y, G.conditionalYGivenX x y • K y /-- The finite average of conditional alice. -/ -def conditionalAliceAverage +@[expose] def conditionalAliceAverage (G : Game X Y A B) (H : X → U) (y : Y) : U := ∑ x : X, G.conditionalXGivenY y x • H x @@ -2043,7 +2043,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The measurement effect for conditioned alice. -/ -def conditionedAliceEffect +@[expose] def conditionedAliceEffect (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -2059,7 +2059,7 @@ def conditionedAliceEffect else 0 /-- The measurement effect for conditioned bob. -/ -def conditionedBobEffect +@[expose] def conditionedBobEffect (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -2176,7 +2176,7 @@ open scoped BigOperators ComplexOrder MatrixOrder /-- The spectral support functional construction used in the quantum parallel-repetition argument. -/ -def spectralSupportFunctional +@[expose] def spectralSupportFunctional {d : Type*} [Fintype d] [DecidableEq d] (F : Matrix d d ℂ) (hF : F.PosSemidef) (f : ℝ → ℝ) : Matrix d d ℂ := @@ -2256,7 +2256,7 @@ private def spectralSupportProjection spectralSupportFunctional F hF (fun x => if x = 0 then 0 else 1) /-- The positive square-root construction for spectral support. -/ -def spectralSupportSqrt +@[expose] def spectralSupportSqrt {d : Type*} [Fintype d] [DecidableEq d] (F : Matrix d d ℂ) (hF : F.PosSemidef) : Matrix d d ℂ := spectralSupportFunctional F hF Real.sqrt @@ -2796,7 +2796,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The set of coordinates remaining after full history. -/ -def fullHistoryRemaining (n : ℕ) +@[expose] def fullHistoryRemaining (n : ℕ) (D L : Finset (Fin n)) : Finset (Fin n) := (Finset.univ \ D) \ L @@ -2817,7 +2817,7 @@ def fullHistoryRemaining (n : ℕ) /-- The full history alice question construction used in the quantum parallel-repetition argument. -/ -def fullHistoryAliceQuestion +@[expose] def fullHistoryAliceQuestion {X Y : Type*} {n : ℕ} {D L : Finset (Fin n)} (h : FullSubsetHistory X Y n D L) @@ -2830,7 +2830,7 @@ def fullHistoryAliceQuestion and_self, hiL]⟩ /-- The full history bob question construction used in the quantum parallel-repetition argument. -/ -def fullHistoryBobQuestion +@[expose] def fullHistoryBobQuestion {X Y : Type*} {n : ℕ} {D L : Finset (Fin n)} (h : FullSubsetHistory X Y n D L) @@ -2913,7 +2913,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The probability weight for full history. -/ -def fullHistoryWeight +@[expose] def fullHistoryWeight (G : Game X Y A B) {n : ℕ} {D L : Finset (Fin n)} (h : FullSubsetHistory X Y n D L) : ℝ := @@ -2925,7 +2925,7 @@ def fullHistoryWeight G.marginalY (h.bobRemaining i)) /-- The probability weight for full history hidden alice. -/ -def fullHistoryHiddenAliceWeight +@[expose] def fullHistoryHiddenAliceWeight (G : Game X Y A B) {n : ℕ} {D L : Finset (Fin n)} (h : FullSubsetHistory X Y n D L) @@ -2934,7 +2934,7 @@ def fullHistoryHiddenAliceWeight G.conditionalXGivenY (h.bobRemaining i) (hidden i) /-- The probability weight for full history hidden bob. -/ -def fullHistoryHiddenBobWeight +@[expose] def fullHistoryHiddenBobWeight (G : Game X Y A B) {n : ℕ} {D L : Finset (Fin n)} (h : FullSubsetHistory X Y n D L) @@ -3120,7 +3120,7 @@ theorem fullHistoryWeight_mul_hidden ← Finset.prod_union hDR, hcover] /-- The spectral filter for full history alice. -/ -def fullHistoryAliceFilter +@[expose] def fullHistoryAliceFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D L : Finset (Fin n)) @@ -3133,7 +3133,7 @@ def fullHistoryAliceFilter (fullHistoryAliceQuestion h hidden) /-- The spectral filter for full history bob. -/ -def fullHistoryBobFilter +@[expose] def fullHistoryBobFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D L : Finset (Fin n)) @@ -3174,7 +3174,7 @@ theorem fullHistoryBobFilter_posSemidef (fullHistoryHiddenBobWeight_nonneg G h hidden) /-- The indicator function for full history win. -/ -def fullHistoryWinIndicator +@[expose] def fullHistoryWinIndicator (G : Game X Y A B) {n : ℕ} {D L : Finset (Fin n)} (h : FullSubsetHistory X Y n D L) @@ -4337,7 +4337,7 @@ private theorem spectralEntropyKernel_eq_scalar_sub_filter The weighted spectral filter variance construction used in the quantum parallel-repetition argument. -/ -def weightedSpectralFilterVariance +@[expose] def weightedSpectralFilterVariance {ι d : Type*} [Fintype ι] [Fintype d] [DecidableEq d] (weight : ι → ℝ) (F : ι → Matrix d d ℂ) (M : Matrix d d ℂ) @@ -5039,7 +5039,7 @@ theorem matrixLogEntropy_born_nonpos_right exact neg_nonneg.mp hpair /-- The potential function controlling full history alice entropy. -/ -def fullHistoryAliceEntropyPotential +@[expose] def fullHistoryAliceEntropyPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D L : Finset (Fin n)) : ℝ := @@ -5077,7 +5077,7 @@ theorem fullHistoryAliceEntropyPotential_nonpos end HistoryContractions /-- The finite atom representing positive matrix spectral. -/ -def positiveMatrixSpectralAtom +@[expose] def positiveMatrixSpectralAtom {d : Type*} [Fintype d] [DecidableEq d] (F : Matrix d d ℂ) (hF : F.PosSemidef) (i : d) : Matrix d d ℂ := @@ -5450,7 +5450,7 @@ open WithLp open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The quantum state representing raw embezzlement. -/ -def rawEmbezzlementState (n : ℕ) : +@[expose] def rawEmbezzlementState (n : ℕ) : EuclideanSpace ℂ (Fin n × Fin n) := toLp 2 fun q : Fin n × Fin n => if q.1 = q.2 then @@ -5469,7 +5469,7 @@ theorem rawEmbezzlementState_ne_zero Real.sqrt_one, Complex.ofReal_one, inv_one, PiLp.zero_apply, one_ne_zero, j] at hj /-- The harmonic number construction used in the quantum parallel-repetition argument. -/ -def harmonicNumber (n : ℕ) : ℝ := +@[expose] def harmonicNumber (n : ℕ) : ℝ := ∑ j : Fin n, ((j.val : ℝ) + 1)⁻¹ theorem rawEmbezzlementState_norm_sq (n : ℕ) : @@ -5515,7 +5515,7 @@ theorem rawEmbezzlementState_norm_sq (n : ℕ) : _ = ((i.val : ℝ) + 1)⁻¹ := hamp i /-- The quantum state representing embezzlement. -/ -def embezzlementState (n : ℕ) : +@[expose] def embezzlementState (n : ℕ) : EuclideanSpace ℂ (Fin n × Fin n) := (‖rawEmbezzlementState n‖⁻¹ : ℝ) • rawEmbezzlementState n @@ -5543,7 +5543,7 @@ abbrev BipartiteUnitVector (d : ℕ) := {ξ : EuclideanSpace ℂ (Fin d × Fin d) // ‖ξ‖ = 1} /-- The overlap quantity for spectral atom. -/ -def spectralAtomOverlap +@[expose] def spectralAtomOverlap {d : Type*} [Fintype d] [DecidableEq d] (F G : Matrix d d ℂ) (hF : F.PosSemidef) (hG : G.PosSemidef) @@ -5669,7 +5669,7 @@ theorem rectangularMatrix_norm_sq rw [dotProduct_comm] /-- The finite outcome encoding for coherent binary joint. -/ -def coherentBinaryJointOutcome +@[expose] def coherentBinaryJointOutcome {d e : Type*} [Fintype d] [Fintype e] [DecidableEq d] [DecidableEq e] (P : POVM Bool d) (Q : POVM Bool e) @@ -5712,7 +5712,7 @@ theorem coherentBinaryJointOutcome_norm_sq (pureDensityMatrix_trace_mul z hz K).symm /-- The state vector representing finite tensor. -/ -def finiteTensorVector +@[expose] def finiteTensorVector {ι d : Type*} [Fintype ι] (v : ι → EuclideanSpace ℂ d) : EuclideanSpace ℂ (ι → d) := @@ -5887,7 +5887,7 @@ theorem spectralAtomOverlap_schmidtMass_le_one _ = 1 := by rw [hf, hg]; norm_num /-- The probability of binary born. -/ -def binaryBornProbability +@[expose] def binaryBornProbability {d e : Type*} [Fintype d] [Fintype e] [DecidableEq d] [DecidableEq e] (ρ : DensityMatrix (d × e)) @@ -5937,7 +5937,7 @@ theorem binaryBornProbability_normalized rfl /-- The probability of binary continue. -/ -def binaryContinueProbability +@[expose] def binaryContinueProbability {d e : Type*} [Fintype d] [Fintype e] [DecidableEq d] [DecidableEq e] (ρ : DensityMatrix (d × e)) @@ -5945,7 +5945,7 @@ def binaryContinueProbability binaryBornProbability ρ P Q false false /-- The probability of binary joint success. -/ -def binaryJointSuccessProbability +@[expose] def binaryJointSuccessProbability {d e : Type*} [Fintype d] [Fintype e] [DecidableEq d] [DecidableEq e] (ρ : DensityMatrix (d × e)) @@ -5953,7 +5953,7 @@ def binaryJointSuccessProbability binaryBornProbability ρ P Q true true /-- The probability of binary mismatch. -/ -def binaryMismatchProbability +@[expose] def binaryMismatchProbability {d e : Type*} [Fintype d] [Fintype e] [DecidableEq d] [DecidableEq e] (ρ : DensityMatrix (d × e)) @@ -5995,7 +5995,7 @@ theorem unitVector_distance_of_real_overlap /-- The shared threshold resource raw construction used in the quantum parallel-repetition argument. -/ -def sharedThresholdResourceRaw +@[expose] def sharedThresholdResourceRaw {κ d : Type*} [DecidableEq κ] [DecidableEq d] (τ : κ → ℝ) : @@ -6044,7 +6044,7 @@ theorem sharedThresholdResourceRaw_ne_zero exact hk (by exact_mod_cast hcast) /-- The auxiliary resource for shared threshold. -/ -def sharedThresholdResource +@[expose] def sharedThresholdResource {κ d : Type*} [Fintype κ] [Fintype d] [DecidableEq κ] [DecidableEq d] (τ : κ → ℝ) : @@ -6065,7 +6065,7 @@ theorem sharedThresholdResource_norm inv_mul_cancel₀ hnorm] /-- The positive operator-valued measurement implementing transpose. -/ -def transposePOVM +@[expose] def transposePOVM {ι d : Type*} [Fintype ι] [Fintype d] [DecidableEq d] (P : POVM ι d) : POVM ι d where effect b := (P.effect b).transpose @@ -6539,7 +6539,7 @@ private theorem twoSidedSchmidtSpectralEnergy_le linarith [sq_nonneg ((inner ℂ ψ φ).re - 1)] /-- The target object for tensor embezzlement. -/ -def tensorEmbezzlementTarget +@[expose] def tensorEmbezzlementTarget {d n : ℕ} (ξ : BipartiteUnitVector d) : EuclideanSpace ℂ (Fin (d * n) × Fin (d * n)) := toLp 2 fun q : Fin (d * n) × Fin (d * n) => @@ -6608,7 +6608,7 @@ theorem tensorEmbezzlementTarget_norm nlinarith [norm_nonneg (tensorEmbezzlementTarget (n := n) ξ)] /-- The operator action for local unitary. -/ -def localUnitaryAction {n : ℕ} +@[expose] def localUnitaryAction {n : ℕ} (U V : Matrix.unitaryGroup (Fin n) ℂ) (ψ : EuclideanSpace ℂ (Fin n × Fin n)) : EuclideanSpace ℂ (Fin n × Fin n) := @@ -6668,13 +6668,13 @@ theorem unitary_col_norm_sq_sum sub_neg_eq_add, hnorm, Matrix.one_apply_eq, Complex.one_re] using h /-- The overlap quantity for unitary basis. -/ -def unitaryBasisOverlap +@[expose] def unitaryBasisOverlap {d : Type*} [Fintype d] [DecidableEq d] (U V : Matrix.unitaryGroup d ℂ) : Matrix.unitaryGroup d ℂ := U⁻¹ * V /-- The quantum state representing diagonal schmidt. -/ -def diagonalSchmidtState +@[expose] def diagonalSchmidtState {d : Type*} [DecidableEq d] (σ : d → ℝ) : EuclideanSpace ℂ (d × d) := toLp 2 fun q : d × d => @@ -6699,7 +6699,7 @@ theorem diagonalSchmidtState_norm_sq simp only [Finset.sum_ite_eq, Finset.mem_univ, ↓reduceIte] /-- The state vector representing schmidt. -/ -def schmidtVector +@[expose] def schmidtVector {d : ℕ} (σ : Fin d → ℝ) (U V : Matrix.unitaryGroup (Fin d) ℂ) : @@ -7060,7 +7060,7 @@ open Complex Matrix Finset section /-- The unitary operator implementing orthonormal basis. -/ -def orthonormalBasisUnitary +@[expose] def orthonormalBasisUnitary {d : ℕ} (b : OrthonormalBasis (Fin d) ℂ (EuclideanSpace ℂ (Fin d))) : @@ -7077,7 +7077,7 @@ def orthonormalBasisUnitary rfl /-- The unitary operator implementing conjugate. -/ -def conjugateUnitary +@[expose] def conjugateUnitary {d : ℕ} (U : Matrix.unitaryGroup (Fin d) ℂ) : Matrix.unitaryGroup (Fin d) ℂ := by diff --git a/LeanPool/QuantumParallelRepetition/Part02.lean b/LeanPool/QuantumParallelRepetition/Part02.lean index 7d8beafab1..1debb51811 100644 --- a/LeanPool/QuantumParallelRepetition/Part02.lean +++ b/LeanPool/QuantumParallelRepetition/Part02.lean @@ -13,7 +13,7 @@ public import Mathlib.NumberTheory.Harmonic.Bounds /-! # Quantum parallel repetition, part 02 -/ -@[expose] public section +public section noncomputable section @@ -137,7 +137,7 @@ open WithLp open scoped BigOperators Kronecker /-- The quantum state representing e pr. -/ -def ePRState (m : ℕ) : +@[expose] def ePRState (m : ℕ) : EuclideanSpace ℂ (Fin m × Fin m) := toLp 2 fun q : Fin m × Fin m => if q.1 = q.2 then @@ -194,7 +194,7 @@ def permutationUnitary {ι : Type*} [Fintype ι] [DecidableEq ι] (σ : Equiv.Perm ι) : (permutationUnitary σ : Matrix ι ι ℂ) = - σ.permMatrix ℂ := rfl + σ.permMatrix ℂ := by rfl theorem localPermutationUnitaryAction_apply {n : ℕ} (σ : Equiv.Perm (Fin n)) @@ -1118,7 +1118,7 @@ theorem exists_proofUniversalHarmonicCatalyst _ ≤ ε := hsqrt /-- The unitary operator implementing coherent shared random controlled. -/ -def coherentSharedRandomControlledUnitary +@[expose] def coherentSharedRandomControlledUnitary {Ω d : Type*} [Fintype Ω] [Fintype d] [DecidableEq Ω] [DecidableEq d] @@ -1143,7 +1143,7 @@ def coherentSharedRandomControlledUnitary Matrix.one_apply, hων, hij] /-- The positive operator-valued measurement implementing spectral partition. -/ -def spectralPartitionPOVM +@[expose] def spectralPartitionPOVM {κ d : Type*} [Fintype κ] [Fintype d] [DecidableEq κ] [DecidableEq d] (F : Matrix d d ℂ) (hF : F.PosSemidef) @@ -1951,7 +1951,7 @@ theorem dSVCanonicalFailurePrefix_card /-- The DSV canonical failure prefix construction used in the quantum parallel-repetition argument. -/ -def dSVCanonicalFailurePrefix +@[expose] def dSVCanonicalFailurePrefix {d : ℕ} (r : Fin (d + 1)) : EuclideanSpace ℂ (Fin d × Fin d) := toLp 2 fun q : Fin d × Fin d => @@ -2156,7 +2156,7 @@ open WithLp open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The positive operator-valued measurement implementing DSV global projector binary. -/ -def dSVGlobalProjectorBinaryPOVM +@[expose] def dSVGlobalProjectorBinaryPOVM {κ d : Type*} [Fintype κ] [Fintype d] [DecidableEq κ] [DecidableEq d] (P : κ → Matrix d d ℂ) @@ -2265,7 +2265,7 @@ section open scoped BigOperators /-- The DSV rational soft pass construction used in the quantum parallel-repetition argument. -/ -def dSVRationalSoftPass (t x : ℝ) : ℝ := +@[expose] def dSVRationalSoftPass (t x : ℝ) : ℝ := x / (x + t) theorem dSVRationalSoftPass_mem_unit @@ -2367,7 +2367,7 @@ theorem dSVSoftBobLeftReducedDensity_trace _ = 1 := targetReducedDensity_trace ζ /-- The unitary operator implementing DSV original computational reindexed. -/ -def dSVOriginalComputationalReindexedUnitary +@[expose] def dSVOriginalComputationalReindexedUnitary {ι : Type*} [Fintype ι] [DecidableEq ι] {D : ℕ} (e : ι ≃ Fin D) (U : Matrix.unitaryGroup ι ℂ) : @@ -2398,7 +2398,7 @@ open scoped BigOperators ComplexOrder /-- The DSV heterogeneous real prefix construction used in the quantum parallel-repetition argument. -/ -def dSVHeterogeneousRealPrefix +@[expose] def dSVHeterogeneousRealPrefix (continuation : ℕ → ℝ) (k : ℕ) : ℝ := ∏ i ∈ Finset.range k, continuation i @@ -2477,7 +2477,7 @@ abbrev DSVUniformDensityThresholdLocalIndex Σ _ : Fin N, Fin d /-- The quantum state representing DSV uniform density threshold shared. -/ -def dSVUniformDensityThresholdSharedState +@[expose] def dSVUniformDensityThresholdSharedState (N d : ℕ) : EuclideanSpace ℂ (DSVUniformDensityThresholdLocalIndex N d × @@ -2523,7 +2523,7 @@ theorem dSVUniformDensityThresholdSharedState_mismatchedWork The DSV uniform density threshold shared density construction used in the quantum parallel- repetition argument. -/ -def dSVUniformDensityThresholdSharedDensity +@[expose] def dSVUniformDensityThresholdSharedDensity {N d : ℕ} (grid : 0 < N) (dimension : 0 < d) : DensityMatrix (DSVUniformDensityThresholdLocalIndex N d × @@ -3121,6 +3121,7 @@ private theorem sharedPermutation_disagreement_card_mul ((left \ right) ∪ (right \ left)) hsubset /-- The probability of uniform permutation. -/ +@[expose] def uniformPermutationProbability (event : Equiv.Perm α → Prop) : ℝ := by classical exact ((Finset.univ.filter fun permutation : Equiv.Perm α => @@ -3543,12 +3544,12 @@ theorem quadratic_le_klFun {x : ℝ} (hx : 0 ≤ x) : linarith /-- The entropy quantity for finite relative. -/ -def finiteRelativeEntropy {ι : Type*} [Fintype ι] +@[expose] def finiteRelativeEntropy {ι : Type*} [Fintype ι] (p q : ι → ℝ) : ℝ := ∑ i, q i * InformationTheory.klFun (p i / q i) /-- The finite total variation construction used in the quantum parallel-repetition argument. -/ -def finiteTotalVariation {ι : Type*} [Fintype ι] +@[expose] def finiteTotalVariation {ι : Type*} [Fintype ι] (p q : ι → ℝ) : ℝ := (∑ i, |p i - q i|) / 2 @@ -3771,7 +3772,7 @@ variable {ι : Type*} [Fintype ι] [DecidableEq ι] /-- The distribution floor numerator construction used in the quantum parallel-repetition argument. -/ -def distributionFloorNumerator (denominator : ℕ) (p : ι → ℝ) : ι → ℕ := +@[expose] def distributionFloorNumerator (denominator : ℕ) (p : ι → ℝ) : ι → ℕ := fun i => Nat.floor (p i * (denominator : ℝ)) /-- @@ -4039,7 +4040,7 @@ section CoarseGraining variable {κ : Type*} [Fintype κ] [DecidableEq κ] /-- The total probability mass of grouped. -/ -def groupedMass (map : ι → κ) (p : ι → ℝ) (j : κ) : ℝ := +@[expose] def groupedMass (map : ι → κ) (p : ι → ℝ) (j : κ) : ℝ := ∑ i ∈ (Finset.univ.filter fun i => map i = j), p i omit [DecidableEq ι] [Fintype κ] in @@ -4103,11 +4104,11 @@ section JointChainRule variable {κ : Type*} [Fintype κ] /-- The marginal distribution of joint first. -/ -def jointFirstMarginal (joint : ι × κ → ℝ) : ι → ℝ := +@[expose] def jointFirstMarginal (joint : ι × κ → ℝ) : ι → ℝ := fun i => ∑ j : κ, joint (i, j) /-- The joint conditional construction used in the quantum parallel-repetition argument. -/ -def jointConditional (joint : ι × κ → ℝ) (i : ι) : κ → ℝ := +@[expose] def jointConditional (joint : ι × κ → ℝ) (i : ι) : κ → ℝ := fun j => joint (i, j) / jointFirstMarginal joint i omit [Fintype ι] [DecidableEq ι] in @@ -4641,7 +4642,7 @@ private theorem dSVUniformLeftDensityConjugateSwap_distance The DSV uniform left density schmidt coefficient construction used in the quantum parallel- repetition argument. -/ -def dSVUniformLeftDensitySchmidtCoefficient +@[expose] def dSVUniformLeftDensitySchmidtCoefficient {d : ℕ} (ξ : BipartiteUnitVector d) (i : Fin d) : ℝ := Real.sqrt @@ -4651,7 +4652,7 @@ def dSVUniformLeftDensitySchmidtCoefficient The DSV uniform left density spectral atom discrepancy construction used in the quantum parallel-repetition argument. -/ -def dSVUniformLeftDensitySpectralAtomDiscrepancy +@[expose] def dSVUniformLeftDensitySpectralAtomDiscrepancy {d : ℕ} (ξ ζ : BipartiteUnitVector d) : ℝ := ∑ i : Fin d, ∑ j : Fin d, |dSVUniformLeftDensitySchmidtCoefficient ξ i ^ 2 - @@ -4714,7 +4715,7 @@ theorem dSVUniformDensityThresholdGrid_apply ring /-- The probability weight for DSV uniform density threshold. -/ -def dSVUniformDensityThresholdWeight +@[expose] def dSVUniformDensityThresholdWeight (N : ℕ) (_k : Fin N) : ℝ := 1 / (N : ℝ) @@ -4728,7 +4729,7 @@ theorem dSVUniformDensityThresholdWeight_nonneg The DSV uniform density grid prefix construction used in the quantum parallel-repetition argument. -/ -def dSVUniformDensityGridPrefix +@[expose] def dSVUniformDensityGridPrefix (N : ℕ) (density : ℝ) : ℝ := ∑ k : Fin N, dSVUniformDensityThresholdWeight N k * @@ -4752,7 +4753,7 @@ theorem dSVUniformDensityGridPrefix_eq_count The DSV uniform density threshold mismatch construction used in the quantum parallel-repetition argument. -/ -def dSVUniformDensityThresholdMismatch +@[expose] def dSVUniformDensityThresholdMismatch (N : ℕ) (alice bob : ℝ) : ℝ := ∑ k : Fin N, dSVUniformDensityThresholdWeight N k * @@ -4944,7 +4945,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] attribute [local instance] Classical.propDecidable /-- The normalize or default construction used in the quantum parallel-repetition argument. -/ -def normalizeOrDefault (fallback z : E) : E := +@[expose] def normalizeOrDefault (fallback z : E) : E := if z = 0 then fallback else NormedSpace.normalize z theorem normalizeOrDefault_norm @@ -5021,7 +5022,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder The DSV canonical failure unit rank family construction used in the quantum parallel-repetition argument. -/ -def dSVCanonicalFailureUnitRankFamily +@[expose] def dSVCanonicalFailureUnitRankFamily (d : ℕ) (positive : 0 < d) (rank : Fin (d + 1)) : BipartiteUnitVector d := ⟨normalizeOrDefault @@ -5064,7 +5065,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder The DSV uniform density threshold left bob basis construction used in the quantum parallel- repetition argument. -/ -def dSVUniformDensityThresholdLeftBobBasis +@[expose] def dSVUniformDensityThresholdLeftBobBasis {d : ℕ} (ζ : BipartiteUnitVector d) : Matrix.unitaryGroup (Fin d) ℂ := (dSVSoftBobLeftReducedDensity_posSemidef ζ).isHermitian.eigenvectorUnitary @@ -5321,7 +5322,7 @@ def dSVUniformDensityThresholdWholeHistoryTargetSplitEquiv The DSV uniform density alice history spectral copy construction used in the quantum parallel- repetition argument. -/ -def dSVUniformDensityAliceHistorySpectralCopy +@[expose] def dSVUniformDensityAliceHistorySpectralCopy {N d : ℕ} (ξ : BipartiteUnitVector d) : Matrix.unitaryGroup (DSVUniformDensityThresholdLocalIndex N d) ℂ := @@ -5526,6 +5527,7 @@ def commonPurificationGenerator /-- The common purification subspace construction used in the quantum parallel-repetition argument. -/ +@[expose] def commonPurificationSubspace {ι d : Type*} [Fintype d] [DecidableEq d] (F : ι → Matrix d d ℂ) (M : Matrix d d ℂ) @@ -5643,6 +5645,7 @@ private theorem spectralPurificationFilterEntryLp_eq_eigen_sum rw [ht] filter_upwards [hentry, hsum, hgenerator] with s he hs hg rw [he, hs] + rw [spectralPurificationFilter, spectralConjugationCLM_apply] change ((U : Matrix d d ℂ) * Matrix.diagonal (fun k => @@ -5689,7 +5692,7 @@ theorem mean_spectralPurificationFilterEntryLp_mem_common The ensemble purification subspace entry construction used in the quantum parallel-repetition argument. -/ -def ensemblePurificationSubspaceEntry +@[expose] def ensemblePurificationSubspaceEntry {ι d : Type*} [Fintype d] [DecidableEq d] (F : ι → Matrix d d ℂ) (M : Matrix d d ℂ) (positive : ∀ i, (F i).PosSemidef) @@ -5732,7 +5735,7 @@ noncomputable def commonPurificationOrthonormalBasis (commonPurificationSubspace F M positive hM) /-- The matrix representation of finite purification. -/ -noncomputable def finitePurificationMatrix +@[expose] noncomputable def finitePurificationMatrix {ι d : Type*} [Fintype ι] [Fintype d] [DecidableEq d] (F : ι → Matrix d d ℂ) (M : Matrix d d ℂ) (positive : ∀ i, (F i).PosSemidef) @@ -6251,7 +6254,7 @@ theorem reindexedMatrixQuadratic rw [dotProduct_comm] /-- The positive operator-valued measurement implementing purification alice. -/ -def purificationAlicePOVM +@[expose] def purificationAlicePOVM {ι d k : Type*} [Fintype ι] [Fintype d] [Fintype k] [DecidableEq d] [DecidableEq k] (P : POVM ι d) : POVM ι (d × k) where @@ -6368,7 +6371,7 @@ theorem purifiedStrategy_winProbability simp_rw [purifiedStrategy_outcomeProbability] /-- The matrix representation of finite local purification joint. -/ -def finiteLocalPurificationJointMatrix +@[expose] def finiteLocalPurificationJointMatrix {X Y A B eA eB : Type*} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] {G : Game X Y A B} (S : Strategy G) @@ -6379,7 +6382,7 @@ def finiteLocalPurificationJointMatrix (1 : Matrix (S.Alice × S.Bob) (S.Alice × S.Bob) ℂ)) ⊗ₖ KB /-- The state vector representing finite local purification. -/ -def finiteLocalPurificationVector +@[expose] def finiteLocalPurificationVector {X Y A B eA eB : Type*} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] {G : Game X Y A B} (S : Strategy G) @@ -6466,6 +6469,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder The DSV uniform density physical async sigma continuation construction used in the quantum parallel-repetition argument. -/ +@[expose] def dSVUniformDensityPhysicalAsyncSigmaContinuation {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] @@ -6775,7 +6779,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder The DSV uniform density corrected matched sigma weighted residual construction used in the quantum parallel-repetition argument. -/ -def dSVUniformDensityCorrectedMatchedSigmaWeightedResidual +@[expose] def dSVUniformDensityCorrectedMatchedSigmaWeightedResidual {H : Type*} {n : ℕ} (history : EuclideanSpace ℂ (H × H)) (work : H → H → EuclideanSpace ℂ (Fin n × Fin n)) : @@ -6874,7 +6878,7 @@ attribute [local instance] Classical.propDecidable The DSV density rational projective threshold bin construction used in the quantum parallel- repetition argument. -/ -def dSVDensityRationalProjectiveThresholdBin +@[expose] def dSVDensityRationalProjectiveThresholdBin (w : ℝ) (N : ℕ) (k : Fin N) (a : ℝ) : Bool := decide (dSVUniformDensityThresholdGrid N k ≤ dSVRationalSoftPass w a) @@ -6882,7 +6886,7 @@ def dSVDensityRationalProjectiveThresholdBin /-- The positive operator-valued measurement implementing DSV density rational projective threshold. -/ -def dSVDensityRationalProjectiveThresholdPOVM +@[expose] def dSVDensityRationalProjectiveThresholdPOVM {ι : Type*} [Fintype ι] [DecidableEq ι] (w : ℝ) (N : ℕ) (k : Fin N) (F : Matrix ι ι ℂ) (positive : F.PosSemidef) : POVM Bool ι := @@ -6908,7 +6912,7 @@ theorem dSVDensityRationalProjectiveThresholdPOVM_projective The positive operator-valued measurement implementing DSV density rational left projective threshold. -/ -def dSVDensityRationalLeftProjectiveThresholdPOVM +@[expose] def dSVDensityRationalLeftProjectiveThresholdPOVM {d : ℕ} (w : ℝ) (N : ℕ) (k : Fin N) (ξ : BipartiteUnitVector d) : POVM Bool (Fin d) := dSVDensityRationalProjectiveThresholdPOVM w N k @@ -6919,7 +6923,7 @@ def dSVDensityRationalLeftProjectiveThresholdPOVM The DSV density rational left projective threshold atom mismatch construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalLeftProjectiveThresholdAtomMismatch +@[expose] def dSVDensityRationalLeftProjectiveThresholdAtomMismatch {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) : ℝ := let F := dSVSoftBobLeftReducedDensity ξ @@ -7062,7 +7066,7 @@ theorem dSVUniformDensityGridPrefix_density_sub_le positive nonnegative bounded] /-- The total probability mass of DSV density rational left projective diagonal. -/ -def dSVDensityRationalLeftProjectiveDiagonalMass +@[expose] def dSVDensityRationalLeftProjectiveDiagonalMass {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) : ℝ := let hF := dSVSoftBobLeftReducedDensity_posSemidef ξ diff --git a/LeanPool/QuantumParallelRepetition/Part03.lean b/LeanPool/QuantumParallelRepetition/Part03.lean index 7dda564628..e3f2024e7c 100644 --- a/LeanPool/QuantumParallelRepetition/Part03.lean +++ b/LeanPool/QuantumParallelRepetition/Part03.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part02 /-! # Quantum parallel repetition, part 03 -/ -@[expose] public section +public section noncomputable section @@ -686,7 +686,7 @@ theorem dSVDensityRationalGrid_density_defect_le The DSV density rational canonical accepted coefficient construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalCanonicalAcceptedCoefficient +@[expose] def dSVDensityRationalCanonicalAcceptedCoefficient {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) (i : Fin d) : ℝ := Real.sqrt (w * dSVUniformDensityGridPrefix N @@ -732,7 +732,7 @@ theorem dSVDensityRationalCanonicalAliceBasis_target (exists_proofDSVUniformDensityPolarLeftCanonicalSchmidt ξ) /-- The target object for DSV density rational canonical accepted. -/ -def dSVDensityRationalCanonicalAcceptedTarget +@[expose] def dSVDensityRationalCanonicalAcceptedTarget {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) : EuclideanSpace ℂ (Fin d × Fin d) := @@ -1402,7 +1402,7 @@ attribute [local instance] Classical.propDecidable The DSV density rational complete physical stopping copy accepted construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalCompletePhysicalStoppingCopyAccepted +@[expose] def dSVDensityRationalCompletePhysicalStoppingCopyAccepted {N d : ℕ} (w : ℝ) (ξ : BipartiteUnitVector d) (q : DSVUniformDensityThresholdLocalIndex N d) : Prop := dSVDensityRationalProjectiveThresholdBin w N q.1 @@ -1417,7 +1417,7 @@ open WithLp open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The finite outcome encoding for DSV density rational physical accepted. -/ -def dSVDensityRationalPhysicalAcceptedOutcome +@[expose] def dSVDensityRationalPhysicalAcceptedOutcome {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) : EuclideanSpace ℂ @@ -1565,7 +1565,7 @@ theorem The DSV density rational prefix rank mismatch construction used in the quantum parallel- repetition argument. -/ -def dSVDensityRationalPrefixRankMismatch +@[expose] def dSVDensityRationalPrefixRankMismatch {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) : ℝ := (∑ i : Fin d, ∑ j : Fin d, @@ -2003,7 +2003,7 @@ theorem dSVDensityRationalMixedAcceptedPrefix_norm_sq The DSV density rational physical mixed accepted prefix work construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalPhysicalMixedAcceptedPrefixWork +@[expose] def dSVDensityRationalPhysicalMixedAcceptedPrefixWork {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) (i j : Fin d) : EuclideanSpace ℂ (Fin N × Fin N) := @@ -2030,7 +2030,7 @@ open WithLp open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The diagonal mask selecting accepted threshold and spectral coordinates. -/ -def dSVDensityRationalCanonicalPrefixMask +@[expose] def dSVDensityRationalCanonicalPrefixMask {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) : Matrix (DSVUniformDensityThresholdLocalIndex N d) @@ -2094,10 +2094,11 @@ private theorem dSVDensityRationalPhysicalAcceptedProjector_eq_spectralMask dSVDensityRationalLeftProjectiveThresholdPOVM dSVDensityRationalProjectiveThresholdPOVM rw [spectralPartitionPOVM_effect_eq_spectralDiagonal] - rfl + simp only [spectralConjugationCLM_apply, dSVUniformDensityThresholdLeftBobBasis, + Matrix.UnitaryGroup.inv_val] /-- The finite outcome encoding for DSV density rational canonical prefix spectral. -/ -def dSVDensityRationalCanonicalPrefixSpectralOutcome +@[expose] def dSVDensityRationalCanonicalPrefixSpectralOutcome {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) : EuclideanSpace ℂ @@ -2117,7 +2118,7 @@ def dSVDensityRationalCanonicalPrefixSpectralOutcome w N ξ ζ))) /-- The measurement effect for DSV density rational complete stopped optional local. -/ -def dSVDensityRationalCompleteStoppedOptionalLocalEffect +@[expose] def dSVDensityRationalCompleteStoppedOptionalLocalEffect {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) : Option Bool → Matrix @@ -2129,7 +2130,7 @@ def dSVDensityRationalCompleteStoppedOptionalLocalEffect w N ξ).effect outcome /-- The finite outcome encoding for DSV density rational complete stopped optional. -/ -def dSVDensityRationalCompleteStoppedOptionalOutcome +@[expose] def dSVDensityRationalCompleteStoppedOptionalOutcome {d : ℕ} (w : ℝ) (N : ℕ) (ξ ζ : BipartiteUnitVector d) (alice bob : Option Bool) : @@ -2166,7 +2167,7 @@ theorem dSVDensityRationalCompleteStoppedOptionalOutcome_none_none mul_zero, mul_one, kroneckerMap_one_one, one_mulVec, toLp_ofLp] /-- The finite schedule for DSV density rational complete stopped optional local. -/ -def dSVDensityRationalCompleteStoppedOptionalLocalSchedule +@[expose] def dSVDensityRationalCompleteStoppedOptionalLocalSchedule (L : ℕ) (hit copy : Fin (L + 1)) : Option Bool := if copy.val < L then if hit = 0 then some false @@ -2199,7 +2200,7 @@ open scoped Kronecker ComplexOrder MatrixOrder The DSV density rational first accept local spectral mask construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalFirstAcceptLocalSpectralMask +@[expose] def dSVDensityRationalFirstAcceptLocalSpectralMask {d : ℕ} (w : ℝ) (N : ℕ) (ξ : BipartiteUnitVector d) (outcome : Bool) : Matrix (DSVUniformDensityThresholdLocalIndex N d) @@ -2257,7 +2258,8 @@ theorem dSVDensityRationalFirstAcceptPhysicalEffect_eq_spectralMask unfold dSVDensityRationalLeftProjectiveThresholdPOVM dSVDensityRationalProjectiveThresholdPOVM rw [spectralPartitionPOVM_effect_eq_spectralDiagonal] - rfl + simp only [spectralConjugationCLM_apply, dSVUniformDensityThresholdLeftBobBasis, + Matrix.UnitaryGroup.inv_val] theorem dSVDensityRationalFirstAcceptLocalSpectralMask_transpose {d : ℕ} (w : ℝ) (N : ℕ) @@ -2740,7 +2742,7 @@ open WithLp open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The transcript representation for DSV density rational public bucket coherent phase. -/ -def dSVDensityRationalPublicBucketCoherentPhaseHistory +@[expose] def dSVDensityRationalPublicBucketCoherentPhaseHistory {H : Type*} (B : ℕ) (history : EuclideanSpace ℂ (H × H)) : EuclideanSpace ℂ ((Fin B × H) × (Fin B × H)) := @@ -2778,7 +2780,7 @@ theorem dSVDensityRationalPublicBucketCoherentPhaseHistory_apply_norm_sq not_false_eq_true, zero_pow, zero_mul] /-- The quantum state representing DSV density rational public bucket coherent phase sigma. -/ -def dSVDensityRationalPublicBucketCoherentPhaseSigmaState +@[expose] def dSVDensityRationalPublicBucketCoherentPhaseSigmaState {H : Type*} {m : ℕ} (B : ℕ) (history : EuclideanSpace ℂ (H × H)) (work : Fin B → H → H → @@ -2956,7 +2958,7 @@ def dSVDensityRationalPublicLogRankFineLabel Nat.floor ((Q : ℝ) * Real.log ((max 1 r.val : ℕ) : ℝ)) /-- The probability weight for DSV density rational public log rank phase. -/ -def dSVDensityRationalPublicLogRankPhaseWeight +@[expose] def dSVDensityRationalPublicLogRankPhaseWeight (B : ℕ) (_ : Fin B) : ℝ := 1 / (B : ℝ) @@ -2973,7 +2975,7 @@ theorem dSVDensityRationalPublicLogRankPhaseWeight_sum The DSV density rational public log rank bucket construction used in the quantum parallel- repetition argument. -/ -def dSVDensityRationalPublicLogRankBucket +@[expose] def dSVDensityRationalPublicLogRankBucket {N B : ℕ} (Q : ℕ) (phase : Fin B) (r : Fin (N + 1)) : Option ℕ := if r.val = 0 then none @@ -3246,7 +3248,7 @@ theorem dSVDensityRationalPublicMultiscalePhase_card_pos exact pow_pos positive S /-- The overlap quantity for DSV density rational prefix harmonic spectral. -/ -def dSVDensityRationalPrefixHarmonicSpectralOverlap +@[expose] def dSVDensityRationalPrefixHarmonicSpectralOverlap {d : ℕ} (ξ ζ : BipartiteUnitVector d) (i j : Fin d) : ℝ := spectralAtomOverlap @@ -3288,7 +3290,7 @@ theorem dSVDensityRationalLocalSpectralPairBasisOverlap_norm_sq (dSVSoftBobLeftReducedDensity_posSemidef ζ) i j).symm /-- The transcript representation for DSV density rational local spectral pair. -/ -def dSVDensityRationalLocalSpectralPairHistory +@[expose] def dSVDensityRationalLocalSpectralPairHistory {d : ℕ} (N : ℕ) (ξ ζ : BipartiteUnitVector d) : EuclideanSpace ℂ (Fin d × Fin d) := @@ -3946,7 +3948,7 @@ abbrev DSVDensityRationalPublicMultiscalePhaseHistoryLocalIndex The DSV density rational public multiscale phase residual construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalPublicMultiscalePhaseResidual +@[expose] def dSVDensityRationalPublicMultiscalePhaseResidual (S B N d L m : ℕ) : ℕ := dSVDensityRationalPublicLogPhaseResidual (Fintype.card (DSVDensityRationalPublicMultiscalePhase S B)) @@ -3955,7 +3957,7 @@ def dSVDensityRationalPublicMultiscalePhaseResidual /-- The finite equivalence encoding DSV density rational public multiscale phase target first index. -/ -def dSVDensityRationalPublicMultiscalePhaseTargetFirstIndexEquiv +@[expose] def dSVDensityRationalPublicMultiscalePhaseTargetFirstIndexEquiv (S B N d L m : ℕ) : (DSVDensityRationalPublicMultiscalePhaseHistoryLocalIndex S B N d L × Fin m) ≃ @@ -3967,7 +3969,7 @@ def dSVDensityRationalPublicMultiscalePhaseTargetFirstIndexEquiv N d L m /-- The source object for DSV density rational public multiscale phase target first prepared. -/ -def dSVDensityRationalPublicMultiscalePhaseTargetFirstPreparedSource +@[expose] def dSVDensityRationalPublicMultiscalePhaseTargetFirstPreparedSource (S B N d L m : ℕ) : EuclideanSpace ℂ (Fin (d * @@ -4005,7 +4007,7 @@ open scoped BigOperators ComplexOrder Kronecker MatrixOrder The DSV density rational public log phase actual target first local lift construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalPublicLogPhaseActualTargetFirstLocalLift +@[expose] def dSVDensityRationalPublicLogPhaseActualTargetFirstLocalLift (B N d L m : ℕ) (U : Matrix.unitaryGroup (DSVDensityRationalPublicLogPhaseHistoryLocalIndex @@ -4254,7 +4256,7 @@ theorem The DSV density rational heterogeneous actual copy accepted construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousActualCopyAccepted +@[expose] def dSVDensityRationalHeterogeneousActualCopyAccepted {S N d L : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ : BipartiteUnitVector d) @@ -4267,7 +4269,7 @@ def dSVDensityRationalHeterogeneousActualCopyAccepted The DSV density rational heterogeneous actual copy condition construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousActualCopyCondition +@[expose] def dSVDensityRationalHeterogeneousActualCopyCondition {β : Type*} {L : ℕ} (accepted : Fin L → β → Prop) (flag : Fin (L + 1)) (i : Fin (L + 1)) (atom : β) : Prop := @@ -4415,7 +4417,7 @@ theorem then D i atom else 0)).symm /-- The unitary operator implementing DSV density rational heterogeneous actual physical local. -/ -def dSVDensityRationalHeterogeneousActualPhysicalLocalUnitary +@[expose] def dSVDensityRationalHeterogeneousActualPhysicalLocalUnitary {β : Type*} [Fintype β] [DecidableEq β] {L : ℕ} (accepted : Fin L → β → Prop) (U : Matrix.unitaryGroup β ℂ) : @@ -4454,7 +4456,7 @@ def dSVDensityRationalHeterogeneousActualBobUnitary ((dSVUniformDensityBobHistoryCopyBasis (N := N) ζ)⁻¹) /-- The quantum state representing DSV density rational heterogeneous actual physical. -/ -def dSVDensityRationalHeterogeneousActualPhysicalState +@[expose] def dSVDensityRationalHeterogeneousActualPhysicalState (N : ℕ) {S d L : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) : @@ -4496,7 +4498,7 @@ section open scoped BigOperators ComplexOrder Kronecker MatrixOrder /-- The finite outcome encoding for DSV density rational heterogeneous physical stage. -/ -def dSVDensityRationalHeterogeneousPhysicalStageOutcome +@[expose] def dSVDensityRationalHeterogeneousPhysicalStageOutcome {d S L : ℕ} (N : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) @@ -4510,7 +4512,7 @@ def dSVDensityRationalHeterogeneousPhysicalStageOutcome The DSV density rational heterogeneous physical stage continue construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousPhysicalStageContinue +@[expose] def dSVDensityRationalHeterogeneousPhysicalStageContinue {d S L : ℕ} (N : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) (k : ℕ) : ℝ := @@ -4521,7 +4523,7 @@ def dSVDensityRationalHeterogeneousPhysicalStageContinue The DSV density rational heterogeneous physical stage success construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousPhysicalStageSuccess +@[expose] def dSVDensityRationalHeterogeneousPhysicalStageSuccess {d S L : ℕ} (N : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) (k : ℕ) : ℝ := @@ -4594,7 +4596,7 @@ theorem The DSV density rational heterogeneous physical survival construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousPhysicalSurvival +@[expose] def dSVDensityRationalHeterogeneousPhysicalSurvival {d S L : ℕ} (N : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) (k : ℕ) : ℝ := @@ -4615,7 +4617,7 @@ theorem dSVDensityRationalHeterogeneousPhysicalSurvival_nonneg N width schedule ξ ζ j false false /-- The total probability mass of DSV density rational heterogeneous physical stopped success. -/ -def dSVDensityRationalHeterogeneousPhysicalStoppedSuccessMass +@[expose] def dSVDensityRationalHeterogeneousPhysicalStoppedSuccessMass {d S L : ℕ} (N : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) : ℝ := @@ -4639,7 +4641,7 @@ def dSVDensityRationalHeterogeneousPhysicalStoppedAsynchronousMass N width schedule ξ ζ k /-- The total probability mass of DSV density rational heterogeneous physical terminal. -/ -def dSVDensityRationalHeterogeneousPhysicalTerminalMass +@[expose] def dSVDensityRationalHeterogeneousPhysicalTerminalMass {d S L : ℕ} (N : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) : ℝ := @@ -5318,20 +5320,20 @@ open scoped BigOperators variable {α : Type*} [Fintype α] [DecidableEq α] /-- The probability weight for fair partition. -/ -def fairPartitionWeight (α : Type*) [Fintype α] : ℝ := +@[expose] def fairPartitionWeight (α : Type*) [Fintype α] : ℝ := ((2 : ℝ) ^ Fintype.card α)⁻¹ /-- The probability weight for reverse partition. -/ -def reversePartitionWeight (s : Finset α) : ℝ := +@[expose] def reversePartitionWeight (s : Finset α) : ℝ := fairPartitionWeight α * (2 * (s.card : ℝ) / (Fintype.card α : ℝ)) /-- The probability weight for forward marked partition. -/ -def forwardMarkedPartitionWeight (α : Type*) [Fintype α] : ℝ := +@[expose] def forwardMarkedPartitionWeight (α : Type*) [Fintype α] : ℝ := 2 * fairPartitionWeight α / (Fintype.card α : ℝ) /-- The probability weight for reverse marked partition. -/ -def reverseMarkedPartitionWeight (s : Finset α) (i : α) : ℝ := +@[expose] def reverseMarkedPartitionWeight (s : Finset α) (i : α) : ℝ := if i ∈ s then reversePartitionWeight s / (s.card : ℝ) else 0 omit [DecidableEq α] in @@ -5771,7 +5773,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The full history answer count construction used in the quantum parallel-repetition argument. -/ -def fullHistoryAnswerCount +@[expose] def fullHistoryAnswerCount {A B : Type*} [Fintype A] [Fintype B] {n : ℕ} (D : Finset (Fin n)) : ℝ := (Fintype.card ({i : Fin n // i ∈ D} → A) : ℝ) * @@ -5804,7 +5806,7 @@ def fullHistoryAtomCountingWeight fullHistoryWinIndicator G t.1 t.2.1 t.2.2 /-- The total probability mass of full history atom born. -/ -def fullHistoryAtomBornMass +@[expose] def fullHistoryAtomBornMass (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D L : Finset (Fin n)) @@ -6049,7 +6051,7 @@ private def fullCoordinateBaseOfOldHistory ⟨j, fullHistoryRemaining_insert_subset D L i j.property⟩ /-- The transcript representation for full coordinate old. -/ -def fullCoordinateOldHistory +@[expose] def fullCoordinateOldHistory {X Y : Type*} {n : ℕ} (D L : Finset (Fin n)) (i : Fin n) (h : FullCoordinateRevealHistory X Y n D L i) @@ -6078,7 +6080,7 @@ private def fullCoordinateBaseOfNewHistory bobRemaining := h.bobRemaining /-- The transcript representation for full coordinate new. -/ -def fullCoordinateNewHistory +@[expose] def fullCoordinateNewHistory {X Y : Type*} {n : ℕ} (D L : Finset (Fin n)) (i : Fin n) (h : FullCoordinateRevealHistory X Y n D L i) @@ -6303,7 +6305,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The probability weight for full coordinate base. -/ -def fullCoordinateBaseWeight +@[expose] def fullCoordinateBaseWeight (G : Game X Y A B) {n : ℕ} (D L : Finset (Fin n)) (i : Fin n) (h : FullCoordinateRevealHistory X Y n D L i) : ℝ := @@ -6679,7 +6681,7 @@ def fullCoordinateAliceMeanFilter (fullCoordinateOldHistory D L i r y) α /-- Bob's history filter for the selected question and the previously revealed history. -/ -def fullCoordinateBobQuestionFilter +@[expose] def fullCoordinateBobQuestionFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D L : Finset (Fin n)) (i : Fin n) (r : FullCoordinateRevealHistory X Y n D L i) @@ -7180,7 +7182,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The indicator function for full coordinate base win. -/ -def fullCoordinateBaseWinIndicator +@[expose] def fullCoordinateBaseWinIndicator (G : Game X Y A B) {n : ℕ} (D L : Finset (Fin n)) (i : Fin n) (r : FullCoordinateRevealHistory X Y n D L i) diff --git a/LeanPool/QuantumParallelRepetition/Part04.lean b/LeanPool/QuantumParallelRepetition/Part04.lean index 06c04e4d26..396c583922 100644 --- a/LeanPool/QuantumParallelRepetition/Part04.lean +++ b/LeanPool/QuantumParallelRepetition/Part04.lean @@ -10,7 +10,7 @@ public import Mathlib.Analysis.Convex.SpecificFunctions.Pow /-! # Quantum parallel repetition, part 04 -/ -@[expose] public section +public section noncomputable section @@ -403,13 +403,13 @@ open scoped BigOperators attribute [local instance] Classical.propDecidable /-- The exact left construction used in the quantum parallel-repetition argument. -/ -def exactLeft +@[expose] def exactLeft {M : Type*} [Fintype M] [DecidableEq M] (coordinate : M) (partition : M → Bool) : Finset M := Finset.univ.filter fun j => j ≠ coordinate ∧ partition j = false /-- The exact right construction used in the quantum parallel-repetition argument. -/ -def exactRight +@[expose] def exactRight {M : Type*} [Fintype M] [DecidableEq M] (coordinate : M) (partition : M → Bool) : Finset M := Finset.univ.filter fun j => j ≠ coordinate ∧ partition j = true @@ -453,7 +453,7 @@ abbrev ExactRemainingSeed ExactForwardSeed (SourceRemainingCoordinate D) /-- The rank map for exact left. -/ -def exactLeftRank +@[expose] def exactLeftRank {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : {j : M // j ∈ exactLeft seed.coordinate seed.partition} ≃ @@ -462,7 +462,7 @@ def exactLeftRank (Finset.equivFin (exactLeft seed.coordinate seed.partition)) /-- The rank map for exact right. -/ -def exactRightRank +@[expose] def exactRightRank {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : {j : M // j ∈ exactRight seed.coordinate seed.partition} ≃ @@ -471,7 +471,7 @@ def exactRightRank (Finset.equivFin (exactRight seed.coordinate seed.partition)) /-- The exact left prefix construction used in the quantum parallel-repetition argument. -/ -def exactLeftPrefix +@[expose] def exactLeftPrefix {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : Finset M := (Finset.univ.filter @@ -481,7 +481,7 @@ def exactLeftPrefix Subtype.val /-- The exact right prefix construction used in the quantum parallel-repetition argument. -/ -def exactRightPrefix +@[expose] def exactRightPrefix {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : Finset M := (Finset.univ.filter @@ -509,7 +509,7 @@ theorem exactRightPrefix_subset exact ha ▸ a.property /-- The probability weight for exact seed. -/ -def exactSeedWeight +@[expose] def exactSeedWeight {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : ℝ := (1 / (Fintype.card M : ℝ)) * @@ -1168,7 +1168,7 @@ abbrev ExactFullQuestion (Fin n → X) × (Fin n → Y) /-- The finite encoding of exact reveal. -/ -def exactRevealCode +@[expose] def exactRevealCode {n : ℕ} (D : Finset (Fin n)) (seed : ExactRemainingSeed D) (q : ExactFullQuestion X Y n) : @@ -1181,7 +1181,7 @@ def exactRevealCode aliceRightPrefix j := q.1 j.val.val /-- The probability weight for exact prior question. -/ -def exactPriorQuestionWeight +@[expose] def exactPriorQuestionWeight (G : Game X Y A B) (n : ℕ) (q : ExactFullQuestion X Y n) : ℝ := (G.repeat n).questionWeight q.1 q.2 @@ -1200,7 +1200,7 @@ theorem exactPriorQuestionWeight_sum Fintype.sum_prod_type] using (G.repeat n).weight_normalized /-- The total probability mass of exact reveal. -/ -def exactRevealMass +@[expose] def exactRevealMass (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1236,7 +1236,7 @@ theorem exactRevealMass_sum exact exactPriorQuestionWeight_sum G n /-- The total probability mass of exact alice question. -/ -def exactAliceQuestionMass +@[expose] def exactAliceQuestionMass (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1249,7 +1249,7 @@ def exactAliceQuestionMass else 0 /-- The total probability mass of exact bob question. -/ -def exactBobQuestionMass +@[expose] def exactBobQuestionMass (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1262,7 +1262,7 @@ def exactBobQuestionMass else 0 /-- The total probability mass of exact joint question. -/ -def exactJointQuestionMass +@[expose] def exactJointQuestionMass (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1304,7 +1304,7 @@ theorem exactBobQuestionMass_nonneg · exact le_rfl /-- The spectral filter for exact alice question. -/ -def exactAliceQuestionFilter +@[expose] def exactAliceQuestionFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1321,7 +1321,7 @@ def exactAliceQuestionFilter else 0 /-- The spectral filter for exact bob question. -/ -def exactBobQuestionFilter +@[expose] def exactBobQuestionFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1378,7 +1378,7 @@ theorem exactBobQuestionFilter_posSemidef · exact Matrix.PosSemidef.zero /-- The spectral filter for exact alice mean. -/ -def exactAliceMeanFilter +@[expose] def exactAliceMeanFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1389,7 +1389,7 @@ def exactAliceMeanFilter exactAliceQuestionFilter G n S D seed history answer x /-- The spectral filter for exact bob mean. -/ -def exactBobMeanFilter +@[expose] def exactBobMeanFilter (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1559,6 +1559,7 @@ theorem exactBobCoordinateFilter_sum The exact alice purification family construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactAlicePurificationFamily (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -1573,6 +1574,7 @@ def exactAlicePurificationFamily /-- The exact bob purification family construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactBobPurificationFamily (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -1651,7 +1653,7 @@ abbrev ExactBobLiftIndex Matrix.PosSemidef.zero)) /-- The matrix representation of exact alice purification. -/ -def exactAlicePurificationMatrix +@[expose] def exactAlicePurificationMatrix (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1669,7 +1671,7 @@ def exactAlicePurificationMatrix Matrix.PosSemidef.zero q /-- The matrix representation of exact bob purification. -/ -def exactBobPurificationMatrix +@[expose] def exactBobPurificationMatrix (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -1810,6 +1812,7 @@ abbrev ExactBobLocalIndex G n S D r.seed r.history r.bobAnswer /-- The exact unnormalized psi construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactUnnormalizedPsi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -1825,6 +1828,7 @@ def exactUnnormalizedPsi G n S D r.seed r.history r.bobAnswer (.inl y)) /-- The exact unnormalized phi construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactUnnormalizedPhi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -1840,6 +1844,7 @@ def exactUnnormalizedPhi G n S D r.seed r.history r.bobAnswer (.inl y)) /-- The exact unnormalized gamma construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactUnnormalizedGamma (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -2045,7 +2050,7 @@ abbrev ExactPaddedLocalIndex ExactBobLocalIndex G n S D r) /-- The state vector representing exact padded. -/ -def exactPaddedVector +@[expose] def exactPaddedVector (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) @@ -2095,6 +2100,7 @@ theorem exactPaddedVector_sub simp only [exactPaddedVector, PiLp.sub_apply, sub_zero] /-- The exact padded default construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactPaddedDefault (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -2114,7 +2120,7 @@ theorem exactPaddedDefault_norm simp only [exactPaddedDefault, PiLp.norm_single, norm_one] /-- The exact psi construction used in the quantum parallel-repetition argument. -/ -def exactPsi +@[expose] def exactPsi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) @@ -2127,6 +2133,7 @@ def exactPsi (exactUnnormalizedPsi G n S D r x y)) /-- The exact phi construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactPhi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -2140,6 +2147,7 @@ def exactPhi (exactUnnormalizedPhi G n S D r y)) /-- The exact gamma construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactGamma (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -2334,7 +2342,7 @@ theorem exactQuestionWeight_rectangle · simp only [hBob] /-- The probability weight for exact fiber question. -/ -def exactFiberQuestionWeight +@[expose] def exactFiberQuestionWeight (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -2400,7 +2408,7 @@ def exactFiberBobMarginal exactFiberQuestionWeight G n D seed history x y xs ys /-- The total probability mass of exact fiber question. -/ -def exactFiberQuestionMass +@[expose] def exactFiberQuestionMass (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -2753,7 +2761,7 @@ theorem pureVectorWinningProbability_eq (pureVerifierEffect G z hz PA PB x y) /-- The probability weight for flagged question. -/ -def flaggedQuestionWeight +@[expose] def flaggedQuestionWeight (G : Game X Y A B) (flagWeight : J → ℝ) (ω : J × (X × Y)) : ℝ := flagWeight ω.1 * G.questionWeight ω.2.1 ω.2.2 @@ -2787,18 +2795,18 @@ open Filter open scoped Topology /-- A universal upper bound for the accumulated rounding error. -/ -def universalErrorCeiling (K₀ : ℝ) : ℝ := +@[expose] def universalErrorCeiling (K₀ : ℝ) : ℝ := K₀ * (1 + (2 : ℝ) ^ (1 / 6 : ℝ)) + 2 /-- The combined information-theoretic loss from the sampling steps. -/ -def totalSamplingLoss (K₀ α η lam : ℝ) : ℝ := +@[expose] def totalSamplingLoss (K₀ α η lam : ℝ) : ℝ := 5 * lam + 2 * (K₀ * (α ^ (1 / 12 : ℝ) + (32 * η) ^ (1 / 12 : ℝ)) + Real.sqrt (8 * η) + universalErrorCeiling K₀ * lam) /-- The numerical bound for rounded winning lower. -/ -def roundedWinningLowerBound (ε K₀ α η lam : ℝ) : ℝ := +@[expose] def roundedWinningLowerBound (ε K₀ α η lam : ℝ) : ℝ := 1 - ε / 2 - totalSamplingLoss K₀ α η lam theorem totalSamplingLoss_tendsto_zero @@ -3334,7 +3342,7 @@ open scoped BigOperators ComplexConjugate ComplexOrder Kronecker MatrixOrder Matrix.Norms.L2Operator InnerProductSpace /-- The state vector representing normalized pure. -/ -def normalizedPureVector +@[expose] def normalizedPureVector {d : Type*} [Fintype d] (z : EuclideanSpace ℂ d) : EuclideanSpace ℂ d := ((‖z‖⁻¹ : ℝ) : ℂ) • z @@ -3654,7 +3662,7 @@ section FiniteSamples variable {ι Ω : Type*} [Fintype ι] [DecidableEq ι] [Fintype Ω] /-- The total probability mass of postselection. -/ -def postselectionMass +@[expose] def postselectionMass (law : FiniteEventLaw Ω) (wins : ι → Ω → Bool) (C : Finset ι) : ℝ := law.eventMass (FiniteEventLaw.winEvent wins C) @@ -3681,14 +3689,14 @@ theorem postselectionMass_le_one The conditional coordinate failure construction used in the quantum parallel-repetition argument. -/ -def conditionalCoordinateFailure +@[expose] def conditionalCoordinateFailure (law : FiniteEventLaw Ω) (wins : ι → Ω → Bool) (C : Finset ι) (i : ι) : ℝ := FiniteEventLaw.failureMass law wins C i / postselectionMass law wins C /-- The uniform remaining failure construction used in the quantum parallel-repetition argument. -/ -def uniformRemainingFailure +@[expose] def uniformRemainingFailure (law : FiniteEventLaw Ω) (wins : ι → Ω → Bool) (C : Finset ι) : ℝ := (∑ i ∈ Finset.univ \ C, @@ -3722,7 +3730,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The total probability mass of repeated postselection. -/ -def repeatedPostselectionMass +@[expose] def repeatedPostselectionMass (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (C : Finset (Fin n)) : ℝ := postselectionMass (strategyEventLaw (G.repeat n) S) @@ -3834,20 +3842,20 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The postselection log cost construction used in the quantum parallel-repetition argument. -/ -def postselectionLogCost +@[expose] def postselectionLogCost (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ℝ := Real.log (1 / repeatedPostselectionMass G n S D) /-- The answer log cost construction used in the quantum parallel-repetition argument. -/ -def answerLogCost +@[expose] def answerLogCost {A B : Type*} [Fintype A] [Fintype B] {n : ℕ} (D : Finset (Fin n)) : ℝ := (D.card : ℝ) * Real.log ((Fintype.card A : ℝ) * (Fintype.card B : ℝ)) /-- The error rate associated with martingale. -/ -def martingaleRate +@[expose] def martingaleRate (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ℝ := (postselectionLogCost G n S D + @@ -4913,7 +4921,7 @@ abbrev LocalQuestionContext SourceRemainingCoordinate D × (X × Y) /-- The probability weight for local question. -/ -def localQuestionWeight +@[expose] def localQuestionWeight (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (c : LocalQuestionContext X Y D) : ℝ := G.questionWeight c.2.1 c.2.2 / @@ -4949,7 +4957,7 @@ theorem localQuestionWeight_sum exact div_self hcard /-- The probability distribution for conditioned event. -/ -def conditionedEventDistribution +@[expose] def conditionedEventDistribution {Ω : Type*} [Fintype Ω] (law : FiniteEventLaw Ω) (event : Finset Ω) : Ω → ℝ := fun ω => if ω ∈ event then law.weight ω / law.eventMass event else 0 @@ -5062,7 +5070,7 @@ theorem conditionedEventDistribution_projection_relativeEntropy_le law event positive /-- The finite probability law for repeated conditioned outcome. -/ -def repeatedConditionedOutcomeLaw +@[expose] def repeatedConditionedOutcomeLaw (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : StrategyOutcome @@ -5385,7 +5393,7 @@ theorem groupedMass_id simp only [sum_singleton] /-- The finite prefix mask construction used in the quantum parallel-repetition argument. -/ -def finitePrefixMask +@[expose] def finitePrefixMask {Ω Y : Type*} {h : ℕ} (base : Y) (k : Fin (h + 1)) : (Ω × (Fin h → Y)) → (Ω × (Fin h → Y)) := @@ -5422,7 +5430,7 @@ theorem finitePrefixMask_last simp only [finitePrefixMask, Fin.val_last, Fin.is_lt, ↓reduceIte, id_eq] /-- The entropy quantity for finite prefix relative. -/ -def finitePrefixRelativeEntropy +@[expose] def finitePrefixRelativeEntropy {Ω Y : Type*} [Fintype Ω] [Fintype Y] {h : ℕ} (joint prior : Ω × (Fin h → Y) → ℝ) (base : Y) (k : Fin (h + 1)) : ℝ := @@ -5651,7 +5659,7 @@ theorem exactRemainingSeedWeight_sum simpa only [Fintype.card_coe, card_pos] using remaining /-- The finite probability law for exact postselected joint. -/ -def exactPostselectedJointLaw +@[expose] def exactPostselectedJointLaw (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (q : ExactJointOutcome X Y A B D) : ℝ := @@ -5703,7 +5711,7 @@ theorem exactPostselectedJointLaw_sum _ = 1 := exactRemainingSeedWeight_sum D remaining /-- The exact source pushforward construction used in the quantum parallel-repetition argument. -/ -def exactSourcePushforward +@[expose] def exactSourcePushforward {K : Type*} (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) @@ -5762,7 +5770,7 @@ abbrev ExactLocallySampleableTuple (X × (Y × ExactHistoryFlag X Y A B D)) /-- The finite encoding of exact history. -/ -def exactHistoryCode +@[expose] def exactHistoryCode {n : ℕ} (D : Finset (Fin n)) (q : ExactJointOutcome X Y A B D) : ExactHistoryFlag X Y A B D where @@ -5772,7 +5780,7 @@ def exactHistoryCode bobAnswer := fun j => q.2.2.2.2 j.val /-- The finite encoding of exact locally sampleable. -/ -def exactLocallySampleableCode +@[expose] def exactLocallySampleableCode {n : ℕ} (D : Finset (Fin n)) (q : ExactJointOutcome X Y A B D) : ExactLocallySampleableTuple X Y A B D := @@ -5782,7 +5790,7 @@ def exactLocallySampleableCode exactHistoryCode D q) /-- The finite probability law for exact locally sampleable. -/ -def exactLocallySampleableLaw +@[expose] def exactLocallySampleableLaw (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ExactLocallySampleableTuple X Y A B D → ℝ := @@ -5888,7 +5896,7 @@ theorem exactBobLocalMass_nonneg /-- The exact alice local conditional construction used in the quantum parallel-repetition argument. -/ -def exactAliceLocalConditional +@[expose] def exactAliceLocalConditional {n : ℕ} (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) (Q : ExactLocallySampleableTuple X Y A B D → ℝ) @@ -5903,7 +5911,7 @@ def exactAliceLocalConditional /-- The exact bob local conditional construction used in the quantum parallel-repetition argument. -/ -def exactBobLocalConditional +@[expose] def exactBobLocalConditional {n : ℕ} (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) (Q : ExactLocallySampleableTuple X Y A B D → ℝ) @@ -6372,7 +6380,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The probability weight for exact conditional question. -/ -def exactConditionalQuestionWeight +@[expose] def exactConditionalQuestionWeight (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) @@ -6558,7 +6566,7 @@ theorem exactJointCoordinateFilter_born G n S D bobAnswer ys seed.coordinate.val b) /-- The total probability mass of exact joint conditional winning. -/ -def exactJointConditionalWinningMass +@[expose] def exactJointConditionalWinningMass (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (seed : ExactRemainingSeed D) diff --git a/LeanPool/QuantumParallelRepetition/Part05.lean b/LeanPool/QuantumParallelRepetition/Part05.lean index 4a4c1bb503..fc3acf06c8 100644 --- a/LeanPool/QuantumParallelRepetition/Part05.lean +++ b/LeanPool/QuantumParallelRepetition/Part05.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part04 /-! # Quantum parallel repetition, part 05 -/ -@[expose] public section +public section noncomputable section @@ -29,7 +29,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The total probability mass of exact fixed bob question. -/ -def exactFixedBobQuestionMass +@[expose] def exactFixedBobQuestionMass (G : Game X Y A B) (n : ℕ) (fixed : Finset (Fin n)) (xs : Fin n → X) (known : Fin n → Y) : ℝ := @@ -39,7 +39,7 @@ def exactFixedBobQuestionMass else 0 /-- The total probability mass of exact fixed alice question. -/ -def exactFixedAliceQuestionMass +@[expose] def exactFixedAliceQuestionMass (G : Game X Y A B) (n : ℕ) (fixed : Finset (Fin n)) (known : Fin n → X) (ys : Fin n → Y) : ℝ := @@ -263,14 +263,14 @@ open scoped BigOperators attribute [local instance] Classical.propDecidable /-- The exact reverse left side construction used in the quantum parallel-repetition argument. -/ -def exactReverseLeftSide +@[expose] def exactReverseLeftSide {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : Finset M := insert seed.coordinate (exactLeft seed.coordinate seed.partition) /-- The exact reverse right side construction used in the quantum parallel-repetition argument. -/ -def exactReverseRightSide +@[expose] def exactReverseRightSide {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : Finset M := insert seed.coordinate @@ -454,7 +454,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The exact history accepted construction used in the quantum parallel-repetition argument. -/ -def exactHistoryAccepted +@[expose] def exactHistoryAccepted (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) : Prop := @@ -586,6 +586,7 @@ theorem exactGlobalHistoryLocalIndex_card_pos The exact global history fin reindex construction used in the quantum parallel-repetition argument. -/ +@[expose] def exactGlobalHistoryFinReindex (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : @@ -641,7 +642,7 @@ def exactGlobalHistoryFinPhi /-- The exact global history fin psi construction used in the quantum parallel-repetition argument. -/ -def exactGlobalHistoryFinPsi +@[expose] def exactGlobalHistoryFinPsi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) @@ -706,7 +707,7 @@ def exactSourceTuplePsi G n S D t.2.2.2 t.2.1 t.2.2.1).val /-- The exact source tuple gamma construction used in the quantum parallel-repetition argument. -/ -def exactSourceTupleGamma +@[expose] def exactSourceTupleGamma (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (t : ExactLocallySampleableTuple X Y A B D) : @@ -715,7 +716,7 @@ def exactSourceTupleGamma G n S D t.2.2.2 t.2.1).val /-- The exact source tuple phi construction used in the quantum parallel-repetition argument. -/ -def exactSourceTuplePhi +@[expose] def exactSourceTuplePhi (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (t : ExactLocallySampleableTuple X Y A B D) : @@ -847,7 +848,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- Alice's question-to-mean entropy increment paired with Bob's question filter. -/ -def exactFairAliceQuestionEntropyIncrement +@[expose] def exactFairAliceQuestionEntropyIncrement (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) (y : Y) : ℝ := @@ -863,7 +864,7 @@ def exactFairAliceQuestionEntropyIncrement G n S D r.seed r.history r.bobAnswer y) /-- Bob's question-to-mean entropy increment paired with Alice's question filter. -/ -def exactFairBobQuestionEntropyIncrement +@[expose] def exactFairBobQuestionEntropyIncrement (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) (x : X) : ℝ := @@ -1110,7 +1111,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The error rate associated with exact source classical information. -/ -def exactSourceClassicalInformationRate +@[expose] def exactSourceClassicalInformationRate (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ℝ := (3 * postselectionLogCost G n S D + @@ -1176,7 +1177,7 @@ def exactBobInformationEquiv The exact alice information posterior construction used in the quantum parallel-repetition argument. -/ -def exactAliceInformationPosterior +@[expose] def exactAliceInformationPosterior (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : (SourceRemainingCoordinate D × X) × @@ -1189,7 +1190,7 @@ def exactAliceInformationPosterior The exact alice information reference construction used in the quantum parallel-repetition argument. -/ -def exactAliceInformationReference +@[expose] def exactAliceInformationReference (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : @@ -1203,7 +1204,7 @@ def exactAliceInformationReference The exact bob information posterior construction used in the quantum parallel-repetition argument. -/ -def exactBobInformationPosterior +@[expose] def exactBobInformationPosterior (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : (SourceRemainingCoordinate D × Y) × @@ -1216,7 +1217,7 @@ def exactBobInformationPosterior The exact bob information reference construction used in the quantum parallel-repetition argument. -/ -def exactBobInformationReference +@[expose] def exactBobInformationReference (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : @@ -1349,7 +1350,7 @@ theorem exact_source_equation_twenty_four_bob p q hp hq hac hpnorm hqnorm /-- The error rate associated with exact source pinsker. -/ -def exactSourcePinskerRate +@[expose] def exactSourcePinskerRate (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ℝ := Real.sqrt (exactSourceClassicalInformationRate G n S D / 2) @@ -1677,7 +1678,7 @@ variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] The exact alice source marginal information construction used in the quantum parallel-repetition argument. -/ -def exactAliceSourceMarginalInformation +@[expose] def exactAliceSourceMarginalInformation (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : ℝ := @@ -1691,7 +1692,7 @@ def exactAliceSourceMarginalInformation The exact bob source marginal information construction used in the quantum parallel-repetition argument. -/ -def exactBobSourceMarginalInformation +@[expose] def exactBobSourceMarginalInformation (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : ℝ := @@ -1705,7 +1706,7 @@ def exactBobSourceMarginalInformation The exact alice source conditional information construction used in the quantum parallel- repetition argument. -/ -def exactAliceSourceConditionalInformation +@[expose] def exactAliceSourceConditionalInformation (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : ℝ := @@ -1722,7 +1723,7 @@ def exactAliceSourceConditionalInformation The exact bob source conditional information construction used in the quantum parallel- repetition argument. -/ -def exactBobSourceConditionalInformation +@[expose] def exactBobSourceConditionalInformation (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (base : ExactHistoryFlag X Y A B D) : ℝ := @@ -1975,7 +1976,7 @@ open scoped BigOperators attribute [local instance] Classical.propDecidable /-- The exact ordered side prefix construction used in the quantum parallel-repetition argument. -/ -def exactOrderedSidePrefix +@[expose] def exactOrderedSidePrefix {M : Type*} [DecidableEq M] (side : Finset M) (rank : {j : M // j ∈ side} ≃ Fin side.card) @@ -2049,7 +2050,7 @@ structure ExactReverseSideContext The exact reverse context other prefix construction used in the quantum parallel-repetition argument. -/ -def exactReverseContextOtherPrefix +@[expose] def exactReverseContextOtherPrefix {M : Type*} [Fintype M] [DecidableEq M] {side : Finset M} (context : ExactReverseSideContext M side) : Finset M := @@ -2085,7 +2086,7 @@ theorem exactReverseRightSide_complement exactReverseRightSide, hcoordinate, hbit] /-- The data context recording exact reverse alice. -/ -def exactReverseAliceContext +@[expose] def exactReverseAliceContext {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : ExactReverseSideContext M @@ -2099,7 +2100,7 @@ def exactReverseAliceContext otherSide_eq_complement := exactReverseLeftSide_complement seed /-- The data context recording exact reverse bob. -/ -def exactReverseBobContext +@[expose] def exactReverseBobContext {M : Type*} [Fintype M] [DecidableEq M] (seed : ExactForwardSeed M) : ExactReverseSideContext M @@ -2127,7 +2128,7 @@ def exactDefaultReverseSideContext The exact reverse alice context at construction used in the quantum parallel-repetition argument. -/ -def exactReverseAliceContextAt +@[expose] def exactReverseAliceContextAt {M : Type*} [Fintype M] [DecidableEq M] (side : Finset M) (seed : ExactForwardSeed M) : ExactReverseSideContext M side := @@ -2139,7 +2140,7 @@ def exactReverseAliceContextAt /-- The exact reverse bob context at construction used in the quantum parallel-repetition argument. -/ -def exactReverseBobContextAt +@[expose] def exactReverseBobContextAt {M : Type*} [Fintype M] [DecidableEq M] (side : Finset M) (seed : ExactForwardSeed M) : ExactReverseSideContext M side := @@ -2218,7 +2219,7 @@ abbrev ExactReverseBobFixedInformation j ∈ exactReverseContextOtherPrefix context} → Y) /-- The projection associated with exact reverse alice source. -/ -def exactReverseAliceSourceProjection +@[expose] def exactReverseAliceSourceProjection {n : ℕ} (D : Finset (Fin n)) (side : Finset (SourceRemainingCoordinate D)) : ExactJointOutcome X Y A B D → @@ -2235,7 +2236,7 @@ def exactReverseAliceSourceProjection fun k => q.2.2.1 (context.sideRank.symm k).val.val) /-- The projection associated with exact reverse bob source. -/ -def exactReverseBobSourceProjection +@[expose] def exactReverseBobSourceProjection {n : ℕ} (D : Finset (Fin n)) (side : Finset (SourceRemainingCoordinate D)) : ExactJointOutcome X Y A B D → @@ -2275,7 +2276,7 @@ def exactReverseBobSourceProjection The exact reverse context prefix before construction used in the quantum parallel-repetition argument. -/ -def exactReverseContextPrefixBefore +@[expose] def exactReverseContextPrefixBefore {M : Type*} [Fintype M] [DecidableEq M] {side : Finset M} (context : ExactReverseSideContext M side) @@ -3067,7 +3068,7 @@ theorem exactReverseBobSide_marginal ring /-- The probability weight for exact reverse alice conditional seed. -/ -def exactReverseAliceConditionalSeedWeight +@[expose] def exactReverseAliceConditionalSeedWeight {M : Type*} [Fintype M] [DecidableEq M] (side : Finset M) (seed : ExactForwardSeed M) : ℝ := if exactReverseLeftSide seed = side then @@ -3075,7 +3076,7 @@ def exactReverseAliceConditionalSeedWeight else 0 /-- The probability weight for exact reverse bob conditional seed. -/ -def exactReverseBobConditionalSeedWeight +@[expose] def exactReverseBobConditionalSeedWeight {M : Type*} [Fintype M] [DecidableEq M] (side : Finset M) (seed : ExactForwardSeed M) : ℝ := if exactReverseRightSide seed = side then @@ -3340,7 +3341,7 @@ theorem reweightedSeedWinEventMass simp only [sum_ite_mem, univ_inter, one_mul] /-- The reweighted seed posterior construction used in the quantum parallel-repetition argument. -/ -def reweightedSeedPosterior +@[expose] def reweightedSeedPosterior {K : Type*} [Fintype K] (seedLaw : FiniteEventLaw K) (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) @@ -3433,7 +3434,7 @@ theorem reweightedSeedProjection_relativeEntropy_le rfl /-- The finite probability law for reweighted seed flagged projection. -/ -def reweightedSeedFlaggedProjectionLaw +@[expose] def reweightedSeedFlaggedProjectionLaw {K U Z : Type*} [Fintype K] (seedLaw : FiniteEventLaw K) (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) @@ -3580,7 +3581,7 @@ theorem reweightedSeed_source_equation_twenty_five /-- The reweighted seed prefix joint construction used in the quantum parallel-repetition argument. -/ -def reweightedSeedPrefixJoint +@[expose] def reweightedSeedPrefixJoint {K Ω V : Type*} [Fintype K] {h : ℕ} (seedLaw : FiniteEventLaw K) (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) @@ -6035,7 +6036,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The potential function controlling exact fair alice history high operator. -/ -def exactFairAliceHistoryHighOperatorPotential +@[expose] def exactFairAliceHistoryHighOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) : ℝ := @@ -6049,7 +6050,7 @@ def exactFairAliceHistoryHighOperatorPotential G n S D r.seed r.history r.bobAnswer y) /-- The potential function controlling exact fair alice history low operator. -/ -def exactFairAliceHistoryLowOperatorPotential +@[expose] def exactFairAliceHistoryLowOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) : ℝ := @@ -6062,7 +6063,7 @@ def exactFairAliceHistoryLowOperatorPotential G n S D r.seed r.history r.bobAnswer y) /-- The potential function controlling exact fair bob history high operator. -/ -def exactFairBobHistoryHighOperatorPotential +@[expose] def exactFairBobHistoryHighOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) : ℝ := @@ -6076,7 +6077,7 @@ def exactFairBobHistoryHighOperatorPotential G n S D r.seed r.history r.bobAnswer y)) /-- The potential function controlling exact fair bob history low operator. -/ -def exactFairBobHistoryLowOperatorPotential +@[expose] def exactFairBobHistoryLowOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) : ℝ := @@ -6122,7 +6123,7 @@ theorem exactFairBobHistoryEntropy_eq_operatorPotential_sub rw [← mul_sub, map_sub] /-- The potential function controlling exact reverse alice filter high operator. -/ -def exactReverseAliceFilterHighOperatorPotential +@[expose] def exactReverseAliceFilterHighOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (side : Finset (SourceRemainingCoordinate D)) @@ -6141,7 +6142,7 @@ def exactReverseAliceFilterHighOperatorPotential else 0 /-- The potential function controlling exact reverse alice filter low operator. -/ -def exactReverseAliceFilterLowOperatorPotential +@[expose] def exactReverseAliceFilterLowOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (side : Finset (SourceRemainingCoordinate D)) @@ -6160,7 +6161,7 @@ def exactReverseAliceFilterLowOperatorPotential else 0 /-- The potential function controlling exact reverse bob filter high operator. -/ -def exactReverseBobFilterHighOperatorPotential +@[expose] def exactReverseBobFilterHighOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (side : Finset (SourceRemainingCoordinate D)) @@ -6179,7 +6180,7 @@ def exactReverseBobFilterHighOperatorPotential else 0 /-- The potential function controlling exact reverse bob filter low operator. -/ -def exactReverseBobFilterLowOperatorPotential +@[expose] def exactReverseBobFilterLowOperatorPotential (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (side : Finset (SourceRemainingCoordinate D)) @@ -6891,7 +6892,7 @@ theorem exactLocallySampleableCode_fixedSeed_fiber_iff rw [hx, hy, hr] /-- The total probability mass of exact fair full outcome born. -/ -def exactFairFullOutcomeBornMass +@[expose] def exactFairFullOutcomeBornMass (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (r : ExactHistoryFlag X Y A B D) @@ -7236,7 +7237,7 @@ theorem exactFairPosteriorExpectation_reindex · simp only [univ_eq_attach, mem_attach, not_true_eq_false, mul_eq_zero, IsEmpty.forall_iff] /-- The entropy quantity for exact fair accepted alice. -/ -def exactFairAcceptedAliceEntropy +@[expose] def exactFairAcceptedAliceEntropy (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ℝ := ∑ r : ExactHistoryFlag X Y A B D, @@ -7246,7 +7247,7 @@ def exactFairAcceptedAliceEntropy else 0 /-- The entropy quantity for exact fair accepted bob. -/ -def exactFairAcceptedBobEntropy +@[expose] def exactFairAcceptedBobEntropy (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) : ℝ := ∑ r : ExactHistoryFlag X Y A B D, diff --git a/LeanPool/QuantumParallelRepetition/Part06.lean b/LeanPool/QuantumParallelRepetition/Part06.lean index 4d14f94cc5..0be2714d0c 100644 --- a/LeanPool/QuantumParallelRepetition/Part06.lean +++ b/LeanPool/QuantumParallelRepetition/Part06.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part05 /-! # Quantum parallel repetition, part 06 -/ -@[expose] public section +public section noncomputable section @@ -5917,7 +5917,7 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder The total probability mass of DSV density rational public multiscale first hit physical flag mismatch. -/ -def dSVDensityRationalPublicMultiscaleFirstHitPhysicalFlagMismatchMass +@[expose] def dSVDensityRationalPublicMultiscaleFirstHitPhysicalFlagMismatchMass {A C : Type*} [Fintype A] [Fintype C] {L : ℕ} (alice : A → Fin (L + 1)) (bob : C → Fin (L + 1)) @@ -6200,7 +6200,7 @@ theorem (fun i atom => (U : Matrix β β ℂ) atom (input i)) /-- The total probability mass of DSV density rational heterogeneous actual physical flag. -/ -def dSVDensityRationalHeterogeneousActualPhysicalFlagMass +@[expose] def dSVDensityRationalHeterogeneousActualPhysicalFlagMass (N : ℕ) {S d L : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) @@ -6350,7 +6350,7 @@ attribute [local instance] Classical.propDecidable The DSV density rational heterogeneous actual physical flag born copy width construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousActualPhysicalFlagBornCopyWidth +@[expose] def dSVDensityRationalHeterogeneousActualPhysicalFlagBornCopyWidth {S L : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (i : Fin (L + 1)) : ℝ := if active : i.val < L then width (schedule ⟨i.val, active⟩) else 0 @@ -6911,14 +6911,14 @@ open scoped BigOperators Kronecker ComplexOrder MatrixOrder /-- The finite equivalence encoding DSV density rational public bucket coherent phase sigma product. -/ -def dSVDensityRationalPublicBucketCoherentPhaseSigmaProductEquiv +@[expose] def dSVDensityRationalPublicBucketCoherentPhaseSigmaProductEquiv {H : Type*} (B m : ℕ) : (Σ _ : Fin B × H, Fin m) ≃ (Fin B × H) × Fin m := Equiv.sigmaEquivProd (Fin B × H) (Fin m) /-- The quantum state representing DSV density rational public multiscale bucket coherent sigma. -/ -def dSVDensityRationalPublicMultiscaleBucketCoherentSigmaState +@[expose] def dSVDensityRationalPublicMultiscaleBucketCoherentSigmaState {H : Type*} {m : ℕ} (S B : ℕ) (history : EuclideanSpace ℂ (H × H)) (work : DSVDensityRationalPublicMultiscalePhaseIndex S B → @@ -6936,7 +6936,7 @@ def dSVDensityRationalPublicMultiscaleBucketCoherentSigmaState history work /-- The quantum state representing DSV density rational heterogeneous pure stopped sigma. -/ -def dSVDensityRationalHeterogeneousPureStoppedSigmaState +@[expose] def dSVDensityRationalHeterogeneousPureStoppedSigmaState {S B N d L m : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) @@ -6965,7 +6965,7 @@ def dSVDensityRationalHeterogeneousPureStoppedSigmaState The DSV density rational mixed canonical prefix pure harmonic tensor construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalMixedCanonicalPrefixPureHarmonicTensor +@[expose] def dSVDensityRationalMixedCanonicalPrefixPureHarmonicTensor {N : ℕ} (n : ℕ) (z : EuclideanSpace ℂ (Fin N × Fin N)) : EuclideanSpace ℂ (Fin (N * n) × Fin (N * n)) := @@ -7087,7 +7087,7 @@ theorem The quantum state representing DSV density rational mixed canonical prefix physical accepted sigma. -/ -def dSVDensityRationalMixedCanonicalPrefixPhysicalAcceptedSigmaState +@[expose] def dSVDensityRationalMixedCanonicalPrefixPhysicalAcceptedSigmaState {d N : ℕ} (w : ℝ) (n : ℕ) (ξ ζ : BipartiteUnitVector d) : EuclideanSpace ℂ diff --git a/LeanPool/QuantumParallelRepetition/Part07.lean b/LeanPool/QuantumParallelRepetition/Part07.lean index c1165e62c2..e0615298de 100644 --- a/LeanPool/QuantumParallelRepetition/Part07.lean +++ b/LeanPool/QuantumParallelRepetition/Part07.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part06 /-! # Quantum parallel repetition, part 07 -/ -@[expose] public section +public section noncomputable section @@ -907,7 +907,7 @@ private def dSVDensityRationalPublicBucketPhysicalPhaseWeightedMixedError embezzlementState (N * n)‖ ^ 2 /-- The quantum state representing DSV density rational public bucket physical coherent mixed. -/ -def dSVDensityRationalPublicBucketPhysicalCoherentMixedState +@[expose] def dSVDensityRationalPublicBucketPhysicalCoherentMixedState {d N B : ℕ} (w : ℝ) (n : ℕ) (ξ ζ : BipartiteUnitVector d) : EuclideanSpace ℂ @@ -939,7 +939,7 @@ def dSVDensityRationalPublicBucketPhysicalCoherentTargetState The DSV density rational public bucket physical coherent local reset construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalPublicBucketPhysicalCoherentLocalReset +@[expose] def dSVDensityRationalPublicBucketPhysicalCoherentLocalReset {d N B n : ℕ} (Q : ℕ) (w : ℝ) (ξ ζ : BipartiteUnitVector d) (A C : Fin B → Option ℕ → @@ -2048,7 +2048,7 @@ open scoped BigOperators ComplexOrder Kronecker MatrixOrder The DSV density rational heterogeneous common stop gauge stage error construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousCommonStopGaugeStageError +@[expose] def dSVDensityRationalHeterogeneousCommonStopGaugeStageError {d N B : ℕ} (Q : ℕ) (w : ℝ) (n : ℕ) (ξ ζ : BipartiteUnitVector d) (A C : Fin B → Option ℕ → @@ -2332,7 +2332,7 @@ theorem The DSV density rational heterogeneous stopped common prefix hazard construction used in the quantum parallel-repetition argument. -/ -def dSVDensityRationalHeterogeneousStoppedCommonPrefixHazard +@[expose] def dSVDensityRationalHeterogeneousStoppedCommonPrefixHazard {d N B S L : ℕ} (Q n : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) @@ -2564,7 +2564,7 @@ theorem exists_proofUnconditionalStoppedCommonPrefixBalancedHazard The unconditional prefactor bucket coefficient construction used in the quantum parallel- repetition argument. -/ -def unconditionalPrefactorBucketCoefficient : ℝ := +@[expose] def unconditionalPrefactorBucketCoefficient : ℝ := 16 * (Real.exp 1 - 1) + 4 theorem unconditionalPrefactorBucketCoefficient_nonneg : @@ -2872,7 +2872,7 @@ private def exactLocalQuestionHistoryEquiv The exact locally sampleable ja rounded construction used in the quantum parallel-repetition argument. -/ -def exactLocallySampleableJARounded +@[expose] def exactLocallySampleableJARounded (G : Game X Y A B) (n : ℕ) (D : Finset (Fin n)) (denominator : ℕ) (numerator : ExactLocalSamplerIndex X Y D → @@ -3270,7 +3270,7 @@ abbrev ExactSourceSharedFlag (ExactHistoryFlag X Y A B D × Fin denominator) /-- The probability weight for exact source shared flag. -/ -def exactSourceSharedFlagWeight +@[expose] def exactSourceSharedFlagWeight {n : ℕ} (D : Finset (Fin n)) (denominator : ℕ) (_ : ExactSourceSharedFlag X Y A B D denominator) : ℝ := (1 / (Fintype.card (SourceRemainingCoordinate D) : ℝ)) * @@ -3312,7 +3312,7 @@ theorem exactSourceSharedFlagWeight_sum field_simp /-- The transcript representation for exact source alice permutation. -/ -def exactSourceAlicePermutationHistory +@[expose] def exactSourceAlicePermutationHistory {n : ℕ} (D : Finset (Fin n)) (denominator : ℕ) (numerator : ExactLocalSamplerIndex X Y D → ExactHistoryFlag X Y A B D → ℕ) @@ -4970,7 +4970,7 @@ def exactConditionedReverseBobPrefixEntropyIncrement The exact conditioned reverse alice prefix information construction used in the quantum parallel-repetition argument. -/ -def exactConditionedReverseAlicePrefixInformation +@[expose] def exactConditionedReverseAlicePrefixInformation (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -4986,7 +4986,7 @@ def exactConditionedReverseAlicePrefixInformation The exact conditioned reverse bob prefix information construction used in the quantum parallel- repetition argument. -/ -def exactConditionedReverseBobPrefixInformation +@[expose] def exactConditionedReverseBobPrefixInformation (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -5002,7 +5002,7 @@ def exactConditionedReverseBobPrefixInformation The exact reverse alice conditional history identification construction used in the quantum parallel-repetition argument. -/ -def ExactReverseAliceConditionalHistoryIdentification +@[expose] def ExactReverseAliceConditionalHistoryIdentification (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -5016,7 +5016,7 @@ def ExactReverseAliceConditionalHistoryIdentification The exact reverse bob conditional history identification construction used in the quantum parallel-repetition argument. -/ -def ExactReverseBobConditionalHistoryIdentification +@[expose] def ExactReverseBobConditionalHistoryIdentification (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -5697,7 +5697,7 @@ def exactConditionedReverseAliceNextJoint The exact conditioned reverse alice next prior construction used in the quantum parallel- repetition argument. -/ -def exactConditionedReverseAliceNextPrior +@[expose] def exactConditionedReverseAliceNextPrior (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (remaining : 0 < (Finset.univ \ D).card) @@ -6182,7 +6182,7 @@ variable {X Y A B : Type*} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The data context recording exact reverse alice marked history. -/ -def exactReverseAliceMarkedHistoryContext +@[expose] def exactReverseAliceMarkedHistoryContext (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (default : Y) (seed : ExactRemainingSeed D) @@ -6204,7 +6204,7 @@ def exactReverseAliceMarkedHistoryContext projection.2) /-- The data context recording exact reverse bob marked history. -/ -def exactReverseBobMarkedHistoryContext +@[expose] def exactReverseBobMarkedHistoryContext (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (default : X) (seed : ExactRemainingSeed D) diff --git a/LeanPool/QuantumParallelRepetition/Part08.lean b/LeanPool/QuantumParallelRepetition/Part08.lean index c8eb495dc3..4b1c4e7bb9 100644 --- a/LeanPool/QuantumParallelRepetition/Part08.lean +++ b/LeanPool/QuantumParallelRepetition/Part08.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part07 /-! # Quantum parallel repetition, part 08 -/ -@[expose] public section +public section noncomputable section @@ -107,7 +107,7 @@ theorem exactPermutationOutputUniformExpectation denominator numerator normalized nonempty] /-- The product encoding of exact source alice sample. -/ -def exactSourceAliceSampleTuple +@[expose] def exactSourceAliceSampleTuple {n : ℕ} (D : Finset (Fin n)) (denominator : ℕ) (numerator : ExactLocalSamplerIndex X Y D → ExactHistoryFlag X Y A B D → ℕ) @@ -2117,7 +2117,7 @@ theorem exactLocallySampleableLaw_psi_ne_zero_of_ne_zero zero_div] /-- The positive operator-valued measurement implementing dependent block. -/ -def dependentBlockPOVM +@[expose] def dependentBlockPOVM {R C : Type*} [Fintype R] [DecidableEq R] [Fintype C] {ι : R → Type*} [∀ r, Fintype (ι r)] [∀ r, DecidableEq (ι r)] @@ -2142,7 +2142,7 @@ def dependentBlockPOVM Sigma.mk.injEq, false_and, not_false_eq_true, one_apply_ne] /-- The positive operator-valued measurement implementing reindexed. -/ -def reindexedPOVM +@[expose] def reindexedPOVM {C d e : Type*} [Fintype C] [Fintype d] [Fintype e] [DecidableEq d] [DecidableEq e] (basis : d ≃ e) (P : POVM C d) : POVM C e where @@ -2585,7 +2585,7 @@ variable {X Y A B : Type} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The measurement effect for exact source global winning. -/ -def exactSourceGlobalWinningEffect +@[expose] def exactSourceGlobalWinningEffect [DecidableEq A] [DecidableEq B] (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) (D : Finset (Fin n)) (a₀ : A) (b₀ : B) (x : X) (y : Y) : diff --git a/LeanPool/QuantumParallelRepetition/Part09.lean b/LeanPool/QuantumParallelRepetition/Part09.lean index db15a7af95..ec11c89f10 100644 --- a/LeanPool/QuantumParallelRepetition/Part09.lean +++ b/LeanPool/QuantumParallelRepetition/Part09.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part08 /-! # Quantum parallel repetition, part 09 -/ -@[expose] public section +public section noncomputable section @@ -241,6 +241,7 @@ variable {X Y A B : Type} variable [Fintype X] [Fintype Y] [Fintype A] [Fintype B] /-- The positive operator-valued measurement implementing unitary conjugate. -/ +@[expose] def unitaryConjugatePOVM {C d : Type} [Fintype C] [Fintype d] [DecidableEq d] (U : Matrix.unitaryGroup d ℂ) (P : POVM C d) : POVM C d where @@ -4453,7 +4454,7 @@ def directDSVActualBilateralRetainedIndexEquiv (Equiv.prodProdProdComm s t u v) /-- The measurement effect for direct DSV actual local POVM winning. -/ -def directDSVActualLocalPOVMWinningEffect +@[expose] def directDSVActualLocalPOVMWinningEffect {X Y A B s t : Type*} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] [Fintype s] [Fintype t] [DecidableEq s] [DecidableEq t] @@ -4961,6 +4962,7 @@ open QuantumParallelRepetition.ClassicalSampling attribute [local instance] Classical.propDecidable /-- The finite equivalence encoding physical 8 selected global target work. -/ +@[expose] def physical8SelectedGlobalTargetWorkEquiv (P N d m : ℕ) : UnconditionalSelectedCopyLocalIndex P d N m ≃ @@ -4975,7 +4977,7 @@ def physical8SelectedGlobalTargetWorkEquiv rfl /-- The finite equivalence encoding physical 8 one scale actual global fiber. -/ -def physical8OneScaleActualGlobalFiberEquiv +@[expose] def physical8OneScaleActualGlobalFiberEquiv {P N d L m : ℕ} {R : Type} (phaseSplit : DSVDensityRationalPublicMultiscalePhaseIndex 1 P ≃ @@ -5980,7 +5982,7 @@ def integratorActualC485NormalizedDiagonalWork open Classical in /-- The state vector representing integrator actual c 485 cleaned. -/ -def integratorActualC485CleanedVector +@[expose] def integratorActualC485CleanedVector {S B N d L m : ℕ} (Q : ℕ) (width : Fin S → ℝ) (schedule : Fin L → Fin S) @@ -6005,7 +6007,7 @@ def integratorActualC485CleanedVector (S := S) (B := B) (N := N) (d := d) (L := L) j)) /-- The state vector representing integrator actual c 485 canonical. -/ -def integratorActualC485CanonicalVector +@[expose] def integratorActualC485CanonicalVector {S B N d L m : ℕ} {width : Fin S → ℝ} (schedule : Fin L → Fin S) @@ -6024,7 +6026,7 @@ def integratorActualC485CanonicalVector (B := B) width schedule ξ ζ j) /-- The state vector representing integrator actual c 485 source. -/ -def integratorActualC485SourceVector +@[expose] def integratorActualC485SourceVector {S B N d L m : ℕ} (width : Fin S → ℝ) (schedule : Fin L → Fin S) (ξ ζ : BipartiteUnitVector d) @@ -6536,6 +6538,7 @@ def integratorActualC485SelectedBobPOVM (integratorActualC485SourceBobPOVM G n S D b₀ y) /-- The measurement effect for integrator actual c 485 winning. -/ +@[expose] def integratorActualC485WinningEffect {X Y A B : Type} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] diff --git a/LeanPool/QuantumParallelRepetition/Part10.lean b/LeanPool/QuantumParallelRepetition/Part10.lean index 9843fd4a18..ea76784231 100644 --- a/LeanPool/QuantumParallelRepetition/Part10.lean +++ b/LeanPool/QuantumParallelRepetition/Part10.lean @@ -10,7 +10,7 @@ import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order /-! # Quantum parallel repetition, part 10 -/ -@[expose] public section +public section noncomputable section @@ -1279,7 +1279,7 @@ def unconditionalActualC485FairSourceDiagonalWork (exactGlobalHistoryFinPhi G n S D u.2.2.2 u.2.2.1) j /-- The energy quantity for unconditional actual c 485 fair source clip. -/ -def unconditionalActualC485FairSourceClipEnergy +@[expose] def unconditionalActualC485FairSourceClipEnergy {X Y A B : Type*} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] (G : Game X Y A B) (n : ℕ) (S : Strategy (G.repeat n)) diff --git a/LeanPool/QuantumParallelRepetition/Part11.lean b/LeanPool/QuantumParallelRepetition/Part11.lean index 9ac30cdf5f..2757591b56 100644 --- a/LeanPool/QuantumParallelRepetition/Part11.lean +++ b/LeanPool/QuantumParallelRepetition/Part11.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part10 /-! # Quantum parallel repetition, part 11 -/ -@[expose] public section +public section noncomputable section @@ -811,7 +811,7 @@ private def unconditionalActualC485SelectedVerifierBorn (1 : Matrix T T ℂ))) z /-- The quadratic expectation of the physical winning effect in the supplied vector. -/ -def unconditionalActualC485RawPhysicalVerifierBorn +@[expose] def unconditionalActualC485RawPhysicalVerifierBorn {X Y A B ι κ : Type} [Fintype X] [Fintype Y] [Fintype A] [Fintype B] [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] diff --git a/LeanPool/QuantumParallelRepetition/Part12.lean b/LeanPool/QuantumParallelRepetition/Part12.lean index 6152f17685..2e97b17515 100644 --- a/LeanPool/QuantumParallelRepetition/Part12.lean +++ b/LeanPool/QuantumParallelRepetition/Part12.lean @@ -9,7 +9,7 @@ public import LeanPool.QuantumParallelRepetition.Part11 /-! # Quantum parallel repetition, part 12 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/QuasiBorelSpaces.lean b/LeanPool/QuasiBorelSpaces.lean index d410eed063..61de6c617d 100644 --- a/LeanPool/QuasiBorelSpaces.lean +++ b/LeanPool/QuasiBorelSpaces.lean @@ -50,7 +50,7 @@ Tags: probability, category-theory, measure-theory, denotational-semantics MSC: 60A05, 18C50, 68Q55 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/QuasiBorelSpaces/Basic.lean b/LeanPool/QuasiBorelSpaces/Basic.lean index 49aa0e651e..08875c88f1 100644 --- a/LeanPool/QuasiBorelSpaces/Basic.lean +++ b/LeanPool/QuasiBorelSpaces/Basic.lean @@ -14,7 +14,7 @@ public import LeanPool.QuasiBorelSpaces.MeasureTheory.Pack Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Basic`. -/ -@[expose] public section +public section open scoped MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/Chain.lean b/LeanPool/QuasiBorelSpaces/Chain.lean index 59e8556fe8..9dd124c027 100644 --- a/LeanPool/QuasiBorelSpaces/Chain.lean +++ b/LeanPool/QuasiBorelSpaces/Chain.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Chain`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Chain diff --git a/LeanPool/QuasiBorelSpaces/Cont.lean b/LeanPool/QuasiBorelSpaces/Cont.lean index 3e076a0b37..3375a46779 100644 --- a/LeanPool/QuasiBorelSpaces/Cont.lean +++ b/LeanPool/QuasiBorelSpaces/Cont.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Cont`. -/ -@[expose] public section +public section open QuasiBorelSpace open OmegaCompletePartialOrder @@ -41,7 +41,7 @@ instance : PartialOrder (Cont R A) := simp only [mk.injEq, imp_self]) /-- The underlying continuation as an order homomorphism. -/ -def applyOrderHom : Cont R A →o ((A →ω𝒒 R) →ω𝒒 R) where +@[expose] def applyOrderHom : Cont R A →o ((A →ω𝒒 R) →ω𝒒 R) where toFun := apply monotone' _ _ h := h @@ -120,27 +120,27 @@ instance : OmegaQuasiBorelSpace (Cont R A) where · apply Prod.isHom_snd /-- The `unit` operator (i.e., pure values) for the continuation monad. -/ -@[simps] -def unit : A →ω𝒒 Cont R A where +@[expose, simps] def unit : A →ω𝒒 Cont R A where toFun x := ⟨{ toFun k := k x }⟩ /-- The `bind` operator (i.e., sequential composition) for the continuation monad. -/ -@[simps] +@[expose, simps] def bind [OmegaQuasiBorelSpace B] : (A →ω𝒒 Cont R B) →ω𝒒 (Cont R A →ω𝒒 Cont R B) where toFun f := { toFun x := ⟨{ toFun k := x.apply { toFun y := (f y).apply k } }⟩ } @[simp] -lemma bind_unit [OmegaQuasiBorelSpace B] (f : A →ω𝒒 Cont R B) (x : A) : bind f (unit x) = f x := rfl +lemma bind_unit [OmegaQuasiBorelSpace B] (f : A →ω𝒒 Cont R B) (x : A) : + bind f (unit x) = f x := by rfl @[simp] -lemma unit_bind : bind (unit (R := R) (A := A)) = .id := rfl +lemma unit_bind : bind (unit (R := R) (A := A)) = .id := by rfl @[simp] lemma bind_bind {C : Type*} [OmegaQuasiBorelSpace B] [OmegaQuasiBorelSpace C] (f : B →ω𝒒 Cont R C) (g : A →ω𝒒 Cont R B) : (bind f).comp (bind g) = bind ((bind f).comp g) := - rfl + by rfl end Cont diff --git a/LeanPool/QuasiBorelSpaces/Defs.lean b/LeanPool/QuasiBorelSpaces/Defs.lean index 494567ed80..c8e7c97eaa 100644 --- a/LeanPool/QuasiBorelSpaces/Defs.lean +++ b/LeanPool/QuasiBorelSpaces/Defs.lean @@ -16,7 +16,7 @@ import LeanPool.QuasiBorelSpaces.MeasureTheory.Cases This file defines the concept of a quasi-borel space, as given by [HeunenKSY17]. -/ -@[expose] public section +public section open scoped MeasureTheory @@ -69,7 +69,7 @@ inductive IsHom (f : A → B) : Prop where scoped notation "IsHom[" inst₁ ", " inst₂ "]" => @IsHom _ _ inst₁ inst₂ /-- Every `MeasurableSpace` induces a `QuasiBorelSpace`. -/ -@[reducible] def ofMeasurableSpace [MeasurableSpace A] : QuasiBorelSpace A where +@[expose, reducible] def ofMeasurableSpace [MeasurableSpace A] : QuasiBorelSpace A where IsVar φ := Measurable φ isVar_const x := measurable_const isVar_comp := by fun_prop @@ -116,7 +116,7 @@ Every `QuasiBorelSpace` induces a `MeasurableSpace`. See [HeunenKSY17], Proposition 14. -/ -@[reducible] def toMeasurableSpace : MeasurableSpace A where +@[expose, reducible] def toMeasurableSpace : MeasurableSpace A where MeasurableSet' X := ∀{φ : ℝ → A}, IsHom φ → MeasurableSet (φ ⁻¹' X) measurableSet_empty hφ := by simp only [Set.preimage_empty, MeasurableSet.empty] @@ -126,7 +126,7 @@ See [HeunenKSY17], Proposition 14. simpa only [Set.preimage_iUnion] using MeasurableSet.iUnion fun n ↦ hf n hφ /-- We can lift a `QuasiBorelSpace` from one type to another. -/ -@[reducible] def lift (f : B → A) : QuasiBorelSpace B where +@[expose, reducible] def lift (f : B → A) : QuasiBorelSpace B where IsVar φ := IsVar fun x ↦ f (φ x) isVar_const x := isVar_const (f x) isVar_comp := isVar_comp diff --git a/LeanPool/QuasiBorelSpaces/ENNReal.lean b/LeanPool/QuasiBorelSpaces/ENNReal.lean index 8485da85d2..0446aa328c 100644 --- a/LeanPool/QuasiBorelSpaces/ENNReal.lean +++ b/LeanPool/QuasiBorelSpaces/ENNReal.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.ENNReal`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.ENNReal diff --git a/LeanPool/QuasiBorelSpaces/Finset.lean b/LeanPool/QuasiBorelSpaces/Finset.lean index 071db6f945..3305a56b95 100644 --- a/LeanPool/QuasiBorelSpaces/Finset.lean +++ b/LeanPool/QuasiBorelSpaces/Finset.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Finset`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Finset @@ -26,8 +26,17 @@ variable {C : Type*} [QuasiBorelSpace C] /-- View a finite set as its underlying nodup multiset. -/ -irreducible_def toSubtype : Finset A → { xs : Multiset A // Multiset.Nodup xs } - | ⟨x, h⟩ => ⟨x, h⟩ +@[irreducible, expose] def toSubtype (s : Finset A) : + { xs : Multiset A // Multiset.Nodup xs } := ⟨s.val, s.nodup⟩ + +omit [QuasiBorelSpace A] in +theorem toSubtype_def (s : Finset A) : + toSubtype s = ⟨s.val, s.nodup⟩ := by + unfold toSubtype + apply Subtype.ext + rfl + +attribute [eqns toSubtype_def] toSubtype private irreducible_def ofSubtype : { xs : Multiset A // Multiset.Nodup xs } → Finset A | ⟨x, h⟩ => ⟨x, h⟩ diff --git a/LeanPool/QuasiBorelSpaces/FlatReal.lean b/LeanPool/QuasiBorelSpaces/FlatReal.lean index 089c1a350f..807ff15ca5 100644 --- a/LeanPool/QuasiBorelSpaces/FlatReal.lean +++ b/LeanPool/QuasiBorelSpaces/FlatReal.lean @@ -15,7 +15,7 @@ public import Mathlib.MeasureTheory.Measure.Haar.OfBasis Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.FlatReal`. -/ -@[expose] public section +public section open MeasureTheory open MeasureSpace diff --git a/LeanPool/QuasiBorelSpaces/Functor.lean b/LeanPool/QuasiBorelSpaces/Functor.lean index d93766fa36..0154e5c444 100644 --- a/LeanPool/QuasiBorelSpaces/Functor.lean +++ b/LeanPool/QuasiBorelSpaces/Functor.lean @@ -16,7 +16,7 @@ public import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Functor`. -/ -@[expose] public section +public section namespace QuasiBorelSpace @@ -313,12 +313,12 @@ variable [Continuous F] {S} [Sequence S] @[simp] lemma seq_unseq_coe (x : Limit (Comp F S)) : seq (unseq x) = x := by have := congr_arg (DFunLike.coe · x) seq_unseq - simpa only [QuasiBorelHom.comp_coe, QuasiBorelHom.id_coe] using this + simpa only [QuasiBorelHom.comp_coe, QuasiBorelHom.id_coe, id_eq] using this @[simp] lemma unseq_seq_coe (x : F (Limit S)) : unseq (seq x) = x := by have := congr_arg (DFunLike.coe · x) unseq_seq - simpa only [QuasiBorelHom.comp_coe, QuasiBorelHom.id_coe] using this + simpa only [QuasiBorelHom.comp_coe, QuasiBorelHom.id_coe, id_eq] using this end Continuous @@ -342,7 +342,6 @@ lemma isHom_mk : IsHom (mk (F := F)) := by simp only [isHom_to_lift (A := Nu F), isHom_id'] /-- Shift a compatible family to a family in the functor-composed sequence. -/ -@[simps] def shift : Limit (Iter F) →𝒒 Limit (Comp F (Iter F)) where toFun x := { toFun n := .mk (Iter.unsucc (x (n + 1))) @@ -355,8 +354,12 @@ def shift : Limit (Iter F) →𝒒 Limit (Comp F (Iter F)) where rw [this] } +@[simp] +lemma shift_coe_coe_get (x : Limit (Iter F)) (n : ℕ) : + ((shift x) n).get = Iter.unsucc (x (n + 1)) := by + rfl + /-- Recover a compatible family from the functor-composed sequence. -/ -@[simps -fullyApplied] def unshift : Limit (Comp F (Iter F)) →𝒒 Limit (Iter F) where toFun x := { toFun @@ -376,6 +379,12 @@ def unshift : Limit (Comp F (Iter F)) →𝒒 Limit (Iter F) where intro n cases n <;> fun_prop +@[simp] +lemma unshift_coe_coe (x : Limit (Comp F (Iter F))) : + ⇑(unshift x) = (fun | 0 => Iter.zero | n + 1 => Iter.succ ((x n).get)) := by + funext n + cases n <;> rfl + @[simp] private lemma shift_unshift_coe (x : Limit (Comp F (Iter F))) : shift (unshift x) = x := by ext n @@ -407,7 +416,7 @@ lemma unroll_roll [Continuous F] (x : F (Nu F)) : unroll (roll x) = x := by simp only [ unroll, roll, QuasiBorelHom.coe_mk, shift_unshift_coe, Continuous.unseq_seq_coe, Functor.map_comp_coe, QuasiBorelHom.eq_comp, - QuasiBorelHom.eq_id, Functor.map_id, QuasiBorelHom.id_coe] + QuasiBorelHom.eq_id, Functor.map_id, QuasiBorelHom.id_coe, id_eq] /-- Constructs a `Nu` from an unfolding. -/ def unfold (f : A →𝒒 F A) : A →𝒒 Nu F where diff --git a/LeanPool/QuasiBorelSpaces/Hom.lean b/LeanPool/QuasiBorelSpaces/Hom.lean index b8d63d809f..be5175eede 100644 --- a/LeanPool/QuasiBorelSpaces/Hom.lean +++ b/LeanPool/QuasiBorelSpaces/Hom.lean @@ -17,7 +17,7 @@ This file defines the exponential object in the category of quasi-borel spaces. See [HeunenKSY17], Proposition 18. -/ -@[expose] public section +public section open QuasiBorelSpace @@ -129,15 +129,19 @@ lemma isHom_iff (f : A → B →𝒒 C) : IsHom f ↔ IsHom (fun x : A × B ↦ apply isHom_mk hf /-- Currying for `QuasiBorelHom`s. -/ -@[simps -fullyApplied] -def curry (f : A × B →𝒒 C) : A →𝒒 B →𝒒 C where +@[expose] def curry (f : A × B →𝒒 C) : A →𝒒 B →𝒒 C where toFun x := { toFun y := f (x, y) } +@[simp] theorem curry_coe_coe (f : A × B →𝒒 C) (x : A) : + (curry f x : B → C) = fun y ↦ f (x, y) := by rfl + /-- Uncurrying for `QuasiBorelHom`s. -/ -@[simps -fullyApplied] -def uncurry (f : A →𝒒 B →𝒒 C) : A × B →𝒒 C where +@[expose] def uncurry (f : A →𝒒 B →𝒒 C) : A × B →𝒒 C where toFun x := f x.1 x.2 +@[simp] theorem uncurry_coe (f : A →𝒒 B →𝒒 C) : + (uncurry f : A × B → C) = fun x ↦ f x.1 x.2 := by rfl + @[simp] lemma curry_uncurry (f : A →𝒒 B →𝒒 C) : curry (uncurry f) = f := rfl @@ -145,19 +149,22 @@ lemma curry_uncurry (f : A →𝒒 B →𝒒 C) : curry (uncurry f) = f := rfl lemma uncurry_curry (f : A × B →𝒒 C) : uncurry (curry f) = f := rfl /-- The identity morphism. -/ -@[simps -fullyApplied] -def id : A →𝒒 A where +@[expose] def id : A →𝒒 A where toFun x := x +@[simp] theorem id_coe : ((id : A →𝒒 A) : A → A) = _root_.id := by rfl + @[simp] lemma eq_id : (.mk fun x : A ↦ x) = id := by rfl /-- Morphism composition. -/ -@[simps -fullyApplied] -def comp (f : B →𝒒 C) (g : A →𝒒 B) : A →𝒒 C where +@[expose] def comp (f : B →𝒒 C) (g : A →𝒒 B) : A →𝒒 C where toFun x := f (g x) +@[simp] theorem comp_coe (f : B →𝒒 C) (g : A →𝒒 B) : + (comp f g : A → C) = fun x ↦ f (g x) := by rfl + @[simp] lemma eq_comp {f : B → C} (hf : IsHom f) diff --git a/LeanPool/QuasiBorelSpaces/IsHomDiagonal.lean b/LeanPool/QuasiBorelSpaces/IsHomDiagonal.lean index 7c7d4a7122..7e61200517 100644 --- a/LeanPool/QuasiBorelSpaces/IsHomDiagonal.lean +++ b/LeanPool/QuasiBorelSpaces/IsHomDiagonal.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.Prop Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.IsHomDiagonal`. -/ -@[expose] public section +public section namespace QuasiBorelSpace diff --git a/LeanPool/QuasiBorelSpaces/Lift.lean b/LeanPool/QuasiBorelSpaces/Lift.lean index 07a609131f..1dd138b068 100644 --- a/LeanPool/QuasiBorelSpaces/Lift.lean +++ b/LeanPool/QuasiBorelSpaces/Lift.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Lift`. -/ -@[expose] public section +public section variable {A B : Type*} [QuasiBorelSpace A] [QuasiBorelSpace B] diff --git a/LeanPool/QuasiBorelSpaces/List.lean b/LeanPool/QuasiBorelSpaces/List.lean index 1a4c2e2176..d8bcba353f 100644 --- a/LeanPool/QuasiBorelSpaces/List.lean +++ b/LeanPool/QuasiBorelSpaces/List.lean @@ -32,7 +32,7 @@ on lists are homomorphisms. * Set-like operations (`insert`, `union`, `erase`, `diff`) are homomorphisms -/ -@[expose] public section +public section variable {A B C : Type*} [QuasiBorelSpace A] [QuasiBorelSpace B] [QuasiBorelSpace C] diff --git a/LeanPool/QuasiBorelSpaces/List/Encoding.lean b/LeanPool/QuasiBorelSpaces/List/Encoding.lean index ba60bfd297..4c4f8e9fde 100644 --- a/LeanPool/QuasiBorelSpaces/List/Encoding.lean +++ b/LeanPool/QuasiBorelSpaces/List/Encoding.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Push Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.List.Encoding`. -/ -@[expose] public section +public section namespace List @@ -33,14 +33,14 @@ abbrev Encoding (A : Type*) := namespace Encoding /-- The encoded version of `[]`. -/ -def nil : Encoding A := ⟨0, Fin.elim0⟩ +@[expose] def nil : Encoding A := ⟨0, Fin.elim0⟩ /-- The encoded version of `· ∷ ·`. -/ -def cons (x : A) (xs : Encoding A) : Encoding A := +@[expose] def cons (x : A) (xs : Encoding A) : Encoding A := ⟨xs.1 + 1, Fin.cases x xs.2⟩ /-- The encoded version of `List.foldr`. -/ -def foldr (cons : A → B → B) (nil : B) : Encoding A → B +@[expose] def foldr (cons : A → B → B) (nil : B) : Encoding A → B | ⟨0, _⟩ => nil | ⟨n + 1, k⟩ => cons (k 0) (foldr cons nil ⟨n, fun i ↦ k i.succ⟩) diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory.lean index a8913db24a..a2890b1bbb 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory.lean @@ -27,4 +27,4 @@ formalization: standard Borel spaces, packing of measurable spaces, randomizatio of probability measures, and quantile / CDF infrastructure. -/ -@[expose] public section +public section diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Cases.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Cases.lean index 4610e31bbc..7cbe81f13d 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Cases.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Cases.lean @@ -13,7 +13,7 @@ public import Mathlib.MeasureTheory.MeasurableSpace.Constructions Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Cases`. -/ -@[expose] public section +public section open scoped MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Instances.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Instances.lean index cca597fe48..fcea6738ce 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Instances.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Instances.lean @@ -13,7 +13,7 @@ public import Mathlib.MeasureTheory.MeasurableSpace.Defs Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Instances`. -/ -@[expose] public section +public section namespace MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean index 37ee221e6c..01b16ed072 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.MeasureTheory.Sigma Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.List`. -/ -@[expose] public section +public section variable diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Measure.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Measure.lean index 2a75489db3..df1e2e25a3 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Measure.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Measure.lean @@ -15,7 +15,7 @@ import Mathlib.Probability.Kernel.MeasurableLIntegral Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Measure`. -/ -@[expose] public section +public section namespace MeasureTheory.Measure diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Option.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Option.lean index 30b92af021..2f8ccbed06 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Option.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Option.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.MeasureTheory.Sum Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Option`. -/ -@[expose] public section +public section variable {A B C : Type*} [MeasurableSpace A] [MeasurableSpace B] [MeasurableSpace C] diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Pack.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Pack.lean index e7623d4b50..89abb9b707 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Pack.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Pack.lean @@ -13,7 +13,7 @@ public import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Pack`. -/ -@[expose] public section +public section namespace MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/ProbabilityMeasure.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/ProbabilityMeasure.lean index a6405ebbdc..659d3182fe 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/ProbabilityMeasure.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/ProbabilityMeasure.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.ProbabilityMeasure`. -/ -@[expose] public section +public section namespace MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean index f47a2cd41c..b769bc5eba 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.MeasureTheory.Measure Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Quantile`. -/ -@[expose] public section +public section namespace MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean index c8dc9b1d5b..514c0b278d 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Randomization`. -/ -@[expose] public section +public section open scoped unitInterval diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Sigma.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Sigma.lean index 8ce3a30f9c..812c0abfdb 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Sigma.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Sigma.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.MeasureTheory.Cases Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Sigma`. -/ -@[expose] public section +public section namespace MeasureTheory.Sigma diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/StandardBorelSpace.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/StandardBorelSpace.lean index 588ad83c10..8025e8a555 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/StandardBorelSpace.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/StandardBorelSpace.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.StandardBorelSpace`. -/ -@[expose] public section +public section namespace MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Sum.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Sum.lean index b9b5f49f5a..c074478975 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Sum.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Sum.lean @@ -13,7 +13,7 @@ public import Mathlib.MeasureTheory.Constructions.Polish.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.MeasureTheory.Sum`. -/ -@[expose] public section +public section open scoped MeasureTheory diff --git a/LeanPool/QuasiBorelSpaces/Multiset.lean b/LeanPool/QuasiBorelSpaces/Multiset.lean index 9b6aea94e8..c254a06f3d 100644 --- a/LeanPool/QuasiBorelSpaces/Multiset.lean +++ b/LeanPool/QuasiBorelSpaces/Multiset.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Multiset`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Multiset diff --git a/LeanPool/QuasiBorelSpaces/Nat.lean b/LeanPool/QuasiBorelSpaces/Nat.lean index 261ae2829d..3546bed22a 100644 --- a/LeanPool/QuasiBorelSpaces/Nat.lean +++ b/LeanPool/QuasiBorelSpaces/Nat.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.Prop Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Nat`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Nat diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder.lean index 220c531543..803aa9e58a 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder.lean @@ -19,4 +19,4 @@ Re-exports lemmas and instances about ω-complete partial orders that the quasi-Borel space formalization layers on top of `Mathlib.Order.OmegaCompletePartialOrder`. -/ -@[expose] public section +public section diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean index 8114f43952..1322c8f0d4 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean @@ -18,7 +18,7 @@ As the library grows, compatibility helpers specific to this project can be added here. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder @@ -96,7 +96,15 @@ lemma ωScottContinuous_lintegral · apply MeasureTheory.lintegral_congr fun b ↦ ?_ rw [(by simp : f (ωSup c) b = f (ωSup c) (ωSup (Chain.const b)))] apply Eq.trans (hf₁.map_ωSup (Chain.zip c (Chain.const b))) - rfl + apply le_antisymm + · simp only [ωSup_le_iff, Chain.coe_map, OrderHom.coe_mk, + Function.comp_apply, Chain.zip_apply, Chain.const_apply] + intro n + exact le_iSup_of_le n le_rfl + · refine iSup_le fun n ↦ ?_ + apply le_ωSup_of_le n + simp only [Chain.coe_map, OrderHom.coe_mk, Function.comp_apply, + Chain.zip_apply, Chain.const_apply, le_refl] · fun_prop · intro i j h a apply hf₁.monotone diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain.lean index 46596233d8..d2004b6677 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain.lean @@ -17,4 +17,4 @@ Re-exports the chain instances and lemmas for `Option`, `Sigma`, `Sum`, and constant chains used by the ω-complete partial order infrastructure. -/ -@[expose] public section +public section diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Const.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Const.lean index 9f8bd95936..a7361b399d 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Const.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Const.lean @@ -13,7 +13,7 @@ public import Mathlib.Order.OmegaCompletePartialOrder Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Chain.Const`. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder.Chain diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Option.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Option.lean index 3219b78eb6..8f171da595 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Option.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Option.lean @@ -15,7 +15,7 @@ public import Mathlib.Order.OmegaCompletePartialOrder Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Chain.Option`. -/ -@[expose] public section +public section variable {A : Type*} [Preorder A] @@ -82,7 +82,7 @@ lemma project_coe rfl /-- Turns a `Chain` of `Option`s into an equivalent `Option`al `Chain`. -/ -noncomputable def distrib (c : Chain (Option A)) : Option (Chain A) := +@[expose] noncomputable def distrib (c : Chain (Option A)) : Option (Chain A) := open Classical in if h : ∃n, (c n).isSome then .some (project c h) diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sigma.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sigma.lean index 1e178d58a6..b5a9ac8b3b 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sigma.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sigma.lean @@ -14,7 +14,7 @@ public import Mathlib.Order.OmegaCompletePartialOrder Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Chain.Sigma`. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder.Chain.Sigma @@ -22,17 +22,17 @@ namespace OmegaCompletePartialOrder.Chain.Sigma variable {I : Type*} {P : I → Type*} [∀ i, Preorder (P i)] /-- Injects a chain into a chain of coproducts. -/ -def inj {i} (c : Chain (P i)) : Chain ((i : I) × P i) where +@[expose] def inj {i} (c : Chain (P i)) : Chain ((i : I) × P i) where toFun n := ⟨i, c n⟩ monotone' n₁ n₂ hn := by simp only [Sigma.mk_le_mk_iff] apply c.monotone' hn @[simp] -lemma inj_coe {i} (c : Chain (P i)) (n : ℕ) : inj c n = ⟨i, c n⟩ := rfl +lemma inj_coe {i} (c : Chain (P i)) (n : ℕ) : inj c n = ⟨i, c n⟩ := by rfl /-- Converts a chain of coproducts into a coproduct of chains. -/ -def distrib (c : Chain ((i : I) × P i)) : (i : I) × Chain (P i) where +@[expose] def distrib (c : Chain ((i : I) × P i)) : (i : I) × Chain (P i) where fst := (c 0).fst snd.toFun n := have : (c 0).fst = (c n).fst := by @@ -51,7 +51,7 @@ def distrib (c : Chain ((i : I) × P i)) : (i : I) × Chain (P i) where exact h₁ @[simp] -lemma distrib_inj {i} (c : Chain (P i)) : distrib (inj c) = ⟨i, c⟩ := rfl +lemma distrib_inj {i} (c : Chain (P i)) : distrib (inj c) = ⟨i, c⟩ := by rfl @[simp] lemma inj_distrib (c : Chain (Sigma P)) : inj (distrib c).snd = c := by diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sum.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sum.lean index 338a0bb57a..d15234216e 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sum.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Chain/Sum.lean @@ -16,7 +16,7 @@ This file provides utilities for working with chains in sum types, which are used to construct the ωCPO instance for coproducts. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder.Chain.Sum @@ -65,7 +65,7 @@ def swapOrderHom : A ⊕ B →o B ⊕ A where simp_all @[simp] -lemma swapOrderHom_apply (x : A ⊕ B) : swapOrderHom x = Sum.swap x := rfl +lemma swapOrderHom_apply (x : A ⊕ B) : swapOrderHom x = Sum.swap x := by rfl /-- Projects right values out of a chain. -/ def projr [hB : Inhabited B] (c : Chain (A ⊕ B)) : Chain B := @@ -83,7 +83,7 @@ lemma projr_coe [Inhabited B] (c : Chain (A ⊕ B)) (n : ℕ) : Sum.swap_inr, Sum.elim_inl, id_eq, Sum.elim_inr] /-- Splits a chain of sums into a sum of chains. -/ -def distrib (c : Chain (A ⊕ B)) : Chain A ⊕ Chain B := +@[expose] def distrib (c : Chain (A ⊕ B)) : Chain A ⊕ Chain B := Sum.elim (fun d ↦ let : Inhabited A := ⟨d⟩ diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Fix.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Fix.lean index 51f052e684..5c6ee9c7df 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Fix.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Fix.lean @@ -18,7 +18,7 @@ import Mathlib.Topology.MetricSpace.Bounded Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Fix`. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Option.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Option.lean index 9dc1c996bb..44c39564e7 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Option.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Option.lean @@ -14,7 +14,7 @@ public import LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Chain.Option Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Option`. -/ -@[expose] public section +public section /- diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sigma.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sigma.lean index 05cc2650af..13bccd947d 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sigma.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sigma.lean @@ -13,7 +13,7 @@ public import LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Chain.Sigma Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Sigma`. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder.Sigma diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sum.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sum.lean index 8484217435..08258e7880 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sum.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Sum.lean @@ -19,7 +19,7 @@ import Mathlib.Topology.MetricSpace.Bounded This file provides the `OmegaCompletePartialOrder` instance for `Sum α β`. -/ -@[expose] public section +public section namespace OmegaCompletePartialOrder.Sum diff --git a/LeanPool/QuasiBorelSpaces/OmegaHom.lean b/LeanPool/QuasiBorelSpaces/OmegaHom.lean index eb4d9bba5a..9101971e03 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaHom.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaHom.lean @@ -17,7 +17,7 @@ This file defines the function space `OmegaQuasiBorelHom X Y` (written itself an ωQBS. -/ -@[expose] public section +public section open QuasiBorelSpace open OmegaQuasiBorelSpace @@ -89,25 +89,34 @@ instance : PartialOrder (X →ω𝒒 Y) := PartialOrder.lift DFunLike.coe DFunLike.coe_injective /-- Converts an ωQBS Hom to a Poset Hom. -/ -@[simps, coe] +@[coe] def toOrderHom (f : X →ω𝒒 Y) : X →o Y where toFun := f monotone' := f.monotone_coe +@[simp] theorem toOrderHom_coe (f : X →ω𝒒 Y) (x : X) : + toOrderHom f x = f x := by rfl + /-- Converts a ωQBS Hom to an ωCPO Hom. -/ -@[simps, coe] +@[coe] def toContinuousHom (f : X →ω𝒒 Y) : X →𝒄 Y where toFun := f monotone' := f.monotone_coe map_ωSup' := f.ωScottContinuous_coe.map_ωSup +@[simp] theorem toContinuousHom_coe (f : X →ω𝒒 Y) (x : X) : + toContinuousHom f x = f x := by rfl + /-- Converts a ωQBS Hom to a quasi-Borel Hom. -/ -@[simps, coe] +@[coe] def toQuasiBorelHom (f : X →ω𝒒 Y) : X →𝒒 Y where toFun := f +@[simp] theorem toQuasiBorelHom_coe (f : X →ω𝒒 Y) (x : X) : + toQuasiBorelHom f x = f x := by rfl + /-- The underlying pointwise function as an order homomorphism. -/ -def coeOrderHom : (X →ω𝒒 Y) →o (X → Y) where +@[expose] def coeOrderHom : (X →ω𝒒 Y) →o (X → Y) where toFun f := f monotone' _ _ h := h @@ -292,49 +301,64 @@ instance : OmegaQuasiBorelSpace (X →ω𝒒 Y) where /-! ### Operations -/ /-- Identity `OmegaQuasiBorelHom`s. -/ -@[simps] -def id : X →ω𝒒 X where +@[expose] def id : X →ω𝒒 X where toFun x := x +@[simp] theorem id_coe (x : X) : (id : X →ω𝒒 X) x = x := by rfl + /-- Function composition for `OmegaQuasiBorelHom`s. -/ -@[simps coe] -def comp (f : Y →ω𝒒 Z) (g : X →ω𝒒 Y) : X →ω𝒒 Z where +@[expose] def comp (f : Y →ω𝒒 Z) (g : X →ω𝒒 Y) : X →ω𝒒 Z where toFun x := f (g x) +@[simp] theorem comp_coe (f : Y →ω𝒒 Z) (g : X →ω𝒒 Y) (x : X) : + comp f g x = f (g x) := by rfl + /-- Product construction as an `OmegaQuasiBorelHom`. -/ -@[simps coe] def Prod.mk (f : X →ω𝒒 Y) (g : X →ω𝒒 Z) : X →ω𝒒 Y × Z where toFun x := (f x, g x) +@[simp] theorem Prod.mk_coe (f : X →ω𝒒 Y) (g : X →ω𝒒 Z) (x : X) : + Prod.mk f g x = (f x, g x) := by rfl + /-- First product projection. -/ -@[simps coe] def Prod.fst : X × Y →ω𝒒 X where toFun x := x.1 +@[simp] theorem Prod.fst_coe (x : X × Y) : (Prod.fst : X × Y →ω𝒒 X) x = x.1 := by rfl + /-- Second product projection. -/ -@[simps coe] def Prod.snd : X × Y →ω𝒒 Y where toFun x := x.2 +@[simp] theorem Prod.snd_coe (x : X × Y) : (Prod.snd : X × Y →ω𝒒 Y) x = x.2 := by rfl + /-- Currying for `OmegaQuasiBorelHom`s. -/ -@[simps coe] def curry (f : Z × X →ω𝒒 Y) : Z →ω𝒒 (X →ω𝒒 Y) where toFun x := { toFun y := f (x, y) } +@[simp] theorem curry_coe (f : Z × X →ω𝒒 Y) (z : Z) : + curry f z = ({ toFun x := f (z, x) } : X →ω𝒒 Y) := by + ext x + rfl + /-- Function application is an `OmegaQuasiBorelHom`. -/ -@[simps coe] def eval : (X →ω𝒒 Y) × X →ω𝒒 Y where toFun x := x.1 x.2 +@[simp] theorem eval_coe (x : (X →ω𝒒 Y) × X) : + (eval : (X →ω𝒒 Y) × X →ω𝒒 Y) x = x.1 x.2 := by rfl + /-- Uncurrying for `OmegaQuasiBorelHom`s. -/ -@[simps!] def uncurry (f : X →ω𝒒 Y →ω𝒒 Z) : X × Y →ω𝒒 Z := eval.comp (Prod.mk (comp f Prod.fst) Prod.snd) +@[simp] theorem uncurry_coe (f : X →ω𝒒 Y →ω𝒒 Z) (x : X × Y) : + uncurry f x = f x.1 x.2 := by rfl + @[simp] -lemma curry_uncurry (f : Z →ω𝒒 (X →ω𝒒 Y)) : curry (uncurry f) = f := rfl +lemma curry_uncurry (f : Z →ω𝒒 (X →ω𝒒 Y)) : curry (uncurry f) = f := by rfl @[simp] -lemma uncurry_curry (f : Z × X →ω𝒒 Y) : uncurry (curry f) = f := rfl +lemma uncurry_curry (f : Z × X →ω𝒒 Y) : uncurry (curry f) = f := by rfl end OmegaQuasiBorelHom diff --git a/LeanPool/QuasiBorelSpaces/OmegaQuasiBorelSpace.lean b/LeanPool/QuasiBorelSpaces/OmegaQuasiBorelSpace.lean index 19ce0890df..a96e92e22e 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaQuasiBorelSpace.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaQuasiBorelSpace.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.OmegaQuasiBorelSpace`. -/ -@[expose] public section +public section open OmegaCompletePartialOrder diff --git a/LeanPool/QuasiBorelSpaces/Option.lean b/LeanPool/QuasiBorelSpaces/Option.lean index 9b4b8e927c..c6f85f5ca9 100644 --- a/LeanPool/QuasiBorelSpaces/Option.lean +++ b/LeanPool/QuasiBorelSpaces/Option.lean @@ -17,7 +17,7 @@ import LeanPool.QuasiBorelSpaces.Prop Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Option`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Option diff --git a/LeanPool/QuasiBorelSpaces/Option/Instances.lean b/LeanPool/QuasiBorelSpaces/Option/Instances.lean index 5e10a9e7f3..c4d9799b4b 100644 --- a/LeanPool/QuasiBorelSpaces/Option/Instances.lean +++ b/LeanPool/QuasiBorelSpaces/Option/Instances.lean @@ -14,7 +14,7 @@ public import Aesop.BuiltinRules Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Option.Instances`. -/ -@[expose] public section +public section variable {A : Type*} diff --git a/LeanPool/QuasiBorelSpaces/Pi.lean b/LeanPool/QuasiBorelSpaces/Pi.lean index 89b95e51d9..832f573850 100644 --- a/LeanPool/QuasiBorelSpaces/Pi.lean +++ b/LeanPool/QuasiBorelSpaces/Pi.lean @@ -18,7 +18,7 @@ This file defines small products of quasi-borel spaces by giving a See [HeunenKSY17], Proposition 16. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Pi diff --git a/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean b/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean index 4168f803e4..7c92db11b1 100644 --- a/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean +++ b/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.PreProbabilityMeasure`. -/ -@[expose] public section +public section open MeasureTheory open scoped unitInterval @@ -307,15 +307,15 @@ instance : CoeFun (Var A) (fun _ ↦ ℝ → PreProbabilityMeasure A) where coe := apply /-- The constant variable. -/ -def const (μ : PreProbabilityMeasure A) : Var A where +@[expose] def const (μ : PreProbabilityMeasure A) : Var A where eval := μ.eval base _ := μ.base @[simp] -lemma apply_const (μ : PreProbabilityMeasure A) (r : ℝ) : apply (const μ) r = μ := rfl +lemma apply_const (μ : PreProbabilityMeasure A) (r : ℝ) : apply (const μ) r = μ := by rfl /-- Precomposition of variables by measurable functions. -/ -def comp {f : ℝ → ℝ} (hf : Measurable f) (φ : Var A) : Var A where +@[expose] def comp {f : ℝ → ℝ} (hf : Measurable f) (φ : Var A) : Var A where eval := φ.eval base r := φ.base (f r) @@ -323,7 +323,7 @@ def comp {f : ℝ → ℝ} (hf : Measurable f) (φ : Var A) : Var A where lemma apply_comp {f : ℝ → ℝ} (hf : Measurable f) (φ : Var A) (r : ℝ) : apply (comp hf φ) r = apply φ (f r) := - rfl + by rfl /-- Gluing of a countable number of variables. -/ noncomputable def cases diff --git a/LeanPool/QuasiBorelSpaces/ProbabilityMeasure.lean b/LeanPool/QuasiBorelSpaces/ProbabilityMeasure.lean index 874f282224..b8619d79f5 100644 --- a/LeanPool/QuasiBorelSpaces/ProbabilityMeasure.lean +++ b/LeanPool/QuasiBorelSpaces/ProbabilityMeasure.lean @@ -22,7 +22,7 @@ This file defines probability measures over quasi-borel spaces. See [HeunenKSY17], Section V-D. -/ -@[expose] public section +public section open MeasureTheory open scoped unitInterval diff --git a/LeanPool/QuasiBorelSpaces/Prod.lean b/LeanPool/QuasiBorelSpaces/Prod.lean index 169a197513..52a920b263 100644 --- a/LeanPool/QuasiBorelSpaces/Prod.lean +++ b/LeanPool/QuasiBorelSpaces/Prod.lean @@ -21,7 +21,7 @@ This file defines binary products of quasi-borel spaces by giving a See [HeunenKSY17], Proposition 16. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Prod diff --git a/LeanPool/QuasiBorelSpaces/Prop.lean b/LeanPool/QuasiBorelSpaces/Prop.lean index c3c43e4de3..d950a556fe 100644 --- a/LeanPool/QuasiBorelSpaces/Prop.lean +++ b/LeanPool/QuasiBorelSpaces/Prop.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.Prod Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Prop`. -/ -@[expose] public section +public section variable diff --git a/LeanPool/QuasiBorelSpaces/Quotient.lean b/LeanPool/QuasiBorelSpaces/Quotient.lean index 5cde32ea7f..f3e61b40c8 100644 --- a/LeanPool/QuasiBorelSpaces/Quotient.lean +++ b/LeanPool/QuasiBorelSpaces/Quotient.lean @@ -15,7 +15,7 @@ import LeanPool.QuasiBorelSpaces.Hom Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Quotient`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Quotient diff --git a/LeanPool/QuasiBorelSpaces/Rose.lean b/LeanPool/QuasiBorelSpaces/Rose.lean index 846b20986e..d5cea3f4e0 100644 --- a/LeanPool/QuasiBorelSpaces/Rose.lean +++ b/LeanPool/QuasiBorelSpaces/Rose.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Rose`. -/ -@[expose] public section +public section variable {A B C : Type*} [QuasiBorelSpace A] [QuasiBorelSpace B] [QuasiBorelSpace C] diff --git a/LeanPool/QuasiBorelSpaces/Rose/Encoding.lean b/LeanPool/QuasiBorelSpaces/Rose/Encoding.lean index 9fc581b6a7..9ddf6290f5 100644 --- a/LeanPool/QuasiBorelSpaces/Rose/Encoding.lean +++ b/LeanPool/QuasiBorelSpaces/Rose/Encoding.lean @@ -13,7 +13,7 @@ public import LeanPool.QuasiBorelSpaces.RoseTree.Defs Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Rose.Encoding`. -/ -@[expose] public section +public section namespace Rose @@ -30,14 +30,14 @@ abbrev Encoding (A : Type*) := namespace Encoding /-- The encoded version of `Rose.mk`. -/ -def mk (x : A) (xs : List (Encoding A)) : Encoding A where +@[expose] def mk (x : A) (xs : List (Encoding A)) : Encoding A where fst := ⟨(), List.map Sigma.fst xs⟩ snd := fun | [] => x | i :: is => (xs[i]?.map fun k ↦ k.2 is).getD x /-- The encoded version of `Rose.foldr`. -/ -def fold (mk : A → List B → B) : Encoding A → B +@[expose] def fold (mk : A → List B → B) : Encoding A → B | ⟨⟨(), xs⟩, k⟩ => mk (k []) (List.ofFn fun i : Fin xs.length ↦ fold mk ⟨xs[i], fun is ↦ k (i :: is)⟩) diff --git a/LeanPool/QuasiBorelSpaces/RoseTree.lean b/LeanPool/QuasiBorelSpaces/RoseTree.lean index aa724324f3..9a8c25fef0 100644 --- a/LeanPool/QuasiBorelSpaces/RoseTree.lean +++ b/LeanPool/QuasiBorelSpaces/RoseTree.lean @@ -16,4 +16,4 @@ formalization. Defines node-labelled, finitely branching trees together with basic algebraic structure. -/ -@[expose] public section +public section diff --git a/LeanPool/QuasiBorelSpaces/RoseTree/Basic.lean b/LeanPool/QuasiBorelSpaces/RoseTree/Basic.lean index 53af9a05a6..86528cdcae 100644 --- a/LeanPool/QuasiBorelSpaces/RoseTree/Basic.lean +++ b/LeanPool/QuasiBorelSpaces/RoseTree/Basic.lean @@ -14,7 +14,7 @@ import Mathlib.Control.Traversable.Instances Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.RoseTree.Basic`. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/QuasiBorelSpaces/RoseTree/Defs.lean b/LeanPool/QuasiBorelSpaces/RoseTree/Defs.lean index a2c3cd0223..db7494dc2d 100644 --- a/LeanPool/QuasiBorelSpaces/RoseTree/Defs.lean +++ b/LeanPool/QuasiBorelSpaces/RoseTree/Defs.lean @@ -13,7 +13,7 @@ public import Mathlib.Logic.Equiv.List Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.RoseTree.Defs`. -/ -@[expose] public section +public section universe u @@ -29,17 +29,16 @@ structure Rose (A : Type u) : Type u where namespace Rose /-- The fold operation over trees. -/ -@[simp] -def fold (f : A → List B → B) : Rose A → B +@[simp, expose] def fold (f : A → List B → B) : Rose A → B | ⟨x, xs⟩ => f x (xs.map (fold f)) /-- Grafts a tree to every sub-node in a `Rose` tree. -/ -@[simp] +@[expose, simp] def bind (f : A → Rose B) : Rose A → Rose B := fun | ⟨x, xs⟩ => ⟨(f x).label, (f x).children ++ List.map (bind f) xs⟩ /-- Applies a function to every label in a `Rose` tree. -/ -def map (f : A → B) : Rose A → Rose B := +@[expose] def map (f : A → B) : Rose A → Rose B := bind (fun x ↦ ⟨f x, []⟩) instance : Monad Rose where @@ -47,11 +46,11 @@ instance : Monad Rose where bind := flip bind /-- An injection into the natural numbers. -/ -def encode [Encodable A] : Rose A → ℕ +@[expose] def encode [Encodable A] : Rose A → ℕ | ⟨x, xs⟩ => Nat.pair (Encodable.encode x) (Encodable.encode (List.map encode xs)) /-- The inverse of `encode`. -/ -def decode [Encodable A] (n : ℕ) : Option (Rose A) := +@[expose] def decode [Encodable A] (n : ℕ) : Option (Rose A) := match Nat.unpair n, Nat.unpair_right_le n with | (i, j), h => do let x ← Encodable.decode₂ A i diff --git a/LeanPool/QuasiBorelSpaces/SeparatesPoints.lean b/LeanPool/QuasiBorelSpaces/SeparatesPoints.lean index e6e3abd60d..f14f4eaa9c 100644 --- a/LeanPool/QuasiBorelSpaces/SeparatesPoints.lean +++ b/LeanPool/QuasiBorelSpaces/SeparatesPoints.lean @@ -16,7 +16,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.SeparatesPoints`. -/ -@[expose] public section +public section variable {A : Type*} [QuasiBorelSpace A] diff --git a/LeanPool/QuasiBorelSpaces/Sigma.lean b/LeanPool/QuasiBorelSpaces/Sigma.lean index df26922bc4..4041b5f471 100644 --- a/LeanPool/QuasiBorelSpaces/Sigma.lean +++ b/LeanPool/QuasiBorelSpaces/Sigma.lean @@ -22,7 +22,7 @@ This file defines small coproducts of quasi-borel spaces by giving a See [HeunenKSY17], Proposition 17. -/ -@[expose] public section +public section open scoped MeasureTheory @@ -57,16 +57,23 @@ attribute [fun_prop] measurable_index Since every `Var` represents a variable, each `Var` induces a function `ℝ → Σi, P i`. -/ -@[simps] -def apply (x : Var I P) (r : ℝ) : Sigma P where +@[expose] def apply (x : Var I P) (r : ℝ) : Sigma P where fst := x.embed (x.index r) snd := x.var (x.index r) r +@[simp] +lemma apply_fst (x : Var I P) (r : ℝ) : (apply x r).fst = x.embed (x.index r) := by + rfl + +@[simp] +lemma apply_snd (x : Var I P) (r : ℝ) : (apply x r).snd = x.var (x.index r) r := by + rfl + @[simp] lemma apply_mk {f : ℕ → I} {i : ℝ → ℕ} {φ : (i : ℕ) → ℝ → P (f i)} {r : ℝ} (hφ : ∀ i, IsHom (φ i)) (hi : Measurable[_, ⊤] i) - : apply ⟨f, i, φ, hφ, hi⟩ r = ⟨f (i r), φ (i r) r⟩ := + : apply ⟨f, i, φ, hφ, hi⟩ r = ⟨f (i r), φ (i r) r⟩ := by rfl /-- A `Var` can be constructed from any `Encodable` index type. -/ diff --git a/LeanPool/QuasiBorelSpaces/Subtype.lean b/LeanPool/QuasiBorelSpaces/Subtype.lean index 6a761eb928..c20c322217 100644 --- a/LeanPool/QuasiBorelSpaces/Subtype.lean +++ b/LeanPool/QuasiBorelSpaces/Subtype.lean @@ -14,7 +14,7 @@ import LeanPool.QuasiBorelSpaces.Basic Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.Subtype`. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Subtype diff --git a/LeanPool/QuasiBorelSpaces/Sum.lean b/LeanPool/QuasiBorelSpaces/Sum.lean index 0e9f6eb2d7..39356657f5 100644 --- a/LeanPool/QuasiBorelSpaces/Sum.lean +++ b/LeanPool/QuasiBorelSpaces/Sum.lean @@ -20,15 +20,15 @@ This file defines binary coproducts of quasi-borel spaces by giving a See [HeunenKSY17], Proposition 17. -/ -@[expose] public section +public section namespace QuasiBorelSpace.Sum universe u v variable - {A : Type*} [QuasiBorelSpace A] - {B : Type*} [QuasiBorelSpace B] + {A : Type*} [instA : QuasiBorelSpace A] + {B : Type*} [instB : QuasiBorelSpace B] {C : Type*} [QuasiBorelSpace C] {D : Type*} [QuasiBorelSpace D] {E : Type*} [QuasiBorelSpace E] @@ -36,7 +36,7 @@ variable /-- We derive the `QuasiBorelSpace` instance for `A ⊕ B` via `Sigma (Encoding A B)`. -/ -def Encoding (A : Type u) (B : Type v) : Bool → Type (max u v) +@[expose] def Encoding (A : Type u) (B : Type v) : Bool → Type (max u v) | true => ULift A | false => ULift B @@ -83,6 +83,7 @@ def encode : A ⊕ B → Sigma (Encoding A B) := instance : QuasiBorelSpace (A ⊕ B) := lift encode +include instA instB in @[fun_prop] lemma isHom_encode : IsHom (encode (A := A) (B := B)) := by apply isHom_of_lift @@ -114,7 +115,7 @@ lemma isHom_elim ext x cases x <;> rfl rw [this] - fun_prop + exact isHom_comp (Encoding.isHom_elim hf hg) isHom_encode @[fun_prop] lemma isHom_elim' diff --git a/LeanPool/QuasiBorelSpaces/UnitInterval.lean b/LeanPool/QuasiBorelSpaces/UnitInterval.lean index d20af34e9e..0b2d552655 100644 --- a/LeanPool/QuasiBorelSpaces/UnitInterval.lean +++ b/LeanPool/QuasiBorelSpaces/UnitInterval.lean @@ -14,4 +14,4 @@ Re-exports the `UnitInterval` sub-modules used by the quasi-Borel space formalization. -/ -@[expose] public section +public section diff --git a/LeanPool/QuasiBorelSpaces/UnitInterval/AssocProd.lean b/LeanPool/QuasiBorelSpaces/UnitInterval/AssocProd.lean index 18f21c1a19..8bcdac70a4 100644 --- a/LeanPool/QuasiBorelSpaces/UnitInterval/AssocProd.lean +++ b/LeanPool/QuasiBorelSpaces/UnitInterval/AssocProd.lean @@ -13,7 +13,7 @@ public import Mathlib.Topology.UnitInterval Imported Lean Pool material for `LeanPool.QuasiBorelSpaces.UnitInterval.AssocProd`. -/ -@[expose] public section +public section open scoped unitInterval @@ -21,7 +21,6 @@ open scoped unitInterval namespace unitInterval /-- Helper function for `choose_assoc` -/ -@[simps] noncomputable def assocProd (p q : I) : I where val := (σ p * q) / σ (p * q) property := by @@ -37,6 +36,9 @@ noncomputable def assocProd (p q : I) : I where have h₁ : (p : ℝ) = 1 := le_antisymm p.property.2 h.1 simp_all +@[simp] lemma assocProd_coe (p q : I) : + (assocProd p q : ℝ) = (σ p : ℝ) * (q : ℝ) / (σ (p * q) : ℝ) := by rfl + @[inherit_doc] scoped infixr:80 " ⍟ " => assocProd diff --git a/LeanPool/Rado.lean b/LeanPool/Rado.lean index badadfc4c3..7768de03b8 100644 --- a/LeanPool/Rado.lean +++ b/LeanPool/Rado.lean @@ -20,4 +20,4 @@ Tags: riemann-surfaces, second-countability, harmonic-functions, perron-method MSC: 30F15, 30F20, 54D65 -/ -@[expose] public section +public section diff --git a/LeanPool/Rado/Complex/Dirichlet.lean b/LeanPool/Rado/Complex/Dirichlet.lean index eb1e5ad915..cac024451d 100644 --- a/LeanPool/Rado/Complex/Dirichlet.lean +++ b/LeanPool/Rado/Complex/Dirichlet.lean @@ -43,7 +43,7 @@ used by Perron's method: Here "harmonic" is Mathlib's `InnerProductSpace.HarmonicOnNhd`. -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex diff --git a/LeanPool/Rado/Complex/PlanarConnected.lean b/LeanPool/Rado/Complex/PlanarConnected.lean index 76757767ee..cd3255ea57 100644 --- a/LeanPool/Rado/Complex/PlanarConnected.lean +++ b/LeanPool/Rado/Complex/PlanarConnected.lean @@ -23,7 +23,7 @@ Also provided: the annuli `1 ≤ |z ∓ 4| ≤ 2` sit inside `B(0, 8)`, and rela trivial inclusions used when instantiating the configuration in a chart. -/ -@[expose] public section +public section open Set Metric Complex diff --git a/LeanPool/Rado/Complex/Poisson.lean b/LeanPool/Rado/Complex/Poisson.lean index 0d84ec0b4c..b8e522b83a 100644 --- a/LeanPool/Rado/Complex/Poisson.lean +++ b/LeanPool/Rado/Complex/Poisson.lean @@ -39,7 +39,7 @@ Mathlib anchors (pinned commit `905b9581`): `Mathlib/Analysis/Complex/Harmonic/`). -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex Real diff --git a/LeanPool/Rado/Complex/SubMean.lean b/LeanPool/Rado/Complex/SubMean.lean index 94095675e1..99f0282afa 100644 --- a/LeanPool/Rado/Complex/SubMean.lean +++ b/LeanPool/Rado/Complex/SubMean.lean @@ -22,7 +22,7 @@ principle on bounded opens. All are elementary consequences of the circle average inequality and a clopen argument. -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory Real diff --git a/LeanPool/Rado/Main.lean b/LeanPool/Rado/Main.lean index 16b638e32c..28a24454bb 100644 --- a/LeanPool/Rado/Main.lean +++ b/LeanPool/Rado/Main.lean @@ -25,7 +25,7 @@ The real-manifold analogue is false (Prüfer surface, long line), so the proof must use the complex structure in an essential way. -/ -@[expose] public section +public section theorem rado_riemannSurface {X : Type*} [TopologicalSpace X] [T2Space X] [ConnectedSpace X] [ChartedSpace ℂ X] diff --git a/LeanPool/Rado/Surface/Assembly.lean b/LeanPool/Rado/Surface/Assembly.lean index 5eb80239e4..a15649a6e8 100644 --- a/LeanPool/Rado/Surface/Assembly.lean +++ b/LeanPool/Rado/Surface/Assembly.lean @@ -24,7 +24,7 @@ Poincaré–Volterra lemma to the evaluation map on a connected component of the ball (`secondCountableTopology_of_riemannSurface`). -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex Filter diff --git a/LeanPool/Rado/Surface/Barriers.lean b/LeanPool/Rado/Surface/Barriers.lean index 50c2aa8986..d8dca59e99 100644 --- a/LeanPool/Rado/Surface/Barriers.lean +++ b/LeanPool/Rado/Surface/Barriers.lean @@ -20,7 +20,7 @@ two explicit log-barriers on the annuli `1 ≤ |ζ ∓ 4| ≤ 2`: values `≥ 3/ resp. `≤ 1/4` at the witness points `±4 + 2^(1/4)`. -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex Filter @@ -41,6 +41,7 @@ section Config variable (e : OpenPartialHomeomorph X ℂ) /-- The surface `X` minus the two closed configuration disks. -/ +@[expose] def configY : Set X := univ \ (e.symm '' closedBall (-4) 1 ∪ e.symm '' closedBall 4 1) diff --git a/LeanPool/Rado/Surface/Charts.lean b/LeanPool/Rado/Surface/Charts.lean index ba6fece08c..2169a36587 100644 --- a/LeanPool/Rado/Surface/Charts.lean +++ b/LeanPool/Rado/Surface/Charts.lean @@ -29,7 +29,7 @@ is only needed at the very end). This file sets up the chart-level toolkit: second countability. -/ -@[expose] public section +public section open Set Topology Metric Manifold Filter @@ -69,7 +69,7 @@ theorem chartAt_mem_riemannAtlas (x : X) : chartAt ℂ x ∈ riemannAtlas X := IsManifold.chart_mem_maximalAtlas x /-- Chartwise holomorphy of a map `X → ℂ` on a set, via the preferred charts. -/ -def HolomorphicOn (F : X → ℂ) (s : Set X) : Prop := +@[expose] def HolomorphicOn (F : X → ℂ) (s : Set X) : Prop := ∀ x ∈ s, AnalyticAt ℂ (F ∘ (chartAt ℂ x).symm) (chartAt ℂ x x) namespace HolomorphicOn diff --git a/LeanPool/Rado/Surface/Germs.lean b/LeanPool/Rado/Surface/Germs.lean index 1b8a8f488f..8508044608 100644 --- a/LeanPool/Rado/Surface/Germs.lean +++ b/LeanPool/Rado/Surface/Germs.lean @@ -23,7 +23,7 @@ constant germ would force `u` to be constant), and every connected component projects onto all of a connected base. -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex Filter @@ -263,7 +263,7 @@ variable (u : X → ℝ) (Y : Set X) /-- The value of a germ at the base point of its filter (well defined because every neighbourhood of `y` contains `y`). -/ -noncomputable def germValue {y : X} (γ : Germ (𝓝 y) ℂ) : ℂ := +@[expose] noncomputable def germValue {y : X} (γ : Germ (𝓝 y) ℂ) : ℂ := γ.liftOn (fun f ↦ f y) fun _ _ h ↦ h.self_of_nhds omit [ChartedSpace ℂ X] [IsManifold (modelWithCornersSelf ℂ ℂ) 1 X] in @@ -280,7 +280,7 @@ theorem isOpen_eventuallyEq_nhds {F G : X → ℂ} : IsOpen {x : X | F =ᶠ[𝓝 /-- The étale space of conjugate germs of `u` over `Y`: pairs of a point `y ∈ Y` and the germ at `y` of a conjugate of `u` defined on some open neighbourhood inside `Y`. -/ -def ConjEtale : Type _ := +@[expose] def ConjEtale : Type _ := {p : Σ y : X, Germ (𝓝 y) ℂ // p.1 ∈ Y ∧ ∃ V F, IsOpen V ∧ p.1 ∈ V ∧ V ⊆ Y ∧ IsConjugate u F V ∧ p.2 = (F : Germ (𝓝 p.1) ℂ)} @@ -301,6 +301,7 @@ instance : TopologicalSpace (ConjEtale u Y) := TopologicalSpace.generateFrom (basicSets u Y) /-- The projection to the surface. -/ +@[expose] def proj (q : ConjEtale u Y) : X := q.1.1 /-- The evaluation map. -/ diff --git a/LeanPool/Rado/Surface/Harmonic.lean b/LeanPool/Rado/Surface/Harmonic.lean index c7939e68db..0da24eca2d 100644 --- a/LeanPool/Rado/Surface/Harmonic.lean +++ b/LeanPool/Rado/Surface/Harmonic.lean @@ -24,7 +24,7 @@ small circles implies it on all circles, via the maximum principle and comparison with the Poisson extension. -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex Filter @@ -34,7 +34,7 @@ variable {X : Type*} [TopologicalSpace X] [ChartedSpace ℂ X] [IsManifold (modelWithCornersSelf ℂ ℂ) 1 X] /-- The image of `s` in the chart `e`. -/ -def chartImage (e : OpenPartialHomeomorph X ℂ) (s : Set X) : Set ℂ := +@[expose] def chartImage (e : OpenPartialHomeomorph X ℂ) (s : Set X) : Set ℂ := e '' (s ∩ e.source) omit [ChartedSpace ℂ X] [IsManifold (modelWithCornersSelf ℂ ℂ) 1 X] in @@ -67,7 +67,7 @@ theorem continuousOn_comp_chart_symm {g : X → ℝ} (e : OpenPartialHomeomorph /-! ## Harmonic and subharmonic functions on a Riemann surface -/ /-- `u : X → ℝ` is harmonic on `s`: every chart representative is harmonic. -/ -def SurfaceHarmonicOn (u : X → ℝ) (s : Set X) : Prop := +@[expose] def SurfaceHarmonicOn (u : X → ℝ) (s : Set X) : Prop := ∀ e ∈ riemannAtlas X, HarmonicOnNhd (u ∘ e.symm) (chartImage e s) /-- `g : X → ℝ` is subharmonic on `s`: continuous, and every chart diff --git a/LeanPool/Rado/Surface/HolomorphicCompat.lean b/LeanPool/Rado/Surface/HolomorphicCompat.lean index 23554a4d1a..8b895a3a4f 100644 --- a/LeanPool/Rado/Surface/HolomorphicCompat.lean +++ b/LeanPool/Rado/Surface/HolomorphicCompat.lean @@ -44,7 +44,7 @@ proving Radó's theorem from it is strictly stronger than proving it from `ω`; `isManifold_omega_of_one` the two hypotheses are in fact equivalent here. -/ -@[expose] public section +public section open scoped Manifold ContDiff open Set diff --git a/LeanPool/Rado/Surface/Perron.lean b/LeanPool/Rado/Surface/Perron.lean index 7fbcc51658..9a5ffc2a43 100644 --- a/LeanPool/Rado/Surface/Perron.lean +++ b/LeanPool/Rado/Surface/Perron.lean @@ -24,7 +24,7 @@ upper envelope of a Perron family is harmonic Prop. 1.2.3). -/ -@[expose] public section +public section open Set Topology Metric MeasureTheory InnerProductSpace Complex Filter diff --git a/LeanPool/Rado/Topology/PoincareVolterra.lean b/LeanPool/Rado/Topology/PoincareVolterra.lean index 1047597ecc..71f53f4dee 100644 --- a/LeanPool/Rado/Topology/PoincareVolterra.lean +++ b/LeanPool/Rado/Topology/PoincareVolterra.lean @@ -43,7 +43,7 @@ second countable (as a subspace). Then: second-countable open sets cover `Z`. -/ -@[expose] public section +public section open Set Topology TopologicalSpace diff --git a/LeanPool/Rado/Topology/SecondCountable.lean b/LeanPool/Rado/Topology/SecondCountable.lean index a98a321b9e..aca82a3c3a 100644 --- a/LeanPool/Rado/Topology/SecondCountable.lean +++ b/LeanPool/Rado/Topology/SecondCountable.lean @@ -24,7 +24,7 @@ Point-set topology preliminaries for the Poincaré–Volterra lemma All statements are pure topology, independent of the rest of the development. -/ -@[expose] public section +public section open Set Topology diff --git a/LeanPool/RamanujanNagell.lean b/LeanPool/RamanujanNagell.lean index 95559547d8..c4bb856430 100644 --- a/LeanPool/RamanujanNagell.lean +++ b/LeanPool/RamanujanNagell.lean @@ -22,7 +22,7 @@ Tags: number-theory, diophantine-equations, quadratic-integers MSC: 11D61, 11D45, 11R11 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/RamanujanNagell/Basic.lean b/LeanPool/RamanujanNagell/Basic.lean index 5c03c015b0..dea4938945 100644 --- a/LeanPool/RamanujanNagell/Basic.lean +++ b/LeanPool/RamanujanNagell/Basic.lean @@ -22,7 +22,7 @@ below uses these facts together with `units_pm_one`, `theta_irreducible`, `theta'_irreducible`, and the UFD scaffolding `ufd_power_association`. -/ -@[expose] public section +public section namespace RamanujanNagell diff --git a/LeanPool/RamanujanNagell/Helpers.lean b/LeanPool/RamanujanNagell/Helpers.lean index 91962a4600..2bda8f25af 100644 --- a/LeanPool/RamanujanNagell/Helpers.lean +++ b/LeanPool/RamanujanNagell/Helpers.lean @@ -26,7 +26,7 @@ rather than through `𝓞 K` where `K = QuadraticAlgebra ℚ (-2) 1`. The payoff replaces the discriminant / class-number-1 detour through Dirichlet. -/ -@[expose] public section +public section namespace RamanujanNagell @@ -36,23 +36,23 @@ open QuadraticAlgebra abbrev R : Type := QuadraticAlgebra ℤ (-2) 1 /-- `θ = (1 + √-7)/2`, the generator of `R`. -/ -def θ : R := ⟨0, 1⟩ +@[expose] def θ : R := ⟨0, 1⟩ /-- `θ' = (1 - √-7)/2 = 1 - θ`, the Galois conjugate of `θ`. -/ -def θ' : R := ⟨1, -1⟩ +@[expose] def θ' : R := ⟨1, -1⟩ /-! ## Stoll's `rfl` claims -/ -lemma theta_sq : θ ^ 2 = θ - 2 := rfl +lemma theta_sq : θ ^ 2 = θ - 2 := by rfl -lemma theta_mul_theta' : θ * θ' = 2 := rfl +lemma theta_mul_theta' : θ * θ' = 2 := by rfl -lemma theta_add_theta' : θ + θ' = 1 := rfl +lemma theta_add_theta' : θ + θ' = 1 := by rfl -lemma theta'_eq_one_sub_theta : θ' = 1 - θ := rfl +lemma theta'_eq_one_sub_theta : θ' = 1 - θ := by rfl /-- For backward compatibility with the old Helpers API. -/ -lemma two_factorisation_R : θ * (1 - θ) = 2 := rfl +lemma two_factorisation_R : θ * (1 - θ) = 2 := by rfl /-! ## Norm form and positivity diff --git a/LeanPool/RamanujanTauMissesPrimes.lean b/LeanPool/RamanujanTauMissesPrimes.lean index 62d9773efa..0e0f082411 100644 --- a/LeanPool/RamanujanTauMissesPrimes.lean +++ b/LeanPool/RamanujanTauMissesPrimes.lean @@ -21,7 +21,7 @@ Tags: number-theory, modular-forms MSC: 11F30, 11N05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/RamanujanTauMissesPrimes/Solution.lean b/LeanPool/RamanujanTauMissesPrimes/Solution.lean index 23c2f760fe..5be2c3ed2c 100644 --- a/LeanPool/RamanujanTauMissesPrimes/Solution.lean +++ b/LeanPool/RamanujanTauMissesPrimes/Solution.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.IntervalCases # LeanPool.RamanujanTauMissesPrimes.Solution -/ -@[expose] public section +public section open Filter Asymptotics diff --git a/LeanPool/RearrangementNumber.lean b/LeanPool/RearrangementNumber.lean index 0a9049ceb2..7b5c046b67 100644 --- a/LeanPool/RearrangementNumber.lean +++ b/LeanPool/RearrangementNumber.lean @@ -46,4 +46,4 @@ Tags: set-theory, cardinal-characteristics, series MSC: 03E17, 40A05 -/ -@[expose] public section +public section diff --git a/LeanPool/RearrangementNumber/NonMRR.lean b/LeanPool/RearrangementNumber/NonMRR.lean index de4bd371c1..d2cd585dbe 100644 --- a/LeanPool/RearrangementNumber/NonMRR.lean +++ b/LeanPool/RearrangementNumber/NonMRR.lean @@ -35,6 +35,6 @@ public import LeanPool.RearrangementNumber.NonMRR.Morphism /-! Formalization accompanying the rearrangement-number manuscript. -/ -@[expose] public section +public section /- Adapted for Lean Pool: module imports and compatibility with its pinned toolchain. -/ diff --git a/LeanPool/RearrangementNumber/NonMRR/BlockAnalysis.lean b/LeanPool/RearrangementNumber/NonMRR/BlockAnalysis.lean index c23e8821c6..6ce55ba3cf 100644 --- a/LeanPool/RearrangementNumber/NonMRR/BlockAnalysis.lean +++ b/LeanPool/RearrangementNumber/NonMRR/BlockAnalysis.lean @@ -23,14 +23,14 @@ In particular, the conclusion below is deliberately a `Tendsto` statement: `Summable` for real series would assert unconditional (absolute) convergence. -/ -@[expose] public section +public section open Filter Finset Topology namespace NonMRR /-- The partial sum of a series in the order specified by a permutation. -/ -def rearrangedPartialSum (a : ℕ → ℝ) (π : Equiv.Perm ℕ) (j : ℕ) : ℝ := +@[expose] def rearrangedPartialSum (a : ℕ → ℝ) (π : Equiv.Perm ℕ) (j : ℕ) : ℝ := ∑ i ∈ range j, a (π i) /-- A coordinate belongs to at most one member of a disjoint block family. -/ diff --git a/LeanPool/RearrangementNumber/NonMRR/Bounding.lean b/LeanPool/RearrangementNumber/NonMRR/Bounding.lean index 44bd4503d7..e4cda9ac68 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Bounding.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Bounding.lean @@ -22,7 +22,7 @@ The relation `boundingRelation` has `f` related to `g` when `f n < g n` infinitely often. Its norm is the bounding number in the manuscript. -/ -@[expose] public section +public section open Filter Cardinal Set diff --git a/LeanPool/RearrangementNumber/NonMRR/Catalogue.lean b/LeanPool/RearrangementNumber/NonMRR/Catalogue.lean index 6b6af3e501..879d9f0350 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Catalogue.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Catalogue.lean @@ -21,7 +21,7 @@ The blocks are Walsh vectors supported on consecutive disjoint intervals. The geometrically decaying error bound makes their eventual prefix bounds summable. -/ -@[expose] public section +public section open Finset Filter open scoped BigOperators diff --git a/LeanPool/RearrangementNumber/NonMRR/Category.lean b/LeanPool/RearrangementNumber/NonMRR/Category.lean index df02881d77..c0f04869b2 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Category.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Category.lean @@ -28,7 +28,7 @@ lemma. The category comparison used in the final proof is developed in `NonMRR.CategoryBound`; the general Bartoszyński characterization is not assumed. -/ -@[expose] public section +public section open Set Filter Cardinal @@ -37,11 +37,11 @@ namespace NonMRR universe u /-- The least size of a nonmeagre subset of a topological space. -/ -noncomputable def nonMeagreCardinal (X : Type u) [TopologicalSpace X] : Cardinal.{u} := +@[expose] noncomputable def nonMeagreCardinal (X : Type u) [TopologicalSpace X] : Cardinal.{u} := sInf {κ | ∃ s : Set X, ¬ IsMeagre s ∧ Cardinal.mk s = κ} /-- The uniformity of the meagre ideal on the real line, as in the manuscript. -/ -noncomputable def nonM : Cardinal := nonMeagreCardinal ℝ +@[expose] noncomputable def nonM : Cardinal := nonMeagreCardinal ℝ /-- The corresponding cardinal for Baire space; no identification is postulated. -/ noncomputable def nonMBaire : Cardinal := nonMeagreCardinal (ℕ → ℕ) diff --git a/LeanPool/RearrangementNumber/NonMRR/CategoryBlocks.lean b/LeanPool/RearrangementNumber/NonMRR/CategoryBlocks.lean index 06e3ef8488..b14a51cc34 100644 --- a/LeanPool/RearrangementNumber/NonMRR/CategoryBlocks.lean +++ b/LeanPool/RearrangementNumber/NonMRR/CategoryBlocks.lean @@ -19,7 +19,7 @@ This is the topological coding ingredient of the Bartoszyński–Miller characterisation. It does not identify any cardinal invariant by definition. -/ -@[expose] public section +public section open Set Filter diff --git a/LeanPool/RearrangementNumber/NonMRR/CategoryBound.lean b/LeanPool/RearrangementNumber/NonMRR/CategoryBound.lean index d1054458c2..75ae9d9482 100644 --- a/LeanPool/RearrangementNumber/NonMRR/CategoryBound.lean +++ b/LeanPool/RearrangementNumber/NonMRR/CategoryBound.lean @@ -24,7 +24,7 @@ that of any rearranging family. All block, coding and category ingredients are instantiated by the constructions in the preceding modules. -/ -@[expose] public section +public section open Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/CategoryReduction.lean b/LeanPool/RearrangementNumber/NonMRR/CategoryReduction.lean index 534137ea15..057895cc4d 100644 --- a/LeanPool/RearrangementNumber/NonMRR/CategoryReduction.lean +++ b/LeanPool/RearrangementNumber/NonMRR/CategoryReduction.lean @@ -19,7 +19,7 @@ The finite-block description is combined with the explicit pasting of separated blocks. All cardinal estimates use images of actual families. -/ -@[expose] public section +public section open Set Filter Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/CategoryTransfer.lean b/LeanPool/RearrangementNumber/NonMRR/CategoryTransfer.lean index 16aeb1825e..500d897e12 100644 --- a/LeanPool/RearrangementNumber/NonMRR/CategoryTransfer.lean +++ b/LeanPool/RearrangementNumber/NonMRR/CategoryTransfer.lean @@ -24,7 +24,7 @@ nonempty real interior. This suffices to preserve nonmeagreness of images; injectivity and an identification of the spaces are unnecessary. -/ -@[expose] public section +public section open Set Filter Finset Cardinal Topology diff --git a/LeanPool/RearrangementNumber/NonMRR/Construction.lean b/LeanPool/RearrangementNumber/NonMRR/Construction.lean index 048397a58f..b8e7f3709b 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Construction.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Construction.lean @@ -23,7 +23,7 @@ The analytic hypotheses are precisely the conclusions of the finite construction they do not assume an inequality between cardinal characteristics. -/ -@[expose] public section +public section open Filter Finset Cardinal Set open scoped Topology diff --git a/LeanPool/RearrangementNumber/NonMRR/FiniteAnalytic.lean b/LeanPool/RearrangementNumber/NonMRR/FiniteAnalytic.lean index ccf3709377..0c6599d5cb 100644 --- a/LeanPool/RearrangementNumber/NonMRR/FiniteAnalytic.lean +++ b/LeanPool/RearrangementNumber/NonMRR/FiniteAnalytic.lean @@ -19,7 +19,7 @@ public import Mathlib.Tactic.NormNum /-! Finite analytic estimates. -/ -@[expose] public section +public section open scoped BigOperators @@ -114,7 +114,7 @@ theorem sum_walk_fourth_le {ι : Type*} [Fintype ι] {L : ℕ} (hLpos : 0 < L) _ = 4 := by simp [hLne] /-- The walks that at some time exceed the threshold `1/q`. -/ -noncomputable def badWalks {ι : Type*} [Fintype ι] +@[expose] noncomputable def badWalks {ι : Type*} [Fintype ι] (S : ι → ℕ → ℝ) (L q : ℕ) : Finset ι := by classical exact Finset.univ.filter fun k => ∃ j ≤ L, 1 / (q : ℝ) < |S k j| diff --git a/LeanPool/RearrangementNumber/NonMRR/FiniteEmbedding.lean b/LeanPool/RearrangementNumber/NonMRR/FiniteEmbedding.lean index 4125d15fa5..f0b5051167 100644 --- a/LeanPool/RearrangementNumber/NonMRR/FiniteEmbedding.lean +++ b/LeanPool/RearrangementNumber/NonMRR/FiniteEmbedding.lean @@ -16,7 +16,7 @@ public import Mathlib.Data.Finset.Sort /-! Embedding finite vectors into series. -/ -@[expose] public section +public section open scoped BigOperators open Finset diff --git a/LeanPool/RearrangementNumber/NonMRR/FiniteVectors.lean b/LeanPool/RearrangementNumber/NonMRR/FiniteVectors.lean index 10c195e9e9..0120bb0f60 100644 --- a/LeanPool/RearrangementNumber/NonMRR/FiniteVectors.lean +++ b/LeanPool/RearrangementNumber/NonMRR/FiniteVectors.lean @@ -15,7 +15,7 @@ public import LeanPool.RearrangementNumber.NonMRR.Walsh /-! Finite vector constructions. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/RearrangementNumber/NonMRR/GapBounding.lean b/LeanPool/RearrangementNumber/NonMRR/GapBounding.lean index 550c5d4529..fae8dc68e9 100644 --- a/LeanPool/RearrangementNumber/NonMRR/GapBounding.lean +++ b/LeanPool/RearrangementNumber/NonMRR/GapBounding.lean @@ -20,7 +20,7 @@ family of increasing sequences whose successive gaps escape any prescribed function. This is the bounding-number ingredient in the category reduction. -/ -@[expose] public section +public section open Filter Finset Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/LowerBound.lean b/LeanPool/RearrangementNumber/NonMRR/LowerBound.lean index 1e93125401..e44677e9a2 100644 --- a/LeanPool/RearrangementNumber/NonMRR/LowerBound.lean +++ b/LeanPool/RearrangementNumber/NonMRR/LowerBound.lean @@ -22,7 +22,7 @@ least the bounding number. This statement does not presume that a rearranging family has already been constructed. -/ -@[expose] public section +public section open Filter Cardinal Topology diff --git a/LeanPool/RearrangementNumber/NonMRR/Main.lean b/LeanPool/RearrangementNumber/NonMRR/Main.lean index 42c9258143..43957f0486 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Main.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Main.lean @@ -21,7 +21,7 @@ of the real line, and `rr` uses rearranging families of permutations of ℕ. All preceding construction and category lemmas have been proved over mathlib. -/ -@[expose] public section +public section open Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/Morphism.lean b/LeanPool/RearrangementNumber/NonMRR/Morphism.lean index 392691d791..88d9728088 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Morphism.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Morphism.lean @@ -22,7 +22,7 @@ from each catalogue indexed by `g`. Its response map records the exceptional blocks of a growth function and a permutation. -/ -@[expose] public section +public section open Filter diff --git a/LeanPool/RearrangementNumber/NonMRR/Padding.lean b/LeanPool/RearrangementNumber/NonMRR/Padding.lean index 26706cf497..07bde62bd6 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Padding.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Padding.lean @@ -22,7 +22,7 @@ natural sum of a series, and inserting zeros preserves failure of absolute convergence. -/ -@[expose] public section +public section open Filter Finset Topology diff --git a/LeanPool/RearrangementNumber/NonMRR/PermutationBounds.lean b/LeanPool/RearrangementNumber/NonMRR/PermutationBounds.lean index a869e1d698..6e3c2b8ebc 100644 --- a/LeanPool/RearrangementNumber/NonMRR/PermutationBounds.lean +++ b/LeanPool/RearrangementNumber/NonMRR/PermutationBounds.lean @@ -19,7 +19,7 @@ An eventually bounded family of permutation controls admits a common increasing sequence whose tail is preserved in order by the inverse of each permutation. -/ -@[expose] public section +public section open Filter Finset Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/Relations.lean b/LeanPool/RearrangementNumber/NonMRR/Relations.lean index 06e6a742e6..8bc6c48254 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Relations.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Relations.lean @@ -20,7 +20,7 @@ The direction of a morphism agrees with that section: a morphism from `A` to `B` gives `B.norm ≤ A.norm`. -/ -@[expose] public section +public section open Cardinal Set @@ -41,7 +41,7 @@ structure Relation where namespace Relation /-- A family of responses solving every challenge. -/ -def Dominating (A : Relation.{u}) (s : Set A.Response) : Prop := +@[expose] def Dominating (A : Relation.{u}) (s : Set A.Response) : Prop := ∀ x, ∃ y ∈ s, A.relates x y /-- The least cardinality of a dominating family. -/ @@ -87,7 +87,7 @@ theorem Morphism.norm_le {A B : Relation.{u}} (f : Morphism A B) : B.norm ≤ A. _ = A.norm := hcard /-- The second challenge in a sequential composition depends on the first response. -/ -def sequential (A B : Relation.{u}) : Relation.{u} where +@[expose] def sequential (A B : Relation.{u}) : Relation.{u} where Challenge := A.Challenge × (A.Response → B.Challenge) Response := A.Response × B.Response relates x y := A.relates x.1 y.1 ∧ B.relates (x.2 y.1) y.2 diff --git a/LeanPool/RearrangementNumber/NonMRR/Riemann.lean b/LeanPool/RearrangementNumber/NonMRR/Riemann.lean index f197a88cd9..26c7772a3d 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Riemann.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Riemann.lean @@ -19,7 +19,7 @@ public import Mathlib.Tactic /-! Rearranging a conditionally convergent series through Baire category. -/ -@[expose] public section +public section open Filter Finset Set Topology open scoped BigOperators diff --git a/LeanPool/RearrangementNumber/NonMRR/RiemannBaire.lean b/LeanPool/RearrangementNumber/NonMRR/RiemannBaire.lean index 6ac276d7c7..421421fe7d 100644 --- a/LeanPool/RearrangementNumber/NonMRR/RiemannBaire.lean +++ b/LeanPool/RearrangementNumber/NonMRR/RiemannBaire.lean @@ -21,7 +21,7 @@ space of injections. Simultaneously requiring each integer in the range turns the resulting injection into a permutation. -/ -@[expose] public section +public section open Filter Finset Set Topology diff --git a/LeanPool/RearrangementNumber/NonMRR/Selection.lean b/LeanPool/RearrangementNumber/NonMRR/Selection.lean index f57125d2ed..91dad18f75 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Selection.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Selection.lean @@ -20,7 +20,7 @@ slalom to a common zero-sum witness. All hypotheses describe the concrete finite blocks and the chosen functions; no cardinal-invariant inequality is assumed. -/ -@[expose] public section +public section open Filter Finset Topology diff --git a/LeanPool/RearrangementNumber/NonMRR/Series.lean b/LeanPool/RearrangementNumber/NonMRR/Series.lean index 7cf68853f2..a957992c62 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Series.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Series.lean @@ -22,7 +22,7 @@ Convergence is taken along the natural partial sums. In particular, ordinary We use mathlib's `SummationFilter.conditional ℕ` explicitly. -/ -@[expose] public section +public section open Filter Finset Cardinal open scoped Topology @@ -30,7 +30,7 @@ open scoped Topology namespace NonMRR /-- The sum of the first `n` terms. -/ -def partialSum (a : ℕ → ℝ) (n : ℕ) : ℝ := ∑ i ∈ range n, a i +@[expose] def partialSum (a : ℕ → ℝ) (n : ℕ) : ℝ := ∑ i ∈ range n, a i theorem hasSum_conditional_iff {a : ℕ → ℝ} {s : ℝ} : HasSum a s (SummationFilter.conditional ℕ) ↔ @@ -48,11 +48,11 @@ structure ConditionalSeries where not_absolute : ¬ Summable (fun n ↦ |term n|) /-- A permutation rearranges a series when it fails to preserve its natural sum. -/ -def Rearranges (a : ConditionalSeries) (π : Equiv.Perm ℕ) : Prop := +@[expose] def Rearranges (a : ConditionalSeries) (π : Equiv.Perm ℕ) : Prop := ¬ HasSum (a.term ∘ π) a.sum (SummationFilter.conditional ℕ) /-- A family which rearranges every conditionally convergent real series. -/ -def IsRearranging (s : Set (Equiv.Perm ℕ)) : Prop := +@[expose] def IsRearranging (s : Set (Equiv.Perm ℕ)) : Prop := ∀ a : ConditionalSeries, ∃ π ∈ s, Rearranges a π /-- The rearrangement number, with the cardinal-minimum definition in the manuscript. -/ diff --git a/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean b/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean index 567f725e73..cdb8be6f20 100644 --- a/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean +++ b/LeanPool/RearrangementNumber/NonMRR/SlalomBound.lean @@ -21,7 +21,7 @@ classical bounding-number lower bound. The category comparison needed for the topological cardinal `nonM` is proved in `NonMRR.CategoryBound`. -/ -@[expose] public section +public section open Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean b/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean index f48b9bfe1f..db0fee9fa5 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Slaloms.lean @@ -21,7 +21,7 @@ This defines the actual finite-set-valued slaloms of the manuscript. Their relation norm is not identified with `nonM` by definition. -/ -@[expose] public section +public section open Filter Cardinal diff --git a/LeanPool/RearrangementNumber/NonMRR/Walsh.lean b/LeanPool/RearrangementNumber/NonMRR/Walsh.lean index b574fb2e48..665c93c3cf 100644 --- a/LeanPool/RearrangementNumber/NonMRR/Walsh.lean +++ b/LeanPool/RearrangementNumber/NonMRR/Walsh.lean @@ -16,7 +16,7 @@ public import Mathlib.Tactic /-! Walsh sign families. -/ -@[expose] public section +public section open scoped BigOperators open Finset @@ -26,7 +26,7 @@ noncomputable section namespace NonMRR /-- The sum of the first `j` coordinates of a finite real vector. -/ -def vectorPrefix {L : ℕ} (v : Fin L → ℝ) (j : ℕ) : ℝ := +@[expose] def vectorPrefix {L : ℕ} (v : Fin L → ℝ) (j : ℕ) : ℝ := ∑ i ∈ univ.filter (fun i : Fin L => i.val < j), v i private def sign (b : Bool) : ℝ := if b then 1 else -1 diff --git a/LeanPool/RearrangementNumber/Solution.lean b/LeanPool/RearrangementNumber/Solution.lean index da3e433119..8315cf20f3 100644 --- a/LeanPool/RearrangementNumber/Solution.lean +++ b/LeanPool/RearrangementNumber/Solution.lean @@ -19,7 +19,7 @@ the substantive proof development in this repository. Challenge and Solution are separate environments: never import Challenge here. -/ -@[expose] public section +public section open Cardinal diff --git a/LeanPool/Redhill.lean b/LeanPool/Redhill.lean index 37bb4b2725..08821beec9 100644 --- a/LeanPool/Redhill.lean +++ b/LeanPool/Redhill.lean @@ -41,4 +41,4 @@ Tags: number-theory, abc-conjecture, n-conjecture, ramaekers-conjecture MSC: 11A41, 11D75 -/ -@[expose] public section +public section diff --git a/LeanPool/Redhill/BB94.lean b/LeanPool/Redhill/BB94.lean index 5897fb9f10..e6a6b1f7b9 100644 --- a/LeanPool/Redhill/BB94.lean +++ b/LeanPool/Redhill/BB94.lean @@ -15,7 +15,7 @@ import Mathlib.RingTheory.Radical.NatInt # Browkin and Brzeziński's 1994 result -/ -@[expose] public section +public section namespace BB94 diff --git a/LeanPool/Redhill/Common/Conjectures.lean b/LeanPool/Redhill/Common/Conjectures.lean index c595cb4f3c..2d1ac9cb11 100644 --- a/LeanPool/Redhill/Common/Conjectures.lean +++ b/LeanPool/Redhill/Common/Conjectures.lean @@ -13,7 +13,7 @@ public import LeanPool.Redhill.Common.SubsumCondition # Definitions of the tuple sets and conjectures considered in the paper -/ -@[expose] public section +public section open Finset @@ -23,7 +23,7 @@ def ABCConjecture : Prop := quality {a : Fin 3 → ℤ | ∑ i, a i = 0 ∧ univ.gcd a = 1} = 1 /-- The tuples in Browkin and Brzeziński's `n`-conjecture. `A(n)` in the paper. -/ -def nConjectureTuples (n : ℕ) : Set (Fin n → ℤ) := +@[expose] def nConjectureTuples (n : ℕ) : Set (Fin n → ℤ) := {a | ∑ i, a i = 0 ∧ SSC a ∧ univ.gcd a = 1} /-- Browkin and Brzeziński's **`n`-conjecture** for a fixed `n`. @@ -46,11 +46,11 @@ def ramaekersTuples (n : ℕ) : Set (Fin n → ℤ) := /-- **Ramaekers's conjecture** for a fixed `n`. The conjecture itself is `∀ n ≥ 3, RamaekersConjecture n`. -/ -def RamaekersConjecture (n : ℕ) : Prop := +@[expose] def RamaekersConjecture (n : ℕ) : Prop := quality (ramaekersTuples n) = 1 /-- `U(F,n)` in the paper. -/ -def factorFreeTuples (F : Finset ℕ) (n : ℕ) : Set (Fin n → ℤ) := +@[expose] def factorFreeTuples (F : Finset ℕ) (n : ℕ) : Set (Fin n → ℤ) := {a | ∑ i, a i = 0 ∧ StrongSSC a ∧ PairwiseCoprime a ∧ ∀ f ∈ F, ∀ i, ¬↑f ∣ a i} lemma nConjecture_3_iff_ABC : NConjecture 3 ↔ ABCConjecture := by diff --git a/LeanPool/Redhill/Common/MaxAbs.lean b/LeanPool/Redhill/Common/MaxAbs.lean index 08473d653a..21a7654e1f 100644 --- a/LeanPool/Redhill/Common/MaxAbs.lean +++ b/LeanPool/Redhill/Common/MaxAbs.lean @@ -12,7 +12,7 @@ public import Mathlib.Data.Fintype.Basic # Maximum absolute value of a tuple of integers -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Redhill/Common/PairwiseCoprime.lean b/LeanPool/Redhill/Common/PairwiseCoprime.lean index 7b2e492c2c..77bf6b157f 100644 --- a/LeanPool/Redhill/Common/PairwiseCoprime.lean +++ b/LeanPool/Redhill/Common/PairwiseCoprime.lean @@ -14,7 +14,7 @@ import Mathlib.RingTheory.Coprime.Lemmas # Pairwise coprimality -/ -@[expose] public section +public section /-- A predicate stating that the given tuple's numbers are pairwise coprime. -/ diff --git a/LeanPool/Redhill/Common/PrimeChain.lean b/LeanPool/Redhill/Common/PrimeChain.lean index f1d43c0b08..3a320e2812 100644 --- a/LeanPool/Redhill/Common/PrimeChain.lean +++ b/LeanPool/Redhill/Common/PrimeChain.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Order.Group.Nat These are sequences of primes where the next prime is at least twice the last. -/ -@[expose] public section +public section open Nat @@ -45,7 +45,7 @@ lemma primeChain_gt {s n : ℕ} : s < primeChain s n := open Fin Finset /-- An `(n + 2)`-tuple that satisfies the strong subsum condition if `0 < m ≤ s`. -/ -def chainTup (n m s : ℕ) (i : Fin (n + 2)) : ℤ := +@[expose] def chainTup (n m s : ℕ) (i : Fin (n + 2)) : ℤ := i.addCases (primeChain s ·.1) fun | 0 => m | 1 => -(m + ∑ i ∈ range n, primeChain s i) variable {n m s : ℕ} diff --git a/LeanPool/Redhill/Common/Quality.lean b/LeanPool/Redhill/Common/Quality.lean index af2da55c00..8d93e45dbe 100644 --- a/LeanPool/Redhill/Common/Quality.lean +++ b/LeanPool/Redhill/Common/Quality.lean @@ -15,7 +15,7 @@ public import Mathlib.RingTheory.PrincipalIdealDomain # Qualities of tuples and sets of tuples -/ -@[expose] public section +public section open Finset Real ENNReal @@ -25,7 +25,7 @@ variable {n : ℕ} open UniqueFactorizationMonoid in /-- The quality of a single tuple. This depends on Lean defining `log -x = log x` for all real `x`. -/ -noncomputable def tupleQuality (a : Fin n → ℤ) : ℝ≥0∞ := +@[expose] noncomputable def tupleQuality (a : Fin n → ℤ) : ℝ≥0∞ := .ofReal (log (maxAbs a) / log (radical (∏ i, a i) : ℤ)) /-- The quality of a set of tuples, defined as the infimum of those numbers where diff --git a/LeanPool/Redhill/Common/SubsumCondition.lean b/LeanPool/Redhill/Common/SubsumCondition.lean index 6da68c7e67..eccc935b18 100644 --- a/LeanPool/Redhill/Common/SubsumCondition.lean +++ b/LeanPool/Redhill/Common/SubsumCondition.lean @@ -18,7 +18,7 @@ public import Mathlib.Algebra.Order.Ring.Nat # Subsum conditions -/ -@[expose] public section +public section open Finset SignType @@ -27,16 +27,17 @@ variable {n k : ℕ} (a : Fin n → ℤ) /-- The subsum condition: any subset of the tuple summing to 0 is either empty or the whole tuple. -/ -def SSC : Prop := +@[expose] def SSC : Prop := ∀ b, b.Nonempty → bᶜ.Nonempty → ∑ i ∈ b, a i ≠ 0 /-- A subsum block for `a` is an index set that must be constant in any sign weighting of the tuple's elements that leads to a zero sum. -/ +@[expose] def IsSubsumBlock (s : Finset (Fin n)) : Prop := ∀ b : Fin n → SignType, ∑ i, b i * a i = 0 → ∃ c, ∀ i ∈ s, b i = c /-- The strong subsum condition, defined as all `Fin n` being a subsum block. -/ -def StrongSSC : Prop := +@[expose] def StrongSSC : Prop := IsSubsumBlock a univ variable {a} @@ -129,7 +130,7 @@ section TupReduce variable (s : Finset (Fin n)) (hk : k = n - #s) /-- The order-preserving bijection from `Fin k` to `sᶜ`, where `k = n - #s`. -/ -def complRank (i : Fin k) : Fin n := +@[expose] def complRank (i : Fin k) : Fin n := sᶜ.orderEmbOfFin (by simp [card_compl]) (i.cast hk) lemma complRank_01 : complRank {0, 1} (n.add_sub_cancel 2).symm = (Fin.addNat · 2) := @@ -139,7 +140,7 @@ variable (a) in /-- `tupReduce a s hk` is the tuple with `∑ i ∈ s, a i` at the last index and the remaining elements of `a` appended in order. `hk : k = n - #s` mitigates definitional equality problems. -/ -def tupReduce : Fin (k + 1) → ℤ := +@[expose] def tupReduce : Fin (k + 1) → ℤ := Fin.lastCases (∑ i ∈ s, a i) fun i ↦ a (complRank s hk i) variable {s hk} diff --git a/LeanPool/Redhill/Common/VWPair.lean b/LeanPool/Redhill/Common/VWPair.lean index 06d5f613ca..e05dbc6e5b 100644 --- a/LeanPool/Redhill/Common/VWPair.lean +++ b/LeanPool/Redhill/Common/VWPair.lean @@ -32,7 +32,7 @@ because 29 and 31 are big primes. The coprimality condition only requires `0 < u ≤ m` and is proved separately. -/ -@[expose] public section +public section open Nat Finset @@ -201,7 +201,7 @@ variable {n m s B : ℕ} {vw : VWPair (m + ∑ i ∈ range n, primeChain s i) B} variable (vw) in /-- An `(n + 3)`-tuple reducing to `chainTup n m s`. -/ -def vwTup (i : Fin (n + 3)) : ℤ := +@[expose] def vwTup (i : Fin (n + 3)) : ℤ := i.addCases (primeChain s ·.1) fun | 0 => vw.v | 1 => -vw.w diff --git a/LeanPool/Redhill/General/Coprime.lean b/LeanPool/Redhill/General/Coprime.lean index bdc8ec7c20..956d98f7a3 100644 --- a/LeanPool/Redhill/General/Coprime.lean +++ b/LeanPool/Redhill/General/Coprime.lean @@ -19,7 +19,7 @@ they have no common factor". This is not always true even with the paper's defin but can be made so by adding 101 to the factors of `y`. -/ -@[expose] public section +public section namespace GeneralCase diff --git a/LeanPool/Redhill/General/Defs.lean b/LeanPool/Redhill/General/Defs.lean index 50b500384f..3d45d2e5af 100644 --- a/LeanPool/Redhill/General/Defs.lean +++ b/LeanPool/Redhill/General/Defs.lean @@ -24,7 +24,7 @@ for sufficiently large `h`. The lower bound `s` for `primeChain` in `U` was originally `200 * Y F ^ 6`. -/ -@[expose] public section +public section namespace GeneralCase @@ -34,9 +34,11 @@ open Nat Fin Finset variable (n : ℕ) (F : Finset ℕ) (h : ℕ) /-- An optimised version of the paper's `y`. -/ +@[expose] def Y : ℕ := 33330 * (F.erase 0).prod id /-- `x` in the paper, but using the optimised `y`. -/ +@[expose] def X : ℕ := (Y F + 1) ^ h ! lemma Y_lower_bound {F} : 33330 ≤ Y F := by @@ -49,7 +51,7 @@ lemma Y_lt_X {F h} : Y F < X F h := (lt_add_one _).trans_le (le_self_pow (factorial_ne_zero h) _) /-- The sum of `tup` over all indices save `n` and `n + 1`, i.e. the input `u` to `VWPair`. -/ -def U : ℕ := (100 * Y F - 2) * Y F ^ 5 + ∑ i ∈ range n, primeChain (100 * Y F ^ 6) i +@[expose] def U : ℕ := (100 * Y F - 2) * Y F ^ 5 + ∑ i ∈ range n, primeChain (100 * Y F ^ 6) i lemma U_lower_bound {n F} : (100 * 33330 - 2) * 33330 ^ 5 ≤ U n F := by apply (Nat.le_add_right ..).trans' @@ -58,11 +60,12 @@ lemma U_lower_bound {n F} : (100 * 33330 - 2) * 33330 ^ 5 ≤ U n F := by lemma U_pos {n F} : 0 < U n F := by grind [U_lower_bound] /-- The `VWPair` generated from the inputs `u = m = U n F`. -/ +@[expose] def VW : VWPair (U n F) (U n F) := .of .. /-- The sequence of `(n + 6)`-tuples whose tail is in `factorFreeTuples` and has quality tending to `5 / 4`. -/ -def tup (i : Fin (n + 6)) : ℤ := +@[expose] def tup (i : Fin (n + 6)) : ℤ := i.addCases (primeChain (100 * Y F ^ 6) ·.1) fun | 0 => (VW n F).v | 1 => -(VW n F).w diff --git a/LeanPool/Redhill/General/Main.lean b/LeanPool/Redhill/General/Main.lean index 541105062b..d131131774 100644 --- a/LeanPool/Redhill/General/Main.lean +++ b/LeanPool/Redhill/General/Main.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset # The general case (Theorem 1.14) -/ -@[expose] public section +public section namespace GeneralCase diff --git a/LeanPool/Redhill/General/Subsum.lean b/LeanPool/Redhill/General/Subsum.lean index 6558b2ba4c..42e283cf0b 100644 --- a/LeanPool/Redhill/General/Subsum.lean +++ b/LeanPool/Redhill/General/Subsum.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Positivity.Finset # Subsum condition for the general case -/ -@[expose] public section +public section namespace GeneralCase @@ -31,6 +31,7 @@ open Fin Finset Nat variable {n : ℕ} {F : Finset ℕ} {h : ℕ} /-- The embedding for the first subsum block reduction. -/ +@[expose] def redEmb1 : Fin 4 ↪ Fin (n + 6) := ⟨fun i ↦ (i.natAdd 2).natAdd n, fun i j h ↦ by simpa [natAdd_inj 2] using h⟩ diff --git a/LeanPool/Redhill/KonyaginPrelude.lean b/LeanPool/Redhill/KonyaginPrelude.lean index 0cb030e392..47234a7858 100644 --- a/LeanPool/Redhill/KonyaginPrelude.lean +++ b/LeanPool/Redhill/KonyaginPrelude.lean @@ -15,7 +15,7 @@ import Mathlib.RingTheory.Radical.NatInt # The "warm-up" result (Theorem 2.1) -/ -@[expose] public section +public section namespace KonyaginPrelude diff --git a/LeanPool/Redhill/Odd/Defs.lean b/LeanPool/Redhill/Odd/Defs.lean index 75de381a8d..4ce1cd5358 100644 --- a/LeanPool/Redhill/Odd/Defs.lean +++ b/LeanPool/Redhill/Odd/Defs.lean @@ -23,7 +23,7 @@ The lower bound `s` for `primeChain` in `U` was originally `max 16 (F.sup id)`. This could be lowered because `strongSSC_vwTup` only requires `m ≤ s`, not `2m ≤ s`. -/ -@[expose] public section +public section namespace OddCase @@ -33,6 +33,7 @@ open Nat Fin Finset variable (n : ℕ) (F : Finset ℕ) /-- The sum of `tup` over all indices save `n` and `n + 1`, i.e. the input `u` to `VWPair`. -/ +@[expose] def U : ℕ := 8 + ∑ i ∈ range n, primeChain (max 8 (F.sup id)) i /-- The `VWPair` generated from the inputs `u = U n F, m = max (U n F) (F.sup id)`. -/ @@ -40,13 +41,13 @@ def VW : VWPair (U n F) (max (U n F) (F.sup id)) := .of .. /-- We require `x` in `tup` to be a multiple of this number, an optimised version of the paper's `y`. -/ -def Y : ℕ := +@[expose] def Y : ℕ := 10 * (F.erase 0).prod id * (∏ i ∈ range n, primeChain (max 8 (F.sup id)) i) * (VW n F).v * (VW n F).w /-- The sequence of `(n + 5)`-tuples containing an infinite subsequence in `factorFreeTuples` whose qualities tend to `5 / 3`, assuming `n` is even and `0, 1, 2, 5, 10 ∉ F`. -/ -def tup (x : ℤ) (i : Fin (n + 5)) : ℤ := +@[expose] def tup (x : ℤ) (i : Fin (n + 5)) : ℤ := i.addCases (primeChain (max 8 (F.sup id)) ·.1) fun | 0 => (VW n F).v | 1 => -(VW n F).w diff --git a/LeanPool/Redhill/Odd/Main.lean b/LeanPool/Redhill/Odd/Main.lean index 0da14b367a..7022072c59 100644 --- a/LeanPool/Redhill/Odd/Main.lean +++ b/LeanPool/Redhill/Odd/Main.lean @@ -17,7 +17,7 @@ import Mathlib.RingTheory.Radical.NatInt # The odd case (Theorem 1.13) -/ -@[expose] public section +public section namespace OddCase diff --git a/LeanPool/Redhill/Odd/Pell.lean b/LeanPool/Redhill/Odd/Pell.lean index c2d941b366..1981d47952 100644 --- a/LeanPool/Redhill/Odd/Pell.lean +++ b/LeanPool/Redhill/Odd/Pell.lean @@ -14,7 +14,7 @@ import Mathlib.RingTheory.Radical.NatInt # Pell equation for the odd case -/ -@[expose] public section +public section namespace OddCase diff --git a/LeanPool/Redhill/Odd/Subsum.lean b/LeanPool/Redhill/Odd/Subsum.lean index 52cb6b899a..bb80a669e3 100644 --- a/LeanPool/Redhill/Odd/Subsum.lean +++ b/LeanPool/Redhill/Odd/Subsum.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Zify # Subsum condition for the odd case -/ -@[expose] public section +public section namespace OddCase @@ -32,6 +32,7 @@ open Fin Finset variable {n : ℕ} {F : Finset ℕ} {x : ℤ} /-- The embedding for the first subsum block reduction. -/ +@[expose] def redEmb1 : Fin 3 ↪ Fin (n + 5) := ⟨fun i ↦ (i.natAdd 2).natAdd n, fun i j h ↦ by simpa [natAdd_inj 2] using h⟩ diff --git a/LeanPool/Redhill/ToMathlib/NatAbs.lean b/LeanPool/Redhill/ToMathlib/NatAbs.lean index c87d3ab93d..0e1f24e21a 100644 --- a/LeanPool/Redhill/ToMathlib/NatAbs.lean +++ b/LeanPool/Redhill/ToMathlib/NatAbs.lean @@ -13,7 +13,7 @@ import Mathlib.Data.Int.Order.Basic # Lemmas on `Int.natAbs` -/ -@[expose] public section +public section lemma Int.sub_le_add_natAbs {a b : ℤ} : a.natAbs - b.natAbs ≤ (a + b).natAbs := by lia diff --git a/LeanPool/Redhill/ToMathlib/NatSumProd.lean b/LeanPool/Redhill/ToMathlib/NatSumProd.lean index 6566f5b9a5..936653c077 100644 --- a/LeanPool/Redhill/ToMathlib/NatSumProd.lean +++ b/LeanPool/Redhill/ToMathlib/NatSumProd.lean @@ -16,7 +16,7 @@ import Mathlib.Algebra.Ring.Nat These are used when proving the subsum condition in the odd case. -/ -@[expose] public section +public section namespace Nat diff --git a/LeanPool/RellichKondrachov.lean b/LeanPool/RellichKondrachov.lean index a053e828cc..0a1d181d9e 100644 --- a/LeanPool/RellichKondrachov.lean +++ b/LeanPool/RellichKondrachov.lean @@ -59,7 +59,7 @@ Tags: analysis, pde, sobolev-embedding MSC: 46E35 -/ -@[expose] public section +public section /-! # Rellich–Kondrachov Compact Embedding Theorem diff --git a/LeanPool/RellichKondrachov/Analysis/Calculus/ContDiff/Support.lean b/LeanPool/RellichKondrachov/Analysis/Calculus/ContDiff/Support.lean index 45053edb42..2eb4f03a9d 100644 --- a/LeanPool/RellichKondrachov/Analysis/Calculus/ContDiff/Support.lean +++ b/LeanPool/RellichKondrachov/Analysis/Calculus/ContDiff/Support.lean @@ -18,7 +18,7 @@ is contained in `s`, then `f` is globally `C^n` (it is `0` in a neighborhood of outside `s`). -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H1.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H1.lean index 290ed5b783..23b8510670 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H1.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H1.lean @@ -42,7 +42,7 @@ No analytic “Sobolev theorems” are proved here; those are tracked separately regularity beads). -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -73,7 +73,7 @@ abbrev L2E : Type _ := ↥(E →₂[μ] E) abbrev H1Target : Type _ := L2ℝ (μ := μ) × L2E (μ := μ) /-- `C¹` real-valued functions on `E` with compact support, as a submodule of `E → ℝ`. -/ -def C1c : Submodule ℝ (E → ℝ) where +@[expose] def C1c : Submodule ℝ (E → ℝ) where carrier := {f | ContDiff ℝ 1 f ∧ HasCompactSupport f} zero_mem' := by refine ⟨contDiff_const, ?_⟩ @@ -88,7 +88,7 @@ def C1c : Submodule ℝ (E → ℝ) where exact (HasCompactSupport.smul_left (f := fun _ : E => c) hf.2) /-- The pointwise gradient (as an `E`-valued function), via Riesz representation. -/ -noncomputable def grad (f : E → ℝ) : E → E := +@[expose] noncomputable def grad (f : E → ℝ) : E → E := fun x => (InnerProductSpace.toDual ℝ E).symm (fderiv ℝ f x) lemma continuous_grad {f : E → ℝ} (hf : ContDiff ℝ 1 f) : Continuous (grad (E := E) f) := by @@ -126,11 +126,11 @@ lemma memLp_grad_of_mem_C1c {f : E → ℝ} (hf : f ∈ C1c (E := E)) : exact hcont.memLp_of_hasCompactSupport (μ := μ) (p := (2 : ℝ≥0∞)) hcs /-- The `L²` class of a `C¹` compactly supported function. -/ -noncomputable def toL2 (f : ↥(C1c (E := E))) : L2ℝ (μ := μ) := +@[expose] noncomputable def toL2 (f : ↥(C1c (E := E))) : L2ℝ (μ := μ) := (memLp_of_mem_C1c (μ := μ) (E := E) f.2).toLp f.1 /-- The `L²` class of the gradient of a `C¹` compactly supported function. -/ -noncomputable def toL2Grad (f : ↥(C1c (E := E))) : L2E (μ := μ) := +@[expose] noncomputable def toL2Grad (f : ↥(C1c (E := E))) : L2E (μ := μ) := (memLp_grad_of_mem_C1c (μ := μ) (E := E) f.2).toLp (grad (E := E) f.1) omit [CompleteSpace E] in @@ -170,7 +170,7 @@ private lemma toL2_smul (c : ℝ) (f : ↥(C1c (E := E))) : simp [Pi.smul_apply, hxsmul, hxf] /-- Linear map sending `C¹_c` functions to their `L²` classes. -/ -noncomputable def toL2Linear : ↥(C1c (E := E)) →ₗ[ℝ] L2ℝ (μ := μ) where +@[expose] noncomputable def toL2Linear : ↥(C1c (E := E)) →ₗ[ℝ] L2ℝ (μ := μ) where toFun := toL2 (μ := μ) (E := E) map_add' := by exact toL2_add (μ := μ) (E := E) map_smul' := by exact toL2_smul (μ := μ) (E := E) @@ -231,17 +231,17 @@ private lemma toL2Grad_smul (c : ℝ) (f : ↥(C1c (E := E))) : simpa [Pi.smul_apply] using hxsmul.symm /-- Linear map sending `C¹_c` functions to the `L²` class of their gradient. -/ -noncomputable def toL2GradLinear : ↥(C1c (E := E)) →ₗ[ℝ] L2E (μ := μ) where +@[expose] noncomputable def toL2GradLinear : ↥(C1c (E := E)) →ₗ[ℝ] L2E (μ := μ) where toFun := toL2Grad (μ := μ) (E := E) map_add' := by exact toL2Grad_add (μ := μ) (E := E) map_smul' := by exact toL2Grad_smul (μ := μ) (E := E) /-- The graph map `f ↦ (f, ∇f)` into `L² × L²(E)`. -/ -noncomputable def graph : ↥(C1c (E := E)) →ₗ[ℝ] H1Target (μ := μ) := +@[expose] noncomputable def graph : ↥(C1c (E := E)) →ₗ[ℝ] H1Target (μ := μ) := (toL2Linear (μ := μ) (E := E)).prod (toL2GradLinear (μ := μ) (E := E)) /-- The Euclidean `H¹` space (as a closed submodule of `L² × L²(E)`). -/ -noncomputable def h1 : Submodule ℝ (H1Target (μ := μ)) := +@[expose] noncomputable def h1 : Submodule ℝ (H1Target (μ := μ)) := (LinearMap.range (graph (μ := μ) (E := E))).topologicalClosure /-- The Euclidean `H¹` submodule is closed by construction. -/ @@ -255,12 +255,12 @@ instance instCompleteSpaceh1 : CompleteSpace (↥(h1 (μ := μ) (E := E))) := by exact (isClosed_h1 (μ := μ) (E := E)).isComplete.completeSpace_coe /-- The continuous embedding `H¹ → L²`. -/ -noncomputable def h1ToL2 : (↥(h1 (μ := μ) (E := E))) →L[ℝ] L2ℝ (μ := μ) := +@[expose] noncomputable def h1ToL2 : (↥(h1 (μ := μ) (E := E))) →L[ℝ] L2ℝ (μ := μ) := (ContinuousLinearMap.fst ℝ (L2ℝ (μ := μ)) (L2E (μ := μ))).comp (Submodule.subtypeL (h1 (μ := μ) (E := E))) /-- The continuous gradient map `H¹ → L²(E)`. -/ -noncomputable def h1ToL2Grad : (↥(h1 (μ := μ) (E := E))) →L[ℝ] L2E (μ := μ) := +@[expose] noncomputable def h1ToL2Grad : (↥(h1 (μ := μ) (E := E))) →L[ℝ] L2E (μ := μ) := (ContinuousLinearMap.snd ℝ (L2ℝ (μ := μ)) (L2E (μ := μ))).comp (Submodule.subtypeL (h1 (μ := μ) (E := E))) diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H2.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H2.lean index d85232a63a..f629da2274 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H2.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/H2.lean @@ -22,7 +22,7 @@ Hessian, and define `H²` as the topological closure of the range inside an ambi No Rellich/elliptic regularity theorems are proved here; this file is purely definitional/API. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -51,7 +51,7 @@ abbrev L2EE : Type _ := ↥(E →₂[μ] (E →L[ℝ] E)) abbrev H2Target : Type _ := L2ℝ (μ := μ) × (L2E (μ := μ) × L2EE (μ := μ)) /-- `C²` real-valued functions on `E` with compact support, as a submodule of `E → ℝ`. -/ -def C2c : Submodule ℝ (E → ℝ) where +@[expose] def C2c : Submodule ℝ (E → ℝ) where carrier := {f | ContDiff ℝ 2 f ∧ HasCompactSupport f} zero_mem' := by refine ⟨contDiff_const, ?_⟩ diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean index e050af59f4..b22607b97f 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean @@ -22,7 +22,7 @@ The principal statement will control `‖smoothL2 ψ u - extendByZeroL2 u‖₂` `‖translateL2 t (extendByZeroL2 u) - extendByZeroL2 u‖₂` over `t` in the support of `ψ`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -55,7 +55,7 @@ variable (ψ : E → ℝ) /-- The measure with density `ψ` with respect to Lebesgue measure. This will be a probability measure once `ψ ≥ 0` and `∫ ψ = 1`. -/ -noncomputable def kernelMeasure : Measure E := +@[expose] noncomputable def kernelMeasure : Measure E := (volume : Measure E).withDensity fun x => ENNReal.ofReal (ψ x) lemma kernelMeasure_univ (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/ArzelaAscoli.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/ArzelaAscoli.lean index 43c06bafac..deaecfcfd4 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/ArzelaAscoli.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/ArzelaAscoli.lean @@ -25,7 +25,7 @@ Fréchet–Kolmogorov / Riesz–Kolmogorov approach to Euclidean Rellich–Kondr Tracking: Beads `lean-103.5.2.26.5.3.2.2.1.1`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Compactness.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Compactness.lean index 8a309bde7c..850f28073e 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Compactness.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Compactness.lean @@ -25,7 +25,7 @@ The Arzelà–Ascoli compactness statement for `smoothBCF` lives in This is tracked under Beads `lean-103.5.2.26.5.3.2.2.1`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -57,7 +57,7 @@ variable {K : Set E} variable {ψ : E → ℝ} /-- The natural compact codomain for smoothing on `K` by a compactly supported kernel `ψ`. -/ -def Kψ : Set E := +@[expose] def Kψ : Set E := K + tsupport ψ omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/FrechetKolmogorov.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/FrechetKolmogorov.lean index e414679dcd..8ba4063ba7 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/FrechetKolmogorov.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/FrechetKolmogorov.lean @@ -36,7 +36,7 @@ compact support (modeled as `Lp ℝ 2 (volume.restrict K)` and embedded into `L Tracking: Beads `lean-103.5.2.26.5.3.2.2.3`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Kernels.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Kernels.lean index a60af7e8d5..907b5e7862 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Kernels.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Kernels.lean @@ -26,7 +26,7 @@ by its (positive) integral. Tracking: Beads `lean-103.5.2.26.5.3.2.2.5`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Smoothing.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Smoothing.lean index 8f451074f0..1480691e62 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Smoothing.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Smoothing.lean @@ -22,7 +22,7 @@ Fréchet–Kolmogorov / Riesz–Kolmogorov approach to Euclidean Rellich–Kondr a smoothing operator obtained by convolution with a compactly supported continuous kernel `ψ`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -82,7 +82,7 @@ local instance instMeasurableAddSmoothing1 : MeasurableAdd E := by variable {K : Set E} /-- Extend an `L²` function on `K` by zero to a pointwise function on the ambient space. -/ -def extendByZeroFun (u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : E → ℝ := +@[expose] def extendByZeroFun (u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : E → ℝ := K.indicator fun x : E => u x lemma hasCompactSupport_extendByZeroFun (hK : IsCompact K) @@ -151,7 +151,7 @@ lemma norm_extendByZeroL2 (hKm : MeasurableSet K) variable (ψ : E → ℝ) /-- Smoothing by convolution with a fixed kernel `ψ`, applied to the zero-extension from `K`. -/ -def smoothFun (u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : E → ℝ := +@[expose] def smoothFun (u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : E → ℝ := (extendByZeroFun (K := K) u) ⋆[ContinuousLinearMap.lsmul ℝ ℝ, (volume : Measure E)] ψ lemma continuous_smoothFun diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Transfer.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Transfer.lean index 382e46482e..514f12a488 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Transfer.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Transfer.lean @@ -23,7 +23,7 @@ This file transfers the Arzelà–Ascoli compactness of the `BoundedContinuousFu Tracking: Beads `lean-103.5.2.26.5.3.2.2.1.2`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/TranslationIntegral.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/TranslationIntegral.lean index ef088f5c61..8e21b5531e 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/TranslationIntegral.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/TranslationIntegral.lean @@ -21,7 +21,7 @@ The core observation is that if `ψ` is supported in a neighborhood where the tr Tracking: Beads `lean-103.5.2.26.5.3.2.2.4`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2CompactnessCriterion.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2CompactnessCriterion.lean index 21b46d02a2..ed48503839 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2CompactnessCriterion.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2CompactnessCriterion.lean @@ -26,4 +26,4 @@ machinery used in the Euclidean Rellich–Kondrachov proof stack. This is tracked under Beads `lean-103.5.2.26.5.3.2.2.*`. -/ -@[expose] public section +public section diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Rellich.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Rellich.lean index 15f5c16bf5..7ffa317d46 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Rellich.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Rellich.lean @@ -42,7 +42,7 @@ The proof uses: Tracking: Beads `lean-103.5.2.26.5.3.2.1`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -77,7 +77,7 @@ local instance instFactOneLeTwoSobolevEuclideanRellich : Fact (1 ≤ (2 : ℝ≥ We model “supported in `K`” as belonging to the closed range of the extension-by-zero map `Lp(volume.restrict K) →ₗᵢ Lp(volume)`. -/ -noncomputable def h1On (K : Set E) (hKm : MeasurableSet K) : +@[expose] noncomputable def h1On (K : Set E) (hKm : MeasurableSet K) : Submodule ℝ (↥(h1 (μ := (volume : Measure E)) (E := E))) := Submodule.comap (h1ToL2 (μ := (volume : Measure E)) (E := E)).toLinearMap @@ -86,7 +86,7 @@ noncomputable def h1On (K : Set E) (hKm : MeasurableSet K) : (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := K) hKm).toLinearMap)) /-- The inclusion `h1On K → L²(volume)` as a continuous linear map. -/ -noncomputable def h1OnToL2 (K : Set E) (hKm : MeasurableSet K) : +@[expose] noncomputable def h1OnToL2 (K : Set E) (hKm : MeasurableSet K) : ↥(h1On K hKm) →L[ℝ] (E →₂[(volume : Measure E)] ℝ) := (h1ToL2 (μ := (volume : Measure E)) (E := E)).comp (h1On K hKm).subtypeL diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/SupportedH1.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/SupportedH1.lean index b42bf703f8..775c1236c6 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/SupportedH1.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/SupportedH1.lean @@ -28,7 +28,7 @@ arbitrary measure `μ`. Compactness results are proven elsewhere. - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.h1OnToL2Measure` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis @@ -110,7 +110,7 @@ lemma mem_range_extendByZeroₗᵢ_toLp_of_tsupport_subset {F : Type*} [NormedAd We model “supported in `K`” as belonging to the closed range of the extension-by-zero map `Lp(μ.restrict K) →ₗᵢ Lp(μ)`. -/ -noncomputable def h1OnMeasure : +@[expose] noncomputable def h1OnMeasure : Submodule ℝ (↥(h1 (μ := μ) (E := E))) := Submodule.comap (h1ToL2 (μ := μ) (E := E)).toLinearMap diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Translation.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Translation.lean index 19c3db7432..8e40bce888 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Translation.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/Translation.lean @@ -25,7 +25,7 @@ operators and their interaction with the `C¹_c` graph embedding used to define - `grad_translate`: the Euclidean gradient commutes with translation. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimate.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimate.lean index a562f1a5af..1605f1725f 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimate.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimate.lean @@ -23,7 +23,7 @@ At this stage we only prove *pointwise* inequalities along the segment `t ↦ x The measure-theoretic lifting to `L²` is tracked separately under `lean-103.5.2.26.5.3.2.3`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateH1.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateH1.lean index 1f65dbb65d..1f790ea996 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateH1.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateH1.lean @@ -20,7 +20,7 @@ Extend Euclidean `L²` translation estimates from `C¹_c` to the closure-based E `L²(E)` component in our `H¹ ⊆ L² × L²(E)` model. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean index 582d9f67b5..9a46f8f63c 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean @@ -26,7 +26,7 @@ of translations. inequality on `L²` norms), under a right-invariant measure. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Analysis diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitz.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitz.lean index 2a0b1508af..c5200a8c09 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitz.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitz.lean @@ -22,7 +22,7 @@ Riemannian `edist` on `M`). `lipschitzOnWith_symm_extChartAt_ofRiemannianMetric` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitzForward.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitzForward.lean index 2742b9e463..b79d63de3b 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitzForward.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/ChartLocalLipschitzForward.lean @@ -18,7 +18,7 @@ Local Lipschitz control for the (forward) extended chart on a Riemannian manifol - `RellichKondrachov.Geometry.Manifold.Riemannian.lipschitzOnWith_extChartAt_ofRiemannianMetric` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure.lean index 98f6a5bf62..afbeb70202 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure.lean @@ -24,7 +24,7 @@ Riemannian isometries and suitable for building `L²(M)` once finiteness propert Hausdorff measure `μH[dim]` on `M`, using the emetric structure induced by the Riemannian metric. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -55,7 +55,7 @@ local instance instBorelSpaceVolumeMeasure : BorelSpace M := ⟨rfl⟩ This uses `EMetricSpace.ofRiemannianMetric` to construct the emetric structure in a way that is defeq to the existing topology on `M`, as recommended by the Mathlib Riemannian manifold API. -/ -noncomputable def riemannianVolumeMeasure : Measure M := by +@[expose] noncomputable def riemannianVolumeMeasure : Measure M := by classical letI : EMetricSpace M := EMetricSpace.ofRiemannianMetric I M letI : BorelSpace M := ⟨rfl⟩ diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure/Finiteness.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure/Finiteness.lean index 976946dcc3..c72215663f 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure/Finiteness.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Riemannian/VolumeMeasure/Finiteness.lean @@ -22,7 +22,7 @@ Finiteness properties of `riemannianVolumeMeasure`. on a compact manifold, the total volume is finite. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartData.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartData.lean index 8f80f5b22b..37102e00cf 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartData.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartData.lean @@ -28,7 +28,7 @@ This file provides: manifold, there exists such data subordinate to `chartAt` sources. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartDataRiemannian.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartDataRiemannian.lean index 8ce2a2655c..9bfb79d3e4 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartDataRiemannian.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartDataRiemannian.lean @@ -29,7 +29,7 @@ measure on the fixed compact supports used by the manifold Rellich glue. - `RellichKondrachov.Geometry.Manifold.Sobolev.exists_riemannianFiniteChartData` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -126,7 +126,7 @@ compactness arguments. -/ /-- The chart ball in model-space coordinates associated to chart index `i`. -/ -def chartBall (dR : RiemannianFiniteChartData (H := H) (M := M) I) (i : dR.d.ι) : Set E := +@[expose] def chartBall (dR : RiemannianFiniteChartData (H := H) (M := M) I) (i : dR.d.ι) : Set E := Metric.ball (extChartAt I (dR.d.center i) (dR.d.center i)) (dR.r i) ∩ (extChartAt I (dR.d.center i)).target diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasure.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasure.lean index 2f54dca208..129347dfb2 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasure.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasure.lean @@ -17,7 +17,7 @@ on `M` to a measure on the model space `E` using `extChartAt`. This file defines measures and records basic finiteness instances needed by the Euclidean Sobolev baseline. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -66,7 +66,7 @@ so that the value of `extChartAt` outside its source is irrelevant. -/ /-- The pushforward of a measure `μ` on `M` along the extended chart `extChartAt`. -/ -noncomputable def chartMeasure (μ : Measure M) (i : d.ι) : Measure E := +@[expose] noncomputable def chartMeasure (μ : Measure M) (i : d.ι) : Measure E := (μ.restrict (extChartAt I (d.center i)).source).map (extChartAt I (d.center i)) section diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureLp.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureLp.lean index 46d98dd4ce..8d5b7ae095 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureLp.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureLp.lean @@ -30,7 +30,7 @@ This file provides: - `RellichKondrachov.Geometry.Manifold.Sobolev.FiniteChartData.chartPullbackL2` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannian.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannian.lean index 32aa9033ea..8ca042c79f 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannian.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannian.lean @@ -27,7 +27,7 @@ measure on the chart target, restricted to suitable neighborhoods. with an explicit constant. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannianVolume.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannianVolume.lean index 6f7c5756e9..69034f50eb 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannianVolume.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/ChartMeasureRiemannianVolume.lean @@ -31,7 +31,7 @@ resulting domination by `volume` on chart balls. `volume_restrict_le_chartMeasure` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/EmbeddingL2.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/EmbeddingL2.lean index ba805c4c30..af57570eb9 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/EmbeddingL2.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/EmbeddingL2.lean @@ -27,7 +27,7 @@ measure-preserving chart map and then extended by zero from the chart source. - `RellichKondrachov.Geometry.Manifold.Sobolev.FiniteChartData.h2ToL2` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -84,7 +84,7 @@ noncomputable def chartToGlobalL2 {F : Type*} [NormedAddCommGroup F] [NormedSpac /-- The continuous linear inclusion `H¹(d,μ) → L²(M,μ)` defined by summing the chartwise `L²` components after pulling them back to `M` and extending by zero. -/ -noncomputable def h1ToL2 (μ : Measure M) [IsFiniteMeasure μ] : +@[expose] noncomputable def h1ToL2 (μ : Measure M) [IsFiniteMeasure μ] : (↥(h1 (d := d) (I := I) (μ := μ))) →L[ℝ] (M →₂[μ] ℝ) := by classical exact ∑ i : d.ι, (chartToGlobalL2 (d := d) (I := I) (μ := μ) (F := ℝ) i).comp @@ -92,7 +92,7 @@ noncomputable def h1ToL2 (μ : Measure M) [IsFiniteMeasure μ] : /-- The continuous linear inclusion `H²(d,μ) → L²(M,μ)` defined by summing the chartwise `L²` components after pulling them back to `M` and extending by zero. -/ -noncomputable def h2ToL2 (μ : Measure M) [IsFiniteMeasure μ] : +@[expose] noncomputable def h2ToL2 (μ : Measure M) [IsFiniteMeasure μ] : (↥(h2 (d := d) (I := I) (μ := μ))) →L[ℝ] (M →₂[μ] ℝ) := by classical exact ∑ i : d.ι, (chartToGlobalL2 (d := d) (I := I) (μ := μ) (F := ℝ) i).comp diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H1.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H1.lean index 044eb58c1b..304744dfab 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H1.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H1.lean @@ -26,7 +26,7 @@ Given `d : FiniteChartData` and a finite measure `μ` on `M`, we: - `RellichKondrachov.Geometry.Manifold.Sobolev.FiniteChartData.h1` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -64,7 +64,7 @@ local instance instBorelSpaceMH1 : BorelSpace M := ⟨rfl⟩ namespace FiniteChartData /-- `C¹` scalar functions `M → ℝ` (in the manifold sense), as a submodule of `M → ℝ`. -/ -def C1 : Submodule ℝ (M → ℝ) where +@[expose] def C1 : Submodule ℝ (M → ℝ) where carrier := {f | ContMDiff I (𝓘(ℝ, ℝ)) 1 f} zero_mem' := by -- `0` is (locally) constant, hence `C¹`. @@ -224,7 +224,7 @@ abbrev h1Target (μ : Measure M) : Type _ := ∀ i : d.ι, h1TargetE (d := d) (I /-- The per-chart graph map `C¹(M) →ₗ (L² × L²(E))` obtained by localization to chart `i` and the Euclidean `H¹` graph construction. -/ -noncomputable def h1GraphChart (i : d.ι) : +@[expose] noncomputable def h1GraphChart (i : d.ι) : ↥(C1 (E := E) (H := H) (M := M) (I := I)) →ₗ[ℝ] h1TargetE (d := d) (I := I) μ i := (RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.graph (μ := chartMeasure (d := d) (I := I) μ i) (E := E)).comp @@ -273,14 +273,14 @@ lemma h1GraphChart_snd (i : d.ι) (f : ↥(C1 (E := E) (H := H) (M := M) (I := I RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.toL2GradLinear, localizeToC1c] /-- The product-of-charts graph map `C¹(M) →ₗ ∀ i, (L² × L²(E))` used to define manifold `H¹`. -/ -noncomputable def h1Graph : +@[expose] noncomputable def h1Graph : ↥(C1 (E := E) (H := H) (M := M) (I := I)) →ₗ[ℝ] h1Target (d := d) (I := I) μ := by classical -- Assemble the per-chart graph maps into a product map. refine LinearMap.pi fun i => h1GraphChart (d := d) (I := I) (μ := μ) i /-- The `H¹` submodule defined by chart localizations and the Euclidean `H¹` graph construction. -/ -noncomputable def h1 : Submodule ℝ (h1Target (d := d) (I := I) μ) := +@[expose] noncomputable def h1 : Submodule ℝ (h1Target (d := d) (I := I) μ) := (LinearMap.range (h1Graph (d := d) (I := I) (μ := μ))).topologicalClosure omit [T2Space M] in @@ -294,17 +294,17 @@ instance instCompleteSpaceh1 : CompleteSpace (↥(h1 (d := d) (I := I) (μ := μ exact (isClosed_h1 (d := d) (I := I) (μ := μ)).isComplete.completeSpace_coe /-- The continuous projection `H¹ →` chartwise `L² × L²(E)` for a fixed chart index. -/ -noncomputable def h1ToChart (i : d.ι) : +@[expose] noncomputable def h1ToChart (i : d.ι) : (↥(h1 (d := d) (I := I) (μ := μ))) →L[ℝ] h1TargetE (d := d) (I := I) μ i := (ContinuousLinearMap.proj (R := ℝ) i).comp (Submodule.subtypeL (h1 (d := d) (I := I) (μ := μ))) /-- The continuous chartwise `L²` map extracted from `H¹`. -/ -noncomputable def h1ToChartL2 (i : d.ι) : +@[expose] noncomputable def h1ToChartL2 (i : d.ι) : (↥(h1 (d := d) (I := I) (μ := μ))) →L[ℝ] ↥(E →₂[chartMeasure (d := d) (I := I) μ i] ℝ) := (ContinuousLinearMap.fst ℝ _ _).comp (h1ToChart (d := d) (I := I) (μ := μ) i) /-- The continuous chartwise gradient map `H¹ → L²(E)` extracted from `H¹`. -/ -noncomputable def h1ToChartL2Grad (i : d.ι) : +@[expose] noncomputable def h1ToChartL2Grad (i : d.ι) : (↥(h1 (d := d) (I := I) (μ := μ))) →L[ℝ] ↥(E →₂[chartMeasure (d := d) (I := I) μ i] E) := (ContinuousLinearMap.snd ℝ _ _).comp (h1ToChart (d := d) (I := I) (μ := μ) i) diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H2.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H2.lean index abd99d108d..f58c32a82a 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H2.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/H2.lean @@ -30,7 +30,7 @@ where `μᵢ` is the pushforward chart measure (`chartMeasure`) and the graph ma - `RellichKondrachov.Geometry.Manifold.Sobolev.FiniteChartData.h2` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -247,7 +247,7 @@ noncomputable def h2GraphChart (i : d.ι) : (localizeToC2c (d := d) (I := I) i) /-- The product-of-charts graph map `C²(M) →ₗ ∀ i, h2TargetE i` used to define manifold `H²`. -/ -noncomputable def h2Graph : +@[expose] noncomputable def h2Graph : ↥(C2 (E := E) (H := H) (M := M) (I := I)) →ₗ[ℝ] h2Target (d := d) (I := I) μ := by classical refine LinearMap.pi fun i => h2GraphChart (d := d) (I := I) (μ := μ) i @@ -266,7 +266,7 @@ private instance instContinuousConstSMulH2Target : (ContinuousConstSMul ℝ (∀ i : d.ι, h2TargetE (d := d) (I := I) μ i)) /-- The `H²` submodule defined by chart localizations and the Euclidean `H²` graph construction. -/ -noncomputable def h2 : Submodule ℝ (h2Target (d := d) (I := I) μ) := +@[expose] noncomputable def h2 : Submodule ℝ (h2Target (d := d) (I := I) μ) := (LinearMap.range (h2Graph (d := d) (I := I) (μ := μ))).topologicalClosure omit [IsManifold I (1 : WithTop ℕ∞) M] [T2Space M] in @@ -281,12 +281,12 @@ instance instCompleteSpaceh2 : CompleteSpace (↥(h2 (d := d) (I := I) (μ := μ /-- The continuous projection `H² →` chartwise `L² × (L²(E) × L²(E →L E))` for a fixed chart index. -/ -noncomputable def h2ToChart (i : d.ι) : +@[expose] noncomputable def h2ToChart (i : d.ι) : (↥(h2 (d := d) (I := I) (μ := μ))) →L[ℝ] h2TargetE (d := d) (I := I) μ i := (ContinuousLinearMap.proj (R := ℝ) i).comp (Submodule.subtypeL (h2 (d := d) (I := I) (μ := μ))) /-- The continuous chartwise `L²` map extracted from `H²`. -/ -noncomputable def h2ToChartL2 (i : d.ι) : +@[expose] noncomputable def h2ToChartL2 (i : d.ι) : (↥(h2 (d := d) (I := I) (μ := μ))) →L[ℝ] ↥(E →₂[chartMeasure (d := d) (I := I) μ i] ℝ) := (ContinuousLinearMap.fst ℝ _ _).comp (h2ToChart (d := d) (I := I) (μ := μ) i) diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/Localization.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/Localization.lean index 4f79d3e7da..96c793b816 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/Localization.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/Localization.lean @@ -26,7 +26,7 @@ For compact manifolds, the resulting function has compact support and is `C^1` ( the Euclidean `C1c` submodule used in the Euclidean Sobolev baseline). -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -65,12 +65,12 @@ abbrev chart (i : d.ι) : PartialEquiv M E := extChartAt I (d.center i) /-- The localization of a scalar function `f : M → ℝ` to a chart `i`, as a function on `E`. -/ -noncomputable def localize (f : M → ℝ) (i : d.ι) : E → ℝ := +@[expose] noncomputable def localize (f : M → ℝ) (i : d.ι) : E → ℝ := Set.indicator (chart (d := d) i).target fun y => d.ρ i ((chart (d := d) i).symm y) * f ((chart (d := d) i).symm y) /-- The closed set `closure (support (ρ i))` used to control the support of localizations. -/ -def rhoSupportClosure (i : d.ι) : Set M := +@[expose] def rhoSupportClosure (i : d.ι) : Set M := closure (Function.support (d.ρ i : M → ℝ)) omit [CompleteSpace E] [FiniteDimensional ℝ E] [IsManifold I (1 : WithTop ℕ∞) M] @@ -85,7 +85,7 @@ lemma isCompact_rhoSupportClosure (i : d.ι) : IsCompact (rhoSupportClosure (d : (isClosed_closure.isCompact) /-- A compact subset of the chart model space containing the supports of all localizations. -/ -def rhoSupportImage (i : d.ι) : Set E := +@[expose] def rhoSupportImage (i : d.ι) : Set E := (chart (d := d) i) '' rhoSupportClosure (d := d) i omit [CompleteSpace E] [FiniteDimensional ℝ E] [IsManifold I (1 : WithTop ℕ∞) M] [I.Boundaryless] diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/LocalizationH2.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/LocalizationH2.lean index 18008deb7c..f1ffcea2b9 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/LocalizationH2.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/LocalizationH2.lean @@ -23,7 +23,7 @@ This extends `RellichKondrachov.Geometry.Manifold.Sobolev.Localization` by showi - `RellichKondrachov.Geometry.Manifold.Sobolev.FiniteChartData.localize_mem_C2c` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachov.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachov.lean index 9dfa5f1619..44d43c7e2d 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachov.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachov.lean @@ -25,7 +25,7 @@ The analytic heart of Rellich (compactness on Euclidean chart domains) is tracke - `RellichKondrachov.Geometry.Manifold.Sobolev.FiniteChartData.isCompactOperator_h2ToL2_of_summands` -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian.lean index 72a7fdb5ae..a5099bc4f6 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian.lean @@ -17,5 +17,5 @@ Thin re-export of the Riemannian Rellich–Kondrachov proof, split into focused * `RellichKondrachovRiemannian.Global`: finite-atlas assembly and the final compactness theorem. -/ -@[expose] public section +public section diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean index 25ac27cdfe..e643fbc8d3 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean @@ -20,7 +20,7 @@ This module sets up the `L²`-range codomain restrictions and applies Euclidean `RellichKondrachovRiemannian.Transport`. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -88,7 +88,7 @@ open RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean variable (i : dR.d.ι) /-- Embed the local square-integrable range using the chart volume measure. -/ -noncomputable def eL2RangeChartVol (i : dR.d.ι) +@[expose] noncomputable def eL2RangeChartVol (i : dR.d.ι) (F : Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] : let μM := RellichKondrachov.Geometry.Manifold.Riemannian.riemannianVolumeMeasure (I := I) (M := M) @@ -114,7 +114,7 @@ between `μchart` and `volume` explicit and purely `L²`-level. omit [T2Space M] in /-- The chartwise `H¹ → L²` projection with codomain restricted to the Euclidean `H¹` range, for the chart pushforward of the Riemannian volume measure. -/ -noncomputable def h1ToChartL2Range : +@[expose] noncomputable def h1ToChartL2Range : let μM := RellichKondrachov.Geometry.Manifold.Riemannian.riemannianVolumeMeasure (I := I) (M := M) let μchart := FiniteChartData.chartMeasure (d := dR.d) (I := I) μM i diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Global.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Global.lean index 15b160846c..85566bc5ac 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Global.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Global.lean @@ -20,7 +20,7 @@ Finite-atlas assembly: turn the per-chart compactness result into compactness of `H¹ → L²` map for the Riemannian volume measure. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Transport.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Transport.lean index 8dd6eac961..0b898cc9fd 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Transport.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Transport.lean @@ -25,7 +25,7 @@ compactness proof. - `rhoSupportImage_measurable`: measurability of the fixed support set. -/ -@[expose] public section +public section namespace RellichKondrachov namespace Geometry @@ -592,7 +592,7 @@ restricted `L²` spaces. /-- The `L²`-level equivalence between the chart pushforward measure and Lebesgue `volume`, localized to the fixed compact support, for a general value type `F`. -/ -noncomputable def l2EquivVolumeOnRhoSupportImage' (i : dR.d.ι) (F : Type*) +@[expose] noncomputable def l2EquivVolumeOnRhoSupportImage' (i : dR.d.ι) (F : Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] : (E →₂[ (FiniteChartData.chartMeasure (d := dR.d) (I := I) @@ -716,7 +716,8 @@ between the `extendByZero` ranges for `μchart` and Lebesgue `volume`. /-- The extension-by-zero range equivalence between the chart pushforward measure and Lebesgue `volume` on the fixed compact support, for a general value type `F`. -/ -noncomputable def l2ExtendByZeroRangeEquivVolumeOnRhoSupportImage' (i : dR.d.ι) (F : Type*) +@[expose] noncomputable def l2ExtendByZeroRangeEquivVolumeOnRhoSupportImage' + (i : dR.d.ι) (F : Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] : let μM := RellichKondrachov.Geometry.Manifold.Riemannian.riemannianVolumeMeasure (I := I) (M := M) diff --git a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean index 36267ef79b..7831189404 100644 --- a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean +++ b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean @@ -23,7 +23,7 @@ equivalence between `Lp` spaces, and compactness of operators can be transported Tracking: Beads `lean-103.5.2.26.5.3.3.1`. -/ -@[expose] public section +public section namespace MeasureTheory @@ -172,7 +172,7 @@ private lemma norm_changeMeasureFun_le {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : /-- The identity map as a continuous linear map `Lp E p μ →L[ℝ] Lp E p ν` under `ν ≤ c • μ`. This is stated for `p ≠ ∞` (the only case needed in this repo; in particular we use `p = 2`). -/ -noncomputable def changeMeasureL {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : ν ≤ c • μ) (hp : p ≠ ∞) : +@[expose] noncomputable def changeMeasureL {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : ν ≤ c • μ) (hp : p ≠ ∞) : Lp E p μ →L[ℝ] Lp E p ν := (changeMeasureₗ (μ := μ) (ν := ν) (E := E) (p := p) hc hν).mkContinuous (ENNReal.toReal (c ^ (1 / p).toReal)) @@ -211,7 +211,7 @@ map gives a continuous linear equivalence between the two `Lp` spaces. /-- If `ν ≤ c₁ • μ` and `μ ≤ c₂ • ν` (with `c₁, c₂ ≠ ∞`) and `p ≠ ∞`, then the identity map induces a continuous linear equivalence `Lp E p μ ≃L[ℝ] Lp E p ν`. -/ -noncomputable def changeMeasureEquiv {c₁ c₂ : ℝ≥0∞} (hc₁ : c₁ ≠ ∞) (hc₂ : c₂ ≠ ∞) +@[expose] noncomputable def changeMeasureEquiv {c₁ c₂ : ℝ≥0∞} (hc₁ : c₁ ≠ ∞) (hc₂ : c₂ ≠ ∞) (hν : ν ≤ c₁ • μ) (hμ : μ ≤ c₂ • ν) (hp : p ≠ ∞) : Lp E p μ ≃L[ℝ] Lp E p ν := by classical diff --git a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ExtendByZeroRangeEquiv.lean b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ExtendByZeroRangeEquiv.lean index 411a5e5e41..855660b8e5 100644 --- a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ExtendByZeroRangeEquiv.lean +++ b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ExtendByZeroRangeEquiv.lean @@ -23,7 +23,7 @@ This is used in the manifold Rellich glue to transport compactness on `volume` t fixed compact supports. -/ -@[expose] public section +public section namespace MeasureTheory @@ -41,7 +41,7 @@ variable {s : Set α} (hs : MeasurableSet s) /-- If `μ.restrict s` and `ν.restrict s` are mutually comparable (with finite constants), then the extend-by-zero ranges in `Lp` are continuously linearly equivalent. -/ -noncomputable def extendByZeroRangeEquivOfRestrictChangeMeasureEquiv {c₁ c₂ : ℝ≥0∞} +@[expose] noncomputable def extendByZeroRangeEquivOfRestrictChangeMeasureEquiv {c₁ c₂ : ℝ≥0∞} (hc₁ : c₁ ≠ ∞) (hc₂ : c₂ ≠ ∞) (hν : ν.restrict s ≤ c₁ • μ.restrict s) (hμ : μ.restrict s ≤ c₂ • ν.restrict s) (hp : p ≠ ∞) : diff --git a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/Restrict.lean b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/Restrict.lean index 8fa296d509..02f76eb753 100644 --- a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/Restrict.lean +++ b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/Restrict.lean @@ -29,7 +29,7 @@ given by extension-by-zero (via `Set.indicator`). - `MeasureTheory.Lp.extendByZeroₗᵢ` -/ -@[expose] public section +public section namespace MeasureTheory @@ -165,7 +165,7 @@ noncomputable def extendByZeroₗ : Lp E p (μ.restrict s) →ₗ[ℝ] Lp E p μ simpa using hcx.symm /-- Extension-by-zero as a linear isometry. -/ -noncomputable def extendByZeroₗᵢ : Lp E p (μ.restrict s) →ₗᵢ[ℝ] Lp E p μ where +@[expose] noncomputable def extendByZeroₗᵢ : Lp E p (μ.restrict s) →ₗᵢ[ℝ] Lp E p μ where toLinearMap := extendByZeroₗ (μ := μ) (p := p) (s := s) hs norm_map' f := by classical diff --git a/LeanPool/RellichKondrachov/MeasureTheory/Measure/HausdorffVolume.lean b/LeanPool/RellichKondrachov/MeasureTheory/Measure/HausdorffVolume.lean index aec222d62a..9c76c2a961 100644 --- a/LeanPool/RellichKondrachov/MeasureTheory/Measure/HausdorffVolume.lean +++ b/LeanPool/RellichKondrachov/MeasureTheory/Measure/HausdorffVolume.lean @@ -20,7 +20,7 @@ Using uniqueness of Haar measures, we record the resulting proportionality compactness statements across equivalent measures. -/ -@[expose] public section +public section namespace RellichKondrachov diff --git a/LeanPool/RiemannMappingTheorem.lean b/LeanPool/RiemannMappingTheorem.lean index 5d830aa60e..c608c0df14 100644 --- a/LeanPool/RiemannMappingTheorem.lean +++ b/LeanPool/RiemannMappingTheorem.lean @@ -21,7 +21,7 @@ Tags: complex-analysis, conformal-maps, schwarz-lemma MSC: 30C35, 30C20 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/RiemannMappingTheorem/Cindex.lean b/LeanPool/RiemannMappingTheorem/Cindex.lean index 63c0b4c69e..ba998ad28a 100644 --- a/LeanPool/RiemannMappingTheorem/Cindex.lean +++ b/LeanPool/RiemannMappingTheorem/Cindex.lean @@ -12,14 +12,14 @@ import Mathlib.Analysis.Complex.RemovableSingularity # LeanPool.RiemannMappingTheorem.Cindex -/ -@[expose] public section +public section open Real Complex Function TopologicalSpace Filter Topology Metric MeasureTheory Nat /-- The argument-principle integral `(2πi)⁻¹ ∮_{C(z₀, r)} f'(z)/f(z) dz`, which counts zeroes of `f` inside the circle of radius `r` around `z₀` (with multiplicity). -/ -noncomputable def cindex (z₀ : ℂ) (r : ℝ) (f : ℂ → ℂ) : ℂ := +@[expose] noncomputable def cindex (z₀ : ℂ) (r : ℝ) (f : ℂ → ℂ) : ℂ := (2 * π * I)⁻¹ * ∮ z in C(z₀, r), deriv f z / f z section circle_integral diff --git a/LeanPool/RiemannMappingTheorem/Defs.lean b/LeanPool/RiemannMappingTheorem/Defs.lean index 065bcd72e8..ae3cbca227 100644 --- a/LeanPool/RiemannMappingTheorem/Defs.lean +++ b/LeanPool/RiemannMappingTheorem/Defs.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # LeanPool.RiemannMappingTheorem.Defs -/ -@[expose] public section +public section open Complex Metric Set @@ -24,14 +24,14 @@ variable {u : ℂ} {U V W : Set ℂ} /-- The collection of compact subsets of `U`. Used as the index for the compact-open topology `𝓒 U`. -/ -def compacts (U : Set ℂ) : Set (Set ℂ) := {K ⊆ U | IsCompact K} +@[expose] def compacts (U : Set ℂ) : Set (Set ℂ) := {K ⊆ U | IsCompact K} @[simp] lemma union_compacts : ⋃₀ compacts U = U := subset_antisymm (fun _ ⟨_, hK, hz⟩ => hK.1 hz) (fun z hz => ⟨{z}, ⟨singleton_subset_iff.2 hz, isCompact_singleton⟩, mem_singleton z⟩) /-- The open unit disk `{z : ℂ | ‖z‖ < 1}`. -/ -def 𝔻 : Set ℂ := ball 0 1 +@[expose] def 𝔻 : Set ℂ := ball 0 1 lemma mem_𝔻_iff : u ∈ 𝔻 ↔ ‖u‖ < 1 := mem_ball_zero_iff @@ -84,7 +84,7 @@ instance {U V : Set ℂ} : CoeFun (embedding U V) (fun _ => ℂ → ℂ) := ⟨e maps_to := fun _ hx => hUV ▸ hx /-- Composition of embeddings: `(f ∘ g) : embedding U W`. -/ -@[simp] def embedding.comp (f : embedding V W) (g : embedding U V) : embedding U W where +@[expose, simp] def embedding.comp (f : embedding V W) (g : embedding U V) : embedding U W where toFun := f ∘ g is_diff := f.is_diff.comp g.is_diff g.maps_to is_inj := f.is_inj.comp g.is_inj g.maps_to diff --git a/LeanPool/RiemannMappingTheorem/DerivInj.lean b/LeanPool/RiemannMappingTheorem/DerivInj.lean index 7827ead7a6..a8464e3893 100644 --- a/LeanPool/RiemannMappingTheorem/DerivInj.lean +++ b/LeanPool/RiemannMappingTheorem/DerivInj.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Complex.RemovableSingularity # LeanPool.RiemannMappingTheorem.DerivInj -/ -@[expose] public section +public section open Complex Metric circleIntegral Topology Filter Set diff --git a/LeanPool/RiemannMappingTheorem/Etape2.lean b/LeanPool/RiemannMappingTheorem/Etape2.lean index 939fa415e8..a8928c3115 100644 --- a/LeanPool/RiemannMappingTheorem/Etape2.lean +++ b/LeanPool/RiemannMappingTheorem/Etape2.lean @@ -17,7 +17,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # LeanPool.RiemannMappingTheorem.Etape2 -/ -@[expose] public section +public section open Complex ComplexConjugate Set Metric Topology Filter diff --git a/LeanPool/RiemannMappingTheorem/HasSqrt.lean b/LeanPool/RiemannMappingTheorem/HasSqrt.lean index 3febf25504..e90635cadf 100644 --- a/LeanPool/RiemannMappingTheorem/HasSqrt.lean +++ b/LeanPool/RiemannMappingTheorem/HasSqrt.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.Complex.CauchyIntegral # LeanPool.RiemannMappingTheorem.HasSqrt -/ -@[expose] public section +public section open Set Complex Metric Topology @@ -22,7 +22,7 @@ variable {z z₀ : ℂ} {U : Set ℂ} /-- `hasSqrt U` : every nowhere-zero holomorphic function on `U` has a holomorphic square root there. -/ -def hasSqrt (U : Set ℂ) : Prop := +@[expose] def hasSqrt (U : Set ℂ) : Prop := ∀ (f : ℂ → ℂ), (∀ z ∈ U, f z ≠ 0) → DifferentiableOn ℂ f U → ∃ g, DifferentiableOn ℂ g U ∧ EqOn f (g ^ 2) U diff --git a/LeanPool/RiemannMappingTheorem/Hurwitz.lean b/LeanPool/RiemannMappingTheorem/Hurwitz.lean index a2f1d017f1..d78dfa72e4 100644 --- a/LeanPool/RiemannMappingTheorem/Hurwitz.lean +++ b/LeanPool/RiemannMappingTheorem/Hurwitz.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.Complex.LocallyUniformLimit # LeanPool.RiemannMappingTheorem.Hurwitz -/ -@[expose] public section +public section open Filter Topology Set Metric Uniformity diff --git a/LeanPool/RiemannMappingTheorem/Main.lean b/LeanPool/RiemannMappingTheorem/Main.lean index a0450fb848..fea3cb869f 100644 --- a/LeanPool/RiemannMappingTheorem/Main.lean +++ b/LeanPool/RiemannMappingTheorem/Main.lean @@ -18,7 +18,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # LeanPool.RiemannMappingTheorem.Main -/ -@[expose] public section +public section open UniformConvergence Topology Filter Set Metric Function diff --git a/LeanPool/RiemannMappingTheorem/Montel.lean b/LeanPool/RiemannMappingTheorem/Montel.lean index 203ab4d573..feba44858a 100644 --- a/LeanPool/RiemannMappingTheorem/Montel.lean +++ b/LeanPool/RiemannMappingTheorem/Montel.lean @@ -15,7 +15,7 @@ import Mathlib.Topology.UniformSpace.Ascoli # LeanPool.RiemannMappingTheorem.Montel -/ -@[expose] public section +public section open Set Function Metric UniformConvergence Complex diff --git a/LeanPool/RiemannMappingTheorem/Spaces.lean b/LeanPool/RiemannMappingTheorem/Spaces.lean index 5617ba2629..832a71c2a3 100644 --- a/LeanPool/RiemannMappingTheorem/Spaces.lean +++ b/LeanPool/RiemannMappingTheorem/Spaces.lean @@ -15,7 +15,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # LeanPool.RiemannMappingTheorem.Spaces -/ -@[expose] public section +public section open Topology Filter Set Function UniformConvergence Metric @@ -26,7 +26,7 @@ uniform (compact-open) convergence on `U`. -/ abbrev 𝓒 (U : Set ℂ) := ℂ →ᵤ[compacts U] ℂ /-- The complex derivative as a self-map on `𝓒 U`. -/ -noncomputable def uderiv (f : 𝓒 U) : 𝓒 U := deriv f +@[expose] noncomputable def uderiv (f : 𝓒 U) : 𝓒 U := deriv f lemma tendsto_𝓒_iff (hU : IsOpen U) {F : ι → 𝓒 U} {f : 𝓒 U} : Tendsto F l (𝓝 f) ↔ TendstoLocallyUniformlyOn F f l U := by @@ -35,7 +35,7 @@ lemma tendsto_𝓒_iff (hU : IsOpen U) {F : ι → 𝓒 U} {f : 𝓒 U} : /-- `𝓗 U` : the subspace of `𝓒 U` consisting of holomorphic (complex-differentiable) functions on `U`. -/ -def 𝓗 (U : Set ℂ) := {f : 𝓒 U | DifferentiableOn ℂ f U} +@[expose] def 𝓗 (U : Set ℂ) := {f : 𝓒 U | DifferentiableOn ℂ f U} lemma isClosed_𝓗 (hU : IsOpen U) : IsClosed (𝓗 U) := by refine isClosed_iff_clusterPt.2 (fun f hf => ?_) @@ -55,7 +55,7 @@ lemma ContinuousOn_uderiv (hU : IsOpen U) : ContinuousOn uderiv (𝓗 U) := by /-- `𝓑 U Q` : the collection of holomorphic maps on `U` whose image on each compact `K ⊆ U` is contained in `Q K`. Used to formalise local boundedness conditions for normal-family arguments. -/ -def 𝓑 (U : Set ℂ) (Q : Set ℂ → Set ℂ) : Set (𝓒 U) := +@[expose] def 𝓑 (U : Set ℂ) (Q : Set ℂ → Set ℂ) : Set (𝓒 U) := {f ∈ 𝓗 U | ∀ K ∈ compacts U, MapsTo f K (Q K)} lemma 𝓑_const {Q : Set ℂ} : 𝓑 U (fun _ => Q) = {f ∈ 𝓗 U | MapsTo f U Q} := by @@ -79,7 +79,7 @@ theorem isClosed_𝓑 (hU : IsOpen U) (hQ : ∀ K ∈ compacts U, IsCompact (Q K /-- `𝓜 U` : holomorphic functions on `U` whose image lies in the closed unit disk `closedBall 0 1 ⊆ ℂ`. -/ -def 𝓜 (U : Set ℂ) := {f ∈ 𝓗 U | MapsTo f U (closedBall (0 : ℂ) 1)} +@[expose] def 𝓜 (U : Set ℂ) := {f ∈ 𝓗 U | MapsTo f U (closedBall (0 : ℂ) 1)} lemma 𝓜_eq_𝓑 : 𝓜 U = 𝓑 U (fun _ => closedBall 0 1) := 𝓑_const.symm @@ -91,7 +91,7 @@ lemma IsClosed_𝓜 (hU : IsOpen U) : IsClosed (𝓜 U) := by (mem_singleton z) ⟨singleton_subset_iff.2 hz, isCompact_singleton⟩).continuous) /-- `𝓘 U` : holomorphic injections from `U` into the closed unit disk. -/ -def 𝓘 (U : Set ℂ) := {f ∈ 𝓜 U | InjOn f U} +@[expose] def 𝓘 (U : Set ℂ) := {f ∈ 𝓜 U | InjOn f U} lemma 𝓘_nonempty [good_domain U] : (𝓘 U).Nonempty := by obtain ⟨u, hu⟩ := nonempty_compl.mpr (good_domain.ne_univ : U ≠ univ) @@ -134,6 +134,6 @@ lemma 𝓘_nonempty [good_domain U] : (𝓘 U).Nonempty := by maps `U → closedBall 0 1` that are either injective or constant. Hurwitz's theorem says these are the only locally uniform limits of elements of `𝓘 U`. -/ -def 𝓙 (U : Set ℂ) := {f ∈ 𝓜 U | InjOn f U ∨ ∃ w : ℂ, EqOn f (fun _ => w) U} +@[expose] def 𝓙 (U : Set ℂ) := {f ∈ 𝓜 U | InjOn f U ∨ ∃ w : ℂ, EqOn f (fun _ => w) U} lemma 𝓘_subset_𝓙 : 𝓘 U ⊆ 𝓙 U := fun _ hf => ⟨hf.1, Or.inl hf.2⟩ diff --git a/LeanPool/RiemannMappingTheorem/ToMathlib.lean b/LeanPool/RiemannMappingTheorem/ToMathlib.lean index 546aa12c03..7733e3dbdb 100644 --- a/LeanPool/RiemannMappingTheorem/ToMathlib.lean +++ b/LeanPool/RiemannMappingTheorem/ToMathlib.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts # LeanPool.RiemannMappingTheorem.ToMathlib -/ -@[expose] public section +public section open intervalIntegral Real MeasureTheory Filter Topology Set Metric Interval diff --git a/LeanPool/RiemannMappingTheorem/Uniform.lean b/LeanPool/RiemannMappingTheorem/Uniform.lean index 01847cc7da..f2eba313db 100644 --- a/LeanPool/RiemannMappingTheorem/Uniform.lean +++ b/LeanPool/RiemannMappingTheorem/Uniform.lean @@ -12,7 +12,7 @@ import Mathlib.Topology.UniformSpace.Compact # LeanPool.RiemannMappingTheorem.Uniform -/ -@[expose] public section +public section open Set Filter UniformSpace Function Uniformity Topology SetRel diff --git a/LeanPool/RiemannRochFunctionFields.lean b/LeanPool/RiemannRochFunctionFields.lean index ae3311b7b8..29c1f1126c 100644 --- a/LeanPool/RiemannRochFunctionFields.lean +++ b/LeanPool/RiemannRochFunctionFields.lean @@ -22,4 +22,4 @@ Tags: riemann-roch, function-fields, algebraic-curves, weil-differentials, ellip MSC: 14H05, 11R58, 14H52 -/ -@[expose] public section +public section diff --git a/LeanPool/RiemannRochFunctionFields/AdeleSpace/Basic.lean b/LeanPool/RiemannRochFunctionFields/AdeleSpace/Basic.lean index 9ee81e8dac..ff6871aa55 100644 --- a/LeanPool/RiemannRochFunctionFields/AdeleSpace/Basic.lean +++ b/LeanPool/RiemannRochFunctionFields/AdeleSpace/Basic.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real Definitions and basic structure for Stichtenoth's adele space. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero open Filter @@ -37,6 +37,7 @@ local instance instDecidableEqPlaceAAdele : DecidableEq (PlaceA k K) := Classica /-- The `k`-submodule of the full product consisting of tuples integral at all but finitely many places. -/ +@[expose] def adeleSubmodule : Submodule k (PlaceA k K → K) where carrier := {α | ∀ᶠ v in cofinite, α v ∈ placeValuationSubring k K v} zero_mem' := by simp @@ -78,7 +79,7 @@ theorem eventually_mem_placeValuationSubring (f : K) : abbrev AdeleSpace := adeleSubmodule k K /-- Pointwise multiplication of an adele by an element of `K`. -/ -def smulAdele (x : K) (a : AdeleSpace k K) : AdeleSpace k K := ⟨fun v => x * a.val v, by +@[expose] def smulAdele (x : K) (a : AdeleSpace k K) : AdeleSpace k K := ⟨fun v => x * a.val v, by have hx := eventually_mem_placeValuationSubring k K x have ha := a.property change ∀ᶠ v : PlaceA k K in cofinite, a.val v ∈ placeValuationSubring k K v at ha @@ -95,7 +96,7 @@ instance : Module K (AdeleSpace k K) := (fun _ => Subtype.ext <| funext fun _ => one_mul _) /-- Multiplication by `x ∈ K` as a `k`-linear endomorphism of the adele space. -/ -def mulAdeleLinear (x : K) : AdeleSpace k K →ₗ[k] AdeleSpace k K where +@[expose] def mulAdeleLinear (x : K) : AdeleSpace k K →ₗ[k] AdeleSpace k K where toFun a := x • a map_add' _ _ := smul_add x _ _ map_smul' c a := by @@ -106,10 +107,11 @@ def mulAdeleLinear (x : K) : AdeleSpace k K →ₗ[k] AdeleSpace k K where /-- An adele lies in the filtration piece `A(D)` when its component at every place `v` has valuation at most `WithZero.exp (D v)`. -/ -def memAdeleFilt (D : DivisorA k K) (α : AdeleSpace k K) : Prop := +@[expose] def memAdeleFilt (D : DivisorA k K) (α : AdeleSpace k K) : Prop := ∀ v, placeValuation k K v (α.val v) ≤ WithZero.exp (D v) /-- The filtration piece `A(D)` of the adele space. -/ +@[expose] def adeleFilt (D : DivisorA k K) : Submodule k (AdeleSpace k K) where carrier := {a | memAdeleFilt k K D a} zero_mem' := fun v => by simp @@ -128,7 +130,7 @@ def adeleFilt (D : DivisorA k K) : Submodule k (AdeleSpace k K) where (one_mul _) /-- The diagonal embedding `K → A_K` of principal adeles. -/ -def diagonal : K →ₗ[k] AdeleSpace k K where +@[expose] def diagonal : K →ₗ[k] AdeleSpace k K where toFun f := ⟨fun _ => f, by simpa [adeleSubmodule] using eventually_mem_placeValuationSubring k K f⟩ @@ -136,6 +138,7 @@ def diagonal : K →ₗ[k] AdeleSpace k K where map_smul' _ _ := rfl /-- The image `diag(K)` of the diagonal embedding. -/ +@[expose] def diagonalSubmodule : Submodule k (AdeleSpace k K) := LinearMap.range (diagonal k K) theorem adeleFilt_inf_diagonal (D : DivisorA k K) : @@ -160,6 +163,7 @@ def adeleFiltWithin (D D' : DivisorA k K) : Submodule.comap (adeleFilt k K D').subtype (adeleFilt k K D) /-- Finite-rank increment `finrank k (A(D') ⧸ A(D))`. -/ +@[expose] noncomputable def finrankAdeleFiltDiff (D D' : DivisorA k K) : ℕ := by letI : AddCommGroup (adeleFilt k K D') := Submodule.addCommGroup _ letI : Module k (adeleFilt k K D') := Submodule.module _ @@ -168,6 +172,7 @@ noncomputable def finrankAdeleFiltDiff (D D' : DivisorA k K) : ℕ := by Submodule.comap (adeleFilt k K D').subtype (adeleFilt k K D) /-- Rank of `(A(D') + diag(K)) ⧸ (A(D) + diag(K))` from the sandwich bookkeeping. -/ +@[expose] noncomputable def sandwichRank (D D' : DivisorA k K) : ℤ := by letI : AddCommGroup (adeleFilt k K D' + diagonalSubmodule k K) := @@ -179,7 +184,7 @@ noncomputable def sandwichRank (D D' : DivisorA k K) : ℤ := (adeleFilt k K D + diagonalSubmodule k K)) /-- Component update for adele surgery (`A(D₁ ⊔ D₂) = A(D₁) + A(D₂)`). -/ -def adeleUpdate (α : AdeleSpace k K) (v : PlaceA k K) (a : K) : AdeleSpace k K := +@[expose] def adeleUpdate (α : AdeleSpace k K) (v : PlaceA k K) (a : K) : AdeleSpace k K := ⟨Function.update α.val v a, by change ∀ᶠ w : PlaceA k K in cofinite, Function.update α.val v a w ∈ placeValuationSubring k K w diff --git a/LeanPool/RiemannRochFunctionFields/AdeleSpace/FilterChain.lean b/LeanPool/RiemannRochFunctionFields/AdeleSpace/FilterChain.lean index e1a62bb6bd..c6cdc7bf11 100644 --- a/LeanPool/RiemannRochFunctionFields/AdeleSpace/FilterChain.lean +++ b/LeanPool/RiemannRochFunctionFields/AdeleSpace/FilterChain.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real This file proves the exact rank formula for the adele filtration and the sandwich identity. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero open IsDedekindDomain Cardinal diff --git a/LeanPool/RiemannRochFunctionFields/Basic.lean b/LeanPool/RiemannRochFunctionFields/Basic.lean index fc6607dc55..1a0928cfea 100644 --- a/LeanPool/RiemannRochFunctionFields/Basic.lean +++ b/LeanPool/RiemannRochFunctionFields/Basic.lean @@ -16,7 +16,7 @@ used in downstream modules (`degA`, `placeDegA`), and hosts the standing `IsFullConstantField` hypothesis. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc diff --git a/LeanPool/RiemannRochFunctionFields/CoordinateFree/AdeleSpace.lean b/LeanPool/RiemannRochFunctionFields/CoordinateFree/AdeleSpace.lean index e8550a2e17..dd9f8c809c 100644 --- a/LeanPool/RiemannRochFunctionFields/CoordinateFree/AdeleSpace.lean +++ b/LeanPool/RiemannRochFunctionFields/CoordinateFree/AdeleSpace.lean @@ -17,7 +17,7 @@ coordinate-free places. The equivalence `adeleEquivChart` identifies it with the construction and transports the filtration and diagonal embedding. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero open Filter @@ -34,6 +34,7 @@ variable [Algebra k K] [Algebra k[X] K] [Algebra k⟮X⟯ K] [Algebra.IsSeparable k⟮X⟯ K] /-- The `k`-submodule of tuples over intrinsic places that are integral almost everywhere. -/ +@[expose] def adeleSubmodule : Submodule k (Place k K → K) where carrier := {a | ∀ᶠ v in cofinite, a v ∈ v.toValuationSubring} zero_mem' := by @@ -95,14 +96,15 @@ noncomputable def adeleEquivChart : AdeleSpace k K ≃ₗ[k] Chart.AdeleSpace k @[simp] theorem adeleEquivChart_apply (a : AdeleSpace k K) (w : PlaceA k K) : (adeleEquivChart k K a).1 w = a.1 (chartToPlace k K w) := - rfl + by rfl @[simp] theorem adeleEquivChart_symm_apply (a : Chart.AdeleSpace k K) (v : Place k K) : ((adeleEquivChart k K).symm a).1 v = a.1 ((chartToPlace k K).symm v) := - rfl + by rfl /-- Pointwise multiplication of an intrinsic adele by an element of `K`. -/ +@[expose] def smulAdele (x : K) (a : AdeleSpace k K) : AdeleSpace k K := ⟨fun v => x * a.1 v, (eventually_mem_place k K x).and a.property |>.mono fun _ h => mul_mem h.1 h.2⟩ diff --git a/LeanPool/RiemannRochFunctionFields/CoordinateFree/Divisor.lean b/LeanPool/RiemannRochFunctionFields/CoordinateFree/Divisor.lean index f38e446278..72f66b8685 100644 --- a/LeanPool/RiemannRochFunctionFields/CoordinateFree/Divisor.lean +++ b/LeanPool/RiemannRochFunctionFields/CoordinateFree/Divisor.lean @@ -24,7 +24,7 @@ degree with the residue-field weighted sum. * `FunctionField.principalDivisor`: coordinate-free principal divisors. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -164,6 +164,7 @@ end Place /-- The chart degree agrees with the intrinsic residue-field degree. -/ theorem placeDegree_eq (w : PlaceA k K) : placeDegree k K w = (chartToPlace k K w).degree := by + rw [chartToPlace_apply] rcases w with w | w · exact (Place.finite_degree_eq k K w).symm · exact (Place.infinite_degree_eq k K w).symm @@ -172,11 +173,11 @@ theorem placeDegree_eq (w : PlaceA k K) : abbrev Divisor := Place k K →₀ ℤ /-- Reindex a chart divisor by the chart/intrinsic place equivalence. -/ -noncomputable def divisorEquivChart : DivisorA k K ≃+ Divisor k K := +@[expose] noncomputable def divisorEquivChart : DivisorA k K ≃+ Divisor k K := Finsupp.domCongr (chartToPlace k K) /-- The coordinate-free principal-divisor homomorphism. -/ -noncomputable def principalDivisor : Additive Kˣ →+ Divisor k K := +@[expose] noncomputable def principalDivisor : Additive Kˣ →+ Divisor k K := (divisorEquivChart k K).toAddMonoidHom.comp (principalDivisorA k K) namespace Divisor @@ -190,7 +191,7 @@ omit [Algebra k[X] K] [Algebra k⟮X⟯ K] [IsScalarTower k k[X] K] [Algebra.IsSeparable k⟮X⟯ K] in /-- The degree is the intrinsic residue-degree weighted sum. -/ theorem deg_formula (D : Divisor k K) : - deg k K D = D.sum fun v n => n * (v.degree : ℤ) := rfl + deg k K D = D.sum fun v n => n * (v.degree : ℤ) := by rfl omit [Algebra k[X] K] [Algebra k⟮X⟯ K] [IsScalarTower k k[X] K] [IsScalarTower k[X] k⟮X⟯ K] [FunctionField k K] diff --git a/LeanPool/RiemannRochFunctionFields/CoordinateFree/EllipticCurve.lean b/LeanPool/RiemannRochFunctionFields/CoordinateFree/EllipticCurve.lean index 4215b84fb7..5c9c2674f7 100644 --- a/LeanPool/RiemannRochFunctionFields/CoordinateFree/EllipticCurve.lean +++ b/LeanPool/RiemannRochFunctionFields/CoordinateFree/EllipticCurve.lean @@ -19,7 +19,7 @@ intrinsic places. The former two-chart implementation remains in `WeierstrassCurve.Affine.Chart`. -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart diff --git a/LeanPool/RiemannRochFunctionFields/CoordinateFree/RiemannRoch.lean b/LeanPool/RiemannRochFunctionFields/CoordinateFree/RiemannRoch.lean index 21596ddb39..5bf723b730 100644 --- a/LeanPool/RiemannRochFunctionFields/CoordinateFree/RiemannRoch.lean +++ b/LeanPool/RiemannRochFunctionFields/CoordinateFree/RiemannRoch.lean @@ -25,7 +25,7 @@ places. The kernel-checked chart proofs are transported across `chartToPlace`. * `FunctionField.riemann_roch` and coordinate-free corollaries C1–C6. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero diff --git a/LeanPool/RiemannRochFunctionFields/CoordinateFree/WeilDifferential.lean b/LeanPool/RiemannRochFunctionFields/CoordinateFree/WeilDifferential.lean index 82540a18d7..472397ac78 100644 --- a/LeanPool/RiemannRochFunctionFields/CoordinateFree/WeilDifferential.lean +++ b/LeanPool/RiemannRochFunctionFields/CoordinateFree/WeilDifferential.lean @@ -18,7 +18,7 @@ vanish on `A(D)` plus the diagonal for some intrinsic divisor. The equivalence carriers in the public statements. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -71,16 +71,14 @@ omit [IsFullConstantField k K] in theorem adeleDualEquivChart_apply (phi : AdeleSpace k K →ₗ[k] k) (a : Chart.AdeleSpace k K) : adeleDualEquivChart (k := k) (K := K) phi a = - phi ((adeleEquivChart k K).symm a) := - rfl + phi ((adeleEquivChart k K).symm a) := by rfl omit [IsFullConstantField k K] in @[simp] theorem adeleDualEquivChart_symm_apply (phi : Chart.AdeleSpace k K →ₗ[k] k) (a : AdeleSpace k K) : (adeleDualEquivChart (k := k) (K := K)).symm phi a = - phi (adeleEquivChart k K a) := - rfl + phi (adeleEquivChart k K a) := by rfl /-- Reindex an intrinsic Weil differential as a chart Weil differential. -/ noncomputable def toChart (omega : WeilDifferential k K) : diff --git a/LeanPool/RiemannRochFunctionFields/Divisor.lean b/LeanPool/RiemannRochFunctionFields/Divisor.lean index f903be14a3..9907eebdf4 100644 --- a/LeanPool/RiemannRochFunctionFields/Divisor.lean +++ b/LeanPool/RiemannRochFunctionFields/Divisor.lean @@ -23,7 +23,7 @@ function `FractionalIdeal.count K v`. * `FractionalIdeal.principalDivisor`: the divisor of a nonzero element of the fraction field. -/ -@[expose] public section +public section open IsDedekindDomain open scoped nonZeroDivisors @@ -76,7 +76,7 @@ private theorem eq_of_count_eq {I J : FractionalIdeal R⁰ K} (hI : I ≠ 0) (hJ Multiplication of fractional ideals corresponds to addition of divisors. -/ -noncomputable def divisorEquiv : Additive (FractionalIdeal R⁰ K)ˣ ≃+ Divisor R where +@[expose] noncomputable def divisorEquiv : Additive (FractionalIdeal R⁰ K)ˣ ≃+ Divisor R where toFun I := divisor I.toMul invFun D := Additive.ofMul (ofDivisor K D) left_inv I := by @@ -105,10 +105,10 @@ noncomputable def principalFractionalIdeal : Kˣ →* (FractionalIdeal R⁰ K)ˣ @[simp] theorem principalFractionalIdeal_apply_coe (x : Kˣ) : (principalFractionalIdeal (R := R) (K := K) x : FractionalIdeal R⁰ K) = - spanSingleton R⁰ (x : K) := rfl + spanSingleton R⁰ (x : K) := by rfl /-- The principal divisor of a nonzero element of the fraction field. -/ -noncomputable def principalDivisor : Additive Kˣ →+ Divisor R := +@[expose] noncomputable def principalDivisor : Additive Kˣ →+ Divisor R := divisorEquiv.toAddMonoidHom.comp principalFractionalIdeal.toAdditive @[simp] @@ -130,7 +130,7 @@ omit [IsDedekindDomain R] in @[simp] theorem weightedDegree_apply (w : Ideal R → ℕ) (D : Divisor R) : weightedDegree (R := R) w D = - D.sum fun v n => n * (w v.asIdeal : ℤ) := rfl + D.sum fun v n => n * (w v.asIdeal : ℤ) := by rfl /-- The weighted degree of the divisor of a nonzero integral ideal is the weighted sum of its normalized prime factors. The weight is stated on ideals, so that it can later be chosen as a diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/ConcreteRegression.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/ConcreteRegression.lean index 849fcbd902..8b15adff1d 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/ConcreteRegression.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/ConcreteRegression.lean @@ -33,7 +33,7 @@ All declarations live in the `RiemannRochTest.EllipticCurve` namespace so that t `k`, `curve`, … do not leak into the root environment. -/ -@[expose] public section +public section open FunctionField diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean index 04ad2335f7..dd33f8b033 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean @@ -23,7 +23,7 @@ localization of a polynomial PID, so its maximal ideal is principal and the loca The main result is the `IsDedekindDomain W.CoordinateRing` instance. -/ -@[expose] public section +public section open Polynomial open scoped Polynomial.Bivariate diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/DegreeOneDictionary.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/DegreeOneDictionary.lean index 4e4d7900ad..b300112d50 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/DegreeOneDictionary.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/DegreeOneDictionary.lean @@ -16,7 +16,7 @@ Unlike the all-place dichotomy over an algebraically closed field, this directio the residue field has dimension one over the base field. -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusCounting.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusCounting.lean index eacf67d56a..2a1188b7c1 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusCounting.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusCounting.lean @@ -23,7 +23,7 @@ genus one. Finally, a degree-zero canonical divisor is moved to zero by its uni Riemann–Roch section. -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusOne.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusOne.lean index 78ec1d4796..e39af418bb 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusOne.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/GenusOne.lean @@ -17,7 +17,7 @@ Weierstrass monomials in `L(n·∞)`. The zero canonical divisor is then obtain arbitrary canonical divisor with its unique nonzero Riemann–Roch section. -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean index 52446a0e47..b52d9f0f81 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean @@ -22,7 +22,7 @@ ramification index two. The fundamental ramification–inertia identity for the extension then proves that the prime is unique and has inertia degree one. -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart @@ -360,7 +360,7 @@ noncomputable def infinityHeightOne : IsDedekindDomain.HeightOneSpectrum S∞ := exact ⟨P, hP.1.isPrime, Ideal.ne_bot_of_liesOver_of_ne_bot hp0 P⟩ /-- The unique place of the elliptic function field above the point at infinity. -/ -noncomputable def infinityPlace : PlaceA k K := Sum.inr (infinityHeightOne (k := k) K) +@[expose] noncomputable def infinityPlace : PlaceA k K := Sum.inr (infinityHeightOne (k := k) K) include W in omit [WeierstrassCurve.IsElliptic W] in diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean index 2d3dc600aa..9b4a894705 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean @@ -19,7 +19,7 @@ Weierstrass generator in every characteristic, and (over an algebraically closed `IsFullConstantField k K`. -/ -@[expose] public section +public section open Polynomial @@ -133,7 +133,7 @@ section AbstractRatFuncAlgebra variable [Algebra k⟮X⟯ K] [IsScalarTower k[X] k⟮X⟯ K] /-- The coordinate function `y ∈ K`, the image of the `AdjoinRoot` generator. -/ -def yCoord : K := algebraMap W.CoordinateRing K (CoordinateRing.mk W Y) +@[expose] def yCoord : K := algebraMap W.CoordinateRing K (CoordinateRing.mk W Y) /-- The `{1, y}` basis of `K` over `k⟮X⟯`, localized from `CoordinateRing.basis`. -/ def basisRatFunc : Module.Basis (Fin 2) k⟮X⟯ K := diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/PicTorsorCore.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/PicTorsorCore.lean index 88a4cea5f0..43b29c5b6c 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/PicTorsorCore.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/PicTorsorCore.lean @@ -21,7 +21,7 @@ This file constructs the divisor-class map, proves its bijectivity by Riemann– identifies it with the ideal-class map on rational Weierstrass points. -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart @@ -73,7 +73,7 @@ omit [IsScalarTower k[X] k⟮X⟯ K] [_root_.FunctionField k K] [Algebra.IsSepar @[simp] lemma finitePart_apply (D : DivisorA k K) (v : IsDedekindDomain.HeightOneSpectrum (ringOfIntegers k K)) : - finitePart (k := k) K D v = D (Sum.inl v) := rfl + finitePart (k := k) K D v = D (Sum.inl v) := by rfl /-- The ideal class represented by the finite part of an adelic divisor. -/ noncomputable def finiteDivisorClass : DivisorA k K →+ @@ -132,7 +132,9 @@ lemma finiteDivisorClass_principal (u : Kˣ) : Submodule.span (ringOfIntegers k K) {(u : K)} rw [← FractionalIdeal.coe_spanSingleton (R := ringOfIntegers k K) (S := (ringOfIntegers k K)⁰)] - rfl + exact congrArg (fun J : FractionalIdeal (ringOfIntegers k K)⁰ K => + (J : Submodule (ringOfIntegers k K) K)) + (FractionalIdeal.principalFractionalIdeal_apply_coe u) omit [Algebra k K] [IsScalarTower k k[X] K] [IsFullConstantField k K] in lemma eq_single_of_effective_deg_one {D : DivisorA k K} diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/PlaceDictionary.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/PlaceDictionary.lean index 3011c4fd36..35642941b1 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/PlaceDictionary.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/PlaceDictionary.lean @@ -21,7 +21,7 @@ tie every statement to one `Semiring` derivation path and break instance unifica (`OreLocalization.instSemiring` vs `FractionRing.field`). -/ -@[expose] public section +public section open FunctionField open FunctionField.Chart @@ -42,7 +42,7 @@ variable [Algebra k[X] K] [IsScalarTower k[X] W.CoordinateRing K] /-- The integral-closure identification between the affine coordinate ring and the finite-integer ring of its fraction field. -/ -noncomputable def coordinateRingEquivIntegers : +@[expose] noncomputable def coordinateRingEquivIntegers : W.CoordinateRing ≃ₐ[k[X]] ringOfIntegers k K := IsIntegralClosure.equiv k[X] W.CoordinateRing K (ringOfIntegers k K) @@ -65,13 +65,13 @@ lemma XYIdeal_ne_bot {x y : k} (_h : W.Nonsingular x y) : exact Ideal.subset_span (Set.mem_insert _ _) /-- A nonsingular affine point as a height-one prime of the coordinate ring. -/ -noncomputable def affineHeightOne {x y : k} (h : W.Nonsingular x y) : +@[expose] noncomputable def affineHeightOne {x y : k} (h : W.Nonsingular x y) : IsDedekindDomain.HeightOneSpectrum W.CoordinateRing := ⟨CoordinateRing.XYIdeal W x (Polynomial.C y), (XYIdeal_isMaximal W h).isPrime, XYIdeal_ne_bot W h⟩ /-- The finite place corresponding to a nonsingular affine pair. -/ -noncomputable def finitePlaceOfAffine {x y : k} (h : W.Nonsingular x y) : PlaceA k K := +@[expose] noncomputable def finitePlaceOfAffine {x y : k} (h : W.Nonsingular x y) : PlaceA k K := Sum.inl (IsDedekindDomain.HeightOneSpectrum.equivOfRingEquiv (coordinateRingEquivIntegers W K).toRingEquiv (affineHeightOne W h)) @@ -137,7 +137,7 @@ lemma maximal_eq_XYIdeal [IsAlgClosed k] (I : Ideal W.CoordinateRing) [I.IsMaxim exact ((XYIdeal_isMaximal W hns).eq_of_le (Ideal.IsMaximal.ne_top inferInstance) hle).symm /-- The finite place corresponding to a nonsingular affine point `(x, y)`. -/ -noncomputable def placeOfPoint : W.Point → PlaceA k K +@[expose] noncomputable def placeOfPoint : W.Point → PlaceA k K | .zero => infinityPlace K | .some _ _ h => finitePlaceOfAffine W K h diff --git a/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean b/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean index 02e2cd2f41..ffd081bc48 100644 --- a/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean +++ b/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean @@ -26,7 +26,7 @@ The partial order on `DivisorA` is the pointwise order on `Finsupp` from Mathlib (`Finsupp.le_def`); no new order instance is introduced here. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc @@ -43,6 +43,7 @@ variable (k K : Type*) [Field k] [Field K] local instance instDecidableEqRatFuncDivisorFile : DecidableEq k⟮X⟯ := Classical.decEq _ /-- The degree of a coordinate place: the residue field dimension over `k`. -/ +@[expose] noncomputable def placeDegree (v : PlaceA k K) : ℕ := match v with | Sum.inl w => @@ -553,11 +554,11 @@ theorem infinitePrincipalDegree_eq_neg_intDegree_norm (x : Kˣ) : ring /-- The valuation subring at a coordinate place. -/ -noncomputable def placeValuationSubring (v : PlaceA k K) : ValuationSubring K := +@[expose] noncomputable def placeValuationSubring (v : PlaceA k K) : ValuationSubring K := (placeValuation k K v).valuationSubring /-- The global degree of a divisor. -/ -noncomputable def deg (D : DivisorA k K) : ℤ := +@[expose] noncomputable def deg (D : DivisorA k K) : ℤ := D.sum fun v n => (n : ℤ) * (placeDegree k K v : ℤ) /-- Product formula: the global degree of a principal divisor is zero. -/ @@ -569,7 +570,7 @@ theorem deg_principalDivisorA_eq_zero (x : Kˣ) : (R := infiniteIntegers k K) (K := K) (Additive.ofMul x) have hdiv : principalDivisorA k K (Additive.ofMul x) = Dfin.sumElim Dinf := by rw [Finsupp.sumElim_eq_add] - rfl + exact principalDivisorA_apply k K (Additive.ofMul x) rw [deg, hdiv, Finsupp.sum_sumElim] change Dfin.sum (fun v n => n * (placeDegree k K (Sum.inl v) : ℤ)) + @@ -582,6 +583,7 @@ theorem deg_principalDivisorA_eq_zero (x : Kˣ) : def support (D : DivisorA k K) : Finset (PlaceA k K) := D.support /-- A divisor is effective when all coefficients are nonnegative. -/ +@[expose] def IsEffective (D : DivisorA k K) : Prop := ∀ v, 0 ≤ D v diff --git a/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean b/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean index cd7906f629..b99d8ff6eb 100644 --- a/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean +++ b/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean @@ -20,7 +20,7 @@ quotient-based `Ideal.ramificationIdx'` over the finite set records the resulting bound `e ≤ [L : K]` for a single prime. -/ -@[expose] public section +public section open Module diff --git a/LeanPool/RiemannRochFunctionFields/Genus/AdeleQuotient.lean b/LeanPool/RiemannRochFunctionFields/Genus/AdeleQuotient.lean index e8588d9261..830c4b8980 100644 --- a/LeanPool/RiemannRochFunctionFields/Genus/AdeleQuotient.lean +++ b/LeanPool/RiemannRochFunctionFields/Genus/AdeleQuotient.lean @@ -15,7 +15,7 @@ This file proves Stichtenoth 1.5.4: the rank of `𝒜_K/(A(D)+diag(K))` equals t index `i(D)`. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero open Filter @@ -36,7 +36,7 @@ variable [IsFullConstantField k K] local instance instDecidableEqPlaceAAdeleQuotient : DecidableEq (PlaceA k K) := Classical.decEq _ /-- The top submodule of the adele space (avoids `↥⊤` notation pitfalls). -/ -def topAdeleSubmodule : Submodule k (AdeleSpace k K) := ⊤ +@[expose] def topAdeleSubmodule : Submodule k (AdeleSpace k K) := ⊤ omit [IsFullConstantField k K] in /-- Finite set of finite places where an adele component is not integral. -/ diff --git a/LeanPool/RiemannRochFunctionFields/Genus/Basic.lean b/LeanPool/RiemannRochFunctionFields/Genus/Basic.lean index 758ea13acf..ea6df77c28 100644 --- a/LeanPool/RiemannRochFunctionFields/Genus/Basic.lean +++ b/LeanPool/RiemannRochFunctionFields/Genus/Basic.lean @@ -30,7 +30,7 @@ This file defines the genus of a function field and the specialty index `i(D)`. * `FunctionField.deg_polarX_eq_finrank` -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -50,7 +50,7 @@ variable [IsFullConstantField k K] local instance instDecidableEqRatFuncGenus : DecidableEq k⟮X⟯ := Classical.decEq _ /-- The defect `deg D + 1 − ℓ(D)`. -/ -noncomputable def defect (D : DivisorA k K) : ℤ := +@[expose] noncomputable def defect (D : DivisorA k K) : ℤ := deg k K D + 1 - ell k K D /-- Stichtenoth 1.4.11 for the chart variable `X_K` (equality; ≤ half proved in `Polar.lean`). -/ @@ -255,7 +255,7 @@ theorem genus_le_of_family (B C : DivisorA k K) (c₀ : ℤ) simpa [hD] using hbound D /-- The index of specialty `i(D) = ℓ(D) − (deg D + 1 − g)`. -/ -noncomputable def indexOfSpecialty (D : DivisorA k K) : ℕ := +@[expose] noncomputable def indexOfSpecialty (D : DivisorA k K) : ℕ := (ell k K D - (deg k K D + 1 - (genus k K : ℤ))).toNat theorem indexOfSpecialty_eq (D : DivisorA k K) : @@ -265,7 +265,7 @@ theorem indexOfSpecialty_eq (D : DivisorA k K) : omega /-- `finrank k (A_K ⧸ (A(D) + diag(K)))`. -/ -noncomputable def finrankAdeleQuotient (D : DivisorA k K) : ℕ := +@[expose] noncomputable def finrankAdeleQuotient (D : DivisorA k K) : ℕ := Module.finrank k <| (AdeleSpace k K) ⧸ (adeleFilt k K D + diagonalSubmodule k K) diff --git a/LeanPool/RiemannRochFunctionFields/Genus/Polar.lean b/LeanPool/RiemannRochFunctionFields/Genus/Polar.lean index 2226d1b19f..68201b913d 100644 --- a/LeanPool/RiemannRochFunctionFields/Genus/Polar.lean +++ b/LeanPool/RiemannRochFunctionFields/Genus/Polar.lean @@ -14,7 +14,7 @@ This file develops the pole divisor `(x)_∞` and the key degree identity: `deg (polarDivisor x) = finrank k(X) K` for transcendental `x`. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -75,7 +75,7 @@ local instance instDecidableEqRatFuncPolar : DecidableEq k⟮X⟯ := Classical.d section PolarDivisor /-- The pole divisor `(x)_∞` of a nonzero function. -/ -noncomputable def polarDivisor (x : K) : DivisorA k K := +@[expose] noncomputable def polarDivisor (x : K) : DivisorA k K := by classical exact if hx : x = 0 then 0 @@ -229,7 +229,7 @@ theorem nsmul_le_nsmul_polar {D : DivisorA k K} (hD : 0 ≤ D) {j r : ℕ} (hjr exact mul_le_mul_of_nonneg_right (Nat.cast_le.mpr hjr) (hD v) /-- A uniform pole bound for a finite family of functions. -/ -noncomputable def basisPoleBound {ι : Type*} [Fintype ι] (f : ι → K) : DivisorA k K := +@[expose] noncomputable def basisPoleBound {ι : Type*} [Fintype ι] (f : ι → K) : DivisorA k K := (Finset.univ : Finset ι).sum fun i => polarDivisor k K (f i) omit [Algebra k K] [IsScalarTower k k[X] K] [IsFullConstantField k K] in @@ -281,7 +281,7 @@ local instance instIsScalarTowerChart : IsScalarTower k k⟮X⟯ K := ← IsScalarTower.algebraMap_apply k k[X] k⟮X⟯] /-- The chart variable `X_K` in `K`. -/ -noncomputable def XK : K := algebraMap k⟮X⟯ K (RatFunc.X : k⟮X⟯) +@[expose] noncomputable def XK : K := algebraMap k⟮X⟯ K (RatFunc.X : k⟮X⟯) omit [_root_.FunctionField k K] [Algebra.IsSeparable k⟮X⟯ K] [IsFullConstantField k K] in theorem transcendental_XK : Transcendental k (XK k K) := diff --git a/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean b/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean index 120af496d8..4647a075ad 100644 --- a/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean +++ b/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean @@ -15,7 +15,7 @@ This file proves `deg (X_K)_∞ ≤ [K : k(X)]` via the fundamental identity of index and inertia degree. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero Additive @@ -39,10 +39,10 @@ local instance instDecidableEqPlaceARam : DecidableEq (PlaceA k K) := Classical. local instance instDecidableEqRatFuncRam : DecidableEq k⟮X⟯ := Classical.decEq _ /-- The uniformizer `t = X⁻¹` in `k(X)`. -/ -noncomputable def tRatFunc : k⟮X⟯ := 1 / RatFunc.X +@[expose] noncomputable def tRatFunc : k⟮X⟯ := 1 / RatFunc.X /-- `t` as an element of the valuation subring at infinity. -/ -noncomputable def tA : inftyValuationSubring k := +@[expose] noncomputable def tA : inftyValuationSubring k := ⟨tRatFunc k, by rw [Valuation.mem_valuationSubring_iff] dsimp [tRatFunc] @@ -50,7 +50,7 @@ noncomputable def tA : inftyValuationSubring k := exact WithZero.exp_le_exp.mpr (show (-1 : ℤ) ≤ 0 by omega)⟩ @[simp] -theorem tRatFunc_coe : (tA k : k⟮X⟯) = tRatFunc k := rfl +theorem tRatFunc_coe : (tA k : k⟮X⟯) = tRatFunc k := by rfl omit [Algebra k K] [Algebra k[X] K] [IsScalarTower k k[X] K] [IsScalarTower k[X] k⟮X⟯ K] [_root_.FunctionField k K] [Algebra.IsSeparable k⟮X⟯ K] [IsFullConstantField k K] in @@ -74,11 +74,11 @@ local notation "inftyInts" => infiniteIntegers k K local notation "maxIdealInfty" => IsLocalRing.maximalIdeal (inftyValuationSubring k) /-- Ramification index of the infinite place above `k(X)`. -/ -noncomputable def ramIdxInfty (P : Ideal (infiniteIntegers k K)) : ℕ := +@[expose] noncomputable def ramIdxInfty (P : Ideal (infiniteIntegers k K)) : ℕ := (IsLocalRing.maximalIdeal (inftyValuationSubring k)).ramificationIdx' P /-- Its image `t_K` in the function field. -/ -noncomputable def tK : K := algebraMap k⟮X⟯ K (tRatFunc k) +@[expose] noncomputable def tK : K := algebraMap k⟮X⟯ K (tRatFunc k) omit [Algebra k K] [Algebra k[X] K] [IsScalarTower k k[X] K] [IsScalarTower k[X] k⟮X⟯ K] [_root_.FunctionField k K] [Algebra.IsSeparable k⟮X⟯ K] [IsFullConstantField k K] in @@ -125,7 +125,7 @@ theorem principalDivisorA_nonneg_at_finite_of_mem_ringOfIntegers {a : ringOfInte FractionalIdeal.count K w (FractionalIdeal.spanSingleton (ringOfIntegers k K)⁰ (Units.mk0 (a : K) (ringOfIntegers_coe_ne_zero k K ha))) := by - rfl + rw [FractionalIdeal.principalDivisor_apply, toMul_ofMul] have hnonneg : 0 ≤ FractionalIdeal.count K w (FractionalIdeal.spanSingleton (ringOfIntegers k K)⁰ diff --git a/LeanPool/RiemannRochFunctionFields/LinearKneser.lean b/LeanPool/RiemannRochFunctionFields/LinearKneser.lean index 6e655e7acf..1c0449e363 100644 --- a/LeanPool/RiemannRochFunctionFields/LinearKneser.lean +++ b/LeanPool/RiemannRochFunctionFields/LinearKneser.lean @@ -22,7 +22,7 @@ hypothesis makes the stabilizer-field step direct and avoids a separate finite/i split. -/ -@[expose] public section +public section open scoped Pointwise diff --git a/LeanPool/RiemannRochFunctionFields/LocalResidue.lean b/LeanPool/RiemannRochFunctionFields/LocalResidue.lean index 4a49aa534a..5cbd2ff853 100644 --- a/LeanPool/RiemannRochFunctionFields/LocalResidue.lean +++ b/LeanPool/RiemannRochFunctionFields/LocalResidue.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! Local residue maps for height-one primes of Dedekind domains. -/ -@[expose] public section +public section open scoped nonZeroDivisors WithZero @@ -25,6 +25,7 @@ variable {R K : Type*} [CommRing R] [IsDedekindDomain R] [Field K] [Algebra R K] [IsFractionRing R K] /-- The residue map from the valuation ring at a height-one prime. -/ +@[expose] noncomputable def residueHom (v : HeightOneSpectrum R) : valuationSubringAtPrime K v →+* v.asIdeal.ResidueField := IsLocalization.lift (S := valuationSubringAtPrime K v) diff --git a/LeanPool/RiemannRochFunctionFields/Place.lean b/LeanPool/RiemannRochFunctionFields/Place.lean index d674abc203..4747ee01ad 100644 --- a/LeanPool/RiemannRochFunctionFields/Place.lean +++ b/LeanPool/RiemannRochFunctionFields/Place.lean @@ -31,7 +31,7 @@ places are the height-one primes of the integral closure of the valuation subrin * `FunctionField.principalDivisorA`: the principal divisor on both coordinate charts. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -243,6 +243,7 @@ noncomputable def normalization (v : Place k K) : Classical.choice v.isDiscrete /-- The normalized `ℤᵐ⁰`-valued valuation associated to a coordinate-free place. -/ +@[expose] noncomputable def valuation (v : Place k K) : Valuation K ℤᵐ⁰ := v.toValuationSubring.valuation.restrict.map v.normalization.toMonoidWithZeroHom v.normalization.toOrderIso.monotone @@ -298,7 +299,7 @@ abbrev residueField (v : Place k K) := IsLocalRing.ResidueField v.toValuationSubring /-- The intrinsic degree of a place is the dimension of its residue field over `k`. -/ -noncomputable def degree (v : Place k K) : ℕ := +@[expose] noncomputable def degree (v : Place k K) : ℕ := Module.finrank k v.residueField end Place @@ -450,7 +451,7 @@ abbrev PlaceA := IsDedekindDomain.HeightOneSpectrum (infiniteIntegers k K) /-- The discrete valuation associated to a coordinate place. -/ -def placeValuation : PlaceA k K → Valuation K ℤᵐ⁰ +@[expose] def placeValuation : PlaceA k K → Valuation K ℤᵐ⁰ | Sum.inl v => v.valuation K | Sum.inr v => v.valuation K @@ -508,6 +509,14 @@ noncomputable def principalDivisorA : Additive Kˣ →+ DivisorA k K := (Finsupp.mapDomain.addMonoidHom Sum.inr).comp (FractionalIdeal.principalDivisor (R := infiniteIntegers k K) (K := K)) +/-- A principal divisor combines the finite and infinite coordinate divisors. -/ +theorem principalDivisorA_apply (x : Additive Kˣ) : + principalDivisorA k K x = + Finsupp.mapDomain Sum.inl + (FractionalIdeal.principalDivisor (R := ringOfIntegers k K) (K := K) x) + + Finsupp.mapDomain Sum.inr + (FractionalIdeal.principalDivisor (R := infiniteIntegers k K) (K := K) x) := by rfl + @[simp] theorem principalDivisorA_apply_finite (x : Additive Kˣ) (v : IsDedekindDomain.HeightOneSpectrum (ringOfIntegers k K)) : diff --git a/LeanPool/RiemannRochFunctionFields/PlaceEquiv.lean b/LeanPool/RiemannRochFunctionFields/PlaceEquiv.lean index 11d8bb7d15..9dfa788619 100644 --- a/LeanPool/RiemannRochFunctionFields/PlaceEquiv.lean +++ b/LeanPool/RiemannRochFunctionFields/PlaceEquiv.lean @@ -30,7 +30,7 @@ integral closure. * `FunctionField.placeValuation_isEquiv`: compatibility of normalized valuations. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -75,7 +75,7 @@ noncomputable def Place.ofChart (w : PlaceA k K) : Place k K := by @[simp] theorem Place.ofChart_toValuationSubring (w : PlaceA k K) : (Place.ofChart k K w).toValuationSubring = - (placeValuation k K w).valuationSubring := rfl + (placeValuation k K w).valuationSubring := by rfl theorem Place.ofChart_valuation_isEquiv (w : PlaceA k K) : (placeValuation k K w).IsEquiv (Place.ofChart k K w).valuation := by @@ -438,6 +438,7 @@ theorem ofChart_toChart (v : Place k K) : Classical.choose_spec (exists_chart k K v) /-- Coordinate places and intrinsic places are equivalent. -/ +@[expose] noncomputable def chartToPlaceCore : PlaceA k K ≃ Place k K where toFun := Place.ofChart k K invFun := toChart k K @@ -452,7 +453,7 @@ noncomputable abbrev chartToPlace : PlaceA k K ≃ Place k K := @[simp] theorem chartToPlace_apply (w : PlaceA k K) : - chartToPlace k K w = Place.ofChart k K w := rfl + chartToPlace k K w = Place.ofChart k K w := by rfl /-- The coordinate valuation and the normalized intrinsic valuation define the same place. -/ theorem placeValuation_isEquiv (w : PlaceA k K) : diff --git a/LeanPool/RiemannRochFunctionFields/RRspace/Basic.lean b/LeanPool/RiemannRochFunctionFields/RRspace/Basic.lean index df7e051d48..2f14a5aa0d 100644 --- a/LeanPool/RiemannRochFunctionFields/RRspace/Basic.lean +++ b/LeanPool/RiemannRochFunctionFields/RRspace/Basic.lean @@ -16,7 +16,7 @@ This file defines the Riemann–Roch space of a divisor on a function field and `ℓ(D)`. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -61,7 +61,7 @@ theorem nonempty_placeA : Nonempty (PlaceA k K) := by /-- A function belongs to the Riemann–Roch space of `D` when its valuation at every place `v` is at most `WithZero.exp (D v)`, i.e. `ord_v f ≥ -D v` in additive notation. The zero function belongs trivially since its valuation is `0`. -/ -def memRRspace (D : DivisorA k K) (f : K) : Prop := +@[expose] def memRRspace (D : DivisorA k K) (f : K) : Prop := ∀ v, placeValuation k K v f ≤ WithZero.exp (D v) namespace memRRspace @@ -120,14 +120,14 @@ theorem pow_mem {D : DivisorA k K} {f : K} (hf : memRRspace k K D f) : end memRRspace /-- The Riemann–Roch space `L(D)`. -/ -def RRspace (D : DivisorA k K) : Submodule k K where +@[expose] def RRspace (D : DivisorA k K) : Submodule k K where carrier := {f | memRRspace k K D f} zero_mem' := memRRspace.zero_mem (k := k) (K := K) D add_mem' hf hg := memRRspace.add_mem (k := k) (K := K) hf hg smul_mem' c _ hf := memRRspace.smul_mem (k := k) (K := K) c hf /-- The dimension `ℓ(D)`. -/ -noncomputable def ell (D : DivisorA k K) : ℕ := +@[expose] noncomputable def ell (D : DivisorA k K) : ℕ := Module.finrank k (RRspace k K D) @[simp] @@ -206,6 +206,7 @@ theorem ell_add_principal (D : DivisorA k K) (x : Kˣ) : exact (RRspaceAddPrincipalEquiv k K D x).finrank_eq /-- The rank of the quotient `L(D') / L(D)` (with intersection semantics when unordered). -/ +@[expose] noncomputable def finrankRRspaceDiff (D D' : DivisorA k K) : ℕ := by letI : AddCommGroup (RRspace k K D') := Submodule.addCommGroup _ letI : Module k (RRspace k K D') := Submodule.module _ diff --git a/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Basic.lean b/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Basic.lean index 839e242a6d..8b220139d0 100644 --- a/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Basic.lean +++ b/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Basic.lean @@ -14,7 +14,7 @@ This is pure packaging of the duality theorem together with the definition of th specialty. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero diff --git a/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Corollaries.lean b/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Corollaries.lean index 842869dd89..16cca376e0 100644 --- a/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Corollaries.lean +++ b/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Corollaries.lean @@ -18,7 +18,7 @@ Standard consequences of the main theorem, including C5 (Clifford) and C6 (exist non-special divisors). -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero diff --git a/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Regression.lean b/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Regression.lean index 598f0feea3..da5be387b8 100644 --- a/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Regression.lean +++ b/LeanPool/RiemannRochFunctionFields/RiemannRochTheorem/Regression.lean @@ -14,7 +14,7 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real Sanity checks on `k(t)` and spot checks for the specialty index table. -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero diff --git a/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean b/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean index 3f582292f0..06960f0aec 100644 --- a/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean +++ b/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean @@ -16,7 +16,7 @@ available in its sharp form: the particular fraction-field extension is separabl records that variant, using the same normal-closure argument as the Mathlib theorem. -/ -@[expose] public section +public section open Module open UniqueFactorizationMonoid diff --git a/LeanPool/RiemannRochFunctionFields/WeilDifferential/Basic.lean b/LeanPool/RiemannRochFunctionFields/WeilDifferential/Basic.lean index 65cad40d64..7ce76d7fc6 100644 --- a/LeanPool/RiemannRochFunctionFields/WeilDifferential/Basic.lean +++ b/LeanPool/RiemannRochFunctionFields/WeilDifferential/Basic.lean @@ -29,7 +29,7 @@ that identifies `L(W − D)` with `Ω(D)`. * `FunctionField.duality` -/ -@[expose] public section +public section open scoped nonZeroDivisors Polynomial RatFunc WithZero @@ -133,10 +133,10 @@ namespace WeilDifferential variable {k K} /-- A Weil differential is nonzero. -/ -def IsNonzero (ω : WeilDifferential k K) : Prop := ω.toFun ≠ 0 +@[expose] def IsNonzero (ω : WeilDifferential k K) : Prop := ω.toFun ≠ 0 /-- The space `Ω(D)` of k-linear functionals vanishing on `A(D)+diag(K)`. -/ -def differentialSpace (D : DivisorA k K) : Submodule k (AdeleSpace k K →ₗ[k] k) where +@[expose] def differentialSpace (D : DivisorA k K) : Submodule k (AdeleSpace k K →ₗ[k] k) where carrier := {φ | ∀ a ∈ adeleFilt k K D + diagonalSubmodule k K, φ a = 0} zero_mem' := by simp add_mem' {f g} hf hg := by @@ -436,8 +436,7 @@ omit [IsFullConstantField k K] in @[simp] theorem smulIntoOmega_coe (ω : WeilDifferential k K) {D₀ : DivisorA k K} (h : D₀ ∈ vanishingDivisors ω) (E : DivisorA k K) (f : RRspace k K E) : - (smulIntoOmega ω h E f : AdeleSpace k K →ₗ[k] k) = (smulWeil (f : K) ω).toFun := - rfl + (smulIntoOmega ω h E f : AdeleSpace k K →ₗ[k] k) = (smulWeil (f : K) ω).toFun := by rfl omit [IsFullConstantField k K] in theorem smulIntoOmega_injective (ω : WeilDifferential k K) {D₀ : DivisorA k K} @@ -703,7 +702,7 @@ theorem divOmega_smul (x : Kˣ) (ω : WeilDifferential k K) (hω : IsNonzero ω) end WeilDifferential /-- A divisor is canonical when it is the divisor of a nonzero Weil differential. -/ -def IsCanonical (W : DivisorA k K) : Prop := +@[expose] def IsCanonical (W : DivisorA k K) : Prop := ∃ (ω : WeilDifferential k K) (hω : WeilDifferential.IsNonzero ω), WeilDifferential.divOmega ω hω = W diff --git a/LeanPool/RlTheoryInLean.lean b/LeanPool/RlTheoryInLean.lean index 612428bb00..0aa616bdb8 100644 --- a/LeanPool/RlTheoryInLean.lean +++ b/LeanPool/RlTheoryInLean.lean @@ -25,7 +25,7 @@ Tags: probability, reinforcement-learning, stochastic-matrices MSC: 62L20, 60J10 -/ -@[expose] public section +public section /-! ## Provenance diff --git a/LeanPool/RlTheoryInLean/Analysis.lean b/LeanPool/RlTheoryInLean/Analysis.lean index c261cf00d3..8b111000b5 100644 --- a/LeanPool/RlTheoryInLean/Analysis.lean +++ b/LeanPool/RlTheoryInLean/Analysis.lean @@ -14,4 +14,4 @@ import Mathlib.Analysis.Normed.Group.Basic Import-only index for the `Analysis` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Analysis/Normed.lean b/LeanPool/RlTheoryInLean/Analysis/Normed.lean index 3b15619fe5..d43b500339 100644 --- a/LeanPool/RlTheoryInLean/Analysis/Normed.lean +++ b/LeanPool/RlTheoryInLean/Analysis/Normed.lean @@ -14,4 +14,4 @@ import Mathlib.Analysis.Normed.Group.Basic Import-only index for the `Normed` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Analysis/Normed/Group.lean b/LeanPool/RlTheoryInLean/Analysis/Normed/Group.lean index 31ec229ace..a7dd1e4842 100644 --- a/LeanPool/RlTheoryInLean/Analysis/Normed/Group.lean +++ b/LeanPool/RlTheoryInLean/Analysis/Normed/Group.lean @@ -14,4 +14,4 @@ import Mathlib.Analysis.Normed.Group.Basic Import-only index for the `Group` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Analysis/Normed/Group/Basic.lean b/LeanPool/RlTheoryInLean/Analysis/Normed/Group/Basic.lean index 6483bb4da0..b7500a3d57 100644 --- a/LeanPool/RlTheoryInLean/Analysis/Normed/Group/Basic.lean +++ b/LeanPool/RlTheoryInLean/Analysis/Normed/Group/Basic.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Normed.Group.Basic # LeanPool.RlTheoryInLean.Analysis.Normed.Group.Basic -/ -@[expose] public section +public section variable {E : Type*} [SeminormedAddGroup E] diff --git a/LeanPool/RlTheoryInLean/Data.lean b/LeanPool/RlTheoryInLean/Data.lean index 26bacdb5be..95f8a02118 100644 --- a/LeanPool/RlTheoryInLean/Data.lean +++ b/LeanPool/RlTheoryInLean/Data.lean @@ -15,4 +15,4 @@ import Mathlib.Tactic.Positivity.Finset Import-only index for the `Data` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Data/Matrix.lean b/LeanPool/RlTheoryInLean/Data/Matrix.lean index 44a522adce..45093b4f10 100644 --- a/LeanPool/RlTheoryInLean/Data/Matrix.lean +++ b/LeanPool/RlTheoryInLean/Data/Matrix.lean @@ -17,4 +17,4 @@ import Mathlib.Tactic.Positivity.Finset Import-only index for the `Matrix` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean b/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean index 85585a7b70..b0df871fa6 100644 --- a/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean +++ b/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Ring.RingNF # LeanPool.RlTheoryInLean.Data.Matrix.Mul -/ -@[expose] public section +public section open Finset Real diff --git a/LeanPool/RlTheoryInLean/Data/Matrix/PosDef.lean b/LeanPool/RlTheoryInLean/Data/Matrix/PosDef.lean index 5bf709bc34..5e104f2949 100644 --- a/LeanPool/RlTheoryInLean/Data/Matrix/PosDef.lean +++ b/LeanPool/RlTheoryInLean/Data/Matrix/PosDef.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Matrix.PosDef # LeanPool.RlTheoryInLean.Data.Matrix.PosDef -/ -@[expose] public section +public section open Real Finset Filter TopologicalSpace Preorder Matrix EuclideanSpace open scoped InnerProductSpace RealInnerProductSpace diff --git a/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean b/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean index 1a655a6aa7..56e65ed4d8 100644 --- a/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean +++ b/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # LeanPool.RlTheoryInLean.Data.Matrix.Stochastic -/ -@[expose] public section +public section open Finset NNReal WithLp Matrix PiLp Nat ContractingWith Metric Bornology Filter Function open scoped BigOperators diff --git a/LeanPool/RlTheoryInLean/Defs.lean b/LeanPool/RlTheoryInLean/Defs.lean index e3a58b4b27..1edd1877b5 100644 --- a/LeanPool/RlTheoryInLean/Defs.lean +++ b/LeanPool/RlTheoryInLean/Defs.lean @@ -14,7 +14,7 @@ public import Mathlib.Probability.Kernel.Defs # LeanPool.RlTheoryInLean.Defs -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory Filter diff --git a/LeanPool/RlTheoryInLean/MeasureTheory.lean b/LeanPool/RlTheoryInLean/MeasureTheory.lean index 13559e9074..a2b9a3007f 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory.lean @@ -15,4 +15,4 @@ public import LeanPool.RlTheoryInLean.MeasureTheory.Measure Import-only index for the `MeasureTheory` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Function.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Function.lean index c1bcc1fe05..ca03756e4f 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Function.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Function.lean @@ -14,4 +14,4 @@ public import LeanPool.RlTheoryInLean.MeasureTheory.Function.L1Space Import-only index for the `Function` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation.lean index dc2fc1d20d..c5e63255aa 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation.lean @@ -13,4 +13,4 @@ public import LeanPool.RlTheoryInLean.MeasureTheory.Function.ConditionalExpectat Import-only index for the `ConditionalExpectation` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation/Basic.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation/Basic.lean index 0fba7aa55e..c5553c6520 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation/Basic.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Function/ConditionalExpectation/Basic.lean @@ -15,7 +15,7 @@ import Mathlib.Probability.Kernel.Condexp # LeanPool.RlTheoryInLean.MeasureTheory.Function.ConditionalExpectation.Basic -/ -@[expose] public section +public section open Filter ProbabilityTheory open scoped RealInnerProductSpace diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space.lean index fb032afedc..40be67ef28 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space.lean @@ -13,4 +13,4 @@ public import LeanPool.RlTheoryInLean.MeasureTheory.Function.L1Space.Integrable Import-only index for the `L1Space` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space/Integrable.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space/Integrable.lean index 7c9556253e..eafdc3b8b5 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space/Integrable.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Function/L1Space/Integrable.lean @@ -11,7 +11,7 @@ public import Mathlib.MeasureTheory.Function.L1Space.Integrable # LeanPool.RlTheoryInLean.MeasureTheory.Function.L1Space.Integrable -/ -@[expose] public section +public section open Filter diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace.lean b/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace.lean index 866e253dae..d6bf3d4e98 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace.lean @@ -13,4 +13,4 @@ public import LeanPool.RlTheoryInLean.MeasureTheory.MeasurableSpace.Construction Import-only index for the `MeasurableSpace` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace/Constructions.lean b/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace/Constructions.lean index 56debcb5dd..b8d7f35ed3 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace/Constructions.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/MeasurableSpace/Constructions.lean @@ -11,7 +11,7 @@ public import Mathlib.MeasureTheory.MeasurableSpace.Constructions # LeanPool.RlTheoryInLean.MeasureTheory.MeasurableSpace.Constructions -/ -@[expose] public section +public section lemma Measurable.of_uncurry {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Measure.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Measure.lean index 2c3f807ef7..6ca45c751f 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Measure.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Measure.lean @@ -15,4 +15,4 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic Import-only index for the `Measure` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Measure/GiryMonad.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Measure/GiryMonad.lean index 9c7d71fb7d..54037b4f5b 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Measure/GiryMonad.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Measure/GiryMonad.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # LeanPool.RlTheoryInLean.MeasureTheory.Measure.GiryMonad -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure ProbabilityTheory Finset NNReal ENNReal Preorder Filter diff --git a/LeanPool/RlTheoryInLean/MeasureTheory/Measure/Prod.lean b/LeanPool/RlTheoryInLean/MeasureTheory/Measure/Prod.lean index 0f20649a24..54758ca8fc 100644 --- a/LeanPool/RlTheoryInLean/MeasureTheory/Measure/Prod.lean +++ b/LeanPool/RlTheoryInLean/MeasureTheory/Measure/Prod.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # LeanPool.RlTheoryInLean.MeasureTheory.Measure.Prod -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure ProbabilityTheory Finset NNReal ENNReal Preorder Filter diff --git a/LeanPool/RlTheoryInLean/Order.lean b/LeanPool/RlTheoryInLean/Order.lean index b9bf6a58a3..c3d506329f 100644 --- a/LeanPool/RlTheoryInLean/Order.lean +++ b/LeanPool/RlTheoryInLean/Order.lean @@ -15,4 +15,4 @@ import Mathlib.Algebra.Order.Field.Basic Import-only index for the `Order` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Order/Filter.lean b/LeanPool/RlTheoryInLean/Order/Filter.lean index 2cae6cdbf2..27c918f105 100644 --- a/LeanPool/RlTheoryInLean/Order/Filter.lean +++ b/LeanPool/RlTheoryInLean/Order/Filter.lean @@ -15,4 +15,4 @@ import Mathlib.Algebra.Order.Field.Basic Import-only index for the `Filter` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean b/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean index 20cc00f4c4..5566bb4f10 100644 --- a/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean +++ b/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean @@ -17,7 +17,7 @@ import Mathlib.Order.Filter.Basic # LeanPool.RlTheoryInLean.Order.Filter.Basic -/ -@[expose] public section +public section open Finset Filter open scoped BigOperators diff --git a/LeanPool/RlTheoryInLean/Probability.lean b/LeanPool/RlTheoryInLean/Probability.lean index ce01731798..23fbf54dbf 100644 --- a/LeanPool/RlTheoryInLean/Probability.lean +++ b/LeanPool/RlTheoryInLean/Probability.lean @@ -14,4 +14,4 @@ public import LeanPool.RlTheoryInLean.Probability.MarkovChain Import-only index for the `Probability` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Probability/Kernel.lean b/LeanPool/RlTheoryInLean/Probability/Kernel.lean index e88cbedc36..fca626b25f 100644 --- a/LeanPool/RlTheoryInLean/Probability/Kernel.lean +++ b/LeanPool/RlTheoryInLean/Probability/Kernel.lean @@ -15,4 +15,4 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic Import-only index for the `Kernel` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Probability/Kernel/Basic.lean b/LeanPool/RlTheoryInLean/Probability/Kernel/Basic.lean index f23b2cbc13..ca20cdafab 100644 --- a/LeanPool/RlTheoryInLean/Probability/Kernel/Basic.lean +++ b/LeanPool/RlTheoryInLean/Probability/Kernel/Basic.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # LeanPool.RlTheoryInLean.Probability.Kernel.Basic -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure ProbabilityTheory.Kernel ProbabilityTheory open Finset Bornology NNReal ENNReal Preorder Filter @@ -23,7 +23,7 @@ variable {α β γ : Type*} variable [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] /-- Iterates of a homogeneous transition kernel. -/ -noncomputable def iter (κ : Kernel α α) : ℕ → Kernel α α +@[expose] noncomputable def iter (κ : Kernel α α) : ℕ → Kernel α α | 0 => Kernel.id | (n + 1) => ((iter κ) n).comp κ diff --git a/LeanPool/RlTheoryInLean/Probability/Kernel/Composition.lean b/LeanPool/RlTheoryInLean/Probability/Kernel/Composition.lean index 02183c5d95..13c86212df 100644 --- a/LeanPool/RlTheoryInLean/Probability/Kernel/Composition.lean +++ b/LeanPool/RlTheoryInLean/Probability/Kernel/Composition.lean @@ -14,4 +14,4 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic Import-only index for the `Composition` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Probability/Kernel/Composition/MapComap.lean b/LeanPool/RlTheoryInLean/Probability/Kernel/Composition/MapComap.lean index cacea19c5d..dbc1d79f5f 100644 --- a/LeanPool/RlTheoryInLean/Probability/Kernel/Composition/MapComap.lean +++ b/LeanPool/RlTheoryInLean/Probability/Kernel/Composition/MapComap.lean @@ -14,7 +14,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # LeanPool.RlTheoryInLean.Probability.Kernel.Composition.MapComap -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure ProbabilityTheory.Kernel ProbabilityTheory open Finset Bornology NNReal ENNReal Preorder Filter diff --git a/LeanPool/RlTheoryInLean/Probability/MarkovChain.lean b/LeanPool/RlTheoryInLean/Probability/MarkovChain.lean index 175c4ba6e1..4a790406cb 100644 --- a/LeanPool/RlTheoryInLean/Probability/MarkovChain.lean +++ b/LeanPool/RlTheoryInLean/Probability/MarkovChain.lean @@ -15,4 +15,4 @@ public import LeanPool.RlTheoryInLean.Probability.MarkovChain.Trajectory Import-only index for the `MarkovChain` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Defs.lean b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Defs.lean index e8c047bc8f..7ef2d84998 100644 --- a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Defs.lean +++ b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Defs.lean @@ -12,7 +12,7 @@ public import Mathlib.Probability.Kernel.Composition.Comp # LeanPool.RlTheoryInLean.Probability.MarkovChain.Defs -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure ProbabilityTheory.Kernel ProbabilityTheory open Finset NNReal ENNReal Preorder Function @@ -34,7 +34,7 @@ structure HomMarkovChainSpec (S : Type u) [MeasurableSpace S] where init : ProbabilityMeasure S /-- Iterates of the transition kernel of a Markov chain. -/ -noncomputable def Kernel.iter (κ : Kernel S S) : ℕ → Kernel S S +@[expose] noncomputable def Kernel.iter (κ : Kernel S S) : ℕ → Kernel S S | 0 => Kernel.id | (n + 1) => ((iter κ) n).comp κ diff --git a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite.lean b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite.lean index e21b3fa852..c5be60174c 100644 --- a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite.lean +++ b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite.lean @@ -13,4 +13,4 @@ public import LeanPool.RlTheoryInLean.Probability.MarkovChain.Finite.Defs Import-only index for the `Finite` directory of the RL-theory-in-Lean import. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite/Defs.lean b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite/Defs.lean index 32e05b1c29..a9c075bc1c 100644 --- a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite/Defs.lean +++ b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Finite/Defs.lean @@ -15,7 +15,7 @@ import Mathlib.Probability.Kernel.Composition.IntegralCompProd # LeanPool.RlTheoryInLean.Probability.MarkovChain.Finite.Defs -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure ProbabilityTheory.Kernel ProbabilityTheory open Finset NNReal ENNReal Preorder Function StochasticMatrix Filter diff --git a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean index 60299c993a..69d215bfbf 100644 --- a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean +++ b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean @@ -13,7 +13,7 @@ public import LeanPool.RlTheoryInLean.Probability.MarkovChain.Defs # LeanPool.RlTheoryInLean.Probability.MarkovChain.Trajectory -/ -@[expose] public section +public section open MeasureTheory MeasureTheory.Measure Filtration open ProbabilityTheory.Kernel diff --git a/LeanPool/RlTheoryInLean/StochasticApproximation.lean b/LeanPool/RlTheoryInLean/StochasticApproximation.lean index c0fd30f533..61bc182111 100644 --- a/LeanPool/RlTheoryInLean/StochasticApproximation.lean +++ b/LeanPool/RlTheoryInLean/StochasticApproximation.lean @@ -14,4 +14,4 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic Discrete Gronwall inequalities from the stochastic-approximation core. -/ -@[expose] public section +public section diff --git a/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean b/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean index 248c8aea66..4c04a3c54a 100644 --- a/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean +++ b/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean @@ -12,7 +12,7 @@ import Mathlib.MeasureTheory.Integral.Bochner.Basic # LeanPool.RlTheoryInLean.StochasticApproximation.DiscreteGronwall -/ -@[expose] public section +public section open Real Finset diff --git a/LeanPool/RootSystem.lean b/LeanPool/RootSystem.lean index 9bf3d17354..9363ae4278 100644 --- a/LeanPool/RootSystem.lean +++ b/LeanPool/RootSystem.lean @@ -19,7 +19,7 @@ Tags: representation-theory, root-systems, lie-theory, combinatorics MSC: 17B22, 20F55 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/RootSystem/An.lean b/LeanPool/RootSystem/An.lean index 10d4b20f26..2d82d683f9 100644 --- a/LeanPool/RootSystem/An.lean +++ b/LeanPool/RootSystem/An.lean @@ -14,7 +14,7 @@ Explicit construction of the type-`Aₙ` root pairing on the weight lattice `Fin exhibited as a crystallographic, reduced Mathlib `RootPairing`. -/ -@[expose] public section +public section namespace An @@ -236,6 +236,8 @@ theorem pairing_formula {n : ℕ} [NeZero n] (J K : SignedInterval n) : aesop; · lia; rw [← Finset.mul_sum _ _ _] + have hJ : J.i ≤ J.j := J.hij + have hK : K.i ≤ K.j := K.hij simp_all +decide [Finset.sum_add_distrib, Finset.sum_sub_distrib] grind +suggestions diff --git a/LeanPool/RootSystem/BCn.lean b/LeanPool/RootSystem/BCn.lean index 0897737c9d..a629191414 100644 --- a/LeanPool/RootSystem/BCn.lean +++ b/LeanPool/RootSystem/BCn.lean @@ -16,7 +16,7 @@ its roots as the classical type-`BCₙ` root set `{±eᵢ, ±2eᵢ, ±eᵢ ± e (`BCn.isReflective_iff_isClassicalRoot`, `BCn.range_rootPairing_root`). -/ -@[expose] public section +public section namespace BCn @@ -26,7 +26,7 @@ abbrev Space (n : ℕ) := Fin n → ℤ abbrev CoSpace (n : ℕ) := Module.Dual ℤ (Space n) /-- The standard dot product on `ℤⁿ`. -/ -noncomputable def dotProduct (n : ℕ) : Space n →ₗ[ℤ] Space n →ₗ[ℤ] ℤ where +@[expose] noncomputable def dotProduct (n : ℕ) : Space n →ₗ[ℤ] Space n →ₗ[ℤ] ℤ where toFun x := { toFun := fun y => ∑ i, x i * y i map_add' := by diff --git a/LeanPool/RungeKuttaOrderConditions.lean b/LeanPool/RungeKuttaOrderConditions.lean index 6b6aff649e..ecd21f0bf9 100644 --- a/LeanPool/RungeKuttaOrderConditions.lean +++ b/LeanPool/RungeKuttaOrderConditions.lean @@ -24,4 +24,4 @@ Tags: numerical-analysis, runge-kutta, rooted-trees, order-conditions MSC: 65L06, 65L05, 05C05 -/ -@[expose] public section +public section diff --git a/LeanPool/RungeKuttaOrderConditions/ButcherOrder.lean b/LeanPool/RungeKuttaOrderConditions/ButcherOrder.lean index 11e6cdabfd..4c76bbd424 100644 --- a/LeanPool/RungeKuttaOrderConditions/ButcherOrder.lean +++ b/LeanPool/RungeKuttaOrderConditions/ButcherOrder.lean @@ -11,9 +11,9 @@ public meta import Mathlib.Tactic.ToAdditive public meta import Mathlib.Tactic.ToDual import Mathlib.Data.Rat.Cast.Order import Mathlib.Tactic.FinCases -import Mathlib.Tactic.NormNum.Abs -import Mathlib.Tactic.NormNum.DivMod -import Mathlib.Tactic.NormNum.OfScientific +public meta import Mathlib.Tactic.NormNum.Abs +public meta import Mathlib.Tactic.NormNum.DivMod +public meta import Mathlib.Tactic.NormNum.OfScientific import Mathlib.Tactic.Ring.RingNF /-! @@ -26,7 +26,7 @@ keystone for order conditions, and verifies Euler, Heun, RK4, Dormand-Prince, and Gauss-Legendre certificates. -/ -@[expose] public section +public section namespace RungeKuttaOrderConditions @@ -152,7 +152,7 @@ abbrev Forest := List RTree -- the building blocks: • and grafting /-- The one-node rooted tree. -/ -def leaf : RTree := .node [] +@[expose] def leaf : RTree := .node [] /-- Graft a forest below a new root. -/ def graft (F : Forest) : RTree := .node F @@ -160,9 +160,9 @@ def graft (F : Forest) : RTree := .node F mutual /-- Number of vertices in a rooted tree. -/ - def order : RTree → Nat | .node F => 1 + orderF F + @[expose] def order : RTree → Nat | .node F => 1 + orderF F /-- Total number of vertices in a forest. -/ - def orderF : Forest → Nat | [] => 0 | t :: ts => order t + orderF ts + @[expose] def orderF : Forest → Nat | [] => 0 | t :: ts => order t + orderF ts end end Butcher @@ -173,9 +173,9 @@ namespace RungeKuttaOrderConditions.Butcher mutual /-- density γ(t) = |t| · ∏_children γ. γ(•)=1, γ(•–•)=2, γ(cherry)=3, γ(ladder₃)=6. -/ - def gamma : RTree → Nat | .node F => order (.node F) * gammaF F + @[expose] def gamma : RTree → Nat | .node F => order (.node F) * gammaF F /-- Product of the densities of the trees in a forest. -/ - def gammaF : Forest → Nat | [] => 1 | t :: ts => gamma t * gammaF ts + @[expose] def gammaF : Forest → Nat | [] => 1 | t :: ts => gamma t * gammaF ts end end Butcher @@ -194,18 +194,18 @@ namespace RungeKuttaOrderConditions.Butcher variable {K : Type*} [CommRing K] /-- Dot product of two coefficient vectors, truncated to the shorter length. -/ -def dot (u v : List K) : K := (List.zipWith (· * ·) u v).sum +@[expose] def dot (u v : List K) : K := (List.zipWith (· * ·) u v).sum /-- Pointwise product of two coefficient vectors, truncated to the shorter length. -/ -def pmul (u v : List K) : List K := List.zipWith (· * ·) u v +@[expose] def pmul (u v : List K) : List K := List.zipWith (· * ·) u v /-- Matrix-vector product for a list-of-rows matrix. -/ -def mulMatVec (A : List (List K)) (v : List K) : List K := A.map (fun row => dot row v) +@[expose] def mulMatVec (A : List (List K)) (v : List K) : List K := A.map (fun row => dot row v) mutual /-- Internal elementary weight vector for a rooted tree. -/ - def phiVec (A : List (List K)) : RTree → List K + @[expose] def phiVec (A : List (List K)) : RTree → List K | .node F => phiForest A F /-- ∏ over children of (A · phiVec child), pointwise; empty forest ↦ all-ones (length s). -/ - def phiForest (A : List (List K)) : Forest → List K + @[expose] def phiForest (A : List (List K)) : Forest → List K | [] => A.map (fun _ => 1) | t :: ts => pmul (mulMatVec A (phiVec A t)) (phiForest A ts) end @@ -218,7 +218,7 @@ namespace RungeKuttaOrderConditions.Butcher variable {K : Type*} [CommRing K] /-- elementary weight Φ(t) = bᵀ·g(t). -/ -def Phi (A : List (List K)) (b : List K) (t : RTree) : K := dot b (phiVec A t) +@[expose] def Phi (A : List (List K)) (b : List K) (t : RTree) : K := dot b (phiVec A t) /-- the order condition at a single tree, in MULTIPLICATIVE form `γ(t)·Φ(t) = 1` (iff Φ(t)=1/γ(t) since γ(t) ≥ 1); stated this way it needs only a commutative @@ -230,44 +230,44 @@ abbrev orderCond (A : List (List K)) (b : List K) (t : RTree) : Prop := -- explicit Forester sugar /-- The unique tree of order 1. -/ -def t1 : RTree := leaf -- • |t|=1 γ=1 +@[expose] def t1 : RTree := leaf -- • |t|=1 γ=1 /-- The ladder tree of order 2. -/ -def t2 : RTree := .node [leaf] -- •–• |t|=2 γ=2 +@[expose] def t2 : RTree := .node [leaf] -- •–• |t|=2 γ=2 /-- The two-leaf cherry tree of order 3. -/ -def t31 : RTree := .node [leaf, leaf] -- cherry |t|=3 γ=3 +@[expose] def t31 : RTree := .node [leaf, leaf] -- cherry |t|=3 γ=3 /-- The ladder tree of order 3. -/ -def t32 : RTree := .node [.node [leaf]] -- ladder₃ |t|=3 γ=6 +@[expose] def t32 : RTree := .node [.node [leaf]] -- ladder₃ |t|=3 γ=6 -- order 4 /-- The four-vertex bushy tree. -/ -def t41 : RTree := .node [leaf, leaf, leaf] -- γ=4 +@[expose] def t41 : RTree := .node [leaf, leaf, leaf] -- γ=4 /-- A mixed order-4 tree with one leaf and one order-2 child. -/ -def t42 : RTree := .node [leaf, .node [leaf]] -- γ=8 +@[expose] def t42 : RTree := .node [leaf, .node [leaf]] -- γ=8 /-- The order-4 tree with a cherry child. -/ -def t43 : RTree := .node [.node [leaf, leaf]] -- γ=12 +@[expose] def t43 : RTree := .node [.node [leaf, leaf]] -- γ=12 /-- The ladder tree of order 4. -/ -def t44 : RTree := .node [.node [.node [leaf]]] -- ladder₄ γ=24 +@[expose] def t44 : RTree := .node [.node [.node [leaf]]] -- ladder₄ γ=24 -- one order-5 tree (to witness RK4 is NOT order 5) /-- The five-vertex bushy tree used to witness RK4's order-5 failure. -/ -def t5bushy : RTree := .node [leaf, leaf, leaf, leaf] -- γ=5 +@[expose] def t5bushy : RTree := .node [leaf, leaf, leaf, leaf] -- γ=5 /-- Stage matrix for the Euler method. -/ -def eulerA : List (List ℚ) := [[0]] +@[expose] def eulerA : List (List ℚ) := [[0]] /-- Weights for the Euler method. -/ -def eulerB : List ℚ := [1] +@[expose] def eulerB : List ℚ := [1] /-- Stage matrix for Heun's explicit trapezoid method. -/ -def heunA : List (List ℚ) := [[0,0],[1,0]] +@[expose] def heunA : List (List ℚ) := [[0,0],[1,0]] /-- Weights for Heun's explicit trapezoid method. -/ -def heunB : List ℚ := [1/2, 1/2] +@[expose] def heunB : List ℚ := [1/2, 1/2] /-- Stage matrix for the classical four-stage Runge-Kutta method. -/ -def rk4A : List (List ℚ) := [[0,0,0,0],[1/2,0,0,0],[0,1/2,0,0],[0,0,1,0]] +@[expose] def rk4A : List (List ℚ) := [[0,0,0,0],[1/2,0,0,0],[0,1/2,0,0],[0,0,1,0]] /-- Weights for the classical four-stage Runge-Kutta method. -/ -def rk4B : List ℚ := [1/6, 1/3, 1/3, 1/6] +@[expose] def rk4B : List ℚ := [1/6, 1/3, 1/3, 1/6] -- Dormand–Prince RK45 (DOPRI5): 7 stages (FSAL), the 5th-order solution weights. /-- Stage matrix for the Dormand-Prince RK45 method. -/ -def dpA : List (List ℚ) := +@[expose] def dpA : List (List ℚ) := [[0,0,0,0,0,0,0], [1/5,0,0,0,0,0,0], [3/40,9/40,0,0,0,0,0], @@ -276,17 +276,17 @@ def dpA : List (List ℚ) := [9017/3168,-355/33,46732/5247,49/176,-5103/18656,0,0], [35/384,0,500/1113,125/192,-2187/6784,11/84,0]] /-- Fifth-order solution weights for the Dormand-Prince RK45 method. -/ -def dpB : List ℚ := [35/384, 0, 500/1113, 125/192, -2187/6784, 11/84, 0] +@[expose] def dpB : List ℚ := [35/384, 0, 500/1113, 125/192, -2187/6784, 11/84, 0] -- Gauss–Legendre s=3 (order 6), fully implicit, with coefficients in ℚ(√15): -- ⟨a,b⟩ = a + b·√15. /-- Stage matrix for the three-stage Gauss-Legendre method over ℚ(√15). -/ -def gaussA : List (List Q15) := +@[expose] def gaussA : List (List Q15) := [[⟨5/36, 0⟩, ⟨2/9, -1/15⟩, ⟨5/36, -1/30⟩], [⟨5/36, 1/24⟩, ⟨2/9, 0⟩, ⟨5/36, -1/24⟩], [⟨5/36, 1/30⟩, ⟨2/9, 1/15⟩, ⟨5/36, 0⟩]] /-- Weights for the three-stage Gauss-Legendre method over ℚ(√15). -/ -def gaussB : List Q15 := [⟨5/18, 0⟩, ⟨4/9, 0⟩, ⟨5/18, 0⟩] +@[expose] def gaussB : List Q15 := [⟨5/18, 0⟩, ⟨4/9, 0⟩, ⟨5/18, 0⟩] /-- discharge a Q15 order condition: unfold the engine + cast, split into ℚ components, `norm_num`. -/ diff --git a/LeanPool/RungeKuttaOrderConditions/CheckerExamples.lean b/LeanPool/RungeKuttaOrderConditions/CheckerExamples.lean new file mode 100644 index 0000000000..50365dcd77 --- /dev/null +++ b/LeanPool/RungeKuttaOrderConditions/CheckerExamples.lean @@ -0,0 +1,25 @@ +/- +Copyright (c) 2026 Lean Pool contributors. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Lean Pool contributors +-/ +module + +import LeanPool.RungeKuttaOrderConditions.ButcherOrder + +/-! +# Imported Runge-Kutta checker examples + +These examples exercise the public computational definitions and tactic implementations +from a separate module, where only the exported interface is available. +-/ + +open RungeKuttaOrderConditions.Butcher + +example : orderCond eulerA eulerB t1 := by butcherCheck +example : orderCond heunA heunB t2 := by butcherCheck +example : orderCond rk4A rk4B t44 := by butcherCheck +example : orderCond dpA dpB t5bushy := by butcherCheck +example : orderCond gaussA gaussB t1 := by gaussCheck +example : orderCond gaussA gaussB t2 := by gaussCheck +example : order leaf = 1 := by decide +kernel diff --git a/LeanPool/Rupert.lean b/LeanPool/Rupert.lean index d85187d443..b2efe937af 100644 --- a/LeanPool/Rupert.lean +++ b/LeanPool/Rupert.lean @@ -34,4 +34,4 @@ Tags: convex-geometry, polyhedra, rupert-problem MSC: 52B10, 52A15 -/ -@[expose] public section +public section diff --git a/LeanPool/Rupert/Affine.lean b/LeanPool/Rupert/Affine.lean index 1d5fa87520..a24ac52a65 100644 --- a/LeanPool/Rupert/Affine.lean +++ b/LeanPool/Rupert/Affine.lean @@ -13,7 +13,7 @@ public import Mathlib.Geometry.Euclidean.Projection Imported Lean Pool material for `LeanPool.Rupert.Affine`. -/ -@[expose] public section +public section /-- The Rupert Property for a pair of subsets X, Y of an arbitrary finite-dimensional real affine space P. X has the Rupert property diff --git a/LeanPool/Rupert/Attr.lean b/LeanPool/Rupert/Attr.lean index b4bc126781..d18113c4d1 100644 --- a/LeanPool/Rupert/Attr.lean +++ b/LeanPool/Rupert/Attr.lean @@ -15,7 +15,7 @@ import Lean.Meta.Tactic.Simp.RegisterCommand Imported Lean Pool material for `LeanPool.Rupert.Attr`. -/ -@[expose] public section +public section /-- Simp set for evaluating concrete matrices in Rupert certificates. -/ register_simp_attr matrix_simps diff --git a/LeanPool/Rupert/Basic.lean b/LeanPool/Rupert/Basic.lean index 525eaa9d64..551e70ae1c 100644 --- a/LeanPool/Rupert/Basic.lean +++ b/LeanPool/Rupert/Basic.lean @@ -13,7 +13,7 @@ public import Mathlib.Analysis.InnerProductSpace.PiL2 Imported Lean Pool material for `LeanPool.Rupert.Basic`. -/ -@[expose] public section +public section open scoped Matrix @@ -29,11 +29,11 @@ abbrev E (n : ℕ) := EuclideanSpace ℝ (Fin n) abbrev SO3 := Matrix.specialOrthogonalGroup (Fin 3) ℝ /-- Projects a vector from 3-space to 2-space by dropping the third coordinate. -/ -def projXy {k : Type} (v : EuclideanSpace k (Fin 3)) : EuclideanSpace k (Fin 2) := +@[expose] def projXy {k : Type} (v : EuclideanSpace k (Fin 3)) : EuclideanSpace k (Fin 2) := !₂[v 0, v 1] /-- The Rupert Property for a convex polyhedron given as an indexed finite set of vertices. -/ -def IsRupert {ι : Type} (vertices : ι → ℝ³) : Prop := +@[expose] def IsRupert {ι : Type} (vertices : ι → ℝ³) : Prop := ∃ innerRotation ∈ SO3, ∃ innerOffset : ℝ², ∃ outerRotation ∈ SO3, let hull := convexHull ℝ { vertices i | i } let inner_shadow := { innerOffset + projXy (innerRotation.toEuclideanLin p) | p ∈ hull } @@ -42,7 +42,7 @@ def IsRupert {ι : Type} (vertices : ι → ℝ³) : Prop := /-- Alternate formulation of the Rupert Property. This is equivalent to IsRupert and should be easier to prove. -/ -def IsRupert' {ι : Type} (vertices : ι → ℝ³) : Prop := +@[expose] def IsRupert' {ι : Type} (vertices : ι → ℝ³) : Prop := ∃ innerRotation ∈ SO3, ∃ innerOffset : ℝ², ∃ outerRotation ∈ SO3, let inner_shadow := { innerOffset + projXy (innerRotation.toEuclideanLin (vertices i)) | i } let outerShadow := { projXy (outerRotation.toEuclideanLin (vertices i)) | i } diff --git a/LeanPool/Rupert/Convex.lean b/LeanPool/Rupert/Convex.lean index f8e047b59b..dc3126a153 100644 --- a/LeanPool/Rupert/Convex.lean +++ b/LeanPool/Rupert/Convex.lean @@ -14,7 +14,7 @@ import Mathlib.Algebra.Order.Star.Real Imported Lean Pool material for `LeanPool.Rupert.Convex`. -/ -@[expose] public section +public section open Pointwise diff --git a/LeanPool/Rupert/Cube.lean b/LeanPool/Rupert/Cube.lean index a1afd1faac..b7cc7d6156 100644 --- a/LeanPool/Rupert/Cube.lean +++ b/LeanPool/Rupert/Cube.lean @@ -16,7 +16,7 @@ import LeanPool.Rupert.MatrixSimps Imported Lean Pool material for `LeanPool.Rupert.Cube`. -/ -@[expose] public section +public section namespace Cube open Matrix diff --git a/LeanPool/Rupert/Equivalences/AffineRupertEquivRupertSet.lean b/LeanPool/Rupert/Equivalences/AffineRupertEquivRupertSet.lean index 3ada1278a1..b8b8e4901b 100644 --- a/LeanPool/Rupert/Equivalences/AffineRupertEquivRupertSet.lean +++ b/LeanPool/Rupert/Equivalences/AffineRupertEquivRupertSet.lean @@ -20,4 +20,4 @@ import Mathlib.Tactic.NormNum.GCD Imported Lean Pool material for `LeanPool.Rupert.Equivalences.AffineRupertEquivRupertSet`. -/ -@[expose] public section +public section diff --git a/LeanPool/Rupert/Equivalences/RupertEquivRupertPrime.lean b/LeanPool/Rupert/Equivalences/RupertEquivRupertPrime.lean index 72f33eb034..d51931587c 100644 --- a/LeanPool/Rupert/Equivalences/RupertEquivRupertPrime.lean +++ b/LeanPool/Rupert/Equivalences/RupertEquivRupertPrime.lean @@ -14,7 +14,7 @@ import LeanPool.Rupert.Equivalences.Util Imported Lean Pool material for `LeanPool.Rupert.Equivalences.RupertEquivRupertPrime`. -/ -@[expose] public section +public section open Matrix theorem rupert'_imp_rupert {ι : Type} (v : ι → ℝ³) : IsRupert' v → IsRupert v := by diff --git a/LeanPool/Rupert/Equivalences/RupertEquivRupertSet.lean b/LeanPool/Rupert/Equivalences/RupertEquivRupertSet.lean index a16706874d..7175b53b6d 100644 --- a/LeanPool/Rupert/Equivalences/RupertEquivRupertSet.lean +++ b/LeanPool/Rupert/Equivalences/RupertEquivRupertSet.lean @@ -14,7 +14,7 @@ import LeanPool.Rupert.Equivalences.Util Imported Lean Pool material for `LeanPool.Rupert.Equivalences.RupertEquivRupertSet`. -/ -@[expose] public section +public section open Matrix theorem rupert_imp_rupert_set {ι : Type} [Finite ι] (v : ι → ℝ³) : diff --git a/LeanPool/Rupert/Equivalences/Util.lean b/LeanPool/Rupert/Equivalences/Util.lean index c0e0305eb1..ccd0df8b30 100644 --- a/LeanPool/Rupert/Equivalences/Util.lean +++ b/LeanPool/Rupert/Equivalences/Util.lean @@ -16,12 +16,12 @@ import Mathlib.Algebra.Order.Archimedean.Real.Hom Imported Lean Pool material for `LeanPool.Rupert.Equivalences.Util`. -/ -@[expose] public section +public section open Pointwise open Matrix /-- Projecting from ℝ³ to ℝ² is linear -/ -noncomputable +@[expose] noncomputable def projXyLinear : ℝ³ →ₗ[ℝ] ℝ² := { toFun := projXy, @@ -34,22 +34,19 @@ def projXyLinear : ℝ³ →ₗ[ℝ] ℝ² := } /-- Rotation by an element of `SO3`, viewed as an affine map. -/ -noncomputable +@[expose] noncomputable def rotationAffine (rot : SO3) : ℝ³ →ᵃ[ℝ] ℝ³ := (Matrix.toEuclideanLin rot).toAffineMap /-- Translating is affine. -/ -noncomputable -def offsetAffine (off : E 2) : ℝ² →ᵃ[ℝ] ℝ² := +@[expose] noncomputable def offsetAffine (off : E 2) : ℝ² →ᵃ[ℝ] ℝ² := {toFun v := off + v, linear := LinearMap.id, map_vadd' p v := add_vadd_comm v off p } /-- Projection of a rotated point onto the xy-plane, as an affine map. -/ -noncomputable -def projXyRotationIsAffine (rot : SO3) : ℝ³ →ᵃ[ℝ] ℝ² := +@[expose] noncomputable def projXyRotationIsAffine (rot : SO3) : ℝ³ →ᵃ[ℝ] ℝ² := AffineMap.comp projXyLinear.toAffineMap (rotationAffine rot) /-- Full affine transform used for projected Rupert shadows. -/ -noncomputable -def fullTransformAffine (off : E 2) (rot : SO3) : ℝ³ →ᵃ[ℝ] ℝ² := +@[expose] noncomputable def fullTransformAffine (off : E 2) (rot : SO3) : ℝ³ →ᵃ[ℝ] ℝ² := AffineMap.comp (offsetAffine off) (projXyRotationIsAffine rot) proof_wanted affine_rupert_iff_rupert_set diff --git a/LeanPool/Rupert/FinCases.lean b/LeanPool/Rupert/FinCases.lean index fc33613057..fb2242a75d 100644 --- a/LeanPool/Rupert/FinCases.lean +++ b/LeanPool/Rupert/FinCases.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.FinCases Imported Lean Pool material for `LeanPool.Rupert.FinCases`. -/ -@[expose] public section +public section /-- Lemma for helping with goals such as diff --git a/LeanPool/Rupert/Icosahedron.lean b/LeanPool/Rupert/Icosahedron.lean index d62b7a831b..ade825c960 100644 --- a/LeanPool/Rupert/Icosahedron.lean +++ b/LeanPool/Rupert/Icosahedron.lean @@ -14,7 +14,7 @@ public import LeanPool.Rupert.Basic Imported Lean Pool material for `LeanPool.Rupert.Icosahedron`. -/ -@[expose] public section +public section namespace Icosahedron diff --git a/LeanPool/Rupert/MatrixSimps.lean b/LeanPool/Rupert/MatrixSimps.lean index 022cb5bcbf..312237c6fc 100644 --- a/LeanPool/Rupert/MatrixSimps.lean +++ b/LeanPool/Rupert/MatrixSimps.lean @@ -15,7 +15,7 @@ import LeanPool.Rupert.Attr Imported Lean Pool material for `LeanPool.Rupert.MatrixSimps`. -/ -@[expose] public section +public section /-- Reduce natural additions in concrete matrix expressions. -/ dsimproc_decl matrixReduceNatAdd ((_ + _ : Nat)) := Nat.reduceAdd diff --git a/LeanPool/Rupert/Quaternion.lean b/LeanPool/Rupert/Quaternion.lean index 23f789b794..f8289ee818 100644 --- a/LeanPool/Rupert/Quaternion.lean +++ b/LeanPool/Rupert/Quaternion.lean @@ -15,10 +15,10 @@ public import LeanPool.Rupert.Basic Imported Lean Pool material for `LeanPool.Rupert.Quaternion`. -/ -@[expose] public section +public section /-- Converts a quaternion to a normalized rotation matrix. -/ -def matrixOfQuat {R : Type} [Field R] (q : Quaternion R) +@[expose] def matrixOfQuat {R : Type} [Field R] (q : Quaternion R) : Matrix (Fin 3) (Fin 3) R := let ⟨w, x, y, z⟩ := q let normsq := w^2 + x^2 + y^2 + z^2 diff --git a/LeanPool/Rupert/Set.lean b/LeanPool/Rupert/Set.lean index 6a1de84dee..a5dd52952c 100644 --- a/LeanPool/Rupert/Set.lean +++ b/LeanPool/Rupert/Set.lean @@ -13,7 +13,7 @@ public import LeanPool.Rupert.Basic Imported Lean Pool material for `LeanPool.Rupert.Set`. -/ -@[expose] public section +public section open scoped Matrix @@ -23,7 +23,7 @@ open scoped Matrix transformations. By "comfortably" we mean the closure of one set is a subset of the interior of the other. This definition rules out trivial cases of a set fitting inside itself. -/ -def IsRupertPair (inner outer : Set ℝ³) : Prop := +@[expose] def IsRupertPair (inner outer : Set ℝ³) : Prop := ∃ innerRot ∈ SO3, ∃ innerOffset : ℝ², ∃ outerRot ∈ SO3, let inner_shadow := { innerOffset + projXy (innerRot.toEuclideanLin p) | p ∈ inner } let outerShadow := { projXy (outerRot.toEuclideanLin p) | p ∈ outer } @@ -32,4 +32,4 @@ def IsRupertPair (inner outer : Set ℝ³) : Prop := /-- The Rupert Property for a subset S of ℝ³. S has the Rupert property if there are rotations and translations such that one 2-dimensional "shadow" of S can be made to fit entirely inside the interior of another such "shadow". -/ -def IsRupertSet (S : Set ℝ³) : Prop := IsRupertPair S S +@[expose] def IsRupertSet (S : Set ℝ³) : Prop := IsRupertPair S S diff --git a/LeanPool/Rupert/SnubCube.lean b/LeanPool/Rupert/SnubCube.lean index 3f50c5a664..1b9e2e321e 100644 --- a/LeanPool/Rupert/SnubCube.lean +++ b/LeanPool/Rupert/SnubCube.lean @@ -13,7 +13,7 @@ public import LeanPool.Rupert.Basic Imported Lean Pool material for `LeanPool.Rupert.SnubCube`. -/ -@[expose] public section +public section namespace SnubCube diff --git a/LeanPool/Rupert/Square.lean b/LeanPool/Rupert/Square.lean index 17111a2a08..f708686efe 100644 --- a/LeanPool/Rupert/Square.lean +++ b/LeanPool/Rupert/Square.lean @@ -15,7 +15,7 @@ import LeanPool.Rupert.Equivalences.RupertEquivRupertPrime Imported Lean Pool material for `LeanPool.Rupert.Square`. -/ -@[expose] public section +public section namespace Square diff --git a/LeanPool/Rupert/Tetrahedron.lean b/LeanPool/Rupert/Tetrahedron.lean index 0dcbfd94e0..eafa2a7987 100644 --- a/LeanPool/Rupert/Tetrahedron.lean +++ b/LeanPool/Rupert/Tetrahedron.lean @@ -17,7 +17,7 @@ import LeanPool.Rupert.MatrixSimps Imported Lean Pool material for `LeanPool.Rupert.Tetrahedron`. -/ -@[expose] public section +public section namespace Tetrahedron diff --git a/LeanPool/Rupert/TriakisTetrahedron.lean b/LeanPool/Rupert/TriakisTetrahedron.lean index 75d4f6d09a..fb3418033d 100644 --- a/LeanPool/Rupert/TriakisTetrahedron.lean +++ b/LeanPool/Rupert/TriakisTetrahedron.lean @@ -18,7 +18,7 @@ import LeanPool.Rupert.MatrixSimps Imported Lean Pool material for `LeanPool.Rupert.TriakisTetrahedron`. -/ -@[expose] public section +public section namespace TriakisTetrahedron diff --git a/LeanPool/Sabidussi.lean b/LeanPool/Sabidussi.lean index c6069bc949..0261fedab9 100644 --- a/LeanPool/Sabidussi.lean +++ b/LeanPool/Sabidussi.lean @@ -30,4 +30,4 @@ Tags: graph-theory, eulerian-graphs, circuit-decomposition, sabidussi MSC: 05C45 -/ -@[expose] public section +public section diff --git a/LeanPool/Sabidussi/Color.lean b/LeanPool/Sabidussi/Color.lean index d640ce9a6b..d37eda8aa3 100644 --- a/LeanPool/Sabidussi/Color.lean +++ b/LeanPool/Sabidussi/Color.lean @@ -21,7 +21,7 @@ This file contains the elementary algebra over `F₂²` used by the proof. We us product so that the three admissible local frames can be given by concrete formulas. -/ -@[expose] public section +public section namespace Sabidussi @@ -46,10 +46,10 @@ theorem F₂_add_shuffle (a b : F₂) : a + (b + (a + b)) = 0 := by _ = 0 := by simp /-- The alternating form polarizing `quadratic`. -/ -def bracket (x y : Color) : F₂ := x.1 * y.2 + x.2 * y.1 +@[expose] def bracket (x y : Color) : F₂ := x.1 * y.2 + x.2 * y.1 /-- The quadratic form detecting the colour `(1, 1)`. -/ -def quadratic (x : Color) : F₂ := x.1 * x.2 +@[expose] def quadratic (x : Color) : F₂ := x.1 * x.2 @[simp] theorem bracket_apply (x y : Color) : bracket x y = x.1 * y.2 + x.2 * y.1 := rfl @@ -74,7 +74,7 @@ theorem bracket_add_right (x y z : Color) : ring /-- Bracketing with a fixed left argument, as an additive homomorphism. -/ -def bracketRightHom (x : Color) : Color →+ F₂ where +@[expose] def bracketRightHom (x : Color) : Color →+ F₂ where toFun := bracket x map_zero' := bracket_zero_right x map_add' := bracket_add_right x @@ -99,7 +99,7 @@ theorem quadratic_add (x y : Color) : ring /-- The three locally admissible difference vectors at a 6-valent vertex. -/ -def tripleDifference (t : Color) : Fin 3 → Color +@[expose] def tripleDifference (t : Color) : Fin 3 → Color | ⟨0, _⟩ => t | ⟨1, _⟩ => (t.2, t.1 + t.2) | ⟨2, _⟩ => (t.1 + t.2, t.1) @@ -144,7 +144,7 @@ theorem tripleDifference_ne_zero (t : Color) (ht : t ≠ 0) (i : Fin 3) : · simpa [h₁] using hsum /-- At a 4-valent vertex the two local differences coincide. -/ -def doubleDifference (t : Color) : Fin 2 → Color +@[expose] def doubleDifference (t : Color) : Fin 2 → Color | ⟨0, _⟩ => t | ⟨1, _⟩ => t diff --git a/LeanPool/Sabidussi/CyclicWord.lean b/LeanPool/Sabidussi/CyclicWord.lean index 9c2890aec9..2ca4d935da 100644 --- a/LeanPool/Sabidussi/CyclicWord.lean +++ b/LeanPool/Sabidussi/CyclicWord.lean @@ -28,7 +28,7 @@ the local patterns from `LocalPattern` and the odd balancing theorem produce col such that adjacent gaps have different colours and every colour occurs evenly at each letter. -/ -@[expose] public section +public section namespace Sabidussi namespace CyclicWord @@ -52,6 +52,7 @@ variable (W : Word (V := V)) abbrev Pos := Fin (W.n + 1) /-- The position immediately preceding `i`, cyclically. -/ +@[expose] def prev (i : W.Pos) : W.Pos := (finRotate (W.n + 1)).symm i /-- Occurrences of a letter. -/ @@ -61,6 +62,7 @@ instance (v : V) : Fintype (W.Occurrence v) := Subtype.fintype fun i : W.Pos ↦ W.letter i = v /-- The two gap colours incident with an occurrence. -/ +@[expose] def incidentColor (x : W.Pos → Color) {v : V} (o : W.Occurrence v) (s : Fin 2) : Color := if s = 0 then x (W.prev o.1) else x o.1 diff --git a/LeanPool/Sabidussi/LocalPattern.lean b/LeanPool/Sabidussi/LocalPattern.lean index c47348ae74..c091d132aa 100644 --- a/LeanPool/Sabidussi/LocalPattern.lean +++ b/LeanPool/Sabidussi/LocalPattern.lean @@ -22,7 +22,7 @@ The construction is the degree-splitting step of the manuscript written without graph: remove pairs of occurrences recursively, ending with a pair or a triple. -/ -@[expose] public section +public section namespace Sabidussi @@ -46,6 +46,7 @@ theorem sum_tripleDifference_choice (i : Fin 3) : /-- Three local patterns on `n + 2` occurrences. For `2` occurrences the difference is constant; for `3` it is the anisotropic triple; every additional pair receives the same nonzero colour and is then removed recursively. -/ +@[expose] def localDifference : (n : ℕ) → Fin 3 → Fin (n + 2) → Color | 0, c => doubleDifference (choiceColor c) | 1, c => tripleDifference (choiceColor c) diff --git a/LeanPool/Sabidussi/LoopGraphBridge.lean b/LeanPool/Sabidussi/LoopGraphBridge.lean index 9f30ad2e96..db3ad474b8 100644 --- a/LeanPool/Sabidussi/LoopGraphBridge.lean +++ b/LeanPool/Sabidussi/LoopGraphBridge.lean @@ -22,7 +22,7 @@ zero denotes the preceding gap, while Euler-tour side zero denotes the current d half-edge; the bridge therefore precomposes occurrence sides with `Fin.rev`. -/ -@[expose] public section +public section namespace Sabidussi namespace LoopMultigraph @@ -34,6 +34,7 @@ variable {V E : Type*} [Fintype V] [Fintype E] [DecidableEq V] [DecidableEq E] {G : LoopMultigraph V E} /-- The cyclic transition word read from an Euler tour. -/ +@[expose] def EulerTour.eulerWord (T : G.EulerTour) : Sabidussi.CyclicWord.Word (V := V) where n := T.n letter := T.vertexAt @@ -70,10 +71,13 @@ theorem incidentColor_eq_halfEdgeColor x (T.edge.symm ((T.wordOccurrenceSideEquivHalfEdgesAt v os).1.1)) := by rcases os with ⟨o, s⟩ fin_cases s - · change x (T.prev o.1) = x (T.edge.symm (T.edge (T.prev o.1))) + · change x (T.prev o.1) = + x (T.edge.symm (T.occurrenceSideEquivHalfEdgesAt v (o, 1)).1.1) + rw [T.occurrenceSideEquivHalfEdgesAt_edge] + simp + · change x o.1 = x (T.edge.symm (T.occurrenceSideEquivHalfEdgesAt v (o, 0)).1.1) + rw [T.occurrenceSideEquivHalfEdgesAt_edge] simp - · change x o.1 = x (T.edge.symm (T.edge o.1)) - exact (congrArg x (T.edge.symm_apply_apply (show T.Pos from o.1))).symm /-- The coloured occurrence sides of the word and the correspondingly coloured half-edges at a vertex are equinumerous. -/ diff --git a/LeanPool/Sabidussi/LoopMultigraph.lean b/LeanPool/Sabidussi/LoopMultigraph.lean index b67085ed65..f8327a06fd 100644 --- a/LeanPool/Sabidussi/LoopMultigraph.lean +++ b/LeanPool/Sabidussi/LoopMultigraph.lean @@ -21,7 +21,7 @@ are represented without quotienting or special cases. Degree and parity always incidences; consequently a loop contributes two incidences at its vertex. -/ -@[expose] public section +public section namespace Sabidussi @@ -150,6 +150,14 @@ def occurrenceSideEquivHalfEdgesAt (v : V) : T.Occurrence v × Fin 2 ≃ G.halfE change T.vertexAt p.1 = v ↔ G.vertex (T.positionSideToHalfEdge p) = v rw [T.vertex_positionSideToHalfEdge p]) +omit [DecidableEq V] in +/-- The edge underlying an occurrence side is the current or preceding tour edge. -/ +theorem occurrenceSideEquivHalfEdgesAt_edge (v : V) (os : T.Occurrence v × Fin 2) : + (T.occurrenceSideEquivHalfEdgesAt v os).1.1 = + if os.2 = 0 then T.edge os.1.1 else T.edge (T.prev os.1.1) := by + rcases os with ⟨o, s⟩ + fin_cases s <;> rfl + /-- The degree at `v` is twice its number of occurrences in the transition word. -/ theorem degree_eq_two_mul_card_occurrence (v : V) : G.degree v = 2 * Fintype.card (T.Occurrence v) := by @@ -162,11 +170,12 @@ variable {V E : Type*} [Fintype V] [Fintype E] [DecidableEq V] [DecidableEq E] (G : LoopMultigraph V E) /-- The incidence indicator of an edge at a vertex, with both edge ends counted. -/ -def edgeIncidence (v : V) (e : E) : F₂ := +@[expose] def edgeIncidence (v : V) (e : E) : F₂ := (if G.endAt e 0 = v then 1 else 0) + (if G.endAt e 1 = v then 1 else 0) /-- An edge set is even when every vertex has even degree in the induced multigraph. -/ +@[expose] def IsEvenEdgeSet (F : Finset E) : Prop := ∀ v : V, ∑ e ∈ F, G.edgeIncidence v e = 0 @@ -268,6 +277,7 @@ structure CircuitDecomposition where /-- A circuit decomposition is compatible with an Euler tour when no one circuit contains both edge objects of a transition. -/ +@[expose] def CircuitDecomposition.Compatible {G : LoopMultigraph V E} (S : G.CircuitDecomposition) (T : G.EulerTour) : Prop := ∀ (i : T.Pos) (C : G.Cycle), C ∈ S.circuits → diff --git a/LeanPool/Sabidussi/OddBalance.lean b/LeanPool/Sabidussi/OddBalance.lean index bfa99fdc89..4a29478f02 100644 --- a/LeanPool/Sabidussi/OddBalance.lean +++ b/LeanPool/Sabidussi/OddBalance.lean @@ -24,7 +24,7 @@ modulo two, expands the count over choices of partner vertices, and cancels the derangement contributions in pairs. -/ -@[expose] public section +public section open scoped BigOperators open Finset @@ -51,6 +51,7 @@ variable {V : Type*} [Fintype V] [DecidableEq V] /-- The interaction obstruction at a vertex `v`: the sum over all other vertices `u` of the pairwise interaction of the chosen frames at `v` and `u`. -/ +@[expose] def obstruction (b : V → V → Fin 3 → Fin 3 → F2) (x : V → Fin 3) (v : V) : F2 := ∑ u ∈ Finset.univ.erase v, b v u (x v) (x u) @@ -290,7 +291,7 @@ lemma totalChoiceTerm_eq_zero_of_twoCycle rw [hrow, zero_mul] /-- A derangement of the vertices of `S`: a fixed-point-free permutation. -/ -def Derangement (S : Finset V) := +@[expose] def Derangement (S : Finset V) := {σ : Equiv.Perm {v // v ∈ S} // ∀ v, σ v ≠ v} noncomputable instance Derangement.instFintype (S : Finset V) : Fintype (Derangement S) := @@ -377,7 +378,7 @@ lemma totalChoiceTerm_eq_zero_of_derangement_inv_eq_self _ = d.1 v₀ := rfl /-- A choice of partners whose image covers every vertex of `S`. -/ -def CoveredChoice (S : Finset V) := +@[expose] def CoveredChoice (S : Finset V) := {f : Choice S // ∀ w : {w // w ∈ S}, ∃ v, (f v : V) = w} noncomputable instance CoveredChoice.instFintype (S : Finset V) : diff --git a/LeanPool/Sabidussi/OrdinaryCircuit.lean b/LeanPool/Sabidussi/OrdinaryCircuit.lean index 42d16846d1..be91e0e1e1 100644 --- a/LeanPool/Sabidussi/OrdinaryCircuit.lean +++ b/LeanPool/Sabidussi/OrdinaryCircuit.lean @@ -19,7 +19,7 @@ of chains of incident labelled edges; in particular it does not mention parity o Loops and parallel edges need no exceptional representation. -/ -@[expose] public section +public section namespace Sabidussi namespace LoopMultigraph @@ -394,7 +394,7 @@ def Cycle.toOrdinaryCircuit (C : G.Cycle) : G.OrdinaryCircuit where omit [DecidableEq E] in @[simp] theorem Cycle.toOrdinaryCircuit_edges (C : G.Cycle) : - C.toOrdinaryCircuit.edges = C.edges := rfl + C.toOrdinaryCircuit.edges = C.edges := by rfl omit [DecidableEq E] in /-- An ordinary circuit is an even edge set (including the singleton-loop case). -/ diff --git a/LeanPool/Sabidussi/Parity.lean b/LeanPool/Sabidussi/Parity.lean index ae3944914e..4537e71f79 100644 --- a/LeanPool/Sabidussi/Parity.lean +++ b/LeanPool/Sabidussi/Parity.lean @@ -22,7 +22,7 @@ have been balanced: polarization of the quadratic form along an ordered word, an the parity of all four colour classes from its linear and quadratic moments. -/ -@[expose] public section +public section namespace Sabidussi @@ -86,7 +86,7 @@ theorem quadratic_sum_fin : ∀ {n : ℕ} (f : Fin n → Color), abel /-- The positions carrying a specified colour. -/ -def colorFiber {I : Type*} [Fintype I] (f : I → Color) (c : Color) : +@[expose] def colorFiber {I : Type*} [Fintype I] (f : I → Color) (c : Color) : Finset I := Finset.univ.filter fun i ↦ f i = c diff --git a/LeanPool/Sabidussi/Statement.lean b/LeanPool/Sabidussi/Statement.lean index 6cfc9e0e98..277a3005cc 100644 --- a/LeanPool/Sabidussi/Statement.lean +++ b/LeanPool/Sabidussi/Statement.lean @@ -16,7 +16,7 @@ the trusted import boundary for `leanprover/comparator`; proof modules build on import them. -/ -@[expose] public section +public section namespace Sabidussi @@ -33,16 +33,17 @@ variable {V E : Type*} [Fintype V] [Fintype E] [DecidableEq V] abbrev HalfEdge (E : Type*) := E × Fin 2 /-- The endpoint vertex of a half-edge. -/ -def vertex (G : LoopMultigraph V E) (h : HalfEdge E) : V := G.endAt h.1 h.2 +@[expose] def vertex (G : LoopMultigraph V E) (h : HalfEdge E) : V := G.endAt h.1 h.2 /-- Half-edges incident with a vertex. A loop contributes both of its numbered ends. -/ -def halfEdgesAt (G : LoopMultigraph V E) (v : V) := +@[expose] def halfEdgesAt (G : LoopMultigraph V E) (v : V) := {h : HalfEdge E // G.vertex h = v} instance (G : LoopMultigraph V E) (v : V) : Fintype (G.halfEdgesAt v) := Subtype.fintype fun h : HalfEdge E ↦ G.vertex h = v /-- Degree counted in half-edge incidences. -/ +@[expose] def degree (G : LoopMultigraph V E) (v : V) : ℕ := Fintype.card (G.halfEdgesAt v) @@ -69,10 +70,10 @@ variable [DecidableEq V] {G : LoopMultigraph V E} (T : G.EulerTour) abbrev Pos := Fin (T.n + 1) /-- The next edge position. -/ -def next (i : T.Pos) : T.Pos := finRotate (T.n + 1) i +@[expose] def next (i : T.Pos) : T.Pos := finRotate (T.n + 1) i /-- The previous edge position. -/ -def prev (i : T.Pos) : T.Pos := (finRotate (T.n + 1)).symm i +@[expose] def prev (i : T.Pos) : T.Pos := (finRotate (T.n + 1)).symm i end EulerTour @@ -81,22 +82,24 @@ variable {V E : Type*} [Fintype V] [Fintype E] [DecidableEq V] [DecidableEq E] /-- The ordinary natural-number degree of `v` in an edge set. Edge ends are counted, so this definition also has the standard behavior for multigraphs. -/ -def degreeIn (F : Finset E) (v : V) : ℕ := +@[expose] def degreeIn (F : Finset E) (v : V) : ℕ := ((F ×ˢ (Finset.univ : Finset (Fin 2))).filter fun h ↦ G.endAt h.1 h.2 = v).card /-- Two labelled edges meet if some numbered end of one has the same endpoint as some numbered end of the other. An edge meets itself, and parallel edges meet at both endpoints. -/ +@[expose] def EdgeAdjacent (e f : E) : Prop := ∃ i j : Fin 2, G.endAt e i = G.endAt f j /-- Edge-chain connectivity of a nonempty edge-supported subgraph. -/ +@[expose] def EdgeConnected (F : Finset E) : Prop := ∃ root ∈ F, ∀ e ∈ F, Relation.ReflTransGen (fun x y : E ↦ x ∈ F ∧ y ∈ F ∧ G.EdgeAdjacent x y) root e /-- The vertices incident with at least one edge of `F`. -/ -def edgeSupport (F : Finset E) : Finset V := +@[expose] def edgeSupport (F : Finset E) : Finset V := Finset.univ.filter fun v ↦ ∃ e ∈ F, ∃ i : Fin 2, G.endAt e i = v /-- An ordinary circuit: a nonempty connected edge-supported subgraph in which every supported @@ -119,6 +122,7 @@ structure OrdinaryCircuitDecomposition where coveredOnce : ∀ e : E, (circuits.filter fun C ↦ e ∈ C.edges).length = 1 /-- Compatibility stated for ordinary circuits. -/ +@[expose] def OrdinaryCircuitDecomposition.Compatible {G : LoopMultigraph V E} (S : G.OrdinaryCircuitDecomposition) (T : G.EulerTour) : Prop := ∀ (i : T.Pos) (C : G.OrdinaryCircuit), C ∈ S.circuits → diff --git a/LeanPool/SardMoreira.lean b/LeanPool/SardMoreira.lean index c5f2e059a5..44b38af7c0 100644 --- a/LeanPool/SardMoreira.lean +++ b/LeanPool/SardMoreira.lean @@ -38,7 +38,7 @@ Tags: analysis, measure-theory, sard-theorem, hausdorff-measure MSC: 28A78, 58C25 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/SardMoreira/Chart.lean b/LeanPool/SardMoreira/Chart.lean index fd6ccefa14..164c14ff50 100644 --- a/LeanPool/SardMoreira/Chart.lean +++ b/LeanPool/SardMoreira/Chart.lean @@ -24,7 +24,7 @@ import Mathlib.RingTheory.SimpleRing.Principal # LeanPool.SardMoreira.Chart -/ -@[expose] public section +public section noncomputable section @@ -301,7 +301,7 @@ theorem differentiableAt (f : Chart k α s) (hk : k ≠ 0) {x : E × f.Dom} (hx f.contDiffMoreiraHolderAt hx |>.differentiableAt hk /-- The identity chart. -/ -@[simps -fullyApplied] +@[expose, simps -fullyApplied] protected def id : Chart k α s where Dom := F toFun := id @@ -420,7 +420,7 @@ theorem exists_dim_lt_map_nhdsWithin_eq (hs : ¬IsLargeAt k α s a) · exact mem_nhdsWithin_of_mem_nhds <| hUo.mem_nhds hUmem /-- Compose two charts of the same depth. -/ -@[simps -fullyApplied] +@[expose, simps -fullyApplied] protected def comp (g : Chart k α s) (f : Chart k α g.set) (hk : k ≠ 0) : Chart k α s where Dom := f.Dom @@ -438,7 +438,7 @@ protected def comp (g : Chart k α s) (f : Chart k α g.set) (hk : k ≠ 0) : mapsTo := g.mapsTo.comp f.mapsTo /-- Restrict a chart to a smaller subset of its domain. -/ -@[simps -fullyApplied] +@[expose, simps -fullyApplied] def restr (f : Chart k α s) (t : Set (E × f.Dom)) : Chart k α s where Dom := f.Dom toFun := f @@ -450,7 +450,7 @@ def restr (f : Chart k α s) (t : Set (E × f.Dom)) : Chart k α s where mapsTo := f.mapsTo.mono_left inter_subset_left /-- Regard a chart of depth `k` as a chart of any smaller depth. -/ -@[simps -fullyApplied] +@[expose, simps -fullyApplied] def ofLE (ψ : Chart k α s) (l : ℕ) (hl : l ≤ k) : Chart l α s where __ := ψ contDiffMoreiraHolderAt hx := ψ.contDiffMoreiraHolderAt hx |>.of_le hl @@ -533,6 +533,17 @@ def _root_.Moreira2001.Atlas.main {E : Type u} [NormedAddCommGroup E] [NormedSpa refine mem_biUnion hφ ?_ aesop } +theorem main_succ_charts {E : Type u} {F : Type v} + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] + (k : ℕ) (α : I) (s : Set (E × F)) : + (main (k + 1) α s).charts = + ⋃ ψ ∈ (choice k α s).charts, + (fun φ ↦ + ((ψ.ofLE 1 (by simp)).restr {x | IsLargeAt (k + 1) α ψ.set x}).comp φ one_ne_zero) '' + (main k α {x ∈ ψ.set | IsLargeAt (k + 1) α ψ.set x}).charts := by + rfl + end Atlas end Moreira2001 diff --git a/LeanPool/SardMoreira/ChartEstimates.lean b/LeanPool/SardMoreira/ChartEstimates.lean index bd1483bfa1..544302cac6 100644 --- a/LeanPool/SardMoreira/ChartEstimates.lean +++ b/LeanPool/SardMoreira/ChartEstimates.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Covering.Besicovitch # LeanPool.SardMoreira.ChartEstimates -/ -@[expose] public section +public section open scoped unitInterval Topology NNReal open Asymptotics Filter Set Metric Function MeasureTheory Measure @@ -140,7 +140,7 @@ theorem isBigO_main_aux simpa [Function.comp_def, Prod.sub_def] using this _ = _ := by simp | succ k ihk => - simp only [main, mem_iUnion, mem_image] at hψ + simp only [main_succ_charts, mem_iUnion, mem_image] at hψ rcases hψ with ⟨ψ, hψ, φ, hφ, rfl⟩ suffices (fun y ↦ f (ψ (φ (x.1, y)))) =O[𝓝 x.2] fun y ↦ ‖y - x.2‖ ^ (k + α + 1 : ℝ) by simpa [add_right_comm _ (1 : ℝ)] diff --git a/LeanPool/SardMoreira/ContDiff.lean b/LeanPool/SardMoreira/ContDiff.lean index 4e37c5249e..332cf41d6b 100644 --- a/LeanPool/SardMoreira/ContDiff.lean +++ b/LeanPool/SardMoreira/ContDiff.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.GCD # LeanPool.SardMoreira.ContDiff -/ -@[expose] public section +public section open scoped unitInterval Topology NNReal open Function Asymptotics Filter Set diff --git a/LeanPool/SardMoreira/ContDiffMoreiraHolder.lean b/LeanPool/SardMoreira/ContDiffMoreiraHolder.lean index 45d90ffbd2..c80262e3ec 100644 --- a/LeanPool/SardMoreira/ContDiffMoreiraHolder.lean +++ b/LeanPool/SardMoreira/ContDiffMoreiraHolder.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.NormNum.GCD # LeanPool.SardMoreira.ContDiffMoreiraHolder -/ -@[expose] public section +public section open scoped unitInterval Topology NNReal open Asymptotics Filter Set diff --git a/LeanPool/SardMoreira/ContinuousMultilinearMap.lean b/LeanPool/SardMoreira/ContinuousMultilinearMap.lean index 1547c14429..c82a720dc6 100644 --- a/LeanPool/SardMoreira/ContinuousMultilinearMap.lean +++ b/LeanPool/SardMoreira/ContinuousMultilinearMap.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SardMoreira.ContinuousMultilinearMap -/ -@[expose] public section +public section open scoped Asymptotics BigOperators diff --git a/LeanPool/SardMoreira/ImplicitFunction.lean b/LeanPool/SardMoreira/ImplicitFunction.lean index 2fb3804d5f..4e0adceb28 100644 --- a/LeanPool/SardMoreira/ImplicitFunction.lean +++ b/LeanPool/SardMoreira/ImplicitFunction.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SardMoreira.ImplicitFunction -/ -@[expose] public section +public section noncomputable section @@ -27,7 +27,7 @@ variable {𝕜 E F : Type*} [NontriviallyNormedField 𝕜] /-- An `ImplicitFunctionData` from a strict Fréchet derivative `f'` with both its kernel and its range closed-complemented. -/ -@[irreducible, simps +simpRhs pt] +@[irreducible] def implicitFunctionDataOfComplementedKerRange (f : E → F) (f' : E →L[𝕜] F) {a : E} (hf : HasStrictFDerivAt f f' a) (hker : f'.ker.ClosedComplemented) (hrange : f'.range.ClosedComplemented) : @@ -56,6 +56,33 @@ def implicitFunctionDataOfComplementedKerRange (f : E → F) (f' : E →L[𝕜] isCompl_ker := ?_ } simpa only [hker_eq] using LinearMap.isCompl_of_proj hker.choose_spec +@[simp] theorem implicitFunctionDataOfComplementedKerRange_pt (f : E → F) + (f' : E →L[𝕜] F) {a : E} (hf : HasStrictFDerivAt f f' a) + (hker : f'.ker.ClosedComplemented) (hrange : f'.range.ClosedComplemented) : + have := hrange.isClosed.completeSpace_coe + (hf.implicitFunctionDataOfComplementedKerRange f f' hker hrange).pt = a := by + classical + unfold implicitFunctionDataOfComplementedKerRange + rfl + +@[simp] theorem implicitFunctionDataOfComplementedKerRange_leftFun_apply + (f : E → F) (f' : E →L[𝕜] F) {a : E} (hf : HasStrictFDerivAt f f' a) + (hker : f'.ker.ClosedComplemented) (hrange : f'.range.ClosedComplemented) (x : E) : + have := hrange.isClosed.completeSpace_coe + (hf.implicitFunctionDataOfComplementedKerRange f f' hker hrange).leftFun x = + hrange.choose (f x) := by + unfold implicitFunctionDataOfComplementedKerRange + rfl + +@[simp] theorem implicitFunctionDataOfComplementedKerRange_rightFun_apply + (f : E → F) (f' : E →L[𝕜] F) {a : E} (hf : HasStrictFDerivAt f f' a) + (hker : f'.ker.ClosedComplemented) (hrange : f'.range.ClosedComplemented) (x : E) : + have := hrange.isClosed.completeSpace_coe + (hf.implicitFunctionDataOfComplementedKerRange f f' hker hrange).rightFun x = + hker.choose x := by + unfold implicitFunctionDataOfComplementedKerRange + rfl + /-- The `OpenPartialHomeomorph` associated to `implicitFunctionDataOfComplementedKerRange`. -/ def implicitToOpenPartialHomeomorphOfComplementedKerRange (f : E → F) (f' : E →L[𝕜] F) {a : E} diff --git a/LeanPool/SardMoreira/LebesgueDensity.lean b/LeanPool/SardMoreira/LebesgueDensity.lean index 2aa594d289..0665edb2ab 100644 --- a/LeanPool/SardMoreira/LebesgueDensity.lean +++ b/LeanPool/SardMoreira/LebesgueDensity.lean @@ -19,7 +19,7 @@ import Mathlib.Topology.Separation.CompletelyRegular # LeanPool.SardMoreira.LebesgueDensity -/ -@[expose] public section +public section open scoped ENNReal NNReal Set.Notation Pointwise open MeasureTheory Filter Set Function Metric Topology diff --git a/LeanPool/SardMoreira/LinearAlgebra.lean b/LeanPool/SardMoreira/LinearAlgebra.lean index 9da6aa52d8..2773cbbd76 100644 --- a/LeanPool/SardMoreira/LinearAlgebra.lean +++ b/LeanPool/SardMoreira/LinearAlgebra.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SardMoreira.LinearAlgebra -/ -@[expose] public section +public section open Function open Module (finrank) diff --git a/LeanPool/SardMoreira/LocalEstimates.lean b/LeanPool/SardMoreira/LocalEstimates.lean index fd79c49096..4a55d2412a 100644 --- a/LeanPool/SardMoreira/LocalEstimates.lean +++ b/LeanPool/SardMoreira/LocalEstimates.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Normed.Affine.AddTorsor # LeanPool.SardMoreira.LocalEstimates -/ -@[expose] public section +public section open scoped Topology NNReal ENNReal unitInterval open Asymptotics Filter MeasureTheory AffineMap Set Metric diff --git a/LeanPool/SardMoreira/MainTheorem.lean b/LeanPool/SardMoreira/MainTheorem.lean index 7310c45a38..da3c553ab6 100644 --- a/LeanPool/SardMoreira/MainTheorem.lean +++ b/LeanPool/SardMoreira/MainTheorem.lean @@ -21,7 +21,7 @@ import Mathlib.Topology.Separation.CompletelyRegular # LeanPool.SardMoreira.MainTheorem -/ -@[expose] public section +public section open scoped unitInterval NNReal Topology ENNReal Pointwise open MeasureTheory Measure Metric @@ -628,7 +628,8 @@ theorem hausdorffMeasure_image_nhdsWithin_null_of_finrank_eq rw [hdf.coe_implicitToOpenPartialHomeomorphOfComplementedKerRange hker hrange] funext x rw [ImplicitFunctionData.prodFun_apply] - simp [φ, HasStrictFDerivAt.implicitFunctionDataOfComplementedKerRange] + simp only [φ, HasStrictFDerivAt.implicitFunctionDataOfComplementedKerRange_leftFun_apply, + HasStrictFDerivAt.implicitFunctionDataOfComplementedKerRange_rightFun_apply] rw [hprod] simpa [φ, HasStrictFDerivAt.implicitFunctionDataOfComplementedKerRange_pt] using φ.isInvertible_fderiv_prodFun diff --git a/LeanPool/SardMoreira/MeasureBallSemicontinuous.lean b/LeanPool/SardMoreira/MeasureBallSemicontinuous.lean index 128005f6f8..bb5b740928 100644 --- a/LeanPool/SardMoreira/MeasureBallSemicontinuous.lean +++ b/LeanPool/SardMoreira/MeasureBallSemicontinuous.lean @@ -17,7 +17,7 @@ import Mathlib.MeasureTheory.Constructions.BorelSpace.Order # LeanPool.SardMoreira.MeasureBallSemicontinuous -/ -@[expose] public section +public section open MeasureTheory Topology Filter Set Metric open scoped NNReal diff --git a/LeanPool/SardMoreira/MeasureComap.lean b/LeanPool/SardMoreira/MeasureComap.lean index ed28736ef4..bfcab1cfd7 100644 --- a/LeanPool/SardMoreira/MeasureComap.lean +++ b/LeanPool/SardMoreira/MeasureComap.lean @@ -12,7 +12,7 @@ import Mathlib.Analysis.Normed.Group.Basic # LeanPool.SardMoreira.MeasureComap -/ -@[expose] public section +public section open scoped ENNReal NNReal Set.Notation Pointwise open MeasureTheory Filter Set Function Metric Topology diff --git a/LeanPool/SardMoreira/MeasureNNReal.lean b/LeanPool/SardMoreira/MeasureNNReal.lean index 4cd829d853..cc710ec7f4 100644 --- a/LeanPool/SardMoreira/MeasureNNReal.lean +++ b/LeanPool/SardMoreira/MeasureNNReal.lean @@ -12,7 +12,7 @@ import LeanPool.SardMoreira.MeasureComap # LeanPool.SardMoreira.MeasureNNReal -/ -@[expose] public section +public section open scoped ENNReal NNReal Set.Notation Pointwise open MeasureTheory Filter Set Function Metric Topology diff --git a/LeanPool/SardMoreira/NormedSpace.lean b/LeanPool/SardMoreira/NormedSpace.lean index d28ac6fdcc..fbb5125f92 100644 --- a/LeanPool/SardMoreira/NormedSpace.lean +++ b/LeanPool/SardMoreira/NormedSpace.lean @@ -11,7 +11,7 @@ public import Mathlib.Analysis.Normed.Module.Basic # LeanPool.SardMoreira.NormedSpace -/ -@[expose] public section +public section namespace NNReal diff --git a/LeanPool/SardMoreira/OuterMeasureDeriv.lean b/LeanPool/SardMoreira/OuterMeasureDeriv.lean index b9b73d8731..e013464f04 100644 --- a/LeanPool/SardMoreira/OuterMeasureDeriv.lean +++ b/LeanPool/SardMoreira/OuterMeasureDeriv.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SardMoreira.OuterMeasureDeriv -/ -@[expose] public section +public section namespace MeasureTheory.Measure diff --git a/LeanPool/SardMoreira/ToMathlib.lean b/LeanPool/SardMoreira/ToMathlib.lean index 1af3a99af5..bb954c4161 100644 --- a/LeanPool/SardMoreira/ToMathlib.lean +++ b/LeanPool/SardMoreira/ToMathlib.lean @@ -23,4 +23,4 @@ This module gathers auxiliary lemmas from the SardMoreira project that are candidates for upstreaming to Mathlib. -/ -@[expose] public section +public section diff --git a/LeanPool/SardMoreira/ToMathlib/ContinuousLinearMap.lean b/LeanPool/SardMoreira/ToMathlib/ContinuousLinearMap.lean index b05aa9e81c..e19790118f 100644 --- a/LeanPool/SardMoreira/ToMathlib/ContinuousLinearMap.lean +++ b/LeanPool/SardMoreira/ToMathlib/ContinuousLinearMap.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset Mostly about `ContinuousLinearMap.IsInvertible` and `ContinuousLinearMap.inverse`. -/ -@[expose] public section +public section open Filter Function Asymptotics Topology diff --git a/LeanPool/SardMoreira/ToMathlib/PR31960.lean b/LeanPool/SardMoreira/ToMathlib/PR31960.lean index 6bb690714e..bcb8a29f02 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR31960.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR31960.lean @@ -20,4 +20,4 @@ them via the relevant Mathlib import so existing import sites continue to resolve. -/ -@[expose] public section +public section diff --git a/LeanPool/SardMoreira/ToMathlib/PR32186.lean b/LeanPool/SardMoreira/ToMathlib/PR32186.lean index d7dcfde2c5..aa589c962f 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR32186.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR32186.lean @@ -17,7 +17,7 @@ In this file we prove several version of the following fact: the displacement (`dist (f a) (f b)`) is at most the integral of `‖deriv f‖` over `[a, b]`. -/ -@[expose] public section +public section diff --git a/LeanPool/SardMoreira/ToMathlib/PR32986.lean b/LeanPool/SardMoreira/ToMathlib/PR32986.lean index a50872b541..b58d20debd 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR32986.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR32986.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Positivity.Finset Lemmas from https://github.com/leanprover-community/mathlib4/pull/32986 -/ -@[expose] public section +public section open scoped Topology Filter open MeasureTheory Measure Metric diff --git a/LeanPool/SardMoreira/ToMathlib/PR32993.lean b/LeanPool/SardMoreira/ToMathlib/PR32993.lean index 55990bc6cd..767bd8cf04 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR32993.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR32993.lean @@ -11,7 +11,7 @@ public import Mathlib.Basic.ENNReal.Basic # LeanPool.SardMoreira.ToMathlib.PR32993 -/ -@[expose] public section +public section open ENNReal diff --git a/LeanPool/SardMoreira/ToMathlib/PR33029.lean b/LeanPool/SardMoreira/ToMathlib/PR33029.lean index ee626d1065..5acb3a91ba 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR33029.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR33029.lean @@ -23,4 +23,4 @@ re-exports them via the relevant Mathlib imports so existing import sites continue to resolve. -/ -@[expose] public section +public section diff --git a/LeanPool/SardMoreira/ToMathlib/PR33114.lean b/LeanPool/SardMoreira/ToMathlib/PR33114.lean index 41247f656d..17f37e46b2 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR33114.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR33114.lean @@ -38,7 +38,7 @@ then these sets become balls, and we can apply Vitali theorem. [Moreira2001] -/ -@[expose] public section +public section open scoped ENNReal NNReal Filter Uniformity Topology @@ -59,13 +59,19 @@ namespace WithRPowDist variable {X : Type*} {α : ℝ} {hα₀ : 0 < α} {hα₁ : α ≤ 1} /-- The natural equivalence between `WithRPowDist X α hr₀ hr₁` and `X`. -/ -@[simps -fullyApplied apply symm_apply] +@[expose] def equiv (X : Type*) (α : ℝ) (hr₀ : 0 < α) (hr₁ : α ≤ 1) : WithRPowDist X α hr₀ hr₁ ≃ X where toFun := val invFun := mk left_inv _ := rfl right_inv _ := rfl +@[simp] theorem equiv_apply (X : Type*) (α : ℝ) (hr₀ : 0 < α) (hr₁ : α ≤ 1) : + ⇑(equiv X α hr₀ hr₁) = val := by rfl + +@[simp] theorem equiv_symm_apply (X : Type*) (α : ℝ) (hr₀ : 0 < α) (hr₁ : α ≤ 1) : + ⇑(equiv X α hr₀ hr₁).symm = mk := by rfl + @[simp] theorem val_comp_mk : (val : WithRPowDist X α hα₀ hα₁ → X) ∘ mk = id := rfl @@ -119,10 +125,20 @@ theorem continuous_mk : Continuous (mk : X → WithRPowDist X α hα₀ hα₁) continuous_induced_rng.2 continuous_id /-- The natural homeomorphism between `WithRPowDist X α hα₀ hα₁` and `X`. -/ -@[simps! -fullyApplied toEquiv apply symm_apply] -def homeomorph : WithRPowDist X α hα₀ hα₁ ≃ₜ X where +@[expose] def homeomorph : WithRPowDist X α hα₀ hα₁ ≃ₜ X where toEquiv := WithRPowDist.equiv X α hα₀ hα₁ +theorem toEquiv_homeomorph : homeomorph.toEquiv = equiv X α hα₀ hα₁ := by rfl + +@[simp] theorem homeomorph_toEquiv : homeomorph.toEquiv = equiv X α hα₀ hα₁ := + toEquiv_homeomorph + +@[simp] theorem homeomorph_apply : + ⇑(homeomorph : WithRPowDist X α hα₀ hα₁ ≃ₜ X) = val := by rfl + +@[simp] theorem homeomorph_symm_apply : + ⇑(homeomorph : WithRPowDist X α hα₀ hα₁ ≃ₜ X).symm = mk := by rfl + /-! We copy some instances from the underlying space `X` to `WithRPowDist X α hα₀ hα₁`. In the future, we can add more of them, if needed, @@ -197,12 +213,20 @@ theorem _root_.WithRPowDist.uniformContinuous_mk : uniformContinuous_comap' uniformContinuous_id /-- The natural uniform equivalence between `WithRPowDist X α hα₀ hα₁` and `X`. -/ -@[simps! toEquiv apply symm_apply] def _root_.WithRPowDist.uniformEquiv : WithRPowDist X α hα₀ hα₁ ≃ᵤ X where toEquiv := WithRPowDist.equiv X α hα₀ hα₁ uniformContinuous_toFun := uniformContinuous_val uniformContinuous_invFun := uniformContinuous_mk +@[simp] theorem uniformEquiv_toEquiv : uniformEquiv.toEquiv = equiv X α hα₀ hα₁ := by rfl + +@[simp] theorem uniformEquiv_apply (x : WithRPowDist X α hα₀ hα₁) : + uniformEquiv x = x.val := by rfl + +@[simp] theorem uniformEquiv_symm_apply (x : X) : + (uniformEquiv : WithRPowDist X α hα₀ hα₁ ≃ᵤ X).symm x = + (mk x : WithRPowDist X α hα₀ hα₁) := by rfl + end UniformSpace /-! diff --git a/LeanPool/SardMoreira/Topology.lean b/LeanPool/SardMoreira/Topology.lean index d313119bc3..49f0af243f 100644 --- a/LeanPool/SardMoreira/Topology.lean +++ b/LeanPool/SardMoreira/Topology.lean @@ -12,7 +12,7 @@ import Mathlib.Topology.NhdsWithin # LeanPool.SardMoreira.Topology -/ -@[expose] public section +public section open Filter open scoped Topology diff --git a/LeanPool/SardMoreira/UnifDoublingCover.lean b/LeanPool/SardMoreira/UnifDoublingCover.lean index 334576982e..9230ca7a34 100644 --- a/LeanPool/SardMoreira/UnifDoublingCover.lean +++ b/LeanPool/SardMoreira/UnifDoublingCover.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SardMoreira.UnifDoublingCover -/ -@[expose] public section +public section open MeasureTheory Measure Metric Set diff --git a/LeanPool/SardMoreira/Unused.lean b/LeanPool/SardMoreira/Unused.lean index e3e9615654..e4c24b268e 100644 --- a/LeanPool/SardMoreira/Unused.lean +++ b/LeanPool/SardMoreira/Unused.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.NormNum.GCD # LeanPool.SardMoreira.Unused -/ -@[expose] public section +public section open scoped Topology open Filter Set @@ -41,7 +41,7 @@ theorem HasFDerivWithinAt.of_local_leftInverse {𝕜 E F : Type*} HasFDerivWithinAt.of_local_left_inverse hg hf ha hfg /-- Continuous linear equivalence between a submodule of a submodule and its mapped subtype. -/ -@[simps! -fullyApplied apply_coe symm_apply_coe_coe] +@[expose, simps! -fullyApplied apply_coe symm_apply_coe_coe] def Submodule.continuousEquivSubtypeMap {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] (p : Submodule R M) (q : Submodule R p) : q ≃L[R] q.map p.subtype where @@ -50,7 +50,7 @@ def Submodule.continuousEquivSubtypeMap {R M : Type*} [Semiring R] [AddCommMonoi continuous_invFun := .codRestrict (.codRestrict continuous_subtype_val _) _ /-- Continuous linear equivalence from the top submodule to the ambient module. -/ -@[simps!] +@[expose, simps!] def Submodule.topContinuousEquiv {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] : (⊤ : Submodule R M) ≃L[R] M where @@ -159,8 +159,7 @@ variable {𝕜 E F G : Type*} variable {n : ℕ} (c : OrderedFinpartition n) /-- Cover `[0, n)`, `n ≠ 0`, by a single subset. -/ -@[simps -fullyApplied] -def single (n : ℕ) (hn : n ≠ 0) : OrderedFinpartition n where +@[expose] def single (n : ℕ) (hn : n ≠ 0) : OrderedFinpartition n where length := 1 partSize _ := n partSize_pos _ := hn.bot_lt @@ -170,6 +169,14 @@ def single (n : ℕ) (hn : n ≠ 0) : OrderedFinpartition n where disjoint := subsingleton_univ.pairwise _ cover x := ⟨0, x, rfl⟩ +@[simp] theorem single_length (n : ℕ) (hn : n ≠ 0) : (single n hn).length = 1 := by rfl + +@[simp] theorem single_partSize (n : ℕ) (hn : n ≠ 0) : + (single n hn).partSize = fun _ => n := by rfl + +@[simp] theorem single_emb (n : ℕ) (hn : n ≠ 0) : + (single n hn).emb = fun _ => id := by rfl + @[simp] theorem applyOrderedFinpartition_single (hn : n ≠ 0) (p : ∀ i : Fin (single n hn).length, E [×(single n hn).partSize i]→L[𝕜] F) diff --git a/LeanPool/SardMoreira/UpperLowerSemicontinuous.lean b/LeanPool/SardMoreira/UpperLowerSemicontinuous.lean index 7bc531ae8e..43e23b0717 100644 --- a/LeanPool/SardMoreira/UpperLowerSemicontinuous.lean +++ b/LeanPool/SardMoreira/UpperLowerSemicontinuous.lean @@ -18,7 +18,7 @@ import Mathlib.Topology.MetricSpace.Bounded # LeanPool.SardMoreira.UpperLowerSemicontinuous -/ -@[expose] public section +public section open Set Filter Function TopologicalSpace diff --git a/LeanPool/SardMoreira/WithRPowDist.lean b/LeanPool/SardMoreira/WithRPowDist.lean index f17f1eefe9..b01147537e 100644 --- a/LeanPool/SardMoreira/WithRPowDist.lean +++ b/LeanPool/SardMoreira/WithRPowDist.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SardMoreira.WithRPowDist -/ -@[expose] public section +public section open scoped ENNReal NNReal Filter Uniformity Topology open Function @@ -38,7 +38,7 @@ theorem measurable_mk : Measurable (mk : X → WithRPowDist X α hα₀ hα₁) rw [instMeasurableSpace, MeasurableSpace.comap_comp, val_comp_mk, MeasurableSpace.comap_id] /-- The natural measurable equivalence between `WithRPowDist X α hα₀ hα₁` and `X`. -/ -@[simps! -fullyApplied toEquiv apply symm_apply] +@[expose, simps! -fullyApplied toEquiv apply symm_apply] def measurableEquiv : WithRPowDist X α hα₀ hα₁ ≃ᵐ X where toEquiv := WithRPowDist.equiv X α hα₀ hα₁ measurable_toFun := measurable_val @@ -61,7 +61,7 @@ open WithRPowDist variable (α hα₀ hα₁) in /-- The pushforward of a measure `μ` on `X` under the canonical map `X → WithRPowDist X α hα₀ hα₁`. -/ -def withRPowDist (μ : Measure X) : Measure (WithRPowDist X α hα₀ hα₁) := +@[expose] def withRPowDist (μ : Measure X) : Measure (WithRPowDist X α hα₀ hα₁) := μ.map .mk theorem withRPowDist_apply (μ : Measure X) (s : Set (WithRPowDist X α hα₀ hα₁)) : @@ -116,7 +116,14 @@ instance [TopologicalSpace X] [μ.WeaklyRegular] : apply WeaklyRegular.innerRegular.map' · exact fun U hU ↦ hU.preimage continuous_mk · intro K hK - rwa [measurableEquiv_symm_apply, ← homeomorph_symm_apply, Homeomorph.isClosed_image] + have h_image : + (measurableEquiv.symm : X → WithRPowDist X α hα₀ hα₁) '' K = + (homeomorph.symm : X → WithRPowDist X α hα₀ hα₁) '' K := by + apply Set.image_congr + intro x hx + simp only [measurableEquiv_symm_apply, homeomorph_symm_apply] + rw [h_image] + exact homeomorph.symm.isClosed_image.mpr hK instance [TopologicalSpace X] [μ.InnerRegularCompactLTTop] : (μ.withRPowDist α hα₀ hα₁).InnerRegularCompactLTTop where diff --git a/LeanPool/Schoenflies/Accessible.lean b/LeanPool/Schoenflies/Accessible.lean index 68bb92f131..7f642c9109 100755 --- a/LeanPool/Schoenflies/Accessible.lean +++ b/LeanPool/Schoenflies/Accessible.lean @@ -37,7 +37,7 @@ through `C = ∂D`, i.e. through the Jordan curve theorem, which is not yet avai is played by Proposition 8.5, which is stated with `C ⊆ closure D` as a hypothesis. -/ -@[expose] public section +public section open Metric Set @@ -94,7 +94,7 @@ theorem stronglyAccessible_of_isMinOn {a : Plane} (hq : q ∉ C) (ha : a ∈ C) at radius `s`: the points seen from `p` in a direction `w` with `⟪v, w⟫ > 1/2` and at distance less than `s`. Writing the condition as `‖x - p‖ / 2 < ⟪v, x - p⟫` avoids normalizing `x - p`, and makes the openness of the cone immediate. -/ -def accessCone (p v : Plane) (s : ℝ) : Set Plane := +@[expose] def accessCone (p v : Plane) (s : ℝ) : Set Plane := {x | ‖x - p‖ < s ∧ ‖x - p‖ / 2 < inner ℝ v (x - p)} theorem mem_accessCone_iff {x : Plane} : diff --git a/LeanPool/Schoenflies/AccessibleJoin.lean b/LeanPool/Schoenflies/AccessibleJoin.lean index 7f2a480080..b47e860bbb 100755 --- a/LeanPool/Schoenflies/AccessibleJoin.lean +++ b/LeanPool/Schoenflies/AccessibleJoin.lean @@ -88,7 +88,7 @@ skeleton homeomorphism. Both need the stage/anchor machinery of §"Continuity at curve"; the extraction between them is what this module supplies. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/AlternatingCrosscuts.lean b/LeanPool/Schoenflies/AlternatingCrosscuts.lean index 12c69f1220..cffb24e2cb 100755 --- a/LeanPool/Schoenflies/AlternatingCrosscuts.lean +++ b/LeanPool/Schoenflies/AlternatingCrosscuts.lean @@ -93,7 +93,7 @@ those particular sets the realization has to reproduce. * `alternating_crosscuts` — `cor:alternating-crosscuts`, bundled. -/ -@[expose] public section +public section open Set unitInterval diff --git a/LeanPool/Schoenflies/ArcCollars.lean b/LeanPool/Schoenflies/ArcCollars.lean index 0f8667be53..039852ec9c 100755 --- a/LeanPool/Schoenflies/ArcCollars.lean +++ b/LeanPool/Schoenflies/ArcCollars.lean @@ -88,7 +88,7 @@ arc, and `Schoenflies.isPolyArcCarrier_segment` exhibits one. a `PolyArc`, which recovers `Schoenflies.hasArcCollars_segment` as a special case. -/ -@[expose] public section +public section open Metric Set @@ -157,7 +157,7 @@ noncomputable def pt : Plane := A.off i c 0 def edge : Set Plane := segment ℝ (A.vertex i) (A.vertex (i + 1)) /-- The carrier of the arc: the union of its `n + 1` edges. -/ -def carrier : Set Plane := ⋃ i, ⋃ (_ : i ≤ n), A.edge i +@[expose] def carrier : Set Plane := ⋃ i, ⋃ (_ : i ≤ n), A.edge i variable {A i j c t s} @@ -1436,7 +1436,7 @@ theorem subset_closure_sideR : K ⊆ closure S.sideR := by exported, not existentially packaged: `nbhd`, `sideL` and `sideR` are definitions with an API of their own, and `Schoenflies.ArcStrip.sideL_disjoint_sideR` and `Schoenflies.ArcStrip.isOpen_sideL` are two clauses of Lemma 1.8 (b) that the record drops. -/ -def collar : ArcCollar D A.carrier K where +@[expose] def collar : ArcCollar D A.carrier K where nbhd := S.nbhd left := S.sideL right := S.sideR @@ -1766,7 +1766,7 @@ namespace PolyArc variable {n k : ℕ} {A : PolyArc n} /-- The union of the first `k + 1` edges. -/ -def prefixCarrier (A : PolyArc n) (k : ℕ) : Set Plane := ⋃ i, ⋃ (_ : i ≤ k), A.edge i +@[expose] def prefixCarrier (A : PolyArc n) (k : ℕ) : Set Plane := ⋃ i, ⋃ (_ : i ≤ k), A.edge i theorem mem_prefixCarrier_iff {x : Plane} : x ∈ A.prefixCarrier k ↔ ∃ i ≤ k, x ∈ A.edge i := mem_iUnion_le_nat diff --git a/LeanPool/Schoenflies/ArcComplement.lean b/LeanPool/Schoenflies/ArcComplement.lean index 32e885ce30..25d11089d5 100755 --- a/LeanPool/Schoenflies/ArcComplement.lean +++ b/LeanPool/Schoenflies/ArcComplement.lean @@ -85,7 +85,7 @@ Three hypotheses, all named in the statements that carry them. simple polygonal arc. -/ -@[expose] public section +public section open Metric Set unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/ArcComplementPrep.lean b/LeanPool/Schoenflies/ArcComplementPrep.lean index 44dcf4454e..c65c784c2b 100755 --- a/LeanPool/Schoenflies/ArcComplementPrep.lean +++ b/LeanPool/Schoenflies/ArcComplementPrep.lean @@ -73,7 +73,7 @@ outer-chain lemma (`lem:outer-chain`), so that the theorem itself becomes a shor squares". -/ -@[expose] public section +public section open Metric Set unitInterval open scoped Graph @@ -111,16 +111,16 @@ theorem mem_frontier_closedSquare_of_snd (h1 : |z 1 - c 1| = r) (h0 : |z 0 - c 0 mem_frontier_closedSquare.2 (by rw [max_eq_right (h1 ▸ h0), h1]) /-- The north-east corner of the square of radius `r` about `c`. -/ -def sqNE (c : Plane) (r : ℝ) : Plane := mk (c 0 + r) (c 1 + r) +@[expose] def sqNE (c : Plane) (r : ℝ) : Plane := mk (c 0 + r) (c 1 + r) /-- The north-west corner. -/ -def sqNW (c : Plane) (r : ℝ) : Plane := mk (c 0 - r) (c 1 + r) +@[expose] def sqNW (c : Plane) (r : ℝ) : Plane := mk (c 0 - r) (c 1 + r) /-- The south-west corner. -/ -def sqSW (c : Plane) (r : ℝ) : Plane := mk (c 0 - r) (c 1 - r) +@[expose] def sqSW (c : Plane) (r : ℝ) : Plane := mk (c 0 - r) (c 1 - r) /-- The south-east corner. -/ -def sqSE (c : Plane) (r : ℝ) : Plane := mk (c 0 + r) (c 1 - r) +@[expose] def sqSE (c : Plane) (r : ℝ) : Plane := mk (c 0 + r) (c 1 - r) @[simp] theorem sqNE_zero : sqNE c r 0 = c 0 + r := rfl @[simp] theorem sqNE_one : sqNE c r 1 = c 1 + r := rfl @@ -208,7 +208,7 @@ variable {c : Plane} {r : ℝ} /-- **The boundary of the axis-parallel square of `ℓ^∞`-radius `r` about `c`, as a closed polygon.**This is the presentation the overlay and parity machinery consume; `Schoenflies.modelCurve` is the case `c = 0`, `r = 1` but only as a set. -/ -def squarePolygon (c : Plane) {r : ℝ} (hr : 0 < r) : ClosedPolygon 1 where +@[expose] def squarePolygon (c : Plane) {r : ℝ} (hr : 0 < r) : ClosedPolygon 1 where vertex := ![sqNE c r, sqNW c r, sqSW c r, sqSE c r] vertex_inj := by -- Any two of the four corners differ in a coordinate; `r > 0` is what makes them differ. @@ -584,7 +584,7 @@ common vertices; see `exists_two_common_vertices`. -/ /-- The four sides of the square of `ℓ^∞`-radius `r` about `c`, as `Piece`s, in the same cyclic order as `squarePolygon`. -/ -def squarePieces (c : Plane) (r : ℝ) : List Piece := +@[expose] def squarePieces (c : Plane) (r : ℝ) : List Piece := [(sqNE c r, sqNW c r), (sqNW c r, sqSW c r), (sqSW c r, sqSE c r), (sqSE c r, sqNE c r)] theorem cover_squarePieces (c : Plane) (hr : 0 ≤ r) : diff --git a/LeanPool/Schoenflies/ArcMonotone.lean b/LeanPool/Schoenflies/ArcMonotone.lean index 29dbda50b8..c54e349506 100755 --- a/LeanPool/Schoenflies/ArcMonotone.lean +++ b/LeanPool/Schoenflies/ArcMonotone.lean @@ -68,7 +68,7 @@ Declarations: matching endpoints. -/ -@[expose] public section +public section open Set unitInterval diff --git a/LeanPool/Schoenflies/BoundaryAnchors.lean b/LeanPool/Schoenflies/BoundaryAnchors.lean index db463e1704..3b2c61591d 100755 --- a/LeanPool/Schoenflies/BoundaryAnchors.lean +++ b/LeanPool/Schoenflies/BoundaryAnchors.lean @@ -21,7 +21,7 @@ This discharges `lem:anchor-density` and constructs the `HasAnchorCrosscuts` and inputs used in `prop:boundary-continuity`. -/ -@[expose] public section +public section open Filter Metric Set open scoped Graph diff --git a/LeanPool/Schoenflies/BoundaryContinuity.lean b/LeanPool/Schoenflies/BoundaryContinuity.lean index c79d1f77b6..487b9d6010 100755 --- a/LeanPool/Schoenflies/BoundaryContinuity.lean +++ b/LeanPool/Schoenflies/BoundaryContinuity.lean @@ -49,7 +49,7 @@ An earlier version of this docstring listed those as if they were here; they nev target crosscut, is in `Schoenflies/BoundaryContinuity2.lean`. -/ -@[expose] public section +public section open Metric Set Schoenflies open scoped Graph diff --git a/LeanPool/Schoenflies/BoundaryContinuity2.lean b/LeanPool/Schoenflies/BoundaryContinuity2.lean index e294d63707..d0d1ec3e42 100755 --- a/LeanPool/Schoenflies/BoundaryContinuity2.lean +++ b/LeanPool/Schoenflies/BoundaryContinuity2.lean @@ -88,7 +88,7 @@ corresponding target side, whose trace on `S` is `u(A₁)` — and `r ∉ A₁`. **`thm:square-extension`**. -/ -@[expose] public section +public section open Bornology Filter Metric Schoenflies Set Topology open scoped Graph diff --git a/LeanPool/Schoenflies/BoundaryCycles.lean b/LeanPool/Schoenflies/BoundaryCycles.lean index 40c4ba7248..4a78f06ac4 100755 --- a/LeanPool/Schoenflies/BoundaryCycles.lean +++ b/LeanPool/Schoenflies/BoundaryCycles.lean @@ -30,7 +30,7 @@ Stating the carrier clause with cycle. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/BoundaryCyclesGenerated.lean b/LeanPool/Schoenflies/BoundaryCyclesGenerated.lean index f6d46261e5..7d862f114c 100755 --- a/LeanPool/Schoenflies/BoundaryCyclesGenerated.lean +++ b/LeanPool/Schoenflies/BoundaryCyclesGenerated.lean @@ -23,7 +23,7 @@ each new boundary is one old boundary arc followed by the reverse of the inserte * `Schoenflies.GeneratedStructure.boundaryCycles` — the closed induction. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Bounded.lean b/LeanPool/Schoenflies/Bounded.lean index 0241fee375..81b90187aa 100755 --- a/LeanPool/Schoenflies/Bounded.lean +++ b/LeanPool/Schoenflies/Bounded.lean @@ -28,7 +28,7 @@ connectedness theorem be applied to a complement. open; the exterior of a plane graph is open for this reason. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/CellulationInvariants.lean b/LeanPool/Schoenflies/CellulationInvariants.lean index 0aa942d6e6..6c41e74219 100755 --- a/LeanPool/Schoenflies/CellulationInvariants.lean +++ b/LeanPool/Schoenflies/CellulationInvariants.lean @@ -95,7 +95,7 @@ closed walk. out, and this is what it has to be. -/ -@[expose] public section +public section open Set Bornology open scoped Graph @@ -163,7 +163,8 @@ theorem cellUnion_congr {S₁ S₂ : CellStructure γ} {R₁ : S₁.Realization} cells strictly below it. Under assertion (i) this is the topological frontier of the open 2-cell (`IsCellDecomposition.faceBoundary_eq_frontier`), which is what makes it the right thing for the blueprint's "boundary walk of `F`" without a walk being available. -/ -def faceBoundary (R : S.Realization) (F : γ) : Set Plane := R.cellUnion (S.subcells F \ {F}) +@[expose] def faceBoundary (R : S.Realization) (F : γ) : Set Plane := + R.cellUnion (S.subcells F \ {F}) namespace IsCellDecomposition diff --git a/LeanPool/Schoenflies/CombinatorialInvariance.lean b/LeanPool/Schoenflies/CombinatorialInvariance.lean index c2794fe16c..c8f97de23d 100755 --- a/LeanPool/Schoenflies/CombinatorialInvariance.lean +++ b/LeanPool/Schoenflies/CombinatorialInvariance.lean @@ -85,7 +85,7 @@ from one combinatorial hypothesis. of a realization needs. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph @@ -238,13 +238,13 @@ namespace CellStructure variable (S : CellStructure γ) /-- All cells of the structure. -/ -def cells : Set γ := V(S.skel) ∪ E(S.skel) ∪ S.faces +@[expose] def cells : Set γ := V(S.skel) ∪ E(S.skel) ∪ S.faces /-- The cells of the distinguished outer cycle: its vertices and its edges. -/ def outerCells : Set γ := V(S.outerGraph) ∪ E(S.outerGraph) /-- The supercells of a cell: the index set of its closed star. -/ -def supercells (σ : γ) : Set γ := {τ | S.sub σ τ} +@[expose] def supercells (σ : γ) : Set γ := {τ | S.sub σ τ} /-- A cell is incident with the outer cycle when some outer cell is a subcell of it. This is the middle, purely combinatorial condition of lem:outer-incidence. -/ @@ -291,7 +291,7 @@ variable {S} variable (R : S.Realization) /-- The drawn skeleton: the pushforward of the abstract skeleton along the positions. -/ -def graph : Graph Plane γ := S.skel.map R.pos +@[expose] def graph : Graph Plane γ := S.skel.map R.pos @[simp] theorem vertexSet_graph : V(R.graph) = R.pos '' V(S.skel) := vertexSet_map _ _ @@ -302,17 +302,17 @@ instance finite_graph : (R.graph).Finite where finite_edgeSet := by rw [edgeSet_graph]; exact S.finite_edgeSet /-- The realized 1-skeleton `|Γ|`. -/ -def skeletonSet : Set Plane := pointSet R.graph R.drawing +@[expose] def skeletonSet : Set Plane := pointSet R.graph R.drawing /-- The realized outer cycle: `C` in the source realization, `S` in the target one. -/ def outerSet : Set Plane := pointSet (S.outerGraph.map R.pos) R.drawing /-- The **open nonboundary part** `|Γ| \ C` of def:admissible-graph. -/ -def nonboundary : Set Plane := R.skeletonSet \ R.outerSet +@[expose] def nonboundary : Set Plane := R.skeletonSet \ R.outerSet /-- The closed star of a cell: the union of the closures of its supercells. The index set is abstract; only the summands are geometric. -/ -def star (σ : γ) : Set Plane := ⋃ τ ∈ S.supercells σ, closure (R.cell τ) +@[expose] def star (σ : γ) : Set Plane := ⋃ τ ∈ S.supercells σ, closure (R.cell τ) theorem outerSet_subset_skeletonSet : R.outerSet ⊆ R.skeletonSet := pointSet_mono (S.outerGraph_le.map R.pos) @@ -399,7 +399,7 @@ theorem image_outerSet : g.toFun '' R₁.outerSet = R₂.outerSet := theorem injOn : InjOn g.toFun R₁.skeletonSet := g.leftInvOn.injOn /-- The homeomorphism run backwards. -/ -def symm : SkeletonHomeo R₂ R₁ where +@[expose] def symm : SkeletonHomeo R₂ R₁ where toFun := g.invFun invFun := g.toFun continuousOn_toFun := g.continuousOn_invFun @@ -499,7 +499,7 @@ theorem Realization.star_subset_of_sub (R : S.Realization) /-- The clause "every outer edge is a subcell of exactly one 2-cell" — assertion (vi) of lem:cellulation-invariants — as a property of the abstract structure alone. -/ -def OuterEdgeUniqueFace (S : CellStructure γ) : Prop := +@[expose] def OuterEdgeUniqueFace (S : CellStructure γ) : Prop := ∀ ⦃e⦄, e ∈ E(S.outerGraph) → ∃! F, F ∈ S.faces ∧ S.sub e F /-- **The 2-cell incident with an outer edge is combinatorial** — part (c) of diff --git a/LeanPool/Schoenflies/CommonSubdivision.lean b/LeanPool/Schoenflies/CommonSubdivision.lean index 23bb29ac14..cfd090ee53 100755 --- a/LeanPool/Schoenflies/CommonSubdivision.lean +++ b/LeanPool/Schoenflies/CommonSubdivision.lean @@ -30,7 +30,7 @@ the ear construction. arbitrary plane drawings, used when assembling target/mesh overlays. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Compose.lean b/LeanPool/Schoenflies/Compose.lean index 32a087564b..57b28d02c9 100755 --- a/LeanPool/Schoenflies/Compose.lean +++ b/LeanPool/Schoenflies/Compose.lean @@ -34,7 +34,7 @@ to the face machinery at all, even though both halves compiled. The overlay now * `polygonal_collar` — Lemma 1.8 (a), the three strip modules composed. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Concatenate.lean b/LeanPool/Schoenflies/Concatenate.lean index b42ccc6a62..a9e6720f4f 100755 --- a/LeanPool/Schoenflies/Concatenate.lean +++ b/LeanPool/Schoenflies/Concatenate.lean @@ -44,7 +44,7 @@ itself. Pinning those needs the start/finish counterparts of the midpoint lemmas of a curve takes. -/ -@[expose] public section +public section open Set unitInterval diff --git a/LeanPool/Schoenflies/CrosscutAtMostTwo.lean b/LeanPool/Schoenflies/CrosscutAtMostTwo.lean index db4b7ca492..c0c9412502 100755 --- a/LeanPool/Schoenflies/CrosscutAtMostTwo.lean +++ b/LeanPool/Schoenflies/CrosscutAtMostTwo.lean @@ -79,7 +79,7 @@ existential. crosscut with no hypothesis left standing, and certifies that `HasArcCollars` is satisfiable. -/ -@[expose] public section +public section open Metric Set unitInterval @@ -134,7 +134,7 @@ the endpoints" amounts to here, since the endpoints of a crosscut are outside `D Nondegeneracy is asked for because the blueprint's proof builds the collar out of edge blocks and vertex disks along `K`, which needs `K` to contain an edge; a consumer that has a genuine subarc always has it. -/ -def HasArcCollars (D P : Set Plane) : Prop := +@[expose] def HasArcCollars (D P : Set Plane) : Prop := ∀ K : Set Plane, K ⊆ D ∩ P → IsCompact K → IsPreconnected K → K.Nontrivial → Nonempty (ArcCollar D P K) diff --git a/LeanPool/Schoenflies/CrosscutCells.lean b/LeanPool/Schoenflies/CrosscutCells.lean index 9c336f3def..65db5b5c67 100755 --- a/LeanPool/Schoenflies/CrosscutCells.lean +++ b/LeanPool/Schoenflies/CrosscutCells.lean @@ -59,7 +59,7 @@ inclusion `Ω† ⊆ Wᵢ`, which is a hypothesis here. A consumer supplies it b because the bundled form carries the hypotheses of both indices at once. -/ -@[expose] public section +public section open Bornology Set @@ -75,12 +75,12 @@ complement. -/ /-- The union of the bounded components of the complement — the blueprint's `Int(C)` once `C` is known to be separating. -/ -def inside (C : Set Plane) : Set Plane := +@[expose] def inside (C : Set Plane) : Set Plane := {x | x ∉ C ∧ IsBounded (connectedComponentIn Cᶜ x)} /-- The union of the unbounded components of the complement — the blueprint's `Ext(C)` once `C` is known to be separating. -/ -def outside (C : Set Plane) : Set Plane := +@[expose] def outside (C : Set Plane) : Set Plane := {x | x ∉ C ∧ ¬ IsBounded (connectedComponentIn Cᶜ x)} theorem mem_inside_iff : x ∈ inside C ↔ x ∉ C ∧ IsBounded (connectedComponentIn Cᶜ x) := Iff.rfl @@ -200,10 +200,10 @@ are *the* two regions". Both are stated without a separation hypothesis; the fac them useful carry one. -/ /-- `Ω` is a region of the complement of `C`. -/ -def IsRegionOf (C Ω : Set Plane) : Prop := Ω = inside C ∨ Ω = outside C +@[expose] def IsRegionOf (C Ω : Set Plane) : Prop := Ω = inside C ∨ Ω = outside C /-- `Ω` and `Ω'` are the two regions of the complement of `C`, in one order or the other. -/ -def IsRegionPair (C Ω Ω' : Set Plane) : Prop := +@[expose] def IsRegionPair (C Ω Ω' : Set Plane) : Prop := (Ω = inside C ∧ Ω' = outside C) ∨ (Ω = outside C ∧ Ω' = inside C) /-- Every component of the complement is one of the two regions: there are no others. This is diff --git a/LeanPool/Schoenflies/CrosscutEncloses.lean b/LeanPool/Schoenflies/CrosscutEncloses.lean index f985a26fb5..c6782cd01a 100755 --- a/LeanPool/Schoenflies/CrosscutEncloses.lean +++ b/LeanPool/Schoenflies/CrosscutEncloses.lean @@ -102,7 +102,7 @@ have to add the field. combinatorial half `Graph.CrosscutExists`. -/ -@[expose] public section +public section open Bornology Set diff --git a/LeanPool/Schoenflies/CrosscutExists.lean b/LeanPool/Schoenflies/CrosscutExists.lean index 28befcec90..04d5b8101f 100755 --- a/LeanPool/Schoenflies/CrosscutExists.lean +++ b/LeanPool/Schoenflies/CrosscutExists.lean @@ -76,7 +76,7 @@ development; they are the missing companions of `Graph.IsPath.split_meet` and the descent step of `lem:outer-chain`. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph diff --git a/LeanPool/Schoenflies/Curve.lean b/LeanPool/Schoenflies/Curve.lean index 1fbbeaeccd..bd7cbc3015 100755 --- a/LeanPool/Schoenflies/Curve.lean +++ b/LeanPool/Schoenflies/Curve.lean @@ -34,7 +34,7 @@ form most of the development speaks, since gluing and cutting are stated about e * `IsLoop` — the parametrisation underlying a Jordan curve. -/ -@[expose] public section +public section open Set unitInterval @@ -43,12 +43,12 @@ namespace Schoenflies /-! ### Arcs -/ /-- A simple arc: the image of a continuous injective map on `[0, 1]`. -/ -def IsArc (A : Set Plane) : Prop := +@[expose] def IsArc (A : Set Plane) : Prop := ∃ f : ℝ → Plane, ContinuousOn f I ∧ InjOn f I ∧ f '' I = A /-- An arc between two named points: the set-level reading, and the form gluing and cutting are stated in. -/ -def IsArcBetween (A : Set Plane) (p q : Plane) : Prop := +@[expose] def IsArcBetween (A : Set Plane) (p q : Plane) : Prop := ∃ f : ℝ → Plane, ContinuousOn f I ∧ InjOn f I ∧ f '' I = A ∧ f 0 = p ∧ f 1 = q /-- A loop: continuous on `[0, 1]`, returning to its start, and injective before it does. -/ @@ -58,7 +58,7 @@ structure IsLoop (f : ℝ → Plane) : Prop where injOn : InjOn f (Ico 0 1) /-- A Jordan curve: the image of a loop. -/ -def IsJordanCurve (C : Set Plane) : Prop := +@[expose] def IsJordanCurve (C : Set Plane) : Prop := ∃ f : ℝ → Plane, IsLoop f ∧ f '' I = C /-! ### The unit interval, as a subset of `ℝ` -/ diff --git a/LeanPool/Schoenflies/Direction.lean b/LeanPool/Schoenflies/Direction.lean index b5b18f16b4..5e2972af8a 100755 --- a/LeanPool/Schoenflies/Direction.lean +++ b/LeanPool/Schoenflies/Direction.lean @@ -64,7 +64,7 @@ for the two right germs, and there the missing second sign is exactly what "`s/t `Plane.exists_germ_threshold` supplies it, with an explicit threshold. -/ -@[expose] public section +public section open Set @@ -78,7 +78,7 @@ variable {u w d d₁ d₂ r₁ r₂ v : Plane} {r t s : ℝ} /-- A *direction* is a unit vector. Only the ray a direction spans ever matters below, but normalising to unit length gives a canonical representative of that ray. -/ -def IsDirection (u : Plane) : Prop := ‖u‖ = 1 +@[expose] def IsDirection (u : Plane) : Prop := ‖u‖ = 1 theorem IsDirection.ne_zero (hu : IsDirection u) : u ≠ 0 := by intro h @@ -88,7 +88,7 @@ theorem IsDirection.ne_zero (hu : IsDirection u) : u ≠ 0 := by theorem IsDirection.norm (hu : IsDirection u) : ‖u‖ = 1 := hu /-- The unit vector along a nonzero vector. -/ -noncomputable def dir (u : Plane) : Plane := ‖u‖⁻¹ • u +@[expose] noncomputable def dir (u : Plane) : Plane := ‖u‖⁻¹ • u theorem isDirection_dir (hu : u ≠ 0) : IsDirection (dir u) := by have hpos : 0 < ‖u‖ := norm_pos_iff.2 hu @@ -137,7 +137,7 @@ theorem det_ne_zero_iff (hu : IsDirection u) (hw : IsDirection w) : A nonzero `d` lies on it when at least two of the three consecutive orientation forms of the triple `(u, d, w)` are positive. The definition is a cyclic condition, so it is correct for the short arc and for the long arc alike, with no hypothesis on the sign of `det u w`. -/ -def arcCCW (u w : Plane) : Set Plane := +@[expose] def arcCCW (u w : Plane) : Set Plane := {d | (0 < det u d ∧ 0 < det d w) ∨ (0 < det d w ∧ 0 < det w u) ∨ (0 < det w u ∧ 0 < det u d)} /-- Fix the orientation by `0 < det u w`, so that `w` is counterclockwise of `u` by less than a diff --git a/LeanPool/Schoenflies/Endgame.lean b/LeanPool/Schoenflies/Endgame.lean index 03b0334b35..46d448b960 100755 --- a/LeanPool/Schoenflies/Endgame.lean +++ b/LeanPool/Schoenflies/Endgame.lean @@ -92,7 +92,7 @@ into the module that owns `Schoenflies.IsHomeoOn`: `Schoenflies.paste` and `Schoenflies.Plane.IsSquareMover.isHomeoOn`. -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/FaceCycles.lean b/LeanPool/Schoenflies/FaceCycles.lean index fb0b85dc36..ced1fec7f9 100755 --- a/LeanPool/Schoenflies/FaceCycles.lean +++ b/LeanPool/Schoenflies/FaceCycles.lean @@ -110,7 +110,7 @@ Root `Graph`, as fixed by `Schoenflies/Graph/Walk.lean`. The two arc lemmas are side". -/ -@[expose] public section +public section open Set open scoped Graph @@ -264,7 +264,7 @@ theorem pathGraphOf_mono (h : W ⊆ D) : G.pathGraphOf u W ≤ G.pathGraphOf u D /-- The subgraph of `G` drawn by a cycle: the detour followed by the edge, as a closed walk. Exported as the object rather than hidden behind an existential — the consumer of `lem:face-cycles` needs the graph itself, to feed it to the ear decomposition. -/ -def cycleGraph (G : Graph α β) (u : α) (e : β) (D : List β) : Graph α β := +@[expose] def cycleGraph (G : Graph α β) (u : α) (e : β) (D : List β) : Graph α β := G.pathGraphOf u (D ++ [e]) /-- The detour spans a path subgraph of the cycle. -/ diff --git a/LeanPool/Schoenflies/FaceCyclesLand.lean b/LeanPool/Schoenflies/FaceCyclesLand.lean index c53cc90545..ac47d968f7 100755 --- a/LeanPool/Schoenflies/FaceCyclesLand.lean +++ b/LeanPool/Schoenflies/FaceCyclesLand.lean @@ -78,7 +78,7 @@ Once this module is moved above `Schoenflies/FaceCyclesProof.lean`, the hypothes * `Graph.IsFaceCycle.eq_inside_of_isBounded'` — "in particular, every bounded face is the interior of its boundary cycle". -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/FaceCyclesProof.lean b/LeanPool/Schoenflies/FaceCyclesProof.lean index 34845a4691..940f52cece 100755 --- a/LeanPool/Schoenflies/FaceCyclesProof.lean +++ b/LeanPool/Schoenflies/FaceCyclesProof.lean @@ -103,7 +103,7 @@ general and belong in `Schoenflies/Graph/Walk.lean` and `Schoenflies/Graph/Cycle * `Graph.face_cycles` — `lem:face-cycles`, modulo `Schoenflies.CrosscutSplitsRegion`. -/ -@[expose] public section +public section open Metric Set unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/FiniteTransfer.lean b/LeanPool/Schoenflies/FiniteTransfer.lean index 9d17f877f4..d4fd91490c 100755 --- a/LeanPool/Schoenflies/FiniteTransfer.lean +++ b/LeanPool/Schoenflies/FiniteTransfer.lean @@ -142,7 +142,7 @@ there as `Schoenflies.finite_transfer_toward_square`. finite-transfer induction parametrized by its two construction interfaces. -/ -@[expose] public section +public section open Metric Set open scoped Graph diff --git a/LeanPool/Schoenflies/FiniteTransferTarget.lean b/LeanPool/Schoenflies/FiniteTransferTarget.lean index 3a34f9df34..0f7ff4678e 100755 --- a/LeanPool/Schoenflies/FiniteTransferTarget.lean +++ b/LeanPool/Schoenflies/FiniteTransferTarget.lean @@ -57,7 +57,7 @@ incident with one unique current source face. and direction-(b) theorem assuming only that combinatorial invariant. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/FiniteTransferTargetMesh.lean b/LeanPool/Schoenflies/FiniteTransferTargetMesh.lean index ef83a11f4e..b227a4d161 100755 --- a/LeanPool/Schoenflies/FiniteTransferTargetMesh.lean +++ b/LeanPool/Schoenflies/FiniteTransferTargetMesh.lean @@ -40,7 +40,7 @@ condition follows with no ear-order argument. conclusion reduced to propagation of one static outer-cycle invariant. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/FreshAccess.lean b/LeanPool/Schoenflies/FreshAccess.lean index ce3cb98756..81d6b967eb 100755 --- a/LeanPool/Schoenflies/FreshAccess.lean +++ b/LeanPool/Schoenflies/FreshAccess.lean @@ -79,7 +79,7 @@ cone, and the induction is what will discharge it. domain-restricted absorption interface. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/FreshDenseSelection.lean b/LeanPool/Schoenflies/FreshDenseSelection.lean index ab14d884cd..18fd0dcba5 100755 --- a/LeanPool/Schoenflies/FreshDenseSelection.lean +++ b/LeanPool/Schoenflies/FreshDenseSelection.lean @@ -33,7 +33,7 @@ Any connected set avoiding all selected anchors must therefore have the required target stars have diameter less than twice the selected mesh scale. -/ -@[expose] public section +public section open Metric Set Topology open scoped Graph diff --git a/LeanPool/Schoenflies/GeneralCrosscut.lean b/LeanPool/Schoenflies/GeneralCrosscut.lean index 3fcf103691..ad8ea9d7e6 100755 --- a/LeanPool/Schoenflies/GeneralCrosscut.lean +++ b/LeanPool/Schoenflies/GeneralCrosscut.lean @@ -70,7 +70,7 @@ Neither is a restatement of anything proved here. and the only new fact about arcs this module needs. -/ -@[expose] public section +public section open Bornology Set unitInterval diff --git a/LeanPool/Schoenflies/GeneratedStructure.lean b/LeanPool/Schoenflies/GeneratedStructure.lean index af8b0bb394..1759a4d419 100755 --- a/LeanPool/Schoenflies/GeneratedStructure.lean +++ b/LeanPool/Schoenflies/GeneratedStructure.lean @@ -90,7 +90,7 @@ definitions below therefore declare `σ ≼ σ` for every new cell; that is the this module adds a pair the blueprint's prose does not list. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph @@ -114,7 +114,7 @@ two new edges `e₁ : x — v`, `e₂ : v — y`. The three guards `f ≠ e`, `f ≠ e₁`, `f ≠ e₂` on the surviving links make the three disjuncts mutually exclusive with no hypotheses, and `hne` does the same for the last two. The freshness hypotheses `h₁`, `h₂` are what make `edgeSet` right. -/ -def subdivGraph (H : Graph γ γ) (e x y v e₁ e₂ : γ) (hne : e₁ ≠ e₂) +@[expose] def subdivGraph (H : Graph γ γ) (e x y v e₁ e₂ : γ) (hne : e₁ ≠ e₂) (h₁ : e₁ ∉ E(H)) (h₂ : e₂ ∉ E(H)) : Graph γ γ where vertexSet := V(H) ∪ {z | z = v ∧ H.IsLink e x y} edgeSet := (E(H) \ {e}) ∪ {f | (f = e₁ ∨ f = e₂) ∧ H.IsLink e x y} @@ -238,7 +238,7 @@ theorem faces_ne_edgeSet {z w : γ} (hz : z ∈ S.faces) (hw : w ∈ E(S.skel)) /-- The cells of a walk: its edges, and the vertices it visits. This is what the blueprint calls "the cells of the boundary walk `Bᵢ`". -/ -def pathCells (u : γ) (W : List γ) : Set γ := {c | c ∈ W} ∪ S.skel.walkVertices u W +@[expose] def pathCells (u : γ) (W : List γ) : Set γ := {c | c ∈ W} ∪ S.skel.walkVertices u W variable {S} @@ -365,13 +365,13 @@ theorem newEdge₂_notMem_outer : d.newEdge₂ ∉ E(S.outerGraph) := fun h => d.newEdge₂_notMem_edgeSet (S.outerGraph_le.edgeSet_mono h) /-- The subdivided skeleton. -/ -def skeleton : Graph γ γ := +@[expose] def skeleton : Graph γ γ := subdivGraph S.skel d.edge d.left d.right d.newVertex d.newEdge₁ d.newEdge₂ d.newEdge_ne d.newEdge₁_notMem_edgeSet d.newEdge₂_notMem_edgeSet /-- The subdivided outer cycle. When the subdivided edge is not an outer edge this is the old outer cycle unchanged (`SubdivData.outer_eq`). -/ -def outer : Graph γ γ := +@[expose] def outer : Graph γ γ := subdivGraph S.outerGraph d.edge d.left d.right d.newVertex d.newEdge₁ d.newEdge₂ d.newEdge_ne d.newEdge₁_notMem_outer d.newEdge₂_notMem_outer @@ -435,6 +435,7 @@ open scoped Classical in The boundary walks are the orientation-aware replacements carried by `SubdivData`. They must arrive as data because an edge list does not determine the direction in which its walk crosses the subdivided edge; the two incident face boundaries can traverse it in opposite directions. -/ +@[expose] noncomputable def subdivideEdge (S : CellStructure γ) (d : S.SubdivData) : CellStructure γ where skel := d.skeleton faces := S.faces @@ -619,7 +620,7 @@ theorem paths_disjoint ⦃f : γ⦄ (h₁ : f ∈ d.path₁) (h₂ : f ∈ d.pat S.disjoint_vertexSet_edgeSet.ne_of_mem d.isPath₁.right_mem hfE rfl] /-- All cells of the ear: its vertices, including its two old ends, and its edges. -/ -def earCells : Set γ := V(d.ear) ∪ E(d.ear) +@[expose] def earCells : Set γ := V(d.ear) ∪ E(d.ear) /-- The cells the split creates: the interior cells of the ear, its edges, and the two new 2-cells. The ear's two ends are *not* new — they are old vertices, and the blueprint is @@ -627,10 +628,10 @@ explicit that they are their own parents. -/ def newCells : Set γ := (V(d.ear) \ {d.source, d.target}) ∪ E(d.ear) ∪ {d.face₁, d.face₂} /-- The cells of the first boundary path. -/ -def cells₁ : Set γ := S.pathCells d.source d.path₁ +@[expose] def cells₁ : Set γ := S.pathCells d.source d.path₁ /-- The cells of the second boundary path. -/ -def cells₂ : Set γ := S.pathCells d.source d.path₂ +@[expose] def cells₂ : Set γ := S.pathCells d.source d.path₂ theorem source_mem_skel : d.source ∈ V(S.skel) := d.isPath₁.left_mem @@ -682,7 +683,7 @@ theorem compatible : S.skel.Compatible d.ear := Graph.Compatible.of_disjoint_edgeSet d.disjoint_edgeSet /-- The skeleton after the split: the old skeleton with the ear glued in along its two ends. -/ -def skeleton : Graph γ γ := S.skel.union d.ear +@[expose] def skeleton : Graph γ γ := S.skel.union d.ear @[simp] theorem skeleton_vertexSet : V(d.skeleton) = V(S.skel) ∪ V(d.ear) := rfl @@ -719,6 +720,7 @@ open scoped Classical in As with `CellStructure.subdivideEdge`, the boundary walks are a raw datum: the two new 2-cells get the concatenation of their boundary path with the reversed ear, and nothing below reads the orientation. -/ +@[expose] noncomputable def splitFace (S : CellStructure γ) (d : S.SplitData) : CellStructure γ where skel := d.skeleton faces := insert d.face₁ (insert d.face₂ (S.faces \ {d.face})) diff --git a/LeanPool/Schoenflies/Graph/Component.lean b/LeanPool/Schoenflies/Graph/Component.lean index 9148bab5c0..9a6546b532 100755 --- a/LeanPool/Schoenflies/Graph/Component.lean +++ b/LeanPool/Schoenflies/Graph/Component.lean @@ -79,7 +79,7 @@ must aim at a vertex of `S` other than `c`. In the application `S` is the vertex Root `Graph`, as fixed by `Schoenflies/Graph/Walk.lean`. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/Cycle.lean b/LeanPool/Schoenflies/Graph/Cycle.lean index 45ce07a4f4..7a00e72d8a 100755 --- a/LeanPool/Schoenflies/Graph/Cycle.lean +++ b/LeanPool/Schoenflies/Graph/Cycle.lean @@ -76,7 +76,7 @@ subgraph can answer differently. `Graph.IsWalk.anti` from `Walk.lean` is the eng a cycle"; the form the tree module's longest-path argument consumes. -/ -@[expose] public section +public section open Set @@ -128,7 +128,7 @@ theorem IsWalk.reaches_deleteEdges (h : G.IsWalk u W v) (hW : ∀ f ∈ W, f ∉ /-- `G.IsCycleThrough e u v D` : the edge `e` links `u` to `v`, and `D` is a path from `u` back to `v` that does not use `e`. The cycle is `e` together with `D`; it is presented through `e` because that is the edge every question is asked about. -/ -def IsCycleThrough (G : Graph α β) (e : β) (u v : α) (D : List β) : Prop := +@[expose] def IsCycleThrough (G : Graph α β) (e : β) (u v : α) (D : List β) : Prop := G.IsLink e u v ∧ G.IsPath u D v ∧ e ∉ D /-- `G.LiesOnCycle e` : the edge `e` lies on a cycle of `G`. -/ diff --git a/LeanPool/Schoenflies/Graph/CycleJordan.lean b/LeanPool/Schoenflies/Graph/CycleJordan.lean index 0bbb210eb3..897b47bcad 100755 --- a/LeanPool/Schoenflies/Graph/CycleJordan.lean +++ b/LeanPool/Schoenflies/Graph/CycleJordan.lean @@ -60,7 +60,7 @@ realisation is a single arc and not a Jordan curve. inclusion of it, but the equality is what the blueprint asserts. -/ -@[expose] public section +public section open Set Schoenflies unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/Degree.lean b/LeanPool/Schoenflies/Graph/Degree.lean index db162b55fa..2ef8e0e9da 100755 --- a/LeanPool/Schoenflies/Graph/Degree.lean +++ b/LeanPool/Schoenflies/Graph/Degree.lean @@ -73,7 +73,7 @@ notation `G.degree`, `G.IsLeaf`, `G.vertexFinset` works on a `G : Graph α β`. modules should do the same. -/ -@[expose] public section +public section open scoped Graph @@ -111,7 +111,7 @@ noncomputable def vertexFinset (G : Graph α β) [G.Finite] : Finset α := (finite_vertexSet G).toFinset /-- The edge set of a finite graph, as a `Finset`. -/ -noncomputable def edgeFinset (G : Graph α β) [G.Finite] : Finset β := +@[expose] noncomputable def edgeFinset (G : Graph α β) [G.Finite] : Finset β := (finite_edgeSet G).toFinset @[simp] @@ -156,7 +156,7 @@ theorem finite_loopSet [G.Finite] (x : α) : (G.loopSet x).Finite := /-- `G.degree x` is the number of edge ends of `G` at the vertex `x`: a non-loop edge incident with `x` contributes one, a loop at `x` contributes two. -/ -noncomputable def degree (G : Graph α β) (x : α) : ℕ := +@[expose] noncomputable def degree (G : Graph α β) (x : α) : ℕ := (G.incidenceSet x).ncard + (G.loopSet x).ncard theorem degree_def (G : Graph α β) (x : α) : diff --git a/LeanPool/Schoenflies/Graph/Drawing.lean b/LeanPool/Schoenflies/Graph/Drawing.lean index 2717c806be..e85b4f6dbc 100755 --- a/LeanPool/Schoenflies/Graph/Drawing.lean +++ b/LeanPool/Schoenflies/Graph/Drawing.lean @@ -49,7 +49,7 @@ only that are unaffected. rather than indexed, so no face has to be produced before it is spoken about. -/ -@[expose] public section +public section open Metric Set Schoenflies unitInterval open scoped Graph @@ -59,7 +59,7 @@ namespace Graph variable {β : Type*} {G : Graph Plane β} {drawing : β → ℝ → Plane} {base : Plane} /-- The point set of a single edge: the image of its parametrization on `[0, 1]`. -/ -def edgeArc (drawing : β → ℝ → Plane) (e : β) : Set Plane := drawing e '' I +@[expose] def edgeArc (drawing : β → ℝ → Plane) (e : β) : Set Plane := drawing e '' I /-- A drawing of an abstract graph in the plane. @@ -128,7 +128,7 @@ end IsDrawing /-! ### What a plane graph occupies -/ /-- The point set of a plane graph: its vertices together with all of its edge arcs. -/ -def pointSet (G : Graph Plane β) (drawing : β → ℝ → Plane) : Set Plane := +@[expose] def pointSet (G : Graph Plane β) (drawing : β → ℝ → Plane) : Set Plane := V(G) ∪ ⋃ e ∈ E(G), edgeArc drawing e theorem vertexSet_subset_pointSet : V(G) ⊆ pointSet G drawing := subset_union_left @@ -148,7 +148,7 @@ theorem IsDrawing.isClosed_pointSet [G.Finite] (h : IsDrawing G drawing) : IsClosed (pointSet G drawing) := h.isCompact_pointSet.isClosed /-- The exterior of a plane graph: everything the drawing does not occupy. -/ -def exterior (G : Graph Plane β) (drawing : β → ℝ → Plane) : Set Plane := +@[expose] def exterior (G : Graph Plane β) (drawing : β → ℝ → Plane) : Set Plane := (pointSet G drawing)ᶜ theorem IsDrawing.isOpen_exterior [G.Finite] (h : IsDrawing G drawing) : @@ -156,7 +156,7 @@ theorem IsDrawing.isOpen_exterior [G.Finite] (h : IsDrawing G drawing) : /-- A face of a plane graph, named by a point of the exterior rather than indexed: no face has to be produced before it can be spoken about. -/ -def face (G : Graph Plane β) (drawing : β → ℝ → Plane) (base : Plane) : Set Plane := +@[expose] def face (G : Graph Plane β) (drawing : β → ℝ → Plane) (base : Plane) : Set Plane := connectedComponentIn (exterior G drawing) base theorem face_subset_exterior (G : Graph Plane β) (drawing : β → ℝ → Plane) (base : Plane) : diff --git a/LeanPool/Schoenflies/Graph/Ear.lean b/LeanPool/Schoenflies/Graph/Ear.lean index 2d9df9bdec..a73061df1a 100755 --- a/LeanPool/Schoenflies/Graph/Ear.lean +++ b/LeanPool/Schoenflies/Graph/Ear.lean @@ -90,7 +90,7 @@ consumer discharges it from its drawing. 2-connected graph has no bridge", turned into one transfer lemma. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/K33.lean b/LeanPool/Schoenflies/Graph/K33.lean index a4bec72b43..a184df0926 100755 --- a/LeanPool/Schoenflies/Graph/K33.lean +++ b/LeanPool/Schoenflies/Graph/K33.lean @@ -85,7 +85,7 @@ that `exists_two_chords_same_side` wants. It returns two remaining edges on the and `chords_disjoint` says they do not. -/ -@[expose] public section +public section open Set Schoenflies unitInterval open scoped Graph @@ -158,14 +158,14 @@ through the edge `e 0 0`, with a detour path running the other way round. -/ /-- The index pairs of the six edges of the six-cycle, in the order the cycle is traversed starting from `e 0 0`. Kept as index pairs, not as edges, because every question about which edges the cycle uses is then decidable. -/ -def hexPairs : List (Fin 3 × Fin 3) := [(0, 0), (0, 2), (2, 2), (2, 1), (1, 1), (1, 0)] +@[expose] def hexPairs : List (Fin 3 × Fin 3) := [(0, 0), (0, 2), (2, 2), (2, 1), (1, 1), (1, 0)] /-- The five edges of the detour of the six-cycle: the path `x₀ → y₂ → x₂ → y₁ → x₁ → y₀` that returns to the other end of `e 0 0`. -/ -def hexDetour (e : Fin 3 → Fin 3 → β) : List β := [e 0 2, e 2 2, e 2 1, e 1 1, e 1 0] +@[expose] def hexDetour (e : Fin 3 → Fin 3 → β) : List β := [e 0 2, e 2 2, e 2 1, e 1 1, e 1 0] /-- The six edges of the six-cycle. -/ -def hexList (e : Fin 3 → Fin 3 → β) : List β := e 0 0 :: hexDetour e +@[expose] def hexList (e : Fin 3 → Fin 3 → β) : List β := e 0 0 :: hexDetour e theorem hexList_eq_map (e : Fin 3 → Fin 3 → β) : hexList e = hexPairs.map fun p ↦ e p.1 p.2 := rfl @@ -254,16 +254,18 @@ to the first and one end interior to the second — this is the blueprint's "the alternate on the six-cycle". -/ /-- Index pairs of the first of the two paths the ends of `e s (s+1)` cut the six-cycle into. -/ -def arcAPairs (s : Fin 3) : List (Fin 3 × Fin 3) := [(s, s), (s + 1, s), (s + 1, s + 1)] +@[expose] def arcAPairs (s : Fin 3) : List (Fin 3 × Fin 3) := [(s, s), (s + 1, s), (s + 1, s + 1)] /-- Index pairs of the second of the two paths. -/ +@[expose] def arcBPairs (s : Fin 3) : List (Fin 3 × Fin 3) := [(s, s + 2), (s + 2, s + 2), (s + 2, s + 1)] /-- The edges of the first path. -/ +@[expose] def arcA (e : Fin 3 → Fin 3 → β) (s : Fin 3) : List β := [e s s, e (s + 1) s, e (s + 1) (s + 1)] /-- The edges of the second path. -/ -def arcB (e : Fin 3 → Fin 3 → β) (s : Fin 3) : List β := +@[expose] def arcB (e : Fin 3 → Fin 3 → β) (s : Fin 3) : List β := [e s (s + 2), e (s + 2) (s + 2), e (s + 2) (s + 1)] theorem arcA_eq_map (e : Fin 3 → Fin 3 → β) (s : Fin 3) : diff --git a/LeanPool/Schoenflies/Graph/K33Closed.lean b/LeanPool/Schoenflies/Graph/K33Closed.lean index de5068a78a..5f82487f8a 100755 --- a/LeanPool/Schoenflies/Graph/K33Closed.lean +++ b/LeanPool/Schoenflies/Graph/K33Closed.lean @@ -63,7 +63,7 @@ genuinely about changing the drawing, not about presentations. `Graph.Bendable` statement in the shape the theorems below consume; nothing here proves it. -/ -@[expose] public section +public section open Metric Set unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/K33Land.lean b/LeanPool/Schoenflies/Graph/K33Land.lean index f5a3ce7f80..676b0cf63b 100755 --- a/LeanPool/Schoenflies/Graph/K33Land.lean +++ b/LeanPool/Schoenflies/Graph/K33Land.lean @@ -96,7 +96,7 @@ With this module in place `Graph.IsHexRealization`, `Graph.IsHexCrosscut`, `Grap and `Graph.Bendable` have no consumers left. -/ -@[expose] public section +public section open Bornology Metric Set unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/K33Planar.lean b/LeanPool/Schoenflies/Graph/K33Planar.lean index 04bff6feee..c7dc209bd8 100755 --- a/LeanPool/Schoenflies/Graph/K33Planar.lean +++ b/LeanPool/Schoenflies/Graph/K33Planar.lean @@ -77,7 +77,7 @@ realization a polygonal drawing and accepts *any* drawing back. This restriction interface that lets the two cut points be interior to edges of `C`. -/ -@[expose] public section +public section open Set Schoenflies unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/OuterFace.lean b/LeanPool/Schoenflies/Graph/OuterFace.lean index cf2137487c..2b31175521 100755 --- a/LeanPool/Schoenflies/Graph/OuterFace.lean +++ b/LeanPool/Schoenflies/Graph/OuterFace.lean @@ -29,7 +29,7 @@ been, so "the outer face" is "the face through any point far enough out". the outer face. -/ -@[expose] public section +public section open Metric Set Schoenflies unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/PathGraph.lean b/LeanPool/Schoenflies/Graph/PathGraph.lean index 089da2cd3d..44a4b49e5f 100755 --- a/LeanPool/Schoenflies/Graph/PathGraph.lean +++ b/LeanPool/Schoenflies/Graph/PathGraph.lean @@ -72,7 +72,7 @@ Root `Graph`, as fixed by `Schoenflies/Graph/Walk.lean`, so that `h.reaches_an_e `G.pathGraphOf u W` resolve by dot notation. -/ -@[expose] public section +public section open Set open scoped Graph @@ -239,7 +239,7 @@ carrying exactly the walk's own edges. This is the construction an ear decomposition needs — a path found inside a big graph, turned into a graph of its own so that it can be unioned back in. It is built from Mathlib's `Graph.domRestrict` and `Graph.induce`, so that `Graph.pathGraphOf_le` is almost free. -/ -def pathGraphOf (G : Graph α β) (u : α) (W : List β) : Graph α β := +@[expose] def pathGraphOf (G : Graph α β) (u : α) (W : List β) : Graph α β := (G.restrict {e | e ∈ W}).induce (G.walkVertices u W) @[simp] diff --git a/LeanPool/Schoenflies/Graph/Redrawing.lean b/LeanPool/Schoenflies/Graph/Redrawing.lean index e5caa9286d..f4359bad55 100755 --- a/LeanPool/Schoenflies/Graph/Redrawing.lean +++ b/LeanPool/Schoenflies/Graph/Redrawing.lean @@ -67,7 +67,7 @@ Bricks B7 and B8 of `lem:polygonal-redrawing` (H6), and the lemma itself. the core inside its tube, and the assembly of radial, replacement path and radial. -/ -@[expose] public section +public section open Metric Set unitInterval open scoped Graph @@ -172,7 +172,7 @@ polygon already built, truncates there and appends. -/ /-- The last vertex of a nonempty vertex list, with the nonemptiness discharged by the `cons`. Carrying the list in the form `u :: t` removes every dependent proof argument from the statements below. -/ -def lastP (u : Plane) (t : List Plane) : Plane := (u :: t).getLast (List.cons_ne_nil u t) +@[expose] def lastP (u : Plane) (t : List Plane) : Plane := (u :: t).getLast (List.cons_ne_nil u t) @[simp] theorem lastP_nil (u : Plane) : lastP u [] = u := rfl diff --git a/LeanPool/Schoenflies/Graph/Relabel.lean b/LeanPool/Schoenflies/Graph/Relabel.lean index 1bbc88068a..afae540ffe 100755 --- a/LeanPool/Schoenflies/Graph/Relabel.lean +++ b/LeanPool/Schoenflies/Graph/Relabel.lean @@ -20,7 +20,7 @@ The relabelling map only has to be injective on the graph's edge set. Walks, pa graphs then push forward by mapping their edge lists. -/ -@[expose] public section +public section open Set open Schoenflies @@ -32,7 +32,7 @@ namespace Graph variable {α β δ : Type*} {G : Graph α β} {f : β → δ} /-- Relabel every edge of `G` by a map injective on `E(G)`, without changing its vertices. -/ -def relabelEdges (G : Graph α β) (f : β → δ) (hf : InjOn f E(G)) : Graph α δ where +@[expose] def relabelEdges (G : Graph α β) (f : β → δ) (hf : InjOn f E(G)) : Graph α δ where vertexSet := V(G) edgeSet := f '' E(G) IsLink d x y := ∃ e ∈ E(G), f e = d ∧ G.IsLink e x y diff --git a/LeanPool/Schoenflies/Graph/RelativeEar.lean b/LeanPool/Schoenflies/Graph/RelativeEar.lean index 877bd404e3..757b35d4fd 100755 --- a/LeanPool/Schoenflies/Graph/RelativeEar.lean +++ b/LeanPool/Schoenflies/Graph/RelativeEar.lean @@ -93,7 +93,7 @@ current graph and add the next geometric ear") and of the finite transfer of Par Root `Graph`, as fixed by `Schoenflies/Graph/Walk.lean`. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/Tree.lean b/LeanPool/Schoenflies/Graph/Tree.lean index e328362aa8..5317cd4d80 100755 --- a/LeanPool/Schoenflies/Graph/Tree.lean +++ b/LeanPool/Schoenflies/Graph/Tree.lean @@ -60,7 +60,7 @@ single edge, and a path takes no edge twice. The root `Graph` namespace, as in `Walk.lean`, `Degree.lean` and `Cycle.lean`. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/TwoConnected.lean b/LeanPool/Schoenflies/Graph/TwoConnected.lean index 66c56a2e9a..ea552f0872 100755 --- a/LeanPool/Schoenflies/Graph/TwoConnected.lean +++ b/LeanPool/Schoenflies/Graph/TwoConnected.lean @@ -102,7 +102,7 @@ subgraphs of the union. have at least two vertices in common, their union is 2-connected". -/ -@[expose] public section +public section open Set @@ -186,7 +186,7 @@ def IsCutVertex (G : Graph α β) (x : α) : Prop := /-- The graph has three pairwise distinct vertices. Stated existentially rather than as `3 ≤ V(G).ncard` so that it is monotone with no finiteness hypothesis. -/ -def HasThreeVertices (G : Graph α β) : Prop := +@[expose] def HasThreeVertices (G : Graph α β) : Prop := ∃ a ∈ V(G), ∃ b ∈ V(G), ∃ c ∈ V(G), a ≠ b ∧ a ≠ c ∧ b ≠ c /-- On a graph with finitely many vertices the clause is the count it is named for. Kept so @@ -276,7 +276,7 @@ theorem IsTwoConnected.no_bridge (h : G.IsTwoConnected) (hl : G.IsLink e u v) : needed, since two graphs may disagree about the ends of a shared edge name; for `Graph.Compatible` graphs, which is the only case the development forms, the disjunction collapses to the naive one. -/ -protected def union (G H : Graph α β) : Graph α β where +@[expose] protected def union (G H : Graph α β) : Graph α β where vertexSet := V(G) ∪ V(H) edgeSet := E(G) ∪ E(H) IsLink e x y := G.IsLink e x y ∨ (e ∉ E(G) ∧ H.IsLink e x y) diff --git a/LeanPool/Schoenflies/Graph/TwoPaths.lean b/LeanPool/Schoenflies/Graph/TwoPaths.lean index c735d0f8c1..925277eb93 100755 --- a/LeanPool/Schoenflies/Graph/TwoPaths.lean +++ b/LeanPool/Schoenflies/Graph/TwoPaths.lean @@ -32,7 +32,7 @@ one cycle at a time, and any later argument that has to see a subdivided closed * `Graph.isTwoConnected_of_two_paths` — the cycle base case of `lem:union-two-connected`. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Graph/VertexSquares.lean b/LeanPool/Schoenflies/Graph/VertexSquares.lean index e4ccfc87ba..00af18d4d7 100755 --- a/LeanPool/Schoenflies/Graph/VertexSquares.lean +++ b/LeanPool/Schoenflies/Graph/VertexSquares.lean @@ -57,7 +57,7 @@ Bricks B2, B3 and B4 of `lem:polygonal-redrawing`. which is a property of the whole arc. -/ -@[expose] public section +public section open Metric Set unitInterval diff --git a/LeanPool/Schoenflies/Graph/Walk.lean b/LeanPool/Schoenflies/Graph/Walk.lean index 08370fcd72..94bdbe42e0 100755 --- a/LeanPool/Schoenflies/Graph/Walk.lean +++ b/LeanPool/Schoenflies/Graph/Walk.lean @@ -82,7 +82,7 @@ by shortening an arbitrary walk at repeated vertices"). This file supplies that vertex it visits; what `lem:subdivision-ear-preserve` and `lem:relative-ear` run on. -/ -@[expose] public section +public section open Set @@ -93,11 +93,12 @@ namespace Graph /-! ### The vertices an edge list touches -/ /-- The vertices lying on at least one edge of `W`. -/ -def coveredVertices (G : Graph α β) (W : List β) : Set α := {x | ∃ e ∈ W, G.Inc e x} +@[expose] def coveredVertices (G : Graph α β) (W : List β) : Set α := {x | ∃ e ∈ W, G.Inc e x} /-- The vertices a walk from `u` along `W` visits: its source, plus the ends of every edge it takes. Defined for any edge list, not just for one that walks — the freshness clause of a path reads it about the *rest* of the path before that rest is known to be a walk at all. -/ +@[expose] def walkVertices (G : Graph α β) (u : α) (W : List β) : Set α := insert u (G.coveredVertices W) theorem mem_coveredVertices_iff : x ∈ G.coveredVertices W ↔ ∃ e ∈ W, G.Inc e x := Iff.rfl @@ -452,7 +453,7 @@ theorem IsWalk.contains_path (h : G.IsWalk u W v) : ∃ P, G.IsPath u P v ∧ P /-- `G.Reaches u v` : some walk of `G` runs from `u` to `v`. Stated with a walk rather than a path because walks are what arguments build — they concatenate and reverse with no side condition — and a path is recovered on demand (`Graph.Reaches.exists_isPath`). -/ -def Reaches (G : Graph α β) (u v : α) : Prop := ∃ W, G.IsWalk u W v +@[expose] def Reaches (G : Graph α β) (u v : α) : Prop := ∃ W, G.IsWalk u W v theorem Reaches.left_mem (h : G.Reaches u v) : u ∈ V(G) := h.choose_spec.left_mem @@ -486,7 +487,7 @@ theorem Reaches.mono (hHG : H ≤ G) (h : H.Reaches u v) : G.Reaches u v := /-- A graph is connected when it has a vertex and every vertex reaches every other. The nonemptiness clause is not bureaucracy: it is what makes the counting statements about trees true as stated. -/ -def Connected (G : Graph α β) : Prop := +@[expose] def Connected (G : Graph α β) : Prop := V(G).Nonempty ∧ ∀ ⦃u⦄, u ∈ V(G) → ∀ ⦃v⦄, v ∈ V(G) → G.Reaches u v theorem Connected.nonempty (h : G.Connected) : V(G).Nonempty := h.1 diff --git a/LeanPool/Schoenflies/GridAttach.lean b/LeanPool/Schoenflies/GridAttach.lean index 569d166791..ca81a3a4b2 100755 --- a/LeanPool/Schoenflies/GridAttach.lean +++ b/LeanPool/Schoenflies/GridAttach.lean @@ -80,7 +80,7 @@ lemmas of this module, and all three are statements about `Γ`, never about the Neither is a restatement of a goal of this module, and both are true. -/ -@[expose] public section +public section open Metric Set open scoped Graph diff --git a/LeanPool/Schoenflies/InitialGenerated.lean b/LeanPool/Schoenflies/InitialGenerated.lean index d6f6746bb4..a8ce941432 100755 --- a/LeanPool/Schoenflies/InitialGenerated.lean +++ b/LeanPool/Schoenflies/InitialGenerated.lean @@ -83,7 +83,7 @@ holding the anchored form. (`rem:intermediate-disconnection` waives it only at intermediate stages). -/ -@[expose] public section +public section open Metric Set Topology unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/InitialOuterCycle.lean b/LeanPool/Schoenflies/InitialOuterCycle.lean index 95a15da528..c49ebaa14d 100755 --- a/LeanPool/Schoenflies/InitialOuterCycle.lean +++ b/LeanPool/Schoenflies/InitialOuterCycle.lean @@ -22,7 +22,7 @@ This module supplies its base case for the concrete initial hexagon. initial matched cellulation is its six-edge simple cycle. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/InitialPair.lean b/LeanPool/Schoenflies/InitialPair.lean index e2213e7055..3e54b67405 100755 --- a/LeanPool/Schoenflies/InitialPair.lean +++ b/LeanPool/Schoenflies/InitialPair.lean @@ -86,7 +86,7 @@ restatement of anything proved here. `prop:initial-pair`. -/ -@[expose] public section +public section open Metric Set Topology unitInterval open scoped Graph @@ -229,7 +229,7 @@ namespace InitialCell /-- The two ends of a cell, when it is an edge. Junk elsewhere; the graph below only ever consults it on an edge name. -/ -def ends : InitialCell → InitialCell × InitialCell +@[expose] def ends : InitialCell → InitialCell × InitialCell | .edge i => (.vert i, .vert (i + 1)) | .chord => (.vert 1, .vert 4) | c => (c, c) @@ -238,10 +238,10 @@ def ends : InitialCell → InitialCell × InitialCell def vertices : Set InitialCell := Set.range InitialCell.vert /-- The seven 1-cells: six outer edges and the crosscut. -/ -def edges : Set InitialCell := Set.range InitialCell.edge ∪ {InitialCell.chord} +@[expose] def edges : Set InitialCell := Set.range InitialCell.edge ∪ {InitialCell.chord} /-- The six outer 1-cells. -/ -def outerEdges : Set InitialCell := Set.range InitialCell.edge +@[expose] def outerEdges : Set InitialCell := Set.range InitialCell.edge /-- The two 2-cells. -/ def faces : Set InitialCell := Set.range InitialCell.face @@ -331,12 +331,12 @@ theorem initOuter_le_initSkel : initOuter ≤ initSkel := /-- The cells lying on the closed boundary of a 2-cell: the vertices and edges of `Bᵢ` together with the crosscut. `face false = R₁` is bounded by `B₁ ∪ P`, `face true = R₂` by `B₂ ∪ P`. -/ -def faceCells : Bool → Set InitialCell +@[expose] def faceCells : Bool → Set InitialCell | false => {.vert 1, .vert 2, .vert 3, .vert 4, .edge 1, .edge 2, .edge 3, .chord} | true => {.vert 4, .vert 5, .vert 0, .vert 1, .edge 4, .edge 5, .edge 0, .chord} /-- The cyclic boundary walk of each 2-cell, as a list of edge names. -/ -def initBoundary : InitialCell → List InitialCell +@[expose] def initBoundary : InitialCell → List InitialCell | .face false => [.edge 1, .edge 2, .edge 3, .chord] | .face true => [.edge 4, .edge 5, .edge 0, .chord] | _ => [] diff --git a/LeanPool/Schoenflies/InitialPairFixed.lean b/LeanPool/Schoenflies/InitialPairFixed.lean index a5cbeb6a1b..c6727294aa 100755 --- a/LeanPool/Schoenflies/InitialPairFixed.lean +++ b/LeanPool/Schoenflies/InitialPairFixed.lean @@ -80,7 +80,7 @@ lists it holds are closed walks of `initSkel` whose cells are exactly `faceCells anchor clause and the matched labelling in the statement. -/ -@[expose] public section +public section open Metric Set Topology unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/InitialReverseTransfer.lean b/LeanPool/Schoenflies/InitialReverseTransfer.lean index c21ef72a10..3caa3cfb71 100755 --- a/LeanPool/Schoenflies/InitialReverseTransfer.lean +++ b/LeanPool/Schoenflies/InitialReverseTransfer.lean @@ -28,7 +28,7 @@ cell name. Edge relabelling preserves the ambient boundary geometry used by rev subdivision hypotheses, and run reverse transfer. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/InteriorHomeomorphism.lean b/LeanPool/Schoenflies/InteriorHomeomorphism.lean index 5e510f9242..b731fb8995 100755 --- a/LeanPool/Schoenflies/InteriorHomeomorphism.lean +++ b/LeanPool/Schoenflies/InteriorHomeomorphism.lean @@ -17,7 +17,7 @@ the construction of the nested stage sequence and therefore obtains the limit ho between the inside of an arbitrary Jordan curve and the open square. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/Inversion.lean b/LeanPool/Schoenflies/Inversion.lean index 476a5ec9e0..e797a133de 100755 --- a/LeanPool/Schoenflies/Inversion.lean +++ b/LeanPool/Schoenflies/Inversion.lean @@ -95,7 +95,7 @@ abstract `IsSeparating` curve, do not need it. of `S` onto `T`" that `prop:exterior-extension` is phrased in. -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/Jordan.lean b/LeanPool/Schoenflies/Jordan.lean index d48322d5d5..d99e3734e9 100755 --- a/LeanPool/Schoenflies/Jordan.lean +++ b/LeanPool/Schoenflies/Jordan.lean @@ -89,7 +89,7 @@ blueprint's `Q_j` never appears: only the parameter blocks `[t 0 j, t 2 j]` do. `thm:jordan`. -/ -@[expose] public section +public section open Bornology Metric Set unitInterval diff --git a/LeanPool/Schoenflies/JordanClosed.lean b/LeanPool/Schoenflies/JordanClosed.lean index 5d220e2fe2..6465e7772f 100755 --- a/LeanPool/Schoenflies/JordanClosed.lean +++ b/LeanPool/Schoenflies/JordanClosed.lean @@ -44,7 +44,7 @@ Discharging the first makes `thm:arc-complement`, and with it `lem:accessible-de **`thm:general-crosscut`**. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/JordanSchoenflies.lean b/LeanPool/Schoenflies/JordanSchoenflies.lean index b41f2c83a2..0b9701c450 100755 --- a/LeanPool/Schoenflies/JordanSchoenflies.lean +++ b/LeanPool/Schoenflies/JordanSchoenflies.lean @@ -21,7 +21,7 @@ The declarations below close `thm:square-extension` and `thm:main`; the interven reduction, closed-interior, pointed, and exterior extensions are supplied by `Endgame.lean`. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/JordanSeparates.lean b/LeanPool/Schoenflies/JordanSeparates.lean index 5e97fc4860..2caed52835 100755 --- a/LeanPool/Schoenflies/JordanSeparates.lean +++ b/LeanPool/Schoenflies/JordanSeparates.lean @@ -84,7 +84,7 @@ Three groups of declarations here are general and have no home yet on `main`: `Graph.IsArcK33`. -/ -@[expose] public section +public section open Metric Set unitInterval diff --git a/LeanPool/Schoenflies/LimitMap.lean b/LeanPool/Schoenflies/LimitMap.lean index 767500aa29..d6b7077b53 100755 --- a/LeanPool/Schoenflies/LimitMap.lean +++ b/LeanPool/Schoenflies/LimitMap.lean @@ -93,7 +93,7 @@ All of the following live in `Schoenflies.CellStructure`. `LimitTower.tgtStar_subset_of_mem_cellNbhd`. -/ -@[expose] public section +public section open Set Metric Bornology Filter open scoped Graph diff --git a/LeanPool/Schoenflies/Line.lean b/LeanPool/Schoenflies/Line.lean index 552efae156..8e5d1657b2 100755 --- a/LeanPool/Schoenflies/Line.lean +++ b/LeanPool/Schoenflies/Line.lean @@ -55,7 +55,7 @@ merely in `closure U`. subset of `ℝ` is an open interval whose endpoints are outside the set. -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/LocalGrid.lean b/LeanPool/Schoenflies/LocalGrid.lean index c26bdc065a..6ad2b2ace5 100755 --- a/LeanPool/Schoenflies/LocalGrid.lean +++ b/LeanPool/Schoenflies/LocalGrid.lean @@ -80,7 +80,7 @@ report. "spanning 2-connected subgraph" form the assembly needs. -/ -@[expose] public section +public section open Metric Set open scoped Graph diff --git a/LeanPool/Schoenflies/LocallyPolygonal.lean b/LeanPool/Schoenflies/LocallyPolygonal.lean index 6e2cb86233..82adca75b1 100755 --- a/LeanPool/Schoenflies/LocallyPolygonal.lean +++ b/LeanPool/Schoenflies/LocallyPolygonal.lean @@ -53,7 +53,7 @@ point misses all the others outright, so `M` looks locally exactly like the one- pairwise disjoint closures is locally polygonally connected. -/ -@[expose] public section +public section open Metric Set @@ -143,11 +143,12 @@ theorem polyConnIn_union_of_convex {C D : Set Plane} (hC : Convex ℝ C) (hD : C `U ∩ S` is the relative neighbourhood; stating it through an ambient open set avoids carrying a subtype topology. Note the paths are required to lie in `S`, not in the neighbourhood — that is the form brick B6's clopen argument consumes. -/ -def IsLocallyPolyConnAt (S : Set Plane) (p : Plane) : Prop := +@[expose] def IsLocallyPolyConnAt (S : Set Plane) (p : Plane) : Prop := ∃ U : Set Plane, IsOpen U ∧ p ∈ U ∧ ∀ x ∈ U ∩ S, ∀ y ∈ U ∩ S, PolyConnIn S x y /-- `S` is locally polygonally connected: polygonally connected near each of its points. -/ -def IsLocallyPolyConn (S : Set Plane) : Prop := ∀ p ∈ S, IsLocallyPolyConnAt S p +@[expose] def IsLocallyPolyConn (S : Set Plane) : Prop := + ∀ p ∈ S, IsLocallyPolyConnAt S p /-- If the relative neighbourhood is itself convex there is nothing to do. -/ theorem isLocallyPolyConnAt_of_convex {U : Set Plane} {p : Plane} (hU : IsOpen U) (hpU : p ∈ U) diff --git a/LeanPool/Schoenflies/MatchedArc.lean b/LeanPool/Schoenflies/MatchedArc.lean index 33a4353500..23d290d956 100755 --- a/LeanPool/Schoenflies/MatchedArc.lean +++ b/LeanPool/Schoenflies/MatchedArc.lean @@ -21,7 +21,7 @@ those descriptions. edge arcs under the parameter-matching homeomorphism are polygonal target edge arcs. -/ -@[expose] public section +public section open Set unitInterval diff --git a/LeanPool/Schoenflies/MatchedSplit.lean b/LeanPool/Schoenflies/MatchedSplit.lean index 033ef533e5..12bb296545 100755 --- a/LeanPool/Schoenflies/MatchedSplit.lean +++ b/LeanPool/Schoenflies/MatchedSplit.lean @@ -101,7 +101,7 @@ arcs of the graph's own edges. It is stated in the root `Graph` namespace next t appears it belongs there or in `Schoenflies/Graph/Drawing.lean`. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph diff --git a/LeanPool/Schoenflies/ModelCurve.lean b/LeanPool/Schoenflies/ModelCurve.lean index b62c3b2a01..ecb2f32a9f 100755 --- a/LeanPool/Schoenflies/ModelCurve.lean +++ b/LeanPool/Schoenflies/ModelCurve.lean @@ -58,7 +58,7 @@ subsequence chase establishes, and it is one line here. `IsJordanCurve.modelCurve_homeomorph` — Lemma 3.1, first clause. -/ -@[expose] public section +public section open Set Topology unitInterval @@ -124,7 +124,7 @@ theorem segment_neg_one_one : segment ℝ (-1 : ℝ) 1 = Icc (-1) 1 := /-- The model curve `S = ∂Q`, the boundary of the square `Q = [-1,1]²`, described by the sup norm. -/ -def modelCurve : Set Plane := {x : Plane | Plane.supNorm x = 1} +@[expose] def modelCurve : Set Plane := {x : Plane | Plane.supNorm x = 1} /-- The corner `(1, 1)`. -/ def cornerNE : Plane := Plane.mk 1 1 diff --git a/LeanPool/Schoenflies/OuterChain.lean b/LeanPool/Schoenflies/OuterChain.lean index 876124e921..93282d1862 100755 --- a/LeanPool/Schoenflies/OuterChain.lean +++ b/LeanPool/Schoenflies/OuterChain.lean @@ -101,7 +101,7 @@ assumed. statement with nothing assumed. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph diff --git a/LeanPool/Schoenflies/OuterChainClosed.lean b/LeanPool/Schoenflies/OuterChainClosed.lean index 595ac1359d..40b0dfce14 100755 --- a/LeanPool/Schoenflies/OuterChainClosed.lean +++ b/LeanPool/Schoenflies/OuterChainClosed.lean @@ -31,7 +31,7 @@ fill it in, and every consumer written in the meantime would have been built on statement as `Graph.IsPlaneChain.outer_chain`, with its hypothesis discharged. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph diff --git a/LeanPool/Schoenflies/Overlay.lean b/LeanPool/Schoenflies/Overlay.lean index e599106e7b..81e1405e47 100755 --- a/LeanPool/Schoenflies/Overlay.lean +++ b/LeanPool/Schoenflies/Overlay.lean @@ -22,7 +22,7 @@ duplicated subsegment is named once (`lem:polygonal-overlay`). * `polygonal_overlay` — Lemma 3.7 (polygonal overlay). -/ -@[expose] public section +public section open Metric Set @@ -130,17 +130,17 @@ segment's ends are determined by its point set is a theorem this development doe does not need. -/ /-- Where two pieces meet. -/ -def meetOf (P Q : Piece) : Set Plane := P.seg ∩ Q.seg +@[expose] def meetOf (P Q : Piece) : Set Plane := P.seg ∩ Q.seg theorem meetOf_comm (P Q : Piece) : meetOf P Q = meetOf Q P := inter_comm _ _ /-- Every end of every source piece is a cut point. -/ -def EndsAreCut (pieces : List Piece) (points : List Plane) : Prop := +@[expose] def EndsAreCut (pieces : List Piece) (points : List Plane) : Prop := ∀ P ∈ pieces, ∀ z, (z = P.1 ∨ z = P.2) → z ∈ points /-- For every pair of distinct source pieces that meet, some pair of ends of the meet is cut. -/ -def MeetsAreCut (pieces : List Piece) (points : List Plane) : Prop := +@[expose] def MeetsAreCut (pieces : List Piece) (points : List Plane) : Prop := ∀ P ∈ pieces, ∀ Q ∈ pieces, P ≠ Q → (meetOf P Q).Nonempty → ∃ u v, meetOf P Q = segment ℝ u v ∧ u ∈ points ∧ v ∈ points diff --git a/LeanPool/Schoenflies/OverlayExtension.lean b/LeanPool/Schoenflies/OverlayExtension.lean index e87949efd7..1ef1d02877 100755 --- a/LeanPool/Schoenflies/OverlayExtension.lean +++ b/LeanPool/Schoenflies/OverlayExtension.lean @@ -19,7 +19,7 @@ The resulting overlay is automatically a plane subdivision of the old overlay. finite straight-line engine needed before the wild outer graph and the joining ear are glued. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/OverlayGraph.lean b/LeanPool/Schoenflies/OverlayGraph.lean index 4eb43f7816..7dc35b46fd 100755 --- a/LeanPool/Schoenflies/OverlayGraph.lean +++ b/LeanPool/Schoenflies/OverlayGraph.lean @@ -45,7 +45,7 @@ The three clauses of `Graph.IsDrawing` come out as follows. * `polygonal_overlay` — Lemma 3.7 (polygonal overlay), the whole statement. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -233,13 +233,13 @@ theorem overlayPieces_disjoint_interiors {pieces : List Piece} {points : List Pl /-! ### The graph -/ /-- The ends of a list of pieces. -/ -def endSet (edges : List Piece) : Set Plane := {v | ∃ P ∈ edges, v = P.1 ∨ v = P.2} +@[expose] def endSet (edges : List Piece) : Set Plane := {v | ∃ P ∈ edges, v = P.1 ∨ v = P.2} /-- The overlay graph: the oriented deduplicated pieces as edges, their ends as vertices. An edge links `x` and `y` exactly when they are its two ends in one order or the other, which is what makes `eq_or_eq_of_isLink_of_isLink` a case split with no content. -/ -noncomputable def overlayGraph (pieces : List Piece) (points : List Plane) : +@[expose] noncomputable def overlayGraph (pieces : List Piece) (points : List Plane) : Graph Plane Piece where vertexSet := endSet (overlayPieces pieces points) IsLink P x y := P ∈ overlayPieces pieces points ∧ @@ -286,7 +286,7 @@ A straight edge is drawn by the affine parametrization of its segment, so the ar `IsDrawing` is `isArcBetween_segment` and nothing else. -/ /-- Every piece is drawn by the affine parametrization of its segment. -/ -noncomputable def segmentDrawing (P : Piece) : ℝ → Plane := AffineMap.lineMap P.1 P.2 +@[expose] noncomputable def segmentDrawing (P : Piece) : ℝ → Plane := AffineMap.lineMap P.1 P.2 @[simp] theorem edgeArc_segmentDrawing (P : Piece) : Graph.edgeArc segmentDrawing P = P.seg := diff --git a/LeanPool/Schoenflies/Parity.lean b/LeanPool/Schoenflies/Parity.lean index 309b815fcc..0a6c8ae1fb 100755 --- a/LeanPool/Schoenflies/Parity.lean +++ b/LeanPool/Schoenflies/Parity.lean @@ -68,7 +68,7 @@ zero over the list". `edgesOf` builds a closed chain from a cyclic vertex list, supply from a cyclic vertex list, and its survival of subdivision. -/ -@[expose] public section +public section open Metric Set @@ -80,7 +80,7 @@ variable {u a b c p q z w : Plane} {s t : ℝ} {L : List Piece} /-- How far across the direction `u` the point `z` lies. Edges on which this is constant are the blueprint's horizontal edges. -/ -def hgt (u z : Plane) : ℝ := Plane.det u z +@[expose] def hgt (u z : Plane) : ℝ := Plane.det u z /-- How far along the direction `u` the point `z` lies. The ray from `q` is the set of points of the same `hgt` and larger `fwd`. -/ @@ -227,7 +227,7 @@ theorem meet_swap (h : hgt u a ≠ hgt u b) (t : ℝ) : meet u b a t = meet u a The height test is half-open at the bottom: an edge whose lower end is exactly at the height of `q` counts, one whose upper end is counts not. That convention is what makes the count well defined at every `q` off the polygon, with no genericity assumption. -/ -def Crosses (u : Plane) (P : Piece) (q : Plane) : Prop := +@[expose] def Crosses (u : Plane) (P : Piece) (q : Plane) : Prop := min (hgt u P.1) (hgt u P.2) ≤ hgt u q ∧ hgt u q < max (hgt u P.1) (hgt u P.2) ∧ fwd u q < fwd u (meet u P.1 P.2 (hgt u q)) @@ -240,15 +240,15 @@ theorem crosses_swap (h : hgt u a ≠ hgt u b) (q : Plane) : simp only [Crosses, meet_swap h, min_comm (hgt u b) (hgt u a), max_comm (hgt u b) (hgt u a)] /-- How many edges of `L` the ray from `q` crosses. -/ -noncomputable def crossings (u : Plane) (L : List Piece) (q : Plane) : ℕ := +@[expose] noncomputable def crossings (u : Plane) (L : List Piece) (q : Plane) : ℕ := (L.map (fun P => if Crosses u P q then 1 else 0)).sum /-- The contribution of one edge to the parity. -/ -noncomputable def mark (u : Plane) (P : Piece) (q : Plane) : ZMod 2 := +@[expose] noncomputable def mark (u : Plane) (P : Piece) (q : Plane) : ZMod 2 := if Crosses u P q then 1 else 0 /-- The crossing parity `π_C(q)`. -/ -noncomputable def parity (u : Plane) (L : List Piece) (q : Plane) : ZMod 2 := +@[expose] noncomputable def parity (u : Plane) (L : List Piece) (q : Plane) : ZMod 2 := (L.map (fun P => mark u P q)).sum @[simp] theorem crossings_nil (u q : Plane) : crossings u [] q = 0 := rfl @@ -472,7 +472,7 @@ theorem add_self_zmod_two (x : ZMod 2) : x + x = 0 := by every `ZMod 2`-valued function of the ends sums to zero over the list — which is exactly what the parity argument consumes, and which `isClosedChain_edgesOf` supplies for a cyclic vertex list. -/ -def IsClosedChain (L : List Piece) : Prop := +@[expose] def IsClosedChain (L : List Piece) : Prop := ∀ f : Plane → ZMod 2, (L.map (fun P => f P.1 + f P.2)).sum = 0 theorem isClosedChain_nil : IsClosedChain [] := fun _ => by simp diff --git a/LeanPool/Schoenflies/ParitySplitting.lean b/LeanPool/Schoenflies/ParitySplitting.lean index 0a0d0a3647..31852bf391 100755 --- a/LeanPool/Schoenflies/ParitySplitting.lean +++ b/LeanPool/Schoenflies/ParitySplitting.lean @@ -94,7 +94,7 @@ One lemma here strengthens one on `main`: `mark_swap'` drops the non-levelness h under either name. Its home is `Schoenflies/Parity.lean`. -/ -@[expose] public section +public section open Metric Set @@ -184,7 +184,8 @@ theorem chainSum_map_orientPiece (f : Plane → ZMod 2) (L : List Piece) : to be named by either of its two ends first. This is the relation under which "the edge list of `Jᵢ` is that of `Aᵢ` together with that of `P`" is true — a `ClosedPolygon` built on `Aᵢ ∪ P` lists its edges in its own cyclic order, and traverses one of the two pieces backwards. -/ -def SameEdges (L₁ L₂ : List Piece) : Prop := (L₁.map orientPiece).Perm (L₂.map orientPiece) +@[expose] def SameEdges (L₁ L₂ : List Piece) : Prop := + (L₁.map orientPiece).Perm (L₂.map orientPiece) @[refl] theorem SameEdges.refl (L : List Piece) : SameEdges L L := List.Perm.refl _ @@ -305,7 +306,7 @@ How a crosscut is normally presented: a list of points. `pathPieces` reads off i `isChainFrom_pathPieces` says its boundary is the two ends of the list. -/ /-- The edges of the polyline `v₀, v₁, …, v_k`. -/ -def pathPieces : List Plane → List Piece +@[expose] def pathPieces : List Plane → List Piece | [] => [] | [_] => [] | v :: w :: rest => (v, w) :: pathPieces (w :: rest) @@ -356,7 +357,7 @@ variable {C : ClosedPolygon m} {a : ZMod (m + 3)} {k : ℕ} /-- The edge list of the arc of `C` that leaves vertex `a` and runs forward through `k` edges. For `k ≤ m + 3` this is one of the two arcs a crosscut with endpoints `C.vertex a` and `C.vertex (a + k)` cuts `C` into; the other is `arcPieces C (a + k) (m + 3 - k)`. -/ -def arcPieces (C : ClosedPolygon m) (a : ZMod (m + 3)) (k : ℕ) : List Piece := +@[expose] def arcPieces (C : ClosedPolygon m) (a : ZMod (m + 3)) (k : ℕ) : List Piece := (List.range k).map fun t : ℕ => (C.vertex (a + t), C.vertex (a + t + 1)) @[simp] theorem arcPieces_zero (C : ClosedPolygon m) (a : ZMod (m + 3)) : diff --git a/LeanPool/Schoenflies/Plane.lean b/LeanPool/Schoenflies/Plane.lean index f0ef123f53..44fbf6d6a5 100755 --- a/LeanPool/Schoenflies/Plane.lean +++ b/LeanPool/Schoenflies/Plane.lean @@ -29,7 +29,7 @@ connectedness that the rest of the development uses without comment. Lemma 1.5 (closure and diameter) is `Metric.diam_closure` in Mathlib. -/ -@[expose] public section +public section open Metric Set @@ -50,10 +50,10 @@ abbrev mk (x y : ℝ) : Plane := !₂[x, y] /-- The orientation form `det (a, b) = a₁b₂ - a₂b₁`. It is positive exactly when `b` lies counterclockwise of `a`. -/ -def det (a b : Plane) : ℝ := a 0 * b 1 - a 1 * b 0 +@[expose] def det (a b : Plane) : ℝ := a 0 * b 1 - a 1 * b 0 /-- `u` turned counterclockwise through a right angle. -/ -def perp (u : Plane) : Plane := mk (-u 1) (u 0) +@[expose] def perp (u : Plane) : Plane := mk (-u 1) (u 0) @[simp] theorem perp_zero (u : Plane) : perp u 0 = -u 1 := rfl @[simp] theorem perp_one (u : Plane) : perp u 1 = u 0 := rfl diff --git a/LeanPool/Schoenflies/PolyArcRealize.lean b/LeanPool/Schoenflies/PolyArcRealize.lean index cbdd3bb7cc..79c32ed02c 100755 --- a/LeanPool/Schoenflies/PolyArcRealize.lean +++ b/LeanPool/Schoenflies/PolyArcRealize.lean @@ -98,7 +98,7 @@ There is no blueprint label for this statement: like the closed-curve realizatio same at the call site of `thm:general-crosscut`. -/ -@[expose] public section +public section open Metric Set unitInterval diff --git a/LeanPool/Schoenflies/PolyLocal.lean b/LeanPool/Schoenflies/PolyLocal.lean index 1f07b2f3ae..c7f91160c1 100755 --- a/LeanPool/Schoenflies/PolyLocal.lean +++ b/LeanPool/Schoenflies/PolyLocal.lean @@ -59,7 +59,7 @@ Brick B5 ↔ brick B6 of `lem:polygonal-redrawing` (H6), and the interface B7 us payoff: two points of a connected relatively open piece are joined *inside that piece*. -/ -@[expose] public section +public section open Metric Set @@ -129,7 +129,7 @@ Two strengthenings over `IsLocallyPolyConnAt`, and both are needed by brick B7. confined to the neighbourhood, not merely to `S`, because a replacement arc has to stay in its tube; and the neighbourhoods run through a basis at `p`, because otherwise the property does not survive intersecting `S` with an open set (`IsLocallyPolyConn'.inter_isOpen`). -/ -def IsLocallyPolyConnAt' (S : Set Plane) (p : Plane) : Prop := +@[expose] def IsLocallyPolyConnAt' (S : Set Plane) (p : Plane) : Prop := ∀ W : Set Plane, IsOpen W → p ∈ W → ∃ U : Set Plane, IsOpen U ∧ p ∈ U ∧ U ⊆ W ∧ ∀ x ∈ U ∩ S, ∀ y ∈ U ∩ S, PolyReaches (U ∩ S) x y @@ -332,7 +332,7 @@ theorem IsLocallyPolyConn'.inter_isOpen (h : IsLocallyPolyConn' S) (hW : IsOpen /-! ### Relatively open subsets and their components -/ /-- `A` is relatively open in `S`: cut out of `S` by an ambient open set. -/ -def IsRelOpenIn (S A : Set Plane) : Prop := ∃ W : Set Plane, IsOpen W ∧ A = S ∩ W +@[expose] def IsRelOpenIn (S A : Set Plane) : Prop := ∃ W : Set Plane, IsOpen W ∧ A = S ∩ W theorem IsRelOpenIn.subset (h : IsRelOpenIn S A) : A ⊆ S := by obtain ⟨W, -, rfl⟩ := h diff --git a/LeanPool/Schoenflies/PolyPath.lean b/LeanPool/Schoenflies/PolyPath.lean index 3a309c8b55..affc1faf2d 100755 --- a/LeanPool/Schoenflies/PolyPath.lean +++ b/LeanPool/Schoenflies/PolyPath.lean @@ -24,7 +24,7 @@ primitive. to a *simple* arc, which needs the finite-graph machinery and is proved with Lemma 1.2. -/ -@[expose] public section +public section open Metric Set @@ -42,7 +42,7 @@ theorem isCompact_segment (x y : Plane) : IsCompact (segment ℝ x y) := by /-- The carrier of a polygonal path: the union of the segments joining consecutive vertices. A single vertex carries itself, so that a path may be constant. -/ -def poly : List Plane → Set Plane +@[expose] def poly : List Plane → Set Plane | [] => ∅ | [v] => {v} | u :: v :: rest => segment ℝ u v ∪ poly (v :: rest) diff --git a/LeanPool/Schoenflies/PolygonBridge.lean b/LeanPool/Schoenflies/PolygonBridge.lean index 33a4518a36..8ffcdde3d6 100755 --- a/LeanPool/Schoenflies/PolygonBridge.lean +++ b/LeanPool/Schoenflies/PolygonBridge.lean @@ -82,7 +82,7 @@ One general lemma is stated here that does not belong here: `Schoenflies.exists_ the destructor matching `Schoenflies.mem_cover`, whose home is `Schoenflies/Parity.lean`. -/ -@[expose] public section +public section open Metric Set @@ -149,7 +149,7 @@ private theorem det_rot₃ (a b c : Plane) : det (a - c) (b - a) = det (b - a) ( /-- **A triangle is a simple closed polygon.** Any three points that are not collinear, taken in that cyclic order. `edges_meet` holds because two of the three edges always share exactly one endpoint, and `corner` because the orientation form is what nonzero says. -/ -def triangle (h : det (b - a) (c - a) ≠ 0) : ClosedPolygon 0 where +@[expose] def triangle (h : det (b - a) (c - a) ≠ 0) : ClosedPolygon 0 where vertex := ![a, b, c] vertex_inj := by have hab : a ≠ b := by @@ -332,7 +332,7 @@ the list occupies the polygon. -/ /-- The `m + 3` edges of the polygon, as a list of pieces in cyclic order. This is the form the crossing count of §2 is defined on. -/ -def pieces (P : ClosedPolygon m) : List Piece := +@[expose] def pieces (P : ClosedPolygon m) : List Piece := (List.range (m + 3)).map fun j : ℕ => (P.vertex (j : ZMod (m + 3)), P.vertex ((j : ZMod (m + 3)) + 1)) diff --git a/LeanPool/Schoenflies/Polygonal.lean b/LeanPool/Schoenflies/Polygonal.lean index 204dd26615..152757eb64 100755 --- a/LeanPool/Schoenflies/Polygonal.lean +++ b/LeanPool/Schoenflies/Polygonal.lean @@ -25,7 +25,7 @@ segment itself, and the distinctness of its ends is already part of well-formedn * `isArcBetween_segment` — a nondegenerate segment is an arc between its endpoints. -/ -@[expose] public section +public section open Metric Set @@ -33,7 +33,7 @@ namespace Schoenflies /-- A set is polygonal when it is the carrier of a finite vertex list, that is, a finite union of line segments. -/ -def IsPolygonal (A : Set Plane) : Prop := ∃ vs : List Plane, A = poly vs +@[expose] def IsPolygonal (A : Set Plane) : Prop := ∃ vs : List Plane, A = poly vs theorem IsPolygonal.isCompact {A : Set Plane} (h : IsPolygonal A) : IsCompact A := by obtain ⟨vs, rfl⟩ := h diff --git a/LeanPool/Schoenflies/PolygonalCarrier.lean b/LeanPool/Schoenflies/PolygonalCarrier.lean index 289564532e..f87a98e301 100755 --- a/LeanPool/Schoenflies/PolygonalCarrier.lean +++ b/LeanPool/Schoenflies/PolygonalCarrier.lean @@ -35,7 +35,7 @@ Brick B6 of `lem:polygonal-redrawing` (H6): polygonal connectivity one level up. it, verbatim; the `example` below it is a machine check that the statements agree. -/ -@[expose] public section +public section open Metric Set @@ -129,7 +129,7 @@ The neighbourhood is presented as `V ∩ C` for an ambient open `V`, which is ex relatively open neighbourhood is; the paths are only required to stay inside `C`, not inside the neighbourhood, since that is all the clopen argument uses and it is the weaker demand on a producer. Ball, half-disk and three-quarter disk all qualify. -/ -def IsLocallyPolyConnected (C : Set Plane) : Prop := +@[expose] def IsLocallyPolyConnected (C : Set Plane) : Prop := ∀ w ∈ C, ∃ V : Set Plane, IsOpen V ∧ w ∈ V ∧ ∀ z ∈ V ∩ C, PolyReaches C w z /-- The relative-openness step, stated once because the clopen argument uses it twice — for diff --git a/LeanPool/Schoenflies/PolygonalCrosscut.lean b/LeanPool/Schoenflies/PolygonalCrosscut.lean index 0aad4365b5..2171746213 100755 --- a/LeanPool/Schoenflies/PolygonalCrosscut.lean +++ b/LeanPool/Schoenflies/PolygonalCrosscut.lean @@ -79,7 +79,7 @@ see the note there about the `corner` field. Nothing in this file inspects `corn * `polygonal_crosscut` — Theorem 2.8, bundled. -/ -@[expose] public section +public section open Bornology Set diff --git a/LeanPool/Schoenflies/PolygonalJordan.lean b/LeanPool/Schoenflies/PolygonalJordan.lean index 2e1e8b536c..6170c6f775 100755 --- a/LeanPool/Schoenflies/PolygonalJordan.lean +++ b/LeanPool/Schoenflies/PolygonalJordan.lean @@ -63,7 +63,7 @@ argument depends on, would invert the layering. They are `private` so that the d cannot collide when the integrator hoists the originals. -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/PrePolygonArc.lean b/LeanPool/Schoenflies/PrePolygonArc.lean index d62a12d3ab..c596d65e76 100755 --- a/LeanPool/Schoenflies/PrePolygonArc.lean +++ b/LeanPool/Schoenflies/PrePolygonArc.lean @@ -71,7 +71,7 @@ of the split edge lies on neither half. `Schoenflies.exists_closedPolygon_split`, which requires them to be corners. -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/PrePolygonSep.lean b/LeanPool/Schoenflies/PrePolygonSep.lean index 8da7248b61..13687cf74d 100755 --- a/LeanPool/Schoenflies/PrePolygonSep.lean +++ b/LeanPool/Schoenflies/PrePolygonSep.lean @@ -90,7 +90,7 @@ under `List.Perm` (immediate, `parity` is a sum over the list), and a strengthen shorter than either. -/ -@[expose] public section +public section open Bornology Metric Set diff --git a/LeanPool/Schoenflies/QuantitativeForwardStages.lean b/LeanPool/Schoenflies/QuantitativeForwardStages.lean index 8edba253d7..341882ad47 100755 --- a/LeanPool/Schoenflies/QuantitativeForwardStages.lean +++ b/LeanPool/Schoenflies/QuantitativeForwardStages.lean @@ -19,7 +19,7 @@ This module turns that containment into the pointwise source-star estimate used survives the forward refinement. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/QuantitativeRecursion.lean b/LeanPool/Schoenflies/QuantitativeRecursion.lean index 2b7aac7382..22de874fa9 100755 --- a/LeanPool/Schoenflies/QuantitativeRecursion.lean +++ b/LeanPool/Schoenflies/QuantitativeRecursion.lean @@ -14,7 +14,7 @@ This module iterates the two-sided quantitative successor. Window centres are read from a recurrent sequence and all three quantitative parameters use a dyadic scale. -/ -@[expose] public section +public section open Filter Metric Set diff --git a/LeanPool/Schoenflies/QuantitativeStages.lean b/LeanPool/Schoenflies/QuantitativeStages.lean index cdb13819bb..38e773a01b 100755 --- a/LeanPool/Schoenflies/QuantitativeStages.lean +++ b/LeanPool/Schoenflies/QuantitativeStages.lean @@ -30,7 +30,7 @@ the requested bound. face-mesh estimate. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/Realization.lean b/LeanPool/Schoenflies/Realization.lean index 72214b5e15..3a6931c55d 100755 --- a/LeanPool/Schoenflies/Realization.lean +++ b/LeanPool/Schoenflies/Realization.lean @@ -80,7 +80,7 @@ needs to cut at a straight point has to change the curve — bend it there — w theorem, and is exactly the freedom `Graph.IsK33Config.not_isDrawing` reserves for itself. -/ -@[expose] public section +public section open Metric Set unitInterval @@ -207,7 +207,8 @@ section Delete variable {m : ℕ} /-- An index of the shortened list, read in the original one: the same numeral. -/ -def emb (j : ZMod (m + 3)) : ZMod (m + 1 + 3) := ((j.val : ℕ) : ZMod (m + 1 + 3)) +@[expose] def emb (j : ZMod (m + 3)) : ZMod (m + 1 + 3) := + ((j.val : ℕ) : ZMod (m + 1 + 3)) theorem neg_one_eq_cast : (-1 : ZMod (m + 1 + 3)) = ((m + 3 : ℕ) : ZMod (m + 1 + 3)) := by have h0 : ((m + 1 + 3 : ℕ) : ZMod (m + 1 + 3)) = 0 := ZMod.natCast_self _ @@ -736,7 +737,7 @@ noncomputable def par (T : Finset ℝ) (hcard : T.card = n) (i : Fin n) : ℝ := T.orderEmbOfFin hcard i /-- The right end of the `i`-th gap: the next parameter, or `1` for the last gap. -/ -noncomputable def parNext (T : Finset ℝ) (hcard : T.card = n) (i : Fin n) : ℝ := +@[expose] noncomputable def parNext (T : Finset ℝ) (hcard : T.card = n) (i : Fin n) : ℝ := if h : (i : ℕ) + 1 < n then T.orderEmbOfFin hcard ⟨(i : ℕ) + 1, h⟩ else 1 theorem par_mem (i : Fin n) : par T hcard i ∈ T := T.orderEmbOfFin_mem hcard i diff --git a/LeanPool/Schoenflies/RealizeSplit.lean b/LeanPool/Schoenflies/RealizeSplit.lean index 8e0ad6f3ba..58345cfe2b 100755 --- a/LeanPool/Schoenflies/RealizeSplit.lean +++ b/LeanPool/Schoenflies/RealizeSplit.lean @@ -81,7 +81,7 @@ Three facts about drawings and paths had no home on `main` and are proved here i what rules out the returning point that would break `IsArcBetween.concatenate`. -/ -@[expose] public section +public section open Set Schoenflies open scoped Graph @@ -381,7 +381,7 @@ def earGraph (d : S.SplitData) (earPos : γ → Plane) : Graph Plane γ := d.ear E(d.earGraph earPos) = E(d.ear) := Graph.edgeSet_map _ _ /-- The point set the drawn ear occupies: the crosscut `P` of `thm:general-crosscut`. -/ -def earSet (d : S.SplitData) (earPos : γ → Plane) (earDraw : γ → ℝ → Plane) : Set Plane := +@[expose] def earSet (d : S.SplitData) (earPos : γ → Plane) (earDraw : γ → ℝ → Plane) : Set Plane := Graph.pointSet (d.earGraph earPos) earDraw /-- **The geometric input of one 2-cell split.** A position for each vertex of the abstract diff --git a/LeanPool/Schoenflies/RealizeSubdiv.lean b/LeanPool/Schoenflies/RealizeSubdiv.lean index b1a86cd7fb..0cf9c038eb 100755 --- a/LeanPool/Schoenflies/RealizeSubdiv.lean +++ b/LeanPool/Schoenflies/RealizeSubdiv.lean @@ -99,7 +99,7 @@ Declarations: realized 1-skeleton. -/ -@[expose] public section +public section open Set unitInterval open scoped Graph @@ -290,7 +290,7 @@ off the structure; it is decided by a case distinction, once, here. -/ noncomputable def leftParam : ℝ := if R.drawing d.edge 0 = R.pos d.left then 0 else 1 /-- The endpoint parameter at which the drawn subdivided edge sits at `R.pos d.right`. -/ -noncomputable def rightParam : ℝ := 1 - d.leftParam R +@[expose] noncomputable def rightParam : ℝ := 1 - d.leftParam R theorem leftParam_eq_zero_or_one : d.leftParam R = 0 ∨ d.leftParam R = 1 := by unfold leftParam diff --git a/LeanPool/Schoenflies/RealizeSubdivHomeo.lean b/LeanPool/Schoenflies/RealizeSubdivHomeo.lean index 7ba2bb98f9..f61ad1ad7f 100755 --- a/LeanPool/Schoenflies/RealizeSubdivHomeo.lean +++ b/LeanPool/Schoenflies/RealizeSubdivHomeo.lean @@ -66,7 +66,7 @@ Declarations: with `realizeHomeo_toFun` / `realizeHomeo_invFun` / `realizeHomeo_eqOn`. -/ -@[expose] public section +public section open Set unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/RefinementStars.lean b/LeanPool/Schoenflies/RefinementStars.lean index 1c20da30ef..5582da5e08 100755 --- a/LeanPool/Schoenflies/RefinementStars.lean +++ b/LeanPool/Schoenflies/RefinementStars.lean @@ -81,7 +81,7 @@ operations replace a single cell `c` by a set `N` of fresh cells and send `N` to lemma serves both. -/ -@[expose] public section +public section open Set Metric Bornology open scoped Graph diff --git a/LeanPool/Schoenflies/SegmentCut.lean b/LeanPool/Schoenflies/SegmentCut.lean index 1b93a9d8f1..5ab4674fd0 100755 --- a/LeanPool/Schoenflies/SegmentCut.lean +++ b/LeanPool/Schoenflies/SegmentCut.lean @@ -27,7 +27,7 @@ far coefficient vanishes. `subdivide_inside`. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/SegmentMeet.lean b/LeanPool/Schoenflies/SegmentMeet.lean index 85d9844f62..aa7729677c 100755 --- a/LeanPool/Schoenflies/SegmentMeet.lean +++ b/LeanPool/Schoenflies/SegmentMeet.lean @@ -25,7 +25,7 @@ convex subset of `ℝ`, hence a closed interval; pushing that interval forward i * `segment_inter_segment` — the meet dichotomy used by Lemma 3.7. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/SegmentOrder.lean b/LeanPool/Schoenflies/SegmentOrder.lean index a4c0c6caeb..95660c3d70 100755 --- a/LeanPool/Schoenflies/SegmentOrder.lean +++ b/LeanPool/Schoenflies/SegmentOrder.lean @@ -57,7 +57,7 @@ excluded by the hypotheses or settled outright, and that case split lives inside of merely overlapping. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/SimpleArc.lean b/LeanPool/Schoenflies/SimpleArc.lean index cbaf00cb59..62bbf8afcd 100755 --- a/LeanPool/Schoenflies/SimpleArc.lean +++ b/LeanPool/Schoenflies/SimpleArc.lean @@ -71,7 +71,7 @@ is a general fact about preconnected sets. Both are here only because their home `main`. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -103,7 +103,7 @@ point, which is the second disjunct of `cover_segsOf`. -/ open scoped Classical in /-- The nondegenerate segments of a polygonal chain, in order. A repeated vertex contributes nothing. -/ -noncomputable def segsOf : List Plane → List Piece +@[expose] noncomputable def segsOf : List Plane → List Piece | [] => [] | [_] => [] | u :: v :: rest => if u = v then segsOf (v :: rest) else (u, v) :: segsOf (v :: rest) diff --git a/LeanPool/Schoenflies/SkeletonAccess.lean b/LeanPool/Schoenflies/SkeletonAccess.lean index 2adc7231ed..2c213ac305 100755 --- a/LeanPool/Schoenflies/SkeletonAccess.lean +++ b/LeanPool/Schoenflies/SkeletonAccess.lean @@ -127,7 +127,7 @@ nothing beyond the shared hypothesis. point of a target face" of the same lemma. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -597,7 +597,7 @@ cell found is the prescribed one. It is discharged by complement of the skeleton, which is what invariant (i) asserts) or, when the cells live inside an ambient region whose frontier belongs to the skeleton, by `Schoenflies.cellsAbsorb_of_isComponent_in`. -/ -def CellsAbsorb (K : Set Plane) (cells : Set (Set Plane)) : Prop := +@[expose] def CellsAbsorb (K : Set Plane) (cells : Set (Set Plane)) : Prop := ∀ N : Set Plane, IsPreconnected N → Disjoint N K → ∀ R ∈ cells, (N ∩ R).Nonempty → N ⊆ R /-- A connected set that misses the frontier of an open set and meets it lies inside it. -/ diff --git a/LeanPool/Schoenflies/SkeletonLocal.lean b/LeanPool/Schoenflies/SkeletonLocal.lean index f45111bf73..fb5505ebf4 100755 --- a/LeanPool/Schoenflies/SkeletonLocal.lean +++ b/LeanPool/Schoenflies/SkeletonLocal.lean @@ -71,7 +71,7 @@ sectors in aggregate — as one `Plane.cone` over all free directions at once. exterior inside a local disk lies, minus `x`, in that point's face. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -173,7 +173,7 @@ segment issuing from `x`. Choice-free and stated for an arbitrary set, so that a consumer never has to name a segment decomposition of `S`. Being a *set* of unit vectors, its members are automatically pairwise distinct — the blueprint's "with pairwise distinct directions". -/ -def localDirs (S : Set Plane) (x : Plane) : Set Plane := +@[expose] def localDirs (S : Set Plane) (x : Plane) : Set Plane := {d | Plane.IsDirection d ∧ ∃ ε : ℝ, 0 < ε ∧ segment ℝ x (x + ε • d) ⊆ S} theorem isDirection_of_mem_localDirs (h : d ∈ localDirs S x) : Plane.IsDirection d := h.1 @@ -302,7 +302,7 @@ of `x` together with the rays leaving `x` in the local directions. This one criterion is the whole local picture; the disk formula, the sector description and the star-shapedness are all derived from it below, and each therefore holds at every positive radius below a local radius (`IsLocalRadius.mono`). -/ -def IsLocalRadius (S : Set Plane) (x : Plane) (r : ℝ) : Prop := +@[expose] def IsLocalRadius (S : Set Plane) (x : Plane) (r : ℝ) : Prop := 0 < r ∧ ∀ z, dist z x ≤ r → (z ∈ S ↔ z = x ∨ Plane.dir (z - x) ∈ localDirs S x) theorem IsLocalRadius.pos (h : IsLocalRadius S x r) : 0 < r := h.1 diff --git a/LeanPool/Schoenflies/SkeletonSectors.lean b/LeanPool/Schoenflies/SkeletonSectors.lean index cff4068bb2..b7012f115e 100755 --- a/LeanPool/Schoenflies/SkeletonSectors.lean +++ b/LeanPool/Schoenflies/SkeletonSectors.lean @@ -111,7 +111,7 @@ component is connected by construction. not cover. -/ -@[expose] public section +public section open Metric Set unitInterval open scoped Graph diff --git a/LeanPool/Schoenflies/SourceAttachment.lean b/LeanPool/Schoenflies/SourceAttachment.lean index f56852bb38..ecb2ecc767 100755 --- a/LeanPool/Schoenflies/SourceAttachment.lean +++ b/LeanPool/Schoenflies/SourceAttachment.lean @@ -26,7 +26,7 @@ outer curve separate. transfer. -/ -@[expose] public section +public section open Set open scoped Graph @@ -608,7 +608,7 @@ noncomputable abbrev innerGraph : _root_.Graph Plane γ := (Q.crosscutOverlay J p s epsilon extra).relabelEdges w.name w.name_inj /-- The mixed crosscut source graph. -/ -noncomputable def graph : _root_.Graph Plane γ := w.outerGraph.union w.innerGraph +@[expose] noncomputable def graph : _root_.Graph Plane γ := w.outerGraph.union w.innerGraph /-- The mixed drawing keeps the wild outer parametrizations and uses straight segments on all fresh inner edges. -/ diff --git a/LeanPool/Schoenflies/SourceJoining.lean b/LeanPool/Schoenflies/SourceJoining.lean index 0f33c28bc7..9b96a30a41 100755 --- a/LeanPool/Schoenflies/SourceJoining.lean +++ b/LeanPool/Schoenflies/SourceJoining.lean @@ -21,7 +21,7 @@ core, crosscut, and grid together with the joining segments, retaining every old `OverlayExtension` then supplies the plane-subdivision certificate automatically. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/SourceOverlay.lean b/LeanPool/Schoenflies/SourceOverlay.lean index 8e9a54e0c5..92595a6bbc 100755 --- a/LeanPool/Schoenflies/SourceOverlay.lean +++ b/LeanPool/Schoenflies/SourceOverlay.lean @@ -33,7 +33,7 @@ geometric core of the forward half of the quantitative-refinement recursion. carried source-connectedness invariant and two distinct common source/grid vertices. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Square.lean b/LeanPool/Schoenflies/Square.lean index 46d9947033..36eb3394ff 100755 --- a/LeanPool/Schoenflies/Square.lean +++ b/LeanPool/Schoenflies/Square.lean @@ -30,7 +30,7 @@ whereas the outside of a disk would need the polar decomposition this developmen face of a plane graph unbounded. -/ -@[expose] public section +public section open Metric Set @@ -51,10 +51,10 @@ theorem continuous_coord (i : Fin 2) : Continuous fun x : Plane => x i := /-! ### The sup norm -/ /-- The sup norm `‖x‖∞ = max |x₁| |x₂|`. -/ -noncomputable def supNorm (x : Plane) : ℝ := max |x 0| |x 1| +@[expose] noncomputable def supNorm (x : Plane) : ℝ := max |x 0| |x 1| /-- The sup distance. -/ -noncomputable def supDist (x y : Plane) : ℝ := supNorm (x - y) +@[expose] noncomputable def supDist (x y : Plane) : ℝ := supNorm (x - y) theorem supNorm_nonneg (x : Plane) : 0 ≤ supNorm x := le_trans (abs_nonneg _) (le_max_left _ _) @@ -161,10 +161,10 @@ theorem isOpen_coord_gt (i : Fin 2) (r : ℝ) : IsOpen {x : Plane | r < x i} := /-! ### Axis-parallel squares -/ /-- The closed axis-parallel square of radius `r` about `c`. -/ -def closedSquare (c : Plane) (r : ℝ) : Set Plane := {x | supDist x c ≤ r} +@[expose] def closedSquare (c : Plane) (r : ℝ) : Set Plane := {x | supDist x c ≤ r} /-- The open axis-parallel square of radius `r` about `c`. -/ -def openSquare (c : Plane) (r : ℝ) : Set Plane := {x | supDist x c < r} +@[expose] def openSquare (c : Plane) (r : ℝ) : Set Plane := {x | supDist x c < r} theorem closedSquare_eq_inter (c : Plane) (r : ℝ) : closedSquare c r = @@ -213,7 +213,7 @@ theorem isClosed_closedSquare (c : Plane) (r : ℝ) : IsClosed (closedSquare c r /-! ### The outside of a square -/ /-- The plane outside the closed square of radius `r` about the origin. -/ -def beyondSquare (r : ℝ) : Set Plane := {x | r < |x 0| ∨ r < |x 1|} +@[expose] def beyondSquare (r : ℝ) : Set Plane := {x | r < |x 0| ∨ r < |x 1|} /-- The outside of a square is connected. diff --git a/LeanPool/Schoenflies/SquareCycle.lean b/LeanPool/Schoenflies/SquareCycle.lean index 4eead73e3a..1e9258db42 100755 --- a/LeanPool/Schoenflies/SquareCycle.lean +++ b/LeanPool/Schoenflies/SquareCycle.lean @@ -67,7 +67,7 @@ boundary, a number in `[0, 8r)`. It is affine on each side, and it is the order `lem:polygonal-overlay`'s cut points into an ordered cycle. -/ -@[expose] public section +public section open Metric Set open scoped Graph diff --git a/LeanPool/Schoenflies/SquareMesh.lean b/LeanPool/Schoenflies/SquareMesh.lean index fec825c113..1a40f468fb 100755 --- a/LeanPool/Schoenflies/SquareMesh.lean +++ b/LeanPool/Schoenflies/SquareMesh.lean @@ -80,7 +80,7 @@ the rings are disjoint frames. belong in `Schoenflies/Subdivide.lean`. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -91,12 +91,12 @@ namespace Schoenflies /-- The frame of the square of radius `r` about the origin. For `r = 1` this is definitionally `modelCurve`. -/ -def ringSet (r : ℝ) : Set Plane := {x : Plane | Plane.supNorm x = r} +@[expose] def ringSet (r : ℝ) : Set Plane := {x : Plane | Plane.supNorm x = r} theorem ringSet_one : ringSet 1 = modelCurve := rfl /-- The four sides of the square of radius `r`, as a list of pieces. -/ -def ringPieces (r : ℝ) : List Piece := +@[expose] def ringPieces (r : ℝ) : List Piece := [(Plane.mk r r, Plane.mk (-r) r), (Plane.mk (-r) r, Plane.mk (-r) (-r)), (Plane.mk (-r) (-r), Plane.mk r (-r)), @@ -481,7 +481,7 @@ theorem anchors_subset_meshPoints (N : ℕ) (fresh anchors : List Plane) : anchors ⊆ meshPoints N fresh anchors := List.subset_append_left _ _ /-- **The mesh graph.** -/ -noncomputable def meshGraph (N : ℕ) (fresh anchors : List Plane) : Graph Plane Piece := +@[expose] noncomputable def meshGraph (N : ℕ) (fresh anchors : List Plane) : Graph Plane Piece := overlayGraph (meshSegments N fresh) (meshPoints N fresh anchors) instance meshGraph_finite (N : ℕ) (fresh anchors : List Plane) : @@ -1083,7 +1083,7 @@ theorem meshCount_spec {δ : ℝ} (hδ : 0 < δ) : 2 * Real.sqrt 2 < δ * meshCo /-- **The anchored square mesh**: `meshCount δ` concentric ring frames inside `Q = [-1,1]²`, one radial spoke at each fresh boundary point, and the anchors inserted as extra vertices of the outer ring. -/ -noncomputable def squareMesh (δ : ℝ) (fresh anchors : List Plane) : Graph Plane Piece := +@[expose] noncomputable def squareMesh (δ : ℝ) (fresh anchors : List Plane) : Graph Plane Piece := meshGraph (meshCount δ) fresh anchors instance squareMesh_finite (δ : ℝ) (fresh anchors : List Plane) : diff --git a/LeanPool/Schoenflies/SquareMeshClosed.lean b/LeanPool/Schoenflies/SquareMeshClosed.lean index b5947a58ec..ce10cc1d01 100755 --- a/LeanPool/Schoenflies/SquareMeshClosed.lean +++ b/LeanPool/Schoenflies/SquareMeshClosed.lean @@ -104,7 +104,7 @@ genuine cycle rather than a point set — `Schoenflies.squareMesh_isLongCycle_ou clause 5. -/ -@[expose] public section +public section open Metric Set open scoped Graph diff --git a/LeanPool/Schoenflies/SquareMeshConnected.lean b/LeanPool/Schoenflies/SquareMeshConnected.lean index 46412fe5a8..4c319fc57c 100755 --- a/LeanPool/Schoenflies/SquareMeshConnected.lean +++ b/LeanPool/Schoenflies/SquareMeshConnected.lean @@ -118,7 +118,7 @@ carried explicitly by every theorem below that needs it. unions are concatenations. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -204,7 +204,7 @@ opposite sides of the square meet nothing of each other. The two statements are the integrator may want them beside each other. -/ /-- The hub `K` with the pieces `Γ 0, …, Γ (m-1)` glued on, one at a time. -/ -def attachUnion (K : Graph α β) (Γ : ℕ → Graph α β) : ℕ → Graph α β +@[expose] def attachUnion (K : Graph α β) (Γ : ℕ → Graph α β) : ℕ → Graph α β | 0 => K | (m + 1) => (attachUnion K Γ m).union (Γ m) @@ -308,7 +308,7 @@ the list and the other's on the set. If a third consumer appears, hoist the set `Schoenflies/OverlayGraph.lean` beside `endSet` and derive this one from it. -/ /-- The graph whose edges are the listed segments and whose vertices are their ends. -/ -def pieceListGraph (edges : List Piece) : Graph Plane Piece where +@[expose] def pieceListGraph (edges : List Piece) : Graph Plane Piece where vertexSet := endSet edges IsLink P x y := P ∈ edges ∧ ((x = P.1 ∧ y = P.2) ∨ (x = P.2 ∧ y = P.1)) edgeSet := {P | P ∈ edges} @@ -429,13 +429,14 @@ each cell a genuine quadrilateral. Sortedness enters only with the geometry of t cycle. -/ /-- The grid point with coordinate indices `(i, j)`. -/ -def gridPt (xc yc : ℕ → ℝ) (i j : ℕ) : Plane := Plane.mk (xc i) (yc j) +@[expose] def gridPt (xc yc : ℕ → ℝ) (i j : ℕ) : Plane := Plane.mk (xc i) (yc j) /-- The horizontal grid edge from `(i, j)` to `(i+1, j)`. -/ def gridHEdge (xc yc : ℕ → ℝ) (i j : ℕ) : Piece := (gridPt xc yc i j, gridPt xc yc (i + 1) j) /-- The vertical grid edge from `(i, j)` to `(i, j+1)`. -/ -def gridVEdge (xc yc : ℕ → ℝ) (i j : ℕ) : Piece := (gridPt xc yc i j, gridPt xc yc i (j + 1)) +@[expose] def gridVEdge (xc yc : ℕ → ℝ) (i j : ℕ) : Piece := + (gridPt xc yc i j, gridPt xc yc i (j + 1)) theorem gridPt_ne_of_fst {xc yc : ℕ → ℝ} {i i' j j' : ℕ} (h : xc i ≠ xc i') : gridPt xc yc i j ≠ gridPt xc yc i' j' := fun he => by @@ -460,12 +461,13 @@ def stripEdges (xc yc : ℕ → ℝ) (i n : ℕ) : List Piece := (List.range n).flatMap (cellEdges xc yc i) /-- The `m × n` grid: `m` columns of `n` cells. -/ -def gridEdges (xc yc : ℕ → ℝ) (m n : ℕ) : List Piece := +@[expose] def gridEdges (xc yc : ℕ → ℝ) (m n : ℕ) : List Piece := (List.range m).flatMap fun i => stripEdges xc yc i n /-- **The grid graph**: the `m × n` rectangular grid on the coordinates `xc`, `yc`, as a plane graph with straight edges. -/ -def gridGraph (xc yc : ℕ → ℝ) (m n : ℕ) : Graph Plane Piece := pieceListGraph (gridEdges xc yc m n) +@[expose] def gridGraph (xc yc : ℕ → ℝ) (m n : ℕ) : Graph Plane Piece := + pieceListGraph (gridEdges xc yc m n) theorem stripEdges_succ (xc yc : ℕ → ℝ) (i n : ℕ) : stripEdges xc yc i (n + 1) = stripEdges xc yc i n ++ cellEdges xc yc i n := by diff --git a/LeanPool/Schoenflies/SquareMeshFixed.lean b/LeanPool/Schoenflies/SquareMeshFixed.lean index ad2be71c89..6498d830a6 100755 --- a/LeanPool/Schoenflies/SquareMeshFixed.lean +++ b/LeanPool/Schoenflies/SquareMeshFixed.lean @@ -114,7 +114,7 @@ hypothesis giving two distinct fresh points. open. -/ -@[expose] public section +public section open Metric Set open scoped Graph @@ -779,13 +779,13 @@ sides are disjoint; two adjacent ones meet in their common corner. Everything is `mem_segment_horiz` / `mem_segment_vert` and `plane_eq_of_coords`. -/ /-- The top side of `S`, from the north-east corner to the north-west one. -/ -def sideT : Piece := (Plane.mk 1 1, Plane.mk (-1) 1) +@[expose] def sideT : Piece := (Plane.mk 1 1, Plane.mk (-1) 1) /-- The left side of `S`. -/ def sideL : Piece := (Plane.mk (-1) 1, Plane.mk (-1) (-1)) /-- The bottom side of `S`. -/ -def sideB : Piece := (Plane.mk (-1) (-1), Plane.mk 1 (-1)) +@[expose] def sideB : Piece := (Plane.mk (-1) (-1), Plane.mk 1 (-1)) /-- The right side of `S`, from the south-east corner back to the north-east one. -/ def sideR : Piece := (Plane.mk 1 (-1), Plane.mk 1 1) diff --git a/LeanPool/Schoenflies/SquareMover.lean b/LeanPool/Schoenflies/SquareMover.lean index ce5d9d7d7d..fa11067ca1 100755 --- a/LeanPool/Schoenflies/SquareMover.lean +++ b/LeanPool/Schoenflies/SquareMover.lean @@ -49,7 +49,7 @@ Supporting material, of independent use: `Plane.tent` and `Plane.bend` with thei and `Plane.interior_closedSquare`. -/ -@[expose] public section +public section open Metric Set @@ -601,7 +601,8 @@ theorem IsSquareMover.eqOn_frontier {M N : Plane → Plane} (h : IsSquareMover c /-! ### The mover as a homeomorphism -/ /-- A mover of the square, packaged as a self-homeomorphism of the closed square. -/ -noncomputable def IsSquareMover.homeomorph {M N : Plane → Plane} (h : IsSquareMover c r M N) : +@[expose] noncomputable def IsSquareMover.homeomorph + {M N : Plane → Plane} (h : IsSquareMover c r M N) : closedSquare c r ≃ₜ closedSquare c r where toFun z := ⟨M z, h.mapsTo z.2⟩ invFun z := ⟨N z, h.mapsTo_inv z.2⟩ diff --git a/LeanPool/Schoenflies/StageTower.lean b/LeanPool/Schoenflies/StageTower.lean index 7bf2d336df..2dc25a7b10 100755 --- a/LeanPool/Schoenflies/StageTower.lean +++ b/LeanPool/Schoenflies/StageTower.lean @@ -62,7 +62,7 @@ facts about the square. `Schoenflies.HasLimitHomeomorphism`. -/ -@[expose] public section +public section open Bornology Filter Metric Set Topology open scoped Graph diff --git a/LeanPool/Schoenflies/StageTransition.lean b/LeanPool/Schoenflies/StageTransition.lean index fa200c15fb..de8f7a0509 100755 --- a/LeanPool/Schoenflies/StageTransition.lean +++ b/LeanPool/Schoenflies/StageTransition.lean @@ -25,7 +25,7 @@ packages that shared output and proves that transitions compose. * `Schoenflies.StageTransition.trans` — consecutive transferred refinements compose. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/Strip.lean b/LeanPool/Schoenflies/Strip.lean index 4cee1c2c45..5cd676e7b0 100755 --- a/LeanPool/Schoenflies/Strip.lean +++ b/LeanPool/Schoenflies/Strip.lean @@ -78,7 +78,7 @@ sufficiently small disk about a point of the curve meets the complement in exact components, one in each side), and part **(b)**, the arc case. -/ -@[expose] public section +public section open Metric Set @@ -255,7 +255,7 @@ by the two arcs are exactly the two components of the ball minus the two inciden segments, which is what makes the labelling at a vertex well defined. -/ /-- The open sector of radius `ρ` about `v` spanned by the set `A` of directions. -/ -def cone (v : Plane) (A : Set Plane) (ρ : ℝ) : Set Plane := {x | x - v ∈ A} ∩ ball v ρ +@[expose] def cone (v : Plane) (A : Set Plane) (ρ : ℝ) : Set Plane := {x | x - v ∈ A} ∩ ball v ρ theorem mem_cone_iff {v : Plane} {A : Set Plane} : x ∈ cone v A ρ ↔ x - v ∈ A ∧ dist x v < ρ := Iff.rfl @@ -297,11 +297,11 @@ progress along the edge and `coordAcross` the signed distance to its line. Both the block is an intersection of four open half-planes — open and convex at a glance. -/ /-- Progress along the directed edge that starts at `a` with unit tangent `u`. -/ -noncomputable def coordAlong (a u x : Plane) : ℝ := inner ℝ u (x - a) +@[expose] noncomputable def coordAlong (a u x : Plane) : ℝ := inner ℝ u (x - a) /-- Signed distance from `x` to the line of the directed edge that starts at `a` with unit tangent `u`; positive on the left. -/ -def coordAcross (a u x : Plane) : ℝ := det u (x - a) +@[expose] def coordAcross (a u x : Plane) : ℝ := det u (x - a) /-- The orientation form is the inner product against the turned vector. -/ theorem det_eq_inner_perp (u v : Plane) : det u v = inner ℝ (perp u) v := by @@ -373,7 +373,7 @@ theorem abs_coordAcross_sub_le (hu : IsDirection u) (a x y : Plane) : /-- The open block around the directed edge from `a` with unit tangent `u`: the points whose progress lies in `(t₁, t₂)` and whose signed distance lies in `(s₁, s₂)`. -/ -def strip (a u : Plane) (t₁ t₂ s₁ s₂ : ℝ) : Set Plane := +@[expose] def strip (a u : Plane) (t₁ t₂ s₁ s₂ : ℝ) : Set Plane := {x | t₁ < coordAlong a u x ∧ coordAlong a u x < t₂ ∧ s₁ < coordAcross a u x ∧ coordAcross a u x < s₂} @@ -482,25 +482,25 @@ theorem vertex_ne : P.vertex i ≠ P.vertex (i + 1) := fun h => /-! ### Edges, in their own frame -/ /-- The length of the edge leaving vertex `i`. -/ -noncomputable def len : ℝ := ‖P.vertex (i + 1) - P.vertex i‖ +@[expose] noncomputable def len : ℝ := ‖P.vertex (i + 1) - P.vertex i‖ /-- The unit tangent of the edge leaving vertex `i`, which is also the outgoing ray at `i`. -/ noncomputable def tang : Plane := dir (P.vertex (i + 1) - P.vertex i) /-- The incoming ray at vertex `i`: the direction back along the edge that arrives there. -/ -noncomputable def rayIn : Plane := dir (P.vertex (i - 1) - P.vertex i) +@[expose] noncomputable def rayIn : Plane := dir (P.vertex (i - 1) - P.vertex i) /-- The point of the plane at progress `t` and signed offset `s` in the frame of edge `i`. -/ -noncomputable def off : Plane := P.vertex i + t • P.tang i + s • perp (P.tang i) +@[expose] noncomputable def off : Plane := P.vertex i + t • P.tang i + s • perp (P.tang i) /-- The point of edge `i` at distance `c` from its initial vertex. -/ -noncomputable def pt : Plane := P.off i c 0 +@[expose] noncomputable def pt : Plane := P.off i c 0 /-- The edge leaving vertex `i`. -/ -def edge : Set Plane := segment ℝ (P.vertex i) (P.vertex (i + 1)) +@[expose] def edge : Set Plane := segment ℝ (P.vertex i) (P.vertex (i + 1)) /-- The carrier of the polygon: the union of its edges. -/ -def carrier : Set Plane := ⋃ i, P.edge i +@[expose] def carrier : Set Plane := ⋃ i, P.edge i variable {P i j c t s} @@ -679,30 +679,30 @@ theorem rho_lt_R : D.rho < D.R := by /-! ### The four families of blocks -/ /-- The left block of edge `i`. -/ -def blockL (i : ZMod (m + 3)) : Set Plane := +@[expose] def blockL (i : ZMod (m + 3)) : Set Plane := strip (P.vertex i) (P.tang i) D.lam (P.len i - D.lam) 0 D.rho /-- The right block of edge `i`. -/ -def blockR (i : ZMod (m + 3)) : Set Plane := +@[expose] def blockR (i : ZMod (m + 3)) : Set Plane := strip (P.vertex i) (P.tang i) D.lam (P.len i - D.lam) (-D.rho) 0 /-- The left sector at vertex `i`: the arc `arcCCW (tang i) (rayIn i)` is the one carrying both left germs, by `Plane.germs_split'`. -/ -def sectorL (i : ZMod (m + 3)) : Set Plane := +@[expose] def sectorL (i : ZMod (m + 3)) : Set Plane := cone (P.vertex i) (arcCCW (P.tang i) (P.rayIn i)) D.R /-- The right sector at vertex `i`. -/ -def sectorR (i : ZMod (m + 3)) : Set Plane := +@[expose] def sectorR (i : ZMod (m + 3)) : Set Plane := cone (P.vertex i) (arcCCW (P.rayIn i) (P.tang i)) D.R /-- The left side of the collar. -/ -def sideL : Set Plane := ⋃ i, (D.sectorL i ∪ D.blockL i) +@[expose] def sideL : Set Plane := ⋃ i, (D.sectorL i ∪ D.blockL i) /-- The right side of the collar. -/ -def sideR : Set Plane := ⋃ i, (D.sectorR i ∪ D.blockR i) +@[expose] def sideR : Set Plane := ⋃ i, (D.sectorR i ∪ D.blockR i) /-- The collar itself. -/ -def nbhd : Set Plane := D.sideL ∪ D.sideR ∪ P.carrier +@[expose] def nbhd : Set Plane := D.sideL ∪ D.sideR ∪ P.carrier theorem mem_blockL_iff : x ∈ D.blockL i ↔ D.lam < coordAlong (P.vertex i) (P.tang i) x ∧ diff --git a/LeanPool/Schoenflies/StripConnected.lean b/LeanPool/Schoenflies/StripConnected.lean index 498d66c690..bbfbdb6912 100755 --- a/LeanPool/Schoenflies/StripConnected.lean +++ b/LeanPool/Schoenflies/StripConnected.lean @@ -50,7 +50,7 @@ Producing the constants is `exists_stripData`, which lives elsewhere; every stat for a given `D : StripData P`, exactly as in `Schoenflies/Strip.lean`. -/ -@[expose] public section +public section open Metric Set @@ -294,10 +294,10 @@ variable {P : ClosedPolygon m} (D : StripData P) {i j : ZMod (m + 3)} {x : Plane /-- The left piece at index `i`: the left sector at vertex `i` glued to the left block of the edge leaving `i`. -/ -def pieceL (i : ZMod (m + 3)) : Set Plane := D.sectorL i ∪ D.blockL i +@[expose] def pieceL (i : ZMod (m + 3)) : Set Plane := D.sectorL i ∪ D.blockL i /-- The right piece at index `i`. -/ -def pieceR (i : ZMod (m + 3)) : Set Plane := D.sectorR i ∪ D.blockR i +@[expose] def pieceR (i : ZMod (m + 3)) : Set Plane := D.sectorR i ∪ D.blockR i theorem sideL_eq_iUnion : D.sideL = ⋃ i, D.pieceL i := rfl theorem sideR_eq_iUnion : D.sideR = ⋃ i, D.pieceR i := rfl diff --git a/LeanPool/Schoenflies/StripConstants.lean b/LeanPool/Schoenflies/StripConstants.lean index 00855bc8da..d22498abcc 100755 --- a/LeanPool/Schoenflies/StripConstants.lean +++ b/LeanPool/Schoenflies/StripConstants.lean @@ -61,7 +61,7 @@ use whichever side is convenient. It carries enough simplicity for both statemen `R`-neighbourhood of the curve, which is how the prescribed open set is honoured. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/StripLocal.lean b/LeanPool/Schoenflies/StripLocal.lean index a31599ad00..4d28c29362 100755 --- a/LeanPool/Schoenflies/StripLocal.lean +++ b/LeanPool/Schoenflies/StripLocal.lean @@ -60,7 +60,7 @@ The local two-sidedness assertion *at a vertex* is not proved here; see the modu end. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/Subarc.lean b/LeanPool/Schoenflies/Subarc.lean index b8d0d4ff43..fb07092fbe 100755 --- a/LeanPool/Schoenflies/Subarc.lean +++ b/LeanPool/Schoenflies/Subarc.lean @@ -47,7 +47,7 @@ the density arguments of `lem:accessible-dense`, which need `basic_piece_inside_ * `basic_piece_inside_ball` — the subarc basis. -/ -@[expose] public section +public section open Set unitInterval @@ -57,7 +57,7 @@ namespace Schoenflies /-- The affine map carrying `[0, 1]` onto the parameter interval between `a` and `b`, running from `a` to `b`. -/ -def reparam (a b : ℝ) : ℝ → ℝ := fun t => a + t * (b - a) +@[expose] def reparam (a b : ℝ) : ℝ → ℝ := fun t => a + t * (b - a) variable {a b : ℝ} @@ -97,7 +97,7 @@ theorem uIcc_subset_I (ha : a ∈ I) (hb : b ∈ I) : uIcc a b ⊆ I := /-- The subarc of `f` between the parameters `a` and `b`: the arc traversed from `f a` to `f b`, reparametrised so that it is again a map on `[0, 1]`. -/ -def subarc (f : ℝ → Plane) (a b : ℝ) : ℝ → Plane := fun t => f (reparam a b t) +@[expose] def subarc (f : ℝ → Plane) (a b : ℝ) : ℝ → Plane := fun t => f (reparam a b t) variable {f : ℝ → Plane} @@ -161,7 +161,7 @@ Taken on the parameter side, as the image of the open unit interval, because tha the subarc basis argument needs: an open subarc is the image of an open subinterval. Injectivity then says it is also the arc minus the two endpoint *values*, which is how the blueprint reads it (`openArc_eq_diff`). -/ -def openArc (f : ℝ → Plane) : Set Plane := f '' Ioo 0 1 +@[expose] def openArc (f : ℝ → Plane) : Set Plane := f '' Ioo 0 1 theorem Ioo_subset_I : Ioo (0 : ℝ) 1 ⊆ I := Ioo_subset_Icc_self diff --git a/LeanPool/Schoenflies/Subdivide.lean b/LeanPool/Schoenflies/Subdivide.lean index d6bcc21a26..8603f271d5 100755 --- a/LeanPool/Schoenflies/Subdivide.lean +++ b/LeanPool/Schoenflies/Subdivide.lean @@ -36,7 +36,7 @@ Three facts about one cut, each lifted across the piece list and then across the * `subdivide` and its three properties — the cutting half of Lemma 3.7 (polygonal overlay). -/ -@[expose] public section +public section open Metric Set @@ -48,18 +48,18 @@ abbrev Piece := Plane × Plane namespace Piece /-- The closed segment a piece occupies. -/ -def seg (P : Piece) : Set Plane := segment ℝ P.1 P.2 +@[expose] def seg (P : Piece) : Set Plane := segment ℝ P.1 P.2 /-- The interior of a piece. -/ -def interior (P : Piece) : Set Plane := openSegment ℝ P.1 P.2 +@[expose] def interior (P : Piece) : Set Plane := openSegment ℝ P.1 P.2 /-- A piece is nondegenerate when its two ends differ. -/ -def Nondeg (P : Piece) : Prop := P.1 ≠ P.2 +@[expose] def Nondeg (P : Piece) : Prop := P.1 ≠ P.2 end Piece /-- What a list of pieces occupies. -/ -def cover (pieces : List Piece) : Set Plane := ⋃ P ∈ pieces, P.seg +@[expose] def cover (pieces : List Piece) : Set Plane := ⋃ P ∈ pieces, P.seg @[simp] theorem cover_nil : cover [] = ∅ := by simp [cover] @@ -83,7 +83,7 @@ theorem cover_flatMap (f : Piece → List Piece) (ps : List Piece) : open scoped Classical in /-- Cut one piece at one point: two pieces if the point is interior to it, and the piece unchanged otherwise. Cutting at a point that is already an endpoint is a no-op. -/ -noncomputable def splitAt (p : Plane) (P : Piece) : List Piece := +@[expose] noncomputable def splitAt (p : Plane) (P : Piece) : List Piece := if p ∈ P.interior then [(P.1, p), (p, P.2)] else [P] theorem splitAt_cover (p : Plane) (P : Piece) : cover (splitAt p P) = P.seg := by @@ -160,7 +160,7 @@ theorem splitAt_avoids (p : Plane) {P : Piece} (hP : P.Nondeg) : /-! ### One cut, across the whole list -/ /-- Cut every piece of the list at one point. -/ -noncomputable def splitAllAt (p : Plane) (pieces : List Piece) : List Piece := +@[expose] noncomputable def splitAllAt (p : Plane) (pieces : List Piece) : List Piece := pieces.flatMap (splitAt p) theorem splitAllAt_cover (p : Plane) (pieces : List Piece) : @@ -191,7 +191,7 @@ theorem splitAllAt_avoids (p : Plane) {pieces : List Piece} (h : ∀ P ∈ piece /-- Subdivide a list of pieces at a list of points, recursing on the POINT list: cut every current piece at the head, then carry on with the tail. -/ -noncomputable def subdivide (pieces : List Piece) : List Plane → List Piece +@[expose] noncomputable def subdivide (pieces : List Piece) : List Plane → List Piece | [] => pieces | p :: ps => subdivide (splitAllAt p pieces) ps diff --git a/LeanPool/Schoenflies/TargetOverlay.lean b/LeanPool/Schoenflies/TargetOverlay.lean index 08388f1164..91e6283b7d 100755 --- a/LeanPool/Schoenflies/TargetOverlay.lean +++ b/LeanPool/Schoenflies/TargetOverlay.lean @@ -57,7 +57,7 @@ reverse-transfer stage. — the accessible clean overlay performs the complete reverse finite transfer. -/ -@[expose] public section +public section open Set open scoped Graph diff --git a/LeanPool/Schoenflies/Topology.lean b/LeanPool/Schoenflies/Topology.lean index f67b214d44..f8e23e99e8 100755 --- a/LeanPool/Schoenflies/Topology.lean +++ b/LeanPool/Schoenflies/Topology.lean @@ -32,7 +32,7 @@ This module collects the few that are not stated in the form the development use form the development pastes with. -/ -@[expose] public section +public section open Metric Set diff --git a/LeanPool/Schoenflies/TwoArcs.lean b/LeanPool/Schoenflies/TwoArcs.lean index 6ae52ddba8..47c2733297 100755 --- a/LeanPool/Schoenflies/TwoArcs.lean +++ b/LeanPool/Schoenflies/TwoArcs.lean @@ -46,7 +46,7 @@ carries the same point as the start and so lands back on `s`. * `IsLoop.two_arcs_at_parameters` — the parameter-level form the clause is assembled from. -/ -@[expose] public section +public section open Set unitInterval diff --git a/LeanPool/Schoenflies/UniformBound.lean b/LeanPool/Schoenflies/UniformBound.lean index 443ef3a8fc..f8e307e1a4 100755 --- a/LeanPool/Schoenflies/UniformBound.lean +++ b/LeanPool/Schoenflies/UniformBound.lean @@ -26,7 +26,7 @@ member at once. holding at some positive bound for each member holds at one common positive bound. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Schoenflies/Windows.lean b/LeanPool/Schoenflies/Windows.lean index 617760c93e..076e6fbe26 100755 --- a/LeanPool/Schoenflies/Windows.lean +++ b/LeanPool/Schoenflies/Windows.lean @@ -78,7 +78,7 @@ subset of the plane supplies a `b` as close to `x` as asked, inside `D`. * `Schoenflies.tendsto_two_pow_neg`, `.two_pow_neg_pos` — `ε_n = 2^{-n}`. -/ -@[expose] public section +public section open Filter Metric Set diff --git a/LeanPool/SelbergSieve4.lean b/LeanPool/SelbergSieve4.lean index 62363176fd..1019331d01 100644 --- a/LeanPool/SelbergSieve4.lean +++ b/LeanPool/SelbergSieve4.lean @@ -24,4 +24,4 @@ Tags: number-theory, analytic-number-theory, sieve-theory, prime-counting MSC: 11N35, 11N05, 11N13 -/ -@[expose] public section +public section diff --git a/LeanPool/SelbergSieve4/Applications.lean b/LeanPool/SelbergSieve4/Applications.lean index d947331e26..91d859bd7c 100644 --- a/LeanPool/SelbergSieve4/Applications.lean +++ b/LeanPool/SelbergSieve4/Applications.lean @@ -18,4 +18,4 @@ import Mathlib.Tactic.Positivity.Finset # Applications of the Selberg sieve -/ -@[expose] public section +public section diff --git a/LeanPool/SelbergSieve4/Applications/BrunTitchmarsh.lean b/LeanPool/SelbergSieve4/Applications/BrunTitchmarsh.lean index 2aa4d6cf0a..7f3ff9319f 100644 --- a/LeanPool/SelbergSieve4/Applications/BrunTitchmarsh.lean +++ b/LeanPool/SelbergSieve4/Applications/BrunTitchmarsh.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SelbergSieve4.Applications.BrunTitchmarsh -/ -@[expose] public section +public section open PrimeUpperBound open scoped Nat ArithmeticFunction.zeta ArithmeticFunction.Moebius ArithmeticFunction.omega diff --git a/LeanPool/SelbergSieve4/Applications/PrimeCountingUpperBound.lean b/LeanPool/SelbergSieve4/Applications/PrimeCountingUpperBound.lean index 26d1967db6..183d7bfa62 100644 --- a/LeanPool/SelbergSieve4/Applications/PrimeCountingUpperBound.lean +++ b/LeanPool/SelbergSieve4/Applications/PrimeCountingUpperBound.lean @@ -20,7 +20,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt # LeanPool.SelbergSieve4.Applications.PrimeCountingUpperBound -/ -@[expose] public section +public section open scoped Nat Nat.Prime ArithmeticFunction.zeta ArithmeticFunction.Moebius open scoped ArithmeticFunction.omega BigOperators diff --git a/LeanPool/SelbergSieve4/AuxResults.lean b/LeanPool/SelbergSieve4/AuxResults.lean index 234e89a196..e7d898f753 100644 --- a/LeanPool/SelbergSieve4/AuxResults.lean +++ b/LeanPool/SelbergSieve4/AuxResults.lean @@ -16,7 +16,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt # LeanPool.SelbergSieve4.AuxResults -/ -@[expose] public section +public section --import SelbergSieve.AesopDiv noncomputable section diff --git a/LeanPool/SelbergSieve4/ForArithmeticFunction.lean b/LeanPool/SelbergSieve4/ForArithmeticFunction.lean index 120acf2e34..2796f087f8 100644 --- a/LeanPool/SelbergSieve4/ForArithmeticFunction.lean +++ b/LeanPool/SelbergSieve4/ForArithmeticFunction.lean @@ -20,4 +20,4 @@ public import LeanPool.SelbergSieve4.Tactic.Multiplicativity Imported Lean Pool material for `LeanPool.SelbergSieve4.ForArithmeticFunction`. -/ -@[expose] public section +public section diff --git a/LeanPool/SelbergSieve4/ForMathlib.lean b/LeanPool/SelbergSieve4/ForMathlib.lean index 24169e0f7c..106820955f 100644 --- a/LeanPool/SelbergSieve4/ForMathlib.lean +++ b/LeanPool/SelbergSieve4/ForMathlib.lean @@ -14,4 +14,4 @@ import Mathlib.Tactic.Positivity.Finset # Auxiliary lemmas for Mathlib -/ -@[expose] public section +public section diff --git a/LeanPool/SelbergSieve4/ForMathlib/Basic.lean b/LeanPool/SelbergSieve4/ForMathlib/Basic.lean index 947f7f12eb..971a6e167a 100644 --- a/LeanPool/SelbergSieve4/ForMathlib/Basic.lean +++ b/LeanPool/SelbergSieve4/ForMathlib/Basic.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SelbergSieve4.ForMathlib.Basic -/ -@[expose] public section +public section namespace Aux diff --git a/LeanPool/SelbergSieve4/ForMathlib/ProdsAntidiagonal.lean b/LeanPool/SelbergSieve4/ForMathlib/ProdsAntidiagonal.lean index 6a394e31ac..639fdac41c 100644 --- a/LeanPool/SelbergSieve4/ForMathlib/ProdsAntidiagonal.lean +++ b/LeanPool/SelbergSieve4/ForMathlib/ProdsAntidiagonal.lean @@ -11,7 +11,7 @@ public import Mathlib.Algebra.Order.Antidiag.Nat # LeanPool.SelbergSieve4.ForMathlib.ProdsAntidiagonal -/ -@[expose] public section +public section open scoped ArithmeticFunction.omega diff --git a/LeanPool/SelbergSieve4/MainResults.lean b/LeanPool/SelbergSieve4/MainResults.lean index 212ccc76bf..31495462d9 100644 --- a/LeanPool/SelbergSieve4/MainResults.lean +++ b/LeanPool/SelbergSieve4/MainResults.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SelbergSieve4.MainResults -/ -@[expose] public section +public section open scoped BigOperators ArithmeticFunction.zeta ArithmeticFunction.Moebius ArithmeticFunction.omega Sieve Nat Nat.Prime diff --git a/LeanPool/SelbergSieve4/Selberg.lean b/LeanPool/SelbergSieve4/Selberg.lean index eb8932dea6..b3b2884257 100644 --- a/LeanPool/SelbergSieve4/Selberg.lean +++ b/LeanPool/SelbergSieve4/Selberg.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SelbergSieve4.Selberg -/ -@[expose] public section +public section noncomputable section @@ -48,6 +48,7 @@ local notation3 "y" => SelbergSieve.level s local notation3 "hy" => SelbergSieve.one_le_level s /-- Selberg bounding sum over divisors below the square-root level. -/ +@[expose] def selbergBoundingSum : ℝ := ∑ l ∈ divisors P, if l ^ 2 ≤ y then g l else 0 local notation3 "S" => SelbergSieve.selbergBoundingSum s diff --git a/LeanPool/SelbergSieve4/SieveLemmas.lean b/LeanPool/SelbergSieve4/SieveLemmas.lean index 0f8a17dff2..095d993f0f 100644 --- a/LeanPool/SelbergSieve4/SieveLemmas.lean +++ b/LeanPool/SelbergSieve4/SieveLemmas.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.SelbergSieve4.SieveLemmas -/ -@[expose] public section +public section noncomputable section @@ -61,22 +61,20 @@ local notation3 "X" => Sieve.totalMass s local notation3 "A" => Sieve.support s /-- Weighted count of support elements divisible by `d`. -/ -@[simp] -def multSum (d : ℕ) : ℝ := +@[expose, simp] def multSum (d : ℕ) : ℝ := ∑ n ∈ A, if d ∣ n then a n else 0 local notation3 "𝒜" => Sieve.multSum s -- A_d = ν (d)/d X + R_d /-- Remainder term after subtracting the expected main term from `multSum`. -/ -@[simp] -def rem (d : ℕ) : ℝ := +@[expose, simp] def rem (d : ℕ) : ℝ := 𝒜 d - ν d * X local notation3 "R" => Sieve.rem s /-- Weighted count of support elements coprime to the sieve modulus. -/ -def siftedSum : ℝ := +@[expose] def siftedSum : ℝ := ∑ d ∈ A, if Coprime P d then a d else 0 open scoped ArithmeticFunction @@ -100,7 +98,7 @@ def mainSum (μPlus : ℕ → ℝ) : ℝ := ∑ d ∈ divisors P, μPlus d * ν d /-- Error contribution of an upper-bound sieve weight. -/ -def errSum (μPlus : ℕ → ℝ) : ℝ := +@[expose] def errSum (μPlus : ℕ → ℝ) : ℝ := ∑ d ∈ divisors P, |μPlus d| * |R d| section SieveLemmas @@ -283,6 +281,7 @@ end SieveLemmas section LambdaSquared /-- Lambda-squared upper-bound weights generated from a function on divisors. -/ +@[expose] def _root_.Sieve.lambdaSquared (weights : ℕ → ℝ) : ℕ → ℝ := fun d => ∑ d1 ∈ d.divisors, ∑ d2 ∈ d.divisors, if d = Nat.lcm d1 d2 then weights d1 * weights d2 else 0 diff --git a/LeanPool/SelbergSieve4/Tactic.lean b/LeanPool/SelbergSieve4/Tactic.lean index 321e82f07d..8ffa85888a 100644 --- a/LeanPool/SelbergSieve4/Tactic.lean +++ b/LeanPool/SelbergSieve4/Tactic.lean @@ -14,4 +14,4 @@ import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt # Tactics for the Selberg sieve import -/ -@[expose] public section +public section diff --git a/LeanPool/SelbergSieve4/Tactic/AesopDiv.lean b/LeanPool/SelbergSieve4/Tactic/AesopDiv.lean index 4ca429e342..728e4dc1aa 100644 --- a/LeanPool/SelbergSieve4/Tactic/AesopDiv.lean +++ b/LeanPool/SelbergSieve4/Tactic/AesopDiv.lean @@ -14,7 +14,7 @@ import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt # LeanPool.SelbergSieve4.Tactic.AesopDiv -/ -@[expose] public section +public section namespace Sieve open Finset diff --git a/LeanPool/SelbergSieve4/Tactic/AesopInit.lean b/LeanPool/SelbergSieve4/Tactic/AesopInit.lean index 0d16d63410..4def9d0103 100644 --- a/LeanPool/SelbergSieve4/Tactic/AesopInit.lean +++ b/LeanPool/SelbergSieve4/Tactic/AesopInit.lean @@ -13,7 +13,7 @@ import Aesop.Frontend.Command Imported Lean Pool material for `LeanPool.SelbergSieve4.Tactic.AesopInit`. -/ -@[expose] public section +public section declare_aesop_rule_sets [Divisibility] diff --git a/LeanPool/SelbergSieve4/UpperBoundSieve.lean b/LeanPool/SelbergSieve4/UpperBoundSieve.lean index ae8f72d98c..c6df770aff 100644 --- a/LeanPool/SelbergSieve4/UpperBoundSieve.lean +++ b/LeanPool/SelbergSieve4/UpperBoundSieve.lean @@ -13,14 +13,14 @@ import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt # LeanPool.SelbergSieve4.UpperBoundSieve -/ -@[expose] public section +public section open scoped BigOperators ArithmeticFunction.zeta ArithmeticFunction.Moebius ArithmeticFunction.omega namespace Sieve /-- A real-valued divisor weight majorizing the delta function at `1`. -/ -def UpperMoebius (μ_plus : ℕ → ℝ) : Prop := +@[expose] def UpperMoebius (μ_plus : ℕ → ℝ) : Prop := ∀ n : ℕ, (if n=1 then 1 else 0) ≤ ∑ d ∈ n.divisors, μ_plus d /-- Upper-bound sieve weights with their majorization property. -/ diff --git a/LeanPool/SemicircleCheck.lean b/LeanPool/SemicircleCheck.lean index ec4e5a14c4..9139fb25b2 100644 --- a/LeanPool/SemicircleCheck.lean +++ b/LeanPool/SemicircleCheck.lean @@ -24,4 +24,4 @@ Tags: combinatorics, catalan-numbers, noncrossing-partitions MSC: 05A15, 05A18 -/ -@[expose] public section +public section diff --git a/LeanPool/SemicircleCheck/CatalanRecurrence.lean b/LeanPool/SemicircleCheck/CatalanRecurrence.lean index 6fff0a395b..a157cb6727 100644 --- a/LeanPool/SemicircleCheck/CatalanRecurrence.lean +++ b/LeanPool/SemicircleCheck/CatalanRecurrence.lean @@ -30,7 +30,7 @@ import LeanPool.SemicircleCheck.RotationArithmetic 4. catalanEquiv: NoncrossingPairing(n+1) ≃ Σ k, NCP(k) × NCP(n-k) -/ -@[expose] public section +public section open Equiv Equiv.Perm Fintype @@ -830,7 +830,7 @@ The full bijection NoncrossingPairing(n+1) ≃ Σ k, NCP(k) × NCP(n-k) that yields the Catalan recurrence when we take cardinalities. -/ /-- Noncrossing pairings: the subtype of pairings that are noncrossing. -/ -def NoncrossingPairing (n : ℕ) := +@[expose] def NoncrossingPairing (n : ℕ) := { p : Pairing n // p.IsNoncrossing } /-! ### Helper: extracting k from p(0) = 2k+1 -/ diff --git a/LeanPool/SemicircleCheck/Census.lean b/LeanPool/SemicircleCheck/Census.lean index 672426a377..c8c3075771 100644 --- a/LeanPool/SemicircleCheck/Census.lean +++ b/LeanPool/SemicircleCheck/Census.lean @@ -51,7 +51,7 @@ import Mathlib.Tactic.NormNum.GCD 4. Total pairings = (2n-1)!! = 1·3·5···(2n-1). -/ -@[expose] public section +public section open Equiv Equiv.Perm diff --git a/LeanPool/SemicircleCheck/EvenCard.lean b/LeanPool/SemicircleCheck/EvenCard.lean index 8445ffa267..0c888dea97 100644 --- a/LeanPool/SemicircleCheck/EvenCard.lean +++ b/LeanPool/SemicircleCheck/EvenCard.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.GCD This is the small combinatorial lemma later used in the Catalan recurrence. -/ -@[expose] public section +public section open Equiv Equiv.Perm diff --git a/LeanPool/SemicircleCheck/FinRotateLemmas.lean b/LeanPool/SemicircleCheck/FinRotateLemmas.lean index a3badfc6d7..ac17cf18c0 100644 --- a/LeanPool/SemicircleCheck/FinRotateLemmas.lean +++ b/LeanPool/SemicircleCheck/FinRotateLemmas.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.NormNum.GCD `finRotate` arithmetic lemmas isolated for eventual Mathlib extraction. -/ -@[expose] public section +public section open Equiv Equiv.Perm diff --git a/LeanPool/SemicircleCheck/GenusNoncrossing.lean b/LeanPool/SemicircleCheck/GenusNoncrossing.lean index 8273b5c39d..30aaa74b54 100644 --- a/LeanPool/SemicircleCheck/GenusNoncrossing.lean +++ b/LeanPool/SemicircleCheck/GenusNoncrossing.lean @@ -28,7 +28,7 @@ import Mathlib.GroupTheory.Perm.Fin - Three-stage proof decomposition via cycle count bound -/ -@[expose] public section +public section open Equiv Equiv.Perm Fintype @@ -79,11 +79,11 @@ avoids carrying proof terms through every definition and theorem. -/ /-- A permutation is a pairing if it is an involution with no fixed points. -/ -def IsPairing {n : ℕ} (π : Perm (Fin (2 * n))) : Prop := +@[expose] def IsPairing {n : ℕ} (π : Perm (Fin (2 * n))) : Prop := π ^ 2 = 1 ∧ ∀ x, π x ≠ x /-- The type of pairings of Fin (2n). -/ -def Pairing (n : ℕ) := +@[expose] def Pairing (n : ℕ) := { π : Perm (Fin (2 * n)) // IsPairing π } instance (n : ℕ) : CoeOut (Pairing n) (Perm (Fin (2 * n))) := @@ -573,7 +573,7 @@ formulation because: -/ /-- An adjacent pair in a pairing: a point i such that π(i) = i + 1 mod 2n. -/ -def Pairing.hasAdjacentAt {n : ℕ} (p : Pairing n) (i : Fin (2 * n)) : Prop := +@[expose] def Pairing.hasAdjacentAt {n : ℕ} (p : Pairing n) (i : Fin (2 * n)) : Prop := p.val i = finRotate (2 * n) i /-- Deletion of an adjacent pair: given a pairing with π(i) = i+1, @@ -589,7 +589,7 @@ def Pairing.hasAdjacentAt {n : ℕ} (p : Pairing n) (i : Fin (2 * n)) : Prop := It requires building the injection Fin(2n-2) ↪ Fin(2n) that skips i and j, and proving the conjugated permutation is a fixed-point-free involution. -/ -noncomputable def Pairing.deleteAdjacent {n : ℕ} (p : Pairing (n + 1)) +@[expose] noncomputable def Pairing.deleteAdjacent {n : ℕ} (p : Pairing (n + 1)) (i : Fin (2 * (n + 1))) (h : p.hasAdjacentAt i) : Pairing n := -- Rotate so the adjacent pair sits at coordinates (0, 1) @@ -636,7 +636,7 @@ noncomputable def Pairing.deleteAdjacent {n : ℕ} (p : Pairing (n + 1)) exact SemicircleCore.contractZeroOne_isPairing h₀' h₁' hinv hfpf⟩ /-- Recursive noncrossing predicate. -/ -def Pairing.IsNoncrossing : {n : ℕ} → Pairing n → Prop +@[expose] def Pairing.IsNoncrossing : {n : ℕ} → Pairing n → Prop | 0, _ => True | n + 1, p => ∃ i : Fin (2 * (n + 1)), ∃ h : p.hasAdjacentAt i, (p.deleteAdjacent i h).IsNoncrossing diff --git a/LeanPool/SemicircleCheck/RotationArithmetic.lean b/LeanPool/SemicircleCheck/RotationArithmetic.lean index d08711c6df..ea6b1cafc0 100644 --- a/LeanPool/SemicircleCheck/RotationArithmetic.lean +++ b/LeanPool/SemicircleCheck/RotationArithmetic.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.GCD The `finRotate` arithmetic lemmas live in `SemicircleCheck.FinRotateLemmas`. -/ -@[expose] public section +public section open Equiv Equiv.Perm diff --git a/LeanPool/SemicircleCheck/ShiftTwoEquiv.lean b/LeanPool/SemicircleCheck/ShiftTwoEquiv.lean index 721d0aae55..33dac766b5 100644 --- a/LeanPool/SemicircleCheck/ShiftTwoEquiv.lean +++ b/LeanPool/SemicircleCheck/ShiftTwoEquiv.lean @@ -27,7 +27,7 @@ import Mathlib.Data.Fin.Basic rotate to (0,1) → contractZeroOne → rotate back (if needed) -/ -@[expose] public section +public section namespace SemicircleCore @@ -35,7 +35,7 @@ variable {n : ℕ} /-- The uniform, piecewise-free embedding of the reduced universe into the expanded universe, bypassing coordinates 0 and 1. -/ -def shiftTwoEquiv (n : ℕ) : +@[expose] def shiftTwoEquiv (n : ℕ) : Fin (2 * n) ≃ { x : Fin (2 * n + 2) // 2 ≤ x.val } where toFun x := ⟨⟨x.val + 2, by omega⟩, by simp⟩ invFun y := ⟨y.val.val - 2, by omega⟩ @@ -43,7 +43,7 @@ def shiftTwoEquiv (n : ℕ) : right_inv y := Subtype.ext (Fin.ext (by simp; omega)) /-- The invariant subspace after 0 and 1 are claimed by adjacency. -/ -def RemainingDomain (n : ℕ) : Set (Fin (2 * n + 2)) := +@[expose] def RemainingDomain (n : ℕ) : Set (Fin (2 * n + 2)) := { x | 2 ≤ x.val } /-- If π(0) = 1 and π(1) = 0, then π maps {x | x ≥ 2} into itself. @@ -87,7 +87,7 @@ private lemma symm_mapsTo_remaining {π : Equiv.Perm (Fin (2 * n + 2))} Construction: build the restricted permutation on `{x | 2 ≤ x.val}`, then conjugate through `shiftTwoEquiv`. -/ -def contractZeroOne (π : Equiv.Perm (Fin (2 * n + 2))) +@[expose] def contractZeroOne (π : Equiv.Perm (Fin (2 * n + 2))) (h₀ : π ⟨0, by omega⟩ = ⟨1, by omega⟩) (h₁ : π ⟨1, by omega⟩ = ⟨0, by omega⟩) : Equiv.Perm (Fin (2 * n)) := diff --git a/LeanPool/SemicircleLaw.lean b/LeanPool/SemicircleLaw.lean index 2c3f72c464..2ada6ca2a2 100644 --- a/LeanPool/SemicircleLaw.lean +++ b/LeanPool/SemicircleLaw.lean @@ -21,7 +21,7 @@ Tags: probability, random-matrix-theory, distributions MSC: 60B20, 60E05 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/SemicircleLaw/SemicircleDistribution.lean b/LeanPool/SemicircleLaw/SemicircleDistribution.lean index 7d35c9c3aa..f2046f877c 100644 --- a/LeanPool/SemicircleLaw/SemicircleDistribution.lean +++ b/LeanPool/SemicircleLaw/SemicircleDistribution.lean @@ -40,7 +40,7 @@ We define the real-valued Wigner semicircle distribution. * `centralMoment_odd_semicircleReal`: the odd central moments of the semicircle distribution vanish. -/ -@[expose] public section +public section open scoped ENNReal NNReal Real ProbabilityTheory @@ -50,8 +50,7 @@ namespace LeanPool.SemicircleLaw /-- Probability density function of the semicircle distribution with mean `μ` and variance `v`. Note that the square root of a negative number is defined to be zero. -/ -noncomputable -def semicirclePDFReal (μ : ℝ) (v : ℝ≥0) (x : ℝ) : ℝ := +@[expose] noncomputable def semicirclePDFReal (μ : ℝ) (v : ℝ≥0) (x : ℝ) : ℝ := 1 / (2 * π * v) * √(4 * v - (x - μ) ^ 2) lemma semicirclePDFReal_def (μ : ℝ) (v : ℝ≥0) : @@ -207,8 +206,7 @@ lemma lintegral_semicirclePDFReal_eq_one (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) rw [integral_semicirclePDFReal_eq_one μ hv, ENNReal.ofReal_one] /-- The `ℝ≥0∞`-valued pdf of a semicircle distribution on `ℝ` with mean `μ` and variance `v`. -/ -noncomputable -def semicirclePDF (μ : ℝ) (v : ℝ≥0) (x : ℝ) : ℝ≥0∞ := +@[expose] noncomputable def semicirclePDF (μ : ℝ) (v : ℝ≥0) (x : ℝ) : ℝ≥0∞ := ENNReal.ofReal (semicirclePDFReal μ v x) lemma semicirclePDF_def (μ : ℝ) (v : ℝ≥0) : diff --git a/LeanPool/Sensitivity.lean b/LeanPool/Sensitivity.lean index ca481a6404..6615448fc4 100644 --- a/LeanPool/Sensitivity.lean +++ b/LeanPool/Sensitivity.lean @@ -27,7 +27,7 @@ Tags: combinatorics, boolean-functions, computational-complexity MSC: 06E30, 68Q17 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/Sensitivity/Basic.lean b/LeanPool/Sensitivity/Basic.lean index 5bb0db1d46..987bc83e86 100644 --- a/LeanPool/Sensitivity/Basic.lean +++ b/LeanPool/Sensitivity/Basic.lean @@ -23,7 +23,7 @@ Basic bounds and symmetries for the sensitivity of Boolean functions. predicate is invariant under flipping the same coordinate at the input. -/ -@[expose] public section +public section namespace LeanPoolSensitivity diff --git a/LeanPool/Sensitivity/Consequences.lean b/LeanPool/Sensitivity/Consequences.lean index 10a3459a0c..096b53e8a3 100644 --- a/LeanPool/Sensitivity/Consequences.lean +++ b/LeanPool/Sensitivity/Consequences.lean @@ -22,7 +22,7 @@ of its sensitivity. * `LeanPoolSensitivity.degree_le_sensitivity_sq` — `f.degree ≤ f.sensitivity^2`. -/ -@[expose] public section +public section namespace LeanPoolSensitivity diff --git a/LeanPool/Sensitivity/Defs.lean b/LeanPool/Sensitivity/Defs.lean index c3d166dc1b..79d57787f4 100644 --- a/LeanPool/Sensitivity/Defs.lean +++ b/LeanPool/Sensitivity/Defs.lean @@ -28,7 +28,7 @@ including bit flips, sensitivity, and local sensitivity. coordinates simultaneously. -/ -@[expose] public section +public section namespace LeanPoolSensitivity @@ -40,7 +40,7 @@ variable {n : ℕ} /-- Flip the `i`-th bit of an input `x : Fin n → Bool`, leaving all other coordinates fixed. -/ -def flipBit (x : Fin n → Bool) (i : Fin n) : Fin n → Bool := +@[expose] def flipBit (x : Fin n → Bool) (i : Fin n) : Fin n → Bool := Function.update x i (!x i) @[simp] @@ -77,7 +77,7 @@ namespace BoolFun /-- `f` is sensitive at input `x` in coordinate `i` when flipping bit `i` changes the value of `f`. -/ -def sensitiveAt (f : BoolFun n) (x : Fin n → Bool) (i : Fin n) : Prop := +@[expose] def sensitiveAt (f : BoolFun n) (x : Fin n → Bool) (i : Fin n) : Prop := f (flipBit x i) ≠ f x instance (f : BoolFun n) (x : Fin n → Bool) (i : Fin n) : @@ -86,12 +86,12 @@ instance (f : BoolFun n) (x : Fin n → Bool) (i : Fin n) : /-- The local sensitivity of `f` at input `x`: number of coordinates `i` at which `f` is sensitive. -/ -def localSensitivity (f : BoolFun n) (x : Fin n → Bool) : ℕ := +@[expose] def localSensitivity (f : BoolFun n) (x : Fin n → Bool) : ℕ := (Finset.univ.filter fun i => f.sensitiveAt x i).card /-- The sensitivity of `f`: the maximum of `f.localSensitivity x` over all inputs `x`. -/ -noncomputable def sensitivity (f : BoolFun n) : ℕ := +@[expose] noncomputable def sensitivity (f : BoolFun n) : ℕ := Finset.univ.sup (fun x => f.localSensitivity x) /-- The sensitivity of any Boolean function on `n` variables is at most `n`. -/ diff --git a/LeanPool/Sensitivity/Huang.lean b/LeanPool/Sensitivity/Huang.lean index a99b3d20a3..de3d0e2ed8 100644 --- a/LeanPool/Sensitivity/Huang.lean +++ b/LeanPool/Sensitivity/Huang.lean @@ -46,7 +46,7 @@ The project was developed at https://github.com/leanprover-community/lean-sensit archived at https://github.com/leanprover-community/mathlib/blob/master/archive/sensitivity.lean -/ -@[expose] public section +public section namespace LeanPoolSensitivity.Huang @@ -109,7 +109,7 @@ theorem succ_n_eq (p q : Q n.succ) : p = q ↔ p 0 = q 0 ∧ π p = π q := by /-- The adjacency relation defining the graph structure on `Q n`: `p.adjacent q` if there is an edge from `p` to `q` in `Q n`. -/ -def adjacent {n : ℕ} (p : Q n) : Set (Q n) := { q | ∃! i, p i ≠ q i } +@[expose] def adjacent {n : ℕ} (p : Q n) : Set (Q n) := { q | ∃! i, p i ≠ q i } /-- In `Q 0`, no two vertices are adjacent. -/ theorem not_adjacent_zero (p q : Q 0) : q ∉ p.adjacent := by rintro ⟨v, _⟩; apply finZeroElim v @@ -196,7 +196,7 @@ noncomputable def e : ∀ {n}, Q n → V n @[simp] theorem e_zero_apply (x : Q 0) : e x = (1 : ℝ) := - rfl + by rfl /-- The dual basis to `e`, defined inductively. -/ noncomputable def ε : ∀ {n : ℕ}, Q n → V n →ₗ[ℝ] ℝ @@ -276,7 +276,7 @@ The next two lemmas unbury them. -/ @[simp] theorem f_zero : f 0 = 0 := - rfl + by rfl theorem f_succ_apply (v : V n.succ) : f n.succ v = (f n v.1 + v.2, v.1 - f n v.2) := by cases v diff --git a/LeanPool/Sensitivity/HuangBridge.lean b/LeanPool/Sensitivity/HuangBridge.lean index 6c94fb68ec..b88cbf42e2 100644 --- a/LeanPool/Sensitivity/HuangBridge.lean +++ b/LeanPool/Sensitivity/HuangBridge.lean @@ -26,7 +26,7 @@ project, a community formalisation of Huang's proof carried out shortly after the original paper appeared in 2019. -/ -@[expose] public section +public section namespace LeanPoolSensitivity diff --git a/LeanPool/Sensitivity/Main.lean b/LeanPool/Sensitivity/Main.lean index d954d70f48..c98a206ca8 100644 --- a/LeanPool/Sensitivity/Main.lean +++ b/LeanPool/Sensitivity/Main.lean @@ -36,7 +36,7 @@ lemma with the Huang hypercube lemma imported from `Mathlib`'s `f` itself. -/ -@[expose] public section +public section namespace LeanPoolSensitivity diff --git a/LeanPool/Sensitivity/Multilinear.lean b/LeanPool/Sensitivity/Multilinear.lean index 36afec4c7a..c145a724d5 100644 --- a/LeanPool/Sensitivity/Multilinear.lean +++ b/LeanPool/Sensitivity/Multilinear.lean @@ -26,7 +26,7 @@ of that representation and the multilinear degree of `f`. * `LeanPoolSensitivity.BoolFun.degree` — the multilinear degree of `f`. -/ -@[expose] public section +public section namespace LeanPoolSensitivity @@ -34,7 +34,7 @@ variable {n : ℕ} /-- The Boolean assignment that is `true` on coordinates in `S` and `false` elsewhere. -/ -def indicator (S : Finset (Fin n)) : Fin n → Bool := +@[expose] def indicator (S : Finset (Fin n)) : Fin n → Bool := fun i => decide (i ∈ S) @[simp] @@ -48,7 +48,7 @@ theorem indicator_not_mem {S : Finset (Fin n)} {i : Fin n} : simp [indicator] /-- Integer encoding of a Boolean value: `true ↦ 1` and `false ↦ 0`. -/ -def boolToInt (b : Bool) : ℤ := if b then 1 else 0 +@[expose] def boolToInt (b : Bool) : ℤ := if b then 1 else 0 @[simp] theorem boolToInt_true : boolToInt true = 1 := rfl @[simp] theorem boolToInt_false : boolToInt false = 0 := rfl @@ -59,7 +59,7 @@ namespace BoolFun `∏_{i ∈ S} x_i` in the unique multilinear polynomial representing `f`, computed by inclusion–exclusion as `c_S(f) = ∑_{T ⊆ S} (-1)^{|S|-|T|} f(1_T)`. -/ -def moebius (f : BoolFun n) (S : Finset (Fin n)) : ℤ := +@[expose] def moebius (f : BoolFun n) (S : Finset (Fin n)) : ℤ := ∑ T ∈ S.powerset, (-1) ^ (S.card - T.card) * boolToInt (f (indicator T)) diff --git a/LeanPool/Sensitivity/Parity.lean b/LeanPool/Sensitivity/Parity.lean index 80aaf98c3a..19db3ea345 100644 --- a/LeanPool/Sensitivity/Parity.lean +++ b/LeanPool/Sensitivity/Parity.lean @@ -32,7 +32,7 @@ must have a "majority" parity-sign class strictly larger than `2^{n-1}`. degree, one parity-sign class has more than `2^{n-1}` vertices. -/ -@[expose] public section +public section namespace LeanPoolSensitivity diff --git a/LeanPool/Sensitivity/Subcube.lean b/LeanPool/Sensitivity/Subcube.lean index 328d8f2016..ab0c1f1dc9 100644 --- a/LeanPool/Sensitivity/Subcube.lean +++ b/LeanPool/Sensitivity/Subcube.lean @@ -32,7 +32,7 @@ decrease sensitivity and preserves Möbius coefficients on subsets of the restriction has full degree `d`. -/ -@[expose] public section +public section namespace LeanPoolSensitivity @@ -40,7 +40,7 @@ variable {n : ℕ} /-- Embed an assignment of the "free" coordinates into the full hypercube by copying values from `base` on the non-free coordinates. -/ -def embed (free : Finset (Fin n)) (base : Fin n → Bool) +@[expose] def embed (free : Finset (Fin n)) (base : Fin n → Bool) (x : Fin n → Bool) : Fin n → Bool := fun j => if j ∈ free then x j else base j @@ -83,7 +83,7 @@ namespace BoolFun /-- Restriction of `f` to the subcube parametrised by the free coordinates `free` and the fixed assignment `base` on the remaining coordinates. -/ -def restrictTo (f : BoolFun n) (free : Finset (Fin n)) +@[expose] def restrictTo (f : BoolFun n) (free : Finset (Fin n)) (base : Fin n → Bool) : BoolFun n := fun x => f (embed free base x) diff --git a/LeanPool/SetTheory.lean b/LeanPool/SetTheory.lean index 2a67ff694c..6b1e9a982c 100644 --- a/LeanPool/SetTheory.lean +++ b/LeanPool/SetTheory.lean @@ -18,7 +18,7 @@ Tags: set-theory, large-cardinals, elementary-embedding, kunen-inconsistency, mo MSC: 03E55, 03C90 -/ -@[expose] public section +public section /-! ## Overview diff --git a/LeanPool/SetTheory/Basic.lean b/LeanPool/SetTheory/Basic.lean index fd2a9ede95..c94eefe5e6 100644 --- a/LeanPool/SetTheory/Basic.lean +++ b/LeanPool/SetTheory/Basic.lean @@ -23,7 +23,7 @@ including the von Neumann hierarchy and foundational lemmas used throughout the inconsistency development. -/ -@[expose] public section +public section noncomputable section @@ -106,7 +106,7 @@ class ToV (α : Type*) where open ToV /-- The `toZFSet` declaration. -/ -def toZFSet {α} [ToV α] (x : α) : ZFSet.{0} := (toV x).val +@[expose] def toZFSet {α} [ToV α] (x : α) : ZFSet.{0} := (toV x).val /-- The `↓_` notation. -/ prefix:max "↓" => toV @@ -287,7 +287,7 @@ lemma lt_iff_le_and_exists {x y : M} : x < y ↔ x ≤ y ∧ ∃ z ∈ y, z ∉ attribute [formula_builder_pre, formula_builder] Set.mem_setOf_eq /-- The `IsSet` declaration. -/ -@[formula_builder_pre] def IsSet (C : Set M) := ∃! x : M, ∀ y, y ∈ x ↔ y ∈ C +@[expose, formula_builder_pre] def IsSet (C : Set M) := ∃! x : M, ∀ y, y ∈ x ↔ y ∈ C lemma isSet_iff_exists_set {C : Set M} : IsSet C ↔ ∃ x : M, ∀ y, y ∈ x ↔ y ∈ C := by refine ⟨fun | ⟨x, hx⟩ => ⟨x, hx.1⟩, fun | ⟨x, hx⟩ => ⟨x, hx, fun y hy => ?_⟩⟩ @@ -312,7 +312,7 @@ lemma exists_separate (x : M) (p : M → Prop) : IsSet {y | y ∈ x ∧ p y} := ⟨ZFSet.sep (fun x => p (↓x)) x, fun _ => ZFSet.mem_sep⟩ /-- The `separate` declaration. -/ -def separate (x : M) (p : M → Prop) := (exists_separate x p).choose +@[expose] def separate (x : M) (p : M → Prop) := (exists_separate x p).choose @[simp] lemma mem_separate_iff {x : M} {p : M → Prop} : ∀ z, z ∈ separate x p ↔ z ∈ x ∧ p z := (exists_separate x p).choose_spec.1 @@ -531,7 +531,7 @@ lemma exists_minimal {p : M → Prop} : (∃! x, IsGLB {x | p x} x) ↔ ∃ x : · refine ⟨_, fun y hy => hy _ ht⟩ /-- The `IsTransitive` declaration. -/ -@[realize] def IsTransitive (X : M) := ∀ ⦃x⦄, x ∈ X → x ⊆ X +@[expose, realize] def IsTransitive (X : M) := ∀ ⦃x⦄, x ∈ X → x ⊆ X @[toV_simps] lemma IsTransitive.toV (α : M) : IsTransitive ↓α ↔ IsTransitive α := by simp only [IsTransitive, toV_simps] @@ -660,7 +660,7 @@ instance instOrderBotM : OrderBot M where notation "⸨"a ", " b "⸩" => pair a b /-- The `IsPair` declaration. -/ -@[realize] def IsPair (z : M) := ∃ x, ∃ y, z = ⸨x, y⸩ +@[expose, realize] def IsPair (z : M) := ∃ x, ∃ y, z = ⸨x, y⸩ @[simp] lemma isPair_pair {x y : M} : IsPair ⸨x, y⸩ := by simp [IsPair] @@ -718,9 +718,9 @@ lemma unordered_pair_mem_pair (x y : M) : {x, y} ∈ ⸨x, y⸩ := by simp [pair attribute [simp] Pairs.spec /-- The `IsRelation` declaration. -/ -@[realize] def IsRelation (r : M) := ∀ ⦃x⦄, x ∈ r → IsPair x +@[expose, realize] def IsRelation (r : M) := ∀ ⦃x⦄, x ∈ r → IsPair x /-- The `IsFunc` declaration. -/ -@[realize] def IsFunc (f : M) := IsRelation f ∧ ∀ ⦃x y z⦄, ⸨x, y⸩ ∈ f → ⸨x, z⸩ ∈ f → y = z +@[expose, realize] def IsFunc (f : M) := IsRelation f ∧ ∀ ⦃x y z⦄, ⸨x, y⸩ ∈ f → ⸨x, z⸩ ∈ f → y = z @[realize] lemma Dom.eu (f : M) : IsSet {x | ∃ y, ⸨x, y⸩ ∈ f} := by rw [isSet_iff] @@ -759,10 +759,11 @@ lemma func_sub_pairs {A B f : M} (hf : IsFunc f ∧ Dom f = A ∧ Ran f ⊆ B) : exact ⟨y, hy, fun z hz => (hf.2 hy hz).symm⟩ /-- The `PreserveMem` declaration. -/ -@[realize] def PreserveMem (f : M) := ∀ x ∈ Dom f, ∀ y ∈ Dom f, x ∈ y → apply f x ∈ apply f y +@[expose, realize] def PreserveMem (f : M) := + ∀ x ∈ Dom f, ∀ y ∈ Dom f, x ∈ y → apply f x ∈ apply f y /-- The `funcToSet` declaration. -/ -def funcToSet {A B : M} (f : A → B) : M := +@[expose] def funcToSet {A B : M} (f : A → B) : M := separate (Pairs A B) fun x => ∃ hx : fst x ∈ A, (f ⟨fst x, hx⟩).1 = snd x @[simp] lemma isFunc_funcToSet {A B : M} {f : A → B} : IsFunc (funcToSet f) := by @@ -840,7 +841,7 @@ lemma funcToSet_setToFunc {A B : M} (f : (Func A B : M)) : funcToSet (setToFunc simp only [fst_mem_A, apply.eq_iff _ _ hf.1 fst_mem_dom, eta, hx, and_true] /-- The `funcEquiv` declaration. -/ -def funcEquiv {A B : M} : (Func A B : M) ≃ (A → B) where +@[expose] def funcEquiv {A B : M} : (Func A B : M) ≃ (A → B) where toFun f := setToFunc f invFun f := ⟨funcToSet f, funcToSet_mem_Func f⟩ left_inv := by simp [LeftInverse, funcToSet_setToFunc] @@ -881,7 +882,7 @@ lemma ext_func {f g : M} (hf : IsFunc f) (hg : IsFunc g) simp [sInf] /-- The `IsInjective` declaration. -/ -@[realize] def IsInjective (f : M) := +@[expose, realize] def IsInjective (f : M) := IsFunc f ∧ ∀ x ∈ Dom f, ∀ y ∈ Dom f, apply f x = apply f y → x = y @[simp] lemma isInjective_funcToSet {A B : M} {f : A → B} : @@ -895,11 +896,11 @@ lemma nonempty_iff (x : M) : Nonempty x ↔ x ≠ ∅ := by simp only [not_forall, not_not] /-- The `cardLE` declaration. -/ -@[realize] def cardLE (x y : M) := ∃ f ∈ Func x y, IsInjective f +@[expose, realize] def cardLE (x y : M) := ∃ f ∈ Func x y, IsInjective f /-- The `cardEq` declaration. -/ -@[realize] def cardEq (x y : M) := ∃ f ∈ Func x y, IsInjective f ∧ Ran f = y +@[expose, realize] def cardEq (x y : M) := ∃ f ∈ Func x y, IsInjective f ∧ Ran f = y /-- The `cardLT` declaration. -/ -@[realize] def cardLT (x y : M) := cardLE x y ∧ ¬cardEq x y +@[expose, realize] def cardLT (x y : M) := cardLE x y ∧ ¬cardEq x y lemma cardLE_iff (x y : M) : cardLE x y ↔ #x ≤ #y := by simpa only [cardLE, exists_func, isInjective_funcToSet, le_def] diff --git a/LeanPool/SetTheory/ElementaryEmbedding.lean b/LeanPool/SetTheory/ElementaryEmbedding.lean index 931e6f7c2a..f68baeef3e 100644 --- a/LeanPool/SetTheory/ElementaryEmbedding.lean +++ b/LeanPool/SetTheory/ElementaryEmbedding.lean @@ -15,7 +15,7 @@ This module defines nontrivial elementary embeddings of a model of ZF into itsel critical points, and the basic properties of the iterates of the critical point. -/ -@[expose] public section +public section noncomputable section @@ -109,7 +109,7 @@ lemma crit_exists : ∃ α, IsOrdinal α ∧ j α ≠ α := by variable (j) in /-- The `crit` declaration. -/ -def crit : M := sInf {α : M | j α ≠ α ∧ IsOrdinal α} +@[expose] def crit : M := sInf {α : M | j α ≠ α ∧ IsOrdinal α} lemma crit_eq_ordinal_sInf : crit j = (sInf {α : Ordinals M | j α ≠ α}).1 := by rw [crit, show {α | j α ≠ α ∧ IsOrdinal α} = (·.1) '' {α : Ordinals M | j α ≠ α} by ext; simp, @@ -231,7 +231,7 @@ lemma isStrongLimit_crit_iter (n : ℕ) : IsStrongLimit (j^[n] (crit j)) := by variable (j) in /-- The `hasOmegaOfNontrivialSelfEmbedding` declaration. -/ -@[reducible] def hasOmegaOfNontrivialSelfEmbedding : IsVonNeumannWithOmega M := by +@[expose, reducible] def hasOmegaOfNontrivialSelfEmbedding : IsVonNeumannWithOmega M := by split_vonNeumann hM · suffices ω < μ from .vonNeumann μ hμ this rfl by_contra! μ_le_omega diff --git a/LeanPool/SetTheory/KunenInconsistency.lean b/LeanPool/SetTheory/KunenInconsistency.lean index 92904e9605..42675e231b 100644 --- a/LeanPool/SetTheory/KunenInconsistency.lean +++ b/LeanPool/SetTheory/KunenInconsistency.lean @@ -16,7 +16,7 @@ This module proves the Kunen inconsistency theorem: there is no nontrivial eleme embedding of the universe of sets into itself. -/ -@[expose] public section +public section noncomputable section @@ -28,7 +28,8 @@ private lemma mk_Iio_ToType_lt {c : Cardinal} (i : c.ord.ToType) : #(Set.Iio i) simpa using mk_Iio_lt i /-- The `IsOmegaJonssonFunc` declaration. -/ -@[realize] def IsOmegaJonssonFunc {M₀} [ZFStructure M₀] [IsVonNeumannWithOmega M₀] (f κ : M₀) := +@[expose, realize] def IsOmegaJonssonFunc {M₀} [ZFStructure M₀] [IsVonNeumannWithOmega M₀] + (f κ : M₀) := f ∈ Func (Func ωₘ κ) κ ∧ ∀ X ⊆ κ, cardEq X κ → ∀ α ∈ κ, ∃ s ∈ Func ωₘ X, apply f s = α /-- The `KunenBoundParams` type. -/ @@ -53,9 +54,9 @@ instance : ZFStructure M := structureM instance : IsVonNeumannWithOmega M := hasOmegaOfNontrivialSelfEmbedding (hM := isVonNeumann) j /-- The `κ` declaration. -/ -def κ n := j^[n] (crit j) +@[expose] def κ n := j^[n] (crit j) /-- The `κω` declaration. -/ -def κω : M := ⨆ n : ℕ, κ n +@[expose] def κω : M := ⨆ n : ℕ, κ n /-- The `κωEquinumerousSubsets` declaration. -/ def κωEquinumerousSubsets := {x : M // x ⊆ κω ∧ #x = #κω} /-- The `ν` declaration. -/ @@ -89,6 +90,7 @@ lemma bddAbove_ordinal_κ : convert bddAbove_crit_iter using 1 ext x simp only [Set.mem_image, Set.mem_range, exists_exists_eq_and] + simp only [κ] rfl lemma κω_eq_ordinal_sSup : κω = (⨆ n : ℕ, (⟨κ n, isOrdinal_crit_iter _⟩ : Ordinals M)).1 := by @@ -103,7 +105,10 @@ lemma κ_mem_κω (n : ℕ) : κ n ∈ κω := by erw [Subtype.mk_lt_mk, ← IsOrdinal.mem_iff_lt (isOrdinal_crit_iter _) (isOrdinal_crit_iter _)] exact crit_iter_mem_succ n -lemma κ_le_κω (n : ℕ) : κ n ≤ κω := le_csSup bddAbove_crit_iter ⟨n, rfl⟩ +lemma κ_le_κω (n : ℕ) : κ n ≤ κω := by + change (κ n : Set M) ⊆ (κω : Set M) + intro x hx + exact (le_csSup bddAbove_crit_iter ⟨n, rfl⟩) hx lemma aleph0_le_κω : ℵ₀ ≤ #κω := by simpa only [← card_ωₘ, κω] using card_le_of_sub (le_trans ωₘ_le_crit (κ_le_κω 0)) @@ -198,7 +203,7 @@ lemma s_mem_X : ∀ α n, (s α n).1 ∈ X α := by /-- The `f` declaration. -/ def f (x : ℕ → κω) : κω := ⟨γ (s.invFun x), γ_mem_κω _⟩ /-- The `fSet` declaration. -/ -def fSet : M := funcToSet fun x => f (setToFunc x ∘ omegaEquiv.symm) +@[expose] def fSet : M := funcToSet fun x => f (setToFunc x ∘ omegaEquiv.symm) lemma fSet_mem : fSet ∈ Func (Func ωₘ κω) κω := (funcEquiv.symm fun x => f (funcEquiv x ∘ omegaEquiv.symm)).2 @@ -271,7 +276,8 @@ lemma j_κFuncSet : j κFuncSet = funcToSet (κFunc ∘ Nat.succ ∘ omegaEquiv) rw [← j_natCast (j := j), apply.elementarity, κFuncSet, apply_funcToSet _ (by simp), apply_funcToSet _ (by simp [j_natCast])] simp only [comp_apply, κFunc, Nat.succ_eq_add_one, j_natCast] - erw [omegaEquiv.apply_symm_apply, κ, κ, iterate_succ_apply'] + simp only [κ] + rw [iterate_succ_apply'] lemma j_κω : j κω = κω := by simp only [← iUnion_κ_funcSet_eq, elementary_simps_rev, j_κFuncSet] @@ -286,7 +292,7 @@ lemma j_κω : j κω = κω := by simpa [eq_comm] using (Nat.or_exists_add_one (p := fun n => κ n = x)).symm have bdd_κ_comp_succ : BddAbove (Set.range (κ ∘ Nat.succ)) := by refine bddAbove_crit_iter.mono fun | x, ⟨n, hn⟩ => ?_ - simpa using ⟨n + 1, hn⟩ + simpa only [κ, comp_apply] using ⟨n + 1, hn⟩ rw [eq_insert, csSup_insert bdd_κ_comp_succ, right_eq_sup] · exact le_trans (le_of_lt (crit_iter_lt_succ 0)) (le_csSup bdd_κ_comp_succ ⟨0, rfl⟩) · simp [Set.range_nonempty] diff --git a/LeanPool/SetTheory/Omega.lean b/LeanPool/SetTheory/Omega.lean index a50cf9de13..c7cbc1cdad 100644 --- a/LeanPool/SetTheory/Omega.lean +++ b/LeanPool/SetTheory/Omega.lean @@ -16,7 +16,7 @@ This module develops the theory of `ω` and the natural numbers inside a von Neu of ZF, providing the infinitary tools needed for the Kunen inconsistency argument. -/ -@[expose] public section +public section noncomputable section @@ -36,9 +36,10 @@ def Set.toZFSet {A : ZFSet} (B : Set A) : ZFSet := namespace SetTheory /-- The `IsWellFoundedRevMem` declaration. -/ -@[realize] def IsWellFoundedRevMem (x : M) := ∀ S ∈ 𝓟 x, S ≠ ∅ → ∃ y ∈ S, ∀ z ∈ S, y ∉ z +@[expose, realize] def IsWellFoundedRevMem (x : M) := + ∀ S ∈ 𝓟 x, S ≠ ∅ → ∃ y ∈ S, ∀ z ∈ S, y ∉ z /-- The `MemOmega` declaration. -/ -@[realize] def MemOmega (x : M) := IsOrdinal x ∧ IsWellFoundedRevMem x +@[expose, realize] def MemOmega (x : M) := IsOrdinal x ∧ IsWellFoundedRevMem x @[toV_simps] lemma IsWellFoundedRevMem.toV (x : M) : IsWellFoundedRevMem ↓x ↔ IsWellFoundedRevMem x := by simp only [IsWellFoundedRevMem, toV_simps, empty.toV (M := M)] @@ -69,7 +70,7 @@ namespace SetTheory aesop /-- The `ωₛ` declaration. -/ -def ωₛ := Ordinal.toZFSet ω +@[expose] def ωₛ := Ordinal.toZFSet ω instance instNatCastM : NatCast M where natCast (n : ℕ) := by diff --git a/LeanPool/SetTheory/OrderTheory.lean b/LeanPool/SetTheory/OrderTheory.lean index fdc390d7d7..b72aa8146a 100644 --- a/LeanPool/SetTheory/OrderTheory.lean +++ b/LeanPool/SetTheory/OrderTheory.lean @@ -14,16 +14,16 @@ This module collects order-theoretic lemmas about infima and suprema in conditio complete lattices, in particular closure under bounded infima and suprema. -/ -@[expose] public section +public section open Function OrderDual Set variable {α β : Type*} [ConditionallyCompleteLattice α] [ConditionallyCompleteLattice β] /-- The `sInfClosed` declaration. -/ -def sInfClosed (S : Set α) := ∀ s ⊆ S, s.Nonempty → BddBelow s → sInf s ∈ S +@[expose] def sInfClosed (S : Set α) := ∀ s ⊆ S, s.Nonempty → BddBelow s → sInf s ∈ S /-- The `sSupClosed` declaration. -/ -def sSupClosed (S : Set α) := ∀ s ⊆ S, s.Nonempty → BddAbove s → sSup s ∈ S +@[expose] def sSupClosed (S : Set α) := ∀ s ⊆ S, s.Nonempty → BddAbove s → sSup s ∈ S lemma sInfClosed_top : sInfClosed (⊤ : Set α) := by simp [sInfClosed] lemma sInfClosed_Ici (x : α) : sInfClosed (Ici x) := fun _ hsub hne _ => le_csInf hne hsub diff --git a/LeanPool/SetTheory/Ordinals.lean b/LeanPool/SetTheory/Ordinals.lean index d7a4f20d2f..9720b072e5 100644 --- a/LeanPool/SetTheory/Ordinals.lean +++ b/LeanPool/SetTheory/Ordinals.lean @@ -17,7 +17,7 @@ This module develops the theory of ordinals inside a von Neumann model of ZF, in their order structure and the correspondence with Mathlib's `Ordinal` type. -/ -@[expose] public section +public section noncomputable section @@ -28,11 +28,11 @@ variable {M} [ZFStructure M] [hM : IsVonNeumann M] namespace SetTheory /-- The `IsOrdinal` declaration. -/ -@[realize] def IsOrdinal (x : M) := IsTransitive x ∧ ∀ y ∈ x, IsTransitive y +@[expose, realize] def IsOrdinal (x : M) := IsTransitive x ∧ ∀ y ∈ x, IsTransitive y /-- The `IsStrongLimit` declaration. -/ -@[realize] def IsStrongLimit (κ : M) := IsOrdinal κ ∧ ∀ α ∈ κ, cardLT (𝓟 α) κ +@[expose, realize] def IsStrongLimit (κ : M) := IsOrdinal κ ∧ ∀ α ∈ κ, cardLT (𝓟 α) κ /-- The `IsOrdinalValuedFunc` declaration. -/ -@[realize] def IsOrdinalValuedFunc (f : M) := IsFunc f ∧ ∀ x ∈ Ran f, IsOrdinal x +@[expose, realize] def IsOrdinalValuedFunc (f : M) := IsFunc f ∧ ∀ x ∈ Ran f, IsOrdinal x @[toV_simps] lemma IsOrdinal.toV (α : M) : IsOrdinal ↓α ↔ IsOrdinal α := by simp only [IsOrdinal, toV_simps] @@ -119,7 +119,7 @@ def rankFunc (x : M) : ((trcl {x}) : M) → (succ (rank x) : M) := by rwa [rank_trcl, rank_singleton] at hy /-- The `IsRankFunction` declaration. -/ -@[realize] def IsRankFunction (x : M) (f : M) := +@[expose, realize] def IsRankFunction (x : M) (f : M) := IsOrdinalValuedFunc f ∧ IsTransitive (Dom f) ∧ x ∈ Dom f ∧ PreserveMem f lemma isRankFunction_rankFunc {x : M} : IsRankFunction x (funcToSet (rankFunc x)) := by @@ -233,7 +233,7 @@ def toOrdinal : Ordinals M ↪o Ordinal.{0} where variable (M) in /-- The `maxOrdinal` declaration. -/ -def maxOrdinal : WithTop Ordinal.{0} := by +@[expose] def maxOrdinal : WithTop Ordinal.{0} := by split_vonNeumann hM · exact .some μ · exact ⊤ diff --git a/LeanPool/SetTheory/RealizeBuilders.lean b/LeanPool/SetTheory/RealizeBuilders.lean index 1bab94414b..fde6e59464 100644 --- a/LeanPool/SetTheory/RealizeBuilders.lean +++ b/LeanPool/SetTheory/RealizeBuilders.lean @@ -20,7 +20,7 @@ Build the formula, realization, and elementarity declarations registered by `@[r The expression representation and its correctness lemmas live in `RealizeCore`. -/ -@[expose] public section +public section open Lean Parser Elab Term Meta Qq Std FirstOrder.Language diff --git a/LeanPool/SetTheory/RealizeCore.lean b/LeanPool/SetTheory/RealizeCore.lean index a0b9c26eae..5ae025e461 100644 --- a/LeanPool/SetTheory/RealizeCore.lean +++ b/LeanPool/SetTheory/RealizeCore.lean @@ -18,7 +18,7 @@ membership relation, together with notation and metaprogramming infrastructure f building and realizing bounded formulas in models of ZF. -/ -@[expose] public section +public section open Lean Parser Elab Term Meta Qq Std FirstOrder.Language @@ -29,7 +29,7 @@ inductive memRel : ℕ → Type open FirstOrder in /-- The first-order language of ZF set theory, with a single binary membership relation. -/ -def 𝓛ZF : FirstOrder.Language := ⟨fun _ => Empty, memRel⟩ +@[expose] def 𝓛ZF : FirstOrder.Language := ⟨fun _ => Empty, memRel⟩ deriving IsRelational attribute [local implicit_reducible] 𝓛ZF @@ -390,7 +390,7 @@ namespace VariableParams variable (ps : VariableParams) /-- The `numFreeVariables` declaration. -/ -def numFreeVariables : Nat := ps.countP (·.isFreeVariable) +@[expose] def numFreeVariables : Nat := ps.countP (·.isFreeVariable) /-- The `numHypotheses` declaration. -/ def numHypotheses : Nat := ps.countP (·.isHypothesis) @@ -431,7 +431,7 @@ abbrev BuildFormulaM := StateT BuildFormulaState MetaM namespace BuildFormula /-- The `removeNameSuffix` declaration. -/ -def removeNameSuffix (name : Name) : Name := +@[expose] def removeNameSuffix (name : Name) : Name := match name with | .anonymous => .anonymous | _ => @@ -751,7 +751,7 @@ def buildFormula (formulaName : Name) : BuildFormulaM Unit := do applyAttributes formulaName #[{name := `irreducible}] |>.run' /-- The `prefixIdents` declaration. -/ -def prefixIdents (typeLetter := "M") : Array Ident := +@[expose] def prefixIdents (typeLetter := "M") : Array Ident := #[mkIdent typeLetter.toName, mkIdent ("s" ++ typeLetter).toName] /-- The prefix identifiers are exactly the carrier type and its structure instance. -/ diff --git a/LeanPool/SetTheory/SimpAttr.lean b/LeanPool/SetTheory/SimpAttr.lean index 6d1953a1d1..979680cc45 100644 --- a/LeanPool/SetTheory/SimpAttr.lean +++ b/LeanPool/SetTheory/SimpAttr.lean @@ -16,7 +16,7 @@ This module registers the custom `simp` attributes used to drive the formula-rea and elementary-embedding automation in the rest of the development. -/ -@[expose] public section +public section /-- Simp set for unfolding `Formula.Realize` of the generated ZF formulas. -/ register_simp_attr realize_simps diff --git a/LeanPool/Shannon1948Formalization.lean b/LeanPool/Shannon1948Formalization.lean index 0273a6e618..d7d629ea76 100644 --- a/LeanPool/Shannon1948Formalization.lean +++ b/LeanPool/Shannon1948Formalization.lean @@ -21,7 +21,7 @@ Tags: information-theory, entropy, probability MSC: 94A17, 60C05 -/ -@[expose] public section +public section /-! # Shannon diff --git a/LeanPool/Shannon1948Formalization/Entropy.lean b/LeanPool/Shannon1948Formalization/Entropy.lean index dd8cb6e1bd..a0b4b7ce7b 100644 --- a/LeanPool/Shannon1948Formalization/Entropy.lean +++ b/LeanPool/Shannon1948Formalization/Entropy.lean @@ -26,4 +26,4 @@ Import this file to access the full development: ↘ Converse -/ -@[expose] public section +public section diff --git a/LeanPool/Shannon1948Formalization/Entropy/Approx.lean b/LeanPool/Shannon1948Formalization/Entropy/Approx.lean index 288fce8edf..ecd0a8ecf8 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Approx.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Approx.lean @@ -23,7 +23,7 @@ their convergence to `p`. This is the bridge from the rational formula to the full real-probability formula. -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section diff --git a/LeanPool/Shannon1948Formalization/Entropy/Converse.lean b/LeanPool/Shannon1948Formalization/Entropy/Converse.lean index 958c444e10..8859815c58 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Converse.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Converse.lean @@ -26,7 +26,7 @@ positive multiple of `entropyNat`. - `entropyNat_shannonAxioms`: `ShannonEntropyAxioms entropyNat` -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section diff --git a/LeanPool/Shannon1948Formalization/Entropy/Core.lean b/LeanPool/Shannon1948Formalization/Entropy/Core.lean index 2fcfeb8aa1..5e3f094530 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Core.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Core.lean @@ -33,7 +33,7 @@ Global roadmap (matching Shannon Appendix 2): continuity upgrades the rational formula to all real probabilities. -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section @@ -41,7 +41,7 @@ open Filter open scoped Topology /-- `p` has nonnegative masses that sum to one. -/ -def IsProbDist {α : Type} [Fintype α] (p : α → ℝ) : Prop := +@[expose] def IsProbDist {α : Type} [Fintype α] (p : α → ℝ) : Prop := (∀ a, 0 ≤ p a) ∧ (∑ a, p a) = 1 /-- @@ -63,7 +63,7 @@ lemma prob_le_one {α : Type} [Fintype α] (p : ProbDist α) (a : α) : p a ≤ (prob_sum_eq_one p) ▸ Finset.single_le_sum (fun b _ => prob_nonneg p b) (Finset.mem_univ a) /-- Uniform distribution on `Fin (n + 1)`. -/ -def uniformFin (n : ℕ) : ProbDist (Fin (n + 1)) := +@[expose] def uniformFin (n : ℕ) : ProbDist (Fin (n + 1)) := ⟨fun _ => 1 / (n + 1 : ℝ), fun _ => by positivity, by simp [Finset.card_univ, show (n + 1 : ℝ) ≠ 0 by exact_mod_cast Nat.succ_ne_zero n]⟩ @@ -71,12 +71,12 @@ def uniformFin (n : ℕ) : ProbDist (Fin (n + 1)) := Uniform distribution on `Fin n` for positive natural `n : ℕ+`. This avoids `n + 1` index gymnastics when formalizing Appendix 2. -/ -def uniformPNat (n : ℕ+) : ProbDist (Fin n) := +@[expose] def uniformPNat (n : ℕ+) : ProbDist (Fin n) := ⟨fun _ => 1 / (n : ℝ), fun _ => by positivity, by simp [Finset.card_univ, show (n : ℝ) ≠ 0 by exact_mod_cast Nat.ne_of_gt n.2]⟩ /-- Composite distribution for a two-stage random choice. -/ -def composeProb +@[expose] def composeProb {α : Type} [Fintype α] {β : α → Type} [∀ a, Fintype (β a)] (p : ProbDist α) @@ -88,7 +88,7 @@ def composeProb prob_sum_eq_one p]⟩ /-- Equivalence between two-stage finite outcomes and `Fin (n * m)`. -/ -def sigmaConstFinEquivFinMul (n m : ℕ+) : +@[expose] def sigmaConstFinEquivFinMul (n m : ℕ+) : Sigma (fun _ : Fin n => Fin m) ≃ Fin (n * m : ℕ+) := (Equiv.sigmaEquivProdOfEquiv (fun _ : Fin n => (Equiv.refl (Fin m)))).trans finProdFinEquiv @@ -97,7 +97,7 @@ def sigmaConstFinEquivFinMul (n m : ℕ+) : Relabel a distribution along an equivalence of finite types. This is the formal "event names do not matter" transport map. -/ -def relabelProb +@[expose] def relabelProb {α β : Type} [Fintype α] [Fintype β] (e : α ≃ β) (p : ProbDist α) : @@ -138,7 +138,7 @@ structure ShannonEntropyAxioms `A_H(n)` is Shannon's notation for uncertainty on the uniform distribution with `n + 1` equiprobable outcomes. -/ -def A +@[expose] def A (H : {α : Type} → [Fintype α] → ProbDist α → ℝ) (n : ℕ) : ℝ := H (uniformFin n) @@ -146,7 +146,7 @@ def A /-- `Apos H n` is uncertainty for exactly `n` equiprobable outcomes (`n : ℕ+`). -/ -def Apos +@[expose] def Apos (H : {α : Type} → [Fintype α] → ProbDist α → ℝ) (n : ℕ+) : ℝ := H (uniformPNat n) diff --git a/LeanPool/Shannon1948Formalization/Entropy/Final.lean b/LeanPool/Shannon1948Formalization/Entropy/Final.lean index aefc356b4b..41993b5aa3 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Final.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Final.lean @@ -23,7 +23,7 @@ Combines the rational characterization and continuity extension to prove: - base-parametric uniqueness (`entropyBase_unique`). -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section diff --git a/LeanPool/Shannon1948Formalization/Entropy/Gibbs.lean b/LeanPool/Shannon1948Formalization/Entropy/Gibbs.lean index 2f66a8416a..f67360ef2b 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Gibbs.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Gibbs.lean @@ -31,7 +31,7 @@ Mathlib's concavity infrastructure for later proofs. - `entropyNat_le_log_card`: `H(p) ≤ log |α|` -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section diff --git a/LeanPool/Shannon1948Formalization/Entropy/Joint.lean b/LeanPool/Shannon1948Formalization/Entropy/Joint.lean index 7e78528d34..a938f43b94 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Joint.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Joint.lean @@ -36,7 +36,7 @@ the infrastructure for multi-variable entropy identities. - `marginalFst_prodDist`, `marginalSnd_prodDist`: marginals of product distributions -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section @@ -45,21 +45,21 @@ open Finset Real /-! ## Marginals and product distributions -/ /-- First marginal: `(marginalFst p)(a) = ∑_b p(a, b)`. -/ -def marginalFst {α β : Type} [Fintype α] [Fintype β] +@[expose] def marginalFst {α β : Type} [Fintype α] [Fintype β] (p : ProbDist (α × β)) : ProbDist α := ⟨fun a => ∑ b, p (a, b), fun a => Finset.sum_nonneg fun b _ => prob_nonneg p (a, b), by simp_rw [← Fintype.sum_prod_type, prob_sum_eq_one p]⟩ /-- Second marginal: `(marginalSnd p)(b) = ∑_a p(a, b)`. -/ -def marginalSnd {α β : Type} [Fintype α] [Fintype β] +@[expose] def marginalSnd {α β : Type} [Fintype α] [Fintype β] (p : ProbDist (α × β)) : ProbDist β := ⟨fun b => ∑ a, p (a, b), fun b => Finset.sum_nonneg fun a _ => prob_nonneg p (a, b), by simp_rw [← Fintype.sum_prod_type_right, prob_sum_eq_one p]⟩ /-- Product distribution: `(prodDist p q)(a, b) = p(a) * q(b)`. -/ -def prodDist {α β : Type} [Fintype α] [Fintype β] +@[expose] def prodDist {α β : Type} [Fintype α] [Fintype β] (p : ProbDist α) (q : ProbDist β) : ProbDist (α × β) := ⟨fun ab => p ab.1 * q ab.2, fun ab => mul_nonneg (prob_nonneg p ab.1) (prob_nonneg q ab.2), @@ -78,7 +78,7 @@ def IsIndependent {α β : Type} [Fintype α] [Fintype β] This measures the average remaining uncertainty in `Y` once `X` is known. The formula uses Lean's `0 / 0 = 0` and `log 0 = 0` conventions: when `p_X(x) = 0` we also have `p(x,y) = 0`, so the term vanishes. -/ -def condEntropy {α β : Type} [Fintype α] [Fintype β] +@[expose] def condEntropy {α β : Type} [Fintype α] [Fintype β] (p : ProbDist (α × β)) : ℝ := -∑ ab : α × β, p ab * Real.log (p ab / marginalFst p ab.1) diff --git a/LeanPool/Shannon1948Formalization/Entropy/Properties.lean b/LeanPool/Shannon1948Formalization/Entropy/Properties.lean index a9584f3608..9a7a5e0133 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Properties.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Properties.lean @@ -26,7 +26,7 @@ Gibbs inequality and concavity of `negMulLog`. 6. `condEntropy_nonneg` — conditional entropy is nonnegative -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section diff --git a/LeanPool/Shannon1948Formalization/Entropy/Rational.lean b/LeanPool/Shannon1948Formalization/Entropy/Rational.lean index da373c139c..f43c4955d2 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Rational.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Rational.lean @@ -23,7 +23,7 @@ It also includes a worked decomposition corresponding to Shannon's `(1/2, 1/3, 1/6)` narrative. -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization @@ -152,7 +152,7 @@ def workedP : ProbDist Bool := /-- Second-stage alphabets for the worked decomposition: `true` has one outcome; `false` has two outcomes. -/ -def workedFib : Bool → Type +@[expose] def workedFib : Bool → Type | true => Fin 1 | false => Fin 2 @@ -161,7 +161,7 @@ instance : ∀ b : Bool, Fintype (workedFib b) | false => by simpa [workedFib] using (inferInstance : Fintype (Fin 2)) /-- Second-stage conditional probabilities for the worked decomposition. -/ -def workedQ : (b : Bool) → ProbDist (workedFib b) +@[expose] def workedQ : (b : Bool) → ProbDist (workedFib b) | true => by change ProbDist (Fin 1) exact (uniformPNat ⟨1, by norm_num⟩ : ProbDist (Fin 1)) diff --git a/LeanPool/Shannon1948Formalization/Entropy/Uniform.lean b/LeanPool/Shannon1948Formalization/Entropy/Uniform.lean index cf8ee30fe3..34e95194fd 100644 --- a/LeanPool/Shannon1948Formalization/Entropy/Uniform.lean +++ b/LeanPool/Shannon1948Formalization/Entropy/Uniform.lean @@ -22,7 +22,7 @@ Main outputs: - positivity of the scale factor `K`. -/ -@[expose] public section +public section namespace LeanPool.Shannon1948Formalization noncomputable section @@ -288,7 +288,7 @@ lemma Apos_monotone hH.uniformMonotone.monotone /-- Entropy-form expression with natural logarithm. -/ -def entropyNat +@[expose] def entropyNat {α : Type} [Fintype α] (p : ProbDist α) : ℝ := -∑ a, p a * Real.log (p a) diff --git a/LeanPool/SingularModuli.lean b/LeanPool/SingularModuli.lean index 62d8bd7890..fcae9e01c2 100644 --- a/LeanPool/SingularModuli.lean +++ b/LeanPool/SingularModuli.lean @@ -28,4 +28,4 @@ Tags: algebraic-number-theory, quadratic-orders, legendre-symbol MSC: 11R11, 11R29, 11A15 -/ -@[expose] public section +public section diff --git a/LeanPool/SingularModuli/QuadraticOrder/Basic.lean b/LeanPool/SingularModuli/QuadraticOrder/Basic.lean index 79e44790de..c12accf046 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Basic.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Basic.lean @@ -35,12 +35,12 @@ introduced only where it is actually needed (see `Discriminant.lean`). For no longer matches the order of discriminant `d`. -/ -@[expose] public section +public section open scoped Polynomial /-- The defining polynomial of `QuadraticOrder d`. -/ -noncomputable def poly (d : ℤ) : ℤ[X] := +@[expose] noncomputable def poly (d : ℤ) : ℤ[X] := Polynomial.X ^ 2 - Polynomial.C d * Polynomial.X + Polynomial.C ((d ^ 2 - d) / 4) /-- @@ -119,6 +119,8 @@ lemma tau_minimal_poly : noncomputable def basis : PowerBasis ℤ (QuadraticOrder d) := AdjoinRoot.powerBasis' (poly_monic d) +lemma basis_gen_eq_tau : (basis (d := d)).gen = tau := by rfl + /-- `QuadraticOrder d` is a free `ℤ`-module (of rank 2). -/ instance : Module.Free ℤ (QuadraticOrder d) := (poly_monic d).free_adjoinRoot diff --git a/LeanPool/SingularModuli/QuadraticOrder/CanonicalForm.lean b/LeanPool/SingularModuli/QuadraticOrder/CanonicalForm.lean index 683aae804d..79b95787c9 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/CanonicalForm.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/CanonicalForm.lean @@ -41,7 +41,7 @@ canonical forms) is developed in subsequent PRs on top of this scaffolding. -/ -@[expose] public section +public section namespace QuadraticOrder @@ -216,7 +216,7 @@ private lemma zSpan_smul_mem have hi2 : i.val < 2 := by rw [← basis_dim]; exact i.isLt interval_cases h : i.val · simp only [h, pow_zero]; exact hM_one - · simp only [h, pow_one]; exact hM_tau + · simp only [h, pow_one, basis_gen_eq_tau]; exact hM_tau -- Hence `c ∈ M` via `Basis.sum_repr`. suffices c ∈ M by exact this x hx have hsum := (basis (d := d)).basis.sum_repr c diff --git a/LeanPool/SingularModuli/QuadraticOrder/Discriminant.lean b/LeanPool/SingularModuli/QuadraticOrder/Discriminant.lean index 43ff14de08..54245cf5d7 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Discriminant.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Discriminant.lean @@ -28,7 +28,7 @@ exactly under the congruence hypothesis. The general form `tau_sub_tauConj_sq` is a Lean-only artifact with no thesis counterpart. -/ -@[expose] public section +public section namespace QuadraticOrder diff --git a/LeanPool/SingularModuli/QuadraticOrder/Norm.lean b/LeanPool/SingularModuli/QuadraticOrder/Norm.lean index 8fb321f12c..c47c866a8b 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Norm.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Norm.lean @@ -30,7 +30,7 @@ agrees with the thesis; the route via `tauConj` is a Lean-idiomatic reformulation. -/ -@[expose] public section +public section namespace QuadraticOrder @@ -67,7 +67,7 @@ Vieta relations, and exhibits `normForm` as a multiplicative norm via the factorisation `(a + b·τ)(a + b·tauConj) = N(a, b)`. -/ /-- The Galois conjugate of `tau`: the other root of `poly d`. -/ -noncomputable def tauConj : QuadraticOrder d := d • (1 : QuadraticOrder d) - tau +@[expose] noncomputable def tauConj : QuadraticOrder d := d • (1 : QuadraticOrder d) - tau /-- Vieta: the sum of the roots of `poly d` equals `d`. -/ lemma tau_add_tauConj : tau + tauConj = d • (1 : QuadraticOrder d) := by diff --git a/LeanPool/SingularModuli/QuadraticOrder/Prime.lean b/LeanPool/SingularModuli/QuadraticOrder/Prime.lean index e90af62927..5f73365fc6 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Prime.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Prime.lean @@ -34,4 +34,4 @@ whole trichotomy is routed through one ring isomorphism rather than the thesis's explicit index computations. -/ -@[expose] public section +public section diff --git a/LeanPool/SingularModuli/QuadraticOrder/Prime/Inert.lean b/LeanPool/SingularModuli/QuadraticOrder/Prime/Inert.lean index a23049f1ec..eaff588731 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Prime/Inert.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Prime/Inert.lean @@ -25,7 +25,7 @@ remains prime in `O_d` exactly when the Legendre symbol `(d/p) = -1`. rather than via the thesis's direct index computation in `ℤ/pᵏ[x]/g(x)`. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/SingularModuli/QuadraticOrder/Prime/PolyMod.lean b/LeanPool/SingularModuli/QuadraticOrder/Prime/PolyMod.lean index bd21e8923c..8debe4a705 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Prime/PolyMod.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Prime/PolyMod.lean @@ -39,7 +39,7 @@ iso), `Inert.lean`, `Split.lean`, and `Ramified.lean`. `Prime/` directory; the other `Prime/*` files import this one and inherit it. -/ -@[expose] public section +public section open Polynomial @@ -49,7 +49,7 @@ variable (d : ℤ) (p : ℕ) /-- Reduction of the defining polynomial `poly d` modulo `p`, as a polynomial in `(ZMod p)[X]`. -/ -noncomputable def polyMod : (ZMod p)[X] := +@[expose] noncomputable def polyMod : (ZMod p)[X] := (poly d).map (Int.castRingHom (ZMod p)) /-- Explicit form: `polyMod d p = X² - d·X + ((d² - d)/4)` over `ZMod p`. -/ diff --git a/LeanPool/SingularModuli/QuadraticOrder/Prime/QuotientIso.lean b/LeanPool/SingularModuli/QuadraticOrder/Prime/QuotientIso.lean index d899451845..3a4fdab6ec 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Prime/QuotientIso.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Prime/QuotientIso.lean @@ -32,7 +32,7 @@ field/PID structure of `𝔽ₚ[X]` does the work. The downstream files Lean-idiomatic route; the mathematical content matches Prop 3.2.1. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/SingularModuli/QuadraticOrder/Prime/Ramified.lean b/LeanPool/SingularModuli/QuadraticOrder/Prime/Ramified.lean index 0b35ff3357..39b373e3cc 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Prime/Ramified.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Prime/Ramified.lean @@ -34,7 +34,7 @@ reverse direction reduces to *squarefreeness of `polyMod d p`* and transports thesis's hand computation. Mathematically the same as Prop 3.2.1. -/ -@[expose] public section +public section open Polynomial diff --git a/LeanPool/SingularModuli/QuadraticOrder/Prime/Split.lean b/LeanPool/SingularModuli/QuadraticOrder/Prime/Split.lean index 0219927741..8e1ea578d1 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Prime/Split.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Prime/Split.lean @@ -32,7 +32,7 @@ of the quotient `O/(p) ≅ 𝔽ₚ × 𝔽ₚ` is the Lean-idiomatic restatement thesis's "p factors as two distinct primes". -/ -@[expose] public section +public section namespace QuadraticOrder diff --git a/LeanPool/SingularModuli/QuadraticOrder/RootCounting.lean b/LeanPool/SingularModuli/QuadraticOrder/RootCounting.lean index 60253b29a7..ca53d115ef 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/RootCounting.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/RootCounting.lean @@ -16,7 +16,7 @@ This file counts solutions to `x² ≡ c (mod p^n)` for prime powers `p^n`. These are the "analytic inputs" for the ideal-counting theorems (Layer 4). -/ -@[expose] public section +public section namespace QuadraticOrder diff --git a/LeanPool/SingularModuli/QuadraticOrder/Verification.lean b/LeanPool/SingularModuli/QuadraticOrder/Verification.lean index 94087a44c3..3cc3ddf221 100644 --- a/LeanPool/SingularModuli/QuadraticOrder/Verification.lean +++ b/LeanPool/SingularModuli/QuadraticOrder/Verification.lean @@ -20,7 +20,7 @@ This file records a small sanity check for the defining minimal polynomial of `tau`. -/ -@[expose] public section +public section /-- Sanity check: `τ` satisfies its minimal polynomial `X² - dX + (d²-d)/4 = 0`. -/ example (d : ℤ) : (QuadraticOrder.tau (d := d)) ^ 2 - d • QuadraticOrder.tau + diff --git a/LeanPool/SpectralPositivity.lean b/LeanPool/SpectralPositivity.lean index 6674c37c9c..3f92e75c28 100644 --- a/LeanPool/SpectralPositivity.lean +++ b/LeanPool/SpectralPositivity.lean @@ -28,4 +28,4 @@ Tags: linear-algebra, perron-frobenius, positivity MSC: 15B48, 15A18 -/ -@[expose] public section +public section diff --git a/LeanPool/SpectralPositivity/Matrix/MMatrixInverse.lean b/LeanPool/SpectralPositivity/Matrix/MMatrixInverse.lean index cf690a9237..a732ca7bf3 100644 --- a/LeanPool/SpectralPositivity/Matrix/MMatrixInverse.lean +++ b/LeanPool/SpectralPositivity/Matrix/MMatrixInverse.lean @@ -51,7 +51,7 @@ This file provides both forms: * `graphops-qft` consumes the strict version for resolvent positivity. -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/SpectralPositivity/Matrix/MetzlerExp.lean b/LeanPool/SpectralPositivity/Matrix/MetzlerExp.lean index 6eeb4a976a..15d91da7d2 100644 --- a/LeanPool/SpectralPositivity/Matrix/MetzlerExp.lean +++ b/LeanPool/SpectralPositivity/Matrix/MetzlerExp.lean @@ -30,7 +30,7 @@ of partial sums to the matrix exponential. - Horn–Johnson, *Matrix Analysis*, Cambridge, 2013, Thm 8.5.5 -/ -@[expose] public section +public section open Matrix BigOperators Finset diff --git a/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean b/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean index 3b0ee000a9..99e1134c2b 100644 --- a/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean +++ b/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean @@ -32,7 +32,7 @@ blocks for the Metzler matrix exponential theorem (in MetzlerExp.lean). - Berman and Plemmons, *Nonnegative Matrices*, SIAM, 1994 -/ -@[expose] public section +public section open Matrix BigOperators Finset @@ -41,10 +41,12 @@ noncomputable section variable {n : Type*} [Fintype n] [DecidableEq n] /-- A matrix has nonneg off-diagonal entries (Metzler condition). -/ +@[expose] def Matrix.NonnegOffDiag (L : Matrix n n ℝ) : Prop := ∀ i j, i ≠ j → 0 ≤ L i j /-- A matrix has all nonneg entries. -/ +@[expose] def Matrix.Nonneg (M : Matrix n n ℝ) : Prop := ∀ i j, 0 ≤ M i j diff --git a/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean b/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean index 4fd8cb71ad..8ee55df7ff 100644 --- a/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean +++ b/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean @@ -34,7 +34,7 @@ For B = A^k with all entries strictly positive (from `exists_pos_power`): - Seneta, *Non-negative Matrices and Markov Chains*, Springer, 2006 -/ -@[expose] public section +public section open Matrix BigOperators Finset MeasureTheory @@ -54,6 +54,7 @@ periodic irreducible matrices (e.g., the permutation matrix of a 2-cycle of A^k strictly positive. This definition therefore characterizes *primitive* nonneg matrices. -/ +@[expose] def Matrix.IsIrreducible (A : Matrix n n ℝ) : Prop := A.Nonneg ∧ (∀ i j : n, ∃ k : ℕ, 0 < k ∧ 0 < (A ^ k) i j) ∧ (∃ i : n, 0 < A i i) diff --git a/LeanPool/SpectralPositivity/Operator/Jentzsch.lean b/LeanPool/SpectralPositivity/Operator/Jentzsch.lean index 5ff722473a..b67c754504 100644 --- a/LeanPool/SpectralPositivity/Operator/Jentzsch.lean +++ b/LeanPool/SpectralPositivity/Operator/Jentzsch.lean @@ -35,4 +35,4 @@ generalized from L²(ℝⁿ) to L²(Ω, volume) for any MeasureSpace Ω. - Reed-Simon IV, Theorems XIII.43–44 -/ -@[expose] public section +public section diff --git a/LeanPool/SpectralPositivity/Operator/JentzschProof.lean b/LeanPool/SpectralPositivity/Operator/JentzschProof.lean index bc41863587..bf93835872 100644 --- a/LeanPool/SpectralPositivity/Operator/JentzschProof.lean +++ b/LeanPool/SpectralPositivity/Operator/JentzschProof.lean @@ -36,7 +36,7 @@ structure (absolute value, positive/negative parts). - Courant-Hilbert, *Methods of Mathematical Physics*, Ch. VI -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/SpectralPositivity/Operator/KernelPositivity.lean b/LeanPool/SpectralPositivity/Operator/KernelPositivity.lean index 8a518e496c..d9338a9374 100644 --- a/LeanPool/SpectralPositivity/Operator/KernelPositivity.lean +++ b/LeanPool/SpectralPositivity/Operator/KernelPositivity.lean @@ -35,7 +35,7 @@ This forces K > 0 a.e. on A × B for all such A, B. - Simon, *Functional Integration and Quantum Physics*, Prop. I.12 -/ -@[expose] public section +public section open MeasureTheory Measure Filter diff --git a/LeanPool/SpectralPositivity/Operator/SpectralRadius.lean b/LeanPool/SpectralPositivity/Operator/SpectralRadius.lean index 10355d0044..164380224a 100644 --- a/LeanPool/SpectralPositivity/Operator/SpectralRadius.lean +++ b/LeanPool/SpectralPositivity/Operator/SpectralRadius.lean @@ -44,7 +44,7 @@ spectral radius. - Simon, *Trace Ideals*, Ch. 2 -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/SpectralTheory/Spectral/Cayley/Basic.lean b/LeanPool/SpectralTheory/Spectral/Cayley/Basic.lean index 8452964227..6649f5050a 100644 --- a/LeanPool/SpectralTheory/Spectral/Cayley/Basic.lean +++ b/LeanPool/SpectralTheory/Spectral/Cayley/Basic.lean @@ -17,7 +17,7 @@ can therefore be composed with `A - iI`, and the resulting everywhere-defined li isometry, hence continuous. -/ -@[expose] public section +public section open scoped LinearPMap diff --git a/LeanPool/SpectralTheory/Spectral/Cayley/Inverse.lean b/LeanPool/SpectralTheory/Spectral/Cayley/Inverse.lean index e59ba01979..1003967c2c 100644 --- a/LeanPool/SpectralTheory/Spectral/Cayley/Inverse.lean +++ b/LeanPool/SpectralTheory/Spectral/Cayley/Inverse.lean @@ -16,7 +16,7 @@ surjective onto `1 - U`'s complement, giving the inverse construction used to recover the self-adjoint operator from its unitary Cayley transform. -/ -@[expose] public section +public section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] diff --git a/LeanPool/SpectralTheory/Spectral/Cayley/Unitary.lean b/LeanPool/SpectralTheory/Spectral/Cayley/Unitary.lean index 65c0967dc2..c63a5a5bfd 100644 --- a/LeanPool/SpectralTheory/Spectral/Cayley/Unitary.lean +++ b/LeanPool/SpectralTheory/Spectral/Cayley/Unitary.lean @@ -16,7 +16,7 @@ surjective, and combines this with its isometry (from `Spectral.Cayley.Basic`) to show it is unitary. -/ -@[expose] public section +public section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] diff --git a/LeanPool/SpectralTheory/Spectral/PVM/Basic.lean b/LeanPool/SpectralTheory/Spectral/PVM/Basic.lean index 7b631b1fe5..dca0563d19 100644 --- a/LeanPool/SpectralTheory/Spectral/PVM/Basic.lean +++ b/LeanPool/SpectralTheory/Spectral/PVM/Basic.lean @@ -16,7 +16,7 @@ This file defines real projection-valued measures through strong-operator counta and proves monotonicity of their associated scalar quadratic forms. -/ -@[expose] public section +public section open Function diff --git a/LeanPool/SpectralTheory/Spectral/PVM/Integral.lean b/LeanPool/SpectralTheory/Spectral/PVM/Integral.lean index 36f76e0013..2da633491f 100644 --- a/LeanPool/SpectralTheory/Spectral/PVM/Integral.lean +++ b/LeanPool/SpectralTheory/Spectral/PVM/Integral.lean @@ -19,7 +19,7 @@ This file constructs the spectral integral first for complex-valued simple funct bounded measurable functions. -/ -@[expose] public section +public section open MeasureTheory @@ -27,7 +27,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] /-- The spectral sum of a complex-valued simple function against a PVM. -/ -noncomputable def PVM.simpleIntegral (E_pvm : PVM E) +@[expose] noncomputable def PVM.simpleIntegral (E_pvm : PVM E) (f : SimpleFunc ℝ ℂ) : E →L[ℂ] E := ∑ z ∈ f.range, z • E_pvm.proj (f ⁻¹' {z}) @@ -526,7 +526,7 @@ theorem PVM.simpleIntegral_piecewise_const (E_pvm : PVM E) rw [hpre, zero_smul, add_zero] /-- The bounded spectral integral of a measurable, uniformly bounded complex function. -/ -noncomputable def PVM.integral (E_pvm : PVM E) +@[expose] noncomputable def PVM.integral (E_pvm : PVM E) (f : ℝ → ℂ) (hf : Measurable f) (hbdd : ∃ C, ∀ t, ‖f t‖ ≤ C) : E →L[ℂ] E := Filter.limUnder Filter.atTop (fun n => E_pvm.simpleIntegral diff --git a/LeanPool/SpectralTheory/Spectral/PVM/Unbounded.lean b/LeanPool/SpectralTheory/Spectral/PVM/Unbounded.lean index 9e46244318..c53725a1f7 100644 --- a/LeanPool/SpectralTheory/Spectral/PVM/Unbounded.lean +++ b/LeanPool/SpectralTheory/Spectral/PVM/Unbounded.lean @@ -26,7 +26,7 @@ functions by a monotone-limit construction, giving the partial operator `E_pvm.unboundedIntegral f hf` for a PVM `E_pvm` and measurable `f`. -/ -@[expose] public section +public section open MeasureTheory open Function @@ -35,7 +35,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] /-- The nonnegative scalar set function induced by a PVM and a vector. -/ -def PVM.scalarContent (E_pvm : PVM E) (x : E) (S : Set ℝ) : ℝ := +@[expose] def PVM.scalarContent (E_pvm : PVM E) (x : E) (S : Set ℝ) : ℝ := (@inner ℂ E _ (E_pvm.proj S x) x).re /-- Scalar PVM content is nonnegative for measurable sets. -/ diff --git a/LeanPool/SpectralTheory/Spectral/Spectral/CayleyCalculus.lean b/LeanPool/SpectralTheory/Spectral/Spectral/CayleyCalculus.lean index f869970a5f..732049d4f8 100644 --- a/LeanPool/SpectralTheory/Spectral/Spectral/CayleyCalculus.lean +++ b/LeanPool/SpectralTheory/Spectral/Spectral/CayleyCalculus.lean @@ -17,7 +17,7 @@ result turns a PVM representation of the scalar Cayley phase into containment of self-adjoint operator, after which self-adjoint maximality upgrades containment to equality. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/SpectralTheory/Spectral/Spectral/Existence.lean b/LeanPool/SpectralTheory/Spectral/Spectral/Existence.lean index 9a43b52687..d7c4f4feae 100644 --- a/LeanPool/SpectralTheory/Spectral/Spectral/Existence.lean +++ b/LeanPool/SpectralTheory/Spectral/Spectral/Existence.lean @@ -28,7 +28,7 @@ inverse Cayley coordinate, and proves that its unbounded coordinate integral is self-adjoint operator. -/ -@[expose] public section +public section open MeasureTheory open CompactlySupported diff --git a/LeanPool/SpectralTheory/Spectral/Spectral/FuncCalc.lean b/LeanPool/SpectralTheory/Spectral/Spectral/FuncCalc.lean index edab23767a..c51b864535 100644 --- a/LeanPool/SpectralTheory/Spectral/Spectral/FuncCalc.lean +++ b/LeanPool/SpectralTheory/Spectral/Spectral/FuncCalc.lean @@ -18,13 +18,13 @@ a measurable function `f`, and shows it recovers `A` on the coordinate function. -/ -@[expose] public section +public section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] /-- The measurable spectral functional calculus obtained from a spectral PVM representing `A`. -/ -noncomputable def spectralFuncCalc +@[expose] noncomputable def spectralFuncCalc (A : E →ₗ.[ℂ] E) (hA : IsSelfAdjoint A) (f : ℝ → ℂ) (hf : Measurable f) : E →ₗ.[ℂ] E := (Classical.choose (spectral_theorem_existence A hA)).unboundedIntegral f hf diff --git a/LeanPool/SpectralTheory/Spectral/Spectral/Intrinsic.lean b/LeanPool/SpectralTheory/Spectral/Spectral/Intrinsic.lean index 4df286d34c..63c8b6cb88 100644 --- a/LeanPool/SpectralTheory/Spectral/Spectral/Intrinsic.lean +++ b/LeanPool/SpectralTheory/Spectral/Spectral/Intrinsic.lean @@ -18,7 +18,7 @@ operator domain is exactly the finite-second-moment space, and the operator's diagonal matrix coefficient is the first moment. -/ -@[expose] public section +public section open MeasureTheory @@ -27,7 +27,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] /-- A PVM intrinsically represents a partial linear operator when its scalar spectral measures give the exact domain and first-moment quadratic form. -/ -def PVM.Represents (E_pvm : PVM E) (A : E →ₗ.[ℂ] E) : Prop := +@[expose] def PVM.Represents (E_pvm : PVM E) (A : E →ₗ.[ℂ] E) : Prop := ∃ scalarMeasure : E → Measure ℝ, (∀ (x : E) (S : Set ℝ), MeasurableSet S → scalarMeasure x S = diff --git a/LeanPool/SpectralTheory/Spectral/Spectral/Polarization.lean b/LeanPool/SpectralTheory/Spectral/Spectral/Polarization.lean index 5a7439ca39..f9426d95ef 100644 --- a/LeanPool/SpectralTheory/Spectral/Spectral/Polarization.lean +++ b/LeanPool/SpectralTheory/Spectral/Spectral/Polarization.lean @@ -20,7 +20,7 @@ satisfying complex homogeneity and the parallelogram law. The diagonal of the re is the original quadratic form. -/ -@[expose] public section +public section open scoped ComplexConjugate diff --git a/LeanPool/SpectralTheory/Spectral/Spectral/Uniqueness.lean b/LeanPool/SpectralTheory/Spectral/Spectral/Uniqueness.lean index c672861a99..053edb2f3a 100644 --- a/LeanPool/SpectralTheory/Spectral/Spectral/Uniqueness.lean +++ b/LeanPool/SpectralTheory/Spectral/Spectral/Uniqueness.lean @@ -21,7 +21,7 @@ measures from characteristic functions, and then recovers projections. It also s representing PVM computes the selected measurable functional calculus. -/ -@[expose] public section +public section open Filter MeasureTheory diff --git a/LeanPool/SpectralTheory/Spectral/Stone/Generator.lean b/LeanPool/SpectralTheory/Spectral/Stone/Generator.lean index 1e969dd680..745a471a6f 100644 --- a/LeanPool/SpectralTheory/Spectral/Stone/Generator.lean +++ b/LeanPool/SpectralTheory/Spectral/Stone/Generator.lean @@ -17,7 +17,7 @@ infinitesimal-generator relation between such a group and a partial operator, via the Stone difference quotient. -/ -@[expose] public section +public section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] diff --git a/LeanPool/SpectralTheory/Spectral/Stone/Intrinsic.lean b/LeanPool/SpectralTheory/Spectral/Stone/Intrinsic.lean index 93edf10917..612e1d53ce 100644 --- a/LeanPool/SpectralTheory/Spectral/Stone/Intrinsic.lean +++ b/LeanPool/SpectralTheory/Spectral/Stone/Intrinsic.lean @@ -19,14 +19,14 @@ self-adjoint generator, and every self-adjoint operator generates such a group. -/ -@[expose] public section +public section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] /-- `U` has infinitesimal generator `A`: its domain is exactly the vectors whose Stone difference quotient converges, and the limit is `A`. -/ -def StrongContUnitary.Generates (U : StrongContUnitary E) +@[expose] def StrongContUnitary.Generates (U : StrongContUnitary E) (A : E →ₗ.[ℂ] E) : Prop := (∀ x : E, x ∈ A.domain ↔ ∃ y, Filter.Tendsto diff --git a/LeanPool/SpectralTheory/Spectral/Stone/SelfAdjoint.lean b/LeanPool/SpectralTheory/Spectral/Stone/SelfAdjoint.lean index 910b1d1acf..fc2f870434 100644 --- a/LeanPool/SpectralTheory/Spectral/Stone/SelfAdjoint.lean +++ b/LeanPool/SpectralTheory/Spectral/Stone/SelfAdjoint.lean @@ -19,7 +19,7 @@ one-parameter unitary group is self-adjoint, via the group's unitarity and the fundamental theorem of calculus for the difference quotient. -/ -@[expose] public section +public section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] diff --git a/LeanPool/SpectralTheory/Spectral/Stone/Theorem.lean b/LeanPool/SpectralTheory/Spectral/Stone/Theorem.lean index 46a2707d84..fd087571e0 100644 --- a/LeanPool/SpectralTheory/Spectral/Stone/Theorem.lean +++ b/LeanPool/SpectralTheory/Spectral/Stone/Theorem.lean @@ -19,7 +19,7 @@ Stone's theorem in the direction from self-adjoint operators to unitary groups. -/ -@[expose] public section +public section open MeasureTheory Filter @@ -27,7 +27,7 @@ variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] /-- The complex unit phase at time `t` and spectral coordinate `r`. -/ -noncomputable def stonePhase (t r : ℝ) : ℂ := +@[expose] noncomputable def stonePhase (t r : ℝ) : ℂ := Complex.exp (Complex.I * (t : ℂ) * (r : ℂ)) theorem stonePhase_measurable (t : ℝ) : Measurable (stonePhase t) := by @@ -74,7 +74,7 @@ private theorem PVM.integral_const_mul_local (E_pvm : PVM E) exact E_pvm.integral_const c, smul_mul_assoc, one_mul] /-- The bounded evolution operator obtained by integrating the unit phase against a PVM. -/ -noncomputable def spectralEvolution (E_pvm : PVM E) (t : ℝ) : E →L[ℂ] E := +@[expose] noncomputable def spectralEvolution (E_pvm : PVM E) (t : ℝ) : E →L[ℂ] E := E_pvm.integral (stonePhase t) (by exact stonePhase_measurable t) (by exact ⟨1, stonePhase_bounded t⟩) @@ -278,7 +278,7 @@ private theorem spectralEvolution_stronglyContinuous (E_pvm : PVM E) (x : E) : exact (sq_lt_sq₀ (norm_nonneg _) hε.le).1 hsquare /-- The strongly continuous unitary group assembled from spectral evolution operators. -/ -noncomputable def spectralUnitaryGroup (E_pvm : PVM E) : +@[expose] noncomputable def spectralUnitaryGroup (E_pvm : PVM E) : StrongContUnitary E where toFun := spectralEvolution E_pvm isUnitary := by exact spectralEvolution_unitary E_pvm @@ -421,7 +421,8 @@ private theorem quotientDifference_lintegral_tendsto_zero norm_num) (by rw [lintegral_const_mul 4 hcoordMeas] - exact ENNReal.mul_ne_top (by norm_num) x.property.ne) + exact ENNReal.mul_ne_top (by norm_num) + ((E_pvm.mem_domain_unboundedIntegral _ _ _).mp x.property).ne) (ae_of_all _ fun r => by have hconstR : Tendsto (fun _t : ℝ => (r : ℂ)) (nhdsWithin 0 {0}ᶜ) (nhds (r : ℂ)) := tendsto_const_nhds @@ -597,7 +598,7 @@ private theorem spectralUnitaryGroup_generator (E_pvm : PVM E) : exact (LinearPMap.eq_of_le_of_domain_eq hle hdomain).symm /-- The unitary group obtained by integrating the phases `exp (i t r)` against a PVM. -/ -noncomputable def PVM.phaseUnitaryGroup (E_pvm : PVM E) : StrongContUnitary E := +@[expose] noncomputable def PVM.phaseUnitaryGroup (E_pvm : PVM E) : StrongContUnitary E := spectralUnitaryGroup E_pvm /-- The generator of the phase unitary group is integration against the real coordinate. -/ diff --git a/LeanPool/SpectralTheory/SpectralStoneSolution.lean b/LeanPool/SpectralTheory/SpectralStoneSolution.lean index b6445ba42c..4c316c25b7 100644 --- a/LeanPool/SpectralTheory/SpectralStoneSolution.lean +++ b/LeanPool/SpectralTheory/SpectralStoneSolution.lean @@ -24,7 +24,7 @@ restated and closed by transporting the library's theorems across that conversion. -/ -@[expose] public section +public section open Function MeasureTheory diff --git a/LeanPool/StallingsFolding/BasisRose.lean b/LeanPool/StallingsFolding/BasisRose.lean index 0fc7f15009..6517791a5d 100644 --- a/LeanPool/StallingsFolding/BasisRose.lean +++ b/LeanPool/StallingsFolding/BasisRose.lean @@ -15,7 +15,7 @@ basis letters and proves that its loop subgroup is exactly the subgroup generated by those letters. -/ -@[expose] public section +public section namespace Stallings diff --git a/LeanPool/StallingsFolding/Flower.lean b/LeanPool/StallingsFolding/Flower.lean index ed623b925d..9389c96c74 100644 --- a/LeanPool/StallingsFolding/Flower.lean +++ b/LeanPool/StallingsFolding/Flower.lean @@ -20,7 +20,7 @@ word. Its vertices are indexed by generator and letter position, so the construction is finite and the input words remain visible in the definition. -/ -@[expose] public section +public section namespace Stallings @@ -84,7 +84,7 @@ def flowerLabel (S : List Word) (i : Fin S.length) (j : Fin (S.get i).length) : /-- A directed edge, allowing either the forward letter in an input word or its inverse orientation. -/ -def flowerEdge (S : List Word) (v : FlowerVertex S) (x : Letter) +@[expose] def flowerEdge (S : List Word) (v : FlowerVertex S) (x : Letter) (w : FlowerVertex S) : Prop := ∃ i : Fin S.length, ∃ j : Fin (S.get i).length, (v = flowerSource S i j ∧ w = flowerTarget S i j ∧ x = flowerLabel S i j) ∨ @@ -125,7 +125,7 @@ def flowerGraph (S : List Word) : InverseMultigraph (FlowerVertex S) where exact flowerEdge_inv_iff v w x /-- The subgroup generated by the words in the input list. -/ -def generatorSubgroup (S : List Word) : Subgroup Free := +@[expose] def generatorSubgroup (S : List Word) : Subgroup Free := Subgroup.closure (Set.range fun i : Fin S.length => wordEval (S.get i)) /-- The word prefix reaching an internal flower vertex, with `1` at the basepoint. -/ diff --git a/LeanPool/StallingsFolding/Folding.lean b/LeanPool/StallingsFolding/Folding.lean index 4e77a69501..eeed307d34 100644 --- a/LeanPool/StallingsFolding/Folding.lean +++ b/LeanPool/StallingsFolding/Folding.lean @@ -20,7 +20,7 @@ is a simple reference algorithm; a union-find implementation can later replace it without changing the correctness interface. -/ -@[expose] public section +public section namespace Stallings @@ -35,7 +35,7 @@ structure InverseMultigraph (V : Type*) where /-- A Boolean relation is a fold congruence if it is an equivalence relation and equivalent vertices have equivalent targets along equally-labelled edges. -/ -def IsFoldCongruence {V : Type*} +@[expose] def IsFoldCongruence {V : Type*} (G : InverseMultigraph V) (r : V → V → Bool) : Prop := (∀ v, r v v = true) ∧ @@ -53,7 +53,7 @@ instance foldCongruenceDecidable {V : Type*} [Fintype V] [DecidableEq V] For a finite vertex type, the quantification is over a finite type of Boolean relations, so this relation is decidable and executable. -/ -def foldRel {V : Type*} +@[expose] def foldRel {V : Type*} (G : InverseMultigraph V) (v w : V) : Prop := ∀ r : V → V → Bool, IsFoldCongruence G r → r v w = true @@ -217,7 +217,7 @@ inductive Walk : V → Word → V → Prop where (edge : u ∈ G.edges v x) (tail : Walk u w z) : Walk v (x :: w) z /-- The subgroup generated by labels of based loops in the multigraph. -/ -def loopSubgroup (base : V) : Subgroup Free := +@[expose] def loopSubgroup (base : V) : Subgroup Free := Subgroup.closure {g : Free | ∃ w : Word, wordEval w = g ∧ G.Walk base w base} end InverseMultigraph @@ -261,7 +261,7 @@ theorem foldWalk {V : Type*} [Fintype V] [DecidableEq V] [LinearOrder V] exact ih /-- Equality of right cosets of a subgroup, in element form. -/ -def CosetEquivalent (H : Subgroup Free) (g h : Free) : Prop := g * h⁻¹ ∈ H +@[expose] def CosetEquivalent (H : Subgroup Free) (g h : Free) : Prop := g * h⁻¹ ∈ H namespace CosetEquivalent @@ -301,7 +301,7 @@ end CosetEquivalent /-- A potential assigns a free-group value to each vertex, consistently up to left multiplication by `H` along every labelled edge. -/ -def HasCosetPotential {V : Type*} +@[expose] def HasCosetPotential {V : Type*} (G : InverseMultigraph V) (H : Subgroup Free) (potential : V → Free) : Prop := ∀ {v : V} {x : Letter} {w : V}, w ∈ G.edges v x → diff --git a/LeanPool/StallingsFolding/InverseAutomaton.lean b/LeanPool/StallingsFolding/InverseAutomaton.lean index 123bc35c2f..423d218fdf 100644 --- a/LeanPool/StallingsFolding/InverseAutomaton.lean +++ b/LeanPool/StallingsFolding/InverseAutomaton.lean @@ -17,7 +17,7 @@ subgroup of the free group, and that membership in this subgroup is exactly a finite traversal test on the canonical reduced word. -/ -@[expose] public section +public section namespace Stallings @@ -31,7 +31,7 @@ abbrev Word := List Letter abbrev Free := FreeGroup (Fin 2) /-- Reverse the orientation of a letter. -/ -def letterInv (x : Letter) : Letter := (x.1, !x.2) +@[expose] def letterInv (x : Letter) : Letter := (x.1, !x.2) @[simp] theorem letterInv_letterInv (x : Letter) : letterInv (letterInv x) = x := by @@ -42,10 +42,10 @@ theorem letterInv_letterInv (x : Letter) : letterInv (letterInv x) = x := by def wordInv (w : Word) : Word := FreeGroup.invRev w /-- Interpret a signed word as an element of the free group. -/ -def wordEval (w : Word) : Free := FreeGroup.mk w +@[expose] def wordEval (w : Word) : Free := FreeGroup.mk w /-- Interpret one signed generator as an element of the free group. -/ -def letterEval (x : Letter) : Free := +@[expose] def letterEval (x : Letter) : Free := if x.2 then FreeGroup.of x.1 else (FreeGroup.of x.1)⁻¹ @[simp] @@ -90,12 +90,12 @@ namespace InverseAutomaton variable {V : Type*} (G : InverseAutomaton V) /-- Execute a word from a starting state, stopping if a required edge is absent. -/ -def run (G : InverseAutomaton V) (v : V) : Word → Option V +@[expose] def run (G : InverseAutomaton V) (v : V) : Word → Option V | [] => some v | x :: w => (G.next v x).bind fun u => G.run u w @[simp] -theorem run_nil (v : V) : G.run v [] = some v := rfl +theorem run_nil (v : V) : G.run v [] = some v := by rfl /-- A labelled path in an inverse automaton. -/ inductive Walk : V → Word → V → Prop where @@ -205,7 +205,7 @@ theorem run_success_of_reduction (v : V) (w : Word) {t : V} G.run v (FreeGroup.reduce w) = some t := G.run_success_of_red v (FreeGroup.reduce.red) hRun /-- The subgroup represented by all loops at the basepoint. -/ -def loopSubgroup : Subgroup Free where +@[expose] def loopSubgroup : Subgroup Free where carrier := {g | ∃ w : Word, wordEval w = g ∧ G.Walk G.base w G.base} one_mem' := by exact ⟨[], by simpa [wordEval] using FreeGroup.one_eq_mk.symm, Walk.nil G.base⟩ @@ -222,7 +222,7 @@ def loopSubgroup : Subgroup Free where rw [wordEval_wordInv, hw] /-- Membership in the loop subgroup is decided by traversing the canonical reduced word. -/ -def accepts (g : Free) : Prop := G.run G.base (FreeGroup.toWord g) = some G.base +@[expose] def accepts (g : Free) : Prop := G.run G.base (FreeGroup.toWord g) = some G.base theorem accepts_iff_mem_loopSubgroup (g : Free) : G.accepts g ↔ g ∈ G.loopSubgroup := by diff --git a/LeanPool/StallingsFolding/Recognizer.lean b/LeanPool/StallingsFolding/Recognizer.lean index 5005f9c14d..39855dbd3b 100644 --- a/LeanPool/StallingsFolding/Recognizer.lean +++ b/LeanPool/StallingsFolding/Recognizer.lean @@ -15,7 +15,7 @@ of the implementation proves its based-loop subgroup is precisely the subgroup generated by the input list. -/ -@[expose] public section +public section namespace Stallings diff --git a/LeanPool/StallingsFolding/Restriction.lean b/LeanPool/StallingsFolding/Restriction.lean index bce3a0dbde..e70c572996 100644 --- a/LeanPool/StallingsFolding/Restriction.lean +++ b/LeanPool/StallingsFolding/Restriction.lean @@ -16,7 +16,7 @@ unrelated connected components impose no hypotheses. This extension was added during the AI-assisted Lean Pool port of Arthur Freitas Ramos' development. -/ -@[expose] public section +public section namespace Stallings namespace InverseMultigraph diff --git a/LeanPool/SteinhausThreeGap.lean b/LeanPool/SteinhausThreeGap.lean index b082ec690b..8bdda10c51 100644 --- a/LeanPool/SteinhausThreeGap.lean +++ b/LeanPool/SteinhausThreeGap.lean @@ -18,4 +18,4 @@ Tags: number-theory, three-gap-theorem, equidistribution MSC: 11K06 -/ -@[expose] public section +public section diff --git a/LeanPool/SteinhausThreeGap/Basic.lean b/LeanPool/SteinhausThreeGap/Basic.lean index 7fb907b3e9..88682b344c 100644 --- a/LeanPool/SteinhausThreeGap/Basic.lean +++ b/LeanPool/SteinhausThreeGap/Basic.lean @@ -53,7 +53,7 @@ Note on `noncomputable`: on `ℝ`, `DecidableEq` and the order are noncomputable `noncomputable`. -/ -@[expose] public section +public section namespace SteinhausThreeGap @@ -103,7 +103,7 @@ noncomputable def sortedVal (a : ℝ) (N : ℕ) (i : ℕ) : ℝ := over `Finset.range (k - 1)`; * the wrap-around gap `g 0 + 1 - g (k - 1)` (i.e. `min + 1 - max`), added as a singleton. -/ -noncomputable def gaps (a : ℝ) (N : ℕ) : Multiset ℝ := +@[expose] noncomputable def gaps (a : ℝ) (N : ℕ) : Multiset ℝ := ((Finset.range (orbitCard a N - 1)).val.map (fun i => sortedVal a N (i + 1) - sortedVal a N i)) + {sortedVal a N 0 + 1 - sortedVal a N (orbitCard a N - 1)} @@ -165,7 +165,7 @@ theorem sortedVal_mem (a : ℝ) {N : ℕ} {i : ℕ} (h : i < orbitCard a N) : /-! ## Phase 2 — gap infrastructure and the distinct-gap-count reduction -/ /-- The `i`-th adjacent gap of the sorted enumeration. -/ -noncomputable def gapAt (a : ℝ) (N : ℕ) (i : ℕ) : ℝ := +@[expose] noncomputable def gapAt (a : ℝ) (N : ℕ) (i : ℕ) : ℝ := sortedVal a N (i + 1) - sortedVal a N i /-- `gaps` written through `gapAt` (definitional). -/ diff --git a/LeanPool/SumDifferenceExponent/Basic.lean b/LeanPool/SumDifferenceExponent/Basic.lean index 2a0e614ce3..2e7278a400 100644 --- a/LeanPool/SumDifferenceExponent/Basic.lean +++ b/LeanPool/SumDifferenceExponent/Basic.lean @@ -44,7 +44,7 @@ is never attained. This product is licensed under the Apache License, Version 2.0; see the LICENSE file. -/ -@[expose] public section +public section open scoped BigOperators Pointwise @@ -53,11 +53,11 @@ namespace SumDifferenceExponent /-! ## 1. The optimization problem -/ /-- The sum doubling constant `|A + A| / |A|`, regarded as a real number. -/ -noncomputable def sigma (A : Finset ℤ) : ℝ := +@[expose] noncomputable def sigma (A : Finset ℤ) : ℝ := ((A + A).card : ℝ) / (A.card : ℝ) /-- The difference doubling constant `|A - A| / |A|`, regarded as a real number. -/ -noncomputable def delta (A : Finset ℤ) : ℝ := +@[expose] noncomputable def delta (A : Finset ℤ) : ℝ := ((A - A).card : ℝ) / (A.card : ℝ) /-- @@ -65,7 +65,7 @@ The sum/difference growth exponent. As in the paper, this definition is only used under the hypothesis `2 ≤ A.card`; without that hypothesis the quotient is still a Lean term, but is not the quantity in the optimization problem. -/ -noncomputable def growthExponent (A : Finset ℤ) : ℝ := +@[expose] noncomputable def growthExponent (A : Finset ℤ) : ℝ := Real.log (sigma A) / Real.log (delta A) /-- diff --git a/LeanPool/SumDifferenceExponent/Column.lean b/LeanPool/SumDifferenceExponent/Column.lean index 5421deaa8c..3f62770f62 100644 --- a/LeanPool/SumDifferenceExponent/Column.lean +++ b/LeanPool/SumDifferenceExponent/Column.lean @@ -14,7 +14,7 @@ public import Mathlib.Data.Nat.Digits.Lemmas /-! Kernel-friendly base-39 column construction. -/ -@[expose] public section +public section open scoped BigOperators Pointwise @@ -107,7 +107,7 @@ theorem allValues_eq_range (m : ℕ) : def ZNat (m : ℕ) : Finset ℕ := digitSet 39 V m /-- The sparse column set viewed as integers. -/ -def Z (m : ℕ) : Finset ℤ := (ZNat m).image fun n : ℕ => (n : ℤ) +@[expose] def Z (m : ℕ) : Finset ℤ := (ZNat m).image fun n : ℕ => (n : ℤ) theorem ZNat_card (m : ℕ) : (ZNat m).card = 12 ^ m := by rw [ZNat, digitSet_card (by norm_num : 1 < 39)] diff --git a/LeanPool/SumDifferenceExponent/Construction.lean b/LeanPool/SumDifferenceExponent/Construction.lean index 2545621a17..93df940f22 100644 --- a/LeanPool/SumDifferenceExponent/Construction.lean +++ b/LeanPool/SumDifferenceExponent/Construction.lean @@ -14,7 +14,7 @@ public import Mathlib.Tactic.Positivity /-! Explicit row-column sets and their cardinality estimates. -/ -@[expose] public section +public section open scoped BigOperators Pointwise @@ -122,10 +122,10 @@ theorem rowLabel_sum_lt_base nlinarith [Nat.zero_le i, Nat.zero_le j, Nat.zero_le l] /-- The number of base-39 digits needed to make the sparse contributions negligible. -/ -def depth (l : ℕ) : ℕ := 28 * l +@[expose] def depth (l : ℕ) : ℕ := 28 * l /-- The range length of the full column at the chosen digit depth. -/ -def columnModulus (l : ℕ) : ℕ := 39 ^ depth l +@[expose] def columnModulus (l : ℕ) : ℕ := 39 ^ depth l theorem sparse_difference_negligible (l : ℕ) : 2 * l * 37 ^ depth l ≤ columnModulus l := by diff --git a/LeanPool/SumDifferenceExponent/Limit.lean b/LeanPool/SumDifferenceExponent/Limit.lean index c29dc71ddd..f64dc09b92 100644 --- a/LeanPool/SumDifferenceExponent/Limit.lean +++ b/LeanPool/SumDifferenceExponent/Limit.lean @@ -10,7 +10,7 @@ public import LeanPool.SumDifferenceExponent.Basic /-! The asymptotic lower bound for the explicit construction. -/ -@[expose] public section +public section open scoped BigOperators Pointwise open Filter Topology diff --git a/LeanPool/SumDifferenceExponent/Main.lean b/LeanPool/SumDifferenceExponent/Main.lean index e2fa35abda..d6f5a876ea 100644 --- a/LeanPool/SumDifferenceExponent/Main.lean +++ b/LeanPool/SumDifferenceExponent/Main.lean @@ -9,7 +9,7 @@ public import LeanPool.SumDifferenceExponent.Limit /-! The complete sharp-supremum theorem. -/ -@[expose] public section +public section open scoped BigOperators Pointwise open Filter Topology diff --git a/LeanPool/SumDifferenceExponent/Quantitative.lean b/LeanPool/SumDifferenceExponent/Quantitative.lean index f37f7004fc..780a929760 100644 --- a/LeanPool/SumDifferenceExponent/Quantitative.lean +++ b/LeanPool/SumDifferenceExponent/Quantitative.lean @@ -10,7 +10,7 @@ public import Mathlib.Analysis.Complex.ExponentialBounds /-! A fully explicit `10⁻⁹⁹⁹` quantitative witness. -/ -@[expose] public section +public section open scoped BigOperators Pointwise open Filter Topology diff --git a/LeanPool/SumsThreeSquares.lean b/LeanPool/SumsThreeSquares.lean index dbc5d360d8..ec57c7ccc6 100644 --- a/LeanPool/SumsThreeSquares.lean +++ b/LeanPool/SumsThreeSquares.lean @@ -24,7 +24,7 @@ Tags: number-theory, quadratic-forms, geometry-of-numbers MSC: 11E25, 11H06 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/SumsThreeSquares/MinkowskiConvex.lean b/LeanPool/SumsThreeSquares/MinkowskiConvex.lean index dfd4835073..9eb03555c3 100644 --- a/LeanPool/SumsThreeSquares/MinkowskiConvex.lean +++ b/LeanPool/SumsThreeSquares/MinkowskiConvex.lean @@ -21,7 +21,7 @@ states that a symmetric convex set of volume greater than `2 ^ n` contains a non point all of whose coordinates are integers. -/ -@[expose] public section +public section namespace LeanPool.SumsThreeSquares diff --git a/LeanPool/SumsThreeSquares/SumThreeSquares.lean b/LeanPool/SumsThreeSquares/SumThreeSquares.lean index d305fe72c2..a00b92a91f 100644 --- a/LeanPool/SumsThreeSquares/SumThreeSquares.lean +++ b/LeanPool/SumsThreeSquares/SumThreeSquares.lean @@ -26,7 +26,7 @@ Minkowski's theorem (see `LeanPool.SumsThreeSquares.MinkowskiConvex`). The main result is `blueprint_case_mod8_eq3`. -/ -@[expose] public section +public section namespace LeanPool.SumsThreeSquares diff --git a/LeanPool/Sundogcert.lean b/LeanPool/Sundogcert.lean index c1cf6614f2..2d75dd78f6 100644 --- a/LeanPool/Sundogcert.lean +++ b/LeanPool/Sundogcert.lean @@ -36,4 +36,4 @@ Tags: complexity, coding-theory, np-hardness MSC: 68Q17, 94B35 -/ -@[expose] public section +public section diff --git a/LeanPool/Sundogcert/CertWall.lean b/LeanPool/Sundogcert/CertWall.lean index 73c1bcc7ac..80e9f9664e 100644 --- a/LeanPool/Sundogcert/CertWall.lean +++ b/LeanPool/Sundogcert/CertWall.lean @@ -51,7 +51,7 @@ import Mathlib.LinearAlgebra.Matrix.NonsingularInverse `colWeightLb` only — never a claim about the hardness of decoding itself. -/ -@[expose] public section +public section open Matrix diff --git a/LeanPool/Sundogcert/Certificate.lean b/LeanPool/Sundogcert/Certificate.lean index dbd36e4dc3..f371f7b8c8 100644 --- a/LeanPool/Sundogcert/Certificate.lean +++ b/LeanPool/Sundogcert/Certificate.lean @@ -19,7 +19,7 @@ public import Mathlib.InformationTheory.Hamming -- hammingNorm (the error weigh TRUST SURFACE = the `Scheme` fields (esp. `hHG`) + `Safe`; everything else is machine-checked. -/ -@[expose] public section +public section open Matrix @@ -29,7 +29,7 @@ variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] -- Deployed instance: `F := ZMod 2` (the [n=128, k=64] GF(2) certificate). Field-generic below. /-- Hamming weight = number of nonzero coordinates (the error weight). -/ -def wt {n : ℕ} (e : Fin n → F) : ℕ := hammingNorm e +@[expose] def wt {n : ℕ} (e : Fin n → F) : ℕ := hammingNorm e /-! ### THE TRUST SURFACE — a reviewer audits these definitions; the rest is machine-checked. -/ @@ -58,7 +58,7 @@ def body (s : Fin S.k → F) (e : Fin S.n → F) : Fin S.n → F := s ᵥ* S.G + /-- **Safety predicate** (semantic): some same-syndrome witness has weight ≤ τ. The planted `e` is a *label*, never referenced here. -/ -def Safe (y : Fin S.n → F) : Prop := +@[expose] def Safe (y : Fin S.n → F) : Prop := ∃ e' : Fin S.n → F, S.H *ᵥ e' = S.H *ᵥ y ∧ wt e' ≤ S.τ /-! ### The verifier (cheap, three-valued) -/ @@ -195,7 +195,7 @@ theorem hammingNorm_eq_card_vsupp {n : ℕ} (v : Fin n → F) : simp only [hammingNorm, vsupp] /-- Worst-case column weight of `M`: the most nonzero entries in any single column. -/ -def colBound (M : Matrix (Fin a) (Fin b) F) : ℕ := +@[expose] def colBound (M : Matrix (Fin a) (Fin b) F) : ℕ := Finset.univ.sup (fun j => (Finset.univ.filter (fun i => M i j ≠ 0)).card) omit [Fintype F] in @@ -236,7 +236,7 @@ theorem hammingNorm_mulVec_le (M : Matrix (Fin a) (Fin b) F) (e : Fin b → F) : `hammingNorm` zero-test + one division; `colBound S.H` amortized once per scheme). Unlike `supportLb` it can exceed 1, so `reject` fires at `τ > 0`. Floor division is the SOUND direction (it only under-estimates weight); `colBound = 0` ⟹ `H = 0` ⟹ syndrome `= 0`, sound. -/ -def colWeightLb (z : Fin S.m → F) : ℕ := hammingNorm z / colBound S.H +@[expose] def colWeightLb (z : Fin S.m → F) : ℕ := hammingNorm z / colBound S.H /-- `colWeightLb` never exceeds any same-syndrome witness weight (soundness). -/ theorem colWeightLb_sound (y e' : Fin S.n → F) (he : S.H *ᵥ e' = S.H *ᵥ y) : diff --git a/LeanPool/Sundogcert/CheckCost.lean b/LeanPool/Sundogcert/CheckCost.lean index a20f312726..87e4972e30 100644 --- a/LeanPool/Sundogcert/CheckCost.lean +++ b/LeanPool/Sundogcert/CheckCost.lean @@ -32,7 +32,7 @@ public import LeanPool.Sundogcert.Certificate Given that audited model, the polynomial bound is a THEOREM (kernel-checked, `sorry`-free). -/ -@[expose] public section +public section open Matrix diff --git a/LeanPool/Sundogcert/ClauseGadget.lean b/LeanPool/Sundogcert/ClauseGadget.lean index f635470e9c..d5812b2887 100644 --- a/LeanPool/Sundogcert/ClauseGadget.lean +++ b/LeanPool/Sundogcert/ClauseGadget.lean @@ -55,7 +55,7 @@ public import LeanPool.Sundogcert.VarWheel AXIOM-CLEAN (no `Lean.ofReduceBool`; we use `decide`, never `native_decide`). -/ -@[expose] public section +public section open Sundog.SATNPHard Sundog.VarWheel @@ -65,7 +65,7 @@ variable {n : ℕ} /-- The clause gadget's internal pair `s1_k, s2_k` is coverable iff AT LEAST ONE of the three slots' tips is free. `free k` records whether the slot-`k` tip is free. -/ -def clauseCoverable (free : Fin 3 → Bool) : Prop := ∃ k : Fin 3, free k = true +@[expose] def clauseCoverable (free : Fin 3 → Bool) : Prop := ∃ k : Fin 3, free k = true /-- `clauseCoverable` is an `∃` over `Fin 3` of a decidable `Prop`; register the instance explicitly so `decide` fires at the `def` level (and for the downstream milestones 5–8). -/ diff --git a/LeanPool/Sundogcert/DecodingNPHard.lean b/LeanPool/Sundogcert/DecodingNPHard.lean index 2c5e8bf458..dced90f8b6 100644 --- a/LeanPool/Sundogcert/DecodingNPHard.lean +++ b/LeanPool/Sundogcert/DecodingNPHard.lean @@ -58,7 +58,7 @@ import Mathlib.Data.ZMod.Basic over GF(2). The connection lemma makes the odd-cover ⇔ syndrome=allOnes equivalence explicit. -/ -@[expose] public section +public section open Matrix Finset @@ -70,14 +70,14 @@ variable {s : ℕ} (c : Fin s → Finset X) (q : ℕ) /-! ### The reduction's definitions. -/ /-- `coverCount c T x` — how many SELECTED 3-sets (indices in `T`) contain the point `x`. -/ -def coverCount (T : Finset (Fin s)) (x : X) : ℕ := +@[expose] def coverCount (T : Finset (Fin s)) (x : X) : ℕ := (T.filter (fun i => x ∈ c i)).card /-- `T` is an **exact cover**: every point is covered by exactly one selected set. -/ -def IsExactCover (T : Finset (Fin s)) : Prop := ∀ x : X, coverCount c T x = 1 +@[expose] def IsExactCover (T : Finset (Fin s)) : Prop := ∀ x : X, coverCount c T x = 1 /-- **EC3S / X3C**: an exact cover exists. (The source NP-hard problem; Karp 1972.) -/ -def X3C : Prop := ∃ T : Finset (Fin s), IsExactCover c T +@[expose] def X3C : Prop := ∃ T : Finset (Fin s), IsExactCover c T /-- The parity-check matrix of the reduction: column `i` is the GF(2) indicator of the 3-set `c i`. Rows are points of `X`, columns are the `s` sets. -/ diff --git a/LeanPool/Sundogcert/Degradation.lean b/LeanPool/Sundogcert/Degradation.lean index e775490fe0..d92f53e426 100644 --- a/LeanPool/Sundogcert/Degradation.lean +++ b/LeanPool/Sundogcert/Degradation.lean @@ -33,7 +33,7 @@ public import LeanPool.Sundogcert.Scaling Safe-equivalence for all c), reusing the Looseness invertibility approach. -/ -@[expose] public section +public section open Matrix @@ -257,7 +257,7 @@ theorem hHG_bandDense (m c : ℕ) : /-- The band-dense scheme at density `c`: same `n,k,m,G,τ` as `projScheme`, only `H` differs (`H := bandDenseH m c`, density `c`). -/ -def bandScheme (m c : ℕ) : Scheme (ZMod 2) where +@[expose] def bandScheme (m c : ℕ) : Scheme (ZMod 2) where n := 2 * m k := m m := m diff --git a/LeanPool/Sundogcert/Instance.lean b/LeanPool/Sundogcert/Instance.lean index 94e07b1f5b..a95bd743fd 100644 --- a/LeanPool/Sundogcert/Instance.lean +++ b/LeanPool/Sundogcert/Instance.lean @@ -23,7 +23,7 @@ public import Mathlib.LinearAlgebra.Matrix.Notation -- !![; ] matrix literal not NOT general tightness. -/ -@[expose] public section +public section open Matrix diff --git a/LeanPool/Sundogcert/Looseness.lean b/LeanPool/Sundogcert/Looseness.lean index d20e7933c1..5937ba34e5 100644 --- a/LeanPool/Sundogcert/Looseness.lean +++ b/LeanPool/Sundogcert/Looseness.lean @@ -33,7 +33,7 @@ public import Mathlib.LinearAlgebra.Matrix.NonsingularInverse weight `m` YET `colWeightLb (denseScheme m) = 0`. Anti-scaling-law: gap = m. -/ -@[expose] public section +public section open Matrix @@ -188,7 +188,7 @@ theorem hHG_dense (m : ℕ) : /-! ### TIER 2/1 — the dense scheme. -/ /-- The DENSE scheme: same `n,k,m,G,τ` as `projScheme`, but `H := denseH m` (row-equivalent). -/ -def denseScheme (m : ℕ) : Scheme (ZMod 2) where +@[expose] def denseScheme (m : ℕ) : Scheme (ZMod 2) where n := 2 * m k := m m := m diff --git a/LeanPool/Sundogcert/MatchingNPHard.lean b/LeanPool/Sundogcert/MatchingNPHard.lean index 59162305bd..8a71816294 100644 --- a/LeanPool/Sundogcert/MatchingNPHard.lean +++ b/LeanPool/Sundogcert/MatchingNPHard.lean @@ -43,7 +43,7 @@ public import LeanPool.Sundogcert.DecodingNPHard `3SAT ≤ 3DM` that would discharge 3DM's hardness internally. -/ -@[expose] public section +public section open Finset @@ -58,7 +58,7 @@ variable {s : ℕ} (t : Fin s → W × X × Y) (q : ℕ) /-- **Perfect 3-dimensional matching** among the `s` triples: a selection `T` of triple-indices covering each W-element, each X-element, and each Y-element exactly once. -/ -def ThreeDM : Prop := ∃ T : Finset (Fin s), +@[expose] def ThreeDM : Prop := ∃ T : Finset (Fin s), (∀ w : W, (T.filter (fun i => (t i).1 = w)).card = 1) ∧ (∀ x : X, (T.filter (fun i => (t i).2.1 = x)).card = 1) ∧ (∀ y : Y, (T.filter (fun i => (t i).2.2 = y)).card = 1) diff --git a/LeanPool/Sundogcert/RSCertificate.lean b/LeanPool/Sundogcert/RSCertificate.lean index 06ab2aaa97..4218c481cc 100644 --- a/LeanPool/Sundogcert/RSCertificate.lean +++ b/LeanPool/Sundogcert/RSCertificate.lean @@ -41,7 +41,7 @@ there is zero) + `det_vandermonde_ne_zero_iff`. A field discharges `[CommRing]+[ * `Polynomial.eq_of_natDegree_lt_card_of_eval_eq`, `Matrix.det_vandermonde_ne_zero_iff`. -/ -@[expose] public section +public section namespace Sundog.RSCertificate diff --git a/LeanPool/Sundogcert/SATNPHard.lean b/LeanPool/Sundogcert/SATNPHard.lean index 716c9d7019..825a37882c 100644 --- a/LeanPool/Sundogcert/SATNPHard.lean +++ b/LeanPool/Sundogcert/SATNPHard.lean @@ -41,7 +41,7 @@ public import Mathlib.Data.Fin.VecNotation and its correctness, is the work to come — milestones 2+ of `3SAT ≤ 3DM ≤ X3C ≤ Decodes`. -/ -@[expose] public section +public section namespace Sundog.SATNPHard @@ -52,7 +52,7 @@ abbrev Literal (n : ℕ) := Fin n × Bool abbrev Assignment (n : ℕ) := Fin n → Bool /-- Evaluate a literal under an assignment. -/ -def evalLiteral {n : ℕ} (a : Assignment n) (l : Literal n) : Bool := +@[expose] def evalLiteral {n : ℕ} (a : Assignment n) (l : Literal n) : Bool := if l.2 then a l.1 else !(a l.1) /-- A 3-clause: an ORDERED triple of literals (`Fin 3 → Literal` — cleaner than a Finset @@ -60,18 +60,18 @@ def evalLiteral {n : ℕ} (a : Assignment n) (l : Literal n) : Bool := abbrev Clause (n : ℕ) := Fin 3 → Literal n /-- A clause is satisfied iff at least one of its 3 literals is true. -/ -def clauseSat {n : ℕ} (a : Assignment n) (c : Clause n) : Prop := +@[expose] def clauseSat {n : ℕ} (a : Assignment n) (c : Clause n) : Prop := ∃ k : Fin 3, evalLiteral a (c k) = true /-- A 3-CNF formula: `m` clauses, indexed. -/ abbrev Formula (n m : ℕ) := Fin m → Clause n /-- A formula is satisfied iff every clause is. -/ -def formulaSat {n m : ℕ} (a : Assignment n) (f : Formula n m) : Prop := +@[expose] def formulaSat {n m : ℕ} (a : Assignment n) (f : Formula n m) : Prop := ∀ k : Fin m, clauseSat a (f k) /-- **3-SAT**: a formula is satisfiable iff some assignment satisfies it. -/ -def Satisfiable {n m : ℕ} (f : Formula n m) : Prop := +@[expose] def Satisfiable {n m : ℕ} (f : Formula n m) : Prop := ∃ a : Assignment n, formulaSat a f /-! ### Decidability. @@ -97,7 +97,7 @@ instance {n m : ℕ} (f : Formula n m) : Decidable (Satisfiable f) := `a 0 = true`). `∃` ranges over the 4 assignments of `Fin 2 → Bool` — decidable. -/ /-- The single satisfiable clause `x₀ ∨ x₁ ∨ x₀`. -/ -def cSat : Clause 2 := ![(0, true), (1, true), (0, true)] +@[expose] def cSat : Clause 2 := ![(0, true), (1, true), (0, true)] /-- The satisfiable formula with one clause. -/ def fSat : Formula 2 1 := ![cSat] diff --git a/LeanPool/Sundogcert/SATReduction.lean b/LeanPool/Sundogcert/SATReduction.lean index 50457f315e..15a35b4515 100644 --- a/LeanPool/Sundogcert/SATReduction.lean +++ b/LeanPool/Sundogcert/SATReduction.lean @@ -64,7 +64,7 @@ public import LeanPool.Sundogcert.MatchingNPHard `[propext, Classical.choice, Quot.sound]` on the four audited results. -/ -@[expose] public section +public section open Sundog.SATNPHard Sundog.MatchingNPHard @@ -110,7 +110,7 @@ instance instDecidableEqTripleIdx : DecidableEq (TripleIdx n m) := /-! ### The triple function — faithful to the milestone-2/3 gadgets. -/ /-- The triple map `TripleIdx → Tip × XNode × YNode`: each index slot emits its gadget triple. -/ -def tripleFn (φ : Formula n m) : TripleIdx n m → Tip n m × XNode n m × YNode n m +@[expose] def tripleFn (φ : Formula n m) : TripleIdx n m → Tip n m × XNode n m × YNode n m | Sum.inl (i, j) => ((i, j, true), Sum.inl (i, j), Sum.inl (i, j)) | Sum.inr (Sum.inl (i, j)) => ((i, j, false), Sum.inl (i, j + 1), Sum.inl (i, j)) | Sum.inr (Sum.inr (Sum.inl (k, slot))) => @@ -123,7 +123,7 @@ def tripleFn (φ : Formula n m) : TripleIdx n m → Tip n m × XNode n m × YNod /-- **The reduction.** Re-index the gadget triple map along the canonical finite equiv, giving the `Fin s → Tip × XNode × YNode` shape the matching problem wants (`s = card TripleIdx`). `noncomputable` because `Fintype.equivFin` is. -/ -noncomputable def reduce (φ : Formula n m) : +@[expose] noncomputable def reduce (φ : Formula n m) : Fin (Fintype.card (TripleIdx n m)) → Tip n m × XNode n m × YNode n m := fun i => tripleFn φ ((Fintype.equivFin _).symm i) diff --git a/LeanPool/Sundogcert/SATReductionForward.lean b/LeanPool/Sundogcert/SATReductionForward.lean index e5f915382f..0e8527af71 100644 --- a/LeanPool/Sundogcert/SATReductionForward.lean +++ b/LeanPool/Sundogcert/SATReductionForward.lean @@ -53,7 +53,7 @@ public import LeanPool.Sundogcert.ThreeDMReindex Axiom-clean (no `native_decide`, no `decide`). Expect `[propext, Classical.choice, Quot.sound]`. -/ -@[expose] public section +public section open Sundog.SATReduction Sundog.SATNPHard open Sundog.SATReductionIncidence Sundog.ThreeDMReindex diff --git a/LeanPool/Sundogcert/SATReductionIncidence.lean b/LeanPool/Sundogcert/SATReductionIncidence.lean index a257a642f1..fee9f19c33 100644 --- a/LeanPool/Sundogcert/SATReductionIncidence.lean +++ b/LeanPool/Sundogcert/SATReductionIncidence.lean @@ -38,7 +38,7 @@ public import LeanPool.Sundogcert.SATReduction Axiom-clean (no `decide`, no `native_decide`). Expect `[propext, Quot.sound]` subsets on all six. -/ -@[expose] public section +public section open Sundog.SATReduction Sundog.SATNPHard diff --git a/LeanPool/Sundogcert/SATReductionMain.lean b/LeanPool/Sundogcert/SATReductionMain.lean index 14aa37165d..3d24c10206 100644 --- a/LeanPool/Sundogcert/SATReductionMain.lean +++ b/LeanPool/Sundogcert/SATReductionMain.lean @@ -52,7 +52,7 @@ import LeanPool.Sundogcert.SATReductionReverse `[propext, Classical.choice, Quot.sound]` on each audited result. -/ -@[expose] public section +public section open Sundog.SATReduction Sundog.SATNPHard Sundog.SATReductionForward open Sundog.SATReductionReverse Sundog.ThreeDMReindex Sundog.MatchingNPHard diff --git a/LeanPool/Sundogcert/SATReductionReverse.lean b/LeanPool/Sundogcert/SATReductionReverse.lean index c021071b98..4265e0a31f 100644 --- a/LeanPool/Sundogcert/SATReductionReverse.lean +++ b/LeanPool/Sundogcert/SATReductionReverse.lean @@ -52,7 +52,7 @@ import LeanPool.Sundogcert.VarWheel Expect `[propext, Classical.choice, Quot.sound]` on both `reverse` and the helper. -/ -@[expose] public section +public section open Sundog.SATReduction Sundog.SATNPHard Sundog.VarWheel open Sundog.SATReductionIncidence Sundog.ThreeDMReindex diff --git a/LeanPool/Sundogcert/Scaling.lean b/LeanPool/Sundogcert/Scaling.lean index b9eac66c2d..7f3c5726a9 100644 --- a/LeanPool/Sundogcert/Scaling.lean +++ b/LeanPool/Sundogcert/Scaling.lean @@ -28,7 +28,7 @@ import Mathlib.Tactic.ContinuousFunctionalCalculus family demonstrates SOUNDNESS and linear-in-n τ reach, NOT general tightness. -/ -@[expose] public section +public section open Matrix @@ -37,7 +37,7 @@ namespace Sundog.Certificate.Scaling /-! ### The parametric family (the [2m, m] projection code). -/ /-- Parity-check `[Iₘ | 0]` : row `i`, col `j` is `1` iff `j = i` (so `j < m`). -/ -def projH (m : ℕ) : Matrix (Fin m) (Fin (2 * m)) (ZMod 2) := +@[expose] def projH (m : ℕ) : Matrix (Fin m) (Fin (2 * m)) (ZMod 2) := Matrix.of fun i j => if (j : ℕ) = (i : ℕ) then 1 else 0 /-- Generator `[0 | Iₘ]` : row `i`, col `j` is `1` iff `j = i + m` (so `j ≥ m`). @@ -47,7 +47,7 @@ def projG (m : ℕ) : Matrix (Fin m) (Fin (2 * m)) (ZMod 2) := /-- The all-ones-syndrome body: the first `m` coordinates are `1`, the rest `0`. `projH m *ᵥ (allOnesSynBody m)` is the all-ones vector in `Fin m`. -/ -def allOnesSynBody (m : ℕ) : Fin (2 * m) → ZMod 2 := +@[expose] def allOnesSynBody (m : ℕ) : Fin (2 * m) → ZMod 2 := fun j => if (j : ℕ) < m then 1 else 0 /-! ### TIER 3 — pure computation. The empirical scaling law (NO Scheme / hHG needed). @@ -106,7 +106,7 @@ theorem hHG_proj (m : ℕ) : The divergence WIDENS with m — the non-degenerate bound's reach grows linearly in τ. -/ /-- The parametric scheme `[2m, m]` at radius `τ = m - 1`. -/ -def projScheme (m : ℕ) : Scheme (ZMod 2) where +@[expose] def projScheme (m : ℕ) : Scheme (ZMod 2) where n := 2 * m k := m m := m diff --git a/LeanPool/Sundogcert/ThreeDMReindex.lean b/LeanPool/Sundogcert/ThreeDMReindex.lean index 5d6ee7a83a..8b37a7ba1e 100644 --- a/LeanPool/Sundogcert/ThreeDMReindex.lean +++ b/LeanPool/Sundogcert/ThreeDMReindex.lean @@ -40,7 +40,7 @@ public import LeanPool.Sundogcert.MatchingNPHard Axiom-clean (`decide`/`native_decide` never used). Expect the standard classical trio. -/ -@[expose] public section +public section open Finset open Sundog.MatchingNPHard @@ -57,7 +57,7 @@ variable {I : Type*} [Fintype I] [DecidableEq I] /-- **Perfect 3-dimensional matching over an arbitrary `Fintype` index `I`** — a selection `T : Finset I` covering each W-element, each X-element, and each Y-element exactly once. Mirrors `MatchingNPHard.ThreeDM` exactly, but indexed by `I` rather than `Fin s`. -/ -def threeDMI (t : I → W × X × Y) : Prop := ∃ T : Finset I, +@[expose] def threeDMI (t : I → W × X × Y) : Prop := ∃ T : Finset I, (∀ w : W, (T.filter (fun i => (t i).1 = w)).card = 1) ∧ (∀ x : X, (T.filter (fun i => (t i).2.1 = x)).card = 1) ∧ (∀ y : Y, (T.filter (fun i => (t i).2.2 = y)).card = 1) diff --git a/LeanPool/Sundogcert/VarWheel.lean b/LeanPool/Sundogcert/VarWheel.lean index af48150c53..da67f4ba8c 100644 --- a/LeanPool/Sundogcert/VarWheel.lean +++ b/LeanPool/Sundogcert/VarWheel.lean @@ -56,7 +56,7 @@ import Mathlib.Tactic.SetLike by kernel `decide` — AXIOM-CLEAN (no `Lean.ofReduceBool`; we use `decide`, never `native_decide`). -/ -@[expose] public section +public section namespace Sundog.VarWheel @@ -69,7 +69,7 @@ abbrev Selection (m : ℕ) := Fin m → Bool /-- The internal node `a j` is covered EXACTLY ONCE: exactly one of `σ j = true` (the positive triple `t_j` touches `a j`) and `σ (j-1) = false` (the negative triple `t⁻_(j-1)` touches `a j`) holds. -/ -def aCoveredOnce (σ : Selection m) (j : Fin m) : Prop := +@[expose] def aCoveredOnce (σ : Selection m) (j : Fin m) : Prop := Xor (σ j = true) (σ (j - 1) = false) /-- The covered-once exclusive-or collapses to the local agreement `σ j = σ (j-1)`: @@ -80,7 +80,7 @@ lemma aCoveredOnce_iff (σ : Selection m) (j : Fin m) : cases h1 : σ j <;> cases h2 : σ (j - 1) <;> simp [Xor] /-- A valid internal cover: every internal node `a j` is covered exactly once. -/ -def ValidCover (σ : Selection m) : Prop := +@[expose] def ValidCover (σ : Selection m) : Prop := ∀ j : Fin m, aCoveredOnce σ j /-! ### Decidability. @@ -141,10 +141,10 @@ theorem validCover_iff_const (_hm : 0 < m) (σ : Selection m) : family of tips is left uncovered ("free") and thus available to the clause gadgets. -/ /-- The positive tip `posTip j` is free in state `σ` iff its triple `t_j` was NOT selected. -/ -def posTipFree (σ : Selection m) (j : Fin m) : Prop := σ j = false +@[expose] def posTipFree (σ : Selection m) (j : Fin m) : Prop := σ j = false /-- The negative tip `negTip j` is free in state `σ` iff its triple `t⁻_j` was NOT selected. -/ -def negTipFree (σ : Selection m) (j : Fin m) : Prop := σ j = true +@[expose] def negTipFree (σ : Selection m) (j : Fin m) : Prop := σ j = true omit [NeZero m] in /-- The all-true (one truth value) state frees every negative tip and no positive tip. -/ diff --git a/LeanPool/SyntheticEuclid4.lean b/LeanPool/SyntheticEuclid4.lean index 6b44e5e18c..6c33853a22 100644 --- a/LeanPool/SyntheticEuclid4.lean +++ b/LeanPool/SyntheticEuclid4.lean @@ -24,7 +24,7 @@ Tags: euclidean-geometry, synthetic-geometry, pythagorean-theorem MSC: 51M04 -/ -@[expose] public section +public section /-! A formalization of Book I of Euclid's *Elements* in Lean 4, built on Avigad, diff --git a/LeanPool/SyntheticEuclid4/Axioms.lean b/LeanPool/SyntheticEuclid4/Axioms.lean index d321d7efc2..f33901f93c 100644 --- a/LeanPool/SyntheticEuclid4/Axioms.lean +++ b/LeanPool/SyntheticEuclid4/Axioms.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.SetLike Axioms of synthetic geometry -/ -@[expose] public section +public section /-! Universes for points lines and circles-/ universe u @@ -222,25 +222,25 @@ variable [i : IncidenceGeometry] open IncidenceGeometry -------------------------------------------------- Definitions ----------------------------------- /-- Points being on different sides of a line -/ -def diffside a b L := ¬OnLine a L ∧ ¬OnLine b L ∧ ¬SameSide a b L +@[expose] def diffside a b L := ¬OnLine a L ∧ ¬OnLine b L ∧ ¬SameSide a b L /-- A point being outside a circle -/ -def outCircle a α := ¬OnCircle a α ∧ ¬InCircle a α +@[expose] def outCircle a α := ¬OnCircle a α ∧ ¬InCircle a α /-- Points being colinear -/ -def colinear a b c := ∃ L : Line, OnLine a L ∧ OnLine b L ∧ OnLine c L +@[expose] def colinear a b c := ∃ L : Line, OnLine a L ∧ OnLine b L ∧ OnLine c L /-- Definition of a triangle -/ -def triangle a b c := ¬colinear a b c +@[expose] def triangle a b c := ¬colinear a b c /-- Definition of an equilateral triangle -/ -def eqTri a b c := triangle a b c ∧ length a b = length a c ∧ length b a = length b c +@[expose] def eqTri a b c := triangle a b c ∧ length a b = length a c ∧ length b a = length b c ∧ length c a = length c b /-- Definition of an isosoles triangle -/ -def isoTri a b c := triangle a b c ∧ length a b = length a c +@[expose] def isoTri a b c := triangle a b c ∧ length a b = length a c /-- Definition of parallel -/ -def para M N := ∀ e, ¬OnLine e M ∨ ¬OnLine e N +@[expose] def para M N := ∀ e, ¬OnLine e M ∨ ¬OnLine e N /-- Definition of parallelogram -/ -def paragram a b c d L M N O := OnLine a L ∧ OnLine b L ∧ OnLine b M ∧ +@[expose] def paragram a b c d L M N O := OnLine a L ∧ OnLine b L ∧ OnLine b M ∧ OnLine c M ∧ OnLine c N ∧ OnLine d N ∧ OnLine d O ∧ OnLine a O ∧ para L N ∧ para M O /-- Definition of a square -/ -def square a b c d := length a b = length b c ∧ length a b = length c d ∧ +@[expose] def square a b c d := length a b = length b c ∧ length a b = length c d ∧ length a b = length d a ∧ angle a b c = rightangle ∧ angle b c d = rightangle ∧ angle c d a = rightangle ∧ angle d a b = rightangle diff --git a/LeanPool/SyntheticEuclid4/SyntheticEuclid4.lean b/LeanPool/SyntheticEuclid4/SyntheticEuclid4.lean index 9b0328183f..ae2f075049 100644 --- a/LeanPool/SyntheticEuclid4/SyntheticEuclid4.lean +++ b/LeanPool/SyntheticEuclid4/SyntheticEuclid4.lean @@ -21,7 +21,7 @@ In this file we prove the Pythagorean theorem (Euclid I.47) using Avigad's axiom geometry. -/ -@[expose] public section +public section namespace SyntheticEuclid4 diff --git a/LeanPool/SyntheticEuclid4/Tactics.lean b/LeanPool/SyntheticEuclid4/Tactics.lean index 554c9914ac..1f6d87ff32 100644 --- a/LeanPool/SyntheticEuclid4/Tactics.lean +++ b/LeanPool/SyntheticEuclid4/Tactics.lean @@ -21,7 +21,7 @@ the building blocks for the `perm`/`perma`/`linperm` tactics defined in `PermTactics`. -/ -@[expose] public section +public section namespace SyntheticEuclid4 diff --git a/LeanPool/ThreeGap.lean b/LeanPool/ThreeGap.lean index c3186c3322..dbab36b5b3 100644 --- a/LeanPool/ThreeGap.lean +++ b/LeanPool/ThreeGap.lean @@ -21,4 +21,4 @@ Tags: number-theory, kronecker-sequences, three-gap MSC: 11J71 -/ -@[expose] public section +public section diff --git a/LeanPool/ThreeGap/ChevallierCount.lean b/LeanPool/ThreeGap/ChevallierCount.lean index ed2987c285..55ec30dc26 100644 --- a/LeanPool/ThreeGap/ChevallierCount.lean +++ b/LeanPool/ThreeGap/ChevallierCount.lean @@ -38,7 +38,7 @@ This file isolates the count as a pure statement about a cost function `r : ℕ Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.Chevallier @@ -93,7 +93,7 @@ theorem record_floor (hr : RecordsContinue r) (i : ℕ) {j : ℕ} (hj1 : 1 ≤ j /-- The nearest-neighbour distance of the `q`-th point among `{x_0,…,x_N}`, abstractly: the minimum cost `min_{1 ≤ j ≤ max(q, N−q)} r(j)` (junk `0` outside the valid range). -/ -noncomputable def gapVal (N q : ℕ) : ℝ := +@[expose] noncomputable def gapVal (N q : ℕ) : ℝ := if h : (Finset.Icc 1 (max q (N - q))).Nonempty then (Finset.Icc 1 (max q (N - q))).inf' h r else 0 diff --git a/LeanPool/ThreeGap/ChevallierGapBound.lean b/LeanPool/ThreeGap/ChevallierGapBound.lean index 83bd105cee..c5f8954e7e 100644 --- a/LeanPool/ThreeGap/ChevallierGapBound.lean +++ b/LeanPool/ThreeGap/ChevallierGapBound.lean @@ -41,7 +41,7 @@ and the growth inequality) are the substantial geometric pieces still to formali Axiom-clean; elementary. -/ -@[expose] public section +public section namespace ThreeGap.Chevallier @@ -62,7 +62,7 @@ theorem for the relevant `α` — the best approximations improve without bound) `q ≥ 1` is essential: the cost `r 0 = δ_0 = 0` is the global minimum (the zero denominator has zero defect), so no `q'` can beat it — a `∀ q` version would be vacuously unsatisfiable. Denominators are `≥ 1` throughout (`bestDenom` starts at `1`), so this is exactly the right hypothesis. -/ -def RecordsContinue : Prop := ∀ q : ℕ, 1 ≤ q → ∃ q' > q, r q' < r q +@[expose] def RecordsContinue : Prop := ∀ q : ℕ, 1 ≤ q → ∃ q' > q, r q' < r q open Classical in /-- **The best-approximation denominators** `qₙ`, with the positivity proof carried alongside (so @@ -85,7 +85,7 @@ theorem bestDenom_pos (hr : RecordsContinue r) (n : ℕ) : 1 ≤ bestDenom r hr /-- The defining unfolding of `bestDenom` at a successor (with the positivity proof discharged). -/ theorem bestDenom_succ (hr : RecordsContinue r) (n : ℕ) : - bestDenom r hr (n + 1) = Nat.find (hr (bestDenom r hr n) (bestDenom_pos r hr n)) := rfl + bestDenom r hr (n + 1) = Nat.find (hr (bestDenom r hr n) (bestDenom_pos r hr n)) := by rfl /-- Each best-approximation denominator is strictly larger than the previous. -/ theorem bestDenom_lt (hr : RecordsContinue r) (n : ℕ) : diff --git a/LeanPool/ThreeGap/DeltaCost.lean b/LeanPool/ThreeGap/DeltaCost.lean index 924a918755..0dc8cd091c 100644 --- a/LeanPool/ThreeGap/DeltaCost.lean +++ b/LeanPool/ThreeGap/DeltaCost.lean @@ -45,7 +45,7 @@ distance), handled separately. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.DeltaCost @@ -78,7 +78,7 @@ theorem delta_attained (α : Fin d → ℝ) (q : ℤ) : _ ≤ ‖rem α q p‖ := norm_le_pi_norm _ k /-- **The defect cost** as a function of a natural-number denominator: `r q = delta α q`. -/ -noncomputable def deltaCost (α : Fin d → ℝ) : ℕ → ℝ := fun q => delta α (q : ℤ) +@[expose] noncomputable def deltaCost (α : Fin d → ℝ) : ℕ → ℝ := fun q => delta α (q : ℤ) /-- `hattain` for the record denominators: at each `q_k = bestDenom`, the defect is attained by the nearest integer vector. -/ diff --git a/LeanPool/ThreeGap/EuclideanAngle.lean b/LeanPool/ThreeGap/EuclideanAngle.lean index 378eb5007a..474568a8b8 100644 --- a/LeanPool/ThreeGap/EuclideanAngle.lean +++ b/LeanPool/ThreeGap/EuclideanAngle.lean @@ -40,7 +40,7 @@ This file isolates the fully-proven angular crux; the packing count on top of it geometric step (sharp form = Romanov). Axiom-clean; elementary. -/ -@[expose] public section +public section namespace ThreeGap.EuclideanAngle diff --git a/LeanPool/ThreeGap/EuclideanDefect.lean b/LeanPool/ThreeGap/EuclideanDefect.lean index 889f1a6fcd..b1dbaa23c3 100644 --- a/LeanPool/ThreeGap/EuclideanDefect.lean +++ b/LeanPool/ThreeGap/EuclideanDefect.lean @@ -23,7 +23,7 @@ over that finite set realises the infimum. `deltaN_euclNorm_attained`: `∃ p, euclNorm n (rem α q p) = δ_q`. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox diff --git a/LeanPool/ThreeGap/EuclideanFiveDistanceSharp.lean b/LeanPool/ThreeGap/EuclideanFiveDistanceSharp.lean index 8df90b508f..3f52007aac 100644 --- a/LeanPool/ThreeGap/EuclideanFiveDistanceSharp.lean +++ b/LeanPool/ThreeGap/EuclideanFiveDistanceSharp.lean @@ -25,7 +25,7 @@ replacing `2 qₙ ≤ qₙ₊₅`; feeding it through Chevallier's count (`cheva yields `≤ 4 + 1 = 5` distances. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.EuclideanRecords diff --git a/LeanPool/ThreeGap/EuclideanFiveDistanceSharpArith.lean b/LeanPool/ThreeGap/EuclideanFiveDistanceSharpArith.lean index edfc19b19d..d0a49ef159 100644 --- a/LeanPool/ThreeGap/EuclideanFiveDistanceSharpArith.lean +++ b/LeanPool/ThreeGap/EuclideanFiveDistanceSharpArith.lean @@ -58,7 +58,7 @@ with record minima at `d = 1, 7, 8, 10, 11` (values `73 > 68 > 61 > 50 > 17`). T `five_le_card_image_of_strictAnti_chain` below is the foundational R3 step (axiom-clean). -/ -@[expose] public section +public section namespace ThreeGap.EuclideanRecords diff --git a/LeanPool/ThreeGap/EuclideanGrowth.lean b/LeanPool/ThreeGap/EuclideanGrowth.lean index a3abd78f96..a54a8bf4d0 100644 --- a/LeanPool/ThreeGap/EuclideanGrowth.lean +++ b/LeanPool/ThreeGap/EuclideanGrowth.lean @@ -26,7 +26,7 @@ homogeneity come for free from that being a (continuous) linear equivalence. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox @@ -34,7 +34,7 @@ variable {d : ℕ} /-- The **Euclidean (L²) norm** on `Fin d → ℝ`, transported from `EuclideanSpace ℝ (Fin d)` along `EuclideanSpace.equiv`. Concretely `euclNorm x = √(∑ i, (x i)²)`. -/ -noncomputable def euclNorm (d : ℕ) (x : Fin d → ℝ) : ℝ := +@[expose] noncomputable def euclNorm (d : ℕ) (x : Fin d → ℝ) : ℝ := ‖(EuclideanSpace.equiv (Fin d) ℝ).symm x‖ theorem euclNorm_nonneg (x : Fin d → ℝ) : 0 ≤ euclNorm d x := norm_nonneg _ diff --git a/LeanPool/ThreeGap/EuclideanGrowthFive.lean b/LeanPool/ThreeGap/EuclideanGrowthFive.lean index afe3197c86..4069d7b950 100644 --- a/LeanPool/ThreeGap/EuclideanGrowthFive.lean +++ b/LeanPool/ThreeGap/EuclideanGrowthFive.lean @@ -38,7 +38,7 @@ sequence remaining instantiation step. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox diff --git a/LeanPool/ThreeGap/EuclideanGrowthFour.lean b/LeanPool/ThreeGap/EuclideanGrowthFour.lean index f1267aad9f..89a03add94 100644 --- a/LeanPool/ThreeGap/EuclideanGrowthFour.lean +++ b/LeanPool/ThreeGap/EuclideanGrowthFour.lean @@ -26,7 +26,7 @@ shortest record `r(qₙ₊₄)` cannot lie in the open cone of two others, becau (`hbest`, the index difference lies in `(0, qₖ)`) forces `‖r(qₙ₊₄) − vⱼ − vₖ‖ > ‖vₖ‖`. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox diff --git a/LeanPool/ThreeGap/EuclideanNN.lean b/LeanPool/ThreeGap/EuclideanNN.lean index 439d12459f..60c5c544c1 100644 --- a/LeanPool/ThreeGap/EuclideanNN.lean +++ b/LeanPool/ThreeGap/EuclideanNN.lean @@ -27,7 +27,7 @@ it is stated here generically for any symmetric `c : ℤ → ℝ` and instantiat `c = deltaN (euclNorm 2) α` (symmetric by `deltaN_neg`). Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.EuclideanRecords @@ -99,6 +99,7 @@ theorem gapVal_eq_nnDistC (c : ℤ → ℝ) (hsymm : ∀ t : ℤ, c (-t) = c t) /-- **The Euclidean torus nearest-neighbour distance** of `qα` among `{0, α, …, Nα}`, via `d_𝕋(iα, jα) = deltaN (euclNorm 2) α (i − j)`. -/ +@[expose] noncomputable def nnDistE (α : Fin 2 → ℝ) (N q : ℕ) : ℝ := nnDistC (deltaN (euclNorm 2) α) N q /-- **`g₂ ≤ 6` for the actual Euclidean nearest-neighbour distances on `𝕋²` (unconditional).** For diff --git a/LeanPool/ThreeGap/EuclideanPacking.lean b/LeanPool/ThreeGap/EuclideanPacking.lean index 70b48dd503..dac9995e1e 100644 --- a/LeanPool/ThreeGap/EuclideanPacking.lean +++ b/LeanPool/ThreeGap/EuclideanPacking.lean @@ -37,7 +37,7 @@ argument. Axiom-clean; elementary. -/ -@[expose] public section +public section namespace ThreeGap.EuclideanPacking diff --git a/LeanPool/ThreeGap/EuclideanRecords.lean b/LeanPool/ThreeGap/EuclideanRecords.lean index 42dfa3c2ca..a16eca4ed1 100644 --- a/LeanPool/ThreeGap/EuclideanRecords.lean +++ b/LeanPool/ThreeGap/EuclideanRecords.lean @@ -30,7 +30,7 @@ Dirichlet via `deltaN(euclNorm 2) α q ≤ √2 · delta α q` (the Euclidean no in the plane). The sharp `g₂ ≤ 5` needs Romanov's `K = 4`; this is the `K = 5` bound. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.EuclideanRecords @@ -38,6 +38,7 @@ open scoped Real open ThreeGap.SimApprox ThreeGap.Chevallier ThreeGap.DeltaCost ThreeGap.SimDirichlet /-- The **Euclidean defect cost** as a function of a natural denominator. -/ +@[expose] noncomputable def deltaE (α : Fin 2 → ℝ) : ℕ → ℝ := fun q => deltaN (euclNorm 2) α (q : ℤ) /-- The Euclidean norm is at most `√2 ·` the sup norm in the plane. -/ diff --git a/LeanPool/ThreeGap/FiveDistance.lean b/LeanPool/ThreeGap/FiveDistance.lean index 6e64c97348..5db9373b10 100644 --- a/LeanPool/ThreeGap/FiveDistance.lean +++ b/LeanPool/ThreeGap/FiveDistance.lean @@ -24,7 +24,7 @@ and `EuclideanAngle.angle_ge_pi_div_three_of_norm_sub_gt` (the record-angle bound). -/ -@[expose] public section +public section namespace ThreeGap.FiveDistance diff --git a/LeanPool/ThreeGap/FiveDistanceHM.lean b/LeanPool/ThreeGap/FiveDistanceHM.lean index 114db52fb9..80ca9fb1c6 100644 --- a/LeanPool/ThreeGap/FiveDistanceHM.lean +++ b/LeanPool/ThreeGap/FiveDistanceHM.lean @@ -39,7 +39,7 @@ See the module docstring of `RomanovK4` and `MATHLIB_SUCCESSIVE_MINIMA_SCOPE.md` (Romanov / lattice-minima) routes; this file pursues the elementary HM Theorem-8 route. -/ -@[expose] public section +public section namespace ThreeGap.FiveDistanceHM diff --git a/LeanPool/ThreeGap/LinftyFiveDistanceSharpArith.lean b/LeanPool/ThreeGap/LinftyFiveDistanceSharpArith.lean index 670a5c4e3c..7406839702 100644 --- a/LeanPool/ThreeGap/LinftyFiveDistanceSharpArith.lean +++ b/LeanPool/ThreeGap/LinftyFiveDistanceSharpArith.lean @@ -46,7 +46,7 @@ comparison is between *integers*, and the rational→irrational transport gap is are reused verbatim from the Euclidean development. -/ -@[expose] public section +public section namespace ThreeGap.LinftyRecords diff --git a/LeanPool/ThreeGap/LinftyThreeTorusNine.lean b/LeanPool/ThreeGap/LinftyThreeTorusNine.lean index 38546621eb..a5b87fb78d 100644 --- a/LeanPool/ThreeGap/LinftyThreeTorusNine.lean +++ b/LeanPool/ThreeGap/LinftyThreeTorusNine.lean @@ -38,7 +38,7 @@ three coordinates; everything is exact modular arithmetic — no square roots. -/ -@[expose] public section +public section namespace ThreeGap.LinftyRecords3 diff --git a/LeanPool/ThreeGap/ModTwoGrowth.lean b/LeanPool/ThreeGap/ModTwoGrowth.lean index 0ffa334b94..2f5269c060 100644 --- a/LeanPool/ThreeGap/ModTwoGrowth.lean +++ b/LeanPool/ThreeGap/ModTwoGrowth.lean @@ -34,7 +34,7 @@ five-distance theorem. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox diff --git a/LeanPool/ThreeGap/SimultaneousApprox.lean b/LeanPool/ThreeGap/SimultaneousApprox.lean index 679a4aebd6..9997a5fdd1 100644 --- a/LeanPool/ThreeGap/SimultaneousApprox.lean +++ b/LeanPool/ThreeGap/SimultaneousApprox.lean @@ -40,7 +40,7 @@ fit) is Ermakov's Lemmas 1–2, the cited geometric completion. Norm-agnostic: h Axiom-clean; elementary. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox @@ -48,16 +48,16 @@ variable {n : ℕ} /-- The integer-vector translate of `q • α` by `p`, as an element of `Fin n → ℝ`. Its norm over all `p ∈ ℤⁿ` is minimised at the best approximation; here we only need the value and its lower bound. -/ -noncomputable def rem (α : Fin n → ℝ) (q : ℤ) (p : Fin n → ℤ) : Fin n → ℝ := +@[expose] noncomputable def rem (α : Fin n → ℝ) (q : ℤ) (p : Fin n → ℤ) : Fin n → ℝ := (q : ℝ) • α - (fun k => (p k : ℝ)) /-- The **approximation defect** `δ_q = inf_{p ∈ ℤⁿ} ‖q • α − p‖`. -/ -noncomputable def delta (α : Fin n → ℝ) (q : ℤ) : ℝ := +@[expose] noncomputable def delta (α : Fin n → ℝ) (q : ℤ) : ℝ := ⨅ p : Fin n → ℤ, ‖rem α q p‖ /-- The **approximation defect for an arbitrary norm `N`**: `δ^N_q = inf_{p ∈ ℤⁿ} N (q • α − p)`. (`delta` is the `N = ‖·‖` sup-norm case.) -/ -noncomputable def deltaN (N : (Fin n → ℝ) → ℝ) (α : Fin n → ℝ) (q : ℤ) : ℝ := +@[expose] noncomputable def deltaN (N : (Fin n → ℝ) → ℝ) (α : Fin n → ℝ) (q : ℤ) : ℝ := ⨅ p : Fin n → ℤ, N (rem α q p) /-- For a nonnegative `N`, the defect `δ^N_q` is a lower bound on every concrete approximation. -/ diff --git a/LeanPool/ThreeGap/SimultaneousDirichlet.lean b/LeanPool/ThreeGap/SimultaneousDirichlet.lean index e0ae3d1c4d..d596497b2e 100644 --- a/LeanPool/ThreeGap/SimultaneousDirichlet.lean +++ b/LeanPool/ThreeGap/SimultaneousDirichlet.lean @@ -33,7 +33,7 @@ coordinate, **with no remaining hypothesis** (`nnDist_count_unconditional`, `nnDist_count_plane_unconditional`). Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimDirichlet diff --git a/LeanPool/ThreeGap/SupNormGrowth.lean b/LeanPool/ThreeGap/SupNormGrowth.lean index aa6adcbd2b..a08ba704be 100644 --- a/LeanPool/ThreeGap/SupNormGrowth.lean +++ b/LeanPool/ThreeGap/SupNormGrowth.lean @@ -36,7 +36,7 @@ survey (§2.4.1, attributed to Lagarias): No convex geometry, no kissing number — purely the pigeonhole. Axiom-clean. -/ -@[expose] public section +public section namespace ThreeGap.SimApprox diff --git a/LeanPool/ThreeGap/TorusReduction.lean b/LeanPool/ThreeGap/TorusReduction.lean index df9ea4aa5d..17bf4507ed 100644 --- a/LeanPool/ThreeGap/TorusReduction.lean +++ b/LeanPool/ThreeGap/TorusReduction.lean @@ -34,7 +34,7 @@ distinct **actual** nearest-neighbour distances: `g_∞ ≤ 2^d + 1`. Axiom-clean; elementary. -/ -@[expose] public section +public section namespace ThreeGap.DeltaCost diff --git a/LeanPool/Turan3.lean b/LeanPool/Turan3.lean index 96e96f174e..b79bc9a409 100644 --- a/LeanPool/Turan3.lean +++ b/LeanPool/Turan3.lean @@ -19,4 +19,4 @@ Tags: graph-theory, combinatorics, turan-theorem, extremal-graph-theory MSC: 05C35 -/ -@[expose] public section +public section diff --git a/LeanPool/Turan3/Turans3rdProof.lean b/LeanPool/Turan3/Turans3rdProof.lean index 6504d75e3e..ba5fc6049a 100644 --- a/LeanPool/Turan3/Turans3rdProof.lean +++ b/LeanPool/Turan3/Turans3rdProof.lean @@ -21,7 +21,7 @@ upper bound `(1/2)(1 - 1/(p-1)) n²` on the number of edges. All declarations live in the `Turan3` namespace. -/ -@[expose] public section +public section namespace Turan3 diff --git a/LeanPool/TwoColoringOneRound.lean b/LeanPool/TwoColoringOneRound.lean index 63aefd915e..05cba72026 100644 --- a/LeanPool/TwoColoringOneRound.lean +++ b/LeanPool/TwoColoringOneRound.lean @@ -26,7 +26,7 @@ Tags: distributed-computing, graph-coloring, randomized-algorithms, formal-verif MSC: 68W15, 05C15 -/ -@[expose] public section +public section /-! ## Mathematical overview diff --git a/LeanPool/TwoColoringOneRound/API.lean b/LeanPool/TwoColoringOneRound/API.lean index adbcf6033d..73039eab27 100644 --- a/LeanPool/TwoColoringOneRound/API.lean +++ b/LeanPool/TwoColoringOneRound/API.lean @@ -29,7 +29,7 @@ This is the recommended entry point for humans. (bounds on `Distributed2Coloring.ClassicalAlgorithm.pStar`) -/ -@[expose] public section +public section namespace Distributed2Coloring end Distributed2Coloring diff --git a/LeanPool/TwoColoringOneRound/Definitions.lean b/LeanPool/TwoColoringOneRound/Definitions.lean index 3fb44c2cbc..af0c4fb1e3 100644 --- a/LeanPool/TwoColoringOneRound/Definitions.lean +++ b/LeanPool/TwoColoringOneRound/Definitions.lean @@ -18,7 +18,7 @@ Most internal development lives under `Distributed2Coloring.LowerBound` and they want to follow the detailed proofs. -/ -@[expose] public section +public section namespace Distributed2Coloring @@ -63,11 +63,11 @@ The event that a fixed oriented edge is monochromatic. We represent an oriented edge by four consecutive i.i.d. labels `x 0, x 1, x 2, x 3`; the two endpoints apply the same local rule to the overlapping triples `(x0,x1,x2)` and `(x1,x2,x3)`. -/ -def pEvent (alg : ClassicalAlgorithm) : Set (Samples 4) := +@[expose] def pEvent (alg : ClassicalAlgorithm) : Set (Samples 4) := {x | alg.f (x 0, x 1, x 2) = alg.f (x 1, x 2, x 3)} /-- The monochromatic-edge probability of a one-round algorithm on the directed cycle. -/ -noncomputable def p (alg : ClassicalAlgorithm) : ENNReal := +@[expose] noncomputable def p (alg : ClassicalAlgorithm) : ENNReal := (volume : Measure (Samples 4)) (pEvent alg) lemma measurable_fstTriple : diff --git a/LeanPool/TwoColoringOneRound/LowerBound.lean b/LeanPool/TwoColoringOneRound/LowerBound.lean index 778e7109b7..3d57410eee 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound.lean @@ -41,4 +41,4 @@ import Mathlib.Tactic.Positivity.Finset This module re-exports the vendored formalization imported from `2-coloring-1-round`. -/ -@[expose] public section +public section diff --git a/LeanPool/TwoColoringOneRound/LowerBound/Certificate.lean b/LeanPool/TwoColoringOneRound/LowerBound/Certificate.lean index 8fa61ddc90..4e69026922 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/Certificate.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/Certificate.lean @@ -26,7 +26,7 @@ Planned approach (to be implemented): * translate the resulting edge-correlation bound into a monochromatic-edge bound. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -36,11 +36,11 @@ namespace N1000000 open Distributed2Coloring.LowerBound.N1000000Data /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def coeffAt (a : Array Int) (i : Nat) : Int := +@[expose] def coeffAt (a : Array Int) (i : Nat) : Int := a.getD i 0 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def innerD2 (A B : Array (Array Int)) : Int := +@[expose] def innerD2 (A B : Array (Array Int)) : Int := let rows := A.size let cols := if rows = 0 then 0 else (A.getD 0 #[]).size (Finset.range rows).sum fun i => @@ -48,25 +48,25 @@ def innerD2 (A B : Array (Array Int)) : Int := (A.getD i #[]).getD j 0 * (B.getD i #[]).getD j 0 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def linNumD (i : Nat) : Int := +@[expose] def linNumD (i : Nat) : Int := muSupport.foldl (fun acc t => acc + coeffAt t.2.1 i * t.2.2) 0 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def psdNumD2 (i : Nat) : Int := +@[expose] def psdNumD2 (i : Nat) : Int := (Finset.range SiBlocks.size).sum fun r => innerD2 (SiBlocks.getD r #[] |>.getD i #[]) (ZBlocks.getD r #[]) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def c (i : Nat) : Int := +@[expose] def c (i : Nat) : Int := if i = edgeVar then 1 else 0 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def stationarityLHSD2 (i : Nat) : Int := +@[expose] def stationarityLHSD2 (i : Nat) : Int := -- `linNumD i` represents the numerator over `D`; multiply by `D` to put it over `D^2`. (linNumD i) * (D : Int) - psdNumD2 i /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def dualObjectiveComputedD2 : Int := +@[expose] def dualObjectiveComputedD2 : Int := let muSumD : Int := muSupport.foldl (fun acc t => acc + t.2.2) 0 let psdSumD2 : Int := (Finset.range S0Blocks.size).sum fun r => diff --git a/LeanPool/TwoColoringOneRound/LowerBound/CorrAvgMatrix.lean b/LeanPool/TwoColoringOneRound/LowerBound/CorrAvgMatrix.lean index 1d59503f00..decb067d77 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/CorrAvgMatrix.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/CorrAvgMatrix.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.CorrAvgMatrix -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -29,7 +29,7 @@ def corrMatrix {n : Nat} (f : Coloring n) : Matrix (Vertex n) (Vertex n) Correla fun u v => corr f u v /-- The orbit-averaged correlation kernel as a matrix indexed by vertices. -/ -noncomputable def corrAvgMatrix {n : Nat} (f : Coloring n) : +@[expose] noncomputable def corrAvgMatrix {n : Nat} (f : Coloring n) : Matrix (Vertex n) (Vertex n) Correlation.Q := fun u v => corrAvg f u v diff --git a/LeanPool/TwoColoringOneRound/LowerBound/Correlation.lean b/LeanPool/TwoColoringOneRound/LowerBound/Correlation.lean index 36f78133f9..5ae5d17666 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/Correlation.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/Correlation.lean @@ -28,7 +28,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.Correlation -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -67,17 +67,17 @@ instance (n : Nat) : MulAction (G n) (Edge n) where (σ • e).1 i = σ (e.1 i) := rfl /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def spin (b : Bool) : Q := +@[expose] def spin (b : Bool) : Q := if b then (-1 : Q) else (1 : Q) lemma spin_mul_self (b : Bool) : spin b * spin b = 1 := by cases b <;> simp [spin] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def corr {n : Nat} (f : Coloring n) (u v : Vertex n) : Q := +@[expose] def corr {n : Nat} (f : Coloring n) (u v : Vertex n) : Q := spin (f u) * spin (f v) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def corrAvg {n : Nat} (f : Coloring n) (u v : Vertex n) : Q := +@[expose] noncomputable def corrAvg {n : Nat} (f : Coloring n) (u v : Vertex n) : Q := (∑ σ : G n, corr f (σ • u) (σ • v)) / (Fintype.card (G n) : Q) lemma cardG_pos (n : Nat) : 0 < (Fintype.card (G n) : Q) := by diff --git a/LeanPool/TwoColoringOneRound/LowerBound/Defs.lean b/LeanPool/TwoColoringOneRound/LowerBound/Defs.lean index ebaa002083..88ed1f8eaa 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/Defs.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/Defs.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.Defs -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -42,22 +42,22 @@ abbrev Edge (n : Nat) := { e : Tuple 4 n // Function.Injective e } namespace Vertex /-- First coordinate `a` of a vertex `(a,b,c)`. -/ -def a {n : Nat} (v : Vertex n) : Sym n := v.1 ⟨0, by decide⟩ +@[expose] def a {n : Nat} (v : Vertex n) : Sym n := v.1 ⟨0, by decide⟩ /-- Second coordinate `b` of a vertex `(a,b,c)`. -/ -def b {n : Nat} (v : Vertex n) : Sym n := v.1 ⟨1, by decide⟩ +@[expose] def b {n : Nat} (v : Vertex n) : Sym n := v.1 ⟨1, by decide⟩ /-- Third coordinate `c` of a vertex `(a,b,c)`. -/ -def c {n : Nat} (v : Vertex n) : Sym n := v.1 ⟨2, by decide⟩ +@[expose] def c {n : Nat} (v : Vertex n) : Sym n := v.1 ⟨2, by decide⟩ end Vertex namespace Edge /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def srcIndex (i : Fin 3) : Fin 4 := +@[expose] def srcIndex (i : Fin 3) : Fin 4 := ⟨i.1, Nat.lt_trans i.2 (by decide)⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def dstIndex (i : Fin 3) : Fin 4 := +@[expose] def dstIndex (i : Fin 3) : Fin 4 := ⟨i.1 + 1, Nat.succ_lt_succ i.2⟩ @[simp] lemma srcIndex_zero : srcIndex (0 : Fin 3) = (0 : Fin 4) := by @@ -85,7 +85,7 @@ def dstIndex (i : Fin 3) : Fin 4 := rfl /-- Source vertex of an edge `(a,b,c,d)`, i.e. `(a,b,c)`. -/ -def src {n : Nat} (e : Edge n) : Vertex n := +@[expose] def src {n : Nat} (e : Edge n) : Vertex n := ⟨fun i => e.1 (srcIndex i), by intro i j hij have h4 : srcIndex i = srcIndex j := e.2 hij @@ -93,6 +93,7 @@ def src {n : Nat} (e : Edge n) : Vertex n := simpa [srcIndex] using congrArg Fin.val h4⟩ /-- Target vertex of an edge `(a,b,c,d)`, i.e. `(b,c,d)`. -/ +@[expose] def dst {n : Nat} (e : Edge n) : Vertex n := ⟨fun i => e.1 (dstIndex i), by intro i j hij @@ -102,7 +103,7 @@ def dst {n : Nat} (e : Edge n) : Vertex n := exact Nat.succ.inj hval⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def monochromatic {n : Nat} (f : Vertex n → Bool) (e : Edge n) : Prop := +@[expose] def monochromatic {n : Nat} (f : Vertex n → Bool) (e : Edge n) : Prop := f (src e) = f (dst e) instance {n : Nat} (f : Vertex n → Bool) (e : Edge n) : Decidable (monochromatic f e) := by @@ -115,31 +116,31 @@ end Edge abbrev Coloring (n : Nat) := Vertex n → Bool /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def edgeCount (n : Nat) : Nat := Fintype.card (Edge n) +@[expose] def edgeCount (n : Nat) : Nat := Fintype.card (Edge n) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def monoEdges {n : Nat} (f : Coloring n) : Finset (Edge n) := +@[expose] def monoEdges {n : Nat} (f : Coloring n) : Finset (Edge n) := (Finset.univ : Finset (Edge n)).filter (Edge.monochromatic f) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def monoCount {n : Nat} (f : Coloring n) : Nat := +@[expose] def monoCount {n : Nat} (f : Coloring n) : Nat := (monoEdges f).card /-- Fraction of monochromatic directed edges under `f`. -/ -def monoFraction {n : Nat} (f : Coloring n) : ℚ := +@[expose] def monoFraction {n : Nat} (f : Coloring n) : ℚ := (monoCount f : ℚ) / (edgeCount n : ℚ) /-- Convert a coloring to a sign labeling `±1`. -/ -def signOfColoring {n : Nat} (f : Coloring n) : Vertex n → Int := +@[expose] def signOfColoring {n : Nat} (f : Coloring n) : Vertex n → Int := fun v => if f v then (-1) else (1) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def edgeCorrSum {n : Nat} (f : Coloring n) : Int := +@[expose] def edgeCorrSum {n : Nat} (f : Coloring n) : Int := (Finset.univ : Finset (Edge n)).sum fun e => (signOfColoring f (Edge.src e)) * (signOfColoring f (Edge.dst e)) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def edgeCorrelation {n : Nat} (f : Coloring n) : ℚ := +@[expose] def edgeCorrelation {n : Nat} (f : Coloring n) : ℚ := (edgeCorrSum f : ℚ) / (edgeCount n : ℚ) lemma signOfColoring_sq {n : Nat} (f : Coloring n) (v : Vertex n) : diff --git a/LeanPool/TwoColoringOneRound/LowerBound/EdgePatterns.lean b/LeanPool/TwoColoringOneRound/LowerBound/EdgePatterns.lean index a23f94b45f..17619cb149 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/EdgePatterns.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/EdgePatterns.lean @@ -30,7 +30,7 @@ These are used in auxiliary “sanity check” and “upper bound” files to av case-bashy equivalence proofs. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -45,19 +45,19 @@ abbrev Small : Type := Set.Iio two abbrev Big : Type := Set.Ici two /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def Pat0000 (e : Edge n) : Prop := +@[expose] def Pat0000 (e : Edge n) : Prop := e.1 0 < two ∧ e.1 1 < two ∧ e.1 2 < two ∧ e.1 3 < two /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def Pat1111 (e : Edge n) : Prop := +@[expose] def Pat1111 (e : Edge n) : Prop := two ≤ e.1 0 ∧ two ≤ e.1 1 ∧ two ≤ e.1 2 ∧ two ≤ e.1 3 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def Pat1001 (e : Edge n) : Prop := +@[expose] def Pat1001 (e : Edge n) : Prop := two ≤ e.1 0 ∧ e.1 1 < two ∧ e.1 2 < two ∧ two ≤ e.1 3 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def Pat0110 (e : Edge n) : Prop := +@[expose] def Pat0110 (e : Edge n) : Prop := e.1 0 < two ∧ two ≤ e.1 1 ∧ two ≤ e.1 2 ∧ e.1 3 < two instance : DecidablePred (Pat0000 (two := two)) := by diff --git a/LeanPool/TwoColoringOneRound/LowerBound/LocalRule.lean b/LeanPool/TwoColoringOneRound/LowerBound/LocalRule.lean index da648f4776..d362d14cd8 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/LocalRule.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/LocalRule.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.LocalRule -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000AvailFrom.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000AvailFrom.lean index fee0c77da2..8c5b76c8c8 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000AvailFrom.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000AvailFrom.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000AvailFrom -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -34,7 +34,7 @@ abbrev n : Nat := N1000000Data.n abbrev SymN := Sym n /-- Symbols `≥ s` inside `Fin n`. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def AvailFrom (s : Nat) : Type := { x : SymN // s ≤ x.1 } diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionCompute.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionCompute.lean index bd89a33c8e..f84ac2dd14 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionCompute.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionCompute.lean @@ -30,7 +30,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionCompute -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeBase.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeBase.lean index 268e187c66..823d436a57 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeBase.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeBase.lean @@ -17,7 +17,7 @@ we replace a term `(s : ℚ) / (D : ℚ)` by the reduced fraction obtained by ca `g = gcd(|s|, D)`. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -48,6 +48,7 @@ abbrev iOfNat (m : Nat) : Int := Int.ofNat m private theorem tTr_lt (d : DirIdx) : tTr[d.1]! < masks.size := by fin_cases d <;> decide /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def invDir (d : DirIdx) : DirIdx := ⟨tTr[d.1]!, (by exact tTr_lt d)⟩ @@ -56,6 +57,7 @@ abbrev basisDen (r : Block) : Nat := moduleBasisDen[r.1]! /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def bValNum (r : Block) (j : Fin 3) (k : DirIdx) : Int := if j.1 < blockSizes[r.1]! then ((moduleBasisNum[r.1]!).getD j.1 #[]).getD (tTr[k.1]!) 0 @@ -67,7 +69,7 @@ def bVal (r : Block) (j : Fin 3) (k : DirIdx) : Q := (bValNum r j k : Q) / (basisDen r : Q) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def compBasis (r : Block) (d : DirIdx) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def compBasis (r : Block) (d : DirIdx) : Matrix (Fin 3) (Fin 3) Q := fun p q => (Finset.univ.sum fun k : DirIdx => (Finset.univ.sum fun a : DirIdx => @@ -126,6 +128,7 @@ theorem div_by_D_eq_div_by_div_gcd (s : Int) : simp_all /-- Integer numerator of a compressed basis entry, skipping zero basis coordinates. -/ +@[expose] def compBasisIntEntry (r : Block) (d : DirIdx) (p q : Fin 3) : Int := let rows := (Finset.univ : Finset DirIdx).filter fun k => bValNum r p k ≠ 0 let columns := (Finset.univ : Finset DirIdx).filter fun a => bValNum r q a ≠ 0 @@ -234,13 +237,14 @@ theorem compBasis_entry_eq_div (r : Block) (d : DirIdx) (p q : Fin 3) : simpa [den, mul_assoc, mul_left_comm, mul_comm] using hmain /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def compBasisSymm (r : Block) (d : DirIdx) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def compBasisSymm (r : Block) (d : DirIdx) : Matrix (Fin 3) (Fin 3) Q := if tTr[d.1]! = d.1 then compBasis r d else compBasis r d + compBasis r (invDir d) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def idDirIdx : DirIdx := ⟨idIndex, by decide⟩ @@ -248,6 +252,7 @@ private theorem varToOrbitRep_lt (i : Var) : varToOrbitRep[i.1]! < masks.size := fin_cases i <;> decide /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def varOrbit (i : Var) : DirIdx := ⟨varToOrbitRep[i.1]!, (by exact varToOrbitRep_lt i)⟩ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0.lean index 574a585e7b..142e9be209 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0Int.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0Int.lean index d6456cbccf..4e82abf5ed 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0Int.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0Int.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0Int -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock0.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock0.lean index b0858caa32..1de1ab4451 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock0.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock0.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock0 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock1.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock1.lean index 5535be1f6f..93001874e5 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock1.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock1.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock1 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock2.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock2.lean index 95a7a37b4f..5fbd2a2d22 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock2.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock2.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock2 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock3.lean index 78201462a1..1fe916def3 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock4.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock4.lean index 588015341d..0c98a320eb 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock4.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock4.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock4 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock5.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock5.lean index 0e0ed371a2..092133fd73 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock5.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock5.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock5 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock6.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock6.lean index 3afd84f781..17f9229dcc 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock6.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntBlock6.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntBlock6 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntGoal.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntGoal.lean index 253dfccef9..454207eccc 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntGoal.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeS0IntGoal.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeS0IntGoal -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSi.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSi.lean index 049e9ba5b3..9df658f09d 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSi.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSi.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSi -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiInt.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiInt.lean index ba3e600f31..b7e530db28 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiInt.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiInt.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiInt -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0.lean index 58a82c54ba..866c07a361 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars0to3.lean index 50477f1509..b314537067 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars12to15.lean index c16852693f..22b31ab5d7 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars16to19.lean index 5e3f8c8d3c..5aa9a1daa0 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars20to22.lean index 9338e13ec8..b348a929b6 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars4to7.lean index 9f4e5e32dd..7bacaccdde 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars8to11.lean index ea10715242..85ca98be63 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock0Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock0Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1.lean index 4812020ec3..4701a3472c 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars0to3.lean index b018273c8e..448e1012d7 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars12to15.lean index 7ebb467cf9..be82684688 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars16to19.lean index 1120ef0344..f08c855843 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars20to22.lean index c1cc7b875f..5ccc374d0b 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars4to7.lean index a8322c12f8..17b4d08380 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars8to11.lean index 5b14adad2e..6542cc00b6 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock1Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock1Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2.lean index 13045bbf0d..68152d01f8 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars0to3.lean index 2d82594826..53e7ec85f8 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars12to15.lean index 790649e9f8..3e64ae020c 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars16to19.lean index 485e61cba4..7e5aadf285 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars20to22.lean index 521f23c420..4120a8ef16 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars4to7.lean index 51d37768ff..6ed64f0028 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars8to11.lean index 61ee3e2be8..e9b4957230 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock2Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock2Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3.lean index 362dc5469a..54f045dbe9 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars0to3.lean index 837e598d74..5ac0c299b3 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars12to15.lean index 1bf66592ea..e725b73164 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars16to19.lean index a70b909141..10bf95b3ff 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars20to22.lean index ca31962201..53baf7c74f 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars4to7.lean index 6e2c14e7ee..4e9f9c4452 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars8to11.lean index 5e41863dc8..2a9da863f5 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock3Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock3Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4.lean index db80284b51..eb5f47a4a2 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars0to3.lean index dc40c032f0..6d868a2395 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars12to15.lean index 6e9a693d95..2ba7b4938d 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars16to19.lean index f3cabe5ed2..43b65ed99b 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars20to22.lean index eea514a6e1..3d7b352c5b 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars4to7.lean index b3998f8f5c..32086e0dc7 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars8to11.lean index 1a1062d451..bb656d5c9c 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock4Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock4Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5.lean index 4d71bf629b..4b703f3483 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars0to3.lean index bb9c8958fb..55a11fdf86 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars12to15.lean index cdd64effd2..d29aca83ed 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars16to19.lean index 1b69b9ac55..dfe5f6551f 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars20to22.lean index 8bc50959fe..4b42967053 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars4to7.lean index 4f41c541be..339cba3e77 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars8to11.lean index 0f64b95668..f89d3197ca 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock5Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock5Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6.lean index ce03a43bb6..64cbe10cd2 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars0to3.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars0to3.lean index 4cda0231f3..c7cd1c9815 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars0to3.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars0to3.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6Vars0to3 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars12to15.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars12to15.lean index 85b582bf0a..54381c51b9 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars12to15.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars12to15.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6Vars12to15 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars16to19.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars16to19.lean index 2397c402f3..f38abd1377 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars16to19.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars16to19.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6Vars16to19 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars20to22.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars20to22.lean index 121651ec42..7e8f8880dd 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars20to22.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars20to22.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6Vars20to22 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars4to7.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars4to7.lean index 99ab1143aa..86d382d63a 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars4to7.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars4to7.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6Vars4to7 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars8to11.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars8to11.lean index e08289f0b8..12666d681e 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars8to11.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntBlock6Vars8to11.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntBlock6Vars8to11 -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntGoal.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntGoal.lean index 8131c08c60..a27cd63286 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntGoal.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionComputeSiIntGoal.lean @@ -12,7 +12,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionComputeSiIntGoal -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionForB.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionForB.lean index 5c9dac3048..ed92a8cbc9 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionForB.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000BCompressionForB.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000BCompressionForB -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Bound.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Bound.lean index 74d5eff62b..67e0f9307e 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Bound.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Bound.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Bound -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixDecompose.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixDecompose.lean index 98a309ae34..9175247a66 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixDecompose.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixDecompose.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000CorrAvgMatrixDecompose -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -84,7 +84,7 @@ theorem dirMask_base_repVertex (d : DirIdx) : -- The overlap-type coefficient induced by a coloring. /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def coeff (f : Coloring n) (d : DirIdx) : Q := +@[expose] noncomputable def coeff (f : Coloring n) (d : DirIdx) : Q := corrAvg f baseVertex (repVertex d) theorem corrAvg_eq_coeff_of_dirMask_eq (f : Coloring n) {u v : V} (d : DirIdx) diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixSymmDecompose.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixSymmDecompose.lean index ed46cdfc2c..ca4558be57 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixSymmDecompose.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000CorrAvgMatrixSymmDecompose.lean @@ -21,7 +21,7 @@ The key bookkeeping is a tiny (34-element) map from directed indices to the uniq transpose-orbit contains it (with `idDirIdx` handled separately). -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Data.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Data.lean index 725981d8a8..ec3eeeec49 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Data.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Data.lean @@ -15,21 +15,24 @@ import Mathlib.Tactic.NormNum.Pow import Mathlib.Tactic.Positivity.Finset /-! This file is auto-generated by `scripts/export_n1000000_to_lean.py`. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound.N1000000Data /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def n : Nat := 1000000 +@[expose] def n : Nat := 1000000 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def numVars : Nat := 23 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def edgeVar : Nat := 11 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ def muSupportSize : Nat := 27 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def D : Nat := 89202980794122492566142873090593446023921664 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def muSupport : Array (Nat × Array Int × Int) := #[ +@[expose] def muSupport : Array (Nat × Array Int × Int) := #[ (0, #[1, 0, @@ -708,6 +711,7 @@ def muSupport : Array (Nat × Array Int × Int) := #[ ] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def S0Blocks : Array (Array (Array Int)) := #[ #[ #[44601490397061246283071436545296723011960832] @@ -754,6 +758,7 @@ def S0Blocks : Array (Array (Array Int)) := #[ ] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def SiBlocks : Array (Array (Array (Array Int))) := #[ #[ #[ @@ -1841,6 +1846,7 @@ def SiBlocks : Array (Array (Array (Array Int))) := #[ ] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def ZBlocks : Array (Array (Array Int)) := #[ #[ #[0] @@ -1891,6 +1897,6 @@ def ZBlocks : Array (Array (Array Int)) := #[ ] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def dualObjectiveD2 : Int := +@[expose] def dualObjectiveD2 : Int := -4156965047105896371246830027385491622956147256291889983163181913857548664285203217252352 end Distributed2Coloring.LowerBound.N1000000Data diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Interface.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Interface.lean index 97ca52dff5..f86767062e 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Interface.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Interface.lean @@ -38,7 +38,7 @@ It states that for `n = 1_000_000`, every coloring has monochromatic-edge fracti `23879/100000 = 0.23879`. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000IntersectionCounting.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000IntersectionCounting.lean index aa6b571208..f516a42e48 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000IntersectionCounting.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000IntersectionCounting.lean @@ -35,7 +35,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000IntersectionCounting -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -59,6 +59,7 @@ abbrev V := Vertex n abbrev DirIdx := N1000000StructureConstants.DirIdx /-- The actual intersection fiber: vertices `v` with base-type `a` and relative-type `d` to `u`. -/ +@[expose] def Inter {k : DirIdx} (u : BaseOrbit k) (a d : DirIdx) : Type := { v : V // dirMask baseVertex v = maskAt a ∧ dirMask v u.1 = maskAt d } @@ -68,7 +69,7 @@ noncomputable instance {k : DirIdx} (u : BaseOrbit k) (a d : DirIdx) : Fintype ( /-- Free coordinates for the intersection number `N[k][a][d]`: positions `j` where `v_j` is neither a base symbol (`a`) nor a reused symbol from `u` (`d`). -/ -@[implicit_reducible] +@[expose, implicit_reducible] def FreeCoord (a d : DirIdx) : Type := { j : Fin 3 // colMatch (maskAt a) j = none ∧ rowMatch (maskAt d) j = none } @@ -122,7 +123,7 @@ private lemma card_usedSet {k : DirIdx} (u : BaseOrbit k) : /-- Available symbols for new coordinates: those not in `baseSet` and not used by `u` on its free columns. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def AvailFor {k : DirIdx} (u : BaseOrbit k) : Type := { x : SymN // x ∉ (baseSet ∪ freeSyms (k := k) u) } diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Main.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Main.lean index 8b95144d2f..858298d4d9 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Main.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Main.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Main -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskAtFacts.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskAtFacts.lean index aed6a69066..33f0e55fe1 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskAtFacts.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskAtFacts.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000MaskAtFacts -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskComplete.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskComplete.lean index 57b7c24942..d1056a6923 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskComplete.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MaskComplete.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000MaskComplete -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuLinear.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuLinear.lean index dbc3f6dfea..786c831eee 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuLinear.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuLinear.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000MuLinear -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -65,6 +65,7 @@ def vertexOfLabels (t : N1000000MuWitness.LabelTriple) : Vertex n := varRepVertexU ⟨0, by decide⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def PairMapOk (i : Var) (pm : PairMapData) : Prop := pm.srcU = varRepUAt i ∧ pm.srcV = varRepVAt i ∧ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuWitness.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuWitness.lean index 5f9e6eff10..de55bcc1a6 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuWitness.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000MuWitness.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000MuWitness -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Objective.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Objective.lean index 5ddf1379ad..e0b8cc8eda 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Objective.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Objective.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Objective -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitCounting.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitCounting.lean index 9d6778c528..cd6141ba61 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitCounting.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitCounting.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000OrbitCounting -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -87,7 +87,7 @@ private lemma ge_three_of_ne_base (x : SymN) simp_all /-- Free columns for a directed type `k`: coordinates not equal to any base symbol. -/ -@[implicit_reducible] +@[expose, implicit_reducible] def FreeCol (k : DirIdx) : Type := { j : Fin 3 // colMatch (maskAt k) j = none } @@ -113,7 +113,7 @@ private lemma colMatch_unique (k : DirIdx) {j₁ j₂ : Fin 3} {i : Fin 3} colMatch_unique' (k := k) _ _ _ h₁ h₂ /-- Vertices in the orbit of the base vertex with directed type `k`. -/ -def BaseOrbit (k : DirIdx) : Type := +@[expose] def BaseOrbit (k : DirIdx) : Type := { u : V // dirMask baseVertex u = maskAt k } noncomputable instance (k : DirIdx) : Fintype (BaseOrbit k) := by @@ -157,6 +157,7 @@ def encodeBaseOrbit (k : DirIdx) (u : BaseOrbit k) : FreeCol k ↪ AvailFrom3 := private theorem base_val_lt_three (i : Fin 3) : (baseVertex.1 i).1 < 3 := by fin_cases i <;> decide /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] noncomputable def decodeTuple (k : DirIdx) (g : FreeCol k ↪ AvailFrom3) : Tuple 3 n := fun j => if hc : colMatch (maskAt k) j = none then @@ -226,6 +227,7 @@ private theorem decodeTuple_injective (k : DirIdx) (g : FreeCol k ↪ AvailFrom3 simp [this] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] noncomputable def decodeVertex (k : DirIdx) (g : FreeCol k ↪ AvailFrom3) : V := ⟨decodeTuple (k := k) g, by exact decodeTuple_injective (k := k) g⟩ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitalBasis.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitalBasis.lean index fe045b42da..efeb2d07a1 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitalBasis.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000OrbitalBasis.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000OrbitalBasis -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -66,7 +66,7 @@ abbrev s1 : SymN := ⟨1, by decide⟩ abbrev s2 : SymN := ⟨2, by decide⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def baseTuple : Tuple 3 n +@[expose] def baseTuple : Tuple 3 n | ⟨0, _⟩ => s0 | ⟨1, _⟩ => s1 | ⟨2, _⟩ => s2 @@ -76,14 +76,15 @@ theorem baseTuple_injective : Function.Injective baseTuple := by fin_cases i <;> fin_cases j <;> simp only [baseTuple] at hij <;> cases hij <;> rfl /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def baseVertex : V := +@[expose] def baseVertex : V := ⟨baseTuple, baseTuple_injective⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def baseSet : Finset SymN := +@[expose] def baseSet : Finset SymN := insert s0 (insert s1 (insert s2 ∅)) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def outside (x : SymN) : Prop := x ∉ baseSet instance : DecidablePred outside := by @@ -97,7 +98,7 @@ abbrev OutsideSym := { x : SymN // outside x } -- The directed orbital basis matrices, in the `N[k][a][d]` convention: -- `A_d[u,v] = 1` iff the directed overlap mask of the ordered pair `(v,u)` is `maskAt d`. /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def A (d : DirIdx) : Matrix V V Q := +@[expose] def A (d : DirIdx) : Matrix V V Q := fun u v => if dirMask v u = maskAt d then 1 else 0 @[simp] theorem A_apply (d : DirIdx) (u v : V) : @@ -105,7 +106,7 @@ def A (d : DirIdx) : Matrix V V Q := -- The symmetric orbital basis element corresponding to a directed type `d`. /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def ASymm (d : DirIdx) : Matrix V V Q := +@[expose] def ASymm (d : DirIdx) : Matrix V V Q := if h : tTr[d.1]! = d.1 then A d else diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000PairTransitivity.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000PairTransitivity.lean index e7174c896f..894a5b4c59 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000PairTransitivity.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000PairTransitivity.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000PairTransitivity -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -55,10 +55,10 @@ abbrev i1 : Fin 3 := 1 abbrev i2 : Fin 3 := 2 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def bit (k : Nat) : Nat := (1 : Nat) <<< k +@[expose] def bit (k : Nat) : Nat := (1 : Nat) <<< k /-- The directed overlap mask between two vertices, as a `3×3` partial permutation bitmask. -/ -def dirMask (u v : V) : Mask := +@[expose] def dirMask (u v : V) : Mask := -- We build a `9`-bit number by appending three `3`-bit rows. let row0 : Nat := ((if u.1 i0 = v.1 i0 then bit 0 else 0) ||| (if u.1 i0 = v.1 i1 then bit 1 else 0)) ||| diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Relaxation.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Relaxation.lean index eff2aa156c..347ac8884a 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Relaxation.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Relaxation.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Relaxation -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -48,7 +48,7 @@ instance : NeZero n := ⟨by decide⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def symOfNat (k : Nat) : SymN := +@[expose] def symOfNat (k : Nat) : SymN := Fin.ofNat n k lemma symOfNat_injective_of_lt {a b : Nat} (ha : a < n) (hb : b < n) : @@ -58,14 +58,14 @@ lemma symOfNat_injective_of_lt {a b : Nat} (ha : a < n) (hb : b < n) : rwa [Nat.mod_eq_of_lt ha, Nat.mod_eq_of_lt hb] at hval /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def labelGet (t : LabelTriple) (i : Fin 3) : SymN := +@[expose] def labelGet (t : LabelTriple) (i : Fin 3) : SymN := match i.1 with | 0 => symOfNat t.1 | 1 => symOfNat t.2.1 | _ => symOfNat t.2.2 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def tupleOfLabels (t : LabelTriple) : Tuple 3 n := +@[expose] def tupleOfLabels (t : LabelTriple) : Tuple 3 n := fun i => labelGet t i /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ @@ -80,6 +80,7 @@ lemma labelGet_eq_symOfNat_labelGetNat (t : LabelTriple) (i : Fin 3) : fin_cases i <;> rfl /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def LabelsDistinct (t : LabelTriple) : Prop := t.1 ≠ t.2.1 ∧ t.1 ≠ t.2.2 ∧ t.2.1 ≠ t.2.2 @@ -88,6 +89,7 @@ instance (t : LabelTriple) : Decidable (LabelsDistinct t) := by infer_instance /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def LabelsInRange (t : LabelTriple) : Prop := t.1 < n ∧ t.2.1 < n ∧ t.2.2 < n @@ -153,18 +155,19 @@ theorem varRepVAt_injective : ∀ i : Var, Function.Injective (tupleOfLabels (va fin_cases i <;> exact tupleOfLabels_injective_of_labelsDistinct _ (by decide) (by decide) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def varRepVertexU (i : Var) : Vertex n := +@[expose] def varRepVertexU (i : Var) : Vertex n := ⟨tupleOfLabels (varRepUAt i), varRepUAt_injective i⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def varRepVertexV (i : Var) : Vertex n := +@[expose] def varRepVertexV (i : Var) : Vertex n := ⟨tupleOfLabels (varRepVAt i), varRepVAt_injective i⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def xFromColoring (f : Coloring n) : Var → Q := +@[expose] noncomputable def xFromColoring (f : Coloring n) : Var → Q := fun i => corrAvg (n := n) f (varRepVertexU i) (varRepVertexV i) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def edgeVarVar : Var := ⟨edgeVar, by decide⟩ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000RelaxationPsdSoundness.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000RelaxationPsdSoundness.lean index 60ace474e4..ac89275dd0 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000RelaxationPsdSoundness.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000RelaxationPsdSoundness.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000RelaxationPsdSoundness -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -44,6 +44,7 @@ abbrev Block := N1000000WeakDuality.Block Scaled compression hypothesis: each reduced PSD block, after multiplying by its positive scale factor, is a congruence transform of `corrAvgMatrix f`. -/ +@[expose] def CompressionHypScaled : Prop := ∃ B : Block → Matrix V (Fin 3) Q, ∀ f : Coloring n, ∀ r : Block, diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000StructureConstants.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000StructureConstants.lean index fdfdbd3a7d..6054cf7d9d 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000StructureConstants.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000StructureConstants.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000StructureConstants -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -45,7 +45,7 @@ abbrev Mask := Distributed2Coloring.LowerBound.Mask abbrev DirIdx := Fin masks.size /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def maskAt (d : DirIdx) : Mask := +@[expose] def maskAt (d : DirIdx) : Mask := masks[d.1]! lemma maskAt_lt_512 (d : DirIdx) : maskAt d < (1 <<< 9) := by @@ -53,6 +53,7 @@ lemma maskAt_lt_512 (d : DirIdx) : maskAt d < (1 <<< 9) := by fin_cases d <;> decide /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def colMatch (m : Mask) (j : Fin 3) : Option (Fin 3) := if m.testBit (0 * 3 + j.1) then some ⟨0, by decide⟩ else if m.testBit (1 * 3 + j.1) then some ⟨1, by decide⟩ @@ -60,6 +61,7 @@ def colMatch (m : Mask) (j : Fin 3) : Option (Fin 3) := else none /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def rowMatch (m : Mask) (i : Fin 3) : Option (Fin 3) := if m.testBit (i.1 * 3 + 0) then some ⟨0, by decide⟩ else if m.testBit (i.1 * 3 + 1) then some ⟨1, by decide⟩ @@ -67,17 +69,19 @@ def rowMatch (m : Mask) (i : Fin 3) : Option (Fin 3) := else none /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def freeCols (m : Mask) : Nat := (Finset.univ.filter fun j : Fin 3 => colMatch m j = none).card /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def freeCoords (a d : Mask) : Nat := (Finset.univ.filter fun j : Fin 3 => colMatch a j = none ∧ rowMatch d j = none).card /-- Compatibility check for the triple of masks `(k,a,d)` in the representative intersection number `N[k][a][d]`: `k` is the type of `(base,u)`, `a` is the type of `(base,v)`, and `d` is the type of `(v,u)`. -/ -def consistentAt (k a d : Mask) (j : Fin 3) : Bool := +@[expose] def consistentAt (k a d : Mask) (j : Fin 3) : Bool := match colMatch a j, rowMatch d j with | some i, none => -- `v_j = base_i` but `v_j` does not equal any coordinate of `u`. @@ -94,16 +98,16 @@ def consistentAt (k a d : Mask) (j : Fin 3) : Bool := decide (colMatch k l = none) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def consistent (k a d : Mask) : Bool := +@[expose] def consistent (k a d : Mask) : Bool := consistentAt k a d ⟨0, by decide⟩ && consistentAt k a d ⟨1, by decide⟩ && consistentAt k a d ⟨2, by decide⟩ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def baseTypeCount (k : DirIdx) : Nat := +@[expose] def baseTypeCount (k : DirIdx) : Nat := (n - 3).descFactorial (freeCols (maskAt k)) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def N (k a d : DirIdx) : Nat := +@[expose] def N (k a d : DirIdx) : Nat := if consistent (maskAt k) (maskAt a) (maskAt d) then let used : Nat := 3 + freeCols (maskAt k) (n - used).descFactorial (freeCoords (maskAt a) (maskAt d)) diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Transitivity.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Transitivity.lean index d820f09b1e..0df28ff9ab 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Transitivity.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Transitivity.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Transitivity -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000WeakDuality.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000WeakDuality.lean index 37b8a28e7d..11e3c78027 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000WeakDuality.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000WeakDuality.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000WeakDuality -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -37,10 +37,12 @@ abbrev Block := Fin 7 abbrev Mu := Fin muSupport.size /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def xEdge (x : Var → Q) : Q := x ⟨edgeVar, by decide⟩ /-- The empty dual-certificate entry used as a default value. -/ +@[expose] def defaultMu : Nat × Array Int × Int := (0, #[], 0) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ @@ -52,19 +54,21 @@ def muVal (k : Mu) : Q := (muNumD k : Q) / (D : Q) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def aVec (k : Mu) : Array Int := +@[expose] def aVec (k : Mu) : Array Int := (muSupport.getD k.1 defaultMu).2.1 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def aCoeffInt (k : Mu) (i : Var) : Int := coeffAt (aVec k) i.1 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def aCoeff (k : Mu) (i : Var) : Q := (aCoeffInt k i : Q) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def aDot (k : Mu) (x : Var → Q) : Q := +@[expose] def aDot (k : Mu) (x : Var → Q) : Q := ∑ i : Var, (aCoeff k i) * x i /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ @@ -72,23 +76,23 @@ def muSum : Q := ∑ k : Mu, muVal k /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def S0Num (r : Block) : Array (Array Int) := +@[expose] def S0Num (r : Block) : Array (Array Int) := S0Blocks.getD r.1 #[] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def SiNum (r : Block) (i : Var) : Array (Array Int) := +@[expose] def SiNum (r : Block) (i : Var) : Array (Array Int) := (SiBlocks.getD r.1 #[]).getD i.1 #[] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def S0 (r : Block) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def S0 (r : Block) : Matrix (Fin 3) (Fin 3) Q := toMat3Scaled D (S0Num r) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def Si (r : Block) (i : Var) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def Si (r : Block) (i : Var) : Matrix (Fin 3) (Fin 3) Q := toMat3Scaled D (SiNum r i) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def S (x : Var → Q) (r : Block) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def S (x : Var → Q) (r : Block) : Matrix (Fin 3) (Fin 3) Q := S0 r + ∑ i : Var, x i • Si r i /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ @@ -104,11 +108,11 @@ def zCoeff (i : Var) : Q := ∑ r : Block, frobInner (Z r) (Si r i) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def dualObjective : Q := +@[expose] def dualObjective : Q := (dualObjectiveComputedD2 : Q) / ((D : Q) * (D : Q)) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def PrimalFeasibleForCertificate (x : Var → Q) : Prop := +@[expose] def PrimalFeasibleForCertificate (x : Var → Q) : Prop := (∀ k : Mu, aDot k x ≤ (1 : Q)) ∧ ∀ r : Block, (S x r).PosSemidef theorem muVal_nonneg (k : Mu) : 0 ≤ muVal k := by diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000WedderburnData.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000WedderburnData.lean index e213fc3e61..72371a1139 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000WedderburnData.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000WedderburnData.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000WedderburnData -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound namespace N1000000WedderburnData @@ -28,10 +28,12 @@ abbrev Q := ℚ -- The 7 Wedderburn block sizes are 1,1,1,2,3,3,3 (sorted by size). /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def blockSizes : Array Nat := #[1, 1, 1, 2, 3, 3, 3] -- Exact rational scaling factors (one per PSD block). /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def blockScales : Array Q := #[ (Rat.normalize (999997) (3000000)), @@ -47,6 +49,7 @@ def blockScales : Array Q := -- stored as integer numerators with a single common denominator per block: -- `moduleBasisQ r p k = moduleBasisNum[r][p][k] / moduleBasisDen[r]`. /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def moduleBasisDen : Array Nat := #[6000000, 2999973000077999928, 999997000002000000, @@ -56,6 +59,7 @@ def moduleBasisDen : Array Nat := #[6000000, 3999972000048000000] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def moduleBasisNum : Array (Array (Array Int)) := #[ #[ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Witness.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Witness.lean index c86ed230ad..7fa5821bf5 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Witness.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Witness.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Witness -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -35,6 +35,7 @@ abbrev tTr : Array Nat := #[0, 1, 4, 13, 2, 5, 14, 7, 8, 16, 20, 21, 23, 3, 6, 15, 9, 17, 22, 24, 10, 11, 18, 12, 19, 25, 26, 27, 28, 30, 29, 31, 32, 33] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def idIndex : Nat := 33 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Z.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Z.lean index 53dec2be4e..92b40e645a 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000Z.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000Z.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.LowerBound.N1000000Z -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -33,11 +33,11 @@ abbrev Q := ℚ abbrev Block := Fin 7 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def matGet (M : Array (Array Int)) (i j : Nat) : Int := +@[expose] def matGet (M : Array (Array Int)) (i j : Nat) : Int := (M.getD i #[]).getD j 0 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def toMat3Scaled (den : Nat) (M : Array (Array Int)) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def toMat3Scaled (den : Nat) (M : Array (Array Int)) : Matrix (Fin 3) (Fin 3) Q := fun i j => (matGet M i.1 j.1 : Q) / (den : Q) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ @@ -45,7 +45,7 @@ def toVec3Scaled (den : Nat) (v : Array Int) : Fin 3 → Q := fun i => (v.getD i.1 0 : Q) / (den : Q) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def Z (r : Block) : Matrix (Fin 3) (Fin 3) Q := +@[expose] def Z (r : Block) : Matrix (Fin 3) (Fin 3) Q := toMat3Scaled D (ZBlocks.getD r.1 #[]) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N1000000ZData.lean b/LeanPool/TwoColoringOneRound/LowerBound/N1000000ZData.lean index e8b3538842..9b47673791 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N1000000ZData.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N1000000ZData.lean @@ -7,7 +7,7 @@ module /-! Auto-generated exact LDLᵀ data for the dual blocks `Z_r`. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -15,6 +15,7 @@ namespace N1000000ZData /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def ZldlDen : Array Nat := #[1, 1, 1152921504606846976, @@ -24,6 +25,7 @@ def ZldlDen : Array Nat := #[1, 108119210378859631041159824564458405038878301870016480624919969792] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def ZldlLNum : Array (Array (Array Int)) := #[ #[#[1, 0, 0], #[0, 1, 0], #[0, 0, 1]], @@ -68,6 +70,7 @@ def ZldlLNum : Array (Array (Array Int)) := ] /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] def ZldlDNum : Array (Array Int) := #[ #[0, 0, 0], diff --git a/LeanPool/TwoColoringOneRound/LowerBound/N9.lean b/LeanPool/TwoColoringOneRound/LowerBound/N9.lean index 614b4796dd..6115d8498a 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/N9.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/N9.lean @@ -33,7 +33,7 @@ This file proves a small “warm-up” theorem matching the report: All proofs are kernel-checked (no `native_decide`). -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -157,7 +157,7 @@ For `n = 9`, every edge participates in exactly `5 * (9-4) = 25` such pairs, hen abbrev CyclePairs : Type := Emb5 × Fin 5 /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def CycleMonoPairs (f : Coloring9) : Type := +@[expose] def CycleMonoPairs (f : Coloring9) : Type := {p : CyclePairs // Edge.monochromatic f (edgeAt p.1 p.2)} noncomputable instance (f : Coloring9) : Fintype (CycleMonoPairs f) := by diff --git a/LeanPool/TwoColoringOneRound/LowerBound/OverlapType.lean b/LeanPool/TwoColoringOneRound/LowerBound/OverlapType.lean index 33a67201d1..6b8f258ad9 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/OverlapType.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/OverlapType.lean @@ -22,7 +22,7 @@ This file provides the core combinatorial operations needed to compute the orbit constants for fixed `n` (eventually instantiated to `n = 10^6`). -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound @@ -53,7 +53,7 @@ def decodePartialPerm (m : Mask) : Fin 3 → Option (Fin 3) := else none /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -def IsPartialPermMask (m : Mask) : Prop := +@[expose] def IsPartialPermMask (m : Mask) : Prop := (∀ i : Fin 3, (Finset.filter (fun j : Fin 3 => m.testBit (i.1 * 3 + j.1)) Finset.univ).card ≤ 1) ∧ (∀ j : Fin 3, (Finset.filter (fun i : Fin 3 => m.testBit (i.1 * 3 + j.1)) Finset.univ).card ≤ 1) diff --git a/LeanPool/TwoColoringOneRound/LowerBound/Sanity.lean b/LeanPool/TwoColoringOneRound/LowerBound/Sanity.lean index 7b935dbd27..f26a25037c 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/Sanity.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/Sanity.lean @@ -26,7 +26,7 @@ This file proves, in a fully kernel-checked way, that for `n = 5` there is an ex with monochromatic edge fraction exactly `1/5`. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/LowerBound/UpperBound.lean b/LeanPool/TwoColoringOneRound/LowerBound/UpperBound.lean index a78ac65f2e..36f8105b4a 100644 --- a/LeanPool/TwoColoringOneRound/LowerBound/UpperBound.lean +++ b/LeanPool/TwoColoringOneRound/LowerBound/UpperBound.lean @@ -27,7 +27,7 @@ The coloring used here is the simple rounding-based local rule from the report: * apply a fixed local rule `g` to the rounded bits. -/ -@[expose] public section +public section namespace Distributed2Coloring.LowerBound diff --git a/LeanPool/TwoColoringOneRound/MainResults.lean b/LeanPool/TwoColoringOneRound/MainResults.lean index 5a3609a60e..d8f1d7fa8f 100644 --- a/LeanPool/TwoColoringOneRound/MainResults.lean +++ b/LeanPool/TwoColoringOneRound/MainResults.lean @@ -22,7 +22,7 @@ This file collects the public-facing theorems connecting: We also package these bounds as statements about an infimum `p⋆` over all measurable local rules. -/ -@[expose] public section +public section namespace Distributed2Coloring diff --git a/LeanPool/TwoColoringOneRound/Reduction.lean b/LeanPool/TwoColoringOneRound/Reduction.lean index 13250f08f0..54bb06f19d 100644 --- a/LeanPool/TwoColoringOneRound/Reduction.lean +++ b/LeanPool/TwoColoringOneRound/Reduction.lean @@ -30,7 +30,7 @@ already-formalized explicit construction to conclude `p ≤ 0.24118` for some `ClassicalAlgorithm`. -/ -@[expose] public section +public section namespace Distributed2Coloring diff --git a/LeanPool/TwoColoringOneRound/SimpleBounds.lean b/LeanPool/TwoColoringOneRound/SimpleBounds.lean index 01f3be04ae..66feec477c 100644 --- a/LeanPool/TwoColoringOneRound/SimpleBounds.lean +++ b/LeanPool/TwoColoringOneRound/SimpleBounds.lean @@ -11,7 +11,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.TwoColoringOneRound.SimpleBounds -/ -@[expose] public section +public section namespace Distributed2Coloring diff --git a/LeanPool/TwoColoringOneRound/UpperBound.lean b/LeanPool/TwoColoringOneRound/UpperBound.lean index 78b703d8b4..e1751956b0 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound.lean @@ -16,4 +16,4 @@ import Mathlib.Tactic.Positivity.Finset This module re-exports the vendored formalization imported from `2-coloring-1-round`. -/ -@[expose] public section +public section diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param.lean index 0cf49d18d2..3c5cb54245 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param.lean @@ -21,4 +21,4 @@ import Mathlib.Tactic.Positivity.Finset This module re-exports the vendored formalization imported from `2-coloring-1-round`. -/ -@[expose] public section +public section diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Basic.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Basic.lean index 58f22471d5..bcc1844a7b 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Basic.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Basic.lean @@ -16,7 +16,7 @@ parameters `(t, t1, t2)`. Later files will prove the quantitative bound `ClassicalAlgorithm.p recursive3ParamAlg < 24118/100000`. -/ -@[expose] public section +public section namespace Distributed2Coloring @@ -28,15 +28,15 @@ namespace Recursive3Param /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def t : Rand := +@[expose] noncomputable def t : Rand := (⟨(5 / 8 : ℝ), by constructor <;> norm_num⟩ : I) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def t1 : Rand := +@[expose] noncomputable def t1 : Rand := (⟨(3 / 8 : ℝ), by constructor <;> norm_num⟩ : I) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def t2 : Rand := +@[expose] noncomputable def t2 : Rand := (⟨(17 / 32 : ℝ), by constructor <;> norm_num⟩ : I) lemma t1_lt_t2 : (t1 : ℝ) < t2 := by norm_num [t1, t2] @@ -57,7 +57,7 @@ This is the base cutoff surface `z_base(x,y;t)` described in the project write-u -/ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def zBase (x y : Rand) : ℝ := +@[expose] noncomputable def zBase (x y : Rand) : ℝ := if (y : ℝ) ∈ Set.Ici (t : ℝ) then if (x : ℝ) ∈ Set.Iio (t : ℝ) then 1 else (t : ℝ) else @@ -75,7 +75,7 @@ We implement the recursive surface directly using the induced partition (this is -/ /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def z0 (x y : Rand) : ℝ := +@[expose] noncomputable def z0 (x y : Rand) : ℝ := if ((x : ℝ) ∈ Set.Icc (t1 : ℝ) (t : ℝ) ∧ (y : ℝ) ∈ Set.Icc (t1 : ℝ) (t : ℝ)) then -- Inside `[t1,t] × [t1,t]`, the recursion collapses to the base rule with threshold `t2`. if (y : ℝ) ∈ Set.Iio (t2 : ℝ) then @@ -87,7 +87,7 @@ noncomputable def z0 (x y : Rand) : ℝ := zBase x y /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def g (x y z : Rand) : Color := +@[expose] noncomputable def g (x y z : Rand) : Color := if (z : ℝ) < z0 x y then 1 else 0 lemma measurable_zBase : Measurable fun xy : Rand × Rand => zBase xy.1 xy.2 := by @@ -181,7 +181,7 @@ lemma measurable_g : Measurable fun xyz : Rand × Rand × Rand => g xyz.1 xyz.2. · exact measurable_const /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def recursive3ParamAlg : ClassicalAlgorithm where +@[expose] noncomputable def recursive3ParamAlg : ClassicalAlgorithm where f := fun xyz => g xyz.1 xyz.2.1 xyz.2.2 measurable_f := measurable_g @@ -227,7 +227,7 @@ lemma z0_mem_Icc (x y : Rand) : z0 x y ∈ Set.Icc (0 : ℝ) 1 := by exact zBase_mem_Icc x y /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def z0I (x y : Rand) : Rand := +@[expose] noncomputable def z0I (x y : Rand) : Rand := ⟨z0 x y, z0_mem_Icc x y⟩ lemma g_eq_one_iff (x y z : Rand) : g x y z = 1 ↔ (z : ℝ) < z0 x y := by diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Bound.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Bound.lean index 7b15c876f0..6ade273c44 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Bound.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Bound.lean @@ -18,7 +18,7 @@ This file completes the computation of `ClassicalAlgorithm.p recursive3ParamAlg` numerical upper bound `p < 24118/100000`. -/ -@[expose] public section +public section namespace Distributed2Coloring @@ -173,7 +173,7 @@ noncomputable def constT2T2 : ℝ≥0∞ := ENNReal.ofReal (1 - (t2 : ℝ)) * ENNReal.ofReal (1 - (t2 : ℝ)) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def gCt2 (c : Rand) : ℝ≥0∞ := +@[expose] noncomputable def gCt2 (c : Rand) : ℝ≥0∞ := ENNReal.ofReal (c : ℝ) * ENNReal.ofReal (t2 : ℝ) + ENNReal.ofReal (1 - (c : ℝ)) * ENNReal.ofReal (1 - (t2 : ℝ)) @@ -183,7 +183,7 @@ noncomputable def gTB (b : Rand) : ℝ≥0∞ := ENNReal.ofReal (1 - (t : ℝ)) * ENNReal.ofReal (1 - (b : ℝ)) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def gT2B (b : Rand) : ℝ≥0∞ := +@[expose] noncomputable def gT2B (b : Rand) : ℝ≥0∞ := ENNReal.ofReal (t2 : ℝ) * ENNReal.ofReal (b : ℝ) + ENNReal.ofReal (1 - (t2 : ℝ)) * ENNReal.ofReal (1 - (b : ℝ)) diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/ComputeP.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/ComputeP.lean index 8bf14f936b..fcd41831d2 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/ComputeP.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/ComputeP.lean @@ -16,7 +16,7 @@ This file will prove that the 3-parameter recursive cutoff algorithm from `ClassicalAlgorithm.p recursive3ParamAlg < 24118/100000`. -/ -@[expose] public section +public section namespace Distributed2Coloring @@ -123,6 +123,7 @@ lemma lmarginal_D (x : Samples 4) : split_ifs <;> simp /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ +@[expose] noncomputable def aSlice (b c : Rand) : Set Rand := {a | c < z0I a b} @@ -314,7 +315,7 @@ lemma lmarginal_AD (x : Samples 4) : (ENNReal.ofReal (1 - (z0I (x 1) (x 2) : ℝ)))) /-- Imported auxiliary declaration for the 2-coloring one-round formalization. -/ -noncomputable def innerBC (b c : Rand) : ℝ≥0∞ := +@[expose] noncomputable def innerBC (b c : Rand) : ℝ≥0∞ := ENNReal.ofReal (z0I b c) * (volume : Measure Rand) (aSlice b c) + ENNReal.ofReal (1 - (z0I b c : ℝ)) * (volume : Measure Rand) (aSlice b c)ᶜ diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Final.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Final.lean index 6adbfcee4d..b7ba3d4400 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Final.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Final.lean @@ -20,7 +20,7 @@ This file combines the four `b`-regions computed in `ClassicalAlgorithm.p recursive3ParamAlg < 24118/100000`. -/ -@[expose] public section +public section namespace Distributed2Coloring diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Regions.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Regions.lean index 85930b11bb..52f7e0f9a0 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Regions.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Regions.lean @@ -18,7 +18,7 @@ This file computes the contributions to `ClassicalAlgorithm.p recursive3ParamAlg `b < t1` and `t1 ≤ b < t2` regions. -/ -@[expose] public section +public section namespace Distributed2Coloring diff --git a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Value.lean b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Value.lean index b51a9cd4f0..27283d1b68 100644 --- a/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Value.lean +++ b/LeanPool/TwoColoringOneRound/UpperBound/Recursive3Param/Value.lean @@ -14,7 +14,7 @@ The final result is the dyadic rational value `94835 / 393216 ≈ 0.24117787679 < 24118/100000`. -/ -@[expose] public section +public section namespace Distributed2Coloring diff --git a/LeanPool/UlmsTheorem.lean b/LeanPool/UlmsTheorem.lean index b92570a6b8..d21976d2cb 100644 --- a/LeanPool/UlmsTheorem.lean +++ b/LeanPool/UlmsTheorem.lean @@ -21,4 +21,4 @@ Tags: abelian-groups, p-groups, classification-theorems, ordinal-filtrations, ul MSC: 20K10 -/ -@[expose] public section +public section diff --git a/LeanPool/UlmsTheorem/Basic.lean b/LeanPool/UlmsTheorem/Basic.lean index 8aefd49c6c..be0b8efc5c 100644 --- a/LeanPool/UlmsTheorem/Basic.lean +++ b/LeanPool/UlmsTheorem/Basic.lean @@ -38,7 +38,7 @@ Throughout we work with additive abelian groups. - `ulmLength p G` : least α with p^α G = 0 (for reduced groups) -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/PGroups/Basic.lean b/LeanPool/UlmsTheorem/PGroups/Basic.lean index 5b6baadfad..069cf0ae79 100644 --- a/LeanPool/UlmsTheorem/PGroups/Basic.lean +++ b/LeanPool/UlmsTheorem/PGroups/Basic.lean @@ -17,7 +17,7 @@ This file is the new entry point for shared p-group infrastructure. At the moment it re-exports the project-wide basic setup from `Lib.Basic`. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/PGroups/Defs.lean b/LeanPool/UlmsTheorem/PGroups/Defs.lean index 0e4f63b805..d6ecc433f6 100644 --- a/LeanPool/UlmsTheorem/PGroups/Defs.lean +++ b/LeanPool/UlmsTheorem/PGroups/Defs.lean @@ -26,7 +26,7 @@ Existing imports of `Lib.PGroups.Defs` therefore continue to work while the library is migrated to the new layout. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/PGroups/Heights.lean b/LeanPool/UlmsTheorem/PGroups/Heights.lean index 6dfde4fa4e..1ddd877055 100644 --- a/LeanPool/UlmsTheorem/PGroups/Heights.lean +++ b/LeanPool/UlmsTheorem/PGroups/Heights.lean @@ -16,7 +16,7 @@ This file contains the reducedness predicate used in the project and the basic finite `p`-height calculus. -/ -@[expose] public section +public section namespace UlmsTheorem @@ -29,6 +29,7 @@ variable (p : ℕ) This hypothesis is logically independent from reducedness. In particular, torsion-free groups such as `ℤ` must not enter Ulm's classification theorem merely because their `p`-socle is trivial. -/ +@[expose] def IsPrimaryPGroup (G : Type*) [AddCommGroup G] : Prop := ∀ x : G, ∃ n : ℕ, p ^ n • x = 0 @@ -38,6 +39,7 @@ For the countable `p`-primary groups classified below, this is equivalent to say `G` has no nontrivial divisible subgroup: the eventual stable Ulm subgroup is the maximal divisible subgroup. Crucially, this does *not* require `G_ω = 0`; reduced groups may contain elements of infinite height and have arbitrary countable Ulm length. -/ +@[expose] def IsPReduced (G : Type*) [AddCommGroup G] : Prop := ∃ α : Ordinal.{0}, ulmSubgroup p α (G := G) = ⊥ diff --git a/LeanPool/UlmsTheorem/PGroups/Morphisms.lean b/LeanPool/UlmsTheorem/PGroups/Morphisms.lean index bb1f828c76..0a0f28a267 100644 --- a/LeanPool/UlmsTheorem/PGroups/Morphisms.lean +++ b/LeanPool/UlmsTheorem/PGroups/Morphisms.lean @@ -19,7 +19,7 @@ Stable entry point for isomorphism lemmas connecting Ulm subgroups, filtered p-socle layers, and the classical `P_α / P_{α+1}` Ulm invariants. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/PGroups/Socle.lean b/LeanPool/UlmsTheorem/PGroups/Socle.lean index 3ce708b14b..b1bfb6e3b9 100644 --- a/LeanPool/UlmsTheorem/PGroups/Socle.lean +++ b/LeanPool/UlmsTheorem/PGroups/Socle.lean @@ -14,7 +14,7 @@ public import LeanPool.UlmsTheorem.PGroups.UlmSubgroups This file contains the p-socle and its interaction with the Ulm filtration. -/ -@[expose] public section +public section namespace UlmsTheorem @@ -23,6 +23,7 @@ open Ordinal variable (p : ℕ) /-- The `p`-socle `P = {x | p • x = 0}`. -/ +@[expose] def pSocle {G : Type*} [AddCommGroup G] : AddSubgroup G where carrier := {x | p • x = 0} zero_mem' := by simp @@ -42,6 +43,7 @@ variable {G : Type*} [AddCommGroup G] @[simp] lemma mem_pSocle (x : G) : x ∈ pSocle p (G := G) ↔ p • x = 0 := Iff.rfl /-- The filtered socle `P_α = P ∩ G_α`. -/ +@[expose] noncomputable def pSocleAt (α : Ordinal) : AddSubgroup G := pSocle p ⊓ ulmSubgroup p α @@ -68,7 +70,8 @@ noncomputable instance pSocleZModModule : refine AddCommGroup.zmodModule (n := p) (G := pSocle p (G := G)) ?_ intro x apply Subtype.ext - exact x.property + change p • (x : G) = 0 + exact (mem_pSocle p (x : G)).mp x.property noncomputable instance pSocleAtZModModule (α : Ordinal) : Module (ZMod p) (pSocleAt p α (G := G)) := by @@ -80,7 +83,7 @@ noncomputable instance pSocleAtZModModule (α : Ordinal) : simp [hx] /-- `P_{α+1}` viewed as a subgroup of `P_α`. -/ -noncomputable def pSocleAtSuccSubgroupOf (α : Ordinal) : +@[expose] noncomputable def pSocleAtSuccSubgroupOf (α : Ordinal) : AddSubgroup (pSocleAt p α (G := G)) := (pSocleAt p (Order.succ α) (G := G)).comap (AddSubgroup.subtype (pSocleAt p α)) diff --git a/LeanPool/UlmsTheorem/PGroups/Subgroups.lean b/LeanPool/UlmsTheorem/PGroups/Subgroups.lean index 8826ba95b8..cfe64cd2a2 100644 --- a/LeanPool/UlmsTheorem/PGroups/Subgroups.lean +++ b/LeanPool/UlmsTheorem/PGroups/Subgroups.lean @@ -17,7 +17,7 @@ development: the natural-number powers `pPow` and the image-of-multiplication construction `pImage`. -/ -@[expose] public section +public section namespace UlmsTheorem @@ -26,7 +26,7 @@ variable (p : ℕ) /-! ### Natural-number Ulm subgroups -/ /-- `p^n·G = { p^n • y | y : G }`. -/ -def pPow {G : Type*} [AddCommGroup G] (n : ℕ) : AddSubgroup G where +@[expose] def pPow {G : Type*} [AddCommGroup G] (n : ℕ) : AddSubgroup G where carrier := {x | ∃ y : G, p ^ n • y = x} zero_mem' := ⟨0, by simp⟩ add_mem' := by @@ -69,6 +69,7 @@ end PowLemmas /-! ### `p`-image of a subgroup -/ /-- `{ p • y | y ∈ H }` as a subgroup of `G`. -/ +@[expose] def pImage {G : Type*} [AddCommGroup G] (H : AddSubgroup G) : AddSubgroup G where carrier := {x | ∃ y ∈ H, p • y = x} zero_mem' := ⟨0, H.zero_mem, by simp⟩ diff --git a/LeanPool/UlmsTheorem/PGroups/UlmInvariants.lean b/LeanPool/UlmsTheorem/PGroups/UlmInvariants.lean index 80586f58ae..5b92ce4115 100644 --- a/LeanPool/UlmsTheorem/PGroups/UlmInvariants.lean +++ b/LeanPool/UlmsTheorem/PGroups/UlmInvariants.lean @@ -36,7 +36,7 @@ not the classical Ulm invariant used in Ulm's theorem. - Kaplansky, "Infinite Abelian Groups", Theorem 14 -/ -@[expose] public section +public section namespace UlmsTheorem @@ -55,6 +55,7 @@ noncomputable def layerSuccIncl {G : Type*} [AddCommGroup G] (α : Ordinal) : /-- The quotient `G_α / G_{α+1}`. This is useful auxiliary filtration data, but it is not the classical Ulm invariant. -/ +@[expose] noncomputable def layerQuotient {G : Type*} [AddCommGroup G] (α : Ordinal) : Type _ := (ulmSubgroup p α (G := G)) ⧸ @@ -79,7 +80,7 @@ lemma layerQuotient_orderOf_dvd_p {G : Type*} [AddCommGroup G] (α : Ordinal) ((ulmSubgroup p (Order.succ α) (G := G)).comap (ulmSubgroup p α (G := G)).subtype) 0 have hmem : (p • (a : G)) ∈ ulmSubgroup p (Order.succ α) (G := G) := by - rw [ulmSubgroup_succ] + rw [ulmSubgroup_succ, mem_pImage] exact ⟨a, a.property, rfl⟩ apply (QuotientAddGroup.mk'_eq_mk' _).2 refine ⟨-(p • a), ?_, by simp⟩ @@ -100,6 +101,7 @@ noncomputable def layerInvariant {G : Type*} [AddCommGroup G] /-! ### The classical Ulm quotient `P_α / P_{α+1}` -/ /-- `P_(α+1)` as a `ZMod p`-submodule of `P_α`. -/ +@[expose] noncomputable def ulmDenSubmodule {G : Type*} [AddCommGroup G] (α : Ordinal) : Submodule (ZMod p) (pSocleAt p α (G := G)) := AddSubgroup.toZModSubmodule p (pSocleAtSuccSubgroupOf p α) @@ -122,6 +124,7 @@ lemma ulmQuotient_orderOf_dvd_p {G : Type*} [AddCommGroup G] (α : Ordinal) rfl /-- The classical Ulm invariant `f_G(α) = dim_{ℤ/pℤ}(P_α / P_{α+1})`. -/ +@[expose] noncomputable def ulmInvariant {G : Type*} [AddCommGroup G] (α : Ordinal) : Cardinal := Module.rank (ZMod p) (ulmQuotient p α (G := G)) @@ -171,12 +174,14 @@ theorem markedGradedInvariant_bot (α : Ordinal) : /-- The Fuchs/Walker Hill denominator `P_α ∩ (S + G_(α+1))`, viewed inside `P_α`. -/ +@[expose] noncomputable def hillDen (S : AddSubgroup G) (α : Ordinal) : AddSubgroup (pSocleAt p α (G := G)) := (pSocleAt p α ⊓ (S ⊔ ulmSubgroup p (Order.succ α))).comap (pSocleAt p α).subtype /-- The Hill denominator as a `ZMod p`-submodule of `P_α`. -/ +@[expose] noncomputable def hillSubmodule (S : AddSubgroup G) (α : Ordinal) : Submodule (ZMod p) (pSocleAt p α (G := G)) := AddSubgroup.toZModSubmodule p (hillDen p S α) @@ -259,6 +264,7 @@ lemma ulmDenSubmodule_le_hillSubmodule (S : AddSubgroup G) (α : Ordinal) : exact ⟨x.property, AddSubgroup.mem_sup_right hx.2⟩ /-- The subspace of the ordinary Ulm layer occupied by the marked subgroup `S`. -/ +@[expose] noncomputable def relativeOccupiedSubmodule (S : AddSubgroup G) (α : Ordinal) : Submodule (ZMod p) (ulmQuotient p α (G := G)) := (hillSubmodule p S α).map (ulmDenSubmodule p α).mkQ diff --git a/LeanPool/UlmsTheorem/PGroups/UlmSubgroups.lean b/LeanPool/UlmsTheorem/PGroups/UlmSubgroups.lean index c0e8d92e8c..877aab7dc3 100644 --- a/LeanPool/UlmsTheorem/PGroups/UlmSubgroups.lean +++ b/LeanPool/UlmsTheorem/PGroups/UlmSubgroups.lean @@ -17,7 +17,7 @@ This file contains the transfinite Ulm filtration `ulmSubgroup` and its basic structural lemmas. -/ -@[expose] public section +public section namespace UlmsTheorem @@ -28,7 +28,7 @@ variable (p : ℕ) /-- `p^α·G` by transfinite recursion: `p^0·G = G`, `p^(α+1)·G = {p•x | x ∈ p^α·G}`, and `p^λ·G = ⋂_{β<λ} p^β·G`. -/ -noncomputable def ulmSubgroup {G : Type*} [AddCommGroup G] (α : Ordinal) : +@[expose] noncomputable def ulmSubgroup {G : Type*} [AddCommGroup G] (α : Ordinal) : AddSubgroup G := α.limitRecOn ⊤ @@ -89,7 +89,7 @@ lemma ulmSubgroup_antitone : Antitone (fun α ↦ ulmSubgroup p α (G := G)) := have hs : ulmSubgroup p (β + 1) (G := G) ≤ ulmSubgroup p β := by rw [ulmSubgroup_add_one] intro x hx - rcases hx with ⟨y, hy, rfl⟩ + rcases (mem_pImage p _ _).mp hx with ⟨y, hy, rfl⟩ simpa using (ulmSubgroup p β (G := G)).nsmul_mem hy p rcases lt_or_eq_of_le hαβ with hlt | rfl · exact hs.trans (ih α (Order.le_of_lt_succ hlt)) @@ -147,7 +147,8 @@ lemma map_ulmSubgroup_le {H : Type*} [AddCommGroup H] (φ : G →+ H) (α : Ordi | add_one α ih => intro y hy rcases hy with ⟨x, hx, rfl⟩ - rw [ulmSubgroup_add_one] at hx ⊢ + change x ∈ ulmSubgroup p (α + 1) at hx + rw [ulmSubgroup_add_one, mem_pImage] at hx ⊢ rcases hx with ⟨z, hz, rfl⟩ exact ⟨φ z, ih ⟨z, hz, rfl⟩, by simp⟩ | limit o ho IH => diff --git a/LeanPool/UlmsTheorem/Regression.lean b/LeanPool/UlmsTheorem/Regression.lean index 05957f73fd..0795c9f7d2 100644 --- a/LeanPool/UlmsTheorem/Regression.lean +++ b/LeanPool/UlmsTheorem/Regression.lean @@ -55,7 +55,7 @@ Two checks that cannot live in a build, recorded here so they are not lost: from hand-computed finite instances like this one. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/Ulm/Classification.lean b/LeanPool/UlmsTheorem/Ulm/Classification.lean index 2ec4ef0058..96441ad5fd 100644 --- a/LeanPool/UlmsTheorem/Ulm/Classification.lean +++ b/LeanPool/UlmsTheorem/Ulm/Classification.lean @@ -18,7 +18,7 @@ the back-and-forth construction on finite partial isomorphisms and the final isomorphism-from-invariants statement. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/Ulm/Extension.lean b/LeanPool/UlmsTheorem/Ulm/Extension.lean index 7a225b3098..7f9f4536cb 100644 --- a/LeanPool/UlmsTheorem/Ulm/Extension.lean +++ b/LeanPool/UlmsTheorem/Ulm/Extension.lean @@ -27,7 +27,7 @@ direction of Ulm's theorem, formulated against the classical invariants `dim_{ℤ/pℤ}(P_α / P_{α+1})`. -/ -@[expose] public section +public section namespace UlmsTheorem @@ -84,6 +84,7 @@ noncomputable def stageAtSuccInStar (S : AddSubgroup G) (α : Ordinal) : (stageAt p S (Order.succ α)).comap (kaplanskyStar p S α).subtype /-- The source quotient in Kaplansky's relative-Ulm map. -/ +@[expose] noncomputable def kaplanskyDomainQuotient (S : AddSubgroup G) (α : Ordinal) : Type u := kaplanskyStar p S α ⧸ stageAtSuccInStar p S α @@ -508,6 +509,7 @@ def UlmStage.at (s : UlmStage p (G := G) (H := H)) (α : Ordinal.{0}) : hφ_succSucc := fun x ↦ s.hφ x (Order.succ (Order.succ α)) /-- Reverse a finite partial isomorphism. -/ +@[expose] noncomputable def UlmStage.symm (s : UlmStage p (G := G) (H := H)) : UlmStage p (G := H) (H := G) where A := s.B diff --git a/LeanPool/UlmsTheorem/Ulm/Invariance.lean b/LeanPool/UlmsTheorem/Ulm/Invariance.lean index ef23bb5497..11ea03e306 100644 --- a/LeanPool/UlmsTheorem/Ulm/Invariance.lean +++ b/LeanPool/UlmsTheorem/Ulm/Invariance.lean @@ -15,7 +15,7 @@ both the Ulm filtration and the classical `P_α / P_{α+1}` quotients, hence the Ulm invariants. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UlmsTheorem/Ulm/Pure.lean b/LeanPool/UlmsTheorem/Ulm/Pure.lean index bdef464451..bf73406e88 100644 --- a/LeanPool/UlmsTheorem/Ulm/Pure.lean +++ b/LeanPool/UlmsTheorem/Ulm/Pure.lean @@ -20,7 +20,7 @@ This file contains the basic hard-direction infrastructure for Ulm's theorem: ordinal height, p-order, purity, and height-preserving maps on subgroups. -/ -@[expose] public section +public section namespace UlmsTheorem @@ -37,6 +37,7 @@ noncomputable def ulmHeight (x : G) : WithTop Ordinal.{0} := ⨆ (α : Ordinal.{0}) (_ : x ∈ ulmSubgroup p α (G := G)), (α : WithTop Ordinal.{0}) /-- `x` is proper with respect to `S` when its height is maximal in the coset `x + S`. -/ +@[expose] def IsProper (S : AddSubgroup G) (x : G) : Prop := ∀ s : S, ulmHeight p x ≥ ulmHeight p (x + s) @@ -163,6 +164,7 @@ def IsHeightPreserving (φ : G →+ H) : Prop := x ∈ ulmSubgroup p α (G := G) ↔ φ x ∈ ulmSubgroup p α (G := H) /-- Height-preserving map between subgroups `A ≤ G` and `B ≤ H`. -/ +@[expose] def IsHeightPresOn {A : AddSubgroup G} {B : AddSubgroup H} (φ : A →+ B) : Prop := ∀ (a : A) (α : Ordinal.{0}), (a : G) ∈ ulmSubgroup p α (G := G) ↔ (φ a : H) ∈ ulmSubgroup p α (G := H) @@ -269,11 +271,15 @@ def IsIsotype (A : AddSubgroup G) : Prop := ∀ (x : A) (α : Ordinal.{0}), (x : G) ∈ ulmSubgroup p α (G := G) ↔ x ∈ ulmSubgroup p α (G := A) -lemma IsPure_bot : IsPure p (⊥ : AddSubgroup G) := - fun _ _ _ ↦ ⟨0, Subsingleton.elim _ _⟩ +lemma IsPure_bot : IsPure p (⊥ : AddSubgroup G) := by + intro n x _ + apply (pPow_mem_iff p x n).mpr + exact ⟨0, Subsingleton.elim _ _⟩ -lemma IsPure_top : IsPure p (⊤ : AddSubgroup G) := fun _ _ hx ↦ by - obtain ⟨y, hy⟩ := hx +lemma IsPure_top : IsPure p (⊤ : AddSubgroup G) := by + intro n x hx + obtain ⟨y, hy⟩ := (pPow_mem_iff p (x : G) n).mp hx + apply (pPow_mem_iff p x n).mpr exact ⟨⟨y, by simp⟩, Subtype.ext hy⟩ lemma IsIsotype.isPure {A : AddSubgroup G} (hA : IsIsotype p A) : @@ -415,7 +421,8 @@ lemma IsPure.map_of_heightPres {A : AddSubgroup G} (hA : IsPure p A) have ha_pow : a ∈ pPow p n (G := G) := by rw [← ulmSubgroup_nat (p := p) n] exact (hφ a n).mpr hx' - rcases hA n ⟨a, haA⟩ ha_pow with ⟨b, hb⟩ + rcases (pPow_mem_iff p _ n).mp (hA n ⟨a, haA⟩ ha_pow) with ⟨b, hb⟩ + apply (pPow_mem_iff p x n).mpr refine ⟨⟨φ b, ⟨b, b.property, rfl⟩⟩, ?_⟩ ext have hb' : p ^ n • (b : G) = a := congrArg (fun z : A ↦ (z : G)) hb @@ -433,7 +440,8 @@ lemma IsPure.range_of_heightPresOn {A : AddSubgroup G} {B : AddSubgroup H} have ha_pow : (a : G) ∈ pPow p n (G := G) := by rw [← ulmSubgroup_nat (p := p) (G := G) n] exact (hφ a n).mpr hx' - rcases hA n a ha_pow with ⟨b, hb⟩ + rcases (pPow_mem_iff p _ n).mp (hA n a ha_pow) with ⟨b, hb⟩ + apply (pPow_mem_iff p x n).mpr refine ⟨⟨(B.subtype.comp φ) b, ⟨b, by simp, rfl⟩⟩, ?_⟩ apply Subtype.ext calc diff --git a/LeanPool/UlmsTheorem/Ulm/Theorem.lean b/LeanPool/UlmsTheorem/Ulm/Theorem.lean index 3818c6063f..9deb4fb119 100644 --- a/LeanPool/UlmsTheorem/Ulm/Theorem.lean +++ b/LeanPool/UlmsTheorem/Ulm/Theorem.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Positivity.Finset Public entry point for the Ulm-theorem track of the project. -/ -@[expose] public section +public section namespace UlmsTheorem diff --git a/LeanPool/UnconditionalSchauderBasis.lean b/LeanPool/UnconditionalSchauderBasis.lean index 2dc3b4e946..c7134c4c1d 100644 --- a/LeanPool/UnconditionalSchauderBasis.lean +++ b/LeanPool/UnconditionalSchauderBasis.lean @@ -22,7 +22,7 @@ Tags: functional-analysis, banach-spaces, schauder-bases MSC: 46B15 -/ -@[expose] public section +public section /-! # Schauder bases and the finite sign criterion diff --git a/LeanPool/VirasoroProject.lean b/LeanPool/VirasoroProject.lean index ccc829781d..47ece956dd 100644 --- a/LeanPool/VirasoroProject.lean +++ b/LeanPool/VirasoroProject.lean @@ -42,4 +42,4 @@ Tags: representation-theory, lie-algebras, mathematical-physics, virasoro-algebr MSC: 17B68, 17B56, 81R10 -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/CentralChargeCalc.lean b/LeanPool/VirasoroProject/CentralChargeCalc.lean index 0999aae142..9fae5aa49a 100644 --- a/LeanPool/VirasoroProject/CentralChargeCalc.lean +++ b/LeanPool/VirasoroProject/CentralChargeCalc.lean @@ -53,7 +53,7 @@ central charge, Sugawara construction -/ -@[expose] public section +public section namespace VirasoroProject @@ -64,7 +64,7 @@ section central_charge_calculation open Finset /-- A discrete integral of a function on `ℤ`. -/ -def zPrimitive {R : Type*} [AddCommGroup R] (f : ℤ → R) (n : ℤ) : R := +@[expose] def zPrimitive {R : Type*} [AddCommGroup R] (f : ℤ → R) (n : ℤ) : R := if 0 ≤ n then ∑ j ∈ range (Int.toNat n), f j else -(∑ j ∈ range (Int.natAbs n), f (-j-1)) @[simp] lemma zPrimitive_zero {R : Type*} [AddCommGroup R] (f : ℤ → R) : diff --git a/LeanPool/VirasoroProject/CentralExtension.lean b/LeanPool/VirasoroProject/CentralExtension.lean index 201a29eb42..0dac998c06 100644 --- a/LeanPool/VirasoroProject/CentralExtension.lean +++ b/LeanPool/VirasoroProject/CentralExtension.lean @@ -37,7 +37,7 @@ Lie algebra, central extension, 2-cocycle -/ -@[expose] public section +public section namespace VirasoroProject @@ -55,7 +55,7 @@ namespace LieTwoCocycle /-- The underlying type of the central extension of Lie algebras determined by a Lie algebra 2-cocycle. -/ -def CentralExtension (γ : LieTwoCocycle 𝕜 𝓰 𝓪) := +@[expose] def CentralExtension (γ : LieTwoCocycle 𝕜 𝓰 𝓪) := let _ : LieTwoCocycle 𝕜 𝓰 𝓪 := γ 𝓰 × 𝓪 @@ -97,7 +97,7 @@ variable (γ) open LinearMapClass RingHom in /-- The Lie bracket in a central extension defined by a Lie algebra 2-cocycle. -/ -def bracket : γ.CentralExtension +@[expose] def bracket : γ.CentralExtension →ₗ[𝕜] γ.CentralExtension →ₗ[𝕜] γ.CentralExtension where toFun := fun ⟨X,_⟩ ↦ { toFun := fun ⟨Y,_⟩ ↦ ⟨⁅X,Y⁆, γ X Y⟩ @@ -122,7 +122,7 @@ def bracket : γ.CentralExtension exact congrArg (fun f => f Y) (map_smul γ m X) @[simp] lemma bracket_apply (Z W : γ.CentralExtension) : - γ.bracket Z W = ⟨⁅Z.fst, W.fst⁆, γ Z.fst W.fst⟩ := rfl + γ.bracket Z W = ⟨⁅Z.fst, W.fst⁆, γ Z.fst W.fst⟩ := by rfl lemma bracket_self (Z : γ.CentralExtension) : γ.bracket Z Z = 0 := by @@ -213,19 +213,19 @@ def congr {γ₁ γ₂ : LieTwoCocycle 𝕜 𝓰 𝓪} (h : γ₁ = γ₂) : ext <;> dsimp only lemma congr_apply {γ₁ γ₂ : LieTwoCocycle 𝕜 𝓰 𝓪} (h : γ₁ = γ₂) (Z : γ₁.CentralExtension) : - congr h Z = ⟨Z.1, Z.2⟩ := rfl + congr h Z = ⟨Z.1, Z.2⟩ := by rfl @[simp] lemma congr_trans {γ₁ γ₂ γ₃ : LieTwoCocycle 𝕜 𝓰 𝓪} (h₁₂ : γ₁ = γ₂) (h₂₃ : γ₂ = γ₃) : (congr h₁₂).trans (congr h₂₃) = (congr (h₁₂.trans h₂₃)) := - rfl + by rfl lemma congr_congr_symm {γ₁ γ₂ : LieTwoCocycle 𝕜 𝓰 𝓪} (h : γ₁ = γ₂) : (congr h).trans (congr h.symm) = LieEquiv.refl := - rfl + by rfl lemma hom_of_coboundary_refl (γ : LieTwoCocycle 𝕜 𝓰 𝓪) : congr (Eq.refl γ) = LieEquiv.refl (R := 𝕜) (L₁ := γ.CentralExtension) := - rfl + by rfl lemma hom_of_coboundary_add (γ₁ γ₂ γ₃ : LieTwoCocycle 𝕜 𝓰 𝓪) (β₁ β₂ : LieOneCochain 𝕜 𝓰 𝓪) (h₂ : γ₁ + β₁.bdry = γ₂) (h₃ : γ₂ + β₂.bdry = γ₃) : diff --git a/LeanPool/VirasoroProject/Commutator.lean b/LeanPool/VirasoroProject/Commutator.lean index 626dfb5172..439190cf16 100644 --- a/LeanPool/VirasoroProject/Commutator.lean +++ b/LeanPool/VirasoroProject/Commutator.lean @@ -22,7 +22,7 @@ This file defines commutators of linear operators, and proves a few useful prope -/ -@[expose] public section +public section namespace LinearMap @@ -33,7 +33,7 @@ section commutator variable {𝕜 : Type*} [Semiring 𝕜] {V : Type*} [AddCommGroup V] [Module 𝕜 V] /-- Commutator `[A,B] := AB-BA` of two linear operators `A`, `B`. -/ -def commutator (A B : V →ₗ[𝕜] V) : V →ₗ[𝕜] V := +@[expose] def commutator (A B : V →ₗ[𝕜] V) : V →ₗ[𝕜] V := A * B - B * A /-- `[A,B] = -[B,A]` -/ @@ -78,7 +78,7 @@ section commutatorBilin variable {𝕜 : Type*} [Field 𝕜] (V : Type*) [AddCommGroup V] [Module 𝕜 V] /-- Commutator `[⬝,⬝]` as a bilinear map on the space of linear maps. -/ -noncomputable def _root_.LinearMap.commutatorBilin : +@[expose] noncomputable def _root_.LinearMap.commutatorBilin : (V →ₗ[𝕜] V) →ₗ[𝕜] (V →ₗ[𝕜] V) →ₗ[𝕜] (V →ₗ[𝕜] V) where toFun A := { toFun := fun B ↦ A.commutator B @@ -107,7 +107,7 @@ section algebra_commutator variable (𝕜 : Type*) {A : Type*} [CommSemiring 𝕜] [Ring A] [Algebra 𝕜 A] /-- Commutator with a fixed element in a `𝕜`-algebra as a `𝕜`-linear map. -/ -def _root_.LinearMap.algebraCommutator' (a : A) : A →ₗ[𝕜] A where +@[expose] def _root_.LinearMap.algebraCommutator' (a : A) : A →ₗ[𝕜] A where toFun b := a * b - b * a map_add' b₁ b₂ := by simp only [mul_add, add_mul, sub_eq_add_neg, neg_add_rev] diff --git a/LeanPool/VirasoroProject/CyclicTripleSum.lean b/LeanPool/VirasoroProject/CyclicTripleSum.lean index 63a52d0dc8..ab104bf3ba 100644 --- a/LeanPool/VirasoroProject/CyclicTripleSum.lean +++ b/LeanPool/VirasoroProject/CyclicTripleSum.lean @@ -41,7 +41,7 @@ Jacobi identity, Lie algebra 2-cocycle condition -/ -@[expose] public section +public section namespace VirasoroProject @@ -56,7 +56,7 @@ variable {V W : Type*} Given functions β : V × V → V and φ : V × V → W where W has additive structure, `cyclicTripleSum β φ` is the function of three variables on V defined by: ⟨x,y,z⟩ ↦ φ(x,β(y,z)) + φ(y,β(z,x)) + φ(z,β(x,y)). -/ -def cyclicTripleSum [Add W] (β : V → V → V) (φ : V → V → W) (x y z : V) : W := +@[expose] def cyclicTripleSum [Add W] (β : V → V → V) (φ : V → V → W) (x y z : V) : W := φ x (β y z) + φ y (β z x) + φ z (β x y) lemma cyclicTripleSum_apply [Add W] (β : V → V → V) (φ : V → V → W) (x y z : V) : @@ -163,7 +163,7 @@ section cyclicTripleSumBilin -- TODO: Does a more convenient coercion exist? Should this be made to a literal coercion? /-- "Coerce" a bilinear map into a biadditive map. -/ -def _root_.LinearMap.toBiadditive +@[expose] def _root_.LinearMap.toBiadditive {V₁ V₂ V₃ : Type*} [AddCommMonoid V₁] [AddCommMonoid V₂] [AddCommMonoid V₃] {R₁ R₂ R₃ : Type*} [CommSemiring R₁] [CommSemiring R₂] [CommSemiring R₃] {σ : R₁ →+* R₃} {τ : R₂ →+* R₃} @@ -186,7 +186,7 @@ variable [Module 𝕜 V] [Module 𝕜 W] Given bilinear functions β : V × V → V and φ : V × V → W, `cyclicTripleSumHom β φ` is the trilinear function on V defined by: ⟨x,y,z⟩ ↦ φ(x,β(y,z)) + φ(y,β(z,x)) + φ(z,β(x,y)). -/ -noncomputable def _root_.VirasoroProject.cyclicTripleSumHom +@[expose] noncomputable def _root_.VirasoroProject.cyclicTripleSumHom (β : V →ₗ[𝕜] V →ₗ[𝕜] V) (φ : V →ₗ[𝕜] V →ₗ[𝕜] W) : V →ₗ[𝕜] V →ₗ[𝕜] V →ₗ[𝕜] W where toFun := fun x ↦ diff --git a/LeanPool/VirasoroProject/FockSpace.lean b/LeanPool/VirasoroProject/FockSpace.lean index 95c277d24f..ec8f64390e 100644 --- a/LeanPool/VirasoroProject/FockSpace.lean +++ b/LeanPool/VirasoroProject/FockSpace.lean @@ -66,7 +66,7 @@ Heisenberg algebra, Fock space -/ -@[expose] public section +public section @@ -108,7 +108,7 @@ open HeisenbergAlgebra in /-- The triangular decomposition of the Heisenberg algebra with upper and lower (essentially nilpotent) parts spanned by the `Jₖ` with positive and negative `k`, respectively, and the Cartan subalgebra spanned by `J₀` and the central element `K`. -/ -noncomputable def _root_.VirasoroProject.heisenbergTri : +@[expose] noncomputable def _root_.VirasoroProject.heisenbergTri : TriangularDecomposition 𝕜 (HeisenbergAlgebra 𝕜) := TriangularDecomposition.ofBasis (basisJK 𝕜) indexTri pairwise_disjoint_indexTri iUnion_indexTri @@ -147,11 +147,11 @@ noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.hw (α : 𝕜) : (heisenbergTriCartanBasis 𝕜).constr (M' := 𝕜) 𝕜 (fun i ↦ if i.val = none then 1 else α) /-- The Heisenberg generator `K` as an element of the Cartan subalgebra. -/ -noncomputable def _root_.VirasoroProject.heisenbergTriKgen : (heisenbergTri 𝕜).part 0 := +@[expose] noncomputable def _root_.VirasoroProject.heisenbergTriKgen : (heisenbergTri 𝕜).part 0 := ⟨.kgen 𝕜, Submodule.mem_span_of_mem (by simp [indexTri])⟩ /-- The Heisenberg generator `J₀` as an element of the Cartan subalgebra. -/ -noncomputable def _root_.VirasoroProject.heisenbergTriJzero : (heisenbergTri 𝕜).part 0 := +@[expose] noncomputable def _root_.VirasoroProject.heisenbergTriJzero : (heisenbergTri 𝕜).part 0 := ⟨.jgen 𝕜 0, Submodule.mem_span_of_mem (by simp [indexTri])⟩ @[simp] lemma _root_.VirasoroProject.heisenbergTri_kgen_val diff --git a/LeanPool/VirasoroProject/FockSpaceSugawara.lean b/LeanPool/VirasoroProject/FockSpaceSugawara.lean index 7336ef65c0..23f0a3f9d3 100644 --- a/LeanPool/VirasoroProject/FockSpaceSugawara.lean +++ b/LeanPool/VirasoroProject/FockSpaceSugawara.lean @@ -52,7 +52,7 @@ Heisenberg algebra, Fock space, Virasoro algebra, Sugawara construction -/ -@[expose] public section +public section namespace VirasoroProject diff --git a/LeanPool/VirasoroProject/HeisenbergAlgebra.lean b/LeanPool/VirasoroProject/HeisenbergAlgebra.lean index b088bb441a..0e17499469 100644 --- a/LeanPool/VirasoroProject/HeisenbergAlgebra.lean +++ b/LeanPool/VirasoroProject/HeisenbergAlgebra.lean @@ -45,7 +45,7 @@ Heisenberg algebra -/ -@[expose] public section +public section namespace VirasoroProject @@ -63,7 +63,7 @@ variable (ι : Type*) variable (𝕜 : Type*) [CommRing 𝕜] /-- An auxiliary construction of an abelian Lie algebra with a given index set for a basis. -/ -def AbelianLieAlgebraOn := ι →₀ 𝕜 +@[expose] def AbelianLieAlgebraOn := ι →₀ 𝕜 noncomputable instance : AddCommGroup (AbelianLieAlgebraOn ι 𝕜) := Finsupp.instAddCommGroup @@ -74,7 +74,7 @@ namespace AbelianLieAlgebraOn variable {ι} /-- The basis of `jᵢ` generators of the abelian Lie algebra (indices `i : ι`). -/ -noncomputable def jgen : Basis ι 𝕜 (AbelianLieAlgebraOn ι 𝕜) := Finsupp.basisFun _ _ +@[expose] noncomputable def jgen : Basis ι 𝕜 (AbelianLieAlgebraOn ι 𝕜) := Finsupp.basisFun _ _ lemma jgen_eq_single (i : ι) : jgen 𝕜 i = Finsupp.single i 1 := rfl @@ -109,7 +109,7 @@ variable (𝕜 : Type*) [Field 𝕜] /-- A bilinear map version of the Heisenberg cocycle. (Defining equation: `γ (jgen k) (jgen l) = k * δ[k+l,0]`.) -/ -noncomputable def _root_.VirasoroProject.AbelianLieAlgebraOn.heisenbergCocycleBilin : +@[expose] noncomputable def _root_.VirasoroProject.AbelianLieAlgebraOn.heisenbergCocycleBilin : (AbelianLieAlgebraOn ℤ 𝕜) →ₗ[𝕜] (AbelianLieAlgebraOn ℤ 𝕜) →ₗ[𝕜] 𝕜 := (jgen 𝕜).constr 𝕜 <| fun k ↦ (jgen 𝕜).constr 𝕜 <| fun l ↦ if k + l = 0 then k else 0 @@ -129,7 +129,7 @@ lemma _root_.VirasoroProject.AbelianLieAlgebraOn.heisenbergCocycleBilin_eq_neg_f variable [CharZero 𝕜] /-- The Heisenberg cocycle. -/ -noncomputable def _root_.VirasoroProject.AbelianLieAlgebraOn.heisenbergCocycle : +@[expose] noncomputable def _root_.VirasoroProject.AbelianLieAlgebraOn.heisenbergCocycle : LieTwoCocycle 𝕜 (AbelianLieAlgebraOn ℤ 𝕜) 𝕜 where toBilin := heisenbergCocycleBilin 𝕜 self' X := by @@ -172,7 +172,7 @@ variable (𝕜 : Type*) [Field 𝕜] variable [CharZero 𝕜] /-- The Heisenberg algebra. -/ -def _root_.VirasoroProject.HeisenbergAlgebra +@[expose] def _root_.VirasoroProject.HeisenbergAlgebra := LieTwoCocycle.CentralExtension (AbelianLieAlgebraOn.heisenbergCocycle 𝕜) namespace HeisenbergAlgebra @@ -193,14 +193,14 @@ noncomputable instance : LieAlgebra 𝕜 (HeisenbergAlgebra 𝕜) := variable {𝕜} /-- The projection from Heisenberg algebra to the original abelian Lie algebra. -/ -noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.toAbelianLieAlgebraOn +@[expose] noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.toAbelianLieAlgebraOn : HeisenbergAlgebra 𝕜 →ₗ⁅𝕜⁆ AbelianLieAlgebraOn ℤ 𝕜 := LieTwoCocycle.CentralExtension.proj (AbelianLieAlgebraOn.heisenbergCocycle 𝕜) variable (𝕜) /-- The embedding of central elements to Heisenberg algebra. -/ -noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.ofCentral +@[expose] noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.ofCentral : 𝕜 →ₗ⁅𝕜⁆ HeisenbergAlgebra 𝕜 := LieTwoCocycle.CentralExtension.emb (AbelianLieAlgebraOn.heisenbergCocycle 𝕜) @@ -243,12 +243,12 @@ theorem _root_.VirasoroProject.HeisenbergAlgebra.isCentralExtension LieTwoCocycle.CentralExtension.isCentralExtension _ /-- The (commonly used) `Jₖ` elements of the Heisenberg algebra, for `k ∈ ℤ`. -/ -noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.jgen +@[expose] noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.jgen (k : ℤ) : HeisenbergAlgebra 𝕜 := ⟨.jgen 𝕜 k, 0⟩ /-- The `K` central element of the Heisenberg algebra, which is commonly set to 1 (in representations). -/ -noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.kgen +@[expose] noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.kgen : HeisenbergAlgebra 𝕜 := ofCentral 𝕜 1 lemma _root_.VirasoroProject.HeisenbergAlgebra.kgen_eq_ofCentral_one : kgen 𝕜 = ofCentral 𝕜 1 := rfl @@ -289,7 +289,7 @@ lemma _root_.VirasoroProject.HeisenbergAlgebra.toAbelianLieAlgebraOn_kgen : /-- A section of the standard projection from the Heisenberg algebra to the underlying abelian Lie algebra. -/ -noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.jsection +@[expose] noncomputable def _root_.VirasoroProject.HeisenbergAlgebra.jsection : AbelianLieAlgebraOn ℤ 𝕜 →ₗ[𝕜] HeisenbergAlgebra 𝕜 := LieTwoCocycle.CentralExtension.stdSection (AbelianLieAlgebraOn.heisenbergCocycle 𝕜) diff --git a/LeanPool/VirasoroProject/IndexTri.lean b/LeanPool/VirasoroProject/IndexTri.lean index 6670e6e7e5..cf9ba5d053 100644 --- a/LeanPool/VirasoroProject/IndexTri.lean +++ b/LeanPool/VirasoroProject/IndexTri.lean @@ -28,12 +28,12 @@ the triangular decompositions of both the Virasoro algebra and the Heisenberg al -/ -@[expose] public section +public section namespace VirasoroProject /-- The partition of `Option ℤ` into zero, positive, and negative parts. -/ -def indexTri (ε : SignType) : Set (Option ℤ) := match ε with +@[expose] def indexTri (ε : SignType) : Set (Option ℤ) := match ε with | SignType.zero => {none, some 0} | SignType.pos => some '' {n : ℤ | 0 < n} | SignType.neg => some '' {n : ℤ | n < 0} diff --git a/LeanPool/VirasoroProject/IsCentralExtension.lean b/LeanPool/VirasoroProject/IsCentralExtension.lean index 3994bbe82d..b3c2b941af 100644 --- a/LeanPool/VirasoroProject/IsCentralExtension.lean +++ b/LeanPool/VirasoroProject/IsCentralExtension.lean @@ -37,7 +37,7 @@ Lie algebra, central extension, short exact sequence -/ -@[expose] public section +public section namespace VirasoroProject @@ -82,7 +82,7 @@ namespace LieTwoCocycle.CentralExtension /-- If `𝓮` is the (central) extension of `𝓰` by `𝓪` defined by a 2-cocycle `γ ∈ Z²(𝓰,𝓪)`, then `LieTwoCocycle.CentralExtension.emb` gives the corresponding embedding `𝓪 ⟶ 𝓮`. -/ -def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.emb +@[expose] def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.emb [IsLieAbelian 𝓪] : 𝓪 →ₗ⁅𝕜⁆ γ.CentralExtension where toFun := fun A ↦ ⟨0, A⟩ map_add' A₁ A₂ := by @@ -114,7 +114,8 @@ def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.emb /-- If `𝓮` is the (central) extension of `𝓰` by `𝓪` defined by a 2-cocycle `γ ∈ Z²(𝓰,𝓪)`, then `LieTwoCocycle.CentralExtension.proj` gives the corresponding projection `𝓮 ⟶ 𝓰`. -/ -def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.proj : γ.CentralExtension →ₗ⁅𝕜⁆ 𝓰 where +@[expose] def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.proj : + γ.CentralExtension →ₗ⁅𝕜⁆ 𝓰 where toFun := fun ⟨X, _⟩ ↦ X map_add' := by intro ⟨X₁, A₁⟩ ⟨X₂, A₂⟩; rfl map_smul' := by intro c ⟨X, A⟩; rfl @@ -185,7 +186,7 @@ theorem _root_.VirasoroProject.LieTwoCocycle.CentralExtension.isCentralExtension simp /-- A standard section of a Lie algebra central extension associated to a Lie 2-cocycle. -/ -noncomputable def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.stdSection +@[expose] noncomputable def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.stdSection (γ : LieTwoCocycle 𝕜 𝓰 𝓪) : 𝓰 →ₗ[𝕜] γ.CentralExtension where toFun X := ⟨X, 0⟩ @@ -201,7 +202,7 @@ noncomputable def _root_.VirasoroProject.LieTwoCocycle.CentralExtension.stdSecti lemma _root_.VirasoroProject.LieTwoCocycle.CentralExtension.stdSection_prop (γ : LieTwoCocycle 𝕜 𝓰 𝓪) : proj γ ∘ₗ stdSection γ = (1 : 𝓰 →ₗ[𝕜] 𝓰) := - rfl + by rfl end LieTwoCocycle.CentralExtension --namespace diff --git a/LeanPool/VirasoroProject/LieAlgebraModuleUEA.lean b/LeanPool/VirasoroProject/LieAlgebraModuleUEA.lean index 072c8bd7e3..56d561796e 100644 --- a/LeanPool/VirasoroProject/LieAlgebraModuleUEA.lean +++ b/LeanPool/VirasoroProject/LieAlgebraModuleUEA.lean @@ -63,7 +63,7 @@ Lie algebra, universal enveloping algebra -/ -@[expose] public section +public section -- `LieRing.ofAssociativeRing` is only a local instance in Mathlib; it is needed to view the @@ -86,11 +86,11 @@ lemma Algebra.smul_scalar_smul_eq_smul_algebraMap_mul (c : 𝕜) (a : A) : variable (V : Type*) [AddCommGroup V] [Module A V] /-- Any module over an algebra is a module over the scalars. -/ -@[reducible] def moduleScalarOfModule : Module 𝕜 V := +@[expose, reducible] def moduleScalarOfModule : Module 𝕜 V := Module.compHom _ (algebraMap 𝕜 A) lemma moduleScalarOfModule.smul_def (r : 𝕜) (v : V) : - (moduleScalarOfModule 𝕜 A V).smul r v = algebraMap 𝕜 A r • v := + (moduleScalarOfModule 𝕜 A V).smul r v = algebraMap 𝕜 A r • v := by rfl /-- When making any module over an algebra a module over the scalars, these form an @@ -108,7 +108,7 @@ lemma isScalarTowerModuleScalarOfModule : /-- Type synonym of a module over an algebra, when it is to be viewed as a module over the scalars. -/ -def _root_.ModuleOfModuleAlgebra (𝕜 A V : Type*) [CommRing 𝕜] +@[expose] def _root_.ModuleOfModuleAlgebra (𝕜 A V : Type*) [CommRing 𝕜] [Semiring A] [algebra : Algebra 𝕜 A] [AddCommGroup V] [module : Module A V] := let _ : Algebra 𝕜 A := algebra let _ : Module A V := module @@ -200,7 +200,7 @@ def centralSMulHom {z : R} (z_central : ∀ a, z * a = a * z) lemma centralSMulHom_apply {z : R} (z_central : ∀ a, Commute z a) (M : Type*) [AddCommMonoid M] [Module R M] (v : M) : centralSMulHom z_central M v = z • v := - rfl + by rfl variable {𝕜 A : Type*} [CommRing 𝕜] [Semiring A] [Algebra 𝕜 A] variable (M : Type*) [AddCommGroup M] [Module 𝕜 M] [Module A M] [IsScalarTower 𝕜 A M] @@ -388,7 +388,7 @@ structure on `V`. -/ (a : 𝓤 𝕜 𝓰) (v : V) : (LieAlgebra.Representation.moduleUniversalEnvelopingAlgebra ρ).smul a v = UniversalEnvelopingAlgebra.lift 𝕜 ρ a v := - rfl + by rfl /-- The defining property of the `𝓤 𝕜 𝓰`-module structure on a representation `V` of a `𝕜`-Lie algebra `𝓰`. -/ diff --git a/LeanPool/VirasoroProject/LieAlgebraRepresentationOfBasis.lean b/LeanPool/VirasoroProject/LieAlgebraRepresentationOfBasis.lean index e8a1287d77..230c3a1cbf 100644 --- a/LeanPool/VirasoroProject/LieAlgebraRepresentationOfBasis.lean +++ b/LeanPool/VirasoroProject/LieAlgebraRepresentationOfBasis.lean @@ -24,7 +24,7 @@ constructions.) -/ -@[expose] public section +public section namespace LieAlgebra @@ -59,7 +59,7 @@ lemma _root_.LieAlgebra.Representation.apply_bracket_eq_commutator /-- An auxiliary definition for constructing representation of Lie algebras from a basis and a corresponding collection of operators; `representationOfBasisAux` is just a linear map from the Lie algebra to the space of operators (not yet a morphism of Lie algebras). -/ -noncomputable def representationOfBasisAux +@[expose] noncomputable def representationOfBasisAux {𝕂 : Type*} [Field 𝕂] {V : Type*} [AddCommGroup V] [Module 𝕂 V] {𝓰 : Type*} [LieRing 𝓰] [LieAlgebra 𝕂 𝓰] {ι : Type*} (B : Basis ι 𝕂 𝓰) (genOper : ι → (V →ₗ[𝕂] V)) : @@ -94,7 +94,7 @@ lemma representationOfBasisAux_property /-- A representation of a Lie algebra `𝓰` with basis `B` constructed from a collection of operators satisfying the commutation relations specified by the Lie brackets of the basis elements. -/ -noncomputable def representationOfBasis +@[expose] noncomputable def representationOfBasis {𝕂 : Type*} [Field 𝕂] {V : Type*} [AddCommGroup V] [Module 𝕂 V] {𝓰 : Type*} [LieRing 𝓰] [LieAlgebra 𝕂 𝓰] {ι : Type*} (B : Basis ι 𝕂 𝓰) {genOper : ι → (V →ₗ[𝕂] V)} diff --git a/LeanPool/VirasoroProject/LieCohomologySmallDegree.lean b/LeanPool/VirasoroProject/LieCohomologySmallDegree.lean index c8d7e14002..bcc97cc7d3 100644 --- a/LeanPool/VirasoroProject/LieCohomologySmallDegree.lean +++ b/LeanPool/VirasoroProject/LieCohomologySmallDegree.lean @@ -48,7 +48,7 @@ Lie algebra, cohomology -/ -@[expose] public section +public section namespace VirasoroProject @@ -289,20 +289,22 @@ section LieTwoCoboundary variable {𝕜 𝓰 𝓪} /-- A Lie algebra 1-cochain determines a bilinear map via the differential. -/ -def _root_.VirasoroProject.LieOneCochain.bdry' (β : LieOneCochain 𝕜 𝓰 𝓪) : 𝓰 →ₗ[𝕜] 𝓰 →ₗ[𝕜] 𝓪 where +@[expose] def _root_.VirasoroProject.LieOneCochain.bdry' + (β : LieOneCochain 𝕜 𝓰 𝓪) : 𝓰 →ₗ[𝕜] 𝓰 →ₗ[𝕜] 𝓪 where toFun := fun X ↦ β ∘ₗ LieAlgebra.bracketHom 𝕜 𝓰 X map_add' X₁ X₂ := by ext; simp map_smul' c X := by ext; simp /-- A Lie algebra 1-cochain linearly determines a bilinear map via the differential. -/ -def _root_.VirasoroProject.LieOneCochain.bdryHom' +@[expose] def _root_.VirasoroProject.LieOneCochain.bdryHom' : LieOneCochain 𝕜 𝓰 𝓪 →ₗ[𝕜] 𝓰 →ₗ[𝕜] 𝓰 →ₗ[𝕜] 𝓪 where toFun := fun β ↦ LieOneCochain.bdry' β map_add' β₁ β₂ := by ext X Y; rfl map_smul' c Z := by ext X Y; rfl /-- The `∂` of a Lie algebra 1-cochain as a Lie algebra 2-cocycle. -/ -def _root_.VirasoroProject.LieOneCochain.bdry (β : LieOneCochain 𝕜 𝓰 𝓪) : LieTwoCocycle 𝕜 𝓰 𝓪 where +@[expose] def _root_.VirasoroProject.LieOneCochain.bdry + (β : LieOneCochain 𝕜 𝓰 𝓪) : LieTwoCocycle 𝕜 𝓰 𝓪 where toBilin := LieOneCochain.bdryHom' β self' X := by simp [LieOneCochain.bdryHom', LieOneCochain.bdry'] leibniz' X Y Z := by simp [LieOneCochain.bdryHom', LieOneCochain.bdry'] @@ -310,7 +312,7 @@ def _root_.VirasoroProject.LieOneCochain.bdry (β : LieOneCochain 𝕜 𝓰 𝓪 variable (𝕜 𝓰 𝓪) /-- The `∂` as a linear map from Lie algebra 1-cochains to Lie algebra 2-cocycles. -/ -def _root_.VirasoroProject.LieOneCochainBdryHom +@[expose] def _root_.VirasoroProject.LieOneCochainBdryHom : LieOneCochain 𝕜 𝓰 𝓪 →ₗ[𝕜] LieTwoCocycle 𝕜 𝓰 𝓪 where toFun β := β.bdry map_add' _ _ := rfl @@ -322,7 +324,7 @@ def _root_.VirasoroProject.LieOneCochainBdryHom simp lemma _root_.VirasoroProject.LieOneCochain.bdry_apply (β : LieOneCochain 𝕜 𝓰 𝓪) (X Y : 𝓰) : - β.bdry X Y = β (⁅X, Y⁆) := rfl + β.bdry X Y = β (⁅X, Y⁆) := by rfl /-- Lie algebra 2-coboundaries as a vector space. -/ abbrev _root_.VirasoroProject.LieTwoCoboundary := LinearMap.range (LieOneCochainBdryHom 𝕜 𝓰 𝓪) @@ -334,7 +336,8 @@ section LieTwoCohomology /-! ### Lie algebra 2-cohomology -/ /-- The 2-cohomology `H²(𝓰,𝓪)` of a Lie algebra `𝓰` with coefficients in `𝓪`. -/ -def _root_.VirasoroProject.LieTwoCohomology := LieTwoCocycle 𝕜 𝓰 𝓪 ⧸ LieTwoCoboundary 𝕜 𝓰 𝓪 +@[expose] def _root_.VirasoroProject.LieTwoCohomology := + LieTwoCocycle 𝕜 𝓰 𝓪 ⧸ LieTwoCoboundary 𝕜 𝓰 𝓪 namespace LieTwoCohomology @@ -352,7 +355,7 @@ namespace LieTwoCocycle /-- The linear map from 2-cocycles to 2-cohomologies of a Lie algebra `𝓰` with coefficients in `𝓪`. -/ -def _root_.VirasoroProject.LieTwoCocycle.toLieTwoCohomology +@[expose] def _root_.VirasoroProject.LieTwoCocycle.toLieTwoCohomology : LieTwoCocycle 𝕜 𝓰 𝓪 →ₗ[𝕜] LieTwoCohomology 𝕜 𝓰 𝓪 := (LieTwoCoboundary 𝕜 𝓰 𝓪).mkQ @@ -364,7 +367,7 @@ variable {𝕜 𝓰 𝓪} /-- The projection to 2-cohomologies from 2-cocycles of a Lie algebra `𝓰` with coefficients in `𝓪`. (This definition is to enable dot notation, while the linear map version doesn't.) -/ -def _root_.VirasoroProject.LieTwoCocycle.cohomologyClass +@[expose] def _root_.VirasoroProject.LieTwoCocycle.cohomologyClass (γ : LieTwoCocycle 𝕜 𝓰 𝓪) : LieTwoCohomology 𝕜 𝓰 𝓪 := LieTwoCocycle.toLieTwoCohomology _ _ _ γ @@ -418,7 +421,7 @@ lemma _root_.VirasoroProject.LieTwoCocycle.ker_toLieTwoCohomology_eq_bot_of_isLi /-- For abelian Lie algebras, the map from 2-cocycles to their cohomology classes is a linear equivalence. -/ -noncomputable def _root_.VirasoroProject.LieTwoCocycle.toLieTwoCohomologyEquiv : +@[expose] noncomputable def _root_.VirasoroProject.LieTwoCocycle.toLieTwoCohomologyEquiv : LieTwoCocycle 𝕜 𝓰 𝓪 ≃ₗ[𝕜] LieTwoCohomology 𝕜 𝓰 𝓪 := LinearEquiv.ofBijective (LieTwoCocycle.toLieTwoCohomology 𝕜 𝓰 𝓪) ⟨LinearMap.ker_eq_bot.mp <| LieTwoCocycle.ker_toLieTwoCohomology_eq_bot_of_isLieAbelian .., diff --git a/LeanPool/VirasoroProject/LieVerma.lean b/LeanPool/VirasoroProject/LieVerma.lean index f03794dcb2..9a60dfa2ed 100644 --- a/LeanPool/VirasoroProject/LieVerma.lean +++ b/LeanPool/VirasoroProject/LieVerma.lean @@ -59,7 +59,7 @@ Verma module, Lie algebra, representation -/ -@[expose] public section +public section namespace VirasoroProject @@ -82,7 +82,8 @@ namespace TriangularDecomposition variable {𝕜 𝓰} in /-- The triangular decomposition induced by a basis and a partition of the basis indices. -/ -def ofBasis {ι : Type*} [Nontrivial 𝕜] [IsCancelMulZero 𝕜] [Module.IsTorsionFree 𝕜 𝓰] +@[expose] def ofBasis {ι : Type*} [Nontrivial 𝕜] [IsCancelMulZero 𝕜] + [Module.IsTorsionFree 𝕜 𝓰] (B : Basis ι 𝕜 𝓰) (Bp : SignType → Set ι) (Bp_disj : Pairwise (fun ε₁ ε₂ ↦ Disjoint (Bp ε₁) (Bp ε₂))) (Bp_cover : ⋃ ε, Bp ε = Set.univ) : @@ -126,7 +127,8 @@ def ofBasis {ι : Type*} [Nontrivial 𝕜] [IsCancelMulZero 𝕜] [Module.IsTors variable {𝕜 𝓰} in /-- The parts of a triangular decomposition determined by a basis have natural bases by construction. -/ -noncomputable def _root_.VirasoroProject.TriangularDecomposition.ofBasis.basisPart {ι : Type*} +@[expose] noncomputable def _root_.VirasoroProject.TriangularDecomposition.ofBasis.basisPart + {ι : Type*} [Nontrivial 𝕜] [IsCancelMulZero 𝕜] [Module.IsTorsionFree 𝕜 𝓰] (B : Basis ι 𝕜 𝓰) (Bp : SignType → Set ι) (Bp_disj : Pairwise (fun ε₁ ε₂ ↦ Disjoint (Bp ε₁) (Bp ε₂))) @@ -160,13 +162,13 @@ noncomputable def weightHW (η : weight tri) (i : tri.cartan ⊕ tri.upper) : | Sum.inr E => ⟨ιUEA 𝕜 E, 0⟩ /-- The Verma module of highest weight η. -/ -def VermaHW (η : weight tri) := +@[expose] def VermaHW (η : weight tri) := VermaModule (weightHW η) variable (η : weight tri) /-- The highest weight vector of the Verma module of highest weight η. -/ -noncomputable def _root_.VirasoroProject.TriangularDecomposition.VermaHW.hwVec +@[expose] noncomputable def _root_.VirasoroProject.TriangularDecomposition.VermaHW.hwVec (η : weight tri) : VermaHW η := VermaModule.hwVec _ @@ -216,7 +218,7 @@ lemma _root_.VirasoroProject.TriangularDecomposition.VermaHW.cartan_smul_hwVec /-- The universal map from a Verma module to any module with a vector of the given highest weight. -/ -noncomputable def _root_.VirasoroProject.TriangularDecomposition.VermaHW.universalMap +@[expose] noncomputable def _root_.VirasoroProject.TriangularDecomposition.VermaHW.universalMap (η : weight tri) (M : Type*) [AddCommGroup M] [Module (𝓤 𝕜 𝓰) M] {hwv : M} (hwv_cartan : ∀ {H} (hH : H ∈ tri.cartan), diff --git a/LeanPool/VirasoroProject/SectionSES.lean b/LeanPool/VirasoroProject/SectionSES.lean index a69c71c0db..28f6ac995d 100644 --- a/LeanPool/VirasoroProject/SectionSES.lean +++ b/LeanPool/VirasoroProject/SectionSES.lean @@ -43,7 +43,7 @@ short exact sequence -/ -@[expose] public section +public section section group_section diff --git a/LeanPool/VirasoroProject/Sugawara.lean b/LeanPool/VirasoroProject/Sugawara.lean index ed9e87bc6f..8d9fa2f4a0 100644 --- a/LeanPool/VirasoroProject/Sugawara.lean +++ b/LeanPool/VirasoroProject/Sugawara.lean @@ -61,7 +61,7 @@ Sugawara construction, Virasoro algebra, Heisenberg algebra, bosonic Fock space -/ -@[expose] public section +public section namespace VirasoroProject @@ -247,7 +247,7 @@ lemma heiPairNO_trunc_cofinite_sub (n : ℤ) (v : V) : open Topology /-- The basic bosonic Sugawara generators (an auxiliary definition). -/ -noncomputable def sugawaraGenAux (n : ℤ) (v : V) : V := +@[expose] noncomputable def sugawaraGenAux (n : ℤ) (v : V) : V := (2 : 𝕜)⁻¹ • ∑ᶠ k, pairNO heiOper (n-k) k v omit heiTrunc in @@ -283,7 +283,7 @@ lemma sugawaraGenAux_smul (n : ℤ) (c : 𝕜) (v : V) : simp [sugawaraGenAux_def, map_smul, smul_finsum, smul_comm c] /-- The basic bosonic Sugawara generators (as linear operators). -/ -noncomputable def sugawaraGen (n : ℤ) : V →ₗ[𝕜] V where +@[expose] noncomputable def sugawaraGen (n : ℤ) : V →ₗ[𝕜] V where toFun := sugawaraGenAux heiOper n map_add' v w := sugawaraGenAux_add heiTrunc n v w map_smul' c v := sugawaraGenAux_smul heiOper n c v @@ -682,7 +682,7 @@ section representation /-- Construct a representation of Virasoro algebra from a central charge value `c` and a collection `(Lₙ)`, `n ∈ ℤ`, of operators satisfying the commutation relations of Virasoro generators with that central charge. -/ -noncomputable def _root_.VirasoroProject.VirasoroAlgebra.representationOfCentralChargeOfL +@[expose] noncomputable def _root_.VirasoroProject.VirasoroAlgebra.representationOfCentralChargeOfL {𝕂 : Type*} [Field 𝕂] [CharZero 𝕂] {V : Type*} [AddCommGroup V] [Module 𝕂 V] (c : 𝕂) {lOper : ℤ → (V →ₗ[𝕂] V)} (lComm : ∀ n m, (lOper n).commutator (lOper m) diff --git a/LeanPool/VirasoroProject/ToMathlib.lean b/LeanPool/VirasoroProject/ToMathlib.lean index 10e3f112df..7e31bda1c2 100644 --- a/LeanPool/VirasoroProject/ToMathlib.lean +++ b/LeanPool/VirasoroProject/ToMathlib.lean @@ -16,4 +16,4 @@ Import-only index for project-local lemmas and constructions that were developed as Mathlib-facing support code. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Algebra.lean b/LeanPool/VirasoroProject/ToMathlib/Algebra.lean index a22663c7f6..2cee6fe438 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Algebra.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Algebra.lean @@ -13,4 +13,4 @@ public import LeanPool.VirasoroProject.ToMathlib.Algebra.Lie Import-only index for algebra support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie.lean b/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie.lean index 44246f9b04..889db119fa 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie.lean @@ -14,4 +14,4 @@ public import LeanPool.VirasoroProject.ToMathlib.Algebra.Lie.Basic Import-only index for Lie algebra support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Abelian.lean b/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Abelian.lean index 11e54a6e9f..af3cd54a7a 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Abelian.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Abelian.lean @@ -11,7 +11,7 @@ public import Mathlib.Algebra.Lie.Abelian # LeanPool.VirasoroProject.ToMathlib.Algebra.Lie.Abelian -/ -@[expose] public section +public section instance _root_.CommRing.isLieAbelian (R : Type*) [CommRing R] : IsLieAbelian R where trivial c₁ c₂ := by diff --git a/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Basic.lean b/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Basic.lean index c8b5a9b44d..d571a7ac31 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Basic.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Algebra/Lie/Basic.lean @@ -11,14 +11,14 @@ public import Mathlib.Algebra.Lie.Basic # LeanPool.VirasoroProject.ToMathlib.Algebra.Lie.Basic -/ -@[expose] public section +public section universe u variable (𝕜 : Type*) [CommRing 𝕜] variable (𝓰 : Type u) [LieRing 𝓰] [LieAlgebra 𝕜 𝓰] /-- `⁅·,·⁆` as a bilinear map. -/ -def LieAlgebra.bracketHom : 𝓰 →ₗ[𝕜] 𝓰 →ₗ[𝕜] 𝓰 where +@[expose] def LieAlgebra.bracketHom : 𝓰 →ₗ[𝕜] 𝓰 →ₗ[𝕜] 𝓰 where toFun := fun X ↦ { toFun := fun Y ↦ ⁅X, Y⁆ map_add' := by simp diff --git a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra.lean b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra.lean index 799d341d21..160c30d8bf 100644 --- a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra.lean +++ b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra.lean @@ -14,4 +14,4 @@ public import LeanPool.VirasoroProject.ToMathlib.LinearAlgebra.Finsupp Import-only index for linear algebra support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis.lean b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis.lean index cdd2f1e144..cf423003a9 100644 --- a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis.lean +++ b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis.lean @@ -14,4 +14,4 @@ public import LeanPool.VirasoroProject.ToMathlib.LinearAlgebra.Basis.FinsumRepr Import-only index for basis support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/Defs.lean b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/Defs.lean index 17e5824596..d4edb8e373 100644 --- a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/Defs.lean +++ b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/Defs.lean @@ -11,8 +11,9 @@ public import Mathlib.LinearAlgebra.Basis.Defs # LeanPool.VirasoroProject.ToMathlib.LinearAlgebra.Basis.Defs -/ -@[expose] public section +public section /-- Standard basis of the space of finitely supported functions. -/ -noncomputable def Finsupp.basisFun (X R : Type*) [Semiring R] : Module.Basis X R (X →₀ R) where +@[expose] noncomputable def Finsupp.basisFun (X R : Type*) [Semiring R] : + Module.Basis X R (X →₀ R) where repr := (LinearEquiv.refl _ _) diff --git a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/FinsumRepr.lean b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/FinsumRepr.lean index c8914a125c..dbb6b37530 100644 --- a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/FinsumRepr.lean +++ b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Basis/FinsumRepr.lean @@ -13,7 +13,7 @@ import Mathlib.LinearAlgebra.Basis.Basic # LeanPool.VirasoroProject.ToMathlib.LinearAlgebra.Basis.FinsumRepr -/ -@[expose] public section +public section lemma smul_support_subset_left {R M ι : Type*} [Semiring R] [AddCommGroup M] [Module R M] (v : ι → M) (cf : ι → R) : @@ -132,7 +132,7 @@ lemma repr_finsum_mem_eq_ite {R M ι : Type*} [Semiring R] [Nontrivial R] [IsCan by_cases hi : i ∈ I <;> simp [hi, aux i] /-- The basis on the span of a subset of a basis, indexed by that subset. -/ - noncomputable def basisSubmoduleSpan {R M ι : Type*} +@[expose] noncomputable def basisSubmoduleSpan {R M ι : Type*} [Semiring R] [Nontrivial R] [IsCancelMulZero R] [AddCommGroup M] [Module R M] [Module.IsTorsionFree R M] (B : Basis ι R M) (I : Set ι) : Basis I R (Submodule.span R (B '' I)) := diff --git a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp.lean b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp.lean index 27438fc415..e22198fab9 100644 --- a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp.lean +++ b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp.lean @@ -14,4 +14,4 @@ Import-only index for finitely supported function support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp/Supported.lean b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp/Supported.lean index d0e31a6a4b..8fab17f011 100644 --- a/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp/Supported.lean +++ b/LeanPool/VirasoroProject/ToMathlib/LinearAlgebra/Finsupp/Supported.lean @@ -13,7 +13,7 @@ import Mathlib.Algebra.Module.Submodule.Basic # LeanPool.VirasoroProject.ToMathlib.LinearAlgebra.Finsupp.Supported -/ -@[expose] public section +public section --import Mathlib diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology.lean b/LeanPool/VirasoroProject/ToMathlib/Topology.lean index c726d038e0..2c0853242b 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology.lean @@ -14,4 +14,4 @@ public import LeanPool.VirasoroProject.ToMathlib.Topology.Order Import-only index for topology support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra.lean index 684d831fee..f721774b12 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra.lean @@ -17,4 +17,4 @@ Import-only index for topological algebra support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators.lean index 94d44fe89b..f884111805 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators.lean @@ -13,4 +13,4 @@ public import LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.BigOperators.F Import-only index for big-operator support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators/FinProd.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators/FinProd.lean index a32912d3ed..74c7afe136 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators/FinProd.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/BigOperators/FinProd.lean @@ -11,7 +11,7 @@ public import Mathlib.Algebra.BigOperators.Finprod # LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.BigOperators.FinProd -/ -@[expose] public section +public section section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/ConstMulAction.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/ConstMulAction.lean index 7efe0416d4..d65cb677a0 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/ConstMulAction.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/ConstMulAction.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.Algebra.ConstMulAction # LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.ConstMulAction -/ -@[expose] public section +public section lemma continuousConstSMul_of_discreteTopology (𝕜 X : Type*) [TopologicalSpace X] [DiscreteTopology X] [SMul 𝕜 X] : diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum.lean index 1686f87175..85fbb812b7 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum.lean @@ -13,4 +13,4 @@ public import LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.InfiniteSum.Ba Import-only index for infinite-sum support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum/Basic.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum/Basic.lean index b72e29b00f..cc8eb6a494 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum/Basic.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/InfiniteSum/Basic.lean @@ -12,7 +12,7 @@ import Mathlib.Topology.Algebra.InfiniteSum.Basic # LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.InfiniteSum.Basic -/ -@[expose] public section +public section section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module.lean index b831fe9f81..1ff598b2b2 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module.lean @@ -14,4 +14,4 @@ Import-only index for topological module support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap.lean index 6b5d500148..962a8f4e87 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap.lean @@ -13,4 +13,4 @@ public import LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.Module.LinearM Import-only index for linear-map support modules used by the Virasoro Project. -/ -@[expose] public section +public section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap/Defs.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap/Defs.lean index 776c0c3687..d0607a9dc0 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap/Defs.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Algebra/Module/LinearMap/Defs.lean @@ -12,7 +12,7 @@ public import Mathlib.Algebra.Module.LinearMap.Defs # LeanPool.VirasoroProject.ToMathlib.Topology.Algebra.Module.LinearMap.Defs -/ -@[expose] public section +public section section diff --git a/LeanPool/VirasoroProject/ToMathlib/Topology/Order.lean b/LeanPool/VirasoroProject/ToMathlib/Topology/Order.lean index 77a424eead..2347585808 100644 --- a/LeanPool/VirasoroProject/ToMathlib/Topology/Order.lean +++ b/LeanPool/VirasoroProject/ToMathlib/Topology/Order.lean @@ -11,7 +11,7 @@ public import Mathlib.Topology.Order # LeanPool.VirasoroProject.ToMathlib.Topology.Order -/ -@[expose] public section +public section section diff --git a/LeanPool/VirasoroProject/VermaModule.lean b/LeanPool/VirasoroProject/VermaModule.lean index 5e37881d3c..03b01cff7a 100644 --- a/LeanPool/VirasoroProject/VermaModule.lean +++ b/LeanPool/VirasoroProject/VermaModule.lean @@ -52,7 +52,7 @@ Verma module -/ -@[expose] public section +public section namespace VirasoroProject @@ -124,7 +124,7 @@ def _root_.VirasoroProject.vermaIdeal (η : ι → A × 𝕜) : /-- The (generalied) Verma module of an algebra `A`: `η : ι → A × 𝕜` is an indexed collection of algebra elements and scalars by which they should act on the "highest weight vector". -/ -def _root_.VirasoroProject.VermaModule (η : ι → A × 𝕜) := +@[expose] def _root_.VirasoroProject.VermaModule (η : ι → A × 𝕜) := A ⧸ vermaIdeal η /-- The highest weight vector in a (generalized) Verma module. -/ diff --git a/LeanPool/VirasoroProject/VirasoroAlgebra.lean b/LeanPool/VirasoroProject/VirasoroAlgebra.lean index 5ac0a76e4f..bd7c9750bf 100644 --- a/LeanPool/VirasoroProject/VirasoroAlgebra.lean +++ b/LeanPool/VirasoroProject/VirasoroAlgebra.lean @@ -50,7 +50,7 @@ Virasoro algebra -/ -@[expose] public section +public section namespace VirasoroProject @@ -66,7 +66,7 @@ variable (𝕜 : Type*) [Field 𝕜] variable [CharZero 𝕜] /-- The Virasoro algebra. -/ -def VirasoroAlgebra := LieTwoCocycle.CentralExtension (WittAlgebra.virasoroCocycle 𝕜) +@[expose] def VirasoroAlgebra := LieTwoCocycle.CentralExtension (WittAlgebra.virasoroCocycle 𝕜) namespace VirasoroAlgebra @@ -85,13 +85,13 @@ noncomputable instance : LieAlgebra 𝕜 (VirasoroAlgebra 𝕜) := variable {𝕜} /-- The projection from Virasoro algebra to Witt algebra. -/ -noncomputable def toWittAlgebra : VirasoroAlgebra 𝕜 →ₗ⁅𝕜⁆ WittAlgebra 𝕜 := +@[expose] noncomputable def toWittAlgebra : VirasoroAlgebra 𝕜 →ₗ⁅𝕜⁆ WittAlgebra 𝕜 := LieTwoCocycle.CentralExtension.proj (WittAlgebra.virasoroCocycle 𝕜) variable (𝕜) /-- The embedding of central elements to Virasoro algebra. -/ -noncomputable def ofCentral : 𝕜 →ₗ⁅𝕜⁆ VirasoroAlgebra 𝕜 := +@[expose] noncomputable def ofCentral : 𝕜 →ₗ⁅𝕜⁆ VirasoroAlgebra 𝕜 := LieTwoCocycle.CentralExtension.emb (WittAlgebra.virasoroCocycle 𝕜) lemma bracket_def' (X Y : VirasoroAlgebra 𝕜) : @@ -128,11 +128,11 @@ theorem isCentralExtension : LieAlgebra.IsCentralExtension (ofCentral 𝕜) toWi LieTwoCocycle.CentralExtension.isCentralExtension _ /-- The (commonly used) `Lₙ` elements of the Virasoro algebra, for `n ∈ ℤ`. -/ -noncomputable def lgen (n : ℤ) : VirasoroAlgebra 𝕜 := +@[expose] noncomputable def lgen (n : ℤ) : VirasoroAlgebra 𝕜 := ⟨WittAlgebra.lgen 𝕜 n, 0⟩ /-- The (commonly used) `C` central element of the Virasoro algebra. -/ -noncomputable def cgen : VirasoroAlgebra 𝕜 := ofCentral 𝕜 1 +@[expose] noncomputable def cgen : VirasoroAlgebra 𝕜 := ofCentral 𝕜 1 lemma cgen_eq_ofCentral_one : cgen 𝕜 = ofCentral 𝕜 1 := rfl @@ -192,7 +192,7 @@ lemma lgen_bracket' (n m : ℤ) : rw [lgen_bracket]; congr; ring /-- A section of the standard projection from the Virasoro algebra to the Witt algebra. -/ -noncomputable def lsection : WittAlgebra 𝕜 →ₗ[𝕜] VirasoroAlgebra 𝕜 := +@[expose] noncomputable def lsection : WittAlgebra 𝕜 →ₗ[𝕜] VirasoroAlgebra 𝕜 := LieTwoCocycle.CentralExtension.stdSection (WittAlgebra.virasoroCocycle 𝕜) lemma lsection_prop : toWittAlgebra.toLinearMap ∘ₗ lsection 𝕜 = 1 := by diff --git a/LeanPool/VirasoroProject/VirasoroCocycle.lean b/LeanPool/VirasoroProject/VirasoroCocycle.lean index 91f18cedfc..371fb0999f 100644 --- a/LeanPool/VirasoroProject/VirasoroCocycle.lean +++ b/LeanPool/VirasoroProject/VirasoroCocycle.lean @@ -41,7 +41,7 @@ Witt algebra, Virasoro algebra, Lie algebra cohomology -/ -@[expose] public section +public section namespace VirasoroProject @@ -99,7 +99,7 @@ lemma virasoroCocycleBilin_eq_neg_flip : variable [CharZero 𝕜] /-- The Virasoro cocycle. -/ -noncomputable def virasoroCocycle : +@[expose] noncomputable def virasoroCocycle : LieTwoCocycle 𝕜 (WittAlgebra 𝕜) 𝕜 where toBilin := virasoroCocycleBilin 𝕜 self' X := by diff --git a/LeanPool/VirasoroProject/VirasoroVerma.lean b/LeanPool/VirasoroProject/VirasoroVerma.lean index 117fae219a..180580f5c8 100644 --- a/LeanPool/VirasoroProject/VirasoroVerma.lean +++ b/LeanPool/VirasoroProject/VirasoroVerma.lean @@ -55,7 +55,7 @@ Virasoro algebra, Verma module -/ -@[expose] public section +public section namespace VirasoroProject @@ -84,7 +84,7 @@ open VirasoroAlgebra in /-- The triangular decomposition of the Virasoro algebra with upper and lower (essentially nilpotent) parts spanned by the `Lₙ` with positive and negative `n`, respectively, and the Cartan subalgebra spanned by `L₀` and the central element `C`. -/ -noncomputable def _root_.VirasoroProject.virasoroTri : +@[expose] noncomputable def _root_.VirasoroProject.virasoroTri : TriangularDecomposition 𝕜 (VirasoroAlgebra 𝕜) := TriangularDecomposition.ofBasis (basisLC 𝕜) indexTri pairwise_disjoint_indexTri iUnion_indexTri @@ -123,11 +123,11 @@ noncomputable def _root_.VirasoroProject.VirasoroAlgebra.hw (c h : 𝕜) : (virasoroTriCartanBasis 𝕜).constr (M' := 𝕜) 𝕜 (fun i ↦ if i.val = none then c else h) /-- The Virasoro generator `C` as an element of the Cartan subalgebra. -/ -noncomputable def _root_.VirasoroProject.virasoroTriCgen : (virasoroTri 𝕜).part 0 := +@[expose] noncomputable def _root_.VirasoroProject.virasoroTriCgen : (virasoroTri 𝕜).part 0 := ⟨.cgen 𝕜, Submodule.mem_span_of_mem (by simp [indexTri])⟩ /-- The Virasoro generator `L₀` as an element of the Cartan subalgebra. -/ -noncomputable def _root_.VirasoroProject.virasoroTriLzero : (virasoroTri 𝕜).part 0 := +@[expose] noncomputable def _root_.VirasoroProject.virasoroTriLzero : (virasoroTri 𝕜).part 0 := ⟨.lgen 𝕜 0, Submodule.mem_span_of_mem (by simp [indexTri])⟩ @[simp] lemma _root_.VirasoroProject.virasoroTri_cgen_val : diff --git a/LeanPool/VirasoroProject/WittAlgebra.lean b/LeanPool/VirasoroProject/WittAlgebra.lean index 3f6292d313..eeb6930fc3 100644 --- a/LeanPool/VirasoroProject/WittAlgebra.lean +++ b/LeanPool/VirasoroProject/WittAlgebra.lean @@ -53,7 +53,7 @@ Witt algebra -/ -@[expose] public section +public section namespace VirasoroProject @@ -62,7 +62,7 @@ open Module variable (𝕜 : Type*) [CommRing 𝕜] /-- The Witt algebra: an ∞-dimensional Lie algebra (polynomial vector fields on a circle). -/ -def WittAlgebra := ℤ →₀ 𝕜 +@[expose] def WittAlgebra := ℤ →₀ 𝕜 noncomputable instance : AddCommGroup (WittAlgebra 𝕜) := Finsupp.instAddCommGroup @@ -71,12 +71,12 @@ noncomputable instance : Module 𝕜 (WittAlgebra 𝕜) := Finsupp.module .. namespace WittAlgebra /-- The basis of `ℓₙ` generators of the Witt algebra (indices `n : ℤ`). -/ -noncomputable def lgen : Basis ℤ 𝕜 (WittAlgebra 𝕜) := Finsupp.basisFun _ _ +@[expose] noncomputable def lgen : Basis ℤ 𝕜 (WittAlgebra 𝕜) := Finsupp.basisFun _ _ lemma lgen_eq_single (n : ℤ) : lgen 𝕜 n = Finsupp.single n 1 := rfl /-- The Lie bracket for the Witt algebra `WittAlgebra` as a bilinear map. -/ -noncomputable def bracket : +@[expose] noncomputable def bracket : (WittAlgebra 𝕜) →ₗ[𝕜] (WittAlgebra 𝕜) →ₗ[𝕜] (WittAlgebra 𝕜) := (lgen 𝕜).constr 𝕜 <| fun n ↦ (lgen 𝕜).constr 𝕜 <| fun m ↦ (n - m : 𝕜) • lgen 𝕜 (n + m) diff --git a/LeanPool/VirasoroProject/WittAlgebraCohomology.lean b/LeanPool/VirasoroProject/WittAlgebraCohomology.lean index f5d08372b4..a11cd053ea 100644 --- a/LeanPool/VirasoroProject/WittAlgebraCohomology.lean +++ b/LeanPool/VirasoroProject/WittAlgebraCohomology.lean @@ -38,7 +38,7 @@ Witt algebra, Lie algebra cohomology -/ -@[expose] public section +public section namespace VirasoroProject diff --git a/LeanPool/Vlasov.lean b/LeanPool/Vlasov.lean index 242628cd01..11a45daa9e 100644 --- a/LeanPool/Vlasov.lean +++ b/LeanPool/Vlasov.lean @@ -20,4 +20,4 @@ Tags: kinetic-theory, mean-field-limit, optimal-transport, wasserstein-distance, MSC: 35Q83, 82C22, 49Q22 -/ -@[expose] public section +public section diff --git a/LeanPool/Vlasov/Base.lean b/LeanPool/Vlasov/Base.lean index ec1bea331f..fdd85d2d65 100644 --- a/LeanPool/Vlasov/Base.lean +++ b/LeanPool/Vlasov/Base.lean @@ -9,4 +9,4 @@ public import LeanPool.Vlasov.Base.Geometry /-! # Ambient geometry: the physical and phase spaces. -/ -@[expose] public section +public section diff --git a/LeanPool/Vlasov/Base/Geometry.lean b/LeanPool/Vlasov/Base/Geometry.lean index e8387c0fdd..09b0b8814f 100644 --- a/LeanPool/Vlasov/Base/Geometry.lean +++ b/LeanPool/Vlasov/Base/Geometry.lean @@ -14,7 +14,7 @@ Throughout, `d : ℕ` is the spatial dimension. Single-particle physical space (position × velocity). These are the shared ambient types that both the optimal-transport layer and the kinetic (Vlasov) layer are built over. -/ -@[expose] public section +public section namespace Vlasov diff --git a/LeanPool/Vlasov/Basic.lean b/LeanPool/Vlasov/Basic.lean index 6524bb2de9..328af053e4 100644 --- a/LeanPool/Vlasov/Basic.lean +++ b/LeanPool/Vlasov/Basic.lean @@ -38,7 +38,7 @@ mean-field theory of the Vlasov equation: `(tex: …)` labels cross-reference the companion LaTeX paper. -/ -@[expose] public section +public section open MeasureTheory @@ -251,7 +251,7 @@ lemma empiricalMeasure_isProbabilityMeasure (N : ℕ) [NeZero N] /-- (tex: def:empirical) The time-dependent empirical measure μ_t^N along a solution of eq:newton. -/ -noncomputable def empiricalMeasureCurve (N : ℕ) (X V : ℝ → Fin N → PhysSpace d) : +@[expose] noncomputable def empiricalMeasureCurve (N : ℕ) (X V : ℝ → Fin N → PhysSpace d) : ℝ → Measure (PhaseSpace d) := fun t => empiricalMeasure N (X t) (V t) @@ -264,12 +264,12 @@ noncomputable def empiricalMeasureCurve (N : ℕ) (X V : ℝ → Fin N → PhysS /-- Convolution of a function k : ℝ^d → ℝ^d with a (finite) measure ρ on ℝ^d: (k * ρ)(x) := ∫ k(x − y) dρ(y). -/ -noncomputable def convolveFunctionMeasure (k : PhysSpace d → PhysSpace d) +@[expose] noncomputable def convolveFunctionMeasure (k : PhysSpace d → PhysSpace d) (ρ : Measure (PhysSpace d)) (x : PhysSpace d) : PhysSpace d := ∫ y, k (x - y) ∂ρ /-- Spatial marginal of a measure on phase space. -/ -noncomputable def spatialMarginal (μ : Measure (PhaseSpace d)) : +@[expose] noncomputable def spatialMarginal (μ : Measure (PhaseSpace d)) : Measure (PhysSpace d) := Measure.map Prod.fst μ @@ -757,7 +757,7 @@ for every φ ∈ C_c^∞(ℝ^d × ℝ^d), with |R_N(t)| ≤ (1/N) ‖∇W‖_∞ This is a `Prop`-valued definition packaging the statement of eq:weak-eq. -/ -def WeakEvolutionEq (gradW : PhysSpace d → PhysSpace d) +@[expose] def WeakEvolutionEq (gradW : PhysSpace d → PhysSpace d) (μ : ℝ → Measure (PhaseSpace d)) (φ : PhaseSpace d → ℝ) (gradXφ gradVφ : PhaseSpace d → PhysSpace d) @@ -834,7 +834,7 @@ the map t ↦ ∫ φ df_t satisfies d/dt ∫ φ df_t = ∫ [v · ∇_x φ − (∇W * ρ_t)(x) · ∇_v φ] df_t. -/ -def IsVlasovSolution (gradW : PhysSpace d → PhysSpace d) +@[expose] def IsVlasovSolution (gradW : PhysSpace d → PhysSpace d) (f : ℝ → Measure (PhaseSpace d)) : Prop := ∀ (φ : PhaseSpace d → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → @@ -873,7 +873,7 @@ theorem empiricalMeasure_isVlasovSolution -- condition on the norm. /-- Predicate: μ is a probability measure on PhaseSpace d with finite first moment. -/ -def HasFiniteFirstMoment (μ : Measure (PhaseSpace d)) : Prop := +@[expose] def HasFiniteFirstMoment (μ : Measure (PhaseSpace d)) : Prop := IsProbabilityMeasure μ ∧ Integrable (fun z : PhaseSpace d => ‖z‖) μ omit [NeZero d] in @@ -924,7 +924,7 @@ is the characteristic flow associated to a given curve of spatial marginal measu The self-consistent condition (ρ_t is the pushforward of f_0 under X(t, ·)) is captured by `IsCharacteristicFlowSelfConsistent`. -/ -def IsCharacteristicFlow +@[expose] def IsCharacteristicFlow (gradW : PhysSpace d → PhysSpace d) (ρ : ℝ → Measure (PhysSpace d)) (charX charV : ℝ → PhaseSpace d → PhysSpace d) : Prop := @@ -939,7 +939,7 @@ def IsCharacteristicFlow /-- (tex: eq:char) The self-consistency condition: the spatial marginal ρ_t equals the pushforward of the initial spatial marginal f₀_x under the position map X(t, ·). -/ -def IsCharacteristicFlowSelfConsistent +@[expose] def IsCharacteristicFlowSelfConsistent (charX : ℝ → PhaseSpace d → PhysSpace d) (f₀ : Measure (PhaseSpace d)) (ρ : ℝ → Measure (PhysSpace d)) : Prop := @@ -948,7 +948,7 @@ def IsCharacteristicFlowSelfConsistent /-- (tex: eq:char) The Vlasov solution f_t is the pushforward of f_0 under the characteristic map (X(t,·), V(t,·)). -/ -noncomputable def vlasovSolutionViaPushforward +@[expose] noncomputable def vlasovSolutionViaPushforward (charX charV : ℝ → PhaseSpace d → PhysSpace d) (f₀ : Measure (PhaseSpace d)) (t : ℝ) : Measure (PhaseSpace d) := Measure.map (fun z => (charX t z, charV t z)) f₀ @@ -978,7 +978,7 @@ Producers: conclusion costs no extra infrastructure. `IsLagrangianVlasovSolution gradW f → IsVlasovSolution gradW f` by `.1`. -/ -def IsLagrangianVlasovSolution (gradW : PhysSpace d → PhysSpace d) +@[expose] def IsLagrangianVlasovSolution (gradW : PhysSpace d → PhysSpace d) (f : ℝ → Measure (PhaseSpace d)) : Prop := IsVlasovSolution gradW f ∧ ∃ charX charV : ℝ → PhaseSpace d → PhysSpace d, diff --git a/LeanPool/Vlasov/ForMathlib.lean b/LeanPool/Vlasov/ForMathlib.lean index 3cefd19965..d427d8e13b 100644 --- a/LeanPool/Vlasov/ForMathlib.lean +++ b/LeanPool/Vlasov/ForMathlib.lean @@ -9,4 +9,4 @@ public import LeanPool.Vlasov.ForMathlib.PicardLindelof /-! # Vendored Picard-Lindelof with an explicit confinement conjunct. -/ -@[expose] public section +public section diff --git a/LeanPool/Vlasov/ForMathlib/PicardLindelof.lean b/LeanPool/Vlasov/ForMathlib/PicardLindelof.lean index 9ec7c25296..8daf403b36 100644 --- a/LeanPool/Vlasov/ForMathlib/PicardLindelof.lean +++ b/LeanPool/Vlasov/ForMathlib/PicardLindelof.lean @@ -46,7 +46,7 @@ conclusion only grows). to Helper 1, `vlasov_window_confinement`). -/ -@[expose] public section +public section namespace IsPicardLindelof diff --git a/LeanPool/Vlasov/OT.lean b/LeanPool/Vlasov/OT.lean index 6bafa90ba2..8e8bff14c1 100644 --- a/LeanPool/Vlasov/OT.lean +++ b/LeanPool/Vlasov/OT.lean @@ -15,4 +15,4 @@ import Mathlib.MeasureTheory.Covering.Besicovitch /-! # Optimal transport, characteristic flow, and the well-posedness ladder. -/ -@[expose] public section +public section diff --git a/LeanPool/Vlasov/OT/CharacteristicFlow.lean b/LeanPool/Vlasov/OT/CharacteristicFlow.lean index ade83358bb..42ff6f5d44 100644 --- a/LeanPool/Vlasov/OT/CharacteristicFlow.lean +++ b/LeanPool/Vlasov/OT/CharacteristicFlow.lean @@ -47,7 +47,7 @@ differentiation-under-integral check that is not in Mathlib. See `formalize/DESIGN.md` (in the source repository) for the overall design. -/ -@[expose] public section +public section namespace Vlasov @@ -62,7 +62,7 @@ Note that the first component is the identity in `v` (the position ODE `x' = v`) and the second component is the mean-field force `−∇W ∗ ρ_t` evaluated at `x` (the velocity ODE `v' = −(∇W ∗ ρ)(x)`). -/ -noncomputable def vlasovVectorField +@[expose] noncomputable def vlasovVectorField {d : ℕ} (gradW : PhysSpace d → PhysSpace d) (ρ : ℝ → Measure (PhysSpace d)) @@ -1102,7 +1102,7 @@ over a chosen time set `s_t : Set ℝ` and initial-condition set The global `IsCharacteristicFlow gradW ρ charX charV` is the specialisation `IsCharacteristicFlowOn ... Set.univ Set.univ` (modulo the unconditional init clause). -/ -def IsCharacteristicFlowOn +@[expose] def IsCharacteristicFlowOn {d : ℕ} (gradW : PhysSpace d → PhysSpace d) (ρ : ℝ → Measure (PhysSpace d)) @@ -1162,7 +1162,7 @@ The Vlasov solution's weak PDE inherits the same regularity: it holds on the open interval where the characteristic flow is differentiable, and the initial condition at `t = 0` is captured separately by the pushforward equation in `IsLagrangianVlasovSolutionOn`. -/ -def WeakEvolutionEqOn {d : ℕ} +@[expose] def WeakEvolutionEqOn {d : ℕ} (gradW : PhysSpace d → PhysSpace d) (μ : ℝ → Measure (PhaseSpace d)) (φ : PhaseSpace d → ℝ) @@ -1179,7 +1179,7 @@ def WeakEvolutionEqOn {d : ℕ} /-- Localized Vlasov solution on `[0, T]`. Mirror of `IsVlasovSolution` with the weak PDE restricted to `[0, T]` via `WeakEvolutionEqOn`. -/ -def IsVlasovSolutionOn {d : ℕ} +@[expose] def IsVlasovSolutionOn {d : ℕ} (gradW : PhysSpace d → PhysSpace d) (f : ℝ → Measure (PhaseSpace d)) (T : ℝ) : Prop := ∀ (φ : PhaseSpace d → ℝ), @@ -1204,7 +1204,7 @@ def IsVlasovSolutionOn {d : ℕ} Every conjunct is the localized analogue of `IsLagrangianVlasovSolution`'s. The forward-iteration continuation bridges to the global predicate by gluing local windows. -/ -def IsLagrangianVlasovSolutionOn {d : ℕ} +@[expose] def IsLagrangianVlasovSolutionOn {d : ℕ} (gradW : PhysSpace d → PhysSpace d) (f : ℝ → Measure (PhaseSpace d)) (T : ℝ) : Prop := IsVlasovSolutionOn gradW f T ∧ @@ -3036,7 +3036,7 @@ The dominated-bound clause is the technical heart: deriving it requires a uniform-in-`z` bound on the flow speed `(charV s z, V'(s,z))` on the support of `φ`, which the eventual `vlasovWellPosedness` caller will produce from Picard-Lindelof local-flow boundedness + `HasCompactSupport φ`. -/ -def DiffUnderIntegralData +@[expose] def DiffUnderIntegralData {d : ℕ} (gradW : PhysSpace d → PhysSpace d) (ρ : ℝ → Measure (PhysSpace d)) @@ -3839,7 +3839,7 @@ times `S`. Returns `⨆ t ∈ S, wasserstein1 (ρ t) (σ t)` in `ℝ≥0∞`. the same moment bound, via `supW1On_ne_top_of_VlasovMeasureCurve`. Used as the contraction metric for the Picard iteration. -/ -noncomputable def supW1On {d : ℕ} +@[expose] noncomputable def supW1On {d : ℕ} (S : Set ℝ) (ρ σ : ℝ → Measure (PhysSpace d)) : ℝ≥0∞ := ⨆ (t : ℝ) (_ : t ∈ S), wasserstein1 (ρ t) (σ t) @@ -3942,7 +3942,7 @@ This is kept separate from the supW1On *contraction-ratio* constraint `LocalSmallnessContraction` (below): the two are genuinely independent mathematical constraints from distinct sub-arguments, so each predicate stays matched to its own sub-argument. -/ -def LocalSmallnessPLBuffer (L : NNReal) (T : ℝ) : Prop := +@[expose] def LocalSmallnessPLBuffer (L : NNReal) (T : ℝ) : Prop := (L : ℝ) * T ^ 2 < 1 /-- **Smallness predicate for the supW1On contraction-ratio constraint.** @@ -3955,7 +3955,7 @@ on the W₁-based contraction analysis, inherited off `max(1, L)`-Lipschitz constant). When `max(1, L) = 1` the constraint simplifies to `L · (exp T - 1) < 1`. -/ -def LocalSmallnessContraction (L : NNReal) (T : ℝ) : Prop := +@[expose] def LocalSmallnessContraction (L : NNReal) (T : ℝ) : Prop := (L : ℝ) * (Real.exp ((max 1 (L : ℝ)) * T) - 1) / (max 1 (L : ℝ)) < 1 /-- The curve metric used by the `VlasovMeasureCurve` Banach iteration: @@ -4107,7 +4107,7 @@ continuous clamp via `ContinuousOn.comp_continuous`. -/ /-- Clamp `t : ℝ` to `Icc 0 T`. Used by `VlasovMeasureCurve.extend` to extend a curve from `Icc 0 T` to all of `ℝ`. -/ -def clampToIcc (T t : ℝ) : ℝ := max 0 (min t T) +@[expose] def clampToIcc (T t : ℝ) : ℝ := max 0 (min t T) lemma clampToIcc_mem {T : ℝ} (hT : 0 ≤ T) (t : ℝ) : clampToIcc T t ∈ Set.Icc (0 : ℝ) T := by @@ -4130,7 +4130,7 @@ The extension preserves all structural properties (`IsProbabilityMeasure`, moment bound, integrability of `‖·‖`) universally in `t`, and extends W₁-continuity to convolveFunctionMeasure-continuity universally in `t` via `clampToIcc_continuous` + `vlasovMeasureCurve_convCont`. -/ -noncomputable def VlasovMeasureCurve.extend {d : ℕ} [NeZero d] {T : ℝ} {M : ℝ → ℝ} +@[expose] noncomputable def VlasovMeasureCurve.extend {d : ℕ} [NeZero d] {T : ℝ} {M : ℝ → ℝ} (ρ : VlasovMeasureCurve d T M) : ℝ → Measure (PhysSpace d) := fun t => ρ.ρ (clampToIcc T t) diff --git a/LeanPool/Vlasov/OT/Coupling.lean b/LeanPool/Vlasov/OT/Coupling.lean index 5ad891b209..cdf7eba29d 100644 --- a/LeanPool/Vlasov/OT/Coupling.lean +++ b/LeanPool/Vlasov/OT/Coupling.lean @@ -31,7 +31,7 @@ characteristic flows. See `formalize/DESIGN.md` (in the source repository) for the overall design choices. -/ -@[expose] public section +public section /- The contents of this file — `IsCoupling`, `wasserstein1Coupling`, both @@ -53,7 +53,7 @@ product space whose marginals are exactly `μ` and `ν`. We use the convention that `Prod.fst` is the `α`-marginal and `Prod.snd` is the `β`-marginal. -/ -def IsCoupling {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] +@[expose] def IsCoupling {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (π : Measure (α × β)) (μ : Measure α) (ν : Measure β) : Prop := Measure.map Prod.fst π = μ ∧ Measure.map Prod.snd π = ν @@ -70,7 +70,7 @@ This is the standard OT convention: a coupling π whose cost is non-integrable contributes `⊤` to the infimum (rather than the Bochner junk-value 0), so the infimum correctly identifies the OT-optimal coupling. Returns `⊤` if no coupling exists. -/ -noncomputable def wasserstein1Coupling +@[expose] noncomputable def wasserstein1Coupling {α : Type*} [MeasurableSpace α] [PseudoMetricSpace α] (μ ν : Measure α) : ENNReal := ⨅ (π : Measure (α × α)) (_ : IsCoupling π μ ν), diff --git a/LeanPool/Vlasov/OT/Wasserstein.lean b/LeanPool/Vlasov/OT/Wasserstein.lean index 45744fab7d..afa78f0709 100644 --- a/LeanPool/Vlasov/OT/Wasserstein.lean +++ b/LeanPool/Vlasov/OT/Wasserstein.lean @@ -18,7 +18,7 @@ truncated-metric variant `wassersteinBar` (Wbar), and their property lemmas (symmetry, triangle, non-expansion under 1-Lipschitz pushforward, KR-dual lower bound, finiteness under finite first moments). -/ -@[expose] public section +public section open MeasureTheory @@ -44,7 +44,7 @@ bound `|f x − f y| ≤ c x y` (rather than `LipschitzWith 1 f` w.r.t. an ambie metric) decouples the definition from the `PseudoMetricSpace` instance, so a cost like `min (dist x y) 1` (the truncated-metric "Wbar" cost) instantiates with no new instance. `wasserstein1` is the `c = dist` case. -/ -noncomputable def wassersteinCost {α : Type*} [MeasurableSpace α] +@[expose] noncomputable def wassersteinCost {α : Type*} [MeasurableSpace α] (c : α → α → ℝ) (μ ν : Measure α) : ENNReal := ⨆ (f : α → ℝ) (_ : ∀ x y, |f x - f y| ≤ c x y), ENNReal.ofReal (∫ x, f x ∂μ - ∫ x, f x ∂ν) @@ -66,7 +66,7 @@ lemma lipschitzWith_one_iff_oscillation {α : Type*} [PseudoMetricSpace α] /-- The Kantorovich–Rubinstein dual Wasserstein-1 distance: the `c = dist` case of `wassersteinCost`. -/ -noncomputable def wasserstein1 {α : Type*} [MeasurableSpace α] [PseudoMetricSpace α] +@[expose] noncomputable def wasserstein1 {α : Type*} [MeasurableSpace α] [PseudoMetricSpace α] (μ ν : Measure α) : ENNReal := wassersteinCost (fun x y => dist x y) μ ν diff --git a/LeanPool/Vlasov/OT/WeakToLagrangian.lean b/LeanPool/Vlasov/OT/WeakToLagrangian.lean index 128916837e..f9d4c72047 100644 --- a/LeanPool/Vlasov/OT/WeakToLagrangian.lean +++ b/LeanPool/Vlasov/OT/WeakToLagrangian.lean @@ -83,7 +83,7 @@ Assembly (C4): Universal (non-`_On`) form via window-gluing is a deferred follow-on (C5). -/ -@[expose] public section +public section namespace Vlasov @@ -614,7 +614,7 @@ theorem convolveFunctionMeasure_fderiv_continuous /-- Picard iterates for the linear IVP `x' = 𝒜(t)x`, `x(0)=x₀` (the V1c engine): `I₀ ≡ x₀`, `I_{n+1}(t) = ∫₀ᵗ 𝒜(s)(Iₙ(s)) ds`. -/ -noncomputable def picardIter {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[expose] noncomputable def picardIter {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (𝒜 : ℝ → (E →L[ℝ] E)) (x₀ : E) : ℕ → ℝ → E | 0, _ => x₀ | (n + 1), t => ∫ s in (0 : ℝ)..t, 𝒜 s (picardIter 𝒜 x₀ n s) diff --git a/LeanPool/Vlasov/OT/WellPosedness.lean b/LeanPool/Vlasov/OT/WellPosedness.lean index e927c6b8bc..db7d5b24be 100644 --- a/LeanPool/Vlasov/OT/WellPosedness.lean +++ b/LeanPool/Vlasov/OT/WellPosedness.lean @@ -38,7 +38,7 @@ development: See `formalize/DESIGN.md` (in the source repository) for the overall design. -/ -@[expose] public section +public section namespace Vlasov diff --git a/LeanPool/Wallace.lean b/LeanPool/Wallace.lean index 180b4be1d0..3ad5217539 100644 --- a/LeanPool/Wallace.lean +++ b/LeanPool/Wallace.lean @@ -22,7 +22,7 @@ Tags: wallace-problem, topological-groups, set-theoretic-topology MSC: 22A05, 54D30, 20K20 -/ -@[expose] public section +public section /-! # Countably compact groups and the Wallace counterexample diff --git a/LeanPool/Wallace/BlockFilters.lean b/LeanPool/Wallace/BlockFilters.lean index 8826292a32..6634cd8e29 100644 --- a/LeanPool/Wallace/BlockFilters.lean +++ b/LeanPool/Wallace/BlockFilters.lean @@ -26,7 +26,7 @@ abstract in the finite blocks: the later scheduling module only has to provide n which eventually avoid every finite set and a deletion bound whose relative size tends to zero. -/ -@[expose] public section +public section open Filter Set Topology open scoped Topology @@ -48,7 +48,7 @@ namespace BlockSystem /-- The concrete block system supplied by the triangular preprocessing enumeration. Its blocks have the prescribed cardinalities and partition `ℕ`; in particular, every finite set of positions meets only finitely many block labels. -/ -def ofBlockPositions (N : ℕ → ℕ) (hN : ∀ l, 0 < N l) : BlockSystem where +@[expose] def ofBlockPositions (N : ℕ → ℕ) (hN : ∀ l, 0 < N l) : BlockSystem where block := TriangularPreprocess.blockPositions N hN block_nonempty := by intro l @@ -254,7 +254,7 @@ variable (N : ℕ → ℕ) (hN : ∀ l, 0 < N l) abbrev blocks : BlockSystem := BlockSystem.ofBlockPositions N hN /-- A free ultrafilter refining the density filter of a code's label. -/ -def ultrafilter (a : ContinuumIndex) : Ultrafilter ℕ := +@[expose] def ultrafilter (a : ContinuumIndex) : Ultrafilter ℕ := Classical.choose ((blocks N hN).exists_free_ultrafilter_le_densityFilter (label_infinite a)) theorem ultrafilter_le_density (a : ContinuumIndex) : @@ -323,7 +323,7 @@ namespace BlockSystem /-- The points retained after deleting `E l` from every block whose label belongs to `b`. This is exactly the set `U_α` in equation (retained) of the paper. -/ -def retainedBlocks (B : BlockSystem) (b : Set ℕ) (E : ℕ → Finset ℕ) : Set ℕ := +@[expose] def retainedBlocks (B : BlockSystem) (b : Set ℕ) (E : ℕ → Finset ℕ) : Set ℕ := ⋃ l ∈ b, ↑(B.block l \ E l) /-- On a retained label, every point missing from the retained union lies in the diff --git a/LeanPool/Wallace/BlockLimit.lean b/LeanPool/Wallace/BlockLimit.lean index fd49a74190..bb24c54a7c 100644 --- a/LeanPool/Wallace/BlockLimit.lean +++ b/LeanPool/Wallace/BlockLimit.lean @@ -18,7 +18,7 @@ of an ultrafilter-generic position tends to infinity. This turns the vanishing on a retained member of the ultrafilter into convergence to zero in the circle. -/ -@[expose] public section +public section open Filter Set Topology diff --git a/LeanPool/Wallace/BoundedIndependentMap.lean b/LeanPool/Wallace/BoundedIndependentMap.lean index d871abdd6a..2b29b9613a 100644 --- a/LeanPool/Wallace/BoundedIndependentMap.lean +++ b/LeanPool/Wallace/BoundedIndependentMap.lean @@ -21,7 +21,7 @@ import Mathlib.Topology.MetricSpace.Bounded # Transport of bounded independence through injective homomorphisms -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Wallace/CoefficientTransfiniteExtension.lean b/LeanPool/Wallace/CoefficientTransfiniteExtension.lean index b62bd35b20..89b3032262 100644 --- a/LeanPool/Wallace/CoefficientTransfiniteExtension.lean +++ b/LeanPool/Wallace/CoefficientTransfiniteExtension.lean @@ -16,7 +16,7 @@ a prescribed circle element. The integer specialization uses scalar multiplicati specialization obtains the character from Baer's extension theorem. -/ -@[expose] public section +public section open Filter Set Topology @@ -46,19 +46,19 @@ structure Data (R : Type w) (I : Type u) [Zero R] [LT I] where p : Code → Ultrafilter ℕ /-- Closure under the prepared supports attached to code coordinates in `D`. -/ -def ClosedUnderPreparedSupports {R : Type w} {I : Type u} [Zero R] [LT I] +@[expose] def ClosedUnderPreparedSupports {R : Type w} {I : Type u} [Zero R] [LT I] (E : Data R I) (D : Set I) : Prop := ∀ c, E.codeIndex c ∈ D → ∀ n i, i ∈ (E.prepared c n).support → i ∈ D /-- The local character already realizes each limit whose code coordinate lies in `D`. -/ -def LocallyAdmissible {R : Type w} {I : Type u} [AddCommMonoid R] [One R] [LT I] +@[expose] def LocallyAdmissible {R : Type w} {I : Type u} [AddCommMonoid R] [One R] [LT I] (E : Data R I) (D : Set I) (character : (D →₀ R) →+ UnitAddCircle) : Prop := ∀ (c : E.Code) (hc : E.codeIndex c ∈ D), Tendsto (fun n ↦ character (Finsupp.subtypeDomain D (E.prepared c n))) (E.p c) (nhds (character (Finsupp.single ⟨E.codeIndex c, hc⟩ 1))) /-- The character on a direct sum induced by its coordinate characters. -/ -def finsuppAddHom {R : Type w} {I : Type u} [AddCommMonoid R] +@[expose] def finsuppAddHom {R : Type w} {I : Type u} [AddCommMonoid R] (coordinates : I → (R →+ UnitAddCircle)) : (I →₀ R) →+ UnitAddCircle := Finsupp.liftAddHom coordinates @@ -113,7 +113,7 @@ def coordinateStep 0 /-- The coordinate characters constructed by well-founded recursion. -/ -def globalCoordinate {R : Type w} {I : Type u} [AddCommMonoid R] [One R] +@[expose] def globalCoordinate {R : Type w} {I : Type u} [AddCommMonoid R] [One R] [LinearOrder I] [WellFoundedLT I] (extension : CoordinateExtension R) (E : Data R I) (D : Set I) (character : (D →₀ R) →+ UnitAddCircle) : I → (R →+ UnitAddCircle) := @@ -156,7 +156,7 @@ private theorem globalCoordinate_codeIndex_of_not_mem rw [hchosen] /-- The global character assembled from the recursively constructed coordinates. -/ -def globalCharacter {R : Type w} {I : Type u} [AddCommMonoid R] [One R] +@[expose] def globalCharacter {R : Type w} {I : Type u} [AddCommMonoid R] [One R] [LinearOrder I] [WellFoundedLT I] (extension : CoordinateExtension R) (E : Data R I) (D : Set I) (character : (D →₀ R) →+ UnitAddCircle) : (I →₀ R) →+ UnitAddCircle := diff --git a/LeanPool/Wallace/ConcreteClosure.lean b/LeanPool/Wallace/ConcreteClosure.lean index b45cd21ae7..5cd3d03c23 100644 --- a/LeanPool/Wallace/ConcreteClosure.lean +++ b/LeanPool/Wallace/ConcreteClosure.lean @@ -24,7 +24,7 @@ countable, contains the support of `x`, and has exactly the closure property req transfinite character extension. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Wallace/ConcreteData.lean b/LeanPool/Wallace/ConcreteData.lean index d8641f9f7f..2bae48a767 100644 --- a/LeanPool/Wallace/ConcreteData.lean +++ b/LeanPool/Wallace/ConcreteData.lean @@ -28,7 +28,7 @@ The choices here are entirely set-theoretic. No topology on the free group and assumed. -/ -@[expose] public section +public section open Filter Set Topology @@ -53,11 +53,11 @@ theorem selector_strictMono (a : ContinuumIndex) : StrictMono (selector N hN M a (Classical.choose_spec (triangular_block_preprocess a N hN M)).1 /-- The prepared subsequence coded by `a`. -/ -def prepared (a : ContinuumIndex) (n : ℕ) : ContinuumFreeGroup := +@[expose] def prepared (a : ContinuumIndex) (n : ℕ) : ContinuumFreeGroup := codedSequence a (selector N hN M a n) /-- The shifted finite set in block `l`. -/ -def differenceBlock (a : ContinuumIndex) (l : ℕ) : Finset ContinuumFreeGroup := +@[expose] def differenceBlock (a : ContinuumIndex) (l : ℕ) : Finset ContinuumFreeGroup := (blockPositions N hN l).image fun n ↦ prepared N hN M a n - codeBasisVector a theorem differenceBlock_boundedIndependent (a : ContinuumIndex) (l : ℕ) : @@ -83,7 +83,7 @@ theorem preparedDifference_injective (a : ContinuumIndex) : /-! ## Packaging for the transfinite extension -/ /-- The concrete triangular data used by the transfinite recursion. -/ -def transfiniteData : TransfiniteExtension.ContinuumData where +@[expose] def transfiniteData : TransfiniteExtension.ContinuumData where Code := ContinuumIndex codeIndex := codeIndex prepared := prepared N hN M diff --git a/LeanPool/Wallace/ConcreteFusionRun.lean b/LeanPool/Wallace/ConcreteFusionRun.lean index f030f3ddc9..6513007253 100644 --- a/LeanPool/Wallace/ConcreteFusionRun.lean +++ b/LeanPool/Wallace/ConcreteFusionRun.lean @@ -18,7 +18,7 @@ prepared local blocks. It then converts the bounded deletion at every stage int block-density certificate for every relevant code. No marker sequence is used. -/ -@[expose] public section +public section open Filter Set Topology diff --git a/LeanPool/Wallace/ConcreteLocalSetup.lean b/LeanPool/Wallace/ConcreteLocalSetup.lean index 75eb2926be..6f8251d2ed 100644 --- a/LeanPool/Wallace/ConcreteLocalSetup.lean +++ b/LeanPool/Wallace/ConcreteLocalSetup.lean @@ -22,7 +22,7 @@ almost-disjoint labels, selects the unique active code at each block label, and finite independent set presented to bounded deletion at that stage. -/ -@[expose] public section +public section open Set @@ -98,7 +98,7 @@ theorem closureInclusion_injective (x : ContinuumFreeGroup) : exact h /-- The shifted prepared value, restricted to the local closure. -/ -def localDifference (x : ContinuumFreeGroup) +@[expose] def localDifference (x : ContinuumFreeGroup) (a : RelevantCode N hN M x) (n : ℕ) : closure N hN M x →₀ ℤ := by classical @@ -157,7 +157,7 @@ theorem localDifference_injective ← closureInclusion_localDifference N hN M x a n, hmn] /-- The independent shifted set in one block, now inside the countable local group. -/ -def localDifferenceBlock (x : ContinuumFreeGroup) +@[expose] def localDifferenceBlock (x : ContinuumFreeGroup) (a : RelevantCode N hN M x) (l : ℕ) : Finset (closure N hN M x →₀ ℤ) := (blockPositions N hN l).image (localDifference N hN M x a) diff --git a/LeanPool/Wallace/CountableClosure.lean b/LeanPool/Wallace/CountableClosure.lean index fe379fdfaa..031162bfa7 100644 --- a/LeanPool/Wallace/CountableClosure.lean +++ b/LeanPool/Wallace/CountableClosure.lean @@ -16,7 +16,7 @@ prepared sequence. Because code indices are injective, closing a countable set whose indices it contains still takes only countably many new coordinates at each finite stage. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Wallace/CountableDisjointization.lean b/LeanPool/Wallace/CountableDisjointization.lean index b0de129277..57b5791122 100644 --- a/LeanPool/Wallace/CountableDisjointization.lean +++ b/LeanPool/Wallace/CountableDisjointization.lean @@ -25,7 +25,7 @@ orders any countable index type by an injection into `ℕ` and applies the stand deletion. Each label loses only finitely many points. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Wallace/FiniteCombinatorics.lean b/LeanPool/Wallace/FiniteCombinatorics.lean index 7c5d283aa5..eee8354d79 100644 --- a/LeanPool/Wallace/FiniteCombinatorics.lean +++ b/LeanPool/Wallace/FiniteCombinatorics.lean @@ -32,7 +32,7 @@ The paper writes integer bounds as `|c| ≤ M`. We use `Int.natAbs c ≤ M`, wh definitionally the corresponding natural-number inequality. -/ -@[expose] public section +public section open scoped BigOperators open Set @@ -50,7 +50,7 @@ variable {I : Type u} {T : Type v} [LinearOrder I] /-- The support condition in the triangular enumeration: every coordinate occurring in a term of the sequence lies strictly below its assigned index. -/ -def SupportedBelow (s : ℕ → I →₀ ℤ) (i : I) : Prop := +@[expose] def SupportedBelow (s : ℕ → I →₀ ℤ) (i : I) : Prop := ∀ n j, j ∈ (s n).support → j < i end Triangular @@ -61,7 +61,7 @@ variable {G : Type u} [AddCommGroup G] /-- A finite set is `M`-independent if every integer relation whose coefficients have absolute value at most `M` is trivial. This is the paper's definition, specialized to a finite set. -/ -def BoundedIndependent (M : ℕ) (X : Finset G) : Prop := +@[expose] def BoundedIndependent (M : ℕ) (X : Finset G) : Prop := ∀ c : G → ℤ, (∀ x ∈ X, Int.natAbs (c x) ≤ M) → (∑ x ∈ X, c x • x) = 0 → ∀ x ∈ X, c x = 0 @@ -275,7 +275,7 @@ end IntegerDependence section BoundedDeletion /-- A bounded relation using both the finite families `A` and `Y`. -/ -def HasMixedRelation (Q : ℕ) (A Y : Finset G) : Prop := +@[expose] def HasMixedRelation (Q : ℕ) (A Y : Finset G) : Prop := ∃ (b c : G → ℤ), (∀ a ∈ A, Int.natAbs (b a) ≤ Q) ∧ (∀ y ∈ Y, Int.natAbs (c y) ≤ Q) ∧ @@ -284,7 +284,7 @@ def HasMixedRelation (Q : ℕ) (A Y : Finset G) : Prop := (∑ a ∈ A, b a • a) + ∑ y ∈ Y, c y • y = 0 /-- No nontrivial relation of coefficient height at most `Q` uses both `A` and `Y`. -/ -def MixedRelationFree (Q : ℕ) (A Y : Finset G) : Prop := +@[expose] def MixedRelationFree (Q : ℕ) (A Y : Finset G) : Prop := ¬ HasMixedRelation Q A Y theorem mixedRelationFree_empty (Q : ℕ) (A : Finset G) : diff --git a/LeanPool/Wallace/FullTopology.lean b/LeanPool/Wallace/FullTopology.lean index cbf0d241d8..c37eb22608 100644 --- a/LeanPool/Wallace/FullTopology.lean +++ b/LeanPool/Wallace/FullTopology.lean @@ -22,7 +22,7 @@ and has no non-eventually-constant convergent sequences. Its canonical induced totally bounded, which is the uniform formulation of precompactness used here. -/ -@[expose] public section +public section open Filter Set Topology @@ -95,18 +95,18 @@ namespace FullCharacterPackage variable {G : Type u} [AddCommGroup G] /-- Simultaneous evaluation by all characters in the package. -/ -def evaluation (C : FullCharacterPackage G) : +@[expose] def evaluation (C : FullCharacterPackage G) : G →+ (C.CharacterIndex → UnitAddCircle) where toFun x j := C.character j x map_zero' := by ext j; simp map_add' x y := by ext j; simp /-- The initial topology generated by the package's characters. -/ -@[reducible] def initialTopology (C : FullCharacterPackage G) : TopologicalSpace G := +@[expose, reducible] def initialTopology (C : FullCharacterPackage G) : TopologicalSpace G := TopologicalSpace.induced C.evaluation inferInstance /-- The uniformity pulled back from the compact power of the circle. -/ -@[reducible] def initialUniformSpace (C : FullCharacterPackage G) : UniformSpace G := +@[expose, reducible] def initialUniformSpace (C : FullCharacterPackage G) : UniformSpace G := UniformSpace.comap C.evaluation inferInstance theorem initialUniformSpace_toTopology (C : FullCharacterPackage G) : @@ -211,7 +211,7 @@ namespace SeparationPackage variable {I : Type u} /-- Regard the existing free-Abelian separation package as a full character package. -/ -def toFullCharacterPackage (C : SeparationPackage I) : +@[expose] def toFullCharacterPackage (C : SeparationPackage I) : FullCharacterPackage (I →₀ ℤ) where Code := C.Code codeEquiv := C.codeEquiv @@ -250,7 +250,7 @@ theorem initial_onlyEventuallyConstantConvergentSequences exact C.toFullCharacterPackage.initial_onlyEventuallyConstantConvergentSequences /-- The uniform structure induced by all characters in the separation package. -/ -@[reducible] def initialUniformSpace (C : SeparationPackage I) : +@[expose, reducible] def initialUniformSpace (C : SeparationPackage I) : UniformSpace (I →₀ ℤ) := C.toFullCharacterPackage.initialUniformSpace @@ -273,7 +273,7 @@ end SeparationPackage /-- The exact topological conclusion shared by the free-Abelian and rational-vector-group results. Total boundedness is stated for a compatible uniformity inducing the displayed topology. -/ -def HasMainGroupTopology (G : Type u) [AddCommGroup G] : Prop := +@[expose] def HasMainGroupTopology (G : Type u) [AddCommGroup G] : Prop := ∃ (topology : TopologicalSpace G) (uniformity : UniformSpace G), uniformity.toTopologicalSpace = topology ∧ @IsUniformAddGroup G uniformity _ ∧ diff --git a/LeanPool/Wallace/FullTopologyMain.lean b/LeanPool/Wallace/FullTopologyMain.lean index 35fc042557..d6bc95fd5b 100644 --- a/LeanPool/Wallace/FullTopologyMain.lean +++ b/LeanPool/Wallace/FullTopologyMain.lean @@ -16,7 +16,7 @@ This module applies the unconditional fusion construction to the generic topolog `Wallace.FullTopology`. The resulting theorem has no hypotheses. -/ -@[expose] public section +public section namespace Wallace diff --git a/LeanPool/Wallace/FusionLimit.lean b/LeanPool/Wallace/FusionLimit.lean index 787e3c3bd2..8bcd0884f7 100644 --- a/LeanPool/Wallace/FusionLimit.lean +++ b/LeanPool/Wallace/FusionLimit.lean @@ -18,7 +18,7 @@ complete metric argument: the pointwise limit is again a homomorphism, and a geo a tail gives an explicit bound from the first point of that tail to the limit. -/ -@[expose] public section +public section open Filter Topology open scoped ENNReal diff --git a/LeanPool/Wallace/FusionSchedule.lean b/LeanPool/Wallace/FusionSchedule.lean index 23a0de1f45..7a34e5bf89 100644 --- a/LeanPool/Wallace/FusionSchedule.lean +++ b/LeanPool/Wallace/FusionSchedule.lean @@ -24,7 +24,7 @@ makes the discarded proportion tend to zero. The errors form a geometric series `1 / 32`, leaving a large margin around an initial character value of `1 / 2`. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/Wallace/FusionStage.lean b/LeanPool/Wallace/FusionStage.lean index f82ad84b29..3813f870f1 100644 --- a/LeanPool/Wallace/FusionStage.lean +++ b/LeanPool/Wallace/FusionStage.lean @@ -17,7 +17,7 @@ This module turns the bounded-deletion conclusion into the exact short-relation required by the uniform Kronecker lemma. It is the finite algebraic heart of one fusion stage. -/ -@[expose] public section +public section open scoped BigOperators diff --git a/LeanPool/Wallace/GeneralMain.lean b/LeanPool/Wallace/GeneralMain.lean index cb7d267220..3b67495a95 100644 --- a/LeanPool/Wallace/GeneralMain.lean +++ b/LeanPool/Wallace/GeneralMain.lean @@ -20,7 +20,7 @@ coordinatization embedding from Section 2. Its prescribed basis limits lie in t group by construction, so no new fusion or set-theoretic hypothesis is needed. -/ -@[expose] public section +public section open Cardinal diff --git a/LeanPool/Wallace/GlobalAssembly.lean b/LeanPool/Wallace/GlobalAssembly.lean index aebf0950ae..0932a0b89d 100644 --- a/LeanPool/Wallace/GlobalAssembly.lean +++ b/LeanPool/Wallace/GlobalAssembly.lean @@ -27,7 +27,7 @@ makes it admissible at every code. The resulting characters form a separating f minimal construction interface yields the Wallace semigroup. -/ -@[expose] public section +public section open Filter Set Topology @@ -45,7 +45,7 @@ open TransfiniteExtension variable (N : ℕ → ℕ) (hN : ∀ l, 0 < N l) (M : ℕ → ℕ) /-- The exact local output required from the countable fusion. -/ -def HasLocalSeparatingCharacters : Prop := +@[expose] def HasLocalSeparatingCharacters : Prop := ∀ x : {x : ContinuumFreeGroup // x ≠ 0}, ∃ χD : (closure N hN M x.1 →₀ ℤ) →+ UnitAddCircle, χD (Finsupp.subtypeDomain (closure N hN M x.1) x.1) ≠ 0 ∧ @@ -69,7 +69,7 @@ theorem localCharacter_admissible (x : {x : ContinuumFreeGroup // x ≠ 0}) : (Classical.choose_spec (H x)).2 /-- Extend the chosen local character by the well-founded triangular recursion. -/ -def globalCharacter (x : {x : ContinuumFreeGroup // x ≠ 0}) : +@[expose] def globalCharacter (x : {x : ContinuumFreeGroup // x ≠ 0}) : ContinuumFreeGroup →+ UnitAddCircle := TransfiniteExtension.globalCharacter (transfiniteData N hN M) (closure N hN M x.1) (localCharacter N hN M H x) diff --git a/LeanPool/Wallace/InitialCharacter.lean b/LeanPool/Wallace/InitialCharacter.lean index 8fe7dbb91a..8e0e496a83 100644 --- a/LeanPool/Wallace/InitialCharacter.lean +++ b/LeanPool/Wallace/InitialCharacter.lean @@ -17,7 +17,7 @@ circle. Torsion-freeness makes this one-point prescription compatible with ever relation, and divisibility of the circle extends it to the ambient group. -/ -@[expose] public section +public section namespace Wallace diff --git a/LeanPool/Wallace/LocalEnumeration.lean b/LeanPool/Wallace/LocalEnumeration.lean index 0426e7c80a..9c6d1e6f88 100644 --- a/LeanPool/Wallace/LocalEnumeration.lean +++ b/LeanPool/Wallace/LocalEnumeration.lean @@ -13,7 +13,7 @@ public import Mathlib.Data.Finsupp.Encodable # Enumeration of a countable local direct sum -/ -@[expose] public section +public section namespace Wallace diff --git a/LeanPool/Wallace/LocalFusion.lean b/LeanPool/Wallace/LocalFusion.lean index d274c46354..46120da371 100644 --- a/LeanPool/Wallace/LocalFusion.lean +++ b/LeanPool/Wallace/LocalFusion.lean @@ -31,7 +31,7 @@ character and derive: The second half of the file carries out the scheduling induction for the concrete Wallace data. -/ -@[expose] public section +public section open Filter Set Topology @@ -403,7 +403,7 @@ def nextFusionState (FusionSchedule.accumulatedSize_succ l).symm /-- The dependent natural-number recursion starting from `initial`. -/ -def fusionStates +@[expose] def fusionStates {G : Type} [AddCommGroup G] [DecidableEq G] (fresh : ℕ → Finset G) (enumeration : ℕ → G) (x : G) (hfresh_card : ∀ l, (fresh l).card ≤ FusionSchedule.blockSize l) diff --git a/LeanPool/Wallace/MathlibFoundations.lean b/LeanPool/Wallace/MathlibFoundations.lean index 5fac763114..63799f2526 100644 --- a/LeanPool/Wallace/MathlibFoundations.lean +++ b/LeanPool/Wallace/MathlibFoundations.lean @@ -22,7 +22,7 @@ the basic facts about the initial topology generated by a family of circle-value No declaration in this file is an axiom and no proof is omitted. -/ -@[expose] public section +public section open Filter Set open scoped Cardinal diff --git a/LeanPool/Wallace/NontrivialSequences.lean b/LeanPool/Wallace/NontrivialSequences.lean index c791ef31f9..65101d7a19 100644 --- a/LeanPool/Wallace/NontrivialSequences.lean +++ b/LeanPool/Wallace/NontrivialSequences.lean @@ -23,7 +23,7 @@ same subsequence would converge to zero along the free ultrafilter. This observation avoids any separate oscillating-marker construction. -/ -@[expose] public section +public section open Filter Set Topology @@ -35,7 +35,7 @@ noncomputable section /-- Every injective sequence has a strictly reindexed subsequence with a nonzero limit along a free ultrafilter. -/ -def HasNonzeroLimitProperty +@[expose] def HasNonzeroLimitProperty (G : Type u) [TopologicalSpace G] [Zero G] : Prop := ∀ s : ℕ → G, Function.Injective s → ∃ (φ : ℕ → ℕ) (x : G) (p : Ultrafilter ℕ), diff --git a/LeanPool/Wallace/PackageTransport.lean b/LeanPool/Wallace/PackageTransport.lean index 7e236c5bf8..ffde0cf261 100644 --- a/LeanPool/Wallace/PackageTransport.lean +++ b/LeanPool/Wallace/PackageTransport.lean @@ -16,7 +16,7 @@ limit point for an embedded injective sequence has a chosen preimage in `G`, the package pulls back to `G`. -/ -@[expose] public section +public section open Filter Topology diff --git a/LeanPool/Wallace/RationalAssembly.lean b/LeanPool/Wallace/RationalAssembly.lean index f7368197ea..105f4e3ba3 100644 --- a/LeanPool/Wallace/RationalAssembly.lean +++ b/LeanPool/Wallace/RationalAssembly.lean @@ -18,7 +18,7 @@ The resulting compatible characters separate points and realize the nonzero ultr attached to every injective rational sequence. -/ -@[expose] public section +public section open Filter Set Topology @@ -82,7 +82,7 @@ theorem globalCharacter_admissible (localCharacter_admissible x) a /-- The complete character package for the rational direct sum of rank continuum. -/ -def fullCharacterPackage : FullCharacterPackage ContinuumRationalGroup where +@[expose] def fullCharacterPackage : FullCharacterPackage ContinuumRationalGroup where Code := ContinuumIndex codeEquiv := rationalSequenceCodeEquiv subsequence := selector N hN M diff --git a/LeanPool/Wallace/RationalClosure.lean b/LeanPool/Wallace/RationalClosure.lean index ad006c6de4..93335ad733 100644 --- a/LeanPool/Wallace/RationalClosure.lean +++ b/LeanPool/Wallace/RationalClosure.lean @@ -23,7 +23,7 @@ Starting from the finite support of a vector, close under the supports of every sequence whose code coordinate has entered the set. -/ -@[expose] public section +public section open Set diff --git a/LeanPool/Wallace/RationalData.lean b/LeanPool/Wallace/RationalData.lean index 3ec8a19e0f..ef609aa065 100644 --- a/LeanPool/Wallace/RationalData.lean +++ b/LeanPool/Wallace/RationalData.lean @@ -23,7 +23,7 @@ This module chooses, uniformly for every coded injective rational sequence, its subsequence and its free block-density ultrafilter. -/ -@[expose] public section +public section open Filter Set Topology @@ -46,11 +46,11 @@ theorem selector_strictMono (a : ContinuumIndex) : StrictMono (selector N hN M a (Classical.choose_spec (triangular_block_preprocess a N hN M)).1 /-- Prepared subsequence represented by code `a`. -/ -def prepared (a : ContinuumIndex) (n : ℕ) : ContinuumRationalGroup := +@[expose] def prepared (a : ContinuumIndex) (n : ℕ) : ContinuumRationalGroup := codedSequence a (selector N hN M a n) /-- Shifted finite set in block `l`. -/ -def differenceBlock (a : ContinuumIndex) (l : ℕ) : Finset ContinuumRationalGroup := +@[expose] def differenceBlock (a : ContinuumIndex) (l : ℕ) : Finset ContinuumRationalGroup := (TriangularPreprocess.blockPositions N hN l).image fun n ↦ prepared N hN M a n - codeBasisVector a @@ -73,7 +73,7 @@ theorem preparedDifference_injective (a : ContinuumIndex) : exact sub_left_injective hmn /-- Concrete input for the rational transfinite recursion. -/ -def transfiniteData : RationalTransfiniteExtension.ContinuumData where +@[expose] def transfiniteData : RationalTransfiniteExtension.ContinuumData where Code := ContinuumIndex codeIndex := codeIndex prepared := prepared N hN M diff --git a/LeanPool/Wallace/RationalFusionRun.lean b/LeanPool/Wallace/RationalFusionRun.lean index 917d842e59..eb1964b6cf 100644 --- a/LeanPool/Wallace/RationalFusionRun.lean +++ b/LeanPool/Wallace/RationalFusionRun.lean @@ -19,7 +19,7 @@ prepared local blocks, proves the density bound for deleted positions, and packa resulting separating, locally admissible character. -/ -@[expose] public section +public section open Filter Set Topology diff --git a/LeanPool/Wallace/RationalLocalSetup.lean b/LeanPool/Wallace/RationalLocalSetup.lean index 8b87e3abb9..559076732e 100644 --- a/LeanPool/Wallace/RationalLocalSetup.lean +++ b/LeanPool/Wallace/RationalLocalSetup.lean @@ -21,7 +21,7 @@ has at most one active code, and its shifted prepared terms form the finite inde used by the fusion. -/ -@[expose] public section +public section open Set @@ -96,7 +96,7 @@ theorem closureInclusion_injective (x : ContinuumRationalGroup) : exact h /-- The prepared difference restricted to the local coordinate closure. -/ -def localDifference (x : ContinuumRationalGroup) +@[expose] def localDifference (x : ContinuumRationalGroup) (a : RelevantCode N hN M x) (n : ℕ) : closure N hN M x →₀ ℚ := by classical exact Finsupp.subtypeDomain (closure N hN M x) @@ -153,7 +153,7 @@ theorem localDifference_injective (x : ContinuumRationalGroup) ← closureInclusion_localDifference N hN M x a n, hmn] /-- The finite block of local prepared differences for a relevant code. -/ -def localDifferenceBlock (x : ContinuumRationalGroup) +@[expose] def localDifferenceBlock (x : ContinuumRationalGroup) (a : RelevantCode N hN M x) (l : ℕ) : Finset (closure N hN M x →₀ ℚ) := (TriangularPreprocess.blockPositions N hN l).image (localDifference N hN M x a) diff --git a/LeanPool/Wallace/RationalTransfiniteExtension.lean b/LeanPool/Wallace/RationalTransfiniteExtension.lean index 9b778a0bbc..efed7765e1 100644 --- a/LeanPool/Wallace/RationalTransfiniteExtension.lean +++ b/LeanPool/Wallace/RationalTransfiniteExtension.lean @@ -24,7 +24,7 @@ extension theorem extends the integer character with prescribed value at one to each rational coordinate. -/ -@[expose] public section +public section open Filter Set Topology diff --git a/LeanPool/Wallace/RationalTriangularPreprocess.lean b/LeanPool/Wallace/RationalTriangularPreprocess.lean index a292f00c86..b68edab1ea 100644 --- a/LeanPool/Wallace/RationalTriangularPreprocess.lean +++ b/LeanPool/Wallace/RationalTriangularPreprocess.lean @@ -31,7 +31,7 @@ independence selector from `Wallace.TriangularPreprocess`. No topology or character is assumed. -/ -@[expose] public section +public section open Set open scoped Cardinal @@ -54,7 +54,7 @@ abbrev RationalInjectiveSequences := {s : ℕ → ContinuumRationalGroup // Function.Injective s} /-- The triangular support condition for rational-valued finitely supported sequences. -/ -def RationalSupportedBelow (s : ℕ → ContinuumRationalGroup) (i : ContinuumIndex) : Prop := +@[expose] def RationalSupportedBelow (s : ℕ → ContinuumRationalGroup) (i : ContinuumIndex) : Prop := ∀ n j, j ∈ (s n).support → j < i theorem mk_continuumIndex : #ContinuumIndex = 𝔠 := @@ -105,7 +105,7 @@ def rationalSequenceCodeEquiv : ContinuumIndex ≃ RationalInjectiveSequences := mk_continuumIndex.trans mk_rationalInjectiveSequences.symm /-- The injective rational sequence represented by the code `a`. -/ -def codedSequence (a : ContinuumIndex) : ℕ → ContinuumRationalGroup := +@[expose] def codedSequence (a : ContinuumIndex) : ℕ → ContinuumRationalGroup := (rationalSequenceCodeEquiv a).1 theorem codedSequence_injective (a : ContinuumIndex) : @@ -146,7 +146,7 @@ theorem codedSequence_supportedBelow (a : ContinuumIndex) : (TriangularPreprocess.freshIndex_spec supportBound a).1 /-- The rational basis point assigned to a code. -/ -def codeBasisVector (a : ContinuumIndex) : ContinuumRationalGroup := +@[expose] def codeBasisVector (a : ContinuumIndex) : ContinuumRationalGroup := Finsupp.single (codeIndex a) 1 /-- The translated sequence used for bounded-independence preprocessing. -/ diff --git a/LeanPool/Wallace/RealMain.lean b/LeanPool/Wallace/RealMain.lean index 5b5161f52c..22a45310e8 100644 --- a/LeanPool/Wallace/RealMain.lean +++ b/LeanPool/Wallace/RealMain.lean @@ -19,7 +19,7 @@ rational Hamel dimension of `ℝ`, then transports the fully constructed charact than merely asserting that a suitable topology can be transferred. -/ -@[expose] public section +public section open Cardinal Module diff --git a/LeanPool/Wallace/Result.lean b/LeanPool/Wallace/Result.lean index 40fd35e4c0..0c7b7b83e2 100644 --- a/LeanPool/Wallace/Result.lean +++ b/LeanPool/Wallace/Result.lean @@ -28,7 +28,7 @@ compact, cancellative on both sides, a topological semigroup, and not a group. Every declaration in this file is proved from its explicitly stated hypotheses. -/ -@[expose] public section +public section open Filter Set Topology @@ -47,7 +47,7 @@ def IsWallaceSemigroup (S : Type u) [TopologicalSpace S] [AddMonoid S] : Prop := /-- A convenient unbundled form of the accumulation-point criterion used for countable compactness. -/ -def HasInfiniteSetAccumulationProperty +@[expose] def HasInfiniteSetAccumulationProperty (X : Type u) [TopologicalSpace X] : Prop := ∀ B : Set X, B.Infinite → ∃ x : X, AccPt x (Filter.principal B) @@ -84,7 +84,7 @@ theorem accPt_range_of_free_ultrafilter_limit Every injective sequence contained in `P` has a genuine subsequence (`StrictMono φ`) converging to a point of `P` along a free ultrafilter. -/ -def HasWallaceLimitProperty +@[expose] def HasWallaceLimitProperty {F : Type u} [TopologicalSpace F] [AddZeroClass F] (P : AddSubmonoid F) : Prop := ∀ s : ℕ → F, Function.Injective s → (∀ n, s n ∈ P) → diff --git a/LeanPool/Wallace/SeparationInterface.lean b/LeanPool/Wallace/SeparationInterface.lean index 31201b5e67..05991f65b3 100644 --- a/LeanPool/Wallace/SeparationInterface.lean +++ b/LeanPool/Wallace/SeparationInterface.lean @@ -21,7 +21,7 @@ No topology on the free Abelian group and no compactness conclusion is stored in `SeparationPackage`; both are derived below from its algebraic and filter-theoretic fields. -/ -@[expose] public section +public section open Filter Set Topology @@ -32,7 +32,7 @@ namespace Wallace noncomputable section /-- An injective sequence bundled with the proof of injectivity. -/ -def InjectiveSequence' (G : Type u) := +@[expose] def InjectiveSequence' (G : Type u) := {s : ℕ → G // Function.Injective s} /-- @@ -70,7 +70,7 @@ namespace SeparationPackage variable {I : Type u} /-- Simultaneous evaluation by all compatible separating characters. -/ -def evaluation (C : SeparationPackage I) : +@[expose] def evaluation (C : SeparationPackage I) : (I →₀ ℤ) →+ ({x : I →₀ ℤ // x ≠ 0} → UnitAddCircle) where toFun y x := C.character x y map_zero' := by @@ -81,7 +81,7 @@ def evaluation (C : SeparationPackage I) : exact map_add (C.character z) x y /-- The initial topology induced by the compatible separating characters. -/ -@[reducible] def initialTopology (C : SeparationPackage I) : +@[expose, reducible] def initialTopology (C : SeparationPackage I) : TopologicalSpace (I →₀ ℤ) := TopologicalSpace.induced C.evaluation inferInstance diff --git a/LeanPool/Wallace/TorsionFreeCoordinate.lean b/LeanPool/Wallace/TorsionFreeCoordinate.lean index c29684786c..5e327c17c0 100644 --- a/LeanPool/Wallace/TorsionFreeCoordinate.lean +++ b/LeanPool/Wallace/TorsionFreeCoordinate.lean @@ -37,7 +37,7 @@ Abelian group of cardinality continuum embeds in the rational direct sum of cont way whose image contains every standard basis vector. -/ -@[expose] public section +public section open Cardinal Module diff --git a/LeanPool/Wallace/TransfiniteExtension.lean b/LeanPool/Wallace/TransfiniteExtension.lean index 6f41713fea..4d2756b329 100644 --- a/LeanPool/Wallace/TransfiniteExtension.lean +++ b/LeanPool/Wallace/TransfiniteExtension.lean @@ -22,7 +22,7 @@ This file specializes the coefficient-parametric Wallace recursion to the free A An integer coordinate character is uniquely determined by its value at one. -/ -@[expose] public section +public section open Filter Set Topology diff --git a/LeanPool/Wallace/TriangularPreprocess.lean b/LeanPool/Wallace/TriangularPreprocess.lean index b1d2e77f73..0c15d1b0c6 100644 --- a/LeanPool/Wallace/TriangularPreprocess.lean +++ b/LeanPool/Wallace/TriangularPreprocess.lean @@ -32,7 +32,7 @@ assigned distinct indices strictly above every coordinate in the sequence. The the file constructs a genuine subsequence whose prescribed finite blocks are bounded-independent. -/ -@[expose] public section +public section open Set open scoped Cardinal @@ -101,7 +101,7 @@ def sequenceCodeEquiv : ContinuumIndex ≃ InjectiveSequences := Classical.choice <| Cardinal.eq.mp <| mk_continuumIndex.trans mk_injectiveSequences.symm /-- The sequence represented by a code. -/ -def codedSequence (a : ContinuumIndex) : ℕ → ContinuumFreeGroup := +@[expose] def codedSequence (a : ContinuumIndex) : ℕ → ContinuumFreeGroup := (sequenceCodeEquiv a).1 theorem codedSequence_injective (a : ContinuumIndex) : @@ -495,7 +495,7 @@ theorem blockOf_spec (N : ℕ → ℕ) (hN : ∀ l, 0 < N l) (n : ℕ) : simpa only [hb] using Nat.le_of_not_gt hminimal /-- The finite interval `I_l = [S_l, S_l + N_l)` used in the paper. -/ -def blockPositions (N : ℕ → ℕ) (_hN : ∀ l, 0 < N l) (l : ℕ) : Finset ℕ := +@[expose] def blockPositions (N : ℕ → ℕ) (_hN : ∀ l, 0 < N l) (l : ℕ) : Finset ℕ := Finset.Ico (blockStart N l) (blockStart N (l + 1)) theorem mem_blockPositions_iff @@ -554,7 +554,7 @@ theorem exists_boundedIndependent_subsequence_for_sizes /-! ## The paper's shifted coded sequences -/ /-- The basis vector attached to a code's fresh index. -/ -def codeBasisVector (a : ContinuumIndex) : ContinuumFreeGroup := +@[expose] def codeBasisVector (a : ContinuumIndex) : ContinuumFreeGroup := Finsupp.single (codeIndex a) 1 /-- The sequence to which finite bounded-independence extraction is applied. -/ diff --git a/LeanPool/Wallace/TychonoffWallace.lean b/LeanPool/Wallace/TychonoffWallace.lean index 6dd5b45455..cf87f224dd 100644 --- a/LeanPool/Wallace/TychonoffWallace.lean +++ b/LeanPool/Wallace/TychonoffWallace.lean @@ -20,7 +20,7 @@ noninvertible element. The paper's printed corollary also says that the witness and Tychonoff. This module makes both properties part of the public proposition. -/ -@[expose] public section +public section namespace Wallace diff --git a/LeanPool/Wallace/UniformKronecker.lean b/LeanPool/Wallace/UniformKronecker.lean index 446b957591..02d4c353e4 100644 --- a/LeanPool/Wallace/UniformKronecker.lean +++ b/LeanPool/Wallace/UniformKronecker.lean @@ -17,7 +17,7 @@ This file isolates the exact (non-quantitative) character-extension argument use The remaining quantitative statement is developed on top of these declarations. -/ -@[expose] public section +public section open scoped BigOperators @@ -30,7 +30,7 @@ namespace Wallace open Filter Set TopologicalSpace Topology /-- The homomorphism which evaluates an integer relation on a finite tuple. -/ -def relationMap {G : Type u} [AddCommGroup G] {m : ℕ} (z : Fin m → G) : +@[expose] def relationMap {G : Type u} [AddCommGroup G] {m : ℕ} (z : Fin m → G) : (Fin m → ℤ) →+ G where toFun a := ∑ i, a i • z i map_zero' := by simp @@ -46,7 +46,7 @@ theorem relationMap_single {G : Type u} [AddCommGroup G] {m : ℕ} simp [relationMap] /-- Evaluation of an integer vector on a tuple in the unit additive torus. -/ -def torusRelationMap {m : ℕ} (t : Fin m → UnitAddCircle) : +@[expose] def torusRelationMap {m : ℕ} (t : Fin m → UnitAddCircle) : (Fin m → ℤ) →+ UnitAddCircle := relationMap t @@ -80,13 +80,13 @@ theorem natAbs_le_intVectorHeight {m : ℕ} (a : Fin m → ℤ) (i : Fin m) : exact Finset.le_sup (f := fun j => (a j).natAbs) (Finset.mem_univ i) /-- A target tuple respects all relations of height at most `q`. -/ -def RespectsRelationsUpTo {G : Type u} [AddCommGroup G] {m : ℕ} +@[expose] def RespectsRelationsUpTo {G : Type u} [AddCommGroup G] {m : ℕ} (q : ℕ) (z : Fin m → G) (t : Fin m → UnitAddCircle) : Prop := ∀ a : Fin m → ℤ, intVectorHeight a ≤ q → relationMap z a = 0 → torusRelationMap t a = 0 /-- `q` is a uniform Kronecker bound for tuples of length `m` and error `ε`. -/ -def IsUniformKroneckerBound (m : ℕ) (ε : ℝ) (q : ℕ) : Prop := +@[expose] def IsUniformKroneckerBound (m : ℕ) (ε : ℝ) (q : ℕ) : Prop := ∀ {G : Type u} [AddCommGroup G] (z : Fin m → G) (t : Fin m → UnitAddCircle), RespectsRelationsUpTo q z t → ∃ χ : G →+ UnitAddCircle, ∀ i, ‖χ (z i) - t i‖ < ε @@ -205,7 +205,7 @@ theorem isClosed_integerAnnihilator {m : ℕ} (R : AddSubgroup (Fin m → ℤ)) exact isClosed_singleton.preimage (by fun_prop) /-- Distance to the relation annihilator, as a bounded continuous real-valued function. -/ -def annihilatorDistance {m : ℕ} (R : AddSubgroup (Fin m → ℤ)) : +@[expose] def annihilatorDistance {m : ℕ} (R : AddSubgroup (Fin m → ℤ)) : BoundedContinuousFunction (UnitAddTorus (Fin m)) ℝ := BoundedContinuousFunction.mkOfCompact (⟨fun x ↦ Metric.infDist x (integerAnnihilator R), diff --git a/LeanPool/WhiteheadTheorem.lean b/LeanPool/WhiteheadTheorem.lean index 8c4dcc9ce2..95eebe80f6 100644 --- a/LeanPool/WhiteheadTheorem.lean +++ b/LeanPool/WhiteheadTheorem.lean @@ -48,4 +48,4 @@ Tags: algebraic-topology, cw-complex, homotopy-groups, weak-homotopy-equivalence MSC: 55P10, 55Q05, 55U10 -/ -@[expose] public section +public section diff --git a/LeanPool/WhiteheadTheorem/Auxiliary.lean b/LeanPool/WhiteheadTheorem/Auxiliary.lean index d6542f25ee..542c091419 100644 --- a/LeanPool/WhiteheadTheorem/Auxiliary.lean +++ b/LeanPool/WhiteheadTheorem/Auxiliary.lean @@ -15,7 +15,7 @@ public import Mathlib.Topology.Category.TopCat.Basic Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Auxiliary`. -/ -@[expose] public section +public section namespace CategoryTheory diff --git a/LeanPool/WhiteheadTheorem/Basic.lean b/LeanPool/WhiteheadTheorem/Basic.lean index c48376df65..3ef7926db3 100644 --- a/LeanPool/WhiteheadTheorem/Basic.lean +++ b/LeanPool/WhiteheadTheorem/Basic.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Basic`. -/ -@[expose] public section +public section open CategoryTheory diff --git a/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean b/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean index a587880ca9..e715056630 100644 --- a/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean +++ b/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean @@ -16,7 +16,7 @@ public import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Defs Imported Lean Pool material for `LeanPool.WhiteheadTheorem.CWComplex.Basic`. -/ -@[expose] public section +public section /-! # CW-complexes @@ -80,7 +80,7 @@ namespace AttachCells /-- The inclusion map from `X` to `X'`, given that `X'` is obtained from `X` by attaching `(n + 1)`-disks -/ -noncomputable def incl (att : AttachCells n X X') : X ⟶ X' := +@[expose] noncomputable def incl (att : AttachCells n X X') : X ⟶ X' := Limits.pushout.inl (Limits.Sigma.desc att.attachMaps) (Limits.Sigma.map fun _ ↦ diskBoundaryIncl n) ≫ att.isoPushout.inv @@ -118,7 +118,7 @@ end AttachCells /-- The inclusion map from `sk n` (i.e., the $(n-1)$-skeleton) to `sk (n + 1)` (i.e., the $n$-skeleton) of a relative CW-complex -/ -noncomputable def skInclSucc (X : RelCWComplex) (n : ℕ) : X.sk n ⟶ X.sk (n + 1) := +@[expose] noncomputable def skInclSucc (X : RelCWComplex) (n : ℕ) : X.sk n ⟶ X.sk (n + 1) := (X.attachCells n).incl /-- The inclusion map from `sk n` (i.e., the $(n-1)$-skeleton) to `sk m` (i.e., the @@ -128,7 +128,7 @@ noncomputable def skInclToSk (X : RelCWComplex) {n : ℕ} {m : ℕ} (hnm : n ≤ (Functor.ofSequence X.skInclSucc).map (homOfLE hnm) /-- The topology on a relative CW-complex -/ -noncomputable def toTopCat (X : RelCWComplex) : TopCat.{u} := +@[expose] noncomputable def toTopCat (X : RelCWComplex) : TopCat.{u} := Limits.colimit (Functor.ofSequence X.skInclSucc) noncomputable instance : Coe RelCWComplex TopCat where @@ -138,7 +138,7 @@ noncomputable instance : Coe CWComplex TopCat where coe X := toTopCat X.toRelCWComplex /-- The inclusion map from `sk n` (i.e., the $(n-1)$-skeleton of `X`) to `X` -/ -noncomputable def skIncl (X : RelCWComplex.{u}) (n : ℕ) : X.sk n ⟶ X := +@[expose] noncomputable def skIncl (X : RelCWComplex.{u}) (n : ℕ) : X.sk n ⟶ X := Limits.colimit.ι (Functor.ofSequence _) n @[simp] diff --git a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean index 1756816503..1dd7e40ae7 100644 --- a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean +++ b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean @@ -20,7 +20,7 @@ homeomorphic to `I × X`, where `I` is the unit interval. The $(-1)$-skeleton of `X.IProd` is homeomorphic to `{0, 1} × X`. -/ -@[expose] public section +public section open CategoryTheory unitInterval TopCat @@ -63,7 +63,7 @@ r X n | pushout | ``` `X.IProd.sk 0 = {0, 1} × X ≅ X.IProd.sk 1` -/ -noncomputable def sk (n : ℕ) : TopCat.{u} := +@[expose] noncomputable def sk (n : ℕ) : TopCat.{u} := match n with | 0 => TopCat.of (zeroOne × X.toTopCat) | n + 1 => Limits.pushout (IProd.l X n) (IProd.r X n) @@ -81,30 +81,31 @@ end IProd /-- `cubeInclToSk` -/ -noncomputable def cubeInclToSk {n : ℕ} (α : (X.attachCells n).cells) : 𝕀 n ⟶ X.sk (n + 1) := +@[expose] noncomputable def cubeInclToSk {n : ℕ} (α : (X.attachCells n).cells) : + 𝕀 n ⟶ X.sk (n + 1) := (diskPair.homeoCubePairULift n).inv.right ≫ Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ Limits.pushout.inr .. ≫ (X.attachCells n).isoPushout.inv /-- `cubeIncl` -/ -noncomputable def cubeIncl {n : ℕ} (α : (X.attachCells n).cells) : 𝕀 n ⟶ X := +@[expose] noncomputable def cubeIncl {n : ℕ} (α : (X.attachCells n).cells) : 𝕀 n ⟶ X := X.cubeInclToSk α ≫ X.skIncl (n + 1) /-- `cubeAtt` -/ -noncomputable def cubeAtt {n : ℕ} (α : (X.attachCells n).cells) : ∂𝕀 n ⟶ X.sk n := +@[expose] noncomputable def cubeAtt {n : ℕ} (α : (X.attachCells n).cells) : ∂𝕀 n ⟶ X.sk n := (diskPair.homeoCubePairULift n).inv.left ≫ (X.attachCells n).attachMaps α namespace IProd /-- `cubeAttBotOrTop` -/ -noncomputable def cubeAttBotOrTop {n : ℕ} (α : (X.attachCells n).cells) (t : zeroOne) : +@[expose] noncomputable def cubeAttBotOrTop {n : ℕ} (α : (X.attachCells n).cells) (t : zeroOne) : 𝕀 n ⟶ IProd.sk X (n + 1) := -- bottom face of `∂𝕀 (n + 1)` X.cubeIncl α ≫ ofHom ⟨fun x ↦ ⟨t, x⟩, by fun_prop⟩ ≫ -- X ⟶ {0, 1} × X Limits.pushout.inl .. /-- `cubeAttSides` -/ -noncomputable def cubeAttSides {n : ℕ} (α : (X.attachCells n).cells) : +@[expose] noncomputable def cubeAttSides {n : ℕ} (α : (X.attachCells n).cells) : TopCat.of (I × ∂𝕀 n) ⟶ IProd.sk X (n + 1) := -- sides of `∂𝕀 (n + 1)` ofHom ((ContinuousMap.id I).prodMap (X.cubeAtt α).hom) ≫ -- of (I × ∂𝕀 n) ⟶ of (I × (X.sk n)) Limits.pushout.inr .. @@ -115,10 +116,13 @@ lemma cubeAtt_compatible {n : ℕ} (α : (X.attachCells n).cells) (t : zeroOne) let iX : X.toTopCat ⟶ TopCat.of (zeroOne × X.toTopCat) := ofHom ⟨fun x ↦ ⟨t, x⟩, by fun_prop⟩ let isk : X.sk n ⟶ TopCat.of (zeroOne × (X.sk n)) := ofHom ⟨fun x ↦ ⟨t, x⟩, by fun_prop⟩ change ((diskPair.homeoCubePairULift n).inv.left ≫ diskBoundaryIncl n ≫ - Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ Limits.pushout.inr .. ≫ - (X.attachCells n).isoPushout.inv ≫ X.skIncl _ ≫ iX ≫ Limits.pushout.inl .. ) y = + Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ + Limits.pushout.inr (Limits.Sigma.desc (X.attachCells n).attachMaps) + (Limits.Sigma.map fun x ↦ diskBoundaryIncl n) ≫ + (X.attachCells n).isoPushout.inv ≫ X.skIncl _ ≫ iX ≫ + Limits.pushout.inl (l X n) (r X n) ) y = ((diskPair.homeoCubePairULift n).inv.left ≫ (X.attachCells n).attachMaps α ≫ - isk ≫ r X n ≫ Limits.pushout.inr .. ) y + isk ≫ r X n ≫ Limits.pushout.inr (l X n) (r X n) ) y have h := (X.attachCells n).w_cell α unfold RelCWComplex.AttachGeneralizedCells.pushoutInr at h unfold RelCWComplex.AttachGeneralizedCells.pushoutInl at h @@ -175,7 +179,7 @@ noncomputable def sigmaDisksInclToSk (n : ℕ) : ≫ Limits.pushout.inr .. /-- `skInclSucc` -/ -noncomputable def skInclSucc (n : ℕ) : IProd.sk X (n + 1) ⟶ IProd.sk X (n + 1 + 1) := +@[expose] noncomputable def skInclSucc (n : ℕ) : IProd.sk X (n + 1) ⟶ IProd.sk X (n + 1 + 1) := let il : TopCat.of (zeroOne × X.toTopCat) ⟶ IProd.sk X (n + 1 + 1) := Limits.pushout.inl .. let ir : TopCat.of (I × X.sk n) ⟶ IProd.sk X (n + 1 + 1) := ofHom ((ContinuousMap.id I).prodMap (X.skInclSucc _).hom) ≫ Limits.pushout.inr .. @@ -291,12 +295,12 @@ lemma commSqSkSk (n : ℕ) : change (X.cubeAtt α ≫ X.skInclSucc n) _ = _ unfold CWComplex.cubeAtt CWComplex.cubeInclToSk rw [Category.assoc] + unfold RelCWComplex.skInclSucc RelCWComplex.AttachCells.incl change _ = ((diskPair.homeoCubePairULift n).inv.left ≫ diskBoundaryIncl _ ≫ Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ Limits.pushout.inr .. ≫ (X.attachCells n).isoPushout.inv ) ⟨⟨(Cube.splitAtLast y).2, cubeBoundary.splitAtLast_snd_mem_boundary_of_mem_sides hk⟩⟩ congr 3 - unfold RelCWComplex.skInclSucc RelCWComplex.AttachCells.incl change (_ ≫ _) ≫ (X.attachCells n).isoPushout.inv = (_ ≫ _ ≫ _) ≫ (X.attachCells n).isoPushout.inv congr 1 @@ -607,7 +611,7 @@ noncomputable abbrev desc : IProd.sk X (n + 1 + 1) ⟶ Z.pt := Limits.pushout.desc (l'' X n Z) (r'' X n Z) (w'' X n Z) /-- `cocone` -/ -noncomputable def cocone (n : ℕ) : +@[expose] noncomputable def cocone (n : ℕ) : Limits.PushoutCocone (Limits.Sigma.desc (IProd.attachMaps X)) (Limits.Sigma.map fun _ ↦ diskBoundaryIncl (n + 1)) := diff --git a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Iso.lean b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Iso.lean index e460257047..c41aea650a 100644 --- a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Iso.lean +++ b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Iso.lean @@ -14,7 +14,7 @@ This file verifies that the pair `(X.IProd.sk 0, X.IProd)` is homeomorphic to and `I` is the unit interval. -/ -@[expose] public section +public section open CategoryTheory unitInterval TopCat @@ -123,7 +123,7 @@ lemma naturality : X.IProd.skInclSucc n ≫ incl X (n + 1) = incl X n := /-- The cocone with `X.IProd.sk 0 ⟶ X.IProd.sk 1 ⟶ ⋯` as base and `TopCat.of (I × X.toTopCat)` as vertex. This is actually a colimit cocone (see `CWComplex.IProd.colimitCocone`). -/ -noncomputable def cocone : Limits.Cocone (Functor.ofSequence X.IProd.skInclSucc) := +@[expose] noncomputable def cocone : Limits.Cocone (Functor.ofSequence X.IProd.skInclSucc) := { pt := TopCat.of (I × X.toTopCat) ι := NatTrans.ofSequence (incl X) <| by intro n diff --git a/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean b/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean index ef3b81ea23..fc9a7464b9 100644 --- a/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean +++ b/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean @@ -20,7 +20,7 @@ This is the theorem `IsCompressible.relCWComplex_of_diskBoundaryIncl`. Some proofs are similar to the ones in `Mathlib.CategoryTheory.LiftingProperties.Limits` -/ -@[expose] public section +public section open CategoryTheory unitInterval diff --git a/LeanPool/WhiteheadTheorem/Compressible/Defs.lean b/LeanPool/WhiteheadTheorem/Compressible/Defs.lean index ea1e8d2999..2e5c82bc28 100644 --- a/LeanPool/WhiteheadTheorem/Compressible/Defs.lean +++ b/LeanPool/WhiteheadTheorem/Compressible/Defs.lean @@ -15,7 +15,7 @@ public import Mathlib.Topology.Homotopy.Basic Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Compressible.Defs`. -/ -@[expose] public section +public section open CategoryTheory unitInterval @@ -58,7 +58,7 @@ namespace LiftStructUpToRelHomotopy variable {sq : CommSq f ι i F} (l : LiftStructUpToRelHomotopy sq) /-- `curriedH` -/ -noncomputable def curriedH : X' ⟶ TopCat.of C(I, X) := +@[expose] noncomputable def curriedH : X' ⟶ TopCat.of C(I, X) := ofHom l.H.some.toContinuousMap.argSwap.curry lemma curriedH_apply_zero : diff --git a/LeanPool/WhiteheadTheorem/Compressible/Disk.lean b/LeanPool/WhiteheadTheorem/Compressible/Disk.lean index 4328e4d0ae..95d24d4e93 100644 --- a/LeanPool/WhiteheadTheorem/Compressible/Disk.lean +++ b/LeanPool/WhiteheadTheorem/Compressible/Disk.lean @@ -23,7 +23,7 @@ it is compressible with respect to `TopCat.diskBoundaryIncl n : ∂𝔻 n ⟶ for each `n`. -/ -@[expose] public section +public section open CategoryTheory TopCat open scoped unitInterval ContinuousMap Topology Topology.Homotopy diff --git a/LeanPool/WhiteheadTheorem/Compressible/WeakEquiv.lean b/LeanPool/WhiteheadTheorem/Compressible/WeakEquiv.lean index 5300e018ce..cfab73baaa 100644 --- a/LeanPool/WhiteheadTheorem/Compressible/WeakEquiv.lean +++ b/LeanPool/WhiteheadTheorem/Compressible/WeakEquiv.lean @@ -26,7 +26,7 @@ hence the definition `TopCat.LiftStructUpToRelHomotopy` can be weakened (?) * T. tom Dieck, *Algebraic topology*. Theorem 8.4.3. -/ -@[expose] public section +public section universe u diff --git a/LeanPool/WhiteheadTheorem/Defs.lean b/LeanPool/WhiteheadTheorem/Defs.lean index 8a237548cd..619c33dfb7 100644 --- a/LeanPool/WhiteheadTheorem/Defs.lean +++ b/LeanPool/WhiteheadTheorem/Defs.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Defs`. -/ -@[expose] public section +public section open CategoryTheory @@ -39,6 +39,6 @@ lemma isIso_inducedPointedHom_of_isWeakHomotopyEquiv rwa [HomotopyGroup.inducedMap] at this /-- `IsHomotopyEquiv` -/ -def IsHomotopyEquiv {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] +@[expose] def IsHomotopyEquiv {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] (f : C(X, Y)) : Prop := ∃ equiv : X ≃ₕ Y, equiv.toFun = f diff --git a/LeanPool/WhiteheadTheorem/Exponential.lean b/LeanPool/WhiteheadTheorem/Exponential.lean index 3066d9e1d5..4876cdfe75 100644 --- a/LeanPool/WhiteheadTheorem/Exponential.lean +++ b/LeanPool/WhiteheadTheorem/Exponential.lean @@ -17,7 +17,7 @@ import Mathlib.Topology.UnitInterval Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Exponential`. -/ -@[expose] public section +public section open CategoryTheory open scoped Topology @@ -131,13 +131,13 @@ namespace ContinuousMap variable {A B Y : Type*} [TopologicalSpace A] [TopologicalSpace B] [TopologicalSpace Y] /-- `argSwap` -/ -@[simp] +@[expose, simp] def argSwap : C(C(A × B, Y), C(B × A, Y)) where toFun f := f.comp ContinuousMap.prodSwap continuous_toFun := by fun_prop /-- `curriedArgSwap` -/ -def curriedArgSwap [LocallyCompactSpace A] [LocallyCompactSpace B] : +@[expose] def curriedArgSwap [LocallyCompactSpace A] [LocallyCompactSpace B] : C(C(A, C(B, Y)), C(B, C(A, Y))) where toFun f := ContinuousMap.curry <| argSwap <| ContinuousMap.uncurry f continuous_toFun := by @@ -148,7 +148,7 @@ lemma curriedArgSwap_curriedArgSwap [LocallyCompactSpace A] [LocallyCompactSpace curriedArgSwap ∘ (curriedArgSwap (A := A) (B := B) (Y := Y)) = id := rfl /-- `curryLeft` -/ -def curryLeft (f : C(A × B, Y)) (b : B) : C(A, Y) where +@[expose] def curryLeft (f : C(A × B, Y)) (b : B) : C(A, Y) where toFun a := f ⟨a, b⟩ continuous_toFun := f.continuous.curry_left diff --git a/LeanPool/WhiteheadTheorem/HEP/Cofibration.lean b/LeanPool/WhiteheadTheorem/HEP/Cofibration.lean index 4259c0e505..6337a5f339 100644 --- a/LeanPool/WhiteheadTheorem/HEP/Cofibration.lean +++ b/LeanPool/WhiteheadTheorem/HEP/Cofibration.lean @@ -17,7 +17,7 @@ import Mathlib.CategoryTheory.LiftingProperties.Limits Imported Lean Pool material for `LeanPool.WhiteheadTheorem.HEP.Cofibration`. -/ -@[expose] public section +public section open CategoryTheory TopCat open scoped Topology unitInterval @@ -25,7 +25,7 @@ open scoped Topology unitInterval /-- `HasHomotopyExtensionProperty` -/ -def HasHomotopyExtensionProperty {A X : Type u} [TopologicalSpace A] [TopologicalSpace X] +@[expose] def HasHomotopyExtensionProperty {A X : Type u} [TopologicalSpace A] [TopologicalSpace X] (i : C(A, X)) (Y : Type u) [TopologicalSpace Y] : Prop := ∀ (f : C(X, Y)) (h : C(A × I, Y)), f ∘ i = h ∘ (·, 0) → ∃ H : C(X × I, Y), f = H ∘ (·, 0) ∧ h = H ∘ Prod.map i id diff --git a/LeanPool/WhiteheadTheorem/HEP/Cube.lean b/LeanPool/WhiteheadTheorem/HEP/Cube.lean index 097cc7201c..95ea7fa6fc 100644 --- a/LeanPool/WhiteheadTheorem/HEP/Cube.lean +++ b/LeanPool/WhiteheadTheorem/HEP/Cube.lean @@ -14,7 +14,7 @@ In this file, the homotopy extension property (HEP) of the pair $(I^n, ∂I^n)$ is derived from the HEP of $(D^n, ∂D^n)$. -/ -@[expose] public section +public section open CategoryTheory TopCat open scoped Topology unitInterval diff --git a/LeanPool/WhiteheadTheorem/HEP/CubeJar.lean b/LeanPool/WhiteheadTheorem/HEP/CubeJar.lean index b37a27b85b..3d9e525a57 100644 --- a/LeanPool/WhiteheadTheorem/HEP/CubeJar.lean +++ b/LeanPool/WhiteheadTheorem/HEP/CubeJar.lean @@ -13,7 +13,7 @@ public import LeanPool.WhiteheadTheorem.Auxiliary This file proves that the pair `(∂𝕀 n, ⊔𝕀 n)` has the homotopy extension property for `n ≥ 1`. -/ -@[expose] public section +public section open scoped Topology Topology.Homotopy unitInterval diff --git a/LeanPool/WhiteheadTheorem/HEP/Retract.lean b/LeanPool/WhiteheadTheorem/HEP/Retract.lean index d66476f91a..1a552694fa 100644 --- a/LeanPool/WhiteheadTheorem/HEP/Retract.lean +++ b/LeanPool/WhiteheadTheorem/HEP/Retract.lean @@ -17,7 +17,7 @@ public import LeanPool.WhiteheadTheorem.HEP.Cube Imported Lean Pool material for `LeanPool.WhiteheadTheorem.HEP.Retract`. -/ -@[expose] public section +public section open TopCat diff --git a/LeanPool/WhiteheadTheorem/HomotopyGroup/ChangeBasePt.lean b/LeanPool/WhiteheadTheorem/HomotopyGroup/ChangeBasePt.lean index 30e1030b90..8b1268ed4e 100644 --- a/LeanPool/WhiteheadTheorem/HomotopyGroup/ChangeBasePt.lean +++ b/LeanPool/WhiteheadTheorem/HomotopyGroup/ChangeBasePt.lean @@ -15,7 +15,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.WhiteheadTheorem.HomotopyGroup.ChangeBasePt`. -/ -@[expose] public section +public section -- import Mathlib.CategoryTheory.Category.Pointed -- import WhiteheadTheorem.HEP.Retract -- import Mathlib.CategoryTheory.LiftingProperties.Adjunction @@ -350,7 +350,7 @@ end GenLoop /-- Transport an element of `π_ n X (p 0)` along the path `p`. -/ -noncomputable def HomotopyGroup.changeBasePt (n : ℕ) (p : Path x₀ x₁) : +@[expose] noncomputable def HomotopyGroup.changeBasePt (n : ℕ) (p : Path x₀ x₁) : π_ n X x₀ → π_ n X x₁ := by apply Quotient.map fun f₀ ↦ (p # f₀) intro f₀ g₀ eq₀ diff --git a/LeanPool/WhiteheadTheorem/HomotopyGroup/InducedMaps.lean b/LeanPool/WhiteheadTheorem/HomotopyGroup/InducedMaps.lean index a69f128ea3..ed00caafb2 100644 --- a/LeanPool/WhiteheadTheorem/HomotopyGroup/InducedMaps.lean +++ b/LeanPool/WhiteheadTheorem/HomotopyGroup/InducedMaps.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.WhiteheadTheorem.HomotopyGroup.InducedMaps`. -/ -@[expose] public section +public section open CategoryTheory @@ -172,7 +172,7 @@ end Pointed namespace GenLoop /-- The map of `GenLoop`s induced by a morphism `f : X ⟶ Y` of pointed topological spaces -/ -def inducedMap' (n : ℕ) {X Y : PointedTopCat} (f : X ⟶ Y) : +@[expose] def inducedMap' (n : ℕ) {X Y : PointedTopCat} (f : X ⟶ Y) : Ω^ (Fin n) X.as X.point → Ω^ (Fin n) Y.as Y.point := fun α ↦ ⟨f.right.hom.comp α.val, fun i hi ↦ by rw [ContinuousMap.comp_apply, ← PointedTopCat.w f] @@ -207,7 +207,7 @@ private theorem inducedMap'_respects (n : ℕ) {X Y : PointedTopCat} (f : X ⟶ /-- The map between homotopy groups (as sets) induced by a morphism `f : X ⟶ Y` of pointed topological spaces -/ -def inducedMap' (n : ℕ) {X Y : PointedTopCat} (f : X ⟶ Y) : +@[expose] def inducedMap' (n : ℕ) {X Y : PointedTopCat} (f : X ⟶ Y) : π_ n X.as X.point → π_ n Y.as Y.point := Quotient.map (GenLoop.inducedMap' n f) fun {α β} hαβ ↦ by exact inducedMap'_respects n f (α := α) (β := β) hαβ @@ -245,7 +245,7 @@ end inducedMap /-- `π_n` is a functor sending a based topological space `(X, x₀)` to its `n`-th homotopy group (as a type, ignoring its group structure) based at `x₀`. -/ -noncomputable def functorToType (n : ℕ) : PointedTopCat.{u} ⥤ Type u where +@[expose] noncomputable def functorToType (n : ℕ) : PointedTopCat.{u} ⥤ Type u where obj X := π_ n X.as X.point map {X Y} f := TypeCat.ofHom (inducedMap' n f) map_id X := by @@ -266,7 +266,7 @@ noncomputable def functorToType (n : ℕ) : PointedTopCat.{u} ⥤ Type u where to its `n`-th homotopy group (as a pointed type whose base point is the contant map, ignoring its group structure) based at `x₀`. -/ -noncomputable def functorToPointed (n : ℕ) : PointedTopCat.{u} ⥤ Pointed.{u} where +@[expose] noncomputable def functorToPointed (n : ℕ) : PointedTopCat.{u} ⥤ Pointed.{u} where obj X := Pointed.of (default : π_ n X.as X.point) map {X Y} f := { toFun := (functorToType n).map f diff --git a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Algebra.lean b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Algebra.lean index 9053a664a4..f2900f8b52 100644 --- a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Algebra.lean +++ b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Algebra.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.NormNum.Pow TODO: Use `Pointed` (the category of pointed types) in Mathlib. -/ -@[expose] public section +public section /- A pointed map from `(X, x₀)` to `(Y, y₀)` is a function `f : X → Y` such that `f x₀ = y₀`. -/ diff --git a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Compression.lean b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Compression.lean index a5ba4d5023..4d93d9692b 100644 --- a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Compression.lean +++ b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Compression.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.GCD Imported Lean Pool material for `LeanPool.WhiteheadTheorem.RelHomotopyGroup.Compression`. -/ -@[expose] public section +public section open scoped unitInterval Topology Topology.Homotopy open ContinuousMap diff --git a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Defs.lean b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Defs.lean index e6b3923660..289b59e73e 100644 --- a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Defs.lean +++ b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/Defs.lean @@ -15,13 +15,13 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.WhiteheadTheorem.RelHomotopyGroup.Defs`. -/ -@[expose] public section +public section open scoped unitInterval Topology Topology.Homotopy /-- relative generalized loops -/ -def RelGenLoop (n : ℕ) (X : Type*) [TopologicalSpace X] (A : Set X) (a : A) : +@[expose] def RelGenLoop (n : ℕ) (X : Type*) [TopologicalSpace X] (A : Set X) (a : A) : Set C(I^ Fin n, X) := {f | (∀ y ∈ ∂I^n, f y ∈ A) ∧ ∀ y ∈ ⊔I^n, f y = a} @@ -31,7 +31,7 @@ namespace RelGenLoop variable {n : ℕ} {X : Type*} [TopologicalSpace X] {A : Set X} {a : A} /-- The constant `RelGenLoop` at `a`. -/ -def const : RelGenLoop n X A a := +@[expose] def const : RelGenLoop n X A a := ⟨ContinuousMap.const (I^ Fin n) a, ⟨by simp, by simp⟩⟩ instance inhabited : Inhabited (RelGenLoop n X A a) := @@ -92,7 +92,7 @@ end RelGenLoop /-- We have defined relative homotopy "groups" as mere sets. The group structure is not needed for the Whitehead theorem. -/ -def RelHomotopyGroup (n : ℕ) (X : Type*) [TopologicalSpace X] (A : Set X) (a : A) := +@[expose] def RelHomotopyGroup (n : ℕ) (X : Type*) [TopologicalSpace X] (A : Set X) (a : A) := Quotient (RelGenLoop.Homotopic.setoid n X A a) -- scoped[Topology] notation "π_" => RelHomotopyGroup @@ -121,12 +121,12 @@ def equivPi0 : π_rel 0 X A a ≃ π_ 0 X a := fun y hy ↦ isEmptyElim (⟨y, hy⟩ : ⊔I^0) ⟩ } ⟩ /-- `iStar'` -/ -def iStar' (f : Ω^ (Fin n) A a) : π_ n X a := +@[expose] def iStar' (f : Ω^ (Fin n) A a) : π_ n X a := Quotient.mk _ ⟨ ⟨Subtype.val ∘ f.val, f.val.continuous_toFun.subtype_val⟩, by intro y hy; simp only [ContinuousMap.coe_mk, Function.comp_apply, f.property y hy] ⟩ /-- The inclusion map $i_*$ (of pointed sets) from πₙ(A, a) to πₙ(X, a) -/ -def iStar : π_ n A a → π_ n X a := +@[expose] def iStar : π_ n A a → π_ n X a := Quotient.lift (iStar' n X A a) fun f g H ↦ -- if `f ≈ g` by `H` Quotient.sound <| Nonempty.intro -- then `inc f ≈ inc g` by this homotopy: { toHomotopy := (ContinuousMap.Homotopy.refl @@ -140,13 +140,13 @@ def iStar : π_ n A a → π_ n X a := simp_all } /-- `jStar'` -/ -def jStar' (f : Ω^ (Fin n) X a) : π_rel n X A a := +@[expose] def jStar' (f : Ω^ (Fin n) X a) : π_rel n X A a := Quotient.mk _ ⟨f, ⟨fun y hy ↦ Set.mem_of_eq_of_mem (f.property y hy) (Subtype.coe_prop a), fun y hy ↦ f.property y <| (Cube.boundaryJar_subset_boundary n) hy ⟩ ⟩ /-- The inclusion map $j_*$ (of pointed sets) from πₙ(A, a) to πₙ(X, A, a) -/ -def jStar : π_ n X a → π_rel n X A a := +@[expose] def jStar : π_ n X a → π_rel n X A a := Quotient.lift (jStar' n X A a) fun f g H ↦ Quotient.sound <| Nonempty.intro { toHomotopy := H.some.toHomotopy @@ -169,7 +169,7 @@ def jStar : π_ n X a → π_rel n X A a := /-- Restrict `f : C(I^ Fin (n + 1), X)` to the top face (where the last coordinate equals `1`). -/ -def bd' (f : RelGenLoop (n + 1) X A a) : π_ n A a := +@[expose] def bd' (f : RelGenLoop (n + 1) X A a) : π_ n A a := Quotient.mk _ ⟨ { toFun y := ⟨ (f ∘ Cube.inclToTop) y, f.property.left _ ⟨Fin.last _, by right; simp [Cube.splitAtLast, Cube.inclToTop]⟩ ⟩ @@ -183,7 +183,7 @@ def bd' (f : RelGenLoop (n + 1) X A a) : π_ n A a := exact Cube.inclToTop.mem_boundaryJar_of hy ⟩ /-- The boundary map $∂$ (of pointed sets) from πₙ₊₁(X, A, a) to πₙ(A, a) -/ -def bd : π_rel (n + 1) X A a → π_ n A a := +@[expose] def bd : π_rel (n + 1) X A a → π_ n A a := Quotient.lift (bd' n X A a) fun f g H ↦ Quotient.sound <| Nonempty.intro { toFun ty := ⟨H.some.toHomotopy.comp (ContinuousMap.Homotopy.refl Cube.inclToTop) ty, @@ -235,7 +235,7 @@ variable {n : ℕ} {X : Type*} [TopologicalSpace X] {A : Set X} {a : A} /-- Let `g` be a continuous function from `I^ Fin n` to `X`. If `g` is homotopic rel `∂I^n` to some `f : RelGenLoop n X A a`, then `g` itself can be regarded as a `RelGenLoop`. -/ -def ofHomotopyRel {n : ℕ} {X : Type*} [TopologicalSpace X] {A : Set X} {a : A} +@[expose] def ofHomotopyRel {n : ℕ} {X : Type*} [TopologicalSpace X] {A : Set X} {a : A} (f : RelGenLoop n X A a) (g : C(I^Fin n, X)) (H : ContinuousMap.HomotopyRel f g (∂I^n)) : RelGenLoop n X A a := let g_bd : ∀ y ∈ ∂I^n, g y = f.val y := -- g maps `∂I^n` in the same way `f` does. diff --git a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/LongExactSeq.lean b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/LongExactSeq.lean index 135dabf68e..d5a9aa611c 100644 --- a/LeanPool/WhiteheadTheorem/RelHomotopyGroup/LongExactSeq.lean +++ b/LeanPool/WhiteheadTheorem/RelHomotopyGroup/LongExactSeq.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.GCD Imported Lean Pool material for `LeanPool.WhiteheadTheorem.RelHomotopyGroup.LongExactSeq`. -/ -@[expose] public section +public section open scoped unitInterval Topology Topology.Homotopy open ContinuousMap diff --git a/LeanPool/WhiteheadTheorem/Shapes/Cube.lean b/LeanPool/WhiteheadTheorem/Shapes/Cube.lean index c01a905975..8aeaf999ea 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/Cube.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/Cube.lean @@ -14,7 +14,7 @@ public import Mathlib.Topology.Homotopy.HomotopyGroup Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.Cube`. -/ -@[expose] public section +public section open scoped unitInterval Topology Topology.Homotopy @@ -23,14 +23,14 @@ open scoped unitInterval Topology Topology.Homotopy namespace Cube /-- `Cube.boundaryJar (n + 1) = ∂Iⁿ × I ∪ Iⁿ × {0} ⊆ Iⁿ⁺¹` -/ -def boundaryJar (n : ℕ) : Set (I^ Fin n) := +@[expose] def boundaryJar (n : ℕ) : Set (I^ Fin n) := match n with | 0 => ∅ | _ + 1 => {y | (∃ i, y i = 0 ∨ y i = 1) ∧ (y (Fin.last _) = 1 → ∃ i < Fin.last _, y i = 0 ∨ y i = 1) } /-- `Cube.boundaryLid (n + 1) = Iⁿ × {1} ⊆ Iⁿ⁺¹` -/ -def boundaryLid (n : ℕ) : Set (I^ Fin n) := +@[expose] def boundaryLid (n : ℕ) : Set (I^ Fin n) := match n with | 0 => ∅ | _ + 1 => {y | y (Fin.last _) = 1} @@ -41,9 +41,9 @@ scoped[Topology.Homotopy] notation "∂I^" n => Cube.boundary (Fin n) scoped[Topology.Homotopy] notation "⊔I^" n => Cube.boundaryJar n /-- `boundaryIncl` -/ -def boundaryIncl (n : ℕ) : C(∂I^n, I^ (Fin n)) := ⟨Subtype.val, continuous_subtype_val⟩ +@[expose] def boundaryIncl (n : ℕ) : C(∂I^n, I^ (Fin n)) := ⟨Subtype.val, continuous_subtype_val⟩ /-- `boundaryJarIncl` -/ -def boundaryJarIncl (n : ℕ) : C(⊔I^n, I^ (Fin n)) := ⟨Subtype.val, continuous_subtype_val⟩ +@[expose] def boundaryJarIncl (n : ℕ) : C(⊔I^n, I^ (Fin n)) := ⟨Subtype.val, continuous_subtype_val⟩ instance isEmpty_boundary_zero : IsEmpty (∂I^0) := Set.isEmpty_coe_sort.mpr <| Set.subset_empty_iff.mp fun _ ⟨i, _⟩ ↦ isEmptyElim i @@ -56,7 +56,7 @@ lemma boundaryJar_subset_boundary (n : ℕ) : (⊔I^n) ⊆ (∂I^n) := | _ + 1 => fun _ ⟨hy1, _⟩ ↦ hy1 /-- `boundaryJarInclToBoundary` -/ -def boundaryJarInclToBoundary (n : ℕ) : C(⊔I^n, ∂I^n) where +@[expose] def boundaryJarInclToBoundary (n : ℕ) : C(⊔I^n, ∂I^n) where toFun := fun ⟨y, hy⟩ ↦ ⟨y, boundaryJar_subset_boundary n hy⟩ continuous_toFun := by fun_prop @@ -109,7 +109,7 @@ instance uniqueBoundaryJarOne : Unique (⊔I^1) where · exfalso; obtain ⟨k, hk⟩ := hy2 h1; exact Nat.not_succ_le_zero k hk.left /-- `homeoNeqLast` -/ -def homeoNeqLast {n : ℕ} : (I^ Fin n) ≃ₜ I^{ j : Fin (n + 1) // j ≠ Fin.last _ } := +@[expose] def homeoNeqLast {n : ℕ} : (I^ Fin n) ≃ₜ I^{ j : Fin (n + 1) // j ≠ Fin.last _ } := Homeomorph.piCongr { toFun i := ⟨i.castSucc, by simp_all ⟩ @@ -122,12 +122,12 @@ def homeoNeqLast {n : ℕ} : (I^ Fin n) ≃ₜ I^{ j : Fin (n + 1) // j ≠ Fin. fun _ ↦ Homeomorph.refl _ /-- A homeomorphism that sends `(y₀, y₁, …, yₙ₋₁, yₙ)` to `(yₙ, (y₀, y₁, …, yₙ₋₁))` -/ -def splitAtLast {n : ℕ} : (I^ Fin (n + 1)) ≃ₜ I × (I^ Fin n) := +@[expose] def splitAtLast {n : ℕ} : (I^ Fin (n + 1)) ≃ₜ I × (I^ Fin n) := splitAt (Fin.last _) |>.trans <| Homeomorph.prodCongr (Homeomorph.refl _) homeoNeqLast.symm /-- A homeomorphism that sends `(y₀, y₁, …, yₙ₋₁, yₙ)` to `((y₀, y₁, …, yₙ₋₁), yₙ)` -/ -def splitAtLastComm {n : ℕ} : (I^ Fin (n + 1)) ≃ₜ (I^ Fin n) × I := +@[expose] def splitAtLastComm {n : ℕ} : (I^ Fin (n + 1)) ≃ₜ (I^ Fin n) × I := splitAtLast.trans <| Homeomorph.prodComm I (I^ Fin n) lemma splitAtLast_fst_eq {n : ℕ} (y : I^Fin (n + 1)) : @@ -229,7 +229,7 @@ lemma splitAtLast_symm_mem_boundary_of_mem_boundary mapping (y₀, y₁, …, yₙ₋₁) to (y₀, y₁, …, yₙ₋₁, 1). (Although `1` appears first in this definition, it is actually the last coordinate in `(I^ Fin (n + 1))`, due to `Cube.insertAt`). -/ -def inclToTop {n : ℕ} : C(I^ Fin n, I^ Fin (n + 1)) where +@[expose] def inclToTop {n : ℕ} : C(I^ Fin n, I^ Fin (n + 1)) where toFun y := splitAtLast.symm ⟨1, y⟩ continuous_toFun := splitAtLast.symm.continuous.comp <| Continuous.prodMk continuous_const continuous_id @@ -276,12 +276,12 @@ lemma splitAtLast_inclToTop_eq {n : ℕ} {y : I^Fin n} : Homeomorph.apply_symm_apply, Homeomorph.symm_apply_apply] /-- `(y₀, y₁, …, yₙ₋₁, yₙ) ↦ (y₀, y₁, …, yₙ₋₁)` -/ -def discardLast {n : ℕ} : C(I^ Fin (n + 1), I^ Fin n) where +@[expose] def discardLast {n : ℕ} : C(I^ Fin (n + 1), I^ Fin n) where toFun y := fun i ↦ y ⟨i.val, i.prop.trans (by omega : n < n + 1)⟩ continuous_toFun := by fun_prop /-- (y₀, y₁, …, yₙ₋₁) ↦ (y₀, y₁, …, yₙ₋₁, 0) -/ -def inclToBot {n : ℕ} : C(I^ Fin n, I^ Fin (n + 1)) where +@[expose] def inclToBot {n : ℕ} : C(I^ Fin n, I^ Fin (n + 1)) where toFun y := Cube.insertAt (Fin.last _) ⟨0, Cube.homeoNeqLast y⟩ continuous_toFun := (Cube.insertAt _).continuous.comp <| Continuous.prodMk continuous_const Cube.homeoNeqLast.continuous @@ -306,14 +306,14 @@ lemma mem_boundaryJar {n : ℕ} (y : I^Fin n) : inclToBot y ∈ ⊔I^(n + 1) := end inclToBot /-- The inclusion (y₀, y₁, …, yₙ₋₁) ↦ (y₀, y₁, …, yₙ₋₁, 0) to the bottom face of `⊔I^(n+1)` -/ -def inclToBoundaryJarBot {n : ℕ} : C(I^ Fin n, ⊔I^(n+1)) where +@[expose] def inclToBoundaryJarBot {n : ℕ} : C(I^ Fin n, ⊔I^(n+1)) where toFun y := ⟨ inclToBot y, inclToBot.mem_boundaryJar y ⟩ continuous_toFun := Continuous.subtype_mk inclToBot.continuous _ /-- The inclusion `(y, t) ↦ (y₀, y₁, …, yₙ₋₁, t)` to the sides of `⊔I^(n+1)`, i.e., the closure of the complement of the top and bottom faces of `∂I^(n+1)`. -/ -def inclToBoundaryJarSides {n : ℕ} : C((∂I^n) × I, ⊔I^(n+1)) where +@[expose] def inclToBoundaryJarSides {n : ℕ} : C((∂I^n) × I, ⊔I^(n+1)) where toFun := fun yt ↦ ⟨ (toContinuousMap splitAtLastComm.symm |>.comp <| ContinuousMap.prodMap (boundaryIncl n) (ContinuousMap.id _)) yt, @@ -333,7 +333,7 @@ def inclToBoundaryJarSides {n : ℕ} : C((∂I^n) × I, ⊔I^(n+1)) where /-- The inclusion `(y, t) ↦ (y₀, y₁, …, yₙ₋₁, t)` to the sides of the $(n+1)$-dimensional cube. -/ -def inclToSides {n : ℕ} : C((∂I^n) × I, I^ Fin (n + 1)) where +@[expose] def inclToSides {n : ℕ} : C((∂I^n) × I, I^ Fin (n + 1)) where toFun := Subtype.val ∘ inclToBoundaryJarSides continuous_toFun := Continuous.subtype_val inclToBoundaryJarSides.continuous @@ -343,13 +343,13 @@ end Cube namespace TopCat /-- `cube` -/ -def cube (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| I^ Fin n +@[expose] def cube (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| I^ Fin n /-- `cubeBoundary` -/ -def cubeBoundary (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| Cube.boundary (Fin n) +@[expose] def cubeBoundary (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| Cube.boundary (Fin n) /-- `cubeBoundaryJar` -/ -def cubeBoundaryJar (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| Cube.boundaryJar n +@[expose] def cubeBoundaryJar (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| Cube.boundaryJar n /-- `𝕀 n` denotes the `n`-cube (as an object in `TopCat`). -/ scoped prefix:arg "𝕀 " => cube @@ -362,14 +362,15 @@ of the `n`-cube (as an object in `TopCat`). -/ scoped prefix:arg "⊔𝕀 " => cubeBoundaryJar /-- The inclusion `∂𝕀 n ⟶ 𝕀 n` of the boundary of the `n`-cube. -/ -def cubeBoundaryIncl (n : ℕ) : cubeBoundary.{u} n ⟶ cube.{u} n := +@[expose] def cubeBoundaryIncl (n : ℕ) : cubeBoundary.{u} n ⟶ cube.{u} n := ofHom { toFun := fun ⟨⟨p, _⟩⟩ ↦ ⟨p⟩ continuous_toFun := continuous_uliftUp.comp <| continuous_subtype_val.comp continuous_induced_dom } /-- `cubeBoundaryJarInclToBoundary` -/ -def cubeBoundaryJarInclToBoundary (n : ℕ) : cubeBoundaryJar.{u} n ⟶ cubeBoundary.{u} n := +@[expose] def cubeBoundaryJarInclToBoundary (n : ℕ) : + cubeBoundaryJar.{u} n ⟶ cubeBoundary.{u} n := ofHom { toFun := fun ⟨p⟩ ↦ ⟨Cube.boundaryJarInclToBoundary n p⟩ continuous_toFun := by fun_prop } @@ -379,7 +380,7 @@ lemma cubeBoundaryIncl_apply_down_eq {n : ℕ} (y : I^Fin n) (hy : y ∈ ∂I^n) (cubeBoundaryIncl n ⟨⟨y, hy⟩⟩).down = y := rfl /-- `cubeSplitAtLast` -/ -def cubeSplitAtLast {n : ℕ} : 𝕀 (n + 1) ≅ TopCat.of (I × 𝕀 n) where +@[expose] def cubeSplitAtLast {n : ℕ} : 𝕀 (n + 1) ≅ TopCat.of (I × 𝕀 n) where hom := ofHom ⟨fun ⟨y⟩ ↦ ⟨(Cube.splitAtLast y).fst, ⟨(Cube.splitAtLast y).snd⟩⟩, by fun_prop⟩ inv := ofHom ⟨fun ⟨t, ⟨y⟩⟩ ↦ ⟨Cube.splitAtLast.symm ⟨t, y⟩⟩, by fun_prop⟩ hom_inv_id := by @@ -411,7 +412,7 @@ namespace cubeBoundary /-- The inclusion from the n-dimensional cube to the top or bottom face of the boundary of the (n+1)-dimensional cube, mapping (y₀, y₁, …, yₙ₋₁) to (y₀, y₁, …, yₙ₋₁, t). -/ -def cubeInclToBotOrTop {n : ℕ} (t : unitInterval.zeroOne) : 𝕀 n ⟶ ∂𝕀 (n + 1) := +@[expose] def cubeInclToBotOrTop {n : ℕ} (t : unitInterval.zeroOne) : 𝕀 n ⟶ ∂𝕀 (n + 1) := ofHom { toFun := fun ⟨y⟩ ↦ ⟨Cube.splitAtLast.symm ⟨unitInterval.zeroOneIncl t, y⟩, by use Fin.last _ diff --git a/LeanPool/WhiteheadTheorem/Shapes/CubeBoundaryMap.lean b/LeanPool/WhiteheadTheorem/Shapes/CubeBoundaryMap.lean index 5198d28607..66863a7313 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/CubeBoundaryMap.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/CubeBoundaryMap.lean @@ -14,7 +14,7 @@ public import LeanPool.WhiteheadTheorem.Auxiliary Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.CubeBoundaryMap`. -/ -@[expose] public section +public section open scoped Topology Topology.Homotopy CategoryTheory @@ -91,7 +91,7 @@ variable (f01 : zeroOne → (cube.{u} n ⟶ Z)) -- bottom or top face of `∂ variable (fs : TopCat.of (I × cubeBoundary.{u} n) ⟶ Z) -- sides of `∂𝕀 (n + 1)` /-- `mapVecOfBotTopSides` -/ -def mapVecOfBotTopSides : (k : Fin 3) → C(botTopSidesCover n k, Z) := +@[expose] def mapVecOfBotTopSides : (k : Fin 3) → C(botTopSidesCover n k, Z) := let g0 : C(botOrTop.{u} n 0, Z) := ⟨fun ⟨⟨y, _⟩, _⟩ ↦ f01 0 ⟨(Cube.splitAtLast y).snd⟩, by apply (f01 0).hom.continuous.comp @@ -141,7 +141,7 @@ theorem mapVecOfBotTopSides_compatible · exact mapVecOfBotTopSides_compatible_botOrTop _ _ h |>.right _ hyk hyj |>.symm /-- `mapOfBotTopSides` -/ -noncomputable def mapOfBotTopSides +@[expose] noncomputable def mapOfBotTopSides (h : ∀ t y, f01 t (cubeBoundaryIncl _ y) = fs ⟨zeroOneIncl t, y⟩) : ∂𝕀 (n + 1) ⟶ Z := ofHom <| ContinuousMap.liftCoverClosed (botTopSidesCover n) diff --git a/LeanPool/WhiteheadTheorem/Shapes/Disk.lean b/LeanPool/WhiteheadTheorem/Shapes/Disk.lean index 1356ea3655..144db66639 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/Disk.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/Disk.lean @@ -14,18 +14,18 @@ public import Mathlib.Topology.Category.TopCat.Basic Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.Disk`. -/ -@[expose] public section +public section namespace TopCat /-- The `n`-disk is the set of points in ℝⁿ whose norm is at most `1`, endowed with the subspace topology. -/ -noncomputable def disk (n : ℕ) : TopCat.{u} := +@[expose] noncomputable def disk (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| Metric.closedBall (0 : EuclideanSpace ℝ (Fin n)) 1 /-- The boundary of the `n`-disk. -/ -noncomputable def diskBoundary (n : ℕ) : TopCat.{u} := +@[expose] noncomputable def diskBoundary (n : ℕ) : TopCat.{u} := TopCat.of <| ULift <| Metric.sphere (0 : EuclideanSpace ℝ (Fin n)) 1 /-- The `n`-sphere is the set of points in ℝⁿ⁺¹ whose norm equals `1`, @@ -43,7 +43,7 @@ scoped prefix:arg "∂𝔻 " => diskBoundary scoped prefix:arg "𝕊 " => sphere /-- The inclusion `∂𝔻 n ⟶ 𝔻 n` of the boundary of the `n`-disk. -/ -def diskBoundaryIncl (n : ℕ) : diskBoundary.{u} n ⟶ disk.{u} n := +@[expose] def diskBoundaryIncl (n : ℕ) : diskBoundary.{u} n ⟶ disk.{u} n := ofHom { toFun := fun ⟨p, hp⟩ ↦ ⟨p, le_of_eq hp⟩ continuous_toFun := ⟨fun t ⟨s, ⟨r, hro, hrs⟩, hst⟩ ↦ by diff --git a/LeanPool/WhiteheadTheorem/Shapes/DiskHomeoCube.lean b/LeanPool/WhiteheadTheorem/Shapes/DiskHomeoCube.lean index 27d3e92bb3..e3c1ca9471 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/DiskHomeoCube.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/DiskHomeoCube.lean @@ -17,7 +17,7 @@ import LeanPool.WhiteheadTheorem.Auxiliary Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.DiskHomeoCube`. -/ -@[expose] public section +public section open scoped Topology TopCat ENNReal unitInterval @@ -29,11 +29,11 @@ universe u v variable (n : ℕ) (p q : ℝ≥0∞) [hp : Fact (1 ≤ p)] [hq : Fact (1 ≤ q)] /-- The unit disk in `ℝⁿ` based on the `Lᵖ` norm, where `p ≥ 1`. -/ -def pDisk (n : ℕ) (p : ℝ≥0∞) [hp : Fact (1 ≤ p)] : TopCat.{u} := +@[expose] def pDisk (n : ℕ) (p : ℝ≥0∞) [hp : Fact (1 ≤ p)] : TopCat.{u} := TopCat.of <| ULift <| Metric.closedBall (0 : PiLp p fun (_ : Fin n) ↦ ℝ) 1 /-- The boundary of the `pDisk`. -/ -def pDiskBoundary (n : ℕ) (p : ℝ≥0∞) [hp : Fact (1 ≤ p)] : TopCat.{u} := +@[expose] def pDiskBoundary (n : ℕ) (p : ℝ≥0∞) [hp : Fact (1 ≤ p)] : TopCat.{u} := TopCat.of <| ULift <| Metric.sphere (0 : PiLp p fun (_ : Fin n) ↦ ℝ) 1 /-- The inclusion of the boundary of the `pDisk`. -/ diff --git a/LeanPool/WhiteheadTheorem/Shapes/Jar.lean b/LeanPool/WhiteheadTheorem/Shapes/Jar.lean index 094abeded2..a386355ae7 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/Jar.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/Jar.lean @@ -14,7 +14,7 @@ public import LeanPool.WhiteheadTheorem.Shapes.Disk Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.Jar`. -/ -@[expose] public section +public section open TopCat diff --git a/LeanPool/WhiteheadTheorem/Shapes/MappingCylinder.lean b/LeanPool/WhiteheadTheorem/Shapes/MappingCylinder.lean index 0bf0ef1458..5bdcac49e8 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/MappingCylinder.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/MappingCylinder.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Measurability.Init Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.MappingCylinder`. -/ -@[expose] public section +public section open CategoryTheory open scoped unitInterval ContinuousMap @@ -33,7 +33,7 @@ namespace TopCat /-- The mapping cylinder of a continuous map `f : X ⟶ Y`. -/ -noncomputable def MapCyl : TopCat.{u} := Limits.pushout f (Cyl.i₀ X) +@[expose] noncomputable def MapCyl : TopCat.{u} := Limits.pushout f (Cyl.i₀ X) namespace MapCyl @@ -77,12 +77,12 @@ theorem isEmbedding_domIncl : Topology.IsEmbedding (domIncl f) := by /-- The domain `X` of a continuous map `f` is homeomorphic to the top surface of the mapping cylinder of `f`. -/ -noncomputable def domHomeoTop : X ≃ₜ top f := (isEmbedding_domIncl f).toHomeomorph +@[expose] noncomputable def domHomeoTop : X ≃ₜ top f := (isEmbedding_domIncl f).toHomeomorph /-- `domInclToTop` -/ -noncomputable def domInclToTop : C(X, top f) := toContinuousMap (domHomeoTop f) +@[expose] noncomputable def domInclToTop : C(X, top f) := toContinuousMap (domHomeoTop f) /-- `domInclFromTop` -/ -def domInclFromTop : C(top f, MapCyl f) := ⟨Subtype.val, continuous_subtype_val⟩ +@[expose] def domInclFromTop : C(top f, MapCyl f) := ⟨Subtype.val, continuous_subtype_val⟩ lemma domIncl_hom_eq_domInclFromTop_comp_domInclToTop : (domIncl f).hom = (domInclFromTop f).comp (domInclToTop f) := rfl @@ -120,7 +120,7 @@ and is equal to uncurried form when evaluated at any `t : I` (see `curriedDeformRetrEvalAt_eq_deformRetrEvalAt`). Note: `s * t` uses the instance `unitInterval.continuousMul` in `Shapes/Maps.lean`. -/ -noncomputable def curriedDeformRetr : MapCyl f ⟶ TopCat.of C(I, MapCyl f) := +@[expose] noncomputable def curriedDeformRetr : MapCyl f ⟶ TopCat.of C(I, MapCyl f) := Limits.pushout.desc (PathSpace.homToConstPaths (inl f)) (ofHom <| ContinuousMap.curry { toFun := fun ⟨⟨x, s⟩, t⟩ ↦ (inr f).hom ⟨x, s * t⟩ @@ -133,7 +133,7 @@ noncomputable def curriedDeformRetr : MapCyl f ⟶ TopCat.of C(I, MapCyl f) := exact congr_fun (congr_arg (ContinuousMap.toFun ∘ Hom.hom) (condition f)) x ) /-- `curriedDeformRetrEvalAt` -/ -noncomputable def curriedDeformRetrEvalAt (t : I) : MapCyl f ⟶ MapCyl f := +@[expose] noncomputable def curriedDeformRetrEvalAt (t : I) : MapCyl f ⟶ MapCyl f := ofHom <| (curriedDeformRetr f).hom.uncurry.curryLeft t lemma curriedDeformRetrEvalAt_hom_apply (t : I) (z : MapCyl f) : diff --git a/LeanPool/WhiteheadTheorem/Shapes/Maps.lean b/LeanPool/WhiteheadTheorem/Shapes/Maps.lean index efd7cef94b..a177e2475b 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/Maps.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/Maps.lean @@ -15,7 +15,7 @@ public import Mathlib.Topology.Category.TopCat.Basic Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.Maps`. -/ -@[expose] public section +public section -- import Mathlib.Topology.Category.TopCat.Limits.Basic open scoped Topology unitInterval CategoryTheory @@ -91,7 +91,7 @@ lemma set_neq_zero_eq_compl_range_i₀ (X : TopCat.{u}) : simp_all only [not_true_eq_false] /-- `i₁ToComplRangeI₀` -/ -def i₁ToComplRangeI₀ (X : TopCat.{u}) : +@[expose] def i₁ToComplRangeI₀ (X : TopCat.{u}) : C(X, (Set.range (Cyl.i₀ X)).compl) where toFun x := ⟨Cyl.i₁ _ x, by rw [(by rfl: (Set.range (Cyl.i₀ X)).compl = {z | z ∉ Set.range (Cyl.i₀ X)})] diff --git a/LeanPool/WhiteheadTheorem/Shapes/Pushout.lean b/LeanPool/WhiteheadTheorem/Shapes/Pushout.lean index bb4e44af6d..747a0797a3 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/Pushout.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/Pushout.lean @@ -14,7 +14,7 @@ public import Mathlib.CategoryTheory.Limits.Shapes.FiniteLimits Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.Pushout`. -/ -@[expose] public section +public section /-! TODO: diff --git a/LeanPool/WhiteheadTheorem/Shapes/UnitInterval.lean b/LeanPool/WhiteheadTheorem/Shapes/UnitInterval.lean index 4454befad7..c4330d8991 100644 --- a/LeanPool/WhiteheadTheorem/Shapes/UnitInterval.lean +++ b/LeanPool/WhiteheadTheorem/Shapes/UnitInterval.lean @@ -13,7 +13,7 @@ public import Mathlib.Topology.UnitInterval Imported Lean Pool material for `LeanPool.WhiteheadTheorem.Shapes.UnitInterval`. -/ -@[expose] public section +public section namespace unitInterval diff --git a/LeanPool/ZFLean.lean b/LeanPool/ZFLean.lean index f3389b46b5..05376f3345 100644 --- a/LeanPool/ZFLean.lean +++ b/LeanPool/ZFLean.lean @@ -32,7 +32,7 @@ Tags: set-theory, zfc, foundations MSC: 03E30, 03B35 -/ -@[expose] public section +public section /-! # ZFLean diff --git a/LeanPool/ZFLean/Basic.lean b/LeanPool/ZFLean/Basic.lean index 48e1b26892..7295094480 100644 --- a/LeanPool/ZFLean/Basic.lean +++ b/LeanPool/ZFLean/Basic.lean @@ -14,7 +14,7 @@ import Mathlib.Tactic.Attr.Core Imported Lean Pool material for `LeanPool.ZFLean.Basic`. -/ -@[expose] public section +public section noncomputable section namespace ZFSet diff --git a/LeanPool/ZFLean/Booleans.lean b/LeanPool/ZFLean/Booleans.lean index 27308f49b8..07fcfcdd92 100644 --- a/LeanPool/ZFLean/Booleans.lean +++ b/LeanPool/ZFLean/Booleans.lean @@ -25,7 +25,7 @@ It defines the following operations: -/ -@[expose] public section +public section noncomputable section diff --git a/LeanPool/ZFLean/Embeddings.lean b/LeanPool/ZFLean/Embeddings.lean index ca158255d3..f700828650 100644 --- a/LeanPool/ZFLean/Embeddings.lean +++ b/LeanPool/ZFLean/Embeddings.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ZFLean.Embeddings`. -/ -@[expose] public section +public section namespace ZFSet /-- Imported ZFLean declaration. -/ diff --git a/LeanPool/ZFLean/Functions.lean b/LeanPool/ZFLean/Functions.lean index efe03022e0..013882e227 100644 --- a/LeanPool/ZFLean/Functions.lean +++ b/LeanPool/ZFLean/Functions.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ZFLean.Functions`. -/ -@[expose] public section +public section namespace ZFSet @@ -99,7 +99,7 @@ theorem _root_.ZFSet.funs.nonempty {A B : ZFSet} (hB : B ≠ ∅) : ZFSet.funs A `IsPFunc f A B` is the assertion that `f` is a partial function from `A` to `B`, i.e. that if `pair x y ∈ f` and `pair x z ∈ f` then `y = z`. -/ -def IsPFunc (f A B : ZFSet) := f ⊆ prod A B ∧ ∀ x y : +@[expose] def IsPFunc (f A B : ZFSet) := f ⊆ prod A B ∧ ∀ x y : ZFSet, pair x y ∈ f → ∀ z, pair x z ∈ f → y = z @[zrel] @@ -213,16 +213,16 @@ theorem is_func_of_pfunc (f : ZFSet) {A B} (hf : f.IsPFunc A B) : IsFunc f.Dom B rw [pair_mem_prod] exact ⟨u_dom, yB⟩ /-- Imported ZFLean declaration. -/ -def IsInjective (f : ZFSet) {A B : ZFSet} (_hf : IsFunc A B f := by zfun) := +@[expose] def IsInjective (f : ZFSet) {A B : ZFSet} (_hf : IsFunc A B f := by zfun) := let _ := _hf ∀ x y z, x ∈ A → y ∈ A → z ∈ B → x.pair z ∈ f → y.pair z ∈ f → x = y /-- Imported ZFLean declaration. -/ -def IsSurjective (f : ZFSet) {A B : ZFSet} (_hf : IsFunc A B f := by zfun) := +@[expose] def IsSurjective (f : ZFSet) {A B : ZFSet} (_hf : IsFunc A B f := by zfun) := let _ := _hf ∀ y ∈ B, ∃ x ∈ A, x.pair y ∈ f /-- A function is bijective when it is injective and surjective. -/ -def IsBijective (f : ZFSet) {A B : ZFSet} (hf : IsFunc A B f := by zfun) := +@[expose] def IsBijective (f : ZFSet) {A B : ZFSet} (hf : IsFunc A B f := by zfun) := f.IsInjective ∧ f.IsSurjective theorem _root_.ZFSet.IsInjective.ofBijective {f A B C : ZFSet} {hf : IsFunc A B f} @@ -357,7 +357,7 @@ If `f : A → B` and `g : B → C` are functions, then `composition g f` is the from `A` to `C` defined by `composition g f (x, z) = (x, y)` where `y` is such that `(x, y) ∈ f` and `(y, z) ∈ g`. -/ -def composition (g f : ZFSet) (A B C : ZFSet) : ZFSet := +@[expose] def composition (g f : ZFSet) (A B C : ZFSet) : ZFSet := (A.prod C).sep fun xz => ∃ (x z : ZFSet), xz = x.pair z ∧ ∃ y ∈ B, x.pair y ∈ f ∧ y.pair z ∈ g @@ -564,7 +564,8 @@ theorem fcomp_assoc {A B C D : ZFSet} {f : ZFSet} {g : ZFSet} {h : ZFSet} open Classical in /-- Imported ZFLean declaration. -/ -noncomputable def fapply (f : ZFSet) {A B : ZFSet} (hf : f.IsPFunc A B := by zpfun) : +@[expose] noncomputable def fapply (f : ZFSet) {A B : ZFSet} + (hf : f.IsPFunc A B := by zpfun) : {x // x ∈ f.Dom} → {x // x ∈ B} := fun ⟨x, x_dom⟩ ↦ have : ∃ y ∈ B, pair x y ∈ f := by unfold Dom at x_dom @@ -1143,7 +1144,8 @@ theorem fcomp_bij_fcomp_inv_left {A B C : ZFSet} {f g h : ZFSet} {hf : IsFunc B /-- The image of a set under a relation. -/ -def Image (R : ZFSet) {A B : ZFSet} (X : ZFSet) (_hR : R ⊆ A.prod B := by zrel) : ZFSet := +@[expose] def Image (R : ZFSet) {A B : ZFSet} (X : ZFSet) + (_hR : R ⊆ A.prod B := by zrel) : ZFSet := let _ := _hR B.sep (fun y ↦ ∃ x ∈ X, x.pair y ∈ R) diff --git a/LeanPool/ZFLean/Integers.lean b/LeanPool/ZFLean/Integers.lean index 8c0b943f91..4fec843a6d 100644 --- a/LeanPool/ZFLean/Integers.lean +++ b/LeanPool/ZFLean/Integers.lean @@ -22,7 +22,7 @@ Finally, we show that that the `ZFInt` type is isomorphic to the type of element `ZFSet.Int` type using the Schröder-Bernstein theorem. -/ -@[expose] public section +public section universe u namespace ZFSet @@ -51,7 +51,7 @@ protected instance instSetoidZFNatZFNat : Setoid (ZFNat × ZFNat) where abbrev ZFInt := Quotient ZFSet.instSetoidZFNatZFNat namespace ZFInt /-- Imported ZFLean declaration. -/ -def mk : ZFNat × ZFNat → ZFInt := Quotient.mk'' +@[expose] def mk : ZFNat × ZFNat → ZFInt := Quotient.mk'' @[simp] theorem mk_eq (x : ZFNat × ZFNat) : @Eq ZFInt ⟦x⟧ (mk x) := rfl @[simp] diff --git a/LeanPool/ZFLean/Isomorphisms.lean b/LeanPool/ZFLean/Isomorphisms.lean index 3038f28dbc..e08f16b892 100644 --- a/LeanPool/ZFLean/Isomorphisms.lean +++ b/LeanPool/ZFLean/Isomorphisms.lean @@ -17,10 +17,10 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ZFLean.Isomorphisms`. -/ -@[expose] public section +public section namespace ZFSet /-- Imported ZFLean declaration. -/ -def isIso (A B : ZFSet) : Prop := +@[expose] def isIso (A B : ZFSet) : Prop := ∃ (bij : ZFSet) (is_func : A.IsFunc B bij), bij.IsBijective is_func /-- Imported ZFLean declaration. -/ infix:40 " ≅ᶻ " => ZFSet.isIso diff --git a/LeanPool/ZFLean/IsomorphismsFunsToPowRel.lean b/LeanPool/ZFLean/IsomorphismsFunsToPowRel.lean index bf751e60dd..a50d790a1e 100644 --- a/LeanPool/ZFLean/IsomorphismsFunsToPowRel.lean +++ b/LeanPool/ZFLean/IsomorphismsFunsToPowRel.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ZFLean.IsomorphismsFunsToPowRel`. -/ -@[expose] public section +public section namespace ZFSet diff --git a/LeanPool/ZFLean/IsomorphismsZFNatIso.lean b/LeanPool/ZFLean/IsomorphismsZFNatIso.lean index c6568d9bf3..eb61a1fe02 100644 --- a/LeanPool/ZFLean/IsomorphismsZFNatIso.lean +++ b/LeanPool/ZFLean/IsomorphismsZFNatIso.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ZFLean.IsomorphismsZFNatIso`. -/ -@[expose] public section +public section namespace ZFSet diff --git a/LeanPool/ZFLean/Naturals.lean b/LeanPool/ZFLean/Naturals.lean index 09a6c96030..54a1db4a94 100644 --- a/LeanPool/ZFLean/Naturals.lean +++ b/LeanPool/ZFLean/Naturals.lean @@ -34,7 +34,7 @@ various properties and usual arithmetic operations on natural numbers. -/ -@[expose] public section +public section universe u @@ -207,7 +207,7 @@ theorem succ_mem_Nat' {n} (h : n ∈ Nat) : insert n n ∈ Nat := by The successor function `succ` is build from the insertion of a set into itself embedded into the `ZFNat` type. -/ -def succ (n : ZFNat) : ZFNat := +@[expose] def succ (n : ZFNat) : ZFNat := let ⟨n, h⟩ := n have p : insert n n ∈ Nat := succ_mem_Nat' h ⟨insert n n, p⟩ @@ -543,7 +543,7 @@ theorem pred_in_Nat' ⦃x : ZFSet⦄ (h : x ∈ Nat) : (⋃₀ x : ZFSet) ∈ Na rw [sUnion_insert_nat] <;> assumption /-- The predecessor function on natural numbers, defined directly as the union of a set. -/ -def pred (x : ZFNat) : ZFNat := x.map sUnion pred_in_Nat' +@[expose] def pred (x : ZFNat) : ZFNat := x.map sUnion pred_in_Nat' theorem pred_eq (n : ZFNat) : pred n = ⟨⋃₀ n.val, pred_in_Nat' n.property⟩ := rfl diff --git a/LeanPool/ZFLean/Rationals.lean b/LeanPool/ZFLean/Rationals.lean index 8f9ac46587..dedc989a7c 100644 --- a/LeanPool/ZFLean/Rationals.lean +++ b/LeanPool/ZFLean/Rationals.lean @@ -15,7 +15,7 @@ This file defines the rational numbers in ZFC, based on the integers and using t -/ -@[expose] public section +public section namespace ZFSet /-- Imported ZFLean declaration. -/ @@ -67,7 +67,7 @@ abbrev ZFRat := Quotient ZFSet.instSetoidZFIntZFInt' namespace ZFRat /-- Imported ZFLean declaration. -/ -def mk : ZFInt × ZFInt' → ZFRat := Quotient.mk'' +@[expose] def mk : ZFInt × ZFInt' → ZFRat := Quotient.mk'' @[simp] theorem mk_eq (x : ZFInt × ZFInt') : @Eq ZFRat ⟦x⟧ (mk x) := rfl diff --git a/LeanPool/ZFLean/Sum.lean b/LeanPool/ZFLean/Sum.lean index d01eb85ced..3899b3019a 100644 --- a/LeanPool/ZFLean/Sum.lean +++ b/LeanPool/ZFLean/Sum.lean @@ -19,14 +19,14 @@ import Mathlib.Tactic.NormNum.Pow Imported Lean Pool material for `LeanPool.ZFLean.Sum`. -/ -@[expose] public section +public section universe u v namespace ZFSet /-- Imported ZFLean declaration. -/ -def Sum (A B : ZFSet) := +@[expose] def Sum (A B : ZFSet) := {x // x ∈ (ZFSet.prod { ZFBool.false.val } A) ∪ (ZFSet.prod { ZFBool.true.val } B)} /-- Imported ZFLean declaration. -/ infixr:50 " ⊎ " => Sum @@ -169,7 +169,7 @@ noncomputable def instEquivSumSubtypeMem {A B : ZFSet} : A ⊎ B ≃ ({x // x end Sum /-- Imported ZFLean declaration. -/ -def Option (S : ZFSet) := {∅} ⊎ S +@[expose] def Option (S : ZFSet) := {∅} ⊎ S instance {T : ZFSet} : Nonempty (Option T) := ⟨Sum.inl ⟨∅, mem_singleton.mpr rfl⟩⟩ diff --git a/LeanPool/Zeta3Irrational.lean b/LeanPool/Zeta3Irrational.lean index 52a086ef97..5bedb300a8 100644 --- a/LeanPool/Zeta3Irrational.lean +++ b/LeanPool/Zeta3Irrational.lean @@ -27,7 +27,7 @@ Tags: number-theory, analysis, zeta-functions MSC: 11M06, 11J72 -/ -@[expose] public section +public section /-! This project formalizes the integral identities and denominator/positivity/ diff --git a/LeanPool/Zeta3Irrational/Basic.lean b/LeanPool/Zeta3Irrational/Basic.lean index e29a5bb247..b8f1bc649e 100644 --- a/LeanPool/Zeta3Irrational/Basic.lean +++ b/LeanPool/Zeta3Irrational/Basic.lean @@ -23,7 +23,7 @@ import Mathlib.RingTheory.DedekindDomain.Basic # LeanPool.Zeta3Irrational.Basic -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational diff --git a/LeanPool/Zeta3Irrational/Bound.lean b/LeanPool/Zeta3Irrational/Bound.lean index 3d4dde9d24..4179b0527c 100644 --- a/LeanPool/Zeta3Irrational/Bound.lean +++ b/LeanPool/Zeta3Irrational/Bound.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Order.Star.Real # LeanPool.Zeta3Irrational.Bound -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational diff --git a/LeanPool/Zeta3Irrational/Chebyshev.lean b/LeanPool/Zeta3Irrational/Chebyshev.lean index 7c959b44fc..2661fcbc9b 100644 --- a/LeanPool/Zeta3Irrational/Chebyshev.lean +++ b/LeanPool/Zeta3Irrational/Chebyshev.lean @@ -20,7 +20,7 @@ upstream PrimeNumberTheoremAnd development. It gives an eventual bound `ψ x ≤ 1.13 x`, enough to control the lcm denominator in Beukers' proof. -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational namespace ChebyshevAux diff --git a/LeanPool/Zeta3Irrational/D.lean b/LeanPool/Zeta3Irrational/D.lean index 8498004179..19c2d1c299 100644 --- a/LeanPool/Zeta3Irrational/D.lean +++ b/LeanPool/Zeta3Irrational/D.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Nat.Choose.Factorization # LeanPool.Zeta3Irrational.D -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational @@ -22,7 +22,7 @@ open scoped Nat open BigOperators /-- The least common multiple of a finite set of natural numbers. -/ -def d (s : Finset ℕ) : ℕ := s.lcm id +@[expose] def d (s : Finset ℕ) : ℕ := s.lcm id theorem d_insert (s : Finset ℕ) (n : ℕ) : d (insert n s) = Nat.lcm n (d s) := by simp only [d, Finset.lcm_insert, id_eq] diff --git a/LeanPool/Zeta3Irrational/Equality.lean b/LeanPool/Zeta3Irrational/Equality.lean index 5bad819a90..01eeb15de3 100644 --- a/LeanPool/Zeta3Irrational/Equality.lean +++ b/LeanPool/Zeta3Irrational/Equality.lean @@ -13,7 +13,7 @@ import Mathlib.Analysis.SpecialFunctions.Integrals.Basic # LeanPool.Zeta3Irrational.Equality -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational diff --git a/LeanPool/Zeta3Irrational/Integral.lean b/LeanPool/Zeta3Irrational/Integral.lean index b0c7aeb162..06cbbfd6eb 100644 --- a/LeanPool/Zeta3Irrational/Integral.lean +++ b/LeanPool/Zeta3Irrational/Integral.lean @@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Integral.IntegralEqImproper # LeanPool.Zeta3Irrational.Integral -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational diff --git a/LeanPool/Zeta3Irrational/LegendrePoly.lean b/LeanPool/Zeta3Irrational/LegendrePoly.lean index 8a95c74bba..d35a7c1aec 100644 --- a/LeanPool/Zeta3Irrational/LegendrePoly.lean +++ b/LeanPool/Zeta3Irrational/LegendrePoly.lean @@ -21,7 +21,7 @@ polynomial in `ℤ[X]`. We prove some basic properties of the shiftedLegendre po -/ -@[expose] public section +public section open scoped Nat open BigOperators Finset diff --git a/LeanPool/Zeta3Irrational/LinearForm.lean b/LeanPool/Zeta3Irrational/LinearForm.lean index 6a1c63d90f..b6c8e32093 100644 --- a/LeanPool/Zeta3Irrational/LinearForm.lean +++ b/LeanPool/Zeta3Irrational/LinearForm.lean @@ -13,7 +13,7 @@ import Mathlib.Tactic.Positivity.Finset # LeanPool.Zeta3Irrational.LinearForm -/ -@[expose] public section +public section namespace LeanPool.Zeta3Irrational diff --git a/LeanPool/Zeta5Irrational/Andreief.lean b/LeanPool/Zeta5Irrational/Andreief.lean index 035eaf098e..ac66a7f6af 100644 --- a/LeanPool/Zeta5Irrational/Andreief.lean +++ b/LeanPool/Zeta5Irrational/Andreief.lean @@ -21,7 +21,7 @@ For functions `f i, g j : ℝ → ℝ` with `f i * g j` integrable, This is (6.10) of the paper in the form used for the Hankel determinant. -/ -@[expose] public section +public section open MeasureTheory Finset Equiv diff --git a/LeanPool/Zeta5Irrational/ArcsineAtoms.lean b/LeanPool/Zeta5Irrational/ArcsineAtoms.lean index e73144b514..3fe03a5db7 100644 --- a/LeanPool/Zeta5Irrational/ArcsineAtoms.lean +++ b/LeanPool/Zeta5Irrational/ArcsineAtoms.lean @@ -27,14 +27,14 @@ Hence `∫₀^{2π} log ‖z - y(θ)‖ dθ = 2π (log (r/2) + log⁺ ‖q₁‖ circle-average identity, which gives the closed form `Uω` of (A.1) for real `z`. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology namespace Zeta5Irrational /-- The arcsine curve `θ ↦ m + r cos θ` (as a complex number). -/ -noncomputable def arcCurve (m r : ℝ) (θ : ℝ) : ℂ := +@[expose] noncomputable def arcCurve (m r : ℝ) (θ : ℝ) : ℂ := ((m + r * Real.cos θ : ℝ) : ℂ) lemma continuous_arcCurve (m r : ℝ) : Continuous (arcCurve m r) := by unfold arcCurve; fun_prop diff --git a/LeanPool/Zeta5Irrational/ArcsinePotential.lean b/LeanPool/Zeta5Irrational/ArcsinePotential.lean index 3dad751de5..29278883da 100644 --- a/LeanPool/Zeta5Irrational/ArcsinePotential.lean +++ b/LeanPool/Zeta5Irrational/ArcsinePotential.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Ring.RingNF regularisation error. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology diff --git a/LeanPool/Zeta5Irrational/Arith/BasisChange.lean b/LeanPool/Zeta5Irrational/Arith/BasisChange.lean index fd21e2cede..aa080726f4 100644 --- a/LeanPool/Zeta5Irrational/Arith/BasisChange.lean +++ b/LeanPool/Zeta5Irrational/Arith/BasisChange.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.Ring.Basic `det [μ_X(D_N⁶ E_a E_b / D_K)] = det(C)² Δ_K` where `C` is the coefficient matrix. -/ -@[expose] public section +public section open Finset Polynomial @@ -74,7 +74,7 @@ lemma μX_sum {ι : Type*} (K : ℕ) (s : Finset ι) (f : ι → ℚ[X]) : | insert a s ha ih => rw [Finset.sum_insert ha, Finset.sum_insert ha, μX_add, ih] /-- The coefficient matrix of a family of polynomials. -/ -noncomputable def coeffMat {h : ℕ} (E : Fin h → ℚ[X]) : Matrix (Fin h) (Fin h) ℚ := +@[expose] noncomputable def coeffMat {h : ℕ} (E : Fin h → ℚ[X]) : Matrix (Fin h) (Fin h) ℚ := Matrix.of fun a k => (E a).coeff k lemma sum_coeffMat {h : ℕ} (E : Fin h → ℚ[X]) (hE : ∀ a, (E a).natDegree < h) (a : Fin h) : diff --git a/LeanPool/Zeta5Irrational/Arith/BinomBasis.lean b/LeanPool/Zeta5Irrational/Arith/BinomBasis.lean index 20b9142153..a276ab1841 100644 --- a/LeanPool/Zeta5Irrational/Arith/BinomBasis.lean +++ b/LeanPool/Zeta5Irrational/Arith/BinomBasis.lean @@ -28,7 +28,7 @@ import Mathlib.Tactic.Ring.Basic * `newton` : `P = ∑_{k ≤ d} Δ^k P(0) · bin k` for `deg P ≤ d`. -/ -@[expose] public section +public section open Finset Polynomial @@ -44,7 +44,7 @@ lemma poly_eq_of_nat {P Q : ℚ[X]} (h : ∀ n : ℕ, P.eval (n : ℚ) = Q.eval /-! ### The Bernoulli functional -/ /-- `Lb Q = ∑_n Q_n B_n`. -/ -noncomputable def Lb (Q : ℚ[X]) : ℚ := +@[expose] noncomputable def Lb (Q : ℚ[X]) : ℚ := Q.sum fun n a => a * _root_.bernoulli n lemma Lb_add (P Q : ℚ[X]) : Lb (P + Q) = Lb P + Lb Q := by @@ -103,7 +103,7 @@ theorem Lb_shift (Q : ℚ[X]) : Lb (Q.comp (X + 1)) - Lb Q = Q.derivative.eval 0 /-! ### The binomial basis -/ /-- `bin k = x(x-1)⋯(x-k+1)/k!`. -/ -noncomputable def bin (k : ℕ) : ℚ[X] := +@[expose] noncomputable def bin (k : ℕ) : ℚ[X] := C ((k.factorial : ℚ)⁻¹) * descPochhammer ℚ k lemma bin_eval_nat (k m : ℕ) : (bin k).eval (m : ℚ) = (m.choose k : ℚ) := by @@ -168,7 +168,7 @@ lemma eq_C_of_comp_add_one {Q : ℚ[X]} (h : Q.comp (X + 1) = Q) : Q = C (Q.eval push_cast; rw [this, ih] /-- The coefficients of the derivative in the binomial basis. -/ -noncomputable def dcoef (j : ℕ) : ℚ := +@[expose] noncomputable def dcoef (j : ℕ) : ℚ := (-1) ^ (j - 1) / (j : ℚ) /-- **Derivative of the binomial polynomials**. -/ diff --git a/LeanPool/Zeta5Irrational/Arith/ClassCount.lean b/LeanPool/Zeta5Irrational/Arith/ClassCount.lean index 9290182522..278ec09be4 100644 --- a/LeanPool/Zeta5Irrational/Arith/ClassCount.lean +++ b/LeanPool/Zeta5Irrational/Arith/ClassCount.lean @@ -20,7 +20,7 @@ For `p = 2m + 1` every residue `c` mod `p` is `≡ ±a` for a unique `a ∈ {0, We express the per-class counts `classCount` of the framework in terms of these classes. -/ -@[expose] public section +public section open Finset Polynomial @@ -33,7 +33,7 @@ def mu (p : ℕ) (a : ℕ) (c : ZMod p) : ℕ := (if ((a : ℤ) : ZMod p) = c then 1 else 0) + (if ((a : ℤ) : ZMod p) = -c then 1 else 0) /-- The class of a residue. -/ -def ccls (hm : 2 * m + 1 = p) (c : ZMod p) : Fin (m + 1) := +@[expose] def ccls (hm : 2 * m + 1 = p) (c : ZMod p) : Fin (m + 1) := if h : c.val ≤ m then ⟨c.val, by omega⟩ else ⟨p - c.val, by have := c.val_lt; omega⟩ lemma ccls_spec (hm : 2 * m + 1 = p) (c : ZMod p) : @@ -100,7 +100,7 @@ lemma mu_eq (hm : 2 * m + 1 = p) (a : Fin (m + 1)) (c : ZMod p) : ite_eq_right (fun h => ha (ccls_unique hm c a (Or.inr h)))] /-- `#{j ≤ X : j ≡ c} + #{j ≤ X : j ≡ -c}`. -/ -def SX (p X : ℕ) (c : ZMod p) : ℕ := +@[expose] def SX (p X : ℕ) (c : ZMod p) : ℕ := ((Icc 1 X).filter fun j : ℕ => ((j : ℤ) : ZMod p) = c).card + ((Icc 1 X).filter fun j : ℕ => ((j : ℤ) : ZMod p) = -c).card @@ -112,10 +112,11 @@ lemma SX_ccls (hm : 2 * m + 1 = p) (X : ℕ) (c : ZMod p) : rw [SX_neg] /-- The class constant `5[a = 0] + 6 S_N(a) - S_K(a)`. -/ -noncomputable def Bse (p K N : ℕ) (a : ℕ) : ℚ := +@[expose] noncomputable def Bse (p K N : ℕ) (a : ℕ) : ℚ := (if a = 0 then 5 else 0) + 6 * (SX p N (((a : ℤ) : ZMod p)) : ℚ) - SX p K (((a : ℤ) : ZMod p)) /-- The vanishing order of the row `s = (a, i)` at the class `b`. -/ +@[expose] def nu {m : ℕ} (L : Fin (m + 1) → ℕ) (s : Σ a : Fin (m + 1), Fin (L a)) (b : Fin (m + 1)) : ℕ := if b = s.1 then s.2 else L b diff --git a/LeanPool/Zeta5Irrational/Arith/ClassFrame.lean b/LeanPool/Zeta5Irrational/Arith/ClassFrame.lean index 422e7f7093..593989e917 100644 --- a/LeanPool/Zeta5Irrational/Arith/ClassFrame.lean +++ b/LeanPool/Zeta5Irrational/Arith/ClassFrame.lean @@ -26,14 +26,14 @@ Classes `a = 0, …, m` (with `p = 2m + 1`), dimensions `L a` with `∑ L = h`, entry inequalities, then `v_p^G(Δ) ≥ 2 ∑ w`. -/ -@[expose] public section +public section open Finset Polynomial namespace Zeta5Irrational /-- The `t`-roots of the basis polynomial `E_{a,i}`. -/ -def classRoots {m : ℕ} (L : Fin (m + 1) → ℕ) (a : Fin (m + 1)) (i : ℕ) : Multiset ℤ := +@[expose] def classRoots {m : ℕ} (L : Fin (m + 1) → ℕ) (a : Fin (m + 1)) (i : ℕ) : Multiset ℤ := (∑ c ∈ Finset.univ.erase a, Multiset.replicate (L c) ((c : ℕ) : ℤ)) + Multiset.replicate i ((a : ℕ) : ℤ) @@ -42,7 +42,7 @@ lemma card_classRoots {m : ℕ} (L : Fin (m + 1) → ℕ) (a : Fin (m + 1)) (i : simp [classRoots, Multiset.card_sum] /-- `∏_{γ ∈ M} (t + γ²)` over `ℤ`. -/ -noncomputable def tpolZ (M : Multiset ℤ) : ℤ[X] := +@[expose] noncomputable def tpolZ (M : Multiset ℤ) : ℤ[X] := (M.map fun γ : ℤ => X + C (γ ^ 2)).prod lemma tpolZ_map_Q (M : Multiset ℤ) : (tpolZ M).map (Int.castRingHom ℚ) = tpol M := by @@ -102,12 +102,13 @@ lemma sq_injective {p m : ℕ} [hp : Fact p.Prime] (hm : 2 * m + 1 = p) : exact Fin.ext (by omega) /-- The `t`-roots of the numerator `D_N⁶ E_s E_t`. -/ +@[expose] def entryRoots {m : ℕ} (N : ℕ) (L : Fin (m + 1) → ℕ) (s t : Σ a : Fin (m + 1), Fin (L a)) : Multiset ℤ := 6 • ((Icc 1 N).val.map fun j : ℕ => (j : ℤ)) + classRoots L s.1 s.2 + classRoots L t.1 t.2 /-- The per-class count appearing in the entry bound. -/ -noncomputable def classCount (p : ℕ) (K : ℕ) (M : Multiset ℤ) (c : ZMod p) : ℚ := +@[expose] noncomputable def classCount (p : ℕ) (K : ℕ) (M : Multiset ℤ) (c : ZMod p) : ℚ := (((if c = 0 then 5 else 0) + (M.filter fun γ : ℤ => (γ : ZMod p) = c).card + (M.filter fun γ : ℤ => (γ : ZMod p) = -c).card : ℕ) : diff --git a/LeanPool/Zeta5Irrational/Arith/DirectBound.lean b/LeanPool/Zeta5Irrational/Arith/DirectBound.lean index b534fd1c38..65f19f49b6 100644 --- a/LeanPool/Zeta5Irrational/Arith/DirectBound.lean +++ b/LeanPool/Zeta5Irrational/Arith/DirectBound.lean @@ -26,7 +26,7 @@ where `e_c` (resp. `ℓ_c`) is the number of zeros (resp. poles) in the class `c This replaces the `p`-adic distribution formula of the paper (Lemmas 3.1–3.2). -/ -@[expose] public section +public section open Finset Polynomial @@ -35,15 +35,15 @@ namespace Zeta5Irrational variable {p : ℕ} [hp : Fact p.Prime] /-- The numerator `κ ∏_{ζ ∈ Z} (x - ζ)`. -/ -noncomputable def numOf (κ : ℚ) (Z : Multiset ℤ) : ℚ[X] := +@[expose] noncomputable def numOf (κ : ℚ) (Z : Multiset ℤ) : ℚ[X] := C κ * (Z.map fun ζ : ℤ => X - C (ζ : ℚ)).prod /-- Number of zeros in the class `c`. -/ -def cnt (p : ℕ) (Z : Multiset ℤ) (c : ZMod p) : ℕ := +@[expose] def cnt (p : ℕ) (Z : Multiset ℤ) (c : ZMod p) : ℕ := (Z.filter fun ζ : ℤ => (ζ : ZMod p) = c).card /-- Poles in the class `c`. -/ -def plc (p : ℕ) (Pl : Finset ℤ) (c : ZMod p) : Finset ℤ := +@[expose] def plc (p : ℕ) (Pl : Finset ℤ) (c : ZMod p) : Finset ℤ := Pl.filter fun r : ℤ => (r : ZMod p) = c /-! ### Integer valuations -/ @@ -148,7 +148,7 @@ lemma VG_eval_numOf (κ : ℚ) (hκ : VG p κ 0) (Z : Multiset ℤ) (x : ℤ) : simpa using hκ.mul (VG_prod_sub Z x) /-- Poles in the same class differ by exactly one power of `p`. -/ -def Sep (p : ℕ) (Pl : Finset ℤ) : Prop := +@[expose] def Sep (p : ℕ) (Pl : Finset ℤ) : Prop := ∀ r ∈ Pl, ∀ s ∈ Pl, r ≠ s → (r : ZMod p) = s → ¬(p : ℤ) ^ 2 ∣ r - s lemma padicValRat_denom_le (Pl : Finset ℤ) (hsep : Sep p Pl) {r : ℤ} (hr : r ∈ Pl) : diff --git a/LeanPool/Zeta5Irrational/Arith/DirectPoly.lean b/LeanPool/Zeta5Irrational/Arith/DirectPoly.lean index 69254cdf03..44749e101e 100644 --- a/LeanPool/Zeta5Irrational/Arith/DirectPoly.lean +++ b/LeanPool/Zeta5Irrational/Arith/DirectPoly.lean @@ -28,7 +28,7 @@ For every integer `m`, `v_p(P(m)) ≥ β` where `P` is the polynomial part of `κ ∏ (x - ζ) / ∏ (x - r)` and `β ≤ e_c - ℓ_c` for every class `c`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/InnerAlloc.lean b/LeanPool/Zeta5Irrational/Arith/InnerAlloc.lean index 2f6824cd76..c690f77ca7 100644 --- a/LeanPool/Zeta5Irrational/Arith/InnerAlloc.lean +++ b/LeanPool/Zeta5Irrational/Arith/InnerAlloc.lean @@ -26,14 +26,14 @@ remaining rows into the zero class. Then * `Φ(kf) ≥ Φ(k) - (k - klo) L0min/2` for every `k ∈ [klo, ktop]`. -/ -@[expose] public section +public section open Finset namespace Zeta5Irrational /-- The number of rows of offset `β` below the level `k`: `⌈(k - β)/2⌉⁺`. -/ -def lrow (k β : ℤ) : ℕ := +@[expose] def lrow (k β : ℤ) : ℕ := ((k - β + 1) / 2).toNat lemma lrow_ge (k β : ℤ) : ((k : ℚ) - β) / 2 ≤ lrow k β := by @@ -70,7 +70,7 @@ lemma lrow_succ (k β : ℤ) : unfold lrow; omega /-- `ψ(k, β) = ∑_{i < lrow} (k/2 - i - β/2)`. -/ -noncomputable def psiR (k β : ℤ) : ℚ := +@[expose] noncomputable def psiR (k β : ℤ) : ℚ := ∑ i ∈ range (lrow k β), (((k : ℚ) - 2 * i - β) / 2) lemma psiR_succ (k β : ℤ) : psiR (k + 1) β = psiR k β + (lrow (k + 1) β : ℚ) / 2 := by @@ -95,11 +95,11 @@ lemma psiR_succ (k β : ℤ) : psiR (k + 1) β = psiR k β + (lrow (k + 1) β : variable {m : ℕ} /-- Rows used at level `k`. -/ -def rowsK (β : Fin (m + 1) → ℤ) (k : ℤ) : ℕ := +@[expose] def rowsK (β : Fin (m + 1) → ℤ) (k : ℤ) : ℕ := ∑ c ∈ univ.erase (0 : Fin (m + 1)), lrow k (β c) /-- `Φ(k) = h k / 2 - ∑ ψ`. -/ -noncomputable def PhiK (β : Fin (m + 1) → ℤ) (h : ℕ) (k : ℤ) : ℚ := +@[expose] noncomputable def PhiK (β : Fin (m + 1) → ℤ) (h : ℕ) (k : ℤ) : ℚ := (h : ℚ) * k / 2 - ∑ c ∈ univ.erase (0 : Fin (m + 1)), psiR k (β c) lemma PhiK_succ (β : Fin (m + 1) → ℤ) (h : ℕ) (k : ℤ) : @@ -196,7 +196,7 @@ theorem PhiK_le_kf (hlo : rowsK β klo + L0min ≤ h) {k : ℤ} (hk1 : klo ≤ k end /-- The allocation. -/ -noncomputable def allocK (β : Fin (m + 1) → ℤ) (h : ℕ) (kf : ℤ) (c : Fin (m + 1)) : ℕ := +@[expose] noncomputable def allocK (β : Fin (m + 1) → ℤ) (h : ℕ) (kf : ℤ) (c : Fin (m + 1)) : ℕ := if c = 0 then h - rowsK β kf else lrow kf (β c) lemma sum_allocK (β : Fin (m + 1) → ℤ) (h : ℕ) (kf : ℤ) (hkf : rowsK β kf ≤ h) : diff --git a/LeanPool/Zeta5Irrational/Arith/InnerWeights.lean b/LeanPool/Zeta5Irrational/Arith/InnerWeights.lean index 8ce315a0ae..db50df957e 100644 --- a/LeanPool/Zeta5Irrational/Arith/InnerWeights.lean +++ b/LeanPool/Zeta5Irrational/Arith/InnerWeights.lean @@ -21,7 +21,7 @@ If `top a - 1 ≤ top c` for all `a, c ≠ 0` (P) and `top a - 1 ≤ 2 L 0 + (b (Z), then `v_p^G(Δ) ≥ 2 ∑ w`. -/ -@[expose] public section +public section open Finset Polynomial @@ -30,11 +30,11 @@ namespace Zeta5Irrational variable {m : ℕ} /-- `top a = L a + (b a - 4)/2`. -/ -noncomputable def topw (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) (a : Fin (m + 1)) : ℚ := +@[expose] noncomputable def topw (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) (a : Fin (m + 1)) : ℚ := L a + (b a - 4) / 2 /-- The minimum of `top` over the ordinary classes. -/ -noncomputable def tmin (hm : 1 ≤ m) (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) : ℚ := +@[expose] noncomputable def tmin (hm : 1 ≤ m) (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) : ℚ := (Finset.univ.erase (0 : Fin (m + 1))).inf' ⟨⟨1, by omega⟩, by simp [Fin.ext_iff]⟩ (topw L b) lemma tmin_le (hm : 1 ≤ m) (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) {c : Fin (m + 1)} (hc : c ≠ 0) : @@ -141,11 +141,12 @@ theorem inner_bound {p : ℕ} [Fact p.Prime] (hp5 : 5 ≤ p) (hm : 2 * m + 1 = p /-! ### Capped weights: validity needs only the zero-class condition -/ /-- Uncapped weights. -/ +@[expose] noncomputable def wraw (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) (s : Σ a : Fin (m + 1), Fin (L a)) : ℚ := if s.1 = 0 then 2 * (s.2 : ℚ) + (b 0 - 4) / 2 else (s.2 : ℚ) + (b s.1 - 4) / 2 /-- Capped weights `min (wraw) (min_{c ≠ 0} top c)`. -/ -noncomputable def wcap (hm : 1 ≤ m) (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) +@[expose] noncomputable def wcap (hm : 1 ≤ m) (L : Fin (m + 1) → ℕ) (b : ℕ → ℚ) (s : Σ a : Fin (m + 1), Fin (L a)) : ℚ := min (wraw L b s) (tmin hm L b) diff --git a/LeanPool/Zeta5Irrational/Arith/IntPoly.lean b/LeanPool/Zeta5Irrational/Arith/IntPoly.lean index 8b2ecef0a2..3df413edca 100644 --- a/LeanPool/Zeta5Irrational/Arith/IntPoly.lean +++ b/LeanPool/Zeta5Irrational/Arith/IntPoly.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.Ring.Basic composition and evaluation, and division by `X - a` (for `p`-integral roots `a`). -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/LowRank.lean b/LeanPool/Zeta5Irrational/Arith/LowRank.lean index 32ff1b6892..45f6c75a1b 100644 --- a/LeanPool/Zeta5Irrational/Arith/LowRank.lean +++ b/LeanPool/Zeta5Irrational/Arith/LowRank.lean @@ -24,7 +24,7 @@ If `v(A_{st}) ≥ w_s + w_t` with `w ≤ 0`, and `U`, `V` are `p`-integral of in `v_p^G(det(A + p⁻¹ U V)) ≥ 2 ∑ w - r` (via the Schur complement). -/ -@[expose] public section +public section open Finset Polynomial Matrix diff --git a/LeanPool/Zeta5Irrational/Arith/MomentVal.lean b/LeanPool/Zeta5Irrational/Arith/MomentVal.lean index 4266d6c97f..05f4682b4e 100644 --- a/LeanPool/Zeta5Irrational/Arith/MomentVal.lean +++ b/LeanPool/Zeta5Irrational/Arith/MomentVal.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Ring.Basic for `e < 2p - 3` (von Staudt–Clausen). -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Arith/OuterBasis.lean b/LeanPool/Zeta5Irrational/Arith/OuterBasis.lean index c3fbe5d171..58d2780a1e 100644 --- a/LeanPool/Zeta5Irrational/Arith/OuterBasis.lean +++ b/LeanPool/Zeta5Irrational/Arith/OuterBasis.lean @@ -19,7 +19,7 @@ row `(c, i)` (`i < Lo c`) is `tpol (rootsO c i)` with where `big c` are the tail poles of class `c` above `p`. -/ -@[expose] public section +public section open Finset Polynomial @@ -28,7 +28,7 @@ namespace Zeta5Irrational variable {p : ℕ} [hp : Fact p.Prime] {m : ℕ} /-- The class of a natural number. -/ -def jc (hm : 2 * m + 1 = p) (j : ℕ) : Fin (m + 1) := +@[expose] def jc (hm : 2 * m + 1 = p) (j : ℕ) : Fin (m + 1) := ccls hm (((j : ℤ) : ZMod p)) lemma sq_eq_iff_ccls (hm : 2 * m + 1 = p) (x y : ZMod p) : @@ -55,27 +55,27 @@ lemma sq_eq_iff_ccls (hm : 2 * m + 1 = p) (x y : ZMod p) : variable (hm : 2 * m + 1 = p) (n : ℕ) /-- Tail poles `N < j ≤ K`. -/ -def tailO (n : ℕ) : Finset ℕ := +@[expose] def tailO (n : ℕ) : Finset ℕ := Icc (3 * n + 1) (40 * n) /-- Outer pole indices belonging to the residue class `c`. -/ -def tailC (c : Fin (m + 1)) : Finset ℕ := +@[expose] def tailC (c : Fin (m + 1)) : Finset ℕ := (tailO n).filter fun j => jc hm j = c /-- Number of rows allocated to the outer residue class `c`. -/ -def LoC (c : Fin (m + 1)) : ℕ := +@[expose] def LoC (c : Fin (m + 1)) : ℕ := (tailC hm n c).card /-- Outer pole indices in class `c` that exceed the prime `p`. -/ -def bigC (c : Fin (m + 1)) : Finset ℕ := +@[expose] def bigC (c : Fin (m + 1)) : Finset ℕ := (tailC hm n c).filter fun j => p < j /-- Number of outer poles in class `c` that exceed `p`. -/ -def nbC (c : Fin (m + 1)) : ℕ := +@[expose] def nbC (c : Fin (m + 1)) : ℕ := (bigC hm n c).card /-- The roots of the outer row `(c, i)`. -/ -def rootsO (c : Fin (m + 1)) (i : ℕ) : Multiset ℤ := +@[expose] def rootsO (c : Fin (m + 1)) (i : ℕ) : Multiset ℤ := ((tailO n).filter fun j => jc hm j ≠ c).val.map (fun j : ℕ => (j : ℤ)) + (if i < nbC hm n c then Multiset.replicate i ((c : ℕ) : ℤ) else @@ -117,7 +117,7 @@ lemma sq_jc (j : ℕ) : (((j : ℤ) : ZMod p)) ^ 2 = ((((jc hm j : ℕ) : ℤ) : rw [sq_eq_iff_ccls hm, ccls_self]; rfl /-- `γ_c = -c²` in `𝔽_p`. -/ -def γO (c : Fin (m + 1)) : ZMod p := +@[expose] def γO (c : Fin (m + 1)) : ZMod p := -((((c : ℕ) : ℤ) : ZMod p)) ^ 2 lemma map_factor (γ : ℤ) : diff --git a/LeanPool/Zeta5Irrational/Arith/OuterEntries.lean b/LeanPool/Zeta5Irrational/Arith/OuterEntries.lean index 0dc14a0f50..9d36209ff0 100644 --- a/LeanPool/Zeta5Irrational/Arith/OuterEntries.lean +++ b/LeanPool/Zeta5Irrational/Arith/OuterEntries.lean @@ -28,7 +28,7 @@ import Mathlib.Tactic.Ring.Basic Helper lemmas (memberships, root counts, zero-class valuations). -/ -@[expose] public section +public section open Finset Polynomial @@ -37,6 +37,7 @@ namespace Zeta5Irrational variable {p : ℕ} [hp : Fact p.Prime] {m : ℕ} /-- The entry roots `6·[1..N] + rows`. -/ +@[expose] def entryO (hm : 2 * m + 1 = p) (n : ℕ) (cs : Fin (m + 1)) (is : ℕ) (ct : Fin (m + 1)) (it : ℕ) : Multiset ℤ := 6 • ((Icc 1 (3 * n)).val.map fun j : ℕ => (j : ℤ)) + rootsO hm n cs is + rootsO hm n ct it diff --git a/LeanPool/Zeta5Irrational/Arith/OuterEntry.lean b/LeanPool/Zeta5Irrational/Arith/OuterEntry.lean index de78a1982b..93e914a933 100644 --- a/LeanPool/Zeta5Irrational/Arith/OuterEntry.lean +++ b/LeanPool/Zeta5Irrational/Arith/OuterEntry.lean @@ -28,7 +28,7 @@ For a numerator `tpol M = ∏_{γ ∈ M} (t + γ²)`: * `PV_congr` : `poleValue (p - c) ≡ poleValue c (mod p)`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/OuterEntryMain.lean b/LeanPool/Zeta5Irrational/Arith/OuterEntryMain.lean index 552418b37d..c0693ce09f 100644 --- a/LeanPool/Zeta5Irrational/Arith/OuterEntryMain.lean +++ b/LeanPool/Zeta5Irrational/Arith/OuterEntryMain.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.Ring.Basic /-! # Outer range: the entry theorem -/ -@[expose] public section +public section open Finset Polynomial @@ -114,15 +114,15 @@ lemma pole_sum_cross {cs ct : Fin (m + 1)} (hc : cs ≠ ct) (is it : ℕ) : · right; left; exact h /-- `ℓ(c) = #{j ≤ K : j ≡ ±c}`. -/ -def ellC (c : Fin (m + 1)) : ℕ := +@[expose] def ellC (c : Fin (m + 1)) : ℕ := ((Icc 1 (40 * n)).filter fun j => jc hm j = c).card /-- `δ(c) = [c ≤ N]`. -/ -def delC (c : Fin (m + 1)) : ℕ := +@[expose] def delC (c : Fin (m + 1)) : ℕ := if (c : ℕ) ≤ 3 * n then 1 else 0 /-- The outer weights (4.12). -/ -noncomputable def wO (c : Fin (m + 1)) (i : ℕ) : ℚ := +@[expose] noncomputable def wO (c : Fin (m + 1)) (i : ℕ) : ℚ := if c = 0 then (if i < nbC hm n 0 then -2 else if nbC hm n 0 = 0 then -1 / 2 else 0) else (if i < nbC hm n c then min 0 ((i : ℚ) + 3 * delC n c - ((ellC hm n c : ℚ) + 4) / 2) else 0) diff --git a/LeanPool/Zeta5Irrational/Arith/OuterFrame.lean b/LeanPool/Zeta5Irrational/Arith/OuterFrame.lean index c3450fce6c..ddbd27945f 100644 --- a/LeanPool/Zeta5Irrational/Arith/OuterFrame.lean +++ b/LeanPool/Zeta5Irrational/Arith/OuterFrame.lean @@ -32,7 +32,7 @@ an integral product `U V`; with weights `w ≤ 0` for the integral part this giv `v_p^G(Δ) ≥ 2 ∑ w - r`. -/ -@[expose] public section +public section open Finset Polynomial @@ -41,7 +41,7 @@ namespace Zeta5Irrational variable {p : ℕ} [hp : Fact p.Prime] /-- The moments `e ≥ 2p - 3` of a polynomial. -/ -noncomputable def μGe (p : ℕ) (Q : ℚ[X]) : ℚ := +@[expose] noncomputable def μGe (p : ℕ) (Q : ℚ[X]) : ℚ := ∑ e ∈ range (Q.natDegree + 1), if 2 * p ≤ e + 3 then Q.coeff e * μmono e else 0 lemma μGe_eq (p : ℕ) (Q : ℚ[X]) {N : ℕ} (hN : Q.natDegree < N) : diff --git a/LeanPool/Zeta5Irrational/Arith/PoleFun.lean b/LeanPool/Zeta5Irrational/Arith/PoleFun.lean index 71089cba4d..f23dc03e28 100644 --- a/LeanPool/Zeta5Irrational/Arith/PoleFun.lean +++ b/LeanPool/Zeta5Irrational/Arith/PoleFun.lean @@ -24,14 +24,14 @@ For a numerator `A ∈ ℚ[x]` and a finite set `Pl ⊆ ℤ` of poles, `g = A / `partial_fractions` : `A = P Π + ∑_r res_r ∏_{s ≠ r} (x - s)`. -/ -@[expose] public section +public section open Finset Polynomial namespace Zeta5Irrational /-- `∏_{r ∈ Pl} (x - r)`. -/ -noncomputable def piPl (Pl : Finset ℤ) : ℚ[X] := +@[expose] noncomputable def piPl (Pl : Finset ℤ) : ℚ[X] := ∏ r ∈ Pl, (X - C (r : ℚ)) lemma piPl_monic (Pl : Finset ℤ) : (piPl Pl).Monic := @@ -44,19 +44,19 @@ lemma natDegree_piPl (Pl : Finset ℤ) : (piPl Pl).natDegree = Pl.card := by simp /-- The polynomial part. -/ -noncomputable def polyPart (A : ℚ[X]) (Pl : Finset ℤ) : ℚ[X] := +@[expose] noncomputable def polyPart (A : ℚ[X]) (Pl : Finset ℤ) : ℚ[X] := A /ₘ piPl Pl /-- The residue at `r`. -/ -noncomputable def resP (A : ℚ[X]) (Pl : Finset ℤ) (r : ℤ) : ℚ := +@[expose] noncomputable def resP (A : ℚ[X]) (Pl : Finset ℤ) (r : ℤ) : ℚ := A.eval (r : ℚ) / ∏ s ∈ Pl.erase r, ((r : ℚ) - s) /-- The harmonic index `d(r)`. -/ -def dd (r : ℤ) : ℕ := +@[expose] def dd (r : ℤ) : ℕ := if 0 ≤ r then r.toNat else (-r - 1).toNat /-- The functional `τ_X`. -/ -noncomputable def tauX (A : ℚ[X]) (Pl : Finset ℤ) : ℚ[X] := +@[expose] noncomputable def tauX (A : ℚ[X]) (Pl : Finset ℤ) : ℚ[X] := C (tau (polyPart A Pl)) + ∑ r ∈ Pl, C (resP A Pl r) * (C (H5 (dd r)) - X) lemma lagrange_basis_eq (Pl : Finset ℤ) (r : ℤ) : diff --git a/LeanPool/Zeta5Irrational/Arith/PoleVal.lean b/LeanPool/Zeta5Irrational/Arith/PoleVal.lean index 2960ec3cd4..c985f7d3d2 100644 --- a/LeanPool/Zeta5Irrational/Arith/PoleVal.lean +++ b/LeanPool/Zeta5Irrational/Arith/PoleVal.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.Ring.RingNF /-! # Valuations of the pole values `μ_X(1/(t + j²)) = j⁴(X - H⁽⁵⁾_j) - 1/4 + 1/(2j)` -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/Pullback.lean b/LeanPool/Zeta5Irrational/Arith/Pullback.lean index de20caca78..1cfd5d83d1 100644 --- a/LeanPool/Zeta5Irrational/Arith/Pullback.lean +++ b/LeanPool/Zeta5Irrational/Arith/Pullback.lean @@ -30,7 +30,7 @@ With `PlK K = {±1, …, ±K}` and `pull K P = (-1)^K x⁵ P(-x²)` we have `x⁵ P(-x²) / D_K(-x²) = pull K P / ∏_{r ∈ PlK K} (x - r)`. -/ -@[expose] public section +public section open Finset Polynomial @@ -98,7 +98,7 @@ lemma tau_cubic (a : ℚ) : tau (-X ^ 3 - C a * X) = -1 / 4 := by /-! ### The pole set `{±1, …, ±K}` -/ /-- The poles `±1, …, ±K` in the variable `x`. -/ -def PlK (K : ℕ) : Finset ℤ := +@[expose] def PlK (K : ℕ) : Finset ℤ := (Icc 1 K).image (fun j : ℕ => (j : ℤ)) ∪ (Icc 1 K).image (fun j : ℕ => -(j : ℤ)) lemma PlK_disjoint (K : ℕ) : @@ -139,7 +139,7 @@ lemma piPl_PlK (K : ℕ) : piPl (PlK K) = C ((-1 : ℚ) ^ K) * (D K).comp (-X ^ ring /-- `pull K P = (-1)^K x⁵ P(-x²)`. -/ -noncomputable def pull (K : ℕ) (P : ℚ[X]) : ℚ[X] := +@[expose] noncomputable def pull (K : ℕ) (P : ℚ[X]) : ℚ[X] := C ((-1 : ℚ) ^ K) * X ^ 5 * P.comp (-X ^ 2) lemma card_PlK (K : ℕ) : (PlK K).card = 2 * K := by diff --git a/LeanPool/Zeta5Irrational/Arith/SmallPrime.lean b/LeanPool/Zeta5Irrational/Arith/SmallPrime.lean index fc3ec824f2..209a4b92c9 100644 --- a/LeanPool/Zeta5Irrational/Arith/SmallPrime.lean +++ b/LeanPool/Zeta5Irrational/Arith/SmallPrime.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.Ring.Basic * `v_p(H^{(5)}_m) ≥ -5 log_p m`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/SmallPrimeF.lean b/LeanPool/Zeta5Irrational/Arith/SmallPrimeF.lean index 8fcdd11e03..d8d4e8ef6a 100644 --- a/LeanPool/Zeta5Irrational/Arith/SmallPrimeF.lean +++ b/LeanPool/Zeta5Irrational/Arith/SmallPrimeF.lean @@ -32,7 +32,7 @@ import Mathlib.Tactic.Ring.Basic basis `q_0 = 1`, `q_i(t) = (-1)^i 2t D_{i-1}(t)/(2i)!` with `q_i(-z²) = C(z+i, 2i) + C(z+i-1, 2i)`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/SmallPrimeRes.lean b/LeanPool/Zeta5Irrational/Arith/SmallPrimeRes.lean index 28fb192d3b..e0da40bcc1 100644 --- a/LeanPool/Zeta5Irrational/Arith/SmallPrimeRes.lean +++ b/LeanPool/Zeta5Irrational/Arith/SmallPrimeRes.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Ring.Basic `v_p((K!)² / ∏_{s ≠ r} (r - s)) ≥ -log_p (2K)`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/SmallPrimeTau.lean b/LeanPool/Zeta5Irrational/Arith/SmallPrimeTau.lean index 1bbc6a51ec..efcca53cb4 100644 --- a/LeanPool/Zeta5Irrational/Arith/SmallPrimeTau.lean +++ b/LeanPool/Zeta5Irrational/Arith/SmallPrimeTau.lean @@ -30,7 +30,7 @@ Instead of the paper's ball analysis we evaluate the polynomial part on the wind window lemma. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/TEntry.lean b/LeanPool/Zeta5Irrational/Arith/TEntry.lean index e852026dbc..ebea9c9f6f 100644 --- a/LeanPool/Zeta5Irrational/Arith/TEntry.lean +++ b/LeanPool/Zeta5Irrational/Arith/TEntry.lean @@ -18,14 +18,14 @@ For a multiset `M` of integers, `tpol M = ∏_{γ ∈ M} (t + γ²)`. Its pullba `μ_X(tpol M / D_K)`. -/ -@[expose] public section +public section open Finset Polynomial namespace Zeta5Irrational /-- `∏_{γ ∈ M} (t + γ²)`. -/ -noncomputable def tpol (M : Multiset ℤ) : ℚ[X] := +@[expose] noncomputable def tpol (M : Multiset ℤ) : ℚ[X] := (M.map fun γ : ℤ => X + C ((γ : ℚ) ^ 2)).prod lemma tpol_add (M M' : Multiset ℤ) : tpol (M + M') = tpol M * tpol M' := by diff --git a/LeanPool/Zeta5Irrational/Arith/TauBound.lean b/LeanPool/Zeta5Irrational/Arith/TauBound.lean index 37daf112a5..1ffccdaf1c 100644 --- a/LeanPool/Zeta5Irrational/Arith/TauBound.lean +++ b/LeanPool/Zeta5Irrational/Arith/TauBound.lean @@ -22,7 +22,7 @@ If `deg P ≤ d` and `v_p(P(m)) ≥ β` for `m = 0, …, d`, then `v_p(τ(P)) ≥ β - 4 ⌊log_p (d+1)⌋ - v_p(24)`. -/ -@[expose] public section +public section open Finset Polynomial @@ -31,11 +31,11 @@ namespace Zeta5Irrational variable {p : ℕ} [hp : Fact p.Prime] /-- `τ(P) = L(P''')/24`. -/ -noncomputable def tau (P : ℚ[X]) : ℚ := +@[expose] noncomputable def tau (P : ℚ[X]) : ℚ := Lb (derivative^[3] P) / 24 /-- `Q` is a combination of `bin 0, …, bin k` with coefficients of valuation `≥ r`. -/ -def BinRep (p : ℕ) (k : ℕ) (r : ℚ) (Q : ℚ[X]) : Prop := +@[expose] def BinRep (p : ℕ) (k : ℕ) (r : ℚ) (Q : ℚ[X]) : Prop := ∃ e : ℕ → ℚ, Q = ∑ m ∈ range (k + 1), C (e m) * bin m ∧ ∀ m ≤ k, VG p (e m) r lemma derivative_bin' {k m : ℕ} (hm : m ≤ k) : diff --git a/LeanPool/Zeta5Irrational/Arith/Unimodular.lean b/LeanPool/Zeta5Irrational/Arith/Unimodular.lean index e823b1352e..2997ef3132 100644 --- a/LeanPool/Zeta5Irrational/Arith/Unimodular.lean +++ b/LeanPool/Zeta5Irrational/Arith/Unimodular.lean @@ -23,7 +23,7 @@ where the `γ_c ∈ 𝔽_p` are distinct, `idx a < L (cls a)` and `(cls, idx)` i Then the coefficient matrix of the `E a` has a determinant prime to `p`. -/ -@[expose] public section +public section open Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Arith/Val.lean b/LeanPool/Zeta5Irrational/Arith/Val.lean index 746cdad444..fa1a2549fc 100644 --- a/LeanPool/Zeta5Irrational/Arith/Val.lean +++ b/LeanPool/Zeta5Irrational/Arith/Val.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Ring.Basic * `det_GV` : if `M i j` has Gauss valuation `≥ ρ i + κ j`, then `det M` has `≥ ∑ ρ + ∑ κ`. -/ -@[expose] public section +public section open Finset Polynomial @@ -31,7 +31,7 @@ namespace Zeta5Irrational variable {p : ℕ} /-- `v_p(q) ≥ r` (vacuous for `q = 0`). -/ -def VG (p : ℕ) (q : ℚ) (r : ℚ) : Prop := +@[expose] def VG (p : ℕ) (q : ℚ) (r : ℚ) : Prop := q = 0 ∨ r ≤ (padicValRat p q : ℚ) namespace VG @@ -150,7 +150,7 @@ lemma inv_nat [hp : Fact p.Prime] {j n : ℕ} (hj : 1 ≤ j) (hjn : j ≤ n) : end VG /-- Gauss valuation bound for polynomials in `X`. -/ -def GV (p : ℕ) (f : ℚ[X]) (r : ℚ) : Prop := +@[expose] def GV (p : ℕ) (f : ℚ[X]) (r : ℚ) : Prop := ∀ n, VG p (f.coeff n) r namespace GV diff --git a/LeanPool/Zeta5Irrational/Certificates.lean b/LeanPool/Zeta5Irrational/Certificates.lean index 9cc7b07cf8..b8861f4c81 100644 --- a/LeanPool/Zeta5Irrational/Certificates.lean +++ b/LeanPool/Zeta5Irrational/Certificates.lean @@ -27,7 +27,7 @@ Tools for the numerical verification of the potential inequality (6.2) (Lemma 6. * `sqrt_le_of_sq_le`, `le_sqrt_of_sq_le` : rational enclosures of square roots. -/ -@[expose] public section +public section open Finset Filter Topology diff --git a/LeanPool/Zeta5Irrational/CircleAtoms.lean b/LeanPool/Zeta5Irrational/CircleAtoms.lean index 1c5ab92118..19014fd35e 100644 --- a/LeanPool/Zeta5Irrational/CircleAtoms.lean +++ b/LeanPool/Zeta5Irrational/CircleAtoms.lean @@ -27,7 +27,7 @@ Consequences of Mathlib's circle-average identities, in the normalisation used h preimages under `circleMap` and `cos`. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology diff --git a/LeanPool/Zeta5Irrational/Constants.lean b/LeanPool/Zeta5Irrational/Constants.lean index fab114cad5..27a7ff0ab1 100644 --- a/LeanPool/Zeta5Irrational/Constants.lean +++ b/LeanPool/Zeta5Irrational/Constants.lean @@ -17,12 +17,12 @@ import Mathlib.Tactic.NormNum.Pow the identity (5.20) at `M = 200` and the margin (7.2), both checked by `norm_num`. -/ -@[expose] public section +public section namespace Zeta5Irrational /-- The constant `U` of Lemma 6.1 / (6.4). -/ -def U : ℚ := +@[expose] def U : ℚ := -2733991 / 2000000 /-- The constant `A*` of (5.19). -/ @@ -45,7 +45,7 @@ lemma margin : (139 : ℚ) / 5 < -1600 * (A200 + U) := by unfold A200 U; norm_nu /-- The normalisation constant proved here (`Zeta5Irrational.Growth`): `limsup K⁻² log m_K ≤ A_eff`. It is weaker than the paper's `A₂₀₀`, but still below `-U`. -/ -def Aeff : ℚ := +@[expose] def Aeff : ℚ := 136 / 100 /-- The margin used for irrationality: `A_eff + U < 0`. -/ diff --git a/LeanPool/Zeta5Irrational/Construction.lean b/LeanPool/Zeta5Irrational/Construction.lean index a35e56943a..62432650c7 100644 --- a/LeanPool/Zeta5Irrational/Construction.lean +++ b/LeanPool/Zeta5Irrational/Construction.lean @@ -31,59 +31,59 @@ Nothing is proved about these objects here; see `Zeta5Irrational.MainEstimate` f estimate. -/ -@[expose] public section +public section open Polynomial Finset namespace Zeta5Irrational /-- `D_m(t) = ∏_{j=1}^m (t + j²)`, a monic polynomial in `t`. -/ -noncomputable def D (m : ℕ) : ℚ[X] := +@[expose] noncomputable def D (m : ℕ) : ℚ[X] := ∏ j ∈ Icc 1 m, (X + C ((j : ℚ) ^ 2)) /-- The polynomial moments (2.2): `μ(t^e) = (-1)^e B_{2e+2} (2e+3)(2e+4)(2e+5) / 24`. Mathlib's `bernoulli` uses the convention `B₁ = -1/2`, as does the paper. -/ -def μmono (e : ℕ) : ℚ := +@[expose] def μmono (e : ℕ) : ℚ := (-1) ^ e * _root_.bernoulli (2 * e + 2) * ((2 * e + 3) * (2 * e + 4) * (2 * e + 5)) / 24 /-- `μ` on polynomials in `t`, extended `ℚ`-linearly from the monomials. -/ -noncomputable def μpoly (P : ℚ[X]) : ℚ := +@[expose] noncomputable def μpoly (P : ℚ[X]) : ℚ := P.sum fun e c => c * μmono e /-- The generalized harmonic number `H_j^{(5)} = ∑_{v=1}^j v⁻⁵`. -/ -def H5 (j : ℕ) : ℚ := +@[expose] def H5 (j : ℕ) : ℚ := ∑ v ∈ Icc 1 j, 1 / (v : ℚ) ^ 5 /-- The pole values (2.3), as polynomials in the indeterminate `X`: `μ_X(1/(t + j²)) = j⁴ (X - H_j^{(5)}) - 1/4 + 1/(2j)`. -/ -noncomputable def poleValue (j : ℕ) : ℚ[X] := +@[expose] noncomputable def poleValue (j : ℕ) : ℚ[X] := C ((j : ℚ) ^ 4) * (X - C (H5 j)) - C (1 / 4) + C (1 / (2 * (j : ℚ))) /-- `μ_X(P(t) / D_K(t))` for a polynomial `P` in `t`, as a polynomial in `X`. Since `D_K` is monic with the simple roots `t = -j²` (`1 ≤ j ≤ K`), `P / D_K = (P /ₘ D_K) + ∑_j (P(-j²) / D_K'(-j²)) / (t + j²)`, and `μ_X` is applied termwise. -/ -noncomputable def μX (K : ℕ) (P : ℚ[X]) : ℚ[X] := +@[expose] noncomputable def μX (K : ℕ) (P : ℚ[X]) : ℚ[X] := C (μpoly (P /ₘ D K)) + ∑ j ∈ Icc 1 K, C (P.eval (-(j : ℚ) ^ 2) / (derivative (D K)).eval (-(j : ℚ) ^ 2)) * poleValue j /-- The `h × h` Hankel matrix `G_K(X)` of (2.4), whose `(i, j)` entry is `μ_X (D_N(t)^6 t^(i+j) / D_K(t))`, with `K = 40 n`, `N = 3 n`, `h = 37 n`. -/ -noncomputable def G (n : ℕ) : Matrix (Fin (37 * n)) (Fin (37 * n)) ℚ[X] := fun i j => +@[expose] noncomputable def G (n : ℕ) : Matrix (Fin (37 * n)) (Fin (37 * n)) ℚ[X] := fun i j => μX (40 * n) (D (3 * n) ^ 6 * X ^ ((i : ℕ) + (j : ℕ))) /-- `Δ_K(X) = det G_K(X)`, a polynomial in `X` (of degree `h`, by (2.9)). -/ -noncomputable def Δ (n : ℕ) : ℚ[X] := +@[expose] noncomputable def Δ (n : ℕ) : ℚ[X] := (G n).det /-- The scalar `S_K` of (2.5). -/ -noncomputable def S (n : ℕ) : ℚ := +@[expose] noncomputable def S (n : ℕ) : ℚ := ((40 * n).factorial : ℚ) ^ (2 * (37 * n)) * 4 ^ (37 * n - 1) / (((3 * n).factorial : ℚ) ^ (12 * (37 * n)) * ∏ i ∈ Icc 1 (37 * n - 1), ((2 * i).factorial : ℚ) ^ 2) /-- `F_K = S_K Δ_K` of (2.5). -/ -noncomputable def F (n : ℕ) : ℚ[X] := +@[expose] noncomputable def F (n : ℕ) : ℚ[X] := C (S n) * Δ n end Zeta5Irrational diff --git a/LeanPool/Zeta5Irrational/Criterion.lean b/LeanPool/Zeta5Irrational/Criterion.lean index 4f1eb4a5fe..e72d8293f3 100644 --- a/LeanPool/Zeta5Irrational/Criterion.lean +++ b/LeanPool/Zeta5Irrational/Criterion.lean @@ -29,7 +29,7 @@ The point is that if `ξ = a / b` then `b ^ (d n) * Q(a / b)` is a positive inte least `1`, while it tends to zero. -/ -@[expose] public section +public section open Polynomial Filter Topology diff --git a/LeanPool/Zeta5Irrational/Degree.lean b/LeanPool/Zeta5Irrational/Degree.lean index aa31570384..4d88e433e9 100644 --- a/LeanPool/Zeta5Irrational/Degree.lean +++ b/LeanPool/Zeta5Irrational/Degree.lean @@ -28,7 +28,7 @@ determinant of the matrix of `X`-coefficients, which is `Vᵀ diag(w) V` for the matrix `V` of the nodes `-j²`, `N < j ≤ K`, with nonzero weights `w`. Hence `deg Δ_K = h`. -/ -@[expose] public section +public section open Polynomial Matrix Finset @@ -56,7 +56,7 @@ lemma coeff_det_of_natDegree_le_one {R : Type*} [CommRing R] {n : ℕ} _ = n := by simp /-- Residue coefficient at the pole `-j²` of `P / D K`, for `1 ≤ j ≤ K`. -/ -noncomputable def res (K : ℕ) (P : ℚ[X]) (j : ℕ) : ℚ := +@[expose] noncomputable def res (K : ℕ) (P : ℚ[X]) (j : ℕ) : ℚ := P.eval (-(j : ℚ) ^ 2) / (derivative (D K)).eval (-(j : ℚ) ^ 2) lemma poleValue_eq (j : ℕ) : diff --git a/LeanPool/Zeta5Irrational/DetIntegral.lean b/LeanPool/Zeta5Irrational/DetIntegral.lean index e6cc133638..0d57526a5d 100644 --- a/LeanPool/Zeta5Irrational/DetIntegral.lean +++ b/LeanPool/Zeta5Irrational/DetIntegral.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.Ring.Basic of `y₁², …, y_h²` and `ν(y) = D_N(y²)^6 / D_K(y²) · w(y)`. -/ -@[expose] public section +public section open MeasureTheory Set Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/Energy.lean b/LeanPool/Zeta5Irrational/Energy.lean index 66431c4370..fca31cae4c 100644 --- a/LeanPool/Zeta5Irrational/Energy.lean +++ b/LeanPool/Zeta5Irrational/Energy.lean @@ -31,14 +31,14 @@ import Mathlib.Tactic.Ring.RingNF `2 log(2K) + 2` in place of `2 log K + 2` in the upper error bound. -/ -@[expose] public section +public section open Filter Topology Set MeasureTheory Finset namespace Zeta5Irrational /-- The external field of (6.1). -/ -noncomputable def Vfield (t : ℝ) : ℝ := +@[expose] noncomputable def Vfield (t : ℝ) : ℝ := 2 * Real.pi * Real.sqrt t + (∫ u in (0 : ℝ)..1, Real.log (t + u ^ 2)) - 6 * ∫ u in (0 : ℝ)..(3 / 40), Real.log (t + u ^ 2) diff --git a/LeanPool/Zeta5Irrational/EnergyAtoms.lean b/LeanPool/Zeta5Irrational/EnergyAtoms.lean index 0787016cf4..c2fd9b80df 100644 --- a/LeanPool/Zeta5Irrational/EnergyAtoms.lean +++ b/LeanPool/Zeta5Irrational/EnergyAtoms.lean @@ -29,7 +29,7 @@ For a configuration `t : Fin h → ℝ` and a radius `ε > 0`, the atoms are the This file verifies the hypotheses of `energy_log_nonpos` for these atoms. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology @@ -46,11 +46,11 @@ lemma sum_Icc_eq_sum_range' (m : ℕ) (f : ℕ → ℝ) : rw [add_comm] /-- Midpoints and half-lengths of the intervals of Table 1. -/ -noncomputable def mρ (j : ℕ) : ℝ := +@[expose] noncomputable def mρ (j : ℕ) : ℝ := (aρ j + bρ j) / 2 /-- Half-width of the support of the `j`th arcsine component. -/ -noncomputable def rρ (j : ℕ) : ℝ := +@[expose] noncomputable def rρ (j : ℕ) : ℝ := (bρ j - aρ j) / 2 lemma rρ_pos (j : Fin 16) : 0 < rρ (j + 1) := by @@ -74,12 +74,12 @@ abbrev Idx (h : ℕ) := Fin h ⊕ Fin 16 /-- The weights. -/ -noncomputable def atomS (h : ℕ) (K : ℝ) : Idx h → ℝ +@[expose] noncomputable def atomS (h : ℕ) (K : ℝ) : Idx h → ℝ | Sum.inl _ => 1 / K | Sum.inr j => -cρ (j + 1) /-- The curves. -/ -noncomputable def atomγ {h : ℕ} (t : Fin h → ℝ) (ε : ℝ) : Idx h → ℝ → ℂ +@[expose] noncomputable def atomγ {h : ℕ} (t : Fin h → ℝ) (ε : ℝ) : Idx h → ℝ → ℂ | Sum.inl i => circleMap (t i) ε | Sum.inr j => arcCurve (mρ (j + 1)) (rρ (j + 1)) diff --git a/LeanPool/Zeta5Irrational/EnergyBlocks.lean b/LeanPool/Zeta5Irrational/EnergyBlocks.lean index 0541757aa3..9f9656af88 100644 --- a/LeanPool/Zeta5Irrational/EnergyBlocks.lean +++ b/LeanPool/Zeta5Irrational/EnergyBlocks.lean @@ -27,14 +27,14 @@ With `P k l = pairInt (atomγ t ε) (log ‖· - ·‖) k l`: * (D) `(2π)² log ((bⱼ' - aⱼ')/4) ≤ P (inr j) (inr j')`. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology namespace Zeta5Irrational /-- The pair integrals of the logarithmic kernel for the configuration atoms. -/ -noncomputable def Plog {h : ℕ} (t : Fin h → ℝ) (ε : ℝ) (k l : Idx h) : ℝ := +@[expose] noncomputable def Plog {h : ℕ} (t : Fin h → ℝ) (ε : ℝ) (k l : Idx h) : ℝ := pairInt (atomγ t ε) (fun z w => Real.log ‖z - w‖) k l lemma log_le_log_add_posLog {ε x : ℝ} (hε : 0 < ε) (hx : 0 < x) : @@ -117,7 +117,7 @@ lemma block_B {h : ℕ} (t : Fin h → ℝ) {ε : ℝ} (hε : 0 < ε) (i i' : Fi nlinarith [Real.pi_pos] /-- The regularisation error of the arcsine potential at a real point `t`. -/ -noncomputable def errj (ε t m r : ℝ) : ℝ := +@[expose] noncomputable def errj (ε t m r : ℝ) : ℝ := ε / r + Real.sqrt (ε / r * ((ε + 2 * |t - m|) / r)) lemma errj_nonneg {ε t m r : ℝ} (hε : 0 < ε) (hr : 0 < r) : 0 ≤ errj ε t m r := by diff --git a/LeanPool/Zeta5Irrational/EnergyBound.lean b/LeanPool/Zeta5Irrational/EnergyBound.lean index 2d368ea630..36cd1790c2 100644 --- a/LeanPool/Zeta5Irrational/EnergyBound.lean +++ b/LeanPool/Zeta5Irrational/EnergyBound.lean @@ -36,7 +36,7 @@ import Mathlib.Tactic.Ring.Basic * everything else: the pointwise bound for the integrand of (6.10) and its integration. -/ -@[expose] public section +public section open Filter Topology Set MeasureTheory Finset Polynomial diff --git a/LeanPool/Zeta5Irrational/EnergyConst.lean b/LeanPool/Zeta5Irrational/EnergyConst.lean index 0484b2917b..3dc7e1c1c6 100644 --- a/LeanPool/Zeta5Irrational/EnergyConst.lean +++ b/LeanPool/Zeta5Irrational/EnergyConst.lean @@ -28,7 +28,7 @@ reduction `log y = log (2^k y) - k log 2`. The certificates (`k`, partial sums w rounded down) were generated by exact rational arithmetic; `norm_num` checks each one. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/EnergyFinal.lean b/LeanPool/Zeta5Irrational/EnergyFinal.lean index 333219f6d3..b11f4b39de 100644 --- a/LeanPool/Zeta5Irrational/EnergyFinal.lean +++ b/LeanPool/Zeta5Irrational/EnergyFinal.lean @@ -34,7 +34,7 @@ The paper uses `(120 + √2)h + 2h log K` for the lower-order terms and `ε = K Here the different regularisation estimate and `ε = K⁻⁶` give `5h + 6h log K`. -/ -@[expose] public section +public section open MeasureTheory Set Real Filter Topology Finset diff --git a/LeanPool/Zeta5Irrational/EnergyLimit.lean b/LeanPool/Zeta5Irrational/EnergyLimit.lean index a6a7a9750d..f4306b264f 100644 --- a/LeanPool/Zeta5Irrational/EnergyLimit.lean +++ b/LeanPool/Zeta5Irrational/EnergyLimit.lean @@ -21,7 +21,7 @@ The hypotheses are integrability of `log ‖γ k θ - γ l φ‖` on the torus a distinctness `γ k θ ≠ γ l φ`. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology diff --git a/LeanPool/Zeta5Irrational/EnergyRaw.lean b/LeanPool/Zeta5Irrational/EnergyRaw.lean index 49cb00dce5..ccc5d62315 100644 --- a/LeanPool/Zeta5Irrational/EnergyRaw.lean +++ b/LeanPool/Zeta5Irrational/EnergyRaw.lean @@ -25,14 +25,14 @@ Combining `atom_energy_nonpos` with the four block estimates gives, for every co (`energy_raw`), where the diagonal terms are `log 0 = 0`. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology Finset namespace Zeta5Irrational /-- The total regularisation error at a point. -/ -noncomputable def Err (ε t : ℝ) : ℝ := +@[expose] noncomputable def Err (ε t : ℝ) : ℝ := ∑ j : Fin 16, cρ (j + 1) * errj ε t (mρ (j + 1)) (rρ (j + 1)) /-- diff --git a/LeanPool/Zeta5Irrational/Gaussian.lean b/LeanPool/Zeta5Irrational/Gaussian.lean index 1046a5770f..7e9e291f22 100644 --- a/LeanPool/Zeta5Irrational/Gaussian.lean +++ b/LeanPool/Zeta5Irrational/Gaussian.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Ring.Basic * `intervalIntegral_swap_of_continuous` : Fubini for interval integrals of continuous functions. -/ -@[expose] public section +public section open MeasureTheory Set Real diff --git a/LeanPool/Zeta5Irrational/Growth.lean b/LeanPool/Zeta5Irrational/Growth.lean index 27e01f8508..42d4f24999 100644 --- a/LeanPool/Zeta5Irrational/Growth.lean +++ b/LeanPool/Zeta5Irrational/Growth.lean @@ -32,7 +32,7 @@ the prime number theorem; total `≈ 1.3480 K² + o(K²)`. -/ -@[expose] public section +public section open Filter Finset diff --git a/LeanPool/Zeta5Irrational/Growth/Assembly1.lean b/LeanPool/Zeta5Irrational/Growth/Assembly1.lean index b5130e1a38..934b411bef 100644 --- a/LeanPool/Zeta5Irrational/Growth/Assembly1.lean +++ b/LeanPool/Zeta5Irrational/Growth/Assembly1.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Ring.Basic /-! # Growth: decomposition of `log m_K` and the small primes -/ -@[expose] public section +public section open Finset Filter diff --git a/LeanPool/Zeta5Irrational/Growth/Assembly2.lean b/LeanPool/Zeta5Irrational/Growth/Assembly2.lean index 6685482501..e5bc9aee23 100644 --- a/LeanPool/Zeta5Irrational/Growth/Assembly2.lean +++ b/LeanPool/Zeta5Irrational/Growth/Assembly2.lean @@ -22,7 +22,7 @@ import Mathlib.Algebra.Order.Floor.Semifield /-! # Growth: the three prime ranges `K/400 < p ≤ K/20`, `K/20 < p ≤ K/3`, `K/3 < p ≤ 2h` -/ -@[expose] public section +public section open Finset Filter diff --git a/LeanPool/Zeta5Irrational/Growth/Assembly3.lean b/LeanPool/Zeta5Irrational/Growth/Assembly3.lean index bacfb775b8..6db96ab797 100644 --- a/LeanPool/Zeta5Irrational/Growth/Assembly3.lean +++ b/LeanPool/Zeta5Irrational/Growth/Assembly3.lean @@ -24,7 +24,7 @@ import Mathlib.Tactic.Ring.Basic /-! # Growth: the per-range sums as prime sums -/ -@[expose] public section +public section open Finset Filter @@ -102,7 +102,7 @@ lemma range2_le {n : ℕ} (hn : 10400 ≤ n) : linarith /-- The inner table as a function. -/ -noncomputable def fIn (x : ℝ) : ℝ := +@[expose] noncomputable def fIn (x : ℝ) : ℝ := gIn (pieceIdx tIn 125 x) x lemma tIn_zero : tIn 0 = 3 := by simp [tIn, tInL] diff --git a/LeanPool/Zeta5Irrational/Growth/Assembly4.lean b/LeanPool/Zeta5Irrational/Growth/Assembly4.lean index 2bdd813b1c..1709866ddd 100644 --- a/LeanPool/Zeta5Irrational/Growth/Assembly4.lean +++ b/LeanPool/Zeta5Irrational/Growth/Assembly4.lean @@ -23,7 +23,7 @@ import Mathlib.Tactic.Ring.Basic /-! # Growth: the limits of the three prime sums -/ -@[expose] public section +public section open Finset Filter diff --git a/LeanPool/Zeta5Irrational/Growth/ClassData.lean b/LeanPool/Zeta5Irrational/Growth/ClassData.lean index 44fc2a75e8..e31712b544 100644 --- a/LeanPool/Zeta5Irrational/Growth/ClassData.lean +++ b/LeanPool/Zeta5Irrational/Growth/ClassData.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Ring.Basic * `-v_p(S_K) ≤ -2h⌊K/p⌋ + 12h⌊N/p⌋ + 2 ∑_{j ≥ 1} (h - jp/2)⁺` when `p² > max(2h, N)`, `p` odd. -/ -@[expose] public section +public section open Finset @@ -108,7 +108,7 @@ lemma padicValNat_factorial_small {k : ℕ} (hk : k < p ^ 2) : padicValNat p k.f · exact Nat.log_lt_of_lt_pow h0.ne' hk /-- The layer-cake function `T(t) = ∑_{j ≤ J} (t - j p/2)⁺`. -/ -noncomputable def layer (p J : ℕ) (t : ℝ) : ℝ := +@[expose] noncomputable def layer (p J : ℕ) (t : ℝ) : ℝ := ∑ j ∈ Icc 1 J, max 0 (t - j * p / 2) lemma layer_step (J : ℕ) (i : ℕ) (hJ : 2 * i / p ≤ J) : diff --git a/LeanPool/Zeta5Irrational/Growth/ClassSum.lean b/LeanPool/Zeta5Irrational/Growth/ClassSum.lean index 454b5c8437..8484c07574 100644 --- a/LeanPool/Zeta5Irrational/Growth/ClassSum.lean +++ b/LeanPool/Zeta5Irrational/Growth/ClassSum.lean @@ -31,7 +31,7 @@ nine interval counts. Each count is within `5/2` of `p` times its continuous ana We also prove `SX p X c = 2 ⌊X/p⌋ + a_c(X mod p)`. -/ -@[expose] public section +public section open Finset @@ -46,19 +46,19 @@ def ivHi (m v : ℕ) : Fin 3 → ℕ := ![m, v, m] /-- The continuous intervals. -/ -noncomputable def cvLo (f : ℝ) : Fin 3 → ℝ := +@[expose] noncomputable def cvLo (f : ℝ) : Fin 3 → ℝ := ![0, 0, 1 - f] /-- Upper endpoints of the continuous intervals corresponding to `ivHi`. -/ -noncomputable def cvHi (f : ℝ) : Fin 3 → ℝ := +@[expose] noncomputable def cvHi (f : ℝ) : Fin 3 → ℝ := ![1 / 2, f, 1 / 2] /-- The coefficients of `h` in the basis `1, A, E`. -/ -def bcoef (h : ℕ → ℝ) : Fin 3 → ℝ := +@[expose] def bcoef (h : ℕ → ℝ) : Fin 3 → ℝ := ![h 0, h 1 - h 0, h 2 - h 1] /-- `a(c) = [c ≤ v] + [p - v ≤ c]`. -/ -def aCnt (p v c : ℕ) : ℕ := +@[expose] def aCnt (p v c : ℕ) : ℕ := (if c ≤ v then 1 else 0) + (if p - v ≤ c then 1 else 0) /-- The interval indicator. -/ @@ -125,7 +125,7 @@ theorem class_sum {p m v v' : ℕ} (hm : 2 * m + 1 = p) (hv : v < p) (hv' : v' < split_ifs <;> simp_all /-- The continuous analogue of an interval count. -/ -noncomputable def ccount (f g : ℝ) (i j : Fin 3) : ℝ := +@[expose] noncomputable def ccount (f g : ℝ) (i j : Fin 3) : ℝ := max 0 (min (min (cvHi f i) (cvHi g j)) (1 / 2) - max (max (cvLo f i) (cvLo g j)) 0) lemma cast_trunc_sub (a b : ℕ) : ((a - b : ℕ) : ℝ) = max 0 ((a : ℝ) - b) := by diff --git a/LeanPool/Zeta5Irrational/Growth/Constants.lean b/LeanPool/Zeta5Irrational/Growth/Constants.lean index 588a3173ae..33fadca9e9 100644 --- a/LeanPool/Zeta5Irrational/Growth/Constants.lean +++ b/LeanPool/Zeta5Irrational/Growth/Constants.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Ring.Basic /-! # Uniform bounds for the additive constants of the per-prime bounds -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Growth/InnerPrime.lean b/LeanPool/Zeta5Irrational/Growth/InnerPrime.lean index 8fc01213cf..8eff17cec5 100644 --- a/LeanPool/Zeta5Irrational/Growth/InnerPrime.lean +++ b/LeanPool/Zeta5Irrational/Growth/InnerPrime.lean @@ -28,7 +28,7 @@ with `q = ⌊K/p⌋`, `q' = ⌊N/p⌋`, `B = 12q' - 2q - 4`, the class counts `a `ClassSum`, and the layer-cake function `T`. -/ -@[expose] public section +public section open Finset @@ -84,7 +84,7 @@ lemma neg_vSK_le {n : ℕ} (hn : 1 ≤ n) (_hp3 : 3 ≤ p) (hN : 3 * n < p ^ 2) mul_nonneg (show (0 : ℝ) ≤ 37 * n - 1 by linarith) hB] /-- The zero-class deficit bound. -/ -noncomputable def Bmax (n p : ℕ) : ℝ := +@[expose] noncomputable def Bmax (n p : ℕ) : ℝ := max 0 ((ktopI n p : ℝ) / 2 - ((5 + 12 * ((3 * n / p : ℕ) : ℝ) - 2 * ((40 * n / p : ℕ) : ℝ)) - 4) / 2) * @@ -95,7 +95,7 @@ noncomputable def Bmax (n p : ℕ) : ℝ := 1) /-- The class function of the inner range. -/ -noncomputable def hIn (n p : ℕ) (k : ℤ) (a a' : ℕ) : ℝ := +@[expose] noncomputable def hIn (n p : ℕ) (k : ℤ) (a a' : ℕ) : ℝ := (psiR k (12 * ((3 * n / p : ℕ) : ℤ) - 2 * ((40 * n / p : ℕ) : ℤ) - 4 + 6 * (a' : ℤ) - a) : ℝ) section diff --git a/LeanPool/Zeta5Irrational/Growth/InnerSum.lean b/LeanPool/Zeta5Irrational/Growth/InnerSum.lean index de90a84b39..4bcd48b9df 100644 --- a/LeanPool/Zeta5Irrational/Growth/InnerSum.lean +++ b/LeanPool/Zeta5Irrational/Growth/InnerSum.lean @@ -18,12 +18,12 @@ import Mathlib.Tactic.NormNum.Pow /-!Generated by `gen_inner_sum.py`: the table of `Ê_in` on `[3, 20]`. -/ -@[expose] public section +public section namespace Zeta5Irrational /-- The 126 rational endpoints of the 125 inner-range linear pieces. -/ -def tInL : List ℚ := +@[expose] def tInL : List ℚ := [(3), (70 / 23), (120 / 37), (10 / 3), (80 / 23), (7 / 2), (160 / 43), (140 / 37), (90 / 23), (4), (160 / 37), (100 / 23), (9 / 2), (200 / 43), (110 / 23), (180 / 37), (5), (120 / 23), (200 / 37), (11 / 2), (240 / 43), (130 / 23), (220 / 37), (6), (140 / 23), (240 / 37), @@ -51,7 +51,7 @@ def kInL : List ℤ := 45, 45, 45, 46] /-- Rational slopes of the 125 inner-range linear pieces. -/ -def aInL : List ℚ := +@[expose] def aInL : List ℚ := [(18 / 5), (49 / 20), (283 / 40), (277 / 40), (231 / 40), (271 / 40), (71 / 20), (27 / 5), (17 / 4), (17 / 5), (321 / 40), (55 / 8), (63 / 8), (93 / 20), (7 / 2), (107 / 20), (9 / 2), (67 / 20), (319 / 40), (359 / 40), (23 / 4), (23 / 5), (129 / 20), (28 / 5), (89 / 20), @@ -85,7 +85,7 @@ def bInL : List ℚ := (-687 / 2), (-322), (-357), (-376), (-354), (-444), (-927 / 2), (-801 / 2), (-378)] /-- The `i`th inner-range endpoint as a real number; zero outside the table. -/ -noncomputable def tIn (i : ℕ) : ℝ := +@[expose] noncomputable def tIn (i : ℕ) : ℝ := ((tInL.getD i 0 : ℚ) : ℝ) /-- The allocation level for inner piece `i`; zero outside the table. -/ @@ -93,7 +93,7 @@ def kIn (i : ℕ) : ℤ := kInL.getD i 0 /-- The affine bound on inner piece `i`, with coefficients from `aInL` and `bInL`. -/ -noncomputable def gIn (i : ℕ) (x : ℝ) : ℝ := +@[expose] noncomputable def gIn (i : ℕ) (x : ℝ) : ℝ := ((aInL.getD i 0 : ℚ) : ℝ) * x + ((bInL.getD i 0 : ℚ) : ℝ) theorem tIn_mono : ∀ i < 125, tIn i < tIn (i + 1) := by diff --git a/LeanPool/Zeta5Irrational/Growth/InnerTable.lean b/LeanPool/Zeta5Irrational/Growth/InnerTable.lean index 973705cd6e..9a425f1637 100644 --- a/LeanPool/Zeta5Irrational/Growth/InnerTable.lean +++ b/LeanPool/Zeta5Irrational/Growth/InnerTable.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.Ring.Basic /-!Generated by `gen_lean_inner.py`: the pieces of `Ê_in` on `[3, 20]`. -/ -@[expose] public section +public section namespace Zeta5Irrational diff --git a/LeanPool/Zeta5Irrational/Growth/OuterPrime.lean b/LeanPool/Zeta5Irrational/Growth/OuterPrime.lean index c170d300b5..11f1e52150 100644 --- a/LeanPool/Zeta5Irrational/Growth/OuterPrime.lean +++ b/LeanPool/Zeta5Irrational/Growth/OuterPrime.lean @@ -26,7 +26,7 @@ import Mathlib.Algebra.Order.Floor.Semifield For a nonzero class `c`, the number of class members in `(X, Y]` is `SX p Y c - SX p X c`. -/ -@[expose] public section +public section open Finset @@ -93,7 +93,7 @@ lemma card_class_Ioc (hm : 2 * m + 1 = p) {c : Fin (m + 1)} (hc : c ≠ 0) {X Y omega /-- The per-class outer weight sum `G_q(a, δ)`. -/ -noncomputable def GO (q a d : ℕ) : ℚ := +@[expose] noncomputable def GO (q a d : ℕ) : ℚ := ∑ i ∈ range (2 * q + a - 2), min 0 ((i : ℚ) + 3 * d - ((2 * q + a : ℕ) + 4 : ℚ) / 2) section @@ -197,17 +197,17 @@ lemma sum_wO_zero : -4 ≤ ∑ i ∈ range (LoC hm n 0), wO hm n 0 i := by end /-- The class-function coefficients of the outer range. -/ -noncomputable def bGO (q : ℕ) (i j : Fin 3) : ℝ := +@[expose] noncomputable def bGO (q : ℕ) (i j : Fin 3) : ℝ := bcoef (fun a => bcoef (fun b => (GO q a b : ℝ)) j) i /-- **The continuous outer function** (in the variable `x = K/p`). -/ -noncomputable def Eout (x : ℝ) : ℝ := +@[expose] noncomputable def Eout (x : ℝ) : ℝ := -2 * (37 / 40 * x) * (⌊x⌋₊ : ℝ) + 2 * Jc (37 / 40 * x) - 2 * ∑ i, ∑ j, bGO ⌊x⌋₊ i j * ccount (Int.fract x) (Int.fract (3 / 40 * x)) i j + max 0 (13 / 10 * x - 2) /-- The additive error of the outer bound. -/ -noncomputable def Cout (n p : ℕ) : ℝ := +@[expose] noncomputable def Cout (n p : ℕ) : ℝ := 5 * ∑ i, ∑ j, |bGO (40 * n / p) i j| + 11 section diff --git a/LeanPool/Zeta5Irrational/Growth/OuterTable.lean b/LeanPool/Zeta5Irrational/Growth/OuterTable.lean index 4dfb67f95a..979091fa7f 100644 --- a/LeanPool/Zeta5Irrational/Growth/OuterTable.lean +++ b/LeanPool/Zeta5Irrational/Growth/OuterTable.lean @@ -20,7 +20,7 @@ import Mathlib.Tactic.Ring.RingNF /-!Generated by `gen_lean_outer.py`: the table of `Ê_out` on `[20/37, 3]`. -/ -@[expose] public section +public section namespace Zeta5Irrational @@ -885,12 +885,12 @@ theorem outPiece_12 (x : ℝ) (h1 : ((120) / 43 : ℝ) ≤ x) (h2 : x < (3 : ℝ ring_nf /-- The 14 rational endpoints of the 13 outer-range linear pieces. -/ -def tOutL : List ℚ := +@[expose] def tOutL : List ℚ := [(20 / 37), (40 / 43), (1), (40 / 37), (3 / 2), (20 / 13), (60 / 37), (80 / 43), (2), (80 / 37), (5 / 2), (100 / 37), (120 / 43), (3)] /-- Rational slopes of the 13 outer-range linear pieces. -/ -def aOutL : List ℚ := +@[expose] def aOutL : List ℚ := [(37 / 20), (37 / 20), (1), (42 / 5), (42 / 5), (97 / 10), (231 / 20), (51 / 10), (17 / 4), (429 / 40), (429 / 40), (503 / 40), (36 / 5)] @@ -899,11 +899,11 @@ def bOutL : List ℚ := [(-1), (-1), (-2), (-10), (-10), (-12), (-15), (-3), (-5), (-19), (-19), (-24), (-9)] /-- The `i`th outer-range endpoint as a real number; zero outside the table. -/ -noncomputable def tOut (i : ℕ) : ℝ := +@[expose] noncomputable def tOut (i : ℕ) : ℝ := ((tOutL.getD i 0 : ℚ) : ℝ) /-- The affine bound on outer piece `i`, with coefficients from `aOutL` and `bOutL`. -/ -noncomputable def gOut (i : ℕ) (x : ℝ) : ℝ := +@[expose] noncomputable def gOut (i : ℕ) (x : ℝ) : ℝ := ((aOutL.getD i 0 : ℚ) : ℝ) * x + ((bOutL.getD i 0 : ℚ) : ℝ) theorem tOut_mono : ∀ i < 13, tOut i < tOut (i + 1) := by diff --git a/LeanPool/Zeta5Irrational/Growth/PieceIdx.lean b/LeanPool/Zeta5Irrational/Growth/PieceIdx.lean index 7356f741b5..14f0868b39 100644 --- a/LeanPool/Zeta5Irrational/Growth/PieceIdx.lean +++ b/LeanPool/Zeta5Irrational/Growth/PieceIdx.lean @@ -15,7 +15,7 @@ For a strictly increasing grid `t 0 < t 1 < … < t m`, `pieceIdx t m x` is the `[t i, t (i+1))` containing `x ∈ [t 0, t m)`. -/ -@[expose] public section +public section namespace Zeta5Irrational diff --git a/LeanPool/Zeta5Irrational/Growth/TableGen.lean b/LeanPool/Zeta5Irrational/Growth/TableGen.lean index 27f2753ce0..29ad29c607 100644 --- a/LeanPool/Zeta5Irrational/Growth/TableGen.lean +++ b/LeanPool/Zeta5Irrational/Growth/TableGen.lean @@ -18,7 +18,7 @@ On a piece where `⌊x⌋`, `⌊αx⌋`, `⌊2λx⌋` are constant, `Ê_in(x, k) combinations of the interval counts `c_{ij}({x}, {αx})`; the counts have closed forms. -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Growth/TableIntegrals.lean b/LeanPool/Zeta5Irrational/Growth/TableIntegrals.lean index 7418d13270..98993f65ed 100644 --- a/LeanPool/Zeta5Irrational/Growth/TableIntegrals.lean +++ b/LeanPool/Zeta5Irrational/Growth/TableIntegrals.lean @@ -25,7 +25,7 @@ import Mathlib.Tactic.Ring.Basic `127751/96000 + 9/640` for the outer table. -/ -@[expose] public section +public section open Finset intervalIntegral diff --git a/LeanPool/Zeta5Irrational/Growth/TablePrime.lean b/LeanPool/Zeta5Irrational/Growth/TablePrime.lean index 4d37eb850c..5f23d302a2 100644 --- a/LeanPool/Zeta5Irrational/Growth/TablePrime.lean +++ b/LeanPool/Zeta5Irrational/Growth/TablePrime.lean @@ -21,27 +21,27 @@ with `u = λx`, the coefficients `b_{ij}` of the class function `ψ(k, B + 6a' - `1, A, E`, and the continuous interval counts `c_{ij}`. -/ -@[expose] public section +public section open Finset namespace Zeta5Irrational /-- The class-function coefficients. -/ -noncomputable def bIn (q q' : ℕ) (k : ℤ) (i j : Fin 3) : ℝ := +@[expose] noncomputable def bIn (q q' : ℕ) (k : ℤ) (i j : Fin 3) : ℝ := bcoef (fun a => bcoef (fun b => (psiR k (12 * (q' : ℤ) - 2 * (q : ℤ) - 4 + 6 * (b : ℤ) - a) : ℝ)) j) i /-- **The continuous inner function.** -/ -noncomputable def Ein (x : ℝ) (k : ℤ) : ℝ := +@[expose] noncomputable def Ein (x : ℝ) (k : ℤ) : ℝ := -2 * (37 / 40 * x) * (⌊x⌋₊ : ℝ) + 12 * (37 / 40 * x) * (⌊3 / 40 * x⌋₊ : ℝ) + 2 * Jc (37 / 40 * x) - 37 / 40 * x * k + 2 * ∑ i, ∑ j, bIn ⌊x⌋₊ ⌊3 / 40 * x⌋₊ k i j * ccount (Int.fract x) (Int.fract (3 / 40 * x)) i j /-- The additive error of the table bound. -/ -noncomputable def Ctab (n p : ℕ) (k : ℤ) : ℝ := +@[expose] noncomputable def Ctab (n p : ℕ) (k : ℤ) : ℝ := 5 * ∑ i, ∑ j, |bIn (40 * n / p) (3 * n / p) k i j| + ((ktopI n p - kloI n p : ℤ) : ℝ) * (L0I n p : ℝ) + 2 * Bmax n p + diff --git a/LeanPool/Zeta5Irrational/Growth/TailIntegral.lean b/LeanPool/Zeta5Irrational/Growth/TailIntegral.lean index ee13f5e198..cfc432723a 100644 --- a/LeanPool/Zeta5Irrational/Growth/TailIntegral.lean +++ b/LeanPool/Zeta5Irrational/Growth/TailIntegral.lean @@ -35,30 +35,30 @@ continuous across the breakpoints. Two integrations by parts on each piece and t `∑_i ∫_{t_i}^{t_{i+1}} (x F + 27/16)/x³ ≤ tailBound`. -/ -@[expose] public section +public section open Finset intervalIntegral namespace Zeta5Irrational /-- The grid. -/ -noncomputable def tT (i : ℕ) : ℝ := +@[expose] noncomputable def tT (i : ℕ) : ℝ := 20 + i / 3 /-- Integer part of the left endpoint `tT i` of a tail interval. -/ -def qT (i : ℕ) : ℕ := +@[expose] def qT (i : ℕ) : ℕ := (60 + i) / 3 /-- Integer part of `3 / 40 * tT i`, used to fix the second fractional part. -/ -def qT' (i : ℕ) : ℕ := +@[expose] def qT' (i : ℕ) : ℕ := (60 + i) / 40 /-- `F` on the piece `i`. -/ -noncomputable def FT (i : ℕ) (x : ℝ) : ℝ := +@[expose] noncomputable def FT (i : ℕ) (x : ℝ) : ℝ := 37 / 10 + 37 / 20 * (x - qT i) - 111 / 10 * (3 / 40 * x - qT' i) /-- The tail majorant on piece `i`, including the additive error `27 / 16`. -/ -noncomputable def gT (i : ℕ) (x : ℝ) : ℝ := +@[expose] noncomputable def gT (i : ℕ) (x : ℝ) : ℝ := x * FT i x + 27 / 16 /-- The quadratic oscillation contributed by the two fractional parts on tail piece `i`. -/ diff --git a/LeanPool/Zeta5Irrational/Growth/TailPrime.lean b/LeanPool/Zeta5Irrational/Growth/TailPrime.lean index 634fa654b4..e01204561f 100644 --- a/LeanPool/Zeta5Irrational/Growth/TailPrime.lean +++ b/LeanPool/Zeta5Irrational/Growth/TailPrime.lean @@ -25,7 +25,7 @@ For an explicit level `k` (the rounded minimiser of the quadratic majorant) the `F(x) = 4λ + 2λ{x} - 12λ{αx}`, `λ = 37/40`, `α = 3/40`, `x = K/p`. -/ -@[expose] public section +public section open Finset @@ -250,11 +250,11 @@ lemma diff_le {hR SR p : ℝ} (hp : 1 < p) (hh0 : 0 ≤ hR) (hhS : 0 ≤ hR + SR · positivity /-- `F(x) = 4λ + 2λ{x} - 12λ{αx}`. -/ -noncomputable def Ftail (x : ℝ) : ℝ := +@[expose] noncomputable def Ftail (x : ℝ) : ℝ := 4 * (37 / 40) + 2 * (37 / 40) * Int.fract x - 12 * (37 / 40) * Int.fract (3 / 40 * x) /-- The additive error of the tail bound. -/ -noncomputable def Ctail (n p : ℕ) : ℝ := +@[expose] noncomputable def Ctail (n p : ℕ) : ℝ := 4 * (37 * n : ℝ) / p + ((ktopI n p - kloI n p : ℤ) : ℝ) * (L0I n p : ℝ) + 2 * Bmax n p + 1 /-- Sum the quadratic class bound using the seven-unit range of the counts. -/ diff --git a/LeanPool/Zeta5Irrational/Hermite.lean b/LeanPool/Zeta5Irrational/Hermite.lean index 90b02f0088..62c0cfe7e9 100644 --- a/LeanPool/Zeta5Irrational/Hermite.lean +++ b/LeanPool/Zeta5Irrational/Hermite.lean @@ -39,7 +39,7 @@ import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals * `g(y) = y⁵ / (12 (y² + a²))` and its derivatives `g₁, …, g₄`. -/ -@[expose] public section +public section open Filter Topology Finset @@ -121,7 +121,7 @@ lemma hasSum_pow_four_mul_geometric {x : ℝ} (hx0 : 0 ≤ x) (hx1 : x < 1) : /-! ### `F(y) = 1 / (e^{2πy} - 1)` and its derivatives -/ /-- `q(y) = e^{2πy}`. -/ -noncomputable def qe (y : ℝ) : ℝ := +@[expose] noncomputable def qe (y : ℝ) : ℝ := Real.exp (2 * Real.pi * y) lemma qe_pos (y : ℝ) : 0 < qe y := @@ -141,23 +141,23 @@ lemma hasDerivAt_qe (y : ℝ) : HasDerivAt qe (2 * Real.pi * qe y) y := by ring /-- `F(y) = 1 / (e^{2πy} - 1)` and its first four derivatives. -/ -noncomputable def F0 (y : ℝ) : ℝ := +@[expose] noncomputable def F0 (y : ℝ) : ℝ := 1 / (qe y - 1) /-- Expression for the first derivative of `F0` on the positive half-line. -/ -noncomputable def F1 (y : ℝ) : ℝ := +@[expose] noncomputable def F1 (y : ℝ) : ℝ := -(2 * Real.pi) * qe y / (qe y - 1) ^ 2 /-- Expression for the second derivative of `F0` on the positive half-line. -/ -noncomputable def F2 (y : ℝ) : ℝ := +@[expose] noncomputable def F2 (y : ℝ) : ℝ := (2 * Real.pi) ^ 2 * qe y * (qe y + 1) / (qe y - 1) ^ 3 /-- Expression for the third derivative of `F0` on the positive half-line. -/ -noncomputable def F3 (y : ℝ) : ℝ := +@[expose] noncomputable def F3 (y : ℝ) : ℝ := -(2 * Real.pi) ^ 3 * qe y * (qe y ^ 2 + 4 * qe y + 1) / (qe y - 1) ^ 4 /-- Expression for the fourth derivative of `F0` on the positive half-line. -/ -noncomputable def F4 (y : ℝ) : ℝ := +@[expose] noncomputable def F4 (y : ℝ) : ℝ := (2 * Real.pi) ^ 4 * qe y * (qe y ^ 3 + 11 * qe y ^ 2 + 11 * qe y + 1) / (qe y - 1) ^ 5 lemma hasDerivAt_F0 {y : ℝ} (hy : 0 < y) : HasDerivAt F0 (F1 y) y := by @@ -246,23 +246,23 @@ lemma w_eq_F4 {y : ℝ} (hy : 0 < y) : w y = y ^ 5 * F4 y / 12 := by /-! ### `g(y) = y⁵ / (12 (y² + a²))` and its derivatives -/ /-- Rational factor paired with `F4` in the Hermite integral formula. -/ -noncomputable def g0 (a y : ℝ) : ℝ := +@[expose] noncomputable def g0 (a y : ℝ) : ℝ := y ^ 5 / (12 * (y ^ 2 + a ^ 2)) /-- First derivative of the rational factor `g0 a`, for positive `a`. -/ -noncomputable def g1 (a y : ℝ) : ℝ := +@[expose] noncomputable def g1 (a y : ℝ) : ℝ := y ^ 4 * (5 * a ^ 2 + 3 * y ^ 2) / (12 * (y ^ 2 + a ^ 2) ^ 2) /-- Second derivative of the rational factor `g0 a`, for positive `a`. -/ -noncomputable def g2 (a y : ℝ) : ℝ := +@[expose] noncomputable def g2 (a y : ℝ) : ℝ := y ^ 3 * (10 * a ^ 4 + 9 * a ^ 2 * y ^ 2 + 3 * y ^ 4) / (6 * (y ^ 2 + a ^ 2) ^ 3) /-- Third derivative of the rational factor `g0 a`, for positive `a`. -/ -noncomputable def g3 (a y : ℝ) : ℝ := +@[expose] noncomputable def g3 (a y : ℝ) : ℝ := y ^ 2 * (10 * a ^ 6 + 5 * a ^ 4 * y ^ 2 + 4 * a ^ 2 * y ^ 4 + y ^ 6) / (2 * (y ^ 2 + a ^ 2) ^ 4) /-- Fourth derivative of the rational factor `g0 a`, for positive `a`. -/ -noncomputable def g4 (a y : ℝ) : ℝ := +@[expose] noncomputable def g4 (a y : ℝ) : ℝ := 2 * a ^ 4 * y * (5 * a ^ 4 - 10 * a ^ 2 * y ^ 2 + y ^ 4) / (y ^ 2 + a ^ 2) ^ 5 lemma hasDerivAt_g0 {a : ℝ} (ha : 0 < a) (y : ℝ) : HasDerivAt (g0 a) (g1 a y) y := by diff --git a/LeanPool/Zeta5Irrational/HermiteFormula.lean b/LeanPool/Zeta5Irrational/HermiteFormula.lean index a69fef40d5..df7a4f2a6b 100644 --- a/LeanPool/Zeta5Irrational/HermiteFormula.lean +++ b/LeanPool/Zeta5Irrational/HermiteFormula.lean @@ -28,7 +28,7 @@ import Mathlib.Tactic.Ring.RingNF i.e. the pole moments (2.3) of the paper (Proposition 2.2). -/ -@[expose] public section +public section open Filter Topology Set MeasureTheory Finset diff --git a/LeanPool/Zeta5Irrational/HermiteIBP.lean b/LeanPool/Zeta5Irrational/HermiteIBP.lean index 952a616390..f89b7d6bb9 100644 --- a/LeanPool/Zeta5Irrational/HermiteIBP.lean +++ b/LeanPool/Zeta5Irrational/HermiteIBP.lean @@ -30,7 +30,7 @@ Uniform bounds `|F_m(y)| ≤ c_m (1+2πy)^{m+1} / (2π y^{m+1} e^{2πy})` and `| give integrability of the products and vanishing boundary terms at `0⁺` and `∞`. -/ -@[expose] public section +public section open Filter Topology Set MeasureTheory diff --git a/LeanPool/Zeta5Irrational/HermiteIntegrals.lean b/LeanPool/Zeta5Irrational/HermiteIntegrals.lean index 132f630665..dc1e8577a9 100644 --- a/LeanPool/Zeta5Irrational/HermiteIntegrals.lean +++ b/LeanPool/Zeta5Irrational/HermiteIntegrals.lean @@ -34,14 +34,14 @@ import Mathlib.MeasureTheory.Integral.IntegralEqImproper The antiderivatives (a rational function plus arctan terms) are verified by differentiation. -/ -@[expose] public section +public section open Filter Topology Set MeasureTheory namespace Zeta5Irrational /-- `g₄(y) / y` as a rational function (continuous at `0`). -/ -noncomputable def h4 (a y : ℝ) : ℝ := +@[expose] noncomputable def h4 (a y : ℝ) : ℝ := 2 * a ^ 4 * (5 * a ^ 4 - 10 * a ^ 2 * y ^ 2 + y ^ 4) / (y ^ 2 + a ^ 2) ^ 5 lemma g4_div_eq_h4 (a : ℝ) {y : ℝ} (hy : y ≠ 0) : g4 a y / y = h4 a y := by @@ -181,7 +181,7 @@ lemma integral_h4 {a : ℝ} (ha : 0 < a) : ∫ y in Ioi 0, h4 a y = Real.pi / a /-! ### `∫₀^∞ g₄(y) y/(y² + n²) dy = π a⁴/(a + n)⁵` -/ /-- The integrand `g₄(y) · y/(y² + n²)`. -/ -noncomputable def k4 (a n y : ℝ) : ℝ := +@[expose] noncomputable def k4 (a n y : ℝ) : ℝ := g4 a y * (y / (y ^ 2 + n ^ 2)) lemma abs_k4_le {a n : ℝ} (ha : 0 < a) (hn : 0 < n) {y : ℝ} (hy : 0 < y) : diff --git a/LeanPool/Zeta5Irrational/Kernel.lean b/LeanPool/Zeta5Irrational/Kernel.lean index 56e1d42dc6..9e043dfc10 100644 --- a/LeanPool/Zeta5Irrational/Kernel.lean +++ b/LeanPool/Zeta5Irrational/Kernel.lean @@ -31,7 +31,7 @@ import Mathlib.MeasureTheory.Integral.DominatedConvergence * `tendsto_Ltr` : `L_{1/(n+1), n+1}(r) → log r`. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral Filter Topology diff --git a/LeanPool/Zeta5Irrational/Legendre.lean b/LeanPool/Zeta5Irrational/Legendre.lean index dddf1f9b18..6e8f3362ca 100644 --- a/LeanPool/Zeta5Irrational/Legendre.lean +++ b/LeanPool/Zeta5Irrational/Legendre.lean @@ -18,14 +18,14 @@ import Mathlib.Tactic.Ring.Basic where each factorial valuation is given by Legendre's formula (`padicValNat_factorial`). -/ -@[expose] public section +public section open Finset namespace Zeta5Irrational /-- `v_p(S_K)`. -/ -noncomputable def vSK (n p : ℕ) : ℤ := +@[expose] noncomputable def vSK (n p : ℕ) : ℤ := padicValRat p (S n) lemma padicValNat_finset_prod (p : ℕ) [hp : Fact p.Prime] {ι : Type*} (s : Finset ι) (f : ι → ℕ) diff --git a/LeanPool/Zeta5Irrational/Main.lean b/LeanPool/Zeta5Irrational/Main.lean index 79c04d338f..26bfbb14c0 100644 --- a/LeanPool/Zeta5Irrational/Main.lean +++ b/LeanPool/Zeta5Irrational/Main.lean @@ -20,7 +20,7 @@ public import Mathlib.NumberTheory.Real.Irrational `Classical.choice` and `Quot.sound`. -/ -@[expose] public section +public section open Polynomial Filter Topology diff --git a/LeanPool/Zeta5Irrational/MainEstimate.lean b/LeanPool/Zeta5Irrational/MainEstimate.lean index 3afdc0b140..268916dd84 100644 --- a/LeanPool/Zeta5Irrational/MainEstimate.lean +++ b/LeanPool/Zeta5Irrational/MainEstimate.lean @@ -34,7 +34,7 @@ From these, `main_estimate` proves Theorem 2.1 with decay rate `c = -800 (A_eff place of the paper's `139/5`. This suffices for the irrationality criterion. -/ -@[expose] public section +public section open Polynomial Filter Topology diff --git a/LeanPool/Zeta5Irrational/Measure.lean b/LeanPool/Zeta5Irrational/Measure.lean index a8e367177a..4a7340e55a 100644 --- a/LeanPool/Zeta5Irrational/Measure.lean +++ b/LeanPool/Zeta5Irrational/Measure.lean @@ -18,7 +18,7 @@ import Mathlib.Tactic.NormNum.Pow sums `S_j`, and the energy `I(ρ)` by formula (A.2). -/ -@[expose] public section +public section open Finset @@ -33,7 +33,7 @@ noncomputable abbrev alph : ℝ := 3 / 40 /-- The constant `C*` of (6.3). -/ -noncomputable def Cstar : ℝ := +@[expose] noncomputable def Cstar : ℝ := -2 * lam + 12 * alph * lam * (1 - Real.log alph) + 3 * lam ^ 2 - 2 * lam ^ 2 * Real.log (2 * lam) @@ -42,7 +42,7 @@ noncomputable abbrev M0 : ℝ := -1329 / 200 /-- Table 1: `10¹² a_j`, `10¹² b_j`, `10¹² c_j`. -/ -def table1 : List (ℕ × ℕ × ℕ) := +@[expose] def table1 : List (ℕ × ℕ × ℕ) := [(3906748086, 8992695531, 10515596180), (2312248264, 15340997855, 29471737793), (1402286665, 25730180724, 42934365099), (881725356, 41909578246, 58204231966), (578197906, 65851089563, 69037621310), (396324613, 99481037884, 78873099189), @@ -53,23 +53,23 @@ def table1 : List (ℕ × ℕ × ℕ) := (74129565, 716160577112, 30462865791), (71741310, 746637295669, 5959622577)] /-- `a_j`, `b_j`, `c_j` (1-indexed; `0` outside the table). -/ -noncomputable def aρ (j : ℕ) : ℝ := +@[expose] noncomputable def aρ (j : ℕ) : ℝ := ((table1.getD (j - 1) (0, 0, 0)).1 : ℝ) / 10 ^ 12 /-- Right endpoint of the `j`th arcsine component, read from the exact rational table. -/ -noncomputable def bρ (j : ℕ) : ℝ := +@[expose] noncomputable def bρ (j : ℕ) : ℝ := ((table1.getD (j - 1) (0, 0, 0)).2.1 : ℝ) / 10 ^ 12 /-- Mass of the `j`th arcsine component, read from the exact rational table. -/ -noncomputable def cρ (j : ℕ) : ℝ := +@[expose] noncomputable def cρ (j : ℕ) : ℝ := ((table1.getD (j - 1) (0, 0, 0)).2.2 : ℝ) / 10 ^ 12 /-- Partial sums `S_j = ∑_{i ≤ j} c_i`. -/ -noncomputable def Sρ (j : ℕ) : ℝ := +@[expose] noncomputable def Sρ (j : ℕ) : ℝ := ∑ i ∈ Icc 1 j, cρ i /-- The logarithmic energy `I(ρ)` of the measure `ρ`, formula (A.2). -/ -noncomputable def Irho : ℝ := +@[expose] noncomputable def Irho : ℝ := ∑ j ∈ Icc 1 16, (Sρ j ^ 2 - Sρ (j - 1) ^ 2) * Real.log ((bρ j - aρ j) / 4) /-- The total mass of `ρ` is `λ` (Appendix A.1). -/ diff --git a/LeanPool/Zeta5Irrational/Moments.lean b/LeanPool/Zeta5Irrational/Moments.lean index 684400726c..17a0bcc4b5 100644 --- a/LeanPool/Zeta5Irrational/Moments.lean +++ b/LeanPool/Zeta5Irrational/Moments.lean @@ -28,7 +28,7 @@ integral, term-wise integration of the series defining `w`, and Euler's formula `ζ(2k) = (-1)^{k+1} 2^{2k-1} π^{2k} B_{2k} / (2k)!` (`hasSum_zeta_nat` in Mathlib). -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology Finset diff --git a/LeanPool/Zeta5Irrational/Norm.lean b/LeanPool/Zeta5Irrational/Norm.lean index 9fe1c945aa..f83c4ad091 100644 --- a/LeanPool/Zeta5Irrational/Norm.lean +++ b/LeanPool/Zeta5Irrational/Norm.lean @@ -36,44 +36,44 @@ falling back to (3.12) otherwise. The normaliser is `mN n = ∏_{p ≤ 2h} p^{-L `integral_mN` proves `mN n · F_K ∈ ℤ[X]` for every `n ≥ 1`. -/ -@[expose] public section +public section open Finset Polynomial namespace Zeta5Irrational /-- The cutoff `M` separating small primes from the inner range. -/ -def Mcut : ℕ := +@[expose] def Mcut : ℕ := 400 /-- The small-prime exponent (3.12). -/ -noncomputable def Lsmall (n p : ℕ) : ℤ := +@[expose] noncomputable def Lsmall (n p : ℕ) : ℤ := -(6 * (37 * n : ℕ) * (Nat.log p (200 * n) : ℤ) + (37 * n : ℕ) * (padicValNat p 24 : ℤ)) /-- The class offsets `β_c = 6 ℓ_N(c) - ℓ_K(c) - 4`. -/ -noncomputable def betaI (n p : ℕ) {m : ℕ} (c : Fin (m + 1)) : ℤ := +@[expose] noncomputable def betaI (n p : ℕ) {m : ℕ} (c : Fin (m + 1)) : ℤ := 6 * (SX p (3 * n) (((c : ℕ) : ℤ) : ZMod p) : ℤ) - (SX p (40 * n) (((c : ℕ) : ℤ) : ZMod p) : ℤ) - 4 /-- The water-filling parameters. -/ -def kloI (n p : ℕ) : ℤ := +@[expose] def kloI (n p : ℕ) : ℤ := -2 * ((40 * n / p : ℕ) : ℤ) - 6 /-- Upper admissible allocation level in the inner-prime range. -/ -def ktopI (n p : ℕ) : ℤ := +@[expose] def ktopI (n p : ℕ) : ℤ := 8 * ((40 * n / p : ℕ) : ℤ) + 20 /-- Rows reserved for the zero residue class in the inner allocation. -/ -def L0I (n p : ℕ) : ℕ := +@[expose] def L0I (n p : ℕ) : ℕ := 3 * (40 * n / p) + 6 /-- The inner allocation. -/ -noncomputable def allocI (n p m : ℕ) : Fin (m + 1) → ℕ := +@[expose] noncomputable def allocI (n p m : ℕ) : Fin (m + 1) → ℕ := allocK (betaI n p (m := m)) (37 * n) (kfSel (betaI n p (m := m)) (37 * n) (L0I n p) (kloI n p) (ktopI n p)) /-- The side conditions of the inner bound. -/ -def InnerOK (n p : ℕ) : Prop := +@[expose] def InnerOK (n p : ℕ) : Prop := ∃ _hm : 2 * (p / 2) + 1 = p, ∃ hm1 : 1 ≤ p / 2, 5 ≤ p ∧ @@ -85,15 +85,15 @@ def InnerOK (n p : ℕ) : Prop := 2 * (allocI n p (p / 2) 0 : ℚ) + (Bse p (40 * n) (3 * n) 0 - 4) / 2 /-- The inner weight sum (for `m = p / 2`). -/ -noncomputable def WI (n p : ℕ) : ℚ := +@[expose] noncomputable def WI (n p : ℕ) : ℚ := if hm1 : 1 ≤ p / 2 then ∑ s, wcap hm1 (allocI n p (p / 2)) (Bse p (40 * n) (3 * n)) s else 0 /-- The side conditions of the outer bound. -/ -def OuterOK (n p : ℕ) : Prop := +@[expose] def OuterOK (n p : ℕ) : Prop := 2 * (p / 2) + 1 = p ∧ 7 ≤ p ∧ 40 * n < 3 * p ∧ 2 * (40 * n) < p ^ 2 ∧ 3 * n < p /-- The outer weight sum minus the rank loss (for `m = p / 2`). -/ -noncomputable def WO (n p : ℕ) : ℚ := +@[expose] noncomputable def WO (n p : ℕ) : ℚ := if hpp : p.Prime then if hm : 2 * (p / 2) + 1 = p then haveI : Fact p.Prime := ⟨hpp⟩ @@ -104,14 +104,14 @@ noncomputable def WO (n p : ℕ) : ℚ := open Classical in /-- **The local exponent.** -/ -noncomputable def Lp (n p : ℕ) : ℤ := +@[expose] noncomputable def Lp (n p : ℕ) : ℤ := if p * Mcut ≤ 40 * n then Lsmall n p else if 3 * p ≤ 40 * n then (if InnerOK n p then vSK n p + ⌊2 * WI n p⌋ else Lsmall n p) else (if OuterOK n p then vSK n p + ⌊WO n p⌋ else Lsmall n p) /-- **The normaliser** `m_K = ∏_{p ≤ 2h} p^{-L_p}`. -/ -noncomputable def mN (n : ℕ) : ℚ := +@[expose] noncomputable def mN (n : ℕ) : ℚ := ∏ p ∈ (range (2 * (37 * n) + 1)).filter Nat.Prime, (p : ℚ) ^ (-Lp n p) lemma mN_pos (n : ℕ) : 0 < mN n := by diff --git a/LeanPool/Zeta5Irrational/PNT.lean b/LeanPool/Zeta5Irrational/PNT.lean index 67f48e53cb..6d31bf6736 100644 --- a/LeanPool/Zeta5Irrational/PNT.lean +++ b/LeanPool/Zeta5Irrational/PNT.lean @@ -16,7 +16,7 @@ form `θ(x) ~ x` for Chebyshev's function `θ`. Mathlib does not contain it; the `PrimeNumberTheoremAnd` development already preserved in `LeanPool.MooreBound` does. -/ -@[expose] public section +public section open Filter Asymptotics diff --git a/LeanPool/Zeta5Irrational/PartialFractions.lean b/LeanPool/Zeta5Irrational/PartialFractions.lean index 77fbebf47b..3a8e69708d 100644 --- a/LeanPool/Zeta5Irrational/PartialFractions.lean +++ b/LeanPool/Zeta5Irrational/PartialFractions.lean @@ -22,7 +22,7 @@ For a polynomial `P` and `t ≥ 0`, `P(t) / D_K(t) = (P /ₘ D_K)(t) + ∑_j res `res_j = P(-j²) / D_K'(-j²)`, the residues used in the definition of `μ_X` (`Zeta5Irrational.res`). -/ -@[expose] public section +public section open Polynomial Finset diff --git a/LeanPool/Zeta5Irrational/Positivity.lean b/LeanPool/Zeta5Irrational/Positivity.lean index 2ff1a93a95..558ce3e1fb 100644 --- a/LeanPool/Zeta5Irrational/Positivity.lean +++ b/LeanPool/Zeta5Irrational/Positivity.lean @@ -30,7 +30,7 @@ parts and the Mittag-Leffler expansion); * `Δ_pos` : `Δ_K(ζ(5)) > 0`, since `G_K(ζ(5))` is the Gram matrix of a positive weight. -/ -@[expose] public section +public section open Polynomial MeasureTheory Set Finset @@ -146,7 +146,7 @@ theorem moment_rep (K : ℕ) (P : ℚ[X]) : rw [integral_const_mul, pole_moment j (Finset.mem_Icc.mp hj).1] /-- The positive weight `ν(y) = D_N(y²)^6 / D_K(y²) · w(y)`. -/ -noncomputable def ν (n : ℕ) (y : ℝ) : ℝ := +@[expose] noncomputable def ν (n : ℕ) (y : ℝ) : ℝ := aeval (y ^ 2) (D (3 * n)) ^ 6 / aeval (y ^ 2) (D (40 * n)) * w y lemma ν_pos (n : ℕ) {y : ℝ} (hy : 0 < y) : 0 < ν n y := by diff --git a/LeanPool/Zeta5Irrational/Potential.lean b/LeanPool/Zeta5Irrational/Potential.lean index 7ab8939ef5..3067d22055 100644 --- a/LeanPool/Zeta5Irrational/Potential.lean +++ b/LeanPool/Zeta5Irrational/Potential.lean @@ -32,19 +32,19 @@ import Mathlib.Tactic.Ring.Basic * the derivative of `V`: `V'(t) = P(√t)/√t` with `P(y) = π + arctan(1/y) - 6 arctan(α/y)`. -/ -@[expose] public section +public section open Filter Topology Set Finset namespace Zeta5Irrational /-- The closed form (A.1) of the potential of the arcsine measure on `[a, b]`. -/ -noncomputable def Uω (a b t : ℝ) : ℝ := +@[expose] noncomputable def Uω (a b t : ℝ) : ℝ := if a ≤ t ∧ t ≤ b then Real.log ((b - a) / 4) else Real.log ((|t - (a + b) / 2| + Real.sqrt ((t - a) * (t - b))) / 2) /-- The potential of `ρ`. -/ -noncomputable def Uρ (t : ℝ) : ℝ := +@[expose] noncomputable def Uρ (t : ℝ) : ℝ := ∑ j ∈ Icc 1 16, cρ j * Uω (aρ j) (bρ j) t lemma Uω_of_mem {a b t : ℝ} (h1 : a ≤ t) (h2 : t ≤ b) : Uω a b t = Real.log ((b - a) / 4) := by @@ -103,11 +103,11 @@ lemma Uω_antitoneOn_Iic {a b : ℝ} (hab : a < b) : AntitoneOn (Uω a b) (Iic a /-! ### The derivative of `V` -/ /-- `P(y) = π + arctan (1/y) - 6 arctan (α/y)`. -/ -noncomputable def Pfun (y : ℝ) : ℝ := +@[expose] noncomputable def Pfun (y : ℝ) : ℝ := Real.pi + Real.arctan (1 / y) - 6 * Real.arctan ((3 / 40) / y) /-- The closed form of `V` as a function of `y = √t`: `Φ(y) = V(y²)`. -/ -noncomputable def Φ (y : ℝ) : ℝ := +@[expose] noncomputable def Φ (y : ℝ) : ℝ := Real.log (1 + y ^ 2) - 6 * (3 / 40) * Real.log (y ^ 2 + (3 / 40) ^ 2) - 2 + 12 * (3 / 40) + 2 * y * Pfun y diff --git a/LeanPool/Zeta5Irrational/PotentialV.lean b/LeanPool/Zeta5Irrational/PotentialV.lean index 337e2663ab..819a26e86d 100644 --- a/LeanPool/Zeta5Irrational/PotentialV.lean +++ b/LeanPool/Zeta5Irrational/PotentialV.lean @@ -22,7 +22,7 @@ import Mathlib.Tactic.Ring.RingNF `V(t) = log(1+t) - 6α log(t+α²) - 2 + 12α + 2√t (π + arctan(1/√t) - 6 arctan(α/√t))`. -/ -@[expose] public section +public section open Filter Topology Set MeasureTheory diff --git a/LeanPool/Zeta5Irrational/PrimeSum.lean b/LeanPool/Zeta5Irrational/PrimeSum.lean index 10f07f08f3..4fb438222f 100644 --- a/LeanPool/Zeta5Irrational/PrimeSum.lean +++ b/LeanPool/Zeta5Irrational/PrimeSum.lean @@ -23,14 +23,14 @@ import Mathlib.Analysis.SpecialFunctions.Integrals.Basic this gives `∑_{K/d < p ≤ K/c} p log p = K² (1/c² - 1/d²)/2 + o(K²)`. -/ -@[expose] public section +public section open Finset Filter Topology MeasureTheory Set Real Asymptotics namespace Zeta5Irrational /-- `c p = log p` for primes, `0` otherwise. -/ -noncomputable def cPrime (k : ℕ) : ℝ := +@[expose] noncomputable def cPrime (k : ℕ) : ℝ := if k.Prime then Real.log k else 0 lemma theta_eq_sum_cPrime (t : ℝ) : Chebyshev.theta t = ∑ k ∈ Icc 0 ⌊t⌋₊, cPrime k := by @@ -39,7 +39,7 @@ lemma theta_eq_sum_cPrime (t : ℝ) : Chebyshev.theta t = ∑ k ∈ Icc 0 ⌊t /-- The weighted prime sum `∑_{a < p ≤ b} p log p` (as a sum over integers `k` with `⌊a⌋₊ < k ≤ ⌊b⌋₊`). -/ -noncomputable def wsum (a b : ℝ) : ℝ := +@[expose] noncomputable def wsum (a b : ℝ) : ℝ := ∑ k ∈ Ioc ⌊a⌋₊ ⌊b⌋₊, (k : ℝ) * cPrime k /-- Abel summation for the weighted prime sum. -/ diff --git a/LeanPool/Zeta5Irrational/PrimeSumIntegral.lean b/LeanPool/Zeta5Irrational/PrimeSumIntegral.lean index 237f0ee5da..0955770e2e 100644 --- a/LeanPool/Zeta5Irrational/PrimeSumIntegral.lean +++ b/LeanPool/Zeta5Irrational/PrimeSumIntegral.lean @@ -25,7 +25,7 @@ For `f` Lipschitz on `[a, b]` (`0 < a < b`), `psum f a b K / K² ≤ ∫_a^b f(x large `K`; and the piecewise version for `f` given by Lipschitz pieces on `[t_i, t_{i+1})`. -/ -@[expose] public section +public section open Finset Filter Topology Set intervalIntegral MeasureTheory diff --git a/LeanPool/Zeta5Irrational/PrimeSumStep.lean b/LeanPool/Zeta5Irrational/PrimeSumStep.lean index 137a0812ba..fa837adbf0 100644 --- a/LeanPool/Zeta5Irrational/PrimeSumStep.lean +++ b/LeanPool/Zeta5Irrational/PrimeSumStep.lean @@ -19,14 +19,14 @@ of a partition `a = c_0 < ⋯ < c_r = b`, then `K² ∑_j v_j (1/c_j² - 1/c_{j+1}²)/2 + o(K²)`. -/ -@[expose] public section +public section open Finset Filter Topology Set namespace Zeta5Irrational /-- `∑_{K/b < p ≤ K/a} p f(K/p) log p`. -/ -noncomputable def psum (f : ℝ → ℝ) (a b K : ℝ) : ℝ := +@[expose] noncomputable def psum (f : ℝ → ℝ) (a b K : ℝ) : ℝ := ∑ k ∈ Ioc ⌊K / b⌋₊ ⌊K / a⌋₊, (k : ℝ) * cPrime k * f (K / k) lemma cPrime_nonneg (k : ℕ) : 0 ≤ cPrime k := by diff --git a/LeanPool/Zeta5Irrational/RealBound.lean b/LeanPool/Zeta5Irrational/RealBound.lean index ab4b46933d..34dce738cd 100644 --- a/LeanPool/Zeta5Irrational/RealBound.lean +++ b/LeanPool/Zeta5Irrational/RealBound.lean @@ -32,7 +32,7 @@ A variant of Proposition 6.3 (`real_bound`) with `27 K log K` in place of the pa * `log_S_le` : the Stirling bound (6.15) — proved. -/ -@[expose] public section +public section open Polynomial Filter Topology Finset diff --git a/LeanPool/Zeta5Irrational/Stirling.lean b/LeanPool/Zeta5Irrational/Stirling.lean index a31864c460..fd1badf287 100644 --- a/LeanPool/Zeta5Irrational/Stirling.lean +++ b/LeanPool/Zeta5Irrational/Stirling.lean @@ -34,7 +34,7 @@ import Mathlib.Tactic.Ring.RingNF the bound displayed before (6.15) in the paper. -/ -@[expose] public section +public section open Real Finset diff --git a/LeanPool/Zeta5Irrational/Table/Bracket.lean b/LeanPool/Zeta5Irrational/Table/Bracket.lean index 36600b8ac0..17cc6bfdcb 100644 --- a/LeanPool/Zeta5Irrational/Table/Bracket.lean +++ b/LeanPool/Zeta5Irrational/Table/Bracket.lean @@ -17,7 +17,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # Bracket: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/Common.lean b/LeanPool/Zeta5Irrational/Table/Common.lean index dcba05280e..22b2132207 100644 --- a/LeanPool/Zeta5Irrational/Table/Common.lean +++ b/LeanPool/Zeta5Irrational/Table/Common.lean @@ -16,7 +16,7 @@ import Mathlib.Tactic.NormNum.Pow /-! ### The entries of Table 1 as numerals -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/Intervals.lean b/LeanPool/Zeta5Irrational/Table/Intervals.lean index c34b9d8c37..7906882b75 100644 --- a/LeanPool/Zeta5Irrational/Table/Intervals.lean +++ b/LeanPool/Zeta5Irrational/Table/Intervals.lean @@ -127,7 +127,7 @@ public import LeanPool.Zeta5Irrational.Table.Tail /-! # Intervals: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/Tail.lean b/LeanPool/Zeta5Irrational/Table/Tail.lean index 1901976dd8..29ebce8842 100644 --- a/LeanPool/Zeta5Irrational/Table/Tail.lean +++ b/LeanPool/Zeta5Irrational/Table/Tail.lean @@ -21,7 +21,7 @@ import Mathlib.Tactic.Positivity.Basic /-! # The tail `t ≥ 2` of the potential inequality (6.2): the bound (6.8) -/ -@[expose] public section +public section open Finset Set diff --git a/LeanPool/Zeta5Irrational/Table/U00.lean b/LeanPool/Zeta5Irrational/Table/U00.lean index 0a5c8f9651..c6c9ae69f5 100644 --- a/LeanPool/Zeta5Irrational/Table/U00.lean +++ b/LeanPool/Zeta5Irrational/Table/U00.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U00) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U01.lean b/LeanPool/Zeta5Irrational/Table/U01.lean index 2ec9d88dbf..80ab20d693 100644 --- a/LeanPool/Zeta5Irrational/Table/U01.lean +++ b/LeanPool/Zeta5Irrational/Table/U01.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U01) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U02.lean b/LeanPool/Zeta5Irrational/Table/U02.lean index 2175276fa2..7ac66b4279 100644 --- a/LeanPool/Zeta5Irrational/Table/U02.lean +++ b/LeanPool/Zeta5Irrational/Table/U02.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U02) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U03.lean b/LeanPool/Zeta5Irrational/Table/U03.lean index 563e371024..699e7d19fc 100644 --- a/LeanPool/Zeta5Irrational/Table/U03.lean +++ b/LeanPool/Zeta5Irrational/Table/U03.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U03) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U04.lean b/LeanPool/Zeta5Irrational/Table/U04.lean index 31b2bd5fbc..b56d819667 100644 --- a/LeanPool/Zeta5Irrational/Table/U04.lean +++ b/LeanPool/Zeta5Irrational/Table/U04.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U04) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U05.lean b/LeanPool/Zeta5Irrational/Table/U05.lean index 563112de70..607859b997 100644 --- a/LeanPool/Zeta5Irrational/Table/U05.lean +++ b/LeanPool/Zeta5Irrational/Table/U05.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U05) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U06.lean b/LeanPool/Zeta5Irrational/Table/U06.lean index 60816ff4e7..518cb40e2f 100644 --- a/LeanPool/Zeta5Irrational/Table/U06.lean +++ b/LeanPool/Zeta5Irrational/Table/U06.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U06) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U07.lean b/LeanPool/Zeta5Irrational/Table/U07.lean index a3851f7f6c..205ed1dffd 100644 --- a/LeanPool/Zeta5Irrational/Table/U07.lean +++ b/LeanPool/Zeta5Irrational/Table/U07.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U07) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U08.lean b/LeanPool/Zeta5Irrational/Table/U08.lean index 10d12131ec..896229f184 100644 --- a/LeanPool/Zeta5Irrational/Table/U08.lean +++ b/LeanPool/Zeta5Irrational/Table/U08.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U08) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U09.lean b/LeanPool/Zeta5Irrational/Table/U09.lean index 0328805a98..46a695d40b 100644 --- a/LeanPool/Zeta5Irrational/Table/U09.lean +++ b/LeanPool/Zeta5Irrational/Table/U09.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U09) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U10.lean b/LeanPool/Zeta5Irrational/Table/U10.lean index 29afac606a..8a6975febb 100644 --- a/LeanPool/Zeta5Irrational/Table/U10.lean +++ b/LeanPool/Zeta5Irrational/Table/U10.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U10) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U11.lean b/LeanPool/Zeta5Irrational/Table/U11.lean index 7a371f4c6a..bf342a212e 100644 --- a/LeanPool/Zeta5Irrational/Table/U11.lean +++ b/LeanPool/Zeta5Irrational/Table/U11.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U11) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U12.lean b/LeanPool/Zeta5Irrational/Table/U12.lean index 7d08c89cef..45c87f903e 100644 --- a/LeanPool/Zeta5Irrational/Table/U12.lean +++ b/LeanPool/Zeta5Irrational/Table/U12.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U12) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U13.lean b/LeanPool/Zeta5Irrational/Table/U13.lean index b18869a0ad..e3f292d365 100644 --- a/LeanPool/Zeta5Irrational/Table/U13.lean +++ b/LeanPool/Zeta5Irrational/Table/U13.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U13) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U14.lean b/LeanPool/Zeta5Irrational/Table/U14.lean index 896e134ad1..dfba81350e 100644 --- a/LeanPool/Zeta5Irrational/Table/U14.lean +++ b/LeanPool/Zeta5Irrational/Table/U14.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U14) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U15.lean b/LeanPool/Zeta5Irrational/Table/U15.lean index 1f01f854ec..62ccc6d846 100644 --- a/LeanPool/Zeta5Irrational/Table/U15.lean +++ b/LeanPool/Zeta5Irrational/Table/U15.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U15) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U16.lean b/LeanPool/Zeta5Irrational/Table/U16.lean index aa65af783a..d6418955e6 100644 --- a/LeanPool/Zeta5Irrational/Table/U16.lean +++ b/LeanPool/Zeta5Irrational/Table/U16.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U16) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U17.lean b/LeanPool/Zeta5Irrational/Table/U17.lean index 1fc023c61c..49f64a863a 100644 --- a/LeanPool/Zeta5Irrational/Table/U17.lean +++ b/LeanPool/Zeta5Irrational/Table/U17.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U17) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U18.lean b/LeanPool/Zeta5Irrational/Table/U18.lean index cf6301eec5..a9a8178766 100644 --- a/LeanPool/Zeta5Irrational/Table/U18.lean +++ b/LeanPool/Zeta5Irrational/Table/U18.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U18) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U19.lean b/LeanPool/Zeta5Irrational/Table/U19.lean index 44902dcf1c..cc80f903ec 100644 --- a/LeanPool/Zeta5Irrational/Table/U19.lean +++ b/LeanPool/Zeta5Irrational/Table/U19.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U19) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U20.lean b/LeanPool/Zeta5Irrational/Table/U20.lean index 5b78439083..3b7f6d086a 100644 --- a/LeanPool/Zeta5Irrational/Table/U20.lean +++ b/LeanPool/Zeta5Irrational/Table/U20.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U20) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U21.lean b/LeanPool/Zeta5Irrational/Table/U21.lean index 654ba4ce2b..8c027723c2 100644 --- a/LeanPool/Zeta5Irrational/Table/U21.lean +++ b/LeanPool/Zeta5Irrational/Table/U21.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U21) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U22.lean b/LeanPool/Zeta5Irrational/Table/U22.lean index e8a0c413b6..07e0a90ec2 100644 --- a/LeanPool/Zeta5Irrational/Table/U22.lean +++ b/LeanPool/Zeta5Irrational/Table/U22.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U22) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U23.lean b/LeanPool/Zeta5Irrational/Table/U23.lean index 14a4f56064..875e716919 100644 --- a/LeanPool/Zeta5Irrational/Table/U23.lean +++ b/LeanPool/Zeta5Irrational/Table/U23.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U23) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U24.lean b/LeanPool/Zeta5Irrational/Table/U24.lean index c4394f2bf5..bc206906c5 100644 --- a/LeanPool/Zeta5Irrational/Table/U24.lean +++ b/LeanPool/Zeta5Irrational/Table/U24.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U24) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U25.lean b/LeanPool/Zeta5Irrational/Table/U25.lean index 1b2ee9e135..95f778e22c 100644 --- a/LeanPool/Zeta5Irrational/Table/U25.lean +++ b/LeanPool/Zeta5Irrational/Table/U25.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U25) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U26.lean b/LeanPool/Zeta5Irrational/Table/U26.lean index c7d7b311dc..4fdfea4f0b 100644 --- a/LeanPool/Zeta5Irrational/Table/U26.lean +++ b/LeanPool/Zeta5Irrational/Table/U26.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U26) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U27.lean b/LeanPool/Zeta5Irrational/Table/U27.lean index 57a0671dec..e4b075344a 100644 --- a/LeanPool/Zeta5Irrational/Table/U27.lean +++ b/LeanPool/Zeta5Irrational/Table/U27.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U27) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U28.lean b/LeanPool/Zeta5Irrational/Table/U28.lean index 0cb56450b3..22e3d85292 100644 --- a/LeanPool/Zeta5Irrational/Table/U28.lean +++ b/LeanPool/Zeta5Irrational/Table/U28.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U28) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U29.lean b/LeanPool/Zeta5Irrational/Table/U29.lean index 2169fe7cbd..d9e9e4cf2b 100644 --- a/LeanPool/Zeta5Irrational/Table/U29.lean +++ b/LeanPool/Zeta5Irrational/Table/U29.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U29) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U30.lean b/LeanPool/Zeta5Irrational/Table/U30.lean index bb77659786..0f47b2985b 100644 --- a/LeanPool/Zeta5Irrational/Table/U30.lean +++ b/LeanPool/Zeta5Irrational/Table/U30.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U30) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U31.lean b/LeanPool/Zeta5Irrational/Table/U31.lean index 7ab756e9eb..19b8cff704 100644 --- a/LeanPool/Zeta5Irrational/Table/U31.lean +++ b/LeanPool/Zeta5Irrational/Table/U31.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U31) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U32.lean b/LeanPool/Zeta5Irrational/Table/U32.lean index 15b5439584..2bf24da2d6 100644 --- a/LeanPool/Zeta5Irrational/Table/U32.lean +++ b/LeanPool/Zeta5Irrational/Table/U32.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U32) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U33.lean b/LeanPool/Zeta5Irrational/Table/U33.lean index 2b3c9df0b7..3f9618d134 100644 --- a/LeanPool/Zeta5Irrational/Table/U33.lean +++ b/LeanPool/Zeta5Irrational/Table/U33.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U33) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U34.lean b/LeanPool/Zeta5Irrational/Table/U34.lean index 94ec4b3816..f3315475a5 100644 --- a/LeanPool/Zeta5Irrational/Table/U34.lean +++ b/LeanPool/Zeta5Irrational/Table/U34.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U34) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U35.lean b/LeanPool/Zeta5Irrational/Table/U35.lean index e6b97745a6..e4b1e9ec91 100644 --- a/LeanPool/Zeta5Irrational/Table/U35.lean +++ b/LeanPool/Zeta5Irrational/Table/U35.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U35) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U36.lean b/LeanPool/Zeta5Irrational/Table/U36.lean index 84aed46b20..14741bac26 100644 --- a/LeanPool/Zeta5Irrational/Table/U36.lean +++ b/LeanPool/Zeta5Irrational/Table/U36.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U36) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U37.lean b/LeanPool/Zeta5Irrational/Table/U37.lean index fc23ec5bd6..d3223a29fb 100644 --- a/LeanPool/Zeta5Irrational/Table/U37.lean +++ b/LeanPool/Zeta5Irrational/Table/U37.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U37) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U38.lean b/LeanPool/Zeta5Irrational/Table/U38.lean index fa0452ccc2..2705c7e8be 100644 --- a/LeanPool/Zeta5Irrational/Table/U38.lean +++ b/LeanPool/Zeta5Irrational/Table/U38.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U38) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U39.lean b/LeanPool/Zeta5Irrational/Table/U39.lean index c2d4b4db6e..07ab162668 100644 --- a/LeanPool/Zeta5Irrational/Table/U39.lean +++ b/LeanPool/Zeta5Irrational/Table/U39.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U39) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U40.lean b/LeanPool/Zeta5Irrational/Table/U40.lean index 6479827caf..aae606c80c 100644 --- a/LeanPool/Zeta5Irrational/Table/U40.lean +++ b/LeanPool/Zeta5Irrational/Table/U40.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U40) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U41.lean b/LeanPool/Zeta5Irrational/Table/U41.lean index 3284783767..83e71708ab 100644 --- a/LeanPool/Zeta5Irrational/Table/U41.lean +++ b/LeanPool/Zeta5Irrational/Table/U41.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U41) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U42.lean b/LeanPool/Zeta5Irrational/Table/U42.lean index 09ae6617cb..e6d0267f54 100644 --- a/LeanPool/Zeta5Irrational/Table/U42.lean +++ b/LeanPool/Zeta5Irrational/Table/U42.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U42) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U43.lean b/LeanPool/Zeta5Irrational/Table/U43.lean index d16109217a..a832603e39 100644 --- a/LeanPool/Zeta5Irrational/Table/U43.lean +++ b/LeanPool/Zeta5Irrational/Table/U43.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U43) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U44.lean b/LeanPool/Zeta5Irrational/Table/U44.lean index ee2acf913e..2ba92c12a4 100644 --- a/LeanPool/Zeta5Irrational/Table/U44.lean +++ b/LeanPool/Zeta5Irrational/Table/U44.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U44) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U45.lean b/LeanPool/Zeta5Irrational/Table/U45.lean index 840f90bda5..554af932f2 100644 --- a/LeanPool/Zeta5Irrational/Table/U45.lean +++ b/LeanPool/Zeta5Irrational/Table/U45.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U45) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U46.lean b/LeanPool/Zeta5Irrational/Table/U46.lean index 7f3683d39b..c38dcc9d99 100644 --- a/LeanPool/Zeta5Irrational/Table/U46.lean +++ b/LeanPool/Zeta5Irrational/Table/U46.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U46) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U47.lean b/LeanPool/Zeta5Irrational/Table/U47.lean index a027083ec8..3331947ff4 100644 --- a/LeanPool/Zeta5Irrational/Table/U47.lean +++ b/LeanPool/Zeta5Irrational/Table/U47.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U47) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U48.lean b/LeanPool/Zeta5Irrational/Table/U48.lean index 9d659caf5e..0c4d8dddec 100644 --- a/LeanPool/Zeta5Irrational/Table/U48.lean +++ b/LeanPool/Zeta5Irrational/Table/U48.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U48) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U49.lean b/LeanPool/Zeta5Irrational/Table/U49.lean index 512aa227c9..4370eca4b0 100644 --- a/LeanPool/Zeta5Irrational/Table/U49.lean +++ b/LeanPool/Zeta5Irrational/Table/U49.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U49) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U50.lean b/LeanPool/Zeta5Irrational/Table/U50.lean index b5dcad2c41..6a6f9aed88 100644 --- a/LeanPool/Zeta5Irrational/Table/U50.lean +++ b/LeanPool/Zeta5Irrational/Table/U50.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U50) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U51.lean b/LeanPool/Zeta5Irrational/Table/U51.lean index 0fb1081be0..3550f8d0c1 100644 --- a/LeanPool/Zeta5Irrational/Table/U51.lean +++ b/LeanPool/Zeta5Irrational/Table/U51.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U51) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U52.lean b/LeanPool/Zeta5Irrational/Table/U52.lean index 75524aae81..d914841ef5 100644 --- a/LeanPool/Zeta5Irrational/Table/U52.lean +++ b/LeanPool/Zeta5Irrational/Table/U52.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U52) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U53.lean b/LeanPool/Zeta5Irrational/Table/U53.lean index 87d7869602..35a4a844f6 100644 --- a/LeanPool/Zeta5Irrational/Table/U53.lean +++ b/LeanPool/Zeta5Irrational/Table/U53.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U53) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U54.lean b/LeanPool/Zeta5Irrational/Table/U54.lean index 08c6370d38..c1b0bf7315 100644 --- a/LeanPool/Zeta5Irrational/Table/U54.lean +++ b/LeanPool/Zeta5Irrational/Table/U54.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U54) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U55.lean b/LeanPool/Zeta5Irrational/Table/U55.lean index 93ac5ee641..791eda0040 100644 --- a/LeanPool/Zeta5Irrational/Table/U55.lean +++ b/LeanPool/Zeta5Irrational/Table/U55.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U55) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/U56.lean b/LeanPool/Zeta5Irrational/Table/U56.lean index 20b1934c2c..aadb3e1375 100644 --- a/LeanPool/Zeta5Irrational/Table/U56.lean +++ b/LeanPool/Zeta5Irrational/Table/U56.lean @@ -10,7 +10,7 @@ public import LeanPool.Zeta5Irrational.Table.UpperCertificate /-! # Certified arcsine potential bounds (U56) -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/UpperCertificate.lean b/LeanPool/Zeta5Irrational/Table/UpperCertificate.lean index eeed4a6faf..003d525be5 100644 --- a/LeanPool/Zeta5Irrational/Table/UpperCertificate.lean +++ b/LeanPool/Zeta5Irrational/Table/UpperCertificate.lean @@ -12,7 +12,7 @@ public import Mathlib.Analysis.Complex.ExponentialBounds /-! # Reusable upper certificates for arcsine potentials -/ -@[expose] public section +public section namespace Zeta5Irrational diff --git a/LeanPool/Zeta5Irrational/Table/V00.lean b/LeanPool/Zeta5Irrational/Table/V00.lean index 8dc82aafc6..f938ea8ebb 100644 --- a/LeanPool/Zeta5Irrational/Table/V00.lean +++ b/LeanPool/Zeta5Irrational/Table/V00.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V00: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V01.lean b/LeanPool/Zeta5Irrational/Table/V01.lean index 7d2b95c047..e06c35dbca 100644 --- a/LeanPool/Zeta5Irrational/Table/V01.lean +++ b/LeanPool/Zeta5Irrational/Table/V01.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V01: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V02.lean b/LeanPool/Zeta5Irrational/Table/V02.lean index a608a3b1c8..21fa0d031f 100644 --- a/LeanPool/Zeta5Irrational/Table/V02.lean +++ b/LeanPool/Zeta5Irrational/Table/V02.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V02: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V03.lean b/LeanPool/Zeta5Irrational/Table/V03.lean index 2f8a162225..670e4e9b09 100644 --- a/LeanPool/Zeta5Irrational/Table/V03.lean +++ b/LeanPool/Zeta5Irrational/Table/V03.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V03: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V04.lean b/LeanPool/Zeta5Irrational/Table/V04.lean index 051631c3ee..55744f3e09 100644 --- a/LeanPool/Zeta5Irrational/Table/V04.lean +++ b/LeanPool/Zeta5Irrational/Table/V04.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V04: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V05.lean b/LeanPool/Zeta5Irrational/Table/V05.lean index 54e002838c..76eab37782 100644 --- a/LeanPool/Zeta5Irrational/Table/V05.lean +++ b/LeanPool/Zeta5Irrational/Table/V05.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V05: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V06.lean b/LeanPool/Zeta5Irrational/Table/V06.lean index d2649f26ed..b778142836 100644 --- a/LeanPool/Zeta5Irrational/Table/V06.lean +++ b/LeanPool/Zeta5Irrational/Table/V06.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V06: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V07.lean b/LeanPool/Zeta5Irrational/Table/V07.lean index 8b9a20d8ae..1247f3d082 100644 --- a/LeanPool/Zeta5Irrational/Table/V07.lean +++ b/LeanPool/Zeta5Irrational/Table/V07.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V07: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V08.lean b/LeanPool/Zeta5Irrational/Table/V08.lean index e09f79668b..4dd1e29a47 100644 --- a/LeanPool/Zeta5Irrational/Table/V08.lean +++ b/LeanPool/Zeta5Irrational/Table/V08.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V08: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V09.lean b/LeanPool/Zeta5Irrational/Table/V09.lean index be9cfa2025..ea0fa0b59e 100644 --- a/LeanPool/Zeta5Irrational/Table/V09.lean +++ b/LeanPool/Zeta5Irrational/Table/V09.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V09: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V10.lean b/LeanPool/Zeta5Irrational/Table/V10.lean index a49640cb61..25a0ec59e9 100644 --- a/LeanPool/Zeta5Irrational/Table/V10.lean +++ b/LeanPool/Zeta5Irrational/Table/V10.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V10: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V11.lean b/LeanPool/Zeta5Irrational/Table/V11.lean index 77c27faea0..84318674b4 100644 --- a/LeanPool/Zeta5Irrational/Table/V11.lean +++ b/LeanPool/Zeta5Irrational/Table/V11.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V11: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V12.lean b/LeanPool/Zeta5Irrational/Table/V12.lean index 27af5c5c10..a323c845dd 100644 --- a/LeanPool/Zeta5Irrational/Table/V12.lean +++ b/LeanPool/Zeta5Irrational/Table/V12.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V12: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V13.lean b/LeanPool/Zeta5Irrational/Table/V13.lean index 5f2f61df15..34dc3e8b6b 100644 --- a/LeanPool/Zeta5Irrational/Table/V13.lean +++ b/LeanPool/Zeta5Irrational/Table/V13.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V13: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V14.lean b/LeanPool/Zeta5Irrational/Table/V14.lean index 50ea4ee335..5a4878c031 100644 --- a/LeanPool/Zeta5Irrational/Table/V14.lean +++ b/LeanPool/Zeta5Irrational/Table/V14.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V14: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V15.lean b/LeanPool/Zeta5Irrational/Table/V15.lean index fd73ffb46f..196034b29d 100644 --- a/LeanPool/Zeta5Irrational/Table/V15.lean +++ b/LeanPool/Zeta5Irrational/Table/V15.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V15: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V16.lean b/LeanPool/Zeta5Irrational/Table/V16.lean index 6c9360206c..63e947b51a 100644 --- a/LeanPool/Zeta5Irrational/Table/V16.lean +++ b/LeanPool/Zeta5Irrational/Table/V16.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V16: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V17.lean b/LeanPool/Zeta5Irrational/Table/V17.lean index e12cbbce01..81d96d99ba 100644 --- a/LeanPool/Zeta5Irrational/Table/V17.lean +++ b/LeanPool/Zeta5Irrational/Table/V17.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V17: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V18.lean b/LeanPool/Zeta5Irrational/Table/V18.lean index cb5d342781..276d415ca6 100644 --- a/LeanPool/Zeta5Irrational/Table/V18.lean +++ b/LeanPool/Zeta5Irrational/Table/V18.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V18: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V19.lean b/LeanPool/Zeta5Irrational/Table/V19.lean index 8ebb101544..5257b2a3a5 100644 --- a/LeanPool/Zeta5Irrational/Table/V19.lean +++ b/LeanPool/Zeta5Irrational/Table/V19.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V19: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V20.lean b/LeanPool/Zeta5Irrational/Table/V20.lean index 40cdf442e2..97fd264d85 100644 --- a/LeanPool/Zeta5Irrational/Table/V20.lean +++ b/LeanPool/Zeta5Irrational/Table/V20.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V20: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V21.lean b/LeanPool/Zeta5Irrational/Table/V21.lean index 136f0c5617..bdc6fec07c 100644 --- a/LeanPool/Zeta5Irrational/Table/V21.lean +++ b/LeanPool/Zeta5Irrational/Table/V21.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V21: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V22.lean b/LeanPool/Zeta5Irrational/Table/V22.lean index 53f9b3bd2c..50f80817c4 100644 --- a/LeanPool/Zeta5Irrational/Table/V22.lean +++ b/LeanPool/Zeta5Irrational/Table/V22.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V22: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V23.lean b/LeanPool/Zeta5Irrational/Table/V23.lean index e2031baf14..2e25f6e051 100644 --- a/LeanPool/Zeta5Irrational/Table/V23.lean +++ b/LeanPool/Zeta5Irrational/Table/V23.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V23: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V24.lean b/LeanPool/Zeta5Irrational/Table/V24.lean index 0f46be5c85..fd05571ed0 100644 --- a/LeanPool/Zeta5Irrational/Table/V24.lean +++ b/LeanPool/Zeta5Irrational/Table/V24.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V24: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V25.lean b/LeanPool/Zeta5Irrational/Table/V25.lean index 231a02e67f..e3cb556a35 100644 --- a/LeanPool/Zeta5Irrational/Table/V25.lean +++ b/LeanPool/Zeta5Irrational/Table/V25.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V25: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V26.lean b/LeanPool/Zeta5Irrational/Table/V26.lean index b0640a5cd1..77d3d6ea56 100644 --- a/LeanPool/Zeta5Irrational/Table/V26.lean +++ b/LeanPool/Zeta5Irrational/Table/V26.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V26: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V27.lean b/LeanPool/Zeta5Irrational/Table/V27.lean index 95edaa31c0..f4e81d7b1e 100644 --- a/LeanPool/Zeta5Irrational/Table/V27.lean +++ b/LeanPool/Zeta5Irrational/Table/V27.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V27: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V28.lean b/LeanPool/Zeta5Irrational/Table/V28.lean index 1ed7fb262f..6504c048de 100644 --- a/LeanPool/Zeta5Irrational/Table/V28.lean +++ b/LeanPool/Zeta5Irrational/Table/V28.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V28: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V29.lean b/LeanPool/Zeta5Irrational/Table/V29.lean index 972ce0cf57..a7254343d8 100644 --- a/LeanPool/Zeta5Irrational/Table/V29.lean +++ b/LeanPool/Zeta5Irrational/Table/V29.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V29: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V30.lean b/LeanPool/Zeta5Irrational/Table/V30.lean index e49ab6c62c..ff04e52e19 100644 --- a/LeanPool/Zeta5Irrational/Table/V30.lean +++ b/LeanPool/Zeta5Irrational/Table/V30.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V30: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V31.lean b/LeanPool/Zeta5Irrational/Table/V31.lean index 586b1241be..336081d1bf 100644 --- a/LeanPool/Zeta5Irrational/Table/V31.lean +++ b/LeanPool/Zeta5Irrational/Table/V31.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V31: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V32.lean b/LeanPool/Zeta5Irrational/Table/V32.lean index 479e51ab17..5858c0e0e9 100644 --- a/LeanPool/Zeta5Irrational/Table/V32.lean +++ b/LeanPool/Zeta5Irrational/Table/V32.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V32: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V33.lean b/LeanPool/Zeta5Irrational/Table/V33.lean index 90d2c22584..591dde5b46 100644 --- a/LeanPool/Zeta5Irrational/Table/V33.lean +++ b/LeanPool/Zeta5Irrational/Table/V33.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V33: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V34.lean b/LeanPool/Zeta5Irrational/Table/V34.lean index 6e18b124a7..b4ae148208 100644 --- a/LeanPool/Zeta5Irrational/Table/V34.lean +++ b/LeanPool/Zeta5Irrational/Table/V34.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V34: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V35.lean b/LeanPool/Zeta5Irrational/Table/V35.lean index 4fa073abe7..69de8b1f9a 100644 --- a/LeanPool/Zeta5Irrational/Table/V35.lean +++ b/LeanPool/Zeta5Irrational/Table/V35.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V35: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V36.lean b/LeanPool/Zeta5Irrational/Table/V36.lean index d305c5dbd1..072fd8fe0e 100644 --- a/LeanPool/Zeta5Irrational/Table/V36.lean +++ b/LeanPool/Zeta5Irrational/Table/V36.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V36: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V37.lean b/LeanPool/Zeta5Irrational/Table/V37.lean index 6460a76ad9..9b30852cee 100644 --- a/LeanPool/Zeta5Irrational/Table/V37.lean +++ b/LeanPool/Zeta5Irrational/Table/V37.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V37: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V38.lean b/LeanPool/Zeta5Irrational/Table/V38.lean index 8cd135a850..0528bcb733 100644 --- a/LeanPool/Zeta5Irrational/Table/V38.lean +++ b/LeanPool/Zeta5Irrational/Table/V38.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V38: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V39.lean b/LeanPool/Zeta5Irrational/Table/V39.lean index 36265ddc57..101e9ce067 100644 --- a/LeanPool/Zeta5Irrational/Table/V39.lean +++ b/LeanPool/Zeta5Irrational/Table/V39.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V39: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V40.lean b/LeanPool/Zeta5Irrational/Table/V40.lean index d4b56d0244..937f859c65 100644 --- a/LeanPool/Zeta5Irrational/Table/V40.lean +++ b/LeanPool/Zeta5Irrational/Table/V40.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V40: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V41.lean b/LeanPool/Zeta5Irrational/Table/V41.lean index 6f39f2a9ed..c3d9a151a5 100644 --- a/LeanPool/Zeta5Irrational/Table/V41.lean +++ b/LeanPool/Zeta5Irrational/Table/V41.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V41: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V42.lean b/LeanPool/Zeta5Irrational/Table/V42.lean index 96ea9aec6c..15f171cfd7 100644 --- a/LeanPool/Zeta5Irrational/Table/V42.lean +++ b/LeanPool/Zeta5Irrational/Table/V42.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V42: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V43.lean b/LeanPool/Zeta5Irrational/Table/V43.lean index b21d09223b..bbf1625a23 100644 --- a/LeanPool/Zeta5Irrational/Table/V43.lean +++ b/LeanPool/Zeta5Irrational/Table/V43.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V43: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V44.lean b/LeanPool/Zeta5Irrational/Table/V44.lean index 4aebdc9009..4c01681c5f 100644 --- a/LeanPool/Zeta5Irrational/Table/V44.lean +++ b/LeanPool/Zeta5Irrational/Table/V44.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V44: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V45.lean b/LeanPool/Zeta5Irrational/Table/V45.lean index 3ec6a7a05e..a75967ac6d 100644 --- a/LeanPool/Zeta5Irrational/Table/V45.lean +++ b/LeanPool/Zeta5Irrational/Table/V45.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V45: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V46.lean b/LeanPool/Zeta5Irrational/Table/V46.lean index fe9c667ead..cef951240e 100644 --- a/LeanPool/Zeta5Irrational/Table/V46.lean +++ b/LeanPool/Zeta5Irrational/Table/V46.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V46: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V47.lean b/LeanPool/Zeta5Irrational/Table/V47.lean index 1aa20d0c73..0b7b459634 100644 --- a/LeanPool/Zeta5Irrational/Table/V47.lean +++ b/LeanPool/Zeta5Irrational/Table/V47.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V47: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V48.lean b/LeanPool/Zeta5Irrational/Table/V48.lean index 544413654c..687ba98aef 100644 --- a/LeanPool/Zeta5Irrational/Table/V48.lean +++ b/LeanPool/Zeta5Irrational/Table/V48.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V48: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V49.lean b/LeanPool/Zeta5Irrational/Table/V49.lean index 4f09bc7e02..757278cfeb 100644 --- a/LeanPool/Zeta5Irrational/Table/V49.lean +++ b/LeanPool/Zeta5Irrational/Table/V49.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V49: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V50.lean b/LeanPool/Zeta5Irrational/Table/V50.lean index c4115afea9..f7a657bf89 100644 --- a/LeanPool/Zeta5Irrational/Table/V50.lean +++ b/LeanPool/Zeta5Irrational/Table/V50.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V50: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V51.lean b/LeanPool/Zeta5Irrational/Table/V51.lean index a29484a3a2..15f6303ad9 100644 --- a/LeanPool/Zeta5Irrational/Table/V51.lean +++ b/LeanPool/Zeta5Irrational/Table/V51.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V51: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V52.lean b/LeanPool/Zeta5Irrational/Table/V52.lean index f0def0ecbf..81640533dc 100644 --- a/LeanPool/Zeta5Irrational/Table/V52.lean +++ b/LeanPool/Zeta5Irrational/Table/V52.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V52: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V53.lean b/LeanPool/Zeta5Irrational/Table/V53.lean index 677793076f..af3a6867ae 100644 --- a/LeanPool/Zeta5Irrational/Table/V53.lean +++ b/LeanPool/Zeta5Irrational/Table/V53.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V53: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V54.lean b/LeanPool/Zeta5Irrational/Table/V54.lean index 048353cc50..f94ddd1569 100644 --- a/LeanPool/Zeta5Irrational/Table/V54.lean +++ b/LeanPool/Zeta5Irrational/Table/V54.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V54: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V55.lean b/LeanPool/Zeta5Irrational/Table/V55.lean index a948a96436..74c7dcbcce 100644 --- a/LeanPool/Zeta5Irrational/Table/V55.lean +++ b/LeanPool/Zeta5Irrational/Table/V55.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V55: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/Table/V56.lean b/LeanPool/Zeta5Irrational/Table/V56.lean index 3d6a859f7e..c2a8c57f8a 100644 --- a/LeanPool/Zeta5Irrational/Table/V56.lean +++ b/LeanPool/Zeta5Irrational/Table/V56.lean @@ -19,7 +19,7 @@ import Mathlib.Tactic.NormNum.Pow /-! # V56: certified bounds for the zeta(5) proof -/ -@[expose] public section +public section open Finset diff --git a/LeanPool/Zeta5Irrational/TableCheck.lean b/LeanPool/Zeta5Irrational/TableCheck.lean index b9be58f6b5..8dca698ea5 100644 --- a/LeanPool/Zeta5Irrational/TableCheck.lean +++ b/LeanPool/Zeta5Irrational/TableCheck.lean @@ -24,7 +24,7 @@ For each interval `[l, r]` of the partition of `(0, 2]`, the inequality `2Uρ(t) The tail `t ≥ 2` is handled by the elementary bound (6.8). -/ -@[expose] public section +public section open Filter Topology Set Finset diff --git a/LeanPool/Zeta5Irrational/Weight.lean b/LeanPool/Zeta5Irrational/Weight.lean index 5e7f807d2e..123ed905b1 100644 --- a/LeanPool/Zeta5Irrational/Weight.lean +++ b/LeanPool/Zeta5Irrational/Weight.lean @@ -25,18 +25,18 @@ import Mathlib.Tactic.Ring.RingNF `w(y) ≤ (32 y + 11) e^{-π y}` for `y > 0` (a crude form of (6.11)), and measurability on `(0, ∞)`. -/ -@[expose] public section +public section open MeasureTheory Set Filter Topology namespace Zeta5Irrational /-- The series `∑_{ℓ ≥ 1} ℓ⁴ e^{-2πℓy}`. -/ -noncomputable def wS (y : ℝ) : ℝ := +@[expose] noncomputable def wS (y : ℝ) : ℝ := ∑' ℓ : ℕ, ((ℓ : ℝ) + 1) ^ 4 * Real.exp (-(2 * Real.pi * ((ℓ : ℝ) + 1) * y)) /-- The weight `w(y) = (2π)⁴ y⁵ / 12 · ∑_{ℓ ≥ 1} ℓ⁴ e^{-2πℓy}` of (2.10). -/ -noncomputable def w (y : ℝ) : ℝ := +@[expose] noncomputable def w (y : ℝ) : ℝ := (2 * Real.pi) ^ 4 * y ^ 5 / 12 * wS y lemma summable_w_term {y : ℝ} (hy : 0 < y) : diff --git a/LeanPool/Zeta5Irrational/ZeroMass.lean b/LeanPool/Zeta5Irrational/ZeroMass.lean index 242ed4fe1e..caf24f31c6 100644 --- a/LeanPool/Zeta5Irrational/ZeroMass.lean +++ b/LeanPool/Zeta5Irrational/ZeroMass.lean @@ -34,24 +34,24 @@ For the truncated kernel `Ltr a b r = (1/2) ∫_a^b (e^{-s} - e^{-s r²})/s ds` positivity argument of the paper. -/ -@[expose] public section +public section open MeasureTheory Set Real intervalIntegral namespace Zeta5Irrational /-- The truncated logarithmic kernel `L_{a,b}(r)`. -/ -noncomputable def Ltr (a b r : ℝ) : ℝ := +@[expose] noncomputable def Ltr (a b r : ℝ) : ℝ := (1 / 2) * ∫ s in a..b, (Real.exp (-s) - Real.exp (-s * r ^ 2)) / s variable {ι : Type*} /-- Double integral of a kernel against two atoms. -/ -noncomputable def pairInt (γ : ι → ℝ → ℂ) (f : ℂ → ℂ → ℝ) (k l : ι) : ℝ := +@[expose] noncomputable def pairInt (γ : ι → ℝ → ℂ) (f : ℂ → ℂ → ℝ) (k l : ι) : ℝ := ∫ θ in (0 : ℝ)..2 * π, ∫ φ in (0 : ℝ)..2 * π, f (γ k θ) (γ l φ) /-- The energy of the signed combination of atoms. -/ -noncomputable def energy [Fintype ι] (s : ι → ℝ) (γ : ι → ℝ → ℂ) (f : ℂ → ℂ → ℝ) : ℝ := +@[expose] noncomputable def energy [Fintype ι] (s : ι → ℝ) (γ : ι → ℝ → ℂ) (f : ℂ → ℂ → ℝ) : ℝ := ∑ k, ∑ l, s k * s l * pairInt γ f k l /-- Gaussian pair integral. -/ diff --git a/LeanPool/Zeta5Irrational/Zeta5.lean b/LeanPool/Zeta5Irrational/Zeta5.lean index f205de76ed..ccdd128626 100644 --- a/LeanPool/Zeta5Irrational/Zeta5.lean +++ b/LeanPool/Zeta5Irrational/Zeta5.lean @@ -14,12 +14,12 @@ import Mathlib.Tactic.NormNum.Pow /-! # `ζ(5)` as a real number -/ -@[expose] public section +public section namespace Zeta5Irrational /-- `ζ(5)` as a real number. -/ -noncomputable def zeta5 : ℝ := +@[expose] noncomputable def zeta5 : ℝ := ∑' n : ℕ, 1 / (n : ℝ) ^ 5 /-- Mathlib's `riemannZeta 5` is the real number `zeta5`. -/ diff --git a/LeanPool/ZetaH123.lean b/LeanPool/ZetaH123.lean index ad527b7b27..1280ae06b6 100644 --- a/LeanPool/ZetaH123.lean +++ b/LeanPool/ZetaH123.lean @@ -25,4 +25,4 @@ Tags: number-theory, function-fields, zeta-functions MSC: 11M38, 11T55, 11G09 -/ -@[expose] public section +public section diff --git a/LeanPool/ZetaH123/H1.lean b/LeanPool/ZetaH123/H1.lean index 5f49f7b9b6..554d2e1a5e 100644 --- a/LeanPool/ZetaH123/H1.lean +++ b/LeanPool/ZetaH123/H1.lean @@ -25,7 +25,7 @@ import Mathlib.Topology.MetricSpace.Bounded # H1 for Thakur's hypotheses on power sums -/ -@[expose] public section +public section namespace ZetaH123.H1 diff --git a/LeanPool/ZetaH123/H2.lean b/LeanPool/ZetaH123/H2.lean index e848af2549..9902c1199a 100644 --- a/LeanPool/ZetaH123/H2.lean +++ b/LeanPool/ZetaH123/H2.lean @@ -26,7 +26,7 @@ import Mathlib.Topology.MetricSpace.Bounded # H2 for Thakur's hypotheses on power sums -/ -@[expose] public section +public section namespace ZetaH123.H2 diff --git a/LeanPool/ZetaH123/H3.lean b/LeanPool/ZetaH123/H3.lean index 0513e25a1e..4ae660e695 100644 --- a/LeanPool/ZetaH123/H3.lean +++ b/LeanPool/ZetaH123/H3.lean @@ -24,7 +24,7 @@ import Mathlib.Topology.MetricSpace.Bounded # H3 for Thakur's hypotheses on power sums -/ -@[expose] public section +public section namespace ZetaH123.H3 diff --git a/LeanPool/ZetaH123/Lem41.lean b/LeanPool/ZetaH123/Lem41.lean index 65b76092c8..faa67a92c5 100644 --- a/LeanPool/ZetaH123/Lem41.lean +++ b/LeanPool/ZetaH123/Lem41.lean @@ -26,7 +26,7 @@ import Mathlib.Topology.MetricSpace.Bounded # Lemma 4.1 for Thakur's hypotheses on power sums -/ -@[expose] public section +public section namespace ZetaH123.Lem41 diff --git a/LeanPool/ZetaZeros.lean b/LeanPool/ZetaZeros.lean index e997e6dac6..26f319a9c0 100644 --- a/LeanPool/ZetaZeros.lean +++ b/LeanPool/ZetaZeros.lean @@ -22,4 +22,4 @@ Tags: analytic-number-theory, riemann-zeta-function, critical-line, simple-zeros MSC: 11M06, 11M26 -/ -@[expose] public section +public section diff --git a/LeanPool/ZetaZeros/Defs.lean b/LeanPool/ZetaZeros/Defs.lean index 398dea2292..363ef90581 100644 --- a/LeanPool/ZetaZeros/Defs.lean +++ b/LeanPool/ZetaZeros/Defs.lean @@ -21,40 +21,39 @@ named after whichever definition in the *module* first needed it, so splitting t modules gives them names a single self-contained file cannot reproduce. -/ -@[expose] public section +public section namespace ZetaZeros /-- The non-trivial zeros of the Riemann zeta function with imaginary part in `(0, T]`: the zeros lying in the critical strip `0 < re s < 1`, as a set, so without multiplicity. -/ -@[zz_tag "def_nontrivial_zeros"] +@[expose, zz_tag "def_nontrivial_zeros"] def nontrivialZeros (T : ℝ) : Set ℂ := {ρ | riemannZeta ρ = 0 ∧ 0 < ρ.re ∧ ρ.re < 1 ∧ 0 < ρ.im ∧ ρ.im ≤ T} /-- The multiplicity of `ρ` as a zero of the Riemann zeta function, i.e. its order of vanishing there. -/ -@[zz_tag "def_multiplicity"] +@[expose, zz_tag "def_multiplicity"] noncomputable def zeroMultiplicity (ρ : ℂ) : ℕ := analyticOrderNatAt riemannZeta ρ /-- The number of non-trivial zeros with imaginary part in `(0, T]`, counted with multiplicity. This is `N T` in the source. -/ -@[zz_tag "def_N"] +@[expose, zz_tag "def_N"] noncomputable def zeroCount (T : ℝ) : ℕ := ∑ᶠ ρ ∈ nontrivialZeros T, zeroMultiplicity ρ /-- The number of non-trivial zeros with imaginary part in `(0, T]` that are simple and lie on the critical line `re s = 1/2`. This is `N₀ˢ T` in the source. -/ -@[zz_tag "def_N_simple"] +@[expose, zz_tag "def_N_simple"] noncomputable def simpleOnLineCount (T : ℝ) : ℕ := {ρ ∈ nontrivialZeros T | ρ.re = 1 / 2 ∧ zeroMultiplicity ρ = 1}.ncard /-- The number of distinct non-trivial zeros with imaginary part in `(0, T]`. This is `N_d T` in the source. -/ -@[zz_tag "def_N_distinct"] +@[expose, zz_tag "def_N_distinct"] noncomputable def distinctZeroCount (T : ℝ) : ℕ := (nontrivialZeros T).ncard /-- The Fourier transform of a compactly supported real function, at a complex argument. -/ -@[zz_tag "def_fourier"] -noncomputable def fourierC (f : ℝ → ℝ) (ξ : ℂ) : ℂ := +@[expose, zz_tag "def_fourier"] noncomputable def fourierC (f : ℝ → ℝ) (ξ : ℂ) : ℂ := ∫ u : ℝ, (f u : ℂ) * Complex.exp (-(2 * (Real.pi : ℂ)) * Complex.I * ξ * (u : ℂ)) /-- `eta` is `lam`-admissible: square-integrable, real-valued, even, supported in @@ -71,7 +70,7 @@ structure IsAdmissible (lam : ℝ) (eta : ℝ → ℝ) : Prop where fourier_sq_zero : fourierC (eta ^ 2) 0 = 1 /-- The kernel of a test function, `K_eta = fourier transform of eta squared`. -/ -@[zz_tag "def_kernel"] +@[expose, zz_tag "def_kernel"] noncomputable def testKernel (eta : ℝ → ℝ) : ℂ → ℂ := fourierC (eta ^ 2) /-- The support `Z` with multiplicities `m` is conjugation-invariant: every multiplicity is at @@ -86,30 +85,28 @@ structure IsConjInvariant (Z : Finset ℂ) (m : ℂ → ℕ) : Prop where mult_conj : ∀ z ∈ Z, m ((starRingEnd ℂ) z) = m z /-- The simple real part of the support: real points of multiplicity one. -/ -@[zz_tag "def_R1"] -noncomputable def simpleRealPart (Z : Finset ℂ) (m : ℂ → ℕ) : Finset ℂ := +@[expose, zz_tag "def_R1"] noncomputable def simpleRealPart (Z : Finset ℂ) (m : ℂ → ℕ) : Finset ℂ := Z.filter fun x => x.im = 0 ∧ m x = 1 /-- The weight `4 / (4 - z²)` carried by the unconditional pair-correlation formula. -/ -@[zz_tag "def_w"] -noncomputable def pairWeight (z : ℂ) : ℂ := 4 / (4 - z ^ 2) +@[expose, zz_tag "def_w"] noncomputable def pairWeight (z : ℂ) : ℂ := 4 / (4 - z ^ 2) /-- The rescaled difference `i(ρ - ρ') log T / (2π)` of two zeros. -/ -@[zz_tag "def_z_rho"] -noncomputable def rescaledDiff (T : ℝ) (ρ ρ' : ℂ) : ℂ := +@[expose, zz_tag "def_z_rho"] noncomputable def rescaledDiff (T : ℝ) (ρ ρ' : ℂ) : ℂ := Complex.I * (ρ - ρ') * ((Real.log T / (2 * Real.pi) : ℝ) : ℂ) /-- The weighted sum of `fourierC f` over ordered pairs of non-trivial zeros with imaginary part in `(0, T]`, each zero counted with multiplicity. -/ -@[zz_tag "def_B_T"] +@[expose, zz_tag "def_B_T"] noncomputable def pairCorrelationSum (f : ℝ → ℝ) (T : ℝ) : ℂ := ∑ᶠ ρ ∈ nontrivialZeros T, ∑ᶠ ρ' ∈ nontrivialZeros T, ((zeroMultiplicity ρ * zeroMultiplicity ρ' : ℕ) : ℂ) * fourierC f (rescaledDiff T ρ ρ') * pairWeight (ρ - ρ') /-- The main term `f 0 + 2 ∫₀¹ α f α` of the pair-correlation formula. -/ -@[zz_tag "def_A_functional"] -noncomputable def pairMainTerm (f : ℝ → ℝ) : ℝ := f 0 + 2 * ∫ α in (0:ℝ)..1, α * f α +@[expose, zz_tag "def_A_functional"] +noncomputable def pairMainTerm (f : ℝ → ℝ) : ℝ := + f 0 + 2 * ∫ α in (0:ℝ)..1, α * f α /-- A test function admissible in the pair-correlation formula: even, integrable, supported in `[-1, 1]`, and Lipschitz at the origin. @@ -117,7 +114,7 @@ noncomputable def pairMainTerm (f : ℝ → ℝ) : ℝ := f 0 + 2 * ∫ α in (0 The Lipschitz condition is imposed globally rather than only at `0`. That makes this predicate *stronger*, hence `PairCorrelation` weaker and safer to assume — and the cited lemma still supplies it. -/ -def IsPairTestFunction (f : ℝ → ℝ) : Prop := +@[expose] def IsPairTestFunction (f : ℝ → ℝ) : Prop := (∀ x, f (-x) = f x) ∧ MeasureTheory.Integrable f ∧ (∀ x, 1 < |x| → f x = 0) ∧ ∃ C : ℝ, ∀ x, |f x - f 0| ≤ C * |x| @@ -129,7 +126,7 @@ every result depending on it names it in its own statement. -/ /-- **Riemann--von Mangoldt** (`lem_rvm`, external input). `N T ∼ (T / 2π) log T`. -/ -@[zz_tag "lem_rvm"] +@[expose, zz_tag "lem_rvm"] def RiemannVonMangoldt : Prop := ∀ ε > 0, ∃ T₀ : ℝ, ∀ T ≥ T₀, |(zeroCount T : ℝ) / (T / (2 * Real.pi) * Real.log T) - 1| < ε @@ -139,7 +136,7 @@ function the weighted pair-correlation sum is `(T / 2π) log T` times its main t `O(1 / √log T)`. Lemma 5 of Baluyot--Goldston--Suriajaya--Turnage-Butterbaugh, *An unconditional Montgomery theorem for pair correlation of zeros of the Riemann zeta-function*, Acta Arith. 214 (2024), 357--376. -/ -@[zz_tag "lem_bgst"] +@[expose, zz_tag "lem_bgst"] def PairCorrelation : Prop := ∀ f : ℝ → ℝ, IsPairTestFunction f → ∃ C : ℝ, 0 < C ∧ ∃ T₀ : ℝ, ∀ T ≥ T₀, diff --git a/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean b/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean index ba6b520bba..699396f3a2 100644 --- a/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean +++ b/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean @@ -32,7 +32,7 @@ Bochner integral is unconditional, so a separable integrand factors by two such by Fubini. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/Basis.lean b/LeanPool/ZetaZeros/Hilbert/Basis.lean index f8494f063f..1cec715987 100644 --- a/LeanPool/ZetaZeros/Hilbert/Basis.lean +++ b/LeanPool/ZetaZeros/Hilbert/Basis.lean @@ -21,7 +21,7 @@ The three subspaces are finite-dimensional — each is spanned by a finite famil makes `Module.finrank` the right index bound and Gram–Schmidt applicable. -/ -@[expose] public section +public section namespace ZetaZeros @@ -64,14 +64,14 @@ structure IsAdaptedBasis (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ /-- The Bessel coefficient of a single `L²` element: the coefficient of the two-variable kernel against its tensor square. -/ -@[zz_tag "def_alpha"] +@[expose, zz_tag "def_alpha"] noncomputable def alphaOf (eta : ℝ → ℝ) (lam : ℝ) (Z : Finset ℂ) (m : ℂ → ℕ) (psi : L2Interval lam) : ℂ := ∫ u in Set.Ioo (-lam) lam, ∫ v in Set.Ioo (-lam) lam, bigF eta Z m u v * (starRingEnd ℂ) ((psi : ℝ → ℂ) u * (psi : ℝ → ℂ) v) /-- The indexed form of `alphaOf`. -/ -noncomputable def alphaCoeff (eta : ℝ → ℝ) (lam : ℝ) (Z : Finset ℂ) (m : ℂ → ℕ) +@[expose] noncomputable def alphaCoeff (eta : ℝ → ℝ) (lam : ℝ) (Z : Finset ℂ) (m : ℂ → ℕ) (psi : ℕ → L2Interval lam) (j : ℕ) : ℂ := alphaOf eta lam Z m (psi j) end ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/Defs.lean b/LeanPool/ZetaZeros/Hilbert/Defs.lean index eaf9b5d6f8..8656f72ca9 100644 --- a/LeanPool/ZetaZeros/Hilbert/Defs.lean +++ b/LeanPool/ZetaZeros/Hilbert/Defs.lean @@ -24,44 +24,41 @@ sum over the whole non-real part equals twice a sum over representatives, with n representatives to make. -/ -@[expose] public section +public section namespace ZetaZeros /-- The Fourier transform of a compactly supported real function, at a complex argument. -/ -@[zz_tag "def_f_z"] -noncomputable def fz (eta : ℝ → ℝ) (z : ℂ) (u : ℝ) : ℂ := +@[expose, zz_tag "def_f_z"] noncomputable def fz (eta : ℝ → ℝ) (z : ℂ) (u : ℝ) : ℂ := (eta u : ℂ) * Complex.exp (-(2 * (Real.pi : ℂ)) * Complex.I * (u : ℂ) * z) /-- The even part of the twisted pair, `gz = (fz z + fz (conj z)) / 2`. -/ -@[zz_tag "def_g_z"] -noncomputable def gz (eta : ℝ → ℝ) (z : ℂ) (u : ℝ) : ℂ := +@[expose, zz_tag "def_g_z"] noncomputable def gz (eta : ℝ → ℝ) (z : ℂ) (u : ℝ) : ℂ := (fz eta z u + fz eta ((starRingEnd ℂ) z) u) / 2 /-- The odd part of the twisted pair, `hz = (fz z - fz (conj z)) / (2i)`. -/ -@[zz_tag "def_h_z"] -noncomputable def hz (eta : ℝ → ℝ) (z : ℂ) (u : ℝ) : ℂ := +@[expose, zz_tag "def_h_z"] noncomputable def hz (eta : ℝ → ℝ) (z : ℂ) (u : ℝ) : ℂ := (fz eta z u - fz eta ((starRingEnd ℂ) z) u) / (2 * Complex.I) /-- A function `ℝ → ℂ` is symmetric when conjugation acts as reflection: `conj (Φ u) = Φ (-u)`. The property is preserved by Gram–Schmidt and is what makes the Bessel coefficients real. -/ -@[zz_tag "def_symmetric"] -def IsSymmetric (Φ : ℝ → ℂ) : Prop := ∀ u : ℝ, (starRingEnd ℂ) (Φ u) = Φ (-u) +@[expose, zz_tag "def_symmetric"] +def IsSymmetric (Φ : ℝ → ℂ) : Prop := + ∀ u : ℝ, (starRingEnd ℂ) (Φ u) = Φ (-u) /-- The two-variable kernel `F (u, v) = ∑ z, m z * fz z u * fz z v`, the multiset sum written with explicit multiplicities. -/ -@[zz_tag "def_F"] +@[expose, zz_tag "def_F"] noncomputable def bigF (eta : ℝ → ℝ) (Z : Finset ℂ) (m : ℂ → ℕ) (u v : ℝ) : ℂ := ∑ z ∈ Z, (m z : ℂ) * fz eta z u * fz eta z v /-- The simple real part of the support: real points of multiplicity one. -/ -@[zz_tag "def_R2"] +@[expose, zz_tag "def_R2"] noncomputable def multipleRealPart (Z : Finset ℂ) (m : ℂ → ℕ) : Finset ℂ := Z.filter fun x => x.im = 0 ∧ 2 ≤ m x /-- The non-real part of the support. -/ -@[zz_tag "def_S"] -noncomputable def nonRealPart (Z : Finset ℂ) : Finset ℂ := +@[expose, zz_tag "def_S"] noncomputable def nonRealPart (Z : Finset ℂ) : Finset ℂ := Z.filter fun z => z.im ≠ 0 /-- The even part is conjugation-invariant. -/ diff --git a/LeanPool/ZetaZeros/Hilbert/Dimensions.lean b/LeanPool/ZetaZeros/Hilbert/Dimensions.lean index 1613f16eb2..618cfe4ae9 100644 --- a/LeanPool/ZetaZeros/Hilbert/Dimensions.lean +++ b/LeanPool/ZetaZeros/Hilbert/Dimensions.lean @@ -24,7 +24,7 @@ This is the bound that turns the source's second-range estimate into a statement simple real elements — the quantity the whole proposition is about. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/FIdentity.lean b/LeanPool/ZetaZeros/Hilbert/FIdentity.lean index 763f49be38..c52d357811 100644 --- a/LeanPool/ZetaZeros/Hilbert/FIdentity.lean +++ b/LeanPool/ZetaZeros/Hilbert/FIdentity.lean @@ -23,7 +23,7 @@ conjugation-invariant and `hz` anti-invariant. So the cross terms cancel in pair This is the step that lets the source's factor of two over conjugate pairs disappear entirely. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/InnerReal.lean b/LeanPool/ZetaZeros/Hilbert/InnerReal.lean index e8670b592c..a5767fa8bc 100644 --- a/LeanPool/ZetaZeros/Hilbert/InnerReal.lean +++ b/LeanPool/ZetaZeros/Hilbert/InnerReal.lean @@ -20,7 +20,7 @@ every inner product formed from symmetric functions is real, because conjugating reflecting the interval, and the interval `(-lam, lam)` is reflection-invariant. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/InnerRealL2.lean b/LeanPool/ZetaZeros/Hilbert/InnerRealL2.lean index 4d1990bb01..55f1d51140 100644 --- a/LeanPool/ZetaZeros/Hilbert/InnerRealL2.lean +++ b/LeanPool/ZetaZeros/Hilbert/InnerRealL2.lean @@ -26,7 +26,7 @@ With this, "the Gram–Schmidt coefficients are real" becomes a fact about the a what lets the process stay inside `symmetricSubspace`. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/Integrals.lean b/LeanPool/ZetaZeros/Hilbert/Integrals.lean index f06b72fc97..7e0c0ab4fc 100644 --- a/LeanPool/ZetaZeros/Hilbert/Integrals.lean +++ b/LeanPool/ZetaZeros/Hilbert/Integrals.lean @@ -20,7 +20,7 @@ literally the inner product of the ambient Hilbert space; `fourierC` integrates the two agree because an admissible test function vanishes off the interval. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/L2.lean b/LeanPool/ZetaZeros/Hilbert/L2.lean index 48c06dbb85..125fc68c8a 100644 --- a/LeanPool/ZetaZeros/Hilbert/L2.lean +++ b/LeanPool/ZetaZeros/Hilbert/L2.lean @@ -27,7 +27,7 @@ Also here: the passage from the rescaled zeros as a `Set` to the `Finset` that `IsConjInvariant` requires. -/ -@[expose] public section +public section namespace ZetaZeros @@ -108,7 +108,7 @@ theorem memLp_hz (h : IsAdmissible lam eta) (z : ℂ) : /-- The rescaled zeros as a `Finset`, which is what `IsConjInvariant` and the key proposition take. The rescaled zeros are defined as a `Set`; finiteness of the zero set is what bridges the two. -/ -noncomputable def rescaledZerosFinset (T : ℝ) : Finset ℂ := +@[expose] noncomputable def rescaledZerosFinset (T : ℝ) : Finset ℂ := (nontrivialZeros_finite T).toFinset.image (rescale T) @[simp] diff --git a/LeanPool/ZetaZeros/Hilbert/Subspaces.lean b/LeanPool/ZetaZeros/Hilbert/Subspaces.lean index 4a1d6fdeda..27ce17eb7f 100644 --- a/LeanPool/ZetaZeros/Hilbert/Subspaces.lean +++ b/LeanPool/ZetaZeros/Hilbert/Subspaces.lean @@ -24,7 +24,7 @@ conjugation-anti-invariant, so the span is unchanged — and it removes the enum `z₁, conj z₁, …, z_k, conj z_k` that the source has to carry. -/ -@[expose] public section +public section namespace ZetaZeros @@ -36,36 +36,36 @@ variable {lam : ℝ} {eta : ℝ → ℝ} noncomputable abbrev L2Interval (lam : ℝ) := Lp ℂ 2 (volume.restrict (Set.Ioo (-lam) lam)) /-- The twisted function as an element of `L²`. -/ -noncomputable def fzL2 (h : IsAdmissible lam eta) (z : ℂ) : L2Interval lam := +@[expose] noncomputable def fzL2 (h : IsAdmissible lam eta) (z : ℂ) : L2Interval lam := MemLp.toLp _ (memLp_fz h z) /-- The even part as an element of `L²`. -/ -noncomputable def gzL2 (h : IsAdmissible lam eta) (z : ℂ) : L2Interval lam := +@[expose] noncomputable def gzL2 (h : IsAdmissible lam eta) (z : ℂ) : L2Interval lam := MemLp.toLp _ (memLp_gz h z) /-- The odd part as an element of `L²`. -/ -noncomputable def hzL2 (h : IsAdmissible lam eta) (z : ℂ) : L2Interval lam := +@[expose] noncomputable def hzL2 (h : IsAdmissible lam eta) (z : ℂ) : L2Interval lam := MemLp.toLp _ (memLp_hz h z) /-- The first subspace, spanned by the twisted functions at the multiple real points together with the even parts at the non-real points. -/ -@[zz_tag "def_U"] -noncomputable def subspaceU (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ → ℕ) : +@[expose, zz_tag "def_U"] noncomputable def subspaceU + (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ → ℕ) : Submodule ℂ (L2Interval lam) := Submodule.span ℂ ((fzL2 h '' (multipleRealPart Z m : Set ℂ)) ∪ (gzL2 h '' (nonRealPart Z : Set ℂ))) /-- The second subspace, adding the twisted functions at the simple real points. -/ -@[zz_tag "def_V"] -noncomputable def subspaceV (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ → ℕ) : +@[expose, zz_tag "def_V"] noncomputable def subspaceV + (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ → ℕ) : Submodule ℂ (L2Interval lam) := Submodule.span ℂ ((fzL2 h '' ((simpleRealPart Z m ∪ multipleRealPart Z m : Finset ℂ) : Set ℂ)) ∪ (gzL2 h '' (nonRealPart Z : Set ℂ))) /-- The third subspace, adding the odd parts at the non-real points. -/ -@[zz_tag "def_W"] -noncomputable def subspaceW (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ → ℕ) : +@[expose, zz_tag "def_W"] noncomputable def subspaceW + (h : IsAdmissible lam eta) (Z : Finset ℂ) (m : ℂ → ℕ) : Submodule ℂ (L2Interval lam) := Submodule.span ℂ ((fzL2 h '' ((simpleRealPart Z m ∪ multipleRealPart Z m : Finset ℂ) : Set ℂ)) diff --git a/LeanPool/ZetaZeros/Hilbert/Symmetry.lean b/LeanPool/ZetaZeros/Hilbert/Symmetry.lean index 2730acf01f..9e068b6d81 100644 --- a/LeanPool/ZetaZeros/Hilbert/Symmetry.lean +++ b/LeanPool/ZetaZeros/Hilbert/Symmetry.lean @@ -20,7 +20,7 @@ Everything here follows from one computation, `conj_fz`: conjugating `fz eta z` argument and conjugates the twist. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Hilbert/SymmetryL2.lean b/LeanPool/ZetaZeros/Hilbert/SymmetryL2.lean index 008e7b1aad..cd33f2bc68 100644 --- a/LeanPool/ZetaZeros/Hilbert/SymmetryL2.lean +++ b/LeanPool/ZetaZeros/Hilbert/SymmetryL2.lean @@ -24,7 +24,7 @@ the structure the Gram–Schmidt argument needs, since its coefficients are real `inner_symmetric_im_eq_zero` and so it never leaves the subspace. -/ -@[expose] public section +public section namespace ZetaZeros @@ -47,11 +47,11 @@ theorem ae_restrict_Ioo_neg {P : ℝ → Prop} exact ⟨by linarith, by linarith⟩ /-- Almost-everywhere symmetry for an element of `L²`. -/ -def IsSymmetricL2 (f : L2Interval lam) : Prop := +@[expose] def IsSymmetricL2 (f : L2Interval lam) : Prop := ∀ᵐ u ∂(volume.restrict (Set.Ioo (-lam) lam)), (starRingEnd ℂ) (f u) = f (-u) /-- The symmetric elements form an `ℝ`-subspace of `L²`. -/ -noncomputable def symmetricSubspace (lam : ℝ) : Submodule ℝ (L2Interval lam) where +@[expose] noncomputable def symmetricSubspace (lam : ℝ) : Submodule ℝ (L2Interval lam) where carrier := {f | IsSymmetricL2 f} zero_mem' := by have hz := Lp.coeFn_zero ℂ 2 (volume.restrict (Set.Ioo (-lam) lam)) diff --git a/LeanPool/ZetaZeros/Main.lean b/LeanPool/ZetaZeros/Main.lean index a5db6760e6..0b9188ebce 100644 --- a/LeanPool/ZetaZeros/Main.lean +++ b/LeanPool/ZetaZeros/Main.lean @@ -20,7 +20,7 @@ This combines the kernel construction, the finite-set bounds transferred to zeta Riemann--von Mangoldt asymptotic to obtain the two asymptotic proportion bounds. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/MontgomeryTaylor/AffineKernel.lean b/LeanPool/ZetaZeros/MontgomeryTaylor/AffineKernel.lean index 5df6d097e5..ca149178d1 100644 --- a/LeanPool/ZetaZeros/MontgomeryTaylor/AffineKernel.lean +++ b/LeanPool/ZetaZeros/MontgomeryTaylor/AffineKernel.lean @@ -17,7 +17,7 @@ The heart of the computation: the modulus kernel differentiates twice to `2 f_0 `f_0'' = -2 f_0`, so `G'' = 0` and `G` is affine; being even, it is constant. -/ -@[expose] public section +public section open MeasureTheory @@ -25,7 +25,7 @@ namespace ZetaZeros /-- The auxiliary kernel `G(u) = f₀(u) + ∫_{-1/2}^{1/2} |u - v| f₀(v) dv`, which is constant on `[-1/2, 1/2]`. -/ -noncomputable def extremalG (u : ℝ) : ℝ := +@[expose] noncomputable def extremalG (u : ℝ) : ℝ := extremalTest u + ∫ v in (-(1:ℝ)/2)..(1/2), |u - v| * extremalTest v /-! diff --git a/LeanPool/ZetaZeros/MontgomeryTaylor/Basic.lean b/LeanPool/ZetaZeros/MontgomeryTaylor/Basic.lean index 3d46afd9e8..d78f2dbae7 100644 --- a/LeanPool/ZetaZeros/MontgomeryTaylor/Basic.lean +++ b/LeanPool/ZetaZeros/MontgomeryTaylor/Basic.lean @@ -24,7 +24,7 @@ The three preceding files supply the pieces: the functional is the integral of ` `f_0` of total mass one, the integral collapses to the constant. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ZetaZeros/MontgomeryTaylor/Evaluation.lean b/LeanPool/ZetaZeros/MontgomeryTaylor/Evaluation.lean index f880842654..bc15a5180d 100644 --- a/LeanPool/ZetaZeros/MontgomeryTaylor/Evaluation.lean +++ b/LeanPool/ZetaZeros/MontgomeryTaylor/Evaluation.lean @@ -16,7 +16,7 @@ import Mathlib.Analysis.Real.Pi.Bounds `G 0 = f_0 0 + integral of |v| f_0 v`, elementary by parts, and the trigonometry collapses. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ZetaZeros/MontgomeryTaylor/Integrability.lean b/LeanPool/ZetaZeros/MontgomeryTaylor/Integrability.lean index 2a5d1b350d..ed2f5ffcb8 100644 --- a/LeanPool/ZetaZeros/MontgomeryTaylor/Integrability.lean +++ b/LeanPool/ZetaZeros/MontgomeryTaylor/Integrability.lean @@ -15,7 +15,7 @@ Side conditions only: `f_0` against the linear, `max` and shifted-`max` kernels interval-integrable, and the outer integral needs a continuous integrand. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ZetaZeros/MontgomeryTaylor/Reduction.lean b/LeanPool/ZetaZeros/MontgomeryTaylor/Reduction.lean index 8e622d9bfc..5c34c6fc3c 100644 --- a/LeanPool/ZetaZeros/MontgomeryTaylor/Reduction.lean +++ b/LeanPool/ZetaZeros/MontgomeryTaylor/Reduction.lean @@ -17,7 +17,7 @@ import Mathlib.Analysis.Real.Pi.Bounds `|u - v| f_0 u f_0 v`; added, they are the integral of `f_0` against `G`. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ZetaZeros/MontgomeryTaylor/TestFunction.lean b/LeanPool/ZetaZeros/MontgomeryTaylor/TestFunction.lean index 27eeafa43d..e38ccdb792 100644 --- a/LeanPool/ZetaZeros/MontgomeryTaylor/TestFunction.lean +++ b/LeanPool/ZetaZeros/MontgomeryTaylor/TestFunction.lean @@ -15,7 +15,7 @@ import Mathlib.Analysis.Real.Pi.Bounds continuous on its support. Every later step rests on these, and none mentions the functional. -/ -@[expose] public section +public section open MeasureTheory diff --git a/LeanPool/ZetaZeros/Numeric/MontgomeryTaylor.lean b/LeanPool/ZetaZeros/Numeric/MontgomeryTaylor.lean index 97a91888ca..f4959c89cc 100644 --- a/LeanPool/ZetaZeros/Numeric/MontgomeryTaylor.lean +++ b/LeanPool/ZetaZeros/Numeric/MontgomeryTaylor.lean @@ -18,7 +18,7 @@ no estimate at an irrational argument: five terms bound the first from above, fo from below, and the gap to `1.3275` is about `7 · 10⁻⁷`. -/ -@[expose] public section +public section namespace ZetaZeros @@ -28,7 +28,7 @@ open Filter Finset open scoped Nat /-- The Montgomery–Taylor constant `1/2 + (1/√2) cot(1/√2) = 1.3274992963…`. -/ -@[zz_tag "def_C_MT"] +@[expose, zz_tag "def_C_MT"] noncomputable def montgomeryTaylorConst : ℝ := 1 / 2 + (1 / Real.sqrt 2) * Real.cot (1 / Real.sqrt 2) diff --git a/LeanPool/ZetaZeros/Zeta/Asymptotics.lean b/LeanPool/ZetaZeros/Zeta/Asymptotics.lean index 1e6e024a28..accaf2a903 100644 --- a/LeanPool/ZetaZeros/Zeta/Asymptotics.lean +++ b/LeanPool/ZetaZeros/Zeta/Asymptotics.lean @@ -14,14 +14,14 @@ This file turns the epsilon-form external input into the filter form used by the argument and records the eventual positivity needed to divide by the zero count. -/ -@[expose] public section +public section namespace ZetaZeros open Filter Topology /-- The main scale in the Riemann--von Mangoldt and pair-correlation formulae. -/ -noncomputable def zeroScale (T : ℝ) : ℝ := T / (2 * Real.pi) * Real.log T +@[expose] noncomputable def zeroScale (T : ℝ) : ℝ := T / (2 * Real.pi) * Real.log T /-- The Riemann--von Mangoldt scale is positive at all sufficiently large heights. -/ theorem zeroScale_pos_eventually : ∀ᶠ T in atTop, 0 < zeroScale T := by diff --git a/LeanPool/ZetaZeros/Zeta/Basic.lean b/LeanPool/ZetaZeros/Zeta/Basic.lean index 7e2c87fdac..7b5de724f8 100644 --- a/LeanPool/ZetaZeros/Zeta/Basic.lean +++ b/LeanPool/ZetaZeros/Zeta/Basic.lean @@ -24,7 +24,7 @@ compactly supported in `(-1/2, 1/2)` and even — and then so is the self-convol `(-1, 1)`, together with its second derivative. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Zeta/Cutoff.lean b/LeanPool/ZetaZeros/Zeta/Cutoff.lean index 42dfbf8c5d..b9eeeef5be 100644 --- a/LeanPool/ZetaZeros/Zeta/Cutoff.lean +++ b/LeanPool/ZetaZeros/Zeta/Cutoff.lean @@ -19,7 +19,7 @@ comes free from `ContDiffBump.neg`, and the two radius conditions are what `0 < supplies. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Zeta/Defs.lean b/LeanPool/ZetaZeros/Zeta/Defs.lean index 871935cdc3..8565feb2b6 100644 --- a/LeanPool/ZetaZeros/Zeta/Defs.lean +++ b/LeanPool/ZetaZeros/Zeta/Defs.lean @@ -20,7 +20,7 @@ and a challenge that spell one notion two ways name two constants, and the pair nothing while every other gate stays green. -/ -@[expose] public section +public section namespace ZetaZeros @@ -28,28 +28,28 @@ open MeasureTheory /-- The non-trivial zeros of the Riemann zeta function with imaginary part in `(0, T]`: the zeros lying in the critical strip `0 < re s < 1`, as a set, so without multiplicity. -/ -@[zz_tag "def_Z_T"] +@[expose, zz_tag "def_Z_T"] noncomputable def rescale (T : ℝ) (ρ : ℂ) : ℂ := Complex.I * (ρ - 1 / 2) * ((Real.log T / (2 * Real.pi) : ℝ) : ℂ) /-- The rescaled zeros: the image of the non-trivial zeros up to height `T`. -/ -@[zz_tag "def_Z_T"] +@[expose, zz_tag "def_Z_T"] noncomputable def rescaledZeros (T : ℝ) : Set ℂ := rescale T '' nontrivialZeros T /-- The multiplicity transported along the rescaling: the rescaling is injective, so a rescaled point inherits the multiplicity of the zero it came from. -/ -@[zz_tag "def_Z_T"] +@[expose, zz_tag "def_Z_T"] noncomputable def rescaledMult (T : ℝ) (w : ℂ) : ℕ := zeroMultiplicity (w / (Complex.I * ((Real.log T / (2 * Real.pi) : ℝ) : ℂ)) + 1 / 2) /-- The extremal test function `cos(√2 x) / (√2 sin(1/√2))` on `[-1/2, 1/2]`, zero elsewhere. -/ -@[zz_tag "def_f0"] +@[expose, zz_tag "def_f0"] noncomputable def extremalTest (x : ℝ) : ℝ := if |x| ≤ 1 / 2 then Real.cos (Real.sqrt 2 * x) / (Real.sqrt 2 * Real.sin (1 / Real.sqrt 2)) else 0 /-- The self-convolution of the extremal test function. -/ -@[zz_tag "def_Q0"] +@[expose, zz_tag "def_Q0"] noncomputable def extremalSelfConv (x : ℝ) : ℝ := ∫ t : ℝ, extremalTest t * extremalTest (x - t) /-- `psi` is a `delta`-cutoff: smooth, even, supported in `(-1/2, 1/2)`, valued in `[0, 1]`, and @@ -70,26 +70,26 @@ structure IsCutoff (delta : ℝ) (psi : ℝ → ℝ) : Prop where eq_one : ∀ x, |x| ≤ 1 / 2 - delta → psi x = 1 /-- The normalising constant `A_psi = ∫ psi² f₀`. -/ -@[zz_tag "def_normaliser"] +@[expose, zz_tag "def_normaliser"] noncomputable def cutoffNormaliser (psi : ℝ → ℝ) : ℝ := ∫ x : ℝ, psi x ^ 2 * extremalTest x /-- The normalised test function `eta_psi = psi √f₀ / √A_psi`. -/ -@[zz_tag "def_eta_psi"] +@[expose, zz_tag "def_eta_psi"] noncomputable def cutoffTest (psi : ℝ → ℝ) (x : ℝ) : ℝ := psi x * Real.sqrt (extremalTest x) / Real.sqrt (cutoffNormaliser psi) /-- Its square, `f_psi = eta_psi²`. -/ -@[zz_tag "def_f_psi"] +@[expose, zz_tag "def_f_psi"] noncomputable def cutoffTestSq (psi : ℝ → ℝ) : ℝ → ℝ := cutoffTest psi ^ 2 /-- Its self-convolution, `Q_psi = f_psi ⋆ f_psi`. -/ -@[zz_tag "def_Q_psi"] +@[expose, zz_tag "def_Q_psi"] noncomputable def cutoffSelfConv (psi : ℝ → ℝ) (x : ℝ) : ℝ := ∫ t : ℝ, cutoffTestSq psi t * cutoffTestSq psi (x - t) /-- The corrected test function `r_{psi,T} = Q_psi - Q_psi'' / (4 (log T)²)`, whose Fourier transform carries the factor that cancels the pair-correlation weight. -/ -@[zz_tag "def_r_psi_T"] +@[expose, zz_tag "def_r_psi_T"] noncomputable def correctedTest (psi : ℝ → ℝ) (T : ℝ) (x : ℝ) : ℝ := cutoffSelfConv psi x - iteratedDeriv 2 (cutoffSelfConv psi) x / (4 * Real.log T ^ 2) diff --git a/LeanPool/ZetaZeros/Zeta/Finite.lean b/LeanPool/ZetaZeros/Zeta/Finite.lean index 83c77c8ef2..35826b9d61 100644 --- a/LeanPool/ZetaZeros/Zeta/Finite.lean +++ b/LeanPool/ZetaZeros/Zeta/Finite.lean @@ -20,7 +20,7 @@ It is discharged from Mathlib's `IsCompact.inter_riemannZetaZeros_finite`, since bounded. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Zeta/Kernel.lean b/LeanPool/ZetaZeros/Zeta/Kernel.lean index 8ef0f86008..42d22c9947 100644 --- a/LeanPool/ZetaZeros/Zeta/Kernel.lean +++ b/LeanPool/ZetaZeros/Zeta/Kernel.lean @@ -25,7 +25,7 @@ The cutoff construction packages the unweighted pair sum, proves that the normal admissible, and develops the analytic identities needed to apply pair correlation. -/ -@[expose] public section +public section namespace ZetaZeros @@ -109,7 +109,7 @@ private lemma fourierC_deriv {f : ℝ → ℝ} (hf : ContDiff ℝ (⊤ : ℕ∞) ring /-- The unweighted second moment of the test kernel over ordered pairs of zeta zeros. -/ -noncomputable def unweightedKernelSum (eta : ℝ → ℝ) (T : ℝ) : ℂ := +@[expose] noncomputable def unweightedKernelSum (eta : ℝ → ℝ) (T : ℝ) : ℂ := ∑ᶠ ρ ∈ nontrivialZeros T, ∑ᶠ ρ' ∈ nontrivialZeros T, ((zeroMultiplicity ρ * zeroMultiplicity ρ' : ℕ) : ℂ) * testKernel eta (rescaledDiff T ρ ρ') ^ 2 diff --git a/LeanPool/ZetaZeros/Zeta/Mass.lean b/LeanPool/ZetaZeros/Zeta/Mass.lean index 9fbfd7182e..599e4974ba 100644 --- a/LeanPool/ZetaZeros/Zeta/Mass.lean +++ b/LeanPool/ZetaZeros/Zeta/Mass.lean @@ -20,7 +20,7 @@ The constant `√2 sin(1/√2)` in the denominator of `f₀` is exactly what the `x ↦ √2 x` produces, which is why the mass comes out at one on the nose. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Zeta/OrderConj.lean b/LeanPool/ZetaZeros/Zeta/OrderConj.lean index 1b7ef4eaae..9bf00e93c3 100644 --- a/LeanPool/ZetaZeros/Zeta/OrderConj.lean +++ b/LeanPool/ZetaZeros/Zeta/OrderConj.lean @@ -23,7 +23,7 @@ The three private lemmas below are adapted, with thanks, from they support the same statement for that project's own order function. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Zeta/Proportion.lean b/LeanPool/ZetaZeros/Zeta/Proportion.lean index b554dcb1b2..143f95672c 100644 --- a/LeanPool/ZetaZeros/Zeta/Proportion.lean +++ b/LeanPool/ZetaZeros/Zeta/Proportion.lean @@ -17,7 +17,7 @@ Once the zero count and kernel energy have their required normalized limits, the inequalities turn into the claimed eventual proportion bounds. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZetaZeros/Zeta/Transfer.lean b/LeanPool/ZetaZeros/Zeta/Transfer.lean index f1d2699e9c..ad70ea593b 100644 --- a/LeanPool/ZetaZeros/Zeta/Transfer.lean +++ b/LeanPool/ZetaZeros/Zeta/Transfer.lean @@ -20,7 +20,7 @@ with the canonical sum over zeros, and the transfer of the two abstract finite-s the three zero-counting functions. -/ -@[expose] public section +public section namespace ZetaZeros diff --git a/LeanPool/ZhangYeungInequality.lean b/LeanPool/ZhangYeungInequality.lean index 6913863571..5d78cb530c 100644 --- a/LeanPool/ZhangYeungInequality.lean +++ b/LeanPool/ZhangYeungInequality.lean @@ -26,4 +26,4 @@ Tags: information-theory, entropy, non-shannon-inequality MSC: 94A17, 94A15 -/ -@[expose] public section +public section diff --git a/LeanPool/ZhangYeungInequality/CopyLemma.lean b/LeanPool/ZhangYeungInequality/CopyLemma.lean index c774d310e0..2d78526dfd 100644 --- a/LeanPool/ZhangYeungInequality/CopyLemma.lean +++ b/LeanPool/ZhangYeungInequality/CopyLemma.lean @@ -115,7 +115,7 @@ Shannon entropy, conditional mutual information, copy lemma, conditional indepen Zhang-Yeung -/ -@[expose] public section +public section namespace ZhangYeung diff --git a/LeanPool/ZhangYeungInequality/Delta.lean b/LeanPool/ZhangYeungInequality/Delta.lean index 5d5ddbc22c..a3b6fd11ac 100644 --- a/LeanPool/ZhangYeungInequality/Delta.lean +++ b/LeanPool/ZhangYeungInequality/Delta.lean @@ -93,7 +93,7 @@ for this module. Shannon entropy, mutual information, non-Shannon information inequality, Zhang-Yeung -/ -@[expose] public section +public section namespace ZhangYeung @@ -123,7 +123,7 @@ noncomputable def delta lemma delta_def (Z : Ω → S₁) (U : Ω → S₂) (X : Ω → S₃) (Y : Ω → S₄) (μ : Measure Ω) : delta Z U X Y μ - = I[Z : U; μ] - I[Z : U | X; μ] - I[Z : U | Y; μ] := rfl + = I[Z : U; μ] - I[Z : U | X; μ] - I[Z : U | Y; μ] := by rfl /-- Swapping the two conditioning arguments leaves `delta` unchanged. -/ lemma delta_comm_cond (Z : Ω → S₁) (U : Ω → S₂) (X : Ω → S₃) (Y : Ω diff --git a/LeanPool/ZhangYeungInequality/EntropyRegion.lean b/LeanPool/ZhangYeungInequality/EntropyRegion.lean index 4fb2b02c8b..5c4014fcc6 100644 --- a/LeanPool/ZhangYeungInequality/EntropyRegion.lean +++ b/LeanPool/ZhangYeungInequality/EntropyRegion.lean @@ -21,7 +21,7 @@ map from `Fin n` down to the first four coordinates. Witness-specific `Fin n` le witness and its cone membership / violation) live in `ZhangYeung.Theorem4`. -/ -@[expose] public section +public section namespace ZhangYeung @@ -31,25 +31,25 @@ open scoped Topology universe u /-- `IF` generalized to `Finset (Fin n)`. -/ -def IFN {n : ℕ} (F : Finset (Fin n) → ℝ) (α β : Finset (Fin n)) : ℝ := +@[expose] def IFN {n : ℕ} (F : Finset (Fin n) → ℝ) (α β : Finset (Fin n)) : ℝ := F α + F β - F (α ∪ β) /-- `condIF` generalized to `Finset (Fin n)`. -/ -def condIFN {n : ℕ} (F : Finset (Fin n) → ℝ) (α β γ : Finset (Fin n)) : ℝ := +@[expose] def condIFN {n : ℕ} (F : Finset (Fin n) → ℝ) (α β γ : Finset (Fin n)) : ℝ := F (α ∪ γ) + F (β ∪ γ) - F (α ∪ β ∪ γ) - F γ /-- `deltaF` generalized to `Finset (Fin n)`. -/ -def deltaFN {n : ℕ} (F : Finset (Fin n) → ℝ) (i j k l : Fin n) : ℝ := +@[expose] def deltaFN {n : ℕ} (F : Finset (Fin n) → ℝ) (i j k l : Fin n) : ℝ := IFN F {i} {j} - condIFN F {i} {j} {k} - condIFN F {i} {j} {l} /-- `Γ_n` (paper eq. 11) as a predicate on `Finset (Fin n) → ℝ`. -/ -def shannonConeN {n : ℕ} (F : Finset (Fin n) → ℝ) : Prop := +@[expose] def shannonConeN {n : ℕ} (F : Finset (Fin n) → ℝ) : Prop := F ∅ = 0 ∧ (∀ α β : Finset (Fin n), α ⊆ β → F α ≤ F β) ∧ (∀ α β : Finset (Fin n), F (α ∪ β) + F (α ∩ β) ≤ F α + F β) /-- The Zhang-Yeung inequality at a 4-tuple labeling over `Fin n`. -/ -def zhangYeungAtN {n : ℕ} (F : Finset (Fin n) → ℝ) (i j k l : Fin n) : Prop := +@[expose] def zhangYeungAtN {n : ℕ} (F : Finset (Fin n) → ℝ) (i j k l : Fin n) : Prop := deltaFN F i j k l ≤ (1 / 2) * (IFN F {k} {l} + IFN F {k} ({i} ∪ {j}) + condIFN F {i} {j} {k} - condIFN F {i} {j} {l}) @@ -71,7 +71,7 @@ the test module); the quantifier shapes of `zhangYeungHoldsN` and `zhangYeungHol differ, so their equivalence at `n = 4` is extensional rather than definitional. -/ -def zhangYeungHoldsN {n : ℕ} (F : Finset (Fin n) → ℝ) : Prop := +@[expose] def zhangYeungHoldsN {n : ℕ} (F : Finset (Fin n) → ℝ) : Prop := ∀ i j k l : Fin n, i ≠ j → i ≠ k → i ≠ l → j ≠ k → j ≠ l → k ≠ l → zhangYeungAtN F i j k l @@ -80,7 +80,7 @@ The entropy function of an `n`-variable random-variable family `X : ∀ i : Fin i`, expressed as a set function on `Finset (Fin n)`. -/ -noncomputable def entropyFnN +@[expose] noncomputable def entropyFnN {Ω : Type*} [MeasurableSpace Ω] {n : ℕ} {S : Fin n → Type u} [∀ i, MeasurableSpace (S i)] @@ -103,7 +103,7 @@ noncomputable abbrev entropyFn The Shannon outer bound `Γ_n`, packaged as a set. Membership is definitionally `shannonConeN`. -/ -def shannonRegionN (n : ℕ) : Set (Finset (Fin n) → ℝ) := +@[expose] def shannonRegionN (n : ℕ) : Set (Finset (Fin n) → ℝ) := {F | shannonConeN F} /-- @@ -113,7 +113,7 @@ variables. The quantified probability space and codomain family range over the a universe `u`, so a `Type u` realization is literally a member of the set. -/ -def entropyRegionN (n : ℕ) : Set (Finset (Fin n) → ℝ) := +@[expose] def entropyRegionN (n : ℕ) : Set (Finset (Fin n) → ℝ) := {F | ∃ (Ω : Type u) (_ : MeasurableSpace Ω) (μ : Measure Ω) (_ : IsProbabilityMeasure μ) (S : Fin n → Type u) (_ : ∀ i, MeasurableSpace (S i)) (_ : ∀ i, Fintype (S i)) (_ : ∀ i, MeasurableSingletonClass (S i)) @@ -126,11 +126,11 @@ The almost-entropic region `closure (Γ_n^*)`. Inherits the universe parameter f witnessed by a `Type u` entropy function (or a limit of such) is literally a member of the set. -/ -def almostEntropicRegionN (n : ℕ) : Set (Finset (Fin n) → ℝ) := +@[expose] def almostEntropicRegionN (n : ℕ) : Set (Finset (Fin n) → ℝ) := closure (entropyRegionN.{u} n) /-- Restrict a set function on `Fin n` to its first four coordinates. -/ -def restrictFirstFour {n : ℕ} (hn : 4 ≤ n) : +@[expose] def restrictFirstFour {n : ℕ} (hn : 4 ≤ n) : (Finset (Fin n) → ℝ) → (Finset (Fin 4) → ℝ) := fun F α => F (α.map (Fin.castLEEmb hn)) diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean index 755cdccb23..c1f28ecd8a 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean @@ -19,7 +19,7 @@ Imported Lean Pool material for `LeanPool.ZhangYeungInequality.PFR.ForMathlib.ConditionalIndependence`. -/ -@[expose] public section +public section open MeasureTheory Measure Set open scoped ENNReal ZhangYeungPFR diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean index 750e5f1978..a06f836d46 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean @@ -44,7 +44,7 @@ and -/ -@[expose] public section +public section open Function MeasureTheory Measure Real open scoped ENNReal NNReal Topology ProbabilityTheory ZhangYeungPFR @@ -66,7 +66,7 @@ def entropy (X : Ω → S) (μ : Measure Ω := by volume_tac) := Hm[μ.map X] @[inherit_doc entropy] notation3:max "H[" X " | " Y " ← " y "]" => entropy X (ℙ[|Y ← y]) /-- Entropy of a random variable agrees with entropy of its distribution. -/ -lemma entropy_def (X : Ω → S) (μ : Measure Ω) : entropy X μ = Hm[μ.map X] := rfl +lemma entropy_def (X : Ω → S) (μ : Measure Ω) : entropy X μ = Hm[μ.map X] := by rfl /-- Entropy of a random variable is also the kernel entropy of the distribution over a Dirac mass. @@ -390,7 +390,7 @@ def _root_.ProbabilityTheory.condEntropy (μ.map Y)[fun y ↦ H[X | Y ← y; μ]] lemma _root_.ProbabilityTheory.condEntropy_def (X : Ω → S) (Y : Ω → T) (μ : Measure Ω) : - condEntropy X Y μ = (μ.map Y)[fun y ↦ H[X | Y ← y; μ]] := rfl + condEntropy X Y μ = (μ.map Y)[fun y ↦ H[X | Y ← y; μ]] := by rfl @[inherit_doc condEntropy] notation3:max "H[" X " | " Y "; " μ "]" => condEntropy X Y μ @[inherit_doc condEntropy] notation3:max "H[" X " | " Y "]" => condEntropy X Y volume @@ -733,7 +733,7 @@ def _root_.ProbabilityTheory.mutualInfo @[inherit_doc mutualInfo] notation3:max "I[" X " : " Y "]" => mutualInfo X Y volume lemma _root_.ProbabilityTheory.mutualInfo_def (X : Ω → S) (Y : Ω → T) (μ : Measure Ω) : - I[X : Y; μ] = H[X; μ] + H[Y; μ] - H[⟨X, Y⟩; μ] := rfl + I[X : Y; μ] = H[X; μ] + H[Y; μ] - H[⟨X, Y⟩; μ] := by rfl lemma _root_.ProbabilityTheory.entropy_add_entropy_sub_mutualInfo (X : Ω → S) (Y : Ω → T) (μ : Measure Ω) : @@ -762,7 +762,7 @@ def _root_.ProbabilityTheory.condMutualInfo lemma _root_.ProbabilityTheory.condMutualInfo_def (X : Ω → S) (Y : Ω → T) (Z : Ω → U) (μ : Measure Ω) : condMutualInfo X Y Z μ = (μ.map Z)[fun z ↦ - H[X | Z ← z; μ] + H[Y | Z ← z; μ] - H[⟨X, Y⟩ | Z ← z; μ]] := rfl + H[X | Z ← z; μ] + H[Y | Z ← z; μ] - H[⟨X, Y⟩ | Z ← z; μ]] := by rfl @[inherit_doc condMutualInfo] notation3:max "I[" X " : " Y "|" Z ";" μ "]" => condMutualInfo X Y Z μ @@ -770,7 +770,7 @@ notation3:max "I[" X " : " Y "|" Z ";" μ "]" => condMutualInfo X Y Z μ notation3:max "I[" X " : " Y "|" Z "]" => condMutualInfo X Y Z volume lemma _root_.ProbabilityTheory.condMutualInfo_eq_integral_mutualInfo : - I[X : Y | Z; μ] = (μ.map Z)[fun z ↦ I[X : Y; μ[| Z ⁻¹' {z}]]] := rfl + I[X : Y | Z; μ] = (μ.map Z)[fun z ↦ I[X : Y; μ[| Z ⁻¹' {z}]]] := by rfl @[simp] lemma _root_.ProbabilityTheory.condMutualInfo_zero_measure : I[X : Y | Z; 0] = 0 := by simp [condMutualInfo] @@ -792,7 +792,7 @@ lemma _root_.ProbabilityTheory.mutualInfo_nonneg rw [Measure.map_map measurable_snd (hX.prodMk hY)] congr rw [h_fst, h_snd] - exact measureMutualInfo_nonneg + simpa only [measureMutualInfo_def] using measureMutualInfo_nonneg /-- Subadditivity of entropy. -/ lemma _root_.ProbabilityTheory.entropy_pair_le_add @@ -814,7 +814,7 @@ lemma _root_.ProbabilityTheory.mutualInfo_eq_zero congr rw [h_fst, h_snd] convert measureMutualInfo_eq_zero_iff (μ := μ.map (⟨X, Y⟩)) using 2 - · exact measureMutualInfo_def _ + · exact (measureMutualInfo_def (μ.map (⟨X, Y⟩))).symm rw [indepFun_iff_map_prod_eq_prod_map_map hX.aemeasurable hY.aemeasurable, Measure.ext_iff_measureReal_singleton_finiteSupport] congr! with p diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean index 3b7b4150e8..e3cd146cf3 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean @@ -32,7 +32,7 @@ import Mathlib.MeasureTheory.Integral.Prod -/ -@[expose] public section +public section open Real MeasureTheory @@ -45,8 +45,7 @@ variable {Ω S T U : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace S] [MeasurableSpace T] [MeasurableSpace U] /-- Entropy of a kernel with respect to a measure. -/ -noncomputable -def entropy (κ : Kernel T S) (μ : Measure T) := μ[fun y ↦ Hm[κ y]] +@[expose] noncomputable def entropy (κ : Kernel T S) (μ : Measure T) := μ[fun y ↦ Hm[κ y]] /-- Entropy of a kernel with respect to a measure. -/ notation3:100 "Hk[" κ " , " μ "]" => ProbabilityTheory.Kernel.entropy κ μ diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/MutualInfo.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/MutualInfo.lean index 93617752c9..5500667528 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/MutualInfo.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/MutualInfo.lean @@ -32,7 +32,7 @@ public import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Kernel.Basic -/ -@[expose] public section +public section open Function MeasureTheory Real open scoped ENNReal NNReal Topology ProbabilityTheory @@ -44,8 +44,7 @@ variable {Ω S T U V : Type*} [mΩ : MeasurableSpace Ω] {κ : Kernel T S} {μ : Measure T} {X : Ω → S} {Y : Ω → U} /-- Mutual information of a kernel into a product space with respect to a measure. -/ -noncomputable -def mutualInfo (κ : Kernel T (S × U)) (μ : Measure T) : ℝ := +@[expose] noncomputable def mutualInfo (κ : Kernel T (S × U)) (μ : Measure T) : ℝ := Hk[fst κ, μ] + Hk[snd κ, μ] - Hk[κ, μ] /-- Mutual information of a kernel into a product space with respect to a measure. -/ @@ -130,7 +129,8 @@ lemma mutualInfo_nonneg' {κ : Kernel T (S × U)} {μ : Measure T} [IsFiniteMeas rw [← Finset.sum_add_distrib, ← Finset.sum_sub_distrib] simp_rw [← mul_add, ← mul_sub, fst_apply, snd_apply] have (x : T) : FiniteSupport (κ x) := ⟨hκ x⟩ - exact Finset.sum_nonneg fun x _ ↦ mul_nonneg ENNReal.toReal_nonneg measureMutualInfo_nonneg + exact Finset.sum_nonneg fun x _ ↦ mul_nonneg ENNReal.toReal_nonneg + (by simpa only [measureMutualInfo_def] using (measureMutualInfo_nonneg (μ := κ x))) lemma mutualInfo_nonneg [Countable T] {κ : Kernel T (S × U)} {μ : Measure T} [IsFiniteMeasure μ] [FiniteSupport μ] (hκ : AEFiniteKernelSupport κ μ) : diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean index aa04588174..eac647ba2c 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean @@ -32,7 +32,7 @@ import LeanPool.ZhangYeungInequality.PFR.Mathlib.Probability.UniformOn -/ -@[expose] public section +public section open MeasureTheory Real Set open scoped ENNReal NNReal Topology @@ -557,7 +557,7 @@ def _root_.ProbabilityTheory.measureMutualInfo (μ : Measure (S × T) := by volu notation:100 "Im[" μ "]" => measureMutualInfo μ lemma _root_.ProbabilityTheory.measureMutualInfo_def (μ : Measure (S × T)) : - Im[μ] = Hm[μ.map Prod.fst] + Hm[μ.map Prod.snd] - Hm[μ] := rfl + Im[μ] = Hm[μ.map Prod.fst] + Hm[μ.map Prod.snd] - Hm[μ] := by rfl @[simp] lemma _root_.ProbabilityTheory.measureMutualInfo_zero_measure : Im[(0 : Measure (S × T))] = 0 := by diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean index 0dec4724b4..5a0316da53 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean @@ -14,7 +14,7 @@ public import Mathlib.MeasureTheory.Measure.Map Imported Lean Pool material for `LeanPool.ZhangYeungInequality.PFR.ForMathlib.FiniteRange.Defs`. -/ -@[expose] public section +public section /-- The property of having a finite range. -/ class FiniteRange {Ω G : Type*} (X : Ω → G) : Prop where @@ -25,7 +25,7 @@ noncomputable abbrev FiniteRange.fintype {Ω G : Type*} (X : Ω → G) [hX : Fin Fintype (Set.range X) := hX.finite.fintype /-- The range of a finite range map, as a finset. -/ -noncomputable def FiniteRange.toFinset {Ω G : Type*} (X : Ω +@[expose] noncomputable def FiniteRange.toFinset {Ω G : Type*} (X : Ω → G) [hX : FiniteRange X] : Finset G := @Set.toFinset _ _ hX.fintype diff --git a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean index 74dd448380..c38021e21e 100644 --- a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean +++ b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean @@ -20,7 +20,7 @@ where -/ -@[expose] public section +public section open Real MeasureTheory Measure ProbabilityTheory open scoped ENNReal NNReal Topology ProbabilityTheory @@ -583,14 +583,14 @@ lemma compProd_congr_ae {μ} [SFinite μ] {κ κ' : rw [hb] /-- The analogue of FiniteSupport for probability kernels. -/ -noncomputable def FiniteKernelSupport (κ : Kernel T S) : Prop := +@[expose] noncomputable def FiniteKernelSupport (κ : Kernel T S) : Prop := ∀ t, ∃ A : Finset S, κ t Aᶜ = 0 /-- A kernel `κ` has almost everywhere finite support wrt a measure `μ` if, for almost every point `t`, then `κ t` has finite support. Note that we don't require any uniformity wrt `t`. -/ -noncomputable def AEFiniteKernelSupport (κ : Kernel T S) (μ : Measure T) : Prop := +@[expose] noncomputable def AEFiniteKernelSupport (κ : Kernel T S) (μ : Measure T) : Prop := ∀ᵐ t ∂μ, ∃ A : Finset S, κ t Aᶜ = 0 lemma _root_.ProbabilityTheory.Kernel.FiniteKernelSupport.aefiniteKernelSupport diff --git a/LeanPool/ZhangYeungInequality/Prelude.lean b/LeanPool/ZhangYeungInequality/Prelude.lean index 2cfbd0f3b7..37527bd243 100644 --- a/LeanPool/ZhangYeungInequality/Prelude.lean +++ b/LeanPool/ZhangYeungInequality/Prelude.lean @@ -19,7 +19,7 @@ public import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Prelude`. -/ -@[expose] public section +public section open MeasureTheory ProbabilityTheory open scoped ZhangYeungPFR diff --git a/LeanPool/ZhangYeungInequality/Test.lean b/LeanPool/ZhangYeungInequality/Test.lean index 890358ee37..a4c4f54b51 100644 --- a/LeanPool/ZhangYeungInequality/Test.lean +++ b/LeanPool/ZhangYeungInequality/Test.lean @@ -22,4 +22,4 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Measure Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test`. -/ -@[expose] public section +public section diff --git a/LeanPool/ZhangYeungInequality/Test/CopyLemma.lean b/LeanPool/ZhangYeungInequality/Test/CopyLemma.lean index 2081ce57cc..fce7e3e5f3 100644 --- a/LeanPool/ZhangYeungInequality/Test/CopyLemma.lean +++ b/LeanPool/ZhangYeungInequality/Test/CopyLemma.lean @@ -17,7 +17,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.CopyLemma`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Test/Delta.lean b/LeanPool/ZhangYeungInequality/Test/Delta.lean index 574a42c130..e0a96a8f64 100644 --- a/LeanPool/ZhangYeungInequality/Test/Delta.lean +++ b/LeanPool/ZhangYeungInequality/Test/Delta.lean @@ -17,7 +17,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.Delta`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Test/EntropyRegion.lean b/LeanPool/ZhangYeungInequality/Test/EntropyRegion.lean index a6fa0c227c..7e3bbed609 100644 --- a/LeanPool/ZhangYeungInequality/Test/EntropyRegion.lean +++ b/LeanPool/ZhangYeungInequality/Test/EntropyRegion.lean @@ -17,7 +17,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.EntropyRegion`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Test/Theorem2.lean b/LeanPool/ZhangYeungInequality/Test/Theorem2.lean index a8d3e6fe84..be6fb1ef97 100644 --- a/LeanPool/ZhangYeungInequality/Test/Theorem2.lean +++ b/LeanPool/ZhangYeungInequality/Test/Theorem2.lean @@ -17,7 +17,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.Theorem2`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Test/Theorem3.lean b/LeanPool/ZhangYeungInequality/Test/Theorem3.lean index bfc7e8e240..37081d03cb 100644 --- a/LeanPool/ZhangYeungInequality/Test/Theorem3.lean +++ b/LeanPool/ZhangYeungInequality/Test/Theorem3.lean @@ -17,7 +17,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.Theorem3`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Test/Theorem4.lean b/LeanPool/ZhangYeungInequality/Test/Theorem4.lean index baaa331211..f194776874 100644 --- a/LeanPool/ZhangYeungInequality/Test/Theorem4.lean +++ b/LeanPool/ZhangYeungInequality/Test/Theorem4.lean @@ -15,7 +15,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Measure Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.Theorem4`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Test/Theorem5.lean b/LeanPool/ZhangYeungInequality/Test/Theorem5.lean index f10f6ff103..7ddd0c2264 100644 --- a/LeanPool/ZhangYeungInequality/Test/Theorem5.lean +++ b/LeanPool/ZhangYeungInequality/Test/Theorem5.lean @@ -18,7 +18,7 @@ import LeanPool.ZhangYeungInequality.PFR.ForMathlib.Entropy.Basic Imported Lean Pool material for `LeanPool.ZhangYeungInequality.Test.Theorem5`. -/ -@[expose] public section +public section namespace ZhangYeungTest diff --git a/LeanPool/ZhangYeungInequality/Theorem2.lean b/LeanPool/ZhangYeungInequality/Theorem2.lean index bf45e12afd..d0c4dba34d 100644 --- a/LeanPool/ZhangYeungInequality/Theorem2.lean +++ b/LeanPool/ZhangYeungInequality/Theorem2.lean @@ -172,7 +172,7 @@ Shannon entropy, conditional mutual information, conditional information inequal Kullback-Leibler divergence, Zhang-Yeung, essentially conditional inequality -/ -@[expose] public section +public section namespace ZhangYeung @@ -922,7 +922,8 @@ private lemma condIndepFun_map_triple_real_singleton have h_cancel : μ (h ⁻¹' {c}) * (μ (h ⁻¹' {c}))⁻¹ = 1 := ENNReal.mul_inv_cancel h_h_pre_ne h_h_pre_top -- Extract IndepFun on the conditional. - have h_cond' : ∀ᵐ z ∂(μ.map h), IndepFun f g (μ[|h ← z]) := h_cond + have h_cond' : ∀ᵐ z ∂(μ.map h), IndepFun f g (μ[|h ← z]) := + condIndepFun_iff.mp h_cond rw [ae_iff_of_countable] at h_cond' have h_indep : IndepFun f g (μ[|h ← c]) := h_cond' c h_map_c_ne have h_prod_cond : (μ[|h ← c]) (f ⁻¹' {a} ∩ g ⁻¹' {b}) diff --git a/LeanPool/ZhangYeungInequality/Theorem3.lean b/LeanPool/ZhangYeungInequality/Theorem3.lean index 533902a89d..45c7dfb399 100644 --- a/LeanPool/ZhangYeungInequality/Theorem3.lean +++ b/LeanPool/ZhangYeungInequality/Theorem3.lean @@ -87,7 +87,7 @@ data processing -/ -@[expose] public section +public section namespace ZhangYeung diff --git a/LeanPool/ZhangYeungInequality/Theorem4.lean b/LeanPool/ZhangYeungInequality/Theorem4.lean index 68b7aec8db..bd1df593cb 100644 --- a/LeanPool/ZhangYeungInequality/Theorem4.lean +++ b/LeanPool/ZhangYeungInequality/Theorem4.lean @@ -152,7 +152,7 @@ incompleteness, entropic region -/ -@[expose] public section +public section namespace ZhangYeung @@ -175,7 +175,7 @@ entropy function of a discrete random-variable family (with `F ∅ = 0`), this coincides with `I[X_α : X_β]`. -/ -def IF (F : Finset (Fin 4) → ℝ) (α β : Finset (Fin 4)) : ℝ := +@[expose] def IF (F : Finset (Fin 4) → ℝ) (α β : Finset (Fin 4)) : ℝ := F α + F β - F (α ∪ β) /-- @@ -185,7 +185,7 @@ Set-function conditional mutual information: `condIF(α; β | γ) = F (α ∪ γ coincides with `I[X_α : X_β | X_γ]`. -/ -def condIF (F : Finset (Fin 4) → ℝ) (α β γ : Finset (Fin 4)) : ℝ := +@[expose] def condIF (F : Finset (Fin 4) → ℝ) (α β γ : Finset (Fin 4)) : ℝ := F (α ∪ γ) + F (β ∪ γ) - F (α ∪ β ∪ γ) - F γ /-- @@ -195,7 +195,7 @@ condIF({i}; {j} | {k}) - condIF({i}; {j} | {l})`. Mirrors `ZhangYeung.delta` at set-function level. -/ -def deltaF (F : Finset (Fin 4) → ℝ) (i j k l : Fin 4) : ℝ := +@[expose] def deltaF (F : Finset (Fin 4) → ℝ) (i j k l : Fin 4) : ℝ := IF F {i} {j} - condIF F {i} {j} {k} - condIF F {i} {j} {l} /-! ### Shannon and Zhang-Yeung cone predicates -/ @@ -205,7 +205,7 @@ The Shannon outer bound `Γ_4` from [@zhangyeung1998, eq. 11]: a set function li `Γ_4` iff it vanishes on the empty set, is monotone under subset inclusion, and is submodular. -/ -def shannonCone (F : Finset (Fin 4) → ℝ) : Prop := +@[expose] def shannonCone (F : Finset (Fin 4) → ℝ) : Prop := F ∅ = 0 ∧ (∀ α β : Finset (Fin 4), α ⊆ β → F α ≤ F β) ∧ (∀ α β : Finset (Fin 4), F (α ∪ β) + F (α ∩ β) ≤ F α + F β) @@ -217,7 +217,7 @@ def shannonCone (F : Finset (Fin 4) → ℝ) : Prop := condIF F {i} {j} {l})`. This is the set-function-level restatement of `ZhangYeung.zhangYeung`. -/ -def zhangYeungAt (F : Finset (Fin 4) → ℝ) (i j k l : Fin 4) : Prop := +@[expose] def zhangYeungAt (F : Finset (Fin 4) → ℝ) (i j k l : Fin 4) : Prop := deltaF F i j k l ≤ (1 / 2) * (IF F {k} {l} + IF F {k} ({i} ∪ {j}) + condIF F {i} {j} {k} - condIF F {i} {j} {l}) @@ -227,7 +227,7 @@ in `tildeΓ_4` iff `zhangYeungAt F (π 0) (π 1) (π 2) (π 3)` holds at every permutation `π` of `Fin 4`. -/ -def zhangYeungHolds (F : Finset (Fin 4) → ℝ) : Prop := +@[expose] def zhangYeungHolds (F : Finset (Fin 4) → ℝ) : Prop := ∀ π : Equiv.Perm (Fin 4), zhangYeungAt F (π 0) (π 1) (π 2) (π 3) /-! ### The paper's `n = 4` counterexample witness @@ -252,7 +252,7 @@ to `a = Living over `ℚ` so the witness arithmetic stays exact before the final cast to `ℝ`. -/ -def FWitnessℚ : Finset (Fin 4) → ℚ := fun S => +@[expose] def FWitnessℚ : Finset (Fin 4) → ℚ := fun S => if S.card = 0 then 0 else if S.card = 1 then 2 else if S = ({0, 1} : Finset (Fin 4)) then 4 @@ -264,7 +264,7 @@ The `ℝ`-cast of `FWitnessℚ`, used in the main statements `shannonCone_of_wit `not_zhangYeungHolds_witness`, `shannon_incomplete`, `theorem4_finite`, `theorem4`, and `theorem4_ge_four`. -/ -noncomputable def FWitness : Finset (Fin 4) → ℝ := fun S => (FWitnessℚ S : ℝ) +@[expose] noncomputable def FWitness : Finset (Fin 4) → ℝ := fun S => (FWitnessℚ S : ℝ) /-- Definitional-shape lemma: `FWitness` is the pointwise `ℚ → ℝ` cast of `FWitnessℚ`. diff --git a/LeanPool/ZhangYeungInequality/Theorem5.lean b/LeanPool/ZhangYeungInequality/Theorem5.lean index b531747222..e7a0cb8370 100644 --- a/LeanPool/ZhangYeungInequality/Theorem5.lean +++ b/LeanPool/ZhangYeungInequality/Theorem5.lean @@ -54,7 +54,7 @@ conditional independence -/ -@[expose] public section +public section namespace ZhangYeung